add CutEnum 重命名为 LanguageEnum

This commit is contained in:
lijiarao
2023-08-18 13:38:55 +08:00
parent 72ae6d7cec
commit 8046654ad5
31 changed files with 340 additions and 361 deletions
@@ -1,37 +0,0 @@
package com.jero.common.constant.enums;
/**
* 中英文切换标识
* @description
* @date 2022/1/21 15:22
* @auth zhn
*/
public enum CutEnum {
CN("中文","cn"),
EN("英文","en");
String name;
String value;
private CutEnum(String name, String value) {
this.name = name;
this.value = value;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
}
@@ -0,0 +1,22 @@
package com.jero.common.constant.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* 中英文切换标识
* @description
* @date 2022/1/21 15:22
* @auth zhn
*/
@Getter
@AllArgsConstructor
public enum LanguageEnum {
/**
* 中文,英文
*/
CN("cn"), EN("en");
String value;
}
@@ -1,6 +1,7 @@
package com.jero.common.util; package com.jero.common.util;
import cn.hutool.extra.spring.SpringUtil; import cn.hutool.extra.spring.SpringUtil;
import com.jero.common.constant.enums.LanguageEnum;
import org.springframework.context.MessageSource; import org.springframework.context.MessageSource;
import org.springframework.context.i18n.LocaleContextHolder; import org.springframework.context.i18n.LocaleContextHolder;
@@ -15,8 +16,14 @@ public class MessageUtils {
* @param args 参数 * @param args 参数
* @return 获取国际化翻译值 * @return 获取国际化翻译值
*/ */
public static String message(String code, Object... args) { public static String getMessage(String code, Object... args) {
MessageSource messageSource = SpringUtil.getBean(MessageSource.class); MessageSource messageSource = SpringUtil.getBean(MessageSource.class);
return messageSource.getMessage(code, args, LocaleContextHolder.getLocale()); return messageSource.getMessage(code, args, LocaleContextHolder.getLocale());
} }
public static LanguageEnum getLanguage() {
String language = LocaleContextHolder.getLocale().getLanguage();
return LanguageEnum.EN.getValue().equals(language) ? LanguageEnum.EN : LanguageEnum.CN;
}
} }
@@ -2,7 +2,7 @@ package com.jero.modules.oss.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jero.common.constant.enums.CutEnum; import com.jero.common.constant.enums.LanguageEnum;
import com.jero.common.exception.JeroBootException; import com.jero.common.exception.JeroBootException;
import com.jero.common.system.vo.LoginUser; import com.jero.common.system.vo.LoginUser;
import com.jero.common.util.CommonUtils; import com.jero.common.util.CommonUtils;
@@ -104,7 +104,7 @@ public class OSSFileServiceImpl extends ServiceImpl<OSSFileMapper, OSSFile> impl
// long fileSize = mf.getSize() / 1024 / 1024; // long fileSize = mf.getSize() / 1024 / 1024;
// String originalFilename = mf.getOriginalFilename(); // String originalFilename = mf.getOriginalFilename();
// if (fileSize >= 100) { // if (fileSize >= 100) {
// if (cut.equals(CutEnum.CN.getValue())) { // if (cut.equals(LanguageEnum.CN.getValue())) {
// throw new JeroBootException(originalFilename + "文件大小超出100MB, 请压缩或降低文件质量!"); // throw new JeroBootException(originalFilename + "文件大小超出100MB, 请压缩或降低文件质量!");
// } else { // } else {
// throw new JeroBootException(originalFilename + "File size out 100MB, Please compress or reduce file quality!"); // throw new JeroBootException(originalFilename + "File size out 100MB, Please compress or reduce file quality!");
@@ -131,7 +131,7 @@ public class OSSFileServiceImpl extends ServiceImpl<OSSFileMapper, OSSFile> impl
if ("1".equals(state)) { if ("1".equals(state)) {
//固定文件 //固定文件
if (!fileTypeStr.contains(fileType)) { if (!fileTypeStr.contains(fileType)) {
if (cut.equals(CutEnum.CN.getValue())) { if (cut.equals(LanguageEnum.CN.getValue())) {
throw new JeroBootException("只能够上传pdf,word,excel类型的文件。请重新选择文件!"); throw new JeroBootException("只能够上传pdf,word,excel类型的文件。请重新选择文件!");
} else { } else {
throw new JeroBootException("Only upload pdf,word,excel type of file Please select the file again!"); throw new JeroBootException("Only upload pdf,word,excel type of file Please select the file again!");
@@ -139,7 +139,7 @@ public class OSSFileServiceImpl extends ServiceImpl<OSSFileMapper, OSSFile> impl
} }
} else { } else {
if (CommonUtils.limitFileSuffix(orgName, fileSuffixLimits)) { if (CommonUtils.limitFileSuffix(orgName, fileSuffixLimits)) {
if (cut.equals(CutEnum.CN.getValue())) { if (cut.equals(LanguageEnum.CN.getValue())) {
throw new JeroBootException("不能上传" + StringUtils.join(fileSuffixLimits, ",") + "类型的文件。请重新选择文件!"); throw new JeroBootException("不能上传" + StringUtils.join(fileSuffixLimits, ",") + "类型的文件。请重新选择文件!");
} else { } else {
throw new JeroBootException("Can't upload" + StringUtils.join(fileSuffixLimits, ",") + "type of file Please select the file again!"); throw new JeroBootException("Can't upload" + StringUtils.join(fileSuffixLimits, ",") + "type of file Please select the file again!");
@@ -159,7 +159,7 @@ public class OSSFileServiceImpl extends ServiceImpl<OSSFileMapper, OSSFile> impl
} }
} }
if (flag) { if (flag) {
if (cut.equals(CutEnum.CN.getValue())) { if (cut.equals(LanguageEnum.CN.getValue())) {
throw new JeroBootException("只能够上传pdf/word/excel/csv/ppt/txt/zip/rar/静态图片类型的文件。请重新选择文件!"); throw new JeroBootException("只能够上传pdf/word/excel/csv/ppt/txt/zip/rar/静态图片类型的文件。请重新选择文件!");
} else { } else {
throw new JeroBootException("Only upload pdf/word/excel/csv/ppt/txt/zip/rar/Static image type file. Please re select the file!"); throw new JeroBootException("Only upload pdf/word/excel/csv/ppt/txt/zip/rar/Static image type file. Please re select the file!");
@@ -237,7 +237,7 @@ public class OSSFileServiceImpl extends ServiceImpl<OSSFileMapper, OSSFile> impl
// long fileSize = mf.getSize() / 1024 / 1024; // long fileSize = mf.getSize() / 1024 / 1024;
// String originalFilename = mf.getOriginalFilename(); // String originalFilename = mf.getOriginalFilename();
// if (fileSize >= 100) { // if (fileSize >= 100) {
// if (cut.equals(CutEnum.CN.getValue())) { // if (cut.equals(LanguageEnum.CN.getValue())) {
// throw new JeroBootException(originalFilename + "文件大小超出100MB, 请压缩或降低文件质量!"); // throw new JeroBootException(originalFilename + "文件大小超出100MB, 请压缩或降低文件质量!");
// } else { // } else {
// throw new JeroBootException(originalFilename + "File size out 100MB, Please compress or reduce file quality!"); // throw new JeroBootException(originalFilename + "File size out 100MB, Please compress or reduce file quality!");
@@ -267,7 +267,7 @@ public class OSSFileServiceImpl extends ServiceImpl<OSSFileMapper, OSSFile> impl
if ("1".equals(state)) { if ("1".equals(state)) {
//固定文件 //固定文件
if (!fileTypeStr.contains(fileType)) { if (!fileTypeStr.contains(fileType)) {
if (cut.equals(CutEnum.CN.getValue())) { if (cut.equals(LanguageEnum.CN.getValue())) {
throw new JeroBootException("只能够上传pdf,word,excel类型的文件。请重新选择文件!"); throw new JeroBootException("只能够上传pdf,word,excel类型的文件。请重新选择文件!");
} else { } else {
throw new JeroBootException("Only upload pdf,word,excel type of file Please select the file again!"); throw new JeroBootException("Only upload pdf,word,excel type of file Please select the file again!");
@@ -278,7 +278,7 @@ public class OSSFileServiceImpl extends ServiceImpl<OSSFileMapper, OSSFile> impl
List<String> fileTypeStrTwoList = Arrays.asList(fileTypeStrTwo.split(",")); List<String> fileTypeStrTwoList = Arrays.asList(fileTypeStrTwo.split(","));
//固定文件 //固定文件
if (!fileTypeStrTwoList.contains(fileType)) { if (!fileTypeStrTwoList.contains(fileType)) {
if (cut.equals(CutEnum.CN.getValue())) { if (cut.equals(LanguageEnum.CN.getValue())) {
throw new JeroBootException("只能够上传.docx,.DOCX,.xlsx,.XLSX后缀类型的文件。请重新选择文件!"); throw new JeroBootException("只能够上传.docx,.DOCX,.xlsx,.XLSX后缀类型的文件。请重新选择文件!");
} else { } else {
throw new JeroBootException("Only upload .docx,.DOCX,.xlsx,.XLSX suffix type of file Please select the file again!"); throw new JeroBootException("Only upload .docx,.DOCX,.xlsx,.XLSX suffix type of file Please select the file again!");
@@ -286,7 +286,7 @@ public class OSSFileServiceImpl extends ServiceImpl<OSSFileMapper, OSSFile> impl
} }
} else { } else {
if (CommonUtils.limitFileSuffix(orgName, fileSuffixLimits)) { if (CommonUtils.limitFileSuffix(orgName, fileSuffixLimits)) {
if (cut.equals(CutEnum.CN.getValue())) { if (cut.equals(LanguageEnum.CN.getValue())) {
throw new JeroBootException("不能上传" + StringUtils.join(fileSuffixLimits, ",") + "类型的文件。请重新选择文件!"); throw new JeroBootException("不能上传" + StringUtils.join(fileSuffixLimits, ",") + "类型的文件。请重新选择文件!");
} else { } else {
throw new JeroBootException("Can't upload" + StringUtils.join(fileSuffixLimits, ",") + "type of file Please select the file again!"); throw new JeroBootException("Can't upload" + StringUtils.join(fileSuffixLimits, ",") + "type of file Please select the file again!");
@@ -308,7 +308,7 @@ public class OSSFileServiceImpl extends ServiceImpl<OSSFileMapper, OSSFile> impl
} }
} }
if (flag) { if (flag) {
if (cut.equals(CutEnum.CN.getValue())) { if (cut.equals(LanguageEnum.CN.getValue())) {
throw new JeroBootException("只能够上传pdf/word/excel/csv/ppt/txt/zip/rar/msg/gif/静态图片类型的文件。请重新选择文件!"); throw new JeroBootException("只能够上传pdf/word/excel/csv/ppt/txt/zip/rar/msg/gif/静态图片类型的文件。请重新选择文件!");
} else { } else {
throw new JeroBootException("Only upload pdf/word/excel/csv/ppt/txt/zip/rar/msg/gif/Static image type file. Please re select the file!"); throw new JeroBootException("Only upload pdf/word/excel/csv/ppt/txt/zip/rar/msg/gif/Static image type file. Please re select the file!");
@@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jero.common.constant.CommonConstant; import com.jero.common.constant.CommonConstant;
import com.jero.common.constant.FillRuleConstant; import com.jero.common.constant.FillRuleConstant;
import com.jero.common.constant.enums.CutEnum; import com.jero.common.constant.enums.LanguageEnum;
import com.jero.common.exception.JeroBootException; import com.jero.common.exception.JeroBootException;
import com.jero.common.util.FillRuleUtil; import com.jero.common.util.FillRuleUtil;
import com.jero.common.util.oConvertUtils; import com.jero.common.util.oConvertUtils;
@@ -257,9 +257,9 @@ public class SysCategoryServiceImpl extends ServiceImpl<SysCategoryMapper, SysCa
@Override @Override
public List<SysCategoryTreeVO> getSysCategoryTree(String flag, Map<String, Object> params) { public List<SysCategoryTreeVO> getSysCategoryTree(String flag, Map<String, Object> params) {
String cut = CutEnum.CN.getValue(); String cut = LanguageEnum.CN.getValue();
if(params != null){ if(params != null){
cut = ObjectUtil.isNotEmpty(params.get("cut")) ? (String) params.get("cut") : CutEnum.CN.getValue(); cut = ObjectUtil.isNotEmpty(params.get("cut")) ? (String) params.get("cut") : LanguageEnum.CN.getValue();
} }
try { try {
//只查询技术领域的technology_territory //只查询技术领域的technology_territory
@@ -2,7 +2,7 @@ package com.jero.modules.system.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.jero.common.constant.CommonConstant; import com.jero.common.constant.CommonConstant;
import com.jero.common.constant.enums.CutEnum; import com.jero.common.constant.enums.LanguageEnum;
import com.jero.modules.system.entity.SysDictItem; import com.jero.modules.system.entity.SysDictItem;
import com.jero.modules.system.mapper.SysDictItemMapper; import com.jero.modules.system.mapper.SysDictItemMapper;
import com.jero.modules.system.service.ISysDictItemService; import com.jero.modules.system.service.ISysDictItemService;
@@ -189,7 +189,7 @@ public class SysDictItemServiceImpl extends ServiceImpl<SysDictItemMapper, SysDi
return flag; return flag;
}).distinct().collect(Collectors.toList()); }).distinct().collect(Collectors.toList());
if(CollectionUtils.isNotEmpty(sysDictItemList)){ if(CollectionUtils.isNotEmpty(sysDictItemList)){
if(StringUtils.equals(cut, CutEnum.CN.getValue())){ if(StringUtils.equals(cut, LanguageEnum.CN.getValue())){
result = sysDictItemList.stream().filter(e -> { result = sysDictItemList.stream().filter(e -> {
boolean flag = false; boolean flag = false;
List<String> fieldValueStrList = Arrays.asList(fieldValues.split(",")); List<String> fieldValueStrList = Arrays.asList(fieldValues.split(","));
@@ -201,7 +201,7 @@ public class SysDictItemServiceImpl extends ServiceImpl<SysDictItemMapper, SysDi
} }
return flag; return flag;
}).map(SysDictItem::getItemText).collect(Collectors.joining(",")); }).map(SysDictItem::getItemText).collect(Collectors.joining(","));
}else if(StringUtils.equals(cut,CutEnum.EN.getValue())){ }else if(StringUtils.equals(cut, LanguageEnum.EN.getValue())){
result = sysDictItemList.stream().filter(e -> { result = sysDictItemList.stream().filter(e -> {
boolean flag = false; boolean flag = false;
List<String> fieldValueStrList = Arrays.asList(fieldValues.split(",")); List<String> fieldValueStrList = Arrays.asList(fieldValues.split(","));
@@ -237,7 +237,7 @@ public class SysDictItemServiceImpl extends ServiceImpl<SysDictItemMapper, SysDi
return flag; return flag;
}).distinct().collect(Collectors.toList()); }).distinct().collect(Collectors.toList());
if(CollectionUtils.isNotEmpty(sysDictItemList)){ if(CollectionUtils.isNotEmpty(sysDictItemList)){
if(StringUtils.equals(cut, CutEnum.CN.getValue())){ if(StringUtils.equals(cut, LanguageEnum.CN.getValue())){
result = sysDictItemList.stream().filter(e -> { result = sysDictItemList.stream().filter(e -> {
boolean flag = false; boolean flag = false;
List<String> fieldTextStrList = Arrays.asList(fieldTexts.split(",")); List<String> fieldTextStrList = Arrays.asList(fieldTexts.split(","));
@@ -249,7 +249,7 @@ public class SysDictItemServiceImpl extends ServiceImpl<SysDictItemMapper, SysDi
} }
return flag; return flag;
}).map(SysDictItem::getItemValue).collect(Collectors.joining(",")); }).map(SysDictItem::getItemValue).collect(Collectors.joining(","));
}else if(StringUtils.equals(cut,CutEnum.EN.getValue())){ }else if(StringUtils.equals(cut, LanguageEnum.EN.getValue())){
result = sysDictItemList.stream().filter(e -> { result = sysDictItemList.stream().filter(e -> {
boolean flag = false; boolean flag = false;
List<String> fieldTextStrList = Arrays.asList(fieldTexts.split(",")); List<String> fieldTextStrList = Arrays.asList(fieldTexts.split(","));
@@ -1,6 +1,6 @@
package com.jero.modules.system.util; package com.jero.modules.system.util;
import com.jero.common.constant.enums.CutEnum; import com.jero.common.constant.enums.LanguageEnum;
import com.jero.modules.system.entity.SysCategory; import com.jero.modules.system.entity.SysCategory;
import com.jero.modules.system.entity.SysCategoryTreeVO; import com.jero.modules.system.entity.SysCategoryTreeVO;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
@@ -30,9 +30,9 @@ public class TreeUtils {
sysCategoryTreeVO.setValue(sysCategory.getId()); sysCategoryTreeVO.setValue(sysCategory.getId());
sysCategoryTreeVO.setDictId(sysCategory.getSysDictId()); sysCategoryTreeVO.setDictId(sysCategory.getSysDictId());
String title = ""; String title = "";
if(MyStringUtils.equals(cut,CutEnum.CN.getValue())){ if(MyStringUtils.equals(cut, LanguageEnum.CN.getValue())){
title = sysCategory.getName(); title = sysCategory.getName();
}else if(MyStringUtils.equals(cut,CutEnum.EN.getValue())){ }else if(MyStringUtils.equals(cut, LanguageEnum.EN.getValue())){
title = sysCategory.getEnName(); title = sysCategory.getEnName();
} }
sysCategoryTreeVO.setTitle(title); sysCategoryTreeVO.setTitle(title);
@@ -53,9 +53,9 @@ public class TreeUtils {
sysCategoryTreeVO.setKey(sysCategory.getId()); sysCategoryTreeVO.setKey(sysCategory.getId());
sysCategoryTreeVO.setValue(sysCategory.getId()); sysCategoryTreeVO.setValue(sysCategory.getId());
sysCategoryTreeVO.setDictId(sysCategory.getSysDictId()); sysCategoryTreeVO.setDictId(sysCategory.getSysDictId());
if(CutEnum.CN.getValue().equals(cut)) { if(LanguageEnum.CN.getValue().equals(cut)) {
sysCategoryTreeVO.setTitle(sysCategory.getName()); sysCategoryTreeVO.setTitle(sysCategory.getName());
} else if (CutEnum.EN.getValue().equals(cut)) { } else if (LanguageEnum.EN.getValue().equals(cut)) {
sysCategoryTreeVO.setTitle(sysCategory.getEnName()); sysCategoryTreeVO.setTitle(sysCategory.getEnName());
} }
sysCategoryTreeVO.setParentId(sysCategory.getPid()); sysCategoryTreeVO.setParentId(sysCategory.getPid());
@@ -76,9 +76,9 @@ public class TreeUtils {
sysCategoryTreeVO.setKey(sysCategory.getId()); sysCategoryTreeVO.setKey(sysCategory.getId());
sysCategoryTreeVO.setValue(sysCategory.getId()); sysCategoryTreeVO.setValue(sysCategory.getId());
String title = ""; String title = "";
if(MyStringUtils.equals(cut,CutEnum.CN.getValue())){ if(MyStringUtils.equals(cut, LanguageEnum.CN.getValue())){
title = sysCategory.getName(); title = sysCategory.getName();
}else if(MyStringUtils.equals(cut,CutEnum.EN.getValue())){ }else if(MyStringUtils.equals(cut, LanguageEnum.EN.getValue())){
title = sysCategory.getEnName(); title = sysCategory.getEnName();
} }
sysCategoryTreeVO.setTitle(title); sysCategoryTreeVO.setTitle(title);
@@ -2,6 +2,7 @@ package com.jero.modules.activiti.controller;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import com.jero.common.api.vo.Result; import com.jero.common.api.vo.Result;
import com.jero.common.constant.enums.LanguageEnum;
import com.jero.common.util.MessageUtils; import com.jero.common.util.MessageUtils;
import com.jero.modules.activiti.service.ProcessService; import com.jero.modules.activiti.service.ProcessService;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
@@ -19,18 +20,14 @@ import org.activiti.engine.task.TaskQuery;
import org.apache.commons.io.IOUtils; import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.AntPathMatcher; import org.springframework.context.i18n.LocaleContextHolder;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import org.springframework.util.PathMatcher;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.ByteArrayInputStream; import java.io.ByteArrayInputStream;
import java.util.ArrayList; import java.util.*;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/** /**
@@ -219,8 +216,9 @@ public class AController {
} }
@GetMapping("test") @GetMapping("test")
public Result<String> getRedisTest(){ public Result<String> getRedisTest(){
String msg1 = MessageUtils.message("message"); String msg1 = MessageUtils.getMessage("message");
String msg2 = MessageUtils.message("message.operate.error","123456"); String msg2 = MessageUtils.getMessage("message.operate.error","123456");
LanguageEnum language = MessageUtils.getLanguage();
return Result.OK(msg1+"\n"+msg2) ; return Result.OK(msg1+"\n"+msg2) ;
} }
} }
@@ -4,7 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jero.common.constant.enums.CutEnum; import com.jero.common.constant.enums.LanguageEnum;
import com.jero.common.constant.enums.YesOrNoEnum; import com.jero.common.constant.enums.YesOrNoEnum;
import com.jero.common.exception.JeroBootException; import com.jero.common.exception.JeroBootException;
import com.jero.common.system.vo.LoginUser; import com.jero.common.system.vo.LoginUser;
@@ -173,7 +173,7 @@ public class OnlCgformCollectionServiceImpl extends ServiceImpl<OnlCgformCollect
map.put("sort", "true");//列表排序标识 map.put("sort", "true");//列表排序标识
} }
map.put("db_field_name", LineHumpUtil.lineToHump(onlCgformField.getDbFieldName()));//字段 map.put("db_field_name", LineHumpUtil.lineToHump(onlCgformField.getDbFieldName()));//字段
if (CutEnum.CN.getValue().equals(cut)) { if (LanguageEnum.CN.getValue().equals(cut)) {
map.put("db_field_txt", onlCgformField.getDbFieldTxt());//字段中文名 map.put("db_field_txt", onlCgformField.getDbFieldTxt());//字段中文名
} else { } else {
map.put("db_field_txt", onlCgformField.getDbFieldEnName());//字段英文名 map.put("db_field_txt", onlCgformField.getDbFieldEnName());//字段英文名
@@ -207,7 +207,7 @@ public class OnlCgformCollectionServiceImpl extends ServiceImpl<OnlCgformCollect
map.put("field_show_type", onlCgformField.getFieldShowType());//类型(判断是下拉还是输入框,等等) map.put("field_show_type", onlCgformField.getFieldShowType());//类型(判断是下拉还是输入框,等等)
map.put("dict_field", onlCgformField.getDictField()); //下拉类型的数据字典编码 map.put("dict_field", onlCgformField.getDictField()); //下拉类型的数据字典编码
map.put("db_field_name", LineHumpUtil.lineToHump(onlCgformField.getDbFieldName()));//字段 map.put("db_field_name", LineHumpUtil.lineToHump(onlCgformField.getDbFieldName()));//字段
if (CutEnum.CN.getValue().equals(cut)) { if (LanguageEnum.CN.getValue().equals(cut)) {
map.put("db_field_txt", onlCgformField.getDbFieldTxt());//字段中文名 map.put("db_field_txt", onlCgformField.getDbFieldTxt());//字段中文名
} else { } else {
map.put("db_field_txt", onlCgformField.getDbFieldEnName());//字段英文名 map.put("db_field_txt", onlCgformField.getDbFieldEnName());//字段英文名
@@ -320,7 +320,7 @@ public class OnlCgformCollectionServiceImpl extends ServiceImpl<OnlCgformCollect
String state = (String) data.get("state"); String state = (String) data.get("state");
for (SysDictItem sysDictItem : stateList) { for (SysDictItem sysDictItem : stateList) {
if(StringUtils.equals(state,sysDictItem.getItemValue())){ if(StringUtils.equals(state,sysDictItem.getItemValue())){
if(StringUtils.equals(cut,CutEnum.CN.getValue())){ if(StringUtils.equals(cut, LanguageEnum.CN.getValue())){
data.put("state",sysDictItem.getItemText()); data.put("state",sysDictItem.getItemText());
}else { }else {
data.put("state",sysDictItem.getEnName()); data.put("state",sysDictItem.getEnName());
@@ -7,7 +7,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jero.common.api.vo.Result; import com.jero.common.api.vo.Result;
import com.jero.common.aspect.annotation.AutoLog; import com.jero.common.aspect.annotation.AutoLog;
import com.jero.common.constant.enums.CutEnum; import com.jero.common.constant.enums.LanguageEnum;
import com.jero.common.system.base.controller.JeroController; import com.jero.common.system.base.controller.JeroController;
import com.jero.common.system.vo.LoginUser; import com.jero.common.system.vo.LoginUser;
import com.jero.generater.modules.online.cgform.entity.OnlCgformField; import com.jero.generater.modules.online.cgform.entity.OnlCgformField;
@@ -90,7 +90,7 @@ public class SarFileCompareInfoController extends JeroController<SarFileCompareI
private String getFileTypeText(String fileType, String cut) { private String getFileTypeText(String fileType, String cut) {
OnlCgformField fileTypeField = this.onlCgformFieldService.queryById(fileType); OnlCgformField fileTypeField = this.onlCgformFieldService.queryById(fileType);
if (ObjectUtil.isNotEmpty(fileTypeField)) { if (ObjectUtil.isNotEmpty(fileTypeField)) {
if (CutEnum.CN.getValue().equals(cut)) { if (LanguageEnum.CN.getValue().equals(cut)) {
return fileTypeField.getDbFieldTxt(); return fileTypeField.getDbFieldTxt();
} else { } else {
return fileTypeField.getDbFieldEnName(); return fileTypeField.getDbFieldEnName();
@@ -4,7 +4,7 @@ import com.aliyuncs.utils.IOUtils;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jero.common.constant.enums.CutEnum; import com.jero.common.constant.enums.LanguageEnum;
import com.jero.common.exception.JeroBootException; import com.jero.common.exception.JeroBootException;
import com.jero.common.util.MinioUtil; import com.jero.common.util.MinioUtil;
import com.jero.modules.compare.entity.*; import com.jero.modules.compare.entity.*;
@@ -268,7 +268,7 @@ public class SarFileCompareItemCommentServiceImpl extends ServiceImpl<SarFileCom
response.setContentType("application/force-download"); response.setContentType("application/force-download");
//创建工作表对象 //创建工作表对象
String sheetName = "对比结果"; String sheetName = "对比结果";
if (CutEnum.CN.getValue().equals(cut)) { if (LanguageEnum.CN.getValue().equals(cut)) {
sheetName = "对比结果"; sheetName = "对比结果";
} else { } else {
sheetName = "Comparing results"; sheetName = "Comparing results";
@@ -277,7 +277,7 @@ public class SarFileCompareItemCommentServiceImpl extends ServiceImpl<SarFileCom
HSSFPatriarch patriarch = (HSSFPatriarch) sheet.createDrawingPatriarch(); HSSFPatriarch patriarch = (HSSFPatriarch) sheet.createDrawingPatriarch();
// 创建头部 // 创建头部
String header = ""; String header = "";
if (CutEnum.CN.getValue().equals(cut)) { if (LanguageEnum.CN.getValue().equals(cut)) {
header = "所选标准,条款号,条款名称,条款内容,所选标准,条款号,条款名称,条款内容,评论"; header = "所选标准,条款号,条款名称,条款内容,所选标准,条款号,条款名称,条款内容,评论";
} else { } else {
header = "Selected Standard,Number,Title,Content,Selected Standard,Number,Title,Content,Comment"; header = "Selected Standard,Number,Title,Content,Selected Standard,Number,Title,Content,Comment";
@@ -407,7 +407,7 @@ public class SarFileCompareItemCommentServiceImpl extends ServiceImpl<SarFileCom
} }
if (includeComments || MyStringUtils.isEmpty(selectIds)) { if (includeComments || MyStringUtils.isEmpty(selectIds)) {
Row row = sheet.createRow(i); Row row = sheet.createRow(i);
if (CutEnum.CN.getValue().equals(cut)) { if (LanguageEnum.CN.getValue().equals(cut)) {
row.createCell(0).setCellValue("全文评论"); row.createCell(0).setCellValue("全文评论");
} else { } else {
row.createCell(0).setCellValue("The full text comments"); row.createCell(0).setCellValue("The full text comments");
@@ -463,7 +463,7 @@ public class SarFileCompareItemCommentServiceImpl extends ServiceImpl<SarFileCom
os.flush(); os.flush();
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
if (CutEnum.CN.getValue().equals(cut)) { if (LanguageEnum.CN.getValue().equals(cut)) {
throw new JeroBootException("下载文件失败"); throw new JeroBootException("下载文件失败");
} else { } else {
throw new JeroBootException("Failed to download file"); throw new JeroBootException("Failed to download file");
@@ -1,6 +1,6 @@
package com.jero.modules.docTranslation.enums; package com.jero.modules.docTranslation.enums;
import com.jero.common.constant.enums.CutEnum; import com.jero.common.constant.enums.LanguageEnum;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
/** /**
@@ -51,9 +51,9 @@ public enum ReleaseConditionEnum {
ReleaseConditionEnum[] values = values(); ReleaseConditionEnum[] values = values();
for (ReleaseConditionEnum releaseConditionEnum : values) { for (ReleaseConditionEnum releaseConditionEnum : values) {
if (releaseConditionEnum.value.equals(value)) { if (releaseConditionEnum.value.equals(value)) {
if(StringUtils.equals(cut, CutEnum.CN.getValue())){ if(StringUtils.equals(cut, LanguageEnum.CN.getValue())){
return releaseConditionEnum.cnName; return releaseConditionEnum.cnName;
}else if(StringUtils.equals(cut, CutEnum.EN.getValue())){ }else if(StringUtils.equals(cut, LanguageEnum.EN.getValue())){
return releaseConditionEnum.enName; return releaseConditionEnum.enName;
} }
} }
@@ -39,7 +39,6 @@ import com.jero.modules.document.utils.ReadPdfUtil;
import com.jero.modules.document.utils.ReadWordUtil; import com.jero.modules.document.utils.ReadWordUtil;
import com.jero.modules.document.vo.QueryConditionVO; import com.jero.modules.document.vo.QueryConditionVO;
import com.jero.modules.domain.entity.DomainUserRel; import com.jero.modules.domain.entity.DomainUserRel;
import com.jero.modules.domain.service.DomainUserRelService;
import com.jero.modules.domain.service.impl.DomainManageServiceImpl; import com.jero.modules.domain.service.impl.DomainManageServiceImpl;
import com.jero.modules.home.entity.HomeDocumentDynamicEO; import com.jero.modules.home.entity.HomeDocumentDynamicEO;
import com.jero.modules.home.service.IHomeDocumentDynamicEOService; import com.jero.modules.home.service.IHomeDocumentDynamicEOService;
@@ -399,7 +398,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
} }
} else { } else {
fieldList = fieldList.stream().filter(e -> YesOrNoEnum.YES.getValue().equals(MyStringUtils.valueOf(e.getIsQuery()))).collect(Collectors.toList()); fieldList = fieldList.stream().filter(e -> YesOrNoEnum.YES.getValue().equals(MyStringUtils.valueOf(e.getIsQuery()))).collect(Collectors.toList());
if(CutEnum.CN.getValue().equals(cut)){ if(LanguageEnum.CN.getValue().equals(cut)){
fieldList = fieldList.stream().filter(e->!"title_en".equals(e.getDbFieldName())).collect(Collectors.toList()); fieldList = fieldList.stream().filter(e->!"title_en".equals(e.getDbFieldName())).collect(Collectors.toList());
}else{ }else{
fieldList = fieldList.stream().filter(e->!"title".equals(e.getDbFieldName())).collect(Collectors.toList()); fieldList = fieldList.stream().filter(e->!"title".equals(e.getDbFieldName())).collect(Collectors.toList());
@@ -412,7 +411,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
List<SysCategoryTreeVO> sysCategoryTree = sysCategoryService.getSysCategoryTree(null,params); List<SysCategoryTreeVO> sysCategoryTree = sysCategoryService.getSysCategoryTree(null,params);
List<Map<String, Object>> list = new ArrayList<>(); List<Map<String, Object>> list = new ArrayList<>();
for (OnlCgformField onlCgformField : fieldList) { for (OnlCgformField onlCgformField : fieldList) {
if(CutEnum.CN.getValue().equals(cut)){ if(LanguageEnum.CN.getValue().equals(cut)){
if("title".equals(onlCgformField.getDbFieldName()) || "title_en".equals(onlCgformField.getDbFieldName())){ if("title".equals(onlCgformField.getDbFieldName()) || "title_en".equals(onlCgformField.getDbFieldName())){
onlCgformField.setDbFieldTxt("标题"); onlCgformField.setDbFieldTxt("标题");
} }
@@ -433,7 +432,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
map.put("field_show_type", onlCgformField.getFieldShowType());//类型(判断是下拉还是输入框,等等) map.put("field_show_type", onlCgformField.getFieldShowType());//类型(判断是下拉还是输入框,等等)
map.put("dict_field", onlCgformField.getDictField()); map.put("dict_field", onlCgformField.getDictField());
map.put("db_field_name", onlCgformField.getDbFieldName());//字段 map.put("db_field_name", onlCgformField.getDbFieldName());//字段
if (CutEnum.CN.getValue().equals(cut)) { if (LanguageEnum.CN.getValue().equals(cut)) {
map.put("db_field_txt", onlCgformField.getDbFieldTxt());//字段中文名 map.put("db_field_txt", onlCgformField.getDbFieldTxt());//字段中文名
} else { } else {
map.put("db_field_txt", onlCgformField.getDbFieldEnName());//字段英文名 map.put("db_field_txt", onlCgformField.getDbFieldEnName());//字段英文名
@@ -484,7 +483,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
map.put("type","tree"); map.put("type","tree");
} }
map.put("value",onlCgformField.getDbFieldName()); map.put("value",onlCgformField.getDbFieldName());
if(CutEnum.CN.getValue().equals(cut)){ if(LanguageEnum.CN.getValue().equals(cut)){
map.put("text",onlCgformField.getDbFieldTxt()); map.put("text",onlCgformField.getDbFieldTxt());
}else{ }else{
map.put("text",onlCgformField.getDbFieldEnName()); map.put("text",onlCgformField.getDbFieldEnName());
@@ -519,10 +518,10 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
fieldList = fieldList.stream().filter(e -> YesOrNoEnum.YES.getValue().equals(MyStringUtils.valueOf(e.getIsShowSearch()))).collect(Collectors.toList()); fieldList = fieldList.stream().filter(e -> YesOrNoEnum.YES.getValue().equals(MyStringUtils.valueOf(e.getIsShowSearch()))).collect(Collectors.toList());
} else { } else {
for (OnlCgformField onlCgformField : fieldList) { for (OnlCgformField onlCgformField : fieldList) {
if(CutEnum.EN.getValue().equals(cut) && "title".equals(onlCgformField.getDbFieldName())){ if(LanguageEnum.EN.getValue().equals(cut) && "title".equals(onlCgformField.getDbFieldName())){
onlCgformField.setDbFieldEnName("Title"); onlCgformField.setDbFieldEnName("Title");
break; break;
} else if(CutEnum.CN.getValue().equals(cut) && "title".equals(onlCgformField.getDbFieldName())){ } else if(LanguageEnum.CN.getValue().equals(cut) && "title".equals(onlCgformField.getDbFieldName())){
onlCgformField.setDbFieldTxt("标题"); onlCgformField.setDbFieldTxt("标题");
break; break;
} }
@@ -567,7 +566,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
// map.put("sort", "true");//列表排序标识 // map.put("sort", "true");//列表排序标识
// } // }
map.put("db_field_name", onlCgformField.getDbFieldName());//字段 map.put("db_field_name", onlCgformField.getDbFieldName());//字段
if (CutEnum.CN.getValue().equals(cut)) { if (LanguageEnum.CN.getValue().equals(cut)) {
map.put("db_field_txt", onlCgformField.getDbFieldTxt());//字段中文名 map.put("db_field_txt", onlCgformField.getDbFieldTxt());//字段中文名
} else { } else {
map.put("db_field_txt", onlCgformField.getDbFieldEnName());//字段英文名 map.put("db_field_txt", onlCgformField.getDbFieldEnName());//字段英文名
@@ -618,7 +617,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
List<Map<String, Object>> Results = new ArrayList<>(); List<Map<String, Object>> Results = new ArrayList<>();
Map<String, Object> mapTemp = new HashMap<>(); Map<String, Object> mapTemp = new HashMap<>();
String areaName = ""; String areaName = "";
if (CutEnum.CN.getValue().equals(cut)) { if (LanguageEnum.CN.getValue().equals(cut)) {
areaName = onlCgformAreaTemp.getShowArea(); areaName = onlCgformAreaTemp.getShowArea();
} else { } else {
areaName = onlCgformAreaTemp.getEnName(); areaName = onlCgformAreaTemp.getEnName();
@@ -643,7 +642,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
Results.add(map); Results.add(map);
} }
} }
if (CutEnum.CN.getValue().equals(cut)) { if (LanguageEnum.CN.getValue().equals(cut)) {
mapTemp.put(onlCgformAreaTemp.getShowArea(), Results); mapTemp.put(onlCgformAreaTemp.getShowArea(), Results);
} else { } else {
mapTemp.put(onlCgformAreaTemp.getEnName(), Results); mapTemp.put(onlCgformAreaTemp.getEnName(), Results);
@@ -688,7 +687,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
List<Map<String, Object>> Results = new ArrayList<>(); List<Map<String, Object>> Results = new ArrayList<>();
for (OnlCgformArea onlCgformAreaTemp : areaList) { for (OnlCgformArea onlCgformAreaTemp : areaList) {
String areaName = ""; String areaName = "";
if (CutEnum.CN.getValue().equals(cut)) { if (LanguageEnum.CN.getValue().equals(cut)) {
areaName = onlCgformAreaTemp.getShowArea(); areaName = onlCgformAreaTemp.getShowArea();
} else { } else {
areaName = onlCgformAreaTemp.getEnName(); areaName = onlCgformAreaTemp.getEnName();
@@ -715,7 +714,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
} }
Map<String,Object> fjdssMap = new HashMap<>(); Map<String,Object> fjdssMap = new HashMap<>();
fjdssMap.put("area","文本信息"); fjdssMap.put("area","文本信息");
if(StringUtils.equals(cut,CutEnum.CN.getValue())){ if(StringUtils.equals(cut, LanguageEnum.CN.getValue())){
fjdssMap.put("db_field_txt","分阶段实施详情"); fjdssMap.put("db_field_txt","分阶段实施详情");
}else { }else {
fjdssMap.put("db_field_txt","Details of the phased implementation"); fjdssMap.put("db_field_txt","Details of the phased implementation");
@@ -841,7 +840,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
for (OnlCgformArea onlCgformAreaTemp : areaList) { for (OnlCgformArea onlCgformAreaTemp : areaList) {
String areaName = ""; String areaName = "";
if (CutEnum.CN.getValue().equals(cut)) { if (LanguageEnum.CN.getValue().equals(cut)) {
areaName = onlCgformAreaTemp.getShowArea(); areaName = onlCgformAreaTemp.getShowArea();
} else { } else {
areaName = onlCgformAreaTemp.getEnName(); areaName = onlCgformAreaTemp.getEnName();
@@ -859,7 +858,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
// if (FieldTypeEnum.FILE.getValue().equals(fieldShowType)) { // if (FieldTypeEnum.FILE.getValue().equals(fieldShowType)) {
// Map<String, Object> menuMap1 = new HashMap<>(); // Map<String, Object> menuMap1 = new HashMap<>();
// menuMap1.put("pname",areaName); // menuMap1.put("pname",areaName);
// if (CutEnum.CN.getValue().equals(cut)) { // if (LanguageEnum.CN.getValue().equals(cut)) {
// menuMap1.put("name",onlCgformField.getDbFieldTxt()); // menuMap1.put("name",onlCgformField.getDbFieldTxt());
// } else { // } else {
// menuMap1.put("name",onlCgformField.getDbFieldEnName()); // menuMap1.put("name",onlCgformField.getDbFieldEnName());
@@ -941,7 +940,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
} }
for (OnlCgformArea onlCgformAreaTemp : areaList) { for (OnlCgformArea onlCgformAreaTemp : areaList) {
String areaName = ""; String areaName = "";
if (CutEnum.CN.getValue().equals(cut)) { if (LanguageEnum.CN.getValue().equals(cut)) {
areaName = onlCgformAreaTemp.getShowArea(); areaName = onlCgformAreaTemp.getShowArea();
} else { } else {
areaName = onlCgformAreaTemp.getEnName(); areaName = onlCgformAreaTemp.getEnName();
@@ -949,7 +948,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
Map<String, Object> mapTemp = new HashMap<>(); Map<String, Object> mapTemp = new HashMap<>();
List<Map<String, Object>> resultTemp = new ArrayList<>(); List<Map<String, Object>> resultTemp = new ArrayList<>();
List<OnlCgformField> fieldListTemp = fieldList.stream().filter(e -> onlCgformAreaTemp.getId().equals(e.getShowArea())).collect(Collectors.toList()); List<OnlCgformField> fieldListTemp = fieldList.stream().filter(e -> onlCgformAreaTemp.getId().equals(e.getShowArea())).collect(Collectors.toList());
if(CutEnum.CN.getValue().equals(cut)){ if(LanguageEnum.CN.getValue().equals(cut)){
fieldListTemp.removeIf(new Predicate<OnlCgformField>() { fieldListTemp.removeIf(new Predicate<OnlCgformField>() {
@Override @Override
public boolean test(OnlCgformField onlCgformField) { public boolean test(OnlCgformField onlCgformField) {
@@ -1082,7 +1081,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
resultTemp.add(map); resultTemp.add(map);
} }
} }
if (CutEnum.CN.getValue().equals(cut)) { if (LanguageEnum.CN.getValue().equals(cut)) {
areaName = onlCgformAreaTemp.getShowArea(); areaName = onlCgformAreaTemp.getShowArea();
mapTemp.put(areaName, resultTemp); mapTemp.put(areaName, resultTemp);
} else { } else {
@@ -1106,7 +1105,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
map.put(dict_field, dictField); map.put(dict_field, dictField);
map.put(db_field_name, dbFieldName2);//字段 map.put(db_field_name, dbFieldName2);//字段
if (StringUtils.isNotBlank(cut)) { if (StringUtils.isNotBlank(cut)) {
if (CutEnum.CN.getValue().equals(cut)) { if (LanguageEnum.CN.getValue().equals(cut)) {
map.put(db_field_txt, dbFieldTxt);//字段中文名 map.put(db_field_txt, dbFieldTxt);//字段中文名
} else { } else {
map.put(db_field_txt, dbFieldEnName);//字段中文名 map.put(db_field_txt, dbFieldEnName);//字段中文名
@@ -1302,8 +1301,8 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
List<Map<String, Object>> mapListTempEn = new ArrayList<>(); List<Map<String, Object>> mapListTempEn = new ArrayList<>();
StringBuilder fileTextAll = new StringBuilder(); StringBuilder fileTextAll = new StringBuilder();
try { try {
String cutCn = CutEnum.CN.getValue(); String cutCn = LanguageEnum.CN.getValue();
String cutEn = CutEnum.EN.getValue(); String cutEn = LanguageEnum.EN.getValue();
if (ossFileList.size() != 0) { if (ossFileList.size() != 0) {
Map<String, Object> mapBaseDateCn = new HashMap<>(); Map<String, Object> mapBaseDateCn = new HashMap<>();
Map<String, Object> mapBaseDateEn = new HashMap<>(); Map<String, Object> mapBaseDateEn = new HashMap<>();
@@ -1913,8 +1912,8 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
List<Map<String, Object>> mapListTempEn = new ArrayList<>(); List<Map<String, Object>> mapListTempEn = new ArrayList<>();
String fileTextAll = ""; String fileTextAll = "";
try { try {
String cutCn = CutEnum.CN.getValue(); String cutCn = LanguageEnum.CN.getValue();
String cutEn = CutEnum.EN.getValue(); String cutEn = LanguageEnum.EN.getValue();
if (fileInfos.size() != 0) { if (fileInfos.size() != 0) {
//编辑时,有修改文件的情况 //编辑时,有修改文件的情况
fileTextAll = updateEsInfo(map, searchFieldList, sbCn, sbEn, fileInfos, mapListTempCn, mapListTempEn, cutCn, cutEn); fileTextAll = updateEsInfo(map, searchFieldList, sbCn, sbEn, fileInfos, mapListTempCn, mapListTempEn, cutCn, cutEn);
@@ -2244,7 +2243,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
for (String s : value.split(",")) { for (String s : value.split(",")) {
List<SysDictItem> collect = stateDictItemList.stream().filter(e -> s.equals(e.getItemValue())).collect(Collectors.toList()); List<SysDictItem> collect = stateDictItemList.stream().filter(e -> s.equals(e.getItemValue())).collect(Collectors.toList());
if(collect.size() != 0){ if(collect.size() != 0){
if(CutEnum.CN.getValue().equals(cut)){ if(LanguageEnum.CN.getValue().equals(cut)){
sb.append(collect.get(0).getItemText()+","); sb.append(collect.get(0).getItemText()+",");
}else{ }else{
sb.append(collect.get(0).getEnName()+","); sb.append(collect.get(0).getEnName()+",");
@@ -3144,7 +3143,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
conditionSb.append(" and " + "serial_number" + " like concat(concat('%','" + serialNumber + "'),'%')"); conditionSb.append(" and " + "serial_number" + " like concat(concat('%','" + serialNumber + "'),'%')");
} }
if (StringUtils.isNotBlank(title)) { if (StringUtils.isNotBlank(title)) {
if (CutEnum.CN.getValue().equals((String) parameter.get("cut"))) { if (LanguageEnum.CN.getValue().equals((String) parameter.get("cut"))) {
conditionSb.append(" and " + "title" + " like concat(concat('%','" + title + "'),'%')"); conditionSb.append(" and " + "title" + " like concat(concat('%','" + title + "'),'%')");
} else { } else {
conditionSb.append(" and " + "title_en" + " like concat(concat('%','" + title + "'),'%')"); conditionSb.append(" and " + "title_en" + " like concat(concat('%','" + title + "'),'%')");
@@ -3195,7 +3194,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
.collect(Collectors.toList()); .collect(Collectors.toList());
List<SysDictItem> state = stateList.stream().filter(e -> e.getItemValue().equals(entry.getValue())).collect(Collectors.toList()); List<SysDictItem> state = stateList.stream().filter(e -> e.getItemValue().equals(entry.getValue())).collect(Collectors.toList());
if (state.size() != 0) { if (state.size() != 0) {
if (CutEnum.CN.getValue().equals((String) parameter.get("cut"))) { if (LanguageEnum.CN.getValue().equals((String) parameter.get("cut"))) {
entry.setValue(state.get(0).getItemText()); entry.setValue(state.get(0).getItemText());
} else { } else {
entry.setValue(state.get(0).getEnName()); entry.setValue(state.get(0).getEnName());
@@ -3212,7 +3211,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
String finalKey = key; String finalKey = key;
List<OnlCgformField> onlCgformFieldList = fieldList.stream().filter(e -> e.getDbFieldName().equals(finalKey)).collect(Collectors.toList()); List<OnlCgformField> onlCgformFieldList = fieldList.stream().filter(e -> e.getDbFieldName().equals(finalKey)).collect(Collectors.toList());
record1.put("text_info_id", onlCgformFieldList.get(0).getId()); record1.put("text_info_id", onlCgformFieldList.get(0).getId());
if (CutEnum.CN.getValue().equals((String) parameter.get("cut"))) { if (LanguageEnum.CN.getValue().equals((String) parameter.get("cut"))) {
record1.put("text_info", onlCgformFieldList.get(0).getDbFieldTxt()); record1.put("text_info", onlCgformFieldList.get(0).getDbFieldTxt());
} else { } else {
record1.put("text_info", onlCgformFieldList.get(0).getDbFieldEnName()); record1.put("text_info", onlCgformFieldList.get(0).getDbFieldEnName());
@@ -3282,7 +3281,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
List<String> fileIdLidt = new ArrayList<>(); List<String> fileIdLidt = new ArrayList<>();
for (Map<String,Object> record : records) { for (Map<String,Object> record : records) {
//处理标题 //处理标题
if(CutEnum.EN.getValue().equals(cut)){ if(LanguageEnum.EN.getValue().equals(cut)){
record.put("title",record.get("title_en")); record.put("title",record.get("title_en"));
} }
Map<String, Object> record1 = (Map) record; Map<String, Object> record1 = (Map) record;
@@ -3590,9 +3589,9 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
.collect(Collectors.toList()); .collect(Collectors.toList());
if (dictItems.size() != 0) { if (dictItems.size() != 0) {
List<String> itemText = new ArrayList<>(); List<String> itemText = new ArrayList<>();
if (CutEnum.CN.getValue().equals(cut)) { if (LanguageEnum.CN.getValue().equals(cut)) {
itemText = dictItems.stream().map(SysDictItem::getItemText).collect(Collectors.toList()); itemText = dictItems.stream().map(SysDictItem::getItemText).collect(Collectors.toList());
} else if(CutEnum.EN.getValue().equals(cut)) { } else if(LanguageEnum.EN.getValue().equals(cut)) {
itemText = dictItems.stream().map(SysDictItem::getEnName).collect(Collectors.toList()); itemText = dictItems.stream().map(SysDictItem::getEnName).collect(Collectors.toList());
}else if("1".equals(flag)){ }else if("1".equals(flag)){
itemText = dictItems.stream().map(SysDictItem::getEnName).collect(Collectors.toList()); itemText = dictItems.stream().map(SysDictItem::getEnName).collect(Collectors.toList());
@@ -3610,9 +3609,9 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
if (onlCgformFieldList.size() != 0 && StringUtils.isNotBlank(onlCgformFieldList.get(0).getDictField())) { if (onlCgformFieldList.size() != 0 && StringUtils.isNotBlank(onlCgformFieldList.get(0).getDictField())) {
if(FieldTypeEnum.PULL_SINGLE.getValue().equals(onlCgformFieldList.get(0).getFieldShowType()) if(FieldTypeEnum.PULL_SINGLE.getValue().equals(onlCgformFieldList.get(0).getFieldShowType())
|| FieldTypeEnum.PULL_MORE.getValue().equals(onlCgformFieldList.get(0).getFieldShowType())){ || FieldTypeEnum.PULL_MORE.getValue().equals(onlCgformFieldList.get(0).getFieldShowType())){
if (CutEnum.CN.getValue().equals(cut)) { if (LanguageEnum.CN.getValue().equals(cut)) {
entry.setValue(StringUtils.join(dictItemsCh, ",")); entry.setValue(StringUtils.join(dictItemsCh, ","));
} else if(CutEnum.EN.getValue().equals(cut)){ } else if(LanguageEnum.EN.getValue().equals(cut)){
entry.setValue(StringUtils.join(dictItemsEn, ",")); entry.setValue(StringUtils.join(dictItemsEn, ","));
}else if("1".equals(flag)){ }else if("1".equals(flag)){
entry.setValue(StringUtils.join(dictItemsEn, ",")); entry.setValue(StringUtils.join(dictItemsEn, ","));
@@ -3648,9 +3647,9 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
.collect(Collectors.toList()); .collect(Collectors.toList());
if (dictItems.size() != 0) { if (dictItems.size() != 0) {
List<String> itemText = new ArrayList<>(); List<String> itemText = new ArrayList<>();
if (CutEnum.CN.getValue().equals(cut)) { if (LanguageEnum.CN.getValue().equals(cut)) {
itemText = dictItems.stream().map(SysDictItem::getItemText).collect(Collectors.toList()); itemText = dictItems.stream().map(SysDictItem::getItemText).collect(Collectors.toList());
} else if(CutEnum.EN.getValue().equals(cut)) { } else if(LanguageEnum.EN.getValue().equals(cut)) {
itemText = dictItems.stream().map(SysDictItem::getEnName).collect(Collectors.toList()); itemText = dictItems.stream().map(SysDictItem::getEnName).collect(Collectors.toList());
}else if("2".equals(flagTemp)){ }else if("2".equals(flagTemp)){
itemText = dictItems.stream().map(SysDictItem::getItemText).collect(Collectors.toList()); itemText = dictItems.stream().map(SysDictItem::getItemText).collect(Collectors.toList());
@@ -3668,9 +3667,9 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
if (onlCgformFieldList.size() != 0 && StringUtils.isNotBlank(onlCgformFieldList.get(0).getDictField())) { if (onlCgformFieldList.size() != 0 && StringUtils.isNotBlank(onlCgformFieldList.get(0).getDictField())) {
if(FieldTypeEnum.PULL_SINGLE.getValue().equals(onlCgformFieldList.get(0).getFieldShowType()) if(FieldTypeEnum.PULL_SINGLE.getValue().equals(onlCgformFieldList.get(0).getFieldShowType())
|| FieldTypeEnum.PULL_MORE.getValue().equals(onlCgformFieldList.get(0).getFieldShowType())){ || FieldTypeEnum.PULL_MORE.getValue().equals(onlCgformFieldList.get(0).getFieldShowType())){
if (CutEnum.CN.getValue().equals(cut)) { if (LanguageEnum.CN.getValue().equals(cut)) {
entry.setValue(StringUtils.join(dictItemsCh, ",")); entry.setValue(StringUtils.join(dictItemsCh, ","));
} else if(CutEnum.EN.getValue().equals(cut)){ } else if(LanguageEnum.EN.getValue().equals(cut)){
entry.setValue(StringUtils.join(dictItemsEn, ",")); entry.setValue(StringUtils.join(dictItemsEn, ","));
}else if("2".equals(flagTemp)){ }else if("2".equals(flagTemp)){
entry.setValue(StringUtils.join(dictItemsEn, ",")); entry.setValue(StringUtils.join(dictItemsEn, ","));
@@ -3796,7 +3795,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
if (!"file".equals(flag)) { if (!"file".equals(flag)) {
fieldListTemp = fieldListTemp.stream().filter(e -> !FieldTypeEnum.FILE.getValue().equals(e.getFieldShowType())).collect(Collectors.toList()); fieldListTemp = fieldListTemp.stream().filter(e -> !FieldTypeEnum.FILE.getValue().equals(e.getFieldShowType())).collect(Collectors.toList());
} }
if (CutEnum.CN.getValue().equals(cut)) { if (LanguageEnum.CN.getValue().equals(cut)) {
headerFieldList = fieldListTemp.stream().map(OnlCgformField::getDbFieldTxt).collect(Collectors.toList()); headerFieldList = fieldListTemp.stream().map(OnlCgformField::getDbFieldTxt).collect(Collectors.toList());
} else { } else {
headerFieldList = fieldListTemp.stream().map(OnlCgformField::getDbFieldEnName).collect(Collectors.toList()); headerFieldList = fieldListTemp.stream().map(OnlCgformField::getDbFieldEnName).collect(Collectors.toList());
@@ -3906,7 +3905,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
fis.close(); fis.close();
} }
} catch (IOException e) { } catch (IOException e) {
if(CutEnum.CN.getValue().equals(cut)){ if(LanguageEnum.CN.getValue().equals(cut)){
throw new JeroBootException("下载文件失败"); throw new JeroBootException("下载文件失败");
}else{ }else{
throw new JeroBootException("Failed to download file"); throw new JeroBootException("Failed to download file");
@@ -4145,7 +4144,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
try { try {
String cut = (String) map.get("cut"); String cut = (String) map.get("cut");
String sheetName = ""; String sheetName = "";
if(StringUtils.equals(cut,CutEnum.CN.getValue())){ if(StringUtils.equals(cut, LanguageEnum.CN.getValue())){
sheetName = "文档库导入模板"; sheetName = "文档库导入模板";
}else { }else {
sheetName = "Document LibraryImport Template"; sheetName = "Document LibraryImport Template";
@@ -4266,7 +4265,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
//第二行 //第二行
StringBuilder sbTwo = new StringBuilder(); StringBuilder sbTwo = new StringBuilder();
if(CutEnum.CN.getValue().equals(cut)){ if(LanguageEnum.CN.getValue().equals(cut)){
sbTwo.append("填写说明\n" + "1.导入数据从第三行开始,第一行为表头,第二行为填写说明,第三行是正式数据\n" + "2.所有带*号的字段必须填写\n"); sbTwo.append("填写说明\n" + "1.导入数据从第三行开始,第一行为表头,第二行为填写说明,第三行是正式数据\n" + "2.所有带*号的字段必须填写\n");
}else{ }else{
sbTwo.append("Filling explanation\n" sbTwo.append("Filling explanation\n"
@@ -4276,7 +4275,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
int count = 3; int count = 3;
if (pullSingleList.size() != 0) { if (pullSingleList.size() != 0) {
//单选 //单选
if(CutEnum.CN.getValue().equals(cut)){ if(LanguageEnum.CN.getValue().equals(cut)){
String pullSingle = StringUtils.join(pullSingleList, ",") + "字段是单选属性,必须和系统中的对应字段选项相匹配\n"; String pullSingle = StringUtils.join(pullSingleList, ",") + "字段是单选属性,必须和系统中的对应字段选项相匹配\n";
sbTwo.append(count++ + "." + pullSingle); sbTwo.append(count++ + "." + pullSingle);
}else{ }else{
@@ -4287,7 +4286,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
if (pullMoreList.size() != 0) { if (pullMoreList.size() != 0) {
//多选 //多选
if(CutEnum.CN.getValue().equals(cut)){ if(LanguageEnum.CN.getValue().equals(cut)){
String pullMore = StringUtils.join(pullMoreList, ",") + "字段是多选属性,必须和系统中的对应字段选项相匹配,填写多个时采用英文或中文逗号分割\n"; String pullMore = StringUtils.join(pullMoreList, ",") + "字段是多选属性,必须和系统中的对应字段选项相匹配,填写多个时采用英文或中文逗号分割\n";
sbTwo.append(count++ + "." + pullMore); sbTwo.append(count++ + "." + pullMore);
}else{ }else{
@@ -4297,7 +4296,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
} }
if (dateSingleList.size() != 0) { if (dateSingleList.size() != 0) {
//单选日期 //单选日期
if(CutEnum.CN.getValue().equals(cut)){ if(LanguageEnum.CN.getValue().equals(cut)){
String dateSingle = StringUtils.join(dateSingleList, ",") + "字段为日期,必须精确到日\n"; String dateSingle = StringUtils.join(dateSingleList, ",") + "字段为日期,必须精确到日\n";
sbTwo.append(count++ + "." + dateSingle); sbTwo.append(count++ + "." + dateSingle);
}else{ }else{
@@ -4307,7 +4306,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
} }
if (textStringList.size() != 0) { if (textStringList.size() != 0) {
//输入框 //输入框
if(CutEnum.CN.getValue().equals(cut)){ if(LanguageEnum.CN.getValue().equals(cut)){
String textString = StringUtils.join(textStringList, ",") + "字段为文本,填写文本内容\n"; String textString = StringUtils.join(textStringList, ",") + "字段为文本,填写文本内容\n";
sbTwo.append(count++ + "." + textString); sbTwo.append(count++ + "." + textString);
}else{ }else{
@@ -4317,7 +4316,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
} }
if (standardList.size() != 0) { if (standardList.size() != 0) {
//标准选择 //标准选择
if(CutEnum.CN.getValue().equals(cut)){ if(LanguageEnum.CN.getValue().equals(cut)){
String standard = StringUtils.join(standardList, ",") + "字段为标准号,填写多个时采用英文或中文逗号分割\n"; String standard = StringUtils.join(standardList, ",") + "字段为标准号,填写多个时采用英文或中文逗号分割\n";
sbTwo.append(count++ + "." + standard); sbTwo.append(count++ + "." + standard);
}else{ }else{
@@ -4327,7 +4326,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
} }
if (fileList.size() != 0) { if (fileList.size() != 0) {
//文件 //文件
if(CutEnum.CN.getValue().equals(cut)){ if(LanguageEnum.CN.getValue().equals(cut)){
String file = StringUtils.join(fileList, ",") + "字段为文件属性,填写时需要在本文件同级目录下以标准号为名称建立文件夹,并在文件夹下放置文件且该文件夹下只能有一层级,假设在AAA标准号下放置了B.pdf,则应填写AAA/B.pdf\n"; String file = StringUtils.join(fileList, ",") + "字段为文件属性,填写时需要在本文件同级目录下以标准号为名称建立文件夹,并在文件夹下放置文件且该文件夹下只能有一层级,假设在AAA标准号下放置了B.pdf,则应填写AAA/B.pdf\n";
sbTwo.append(count++ + "." + file); sbTwo.append(count++ + "." + file);
}else{ }else{
@@ -4337,7 +4336,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
} }
if(treeList.size() != 0){ if(treeList.size() != 0){
//树状结构 //树状结构
if(CutEnum.CN.getValue().equals(cut)){ if(LanguageEnum.CN.getValue().equals(cut)){
String tree = StringUtils.join(treeList, ",") + "字段为树状结构属性,填写时直接填写选中的数据,如需要选中车身,则直接填写车身,填写多个时采用英文或中文逗号分割\n"; String tree = StringUtils.join(treeList, ",") + "字段为树状结构属性,填写时直接填写选中的数据,如需要选中车身,则直接填写车身,填写多个时采用英文或中文逗号分割\n";
sbTwo.append(count++ + "." + tree); sbTwo.append(count++ + "." + tree);
}else{ }else{
@@ -4346,7 +4345,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
} }
} }
// //
if(CutEnum.CN.getValue().equals(cut)){ if(LanguageEnum.CN.getValue().equals(cut)){
String tree = "分阶段实施详情字段,多行之间使用#号分隔,列之间使用<n>标签分隔,示例:法规编号/条款<n>新车型<n>2000-10-10<n>备注#"; String tree = "分阶段实施详情字段,多行之间使用#号分隔,列之间使用<n>标签分隔,示例:法规编号/条款<n>新车型<n>2000-10-10<n>备注#";
sbTwo.append(count++ + "." + tree); sbTwo.append(count++ + "." + tree);
}else{ }else{
@@ -4424,7 +4423,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
Map<String, Object> map5 = new HashMap<>(); Map<String, Object> map5 = new HashMap<>();
if ("header".equals(flag)) { if ("header".equals(flag)) {
if (CutEnum.CN.getValue().equals(cut)) { if (LanguageEnum.CN.getValue().equals(cut)) {
//编号 //编号
map1.put("db_field_name", "serial_number");//字段 map1.put("db_field_name", "serial_number");//字段
map1.put("db_field_txt", "编号");//字段中文名 map1.put("db_field_txt", "编号");//字段中文名
@@ -4468,7 +4467,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
list.add(map5); list.add(map5);
} }
} else if ("condition".equals(flag)) { } else if ("condition".equals(flag)) {
if (CutEnum.CN.getValue().equals(cut)) { if (LanguageEnum.CN.getValue().equals(cut)) {
//编号 //编号
map1.put("db_field_name", "serial_number");//字段 map1.put("db_field_name", "serial_number");//字段
map1.put("db_field_txt", "编号");//字段中文名 map1.put("db_field_txt", "编号");//字段中文名
@@ -4515,7 +4514,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
Map<String, Object> map4 = new HashMap<>(); Map<String, Object> map4 = new HashMap<>();
if ("header".equals(flag)) { if ("header".equals(flag)) {
if (CutEnum.CN.getValue().equals(cut)) { if (LanguageEnum.CN.getValue().equals(cut)) {
//编号 //编号
map1.put("db_field_name", "serial_number");//字段 map1.put("db_field_name", "serial_number");//字段
map1.put("db_field_txt", "编号");//字段中文名 map1.put("db_field_txt", "编号");//字段中文名
@@ -4551,7 +4550,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
list.add(map4); list.add(map4);
} }
} else if ("condition".equals(flag)) { } else if ("condition".equals(flag)) {
if (CutEnum.CN.getValue().equals(cut)) { if (LanguageEnum.CN.getValue().equals(cut)) {
//编号 //编号
map1.put("db_field_name", "serial_number");//字段 map1.put("db_field_name", "serial_number");//字段
map1.put("db_field_txt", "编号");//字段中文名 map1.put("db_field_txt", "编号");//字段中文名
@@ -4704,9 +4703,9 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
List<SysCategory> sysCategoryList = categoryList.stream().filter(e -> idList.contains(e.getId())).collect(Collectors.toList()); List<SysCategory> sysCategoryList = categoryList.stream().filter(e -> idList.contains(e.getId())).collect(Collectors.toList());
List<String> nameList = sysCategoryList.stream().map(SysCategory::getName).collect(Collectors.toList()); List<String> nameList = sysCategoryList.stream().map(SysCategory::getName).collect(Collectors.toList());
List<String> nameEnList = sysCategoryList.stream().map(SysCategory::getEnName).collect(Collectors.toList()); List<String> nameEnList = sysCategoryList.stream().map(SysCategory::getEnName).collect(Collectors.toList());
if (CutEnum.CN.getValue().equals(cut)) { if (LanguageEnum.CN.getValue().equals(cut)) {
entry.setValue(StringUtils.join(nameList, ",")); entry.setValue(StringUtils.join(nameList, ","));
} else if(CutEnum.EN.getValue().equals(cut)){ } else if(LanguageEnum.EN.getValue().equals(cut)){
entry.setValue(StringUtils.join(nameEnList, ",")); entry.setValue(StringUtils.join(nameEnList, ","));
}else if("1".equals(flag)){ }else if("1".equals(flag)){
entry.setValue(StringUtils.join(nameEnList, ",")); entry.setValue(StringUtils.join(nameEnList, ","));
@@ -4732,9 +4731,9 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
List<SysCategory> sysCategoryList = categoryList.stream().filter(e -> idList.contains(e.getId())).collect(Collectors.toList()); List<SysCategory> sysCategoryList = categoryList.stream().filter(e -> idList.contains(e.getId())).collect(Collectors.toList());
List<String> nameList = sysCategoryList.stream().map(SysCategory::getName).collect(Collectors.toList()); List<String> nameList = sysCategoryList.stream().map(SysCategory::getName).collect(Collectors.toList());
List<String> nameEnList = sysCategoryList.stream().map(SysCategory::getEnName).collect(Collectors.toList()); List<String> nameEnList = sysCategoryList.stream().map(SysCategory::getEnName).collect(Collectors.toList());
if (CutEnum.CN.getValue().equals(cut)) { if (LanguageEnum.CN.getValue().equals(cut)) {
entry.setValue(StringUtils.join(nameList, ",")); entry.setValue(StringUtils.join(nameList, ","));
} else if(CutEnum.EN.getValue().equals(cut)){ } else if(LanguageEnum.EN.getValue().equals(cut)){
entry.setValue(StringUtils.join(nameEnList, ",")); entry.setValue(StringUtils.join(nameEnList, ","));
}else if("2".equals(flagTemp)){ }else if("2".equals(flagTemp)){
entry.setValue(StringUtils.join(nameList, ",")); entry.setValue(StringUtils.join(nameList, ","));
@@ -4753,7 +4752,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
String filenameorg = file.getOriginalFilename().substring(0, pos); String filenameorg = file.getOriginalFilename().substring(0, pos);
//判断上传文件必须是zip //判断上传文件必须是zip
if (!str.equals("zip") && !str.equals("rar")) { if (!str.equals("zip") && !str.equals("rar")) {
if(CutEnum.CN.getValue().equals(cut)){ if(LanguageEnum.CN.getValue().equals(cut)){
throw new JeroBootException("请上传zip格式的文件或rar格式的文件"); throw new JeroBootException("请上传zip格式的文件或rar格式的文件");
}else{ }else{
throw new JeroBootException("Please upload a zip file or rar file"); throw new JeroBootException("Please upload a zip file or rar file");
@@ -4780,7 +4779,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
if (length > 2) { if (length > 2) {
//删除原上传文件 //删除原上传文件
FileUnZip.deleteDir(saveDirectory); FileUnZip.deleteDir(saveDirectory);
if(CutEnum.CN.getValue().equals(cut)){ if(LanguageEnum.CN.getValue().equals(cut)){
throw new JeroBootException("压缩包中必须有且仅有一个文件夹,请重新上传"); throw new JeroBootException("压缩包中必须有且仅有一个文件夹,请重新上传");
}else{ }else{
throw new JeroBootException("There must be only one folder in the compressed package Please upload it again"); throw new JeroBootException("There must be only one folder in the compressed package Please upload it again");
@@ -4797,7 +4796,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
if (fileList.size() == 0) { if (fileList.size() == 0) {
//删除原上传文件 //删除原上传文件
FileUnZip.deleteDir(saveDirectory); FileUnZip.deleteDir(saveDirectory);
if(CutEnum.CN.getValue().equals(cut)){ if(LanguageEnum.CN.getValue().equals(cut)){
throw new JeroBootException("压缩包根目录下没有excel作为导入数据,请重新上传"); throw new JeroBootException("压缩包根目录下没有excel作为导入数据,请重新上传");
}else{ }else{
throw new JeroBootException("Excel does not exist in the root directory of the compressed package Please upload it again"); throw new JeroBootException("Excel does not exist in the root directory of the compressed package Please upload it again");
@@ -4806,7 +4805,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
} else if (fileList.size() > 1) { } else if (fileList.size() > 1) {
//删除原上传文件 //删除原上传文件
FileUnZip.deleteDir(saveDirectory); FileUnZip.deleteDir(saveDirectory);
if(CutEnum.CN.getValue().equals(cut)){ if(LanguageEnum.CN.getValue().equals(cut)){
throw new JeroBootException("压缩包根目录下仅能存在一个excel为导入数据,请重新上传"); throw new JeroBootException("压缩包根目录下仅能存在一个excel为导入数据,请重新上传");
}else{ }else{
throw new JeroBootException("Only one Excel file can be imported in the compressed package root directory. Please upload data again"); throw new JeroBootException("Only one Excel file can be imported in the compressed package root directory. Please upload data again");
@@ -4821,7 +4820,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
if (excelfilelist.size() < 1) { if (excelfilelist.size() < 1) {
//删除原上传文件 //删除原上传文件
FileUnZip.deleteDir(saveDirectory); FileUnZip.deleteDir(saveDirectory);
if(CutEnum.CN.getValue().equals(cut)){ if(LanguageEnum.CN.getValue().equals(cut)){
throw new JeroBootException("压缩包内没有上传Excel数据"); throw new JeroBootException("压缩包内没有上传Excel数据");
}else{ }else{
throw new JeroBootException("No Excel data is uploaded in the compressed package"); throw new JeroBootException("No Excel data is uploaded in the compressed package");
@@ -4830,7 +4829,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
} else if (excelfilelist.size() > 1) { } else if (excelfilelist.size() > 1) {
//删除原上传文件 //删除原上传文件
FileUnZip.deleteDir(saveDirectory); FileUnZip.deleteDir(saveDirectory);
if(CutEnum.CN.getValue().equals(cut)){ if(LanguageEnum.CN.getValue().equals(cut)){
throw new JeroBootException("压缩包内有多个Excel数据源"); throw new JeroBootException("压缩包内有多个Excel数据源");
}else{ }else{
throw new JeroBootException("There are multiple Excel data sources in the zip package"); throw new JeroBootException("There are multiple Excel data sources in the zip package");
@@ -4892,7 +4891,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
if (dataList.size() == 0) { if (dataList.size() == 0) {
//删除原上传文件 //删除原上传文件
FileUnZip.deleteDir(saveDirectory); FileUnZip.deleteDir(saveDirectory);
if(CutEnum.CN.getValue().equals(cut)){ if(LanguageEnum.CN.getValue().equals(cut)){
throw new JeroBootException("请填写必填字段内容,带*的为必填"); throw new JeroBootException("请填写必填字段内容,带*的为必填");
}else{ }else{
throw new JeroBootException("Please fill in the required fields marked with *"); throw new JeroBootException("Please fill in the required fields marked with *");
@@ -4913,7 +4912,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
workbook.close(); workbook.close();
//删除原上传文件 //删除原上传文件
FileUnZip.deleteDir(saveDirectory); FileUnZip.deleteDir(saveDirectory);
if(CutEnum.CN.getValue().equals(cut)){ if(LanguageEnum.CN.getValue().equals(cut)){
throw new JeroBootException("读取失败,请严格按照模板文件导入数据"); throw new JeroBootException("读取失败,请严格按照模板文件导入数据");
}else{ }else{
throw new JeroBootException("The data fails to be read. Import data strictly according to the template file"); throw new JeroBootException("The data fails to be read. Import data strictly according to the template file");
@@ -4944,14 +4943,14 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
String cut) { String cut) {
//树形数据字典 //树形数据字典
List<String> treeNameList = new ArrayList<>(); List<String> treeNameList = new ArrayList<>();
if(CutEnum.CN.getValue().equals(cut)){ if(LanguageEnum.CN.getValue().equals(cut)){
treeNameList = categoryList.stream().map(SysCategory::getName).collect(Collectors.toList()); treeNameList = categoryList.stream().map(SysCategory::getName).collect(Collectors.toList());
}else{ }else{
treeNameList = categoryList.stream().map(SysCategory::getEnName).collect(Collectors.toList()); treeNameList = categoryList.stream().map(SysCategory::getEnName).collect(Collectors.toList());
} }
//普通数据字典 //普通数据字典
List<String> itemNameList = new ArrayList<>(); List<String> itemNameList = new ArrayList<>();
if(CutEnum.CN.getValue().equals(cut)){ if(LanguageEnum.CN.getValue().equals(cut)){
itemNameList = dictItemList.stream().map(SysDictItem::getItemText).collect(Collectors.toList()); itemNameList = dictItemList.stream().map(SysDictItem::getItemText).collect(Collectors.toList());
}else{ }else{
itemNameList = dictItemList.stream().map(SysDictItem::getEnName).collect(Collectors.toList()); itemNameList = dictItemList.stream().map(SysDictItem::getEnName).collect(Collectors.toList());
@@ -4965,7 +4964,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
i++; i++;
int countError = 0; //记录失败数据数量 int countError = 0; //记录失败数据数量
String errorMsg = ""; String errorMsg = "";
if(CutEnum.CN.getValue().equals(cut)){ if(LanguageEnum.CN.getValue().equals(cut)){
errorMsg = "第" + i + "行:"; errorMsg = "第" + i + "行:";
} else { } else {
errorMsg = i + " line:"; errorMsg = i + " line:";
@@ -4988,7 +4987,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
PhasedImplementationDetailsEO phasedImplementationDetailsEO = new PhasedImplementationDetailsEO(); PhasedImplementationDetailsEO phasedImplementationDetailsEO = new PhasedImplementationDetailsEO();
String[] phasedImplDetailsArr = phasedImplDetails.split("<n>"); String[] phasedImplDetailsArr = phasedImplDetails.split("<n>");
if(phasedImplDetailsArr.length < 3){ if(phasedImplDetailsArr.length < 3){
if(CutEnum.CN.getValue().equals(cut)){ if(LanguageEnum.CN.getValue().equals(cut)){
errorMsg += "分阶段实施详情-必填项不能为空, "; errorMsg += "分阶段实施详情-必填项不能为空, ";
}else{ }else{
errorMsg += "Phased Implementation Details - Required items cannot be empty,"; errorMsg += "Phased Implementation Details - Required items cannot be empty,";
@@ -5000,14 +4999,14 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
if(phasedImplDetailsArr.length >= 1){ if(phasedImplDetailsArr.length >= 1){
String standNumberOrClause = phasedImplDetailsArr[0]; String standNumberOrClause = phasedImplDetailsArr[0];
if(StringUtils.isEmpty(standNumberOrClause)){ if(StringUtils.isEmpty(standNumberOrClause)){
if(CutEnum.CN.getValue().equals(cut)){ if(LanguageEnum.CN.getValue().equals(cut)){
errorMsg += "分阶段实施详情-法规编号/条款不能为空, "; errorMsg += "分阶段实施详情-法规编号/条款不能为空, ";
}else{ }else{
errorMsg += "Phased Implementation Details - Regulation No./clause cannot be empty,"; errorMsg += "Phased Implementation Details - Regulation No./clause cannot be empty,";
} }
countError++; countError++;
} else if (StringUtils.isNotBlank(standNumberOrClause) && standNumberOrClause.length() > 200) { } else if (StringUtils.isNotBlank(standNumberOrClause) && standNumberOrClause.length() > 200) {
if(CutEnum.CN.getValue().equals(cut)){ if(LanguageEnum.CN.getValue().equals(cut)){
errorMsg += "分阶段实施详情-法规编号/条款不能超过" + 200 + "个字符, "; errorMsg += "分阶段实施详情-法规编号/条款不能超过" + 200 + "个字符, ";
}else{ }else{
errorMsg += "Phased Implementation Details - Regulation No./clause Can not be more than " + 200 + " char, "; errorMsg += "Phased Implementation Details - Regulation No./clause Can not be more than " + 200 + " char, ";
@@ -5034,7 +5033,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
}).map(ImplementationTypeEnum::getItemValue).collect(Collectors.toList()); }).map(ImplementationTypeEnum::getItemValue).collect(Collectors.toList());
if(implementationTypeNameArr.length != implementationTypeList.size()){ if(implementationTypeNameArr.length != implementationTypeList.size()){
if(CutEnum.CN.getValue().equals(cut)){ if(LanguageEnum.CN.getValue().equals(cut)){
errorMsg += "分阶段实施详情-实施类型填写有误,填写值为'新车型 或 在产车', "; errorMsg += "分阶段实施详情-实施类型填写有误,填写值为'新车型 或 在产车', ";
}else{ }else{
errorMsg += "Phased Implementation Details - implementationType The value is set to 'New car model or Car in production', "; errorMsg += "Phased Implementation Details - implementationType The value is set to 'New car model or Car in production', ";
@@ -5044,7 +5043,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
phasedImplementationDetailsEO.setImplementationType(implementationTypeList.stream().collect(Collectors.joining(","))); phasedImplementationDetailsEO.setImplementationType(implementationTypeList.stream().collect(Collectors.joining(",")));
} }
}else { }else {
if(CutEnum.CN.getValue().equals(cut)){ if(LanguageEnum.CN.getValue().equals(cut)){
errorMsg += "分阶段实施详情-实施类型不能为空, "; errorMsg += "分阶段实施详情-实施类型不能为空, ";
}else{ }else{
errorMsg += "Phased Implementation Details - Implementation Type cannot be empty,"; errorMsg += "Phased Implementation Details - Implementation Type cannot be empty,";
@@ -5055,7 +5054,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
if(phasedImplDetailsArr.length >= 3){ if(phasedImplDetailsArr.length >= 3){
String implementationDateStr = phasedImplDetailsArr[2]; String implementationDateStr = phasedImplDetailsArr[2];
if(StringUtils.isEmpty(implementationDateStr)){ if(StringUtils.isEmpty(implementationDateStr)){
if(CutEnum.CN.getValue().equals(cut)){ if(LanguageEnum.CN.getValue().equals(cut)){
errorMsg += "分阶段实施详情-实施日期不能为空, "; errorMsg += "分阶段实施详情-实施日期不能为空, ";
}else{ }else{
errorMsg += "Phased Implementation Details - Implementation Date cannot be empty,"; errorMsg += "Phased Implementation Details - Implementation Date cannot be empty,";
@@ -5069,7 +5068,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
e.printStackTrace(); e.printStackTrace();
} }
if(implementationDate == null){ if(implementationDate == null){
if(CutEnum.CN.getValue().equals(cut)){ if(LanguageEnum.CN.getValue().equals(cut)){
errorMsg += "分阶段实施详情-实施日期格式错误,正确格式为'yyyy-MM-dd', "; errorMsg += "分阶段实施详情-实施日期格式错误,正确格式为'yyyy-MM-dd', ";
}else{ }else{
errorMsg += "Phased Implementation Details - implementationDate format is incorrect. The correct format is 'yyyy-MM-dd', "; errorMsg += "Phased Implementation Details - implementationDate format is incorrect. The correct format is 'yyyy-MM-dd', ";
@@ -5083,7 +5082,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
if(phasedImplDetailsArr.length >= 4){ if(phasedImplDetailsArr.length >= 4){
String remarks = phasedImplDetailsArr[3]; String remarks = phasedImplDetailsArr[3];
if (StringUtils.isNotBlank(remarks) && remarks.length() > 1000) { if (StringUtils.isNotBlank(remarks) && remarks.length() > 1000) {
if(CutEnum.CN.getValue().equals(cut)){ if(LanguageEnum.CN.getValue().equals(cut)){
errorMsg += "分阶段实施详情-备注不能超过" + 1000 + "个字符, "; errorMsg += "分阶段实施详情-备注不能超过" + 1000 + "个字符, ";
}else{ }else{
errorMsg += "Phased Implementation Details - ramarks Can not be more than " + 1000 + " char, "; errorMsg += "Phased Implementation Details - ramarks Can not be more than " + 1000 + " char, ";
@@ -5116,7 +5115,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
//树形 //树形
//判断是否必填 //判断是否必填
if (IsMustEnum.YES.getValue().equals(mustInput) && StringUtils.isBlank(value)) { if (IsMustEnum.YES.getValue().equals(mustInput) && StringUtils.isBlank(value)) {
if(CutEnum.CN.getValue().equals(cut)){ if(LanguageEnum.CN.getValue().equals(cut)){
errorMsg += key + "为必填项,不能为空, "; errorMsg += key + "为必填项,不能为空, ";
}else{ }else{
errorMsg += key + " This parameter is mandatory and cannot be empty, "; errorMsg += key + " This parameter is mandatory and cannot be empty, ";
@@ -5125,7 +5124,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
} }
//判断长度 //判断长度
if (StringUtils.isNotBlank(value) && value.length() > Long.parseLong(dbLength)) { if (StringUtils.isNotBlank(value) && value.length() > Long.parseLong(dbLength)) {
if(CutEnum.CN.getValue().equals(cut)){ if(LanguageEnum.CN.getValue().equals(cut)){
errorMsg += key + "不能超过" + dbLength + "个字符, "; errorMsg += key + "不能超过" + dbLength + "个字符, ";
}else{ }else{
errorMsg += key + " Can not be more than " + dbLength + " char, "; errorMsg += key + " Can not be more than " + dbLength + " char, ";
@@ -5136,7 +5135,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
if (StringUtils.isNotBlank(value)) { if (StringUtils.isNotBlank(value)) {
for (String valueTemp : value.split(",")) { for (String valueTemp : value.split(",")) {
if (!treeNameList.contains(valueTemp)) { if (!treeNameList.contains(valueTemp)) {
if(CutEnum.CN.getValue().equals(cut)){ if(LanguageEnum.CN.getValue().equals(cut)){
errorMsg += key + "中的" + valueTemp + "与数据字典不匹配, "; errorMsg += key + "中的" + valueTemp + "与数据字典不匹配, ";
}else{ }else{
errorMsg += key +" "+ valueTemp + " Does not match the data dictionary, "; errorMsg += key +" "+ valueTemp + " Does not match the data dictionary, ";
@@ -5151,7 +5150,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
for (String valueTemp : value.split(",")) { for (String valueTemp : value.split(",")) {
if (treeNameList.contains(valueTemp)) { if (treeNameList.contains(valueTemp)) {
List<SysCategory> collect = new ArrayList<>(); List<SysCategory> collect = new ArrayList<>();
if(CutEnum.CN.getValue().equals(cut)){ if(LanguageEnum.CN.getValue().equals(cut)){
collect = categoryList.stream().filter(e -> e.getName().equals(valueTemp)).collect(Collectors.toList()); collect = categoryList.stream().filter(e -> e.getName().equals(valueTemp)).collect(Collectors.toList());
}else{ }else{
collect = categoryList.stream().filter(e -> e.getEnName().equals(valueTemp)).collect(Collectors.toList()); collect = categoryList.stream().filter(e -> e.getEnName().equals(valueTemp)).collect(Collectors.toList());
@@ -5168,7 +5167,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
//输入框 //输入框
//判断是否必填 //判断是否必填
if (IsMustEnum.YES.getValue().equals(mustInput) && StringUtils.isBlank(value)) { if (IsMustEnum.YES.getValue().equals(mustInput) && StringUtils.isBlank(value)) {
if(CutEnum.CN.getValue().equals(cut)){ if(LanguageEnum.CN.getValue().equals(cut)){
errorMsg += key + "为必填项,不能为空, "; errorMsg += key + "为必填项,不能为空, ";
}else{ }else{
errorMsg += key + " This parameter is mandatory and cannot be empty, "; errorMsg += key + " This parameter is mandatory and cannot be empty, ";
@@ -5177,7 +5176,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
} }
//判断长度 //判断长度
if (StringUtils.isNotBlank(value) && value.length() > Long.parseLong(dbLength)) { if (StringUtils.isNotBlank(value) && value.length() > Long.parseLong(dbLength)) {
if(CutEnum.CN.getValue().equals(cut)){ if(LanguageEnum.CN.getValue().equals(cut)){
errorMsg += key + "不能超过" + dbLength + "个字符, "; errorMsg += key + "不能超过" + dbLength + "个字符, ";
}else{ }else{
errorMsg += key + " Can not be more than" + dbLength + "char, "; errorMsg += key + " Can not be more than" + dbLength + "char, ";
@@ -5193,7 +5192,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
//下拉单选 //下拉单选
//判断是否必填 //判断是否必填
if (IsMustEnum.YES.getValue().equals(mustInput) && StringUtils.isBlank(value)) { if (IsMustEnum.YES.getValue().equals(mustInput) && StringUtils.isBlank(value)) {
if(CutEnum.CN.getValue().equals(cut)){ if(LanguageEnum.CN.getValue().equals(cut)){
errorMsg += key + "为必填项,不能为空, "; errorMsg += key + "为必填项,不能为空, ";
}else{ }else{
errorMsg += key + " This parameter is mandatory and cannot be empty, "; errorMsg += key + " This parameter is mandatory and cannot be empty, ";
@@ -5202,7 +5201,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
} }
//判断长度 //判断长度
if (StringUtils.isNotBlank(value) && value.length() > Long.parseLong(dbLength)) { if (StringUtils.isNotBlank(value) && value.length() > Long.parseLong(dbLength)) {
if(CutEnum.CN.getValue().equals(cut)){ if(LanguageEnum.CN.getValue().equals(cut)){
errorMsg += key + "不能超过" + dbLength + "个字符, "; errorMsg += key + "不能超过" + dbLength + "个字符, ";
}else{ }else{
errorMsg += key + " Can not be more than" + dbLength + " char, "; errorMsg += key + " Can not be more than" + dbLength + " char, ";
@@ -5211,7 +5210,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
} }
//判断是否是单选 //判断是否是单选
if (StringUtils.isNotBlank(value) && value.contains(",")) { if (StringUtils.isNotBlank(value) && value.contains(",")) {
if(CutEnum.CN.getValue().equals(cut)){ if(LanguageEnum.CN.getValue().equals(cut)){
errorMsg += key + "为单选项, "; errorMsg += key + "为单选项, ";
}else{ }else{
errorMsg += key + " Is multiple choice, "; errorMsg += key + " Is multiple choice, ";
@@ -5222,7 +5221,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
//判断数据是否匹配 //判断数据是否匹配
if (StringUtils.isNotBlank(value)) { if (StringUtils.isNotBlank(value)) {
if (!itemNameList.contains(value)) { if (!itemNameList.contains(value)) {
if(CutEnum.CN.getValue().equals(cut)){ if(LanguageEnum.CN.getValue().equals(cut)){
errorMsg += key + "中的" + value + "与数据字典不匹配, "; errorMsg += key + "中的" + value + "与数据字典不匹配, ";
}else{ }else{
errorMsg += key + " " + value + " Does not match the data dictionary, "; errorMsg += key + " " + value + " Does not match the data dictionary, ";
@@ -5234,7 +5233,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
if (itemNameList.contains(value)) { if (itemNameList.contains(value)) {
String finalValue = value; String finalValue = value;
List<SysDictItem> collect = new ArrayList<>(); List<SysDictItem> collect = new ArrayList<>();
if(CutEnum.CN.getValue().equals(cut)){ if(LanguageEnum.CN.getValue().equals(cut)){
collect = dictItemList.stream().filter(e -> StringUtils.isNotBlank(e.getItemText()) && e.getItemText().equals(finalValue)).collect(Collectors.toList()); collect = dictItemList.stream().filter(e -> StringUtils.isNotBlank(e.getItemText()) && e.getItemText().equals(finalValue)).collect(Collectors.toList());
}else{ }else{
collect = dictItemList.stream().filter(e -> StringUtils.isNotBlank(e.getEnName()) && e.getEnName().equals(finalValue)).collect(Collectors.toList()); collect = dictItemList.stream().filter(e -> StringUtils.isNotBlank(e.getEnName()) && e.getEnName().equals(finalValue)).collect(Collectors.toList());
@@ -5246,7 +5245,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
} else if (FieldTypeEnum.PULL_MORE.getValue().equals(fieldShowType)) { } else if (FieldTypeEnum.PULL_MORE.getValue().equals(fieldShowType)) {
//判断是否必填 //判断是否必填
if (IsMustEnum.YES.getValue().equals(mustInput) && StringUtils.isBlank(value)) { if (IsMustEnum.YES.getValue().equals(mustInput) && StringUtils.isBlank(value)) {
if(CutEnum.CN.getValue().equals(cut)){ if(LanguageEnum.CN.getValue().equals(cut)){
errorMsg += key + "为必填项,不能为空, "; errorMsg += key + "为必填项,不能为空, ";
}else{ }else{
errorMsg += key + " This parameter is mandatory and cannot be empty, "; errorMsg += key + " This parameter is mandatory and cannot be empty, ";
@@ -5255,7 +5254,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
} }
//判断长度 //判断长度
if (StringUtils.isNotBlank(value) && value.length() > Long.parseLong(dbLength)) { if (StringUtils.isNotBlank(value) && value.length() > Long.parseLong(dbLength)) {
if(CutEnum.CN.getValue().equals(cut)){ if(LanguageEnum.CN.getValue().equals(cut)){
errorMsg += key + "不能超过" + dbLength + "个字符, "; errorMsg += key + "不能超过" + dbLength + "个字符, ";
}else{ }else{
errorMsg += key + " Can not be more than" + dbLength + " char, "; errorMsg += key + " Can not be more than" + dbLength + " char, ";
@@ -5266,7 +5265,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
if (StringUtils.isNotBlank(value)) { if (StringUtils.isNotBlank(value)) {
for (String valueTemp : value.split(",")) { for (String valueTemp : value.split(",")) {
if (!itemNameList.contains(valueTemp)) { if (!itemNameList.contains(valueTemp)) {
if(CutEnum.CN.getValue().equals(cut)){ if(LanguageEnum.CN.getValue().equals(cut)){
errorMsg += key + "中的" + valueTemp + "与数据字典不匹配, "; errorMsg += key + "中的" + valueTemp + "与数据字典不匹配, ";
}else{ }else{
errorMsg += key +" "+ valueTemp + " Does not match the data dictionary, "; errorMsg += key +" "+ valueTemp + " Does not match the data dictionary, ";
@@ -5282,7 +5281,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
for (String valueTemp : value.split(",")) { for (String valueTemp : value.split(",")) {
if (itemNameList.contains(valueTemp)) { if (itemNameList.contains(valueTemp)) {
List<SysDictItem> collect = new ArrayList<>(); List<SysDictItem> collect = new ArrayList<>();
if(CutEnum.CN.getValue().equals(cut)){ if(LanguageEnum.CN.getValue().equals(cut)){
collect = dictItemList.stream().filter(e -> StringUtils.isNotBlank(e.getItemText()) && e.getItemText().equals(valueTemp)).collect(Collectors.toList()); collect = dictItemList.stream().filter(e -> StringUtils.isNotBlank(e.getItemText()) && e.getItemText().equals(valueTemp)).collect(Collectors.toList());
}else{ }else{
collect = dictItemList.stream().filter(e -> StringUtils.isNotBlank(e.getEnName()) && e.getEnName().equals(valueTemp)).collect(Collectors.toList()); collect = dictItemList.stream().filter(e -> StringUtils.isNotBlank(e.getEnName()) && e.getEnName().equals(valueTemp)).collect(Collectors.toList());
@@ -5302,7 +5301,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
//单选日期 //单选日期
//判断是否必填 //判断是否必填
if (IsMustEnum.YES.getValue().equals(mustInput) && StringUtils.isBlank(value)) { if (IsMustEnum.YES.getValue().equals(mustInput) && StringUtils.isBlank(value)) {
if(CutEnum.CN.getValue().equals(cut)){ if(LanguageEnum.CN.getValue().equals(cut)){
errorMsg += key + "为必填项,不能为空, "; errorMsg += key + "为必填项,不能为空, ";
}else{ }else{
errorMsg += key + " This parameter is mandatory and cannot be empty, "; errorMsg += key + " This parameter is mandatory and cannot be empty, ";
@@ -5311,7 +5310,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
} }
//a判断是否是单日期选择 //a判断是否是单日期选择
if (StringUtils.isNotBlank(value) && value.contains(",")) { if (StringUtils.isNotBlank(value) && value.contains(",")) {
if(CutEnum.CN.getValue().equals(cut)){ if(LanguageEnum.CN.getValue().equals(cut)){
errorMsg += key + "为单日期选项, "; errorMsg += key + "为单日期选项, ";
}else{ }else{
errorMsg += key + " Is single date option, "; errorMsg += key + " Is single date option, ";
@@ -5320,7 +5319,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
} }
//判断格式是否正确 //判断格式是否正确
if (!DateUtils.isValidDate((String) value)) { if (!DateUtils.isValidDate((String) value)) {
if(CutEnum.CN.getValue().equals(cut)){ if(LanguageEnum.CN.getValue().equals(cut)){
errorMsg += key + "格式不正确, 正确格式如:yyyy/m/d、yyyy-MM-dd、yyyy年MM月dd日, "; errorMsg += key + "格式不正确, 正确格式如:yyyy/m/d、yyyy-MM-dd、yyyy年MM月dd日, ";
}else{ }else{
errorMsg += key + " Incorrect format correct format is:yyyy/m/d、yyyy-MM-dd、yyyy年MM月dd日, "; errorMsg += key + " Incorrect format correct format is:yyyy/m/d、yyyy-MM-dd、yyyy年MM月dd日, ";
@@ -5332,7 +5331,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
//多选日期 //多选日期
//判断是否必填 //判断是否必填
if (IsMustEnum.YES.getValue().equals(mustInput) && StringUtils.isBlank(value)) { if (IsMustEnum.YES.getValue().equals(mustInput) && StringUtils.isBlank(value)) {
if(CutEnum.CN.getValue().equals(cut)){ if(LanguageEnum.CN.getValue().equals(cut)){
errorMsg += key + "为必填项,不能为空, "; errorMsg += key + "为必填项,不能为空, ";
}else{ }else{
errorMsg += key + " This parameter is mandatory and cannot be empty, "; errorMsg += key + " This parameter is mandatory and cannot be empty, ";
@@ -5341,7 +5340,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
} }
//判断格式是否正确 //判断格式是否正确
if (!DateUtils.isValidDate((String) value)) { if (!DateUtils.isValidDate((String) value)) {
if(CutEnum.CN.getValue().equals(cut)){ if(LanguageEnum.CN.getValue().equals(cut)){
errorMsg += key + "格式不正确, 正确格式如:yyyy/m/d、yyyy-MM-dd、yyyy年MM月dd日, "; errorMsg += key + "格式不正确, 正确格式如:yyyy/m/d、yyyy-MM-dd、yyyy年MM月dd日, ";
}else{ }else{
errorMsg += key + " Incorrect format correct format is:yyyy/m/d、yyyy-MM-dd、yyyy年MM月dd日, "; errorMsg += key + " Incorrect format correct format is:yyyy/m/d、yyyy-MM-dd、yyyy年MM月dd日, ";
@@ -5354,7 +5353,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
//文件 //文件
//判断是否必填 //判断是否必填
if (IsMustEnum.YES.getValue().equals(mustInput) && StringUtils.isBlank(value)) { if (IsMustEnum.YES.getValue().equals(mustInput) && StringUtils.isBlank(value)) {
if(CutEnum.CN.getValue().equals(cut)){ if(LanguageEnum.CN.getValue().equals(cut)){
errorMsg += key + "为必填项,不能为空, "; errorMsg += key + "为必填项,不能为空, ";
}else{ }else{
errorMsg += key + " This parameter is mandatory and cannot be empty, "; errorMsg += key + " This parameter is mandatory and cannot be empty, ";
@@ -5363,7 +5362,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
} }
//判断长度 //判断长度
if (StringUtils.isNotBlank(value) && value.length() > Long.parseLong(dbLength)) { if (StringUtils.isNotBlank(value) && value.length() > Long.parseLong(dbLength)) {
if(CutEnum.CN.getValue().equals(cut)){ if(LanguageEnum.CN.getValue().equals(cut)){
errorMsg += key + "不能超过" + dbLength + "个字符, "; errorMsg += key + "不能超过" + dbLength + "个字符, ";
}else{ }else{
errorMsg += key + " Can not be more than " + dbLength + " char, "; errorMsg += key + " Can not be more than " + dbLength + " char, ";
@@ -5375,7 +5374,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
for (String fileName : value.split(",")) { for (String fileName : value.split(",")) {
List<File> nowFileList = FileUnZip.readFileByFilename(zipEntryName, fileName,cut,errorMsg,null,key,key); List<File> nowFileList = FileUnZip.readFileByFilename(zipEntryName, fileName,cut,errorMsg,null,key,key);
if (nowFileList.size() == 0) { if (nowFileList.size() == 0) {
if(CutEnum.CN.getValue().equals(cut)){ if(LanguageEnum.CN.getValue().equals(cut)){
errorMsg += key + " 压缩包中没有" + fileName + "文件, "; errorMsg += key + " 压缩包中没有" + fileName + "文件, ";
}else{ }else{
errorMsg += key + " Not in the zip package" + fileName + "file, "; errorMsg += key + " Not in the zip package" + fileName + "file, ";
@@ -5406,7 +5405,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
//标准选择 //标准选择
//判断是否必填 //判断是否必填
if (IsMustEnum.YES.getValue().equals(mustInput) && StringUtils.isBlank(value)) { if (IsMustEnum.YES.getValue().equals(mustInput) && StringUtils.isBlank(value)) {
if(CutEnum.CN.getValue().equals(cut)){ if(LanguageEnum.CN.getValue().equals(cut)){
errorMsg += key + "为必填项,不能为空, "; errorMsg += key + "为必填项,不能为空, ";
}else{ }else{
errorMsg += key + " This parameter is mandatory and cannot be empty, "; errorMsg += key + " This parameter is mandatory and cannot be empty, ";
@@ -5415,7 +5414,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
} }
//判断长度 //判断长度
if (StringUtils.isNotBlank(value) && value.length() > Long.parseLong(dbLength)) { if (StringUtils.isNotBlank(value) && value.length() > Long.parseLong(dbLength)) {
if(CutEnum.CN.getValue().equals(cut)){ if(LanguageEnum.CN.getValue().equals(cut)){
errorMsg += key + "不能超过" + dbLength + "个字符, "; errorMsg += key + "不能超过" + dbLength + "个字符, ";
}else{ }else{
errorMsg += key + " Can not be more than " + dbLength + " char, "; errorMsg += key + " Can not be more than " + dbLength + " char, ";
@@ -5661,7 +5660,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
for (String technologyTerritoryId : record.getTechnologyTerritory().split(",")) { for (String technologyTerritoryId : record.getTechnologyTerritory().split(",")) {
List<SysCategory> collect = categoryList.stream().filter(e -> e.getId().equals(technologyTerritoryId)).collect(Collectors.toList()); List<SysCategory> collect = categoryList.stream().filter(e -> e.getId().equals(technologyTerritoryId)).collect(Collectors.toList());
if(collect.size() != 0){ if(collect.size() != 0){
if(CutEnum.CN.getValue().equals(bussDocumentLibraryEO.getCut())){ if(LanguageEnum.CN.getValue().equals(bussDocumentLibraryEO.getCut())){
sb.append(collect.get(0).getName()+","); sb.append(collect.get(0).getName()+",");
}else{ }else{
sb.append(collect.get(0).getEnName()+","); sb.append(collect.get(0).getEnName()+",");
@@ -5741,7 +5740,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
} }
record1.put("technology_territory_id",technology_territory); record1.put("technology_territory_id",technology_territory);
if(StringUtils.equals(cut,CutEnum.EN.getValue())){ if(StringUtils.equals(cut, LanguageEnum.EN.getValue())){
if(record.containsKey("title") && record.containsKey("title_en")){ if(record.containsKey("title") && record.containsKey("title_en")){
record.put("title",record.get("title_en")); record.put("title",record.get("title_en"));
} }
@@ -5862,7 +5861,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
List<Map<String, Object>> mapList = this.listMaps(wrapper); List<Map<String, Object>> mapList = this.listMaps(wrapper);
String title = ""; String title = "";
if(mapList.size() != 0){ if(mapList.size() != 0){
if(CutEnum.CN.getValue().equals(cut)){ if(LanguageEnum.CN.getValue().equals(cut)){
title = mapList.get(0).get("serial_number") + "《"+ mapList.get(0).get("title") + "》"; title = mapList.get(0).get("serial_number") + "《"+ mapList.get(0).get("title") + "》";
}else{ }else{
title = mapList.get(0).get("serial_number") + "《"+ mapList.get(0).get("title_en") + "》"; title = mapList.get(0).get("serial_number") + "《"+ mapList.get(0).get("title_en") + "》";
@@ -1,7 +1,7 @@
package com.jero.modules.document.service.impl; package com.jero.modules.document.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jero.common.constant.enums.CutEnum; import com.jero.common.constant.enums.LanguageEnum;
import com.jero.modules.document.entity.PhasedImplementationDetailsEO; import com.jero.modules.document.entity.PhasedImplementationDetailsEO;
import com.jero.modules.document.enums.ImplementationTypeEnum; import com.jero.modules.document.enums.ImplementationTypeEnum;
import com.jero.modules.document.mapper.PhasedImplementationDetailsEOMapper; import com.jero.modules.document.mapper.PhasedImplementationDetailsEOMapper;
@@ -119,7 +119,7 @@ public class PhasedImplementationDetailsEOServiceImpl extends ServiceImpl<Phased
ImplementationTypeEnum[] implementationTypeEnums = ImplementationTypeEnum.values(); ImplementationTypeEnum[] implementationTypeEnums = ImplementationTypeEnum.values();
String implementationTypeText = ""; String implementationTypeText = "";
if(StringUtils.equals(cut, CutEnum.CN.getValue())){ if(StringUtils.equals(cut, LanguageEnum.CN.getValue())){
implementationTypeText = Arrays.stream(implementationTypeEnums).filter(implementationTypeEnum -> { implementationTypeText = Arrays.stream(implementationTypeEnums).filter(implementationTypeEnum -> {
boolean flag = false; boolean flag = false;
for (String type : implementationTypeArr) { for (String type : implementationTypeArr) {
@@ -5,7 +5,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jero.common.api.vo.Result; import com.jero.common.api.vo.Result;
import com.jero.common.aspect.annotation.AutoLog; import com.jero.common.aspect.annotation.AutoLog;
import com.jero.common.constant.enums.CutEnum; import com.jero.common.constant.enums.LanguageEnum;
import com.jero.common.system.base.controller.JeroController; import com.jero.common.system.base.controller.JeroController;
import com.jero.common.system.vo.LoginUser; import com.jero.common.system.vo.LoginUser;
import com.jero.common.util.MinioUtil; import com.jero.common.util.MinioUtil;
@@ -131,13 +131,13 @@ public class ExtRepoDataController extends JeroController<ExtRepoData, IExtRepoD
if ((Boolean)session.getAttribute("haveSuperiorManageAuth")) { if ((Boolean)session.getAttribute("haveSuperiorManageAuth")) {
log.info("对外报告数据表收到文件添加请求,开始处理文件:【" + sdf.format(new Date()) + "】"); log.info("对外报告数据表收到文件添加请求,开始处理文件:【" + sdf.format(new Date()) + "】");
int res = extRepoDataService.add(extRepoData); int res = extRepoDataService.add(extRepoData);
if (CutEnum.CN.getValue().equals(extRepoData.getCut())) { if (LanguageEnum.CN.getValue().equals(extRepoData.getCut())) {
result.success("添加成功:" + res + "条数据!"); result.success("添加成功:" + res + "条数据!");
} else { } else {
result.success(res + " pieces of data are added successfully!"); result.success(res + " pieces of data are added successfully!");
} }
} else { } else {
if (CutEnum.CN.getValue().equals(extRepoData.getCut())) { if (LanguageEnum.CN.getValue().equals(extRepoData.getCut())) {
result.error500("没有权限!"); result.error500("没有权限!");
} else { } else {
result.error500("You do not have permission !"); result.error500("You do not have permission !");
@@ -166,13 +166,13 @@ public class ExtRepoDataController extends JeroController<ExtRepoData, IExtRepoD
if (extRepoFolderService.isManager() || (Boolean)session.getAttribute("haveSuperiorManageAuth")) { if (extRepoFolderService.isManager() || (Boolean)session.getAttribute("haveSuperiorManageAuth")) {
extRepoData.setSupFolder(erd.getSupFolder()); extRepoData.setSupFolder(erd.getSupFolder());
extRepoDataService.editById(extRepoData); extRepoDataService.editById(extRepoData);
if (CutEnum.CN.getValue().equals(extRepoData.getCut())) { if (LanguageEnum.CN.getValue().equals(extRepoData.getCut())) {
result.success("编辑成功!"); result.success("编辑成功!");
} else { } else {
result.success("Data update successfully!"); result.success("Data update successfully!");
} }
} else { } else {
if (CutEnum.CN.getValue().equals(extRepoData.getCut())) { if (LanguageEnum.CN.getValue().equals(extRepoData.getCut())) {
result.error500("没有权限!"); result.error500("没有权限!");
} else { } else {
result.error500("You do not have permission !"); result.error500("You do not have permission !");
@@ -202,20 +202,20 @@ public class ExtRepoDataController extends JeroController<ExtRepoData, IExtRepoD
if (extRepoFolderService.isManager() || (Boolean)session.getAttribute("haveSuperiorManageAuth")) { if (extRepoFolderService.isManager() || (Boolean)session.getAttribute("haveSuperiorManageAuth")) {
extRepoDataService.deleteById(id); extRepoDataService.deleteById(id);
MinioUtil.delete(erd.getFileKey()); MinioUtil.delete(erd.getFileKey());
if (CutEnum.CN.getValue().equals(cut)) { if (LanguageEnum.CN.getValue().equals(cut)) {
result.success("删除成功!"); result.success("删除成功!");
} else { } else {
result.success("Data deletion successfully!"); result.success("Data deletion successfully!");
} }
} else { } else {
if (CutEnum.CN.getValue().equals(cut)) { if (LanguageEnum.CN.getValue().equals(cut)) {
result.error500("没有权限!"); result.error500("没有权限!");
} else { } else {
result.error500("You do not have permission!"); result.error500("You do not have permission!");
} }
} }
} else { } else {
if (CutEnum.CN.getValue().equals(cut)) { if (LanguageEnum.CN.getValue().equals(cut)) {
result.error500("删除失败!"); result.error500("删除失败!");
} else { } else {
result.error500("Delete failed!"); result.error500("Delete failed!");
@@ -242,7 +242,7 @@ public class ExtRepoDataController extends JeroController<ExtRepoData, IExtRepoD
for (String id : idsList) { for (String id : idsList) {
ExtRepoData erd = extRepoDataService.queryById(id); ExtRepoData erd = extRepoDataService.queryById(id);
if (null != erd && !extRepoFolderService.isManager() && !sysUser.getUsername().equals(erd.getCreateBy())) { if (null != erd && !extRepoFolderService.isManager() && !sysUser.getUsername().equals(erd.getCreateBy())) {
if (CutEnum.CN.getValue().equals(cut)) { if (LanguageEnum.CN.getValue().equals(cut)) {
result.error500("没有权限!"); result.error500("没有权限!");
} else { } else {
result.error500("You do not have permission!"); result.error500("You do not have permission!");
@@ -256,7 +256,7 @@ public class ExtRepoDataController extends JeroController<ExtRepoData, IExtRepoD
this.extRepoDataService.deleteById(id); this.extRepoDataService.deleteById(id);
} }
} }
if (CutEnum.CN.getValue().equals(cut)) { if (LanguageEnum.CN.getValue().equals(cut)) {
result.success("删除成功!"); result.success("删除成功!");
} else { } else {
result.success("Data deletion successfully!"); result.success("Data deletion successfully!");
@@ -3,7 +3,7 @@ package com.jero.modules.extRepo.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.jero.common.api.vo.Result; import com.jero.common.api.vo.Result;
import com.jero.common.aspect.annotation.AutoLog; import com.jero.common.aspect.annotation.AutoLog;
import com.jero.common.constant.enums.CutEnum; import com.jero.common.constant.enums.LanguageEnum;
import com.jero.common.exception.JeroBootException; import com.jero.common.exception.JeroBootException;
import com.jero.common.system.base.controller.JeroController; import com.jero.common.system.base.controller.JeroController;
import com.jero.modules.extRepo.entity.ERFTreeDataVO; import com.jero.modules.extRepo.entity.ERFTreeDataVO;
@@ -75,7 +75,7 @@ public class ExtRepoFolderController extends JeroController<ExtRepoFolder, IExtR
if (!extRepoFolder.isAddSub()) { if (!extRepoFolder.isAddSub()) {
//增加同级文件夹 //增加同级文件夹
if (!boo) { if (!boo) {
if (CutEnum.CN.getValue().equals(extRepoFolder.getCut())) { if (LanguageEnum.CN.getValue().equals(extRepoFolder.getCut())) {
throw new JeroBootException("无法创建同级文件夹!请联系管理员!"); throw new JeroBootException("无法创建同级文件夹!请联系管理员!");
} else { } else {
throw new JeroBootException("Unable to create a sibling folder ! Please Contact your administrator !"); throw new JeroBootException("Unable to create a sibling folder ! Please Contact your administrator !");
@@ -84,13 +84,13 @@ public class ExtRepoFolderController extends JeroController<ExtRepoFolder, IExtR
extRepoFolder.setSupFolder(folder.getSupFolder()); extRepoFolder.setSupFolder(folder.getSupFolder());
} }
extRepoFolderService.add(extRepoFolder); extRepoFolderService.add(extRepoFolder);
if (CutEnum.CN.getValue().equals(extRepoFolder.getCut())) { if (LanguageEnum.CN.getValue().equals(extRepoFolder.getCut())) {
result.success("添加成功!"); result.success("添加成功!");
} else { } else {
result.success("Data added successfully!"); result.success("Data added successfully!");
} }
} else { } else {
if (CutEnum.CN.getValue().equals(extRepoFolder.getCut())) { if (LanguageEnum.CN.getValue().equals(extRepoFolder.getCut())) {
result.error500("没有权限!"); result.error500("没有权限!");
} else { } else {
result.error500("You do not have permission !"); result.error500("You do not have permission !");
@@ -118,14 +118,14 @@ public class ExtRepoFolderController extends JeroController<ExtRepoFolder, IExtR
boolean boo = (Boolean)session.getAttribute("haveSuperiorManageAuth"); boolean boo = (Boolean)session.getAttribute("haveSuperiorManageAuth");
if (boo || extRepoFolderService.haveManageAuth(extRepoFolder.getId())) { if (boo || extRepoFolderService.haveManageAuth(extRepoFolder.getId())) {
if (!boo) { if (!boo) {
if (CutEnum.CN.getValue().equals(extRepoFolder.getCut())) { if (LanguageEnum.CN.getValue().equals(extRepoFolder.getCut())) {
return result.error500("无法创建同级文件夹!请联系管理员!"); return result.error500("无法创建同级文件夹!请联系管理员!");
} else { } else {
return result.error500("Unable to create a sibling folder ! Please Contact your administrator !"); return result.error500("Unable to create a sibling folder ! Please Contact your administrator !");
} }
} }
} else { } else {
if (CutEnum.CN.getValue().equals(extRepoFolder.getCut())) { if (LanguageEnum.CN.getValue().equals(extRepoFolder.getCut())) {
return result.error500("没有权限!"); return result.error500("没有权限!");
} else { } else {
return result.error500("You do not have permission !"); return result.error500("You do not have permission !");
@@ -149,13 +149,13 @@ public class ExtRepoFolderController extends JeroController<ExtRepoFolder, IExtR
extRepoFolderService.haveSuperiorManageAuth(extRepoFolder.getId(),session); extRepoFolderService.haveSuperiorManageAuth(extRepoFolder.getId(),session);
if (ObjectUtils.isNotEmpty(session.getAttribute("haveSuperiorManageAuth"))&&(Boolean) session.getAttribute("haveSuperiorManageAuth")) { if (ObjectUtils.isNotEmpty(session.getAttribute("haveSuperiorManageAuth"))&&(Boolean) session.getAttribute("haveSuperiorManageAuth")) {
extRepoFolderService.editById(extRepoFolder); extRepoFolderService.editById(extRepoFolder);
if (CutEnum.CN.getValue().equals(extRepoFolder.getCut())) { if (LanguageEnum.CN.getValue().equals(extRepoFolder.getCut())) {
result.success("编辑成功!"); result.success("编辑成功!");
} else { } else {
result.success("Data update successfully!"); result.success("Data update successfully!");
} }
} else { } else {
if (CutEnum.CN.getValue().equals(extRepoFolder.getCut())) { if (LanguageEnum.CN.getValue().equals(extRepoFolder.getCut())) {
result.error500("没有权限!"); result.error500("没有权限!");
} else { } else {
result.error500("You do not have permission !"); result.error500("You do not have permission !");
@@ -184,7 +184,7 @@ public class ExtRepoFolderController extends JeroController<ExtRepoFolder, IExtR
ExtRepoFolder erf = extRepoFolderService.queryById(id); ExtRepoFolder erf = extRepoFolderService.queryById(id);
int count = getRootFolderCount(); int count = getRootFolderCount();
if (erf.getSupFolder().equals("root") && count <= 1) { if (erf.getSupFolder().equals("root") && count <= 1) {
if (CutEnum.CN.getValue().equals(cut)) { if (LanguageEnum.CN.getValue().equals(cut)) {
result.error500("此文件夹不可删除!"); result.error500("此文件夹不可删除!");
} else { } else {
result.error500("This folder cannot be deleted!"); result.error500("This folder cannot be deleted!");
@@ -195,21 +195,21 @@ public class ExtRepoFolderController extends JeroController<ExtRepoFolder, IExtR
extRepoDataService.deleteById(erd.getId()); extRepoDataService.deleteById(erd.getId());
} }
extRepoFolderService.deleteById(id); extRepoFolderService.deleteById(id);
if (CutEnum.CN.getValue().equals(cut)) { if (LanguageEnum.CN.getValue().equals(cut)) {
result.success("删除成功!"); result.success("删除成功!");
} else { } else {
result.success("Data deletion successfully!"); result.success("Data deletion successfully!");
} }
} }
} else { } else {
if (CutEnum.CN.getValue().equals(cut)) { if (LanguageEnum.CN.getValue().equals(cut)) {
result.error500("请先删除子文件夹!"); result.error500("请先删除子文件夹!");
} else { } else {
result.error500("Please delete the subfolder first!"); result.error500("Please delete the subfolder first!");
} }
} }
} else { } else {
if (CutEnum.CN.getValue().equals(cut)) { if (LanguageEnum.CN.getValue().equals(cut)) {
result.error500("没有权限!"); result.error500("没有权限!");
} else { } else {
result.error500("You do not have permission!"); result.error500("You do not have permission!");
@@ -239,7 +239,7 @@ public class ExtRepoFolderController extends JeroController<ExtRepoFolder, IExtR
Result<ExtRepoFolder> result = new Result(); Result<ExtRepoFolder> result = new Result();
ExtRepoFolder extRepoFolder = extRepoFolderService.queryById(id); ExtRepoFolder extRepoFolder = extRepoFolderService.queryById(id);
if (extRepoFolder == null) { if (extRepoFolder == null) {
if (CutEnum.CN.getValue().equals(cut)) { if (LanguageEnum.CN.getValue().equals(cut)) {
result.error500("未找到对应数据!"); result.error500("未找到对应数据!");
} else { } else {
result.error500("No Data!"); result.error500("No Data!");
@@ -5,7 +5,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jero.common.api.vo.Result; import com.jero.common.api.vo.Result;
import com.jero.common.aspect.annotation.AutoLog; import com.jero.common.aspect.annotation.AutoLog;
import com.jero.common.constant.enums.CutEnum; import com.jero.common.constant.enums.LanguageEnum;
import com.jero.common.system.base.controller.JeroController; import com.jero.common.system.base.controller.JeroController;
import com.jero.common.system.query.QueryGenerator; import com.jero.common.system.query.QueryGenerator;
import com.jero.modules.home.entity.HomeDocumentDynamicEO; import com.jero.modules.home.entity.HomeDocumentDynamicEO;
@@ -61,7 +61,7 @@ public class HomeDocumentDynamicEOController extends JeroController<HomeDocument
queryWrapper.orderByDesc("create_time"); queryWrapper.orderByDesc("create_time");
Page<HomeDocumentDynamicEO> page = new Page<HomeDocumentDynamicEO>(pageNo, pageSize); Page<HomeDocumentDynamicEO> page = new Page<HomeDocumentDynamicEO>(pageNo, pageSize);
IPage<HomeDocumentDynamicEO> pageList = homeDocumentDynamicEOService.page(page, queryWrapper); IPage<HomeDocumentDynamicEO> pageList = homeDocumentDynamicEOService.page(page, queryWrapper);
if(CutEnum.CN.getValue().equals(cut) && ObjectUtils.isNotEmpty(pageList.getRecords())){ if(LanguageEnum.CN.getValue().equals(cut) && ObjectUtils.isNotEmpty(pageList.getRecords())){
for (HomeDocumentDynamicEO record : pageList.getRecords()) { for (HomeDocumentDynamicEO record : pageList.getRecords()) {
if(StringUtils.isNotBlank(record.getMsgContentCn())){ if(StringUtils.isNotBlank(record.getMsgContentCn())){
record.setMsgContent(record.getMsgContentCn()); record.setMsgContent(record.getMsgContentCn());
@@ -4,7 +4,7 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jero.common.constant.enums.CutEnum; import com.jero.common.constant.enums.LanguageEnum;
import com.jero.common.system.vo.LoginUser; import com.jero.common.system.vo.LoginUser;
import com.jero.modules.home.entity.HomeFunctionModuleEO; import com.jero.modules.home.entity.HomeFunctionModuleEO;
import com.jero.modules.home.mapper.HomeFunctionModuleEOMapper; import com.jero.modules.home.mapper.HomeFunctionModuleEOMapper;
@@ -131,7 +131,7 @@ public class HomeFunctionModuleEOServiceImpl extends ServiceImpl<HomeFunctionMod
wrapperTemp.in(HomeFunctionModuleEO::getCreateBy,loginUser.getUsername()).orderByAsc(HomeFunctionModuleEO::getState).orderByAsc(HomeFunctionModuleEO::getSort); wrapperTemp.in(HomeFunctionModuleEO::getCreateBy,loginUser.getUsername()).orderByAsc(HomeFunctionModuleEO::getState).orderByAsc(HomeFunctionModuleEO::getSort);
List<HomeFunctionModuleEO> homeFunctionModuleEOS = this.list(wrapperTemp); List<HomeFunctionModuleEO> homeFunctionModuleEOS = this.list(wrapperTemp);
if(homeFunctionModuleEOS.size() == 0){ if(homeFunctionModuleEOS.size() == 0){
if(CutEnum.EN.getValue().equals(cut)){ if(LanguageEnum.EN.getValue().equals(cut)){
for (HomeFunctionModuleEO homeFunctionModuleEO : homeFunctionModuleEOListTemp) { for (HomeFunctionModuleEO homeFunctionModuleEO : homeFunctionModuleEOListTemp) {
homeFunctionModuleEO.setIconName(homeFunctionModuleEO.getIconNameEn()); homeFunctionModuleEO.setIconName(homeFunctionModuleEO.getIconNameEn());
} }
@@ -159,7 +159,7 @@ public class HomeFunctionModuleEOServiceImpl extends ServiceImpl<HomeFunctionMod
} }
} }
homeFunctionModuleEOSTemp = homeFunctionModuleEOSTemp.stream().distinct().collect(Collectors.toList()); homeFunctionModuleEOSTemp = homeFunctionModuleEOSTemp.stream().distinct().collect(Collectors.toList());
if(CutEnum.EN.getValue().equals(cut)){ if(LanguageEnum.EN.getValue().equals(cut)){
for (HomeFunctionModuleEO homeFunctionModuleEO : homeFunctionModuleEOSTemp) { for (HomeFunctionModuleEO homeFunctionModuleEO : homeFunctionModuleEOSTemp) {
homeFunctionModuleEO.setIconName(homeFunctionModuleEO.getIconNameEn()); homeFunctionModuleEO.setIconName(homeFunctionModuleEO.getIconNameEn());
} }
@@ -1,6 +1,6 @@
package com.jero.modules.lanswitch.service.impl; package com.jero.modules.lanswitch.service.impl;
import com.jero.common.constant.enums.CutEnum; import com.jero.common.constant.enums.LanguageEnum;
import com.jero.common.constant.enums.ModuleEnum; import com.jero.common.constant.enums.ModuleEnum;
import com.jero.common.constant.enums.YesOrNoEnum; import com.jero.common.constant.enums.YesOrNoEnum;
import com.jero.generater.modules.online.cgform.entity.OnlCgformField; import com.jero.generater.modules.online.cgform.entity.OnlCgformField;
@@ -69,7 +69,7 @@ public class LanguageSwitchServiceImpl implements ILanguageSwitchService {
map.put("db_field_name", LineHumpUtil.lineToHump(dbFieldName)); map.put("db_field_name", LineHumpUtil.lineToHump(dbFieldName));
} }
if(CutEnum.CN.getValue().equals(cut)){ if(LanguageEnum.CN.getValue().equals(cut)){
map.put("db_field_txt", onlCgformField.getDbFieldTxt());//字段中文名 map.put("db_field_txt", onlCgformField.getDbFieldTxt());//字段中文名
}else{ }else{
map.put("db_field_txt", onlCgformField.getDbFieldEnName());//字段英文名 map.put("db_field_txt", onlCgformField.getDbFieldEnName());//字段英文名
@@ -115,7 +115,7 @@ public class LanguageSwitchServiceImpl implements ILanguageSwitchService {
map.put("db_field_name", LineHumpUtil.lineToHump(onlCgformField.getDbFieldName()));//字段 map.put("db_field_name", LineHumpUtil.lineToHump(onlCgformField.getDbFieldName()));//字段
} }
if (CutEnum.CN.getValue().equals(cut)) { if (LanguageEnum.CN.getValue().equals(cut)) {
map.put("db_field_txt", onlCgformField.getDbFieldTxt());//字段中文名 map.put("db_field_txt", onlCgformField.getDbFieldTxt());//字段中文名
} else { } else {
map.put("db_field_txt", onlCgformField.getDbFieldEnName());//字段英文名 map.put("db_field_txt", onlCgformField.getDbFieldEnName());//字段英文名
@@ -157,7 +157,7 @@ public class LanguageSwitchServiceImpl implements ILanguageSwitchService {
map.put("db_field_name", LineHumpUtil.lineToHump(onlCgformField.getDbFieldName()));//字段 map.put("db_field_name", LineHumpUtil.lineToHump(onlCgformField.getDbFieldName()));//字段
} }
map.put("db_length", onlCgformField.getDbLength());//字段长度 map.put("db_length", onlCgformField.getDbLength());//字段长度
if (CutEnum.CN.getValue().equals(cut)) { if (LanguageEnum.CN.getValue().equals(cut)) {
map.put("db_field_txt", onlCgformField.getDbFieldTxt());//字段中文名 map.put("db_field_txt", onlCgformField.getDbFieldTxt());//字段中文名
} else { } else {
map.put("db_field_txt", onlCgformField.getDbFieldEnName());//字段英文名 map.put("db_field_txt", onlCgformField.getDbFieldEnName());//字段英文名
@@ -4,7 +4,7 @@ import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jero.common.constant.enums.CutEnum; import com.jero.common.constant.enums.LanguageEnum;
import com.jero.common.constant.enums.ModuleEnum; import com.jero.common.constant.enums.ModuleEnum;
import com.jero.common.constant.enums.YesOrNoEnum; import com.jero.common.constant.enums.YesOrNoEnum;
import com.jero.generater.modules.online.cgform.entity.OnlCgformField; import com.jero.generater.modules.online.cgform.entity.OnlCgformField;
@@ -140,15 +140,15 @@ public class OcrRecordEOServiceImpl extends ServiceImpl<OcrRecordEOMapper, OcrRe
} }
String dbFieldName = onlCgformField.getDbFieldName(); String dbFieldName = onlCgformField.getDbFieldName();
if(CutEnum.CN.getValue().equals(cut) && "stand_name_en".equals(onlCgformField.getDbFieldName())) { if(LanguageEnum.CN.getValue().equals(cut) && "stand_name_en".equals(onlCgformField.getDbFieldName())) {
continue; continue;
} }
if(CutEnum.EN.getValue().equals(cut) && "stand_name".equals(onlCgformField.getDbFieldName())) { if(LanguageEnum.EN.getValue().equals(cut) && "stand_name".equals(onlCgformField.getDbFieldName())) {
continue; continue;
} }
map.put("db_field_name", LineHumpUtil.lineToHump(dbFieldName));//字段 map.put("db_field_name", LineHumpUtil.lineToHump(dbFieldName));//字段
if(CutEnum.CN.getValue().equals(cut)){ if(LanguageEnum.CN.getValue().equals(cut)){
map.put("db_field_txt", onlCgformField.getDbFieldTxt());//字段中文名 map.put("db_field_txt", onlCgformField.getDbFieldTxt());//字段中文名
}else{ }else{
map.put("db_field_txt", onlCgformField.getDbFieldEnName());//字段英文名 map.put("db_field_txt", onlCgformField.getDbFieldEnName());//字段英文名
@@ -176,7 +176,7 @@ public class OcrRecordEOServiceImpl extends ServiceImpl<OcrRecordEOMapper, OcrRe
map.put("field_show_type", onlCgformField.getFieldShowType());//类型(判断是下拉还是输入框,等等) map.put("field_show_type", onlCgformField.getFieldShowType());//类型(判断是下拉还是输入框,等等)
map.put("dict_field", onlCgformField.getDictField()); //下拉类型的数据字典编码 map.put("dict_field", onlCgformField.getDictField()); //下拉类型的数据字典编码
map.put("db_field_name", LineHumpUtil.lineToHump(onlCgformField.getDbFieldName()));//字段 map.put("db_field_name", LineHumpUtil.lineToHump(onlCgformField.getDbFieldName()));//字段
if (CutEnum.CN.getValue().equals(cut)) { if (LanguageEnum.CN.getValue().equals(cut)) {
map.put("db_field_txt", onlCgformField.getDbFieldTxt());//字段中文名 map.put("db_field_txt", onlCgformField.getDbFieldTxt());//字段中文名
} else { } else {
map.put("db_field_txt", onlCgformField.getDbFieldEnName());//字段英文名 map.put("db_field_txt", onlCgformField.getDbFieldEnName());//字段英文名
@@ -206,7 +206,7 @@ public class OcrRecordEOServiceImpl extends ServiceImpl<OcrRecordEOMapper, OcrRe
map.put("field_must_input", onlCgformField.getFieldMustInput());//是否必填 map.put("field_must_input", onlCgformField.getFieldMustInput());//是否必填
map.put("dict_field", onlCgformField.getDictField()); //下拉类型的数据字典编码 map.put("dict_field", onlCgformField.getDictField()); //下拉类型的数据字典编码
map.put("db_field_name", LineHumpUtil.lineToHump(onlCgformField.getDbFieldName()));//字段 map.put("db_field_name", LineHumpUtil.lineToHump(onlCgformField.getDbFieldName()));//字段
if (CutEnum.CN.getValue().equals(cut)) { if (LanguageEnum.CN.getValue().equals(cut)) {
map.put("db_field_txt", onlCgformField.getDbFieldTxt());//字段中文名 map.put("db_field_txt", onlCgformField.getDbFieldTxt());//字段中文名
} else { } else {
if("stand_name_en".equals(onlCgformField.getDbFieldName())) { // 英文标题字段特殊处理 if("stand_name_en".equals(onlCgformField.getDbFieldName())) { // 英文标题字段特殊处理
@@ -223,7 +223,7 @@ public class OcrRecordEOServiceImpl extends ServiceImpl<OcrRecordEOMapper, OcrRe
List<Map<String, String>> fieldFileList = new ArrayList<>(); List<Map<String, String>> fieldFileList = new ArrayList<>();
for (OnlCgformField field : documentLibraryFieldList) { for (OnlCgformField field : documentLibraryFieldList) {
Map<String, String> map1 = new HashMap<>(); Map<String, String> map1 = new HashMap<>();
if (CutEnum.CN.getValue().equals(cut)) { if (LanguageEnum.CN.getValue().equals(cut)) {
map1.put("label",field.getDbFieldTxt()); map1.put("label",field.getDbFieldTxt());
map1.put("value",field.getId()); map1.put("value",field.getId());
@@ -267,13 +267,13 @@ public class OcrRecordEOServiceImpl extends ServiceImpl<OcrRecordEOMapper, OcrRe
String fileType = null; String fileType = null;
OnlCgformField fileTypeField = onlCgformFieldService.queryById(ocrRecordEO.getFileType()); OnlCgformField fileTypeField = onlCgformFieldService.queryById(ocrRecordEO.getFileType());
if (ObjectUtil.isNotEmpty(fileTypeField)) { if (ObjectUtil.isNotEmpty(fileTypeField)) {
if (CutEnum.CN.getValue().equals(cut)) { if (LanguageEnum.CN.getValue().equals(cut)) {
fileType = fileTypeField.getDbFieldTxt(); fileType = fileTypeField.getDbFieldTxt();
} else { } else {
fileType = fileTypeField.getDbFieldEnName(); fileType = fileTypeField.getDbFieldEnName();
} }
} }
if (CutEnum.CN.getValue().equals(cut)) { if (LanguageEnum.CN.getValue().equals(cut)) {
Map<String, String> cnMap = dictItemListAll.stream() Map<String, String> cnMap = dictItemListAll.stream()
.filter(e->e.getItemValue().equals(ocrRecordEO.getResultContent()) .filter(e->e.getItemValue().equals(ocrRecordEO.getResultContent())
|| e.getItemValue().equals(ocrRecordEO.getSyncState())) || e.getItemValue().equals(ocrRecordEO.getSyncState()))
@@ -1,6 +1,6 @@
package com.jero.modules.phone.enums; package com.jero.modules.phone.enums;
import com.jero.common.constant.enums.CutEnum; import com.jero.common.constant.enums.LanguageEnum;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
/** /**
@@ -40,7 +40,7 @@ public enum BrowseTypeEnum {
BrowseTypeEnum[] values = values(); BrowseTypeEnum[] values = values();
for (BrowseTypeEnum taskStatusEnum : values) { for (BrowseTypeEnum taskStatusEnum : values) {
if (taskStatusEnum.value.equals(value)) { if (taskStatusEnum.value.equals(value)) {
if (StringUtils.equals(cut, CutEnum.CN.getValue())) { if (StringUtils.equals(cut, LanguageEnum.CN.getValue())) {
return taskStatusEnum.cnName; return taskStatusEnum.cnName;
} else { } else {
return taskStatusEnum.enName; return taskStatusEnum.enName;
@@ -6,7 +6,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jero.common.api.vo.Result; import com.jero.common.api.vo.Result;
import com.jero.common.constant.enums.CutEnum; import com.jero.common.constant.enums.LanguageEnum;
import com.jero.common.es.JeroElasticsearchTemplate; import com.jero.common.es.JeroElasticsearchTemplate;
import com.jero.common.system.vo.LoginUser; import com.jero.common.system.vo.LoginUser;
import com.jero.common.util.DateUtils; import com.jero.common.util.DateUtils;
@@ -48,7 +48,7 @@ public class SearchCenterServiceImpl implements ISearchCenterService {
public Result<Map<String, Object>> getDataCount() { public Result<Map<String, Object>> getDataCount() {
Map<String, Object> result = new HashMap<>(); Map<String, Object> result = new HashMap<>();
Map<String, Object> params = new HashMap<>(); Map<String, Object> params = new HashMap<>();
params.put("cut", CutEnum.CN.getValue()); params.put("cut", LanguageEnum.CN.getValue());
params.put("pageNo", "1"); params.put("pageNo", "1");
params.put("pageSize", "10"); params.put("pageSize", "10");
IPage documentLibraryInfoPage = this.bussDocumentLibraryEOService.getInfoPage(params); IPage documentLibraryInfoPage = this.bussDocumentLibraryEOService.getInfoPage(params);
@@ -79,9 +79,9 @@ public class SearchCenterServiceImpl implements ISearchCenterService {
String cut = (String) params.get("cut"); String cut = (String) params.get("cut");
Integer pageNo = Integer.parseInt(params.get("pageNo").toString()); Integer pageNo = Integer.parseInt(params.get("pageNo").toString());
Integer pageSize = Integer.parseInt(params.get("pageSize").toString()); Integer pageSize = Integer.parseInt(params.get("pageSize").toString());
if (StringUtils.equals(cut, CutEnum.CN.getValue())) { if (StringUtils.equals(cut, LanguageEnum.CN.getValue())) {
indexExistsFlag = jeroElasticsearchTemplate.indexExists(SearchEnum.FULL_TEXT_SEARCH_CN.getValue()); indexExistsFlag = jeroElasticsearchTemplate.indexExists(SearchEnum.FULL_TEXT_SEARCH_CN.getValue());
} else if (StringUtils.equals(cut, CutEnum.EN.getValue())) { } else if (StringUtils.equals(cut, LanguageEnum.EN.getValue())) {
indexExistsFlag = jeroElasticsearchTemplate.indexExists(SearchEnum.FULL_TEXT_SEARCH_EN.getValue()); indexExistsFlag = jeroElasticsearchTemplate.indexExists(SearchEnum.FULL_TEXT_SEARCH_EN.getValue());
} }
if (!indexExistsFlag) { if (!indexExistsFlag) {
@@ -92,9 +92,9 @@ public class SearchCenterServiceImpl implements ISearchCenterService {
// 定义需要查询的字段数组 // 定义需要查询的字段数组
List<String> fieldList = new ArrayList<>(); List<String> fieldList = new ArrayList<>();
fieldList.add("serial_number"); fieldList.add("serial_number");
if (StringUtils.equals(cut,CutEnum.EN.getValue())) { if (StringUtils.equals(cut, LanguageEnum.EN.getValue())) {
fieldList.add("title_en"); fieldList.add("title_en");
} else if (StringUtils.equals(cut,CutEnum.CN.getValue())){ } else if (StringUtils.equals(cut, LanguageEnum.CN.getValue())){
fieldList.add("title"); fieldList.add("title");
} }
fieldList.add("content"); fieldList.add("content");
@@ -209,7 +209,7 @@ public class SearchCenterServiceImpl implements ISearchCenterService {
//2. 数据查询 //2. 数据查询
JSONObject search = new JSONObject(); JSONObject search = new JSONObject();
if (CutEnum.CN.getValue().equals(cut)) { if (LanguageEnum.CN.getValue().equals(cut)) {
search = jeroElasticsearchTemplate.search( search = jeroElasticsearchTemplate.search(
SearchEnum.FULL_TEXT_SEARCH_CN.getValue(), SearchEnum.FULL_TEXT_SEARCH_CN.getValue(),
SearchEnum.FULL_TEXT_SEARCH_CN.getValue(), SearchEnum.FULL_TEXT_SEARCH_CN.getValue(),
@@ -245,7 +245,7 @@ public class SearchCenterServiceImpl implements ISearchCenterService {
String state_dictText = ""; String state_dictText = "";
for (SysDictItem dictItem : stateSysDictItems) { for (SysDictItem dictItem : stateSysDictItems) {
if (StringUtils.equals(dictItem.getItemValue(), state)) { if (StringUtils.equals(dictItem.getItemValue(), state)) {
if (StringUtils.equals(cut, CutEnum.CN.getValue())) { if (StringUtils.equals(cut, LanguageEnum.CN.getValue())) {
state_dictText = dictItem.getItemText(); state_dictText = dictItem.getItemText();
} else { } else {
state_dictText = dictItem.getEnName(); state_dictText = dictItem.getEnName();
@@ -261,7 +261,7 @@ public class SearchCenterServiceImpl implements ISearchCenterService {
} }
mapSource.put("create_time_str",create_time_str); mapSource.put("create_time_str",create_time_str);
// 处理中英文切换的时候 展示的标题 // 处理中英文切换的时候 展示的标题
if (StringUtils.equals(cut,CutEnum.EN.getValue())) { if (StringUtils.equals(cut, LanguageEnum.EN.getValue())) {
mapSource.put("title",mapSource.get("title_en")); mapSource.put("title",mapSource.get("title_en"));
} }
mapList.add(mapSource); mapList.add(mapSource);
@@ -1,6 +1,6 @@
package com.jero.modules.split.common; package com.jero.modules.split.common;
import com.jero.common.constant.enums.CutEnum; import com.jero.common.constant.enums.LanguageEnum;
import com.jero.modules.project.entity.ProjectLawsInventoryEO; import com.jero.modules.project.entity.ProjectLawsInventoryEO;
import com.xkcoding.http.util.StringUtil; import com.xkcoding.http.util.StringUtil;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
@@ -218,7 +218,7 @@ public class FileUnZip {
}else{ }else{
name = filename; name = filename;
} }
if(CutEnum.CN.getValue().equals(cut)){ if(LanguageEnum.CN.getValue().equals(cut)){
errorMsg += nameCn + name + "格式不正确或者压缩包中没有" + name + "文件,请参考模板下载中的说明"; errorMsg += nameCn + name + "格式不正确或者压缩包中没有" + name + "文件,请参考模板下载中的说明";
}else{ }else{
errorMsg += nameEn + name + " Incorrect format or not present in compressed package " + name + " file please refer to the description in template download;"; errorMsg += nameEn + name + " Incorrect format or not present in compressed package " + name + " file please refer to the description in template download;";
@@ -281,7 +281,7 @@ public class FileUnZip {
}else{ }else{
name = filename; name = filename;
} }
if(CutEnum.CN.getValue().equals(cut)){ if(LanguageEnum.CN.getValue().equals(cut)){
errorMsg += nameCn + name + "格式不正确或者压缩包中没有" + name + "文件,请参考模板下载中的说明"; errorMsg += nameCn + name + "格式不正确或者压缩包中没有" + name + "文件,请参考模板下载中的说明";
}else{ }else{
errorMsg += nameEn + name + " Incorrect format or not present in compressed package " + name + " file please refer to the description in template download;"; errorMsg += nameEn + name + " Incorrect format or not present in compressed package " + name + " file please refer to the description in template download;";
@@ -5,7 +5,7 @@ import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.jero.common.api.vo.Result; import com.jero.common.api.vo.Result;
import com.jero.common.aspect.annotation.AutoLog; import com.jero.common.aspect.annotation.AutoLog;
import com.jero.common.constant.enums.CutEnum; import com.jero.common.constant.enums.LanguageEnum;
import com.jero.common.system.base.controller.JeroController; import com.jero.common.system.base.controller.JeroController;
import com.jero.common.util.oConvertUtils; import com.jero.common.util.oConvertUtils;
import com.jero.modules.lanswitch.service.ILanguageSwitchService; import com.jero.modules.lanswitch.service.ILanguageSwitchService;
@@ -323,7 +323,7 @@ public class FileSplitItemsEOController extends JeroController<SarFileSplitItems
result.setResult(oSSFile); result.setResult(oSSFile);
result.setSuccess(true); result.setSuccess(true);
} else { } else {
if("cut".equals(CutEnum.CN.getValue())){ if("cut".equals(LanguageEnum.CN.getValue())){
result.setMessage("上传失败!"); result.setMessage("上传失败!");
}else{ }else{
result.setMessage("fail to upload!"); result.setMessage("fail to upload!");
@@ -5,7 +5,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jero.common.api.vo.Result; import com.jero.common.api.vo.Result;
import com.jero.common.aspect.annotation.AutoLog; import com.jero.common.aspect.annotation.AutoLog;
import com.jero.common.constant.enums.CutEnum; import com.jero.common.constant.enums.LanguageEnum;
import com.jero.common.system.base.controller.JeroController; import com.jero.common.system.base.controller.JeroController;
import com.jero.modules.document.service.IBussDocumentLibraryEOService; import com.jero.modules.document.service.IBussDocumentLibraryEOService;
import com.jero.modules.lanswitch.service.ILanguageSwitchService; import com.jero.modules.lanswitch.service.ILanguageSwitchService;
@@ -75,8 +75,8 @@ public class SarFileSplitInfoController extends JeroController<SarFileSplitInfoE
} }
queryWrapper.lambda().like(StringUtils.isNotEmpty(sarFileSplitInfoEOPage.getSerialNumber()), SarFileSplitInfoEO::getSerialNumber, sarFileSplitInfoEOPage.getSerialNumber()) queryWrapper.lambda().like(StringUtils.isNotEmpty(sarFileSplitInfoEOPage.getSerialNumber()), SarFileSplitInfoEO::getSerialNumber, sarFileSplitInfoEOPage.getSerialNumber())
.like(StringUtils.isNotEmpty(sarFileSplitInfoEOPage.getTitle()) && CutEnum.CN.getValue().equals(sarFileSplitInfoEOPage.getCut()), SarFileSplitInfoEO::getTitle, sarFileSplitInfoEOPage.getTitle()) .like(StringUtils.isNotEmpty(sarFileSplitInfoEOPage.getTitle()) && LanguageEnum.CN.getValue().equals(sarFileSplitInfoEOPage.getCut()), SarFileSplitInfoEO::getTitle, sarFileSplitInfoEOPage.getTitle())
.like(StringUtils.isNotEmpty(sarFileSplitInfoEOPage.getTitle()) && CutEnum.EN.getValue().equals(sarFileSplitInfoEOPage.getCut()), SarFileSplitInfoEO::getTitleEn, sarFileSplitInfoEOPage.getTitle()); .like(StringUtils.isNotEmpty(sarFileSplitInfoEOPage.getTitle()) && LanguageEnum.EN.getValue().equals(sarFileSplitInfoEOPage.getCut()), SarFileSplitInfoEO::getTitleEn, sarFileSplitInfoEOPage.getTitle());
queryWrapper.orderBy(StringUtils.isNotBlank(sarFileSplitInfoEOPage.getOrderByField()), "1".equals(sarFileSplitInfoEOPage.getOrderBy())?true:false, sarFileSplitInfoEOPage.getOrderByField()) queryWrapper.orderBy(StringUtils.isNotBlank(sarFileSplitInfoEOPage.getOrderByField()), "1".equals(sarFileSplitInfoEOPage.getOrderBy())?true:false, sarFileSplitInfoEOPage.getOrderByField())
.orderBy(StringUtils.isBlank(sarFileSplitInfoEOPage.getOrderByField()), false, "create_time"); .orderBy(StringUtils.isBlank(sarFileSplitInfoEOPage.getOrderByField()), false, "create_time");
@@ -11,7 +11,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jero.common.api.vo.Result; import com.jero.common.api.vo.Result;
import com.jero.common.constant.enums.CutEnum; import com.jero.common.constant.enums.LanguageEnum;
import com.jero.common.constant.enums.IsMustEnum; import com.jero.common.constant.enums.IsMustEnum;
import com.jero.common.constant.enums.ModuleEnum; import com.jero.common.constant.enums.ModuleEnum;
import com.jero.common.constant.enums.YesOrNoEnum; import com.jero.common.constant.enums.YesOrNoEnum;
@@ -1490,7 +1490,7 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
sarFileSplitMenuEOMapper.insertSelective(sarFileSplitMenuEO); sarFileSplitMenuEOMapper.insertSelective(sarFileSplitMenuEO);
} }
String msg = ""; String msg = "";
if(CutEnum.CN.getValue().equals(cut)){ if(LanguageEnum.CN.getValue().equals(cut)){
msg = "成功导入" + countSuccess + "条"; msg = "成功导入" + countSuccess + "条";
} else { } else {
msg = "import " + countSuccess + " datas successfully"; msg = "import " + countSuccess + " datas successfully";
@@ -1499,7 +1499,7 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
} catch (Exception e) { } catch (Exception e) {
log.error(e.getMessage(),e); log.error(e.getMessage(),e);
String msg = ""; String msg = "";
if(CutEnum.CN.getValue().equals(cut)){ if(LanguageEnum.CN.getValue().equals(cut)){
msg = "导入失败"; msg = "导入失败";
} else { } else {
msg = "import failed"; msg = "import failed";
@@ -1519,7 +1519,7 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
//判断上传文件必须是zip //判断上传文件必须是zip
// TODO 允许导入rar // TODO 允许导入rar
if (!str.equals("zip")) { if (!str.equals("zip")) {
if(CutEnum.CN.getValue().equals(cut)){ if(LanguageEnum.CN.getValue().equals(cut)){
resultMsg = "请上传zip文件"; resultMsg = "请上传zip文件";
}else{ }else{
resultMsg = "Please upload a zip file"; resultMsg = "Please upload a zip file";
@@ -1541,7 +1541,7 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
if(excelfilelist.size()<1){ if(excelfilelist.size()<1){
//删除原上传文件 //删除原上传文件
FileUnZip.deleteDir(saveDirectory); FileUnZip.deleteDir(saveDirectory);
if(CutEnum.CN.getValue().equals(cut)){ if(LanguageEnum.CN.getValue().equals(cut)){
resultMsg = "压缩包内没有上传Excel数据"; resultMsg = "压缩包内没有上传Excel数据";
}else{ }else{
resultMsg = "In the cabinet did not upload the Excel data"; resultMsg = "In the cabinet did not upload the Excel data";
@@ -1551,7 +1551,7 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
} else if (excelfilelist.size()>1) { } else if (excelfilelist.size()>1) {
//删除原上传文件 //删除原上传文件
FileUnZip.deleteDir(saveDirectory); FileUnZip.deleteDir(saveDirectory);
if(CutEnum.CN.getValue().equals(cut)){ if(LanguageEnum.CN.getValue().equals(cut)){
resultMsg = "压缩包根目录下仅能存在一个excel为导入数据"; resultMsg = "压缩包根目录下仅能存在一个excel为导入数据";
}else{ }else{
resultMsg = "Only one Excel file can be imported in the compressed package root directory"; resultMsg = "Only one Excel file can be imported in the compressed package root directory";
@@ -1617,7 +1617,7 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
}else{ }else{
//删除原上传文件 //删除原上传文件
FileUnZip.deleteDir(saveDirectory); FileUnZip.deleteDir(saveDirectory);
if(CutEnum.CN.getValue().equals(cut)){ if(LanguageEnum.CN.getValue().equals(cut)){
resultMsg = "没有可导入的数据,请检查!"; resultMsg = "没有可导入的数据,请检查!";
}else{ }else{
resultMsg = "No data to import, please check"; resultMsg = "No data to import, please check";
@@ -1626,7 +1626,7 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
} }
} catch (NoSuchElementException e){ } catch (NoSuchElementException e){
FileUnZip.deleteDir(saveDirectory); FileUnZip.deleteDir(saveDirectory);
if(CutEnum.CN.getValue().equals(cut)){ if(LanguageEnum.CN.getValue().equals(cut)){
resultMsg = "没有可导入的数据,请检查!"; resultMsg = "没有可导入的数据,请检查!";
}else{ }else{
resultMsg = "No data to import, please check"; resultMsg = "No data to import, please check";
@@ -1638,7 +1638,7 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
} catch (Exception e) { } catch (Exception e) {
//删除原上传文件 //删除原上传文件
FileUnZip.deleteDir(saveDirectory); FileUnZip.deleteDir(saveDirectory);
if(CutEnum.CN.getValue().equals(cut)){ if(LanguageEnum.CN.getValue().equals(cut)){
resultMsg = "读取失败,请严格按照模板文件导入数据"; resultMsg = "读取失败,请严格按照模板文件导入数据";
}else{ }else{
resultMsg = "The data fails to be read. Import data strictly according to the template file"; resultMsg = "The data fails to be read. Import data strictly according to the template file";
@@ -1648,7 +1648,7 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
} catch (Exception e) { } catch (Exception e) {
//删除原上传文件 //删除原上传文件
FileUnZip.deleteDir(saveDirectory); FileUnZip.deleteDir(saveDirectory);
if(CutEnum.CN.getValue().equals(cut)){ if(LanguageEnum.CN.getValue().equals(cut)){
resultMsg = "读取失败,请严格按照模板文件导入数据"; resultMsg = "读取失败,请严格按照模板文件导入数据";
}else{ }else{
resultMsg = "The data fails to be read. Import data strictly according to the template file"; resultMsg = "The data fails to be read. Import data strictly according to the template file";
@@ -1687,7 +1687,7 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
OSSFile ossFile = ossFileService.getById(splitFileId); OSSFile ossFile = ossFileService.getById(splitFileId);
String url = ossFile.getUrl(); String url = ossFile.getUrl();
if (!MinioUtil.doesObjectExist(url)) { if (!MinioUtil.doesObjectExist(url)) {
if (CutEnum.CN.getValue().equals(cut)) { if (LanguageEnum.CN.getValue().equals(cut)) {
throw new JeroBootException("导入的压缩包不存在!"); throw new JeroBootException("导入的压缩包不存在!");
} else { } else {
throw new JeroBootException("Importing a compressed package that does not exist!"); throw new JeroBootException("Importing a compressed package that does not exist!");
@@ -1737,7 +1737,7 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
if (name.contains(".xlsx")) { if (name.contains(".xlsx")) {
workbook = WorkbookFactory.create(is); workbook = WorkbookFactory.create(is);
} else { } else {
if(CutEnum.CN.getValue().equals(cut)){ if(LanguageEnum.CN.getValue().equals(cut)){
throw new JeroBootException("请导入正确模板!"); throw new JeroBootException("请导入正确模板!");
} else { } else {
throw new JeroBootException("Please import the correct template"); throw new JeroBootException("Please import the correct template");
@@ -1761,21 +1761,21 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
cell.setCellType(CellType.STRING); cell.setCellType(CellType.STRING);
String cellValue = cell.getStringCellValue().substring(cell.getStringCellValue().indexOf("*")+1); String cellValue = cell.getStringCellValue().substring(cell.getStringCellValue().indexOf("*")+1);
if(!cellValue.equals(titles[i])){ if(!cellValue.equals(titles[i])){
if(CutEnum.CN.getValue().equals(cut)){ if(LanguageEnum.CN.getValue().equals(cut)){
throw new JeroBootException("请导入正确模板!"); throw new JeroBootException("请导入正确模板!");
} else { } else {
throw new JeroBootException("Please import the correct template"); throw new JeroBootException("Please import the correct template");
} }
} }
} else{ } else{
if(CutEnum.CN.getValue().equals(cut)){ if(LanguageEnum.CN.getValue().equals(cut)){
throw new JeroBootException("请导入正确模板!"); throw new JeroBootException("请导入正确模板!");
} else { } else {
throw new JeroBootException("Please import the correct template"); throw new JeroBootException("Please import the correct template");
} }
} }
}else{ }else{
if(CutEnum.CN.getValue().equals(cut)){ if(LanguageEnum.CN.getValue().equals(cut)){
throw new JeroBootException("请导入正确模板!"); throw new JeroBootException("请导入正确模板!");
} else { } else {
throw new JeroBootException("Please import the correct template"); throw new JeroBootException("Please import the correct template");
@@ -1790,21 +1790,21 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
cell.setCellType(CellType.STRING); cell.setCellType(CellType.STRING);
String cellValue = cell.getStringCellValue(); String cellValue = cell.getStringCellValue();
if(!cellValue.contains("填写说明")){ if(!cellValue.contains("填写说明")){
if(CutEnum.CN.getValue().equals(cut)){ if(LanguageEnum.CN.getValue().equals(cut)){
throw new JeroBootException("请导入正确模板!"); throw new JeroBootException("请导入正确模板!");
} else { } else {
throw new JeroBootException("Please import the correct template"); throw new JeroBootException("Please import the correct template");
} }
} }
} else{ } else{
if(CutEnum.CN.getValue().equals(cut)){ if(LanguageEnum.CN.getValue().equals(cut)){
throw new JeroBootException("请导入正确模板!"); throw new JeroBootException("请导入正确模板!");
} else { } else {
throw new JeroBootException("Please import the correct template"); throw new JeroBootException("Please import the correct template");
} }
} }
}else{ }else{
if(CutEnum.CN.getValue().equals(cut)){ if(LanguageEnum.CN.getValue().equals(cut)){
throw new JeroBootException("请导入正确模板!"); throw new JeroBootException("请导入正确模板!");
} else { } else {
throw new JeroBootException("Please import the correct template"); throw new JeroBootException("Please import the correct template");
@@ -1936,10 +1936,10 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
List<String> treeNameList = new ArrayList<>(); List<String> treeNameList = new ArrayList<>();
//普通数据字典 //普通数据字典
List<String> itemNameList = new ArrayList<>(); List<String> itemNameList = new ArrayList<>();
if (CutEnum.CN.getValue().equals(cut)) { if (LanguageEnum.CN.getValue().equals(cut)) {
treeNameList = categoryList.stream().map(SysCategory::getName).collect(Collectors.toList()); treeNameList = categoryList.stream().map(SysCategory::getName).collect(Collectors.toList());
itemNameList = dictItemList.stream().map(SysDictItem::getItemText).collect(Collectors.toList()); itemNameList = dictItemList.stream().map(SysDictItem::getItemText).collect(Collectors.toList());
} else if(CutEnum.EN.getValue().equals(cut)){ } else if(LanguageEnum.EN.getValue().equals(cut)){
treeNameList = categoryList.stream().map(SysCategory::getEnName).collect(Collectors.toList()); treeNameList = categoryList.stream().map(SysCategory::getEnName).collect(Collectors.toList());
itemNameList = dictItemList.stream().map(SysDictItem::getEnName).collect(Collectors.toList()); itemNameList = dictItemList.stream().map(SysDictItem::getEnName).collect(Collectors.toList());
} }
@@ -1953,7 +1953,7 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
i++; i++;
int countError = 0; //记录失败数据数量 int countError = 0; //记录失败数据数量
String errorMsg = ""; String errorMsg = "";
if(CutEnum.CN.getValue().equals(cut)){ if(LanguageEnum.CN.getValue().equals(cut)){
errorMsg = "第" + i + "行:"; errorMsg = "第" + i + "行:";
}else{ }else{
errorMsg = i + " line:"; errorMsg = i + " line:";
@@ -1980,7 +1980,7 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
//树形 //树形
//判断是否必填 //判断是否必填
if (IsMustEnum.YES.getValue().equals(mustInput) && StringUtils.isBlank(value)) { if (IsMustEnum.YES.getValue().equals(mustInput) && StringUtils.isBlank(value)) {
if(CutEnum.CN.getValue().equals(cut)){ if(LanguageEnum.CN.getValue().equals(cut)){
errorMsg += fieldName + "为必填项,不能为空;"; errorMsg += fieldName + "为必填项,不能为空;";
}else{ }else{
errorMsg += fieldName + " is mandatory and cannot be empty;"; errorMsg += fieldName + " is mandatory and cannot be empty;";
@@ -1989,7 +1989,7 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
} }
//判断长度 //判断长度
if (StringUtils.isNotBlank(value) && value.length() > Long.parseLong(dbLength)) { if (StringUtils.isNotBlank(value) && value.length() > Long.parseLong(dbLength)) {
if(CutEnum.CN.getValue().equals(cut)) { if(LanguageEnum.CN.getValue().equals(cut)) {
errorMsg += fieldName + "不能超过" + dbLength + "个字符;"; errorMsg += fieldName + "不能超过" + dbLength + "个字符;";
} else { } else {
errorMsg += fieldName + " can not be more than " + dbLength + " char;"; errorMsg += fieldName + " can not be more than " + dbLength + " char;";
@@ -2005,7 +2005,7 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
lastValue = valueTemp.substring(valueTemp.lastIndexOf("/")+1); lastValue = valueTemp.substring(valueTemp.lastIndexOf("/")+1);
} }
if (!treeNameList.contains(lastValue)) { if (!treeNameList.contains(lastValue)) {
if(CutEnum.CN.getValue().equals(cut)) { if(LanguageEnum.CN.getValue().equals(cut)) {
errorMsg += fieldName + "中的" + lastValue + "与数据字典不匹配;"; errorMsg += fieldName + "中的" + lastValue + "与数据字典不匹配;";
} else { } else {
errorMsg += fieldName +" "+ lastValue + " does not match the data dictionary;"; errorMsg += fieldName +" "+ lastValue + " does not match the data dictionary;";
@@ -2025,10 +2025,10 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
} }
if (treeNameList.contains(lastValue)) { if (treeNameList.contains(lastValue)) {
List<SysCategory> collect = new ArrayList<>(); List<SysCategory> collect = new ArrayList<>();
if(CutEnum.CN.getValue().equals(cut)) { if(LanguageEnum.CN.getValue().equals(cut)) {
String finalLastValue = lastValue; String finalLastValue = lastValue;
collect = categoryList.stream().filter(e -> e.getName().equals(finalLastValue)).collect(Collectors.toList()); collect = categoryList.stream().filter(e -> e.getName().equals(finalLastValue)).collect(Collectors.toList());
} else if(CutEnum.EN.getValue().equals(cut)) { } else if(LanguageEnum.EN.getValue().equals(cut)) {
String finalLastValue1 = lastValue; String finalLastValue1 = lastValue;
collect = categoryList.stream().filter(e -> e.getEnName().equals(finalLastValue1)).collect(Collectors.toList()); collect = categoryList.stream().filter(e -> e.getEnName().equals(finalLastValue1)).collect(Collectors.toList());
} }
@@ -2056,7 +2056,7 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
//输入框 //输入框
//判断是否必填 //判断是否必填
if (IsMustEnum.YES.getValue().equals(mustInput) && StringUtils.isBlank(value)) { if (IsMustEnum.YES.getValue().equals(mustInput) && StringUtils.isBlank(value)) {
if(CutEnum.CN.getValue().equals(cut)) { if(LanguageEnum.CN.getValue().equals(cut)) {
errorMsg += fieldName + "为必填项,不能为空;"; errorMsg += fieldName + "为必填项,不能为空;";
} else { } else {
errorMsg += fieldName + " is mandatory and cannot be empty;"; errorMsg += fieldName + " is mandatory and cannot be empty;";
@@ -2065,7 +2065,7 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
} }
//判断长度 //判断长度
if (StringUtils.isNotBlank(value) && value.length() > Long.parseLong(dbLength)) { if (StringUtils.isNotBlank(value) && value.length() > Long.parseLong(dbLength)) {
if(CutEnum.CN.getValue().equals(cut)) { if(LanguageEnum.CN.getValue().equals(cut)) {
errorMsg += fieldName + "不能超过" + dbLength + "个字符;"; errorMsg += fieldName + "不能超过" + dbLength + "个字符;";
} else { } else {
errorMsg += fieldName + " can not be more than" + dbLength + "char;"; errorMsg += fieldName + " can not be more than" + dbLength + "char;";
@@ -2077,7 +2077,7 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
//输入框(数字) //输入框(数字)
//判断是否必填 //判断是否必填
if (IsMustEnum.YES.getValue().equals(mustInput) && StringUtils.isBlank(value)) { if (IsMustEnum.YES.getValue().equals(mustInput) && StringUtils.isBlank(value)) {
if(CutEnum.CN.getValue().equals(cut)) { if(LanguageEnum.CN.getValue().equals(cut)) {
errorMsg += fieldName + "为必填项,不能为空;"; errorMsg += fieldName + "为必填项,不能为空;";
} else { } else {
errorMsg += fieldName + " is mandatory and cannot be empty;"; errorMsg += fieldName + " is mandatory and cannot be empty;";
@@ -2087,7 +2087,7 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
//正则判断仅能为 负号(-),小数点(.)和数字 //正则判断仅能为 负号(-),小数点(.)和数字
String regexNumber = "^(\\-|\\+)?\\d+(\\.\\d+)?$"; String regexNumber = "^(\\-|\\+)?\\d+(\\.\\d+)?$";
if(StringUtils.isNotBlank(value) && !value.matches(regexNumber)){ if(StringUtils.isNotBlank(value) && !value.matches(regexNumber)){
if(CutEnum.CN.getValue().equals(cut)) { if(LanguageEnum.CN.getValue().equals(cut)) {
errorMsg += fieldName + "仅能为 负号(-),小数点(.)和数字;"; errorMsg += fieldName + "仅能为 负号(-),小数点(.)和数字;";
} else { } else {
@@ -2100,7 +2100,7 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
//下拉单选 //下拉单选
//判断是否必填 //判断是否必填
if (IsMustEnum.YES.getValue().equals(mustInput) && StringUtils.isBlank(value)) { if (IsMustEnum.YES.getValue().equals(mustInput) && StringUtils.isBlank(value)) {
if(CutEnum.CN.getValue().equals(cut)) { if(LanguageEnum.CN.getValue().equals(cut)) {
errorMsg += fieldName + "为必填项,不能为空;"; errorMsg += fieldName + "为必填项,不能为空;";
} else { } else {
errorMsg += fieldName + " is mandatory and cannot be empty;"; errorMsg += fieldName + " is mandatory and cannot be empty;";
@@ -2109,7 +2109,7 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
} }
//判断长度 //判断长度
if (StringUtils.isNotBlank(value) && value.length() > Long.parseLong(dbLength)) { if (StringUtils.isNotBlank(value) && value.length() > Long.parseLong(dbLength)) {
if(CutEnum.CN.getValue().equals(cut)) { if(LanguageEnum.CN.getValue().equals(cut)) {
errorMsg += fieldName + "不能超过" + dbLength + "个字符;"; errorMsg += fieldName + "不能超过" + dbLength + "个字符;";
} else { } else {
errorMsg += fieldName + " can not be more than" + dbLength + "char;"; errorMsg += fieldName + " can not be more than" + dbLength + "char;";
@@ -2118,7 +2118,7 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
} }
//判断是否是单选 //判断是否是单选
if (StringUtils.isNotBlank(value) && value.contains(",")) { if (StringUtils.isNotBlank(value) && value.contains(",")) {
if(CutEnum.CN.getValue().equals(cut)) { if(LanguageEnum.CN.getValue().equals(cut)) {
errorMsg += fieldName + "为单选项;"; errorMsg += fieldName + "为单选项;";
} else { } else {
errorMsg += fieldName + " is single type;"; errorMsg += fieldName + " is single type;";
@@ -2128,7 +2128,7 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
//判断数据是否匹配 //判断数据是否匹配
if (StringUtils.isNotBlank(value)) { if (StringUtils.isNotBlank(value)) {
if (!itemNameList.contains(value)) { if (!itemNameList.contains(value)) {
if(CutEnum.CN.getValue().equals(cut)) { if(LanguageEnum.CN.getValue().equals(cut)) {
errorMsg += fieldName + "中的" + value + "与数据字典不匹配;"; errorMsg += fieldName + "中的" + value + "与数据字典不匹配;";
} else{ } else{
errorMsg += fieldName + " " + value + " does not match the data dictionary"; errorMsg += fieldName + " " + value + " does not match the data dictionary";
@@ -2140,9 +2140,9 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
if (itemNameList.contains(value)) { if (itemNameList.contains(value)) {
String finalValue = value; String finalValue = value;
List<SysDictItem> collect = new ArrayList<>(); List<SysDictItem> collect = new ArrayList<>();
if(CutEnum.CN.getValue().equals(cut)) { if(LanguageEnum.CN.getValue().equals(cut)) {
collect = dictItemList.stream().filter(e -> StringUtils.isNotBlank(e.getItemText()) && e.getItemText().equals(finalValue)).collect(Collectors.toList()); collect = dictItemList.stream().filter(e -> StringUtils.isNotBlank(e.getItemText()) && e.getItemText().equals(finalValue)).collect(Collectors.toList());
} else if(CutEnum.EN.getValue().equals(cut)) { } else if(LanguageEnum.EN.getValue().equals(cut)) {
collect = dictItemList.stream().filter(e -> StringUtils.isNotBlank(e.getEnName()) && e.getEnName().equals(finalValue)).collect(Collectors.toList()); collect = dictItemList.stream().filter(e -> StringUtils.isNotBlank(e.getEnName()) && e.getEnName().equals(finalValue)).collect(Collectors.toList());
} }
if (collect.size() != 0) { if (collect.size() != 0) {
@@ -2152,7 +2152,7 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
} else if (FieldTypeEnum.PULL_MORE.getValue().equals(fieldShowType)) { } else if (FieldTypeEnum.PULL_MORE.getValue().equals(fieldShowType)) {
//判断是否必填 //判断是否必填
if (IsMustEnum.YES.getValue().equals(mustInput) && StringUtils.isBlank(value)) { if (IsMustEnum.YES.getValue().equals(mustInput) && StringUtils.isBlank(value)) {
if(CutEnum.CN.getValue().equals(cut)) { if(LanguageEnum.CN.getValue().equals(cut)) {
errorMsg += fieldName + "为必填项,不能为空;"; errorMsg += fieldName + "为必填项,不能为空;";
} else { } else {
errorMsg += fieldName + " is mandatory and cannot be empty;"; errorMsg += fieldName + " is mandatory and cannot be empty;";
@@ -2161,7 +2161,7 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
} }
//判断长度 //判断长度
if (StringUtils.isNotBlank(value) && value.length() > Long.parseLong(dbLength)) { if (StringUtils.isNotBlank(value) && value.length() > Long.parseLong(dbLength)) {
if(CutEnum.CN.getValue().equals(cut)) { if(LanguageEnum.CN.getValue().equals(cut)) {
errorMsg += fieldName + "不能超过" + dbLength + "个字符;"; errorMsg += fieldName + "不能超过" + dbLength + "个字符;";
} else { } else {
errorMsg += fieldName + " can not be more than" + dbLength + "char;"; errorMsg += fieldName + " can not be more than" + dbLength + "char;";
@@ -2173,7 +2173,7 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
value = value.replace(",",","); value = value.replace(",",",");
for (String valueTemp : value.split(",")) { for (String valueTemp : value.split(",")) {
if (!itemNameList.contains(valueTemp)) { if (!itemNameList.contains(valueTemp)) {
if(CutEnum.CN.getValue().equals(cut)) { if(LanguageEnum.CN.getValue().equals(cut)) {
errorMsg += fieldName + "中的" + valueTemp + "与数据字典不匹配;"; errorMsg += fieldName + "中的" + valueTemp + "与数据字典不匹配;";
} else{ } else{
errorMsg += fieldName + " " + valueTemp + " does not match the data dictionary"; errorMsg += fieldName + " " + valueTemp + " does not match the data dictionary";
@@ -2190,9 +2190,9 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
for (String valueTemp : value.split(",")) { for (String valueTemp : value.split(",")) {
if (itemNameList.contains(valueTemp)) { if (itemNameList.contains(valueTemp)) {
List<SysDictItem> collect = new ArrayList<>(); List<SysDictItem> collect = new ArrayList<>();
if(CutEnum.CN.getValue().equals(cut)) { if(LanguageEnum.CN.getValue().equals(cut)) {
collect = dictItemList.stream().filter(e -> StringUtils.isNotBlank(e.getItemText()) && e.getItemText().equals(valueTemp)).collect(Collectors.toList()); collect = dictItemList.stream().filter(e -> StringUtils.isNotBlank(e.getItemText()) && e.getItemText().equals(valueTemp)).collect(Collectors.toList());
} else if(CutEnum.EN.getValue().equals(cut)) { } else if(LanguageEnum.EN.getValue().equals(cut)) {
collect = dictItemList.stream().filter(e -> StringUtils.isNotBlank(e.getEnName()) && e.getEnName().equals(valueTemp)).collect(Collectors.toList()); collect = dictItemList.stream().filter(e -> StringUtils.isNotBlank(e.getEnName()) && e.getEnName().equals(valueTemp)).collect(Collectors.toList());
} }
valueId += collect.get(0).getItemValue() + ","; valueId += collect.get(0).getItemValue() + ",";
@@ -2206,7 +2206,7 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
//单选日期 //单选日期
//判断是否必填 //判断是否必填
if (IsMustEnum.YES.getValue().equals(mustInput) && StringUtils.isBlank(value)) { if (IsMustEnum.YES.getValue().equals(mustInput) && StringUtils.isBlank(value)) {
if(CutEnum.CN.getValue().equals(cut)) { if(LanguageEnum.CN.getValue().equals(cut)) {
errorMsg += fieldName + "为必填项,不能为空;"; errorMsg += fieldName + "为必填项,不能为空;";
} else { } else {
errorMsg += fieldName + " is mandatory and cannot be empty;"; errorMsg += fieldName + " is mandatory and cannot be empty;";
@@ -2216,7 +2216,7 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
//判断是否是单日期选择 //判断是否是单日期选择
value = value.replace(",",","); value = value.replace(",",",");
if (StringUtils.isNotBlank(value) && value.contains(",")) { if (StringUtils.isNotBlank(value) && value.contains(",")) {
if(CutEnum.CN.getValue().equals(cut)) { if(LanguageEnum.CN.getValue().equals(cut)) {
errorMsg += fieldName + "为单日期选项;"; errorMsg += fieldName + "为单日期选项;";
} else { } else {
errorMsg += fieldName + " is single date type;"; errorMsg += fieldName + " is single date type;";
@@ -2225,7 +2225,7 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
} }
//判断格式是否正确 //判断格式是否正确
if (!DateUtils.isValidDate((String) value)) { if (!DateUtils.isValidDate((String) value)) {
if(CutEnum.CN.getValue().equals(cut)){ if(LanguageEnum.CN.getValue().equals(cut)){
errorMsg += fieldName + "格式不正确,正确格式如:yyyy/MM/dd、yyyy-MM-dd、yyyy年MM月dd日;"; errorMsg += fieldName + "格式不正确,正确格式如:yyyy/MM/dd、yyyy-MM-dd、yyyy年MM月dd日;";
}else{ }else{
errorMsg += fieldName + " Incorrect format correct format is:yyyy/MM/dd、yyyy-MM-dd、yyyy年MM月dd日;"; errorMsg += fieldName + " Incorrect format correct format is:yyyy/MM/dd、yyyy-MM-dd、yyyy年MM月dd日;";
@@ -2239,7 +2239,7 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
//多选日期 //多选日期
//判断是否必填 //判断是否必填
if (IsMustEnum.YES.getValue().equals(mustInput) && StringUtils.isBlank(value)) { if (IsMustEnum.YES.getValue().equals(mustInput) && StringUtils.isBlank(value)) {
if(CutEnum.CN.getValue().equals(cut)) { if(LanguageEnum.CN.getValue().equals(cut)) {
errorMsg += fieldName + "为必填项,不能为空;"; errorMsg += fieldName + "为必填项,不能为空;";
} else { } else {
errorMsg += fieldName + " is mandatory and cannot be empty;"; errorMsg += fieldName + " is mandatory and cannot be empty;";
@@ -2248,7 +2248,7 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
} }
//判断格式是否正确 //判断格式是否正确
if (!DateUtils.isValidDate((String) value)) { if (!DateUtils.isValidDate((String) value)) {
if(CutEnum.CN.getValue().equals(cut)){ if(LanguageEnum.CN.getValue().equals(cut)){
errorMsg += fieldName + "格式不正确,正确格式如:yyyy/m/d、yyyy-MM-dd、yyyy年MM月dd日;"; errorMsg += fieldName + "格式不正确,正确格式如:yyyy/m/d、yyyy-MM-dd、yyyy年MM月dd日;";
}else{ }else{
errorMsg += fieldName + " Incorrect format correct format is:yyyy/m/d、yyyy-MM-dd、yyyy年MM月dd日;"; errorMsg += fieldName + " Incorrect format correct format is:yyyy/m/d、yyyy-MM-dd、yyyy年MM月dd日;";
@@ -2262,7 +2262,7 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
String str = value.replace(",", ","); String str = value.replace(",", ",");
String[] strArr = str.split(","); String[] strArr = str.split(",");
if (strArr.length != 2) { if (strArr.length != 2) {
if (CutEnum.CN.getValue().equals(cut)) { if (LanguageEnum.CN.getValue().equals(cut)) {
errorMsg += fieldName + "必须填写两个日期;"; errorMsg += fieldName + "必须填写两个日期;";
} else { } else {
errorMsg += fieldName + " must fill in the two dates;"; errorMsg += fieldName + " must fill in the two dates;";
@@ -2275,7 +2275,7 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
//文件 //文件
//判断是否必填 //判断是否必填
if (IsMustEnum.YES.getValue().equals(mustInput) && StringUtils.isBlank(value)) { if (IsMustEnum.YES.getValue().equals(mustInput) && StringUtils.isBlank(value)) {
if(CutEnum.CN.getValue().equals(cut)) { if(LanguageEnum.CN.getValue().equals(cut)) {
errorMsg += fieldName + "为必填项,不能为空;"; errorMsg += fieldName + "为必填项,不能为空;";
} else { } else {
errorMsg += fieldName + " is mandatory and cannot be empty;"; errorMsg += fieldName + " is mandatory and cannot be empty;";
@@ -2284,7 +2284,7 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
} }
//判断长度 //判断长度
if (StringUtils.isNotBlank(value) && value.length() > Long.parseLong(dbLength)) { if (StringUtils.isNotBlank(value) && value.length() > Long.parseLong(dbLength)) {
if(CutEnum.CN.getValue().equals(cut)) { if(LanguageEnum.CN.getValue().equals(cut)) {
errorMsg += fieldName + "不能超过" + dbLength + "个字符;"; errorMsg += fieldName + "不能超过" + dbLength + "个字符;";
} else { } else {
errorMsg += fieldName + " can not be more than" + dbLength + "char;"; errorMsg += fieldName + " can not be more than" + dbLength + "char;";
@@ -2297,7 +2297,7 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
for (String fileName : value.split(",")) { for (String fileName : value.split(",")) {
List<File> nowFileList = FileUnZip.readFileByFilename(filepath, fileName,null,null,null,null,null); List<File> nowFileList = FileUnZip.readFileByFilename(filepath, fileName,null,null,null,null,null);
if (nowFileList.size() == 0) { if (nowFileList.size() == 0) {
if(CutEnum.CN.getValue().equals(cut)) { if(LanguageEnum.CN.getValue().equals(cut)) {
errorMsg += fieldName + "压缩包中没有" + fileName + "文件; "; errorMsg += fieldName + "压缩包中没有" + fileName + "文件; ";
} else { } else {
errorMsg += fieldName + " " + fileName + "isn't present in the cabinet;"; errorMsg += fieldName + " " + fileName + "isn't present in the cabinet;";
@@ -2328,7 +2328,7 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
//标准选择 //标准选择
//判断是否必填 //判断是否必填
if (IsMustEnum.YES.getValue().equals(mustInput) && StringUtils.isBlank(value)) { if (IsMustEnum.YES.getValue().equals(mustInput) && StringUtils.isBlank(value)) {
if(CutEnum.CN.getValue().equals(cut)) { if(LanguageEnum.CN.getValue().equals(cut)) {
errorMsg += fieldName + "为必填项,不能为空;"; errorMsg += fieldName + "为必填项,不能为空;";
} else { } else {
errorMsg += fieldName + " This parameter is mandatory and cannot be empty;"; errorMsg += fieldName + " This parameter is mandatory and cannot be empty;";
@@ -2337,7 +2337,7 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
} }
//判断长度 //判断长度
if (StringUtils.isNotBlank(value) && value.length() > Long.parseLong(dbLength)) { if (StringUtils.isNotBlank(value) && value.length() > Long.parseLong(dbLength)) {
if(CutEnum.CN.getValue().equals(cut)) { if(LanguageEnum.CN.getValue().equals(cut)) {
errorMsg += fieldName + "不能超过" + dbLength + "个字符;"; errorMsg += fieldName + "不能超过" + dbLength + "个字符;";
} else { } else {
errorMsg += fieldName + " Can not be more than" + dbLength + "char;"; errorMsg += fieldName + " Can not be more than" + dbLength + "char;";
@@ -2354,7 +2354,7 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
//人员选择 //人员选择
//判断是否必填 //判断是否必填
if (IsMustEnum.YES.getValue().equals(mustInput) && StringUtils.isBlank(value)) { if (IsMustEnum.YES.getValue().equals(mustInput) && StringUtils.isBlank(value)) {
if(CutEnum.CN.getValue().equals(cut)) { if(LanguageEnum.CN.getValue().equals(cut)) {
errorMsg += fieldName + "为必填项,不能为空;"; errorMsg += fieldName + "为必填项,不能为空;";
} else { } else {
errorMsg += fieldName + " is mandatory and cannot be empty;"; errorMsg += fieldName + " is mandatory and cannot be empty;";
@@ -2368,7 +2368,7 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
List<String> userIdList = new ArrayList<>(); List<String> userIdList = new ArrayList<>();
for(int u=0 ; u<userNames.length; u++){ for(int u=0 ; u<userNames.length; u++){
// if(!userNames[u].matches(regexPerson)) { // if(!userNames[u].matches(regexPerson)) {
// if(CutEnum.CN.getValue().equals(cut)) { // if(LanguageEnum.CN.getValue().equals(cut)) {
// errorMsg += fieldName + "格式不正确,填写格式:姓名(账号);"; // errorMsg += fieldName + "格式不正确,填写格式:姓名(账号);";
// } else { // } else {
// errorMsg += fieldName + "Not in the correct format, fill in the format:name(account);"; // errorMsg += fieldName + "Not in the correct format, fill in the format:name(account);";
@@ -2381,7 +2381,7 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
if (ObjectUtils.isNotEmpty(user)) { if (ObjectUtils.isNotEmpty(user)) {
userIdList.add(user.getId()); userIdList.add(user.getId());
} else { } else {
if(CutEnum.CN.getValue().equals(cut)) { if(LanguageEnum.CN.getValue().equals(cut)) {
errorMsg += fieldName + "中人员" + userNames[u] + "不存在;"; errorMsg += fieldName + "中人员" + userNames[u] + "不存在;";
} else { } else {
errorMsg += fieldName + " " + userNames[u] + "Not exist;"; errorMsg += fieldName + " " + userNames[u] + "Not exist;";
@@ -2397,7 +2397,7 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
//输入框(链接) //输入框(链接)
//判断是否必填 //判断是否必填
if (IsMustEnum.YES.getValue().equals(mustInput) && StringUtils.isBlank(value)) { if (IsMustEnum.YES.getValue().equals(mustInput) && StringUtils.isBlank(value)) {
if(CutEnum.CN.getValue().equals(cut)) { if(LanguageEnum.CN.getValue().equals(cut)) {
errorMsg += fieldName + "为必填项,不能为空;"; errorMsg += fieldName + "为必填项,不能为空;";
} else { } else {
errorMsg += fieldName + " is mandatory and cannot be empty;"; errorMsg += fieldName + " is mandatory and cannot be empty;";
@@ -2410,7 +2410,7 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
if(StringUtils.isNotBlank(value)){ if(StringUtils.isNotBlank(value)){
for (String valueTemp : value.split(",")) { for (String valueTemp : value.split(",")) {
if(!valueTemp.matches(regexLink)) { if(!valueTemp.matches(regexLink)) {
if(CutEnum.CN.getValue().equals(cut)) { if(LanguageEnum.CN.getValue().equals(cut)) {
errorMsg += valueTemp + "不是正确的链接格式,必须以http或https开头;"; errorMsg += valueTemp + "不是正确的链接格式,必须以http或https开头;";
} else { } else {
errorMsg += valueTemp + " is not the correct format, you must start with HTTP or https"; errorMsg += valueTemp + " is not the correct format, you must start with HTTP or https";
@@ -2685,7 +2685,7 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
map.put("dict_field", onlCgformField.getDictField()); //下拉类型的数据字典编码 map.put("dict_field", onlCgformField.getDictField()); //下拉类型的数据字典编码
map.put("db_field_name", onlCgformField.getDbFieldName());//字段 map.put("db_field_name", onlCgformField.getDbFieldName());//字段
map.put("db_length", onlCgformField.getDbLength());//字段长度 map.put("db_length", onlCgformField.getDbLength());//字段长度
if (CutEnum.CN.getValue().equals(cut)) { if (LanguageEnum.CN.getValue().equals(cut)) {
map.put("db_field_txt", onlCgformField.getDbFieldTxt());//字段中文名 map.put("db_field_txt", onlCgformField.getDbFieldTxt());//字段中文名
} else { } else {
map.put("db_field_txt", onlCgformField.getDbFieldEnName());//字段英文名 map.put("db_field_txt", onlCgformField.getDbFieldEnName());//字段英文名
@@ -2748,7 +2748,7 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
//第二行 //第二行
StringBuilder sbTwo = new StringBuilder(); StringBuilder sbTwo = new StringBuilder();
if(CutEnum.CN.getValue().equals(cut)){ if(LanguageEnum.CN.getValue().equals(cut)){
sbTwo.append("填写说明\n" + "1.导入数据从第三行开始,第一行为表头,第二行为填写说明,第三行是正式数据\n" + "2.所有带*号的字段必须填写\n"); sbTwo.append("填写说明\n" + "1.导入数据从第三行开始,第一行为表头,第二行为填写说明,第三行是正式数据\n" + "2.所有带*号的字段必须填写\n");
}else{ }else{
sbTwo.append("Filling explanation\n" sbTwo.append("Filling explanation\n"
@@ -2758,7 +2758,7 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
int count = 3; int count = 3;
if (pullSingleList.size() != 0) { if (pullSingleList.size() != 0) {
//单选 //单选
if(CutEnum.CN.getValue().equals(cut)){ if(LanguageEnum.CN.getValue().equals(cut)){
String pullSingle = StringUtils.join(pullSingleList, ",") + "字段是单选属性,必须和系统中的对应字段选项相匹配\n"; String pullSingle = StringUtils.join(pullSingleList, ",") + "字段是单选属性,必须和系统中的对应字段选项相匹配\n";
sbTwo.append(count++ + "." + pullSingle); sbTwo.append(count++ + "." + pullSingle);
}else{ }else{
@@ -2768,7 +2768,7 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
} }
if (textNumberList.size() != 0) { if (textNumberList.size() != 0) {
//文本框(数字) //文本框(数字)
if(CutEnum.CN.getValue().equals(cut)) { if(LanguageEnum.CN.getValue().equals(cut)) {
String textNumber = StringUtils.join(textNumberList, ",") + "字段仅能填写数字,负数,小数\n"; String textNumber = StringUtils.join(textNumberList, ",") + "字段仅能填写数字,负数,小数\n";
sbTwo.append(count++ + "." + textNumber); sbTwo.append(count++ + "." + textNumber);
} else { } else {
@@ -2778,7 +2778,7 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
} }
if (pullMoreList.size() != 0) { if (pullMoreList.size() != 0) {
//多选 //多选
if(CutEnum.CN.getValue().equals(cut)){ if(LanguageEnum.CN.getValue().equals(cut)){
String pullMore = StringUtils.join(pullMoreList, ",") + "字段是多选属性,必须和系统中的对应字段选项相匹配,填写多个时采用英文或中文逗号分割\n"; String pullMore = StringUtils.join(pullMoreList, ",") + "字段是多选属性,必须和系统中的对应字段选项相匹配,填写多个时采用英文或中文逗号分割\n";
sbTwo.append(count++ + "." + pullMore); sbTwo.append(count++ + "." + pullMore);
}else{ }else{
@@ -2788,7 +2788,7 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
} }
if (dateSingleList.size() != 0) { if (dateSingleList.size() != 0) {
//单选日期 //单选日期
if(CutEnum.CN.getValue().equals(cut)){ if(LanguageEnum.CN.getValue().equals(cut)){
String dateSingle = StringUtils.join(dateSingleList, ",") + "字段为日期,必须精确到日\n"; String dateSingle = StringUtils.join(dateSingleList, ",") + "字段为日期,必须精确到日\n";
sbTwo.append(count++ + "." + dateSingle); sbTwo.append(count++ + "." + dateSingle);
}else{ }else{
@@ -2798,7 +2798,7 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
} }
if (dateMoreList.size() != 0) { if (dateMoreList.size() != 0) {
//多选日期 //多选日期
if(CutEnum.CN.getValue().equals(cut)) { if(LanguageEnum.CN.getValue().equals(cut)) {
String dateMore = StringUtils.join(dateMoreList, ",") + "字段为日期,必须精确到日,可填写多个,填写多个时采用英文或中文逗号分割\n"; String dateMore = StringUtils.join(dateMoreList, ",") + "字段为日期,必须精确到日,可填写多个,填写多个时采用英文或中文逗号分割\n";
sbTwo.append(count++ + "." + dateMore); sbTwo.append(count++ + "." + dateMore);
} else { } else {
@@ -2808,7 +2808,7 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
} }
if (textStringList.size() != 0) { if (textStringList.size() != 0) {
//输入框 //输入框
if(CutEnum.CN.getValue().equals(cut)){ if(LanguageEnum.CN.getValue().equals(cut)){
String textString = StringUtils.join(textStringList, ",") + "字段为文本,填写文本内容\n"; String textString = StringUtils.join(textStringList, ",") + "字段为文本,填写文本内容\n";
sbTwo.append(count++ + "." + textString); sbTwo.append(count++ + "." + textString);
}else{ }else{
@@ -2818,7 +2818,7 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
} }
if (standardList.size() != 0) { if (standardList.size() != 0) {
//标准选择 //标准选择
if(CutEnum.CN.getValue().equals(cut)){ if(LanguageEnum.CN.getValue().equals(cut)){
String standard = StringUtils.join(standardList, ",") + "字段为标准号,填写多个时采用英文或中文逗号分割\n"; String standard = StringUtils.join(standardList, ",") + "字段为标准号,填写多个时采用英文或中文逗号分割\n";
sbTwo.append(count++ + "." + standard); sbTwo.append(count++ + "." + standard);
}else{ }else{
@@ -2828,7 +2828,7 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
} }
if (fileList.size() != 0) { if (fileList.size() != 0) {
//文件 //文件
if(CutEnum.CN.getValue().equals(cut)){ if(LanguageEnum.CN.getValue().equals(cut)){
String file = StringUtils.join(fileList, ",") + "字段为文件属性,填写时需要在本文件同级目录下以标准号为名称建立文件夹,并在文件夹下放置文件,假设在AAA标准号下放置了B.pdf,则应填写AAA/B.pdf\n"; String file = StringUtils.join(fileList, ",") + "字段为文件属性,填写时需要在本文件同级目录下以标准号为名称建立文件夹,并在文件夹下放置文件,假设在AAA标准号下放置了B.pdf,则应填写AAA/B.pdf\n";
sbTwo.append(count++ + "." + file); sbTwo.append(count++ + "." + file);
}else{ }else{
@@ -2838,7 +2838,7 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
} }
if (treeList.size() != 0) { if (treeList.size() != 0) {
//树形结构 //树形结构
if(CutEnum.CN.getValue().equals(cut)){ if(LanguageEnum.CN.getValue().equals(cut)){
String tree = StringUtils.join(treeList, ",") + "字段为树形结构,填写的数据每层级间用反斜杠(/)划分,如A/B/C代表A层级下B,B层级下的C\n"; String tree = StringUtils.join(treeList, ",") + "字段为树形结构,填写的数据每层级间用反斜杠(/)划分,如A/B/C代表A层级下B,B层级下的C\n";
sbTwo.append(count++ + "." + tree); sbTwo.append(count++ + "." + tree);
}else{ }else{
@@ -2888,7 +2888,7 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
map.put("field_show_type", onlCgformField.getFieldShowType());//类型(判断是下拉还是输入框,等等) map.put("field_show_type", onlCgformField.getFieldShowType());//类型(判断是下拉还是输入框,等等)
map.put("dict_field", onlCgformField.getDictField()); map.put("dict_field", onlCgformField.getDictField());
map.put("db_field_name", onlCgformField.getDbFieldName());//字段 map.put("db_field_name", onlCgformField.getDbFieldName());//字段
if (CutEnum.CN.getValue().equals(cut)) { if (LanguageEnum.CN.getValue().equals(cut)) {
map.put("db_field_txt", onlCgformField.getDbFieldTxt());//字段中文名 map.put("db_field_txt", onlCgformField.getDbFieldTxt());//字段中文名
} else { } else {
map.put("db_field_txt", onlCgformField.getDbFieldEnName());//字段英文名 map.put("db_field_txt", onlCgformField.getDbFieldEnName());//字段英文名
@@ -2926,7 +2926,7 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
.collect(Collectors.toList()); .collect(Collectors.toList());
if (dictItems.size() != 0) { if (dictItems.size() != 0) {
List<String> itemText = new ArrayList<>(); List<String> itemText = new ArrayList<>();
if (CutEnum.CN.getValue().equals(cut)) { if (LanguageEnum.CN.getValue().equals(cut)) {
itemText = dictItems.stream().map(SysDictItem::getItemText).collect(Collectors.toList()); itemText = dictItems.stream().map(SysDictItem::getItemText).collect(Collectors.toList());
} else { } else {
itemText = dictItems.stream().map(SysDictItem::getEnName).collect(Collectors.toList()); itemText = dictItems.stream().map(SysDictItem::getEnName).collect(Collectors.toList());
@@ -2937,7 +2937,7 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
} }
} }
} }
if (CutEnum.CN.getValue().equals(cut)) { if (LanguageEnum.CN.getValue().equals(cut)) {
entry.setValue(StringUtils.join(dictItemsCh, ",")); entry.setValue(StringUtils.join(dictItemsCh, ","));
} else { } else {
entry.setValue(StringUtils.join(dictItemsEn, ",")); entry.setValue(StringUtils.join(dictItemsEn, ","));
@@ -2961,7 +2961,7 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
if (StringUtils.isNotBlank(value)) { if (StringUtils.isNotBlank(value)) {
List<String> idList = Arrays.asList(value.split(",")); List<String> idList = Arrays.asList(value.split(","));
List<SysCategory> sysCategoryList = categoryList.stream().filter(e -> idList.contains(e.getId())).collect(Collectors.toList()); List<SysCategory> sysCategoryList = categoryList.stream().filter(e -> idList.contains(e.getId())).collect(Collectors.toList());
if (CutEnum.CN.getValue().equals(cut)) { if (LanguageEnum.CN.getValue().equals(cut)) {
List<String> nameList = sysCategoryList.stream().map(SysCategory::getName).collect(Collectors.toList()); List<String> nameList = sysCategoryList.stream().map(SysCategory::getName).collect(Collectors.toList());
entry.setValue(StringUtils.join(nameList, ",")); entry.setValue(StringUtils.join(nameList, ","));
} else { } else {
@@ -3004,7 +3004,7 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
map.put("dict_field", onlCgformField.getDictField()); //下拉类型的数据字典编码 map.put("dict_field", onlCgformField.getDictField()); //下拉类型的数据字典编码
map.put("db_field_name", onlCgformField.getDbFieldName());//字段 map.put("db_field_name", onlCgformField.getDbFieldName());//字段
map.put("db_length", onlCgformField.getDbLength());//字段长度 map.put("db_length", onlCgformField.getDbLength());//字段长度
if (CutEnum.CN.getValue().equals(cut)) { if (LanguageEnum.CN.getValue().equals(cut)) {
map.put("db_field_txt", onlCgformField.getDbFieldTxt());//字段中文名 map.put("db_field_txt", onlCgformField.getDbFieldTxt());//字段中文名
} else { } else {
map.put("db_field_txt", onlCgformField.getDbFieldEnName());//字段英文名 map.put("db_field_txt", onlCgformField.getDbFieldEnName());//字段英文名
@@ -3044,7 +3044,7 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
map.put("dict_field", onlCgformField.getDictField()); //下拉类型的数据字典编码 map.put("dict_field", onlCgformField.getDictField()); //下拉类型的数据字典编码
map.put("db_field_name", onlCgformField.getDbFieldName());//字段 map.put("db_field_name", onlCgformField.getDbFieldName());//字段
map.put("db_length", onlCgformField.getDbLength());//字段长度 map.put("db_length", onlCgformField.getDbLength());//字段长度
if (CutEnum.CN.getValue().equals(cut)) { if (LanguageEnum.CN.getValue().equals(cut)) {
map.put("db_field_txt", onlCgformField.getDbFieldTxt());//字段中文名 map.put("db_field_txt", onlCgformField.getDbFieldTxt());//字段中文名
} else { } else {
map.put("db_field_txt", onlCgformField.getDbFieldEnName());//字段英文名 map.put("db_field_txt", onlCgformField.getDbFieldEnName());//字段英文名
@@ -3630,7 +3630,7 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
.sorted(Comparator.comparing(OnlCgformField::getOrderNum)) // 必须按顺序 才能导出时表头和数据一致 .sorted(Comparator.comparing(OnlCgformField::getOrderNum)) // 必须按顺序 才能导出时表头和数据一致
.collect(Collectors.toList()); .collect(Collectors.toList());
List<String> fieldForExport = new ArrayList<>(); List<String> fieldForExport = new ArrayList<>();
if (CutEnum.EN.getValue().equals(cut)){ if (LanguageEnum.EN.getValue().equals(cut)){
fieldForExport = fieldList.stream().map(OnlCgformField::getDbFieldEnName).collect(Collectors.toList()); fieldForExport = fieldList.stream().map(OnlCgformField::getDbFieldEnName).collect(Collectors.toList());
} else { } else {
fieldForExport = fieldList.stream().map(OnlCgformField::getDbFieldTxt).collect(Collectors.toList()); fieldForExport = fieldList.stream().map(OnlCgformField::getDbFieldTxt).collect(Collectors.toList());
@@ -3718,7 +3718,7 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
String dbFieldName = onlCgformField.getDbFieldName(); String dbFieldName = onlCgformField.getDbFieldName();
map.put("db_field_name", dbFieldName); map.put("db_field_name", dbFieldName);
if(CutEnum.CN.getValue().equals(cut)){ if(LanguageEnum.CN.getValue().equals(cut)){
map.put("db_field_txt", onlCgformField.getDbFieldTxt());//字段中文名 map.put("db_field_txt", onlCgformField.getDbFieldTxt());//字段中文名
}else{ }else{
map.put("db_field_txt", onlCgformField.getDbFieldEnName());//字段英文名 map.put("db_field_txt", onlCgformField.getDbFieldEnName());//字段英文名
@@ -4,7 +4,7 @@ import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jero.common.constant.enums.CutEnum; import com.jero.common.constant.enums.LanguageEnum;
import com.jero.common.constant.enums.ModuleEnum; import com.jero.common.constant.enums.ModuleEnum;
import com.jero.common.constant.enums.YesOrNoEnum; import com.jero.common.constant.enums.YesOrNoEnum;
import com.jero.common.exception.JeroBootException; import com.jero.common.exception.JeroBootException;
@@ -149,7 +149,7 @@ public class SarFileSplitInfoServiceImpl extends ServiceImpl<SarFileSplitInfoMap
default: default:
} }
if(result == -1){ if(result == -1){
if(CutEnum.CN.getValue().equals(sarFileSplitInfoEO.getCut())) { if(LanguageEnum.CN.getValue().equals(sarFileSplitInfoEO.getCut())) {
throw new JeroBootException("文档格式错误,请检查文档内容!"); throw new JeroBootException("文档格式错误,请检查文档内容!");
}else{ }else{
throw new JeroBootException("The document format is wrong. Please check the document content!"); throw new JeroBootException("The document format is wrong. Please check the document content!");
@@ -289,14 +289,14 @@ public class SarFileSplitInfoServiceImpl extends ServiceImpl<SarFileSplitInfoMap
String fileType = null; String fileType = null;
OnlCgformField fileTypeField = onlCgformFieldService.queryById(splitInfoEO.getFileType()); OnlCgformField fileTypeField = onlCgformFieldService.queryById(splitInfoEO.getFileType());
if (ObjectUtil.isNotEmpty(fileTypeField)) { if (ObjectUtil.isNotEmpty(fileTypeField)) {
if (CutEnum.CN.getValue().equals(cut)) { if (LanguageEnum.CN.getValue().equals(cut)) {
fileType = fileTypeField.getDbFieldTxt(); fileType = fileTypeField.getDbFieldTxt();
} else { } else {
fileType = fileTypeField.getDbFieldEnName(); fileType = fileTypeField.getDbFieldEnName();
} }
} }
if (CutEnum.CN.getValue().equals(cut)) { if (LanguageEnum.CN.getValue().equals(cut)) {
Map<String, String> cnMap = dictItemListAll.stream() Map<String, String> cnMap = dictItemListAll.stream()
.filter(e-> e.getItemValue().equals(splitInfoEO.getSplitResult())) .filter(e-> e.getItemValue().equals(splitInfoEO.getSplitResult()))
.collect(Collectors.toMap(SysDictItem::getItemValue, SysDictItem::getItemText)); // 优化 .collect(Collectors.toMap(SysDictItem::getItemValue, SysDictItem::getItemText)); // 优化
@@ -353,16 +353,16 @@ public class SarFileSplitInfoServiceImpl extends ServiceImpl<SarFileSplitInfoMap
map.put("sort", "true");//列表排序标识 map.put("sort", "true");//列表排序标识
} }
if(CutEnum.CN.getValue().equals(cut) && "title_en".equals(onlCgformField.getDbFieldName())) { if(LanguageEnum.CN.getValue().equals(cut) && "title_en".equals(onlCgformField.getDbFieldName())) {
continue; continue;
} }
if(CutEnum.EN.getValue().equals(cut) && "title".equals(onlCgformField.getDbFieldName())) { if(LanguageEnum.EN.getValue().equals(cut) && "title".equals(onlCgformField.getDbFieldName())) {
continue; continue;
} }
String dbFieldName = onlCgformField.getDbFieldName(); String dbFieldName = onlCgformField.getDbFieldName();
map.put("db_field_name", LineHumpUtil.lineToHump(dbFieldName)); map.put("db_field_name", LineHumpUtil.lineToHump(dbFieldName));
if(CutEnum.CN.getValue().equals(cut)){ if(LanguageEnum.CN.getValue().equals(cut)){
map.put("db_field_txt", onlCgformField.getDbFieldTxt());//字段中文名 map.put("db_field_txt", onlCgformField.getDbFieldTxt());//字段中文名
}else{ }else{
map.put("db_field_txt", onlCgformField.getDbFieldEnName());//字段英文名 map.put("db_field_txt", onlCgformField.getDbFieldEnName());//字段英文名
@@ -4,7 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.jero.common.api.vo.Result; import com.jero.common.api.vo.Result;
import com.jero.common.aspect.annotation.AutoLog; import com.jero.common.aspect.annotation.AutoLog;
import com.jero.common.constant.enums.CutEnum; import com.jero.common.constant.enums.LanguageEnum;
import com.jero.common.system.base.controller.JeroController; import com.jero.common.system.base.controller.JeroController;
import com.jero.modules.system.service.ISysDictItemService; import com.jero.modules.system.service.ISysDictItemService;
import com.jero.modules.tag.entity.OnlCgformArea; import com.jero.modules.tag.entity.OnlCgformArea;
@@ -97,7 +97,7 @@ public class OnlCgformAreaController extends JeroController<OnlCgformArea, IOnlC
if (count > 0) { if (count > 0) {
// TODO Cut属性一定能拿到?拿不到的时候显示中文还是英文?现在对吗?测试了吗? // TODO Cut属性一定能拿到?拿不到的时候显示中文还是英文?现在对吗?测试了吗?
//中英切换提示语 //中英切换提示语
if(CutEnum.CN.getValue().equals(onlCgformArea.getCut())) { if(LanguageEnum.CN.getValue().equals(onlCgformArea.getCut())) {
return Result.error("同一所属模块下,展示区域名称不能重复!"); return Result.error("同一所属模块下,展示区域名称不能重复!");
}else{ }else{
return Result.error("Under the same module, the display area name cannot be duplicate!"); return Result.error("Under the same module, the display area name cannot be duplicate!");
@@ -132,7 +132,7 @@ public class OnlCgformAreaController extends JeroController<OnlCgformArea, IOnlC
}else { }else {
//中英切换提示语 //中英切换提示语
// TODO Cut属性一定能拿到?拿不到的时候显示中文还是英文?现在对吗?测试了吗? // TODO Cut属性一定能拿到?拿不到的时候显示中文还是英文?现在对吗?测试了吗?
if (CutEnum.CN.getValue().equals(onlCgformArea.getCut())) { if (LanguageEnum.CN.getValue().equals(onlCgformArea.getCut())) {
return Result.error("同一所属模块下,展示区域名称不能重复!"); return Result.error("同一所属模块下,展示区域名称不能重复!");
} else { } else {
@@ -162,7 +162,7 @@ public class OnlCgformAreaController extends JeroController<OnlCgformArea, IOnlC
if (count > 0) { if (count > 0) {
//中英切换提示语 //中英切换提示语
// TODO 只改一半?编辑和新增改了,删除不改? // TODO 只改一半?编辑和新增改了,删除不改?
if(CutEnum.CN.getValue().equals(cut)) { if(LanguageEnum.CN.getValue().equals(cut)) {
return Result.error("该展示区域有关联数据,无法删除!"); return Result.error("该展示区域有关联数据,无法删除!");
}else{ }else{
return Result.error("This exhibition area has associated data and cannot be deleted!"); return Result.error("This exhibition area has associated data and cannot be deleted!");
@@ -201,7 +201,7 @@ public class OnlCgformAreaController extends JeroController<OnlCgformArea, IOnlC
OnlCgformArea onlCgformArea = onlCgformAreaService.queryById(id); OnlCgformArea onlCgformArea = onlCgformAreaService.queryById(id);
if(onlCgformArea==null) { if(onlCgformArea==null) {
//中英切换提示语 //中英切换提示语
if(CutEnum.CN.getValue().equals(onlCgformArea.getCut())) { if(LanguageEnum.CN.getValue().equals(onlCgformArea.getCut())) {
return Result.error("未找到对应数据"); return Result.error("未找到对应数据");
}else{ }else{
return Result.error("No corresponding data was found."); return Result.error("No corresponding data was found.");
@@ -246,7 +246,7 @@ public class OnlCgformAreaController extends JeroController<OnlCgformArea, IOnlC
OnlCgformArea onlCgformArea = (OnlCgformArea) onlCgformAreaService.selectShowAreaById(id); OnlCgformArea onlCgformArea = (OnlCgformArea) onlCgformAreaService.selectShowAreaById(id);
if(onlCgformArea==null) { if(onlCgformArea==null) {
//中英切换提示语 //中英切换提示语
if(CutEnum.CN.getValue().equals(onlCgformArea.getCut())) { if(LanguageEnum.CN.getValue().equals(onlCgformArea.getCut())) {
return Result.error("未找到对应数据"); return Result.error("未找到对应数据");
}else{ }else{
return Result.error("No corresponding data was found."); return Result.error("No corresponding data was found.");
@@ -5,17 +5,15 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.jero.common.api.vo.Result; import com.jero.common.api.vo.Result;
import com.jero.common.aspect.annotation.AutoLog; import com.jero.common.aspect.annotation.AutoLog;
import com.jero.common.constant.CommonConstant; import com.jero.common.constant.CommonConstant;
import com.jero.common.constant.enums.CutEnum; import com.jero.common.constant.enums.LanguageEnum;
import com.jero.common.exception.JeroBootException; import com.jero.common.exception.JeroBootException;
import com.jero.common.system.base.controller.JeroController; import com.jero.common.system.base.controller.JeroController;
import com.jero.common.system.vo.LoginUser; import com.jero.common.system.vo.LoginUser;
import com.jero.generater.modules.online.cgform.controller.OnlCgformApiController; import com.jero.generater.modules.online.cgform.controller.OnlCgformApiController;
import com.jero.modules.enums.FixedFieldEnum; import com.jero.modules.enums.FixedFieldEnum;
import com.jero.modules.system.service.impl.SysDictItemServiceImpl;
import com.jero.modules.tag.entity.OnlCgformArea; import com.jero.modules.tag.entity.OnlCgformArea;
import com.jero.modules.tag.entity.OnlCgformTag; import com.jero.modules.tag.entity.OnlCgformTag;
import com.jero.modules.tag.enums.FileTableIdEnum; import com.jero.modules.tag.enums.FileTableIdEnum;
import com.jero.modules.tag.mapper.OnlCgformTagMapper;
import com.jero.modules.tag.service.IOnlCgformTagService; import com.jero.modules.tag.service.IOnlCgformTagService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
@@ -49,16 +47,8 @@ public class OnlCgformTagController extends JeroController<OnlCgformTag, IOnlCgf
@Autowired @Autowired
private IOnlCgformTagService onlCgformTagService; private IOnlCgformTagService onlCgformTagService;
@Autowired
private OnlCgformTagController onlCgformAreaService;
@Autowired
private SysDictItemServiceImpl sysDictItemService;
@Autowired @Autowired
private OnlCgformApiController onlCgformApiController; private OnlCgformApiController onlCgformApiController;
@Autowired
private OnlCgformTagMapper onlCgformTagMapper;
/** /**
* 分页列表查询 * 分页列表查询
* *
@@ -133,7 +123,7 @@ public class OnlCgformTagController extends JeroController<OnlCgformTag, IOnlCgf
} }
}else{ }else{
//中英切换提示语 //中英切换提示语
if(CutEnum.CN.getValue().equals(onlCgformTag.getCut())) { if(LanguageEnum.CN.getValue().equals(onlCgformTag.getCut())) {
throw new JeroBootException("属性已存在,请检查"); throw new JeroBootException("属性已存在,请检查");
}else{ }else{
throw new JeroBootException("Attribute already exists, please check!"); throw new JeroBootException("Attribute already exists, please check!");
@@ -165,7 +155,7 @@ public class OnlCgformTagController extends JeroController<OnlCgformTag, IOnlCgf
checkData(); checkData();
if (FixedFieldEnum.FIXED_FIELD_ENUM.getValue().equals(onlCgformTag.getIsReadOnly()) || FixedFieldEnum.CONFIGURABLE_FIELD.getValue().equals(onlCgformTag.getIsReadOnly())) { if (FixedFieldEnum.FIXED_FIELD_ENUM.getValue().equals(onlCgformTag.getIsReadOnly()) || FixedFieldEnum.CONFIGURABLE_FIELD.getValue().equals(onlCgformTag.getIsReadOnly())) {
//中英切换提示语 //中英切换提示语
if(CutEnum.CN.getValue().equals(onlCgformTag.getCut())) { if(LanguageEnum.CN.getValue().equals(onlCgformTag.getCut())) {
return Result.error("固定字段,不可修改"); return Result.error("固定字段,不可修改");
}else{ }else{
return Result.error("Fixed field, which cannot be modified."); return Result.error("Fixed field, which cannot be modified.");
@@ -197,7 +187,7 @@ public class OnlCgformTagController extends JeroController<OnlCgformTag, IOnlCgf
} }
}else {//有未删数据,报错 }else {//有未删数据,报错
//中英切换提示语 //中英切换提示语
if(CutEnum.CN.getValue().equals(onlCgformTag.getCut())) { if(LanguageEnum.CN.getValue().equals(onlCgformTag.getCut())) {
return Result.error("属性已存在,请检查"); return Result.error("属性已存在,请检查");
}else{ }else{
return Result.error("Attribute already exists, please check!"); return Result.error("Attribute already exists, please check!");
@@ -233,7 +223,7 @@ public class OnlCgformTagController extends JeroController<OnlCgformTag, IOnlCgf
if(StringUtils.isNotBlank(String.valueOf(onlCgformTag.getIsReadOnly()))) { if(StringUtils.isNotBlank(String.valueOf(onlCgformTag.getIsReadOnly()))) {
if (FixedFieldEnum.FIXED_FIELD_ENUM.getValue().equals(onlCgformTag.getIsReadOnly()) || FixedFieldEnum.CONFIGURABLE_FIELD.getValue().equals(onlCgformTag.getIsReadOnly())) { if (FixedFieldEnum.FIXED_FIELD_ENUM.getValue().equals(onlCgformTag.getIsReadOnly()) || FixedFieldEnum.CONFIGURABLE_FIELD.getValue().equals(onlCgformTag.getIsReadOnly())) {
//中英切换提示语 //中英切换提示语
if(CutEnum.CN.getValue().equals(onlCgformTag.getCut())) { if(LanguageEnum.CN.getValue().equals(onlCgformTag.getCut())) {
result.error500("固定字段,不可删除"); result.error500("固定字段,不可删除");
}else{ }else{
result.error500("Fixed field, cannot be deleted."); result.error500("Fixed field, cannot be deleted.");
@@ -290,7 +280,7 @@ public class OnlCgformTagController extends JeroController<OnlCgformTag, IOnlCgf
OnlCgformTag midTag=onlCgformTagService.getById(list); OnlCgformTag midTag=onlCgformTagService.getById(list);
if (FixedFieldEnum.FIXED_FIELD_ENUM.getValue().equals(String.valueOf(midTag.getIsReadOnly())) || FixedFieldEnum.CONFIGURABLE_FIELD.getValue().equals(String.valueOf(midTag.getIsReadOnly()))) { if (FixedFieldEnum.FIXED_FIELD_ENUM.getValue().equals(String.valueOf(midTag.getIsReadOnly())) || FixedFieldEnum.CONFIGURABLE_FIELD.getValue().equals(String.valueOf(midTag.getIsReadOnly()))) {
//中英切换提示语 //中英切换提示语
if(CutEnum.CN.getValue().equals(midTag.getCut())) { if(LanguageEnum.CN.getValue().equals(midTag.getCut())) {
result.error500("包含固定字段,不可删除"); result.error500("包含固定字段,不可删除");
}else{ }else{
result.error500("It contains fixed fields and cannot be deleted."); result.error500("It contains fixed fields and cannot be deleted.");
@@ -299,7 +289,7 @@ public class OnlCgformTagController extends JeroController<OnlCgformTag, IOnlCgf
if (StringUtils.isNotBlank(String.valueOf(midTag.getIsReadOnly()))) { if (StringUtils.isNotBlank(String.valueOf(midTag.getIsReadOnly()))) {
if (FixedFieldEnum.FIXED_FIELD_ENUM.getValue().equals(String.valueOf(midTag.getIsReadOnly()))) { if (FixedFieldEnum.FIXED_FIELD_ENUM.getValue().equals(String.valueOf(midTag.getIsReadOnly()))) {
//中英切换提示语 //中英切换提示语
if(CutEnum.CN.getValue().equals(midTag.getCut())) { if(LanguageEnum.CN.getValue().equals(midTag.getCut())) {
result.error500("包含固定字段,不可删除"); result.error500("包含固定字段,不可删除");
}else{ }else{
result.error500("It contains fixed fields and cannot be deleted."); result.error500("It contains fixed fields and cannot be deleted.");
@@ -308,7 +298,7 @@ public class OnlCgformTagController extends JeroController<OnlCgformTag, IOnlCgf
onlCgformTagService.updateDictDelFlag(CommonConstant.DEL_FLAG_1, midTag.getId()); onlCgformTagService.updateDictDelFlag(CommonConstant.DEL_FLAG_1, midTag.getId());
//onlCgformApiController.h(String.valueOf(FileTableIdEnum.FILE_TABLE_ID),"normal");//逻辑删除-->改变状态,数据库不删 //onlCgformApiController.h(String.valueOf(FileTableIdEnum.FILE_TABLE_ID),"normal");//逻辑删除-->改变状态,数据库不删
//中英切换提示语 //中英切换提示语
if(CutEnum.CN.getValue().equals(midTag.getCut())) { if(LanguageEnum.CN.getValue().equals(midTag.getCut())) {
result.success("批量删除成功!"); result.success("批量删除成功!");
}else{ }else{
result.success("Batch deletion succeeded!"); result.success("Batch deletion succeeded!");
@@ -5,7 +5,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jero.common.constant.enums.CutEnum; import com.jero.common.constant.enums.LanguageEnum;
import com.jero.generater.modules.online.cgform.service.impl.OnlCgformFieldServiceImpl; import com.jero.generater.modules.online.cgform.service.impl.OnlCgformFieldServiceImpl;
import com.jero.modules.tag.entity.OnlCgformArea; import com.jero.modules.tag.entity.OnlCgformArea;
import com.jero.modules.tag.mapper.OnlCgformAreaMapper; import com.jero.modules.tag.mapper.OnlCgformAreaMapper;
@@ -190,7 +190,7 @@ public class OnlCgformAreaServiceImpl extends ServiceImpl<OnlCgformAreaMapper, O
@Override @Override
public List<OnlCgformArea> queryShowArea(String cut, OnlCgformArea onlCgformArea) { public List<OnlCgformArea> queryShowArea(String cut, OnlCgformArea onlCgformArea) {
QueryWrapper<OnlCgformArea> queryWrapper = new QueryWrapper<>(); QueryWrapper<OnlCgformArea> queryWrapper = new QueryWrapper<>();
if (CutEnum.CN.getValue().equals(cut)) { if (LanguageEnum.CN.getValue().equals(cut)) {
queryWrapper.select("id", "show_area").orderByAsc("sort"); queryWrapper.select("id", "show_area").orderByAsc("sort");
return list(queryWrapper); return list(queryWrapper);
} else { } else {
@@ -220,7 +220,7 @@ public class OnlCgformAreaServiceImpl extends ServiceImpl<OnlCgformAreaMapper, O
List<OnlCgformArea> records = result.getRecords(); List<OnlCgformArea> records = result.getRecords();
String cut = (String) params.get("cut"); String cut = (String) params.get("cut");
//中英切换-所属模块 //中英切换-所属模块
if(CutEnum.EN.getValue().equals(cut)){ if(LanguageEnum.EN.getValue().equals(cut)){
for(OnlCgformArea data:records){ for(OnlCgformArea data:records){
data.setIsModelName(data.getIsModelEnName()); data.setIsModelName(data.getIsModelEnName());
} }
@@ -8,7 +8,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jero.common.constant.CommonConstant; import com.jero.common.constant.CommonConstant;
import com.jero.common.constant.enums.CutEnum; import com.jero.common.constant.enums.LanguageEnum;
import com.jero.common.constant.enums.YesOrNoEnum; import com.jero.common.constant.enums.YesOrNoEnum;
import com.jero.common.system.vo.LoginUser; import com.jero.common.system.vo.LoginUser;
import com.jero.generater.modules.online.cgform.service.impl.OnlCgformFieldServiceImpl; import com.jero.generater.modules.online.cgform.service.impl.OnlCgformFieldServiceImpl;
@@ -284,7 +284,7 @@ public class OnlCgformTagServiceImpl extends ServiceImpl<OnlCgformTagMapper, Onl
List<OnlCgformTag> records = result.getRecords(); List<OnlCgformTag> records = result.getRecords();
String cut = (String) params.get("cut"); String cut = (String) params.get("cut");
//中英切换-属性类型+展示区域列 //中英切换-属性类型+展示区域列
if(CutEnum.EN.getValue().equals(cut)){ if(LanguageEnum.EN.getValue().equals(cut)){
for(OnlCgformTag data:records){ for(OnlCgformTag data:records){
data.setFieldShowTypeName(data.getFieldShowTypeEnName()); data.setFieldShowTypeName(data.getFieldShowTypeEnName());
data.setShowAreaName(data.getShowAreaEnName()); data.setShowAreaName(data.getShowAreaEnName());