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

This commit is contained in:
zyx.net
2022-11-04 13:41:17 +08:00
49 changed files with 1227 additions and 538 deletions
@@ -22,3 +22,8 @@ ADD COLUMN `explanation` varchar(2000) NULL COMMENT '说明' AFTER `project_vers
ALTER TABLE `laws_weilai`.`project_library_base`
MODIFY COLUMN `software_version` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '软件版本' AFTER `explanation`;
-- 认证参数历史列表添加字段--------2022-11-02 未同步生产环境
ALTER TABLE `laws_weilai`.`params_manifest_history`
ADD COLUMN `project_version` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '相关项目版本' AFTER `params_template_name`,
ADD COLUMN `explanation` varchar(2000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '说明' AFTER `project_version`;
@@ -684,6 +684,7 @@ public class SysPermissionController {
//项目参数任务
if(StringUtils.equals(permission.getId(), SysPermissionEnum.PROJECT_PARAMETER_TASKS.getId())){
boolean existTaskFlag = false;
existTaskFlag = sysPermissionService.judgeToDo();
meta.put("existTask",existTaskFlag);
}
json.put("meta", meta);
@@ -2,6 +2,7 @@ package com.jero.modules.system.mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/**
@@ -11,4 +12,10 @@ import java.util.Map;
**/
public interface TodoCenterMapper {
int todoCenterTaskCount(@Param("params") Map<String, Object> params);
List<String> listInfoHomo(@Param("userId") String userId, @Param("state") String state);
Integer countSdtDre(@Param("userName") String userName);
Integer countState(@Param("manifestId") String manifestId);
}
@@ -92,7 +92,9 @@
sa.open_type as open_type,
sa.open_page as open_page,
sa.msg_abstract,
sa.document_id as document_id
sa.document_id as document_id,
sa.msg_content_cn as msg_content_cn,
sa.msg_content_info_cn as msg_content_info_cn
from sys_announcement_send sas
left join sys_announcement sa ON sas.annt_id = sa.id
where sa.del_flag = '0'
@@ -18,4 +18,39 @@
</foreach>
</if>
</select>
<select id="listInfoHomo" resultType="java.lang.String">
SELECT pm.id
FROM params_manifest pm
JOIN ( SELECT id FROM
( SELECT id,substring_index( substring_index( a.certification_engineer, ',', b.help_topic_id + 1 ), ',',- 1 ) user_id
FROM
project_library_base a
JOIN mysql.help_topic b ON b.help_topic_id &lt; ( length( a.certification_engineer ) - length( REPLACE ( a.certification_engineer, ',', '' ) ) + 1 )) temp
WHERE user_id = #{userId}) a ON pm.project_id = a.id
where pm.state = #{state}
</select>
<select id="countSdtDre" resultType="java.lang.Integer">
select count(1)
from (
SELECT DISTINCT pcm.params_manifest_id AS pm
FROM params_collect_manifest pcm
WHERE sdt = #{userName}
and state in ('2', '5')
UNION
SELECT DISTINCT pcm.params_manifest_id AS pm
FROM params_collect_manifest pcm
WHERE dre = #{userName}
and state in ('4', '7')
) temp
</select>
<select id="countState" resultType="java.lang.Integer">
select count(1) from params_collect_manifest
where params_manifest_id = #{manifestId} and id not in(
select id from params_collect_manifest where params_manifest_id = #{manifestId} and state in('7','8')
)
</select>
</mapper>
@@ -1,13 +1,11 @@
package com.jero.modules.system.service;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.baomidou.mybatisplus.extension.service.IService;
import com.jero.common.exception.JeroBootException;
import com.jero.modules.system.entity.SysPermission;
import com.jero.modules.system.model.TreeModel;
import com.baomidou.mybatisplus.extension.service.IService;
import java.util.List;
/**
* <p>
@@ -61,4 +59,6 @@ public interface ISysPermissionService extends IService<SysPermission> {
* @return
*/
public boolean hasPermission(String username, String url);
boolean judgeToDo();
}
@@ -1,33 +1,32 @@
package com.jero.modules.system.service.impl;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
import cn.hutool.core.collection.CollectionUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jero.common.constant.CacheConstant;
import com.jero.common.constant.CommonConstant;
import com.jero.common.exception.JeroBootException;
import com.jero.common.system.vo.LoginUser;
import com.jero.common.util.oConvertUtils;
import com.jero.modules.system.entity.SysPermission;
import com.jero.modules.system.entity.SysPermissionDataRule;
import com.jero.modules.system.mapper.SysDepartPermissionMapper;
import com.jero.modules.system.mapper.SysDepartRolePermissionMapper;
import com.jero.modules.system.mapper.SysPermissionMapper;
import com.jero.modules.system.mapper.SysRolePermissionMapper;
import com.jero.modules.system.mapper.*;
import com.jero.modules.system.model.TreeModel;
import com.jero.modules.system.service.ISysPermissionDataRuleService;
import com.jero.modules.system.service.ISysPermissionService;
import org.apache.shiro.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import javax.annotation.Resource;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* <p>
@@ -55,6 +54,9 @@ public class SysPermissionServiceImpl extends ServiceImpl<SysPermissionMapper, S
@Resource
private SysDepartRolePermissionMapper sysDepartRolePermissionMapper;
@Autowired
private TodoCenterMapper todoCenterMapper;
@Override
public List<TreeModel> queryListByParentId(String parentId) {
return sysPermissionMapper.queryListByParentId(parentId);
@@ -263,4 +265,25 @@ public class SysPermissionServiceImpl extends ServiceImpl<SysPermissionMapper, S
}
}
@Override
public boolean judgeToDo() {
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); // 获取当前登录用户
int count = todoCenterMapper.countSdtDre(loginUser.getUsername());
if (count > 0) {
return true;
}
List<String> manifestIdList = todoCenterMapper.listInfoHomo(loginUser.getId(),"收集中");
if(CollectionUtil.isNotEmpty(manifestIdList)) {
for (int i = 0; i < manifestIdList.size(); i++) {
int coutState = todoCenterMapper.countState(manifestIdList.get(i));
if (coutState > 0) {
return true;
}
}
}
return false;
}
}
@@ -17,6 +17,8 @@ import java.util.Map;
public interface ParamsCollectManifestEOMapper extends BaseMapper<ParamsCollectManifestEO> {
List<ParamsCollectManifestEO> listInfo(@Param("paramsCollectManifestEO") ParamsCollectManifestEO paramsCollectManifestEO);
List<ParamsCollectManifestEO> listInfoOfTodoCenter(@Param("manifestIdList") List<String> manifestIdList);
List<Map<String, Object>> listInfoForExport(@Param("paramsCollectManifestEO") ParamsCollectManifestEO paramsCollectManifestEO, @Param("ids") String ids);
List<ParamsCollectManifestEO> listInfoOfTodoCenter();
@@ -31,4 +31,7 @@ public interface ParamsManifestEOMapper extends BaseMapper<ParamsManifestEO> {
ParamsManifestVO getProjectById(@Param("projectId") String projectId);
List<Map<String, String>> labelListForProjectDetails(@Param("projectId") String projectId);
List<String> listInfoHomo(@Param("userId") String userId, @Param("state") String state);
}
@@ -86,6 +86,10 @@
<select id="listInfoOfTodoCenter" resultMap="ParamsCollectManifestEOResultMap">
select id,nio_number,state,sdt,dre,params_manifest_id from params_collect_manifest
where params_manifest_id in
<foreach collection="manifestIdList" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</select>
<select id="listInfoForExport" resultType="java.util.LinkedHashMap">
@@ -136,12 +136,28 @@
left join project_year_name_info as pyni on plb.year_name_id=pyni.id
) tmp_tb
where 1=1 and state = #{state}
and id in(
SELECT pm.id AS pm FROM params_manifest pm
JOIN ( SELECT id FROM
( SELECT id,substring_index( substring_index( a.certification_engineer, ',', b.help_topic_id + 1 ), ',',- 1 ) user_id
FROM
project_library_base a
JOIN mysql.help_topic b ON b.help_topic_id &lt; ( length( a.certification_engineer ) - length( REPLACE ( a.certification_engineer, ',', '' ) ) + 1 )) temp
WHERE user_id = #{userId}) a ON pm.project_id = a.id
UNION
SELECT DISTINCT pcm.params_manifest_id AS pm FROM params_collect_manifest pcm WHERE sdt = #{userName} and state in('2','5')
UNION
SELECT DISTINCT pcm.params_manifest_id AS pm FROM params_collect_manifest pcm WHERE dre = #{userName} and state in('4','7')
)
<if test="projectName !=null and projectName !=''">
AND project_name LIKE CONCAT(CONCAT('%',#{projectName}),'%')
</if>
<if test="title !=null and title !=''">
AND title LIKE CONCAT(CONCAT('%',#{title}),'%')
</if>
</select>
<select id="getProjectById" resultMap="ParamsManifestEOResultMapForCopy">
@@ -164,4 +180,16 @@
where project_id = #{projectId}
order by create_time desc
</select>
</mapper>
<select id="listInfoHomo" resultType="java.lang.String">
SELECT pm.id
FROM params_manifest pm
JOIN ( SELECT id FROM
( SELECT id,substring_index( substring_index( a.certification_engineer, ',', b.help_topic_id + 1 ), ',',- 1 ) user_id
FROM
project_library_base a
JOIN mysql.help_topic b ON b.help_topic_id &lt; ( length( a.certification_engineer ) - length( REPLACE ( a.certification_engineer, ',', '' ) ) + 1 )) temp
WHERE user_id = #{userId}) a ON pm.project_id = a.id
where pm.state = #{state}
</select>
</mapper>
@@ -169,7 +169,7 @@ public interface IParamsCollectManifestEOService extends IService<ParamsCollectM
void exportDre(ParamsCollectManifestVO paramsCollectManifestVO, HttpServletResponse response, HttpServletRequest request);
// 填写人角色下导入
Result<?> importDre(MultipartFile file, String cut, String paramsManifestId) throws IOException;
Result<?> importDre(MultipartFile file, String cut, String paramsManifestId);
Result<?> importData(List<Map<String, Object>> dataList,
String unzipfilepath,
@@ -41,7 +41,6 @@ import com.jero.modules.cert.template.service.ICertCategoryParamsInfoPublishEOSe
import com.jero.modules.cert.template.service.IParamsInfoPublishEOService;
import com.jero.modules.feishu.service.IFeishuService;
import com.jero.modules.feishu.vo.FeishuMsg2Vo;
import com.jero.modules.feishu.vo.FeishuMsgVo;
import com.jero.modules.message.websocket.WebSocket;
import com.jero.modules.ocr.service.WebSocketServer;
import com.jero.modules.ocr.util.LineHumpUtil;
@@ -64,6 +63,7 @@ import com.jero.modules.system.service.ISysUserService;
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.hssf.usermodel.HSSFDataFormat;
import org.apache.poi.hssf.util.HSSFColor;
import org.apache.poi.ss.usermodel.*;
import org.apache.poi.ss.util.CellRangeAddress;
@@ -1892,13 +1892,20 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
stringBuilder.append("NIO编号为").append("<span style='color: red'>").append(nioNumber).append("</span>").append("工程接口人没有填写,请填写完工程接口人再进行下发收集。");
}
} else {
} else if ("2".equals(type)) {
if (CutEnum.EN.getValue().equals(cut)) {
stringBuilder.append("NIO number is ").append(nioNumber).append(",state is ").append("<span style='color: red'>").append(stateName).append("</span>").append(",no operation permission for this button.");
} else {
stringBuilder.append("NIO编号为").append(nioNumber).append(",状态为").append("<span style='color: red'>").append(stateName).append("</span>").append(",没有此按钮的操作权限。");
}
} else if ("3".equals(type)) {
if (CutEnum.EN.getValue().equals(cut)) {
stringBuilder.append("NIO number is ").append(nioNumber).append(",state is ").append("<span style='color: red'>").append(stateName).append("</span>").append(", fail to import.");
} else {
stringBuilder.append("NIO编号为").append(nioNumber).append(",状态为").append("<span style='color: red'>").append(stateName).append("</span>").append(",导入失败。");
}
}
msgList.add(stringBuilder.toString());
@@ -2447,6 +2454,7 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
@Override
public void exportDre(ParamsCollectManifestVO paramsCollectManifestVO, HttpServletResponse response, HttpServletRequest request) {
OutputStream os = null;
FileInputStream fis = null;
OutputStream excelOS = null;
XSSFWorkbook workbook = new XSSFWorkbook();
String fileOriName = "参数项清单导出待填写数据";
@@ -2456,6 +2464,13 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
if (StringUtils.isNotEmpty(paramsCollectManifestVO.getExportName())) {
fileOriName = paramsCollectManifestVO.getExportName();
}
//创建临时文件夹
String fileNowPath = uploadpath + "/tempZip/" + UUID.randomUUID().toString().replace("-","") + File.separator + fileOriName;
File nowFile = new File(fileNowPath);
if (nowFile.exists()) {
nowFile.delete();
}
nowFile.mkdirs();
try{
String fileName = fileOriName + ".xlsx";
@@ -2470,11 +2485,11 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
String[] headers = titles[1].split(",");
XSSFCellStyle cellStyle =workbook.createCellStyle();
cellStyle.setWrapText(true);
// cellStyle.setAlignment(XSSFCellStyle.ALIGN_CENTER);
cellStyle.setVerticalAlignment(XSSFCellStyle.VERTICAL_CENTER);
cellStyle.setDataFormat(HSSFDataFormat.getBuiltinFormat("@")); // 设置文本格式
XSSFCellStyle cellStyle1 =workbook.createCellStyle();
cellStyle1.setAlignment(XSSFCellStyle.ALIGN_CENTER);
cellStyle1.setVerticalAlignment(VerticalAlignment.CENTER);
// cellStyle1.setAlignment(XSSFCellStyle.ALIGN_CENTER);
//合并单元格
CellRangeAddress region1 =
@@ -2494,8 +2509,9 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
XSSFCell cell = row.createCell(i);
XSSFRichTextString text = new XSSFRichTextString(headers[i]);
cell.setCellValue(text);
cell.setCellStyle(cellStyle1);
// cell.setCellStyle(cellStyle1);
sheetItems.setColumnWidth(i, 20 * 256); // 设置单元格宽度
sheetItems.setDefaultColumnStyle(i, cellStyle);
}
// 在excel表中添加添加填写说明
String explanation = "";
@@ -2504,7 +2520,7 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
+ "1.Import data starts at the third line, the first line is the header, the second line is the description, the third line is the example, and the fourth line is the official data\n"
+ "2.All fields is filled in according to Validate Component and Component Value\n"
+ "3.If the control type is drop-down multi-selection, multiple entries are separated by English or Chinese exclamation points\n"
+ "4.Configuration data is filled in according to the control type, and if there are multiple control types, it needs to be separated by \"#\"\n"
+ "4.Configuration data is filled in according to the sequence of control type, and if there are multiple control types, it needs to be separated by \"#\"\n"
+ "5.When filling in, start in column G and do not modify information such as NIO number and parameter name\n"
+ "6.File fields are file type, must create a folder in the directory of the same level as the file with the name of the nio number and place the file in the folder. Assume that the file is saved in the A number B.pdf,Should fill in A/B.pdf\n"
+ "7.When importing into the system, you need to put the Excel into a folder, place other attachment files correctly as required, and finally compress the folder into zip format for import\n";
@@ -2513,7 +2529,7 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
+ "1.导入数据从第三行开始,第一行为表头,第二行为填写说明,第三行是示例数据,需要从第四行开始填写\n"
+ "2.填写时需按照控件校验和控件备选值进行填写\n"
+ "3.控件类型为下拉多选时,填写多个时采用英文或中文感叹号分割\n"
+ "4.配置数据按照控件类型进行填写,若存在多种控件类型填写时需要通过“#”隔开\n"
+ "4.配置数据按照控件类型顺序进行填写,若存在多种控件类型填写时需要通过“#”隔开\n"
+ "5.填写时从G列开始,请勿修改NIO编号和参数名称等信息\n"
+ "6.上传附件为文件属性,填写时需要在本文件同级目录下以NIO编号为名称建立文件夹,并在文件夹下放置文件且该文件夹下只能有一层级,假设在NIO.XXXX下放置了B.pdf,则应填写NIO.XXXX/B.pdf\n"
+ "7.导入系统时,需要将该Excel放入文件夹内,并按照要求正确放置其他附件文件,最后将文件夹压缩为zip格式进行导入\n";
@@ -2535,11 +2551,24 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
sheetItems.setColumnWidth(i, 20 * 256); // 设置单元格宽度
}
List<OSSFile> allRelevFileList = new ArrayList<>();
Map<String, String> fileNowPathMap = new HashMap<>();
//放文字内容
int allRow = 2;
for(int rowNum = 0;rowNum < allParamsInfoList.size(); rowNum++){
Map<String, Object> exportDto = allParamsInfoList.get(rowNum);
// 处理文件
List<OSSFile> fileList = (List<OSSFile>) exportDto.get("fileList");
if (CollectionUtil.isNotEmpty(fileList)) {
allRelevFileList.addAll(fileList);
fileList.forEach(file -> {
fileNowPathMap.put(file.getId(), fileNowPath + File.separator + exportDto.get("nio_number"));
});
}
allRow++;
XSSFRow row1 = sheetItems.createRow(allRow);
for(int cellNum = 0; cellNum < fieldList.size(); cellNum++){
@@ -2552,13 +2581,29 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
}
//下载关联文件内容
if (allRelevFileList != null && !allRelevFileList.isEmpty()) {
allRelevFileList = allRelevFileList.stream().distinct().collect(Collectors.toList());
downLoadFileList(allRelevFileList,fileNowPathMap);
}
String repFileName = fileName.replaceAll("/","_");
excelOS = new FileOutputStream(fileNowPath + File.separator + repFileName);
response.setHeader("Content-Disposition",
"attachment; filename=\""+ ReadExcel.encodeFileName(repFileName+".xlsx", request) +"\"");
"attachment; filename=\""+ ReadExcel.encodeFileName(fileOriName+".zip", request) +"\"");
response.setContentType("application/force-download");
response.flushBuffer();
os = response.getOutputStream();
workbook.write(os);
workbook.write(excelOS);
excelOS.flush();
excelOS.close();
ZipUtil.zip(fileNowPath,fileNowPath+".zip");
fis = new FileInputStream(fileNowPath+".zip");
int len = 0;
while ((len = fis.read()) != -1) {
os.write(len);
}
} catch (Exception e) {
if (e instanceof JeroBootException){
throw new JeroBootException(e.getMessage());
@@ -2573,6 +2618,7 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
}
} finally {
IOUtils.closeQuietly(os);
IOUtils.closeQuietly(fis);
try {
if (workbook != null) {
workbook.close();
@@ -2584,7 +2630,7 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
}
@Override
public Result<?> importDre(MultipartFile file, String cut, String paramsManifestId) throws IOException {
public Result<?> importDre(MultipartFile file, String cut, String paramsManifestId) {
//验证文件名是否合格
/* 截取后缀名 */
int pos = file.getOriginalFilename().lastIndexOf(".");
@@ -2605,8 +2651,8 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
if(!saveDirectory.isDirectory()){
saveDirectory.mkdir();
}
FileUtils.copyInputStreamToFile(file.getInputStream(), new File(path +File.separator+ file.getOriginalFilename()));
try{
FileUtils.copyInputStreamToFile(file.getInputStream(), new File(path +File.separator+ file.getOriginalFilename()));
//解压缩
String zipEntryName = FileUnZip.unZipFiles2(path +File.separator+ file.getOriginalFilename(), path);
// 数据相关处理,
@@ -2654,27 +2700,36 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
List<Map<String, Object>> datas = result;
if(datas!=null &&!datas.isEmpty()){
try {
int i = 0 ;
List<Map<String, Object>> datasUpdate = new ArrayList<>();
// int i = 0 ;
// List<Map<String, Object>> datasUpdate = new ArrayList<>();
//处理空行数据,当读取exceL出现空行过多时,空行数为20以上时中断读取,将数据清洗为新的list
for(Map<String, Object> importDto :datas){
if(i>20){
break;
}
//判断此行数据是否全部为空
if(checkObjAllFieldsIsNull(importDto)){
i++;
//是则不读取
continue;
}
i = 0;
datasUpdate.add(importDto);
}
// for(Map<String, Object> importDto :datas){
// if(i>20){
// break;
// }
// //判断此行数据是否全部为空
// if(checkObjAllFieldsIsNull(importDto)){
// i++;
// //是则不读取
// continue;
// }
// i = 0;
// datasUpdate.add(importDto);
// }
String unzipfilepath = zipEntryName;
Result<?> message = importData(datasUpdate,unzipfilepath,cut,paramsManifestId);
Result<?> message = importData(datas,unzipfilepath,cut,paramsManifestId);
//删除原上传文件
FileUnZip.deleteDir(saveDirectory);
return message;
} catch (NullPointerException e) {
//删除原上传文件
FileUnZip.deleteDir(saveDirectory);
if(CutEnum.CN.getValue().equals(cut)){
resultMsg = "读取失败,请严格按照模板文件导入数据";
}else{
resultMsg = "The data fails to be read. Import data strictly according to the template file";
}
return Result.error(1, resultMsg);
} catch (Exception e) {
//删除原上传文件
FileUnZip.deleteDir(saveDirectory);
@@ -2738,6 +2793,7 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
}
//将导入数据循环合并整理后 新增至相应表
List<ParamsConfigDataEO> configDataList = (List<ParamsConfigDataEO>) map.get("configDataList");
List<Map<String, String>> notImportNioNumberList = (List<Map<String, String>>) map.get("notImportNioNumberList");
for (ParamsConfigDataEO importDto : configDataList) {
//判断此行数据是否全部为空,是则不读取
@@ -2752,7 +2808,7 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
MultipartFile multipartFile =
new MockMultipartFile(nowFileList.get(0).getName(), nowFileList.get(0).getName(), "text/plain", input);
//文件存入文件表
OSSFile ossFile = ossFileService.uploadLocalOfCos(multipartFile, "", null, null);
OSSFile ossFile = ossFileService.uploadLocalOfCos(multipartFile, "", null, cut);
if (ObjectUtils.isNotEmpty(ossFile)) {
String connectId = UUID.randomUUID().toString().replace("-", "");
OSSFile ossFileUpdate = new OSSFile();
@@ -2776,13 +2832,19 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
String msg = "";
if (isSuccess) {
int countSuccess = configDataList.size();
if (CutEnum.CN.getValue().equals(cut)) {
msg = "成功导入" + countSuccess + "";
if (CollectionUtil.isNotEmpty(notImportNioNumberList)) {
List<String> msgList = getMsgOfIssueCollection(notImportNioNumberList, cut, "3");
return Result.OK(null, msgList);
} else {
msg = "import " + countSuccess + " datas successfully";
int countSuccess = configDataList.size();
if (CutEnum.CN.getValue().equals(cut)) {
msg = "成功导入" + countSuccess + "";
} else {
msg = "import " + countSuccess + " datas successfully";
}
return Result.OK(msg, null);
}
return Result.OK(msg, null);
} else {
if (CutEnum.CN.getValue().equals(cut)) {
msg = "导入失败";
@@ -3172,6 +3234,11 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
}
}
List<ParamsConfigEO> paramsConfigEOList = paramsConfigEOService.queryList(paramsManifestId); // 查询所有配置列
List<String> paramsConfigIdList = paramsConfigEOList.stream().map(ParamsConfigEO::getId).collect(Collectors.toList());
List<ParamsConfigDataEO> paramsConfigDataEOList = paramsConfigDataEOService.queryListByConfigIdList(paramsConfigIdList); // 查询所有配置数据
Map<String,String> isMustMap = ParamsIsMustEnum.toMapForExport(cut);
Map<String,String> controlVerifyMap = ControlVerifyEnum.toMapForExport(cut);
Map<String,String> controlTypeMap = ControlTypeEnum.toMapForExport(cut);
@@ -3182,11 +3249,128 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
String controlType = (String) record1.get("control_type");
String controlVerify = (String) record1.get("control_verify");
String isMust = (String) record1.get("is_must");
String paramsCollectManifestId = (String) record1.get("id");
String nioNumber = (String) record1.get("nio_number");
record1.put("is_must", isMustMap.get(isMust));
record1.put("control_type", controlTypeMap.get(controlType));
record1.put("control_verify", controlVerifyMap.get(controlVerify));
// 配置列
if (CollectionUtil.isNotEmpty(paramsConfigEOList)) {
List<OSSFile> fileList = new ArrayList<>();
paramsConfigEOList.forEach(paramsConfigEO -> { // 参数配置
String paramsConfigId = paramsConfigEO.getId();
List<ParamsConfigDataEO> paramsConfigDataEOS = paramsConfigDataEOList.stream().filter(e-> paramsConfigId.equals(e.getParamsConfigId()) && paramsCollectManifestId.equals(e.getParamsCollectManifestId())).collect(Collectors.toList()); // 参数配置数据
StringBuilder configDataBuilder = new StringBuilder(); // 重新组合配置数据
if (CollectionUtil.isNotEmpty(paramsConfigDataEOS)) {
ParamsConfigDataEO paramsConfigDataEO = paramsConfigDataEOS.get(0);
if (ControlTypeEnum.TEXT.getValue().equals(controlType)) {
if (StringUtils.isNotEmpty(paramsConfigDataEO.getTextData())) {
configDataBuilder.append(paramsConfigDataEO.getTextData());
}
} else if (ControlTypeEnum.PULL_SINGLE.getValue().equals(controlType)
|| ControlTypeEnum.PULL_MORE.getValue().equals(controlType)) {
if (StringUtils.isNotEmpty(paramsConfigDataEO.getPullData())) {
configDataBuilder.append(paramsConfigDataEO.getPullData().replaceAll(",", ""));
}
} else if (ControlTypeEnum.FILE.getValue().equals(controlType)) {
if (StringUtils.isNotEmpty(paramsConfigDataEO.getFileConnectId())) {
List<OSSFile> ossFileList = ossFileService.getFileInfosByConnectId(paramsConfigDataEO.getFileConnectId());
if (CollectionUtil.isNotEmpty(ossFileList)) {
configDataBuilder.append(nioNumber).append("/").append(ossFileList.get(0).getFileName());
fileList.addAll(ossFileList);
}
}
} else if (ControlTypeEnum.TEXT_PULL_SINGLE.getValue().equals(controlType)
|| ControlTypeEnum.TEXT_PULL_MORE.getValue().equals(controlType)) {
if (StringUtils.isNotEmpty(paramsConfigDataEO.getTextData())) {
configDataBuilder.append(paramsConfigDataEO.getTextData());
}
configDataBuilder.append("#");
if (StringUtils.isNotEmpty(paramsConfigDataEO.getPullData())) {
configDataBuilder.append(paramsConfigDataEO.getPullData().replaceAll(",", ""));
}
} else if (ControlTypeEnum.TEXT_FILE.getValue().equals(controlType)) {
if (StringUtils.isNotEmpty(paramsConfigDataEO.getTextData())) {
configDataBuilder.append(paramsConfigDataEO.getTextData());
}
configDataBuilder.append("#");
if (StringUtils.isNotEmpty(paramsConfigDataEO.getFileConnectId())) {
List<OSSFile> ossFileList = ossFileService.getFileInfosByConnectId(paramsConfigDataEO.getFileConnectId());
if (CollectionUtil.isNotEmpty(ossFileList)) {
configDataBuilder.append(nioNumber).append("/").append(ossFileList.get(0).getFileName());
fileList.addAll(ossFileList);
}
}
} else if (ControlTypeEnum.PULL_SINGLE_FILE.getValue().equals(controlType)
|| ControlTypeEnum.PULL_MORE_FILE.getValue().equals(controlType)) {
if (StringUtils.isNotEmpty(paramsConfigDataEO.getPullData())) {
configDataBuilder.append(paramsConfigDataEO.getPullData().replaceAll(",", ""));
}
configDataBuilder.append("#");
if (StringUtils.isNotEmpty(paramsConfigDataEO.getFileConnectId())) {
List<OSSFile> ossFileList = ossFileService.getFileInfosByConnectId(paramsConfigDataEO.getFileConnectId());
if (CollectionUtil.isNotEmpty(ossFileList)) {
configDataBuilder.append(nioNumber).append("/").append(ossFileList.get(0).getFileName());
fileList.addAll(ossFileList);
}
}
} else if (ControlTypeEnum.TEXT_PULL_SINGLE_FILE.getValue().equals(controlType)) {
if (StringUtils.isNotEmpty(paramsConfigDataEO.getTextData())) {
configDataBuilder.append(paramsConfigDataEO.getTextData());
}
configDataBuilder.append("#");
if (StringUtils.isNotEmpty(paramsConfigDataEO.getPullData())) {
configDataBuilder.append(paramsConfigDataEO.getPullData().replaceAll(",", ""));
}
configDataBuilder.append("#");
if (StringUtils.isNotEmpty(paramsConfigDataEO.getFileConnectId())) {
List<OSSFile> ossFileList = ossFileService.getFileInfosByConnectId(paramsConfigDataEO.getFileConnectId());
if (CollectionUtil.isNotEmpty(ossFileList)) {
configDataBuilder.append(nioNumber).append("/").append(ossFileList.get(0).getFileName());
fileList.addAll(ossFileList);
}
}
}
}
String configData = configDataBuilder.toString();
if (StringUtils.isNotEmpty(configData) && "".equals(configData.replace("#", ""))) {
configData = configData.replace("#", "");
}
record1.put(paramsConfigEO.getId(), configData);
});
record1.put("fileList", fileList);
}
result.add(record1);
}
return result;
@@ -3574,9 +3758,9 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
}
}
// 当前行所有单元格均不为空时
if (a != cellLength && row != null) {
// if (a != cellLength && row != null) {
list.add(map);
}
// }
}
return list;
}
@@ -3597,12 +3781,10 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
List<String> configIdList = paramsConfigEOList.stream().map(ParamsConfigEO::getId).collect(Collectors.toList());
List<ParamsConfigDataEO> paramsConfigDataEOList = paramsConfigDataEOService.queryListByConfigIdList(configIdList);
Map<String, String> controlTypeMap = ControlTypeEnum.toMapForImport(cut);
Map<String, String> controlVerifyMap = ControlVerifyEnum.toMapForImport(cut);
Map<String, String> paramsIsMustMap = ParamsIsMustEnum.toMapForImport(cut);
//存放数据验证结果信息
List<ParamsConfigDataEO> configDataList = new ArrayList<>();
List<String> verifyNioNumber = new ArrayList<>();
List<Map<String, String>> notImportNioNumberList = new ArrayList<>();
List<String> stringMessage = new ArrayList<>();
int i = 3; //记录行号
//循环验证数据
@@ -3618,10 +3800,50 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
Map<String, Object> resultMap = new HashMap<>();
String nioNumber = (String) dto.get("nio_number");
String controlType = controlTypeMap.get((String) dto.get("control_type"));
String controlVerify = controlVerifyMap.get((String) dto.get("control_verify"));
String controlValues = (String) dto.get("control_values");
String isMust = paramsIsMustMap.get((String) dto.get("is_must"));
if (StringUtils.isBlank(nioNumber)) {
continue;
}
List<ParamsCollectManifestEO> listPCM = paramsCollectManifestEOList.stream().filter(e-> nioNumber.equals(e.getNioNumber())).collect(Collectors.toList());
if (CollectionUtil.isEmpty(listPCM)) {
if (CutEnum.EN.getValue().equals(cut)) {
errorMsg += "NIO Number can not find; ";
} else{
errorMsg += "NIO编号不存在;";
}
countError++;
stringMessage.add(errorMsg);
continue;
}
if (!verifyNioNumber.contains(nioNumber)) {
verifyNioNumber.add(nioNumber);
} else{
if (CutEnum.EN.getValue().equals(cut)) {
errorMsg += "NIO Number is repeat; ";
} else{
errorMsg += "NIO编号重复;";
}
countError ++;
stringMessage.add(errorMsg);
continue;
}
ParamsCollectManifestEO paramsCollectManifestEO = listPCM.get(0);
String state = paramsCollectManifestEO.getState();
if (!CollectManifestStateEnum.WAIT_FILL.getValue().equals(state) && !CollectManifestStateEnum.CERT_BACK.getValue().equals(state)) {
Map<String, String> msgMap = new HashMap<>();
msgMap.put("nioNumber", nioNumber);
msgMap.put("state", state);
msgMap.put("type", "3");
notImportNioNumberList.add(msgMap);
continue;
}
String controlType = paramsCollectManifestEO.getControlType();
String controlVerify = paramsCollectManifestEO.getControlVerify();
String controlValues = paramsCollectManifestEO.getControlValues();
String isMust = paramsCollectManifestEO.getIsMust();
for (Map.Entry<String, Object> entry : dto.entrySet()) {
String key = entry.getKey();
String value = (String) entry.getValue();
@@ -3681,22 +3903,43 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
}
countError++;
} else {
if (value.split("#").length > 1) {
resultMap = validatePull(configMap.get(key), controlValues, value.split("#")[1], isMust, true, cut);
errorMsg += (String) resultMap.get("errorMsg");
countError += (int) resultMap.get("countError");
configDataEO.setPullData(value.split("#")[1]);
if (StringUtils.isNotEmpty(value)) {
if (countChar(value, "#") != 1) {
if (CutEnum.CN.getValue().equals(cut)) {
errorMsg += configMap.get(key) + "格式不正确;";
} else {
errorMsg += configMap.get(key) + " format is incorrect; ";
}
countError++;
} else {
if (value.split("#").length > 1) {
resultMap = validatePull(configMap.get(key), controlValues, value.split("#")[1], isMust, true, cut);
errorMsg += (String) resultMap.get("errorMsg");
countError += (int) resultMap.get("countError");
configDataEO.setPullData(value.split("#")[1]);
resultMap = validateText(configMap.get(key), controlVerify, value.split("#")[0], ParamsIsMustEnum.NO.getValue(), "1000", cut);
errorMsg += (String) resultMap.get("errorMsg");
countError += (int) resultMap.get("countError");
configDataEO.setTextData(value.split("#")[0]);
resultMap = validateText(configMap.get(key), controlVerify, value.split("#")[0], ParamsIsMustEnum.NO.getValue(), "1000", cut);
errorMsg += (String) resultMap.get("errorMsg");
countError += (int) resultMap.get("countError");
configDataEO.setTextData(value.split("#")[0]);
} else {
resultMap = validatePull(configMap.get(key), controlValues, value.split("#")[0], isMust, true, cut);
errorMsg += (String) resultMap.get("errorMsg");
countError += (int) resultMap.get("countError");
configDataEO.setPullData(value.split("#")[0]);
} else if (value.split("#").length == 1 && value.endsWith("#")) {
// 校验必填
if (IsMustEnum.YES.getValue().equals(isMust)) {
if (CutEnum.CN.getValue().equals(cut)) {
errorMsg += configMap.get(key) + "下拉单选为必填项,不能为空;";
} else {
errorMsg += configMap.get(key) + " is mandatory and cannot be empty; ";
}
countError++;
}
resultMap = validateText(configMap.get(key), controlVerify, value.split("#")[0], ParamsIsMustEnum.NO.getValue(), "1000", cut);
errorMsg += (String) resultMap.get("errorMsg");
countError += (int) resultMap.get("countError");
configDataEO.setTextData(value.split("#")[0]);
}
}
}
}
@@ -3710,21 +3953,42 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
}
countError++;
} else {
if (value.split("#").length > 1) {
resultMap = validatePull(configMap.get(key), controlValues, value.split("#")[1], isMust, false, cut);
errorMsg += (String) resultMap.get("errorMsg");
countError += (int) resultMap.get("countError");
configDataEO.setPullData(value.split("#")[1]);
if (StringUtils.isNotEmpty(value)) {
if (countChar(value, "#") != 1) {
if (CutEnum.CN.getValue().equals(cut)) {
errorMsg += configMap.get(key) + "格式不正确;";
} else {
errorMsg += configMap.get(key) + " format is incorrect; ";
}
countError++;
} else {
if (value.split("#").length > 1) {
resultMap = validatePull(configMap.get(key), controlValues, value.split("#")[1], isMust, false, cut);
errorMsg += (String) resultMap.get("errorMsg");
countError += (int) resultMap.get("countError");
configDataEO.setPullData(value.split("#")[1]);
resultMap = validateText(configMap.get(key), controlVerify, value.split("#")[0], ParamsIsMustEnum.NO.getValue(), "1000", cut);
errorMsg += (String) resultMap.get("errorMsg");
countError += (int) resultMap.get("countError");
configDataEO.setTextData(value.split("#")[0]);
} else {
resultMap = validatePull(configMap.get(key), controlValues, value.split("#")[0], isMust, false, cut);
errorMsg += (String) resultMap.get("errorMsg");
countError += (int) resultMap.get("countError");
configDataEO.setPullData(value.split("#")[0]);
resultMap = validateText(configMap.get(key), controlVerify, value.split("#")[0], ParamsIsMustEnum.NO.getValue(), "1000", cut);
errorMsg += (String) resultMap.get("errorMsg");
countError += (int) resultMap.get("countError");
configDataEO.setTextData(value.split("#")[0]);
} else if (value.split("#").length == 1 && value.endsWith("#")) {
// 校验必填
if (IsMustEnum.YES.getValue().equals(isMust)) {
if (CutEnum.CN.getValue().equals(cut)) {
errorMsg += configMap.get(key) + "下拉多选为必填项,不能为空;";
} else {
errorMsg += configMap.get(key) + " is mandatory and cannot be empty; ";
}
countError++;
}
resultMap = validateText(configMap.get(key), controlVerify, value.split("#")[0], ParamsIsMustEnum.NO.getValue(), "1000", cut);
errorMsg += (String) resultMap.get("errorMsg");
countError += (int) resultMap.get("countError");
configDataEO.setTextData(value.split("#")[0]);
}
}
}
}
@@ -3737,18 +4001,35 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
errorMsg += configMap.get(key) + " is mandatory and cannot be empty; ";
}
countError++;
} else {
resultMap = validateText(configMap.get(key), controlVerify, value.split("#")[0], isMust, "1000", cut);
errorMsg += (String) resultMap.get("errorMsg");
countError += (int) resultMap.get("countError");
configDataEO.setTextData(value.split("#")[0]);
}else {
if (StringUtils.isNotEmpty(value)) {
if (countChar(value, "#") != 1) {
if (CutEnum.CN.getValue().equals(cut)) {
errorMsg += configMap.get(key) + "格式不正确;";
} else {
errorMsg += configMap.get(key) + " format is incorrect; ";
}
countError++;
} else {
if (value.split("#").length > 1) {
resultMap = validateText(configMap.get(key), controlVerify, value.split("#")[0], isMust, "1000", cut);
errorMsg += (String) resultMap.get("errorMsg");
countError += (int) resultMap.get("countError");
configDataEO.setTextData(value.split("#")[0]);
if (value.split("#").length > 1) {
resultMap = validateFile(configMap.get(key), unzipfilepath, value.split("#")[1], ParamsIsMustEnum.NO.getValue(), cut);
errorMsg += (String) resultMap.get("errorMsg");
countError += (int) resultMap.get("countError");
configDataEO.setFileConnectId(value.split("#")[1]);
}
resultMap = validateFile(configMap.get(key), unzipfilepath, value.split("#")[1], ParamsIsMustEnum.NO.getValue(), cut);
errorMsg += (String) resultMap.get("errorMsg");
countError += (int) resultMap.get("countError");
configDataEO.setFileConnectId(value.split("#")[1]);
} else if (value.split("#").length == 1 && value.endsWith("#")) {
resultMap = validateText(configMap.get(key), controlVerify, value.split("#")[0], isMust, "1000", cut);
errorMsg += (String) resultMap.get("errorMsg");
countError += (int) resultMap.get("countError");
configDataEO.setTextData(value.split("#")[0]);
}
}
}
}
} else if (ControlTypeEnum.PULL_SINGLE_FILE.getValue().equals(controlType)) {
@@ -3761,16 +4042,32 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
}
countError++;
} else {
resultMap = validatePull(configMap.get(key), controlValues, value.split("#")[0], isMust, true, cut);
errorMsg += (String) resultMap.get("errorMsg");
countError += (int) resultMap.get("countError");
configDataEO.setPullData(value.split("#")[0]);
if (StringUtils.isNotEmpty(value)) {
if (countChar(value, "#") != 1) {
if (CutEnum.CN.getValue().equals(cut)) {
errorMsg += configMap.get(key) + "格式不正确;";
} else {
errorMsg += configMap.get(key) + " format is incorrect; ";
}
countError++;
} else {
if (value.split("#").length > 1) {
resultMap = validatePull(configMap.get(key), controlValues, value.split("#")[0], isMust, true, cut);
errorMsg += (String) resultMap.get("errorMsg");
countError += (int) resultMap.get("countError");
configDataEO.setPullData(value.split("#")[0]);
if (value.split("#").length > 1) {
resultMap = validateFile(configMap.get(key), unzipfilepath, value.split("#")[1], ParamsIsMustEnum.NO.getValue(), cut);
errorMsg += (String) resultMap.get("errorMsg");
countError += (int) resultMap.get("countError");
configDataEO.setFileConnectId(value.split("#")[1]);
resultMap = validateFile(configMap.get(key), unzipfilepath, value.split("#")[1], ParamsIsMustEnum.NO.getValue(), cut);
errorMsg += (String) resultMap.get("errorMsg");
countError += (int) resultMap.get("countError");
configDataEO.setFileConnectId(value.split("#")[1]);
} else if (value.split("#").length == 1 && value.endsWith("#")) {
resultMap = validatePull(configMap.get(key), controlValues, value.split("#")[0], isMust, true, cut);
errorMsg += (String) resultMap.get("errorMsg");
countError += (int) resultMap.get("countError");
configDataEO.setPullData(value.split("#")[0]);
}
}
}
}
@@ -3784,16 +4081,33 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
}
countError++;
} else {
resultMap = validatePull(configMap.get(key), controlValues, value.split("#")[0], isMust, false, cut);
errorMsg += (String) resultMap.get("errorMsg");
countError += (int) resultMap.get("countError");
configDataEO.setPullData(value.split("#")[0]);
if (StringUtils.isNotEmpty(value)) {
if (countChar(value, "#") != 1) {
if (CutEnum.CN.getValue().equals(cut)) {
errorMsg += configMap.get(key) + "格式不正确;";
} else {
errorMsg += configMap.get(key) + " format is incorrect; ";
}
countError++;
} else {
if (value.split("#").length > 1) {
resultMap = validatePull(configMap.get(key), controlValues, value.split("#")[0], isMust, false, cut);
errorMsg += (String) resultMap.get("errorMsg");
countError += (int) resultMap.get("countError");
configDataEO.setPullData(value.split("#")[0]);
if (value.split("#").length > 1) {
resultMap = validateFile(configMap.get(key), unzipfilepath, value.split("#")[1], ParamsIsMustEnum.NO.getValue(), cut);
errorMsg += (String) resultMap.get("errorMsg");
countError += (int) resultMap.get("countError");
configDataEO.setFileConnectId(value.split("#")[1]);
resultMap = validateFile(configMap.get(key), unzipfilepath, value.split("#")[1], ParamsIsMustEnum.NO.getValue(), cut);
errorMsg += (String) resultMap.get("errorMsg");
countError += (int) resultMap.get("countError");
configDataEO.setFileConnectId(value.split("#")[1]);
} else if (value.split("#").length == 1 && value.endsWith("#")) {
resultMap = validatePull(configMap.get(key), controlValues, value.split("#")[0], isMust, false, cut);
errorMsg += (String) resultMap.get("errorMsg");
countError += (int) resultMap.get("countError");
configDataEO.setPullData(value.split("#")[0]);
}
}
}
}
@@ -3807,28 +4121,51 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
}
countError++;
} else {
if (value.split("#").length > 1) {
resultMap = validatePull(configMap.get(key), controlValues, value.split("#")[1], isMust, true, cut);
errorMsg += (String) resultMap.get("errorMsg");
countError += (int) resultMap.get("countError");
configDataEO.setPullData(value.split("#")[1]);
if(StringUtils.isNotEmpty(value)) {
if (countChar(value, "#") != 2) {
if (CutEnum.CN.getValue().equals(cut)) {
errorMsg += configMap.get(key) + "格式不正确;";
} else {
errorMsg += configMap.get(key) + " format is incorrect; ";
}
countError++;
} else {
if (value.split("#").length > 1) {
resultMap = validatePull(configMap.get(key), controlValues, value.split("#")[1], isMust, true, cut);
errorMsg += (String) resultMap.get("errorMsg");
countError += (int) resultMap.get("countError");
configDataEO.setPullData(value.split("#")[1]);
resultMap = validateText(configMap.get(key), controlVerify, value.split("#")[0], ParamsIsMustEnum.NO.getValue(), "1000", cut);
errorMsg += (String) resultMap.get("errorMsg");
countError += (int) resultMap.get("countError");
configDataEO.setTextData(value.split("#")[0]);
resultMap = validateText(configMap.get(key), controlVerify, value.split("#")[0], ParamsIsMustEnum.NO.getValue(), "1000", cut);
errorMsg += (String) resultMap.get("errorMsg");
countError += (int) resultMap.get("countError");
configDataEO.setTextData(value.split("#")[0]);
if (value.split("#").length > 2) {
resultMap = validateFile(configMap.get(key), unzipfilepath, value.split("#")[2], ParamsIsMustEnum.NO.getValue(), cut);
errorMsg += (String) resultMap.get("errorMsg");
countError += (int) resultMap.get("countError");
configDataEO.setFileConnectId(value.split("#")[2]);
if (!value.endsWith("#")) { //3
resultMap = validateFile(configMap.get(key), unzipfilepath, value.split("#")[2], ParamsIsMustEnum.NO.getValue(), cut);
errorMsg += (String) resultMap.get("errorMsg");
countError += (int) resultMap.get("countError");
configDataEO.setFileConnectId(value.split("#")[2]);
}
} else if (value.split("#").length == 1 && value.endsWith("#")) {
// 校验必填
if (IsMustEnum.YES.getValue().equals(isMust)) {
if (CutEnum.CN.getValue().equals(cut)) {
errorMsg += configMap.get(key) + "下拉单选为必填项,不能为空;";
} else {
errorMsg += configMap.get(key) + " is mandatory and cannot be empty; ";
}
countError++;
}
resultMap = validateText(configMap.get(key), controlVerify, value.split("#")[0], ParamsIsMustEnum.NO.getValue(), "1000", cut);
errorMsg += (String) resultMap.get("errorMsg");
countError += (int) resultMap.get("countError");
configDataEO.setTextData(value.split("#")[0]);
}
}
} else {
resultMap = validatePull(configMap.get(key), controlValues, value.split("#")[0], isMust, false, cut);
errorMsg += (String) resultMap.get("errorMsg");
countError += (int) resultMap.get("countError");
configDataEO.setPullData(value.split("#")[0]);
}
}
@@ -3855,6 +4192,7 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
if (stringMessage.isEmpty()) {
map.put("result", true);
map.put("configDataList", configDataList);
map.put("notImportNioNumberList", notImportNioNumberList);
map.put("message", "");
} else {
map.put("result", false);
@@ -4243,4 +4581,14 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
stringList.add("NIO-" + collectManifestEO.getNioNumber());
}
}
private int countChar(String str, String searchChar) {
int count = 0;
int origialLength = str.length();
str = str.replace(searchChar, "");
int newLength = str.length();
count = origialLength - newLength;
return count;
}
}
@@ -1348,7 +1348,18 @@ public class ParamsInfoEOServiceImpl extends ServiceImpl<ParamsInfoEOMapper, Par
|| ControlTypeEnum.TEXT_PULL_MORE.getValue().equals(controlType)
|| ControlTypeEnum.TEXT_PULL_SINGLE.getValue().equals(controlType)
|| ControlTypeEnum.TEXT_PULL_SINGLE_FILE.getValue().equals(controlType)) {
String controlValuesRegex = "^[^##!]*$";
if (StringUtils.isNotEmpty(controlValues) && !controlValues.matches(controlValuesRegex)) {
if(CutEnum.CN.getValue().equals(cut)) {
errorMsg += "控件备选值格式错误,不能包含中英文感叹号和井号;";
} else {
errorMsg += "Component Value formatting errors, can not chinese and English exclamation points and pound signs; ";
}
countError++;
}
resultMap = validateMustAndLength(controlValues, "控件备选值", "Component Value", IsMustEnum.YES.getValue(), "500", false, cut);
} else {
resultMap = validateMustAndLength(controlValues, "控件备选值", "Component Value", IsMustEnum.NO.getValue(), "500", false, cut);
dto.setControlValues(null);
@@ -90,6 +90,21 @@ public class BussDocumentLibraryEOController extends JeroController<BussDocument
return Result.OK(infoPage);
}
/**
* 文档翻译调取已入库文件
* @param parameter
* @return
*/
@AutoLog(value = "文档翻译调取已入库文件")
@ApiOperation(value="文档翻译调取已入库文件", notes="文档翻译调取已入库文件")
@PostMapping(value = "/transPageInfo")
@ResponseBody
@RequiresPermissions("documentTranslation:retrieval")
public Result<?> transPageInfo(@RequestBody Map<String,Object> parameter) {
IPage infoPage = bussDocumentLibraryEOService.ocrPageInfo(parameter);
return Result.OK(infoPage);
}
/**
* 列表查询
*
@@ -459,10 +459,14 @@ public class DummyInventoryBaseEOServiceImpl extends ServiceImpl<DummyInventoryB
if(ObjectUtils.isNotEmpty(serialNumberDeleteList)){
sbContentYes.append(countYes+". Remove regulations: "+StringUtils.join(hrefListDelete,","));
}
String hrefTemp = "<a href='/virtualListDetails?id=" + dummyInventoryBaseEO.getId() +
"&useExplain="+baseEO.getUseExplain()+
"&name=" + baseEO.getName() + "'" + " target='_blank'>" + baseEO.getName() + "</a>";
//消息英文--不带标签
String contentNo = "The "+ baseEO.getName()+" virtual list you subscribed to has been updated as follows" + sbContentNo;
//消息英文--带标签
String contentYes = "The "+ baseEO.getName()+" virtual list you subscribed to has been updated as follows"+ "</br>" + sbContentYes;;
String contentYes = "The "+ hrefTemp+" virtual list you subscribed to has been updated as follows"+ "</br>" + sbContentYes;;
int countInfoNo = 1;
StringBuilder sbContentINfoNo = new StringBuilder();
@@ -487,9 +491,7 @@ public class DummyInventoryBaseEOServiceImpl extends ServiceImpl<DummyInventoryB
//消息中文--不带标签
String contentInfoNo = "您所订阅的"+baseEO.getName()+"虚拟清单已更新,更新内容如下:"+sbContentINfoNo;
//消息中文--带标签
String contentInfoYes = "您所订阅的"+baseEO.getName()+"虚拟清单已更新,更新内容如下:"+"</br>"+sbContentInfoYes;
String contentInfoYes = "您所订阅的"+hrefTemp+"虚拟清单已更新,更新内容如下:"+"</br>"+sbContentInfoYes;
List<String> userNameList = dummyReadEOService.queryReadUserInfo(dummyInventoryBaseEO.getId());
List<String> thirdIdList = new ArrayList<>();
@@ -545,47 +547,52 @@ public class DummyInventoryBaseEOServiceImpl extends ServiceImpl<DummyInventoryB
}
}else{
//撤回,需要发消息
try {
List<String> userNameList = dummyReadEOService.queryReadUserInfo(dummyInventoryBaseEO.getId());
List<String> thirdIdList = new ArrayList<>();
if(userNameList.size() != 0){
List<String> userIdList = sysUserService.queryUserIdListByNameList(userNameList).stream().map(e -> e.getId()).collect(Collectors.toList());
thirdIdList = sysUserService.queryUserIdListByNameList(userNameList).stream().map(e -> e.getThirdId()).collect(Collectors.toList());
if(userIdList.size() != 0){
//封装消息的实体类 The XX virtual list you subscribed to has been withdrawn
String title = "The "+ baseEO.getName()+" virtual list you subscribed to has been withdrawn.";
//Please note that the XX virtual list you subscribed to has been withdrawn.
String contentLog = "Please note that the "+ baseEO.getName()+" virtual list you subscribed to has been withdrawn.";
// try {
// List<String> userNameList = dummyReadEOService.queryReadUserInfo(dummyInventoryBaseEO.getId());
// List<String> thirdIdList = new ArrayList<>();
// if(userNameList.size() != 0){
// List<String> userIdList = sysUserService.queryUserIdListByNameList(userNameList).stream().map(e -> e.getId()).collect(Collectors.toList());
// thirdIdList = sysUserService.queryUserIdListByNameList(userNameList).stream().map(e -> e.getThirdId()).collect(Collectors.toList());
// if(userIdList.size() != 0){
// String hrefTemp = "<a href='/virtualListDetails?id=" + dummyInventoryBaseEO.getId() +
// "&useExplain="+baseEO.getUseExplain()+
// "&name=" + baseEO.getName() + "'" + " target='_blank'>" + baseEO.getName() + "</a>";
// //封装消息的实体类 The XX virtual list you subscribed to has been withdrawn
// String title = "The "+ baseEO.getName()+" virtual list you subscribed to has been withdrawn.";
// //Please note that the XX virtual list you subscribed to has been withdrawn.
// String contentLog = "Please note that the "+ baseEO.getName()+" virtual list you subscribed to has been withdrawn.";
String contentCn = "您订阅的虚拟清单"+ baseEO.getName()+"已被撤回.";
String contentInfoEn = "Please note that the "+ baseEO.getName()+" virtual list you subscribed to has been withdrawn.";
SysAnnouncement sysAnnouncement = bussDocumentLibraryEOService.getSysAnnouncement(userIdList,
title,
contentInfoEn,
contentInfoEn,
MessageTypeEnum.READ.getValue(),
MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName(),
contentCn,contentCn);
sysAnnouncementService.saveAnnouncement(sysAnnouncement);
bussDocumentLibraryEOService.sendWebsocket(dummyInventoryBaseEO.getId(), title);
}
}
// String contentCnNo = "您订阅的虚拟清单"+ baseEO.getName()+"已被撤回.";
// String contentCnYes = "您订阅的虚拟清单"+ hrefTemp+"已被撤回.";
// String contentInfoEnNo = "Please note that the "+ baseEO.getName()+" virtual list you subscribed to has been withdrawn.";
// String contentInfoEnYes = "Please note that the "+ hrefTemp+" virtual list you subscribed to has been withdrawn.";
// SysAnnouncement sysAnnouncement = bussDocumentLibraryEOService.getSysAnnouncement(userIdList,
// title,
// contentInfoEnNo,
// contentInfoEnYes,
// MessageTypeEnum.READ.getValue(),
// MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName(),
// contentCnNo,contentCnYes);
// sysAnnouncementService.saveAnnouncement(sysAnnouncement);
// bussDocumentLibraryEOService.sendWebsocket(dummyInventoryBaseEO.getId(), title);
// }
// }
//飞书
if(thirdIdList.size() != 0){
String contentInfoTemp = "Please note that the "+ baseEO.getName()+" virtual list you subscribed to has been withdrawn.";
String contentInfoFeiCn = "您订阅的虚拟清单"+ baseEO.getName()+"已被撤回.";
String href = backUrl + "/virtualListDetails?name=" + baseEO.getName() + "&useExplain=" + baseEO.getUseExplain() +"&id=" + baseEO.getId() +"&title=维护虚拟清单";
FeishuMsgVo feishuMsgVo = new FeishuMsgVo();
feishuMsgVo.setTitle(MessageTypeEnum.READ.getNameCn()+"/"+MessageTypeEnum.READ.getName());
feishuMsgVo.setUrl(href);
feishuMsgVo.setContentEn(contentInfoTemp);
feishuMsgVo.setContent(contentInfoFeiCn);
iFeishuService.sendCardMsgVirtua(thirdIdList.toArray(new String[]{}), feishuMsgVo,null,null);
// iFeishuService.batchSendMessage(thirdIdList.toArray(new String[]{}), contentInfoTemp, MessageTypeEnum.PUSH.getName(), href);
}
}catch (Exception e){
e.printStackTrace();
}
// if(thirdIdList.size() != 0){
// String contentInfoTemp = "Please note that the "+ baseEO.getName()+" virtual list you subscribed to has been withdrawn.";
// String contentInfoFeiCn = "您订阅的虚拟清单"+ baseEO.getName()+"已被撤回.";
// String href = backUrl + "/virtualListDetails?name=" + baseEO.getName() + "&useExplain=" + baseEO.getUseExplain() +"&id=" + baseEO.getId() +"&title=维护虚拟清单";
// FeishuMsgVo feishuMsgVo = new FeishuMsgVo();
// feishuMsgVo.setTitle(MessageTypeEnum.READ.getNameCn()+"/"+MessageTypeEnum.READ.getName());
// feishuMsgVo.setUrl(href);
// feishuMsgVo.setContentEn(contentInfoTemp);
// feishuMsgVo.setContent(contentInfoFeiCn);
// iFeishuService.sendCardMsgVirtua(thirdIdList.toArray(new String[]{}), feishuMsgVo,null,null);
//// iFeishuService.batchSendMessage(thirdIdList.toArray(new String[]{}), contentInfoTemp, MessageTypeEnum.PUSH.getName(), href);
// }
// }catch (Exception e){
// e.printStackTrace();
// }
}
}
// /**
@@ -10,13 +10,19 @@ import com.jero.modules.home.mapper.HomeFunctionModuleEOMapper;
import com.jero.modules.home.service.IHomeFunctionModuleEOService;
import com.alibaba.fastjson.JSONObject;
import com.jero.modules.system.entity.SysPermission;
import com.jero.modules.system.service.ISysPermissionService;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.shiro.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import java.util.stream.Collectors;
/**
* @Description: 功能模块
@@ -27,6 +33,9 @@ import java.util.UUID;
@Service
public class HomeFunctionModuleEOServiceImpl extends ServiceImpl<HomeFunctionModuleEOMapper, HomeFunctionModuleEO> implements IHomeFunctionModuleEOService {
@Autowired
private ISysPermissionService sysPermissionService;
/**
* 保存
*
@@ -103,22 +112,35 @@ public class HomeFunctionModuleEOServiceImpl extends ServiceImpl<HomeFunctionMod
public List<HomeFunctionModuleEO> queryList(String cut) {
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
//用户拥有权限的菜单
List<SysPermission> metaList = sysPermissionService.queryByUser(loginUser.getUsername());
//所有的图表(state=0)
LambdaQueryWrapper<HomeFunctionModuleEO> wrapper = new LambdaQueryWrapper<>();
wrapper.in(HomeFunctionModuleEO::getState,"0").isNull(HomeFunctionModuleEO::getCreateBy);
List<HomeFunctionModuleEO> homeFunctionModuleEOList = this.list(wrapper);
List<HomeFunctionModuleEO> homeFunctionModuleEOListTemp = new ArrayList<>();
if(ObjectUtils.isNotEmpty(homeFunctionModuleEOList)){
for (SysPermission sysPermission : metaList) {
List<HomeFunctionModuleEO> collect = homeFunctionModuleEOList.stream().filter(e -> e.getIconName().equals(sysPermission.getName())).collect(Collectors.toList());
if(ObjectUtils.isNotEmpty(collect)){
homeFunctionModuleEOListTemp.addAll(collect);
}
}
}
homeFunctionModuleEOListTemp = homeFunctionModuleEOListTemp.stream().distinct().collect(Collectors.toList());
//当前用户配置的图表
LambdaQueryWrapper<HomeFunctionModuleEO> wrapperTemp = new LambdaQueryWrapper<>();
wrapperTemp.in(HomeFunctionModuleEO::getCreateBy,loginUser.getUsername()).orderByAsc(HomeFunctionModuleEO::getState).orderByAsc(HomeFunctionModuleEO::getSort);
List<HomeFunctionModuleEO> homeFunctionModuleEOS = this.list(wrapperTemp);
if(homeFunctionModuleEOS.size() == 0){
if(CutEnum.EN.getValue().equals(cut)){
for (HomeFunctionModuleEO homeFunctionModuleEO : homeFunctionModuleEOList) {
for (HomeFunctionModuleEO homeFunctionModuleEO : homeFunctionModuleEOListTemp) {
homeFunctionModuleEO.setIconName(homeFunctionModuleEO.getIconNameEn());
}
}
return homeFunctionModuleEOList;
return homeFunctionModuleEOListTemp;
}else{
if(CutEnum.EN.getValue().equals(cut)){
for (HomeFunctionModuleEO homeFunctionModuleEO : homeFunctionModuleEOS) {
@@ -88,28 +88,33 @@ public class ProblemKnowledgeBaseCommentEOServiceImpl extends ServiceImpl<Proble
String createBy = problemKnowledgeBaseEO.getCreateBy();
//自己回复的时候不发消息
// if(!loginUser.getUsername().equals(createBy)){
SysUser sysUser = sysUserService.getUserByName(createBy);
String contentCNNo = "您发布的问题知识库信息"+problemKnowledgeBaseEO.getTitle()+"有新评论,请注意查看.";
String contentENNo = "In the Q&A knowledge "+problemKnowledgeBaseEO.getTitle()+" you created, a new comment has been added. Please be reminded to check it out.";
SysUser sysUser = sysUserService.getUserByName(createBy);
String contentCNNo = "您发布的问题知识库信息"+problemKnowledgeBaseEO.getTitle()+"有新评论,请注意查看.";
String contentENNo = "In the Q&A knowledge "+problemKnowledgeBaseEO.getTitle()+" you created, a new comment has been added. Please be reminded to check it out.";
String url = backUrl +"/problemknowledgeBase";
//发送消息(站内和飞书)
String href = "<a href='"+url + "'"+ " target='_blank'>"+ problemKnowledgeBaseEO.getTitle() + "</a>";
String contentINfoCNNo = "您发布的问题知识库信息"+href+"有新评论,请注意查看.";
String contentInfoENNo = "In the Q&A knowledge "+href+" you created, a new comment has been added. Please be reminded to check it out.";
//发送消息(站内和飞书)
//您发布的问题知识库信息XXXXXXXX有新评论,请注意查看。
//In the Q&A knowledge xxxxxxxx you created, a new comment has been added. Please be reminded to check it out.
SysAnnouncement sysAnnouncement = bussDocumentLibraryEOService.getSysAnnouncement(Arrays.asList(sysUser.getId().split(",")),
"msgTitle",
contentENNo,
contentENNo,
contentInfoENNo,
MessageTypeEnum.PUSH.getValue(),
MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName(),
contentCNNo,
contentCNNo);
contentINfoCNNo);
this.sysAnnouncementService.saveAnnouncement(sysAnnouncement);
bussDocumentLibraryEOService.sendWebsocket(com.jero.modules.system.util.StringUtils.join(sysUser.getThirdId(), ","), sysUser.getThirdId());
String href = backUrl +"/problemknowledgeBase";
// String href = backUrl +"/problemknowledgeBase";
FeishuMsgVo feishuMsgVo = new FeishuMsgVo();
feishuMsgVo.setTitle(MessageTypeEnum.PUSH.getNameCn()+"/"+MessageTypeEnum.PUSH.getName());
feishuMsgVo.setUrl(href);
feishuMsgVo.setUrl(url);
feishuMsgVo.setContentEn(contentENNo);
feishuMsgVo.setContent(contentCNNo);
@@ -170,7 +170,7 @@ public class PrehomoJob implements Job {
}
}
//如果prehomo - 逾期后每天通知
if (projectLawsInventoryEO.getDesignDueDate().before(currentDate)) {
if (!StringUtils.equals(currentDateStr,sdf.format(projectLawsInventoryEO.getPrehomoDueDate()))&&projectLawsInventoryEO.getDesignDueDate().before(currentDate)) {
if(StringUtils.isNotEmpty(projectLawsInventoryEO.getDesignDutyId())){
dueUserIdList.add(projectLawsInventoryEO.getDesignDutyId());
}
@@ -169,7 +169,7 @@ public class VerifyComplianceJob implements Job {
}
}
//如果验证符合性 - 逾期后每天通知
if (projectLawsInventoryEO.getVerifyDueDate().before(currentDate)) {
if (!StringUtils.equals(currentDateStr,sdf.format(projectLawsInventoryEO.getVerifyDueDate()))&&projectLawsInventoryEO.getVerifyDueDate().before(currentDate)) {
if(StringUtils.isNotEmpty(projectLawsInventoryEO.getVerifyDutyId())){
dueUserIdList.add(projectLawsInventoryEO.getVerifyDutyId());
}
@@ -41,6 +41,7 @@ import com.jero.modules.system.enums.DicCodeEnum;
import com.jero.modules.system.mapper.SysDictItemMapper;
import com.jero.modules.system.mapper.SysUserMapper;
import com.jero.modules.system.service.ISysDictService;
import com.jero.modules.system.service.ISysUserService;
import com.jero.modules.system.service.impl.SysDictItemServiceImpl;
import com.jero.modules.system.util.StringUtils;
import org.apache.commons.collections4.CollectionUtils;
@@ -129,6 +130,9 @@ public class ProjectLibraryBaseServiceImpl extends ServiceImpl<ProjectLibraryBas
@Autowired
private ISysDictService sysDictService;
@Autowired
private ISysUserService sysUserService;
/**
* 保存
*
@@ -340,7 +344,9 @@ public class ProjectLibraryBaseServiceImpl extends ServiceImpl<ProjectLibraryBas
//判断该条项目是否是自己创建,如果不是则不能删除
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
List<ProjectLibraryBase> projectLibraryBases = this.queryById(id,null);
if(!loginUser.getUsername().equals(projectLibraryBases.get(0).getCreateBy())){
//管理员和创建人可以删除,其余人不能删除
boolean administrator = sysUserService.isAdministrator();
if(!loginUser.getUsername().equals(projectLibraryBases.get(0).getCreateBy()) && !administrator){
if(CutEnum.CN.getValue().equals(cut)){
throw new JeroBootException("该条项目非本人创建,不能删除");
}else{
@@ -477,13 +477,13 @@ public class ProjectTaskInventoryFeedbackEOServiceImpl extends ServiceImpl<Proje
//feishuMsgVo.setRegulationNo(projectLawsInventoryEO.getSerialNumber());
//feishuMsgVo.setProject(projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBaseInfo.getTargetMarket());
String initiator = "";
if (StringUtils.isNotEmpty(initiatorId)) {
QueryWrapper<SysUser> queryOneWrapper = new QueryWrapper<>();
queryOneWrapper.lambda().eq(SysUser::getId,initiatorId);
SysUser sysUser = this.sysUserService.getBaseMapper().selectOne(queryOneWrapper);
initiator = sysUser.getUsername();
}
//String initiator = "";
//if (StringUtils.isNotEmpty(initiatorId)) {
// QueryWrapper<SysUser> queryOneWrapper = new QueryWrapper<>();
// queryOneWrapper.lambda().eq(SysUser::getId,initiatorId);
// SysUser sysUser = this.sysUserService.getBaseMapper().selectOne(queryOneWrapper);
// initiator = sysUser.getUsername();
//}
//feishuMsgVo.setInitiator(initiator);
//MessageTypeEnum messageTypeEnum = null;
@@ -518,12 +518,12 @@ public class ProjectTaskInventoryFeedbackEOServiceImpl extends ServiceImpl<Proje
//messageTypeEnum = MessageTypeEnum.COMPLIANCE_CONFIRMATION;
msgTitle = MessageType2Enum.DESIGN_COMPLIANCE_CONFIRMATION.getCn() + "/" + MessageType2Enum.DESIGN_COMPLIANCE_CONFIRMATION.getEn();
cnContentUpper = "您好,"+ initiator +"向您提交了工程交付信息,请及时查看处理";
cnContentUpper = "您好,"+ currentUser.getUsername() +"向您提交了工程交付信息,请及时查看处理";
cnContentLower = "项目: " + projectName +
"\n法规: " + LAW_CN +
"\n发起人: " + currentUser.getUsername() +
"\n截止时间: " + sdf.format(projectLawsInventoryEO.getDesignDueDate());
enContentUpper = "Hello! "+ initiator +" has submitted the engineering deliverable information to you. Please check and address the task in a timely manner";
enContentUpper = "Hello! "+ currentUser.getUsername() +" has submitted the engineering deliverable information to you. Please check and address the task in a timely manner";
enContentLower = "Project: " + projectName +
"\nRegulation No: " + LAW_EN +
"\nInitiator: " + currentUser.getUsername() +
@@ -542,12 +542,12 @@ public class ProjectTaskInventoryFeedbackEOServiceImpl extends ServiceImpl<Proje
//messageTypeEnum = MessageTypeEnum.COMPLIANCE_CONFIRMATION;
msgTitle = MessageType2Enum.PRE_HOMO_CONFIRMATION.getCn() + "/" + MessageType2Enum.PRE_HOMO_CONFIRMATION.getEn();
cnContentUpper = "您好,"+ initiator +"向您提交了工程交付信息,请及时查看处理";
cnContentUpper = "您好,"+ currentUser.getUsername() +"向您提交了工程交付信息,请及时查看处理";
cnContentLower = "项目: " + projectName +
"\n法规: " + LAW_CN +
"\n发起人: " + currentUser.getUsername() +
"\n截止时间: " + sdf.format(projectLawsInventoryEO.getPrehomoDueDate());
enContentUpper = "Hello! "+ initiator +" has submitted the engineering deliverable information to you. Please check and address the task in a timely manner";
enContentUpper = "Hello! "+ currentUser.getUsername() +" has submitted the engineering deliverable information to you. Please check and address the task in a timely manner";
enContentLower = "Project: " + projectName +
"\nRegulation No: " + LAW_EN +
"\nInitiator: " + currentUser.getUsername() +
@@ -566,12 +566,12 @@ public class ProjectTaskInventoryFeedbackEOServiceImpl extends ServiceImpl<Proje
//messageTypeEnum = MessageTypeEnum.COMPLIANCE_CONFIRMATION;
msgTitle = MessageType2Enum.VALIDATION_COMPLIANCE_CONFIRMATION.getCn() + "/" + MessageType2Enum.VALIDATION_COMPLIANCE_CONFIRMATION.getEn();
cnContentUpper = "您好,"+ initiator +"向您提交了工程交付信息,请及时查看处理";
cnContentUpper = "您好,"+ currentUser.getUsername() +"向您提交了工程交付信息,请及时查看处理";
cnContentLower = "项目: " + projectName +
"\n法规: " + LAW_CN +
"\n发起人: " + currentUser.getUsername() +
"\n截止时间: " + sdf.format(projectLawsInventoryEO.getVerifyDueDate());
enContentUpper = "Hello! "+ initiator +" has submitted the engineering deliverable information to you. Please check and address the task in a timely manner";
enContentUpper = "Hello! "+ currentUser.getUsername() +" has submitted the engineering deliverable information to you. Please check and address the task in a timely manner";
enContentLower = "Project: " + projectName +
"\nRegulation No: " + LAW_EN +
"\nInitiator: " + currentUser.getUsername() +
@@ -2,31 +2,24 @@ package com.jero.modules.todoCenter.service.impl;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.ObjectUtil;
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.system.vo.LoginUser;
import com.jero.modules.cert.collect.entity.ParamsCollectManifestEO;
import com.jero.modules.cert.collect.enums.CollectManifestStateEnum;
import com.jero.modules.cert.collect.enums.CollectManifestUserTypeEnum;
import com.jero.modules.cert.collect.enums.ManifestStateEnum;
import com.jero.modules.cert.collect.mapper.ParamsCollectManifestEOMapper;
import com.jero.modules.cert.collect.mapper.ParamsManifestEOMapper;
import com.jero.modules.project.entity.ProjectLibraryBase;
import com.jero.modules.project.entity.ProjectRelatedPersonnel;
import com.jero.modules.project.mapper.ProjectLibraryBaseMapper;
import com.jero.modules.project.service.IProjectRelatedPersonnelService;
import com.jero.modules.system.entity.SysUser;
import com.jero.modules.system.service.ISysUserService;
import com.jero.modules.todoCenter.entity.ParamsManifestTodoCenterEO;
import com.jero.modules.todoCenter.service.IParamsManifestTodoCenterService;
import com.jero.modules.todoCenter.vo.ParamsManifestTodoCenterEOPage;
import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.*;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.stream.Collectors;
/**
@@ -36,15 +29,6 @@ import java.util.stream.Collectors;
*/
@Service
public class ParamsManifestTodoCenterServiceImpl implements IParamsManifestTodoCenterService {
@Autowired
private ProjectLibraryBaseMapper projectLibraryBaseMapper;
@Autowired
private ISysUserService sysUserService;
@Autowired
private IProjectRelatedPersonnelService projectRelatedPersonnelService;
@Autowired
private ParamsCollectManifestEOMapper paramsCollectManifestEOMapper;
@@ -53,27 +37,28 @@ public class ParamsManifestTodoCenterServiceImpl implements IParamsManifestTodoC
@Override
public IPage queryPage(ParamsManifestTodoCenterEOPage pageVO) {
// 查询所有项目下的 状态为收集中的清单
pageVO.setState(ManifestStateEnum.COLLECTING.getValue());
List<ParamsManifestTodoCenterEO> paramsManifestEOListAll = paramsManifestEOMapper.listForTodoCenter(pageVO);
// 筛选出当前登录人能在清单中是homo/sdt/dre角色的清单并分页
LambdaQueryWrapper<ProjectLibraryBase> projectLibraryBaseLambdaQueryWrapper = new LambdaQueryWrapper<>();
List<ProjectLibraryBase> projectLibraryBaseListAll = projectLibraryBaseMapper.selectList(projectLibraryBaseLambdaQueryWrapper);
int pageNo = pageVO.getPageNo();
int pageSize = pageVO.getPageSize();
IPage page = new Page(pageNo, pageSize);
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); // 获取当前登录用户
List<ParamsManifestTodoCenterEO> paramsManifestEOList = new ArrayList<>();
List<ProjectLibraryBase> projectLibraryBaseList = new ArrayList<>();
Map<String, Boolean> manifestUserTypeOfHomo = new HashMap<>();
Map<String, Boolean> manifestUserTypeOfSdt = new HashMap<>();
Map<String, Boolean> manifestUserTypeOfDre = new HashMap<>();
Map<String, List<ParamsCollectManifestEO>> paramsManifestEOListMap = new HashMap<>();
// 查询所有项目下的 状态为收集中的清单
pageVO.setState(ManifestStateEnum.COLLECTING.getValue());
pageVO.setUserId(loginUser.getId());
pageVO.setUserName(loginUser.getUsername());
List<ParamsManifestTodoCenterEO> paramsManifestEOListAll = paramsManifestEOMapper.listForTodoCenter(pageVO);
// 查询清单的所有参数项
List<ParamsCollectManifestEO> pcmListAll = paramsCollectManifestEOMapper.listInfoOfTodoCenter();
List<String> manifestIdList = paramsManifestEOListAll.stream().map(ParamsManifestTodoCenterEO::getId).collect(Collectors.toList());
if (CollectionUtil.isEmpty(manifestIdList)) {
return page;
}
List<ParamsCollectManifestEO> pcmListAll = paramsCollectManifestEOMapper.listInfoOfTodoCenter(manifestIdList);
if (CollectionUtil.isEmpty(pcmListAll)) {
return page;
}
String userType = "";
List<String> manifestIdListHomo = paramsManifestEOMapper.listInfoHomo(loginUser.getId(), ManifestStateEnum.COLLECTING.getValue());// 获取当前登录人 拥有认证工程师角色的清单
for(ParamsManifestTodoCenterEO paramsManifestEO : paramsManifestEOListAll) {
// 查询清单的所有参数项
List<ParamsCollectManifestEO> pcmList = pcmListAll.stream().filter(e->paramsManifestEO.getId().equals(e.getParamsManifestId())).collect(Collectors.toList());
@@ -83,44 +68,57 @@ public class ParamsManifestTodoCenterServiceImpl implements IParamsManifestTodoC
continue;
}
// 判断是不是homo角色
projectLibraryBaseList = projectLibraryBaseListAll.stream().filter(e->paramsManifestEO.getProjectId().equals(e.getId())).collect(Collectors.toList());
userType = getLoginUserTypeOfHomo(projectLibraryBaseList, loginUser);
if(StringUtils.isNotBlank(userType)) {
paramsManifestEOList.add(paramsManifestEO);
manifestUserTypeOfHomo.put(paramsManifestEO.getId(), true);
paramsManifestEOListMap.put(paramsManifestEO.getId(), pcmList);
continue;
int count = 0;
if(CollectionUtil.isNotEmpty(manifestIdListHomo) && manifestIdListHomo.contains(paramsManifestEO.getId())) { // 认证工程师 可以看到三种数量
// 统计待发起数量 包括状态待发起收集,变更,工程接口人退回
count = (int) pcmList.stream().filter(e -> CollectManifestStateEnum.WAIT_COLLECT.getValue().equals(e.getState())
|| CollectManifestStateEnum.SDT_BACK.getValue().equals(e.getState())
|| CollectManifestStateEnum.CHANGE.getValue().equals(e.getState())).count();
if (count > 0) {
paramsManifestEO.setWaitCollectNum(count);
}
// 统计待分配数量 包括状态待工程接口人处理,填写人退回
count = (int) pcmList.stream().filter(e-> (CollectManifestStateEnum.WAIT_SDT.getValue().equals(e.getState())
|| CollectManifestStateEnum.DRE_BACK.getValue().equals(e.getState()))).count();
if (count > 0) {
paramsManifestEO.setWaitSdtNum(count);
}
// 统计待填写数量 包括状态待填写,认证工程师退回
count = (int) pcmList.stream().filter(e-> (CollectManifestStateEnum.WAIT_FILL.getValue().equals(e.getState())
|| CollectManifestStateEnum.CERT_BACK.getValue().equals(e.getState()))).count();
if (count > 0) {
paramsManifestEO.setWaitFillNum(count);
}
} else { // 工程接口人和填写人 只能看到 工程接口人是自己 填写人是自己 的数量
// 统计待分配数量 包括状态待工程接口人处理,填写人退回
count = (int) pcmList.stream().filter(e-> (CollectManifestStateEnum.WAIT_SDT.getValue().equals(e.getState())
|| CollectManifestStateEnum.DRE_BACK.getValue().equals(e.getState()))
&& loginUser.getUsername().equals(e.getSdt())).count();
if (count > 0) {
paramsManifestEO.setWaitSdtNum(count);
}
// 统计待填写数量 包括状态待填写,认证工程师退回
count = (int) pcmList.stream().filter(e-> (CollectManifestStateEnum.WAIT_FILL.getValue().equals(e.getState())
|| CollectManifestStateEnum.CERT_BACK.getValue().equals(e.getState()))
&& loginUser.getUsername().equals(e.getDre())).count();
if (count > 0) {
paramsManifestEO.setWaitFillNum(count);
}
}
// 判断是不是sdt角色
userType = getLoginUserTypeOfSdt(pcmList, loginUser);
if(StringUtils.isNotBlank(userType)) {
paramsManifestEOList.add(paramsManifestEO);
manifestUserTypeOfSdt.put(paramsManifestEO.getId(), true);
paramsManifestEOListMap.put(paramsManifestEO.getId(), pcmList);
continue;
}
// 判断是不是dre角色
userType = getLoginUserTypeOfDre(pcmList, loginUser);
if(StringUtils.isNotBlank(userType)) {
paramsManifestEOList.add(paramsManifestEO);
manifestUserTypeOfDre.put(paramsManifestEO.getId(), true);
paramsManifestEOListMap.put(paramsManifestEO.getId(), pcmList);
continue;
}
}
// 分页
paramsManifestEOList = paramsManifestEOList.stream()
List<ParamsManifestTodoCenterEO> paramsManifestEOList =paramsManifestEOListAll.stream()
.filter(e->ObjectUtil.isNotNull(e.getWaitCollectNum()) || ObjectUtil.isNotNull(e.getWaitSdtNum()) || ObjectUtil.isNotNull(e.getWaitFillNum()))
.sorted(Comparator.comparing(ParamsManifestTodoCenterEO::getCreateTime).reversed())
.collect(Collectors.toList());
List<ParamsManifestTodoCenterEO> result = new ArrayList<>();
int pageNo = pageVO.getPageNo();
int pageSize = pageVO.getPageSize();
IPage page = new Page(pageNo, pageSize);
page.setTotal(paramsManifestEOList.size());
int subSize = pageVO.getPageSize(); // 每页记录数
int subCount = paramsManifestEOList.size(); // 总记录数
@@ -134,217 +132,9 @@ public class ParamsManifestTodoCenterServiceImpl implements IParamsManifestTodoC
result = new ArrayList();
}
// 统计清单中的待办参数数据
List<ParamsManifestTodoCenterEO> records = getStatistics(result, manifestUserTypeOfHomo, manifestUserTypeOfSdt, manifestUserTypeOfDre, paramsManifestEOListMap,loginUser);
page.setRecords(records);
page.setTotal(paramsManifestEOList.size());
page.setRecords(result);
return page;
}
public List<ParamsManifestTodoCenterEO> getStatistics(List<ParamsManifestTodoCenterEO> paramsManifestEOList, Map<String, Boolean> manifestUserTypeOfHomo
,Map<String, Boolean> manifestUserTypeOfSdt, Map<String, Boolean> manifestUserTypeOfDre, Map<String, List<ParamsCollectManifestEO>> paramsManifestEOListMap, LoginUser loginUser) {
List<ParamsManifestTodoCenterEO> paramsManifestTodoCenterEOList = new ArrayList<>();
for(ParamsManifestTodoCenterEO paramsManifestTodoCenterEO : paramsManifestEOList) {
// 查询清单的所有参数项
ParamsCollectManifestEO paramsCollectManifestEO = new ParamsCollectManifestEO();
paramsCollectManifestEO.setParamsManifestId(paramsManifestTodoCenterEO.getId());
List<ParamsCollectManifestEO> pcmList = paramsManifestEOListMap.get(paramsManifestTodoCenterEO.getId());
int count = 0;
if (ObjectUtil.isNotEmpty(paramsManifestTodoCenterEO.getId())
&& ObjectUtil.isNotEmpty(manifestUserTypeOfHomo.get(paramsManifestTodoCenterEO.getId()))) {
// 统计待发起数量 包括状态待发起收集,变更,工程接口人退回
count = (int) pcmList.stream().filter(e-> CollectManifestStateEnum.WAIT_COLLECT.getValue().equals(e.getState())
|| CollectManifestStateEnum.SDT_BACK.getValue().equals(e.getState())
|| CollectManifestStateEnum.CHANGE.getValue().equals(e.getState())).count();
if (count > 0) {
paramsManifestTodoCenterEO.setWaitCollectNum(count);
}
// 统计待分配数量 包括状态待工程接口人处理,填写人退回
count = (int) pcmList.stream().filter(e-> (CollectManifestStateEnum.WAIT_SDT.getValue().equals(e.getState())
|| CollectManifestStateEnum.DRE_BACK.getValue().equals(e.getState()))).count();
if (count > 0) {
paramsManifestTodoCenterEO.setWaitSdtNum(count);
}
// 统计待填写数量 包括状态待填写,认证工程师退回
count = (int) pcmList.stream().filter(e-> (CollectManifestStateEnum.WAIT_FILL.getValue().equals(e.getState())
|| CollectManifestStateEnum.CERT_BACK.getValue().equals(e.getState()))).count();
if (count > 0) {
paramsManifestTodoCenterEO.setWaitFillNum(count);
}
} else if (ObjectUtil.isNotEmpty(paramsManifestTodoCenterEO.getId())
&& ObjectUtil.isNotEmpty(manifestUserTypeOfSdt.get(paramsManifestTodoCenterEO.getId()))) {
// 统计待分配数量 包括状态待工程接口人处理,填写人退回
count = (int) pcmList.stream().filter(e-> (CollectManifestStateEnum.WAIT_SDT.getValue().equals(e.getState())
|| CollectManifestStateEnum.DRE_BACK.getValue().equals(e.getState()))
&& loginUser.getUsername().equals(e.getSdt())).count();
if (count > 0) {
paramsManifestTodoCenterEO.setWaitSdtNum(count);
}
// 统计待填写数量 包括状态待填写,认证工程师退回
count = (int) pcmList.stream().filter(e-> (CollectManifestStateEnum.WAIT_FILL.getValue().equals(e.getState())
|| CollectManifestStateEnum.CERT_BACK.getValue().equals(e.getState()))).count();
if (count > 0) {
paramsManifestTodoCenterEO.setWaitFillNum(count);
}
} else if (ObjectUtil.isNotEmpty(paramsManifestTodoCenterEO.getId())
&& ObjectUtil.isNotEmpty(manifestUserTypeOfDre.get(paramsManifestTodoCenterEO.getId()))) {
// 统计待填写数量 包括状态待填写,认证工程师退回
count = (int) pcmList.stream().filter(e-> (CollectManifestStateEnum.WAIT_FILL.getValue().equals(e.getState())
|| CollectManifestStateEnum.CERT_BACK.getValue().equals(e.getState()))
&& loginUser.getUsername().equals(e.getDre())).count();
if (count > 0) {
paramsManifestTodoCenterEO.setWaitFillNum(count);
}
}
paramsManifestTodoCenterEOList.add(paramsManifestTodoCenterEO);
}
return paramsManifestTodoCenterEOList;
}
/**
* 根据项目id清单id查询当前登录人的Homo角色
* @param projectId
* @param paramsManifestId
* @return
*/
public List<String> getLoginUserTypes(String projectId, String paramsManifestId, LoginUser loginUser) {
List<String> userTypeList = new ArrayList<>(); // 一个用户可以有多个用户类型
// LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); // 获取当前登录用户
// 查询项目下所有责任领域下的 homo人员
List<ProjectLibraryBase> projectLibraryBaseList = projectLibraryBaseMapper.queryById(projectId);
List<String> homoList = new ArrayList<>();
if (CollectionUtil.isNotEmpty(projectLibraryBaseList)) {
String homoIdStr = projectLibraryBaseList.get(0).getCertificationEngineer();
if (StringUtils.isNotEmpty(homoIdStr)) {
List<String> homoIdList = Arrays.asList(homoIdStr.split(",")).stream().distinct().collect(Collectors.toList());
homoList = sysUserService.listByIds(homoIdList).stream().map(SysUser::getUsername).collect(Collectors.toList());
}
}
// 查询项目下所有责任领域下的 sdt人员
List<String> sdtList = new ArrayList<>();
LambdaQueryWrapper<ProjectRelatedPersonnel> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(ProjectRelatedPersonnel::getProjectId, projectId);
List<ProjectRelatedPersonnel> prpList = projectRelatedPersonnelService.list(queryWrapper);
// String homoIdStr = prpList.stream().map(e -> e.getCertificationEngineer()).collect(Collectors.joining(","));
String sdtIdStr = prpList.stream().map(e -> e.getEngineeringInterfacePerson()).collect(Collectors.joining(","));
// 项目下有homo-->不一定有sdt
if(StringUtils.isNotBlank(sdtIdStr)) {
List<String> sdtIdList = Arrays.asList(sdtIdStr.split(",")).stream().distinct().collect(Collectors.toList());
sdtList = sysUserService.listByIds(sdtIdList).stream().map(SysUser::getUsername).collect(Collectors.toList());
}
// 查询项目下参数清单下收集参数项中的 sdt,dre人员
ParamsCollectManifestEO paramsCollectManifestEO = new ParamsCollectManifestEO();
paramsCollectManifestEO.setParamsManifestId(paramsManifestId);
List<ParamsCollectManifestEO> pcmList = paramsCollectManifestEOMapper.listInfo(paramsCollectManifestEO);
List<String> sdtListOfPCM = pcmList.stream()
.filter(e->StringUtils.isNotEmpty(e.getSdt()))
.map(ParamsCollectManifestEO::getSdt)
.distinct()
.collect(Collectors.toList());
sdtList.addAll(sdtListOfPCM); // 需要取并集因为存在参数项开始收集但 人员相关名单中sdt被修改的情况
List<String> dreListOfPCM = pcmList.stream()
.filter(e->StringUtils.isNotEmpty(e.getDre()))
.map(ParamsCollectManifestEO::getDre)
.distinct()
.collect(Collectors.toList());
String loginUserName = loginUser.getUsername().toLowerCase();
homoList = toLowerCaseOfList(homoList);
sdtList = toLowerCaseOfList(sdtList);
dreListOfPCM = toLowerCaseOfList(dreListOfPCM);
if (homoList.contains(loginUserName)) {
userTypeList.add(CollectManifestUserTypeEnum.HOMO.getValue());
}
if (sdtList.contains(loginUserName)) {
userTypeList.add(CollectManifestUserTypeEnum.SDT.getValue());
}
if (dreListOfPCM.contains(loginUserName)) {
userTypeList.add(CollectManifestUserTypeEnum.DRE.getValue());
}
return userTypeList;
}
public String getLoginUserTypeOfHomo(List<ProjectLibraryBase> projectLibraryBaseList, LoginUser loginUser) {
String userType = ""; // 一个用户可以有多个用户类型
// 查询项目下的 homo人员
List<String> homoList = new ArrayList<>();
if (CollectionUtil.isNotEmpty(projectLibraryBaseList)) {
String homoIdStr = projectLibraryBaseList.get(0).getCertificationEngineer();
if (StringUtils.isNotEmpty(homoIdStr)) {
List<String> homoIdList = Arrays.asList(homoIdStr.split(",")).stream().distinct().collect(Collectors.toList());
homoList = sysUserService.listByIds(homoIdList).stream().map(SysUser::getUsername).collect(Collectors.toList());
}
}
String loginUserName = loginUser.getUsername().toLowerCase();
homoList = toLowerCaseOfList(homoList);
if (homoList.contains(loginUserName)) {
userType = CollectManifestUserTypeEnum.HOMO.getValue();
}
return userType;
}
public String getLoginUserTypeOfSdt(List<ParamsCollectManifestEO> pcmList, LoginUser loginUser) {
String userType = ""; // 一个用户可以有多个用户类型
List<String> sdtListOfPCM = pcmList.stream()
.filter(e->StringUtils.isNotEmpty(e.getSdt()))
.map(ParamsCollectManifestEO::getSdt)
.distinct()
.collect(Collectors.toList());
String loginUserName = loginUser.getUsername().toLowerCase();
sdtListOfPCM = toLowerCaseOfList(sdtListOfPCM);
if (sdtListOfPCM.contains(loginUserName)) {
userType = CollectManifestUserTypeEnum.SDT.getValue();
}
return userType;
}
public String getLoginUserTypeOfDre(List<ParamsCollectManifestEO> pcmList, LoginUser loginUser) {
String userType = ""; // 一个用户可以有多个用户类型
List<String> dreListOfPCM = pcmList.stream()
.filter(e->StringUtils.isNotEmpty(e.getDre()))
.map(ParamsCollectManifestEO::getDre)
.distinct()
.collect(Collectors.toList());
String loginUserName = loginUser.getUsername().toLowerCase();
dreListOfPCM = toLowerCaseOfList(dreListOfPCM);
if (dreListOfPCM.contains(loginUserName)) {
userType = CollectManifestUserTypeEnum.DRE.getValue();
}
return userType;
}
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;
}
}
@@ -42,4 +42,8 @@ public class ParamsManifestTodoCenterEOPage {
private int pageNo;
private int pageSize;
private String state;
private String userId;
private String userName;
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 914 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 469 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 563 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 674 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 899 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 996 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1000 B

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

+1
View File
@@ -1359,5 +1359,6 @@ module.exports = {
Topping:'Topping',
cancelTopping:'Cancel Topping',
relatedProjectVersion:'Related project version',
Importfailure:'Import failure',
CuiBan:'CuiBan',
}
+1
View File
@@ -1460,5 +1460,6 @@ module.exports = {
Topping:'置顶',
cancelTopping:'取消置顶',
relatedProjectVersion:'相关项目版本',
Importfailure:'导入失败',
CuiBan:'催办',
}
@@ -0,0 +1,284 @@
<template>
<div>
<a-upload name="file" :showUploadList="false"
class="upload-text"
:multiple="false" :headers="tokenHeader"
:action="importUrl"
@change="handleImport"
:accept="accept">
<a-icon type="import" :rotate="270"/>
{{$t('import')}}
</a-upload>
<div class="loading-box" v-if="spinning">
<div class="loading-content">
<a-icon class="loading" type="loading"/>
<div class="loading-tips">
{{this.$t('Importing')}}...
</div>
</div>
</div>
<!-- 错误数据提示-->
<a-modal
:title="$t('Importfailure')"
:width="860"
v-model="visibleoperationFailed"
:maskClosable="false"
:footer="null"
>
<a-row :gutter="24">
<a-col :span="24">
<div>
<span style='font-size: 16px;margin-bottom: 20px;' v-for='(item,key) in operationFailedValue'>
<span v-html="item"></span>
</span>
</div>
</a-col>
</a-row>
<div class="imports-footer">
<div class="imports-footer-wrap">
<a-button class="imports-btn" type="primary" @click="cancleoperationFailed">{{$t('cancel')}}</a-button>
</div>
</div>
</a-modal>
</div>
</template>
<script>
import Vue from 'vue'
import {ACCESS_TOKEN} from '@/store/mutation-types'
import eventBUs from '../../common/event'
import {Modal} from 'ant-design-vue'
import store from '@/store'
export default {
name: 'index',
props: {
url: {
type: Object,
default: {}
},
//判断当前文档库还是其余的页面
isTrue: {
type: Boolean,
default: false
},
accept: {
type: String,
default: ''
},
projectId: {
type: String,
default: ''
},
dummyInventoryBaseId: {
type: String,
default: ''
},
paramsTemplateId: {
type: String,
default: ''
},
paramsManifestId: {
type: String,
default: ''
},
projectLibraryId: {
type: String,
default: ''
}
},
data() {
return {
tokenHeader: {'X-Access-Token': Vue.ls.get(ACCESS_TOKEN)},
spinning: false,
operationFailedValue:[],
visibleoperationFailed: false, // 数据失败的弹框
cut: ''
}
},
computed: {
importUrl() {
if (this.projectId) {
return window._CONFIG['domianURL'] + '/' + this.url.importZipUrl + '?cut=' + this.cut + '&projectId=' + this.projectId
} else if (this.dummyInventoryBaseId) {
return window._CONFIG['domianURL'] + '/' + this.url.importZipUrl + '?cut=' + this.cut + '&dummyInventoryBaseId=' + this.dummyInventoryBaseId
} else if (this.paramsTemplateId) {
return window._CONFIG['domianURL'] + '/' + this.url.importZipUrl + '?cut=' + this.cut + '&paramsTemplateId=' + this.paramsTemplateId
} else if (this.projectLibraryId) {
return window._CONFIG['domianURL'] + '/' + this.url.importZipUrl + '?cut=' + this.cut + '&projectLibraryId=' + this.projectLibraryId
} else if (this.paramsManifestId) {
return window._CONFIG['domianURL'] + '/' + this.url.importZipUrl + '?cut=' + this.cut + '&paramsManifestId=' + this.paramsManifestId
}
return window._CONFIG['domianURL'] + '/' + this.url.importZipUrl + '?cut=' + this.cut
}
},
mounted() {
let long = localStorage.getItem('language')
this.cut = ''
if (long && long == 'zh-cn') {
this.cut = 'cn'
} else if (long && long == 'en-us') {
this.cut = 'en'
}
},
methods: {
handleImport(info) {
this.spinning = true
if (info.file.status !== 'uploading') {
this.$emit('getList')
}
if (info.file.status === 'done') {
if (info.file.response.success) {
if (info.file.response.code === 201) {
let {message} = info.file.response
let {name} = info.file
let content = []
if (message) {
message = message.split('</br>')
message.forEach(res => {
if (res) {
content.push( < div > {res} < /div>)
}
})
}
this.$warning({
title: name,
content: (
< div >
{content}
< /div>
)
})
} else {
if (this.isTrue) {
this.$emit('getList')
} else {
eventBUs.$emit('searchReset')
}
console.log(info.file.response.message)
if(info.file.response.message == null){
console.log(111)
this.operationFailedValue = info.file.response.result
this.visibleoperationFailed = true
}else{
this.$message.success(info.file.response.message || `${info.file.name} 文件导入成功`)
}
}
this.spinning = false
} else {
let data = info.file.response
const token = Vue.ls.get(ACCESS_TOKEN)
if ((token && data.message.includes('Token失效')) || (token && data.message.includes('token')) || (token && data.message.includes('用户不存在'))) {
this.spinning = false
Modal.error({
title: '登录已过期',
content: '很抱歉登录已过期请重新登录',
okText: '重新登录',
mask: false,
onOk: () => {
store.dispatch('Logout').then(() => {
Vue.ls.remove(ACCESS_TOKEN)
window.location.reload()
})
}
})
return
}
let {message} = info.file.response
let {name} = info.file
let content = []
if (message) {
message = message.split('</br>')
message.forEach(res => {
if (res) {
content.push( < div > {res} < /div>)
}
})
}
this.$warning({
title: name,
content: (
< div >
{content}
< /div>
)
})
this.spinning = false
}
} else if (info.file.status === 'error') {
if (info.file.response.status === 500) {
let data = info.file.response
const token = Vue.ls.get(ACCESS_TOKEN)
if ((token && data.message.includes('Token失效')) || (token && data.message.includes('token')) || (token && data.message.includes('用户不存在'))) {
Modal.error({
title: '登录已过期',
content: '很抱歉登录已过期请重新登录',
okText: '重新登录',
mask: false,
onOk: () => {
store.dispatch('Logout').then(() => {
Vue.ls.remove(ACCESS_TOKEN)
window.location.reload()
})
}
})
}
this.spinning = false
} else {
this.$message.error(`文件导入失败: ${info.file.msg} `)
this.spinning = false
}
}
},
// 错误数据的弹框
cancleoperationFailed() {
this.operationFailedValue = []
this.visibleoperationFailed = false
},
}
}
</script>
<style>
.upload-text .ant-upload {
font-size: 14px !important;
font-weight: 400 !important;
color: #040B29 !important;
}
</style>
<style scoped lang="less">
.loading-box {
position: fixed;
top: 0;
left: 0;
z-index: 9999900;
width: 100%;
height: 100%;
background-color: rgba(255, 255, 255, 0.9);
border-radius: 8px;
user-select: none;
.loading-content {
position: absolute;
top: 50%;
left: 50%;
color: #21c9cc;
transform: translate(-50%, -50%);
text-align: center;
.loading {
font-size: 28px;
}
.spin-loading {
animation: rotating 2s linear infinite;
}
.loading-tips {
margin-top: 5px;
font-size: 16px;
color: #21c9cc;
}
}
}
</style>
@@ -26,11 +26,11 @@
<a-icon type="codepen"/>
{{$t('DocumentSplitting')}}
</div>
<div @click="DocumentTranslationClick" v-has="'bussLog:translation'" class="operator-text-text"
:title="$t('DocumentTranslation')">
<a-icon type="file-pdf"/>
{{$t('DocumentTranslation')}}
</div>
<!-- <div @click="DocumentTranslationClick" v-has="'bussLog:translation'" class="operator-text-text"-->
<!-- :title="$t('DocumentTranslation')">-->
<!-- <a-icon type="file-pdf"/>-->
<!-- {{$t('DocumentTranslation')}}-->
<!-- </div>-->
<div @click="DocumentComparisonClick" v-has="'bussLog:comparison'" class="operator-text-text"
:title="$t('DocumentComparison')">
<a-icon type="wallet"/>
@@ -42,7 +42,7 @@
{{title && title.length > 18?title.slice(0,17)+'...':title}}
</span>
<template #overlay>
<a-menu v-if="$route.query.createBy == userData.username"
<a-menu v-if="$route.query.createBy == userData.username || administrators"
@click="({ key: menuKey }) => onContextMenuClick(treeKey, menuKey, record)">
<a-menu-item key="1" @click="orgAdd" v-has="'split:sarFileSplitMenu:add'">{{$t('newNode')}}
</a-menu-item>
@@ -67,19 +67,19 @@
</div>
<div class="table-operator">
<div class="operator-text" @click="handleCopyManage"
v-if="$route.query.createBy == userData.username"
v-if="$route.query.createBy == userData.username || administrators"
v-has="'split:sarFileSplitItems:copy'">
<a-icon type="copy"/>
{{ $t('copy') }}
</div>
<div class="operator-text" @click="handleAddManage"
v-if="$route.query.createBy == userData.username"
v-if="$route.query.createBy == userData.username || administrators"
v-has="'split:sarFileSplitItems:add'">
<a-icon type="plus"/>
{{ $t('add') }}
</div>
<div class="operator-text upload-split"
v-if="$route.query.createBy == userData.username"
v-if="$route.query.createBy == userData.username || administrators"
@click="handleImportManage" v-has="'split:sarFileSplitItems:import'">
<a-icon type="import" :rotate="-90" v-if="uploadMenuId===undefined||uploadMenuId===''"/>
{{ (uploadMenuId===''||uploadMenuId===undefined)? $t('import'):'' }}
@@ -94,25 +94,25 @@
{{ $t('export') }}
</div>
<div class="operator-text" @click="handleDownManage"
v-if="$route.query.createBy == userData.username"
v-if="$route.query.createBy == userData.username || administrators"
v-has="'split:sarFileSplitItems:template'">
<a-icon type="download"/>
{{ $t('TemplateDownload') }}
</div>
<div class="operator-text" @click="handleMergeManage"
v-if="$route.query.createBy == userData.username"
v-if="$route.query.createBy == userData.username || administrators"
v-has="'split:sarFileSplitItems:merge'">
<a-icon type="snippets"/>
{{ $t('MergerClause') }}
</div>
<div class="operator-text" @click="handleManage"
v-if="$route.query.createBy == userData.username"
v-if="$route.query.createBy == userData.username || administrators"
v-has="'split:sarFileSplitItems:set'">
<a-icon type="setting"/>
{{ $t('BatchSetting') }}
</div>
<div class="operator-text" @click="handleBatCancel"
v-if="$route.query.createBy == userData.username"
v-if="$route.query.createBy == userData.username || administrators"
v-has="'split:sarFileSplitItems:delete'">
<a-icon type="delete"/>
{{ $t('BatchDelete') }}
@@ -126,7 +126,7 @@
:OperationList="OperationList"
:infoId="$route.query.infoId"
:menuId="menuId"
:showAction="$route.query.createBy == userData.username ? true :false"
:showAction="$route.query.createBy == userData.username || administrators ? true :false"
@onSelectChange="onSelectChange"
@deleteClick="deleteClick"
@editClick="editClick"
@@ -320,7 +320,8 @@
parameter: {},
widthBrown: '',
creenWidth: document.body.clientWidth,
brownHeight: document.documentElement.clientHeight
brownHeight: document.documentElement.clientHeight,
administrators:false,
}
},
watch: {
@@ -357,6 +358,14 @@
this.userData = this.userInfo()
this.administrators = false
if (this.userInfo().userRoleList && this.userInfo().userRoleList.length > 0) {
this.userInfo().userRoleList.forEach(res => {
if (res.roleCode == 'admin') {
this.administrators = true
}
})
}
this.infoId = this.$route.query.infoId
console.log('info', this.$route.query)
this.loadMenuData()
@@ -223,7 +223,7 @@
...this.queryParam
}
this.loading = true
postAction('document/bussDocumentLibraryEO/ocrPageInfo', query).then((res) => {
postAction('document/bussDocumentLibraryEO/transPageInfo', query).then((res) => {
if (res.success) {
this.dataList = res.result.records || []
this.total = res.result.total
@@ -416,6 +416,7 @@ export default {
controlValues: [
{ required: true, message: this.$t('PleaseEnter')+this.$t('controlAlternatives'), trigger: 'blur' },
{ min:1, max: 500, message: this.$t('cantExeed')+'500'+this.$t('characters'), trigger: 'blur' },
{ validator: this.test }
],
titleDefaultValue: [
{ required: true, message: this.$t('PleaseEnter')+this.$t('DefaultValue'), trigger: 'blur' },
@@ -453,6 +454,14 @@ export default {
}
},
methods: {
test(rule, value, callback) {
var money = /^[^##!]*$/
if (money.test(value)) {
callback()
} else {
callback(new Error(this.$t('disableInput') + '!#'))
}
},
getcontentListedEdit() {
getAction('sys/dict/getDictItems/cert_category', { }).then((res) => {
if (res.success) {
@@ -113,7 +113,8 @@
if (this.idList && this.idList.length > 0) {
id = this.idList.join(',')
} else {
id = this.$route.query.id
id = this.$route.query.parentId ? this.$route.query.parentId : this.$route.query.id
// id = this.$route.query.id
}
getAction('project/projectLibraryBase/getProjectDetailsStatisticsCollectManifestLabel', {id:id}).then((res) => {
if (res.success) {
@@ -463,7 +463,7 @@
import AdjustareaSofrespon from '@/components/AdjustareaSofrespon/index'
import ReferenceParameter from '@/components/ReferenceParameter/index'
import AssignedBy from '@/components/AssignedBy/index'
import ImportFileOnlyList from '@/components/ImportFileOnlyList/index'
import ImportFileOnlyList from '@/components/ImportFileOnlyListtag/index'
import axios from 'axios'
import { ACCESS_TOKEN } from '@/store/mutation-types'
import Vue from 'vue'
@@ -684,12 +684,11 @@
// }
},
mounted() {
console.log(this.$route.query)
this.GetgetLoginUserType()
console.log(this.currentPersonRole)
if(this.$route.query.type == '1'){
this.handleOkRoleSwitching()
}
this.GetgetLoginUserType()
console.log(this.currentPersonRole)
setTimeout(() => {
if (this.currentPersonRole == 'dre') {
this.handlePreservation()
@@ -724,7 +723,7 @@
handleOkRoleSwitching() {
if(this.$route.query.type == '1'){
let query = {
userType:this.$route.query.userType,
userType:this.formInlineRoleSwitching.roleSwitchingCode ? this.formInlineRoleSwitching.roleSwitchingCode : this.$route.query.userType,
paramsManifestId: this.$route.query.id,
projectId: this.$route.query.projectId,
userId: this.userInfo().id
@@ -732,10 +731,10 @@
this.confirmLoadingRoleSwitching = true
postAction('/params/userTypeLog/edit', query).then((res) => {
if (res.success) {
this.currentPersonRole = this.$route.query.userType
this.currentPersonRole = this.formInlineRoleSwitching.roleSwitchingCode ? this.formInlineRoleSwitching.roleSwitchingCode : this.$route.query.userType
this.visibleRoleSwitching = false
this.confirmLoadingRoleSwitching = false
localStorage.setItem('currentPersonRole', JSON.stringify(this.$route.query.userType))
localStorage.setItem('currentPersonRole', JSON.stringify(this.formInlineRoleSwitching.roleSwitchingCode ? this.formInlineRoleSwitching.roleSwitchingCode : this.$route.query.userType))
this.RoleType.forEach((item,index) => {
if(item.value == this.currentPersonRole){
this.rolename = item.label
@@ -935,7 +934,7 @@
ids: this.selectedRowKeys.join(','),
exportName:this.$route.query.projectName + '(' + this.$route.query.title + ')'
}
let name = this.$route.query.projectName + '(' + this.$route.query.title + ')' + '.xlsx'
let name = this.$route.query.projectName + '(' + this.$route.query.title + ')' + '.zip'
downloadFile('/params/collectManifest/exportDre', name , query , this.selectClear)
},
getList(){
@@ -189,8 +189,8 @@
<TaskListModel @TaskListModelList="TaskListModelList" ref="TaskListModelRef"/>
<taskBatSetting @taskBatSettingForm="taskBatSettingForm" ref="taskBatSettingRef"></taskBatSetting>
<batchChangeModel @batchChangeModel="batchChangeModel" ref="batchChangeModelRef"/>
<batchModel @batchModel="batchModel" ref="batchModelRef"/>
<cuibanModel @cibanModel="cibanModel" ref="cModelRef"/>
<batchModel @batchModel="batchModel" ref="batchModelRef"/>
<!-- 错误数据提示-->
<a-modal
:title="$t('operationFailed')"
@@ -222,8 +222,8 @@
import batchChangeModel from './batchChangeModel'
import batchModel from './batchModel'
import TaskListModel from './TaskListModel'
import taskBatSetting from './taskBatSetting'
import cuibanModel from './cuibanModel'
import taskBatSetting from './taskBatSetting'
import { getAction, postAction, deleteAction, downloadFile } from '@/api/manage'
import { mapGetters } from 'vuex'
import store from '@/store/'
@@ -618,6 +618,17 @@
}
},
// 催办
cuibanClick(){
if(this.selectionRowsArray.length <1){
this.$message.warning(this.$t('selectLeastOne'))
}else{
this.$refs.cModelRef.getData(this.selectionRowsArray)
}
},
cibanModel(){
this.getList()
},
cancleoperationFailed(){
this.visibleoperationFailed = false
},
@@ -66,6 +66,7 @@
:expandIconAsCell='false'
:expandIconColumnIndex="5"
:expandIcon="expandIcon"
:expandRowByClick="true"
:loading="loading"
@expand="expandChange"
@change="handleTableChange">
@@ -167,42 +167,97 @@
},
//待填写数量
waitFillClick(item) {
let _this = this
item.type = '1'
item.userType = 'dre'
console.log(item)
let newUrl = _this.$router.resolve({
path: '/ParameterItemCollection',
query: item
// projectName:this.$route.query.projectName
let query = {
paramsManifestId: item.id,
projectId: item.projectId
}
this.loading = true
let userType = ''
let valueList = []
getAction('params/collectManifest/getLoginUserType', query).then((res) => {
if(res.result){
res.result.find((item,index) => {
if(item.value){
valueList.push(item.value)
}
})
let flag = valueList.find((item,index) => {
return item == 'dre'
})
let _this = this
item.type = '1'
item.userType = _this.flag == undefined ? valueList[0] : 'dre'
let newUrl = _this.$router.resolve({
path: '/ParameterItemCollection',
query: item
// projectName:this.$route.query.projectName
})
window.open(newUrl.href, '_blank')
}
})
window.open(newUrl.href, '_blank')
},
//待分配填写人数量
waitSdtClick(item) {
let _this = this
item.type = '1'
item.userType = 'sdt'
console.log(item)
let newUrl = _this.$router.resolve({
path: '/ParameterItemCollection',
query: item
// projectName:this.$route.query.projectName
let query = {
paramsManifestId: item.id,
projectId: item.projectId
}
this.loading = true
let userType = ''
let valueList = []
getAction('params/collectManifest/getLoginUserType', query).then((res) => {
if(res.result){
res.result.find((item,index) => {
if(item.value){
valueList.push(item.value)
}
})
let flag = valueList.find((item,index) => {
return item == 'sdt'
})
let _this = this
item.type = '1'
item.userType = _this.flag == undefined ? valueList[0] : 'sdt'
let newUrl = _this.$router.resolve({
path: '/ParameterItemCollection',
query: item
// projectName:this.$route.query.projectName
})
window.open(newUrl.href, '_blank')
}
})
window.open(newUrl.href, '_blank')
},
//参数待发起数量
waitCollectClick(item) {
let _this = this
item.type = '1'
item.userType = 'homo'
console.log(item)
let newUrl = _this.$router.resolve({
path: '/ParameterItemCollection',
query: item
// projectName:this.$route.query.projectName
let query = {
paramsManifestId: item.id,
projectId: item.projectId
}
this.loading = true
let userType = ''
let valueList = []
getAction('params/collectManifest/getLoginUserType', query).then((res) => {
if(res.result){
res.result.find((item,index) => {
if(item.value){
valueList.push(item.value)
}
})
let flag = valueList.find((item,index) => {
return item == 'homo'
})
let _this = this
item.type = '1'
item.userType = _this.flag == undefined ? valueList[0] : 'homo'
let newUrl = _this.$router.resolve({
path: '/ParameterItemCollection',
query: item
// projectName:this.$route.query.projectName
})
window.open(newUrl.href, '_blank')
}
})
window.open(newUrl.href, '_blank')
},
SizeChange(page, pageSize) {
this.pageNo = 1