发起清单确认。
This commit is contained in:
+15
-7
@@ -1,14 +1,9 @@
|
|||||||
package com.jero.modules.project.entity;
|
package com.jero.modules.project.entity;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.io.UnsupportedEncodingException;
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import org.springframework.format.annotation.DateTimeFormat;
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
@@ -18,7 +13,6 @@ import io.swagger.annotations.ApiModel;
|
|||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
import lombok.experimental.Accessors;
|
import lombok.experimental.Accessors;
|
||||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -172,6 +166,10 @@ public class ProjectLawsInventoryEO implements Serializable {
|
|||||||
@ApiModelProperty(value = "设计符合性确认-交付物模板")
|
@ApiModelProperty(value = "设计符合性确认-交付物模板")
|
||||||
private String designDeliverableTemplate;
|
private String designDeliverableTemplate;
|
||||||
|
|
||||||
|
/**设计符合性确认-交付物模板名称*/
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String designDeliverableTemplateName;
|
||||||
|
|
||||||
/**设计符合性确认-发起人*/
|
/**设计符合性确认-发起人*/
|
||||||
@Excel(name = "设计符合性确认-发起人", width = 15)
|
@Excel(name = "设计符合性确认-发起人", width = 15)
|
||||||
@ApiModelProperty(value = "设计符合性确认-发起人")
|
@ApiModelProperty(value = "设计符合性确认-发起人")
|
||||||
@@ -201,6 +199,10 @@ public class ProjectLawsInventoryEO implements Serializable {
|
|||||||
@ApiModelProperty(value = "prehomo确认-交付物模板")
|
@ApiModelProperty(value = "prehomo确认-交付物模板")
|
||||||
private String prehomoDeliverableTemplate;
|
private String prehomoDeliverableTemplate;
|
||||||
|
|
||||||
|
/**prehomo确认-交付物模板名称*/
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String prehomoDeliverableTemplateName;
|
||||||
|
|
||||||
/**prehomo确认-发起人*/
|
/**prehomo确认-发起人*/
|
||||||
@Excel(name = "prehomo确认-发起人", width = 15)
|
@Excel(name = "prehomo确认-发起人", width = 15)
|
||||||
@ApiModelProperty(value = "prehomo确认-发起人")
|
@ApiModelProperty(value = "prehomo确认-发起人")
|
||||||
@@ -230,6 +232,10 @@ public class ProjectLawsInventoryEO implements Serializable {
|
|||||||
@ApiModelProperty(value = "验证符合性确认-交付物模板")
|
@ApiModelProperty(value = "验证符合性确认-交付物模板")
|
||||||
private String verifyDeliverableTemplate;
|
private String verifyDeliverableTemplate;
|
||||||
|
|
||||||
|
/**验证符合性确认-交付物模板名称*/
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String verifyDeliverableTemplateName;
|
||||||
|
|
||||||
/**验证符合性确认-发起人*/
|
/**验证符合性确认-发起人*/
|
||||||
@Excel(name = "验证符合性确认-发起人", width = 15)
|
@Excel(name = "验证符合性确认-发起人", width = 15)
|
||||||
@ApiModelProperty(value = "验证符合性确认-发起人")
|
@ApiModelProperty(value = "验证符合性确认-发起人")
|
||||||
@@ -276,10 +282,12 @@ public class ProjectLawsInventoryEO implements Serializable {
|
|||||||
|
|
||||||
/**法规工程师提交状态 :0通过 1驳回 */
|
/**法规工程师提交状态 :0通过 1驳回 */
|
||||||
@ApiModelProperty(value = "法规工程师提交状态")
|
@ApiModelProperty(value = "法规工程师提交状态")
|
||||||
|
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||||
private String regulationOwnerSubmitStatus;
|
private String regulationOwnerSubmitStatus;
|
||||||
//这两个只要有一个是拒绝 那么该数据的清单确认状态就为拒绝
|
//这两个只要有一个是拒绝 那么该数据的清单确认状态就为拒绝
|
||||||
/**认证工程师提交状态 :0通过 1驳回 */
|
/**认证工程师提交状态 :0通过 1驳回 */
|
||||||
@ApiModelProperty(value = "认证工程师提交状态")
|
@ApiModelProperty(value = "认证工程师提交状态")
|
||||||
|
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||||
private String homologationEngineerSubmitStatus;
|
private String homologationEngineerSubmitStatus;
|
||||||
|
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
|
|||||||
+81
-12
@@ -2,12 +2,15 @@ package com.jero.modules.project.service.impl;
|
|||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
import com.jero.common.api.vo.Result;
|
import com.jero.common.api.vo.Result;
|
||||||
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;
|
||||||
import com.jero.modules.document.entity.BussDocumentLibraryEO;
|
import com.jero.modules.document.entity.BussDocumentLibraryEO;
|
||||||
import com.jero.modules.document.service.IBussDocumentLibraryEOService;
|
import com.jero.modules.document.service.IBussDocumentLibraryEOService;
|
||||||
|
import com.jero.modules.oss.entity.OSSFile;
|
||||||
|
import com.jero.modules.oss.service.IOSSFileService;
|
||||||
import com.jero.modules.project.entity.ProjectLawsInventoryEO;
|
import com.jero.modules.project.entity.ProjectLawsInventoryEO;
|
||||||
import com.jero.modules.project.entity.ProjectLibraryBase;
|
import com.jero.modules.project.entity.ProjectLibraryBase;
|
||||||
import com.jero.modules.project.enums.*;
|
import com.jero.modules.project.enums.*;
|
||||||
@@ -23,6 +26,7 @@ import org.springframework.beans.BeanUtils;
|
|||||||
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.text.SimpleDateFormat;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@@ -48,6 +52,9 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
|
|||||||
@Autowired
|
@Autowired
|
||||||
private IBussDocumentLibraryEOService iBussDocumentLibraryEOService;
|
private IBussDocumentLibraryEOService iBussDocumentLibraryEOService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IOSSFileService iOSSFileService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 保存
|
* 保存
|
||||||
*
|
*
|
||||||
@@ -170,6 +177,7 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
|
|||||||
public void dataDispose(List<ProjectLawsInventoryEO> list,LoginUser currentUser,int isProjectRole){
|
public void dataDispose(List<ProjectLawsInventoryEO> list,LoginUser currentUser,int isProjectRole){
|
||||||
if(CollectionUtils.isNotEmpty(list)){
|
if(CollectionUtils.isNotEmpty(list)){
|
||||||
List<String> userIdList = new ArrayList<>();
|
List<String> userIdList = new ArrayList<>();
|
||||||
|
List<String> deliverableList = new ArrayList<>();
|
||||||
for (ProjectLawsInventoryEO projectLawsInventoryEO : list) {
|
for (ProjectLawsInventoryEO projectLawsInventoryEO : list) {
|
||||||
if(StringUtils.isNotEmpty(projectLawsInventoryEO.getHomologationEngineerId())){
|
if(StringUtils.isNotEmpty(projectLawsInventoryEO.getHomologationEngineerId())){
|
||||||
userIdList.add(projectLawsInventoryEO.getHomologationEngineerId());
|
userIdList.add(projectLawsInventoryEO.getHomologationEngineerId());
|
||||||
@@ -180,6 +188,19 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
|
|||||||
if(StringUtils.isNotEmpty(projectLawsInventoryEO.getEngineeringInterfacePerson())){
|
if(StringUtils.isNotEmpty(projectLawsInventoryEO.getEngineeringInterfacePerson())){
|
||||||
userIdList.add(projectLawsInventoryEO.getEngineeringInterfacePerson());
|
userIdList.add(projectLawsInventoryEO.getEngineeringInterfacePerson());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//设计符合性确认交付物模板
|
||||||
|
if(StringUtils.isNotBlank(projectLawsInventoryEO.getDesignDeliverableTemplate())){
|
||||||
|
deliverableList.addAll(Arrays.asList(projectLawsInventoryEO.getDesignDeliverableTemplate().split(",")));
|
||||||
|
}
|
||||||
|
// Prehomo确认交付物模板
|
||||||
|
if(StringUtils.isNotBlank(projectLawsInventoryEO.getPrehomoDeliverableTemplate())){
|
||||||
|
deliverableList.addAll(Arrays.asList(projectLawsInventoryEO.getPrehomoDeliverableTemplate().split(",")));
|
||||||
|
}
|
||||||
|
// 验证符合性确认交付物模板
|
||||||
|
if(StringUtils.isNotBlank(projectLawsInventoryEO.getVerifyDeliverableTemplate())){
|
||||||
|
deliverableList.addAll(Arrays.asList(projectLawsInventoryEO.getVerifyDeliverableTemplate().split(",")));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
List<SysUser> sysUsers = new ArrayList<>();
|
List<SysUser> sysUsers = new ArrayList<>();
|
||||||
@@ -190,6 +211,12 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
|
|||||||
sysUsers = sysUserMapper.selectList(sysUserQueryWrapper);
|
sysUsers = sysUserMapper.selectList(sysUserQueryWrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//文件
|
||||||
|
List<OSSFile> fileInfos = new ArrayList<>();
|
||||||
|
if(deliverableList.size() != 0){
|
||||||
|
fileInfos = iOSSFileService.getFileInfos(org.apache.commons.lang3.StringUtils.join(deliverableList, ","));
|
||||||
|
}
|
||||||
|
|
||||||
for (ProjectLawsInventoryEO projectLawsInventoryEO : list) {
|
for (ProjectLawsInventoryEO projectLawsInventoryEO : list) {
|
||||||
//处理人员展示名称
|
//处理人员展示名称
|
||||||
if(CollectionUtils.isNotEmpty(sysUsers)){
|
if(CollectionUtils.isNotEmpty(sysUsers)){
|
||||||
@@ -245,10 +272,46 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
|
|||||||
}
|
}
|
||||||
projectLawsInventoryEO.setRoleCode(roleCode);
|
projectLawsInventoryEO.setRoleCode(roleCode);
|
||||||
projectLawsInventoryEO.setRoleName(roleName);
|
projectLawsInventoryEO.setRoleName(roleName);
|
||||||
|
|
||||||
|
//交付物类型模板
|
||||||
|
if(fileInfos.size() != 0){
|
||||||
|
if(StringUtils.isNotBlank(projectLawsInventoryEO.getDesignDeliverableTemplate())){
|
||||||
|
String fileName = getFileName(projectLawsInventoryEO, fileInfos,projectLawsInventoryEO.getDesignDeliverableTemplate());
|
||||||
|
if(org.apache.commons.lang3.StringUtils.isNotBlank(fileName)){
|
||||||
|
projectLawsInventoryEO.setDesignDeliverableTemplateName(fileName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(StringUtils.isNotBlank(projectLawsInventoryEO.getPrehomoDeliverableTemplate())){
|
||||||
|
String fileName = getFileName(projectLawsInventoryEO, fileInfos,projectLawsInventoryEO.getPrehomoDeliverableTemplate());
|
||||||
|
if(org.apache.commons.lang3.StringUtils.isNotBlank(fileName)){
|
||||||
|
projectLawsInventoryEO.setPrehomoDeliverableTemplateName(fileName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(StringUtils.isNotBlank(projectLawsInventoryEO.getVerifyDeliverableTemplate())){
|
||||||
|
String fileName = getFileName(projectLawsInventoryEO, fileInfos,projectLawsInventoryEO.getVerifyDeliverableTemplate());
|
||||||
|
if(org.apache.commons.lang3.StringUtils.isNotBlank(fileName)){
|
||||||
|
projectLawsInventoryEO.setVerifyDeliverableTemplateName(fileName);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private String getFileName(ProjectLawsInventoryEO projectLawsInventoryEO, List<OSSFile> fileInfos, String deliverableTemplate){
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
for (String s : deliverableTemplate.split(",")) {
|
||||||
|
List<OSSFile> collect = fileInfos.stream().filter(e -> s.equals(e.getId())).collect(Collectors.toList());
|
||||||
|
sb.append(collect.get(0).getFileName() + ",");
|
||||||
|
}
|
||||||
|
String sbStr = "";
|
||||||
|
if(org.apache.commons.lang3.StringUtils.isNotBlank(sb)){
|
||||||
|
sbStr = sb.substring(0, sb.length() - 1);
|
||||||
|
}
|
||||||
|
return sbStr;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 验证数据
|
* 验证数据
|
||||||
* @param projectLibraryId 项目id
|
* @param projectLibraryId 项目id
|
||||||
@@ -343,8 +406,9 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
|
|||||||
try {
|
try {
|
||||||
//TODO 切换成枚举,不要在代码里出现魔数
|
//TODO 切换成枚举,不要在代码里出现魔数
|
||||||
if(StringUtils.equals(operatorType, OperatorTypeEnum.INVENTORY_AFFIRM.getValue())){
|
if(StringUtils.equals(operatorType, OperatorTypeEnum.INVENTORY_AFFIRM.getValue())){
|
||||||
|
SimpleDateFormat sdf = new SimpleDateFormat("yyy-MM-dd");
|
||||||
//清单确认截止时间
|
//清单确认截止时间
|
||||||
Date inventoryAffirmDueDate = (Date) params.get("inventoryAffirmDueDate");
|
String inventoryAffirmDueDate = (String) params.get("inventoryAffirmDueDate");
|
||||||
|
|
||||||
QueryWrapper<ProjectLawsInventoryEO> queryWrapper = new QueryWrapper<>();
|
QueryWrapper<ProjectLawsInventoryEO> queryWrapper = new QueryWrapper<>();
|
||||||
if(StringUtils.isNotEmpty(ids)){
|
if(StringUtils.isNotEmpty(ids)){
|
||||||
@@ -363,10 +427,12 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
|
|||||||
|
|
||||||
if(checkStatus && checkUser){
|
if(checkStatus && checkUser){
|
||||||
projectLawsInventoryEO.setInventoryAffirmStatus(InventoryAffirmStatusEnum.LIST_TO_CONFIRM.getValue());
|
projectLawsInventoryEO.setInventoryAffirmStatus(InventoryAffirmStatusEnum.LIST_TO_CONFIRM.getValue());
|
||||||
projectLawsInventoryEO.setRegulationOwnerSubmitStatus(null);
|
projectLawsInventoryEO.setInventoryAffirmDueDate(sdf.parse(inventoryAffirmDueDate));
|
||||||
projectLawsInventoryEO.setHomologationEngineerSubmitStatus(null);
|
LambdaUpdateWrapper<ProjectLawsInventoryEO> updateWrapper = new LambdaUpdateWrapper<>();
|
||||||
projectLawsInventoryEO.setInventoryAffirmDueDate(inventoryAffirmDueDate);
|
updateWrapper.set(ProjectLawsInventoryEO::getRegulationOwnerSubmitStatus,null);
|
||||||
super.updateById(projectLawsInventoryEO);
|
updateWrapper.set(ProjectLawsInventoryEO::getHomologationEngineerSubmitStatus,null);
|
||||||
|
updateWrapper.eq(ProjectLawsInventoryEO::getId,projectLawsInventoryEO.getId());
|
||||||
|
super.update(projectLawsInventoryEO, updateWrapper);
|
||||||
//发送消息
|
//发送消息
|
||||||
String sendMessage = "XXX" + "发起了" + " XXX " + "(项目名称)法规的清单确认,截止时间为:" +inventoryAffirmDueDate+ ", 请及时查看处理。";
|
String sendMessage = "XXX" + "发起了" + " XXX " + "(项目名称)法规的清单确认,截止时间为:" +inventoryAffirmDueDate+ ", 请及时查看处理。";
|
||||||
}
|
}
|
||||||
@@ -403,18 +469,21 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
|
|||||||
String inventoryAffirmStatus = "";
|
String inventoryAffirmStatus = "";
|
||||||
|
|
||||||
//如果法规工程师与认证工程师都是提交通过 把清单确认状态设置为 接受
|
//如果法规工程师与认证工程师都是提交通过 把清单确认状态设置为 接受
|
||||||
if(projectLawsInventoryEO.getRegulationOwnerSubmitStatus().equals("0") && projectLawsInventoryEO.getHomologationEngineerSubmitStatus().equals("0")){
|
if(StringUtils.isNotEmpty(projectLawsInventoryEO.getRegulationOwnerSubmitStatus()) && StringUtils.isNotEmpty(projectLawsInventoryEO.getHomologationEngineerSubmitStatus())){
|
||||||
inventoryAffirmStatus = InventoryAffirmStatusEnum.ACCEPTED.getValue();
|
if(projectLawsInventoryEO.getRegulationOwnerSubmitStatus().equals("0") && projectLawsInventoryEO.getHomologationEngineerSubmitStatus().equals("0")){
|
||||||
}
|
inventoryAffirmStatus = InventoryAffirmStatusEnum.ACCEPTED.getValue();
|
||||||
//如果法规工程师与认证工程师 其中一个人是拒绝 把清单确认状态设置为 拒绝
|
}
|
||||||
if(projectLawsInventoryEO.getRegulationOwnerSubmitStatus().equals("1") || projectLawsInventoryEO.getHomologationEngineerSubmitStatus().equals("1")){
|
|
||||||
inventoryAffirmStatus = InventoryAffirmStatusEnum.REJECTED.getValue();
|
//如果法规工程师与认证工程师 其中一个人是拒绝 把清单确认状态设置为 拒绝
|
||||||
|
if(projectLawsInventoryEO.getRegulationOwnerSubmitStatus().equals("1") || projectLawsInventoryEO.getHomologationEngineerSubmitStatus().equals("1")){
|
||||||
|
inventoryAffirmStatus = InventoryAffirmStatusEnum.REJECTED.getValue();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(StringUtils.isNotEmpty(inventoryAffirmStatus)){
|
if(StringUtils.isNotEmpty(inventoryAffirmStatus)){
|
||||||
projectLawsInventoryEO.setInventoryAffirmStatus(inventoryAffirmStatus);
|
projectLawsInventoryEO.setInventoryAffirmStatus(inventoryAffirmStatus);
|
||||||
super.baseMapper.updateById(projectLawsInventoryEO);
|
|
||||||
}
|
}
|
||||||
|
super.baseMapper.updateById(projectLawsInventoryEO);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user