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

This commit is contained in:
CD
2022-11-04 14:34:35 +08:00
26 changed files with 390 additions and 136 deletions
@@ -169,7 +169,7 @@ public interface IParamsCollectManifestEOService extends IService<ParamsCollectM
void exportDre(ParamsCollectManifestVO paramsCollectManifestVO, HttpServletResponse response, HttpServletRequest request);
// 填写人角色下导入
Result<?> importDre(MultipartFile file, String cut, String paramsManifestId) throws IOException;
Result<?> importDre(MultipartFile file, String cut, String paramsManifestId);
Result<?> importData(List<Map<String, Object>> dataList,
String unzipfilepath,
@@ -63,6 +63,7 @@ import com.jero.modules.system.service.ISysUserService;
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.hssf.usermodel.HSSFDataFormat;
import org.apache.poi.hssf.util.HSSFColor;
import org.apache.poi.ss.usermodel.*;
import org.apache.poi.ss.util.CellRangeAddress;
@@ -2484,11 +2485,11 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
String[] headers = titles[1].split(",");
XSSFCellStyle cellStyle =workbook.createCellStyle();
cellStyle.setWrapText(true);
// cellStyle.setAlignment(XSSFCellStyle.ALIGN_CENTER);
cellStyle.setVerticalAlignment(XSSFCellStyle.VERTICAL_CENTER);
cellStyle.setDataFormat(HSSFDataFormat.getBuiltinFormat("@")); // 设置文本格式
XSSFCellStyle cellStyle1 =workbook.createCellStyle();
cellStyle1.setAlignment(XSSFCellStyle.ALIGN_CENTER);
cellStyle1.setVerticalAlignment(VerticalAlignment.CENTER);
// cellStyle1.setAlignment(XSSFCellStyle.ALIGN_CENTER);
//合并单元格
CellRangeAddress region1 =
@@ -2508,8 +2509,9 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
XSSFCell cell = row.createCell(i);
XSSFRichTextString text = new XSSFRichTextString(headers[i]);
cell.setCellValue(text);
cell.setCellStyle(cellStyle1);
// cell.setCellStyle(cellStyle1);
sheetItems.setColumnWidth(i, 20 * 256); // 设置单元格宽度
sheetItems.setDefaultColumnStyle(i, cellStyle);
}
// 在excel表中添加添加填写说明
String explanation = "";
@@ -2518,7 +2520,7 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
+ "1.Import data starts at the third line, the first line is the header, the second line is the description, the third line is the example, and the fourth line is the official data\n"
+ "2.All fields is filled in according to Validate Component and Component Value\n"
+ "3.If the control type is drop-down multi-selection, multiple entries are separated by English or Chinese exclamation points\n"
+ "4.Configuration data is filled in according to the control type, and if there are multiple control types, it needs to be separated by \"#\"\n"
+ "4.Configuration data is filled in according to the sequence of control type, and if there are multiple control types, it needs to be separated by \"#\"\n"
+ "5.When filling in, start in column G and do not modify information such as NIO number and parameter name\n"
+ "6.File fields are file type, must create a folder in the directory of the same level as the file with the name of the nio number and place the file in the folder. Assume that the file is saved in the A number B.pdf,Should fill in A/B.pdf\n"
+ "7.When importing into the system, you need to put the Excel into a folder, place other attachment files correctly as required, and finally compress the folder into zip format for import\n";
@@ -2527,7 +2529,7 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
+ "1.导入数据从第三行开始,第一行为表头,第二行为填写说明,第三行是示例数据,需要从第四行开始填写\n"
+ "2.填写时需按照控件校验和控件备选值进行填写\n"
+ "3.控件类型为下拉多选时,填写多个时采用英文或中文感叹号分割\n"
+ "4.配置数据按照控件类型进行填写,若存在多种控件类型填写时需要通过“#”隔开\n"
+ "4.配置数据按照控件类型顺序进行填写,若存在多种控件类型填写时需要通过“#”隔开\n"
+ "5.填写时从G列开始,请勿修改NIO编号和参数名称等信息\n"
+ "6.上传附件为文件属性,填写时需要在本文件同级目录下以NIO编号为名称建立文件夹,并在文件夹下放置文件且该文件夹下只能有一层级,假设在NIO.XXXX下放置了B.pdf,则应填写NIO.XXXX/B.pdf\n"
+ "7.导入系统时,需要将该Excel放入文件夹内,并按照要求正确放置其他附件文件,最后将文件夹压缩为zip格式进行导入\n";
@@ -2628,7 +2630,7 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
}
@Override
public Result<?> importDre(MultipartFile file, String cut, String paramsManifestId) throws IOException {
public Result<?> importDre(MultipartFile file, String cut, String paramsManifestId) {
//验证文件名是否合格
/* 截取后缀名 */
int pos = file.getOriginalFilename().lastIndexOf(".");
@@ -2806,7 +2808,7 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
MultipartFile multipartFile =
new MockMultipartFile(nowFileList.get(0).getName(), nowFileList.get(0).getName(), "text/plain", input);
//文件存入文件表
OSSFile ossFile = ossFileService.uploadLocalOfCos(multipartFile, "", null, null);
OSSFile ossFile = ossFileService.uploadLocalOfCos(multipartFile, "", null, cut);
if (ObjectUtils.isNotEmpty(ossFile)) {
String connectId = UUID.randomUUID().toString().replace("-", "");
OSSFile ossFileUpdate = new OSSFile();
@@ -3265,26 +3267,101 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
StringBuilder configDataBuilder = new StringBuilder(); // 重新组合配置数据
if (CollectionUtil.isNotEmpty(paramsConfigDataEOS)) {
ParamsConfigDataEO paramsConfigDataEO = paramsConfigDataEOS.get(0);
if (StringUtils.isNotEmpty(paramsConfigDataEO.getTextData())) {
configDataBuilder.append(paramsConfigDataEO.getTextData()).append("#");
}
if (StringUtils.isNotEmpty(paramsConfigDataEO.getPullData())) {
configDataBuilder.append(paramsConfigDataEO.getPullData().replaceAll(",", "")).append("#");
}
if (StringUtils.isNotEmpty(paramsConfigDataEO.getFileConnectId())) {
List<OSSFile> ossFileList = ossFileService.getFileInfosByConnectId(paramsConfigDataEO.getFileConnectId());
if (CollectionUtil.isNotEmpty(ossFileList)) {
configDataBuilder.append(nioNumber).append("/").append(ossFileList.get(0).getFileName()).append("#");
fileList.addAll(ossFileList);
if (ControlTypeEnum.TEXT.getValue().equals(controlType)) {
if (StringUtils.isNotEmpty(paramsConfigDataEO.getTextData())) {
configDataBuilder.append(paramsConfigDataEO.getTextData());
}
} else if (ControlTypeEnum.PULL_SINGLE.getValue().equals(controlType)
|| ControlTypeEnum.PULL_MORE.getValue().equals(controlType)) {
if (StringUtils.isNotEmpty(paramsConfigDataEO.getPullData())) {
configDataBuilder.append(paramsConfigDataEO.getPullData().replaceAll(",", ""));
}
} else if (ControlTypeEnum.FILE.getValue().equals(controlType)) {
if (StringUtils.isNotEmpty(paramsConfigDataEO.getFileConnectId())) {
List<OSSFile> ossFileList = ossFileService.getFileInfosByConnectId(paramsConfigDataEO.getFileConnectId());
if (CollectionUtil.isNotEmpty(ossFileList)) {
configDataBuilder.append(nioNumber).append("/").append(ossFileList.get(0).getFileName());
fileList.addAll(ossFileList);
}
}
} else if (ControlTypeEnum.TEXT_PULL_SINGLE.getValue().equals(controlType)
|| ControlTypeEnum.TEXT_PULL_MORE.getValue().equals(controlType)) {
if (StringUtils.isNotEmpty(paramsConfigDataEO.getTextData())) {
configDataBuilder.append(paramsConfigDataEO.getTextData());
}
configDataBuilder.append("#");
if (StringUtils.isNotEmpty(paramsConfigDataEO.getPullData())) {
configDataBuilder.append(paramsConfigDataEO.getPullData().replaceAll(",", ""));
}
} else if (ControlTypeEnum.TEXT_FILE.getValue().equals(controlType)) {
if (StringUtils.isNotEmpty(paramsConfigDataEO.getTextData())) {
configDataBuilder.append(paramsConfigDataEO.getTextData());
}
configDataBuilder.append("#");
if (StringUtils.isNotEmpty(paramsConfigDataEO.getFileConnectId())) {
List<OSSFile> ossFileList = ossFileService.getFileInfosByConnectId(paramsConfigDataEO.getFileConnectId());
if (CollectionUtil.isNotEmpty(ossFileList)) {
configDataBuilder.append(nioNumber).append("/").append(ossFileList.get(0).getFileName());
fileList.addAll(ossFileList);
}
}
} else if (ControlTypeEnum.PULL_SINGLE_FILE.getValue().equals(controlType)
|| ControlTypeEnum.PULL_MORE_FILE.getValue().equals(controlType)) {
if (StringUtils.isNotEmpty(paramsConfigDataEO.getPullData())) {
configDataBuilder.append(paramsConfigDataEO.getPullData().replaceAll(",", ""));
}
configDataBuilder.append("#");
if (StringUtils.isNotEmpty(paramsConfigDataEO.getFileConnectId())) {
List<OSSFile> ossFileList = ossFileService.getFileInfosByConnectId(paramsConfigDataEO.getFileConnectId());
if (CollectionUtil.isNotEmpty(ossFileList)) {
configDataBuilder.append(nioNumber).append("/").append(ossFileList.get(0).getFileName());
fileList.addAll(ossFileList);
}
}
} else if (ControlTypeEnum.TEXT_PULL_SINGLE_FILE.getValue().equals(controlType)) {
if (StringUtils.isNotEmpty(paramsConfigDataEO.getTextData())) {
configDataBuilder.append(paramsConfigDataEO.getTextData());
}
configDataBuilder.append("#");
if (StringUtils.isNotEmpty(paramsConfigDataEO.getPullData())) {
configDataBuilder.append(paramsConfigDataEO.getPullData().replaceAll(",", ""));
}
configDataBuilder.append("#");
if (StringUtils.isNotEmpty(paramsConfigDataEO.getFileConnectId())) {
List<OSSFile> ossFileList = ossFileService.getFileInfosByConnectId(paramsConfigDataEO.getFileConnectId());
if (CollectionUtil.isNotEmpty(ossFileList)) {
configDataBuilder.append(nioNumber).append("/").append(ossFileList.get(0).getFileName());
fileList.addAll(ossFileList);
}
}
}
}
String configData = configDataBuilder.toString();
if (configData.contains("#")) {
configData = configData.substring(0, configData.lastIndexOf("#"));
if (StringUtils.isNotEmpty(configData) && "".equals(configData.replace("#", ""))) {
configData = configData.replace("#", "");
}
record1.put(paramsConfigEO.getId(), configData);
@@ -3826,22 +3903,43 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
}
countError++;
} else {
if (value.split("#").length > 1) {
resultMap = validatePull(configMap.get(key), controlValues, value.split("#")[1], isMust, true, cut);
errorMsg += (String) resultMap.get("errorMsg");
countError += (int) resultMap.get("countError");
configDataEO.setPullData(value.split("#")[1]);
if (StringUtils.isNotEmpty(value)) {
if (countChar(value, "#") != 1) {
if (CutEnum.CN.getValue().equals(cut)) {
errorMsg += configMap.get(key) + "格式不正确;";
} else {
errorMsg += configMap.get(key) + " format is incorrect; ";
}
countError++;
} else {
if (value.split("#").length > 1) {
resultMap = validatePull(configMap.get(key), controlValues, value.split("#")[1], isMust, true, cut);
errorMsg += (String) resultMap.get("errorMsg");
countError += (int) resultMap.get("countError");
configDataEO.setPullData(value.split("#")[1]);
resultMap = validateText(configMap.get(key), controlVerify, value.split("#")[0], ParamsIsMustEnum.NO.getValue(), "1000", cut);
errorMsg += (String) resultMap.get("errorMsg");
countError += (int) resultMap.get("countError");
configDataEO.setTextData(value.split("#")[0]);
resultMap = validateText(configMap.get(key), controlVerify, value.split("#")[0], ParamsIsMustEnum.NO.getValue(), "1000", cut);
errorMsg += (String) resultMap.get("errorMsg");
countError += (int) resultMap.get("countError");
configDataEO.setTextData(value.split("#")[0]);
} else {
resultMap = validatePull(configMap.get(key), controlValues, value.split("#")[0], isMust, true, cut);
errorMsg += (String) resultMap.get("errorMsg");
countError += (int) resultMap.get("countError");
configDataEO.setPullData(value.split("#")[0]);
} else if (value.split("#").length == 1 && value.endsWith("#")) {
// 校验必填
if (IsMustEnum.YES.getValue().equals(isMust)) {
if (CutEnum.CN.getValue().equals(cut)) {
errorMsg += configMap.get(key) + "下拉单选为必填项,不能为空;";
} else {
errorMsg += configMap.get(key) + " is mandatory and cannot be empty; ";
}
countError++;
}
resultMap = validateText(configMap.get(key), controlVerify, value.split("#")[0], ParamsIsMustEnum.NO.getValue(), "1000", cut);
errorMsg += (String) resultMap.get("errorMsg");
countError += (int) resultMap.get("countError");
configDataEO.setTextData(value.split("#")[0]);
}
}
}
}
@@ -3855,21 +3953,42 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
}
countError++;
} else {
if (value.split("#").length > 1) {
resultMap = validatePull(configMap.get(key), controlValues, value.split("#")[1], isMust, false, cut);
errorMsg += (String) resultMap.get("errorMsg");
countError += (int) resultMap.get("countError");
configDataEO.setPullData(value.split("#")[1]);
if (StringUtils.isNotEmpty(value)) {
if (countChar(value, "#") != 1) {
if (CutEnum.CN.getValue().equals(cut)) {
errorMsg += configMap.get(key) + "格式不正确;";
} else {
errorMsg += configMap.get(key) + " format is incorrect; ";
}
countError++;
} else {
if (value.split("#").length > 1) {
resultMap = validatePull(configMap.get(key), controlValues, value.split("#")[1], isMust, false, cut);
errorMsg += (String) resultMap.get("errorMsg");
countError += (int) resultMap.get("countError");
configDataEO.setPullData(value.split("#")[1]);
resultMap = validateText(configMap.get(key), controlVerify, value.split("#")[0], ParamsIsMustEnum.NO.getValue(), "1000", cut);
errorMsg += (String) resultMap.get("errorMsg");
countError += (int) resultMap.get("countError");
configDataEO.setTextData(value.split("#")[0]);
} else {
resultMap = validatePull(configMap.get(key), controlValues, value.split("#")[0], isMust, false, cut);
errorMsg += (String) resultMap.get("errorMsg");
countError += (int) resultMap.get("countError");
configDataEO.setPullData(value.split("#")[0]);
resultMap = validateText(configMap.get(key), controlVerify, value.split("#")[0], ParamsIsMustEnum.NO.getValue(), "1000", cut);
errorMsg += (String) resultMap.get("errorMsg");
countError += (int) resultMap.get("countError");
configDataEO.setTextData(value.split("#")[0]);
} else if (value.split("#").length == 1 && value.endsWith("#")) {
// 校验必填
if (IsMustEnum.YES.getValue().equals(isMust)) {
if (CutEnum.CN.getValue().equals(cut)) {
errorMsg += configMap.get(key) + "下拉多选为必填项,不能为空;";
} else {
errorMsg += configMap.get(key) + " is mandatory and cannot be empty; ";
}
countError++;
}
resultMap = validateText(configMap.get(key), controlVerify, value.split("#")[0], ParamsIsMustEnum.NO.getValue(), "1000", cut);
errorMsg += (String) resultMap.get("errorMsg");
countError += (int) resultMap.get("countError");
configDataEO.setTextData(value.split("#")[0]);
}
}
}
}
@@ -3882,18 +4001,35 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
errorMsg += configMap.get(key) + " is mandatory and cannot be empty; ";
}
countError++;
} else {
resultMap = validateText(configMap.get(key), controlVerify, value.split("#")[0], isMust, "1000", cut);
errorMsg += (String) resultMap.get("errorMsg");
countError += (int) resultMap.get("countError");
configDataEO.setTextData(value.split("#")[0]);
}else {
if (StringUtils.isNotEmpty(value)) {
if (countChar(value, "#") != 1) {
if (CutEnum.CN.getValue().equals(cut)) {
errorMsg += configMap.get(key) + "格式不正确;";
} else {
errorMsg += configMap.get(key) + " format is incorrect; ";
}
countError++;
} else {
if (value.split("#").length > 1) {
resultMap = validateText(configMap.get(key), controlVerify, value.split("#")[0], isMust, "1000", cut);
errorMsg += (String) resultMap.get("errorMsg");
countError += (int) resultMap.get("countError");
configDataEO.setTextData(value.split("#")[0]);
if (value.split("#").length > 1) {
resultMap = validateFile(configMap.get(key), unzipfilepath, value.split("#")[1], ParamsIsMustEnum.NO.getValue(), cut);
errorMsg += (String) resultMap.get("errorMsg");
countError += (int) resultMap.get("countError");
configDataEO.setFileConnectId(value.split("#")[1]);
}
resultMap = validateFile(configMap.get(key), unzipfilepath, value.split("#")[1], ParamsIsMustEnum.NO.getValue(), cut);
errorMsg += (String) resultMap.get("errorMsg");
countError += (int) resultMap.get("countError");
configDataEO.setFileConnectId(value.split("#")[1]);
} else if (value.split("#").length == 1 && value.endsWith("#")) {
resultMap = validateText(configMap.get(key), controlVerify, value.split("#")[0], isMust, "1000", cut);
errorMsg += (String) resultMap.get("errorMsg");
countError += (int) resultMap.get("countError");
configDataEO.setTextData(value.split("#")[0]);
}
}
}
}
} else if (ControlTypeEnum.PULL_SINGLE_FILE.getValue().equals(controlType)) {
@@ -3906,16 +4042,32 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
}
countError++;
} else {
resultMap = validatePull(configMap.get(key), controlValues, value.split("#")[0], isMust, true, cut);
errorMsg += (String) resultMap.get("errorMsg");
countError += (int) resultMap.get("countError");
configDataEO.setPullData(value.split("#")[0]);
if (StringUtils.isNotEmpty(value)) {
if (countChar(value, "#") != 1) {
if (CutEnum.CN.getValue().equals(cut)) {
errorMsg += configMap.get(key) + "格式不正确;";
} else {
errorMsg += configMap.get(key) + " format is incorrect; ";
}
countError++;
} else {
if (value.split("#").length > 1) {
resultMap = validatePull(configMap.get(key), controlValues, value.split("#")[0], isMust, true, cut);
errorMsg += (String) resultMap.get("errorMsg");
countError += (int) resultMap.get("countError");
configDataEO.setPullData(value.split("#")[0]);
if (value.split("#").length > 1) {
resultMap = validateFile(configMap.get(key), unzipfilepath, value.split("#")[1], ParamsIsMustEnum.NO.getValue(), cut);
errorMsg += (String) resultMap.get("errorMsg");
countError += (int) resultMap.get("countError");
configDataEO.setFileConnectId(value.split("#")[1]);
resultMap = validateFile(configMap.get(key), unzipfilepath, value.split("#")[1], ParamsIsMustEnum.NO.getValue(), cut);
errorMsg += (String) resultMap.get("errorMsg");
countError += (int) resultMap.get("countError");
configDataEO.setFileConnectId(value.split("#")[1]);
} else if (value.split("#").length == 1 && value.endsWith("#")) {
resultMap = validatePull(configMap.get(key), controlValues, value.split("#")[0], isMust, true, cut);
errorMsg += (String) resultMap.get("errorMsg");
countError += (int) resultMap.get("countError");
configDataEO.setPullData(value.split("#")[0]);
}
}
}
}
@@ -3929,16 +4081,33 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
}
countError++;
} else {
resultMap = validatePull(configMap.get(key), controlValues, value.split("#")[0], isMust, false, cut);
errorMsg += (String) resultMap.get("errorMsg");
countError += (int) resultMap.get("countError");
configDataEO.setPullData(value.split("#")[0]);
if (StringUtils.isNotEmpty(value)) {
if (countChar(value, "#") != 1) {
if (CutEnum.CN.getValue().equals(cut)) {
errorMsg += configMap.get(key) + "格式不正确;";
} else {
errorMsg += configMap.get(key) + " format is incorrect; ";
}
countError++;
} else {
if (value.split("#").length > 1) {
resultMap = validatePull(configMap.get(key), controlValues, value.split("#")[0], isMust, false, cut);
errorMsg += (String) resultMap.get("errorMsg");
countError += (int) resultMap.get("countError");
configDataEO.setPullData(value.split("#")[0]);
if (value.split("#").length > 1) {
resultMap = validateFile(configMap.get(key), unzipfilepath, value.split("#")[1], ParamsIsMustEnum.NO.getValue(), cut);
errorMsg += (String) resultMap.get("errorMsg");
countError += (int) resultMap.get("countError");
configDataEO.setFileConnectId(value.split("#")[1]);
resultMap = validateFile(configMap.get(key), unzipfilepath, value.split("#")[1], ParamsIsMustEnum.NO.getValue(), cut);
errorMsg += (String) resultMap.get("errorMsg");
countError += (int) resultMap.get("countError");
configDataEO.setFileConnectId(value.split("#")[1]);
} else if (value.split("#").length == 1 && value.endsWith("#")) {
resultMap = validatePull(configMap.get(key), controlValues, value.split("#")[0], isMust, false, cut);
errorMsg += (String) resultMap.get("errorMsg");
countError += (int) resultMap.get("countError");
configDataEO.setPullData(value.split("#")[0]);
}
}
}
}
@@ -3952,28 +4121,51 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
}
countError++;
} else {
if (value.split("#").length > 1) {
resultMap = validatePull(configMap.get(key), controlValues, value.split("#")[1], isMust, true, cut);
errorMsg += (String) resultMap.get("errorMsg");
countError += (int) resultMap.get("countError");
configDataEO.setPullData(value.split("#")[1]);
if(StringUtils.isNotEmpty(value)) {
if (countChar(value, "#") != 2) {
if (CutEnum.CN.getValue().equals(cut)) {
errorMsg += configMap.get(key) + "格式不正确;";
} else {
errorMsg += configMap.get(key) + " format is incorrect; ";
}
countError++;
} else {
if (value.split("#").length > 1) {
resultMap = validatePull(configMap.get(key), controlValues, value.split("#")[1], isMust, true, cut);
errorMsg += (String) resultMap.get("errorMsg");
countError += (int) resultMap.get("countError");
configDataEO.setPullData(value.split("#")[1]);
resultMap = validateText(configMap.get(key), controlVerify, value.split("#")[0], ParamsIsMustEnum.NO.getValue(), "1000", cut);
errorMsg += (String) resultMap.get("errorMsg");
countError += (int) resultMap.get("countError");
configDataEO.setTextData(value.split("#")[0]);
resultMap = validateText(configMap.get(key), controlVerify, value.split("#")[0], ParamsIsMustEnum.NO.getValue(), "1000", cut);
errorMsg += (String) resultMap.get("errorMsg");
countError += (int) resultMap.get("countError");
configDataEO.setTextData(value.split("#")[0]);
if (value.split("#").length > 2) {
resultMap = validateFile(configMap.get(key), unzipfilepath, value.split("#")[2], ParamsIsMustEnum.NO.getValue(), cut);
errorMsg += (String) resultMap.get("errorMsg");
countError += (int) resultMap.get("countError");
configDataEO.setFileConnectId(value.split("#")[2]);
if (!value.endsWith("#")) { //3
resultMap = validateFile(configMap.get(key), unzipfilepath, value.split("#")[2], ParamsIsMustEnum.NO.getValue(), cut);
errorMsg += (String) resultMap.get("errorMsg");
countError += (int) resultMap.get("countError");
configDataEO.setFileConnectId(value.split("#")[2]);
}
} else if (value.split("#").length == 1 && value.endsWith("#")) {
// 校验必填
if (IsMustEnum.YES.getValue().equals(isMust)) {
if (CutEnum.CN.getValue().equals(cut)) {
errorMsg += configMap.get(key) + "下拉单选为必填项,不能为空;";
} else {
errorMsg += configMap.get(key) + " is mandatory and cannot be empty; ";
}
countError++;
}
resultMap = validateText(configMap.get(key), controlVerify, value.split("#")[0], ParamsIsMustEnum.NO.getValue(), "1000", cut);
errorMsg += (String) resultMap.get("errorMsg");
countError += (int) resultMap.get("countError");
configDataEO.setTextData(value.split("#")[0]);
}
}
} else {
resultMap = validatePull(configMap.get(key), controlValues, value.split("#")[0], isMust, false, cut);
errorMsg += (String) resultMap.get("errorMsg");
countError += (int) resultMap.get("countError");
configDataEO.setPullData(value.split("#")[0]);
}
}
@@ -4389,4 +4581,14 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
stringList.add("NIO-" + collectManifestEO.getNioNumber());
}
}
private int countChar(String str, String searchChar) {
int count = 0;
int origialLength = str.length();
str = str.replace(searchChar, "");
int newLength = str.length();
count = origialLength - newLength;
return count;
}
}
@@ -1348,7 +1348,18 @@ public class ParamsInfoEOServiceImpl extends ServiceImpl<ParamsInfoEOMapper, Par
|| ControlTypeEnum.TEXT_PULL_MORE.getValue().equals(controlType)
|| ControlTypeEnum.TEXT_PULL_SINGLE.getValue().equals(controlType)
|| ControlTypeEnum.TEXT_PULL_SINGLE_FILE.getValue().equals(controlType)) {
String controlValuesRegex = "^[^##!]*$";
if (StringUtils.isNotEmpty(controlValues) && !controlValues.matches(controlValuesRegex)) {
if(CutEnum.CN.getValue().equals(cut)) {
errorMsg += "控件备选值格式错误,不能包含中英文感叹号和井号;";
} else {
errorMsg += "Component Value formatting errors, can not chinese and English exclamation points and pound signs; ";
}
countError++;
}
resultMap = validateMustAndLength(controlValues, "控件备选值", "Component Value", IsMustEnum.YES.getValue(), "500", false, cut);
} else {
resultMap = validateMustAndLength(controlValues, "控件备选值", "Component Value", IsMustEnum.NO.getValue(), "500", false, cut);
dto.setControlValues(null);
@@ -10,13 +10,19 @@ import com.jero.modules.home.mapper.HomeFunctionModuleEOMapper;
import com.jero.modules.home.service.IHomeFunctionModuleEOService;
import com.alibaba.fastjson.JSONObject;
import com.jero.modules.system.entity.SysPermission;
import com.jero.modules.system.service.ISysPermissionService;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.shiro.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import java.util.stream.Collectors;
/**
* @Description: 功能模块
@@ -27,6 +33,9 @@ import java.util.UUID;
@Service
public class HomeFunctionModuleEOServiceImpl extends ServiceImpl<HomeFunctionModuleEOMapper, HomeFunctionModuleEO> implements IHomeFunctionModuleEOService {
@Autowired
private ISysPermissionService sysPermissionService;
/**
* 保存
*
@@ -103,22 +112,35 @@ public class HomeFunctionModuleEOServiceImpl extends ServiceImpl<HomeFunctionMod
public List<HomeFunctionModuleEO> queryList(String cut) {
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
//用户拥有权限的菜单
List<SysPermission> metaList = sysPermissionService.queryByUser(loginUser.getUsername());
//所有的图表(state=0)
LambdaQueryWrapper<HomeFunctionModuleEO> wrapper = new LambdaQueryWrapper<>();
wrapper.in(HomeFunctionModuleEO::getState,"0").isNull(HomeFunctionModuleEO::getCreateBy);
List<HomeFunctionModuleEO> homeFunctionModuleEOList = this.list(wrapper);
List<HomeFunctionModuleEO> homeFunctionModuleEOListTemp = new ArrayList<>();
if(ObjectUtils.isNotEmpty(homeFunctionModuleEOList)){
for (SysPermission sysPermission : metaList) {
List<HomeFunctionModuleEO> collect = homeFunctionModuleEOList.stream().filter(e -> e.getIconName().equals(sysPermission.getName())).collect(Collectors.toList());
if(ObjectUtils.isNotEmpty(collect)){
homeFunctionModuleEOListTemp.addAll(collect);
}
}
}
homeFunctionModuleEOListTemp = homeFunctionModuleEOListTemp.stream().distinct().collect(Collectors.toList());
//当前用户配置的图表
LambdaQueryWrapper<HomeFunctionModuleEO> wrapperTemp = new LambdaQueryWrapper<>();
wrapperTemp.in(HomeFunctionModuleEO::getCreateBy,loginUser.getUsername()).orderByAsc(HomeFunctionModuleEO::getState).orderByAsc(HomeFunctionModuleEO::getSort);
List<HomeFunctionModuleEO> homeFunctionModuleEOS = this.list(wrapperTemp);
if(homeFunctionModuleEOS.size() == 0){
if(CutEnum.EN.getValue().equals(cut)){
for (HomeFunctionModuleEO homeFunctionModuleEO : homeFunctionModuleEOList) {
for (HomeFunctionModuleEO homeFunctionModuleEO : homeFunctionModuleEOListTemp) {
homeFunctionModuleEO.setIconName(homeFunctionModuleEO.getIconNameEn());
}
}
return homeFunctionModuleEOList;
return homeFunctionModuleEOListTemp;
}else{
if(CutEnum.EN.getValue().equals(cut)){
for (HomeFunctionModuleEO homeFunctionModuleEO : homeFunctionModuleEOS) {
@@ -91,7 +91,7 @@ public class ProblemKnowledgeBaseCommentEOServiceImpl extends ServiceImpl<Proble
SysUser sysUser = sysUserService.getUserByName(createBy);
String contentCNNo = "您发布的问题知识库信息"+problemKnowledgeBaseEO.getTitle()+"有新评论,请注意查看.";
String contentENNo = "In the Q&A knowledge "+problemKnowledgeBaseEO.getTitle()+" you created, a new comment has been added. Please be reminded to check it out.";
String url = backUrl +"/problemknowledgeBase";
String url = backUrl +"/problemknowledgeBase?id="+problemKnowledgeBaseEO.getId();
String href = "<a href='"+url + "'"+ " target='_blank'>"+ problemKnowledgeBaseEO.getTitle() + "</a>";
String contentINfoCNNo = "您发布的问题知识库信息"+href+"有新评论,请注意查看.";
Binary file not shown.

After

Width:  |  Height:  |  Size: 914 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 469 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 563 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 674 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 899 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 996 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1000 B

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

@@ -100,7 +100,7 @@
{{item.targetMarket_dicText}}
</div>
<div class="content-box-button-text" v-if="item.showPermissions_dicText">
<a-icon type="eye" />
<a-icon type="eye"/>
{{item.showPermissions_dicText}}
</div>
<div class="content-box-button-text">
@@ -217,22 +217,17 @@
}
},
mounted() {
let serial_number = localStorage.getItem('serial_number')
let serial_number = this.$route.query.serial_number
if (serial_number) {
this.searchStr = serial_number
localStorage.removeItem('serial_number')
}
this.isTrue = true
let BaseQuery = localStorage.getItem('problemknowledgeBase')
let BaseQuery = this.$route.query.id
if (BaseQuery) {
let content = JSON.parse(BaseQuery)
if (content.id) {
this.isTrue = false
this.$nextTick(() => {
this.$refs.problemKnowledgeBaseListViewRef.getData(JSON.parse(JSON.stringify(content)))
})
}
localStorage.removeItem('problemknowledgeBase')
this.isTrue = false
this.$nextTick(() => {
this.$refs.problemKnowledgeBaseListViewRef.getData({ id: BaseQuery })
})
}
this.getList()
this.replacePage()
@@ -29,7 +29,14 @@
},
methods: {
callback(key) {
if (key == 'Country Card') {
if (this.$route.query.serial_number || this.$route.query.id) {
this.$router.push({
path: '/problemknowledgeBase'
})
}
}
this.tabModel = key
}
}
}
@@ -26,11 +26,11 @@
<a-icon type="codepen"/>
{{$t('DocumentSplitting')}}
</div>
<div @click="DocumentTranslationClick" v-has="'bussLog:translation'" class="operator-text-text"
:title="$t('DocumentTranslation')">
<a-icon type="file-pdf"/>
{{$t('DocumentTranslation')}}
</div>
<!-- <div @click="DocumentTranslationClick" v-has="'bussLog:translation'" class="operator-text-text"-->
<!-- :title="$t('DocumentTranslation')">-->
<!-- <a-icon type="file-pdf"/>-->
<!-- {{$t('DocumentTranslation')}}-->
<!-- </div>-->
<div @click="DocumentComparisonClick" v-has="'bussLog:comparison'" class="operator-text-text"
:title="$t('DocumentComparison')">
<a-icon type="wallet"/>
@@ -405,9 +405,12 @@
}
})
}
localStorage.setItem('serial_number',serial_number)
// localStorage.setItem('serial_number',serial_number)
let newUrl = this.$router.resolve({
path: '/problemknowledgeBase',
query: {
serial_number: serial_number
}
})
window.open(newUrl.href, '_blank')
},
@@ -466,7 +469,7 @@
} else if (fileSuffix == '.xlsx' || fileSuffix == '.xls') {
let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + fileQuery.id + fileSuffix)
window.open(url, '_blank')
}else if(fileSuffix == '.png' || fileSuffix == '.jpeg' || fileSuffix == '.gif' || fileSuffix == '.jpg'){
} else if (fileSuffix == '.png' || fileSuffix == '.jpeg' || fileSuffix == '.gif' || fileSuffix == '.jpg') {
let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadImgUrl + '/' + fileQuery.id + fileSuffix)
window.open(url, '_blank')
} else {
@@ -42,7 +42,7 @@
{{title && title.length > 18?title.slice(0,17)+'...':title}}
</span>
<template #overlay>
<a-menu v-if="$route.query.createBy == userData.username"
<a-menu v-if="$route.query.createBy == userData.username || administrators"
@click="({ key: menuKey }) => onContextMenuClick(treeKey, menuKey, record)">
<a-menu-item key="1" @click="orgAdd" v-has="'split:sarFileSplitMenu:add'">{{$t('newNode')}}
</a-menu-item>
@@ -67,19 +67,19 @@
</div>
<div class="table-operator">
<div class="operator-text" @click="handleCopyManage"
v-if="$route.query.createBy == userData.username"
v-if="$route.query.createBy == userData.username || administrators"
v-has="'split:sarFileSplitItems:copy'">
<a-icon type="copy"/>
{{ $t('copy') }}
</div>
<div class="operator-text" @click="handleAddManage"
v-if="$route.query.createBy == userData.username"
v-if="$route.query.createBy == userData.username || administrators"
v-has="'split:sarFileSplitItems:add'">
<a-icon type="plus"/>
{{ $t('add') }}
</div>
<div class="operator-text upload-split"
v-if="$route.query.createBy == userData.username"
v-if="$route.query.createBy == userData.username || administrators"
@click="handleImportManage" v-has="'split:sarFileSplitItems:import'">
<a-icon type="import" :rotate="-90" v-if="uploadMenuId===undefined||uploadMenuId===''"/>
{{ (uploadMenuId===''||uploadMenuId===undefined)? $t('import'):'' }}
@@ -94,25 +94,25 @@
{{ $t('export') }}
</div>
<div class="operator-text" @click="handleDownManage"
v-if="$route.query.createBy == userData.username"
v-if="$route.query.createBy == userData.username || administrators"
v-has="'split:sarFileSplitItems:template'">
<a-icon type="download"/>
{{ $t('TemplateDownload') }}
</div>
<div class="operator-text" @click="handleMergeManage"
v-if="$route.query.createBy == userData.username"
v-if="$route.query.createBy == userData.username || administrators"
v-has="'split:sarFileSplitItems:merge'">
<a-icon type="snippets"/>
{{ $t('MergerClause') }}
</div>
<div class="operator-text" @click="handleManage"
v-if="$route.query.createBy == userData.username"
v-if="$route.query.createBy == userData.username || administrators"
v-has="'split:sarFileSplitItems:set'">
<a-icon type="setting"/>
{{ $t('BatchSetting') }}
</div>
<div class="operator-text" @click="handleBatCancel"
v-if="$route.query.createBy == userData.username"
v-if="$route.query.createBy == userData.username || administrators"
v-has="'split:sarFileSplitItems:delete'">
<a-icon type="delete"/>
{{ $t('BatchDelete') }}
@@ -126,7 +126,7 @@
:OperationList="OperationList"
:infoId="$route.query.infoId"
:menuId="menuId"
:showAction="$route.query.createBy == userData.username ? true :false"
:showAction="$route.query.createBy == userData.username || administrators ? true :false"
@onSelectChange="onSelectChange"
@deleteClick="deleteClick"
@editClick="editClick"
@@ -320,7 +320,8 @@
parameter: {},
widthBrown: '',
creenWidth: document.body.clientWidth,
brownHeight: document.documentElement.clientHeight
brownHeight: document.documentElement.clientHeight,
administrators:false,
}
},
watch: {
@@ -357,6 +358,14 @@
this.userData = this.userInfo()
this.administrators = false
if (this.userInfo().userRoleList && this.userInfo().userRoleList.length > 0) {
this.userInfo().userRoleList.forEach(res => {
if (res.roleCode == 'admin') {
this.administrators = true
}
})
}
this.infoId = this.$route.query.infoId
console.log('info', this.$route.query)
this.loadMenuData()
@@ -176,7 +176,7 @@
})
},
checkedClick(item) {
localStorage.setItem('problemknowledgeBase',JSON.stringify(item))
// localStorage.setItem('problemknowledgeBase',JSON.stringify(item))
this.$router.push({
path: '/problemknowledgeBase',
query: {
@@ -113,7 +113,8 @@
if (this.idList && this.idList.length > 0) {
id = this.idList.join(',')
} else {
id = this.$route.query.id
id = this.$route.query.parentId ? this.$route.query.parentId : this.$route.query.id
// id = this.$route.query.id
}
getAction('project/projectLibraryBase/getProjectDetailsStatisticsCollectManifestLabel', {id:id}).then((res) => {
if (res.success) {
@@ -357,7 +357,7 @@
this.areaVisible = true
this.areaTitle = this.$t('editDetailList')
setTimeout(() => {
this.$refs.templateRef.editData(edit)
this.$refs.templateRef.editData(edit,1)
}, 50)
},
handleAdd() {
@@ -79,7 +79,7 @@
</div>
</a-col>
</a-row>
<a-row :gutter='24'>
<a-row :gutter='24' v-if='!this.num'>
<a-col :span='9'>
<div class="box-title-text">
<div class="title-text">
@@ -143,6 +143,7 @@
</a-spin>
<a-table
class='table-area'
v-if='!this.num'
ref='table'
size='middle'
rowKey='id'
@@ -156,6 +157,7 @@
</a-table>
<div class="page" style='display: flex;justify-content: flex-end; margin-bottom: 42px'>
<a-pagination
v-if='!this.num'
:show-total="total => $t('total')+` ${total} `+$t('strip')"
show-quick-jumper
show-size-changer
@@ -235,6 +237,7 @@
spinLoading: false,
confirmLoading: false,
selectedRowKeys: [],
num:'',
pageNo: 1,
pageSize: 10,
row: {}
@@ -321,8 +324,9 @@
this.newVisible = true
this.form = {}
},
editData(edit) {
editData(edit,num) {
// 编辑一行的数据
this.num = num
let query = JSON.parse(JSON.stringify(edit))
if (query.projectVersion) {
query.projectVersion = query.projectVersion.split(',')