合并分支 'fix_2nd_period' 到 'master'

Fix 2nd period

查看合并请求 laws-nio/laws-weilai!253
This commit is contained in:
高嵩
2022-11-24 20:29:09 +08:00
18 changed files with 1821 additions and 263 deletions
@@ -27,3 +27,8 @@ 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`;
-- 认证参数历史列表添加字段--------2022-11-23 未同步生产环境
ALTER TABLE `laws_weilai`.`params_manifest`
ADD COLUMN `project_version_id` varchar(50) NULL COMMENT '项目相关版本对应的项目id' AFTER `explanation`;
ALTER TABLE `laws_weilai`.`params_manifest_history`
ADD COLUMN `project_version_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '项目相关版本对应的项目id' AFTER `explanation`;
@@ -103,10 +103,13 @@ public class ParamsManifestEO implements Serializable {
@TableField(exist = false)
private String projectName;
//相关项目版本
@ApiModelProperty(value = "相关项目版本")
private String projectVersion;
//说明
@ApiModelProperty(value = "说明")
private String explanation;
@ApiModelProperty(value = "项目相关版本对应的项目id")
private String projectVersionId;
}
@@ -18,6 +18,7 @@
<result column="params_template_name" property="paramsTemplateName" />
<result column="project_version" property="projectVersion" />
<result column="explanation" property="explanation" />
<result column="project_version_id" property="projectVersionId" />
</resultMap>
<resultMap id="ParamsManifestEOResultMapForCopy" type="com.jero.modules.cert.collect.vo.ParamsManifestVO">
<id column="id" property="id" />
@@ -49,6 +49,7 @@ import com.jero.modules.oss.service.IOSSFileService;
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.IProjectLibraryBaseService;
import com.jero.modules.project.service.IProjectRelatedPersonnelService;
import com.jero.modules.split.common.FileUnZip;
import com.jero.modules.split.common.ReadExcel;
@@ -147,6 +148,8 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
@Autowired
private ProjectLibraryBaseMapper projectLibraryBaseMapper;
@Autowired
private IProjectLibraryBaseService projectLibraryBaseService;
@Autowired
private WebSocketServer webSocketServer; // 同步上报库时变更清单状态时使用
@Resource
private WebSocket webSocket; // 消息专用
@@ -172,6 +175,7 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
List<ParamsInfoPublishEO> paramsInfoPublishEOList = paramsCollectManifestVO.getParamsInfoPublishEOList();
LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
ParamsManifestEO paramsManifestEO = paramsManifestEOService.getById(paramsManifestId);
// 复制参数项
List<ParamsCollectManifestEO> paramsCollectManifestEOList = new ArrayList<>();
@@ -192,7 +196,7 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
target.setUpdateTime(date);
// 根据负责领域处理工程接口人(零个,一个,多个): 领域中仅有一个人时,添加该字段
ProjectRelatedPersonnel projectRelatedPersonnel = projectRelatedPersonnelService.queryByProjectIdAndDutyTerritory(projectId, source.getDutyTerritory());
ProjectRelatedPersonnel projectRelatedPersonnel = projectRelatedPersonnelService.queryByProjectIdAndDutyTerritory(paramsManifestEO.getProjectVersionId(), source.getDutyTerritory());
if (ObjectUtil.isNotEmpty(projectRelatedPersonnel)) {
String sdtId = projectRelatedPersonnel.getEngineeringInterfacePerson();
if (org.apache.commons.lang.StringUtils.isNotBlank(sdtId) && !sdtId.contains(",")) { // 领域中仅有一个人时,添加该字段
@@ -207,7 +211,6 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
}
// 判断清单状态是否为已完成,若是,更改为收集中
ParamsManifestEO paramsManifestEO = paramsManifestEOService.getById(paramsManifestId);
if (ManifestStateEnum.FINISHED.getValue().equals(paramsManifestEO.getState())) {
// 更新清单状态和完成时间
ParamsManifestEO updateParamsManifestEO = new ParamsManifestEO();
@@ -1043,8 +1046,11 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
@Override
public List<Map<String,String>> querySdtList(ParamsCollectManifestVO paramsCollectManifestVO) {
// 根据主项目ID 查询 相关项目版本的项目ID
String projectVersionId = projectLibraryBaseService.getIdByVersionAndParentId(paramsCollectManifestVO.getProjectVersion(), paramsCollectManifestVO.getProjectId());
List<Map<String,String>> sdtList = new ArrayList<>();
ProjectRelatedPersonnel projectRelatedPersonnel = projectRelatedPersonnelService.queryByProjectIdAndDutyTerritory(paramsCollectManifestVO.getProjectId(), paramsCollectManifestVO.getDutyTerritory());
ProjectRelatedPersonnel projectRelatedPersonnel = projectRelatedPersonnelService.queryByProjectIdAndDutyTerritory(projectVersionId, paramsCollectManifestVO.getDutyTerritory());
if (ObjectUtil.isNotEmpty(projectRelatedPersonnel)) {
String sdtIds = projectRelatedPersonnel.getEngineeringInterfacePerson();
if (StringUtils.isNotBlank(sdtIds)) {
@@ -1075,15 +1081,30 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
List<Map<String, String>> userTypeList = new ArrayList<>(); // 一个用户可以有多个用户类型
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); // 获取当前登录用户
// 查询项目下所有责任领域下的 homo人员
List<ProjectLibraryBase> projectLibraryBaseList = projectLibraryBaseMapper.queryById(projectId);
List<String> homoList = new ArrayList<>();
List<ProjectLibraryBase> projectLibraryBaseList = projectLibraryBaseService.getParentAndChildern(projectId);
List<String> homoList = new ArrayList<>(); //homo人员
List<String> studioList = new ArrayList<>(); //studio人员
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());
for (ProjectLibraryBase projectLibraryBase : projectLibraryBaseList) {
// 查询主项目及子项目下所有 homo人员
List<String> homoIdList1 = Arrays.asList(projectLibraryBase.getCertificationEngineer().split(",")).stream().collect(Collectors.toList());
if (CollectionUtil.isNotEmpty(homoIdList1)) {
homoList.addAll(sysUserService.listByIds(homoIdList1).stream().map(SysUser::getUsername).collect(Collectors.toList()));
}
// 查询当前登录用户角色 是否是当前项目的studio
List<String> studioList1 = Arrays.asList(projectLibraryBase.getStudioEngineer().split(",")).stream().collect(Collectors.toList());
if (CollectionUtil.isNotEmpty(studioList1)) {
studioList.addAll(sysUserService.listByIds(studioList1).stream().map(SysUser::getUsername).collect(Collectors.toList())); // studio 一个项目只有一个
}
}
// 去重
homoList = homoList.stream().distinct().collect(Collectors.toList());
studioList = studioList.stream().distinct().collect(Collectors.toList());
}
// 查询项目下所有责任领域下的 sdt人员
@@ -1124,11 +1145,7 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
List<String> userRoleIdList = userRoles.stream().map(SysUserRole::getRoleId).collect(Collectors.toList());
userRoleIds = roleIdList.stream().filter(e->userRoleIdList.contains(e)).collect(Collectors.toList());
}
// 查询当前登录用户角色 是否是当前项目的studio
List<String> studioList = new ArrayList<>();
if (CollectionUtil.isNotEmpty(projectLibraryBaseList)) {
studioList = projectLibraryBaseList.stream().map(ProjectLibraryBase::getStudioEngineerName).collect(Collectors.toList()); // studio 一个项目只有一个
}
String loginUserName = loginUser.getUsername().toLowerCase();
studioList = toLowerCaseOfList(studioList);
@@ -1460,7 +1477,7 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
updateEO.setDutyTerritory(dutyTerritory);
// 根据负责领域处理工程接口人(零个,一个,多个): 领域中仅有一个人时,添加该字段
ProjectRelatedPersonnel projectRelatedPersonnel = projectRelatedPersonnelService.queryByProjectIdAndDutyTerritory(projectId, dutyTerritory);
ProjectRelatedPersonnel projectRelatedPersonnel = projectRelatedPersonnelService.queryByProjectIdAndDutyTerritory(paramsManifestEO.getProjectVersionId(), dutyTerritory);
if (ObjectUtil.isNotEmpty(projectRelatedPersonnel)) {
String sdtId = projectRelatedPersonnel.getEngineeringInterfacePerson();
if (org.apache.commons.lang.StringUtils.isNotBlank(sdtId) && !sdtId.contains(",")) { // 领域中仅有一个人时,添加该字段
@@ -2248,6 +2265,9 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
String paramsManifestId = paramsCollectManifestVO.getParamsManifestId();
String projectId = paramsCollectManifestVO.getProjectId();
// 查询参数清单
ParamsManifestEO paramsManifestEO = paramsManifestEOService.getById(paramsManifestId);
// 查询所有收集参数项
ParamsCollectManifestEO paramsCollectManifestEO = new ParamsCollectManifestEO();
paramsCollectManifestEO.setParamsManifestId(paramsManifestId);
@@ -2260,7 +2280,7 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
list.forEach(collectManifestEO -> {
// 根据负责领域处理工程接口人(零个,一个,多个): 领域中仅有一个人时,添加该字段
ProjectRelatedPersonnel projectRelatedPersonnel = projectRelatedPersonnelService.queryByProjectIdAndDutyTerritory(projectId, collectManifestEO.getDutyTerritory());
ProjectRelatedPersonnel projectRelatedPersonnel = projectRelatedPersonnelService.queryByProjectIdAndDutyTerritory(paramsManifestEO.getProjectVersionId(), collectManifestEO.getDutyTerritory());
if (ObjectUtil.isNotEmpty(projectRelatedPersonnel)) {
String sdtId = projectRelatedPersonnel.getEngineeringInterfacePerson();
if (org.apache.commons.lang.StringUtils.isNotBlank(sdtId) && !sdtId.contains(",")) { // 领域中仅有一个人时,添加该字段
@@ -2283,7 +2303,7 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
@Override
public void exportAll(ParamsCollectManifestVO paramsCollectManifestVO, HttpServletResponse response, HttpServletRequest request) {
// OutputStream os = null;
OutputStream os = null;
OutputStream excelOS = null;
XSSFWorkbook workbook = new XSSFWorkbook();
String fileOriName = "参数项清单导出信息";
@@ -2379,58 +2399,58 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
String repFileName = fileName.replaceAll("/","_");
excelOS = new FileOutputStream(fileNowPath + File.separator + repFileName);
// response.setHeader("Content-Disposition",
// "attachment; filename=\""+ ReadExcel.encodeFileName(fileOriName+".zip", request) +"\"");
// response.setContentType("application/force-download");
// response.flushBuffer();
// os = response.getOutputStream();
response.setHeader("Content-Disposition",
"attachment; filename=\""+ ReadExcel.encodeFileName(fileOriName+".zip", request) +"\"");
response.setContentType("application/force-download");
response.flushBuffer();
os = response.getOutputStream();
workbook.write(excelOS);
excelOS.flush();
excelOS.close();
ZipUtil.zip(fileNowPath,fileNowPath+".zip");
// FileInputStream fis = new FileInputStream(fileNowPath+".zip");
// int len = 0;
// while ((len = fis.read()) != -1) {
// os.write(len);
// }
FileInputStream fis = new FileInputStream(fileNowPath+".zip");
int len = 0;
while ((len = fis.read()) != -1) {
os.write(len);
}
// 将导出文件上传到cos上
String uploadFileName = fileOriName + ".zip";
InputStream uploadFileio = new FileInputStream(new File(fileNowPath+".zip"));
MultipartFile mFile = new MockMultipartFile(uploadFileName, uploadFileName, "text/plain", uploadFileio); // 用于上传
OSSFile ossFile = ossFileService.uploadLocalOfCos(mFile, "/manifest", "", CutEnum.CN.getValue()); // 上传导出的压缩包
// 系统向用户发消息
LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); // 获取当前登录人
String msgTitle = "The file " + paramsCollectManifestVO.getExportName() + " that you exported has been generated.";
String content = "The file " + paramsCollectManifestVO.getExportName() + " that you exported has been generated, please click download.";
String href = "<a href='/jero-boot/sys/common/downLoadFile?id=" + ossFile.getId() + "'" + " target='_blank'>download</a>.";
String contentInfo = "The file " + paramsCollectManifestVO.getExportName() + " that you exported has been generated, please click " + href;
SysAnnouncement sysAnnouncement = new SysAnnouncement();
sysAnnouncement.setDelFlag("0");
sysAnnouncement.setSendStatus("0");
sysAnnouncement.setSendTime(new Date());
sysAnnouncement.setMsgCategory(MessageTypeEnum.PUSH.getValue()); //消息类型:转发推送
sysAnnouncement.setInitiator(MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName()); // 发起人:系统
sysAnnouncement.setMsgType(CommonConstant.MSG_TYPE_UESR);//指定用户
sysAnnouncement.setTitile(msgTitle);
sysAnnouncement.setMsgContent(content);
sysAnnouncement.setMsgContentInfo(contentInfo);
sysAnnouncement.setUserIds(currentUser.getId()); // 发送给当前导出人
sysAnnouncementService.saveAnnouncement(sysAnnouncement);
JSONObject obj = new JSONObject();
obj.put(WebsocketConst.MSG_CMD, WebsocketConst.CMD_TOPIC);
obj.put(WebsocketConst.MSG_ID, currentUser.getId());
obj.put(WebsocketConst.MSG_TXT, contentInfo);
webSocket.sendMessage(obj.toJSONString());
uploadFileio.close();
// os.flush();
// os.close(); // 后开先关
// fis.close(); // 先开后关
// // 将导出文件上传到cos上
// String uploadFileName = fileOriName + ".zip";
// InputStream uploadFileio = new FileInputStream(new File(fileNowPath+".zip"));
// MultipartFile mFile = new MockMultipartFile(uploadFileName, uploadFileName, "text/plain", uploadFileio); // 用于上传
// OSSFile ossFile = ossFileService.uploadLocalOfCos(mFile, "/manifest", "", CutEnum.CN.getValue()); // 上传导出的压缩包
//
// // 系统向用户发消息
// LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); // 获取当前登录人
// String msgTitle = "The file " + paramsCollectManifestVO.getExportName() + " that you exported has been generated.";
// String content = "The file " + paramsCollectManifestVO.getExportName() + " that you exported has been generated, please click download.";
//
// String href = "<a href='/jero-boot/sys/common/downLoadFile?id=" + ossFile.getId() + "'" + " target='_blank'>download</a>.";
// String contentInfo = "The file " + paramsCollectManifestVO.getExportName() + " that you exported has been generated, please click " + href;
//
// SysAnnouncement sysAnnouncement = new SysAnnouncement();
// sysAnnouncement.setDelFlag("0");
// sysAnnouncement.setSendStatus("0");
// sysAnnouncement.setSendTime(new Date());
// sysAnnouncement.setMsgCategory(MessageTypeEnum.PUSH.getValue()); //消息类型:转发推送
// sysAnnouncement.setInitiator(MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName()); // 发起人:系统
// sysAnnouncement.setMsgType(CommonConstant.MSG_TYPE_UESR);//指定用户
// sysAnnouncement.setTitile(msgTitle);
// sysAnnouncement.setMsgContent(content);
// sysAnnouncement.setMsgContentInfo(contentInfo);
// sysAnnouncement.setUserIds(currentUser.getId()); // 发送给当前导出人
// sysAnnouncementService.saveAnnouncement(sysAnnouncement);
//
// JSONObject obj = new JSONObject();
// obj.put(WebsocketConst.MSG_CMD, WebsocketConst.CMD_TOPIC);
// obj.put(WebsocketConst.MSG_ID, currentUser.getId());
// obj.put(WebsocketConst.MSG_TXT, contentInfo);
// webSocket.sendMessage(obj.toJSONString());
//
// uploadFileio.close();
os.flush();
os.close(); // 后开先关
fis.close(); // 先开后关
} catch (Exception e) {
if (e instanceof JeroBootException){
throw new JeroBootException(e.getMessage());
@@ -2444,7 +2464,7 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
}
} finally {
// IOUtils.closeQuietly(os);
IOUtils.closeQuietly(os);
IOUtils.closeQuietly(excelOS);
File tempZipFile = new File(uploadpath + "/tempZip");
FileUtil.deleteContents(tempZipFile);
@@ -2870,6 +2890,9 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
String projectId = paramsCollectManifestVO.getProjectId();
String cut = paramsCollectManifestVO.getCut();
// 查询参数清单
ParamsManifestEO paramsManifestEO = paramsManifestEOService.getById(paramsManifestId);
// 查询清单的所有参数项
LambdaQueryWrapper<ParamsCollectManifestEO> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.in(ParamsCollectManifestEO::getId, paramsCollectManifestIdList);
List<ParamsCollectManifestEO> paramsCollectManifestEOList = paramsCollectManifestEOMapper.selectList(queryWrapper);
@@ -2885,7 +2908,7 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
updateEO.setDutyTerritory(dutyTerritory);
// 根据负责领域处理工程接口人(零个,一个,多个): 领域中仅有一个人时,添加该字段
ProjectRelatedPersonnel projectRelatedPersonnel = projectRelatedPersonnelService.queryByProjectIdAndDutyTerritory(projectId, dutyTerritory);
ProjectRelatedPersonnel projectRelatedPersonnel = projectRelatedPersonnelService.queryByProjectIdAndDutyTerritory(paramsManifestEO.getProjectVersionId(), dutyTerritory);
if (ObjectUtil.isNotEmpty(projectRelatedPersonnel)) {
String sdtId = projectRelatedPersonnel.getEngineeringInterfacePerson();
if (org.apache.commons.lang.StringUtils.isNotBlank(sdtId) && !sdtId.contains(",")) { // 领域中仅有一个人时,添加该字段
@@ -29,6 +29,7 @@ import com.jero.modules.cert.template.enums.ControlTypeEnum;
import com.jero.modules.cert.template.service.IParamsInfoPublishEOService;
import com.jero.modules.cert.template.service.IParamsTemplateEOService;
import com.jero.modules.project.entity.ProjectRelatedPersonnel;
import com.jero.modules.project.service.IProjectLibraryBaseService;
import com.jero.modules.project.service.IProjectRelatedPersonnelService;
import com.jero.modules.system.entity.SysUser;
import com.jero.modules.system.mapper.SysDictMapper;
@@ -93,6 +94,9 @@ public class ParamsManifestEOServiceImpl extends ServiceImpl<ParamsManifestEOMap
@Autowired
private SysDictMapper sysDictMapper;
@Autowired
private IProjectLibraryBaseService projectLibraryBaseService;
/**
@@ -117,6 +121,9 @@ public class ParamsManifestEOServiceImpl extends ServiceImpl<ParamsManifestEOMap
String paramsManifestId = UUID.randomUUID().toString().replace("-","");
// 根据主项目ID 查询 相关项目版本的项目ID
String projectVersionId = projectLibraryBaseService.getIdByVersionAndParentId(paramsManifestEO.getProjectVersion(), paramsManifestEO.getProjectId());
// 根据参数模板id发布版本查询对应参数项集合
List<ParamsInfoPublishEO> paramsInfoPublishEOList = paramsInfoPublishEOService.getListByPublishVersion(paramsManifestEO.getParamsTemplateId(),paramsManifestEO.getParamsTemplatePublishVersion());
@@ -135,7 +142,7 @@ public class ParamsManifestEOServiceImpl extends ServiceImpl<ParamsManifestEOMap
if (!ControlTypeEnum.Title.getValue().equals(source.getControlType())) {
// 根据负责领域处理工程接口人(零个,一个,多个): 领域中仅有一个人时,添加该字段
ProjectRelatedPersonnel projectRelatedPersonnel = projectRelatedPersonnelService.queryByProjectIdAndDutyTerritory(paramsManifestEO.getProjectId(), source.getDutyTerritory());
ProjectRelatedPersonnel projectRelatedPersonnel = projectRelatedPersonnelService.queryByProjectIdAndDutyTerritory(projectVersionId, source.getDutyTerritory());
if (ObjectUtil.isNotEmpty(projectRelatedPersonnel)) {
String sdtId = projectRelatedPersonnel.getEngineeringInterfacePerson();
if (StringUtils.isNotBlank(sdtId) && !sdtId.contains(",")) { // 领域中仅有一个人时,添加该字段
@@ -153,6 +160,7 @@ public class ParamsManifestEOServiceImpl extends ServiceImpl<ParamsManifestEOMap
// 对应参数模板发布版本 前端传过来
paramsManifestEO.setId(paramsManifestId);
paramsManifestEO.setProjectVersionId(projectVersionId);
paramsManifestEO.setState(ManifestStateEnum.COLLECTING.getValue());
paramsManifestEO.setVersion(1); // 默认版本为 1
Date now = new Date();
@@ -184,11 +192,15 @@ public class ParamsManifestEOServiceImpl extends ServiceImpl<ParamsManifestEOMap
}
}
// 根据主项目ID 查询 相关项目版本的项目ID
String projectVersionId = projectLibraryBaseService.getIdByVersionAndParentId(paramsManifestEO.getProjectVersion(), oldParamsManifestEO.getProjectId());
ParamsManifestEO updateEO = new ParamsManifestEO();
updateEO.setId(paramsManifestEO.getId());
updateEO.setTitle(paramsManifestEO.getTitle());
updateEO.setProjectVersion(paramsManifestEO.getProjectVersion());
updateEO.setExplanation(paramsManifestEO.getExplanation());
updateEO.setProjectVersionId(projectVersionId);
Date now = new Date();
updateEO.setUpdateTime(now);
return updateById(updateEO);
@@ -546,6 +558,9 @@ public class ParamsManifestEOServiceImpl extends ServiceImpl<ParamsManifestEOMap
}
}
// 根据主项目ID 查询 相关项目版本的项目ID
String projectVersionId = projectLibraryBaseService.getIdByVersionAndParentId(paramsManifestEO.getProjectVersion(), paramsManifestEO.getProjectId());
// 查询所有模板参数项
List<ParamsInfoPublishEO> paramsInfoPublishEOList = paramsInfoPublishEOService.getListByPublishVersion(paramsTemplateId, paramsTemplatePublishVersion);
@@ -630,7 +645,7 @@ public class ParamsManifestEOServiceImpl extends ServiceImpl<ParamsManifestEOMap
addCollectManifestEO.setParamsManifestId(addManifestId);
addCollectManifestEO.setState(CollectManifestStateEnum.WAIT_COLLECT.getValue());
// 根据负责领域处理工程接口人(零个,一个,多个): 领域中仅有一个人时,添加该字段
ProjectRelatedPersonnel projectRelatedPersonnel = projectRelatedPersonnelService.queryByProjectIdAndDutyTerritory(paramsManifestEO.getProjectId(), addCollectManifestEO.getDutyTerritory());
ProjectRelatedPersonnel projectRelatedPersonnel = projectRelatedPersonnelService.queryByProjectIdAndDutyTerritory(projectVersionId, addCollectManifestEO.getDutyTerritory());
if (ObjectUtil.isNotEmpty(projectRelatedPersonnel)) {
String sdtId = projectRelatedPersonnel.getEngineeringInterfacePerson();
if (StringUtils.isNotBlank(sdtId) && !sdtId.contains(",")) { // 领域中仅有一个人时,添加该字段
@@ -691,6 +706,12 @@ public class ParamsManifestEOServiceImpl extends ServiceImpl<ParamsManifestEOMap
List<Map<String, Object>> collectingList = new LinkedList<>();
List<Map<String, Object>> submitList = new LinkedList<>();
List<Map<String, Object>> syncReportList = new LinkedList<>();
double totalAll = 0;
double notStartTotal = 0;
double collectingTotal = 0;
double submitTotal = 0;
double syncReportTotal = 0;
// 统计清单参数
ParamsCollectManifestEO paramsCollectManifestEO = new ParamsCollectManifestEO();
@@ -725,6 +746,14 @@ public class ParamsManifestEOServiceImpl extends ServiceImpl<ParamsManifestEOMap
String submitPercent = getRatio(submitNumber, total); // 已提交的参数项 百分比
String syncReportPercent = getRatio(syncReportNumber, total); // 已同步上报库的参数项 百分比
// 累加
totalAll += total;
notStartTotal += notStartNumber;
collectingTotal += collectingNumber;
submitTotal += submitNumber;
syncReportTotal += syncReportNumber;
// 组装数据 返回前端
if (notStartNumber == collectingNumber && collectingNumber == submitNumber && submitNumber == syncReportNumber && syncReportNumber == 0) {
continue;
@@ -743,6 +772,34 @@ public class ParamsManifestEOServiceImpl extends ServiceImpl<ParamsManifestEOMap
}
// 设置全部
if (CutEnum.EN.getValue().equals(cut)) {
dutyTerritoryNameList.add(0, "All");
} else {
dutyTerritoryNameList.add(0, "全部");
}
Map<String, Object> notStartMap = new HashMap<>();
notStartMap.put("quantity", notStartTotal);
notStartMap.put("percentage", getRatio(notStartTotal, totalAll));
notStartList.add(0, notStartMap);
Map<String, Object> collectinMap = new HashMap<>();
collectinMap.put("quantity", collectingTotal);
collectinMap.put("percentage", getRatio(collectingTotal, totalAll));
collectingList.add(0, collectinMap);
Map<String, Object> submitMap = new HashMap<>();
submitMap.put("quantity", submitTotal);
submitMap.put("percentage", getRatio(submitTotal, totalAll));
submitList.add(0, submitMap);
Map<String, Object> syncReportMap = new HashMap<>();
syncReportMap.put("quantity", syncReportTotal);
syncReportMap.put("percentage", getRatio(syncReportTotal, totalAll));
syncReportList.add(0, syncReportMap);
//
result.put("dutyTerritory", dutyTerritoryNameList);
result.put("notStart", notStartList);
result.put("collecting", collectingList);
@@ -77,4 +77,7 @@ public class ParamsCollectManifestVO {
@ApiModelProperty(value = "用户类型")
private String userTypes; // 用户类型
@ApiModelProperty(value = "项目相关版本")
private String projectVersion;
}
@@ -81,21 +81,27 @@ public class DummyInventoryInfoEO implements Serializable {
/**适用地区*/
@ApiModelProperty(value = "适用地区")
@Dict(dicCode ="region")
//@Dict(dicCode ="region")
@Excel(name = "适用地区", width = 15, dicCode = "region")
private java.lang.String region;
@TableField(exist = false)
private String region_dictText;
/**适用范围*/
@Excel(name = "适用范围", width = 15, dicCode = "apply_scope")
@ApiModelProperty(value = "适用范围")
@Dict(dicCode ="apply_scope")
//@Dict(dicCode ="apply_scope")
private java.lang.String shi4Yong4Fan4Wei2;
@TableField(exist = false)
private String shi4Yong4Fan4Wei2_dictText;
/**状态*/
@Excel(name = "状态", width = 15,dicCode ="state")
@ApiModelProperty(value = "状态")
@Dict(dicCode ="state")
//@Dict(dicCode ="state")
private java.lang.String state;
@TableField(exist = false)
private String state_dictText;
/**对应标准*/
@Excel(name = "对应标准", width = 15)
@@ -107,8 +113,10 @@ public class DummyInventoryInfoEO implements Serializable {
/**实施类别*/
@Excel(name = "实施类别", width = 15,dicCode ="implement_type")
@ApiModelProperty(value = "实施类别")
@Dict(dicCode ="implement_type")
//@Dict(dicCode ="implement_type")
private java.lang.String implementType;
@TableField(exist = false)
private String implementType_dictText;
/**新车型实施日期*/
@Excel(name = "新车型实施日期", width = 15,format = "yyyy-MM-dd")
@@ -138,14 +146,18 @@ public class DummyInventoryInfoEO implements Serializable {
/**认证类型*/
@Excel(name = "认证类型", width = 15,dicCode ="attestation_type")
@ApiModelProperty(value = "认证类型")
@Dict(dicCode ="attestation_type")
//@Dict(dicCode ="attestation_type")
private java.lang.String attestationType;
@TableField(exist = false)
private String attestationType_dictText;
/**认证级别*/
@Excel(name = "认证级别", width = 15,dicCode ="attestation_rank")
@ApiModelProperty(value = "认证级别")
@Dict(dicCode ="attestation_rank")
//@Dict(dicCode ="attestation_rank")
private java.lang.String attestationRank;
@TableField(exist = false)
private String attestationRank_dictText;
/**适用增补件*/
@ApiModelProperty(value = "适用增补件")
@@ -163,8 +175,10 @@ public class DummyInventoryInfoEO implements Serializable {
/**责任领域*/
@Excel(name = "责任领域", width = 15,dicCode ="duty_territory")
@ApiModelProperty(value = "责任领域")
@Dict(dicCode ="duty_territory")
//@Dict(dicCode ="duty_territory")
private java.lang.String dutyTerritory;
@TableField(exist = false)
private String dutyTerritory_dictText;
/**备注*/
@Excel(name = "备注", width = 15)
@@ -192,14 +206,18 @@ public class DummyInventoryInfoEO implements Serializable {
/**设计符合性确认-发起人*/
@Excel(name = "设计-发起人", width = 15,dicCode ="fa1_qi3_ren2")
@ApiModelProperty(value = "设计符合性确认-发起人")
@Dict(dicCode ="fa1_qi3_ren2")
//@Dict(dicCode ="fa1_qi3_ren2")
private java.lang.String designInitiator;
@TableField(exist = false)
private String designInitiator_dictText;
/**设计符合性确认-责任人*/
@Excel(name = "设计-责任人", width = 15,dicCode ="ze2_ren4_ren2")
@ApiModelProperty(value = "设计符合性确认-责任人")
@Dict(dicCode ="ze2_ren4_ren2")
//@Dict(dicCode ="ze2_ren4_ren2")
private java.lang.String designDuty;
@TableField(exist = false)
private String designDuty_dictText;
//交付物说明
@Excel(name = "设计符合性确认-交付物说明", width = 20)
@@ -226,14 +244,18 @@ public class DummyInventoryInfoEO implements Serializable {
/**prehomo确认-发起人*/
@Excel(name = "Prehomo-发起人", width = 15,dicCode ="fa1_qi3_ren2")
@ApiModelProperty(value = "prehomo确认-发起人")
@Dict(dicCode ="fa1_qi3_ren2")
//@Dict(dicCode ="fa1_qi3_ren2")
private java.lang.String prehomoInitiator;
@TableField(exist = false)
private String prehomoInitiator_dictText;
/**prehomo确认-责任人*/
@Excel(name = "Prehomo-责任人", width = 15,dicCode ="ze2_ren4_ren2")
@ApiModelProperty(value = "prehomo确认-责任人")
@Dict(dicCode ="ze2_ren4_ren2")
//@Dict(dicCode ="ze2_ren4_ren2")
private java.lang.String prehomoDuty;
@TableField(exist = false)
private String prehomoDuty_dictText;
//prehomo确认-交付物说明
@Excel(name = "prehomo确认-交付物说明", width = 20)
@@ -259,14 +281,18 @@ public class DummyInventoryInfoEO implements Serializable {
/**验证符合性确认-发起人*/
@Excel(name = "验证-发起人", width = 15,dicCode ="fa1_qi3_ren2")
@ApiModelProperty(value = "验证符合性确认-发起人")
@Dict(dicCode ="fa1_qi3_ren2")
//@Dict(dicCode ="fa1_qi3_ren2")
private java.lang.String verifyInitiator;
@TableField(exist = false)
private String verifyInitiator_dictText;
/**验证符合性确认-责任人*/
@Excel(name = "验证-责任人", width = 15,dicCode ="ze2_ren4_ren2")
@ApiModelProperty(value = "验证符合性确认-责任人")
@Dict(dicCode ="ze2_ren4_ren2")
//@Dict(dicCode ="ze2_ren4_ren2")
private java.lang.String verifyDuty;
@TableField(exist = false)
private String verifyDuty_dictText;
//验证备注
@Excel(name = "验证符合性确认-交付物说明", width = 20)
@@ -35,6 +35,7 @@ public enum DummyInventoryBaseFieldEnum {
VERIFY_DELIVERABLE_TEMPLATE("验证符合性确认-交付物模板", "verify_deliverable_template","Deliverable template"),
VERIFY_INITIATOR("验证符合性确认-发起人", "fa1_qi3_ren2","Initiator"),
VERIFY_DUTY("验证符合性确认-责任人", "ze2_ren4_ren2","Assignee"),
STATE("状态", "state","state"),
;
@@ -71,4 +72,4 @@ public enum DummyInventoryBaseFieldEnum {
public void setEnName(String enName) {
this.enName = enName;
}
}
}
@@ -34,6 +34,7 @@ import com.jero.modules.system.mapper.SysCategoryMapper;
import com.jero.modules.system.service.impl.SysCategoryServiceImpl;
import com.jero.modules.system.service.impl.SysDictItemServiceImpl;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang3.ObjectUtils;
@@ -72,6 +73,7 @@ import static com.jero.modules.document.service.impl.BussDocumentLibraryEOServic
* @Date: 2022-04-11
* @Version: V1.0
*/
@Slf4j
@Service
public class DummyInventoryInfoEOServiceImpl extends ServiceImpl<DummyInventoryInfoEOMapper, DummyInventoryInfoEO> implements IDummyInventoryInfoEOService {
@@ -329,16 +331,171 @@ public class DummyInventoryInfoEOServiceImpl extends ServiceImpl<DummyInventoryI
*/
@Override
public List<DummyInventoryInfoEO> queryList(DummyInventoryInfoEO dummyInventoryInfoEO,HttpServletRequest req) {
long startTime = System.currentTimeMillis();
QueryWrapper<DummyInventoryInfoEO> queryWrapper = QueryGenerator.initQueryWrapper(dummyInventoryInfoEO,req.getParameterMap());
// queryWrapper.in("dummy_inventory_base_id",dummyInventoryInfoEO.getDummyInventoryBaseId());
queryWrapper.orderByDesc("create_time","serial_number");
List<DummyInventoryInfoEO> dummyInventoryInfoEOList = this.list(queryWrapper);
log.info("一阶段消耗时间:" + (System.currentTimeMillis() - startTime));
//技术领域处理
treeDict(dummyInventoryInfoEO, dummyInventoryInfoEOList);
log.info("二阶段消耗时间:" + (System.currentTimeMillis() - startTime));
this.dataDicDispose(dummyInventoryInfoEOList,dummyInventoryInfoEO.getCut());
log.info("三阶段消耗时间:" + (System.currentTimeMillis() - startTime));
return dummyInventoryInfoEOList;
}
/**
* 数据字典数据处理方法 -> 虚拟清单使用@Dict翻译效率太慢了,200条数据需要处理1分钟。
* @param datas
* @param cut
*/
public void dataDicDispose(List<DummyInventoryInfoEO> datas, String cut){
if(CollectionUtils.isNotEmpty(datas)){
List<SysDictItem> sysDictItems = this.sysDictItemServiceImpl.getBaseMapper().selectItemsAll();
for (DummyInventoryInfoEO data : datas) {
// 适用地区
String region = data.getRegion();
if(StringUtils.isNotEmpty(region)){
String region_dictText = this.disposeShowDictItemValue(sysDictItems, region,cut, DummyInventoryBaseFieldEnum.REGION.getValue());
data.setRegion_dictText(region_dictText);
}
// 适用范围
String shi4Yong4Fan4Wei2 = data.getShi4Yong4Fan4Wei2();
if(StringUtils.isNotEmpty(shi4Yong4Fan4Wei2)){
String shi4Yong4Fan4Wei2_dictText = this.disposeShowDictItemValue(sysDictItems, shi4Yong4Fan4Wei2,cut, DummyInventoryBaseFieldEnum.SHI4_YONG4_FAN4_WEI2.getValue());
data.setShi4Yong4Fan4Wei2_dictText(shi4Yong4Fan4Wei2_dictText);
}
// 状态
String state = data.getState();
if(StringUtils.isNotEmpty(state)){
String state_dictText = this.disposeShowDictItemValue(sysDictItems, state,cut, DummyInventoryBaseFieldEnum.STATE.getValue());
data.setState_dictText(state_dictText);
}
// 实施类别
String implementType = data.getImplementType();
if(StringUtils.isNotEmpty(implementType)){
String implementType_dictText = this.disposeShowDictItemValue(sysDictItems, implementType,cut, DummyInventoryBaseFieldEnum.IMPLEMENT_TYPE.getValue());
data.setImplementType_dictText(implementType_dictText);
}
// 认证类别
String attestationType = data.getAttestationType();
if(StringUtils.isNotEmpty(attestationType)){
String attestationType_dictText = this.disposeShowDictItemValue(sysDictItems, attestationType,cut, DummyInventoryBaseFieldEnum.ATTESTATION_TYPE.getValue());
data.setAttestationType_dictText(attestationType_dictText);
}
// 认证级别
String attestationRank = data.getAttestationRank();
if(StringUtils.isNotEmpty(attestationRank)){
String attestationRank_dictText = this.disposeShowDictItemValue(sysDictItems, attestationRank,cut, DummyInventoryBaseFieldEnum.ATTESTATION_RANK.getValue());
data.setAttestationRank_dictText(attestationRank_dictText);
}
// 责任领域
String dutyTerritory = data.getDutyTerritory();
if(StringUtils.isNotEmpty(dutyTerritory)){
String dutyTerritory_dictText = this.disposeShowDictItemValue(sysDictItems, dutyTerritory,cut, DummyInventoryBaseFieldEnum.DUTY_TERRITORY.getValue());
data.setDutyTerritory_dictText(dutyTerritory_dictText);
}
// 设计符合性-发起人
String designInitiator = data.getDesignInitiator();
if(StringUtils.isNotEmpty(designInitiator)){
String designInitiator_dictText = this.disposeShowDictItemValue(sysDictItems, designInitiator,cut, DummyInventoryBaseFieldEnum.DESIGN_INITIATOR.getValue());
data.setDesignInitiator_dictText(designInitiator_dictText);
}
// 设计符合性-责任人
String designDuty = data.getDesignDuty();
if(StringUtils.isNotEmpty(designDuty)){
String designDuty_dictText = this.disposeShowDictItemValue(sysDictItems, designDuty,cut, DummyInventoryBaseFieldEnum.DESIGN_DUTY.getValue());
data.setDesignDuty_dictText(designDuty_dictText);
}
// preHomo-发起人
String prehomoInitiator = data.getPrehomoInitiator();
if(StringUtils.isNotEmpty(prehomoInitiator)){
String prehomoInitiator_dictText = this.disposeShowDictItemValue(sysDictItems, prehomoInitiator,cut, DummyInventoryBaseFieldEnum.PREHOMO_INITIATOR.getValue());
data.setPrehomoInitiator_dictText(prehomoInitiator_dictText);
}
// preHomo-责任人
String prehomoDuty = data.getPrehomoDuty();
if(StringUtils.isNotEmpty(prehomoDuty)){
String prehomoDuty_dictText = this.disposeShowDictItemValue(sysDictItems, prehomoDuty,cut, DummyInventoryBaseFieldEnum.PREHOMO_DUTY.getValue());
data.setPrehomoDuty_dictText(prehomoDuty_dictText);
}
// 验证符合性-发起人
String verifyInitiator = data.getVerifyInitiator();
if(StringUtils.isNotEmpty(verifyInitiator)){
String verifyInitiator_dictText = this.disposeShowDictItemValue(sysDictItems, verifyInitiator,cut, DummyInventoryBaseFieldEnum.VERIFY_INITIATOR.getValue());
data.setVerifyInitiator_dictText(verifyInitiator_dictText);
}
// 验证符合性-责任人
String verifyDuty = data.getVerifyDuty();
if(StringUtils.isNotEmpty(verifyDuty)){
String verifyDuty_dictText = this.disposeShowDictItemValue(sysDictItems, verifyDuty,cut, DummyInventoryBaseFieldEnum.VERIFY_DUTY.getValue());
data.setVerifyDuty_dictText(verifyDuty_dictText);
}
}
}
}
/**
* 处理展示数据字典值
* @param sysDictItems 所有的数据字典项
* @param fieldValues 字段值
* @param cut 中英文切换标识
* @param dicCode 数据字典code码
* @return
*/
public String disposeShowDictItemValue(List<SysDictItem> sysDictItems,String fieldValues,String cut,String dicCode){
String result = "";
List<SysDictItem> sysDictItemList = sysDictItems.stream().filter(e -> {
boolean flag = false;
if(StringUtils.equals(e.getDictCode(),dicCode)){
flag = true;
}
return flag;
}).distinct().collect(Collectors.toList());
if(CollectionUtils.isNotEmpty(sysDictItemList)){
if(StringUtils.equals(cut,CutEnum.CN.getValue())){
result = sysDictItemList.stream().filter(e -> {
boolean flag = false;
List<String> fieldValueStrList = Arrays.asList(fieldValues.split(","));
for (String fieldValueStr : fieldValueStrList) {
if(StringUtils.equals(fieldValueStr,e.getItemValue())){
flag = true;
break;
}
}
return flag;
}).map(SysDictItem::getItemText).collect(Collectors.joining(","));
}else if(StringUtils.equals(cut,CutEnum.EN.getValue())){
result = sysDictItemList.stream().filter(e -> {
boolean flag = false;
List<String> fieldValueStrList = Arrays.asList(fieldValues.split(","));
for (String fieldValueStr : fieldValueStrList) {
if(StringUtils.equals(fieldValueStr,e.getItemValue())){
flag = true;
break;
}
}
return flag;
}).map(SysDictItem::getEnName).collect(Collectors.joining(","));
}
}
return result;
}
/**
* 复制
@@ -124,4 +124,19 @@ public interface IProjectLibraryBaseService extends IService<ProjectLibraryBase>
* @return
*/
List<ProjectLibraryBase> versionStatistics(String id);
/**
* 通过主项目id和子项目版本号
* @param version
* @param parentId
* @return
*/
String getIdByVersionAndParentId(String version, String parentId);
/**
* 查询主项目及其所有子项目
* @param parentId
* @return
*/
List<ProjectLibraryBase> getParentAndChildern(String parentId);
}
@@ -1316,6 +1316,38 @@ public class ProjectLibraryBaseServiceImpl extends ServiceImpl<ProjectLibraryBas
}
return list;
}
/**
* 通过主项目id和子项目版本号
* @param version
* @param parentId
* @return
*/
@Override
public String getIdByVersionAndParentId(String version, String parentId) {
if ("00".equals(version)) {
return parentId;
}
LambdaQueryWrapper<ProjectLibraryBase> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(ProjectLibraryBase::getProjectVersion,version);
wrapper.eq(ProjectLibraryBase::getParentId, parentId);
List<ProjectLibraryBase> list = this.list(wrapper);
if (CollectionUtils.isNotEmpty(list)) {
return list.get(0).getId();
} else {
return null;
}
}
@Override
public List<ProjectLibraryBase> getParentAndChildern(String parentId) {
LambdaQueryWrapper<ProjectLibraryBase> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(ProjectLibraryBase::getId,parentId);
wrapper.or().eq(ProjectLibraryBase::getParentId, parentId);
List<ProjectLibraryBase> list = this.list(wrapper);
return list;
}
}
@@ -0,0 +1,106 @@
package com.jero.modules.todoCenter.job;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.jero.modules.project.entity.ProjectLawsInventoryEO;
import com.jero.modules.project.service.IProjectLawsInventoryEOService;
import com.jero.modules.todoCenter.entity.ProcessInfoEO;
import com.jero.modules.todoCenter.service.IProcessInfoEOService;
import com.jero.modules.wkflow.enums.FlowTypeEnum;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
/**
* 同步符合性流程截止时间定时器
* @Author: wzj
* @Date: 2022/11/24 13:48
**/
@Slf4j
public class SyncComplianceProcessEndTimeJob implements Job {
@Autowired
private IProjectLawsInventoryEOService projectLawsInventoryEOService;
@Autowired
private IProcessInfoEOService processInfoEOService;
@Override
public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
log.info("同步符合性流程截止时间,定时任务开启 =====================================================");
QueryWrapper<ProcessInfoEO> processInfoQueryWrap = new QueryWrapper<>();
List<String> flowTypeList = new ArrayList<>();
flowTypeList.add(FlowTypeEnum.SJFHXSHLC.getValue());
flowTypeList.add(FlowTypeEnum.PREHOMOQRLC.getValue());
flowTypeList.add(FlowTypeEnum.YZFHXSCLC.getValue());
processInfoQueryWrap.lambda().in(ProcessInfoEO::getFlowType,flowTypeList);
List<ProcessInfoEO> processInfoEOList = this.processInfoEOService.list(processInfoQueryWrap);
if (CollectionUtils.isNotEmpty(processInfoEOList)) {
List<String> lawsInventoryIdList = processInfoEOList.stream().map(ProcessInfoEO::getProjectLawsInventoryId).distinct().collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(lawsInventoryIdList)) {
QueryWrapper<ProjectLawsInventoryEO> lawsInventoryQueryWrap = new QueryWrapper<>();
lawsInventoryQueryWrap.lambda().in(ProjectLawsInventoryEO::getId,lawsInventoryIdList);
List<ProjectLawsInventoryEO> lawsInventoryEOList = this.projectLawsInventoryEOService.list(lawsInventoryQueryWrap);
if (CollectionUtils.isNotEmpty(lawsInventoryEOList)) {
processInfoEOList.forEach(processInfo -> {
this.setProcessInfoEndTime(lawsInventoryEOList, processInfo);
});
this.processInfoEOService.updateBatchById(processInfoEOList);
}
}
}
log.info("同步符合性流程截止时间,定时任务结束 =====================================================");
}
/**
* 设置流程信息的截止时间
* @param lawsInventoryEOList
* @param processInfoEO
*/
private void setProcessInfoEndTime(List<ProjectLawsInventoryEO> lawsInventoryEOList, ProcessInfoEO processInfoEO) {
for (ProjectLawsInventoryEO projectLawsInventoryEO : lawsInventoryEOList) {
if(StringUtils.equals(processInfoEO.getProjectLawsInventoryId(),projectLawsInventoryEO.getId())){
String flowType = processInfoEO.getFlowType();
// 停止循环标识
boolean stopCycle = false;
FlowTypeEnum flowTypeEnumByValue = FlowTypeEnum.getFlowTypeEnumByValue(flowType);
switch (flowTypeEnumByValue){
case SJFHXSHLC:
if(projectLawsInventoryEO.getDesignDueDate() != null){
processInfoEO.setEndTime(projectLawsInventoryEO.getDesignDueDate());
stopCycle = true;
}
break;
case PREHOMOQRLC:
if(projectLawsInventoryEO.getPrehomoDueDate() != null){
processInfoEO.setEndTime(projectLawsInventoryEO.getPrehomoDueDate());
stopCycle = true;
}
break;
case YZFHXSCLC:
if(projectLawsInventoryEO.getVerifyDueDate() != null){
processInfoEO.setEndTime(projectLawsInventoryEO.getVerifyDueDate());
stopCycle = true;
}
break;
}
// 匹配到一个之后将本次循环终止
if (stopCycle) {
break;
}
}
}
}
}
@@ -74,4 +74,19 @@ public enum FlowTypeEnum {
}
return null;
}
/**
* 根据value获取枚举对象
* @param value
* @return
*/
public static FlowTypeEnum getFlowTypeEnumByValue(String value) {
FlowTypeEnum[] flowTypeEnumArr = FlowTypeEnum.values();
for (FlowTypeEnum flowTypeEnum : flowTypeEnumArr) {
if(StringUtils.equals(value,flowTypeEnum.getValue())){
return flowTypeEnum;
}
}
return null;
}
}
@@ -450,6 +450,7 @@
this.getquerySdtId = record.id
getAction(this.url.getquerySdtList, {
projectId: this.$route.query.projectId,
projectVersion:this.$route.query.projectVersion,
dutyTerritory: record.dutyTerritory
}).then((res) => {
if (res.success) {
@@ -710,13 +710,13 @@
/*max-width: 198px;*/
height: 32px;
display: inline-block;
text-align: center;
text-align: left;
line-height: 32px;
/*background: #EFF1F3;*/
border-radius: 4px;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
/*text-overflow: ellipsis;*/
/*white-space: nowrap;*/
/*overflow: hidden;*/
font-size: 14px;
font-weight: 400;
color: #040B29;
@@ -1,145 +1,217 @@
<template>
<div class="box">
<div class="collection-search-wrapper">
<div class="collection-search-header">
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :md="6" :sm="8">
<div class="box-title-text">
<div class="title-text" :title="$t('title')">
<span>{{$t('title')}}</span>
</div>
<j-input class="box-input" :placeholder="$t('PleaseEnter')+$t('title')"
v-model="queryParams.title"></j-input>
</div>
</a-col>
<span style="float: right;overflow: hidden;margin-right: 11px"
class="table-page-search-submitButtons">
<a-col :md="6" :sm="24">
<a-button class="box-button" type="primary" @click="searchQuery">{{$t('query')}}</a-button>
<a-button class="box-button" style="margin-left: 8px" @click="searchReset">{{$t('reset')}}</a-button>
</a-col>
</span>
</a-row>
</a-form>
<div>
<div class="search-detail-wrap">
<div class="box-content-left">
<div class="classification">{{$t('classification')}}:</div>
<template v-for="tag in tagList">
<a-checkable-tag
:key="tag.id"
:title="tag.problemLabel"
:checked="selectedTags.indexOf(tag.id) > -1"
@change="checked => handleChange(tag.id, checked)"
>
{{ tag.problemLabel }}
</a-checkable-tag>
</template>
</div>
<a-form layout="inline" @keyup.enter.native="onSearch">
<div class="box-title-text">
<!-- <div class="title-text" :title="$t('searchContent')">-->
<!-- <span>{{$t('searchContent')}}</span>-->
<!-- </div>-->
<a-input-search class="box-input" :placeholder="$t('PleaseEnter')+$t('searchContent')"
allowClear
@search="onSearch"
v-model="searchStr"></a-input-search>
</div>
</div>
</a-form>
</div>
<div class="table-operator">
<div class="operator-text" @click="handleBatCancel">
<a-icon type="delete"/>
{{ $t('BatchCancel') }}
</div>
</div>
<div class="box-content">
<a-checkbox-group style="width: 100%" :defaultChecked="checkboxText"
@change="checkboxTextChange" v-model="checkboxText">
<div v-for="item in conList" :key="item.collectEO.id">
<div style="margin-bottom: 10px;position: relative">
<a-checkbox :value="item.collectEO.id" class="checkbox-left"></a-checkbox>
<div class="text-text-right"
@click="checkedClick(item)"
:class="{ 'null-input':item.checked }">
<div class="text-header">
<a-tooltip placement="topLeft" overlayClassName="tooltip-index" :mouseEnterDelay="0.5">
<template slot="title">
<span v-html="item.title"></span>
</template>
<div class="text-header-text" style="cursor: pointer" v-html="item.title">
</div>
</a-tooltip>
</div>
<!-- <a-tooltip placement="topLeft" overlayClassName="tooltip-index" :mouseEnterDelay="0.5">-->
<!-- <template slot="title">-->
<!-- <span v-html="item.content"></span>-->
<!-- </template>-->
<div class="text-content" v-html="item.content"
>
</div>
<!-- </a-tooltip>-->
<div v-if="isTrue">
<div v-if="conList.length > 0" style="margin-top: 16px;height: calc(100vh - 260px);overflow:auto;">
<div class="content-box" v-for="(item,index) in conList" :key="index">
<div class="content-box-top" @click="detailClcik(item)">
<span class="content-box-top-text">
{{ item.title }}
</span>
<span class="content-box-top-color"
v-if="item.problemTypeNameList && item.problemTypeNameList.length > 0"
:title="val"
v-for="val in item.problemTypeNameList">
{{val}}
</span>
</div>
<div class="content-box-content">
<div class="content-box-content-top" @click="detailClcik(item)"
v-html="item.contentOne">
</div>
<div @click="CancelCollectionClick(item)"
:title="$t('CancelCollection')"
class="text-text-right-text">{{$t('CancelCollection')}}
<div class="content-box-content-botton">
<div class="content-box-content-botton-text"
v-if="item.accessoryFileNameList && item.accessoryFileNameList.length > 0"
:title="val.fileName"
v-for="val in item.accessoryFileNameList">
<span @click="fileClick(val)">{{val.fileName}}</span>
</div>
</div>
</div>
<div class="content-box-xian" @click="detailClcik(item)"></div>
<div class="content-box-button">
<div class="content-box-button-left" @click="detailClcik(item)">
<div class="content-box-button-text">
<a-icon type="user"/>
{{item.createBy}}
</div>
<div class="content-box-button-text" v-if="item.standNumber">
<a-icon type="audit"/>
{{item.standNumber}}
</div>
<div class="content-box-button-text" v-if="item.targetMarket_dicText">
<img src="../../../../assets/ditu.png" style="width: 15px;margin-top: -3px" alt="">
{{item.targetMarket_dicText}}
</div>
<div class="content-box-button-text" v-if="item.showPermissions_dicText">
<a-icon type="eye"/>
{{item.showPermissions_dicText}}
</div>
<div class="content-box-button-text">
<a-icon type="history"/>
{{item.createTime}}
</div>
</div>
<div class="content-box-button-right">
<div class="content-box-button-text">
<a-icon type="clock-circle" />
{{item.collectEO.createTime}}
</div>
<div class="content-box-button-text"
:class="{'icon-active':item.collectEO && item.collectEO.collectStatus == 'Collect' ? true : false}"
@click="cancelCollection(item)">
<a-icon class="icon" type="star"/>
{{$t('CancelCollection')}}
</div>
</div>
</div>
</div>
</a-checkbox-group>
</div>
<div class="page" v-if="conList && conList.length > 0">
<a-pagination
:show-total="total => $t('total')+` ${total} `+$t('strip')"
show-quick-jumper
show-size-changer
:page-size.sync="pageSize"
:total="total"
:current="pageNo"
@change="pageOnChange"
@showSizeChange="SizeChange"
/>
</div>
<div class="noData" v-else>
{{$t('noData')}}
</div>
<div class="page" v-if="conList.length > 0">
<a-pagination
:show-total="total => $t('total')+` ${total} `+$t('strip')"
show-quick-jumper
show-size-changer
:page-size.sync="pageSize"
:total="total"
:current="pageNo"
@change="pageOnChange"
@showSizeChange="SizeChange"
/>
</div>
</div>
<problemKnowledgeBaseListView ref="problemKnowledgeBaseListViewRef"
@problemKnowledgeBase="problemKnowledgeBase" v-else/>
<JLoading :loading="loading">{{$t('dataLoading')}}</JLoading>
</div>
</template>
<script>
import { getAction, postAction, deleteAction, putAction } from '@/api/manage'
import problemKnowledgeBaseListView from './problemKnowledgeBaseListView'
import { mapGetters } from 'vuex'
import { Base64 } from 'js-base64'
export default {
name: 'problemKnowledgeBaseList',
components: {
problemKnowledgeBaseListView
},
data() {
return {
conList: [],
total: 0,
searchStr:'',
pageSize: 10,
pageNo: 1,
tagList:[],
isTrue: true,
checkboxText: [],
checkboxList: [],
selectedTags: [],
loading: false,
queryParams: {},
url: {
getInfoList: '/problemKnowledgeBase/problemKnowledgeBaseCollectEO/queryCollectPageList',
deleteBatch: '/problemKnowledgeBase/problemKnowledgeBaseCollectEO/deleteBatch'
}
},
downLoadFileUrl: window._CONFIG['domianPreviewURL'] + '/sys/common/download',
downLoadImgUrl: window._CONFIG['domianWebImgURL'] + '/sys/common/download'
}
},
mounted() {
this.getList()
this.replacePage()
},
watch: {
checkboxText: function(value) {
this.conList.forEach(val => {
val.checked = false
})
if (value.length > 0) {
this.conList.forEach(val => {
value.forEach(res => {
if (res === val.collectEO.id) {
val.checked = true
}
})
})
}
this.conList = [...this.conList]
}
},
watch: {},
methods: {
...mapGetters(['userInfo']),
searchQuery() {
replacePage() {
getAction('/problemKnowledgeBase/problemKnowledgeBaseClassifyEO/list', {}).then((res) => {
if (res.success) {
this.tagList = res.result
} else {
this.tagList = []
}
})
},
onSearch() {
this.isTrue = true
this.pageNo = 1
this.getList()
},
checkboxTextChange(value) {
this.checkboxText = JSON.parse(JSON.stringify(value))
if (this.checkboxList && this.checkboxList.length > 0) {
this.checkboxList.forEach(res => {
this.checkboxText.push(res)
})
handleChange(tag, checked) {
const { selectedTags } = this
const nextSelectedTags = checked
? [...selectedTags, tag]
: selectedTags.filter(t => t !== tag)
this.selectedTags = nextSelectedTags
this.isTrue = true
this.getList()
},
detailClcik(val) {
this.isTrue = false
this.$nextTick(() => {
this.$refs.problemKnowledgeBaseListViewRef.getData(JSON.parse(JSON.stringify(val)))
})
},
fileClick(fileQuery) {
let fileName = fileQuery.fileName
let index1 = fileName.lastIndexOf('.')
let index2 = fileName.length
let fileSuffix = fileName.substring(index1, index2)
if (fileSuffix == '.pdf') {
window.open('/pdf/web/viewer.html?file=' + encodeURIComponent('/jero-boot/sys/common/pdf/viewFile?id=' + fileQuery.id + '&userName=' + this.userInfo().username))
} else if (fileSuffix == '.docx' || fileSuffix == '.doc') {
let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + fileQuery.id + fileSuffix)
window.open(url, '_blank')
} else if (fileSuffix == '.xlsx' || fileSuffix == '.xls') {
let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + fileQuery.id + fileSuffix)
window.open(url, '_blank')
} else if (fileSuffix == '.png' || fileSuffix == '.jpeg' || fileSuffix == '.gif' || fileSuffix == '.jpg') {
let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadImgUrl + '/' + fileQuery.id + fileSuffix)
window.open(url, '_blank')
} else {
downloadFile('/sys/common/downLoadFile', fileQuery.fileName, { id: fileQuery.id })
}
},
problemKnowledgeBase() {
this.pageNo = 1
this.isTrue = true
this.getList()
},
searchQuery() {
this.pageNo = 1
this.getList()
},
searchReset() {
this.pageNo = 1
this.queryParams = {}
@@ -178,7 +250,7 @@
this.$message.warning(this.$t('selectLeastOne'))
}
},
CancelCollectionClick(val) {
cancelCollection(val) {
let _this = this
this.$confirm({
content: _this.$t('confirmCancelCollection'),
@@ -209,11 +281,13 @@
return words
},
getList() {
let selectedTags = JSON.parse(JSON.stringify(this.selectedTags))
let query = {
pageNo: this.pageNo,
pageSize: this.pageSize,
createBy: this.userInfo().username,
...this.queryParams
searchStr: this.searchStr,
problemTypes: selectedTags.join(','),
}
this.loading = true
getAction(this.url.getInfoList, query).then((res) => {
@@ -253,29 +327,26 @@
}
</script>
<style>
.checkbox-left .ant-checkbox-inner {
width: 18px !important;
height: 18px !important;
line-height: 18px !important;
<style scoped lang="less">
.search-detail-wrap {
width: 100%;
overflow: hidden;
/*margin: 0 auto;*/
}
.tooltip-index {
max-width: calc(100% - 300px) !important;
}
</style>
<style lang="less" scoped>
@import '~@assets/less/common.less';
.box-title-text {
line-height: 1.4;
width: 360px;
float: right;
display: flex;
align-items: center;
margin-bottom: 10px;
text-align: center;
justify-content: center;
}
.title-text {
width: 43px;
width: 110px;
color: #000F16;
display: inline-block;
font-weight: 500;
@@ -289,15 +360,88 @@
}
.box-input {
/*min-width: 200px;*/
display: inline-block;
width: 100%;
height: 38px;
margin-right: 16px;
}
.box-button {
height: 38px;
}
.box-content-left {
width: calc(100% - 400px);
float: left;
font-size: 14px;
font-weight: 400;
color: #040B29;
margin-right: 10px;
}
.box-content-content {
float: left;
width: 150px;
text-align: center;
}
.box-content-content-index {
width: 108px;
height: 40px;
background: rgba(0, 179, 190, 0.06);
border: 1px solid #00BEBE;
border-radius: 4px;
text-align: center;
font-size: 14px;
color: #00B3BE;
line-height: 40px;
cursor: pointer;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
padding: 0 6px;
}
.classification {
display: inline-block;
font-size: 14px;
color: #000F16;
margin-right: 10px;
overflow: hidden;
margin-bottom: 7px;
}
.box-content-right {
width: 100%;
display: inline-block;
text-align: right;
margin-top: 20px;
}
.operator-text-text-index {
cursor: pointer;
margin-right: 53px;
font-size: 14px;
font-weight: 400;
color: #040B29;
display: inline-block;
}
.operator-text-text-index:last-child {
margin-right: 13px;
}
.box-content-left-text {
margin-right: 30px;
cursor: pointer;
}
.box {
padding: 0 0 0 18px;
box-sizing: border-box;
}
.checkbox-left {
float: left;
position: absolute;
@@ -307,50 +451,45 @@
}
.text-text-right {
width: calc(100% - 152px);
display: inline-block;
padding: 19px 28px;
padding: 19px 20px;
box-sizing: border-box;
margin-left: 38px;
cursor: pointer;
}
.text-text-right-text {
width: 110px;
display: inline-block;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
word-break: break-word;
text-align: center;
padding: 0 6px;
box-sizing: border-box;
position: absolute;
right: 0;
top: 50%;
transform: translateY(-50%);
color: #00B3BE;
cursor: pointer;
/*margin-left: 38px;*/
}
.null-input {
background-color: #F2F4F8;
}
.search-text-title {
margin-bottom: 22px;
}
.text-header {
margin-bottom: 11px;
width: 100%;
.text-header-text {
margin-right: 52px;
font-size: 16px;
font-weight: bold;
color: #040B29;
width: 100%;
display: inline-block;
max-width: calc(100% - 180px);
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
word-break: break-word;
}
/*span {*/
/* margin-right: 52px;*/
/* font-size: 16px;*/
/* font-weight: bold;*/
/* color: #040B29;*/
/* display: inline-block;*/
/* max-width: 500px;*/
/* text-overflow: ellipsis;*/
/* white-space: nowrap;*/
/* overflow: hidden;*/
/*}*/
}
.text-content {
@@ -366,12 +505,7 @@
-webkit-line-clamp: 4;
/*! autoprefixer: on;*/
text-justify: inter-ideograph;
word-break: break-all
}
.box-content {
padding: 0 0 0 8px;
box-sizing: border-box;
word-break: break-all;
}
.page {
@@ -379,20 +513,17 @@
margin-top: 20px;
}
.text-operation {
margin-right: 8px;
}
.submitButtons {
text-align: center;
}
.fileText {
.noData {
width: 100%;
cursor: pointer;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
text-align: center;
line-height: 10;
}
::v-deep .ant-tag-checkable:not(.ant-tag-checkable-checked):hover {
background: #00B3BE;
border: 1px solid #00BEBE;
color: #fff;
}
::v-deep p {
@@ -400,21 +531,217 @@
padding: 0;
}
.selectText {
::v-deep .ant-input {
height: 40px;
}
.content-box {
width: 100%;
height: auto;
padding: 24px 24px 16px 24px;
box-sizing: border-box;
border: 1px solid #E6E6E9;
border-radius: 4px;
position: relative;
margin-bottom: 20px;
.content-box-top {
width: 100%;
height: auto;
.content-box-top-text {
font-size: 16px;
font-weight: bold;
color: #040B29;
cursor: pointer;
overflow: hidden;
display: inline-block;
}
.content-box-top-color {
font-size: 12px;
cursor: pointer;
font-weight: 400;
color: #00BEBE;
padding: 0 10px;
box-sizing: border-box;
display: inline-block;
height: 22px;
line-height: 22px;
background: #DBF2F3;
border-radius: 3px;
margin-left: 6px;
max-width: 140px;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
}
}
.content-box-content {
width: 100%;
height: auto;
margin-top: 16px;
margin-bottom: 10px;
.content-box-content-top {
font-size: 14px;
font-weight: 400;
color: #040B29;
display: -webkit-box;
text-overflow: ellipsis;
/*! autoprefixer: off */
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
/*! autoprefixer: on;*/
text-justify: inter-ideograph;
word-break: break-all;
overflow: hidden;
}
.content-box-content-botton {
width: 100%;
margin-top: 10px;
.content-box-content-botton-text {
/*max-width: 198px;*/
height: 32px;
display: inline-block;
text-align: left;
line-height: 32px;
/*background: #EFF1F3;*/
border-radius: 4px;
/*text-overflow: ellipsis;*/
/*white-space: nowrap;*/
/*word-break: break-all;*/
/*overflow: hidden;*/
font-size: 14px;
font-weight: 400;
color: #040B29;
margin-right: 20px;
cursor: pointer;
text-decoration: underline;
}
}
}
.content-box-xian {
width: 100%;
position: absolute;
border-bottom: 1px #EFF1F3 solid;
left: 0;
/*margin-top: 10px;*/
}
.content-box-button {
width: 100%;
margin-top: 26px;
overflow: hidden;
.content-box-button-left {
width: 50%;
float: left;
.content-box-button-text {
display: inline-block;
margin-right: 30px;
font-size: 14px;
font-weight: 400;
color: #6F7385;
word-break: break-all;
}
}
.content-box-button-right {
width: 50%;
float: left;
text-align: right;
.content-box-button-text {
display: inline-block;
margin-left: 30px;
font-size: 14px;
font-weight: 400;
color: #040B29;
cursor: pointer;
}
}
}
}
.box-title-text-index {
line-height: 1.4;
display: flex;
/*align-items: center;*/
}
.title-text-index {
width: 88px;
text-align: right;
display: inline-block;
font-weight: 500;
font-size: 14px;
margin-right: 16px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
height: 42px;
line-height: 48px;
color: #000F16;
}
.box-input-index {
display: inline-block;
height: 38px;
width: 100%;
}
.itemModel {
width: 100%;
display: inline-block;
margin-bottom: 12px;
}
.Required {
color: red;
margin-right: 4px;
}
.icon-active {
color: #00B3BE !important;
}
.text {
min-width: 16px;
text-align: left;
display: inline-block;
margin-left: 3px;
}
</style>
<style>
.box-content-left .ant-tag {
font-size: 14px;
font-weight: 400;
color: #040B29;
}
.box-content-left .ant-tag-checkable {
padding: 9px 10px;
display: inline-block;
box-sizing: border-box;
background: #fff;
background: rgba(4, 11, 41, 0.06);
color: #363C54;
max-width: 280px;
overflow: hidden;
word-break: break-word;
white-space: nowrap;
text-overflow: ellipsis;
word-break: break-all;
}
::v-deep .ant-select-selection--single {
height: 32px !important;
}
::v-deep .ant-select-selection__rendered {
height: 32px !important;
line-height: 32px !important;
.box-content-left .ant-tag-checkable-checked {
background: #00B3BE;
border: 1px solid #00BEBE;
color: #fff;
}
</style>
@@ -0,0 +1,790 @@
<template>
<div>
<div class="content-box" style="margin-top: 16px">
<div class="content-box-top">
<a-icon type="arrow-left" @click="back" class="icon-left"/>
<span class="content-box-top-text">
{{ queryForm.title }}
</span>
<span class="content-box-top-color"
v-if="queryForm.problemTypeNameList && queryForm.problemTypeNameList.length > 0"
:title="val"
v-for="val in queryForm.problemTypeNameList">
{{val}}
</span>
</div>
<div class="content-box-content">
<div class="content-box-content-top ql-editor" v-html="queryForm.content">
</div>
<div class="content-box-content-botton">
<div class="content-box-content-botton-text"
v-if="queryForm.accessoryFileNameList && queryForm.accessoryFileNameList.length > 0"
v-for="item in queryForm.accessoryFileNameList">
<span @click="pdfPreview(item)" :title="item.fileName" class="file-text">{{item.fileName}}</span>
<a-icon @click="download(item)" type="download" class="icon-text"/>
</div>
</div>
</div>
<div class="content-box-xian"></div>
<div class="content-box-button">
<div class="content-box-button-left">
<div class="content-box-button-text">
<a-icon type="user"/>
{{queryForm.createBy}}
</div>
<div class="content-box-button-text" v-if="queryForm.standNumber">
<div class="content-box-button-text" v-for="(value,key) in queryForm.standNumber.split(',')">
<a-icon type="file-markdown"/>
<span style='text-decoration: underline;cursor:pointer;' @click='detailClick(queryForm,key)'>{{value}}</span>
</div>
</div>
<div class="content-box-button-text" v-if="queryForm.targetMarket_dicText">
<img src="../../../../assets/ditu.png" style="width: 15px;margin-top: -3px" alt="">
{{queryForm.targetMarket_dicText}}
</div>
<div class="content-box-button-text" v-if="queryForm.showPermissions_dicText">
<a-icon type="eye" />
{{queryForm.showPermissions_dicText}}
</div>
<div class="content-box-button-text">
<a-icon type="history"/>
{{queryForm.createTime}}
</div>
</div>
<div class="content-box-button-right">
<div class="content-box-button-text" @click="forwardClick(queryForm)">
<a-icon type="logout"/>
{{$t('forward')}}
</div>
<div class="content-box-button-text">
<a-icon type="eye"/>
<span class="text">{{queryForm.browsingHistoryCount}}</span>
</div>
<div class="content-box-button-text"
:class="{'icon-active':this.isCollect}"
@click="starClick()"
>
<a-icon class="icon" type="star"/>
<span class="text">{{queryForm.collectCount}}</span>
</div>
<div class="content-box-button-text"
:class="{'icon-active':this.isPraise}"
@click="likeClick()">
<a-icon type="like"/>
<span class="text">{{queryForm.praiseCount}}</span>
</div>
</div>
</div>
<div class="content-box-comment">
<div class="content-box-comment-text">
{{$t('comment')}}
</div>
<a-form-model :model="formInline" class="formAdd" :rules="rules" ref="ruleForm">
<a-row :gutter="24">
<a-col :span="24">
<div class="box-title-text">
<a-form-model-item class="itemModel" prop="commentContent">
<a-textarea :placeholder="$t('pleaseEnter')+$t('comment')"
v-model.trim="formInline.commentContent"
:rows="1"/>
</a-form-model-item>
<a-button class="header-btn submit"
:loading="loading" @click="release"
type="primary">{{$t('release')}}
</a-button>
</div>
</a-col>
</a-row>
</a-form-model>
<div class="commentContent-text" v-for="(item,index) in releaseList" :key="index">
<div class="commentContent-header">
<span class="commentContent-yuan"></span>
<span class="commentContent-title">{{item.createBy}}</span>
<span class="commentContent-time">{{item.createTime}}</span>
</div>
<div class="commentContent-content">
{{item.commentContent}}
</div>
<div class="answer-text-index"
style="margin-bottom: 14px">
<span class="answer-text" @click="messageClick(item)">
{{$t('answer')}}
</span>
<span class="answer-text"
v-if="administrators || item.createBy == userInfoQuery.username"
@click="deleteClick(item)">
{{$t('delete')}}
</span>
</div>
<div class="commentContent-text-one" v-for="(val,index1) in item.problemKnowledgeBaseCommentVOList"
v-if="item.problemKnowledgeBaseCommentVOList && item.problemKnowledgeBaseCommentVOList.length > 0">
<div class="commentContent-header">
<!-- <span class="commentContent-yuan"></span>-->
<span class="commentContent-title">{{val.createBy}}</span>
<span class="commentContent-time">{{val.createTime}}</span>
</div>
<div class="commentContent-content">
{{val.commentContent}}
</div>
<div class="answer-text-index">
<span class="answer-text" @click="messageClick(item)">
{{$t('answer')}}
</span>
<span class="answer-text"
v-if="administrators || val.createBy == userInfoQuery.username"
@click="deleteClick(val)">
{{$t('delete')}}
</span>
</div>
</div>
</div>
</div>
<SelectedBy ref="SelectedByRef" :title="$t('forward')" @SelectedByForm="SelectedByForm"></SelectedBy>
</div>
<a-modal
:title="$t('replyToComments')"
:width="700"
:visible="visibleComment"
:confirm-loading="confirmLoading"
:maskClosable="false"
@ok="handleOkComment"
@cancel="handleCancelComment"
>
<a-form-model :model="formInlineComment" class="formAdd" :rules="rulesComment" ref="ruleFormComment">
<a-row :gutter="24">
<a-col :span="24">
<div class="box-title-text">
<div class="title-text">
<span class="Required">*</span>
<span class="title-text-text" :title="$t('replyToComments')">{{$t('replyToComments')}}</span>
</div>
<a-form-model-item class="itemModel" :prop="'replyContent'">
<a-textarea
:placeholder="$t('PleaseEnter')+$t('replyToComments')"
:disabled="false"
v-model.trim="formInlineComment.replyContent" :rows="4"/>
</a-form-model-item>
</div>
</a-col>
</a-row>
</a-form-model>
</a-modal>
</div>
</template>
<script>
import { getAction, postAction, downloadFile, putAction } from '@/api/manage'
import 'quill/dist/quill.core.css'
import 'quill/dist/quill.snow.css'
import 'quill/dist/quill.bubble.css'
import { quillEditor } from 'vue-quill-editor'
import SelectedBy from '@/components/SelectedBy/index'
import { mapGetters } from 'vuex'
import { Base64 } from 'js-base64'
import { deleteAction } from '../../../../api/manage'
export default {
name: 'problemKnowledgeBaseListView',
components: {
SelectedBy
},
data() {
return {
visibleComment: false,
administrators: false,
userInfoQuery: {},
releaseList: [],
loading: false,
formInline: {},
confirmLoading: false,
formInlineComment: {},
rulesComment: {
replyContent: [
{
required: true,
message: this.$t('replyToComments') + this.$t('cannotEmpty'),
trigger: 'blur'
},
{
max: 300,
message: this.$t('replyToComments') + this.$t('cannotExceed') + 300 + this.$t('Characters'),
trigger: 'blur'
}
]
},
rules: {
commentContent: [
{
max: 300,
message: this.$t('comment') + this.$t('cannotExceed') + 300 + this.$t('Characters'),
trigger: 'blur'
}
]
},
queryBase: {},
CommentQuery: {},
queryForm: {},
isPraise: false,
downLoadFileUrl: window._CONFIG['domianPreviewURL'] + '/sys/common/download',
downLoadImgUrl: window._CONFIG['domianWebImgURL'] + '/sys/common/download',
isCollect: false
}
},
mounted() {
this.administrators = false
this.userInfoQuery = this.userInfo()
if (this.userInfo().userRoleList && this.userInfo().userRoleList.length > 0) {
this.userInfo().userRoleList.forEach(res => {
if (res.roleCode == 'admin') {
this.administrators = true
}
})
}
},
methods: {
...mapGetters(['userInfo']),
pdfPreview(fileQuery) {
let fileName = fileQuery.fileName
let index1 = fileName.lastIndexOf('.')
let index2 = fileName.length
let fileSuffix = fileName.substring(index1, index2)
if (fileSuffix == '.pdf') {
window.open('/pdf/web/viewer.html?file=' + encodeURIComponent('/jero-boot/sys/common/pdf/viewFile?id=' + fileQuery.id + '&userName=' + this.userInfo().username))
} else if (fileSuffix == '.docx' || fileSuffix == '.doc') {
let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + fileQuery.id + fileSuffix)
window.open(url, '_blank')
} else if (fileSuffix == '.xlsx' || fileSuffix == '.xls') {
let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + fileQuery.id + fileSuffix)
window.open(url, '_blank')
} else if (fileSuffix == '.png' || fileSuffix == '.jpeg' || fileSuffix == '.gif' || fileSuffix == '.jpg') {
let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadImgUrl + '/' + fileQuery.id + fileSuffix)
window.open(url, '_blank')
} else {
downloadFile('/sys/common/downLoadFile', fileQuery.fileName, { id: fileQuery.id })
}
},
deleteClick(item) {
let _this = this
this.$confirm({
content: _this.$t('ConfirmDelete'),
onOk() {
let url = ''
if (item.problemKnowledgeBaseId) {
url = '/problemKnowledgeBase/problemKnowledgeBaseCommentEO/deleteBatch'
} else {
url = '/project/problemKnowledgeBaseReplyEO/deleteBatch'
}
deleteAction(url, { ids: item.id }).then((res) => {
if (res.success) {
_this.$message.success(_this.$t('OperationSuccessful'))
_this.releaseData()
} else {
_this.$message.warning(res.message)
}
})
}
})
},
download(item) {
downloadFile('/sys/common/downLoadFile', item.fileName, { id: item.id, userName: this.userInfo().username })
},
getData(val) {
this.queryBase = val
this.queryById()
this.releaseData()
this.viewAdd()
},
viewAdd() {
let query = {
problemKnowledgeBaseId: this.queryBase.id,
browsingUserId: this.userInfo().id
}
postAction('/problemKnowledgeBase/problemKnowledgeBaseBrowsingHistoryEO/add', query).then((res) => {
})
},
queryById() {
let query = {
id: this.queryBase.id
}
getAction('/problemKnowledgeBase/problemKnowledgeBaseEO/queryById', query).then((res) => {
if (res.success) {
this.queryForm = res.result || {}
this.queryForm = { ...this.queryForm }
if (this.queryForm.praiseEO && this.queryForm.praiseEO.praiseStatus == 'Praise') {
this.isPraise = true
} else {
this.isPraise = false
}
if (this.queryForm.collectEO && this.queryForm.collectEO.collectStatus == 'Collect') {
this.isCollect = true
} else {
this.isCollect = false
}
}
})
},
likeClick() {
let praiseStatus = ''
this.isPraise = !this.isPraise
if (this.isPraise) {
praiseStatus = 'Praise'
this.queryForm.praiseCount = this.queryForm.praiseCount + 1
} else {
praiseStatus = 'Cancel praise'
this.queryForm.praiseCount = this.queryForm.praiseCount - 1
}
let query = {
problemKnowledgeBaseId: this.queryBase.id,
praiseUserId: this.userInfo().id,
praiseStatus: praiseStatus,
id: this.queryForm.praiseEO ? this.queryForm.praiseEO.id : undefined
}
putAction('/problemKnowledgeBase/problemKnowledgeBasePraiseEO/edit', query).then((res) => {
if (!this.queryForm.praiseEO || !this.queryForm.praiseEO.id) {
this.queryById()
}
})
},
starClick() {
let collectStatus = ''
this.isCollect = !this.isCollect
if (this.isCollect) {
collectStatus = 'Collect'
this.queryForm.collectCount = this.queryForm.collectCount + 1
} else {
collectStatus = 'Cancel Collect'
this.queryForm.collectCount = this.queryForm.collectCount - 1
}
let query = {
problemKnowledgeBaseId: this.queryBase.id,
collectUserId: this.userInfo().id,
collectStatus: collectStatus,
id: this.queryForm.collectEO ? this.queryForm.collectEO.id : undefined
}
putAction('/problemKnowledgeBase/problemKnowledgeBaseCollectEO/edit', query).then((res) => {
if (!this.queryForm.collectEO || !this.queryForm.collectEO.id) {
this.queryById()
}
})
},
release() {
if (!this.formInline.commentContent) {
this.$message.warning(this.$t('pleaseEnter'))
return
}
this.$refs.ruleForm.validate(valid => {
if (valid) {
let query = {
problemKnowledgeBaseId: this.queryBase.id,
commentContent: this.formInline.commentContent,
commentUserId: this.userInfo().id
}
this.loading = true
postAction('/problemKnowledgeBase/problemKnowledgeBaseCommentEO/add', query).then((res) => {
if (res.success) {
this.$message.success(this.$t('OperationSuccessful'))
this.$refs.ruleForm.clearValidate()
this.releaseData()
this.formInline = {}
this.loading = false
} else {
this.$message.warning(this.$t('operationFailed'))
this.loading = false
}
})
}
})
},
handleOkComment() {
this.$refs.ruleFormComment.validate(valid => {
if (valid) {
let query = {
commentId: this.CommentQuery.id,
replyContent: this.formInlineComment.replyContent
}
this.confirmLoading = true
postAction('/project/problemKnowledgeBaseReplyEO/add', query).then((res) => {
if (res.success) {
this.$message.success(this.$t('OperationSuccessful'))
this.visibleComment = false
this.confirmLoading = false
this.releaseData()
} else {
this.confirmLoading = false
this.$message.success(this.$t('operationFailed'))
}
})
}
})
},
handleCancelComment() {
this.visibleComment = false
},
messageClick(val) {
this.CommentQuery = val
this.visibleComment = true
this.formInlineComment = {}
this.$nextTick(() => {
this.$refs.ruleFormComment.clearValidate()
})
},
releaseData() {
let query = {
problemKnowledgeBaseId: this.queryBase.id
}
getAction('/problemKnowledgeBase/problemKnowledgeBaseCommentEO/list', query).then((res) => {
if (res.success) {
this.releaseList = res.result || []
} else {
this.releaseList = []
}
})
},
back() {
this.$emit('problemKnowledgeBase')
},
forwardClick(row) {
this.queryForm = row
this.$refs.SelectedByRef.getPush()
},
detailClick(item,key) {
let newUrl = this.$router.resolve({
path: '/docManage/library/detail',
query: {
id: item.bussDocumentLibraryId.split(',')[key]
}
})
window.open(newUrl.href, '_blank')
},
SelectedByForm(userIds) {
let query = {
userIds: userIds,
departIds: userIds,
problemKnowledgeBaseId: this.queryForm.id,
problemKnowledgeBaseTitle: this.queryForm.title
}
postAction('/problemKnowledgeBase/problemKnowledgeBaseEO/forward', query).then((res) => {
if (res.success) {
this.$message.success(this.$t('OperationSuccessful'))
this.$refs.SelectedByRef.visible = false
this.$refs.SelectedByRef.submitLoading = false
} else {
this.$message.warning(this.$t('operationFailed'))
this.$refs.SelectedByRef.submitLoading = false
}
})
}
}
}
</script>
<style scoped lang="less">
.content-box {
width: 100%;
height: auto;
/*padding: 24px 24px 16px 24px;*/
/*box-sizing: border-box;*/
border: 1px solid #E6E6E9;
border-radius: 4px;
position: relative;
margin-bottom: 20px;
.content-box-top {
width: 100%;
height: auto;
padding: 20px 24px;
box-sizing: border-box;
background: #F7F7F8;
border-bottom: 1px solid #E6E6E9;
display: flex;
align-items: center;
.icon-left {
font-size: 16px;
margin-right: 6px;
font-weight: bold;
}
.content-box-top-text {
font-size: 18px;
font-weight: bold;
color: #040B29;
margin-left: 6px;
}
.content-box-top-color {
font-size: 12px;
font-weight: 400;
color: #00BEBE;
padding: 0 10px;
box-sizing: border-box;
display: inline-block;
height: 22px;
line-height: 22px;
background: #DBF2F3;
border-radius: 3px;
margin-left: 12px;
max-width: 120px;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
}
}
.content-box-content {
width: 100%;
height: auto;
margin-top: 16px;
padding: 0 24px;
margin-bottom: 16px;
box-sizing: border-box;
.content-box-content-top {
font-size: 14px;
font-weight: 400;
color: #040B29;
/*display: -webkit-box;*/
/*text-overflow: ellipsis;*/
/*!*! autoprefixer: off *!*/
/*-webkit-box-orient: vertical;*/
/*-webkit-line-clamp: 2;*/
/*!*! autoprefixer: on;*!*/
/*text-justify: inter-ideograph;*/
/*overflow: hidden;*/
word-break: break-all;
}
.content-box-content-botton {
width: 100%;
margin-top: 10px;
.content-box-content-botton-text {
/*max-width: 200px;*/
/*min-width: 120px;*/
height: 32px;
display: inline-block;
text-align: center;
line-height: 32px;
/*padding: 0 10px;*/
/*background: #EFF1F3;*/
border-radius: 4px;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
font-size: 14px;
font-weight: 400;
color: #040B29;
margin-right: 20px;
cursor: pointer;
.file-text {
width: calc(100% - 30px);
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
text-decoration: underline;
display: inline-block;
margin-right: 6px;
cursor: pointer;
}
.icon-text {
width: 24px;
font-size: 16px;
overflow: hidden;
margin-bottom: 9px;
color: #00B3BE;
cursor: pointer;
}
}
}
}
.content-box-xian {
width: 100%;
position: absolute;
border-bottom: 1px #EFF1F3 solid;
left: 0;
}
.content-box-button {
width: 100%;
margin-top: 32px;
overflow: hidden;
padding: 0 24px 16px 24px;
border-bottom: 1px #EFF1F3 solid;
.content-box-button-left {
width: 50%;
float: left;
.content-box-button-text {
display: inline-block;
margin-right: 30px;
font-size: 14px;
font-weight: 400;
color: #6F7385;
word-break: break-all;
}
}
.content-box-button-right {
width: 50%;
float: left;
text-align: right;
.content-box-button-text {
display: inline-block;
margin-left: 30px;
font-size: 14px;
font-weight: 400;
color: #040B29;
cursor: pointer;
}
}
}
.content-box-comment {
width: 100%;
padding: 0 24px;
box-sizing: border-box;
.content-box-comment-text {
height: 60px;
line-height: 60px;
font-size: 16px;
font-weight: 400;
color: #000F16;
}
.commentContent-text {
width: 100%;
margin-bottom: 20px;
.commentContent-header {
width: 100%;
display: flex;
align-items: center;
.commentContent-yuan {
display: inline-block;
width: 5px;
height: 5px;
background: #00BEBE;
border-radius: 50%;
}
.commentContent-title {
font-size: 14px;
margin-left: 8px;
font-weight: bold;
color: #040B29;
}
.commentContent-time {
font-size: 14px;
margin-left: 8px;
font-weight: 400;
color: #6F7385;
}
}
.commentContent-content {
width: 100%;
margin-left: 12px;
font-size: 14px;
font-weight: 400;
color: #040B29;
margin-top: 6px;
}
.answer-text-index {
width: 100%;
}
.answer-text {
display: inline-block;
padding: 3px 14px;
background: #FFFFFF;
border: 1px solid #E6E6E9;
border-radius: 3px;
font-size: 12px;
font-weight: 400;
color: #040B29;
margin-left: 12px;
margin-top: 6px;
cursor: pointer;
}
.commentContent-text-one {
width: 100%;
margin-left: 12px;
background: #F6F7FA;
border-radius: 4px;
padding: 20px 20px 0 20px;
box-sizing: border-box;
}
.commentContent-text-one:last-child {
padding-bottom: 20px;
}
}
}
}
.box-title-text {
line-height: 1.4;
display: flex;
/*align-items: center;*/
}
.title-text {
width: 88px;
text-align: right;
display: inline-block;
font-weight: 500;
font-size: 14px;
margin-right: 16px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
height: 42px;
line-height: 48px;
color: #000F16;
}
.box-input {
display: inline-block;
height: 38px;
width: 100%;
}
.itemModel {
width: 100%;
display: inline-block;
margin-bottom: 12px;
}
.header-btn {
height: 38px;
margin-left: 16px;
}
.icon-active {
color: #00B3BE !important;
}
.text {
min-width: 16px;
text-align: left;
display: inline-block;
margin-left: 3px;
}
.Required {
color: red;
margin-right: 4px;
}
</style>
@@ -921,12 +921,8 @@
userTypes: this.currentPersonRole,
exportName:this.$route.query.projectName + '(' + this.$route.query.title + ')'
}
getAction('/params/collectManifest/exportAll', query).then((res) => {
if (res && !res.success) {
this.$message.error(res.message)
}
this.textLoading = false
})
let name = this.$route.query.projectName + '(' + this.$route.query.title + ')' + '.zip'
downloadFile('/params/collectManifest/exportAll', name , query , this.selectClear)
},
//填写人导出
handleExportDre(){