|
@@ -10,9 +10,11 @@ import com.jeeplus.sys.service.dto.UserDTO;
|
|
|
import com.jeeplus.sys.utils.StringUtils;
|
|
|
import com.jeeplus.sys.utils.UserUtils;
|
|
|
import com.jeeplus.test.cw.contractRegistration.domain.ContractFile;
|
|
|
+import com.jeeplus.test.cw.contractRegistration.domain.ContractFilePaper;
|
|
|
import com.jeeplus.test.cw.contractRegistration.domain.ContractInfo;
|
|
|
import com.jeeplus.test.cw.contractRegistration.domain.ContractParticipant;
|
|
|
import com.jeeplus.test.cw.contractRegistration.mapper.ContractFileMapper;
|
|
|
+import com.jeeplus.test.cw.contractRegistration.mapper.ContractFilePaperMapper;
|
|
|
import com.jeeplus.test.cw.contractRegistration.mapper.ContractInfoMapper;
|
|
|
import com.jeeplus.test.cw.contractRegistration.mapper.ContractParticipantMapper;
|
|
|
import com.jeeplus.test.cw.workClientInfo.service.dto.CwWorkClientBaseDTO;
|
|
@@ -24,6 +26,7 @@ import com.jeeplus.test.workContract.domain.WorkContractInfo;
|
|
|
import com.jeeplus.test.workContract.service.dto.WorkAttachmentDto;
|
|
|
import com.jeeplus.test.workContract.service.dto.WorkContractInfoDto;
|
|
|
import org.flowable.editor.language.json.converter.util.CollectionUtils;
|
|
|
+import org.flowable.ui.modeler.service.mapper.InfoMapper;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
@@ -52,6 +55,9 @@ public class ContractInfoService {
|
|
|
private ContractFileMapper fileMapper;
|
|
|
|
|
|
@Resource
|
|
|
+ private ContractFilePaperMapper paperMapper;
|
|
|
+
|
|
|
+ @Resource
|
|
|
private ContractParticipantMapper participantMapper;
|
|
|
|
|
|
/**
|
|
@@ -101,13 +107,13 @@ public class ContractInfoService {
|
|
|
}
|
|
|
//6、所属部门
|
|
|
if (StringUtils.isNotEmpty(info.getDepartment())) {
|
|
|
- //先估计id查出是否是父节点,是父节点则查出所以的子节点信息
|
|
|
+ //先根据id查出是否是父节点,是父节点则查出所有的子节点信息
|
|
|
List<String> childIds = mapper.findChildIds(info.getDepartment());
|
|
|
if ( null != childIds & childIds.size()>0){
|
|
|
childIds.add(info.getDepartment());
|
|
|
wrapper.in("a.department",childIds);
|
|
|
}else {
|
|
|
- wrapper.in("a.department", info.getDepartment());
|
|
|
+ wrapper.eq("a.department", info.getDepartment());
|
|
|
}
|
|
|
}
|
|
|
//7、状态
|
|
@@ -234,6 +240,49 @@ public class ContractInfoService {
|
|
|
dto.setCwWorkClientContactDTOList(list);
|
|
|
dto.setContractProperList(dtos);
|
|
|
}
|
|
|
+ } else {
|
|
|
+ //传过来的是纸质归档的id
|
|
|
+ ContractFilePaper filePaper = paperMapper.getById(id);
|
|
|
+ if ( null != filePaper ) {
|
|
|
+ dto = mapper.findById(filePaper.getContractInfoId());
|
|
|
+ if (null != dto) {
|
|
|
+ //参与签约方信息
|
|
|
+ List<ContractParticipant> participant = participantMapper.findByInfoId(dto.getId());
|
|
|
+ dto.setContractStatus("新创建");
|
|
|
+ // 查询合同登记附件信息
|
|
|
+ List<WorkAttachmentDto> dtos = mapper.findDtos(dto.getId());
|
|
|
+ if (CollectionUtils.isNotEmpty(dtos)) {
|
|
|
+ for (WorkAttachmentDto i : dtos) {
|
|
|
+ i.setCreateBy(UserUtils.get(i.getBy()));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ List<CwWorkClientBaseDTO> list = new ArrayList<>();
|
|
|
+ if (participant.size()>0){
|
|
|
+ participant.forEach(cw->{
|
|
|
+ CwWorkClientBaseDTO baseDTO = new CwWorkClientBaseDTO();
|
|
|
+ baseDTO.setName(cw.getCustomerName());
|
|
|
+ baseDTO.setNo(cw.getCustomerNo());
|
|
|
+ list.add(baseDTO);
|
|
|
+ });
|
|
|
+
|
|
|
+ }
|
|
|
+ //估计合同登记id查出归档信息
|
|
|
+ ContractFile contractFile = fileMapper.getInfoByConId(dto.getId());
|
|
|
+ if (null != contractFile){
|
|
|
+ //查归档附件信息
|
|
|
+ List<WorkAttachmentDto> fileDtos = mapper.findDtos(contractFile.getId());
|
|
|
+ if (CollectionUtils.isNotEmpty(fileDtos)) {
|
|
|
+ for (WorkAttachmentDto i : fileDtos) {
|
|
|
+ i.setCreateBy(UserUtils.get(i.getBy()));
|
|
|
+ }
|
|
|
+ dto.setContractInfoList(fileDtos);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ dto.setCwWorkClientContactDTOList(list);
|
|
|
+ dto.setContractProperList(dtos);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -317,10 +366,8 @@ public class ContractInfoService {
|
|
|
//获取当前登录人信息
|
|
|
UserDTO userDTO = UserUtils.getCurrentUserDTO();
|
|
|
//合同编号生成
|
|
|
-// String serialNum = serialnumTplService.genSerialNum(userDTO.getCompanyDTO().getId(), WorkContractInfoDto.BIZ_CODE);
|
|
|
ContractInfo contractInfo = new ContractInfo();
|
|
|
BeanUtils.copyProperties(info, contractInfo);
|
|
|
-// info.setNo(serialNum);
|
|
|
contractInfo.setUpdateBy(userDTO.getId());
|
|
|
contractInfo.setUpdateDate(new Date());
|
|
|
|
|
@@ -330,17 +377,25 @@ public class ContractInfoService {
|
|
|
}else {
|
|
|
contractInfo.setChangeNum(contractInfo.getChangeNum());
|
|
|
}
|
|
|
- //对管理员上传归档文件进行相关操作
|
|
|
+ //对管理员上传归档文件进行相关操作 归档修改
|
|
|
if (StringUtils.isNotEmpty(contractInfo.getFiledType()) && contractInfo.getFiledType().equals("5")){
|
|
|
//根据id找到归档表id
|
|
|
ContractFile contractFile = fileMapper.getInfoByConId(info.getId());
|
|
|
- contractFile.setContractInfoList(info.getContractInfoList());
|
|
|
- if (CollectionUtils.isNotEmpty(contractFile.getContractInfoList())){
|
|
|
- updateFiles(contractFile.getContractInfoList(), userDTO, contractFile.getId());
|
|
|
+ if ( null != contractFile) {
|
|
|
+ contractFile.setContractInfoList(info.getContractInfoList());
|
|
|
+ if (CollectionUtils.isNotEmpty(contractFile.getContractInfoList())){
|
|
|
+ updateFiles(contractFile.getContractInfoList(), userDTO, contractFile.getId());
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+ //纸质归档修改
|
|
|
+ ContractFilePaper filePaper = paperMapper.selectFilePaperByContractInfoId(info.getId());
|
|
|
+ if (null != filePaper) {
|
|
|
+ filePaper.setFiledNo(info.getFiledNo());
|
|
|
+ filePaper.setConfirmFiledNo(info.getConfirmFiledNo());
|
|
|
+ paperMapper.updateById(filePaper);
|
|
|
+ }
|
|
|
|
|
|
mapper.updateById(contractInfo);
|
|
|
ContractParticipant participant = new ContractParticipant();
|
|
@@ -365,7 +420,6 @@ public class ContractInfoService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
List<WorkAttachmentDto> list = info.getContractProperList();
|
|
|
if (CollectionUtils.isNotEmpty(list)) {
|
|
|
updateFiles(list, userDTO, info.getId());
|