|
@@ -87,6 +87,11 @@ public class ContractInfoService {
|
|
|
*/
|
|
|
public void updatePaperInfo(ContractInfo info) {
|
|
|
mapper.updatePaperInfo(info.getId(), info.getActualContractAmount(),info.getContractApprovalType(), info.getFiledPaperType());
|
|
|
+ List<WorkAttachmentDto> list = info.getContractInfoList();
|
|
|
+ UserDTO userDTO = UserUtils.getCurrentUserDTO();
|
|
|
+ if (CollectionUtils.isNotEmpty(list)) {
|
|
|
+ updateFiles(list, userDTO, info.getId());
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
public IPage<ContractInfo> list(Page<ContractInfo> page, ContractInfo info, QueryWrapper<ContractInfo> wrapper) {
|
|
@@ -133,8 +138,15 @@ public class ContractInfoService {
|
|
|
}
|
|
|
}
|
|
|
//7、状态
|
|
|
- if (StringUtils.isNotEmpty(info.getStatus())) {
|
|
|
- wrapper.like("a.status", info.getStatus());
|
|
|
+ //判断 状态是否包含 逗号
|
|
|
+ if(StringUtils.isNotBlank(info.getStatus())){
|
|
|
+ if (info.getStatus().contains(",")) {
|
|
|
+ List<String> statusList = Lists.newLinkedList();
|
|
|
+ statusList = Arrays.asList(info.getStatus().split(","));
|
|
|
+ wrapper.in("a.status", statusList);
|
|
|
+ }else{
|
|
|
+ wrapper.like("a.status", info.getStatus());
|
|
|
+ }
|
|
|
}
|
|
|
//8、归档状态
|
|
|
if (StringUtils.isNotEmpty(info.getFiledType())) {
|
|
@@ -144,6 +156,10 @@ public class ContractInfoService {
|
|
|
if (StringUtils.isNotEmpty(info.getFiledPaperType())) {
|
|
|
wrapper.like("a.filed_paper_type", info.getFiledPaperType());
|
|
|
}
|
|
|
+ //委托方名称
|
|
|
+ if (StringUtils.isNotBlank(info.getClientContactsName())) {
|
|
|
+ wrapper.like("cw_wcb.name", info.getClientContactsName());
|
|
|
+ }
|
|
|
wrapper.eq("a.del_flag","0");
|
|
|
|
|
|
|
|
@@ -206,6 +222,7 @@ public class ContractInfoService {
|
|
|
public ContractInfo findById(String id) {
|
|
|
|
|
|
ContractInfo dto = mapper.findById(id);
|
|
|
+ List<WorkAttachmentDto> fileList = Lists.newArrayList();
|
|
|
|
|
|
if (dto != null){
|
|
|
List<ContractParticipant> participant = participantMapper.findByInfoId(dto.getId());
|
|
@@ -217,6 +234,7 @@ public class ContractInfoService {
|
|
|
i.setCreateBy(UserUtils.get(i.getBy()));
|
|
|
}
|
|
|
}
|
|
|
+ fileList.addAll(dtos);
|
|
|
List<CwWorkClientBaseDTO> list = new ArrayList<>();
|
|
|
if (participant.size()>0){
|
|
|
participant.forEach(cw->{
|
|
@@ -248,12 +266,13 @@ public class ContractInfoService {
|
|
|
for (WorkAttachmentDto i : fileDtos) {
|
|
|
i.setCreateBy(UserUtils.get(i.getBy()));
|
|
|
}
|
|
|
- dto.setContractInfoList(fileDtos);
|
|
|
+ fileList.addAll(fileDtos);
|
|
|
+ //dto.setContractInfoList(fileDtos);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
dto.setCwWorkClientContactDTOList(list);
|
|
|
- dto.setContractProperList(dtos);
|
|
|
+ dto.setContractProperList(fileList);
|
|
|
} else {
|
|
|
//穿来的是归档的id
|
|
|
ContractFile infoByConId = fileMapper.getById(id);
|
|
@@ -269,6 +288,7 @@ public class ContractInfoService {
|
|
|
i.setCreateBy(UserUtils.get(i.getBy()));
|
|
|
}
|
|
|
}
|
|
|
+ fileList.addAll(dtos);
|
|
|
List<CwWorkClientBaseDTO> list = new ArrayList<>();
|
|
|
if (participant.size()>0){
|
|
|
participant.forEach(cw->{
|
|
@@ -286,12 +306,13 @@ public class ContractInfoService {
|
|
|
for (WorkAttachmentDto i : fileDtos) {
|
|
|
i.setCreateBy(UserUtils.get(i.getBy()));
|
|
|
}
|
|
|
- dto.setContractInfoList(fileDtos);
|
|
|
+ fileList.addAll(fileDtos);
|
|
|
+ //dto.setContractInfoList(fileDtos);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
dto.setCwWorkClientContactDTOList(list);
|
|
|
- dto.setContractProperList(dtos);
|
|
|
+ dto.setContractProperList(fileList);
|
|
|
}
|
|
|
} else {
|
|
|
//传过来的是纸质归档的id
|
|
@@ -309,6 +330,7 @@ public class ContractInfoService {
|
|
|
i.setCreateBy(UserUtils.get(i.getBy()));
|
|
|
}
|
|
|
}
|
|
|
+ fileList.addAll(dtos);
|
|
|
List<CwWorkClientBaseDTO> list = new ArrayList<>();
|
|
|
if (participant.size()>0){
|
|
|
participant.forEach(cw->{
|
|
@@ -325,7 +347,8 @@ public class ContractInfoService {
|
|
|
for (WorkAttachmentDto i : fileDtos) {
|
|
|
i.setCreateBy(UserUtils.get(i.getBy()));
|
|
|
}
|
|
|
- dto.setContractInfoList(fileDtos);
|
|
|
+ fileList.addAll(fileDtos);
|
|
|
+ //dto.setContractInfoList(fileDtos);
|
|
|
}
|
|
|
// //估计合同登记id查出归档信息
|
|
|
// ContractFile contractFile = fileMapper.getInfoByConId(dto.getId());
|
|
@@ -341,7 +364,7 @@ public class ContractInfoService {
|
|
|
// }
|
|
|
|
|
|
dto.setCwWorkClientContactDTOList(list);
|
|
|
- dto.setContractProperList(dtos);
|
|
|
+ dto.setContractProperList(fileList);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -426,12 +449,31 @@ public class ContractInfoService {
|
|
|
public String update(ContractInfo info) throws Exception{
|
|
|
//获取当前登录人信息
|
|
|
UserDTO userDTO = UserUtils.getCurrentUserDTO();
|
|
|
- //合同编号生成
|
|
|
+
|
|
|
ContractInfo contractInfo = new ContractInfo();
|
|
|
BeanUtils.copyProperties(info, contractInfo);
|
|
|
contractInfo.setUpdateBy(userDTO.getId());
|
|
|
contractInfo.setUpdateDate(new Date());
|
|
|
|
|
|
+ //合同编号生成
|
|
|
+ String serialNum = "";
|
|
|
+ if (StringUtils.isNotBlank(contractInfo.getContractType()) && StringUtils.isBlank(contractInfo.getContractNo())){
|
|
|
+ if (contractInfo.getContractType().equals("1")){
|
|
|
+ serialNum = serialnumTplService.genSerialNum(userDTO.getCompanyDTO().getId(), ContractInfo.SERIAL_NUMBER1);
|
|
|
+ } else if (contractInfo.getContractType().equals("2")) {
|
|
|
+ serialNum = serialnumTplService.genSerialNum(userDTO.getCompanyDTO().getId(), ContractInfo.SERIAL_NUMBER2);
|
|
|
+ } else if (contractInfo.getContractType().equals("3")) {
|
|
|
+ serialNum = serialnumTplService.genSerialNum(userDTO.getCompanyDTO().getId(), ContractInfo.SERIAL_NUMBER3);
|
|
|
+ } else if (contractInfo.getContractType().equals("4")) {
|
|
|
+ serialNum = serialnumTplService.genSerialNum(userDTO.getCompanyDTO().getId(), ContractInfo.SERIAL_NUMBER4);
|
|
|
+ } else if (contractInfo.getContractType().equals("5")) {
|
|
|
+ serialNum = serialnumTplService.genSerialNum(userDTO.getCompanyDTO().getId(), ContractInfo.SERIAL_NUMBER5);
|
|
|
+ } else if (contractInfo.getContractType().equals("6")) {
|
|
|
+ serialNum = serialnumTplService.genSerialNum(userDTO.getCompanyDTO().getId(), ContractInfo.SERIAL_NUMBER6);
|
|
|
+ }
|
|
|
+ contractInfo.setContractNo(serialNum);
|
|
|
+ }
|
|
|
+
|
|
|
if (StringUtils.isNotEmpty(contractInfo.getStatus()) &&!contractInfo.getStatus().equals("5")){
|
|
|
int num = Integer.parseInt(contractInfo.getChangeNum()) + 1;
|
|
|
contractInfo.setChangeNum(num + "");
|