| | |
| | | package com.doumee.service.business.impl; |
| | | |
| | | import com.doumee.biz.system.SystemDictDataBiz; |
| | | import com.doumee.core.constants.ResponseStatus; |
| | | import com.doumee.core.exception.BusinessException; |
| | | import com.doumee.core.model.LoginUserInfo; |
| | |
| | | @Service |
| | | public class SolutionsServiceImpl implements SolutionsService { |
| | | |
| | | @Autowired |
| | | private SystemDictDataBiz systemDictDataBiz; |
| | | @Autowired |
| | | private MultifileMapper multifileMapper; |
| | | @Autowired |
| | |
| | | file.setObjType(Constants.MultiFile.SOLUTIONS_CONFIRMATION_LATTER.getKey()); |
| | | file.setType(Constants.formatIntegerNum(file.getType())); |
| | | multifileMapper.insert(file); |
| | | file.setObjId(newModel.getId()); |
| | | multifileMapper.insert(file); |
| | | } |
| | | return solutions.getId(); |
| | | } |
| | |
| | | // ||Constants.formatIntegerNum(solutions.getPriceCycleUnit()) < 0 |
| | | ||Constants.formatIntegerNum(solutions.getInsureCycle()) < 0 |
| | | ||Constants.formatIntegerNum(solutions.getInsureCycleUnit()) < 0 |
| | | || solutions.getMinAge() >solutions.getMaxAge() |
| | | ||Constants.formatIntegerNum( solutions.getMinAge()) >Constants.formatIntegerNum(solutions.getMaxAge()) |
| | | || Constants.formatBigdecimal(solutions.getPrice()).compareTo(new BigDecimal(0)) !=1 |
| | | ){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | |
| | | } |
| | | //数据有效性校验 |
| | | initCreateParam(solutions); |
| | | solutions.setType(null);//不支持修改投保方案 |
| | | if(solutionsMapper.selectCount(new QueryWrapper<Solutions>().lambda() |
| | | .eq(Solutions::getName,solutions.getName()) |
| | | .eq(Solutions::getIsdeleted,Constants.ZERO) |
| | |
| | | .last("limit 1") |
| | | ); |
| | | |
| | | |
| | | if(Objects.isNull(oldVersion)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"未查询到历史版本数据"); |
| | | } |
| | |
| | | .lambda() |
| | | .eq(SolutionWorktype::getSolutionId,solutions.getId()) |
| | | ); |
| | | if(Constants.equalsObject(solutions.getType(),Constants.ONE) ){ |
| | | if(Constants.equalsObject(model.getType(),Constants.ONE) ){ |
| | | if (solutions.getFanganFile()!=null && StringUtils.isNotBlank(solutions.getFanganFile().getFileurl())){ |
| | | |
| | | multifileMapper.update(null,new UpdateWrapper<Multifile>().lambda() |
| | | .set(Multifile::getIsdeleted,Constants.ONE) |
| | | .set(Multifile::getEditDate,solutions.getEditDate()) |
| | |
| | | .eq(Multifile::getObjId,solutions.getId()) |
| | | .eq(Multifile::getIsdeleted,Constants.ZERO) |
| | | .eq(Multifile::getObjType,Constants.MultiFile.SOLUTIONS_CONFIRMATION_LATTER.getKey())); |
| | | |
| | | Multifile file = solutions.getFanganFile(); |
| | | file.setIsdeleted(Constants.ZERO); |
| | | file.setCreateDate(solutions.getEditDate()); |
| | |
| | | file.setObjId(solutions.getId()); |
| | | file.setObjType(Constants.MultiFile.SOLUTIONS_CONFIRMATION_LATTER.getKey()); |
| | | file.setType(Constants.formatIntegerNum(file.getType())); |
| | | multifileMapper.insert(file); |
| | | file.setObjId(newModel.getId()); |
| | | multifileMapper.insert(file); |
| | | } |
| | | } |
| | |
| | | .eq(Multifile::getObjType,Constants.MultiFile.SOLUTIONS_CONFIRMATION_LATTER.getKey()) |
| | | .eq(Multifile::getIsdeleted,Constants.ZERO) |
| | | .last("limit 1")); |
| | | model.setFanganFile(f);//方案确认书 |
| | | if(f!=null && StringUtils.isNotBlank(f.getFileurl())){ |
| | | String url = systemDictDataBiz.queryByCode(Constants.OSS,Constants.RESOURCE_PATH).getCode()+systemDictDataBiz.queryByCode(Constants.OSS,Constants.APPLY_FILE).getCode()+f.getFileurl(); |
| | | f.setFileurlFull(url); |
| | | model.setFanganFile(f);//方案确认书 |
| | | } |
| | | return model; |
| | | } |
| | | |
| | |
| | | |
| | | @Override |
| | | public List<Solutions> findList(Solutions solutions) { |
| | | LoginUserInfo user = (LoginUserInfo)SecurityUtils.getSubject().getPrincipal(); |
| | | solutions.setIsdeleted(Constants.ZERO); |
| | | solutions.setStatus(Constants.ZERO); |
| | | if(solutions.getDataType() == null){ |
| | | solutions.setDataType(Constants.TWO); |
| | | } |
| | | if(Constants.equalsObject(user.getType(),Constants.TWO)){ |
| | | //如果是删除 |
| | | solutions.setShopId(user.getCompanyId()); |
| | | } |
| | | QueryWrapper<Solutions> wrapper = new QueryWrapper<>(solutions); |
| | | |
| | | return solutionsMapper.selectList(wrapper); |
| | | } |
| | | |