| | |
| | | |
| | | |
| | | @Override |
| | | public List<CompensationVO> getCompensation(Integer id){ |
| | | SettleClaims settleClaims = settleClaimsMapper.selectById(id); |
| | | public List<CompensationVO> getCompensation(CompensationFeeDTO compensationFeeDTO){ |
| | | if(Objects.isNull(compensationFeeDTO) |
| | | || Objects.isNull(compensationFeeDTO.getType()) |
| | | ){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | } |
| | | SettleClaims settleClaims = null; |
| | | if(Objects.nonNull(compensationFeeDTO.getId())){ |
| | | settleClaims = settleClaimsMapper.selectById(compensationFeeDTO.getId()); |
| | | } |
| | | List<CompensationVO> modelList = new ArrayList<>(); |
| | | if (Objects.nonNull(settleClaims)&&StringUtils.isNotBlank(settleClaims.getAccountContent())) { |
| | | modelList = JSONArray.parseArray(settleClaims.getAccountContent(),CompensationVO.class); |
| | | if (Objects.nonNull(settleClaims)) { |
| | | if(Constants.equalsInteger(compensationFeeDTO.getType(),Constants.ONE)&&StringUtils.isNotBlank(settleClaims.getAccountContent())){ |
| | | modelList = JSONArray.parseArray(settleClaims.getAccountContent(),CompensationVO.class); |
| | | }else if(Constants.equalsInteger(compensationFeeDTO.getType(),Constants.TWO)&&StringUtils.isNotBlank(settleClaims.getHpAccountContent())){ |
| | | modelList = JSONArray.parseArray(settleClaims.getHpAccountContent(),CompensationVO.class); |
| | | } |
| | | } |
| | | Constants.compensation [] compensations = Constants.compensation.values(); |
| | | List<CompensationVO> list = new ArrayList<>(); |
| | |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"对ä¸èµ·ï¼ä¸å¡ç¶æå·²æµè½¬~"); |
| | | } |
| | | |
| | | List<CompensationVO> modelList = JSONArray.parseArray(settleClaims.getAccountContent(),CompensationVO.class); |
| | | List<CompensationVO> modelList = JSONArray.parseArray(dto.getCompensationJson(),CompensationVO.class); |
| | | |
| | | SettleClaims update = new SettleClaims(); |
| | | update.setEditDate(new Date()); |
| | |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"对ä¸èµ·ï¼ä¸å¡ç¶æå·²æµè½¬~"); |
| | | } |
| | | |
| | | List<CompensationVO> modelList = JSONArray.parseArray(settleClaims.getAccountContent(),CompensationVO.class); |
| | | |
| | | List<CompensationVO> modelList = JSONArray.parseArray(dto.getCompensationJson(),CompensationVO.class); |
| | | |
| | | SettleClaims update = new SettleClaims(); |
| | | update.setEditDate(new Date()); |
| | | update.setEditor(loginUserInfo.getId()); |
| | | update.setYlClaimAccount(modelList.stream().filter(i->Constants.equalsInteger(i.getType(),Constants.ONE)&&i.getName().equals(Constants.compensation.YL_COMPENSATION.getName())).map(i->i.getFee()).reduce(BigDecimal.ZERO,BigDecimal::add)); |
| | | update.setWgClaimAccount(modelList.stream().filter(i->Constants.equalsInteger(i.getType(),Constants.ONE)&&i.getName().equals(Constants.compensation.WG_COMPENSATION.getName())).map(i->i.getFee()).reduce(BigDecimal.ZERO,BigDecimal::add)); |
| | | update.setScClaimAccount(modelList.stream().filter(i->Constants.equalsInteger(i.getType(),Constants.ONE)&&i.getName().equals(Constants.compensation.SC_COMPENSATION.getName())).map(i->i.getFee()).reduce(BigDecimal.ZERO,BigDecimal::add)); |
| | | update.setSwClaimAccount(modelList.stream().filter(i->Constants.equalsInteger(i.getType(),Constants.ONE)&&i.getName().equals(Constants.compensation.SW_COMPENSATION.getName())).map(i->i.getFee()).reduce(BigDecimal.ZERO,BigDecimal::add)); |
| | | update.setClaimAccount(modelList.stream().filter(i->Constants.equalsInteger(i.getType(),Constants.ONE)).map(i->i.getFee()).reduce(BigDecimal.ZERO,BigDecimal::add)); |
| | | update.setOtherAccount(modelList.stream().filter(i->Constants.equalsInteger(i.getType(),Constants.TWO)).map(i->i.getFee()).reduce(BigDecimal.ZERO,BigDecimal::add)); |
| | | update.setAccountContent(dto.getCompensationJson()); |
| | | update.setHpAccountContent(dto.getCompensationJson()); |
| | | update.setHpAccount(modelList.stream().map(i->i.getFee()).reduce(BigDecimal.ZERO,BigDecimal::add)); |
| | | update.setId(settleClaims.getId()); |
| | | update.setStatus(Constants.SettleClaimsStatus.COMPENSATION.getKey()); |
| | | settleClaimsMapper.updateById(update); |
| | |
| | | update.setSwClaimAccount(modelList.stream().filter(i->Constants.equalsInteger(i.getType(),Constants.ONE)&&i.getName().equals(Constants.compensation.SW_COMPENSATION.getName())).map(i->i.getFee()).reduce(BigDecimal.ZERO,BigDecimal::add)); |
| | | update.setClaimAccount(modelList.stream().filter(i->Constants.equalsInteger(i.getType(),Constants.ONE)).map(i->i.getFee()).reduce(BigDecimal.ZERO,BigDecimal::add)); |
| | | //å¤çå岿°æ® |
| | | List<CompensationVO> oldList = JSONArray.parseArray(settleClaims.getAccountContent(),CompensationVO.class); |
| | | List<CompensationVO> oldList = JSONArray.parseArray(settleClaims.getHpAccountContent(),CompensationVO.class); |
| | | for (CompensationVO compensationVO:oldList) { |
| | | if(compensationVO.getName().equals(Constants.compensation.YL_COMPENSATION.getName())){ |
| | | compensationVO.setFee(update.getYlClaimAccount()); |
| | |
| | | continue; |
| | | } |
| | | } |
| | | update.setAccountContent(dto.getCompensationJson()); |
| | | update.setAccountContent(JSONArray.toJSONString(oldList)); |
| | | update.setId(settleClaims.getId()); |
| | | settleClaimsMapper.updateById(update); |
| | |
| | | } |
| | | |
| | | |
| | | // @Override |
| | | // @Transactional(rollbackFor = {BusinessException.class,Exception.class}) |
| | | // public void payCash(PayCashDTO dto){ |
| | | // if(Objects.isNull(dto) |
| | | // || Objects.isNull(dto.getId()) |
| | | // || StringUtils.isBlank(dto.getDescribe()) |
| | | // ){ |
| | | // throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | // } |
| | | // LoginUserInfo loginUserInfo = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); |
| | | // if(!loginUserInfo.getType().equals(Constants.ZERO)){ |
| | | // throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"é管çåæ æ³è¿è¡è¯¥æä½"); |
| | | // } |
| | | // SettleClaims settleClaims = settleClaimsJoinMapper.selectById(dto.getId()); |
| | | // if(Objects.isNull(settleClaims)){ |
| | | // throw new BusinessException(ResponseStatus.DATA_EMPTY); |
| | | // } |
| | | // if(!Constants.equalsInteger(Constants.SettleClaimsStatus.COMPENSATION.getKey(),settleClaims.getStatus())){ |
| | | // throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"对ä¸èµ·ï¼ä¸å¡ç¶æå·²æµè½¬~"); |
| | | // } |
| | | // SettleClaims update = new SettleClaims(); |
| | | // update.setEditDate(new Date()); |
| | | // update.setEditor(loginUserInfo.getId()); |
| | | // update.setStatus(Constants.SettleClaimsStatus.WAIT_DEAL.getKey()); |
| | | // update.setId(settleClaims.getId()); |
| | | // settleClaimsMapper.updateById(update); |
| | | // |
| | | // //å卿¥å¿ |
| | | // this.saveSettleClaimsLog(settleClaims, |
| | | // Constants.SettleClaimsLogType.CONFIRM_FEE, |
| | | // Constants.SettleClaimsLogType.CONFIRM_FEE.getInfo()); |
| | | // } |
| | | @Override |
| | | @Transactional(rollbackFor = {BusinessException.class,Exception.class}) |
| | | public void payCash(PayCashDTO dto){ |
| | | if(Objects.isNull(dto) |
| | | || Objects.isNull(dto.getId()) |
| | | || StringUtils.isBlank(dto.getDescribe()) |
| | | ){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | } |
| | | LoginUserInfo loginUserInfo = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); |
| | | if(!loginUserInfo.getType().equals(Constants.ZERO)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"é管çåæ æ³è¿è¡è¯¥æä½"); |
| | | } |
| | | SettleClaims settleClaims = settleClaimsJoinMapper.selectById(dto.getId()); |
| | | if(Objects.isNull(settleClaims)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY); |
| | | } |
| | | if(!Constants.equalsInteger(Constants.SettleClaimsStatus.CONFIRM_FEE.getKey(),settleClaims.getStatus())){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"对ä¸èµ·ï¼ä¸å¡ç¶æå·²æµè½¬~"); |
| | | } |
| | | SettleClaims update = new SettleClaims(); |
| | | update.setEditDate(new Date()); |
| | | update.setEditor(loginUserInfo.getId()); |
| | | update.setStatus(Constants.SettleClaimsStatus.CLOSE_CASE.getKey()); |
| | | update.setId(settleClaims.getId()); |
| | | settleClaimsMapper.updateById(update); |
| | | |
| | | if(CollectionUtils.isNotEmpty(dto.getMultifileList())){ |
| | | List<Multifile> fileList = dto.getMultifileList(); |
| | | if(CollectionUtils.isNotEmpty(fileList)){ |
| | | for (int i = 0; i < fileList.size(); i++) { |
| | | Multifile multifile = fileList.get(i); |
| | | if(Objects.isNull(multifile.getFileurl()) |
| | | || Objects.isNull(multifile.getType()) |
| | | || StringUtils.isBlank(multifile.getName()) |
| | | ){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"éä»¶å
容å¼å¸¸"); |
| | | } |
| | | multifile.setCreator(loginUserInfo.getId()); |
| | | multifile.setCreateDate(new Date()); |
| | | multifile.setIsdeleted(Constants.ZERO); |
| | | multifile.setObjId(settleClaims.getId()); |
| | | //æ·»å æææ¾å
¥ å
¶ä»ææä¸å¡å
|
| | | multifile.setObjType(Constants.MultiFile.LP_PAY_FILE.getKey()); |
| | | multifile.setSortnum(i+1); |
| | | multifileJoinMapper.insert(multifile); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | //å卿¥å¿ |
| | | this.saveSettleClaimsLog(settleClaims, |
| | | Constants.SettleClaimsLogType.PLATFORM_FINISH, |
| | | dto.getDescribe()); |
| | | } |
| | | |
| | | |
| | | |