| | |
| | | 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; |
| | |
| | | @Autowired |
| | | private MemberMapper memberMapper; |
| | | |
| | | @Autowired |
| | | private SystemDictDataBiz systemDictDataBiz; |
| | | @Override |
| | | @Transactional(rollbackFor = {BusinessException.class,Exception.class}) |
| | | public Integer create(YwContract model) { |
| | |
| | | return data; |
| | | } |
| | | |
| | | private void initFiles(YwContract model) { |
| | | List<Multifile> multifiles = multifileMapper.selectList(new QueryWrapper<Multifile>().lambda() |
| | | .eq(Multifile::getObjId, model.getId() ) |
| | | .in(Multifile::getObjType, Arrays.asList(new Integer[]{Constants.MultiFile.YW_CONTRACT_FILE.getKey()})) |
| | | .eq(Multifile::getIsdeleted,Constants.ZERO)); |
| | | if(multifiles!=null){ |
| | | String path = systemDictDataBiz.queryByCode(Constants.FTP,Constants.FTP_RESOURCE_PATH).getCode() |
| | | +systemDictDataBiz.queryByCode(Constants.FTP,Constants.YW_CONTRACT_FILE).getCode(); |
| | | for(Multifile f : multifiles){ |
| | | if(StringUtils.isBlank(f.getFileurl())){ |
| | | continue; |
| | | } |
| | | f.setFileurlFull(path+f.getFileurl()); |
| | | //现场情况 |
| | | if(model.getFileList() == null){ |
| | | model.setFileList(new ArrayList<>()); |
| | | } |
| | | model.getFileList().add(f); |
| | | |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | private void dealMultifileBiz(YwContract model) { |
| | |
| | | multifile.setIsdeleted(Constants.ZERO); |
| | | multifile.setObjId(model.getId()); |
| | | multifile.setCreator(model.getCreator()); |
| | | multifile.setObjType(Constants.MultiFile.YW_WORKORDER_PROBLEM.getKey()); |
| | | multifile.setObjType(Constants.MultiFile.YW_CONTRACT_FILE.getKey()); |
| | | multifile.setSortnum(i+1); |
| | | fileList.add(multifile); |
| | | } |
| | |
| | | |
| | | @Override |
| | | public YwContract findById(Integer id) { |
| | | return ywContractMapper.selectById(id); |
| | | MPJLambdaWrapper<YwContract> queryWrapper = new MPJLambdaWrapper<>(); |
| | | queryWrapper.selectAll(YwContract.class ) |
| | | .selectAs(Company::getName,YwContract::getCompanyName ) |
| | | .selectAs(SystemUser::getRealname,YwContract::getUserName ) |
| | | .selectAs(YwCustomer::getName,YwContract::getRenterName ) |
| | | .selectAs(YwProject::getName,YwContract::getProjectName ) |
| | | .select("t4.realname",YwContract::getCreatorName ) |
| | | .leftJoin(Company.class,Company::getId,YwContract::getCompanyId) |
| | | .leftJoin(SystemUser.class,SystemUser::getId,YwContract::getUserId) |
| | | .leftJoin(SystemUser.class,SystemUser::getId,YwContract::getCreator) |
| | | .leftJoin(YwProject.class,YwProject::getId,YwContract::getProjectId) |
| | | .leftJoin(YwCustomer.class,YwCustomer::getId,YwContract::getRenterId); |
| | | YwContract model = ywContractMapper.selectJoinOne(YwContract.class,queryWrapper); |
| | | if(model != null){ |
| | | initFiles(model); |
| | | } |
| | | |
| | | return model; |
| | | } |
| | | |
| | | @Override |