diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/feishu/enums/TemplateInfoEnum2.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/feishu/enums/TemplateInfoEnum2.java index 08ffc61a2..974aea868 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/feishu/enums/TemplateInfoEnum2.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/feishu/enums/TemplateInfoEnum2.java @@ -18,7 +18,7 @@ public enum TemplateInfoEnum2 { CERTIFICATION_MESSAGE10("认证工程师发起流程,责任人收到消息","ctp_AAuePL6rUK1L"), CERTIFICATION_MESSAGE11("责任人拒绝,认证工程师收到消息","ctp_AAu2ZrSEiB1V"), CERTIFICATION_MESSAGE12("责任人接受,认证工程师收到消息","ctp_AAuePL6r3B0I"), - CERTIFICATION_MESSAGE13("studio修改认证工程师,被修改人收到消息",""), + CERTIFICATION_MESSAGE13("studio修改认证工程师,被修改人收到消息","ctp_AAuLRr2QhG9J"), CERTIFICATION_MESSAGE14("studio修改符合性截止时间,认证工程师收到消息","ctp_AAuePL6r3XqN"), CERTIFICATION_MESSAGE15("认证工程师修改责任人,被修改人收到消息","ctp_AAu2ZrSE1z3f"), CERTIFICATION_MESSAGE16("认证工程师催办,责任人收到消息","ctp_AAuPfn0M0H6i"), @@ -41,6 +41,32 @@ public enum TemplateInfoEnum2 { REGULATION_LIST_RELEASE2("法规清单发布-公用消息-绿色","ctp_AAuPKJ9Cj9w5"), REGULATION_LIST_RELEASE3("法规清单发布-公用消息-红色","ctp_AAu2lBIgaB79"), REGULATION_LIST_RELEASE4("法规清单发布-公用消息-黄色","ctp_AAuPh3LJWg1x"), + + /** + * 法规任务确认消息 + */ + REGULATION_TASK_CONFIRMATION1("法规任务确认-公用消息-绿色-无流程类型","ctp_AAuLRr2QIbMb"), + REGULATION_TASK_CONFIRMATION2("法规任务确认-公用消息-红色-无流程类型","ctp_AAuL6mDxffmu"), + REGULATION_TASK_CONFIRMATION3("法规任务确认-公用消息-黄色-无流程类型","ctp_AAuLRr2Qzyj0"), + REGULATION_TASK_CONFIRMATION4("法规任务确认-公用消息-绿色-有流程类型","ctp_AAuL6mDxf8l1"), + REGULATION_TASK_CONFIRMATION5("法规任务确认-公用消息-红色-有流程类型","ctp_AAuPWTSU2Fg2"), + REGULATION_TASK_CONFIRMATION6("法规任务确认-公用消息-黄色-有流程类型","ctp_AAuLRr2Qzkbo"), + + + /** + * 设计符合性流程 + */ + DESIGN_COMPLIANCE_CONFIRMATION1("设计符合性流程-公用消息-绿色","ctp_AAuPIdaoms57"), + DESIGN_COMPLIANCE_CONFIRMATION2("设计符合性流程-公用消息-红色","ctp_AAuLRr2QX8xb"), + DESIGN_COMPLIANCE_CONFIRMATION3("设计符合性流程-公用消息-黄色","ctp_AAuLdvF0lUtu"), + + /** + * 验证符合性流程 + */ + VALIDATION_COMPLIANCE_CONFIRMATION1("验证符合性流程-公用消息-绿色","ctp_AAuLdvF0lS41"), + VALIDATION_COMPLIANCE_CONFIRMATION2("验证符合性流程-公用消息-红色","ctp_AAu2lBI6MV0i"), + VALIDATION_COMPLIANCE_CONFIRMATION3("验证符合性流程-公用消息-黄色","ctp_AAupcD3RBbUV"), + ; String name; diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/controller/OtaBaCxListController.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/controller/OtaBaCxListController.java index b9956d7ec..7070302ae 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/controller/OtaBaCxListController.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/controller/OtaBaCxListController.java @@ -1,28 +1,29 @@ package com.jero.modules.ota.controller; -import java.util.Arrays; -import java.util.List; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import com.jero.common.api.vo.Result; -import com.jero.common.system.query.QueryGenerator; -import com.jero.modules.ota.entity.OtaBaCxList; -import com.jero.modules.ota.service.IOtaBaCxListService; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import lombok.extern.slf4j.Slf4j; +import com.jero.common.api.vo.Result; +import com.jero.common.aspect.annotation.AutoLog; import com.jero.common.system.base.controller.JeroController; +import com.jero.common.system.query.QueryGenerator; +import com.jero.modules.ota.entity.OtaBaCxList; +import com.jero.modules.ota.service.IOtaBaCxListService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; import org.springframework.web.servlet.ModelAndView; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import com.jero.common.aspect.annotation.AutoLog; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.util.Arrays; +import java.util.List; - /** +/** * @Description: 车型及功能备案列表 * @Author: jero-boot * @Date: 2023-03-17 @@ -167,4 +168,17 @@ public class OtaBaCxListController extends JeroController batchRecord(@RequestBody List recordList) { + otaBaCxListService.batchRecord(recordList); + return Result.OK("备案维护成功!"); + } + + } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/controller/OtaBaSjListController.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/controller/OtaBaSjListController.java index 5e256a3c2..30bb4ba6b 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/controller/OtaBaSjListController.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/controller/OtaBaSjListController.java @@ -1,28 +1,29 @@ package com.jero.modules.ota.controller; -import java.util.Arrays; -import java.util.List; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import com.jero.common.api.vo.Result; -import com.jero.common.system.query.QueryGenerator; -import com.jero.modules.ota.entity.OtaBaSjList; -import com.jero.modules.ota.service.IOtaBaSjListService; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import lombok.extern.slf4j.Slf4j; +import com.jero.common.api.vo.Result; +import com.jero.common.aspect.annotation.AutoLog; import com.jero.common.system.base.controller.JeroController; +import com.jero.common.system.query.QueryGenerator; +import com.jero.modules.ota.entity.OtaBaSjList; +import com.jero.modules.ota.service.IOtaBaSjListService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; import org.springframework.web.servlet.ModelAndView; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import com.jero.common.aspect.annotation.AutoLog; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.util.Arrays; +import java.util.List; - /** +/** * @Description: 升级备案-升级活动备案列表 * @Author: jero-boot * @Date: 2023-03-17 @@ -167,4 +168,16 @@ public class OtaBaSjListController extends JeroController batchRecord(@RequestBody List recordList) { + otaBaSjListService.batchRecord(recordList); + return Result.OK("备案维护成功!"); + } + } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/IOtaBaCxListService.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/IOtaBaCxListService.java index c76057203..45dbe6352 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/IOtaBaCxListService.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/IOtaBaCxListService.java @@ -1,7 +1,8 @@ package com.jero.modules.ota.service; -import com.jero.modules.ota.entity.OtaBaCxList; import com.baomidou.mybatisplus.extension.service.IService; +import com.jero.modules.ota.entity.OtaBaCxList; + import java.util.List; /** @@ -58,4 +59,10 @@ public interface IOtaBaCxListService extends IService { * @return */ List queryList(); + + /** + * 备案维护 + * + */ + void batchRecord(List recordList); } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/IOtaBaSjListService.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/IOtaBaSjListService.java index 9644621c9..8d99a3778 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/IOtaBaSjListService.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/IOtaBaSjListService.java @@ -1,7 +1,8 @@ package com.jero.modules.ota.service; -import com.jero.modules.ota.entity.OtaBaSjList; import com.baomidou.mybatisplus.extension.service.IService; +import com.jero.modules.ota.entity.OtaBaSjList; + import java.util.List; /** @@ -58,4 +59,10 @@ public interface IOtaBaSjListService extends IService { * @return */ List queryList(); + + /** + * 备案维护 + * + */ + void batchRecord(List recordList); } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/impl/OtaBaCxListServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/impl/OtaBaCxListServiceImpl.java index 7a5ced897..ca1027c8c 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/impl/OtaBaCxListServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/impl/OtaBaCxListServiceImpl.java @@ -1,29 +1,40 @@ package com.jero.modules.ota.service.impl; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.jero.common.exception.JeroBootException; import com.jero.modules.ota.entity.OtaBaCxList; +import com.jero.modules.ota.entity.OtaBaCxLsjl; import com.jero.modules.ota.mapper.OtaBaCxListMapper; import com.jero.modules.ota.service.IOtaBaCxListService; +import com.jero.modules.ota.service.IOtaBaCxLsjlService; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import java.util.List; + +import java.text.SimpleDateFormat; import java.util.Date; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import java.util.List; /** * @Description: 车型及功能备案列表 * @Author: jero-boot - * @Date: 2023-03-17 + * @Date: 2023-03-17 * @Version: V1.0 */ @Service public class OtaBaCxListServiceImpl extends ServiceImpl implements IOtaBaCxListService { - /** - * 保存 - * - * @param otaBaCxList - * @return - */ - @Override + private static SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + + @Autowired + private IOtaBaCxLsjlService otaBaCxLsjlService; + + /** + * 保存 + * + * @param otaBaCxList + * @return + */ + @Override public void add(OtaBaCxList otaBaCxList) { Date now = new Date(); otaBaCxList.setCreateTime(now); @@ -31,59 +42,85 @@ public class OtaBaCxListServiceImpl extends ServiceImpl ids) { removeByIds(ids); } - /** - * 通过id查询 - * - * @param id - * @return - */ - @Override + /** + * 通过id查询 + * + * @param id + * @return + */ + @Override public OtaBaCxList queryById(String id) { return getById(id); } /** - * 列表查询 - * - * @return - */ - @Override + * 列表查询 + * + * @return + */ + @Override public List queryList() { return list(); } + + /** + * 备案维护 + */ + @Override + public void batchRecord(List recordList) { + try { + if (null != recordList && recordList.size() > 0) { + for (OtaBaCxList obc : recordList) { + String id = obc.getId(); + OtaBaCxList otaBaCxList = this.queryById(id); + otaBaCxList.setBatjsj(obc.getBatjsj()); + otaBaCxList.setBz(obc.getBz()); + this.saveOrUpdate(otaBaCxList); + //添加历史记录数据 + OtaBaCxLsjl lsjl = new OtaBaCxLsjl(); + lsjl.setOtaId(id); + lsjl.setSjzt(obc.getBz()); + otaBaCxLsjlService.add(lsjl); + } + } + } catch (Exception ex) { + ex.printStackTrace(); + throw new JeroBootException(ex.getMessage()); + } + } } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/impl/OtaBaSjListServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/impl/OtaBaSjListServiceImpl.java index cbbe2eef5..808f867cd 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/impl/OtaBaSjListServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/impl/OtaBaSjListServiceImpl.java @@ -1,29 +1,40 @@ package com.jero.modules.ota.service.impl; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.jero.common.exception.JeroBootException; import com.jero.modules.ota.entity.OtaBaSjList; +import com.jero.modules.ota.entity.OtaBaSjLsjl; import com.jero.modules.ota.mapper.OtaBaSjListMapper; import com.jero.modules.ota.service.IOtaBaSjListService; +import com.jero.modules.ota.service.IOtaBaSjLsjlService; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import java.util.List; + +import java.text.SimpleDateFormat; import java.util.Date; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import java.util.List; /** * @Description: 升级备案-升级活动备案列表 * @Author: jero-boot - * @Date: 2023-03-17 + * @Date: 2023-03-17 * @Version: V1.0 */ @Service public class OtaBaSjListServiceImpl extends ServiceImpl implements IOtaBaSjListService { - /** - * 保存 - * - * @param otaBaSjList - * @return - */ - @Override + private static SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + + @Autowired + private IOtaBaSjLsjlService otaBaSjLsjlService; + + /** + * 保存 + * + * @param otaBaSjList + * @return + */ + @Override public void add(OtaBaSjList otaBaSjList) { Date now = new Date(); otaBaSjList.setCreateTime(now); @@ -31,59 +42,85 @@ public class OtaBaSjListServiceImpl extends ServiceImpl ids) { removeByIds(ids); } - /** - * 通过id查询 - * - * @param id - * @return - */ - @Override + /** + * 通过id查询 + * + * @param id + * @return + */ + @Override public OtaBaSjList queryById(String id) { return getById(id); } /** - * 列表查询 - * - * @return - */ - @Override + * 列表查询 + * + * @return + */ + @Override public List queryList() { return list(); } + + /** + * 备案维护 + */ + @Override + public void batchRecord(List recordList) { + try { + if (null != recordList && recordList.size() > 0) { + for (OtaBaSjList obs : recordList) { + String id = obs.getId(); + OtaBaSjList otaBaSjList = this.queryById(id); + otaBaSjList.setBatjsj(obs.getBatjsj()); + otaBaSjList.setBz(obs.getBz()); + this.saveOrUpdate(otaBaSjList); + //添加历史记录数据 + OtaBaSjLsjl lsjl = new OtaBaSjLsjl(); + lsjl.setOtaId(id); + lsjl.setSjzt(obs.getBz()); + otaBaSjLsjlService.add(lsjl); + } + } + } catch (Exception ex) { + ex.printStackTrace(); + throw new JeroBootException(ex.getMessage()); + } + } } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/job/CertificationInventoryJob.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/job/CertificationInventoryJob.java index 2875f1db0..5e157da83 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/job/CertificationInventoryJob.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/job/CertificationInventoryJob.java @@ -254,13 +254,13 @@ public class CertificationInventoryJob implements Job { Calendar sevenCalendar=new GregorianCalendar(); sevenCalendar.setTime(new Date()); sevenCalendar.add(Calendar.DATE,7); - Date sevenDays = sevenCalendar.getTime(); //fourteen + Date sevenDays = sevenCalendar.getTime(); //获取后十四天后的时间 Calendar fourteenCalendar=new GregorianCalendar(); fourteenCalendar.setTime(new Date()); fourteenCalendar.add(Calendar.DATE,14); - Date fourteenDays = fourteenCalendar.getTime(); //fourteen + Date fourteenDays = fourteenCalendar.getTime(); String threeDaysStr = sdf.format(threeDays); String sevenDaysStr = sdf.format(sevenDays); diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/job/designComplianceJob.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/job/designComplianceJob.java index ab755ed00..fb8f2dda9 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/job/designComplianceJob.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/job/designComplianceJob.java @@ -4,12 +4,15 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.jero.common.constant.enums.MessageType2Enum; import com.jero.common.constant.enums.MessageTypeEnum; import com.jero.common.constant.enums.MsgColorEnum; +import com.jero.common.util.DateUtils; import com.jero.modules.document.entity.BussDocumentLibraryEO; import com.jero.modules.document.service.IBussDocumentLibraryEOService; +import com.jero.modules.feishu.enums.TemplateInfoEnum2; import com.jero.modules.feishu.service.IFeishuService; import com.jero.modules.feishu.vo.FeishuMsg2Vo; import com.jero.modules.feishu.vo.FeishuMsgVo; import com.jero.modules.project.entity.*; +import com.jero.modules.project.enums.ComplianceFlowStatusEnum; import com.jero.modules.project.enums.DesignComplianceStatusEnum; import com.jero.modules.project.enums.JumpLinkEnum; import com.jero.modules.project.enums.SendMsgFlagEnum; @@ -68,12 +71,112 @@ public class designComplianceJob implements Job { private ISysUserService sysUserService; @Autowired private IFeishuService feishuService; + private static SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); @Override public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException { log.info("设计符合性确认流程,定时任务开启 ====================================================="); + + // 查询出 任务待确认、结果待提交的数据 + List designFlowStatusList = new ArrayList<>(); + designFlowStatusList.add(ComplianceFlowStatusEnum.TASK_TO_BE_CONFIRMED.getValue()); + designFlowStatusList.add(ComplianceFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue()); + QueryWrapper lawsInventoryEOQueryWrap = new QueryWrapper<>(); + lawsInventoryEOQueryWrap.lambda().in(ProjectLawsInventoryEO::getDesignFlowStatus,designFlowStatusList); + List projectLawsInventoryEOList = this.projectLawsInventoryEOService.list(lawsInventoryEOQueryWrap); + if(CollectionUtils.isNotEmpty(projectLawsInventoryEOList)){ + // 根据项目进行分组 + Map> lawsInventoryByProjectLibraryIdGroupMap = projectLawsInventoryEOList.stream().collect(Collectors.groupingBy(ProjectLawsInventoryEO::getProjectLibraryId)); + for (Map.Entry> lawsInventoryByProjectLibraryIdGroup : lawsInventoryByProjectLibraryIdGroupMap.entrySet()) { + String projectLibraryId = lawsInventoryByProjectLibraryIdGroup.getKey(); + List lawsInventoryListByProjectLibraryId = lawsInventoryByProjectLibraryIdGroup.getValue(); + if(StringUtils.isEmpty(projectLibraryId) || CollectionUtils.isEmpty(lawsInventoryListByProjectLibraryId)){ + continue; + } + + // 设计符合性 + Map> lawsInventoryByDesignDutyIdGroupMap = lawsInventoryListByProjectLibraryId.stream().collect(Collectors.groupingBy(ProjectLawsInventoryEO::getDesignDutyId)); + for (Map.Entry> lawsInventoryByDesignDutyIdGroup : lawsInventoryByDesignDutyIdGroupMap.entrySet()) { + String designDutyId = lawsInventoryByDesignDutyIdGroup.getKey(); + List designDutyDataList = lawsInventoryByDesignDutyIdGroup.getValue(); + if(StringUtils.isEmpty(designDutyId) || CollectionUtils.isEmpty(designDutyDataList)){ + continue; + } + + List userIdList = Arrays.asList(designDutyId.split(",")); + + Map sendMsgDataListMap = this.disposeSendMsgDataList(designDutyDataList); + + // 三条后结束的 + List threeDaysList = (List) sendMsgDataListMap.get("threeDaysList"); + if(CollectionUtils.isNotEmpty(threeDaysList)){ + Date designDueDate = threeDaysList.get(0).getDesignDueDate(); + String endTime = ""; + if(designDueDate != null){ + endTime = DateUtils.formatDate(designDueDate); + } + String serialNumbers = threeDaysList.stream().map(ProjectLawsInventoryEO::getSerialNumber).distinct().collect(Collectors.joining(",")); + // 给法规工程师发消息 + Map 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); + params.put("flowTypeCn","设计符合性流程"); + params.put("flowTypeEn","Design Compliance Process"); + this.projectLawsInventoryEOService.sendMessageByTemplateId(TemplateInfoEnum2.REGULATION_TASK_CONFIRMATION4.getValue(),params); + } + // 当天结束的 + List currentDaysList = (List) sendMsgDataListMap.get("currentDaysList"); + if(CollectionUtils.isNotEmpty(currentDaysList)){ + Date designDueDate = currentDaysList.get(0).getDesignDueDate(); + String endTime = ""; + if(designDueDate != null){ + endTime = DateUtils.formatDate(designDueDate); + } + String serialNumbers = currentDaysList.stream().map(ProjectLawsInventoryEO::getSerialNumber).distinct().collect(Collectors.joining(",")); + // 给法规工程师发消息 + Map 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); + params.put("flowTypeCn","设计符合性流程"); + params.put("flowTypeEn","Design Compliance Process"); + this.projectLawsInventoryEOService.sendMessageByTemplateId(TemplateInfoEnum2.REGULATION_TASK_CONFIRMATION4.getValue(),params); + } + // 逾期的 + List overdueList = (List) sendMsgDataListMap.get("overdueList"); + if(CollectionUtils.isNotEmpty(overdueList)){ + Date designDueDate = overdueList.get(0).getDesignDueDate(); + String endTime = ""; + if(designDueDate != null){ + endTime = DateUtils.formatDate(designDueDate); + } + String serialNumbers = overdueList.stream().map(ProjectLawsInventoryEO::getSerialNumber).distinct().collect(Collectors.joining(",")); + // 给法规工程师发消息 + Map 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); + params.put("flowTypeCn","设计符合性流程"); + params.put("flowTypeEn","Design Compliance Process"); + this.projectLawsInventoryEOService.sendMessageByTemplateId(TemplateInfoEnum2.REGULATION_TASK_CONFIRMATION5.getValue(),params); + } + } + } + + } + //查询出已经启动了设计符合性流程的数据。 并且流程没有结束。 - QueryWrapper queryProjectTaskInventoryWrapper = new QueryWrapper<>(); + /*QueryWrapper queryProjectTaskInventoryWrapper = new QueryWrapper<>(); queryProjectTaskInventoryWrapper.isNotNull("design_p_id"); List status = new ArrayList<>(); status.add(DesignComplianceStatusEnum.TO_SUBMIT.getValue()); @@ -378,7 +481,76 @@ public class designComplianceJob implements Job { } } } - } + }*/ log.info("设计符合性确认流程,定时任务结束 ====================================================="); } + + private Map disposeSendMsgDataList(List projectLawsInventoryEOList) { + Map result = new HashMap<>(); + Date currentDate = new Date(); + String currentDateStr = sdf.format(currentDate); + + //获取十四天后的时间 + Calendar fourteenCalendar=new GregorianCalendar(); + fourteenCalendar.setTime(new Date()); + fourteenCalendar.add(Calendar.DATE,14); + Date fourteenDays = fourteenCalendar.getTime(); + String fourteenDaysStr = sdf.format(fourteenDays); + + //获取七天后的时间 + Calendar sevenCalendar=new GregorianCalendar(); + sevenCalendar.setTime(new Date()); + sevenCalendar.add(Calendar.DATE,7); + Date sevenDays = sevenCalendar.getTime(); + String sevenDaysStr = sdf.format(sevenDays); + + // 十四天后结束的 + List fourteenDaysList = projectLawsInventoryEOList.stream().filter(data -> { + boolean flag = false; + if(data.getDesignDueDate() != null){ + if (StringUtils.equals(fourteenDaysStr, sdf.format(data.getDesignDueDate()))) { + flag = true; + } + } + return flag; + }).collect(Collectors.toList()); + + // 七天后结束的 + List threeDaysList = projectLawsInventoryEOList.stream().filter(data -> { + boolean flag = false; + if(data.getDesignDueDate() != null){ + if (StringUtils.equals(sevenDaysStr, sdf.format(data.getDesignDueDate()))) { + flag = true; + } + } + return flag; + }).collect(Collectors.toList()); + + // 当天结束的 + List currentDaysList = projectLawsInventoryEOList.stream().filter(data -> { + boolean flag = false; + //结束日期是当前日期 + if(data.getDesignDueDate() != null){ + if (StringUtils.equals(currentDateStr, sdf.format(data.getDesignDueDate()))) { + flag = true; + } + } + return flag; + }).collect(Collectors.toList()); + + // 逾期的 + List overdueList = projectLawsInventoryEOList.stream().filter(data -> { + // 只要早于当前日期都算逾期 不算当天。 + boolean flag = false; + if(data.getDesignDueDate() != null){ + flag = (data.getDesignDueDate().before(currentDate) && !StringUtils.equals(currentDateStr, sdf.format(data.getDesignDueDate()))); + } + return flag; + }).collect(Collectors.toList()); + + result.put("currentDaysList",currentDaysList); + result.put("threeDaysList",threeDaysList); + result.put("overdueList",overdueList); + return result; + } } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectLawsInventoryEOServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectLawsInventoryEOServiceImpl.java index 043f6a662..bb1c9f47f 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectLawsInventoryEOServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectLawsInventoryEOServiceImpl.java @@ -477,6 +477,9 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl params = new HashMap<>(); + params.put("contentCn","您好,您以下任务已被发起人撤回。"); + params.put("contentEn","Hello! Your task has been withdrawn by the initiator."); + params.put("projectLibraryId", projectLawsInventoryEO.getProjectLibraryId()); + params.put("endTime",endTime); + params.put("userIdList",Arrays.asList(regulationOwnerId.split(","))); + params.put("serialNumbers",projectLawsInventoryOld.getSerialNumber()); + this.sendMessageByTemplateId(TemplateInfoEnum2.REGULATION_TASK_CONFIRMATION1.getValue(),params); + } + } + if((projectLawsInventoryOld.getDesignDueDate() != null && projectLawsInventoryEO.getDesignDueDate() != null) && toBeCheckedFlag){ + if(!projectLawsInventoryOld.getDesignDueDate().equals(projectLawsInventoryEO.getDesignDueDate())){ + String endTime = ""; + if(projectLawsInventoryOld.getInventoryAffirmDueDate() != null){ + endTime = DateUtils.formatDate(projectLawsInventoryOld.getInventoryAffirmDueDate()); + } + + String regulationOwnerId = projectLawsInventoryOld.getRegulationOwnerId(); + // 给法规工程师发消息 + Map params = new HashMap<>(); + params.put("contentCn","您好,以下符合性任务的截止时间已被发起人修改。"); + params.put("contentEn","Hello! The due date of the compliance task has been modified by the initiator."); + params.put("projectLibraryId", projectLawsInventoryEO.getProjectLibraryId()); + params.put("endTime",endTime); + params.put("userIdList",Arrays.asList(regulationOwnerId.split(","))); + params.put("serialNumbers",projectLawsInventoryOld.getSerialNumber()); + this.sendMessageByTemplateId(TemplateInfoEnum2.REGULATION_TASK_CONFIRMATION1.getValue(),params); + } + } + if((projectLawsInventoryOld.getVerifyDueDate() != null && projectLawsInventoryEO.getVerifyDueDate() != null) && toBeCheckedFlag){ + if(!projectLawsInventoryOld.getVerifyDueDate().equals(projectLawsInventoryEO.getVerifyDueDate())){ + String endTime = ""; + if(projectLawsInventoryOld.getInventoryAffirmDueDate() != null){ + endTime = DateUtils.formatDate(projectLawsInventoryOld.getInventoryAffirmDueDate()); + } + + String regulationOwnerId = projectLawsInventoryOld.getRegulationOwnerId(); + // 给法规工程师发消息 + Map params = new HashMap<>(); + params.put("contentCn","您好,以下符合性任务的截止时间已被发起人修改。"); + params.put("contentEn","Hello! The due date of the compliance task has been modified by the initiator."); + params.put("projectLibraryId", projectLawsInventoryEO.getProjectLibraryId()); + params.put("endTime",endTime); + params.put("userIdList",Arrays.asList(regulationOwnerId.split(","))); + params.put("serialNumbers",projectLawsInventoryOld.getSerialNumber()); + this.sendMessageByTemplateId(TemplateInfoEnum2.REGULATION_TASK_CONFIRMATION1.getValue(),params); + } + } + + // 设计符合性 任务待确认消息 标识 + boolean toBeConfirmedDesignFlag = ( + StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(),ComplianceFlowStatusEnum.TASK_TO_BE_CONFIRMED.getValue()) + || StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(),ComplianceFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue()) + ); + + if((projectLawsInventoryOld.getDesignDutyId() != null && projectLawsInventoryEO.getDesignDutyId() != null) && toBeConfirmedDesignFlag){ + if(!projectLawsInventoryOld.getDesignDutyId().equals(projectLawsInventoryEO.getDesignDutyId())){ + String endTime = ""; + if(projectLawsInventoryOld.getDesignDueDate() != null){ + endTime = DateUtils.formatDate(projectLawsInventoryOld.getDesignDueDate()); + } + + String regulationOwnerId = projectLawsInventoryOld.getRegulationOwnerId(); + // 给法规工程师发消息 + Map params = new HashMap<>(); + params.put("contentCn","您好,您以下任务已被发起人撤回。"); + params.put("contentEn","Hello! Your task has been withdrawn by the initiator."); + params.put("projectLibraryId", projectLawsInventoryEO.getProjectLibraryId()); + params.put("endTime",endTime); + params.put("userIdList",Arrays.asList(projectLawsInventoryOld.getDesignDutyId().split(","))); + params.put("serialNumbers",projectLawsInventoryOld.getSerialNumber()); + this.sendMessageByTemplateId(TemplateInfoEnum2.REGULATION_TASK_CONFIRMATION1.getValue(),params); + } + } + + // 验证符合性 任务待确认消息 标识 + boolean toBeConfirmedVerifyFlag = ( + StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(),ComplianceFlowStatusEnum.TASK_TO_BE_CONFIRMED.getValue()) + || StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(),ComplianceFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue()) + ); + if((projectLawsInventoryOld.getVerifyDutyId() != null && projectLawsInventoryEO.getVerifyDutyId() != null) && toBeConfirmedVerifyFlag){ + if(!projectLawsInventoryOld.getVerifyDutyId().equals(projectLawsInventoryEO.getVerifyDutyId())){ + String endTime = ""; + if(projectLawsInventoryOld.getVerifyDueDate() != null){ + endTime = DateUtils.formatDate(projectLawsInventoryOld.getVerifyDueDate()); + } + + String regulationOwnerId = projectLawsInventoryOld.getRegulationOwnerId(); + // 给法规工程师发消息 + Map params = new HashMap<>(); + params.put("contentCn","您好,您以下任务已被发起人撤回。"); + params.put("contentEn","Hello! Your task has been withdrawn by the initiator."); + params.put("projectLibraryId", projectLawsInventoryEO.getProjectLibraryId()); + params.put("endTime",endTime); + params.put("userIdList",Arrays.asList(projectLawsInventoryOld.getDesignDutyId().split(","))); + params.put("serialNumbers",projectLawsInventoryOld.getSerialNumber()); + this.sendMessageByTemplateId(TemplateInfoEnum2.REGULATION_TASK_CONFIRMATION1.getValue(),params); + } + } + } + private void setProjectLawsInventoryPermission(String userId, String projectId,String lawsInventoryId,Date now, List adds, String belong) { QueryWrapper del = new QueryWrapper<>(); del.eq("project_id", projectId) @@ -1676,6 +1800,28 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl processInfoDetailEOQueryWrapper = new QueryWrapper<>(); + processInfoDetailEOQueryWrapper.lambda().eq(ProcessInfoDetailEO::getProjectLawsInventoryId,projectLawsInventoryEO.getId()); + processInfoDetailEOQueryWrapper.lambda().eq(ProcessInfoDetailEO::getFlowType,FlowTypeEnum.YZFHXSCLC.getValue()); + List processInfoDetailEOS = this.processInfoDetailEOService.list(processInfoDetailEOQueryWrapper); + if(CollectionUtils.isNotEmpty(processInfoDetailEOS)){ + projectLawsInventoryEO.setVerifyPId(processInfoDetailEOS.get(0).getActiProcInstId()); + } + } + if(!StringUtils.equals(projectLawsInventoryEO.getDesignFlowStatus(),ComplianceFlowStatusEnum.LIST_TO_BE_RELEASED.getValue()) + ||!StringUtils.equals(projectLawsInventoryEO.getDesignFlowStatus(),ComplianceFlowStatusEnum.LIST_TO_BE_CHECKED.getValue())){ + QueryWrapper processInfoDetailEOQueryWrapper = new QueryWrapper<>(); + processInfoDetailEOQueryWrapper.lambda().eq(ProcessInfoDetailEO::getProjectLawsInventoryId,projectLawsInventoryEO.getId()); + processInfoDetailEOQueryWrapper.lambda().eq(ProcessInfoDetailEO::getFlowType,FlowTypeEnum.SJFHXSHLC.getValue()); + List processInfoDetailEOS = this.processInfoDetailEOService.list(processInfoDetailEOQueryWrapper); + if(CollectionUtils.isNotEmpty(processInfoDetailEOS)){ + projectLawsInventoryEO.setDesignPId(processInfoDetailEOS.get(0).getActiProcInstId()); + } + } } } } @@ -2790,7 +2936,10 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl prarams = (Map) jsonObject.get("params"); + String templateId = jsonObject.getString("templateId"); + this.sendMessageByTemplateId(templateId,prarams); } return new Result<>().success("调用成功!"); @@ -10227,6 +10376,8 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl originalCertificationEngineerIdList = Arrays.asList(original.getCertificationEngineer().split(",")); + List newCertificationEngineerIdList = Arrays.asList(projectLibraryBase.getCertificationEngineer().split(",")); + + originalCertificationEngineerIdList = originalCertificationEngineerIdList.stream().filter(originalCertificationEngineerId -> { + boolean flag = true; + for (String newCertificationEngineerId : newCertificationEngineerIdList) { + // 如果新传进来的 认证工程师id跟现有的认证工程师id一致,不用发消息 + if(StringUtils.equals(newCertificationEngineerId,originalCertificationEngineerId)){ + flag = false; + break; + } + } + return flag; + }).collect(Collectors.toList()); + + if(CollectionUtils.isNotEmpty(originalCertificationEngineerIdList)){ + // 判断当前项目下是否还有需要认证工程师操作的数据 只有清单待校核、结果待审查 这两个状态的数据由认证工程师操作。 + List flowStatusList = new ArrayList<>(); + flowStatusList.add(CertificationInventoryFlowStatusEnum.LIST_TO_BE_CHECKED.getValue()); + flowStatusList.add(CertificationInventoryFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue()); + + QueryWrapper certificationInventoryEOQueryWrapper = new QueryWrapper<>(); + certificationInventoryEOQueryWrapper.lambda().eq(ProjectCertificationInventoryEO::getProjectLibraryId,projectLibraryBase.getId()); + certificationInventoryEOQueryWrapper.lambda().in(ProjectCertificationInventoryEO::getFlowStatus,flowStatusList); + List projectCertificationInventoryEOList = this.projectCertificationInventoryEOService.list(certificationInventoryEOQueryWrapper); + if(CollectionUtils.isNotEmpty(projectCertificationInventoryEOList)){ + List userInfoList = this.sysUserService.querySysUserListByIdList(originalCertificationEngineerIdList); + this.projectCertificationInventoryEOService.sendMessageByTemplateId( + projectCertificationInventoryEOList, + TemplateInfoEnum2.CERTIFICATION_MESSAGE13.getValue(), + originalCertificationEngineerIdList, + userInfoList + ); + } + } + } checkExitData(projectLibraryBase); saveOrUpdate(projectLibraryBase); diff --git a/jero-web/src/common/lang/en-us.js b/jero-web/src/common/lang/en-us.js index 65d6c5a03..dc512c442 100644 --- a/jero-web/src/common/lang/en-us.js +++ b/jero-web/src/common/lang/en-us.js @@ -1690,6 +1690,10 @@ module.exports = { taskTypeMismatch:'Task Type Mismatch', taskNodeMismatch:'Task Node Mismatch', ifNot:'If not, fill in "none" or "not involved"', + designComplianceProcess:'Design Compliance Process', + validationComplianceProcess:'Validation Compliance Process', + onlyDataInTheReminderProcessBanBeProcessed:'Only data in the reminder process can be processed', + expeditionProcess:'Expedition Process', addfunction:'Add function', controllername:'Controller name', hardwaremanufacturer:'Hardware manufacturer', diff --git a/jero-web/src/common/lang/zh-cn.js b/jero-web/src/common/lang/zh-cn.js index 28f8158b6..8d7024f75 100644 --- a/jero-web/src/common/lang/zh-cn.js +++ b/jero-web/src/common/lang/zh-cn.js @@ -1767,6 +1767,8 @@ module.exports = { theDataYouSelectedContainsSkip:'您所勾选的数据中包含交付物类型为空的数据;请确认是否跳过', designComplianceProcessFor:'的设计符合性流程', validationComplianceProcessFor:'的验证符合性流程', + designComplianceProcess:'设计符合性流程', + validationComplianceProcess:'验证符合性流程', thePersonResponsibleForVerifyingEmpty:'验证符合性流程的责任人不能为空', theDeadlineComplianceProcessCannotEmpty:'验证符合性流程的截止时间不能为空', theDeadlineForTheDesignCannotBeEmpty:'设计符合性流程的截止时间不能为空', @@ -1795,4 +1797,6 @@ module.exports = { hardwaremanufacturer:'硬件生产企业', softwareversion:'软件版本', returntofill:'返回填写', + onlyDataInTheReminderProcessBanBeProcessed:'只能催办流程中的数据', + expeditionProcess:'催办流程', } \ No newline at end of file diff --git a/jero-web/src/views/projectManagement/components/batSetting.vue b/jero-web/src/views/projectManagement/components/batSetting.vue index e4371c4e2..ff8a45a32 100644 --- a/jero-web/src/views/projectManagement/components/batSetting.vue +++ b/jero-web/src/views/projectManagement/components/batSetting.vue @@ -100,13 +100,26 @@ :title="$t('engineeringInterfacePerson')">{{$t('engineeringInterfacePerson')}} - + + + + {{ item.name }} + + + + + + + + + + @@ -347,7 +360,8 @@ rules: {}, ids: [], code: '', - regulatoryEngineerList: [] + regulatoryEngineerList: [], + engineeringInterfacePersonList:[], } }, mounted() { @@ -355,6 +369,7 @@ methods: { dutyTerritoryChange(event) { this.formInline.regulationOwnerId = undefined + this.formInline.engineeringInterfacePerson = undefined this.formInline = {...this.formInline} this.queryPersonByProject(event) }, @@ -366,6 +381,7 @@ getAction('/project/projectRelatedPersonnel/queryPersonByProjectId', query).then((res) => { if (res.success) { this.regulatoryEngineerList = res.result.lawEngineerList //法规工程师 + this.engineeringInterfacePersonList = res.result.engineeringInterfacePersonList //工程接口人 } }) }, @@ -375,6 +391,8 @@ }, edit(data, code) { this.visible = true + this.regulatoryEngineerList = [] + this.engineeringInterfacePersonList = [] this.getDeliverableTree() this.code = code this.$nextTick(() => { diff --git a/jero-web/src/views/projectManagement/components/certificationList/components/addModel.vue b/jero-web/src/views/projectManagement/components/certificationList/components/addModel.vue index a61672efa..39924c876 100644 --- a/jero-web/src/views/projectManagement/components/certificationList/components/addModel.vue +++ b/jero-web/src/views/projectManagement/components/certificationList/components/addModel.vue @@ -632,7 +632,7 @@ }) }, editModel(value) { - // this.formInline = {} + this.formInline = {} this.visible = true this.formInline = JSON.parse(JSON.stringify(value)) // if (this.formInline.deliverableType) { @@ -644,7 +644,7 @@ this.getRegulationNo() this.title = this.$t('edit') this.$nextTick(() => { - this.formInline = {...this.formInline} + this.formInline = { ...this.formInline } this.$refs.ruleForm.clearValidate() }) }, @@ -773,7 +773,7 @@ }, dutyHandleChange(index) { this.formInline.dataList[index].sdt = undefined - this.formInline = {... this.formInline} + this.formInline = { ...this.formInline } this.queryPersonByProject(this.formInline.dataList[index].dutyTerritory, index) }, queryPersonByProject(row, index) { @@ -785,10 +785,18 @@ if (res.success) { if (this.formInline.id) { this.engineeringInterfacePersonList = res.result.engineeringInterfacePersonList || [] //工程接口人 + if (res.result.engineeringInterfacePersonList && res.result.engineeringInterfacePersonList.length == 1){ + this.formInline.sdt = res.result.engineeringInterfacePersonList[0].value + }else if(this.engineeringInterfacePersonList.length == 0){ + this.formInline.sdt = undefined + } } else { - this.$nextTick(()=>{ + this.$nextTick(() => { this.formInline.dataList[index].engineeringInterfacePersonList = res.result.engineeringInterfacePersonList || [] - this.formInline = {...this.formInline} + if (res.result.engineeringInterfacePersonList && res.result.engineeringInterfacePersonList.length == 1) { + this.formInline.dataList[index].sdt = res.result.engineeringInterfacePersonList[0].value + } + this.formInline = { ...this.formInline } }) } } diff --git a/jero-web/src/views/projectManagement/components/listEditModel.vue b/jero-web/src/views/projectManagement/components/listEditModel.vue index 7e428bf1b..888cc6781 100644 --- a/jero-web/src/views/projectManagement/components/listEditModel.vue +++ b/jero-web/src/views/projectManagement/components/listEditModel.vue @@ -252,26 +252,26 @@ {{$t('engineeringInterfacePerson')}} - - - - - - - - - - - - - - + + + + + + + + + + + {{ item.name }} + + + @@ -1022,11 +1022,11 @@ this.formInline.engineeringInterfacePerson = undefined this.formInline.homologationEngineerId = undefined this.formInline.designInitiatorId = undefined - this.formInline.designDutyId = undefined + // this.formInline.designDutyId = undefined this.formInline.prehomoInitiatorId = undefined this.formInline.prehomoDutyId = undefined this.formInline.verifyInitiatorId = undefined - this.formInline.verifyDutyId = undefined + // this.formInline.verifyDutyId = undefined this.queryPersonByProject(event) }, @@ -1158,9 +1158,9 @@ if (!(this.designInitiatorList.some(val => val.value == row.designInitiatorId))) { row.designInitiatorId = undefined } - if (!(this.designDutyList.some(val => val.value == row.designDutyId))) { - row.designDutyId = undefined - } + // if (!(this.designDutyList.some(val => val.value == row.designDutyId))) { + // row.designDutyId = undefined + // } if (!(this.prehomoInitiatorList.some(val => val.value == row.prehomoInitiatorId))) { row.prehomoInitiatorId = undefined } @@ -1170,9 +1170,9 @@ if (!(this.verifyInitiatorList.some(val => val.value == row.verifyInitiatorId))) { row.verifyInitiatorId = undefined } - if (!(this.verifyDutyList.some(val => val.value == row.verifyDutyId))) { - row.verifyDutyId = undefined - } + // if (!(this.verifyDutyList.some(val => val.value == row.verifyDutyId))) { + // row.verifyDutyId = undefined + // } if (!(this.regulatoryEngineerList.some(val => val.value == row.regulationOwnerId))) { row.regulationOwnerId = undefined } @@ -1389,7 +1389,7 @@ this.formInline[item.db_field_name] = this.formInline[item.db_field_name] ? moment(this.formInline[item.db_field_name]).format('YYYY-MM-DD') : '' }, PersonnelSelectionChange(value, id) { - this.formInline[value + '_id'] = id + this.formInline[value] = id this.formInline = { ...this.formInline } } } diff --git a/jero-web/src/views/projectManagement/components/listOfRegulations.vue b/jero-web/src/views/projectManagement/components/listOfRegulations.vue index 48c48daf7..3da734972 100644 --- a/jero-web/src/views/projectManagement/components/listOfRegulations.vue +++ b/jero-web/src/views/projectManagement/components/listOfRegulations.vue @@ -472,15 +472,16 @@
* - {{ $t('roleSwitching') }} + {{ $t('expeditionProcess') }}
- - - - - - {{ item.roleName }} + + + + + {{ item.name }} @@ -547,6 +548,26 @@ visibleQuestion: false, confirmLoadingQuestion: false, roleSwitchingList: [], + formInlineQuestion: {}, + rulesRoleQuestion: { + questionStatus: [ + { + required: true, + message: this.$t('expeditionProcess') + this.$t('cannotEmpty'), + trigger: 'change' + } + ] + }, + questionList: [ + { + value: '1', + name: this.$t('designComplianceProcess') + }, + { + value: '2', + name: this.$t('validationComplianceProcess') + } + ], listTitle: '', orderBy: '1', orderByField: '', @@ -632,7 +653,7 @@ children: [ { title: this.$t('personLiable'), - dataIndex: 'designDutyName', + dataIndex: 'designDutyIdName', align: 'left', width: 180, ellipsis: true @@ -667,7 +688,7 @@ children: [ { title: this.$t('personLiable'), - dataIndex: 'verifyDutyName', + dataIndex: 'verifyDutyIdName', align: 'left', width: 180, ellipsis: true @@ -1132,7 +1153,9 @@ dataWarningList: [], completeTaskList: [], requestsNum: 0, - JTextLoading: false + JTextLoading: false, + questionIdList: [], + questionWarning: [] } }, @@ -1481,14 +1504,46 @@ }) }, + handleOkQuestion() { + this.$refs.ruleFormQuestion.validate(valid => { + let formInlineQuestion = JSON.parse(JSON.stringify(this.formInlineQuestion)) + if (formInlineQuestion.questionStatus && formInlineQuestion.questionStatus.length > 0) { + formInlineQuestion.questionStatus = formInlineQuestion.questionStatus.join(',') + } + let query = { + ids: this.questionIdList.join(','), + projectLibraryId: this.$route.query.id, + questionStatus: formInlineQuestion.questionStatus + } + this.confirmLoadingQuestion = true + postAction('project/projectLawsInventoryEO/expediting', query).then((res) => { + if (res.success) { + this.$message.success(this.$t('OperationSuccessful')) + this.selectedRowKeys = [] + this.getList() + this.visibleQuestion = false + this.confirmLoadingQuestion = false + if (this.questionWarning && this.questionWarning.length > 0) { + this.promptInformation(this.questionWarning) + } + } else { + this.$message.warning(this.$t('operationFailed')) + } + }) + }) + }, + handleCancelQuestion() { + this.visibleQuestion = false + }, //催办 questionClick() { if (this.selectedRowKeys && this.selectedRowKeys.length > 0) { let selectedRowKeys = JSON.parse(JSON.stringify(this.selectedRowKeys)) let isTrue let content = [] - let idList = [] + this.questionIdList = [] let detailedWarningList = [] + this.questionWarning = [] for (let i = 0; i < this.dataSource.length; i++) { for (let j = 0; j < selectedRowKeys.length; j++) { if (this.dataSource[i].id == selectedRowKeys[j]) { @@ -1497,72 +1552,40 @@ } } 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 (content[i].verifyFlowStatus == 'List to be checked' || + content[i].designFlowStatus == 'List to be checked' || + content[i].verifyFlowStatus == 'Task to be confirmed' || + content[i].designFlowStatus == 'Task to be confirmed' || + content[i].verifyFlowStatus == 'Results to be submitted' || + content[i].designFlowStatus == 'Results to be submitted' || + content[i].verifyFlowStatus == 'Results to be reviewed' || + content[i].designFlowStatus == 'Results to be reviewed') { + this.questionIdList.push(content[i].id) + } else { + detailedWarningList.push(content[i].serialNumber) } } - if (idList && idList.length > 0) { - this.questionAction(idList, detailedWarningList) + if (detailedWarningList && detailedWarningList.length > 0) { + this.questionWarning.push( + < div > { + detailedWarningList + .join(',') + this.$t('conditionsNotMet') + this.$t('onlyDataInTheReminderProcessBanBeProcessed') + } < /div>) + } + if (this.questionIdList && this.questionIdList.length > 0) { + this.visibleQuestion = true + this.$nextTick(() => { + this.formInlineQuestion = {} + this.$refs.ruleFormQuestion.clearValidate() + }) } else { - this.promptInformation(detailedWarningList) + this.promptInformation(this.questionWarning) } } 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) { @@ -1885,6 +1908,7 @@ } }) }, + getList() { let roleCode = this.roleSwitchingCode let queryParam = JSON.parse(JSON.stringify(this.queryParam)) @@ -1940,6 +1964,7 @@ } }) }, + onCheckAllChange(e) { this.checkedList = e.target.checked ? this.customizeList.map(item => item.field) : [] this.selectedValue = this.checkedList @@ -1985,6 +2010,7 @@ } }) }, + getPersonnelList() { this.getList() }, @@ -2174,6 +2200,7 @@ this.$message.warning(this.$t('selectLeastOne')) } }, + submitClick(dataList, num) { let content = [] let designList = [] @@ -2236,6 +2263,7 @@ _this.submitAdmin(dataList) } }, + submitAdmin(dataList) { let _this = this this.requestsNum = 0 @@ -2333,6 +2361,7 @@ postAction('/project/projectCommentEO/add', query).then((res) => { }) }, + rejectCauseAdd(rejectCause, ids) { let rejectTime = moment(new Date()).format('YYYY-MM-DD HH:mm:ss') let query = { @@ -2346,6 +2375,7 @@ }) }, + handleCancelComment() { this.visibleComment = false }, @@ -2385,9 +2415,11 @@ } }) }, + customizeClick() { this.$refs.customizeListRef.transferModel(this.columnsAll) }, + bringInRelevantPersonnelClick() { let _this = this if (this.selectedRowKeys && this.selectedRowKeys.length > 0) {