合并分支 'dev_third_stage' 到 'master'
Dev third stage 查看合并请求 laws-nio/laws-weilai!140
This commit is contained in:
@@ -894,6 +894,10 @@ UPDATE `laws_weilai`.`sys_dict_item` SET `en_name` = 'Fail' WHERE `id` = '149678
|
||||
UPDATE `laws_weilai`.`sys_dict_item` SET `en_name` = 'Depart' WHERE `id` = '1174511244036587521';
|
||||
UPDATE `laws_weilai`.`sys_dict_item` SET `en_name` = 'Company' WHERE `id` = '1174511197735665665';
|
||||
UPDATE `laws_weilai`.`sys_dict_item` SET `en_name` = 'Position' WHERE `id` = '1174509082208395266';
|
||||
-- 项目状态 project_status 2022-08-12
|
||||
UPDATE `laws_weilai`.`sys_dict_item` SET `en_name` = 'Development' WHERE `id` = '1513769417081630721';
|
||||
UPDATE `laws_weilai`.`sys_dict_item` SET `en_name` = 'Production' WHERE `id` = '1513769467044179970';
|
||||
|
||||
|
||||
-- 表字段 英文修改 2022-08-11
|
||||
-- OCR识别转换记录表
|
||||
@@ -913,3 +917,13 @@ UPDATE `laws_weilai`.`onl_cgform_field` SET `db_field_en_name` = 'Item No.' WHER
|
||||
UPDATE `laws_weilai`.`onl_cgform_field` SET `db_field_en_name` = 'Item Name' WHERE `id` = '9e91b704de198ccf2f5fb7297e675404';
|
||||
UPDATE `laws_weilai`.`onl_cgform_field` SET `db_field_en_name` = 'Item Content' WHERE `id` = '120a92b6d595c2fd68d2b90278357ce4';
|
||||
UPDATE `laws_weilai`.`onl_cgform_field` SET `db_field_en_name` = 'Technical Field' WHERE `id` = 'ccf68e6578a0a446a6ac34018f0a477d';
|
||||
-- 文档库信息表 2022-08-12
|
||||
UPDATE `laws_weilai`.`onl_cgform_field` SET `db_field_en_name` = 'Standard Type' WHERE `id` = '441588d80cc31ce68fbdf2ce8b36f93c';
|
||||
UPDATE `laws_weilai`.`onl_cgform_field` SET `db_field_en_name` = 'Area' WHERE `id` = '9f82d58f22a12792a53e202d64a39f06';
|
||||
-- 参数项收集清单 2022-08-12
|
||||
UPDATE `laws_weilai`.`onl_cgform_field` SET `db_field_en_name` = 'Para Batch' WHERE `id` = '161c35a16e92682972dd1aeb26151fa2';
|
||||
UPDATE `laws_weilai`.`onl_cgform_field` SET `db_field_en_name` = 'Para Name' WHERE `id` = 'e586bd87d4d826ce3d7d373caf54c6f6';
|
||||
UPDATE `laws_weilai`.`onl_cgform_field` SET `db_field_en_name` = 'Status' WHERE `id` = '9050dc65a7b2fe82927b74a9ef4a4bb4';
|
||||
UPDATE `laws_weilai`.`onl_cgform_field` SET `db_field_en_name` = 'Responsible Field' WHERE `id` = 'ed57f77975218560b37ea497a20109c6';
|
||||
UPDATE `laws_weilai`.`onl_cgform_field` SET `db_field_en_name` = 'Filled by' WHERE `id` = 'a371f6d49781c0921a48f317d1ba69b6';
|
||||
UPDATE `laws_weilai`.`onl_cgform_field` SET `db_field_en_name` = 'Eng. Interface' WHERE `id` = '58c3d5a50c86be19d5ab0cd5ac4d6d8b';
|
||||
|
||||
+9
-9
@@ -11,15 +11,15 @@ import java.util.Map;
|
||||
* @Date: Created in 15:17 2022/5/7
|
||||
*/
|
||||
public enum CollectManifestStateEnum {
|
||||
WAIT_COLLECT("待发起收集","Wait Collect","1"),
|
||||
WAIT_SDT("待工程接口人处理","Wait Sdt","2"),
|
||||
SDT_BACK("工程接口人退回","Sdt Back","3"),
|
||||
WAIT_FILL("待填写","Wait Fill","4"),
|
||||
DRE_BACK("填写人退回","Dre Back","5"),
|
||||
SUBMIT("已提交","Submit","6"),
|
||||
CERT_BACK("认证工程师退回","Cert Back","7"),
|
||||
SYNC_REPORT("已同步至上报库","Sync Report","8"),
|
||||
CHANGE("变更","Change","9");
|
||||
WAIT_COLLECT("待发起收集","To be collected","1"),
|
||||
WAIT_SDT("待工程接口人处理","To be processed by eng. interface","2"),
|
||||
SDT_BACK("工程接口人退回","Rejected by eng. interface","3"),
|
||||
WAIT_FILL("待填写","To be filled","4"),
|
||||
DRE_BACK("填写人退回","Rejected by the applicant","5"),
|
||||
SUBMIT("已提交","Submitted","6"),
|
||||
CERT_BACK("认证工程师退回","Rejected by homo engineer","7"),
|
||||
SYNC_REPORT("已同步至上报库","Synced to library","8"),
|
||||
CHANGE("变更","Modify","9");
|
||||
|
||||
String name;
|
||||
String enName;
|
||||
|
||||
+3
-3
@@ -9,9 +9,9 @@ import java.util.List;
|
||||
* @Date: Created in 16:47 2022/5/11
|
||||
*/
|
||||
public enum CollectManifestUserTypeEnum {
|
||||
HOMO("认证工程师", "Homologation Engineer", "homo"),
|
||||
SDT("工程接口人", "Sdt People","sdt"),
|
||||
DRE("填写人", "Dre People","dre"),
|
||||
HOMO("认证工程师", "Homo Engineer", "homo"),
|
||||
SDT("工程接口人", "Eng. Interface","sdt"),
|
||||
DRE("填写人", "Filled by","dre"),
|
||||
STUDIO("R&H Studio","R&H Studio","studio"),
|
||||
MANAGER("R&H Manager","R&H Manager","manager"),
|
||||
ADMIN("系统","Administrator","admin"),
|
||||
|
||||
+21
-8
@@ -1063,10 +1063,15 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
|
||||
studioList = projectLibraryBaseList.stream().map(ProjectLibraryBase::getStudioEngineerName).collect(Collectors.toList()); // studio 一个项目只有一个
|
||||
}
|
||||
|
||||
if (CollectionUtil.isEmpty(userRoleIds) && !studioList.contains(loginUser.getUsername())
|
||||
&& !homoList.contains(loginUser.getUsername())
|
||||
&& !sdtList.contains(loginUser.getUsername())
|
||||
&& !dreListOfPCM.contains(loginUser.getUsername())) {
|
||||
String loginUserName = loginUser.getUsername().toLowerCase();
|
||||
studioList = toLowerCaseOfList(studioList);
|
||||
homoList = toLowerCaseOfList(homoList);
|
||||
sdtList = toLowerCaseOfList(sdtList);
|
||||
dreListOfPCM = toLowerCaseOfList(dreListOfPCM);
|
||||
if (CollectionUtil.isEmpty(userRoleIds) && !studioList.contains(loginUserName)
|
||||
&& !homoList.contains(loginUserName)
|
||||
&& !sdtList.contains(loginUserName)
|
||||
&& !dreListOfPCM.contains(loginUserName)) {
|
||||
|
||||
Map<String, String> map = new HashMap<>();
|
||||
if (CutEnum.CN.getValue().equals(cut)) {
|
||||
@@ -1079,7 +1084,7 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
|
||||
return userTypeList;
|
||||
}
|
||||
|
||||
if (homoList.contains(loginUser.getUsername())) {
|
||||
if (homoList.contains(loginUserName)) {
|
||||
Map<String, String> map = new HashMap<>();
|
||||
if (CutEnum.CN.getValue().equals(cut)) {
|
||||
map.put("label", CollectManifestUserTypeEnum.HOMO.getName());
|
||||
@@ -1090,7 +1095,7 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
|
||||
userTypeList.add(map);
|
||||
}
|
||||
|
||||
if (sdtList.contains(loginUser.getUsername())) {
|
||||
if (sdtList.contains(loginUserName)) {
|
||||
Map<String, String> map = new HashMap<>();
|
||||
if (CutEnum.CN.getValue().equals(cut)) {
|
||||
map.put("label", CollectManifestUserTypeEnum.SDT.getName());
|
||||
@@ -1101,7 +1106,7 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
|
||||
userTypeList.add(map);
|
||||
}
|
||||
|
||||
if (dreListOfPCM.contains(loginUser.getUsername())) {
|
||||
if (dreListOfPCM.contains(loginUserName)) {
|
||||
Map<String, String> map = new HashMap<>();
|
||||
if (CutEnum.CN.getValue().equals(cut)) {
|
||||
map.put("label", CollectManifestUserTypeEnum.DRE.getName());
|
||||
@@ -1112,7 +1117,7 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
|
||||
userTypeList.add(map);
|
||||
}
|
||||
|
||||
if (studioList.contains(loginUser.getUsername())) {
|
||||
if (studioList.contains(loginUserName)) {
|
||||
Map<String, String> map = new HashMap<>();
|
||||
if (CutEnum.CN.getValue().equals(cut)) {
|
||||
map.put("label", CollectManifestUserTypeEnum.STUDIO.getName());
|
||||
@@ -1140,6 +1145,14 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
|
||||
return userTypeList;
|
||||
}
|
||||
|
||||
private List<String> toLowerCaseOfList(List<String> list) {
|
||||
List<String> newList = list;
|
||||
if (CollectionUtil.isNotEmpty(list)) {
|
||||
newList = list.stream().map(String::toLowerCase).collect(Collectors.toList());
|
||||
}
|
||||
return newList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> isCollectFinished(String paramsManifestId) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
|
||||
+36
-36
@@ -386,7 +386,7 @@ public class ParamsInfoEOServiceImpl extends ServiceImpl<ParamsInfoEOMapper, Par
|
||||
if (CutEnum.CN.getValue().equals(cut)) {
|
||||
bussExportParams.setSheetName("企业参数表");
|
||||
} else {
|
||||
bussExportParams.setSheetName("Company Params");
|
||||
bussExportParams.setSheetName("Company parameter");
|
||||
}
|
||||
bussExportParams.setType(ExcelType.XSSF); // 解决HSSFRichTextString cannot cast XSSFRichTextString问题
|
||||
bussExportParams.setStyle(CommonExcelExportStyler.class);
|
||||
@@ -727,7 +727,7 @@ public class ParamsInfoEOServiceImpl extends ServiceImpl<ParamsInfoEOMapper, Par
|
||||
// 创建参数对象(用来设定excel得sheet得内容等信息)
|
||||
ExportParams bussExportParams = new ExportParams();
|
||||
// 设置sheet得名称
|
||||
bussExportParams.setSheetName("Company Params");
|
||||
bussExportParams.setSheetName("Company parameter");
|
||||
bussExportParams.setType(ExcelType.XSSF); // 解决HSSFRichTextString cannot cast XSSFRichTextString问题
|
||||
bussExportParams.setStyle(CommonExcelExportStyler.class);
|
||||
// 创建sheet1使用得map
|
||||
@@ -930,8 +930,8 @@ public class ParamsInfoEOServiceImpl extends ServiceImpl<ParamsInfoEOMapper, Par
|
||||
// 第几个sheet页
|
||||
if (numSheet == 0) { // 企业参数表
|
||||
if (CutEnum.EN.getValue().equals(cut)) {
|
||||
String fields[] ={ "*NIO Number", "*Is Must", "*Params Name","*Params Batch","*Duty Territory",
|
||||
"Description", "*Control Type", "Control Verify", "Control Values", "Default Value", "File Template"};
|
||||
String fields[] ={ "*NIO Number", "*Required", "*Para Name","*Para Batch","*Responsible Field",
|
||||
"Description", "*Control Component", "Validate Component", "Component Value", "Default Value", "File Template"};
|
||||
params.setImportFields(fields);
|
||||
|
||||
ExcelImportResult<ParamsInfoEnImport> resultEn = ExcelImportUtil.importExcelMore(excelfile,ParamsInfoEnImport.class, params);
|
||||
@@ -950,7 +950,7 @@ public class ParamsInfoEOServiceImpl extends ServiceImpl<ParamsInfoEOMapper, Par
|
||||
if (certCategoryMap.containsKey(sheetName)) {
|
||||
List<CertCategoryParamsInfoCnImport> list = new ArrayList<>();
|
||||
if (CutEnum.EN.getValue().equals(cut)) {
|
||||
String fields[] ={ "*NIO Number", "*Number", "*Params Name","Description"};
|
||||
String fields[] ={ "*NIO Number", "*Number", "*Para Name","Description"};
|
||||
params.setImportFields(fields);
|
||||
|
||||
ExcelImportResult<CertCategoryParamsInfoEnImport> resultEn = ExcelImportUtil.importExcelMore(excelfile, CertCategoryParamsInfoEnImport.class, params);
|
||||
@@ -1235,7 +1235,7 @@ public class ParamsInfoEOServiceImpl extends ServiceImpl<ParamsInfoEOMapper, Par
|
||||
if(CutEnum.CN.getValue().equals(cut)) {
|
||||
errorMsg += "NIO编号格式错误,仅能为字母,数字,横杠(-),左斜杠,空格;";
|
||||
} else {
|
||||
errorMsg += "NIO number formatting errors, can only letters, numbers, dash (-),left slash,spaces;";
|
||||
errorMsg += "NIO number formatting errors, can only letters, numbers, dash (-),left slash,spaces; ";
|
||||
}
|
||||
countError++;
|
||||
}
|
||||
@@ -1257,10 +1257,10 @@ public class ParamsInfoEOServiceImpl extends ServiceImpl<ParamsInfoEOMapper, Par
|
||||
|
||||
// 是否必填
|
||||
String isMust = dto.getIsMust();
|
||||
resultMap = validateMustAndLength(isMust, "是否必填", "Is Must", IsMustEnum.YES.getValue(), "50", false, cut);
|
||||
resultMap = validateMustAndLength(isMust, "是否必填", "Required", IsMustEnum.YES.getValue(), "50", false, cut);
|
||||
errorMsg += (String)resultMap.get("errorMsg");
|
||||
countError += (int)resultMap.get("countError");
|
||||
resultMap = getCodeByName(isMust,"是否必填","Is Must","enum",paramsIsMustEnumMap,null,null,cut);
|
||||
resultMap = getCodeByName(isMust,"是否必填","Required","enum",paramsIsMustEnumMap,null,null,cut);
|
||||
errorMsg += (String)resultMap.get("errorMsg");
|
||||
countError += (int)resultMap.get("countError");
|
||||
isMust = (String)resultMap.get("value");
|
||||
@@ -1268,7 +1268,7 @@ public class ParamsInfoEOServiceImpl extends ServiceImpl<ParamsInfoEOMapper, Par
|
||||
|
||||
// 参数名称
|
||||
String paramsName = dto.getParamsName();
|
||||
resultMap = validateMustAndLength(paramsName, "参数名称", "Params Name", IsMustEnum.YES.getValue(), "100", false, cut);
|
||||
resultMap = validateMustAndLength(paramsName, "参数名称", "Para Name", IsMustEnum.YES.getValue(), "100", false, cut);
|
||||
errorMsg += (String)resultMap.get("errorMsg");
|
||||
countError += (int)resultMap.get("countError");
|
||||
|
||||
@@ -1285,10 +1285,10 @@ public class ParamsInfoEOServiceImpl extends ServiceImpl<ParamsInfoEOMapper, Par
|
||||
|
||||
// 参数批次
|
||||
String paramsBatch = dto.getParamsBatch();
|
||||
resultMap = validateMustAndLength(paramsBatch, "参数批次", "Params Batch", IsMustEnum.YES.getValue(), "50", true, cut);
|
||||
resultMap = validateMustAndLength(paramsBatch, "参数批次", "Para Batch", IsMustEnum.YES.getValue(), "50", true, cut);
|
||||
errorMsg += (String)resultMap.get("errorMsg");
|
||||
countError += (int)resultMap.get("countError");
|
||||
resultMap = getCodeByName(paramsBatch,"参数批次", "Params Batch", "dicCode",null,itemNameList,dictItemList,cut);
|
||||
resultMap = getCodeByName(paramsBatch,"参数批次", "Para Batch", "dicCode",null,itemNameList,dictItemList,cut);
|
||||
errorMsg += (String)resultMap.get("errorMsg");
|
||||
countError += (int)resultMap.get("countError");
|
||||
paramsBatch = (String)resultMap.get("value");
|
||||
@@ -1296,10 +1296,10 @@ public class ParamsInfoEOServiceImpl extends ServiceImpl<ParamsInfoEOMapper, Par
|
||||
|
||||
// 责任领域
|
||||
String dutyTerritory = dto.getDutyTerritory();
|
||||
resultMap = validateMustAndLength(dutyTerritory, "责任领域", "Duty Territory", IsMustEnum.YES.getValue(), "50",true, cut);
|
||||
resultMap = validateMustAndLength(dutyTerritory, "责任领域", "Responsible Field", IsMustEnum.YES.getValue(), "50",true, cut);
|
||||
errorMsg += (String)resultMap.get("errorMsg");
|
||||
countError += (int)resultMap.get("countError");
|
||||
resultMap = getCodeByName(dutyTerritory,"责任领域", "Duty Territory", "dicCode",null,itemNameList,dictItemList,cut);
|
||||
resultMap = getCodeByName(dutyTerritory,"责任领域", "Responsible Field", "dicCode",null,itemNameList,dictItemList,cut);
|
||||
errorMsg += (String)resultMap.get("errorMsg");
|
||||
countError += (int)resultMap.get("countError");
|
||||
dutyTerritory = (String)resultMap.get("value");
|
||||
@@ -1323,10 +1323,10 @@ public class ParamsInfoEOServiceImpl extends ServiceImpl<ParamsInfoEOMapper, Par
|
||||
|
||||
// 控件类型
|
||||
String controlType = dto.getControlType();
|
||||
resultMap = validateMustAndLength(controlType, "控件类型", "Control Type", IsMustEnum.YES.getValue(), "50", false, cut);
|
||||
resultMap = validateMustAndLength(controlType, "控件类型", "Control Component", IsMustEnum.YES.getValue(), "50", false, cut);
|
||||
errorMsg += (String)resultMap.get("errorMsg");
|
||||
countError += (int)resultMap.get("countError");
|
||||
resultMap = getCodeByName(controlType,"控件类型", "Control Type", "enum",controlTypeEnumMap,null,null,cut);
|
||||
resultMap = getCodeByName(controlType,"控件类型", "Control Component", "enum",controlTypeEnumMap,null,null,cut);
|
||||
errorMsg += (String)resultMap.get("errorMsg");
|
||||
countError += (int)resultMap.get("countError");
|
||||
controlType = (String)resultMap.get("value");
|
||||
@@ -1352,9 +1352,9 @@ public class ParamsInfoEOServiceImpl extends ServiceImpl<ParamsInfoEOMapper, Par
|
||||
|| ControlTypeEnum.TEXT_PULL_MORE.getValue().equals(controlType)
|
||||
|| ControlTypeEnum.TEXT_PULL_SINGLE.getValue().equals(controlType)
|
||||
|| ControlTypeEnum.TEXT_PULL_SINGLE_FILE.getValue().equals(controlType)) {
|
||||
resultMap = validateMustAndLength(controlValues, "控件备选值", "Control Values", IsMustEnum.YES.getValue(), "500", false, cut);
|
||||
resultMap = validateMustAndLength(controlValues, "控件备选值", "Component Value", IsMustEnum.YES.getValue(), "500", false, cut);
|
||||
} else {
|
||||
resultMap = validateMustAndLength(controlValues, "控件备选值", "Control Values", IsMustEnum.NO.getValue(), "500", false, cut);
|
||||
resultMap = validateMustAndLength(controlValues, "控件备选值", "Component Value", IsMustEnum.NO.getValue(), "500", false, cut);
|
||||
dto.setControlValues(null);
|
||||
}
|
||||
errorMsg += (String)resultMap.get("errorMsg");
|
||||
@@ -1367,22 +1367,22 @@ public class ParamsInfoEOServiceImpl extends ServiceImpl<ParamsInfoEOMapper, Par
|
||||
|| ControlTypeEnum.TEXT_PULL_MORE.getValue().equals(controlType)
|
||||
|| ControlTypeEnum.TEXT_FILE.getValue().equals(controlType)
|
||||
|| ControlTypeEnum.TEXT_PULL_SINGLE_FILE.getValue().equals(controlType)) {
|
||||
resultMap = validateMustAndLength(controlVerify, "控件校验", "Control Verify", IsMustEnum.YES.getValue(), "50", false, cut);
|
||||
resultMap = validateMustAndLength(controlVerify, "控件校验", "Validate Component", IsMustEnum.YES.getValue(), "50", false, cut);
|
||||
|
||||
errorMsg += (String)resultMap.get("errorMsg");
|
||||
countError += (int)resultMap.get("countError");
|
||||
resultMap = getCodeByName(controlVerify,"控件校验", "Control Verify", "enum",controlVerifyEnumMap,null,null,cut);
|
||||
resultMap = getCodeByName(controlVerify,"控件校验", "Validate Component", "enum",controlVerifyEnumMap,null,null,cut);
|
||||
errorMsg += (String)resultMap.get("errorMsg");
|
||||
countError += (int)resultMap.get("countError");
|
||||
controlVerify = (String)resultMap.get("value");
|
||||
dto.setControlVerify(controlVerify);
|
||||
|
||||
} else {
|
||||
resultMap = validateMustAndLength(controlVerify, "控件校验", "Control Verify", IsMustEnum.NO.getValue(), "50", false, cut);
|
||||
resultMap = validateMustAndLength(controlVerify, "控件校验", "Validate Component", IsMustEnum.NO.getValue(), "50", false, cut);
|
||||
|
||||
errorMsg += (String)resultMap.get("errorMsg");
|
||||
countError += (int)resultMap.get("countError");
|
||||
resultMap = getCodeByName(controlVerify,"控件校验", "Control Verify", "enum",controlVerifyEnumMap,null,null,cut);
|
||||
resultMap = getCodeByName(controlVerify,"控件校验", "Validate Component", "enum",controlVerifyEnumMap,null,null,cut);
|
||||
errorMsg += (String)resultMap.get("errorMsg");
|
||||
countError += (int)resultMap.get("countError");
|
||||
|
||||
@@ -1409,7 +1409,7 @@ public class ParamsInfoEOServiceImpl extends ServiceImpl<ParamsInfoEOMapper, Par
|
||||
if (CutEnum.CN.getValue().equals(cut)) {
|
||||
errorMsg += "附件模板只能上传一个文件;";
|
||||
} else {
|
||||
errorMsg += "File template only can upload one;";
|
||||
errorMsg += "File template only can upload one; ";
|
||||
}
|
||||
}
|
||||
for (String fileName : fileTemplateName.split(",")) {
|
||||
@@ -1419,7 +1419,7 @@ public class ParamsInfoEOServiceImpl extends ServiceImpl<ParamsInfoEOMapper, Par
|
||||
if (CutEnum.CN.getValue().equals(cut)) {
|
||||
errorMsg += "附件模板压缩包中没有" + fileName + "文件; ";
|
||||
} else {
|
||||
errorMsg += "File template " + fileName + "isn't present in the cabinet;";
|
||||
errorMsg += "File template " + fileName + "isn't present in the cabinet; ";
|
||||
}
|
||||
countError++;
|
||||
} else {
|
||||
@@ -1493,16 +1493,16 @@ public class ParamsInfoEOServiceImpl extends ServiceImpl<ParamsInfoEOMapper, Par
|
||||
if(CutEnum.CN.getValue().equals(cut)) {
|
||||
errorMsg += "nio编号格式错误,仅能为字母,数字,横杠(-),左斜杠,空格;";
|
||||
} else {
|
||||
errorMsg += "NIO number formatting errors, can only letters, numbers, dash (-),left slash,spaces;";
|
||||
errorMsg += "NIO number formatting errors, can only letters, numbers, dash (-),left slash,spaces; ";
|
||||
}
|
||||
countError++;
|
||||
}
|
||||
if (CollectionUtil.isNotEmpty(ccNioNumberImport)) {
|
||||
if (ccNioNumberImport.contains(ccDto.getNioNumber())) {
|
||||
if (CutEnum.CN.getValue().equals(cut)) {
|
||||
errorMsg += "NIO编号重复!";
|
||||
errorMsg += "NIO编号重复;";
|
||||
} else {
|
||||
errorMsg += "NIO number already exists!";
|
||||
errorMsg += "NIO number already exists; ";
|
||||
}
|
||||
countError++;
|
||||
} else {
|
||||
@@ -1524,14 +1524,14 @@ public class ParamsInfoEOServiceImpl extends ServiceImpl<ParamsInfoEOMapper, Par
|
||||
if(CutEnum.CN.getValue().equals(cut)) {
|
||||
errorMsg += "编号格式错误,仅能为字母,数字,横杠(-),小数点(.),左斜杠,空格;";
|
||||
} else {
|
||||
errorMsg += "Number formatting errors, can only letters, numbers, dash (-),dot (.),left slash,spaces;";
|
||||
errorMsg += "Number formatting errors, can only letters, numbers, dash (-),dot (.),left slash,spaces; ";
|
||||
}
|
||||
countError++;
|
||||
}
|
||||
}
|
||||
// 参数名称
|
||||
String paramsName = ccDto.getParamsName();
|
||||
resultMap = validateMustAndLength(paramsName, "参数名称", "Params Name", IsMustEnum.YES.getValue(),"100", false, cut);
|
||||
resultMap = validateMustAndLength(paramsName, "参数名称", "Para Name", IsMustEnum.YES.getValue(),"100", false, cut);
|
||||
errorMsg += (String)resultMap.get("errorMsg");
|
||||
countError += (int)resultMap.get("countError");
|
||||
// 参数说明
|
||||
@@ -1558,7 +1558,7 @@ public class ParamsInfoEOServiceImpl extends ServiceImpl<ParamsInfoEOMapper, Par
|
||||
if (CutEnum.CN.getValue().equals(cut)) {
|
||||
stringMessage.add("导入数据中NIO编号:" + reduceOne + "下存在重复认证类别;");
|
||||
} else {
|
||||
stringMessage.add("Repeat cert category exist in NIO Number: " + reduceOne + ";");
|
||||
stringMessage.add("Repeat cert category exist in NIO Number: " + reduceOne + "; ");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1579,7 +1579,7 @@ public class ParamsInfoEOServiceImpl extends ServiceImpl<ParamsInfoEOMapper, Par
|
||||
if (CutEnum.CN.getValue().equals(cut)) {
|
||||
stringMessage.add("导入数据中NIO编号:" + reduceTwo + "下存在重复认证编号;");
|
||||
} else {
|
||||
stringMessage.add("Repeat number exist in NIO Number: " + reduceTwo + ";");
|
||||
stringMessage.add("Repeat number exist in NIO Number: " + reduceTwo + "; ");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1635,7 +1635,7 @@ public class ParamsInfoEOServiceImpl extends ServiceImpl<ParamsInfoEOMapper, Par
|
||||
if(CutEnum.CN.getValue().equals(cut)) {
|
||||
errorMsg += fieldNameCn + "为必填项,不能为空;";
|
||||
} else {
|
||||
errorMsg += fieldNameEn + " is mandatory and cannot be empty;";
|
||||
errorMsg += fieldNameEn + " is mandatory and cannot be empty; ";
|
||||
}
|
||||
countError++;
|
||||
}
|
||||
@@ -1644,7 +1644,7 @@ public class ParamsInfoEOServiceImpl extends ServiceImpl<ParamsInfoEOMapper, Par
|
||||
if(CutEnum.CN.getValue().equals(cut)) {
|
||||
errorMsg += fieldNameCn + "不能超过" + dbLength + "个字符;";
|
||||
} else {
|
||||
errorMsg += fieldNameEn + " can not be more than " + dbLength + " char;";
|
||||
errorMsg += fieldNameEn + " can not be more than " + dbLength + " char; ";
|
||||
}
|
||||
countError++;
|
||||
}
|
||||
@@ -1655,7 +1655,7 @@ public class ParamsInfoEOServiceImpl extends ServiceImpl<ParamsInfoEOMapper, Par
|
||||
if (CutEnum.CN.getValue().equals(cut)) {
|
||||
errorMsg += fieldNameCn + "为单选项;";
|
||||
} else {
|
||||
errorMsg += fieldNameEn + " is single type;";
|
||||
errorMsg += fieldNameEn + " is single type; ";
|
||||
}
|
||||
countError++;
|
||||
}
|
||||
@@ -1687,7 +1687,7 @@ public class ParamsInfoEOServiceImpl extends ServiceImpl<ParamsInfoEOMapper, Par
|
||||
if(CutEnum.CN.getValue().equals(cut)) {
|
||||
errorMsg += fieldNameCn + "中的" + lastValue + "与数据字典不匹配;";
|
||||
} else {
|
||||
errorMsg += fieldNameEn +" "+ lastValue + " does not match the data dictionary;";
|
||||
errorMsg += fieldNameEn +" "+ lastValue + " does not match the data dictionary; ";
|
||||
}
|
||||
countError++;
|
||||
}
|
||||
@@ -1742,7 +1742,7 @@ public class ParamsInfoEOServiceImpl extends ServiceImpl<ParamsInfoEOMapper, Par
|
||||
if(CutEnum.CN.getValue().equals(cut)) {
|
||||
errorMsg += fieldNameCn + "中的" + valueTemp + "与数据字典不匹配;";
|
||||
} else{
|
||||
errorMsg += fieldNameEn + " " + valueTemp + " does not match the data dictionary";
|
||||
errorMsg += fieldNameEn + " " + valueTemp + " does not match the data dictionary; ";
|
||||
}
|
||||
countError++;
|
||||
}
|
||||
@@ -1777,7 +1777,7 @@ public class ParamsInfoEOServiceImpl extends ServiceImpl<ParamsInfoEOMapper, Par
|
||||
if(CutEnum.CN.getValue().equals(cut)) {
|
||||
errorMsg += fieldNameCn + "中的" + value + "不正确;";
|
||||
} else{
|
||||
errorMsg += fieldNameEn + " " + value + " is not correct";
|
||||
errorMsg += fieldNameEn + " " + value + " is not correct; ";
|
||||
}
|
||||
countError++;
|
||||
}
|
||||
|
||||
+1
-1
@@ -47,7 +47,7 @@ public class CertCategoryParamsInfoEnExport {
|
||||
private String paramsNumber;
|
||||
|
||||
/**参数名称*/
|
||||
@Excel(name = "*Params Name", width = 15, orderNum = "3")
|
||||
@Excel(name = "*Para Name", width = 15, orderNum = "3")
|
||||
@ApiModelProperty(value = "参数名称")
|
||||
private String paramsName;
|
||||
|
||||
|
||||
+1
-1
@@ -47,7 +47,7 @@ public class CertCategoryParamsInfoEnImport {
|
||||
private String paramsNumber;
|
||||
|
||||
/**参数名称*/
|
||||
@Excel(name = "*Params Name", width = 15, orderNum = "3")
|
||||
@Excel(name = "*Para Name", width = 15, orderNum = "3")
|
||||
@ApiModelProperty(value = "参数名称")
|
||||
private String paramsName;
|
||||
|
||||
|
||||
+7
-7
@@ -50,12 +50,12 @@ public class ParamsInfoEnExport {
|
||||
private String nioNumber;
|
||||
|
||||
/**是否必填*/
|
||||
@Excel(name = "*Is Must", width = 15, replace = {"yes_1","no_0"})
|
||||
@Excel(name = "*Required", width = 15, replace = {"yes_1","no_0"})
|
||||
@ApiModelProperty(value = "是否必填")
|
||||
private String isMust;
|
||||
|
||||
/**参数名称*/
|
||||
@Excel(name = "*Params Name", width = 15)
|
||||
@Excel(name = "*Para Name", width = 15)
|
||||
@ApiModelProperty(value = "参数名称")
|
||||
private String paramsName;
|
||||
|
||||
@@ -66,13 +66,13 @@ public class ParamsInfoEnExport {
|
||||
private String technologyTerritory;
|
||||
|
||||
/**参数批次*/
|
||||
@Excel(name = "*Params Batch", width = 15, dicCode = "params_batch_en")
|
||||
@Excel(name = "*Para Batch", width = 15, dicCode = "params_batch_en")
|
||||
@Dict(dicCode = "params_batch")
|
||||
@ApiModelProperty(value = "参数批次")
|
||||
private String paramsBatch;
|
||||
|
||||
/**责任领域*/
|
||||
@Excel(name = "*Duty Territory", width = 15, dicCode = "duty_territory_en")
|
||||
@Excel(name = "*Responsible Field", width = 15, dicCode = "duty_territory_en")
|
||||
@Dict(dicCode = "duty_territory")
|
||||
@ApiModelProperty(value = "责任领域")
|
||||
private String dutyTerritory;
|
||||
@@ -89,17 +89,17 @@ public class ParamsInfoEnExport {
|
||||
private String certCategory;
|
||||
|
||||
/**控件类型*/
|
||||
@Excel(name = "*Control Type", width = 15, replace = {"Text_1","Pull single_2","Pull more_3","File_4","Text+Pull single_5","Text+Pull more_6","Text+File_7","Pull single+File_8","Pull more+File_9","Text+Pull single+File_10","Title_11"})
|
||||
@Excel(name = "*Control Component", width = 15, replace = {"Text_1","Pull single_2","Pull more_3","File_4","Text+Pull single_5","Text+Pull more_6","Text+File_7","Pull single+File_8","Pull more+File_9","Text+Pull single+File_10","Title_11"})
|
||||
@ApiModelProperty(value = "控件类型")
|
||||
private String controlType;
|
||||
|
||||
/**控件校验*/
|
||||
@Excel(name = "Control Verify", width = 15, replace = {"Null_1","Chinese_2","Integer_3","Positive float_4","Integer decimal_5","Decimal one_6","Decimal two_7","Decimal three_8","Decimal four_9"})
|
||||
@Excel(name = "Validate Component", width = 15, replace = {"Null_1","Chinese_2","Integer_3","Positive float_4","Integer decimal_5","Decimal one_6","Decimal two_7","Decimal three_8","Decimal four_9"})
|
||||
@ApiModelProperty(value = "控件校验")
|
||||
private String controlVerify;
|
||||
|
||||
/**控件备选值*/
|
||||
@Excel(name = "Control Values", width = 15)
|
||||
@Excel(name = "Component Value", width = 15)
|
||||
@ApiModelProperty(value = "控件备选值")
|
||||
private String controlValues;
|
||||
|
||||
|
||||
+7
-7
@@ -18,12 +18,12 @@ public class ParamsInfoEnImport {
|
||||
private String nioNumber;
|
||||
|
||||
/**是否必填*/
|
||||
@Excel(name = "*Is Must", width = 15)
|
||||
@Excel(name = "*Required", width = 15)
|
||||
@ApiModelProperty(value = "是否必填")
|
||||
private String isMust;
|
||||
|
||||
/**参数名称*/
|
||||
@Excel(name = "*Params Name", width = 15)
|
||||
@Excel(name = "*Para Name", width = 15)
|
||||
@ApiModelProperty(value = "参数名称")
|
||||
private String paramsName;
|
||||
|
||||
@@ -33,12 +33,12 @@ public class ParamsInfoEnImport {
|
||||
private String technologyTerritory;
|
||||
|
||||
/**参数批次*/
|
||||
@Excel(name = "*Params Batch", width = 15)
|
||||
@Excel(name = "*Para Batch", width = 15)
|
||||
@ApiModelProperty(value = "参数批次")
|
||||
private String paramsBatch;
|
||||
|
||||
/**责任领域*/
|
||||
@Excel(name = "*Duty Territory", width = 15)
|
||||
@Excel(name = "*Responsible Field", width = 15)
|
||||
@ApiModelProperty(value = "责任领域")
|
||||
private String dutyTerritory;
|
||||
|
||||
@@ -53,17 +53,17 @@ public class ParamsInfoEnImport {
|
||||
private String certCategory;
|
||||
|
||||
/**控件类型*/
|
||||
@Excel(name = "*Control Type", width = 15)
|
||||
@Excel(name = "*Control Component", width = 15)
|
||||
@ApiModelProperty(value = "控件类型")
|
||||
private String controlType;
|
||||
|
||||
/**控件校验*/
|
||||
@Excel(name = "Control Verify", width = 15)
|
||||
@Excel(name = "Validate Component", width = 15)
|
||||
@ApiModelProperty(value = "控件校验")
|
||||
private String controlVerify;
|
||||
|
||||
/**控件备选值*/
|
||||
@Excel(name = "Control Values", width = 15)
|
||||
@Excel(name = "Component Value", width = 15)
|
||||
@ApiModelProperty(value = "控件备选值")
|
||||
private String controlValues;
|
||||
|
||||
|
||||
+1
-1
@@ -51,7 +51,7 @@ public class PPEmployee {
|
||||
private String data_provider; // 第三方数据提供商
|
||||
private String extension_attribute1; // O365标签
|
||||
private String working_hour; // 工作制
|
||||
private String domain; // 账号所属域
|
||||
private String domain; // 账号所属域 美国-amer
|
||||
private String ad_failed; // 创建ad失败原账号
|
||||
private String have_employees; // 是否有下属员工
|
||||
private String id; // id ----id
|
||||
|
||||
+14
-13
@@ -227,7 +227,7 @@ public class SyncDataServiceImpl implements ISyncDataService{
|
||||
JSONObject resultJsonEU = (JSONObject) myJsonEU.get("data");
|
||||
//将第一页的账户信息转换为本地dto集合
|
||||
List<JSONObject> userListEU = JSONObject.parseArray(resultJsonEU.get("list").toString(), JSONObject.class);
|
||||
List<PPEmployee> currentPPEmployeeListEU = getPPEmployeeList(userListEU, "EN");
|
||||
List<PPEmployee> currentPPEmployeeListEU = getPPEmployeeList(userListEU, "EU");
|
||||
ppEmployeeList.addAll(currentPPEmployeeListEU);
|
||||
|
||||
//获取总记录数
|
||||
@@ -246,7 +246,7 @@ public class SyncDataServiceImpl implements ISyncDataService{
|
||||
log.debug("【欧洲】打印输出本次同步信息返回结果:"+myJsonEU.get("data").toString());
|
||||
resultJsonEU = (JSONObject) myJsonEU.get("data");
|
||||
userListEU = JSONObject.parseArray(resultJsonEU.get("list").toString(), JSONObject.class);
|
||||
currentPPEmployeeListEU = getPPEmployeeList(userListEU, "EN");
|
||||
currentPPEmployeeListEU = getPPEmployeeList(userListEU, "EU");
|
||||
ppEmployeeList.addAll(currentPPEmployeeListEU);
|
||||
}
|
||||
}
|
||||
@@ -261,21 +261,22 @@ public class SyncDataServiceImpl implements ISyncDataService{
|
||||
for(PPEmployee ppEmployee:ppEmployeeList){
|
||||
try {
|
||||
PPEmployeeMap.put(ppEmployee.getWorker_user_id(), ppEmployee);
|
||||
//1.判断当前账号是否已添加到用户中
|
||||
if (!localUserMap.containsKey(ppEmployee.getWorker_user_id())) {
|
||||
//删除数据库中与该账户相同的数据
|
||||
if(StringUtils.isNotBlank(ppEmployee.getWorker_user_id())) {
|
||||
if (StringUtils.isNotBlank(ppEmployee.getWorker_user_id())) {
|
||||
ppEmployee.setWorker_user_id(ppEmployee.getWorker_user_id().toLowerCase()); // 转小写
|
||||
|
||||
//1.判断当前账号是否已添加到用户中
|
||||
if (!localUserMap.containsKey(ppEmployee.getWorker_user_id())) {
|
||||
//删除数据库中与该账户相同的数据
|
||||
// sysUserService.removeById(ppEmployee.getId()); // 这个为什么是逻辑删除
|
||||
log.info("需要新增的用户信息为:" + JSONObject.toJSONString(ppEmployee));
|
||||
SysUser newUser = sysUserService.addPPUserInfo(ppEmployee);
|
||||
localUserMap.put(ppEmployee.getWorker_user_id(), newUser);
|
||||
}
|
||||
|
||||
} else {
|
||||
SysUser userEO = localUserMap.get(ppEmployee.getWorker_user_id());
|
||||
log.info("需要更新的用户信息为:" + JSONObject.toJSONString(userEO) + " " + JSONObject.toJSONString(ppEmployee));
|
||||
if(userEO != null) {
|
||||
sysUserService.updatePPUserInfo(userEO, ppEmployee);
|
||||
}else {
|
||||
SysUser userEO = localUserMap.get(ppEmployee.getWorker_user_id());
|
||||
log.info("需要更新的用户信息为:" + JSONObject.toJSONString(userEO) + " " + JSONObject.toJSONString(ppEmployee));
|
||||
if (userEO != null) {
|
||||
sysUserService.updatePPUserInfo(userEO, ppEmployee);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+25
-13
@@ -2,14 +2,13 @@ package com.jero.modules.compare.controller;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.aspect.annotation.AutoLog;
|
||||
import com.jero.common.constant.enums.CutEnum;
|
||||
import com.jero.common.system.base.controller.JeroController;
|
||||
import com.jero.common.system.query.QueryGenerator;
|
||||
import com.jero.common.system.vo.LoginUser;
|
||||
import com.jero.generater.modules.online.cgform.entity.OnlCgformField;
|
||||
import com.jero.generater.modules.online.cgform.service.impl.OnlCgformFieldServiceImpl;
|
||||
@@ -17,6 +16,8 @@ import com.jero.modules.compare.entity.SarFileCompareDetailVO;
|
||||
import com.jero.modules.compare.entity.SarFileCompareInfo;
|
||||
import com.jero.modules.compare.service.ISarFileCompareInfoService;
|
||||
import com.jero.modules.docTranslation.enums.ReleaseConditionEnum;
|
||||
import com.jero.modules.system.entity.SysUser;
|
||||
import com.jero.modules.system.util.StringUtils;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -50,22 +51,33 @@ public class SarFileCompareInfoController extends JeroController<SarFileCompareI
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param sarFileCompareInfo
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "文档对比信息表-分页列表查询")
|
||||
@ApiOperation(value = "文档对比信息表-分页列表查询", notes = "文档对比信息表-分页列表查询")
|
||||
@GetMapping(value = "/page")
|
||||
public Result<?> queryPageList(SarFileCompareInfo sarFileCompareInfo, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
@RequestParam(name = "cut", defaultValue = "cn") String cut, HttpServletRequest req) {
|
||||
QueryWrapper<SarFileCompareInfo> queryWrapper = QueryGenerator.initQueryWrapper(sarFileCompareInfo, req.getParameterMap());
|
||||
public Result<?> queryPageList(@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
@RequestParam(name = "cut", defaultValue = "cn") String cut,
|
||||
@RequestParam(name = "serialNumber", defaultValue = "") String serialNumber,
|
||||
@RequestParam(name = "title", defaultValue = "") String title,
|
||||
@RequestParam(name = "releaseState", defaultValue = "") String releaseState,
|
||||
HttpServletRequest req) {
|
||||
LambdaQueryWrapper<SarFileCompareInfo> queryWrapper = new LambdaQueryWrapper<>();
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
queryWrapper.eq("create_by", sysUser.getUsername()).or().eq("release_state", ReleaseConditionEnum.PUBLISHED.getValue());
|
||||
queryWrapper.orderByAsc("create_by");
|
||||
queryWrapper.and(LambdaQueryWrapper -> LambdaQueryWrapper.eq(SarFileCompareInfo::getCreateBy, sysUser.getUsername()).or().eq(SarFileCompareInfo::getReleaseState, ReleaseConditionEnum.PUBLISHED.getValue()));
|
||||
if (StringUtils.isNotBlank(serialNumber)) {
|
||||
String finalSerialNumber = serialNumber.replace("%", "\\%");;
|
||||
queryWrapper.and(LambdaQueryWrapper -> LambdaQueryWrapper.like(SarFileCompareInfo::getSerialNumberLeft, finalSerialNumber).or().like(SarFileCompareInfo::getSerialNumberRight, finalSerialNumber));
|
||||
|
||||
}
|
||||
if (StringUtils.isNotBlank(title)) {
|
||||
String finalTitle = title.replace("%", "\\%");
|
||||
queryWrapper.and(i -> i.like(SarFileCompareInfo::getTitleLeft, finalTitle).or().like(SarFileCompareInfo::getTitleRight, finalTitle));
|
||||
}
|
||||
if (StringUtils.isNotBlank(releaseState)) {
|
||||
queryWrapper.and(LambdaQueryWrapper -> LambdaQueryWrapper.eq(SarFileCompareInfo::getReleaseState, releaseState));
|
||||
}
|
||||
queryWrapper.orderByDesc(SarFileCompareInfo::getCreateTime);
|
||||
Page<SarFileCompareInfo> page = new Page<>(pageNo, pageSize);
|
||||
IPage<SarFileCompareInfo> pageList = sarFileCompareInfoService.page(page, queryWrapper);
|
||||
for (SarFileCompareInfo info : pageList.getRecords()) {
|
||||
|
||||
+2
-2
@@ -233,7 +233,7 @@ public class SarFileCompareInfoServiceImpl extends ServiceImpl<SarFileCompareInf
|
||||
SarFileCompareInfo sarFileCompareInfo = new SarFileCompareInfo();
|
||||
String id = UUID.randomUUID().toString();
|
||||
sarFileCompareInfo.setId(id);
|
||||
sarFileCompareInfo.setFileIdLeft(leftInfo.getId());
|
||||
sarFileCompareInfo.setFileIdLeft(leftInfo.getFileId());
|
||||
// 处理文档库id字段 根据编号和标题查询
|
||||
List<Map<String, Object>> bussDocumentLibraryEOList = bussDocumentLibraryEOService.getListBySerialNumber(leftInfo.getSerialNumber());
|
||||
if (CollectionUtil.isNotEmpty(bussDocumentLibraryEOList)) {
|
||||
@@ -244,7 +244,7 @@ public class SarFileCompareInfoServiceImpl extends ServiceImpl<SarFileCompareInf
|
||||
sarFileCompareInfo.setFileTypeLeft(leftInfo.getFileType());
|
||||
sarFileCompareInfo.setSerialNumberLeft(leftInfo.getSerialNumber());
|
||||
|
||||
sarFileCompareInfo.setFileIdRight(rightInfo.getId());
|
||||
sarFileCompareInfo.setFileIdRight(rightInfo.getFileId());
|
||||
// 处理文档库id字段 根据编号和标题查询
|
||||
List<Map<String, Object>> bussDocumentLibraryEOList1 = bussDocumentLibraryEOService.getListBySerialNumber(rightInfo.getSerialNumber());
|
||||
if (CollectionUtil.isNotEmpty(bussDocumentLibraryEOList1)) {
|
||||
|
||||
+5
-5
@@ -222,7 +222,7 @@ public class ExtRepoFolderServiceImpl extends ServiceImpl<ExtRepoFolderMapper, E
|
||||
public List<ERFTreeData> queryTreeList() {
|
||||
try {
|
||||
List<ExtRepoFolder> list = queryList();
|
||||
List<ERFTreeData> res = getSubFolder(superFolder, list, 1, true);
|
||||
List<ERFTreeData> res = getSubFolder(superFolder, list, 1);
|
||||
Collections.sort(res);
|
||||
return res;
|
||||
} catch (Exception ex) {
|
||||
@@ -235,22 +235,22 @@ public class ExtRepoFolderServiceImpl extends ServiceImpl<ExtRepoFolderMapper, E
|
||||
/**
|
||||
* 查找子文件夹,生成树结构
|
||||
*/
|
||||
private List<ERFTreeData> getSubFolder(String supId, List<ExtRepoFolder> list, int level, boolean needAuth) {
|
||||
private List<ERFTreeData> getSubFolder(String supId, List<ExtRepoFolder> list, int level) {
|
||||
List<ERFTreeData> resList = new ArrayList<>();
|
||||
for (ExtRepoFolder erf : list) {
|
||||
if (supId.equals(erf.getSupFolder())) {
|
||||
int childLevel = level + 1;
|
||||
if (!needAuth || haveViewAuth(erf.getId())) {
|
||||
if (haveViewAuth(erf.getId())) {
|
||||
ERFTreeData date = new ERFTreeData(erf.getFolderName(), erf.getId(), level, erf.getOrderId());
|
||||
date.setAuthManageIdsName(erf.getAuthManageIdsName());
|
||||
date.setAuthManageIds(erf.getAuthManageIds());
|
||||
date.setAuthViewIdsName(erf.getAuthViewIdsName());
|
||||
date.setAuthViewIds(erf.getAuthViewIds());
|
||||
date.setChildren(getSubFolder(erf.getId(), list, childLevel, false));
|
||||
date.setChildren(getSubFolder(erf.getId(), list, childLevel));
|
||||
date.sortChildren();
|
||||
resList.add(date);
|
||||
} else {
|
||||
resList.addAll(getSubFolder(erf.getId(), list, childLevel, true));
|
||||
resList.addAll(getSubFolder(erf.getId(), list, childLevel));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+5
@@ -67,6 +67,11 @@ public class LarkController {
|
||||
log.info("给"+employeeId+"用户推送知识库一级分类菜单:==========================================================");
|
||||
feishuService.sendKnowledgeBaseTypeCard(employeeId.split(","));
|
||||
}
|
||||
//判断用户发送的消息内容,如果包含"负责人" 那么给用户推送知识库分类负责人信息
|
||||
if(StringUtils.contains(text,"负责人")){
|
||||
log.info("给"+employeeId+"用户推送知识库负责人:==========================================================");
|
||||
feishuService.sendKnowledgeBaseTypeChargePersonCard(employeeId.split(","));
|
||||
}
|
||||
}
|
||||
}
|
||||
return decrypt;
|
||||
|
||||
+6
@@ -56,4 +56,10 @@ public interface IFeishuService {
|
||||
* @param jsonObject
|
||||
*/
|
||||
void sendKnowledgeBaseInfoCard(JSONObject jsonObject);
|
||||
|
||||
/**
|
||||
* 发送知识库分类负责人卡片消息 (用户输入负责人的时候)
|
||||
* @param split
|
||||
*/
|
||||
void sendKnowledgeBaseTypeChargePersonCard(String[] split);
|
||||
}
|
||||
|
||||
+89
@@ -213,6 +213,16 @@ public class FeishuServiceImpl implements IFeishuService {
|
||||
contentSb.append("}");
|
||||
contentSb.append("}");
|
||||
}
|
||||
if (StrUtil.isNotEmpty(feishuMsgVo.getAssignee())){
|
||||
contentSb.append(",");
|
||||
contentSb.append("{");
|
||||
contentSb.append("\"is_short\": false,");
|
||||
contentSb.append("\"text\": {");
|
||||
contentSb.append("\"content\": \"**Assignee:** " + feishuMsgVo.getAssignee() + "\",");
|
||||
contentSb.append("\"tag\": \"lark_md\"");
|
||||
contentSb.append("}");
|
||||
contentSb.append("}");
|
||||
}
|
||||
if (StrUtil.isNotEmpty(feishuMsgVo.getDueDate())){
|
||||
contentSb.append(",");
|
||||
contentSb.append("{");
|
||||
@@ -542,4 +552,83 @@ public class FeishuServiceImpl implements IFeishuService {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendKnowledgeBaseTypeChargePersonCard(String[] userIds) {
|
||||
String token = null;
|
||||
try {
|
||||
token = getTenantAccessToken();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
// 设置请求头
|
||||
Map<String, String> headerMap = new HashMap<>();
|
||||
headerMap.put("Authorization", "Bearer " + token);
|
||||
headerMap.put("Content-Type", "application/json; charset=utf-8");
|
||||
|
||||
String sendJson = " {\n" +
|
||||
" \"config\": {\n" +
|
||||
" \"wide_screen_mode\": true\n" +
|
||||
" },\n" +
|
||||
" \"header\": {\n" +
|
||||
" \"title\": {\n" +
|
||||
" \"tag\": \"plain_text\",\n" +
|
||||
" \"content\": \"点击下方的分类查看常见问题\"\n" +
|
||||
" },\n" +
|
||||
" \"template\": \"green\"\n" +
|
||||
" }\n" +
|
||||
"}";
|
||||
JSONObject jsonObject = JSONObject.parseObject(sendJson);
|
||||
JSONArray elements = new JSONArray();
|
||||
JSONObject element = new JSONObject();
|
||||
element.put("tag","action");
|
||||
element.put("layout","bisected");
|
||||
|
||||
//获取分类
|
||||
List<ProblemKnowledgeBaseClassifyEO> problemKnowledgeBaseClassifyEOList = this.problemKnowledgeBaseClassifyEOService.list();
|
||||
this.problemKnowledgeBaseClassifyEOService.disposeData(problemKnowledgeBaseClassifyEOList);
|
||||
|
||||
JSONArray actions = new JSONArray();
|
||||
|
||||
//组装推送过去的点击按钮
|
||||
for (ProblemKnowledgeBaseClassifyEO problemKnowledgeBaseClassifyEO : problemKnowledgeBaseClassifyEOList) {
|
||||
JSONObject buttonObject = new JSONObject();
|
||||
JSONObject text = new JSONObject();
|
||||
JSONObject value = new JSONObject();
|
||||
buttonObject.put("tag","button");
|
||||
|
||||
text.put("tag","plain_text");
|
||||
text.put("content",problemKnowledgeBaseClassifyEO.getProblemLabel() + " [" + problemKnowledgeBaseClassifyEO.getChargePersonIdName() + "]");
|
||||
value.put("chosen",problemKnowledgeBaseClassifyEO.getChargePersonId());
|
||||
|
||||
buttonObject.put("text",text);
|
||||
buttonObject.put("type","primary");
|
||||
buttonObject.put("value",value);
|
||||
actions.add(buttonObject);
|
||||
}
|
||||
|
||||
element.put("actions",actions);
|
||||
|
||||
|
||||
elements.add(element);
|
||||
jsonObject.put("elements",elements);
|
||||
// 设置请求参数
|
||||
JSONObject paramsMap = new JSONObject();
|
||||
paramsMap.put("user_ids", userIds);
|
||||
paramsMap.put("msg_type", "interactive");
|
||||
paramsMap.put("card", jsonObject);
|
||||
|
||||
// 发送请求给飞书
|
||||
String response = null;
|
||||
try {
|
||||
response = HttpRequestUtil.getResponseOfPOST(batchSendMessageUrl, headerMap, paramsMap.toJSONString());
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
// 获取返回结果
|
||||
JSONObject tokenJson = JSONObject.parseObject(response);
|
||||
if(!tokenJson.get("code").toString().equals("0")) {
|
||||
log.error("请求出现异常:" + tokenJson.get("msg") + " " + tokenJson);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -24,5 +24,7 @@ public class FeishuMsgVo {
|
||||
|
||||
private String url; //回调的网址
|
||||
|
||||
private String assignee; //评估人 适用范围:责任人提交通知发起人(设计符合性,pre-homo符合性,验证符合性)
|
||||
|
||||
}
|
||||
|
||||
|
||||
+10
-6
@@ -72,9 +72,11 @@ public class CountryCardManageReleaseEOController extends JeroController<Country
|
||||
@AutoLog(value = "问题知识库-country_card-管理发布表-列表查询")
|
||||
@ApiOperation(value="问题知识库-country_card-管理发布表-列表查询", notes="问题知识库-country_card-管理发布表-列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<List<CountryCardManageReleaseEO>> queryList() {
|
||||
List<CountryCardManageReleaseEO> list = countryCardManageReleaseEOService.queryList();
|
||||
return Result.OK(list);
|
||||
public Result<List<CountryCardManageReleaseEO>> queryList(CountryCardManageReleaseEO countryCardManageReleaseEO,
|
||||
HttpServletRequest req,
|
||||
@RequestParam(name="cut", defaultValue="cn") String cut) {
|
||||
List<CountryCardManageReleaseEO> list = countryCardManageReleaseEOService.queryList(countryCardManageReleaseEO,req,cut);
|
||||
return Result.OK(cut,list);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -194,8 +196,9 @@ public class CountryCardManageReleaseEOController extends JeroController<Country
|
||||
@AutoLog(value = "问题知识库-country_card-管理发布-获取适用市场下拉选")
|
||||
@ApiOperation(value="问题知识库-country_card-管理发布-获取适用市场下拉选", notes="问题知识库-country_card-管理发布-获取适用市场下拉选")
|
||||
@GetMapping(value = "/getApplyMarketList")
|
||||
public Result<List<DictModel>> getApplyMarketList(@RequestParam(name = "queryFlag",required=false) String queryFlag) {
|
||||
Result<List<DictModel>> result = this.countryCardManageReleaseEOService.getApplyMarketList(queryFlag);
|
||||
public Result<List<DictModel>> getApplyMarketList(@RequestParam(name = "queryFlag",required=false) String queryFlag,
|
||||
@RequestParam(name = "cut",required = true) String cut) {
|
||||
Result<List<DictModel>> result = this.countryCardManageReleaseEOService.getApplyMarketList(queryFlag,cut);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -208,7 +211,8 @@ public class CountryCardManageReleaseEOController extends JeroController<Country
|
||||
@ApiOperation(value="问题知识库-country_card-管理发布表-根据多个适用地区查询数据", notes="问题知识库-country_card-管理发布表-根据多个适用地区查询数据")
|
||||
@PostMapping(value = "/queryCountryCardManageReleaseByApplyMarkets")
|
||||
public Result<List<CountryCardManageReleaseEO>> queryCountryCardManageReleaseByApplyMarkets(@RequestBody JSONObject params) {
|
||||
String cut = params.getString("cut");
|
||||
List<CountryCardManageReleaseEO> list = countryCardManageReleaseEOService.queryCountryCardManageReleaseByApplyMarkets(params);
|
||||
return Result.OK(list);
|
||||
return Result.OK(cut,list);
|
||||
}
|
||||
}
|
||||
|
||||
+5
-2
@@ -5,6 +5,7 @@ import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.system.vo.DictModel;
|
||||
import com.jero.modules.problemKnowledgeBase.entity.CountryCardManageReleaseEO;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -60,7 +61,9 @@ public interface ICountryCardManageReleaseEOService extends IService<CountryCard
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
List<CountryCardManageReleaseEO> queryList();
|
||||
List<CountryCardManageReleaseEO> queryList(CountryCardManageReleaseEO countryCardManageReleaseEO,
|
||||
HttpServletRequest req,
|
||||
String cut);
|
||||
|
||||
/**
|
||||
* 处理数据
|
||||
@@ -79,7 +82,7 @@ public interface ICountryCardManageReleaseEOService extends IService<CountryCard
|
||||
* 获取适用市场
|
||||
* @return
|
||||
*/
|
||||
Result<List<DictModel>> getApplyMarketList(String queryFlag);
|
||||
Result<List<DictModel>> getApplyMarketList(String queryFlag,String cut);
|
||||
|
||||
List<CountryCardManageReleaseEO> queryCountryCardManageReleaseByApplyMarkets(JSONObject params);
|
||||
}
|
||||
|
||||
+17
-3
@@ -3,6 +3,8 @@ package com.jero.modules.problemKnowledgeBase.service.impl;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.constant.enums.CutEnum;
|
||||
import com.jero.common.system.query.QueryGenerator;
|
||||
import com.jero.common.system.vo.DictModel;
|
||||
import com.jero.modules.problemKnowledgeBase.entity.CountryCardManageReleaseDetailEO;
|
||||
import com.jero.modules.problemKnowledgeBase.entity.CountryCardManageReleaseEO;
|
||||
@@ -29,6 +31,8 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
/**
|
||||
* @Description: 问题知识库-country_card-管理发布表
|
||||
* @Author: jero-boot
|
||||
@@ -123,8 +127,12 @@ public class CountryCardManageReleaseEOServiceImpl extends ServiceImpl<CountryCa
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<CountryCardManageReleaseEO> queryList() {
|
||||
return list();
|
||||
public List<CountryCardManageReleaseEO> queryList(CountryCardManageReleaseEO countryCardManageReleaseEO,
|
||||
HttpServletRequest req,
|
||||
String cut) {
|
||||
QueryWrapper<CountryCardManageReleaseEO> queryWrapper = QueryGenerator.initQueryWrapper(countryCardManageReleaseEO, req.getParameterMap());
|
||||
List<CountryCardManageReleaseEO> result = this.list(queryWrapper);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -199,7 +207,7 @@ public class CountryCardManageReleaseEOServiceImpl extends ServiceImpl<CountryCa
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result<List<DictModel>> getApplyMarketList(String queryFlag) {
|
||||
public Result<List<DictModel>> getApplyMarketList(String queryFlag,String cut) {
|
||||
List<DictModel> result = new ArrayList<>();
|
||||
|
||||
//获取所有的适用地区
|
||||
@@ -249,6 +257,12 @@ public class CountryCardManageReleaseEOServiceImpl extends ServiceImpl<CountryCa
|
||||
}
|
||||
}
|
||||
|
||||
if(StringUtils.equals(cut, CutEnum.EN.getValue())){
|
||||
result.forEach(data -> {
|
||||
data.setText(data.getTextEn());
|
||||
});
|
||||
}
|
||||
|
||||
return Result.OK(result);
|
||||
}
|
||||
|
||||
|
||||
+7
@@ -1,6 +1,7 @@
|
||||
package com.jero.modules.problemKnowledgeBase.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.jero.common.constant.enums.CutEnum;
|
||||
import com.jero.common.system.query.QueryGenerator;
|
||||
import com.jero.modules.problemKnowledgeBase.entity.CountryCardManageReleaseDetailEO;
|
||||
import com.jero.modules.problemKnowledgeBase.entity.CountryCardManageReleaseEO;
|
||||
@@ -171,6 +172,12 @@ public class CountryCardTempEOServiceImpl extends ServiceImpl<CountryCardTempEOM
|
||||
return flag;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
if(StringUtils.equals(cut, CutEnum.EN.getValue())){
|
||||
collect.forEach(tempItem -> {
|
||||
tempItem.setItemText(tempItem.getEnName());
|
||||
});
|
||||
}
|
||||
|
||||
countryCardTemp.setCountryCardTempItemEOList(collect);
|
||||
}
|
||||
|
||||
|
||||
+7
-7
@@ -1,16 +1,16 @@
|
||||
package com.jero.modules.project.enums;
|
||||
|
||||
public enum ProjectTaskPlanningNameEnum {
|
||||
LIST_CONFIRMATION("清单确认"," Checklist confirmation"),
|
||||
LEGAL_TASK_CONFIRMATION("任务确认","Task confirmation"),
|
||||
DESIGN_DEADLINE("设计符合性","Design compliance"),
|
||||
LIST_CONFIRMATION("法规清单确认","Regulation List Confirmation"),
|
||||
LEGAL_TASK_CONFIRMATION("法规任务确认","Regulation Task Confirmation"),
|
||||
DESIGN_DEADLINE("设计符合性确认","Design Compliance Confirmation"),
|
||||
// PREHOMO_DEADLINE("Pre-Homo","Pre-Homo"),
|
||||
// ATTESTATION_START_TIME("认证开始","Certification begins"),
|
||||
// ATTESTATION_END_TIME("认证结束"," End of certification"),
|
||||
PREHOMO_DEADLINE("摸底试验结束","Pre-Homo Completion"), // name:Pre-Homo value:Pre-Homo
|
||||
ATTESTATION_START_TIME("认证试验结束","Homo Test Completion"),// name:认证开始 value:Certification begins
|
||||
ATTESTATION_END_TIME("认证批准","Type Approval"),// name:认证结束 value:End of certification
|
||||
VERIFY_DEADLINE("验证符合性","Verify compliance"),
|
||||
PREHOMO_DEADLINE("Pre-Homo确认","Pre-Homo Confirmation"), // name:Pre-Homo value:Pre-Homo
|
||||
ATTESTATION_START_TIME("认证结束","Homo Completion"),// name:认证开始 value:Certification begins
|
||||
ATTESTATION_END_TIME("认证开始","Homo KO"),// name:认证结束 value:End of certification
|
||||
VERIFY_DEADLINE("验证符合性确认","Validation Compliance Confirmation"),
|
||||
;
|
||||
String name;
|
||||
String value;
|
||||
|
||||
+18
-15
@@ -2273,10 +2273,11 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
|
||||
taskType = "Design Compliance Confirmation";
|
||||
|
||||
initiator = MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName();
|
||||
SysUser initiatorLarkInfo = this.sysUserMapper.selectOne(
|
||||
new QueryWrapper<SysUser>().lambda().eq(SysUser::getId, projectLawsInventoryEO.getDesignInitiatorId())
|
||||
);
|
||||
initiatorLark = initiatorLarkInfo.getUsername();
|
||||
feishuMsgVo.setAssignee(sysUser.getUsername());
|
||||
// SysUser initiatorLarkInfo = this.sysUserMapper.selectOne(
|
||||
// new QueryWrapper<SysUser>().lambda().eq(SysUser::getId, projectLawsInventoryEO.getDesignInitiatorId())
|
||||
// );
|
||||
// initiatorLark = initiatorLarkInfo.getUsername();
|
||||
} else if(StringUtils.equals(msgType, MsgTypeEnum.PREHOMO_CHARGE_PERSON_SUBMIT_MSG.getValue())){
|
||||
String prehomoInitiatorId = jsonObject.getString("prehomoInitiatorId"); //pre-Home发起人id
|
||||
userIdList.add(prehomoInitiatorId);
|
||||
@@ -2291,10 +2292,11 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
|
||||
taskType = "Pre-Homo Confirmation";
|
||||
|
||||
initiator = MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName();
|
||||
SysUser initiatorLarkInfo = this.sysUserMapper.selectOne(
|
||||
new QueryWrapper<SysUser>().lambda().eq(SysUser::getId, projectLawsInventoryEO.getPrehomoInitiatorId())
|
||||
);
|
||||
initiatorLark = initiatorLarkInfo.getUsername();
|
||||
feishuMsgVo.setAssignee(sysUser.getUsername());
|
||||
// SysUser initiatorLarkInfo = this.sysUserMapper.selectOne(
|
||||
// new QueryWrapper<SysUser>().lambda().eq(SysUser::getId, projectLawsInventoryEO.getPrehomoInitiatorId())
|
||||
// );
|
||||
// initiatorLark = initiatorLarkInfo.getUsername();
|
||||
} else if(StringUtils.equals(msgType, MsgTypeEnum.VERIFY_CHARGE_PERSON_SUBMIT_MSG.getValue())){
|
||||
String verifyInitiatorId = jsonObject.getString("verifyInitiatorId"); //验证符合性发起人id
|
||||
userIdList.add(verifyInitiatorId);
|
||||
@@ -2309,15 +2311,16 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
|
||||
taskType = "Validation Compliance Confirmation";
|
||||
|
||||
initiator = MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName();
|
||||
SysUser initiatorLarkInfo = this.sysUserMapper.selectOne(
|
||||
new QueryWrapper<SysUser>().lambda().eq(SysUser::getId, projectLawsInventoryEO.getVerifyInitiatorId())
|
||||
);
|
||||
initiatorLark = initiatorLarkInfo.getUsername();
|
||||
feishuMsgVo.setAssignee(sysUser.getUsername());
|
||||
// SysUser initiatorLarkInfo = this.sysUserMapper.selectOne(
|
||||
// new QueryWrapper<SysUser>().lambda().eq(SysUser::getId, projectLawsInventoryEO.getVerifyInitiatorId())
|
||||
// );
|
||||
// initiatorLark = initiatorLarkInfo.getUsername();
|
||||
}else if(StringUtils.equals(msgType, MsgTypeEnum.DESIGN_INITIATOR_ACCEPTED_MSG.getValue())){
|
||||
String designDutyId = jsonObject.getString("designDutyId"); //设计符合性责任人id
|
||||
userIdList.add(designDutyId);
|
||||
msgContentEN = "The design compliance information of " + serialNumber +" in "+ projectNameInfoEO.getProjectName()
|
||||
+ ". you sumitted has been approved.";
|
||||
+ " you submitted has been approved.";
|
||||
msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket()
|
||||
+ ": You have a design compliance task to complete";
|
||||
|
||||
@@ -2335,7 +2338,7 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
|
||||
String prehomoDutyId = jsonObject.getString("prehomoDutyId"); //pre-Home责任人id
|
||||
userIdList.add(prehomoDutyId);
|
||||
msgContentEN = "The Pre-Homo confirmation information of " + serialNumber +" in "+ projectNameInfoEO.getProjectName()
|
||||
+ ". you sumitted has been approved.";
|
||||
+ " you submitted has been approved.";
|
||||
msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket()
|
||||
+ ": You have a Pre-Homo task to complete";
|
||||
|
||||
@@ -2353,7 +2356,7 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
|
||||
String verifyDutyId = jsonObject.getString("verifyDutyId"); //验证符合性责任人id
|
||||
userIdList.add(verifyDutyId);
|
||||
msgContentEN = "The validation compliance information of " + serialNumber +" in "+ projectNameInfoEO.getProjectName()
|
||||
+ "you sumitted has been approved.";
|
||||
+ " you submitted has been approved.";
|
||||
msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket()
|
||||
+ ": You have a validation compliance task to complete";
|
||||
|
||||
|
||||
+9
-3
@@ -5,6 +5,7 @@ import cn.hutool.core.util.ObjectUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.poi.ss.usermodel.Row;
|
||||
import org.apache.poi.ss.usermodel.Sheet;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
@@ -120,7 +121,8 @@ public class ExcelUtil {
|
||||
int partNameNum = 0;
|
||||
for (int i = 0; i < workbook.getNumberOfSheets(); i++) {//获取每个Sheet表
|
||||
sheet = workbook.getSheetAt(i);
|
||||
WorksheetPart worksheetPart = (WorksheetPart) pkg.getParts().get(new PartName("/xl/worksheets/" + sheet.getSheetName().toLowerCase() + ".xml"));
|
||||
String sheetName = "sheet" + (i+1); // xml下的表格名称 不是sheet页签名称
|
||||
WorksheetPart worksheetPart = (WorksheetPart) pkg.getParts().get(new PartName("/xl/worksheets/" + sheetName + ".xml"));
|
||||
partNameNum++;
|
||||
|
||||
//获得数据的总行数
|
||||
@@ -142,6 +144,10 @@ public class ExcelUtil {
|
||||
if(ObjectUtil.isNull(cell)) {
|
||||
continue;
|
||||
}
|
||||
// 判断单元格类型,非文本单元格不处理
|
||||
if(! (org.apache.poi.ss.usermodel.Cell.CELL_TYPE_STRING == cell.getCellType())) {
|
||||
continue;
|
||||
}
|
||||
|
||||
String cellValue = cell.getStringCellValue();
|
||||
|
||||
@@ -149,7 +155,7 @@ public class ExcelUtil {
|
||||
String key = (String) imgMap.get("key");
|
||||
String text = (String) imgMap.get("text");
|
||||
byte[] bytes = (byte[]) imgMap.get("bytes");
|
||||
if (("${" + key + "}").equals(cellValue)) {
|
||||
if (StringUtils.isNotEmpty(cellValue) && cellValue.contains("${" + key + "}")) {
|
||||
|
||||
// 根据图片大小调整行高
|
||||
ByteArrayInputStream in = new ByteArrayInputStream(bytes);
|
||||
@@ -161,7 +167,7 @@ public class ExcelUtil {
|
||||
}
|
||||
|
||||
// 插入图片到表格
|
||||
putImagePOI(worksheetPart, pkg, cell, bytes, sheet.getSheetName().toLowerCase(), String.valueOf(partNameNum));
|
||||
putImagePOI(worksheetPart, pkg, cell, bytes, sheetName, String.valueOf(partNameNum));
|
||||
}
|
||||
}
|
||||
j++; // 单元格非空才++
|
||||
|
||||
+3
-1
@@ -162,7 +162,9 @@ public class LawsMonthlyReportWriteEO implements Serializable {
|
||||
/**法规联系人*/
|
||||
@Excel(name = "法规联系人", width = 15)
|
||||
@ApiModelProperty(value = "法规联系人")
|
||||
private java.lang.String lawsContact;
|
||||
private java.lang.String lawsContact;//存id
|
||||
@TableField(exist = false)
|
||||
private java.lang.String lawsContactName;//存用户名
|
||||
|
||||
/**链接*/
|
||||
@Excel(name = "链接", width = 15)
|
||||
|
||||
+74
-9
@@ -1,6 +1,7 @@
|
||||
package com.jero.modules.report.service.impl;
|
||||
|
||||
import cn.hutool.core.util.ZipUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.aliyuncs.utils.IOUtils;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
@@ -139,6 +140,9 @@ public class LawsMonthlyReportWriteEOServiceImpl extends ServiceImpl<LawsMonthly
|
||||
iNewOpinionTemplateEOService.remove(wrapper);
|
||||
//新增
|
||||
List<NewOpinionTemplateEO> newOpinionTemplateEOList = lawsMonthlyReportWriteEO.getNewOpinionTemplateEOList();
|
||||
for (NewOpinionTemplateEO newOpinionTemplateEO : newOpinionTemplateEOList) {
|
||||
newOpinionTemplateEO.setLawsMonthlyReportWriteId(lawsMonthlyReportWriteEO.getId());
|
||||
}
|
||||
iNewOpinionTemplateEOService.saveBatch(newOpinionTemplateEOList);
|
||||
|
||||
}else if (ContentTemplateEnum.NEW_RELEASE_STANDARD_MANIFEST_TEMPLATE.getValue().equals(lawsMonthlyReportWriteEO.getContentTemplate())){
|
||||
@@ -149,6 +153,9 @@ public class LawsMonthlyReportWriteEOServiceImpl extends ServiceImpl<LawsMonthly
|
||||
iNewStandardTemplateEOService.remove(lambdaQueryWrapper);
|
||||
//新增
|
||||
List<NewStandardTemplateEO> newStandardTemplateEOList = lawsMonthlyReportWriteEO.getNewStandardTemplateEOList();
|
||||
for (NewStandardTemplateEO newStandardTemplateEO : newStandardTemplateEOList) {
|
||||
newStandardTemplateEO.setLawsMonthlyReportWriteId(lawsMonthlyReportWriteEO.getId());
|
||||
}
|
||||
iNewStandardTemplateEOService.saveBatch(newStandardTemplateEOList);
|
||||
}
|
||||
|
||||
@@ -289,6 +296,24 @@ public class LawsMonthlyReportWriteEOServiceImpl extends ServiceImpl<LawsMonthly
|
||||
Page<LawsMonthlyReportWriteEO> pageInfo = this.page(page, queryWrapper);
|
||||
//法规月报id
|
||||
List<String> lawsMonthlyReportIdList = pageInfo.getRecords().stream().map(LawsMonthlyReportWriteEO::getId).collect(Collectors.toList());
|
||||
List<String> userIdList = pageInfo.getRecords().stream().map(LawsMonthlyReportWriteEO::getLawsContact).collect(Collectors.toList());
|
||||
List<String> userIds = new ArrayList<>();
|
||||
for (String s : userIdList) {
|
||||
if(StringUtils.isNotBlank(s)){
|
||||
if(s.contains(",")){
|
||||
userIds.addAll(Arrays.asList(s.split(",")));
|
||||
}else{
|
||||
userIds.add(s);
|
||||
}
|
||||
}
|
||||
}
|
||||
List<JSONObject> jsonObjects = sysBaseApi.queryUsersByIds(StringUtils.join(userIds, ","));
|
||||
List<LoginUser> userList = new ArrayList<>();
|
||||
for (JSONObject jsonObject : jsonObjects) {
|
||||
LoginUser loginUser = JSONObject.parseObject(jsonObject.toJSONString(), LoginUser.class);
|
||||
userList.add(loginUser);
|
||||
}
|
||||
|
||||
//获取章节目录
|
||||
List<LawsMonthlyReportTitleTemplateEO> lawsMonthlyReportTitleTemplateEOList = lawsMonthlyReportTitleTemplateEOService.list();
|
||||
|
||||
@@ -311,6 +336,8 @@ public class LawsMonthlyReportWriteEOServiceImpl extends ServiceImpl<LawsMonthly
|
||||
|
||||
|
||||
for (LawsMonthlyReportWriteEO lawsMonthlyReportWriteEO : pageInfo.getRecords()) {
|
||||
//处理法规联系人
|
||||
lawsContact(userList, lawsMonthlyReportWriteEO);
|
||||
//处理章节目录
|
||||
if(StringUtils.isNotBlank(lawsMonthlyReportWriteEO.getMemoriesChapter())){
|
||||
List<LawsMonthlyReportTitleTemplateEO> lawsMonthlyReportTitleTemplateEOS = lawsMonthlyReportTitleTemplateEOList.stream()
|
||||
@@ -356,6 +383,24 @@ public class LawsMonthlyReportWriteEOServiceImpl extends ServiceImpl<LawsMonthly
|
||||
return pageInfo;
|
||||
}
|
||||
|
||||
private void lawsContact(List<LoginUser> userList, LawsMonthlyReportWriteEO lawsMonthlyReportWriteEO) {
|
||||
String lawsContact = lawsMonthlyReportWriteEO.getLawsContact();
|
||||
if(StringUtils.isNotBlank(lawsContact)){
|
||||
List<LoginUser> collect = userList.stream().filter(e -> lawsContact.contains(e.getId())).collect(Collectors.toList());
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (String s : lawsContact.split(",")) {
|
||||
List<LoginUser> loginUserList = collect.stream().filter(e -> e.getId().equals(s)).collect(Collectors.toList());
|
||||
if(loginUserList.size() != 0){
|
||||
sb.append(loginUserList.get(0).getUsername()+",");
|
||||
}
|
||||
}
|
||||
if(StringUtils.isNotBlank(sb)){
|
||||
String substring = sb.substring(0, sb.length() - 1);
|
||||
lawsMonthlyReportWriteEO.setLawsContactName(substring);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void exportMonthlyReport(HttpServletResponse response,
|
||||
HttpServletRequest request,
|
||||
@@ -411,8 +456,8 @@ public class LawsMonthlyReportWriteEOServiceImpl extends ServiceImpl<LawsMonthly
|
||||
List<LawsMonthlyReportTitleTemplateEO> lawsMonthlyReportTitleTemplateEOS = lawsMonthlyReportTitleTemplateEOService.list();
|
||||
lawsMonthlyReportTitleTemplateEOS = lawsMonthlyReportTitleTemplateEOS.stream()
|
||||
.filter(e -> memoriesChapterList.contains(e.getId())).collect(Collectors.toList());
|
||||
|
||||
String path = uploadpath + "/tempZip";
|
||||
long l = System.currentTimeMillis();
|
||||
String path = uploadpath + "/tempZip"+l;
|
||||
File fileTemp = new File(path);
|
||||
if (fileTemp.exists()) {
|
||||
fileTemp.delete();
|
||||
@@ -432,16 +477,34 @@ public class LawsMonthlyReportWriteEOServiceImpl extends ServiceImpl<LawsMonthly
|
||||
os.write(len);
|
||||
}
|
||||
os.flush();
|
||||
os.close();
|
||||
fis.close();
|
||||
} catch (Exception e) {
|
||||
|
||||
}finally {
|
||||
IOUtils.closeQuietly(os);
|
||||
File file = new File(uploadpath + "/tempZip");
|
||||
File file = new File(uploadpath + "/tempZip"+l);
|
||||
FileUtil.deleteContents(file);
|
||||
File fileTem = new File(uploadpath + "/tempZip.zip");
|
||||
File fileTem = new File(uploadpath + "/tempZip"+l+".zip");
|
||||
FileUtil.deleteContents(fileTem);
|
||||
}
|
||||
|
||||
//导出月报后修改列表状态
|
||||
List<LawsMonthlyReportWriteEO> list = new ArrayList<>();
|
||||
if(StringUtils.isBlank(lawsMonthlyReportWriteEO.getIds())){
|
||||
//导出全部
|
||||
list = this.list();
|
||||
}else{
|
||||
//导出部分
|
||||
LambdaQueryWrapper<LawsMonthlyReportWriteEO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.in(LawsMonthlyReportWriteEO::getId,Arrays.asList(lawsMonthlyReportWriteEO.getIds().split(",")));
|
||||
list = this.list(lambdaQueryWrapper);
|
||||
}
|
||||
for (LawsMonthlyReportWriteEO monthlyReportWriteEO : list) {
|
||||
monthlyReportWriteEO.setExportState(ExportStateEnum.HAS_BEEN_EXPORT.getValue());
|
||||
}
|
||||
if(list.size() != 0){
|
||||
this.updateBatchById(list);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -461,10 +524,12 @@ public class LawsMonthlyReportWriteEOServiceImpl extends ServiceImpl<LawsMonthly
|
||||
List<LawsMonthlyReportTitleTemplateEO> reportTitleOneList = lawsMonthlyReportTitleTemplateEOService.list(wrapper);
|
||||
//蔚来汽车法规月报-202004-主页面-CN
|
||||
//NIO Monthly Report on Automobile Regulations-202004-Main Page-EN
|
||||
String memoriesChapterCN = path + File.separator +"蔚来汽车法规月报" + lawsMonthlyReportWriteEOS.get(0).getMonth()+"主页面-CN.docx";
|
||||
String memoriesChapterEN = path + File.separator +"NIO Monthly Report on Automobile Regulations-" + lawsMonthlyReportWriteEOS.get(0).getMonth()+"-Main Page-EN.docx";
|
||||
String memoriesChapterContentCn = path + File.separator +"蔚来汽车法规月报" + lawsMonthlyReportWriteEOS.get(0).getMonth()+"-CN.docx";
|
||||
String memoriesChapterContentEn = path + File.separator +"Weilai Automobile Regulations Monthly Report-" + lawsMonthlyReportWriteEOS.get(0).getMonth()+"-EN.docx";
|
||||
String memoriesChapterCN = path + File.separator +"蔚来汽车法规月报-" + lawsMonthlyReportWriteEOS.get(0).getMonth()+"-主页面-CN.docx";
|
||||
String memoriesChapterEN = path + File.separator +"蔚来汽车法规月报-" + lawsMonthlyReportWriteEOS.get(0).getMonth()+"-主页面-EN.docx";
|
||||
// String memoriesChapterEN = path + File.separator +"NIO Monthly Report on Automobile Regulations-" + lawsMonthlyReportWriteEOS.get(0).getMonth()+"-Main Page-EN.docx";
|
||||
String memoriesChapterContentCn = path + File.separator +"蔚来汽车法规月报-" + lawsMonthlyReportWriteEOS.get(0).getMonth()+"-CN.docx";
|
||||
String memoriesChapterContentEn = path + File.separator +"蔚来汽车法规月报-" + lawsMonthlyReportWriteEOS.get(0).getMonth()+"-EN.docx";
|
||||
// String memoriesChapterContentEn = path + File.separator +"Weilai Automobile Regulations Monthly Report-" + lawsMonthlyReportWriteEOS.get(0).getMonth()+"-EN.docx";
|
||||
String titleCN = "蔚来汽车法规月报" + lawsMonthlyReportWriteEOS.get(0).getMonth();
|
||||
String titleEN = "NIO Monthly Report on Automobile Regulations-" + lawsMonthlyReportWriteEOS.get(0).getMonth();
|
||||
|
||||
|
||||
+3
-1
@@ -2,6 +2,7 @@ package com.jero.modules.report.util;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.jero.common.constant.enums.CutEnum;
|
||||
import com.jero.modules.project.service.impl.ProjectLawsInventoryEOServiceImpl;
|
||||
import com.jero.modules.report.entity.LawsMonthlyReportWriteEO;
|
||||
import com.jero.modules.report.entity.NewOpinionTemplateEO;
|
||||
import com.jero.modules.report.entity.NewStandardTemplateEO;
|
||||
@@ -173,7 +174,8 @@ public class WordUtil {
|
||||
XWPFRun run = logo.createRun();
|
||||
|
||||
String imgFile = logoFilePath;
|
||||
InputStream is = new FileInputStream(imgFile);
|
||||
InputStream is = WordUtil.class.getClassLoader().getResourceAsStream("static/home/weilai.png");
|
||||
// InputStream is = new FileInputStream(imgFile);
|
||||
XWPFPicture picture = run.addPicture(is, XWPFDocument.PICTURE_TYPE_PNG, imgFile, Units.toEMU(95), Units.toEMU(35));
|
||||
String blipID = "";
|
||||
for(XWPFPictureData picturedata : header.getAllPackagePictures()) { //这段必须有,不然打开的logo图片不显示
|
||||
|
||||
Reference in New Issue
Block a user