diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/entity/ProjectCertificationInventoryEO.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/entity/ProjectCertificationInventoryEO.java index 74d413d05..54c3fb880 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/entity/ProjectCertificationInventoryEO.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/entity/ProjectCertificationInventoryEO.java @@ -139,11 +139,12 @@ public class ProjectCertificationInventoryEO implements Serializable { private String bussDocumentLibraryId; /**交付物模板*/ -// @Excel(name = "交付物模板", width = 15) + @ApiModelProperty(value = "交付物模板") private String deliverableTemplate; /**交付物模板名称**/ @TableField(exist = false) + @Excel(name = "交付物模板", width = 15) private String deliverableTemplateName; /**交付结果*/ @@ -157,7 +158,6 @@ public class ProjectCertificationInventoryEO implements Serializable { @DateTimeFormat(pattern="yyyy-MM-dd") @ApiModelProperty(value = "截止日期") private Date endTime; - /**流程状态*/ @ApiModelProperty(value = "流程状态") private String flowStatus; @@ -213,4 +213,8 @@ public class ProjectCertificationInventoryEO implements Serializable { @TableField(exist = false) private String excelName; + +// @Excel(name = "截止日期", width = 15, format = "yyyy-MM-dd") +// @TableField(exist = false) +// private String endTimeStr; } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/entity/ProjectCertificationInventoryEOEn.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/entity/ProjectCertificationInventoryEOEn.java index d9f5e41fd..1f31acd54 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/entity/ProjectCertificationInventoryEOEn.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/entity/ProjectCertificationInventoryEOEn.java @@ -137,11 +137,12 @@ public class ProjectCertificationInventoryEOEn implements Serializable { private java.lang.String bussDocumentLibraryId; /**交付物模板*/ -// @Excel(name = "交付物模板", width = 15) + @ApiModelProperty(value = "交付物模板") private java.lang.String deliverableTemplate; /**交付物模板名称**/ @TableField(exist = false) + @Excel(name = "交付物模板", width = 15) private String deliverableTemplateName; /**交付结果*/ diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/entity/ProjectLawsInventoryEO.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/entity/ProjectLawsInventoryEO.java index c66e7ce3d..8ebc4d8d4 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/entity/ProjectLawsInventoryEO.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/entity/ProjectLawsInventoryEO.java @@ -102,19 +102,19 @@ public class ProjectLawsInventoryEO implements Serializable { /**适用地区*/ @ApiModelProperty(value = "适用地区") //@Dict(dicCode ="region") - @Excel(name = "适用地区", width = 15, dicCode = "region") +// @Excel(name = "适用地区", width = 15, dicCode = "region") private java.lang.String region; @TableField(exist = false) private String region_dictText; /**对应标准*/ - @Excel(name = "对应标准", width = 20) +// @Excel(name = "对应标准", width = 20) @ApiModelProperty(value = "对应标准") private String correspondingStandard; /**实施类别*/ - @Excel(name = "实施类别", width = 20,dicCode ="implement_type") +// @Excel(name = "实施类别", width = 20,dicCode ="implement_type") @ApiModelProperty(value = "实施类别") //@Dict(dicCode ="implement_type") private String implementType; @@ -122,7 +122,7 @@ public class ProjectLawsInventoryEO implements Serializable { private String implementType_dictText; /**新车型实施日期*/ - @Excel(name = "新车型实施日期", width = 20, format = "yyyy-MM-dd") +// @Excel(name = "新车型实施日期", width = 20, format = "yyyy-MM-dd") @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd") @DateTimeFormat(pattern="yyyy-MM-dd") @ApiModelProperty(value = "新车型实施日期") @@ -132,7 +132,7 @@ public class ProjectLawsInventoryEO implements Serializable { private String xin1Che1Xing2Shi2Shi1Ri4Qi1String; /**在产车实施日期*/ - @Excel(name = "在产车实施日期", width = 20, format = "yyyy-MM-dd") +// @Excel(name = "在产车实施日期", width = 20, format = "yyyy-MM-dd") @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd") @DateTimeFormat(pattern="yyyy-MM-dd") @ApiModelProperty(value = "在产车实施日期") @@ -162,7 +162,7 @@ public class ProjectLawsInventoryEO implements Serializable { private String applicableSupplement; /**WVTA ID*/ - @Excel(name = "WVTA ID", width = 20) +// @Excel(name = "WVTA ID", width = 20) @ApiModelProperty(value = "WVTA ID") private String wvtaId; @@ -187,7 +187,7 @@ public class ProjectLawsInventoryEO implements Serializable { @ApiModelProperty(value = "认证工程师id") private String homologationEngineerId; - @Excel(name = "认证工程师", width = 20) +// @Excel(name = "认证工程师", width = 20) @TableField(exist = false) @ApiModelProperty(value = "认证工程师名称") private String homologationEngineerName;//认证工程师名称 @@ -238,7 +238,7 @@ public class ProjectLawsInventoryEO implements Serializable { private String designInitiatorId; /**设计符合性确认-发起人名称*/ - @Excel(name = "发起人", width = 20,groupName = "设计符合性确认") +// @Excel(name = "发起人", width = 20,groupName = "设计符合性确认") @TableField(exist = false) private String designInitiatorName; @@ -372,7 +372,7 @@ public class ProjectLawsInventoryEO implements Serializable { private String verifyInitiatorId; /**验证符合性确认-发起人名称*/ - @Excel(name = "发起人", width = 20,groupName = "验证符合性确认") +// @Excel(name = "发起人", width = 20,groupName = "验证符合性确认") @TableField(exist = false) private String verifyInitiatorName; diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/entity/ProjectLawsInventoryEOEn.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/entity/ProjectLawsInventoryEOEn.java index d380e7c48..b156a0f74 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/entity/ProjectLawsInventoryEOEn.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/entity/ProjectLawsInventoryEOEn.java @@ -101,29 +101,29 @@ public class ProjectLawsInventoryEOEn implements Serializable { /**适用地区*/ @ApiModelProperty(value = "适用地区") @Dict(dicCode ="Area") - @Excel(name = "Area", width = 15) +// @Excel(name = "Area", width = 15) private String region; /**对应标准*/ - @Excel(name = "Compare EU/CN", width = 20) +// @Excel(name = "Compare EU/CN", width = 20) @ApiModelProperty(value = "对应标准") private String correspondingStandard; /**实施类别*/ - @Excel(name = "Usage", width = 20,dicCode ="implement_type") +// @Excel(name = "Usage", width = 20,dicCode ="implement_type") @ApiModelProperty(value = "实施类别") @Dict(dicCode ="implement_type") private String implementType; /**新车型实施日期*/ - @Excel(name = "New Type Execution Date", width = 30, format = "yyyy-MM-dd") +// @Excel(name = "New Type Execution Date", width = 30, format = "yyyy-MM-dd") @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd") @DateTimeFormat(pattern="yyyy-MM-dd") @ApiModelProperty(value = "新车型实施日期") private Date xin1Che1Xing2Shi2Shi1Ri4Qi1; /**在产车实施日期*/ - @Excel(name = "New Vehicle Execution Date", width = 30, format = "yyyy-MM-dd") +// @Excel(name = "New Vehicle Execution Date", width = 30, format = "yyyy-MM-dd") 67169 @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd") @DateTimeFormat(pattern="yyyy-MM-dd") @ApiModelProperty(value = "在产车实施日期") @@ -146,7 +146,7 @@ public class ProjectLawsInventoryEOEn implements Serializable { private String applicableSupplement; /**WVTA ID*/ - @Excel(name = "WVTA ID", width = 20) +// @Excel(name = "WVTA ID", width = 20) @ApiModelProperty(value = "WVTA ID") private String wvtaId; @@ -169,7 +169,7 @@ public class ProjectLawsInventoryEOEn implements Serializable { @ApiModelProperty(value = "认证工程师id") private String homologationEngineerId; - @Excel(name = "Homologation Engineer", width = 25) +// @Excel(name = "Homologation Engineer", width = 25) @TableField(exist = false) @ApiModelProperty(value = "认证工程师名称") private String homologationEngineerName;//认证工程师名称 @@ -213,7 +213,7 @@ public class ProjectLawsInventoryEOEn implements Serializable { private String designInitiatorId; /**设计符合性确认-发起人名称*/ - @Excel(name = "Reviewer", width = 25,groupName = "Design Compliance Check") +// @Excel(name = "Reviewer", width = 25,groupName = "Design Compliance Check") @TableField(exist = false) private String designInitiatorName; @@ -325,7 +325,7 @@ public class ProjectLawsInventoryEOEn implements Serializable { private String verifyInitiatorId; /**验证符合性确认-发起人名称*/ - @Excel(name = "Reviewer", width = 25,groupName = "Validation Compliance Check") +// @Excel(name = "Reviewer", width = 25,groupName = "Validation Compliance Check") @TableField(exist = false) private String verifyInitiatorName; diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/enums/ProjectRoleEnum.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/enums/ProjectRoleEnum.java index 24bfda6e3..cbffa1463 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/enums/ProjectRoleEnum.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/enums/ProjectRoleEnum.java @@ -21,6 +21,7 @@ public enum ProjectRoleEnum { MANAGER("manage","11",""), ADMIN("系统管理员","12",""), VIEWER("Viewer","13",""), + DUTYPERSON("责任人","14","") ; String name; diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectCertificationInventoryEOServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectCertificationInventoryEOServiceImpl.java index bc470b601..0142b904c 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectCertificationInventoryEOServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectCertificationInventoryEOServiceImpl.java @@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.aliyuncs.utils.IOUtils; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; @@ -15,12 +16,14 @@ import com.jero.common.exception.JeroBootException; import com.jero.common.system.query.QueryGenerator; import com.jero.common.system.vo.LoginUser; import com.jero.common.util.DateUtils; +import com.jero.common.util.oss.CosBootUtil; import com.jero.modules.authDummy.entity.AuthDummyInventoryInfoEO; import com.jero.modules.authDummy.service.IAuthDummyInventoryBaseEOService; import com.jero.modules.authDummy.service.IAuthDummyInventoryInfoEOService; import com.jero.modules.document.controller.BussDocumentLibraryEOController; import com.jero.modules.document.entity.BussDocumentLibraryEO; import com.jero.modules.document.mapper.BussDocumentLibraryEOMapper; +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.oss.entity.OSSFile; @@ -63,15 +66,18 @@ import org.aspectj.util.FileUtil; import org.jeecgframework.poi.excel.ExcelExportUtil; import org.jeecgframework.poi.excel.entity.ExportParams; import org.jeecgframework.poi.excel.entity.enmus.ExcelType; +import org.joda.time.DateTime; import org.springframework.beans.BeanUtils; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; +import org.springframework.mock.web.MockMultipartFile; import org.springframework.stereotype.Service; import java.io.*; import java.text.DateFormat; +import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.*; import java.util.stream.Collectors; @@ -85,6 +91,8 @@ import org.springframework.web.multipart.MultipartFile; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import static com.jero.modules.document.service.impl.BussDocumentLibraryEOServiceImpl.copyFile; + /** * @Description: 项目库-认证清单表 * @Author: jero-boot @@ -139,6 +147,15 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl stringStringMap : dataList) { ProjectCertificationInventoryEO projectCertificationInventoryEOTemp = JSON.parseObject(JSON.toJSONString(stringStringMap), ProjectCertificationInventoryEO.class); -// projectCertificationInventoryEOTemp.setCut(projectCertificationInventoryEO.getCut()); + projectCertificationInventoryEOTemp.setCut(projectCertificationInventoryEO.getCut()); projectCertificationInventoryEOTemp.setProjectLibraryId(projectCertificationInventoryEO.getProjectLibraryId()); projectCertificationInventoryEOTemp.setFlowStatus(CertificationInventoryFlowStatusEnum.LIST_TO_BE_RELEASED.getValue()); datas.add(projectCertificationInventoryEOTemp); @@ -2842,17 +2858,553 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl categoryList = sysCategoryService.list(); + List categoryList = sysCategoryService.list(); //普通数据字典 -// List dictItemList = sysDictItemServiceImpl.selectItemsAll(); -// importDatas(datas, dictItemList, zipEntryName,saveDirectory,projectCertificationInventoryEO,categoryList); - String cut = projectCertificationInventoryEO.getCut(); - importDisposeData(datas,cut); + List dictItemList = sysDictItemServiceImpl.selectItemsAll(); + importDatas(datas, dictItemList, zipEntryName,saveDirectory,projectCertificationInventoryEO,categoryList); +// String cut = projectCertificationInventoryEO.getCut(); +// importDisposeData(datas,cut); //删除原上传文件 FileUnZip.deleteDir(saveDirectory); } + private void importDatas(List datas, + List dictItemList, String zipEntryName, + File saveDirectory, ProjectCertificationInventoryEO projectCertificationInventoryEOTemp, + List categoryList) { + List msgList = new ArrayList<>(); + //模板数据验证 + msgList = dataTemplateVerify(datas, dictItemList, zipEntryName, projectCertificationInventoryEOTemp, categoryList); + + if (msgList.size() > 0) { + //返回报错信息 + String html = ""; + for (String s : msgList) { + html += s + "
"; + } + FileUnZip.deleteDir(saveDirectory); + throw new JeroBootException(html); + }else { + if (datas.size() != 0) { + this.saveBatch(datas); + } + } + } + + //模板数据验证 + private List dataTemplateVerify(List datas, + List dictItemList, String zipEntryName, + ProjectCertificationInventoryEO projectCertificationInventoryEOTemp, + List categoryList) { + String dictId = sysCategoryMapper.getDictId("ren4_zheng4_-_jiao1_fu4_wu4_lei4_xing2"); + List collect = categoryList.stream().filter(e -> e.getSysDictId().equals(dictId)).collect(Collectors.toList()); + List treeNameList = new ArrayList<>(); + if(CutEnum.CN.getValue().equals(projectCertificationInventoryEOTemp.getCut())){ + treeNameList = collect.stream().map(SysCategory::getName).collect(Collectors.toList()); + }else{ + treeNameList = collect.stream().map(SysCategory::getEnName).collect(Collectors.toList()); + } + int i = 2; + List msgList = new ArrayList<>(); + String value = ""; + boolean flag = true; + + //编号验证 + verifySerialNumber(datas,projectCertificationInventoryEOTemp); + for (ProjectCertificationInventoryEO projectCertificationInventoryEO : datas) { + i++; + String errorMsg = ""; + if(CutEnum.CN.getValue().equals(projectCertificationInventoryEOTemp.getCut())){ + errorMsg = "第" + i + "行:"; + }else{ + errorMsg = i + " line:"; + } + //类别 + String category = projectCertificationInventoryEO.getCategory(); + //检验项目 + String inspectionItem = projectCertificationInventoryEO.getInspectionItem(); + //配置项 + String configItem = projectCertificationInventoryEO.getConfigItem(); + //WVTA ID + String wvtaId = projectCertificationInventoryEO.getWvtaId(); + //标准编号 + String serialNumber = projectCertificationInventoryEO.getSerialNumber(); + //责任领域 + String dutyTerritory = projectCertificationInventoryEO.getDutyTerritoryName(); + //工程接口人engineeringInterfacePerson + String sdt = projectCertificationInventoryEO.getSdtName(); + //责任人 + String dutyPerson = projectCertificationInventoryEO.getDutyPersonName(); + //交付物类型 + String deliverableType = projectCertificationInventoryEO.getDeliverableTypeName(); + //截止时间 + Date endTime = projectCertificationInventoryEO.getEndTime(); + + //文件 + //交付物模板 + String deliverableTemplate = projectCertificationInventoryEO.getDeliverableTemplateName(); + + + + + //编号必填 + flag = must(projectCertificationInventoryEO, errorMsg, msgList, serialNumber, "编号", "Standard No"); + + + //WVTA ID + + if(StringUtils.isNotBlank(wvtaId)){ + if(wvtaId.length() > 100){ + String message = ""; + if(CutEnum.CN.getValue().equals(projectCertificationInventoryEOTemp.getCut())){ + message = errorMsg + "WVTA ID不能超过100个字符, "; + }else{ + message = errorMsg + " The WVTA ID cannot contain more than 100 characters, "; + } + msgList.add(message); + } + } else { + String message = ""; + if(CutEnum.CN.getValue().equals(projectCertificationInventoryEOTemp.getCut())){ + message = errorMsg + "WVTA ID不能为空, "; + }else{ + message = errorMsg + " The WVTA ID cannot null, "; + } + msgList.add(message); + } + //类别 + + if(StringUtils.isNotBlank(category)){ + if(category.length() > 100){ + String message = ""; + if(CutEnum.CN.getValue().equals(projectCertificationInventoryEOTemp.getCut())){ + message = errorMsg + "类别不能超过100个字符, "; + }else{ + message = errorMsg + " The Category cannot contain more than 100 characters, "; + } + msgList.add(message); + } + }else { + String message = ""; + if(CutEnum.CN.getValue().equals(projectCertificationInventoryEOTemp.getCut())){ + message = errorMsg + "类别不能为空, "; + }else{ + message = errorMsg + " The Category cannot null, "; + } + msgList.add(message); + } + //检验项目 + + if(StringUtils.isNotBlank(inspectionItem)){ + if(inspectionItem.length() > 100){ + String message = ""; + if(CutEnum.CN.getValue().equals(projectCertificationInventoryEOTemp.getCut())){ + message = errorMsg + "检验项目不能超过100个字符, "; + }else{ + message = errorMsg + " The InspectionItem cannot contain more than 100 characters, "; + } + msgList.add(message); + } + }else { + String message = ""; + if(CutEnum.CN.getValue().equals(projectCertificationInventoryEOTemp.getCut())){ + message = errorMsg + "检验项目不能为空, "; + }else{ + message = errorMsg + " The InspectionItem cannot null, "; + } + msgList.add(message); + } + //配置项 + + if(StringUtils.isNotBlank(configItem)){ + if(configItem.length() > 100){ + String message = ""; + if(CutEnum.CN.getValue().equals(projectCertificationInventoryEOTemp.getCut())){ + message = errorMsg + "配置项不能超过100个字符, "; + }else{ + message = errorMsg + " The ConfigItem cannot contain more than 100 characters, "; + } + msgList.add(message); + } + }else { + String message = ""; + if(CutEnum.CN.getValue().equals(projectCertificationInventoryEOTemp.getCut())){ + message = errorMsg + "配置项不能为空, "; + }else{ + message = errorMsg + " The ConfigItem cannot null, "; + } + msgList.add(message); + } + + //责任领域 + + if(StringUtils.isNotBlank(dutyTerritory)){ + value = pullMore(dictItemList, projectCertificationInventoryEO, errorMsg, dutyTerritory,msgList,"责任领域","Responsible Field","duty_territory"); + if(StringUtils.isNotBlank(value)){ + projectCertificationInventoryEO.setDutyTerritory(value); + } + }else { + String message = ""; + if(CutEnum.CN.getValue().equals(projectCertificationInventoryEOTemp.getCut())){ + message = errorMsg + "责任领域不能为空, "; + }else{ + message = errorMsg + " The Responsible Field cannot null, "; + } + msgList.add(message); + } + //工程接口人(责任领域下的工程接口人) + Map objectMap = iProjectRelatedPersonnelService.queryPersonByProjectId(projectCertificationInventoryEOTemp.getProjectLibraryId(), value); + + //工程接口人 + List> mapPersonList = (List>) objectMap.get("engineeringInterfacePersonList"); + //所有人 + List> allPersonList = (List>) objectMap.get("allPersonList"); + + String nameCn = ""; + String nameEn = ""; + //工程接口人 + if(StringUtils.isNotBlank(sdt)){ + nameCn = "工程接口人"; + nameEn = "Eng. Interface "; + //验证人员是否存在 + personnelVerify(projectCertificationInventoryEO, errorMsg, msgList, sdt, mapPersonList,nameCn,nameEn, com.jero.modules.project.enums.ProjectRoleEnum.ENGINEERING_INTERFACE_PERSON.getValue()); + }else { + String message = ""; + if(CutEnum.CN.getValue().equals(projectCertificationInventoryEOTemp.getCut())){ + message = errorMsg + "工程接口人不能为空, "; + }else{ + message = errorMsg + " The Eng. Interface cannot null, "; + } + msgList.add(message); + } + //责任人 + if(StringUtils.isNotBlank(dutyPerson)){ + nameCn = "责任人"; + nameEn = "Assignee"; + //验证人员是否存在 + personnelVerify(projectCertificationInventoryEO, errorMsg, msgList, dutyPerson, allPersonList,nameCn,nameEn, com.jero.modules.project.enums.ProjectRoleEnum.DUTYPERSON.getValue()); + }else { + String message = ""; + if(CutEnum.CN.getValue().equals(projectCertificationInventoryEOTemp.getCut())){ + message = errorMsg + "责任人不能为空, "; + }else{ + message = errorMsg + " The Assignee cannot null, "; + } + msgList.add(message); + } + //交付物类型 + if(StringUtils.isNotEmpty(deliverableType)){ + value = tree(categoryList,treeNameList, projectCertificationInventoryEO, errorMsg, deliverableType,msgList,"交付物类型","Deliverable Type","deliverable_template"); + if(StringUtils.isNotBlank(value)){ + String treeId = getTreeId(categoryList, projectCertificationInventoryEOTemp, treeNameList, value); + projectCertificationInventoryEO.setDeliverableType(treeId); + } + }else{ + String message = ""; + if(CutEnum.CN.getValue().equals(projectCertificationInventoryEOTemp.getCut())){ + message = errorMsg + "交付物类型不能为空, "; + }else{ + message = errorMsg + " The Deliverable Type cannot null, "; + } + msgList.add(message); + } + + //交付物模板 + value = templateTransition(zipEntryName, projectCertificationInventoryEO, errorMsg, deliverableTemplate,msgList,"交付物模板","Deliverable Template"); + if(StringUtils.isNotBlank(value)){ + projectCertificationInventoryEO.setDeliverableTemplate(value); + } + //截止时间 + SimpleDateFormat sd = new SimpleDateFormat(); + String endTimeStr = sd.format(endTime); + if(StringUtils.isNotBlank(endTimeStr)){ + flag = dateVerify(projectCertificationInventoryEO, errorMsg, endTime,msgList,"截止时间","Due Date"); + if(flag){ + projectCertificationInventoryEO.setEndTime(projectCertificationInventoryEO.getEndTime()); + } + }else{ + String message = ""; + if(CutEnum.CN.getValue().equals(projectCertificationInventoryEOTemp.getCut())){ + message = errorMsg + "截止时间不能为空, "; + }else{ + message = errorMsg + " The Due Date Type cannot null, "; + } + msgList.add(message); + } + + } + return msgList; + } + //必填 + private boolean must(ProjectCertificationInventoryEO projectCertificationInventoryEO, String errorMsg, + List msgList, String serialNumber,String nameCn,String nameEn) { + int errorCount = 0; + if(StringUtils.isBlank(serialNumber)){ + errorCount ++; + if(CutEnum.CN.getValue().equals(projectCertificationInventoryEO.getCut())){ + errorMsg += nameCn + "为必填项,不能为空, "; + }else{ + errorMsg += nameEn + "This parameter is mandatory and cannot be empty, "; + } + msgList.add(errorMsg); + } + if(errorCount == 0){ + return true; + }else{ + return false; + } + } + + private boolean dateVerify(ProjectCertificationInventoryEO projectCertificationInventoryEO, + String errorMsg, Date field, List msgList, String nameCn, String nameEn) { + + //判断格式是否正确 + boolean flag = true; + if(ObjectUtils.isNotEmpty(field)){ + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + String format = sdf.format(field); + if (!DateUtils.isValidDate(format)) { + flag = false; + if(CutEnum.CN.getValue().equals(projectCertificationInventoryEO.getCut())){ + errorMsg += nameCn + "格式不正确, 正确格式如:yyyy/m/d、yyyy-MM-dd、yyyy年MM月dd日"; + }else{ + errorMsg += nameEn + " Incorrect format correct format is:yyyy/m/d、yyyy-MM-dd、yyyy年MM月dd日"; + } + msgList.add(errorMsg); + } + } + return flag; + } + + private String templateTransition(String zipEntryName, + ProjectCertificationInventoryEO projectCertificationInventoryEO, + String errorMsg, String deliverableTemplate, List msgList, + String nameCn, String nameEn) { + String value = ""; + if (StringUtils.isNotBlank(deliverableTemplate)) { + StringBuilder sb = new StringBuilder(); + for (String fileName : deliverableTemplate.split(",")) { + List nowFileList = new ArrayList<>(); + + nowFileList = FileUnZip.readFileByFilename(zipEntryName, fileName,projectCertificationInventoryEO.getCut(),errorMsg,msgList,nameCn,nameEn); + + if (nowFileList.size() == 0) { +// if(CutEnum.CN.getValue().equals(projectCertificationInventoryEO.getCut())){ +// errorMsg += "压缩包中没有" + fileName + "文件; "; +// }else{ +// errorMsg += " Not in the zip package" + fileName + "file; "; +// } +// msgList.add(errorMsg); + } else { + try { + FileInputStream input = new FileInputStream(nowFileList.get(0)); + MultipartFile multipartFile = + new MockMultipartFile(nowFileList.get(0).getName(), nowFileList.get(0).getName(), "text/plain", input); + //文件存入文件表 + OSSFile ossFile = iOSSFileService.uploadLocalOfCos(multipartFile, "", null,null); + if (ObjectUtils.isNotEmpty(ossFile)) { + sb.append(ossFile.getId() + ","); + } + } catch (IOException e) { + log.error("认证清单导入"+e.getMessage()); + } + } + } + if (StringUtils.isNotBlank(sb)) { + value = sb.substring(0, sb.length() - 1); + } + } + return value; + } + + private String getTreeId(List categoryList, + ProjectCertificationInventoryEO projectCertificationInventoryEOTemp, + List treeNameList, String value) { + StringBuilder sb = new StringBuilder(); + for (String valueTemp : value.split(",")) { + if (treeNameList.contains(valueTemp)) { + List sysCategoryList = new ArrayList<>(); + if (CutEnum.CN.getValue().equals(projectCertificationInventoryEOTemp.getCut())) { + sysCategoryList = categoryList.stream().filter(e -> e.getName().equals(valueTemp)).collect(Collectors.toList()); + } else { + sysCategoryList = categoryList.stream().filter(e -> e.getEnName().equals(valueTemp)).collect(Collectors.toList()); + } + if (sysCategoryList.size() != 0) { + sb.append(sysCategoryList.get(0).getId() + ","); + } + } + } + if (StringUtils.isNotBlank(sb)) { + String substring = sb.substring(0, sb.length() - 1); + return substring; + } + return null; + } + + private String tree(List categoryList, List nameList, + ProjectCertificationInventoryEO projectCertificationInventoryEO, + String errorMsg, String value, List msgList, + String nameCn, String nameEn, String dictCode) { + if (StringUtils.isNotBlank(value)) { + StringBuilder sb = new StringBuilder(); + for (String s : value.split(",")) { + if(!nameList.contains(s)){ + sb.append(s+","); + } + } + if(StringUtils.isNotBlank(sb)){ + String substring = sb.substring(0, sb.length() - 1); + if (CutEnum.CN.getValue().equals(projectCertificationInventoryEO.getCut())) { + errorMsg += nameCn + "中的" + substring + "与数据字典不匹配, "; + } else { + errorMsg += nameEn + " " + substring + " does not match the data dictionary, "; + } + msgList.add(errorMsg); + }else{ + StringBuilder sbTemp = new StringBuilder(); + for (String s : value.split(",")) { + List collect = new ArrayList<>(); + if(CutEnum.CN.getValue().equals(projectCertificationInventoryEO.getCut())){ + collect = categoryList.stream().filter(e -> s.equals(e.getName())).collect(Collectors.toList()); + if(collect.size() != 0){ + sbTemp.append(collect.get(0).getName()+","); + } + }else{ + collect = categoryList.stream().filter(e -> s.equals(e.getEnName())).collect(Collectors.toList()); + if(collect.size() != 0){ + sbTemp.append(collect.get(0).getEnName()+","); + } + } + } + if(StringUtils.isNotBlank(sbTemp)){ + String substring = sbTemp.substring(0, sbTemp.length() - 1); + return substring; + } + } + } + return null; + } + + private void personnelVerify(ProjectCertificationInventoryEO projectCertificationInventoryEO, + String errorMsg, List msgList, String regulationOwnerId, + List> mapList, String nameCn, String nameEn, String fieldNumber) { + //单选 + if(regulationOwnerId.contains(",")){ + if(CutEnum.CN.getValue().equals(projectCertificationInventoryEO.getCut())){ + errorMsg += nameCn + "导入只能填写一个用户名, "; + }else{ + errorMsg += "Only one user name can be entered for"+ nameEn +"import, "; + } + msgList.add(errorMsg); + } + + if(mapList.size() != 0){ + int count = 0; + for (Map stringStringMap : mapList) { + String name = stringStringMap.get("name"); + if(regulationOwnerId.equals(name)){ + count ++; + if(com.jero.modules.project.enums.ProjectRoleEnum.ENGINEERING_INTERFACE_PERSON.getValue().equals(fieldNumber)){ + projectCertificationInventoryEO.setSdt(stringStringMap.get("value")); + }else if(com.jero.modules.project.enums.ProjectRoleEnum.DUTYPERSON.getValue().equals(fieldNumber)){ + projectCertificationInventoryEO.setDutyPerson(stringStringMap.get("value")); + } + break; + } + } + if(count == 0){ + if(CutEnum.CN.getValue().equals(projectCertificationInventoryEO.getCut())){ + errorMsg += nameCn+regulationOwnerId+"与相关人员名单中责任领域下的人员不匹配"; + }else{ + errorMsg += nameEn+regulationOwnerId+"does not match a person under the Responsible Field in the relevant person list"; + } + msgList.add(errorMsg); + } + }else{ + if(CutEnum.CN.getValue().equals(projectCertificationInventoryEO.getCut())){ + errorMsg += nameCn+regulationOwnerId+"与相关人员名单中责任领域下的人员不匹配"; + }else{ + errorMsg += nameEn+regulationOwnerId+"does not match a person under the Responsible Field in the relevant person list"; + } + msgList.add(errorMsg); + } + } + + private String pullMore(List dictItemList, ProjectCertificationInventoryEO projectCertificationInventoryEO, + String errorMsg, String value, List msgList, + String nameCn, String nameEn, String dictCode) { + List valueList = new ArrayList<>(); + if (StringUtils.isNotBlank(value)) { + List list = Arrays.asList(value.split(",")); + List sysDictItemList = new ArrayList<>(); + if(CutEnum.CN.getValue().equals(projectCertificationInventoryEO.getCut())){ + sysDictItemList = dictItemList.stream().filter(e ->dictCode.equals(e.getDictCode()) && list.contains(e.getItemText())).collect(Collectors.toList()); + }else{ + sysDictItemList = dictItemList.stream().filter(e ->dictCode.equals(e.getDictCode()) && list.contains(e.getEnName())).collect(Collectors.toList()); + } + + if(list.size() == sysDictItemList.size()){ + valueList = sysDictItemList.stream().map(SysDictItem::getItemValue).collect(Collectors.toList()); + + }else{ + //数据中有与数据字典不匹配的值 + List finalValueList = valueList; + List diffList = list.stream().filter(e -> !finalValueList.contains(e)).collect(Collectors.toList()); + if (CutEnum.CN.getValue().equals(projectCertificationInventoryEO.getCut())) { + errorMsg += nameCn + "中的" + StringUtils.join(diffList,",") + "与数据字典不匹配, "; + } else { + errorMsg += nameEn + " " + StringUtils.join(diffList,",") + " does not match the data dictionary, "; + } + msgList.add(errorMsg); + } + } + return StringUtils.join(valueList,","); + } + + + //编号验证 + private void verifySerialNumber(List datas, + ProjectCertificationInventoryEO projectCertificationInventoryEOTemp) { + //1. 验证标准号在文档库中是否存在 + List serialNumberList = datas.stream().map(ProjectCertificationInventoryEO::getSerialNumber).collect(Collectors.toList()); + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.in(BussDocumentLibraryEO::getSerialNumber,serialNumberList); + List bussDocumentLibraryEOList = iBussDocumentLibraryEOService.list(wrapper); + //文档库中可能存在重复的标准号 + List serialNumberListTemp = bussDocumentLibraryEOList.stream().map(BussDocumentLibraryEO::getSerialNumber).distinct().collect(Collectors.toList()); + if(serialNumberList.size() != serialNumberListTemp.size()){ + //存在文档库没有的数据 + List collect = bussDocumentLibraryEOList.stream().map(BussDocumentLibraryEO::getSerialNumber).collect(Collectors.toList()); + List serialNumbers = serialNumberList.stream().filter(e -> !collect.contains(e)).collect(Collectors.toList()); + if(serialNumbers.size() > 0){ + if(CutEnum.CN.getValue().equals(datas.get(0).getCut())){ + throw new JeroBootException(StringUtils.join(serialNumbers,",")+"文档库中不存在,不能添加"); + }else{ + throw new JeroBootException(StringUtils.join(serialNumbers,",")+" does not exist in the document library and cannot be added"); + } + } + }else{ + for (ProjectCertificationInventoryEO projectCertificationInventoryEO : datas) { + List collect = bussDocumentLibraryEOList.stream() + .filter(e -> e.getSerialNumber().equals(projectCertificationInventoryEO.getSerialNumber())).collect(Collectors.toList()); + projectCertificationInventoryEO.setBussDocumentLibraryId(collect.get(0).getId()); + } + } +// //2. 验证标准号在法规清单中是否添加过 +// LambdaQueryWrapper lambdaQueryWrapper = new LambdaQueryWrapper<>(); +// lambdaQueryWrapper.in(ProjectCertificationInventoryEO::getSerialNumber,serialNumberList).in(ProjectCertificationInventoryEO::getProjectLibraryId,projectCertificationInventoryEOTemp.getProjectLibraryId()); +// List projectCertificationInventoryEOList = this.list(lambdaQueryWrapper); +// List serialNumberTempList = projectCertificationInventoryEOList.stream().map(ProjectCertificationInventoryEO::getSerialNumber).collect(Collectors.toList()); +// if(projectCertificationInventoryEOList.size() > 0){ +// if(CutEnum.CN.getValue().equals(datas.get(0).getCut())){ +// throw new JeroBootException(StringUtils.join(serialNumberTempList,",")+"已存在,不能重复添加"); +// }else{ +// throw new JeroBootException(StringUtils.join(serialNumberTempList,",")+" already exists and cannot be added again"); +// } +// } + } + /** * 导出数据 * @param response @@ -2870,10 +3422,19 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl fileInfos = getOssFiles(dataList); + //处理文件名称 + for (int i = 0; i < dataList.size(); i++) { if(StringUtils.isNotEmpty(dataList.get(i).getDeliveryResult())){ String fileName = ossFileService.getFileInfos(dataList.get(i).getDeliveryResult()).stream().map(OSSFile::getFileName).distinct().collect(Collectors.joining(",")); dataList.get(i).setDeliveryResult(fileName); + + } + if(StringUtils.isNotEmpty(dataList.get(i).getDeliverableTemplate())){ + String deliverableTemplateName = template(fileInfos, dataList.get(i).getDeliverableTemplate()); + dataList.get(i).setDeliverableTemplateName(deliverableTemplateName); } } String cut = projectCertificationInventoryEO.getCut(); @@ -2890,7 +3451,7 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl dataList, List fileInfos) throws IOException{ + if(fileInfos.size() != 0){ + for(ProjectCertificationInventoryEO projectCertificationInventoryEO : dataList){ + String deliverableTemplate = projectCertificationInventoryEO.getDeliverableTemplate(); + String serialNumber = projectCertificationInventoryEO.getSerialNumber(); + if(StringUtils.isBlank(serialNumber)){ + continue; + } + List deliverableTemplateFileList = new ArrayList<>(); + List oSSFileList = new ArrayList<>(); + if(StringUtils.isNotBlank(deliverableTemplate)){ + deliverableTemplateFileList = fileInfos.stream().filter(e -> deliverableTemplate.contains(e.getId())).collect(Collectors.toList()); + oSSFileList.addAll(deliverableTemplateFileList); + } + if(oSSFileList.size() != 0){ + String fileNowPath = uploadpath + "/tempZip/" + serialNumber; + File file = new File(fileNowPath); + if (file.exists()) { + file.delete(); + } + file.mkdirs(); + for (OSSFile ossFile : oSSFileList) { + String url = ossFile.getUrl(); + if(StringUtils.isNotBlank(url)){ + //判断文件是否存在 + boolean b = CosBootUtil.doesObjectExist(url); + if(b){ + InputStream download = CosBootUtil.download(url); + copyFile(download, fileNowPath + File.separator + ossFile.getFileName()); + } + } + } + } + } + + } + } + + private String template(List fileInfos, String value) { + StringBuilder sb = new StringBuilder(); + for (String s : value.split(",")) { + List collect = fileInfos.stream().filter(e -> s.equals(e.getId())).collect(Collectors.toList()); + if(collect.size() != 0){ + sb.append(collect.get(0).getFileName()+","); + } + } + String substring = ""; + if(StringUtils.isNotBlank(sb)){ + substring = sb.substring(0, sb.length() - 1); + } + return substring; + } + + private List getOssFiles(List dataList) { + List fileIdList = new ArrayList<>(); + for (ProjectCertificationInventoryEO projectCertificationInventoryEO : dataList) { + if(StringUtils.isNotBlank(projectCertificationInventoryEO.getDeliverableTemplate())){ + fileIdList.add(projectCertificationInventoryEO.getDeliverableTemplate()); + } + } + //查询所有的文件 + List fileInfos = new ArrayList<>(); + if(fileIdList.size() != 0){ + fileInfos = iOSSFileService.getFileInfos(StringUtils.join(fileIdList, ",")); + } + return fileInfos; + } + private String pull(List sysDictItems, String field,String dictCode) { if(StringUtils.isBlank(field)){ return null; @@ -3008,33 +3638,37 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl list = Arrays.asList(title.split(",")); @@ -3112,7 +3746,7 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl--> - {{isTrue ? $t('regulationListModuleMaintenance'):$t('regulationListModuleMaintenance')}} + {{isTrue ? $t('regulationListTemplateMaintenance'):$t('regulationListTemplateMaintenance')}}
@@ -23,8 +23,8 @@
- - {{$t('regulationListModule')}} + + {{$t('regulatoryListTemplate')}} {{$route.query.name}} diff --git a/jero-web/src/views/otamanagement/upgradeactivity/components/upgradecompletion.vue b/jero-web/src/views/otamanagement/upgradeactivity/components/upgradecompletion.vue index 8c21d9b2a..8b1479d10 100644 --- a/jero-web/src/views/otamanagement/upgradeactivity/components/upgradecompletion.vue +++ b/jero-web/src/views/otamanagement/upgradeactivity/components/upgradecompletion.vue @@ -19,11 +19,11 @@ {{$t('implementedupgrade')}}
- - + + {{$t('yes')}} - + {{$t('not')}} @@ -43,7 +43,7 @@
@@ -59,9 +59,9 @@ - {{ (formInline.VINcodelist === 'null' || formInline.VINcodelist === '' || - formInline.VINcodelist == null) ? $t('clickUpload') : $t('viewUploadedFiles') + @click="clickButtonToUpload('csv')"> + {{ (formInline.csv === 'null' || formInline.csv === '' || + formInline.csv == null) ? $t('clickUpload') : $t('viewUploadedFiles') }}

{{$t('notecsv')}}

@@ -69,11 +69,11 @@
-
+
{{$t('vehicleshavenotcompletedonlineupgrade')}} -
@@ -86,7 +86,7 @@
@@ -96,13 +96,13 @@
{{$t('Quantity')}}
- +
@@ -117,9 +117,9 @@ - {{ (formInline.VINcodelist === 'null' || formInline.VINcodelist === '' || - formInline.VINcodelist == null) ? $t('clickUpload') : $t('viewUploadedFiles') + @click="clickButtonToUpload('wwcfj')"> + {{ (formInline.wwcfj === 'null' || formInline.wwcfj === '' || + formInline.wwcfj == null) ? $t('clickUpload') : $t('viewUploadedFiles') }}

{{$t('format')}}

@@ -139,7 +139,7 @@ + :rows="2" v-model="formInline.ssjl"/>
@@ -152,9 +152,9 @@
- {{ (formInline.VINcodelist === 'null' || formInline.VINcodelist === '' || - formInline.VINcodelist == null) ? $t('clickUpload') : $t('viewUploadedFiles') + @click="clickButtonToUpload('ssjlfj')"> + {{ (formInline.ssjlfj === 'null' || formInline.ssjlfj === '' || + formInline.ssjlfj == null) ? $t('clickUpload') : $t('viewUploadedFiles') }}

{{$t('format')}}

@@ -189,7 +189,9 @@ export default { visible: false, disabled: false, showButton:false, - formInline: {}, + formInline: { + list:[{}] + }, confirmLoading: false, acceptcode:'', projectNameList: [], @@ -234,19 +236,20 @@ export default { methods: { ...mapGetters(['userInfo']), addModel(record,flag) { + this.disabled=false + this.showButton=false if(flag=='1'){ this.disabled=true this.showButton=true } this.record=record + this.visible = true this.confirmLoading = false - this.formInline = {} - this.formInline.dataList = [{}] + console.log('555',record); this.$nextTick(() => { this.formInline = { ...this.formInline } this.$refs.ruleForm.clearValidate() - // this.$refs.codeNumber.number() }) }, handleCancel() { @@ -264,27 +267,27 @@ export default { this.formInline.authDummyInventoryBaseId = this.$route.query.id let query = JSON.parse(JSON.stringify(this.formInline)) this.confirmLoading = true - // postAction(this.url.addModel, query).then((res) => { - // if (res.success) { - // this.confirmLoading = false - // this.$message.success(this.$t('OperationSuccessful')) + postAction('/ota/otaBaSjJssj/add',{otaId:this.record.id,...this.formInline}).then((res) => { + if (res.success) { + this.confirmLoading = false + this.$message.success(this.$t('OperationSuccessful')) - // } else { - // this.$message.warning(res.message) - // this.confirmLoading = false - // } - // }) + } else { + this.$message.warning(res.message) + this.confirmLoading = false + } + }) this.visible = false this.$emit('addModelList',this.record) } }) }, addClick(index){ - this.formInline.dataList.splice(index + 1, 0, {}) + this.formInline.list.splice(index + 1, 0, {}) this.formInline = { ...this.formInline } }, deleteClick(index) { - this.formInline.dataList.splice(index, 1) + this.formInline.list.splice(index, 1) this.formInline = { ...this.formInline } }, getRegulationNo() { diff --git a/jero-web/src/views/otamanagement/upgradeactivity/index.vue b/jero-web/src/views/otamanagement/upgradeactivity/index.vue index 1c60bf1eb..658e2efeb 100644 --- a/jero-web/src/views/otamanagement/upgradeactivity/index.vue +++ b/jero-web/src/views/otamanagement/upgradeactivity/index.vue @@ -453,11 +453,18 @@ export default { }, // 结束升级 endUpgrade(record,flag){ + console.log('model',record); this.$refs.upgradecompletionRef.addModel(record,flag) }, // 查看 detailclick(record){ - + localStorage.removeItem('otaIdT') + localStorage.removeItem('otaId') + localStorage.setItem('otaId',record.id) + this.$router.push({ + path: '/upgradeactivityrecord', + query: {} + }) }, // 维护 maintenanceClick(row){ diff --git a/jero-web/src/views/projectManagement/components/listEditModel.vue b/jero-web/src/views/projectManagement/components/listEditModel.vue index 9a4a571c8..fe42f0fd7 100644 --- a/jero-web/src/views/projectManagement/components/listEditModel.vue +++ b/jero-web/src/views/projectManagement/components/listEditModel.vue @@ -221,30 +221,30 @@ - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + +
@@ -252,13 +252,13 @@ {{$t('engineeringInterfacePerson')}}
- - - - - - - + + + + + + + - - - - - - - - - - - - - - - - - - - - - -
-
- {{$t('remarks')}} -
- - - -
-
-
+ + + + + + + + + + + + + + + + + + + + + +
+
+ {{$t('remarks')}} +
+ + + +
+
+
 {{$t('confirmationOfDesignConformity')}}
@@ -326,21 +326,22 @@ :isSingleChoice="true" :personneQuery="formInline" v-if="visible" + :disabled="isEdit(this.formInline)" @change="PersonnelSelectionChange" v-model="formInline.designDutyIdName"/> - - - - - - - - - - - - - + + + + + + + + + + + + + @@ -361,66 +362,67 @@ :placeholder="$t('PleaseSelect')+$t('cutoffTime')" @change="dateChange({db_field_name:'designDueDate'})" format="YYYY-MM-DD" + :disabled="isEdit(this.formInline)" :getCalendarContainer="(trigger) => trigger.parentNode" v-model="formInline.designDueDate" style="width: 100%"/>
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
- - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + +
@@ -436,6 +438,7 @@ :getPopupContainer="triggerNode=> triggerNode.parentNode" class="box-input" style="width: 100%" + :disabled="isEdit(this.formInline)" :tree-data="DeliverableTreeList" tree-checkable :placeholder="$t('PleaseSelect')+$t('typeOfDeliverables')" @@ -475,177 +478,178 @@
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 {{$t('verificationAndConformityconfirmation')}}
@@ -661,6 +665,7 @@ :isSingleChoice="true" :personneQuery="formInline" v-if="visible" + :disabled="isEditVerifi(this.formInline)" @change="PersonnelSelectionChange" v-model="formInline.verifyDutyIdName"/>
@@ -677,50 +682,51 @@ :placeholder="$t('PleaseSelect')+$t('cutoffTime')" @change="dateChange({db_field_name:'verifyDueDate'})" format="YYYY-MM-DD" + :disabled="isEditVerifi(this.formInline)" :getCalendarContainer="(trigger) => trigger.parentNode" v-model="formInline.verifyDueDate" style="width: 100%"/> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - + + + + + + +
@@ -736,6 +742,7 @@ :getPopupContainer="triggerNode=> triggerNode.parentNode" class="box-input" style="width: 100%" + :disabled="isEditVerifi(this.formInline)" :tree-data="DeliverableTreeList" tree-checkable :placeholder="$t('PleaseSelect')+$t('typeOfDeliverables')" @@ -776,6 +783,7 @@ @@ -827,7 +835,8 @@
-
+
{{$t('verifyComplianceConfirmReturnReason')}}
@@ -984,6 +993,22 @@ this.userInfoQuery = this.userInfo() }, methods: { + isEdit(val) { + if (val.designFlowStatus == 'Task to be confirmed' || val.designFlowStatus == 'Results to be submitted' || + val.designFlowStatus == 'Results to be reviewed') { + return true + } else { + return false + } + }, + isEditVerifi(val) { + if (val.verifyFlowStatus == 'Task to be confirmed' || val.verifyFlowStatus == 'Results to be submitted' || + val.verifyFlowStatus == 'Results to be reviewed') { + return true + } else { + return false + } + }, ...mapGetters(['userInfo']), getRejectCause(id) { let query = { @@ -1301,8 +1326,15 @@ this.$set(this, 'rules', rules) }, clickButtonToUpload(item) { + let isTrue = false + if (item == 'designDeliverableTemplate') { + isTrue = this.isEdit(this.formInline) + } else if (item == 'verifyDeliverableTemplate') { + isTrue = this.isEditVerifi(this.formInline) + } this.$refs.uploadFile.perentHandleFunc() this.$refs.uploadFile.visible = true + this.$refs.uploadFile.disabled = isTrue this.uploadName = item getAction('sys/common/getFileInfos', { id: this.formInline[item] }).then((res) => { if (res.success) {