| | |
| | | import com.doumee.core.utils.Constants; |
| | | import com.doumee.core.utils.Utils; |
| | | import com.doumee.dao.business.InsuranceMapper; |
| | | import com.doumee.dao.business.MultifileMapper; |
| | | import com.doumee.dao.business.WorktypeMapper; |
| | | import com.doumee.dao.business.join.DuWorkTypeJoinMapper; |
| | | import com.doumee.dao.business.join.WorktypeJoinMapper; |
| | | import com.doumee.dao.business.model.Insurance; |
| | | import com.doumee.dao.business.model.Multifile; |
| | | import com.doumee.dao.business.model.Solutions; |
| | | import com.doumee.dao.business.model.Worktype; |
| | | import com.doumee.dao.system.model.SystemUser; |
| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.sun.corba.se.spi.orbutil.threadpool.Work; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.apache.shiro.SecurityUtils; |
| | | import org.checkerframework.checker.units.qual.A; |
| | |
| | | private WorktypeJoinMapper worktypeJoinMapper; |
| | | @Autowired |
| | | private SystemDictDataBiz systemDictDataBiz; |
| | | @Autowired |
| | | private MultifileMapper multifileMapper; |
| | | |
| | | @Override |
| | | @Transactional |
| | |
| | | } |
| | | |
| | | if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(saveList)){ |
| | | worktypeJoinMapper.insertBatchSomeColumn(saveList); |
| | | worktypeJoinMapper.insert(saveList); |
| | | } |
| | | |
| | | |
| | |
| | | } |
| | | |
| | | @Override |
| | | public Insurance findById(Integer id) { |
| | | public Insurance findByIdAndType(Integer id,Integer type) { |
| | | Insurance model = insuranceMapper.selectById(id); |
| | | if(model == null || !Constants.equalsInteger(model.getIsdeleted(),Constants.ZERO)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY ); |
| | | } |
| | | String path = systemDictDataBiz.queryByCode(Constants.OSS,Constants.RESOURCE_PATH).getCode()+ |
| | | systemDictDataBiz.queryByCode(Constants.OSS,Constants.INSURANCE).getCode(); |
| | | //附件信息 |
| | | Multifile lpStampTempFile = multifileMapper.selectOne(new QueryWrapper<Multifile>().lambda().eq(Multifile::getIsdeleted,Constants.ZERO) |
| | | .eq(Multifile::getObjId,id).eq(Multifile::getObjType,Constants.MultiFile.LP_STAMP_FILE.getKey()).last("limit 1")); |
| | | if(Objects.nonNull(lpStampTempFile)){ |
| | | lpStampTempFile.setFileurlFull(path + lpStampTempFile.getFileurl()); |
| | | model.setLpStampTempFile(lpStampTempFile); |
| | | } |
| | | |
| | | Multifile lpFile = multifileMapper.selectOne(new QueryWrapper<Multifile>().lambda().eq(Multifile::getIsdeleted,Constants.ZERO) |
| | | .eq(Multifile::getObjId,id).eq(Multifile::getObjType,Constants.MultiFile.LP_FILE.getKey()).last("limit 1")); |
| | | if(Objects.nonNull(lpFile)){ |
| | | lpFile.setFileurlFull(path + lpFile.getFileurl()); |
| | | model.setLpFile(lpFile); |
| | | } |
| | | if(Objects.nonNull(type)&&Constants.equalsInteger(type,Constants.ONE)){ |
| | | return model; |
| | | } |
| | | List<Worktype> worktypeList = worktypeMapper.selectList(new QueryWrapper<Worktype>().lambda() |
| | | .eq(Worktype::getInsuranceId,id) |
| | |
| | | .orderByAsc(Worktype::getSortnum)); |
| | | model.setWorktypeList(worktypeList); |
| | | return model; |
| | | } |
| | | |
| | | @Override |
| | | public Insurance findById(Integer id) { |
| | | return this.findByIdAndType(id,null); |
| | | // Insurance model = insuranceMapper.selectById(id); |
| | | // if(model == null || !Constants.equalsInteger(model.getIsdeleted(),Constants.ZERO)){ |
| | | // throw new BusinessException(ResponseStatus.DATA_EMPTY ); |
| | | // } |
| | | // List<Worktype> worktypeList = worktypeMapper.selectList(new QueryWrapper<Worktype>().lambda() |
| | | // .eq(Worktype::getInsuranceId,id) |
| | | // .eq(Worktype::getIsdeleted,Constants.ZERO) |
| | | // .orderByAsc(Worktype::getSortnum)); |
| | | // model.setWorktypeList(worktypeList); |
| | | // String path = systemDictDataBiz.queryByCode(Constants.OSS,Constants.RESOURCE_PATH).getCode()+ |
| | | // systemDictDataBiz.queryByCode(Constants.OSS,Constants.INSURANCE).getCode(); |
| | | // //附件信息 |
| | | // Multifile lpStampTempFile = multifileMapper.selectOne(new QueryWrapper<Multifile>().lambda().eq(Multifile::getIsdeleted,Constants.ZERO) |
| | | // .eq(Multifile::getObjId,id).eq(Multifile::getObjType,Constants.MultiFile.LP_STAMP_FILE.getKey()).last("limit 1")); |
| | | // if(Objects.nonNull(lpStampTempFile)){ |
| | | // lpStampTempFile.setFileurlFull(path + lpStampTempFile.getFileurl()); |
| | | // model.setLpStampTempFile(lpStampTempFile); |
| | | // } |
| | | // |
| | | // Multifile lpFile = multifileMapper.selectOne(new QueryWrapper<Multifile>().lambda().eq(Multifile::getIsdeleted,Constants.ZERO) |
| | | // .eq(Multifile::getObjId,id).eq(Multifile::getObjType,Constants.MultiFile.LP_FILE.getKey()).last("limit 1")); |
| | | // if(Objects.nonNull(lpFile)){ |
| | | // lpFile.setFileurlFull(path + lpFile.getFileurl()); |
| | | // model.setLpFile(lpFile); |
| | | // } |
| | | |
| | | } |
| | | |
| | | @Override |
| | |
| | | QueryWrapper<Insurance> wrapper = new QueryWrapper<>(insurance); |
| | | return insuranceMapper.selectCount(wrapper); |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | | public void saveLpInfo(Insurance insurance){ |
| | | LoginUserInfo user= (LoginUserInfo)SecurityUtils.getSubject().getPrincipal(); |
| | | if(Objects.isNull(insurance) |
| | | || Objects.isNull(insurance.getId()) |
| | | ){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | } |
| | | multifileMapper.delete(new QueryWrapper<Multifile>().lambda() |
| | | .eq(Multifile::getObjId,insurance.getId()) |
| | | .in(Multifile::getObjType,Constants.MultiFile.LP_STAMP_FILE.getKey(),Constants.MultiFile.LP_FILE.getKey()) |
| | | ); |
| | | |
| | | Insurance model = new Insurance(); |
| | | model.setEditDate(new Date()); |
| | | model.setEditor(user.getId()); |
| | | if(Objects.nonNull(insurance.getLpStampTempFile())){ |
| | | Multifile multifile = insurance.getLpStampTempFile(); |
| | | multifile.setCreateDate(model.getEditDate()); |
| | | multifile.setCreator(model.getEditor()); |
| | | multifile.setIsdeleted(Constants.ZERO); |
| | | multifile.setObjType(Constants.MultiFile.LP_STAMP_FILE.getKey()); |
| | | multifile.setObjId(insurance.getId()); |
| | | multifileMapper.insert(multifile); |
| | | } |
| | | if(Objects.nonNull(insurance.getLpFile())){ |
| | | Multifile multifile = insurance.getLpFile(); |
| | | multifile.setCreateDate(model.getEditDate()); |
| | | multifile.setCreator(model.getEditor()); |
| | | multifile.setIsdeleted(Constants.ZERO); |
| | | multifile.setObjType(Constants.MultiFile.LP_FILE.getKey()); |
| | | multifile.setObjId(insurance.getId()); |
| | | multifileMapper.insert(multifile); |
| | | } |
| | | model.setId(insurance.getId()); |
| | | model.setLpYggxFileInfo(insurance.getLpYggxFileInfo()); |
| | | model.setLpMzFileInfo(insurance.getLpMzFileInfo()); |
| | | model.setLpZyFileInfo(insurance.getLpZyFileInfo()); |
| | | model.setLpScFileInfo(insurance.getLpScFileInfo()); |
| | | model.setLpOtherFileInfo(insurance.getLpOtherFileInfo()); |
| | | model.setLpFileStatus(Constants.ONE); |
| | | insuranceMapper.updateById(model); |
| | | } |
| | | |
| | | |
| | | } |