认证-bug修改
This commit is contained in:
+11
-1
@@ -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<ParamsManifestEO,
|
||||
|
||||
IPage page = new Page(pageNo, pageSize);
|
||||
IPage pageList = paramsManifestEOService.pageInfo(page, paramsManifestEO);
|
||||
List<ParamsManifestEO> rows = pageList.getRecords();
|
||||
// 处理 状态 中英文
|
||||
Map<String, String> stateMap = ManifestStateEnum.toMap(cut);
|
||||
rows.forEach(manifestEO -> {
|
||||
manifestEO.setState(stateMap.get(manifestEO.getState()));
|
||||
});
|
||||
return Result.OK(cut, pageList);
|
||||
}
|
||||
|
||||
|
||||
+9
-9
@@ -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;
|
||||
|
||||
+33
-3
@@ -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<String,String> toMap(String cut){
|
||||
Map<String,String> 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;
|
||||
}
|
||||
}
|
||||
|
||||
+15
-4
@@ -953,7 +953,15 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
|
||||
ParamsCollectManifestEO paramsCollectManifestEO = getById(paramsCollectManifestIdStr[i]);
|
||||
ParamsCollectManifestEO updateEO = new ParamsCollectManifestEO();
|
||||
updateEO.setId(paramsCollectManifestIdStr[i]);
|
||||
updateEO.setState(String.valueOf(Integer.parseInt(paramsCollectManifestEO.getState()) + 1)); // 设置对应状态
|
||||
if (CollectManifestStateEnum.SDT_BACK.equals(paramsCollectManifestEO.getState())
|
||||
|| CollectManifestStateEnum.DRE_BACK.equals(paramsCollectManifestEO.getState())
|
||||
|| CollectManifestStateEnum.CERT_BACK.equals(paramsCollectManifestEO.getState())) {
|
||||
|
||||
updateEO.setState(String.valueOf(Integer.parseInt(paramsCollectManifestEO.getState()) - 2)); // 设置对应状态
|
||||
|
||||
} else {
|
||||
updateEO.setState(String.valueOf(Integer.parseInt(paramsCollectManifestEO.getState()) + 1)); // 设置对应状态
|
||||
}
|
||||
updateEOList.add(updateEO);
|
||||
}
|
||||
return updateBatchById(updateEOList);
|
||||
@@ -1040,7 +1048,9 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
|
||||
connectBuilder.append("You are required to fll in ");
|
||||
for (int i=0; i<paramsCollectManifestIdStr.length; i++) {
|
||||
ParamsCollectManifestEO paramsCollectManifestEO = getById(paramsCollectManifestIdStr[i]);
|
||||
connectBuilder.append(paramsCollectManifestEO.getNioNumber()).append("-").append(paramsCollectManifestEO.getParamsName()).append(",");
|
||||
if (i < 3) {
|
||||
connectBuilder.append(paramsCollectManifestEO.getNioNumber()).append("-").append(paramsCollectManifestEO.getParamsName()).append(",");
|
||||
}
|
||||
|
||||
ParamsCollectManifestEO updateEO = new ParamsCollectManifestEO();
|
||||
updateEO.setId(paramsCollectManifestIdStr[i]);
|
||||
@@ -1111,8 +1121,9 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
|
||||
|
||||
StringBuilder connectBuilder = new StringBuilder();
|
||||
connectBuilder.append("You are required to fll in ");
|
||||
for (ParamsCollectManifestEO paramsCollectManifestEO : paramsCollectManifestEOList) {
|
||||
if (sdt.equals(paramsCollectManifestEO.getSdt())) {
|
||||
for (int i=0; i<paramsCollectManifestEOList.size(); i++) {
|
||||
ParamsCollectManifestEO paramsCollectManifestEO = paramsCollectManifestEOList.get(i);
|
||||
if (sdt.equals(paramsCollectManifestEO.getSdt()) && i<3) {
|
||||
connectBuilder.append(paramsCollectManifestEO.getNioNumber()).append("-").append(paramsCollectManifestEO.getParamsName()).append(",");
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -384,7 +384,7 @@ public class ParamsCollectManifestHistoryEOServiceImpl extends ServiceImpl<Param
|
||||
String[] controlValueStr = controlValue.split(",");
|
||||
for (int i = 0; i < controlValueStr.length; i++) {
|
||||
Map<String, String> controlValueMap = new HashMap<>();
|
||||
controlValueMap.put("lable", controlValueStr[i]);
|
||||
controlValueMap.put("label", controlValueStr[i]);
|
||||
controlValueMap.put("value", controlValueStr[i]);
|
||||
controlValueMapList.add(controlValueMap);
|
||||
}
|
||||
|
||||
+3
-3
@@ -235,10 +235,10 @@ public class ParamsInfoEOController extends JeroController<ParamsInfoEO, IParams
|
||||
public Result<?> 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!");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+3
@@ -135,4 +135,7 @@ public class ParamsInfoEO implements Serializable {
|
||||
@TableField(exist = false)
|
||||
private List<CertCategoryParamsInfoEO> certCategoryParamsInfoEOList; // 认证类别参数列表
|
||||
|
||||
@TableField(exist = false)
|
||||
private String cut;
|
||||
|
||||
}
|
||||
|
||||
+35
-10
@@ -101,14 +101,22 @@ public class ParamsInfoEOServiceImpl extends ServiceImpl<ParamsInfoEOMapper, Par
|
||||
// 校验nio编号 格式:字母数字横杠(-)
|
||||
String nioNumberRegex = "^[A-Za-z0-9-]+$";
|
||||
if (!nioNumber.matches(nioNumberRegex)) {
|
||||
throw new JeroBootException("nio编号格式错误,仅能为字母,数字,横杠(-)");
|
||||
if (CutEnum.CN.getValue().equals(paramsInfoEO.getCut())) {
|
||||
throw new JeroBootException("NIO编号格式错误,仅能为字母,数字,横杠(-)!");
|
||||
} else {
|
||||
throw new JeroBootException("NIO number formatting errors, can only letters, numbers, dash (-)!");
|
||||
}
|
||||
}
|
||||
|
||||
LambdaQueryWrapper<ParamsInfoEO> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(ParamsInfoEO::getNioNumber, paramsInfoEO.getNioNumber());
|
||||
List<ParamsInfoEO> 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<ParamsInfoEOMapper, Par
|
||||
.collect(Collectors.collectingAndThen(Collectors
|
||||
.toCollection(() -> 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<ParamsInfoEOMapper, Par
|
||||
// 校验nio编号 格式:字母数字横杠(-)
|
||||
String nioNumberRegex = "^[A-Za-z0-9-]+$";
|
||||
if (!nioNumber.matches(nioNumberRegex)) {
|
||||
throw new JeroBootException("nio编号格式错误,仅能为字母,数字,横杠(-)");
|
||||
if (CutEnum.CN.getValue().equals(paramsInfoEO.getCut())) {
|
||||
throw new JeroBootException("NIO编号格式错误,仅能为字母,数字,横杠(-)!");
|
||||
} else {
|
||||
throw new JeroBootException("NIO number formatting errors, can only letters, numbers, dash (-)!");
|
||||
}
|
||||
}
|
||||
|
||||
ParamsInfoEO oldParamsInfoEO = getById(paramsInfoId);
|
||||
@@ -175,7 +191,11 @@ public class ParamsInfoEOServiceImpl extends ServiceImpl<ParamsInfoEOMapper, Par
|
||||
queryWrapper.eq(ParamsInfoEO::getNioNumber, paramsInfoEO.getNioNumber());
|
||||
List<ParamsInfoEO> 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<ParamsInfoEOMapper, Par
|
||||
.collect(Collectors.collectingAndThen(Collectors
|
||||
.toCollection(() -> 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<ParamsInfoEOMapper, Par
|
||||
}
|
||||
return Result.error(resultMsg);
|
||||
}
|
||||
String path = uploadpath + "/modal/"+filenameorg;
|
||||
String path = uploadpath + File.separator + "modal" + File.separator + filenameorg;
|
||||
File saveDirectory = new File(path);
|
||||
if(!saveDirectory.isDirectory()){
|
||||
saveDirectory.mkdir();
|
||||
@@ -1151,7 +1175,7 @@ public class ParamsInfoEOServiceImpl extends ServiceImpl<ParamsInfoEOMapper, Par
|
||||
|| ControlTypeEnum.PULL_MORE.getValue().equals(controlType)
|
||||
|| ControlTypeEnum.PULL_MORE_FILE.getValue().equals(controlType)
|
||||
|| ControlTypeEnum.TEXT_PULL_MORE.getValue().equals(controlType)
|
||||
|| ControlTypeEnum.TEXT_FILE.getValue().equals(controlType)
|
||||
|| ControlTypeEnum.TEXT_PULL_SINGLE.getValue().equals(controlType)
|
||||
|| ControlTypeEnum.TEXT_PULL_SINGLE_FILE.getValue().equals(controlType)) {
|
||||
resultMap = validateMustAndLength(controlValues, "控件备选值", "control values", IsMustEnum.YES.getValue(), "500", false, cut);
|
||||
} else {
|
||||
@@ -1192,7 +1216,8 @@ public class ParamsInfoEOServiceImpl extends ServiceImpl<ParamsInfoEOMapper, Par
|
||||
}
|
||||
}
|
||||
for (String fileName : fileTemplateName.split(",")) {
|
||||
List<File> nowFileList = FileUnZip.readFileByFilename(filepath, fileName);
|
||||
List<File> nowFileList = FileUnZip.readFileByFilename(filepath, fileName,null,null,null,null,null);
|
||||
// List<File> 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<ParamsInfoEOMapper, Par
|
||||
|
||||
// nio编号
|
||||
String nioNumber = ccDto.getNioNumber();
|
||||
resultMap = validateMustAndLength(nioNumber, "nio编号", "nio number", IsMustEnum.YES.getValue(),"15", false, cut);
|
||||
resultMap = validateMustAndLength(nioNumber, "NIO编号", "NIO number", IsMustEnum.YES.getValue(),"15", false, cut);
|
||||
errorMsg += (String)resultMap.get("errorMsg");
|
||||
countError += (int)resultMap.get("countError");
|
||||
if (StringUtils.isNotEmpty(ccDto.getNioNumber())) {
|
||||
|
||||
Reference in New Issue
Block a user