From 824215fcce3d23baa53c61bb8e484dee71ef02ca Mon Sep 17 00:00:00 2001 From: liyawei Date: Wed, 22 Jun 2022 09:36:28 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=A4=E8=AF=81-bug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ParamsManifestEOController.java | 12 ++++- .../enums/CollectManifestStateEnum.java | 18 ++++---- .../cert/collect/enums/ManifestStateEnum.java | 36 +++++++++++++-- .../ParamsCollectManifestEOServiceImpl.java | 19 ++++++-- ...msCollectManifestHistoryEOServiceImpl.java | 2 +- .../controller/ParamsInfoEOController.java | 6 +-- .../cert/template/entity/ParamsInfoEO.java | 3 ++ .../service/impl/ParamsInfoEOServiceImpl.java | 45 ++++++++++++++----- 8 files changed, 110 insertions(+), 31 deletions(-) diff --git a/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/collect/controller/ParamsManifestEOController.java b/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/collect/controller/ParamsManifestEOController.java index f471eda07..22e9effbb 100644 --- a/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/collect/controller/ParamsManifestEOController.java +++ b/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/collect/controller/ParamsManifestEOController.java @@ -8,9 +8,12 @@ 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.modules.cert.collect.entity.ParamsManifestEO; +import com.jero.modules.cert.collect.enums.ManifestStateEnum; import com.jero.modules.cert.collect.service.IParamsManifestEOService; import com.jero.modules.cert.collect.vo.ParamsManifestHistoryVO; import com.jero.modules.cert.collect.vo.ParamsManifestVO; +import com.jero.modules.cert.report.entity.ParamsExportTemplateEO; +import com.jero.modules.cert.report.enums.ExportTemplateStateEnum; import com.jero.modules.cert.template.entity.ParamsTemplateEO; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -25,9 +28,10 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.util.Arrays; import java.util.List; +import java.util.Map; - /** +/** * @Description: 参数清单 * @Author: jero-boot * @Date: 2022-05-05 @@ -66,6 +70,12 @@ public class ParamsManifestEOController extends JeroController rows = pageList.getRecords(); + // 处理 状态 中英文 + Map stateMap = ManifestStateEnum.toMap(cut); + rows.forEach(manifestEO -> { + manifestEO.setState(stateMap.get(manifestEO.getState())); + }); return Result.OK(cut, pageList); } diff --git a/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/collect/enums/CollectManifestStateEnum.java b/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/collect/enums/CollectManifestStateEnum.java index 6ec9fee80..ce0611de7 100644 --- a/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/collect/enums/CollectManifestStateEnum.java +++ b/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/collect/enums/CollectManifestStateEnum.java @@ -11,15 +11,15 @@ import java.util.Map; * @Date: Created in 15:17 2022/5/7 */ public enum CollectManifestStateEnum { - WAIT_COLLECT("待发起收集","wait collect","1"), - WAIT_SDT("待工程接口人处理","wait sdt","2"), - SDT_BACK("工程接口人退回","sdt back","3"), - WAIT_FILL("待填写","wait fill","4"), - DRE_BACK("填写人退回","dre back","5"), - SUBMIT("已提交","submit","6"), - CERT_BACK("认证工程师退回","cert back","7"), - SYNC_REPORT("已同步至上报库","sync report","8"), - CHANGE("变更","change","9"); + WAIT_COLLECT("待发起收集","Wait Collect","1"), + WAIT_SDT("待工程接口人处理","Wait Sdt","2"), + SDT_BACK("工程接口人退回","Sdt Back","3"), + WAIT_FILL("待填写","Wait Fill","4"), + DRE_BACK("填写人退回","Dre Back","5"), + SUBMIT("已提交","Submit","6"), + CERT_BACK("认证工程师退回","Cert Back","7"), + SYNC_REPORT("已同步至上报库","Sync Report","8"), + CHANGE("变更","Change","9"); String name; String enName; diff --git a/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/collect/enums/ManifestStateEnum.java b/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/collect/enums/ManifestStateEnum.java index 2e3528573..e62add4e9 100644 --- a/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/collect/enums/ManifestStateEnum.java +++ b/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/collect/enums/ManifestStateEnum.java @@ -1,19 +1,27 @@ package com.jero.modules.cert.collect.enums; +import com.jero.common.constant.enums.CutEnum; +import com.jero.modules.cert.report.enums.ExportTemplateStateEnum; + +import java.util.HashMap; +import java.util.Map; + /** * @Author: liyawei * @Description: 参数清单-状态 * @Date: Created in 16:19 2022/5/5 */ public enum ManifestStateEnum { - COLLECTING("收集中","收集中"), - FINISHED("已完成","已完成"); + COLLECTING("收集中","Collecting","收集中"), + FINISHED("已完成","Finished","已完成"); String name; + String enName; String value; - ManifestStateEnum(String name, String value) { + ManifestStateEnum(String name, String enName, String value) { this.name = name; + this.enName = enName; this.value = value; } @@ -25,6 +33,14 @@ public enum ManifestStateEnum { this.name = name; } + public String getEnName() { + return enName; + } + + public void setEnName(String enName) { + this.enName = enName; + } + public String getValue() { return value; } @@ -32,4 +48,18 @@ public enum ManifestStateEnum { public void setValue(String value) { this.value = value; } + + public static Map toMap(String cut){ + Map map = new HashMap<>(); + if (CutEnum.CN.getValue().equals(cut)) { + for (ManifestStateEnum manifestStateEnum : ManifestStateEnum.values()) { + map.put(manifestStateEnum.getValue(), manifestStateEnum.getName()); + } + } else if (CutEnum.EN.getValue().equals(cut)) { + for (ManifestStateEnum manifestStateEnum : ManifestStateEnum.values()) { + map.put(manifestStateEnum.getValue(), manifestStateEnum.getEnName()); + } + } + return map; + } } diff --git a/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/collect/service/impl/ParamsCollectManifestEOServiceImpl.java b/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/collect/service/impl/ParamsCollectManifestEOServiceImpl.java index 5c51151e9..0b93b1f6d 100644 --- a/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/collect/service/impl/ParamsCollectManifestEOServiceImpl.java +++ b/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/collect/service/impl/ParamsCollectManifestEOServiceImpl.java @@ -953,7 +953,15 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl controlValueMap = new HashMap<>(); - controlValueMap.put("lable", controlValueStr[i]); + controlValueMap.put("label", controlValueStr[i]); controlValueMap.put("value", controlValueStr[i]); controlValueMapList.add(controlValueMap); } diff --git a/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/template/controller/ParamsInfoEOController.java b/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/template/controller/ParamsInfoEOController.java index fbe30a3ec..b1fe83c38 100644 --- a/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/template/controller/ParamsInfoEOController.java +++ b/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/template/controller/ParamsInfoEOController.java @@ -235,10 +235,10 @@ public class ParamsInfoEOController extends JeroController publish(@RequestParam(name="paramsTemplateId") String paramsTemplateId, @RequestParam(name="cut") String cut) { int publishVersion = paramsInfoPublishEOService.publishTemplate(paramsTemplateId); - if (CutEnum.CN.equals(cut)) { - return Result.OK("发布版本:" + publishVersion + "成功!"); + if (CutEnum.CN.getValue().equals(cut)) { + return Result.OK("发布版本:" + publishVersion + " 成功!"); } else { - return Result.OK("Publish version:" + publishVersion + "success!"); + return Result.OK("Publish version:" + publishVersion + " success!"); } } diff --git a/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/template/entity/ParamsInfoEO.java b/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/template/entity/ParamsInfoEO.java index 46bb57d69..cdca194aa 100644 --- a/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/template/entity/ParamsInfoEO.java +++ b/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/template/entity/ParamsInfoEO.java @@ -135,4 +135,7 @@ public class ParamsInfoEO implements Serializable { @TableField(exist = false) private List certCategoryParamsInfoEOList; // 认证类别参数列表 + @TableField(exist = false) + private String cut; + } diff --git a/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/template/service/impl/ParamsInfoEOServiceImpl.java b/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/template/service/impl/ParamsInfoEOServiceImpl.java index 56f0677fe..3c7d2b04e 100644 --- a/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/template/service/impl/ParamsInfoEOServiceImpl.java +++ b/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/template/service/impl/ParamsInfoEOServiceImpl.java @@ -101,14 +101,22 @@ public class ParamsInfoEOServiceImpl extends ServiceImpl queryWrapper = new LambdaQueryWrapper<>(); queryWrapper.eq(ParamsInfoEO::getNioNumber, paramsInfoEO.getNioNumber()); List paramsInfoEOList = list(queryWrapper); if (CollectionUtil.isNotEmpty(paramsInfoEOList)) { - throw new JeroBootException("NIO编号已存在!"); + if (CutEnum.CN.getValue().equals(paramsInfoEO.getCut())) { + throw new JeroBootException("NIO编号已存在!"); + } else { + throw new JeroBootException("NIO number already exists!"); + } } // 批量添加认证类别参数 @@ -119,7 +127,11 @@ public class ParamsInfoEOServiceImpl extends ServiceImpl new TreeSet<>(Comparator.comparing(o -> o.getCertCategory() + ";" + o.getParamsNumber()))), ArrayList::new)); if (ccParamsInfoList.size() < certCategoryParamsInfoEOList.size()) { - throw new JeroBootException("不同类别间参数编号必须唯一!"); + if (CutEnum.CN.getValue().equals(paramsInfoEO.getCut())) { + throw new JeroBootException("不同类别间参数编号必须唯一!"); + } else { + throw new JeroBootException("Parameter number must be unique among the different categories!"); + } } certCategoryParamsInfoEOList.forEach(certCategoryParamsInfoEO -> { certCategoryParamsInfoEO.setParamsTemplateId(paramsTemplateId); @@ -166,7 +178,11 @@ public class ParamsInfoEOServiceImpl extends ServiceImpl paramsInfoEOList = list(queryWrapper); if (CollectionUtil.isNotEmpty(paramsInfoEOList)) { - throw new JeroBootException("NIO编号已存在!"); + if (CutEnum.CN.getValue().equals(paramsInfoEO.getCut())) { + throw new JeroBootException("NIO编号已存在!"); + } else { + throw new JeroBootException("NIO number already exists!"); + } } } @@ -191,7 +211,11 @@ public class ParamsInfoEOServiceImpl extends ServiceImpl new TreeSet<>(Comparator.comparing(o -> o.getCertCategory() + ";" + o.getParamsNumber()))), ArrayList::new)); if (ccParamsInfoList.size() < certCategoryParamsInfoEOList.size()) { - throw new JeroBootException("不同类别间参数编号必须唯一!"); + if (CutEnum.CN.getValue().equals(paramsInfoEO.getCut())) { + throw new JeroBootException("不同类别间参数编号必须唯一!"); + } else { + throw new JeroBootException("Parameter number must be unique among the different categories!"); + } } certCategoryParamsInfoEOList.forEach(certCategoryParamsInfoEO -> { @@ -710,7 +734,7 @@ public class ParamsInfoEOServiceImpl extends ServiceImpl nowFileList = FileUnZip.readFileByFilename(filepath, fileName); + List nowFileList = FileUnZip.readFileByFilename(filepath, fileName,null,null,null,null,null); +// List nowFileList = FileUnZip.readFileByFilename(filepath, fileName); if (nowFileList.size() == 0) { if(CutEnum.CN.getValue().equals(cut)) { errorMsg += "附件模板压缩包中没有" + fileName + "文件; "; @@ -1248,7 +1273,7 @@ public class ParamsInfoEOServiceImpl extends ServiceImpl