Merge remote-tracking branch 'origin/dev_2nd_LCYH' into dev_2nd_LCYH

This commit is contained in:
zyx.net
2023-03-22 18:01:42 +08:00
22 changed files with 1236 additions and 322 deletions
@@ -16,6 +16,31 @@ public enum TemplateInfoEnum2 {
CERTIFICATION_MESSAGE8("认证清单-任务提醒,已逾期","ctp_AAuDMwOPU71H"),
//CERTIFICATION_MESSAGE9("认证清单-责任人分发(转办),第二责任人收到消息","ctp_AAuDM8YP6soc"),
CERTIFICATION_MESSAGE10("认证工程师发起流程,责任人收到消息","ctp_AAuePL6rUK1L"),
CERTIFICATION_MESSAGE11("责任人拒绝,认证工程师收到消息","ctp_AAu2ZrSEiB1V"),
CERTIFICATION_MESSAGE12("责任人接受,认证工程师收到消息","ctp_AAuePL6r3B0I"),
CERTIFICATION_MESSAGE13("studio修改认证工程师,被修改人收到消息",""),
CERTIFICATION_MESSAGE14("studio修改符合性截止时间,认证工程师收到消息","ctp_AAuePL6r3XqN"),
CERTIFICATION_MESSAGE15("认证工程师修改责任人,被修改人收到消息","ctp_AAu2ZrSE1z3f"),
CERTIFICATION_MESSAGE16("认证工程师催办,责任人收到消息","ctp_AAuPfn0M0H6i"),
CERTIFICATION_MESSAGE17("责任人下发工程师,工程师接收-任务","ctp_AAuPfn0MCwlH"),
CERTIFICATION_MESSAGE18("任务提醒,责任人接收-任务 发起人催办责任人","ctp_AAuPh3LJ2Nex"),
CERTIFICATION_MESSAGE19("任务提醒,责任人接收-任务 两周通知","ctp_AAuPh3LJKUZk"),
CERTIFICATION_MESSAGE20("任务提醒,责任人接收-任务 一周通知","ctp_AAuXnIIM45B0"),
CERTIFICATION_MESSAGE21("任务提醒,责任人接收-任务 当天","ctp_AAu2lBIgnWND"),
CERTIFICATION_MESSAGE22("任务提醒,责任人接收-任务 逾期之后 每天通知","ctp_AAuPfn0MDOYu"),
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;
@@ -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 = "验证符合性确认")
@@ -173,7 +173,7 @@ public class CertificationInventoryJob implements Job {
}
Map<String, Object> sendMsgDataListMap = this.disposeSendMsgDataList(dutyPersonDataList);
// 三天后结束的
/*// 三天后结束的
List<ProjectCertificationInventoryEO> threeDaysList = (List<ProjectCertificationInventoryEO>) sendMsgDataListMap.get("threeDaysList");
if(CollectionUtils.isNotEmpty(threeDaysList)){
this.sendLarkCardMsgByTemplate(
@@ -183,7 +183,32 @@ public class CertificationInventoryJob implements Job {
threeDaysList,
TemplateInfoEnum2.CERTIFICATION_MESSAGE6.getValue()
);
}*/
// 十四天后结束的
List<ProjectCertificationInventoryEO> fourteenDaysList = (List<ProjectCertificationInventoryEO>) sendMsgDataListMap.get("fourteenDaysList");
if(CollectionUtils.isNotEmpty(fourteenDaysList)){
this.sendLarkCardMsgByTemplate(
projectLibraryBase,
dutyPersonList,
dutyPersonUserId,
fourteenDaysList,
TemplateInfoEnum2.CERTIFICATION_MESSAGE19.getValue()
);
}
// 七天后结束的
List<ProjectCertificationInventoryEO> sevenDaysList = (List<ProjectCertificationInventoryEO>) sendMsgDataListMap.get("sevenDaysList");
if(CollectionUtils.isNotEmpty(sevenDaysList)){
this.sendLarkCardMsgByTemplate(
projectLibraryBase,
dutyPersonList,
dutyPersonUserId,
sevenDaysList,
TemplateInfoEnum2.CERTIFICATION_MESSAGE20.getValue()
);
}
// 当天结束的
List<ProjectCertificationInventoryEO> currentDaysList = (List<ProjectCertificationInventoryEO>) sendMsgDataListMap.get("currentDaysList");
if(CollectionUtils.isNotEmpty(currentDaysList)){
@@ -192,7 +217,7 @@ public class CertificationInventoryJob implements Job {
dutyPersonList,
dutyPersonUserId,
currentDaysList,
TemplateInfoEnum2.CERTIFICATION_MESSAGE7.getValue()
TemplateInfoEnum2.CERTIFICATION_MESSAGE21.getValue()
);
}
// 逾期的
@@ -203,7 +228,7 @@ public class CertificationInventoryJob implements Job {
dutyPersonList,
dutyPersonUserId,
overdueList,
TemplateInfoEnum2.CERTIFICATION_MESSAGE8.getValue()
TemplateInfoEnum2.CERTIFICATION_MESSAGE22.getValue()
);
}
}
@@ -225,15 +250,31 @@ public class CertificationInventoryJob implements Job {
calendar.add(Calendar.DATE,3);
Date threeDays = calendar.getTime();
//获取后七天后的时间
Calendar sevenCalendar=new GregorianCalendar();
sevenCalendar.setTime(new Date());
sevenCalendar.add(Calendar.DATE,7);
Date sevenDays = sevenCalendar.getTime(); //fourteen
//获取后十四天后的时间
Calendar fourteenCalendar=new GregorianCalendar();
fourteenCalendar.setTime(new Date());
fourteenCalendar.add(Calendar.DATE,14);
Date fourteenDays = fourteenCalendar.getTime(); //fourteen
String threeDaysStr = sdf.format(threeDays);
String sevenDaysStr = sdf.format(sevenDays);
String fourteenDaysStr = sdf.format(fourteenDays);
String currentDateStr = sdf.format(currentDate);
// 当天结束的
List<ProjectCertificationInventoryEO> currentDaysList = dutyPersonDataList.stream().filter(data -> {
boolean flag = false;
//结束日期是当前日期
if (StringUtils.equals(currentDateStr, sdf.format(data.getEndTime()))) {
flag = true;
if(data.getEndTime() != null){
if (StringUtils.equals(currentDateStr, sdf.format(data.getEndTime()))) {
flag = true;
}
}
return flag;
}).collect(Collectors.toList());
@@ -241,16 +282,39 @@ public class CertificationInventoryJob implements Job {
// 三天后结束的
List<ProjectCertificationInventoryEO> threeDaysList = dutyPersonDataList.stream().filter(data -> {
boolean flag = false;
//结束日期是当前日期
if (StringUtils.equals(threeDaysStr, sdf.format(data.getEndTime()))) {
flag = true;
if(data.getEndTime() != null){
if (StringUtils.equals(threeDaysStr, sdf.format(data.getEndTime()))) {
flag = true;
}
}
return flag;
}).collect(Collectors.toList());
// 七天后结束的
List<ProjectCertificationInventoryEO> sevenDaysList = dutyPersonDataList.stream().filter(data -> {
boolean flag = false;
if(data.getEndTime()!=null){
if (StringUtils.equals(sevenDaysStr, sdf.format(data.getEndTime()))) {
flag = true;
}
}
return flag;
}).collect(Collectors.toList());
// 十四天后结束的
List<ProjectCertificationInventoryEO> fourteenDaysList = dutyPersonDataList.stream().filter(data -> {
boolean flag = false;
if(data.getEndTime() != null){
if (StringUtils.equals(fourteenDaysStr, sdf.format(data.getEndTime()))) {
flag = true;
}
}
return flag;
}).collect(Collectors.toList());
// 逾期的
List<ProjectCertificationInventoryEO> overdueList = dutyPersonDataList.stream().filter(data -> {
// 逾期3天、七天、14天
/*// 逾期3天、七天、14天
Calendar day3Later = new GregorianCalendar();
day3Later.setTime(data.getEndTime());
day3Later.add(Calendar.DATE, 3);
@@ -270,13 +334,20 @@ public class CertificationInventoryJob implements Job {
StringUtils.equals(sdf.format(overdue3Days), sdf.format(currentDate))
|| StringUtils.equals(sdf.format(overdue7Days), sdf.format(currentDate))
|| StringUtils.equals(sdf.format(overdue14Days), sdf.format(currentDate))
);
);*/
// 只要早于当前日期都算逾期
boolean flag = false;
if(data.getEndTime() != null){
flag = (data.getEndTime().before(currentDate));
}
return flag;
}).collect(Collectors.toList());
result.put("currentDaysList",currentDaysList);
result.put("threeDaysList",threeDaysList);
result.put("overdueList",overdueList);
result.put("sevenDaysList",sevenDaysList);
result.put("fourteenDaysList",fourteenDaysList);
return result;
}
@@ -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;
}
}
@@ -9,6 +9,7 @@ import com.jero.modules.project.entity.ProjectCertificationInventoryEO;
import com.baomidou.mybatisplus.extension.service.IService;
import com.jero.modules.system.entity.SysCategory;
import com.jero.modules.system.entity.SysRole;
import com.jero.modules.system.entity.SysUser;
import com.jero.modules.todoCenter.entity.ProcessInfoDetailEO;
import com.jero.modules.todoCenter.entity.ProcessInfoEO;
import org.springframework.web.multipart.MultipartFile;
@@ -216,4 +217,13 @@ public interface IProjectCertificationInventoryEOService extends IService<Projec
* @return
*/
Result<?> citeDeliverable(JSONObject json);
/**
* 根据模板返送消息
* @param projectCertificationInventoryEOS
* @param templeteId
* @param userIdList
* @param userInfoList
*/
void sendMessageByTemplateId(List<ProjectCertificationInventoryEO> projectCertificationInventoryEOS,String templeteId,List<String> userIdList,List<SysUser> userInfoList);
}
@@ -10,6 +10,7 @@ import com.jero.modules.feishu.vo.FeishuMsgVo;
import com.jero.modules.project.entity.ProjectLawsInventoryEO;
import com.jero.modules.project.vo.ProjectTaskUrgVo;
import com.jero.modules.system.entity.SysCategory;
import com.jero.modules.system.entity.SysDictItem;
import com.jero.modules.system.entity.SysRole;
import com.jero.modules.todoCenter.entity.ProcessInfoDetailEO;
import com.jero.modules.todoCenter.entity.ProcessInfoEO;
@@ -192,4 +193,25 @@ public interface IProjectLawsInventoryEOService extends IService<ProjectLawsInve
* @return
*/
String getDeliverableTypeNameById(String projectLawsInventoryId, String cut, String flowType,List<ProjectLawsInventoryEO> projectLawsInventoryEOList,List<SysCategory> categoryList);
/**
* 根据id获取责任领域展示名称
* @param projectLawsInventoryId
* @param cut
* @param projectLawsInventoryEOList
* @param sysDictItems
* @param dicCode
* @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);
}
@@ -160,6 +160,66 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
*/
@Override
public void editById(ProjectCertificationInventoryEO projectCertificationInventoryEO) {
List<String> flowStatusList = new ArrayList<>();
flowStatusList.add(CertificationInventoryFlowStatusEnum.TASK_TO_BE_CONFIRMED.getValue());
QueryWrapper<ProjectCertificationInventoryEO> certificationQueryWrap = new QueryWrapper<>();
certificationQueryWrap.lambda().eq(ProjectCertificationInventoryEO::getId,projectCertificationInventoryEO.getId());
certificationQueryWrap.lambda().in(ProjectCertificationInventoryEO::getFlowStatus,flowStatusList);
List<ProjectCertificationInventoryEO> editEndTimeCertificationInventoryEOS = this.list(certificationQueryWrap);
// 编辑截至日期发消息
if(projectCertificationInventoryEO.getEndTime() != null){
editEndTimeCertificationInventoryEOS = editEndTimeCertificationInventoryEOS.stream().filter(certificationInventory -> {
boolean flag = false;
if(!projectCertificationInventoryEO.getEndTime().equals(certificationInventory.getEndTime())){
flag = true;
}
return flag;
}).collect(Collectors.toList());
if(CollectionUtils.isNotEmpty(editEndTimeCertificationInventoryEOS)){
ProjectLibraryBase projectLibraryBase = this.projectLibraryBaseService.selectById(editEndTimeCertificationInventoryEOS.get(0).getProjectLibraryId());
List<String> userIdList = Arrays.asList(projectLibraryBase.getCertificationEngineer().split(","));
List<SysUser> userInfoList = this.sysUserService.querySysUserListByIdList(userIdList);
this.sendMessageByTemplateId(
editEndTimeCertificationInventoryEOS,
TemplateInfoEnum2.CERTIFICATION_MESSAGE14.getValue(),
userIdList,
userInfoList
);
}
}
// 如果编辑了责任人,给责任人发消息
if(StringUtils.isNotEmpty(projectCertificationInventoryEO.getDutyPerson())){
QueryWrapper<ProjectCertificationInventoryEO> editDutyPersonCertificationQueryWrap = new QueryWrapper<>();
editDutyPersonCertificationQueryWrap.lambda().eq(ProjectCertificationInventoryEO::getId,projectCertificationInventoryEO.getId());
List<ProjectCertificationInventoryEO> editDutyPersonCertificationInventoryEOS = this.list(editDutyPersonCertificationQueryWrap);
editDutyPersonCertificationInventoryEOS = editDutyPersonCertificationInventoryEOS.stream().filter(certificationInventory -> {
boolean flag = false;
if(!StringUtils.equals(certificationInventory.getDutyPerson(),projectCertificationInventoryEO.getDutyPerson())){
flag = true;
}
return flag;
}).collect(Collectors.toList());
if(CollectionUtils.isNotEmpty(editDutyPersonCertificationInventoryEOS)){
List<String> userIdList = editDutyPersonCertificationInventoryEOS.stream().map(ProjectCertificationInventoryEO::getDutyPerson).distinct().collect(Collectors.toList());
List<SysUser> userInfoList = this.sysUserService.querySysUserListByIdList(userIdList);
this.sendMessageByTemplateId(
editDutyPersonCertificationInventoryEOS,
TemplateInfoEnum2.CERTIFICATION_MESSAGE15.getValue(),
userIdList,
userInfoList
);
}
}
Date now = new Date();
projectCertificationInventoryEO.setUpdateTime(now);
saveOrUpdate(projectCertificationInventoryEO);
@@ -293,6 +353,36 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
updateList.add(updateProjectCertificationInventoryEO);
}
List<String> flowStatusList = new ArrayList<>();
flowStatusList.add(CertificationInventoryFlowStatusEnum.TASK_TO_BE_CONFIRMED.getValue());
QueryWrapper<ProjectCertificationInventoryEO> certificationQueryWrap = new QueryWrapper<>();
certificationQueryWrap.lambda().in(ProjectCertificationInventoryEO::getId,idList);
certificationQueryWrap.lambda().in(ProjectCertificationInventoryEO::getFlowStatus,flowStatusList);
List<ProjectCertificationInventoryEO> projectCertificationInventoryEOS = this.list(certificationQueryWrap);
if(CollectionUtils.isNotEmpty(projectCertificationInventoryEOS)){
projectCertificationInventoryEOS = projectCertificationInventoryEOS.stream().filter(certificationInventory -> {
boolean flag = false;
if(!projectCertificationInventoryEO.getEndTime().equals(certificationInventory.getEndTime())){
flag = true;
}
return flag;
}).collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(projectCertificationInventoryEOS)) {
ProjectLibraryBase projectLibraryBase = this.projectLibraryBaseService.selectById(projectCertificationInventoryEOS.get(0).getProjectLibraryId());
List<String> userIdList = Arrays.asList(projectLibraryBase.getCertificationEngineer().split(","));
List<SysUser> userInfoList = this.sysUserService.querySysUserListByIdList(userIdList);
this.sendMessageByTemplateId(
projectCertificationInventoryEOS,
TemplateInfoEnum2.CERTIFICATION_MESSAGE14.getValue(),
userIdList,
userInfoList
);
}
}
if(CollectionUtils.isNotEmpty(updateList)){
this.updateBatchById(updateList);
}
@@ -302,6 +392,62 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
return Result.OK("批量设置成功!");
}
/**
* 根据模板发送消息
* @param projectCertificationInventoryEOS
* @param templeteId
*/
@Override
public void sendMessageByTemplateId(List<ProjectCertificationInventoryEO> projectCertificationInventoryEOS,String templeteId,List<String> userIdList,List<SysUser> userInfoList){
LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
ProjectLibraryBase projectLibraryBase = this.projectLibraryBaseService.selectById(projectCertificationInventoryEOS.get(0).getProjectLibraryId());
String PRN_EN = projectLibraryBase.getProjectNameEn();//项目名称 英文
String PRN_CN = projectLibraryBase.getProjectNameCn();//项目名称 中文
// 获取认证清单 - 飞书跳转链接
Map<String, Object> hrefFeishuMap = this.getCertificationInventoryLinkHrefFeishu(projectLibraryBase.getId(), PRN_CN, PRN_EN);
String hrefFeishu_CN = (String) hrefFeishuMap.get("hrefFeishu_CN");
String hrefFeishu_EN = (String) hrefFeishuMap.get("hrefFeishu_EN");
Map<String, Object> standNameAndItemName = this.projectCertificationInventoryEOService.getStandNameAndItemName(projectCertificationInventoryEOS);
String standName = (String) standNameAndItemName.get("standName");
String itemName = (String) standNameAndItemName.get("itemName");
try {
for (String userId : userIdList) {
String thirdId = this.sysUserService.getUserThirdIdByUserId(userInfoList,userId);
if(StringUtils.isNotEmpty(thirdId)){
// 根据结束时间进行排序,获取最近的时间,发消息时使用。
this.certificationInventoryEOListSortByEndTimeAsc(projectCertificationInventoryEOS);
Date endTime = projectCertificationInventoryEOS.get(0).getEndTime();
JSONObject larkMesJson = new JSONObject();
larkMesJson.put("template_id", templeteId);
larkMesJson.put("userIds",thirdId);
Map<String,Object> templateVariableMap = new HashMap<>();
templateVariableMap.put("projectNameCn",PRN_CN);
templateVariableMap.put("projectNameEn",PRN_EN);
templateVariableMap.put("standName",standName);
templateVariableMap.put("itemName",itemName);
templateVariableMap.put("Initiator",projectLibraryBase.getStudioEngineerName());
templateVariableMap.put("endTime",DateUtils.formatDate(endTime));
templateVariableMap.put("viewBtnUrlCn",hrefFeishu_CN);
templateVariableMap.put("viewBtnUrlEn",hrefFeishu_EN);
templateVariableMap.put("operateUserName",currentUser.getUsername());
larkMesJson.put("templateVariableMap",templateVariableMap);
this.feishuService.batchSendLarkCardMsgByTemplate2(larkMesJson);
}
}
} catch (Exception e) {
log.error("飞书消息推送失败");
}
}
@Override
public void importDisposeData(List<ProjectCertificationInventoryEO> datas, String cut) {
if(CollectionUtils.isNotEmpty(datas)){
@@ -1008,7 +1154,8 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
}
ProjectLibraryBase projectLibraryBase = JSONObject.parseObject(JSONObject.toJSONString(json.get("projectLibraryBase")), ProjectLibraryBase.class);
List<String> dutyPersonIdList = projectCertificationInventoryEOList.stream().map(ProjectCertificationInventoryEO::getDutyPerson).distinct().collect(Collectors.toList());
List<SysUser> dutyPersonList = this.sysUserService.querySysUserListByIdList(dutyPersonIdList);
try {
// 更新数据状态为 审查退回
this.updateBatchById(projectCertificationInventoryEOList);
@@ -1019,6 +1166,13 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
// 更新该项目认证流程中,认证工程师的任务状态。
// 如果还有 结果待审查 的数据,不做操作,如果没有 将这个项目认证流程的所有认证工程师待办任务转为已办 flowStatus
this.updateProcessInfoDetailStatus(projectLibraryBase,CertificationFlowNodeEnum.RZGCSSC.getKey(),flowStatus);
this.sendMessageByTemplateId(
projectCertificationInventoryEOList,
TemplateInfoEnum2.CERTIFICATION_MESSAGE24.getValue(),
dutyPersonIdList,
dutyPersonList
);
}catch (Exception ex){
ex.printStackTrace();
log.error("认证工程师-审批退回失败:" + ex.getMessage());
@@ -1074,7 +1228,8 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
}
ProjectLibraryBase projectLibraryBase = JSONObject.parseObject(JSONObject.toJSONString(json.get("projectLibraryBase")), ProjectLibraryBase.class);
List<String> dutyPersonIdList = projectCertificationInventoryEOList.stream().map(ProjectCertificationInventoryEO::getDutyPerson).distinct().collect(Collectors.toList());
List<SysUser> dutyPersonList = this.sysUserService.querySysUserListByIdList(dutyPersonIdList);
try {
// 更新数据状态为 审查通过
this.updateBatchById(projectCertificationInventoryEOList);
@@ -1085,6 +1240,14 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
// 更新该项目认证流程中,认证工程师的任务状态。
// 如果还有 结果待审查 的数据,不做操作,如果没有 将这个项目认证流程的所有认证工程师待办任务转为已办 flowStatus
this.updateProcessInfoDetailStatus(projectLibraryBase,CertificationFlowNodeEnum.RZGCSSC.getKey(),flowStatus);
this.sendMessageByTemplateId(
projectCertificationInventoryEOList,
TemplateInfoEnum2.CERTIFICATION_MESSAGE25.getValue(),
dutyPersonIdList,
dutyPersonList
);
}catch (Exception ex){
ex.printStackTrace();
log.error("认证工程师-审批通过失败:" + ex.getMessage());
@@ -1201,6 +1364,9 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
if(CollectionUtils.isNotEmpty(projectCertificationInventoryLogEOList)){
this.projectCertificationInventoryLogEOService.insertBatch(projectCertificationInventoryLogEOList);
}
List<SysUser> certificationEngineers = this.sysUserService.querySysUserListByIdList(certificationEngineerList);
try {
this.updateBatchById(projectCertificationInventoryEOList);
@@ -1217,6 +1383,13 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
// 给认证工程师分配待办中心的任务 认证工程师审查
this.addProcessInfoDetailEO(processInfoDetailEOList,projectLibraryBase.getId(),CertificationFlowNodeEnum.RZGCSSC.getKey());
this.sendMessageByTemplateId(
projectCertificationInventoryEOList,
TemplateInfoEnum2.CERTIFICATION_MESSAGE23.getValue(),
certificationEngineerList,
certificationEngineers
);
}catch (Exception ex){
ex.printStackTrace();
log.error("责任人-提交任务失败:" + ex.getMessage());
@@ -1253,6 +1426,10 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
}
ProjectLibraryBase projectLibraryBase = JSONObject.parseObject(JSONObject.toJSONString(json.get("projectLibraryBase")), ProjectLibraryBase.class);
String certificationEngineer = projectLibraryBase.getCertificationEngineer();
if(StringUtils.isEmpty(certificationEngineer)){
throw new JeroBootException("该项目中认证工程师为空,请先维护认证工程师!");
}
List<ProjectCertificationInventoryLogEO> projectCertificationInventoryLogEOList = new ArrayList<>();
List<ProcessInfoDetailEO> processInfoDetailEOList = new ArrayList<>();
@@ -1279,6 +1456,18 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
this.projectCertificationInventoryLogEOService.insertBatch(projectCertificationInventoryLogEOList);
}
String PRN_EN = projectLibraryBase.getProjectNameEn();//项目名称 英文
String PRN_CN = projectLibraryBase.getProjectNameCn();//项目名称 中文
// 获取认证清单 - 飞书跳转链接
Map<String, Object> hrefFeishuMap = this.getCertificationInventoryLinkHrefFeishu(projectLibraryBase.getId(), PRN_CN, PRN_EN);
String hrefFeishu_CN = (String) hrefFeishuMap.get("hrefFeishu_CN");
String hrefFeishu_EN = (String) hrefFeishuMap.get("hrefFeishu_EN");
Map<String, Object> standNameAndItemName = this.projectCertificationInventoryEOService.getStandNameAndItemName(projectCertificationInventoryEOList);
String standName = (String) standNameAndItemName.get("standName");
String itemName = (String) standNameAndItemName.get("itemName");
try {
List<String> certificationIdList = projectCertificationInventoryEOList.stream().map(ProjectCertificationInventoryEO::getId).distinct().collect(Collectors.toList());
// 将当前责任人的待办任务转为已办
@@ -1295,6 +1484,41 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
// 责任人接受任务,将数据的状态更新为 结果待提交。
this.updateBatchById(projectCertificationInventoryEOList);
List<String> certificationEngineerList = Arrays.asList(certificationEngineer.split(","));
List<SysUser> certificationEngineers = this.sysUserService.querySysUserListByIdList(certificationEngineerList);
try {
for (String userId : certificationEngineerList) {
String thirdId = this.sysUserService.getUserThirdIdByUserId(certificationEngineers,userId);
if(StringUtils.isNotEmpty(thirdId)){
// 根据结束时间进行排序,获取最近的时间,发消息时使用。
this.certificationInventoryEOListSortByEndTimeAsc(projectCertificationInventoryEOList);
Date endTime = projectCertificationInventoryEOList.get(0).getEndTime();
JSONObject larkMesJson = new JSONObject();
larkMesJson.put("template_id", TemplateInfoEnum2.CERTIFICATION_MESSAGE12.getValue());
larkMesJson.put("userIds",thirdId);
Map<String,Object> templateVariableMap = new HashMap<>();
templateVariableMap.put("projectNameCn",PRN_CN);
templateVariableMap.put("projectNameEn",PRN_EN);
templateVariableMap.put("standName",standName);
templateVariableMap.put("itemName",itemName);
templateVariableMap.put("Initiator",projectLibraryBase.getStudioEngineerName());
templateVariableMap.put("endTime",DateUtils.formatDate(endTime));
templateVariableMap.put("viewBtnUrlCn",hrefFeishu_CN);
templateVariableMap.put("viewBtnUrlEn",hrefFeishu_EN);
templateVariableMap.put("operateUserName",currentUser.getUsername());
larkMesJson.put("templateVariableMap",templateVariableMap);
this.feishuService.batchSendLarkCardMsgByTemplate2(larkMesJson);
}
}
} catch (Exception e) {
log.error("飞书消息推送失败");
}
}catch (Exception ex){
ex.printStackTrace();
log.error("责任人-接受任务失败:" + ex.getMessage());
@@ -1357,6 +1581,18 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
this.projectCertificationInventoryLogEOService.insertBatch(projectCertificationInventoryLogEOList);
}
String PRN_EN = projectLibraryBase.getProjectNameEn();//项目名称 英文
String PRN_CN = projectLibraryBase.getProjectNameCn();//项目名称 中文
// 获取认证清单 - 飞书跳转链接
Map<String, Object> hrefFeishuMap = this.getCertificationInventoryLinkHrefFeishu(projectLibraryBase.getId(), PRN_CN, PRN_EN);
String hrefFeishu_CN = (String) hrefFeishuMap.get("hrefFeishu_CN");
String hrefFeishu_EN = (String) hrefFeishuMap.get("hrefFeishu_EN");
Map<String, Object> standNameAndItemName = this.projectCertificationInventoryEOService.getStandNameAndItemName(projectCertificationInventoryEOList);
String standName = (String) standNameAndItemName.get("standName");
String itemName = (String) standNameAndItemName.get("itemName");
try {
// 将当前责任人的待办任务转为已办
LambdaUpdateWrapper<ProcessInfoDetailEO> detailUpdateWrap = new LambdaUpdateWrapper<>();
@@ -1391,6 +1627,39 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
// 责任人接受任务,将数据的状态更新为 结果待提交。
this.updateBatchById(projectCertificationInventoryEOList);
List<SysUser> certificationEngineers = this.sysUserService.querySysUserListByIdList(certificationEngineerList);
try {
for (String userId : certificationEngineerList) {
String thirdId = this.sysUserService.getUserThirdIdByUserId(certificationEngineers,userId);
if(StringUtils.isNotEmpty(thirdId)){
// 根据结束时间进行排序,获取最近的时间,发消息时使用。
this.certificationInventoryEOListSortByEndTimeAsc(projectCertificationInventoryEOList);
Date endTime = projectCertificationInventoryEOList.get(0).getEndTime();
JSONObject larkMesJson = new JSONObject();
larkMesJson.put("template_id", TemplateInfoEnum2.CERTIFICATION_MESSAGE11.getValue());
larkMesJson.put("userIds",thirdId);
Map<String,Object> templateVariableMap = new HashMap<>();
templateVariableMap.put("projectNameCn",PRN_CN);
templateVariableMap.put("projectNameEn",PRN_EN);
templateVariableMap.put("standName",standName);
templateVariableMap.put("itemName",itemName);
templateVariableMap.put("Initiator",projectLibraryBase.getStudioEngineerName());
templateVariableMap.put("endTime",DateUtils.formatDate(endTime));
templateVariableMap.put("viewBtnUrlCn",hrefFeishu_CN);
templateVariableMap.put("viewBtnUrlEn",hrefFeishu_EN);
templateVariableMap.put("operateUserName",currentUser.getUsername());
larkMesJson.put("templateVariableMap",templateVariableMap);
this.feishuService.batchSendLarkCardMsgByTemplate2(larkMesJson);
}
}
} catch (Exception e) {
log.error("飞书消息推送失败");
}
}catch (Exception ex){
ex.printStackTrace();
log.error("责任人-拒绝任务失败:" + ex.getMessage());
@@ -1906,6 +2175,15 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
});
this.processInfoDetailEOService.updateBatchById(processInfoDetailEOList);
}
List<String> userIdList = Arrays.asList(transferUserId.split(","));
List<SysUser> userInfoList = this.sysUserService.querySysUserListByIdList(userIdList);
this.sendMessageByTemplateId(
projectCertificationInventoryEOList,
TemplateInfoEnum2.CERTIFICATION_MESSAGE17.getValue(),
userIdList,
userInfoList
);
// 获取认证清单 - 飞书跳转链接
// 2023-03-15 去掉此消息
@@ -2054,10 +2332,46 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
for (Map.Entry<String, List<ProjectCertificationInventoryEO>> map : certifycationInventoryListByDutyPersonMap.entrySet()) {
String key = map.getKey();
List<ProjectCertificationInventoryEO> value = map.getValue();
List<String> userIdList = Arrays.asList(key.split(","));
String thirdId = this.sysUserService.getUserThirdIdByUserId(dutyPersonList,key);
// 给责任人发消息
this.sendMessageByTemplateId(
value,
TemplateInfoEnum2.CERTIFICATION_MESSAGE18.getValue(),
userIdList,
dutyPersonList
);
/*// 待提交数据 单独发消息
List<ProjectCertificationInventoryEO> toBeSubmitDataList = value.stream().filter(v -> {
boolean flag = false;
if(StringUtils.equals(v.getFlowStatus(),CertificationInventoryFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue())){
flag = true;
}
return flag;
}).collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(toBeSubmitDataList)) {
this.sendMessageByTemplateId(
toBeSubmitDataList,
TemplateInfoEnum2.CERTIFICATION_MESSAGE18.getValue(),
userIdList,
dutyPersonList
);
}*/
/*String thirdId = this.sysUserService.getUserThirdIdByUserId(dutyPersonList,key);
if(StringUtils.isNotEmpty(thirdId)){
// 过滤掉 待提交的数据,正常发消息
value = value.stream().filter(v -> {
boolean flag = false;
if(!StringUtils.equals(v.getFlowStatus(),CertificationInventoryFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue())){
flag = true;
}
return flag;
}).collect(Collectors.toList());
// 根据结束时间进行排序,获取最近的时间,发消息时使用。
Collections.sort(value, new Comparator<ProjectCertificationInventoryEO>() {
@Override
@@ -2076,7 +2390,13 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
try {
JSONObject larkMesJson = new JSONObject();
larkMesJson.put("template_id", TemplateInfoEnum2.CERTIFICATION_MESSAGE1.getValue());
String templateId = TemplateInfoEnum2.CERTIFICATION_MESSAGE1.getValue();
if(StringUtils.equals(operatorType,OperatorTypeEnum.CERTIFICATION_INVENTORY_CERTIFICATION_ENGINEER_EXPEDITING.getValue())){
templateId = TemplateInfoEnum2.CERTIFICATION_MESSAGE16.getValue();
}
larkMesJson.put("template_id", templateId);
larkMesJson.put("userIds",thirdId);
Map<String,Object> templateVariableMap = new HashMap<>();
@@ -2094,7 +2414,7 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
} catch (Exception e) {
log.error("飞书消息推送失败");
}
}
}*/
}
}
}
@@ -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);
}
}
@@ -3552,6 +3553,15 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
if(ObjectUtils.isNotEmpty(projectLawsInventoryEO.getVerifyDueDate())){
projectLawsInventoryEOTemp.setVerifyDueDate(projectLawsInventoryEO.getVerifyDueDate());
}
//验证符合性确认-交付物类型
if(ObjectUtils.isNotEmpty(projectLawsInventoryEO.getVerifyDeliverableType())){
projectLawsInventoryEOTemp.setVerifyDeliverableType(projectLawsInventoryEO.getVerifyDeliverableType());
}
//设计符合性确认-交付物类型
if(ObjectUtils.isNotEmpty(projectLawsInventoryEO.getDesignDeliverableType())){
projectLawsInventoryEOTemp.setDesignDeliverableType(projectLawsInventoryEO.getDesignDeliverableType());
}
//================================批量设置人员===================================================
//法规工程师id
if(StringUtils.isNotEmpty(projectLawsInventoryEO.getRegulationOwnerId())){
@@ -4004,7 +4014,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 +4024,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 +4088,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 +4102,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 +4407,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 +4417,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 +4481,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 +4495,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 +5717,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 +5853,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 +7604,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 +7640,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 +10016,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 +10038,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 +10075,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 +10100,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 +10153,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("退回成功!");
}
@@ -10096,5 +10195,115 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
return result;
}
@Override
public String getDutyTerritoryNameById(String projectLawsInventoryId, String cut, List<ProjectLawsInventoryEO> projectLawsInventoryEOList, List<SysDictItem> sysDictItems,String dicCode) {
String result = "";
for (ProjectLawsInventoryEO lawsInventory : projectLawsInventoryEOList) {
if(StringUtils.equals(projectLawsInventoryId,lawsInventory.getId())){
String dutyTerritory = lawsInventory.getDutyTerritory();
result = disposeShowDictItemValue(sysDictItems, dutyTerritory,cut,ProjectInventoryFieldEnum.DUTY_TERRITORY.getValue());
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;
}
});
}
}
@@ -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 {
@@ -25,11 +25,13 @@ import com.jero.modules.project.service.IProjectLibraryBaseService;
import com.jero.modules.project.service.IProjectTaskInventoryDetailEOService;
import com.jero.modules.project.service.IProjectTaskInventoryEOService;
import com.jero.modules.system.entity.SysCategory;
import com.jero.modules.system.entity.SysDictItem;
import com.jero.modules.system.entity.SysUser;
import com.jero.modules.system.enums.DicCodeEnum;
import com.jero.modules.system.service.ISysDictService;
import com.jero.modules.system.service.ISysUserService;
import com.jero.modules.system.service.impl.SysCategoryServiceImpl;
import com.jero.modules.system.service.impl.SysDictItemServiceImpl;
import com.jero.modules.todoCenter.entity.ProcessInfoDetailEO;
import com.jero.modules.todoCenter.entity.ProcessInfoEO;
import com.jero.modules.todoCenter.enums.DesignComplianceFlowNodeKeyEnum;
@@ -92,6 +94,8 @@ public class ProcessInfoEOServiceImpl extends ServiceImpl<ProcessInfoEOMapper, P
private ISysDictService sysDictService;
@Autowired
private SysCategoryServiceImpl sysCategoryService;
@Autowired
private SysDictItemServiceImpl sysDictItemServiceImpl;
/**
* 保存
@@ -610,13 +614,19 @@ public class ProcessInfoEOServiceImpl extends ServiceImpl<ProcessInfoEOMapper, P
lawsInventoryEOQueryWrapper.lambda().in(ProjectLawsInventoryEO::getId,projectLawsInventoryIdList);
projectLawsInventoryEOList = this.projectLawsInventoryEOService.list(lawsInventoryEOQueryWrapper);
}
List<SysCategory> categoryList = sysCategoryService.list();
List<SysCategory> categoryList = this.sysCategoryService.list();
List<SysDictItem> sysDictItems = this.sysDictItemServiceImpl.getBaseMapper().selectItemsAll();
for (ProcessInfoVO data : datas) {
// 处理展示的交付物类型信息
if(CollectionUtils.isNotEmpty(projectLawsInventoryEOList)){
// 处理展示的交付物类型信息
String projectLawsInventoryId = data.getProjectLawsInventoryId();
String deliverableTypeName = this.projectLawsInventoryEOService.getDeliverableTypeNameById(projectLawsInventoryId,cut,data.getFlowType(),projectLawsInventoryEOList,categoryList);
data.setDeliverableTypeName(deliverableTypeName);
// 处理责任领域展示信息
String dutyTerritoryName = this.projectLawsInventoryEOService.getDutyTerritoryNameById(projectLawsInventoryId,cut,projectLawsInventoryEOList,sysDictItems,ProjectInventoryFieldEnum.DUTY_TERRITORY.getValue());
data.setDutyTerritoryName(dutyTerritoryName);
}
}
datas.forEach(data -> {
@@ -116,4 +116,6 @@ public class ProcessInfoVO implements Serializable {
/**交付物类型展示名称**/
private String deliverableTypeName;
/**责任领域展示抿成**/
private String dutyTerritoryName;
}
@@ -108,4 +108,7 @@ public class ProcessHistoryEO implements Serializable {
/**附件名称,页面展示字段**/
@TableField(exist = false)
private String approvalFileName;;
@TableField(exist = false)
private String operatorResultName;
}
@@ -164,6 +164,9 @@ public class ProcessHistoryEOServiceImpl extends ServiceImpl<ProcessHistoryEOMap
if(StringUtils.isNotEmpty(data.getOperatorResult())){
data.setReviewResult(ReviewResultEnum.getTextByValue(data.getOperatorResult(),cut));
}
if(StringUtils.isNotEmpty(data.getOperatorResult())){
data.setOperatorResultName(ReviewResultEnum.getTextByValue(data.getOperatorResult(),cut));
}
if(StringUtils.isNotEmpty(data.getOperatorPersonId()) && CollectionUtils.isNotEmpty(sysUserList)){
SysUser userInfo = sysUserList.stream().filter(sysUser -> sysUser.getId().equals(data.getOperatorPersonId())).collect(Collectors.toList()).get(0);
data.setAssignee(userInfo.getUsername());
@@ -15,7 +15,7 @@
<div class="title-text">
<span class="title-text-text" :title="$t('certificationType')">{{$t('certificationType')}}</span>
</div>
<a-form-model-item class="itemModel">
<a-form-model-item class="itemModel-multi">
<j-multi-select-tag class="box-input" v-model="formInline.attestationType"
:placeholder="$t('PleaseSelect')+$t('certificationType')"
:type="'select'"
@@ -33,7 +33,7 @@
<div class="title-text">
<span class="title-text-text" :title="$t('certificationLevel')">{{$t('certificationLevel')}}</span>
</div>
<a-form-model-item class="itemModel">
<a-form-model-item class="itemModel-multi">
<j-multi-select-tag class="box-input" v-model="formInline.attestationRank"
:placeholder="$t('PleaseSelect')+$t('certificationLevel')"
:type="'select'"
@@ -47,7 +47,7 @@
</div>
</a-col>
</a-row>
<a-row :gutter="24">
<a-row :gutter="24" v-if="this.code == '0'">
<a-col :span="12">
<div class="box-title-text">
<div class="title-text">
@@ -55,25 +55,33 @@
</div>
<a-form-model-item class="itemModel-multi">
<j-multi-select-tag class="box-input" v-model="formInline.dutyTerritory"
@change="dutyTerritoryChange"
:placeholder="$t('PleaseSelect')+$t('areaOfResponsibility')"
:type="'select'"
:triggerChange="false" :dictCode="'duty_territory'"/>
</a-form-model-item>
</div>
</a-col>
<a-col :span="12">
<a-col :span="12" v-if="this.code == '0'">
<div class="box-title-text">
<div class="title-text">
<span class="title-text-text"
:title="$t('engineeringInterfacePerson')">{{$t('engineeringInterfacePerson')}}</span>
:title="$t('regulatoryEngineer')">{{$t('regulatoryEngineer')}}</span>
</div>
<a-form-model-item class="itemModel" prop="designDutyId">
<PersonnelSelection :query="{db_field_name:'engineeringInterfacePerson',db_field_txt:$t('engineeringInterfacePerson')}"
:isSingleChoice="true"
:personneQuery="formInline"
v-if="visible"
@change="PersonnelSelectionChange"
v-model="formInline.engineeringInterfacePersonName"/>
<a-form-model-item class="itemModel" prop="regulationOwnerId">
<a-select :placeholder="$t('PleaseSelect')+$t('regulatoryEngineer')"
class="box-input"
:getPopupContainer="triggerNode=> triggerNode.parentNode"
allowClear
v-model="formInline.regulationOwnerId">
<a-select-option v-for="(item, key) in regulatoryEngineerList"
:key="key"
:value="item.value">
<span style="display: inline-block;width: 100%" :title=" item.name">
{{ item.name }}
</span>
</a-select-option>
</a-select>
<!-- <j-dict-select-tag class="box-input" v-model="formInline.designDuty"-->
<!-- :disabled="formInline.roleCode == 0 ? false : true"-->
<!-- @input="handleInput('designDuty')"-->
@@ -85,19 +93,20 @@
</a-col>
</a-row>
<a-row :gutter="24">
<a-col :span="12" v-if="this.code != '1'">
<a-col :span="12">
<div class="box-title-text">
<div class="title-text">
<span class="title-text-text"
:title="$t('regulatoryEngineer')">{{$t('regulatoryEngineer')}}</span>
:title="$t('engineeringInterfacePerson')">{{$t('engineeringInterfacePerson')}}</span>
</div>
<a-form-model-item class="itemModel" prop="designDutyId">
<PersonnelSelection :query="{db_field_name:'regulatoryEngineer',db_field_txt:$t('regulatoryEngineer')}"
:isSingleChoice="true"
:personneQuery="formInline"
v-if="visible"
@change="PersonnelSelectionChange"
v-model="formInline.regulatoryEngineerName"/>
<PersonnelSelection
:query="{db_field_name:'engineeringInterfacePerson',db_field_txt:$t('engineeringInterfacePerson')}"
:isSingleChoice="true"
:personneQuery="formInline"
v-if="visible"
@change="PersonnelSelectionChange"
v-model="formInline.engineeringInterfacePersonName"/>
<!-- <j-dict-select-tag class="box-input" v-model="formInline.designDuty"-->
<!-- :disabled="formInline.roleCode == 0 ? false : true"-->
<!-- @input="handleInput('designDuty')"-->
@@ -118,13 +127,13 @@
<span class="title-text-text"
:title="$t('personLiable')">{{$t('personLiable')}}</span>
</div>
<a-form-model-item class="itemModel" prop="designDutyId">
<PersonnelSelection :query="{db_field_name:'dutyPerson',db_field_txt:$t('personLiable')}"
<a-form-model-item class="itemModel-multi" prop="designDutyIdName">
<PersonnelSelection :query="{db_field_name:'designDutyId',db_field_txt:$t('personLiable')}"
:isSingleChoice="true"
:personneQuery="formInline"
v-if="visible"
@change="PersonnelSelectionChange"
v-model="formInline.dutyPersonName"/>
v-model="formInline.designDutyIdName"/>
<!-- <j-dict-select-tag class="box-input" v-model="formInline.designDuty"-->
<!-- :disabled="formInline.roleCode == 0 ? false : true"-->
<!-- @input="handleInput('designDuty')"-->
@@ -140,13 +149,13 @@
<span class="title-text-text"
:title="$t('cutoffTime')">{{$t('cutoffTime')}}</span>
</div>
<a-form-model-item class="itemModel" :prop="'verifyDueDate'">
<a-form-model-item class="itemModel" :prop="'designDueDate'">
<a-date-picker class="box-input"
:placeholder="$t('PleaseSelect')+$t('cutoffTime')"
@change="dateChange({db_field_name:'verifyDueDate'})"
@change="dateChange({db_field_name:'designDueDate'})"
format="YYYY-MM-DD"
:getCalendarContainer="(trigger) => trigger.parentNode"
v-model="formInline.verifyDueDate"
v-model="formInline.designDueDate"
style="width: 100%"/>
</a-form-model-item>
</div>
@@ -189,7 +198,7 @@
<span class="title-text-text"
:title="$t('typeOfDeliverables')">{{$t('typeOfDeliverables')}}</span>
</div>
<a-form-model-item class="itemModel" prop="typeOfDeliverables">
<a-form-model-item class="itemModel-multi" prop="typeOfDeliverables">
<a-tree-select
tree-node-filter-prop="title"
v-model="formInline.designDeliverableType"
@@ -220,13 +229,13 @@
<span class="title-text-text"
:title="$t('personLiable')">{{$t('personLiable')}}</span>
</div>
<a-form-model-item class="itemModel" prop="verifyDutyId">
<PersonnelSelection :query="{db_field_name:'dutyPerson',db_field_txt:$t('personLiable')}"
<a-form-model-item class="itemModel-multi" prop="verifyDutyIdName">
<PersonnelSelection :query="{db_field_name:'verifyDutyId',db_field_txt:$t('personLiable')}"
:isSingleChoice="true"
:personneQuery="formInline"
v-if="visible"
@change="PersonnelSelectionChange"
v-model="formInline.dutyPersonName"/>
v-model="formInline.verifyDutyIdName"/>
<!-- <j-dict-select-tag class="box-input" v-model="formInline.verifyDuty"-->
<!-- :disabled="formInline.roleCode == 0 ? false : true"-->
<!-- @input="handleInput('verifyDuty')"-->
@@ -291,7 +300,7 @@
<span class="title-text-text"
:title="$t('typeOfDeliverables')">{{$t('typeOfDeliverables')}}</span>
</div>
<a-form-model-item class="itemModel" prop="verifyDeliverableType">
<a-form-model-item class="itemModel-multi" prop="verifyDeliverableType">
<a-tree-select
tree-node-filter-prop="title"
v-model="formInline.verifyDeliverableType"
@@ -337,21 +346,37 @@
formInline: {},
rules: {},
ids: [],
code:'',
code: '',
regulatoryEngineerList: []
}
},
mounted() {
},
methods: {
dutyTerritoryChange(event) {
this.formInline.regulationOwnerId = undefined
this.formInline = {...this.formInline}
this.queryPersonByProject(event)
},
queryPersonByProject(row) {
let query = {
projectId: this.$route.query.id,
dutyTerritory: row.dutyTerritory || row
}
getAction('/project/projectRelatedPersonnel/queryPersonByProjectId', query).then((res) => {
if (res.success) {
this.regulatoryEngineerList = res.result.lawEngineerList //法规工程师
}
})
},
PersonnelSelectionChange(value, id) {
this.formInline[value] = id
this.formInline = { ...this.formInline }
},
edit(data,code) {
edit(data, code) {
this.visible = true
this.getDeliverableTree()
this.code = code
console.log(this.code)
this.$nextTick(() => {
this.ids = data || []
this.formInline = {}
@@ -375,9 +400,15 @@
},
handleOkOne() {
let ids = JSON.parse(JSON.stringify(this.ids))
let formInline = JSON.parse(JSON.stringify(this.formInline))
Object.keys(formInline).forEach(res => {
if (formInline[res] && formInline[res] instanceof Array) {
formInline[res] = formInline[res].join(',')
}
})
let query = {
ids: ids.join(','),
...this.formInline
...formInline
}
this.confirmLoading = true
postAction(this.url.setBatch, query).then((res) => {
@@ -398,9 +429,15 @@
content: _this.$t('batchmodify'),
onOk() {
let ids = JSON.parse(JSON.stringify(_this.ids))
let formInline = JSON.parse(JSON.stringify(_this.formInline))
Object.keys(formInline).forEach(res => {
if (formInline[res] && formInline[res] instanceof Array) {
formInline[res] = formInline[res].join(',')
}
})
let query = {
ids: ids.join(','),
..._this.formInline
...formInline
}
_this.confirmLoading = true
postAction(_this.url.setBatch, query).then((res) => {
@@ -252,19 +252,26 @@
<span class="title-text-text" :title="$t('engineeringInterfacePerson')">{{$t('engineeringInterfacePerson')}}</span>
</div>
<a-form-model-item class="itemModel" :prop="'engineeringInterfacePerson'">
<a-select :placeholder="$t('PleaseSelect')+$t('engineeringInterfacePerson')"
class="box-input"
allowClear
:getPopupContainer="triggerNode=> triggerNode.parentNode"
v-model="formInline.engineeringInterfacePerson">
<a-select-option v-for="(item, key) in engineeringInterfacePersonList"
:key="key"
:value="item.value">
<span style="display: inline-block;width: 100%" :title=" item.name ">
{{ item.name }}
</span>
</a-select-option>
</a-select>
<PersonnelSelection
:query="{db_field_name:'engineeringInterfacePerson',db_field_txt:$t('engineeringInterfacePerson')}"
:isSingleChoice="true"
:personneQuery="formInline"
v-if="visible"
@change="PersonnelSelectionChange"
v-model="formInline.engineeringInterfacePersonName"/>
<!-- <a-select :placeholder="$t('PleaseSelect')+$t('engineeringInterfacePerson')"-->
<!-- class="box-input"-->
<!-- allowClear-->
<!-- :getPopupContainer="triggerNode=> triggerNode.parentNode"-->
<!-- v-model="formInline.engineeringInterfacePerson">-->
<!-- <a-select-option v-for="(item, key) in engineeringInterfacePersonList"-->
<!-- :key="key"-->
<!-- :value="item.value">-->
<!-- <span style="display: inline-block;width: 100%" :title=" item.name ">-->
<!-- {{ item.name }}-->
<!-- </span>-->
<!-- </a-select-option>-->
<!-- </a-select>-->
</a-form-model-item>
</div>
</a-col>
@@ -315,19 +322,25 @@
:title="$t('personLiable')">{{$t('personLiable')}}</span>
</div>
<a-form-model-item class="itemModel" prop="designDutyId">
<a-select :placeholder="$t('PleaseSelect')+$t('personLiable')"
:getPopupContainer="triggerNode=> triggerNode.parentNode"
class="box-input"
allowClear
v-model="formInline.designDutyId">
<a-select-option v-for="(item, key) in designDutyList"
:key="key"
:value="item.value">
<span style="display: inline-block;width: 100%" :title=" item.name ">
{{ item.name }}
</span>
</a-select-option>
</a-select>
<PersonnelSelection :query="{db_field_name:'designDutyId',db_field_txt:$t('personLiable')}"
:isSingleChoice="true"
:personneQuery="formInline"
v-if="visible"
@change="PersonnelSelectionChange"
v-model="formInline.designDutyIdName"/>
<!-- <a-select :placeholder="$t('PleaseSelect')+$t('personLiable')"-->
<!-- :getPopupContainer="triggerNode=> triggerNode.parentNode"-->
<!-- class="box-input"-->
<!-- allowClear-->
<!-- v-model="formInline.designDutyId">-->
<!-- <a-select-option v-for="(item, key) in designDutyList"-->
<!-- :key="key"-->
<!-- :value="item.value">-->
<!-- <span style="display: inline-block;width: 100%" :title=" item.name ">-->
<!-- {{ item.name }}-->
<!-- </span>-->
<!-- </a-select-option>-->
<!-- </a-select>-->
<!-- <j-dict-select-tag class="box-input" v-model="formInline.designDuty"-->
<!-- :disabled="formInline.roleCode == 0 ? false : true"-->
<!-- @input="handleInput('designDuty')"-->
@@ -644,25 +657,12 @@
:title="$t('personLiable')">{{$t('personLiable')}}</span>
</div>
<a-form-model-item class="itemModel" prop="verifyDutyId">
<a-select :placeholder="$t('PleaseSelect')+$t('personLiable')"
class="box-input"
allowClear
:getPopupContainer="triggerNode=> triggerNode.parentNode"
v-model="formInline.verifyDutyId">
<a-select-option v-for="(item, key) in verifyDutyList"
:key="key"
:value="item.value">
<span style="display: inline-block;width: 100%" :title=" item.name ">
{{ item.name }}
</span>
</a-select-option>
</a-select>
<!-- <j-dict-select-tag class="box-input" v-model="formInline.verifyDuty"-->
<!-- :disabled="formInline.roleCode == 0 ? false : true"-->
<!-- @input="handleInput('verifyDuty')"-->
<!-- :placeholder="$t('PleaseSelect')+$t('personLiable')"-->
<!-- :type="'select'"-->
<!-- :triggerChange="false" :dictCode="'ze2_ren4_ren2'"/>-->
<PersonnelSelection :query="{db_field_name:'verifyDutyId',db_field_txt:$t('personLiable')}"
:isSingleChoice="true"
:personneQuery="formInline"
v-if="visible"
@change="PersonnelSelectionChange"
v-model="formInline.verifyDutyIdName"/>
</a-form-model-item>
</div>
</a-col>
@@ -214,7 +214,7 @@
<!-- {{ $t('customize') }}-->
<!-- </div>-->
<div @click="handleExport" v-has="'projectLawsInventory:exportData'"
v-if="this.roleSwitchingCode == '1' || this.roleSwitchingCode == '2' || this.roleSwitchingCode == '30' || this.roleSwitchingCode == '31'"
v-if="this.roleSwitchingCode != '0'"
class="operator-text">
<a-icon type="export" :rotate="-90"/>
{{ $t('export') }}
@@ -320,6 +320,22 @@
</span>
<span v-else>--</span>
</span>
<span slot="designFlowStatusName" slot-scope="text,result">
<span v-if="result.designFlowStatus == 'List to be released' ||
result.designFlowStatus == 'List to be checked'">
{{text}}
</span>
<a v-else @click="designFlowStatusClick(result,$t('designComplianceReview'))"
:title="text">{{text}}</a>
</span>
<span slot="verifyFlowStatusName" slot-scope="text,result">
<span v-if="result.verifyFlowStatus == 'List to be released' ||
result.verifyFlowStatus == 'List to be checked'">
{{text}}
</span>
<a v-else @click="designFlowStatusClick(result,$t('verificationComplianceReview'))"
:title="text">{{text}}</a>
</span>
</a-table>
<div class="buttom-box" v-if="dataSource && dataSource.length > 0">
{{ $t('total') + ' ' + this.dataSource.length + ' ' + $t('strip') }}
@@ -440,17 +456,53 @@
</a-row>
</a-form-model>
</a-modal>
<a-modal
:title="$t('question')"
:width="500"
:visible="visibleQuestion"
:confirm-loading="confirmLoadingQuestion"
:maskClosable="false"
@ok="handleOkQuestion"
@cancel="handleCancelQuestion"
>
<a-form-model :model="formInlineQuestion" class="formAdd" :rules="rulesRoleQuestion"
ref="ruleFormQuestion">
<a-row :gutter="24">
<a-col :span="24">
<div class="box-title-text-index">
<div class="title-text-Comment">
<span class="Required">*</span>
<span class="title-text-text" :title="$t('roleSwitching')">{{ $t('roleSwitching') }}</span>
</div>
<a-form-model-item class="itemModelComment" :prop="'roleSwitchingCode'">
<a-select allowClear :placeholder="$t('pleaseSelect')+$t('roleSwitching')"
v-model="formInlineRoleSwitching.question">
<!-- <a-select-option :value="null">{{$t('pleaseSelect')}}</a-select-option>-->
<a-select-option :value="item.roleCode" v-for="item in questionList">
<span class="itemOption-index" :title="item.roleName">
{{ item.roleName }}
</span>
</a-select-option>
</a-select>
</a-form-model-item>
</div>
</a-col>
</a-row>
</a-form-model>
</a-modal>
<JLoading :loading="JLoading">{{ $t('dataLoading') }}</JLoading>
<JLoading :loading="JTextLoading">{{ $t('Submitting') }}</JLoading>
<resultReportedUpload @resultReportedUploadForm="addModelList" ref="resultReportedUploadRef"/>
<listOfRegulationsView ref="listOfRegulationsViewRef"/>
<batchSettingPersonnel :url="url" ref="batchSettingPersonnelRef" @batchSettingPersonnelForm="addModelList"/>
<viewFileModel ref="viewFileModelRef"/>
<designCompliance ref="designComplianceRef"/>
</a-card>
</template>
<script>
import ImportFile from '@/components/ImportFile/index'
import designCompliance from '../../toDoCenter/projectRegulationTasks/components/designCompliance'
import listAddModel from './listAddModel'
import listEditModel from './listEditModel'
import batSetting from './batSetting'
@@ -485,12 +537,15 @@
resultReportedUpload,
batchSettingPersonnel,
listOfRegulationsView,
viewFileModel
viewFileModel,
designCompliance
},
mixins: [ResizeColumnProvide, ResizeHeader],
data() {
return {
toggleSearchStatus: false,
visibleQuestion: false,
confirmLoadingQuestion: false,
roleSwitchingList: [],
listTitle: '',
orderBy: '1',
@@ -557,14 +612,6 @@
dataIndex: 'regulationOwnerName',
width: 180
},
// {
// title: this.$t('certifiedEngineer'),
// align: 'left',
// ellipsis: true,
// sorter: true,
// dataIndex: 'homologationEngineerName',
// width: 180
// },
{
title: this.$t('engineeringInterfacePerson'),
align: 'left',
@@ -602,7 +649,8 @@
dataIndex: 'designFlowStatusName',
align: 'left',
ellipsis: true,
width: 140
width: 140,
scopedSlots: { customRender: 'designFlowStatusName' }
},
{
title: this.$t('deliverableTemplate'),
@@ -612,13 +660,6 @@
ellipsis: true,
scopedSlots: { customRender: 'designDeliverableTemplate' }
}
// {
// title: this.$t('descriptionDeliverables'),
// dataIndex: 'designRemark',
// align: 'left',
// width: 220,
// ellipsis: true
// }
]
},
{
@@ -643,7 +684,8 @@
dataIndex: 'verifyFlowStatusName',
align: 'left',
ellipsis: true,
width: 180
width: 180,
scopedSlots: { customRender: 'verifyFlowStatusName' }
},
{
title: this.$t('deliverableTemplate'),
@@ -653,13 +695,6 @@
ellipsis: true,
scopedSlots: { customRender: 'verifyDeliverableTemplateName' }
}
// {
// title: this.$t('descriptionDeliverables'),
// dataIndex: 'verifyRemark',
// align: 'left',
// width: 220,
// ellipsis: true
// }
]
},
{
@@ -863,7 +898,7 @@
headFieldEn: 'Process Status',
field: 'designFlowStatusName',
affirmFlag: '1',
key: 24 ,
key: 24,
moduleFlag: '法规清单'
},
{
@@ -1148,19 +1183,88 @@
},
methods: {
...mapGetters(['userInfo']),
//收起/展开
handleToggleSearch() {
this.toggleSearchStatus = !this.toggleSearchStatus
},
//流程状态点击事件
designFlowStatusClick(row, name) {
let query = {}
let TaskKey = ''
if (name == this.$t('designComplianceReview')) {
if (row.designFlowStatus == 'Task to be confirmed') {
TaskKey = 'zrrqr'
} else if (row.designFlowStatus == 'Results to be submitted') {
TaskKey = 'zrrtjjfw'
} else if (row.designFlowStatus == 'Results to be reviewed') {
TaskKey = 'fggcssh'
}
query = {
actiProcInstId: row.designPId,
projectTaskInventoryId: row.id,
projectLibraryId: row.projectLibraryId,
TaskKey: TaskKey,
isDisplay: false,
flowType: 2,
Sponsor: 'regulationOwnerName',
personLiable: 'designDutyName',
typeOfDeliverables: 'designDeliverableTypeName',
deliverableTemplate: 'designDeliverableTemplate',
DueDate: 'designDueDate',
remarks: 'designRemark',
projectName: row.projectName,
targetMarket: row.targetMarket,
projectNameId: row.projectNameId,
primaryKeyId: row.primaryKeyId
}
} else {
if (row.verifyFlowStatus == 'Task to be confirmed') {
TaskKey = 'zrrqr'
} else if (row.verifyFlowStatus == 'Results to be submitted') {
TaskKey = 'zrrtjjfw'
} else if (row.verifyFlowStatus == 'Results to be reviewed') {
TaskKey = 'fggcssh'
}
query = {
actiProcInstId: row.verifyPId,
projectTaskInventoryId: row.id,
projectLibraryId: row.projectLibraryId,
TaskKey: row.taskDefinitionKey,
flowType: 4,
isDisplay: false,
Sponsor: 'regulationOwnerName',
personLiable: 'verifyDutyName',
typeOfDeliverables: 'verifyDeliverableTypeName',
deliverableTemplate: 'verifyDeliverableTemplate',
DueDate: 'verifyDueDate',
remarks: 'verifyRemark',
projectName: row.projectName,
targetMarket: row.targetMarket,
projectNameId: row.projectNameId,
primaryKeyId: row.primaryKeyId
}
}
this.$refs.designComplianceRef.getList(JSON.parse(JSON.stringify(query)), name)
},
//查看列表页面
viewClick(row) {
row.roleCodeIndex = this.roleSwitchingCode
this.$refs.listOfRegulationsViewRef.editModel(JSON.parse(JSON.stringify(row)))
},
//模板下载
handleModule() {
downloadFile(this.url.exportTemplate, this.$t('listOfRegulations') + this.$t('importTemplate') + '.xls', {})
},
//时间禁用
disabledDate(current) {
return current && current < moment().subtract(1, 'day')
},
//获取切换角色的数据
getRoleByUserId(callback) {
getAction('/project/projectLawsInventoryEO/getRoleByUserId', { projectLibraryId: this.$route.query.id }).then((res) => {
if (res.success) {
@@ -1171,6 +1275,9 @@
callback && callback()
})
},
//通过登录人查出当前是什么角色
//判断角色是否存在存在即可展示如不存在显示roleSwitchingList数据中的第一个
getAndUserId() {
let query = {
projectLibraryId: this.$route.query.id,
@@ -1198,6 +1305,8 @@
}
})
},
//生成合规报告
ExportReportClick() {
let selectedRowKeys = JSON.parse(JSON.stringify(this.selectedRowKeys))
if (selectedRowKeys && selectedRowKeys.length == 0) {
@@ -1209,6 +1318,8 @@
downloadFile(this.url.ExportReportUrl, this.$t('listOfRegulations') + this.$t('compliancereport') + '-' + serialNumber + '.docx', { id: selectedRowKeys.join(',') })
}
},
//导出
handleExport() {
let roleCodeIndex = this.roleSwitchingCode
let selectedRowKeys = JSON.parse(JSON.stringify(this.selectedRowKeys))
@@ -1249,6 +1360,7 @@
transferClick() {
this.$refs.transferListRef.transferModel()
},
//批量设置
batSettingClick() {
let code = this.roleSwitchingCode
if (this.selectedRowKeys && this.selectedRowKeys.length > 0) {
@@ -1257,6 +1369,8 @@
this.$message.warning(this.$t('selectLeastOne'))
}
},
//批量设置人员
batchSettingPersonnelClick() {
if (this.selectedRowKeys && this.selectedRowKeys.length > 0) {
let selectedRowKeys = JSON.parse(JSON.stringify(this.selectedRowKeys))
@@ -1298,11 +1412,11 @@
this.$message.warning(this.$t('selectLeastOne'))
}
},
// 撤回
withdrawnClick() {
if (this.selectedRowKeys && this.selectedRowKeys.length > 0) {
let selectedRowKeys = JSON.parse(JSON.stringify(this.selectedRowKeys))
let isTrue
let contentList = []
let detailedWarningList = []
let idList = []
@@ -1313,6 +1427,7 @@
}
}
}
//判断当前流程状态是否为清单待校核的数据
for (let i = 0; i < contentList.length; i++) {
if (contentList[i].verifyFlowStatus == 'List to be checked' ||
contentList[i].designFlowStatus == 'List to be checked') {
@@ -1353,6 +1468,8 @@
this.$message.warning(this.$t('selectLeastOne'))
}
},
//每一次不满足条件的提示语
promptInformation(detailedWarningList) {
let that = this
this.$warning({
@@ -1363,49 +1480,90 @@
)
})
},
//催办
questionClick() {
if (this.selectedRowKeys && this.selectedRowKeys.length > 0) {
let selectedRowKeys = JSON.parse(JSON.stringify(this.selectedRowKeys))
let isTrue
let content = []
let idList = []
let detailedWarningList = []
for (let i = 0; i < this.dataSource.length; i++) {
for (let j = 0; j < selectedRowKeys.length; j++) {
if (this.dataSource[i].id == selectedRowKeys[j]) {
if (this.dataSource[i].taskAffirmStatus == 'List to confirm' ||
this.dataSource[i].inventoryAffirmStatus == 'List to confirm') {
isTrue = true
} else {
isTrue = false
this.$message.warning(this.$t('OnlyOrTaskconfirmationOut'))
return
}
content.push(this.dataSource[i])
}
}
}
if (isTrue) {
let _this = this
this.$confirm({
content: _this.$t('ConfirmQuestion'),
onOk() {
let query = {
ids: selectedRowKeys.join(','),
projectLibraryId: _this.$route.query.id
}
postAction('project/projectLawsInventoryEO/expediting', query).then((res) => {
if (res.success) {
_this.$message.success(_this.$t('OperationSuccessful'))
_this.selectedRowKeys = []
_this.getList()
} else {
_this.$message.warning(_this.$t('operationFailed'))
}
})
for (let i = 0; i < content.length > 0; i++) {
if (this.roleSwitchingCode == '0') {
//为studio角色时在通过判断流程状态是否为清单待校核
if (content[i].verifyFlowStatus == 'List to be checked' ||
content[i].designFlowStatus == 'List to be checked') {
idList.push(content[i].id)
} else {
detailedWarningList.push(
< div > { content[i].serialNumber + this.$t('pleaseSelectTheDataverificationVerified') } < /div>
)
}
})
} else if (this.roleSwitchingCode == '1') {
if (content[i].verifyFlowStatus == 'Task to be confirmed' ||
content[i].designFlowStatus == 'Task to be confirmed') {
idList.push(content[i].id)
} else {
detailedWarningList.push(
< div > { content[i].serialNumber + this.$t('pleaseSelectTheDataverificationVerified') } < /div>
)
}
} else if (this.roleSwitchingCode == '30') {
if (content[i].verifyFlowStatus == 'List to be checked' ||
content[i].designFlowStatus == 'List to be checked') {
idList.push(content[i].id)
} else {
detailedWarningList.push(
< div > { content[i].serialNumber + this.$t('pleaseSelectTheDataverificationVerified') } < /div>
)
}
}
}
if (idList && idList.length > 0) {
this.questionAction(idList, detailedWarningList)
} else {
this.promptInformation(detailedWarningList)
}
} else {
this.$message.warning(this.$t('selectLeastOne'))
}
},
//催办的接口
questionAction(selectedRowKeys, detailedWarningList) {
let _this = this
this.$confirm({
content: _this.$t('ConfirmQuestion'),
onOk() {
let query = {
ids: selectedRowKeys.join(','),
projectLibraryId: _this.$route.query.id
}
postAction('project/projectLawsInventoryEO/expediting', query).then((res) => {
if (res.success) {
_this.$message.success(_this.$t('OperationSuccessful'))
_this.selectedRowKeys = []
_this.getList()
if (detailedWarningList && detailedWarningList.length > 0) {
_this.promptInformation(detailedWarningList)
}
} else {
_this.$message.warning(_this.$t('operationFailed'))
}
})
}
})
},
//定版
fixedPlateClick() {
if (this.dataSource && this.dataSource.length > 0) {
let isTrue
@@ -1423,6 +1581,8 @@
}
}
},
//流程重置
alterationClick() {
if (this.selectedRowKeys.length > 0) {
let _this = this
@@ -1431,19 +1591,7 @@
for (let i = 0; i < this.dataSource.length; i++) {
for (let j = 0; j < selectedRowKeys.length; j++) {
if (this.dataSource[i].id == selectedRowKeys[j]) {
// if (this.dataSource[i].taskAffirmStatus == 'Accepted' ||
// (this.dataSource[i].inventoryAffirmStatus == 'Accepted' && this.dataSource[i].taskAffirmStatus == 'Accepted') ||
// (this.dataSource[i].inventoryAffirmStatus == 'Rejected' && this.dataSource[i].taskAffirmStatus == 'Accepted') ||
// (this.dataSource[i].inventoryAffirmStatus == 'Accepted' && this.dataSource[i].taskAffirmStatus == 'Rejected') ||
// (this.dataSource[i].inventoryAffirmStatus == 'Rejected' && this.dataSource[i].taskAffirmStatus == 'Rejected') ||
// (this.dataSource[i].inventoryAffirmStatus == 'Accepted' && this.dataSource[i].taskAffirmStatus == 'Not started') ||
// (this.dataSource[i].inventoryAffirmStatus == 'Rejected' && this.dataSource[i].taskAffirmStatus == 'Not started')) {
isTrue = true
// } else {
// isTrue = false
// this.$message.warning(this.$t('theTaskConfirmationStatusCannot'))
// return
// }
}
}
}
@@ -1454,6 +1602,8 @@
this.$message.warning(this.$t('selectLeastOne'))
}
},
//流程重置接口
changeInterface() {
let _this = this
this.$confirm({
@@ -1476,9 +1626,12 @@
}
})
},
//添加
handleAdd() {
this.$refs.addModelRef.addModel()
},
//切换角色的确认事件
handleOkRoleSwitching() {
this.$refs.ruleFormRoleSwitching.validate(valid => {
if (valid) {
@@ -1496,6 +1649,7 @@
this.visibleRoleSwitching = false
this.confirmLoadingRoleSwitching = false
this.$emit('getRoleSwitch', this.formInlineRoleSwitching.roleSwitchingCode)
this.selectedRowKeys = []
this.getList()
} else {
this.confirmLoadingRoleSwitching = false
@@ -1505,9 +1659,12 @@
}
})
},
//切换角色的取消事件
handleCancelRoleSwitching() {
this.visibleRoleSwitching = false
},
//打开切换角色的弹窗并判断当前的角色在角色列表中是否存在如不存在选择角色列表中的第一个
roleSwitchingClick() {
this.visibleRoleSwitching = true
this.$nextTick(() => {
@@ -1522,6 +1679,7 @@
this.formInlineRoleSwitching = { ...this.formInlineRoleSwitching }
})
},
//批量删除
handleDel() {
if (this.selectedRowKeys && this.selectedRowKeys.length > 0) {
let _this = this
@@ -1565,10 +1723,12 @@
this.$message.warning(this.$t('selectLeastOne'))
}
},
//编辑
edit(item) {
item.roleCodeIndex = this.roleSwitchingCode
this.$refs.editModelRef.editModel(JSON.parse(JSON.stringify(item)))
},
//删除
deleteLib(val) {
let _this = this
this.$confirm({
@@ -1585,14 +1745,17 @@
}
})
},
//选择数据
onSelectChange(value, rows) {
this.selectedRowKeys = value
this.selectedRowKeysList = rows
},
//搜索
searchQuery() {
this.selectedRowKeys = []
this.getList()
},
//重置
searchReset() {
this.queryParam = {}
this.selectedRowKeys = []
@@ -1600,6 +1763,7 @@
this.$refs.globalAdvancedQueryRef.emitCallback()
// this.getList()
},
addModelList() {
this.selectedRowKeys = []
this.getList()
@@ -1627,6 +1791,7 @@
this.queryParamQuery = sqp
this.getList()
},
tableOnChange(pagination, filters, sorter) {
this.orderBy = sorter.order == 'ascend' ? '1' : '2'
if (sorter.columnKey == 'attestationRank_dictText') {
@@ -1638,6 +1803,7 @@
}
this.getList()
},
getHeader() {
getAction('head/headCustomEO/list', {
moduleFlag: '法规清单'
@@ -1868,97 +2034,6 @@
}
},
initiateTaskConfirmationClick(name) {
this.timeName = name
this.listTitle = this.$t('taskConfirmationDeadline')
if (this.selectedRowKeys && this.selectedRowKeys.length > 0) {
let selectedRowKeys = JSON.parse(JSON.stringify(this.selectedRowKeys))
let isTrue = true
this.TaskSuccessList = []
this.TaskWarningList = []
let dataList = []
for (let i = 0; i < this.dataSource.length; i++) {
for (let j = 0; j < selectedRowKeys.length; j++) {
if (this.dataSource[i].id == selectedRowKeys[j]) {
dataList.push(this.dataSource[i])
}
}
}
for (let i = 0; i < dataList.length; i++) {
if ((dataList[i].taskAffirmStatus == 'Not started' || dataList[i].taskAffirmStatus == 'Rejected') &&
dataList[i].inventoryAffirmStatus == 'Accepted') {
if (dataList[i].engineeringInterfacePerson) {
if (dataList[i].verifyDeliverableType) {
if (dataList[i].verifyDueDate && dataList[i].verifyDutyId
&& dataList[i].verifyInitiatorId) {
} else {
this.TaskWarningList.push(
< div > { dataList[i].serialNumber + this.$t('pleaseConformityVerification') } < /div>)
continue
// isTrue = false
// this.$message.warning(this.dataSource[i].serialNumber + ',' + this.$t('pleaseConformityVerification'))
// return
}
}
if (dataList[i].prehomoDeliverableType) {
if (dataList[i].prehomoDueDate && dataList[i].prehomoDutyId
&& dataList[i].prehomoInitiatorId) {
} else {
this.TaskWarningList.push(
< div > { dataList[i].serialNumber + this.$t('pleaseConfirmedByPrehomo') } < /div>)
continue
// isTrue = false
// this.$message.warning(this.dataSource[i].serialNumber + ',' + this.$t('pleaseConfirmedByPrehomo'))
// return
}
}
if (dataList[i].designDeliverableType) {
if (dataList[i].designDueDate && dataList[i].designDutyId
&& dataList[i].designInitiatorId) {
} else {
this.TaskWarningList.push(
< div > { dataList[i].serialNumber + this.$t('pleaseDesignConformityConfirmation') } < /div>)
continue
// isTrue = false
// this.$message.warning(this.dataSource[i].serialNumber + ',' + this.$t('pleaseDesignConformityConfirmation'))
// return
}
}
this.TaskSuccessList.push(dataList[i])
} else {
this.TaskWarningList.push( < div > { dataList[i].serialNumber + this.$t('theProjectContactEmpty') } < /div>)
// isTrue = false
// this.$message.warning(this.dataSource[i].serialNumber + ',' + this.$t('theProjectContactEmpty'))
// return
}
} else {
this.TaskWarningList.push(
< div > { dataList[i].serialNumber + this.$t('PleaseTaskConfirmationRejected') } < /div>)
// isTrue = false
// this.$message.warning(this.dataSource[i].serialNumber + ',' + this.$t('PleaseTaskConfirmationRejected'))
// return
}
}
if (this.TaskSuccessList && this.TaskSuccessList.length > 0) {
this.visible = true
this.formInline = {}
} else {
let that = this
this.$warning({
content: (
< div >
{ that.TaskWarningList }
< /div>
)
})
}
} else {
this.$message.warning(this.$t('selectLeastOne'))
}
},
handleOk() {
this.$refs.ruleForm.validate(valid => {
if (valid) {
@@ -2198,7 +2273,7 @@
if (dataList[i].verifyFlowStatus == 'List to be checked') {
if (dataList[i].verifyDeliverableType && dataList[i].verifyDutyId && dataList[i].verifyDueDate) {
this.requestsNum++
_this.startProcess(dataList[i], 2, this.requestsNum)
_this.startProcess(dataList[i], 4, this.requestsNum)
}
} else {
_this.detailedWarningList.push(
@@ -2283,31 +2358,6 @@
this.formInline[item.db_field_name] = this.formInline[item.db_field_name] ? moment(this.formInline[item.db_field_name]).format('YYYY-MM-DD') : ''
},
pdfPreview(fileQuery) {
let fileName = fileQuery.fileName
let index1 = fileName.lastIndexOf('.')
let index2 = fileName.length
let fileSuffix = fileName.substring(index1, index2)
if (fileSuffix == '.pdf') {
window.open('/pdf/web/viewer.html?file=' + encodeURIComponent('/jero-boot/sys/common/pdf/viewFile?id=' + fileQuery.id + '&userName=' + this.userInfo().username))
} else if (fileSuffix == '.docx' || fileSuffix == '.doc') {
let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + fileQuery.id + fileSuffix)
window.open(url, '_blank')
} else if (fileSuffix == '.xlsx' || fileSuffix == '.xls') {
let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + fileQuery.id + fileSuffix)
window.open(url, '_blank')
} else if (fileSuffix == '.png' || fileSuffix == '.jpeg' || fileSuffix == '.gif' || fileSuffix == '.jpg') {
let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadImgUrl + '/' + fileQuery.id + fileSuffix)
window.open(url, '_blank')
} else {
downloadFile('/sys/common/downLoadFile', fileQuery.fileName, { id: fileQuery.id })
}
},
download(item) {
downloadFile('/sys/common/downLoadFile', item.fileName, { id: item.id, userName: this.userInfo().username })
},
clickButtonToUpload(item, num) {
if (num == 1) {
this.isResultReported = true
@@ -2351,6 +2401,7 @@
}).then((res) => {
if (res.success) {
_this.$message.success(_this.$t('OperationSuccessful'))
this.selectedRowKeys = []
_this.getList()
} else {
_this.$message.warning(_this.$t('operationFailed'))
@@ -213,6 +213,9 @@
if (row.taskId.length > 30) {
row.taskId = ''
}
if (row.taskDefinitionKey == 'fqlc'){
row.taskId = ''
}
query = {
router: row.router,
taskIds: row.taskId,
@@ -272,16 +275,15 @@
primaryKeyId: row.primaryKeyId,
PersonChargeFeedback: row.personChargeFeedback
}
let newUrl = this.$router.resolve({
path: '/taskListProcess',
query: query
})
window.open(newUrl.href, '_blank')
this.$refs.designComplianceRef.getList(JSON.parse(JSON.stringify(query)), this.$t('designComplianceReview'))
} else if (row.flowType == '4') {
row.taskId = row.taskId + ''
if (row.taskId.length > 30) {
row.taskId = ''
}
if (row.taskDefinitionKey == 'fqlc'){
row.taskId = ''
}
query = {
router: row.router,
taskIds: row.taskId,
@@ -306,11 +308,7 @@
primaryKeyId: row.primaryKeyId,
PersonChargeFeedback: row.personChargeFeedback
}
let newUrl = this.$router.resolve({
path: '/taskListProcess',
query: query
})
window.open(newUrl.href, '_blank')
this.$refs.designComplianceRef.getList(JSON.parse(JSON.stringify(query)), this.$t('verificationComplianceReview'))
}
},
searchQuery(value) {
@@ -109,7 +109,7 @@
},
{
title: this.$t('Tasknode'),
dataIndex: 'taskDefinitionKeyName',
dataIndex: 'name',
align: 'left',
width: 180,
ellipsis: true
@@ -160,7 +160,7 @@
{
title: this.$t('areaOfResponsibility'),
align: 'left',
dataIndex: '',
dataIndex: 'dutyTerritoryName',
ellipsis: true,
width: 120
},
@@ -204,7 +204,7 @@
{
title: this.$t('areaOfResponsibility'),
align: 'left',
dataIndex: '',
dataIndex: 'dutyTerritoryName',
ellipsis: true,
width: 120
},
@@ -178,6 +178,7 @@
})
},
getList(row, title) {
console.log(row)
this.queryData = row
this.queryData.isDisplay = JSON.parse(this.queryData.isDisplay)
this.loading = true
@@ -208,6 +208,9 @@
if (row.taskId.length > 30) {
row.taskId = ''
}
if (row.taskDefinitionKey == 'fqlc'){
row.taskId = ''
}
query = {
router: row.router,
taskIds:row.taskId,
@@ -272,6 +275,9 @@
if (row.taskId.length > 30) {
row.taskId = ''
}
if (row.taskDefinitionKey == 'fqlc'){
row.taskId = ''
}
query = {
router: row.router,
taskIds: row.taskId,
@@ -296,11 +302,7 @@
primaryKeyId: row.primaryKeyId,
PersonChargeFeedback: row.personChargeFeedback
}
let newUrl = this.$router.resolve({
path: '/taskListProcess',
query: query
})
window.open(newUrl.href, '_blank')
this.$refs.designComplianceRef.getList(JSON.parse(JSON.stringify(query)), this.$t('verificationComplianceReview'))
}
},
searchQuery(value) {
@@ -4,7 +4,7 @@
<div class="header-text">
{{query.TaskKey == 'zrrqr' || query.TaskKey == 'dezrrqr' || query.TaskKey == 'zrrtjjfw' || $route.query.TaskKey
== 'dezrrtjjfw'
? $t('personLiableConfirm'):$t('fillInProjectDelivery')}}
? $t('personLiableConfirm'):$t('sponsorReview')}}
</div>
</div>
<a-form-model :model="formInline" class="formAdd" :rules="rules" ref="ruleForm">