|
|
@ -111,6 +111,7 @@ public class HuzhouPlaninfofileServiceImpl extends ServiceImpl<HuzhouPlaninfofil |
|
|
|
public void submitPlanUploadFile(MultipartFile[] files, String planinfoid,String approvalMoneyFieldsValue, |
|
|
|
String contractMoneyFieldsValue, |
|
|
|
List<HuzhouContractinfo> contractList) throws IOException { |
|
|
|
|
|
|
|
// 判断是否为二次上传,是则清楚原有记录
|
|
|
|
if (CollectionUtil.isNotEmpty(contractList)){ |
|
|
|
hasOldContractInfo(contractList); |
|
|
@ -144,6 +145,17 @@ public class HuzhouPlaninfofileServiceImpl extends ServiceImpl<HuzhouPlaninfofil |
|
|
|
//根据项目计划id获取项目信息
|
|
|
|
String taskName = planinfo.getTaskName(); |
|
|
|
taskName=StrUtil.trim(taskName); |
|
|
|
|
|
|
|
if (CollectionUtil.isEmpty(contractList) && taskName.equals("合同签订")){ |
|
|
|
throw new EasyException("合同信息不能为空!"); |
|
|
|
} |
|
|
|
// 校验合同金额
|
|
|
|
if (CollectionUtil.isNotEmpty(contractList)) { |
|
|
|
if (contractinfoService.checkContractAmount(contractList, contractMoneyFieldsValue, taskName)) { |
|
|
|
log.info("金额校验成功!"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
String projectId = planinfoService.getById(planinfoid).getProjectId(); |
|
|
|
HuzhouProjectinfo huzhouProjectinfo = projectinfoService.getById(projectId); |
|
|
|
|
|
|
@ -357,16 +369,8 @@ public class HuzhouPlaninfofileServiceImpl extends ServiceImpl<HuzhouPlaninfofil |
|
|
|
if(list.size()==0){ |
|
|
|
projectinfoService.modifyStageById(pid,"6"); |
|
|
|
} |
|
|
|
|
|
|
|
if (CollectionUtil.isEmpty(contractList) && taskName.equals("合同签订")){ |
|
|
|
throw new EasyException("合同信息不能为空!"); |
|
|
|
} |
|
|
|
// 校验合同金额
|
|
|
|
if (CollectionUtil.isNotEmpty(contractList)) { |
|
|
|
if (contractinfoService.checkContractAmount(contractList, contractMoneyFieldsValue, taskName)) { |
|
|
|
contractinfoService.addContractinfo(files, contractList); |
|
|
|
} |
|
|
|
} |
|
|
|
// 增加合同信息
|
|
|
|
contractinfoService.addContractinfo(files, contractList); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
@ -382,7 +386,7 @@ public class HuzhouPlaninfofileServiceImpl extends ServiceImpl<HuzhouPlaninfofil |
|
|
|
.eq(HuzhouContractinfo::getFlag,"实际"); |
|
|
|
List<HuzhouContractinfo> tmp = contractinfoService.list(qw); |
|
|
|
if (tmp.size()>0){ |
|
|
|
// 清楚原有合同信息(实际)
|
|
|
|
// 清除原有合同信息(实际)
|
|
|
|
LambdaQueryWrapper<HuzhouContractinfo> deleteWrapper = new LambdaQueryWrapper<>(); |
|
|
|
deleteWrapper.eq(HuzhouContractinfo::getProjectId, contractinfo.getProjectId()) |
|
|
|
.eq(HuzhouContractinfo::getTaskName, contractinfo.getTaskName()) |
|
|
@ -470,7 +474,7 @@ public class HuzhouPlaninfofileServiceImpl extends ServiceImpl<HuzhouPlaninfofil |
|
|
|
huzhouPlaninfo.setId(planinfoid); |
|
|
|
|
|
|
|
// 判断是否更新合同信息
|
|
|
|
updateContractInfo(files, flag, contractinfoList, taskName); |
|
|
|
updateContractInfo(files, flag, contractinfoList,contractMoneyFieldsValue, taskName); |
|
|
|
|
|
|
|
if("3".equals(flag)){ |
|
|
|
huzhouPlaninfo.setIsfinish("0"); |
|
|
@ -574,14 +578,30 @@ public class HuzhouPlaninfofileServiceImpl extends ServiceImpl<HuzhouPlaninfofil |
|
|
|
planinfoService.updateById(huzhouPlaninfo1); |
|
|
|
} |
|
|
|
} |
|
|
|
ObjectMapper mapper = new ObjectMapper(); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
private void updateContractInfo(MultipartFile[] files, String flag, String contractinfoList, String taskName) throws IOException { |
|
|
|
/** |
|
|
|
* 修改合同信息 |
|
|
|
* @param files |
|
|
|
* @param flag |
|
|
|
* @param contractinfoList |
|
|
|
* @param contractMoneyFieldsValue |
|
|
|
* @param taskName |
|
|
|
* @throws IOException |
|
|
|
*/ |
|
|
|
private void updateContractInfo(MultipartFile[] files, String flag, String contractinfoList, String contractMoneyFieldsValue, String taskName) throws IOException { |
|
|
|
if (StrUtil.isNotBlank(contractinfoList) && "1".equals(flag)) { |
|
|
|
ObjectMapper mapper = new ObjectMapper(); |
|
|
|
// 1.需要更新的合同信息集合
|
|
|
|
List<HuzhouContractinfo> contractList = mapper.readValue(contractinfoList, new TypeReference<List<HuzhouContractinfo>>() { |
|
|
|
}); |
|
|
|
if (contractinfoService.checkContractAmount(contractList, contractMoneyFieldsValue, taskName)) { |
|
|
|
log.info("金额校验成功!"); |
|
|
|
} |
|
|
|
|
|
|
|
// 2.封装条件
|
|
|
|
LambdaQueryWrapper<HuzhouContractinfo> qw = new LambdaQueryWrapper<>(); |
|
|
|
qw.eq(HuzhouContractinfo::getProjectId, contractList.get(0).getProjectId()) |
|
|
@ -599,11 +619,11 @@ public class HuzhouPlaninfofileServiceImpl extends ServiceImpl<HuzhouPlaninfofil |
|
|
|
HuzhouProjectinfo huzhouProjectinfo = projectinfoService.getById(projectid); |
|
|
|
String superLeader = ""; |
|
|
|
//如果项目信息为空说明是子项目
|
|
|
|
if(huzhouProjectinfo==null){ |
|
|
|
if (huzhouProjectinfo == null) { |
|
|
|
HuzhouSubProjectinfo bySubId = subProjectinfoService.getById(projectid); |
|
|
|
superLeader = bySubId.getSuperLeader(); |
|
|
|
}else { |
|
|
|
superLeader=huzhouProjectinfo.getSuperLeader(); |
|
|
|
} else { |
|
|
|
superLeader = huzhouProjectinfo.getSuperLeader(); |
|
|
|
} |
|
|
|
//获取上级指导室中文名称
|
|
|
|
SysDict dict = sysDictService.getDictByCode("superLeader", superLeader); |
|
|
@ -611,11 +631,11 @@ public class HuzhouPlaninfofileServiceImpl extends ServiceImpl<HuzhouPlaninfofil |
|
|
|
//上级指导室中文名称查询角色有哪些人
|
|
|
|
List<HashMap<String, String>> userDictByRoles = userService.getUserDictByRoles(dictName); |
|
|
|
ArrayList<String> userIdlist = new ArrayList<>(); |
|
|
|
if(userDictByRoles==null||userDictByRoles.size()==0){ |
|
|
|
String error = "任务牵头处室"+dictName+"负责人未找到"; |
|
|
|
if (userDictByRoles == null || userDictByRoles.size() == 0) { |
|
|
|
String error = "任务牵头处室" + dictName + "负责人未找到"; |
|
|
|
throw new EasyException(error); |
|
|
|
} |
|
|
|
for (HashMap<String, String> map:userDictByRoles |
|
|
|
for (HashMap<String, String> map : userDictByRoles |
|
|
|
) { |
|
|
|
String userid = map.get("value"); |
|
|
|
userIdlist.add(userid); |
|
|
|