| | |
| | | |
| | | |
| | | @Override |
| | | public Integer createSys(SettleClaims settleClaims) { |
| | | LoginUserInfo loginUserInfo = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); |
| | | settleClaims.setOrigin(Constants.ONE); |
| | | if(Objects.isNull(settleClaims) |
| | | || Objects.isNull(settleClaims.getMemberName()) |
| | | || Objects.isNull(settleClaims.getSolutionName()) |
| | | || Objects.isNull(settleClaims.getDuId()) |
| | | || Objects.isNull(settleClaims.getWorktypeId()) |
| | | || Objects.isNull(settleClaims.getHappenTime()) |
| | | || Objects.isNull(settleClaims.getType()) |
| | | || Objects.isNull(settleClaims.getInHospital()) |
| | | || Objects.isNull(settleClaims.getMedicalInsurance()) |
| | | || Objects.isNull(settleClaims.getContent()) |
| | | || Objects.isNull(settleClaims.getInformantName()) |
| | | || Objects.isNull(settleClaims.getInformantPhone())){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | } |
| | | if(!loginUserInfo.getType().equals(Constants.ONE)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"非企业员工无法进行该操作"); |
| | | } |
| | | //查询是否存在已提报的数据 根据人员和保险方案进行过滤 是否存在进行中的数据 |
| | | if(settleClaimsMapper.selectCount(new QueryWrapper<SettleClaims>().lambda() |
| | | .eq(SettleClaims::getSolutionId,settleClaims.getSolutionId()) |
| | | .eq(SettleClaims::getMemberId,loginUserInfo.getId()) |
| | | .in(SettleClaims::getStatus,Constants.SettleClaimsStatus.WAIT_ACCEPTANCE.getKey(), |
| | | Constants.SettleClaimsStatus.CONFIRM_INFORMATION.getKey()) |
| | | )>Constants.ZERO){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"存在提报中的报案数据!"); |
| | | } |
| | | settleClaims.setCreateDate(new Date()); |
| | | settleClaims.setIsdeleted(Constants.ZERO); |
| | | settleClaims.setCompanyId(loginUserInfo.getCompanyId()); |
| | | settleClaims.setStatus(Constants.SettleClaimsStatus.WAIT_ACCEPTANCE.getKey()); |
| | | settleClaims.setCreator(loginUserInfo.getId()); |
| | | settleClaims.setCheckUserId(loginUserInfo.getId()); |
| | | settleClaimsMapper.insert(settleClaims); |
| | | |
| | | List<Multifile> reportVideo = settleClaims.getReportFileList(); |
| | | if(CollectionUtils.isNotEmpty(reportVideo)){ |
| | | for (int i = 0; i < reportVideo.size(); i++) { |
| | | Multifile multifile = reportVideo.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.ONE); |
| | | multifile.setSortnum(i+1); |
| | | multifileJoinMapper.insert(multifile); |
| | | } |
| | | } |
| | | |
| | | return settleClaims.getId(); |
| | | } |
| | | @Override |
| | | public Integer create(SettleClaims settleClaims) { |
| | | LoginUserInfo loginUserInfo = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); |
| | | if(Objects.isNull(settleClaims) |
| | |
| | | |
| | | |
| | | @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()); |
| | | } |
| | | |
| | | |
| | | |