| | |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * 自定义Realm,处理认证和权限 |
| | |
| | | if(user == null){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"对不起,账号或密码不正确!"); |
| | | } |
| | | if(Objects.equals(user.getStatus(),Constants.ONE)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"用户已被禁用,请联系管理员"); |
| | | } |
| | | // 获取登录用户信息 |
| | | List<SystemRole> roles = systemRoleService.findByUserId(user.getId()); |
| | | List<SystemPermission> permissions = systemPermissionService.findByUserId(user.getId()); |
| | |
| | | import com.doumee.service.system.SystemPositionUserService; |
| | | import com.doumee.service.system.SystemUserRoleService; |
| | | import com.doumee.service.system.SystemUserService; |
| | | import com.google.common.base.Objects; |
| | | import org.apache.commons.lang3.RandomStringUtils; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.apache.shiro.SecurityUtils; |
| | |
| | | queryUserDto.setUsername(systemUser.getMobile()); |
| | | SystemUser user = systemUserService.findOne(queryUserDto); |
| | | if (user != null) { |
| | | throw new BusinessException(ResponseStatus.DATA_EXISTS.getCode(), "用户名已存在"); |
| | | throw new BusinessException(ResponseStatus.DATA_EXISTS.getCode(), "手机号码已存在"); |
| | | } |
| | | // 验证工号 |
| | | if (StringUtils.isNotBlank(systemUser.getEmpNo())) { |
| | |
| | | public void updateById(CreateSystemUserDTO systemUser) { |
| | | // 验证用户名 |
| | | SystemUser queryUserDto = new SystemUser(); |
| | | queryUserDto.setId(systemUser.getId()); |
| | | queryUserDto.setUsername(systemUser.getUsername()); |
| | | queryUserDto.setDeleted(Constants.ZERO); |
| | | SystemUser user = systemUserService.findOne(queryUserDto); |
| | |
| | | throw new BusinessException(ResponseStatus.DATA_EXISTS.getCode(), "工号已存在"); |
| | | } |
| | | } |
| | | if ("admin".equals(user.getUsername()) && Objects.equal(systemUser.getStatus(),1)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EXISTS.getCode(), "超级管理员账号不允许禁用"); |
| | | } |
| | | // 修改用户 |
| | | systemUserService.updateById(systemUser); |
| | | // 设置部门 |
| | |
| | | @Transactional(rollbackFor = {Exception.class,BusinessException.class}) |
| | | @Override |
| | | public void closeGoodsorder( Goodsorder goodsorder ,int type ) { |
| | | |
| | | LoginUserInfo principal = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); |
| | | List<MemberRides> memberRides = getMemberRidesForClose(goodsorder.getId()); |
| | | //默认结算为押金金额 |
| | | BigDecimal closeMoney = new BigDecimal(0.00); |
| | |
| | | refundDTO.setTotalAmount(goodsorder.getMoney()); |
| | | refundDTO.setMemberId(goodsorder.getMemberId()); |
| | | refundDTO.setReason(Constants.REFUND_TYPE.get(type).getName()); |
| | | refundDTO.setCreator(principal.getId()); |
| | | refundDTO.setType(type); |
| | | Refund refund = wxMiniUtilService.wxRefund(refundDTO); |
| | | update.setCloseId(refund.getId()); |
| | |
| | | BigDecimal refundMoney = total == null?new BigDecimal(0):Constants.formatDecimalNum(total.getMoney()); |
| | | //可退剩余 单位元 |
| | | BigDecimal canBalance =Constants.translateMoney(Constants.formatDecimalNum(goodsorder.getMoney()).subtract(refundMoney)); |
| | | if(canBalance.compareTo(money) > Constants.ZERO){ |
| | | if(canBalance.compareTo(money) >= Constants.ZERO){ |
| | | RefundDTO refundDTO = new RefundDTO(); |
| | | refundDTO.setOrderId(orderId); |
| | | refundDTO.setCanBalance(canBalance); |
| | |
| | | BigDecimal reduce = total!=null?Constants.formatDecimalNum(total.getMoney()):new BigDecimal(0); |
| | | goodsorderCanBanlanceDTO.setHasRefundMoney(Constants.translateMoney(reduce)); |
| | | |
| | | BigDecimal subtract = Constants.translateMoney(goodsorder.getMoney()).subtract(goodsorderCanBanlanceDTO.getCloseMoney()).subtract(goodsorderCanBanlanceDTO.getHasRefundMoney()); |
| | | BigDecimal subtract = Constants.translateMoney(goodsorder.getMoney()).subtract(goodsorderCanBanlanceDTO.getHasRefundMoney()); |
| | | goodsorderCanBanlanceDTO.setCanBanlanceMoney(subtract.compareTo(new BigDecimal("0")) > 0 ? subtract : new BigDecimal("0")); |
| | | return goodsorderCanBanlanceDTO; |
| | | } |
| | |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"该定价方案下没有配置价格"); |
| | | } |
| | | List<String> collect = pricingDetails.stream().map(s -> s.getBikeTypeId()).collect(Collectors.toList()); |
| | | boolean b = baseParams.stream().map(s -> s.getId()).anyMatch(s -> collect.contains(s)); |
| | | boolean b = baseParams.stream().map(s -> s.getId()).allMatch(s -> collect.contains(s)); |
| | | |
| | | if (b){ |
| | | if (!b){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"该定价方案下没有配置完整"); |
| | | } |
| | | PricingParam pricingParam1 = new PricingParam(); |
| | |
| | | String jasonStr = MiniProgrammeDTO.toUnderlineJSONString(miniProgrammeDTO); |
| | | JSONObject parse = (JSONObject) JSONObject.parse(jasonStr); |
| | | parse.entrySet().forEach(s->{ |
| | | if (StringUtils.isNotBlank((String)s.getValue())){ |
| | | // if (StringUtils.isNotBlank((String)s.getValue())){ |
| | | UpdateWrapper<SystemDictData> wrapper = new UpdateWrapper<>(); |
| | | wrapper.lambda() |
| | | .eq(SystemDictData::getLabel,s.getKey().toUpperCase()) |
| | | .set(SystemDictData::getCode,s.getValue()); |
| | | systemDictDataMapper.update(null,wrapper); |
| | | } |
| | | // } |
| | | }); |
| | | } catch (JsonProcessingException e) { |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"字典值解析有误"); |
| | |
| | | select |
| | | distinct |
| | | usr.id, usr.birthday, usr.email, usr.emp_no, usr.mobile, usr.avatar, usr.username, usr.realname, usr.sex, usr.fixed, usr.create_time, usr.update_time, |
| | | usr.nickname, |
| | | usr.nickname,usr.status, |
| | | create_user.id create_user_id, create_user.username create_user_name, |
| | | update_user.id updete_user_id, update_user.username update_user_name |
| | | from "system_user" usr |