Merge remote-tracking branch 'origin/master'

This commit is contained in:
liyawei
2022-05-13 17:49:24 +08:00
24 changed files with 889 additions and 424 deletions
@@ -98,8 +98,15 @@ public class DictAspect {
if(!"java.util.LinkedHashMap".equals(name) && !"java.util.HashMap".equals(name) && !"java.lang.String".equals(name)){
List<JSONObject> items = new ArrayList<>();
for (Object record : (List)((Result) result).getResult()) {
JSONObject item = getJsonObject(record,cut);
items.add(item);
if("java.util.ArrayList".equals(record.getClass().getName())){
for (Object o : (List) record) {
JSONObject item = getJsonObject(o,cut);
items.add(item);
}
}else{
JSONObject item = getJsonObject(record,cut);
items.add(item);
}
}
((Result) result).setResult(items);
}
@@ -9,13 +9,16 @@ import com.jero.modules.system.entity.SysUser;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
@@ -158,17 +161,16 @@ public class ProjectRelatedPersonnelController extends JeroController<ProjectRel
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
@AutoLog(value = "项目库-相关人员维护表-通过excel导入数据")
@ApiOperation(value="项目库-相关人员维护表-通过excel导入数据", notes="项目库-相关人员维护表-通过excel导入数据")
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response,
@RequestParam(name="projectId",required=true) String projectId,
@RequestParam(name="cut",required=true) String cut) {
return projectRelatedPersonnelService.importExcel(request, response, ProjectRelatedPersonnel.class,projectId,cut);
public Result<?> importExcel(MultipartFile file,
@RequestParam(name="projectId",required=true) String projectId,
@RequestParam(name="cut",required=true) String cut) throws IOException, InvalidFormatException {
String message = projectRelatedPersonnelService.importExcel(file, ProjectRelatedPersonnel.class, projectId, cut);
return Result.OK(message);
}
/**
@@ -0,0 +1,53 @@
package com.jero.modules.project.controller;
import com.jero.common.api.vo.Result;
import com.jero.common.aspect.annotation.AutoLog;
import com.jero.modules.project.entity.ProjectLibraryBase;
import com.jero.modules.project.service.IProjectStatusBoardService;
import com.jero.modules.project.vo.TimeNodeVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
/**
* @description
* @date 2022/5/13 9:56
* @auth zhn
*/
@Api(tags="项目状态看板")
@RestController
@RequestMapping("/project/ProjectStatusBoardController")
@Slf4j
public class ProjectStatusBoardController {
@Autowired
private IProjectStatusBoardService iProjectStatusBoardService;
/**
* 时间轴列表
*
* @param projectLibraryBase
* @return
*/
@AutoLog(value = "时间轴列表")
@ApiOperation(value="时间轴列表", notes="时间轴列表")
@GetMapping(value = "/timelineList")
public Result<?> timelineList(ProjectLibraryBase projectLibraryBase, HttpServletRequest req) {
List<List<TimeNodeVO>> result = iProjectStatusBoardService.timelineList(projectLibraryBase, req);
if(result==null) {
return Result.error("未找到对应数据");
}
return Result.OK(result);
}
}
@@ -69,8 +69,8 @@ public class ProjectTaskPlanningController extends JeroController<ProjectTaskPla
@ApiOperation(value="法规,认证任务计划 (各阶段确认进度) 表-列表查询", notes="法规,认证任务计划 (各阶段确认进度) 表-列表查询")
@GetMapping(value = "/list")
public Result<ProjectTaskPlanning> queryList(@RequestParam(name="projectId",required=true) String projectId) {
ProjectTaskPlanning projectTaskPlanning = projectTaskPlanningService.queryList(projectId);
return Result.OK(projectTaskPlanning);
List<ProjectTaskPlanning> projectTaskPlanning = projectTaskPlanningService.queryList(projectId);
return Result.OK(projectTaskPlanning.get(0));
}
/**
@@ -140,11 +140,11 @@ public class ProjectTaskPlanningController extends JeroController<ProjectTaskPla
@GetMapping(value = "/queryByProjectId")
public Result<?> queryByProjectId(@RequestParam(name="projectId",required=true) String projectId,
@RequestParam(name="cut",required=true) String cut) {
List<TimeNodeVO> projectTaskPlanning = projectTaskPlanningService.queryByProjectId(projectId,cut);
if(projectTaskPlanning==null) {
List<List<TimeNodeVO>> result = projectTaskPlanningService.queryByProjectId(projectId,cut);
if(result.size() == 0) {
return Result.error("未找到对应数据");
}
return Result.OK(projectTaskPlanning);
return Result.OK(result.get(0));
}
/**
@@ -0,0 +1,9 @@
package com.jero.modules.project.mapper;
/**
* @description
* @date 2022/5/13 10:00
* @auth zhn
*/
public interface ProjectStatusBoardMapper {
}
@@ -2,6 +2,7 @@ package com.jero.modules.project.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.jero.modules.project.entity.ProjectTaskPlanning;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.List;
@@ -13,7 +14,8 @@ import java.util.List;
* @Version: V1.0
*/
public interface ProjectTaskPlanningMapper extends BaseMapper<ProjectTaskPlanning> {
@Select("SELECT * FROM project_task_planning where project_id=#{projectId}")
ProjectTaskPlanning getByProjectId(String projectId);
// @Select("SELECT * FROM project_task_planning where project_id=#{projectId}")
List<ProjectTaskPlanning> getByProjectId(@Param("projectId") String projectId);
}
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.jero.modules.project.mapper.ProjectStatusBoardMapper">
<resultMap id="ProjectLibraryBaseResultMap" type="com.jero.modules.project.entity.ProjectLibraryBase">
<id column="id" property="id" />
<result column="project_name_id" property="projectNameId" />
<result column="target_market" property="targetMarket" />
<result column="project_status" property="projectStatus" />
<result column="studio_engineer" property="studioEngineer" />
<result column="certification_engineer" property="certificationEngineer" />
<result column="vehicle_platform" property="vehiclePlatform" />
<result column="digital_platform" property="digitalPlatform" />
<result column="ipd_info" property="ipdInfo" />
<result column="vehicle_development_plan" property="vehicleDevelopmentPlan" />
<result column="attestation_plan" property="attestationPlan" />
<result column="create_by" property="createBy" />
<result column="create_time" property="createTime" />
<result column="update_by" property="updateBy" />
<result column="update_time" property="updateTime" />
<result column="sys_org_code" property="sysOrgCode" />
</resultMap>
</mapper>
@@ -12,4 +12,16 @@
<result column="attestation_end_time" property="attestationEndTime" />
<result column="verify_deadline" property="verifyDeadline" />
</resultMap>
</mapper>
<select id="getByProjectId" resultMap="ProjectTaskPlanningResultMap">
SELECT * FROM project_task_planning
where 1 = 1
<if test="projectId != null" >
and project_id in
<foreach collection="projectId.split(',')" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</select>
</mapper>
@@ -1,12 +1,14 @@
package com.jero.modules.project.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.jero.common.api.vo.Result;
import com.jero.modules.project.entity.ProjectRelatedPersonnel;
import com.jero.modules.system.entity.SysUser;
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
import java.util.Map;
@@ -78,10 +80,10 @@ public interface IProjectRelatedPersonnelService extends IService<ProjectRelated
/**设置导出模板*/
void exportTemplate(ProjectRelatedPersonnel projectRelatedPersonnel, HttpServletResponse response, HttpServletRequest request);
Result<?> importExcel(HttpServletRequest request, HttpServletResponse response, Class<ProjectRelatedPersonnel> clazz, String projectId,String cut);
String importExcel(MultipartFile file, Class<ProjectRelatedPersonnel> clazz, String projectId, String cut) throws IOException, InvalidFormatException;
List<ProjectRelatedPersonnel> oppositeDisposeData(List<ProjectRelatedPersonnel> records,String projectId,String cut);
String oppositeDisposeData(List<ProjectRelatedPersonnel> records, String projectId, String cut);
ProjectRelatedPersonnel queryByProjectIdAndDutyTerritory(String projectId, String dutyTerritory);
@@ -0,0 +1,17 @@
package com.jero.modules.project.service;
import com.jero.modules.project.entity.ProjectLibraryBase;
import com.jero.modules.project.vo.TimeNodeVO;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
/**
* @description
* @date 2022/5/13 9:59
* @auth zhn
*/
public interface IProjectStatusBoardService {
List<List<TimeNodeVO>> timelineList(ProjectLibraryBase projectLibraryBase, HttpServletRequest req);
}
@@ -52,12 +52,12 @@ public interface IProjectTaskPlanningService extends IService<ProjectTaskPlannin
* @param projectId
* @return
*/
List<TimeNodeVO> queryByProjectId(String projectId,String cut);
List<List<TimeNodeVO>> queryByProjectId(String projectId,String cut);
/**
* 列表查询
*
* @return
*/
ProjectTaskPlanning queryList(String projectId);
List<ProjectTaskPlanning> queryList(String projectId);
}
@@ -24,7 +24,6 @@ import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.enmus.ExcelType;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import javax.servlet.http.HttpServletRequest;
@@ -175,24 +174,29 @@ public class NcrTrackServiceImpl extends ServiceImpl<NcrTrackMapper, NcrTrackVO>
}
//待办任务id
if(trackVOList.size() != 0){
List<String> projectTaskInventoryIdList = trackVOList.stream().map(NcrTrackVO::getId).distinct().collect(Collectors.toList());
List<String> projectLawsInventoryIdList = trackVOList.stream().map(NcrTrackVO::getProjectLawsInventoryId).distinct().collect(Collectors.toList());
QueryWrapper<ProjectTaskInventoryDetailEO> taskDetailQueryWrapper = new QueryWrapper<>();
taskDetailQueryWrapper.lambda().in(ProjectTaskInventoryDetailEO::getProjectTaskInventoryId,projectTaskInventoryIdList);
taskDetailQueryWrapper.lambda().in(ProjectTaskInventoryDetailEO::getProjectTaskInventoryId,projectLawsInventoryIdList);
//任务清单数据
List<ProjectTaskInventoryDetailEO> projectTaskInventoryDetailEOList = projectTaskInventoryDetailEOService.list(taskDetailQueryWrapper);
for (NcrTrackVO trackVO : trackVOList) {
String projectTaskInventoryId = trackVO.getId();
String prcType = trackVO.getPrcType();
if(StringUtils.isNotBlank(projectTaskInventoryId) && StringUtils.isNotBlank(prcType)){
String projectLawsInventoryId = trackVO.getProjectLawsInventoryId();//任务清单id
String prcType = trackVO.getPrcType();//流程类型
if(StringUtils.isNotBlank(projectLawsInventoryId) && StringUtils.isNotBlank(prcType)){
List<ProjectTaskInventoryDetailEO> collect = projectTaskInventoryDetailEOList.stream()
.filter(e -> projectTaskInventoryId.equals(e.getProjectTaskInventoryId()) && prcType.equals(e.getFlowType()))
.filter(e -> projectLawsInventoryId.equals(e.getProjectTaskInventoryId()) && prcType.equals(e.getFlowType()))
.collect(Collectors.toList());
if(collect.size() != 0){
trackVO.setTaskId(collect.get(0).getTaskId());
trackVO.setTaskId(collect.get(0).getTaskId());//待办任务id
trackVO.setStatus(collect.get(0).getStatus());
trackVO.setProjectTaskInventoryDetailId(collect.get(0).getId());
trackVO.setTaskDefinitionKey(collect.get(0).getTaskDefinitionKey());
}
}
}
}
List<NcrTrackVO> trackVOListTemp = new ArrayList<>();
String idJson = ncrTrackVO.getNcrTrackVOList();
if(StringUtils.isNotBlank(idJson)){
@@ -1,14 +1,12 @@
package com.jero.modules.project.service.impl;
import cn.afterturn.easypoi.excel.ExcelImportUtil;
import cn.afterturn.easypoi.excel.entity.ImportParams;
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.api.vo.Result;
import com.jero.common.constant.enums.CutEnum;
import com.jero.common.exception.JeroBootException;
import com.jero.common.system.vo.LoginUser;
import com.jero.modules.dummy.service.impl.DummyInventoryInfoEOServiceImpl;
import com.jero.modules.enums.DictCodeEnum;
import com.jero.modules.project.entity.ProjectRelatedPersonnel;
import com.jero.modules.project.mapper.ProjectRelatedPersonnelMapper;
@@ -27,17 +25,14 @@ import org.apache.poi.hssf.usermodel.HSSFCellStyle;
import org.apache.poi.hssf.usermodel.HSSFRichTextString;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.VerticalAlignment;
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
import org.apache.poi.ss.usermodel.*;
import org.apache.poi.ss.util.CellRangeAddress;
import org.apache.shiro.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@@ -75,6 +70,9 @@ public class ProjectRelatedPersonnelServiceImpl extends ServiceImpl<ProjectRelat
@Value(value = "${jero.path.upload}")
private String uploadpath;
@Autowired
private DummyInventoryInfoEOServiceImpl dummyInventoryInfoEOService;
/**
* 保存
*
@@ -485,7 +483,7 @@ public class ProjectRelatedPersonnelServiceImpl extends ServiceImpl<ProjectRelat
if(CutEnum.CN.getValue().equals(cut)){
explainInfo = "填写说明\n" +
"1.导入数据从第行开始\n" +
"1.导入数据从第行开始\n" +
"2.所有带*号的字段必须填写\n"+
"3.认证类型,认证级别,实施类别,交付物类型,发起人,责任人,字段是单选属性,必须和系统中的对应字段选项相匹配\n" +
"4.责任领域,字段是多选属性,必须和系统中的对应字段选项相匹配,填写多个时采用英文或中文逗号分割\n" +
@@ -493,7 +491,7 @@ public class ProjectRelatedPersonnelServiceImpl extends ServiceImpl<ProjectRelat
"6.交付物模板字段为文件属性,填写时需要在本文件同级目录下以标准号为名称建立文件夹,并在文件夹下放置文件,假设在AAA标准号下放置了B.docx,则应填写AAA/B.docx";
}else{
explainInfo = "filling explanation\n" +
"1.import data starts at the fourth line\n" +
"1.import data starts at the third line\n" +
"2.all fields marked with * must be filled in\n"+
"3.certification type,certification level,implementation category,type of deliverables,initiator,person liable,Fields are radio attributes that must match the corresponding field option in the system\n" +
"4.area of responsibility, field is a multi-select attribute and must match the corresponding field in the system. If multiple fields are filled in, separate them by commas (,)\n" +
@@ -550,89 +548,97 @@ public class ProjectRelatedPersonnelServiceImpl extends ServiceImpl<ProjectRelat
*/
@Override
public void exportTemplate(ProjectRelatedPersonnel projectRelatedPersonnel, HttpServletResponse response, HttpServletRequest request) {
OutputStream os = null;
HSSFWorkbook workbook = new HSSFWorkbook();
String fileOriName = "法规清单导入模板.xls";
String filePath = uploadpath + File.separator + fileOriName;
try {
String titleOne = "";
if(CutEnum.CN.getValue().equals(projectRelatedPersonnel.getCut())){
titleOne = "*责任领域,*法规工程师,*工程接口人,*认证工程师,备注";
}else{
titleOne = "*Responsible Field,*Regulation Engineer,*Engineering Interface,*Homologation Engineer,Comments";
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
if (sysUser != null) {
OutputStream os = null;
HSSFWorkbook workbook = new HSSFWorkbook();
String fileOriName = "";
String filePath = uploadpath + File.separator + fileOriName;
try {
String titleOne = "";
if (CutEnum.CN.getValue().equals(projectRelatedPersonnel.getCut())) {
titleOne = "*责任领域,*法规工程师,*工程接口人,*认证工程师,备注";
fileOriName = "相关人员导入模板.xls";
} else {
titleOne = "*Responsible Field,*Regulation Engineer,*Engineering Interface,*Homologation Engineer,Comments";
fileOriName = "Import template of related personnel.xls";
}
//创建临时文件夹
File nowFile = new File(filePath);
if (nowFile.exists()) {
nowFile.delete();
}
nowFile.mkdirs();
HSSFSheet sheet = workbook.createSheet("虚拟清单导入模板");
sheet.setDefaultColumnWidth(16);//列宽
HSSFCellStyle cellStyle = workbook.createCellStyle();
cellStyle.setWrapText(true);//自动换行
cellStyle.setAlignment(HorizontalAlignment.CENTER);//垂直居中
cellStyle.setVerticalAlignment(VerticalAlignment.CENTER);//水平居中
HSSFCellStyle cellStyleTemp = workbook.createCellStyle();
cellStyleTemp.setWrapText(true);//自动换行
int startLine = 0;
int endLine = 4;
//合并单元格
CellRangeAddress region1 =
new CellRangeAddress(1, 1, startLine, endLine); //参数1:起始行 参数2:终止行 参数3:起始列 参数4:终止列
sheet.addMergedRegion(region1);
String explainInfo = null;
if (CutEnum.CN.getValue().equals(projectRelatedPersonnel.getCut())) {
explainInfo = "填写说明\n" +
"1.导入数据从第三行开始\n" +
"2.所有带*号的字段必须填写\n" +
"3.认证类型,认证级别,实施类别,交付物类型,发起人,责任人,字段是单选属性,必须和系统中的对应字段选项相匹配\n" +
"4.责任领域,字段是多选属性,必须和系统中的对应字段选项相匹配,填写多个时采用英文或中文逗号分割\n" +
"5.编号,子标题,WVTA ID,备注,填写文本内容\n" +
"6.交付物模板字段为文件属性,填写时需要在本文件同级目录下以标准号为名称建立文件夹,并在文件夹下放置文件,假设在AAA标准号下放置了B.docx,则应填写AAA/B.docx";
} else {
explainInfo = "filling explanation\n" +
"1.import data starts at the third line\n" +
"2.all fields marked with * must be filled in\n" +
"3.certification type,certification level,implementation category,type of deliverables,initiator,person liable,Fields are radio attributes that must match the corresponding field option in the system\n" +
"4.area of responsibility, field is a multi-select attribute and must match the corresponding field in the system. If multiple fields are filled in, separate them by commas (,)\n" +
"5.serial number,subtitle,WVTA ID,remarks,Fill in the text\n" +
"6.deliverable template,When filling in the field, you need to create a folder in the directory of the same level as the file with the name of the standard number and place the file in the folder. If b. diocx is stored under the AAA standard number, enter AAA/B. diocx";
}
HSSFRichTextString explain = new HSSFRichTextString(explainInfo);
//表头
Row row = sheet.createRow(0);//开始创建标题行
String[] headerArr = titleOne.split(",");
for (int m = 0; m < headerArr.length; m++) {
row.createCell(m).setCellValue(headerArr[m]);
}
Row rowExplain = sheet.createRow(1);
short height = (short) (7 * 252);
rowExplain.setHeight((short) height);
Cell cell = rowExplain.createCell(0);
cell.setCellValue(explain);
cell.setCellStyle(cellStyleTemp);
response.setHeader("Content-Disposition",
"attachment; filename=\"" + fileOriName + ".xls");
response.setContentType("application/force-download");
response.flushBuffer();
os = response.getOutputStream();
workbook.write(os);
} catch (Exception e) {
e.printStackTrace();
throw new JeroBootException("下载文件失败,请重试");
} finally {
IOUtils.closeQuietly(os);
}
//创建临时文件夹
File nowFile = new File(filePath);
if (nowFile.exists()) {
nowFile.delete();
}
nowFile.mkdirs();
HSSFSheet sheet = workbook.createSheet("虚拟清单导入模板");
sheet.setDefaultColumnWidth(16);//列宽
HSSFCellStyle cellStyle = workbook.createCellStyle();
cellStyle.setWrapText(true);//自动换行
cellStyle.setAlignment(HorizontalAlignment.CENTER);//垂直居中
cellStyle.setVerticalAlignment(VerticalAlignment.CENTER);//水平居中
HSSFCellStyle cellStyleTemp = workbook.createCellStyle();
cellStyleTemp.setWrapText(true);//自动换行
int startLine = 0;
int endLine = 4;
//合并单元格
CellRangeAddress region1 =
new CellRangeAddress(1, 1, startLine, endLine); //参数1:起始行 参数2:终止行 参数3:起始列 参数4:终止列
sheet.addMergedRegion(region1);
String explainInfo= null;
if(CutEnum.CN.getValue().equals(projectRelatedPersonnel.getCut())){
explainInfo = "填写说明\n" +
"1.导入数据从第四行开始\n" +
"2.所有带*号的字段必须填写\n"+
"3.认证类型,认证级别,实施类别,交付物类型,发起人,责任人,字段是单选属性,必须和系统中的对应字段选项相匹配\n" +
"4.责任领域,字段是多选属性,必须和系统中的对应字段选项相匹配,填写多个时采用英文或中文逗号分割\n" +
"5.编号,子标题,WVTA ID,备注,填写文本内容\n" +
"6.交付物模板字段为文件属性,填写时需要在本文件同级目录下以标准号为名称建立文件夹,并在文件夹下放置文件,假设在AAA标准号下放置了B.docx,则应填写AAA/B.docx";
}else{
explainInfo = "filling explanation\n" +
"1.import data starts at the fourth line\n" +
"2.all fields marked with * must be filled in\n"+
"3.certification type,certification level,implementation category,type of deliverables,initiator,person liable,Fields are radio attributes that must match the corresponding field option in the system\n" +
"4.area of responsibility, field is a multi-select attribute and must match the corresponding field in the system. If multiple fields are filled in, separate them by commas (,)\n" +
"5.serial number,subtitle,WVTA ID,remarks,Fill in the text\n" +
"6.deliverable template,When filling in the field, you need to create a folder in the directory of the same level as the file with the name of the standard number and place the file in the folder. If b. diocx is stored under the AAA standard number, enter AAA/B. diocx";
}
HSSFRichTextString explain=new HSSFRichTextString(explainInfo);
//表头
Row row = sheet.createRow(0);//开始创建标题行
String[] headerArr = titleOne.split(",");
for (int m = 0; m < headerArr.length; m++) {
row.createCell(m).setCellValue(headerArr[m]);
}
Row rowExplain = sheet.createRow(1);
short height = (short) (7 * 252);
rowExplain.setHeight((short) height);
Cell cell = rowExplain.createCell(0);
cell.setCellValue(explain);
cell.setCellStyle(cellStyleTemp);
response.setHeader("Content-Disposition",
"attachment; filename=\"" + fileOriName + ".xls");
response.setContentType("application/force-download");
response.flushBuffer();
os = response.getOutputStream();
workbook.write(os);
} catch (Exception e) {
e.printStackTrace();
throw new JeroBootException("下载文件失败,请重试");
} finally {
IOUtils.closeQuietly(os);
}
}
@@ -642,106 +648,204 @@ public class ProjectRelatedPersonnelServiceImpl extends ServiceImpl<ProjectRelat
/**
* 导入excel数据
*
* @param request
* @return
*/
@Override
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response,
Class<ProjectRelatedPersonnel> clazz,String projectId,String cut) {
Result<ProjectRelatedPersonnel> result=new Result<>();
MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
MultipartFile file = entity.getValue();// 获取上传文件对象
ImportParams params = new ImportParams();
params.setTitleRows(1);
params.setHeadRows(1);
params.setNeedSave(true);
try {
//接收导入数据
List<ProjectRelatedPersonnel> records = ExcelImportUtil.importExcel(file.getInputStream(), clazz, params);
if(CollectionUtils.isNotEmpty(records)) {
oppositeDisposeData(records,projectId,cut);
public String importExcel(MultipartFile file,
Class<ProjectRelatedPersonnel> clazz, String projectId, String cut) throws IOException, InvalidFormatException {
//中英切换提示语
if(CutEnum.CN.getValue().equals(cut)) {
result.success("文件导入成功!数据行数:" + records.size());
String explainInfo= null;
String titleOne = "";
if(CutEnum.CN.getValue().equals(cut)){
titleOne = "*责任领域,*法规工程师,*工程接口人,*认证工程师,备注";
explainInfo = "填写说明\n" +
"1.导入数据从第三行开始\n" +
"2.所有带*号的字段必须填写\n"+
"3.认证类型,认证级别,实施类别,交付物类型,发起人,责任人,字段是单选属性,必须和系统中的对应字段选项相匹配\n" +
"4.责任领域,字段是多选属性,必须和系统中的对应字段选项相匹配,填写多个时采用英文或中文逗号分割\n" +
"5.编号,子标题,WVTA ID,备注,填写文本内容\n" +
"6.交付物模板字段为文件属性,填写时需要在本文件同级目录下以标准号为名称建立文件夹,并在文件夹下放置文件,假设在AAA标准号下放置了B.docx,则应填写AAA/B.docx";
}else{
titleOne = "*Responsible Field,*Regulation Engineer,*Engineering Interface,*Homologation Engineer,Comments";
explainInfo = "filling explanation\n" +
"1.import data starts at the third line\n" +
"2.all fields marked with * must be filled in\n"+
"3.certification type,certification level,implementation category,type of deliverables,initiator,person liable,Fields are radio attributes that must match the corresponding field option in the system\n" +
"4.area of responsibility, field is a multi-select attribute and must match the corresponding field in the system. If multiple fields are filled in, separate them by commas (,)\n" +
"5.serial number,subtitle,WVTA ID,remarks,Fill in the text\n" +
"6.deliverable template,When filling in the field, you need to create a folder in the directory of the same level as the file with the name of the standard number and place the file in the folder. If b. diocx is stored under the AAA standard number, enter AAA/B. diocx";
}
List<String> titleOneList = Arrays.asList(titleOne.split(","));
// 获取文件名
String fileName = file.getOriginalFilename();
// 获取文件后缀
String prefix = fileName.substring(fileName.lastIndexOf("."));
File excelFile = File.createTempFile(fileName, prefix);
file.transferTo(excelFile);
Workbook workbook = WorkbookFactory.create(excelFile);
List<ProjectRelatedPersonnel> list = new ArrayList<>();
if (workbook != null) {
Sheet sheet = workbook.getSheetAt(0);
if (sheet != null) {
int rowNos = sheet.getPhysicalNumberOfRows();// 得到excel的总记录条数
for (int i = 0; i < rowNos ; i++) {
Row row = sheet.getRow(i);
Row headerRow = sheet.getRow(i);
boolean isBlank = dummyInventoryInfoEOService.isRowEmpty(row);
if (row != null && !isBlank) {
int columNos = headerRow.getLastCellNum();// 表头总共的列数
if (columNos == 5) {//列数对
for (int j = 0; j < columNos; j++) {
Cell cell = row.getCell(j,Row.MissingCellPolicy.CREATE_NULL_AS_BLANK);
if (i == 0){
if (i == 0 && !cell.getStringCellValue().equals(titleOneList.get(j))) {//检查表头
if (CutEnum.CN.getValue().equals(cut)) {
throw new JeroBootException("读取失败.请检查第 " + (i+1) + " 行表头,请严格按照模板文件导入数据");
} else {
throw new JeroBootException("The data fails to be read.Please check header in line " + (i+1) + " .Import data strictly according to the template file.");
}
}
}
}
}else if((i!=1 && columNos != 5) || (i==2 && columNos !=1)){
if (CutEnum.CN.getValue().equals(cut)) {
throw new JeroBootException("导入的列数不对,请检查");
} else {
throw new JeroBootException("The number of imported columns is wrong. Please check!");
}
}
}else{
result.success("File import succeeded! Number of data rows" + records.size());
if (CutEnum.CN.getValue().equals(cut)) {
throw new JeroBootException("导入的数据不能为空,请检查");
} else {
throw new JeroBootException("The imported data of cannot be empty. Please check!");
}
}
}else{
//中英切换提示语
if(CutEnum.CN.getValue().equals(cut)) {
result.error500("数据为空,请检查");
}else {
result.error500("The data is empty, please check!");
if (i == 1) {//校验填写说明
row = sheet.getRow(i);
int columNos = row.getLastCellNum();
if(columNos != 1 /*|| (!row.getCell(0).getStringCellValue().equals(explainInfo))*/){
if (CutEnum.CN.getValue().equals(cut)) {
throw new JeroBootException("填写说明列数不对,请严格按照模板文件导入数据");
}else{
throw new JeroBootException("The number of columns of filling explanation is wrong. Please import data strictly according to the template file.");
}
}
}
if (i > 1) {//读取数据
//获取每一行数据
row = sheet.getRow(i);
ProjectRelatedPersonnel projectRelatedPersonnel = new ProjectRelatedPersonnel();
//责任领域不能为空
String dutyTerritory = row.getCell(0).toString();
if(StringUtils.isNotBlank(dutyTerritory)) {
projectRelatedPersonnel.setDutyTerritory(row.getCell(0).toString());
}else{//责任领域不能为空,报错
if(CutEnum.CN.getValue().equals(cut)){
throw new JeroBootException("请填写责任领域,带*的为必填.请检查第 "+ (i+1) + "");
}else{
throw new JeroBootException("Please fill in the Responsible Field and those marked with * are required. .Please check line" + (i+1));
}
}
String lawEngineerName = row.getCell(1, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK).toString();
String engineeringInterfacePersonName = row.getCell(2, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK).toString();
String certificationEngineerName = row.getCell(3,Row.MissingCellPolicy.CREATE_NULL_AS_BLANK).toString();
//除了责任领域全有值->可以
if(StringUtils.isNotBlank(lawEngineerName) && StringUtils.isNotBlank(engineeringInterfacePersonName) && StringUtils.isNotBlank(certificationEngineerName)) {
projectRelatedPersonnel.setLawEngineerName(lawEngineerName);
projectRelatedPersonnel.setEngineeringInterfacePersonName(engineeringInterfacePersonName);
projectRelatedPersonnel.setCertificationEngineerName(certificationEngineerName);
}else if(StringUtils.isBlank(lawEngineerName) && StringUtils.isBlank(engineeringInterfacePersonName) && StringUtils.isBlank(certificationEngineerName)) {
//除了责任领域,带*的全为空->可以
projectRelatedPersonnel.setLawEngineerName("");
projectRelatedPersonnel.setEngineeringInterfacePersonName("");
projectRelatedPersonnel.setCertificationEngineerName("");
}else {//除了责任领域,备注,有一个为空都报错
if(CutEnum.CN.getValue().equals(cut)){
throw new JeroBootException("请填写必填字段内容,带*的为必填.请检查第 "+ (i+1) + "");
}else{
throw new JeroBootException("Please fill in the required fields marked with * .Please check line" + (i+1));
}
}
String remark = row.getCell(4, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK).toString();
if(StringUtils.isNotEmpty(row.getCell(4).toString())) {
projectRelatedPersonnel.setRemark(remark);
}
list.add(projectRelatedPersonnel);
}
}
} catch (Exception e) {
log.error(e.getMessage(), e);
result.error500(e.getMessage());
} finally {
try {
file.getInputStream().close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
return result;
workbook.close();
//把数据翻译成id,并保存
String message = oppositeDisposeData(list, projectId, cut);
return message;
}
/**
* 把导入的数据翻译成对应的id,校验
* 把导入的数据翻译成对应的id,校验,不存
* 若除责任领域外的导入数据不能为空
* @return
*/
@Override
public List<ProjectRelatedPersonnel> oppositeDisposeData(List<ProjectRelatedPersonnel> records,String projectId,String cut) {
int row=1;
public String oppositeDisposeData(List<ProjectRelatedPersonnel> records, String projectId, String cut) {
int row=3;
StringBuilder message = new StringBuilder();
for (ProjectRelatedPersonnel projectRelatedPersonnel:records) {
//查标签内容里的责任领域数据
List<String> sysDictItemValueList = sysDictItemMapper.selectItemValueByDictCode(DictCodeEnum.DUTY_TERRITORY.getValue());
if(!sysDictItemValueList.contains(projectRelatedPersonnel.getDutyTerritory())){
if (CutEnum.CN.getValue().equals(cut)) {
throw new JeroBootException("该责任领域不存在.请检查第" + row + "");
}else{
throw new JeroBootException("The area of responsibility does not exist. Please check line " + row);
}
List<SysDictItem> sysDictItemList = sysDictItemMapper.selectItemsByDictCode(DictCodeEnum.DUTY_TERRITORY.getValue());
List<String> dutyTerritoryValueList = new ArrayList<>();
//按照责任领域名,查value
if (CutEnum.CN.getValue().equals(cut)) {
dutyTerritoryValueList = sysDictItemList.stream().filter(f -> f.getItemText().equals(projectRelatedPersonnel.getDutyTerritory())).map(e -> e.getItemValue()).collect(Collectors.toList());
} else {
dutyTerritoryValueList = sysDictItemList.stream().filter(f -> f.getEnName().equals(projectRelatedPersonnel.getDutyTerritory())).map(e -> e.getItemValue()).collect(Collectors.toList());
}
//责任领域
if(!projectRelatedPersonnel.getDutyTerritory().isEmpty()) {
//导入的一条数据,只能有一个责任领域
if (projectRelatedPersonnel.getDutyTerritory().contains(",")) {
//中英切换提示语
if (CutEnum.CN.getValue().equals(cut)) {
throw new JeroBootException("导入的责任领域只能填一个.请检查第" + row + "");
message.append("导入的责任领域只能填一个.请检查第" + row + ". ");
} else {
throw new JeroBootException("Only one duty territory can be filled in for import. Please check line " + row);
message.append("Only one duty territory can be filled in for import. Please check line " + row);
}
} else {
String dictItemValue = sysDictService.queryDictItemByValue(DictCodeEnum.DUTY_TERRITORY.getValue(), projectRelatedPersonnel.getDutyTerritory(), cut);
if (StringUtils.isBlank(dictItemValue)) {
if (CollectionUtils.isEmpty(dutyTerritoryValueList)) {//导入的责任领域不对
//中英切换提示语
if (CutEnum.CN.getValue().equals(cut)) {
throw new JeroBootException("导入的责任领域不存在.请检查第" + row + "");
message.append("导入的责任领域不存在.请检查第" + row + "");
} else {
throw new JeroBootException("The imported duty territory does not exist. Please check line " + row);
message.append("The imported duty territory does not exist. Please check line " + row);
}
}else {
projectRelatedPersonnel.setDutyTerritory(dutyTerritoryValueList.get(0));
QueryWrapper<ProjectRelatedPersonnel> queryWrapper = new QueryWrapper<>();
List<ProjectRelatedPersonnel> idList = list(queryWrapper.select("id").eq("duty_territory", projectRelatedPersonnel.getDutyTerritory()).eq("project_id",projectId));
List<ProjectRelatedPersonnel> idList = list(queryWrapper.select("id").eq("duty_territory", dutyTerritoryValueList.get(0)).eq("project_id",projectId));
projectRelatedPersonnel.setId(idList.get(0).getId());
}
}
}else{
//中英切换提示语
if(CutEnum.CN.getValue().equals(cut)) {
throw new JeroBootException("导入的责任领域不能为空.请检查第" + row + "");
message.append("导入的责任领域不能为空.请检查第" + row + "");
}else{
throw new JeroBootException("The imported duty territory cannot be empty.Please check line " + row );
message.append("The imported duty territory cannot be empty.Please check line " + row );
}
}
@@ -755,9 +859,9 @@ public class ProjectRelatedPersonnelServiceImpl extends ServiceImpl<ProjectRelat
if(lawEngineerUsers.size()!=lawEngineerNameList.size()){
//中英切换提示语
if(CutEnum.CN.getValue().equals(cut)) {
throw new JeroBootException("导入的法规工程师姓名有误,请检查第" + row + "");
message.append("导入的法规工程师姓名有误,请检查第" + row + "");
}else{
throw new JeroBootException("The imported law engineer is wrong.Please check line " + row );
message.append("The imported law engineer is wrong.Please check line " + row );
}
}
}
@@ -776,12 +880,7 @@ public class ProjectRelatedPersonnelServiceImpl extends ServiceImpl<ProjectRelat
projectRelatedPersonnel.setLawEngineer(midId.substring(0,midId.toString().length()-1));
}
}else{
//中英切换提示语
if(CutEnum.CN.getValue().equals(cut)) {
throw new JeroBootException("导入的法规工程师姓名不能为空,请检查第" + row + "");
}else{
throw new JeroBootException("The imported law engineer cannot be empty.Please check line " + row );
}
projectRelatedPersonnel.setLawEngineer("");
}
//工程接口人
@@ -794,9 +893,9 @@ public class ProjectRelatedPersonnelServiceImpl extends ServiceImpl<ProjectRelat
if(engineeringInterfacePersonUsers.size()!=engineeringInterfacePersonNameList.size()){
//中英切换提示语
if(CutEnum.CN.getValue().equals(cut)) {
throw new JeroBootException("导入的工程接口人姓名有误,请检查第" + row + "");
message.append("导入的工程接口人姓名有误,请检查第" + row + "");
}else{
throw new JeroBootException("The imported engineering interface person is wrong.Please check line " + row );
message.append("The imported engineering interface person is wrong.Please check line " + row );
}
}
}
@@ -815,12 +914,7 @@ public class ProjectRelatedPersonnelServiceImpl extends ServiceImpl<ProjectRelat
projectRelatedPersonnel.setEngineeringInterfacePerson(midId.substring(0,midId.toString().length()-1));
}
}else{
//中英切换提示语
if(CutEnum.CN.getValue().equals(cut)) {
throw new JeroBootException("导入的工程接口人姓名不能为空,请检查第" + row + "");
}else{
throw new JeroBootException("The imported engineering interface person cannot be empty.Please check line " + row );
}
projectRelatedPersonnel.setEngineeringInterfacePerson("");
}
//认证工程师
@@ -833,9 +927,9 @@ public class ProjectRelatedPersonnelServiceImpl extends ServiceImpl<ProjectRelat
if(certificationEngineerUsers.size()!=certificationEngineerNameList.size()){
//中英切换提示语
if(CutEnum.CN.getValue().equals(cut)) {
throw new JeroBootException("导入的认证工程师姓名有误,请检查第" + row + "");
message.append("导入的认证工程师姓名有误,请检查第" + row + "");
}else {
throw new JeroBootException("The imported certification engineer is wrong.Please check line " + row );
message.append("The imported certification engineer is wrong.Please check line " + row );
}
}
}
@@ -854,18 +948,28 @@ public class ProjectRelatedPersonnelServiceImpl extends ServiceImpl<ProjectRelat
projectRelatedPersonnel.setCertificationEngineer(midId.substring(0,midId.toString().length()-1));
}
}else{
//中英切换提示语
if(CutEnum.CN.getValue().equals(cut)) {
throw new JeroBootException("导入的认证工程师姓名不能为空,请检查第" + row + "");
}else {
throw new JeroBootException("The imported certification engineer cannot be empty.Please check line " + row );
}
projectRelatedPersonnel.setCertificationEngineer("");
}
projectRelatedPersonnel.setProjectId(projectId);
Date now = new Date();
projectRelatedPersonnel.setUpdateTime(now);
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
projectRelatedPersonnel.setUpdateBy(sysUser.getUsername());
//
row++;
updateDataById(projectRelatedPersonnel);
}
return records;
//中英切换提示语,message为空 = 之前的数据没错
if(StringUtils.isBlank(message.toString())) {
saveOrUpdateBatch(records);
if (CutEnum.CN.getValue().equals(cut)) {
message.append("导入成功");
} else {
message.append("Import succeeded.");
}
}
return message.toString();
}
@Override
@@ -876,50 +980,50 @@ public class ProjectRelatedPersonnelServiceImpl extends ServiceImpl<ProjectRelat
return getOne(queryWrapper);
}
//导入时,把传入的数据,拼到原来数据后面
private void updateDataById(ProjectRelatedPersonnel projectRelatedPersonnel) {
List<ProjectRelatedPersonnel> records = projectRelatedPersonnelMapper.queryById(projectRelatedPersonnel.getId());
for (ProjectRelatedPersonnel data : records) {
//法规工程师
String lawString = projectRelatedPersonnel.getLawEngineer();
//去重
if(StringUtils.isNotBlank(lawString)) {
List<String> lawList = Arrays.asList(lawString.split(","));
String lawDistinct = lawList.stream().distinct().collect(Collectors.joining(","));
projectRelatedPersonnel.setLawEngineer(lawDistinct);
}
//工程接口人
String interfaceString = projectRelatedPersonnel.getEngineeringInterfacePerson();
//去重
if(StringUtils.isNotBlank(interfaceString)) {
List<String> interfaceList = Arrays.asList(interfaceString.split(","));
String interfaceDistinct = interfaceList.stream().distinct().collect(Collectors.joining(","));
projectRelatedPersonnel.setEngineeringInterfacePerson(interfaceDistinct);
}
// 工程接口人
String certificationString = projectRelatedPersonnel.getCertificationEngineer();
//去重
if(StringUtils.isNotBlank(certificationString)) {
List<String> certificationList = Arrays.asList(certificationString.split(","));
String certificationDistinct = certificationList.stream().distinct().collect(Collectors.joining(","));
projectRelatedPersonnel.setCertificationEngineer(certificationDistinct);
}
if (StringUtils.isBlank(data.getRemark())) {//数据库里备注是空的
projectRelatedPersonnel.setRemark(projectRelatedPersonnel.getRemark());
} else {
projectRelatedPersonnel.setRemark("");
}
Date now = new Date();
projectRelatedPersonnel.setUpdateTime(now);
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
projectRelatedPersonnel.setUpdateBy(sysUser.getUsername());
updateById(projectRelatedPersonnel);
}
}
// //导入-更新数据
// private void updateDataById(List<ProjectRelatedPersonnel> records) {
//// List<ProjectRelatedPersonnel> records = projectRelatedPersonnelMapper.queryById(projectRelatedPersonnel.getId());
// for (ProjectRelatedPersonnel projectRelatedPersonnel : records) {
//// //法规工程师
//// String lawString = projectRelatedPersonnel.getLawEngineer();
//// //去重
//// if(StringUtils.isNotBlank(lawString)) {
//// List<String> lawList = Arrays.asList(lawString.split(","));
//// String lawDistinct = lawList.stream().distinct().collect(Collectors.joining(","));
//// projectRelatedPersonnel.setLawEngineer(lawDistinct);
//// }
////
//// //工程接口人
//// String interfaceString = projectRelatedPersonnel.getEngineeringInterfacePerson();
//// //去重
//// if(StringUtils.isNotBlank(interfaceString)) {
//// List<String> interfaceList = Arrays.asList(interfaceString.split(","));
//// String interfaceDistinct = interfaceList.stream().distinct().collect(Collectors.joining(","));
//// projectRelatedPersonnel.setEngineeringInterfacePerson(interfaceDistinct);
//// }
////
////// 工程接口人
//// String certificationString = projectRelatedPersonnel.getCertificationEngineer();
//// //去重
//// if(StringUtils.isNotBlank(certificationString)) {
//// List<String> certificationList = Arrays.asList(certificationString.split(","));
//// String certificationDistinct = certificationList.stream().distinct().collect(Collectors.joining(","));
//// projectRelatedPersonnel.setCertificationEngineer(certificationDistinct);
//// }
////
//// if (StringUtils.isBlank(data.getRemark())) {//数据库里备注是空的
//// projectRelatedPersonnel.setRemark(projectRelatedPersonnel.getRemark());
//// } else {
//// projectRelatedPersonnel.setRemark("");
//// }
//
// Date now = new Date();
// projectRelatedPersonnel.setUpdateTime(now);
// LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
// projectRelatedPersonnel.setUpdateBy(sysUser.getUsername());
// updateById(projectRelatedPersonnel);
// }
// }
@Override
public List<SysUser> queryCertificationEngineer(String projectId) {
@@ -0,0 +1,49 @@
package com.jero.modules.project.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.jero.common.system.query.QueryGenerator;
import com.jero.modules.dummy.entity.DummyInventoryBaseEO;
import com.jero.modules.project.entity.ProjectLibraryBase;
import com.jero.modules.project.service.IProjectStatusBoardService;
import com.jero.modules.project.vo.TimeNodeVO;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
/**
* @description
* @date 2022/5/13 9:59
* @auth zhn
*/
@Service
public class ProjectStatusBoardServiceImpl implements IProjectStatusBoardService {
@Autowired
private ProjectTaskPlanningServiceImpl projectTaskPlanningService;
@Autowired
private ProjectLibraryBaseServiceImpl projectLibraryBaseService;
@Override
public List<List<TimeNodeVO>> timelineList(ProjectLibraryBase projectLibraryBase, HttpServletRequest req) {
QueryWrapper<ProjectLibraryBase> queryWrapper = QueryGenerator.initQueryWrapper(projectLibraryBase, req.getParameterMap());
//项目库信息
List<ProjectLibraryBase> projectLibraryBaseList = projectLibraryBaseService.list(queryWrapper);
List<List<TimeNodeVO>> result = new ArrayList<>();
if(projectLibraryBaseList.size() != 0){
//项目库id
List<String> projectLibraryBaseIdList = projectLibraryBaseList.stream().map(ProjectLibraryBase::getId).collect(Collectors.toList());
//时间轴数据
result = projectTaskPlanningService.queryByProjectId(StringUtils.join(projectLibraryBaseIdList, ","), projectLibraryBase.getCut());
}
return result;
}
}
@@ -10,6 +10,7 @@ import com.jero.modules.project.enums.ProjectTaskPlanningNameEnum;
import com.jero.modules.project.mapper.ProjectTaskPlanningMapper;
import com.jero.modules.project.service.IProjectTaskPlanningService;
import com.jero.modules.project.vo.TimeNodeVO;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
@@ -90,9 +91,10 @@ public class ProjectTaskPlanningServiceImpl extends ServiceImpl<ProjectTaskPlann
* @return
*/
@Override
public List<TimeNodeVO> queryByProjectId(String projectId,String cut) {
ProjectTaskPlanning projectTaskPlanning = projectTaskPlanningMapper.getByProjectId(projectId);
List<TimeNodeVO> timeNodeVOS = new ArrayList<>();
public List<List<TimeNodeVO>> queryByProjectId(String projectId,String cut) {
List<ProjectTaskPlanning> projectTaskPlanningList = projectTaskPlanningMapper.getByProjectId(projectId);
List<List<TimeNodeVO>> result = new ArrayList<>();
TimeNodeVO listConfirmationVO=null;
Date now=new Date();
@@ -104,156 +106,164 @@ public class ProjectTaskPlanningServiceImpl extends ServiceImpl<ProjectTaskPlann
cal1.set(Calendar.SECOND, 0);
cal1.set(Calendar.MILLISECOND, 0);
Date trueNow = cal1.getTime();
for (ProjectTaskPlanning projectTaskPlanning : projectTaskPlanningList) {
List<TimeNodeVO> timeNodeVOS = new ArrayList<>();
if(ObjectUtils.isNotEmpty(projectTaskPlanning.getListConfirmation())) {
listConfirmationVO = new TimeNodeVO();
if(StringUtils.isNotBlank(projectTaskPlanning.getListConfirmation().toString())) {
listConfirmationVO = new TimeNodeVO();
if(CutEnum.CN.getValue().equals(cut)){
listConfirmationVO.setName(ProjectTaskPlanningNameEnum.LIST_CONFIRMATION.getName());
}else{
listConfirmationVO.setName(ProjectTaskPlanningNameEnum.LIST_CONFIRMATION.getValue());
}
if(CutEnum.CN.getValue().equals(cut)){
listConfirmationVO.setName(ProjectTaskPlanningNameEnum.LIST_CONFIRMATION.getName());
}else{
listConfirmationVO.setName(ProjectTaskPlanningNameEnum.LIST_CONFIRMATION.getValue());
listConfirmationVO.setTime(projectTaskPlanning.getListConfirmation());
if(projectTaskPlanning.getListConfirmation().after(trueNow)){
listConfirmationVO.setStatus(PlanStatusEnum.LESS_THAN_TIME.getValue());
}else if(projectTaskPlanning.getListConfirmation().before(trueNow)){
listConfirmationVO.setStatus(PlanStatusEnum.OUT_OF_DATE.getValue());
}else{
listConfirmationVO.setStatus(PlanStatusEnum.ON_GOING.getValue());
}
timeNodeVOS.add(listConfirmationVO);
}
listConfirmationVO.setTime(projectTaskPlanning.getListConfirmation());
if(projectTaskPlanning.getListConfirmation().after(trueNow)){
listConfirmationVO.setStatus(PlanStatusEnum.LESS_THAN_TIME.getValue());
}else if(projectTaskPlanning.getListConfirmation().before(trueNow)){
listConfirmationVO.setStatus(PlanStatusEnum.OUT_OF_DATE.getValue());
}else{
listConfirmationVO.setStatus(PlanStatusEnum.ON_GOING.getValue());
if(ObjectUtils.isNotEmpty(projectTaskPlanning.getLegalTaskConfirmation())) {
TimeNodeVO legalTaskConfirmationVO = new TimeNodeVO();
if(CutEnum.CN.getValue().equals(cut)){
legalTaskConfirmationVO.setName(ProjectTaskPlanningNameEnum.LEGAL_TASK_CONFIRMATION.getName());
}else{
legalTaskConfirmationVO.setName(ProjectTaskPlanningNameEnum.LEGAL_TASK_CONFIRMATION.getValue());
}
legalTaskConfirmationVO.setTime(projectTaskPlanning.getLegalTaskConfirmation());
if(projectTaskPlanning.getLegalTaskConfirmation().after(trueNow)){
legalTaskConfirmationVO.setStatus(PlanStatusEnum.LESS_THAN_TIME.getValue());
}else if(projectTaskPlanning.getLegalTaskConfirmation().before(trueNow)){
legalTaskConfirmationVO.setStatus(PlanStatusEnum.OUT_OF_DATE.getValue());
}else {
legalTaskConfirmationVO.setStatus(PlanStatusEnum.ON_GOING.getValue());
}
timeNodeVOS.add(legalTaskConfirmationVO);
}
if(ObjectUtils.isNotEmpty(projectTaskPlanning.getDesignDeadline())) {
TimeNodeVO designDeadlineVO = new TimeNodeVO();
if(CutEnum.CN.getValue().equals(cut)){
designDeadlineVO.setName(ProjectTaskPlanningNameEnum.DESIGN_DEADLINE.getName());
}else{
designDeadlineVO.setName(ProjectTaskPlanningNameEnum.DESIGN_DEADLINE.getValue());
}
designDeadlineVO.setTime(projectTaskPlanning.getDesignDeadline());
if(projectTaskPlanning.getDesignDeadline().after(trueNow)){
designDeadlineVO.setStatus(PlanStatusEnum.LESS_THAN_TIME.getValue());
}else if(projectTaskPlanning.getDesignDeadline().before(trueNow)){
designDeadlineVO.setStatus(PlanStatusEnum.OUT_OF_DATE.getValue());
}else{
designDeadlineVO.setStatus(PlanStatusEnum.ON_GOING.getValue());
}
timeNodeVOS.add(designDeadlineVO);
}
if(ObjectUtils.isNotEmpty(projectTaskPlanning.getPrehomoDeadline())) {
TimeNodeVO prehomoDeadlineVO = new TimeNodeVO();
if(CutEnum.CN.getValue().equals(cut)){
prehomoDeadlineVO.setName(ProjectTaskPlanningNameEnum.PREHOMO_DEADLINE.getName());
}else{
prehomoDeadlineVO.setName(ProjectTaskPlanningNameEnum.PREHOMO_DEADLINE.getValue());
}
prehomoDeadlineVO.setTime(projectTaskPlanning.getPrehomoDeadline());
if(projectTaskPlanning.getPrehomoDeadline().after(trueNow)){
prehomoDeadlineVO.setStatus(PlanStatusEnum.LESS_THAN_TIME.getValue());
}else if(projectTaskPlanning.getPrehomoDeadline().before(trueNow)){
prehomoDeadlineVO.setStatus(PlanStatusEnum.OUT_OF_DATE.getValue());
}else{
prehomoDeadlineVO.setStatus(PlanStatusEnum.ON_GOING.getValue());
}
timeNodeVOS.add(prehomoDeadlineVO);
}
if(ObjectUtils.isNotEmpty(projectTaskPlanning.getAttestationStartTime())) {
TimeNodeVO attestationStartTimeVO = new TimeNodeVO();
if(CutEnum.CN.getValue().equals(cut)){
attestationStartTimeVO.setName(ProjectTaskPlanningNameEnum.ATTESTATION_START_TIME.getName());
}else{
attestationStartTimeVO.setName(ProjectTaskPlanningNameEnum.ATTESTATION_START_TIME.getValue());
}
attestationStartTimeVO.setTime(projectTaskPlanning.getAttestationStartTime());
if(projectTaskPlanning.getAttestationStartTime().after(trueNow)){
attestationStartTimeVO.setStatus(PlanStatusEnum.LESS_THAN_TIME.getValue());
}else if(projectTaskPlanning.getAttestationStartTime().before(trueNow)){
attestationStartTimeVO.setStatus(PlanStatusEnum.OUT_OF_DATE.getValue());
}else{
attestationStartTimeVO.setStatus(PlanStatusEnum.ON_GOING.getValue());
}
timeNodeVOS.add(attestationStartTimeVO);
}
if(ObjectUtils.isNotEmpty(projectTaskPlanning.getAttestationEndTime())) {
TimeNodeVO attestationEndTimeVO = new TimeNodeVO();
if(CutEnum.CN.getValue().equals(cut)){
attestationEndTimeVO.setName(ProjectTaskPlanningNameEnum.ATTESTATION_END_TIME.getName());
}else{
attestationEndTimeVO.setName(ProjectTaskPlanningNameEnum.ATTESTATION_END_TIME.getValue());
}
attestationEndTimeVO.setTime(projectTaskPlanning.getAttestationEndTime());
if(projectTaskPlanning.getAttestationEndTime().after(trueNow)){
attestationEndTimeVO.setStatus(PlanStatusEnum.LESS_THAN_TIME.getValue());
}else if(projectTaskPlanning.getAttestationEndTime().before(trueNow)){
attestationEndTimeVO.setStatus(PlanStatusEnum.OUT_OF_DATE.getValue());
}else{
attestationEndTimeVO.setStatus(PlanStatusEnum.ON_GOING.getValue());
}
timeNodeVOS.add(attestationEndTimeVO);
}
if(ObjectUtils.isNotEmpty(projectTaskPlanning.getVerifyDeadline())) {
TimeNodeVO verifyDeadlineVO = new TimeNodeVO();
if(CutEnum.CN.getValue().equals(cut)){
verifyDeadlineVO.setName(ProjectTaskPlanningNameEnum.VERIFY_DEADLINE.getName());
}else{
verifyDeadlineVO.setName(ProjectTaskPlanningNameEnum.VERIFY_DEADLINE.getValue());
}
verifyDeadlineVO.setTime(projectTaskPlanning.getVerifyDeadline());
if(projectTaskPlanning.getVerifyDeadline().after(trueNow)){
verifyDeadlineVO.setStatus(PlanStatusEnum.LESS_THAN_TIME.getValue());
}else if(projectTaskPlanning.getVerifyDeadline().before(trueNow)){
verifyDeadlineVO.setStatus(PlanStatusEnum.OUT_OF_DATE.getValue());
}else{
verifyDeadlineVO.setStatus(PlanStatusEnum.ON_GOING.getValue());
}
timeNodeVOS.add(verifyDeadlineVO);
}
// 排序
Collections.sort(timeNodeVOS, listConfirmationVO);
//设置在已过时,和未发生之间的数据的状态为进行中
for(int i=0;i<timeNodeVOS.size();i++){
if(i == timeNodeVOS.size()-1){
break;
}
if(timeNodeVOS.get(i).getStatus().equals(PlanStatusEnum.OUT_OF_DATE.getValue())
&& timeNodeVOS.get(i+1).getStatus().equals(PlanStatusEnum.LESS_THAN_TIME.getValue())){
timeNodeVOS.get(i+1).setStatus(PlanStatusEnum.ON_GOING.getValue());
break;
}
}
if(timeNodeVOS.size() != 0){
result.add(timeNodeVOS);
}
timeNodeVOS.add(listConfirmationVO);
}
if(!StringUtils.isEmpty(projectTaskPlanning.getLegalTaskConfirmation().toString())) {
TimeNodeVO legalTaskConfirmationVO = new TimeNodeVO();
if(CutEnum.CN.getValue().equals(cut)){
legalTaskConfirmationVO.setName(ProjectTaskPlanningNameEnum.LEGAL_TASK_CONFIRMATION.getName());
}else{
legalTaskConfirmationVO.setName(ProjectTaskPlanningNameEnum.LEGAL_TASK_CONFIRMATION.getValue());
}
legalTaskConfirmationVO.setTime(projectTaskPlanning.getLegalTaskConfirmation());
if(projectTaskPlanning.getLegalTaskConfirmation().after(trueNow)){
legalTaskConfirmationVO.setStatus(PlanStatusEnum.LESS_THAN_TIME.getValue());
}else if(projectTaskPlanning.getLegalTaskConfirmation().before(trueNow)){
legalTaskConfirmationVO.setStatus(PlanStatusEnum.OUT_OF_DATE.getValue());
}else {
legalTaskConfirmationVO.setStatus(PlanStatusEnum.ON_GOING.getValue());
}
timeNodeVOS.add(legalTaskConfirmationVO);
}
if(StringUtils.isNotBlank(projectTaskPlanning.getDesignDeadline().toString())) {
TimeNodeVO designDeadlineVO = new TimeNodeVO();
if(CutEnum.CN.getValue().equals(cut)){
designDeadlineVO.setName(ProjectTaskPlanningNameEnum.DESIGN_DEADLINE.getName());
}else{
designDeadlineVO.setName(ProjectTaskPlanningNameEnum.DESIGN_DEADLINE.getValue());
}
designDeadlineVO.setTime(projectTaskPlanning.getDesignDeadline());
if(projectTaskPlanning.getDesignDeadline().after(trueNow)){
designDeadlineVO.setStatus(PlanStatusEnum.LESS_THAN_TIME.getValue());
}else if(projectTaskPlanning.getDesignDeadline().before(trueNow)){
designDeadlineVO.setStatus(PlanStatusEnum.OUT_OF_DATE.getValue());
}else{
designDeadlineVO.setStatus(PlanStatusEnum.ON_GOING.getValue());
}
timeNodeVOS.add(designDeadlineVO);
}
if(StringUtils.isNotBlank(projectTaskPlanning.getPrehomoDeadline().toString())) {
TimeNodeVO prehomoDeadlineVO = new TimeNodeVO();
if(CutEnum.CN.getValue().equals(cut)){
prehomoDeadlineVO.setName(ProjectTaskPlanningNameEnum.PREHOMO_DEADLINE.getName());
}else{
prehomoDeadlineVO.setName(ProjectTaskPlanningNameEnum.PREHOMO_DEADLINE.getValue());
}
prehomoDeadlineVO.setTime(projectTaskPlanning.getPrehomoDeadline());
if(projectTaskPlanning.getPrehomoDeadline().after(trueNow)){
prehomoDeadlineVO.setStatus(PlanStatusEnum.LESS_THAN_TIME.getValue());
}else if(projectTaskPlanning.getPrehomoDeadline().before(trueNow)){
prehomoDeadlineVO.setStatus(PlanStatusEnum.OUT_OF_DATE.getValue());
}else{
prehomoDeadlineVO.setStatus(PlanStatusEnum.ON_GOING.getValue());
}
timeNodeVOS.add(prehomoDeadlineVO);
}
if(StringUtils.isNotBlank(projectTaskPlanning.getAttestationStartTime().toString())) {
TimeNodeVO attestationStartTimeVO = new TimeNodeVO();
if(CutEnum.CN.getValue().equals(cut)){
attestationStartTimeVO.setName(ProjectTaskPlanningNameEnum.ATTESTATION_START_TIME.getName());
}else{
attestationStartTimeVO.setName(ProjectTaskPlanningNameEnum.ATTESTATION_START_TIME.getValue());
}
attestationStartTimeVO.setTime(projectTaskPlanning.getAttestationStartTime());
if(projectTaskPlanning.getAttestationStartTime().after(trueNow)){
attestationStartTimeVO.setStatus(PlanStatusEnum.LESS_THAN_TIME.getValue());
}else if(projectTaskPlanning.getAttestationStartTime().before(trueNow)){
attestationStartTimeVO.setStatus(PlanStatusEnum.OUT_OF_DATE.getValue());
}else{
attestationStartTimeVO.setStatus(PlanStatusEnum.ON_GOING.getValue());
}
timeNodeVOS.add(attestationStartTimeVO);
}
if(StringUtils.isNotBlank(projectTaskPlanning.getAttestationEndTime().toString())) {
TimeNodeVO attestationEndTimeVO = new TimeNodeVO();
if(CutEnum.CN.getValue().equals(cut)){
attestationEndTimeVO.setName(ProjectTaskPlanningNameEnum.ATTESTATION_END_TIME.getName());
}else{
attestationEndTimeVO.setName(ProjectTaskPlanningNameEnum.ATTESTATION_END_TIME.getValue());
}
attestationEndTimeVO.setTime(projectTaskPlanning.getAttestationEndTime());
if(projectTaskPlanning.getAttestationEndTime().after(trueNow)){
attestationEndTimeVO.setStatus(PlanStatusEnum.LESS_THAN_TIME.getValue());
}else if(projectTaskPlanning.getAttestationEndTime().before(trueNow)){
attestationEndTimeVO.setStatus(PlanStatusEnum.OUT_OF_DATE.getValue());
}else{
attestationEndTimeVO.setStatus(PlanStatusEnum.ON_GOING.getValue());
}
timeNodeVOS.add(attestationEndTimeVO);
}
if(StringUtils.isNotBlank(projectTaskPlanning.getVerifyDeadline().toString())) {
TimeNodeVO verifyDeadlineVO = new TimeNodeVO();
if(CutEnum.CN.getValue().equals(cut)){
verifyDeadlineVO.setName(ProjectTaskPlanningNameEnum.VERIFY_DEADLINE.getName());
}else{
verifyDeadlineVO.setName(ProjectTaskPlanningNameEnum.VERIFY_DEADLINE.getValue());
}
verifyDeadlineVO.setTime(projectTaskPlanning.getVerifyDeadline());
if(projectTaskPlanning.getVerifyDeadline().after(trueNow)){
verifyDeadlineVO.setStatus(PlanStatusEnum.LESS_THAN_TIME.getValue());
}else if(projectTaskPlanning.getVerifyDeadline().before(trueNow)){
verifyDeadlineVO.setStatus(PlanStatusEnum.OUT_OF_DATE.getValue());
}else{
verifyDeadlineVO.setStatus(PlanStatusEnum.ON_GOING.getValue());
}
timeNodeVOS.add(verifyDeadlineVO);
}
// 排序
Collections.sort(timeNodeVOS, listConfirmationVO);
//设置在已过时,和未发生之间的数据的状态为进行中
for(int i=0;i<timeNodeVOS.size();i++){
if(timeNodeVOS.get(i).getStatus().equals(PlanStatusEnum.OUT_OF_DATE.getValue())
&& timeNodeVOS.get(i+1).getStatus().equals(PlanStatusEnum.LESS_THAN_TIME.getValue())){
timeNodeVOS.get(i+1).setStatus(PlanStatusEnum.ON_GOING.getValue());
}
}
return timeNodeVOS;
return result;
}
/**
@@ -262,8 +272,8 @@ public class ProjectTaskPlanningServiceImpl extends ServiceImpl<ProjectTaskPlann
* @return
*/
@Override
public ProjectTaskPlanning queryList(String projectId) {
ProjectTaskPlanning projectTaskPlanning = projectTaskPlanningMapper.getByProjectId(projectId);
public List<ProjectTaskPlanning> queryList(String projectId) {
List<ProjectTaskPlanning> projectTaskPlanning = projectTaskPlanningMapper.getByProjectId(projectId);
return projectTaskPlanning;
}
@@ -129,6 +129,12 @@ public class NcrTrackVO implements Serializable {
private String prcId;
//流程类型
private String prcType;
//状态:待办 、已办
private String status;
//任务清单详情id
private String projectTaskInventoryDetailId;
//任务节点定义key
private String taskDefinitionKey;
@@ -0,0 +1,13 @@
package com.jero.modules.project.vo;
/**
* @description
* @date 2022/5/13 10:04
* @auth zhn
*/
public class ProjectStatusBoardVO {
//项目名称
//目标市场
}
@@ -122,7 +122,9 @@
:title="$t('ParameterDescription')">{{$t('ParameterDescription')}}</span>
</div>
<a-form-model-item class="itemModel" prop="description">
<a-input class="box-input"
<a-input class="box-input add-input"
style='height: 135px; width: 100%'
type="textarea"
:disabled="disabled"
v-model="formInline.description"
:placeholder="$t('PleaseEnter')+$t('ParameterDescription')"/>
@@ -168,7 +170,8 @@
</a-form-model-item>
</div>
</a-col>
<a-col :span="12">
<!-- 控件校验-->
<a-col :span="12" v-if='formInline.controlType =="1" || formInline.controlType =="5" || formInline.controlType =="6" || formInline.controlType =="7" || formInline.controlType =="10"'>
<div class="box-title-text">
<div class="title-text">
<span class="title-text-text" :title="$t('controlVerification')">{{$t('controlVerification')}}</span>
@@ -185,7 +188,8 @@
</div>
</a-col>
</a-row>
<a-row :gutter="24">
<!-- 控件备选值-->
<a-row :gutter="24" v-if='formInline.controlType =="2" || formInline.controlType =="3" || formInline.controlType =="5" || formInline.controlType =="6" || formInline.controlType =="8" || formInline.controlType =="9" || formInline.controlType =="10"'>
<a-col :span="12">
<div class="box-title-text">
<div class="title-text">
@@ -194,15 +198,18 @@
:title="$t('controlAlternatives')">{{$t('controlAlternatives')}}</span>
</div>
<a-form-model-item class="itemModel" prop="controlValues">
<a-input class="box-input"
<a-input class="box-input add-input"
:disabled="disabled"
style='height: 135px'
type="textarea"
v-model="formInline.controlValues"
:placeholder="$t('PleaseEnter')+$t('controlAlternatives')"/>
</a-form-model-item>
</div>
</a-col>
</a-row>
<a-row :gutter="24">
<!-- 附件模板-->
<a-row :gutter="24" v-if='formInline.controlType =="4" || formInline.controlType =="7" || formInline.controlType =="8" || formInline.controlType =="9" || formInline.controlType =="10"'>
<a-col :span="12">
<div class="box-title-text">
<div class="title-text">
@@ -329,11 +336,12 @@ export default {
rules: {
nioNumber:[
{ required: true, message: this.$t('PleaseEnter')+this.$t('NiONumber'), trigger: 'change' },
// {
// pattern: /(?!^\d+$)(?!^[a-zA-Z]+$)[0-9a-zA-Z]{1,15}/,
// message: this.$t('onlyThree'),
// trigger: 'change'
// }
{ min:1, max: 15, message: this.$t('cantExeed')+'15'+this.$t('characters'), trigger: 'blur' },
{
pattern: /^[0-9a-zA-Z-]{1,}$/,
message: this.$t('onlyThree'),
trigger: 'change'
}
],
isMust: [
{ required: true, message: this.$t('pleaseSelect')+this.$t('Required'), trigger: 'change' },
@@ -362,6 +370,11 @@ export default {
{ min:1, max: 500, message: this.$t('cantExeed')+'500'+this.$t('characters'), trigger: 'blur' },
],
},
rulesItem: {
paramsNumber: [
{ required: true, message: this.$t('PleaseEnter')+this.$t('standard'), trigger: 'change' }
]
},
disabled: false,
projectNameList: [],
title: '',
@@ -398,8 +411,6 @@ export default {
},
Onchangelabel(val) {
let _tt = []
console.log(val,'val,,,,')
// this.formInline.certCategoryParamsInfoEOList = []
val.forEach((item) => {
_tt.push({
textVal: item.text, // tab
@@ -439,6 +450,7 @@ export default {
this.visible = true
this.title = '新增'
this.formInline = {}
this.formInline.isMust = '0'
},
editModel(value) {
this.visible = true
@@ -446,11 +458,6 @@ export default {
this.$nextTick(() => {
this.formInline = value
})
// if(value.certCategoryParamsInfoEOList.length > 0 ) {
// this.contentList = value.certCategoryParamsInfoEOList
// }
console.log(this.contentList,'this.contentList')
console.log(value.certCategoryParamsInfoEOList,'lllll')
},
handleCancel() {
this.visible = false
@@ -518,7 +525,9 @@ export default {
.formAdd .ant-form-item-label {
width: 130px;
}
/deep/.add-input{
min-height: 135px!important;
}
.formAdd .ant-form-item-control-wrapper {
display: inline-block;
width: calc(100% - 130px);
@@ -51,6 +51,7 @@
import circulationHistory from '../../components/circulationHistory'
import { getAction, postAction, deleteAction, downloadFile } from '@/api/manage'
import { mapGetters } from 'vuex'
import moment from 'moment'
export default {
name: 'handshakeProcess',
@@ -229,11 +230,56 @@
if (res.success) {
this.$message.success(this.$t('OperationSuccessful'))
this.loading = false
if (value.flag == 0) {
if (this.queryProject.verifyDeliverableType) {
this.startProcessDesign(this.queryBy, 2)
}
if (this.queryProject.prehomoDeliverableType) {
this.startProcessDesign(this.queryBy, 3)
}
if (this.queryProject.designDeliverableType) {
this.startProcessDesign(this.queryBy, 4)
}
} else {
this.$router.push({
path: '/ProcessCenter'
})
}
} else {
this.loading = false
this.$message.warning(this.$t('operationFailed'))
}
})
},
startProcessDesign(value, num) {
let query = {
type: num,
msg: JSON.stringify(value).replace(/\"/g, '\'')
}
postAction('/workFlow/startProcess', query).then((res) => {
if (res.success) {
this.completeTaskDesign(value, res.result)
}
})
},
completeTaskDesign(value, taskId) {
value.reviewResult = 'launch'
let operatorTime = moment(new Date()).format('YYYY-MM-DD HH:mm:ss')
value.operatorTime = operatorTime
let query = {
userid: this.userInfo().id,
taskId: taskId,
json: JSON.stringify(value).replace(/\"/g, '\'')
}
postAction('/workFlow/completeTask', query).then((res) => {
if (res.success) {
this.visible = false
this.$message.success(this.$t('OperationSuccessful'))
this.$router.push({
path: '/ProcessCenter'
})
} else {
this.loading = false
this.$message.warning(this.$t('operationFailed'))
}
})
@@ -270,7 +270,7 @@
this.edit()
this.$router.push({
path: '/ProjectDetails',
query: this.$route.query.primaryKeyId
query: this.$route.query
})
} else {
this.loading = false
@@ -284,6 +284,7 @@
},
getlist() {
let query = {
projectId: this.$route.query.id,
pageSize: this.pageSize,
pageNo: this.pageNo,
...this.queryParam
@@ -146,7 +146,7 @@
{{ $t('deleteLib') }}
</a>
<!-- <a class="text-operation" @click="resultReportedClick(record)">{{$t('resultReported')}}</a>-->
<a @click="addProcess(record)">发起</a>
<!-- <a @click="addProcess(record)">发起</a>-->
</span>
<span slot="titleName" slot-scope="text,record" :title="text">
{{ text && text.length > 10 ? text.slice(0, 9) + '...' : text }}
@@ -57,6 +57,9 @@
:data-source="dataSource"
:columns="columns"
>
<span slot="standard" slot-scope="text,result">
<a @click="standardClick(result)">{{text}}</a>
</span>
</a-table>
</div>
<div class="page" v-if="dataSource.length > 0">
@@ -83,17 +86,19 @@
queryParam: {},
loading: false,
dataSource: [],
selectedRowKeys:[],
selectedRowKeys: [],
columns: [
{
title: this.$t('standard'),
align: 'center',
dataIndex: 'serialNumber'
dataIndex: 'serialNumber',
scopedSlots: { customRender: 'standard' }
},
{
title: this.$t('title'),
align: 'center',
dataIndex: 'title'
dataIndex: 'title',
scopedSlots: { customRender: 'standard' }
},
{
title: this.$t('ProcessType'),
@@ -194,6 +199,48 @@
this.loading = false
}
})
},
standardClick(val) {
let num = val.prcType
let query = {
taskIds: val.taskId,
projectTaskInventoryId: val.projectLawsInventoryId,
projectLibraryId: val.projectLibraryId,
projectName: val.projectName,
id: val.projectLibraryId,
serialNumber: val.serialNumber,
actiProcInstId: val.prcId,
primaryKeyId: val.projectTaskInventoryDetailId,
TaskKey: val.status == 'NotDone' ? val.taskDefinitionKey : 'hhhhh'
}
switch (num) {
case '2':
query.flowType = 2
query.Sponsor = 'designInitiatorName'
query.personLiable = 'designDutyName'
query.typeOfDeliverables = 'designDeliverableType_dictText'
query.deliverableTemplate = 'designDeliverableTemplate'
break
case '3':
query.flowType = 3
query.Sponsor = 'prehomoInitiatorName'
query.personLiable = 'prehomoDutyName'
query.typeOfDeliverables = 'prehomoDeliverableType_dictText'
query.deliverableTemplate = 'prehomoDeliverableTemplate'
break
case '4':
query.flowType = 4
query.Sponsor = 'verifyInitiatorName'
query.personLiable = 'verifyDutyName'
query.typeOfDeliverables = 'verifyDeliverableType_dictText'
query.deliverableTemplate = 'verifyDeliverableTemplate'
break
}
let newUrl = this.$router.resolve({
path: '/taskListProcess',
query: query
})
window.open(newUrl.href, '_blank')
}
}
}
@@ -157,6 +157,9 @@
:data-source="dataSource"
:columns="columns"
>
<span slot="standard" slot-scope="text,result">
<a @click="standardClick(result)">{{text}}</a>
</span>
</a-table>
</div>
<div class="page" v-if="dataSource.length > 0">
@@ -195,13 +198,15 @@
title: this.$t('standard'),
align: 'center',
dataIndex: 'serialNumber',
ellipsis: true
ellipsis: true,
scopedSlots: { customRender: 'standard' }
},
{
title: this.$t('title'),
align: 'center',
dataIndex: 'title',
ellipsis: true
ellipsis: true,
scopedSlots: { customRender: 'standard' }
},
{
title: this.$t('ProcessType'),
@@ -330,6 +335,48 @@
PersonnelSelectionChange(value, id) {
this.queryParam[value] = id
this.queryParam = { ...this.queryParam }
},
standardClick(val) {
let num = val.prcType
let query = {
taskIds: val.taskId,
projectTaskInventoryId: val.projectLawsInventoryId,
projectLibraryId: val.projectLibraryId,
projectName: val.projectName,
id: val.projectLibraryId,
serialNumber: val.serialNumber,
actiProcInstId: val.prcId,
primaryKeyId: val.projectTaskInventoryDetailId,
TaskKey: val.status == 'NotDone' ? val.taskDefinitionKey : 'hhhhh'
}
switch (num) {
case '2':
query.flowType = 2
query.Sponsor = 'designInitiatorName'
query.personLiable = 'designDutyName'
query.typeOfDeliverables = 'designDeliverableType_dictText'
query.deliverableTemplate = 'designDeliverableTemplate'
break
case '3':
query.flowType = 3
query.Sponsor = 'prehomoInitiatorName'
query.personLiable = 'prehomoDutyName'
query.typeOfDeliverables = 'prehomoDeliverableType_dictText'
query.deliverableTemplate = 'prehomoDeliverableTemplate'
break
case '4':
query.flowType = 4
query.Sponsor = 'verifyInitiatorName'
query.personLiable = 'verifyDutyName'
query.typeOfDeliverables = 'verifyDeliverableType_dictText'
query.deliverableTemplate = 'verifyDeliverableTemplate'
break
}
let newUrl = this.$router.resolve({
path: '/taskListProcess',
query: query
})
window.open(newUrl.href, '_blank')
}
}
}