认证清单确认操作-发送飞书消息。
This commit is contained in:
+10
@@ -31,6 +31,16 @@ public enum TemplateInfoEnum2 {
|
||||
CERTIFICATION_MESSAGE23("责任人提交,发起人接收审查任务-任务","ctp_AAuPh3LJKoIX"),
|
||||
CERTIFICATION_MESSAGE24("发起人审查退回,责任人接收-任务","ctp_AAu2lBIgZK5f"),
|
||||
CERTIFICATION_MESSAGE25("发起人审查通过,责任人接收通知-通知","ctp_AAuPKJ9CDwIP"),
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 法规清单发布相关消息模板
|
||||
*/
|
||||
REGULATION_LIST_RELEASE1("Studio发起或stuido催办,法规工程师收到消息","ctp_AAuL6mDxMKxu"),
|
||||
REGULATION_LIST_RELEASE2("法规清单发布-公用消息-绿色","ctp_AAuPKJ9Cj9w5"),
|
||||
REGULATION_LIST_RELEASE3("法规清单发布-公用消息-红色","ctp_AAu2lBIgaB79"),
|
||||
REGULATION_LIST_RELEASE4("法规清单发布-公用消息-黄色","ctp_AAuPh3LJWg1x"),
|
||||
;
|
||||
|
||||
String name;
|
||||
|
||||
+2
-2
@@ -257,7 +257,7 @@ public class ProjectLawsInventoryEO implements Serializable {
|
||||
/**设计符合性确认-责任人名称*/
|
||||
@Excel(name = "责任人", width = 20,groupName = "设计符合性确认")
|
||||
@TableField(exist = false)
|
||||
private String designDutyName;
|
||||
private String designDutyIdName;
|
||||
|
||||
/**设计符合性确认-截止时间*/
|
||||
@Excel(name = "截止时间", width = 20, format = "yyyy-MM-dd",groupName = "设计符合性确认")
|
||||
@@ -391,7 +391,7 @@ public class ProjectLawsInventoryEO implements Serializable {
|
||||
/**验证符合性确认-责任人名称*/
|
||||
@Excel(name = "责任人", width = 20,groupName = "验证符合性确认")
|
||||
@TableField(exist = false)
|
||||
private String verifyDutyName;
|
||||
private String verifyDutyIdName;
|
||||
|
||||
/**验证符合性确认-截止时间*/
|
||||
@Excel(name = "截止时间", width = 20, format = "yyyy-MM-dd",groupName = "验证符合性确认")
|
||||
|
||||
+155
-5
@@ -4,15 +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.ProjectLawsInventoryEO;
|
||||
import com.jero.modules.project.entity.ProjectLibraryBase;
|
||||
import com.jero.modules.project.entity.ProjectNameInfoEO;
|
||||
import com.jero.modules.project.entity.ProjectYearNameInfoEO;
|
||||
import com.jero.modules.project.entity.*;
|
||||
import com.jero.modules.project.enums.ComplianceFlowStatusEnum;
|
||||
import com.jero.modules.project.enums.InventoryAffirmStatusEnum;
|
||||
import com.jero.modules.project.enums.JumpLinkEnum;
|
||||
import com.jero.modules.project.enums.SendMsgFlagEnum;
|
||||
@@ -70,12 +70,105 @@ public class InventoryAffirmJob implements Job {
|
||||
@Autowired
|
||||
private IBussDocumentLibraryEOService bussDocumentLibraryEOService;
|
||||
|
||||
private static SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
|
||||
/**
|
||||
* 清单任务到达截止时间后,给用户发送消息
|
||||
*/
|
||||
@Override
|
||||
public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
|
||||
log.info("清单确认流程,定时任务开启 =====================================================");
|
||||
log.info("清单确认流程,定时任务开启 =====================================================");
|
||||
// 获取法规清单 设计、验证符合性流程状态为 清单待校核的数据。
|
||||
QueryWrapper<ProjectLawsInventoryEO> queryWrapperInventory = new QueryWrapper<>();
|
||||
queryWrapperInventory.and(queryWrapper -> {
|
||||
queryWrapper.lambda().eq(ProjectLawsInventoryEO::getDesignFlowStatus, ComplianceFlowStatusEnum.LIST_TO_BE_CHECKED.getValue());
|
||||
queryWrapper.or(or -> {
|
||||
or.lambda().eq(ProjectLawsInventoryEO::getDesignFlowStatus, ComplianceFlowStatusEnum.LIST_TO_BE_CHECKED.getValue());
|
||||
});
|
||||
});
|
||||
List<ProjectLawsInventoryEO> projectLawsInventoryEOList = this.projectLawsInventoryEOMapper.selectList(queryWrapperInventory);
|
||||
|
||||
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();
|
||||
// 根据法规工程师进行分组
|
||||
Map<String, List<ProjectLawsInventoryEO>> lawsInventoryByRegulationOwnerGroupMap = lawsInventoryListByProjectLibraryId.stream().collect(Collectors.groupingBy(ProjectLawsInventoryEO::getRegulationOwnerId));
|
||||
for (Map.Entry<String, List<ProjectLawsInventoryEO>> lawsInventoryByRegulationOwnerGroup : lawsInventoryByRegulationOwnerGroupMap.entrySet()) {
|
||||
String regulationOwnerId = lawsInventoryByRegulationOwnerGroup.getKey();
|
||||
List<ProjectLawsInventoryEO> regulationOwnerDataList = lawsInventoryByRegulationOwnerGroup.getValue();
|
||||
if(CollectionUtils.isEmpty(regulationOwnerDataList) || StringUtils.isEmpty(regulationOwnerId)){
|
||||
continue;
|
||||
}
|
||||
|
||||
List<String> userIdList = Arrays.asList(regulationOwnerId.split(","));
|
||||
Map<String, Object> sendMsgDataListMap = this.disposeSendMsgDataList(regulationOwnerDataList);
|
||||
|
||||
// 三条后结束的
|
||||
List<ProjectLawsInventoryEO> threeDaysList = (List<ProjectLawsInventoryEO>) sendMsgDataListMap.get("threeDaysList");
|
||||
if(CollectionUtils.isNotEmpty(threeDaysList)){
|
||||
Date inventoryAffirmDueDate = threeDaysList.get(0).getInventoryAffirmDueDate();
|
||||
String endTime = "";
|
||||
if(inventoryAffirmDueDate != null){
|
||||
endTime = DateUtils.formatDate(inventoryAffirmDueDate);
|
||||
}
|
||||
String serialNumbers = threeDaysList.stream().map(ProjectLawsInventoryEO::getSerialNumber).distinct().collect(Collectors.joining(","));
|
||||
// 给法规工程师发消息
|
||||
Map<String,Object> params = new HashMap<>();
|
||||
params.put("contentCn","您好,以下待办任务距离截止日期仅剩3天,请及时查看处理。");
|
||||
params.put("contentEn","Hello! This task will expire in 3 days. Please check and address it in a timely manner. Thank you!");
|
||||
params.put("projectLibraryId",projectLibraryId);
|
||||
params.put("endTime",endTime);
|
||||
params.put("userIdList",userIdList);
|
||||
params.put("serialNumbers",serialNumbers);
|
||||
this.projectLawsInventoryEOService.sendMessageByTemplateId(TemplateInfoEnum2.REGULATION_LIST_RELEASE4.getValue(),params);
|
||||
}
|
||||
// 当天结束的
|
||||
List<ProjectLawsInventoryEO> currentDaysList = (List<ProjectLawsInventoryEO>) sendMsgDataListMap.get("currentDaysList");
|
||||
if(CollectionUtils.isNotEmpty(currentDaysList)){
|
||||
Date inventoryAffirmDueDate = currentDaysList.get(0).getInventoryAffirmDueDate();
|
||||
String endTime = "";
|
||||
if(inventoryAffirmDueDate != null){
|
||||
endTime = DateUtils.formatDate(inventoryAffirmDueDate);
|
||||
}
|
||||
String serialNumbers = currentDaysList.stream().map(ProjectLawsInventoryEO::getSerialNumber).distinct().collect(Collectors.joining(","));
|
||||
// 给法规工程师发消息
|
||||
Map<String,Object> params = new HashMap<>();
|
||||
params.put("contentCn","您好,以下待办任务已到截止日期,请尽快查看处理。");
|
||||
params.put("contentEn","Hello! This task will expire today. Please check and address it ASAP. Thank you!");
|
||||
params.put("projectLibraryId",projectLibraryId);
|
||||
params.put("endTime",endTime);
|
||||
params.put("userIdList",userIdList);
|
||||
params.put("serialNumbers",serialNumbers);
|
||||
this.projectLawsInventoryEOService.sendMessageByTemplateId(TemplateInfoEnum2.REGULATION_LIST_RELEASE4.getValue(),params);
|
||||
}
|
||||
// 逾期的
|
||||
List<ProjectLawsInventoryEO> overdueList = (List<ProjectLawsInventoryEO>) sendMsgDataListMap.get("overdueList");
|
||||
if(CollectionUtils.isNotEmpty(overdueList)){
|
||||
Date inventoryAffirmDueDate = overdueList.get(0).getInventoryAffirmDueDate();
|
||||
String endTime = "";
|
||||
if(inventoryAffirmDueDate != null){
|
||||
endTime = DateUtils.formatDate(inventoryAffirmDueDate);
|
||||
}
|
||||
String serialNumbers = overdueList.stream().map(ProjectLawsInventoryEO::getSerialNumber).distinct().collect(Collectors.joining(","));
|
||||
// 给法规工程师发消息
|
||||
Map<String,Object> params = new HashMap<>();
|
||||
params.put("contentCn","您好,以下待办任务已逾期,请尽快处理。");
|
||||
params.put("contentEn","Hello! This task is overdue. Please address it ASAP. Thank you!");
|
||||
params.put("projectLibraryId",projectLibraryId);
|
||||
params.put("endTime",endTime);
|
||||
params.put("userIdList",userIdList);
|
||||
params.put("serialNumbers",serialNumbers);
|
||||
this.projectLawsInventoryEOService.sendMessageByTemplateId(TemplateInfoEnum2.REGULATION_LIST_RELEASE4.getValue(),params);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* //获取状态为待确认的数据
|
||||
QueryWrapper<ProjectLawsInventoryEO> queryWrapperInventory = new QueryWrapper<>();
|
||||
queryWrapperInventory.lambda().eq(ProjectLawsInventoryEO::getInventoryAffirmStatus, InventoryAffirmStatusEnum.LIST_TO_CONFIRM.getValue());
|
||||
@@ -379,4 +472,61 @@ public class InventoryAffirmJob implements Job {
|
||||
}*/
|
||||
log.info("清单确认流程,定时任务结束 =====================================================");
|
||||
}
|
||||
|
||||
|
||||
/***
|
||||
* 处理需要发消息的数据
|
||||
* @param projectLawsInventoryEOList
|
||||
* @return
|
||||
*/
|
||||
private Map<String, Object> disposeSendMsgDataList(List<ProjectLawsInventoryEO> projectLawsInventoryEOList) {
|
||||
Map<String,Object> result = new HashMap<>();
|
||||
Date currentDate = new Date();
|
||||
String currentDateStr = sdf.format(currentDate);
|
||||
|
||||
//获取后三天的时间
|
||||
Calendar calendar=new GregorianCalendar();
|
||||
calendar.setTime(new Date());
|
||||
calendar.add(Calendar.DATE,3);
|
||||
Date threeDays = calendar.getTime();
|
||||
String threeDaysStr = sdf.format(threeDays);
|
||||
|
||||
// 当天结束的
|
||||
List<ProjectLawsInventoryEO> currentDaysList = projectLawsInventoryEOList.stream().filter(data -> {
|
||||
boolean flag = false;
|
||||
//结束日期是当前日期
|
||||
if(data.getInventoryAffirmDueDate() != null){
|
||||
if (StringUtils.equals(currentDateStr, sdf.format(data.getInventoryAffirmDueDate()))) {
|
||||
flag = true;
|
||||
}
|
||||
}
|
||||
return flag;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
// 三天后结束的
|
||||
List<ProjectLawsInventoryEO> threeDaysList = projectLawsInventoryEOList.stream().filter(data -> {
|
||||
boolean flag = false;
|
||||
if(data.getInventoryAffirmDueDate() != null){
|
||||
if (StringUtils.equals(threeDaysStr, sdf.format(data.getInventoryAffirmDueDate()))) {
|
||||
flag = true;
|
||||
}
|
||||
}
|
||||
return flag;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
// 逾期的
|
||||
List<ProjectLawsInventoryEO> overdueList = projectLawsInventoryEOList.stream().filter(data -> {
|
||||
// 只要早于当前日期都算逾期 不算当天。
|
||||
boolean flag = false;
|
||||
if(data.getInventoryAffirmDueDate() != null){
|
||||
flag = (data.getInventoryAffirmDueDate().before(currentDate) && !StringUtils.equals(currentDateStr, sdf.format(data.getInventoryAffirmDueDate())));
|
||||
}
|
||||
return flag;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
result.put("currentDaysList",currentDaysList);
|
||||
result.put("threeDaysList",threeDaysList);
|
||||
result.put("overdueList",overdueList);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
+10
@@ -204,4 +204,14 @@ public interface IProjectLawsInventoryEOService extends IService<ProjectLawsInve
|
||||
* @return
|
||||
*/
|
||||
String getDutyTerritoryNameById(String projectLawsInventoryId, String cut, List<ProjectLawsInventoryEO> projectLawsInventoryEOList, List<SysDictItem> sysDictItems,String dicCode);
|
||||
|
||||
void sendMessageByTemplateId(String templeteId,Map<String,Object> params);
|
||||
|
||||
Map<String, Object> getProjectLawsInventoryLinkHrefFeishu(String projectLibraryId, String PRN_CN, String PRN_EN);
|
||||
|
||||
/**
|
||||
* 法规清单根据清单确认截至日期顺序排序
|
||||
* @param projectLawsInventoryEOS
|
||||
*/
|
||||
void lawsInventoryEOListSortByInventoryAffirmDueDate(List<ProjectLawsInventoryEO> projectLawsInventoryEOS);
|
||||
}
|
||||
|
||||
+199
-49
@@ -38,6 +38,7 @@ import com.jero.modules.dummy.service.IDummyInventoryInfoEOService;
|
||||
import com.jero.modules.dummy.service.impl.DummyInventoryBaseEOServiceImpl;
|
||||
import com.jero.modules.dummy.util.DeepCopyListUtil;
|
||||
import com.jero.modules.dummy.util.ListDiff;
|
||||
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;
|
||||
@@ -1495,7 +1496,7 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
|
||||
if(StringUtils.isNotEmpty(designDutyId)){
|
||||
String designDutyName = sysUsers.stream().filter(e -> designDutyId.equals(e.getId())).
|
||||
map(SysUser::getUsername).collect(Collectors.joining(","));
|
||||
projectLawsInventoryEO.setDesignDutyName(designDutyName);
|
||||
projectLawsInventoryEO.setDesignDutyIdName(designDutyName);
|
||||
}
|
||||
|
||||
//prehomo确认
|
||||
@@ -1527,7 +1528,7 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
|
||||
if(StringUtils.isNotEmpty(verifyDutyId)){
|
||||
String verifyDutyName = sysUsers.stream().filter(e -> verifyDutyId.equals(e.getId())).
|
||||
map(SysUser::getUsername).collect(Collectors.joining(","));
|
||||
projectLawsInventoryEO.setVerifyDutyName(verifyDutyName);
|
||||
projectLawsInventoryEO.setVerifyDutyIdName(verifyDutyName);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4004,7 +4005,7 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
|
||||
if (StringUtils.isNotBlank(projectLawsInventoryEO.getDesignDutyId())) {
|
||||
userIdList.add(projectLawsInventoryEO.getDesignDutyId());
|
||||
}else {
|
||||
projectLawsInventoryEO.setDesignDutyName("空");
|
||||
projectLawsInventoryEO.setDesignDutyIdName("空");
|
||||
}
|
||||
if (StringUtils.isNotBlank(projectLawsInventoryEO.getPrehomoDutyId())) {
|
||||
userIdList.add(projectLawsInventoryEO.getPrehomoDutyId());
|
||||
@@ -4014,7 +4015,7 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
|
||||
if (StringUtils.isNotBlank(projectLawsInventoryEO.getVerifyDutyId())) {
|
||||
userIdList.add(projectLawsInventoryEO.getVerifyDutyId());
|
||||
}else {
|
||||
projectLawsInventoryEO.setVerifyDutyName("空");
|
||||
projectLawsInventoryEO.setVerifyDutyIdName("空");
|
||||
}
|
||||
|
||||
userIdList = userIdList.stream().distinct().collect(Collectors.toList());
|
||||
@@ -4078,7 +4079,7 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
|
||||
List<String> collect = userList.stream().filter(e -> e.getId().equals(projectLawsInventoryEO.getDesignDutyId())).map(f -> f.getUsername()).collect(Collectors.toList());
|
||||
if(collect.size() != 0){
|
||||
String userName = collect.get(0);
|
||||
projectLawsInventoryEO.setDesignDutyName(userName);
|
||||
projectLawsInventoryEO.setDesignDutyIdName(userName);
|
||||
}
|
||||
}
|
||||
if (StringUtils.isNotBlank(projectLawsInventoryEO.getPrehomoDutyId())) {
|
||||
@@ -4092,7 +4093,7 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
|
||||
List<String> collect = userList.stream().filter(e -> e.getId().equals(projectLawsInventoryEO.getVerifyDutyId())).map(f -> f.getUsername()).collect(Collectors.toList());
|
||||
if(collect.size() != 0){
|
||||
String userName = collect.get(0);
|
||||
projectLawsInventoryEO.setVerifyDutyName(userName);
|
||||
projectLawsInventoryEO.setVerifyDutyIdName(userName);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4397,7 +4398,7 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
|
||||
if (StringUtils.isNotBlank(projectLawsInventoryEO.getDesignDutyId())) {
|
||||
userIdList.add(projectLawsInventoryEO.getDesignDutyId());
|
||||
}else {
|
||||
projectLawsInventoryEO.setDesignDutyName("null");
|
||||
projectLawsInventoryEO.setDesignDutyIdName("null");
|
||||
}
|
||||
if (StringUtils.isNotBlank(projectLawsInventoryEO.getPrehomoDutyId())) {
|
||||
userIdList.add(projectLawsInventoryEO.getPrehomoDutyId());
|
||||
@@ -4407,7 +4408,7 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
|
||||
if (StringUtils.isNotBlank(projectLawsInventoryEO.getVerifyDutyId())) {
|
||||
userIdList.add(projectLawsInventoryEO.getVerifyDutyId());
|
||||
}else {
|
||||
projectLawsInventoryEO.setVerifyDutyName("null");
|
||||
projectLawsInventoryEO.setVerifyDutyIdName("null");
|
||||
}
|
||||
|
||||
userIdList = userIdList.stream().distinct().collect(Collectors.toList());
|
||||
@@ -4471,7 +4472,7 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
|
||||
List<String> collect = userList.stream().filter(e -> e.getId().equals(projectLawsInventoryEO.getDesignDutyId())).map(f -> f.getUsername()).collect(Collectors.toList());
|
||||
if(collect.size() != 0){
|
||||
String userName = collect.get(0);
|
||||
projectLawsInventoryEO.setDesignDutyName(userName);
|
||||
projectLawsInventoryEO.setDesignDutyIdName(userName);
|
||||
}
|
||||
}
|
||||
if (StringUtils.isNotBlank(projectLawsInventoryEO.getPrehomoDutyId())) {
|
||||
@@ -4485,7 +4486,7 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
|
||||
List<String> collect = userList.stream().filter(e -> e.getId().equals(projectLawsInventoryEO.getVerifyDutyId())).map(f -> f.getUsername()).collect(Collectors.toList());
|
||||
if(collect.size() != 0){
|
||||
String userName = collect.get(0);
|
||||
projectLawsInventoryEO.setVerifyDutyName(userName);
|
||||
projectLawsInventoryEO.setVerifyDutyIdName(userName);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5707,7 +5708,14 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
|
||||
@Transactional
|
||||
public Result<?> change(JSONObject parmas) {
|
||||
String ids = parmas.getString("ids");
|
||||
String projectLibraryId = parmas.getString("projectLibraryId");
|
||||
if(StringUtils.isNotEmpty(ids)){
|
||||
|
||||
QueryWrapper<ProjectLawsInventoryEO> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.lambda().in(ProjectLawsInventoryEO::getId, Arrays.asList(ids.split(",")));
|
||||
queryWrapper.lambda().eq(ProjectLawsInventoryEO::getProjectLibraryId,projectLibraryId);
|
||||
List<ProjectLawsInventoryEO> projectLawsInventoryEOS = this.list(queryWrapper);
|
||||
|
||||
List<String> idList = Arrays.asList(ids.split(","));
|
||||
String projectLawsInventoryIds = ids;
|
||||
String pIds = "";
|
||||
@@ -5836,6 +5844,26 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
|
||||
|
||||
// 删除流程历史数据
|
||||
this.processHistoryEOService.deleteBiActiProcInstIdList(actiProcInstIdList);
|
||||
|
||||
this.lawsInventoryEOListSortByInventoryAffirmDueDate(projectLawsInventoryEOS);
|
||||
Date inventoryAffirmDueDate = projectLawsInventoryEOS.get(0).getInventoryAffirmDueDate();
|
||||
String endTime = "";
|
||||
if (inventoryAffirmDueDate != null) {
|
||||
endTime = DateUtils.formatDate(inventoryAffirmDueDate);
|
||||
}
|
||||
|
||||
// 给法规工程师发消息
|
||||
List<String> userIdList = projectLawsInventoryEOS.stream().map(ProjectLawsInventoryEO::getRegulationOwnerId).distinct().collect(Collectors.toList());
|
||||
String serialNumbers = projectLawsInventoryEOS.stream().map(ProjectLawsInventoryEO::getSerialNumber).distinct().collect(Collectors.joining(","));
|
||||
|
||||
Map<String,Object> paramsMsg = new HashMap<>();
|
||||
paramsMsg.put("contentCn","您好,该法规已被发起人撤回。");
|
||||
paramsMsg.put("contentEn","Hello! This regulation has been withdrawn by the initiator.");
|
||||
paramsMsg.put("projectLibraryId",projectLibraryId);
|
||||
paramsMsg.put("endTime",endTime);
|
||||
paramsMsg.put("userIdList",userIdList);
|
||||
paramsMsg.put("serialNumbers",serialNumbers);
|
||||
this.sendMessageByTemplateId(TemplateInfoEnum2.REGULATION_LIST_RELEASE2.getValue(),paramsMsg);
|
||||
}
|
||||
return Result.OK("变更成功!");
|
||||
}
|
||||
@@ -7567,7 +7595,7 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
|
||||
List<SysUser> collect = sysUserList.stream()
|
||||
.filter(e -> e.getId().equals(projectLawsInventoryEO.getDesignDutyId())).collect(Collectors.toList());
|
||||
if(collect.size() != 0){
|
||||
projectLawsInventoryEO.setDesignDutyName(collect.get(0).getUsername());
|
||||
projectLawsInventoryEO.setDesignDutyIdName(collect.get(0).getUsername());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7603,7 +7631,7 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
|
||||
List<SysUser> collect = sysUserList.stream()
|
||||
.filter(e -> e.getId().equals(projectLawsInventoryEO.getVerifyDutyId())).collect(Collectors.toList());
|
||||
if(collect.size() != 0){
|
||||
projectLawsInventoryEO.setVerifyDutyName(collect.get(0).getUsername());
|
||||
projectLawsInventoryEO.setVerifyDutyIdName(collect.get(0).getUsername());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9979,6 +10007,8 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
|
||||
projectLawsInventoryEO.setVerifyFlowStatus(ComplianceFlowStatusEnum.LIST_TO_BE_CHECKED.getValue());
|
||||
}
|
||||
|
||||
projectLawsInventoryEO.setInventoryAffirmDueDate(endTime);
|
||||
|
||||
userIdList.add(projectLawsInventoryEO.getRegulationOwnerId());
|
||||
|
||||
ProcessInfoDetailEO processInfoDetailEO = new ProcessInfoDetailEO();
|
||||
@@ -9999,6 +10029,17 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
|
||||
ProcessInfoEO processInfoEO = new ProcessInfoEO();
|
||||
this.addProcessInfo(processInfoEO,projectLibraryId,endTime);
|
||||
this.addProcessInfoDetail(processInfoEO.getId(),processInfoDetailEOList,endTime);
|
||||
|
||||
userIdList = userIdList.stream().distinct().collect(Collectors.toList());
|
||||
// 给法规工程师发消息
|
||||
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",inventoryAffirmDueDate);
|
||||
params.put("userIdList",userIdList);
|
||||
this.sendMessageByTemplateId(TemplateInfoEnum2.REGULATION_LIST_RELEASE1.getValue(),params);
|
||||
|
||||
return Result.OK("发起清单确认成功!");
|
||||
}
|
||||
|
||||
@@ -10025,6 +10066,22 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
|
||||
queryWrapper.lambda().in(ProjectLawsInventoryEO::getId, Arrays.asList(ids.split(",")));
|
||||
queryWrapper.lambda().eq(ProjectLawsInventoryEO::getProjectLibraryId,projectLibraryId);
|
||||
List<ProjectLawsInventoryEO> projectLawsInventoryEOS = this.baseMapper.selectList(queryWrapper);
|
||||
|
||||
projectLawsInventoryEOS = projectLawsInventoryEOS.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());
|
||||
|
||||
this.lawsInventoryEOListSortByInventoryAffirmDueDate(projectLawsInventoryEOS);
|
||||
Date inventoryAffirmDueDate = projectLawsInventoryEOS.get(0).getInventoryAffirmDueDate();
|
||||
String endTime = "";
|
||||
if(inventoryAffirmDueDate != null){
|
||||
endTime = DateUtils.formatDate(inventoryAffirmDueDate);
|
||||
}
|
||||
|
||||
for (ProjectLawsInventoryEO projectLawsInventoryEO : projectLawsInventoryEOS) {
|
||||
if(StringUtils.equals(projectLawsInventoryEO.getDesignFlowStatus(), ComplianceFlowStatusEnum.LIST_TO_BE_CHECKED.getValue())){
|
||||
projectLawsInventoryEO.setDesignFlowStatus(ComplianceFlowStatusEnum.LIST_TO_BE_RELEASED.getValue());
|
||||
@@ -10034,8 +10091,21 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
|
||||
}
|
||||
}
|
||||
|
||||
List<String> userIdList = projectLawsInventoryEOS.stream().map(ProjectLawsInventoryEO::getRegulationOwnerId).distinct().collect(Collectors.toList());
|
||||
String serialNumbers = projectLawsInventoryEOS.stream().map(ProjectLawsInventoryEO::getSerialNumber).distinct().collect(Collectors.joining(","));
|
||||
|
||||
this.updateBatchById(projectLawsInventoryEOS);
|
||||
|
||||
// 给法规工程师发消息
|
||||
Map<String,Object> params = new HashMap<>();
|
||||
params.put("contentCn","您好,该任务已被发起人撤回。");
|
||||
params.put("contentEn","Hello! This regulation has been withdrawn by the initiator.");
|
||||
params.put("projectLibraryId",projectLibraryId);
|
||||
params.put("endTime",endTime);
|
||||
params.put("userIdList",userIdList);
|
||||
params.put("serialNumbers",serialNumbers);
|
||||
this.sendMessageByTemplateId(TemplateInfoEnum2.REGULATION_LIST_RELEASE2.getValue(),params);
|
||||
|
||||
return Result.OK("撤回成功!");
|
||||
}
|
||||
|
||||
@@ -10074,6 +10144,26 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
|
||||
|
||||
this.updateBatchById(projectLawsInventoryEOS);
|
||||
|
||||
this.lawsInventoryEOListSortByInventoryAffirmDueDate(projectLawsInventoryEOS);
|
||||
Date inventoryAffirmDueDate = projectLawsInventoryEOS.get(0).getInventoryAffirmDueDate();
|
||||
String endTime = "";
|
||||
if(inventoryAffirmDueDate != null){
|
||||
endTime = DateUtils.formatDate(inventoryAffirmDueDate);
|
||||
}
|
||||
List<String> userIdList = Arrays.asList(studioUserInfo.getId().split(","));
|
||||
String serialNumbers = projectLawsInventoryEOS.stream().map(ProjectLawsInventoryEO::getSerialNumber).distinct().collect(Collectors.joining(","));
|
||||
|
||||
// 给studio发消息
|
||||
Map<String,Object> params = new HashMap<>();
|
||||
String contentCn = "您好,该任务被"+ currentUser.getUsername() +"退回,请及时查看处理。";
|
||||
String contentEn = "Hello! This task is rejected by "+ currentUser.getUsername() +". Please check and address it in a timely manner.";
|
||||
params.put("contentCn",contentCn);
|
||||
params.put("contentEn",contentEn);
|
||||
params.put("projectLibraryId",projectLibraryId);
|
||||
params.put("endTime",endTime);
|
||||
params.put("userIdList",userIdList);
|
||||
params.put("serialNumbers",serialNumbers);
|
||||
this.sendMessageByTemplateId(TemplateInfoEnum2.REGULATION_LIST_RELEASE3.getValue(),params);
|
||||
return Result.OK("退回成功!");
|
||||
}
|
||||
|
||||
@@ -10102,49 +10192,109 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
|
||||
for (ProjectLawsInventoryEO lawsInventory : projectLawsInventoryEOList) {
|
||||
if(StringUtils.equals(projectLawsInventoryId,lawsInventory.getId())){
|
||||
String dutyTerritory = lawsInventory.getDutyTerritory();
|
||||
|
||||
result = disposeShowDictItemValue(sysDictItems, dutyTerritory,cut,ProjectInventoryFieldEnum.DUTY_TERRITORY.getValue());
|
||||
/*if(StringUtils.isNotEmpty(fieldValues)){
|
||||
List<SysDictItem> sysDictItemList = sysDictItems.stream().filter(e -> {
|
||||
boolean flag = false;
|
||||
if(StringUtils.equals(e.getDictCode(),dicCode)){
|
||||
flag = true;
|
||||
}
|
||||
return flag;
|
||||
}).distinct().collect(Collectors.toList());
|
||||
if(CollectionUtils.isNotEmpty(sysDictItemList)){
|
||||
if(StringUtils.equals(cut,CutEnum.CN.getValue())){
|
||||
result = sysDictItemList.stream().filter(e -> {
|
||||
boolean flag = false;
|
||||
List<String> fieldValueStrList = Arrays.asList(fieldValues.split(","));
|
||||
for (String fieldValueStr : fieldValueStrList) {
|
||||
if(StringUtils.equals(fieldValueStr,e.getItemValue())){
|
||||
flag = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return flag;
|
||||
}).map(SysDictItem::getItemText).collect(Collectors.joining(","));
|
||||
}else if(StringUtils.equals(cut,CutEnum.EN.getValue())){
|
||||
result = sysDictItemList.stream().filter(e -> {
|
||||
boolean flag = false;
|
||||
List<String> fieldValueStrList = Arrays.asList(fieldValues.split(","));
|
||||
for (String fieldValueStr : fieldValueStrList) {
|
||||
if(StringUtils.equals(fieldValueStr,e.getItemValue())){
|
||||
flag = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return flag;
|
||||
}).map(SysDictItem::getEnName).collect(Collectors.joining(","));
|
||||
}
|
||||
}
|
||||
}*/
|
||||
break;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendMessageByTemplateId(String templeteId, Map<String, Object> params) {
|
||||
LoginUser currentUser = null;
|
||||
try {
|
||||
currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
}catch (Exception ex) {
|
||||
log.error("获取当前用户信息失败!");
|
||||
}
|
||||
|
||||
List<String> userIdList = (List<String>) params.get("userIdList");
|
||||
if (CollectionUtils.isNotEmpty(userIdList)) {
|
||||
List<SysUser> userInfoList = this.sysUserService.querySysUserListByIdList(userIdList);
|
||||
|
||||
String projectLibraryId = (String) params.get("projectLibraryId");
|
||||
String endTime = (String) params.get("endTime");
|
||||
String Initiator = (String) params.get("Initiator");
|
||||
String serialNumbers = (String) params.get("serialNumbers");
|
||||
String contentCn = (String) params.get("contentCn");
|
||||
String contentEn = (String) params.get("contentEn");
|
||||
|
||||
ProjectLibraryBase projectLibraryBase = this.projectLibraryBaseService.selectById(projectLibraryId);
|
||||
|
||||
String PRN_EN = projectLibraryBase.getProjectNameEn();//项目名称 英文
|
||||
String PRN_CN = projectLibraryBase.getProjectNameCn();//项目名称 中文
|
||||
|
||||
// 获取认证清单 - 飞书跳转链接
|
||||
Map<String, Object> hrefFeishuMap = this.getProjectLawsInventoryLinkHrefFeishu(projectLibraryBase.getId(), PRN_CN, PRN_EN);
|
||||
String hrefFeishu_CN = (String) hrefFeishuMap.get("hrefFeishu_CN");
|
||||
String hrefFeishu_EN = (String) hrefFeishuMap.get("hrefFeishu_EN");
|
||||
try {
|
||||
for (String userId : userIdList) {
|
||||
String thirdId = this.sysUserService.getUserThirdIdByUserId(userInfoList,userId);
|
||||
|
||||
if(StringUtils.isNotEmpty(thirdId)){
|
||||
// 根据结束时间进行排序,获取最近的时间,发消息时使用。
|
||||
JSONObject larkMesJson = new JSONObject();
|
||||
larkMesJson.put("template_id", templeteId);
|
||||
larkMesJson.put("userIds",thirdId);
|
||||
|
||||
Map<String,Object> templateVariableMap = new HashMap<>();
|
||||
templateVariableMap.put("contentCn",contentCn);
|
||||
templateVariableMap.put("contentEn",contentEn);
|
||||
templateVariableMap.put("projectNameCn",PRN_CN);
|
||||
templateVariableMap.put("projectNameEn",PRN_EN);
|
||||
templateVariableMap.put("Initiator",ObjectUtils.isNotEmpty(currentUser) ? currentUser.getUsername() : projectLibraryBase.getStudioEngineerName());
|
||||
templateVariableMap.put("studioEngineerName",projectLibraryBase.getStudioEngineerName());
|
||||
templateVariableMap.put("endTime",endTime);
|
||||
templateVariableMap.put("viewBtnUrlCn",hrefFeishu_CN);
|
||||
templateVariableMap.put("viewBtnUrlEn",hrefFeishu_EN);
|
||||
templateVariableMap.put("operateUserName",ObjectUtils.isNotEmpty(currentUser) ? currentUser.getUsername() : projectLibraryBase.getStudioEngineerName());
|
||||
templateVariableMap.put("standName",serialNumbers);
|
||||
|
||||
larkMesJson.put("templateVariableMap",templateVariableMap);
|
||||
this.feishuService.batchSendLarkCardMsgByTemplate2(larkMesJson);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("飞书消息推送失败");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getProjectLawsInventoryLinkHrefFeishu(String projectLibraryId, String PRN_CN, String PRN_EN) {
|
||||
Map<String,Object> result = new HashMap<>();
|
||||
|
||||
String hrefFeishu_CN = backUrl
|
||||
+ JumpLinkEnum.INVENTORY_AFFIRM_LINK.getLink()
|
||||
+ projectLibraryId
|
||||
+ JumpLinkEnum.INVENTORY_AFFIRM_LINK.getType()
|
||||
+ "&projectName=" + PRN_CN;
|
||||
|
||||
//飞书跳转链接
|
||||
String hrefFeishu_EN = backUrl
|
||||
+ JumpLinkEnum.INVENTORY_AFFIRM_LINK.getLink()
|
||||
+ projectLibraryId
|
||||
+ JumpLinkEnum.INVENTORY_AFFIRM_LINK.getType()
|
||||
+ "&projectName=" + PRN_EN;
|
||||
|
||||
result.put("hrefFeishu_CN",hrefFeishu_CN);
|
||||
result.put("hrefFeishu_EN",hrefFeishu_EN);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void lawsInventoryEOListSortByInventoryAffirmDueDate(List<ProjectLawsInventoryEO> projectLawsInventoryEOS) {
|
||||
Collections.sort(projectLawsInventoryEOS, new Comparator<ProjectLawsInventoryEO>() {
|
||||
@Override
|
||||
public int compare(ProjectLawsInventoryEO p1, ProjectLawsInventoryEO p2) {
|
||||
if(p1.getInventoryAffirmDueDate() != null && p2.getInventoryAffirmDueDate() != null){
|
||||
return p1.getInventoryAffirmDueDate().compareTo(p2.getInventoryAffirmDueDate());
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
+2
-2
@@ -1900,7 +1900,7 @@ public class ProjectTaskInventoryEOServiceImpl extends ServiceImpl<ProjectTaskIn
|
||||
if(CollectionUtils.isNotEmpty(projectLawsInventoryEO)){
|
||||
//获取出 , 已经启动了 设计符合性、prehomo确认、验证符合性流程的数据
|
||||
if(StringUtils.isNotEmpty(projectTaskInventory.getDesignPId())){
|
||||
projectTaskInventory.setDesignDutyName(projectLawsInventoryEO.get(0).getDesignDutyName());
|
||||
projectTaskInventory.setDesignDutyName(projectLawsInventoryEO.get(0).getDesignDutyIdName());
|
||||
projectTaskInventory.setDesignInitiatorName(projectLawsInventoryEO.get(0).getDesignInitiatorName());
|
||||
projectTaskInventory.setDesignFlowTaskStatus(ReviewResultEnum.getTextByValue(projectTaskInventory.getDesignFlowTaskStatus(),projectTaskInventoryEO.getCut()));
|
||||
}else {
|
||||
@@ -1914,7 +1914,7 @@ public class ProjectTaskInventoryEOServiceImpl extends ServiceImpl<ProjectTaskIn
|
||||
projectTaskInventory.setPrehomoDueDate(null);
|
||||
}
|
||||
if(StringUtils.isNotEmpty(projectTaskInventory.getVerifyPId())){
|
||||
projectTaskInventory.setVerifyDutyName(projectLawsInventoryEO.get(0).getVerifyDutyName());
|
||||
projectTaskInventory.setVerifyDutyName(projectLawsInventoryEO.get(0).getVerifyDutyIdName());
|
||||
projectTaskInventory.setVerifyInitiatorName(projectLawsInventoryEO.get(0).getVerifyInitiatorName());
|
||||
projectTaskInventory.setVerifyFlowTaskStatus(ReviewResultEnum.getTextByValue(projectTaskInventory.getVerifyFlowTaskStatus(),projectTaskInventoryEO.getCut()));
|
||||
}else {
|
||||
|
||||
Reference in New Issue
Block a user