验证符合性流程-定时发消息。法规清单催办开发。
This commit is contained in:
+9
@@ -67,6 +67,15 @@ public enum OperatorTypeEnum {
|
||||
CERTIFICATION_INVENTORY_DUTY_PERSON_SUBMIT_TASK("认证清单-责任人提交任务","certificationInventoryDutyPersonSubmitTask"),
|
||||
CERTIFICATION_INVENTORY_REVIEW_THROUGH("认证清单-认证工程师审核通过","certificationInventoryReviewThrough"),
|
||||
CERTIFICATION_INVENTORY_REVIEW_RETURNED("认证清单-认证工程师审核退回","certificationInventoryReviewReturned"),
|
||||
|
||||
/**
|
||||
* 项目库-法规清单
|
||||
*/
|
||||
LAWS_INVENTORY_DESIGN_EXPEDITING("法规清单-催办设计符合性流程","lawsInventoryDesignExpediting"),
|
||||
LAWS_INVENTORY_VERIFY_EXPEDITING("法规清单-催办验证符合性流程","lawsInventoryVerifyExpediting"),
|
||||
LAWS_INVENTORY_STUDIO_EXPEDITING("法规清单-studio催办","lawsInventoryStudioExpediting"),
|
||||
LAWS_INVENTORY_REGULATION_OWNER_EXPEDITING("法规清单-法规工程师催办","lawsInventoryRegulationOwnerExpediting"),
|
||||
LAWS_INVENTORY_ENGINEERING_INTERFACE_PERSON_EXPEDITING("法规清单-工程接口人催办","lawsInventoryEngineeringInterfacePersonExpediting"),
|
||||
;
|
||||
|
||||
String name;
|
||||
|
||||
+200
-2
@@ -4,12 +4,15 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.jero.common.constant.enums.MessageType2Enum;
|
||||
import com.jero.common.constant.enums.MessageTypeEnum;
|
||||
import com.jero.common.constant.enums.MsgColorEnum;
|
||||
import com.jero.common.util.DateUtils;
|
||||
import com.jero.modules.document.entity.BussDocumentLibraryEO;
|
||||
import com.jero.modules.document.service.IBussDocumentLibraryEOService;
|
||||
import com.jero.modules.feishu.enums.TemplateInfoEnum2;
|
||||
import com.jero.modules.feishu.service.IFeishuService;
|
||||
import com.jero.modules.feishu.vo.FeishuMsg2Vo;
|
||||
import com.jero.modules.feishu.vo.FeishuMsgVo;
|
||||
import com.jero.modules.project.entity.*;
|
||||
import com.jero.modules.project.enums.ComplianceFlowStatusEnum;
|
||||
import com.jero.modules.project.enums.DesignComplianceStatusEnum;
|
||||
import com.jero.modules.project.enums.JumpLinkEnum;
|
||||
import com.jero.modules.project.enums.SendMsgFlagEnum;
|
||||
@@ -68,12 +71,122 @@ public class VerifyComplianceJob implements Job {
|
||||
private ISysUserService sysUserService;
|
||||
@Autowired
|
||||
private IFeishuService feishuService;
|
||||
private static SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
|
||||
@Override
|
||||
public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
|
||||
log.info("验证符合性流程,定时任务开启 =====================================================");
|
||||
|
||||
// 查询出 结果待提交的数据
|
||||
QueryWrapper<ProjectLawsInventoryEO> lawsInventoryEOQueryWrap = new QueryWrapper<>();
|
||||
lawsInventoryEOQueryWrap.lambda().eq(ProjectLawsInventoryEO::getVerifyFlowStatus, ComplianceFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue());
|
||||
List<ProjectLawsInventoryEO> projectLawsInventoryEOList = this.projectLawsInventoryEOService.list(lawsInventoryEOQueryWrap);
|
||||
if(CollectionUtils.isNotEmpty(projectLawsInventoryEOList)){
|
||||
// 根据项目进行分组
|
||||
Map<String, List<ProjectLawsInventoryEO>> lawsInventoryByProjectLibraryIdGroupMap = projectLawsInventoryEOList.stream().collect(Collectors.groupingBy(ProjectLawsInventoryEO::getProjectLibraryId));
|
||||
for (Map.Entry<String, List<ProjectLawsInventoryEO>> lawsInventoryByProjectLibraryIdGroup : lawsInventoryByProjectLibraryIdGroupMap.entrySet()) {
|
||||
String projectLibraryId = lawsInventoryByProjectLibraryIdGroup.getKey();
|
||||
List<ProjectLawsInventoryEO> lawsInventoryListByProjectLibraryId = lawsInventoryByProjectLibraryIdGroup.getValue();
|
||||
if(StringUtils.isEmpty(projectLibraryId) || CollectionUtils.isEmpty(lawsInventoryListByProjectLibraryId)){
|
||||
continue;
|
||||
}
|
||||
|
||||
Map<String, List<ProjectLawsInventoryEO>> lawsInventoryByVerifyDutyIdGroupMap = lawsInventoryListByProjectLibraryId.stream().collect(Collectors.groupingBy(ProjectLawsInventoryEO::getVerifyDutyId));
|
||||
for (Map.Entry<String, List<ProjectLawsInventoryEO>> lawsInventoryByVerifyDutyIdGroup : lawsInventoryByVerifyDutyIdGroupMap.entrySet()) {
|
||||
String verifyDutyId = lawsInventoryByVerifyDutyIdGroup.getKey();
|
||||
List<ProjectLawsInventoryEO> verifyDutyDataList = lawsInventoryByVerifyDutyIdGroup.getValue();
|
||||
if(StringUtils.isEmpty(verifyDutyId) || CollectionUtils.isEmpty(verifyDutyDataList)){
|
||||
continue;
|
||||
}
|
||||
|
||||
List<String> userIdList = Arrays.asList(verifyDutyId.split(","));
|
||||
|
||||
Map<String, Object> sendMsgDataListMap = this.disposeSendMsgDataList(verifyDutyDataList);
|
||||
|
||||
// 十四天后结束的
|
||||
List<ProjectLawsInventoryEO> fourteenDaysList = (List<ProjectLawsInventoryEO>) sendMsgDataListMap.get("fourteenDaysList");
|
||||
if(CollectionUtils.isNotEmpty(fourteenDaysList)){
|
||||
Date verifyDueDate = fourteenDaysList.get(0).getVerifyDueDate();
|
||||
String endTime = "";
|
||||
if(verifyDueDate != null){
|
||||
endTime = DateUtils.formatDate(verifyDueDate);
|
||||
}
|
||||
String serialNumbers = fourteenDaysList.stream().map(ProjectLawsInventoryEO::getSerialNumber).distinct().collect(Collectors.joining(","));
|
||||
// 给责任人发消息
|
||||
Map<String,Object> params = new HashMap<>();
|
||||
params.put("contentCn","您好,您的任务将于14天后结束,请及时查看处理。");
|
||||
params.put("contentEn","Hello! Your task will end in 14 days. Please check and address it in a timely manner. ");
|
||||
params.put("projectLibraryId",projectLibraryId);
|
||||
params.put("endTime",endTime);
|
||||
params.put("userIdList",userIdList);
|
||||
params.put("serialNumbers",serialNumbers);
|
||||
this.projectLawsInventoryEOService.sendMessageByTemplateId(TemplateInfoEnum2.VALIDATION_COMPLIANCE_CONFIRMATION1.getValue(),params);
|
||||
}
|
||||
|
||||
// 七天后结束的
|
||||
List<ProjectLawsInventoryEO> sevenDaysList = (List<ProjectLawsInventoryEO>) sendMsgDataListMap.get("sevenDaysList");
|
||||
if(CollectionUtils.isNotEmpty(sevenDaysList)){
|
||||
Date verifyDueDate = sevenDaysList.get(0).getVerifyDueDate();
|
||||
String endTime = "";
|
||||
if(verifyDueDate != null){
|
||||
endTime = DateUtils.formatDate(verifyDueDate);
|
||||
}
|
||||
String serialNumbers = sevenDaysList.stream().map(ProjectLawsInventoryEO::getSerialNumber).distinct().collect(Collectors.joining(","));
|
||||
// 给责任人发消息
|
||||
Map<String,Object> params = new HashMap<>();
|
||||
params.put("contentCn","您好,您的任务将于7天后结束,请及时查看处理。");
|
||||
params.put("contentEn","Hello! Your task will end in 7 days. Please check and address it in a timely manner. ");
|
||||
params.put("projectLibraryId",projectLibraryId);
|
||||
params.put("endTime",endTime);
|
||||
params.put("userIdList",userIdList);
|
||||
params.put("serialNumbers",serialNumbers);
|
||||
this.projectLawsInventoryEOService.sendMessageByTemplateId(TemplateInfoEnum2.VALIDATION_COMPLIANCE_CONFIRMATION1.getValue(),params);
|
||||
}
|
||||
|
||||
// 当天结束的
|
||||
List<ProjectLawsInventoryEO> currentDaysList = (List<ProjectLawsInventoryEO>) sendMsgDataListMap.get("currentDaysList");
|
||||
if(CollectionUtils.isNotEmpty(currentDaysList)){
|
||||
Date verifyDueDate = currentDaysList.get(0).getVerifyDueDate();
|
||||
String endTime = "";
|
||||
if(verifyDueDate != null){
|
||||
endTime = DateUtils.formatDate(verifyDueDate);
|
||||
}
|
||||
String serialNumbers = currentDaysList.stream().map(ProjectLawsInventoryEO::getSerialNumber).distinct().collect(Collectors.joining(","));
|
||||
// 给法规工程师发消息
|
||||
Map<String,Object> params = new HashMap<>();
|
||||
params.put("contentCn","您好,您的任务将于今天到期,请尽快查看处理。");
|
||||
params.put("contentEn","Hello! Your task will expire today. Please check and address it ASAP. ");
|
||||
params.put("projectLibraryId",projectLibraryId);
|
||||
params.put("endTime",endTime);
|
||||
params.put("userIdList",userIdList);
|
||||
params.put("serialNumbers",serialNumbers);
|
||||
this.projectLawsInventoryEOService.sendMessageByTemplateId(TemplateInfoEnum2.VALIDATION_COMPLIANCE_CONFIRMATION1.getValue(),params);
|
||||
}
|
||||
// 逾期的
|
||||
List<ProjectLawsInventoryEO> overdueList = (List<ProjectLawsInventoryEO>) sendMsgDataListMap.get("overdueList");
|
||||
if(CollectionUtils.isNotEmpty(overdueList)){
|
||||
Date verifyDueDate = overdueList.get(0).getVerifyDueDate();
|
||||
String endTime = "";
|
||||
if(verifyDueDate != null){
|
||||
endTime = DateUtils.formatDate(verifyDueDate);
|
||||
}
|
||||
String serialNumbers = overdueList.stream().map(ProjectLawsInventoryEO::getSerialNumber).distinct().collect(Collectors.joining(","));
|
||||
// 给法规工程师发消息
|
||||
Map<String,Object> params = new HashMap<>();
|
||||
params.put("contentCn","您好,您的任务已逾期,请尽快查看处理。");
|
||||
params.put("contentEn","Hello! Your task is overdue. Please check and address it ASAP. ");
|
||||
params.put("projectLibraryId",projectLibraryId);
|
||||
params.put("endTime",endTime);
|
||||
params.put("userIdList",userIdList);
|
||||
params.put("serialNumbers",serialNumbers);
|
||||
this.projectLawsInventoryEOService.sendMessageByTemplateId(TemplateInfoEnum2.VALIDATION_COMPLIANCE_CONFIRMATION3.getValue(),params);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//查询出已经启动了验证符合性流程的数据。 并且流程没有结束。
|
||||
QueryWrapper<ProjectTaskInventoryEO> queryProjectTaskInventoryWrapper = new QueryWrapper<>();
|
||||
/*QueryWrapper<ProjectTaskInventoryEO> queryProjectTaskInventoryWrapper = new QueryWrapper<>();
|
||||
queryProjectTaskInventoryWrapper.isNotNull("verify_p_id");
|
||||
List<String> status = new ArrayList<>();
|
||||
status.add(DesignComplianceStatusEnum.TO_SUBMIT.getValue());
|
||||
@@ -364,7 +477,92 @@ public class VerifyComplianceJob implements Job {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}*/
|
||||
log.info("验证符合性流程,定时任务结束 =====================================================");
|
||||
}
|
||||
|
||||
private Map<String, Object> disposeSendMsgDataList(List<ProjectLawsInventoryEO> projectLawsInventoryEOList) {
|
||||
Map<String,Object> result = new HashMap<>();
|
||||
Date currentDate = new Date();
|
||||
String currentDateStr = sdf.format(currentDate);
|
||||
|
||||
//获取十四天后的时间
|
||||
Calendar fourteenCalendar=new GregorianCalendar();
|
||||
fourteenCalendar.setTime(new Date());
|
||||
fourteenCalendar.add(Calendar.DATE,14);
|
||||
Date fourteenDays = fourteenCalendar.getTime();
|
||||
String fourteenDaysStr = sdf.format(fourteenDays);
|
||||
|
||||
//获取七天后的时间
|
||||
Calendar sevenCalendar=new GregorianCalendar();
|
||||
sevenCalendar.setTime(new Date());
|
||||
sevenCalendar.add(Calendar.DATE,7);
|
||||
Date sevenDays = sevenCalendar.getTime();
|
||||
String sevenDaysStr = sdf.format(sevenDays);
|
||||
|
||||
// 十四天后结束的
|
||||
List<ProjectLawsInventoryEO> fourteenDaysList = projectLawsInventoryEOList.stream().filter(data -> {
|
||||
boolean flag = false;
|
||||
if(data.getVerifyDueDate() != null){
|
||||
if (StringUtils.equals(fourteenDaysStr, sdf.format(data.getVerifyDueDate()))) {
|
||||
flag = true;
|
||||
}
|
||||
}
|
||||
return flag;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
// 七天后结束的
|
||||
List<ProjectLawsInventoryEO> sevenDaysList = projectLawsInventoryEOList.stream().filter(data -> {
|
||||
boolean flag = false;
|
||||
if(data.getVerifyDueDate() != null){
|
||||
if (StringUtils.equals(sevenDaysStr, sdf.format(data.getVerifyDueDate()))) {
|
||||
flag = true;
|
||||
}
|
||||
}
|
||||
return flag;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
// 当天结束的
|
||||
List<ProjectLawsInventoryEO> currentDaysList = projectLawsInventoryEOList.stream().filter(data -> {
|
||||
boolean flag = false;
|
||||
//结束日期是当前日期
|
||||
if(data.getVerifyDueDate() != null){
|
||||
if (StringUtils.equals(currentDateStr, sdf.format(data.getVerifyDueDate()))) {
|
||||
flag = true;
|
||||
}
|
||||
}
|
||||
return flag;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
// 逾期的 3天 7天 14天
|
||||
List<ProjectLawsInventoryEO> overdueList = projectLawsInventoryEOList.stream().filter(data -> {
|
||||
Calendar day3Later = new GregorianCalendar();
|
||||
day3Later.setTime(data.getVerifyDueDate());
|
||||
day3Later.add(Calendar.DATE, 3);
|
||||
Date overdue3Days = day3Later.getTime();
|
||||
|
||||
Calendar day7Later = new GregorianCalendar();
|
||||
day7Later.setTime(data.getVerifyDueDate());
|
||||
day7Later.add(Calendar.DATE, 7);
|
||||
Date overdue7Days = day7Later.getTime();
|
||||
|
||||
Calendar day14Later = new GregorianCalendar();
|
||||
day14Later.setTime(data.getVerifyDueDate());
|
||||
day14Later.add(Calendar.DATE, 14);
|
||||
Date overdue14Days = day14Later.getTime();
|
||||
|
||||
boolean flag = (
|
||||
StringUtils.equals(sdf.format(overdue3Days), sdf.format(currentDate))
|
||||
|| StringUtils.equals(sdf.format(overdue7Days), sdf.format(currentDate))
|
||||
|| StringUtils.equals(sdf.format(overdue14Days), sdf.format(currentDate))
|
||||
);
|
||||
return flag;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
result.put("currentDaysList",currentDaysList);
|
||||
result.put("sevenDaysList",sevenDaysList);
|
||||
result.put("overdueList",overdueList);
|
||||
result.put("fourteenDaysList",fourteenDaysList);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
+12
@@ -214,4 +214,16 @@ public interface IProjectLawsInventoryEOService extends IService<ProjectLawsInve
|
||||
* @param projectLawsInventoryEOS
|
||||
*/
|
||||
void lawsInventoryEOListSortByInventoryAffirmDueDate(List<ProjectLawsInventoryEO> projectLawsInventoryEOS);
|
||||
|
||||
/**
|
||||
* 法规清单根据设计符合性截至日期顺序排序
|
||||
* @param projectLawsInventoryEOS
|
||||
*/
|
||||
void lawsInventoryEOListSortByDesignDueDate(List<ProjectLawsInventoryEO> projectLawsInventoryEOS);
|
||||
|
||||
/**
|
||||
* 法规清单根据验证符合性截至日期顺序排序
|
||||
* @param projectLawsInventoryEOS
|
||||
*/
|
||||
void lawsInventoryEOListSortByVerifyDueDate(List<ProjectLawsInventoryEO> projectLawsInventoryEOS);
|
||||
}
|
||||
|
||||
+282
-2
@@ -572,6 +572,8 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
|
||||
* @param projectLawsInventoryEO
|
||||
*/
|
||||
private void updateProjectLawsInventorySendMessage(ProjectLawsInventoryEO projectLawsInventoryEO) {
|
||||
LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
|
||||
ProjectLawsInventoryEO projectLawsInventoryOld = this.queryById(projectLawsInventoryEO.getId());
|
||||
boolean toBeCheckedFlag = (
|
||||
StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(),ComplianceFlowStatusEnum.LIST_TO_BE_CHECKED.getValue())
|
||||
@@ -686,6 +688,57 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
|
||||
this.sendMessageByTemplateId(TemplateInfoEnum2.REGULATION_TASK_CONFIRMATION1.getValue(),params);
|
||||
}
|
||||
}
|
||||
|
||||
// 如果编辑了法规工程师,给新的法规工程师发消息
|
||||
if((StringUtils.isNotEmpty(projectLawsInventoryOld.getRegulationOwnerId()) && StringUtils.isNotEmpty(projectLawsInventoryEO.getRegulationOwnerId()))){
|
||||
if (!StringUtils.equals(projectLawsInventoryOld.getRegulationOwnerId(), projectLawsInventoryEO.getRegulationOwnerId())) {
|
||||
String endTime = "";
|
||||
String regulationOwnerId = "";
|
||||
|
||||
// 设计符合性 结果待审查、结果待提交 标识 判断法规工程师是否被修改了 如果被修改了,给新的法规工程师发消息
|
||||
boolean toBeReviewedDesignFlag = (
|
||||
StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(),ComplianceFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue())
|
||||
|| StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(),ComplianceFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue())
|
||||
);
|
||||
if(toBeReviewedDesignFlag){
|
||||
if(projectLawsInventoryEO.getDesignDueDate() != null){
|
||||
endTime = DateUtils.formatDate(projectLawsInventoryEO.getDesignDueDate());
|
||||
}
|
||||
|
||||
regulationOwnerId = projectLawsInventoryEO.getRegulationOwnerId();
|
||||
// 给法规工程师发消息
|
||||
Map<String,Object> params = new HashMap<>();
|
||||
params.put("contentCn","您好,"+currentUser.getUsername()+"向您分发了该任务,请及时查看处理。");
|
||||
params.put("contentEn","Hello! "+currentUser.getUsername()+" has assigned this task to you. Please check and address it in a timely manner.");
|
||||
params.put("projectLibraryId", projectLawsInventoryEO.getProjectLibraryId());
|
||||
params.put("endTime",endTime);
|
||||
params.put("userIdList",Arrays.asList(regulationOwnerId.split(",")));
|
||||
params.put("serialNumbers",projectLawsInventoryEO.getSerialNumber());
|
||||
this.sendMessageByTemplateId(TemplateInfoEnum2.DESIGN_COMPLIANCE_CONFIRMATION1.getValue(),params);
|
||||
}
|
||||
|
||||
// 验证符合性 结果待审查、结果待提交 标识 判断法规工程师是否被修改了 如果被修改了,给新的法规工程师发消息
|
||||
boolean toBeReviewedVerifyFlag = (
|
||||
StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(),ComplianceFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue())
|
||||
|| StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(),ComplianceFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue())
|
||||
);
|
||||
if (toBeReviewedVerifyFlag) {
|
||||
if(projectLawsInventoryEO.getVerifyDueDate() != null){
|
||||
endTime = DateUtils.formatDate(projectLawsInventoryEO.getVerifyDueDate());
|
||||
}
|
||||
regulationOwnerId = projectLawsInventoryEO.getRegulationOwnerId();
|
||||
// 给法规工程师发消息
|
||||
Map<String,Object> params = new HashMap<>();
|
||||
params.put("contentCn","您好,"+currentUser.getUsername()+"向您分发了该任务,请及时查看处理。");
|
||||
params.put("contentEn","Hello! "+currentUser.getUsername()+" has assigned this task to you. Please check and address it in a timely manner.");
|
||||
params.put("projectLibraryId", projectLawsInventoryEO.getProjectLibraryId());
|
||||
params.put("endTime",endTime);
|
||||
params.put("userIdList",Arrays.asList(regulationOwnerId.split(",")));
|
||||
params.put("serialNumbers",projectLawsInventoryEO.getSerialNumber());
|
||||
this.sendMessageByTemplateId(TemplateInfoEnum2.VALIDATION_COMPLIANCE_CONFIRMATION1.getValue(),params);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void setProjectLawsInventoryPermission(String userId, String projectId,String lawsInventoryId,Date now, List<ProjectUserPermission> adds, String belong) {
|
||||
@@ -9333,6 +9386,7 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
|
||||
String cut = json.getString("cut");
|
||||
String ids = json.getString("ids");
|
||||
String projectLibraryId = json.getString("projectLibraryId");
|
||||
String operateType = json.getString("operateType"); // 操作类型,判断是studio催办 还是法规工程师催办
|
||||
if(StringUtils.isEmpty(ids)){
|
||||
if(StringUtils.equals(cut,CutEnum.CN.getValue())){
|
||||
throw new JeroBootException("请至少选择一条数据!");
|
||||
@@ -9349,7 +9403,207 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
|
||||
lawsInventoryEOQueryWrapper.lambda().in(ProjectLawsInventoryEO::getId,projectLawsInventoryIdList);
|
||||
List<ProjectLawsInventoryEO> projectLawsInventoryEOList = this.baseMapper.selectList(lawsInventoryEOQueryWrapper);
|
||||
|
||||
//获取已经发起的 任务确认流程信息(当前处理人)
|
||||
// 只有studio催办的时候,才会给法规工程师发消息
|
||||
if(StringUtils.equals(operateType,OperatorTypeEnum.LAWS_INVENTORY_STUDIO_EXPEDITING.getValue())){
|
||||
// 如果设计符合性或验证符合性流程状态其中一个为 清单待校核,催办时就需要给这一条数据的法规工程师发消息
|
||||
List<ProjectLawsInventoryEO> toBeCheckedLawsInventoryList = projectLawsInventoryEOList.stream().filter(lawsInventory -> {
|
||||
boolean flag =false;
|
||||
if (StringUtils.equals(lawsInventory.getDesignFlowStatus(),ComplianceFlowStatusEnum.LIST_TO_BE_CHECKED.getValue())
|
||||
|| StringUtils.equals(lawsInventory.getVerifyFlowStatus(),ComplianceFlowStatusEnum.LIST_TO_BE_CHECKED.getValue())){
|
||||
flag = true;
|
||||
}
|
||||
return flag;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
if(CollectionUtils.isNotEmpty(toBeCheckedLawsInventoryList)){
|
||||
Map<String, List<ProjectLawsInventoryEO>> regulationOwnerGroupMap = toBeCheckedLawsInventoryList.stream().collect(Collectors.groupingBy(ProjectLawsInventoryEO::getRegulationOwnerId));
|
||||
for (Map.Entry<String, List<ProjectLawsInventoryEO>> regulationOwnerMap : regulationOwnerGroupMap.entrySet()) {
|
||||
String regulationOwnerId = regulationOwnerMap.getKey();
|
||||
List<ProjectLawsInventoryEO> lawsInventoryEOList = regulationOwnerMap.getValue();
|
||||
if(StringUtils.isEmpty(regulationOwnerId) || CollectionUtils.isEmpty(lawsInventoryEOList)){
|
||||
continue;
|
||||
}
|
||||
|
||||
this.lawsInventoryEOListSortByInventoryAffirmDueDate(lawsInventoryEOList);
|
||||
Date inventoryAffirmDueDate = lawsInventoryEOList.get(0).getInventoryAffirmDueDate();
|
||||
String endTime = "";
|
||||
if(inventoryAffirmDueDate != null){
|
||||
endTime = DateUtils.formatDate(inventoryAffirmDueDate);
|
||||
}
|
||||
String serialNumbers = lawsInventoryEOList.stream().map(ProjectLawsInventoryEO::getSerialNumber).distinct().collect(Collectors.joining(","));
|
||||
|
||||
List<String> userIdList = Arrays.asList(regulationOwnerId.split(","));
|
||||
// 给法规工程师发消息
|
||||
Map<String,Object> params = new HashMap<>();
|
||||
params.put("contentCn","您好,请及时校核法规清单内容并发起符合性流程,谢谢!");
|
||||
params.put("contentEn","Please check the content of the regulation list and initiate the compliance process in a timely manner. Thank you!");
|
||||
params.put("projectLibraryId",projectLibraryId);
|
||||
params.put("endTime",endTime);
|
||||
params.put("userIdList",userIdList);
|
||||
params.put("serialNumbers",serialNumbers);
|
||||
this.sendMessageByTemplateId(TemplateInfoEnum2.REGULATION_LIST_RELEASE1.getValue(),params);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 催办类型 可以只催设计符合性 也可以只催验证符合性
|
||||
String expeditingType = json.getString("expeditingType");
|
||||
if(StringUtils.contains(expeditingType,OperatorTypeEnum.LAWS_INVENTORY_DESIGN_EXPEDITING.getValue())){
|
||||
// 催办设计符合性流程状态为 清单待确认的 责任人
|
||||
List<ProjectLawsInventoryEO> toBeConfirmedLawsInventoryList = projectLawsInventoryEOList.stream().filter(lawsInventory -> {
|
||||
boolean flag =false;
|
||||
if (StringUtils.equals(lawsInventory.getDesignFlowStatus(),ComplianceFlowStatusEnum.TASK_TO_BE_CONFIRMED.getValue())){
|
||||
flag = true;
|
||||
}
|
||||
return flag;
|
||||
}).collect(Collectors.toList());
|
||||
if (CollectionUtils.isNotEmpty(toBeConfirmedLawsInventoryList)) {
|
||||
Map<String, List<ProjectLawsInventoryEO>> designDutyGroupMap = toBeConfirmedLawsInventoryList.stream().collect(Collectors.groupingBy(ProjectLawsInventoryEO::getDesignDutyId));
|
||||
for (Map.Entry<String, List<ProjectLawsInventoryEO>> designDutyMap : designDutyGroupMap.entrySet()) {
|
||||
String designDutyId = designDutyMap.getKey();
|
||||
List<ProjectLawsInventoryEO> lawsInventoryEOList = designDutyMap.getValue();
|
||||
if(StringUtils.isEmpty(designDutyId) || CollectionUtils.isEmpty(lawsInventoryEOList)){
|
||||
continue;
|
||||
}
|
||||
|
||||
this.lawsInventoryEOListSortByDesignDueDate(lawsInventoryEOList);
|
||||
Date designDueDate = lawsInventoryEOList.get(0).getDesignDueDate();
|
||||
String endTime = "";
|
||||
if(designDueDate != null){
|
||||
endTime = DateUtils.formatDate(designDueDate);
|
||||
}
|
||||
String serialNumbers = lawsInventoryEOList.stream().map(ProjectLawsInventoryEO::getSerialNumber).distinct().collect(Collectors.joining(","));
|
||||
|
||||
List<String> userIdList = Arrays.asList(designDutyId.split(","));
|
||||
// 给设计符合性流程责任人发消息
|
||||
Map<String,Object> params = new HashMap<>();
|
||||
params.put("contentCn","您好,请及时查看确认以下任务要求,谢谢!");
|
||||
params.put("contentEn","Hello! Please check and confirm the following task requirement in a timely manner. Thank you!");
|
||||
params.put("projectLibraryId",projectLibraryId);
|
||||
params.put("endTime",endTime);
|
||||
params.put("userIdList",userIdList);
|
||||
params.put("serialNumbers",serialNumbers);
|
||||
this.sendMessageByTemplateId(TemplateInfoEnum2.REGULATION_LIST_RELEASE2.getValue(),params);
|
||||
}
|
||||
}
|
||||
|
||||
// 催办设计符合性流程状态为 结果待提交的 责任人
|
||||
List<ProjectLawsInventoryEO> toBeSubmitLawsInventoryList = projectLawsInventoryEOList.stream().filter(lawsInventory -> {
|
||||
boolean flag =false;
|
||||
if (StringUtils.equals(lawsInventory.getDesignFlowStatus(),ComplianceFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue())){
|
||||
flag = true;
|
||||
}
|
||||
return flag;
|
||||
}).collect(Collectors.toList());
|
||||
if (CollectionUtils.isNotEmpty(toBeSubmitLawsInventoryList)) {
|
||||
Map<String, List<ProjectLawsInventoryEO>> designDutyGroupMap = toBeSubmitLawsInventoryList.stream().collect(Collectors.groupingBy(ProjectLawsInventoryEO::getVerifyDutyId));
|
||||
for (Map.Entry<String, List<ProjectLawsInventoryEO>> designDutyMap : designDutyGroupMap.entrySet()) {
|
||||
String designDutyId = designDutyMap.getKey();
|
||||
List<ProjectLawsInventoryEO> lawsInventoryEOList = designDutyMap.getValue();
|
||||
if(StringUtils.isEmpty(designDutyId) || CollectionUtils.isEmpty(lawsInventoryEOList)){
|
||||
continue;
|
||||
}
|
||||
this.lawsInventoryEOListSortByVerifyDueDate(lawsInventoryEOList);
|
||||
|
||||
Date designDueDate = lawsInventoryEOList.get(0).getVerifyDueDate();
|
||||
String endTime = "";
|
||||
if(designDueDate != null){
|
||||
endTime = DateUtils.formatDate(designDueDate);
|
||||
}
|
||||
String serialNumbers = lawsInventoryEOList.stream().map(ProjectLawsInventoryEO::getSerialNumber).distinct().collect(Collectors.joining(","));
|
||||
|
||||
List<String> userIdList = Arrays.asList(designDutyId.split(","));
|
||||
// 给设计符合性流程责任人发消息
|
||||
Map<String,Object> params = new HashMap<>();
|
||||
params.put("contentCn","您好,请尽快查看处理此项任务,谢谢!");
|
||||
params.put("contentEn","Hello! Please check and address the task ASAP. Thank you!");
|
||||
params.put("projectLibraryId",projectLibraryId);
|
||||
params.put("endTime",endTime);
|
||||
params.put("userIdList",userIdList);
|
||||
params.put("serialNumbers",serialNumbers);
|
||||
this.sendMessageByTemplateId(TemplateInfoEnum2.DESIGN_COMPLIANCE_CONFIRMATION1.getValue(),params);
|
||||
}
|
||||
}
|
||||
}
|
||||
if(StringUtils.contains(expeditingType,OperatorTypeEnum.LAWS_INVENTORY_VERIFY_EXPEDITING.getValue())){
|
||||
// 催办验证符合性流程状态为 清单待确认的 责任人
|
||||
List<ProjectLawsInventoryEO> toBeConfirmedLawsInventoryList = projectLawsInventoryEOList.stream().filter(lawsInventory -> {
|
||||
boolean flag =false;
|
||||
if (StringUtils.equals(lawsInventory.getVerifyFlowStatus(),ComplianceFlowStatusEnum.TASK_TO_BE_CONFIRMED.getValue())){
|
||||
flag = true;
|
||||
}
|
||||
return flag;
|
||||
}).collect(Collectors.toList());
|
||||
if (CollectionUtils.isNotEmpty(toBeConfirmedLawsInventoryList)) {
|
||||
Map<String, List<ProjectLawsInventoryEO>> verifyDutyGroupMap = toBeConfirmedLawsInventoryList.stream().collect(Collectors.groupingBy(ProjectLawsInventoryEO::getVerifyDutyId));
|
||||
for (Map.Entry<String, List<ProjectLawsInventoryEO>> verifyDutyMap : verifyDutyGroupMap.entrySet()) {
|
||||
String verifyDutyId = verifyDutyMap.getKey();
|
||||
List<ProjectLawsInventoryEO> lawsInventoryEOList = verifyDutyMap.getValue();
|
||||
if(StringUtils.isEmpty(verifyDutyId) || CollectionUtils.isEmpty(lawsInventoryEOList)){
|
||||
continue;
|
||||
}
|
||||
|
||||
this.lawsInventoryEOListSortByVerifyDueDate(lawsInventoryEOList);
|
||||
Date verifyDueDate = lawsInventoryEOList.get(0).getVerifyDueDate();
|
||||
String endTime = "";
|
||||
if(verifyDueDate != null){
|
||||
endTime = DateUtils.formatDate(verifyDueDate);
|
||||
}
|
||||
String serialNumbers = lawsInventoryEOList.stream().map(ProjectLawsInventoryEO::getSerialNumber).distinct().collect(Collectors.joining(","));
|
||||
|
||||
List<String> userIdList = Arrays.asList(verifyDutyId.split(","));
|
||||
// 给设计符合性流程责任人发消息
|
||||
Map<String,Object> params = new HashMap<>();
|
||||
params.put("contentCn","您好,请及时查看确认以下任务要求,谢谢!");
|
||||
params.put("contentEn","Hello! Please check and confirm the following task requirement in a timely manner. Thank you!");
|
||||
params.put("projectLibraryId",projectLibraryId);
|
||||
params.put("endTime",endTime);
|
||||
params.put("userIdList",userIdList);
|
||||
params.put("serialNumbers",serialNumbers);
|
||||
this.sendMessageByTemplateId(TemplateInfoEnum2.REGULATION_LIST_RELEASE2.getValue(),params);
|
||||
}
|
||||
}
|
||||
|
||||
// 催办验证符合性流程状态为 结果待提交的 责任人
|
||||
List<ProjectLawsInventoryEO> toBeSubmitLawsInventoryList = projectLawsInventoryEOList.stream().filter(lawsInventory -> {
|
||||
boolean flag =false;
|
||||
if (StringUtils.equals(lawsInventory.getVerifyFlowStatus(),ComplianceFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue())){
|
||||
flag = true;
|
||||
}
|
||||
return flag;
|
||||
}).collect(Collectors.toList());
|
||||
if (CollectionUtils.isNotEmpty(toBeSubmitLawsInventoryList)) {
|
||||
Map<String, List<ProjectLawsInventoryEO>> verifyDutyGroupMap = toBeSubmitLawsInventoryList.stream().collect(Collectors.groupingBy(ProjectLawsInventoryEO::getVerifyDutyId));
|
||||
for (Map.Entry<String, List<ProjectLawsInventoryEO>> verifyDutyMap : verifyDutyGroupMap.entrySet()) {
|
||||
String verifyDutyId = verifyDutyMap.getKey();
|
||||
List<ProjectLawsInventoryEO> lawsInventoryEOList = verifyDutyMap.getValue();
|
||||
if(StringUtils.isEmpty(verifyDutyId) || CollectionUtils.isEmpty(lawsInventoryEOList)){
|
||||
continue;
|
||||
}
|
||||
this.lawsInventoryEOListSortByVerifyDueDate(lawsInventoryEOList);
|
||||
|
||||
Date verifyDueDate = lawsInventoryEOList.get(0).getVerifyDueDate();
|
||||
String endTime = "";
|
||||
if(verifyDueDate != null){
|
||||
endTime = DateUtils.formatDate(verifyDueDate);
|
||||
}
|
||||
String serialNumbers = lawsInventoryEOList.stream().map(ProjectLawsInventoryEO::getSerialNumber).distinct().collect(Collectors.joining(","));
|
||||
|
||||
List<String> userIdList = Arrays.asList(verifyDutyId.split(","));
|
||||
// 给设计符合性流程责任人发消息
|
||||
Map<String,Object> params = new HashMap<>();
|
||||
params.put("contentCn","您好,请尽快查看处理此项任务,谢谢!");
|
||||
params.put("contentEn","Hello! Please check and address the task ASAP. Thank you!");
|
||||
params.put("projectLibraryId",projectLibraryId);
|
||||
params.put("endTime",endTime);
|
||||
params.put("userIdList",userIdList);
|
||||
params.put("serialNumbers",serialNumbers);
|
||||
this.sendMessageByTemplateId(TemplateInfoEnum2.VALIDATION_COMPLIANCE_CONFIRMATION1.getValue(),params);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*//获取已经发起的 任务确认流程信息(当前处理人)
|
||||
JSONObject queryFlowCurrentTaskJson = new JSONObject();
|
||||
queryFlowCurrentTaskJson.put("projectLawsInventoryIdList",projectLawsInventoryIdList);
|
||||
queryFlowCurrentTaskJson.put("flowType",FlowTypeEnum.RWQRLC.getValue());
|
||||
@@ -9556,7 +9810,7 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
});*/
|
||||
|
||||
return Result.OK();
|
||||
}
|
||||
@@ -10458,5 +10712,31 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void lawsInventoryEOListSortByDesignDueDate(List<ProjectLawsInventoryEO> projectLawsInventoryEOS) {
|
||||
Collections.sort(projectLawsInventoryEOS, new Comparator<ProjectLawsInventoryEO>() {
|
||||
@Override
|
||||
public int compare(ProjectLawsInventoryEO p1, ProjectLawsInventoryEO p2) {
|
||||
if(p1.getDesignDueDate() != null && p2.getDesignDueDate() != null){
|
||||
return p1.getDesignDueDate().compareTo(p2.getDesignDueDate());
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void lawsInventoryEOListSortByVerifyDueDate(List<ProjectLawsInventoryEO> projectLawsInventoryEOS) {
|
||||
Collections.sort(projectLawsInventoryEOS, new Comparator<ProjectLawsInventoryEO>() {
|
||||
@Override
|
||||
public int compare(ProjectLawsInventoryEO p1, ProjectLawsInventoryEO p2) {
|
||||
if(p1.getDesignDueDate() != null && p2.getDesignDueDate() != null){
|
||||
return p1.getDesignDueDate().compareTo(p2.getDesignDueDate());
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user