| | |
| | | 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 create(SettleClaims settleClaims) { |
| | | LoginUserInfo loginUserInfo = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); |
| | |
| | | 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(),"éä¼ä¸åå·¥æ æ³è¿è¡è¯¥æä½"); |
| | |
| | | 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 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.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.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.WAIT_CLOSE_CASE.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(Integer id){ |
| | | SettleClaims settleClaims = settleClaimsMapper.selectById(id); |
| | | List<CompensationVO> modelList = new ArrayList<>(); |
| | | if (Objects.nonNull(settleClaims)&&StringUtils.isNotBlank(settleClaims.getAccountContent())) { |
| | | modelList = JSONArray.parseArray(settleClaims.getAccountContent(),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(settleClaims.getAccountContent(),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(settleClaims.getAccountContent(),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.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())){ |
| | | 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)); |
| | | |
| | | //å¤çå岿°æ® |
| | | List<CompensationVO> oldList = JSONArray.parseArray(settleClaims.getAccountContent(),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(dto.getCompensationJson()); |
| | | 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(),"对ä¸èµ·ï¼ä¸å¡ç¶æå·²æµè½¬~"); |
| | | } |
| | | |
| | | |
| | | //å卿¥å¿ |
| | | this.saveSettleClaimsLog(settleClaims, |
| | | Constants.SettleClaimsLogType.CONFIRM_FEE, |
| | | Constants.SettleClaimsLogType.CONFIRM_FEE.getInfo()); |
| | | } |
| | | |
| | | |
| | | |
| | | } |