认证清单-对接列表查询处理展示数据。
This commit is contained in:
+2
@@ -34,4 +34,6 @@ public interface ISysDictItemService extends IService<SysDictItem> {
|
||||
void setAddOrderNum(SysDictItem sysDictItem);
|
||||
|
||||
void setEditOrderNum(SysDictItem sysDictItem);
|
||||
|
||||
String disposeShowDictItemValue(List<SysDictItem> sysDictItems,String fieldValues,String cut,String dicCode);
|
||||
}
|
||||
|
||||
+44
@@ -3,12 +3,16 @@ package com.jero.modules.system.service.impl;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.jero.common.constant.CommonConstant;
|
||||
import com.jero.common.constant.enums.CutEnum;
|
||||
import com.jero.modules.system.entity.SysDictItem;
|
||||
import com.jero.modules.system.mapper.SysDictItemMapper;
|
||||
import com.jero.modules.system.service.ISysDictItemService;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@@ -139,4 +143,44 @@ public class SysDictItemServiceImpl extends ServiceImpl<SysDictItemMapper, SysDi
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String disposeShowDictItemValue(List<SysDictItem> sysDictItems, String fieldValues, String cut, String dicCode) {
|
||||
String result = "";
|
||||
List<SysDictItem> sysDictItemList = sysDictItems.stream().filter(e -> {
|
||||
boolean flag = false;
|
||||
if(StringUtils.equals(e.getDictCode(),dicCode)){
|
||||
flag = true;
|
||||
}
|
||||
return flag;
|
||||
}).distinct().collect(Collectors.toList());
|
||||
if(CollectionUtils.isNotEmpty(sysDictItemList)){
|
||||
if(StringUtils.equals(cut, CutEnum.CN.getValue())){
|
||||
result = sysDictItemList.stream().filter(e -> {
|
||||
boolean flag = false;
|
||||
List<String> fieldValueStrList = Arrays.asList(fieldValues.split(","));
|
||||
for (String fieldValueStr : fieldValueStrList) {
|
||||
if(StringUtils.equals(fieldValueStr,e.getItemValue())){
|
||||
flag = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return flag;
|
||||
}).map(SysDictItem::getItemText).collect(Collectors.joining(","));
|
||||
}else if(StringUtils.equals(cut,CutEnum.EN.getValue())){
|
||||
result = sysDictItemList.stream().filter(e -> {
|
||||
boolean flag = false;
|
||||
List<String> fieldValueStrList = Arrays.asList(fieldValues.split(","));
|
||||
for (String fieldValueStr : fieldValueStrList) {
|
||||
if(StringUtils.equals(fieldValueStr,e.getItemValue())){
|
||||
flag = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return flag;
|
||||
}).map(SysDictItem::getEnName).collect(Collectors.joining(","));
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
package com.jero.modules.authDummy.enums;
|
||||
|
||||
public enum StateEnum {
|
||||
ISSUE("已发布","1"),
|
||||
DRAFT("草稿","2");
|
||||
|
||||
String name;
|
||||
String value;
|
||||
|
||||
private StateEnum(String name, String value) {
|
||||
this.name = name;
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public void setValue(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
}
|
||||
+2
@@ -54,10 +54,12 @@ public class ProjectCertificationInventoryEOController extends JeroController<Pr
|
||||
public Result<?> queryPageList(ProjectCertificationInventoryEO projectCertificationInventoryEO,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
@RequestParam(name="cut", defaultValue="cn") String cut,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<ProjectCertificationInventoryEO> queryWrapper = QueryGenerator.initQueryWrapper(projectCertificationInventoryEO, req.getParameterMap());
|
||||
Page<ProjectCertificationInventoryEO> page = new Page<ProjectCertificationInventoryEO>(pageNo, pageSize);
|
||||
IPage<ProjectCertificationInventoryEO> pageList = projectCertificationInventoryEOService.page(page, queryWrapper);
|
||||
this.projectCertificationInventoryEOService.disposeData(pageList.getRecords(),cut);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
|
||||
+15
@@ -91,6 +91,9 @@ public class ProjectCertificationInventoryEO implements Serializable {
|
||||
@Excel(name = "责任领域", width = 15)
|
||||
@ApiModelProperty(value = "责任领域")
|
||||
private java.lang.String dutyTerritory;
|
||||
/**责任领域名称**/
|
||||
@TableField(exist = false)
|
||||
private String dutyTerritoryName;
|
||||
|
||||
/**交付物*/
|
||||
@Excel(name = "交付物", width = 15)
|
||||
@@ -106,16 +109,25 @@ public class ProjectCertificationInventoryEO implements Serializable {
|
||||
@Excel(name = "工程接口人", width = 15)
|
||||
@ApiModelProperty(value = "工程接口人")
|
||||
private java.lang.String sdt;
|
||||
/**工程接口人名称**/
|
||||
@TableField(exist = false)
|
||||
private String sdtName;
|
||||
|
||||
/**责任人*/
|
||||
@Excel(name = "责任人", width = 15)
|
||||
@ApiModelProperty(value = "责任人")
|
||||
private java.lang.String dutyPerson;
|
||||
/**责任人名称**/
|
||||
@TableField(exist = false)
|
||||
private String dutyPersonName;
|
||||
|
||||
/**交付物类型*/
|
||||
@Excel(name = "交付物类型", width = 15)
|
||||
@ApiModelProperty(value = "交付物类型")
|
||||
private java.lang.String deliverableType;
|
||||
@TableField(exist = false)
|
||||
// 交付物类型名称
|
||||
private String deliverableTypeName;
|
||||
|
||||
/**交付物模板*/
|
||||
@Excel(name = "交付物模板", width = 15)
|
||||
@@ -138,6 +150,9 @@ public class ProjectCertificationInventoryEO implements Serializable {
|
||||
@Excel(name = "流程状态", width = 15)
|
||||
@ApiModelProperty(value = "流程状态")
|
||||
private java.lang.String flowStatus;
|
||||
@TableField(exist = false)
|
||||
// 流程状态展示名称
|
||||
private String flowStatusName;
|
||||
|
||||
/**报告编号*/
|
||||
@Excel(name = "报告编号", width = 15)
|
||||
|
||||
+96
@@ -0,0 +1,96 @@
|
||||
package com.jero.modules.project.enums;
|
||||
|
||||
import com.jero.common.constant.enums.CutEnum;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
/**
|
||||
* 认证清单流程状态枚举类
|
||||
* @Author: wzj
|
||||
* @Date: 2023/3/6 10:17
|
||||
**/
|
||||
public enum CertificationInventoryFlowStatusEnum {
|
||||
|
||||
/**
|
||||
* 清单待发布 未发起清单确认
|
||||
* 清单待校核 发起清单确认后认证工程师未处理
|
||||
* 认证(工程师)退回 清单确认阶段认证工程师退回
|
||||
* 任务待确认 认证工程师发起责任人待确认
|
||||
* 责任人拒绝 责任人拒绝
|
||||
* 结果待提交 责任人接受后 未提交交付物
|
||||
* 工程师退回 责任人分发后被第二位责任人退回
|
||||
* 结果待审查 责任人提交后认证工程师未审查
|
||||
* 审查通过 责任人提交后认证工程师审查通过
|
||||
* 审查退回 责任人提交后认证工程师审查退回
|
||||
*/
|
||||
|
||||
LIST_TO_BE_RELEASED("清单待发布","List to be released","List to be released"),
|
||||
LIST_TO_BE_CHECKED("清单待校核","List to be checked","List to be checked"),
|
||||
CERTIFICATION_RETURNED("认证退回","Certification returned","Certification returned"),
|
||||
TASK_TO_BE_CONFIRMED("任务待确认","Task to be confirmed","Task to be confirmed"),
|
||||
REFUSAL_OF_RESPONSIBLE_PERSON("责任人拒绝","Refusal of responsible person","Refusal of responsible person"),
|
||||
RESULTS_TO_BE_SUBMITTED("结果待提交","Results to be submitted","Results to be submitted"),
|
||||
ENGINEER_RETURN("工程师退回","Engineer return","Engineer return"),
|
||||
RESULTS_TO_BE_REVIEWED("结果待审查","Results to be reviewed","Results to be reviewed"),
|
||||
REVIEW_AND_PASS("审查通过","Review and pass","Review and pass"),
|
||||
REVIEW_AND_RETURN("审查退回","Review and return","Review and return"),
|
||||
;
|
||||
|
||||
|
||||
String cnName;
|
||||
String enName;
|
||||
String value;
|
||||
|
||||
private CertificationInventoryFlowStatusEnum(String cnName,String enName, String value) {
|
||||
this.cnName = cnName;
|
||||
this.enName = enName;
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public String getCnName() {
|
||||
return cnName;
|
||||
}
|
||||
|
||||
public void setCnName(String cnName) {
|
||||
this.cnName = cnName;
|
||||
}
|
||||
|
||||
public String getEnName() {
|
||||
return enName;
|
||||
}
|
||||
|
||||
public void setEnName(String enName) {
|
||||
this.enName = enName;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public void setValue(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public static String getTextByValue(String value,String cut) {
|
||||
CertificationInventoryFlowStatusEnum[] values = values();
|
||||
for (CertificationInventoryFlowStatusEnum flowStatusEnum : values) {
|
||||
if (flowStatusEnum.value.equals(value)) {
|
||||
if(StringUtils.equals(cut, CutEnum.CN.getValue())){
|
||||
return flowStatusEnum.cnName;
|
||||
}else {
|
||||
return flowStatusEnum.enName;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
public static String getTextByName(String name) {
|
||||
CertificationInventoryFlowStatusEnum[] values = values();
|
||||
for (CertificationInventoryFlowStatusEnum flowStatusEnum : values) {
|
||||
if (flowStatusEnum.cnName.equals(name)) {
|
||||
return flowStatusEnum.value;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
+7
@@ -74,4 +74,11 @@ public interface IProjectCertificationInventoryEOService extends IService<Projec
|
||||
* @return
|
||||
*/
|
||||
Result<?> setBatch(ProjectCertificationInventoryEO projectCertificationInventoryEO);
|
||||
|
||||
/**
|
||||
* 处理数据
|
||||
* @param datas
|
||||
* @param cut
|
||||
*/
|
||||
void disposeData(List<ProjectCertificationInventoryEO> datas, String cut);
|
||||
}
|
||||
|
||||
+90
@@ -3,19 +3,32 @@ package com.jero.modules.project.service.impl;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.constant.enums.CutEnum;
|
||||
import com.jero.common.exception.JeroBootException;
|
||||
import com.jero.modules.project.entity.ProjectCertificationInventoryEO;
|
||||
import com.jero.modules.project.enums.CertificationInventoryFlowStatusEnum;
|
||||
import com.jero.modules.project.enums.ProjectInventoryFieldEnum;
|
||||
import com.jero.modules.project.mapper.ProjectCertificationInventoryEOMapper;
|
||||
import com.jero.modules.project.service.IProjectCertificationInventoryEOService;
|
||||
import com.jero.modules.system.entity.SysCategory;
|
||||
import com.jero.modules.system.entity.SysDictItem;
|
||||
import com.jero.modules.system.entity.SysUser;
|
||||
import com.jero.modules.system.service.ISysCategoryService;
|
||||
import com.jero.modules.system.service.ISysDictItemService;
|
||||
import com.jero.modules.system.service.ISysUserService;
|
||||
import com.jero.modules.system.service.impl.SysDictItemServiceImpl;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Date;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@@ -30,6 +43,15 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
@Transactional(value = "transactionManager", readOnly = false, propagation = Propagation.REQUIRED, rollbackFor = Throwable.class)
|
||||
public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<ProjectCertificationInventoryEOMapper, ProjectCertificationInventoryEO> implements IProjectCertificationInventoryEOService {
|
||||
|
||||
@Autowired
|
||||
private ISysUserService sysUserService;
|
||||
@Autowired
|
||||
private ISysCategoryService sysCategoryService;
|
||||
@Autowired
|
||||
private ISysDictItemService sysDictItemService;
|
||||
@Autowired
|
||||
private SysDictItemServiceImpl sysDictItemServiceImpl;
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*
|
||||
@@ -117,6 +139,7 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
|
||||
projectCertificationInventoryEO.setWvtaId(wvtaId);
|
||||
projectCertificationInventoryEO.setBussDocumentLibraryId(bussDocumentLibraryId);
|
||||
projectCertificationInventoryEO.setProjectLibraryId(projectLibraryId);
|
||||
projectCertificationInventoryEO.setFlowStatus(CertificationInventoryFlowStatusEnum.LIST_TO_BE_RELEASED.getValue());
|
||||
projectCertificationInventoryEOList.add(projectCertificationInventoryEO);
|
||||
}
|
||||
|
||||
@@ -154,4 +177,71 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
|
||||
}
|
||||
return Result.OK("批量设置成功!");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disposeData(List<ProjectCertificationInventoryEO> datas, String cut) {
|
||||
if (CollectionUtils.isNotEmpty(datas)) {
|
||||
List<SysCategory> categoryList = this.sysCategoryService.list();
|
||||
List<SysDictItem> sysDictItems = this.sysDictItemServiceImpl.getBaseMapper().selectItemsAll();
|
||||
|
||||
List<String> userIdList = new ArrayList<>();
|
||||
|
||||
userIdList.addAll(datas.stream().map(ProjectCertificationInventoryEO::getSdt).collect(Collectors.toList()));
|
||||
userIdList.addAll(datas.stream().map(ProjectCertificationInventoryEO::getDutyPerson).collect(Collectors.toList()));
|
||||
List<SysUser> sysUserList = this.sysUserService.querySysUserListByIdList(userIdList);
|
||||
|
||||
for (ProjectCertificationInventoryEO data : datas) {
|
||||
if(StringUtils.isNotEmpty(data.getSdt())){
|
||||
String sdtName = sysUserList.stream().filter(sysUser -> {
|
||||
boolean flag = false;
|
||||
if (StringUtils.equals(sysUser.getId(), data.getSdt())) {
|
||||
flag = true;
|
||||
}
|
||||
return flag;
|
||||
}).map(SysUser::getUsername).collect(Collectors.joining(","));
|
||||
data.setSdtName(sdtName);
|
||||
}
|
||||
if(StringUtils.isNotEmpty(data.getDutyPerson())){
|
||||
String dutyPersonName = sysUserList.stream().filter(sysUser -> {
|
||||
boolean flag = false;
|
||||
if (StringUtils.equals(sysUser.getId(), data.getDutyPerson())) {
|
||||
flag = true;
|
||||
}
|
||||
return flag;
|
||||
}).map(SysUser::getUsername).collect(Collectors.joining(","));
|
||||
data.setDutyPersonName(dutyPersonName);
|
||||
}
|
||||
if(StringUtils.isNotEmpty(data.getFlowStatus())){
|
||||
data.setFlowStatusName(CertificationInventoryFlowStatusEnum.getTextByValue(data.getFlowStatus(),cut));
|
||||
}
|
||||
if(StringUtils.isNotEmpty(data.getDeliverableType())){
|
||||
String deliverableTypeName = this.getTreeName(cut, categoryList, Arrays.asList(data.getDeliverableType().split(",")));
|
||||
data.setDeliverableTypeName(deliverableTypeName);
|
||||
}
|
||||
if(StringUtils.isNotEmpty(data.getDutyTerritory())){
|
||||
String dutyTerritoryName = this.sysDictItemService.disposeShowDictItemValue(sysDictItems,data.getDutyTerritory(),cut, ProjectInventoryFieldEnum.DUTY_TERRITORY.getValue());
|
||||
data.setDutyTerritoryName(dutyTerritoryName);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private String getTreeName(String cut, List<SysCategory> categoryList, List<String> technologyTerritoryList) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (String technologyTerritory : technologyTerritoryList) {
|
||||
List<SysCategory> collect = categoryList.stream().filter(e -> technologyTerritory.equals(e.getId())).collect(Collectors.toList());
|
||||
if(collect.size() != 0){
|
||||
if (CutEnum.CN.getValue().equals(cut)) {
|
||||
sb.append(collect.get(0).getName() + ",");
|
||||
} else {
|
||||
sb.append(collect.get(0).getEnName()+ ",");
|
||||
}
|
||||
}
|
||||
}
|
||||
String technologyTerritoryName = "";
|
||||
if (StringUtils.isNotBlank(sb)) {
|
||||
technologyTerritoryName = sb.substring(0, sb.length() - 1);
|
||||
}
|
||||
return technologyTerritoryName;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user