| | |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"未查询到主方案数据!"); |
| | | } |
| | | solutions.setInsuranceId(solutionsBase.getInsuranceId()); |
| | | solutions.setCanAdd(solutionsBase.getCanAdd()); |
| | | solutions.setCanReduce(solutionsBase.getCanReduce()); |
| | | solutions.setCanChangeUnit(solutionsBase.getCanChangeUnit()); |
| | | // solutions.setCanAdd(solutionsBase.getCanAdd()); |
| | | // solutions.setCanReduce(solutionsBase.getCanReduce()); |
| | | // solutions.setCanChangeUnit(solutionsBase.getCanChangeUnit()); |
| | | // solutions.setDelOnlyReplace(solutionsBase.getDelOnlyReplace()); |
| | | solutions.setAddValidDays(solutionsBase.getAddValidDays()); |
| | | solutions.setDelValidDays(solutionsBase.getDelValidDays()); |
| | | solutions.setMinAge(solutionsBase.getMinAge()); |
| | |
| | | file.setObjType(Constants.MultiFile.SOLUTIONS_CONFIRMATION_LATTER.getKey()); |
| | | file.setType(Constants.formatIntegerNum(file.getType())); |
| | | multifileMapper.insert(file); |
| | | file.setId(null); |
| | | file.setObjId(newModel.getId()); |
| | | multifileMapper.insert(file); |
| | | return solutions.getId(); |
| | |
| | | private void dealWorkType(Solutions solutions, Solutions newModel, List<SolutionWorktype> worktypes) { |
| | | |
| | | int num =0; |
| | | List<SolutionWorktype> typeList = new ArrayList<>(); |
| | | for(SolutionWorktype type : worktypes) { |
| | | //基础版本 |
| | | SolutionWorktype w = new SolutionWorktype(); |
| | |
| | | //历史版本的工种信息 |
| | | SolutionWorktype newType = new SolutionWorktype(); |
| | | BeanUtils.copyProperties(w, newType); |
| | | newType.setId(null); |
| | | newType.setSolutionId(newModel.getId()); |
| | | solutionWorktypeJoinMapper.insert(newType); |
| | | typeList.add(newType); |
| | | } |
| | | if(typeList.size()>0){ |
| | | solutionWorktypeJoinMapper.insert(typeList); |
| | | } |
| | | } |
| | | |
| | |
| | | ||Objects.isNull(solutions.getType()) |
| | | ||Objects.isNull(solutions.getRetrial()) |
| | | ||Objects.isNull(solutions.getFanganFile()) |
| | | || Objects.isNull(solutions.getCanAdd()) |
| | | || Objects.isNull(solutions.getCanReduce()) |
| | | || Objects.isNull(solutions.getCanChangeUnit()) |
| | | || Objects.isNull(solutions.getDelOnlyReplace()) |
| | | // ||Constants.formatIntegerNum(solutions.getPriceCycleUnit()) < 0 |
| | | ||Constants.formatIntegerNum(solutions.getInsureCycle()) < 0 |
| | | ||Constants.formatIntegerNum(solutions.getInsureCycleUnit()) < 0 |
| | |
| | | |
| | | @Override |
| | | public void deleteById(Integer id) { |
| | | solutionsMapper.deleteById(id); |
| | | //查询是否已存在使用中的保单 |
| | | if(insuranceApplyMapper.selectCount(new QueryWrapper<InsuranceApply>().lambda() |
| | | .apply(" solution_id in ( select id from solutions where BASE_ID = "+id+" or id = "+id+" )" ) |
| | | .notIn(InsuranceApply::getStatus |
| | | ,Constants.InsuranceApplyStatus.PLATFORM_RETURN.getKey() |
| | | ,Constants.InsuranceApplyStatus.CLOSE.getKey() |
| | | ,Constants.InsuranceApplyStatus.WTB_CLOSED.getKey() |
| | | ) |
| | | )>Constants.ZERO){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"存在已投保的保单数据,无法进行删除"); |
| | | }; |
| | | solutionsMapper.update(null,new UpdateWrapper<Solutions>() |
| | | .lambda() |
| | | .set(Solutions::getIsdeleted,Constants.ONE) |
| | | .and(i->i.eq(Solutions::getId,id).or().eq(Solutions::getBaseId,id)) |
| | | ); |
| | | } |
| | | |
| | | @Override |
| | |
| | | .eq(Multifile::getIsdeleted,Constants.ZERO) |
| | | .eq(Multifile::getObjType,Constants.MultiFile.SOLUTIONS_CONFIRMATION_LATTER.getKey())); |
| | | Multifile file = solutions.getFanganFile(); |
| | | file.setId(null); |
| | | file.setIsdeleted(Constants.ZERO); |
| | | file.setCreateDate(solutions.getEditDate()); |
| | | file.setCreator(solutions.getEditor()); |
| | |
| | | file.setObjType(Constants.MultiFile.SOLUTIONS_CONFIRMATION_LATTER.getKey()); |
| | | file.setType(Constants.formatIntegerNum(file.getType())); |
| | | multifileMapper.insert(file); |
| | | file.setId(null); |
| | | file.setObjId(newModel.getId()); |
| | | multifileMapper.insert(file); |
| | | |