| | |
| | | package com.doumee.service.business.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.doumee.biz.system.SystemDictDataBiz; |
| | | import com.doumee.core.constants.ResponseStatus; |
| | |
| | | import com.doumee.core.utils.DateUtil; |
| | | import com.doumee.core.utils.Utils; |
| | | import com.doumee.dao.business.*; |
| | | import com.doumee.dao.business.dto.SCSupplementDTO; |
| | | import com.doumee.dao.business.dto.SettleClaimsDTO; |
| | | import com.doumee.dao.business.dto.*; |
| | | import com.doumee.dao.business.join.MultifileJoinMapper; |
| | | import com.doumee.dao.business.join.SettleClaimsJoinMapper; |
| | | import com.doumee.dao.business.join.SettleClaimsLogJoinMapper; |
| | | import com.doumee.dao.business.model.*; |
| | | import com.doumee.dao.business.vo.CompensationVO; |
| | | import com.doumee.dao.business.vo.RiskConfigVO; |
| | | import com.doumee.dao.system.model.SystemUser; |
| | | import com.doumee.service.business.SettleClaimsLogService; |
| | |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.servlet.ServletOutputStream; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.File; |
| | | import java.io.FileInputStream; |
| | | import java.io.IOException; |
| | | import java.math.BigDecimal; |
| | | import java.net.URLEncoder; |
| | | import java.nio.charset.Charset; |
| | | import java.util.*; |
| | |
| | | SettleClaimsLog log = new SettleClaimsLog(update,applyLogType.getName(), info,update.getId(),applyLogType.getKey(), JSONObject.toJSONString(model), JSONObject.toJSONString(update)); |
| | | settleClaimsLogMapper.insert(log); |
| | | return 1; |
| | | } |
| | | |
| | | |
| | | @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) { |
| | |
| | | settleClaims.setDisabilityFileList(multifileList.stream().filter(m->m.getObjType().equals(Constants.MultiFile.LP_SCZL_FILE.getKey())).collect(Collectors.toList())); |
| | | |
| | | settleClaims.setCompensationFileList(multifileList.stream().filter(m->m.getObjType().equals(Constants.MultiFile.LP_JACL_FILE.getKey())).collect(Collectors.toList())); |
| | | |
| | | settleClaims.setOtherFileList(multifileList.stream().filter(m->m.getObjType().equals(Constants.MultiFile.LP_OTHER_FILE.getKey())).collect(Collectors.toList())); |
| | | } |
| | | |
| | | //查询操作记录 |
| | |
| | | ){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | } |
| | | |
| | | SettleClaims settleClaims = settleClaimsMapper.selectById(scSupplementDTO.getId()); |
| | | if(!(settleClaims.getStatus().equals(Constants.SettleClaimsStatus.WAIT_ACCEPTANCE.getKey()) |
| | | || settleClaims.getStatus().equals(Constants.SettleClaimsStatus.DEAL_ING.getKey()) |
| | |
| | | } |
| | | |
| | | |
| | | public void saveSettleClaims(SettleClaimsDTO settleClaimsDTO){ |
| | | @Override |
| | | @Transactional(rollbackFor = {BusinessException.class,Exception.class}) |
| | | public void saveSettleClaims(SettleClaimsDTO settleClaimsDTO,SystemDictDataServiceImpl systemDictDataService){ |
| | | LoginUserInfo loginUserInfo = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); |
| | | if(!loginUserInfo.getType().equals(Constants.ONE)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"非企业员工无法进行该操作"); |
| | |
| | | } |
| | | SettleClaims settleClaims = new SettleClaims(); |
| | | BeanUtils.copyProperties(settleClaimsDTO,settleClaims); |
| | | settleClaims.setReportNumStatus(Constants.ZERO); |
| | | if(Objects.nonNull(settleClaims.getId())){ |
| | | settleClaims.setEditDate(new Date()); |
| | | settleClaims.setEditor(loginUserInfo.getId()); |
| | | settleClaims.setStatus(Constants.equalsInteger(settleClaimsDTO.getSaveType(),Constants.ONE)? |
| | | Constants.SettleClaimsStatus.RETURN_ACCEPTANCE.getKey():Constants.SettleClaimsStatus.WAIT_ACCEPTANCE.getKey()); |
| | | if(Constants.equalsInteger(settleClaimsDTO.getSaveType(),Constants.ONE)){ |
| | | //处理风险信息 |
| | | this.saveRisk(settleClaims,settleClaimsDTO,systemDictDataService); |
| | | } |
| | | |
| | | settleClaimsMapper.updateById(settleClaims); |
| | | }else{ |
| | | settleClaims.setCreateDate(new Date()); |
| | |
| | | settleClaims.setCompanyId(loginUserInfo.getCompanyId()); |
| | | settleClaims.setStatus(Constants.equalsInteger(settleClaimsDTO.getSaveType(),Constants.ONE)? |
| | | Constants.SettleClaimsStatus.RETURN_ACCEPTANCE.getKey():Constants.SettleClaimsStatus.WAIT_ACCEPTANCE.getKey()); |
| | | if(Constants.equalsInteger(settleClaimsDTO.getSaveType(),Constants.ONE)){ |
| | | //处理风险信息 |
| | | this.saveRisk(settleClaims,settleClaimsDTO,systemDictDataService); |
| | | } |
| | | settleClaims.setCreator(loginUserInfo.getId()); |
| | | settleClaims.setCheckUserId(loginUserInfo.getId()); |
| | | settleClaimsMapper.insert(settleClaims); |
| | | } |
| | | this.saveFile(settleClaims,settleClaimsDTO,loginUserInfo); |
| | | //处理风险信息 |
| | | |
| | | |
| | | //记录日志 |
| | | this.saveSettleClaimsLog(settleClaims,Constants.SettleClaimsLogType.UPLOAD,null); |
| | | } |
| | | |
| | | public void saveRisk(SettleClaims settleClaims, SettleClaimsDTO settleClaimsDTO, SystemDictDataServiceImpl systemDictDataService){ |
| | |
| | | settleClaims.setRiskSensitive(sensitiveWord); |
| | | } |
| | | } |
| | | |
| | | //疑似新员工出险 |
| | | if(StringUtils.isNotBlank(riskConfigVO.getRiskNewMemberOpen()) |
| | | && StringUtils.equals(riskConfigVO.getRiskNewMemberOpen(),Constants.ONE+"") |
| | | && StringUtils.isNotBlank(riskConfigVO.getRiskNewMemberTimeUnit()) |
| | | && StringUtils.isNotBlank(riskConfigVO.getRiskNewMemberTime()) |
| | | ){ |
| | | Map<String,String> map = new HashMap<>(); |
| | | map.put("title","疑似新员工出险"); |
| | | if(riskConfigVO.getRiskNewMemberTimeUnit().equals(Constants.ONE+"")){ |
| | | if(DateUtil.afterMinutesByDate(Integer.valueOf(riskConfigVO.getRiskNewMemberTime())*60,insuranceApply.getStartTime()).getTime() < happenTime.getTime()){ |
| | | map.put("info","保险生效时间为"+DateUtil.getFomartDate(insuranceApply.getStartTime(),"yyyy-MM-dd")+""); |
| | | riskList.add(map); |
| | | settleClaims.setRiskNewUser(Constants.ONE); |
| | | }; |
| | | |
| | | }else if(Constants.equalsInteger(solutionsBase.getRiskDelayUnit(),Constants.TWO)){ |
| | | if(DateUtil.afterDayByDate(Integer.valueOf(riskConfigVO.getRiskNewMemberTime()),insuranceApply.getStartTime()).getTime() < happenTime.getTime()){ |
| | | map.put("info","保险生效时间为"+DateUtil.getFomartDate(insuranceApply.getStartTime(),"yyyy-MM-dd")+""); |
| | | riskList.add(map); |
| | | settleClaims.setRiskNewUser(Constants.ONE); |
| | | } |
| | | } |
| | | } |
| | | settleClaims.setRiskContent(JSONObject.toJSONString(riskList)); |
| | | if(riskList.size()>Constants.ZERO){ |
| | | settleClaims.setIsRisk(Constants.ONE); |
| | | }else{ |
| | | settleClaims.setIsRisk(Constants.ZERO); |
| | | settleClaims.setStatus(Constants.SettleClaimsStatus.CONFIRM_INFORMATION.getKey()); |
| | | } |
| | | } |
| | | |
| | | public void saveFile(SettleClaims settleClaims,SettleClaimsDTO settleClaimsDTO,LoginUserInfo loginUserInfo){ |
| | |
| | | multifile.setSortnum(i+1); |
| | | multifileJoinMapper.insert(multifile); |
| | | } |
| | | } |
| | | } |
| | | |
| | | // public void getRiskSettleDetail(Integer id){ |
| | | // settleClaimsJoinMapper.selectJoinOne(SettleClaims.class,new MPJLambdaWrapper<SettleClaims>() |
| | | // .selectAll(SettleClaims.class) |
| | | // .selectAs(DispatchUnit::getName,SettleClaims::getDuName) |
| | | // .selectAs(Worktype::getName,SettleClaims::getWorktypeName) |
| | | // .selectAs(Solutions::getName,SettleClaims::getSolutionName) |
| | | // .selectAs(InsuranceApply::getStartTime,SettleClaims::getBaoxianStartTime) |
| | | // .selectAs(InsuranceApply::getEndTime,SettleClaims::getBaoxianEndTime) |
| | | // .leftJoin(Solutions.class,Solutions::getId,SettleClaims::getSolutionId) |
| | | // .leftJoin(DispatchUnit.class,DispatchUnit::getId,SettleClaims::getDuId) |
| | | // .leftJoin(Worktype.class,Worktype::getId,SettleClaims::getWorktypeId) |
| | | // .leftJoin(InsuranceApply.class,InsuranceApply::getId,SettleClaims::getInsuranceApplyId) |
| | | // |
| | | // |
| | | // .eq(SettleClaims::getId,id) |
| | | // .last(" limit 1 ") |
| | | // ); |
| | | // } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = {BusinessException.class,Exception.class}) |
| | | public void saveSupplementDescribe(SaveSupplementDescribeDTO dto){ |
| | | if(Objects.isNull(dto) |
| | | || Objects.isNull(dto.getId()) |
| | | || Objects.isNull(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.ACCEPTANCE.getKey(),settleClaims.getStatus())){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"对不起,业务状态已流转~"); |
| | | } |
| | | if(Constants.equalsInteger(settleClaims.getWaitSupplement(),Constants.ONE)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"待企业补充文件,请等待企业补充文件"); |
| | | } |
| | | //存储日志 |
| | | this.saveSettleClaimsLog(settleClaims,Constants.SettleClaimsLogType.SUPPLEMENT_DESCRIBE,dto.getDescribe()); |
| | | settleClaimsMapper.update(null,new UpdateWrapper<SettleClaims>().lambda() |
| | | .eq(SettleClaims::getId,dto.getId()).set(SettleClaims::getEditDate,DateUtil.getCurrDateTime()).set(SettleClaims::getWaitSupplement,Constants.ONE)); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = {BusinessException.class,Exception.class}) |
| | | public void saveSupplementFile(SaveSupplementDescribeDTO dto){ |
| | | if(Objects.isNull(dto) |
| | | || Objects.isNull(dto.getId()) |
| | | || CollectionUtils.isEmpty(dto.getSupplementFileList())){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | } |
| | | LoginUserInfo loginUserInfo = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); |
| | | if(!(loginUserInfo.getType().equals(Constants.ZERO)||loginUserInfo.getType().equals(Constants.ONE))){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"非平台与企业员工无法进行该操作"); |
| | | } |
| | | SettleClaims settleClaims = settleClaimsJoinMapper.selectById(dto.getId()); |
| | | if(Objects.isNull(settleClaims)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY); |
| | | } |
| | | if(loginUserInfo.getType().equals(Constants.ZERO)){ |
| | | if(!(Constants.equalsInteger(Constants.SettleClaimsStatus.ACCEPTANCE.getKey(),settleClaims.getStatus()) |
| | | || Constants.equalsInteger(Constants.SettleClaimsStatus.WAIT_AUDIT_COMPENSATION.getKey(),settleClaims.getStatus()) |
| | | )){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"对不起,业务状态已流转~"); |
| | | } |
| | | }else{ |
| | | //如果是企业 查询是否是自己企业的数据 |
| | | if(!Constants.equalsInteger(settleClaims.getCompanyId(),loginUserInfo.getCompanyId())){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"非您企业的数据,您无法进行该操作"); |
| | | } |
| | | if(!Constants.equalsInteger(settleClaims.getWaitSupplement(),Constants.ONE)) { |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "当前业务无需进行添加材料"); |
| | | } |
| | | if(!(Constants.equalsInteger(Constants.SettleClaimsStatus.ACCEPTANCE.getKey(),settleClaims.getStatus()) |
| | | || Constants.equalsInteger(Constants.SettleClaimsStatus.WAIT_AUDIT_COMPENSATION.getKey(),settleClaims.getStatus()) |
| | | || Constants.equalsInteger(Constants.SettleClaimsStatus.REJECT_DEAL.getKey(),settleClaims.getStatus()) |
| | | || Constants.equalsInteger(Constants.SettleClaimsStatus.WAIT_DISCUSS_REJECT.getKey(),settleClaims.getStatus()) |
| | | )){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"对不起,业务状态已流转~"); |
| | | } |
| | | settleClaimsMapper.update(null,new UpdateWrapper<SettleClaims>().lambda() |
| | | .eq(SettleClaims::getId,dto.getId()).set(SettleClaims::getEditDate,DateUtil.getCurrDateTime()).set(SettleClaims::getWaitSupplement,Constants.ZERO)); |
| | | } |
| | | multifileJoinMapper.delete(new QueryWrapper<Multifile>().lambda().eq(Multifile::getObjId,dto.getId()).eq(Multifile::getObjType,Constants.MultiFile.LP_OTHER_FILE.getKey())); |
| | | List<Multifile> fileList = dto.getSupplementFileList(); |
| | | 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_OTHER_FILE.getKey()); |
| | | multifile.setSortnum(i+1); |
| | | multifileJoinMapper.insert(multifile); |
| | | } |
| | | } |
| | | //存储日志 |
| | | this.saveSettleClaimsLog(settleClaims,Constants.SettleClaimsLogType.SUPPLEMENT,null); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 撤销报案 |
| | | * @param dto |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = {BusinessException.class,Exception.class}) |
| | | public void returnSettle(OptSettleClaimsDTO dto){ |
| | | if(Objects.isNull(dto) |
| | | || Objects.isNull(dto.getId())){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | } |
| | | LoginUserInfo loginUserInfo = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); |
| | | if(!loginUserInfo.getType().equals(Constants.ONE)){ |
| | | 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(settleClaims.getCompanyId(),loginUserInfo.getCompanyId())){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"非您企业的数据,您无法进行该操作"); |
| | | } |
| | | if(!Constants.equalsInteger(Constants.SettleClaimsStatus.RETURN_ACCEPTANCE.getKey(),settleClaims.getStatus())){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"对不起,业务状态已流转~"); |
| | | } |
| | | //存储日志 |
| | | this.saveSettleClaimsLog(settleClaims,Constants.SettleClaimsLogType.RETURN_SETTLE,null); |
| | | settleClaimsMapper.update(null,new UpdateWrapper<SettleClaims>().lambda() |
| | | .eq(SettleClaims::getId,dto.getId()).set(SettleClaims::getEditDate,DateUtil.getCurrDateTime()).set(SettleClaims::getStatus,Constants.SettleClaimsStatus.RETURN.getKey())); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = {BusinessException.class,Exception.class}) |
| | | public void updCaseType(CaseTypeDTO dto){ |
| | | if(Objects.isNull(dto) |
| | | || Objects.isNull(dto.getId()) |
| | | || Objects.isNull(dto.getCaseType()) |
| | | || !(dto.getCaseType()>=Constants.ONE&&dto.getCaseType()<=Constants.THREE) |
| | | ){ |
| | | 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.ACCEPTANCE.getKey(),settleClaims.getStatus())){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"对不起,业务状态已流转~"); |
| | | } |
| | | //存储日志 |
| | | this.saveSettleClaimsLog(settleClaims, Constants.SettleClaimsLogType.UPD_CASE_TYPE,Constants.SettleClaimsLogType.UPD_CASE_TYPE.getInfo()); |
| | | settleClaimsMapper.update(null,new UpdateWrapper<SettleClaims>().lambda() |
| | | .eq(SettleClaims::getId,dto.getId()).set(SettleClaims::getEditDate,DateUtil.getCurrDateTime()) |
| | | .set(SettleClaims::getEditor,loginUserInfo.getId()) |
| | | .set(SettleClaims::getCaseType,dto.getCaseType())); |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = {BusinessException.class,Exception.class}) |
| | | public void register(OptSettleClaimsDTO dto){ |
| | | if(Objects.isNull(dto) |
| | | || Objects.isNull(dto.getId()) |
| | | || Objects.isNull(dto.getRegisterStatus()) |
| | | || !(Constants.equalsInteger(dto.getRegisterStatus(),Constants.SettleClaimsStatus.CONFIRM_INFORMATION.getKey())||Constants.equalsInteger(dto.getRegisterStatus(),Constants.SettleClaimsStatus.FINISH_ACCEPTANCE.getKey())) |
| | | || (Constants.equalsInteger(dto.getRegisterStatus(),Constants.SettleClaimsStatus.FINISH_ACCEPTANCE.getKey())&&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.RETURN_ACCEPTANCE.getKey(),settleClaims.getStatus())){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"对不起,业务状态已流转~"); |
| | | } |
| | | Constants.SettleClaimsStatus settleClaimsStatus = |
| | | Constants.equalsInteger(dto.getRegisterStatus(),Constants.SettleClaimsStatus.CONFIRM_INFORMATION.getKey())?Constants.SettleClaimsStatus.CONFIRM_INFORMATION:Constants.SettleClaimsStatus.FINISH_ACCEPTANCE; |
| | | //存储日志 |
| | | this.saveSettleClaimsLog(settleClaims, Constants.equalsInteger(dto.getRegisterStatus(),Constants.SettleClaimsStatus.CONFIRM_INFORMATION.getKey())?Constants.SettleClaimsLogType.PLATFORM_REGISTER:Constants.SettleClaimsLogType.PLATFORM_RETURN,dto.getDescribe()); |
| | | settleClaimsMapper.update(null,new UpdateWrapper<SettleClaims>().lambda() |
| | | .eq(SettleClaims::getId,dto.getId()).set(SettleClaims::getEditDate, |
| | | DateUtil.getCurrDateTime()).set(SettleClaims::getStatus,settleClaimsStatus.getKey())); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = {BusinessException.class,Exception.class}) |
| | | public Integer addReportNum(OptSettleClaimsDTO param){ |
| | | if(param.getId() == null |
| | | ||StringUtils.isBlank( param.getReportNum()) ){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | } |
| | | SettleClaims model = settleClaimsMapper.selectById(param.getId()); |
| | | if(model == null ||!Constants.equalsInteger(model.getIsdeleted(),Constants.ZERO)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY); |
| | | } |
| | | if(!(Constants.equalsInteger(model.getStatus(),Constants.SettleClaimsStatus.CONFIRM_INFORMATION.getKey()) |
| | | || Constants.equalsInteger(model.getStatus(),Constants.SettleClaimsStatus.ACCEPTANCE.getKey()) |
| | | ) |
| | | ){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"对不起,业务状态已流转~"); |
| | | } |
| | | LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); |
| | | if(!user.getType().equals(Constants.ZERO)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"非管理员无法进行该操作"); |
| | | } |
| | | if(Constants.equalsInteger(model.getReportNumStatus(),Constants.TWO)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"仅可修改一次报案号"); |
| | | } |
| | | if(!((Constants.equalsInteger(model.getStatus(),Constants.SettleClaimsStatus.ACCEPTANCE.getKey())&&Constants.equalsInteger(model.getReportNumStatus(),Constants.ONE)) |
| | | ||(Constants.equalsInteger(model.getStatus(),Constants.SettleClaimsStatus.WAIT_DEAL.getKey())&&Constants.equalsInteger(model.getReportNumStatus(),Constants.ZERO)))){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"仅可修改一次报案号"); |
| | | } |
| | | |
| | | |
| | | // //查询是否有报案号更改记录 |
| | | // if(Constants.equalsInteger(model.getStatus(),Constants.SettleClaimsStatus.ACCEPTANCE.getKey()) |
| | | // && settleClaimsLogMapper.selectCount(new QueryWrapper<SettleClaimsLog>().lambda() |
| | | // .eq(SettleClaimsLog::getObjType,Constants.SettleClaimsLogType.PLATFORM_ADDCODE.getKey()) |
| | | // .eq(SettleClaimsLog::getSettleClainmsId,param.getId()))>=Constants.ONE){ |
| | | // throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"仅可修改一次报案号"); |
| | | // } |
| | | // if(Constants.equalsInteger(model.getStatus(),Constants.SettleClaimsStatus.CONFIRM_INFORMATION.getKey())&&StringUtils.isNotBlank(model.getReportNum())){ |
| | | // throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"已修改报案号,无法再次修改"); |
| | | // } |
| | | settleClaimsMapper.update(null,new UpdateWrapper<SettleClaims>().lambda() |
| | | .eq(SettleClaims::getId,param.getId()).set(SettleClaims::getEditDate, |
| | | DateUtil.getCurrDateTime()).set(SettleClaims::getReportNum,param.getReportNum())); |
| | | |
| | | SettleClaims update = new SettleClaims(); |
| | | update.setEditDate(new Date()); |
| | | update.setEditor(user.getId()); |
| | | update.setReportNumStatus(model.getReportNumStatus()+Constants.ONE); |
| | | update.setId(model.getId()); |
| | | update.setCheckDate(update.getEditDate()); |
| | | update.setCheckInfo("添加备案号"); |
| | | update.setCheckUserId(user.getId()); |
| | | update.setReportNum(param.getReportNum()); |
| | | settleClaimsMapper.updateById(update); |
| | | |
| | | Constants.SettleClaimsLogType applyLogType = Constants.SettleClaimsLogType.PLATFORM_ADDCODE; |
| | | String info =applyLogType.getInfo(); |
| | | info = info.replace("${param}", update.getReportNum()); |
| | | SettleClaimsLog log = new SettleClaimsLog(update,applyLogType.getName(), info,update.getId(),applyLogType.getKey(), JSONObject.toJSONString(model), JSONObject.toJSONString(update)); |
| | | settleClaimsLogMapper.insert(log); |
| | | |
| | | return 1; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = {BusinessException.class,Exception.class}) |
| | | public Integer addRemark(OptSettleClaimsDTO param){ |
| | | if(param.getId() == null |
| | | ||StringUtils.isBlank( param.getDescribe()) ){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | } |
| | | SettleClaims model = settleClaimsMapper.selectById(param.getId()); |
| | | if(model == null ||!Constants.equalsInteger(model.getIsdeleted(),Constants.ZERO)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY); |
| | | } |
| | | if(!(Constants.equalsInteger(model.getStatus(),Constants.SettleClaimsStatus.CONFIRM_INFORMATION.getKey()) |
| | | ||Constants.equalsInteger(model.getStatus(),Constants.SettleClaimsStatus.ACCEPTANCE.getKey()) |
| | | ||Constants.equalsInteger(model.getStatus(),Constants.SettleClaimsStatus.REJECT_DEAL.getKey()) |
| | | ||Constants.equalsInteger(model.getStatus(),Constants.SettleClaimsStatus.WAIT_DISCUSS_AUDIT.getKey()) |
| | | ||Constants.equalsInteger(model.getStatus(),Constants.SettleClaimsStatus.WAIT_DISCUSS_REJECT.getKey()) |
| | | ||Constants.equalsInteger(model.getStatus(),Constants.SettleClaimsStatus.WAIT_AUDIT_COMPENSATION.getKey()) |
| | | ||Constants.equalsInteger(model.getStatus(),Constants.SettleClaimsStatus.COMPENSATION.getKey()) |
| | | ||Constants.equalsInteger(model.getStatus(),Constants.SettleClaimsStatus.CONFIRM_FEE.getKey()) |
| | | ||Constants.equalsInteger(model.getStatus(),Constants.SettleClaimsStatus.CLOSE_CASE.getKey()) |
| | | )){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"对不起,该申请当前不支持该操作~"); |
| | | } |
| | | LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); |
| | | SettleClaims update = new SettleClaims(); |
| | | update.setEditDate(new Date()); |
| | | update.setEditor(user.getId()); |
| | | update.setCheckDate(update.getEditDate()); |
| | | update.setCheckInfo("添加备注标签"); |
| | | update.setCheckUserId(user.getId()); |
| | | update.setId(model.getId()); |
| | | settleClaimsMapper.updateById(update); |
| | | |
| | | Constants.SettleClaimsLogType applyLogType = Constants.SettleClaimsLogType.PLATFORM_REMARK; |
| | | String info =applyLogType.getInfo(); |
| | | info = info.replace("${param}", param.getDescribe()); |
| | | SettleClaimsLog log = new SettleClaimsLog(update,applyLogType.getName(), info,update.getId(),applyLogType.getKey(), JSONObject.toJSONString(model), JSONObject.toJSONString(update)); |
| | | settleClaimsLogMapper.insert(log); |
| | | return 1; |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = {BusinessException.class,Exception.class}) |
| | | public void acceptance(AcceptanceSettleClaimsDTO dto){ |
| | | if(Objects.isNull(dto) |
| | | || Objects.isNull(dto.getId()) |
| | | || Objects.isNull(dto.getStatus()) |
| | | || StringUtils.isBlank(dto.getDescribe()) |
| | | || !(dto.getStatus()>=Constants.ZERO||dto.getStatus()<=Constants.THREE) |
| | | || ((Constants.equalsInteger(dto.getStatus(),Constants.THREE) ||Constants.equalsInteger(dto.getStatus(),Constants.TWO)) && StringUtils.isBlank(dto.getSyProblemOpts()) ) |
| | | ){ |
| | | 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.WAIT_DEAL.getKey(),settleClaims.getStatus())){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"对不起,业务状态已流转~"); |
| | | } |
| | | if(Constants.equalsInteger(dto.getStatus(),Constants.ZERO) || Constants.equalsInteger(dto.getStatus(),Constants.THREE)){ |
| | | //受理 |
| | | settleClaimsMapper.update(null,new UpdateWrapper<SettleClaims>().lambda() |
| | | .eq(SettleClaims::getId,dto.getId()).set(SettleClaims::getEditDate,DateUtil.getCurrDateTime()).set(SettleClaims::getEditor,loginUserInfo.getId()) |
| | | .set(SettleClaims::getStatus,Constants.SettleClaimsStatus.ACCEPTANCE.getKey())); |
| | | //存储日志 |
| | | this.saveSettleClaimsLog(settleClaims, |
| | | Constants.equalsInteger(dto.getStatus(),Constants.ZERO)?Constants.SettleClaimsLogType.PLATFORM_ACCEPTANCE:Constants.SettleClaimsLogType.PLATFORM_DISCUSS, |
| | | dto.getDescribe()); |
| | | }else if(Constants.equalsInteger(dto.getStatus(),Constants.ONE)){ |
| | | //拒绝受理 |
| | | settleClaimsMapper.update(null,new UpdateWrapper<SettleClaims>().lambda() |
| | | .eq(SettleClaims::getId,dto.getId()).set(SettleClaims::getEditDate,DateUtil.getCurrDateTime()).set(SettleClaims::getEditor,loginUserInfo.getId()) |
| | | .set(SettleClaims::getStatus,Constants.SettleClaimsStatus.REJECT_DEAL.getKey())); |
| | | //存储日志 |
| | | this.saveSettleClaimsLog(settleClaims, |
| | | Constants.SettleClaimsLogType.PLATFORM_REFUSE_ACCEPTANCE, |
| | | Constants.SettleClaimsLogType.PLATFORM_REFUSE_ACCEPTANCE.getInfo().replace("{param}",dto.getDescribe())); |
| | | }else if(Constants.equalsInteger(dto.getStatus(),Constants.TWO)){ |
| | | //受理商议审批 |
| | | settleClaimsMapper.update(null,new UpdateWrapper<SettleClaims>().lambda() |
| | | .eq(SettleClaims::getId,dto.getId()).set(SettleClaims::getEditDate,DateUtil.getCurrDateTime()).set(SettleClaims::getEditor,loginUserInfo.getId()) |
| | | .set(SettleClaims::getStatus,Constants.SettleClaimsStatus.REJECT_DEAL.getKey())); |
| | | //存储日志 |
| | | this.saveSettleClaimsLog(settleClaims, |
| | | Constants.SettleClaimsLogType.PLATFORM_WAIT_DISCUSS, |
| | | dto.getDescribe()); |
| | | } |
| | | } |
| | | |
| | | |
| | | @Override |
| | | 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)) { |
| | | 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<>(); |
| | | for (Constants.compensation c:compensations) { |
| | | CompensationVO compensationVO = new CompensationVO(); |
| | | compensationVO.setType(c.getType()); |
| | | compensationVO.setName(c.getName()); |
| | | if(CollectionUtils.isNotEmpty(modelList)){ |
| | | Optional<CompensationVO> optionalModel = modelList.stream().filter(i->i.getName().equals(c.getName())).findFirst(); |
| | | if(optionalModel.isPresent()){ |
| | | CompensationVO oldModel = optionalModel.get(); |
| | | compensationVO.setFee(oldModel.getFee()); |
| | | compensationVO.setDescribe(oldModel.getDescribe()); |
| | | } |
| | | } |
| | | list.add(compensationVO); |
| | | } |
| | | return list; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = {BusinessException.class,Exception.class}) |
| | | public void compensation(CompensationDTO dto){ |
| | | if(Objects.isNull(dto) |
| | | || Objects.isNull(dto.getId()) |
| | | || StringUtils.isBlank(dto.getCompensationJson()) |
| | | ){ |
| | | 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.ACCEPTANCE.getKey(),settleClaims.getStatus()))||Constants.equalsInteger(Constants.SettleClaimsStatus.WAIT_AUDIT_COMPENSATION.getKey(),settleClaims.getStatus())){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"对不起,业务状态已流转~"); |
| | | } |
| | | |
| | | 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.setId(settleClaims.getId()); |
| | | update.setStatus(Constants.SettleClaimsStatus.WAIT_AUDIT_COMPENSATION.getKey()); |
| | | settleClaimsMapper.updateById(update); |
| | | |
| | | //存储日志 |
| | | this.saveSettleClaimsLog(settleClaims, |
| | | Constants.SettleClaimsLogType.PLATFORM_LP_DEAL, |
| | | Constants.SettleClaimsLogType.PLATFORM_LP_DEAL.getInfo()); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 商议审批 |
| | | * @param dto |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = {BusinessException.class,Exception.class}) |
| | | public void discussAudit(DiscussAuditDTO dto){ |
| | | if(Objects.isNull(dto) |
| | | || Objects.isNull(dto.getId()) |
| | | || Objects.isNull(dto.getStatus()) |
| | | || !(Constants.equalsInteger(dto.getStatus(),Constants.ZERO)||Constants.equalsInteger(dto.getStatus(),Constants.ONE)) |
| | | || (Constants.equalsInteger(dto.getStatus(),Constants.ONE)&&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.WAIT_DISCUSS_AUDIT.getKey(),settleClaims.getStatus())){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"对不起,业务状态已流转~"); |
| | | } |
| | | Constants.SettleClaimsStatus settleClaimsStatus = |
| | | Constants.equalsInteger(dto.getStatus(),Constants.ZERO)?Constants.SettleClaimsStatus.ACCEPTANCE:Constants.SettleClaimsStatus.WAIT_DISCUSS_REJECT; |
| | | //存储日志 |
| | | Constants.SettleClaimsLogType settleClaimsLogType = Constants.equalsInteger(dto.getStatus(),Constants.ZERO) |
| | | ?Constants.SettleClaimsLogType.PLATFORM_DISCUSS_PASS:Constants.SettleClaimsLogType.PLATFORM_DISCUSS_REFUSE; |
| | | this.saveSettleClaimsLog(settleClaims, settleClaimsLogType |
| | | ,settleClaimsLogType.getInfo().replace("${param}",dto.getDescribe())); |
| | | settleClaimsMapper.update(null,new UpdateWrapper<SettleClaims>().lambda() |
| | | .eq(SettleClaims::getId,dto.getId()).set(SettleClaims::getEditDate, DateUtil.getCurrDateTime()) |
| | | .set(SettleClaims::getEditor,loginUserInfo.getId()) |
| | | .set(SettleClaims::getStatus,settleClaimsStatus.getKey())); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = {BusinessException.class,Exception.class}) |
| | | public void nuclearCompensation(CompensationDTO dto){ |
| | | if(Objects.isNull(dto) |
| | | || Objects.isNull(dto.getId()) |
| | | || StringUtils.isBlank(dto.getCompensationJson()) |
| | | ){ |
| | | 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.WAIT_AUDIT_COMPENSATION.getKey(),settleClaims.getStatus())){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"对不起,业务状态已流转~"); |
| | | } |
| | | |
| | | |
| | | List<CompensationVO> modelList = JSONArray.parseArray(dto.getCompensationJson(),CompensationVO.class); |
| | | |
| | | SettleClaims update = new SettleClaims(); |
| | | update.setEditDate(new Date()); |
| | | update.setEditor(loginUserInfo.getId()); |
| | | 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); |
| | | |
| | | //存储日志 |
| | | this.saveSettleClaimsLog(settleClaims, |
| | | Constants.SettleClaimsLogType.PLATFORM_HP_DEAL, |
| | | Constants.SettleClaimsLogType.PLATFORM_HP_DEAL.getInfo()); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = {BusinessException.class,Exception.class}) |
| | | public void updFee(CompensationDTO dto){ |
| | | if(Objects.isNull(dto) |
| | | || Objects.isNull(dto.getId()) |
| | | || StringUtils.isBlank(dto.getCompensationJson()) |
| | | ){ |
| | | 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()) |
| | | || Constants.equalsInteger(Constants.SettleClaimsStatus.CONFIRM_FEE.getKey(),settleClaims.getStatus())) |
| | | ){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"对不起,业务状态已流转~"); |
| | | } |
| | | |
| | | List<CompensationVO> modelList = JSONArray.parseArray(dto.getCompensationJson(),CompensationVO.class); |
| | | |
| | | SettleClaims update = new SettleClaims(); |
| | | update.setEditDate(new Date()); |
| | | update.setEditor(loginUserInfo.getId()); |
| | | if(Constants.equalsInteger(Constants.SettleClaimsStatus.CONFIRM_FEE.getKey(),settleClaims.getStatus())){ |
| | | update.setFeeUpdate(Constants.ONE); |
| | | } |
| | | 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)); |
| | | //处理历史数据 |
| | | 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()); |
| | | }else if(compensationVO.getName().equals(Constants.compensation.WG_COMPENSATION.getName())){ |
| | | compensationVO.setFee(update.getWgClaimAccount()); |
| | | }else if(compensationVO.getName().equals(Constants.compensation.SC_COMPENSATION.getName())){ |
| | | compensationVO.setFee(update.getScClaimAccount()); |
| | | }else if(compensationVO.getName().equals(Constants.compensation.SW_COMPENSATION.getName())){ |
| | | compensationVO.setFee(update.getSwClaimAccount()); |
| | | }else{ |
| | | continue; |
| | | } |
| | | } |
| | | update.setAccountContent(JSONArray.toJSONString(oldList)); |
| | | update.setId(settleClaims.getId()); |
| | | settleClaimsMapper.updateById(update); |
| | | |
| | | //存储日志 |
| | | this.saveSettleClaimsLog(settleClaims, |
| | | Constants.SettleClaimsLogType.PLATFORM_UPD_FEE, |
| | | Constants.SettleClaimsLogType.PLATFORM_UPD_FEE.getInfo()); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = {BusinessException.class,Exception.class}) |
| | | public void confirmFee(Integer id){ |
| | | LoginUserInfo loginUserInfo = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); |
| | | if(!loginUserInfo.getType().equals(Constants.ZERO)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"非管理员无法进行该操作"); |
| | | } |
| | | SettleClaims settleClaims = settleClaimsJoinMapper.selectById(id); |
| | | 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()); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |