| | |
| | | applyChangeMapper.updateById(applyChangeFee); |
| | | |
| | | |
| | | this.saveApplyLog(applyChange,Constants.ApplyChangeLogStatus.UPLOAD,null); |
| | | |
| | | Constants.ApplyLogType applyLogType = Constants.ApplyLogType.CA_COMPANY_COMMIT; |
| | | String info =applyLogType.getInfo(); |
| | | info = info.replace("${param}", ""); |
| | | ApplyLog log = new ApplyLog(applyChange,applyLogType.getName(),info,applyChange.getId(),applyLogType.getKey(), null, null); |
| | | applyLogMapper.insert(log); |
| | | |
| | | |
| | | return applyChange.getId(); |
| | | } |
| | | |
| | |
| | | BigDecimal fee = this.dealApplyChangeData(applyChange,insuranceApply,companySolution,solutions,loginUserInfo,BigDecimal.ZERO); |
| | | applyChange.setFee(fee); |
| | | applyChangeMapper.updateById(applyChange); |
| | | this.saveApplyLog(applyChange,Constants.ApplyChangeLogStatus.UPLOAD,null); |
| | | |
| | | |
| | | Constants.ApplyLogType applyLogType = Constants.ApplyLogType.CA_UPLOAD_AGAIN; |
| | | String info =applyLogType.getInfo(); |
| | | info = info.replace("${param}", ""); |
| | | ApplyLog log = new ApplyLog(applyChange,applyLogType.getName(),info,applyChange.getId(),applyLogType.getKey(), null, null); |
| | | applyLogMapper.insert(log); |
| | | |
| | | |
| | | return applyChange.getId(); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | public void saveApplyLog(ApplyChange applyChange,Constants.ApplyChangeLogStatus applyChangeLogStatus,String content){ |
| | | public void saveApplyLog(ApplyChange applyChange,Constants.ApplyLogType applyLogType,String content){ |
| | | LoginUserInfo loginUserInfo = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); |
| | | ApplyLog applyLog = new ApplyLog(); |
| | | applyLog.setCreateDate(new Date()); |
| | | applyLog.setCreator(loginUserInfo.getId()); |
| | | applyLog.setIsdeleted(Constants.ZERO); |
| | | applyLog.setApplyId(applyChange.getApplyId()); |
| | | applyLog.setTitle(applyChangeLogStatus.getName()); |
| | | applyLog.setTitle(applyLogType.getName()); |
| | | if(StringUtils.isNotBlank(content)){ |
| | | applyLog.setContent(applyChangeLogStatus.getInfo().replace("${param}",content)); |
| | | }else{ |
| | | applyLog.setContent(applyChangeLogStatus.getInfo()); |
| | | applyLog.setContent(applyLogType.getInfo().replace("${param}",content)); |
| | | } |
| | | applyLog.setObjType(applyChangeLogStatus.getKey()); |
| | | applyLog.setObjType(applyLogType.getKey()); |
| | | applyLog.setObjId( applyChange.getId()); |
| | | applyLog.setStatus(applyChange.getStatus()); |
| | | applyLogMapper.insert(applyLog); |
| | |
| | | applyChagneDetail.setApplyChangeId(applyChange.getId()); |
| | | applyChagneDetail.setType(Constants.ONE); |
| | | |
| | | applyChagneDetail.setStartTime(DateUtil.getMontageDate(applyDetail.getStartTime(),1)); |
| | | applyChagneDetail.setStartTime(DateUtil.getMontageDate(applyChange.getApplyStartTime(),1)); |
| | | applyChagneDetail.setEndTime(DateUtil.getMontageDate(applyChange.getApplyStartTime(),3)); |
| | | |
| | | applyChagneDetail.setFee( detailFee.multiply(new BigDecimal(-1))); |
| | |
| | | applyChagneDetail.setCreator(loginUserInfo.getId()); |
| | | applyChagneDetail.setIsdeleted(Constants.ZERO); |
| | | applyChagneDetail.setApplyChangeId(applyChange.getId()); |
| | | applyChagneDetail.setStartTime(DateUtil.getMontageDate(applyChange.getStartTime(),1)); |
| | | applyChagneDetail.setStartTime(DateUtil.getMontageDate(applyChange.getApplyStartTime(),1)); |
| | | applyChagneDetail.setEndTime(DateUtil.getMontageDate(insuranceApply.getEndTime(),2)); |
| | | applyChagneDetail.setType(Constants.ZERO); |
| | | applyChagneDetail.setFee(detailFee); |
| | |
| | | .selectAll(ApplyChange.class) |
| | | .selectAs(InsuranceApply::getCode,ApplyChange::getApplyCode) |
| | | .selectAs(Solutions::getName,ApplyChange::getSolutionsName) |
| | | .selectAs(Company::getName,ApplyChange::getCompanyName) |
| | | .select("( select count(1) from apply_chagne_detail ad where t.id = ad.APPLY_CHANGE_ID and ad.TYPE = 0 )",ApplyChange::getAddNum) |
| | | .select("( select count(1) from apply_chagne_detail ad where t.id = ad.APPLY_CHANGE_ID and ad.TYPE = 1 )",ApplyChange::getDelNum) |
| | | .select("( select count(1) from apply_chagne_detail ad where t.id = ad.APPLY_CHANGE_ID and ad.TYPE = 2 )",ApplyChange::getChangeNum) |
| | | .select("( select ifnull(sum(ad.FEE),0) from apply_chagne_detail ad where t.id = ad.APPLY_CHANGE_ID )",ApplyChange::getChangeMoney) |
| | | .leftJoin(InsuranceApply.class,InsuranceApply::getId,ApplyChange::getApplyId) |
| | | .leftJoin(Solutions.class,Solutions::getId,InsuranceApply::getSolutionId) |
| | | .leftJoin(Company.class,Company::getId,InsuranceApply::getCompanyId) |
| | | .eq(!Objects.isNull(model.getType()),ApplyChange::getType,model.getType()) |
| | | .eq(!Objects.isNull(model.getStatus())&&!model.getStatus().equals(Constants.ApplyChangeStatus.RETURN_APPLY_UPLOAD.getKey()),ApplyChange::getStatus,model.getStatus()) |
| | | .in(!Objects.isNull(model.getStatus())&&model.getStatus().equals(Constants.ApplyChangeStatus.RETURN_APPLY_UPLOAD.getKey()),ApplyChange::getStatus, |
| | |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"未查询方案信息"); |
| | | } |
| | | |
| | | Constants.ApplyChangeLogStatus applyChangeLogStatus = Constants.ApplyChangeLogStatus.RETURN_APPLY; |
| | | Constants.ApplyLogType applyLogType = Constants.ApplyLogType.CA_PLATFORM_CHECK_PASS_NO; |
| | | |
| | | Constants.NoticeObjectType noticeObjectType = Constants.NoticeObjectType.APPLY_CHANGE; |
| | | if(applyChange.getType().equals(Constants.ONE)){ |
| | |
| | | |
| | | |
| | | }else if(applyChangeOptDTO.getOptType().equals(4)){ |
| | | applyChangeLogStatus = Constants.ApplyChangeLogStatus.PLATFORM_AGREE; |
| | | applyLogType = Constants.ApplyLogType.CA_PLATFORM_AGREE_BACK_APPLY; |
| | | //平台同意退回 |
| | | if(loginUserInfo.getType().equals(Constants.ZERO)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"非平台端用户无法进行该操作"); |
| | |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"数据状态错误无法进行该操作!"); |
| | | } |
| | | }else if(applyChangeOptDTO.getOptType().equals(5)){ |
| | | applyChangeLogStatus = Constants.ApplyChangeLogStatus.PLATFORM_UN_AGREE; |
| | | applyLogType = Constants.ApplyLogType.CA_PALTFORM_REFUSE_APPLY; |
| | | //平台驳回退回 |
| | | if(loginUserInfo.getType().equals(Constants.ZERO)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"非平台端用户无法进行该操作"); |
| | |
| | | } |
| | | }else if(applyChangeOptDTO.getOptType().equals(6)){ |
| | | //企业关闭 |
| | | applyChangeLogStatus = Constants.ApplyChangeLogStatus.CLOSE; |
| | | applyLogType = Constants.ApplyLogType.CA_COMPANY_CLOSE; |
| | | if(!loginUserInfo.getType().equals(Constants.ONE)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"非企业端用户无法进行该操作"); |
| | | } |
| | |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"数据状态错误无法进行该操作!"); |
| | | } |
| | | applyChange.setStatus(Constants.ApplyChangeStatus.CLOSE.getKey()); |
| | | |
| | | |
| | | //存储待办信息 |
| | | //删除其他待办 |
| | |
| | | applyChange.setEditDate(new Date()); |
| | | applyChangeMapper.updateById(applyChange); |
| | | |
| | | //存储日志数据 |
| | | this.saveApplyLog(applyChange,applyChangeLogStatus,applyChangeOptDTO.getOptIllustration()); |
| | | String info = applyLogType.getInfo(); |
| | | info = info.replace("${param}", applyChangeOptDTO.getOptIllustration()); |
| | | ApplyLog log = new ApplyLog(applyChange,applyLogType.getName(),info,applyChange.getId(),applyLogType.getKey(), null, null); |
| | | applyLogMapper.insert(log); |
| | | } |
| | | |
| | | |
| | |
| | | .selectAs(Company::getName,ApplyLog::getCompanyName) |
| | | .leftJoin(SystemUser.class,SystemUser::getId,ApplyLog::getCreator) |
| | | .leftJoin(Company.class,Company::getId,SystemUser::getCompanyId) |
| | | .in(ApplyLog::getObjType,Constants.ApplyLogType.getTypeList(Constants.ONE)) |
| | | .eq(ApplyLog::getObjId,applyChange.getId()) |
| | | .orderByAsc(ApplyLog::getCreateDate) |
| | | ); |