变更、导出任务清单接口。
This commit is contained in:
+13
@@ -35,6 +35,7 @@ import org.springframework.web.servlet.ModelAndView;
|
|||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@@ -364,4 +365,16 @@ public class ProjectLawsInventoryEOController extends JeroController<ProjectLaws
|
|||||||
return Result.OK("导入成功");
|
return Result.OK("导入成功");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@AutoLog(value = "变更")
|
||||||
|
@ApiOperation(value="变更", notes="变更")
|
||||||
|
@GetMapping(value = "/change")
|
||||||
|
public Result<?> change(@RequestParam(name="ids",required=true) String ids,
|
||||||
|
@RequestParam(name="cut",required=true) String cut) {
|
||||||
|
Map<String,Object> parmas = new HashMap<>();
|
||||||
|
parmas.put("ids",ids);
|
||||||
|
parmas.put("cut",cut);
|
||||||
|
return this.projectLawsInventoryEOService.change(parmas);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+13
-2
@@ -152,10 +152,21 @@ public class ProjectTaskInventoryEOController extends JeroController<ProjectTask
|
|||||||
* @param request
|
* @param request
|
||||||
* @param projectTaskInventoryEO
|
* @param projectTaskInventoryEO
|
||||||
*/
|
*/
|
||||||
@RequestMapping(value = "/exportXls")
|
/*@RequestMapping(value = "/exportXls")
|
||||||
public ModelAndView exportXls(HttpServletRequest request, ProjectTaskInventoryEO projectTaskInventoryEO) {
|
public ModelAndView exportXls(HttpServletRequest request, ProjectTaskInventoryEO projectTaskInventoryEO) {
|
||||||
return super.exportXls(request, projectTaskInventoryEO, ProjectTaskInventoryEO.class, "项目库-任务清单表");
|
return super.exportXls(request, projectTaskInventoryEO, ProjectTaskInventoryEO.class, "项目库-任务清单表");
|
||||||
}
|
}*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出excel
|
||||||
|
*
|
||||||
|
* @param request
|
||||||
|
* @param projectTaskInventoryEO
|
||||||
|
*/
|
||||||
|
@RequestMapping(value = "/exportXls")
|
||||||
|
public void exportXls(HttpServletResponse response,HttpServletRequest request, ProjectTaskInventoryEO projectTaskInventoryEO) {
|
||||||
|
projectTaskInventoryEOService.exportXls(response,request, projectTaskInventoryEO);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过excel导入数据
|
* 通过excel导入数据
|
||||||
|
|||||||
+40
-6
@@ -70,12 +70,12 @@ public class ProjectTaskInventoryEO implements Serializable {
|
|||||||
private String projectLawsInventoryId;
|
private String projectLawsInventoryId;
|
||||||
|
|
||||||
/**设计符合性流程状态*/
|
/**设计符合性流程状态*/
|
||||||
@Excel(name = "设计符合性流程状态", width = 15)
|
@Excel(name = "设计-流程状态", width = 15)
|
||||||
@ApiModelProperty(value = "设计符合性流程状态")
|
@ApiModelProperty(value = "设计符合性流程状态")
|
||||||
private String designStatus;
|
private String designStatus;
|
||||||
|
|
||||||
/**设计符合性流程-任务状态*/
|
/**设计符合性流程-任务状态*/
|
||||||
@Excel(name = "设计符合性流程-任务状态", width = 15)
|
@Excel(name = "设计-任务状态", width = 15)
|
||||||
@ApiModelProperty(value = "设计符合性流程-任务状态")
|
@ApiModelProperty(value = "设计符合性流程-任务状态")
|
||||||
private String designFlowTaskStatus;
|
private String designFlowTaskStatus;
|
||||||
|
|
||||||
@@ -85,12 +85,12 @@ public class ProjectTaskInventoryEO implements Serializable {
|
|||||||
private String designPId;
|
private String designPId;
|
||||||
|
|
||||||
/**prehomo确认流程状态*/
|
/**prehomo确认流程状态*/
|
||||||
@Excel(name = "prehomo确认流程状态", width = 15)
|
@Excel(name = "prehomo-流程状态", width = 15)
|
||||||
@ApiModelProperty(value = "prehomo确认流程状态")
|
@ApiModelProperty(value = "prehomo确认流程状态")
|
||||||
private String prehomoStatus;
|
private String prehomoStatus;
|
||||||
|
|
||||||
/**prehomo确认流程-任务状态*/
|
/**prehomo确认流程-任务状态*/
|
||||||
@Excel(name = "prehomo确认流程-任务状态", width = 15)
|
@Excel(name = "prehomo-任务状态", width = 15)
|
||||||
@ApiModelProperty(value = "prehomo确认流程-任务状态")
|
@ApiModelProperty(value = "prehomo确认流程-任务状态")
|
||||||
private String prehomoFlowTaskStatus;
|
private String prehomoFlowTaskStatus;
|
||||||
|
|
||||||
@@ -100,12 +100,12 @@ public class ProjectTaskInventoryEO implements Serializable {
|
|||||||
private String prehomoPId;
|
private String prehomoPId;
|
||||||
|
|
||||||
/**验证符合性流程状态*/
|
/**验证符合性流程状态*/
|
||||||
@Excel(name = "验证符合性流程状态", width = 15)
|
@Excel(name = "verify-流程状态", width = 15)
|
||||||
@ApiModelProperty(value = "验证符合性流程状态")
|
@ApiModelProperty(value = "验证符合性流程状态")
|
||||||
private String verifyStatus;
|
private String verifyStatus;
|
||||||
|
|
||||||
/**验证符合性流程-任务状态*/
|
/**验证符合性流程-任务状态*/
|
||||||
@Excel(name = "验证符合性流程-任务状态", width = 15)
|
@Excel(name = "verify-任务状态", width = 15)
|
||||||
@ApiModelProperty(value = "验证符合性流程-任务状态")
|
@ApiModelProperty(value = "验证符合性流程-任务状态")
|
||||||
private String verifyFlowTaskStatus;
|
private String verifyFlowTaskStatus;
|
||||||
|
|
||||||
@@ -136,15 +136,18 @@ public class ProjectTaskInventoryEO implements Serializable {
|
|||||||
|
|
||||||
/**编号**/
|
/**编号**/
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
|
@Excel(name = "编号", width = 20)
|
||||||
private String serialNumber;
|
private String serialNumber;
|
||||||
|
|
||||||
/**标题**/
|
/**标题**/
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
|
@Excel(name = "标题", width = 20)
|
||||||
private String title;
|
private String title;
|
||||||
|
|
||||||
/**责任领域**/
|
/**责任领域**/
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
@Dict(dicCode ="duty_territory")
|
@Dict(dicCode ="duty_territory")
|
||||||
|
@Excel(name = "责任领域", width = 20)
|
||||||
private String dutyTerritory;
|
private String dutyTerritory;
|
||||||
|
|
||||||
/**设计符合性 待办id**/
|
/**设计符合性 待办id**/
|
||||||
@@ -168,8 +171,19 @@ public class ProjectTaskInventoryEO implements Serializable {
|
|||||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||||
@ApiModelProperty(value = "设计符合性确认-截止时间")
|
@ApiModelProperty(value = "设计符合性确认-截止时间")
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
|
@Excel(name = "截止时间", width = 20, format = "yyyy-MM-dd")
|
||||||
private Date designDueDate;
|
private Date designDueDate;
|
||||||
|
|
||||||
|
/**设计符合性确认-发起人名称*/
|
||||||
|
@Excel(name = "设计-发起人", width = 20)
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String designInitiatorName;
|
||||||
|
|
||||||
|
/**设计符合性确认-责任人名称*/
|
||||||
|
@Excel(name = "设计-责任人", width = 20)
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String designDutyName;
|
||||||
|
|
||||||
/**验证符合性 待办id**/
|
/**验证符合性 待办id**/
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private String verifyTaskId;
|
private String verifyTaskId;
|
||||||
@@ -192,6 +206,16 @@ public class ProjectTaskInventoryEO implements Serializable {
|
|||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private Date verifyDueDate;
|
private Date verifyDueDate;
|
||||||
|
|
||||||
|
/**验证符合性-发起人名称*/
|
||||||
|
@Excel(name = "验证-发起人", width = 20)
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String verifyInitiatorName;
|
||||||
|
|
||||||
|
/**验证符合性-责任人名称*/
|
||||||
|
@Excel(name = "验证-责任人", width = 20)
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String verifyDutyName;
|
||||||
|
|
||||||
|
|
||||||
/**prehomo确认 待办id**/
|
/**prehomo确认 待办id**/
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
@@ -215,6 +239,16 @@ public class ProjectTaskInventoryEO implements Serializable {
|
|||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private Date prehomoDueDate;
|
private Date prehomoDueDate;
|
||||||
|
|
||||||
|
/**prehomo确认-发起人名称*/
|
||||||
|
@Excel(name = "prehomo-发起人", width = 20)
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String prehomoInitiatorName;
|
||||||
|
|
||||||
|
/**prehomo确认-责任人名称*/
|
||||||
|
@Excel(name = "prehomo-责任人", width = 20)
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String prehomoDutyName;
|
||||||
|
|
||||||
/** 展示标识 1展示 **/
|
/** 展示标识 1展示 **/
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private String showFlag;
|
private String showFlag;
|
||||||
|
|||||||
+9
-2
@@ -1,5 +1,8 @@
|
|||||||
package com.jero.modules.project.enums;
|
package com.jero.modules.project.enums;
|
||||||
|
|
||||||
|
import com.alibaba.druid.util.StringUtils;
|
||||||
|
import com.jero.common.constant.enums.CutEnum;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 认证进度枚举类
|
* 认证进度枚举类
|
||||||
*/
|
*/
|
||||||
@@ -35,11 +38,15 @@ public enum CertificationProgressEnum {
|
|||||||
this.value = value;
|
this.value = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getTextByValue(String value) {
|
public static String getTextByValue(String value,String cut) {
|
||||||
CertificationProgressEnum[] values = values();
|
CertificationProgressEnum[] values = values();
|
||||||
for (CertificationProgressEnum certificationProgressEnum : values) {
|
for (CertificationProgressEnum certificationProgressEnum : values) {
|
||||||
if (certificationProgressEnum.value.equals(value)) {
|
if (certificationProgressEnum.value.equals(value)) {
|
||||||
return certificationProgressEnum.name;
|
if(StringUtils.equals(cut, CutEnum.CN.getValue())){
|
||||||
|
return certificationProgressEnum.name;
|
||||||
|
}else {
|
||||||
|
return certificationProgressEnum.value;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
+24
-7
@@ -1,22 +1,27 @@
|
|||||||
package com.jero.modules.project.enums;
|
package com.jero.modules.project.enums;
|
||||||
|
|
||||||
|
import com.alibaba.druid.util.StringUtils;
|
||||||
|
import com.jero.common.constant.enums.CutEnum;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 当前项目状态枚举类
|
* 当前项目状态枚举类
|
||||||
*/
|
*/
|
||||||
public enum CurrentProjectStatusEnum {
|
public enum CurrentProjectStatusEnum {
|
||||||
|
|
||||||
BLUE("蓝色","0"),
|
BLUE("蓝色","0","blue"),
|
||||||
RED("红色","1"),
|
RED("红色","1","red"),
|
||||||
YELLOW("黄色","2"),
|
YELLOW("黄色","2","yellow"),
|
||||||
GREEN("绿色","3"),
|
GREEN("绿色","3","green"),
|
||||||
;
|
;
|
||||||
|
|
||||||
String name;
|
String name;
|
||||||
String value;
|
String value;
|
||||||
|
String enName;
|
||||||
|
|
||||||
private CurrentProjectStatusEnum(String name, String value) {
|
private CurrentProjectStatusEnum(String name, String value,String enName) {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
this.value = value;
|
this.value = value;
|
||||||
|
this.enName = enName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getName() {
|
public String getName() {
|
||||||
@@ -35,11 +40,23 @@ public enum CurrentProjectStatusEnum {
|
|||||||
this.value = value;
|
this.value = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getTextByValue(String value) {
|
public String getEnName() {
|
||||||
|
return enName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEnName(String enName) {
|
||||||
|
this.enName = enName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getTextByValue(String value, String cut) {
|
||||||
CurrentProjectStatusEnum[] values = values();
|
CurrentProjectStatusEnum[] values = values();
|
||||||
for (CurrentProjectStatusEnum currentProjectStatusEnum : values) {
|
for (CurrentProjectStatusEnum currentProjectStatusEnum : values) {
|
||||||
if (currentProjectStatusEnum.value.equals(value)) {
|
if (currentProjectStatusEnum.value.equals(value)) {
|
||||||
return currentProjectStatusEnum.name;
|
if(StringUtils.equals(cut, CutEnum.CN.getValue())){
|
||||||
|
return currentProjectStatusEnum.name;
|
||||||
|
}else if(StringUtils.equals(cut, CutEnum.EN.getValue())){
|
||||||
|
return currentProjectStatusEnum.enName;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
+5
@@ -3,6 +3,7 @@ package com.jero.modules.project.service;
|
|||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.jero.common.api.vo.Result;
|
import com.jero.common.api.vo.Result;
|
||||||
|
import com.jero.common.system.vo.LoginUser;
|
||||||
import com.jero.modules.project.entity.ProjectLawsInventoryEO;
|
import com.jero.modules.project.entity.ProjectLawsInventoryEO;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
@@ -114,4 +115,8 @@ public interface IProjectLawsInventoryEOService extends IService<ProjectLawsInve
|
|||||||
|
|
||||||
void importData(MultipartFile file,
|
void importData(MultipartFile file,
|
||||||
ProjectLawsInventoryEO projectLawsInventoryEO);
|
ProjectLawsInventoryEO projectLawsInventoryEO);
|
||||||
|
|
||||||
|
void dataDispose(List<ProjectLawsInventoryEO> list, LoginUser currentUser, int isProjectRole, String cut);
|
||||||
|
|
||||||
|
Result<?> change(Map<String, Object> parmas);
|
||||||
}
|
}
|
||||||
|
|||||||
+3
@@ -6,6 +6,7 @@ import com.jero.modules.project.entity.ProjectTaskInventoryEO;
|
|||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -82,4 +83,6 @@ public interface IProjectTaskInventoryEOService extends IService<ProjectTaskInve
|
|||||||
* @param projectLawsInventoryIds
|
* @param projectLawsInventoryIds
|
||||||
*/
|
*/
|
||||||
void deleteByProjectLawsInventoryIds(List<String> projectLawsInventoryIds);
|
void deleteByProjectLawsInventoryIds(List<String> projectLawsInventoryIds);
|
||||||
|
|
||||||
|
void exportXls(HttpServletResponse response, HttpServletRequest request, ProjectTaskInventoryEO projectTaskInventoryEO);
|
||||||
}
|
}
|
||||||
|
|||||||
+46
-3
@@ -34,9 +34,7 @@ import com.jero.modules.project.enums.ProjectRoleEnum;
|
|||||||
import com.jero.modules.project.enums.RequestSourceEnum;
|
import com.jero.modules.project.enums.RequestSourceEnum;
|
||||||
import com.jero.modules.project.enums.TaskAffirmStatusEnum;
|
import com.jero.modules.project.enums.TaskAffirmStatusEnum;
|
||||||
import com.jero.modules.project.mapper.*;
|
import com.jero.modules.project.mapper.*;
|
||||||
import com.jero.modules.project.service.IProjectLawsInventoryEOService;
|
import com.jero.modules.project.service.*;
|
||||||
import com.jero.modules.project.service.IProjectTaskInventoryEOService;
|
|
||||||
import com.jero.modules.project.service.IProjectRelatedPersonnelService;
|
|
||||||
import com.jero.modules.split.common.FileUnZip;
|
import com.jero.modules.split.common.FileUnZip;
|
||||||
import com.jero.modules.system.entity.SysAnnouncement;
|
import com.jero.modules.system.entity.SysAnnouncement;
|
||||||
import com.jero.modules.system.entity.SysCategory;
|
import com.jero.modules.system.entity.SysCategory;
|
||||||
@@ -143,6 +141,12 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
|
|||||||
@Autowired
|
@Autowired
|
||||||
private IProjectTaskInventoryEOService projectTaskInventoryEOService;
|
private IProjectTaskInventoryEOService projectTaskInventoryEOService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IProjectTaskInventoryDetailEOService projectTaskInventoryDetailEOService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IProjectTaskInventoryFeedbackEOService projectTaskInventoryFeedbackEOService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private IDummyInventoryInfoEOService dummyInventoryInfoEOService;
|
private IDummyInventoryInfoEOService dummyInventoryInfoEOService;
|
||||||
@Value(value = "${jero.path.upload}")
|
@Value(value = "${jero.path.upload}")
|
||||||
@@ -395,6 +399,7 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
|
|||||||
* 数据处理
|
* 数据处理
|
||||||
* @param list
|
* @param list
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void dataDispose(List<ProjectLawsInventoryEO> list,LoginUser currentUser,int isProjectRole,String cut){
|
public void dataDispose(List<ProjectLawsInventoryEO> list,LoginUser currentUser,int isProjectRole,String cut){
|
||||||
if(CollectionUtils.isNotEmpty(list)){
|
if(CollectionUtils.isNotEmpty(list)){
|
||||||
List<String> userIdList = new ArrayList<>();
|
List<String> userIdList = new ArrayList<>();
|
||||||
@@ -1838,6 +1843,44 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Result<?> change(Map<String, Object> parmas) {
|
||||||
|
List<String> idList = Arrays.asList(parmas.get("ids").toString().split(","));
|
||||||
|
if(CollectionUtils.isNotEmpty(idList)){
|
||||||
|
QueryWrapper<ProjectLawsInventoryEO> updateLawsInventoryWrapper = new QueryWrapper<>();
|
||||||
|
updateLawsInventoryWrapper.lambda().in(ProjectLawsInventoryEO::getId,idList);
|
||||||
|
ProjectLawsInventoryEO projectLawsInventoryEO = new ProjectLawsInventoryEO();
|
||||||
|
projectLawsInventoryEO.setInventoryAffirmStatus(InventoryAffirmStatusEnum.NOT_STARTED.getValue());
|
||||||
|
projectLawsInventoryEO.setTaskAffirmStatus(TaskAffirmStatusEnum.NOT_STARTED.getValue());
|
||||||
|
//清单、任务确认初始化。
|
||||||
|
this.baseMapper.update(projectLawsInventoryEO,updateLawsInventoryWrapper);
|
||||||
|
|
||||||
|
//项目任务清单数据初始化。
|
||||||
|
List<ProjectTaskInventoryEO> projectTaskInventoryEOList = new ArrayList<>();
|
||||||
|
idList.forEach(id -> {
|
||||||
|
ProjectTaskInventoryEO projectTaskInventoryEO = new ProjectTaskInventoryEO();
|
||||||
|
String projectTaskInventoryId = UUID.randomUUID().toString().replace("-", "");
|
||||||
|
projectTaskInventoryEO.setId(projectTaskInventoryId);
|
||||||
|
projectTaskInventoryEO.setProjectLawsInventoryId(id);
|
||||||
|
projectTaskInventoryEOList.add(projectTaskInventoryEO);
|
||||||
|
});
|
||||||
|
this.projectTaskInventoryEOService.deleteByProjectLawsInventoryIds(idList);
|
||||||
|
this.projectTaskInventoryEOService.saveBatch(projectTaskInventoryEOList);
|
||||||
|
|
||||||
|
//删除该法规的任务明细数据
|
||||||
|
QueryWrapper<ProjectTaskInventoryDetailEO> deleteTaskInventoryDetailWrapper = new QueryWrapper<>();
|
||||||
|
deleteTaskInventoryDetailWrapper.lambda().in(ProjectTaskInventoryDetailEO::getProjectTaskInventoryId,idList);
|
||||||
|
this.projectTaskInventoryDetailEOService.remove(deleteTaskInventoryDetailWrapper);
|
||||||
|
|
||||||
|
//删除反馈意见数据
|
||||||
|
QueryWrapper<ProjectTaskInventoryFeedbackEO> deleteTaskInventoryFeedbackWrapper = new QueryWrapper<>();
|
||||||
|
deleteTaskInventoryFeedbackWrapper.lambda().in(ProjectTaskInventoryFeedbackEO::getProjectTaskInventoryId,idList);
|
||||||
|
this.projectTaskInventoryFeedbackEOService.remove(deleteTaskInventoryFeedbackWrapper);
|
||||||
|
|
||||||
|
}
|
||||||
|
return Result.OK("变更成功!");
|
||||||
|
}
|
||||||
|
|
||||||
private void importDatas(List<ProjectLawsInventoryEO> dataList,
|
private void importDatas(List<ProjectLawsInventoryEO> dataList,
|
||||||
List<SysDictItem> dictItemList,
|
List<SysDictItem> dictItemList,
|
||||||
String zipEntryName,
|
String zipEntryName,
|
||||||
|
|||||||
+243
@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONArray;
|
|||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.jero.common.api.vo.Result;
|
import com.jero.common.api.vo.Result;
|
||||||
|
import com.jero.common.constant.enums.CutEnum;
|
||||||
import com.jero.common.exception.JeroBootException;
|
import com.jero.common.exception.JeroBootException;
|
||||||
import com.jero.common.system.query.QueryGenerator;
|
import com.jero.common.system.query.QueryGenerator;
|
||||||
import com.jero.common.system.vo.LoginUser;
|
import com.jero.common.system.vo.LoginUser;
|
||||||
@@ -11,23 +12,34 @@ import com.jero.modules.project.entity.*;
|
|||||||
import com.jero.modules.project.enums.*;
|
import com.jero.modules.project.enums.*;
|
||||||
import com.jero.modules.project.mapper.*;
|
import com.jero.modules.project.mapper.*;
|
||||||
import com.jero.modules.project.service.IConditionAssessmentEOService;
|
import com.jero.modules.project.service.IConditionAssessmentEOService;
|
||||||
|
import com.jero.modules.project.service.IProjectLawsInventoryEOService;
|
||||||
import com.jero.modules.project.service.IProjectTaskInventoryEOService;
|
import com.jero.modules.project.service.IProjectTaskInventoryEOService;
|
||||||
import com.jero.modules.project.util.SendMessageUtils;
|
import com.jero.modules.project.util.SendMessageUtils;
|
||||||
|
import com.jero.modules.system.entity.SysDictItem;
|
||||||
import com.jero.modules.system.entity.SysUser;
|
import com.jero.modules.system.entity.SysUser;
|
||||||
import com.jero.modules.system.mapper.SysUserMapper;
|
import com.jero.modules.system.mapper.SysUserMapper;
|
||||||
|
import com.jero.modules.system.service.impl.SysDictItemServiceImpl;
|
||||||
import com.jero.modules.wkflow.enums.FlowTypeEnum;
|
import com.jero.modules.wkflow.enums.FlowTypeEnum;
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.apache.poi.hssf.usermodel.HSSFSheet;
|
||||||
|
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
||||||
|
import org.apache.poi.ss.usermodel.*;
|
||||||
|
import org.apache.poi.ss.util.CellRangeAddress;
|
||||||
import org.apache.shiro.SecurityUtils;
|
import org.apache.shiro.SecurityUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.OutputStream;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: 项目库-任务清单表
|
* @Description: 项目库-任务清单表
|
||||||
@@ -56,6 +68,12 @@ public class ProjectTaskInventoryEOServiceImpl extends ServiceImpl<ProjectTaskIn
|
|||||||
@Autowired
|
@Autowired
|
||||||
private IConditionAssessmentEOService conditionAssessmentEOService;
|
private IConditionAssessmentEOService conditionAssessmentEOService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IProjectLawsInventoryEOService projectLawsInventoryEOService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private SysDictItemServiceImpl sysDictItemServiceImpl;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 保存
|
* 保存
|
||||||
*
|
*
|
||||||
@@ -611,4 +629,229 @@ public class ProjectTaskInventoryEOServiceImpl extends ServiceImpl<ProjectTaskIn
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void exportXls(HttpServletResponse response, HttpServletRequest request, ProjectTaskInventoryEO projectTaskInventoryEO) {
|
||||||
|
List<ProjectTaskInventoryEO> exportData = createExportData(request, projectTaskInventoryEO);
|
||||||
|
|
||||||
|
String firstLineTitle = "";
|
||||||
|
String secondLineTitle = "";
|
||||||
|
if(StringUtils.equals(projectTaskInventoryEO.getCut(),CutEnum.CN.getValue())){
|
||||||
|
firstLineTitle = "设计符合性确认,Pre-Homo确认,验证符合性确认";
|
||||||
|
secondLineTitle = "编号,标题,责任领域," +
|
||||||
|
"发起人,责任人,截止时间,流程状态,任务状态,"+
|
||||||
|
"发起人,责任人,截止时间,流程状态,任务状态,"+
|
||||||
|
"发起人,责任人,截止时间,流程状态,任务状态,"+
|
||||||
|
"认证进度,项目当前状态";
|
||||||
|
}else if(StringUtils.equals(projectTaskInventoryEO.getCut(),CutEnum.EN.getValue())){
|
||||||
|
firstLineTitle = "Confirm design conformance,Pre-Homo Confirm,Verify conformance validation";
|
||||||
|
secondLineTitle = "SerialNumber,Title,Duty territory," +
|
||||||
|
"Initiator,Person in charge,Deadline,Process state,Task status,"+
|
||||||
|
"Initiator,Person in charge,Deadline,Process state,Task status,"+
|
||||||
|
"Initiator,Person in charge,Deadline,Process state,Task status,"+
|
||||||
|
"Certification progress,Current Project Status";
|
||||||
|
}
|
||||||
|
|
||||||
|
OutputStream os = null;
|
||||||
|
HSSFWorkbook workbook = new HSSFWorkbook();
|
||||||
|
|
||||||
|
try {
|
||||||
|
String fileName = "任务清单 " + ".xlsx";
|
||||||
|
response.setHeader("Content-Disposition",
|
||||||
|
"attachment; filename=" + fileName);
|
||||||
|
response.setContentType("application/force-download");
|
||||||
|
|
||||||
|
HSSFSheet sheet = workbook.createSheet("任务清单");
|
||||||
|
|
||||||
|
CellStyle titleCellStyle = workbook.createCellStyle();
|
||||||
|
titleCellStyle.setAlignment(HorizontalAlignment.CENTER);//垂直居中
|
||||||
|
titleCellStyle.setVerticalAlignment(VerticalAlignment.CENTER);//水平居中
|
||||||
|
titleCellStyle.setWrapText(true);//自动换行
|
||||||
|
|
||||||
|
setSheetStyle(sheet);
|
||||||
|
|
||||||
|
//创建表头
|
||||||
|
String[] firstLineTitleArr = firstLineTitle.split(",");
|
||||||
|
String[] secondLineTitleArr = secondLineTitle.split(",");
|
||||||
|
Row firstRow = sheet.createRow(0);
|
||||||
|
|
||||||
|
//第0行 1到3列 19到20列 设置居中、表头值。
|
||||||
|
for (int i = 0; i <= 19; i++){
|
||||||
|
if(i >= 2 || i<=18){
|
||||||
|
Cell cell = firstRow.createCell(i);
|
||||||
|
cell.setCellStyle(titleCellStyle);
|
||||||
|
cell.setCellValue(secondLineTitleArr[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Cell cell03 = firstRow.createCell(3);
|
||||||
|
cell03.setCellStyle(titleCellStyle);
|
||||||
|
cell03.setCellValue(firstLineTitleArr[0]);
|
||||||
|
|
||||||
|
Cell cell08 = firstRow.createCell(8);
|
||||||
|
cell08.setCellStyle(titleCellStyle);
|
||||||
|
cell08.setCellValue(firstLineTitleArr[1]);
|
||||||
|
|
||||||
|
Cell cell13 = firstRow.createCell(13);
|
||||||
|
cell13.setCellStyle(titleCellStyle);
|
||||||
|
cell13.setCellValue(firstLineTitleArr[2]);
|
||||||
|
|
||||||
|
Row secondRow = sheet.createRow(1);
|
||||||
|
for (int i = 0; i < secondLineTitleArr.length; i++) {
|
||||||
|
secondRow.createCell(i).setCellValue(secondLineTitleArr[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
//设置导出数据
|
||||||
|
if(CollectionUtils.isNotEmpty(exportData)) {
|
||||||
|
int rowIndex = 2;
|
||||||
|
for (int dataIndex = 0; dataIndex < exportData.size(); dataIndex++) {
|
||||||
|
Row dataRow = sheet.createRow(rowIndex);
|
||||||
|
dataRow.createCell(0).setCellValue(exportData.get(dataIndex).getSerialNumber());
|
||||||
|
dataRow.createCell(1).setCellValue(exportData.get(dataIndex).getTitle());
|
||||||
|
dataRow.createCell(2).setCellValue(exportData.get(dataIndex).getDutyTerritory());
|
||||||
|
|
||||||
|
dataRow.createCell(3).setCellValue(exportData.get(dataIndex).getDesignInitiatorName());
|
||||||
|
dataRow.createCell(4).setCellValue(exportData.get(dataIndex).getDesignDutyName());
|
||||||
|
String designDueDate = disposeDate(exportData.get(dataIndex).getDesignDueDate());
|
||||||
|
dataRow.createCell(5).setCellValue(designDueDate);
|
||||||
|
dataRow.createCell(6).setCellValue(exportData.get(dataIndex).getDesignStatus());
|
||||||
|
dataRow.createCell(7).setCellValue(exportData.get(dataIndex).getDesignFlowTaskStatus());
|
||||||
|
|
||||||
|
dataRow.createCell(8).setCellValue(exportData.get(dataIndex).getPrehomoInitiatorName());
|
||||||
|
dataRow.createCell(9).setCellValue(exportData.get(dataIndex).getPrehomoDutyName());
|
||||||
|
String prehomoDueDate = disposeDate(exportData.get(dataIndex).getPrehomoDueDate());
|
||||||
|
dataRow.createCell(10).setCellValue(prehomoDueDate);
|
||||||
|
dataRow.createCell(11).setCellValue(exportData.get(dataIndex).getPrehomoStatus());
|
||||||
|
dataRow.createCell(12).setCellValue(exportData.get(dataIndex).getPrehomoFlowTaskStatus());
|
||||||
|
|
||||||
|
dataRow.createCell(13).setCellValue(exportData.get(dataIndex).getVerifyInitiatorName());
|
||||||
|
dataRow.createCell(14).setCellValue(exportData.get(dataIndex).getVerifyDutyName());
|
||||||
|
String verifyDueDate = disposeDate(exportData.get(dataIndex).getVerifyDueDate());
|
||||||
|
dataRow.createCell(15).setCellValue(verifyDueDate);
|
||||||
|
dataRow.createCell(16).setCellValue(exportData.get(dataIndex).getVerifyStatus());
|
||||||
|
dataRow.createCell(17).setCellValue(exportData.get(dataIndex).getVerifyFlowTaskStatus());
|
||||||
|
|
||||||
|
dataRow.createCell(18).setCellValue(exportData.get(dataIndex).getCertificationProgress());
|
||||||
|
dataRow.createCell(19).setCellValue(exportData.get(dataIndex).getProjectStatusAssess());
|
||||||
|
|
||||||
|
rowIndex ++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
os = response.getOutputStream();
|
||||||
|
workbook.write(os);
|
||||||
|
os.flush();
|
||||||
|
}catch (IOException ex){
|
||||||
|
if(CutEnum.CN.getValue().equals(projectTaskInventoryEO.getCut())){
|
||||||
|
throw new JeroBootException("下载文件失败");
|
||||||
|
}else{
|
||||||
|
throw new JeroBootException("Failed to download file");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSheetStyle(HSSFSheet sheet){
|
||||||
|
for (int i = 0; i <= 19; i++){
|
||||||
|
sheet.setColumnWidth(i,4000);
|
||||||
|
}
|
||||||
|
|
||||||
|
//合并单元格 起始行,结束行,起始列,结束列
|
||||||
|
CellRangeAddress region00 = new CellRangeAddress(0, 1, 0, 0);
|
||||||
|
sheet.addMergedRegion(region00);
|
||||||
|
CellRangeAddress region01 = new CellRangeAddress(0, 1, 1, 1);
|
||||||
|
sheet.addMergedRegion(region01);
|
||||||
|
CellRangeAddress region02 = new CellRangeAddress(0, 1, 2, 2);
|
||||||
|
sheet.addMergedRegion(region02);
|
||||||
|
CellRangeAddress region03 = new CellRangeAddress(0, 0, 3, 7);
|
||||||
|
sheet.addMergedRegion(region03);
|
||||||
|
CellRangeAddress region08 = new CellRangeAddress(0, 0, 8, 12);
|
||||||
|
sheet.addMergedRegion(region08);
|
||||||
|
CellRangeAddress region13 = new CellRangeAddress(0, 0, 13, 17);
|
||||||
|
sheet.addMergedRegion(region13);
|
||||||
|
CellRangeAddress region18 = new CellRangeAddress(0, 1, 18, 18);
|
||||||
|
sheet.addMergedRegion(region18);
|
||||||
|
CellRangeAddress region19 = new CellRangeAddress(0, 1, 19, 19);
|
||||||
|
sheet.addMergedRegion(region19);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建导出的数据列表
|
||||||
|
* @param request
|
||||||
|
* @param projectTaskInventoryEO
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public List<ProjectTaskInventoryEO> createExportData(HttpServletRequest request, ProjectTaskInventoryEO projectTaskInventoryEO){
|
||||||
|
LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||||
|
List<ProjectTaskInventoryEO> projectTaskInventoryEOList = queryList(projectTaskInventoryEO, request);
|
||||||
|
|
||||||
|
|
||||||
|
if(CollectionUtils.isNotEmpty(projectTaskInventoryEOList)){
|
||||||
|
List<String> projectLawsInventoryIdList = projectTaskInventoryEOList.stream().
|
||||||
|
distinct().map(ProjectTaskInventoryEO::getProjectLawsInventoryId).collect(Collectors.toList());
|
||||||
|
|
||||||
|
QueryWrapper<ProjectLawsInventoryEO> lawsInventoryEOQueryWrapper = new QueryWrapper<>();
|
||||||
|
lawsInventoryEOQueryWrapper.lambda().in(ProjectLawsInventoryEO::getId,projectLawsInventoryIdList);
|
||||||
|
List<ProjectLawsInventoryEO> projectLawsInventoryEOList = this.projectLawsInventoryEOMapper.selectList(lawsInventoryEOQueryWrapper);
|
||||||
|
projectLawsInventoryEOService.dataDispose(projectLawsInventoryEOList,
|
||||||
|
currentUser,Integer.parseInt(ProjectRoleEnum.STUDIO_ENGINEER.getValue()),projectTaskInventoryEO.getCut());
|
||||||
|
|
||||||
|
List<SysDictItem> dictItemList = sysDictItemServiceImpl.selectItemsByDictCode("duty_territory");
|
||||||
|
|
||||||
|
projectTaskInventoryEOList.forEach(projectTaskInventory -> {
|
||||||
|
List<ProjectLawsInventoryEO> projectLawsInventoryEO = projectLawsInventoryEOList.stream().
|
||||||
|
filter(e -> StringUtils.equals(e.getId(), projectTaskInventory.getProjectLawsInventoryId())).collect(Collectors.toList());
|
||||||
|
if(CollectionUtils.isNotEmpty(projectLawsInventoryEO)){
|
||||||
|
//获取出 , 已经启动了 设计符合性、prehomo确认、验证符合性流程的数据
|
||||||
|
if(StringUtils.isNotEmpty(projectTaskInventory.getDesignPId())){
|
||||||
|
projectTaskInventory.setDesignDutyName(projectLawsInventoryEO.get(0).getDesignDutyName());
|
||||||
|
projectTaskInventory.setDesignInitiatorName(projectLawsInventoryEO.get(0).getDesignInitiatorName());
|
||||||
|
projectTaskInventory.setDesignFlowTaskStatus(ReviewResultEnum.getTextByValue(projectTaskInventory.getDesignFlowTaskStatus(),projectTaskInventoryEO.getCut()));
|
||||||
|
}else {
|
||||||
|
projectTaskInventory.setDesignDueDate(null);
|
||||||
|
}
|
||||||
|
if(StringUtils.isNotEmpty(projectTaskInventory.getPrehomoPId())){
|
||||||
|
projectTaskInventory.setPrehomoDutyName(projectLawsInventoryEO.get(0).getPrehomoDutyName());
|
||||||
|
projectTaskInventory.setPrehomoInitiatorName(projectLawsInventoryEO.get(0).getPrehomoInitiatorName());
|
||||||
|
projectTaskInventory.setPrehomoFlowTaskStatus(ReviewResultEnum.getTextByValue(projectTaskInventory.getPrehomoFlowTaskStatus(),projectTaskInventoryEO.getCut()));
|
||||||
|
}else {
|
||||||
|
projectTaskInventory.setPrehomoDueDate(null);
|
||||||
|
}
|
||||||
|
if(StringUtils.isNotEmpty(projectTaskInventory.getVerifyPId())){
|
||||||
|
projectTaskInventory.setVerifyDutyName(projectLawsInventoryEO.get(0).getVerifyDutyName());
|
||||||
|
projectTaskInventory.setVerifyInitiatorName(projectLawsInventoryEO.get(0).getVerifyInitiatorName());
|
||||||
|
projectTaskInventory.setVerifyFlowTaskStatus(ReviewResultEnum.getTextByValue(projectTaskInventory.getVerifyFlowTaskStatus(),projectTaskInventoryEO.getCut()));
|
||||||
|
}else {
|
||||||
|
projectTaskInventory.setVerifyDueDate(null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
projectTaskInventory.setCertificationProgress(CertificationProgressEnum.getTextByValue(projectTaskInventory.getCertificationProgress(),projectTaskInventoryEO.getCut()));
|
||||||
|
projectTaskInventory.setProjectStatusAssess(CurrentProjectStatusEnum.getTextByValue(projectTaskInventory.getProjectStatusAssess(),projectTaskInventoryEO.getCut()));
|
||||||
|
|
||||||
|
if(StringUtils.isNotEmpty(projectTaskInventory.getDutyTerritory())){
|
||||||
|
List<SysDictItem> collect = dictItemList.stream().filter(dict -> StringUtils.equals(dict.getItemValue(), projectTaskInventory.getDutyTerritory())).collect(Collectors.toList());
|
||||||
|
if(StringUtils.equals(projectTaskInventoryEO.getCut(),CutEnum.CN.getValue())){
|
||||||
|
projectTaskInventory.setDutyTerritory(collect.get(0).getItemText());
|
||||||
|
}else if(StringUtils.equals(projectTaskInventoryEO.getCut(),CutEnum.EN.getValue())){
|
||||||
|
projectTaskInventory.setDutyTerritory(collect.get(0).getEnName());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return projectTaskInventoryEOList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String disposeDate(Date date){
|
||||||
|
String result = "";
|
||||||
|
try {
|
||||||
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||||
|
if(date != null){
|
||||||
|
result = sdf.format(date);
|
||||||
|
}
|
||||||
|
}catch (Exception ex){
|
||||||
|
ex.printStackTrace();
|
||||||
|
log.error("处理日期失败:" +ex.getMessage());
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user