Merge branch 'feature/DM/nflg-bom-transition' of http://192.168.0.40:3000/root/nflg_project into feature/DM/nflg-bom-transition
This commit is contained in:
commit
9a7e17ea82
|
|
@ -0,0 +1,152 @@
|
||||||
|
package com.nflg.product.material.api.user.material;
|
||||||
|
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
|
import cn.hutool.db.Session;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
|
import com.google.common.collect.Lists;
|
||||||
|
import com.google.common.collect.Maps;
|
||||||
|
import com.nflg.product.base.core.api.BaseApi;
|
||||||
|
import com.nflg.product.base.core.conmon.util.SessionUtil;
|
||||||
|
import com.nflg.product.material.constant.MaterialProcessStateEnum;
|
||||||
|
import com.nflg.product.material.constant.MaterialUpdateBillStateEnum;
|
||||||
|
import com.nflg.product.material.pojo.entity.*;
|
||||||
|
import com.nflg.product.material.pojo.vo.MaterialHomeMainVO;
|
||||||
|
import com.nflg.product.material.pojo.vo.StandardPartPickRuleHomeVO;
|
||||||
|
import com.nflg.product.material.service.*;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import nflg.product.common.vo.ResultVO;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Objects;
|
||||||
|
import java.util.function.Function;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* packageName com.nflg.product.material.api.user.material
|
||||||
|
*
|
||||||
|
* @author luohj
|
||||||
|
* @className MaterialHomeApi
|
||||||
|
* @date 2024/7/26 0026
|
||||||
|
* @description 主数据平台首页
|
||||||
|
*/
|
||||||
|
@Api(tags = "主数据平台首页")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("home")
|
||||||
|
public class MaterialHomeApi extends BaseApi {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
MaterialMainService materialMainService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private AuthorityDepartmentService authorityDepartmentService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private StandardDeptService standardDeptService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private StandardPartPickRuleService standardPartPickRuleService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private MaterialUpdateBillService materialUpdateBillService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private StandardPartPickRuleArgumentsService standardPartPickRuleArgumentsService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private StandardCategoryService standardCategoryService;
|
||||||
|
|
||||||
|
@GetMapping("materialManagement")
|
||||||
|
@ApiOperation("物料管理")
|
||||||
|
public ResultVO<Map<String,List<MaterialHomeMainVO>>> materialManagement(){
|
||||||
|
Map<String,List<MaterialHomeMainVO>> mp = Maps.newHashMap();
|
||||||
|
List<MaterialHomeMainVO> mainList = materialMainService.listByHome(null,5);
|
||||||
|
List<MaterialHomeMainVO> mainUpdateList = materialUpdateBillService.listByHome(null,5);
|
||||||
|
mp.put("mainList",mainList);
|
||||||
|
mp.put("mainUpdateList",mainUpdateList);
|
||||||
|
return ResultVO.success(mp);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("materialMessage")
|
||||||
|
@ApiOperation("消息提醒")
|
||||||
|
public ResultVO<Map<String,List<MaterialHomeMainVO>>> materialMessage(){
|
||||||
|
Map<String,List<MaterialHomeMainVO>> mp = Maps.newHashMap();
|
||||||
|
List<MaterialHomeMainVO> mainList = materialMainService.listByHome(MaterialProcessStateEnum.REJECT.getValue(),5);
|
||||||
|
List<MaterialHomeMainVO> mainUpdateList = materialUpdateBillService.listByHome(MaterialUpdateBillStateEnum.REJECT.getValue(),5);
|
||||||
|
mp.put("mainList",mainList);
|
||||||
|
mp.put("mainUpdateList",mainUpdateList);
|
||||||
|
return ResultVO.success(mp);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("standardPartList")
|
||||||
|
@ApiOperation("标准部件")
|
||||||
|
public ResultVO<Map<String, List<StandardPartPickRuleHomeVO>>> standardPartList(){
|
||||||
|
//仅取90天内的数据
|
||||||
|
Date date90 = DateUtil.offsetDay(new Date(),-90);
|
||||||
|
|
||||||
|
Map<String, List<StandardPartPickRuleHomeVO>> mp = Maps.newHashMap();
|
||||||
|
AuthorityDepartmentEntity auDept = authorityDepartmentService.getById(SessionUtil.getPartRowId());
|
||||||
|
//获取当前登录用户的标准件部门id
|
||||||
|
StandardDeptEntity sDept = standardDeptService.getOne(Wrappers.<StandardDeptEntity>lambdaQuery()
|
||||||
|
.eq(StandardDeptEntity::getDeptCode,auDept.getDptCode()),false);
|
||||||
|
if(sDept == null){
|
||||||
|
return ResultVO.success(mp);
|
||||||
|
}
|
||||||
|
//规则集合,含共享部门及创建部门各取前5条记录
|
||||||
|
List<StandardPartPickRuleEntity> ruleList = Lists.newArrayList();
|
||||||
|
List<StandardPartPickRuleEntity> desginRuleList = standardPartPickRuleService.list(Wrappers.<StandardPartPickRuleEntity>lambdaQuery()
|
||||||
|
.ge(StandardPartPickRuleEntity::getCreatedTime,date90)
|
||||||
|
.eq(StandardPartPickRuleEntity::getDeptRowId,sDept.getRowId())
|
||||||
|
.orderByDesc(StandardPartPickRuleEntity::getCreatedTime)
|
||||||
|
.last(String.format("limit %d",5)));
|
||||||
|
List<StandardPartPickRuleEntity> shareRuleList = standardPartPickRuleService.list(Wrappers.<StandardPartPickRuleEntity>lambdaQuery()
|
||||||
|
.ge(StandardPartPickRuleEntity::getCreatedTime,date90)
|
||||||
|
.like(StandardPartPickRuleEntity::getShareDeptRowId,sDept.getRowId())
|
||||||
|
.orderByDesc(StandardPartPickRuleEntity::getCreatedTime)
|
||||||
|
.last(String.format("limit %d",5)));
|
||||||
|
ruleList.addAll(desginRuleList.stream().collect(Collectors.toMap(StandardPartPickRuleEntity::getCategoryRowId,Function.identity(),(k1,k2)->k1)).values());
|
||||||
|
ruleList.addAll(shareRuleList.stream().collect(Collectors.toMap(StandardPartPickRuleEntity::getCategoryRowId,Function.identity(),(k1,k2)-> k1)).values());
|
||||||
|
if(ruleList.isEmpty()){
|
||||||
|
return ResultVO.success(mp);
|
||||||
|
}
|
||||||
|
//分类集合
|
||||||
|
List<StandardCategoryEntity> categoryList = standardCategoryService.list(Wrappers.<StandardCategoryEntity>lambdaQuery()
|
||||||
|
.in(StandardCategoryEntity::getRowId,ruleList.stream().map(StandardPartPickRuleEntity::getCategoryRowId).collect(Collectors.toList())));
|
||||||
|
|
||||||
|
//参数集合
|
||||||
|
List<StandardPartPickRuleArgumentsEntity> argList = standardPartPickRuleArgumentsService.list(Wrappers.<StandardPartPickRuleArgumentsEntity>lambdaQuery()
|
||||||
|
.in(StandardPartPickRuleArgumentsEntity::getPickRuleRowId,ruleList.stream().map(StandardPartPickRuleEntity::getRowId).collect(Collectors.toList()))
|
||||||
|
.orderByAsc(StandardPartPickRuleArgumentsEntity::getOrderNum));
|
||||||
|
//本部门设置的选配规则
|
||||||
|
List<StandardPartPickRuleHomeVO> desginList = Lists.newArrayList();
|
||||||
|
//本部门可用的选配规则
|
||||||
|
List<StandardPartPickRuleHomeVO> shareList = Lists.newArrayList();
|
||||||
|
|
||||||
|
ruleList.stream().distinct().forEach(rule -> {
|
||||||
|
StandardPartPickRuleHomeVO ruleHomeVO = new StandardPartPickRuleHomeVO();
|
||||||
|
ruleHomeVO.setRowId(rule.getRowId());
|
||||||
|
ruleHomeVO.setCategoryRowId(rule.getCategoryRowId());
|
||||||
|
|
||||||
|
ruleHomeVO.setCategoryName(categoryList.stream().filter(c -> Objects.equals(c.getRowId(),rule.getCategoryRowId()))
|
||||||
|
.map(StandardCategoryEntity::getCategoryName).distinct().collect(Collectors.joining()));
|
||||||
|
|
||||||
|
ruleHomeVO.setArguments(argList.stream().filter(a -> Objects.equals(a.getRowId(),rule.getRowId()))
|
||||||
|
.map(StandardPartPickRuleArgumentsEntity::getName).distinct().collect(Collectors.joining("/")));
|
||||||
|
shareList.add(ruleHomeVO);
|
||||||
|
//本部门设置的选配规则
|
||||||
|
if(Objects.equals(rule.getDeptRowId(),sDept.getRowId())){
|
||||||
|
desginList.add(ruleHomeVO);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
mp.put("shareList",shareList);
|
||||||
|
mp.put("desginList",desginList);
|
||||||
|
return ResultVO.success(mp);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -17,4 +17,13 @@ public enum MaterialUpdateBillStateEnum {
|
||||||
|
|
||||||
private final Integer value;
|
private final Integer value;
|
||||||
private final String description;
|
private final String description;
|
||||||
|
|
||||||
|
public static MaterialUpdateBillStateEnum findDescriptionByValue(Integer value) {
|
||||||
|
for (MaterialUpdateBillStateEnum valueEnum : MaterialUpdateBillStateEnum.values()) {
|
||||||
|
if (valueEnum.getValue().equals(value)) {
|
||||||
|
return valueEnum;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -221,6 +221,8 @@ public class MaterialMainEntity implements Serializable {
|
||||||
@ApiModelProperty("驳回原因")
|
@ApiModelProperty("驳回原因")
|
||||||
private String rejectResion;
|
private String rejectResion;
|
||||||
|
|
||||||
|
@ApiModelProperty("驳回时间")
|
||||||
|
private Date rejectTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 物料分类编码
|
* 物料分类编码
|
||||||
|
|
|
||||||
|
|
@ -177,6 +177,9 @@ public class MaterialUpdateBillEntity implements Serializable {
|
||||||
@ApiModelProperty(value = "驳回原因")
|
@ApiModelProperty(value = "驳回原因")
|
||||||
private String rejectResion;
|
private String rejectResion;
|
||||||
|
|
||||||
|
@ApiModelProperty("驳回时间")
|
||||||
|
private Date rejectTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 驳回人
|
* 驳回人
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,35 @@
|
||||||
|
package com.nflg.product.material.pojo.vo;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* packageName com.nflg.product.material.pojo.vo
|
||||||
|
*
|
||||||
|
* @author luohj
|
||||||
|
* @className MaterialHomeMainVO
|
||||||
|
* @date 2024/7/29 0029
|
||||||
|
* @description 首页
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class MaterialHomeMainVO implements Serializable {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "表行id")
|
||||||
|
private Long rowId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "物料编码")
|
||||||
|
private String materialNo;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "物料名称")
|
||||||
|
private String materialName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "流程状态")
|
||||||
|
private Integer processState;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "流程状态名称")
|
||||||
|
private String processStateName;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,42 @@
|
||||||
|
package com.nflg.product.material.pojo.vo;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author 曹鹏飞
|
||||||
|
* @date 2024/5/9 11:31:31
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class StandardPartPickRuleHomeVO implements Serializable {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 行ID
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "行ID")
|
||||||
|
private Long rowId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 部件类型的行ID
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "部件类型的行ID")
|
||||||
|
@NotNull
|
||||||
|
private Long categoryRowId;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 部件类型的名称
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "部件类型的名称")
|
||||||
|
private String categoryName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 参数
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "参数")
|
||||||
|
private String arguments;
|
||||||
|
}
|
||||||
|
|
@ -3,12 +3,14 @@ package com.nflg.product.material.service;
|
||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import cn.hutool.core.collection.CollectionUtil;
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
import cn.hutool.core.convert.Convert;
|
import cn.hutool.core.convert.Convert;
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
import cn.hutool.core.io.FileUtil;
|
import cn.hutool.core.io.FileUtil;
|
||||||
import cn.hutool.core.lang.TypeReference;
|
import cn.hutool.core.lang.TypeReference;
|
||||||
import cn.hutool.core.util.NumberUtil;
|
import cn.hutool.core.util.NumberUtil;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
|
|
@ -18,6 +20,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
import com.google.common.collect.ImmutableList;
|
import com.google.common.collect.ImmutableList;
|
||||||
|
import com.google.common.collect.Lists;
|
||||||
import com.nflg.product.base.core.conmon.util.SessionUtil;
|
import com.nflg.product.base.core.conmon.util.SessionUtil;
|
||||||
import com.nflg.product.base.core.exception.NflgBusinessException;
|
import com.nflg.product.base.core.exception.NflgBusinessException;
|
||||||
import com.nflg.product.base.core.vo.PageVO;
|
import com.nflg.product.base.core.vo.PageVO;
|
||||||
|
|
@ -2874,4 +2877,36 @@ public class MaterialMainService extends ServiceImpl<MaterialMainMapper, Materia
|
||||||
List<MaterialMainEntity> list=lambdaQuery().in(MaterialMainEntity::getMaterialNo, materialNos).list();
|
List<MaterialMainEntity> list=lambdaQuery().in(MaterialMainEntity::getMaterialNo, materialNos).list();
|
||||||
return Convert.toList(MaterialMainVO.class, list);
|
return Convert.toList(MaterialMainVO.class, list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 首页》物料管理》我的物料申请
|
||||||
|
* @param processState 流程状态
|
||||||
|
* @param limitNums 取数
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public List<MaterialHomeMainVO> listByHome(Integer processState,Integer limitNums){
|
||||||
|
List<MaterialHomeMainVO> rlist = Lists.newArrayList();
|
||||||
|
//仅取90天内的数据
|
||||||
|
Date date90 = DateUtil.offsetDay(new Date(),-90);
|
||||||
|
LambdaQueryWrapper<MaterialMainEntity> lw = Wrappers.<MaterialMainEntity>lambdaQuery()
|
||||||
|
.eq(MaterialMainEntity::getCreatedBy, SessionUtil.getUserCode());
|
||||||
|
//消息提醒,仅获取已驳回的记录
|
||||||
|
if(Objects.equals(processState,MaterialProcessStateEnum.REJECT.getValue())){
|
||||||
|
lw.eq(MaterialMainEntity::getProcessState,processState);
|
||||||
|
lw.ge(MaterialMainEntity::getRejectTime,date90).orderByDesc(MaterialMainEntity::getRejectTime);
|
||||||
|
}else{
|
||||||
|
lw.ge(MaterialMainEntity::getCreatedTime,date90).orderByDesc(MaterialMainEntity::getCreatedTime);
|
||||||
|
}
|
||||||
|
lw.last(String.format("limit %d",limitNums));
|
||||||
|
|
||||||
|
List<MaterialMainEntity> mainList = this.list(lw);
|
||||||
|
|
||||||
|
if(!mainList.isEmpty()){
|
||||||
|
rlist = Convert.toList(MaterialHomeMainVO.class,mainList);
|
||||||
|
rlist.forEach(r -> r.setProcessStateName(Optional.ofNullable(MaterialProcessStateEnum.findDescriptionByValue(r.getProcessState()))
|
||||||
|
.map(MaterialProcessStateEnum::getDescription).orElse("") ));
|
||||||
|
}
|
||||||
|
return rlist;
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@ import com.alibaba.fastjson.JSON;
|
||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import com.google.common.collect.ImmutableList;
|
import com.google.common.collect.ImmutableList;
|
||||||
import com.nflg.product.base.core.config.SpringContextUtils;
|
import com.nflg.product.base.core.config.SpringContextUtils;
|
||||||
import com.nflg.product.base.core.conmon.util.SessionUtil;
|
import com.nflg.product.base.core.conmon.util.SessionUtil;
|
||||||
|
|
@ -36,6 +37,7 @@ import java.math.RoundingMode;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.concurrent.CompletableFuture;
|
import java.util.concurrent.CompletableFuture;
|
||||||
import java.util.concurrent.atomic.AtomicReference;
|
import java.util.concurrent.atomic.AtomicReference;
|
||||||
|
import java.util.function.Function;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -66,6 +68,9 @@ public class MaterialSubmitService {
|
||||||
@Value("${oa.timeout}")
|
@Value("${oa.timeout}")
|
||||||
private int timeout;
|
private int timeout;
|
||||||
|
|
||||||
|
@Value("${spring.profiles.active}")
|
||||||
|
private String profiles;
|
||||||
|
|
||||||
public void submitOne(Long rowId) {
|
public void submitOne(Long rowId) {
|
||||||
|
|
||||||
MaterialMainVO materialMainVO = materialMainService.selectByRowId(rowId, MaterialMainTypeEnum.ONE.getCode());
|
MaterialMainVO materialMainVO = materialMainService.selectByRowId(rowId, MaterialMainTypeEnum.ONE.getCode());
|
||||||
|
|
@ -511,6 +516,7 @@ public class MaterialSubmitService {
|
||||||
//更新完结流程
|
//更新完结流程
|
||||||
log.info("物料申请--OA返回结果--通过:" + JSON.toJSONString(oaRowIds));
|
log.info("物料申请--OA返回结果--通过:" + JSON.toJSONString(oaRowIds));
|
||||||
if (oaRowIds.size() > 0) {
|
if (oaRowIds.size() > 0) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// oaId去重
|
// oaId去重
|
||||||
List<String> oaRowIdList = oaRowIds.stream().distinct().collect(Collectors.toList());
|
List<String> oaRowIdList = oaRowIds.stream().distinct().collect(Collectors.toList());
|
||||||
|
|
@ -525,9 +531,23 @@ public class MaterialSubmitService {
|
||||||
// oaId去重
|
// oaId去重
|
||||||
List<OaRejectDTO> rejects = rejectList.stream().collect(Collectors.collectingAndThen(
|
List<OaRejectDTO> rejects = rejectList.stream().collect(Collectors.collectingAndThen(
|
||||||
Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(OaRejectDTO::getInstId))), ArrayList::new));
|
Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(OaRejectDTO::getInstId))), ArrayList::new));
|
||||||
|
List<MaterialMainEntity> mList = materialMainService.list(Wrappers.<MaterialMainEntity>lambdaQuery().in(MaterialMainEntity::getOaRowId,
|
||||||
|
rejects.stream().map(OaRejectDTO::getInstId).distinct().collect(Collectors.toList())));
|
||||||
|
Map<String,String> mainMap = mList.stream().collect(Collectors.toMap(m -> String.valueOf(m.getOaRowId()), MaterialMainEntity::getCreatedBy,(k1, k2)->k1));
|
||||||
for (OaRejectDTO r : rejects) {
|
for (OaRejectDTO r : rejects) {
|
||||||
try {
|
try {
|
||||||
materialMainService.getBaseMapper().reject("", r.getReturnMessage(), r.getInstId());
|
materialMainService.getBaseMapper().reject("", r.getReturnMessage(), r.getInstId());
|
||||||
|
//已驳回,发送RTX消息给用户 by luohj 240730
|
||||||
|
String receiver = mainMap.get(r.getInstId());
|
||||||
|
if(StrUtil.isNotBlank(receiver)){
|
||||||
|
String msg = mList.stream().filter(m -> Objects.equals(String.valueOf(m.getOaRowId()),r.getInstId()))
|
||||||
|
.map(m -> String.format("%s %s",m.getMaterialNo(),m.getMaterialName()))
|
||||||
|
.collect(Collectors.joining("\n"));
|
||||||
|
CompletableFuture.runAsync(() -> {
|
||||||
|
httpUtils.rtxMessage(profiles,"物料新增申请【被驳回】",msg,Objects.equals(receiver,"admin")?"10002327":receiver);
|
||||||
|
}).join();
|
||||||
|
}
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("OAID为:" + r.getInstId() + "修改申请信息异常", e);
|
log.error("OAID为:" + r.getInstId() + "修改申请信息异常", e);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,14 +2,19 @@ package com.nflg.product.material.service;
|
||||||
|
|
||||||
import cn.hutool.cache.impl.TimedCache;
|
import cn.hutool.cache.impl.TimedCache;
|
||||||
import cn.hutool.core.collection.CollectionUtil;
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
|
import cn.hutool.core.convert.Convert;
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.google.common.collect.ImmutableList;
|
import com.google.common.collect.ImmutableList;
|
||||||
|
import com.google.common.collect.Lists;
|
||||||
import com.google.common.collect.Sets;
|
import com.google.common.collect.Sets;
|
||||||
import com.nflg.product.base.core.conmon.util.SessionUtil;
|
import com.nflg.product.base.core.conmon.util.SessionUtil;
|
||||||
import com.nflg.product.base.core.exception.NflgBusinessException;
|
import com.nflg.product.base.core.exception.NflgBusinessException;
|
||||||
|
|
@ -23,6 +28,7 @@ import com.nflg.product.material.pojo.dto.MaterialMainAttrDTO;
|
||||||
import com.nflg.product.material.pojo.dto.MaterialUpdateBillDTO;
|
import com.nflg.product.material.pojo.dto.MaterialUpdateBillDTO;
|
||||||
import com.nflg.product.material.pojo.entity.*;
|
import com.nflg.product.material.pojo.entity.*;
|
||||||
import com.nflg.product.material.pojo.query.MaterialUpdateBillQuery;
|
import com.nflg.product.material.pojo.query.MaterialUpdateBillQuery;
|
||||||
|
import com.nflg.product.material.pojo.vo.MaterialHomeMainVO;
|
||||||
import com.nflg.product.material.pojo.vo.MaterialMainAttrValuesVO;
|
import com.nflg.product.material.pojo.vo.MaterialMainAttrValuesVO;
|
||||||
import com.nflg.product.material.pojo.vo.MaterialMainVO;
|
import com.nflg.product.material.pojo.vo.MaterialMainVO;
|
||||||
import com.nflg.product.material.pojo.vo.MaterialUpdateBillVO;
|
import com.nflg.product.material.pojo.vo.MaterialUpdateBillVO;
|
||||||
|
|
@ -961,4 +967,48 @@ public class MaterialUpdateBillService extends ServiceImpl<MaterialUpdateBillMap
|
||||||
public List<Map<String, Object>> getCurrentUpdateMaterial(List<String> list) {
|
public List<Map<String, Object>> getCurrentUpdateMaterial(List<String> list) {
|
||||||
return materialUpdateBillMapper.getCurrentUpdateMaterial(list);
|
return materialUpdateBillMapper.getCurrentUpdateMaterial(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 首页》物料管理》我的变更申请
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public List<MaterialHomeMainVO> listByHome(Integer billState,Integer limitNums){
|
||||||
|
List<MaterialHomeMainVO> rlist = Lists.newArrayList();
|
||||||
|
//仅取90天内的数据
|
||||||
|
Date date90 = DateUtil.offsetDay(new Date(),-90);
|
||||||
|
|
||||||
|
LambdaQueryWrapper<MaterialUpdateBillEntity> lw = Wrappers.<MaterialUpdateBillEntity>lambdaQuery()
|
||||||
|
.eq(MaterialUpdateBillEntity::getCreatedBy,SessionUtil.getUserCode());
|
||||||
|
|
||||||
|
//消息提醒,仅取已驳回记录
|
||||||
|
if(Objects.equals(billState,MaterialUpdateBillStateEnum.REJECT.getValue())){
|
||||||
|
lw.eq(MaterialUpdateBillEntity::getBillState,billState)
|
||||||
|
.ge(MaterialUpdateBillEntity::getRejectTime,date90)
|
||||||
|
.orderByDesc(MaterialUpdateBillEntity::getRejectTime);
|
||||||
|
}else{
|
||||||
|
lw.ge(MaterialUpdateBillEntity::getCreatedTime,date90)
|
||||||
|
.orderByDesc(MaterialUpdateBillEntity::getCreatedTime);
|
||||||
|
}
|
||||||
|
lw.last(String.format("limit %d",limitNums));
|
||||||
|
|
||||||
|
List<MaterialUpdateBillEntity> entityList = this.list(Wrappers.<MaterialUpdateBillEntity>lambdaQuery()
|
||||||
|
.eq(MaterialUpdateBillEntity::getCreatedBy,SessionUtil.getUserCode())
|
||||||
|
.eq(null != billState,MaterialUpdateBillEntity::getBillState,billState)
|
||||||
|
.ge(MaterialUpdateBillEntity::getCreatedTime,date90)
|
||||||
|
.orderByDesc(MaterialUpdateBillEntity::getCreatedTime)
|
||||||
|
.last(String.format("limit %d",limitNums)));
|
||||||
|
if(!entityList.isEmpty()){
|
||||||
|
entityList.forEach(e -> {
|
||||||
|
MaterialHomeMainVO r = Convert.convert(MaterialHomeMainVO.class,e);
|
||||||
|
if(StrUtil.isBlank(r.getMaterialName())){
|
||||||
|
r.setMaterialName(Optional.ofNullable(e.getOldMaterialDesc()).orElse(""));
|
||||||
|
}
|
||||||
|
r.setProcessState(e.getBillState());
|
||||||
|
r.setProcessStateName(Optional.ofNullable(MaterialUpdateBillStateEnum.findDescriptionByValue(e.getBillState()))
|
||||||
|
.map(MaterialUpdateBillStateEnum::getDescription).orElse(""));
|
||||||
|
rlist.add(r);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return rlist;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ import cn.hutool.core.util.StrUtil;
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
import com.nflg.product.base.core.conmon.util.SessionUtil;
|
import com.nflg.product.base.core.conmon.util.SessionUtil;
|
||||||
import com.nflg.product.base.core.exception.NflgBusinessException;
|
import com.nflg.product.base.core.exception.NflgBusinessException;
|
||||||
|
|
@ -31,6 +32,7 @@ import java.io.IOException;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.time.format.DateTimeFormatter;
|
import java.time.format.DateTimeFormatter;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import java.util.concurrent.CompletableFuture;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -67,6 +69,9 @@ public class MaterialUpdateToOAService {
|
||||||
@Value("${oa.timeout}")
|
@Value("${oa.timeout}")
|
||||||
private int timeout;
|
private int timeout;
|
||||||
|
|
||||||
|
@Value("${spring.profiles.active}")
|
||||||
|
private String profiles;
|
||||||
|
|
||||||
public void submit(List<Long> rowIds) {
|
public void submit(List<Long> rowIds) {
|
||||||
List<MaterialUpdateBillEntity> entityList = materialUpdateBillService.lambdaQuery().in(MaterialUpdateBillEntity::getRowId, rowIds).list();
|
List<MaterialUpdateBillEntity> entityList = materialUpdateBillService.lambdaQuery().in(MaterialUpdateBillEntity::getRowId, rowIds).list();
|
||||||
sysnToOa(entityList);
|
sysnToOa(entityList);
|
||||||
|
|
@ -435,9 +440,24 @@ public class MaterialUpdateToOAService {
|
||||||
// oaId去重
|
// oaId去重
|
||||||
List<OaRejectDTO> rejects = rejectList.stream().collect(Collectors.collectingAndThen(
|
List<OaRejectDTO> rejects = rejectList.stream().collect(Collectors.collectingAndThen(
|
||||||
Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(OaRejectDTO::getInstId))), ArrayList::new));
|
Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(OaRejectDTO::getInstId))), ArrayList::new));
|
||||||
|
|
||||||
|
List<MaterialUpdateBillEntity> mList = materialUpdateBillService.list(Wrappers.<MaterialUpdateBillEntity>lambdaQuery().in(MaterialUpdateBillEntity::getOaRowId,
|
||||||
|
rejects.stream().map(OaRejectDTO::getInstId).distinct().collect(Collectors.toList())));
|
||||||
|
Map<String,String> mainMap = mList.stream().collect(Collectors.toMap(m -> String.valueOf(m.getOaRowId()), MaterialUpdateBillEntity::getCreatedBy,(k1, k2)->k1));
|
||||||
|
|
||||||
for (OaRejectDTO r : rejects) {
|
for (OaRejectDTO r : rejects) {
|
||||||
try {
|
try {
|
||||||
materialUpdateBillService.getBaseMapper().rejectBill(r.getReturnMessage(), r.getInstId(), "");
|
materialUpdateBillService.getBaseMapper().rejectBill(r.getReturnMessage(), r.getInstId(), "");
|
||||||
|
//已驳回,发送RTX消息给用户 by luohj 240730
|
||||||
|
String receiver = mainMap.get(r.getInstId());
|
||||||
|
if(StrUtil.isNotBlank(receiver)){
|
||||||
|
String msg = mList.stream().filter(m -> Objects.equals(String.valueOf(m.getOaRowId()),r.getInstId()))
|
||||||
|
.map(m -> String.format("%s %s",m.getMaterialNo(),Optional.ofNullable(m.getMaterialName()).orElse(m.getOldMaterialDesc())))
|
||||||
|
.collect(Collectors.joining("\n"));
|
||||||
|
CompletableFuture.runAsync(() -> {
|
||||||
|
httpUtils.rtxMessage(profiles,"物料变更申请【被驳回】",msg,Objects.equals(receiver,"admin")?"10002327":receiver);
|
||||||
|
}).join();
|
||||||
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("OAID为:" + r.getInstId() + "修改变更信息异常", e);
|
log.error("OAID为:" + r.getInstId() + "修改变更信息异常", e);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,10 @@
|
||||||
package com.nflg.product.material.util;
|
package com.nflg.product.material.util;
|
||||||
|
|
||||||
|
|
||||||
|
import cn.hutool.core.util.CharsetUtil;
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import cn.hutool.http.HttpRequest;
|
||||||
|
import cn.hutool.http.HttpUtil;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||||
import com.nflg.product.base.core.exception.NflgBusinessException;
|
import com.nflg.product.base.core.exception.NflgBusinessException;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
@ -11,8 +15,10 @@ import org.springframework.http.HttpStatus;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
|
import java.net.URLEncoder;
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.concurrent.CompletableFuture;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -392,5 +398,28 @@ public class HttpUtils {
|
||||||
return getOkHttpClient().newCall(request).execute();
|
return getOkHttpClient().newCall(request).execute();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param profiles 环境变量
|
||||||
|
* @param title 消息标题
|
||||||
|
* @param msg 消息内容
|
||||||
|
* @param receiver 接收人,工号,多人以,隔开
|
||||||
|
*/
|
||||||
|
public void rtxMessage(String profiles, String title, String msg, String receiver){
|
||||||
|
String url = "http://192.168.0.1:8012/sendnotify.cgi";
|
||||||
|
try{
|
||||||
|
if(!ObjectUtil.equal(profiles.toLowerCase(),"prod")){
|
||||||
|
title += "(测试)";
|
||||||
|
}
|
||||||
|
title = URLEncoder.encode(title, "GBK");
|
||||||
|
msg = URLEncoder.encode(msg, "GBK");
|
||||||
|
receiver = URLEncoder.encode(receiver, "GBK");
|
||||||
|
url += "?title=" + title + "&msg=" + msg + "&delaytime=0&receiver=" + receiver;
|
||||||
|
String re = this.doGet(url);
|
||||||
|
}catch (Exception e){
|
||||||
|
log.error("RTX消息发送异常:{}" ,e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -388,6 +388,7 @@
|
||||||
UPDATE t_material_main
|
UPDATE t_material_main
|
||||||
set reject_user=#{rejectUser},
|
set reject_user=#{rejectUser},
|
||||||
reject_resion=#{rejectResion},
|
reject_resion=#{rejectResion},
|
||||||
|
reject_time = now(),
|
||||||
process_state=2
|
process_state=2
|
||||||
where oa_row_id = #{oaRowId}
|
where oa_row_id = #{oaRowId}
|
||||||
</update>
|
</update>
|
||||||
|
|
|
||||||
|
|
@ -171,7 +171,7 @@
|
||||||
|
|
||||||
<update id="rejectBill">
|
<update id="rejectBill">
|
||||||
update t_material_update_bill
|
update t_material_update_bill
|
||||||
set bill_state=5, reject_resion=#{rejectResion}, reject_user=#{rejectUser}
|
set bill_state=5, reject_resion=#{rejectResion},reject_time=now(), reject_user=#{rejectUser}
|
||||||
where oa_row_id = #{oaRowId}
|
where oa_row_id = #{oaRowId}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,17 +2,22 @@ package com.nflg.product.bomnew.api.user;
|
||||||
|
|
||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import cn.hutool.core.collection.CollectionUtil;
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
|
import cn.hutool.core.convert.Convert;
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
|
import cn.hutool.core.util.EnumUtil;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.google.common.collect.ImmutableList;
|
import com.google.common.collect.ImmutableList;
|
||||||
|
import com.google.common.collect.Maps;
|
||||||
import com.mzt.logapi.starter.annotation.LogRecord;
|
import com.mzt.logapi.starter.annotation.LogRecord;
|
||||||
import com.nflg.product.base.core.api.BaseApi;
|
import com.nflg.product.base.core.api.BaseApi;
|
||||||
import com.nflg.product.base.core.conmon.util.SessionUtil;
|
import com.nflg.product.base.core.conmon.util.SessionUtil;
|
||||||
import com.nflg.product.bomnew.constant.EBomConstant;
|
import com.nflg.product.bomnew.constant.*;
|
||||||
import com.nflg.product.bomnew.constant.EBomSourceEnum;
|
|
||||||
import com.nflg.product.bomnew.constant.VirtualPackageTypeEnum;
|
|
||||||
import com.nflg.product.bomnew.pojo.dto.*;
|
import com.nflg.product.bomnew.pojo.dto.*;
|
||||||
|
import com.nflg.product.bomnew.pojo.entity.BomNewEbomParentEntity;
|
||||||
|
import com.nflg.product.bomnew.pojo.entity.BomNewPbomParentEntity;
|
||||||
import com.nflg.product.bomnew.pojo.query.BomExceptionQuery;
|
import com.nflg.product.bomnew.pojo.query.BomExceptionQuery;
|
||||||
import com.nflg.product.bomnew.pojo.query.BomNewEbomMaterialQuery;
|
import com.nflg.product.bomnew.pojo.query.BomNewEbomMaterialQuery;
|
||||||
import com.nflg.product.bomnew.pojo.query.BomNewEbomParentQuery;
|
import com.nflg.product.bomnew.pojo.query.BomNewEbomParentQuery;
|
||||||
|
|
@ -557,4 +562,34 @@ public class EbomApi extends BaseApi {
|
||||||
return ResultVO.success(true);
|
return ResultVO.success(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@GetMapping("byHome")
|
||||||
|
public ResultVO<Map<String,List<BomNewHomeBomVO>>> byHome(){
|
||||||
|
Map<String,List<BomNewHomeBomVO>> mp = Maps.newHashMap();
|
||||||
|
//仅取90天内的数据
|
||||||
|
Date date90 = DateUtil.offsetDay(new Date(),-90);
|
||||||
|
int limitNums = 5;
|
||||||
|
List<BomNewEbomParentEntity> eList = bomNewEbomParentService.list(Wrappers.<BomNewEbomParentEntity>lambdaQuery()
|
||||||
|
.eq(BomNewEbomParentEntity::getCreatedBy,SessionUtil.getUserCode())
|
||||||
|
.ge(BomNewEbomParentEntity::getCreatedTime,date90)
|
||||||
|
.orderByDesc(BomNewEbomParentEntity::getCreatedTime)
|
||||||
|
.last(String.format("limit %d",limitNums)));
|
||||||
|
List<BomNewHomeBomVO> ebomList = Convert.toList(BomNewHomeBomVO.class,eList);
|
||||||
|
ebomList.forEach(e->e.setEditStatusName( EbomEditStatusEnum.byValue(e.getEditStatus())));
|
||||||
|
mp.put("ebomList",ebomList);
|
||||||
|
|
||||||
|
List<BomNewPbomParentEntity> pList = bomNewPbomParentService.list(Wrappers.<BomNewPbomParentEntity>lambdaQuery()
|
||||||
|
.eq(BomNewPbomParentEntity::getCreatedBy,SessionUtil.getUserCode())
|
||||||
|
.ge(BomNewPbomParentEntity::getCreatedTime,date90)
|
||||||
|
.orderByDesc(BomNewPbomParentEntity::getCreatedTime)
|
||||||
|
.last(String.format("limit %d",limitNums)));
|
||||||
|
|
||||||
|
List<BomNewHomeBomVO> pbomList = Convert.toList(BomNewHomeBomVO.class,pList);
|
||||||
|
pbomList.forEach(p -> p.setEditStatusName(PBomEditStatusEnum.byValue(p.getEditStatus())));
|
||||||
|
mp.put("pbomList",pbomList);
|
||||||
|
|
||||||
|
return ResultVO.success(mp);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,13 @@
|
||||||
package com.nflg.product.bomnew.constant;
|
package com.nflg.product.bomnew.constant;
|
||||||
|
|
||||||
|
|
||||||
|
import cn.hutool.core.util.EnumUtil;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@Getter
|
@Getter
|
||||||
public enum EbomEditStatusEnum implements ValueEnum<Integer> {
|
public enum EbomEditStatusEnum implements ValueEnum<Integer> {
|
||||||
|
|
@ -11,7 +15,21 @@ public enum EbomEditStatusEnum implements ValueEnum<Integer> {
|
||||||
HANDLER_CREATED(1, "待处理"),//待处理=暂存
|
HANDLER_CREATED(1, "待处理"),//待处理=暂存
|
||||||
HANDLER_FINISHED(2, "已处理"); //已处理=提交
|
HANDLER_FINISHED(2, "已处理"); //已处理=提交
|
||||||
|
|
||||||
|
|
||||||
private final Integer value;
|
private final Integer value;
|
||||||
private final String description;
|
private final String description;
|
||||||
|
|
||||||
|
public static EbomEditStatusEnum findDescriptionByValue(Integer value) {
|
||||||
|
for (EbomEditStatusEnum valueEnum :EbomEditStatusEnum.values()) {
|
||||||
|
if (valueEnum.getValue().equals(value)) {
|
||||||
|
return valueEnum;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String byValue(Integer value){
|
||||||
|
return Optional.ofNullable(findDescriptionByValue(value))
|
||||||
|
.map(EbomEditStatusEnum::getDescription).orElse("");
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,8 @@ package com.nflg.product.bomnew.constant;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public enum PBomEditStatusEnum implements ValueEnum<Integer>{
|
public enum PBomEditStatusEnum implements ValueEnum<Integer>{
|
||||||
|
|
@ -15,4 +17,19 @@ public enum PBomEditStatusEnum implements ValueEnum<Integer>{
|
||||||
|
|
||||||
private final Integer value;
|
private final Integer value;
|
||||||
private final String description;
|
private final String description;
|
||||||
|
|
||||||
|
|
||||||
|
public static PBomEditStatusEnum findDescriptionByValue(Integer value) {
|
||||||
|
for (PBomEditStatusEnum valueEnum :PBomEditStatusEnum.values()) {
|
||||||
|
if (valueEnum.getValue().equals(value)) {
|
||||||
|
return valueEnum;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String byValue(Integer value){
|
||||||
|
return Optional.ofNullable(findDescriptionByValue(value))
|
||||||
|
.map(PBomEditStatusEnum::getDescription).orElse("");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,35 @@
|
||||||
|
package com.nflg.product.bomnew.pojo.vo;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* packageName com.nflg.product.bomnew.pojo.vo
|
||||||
|
*
|
||||||
|
* @author luohj
|
||||||
|
* @className BomNewHomeBomVO
|
||||||
|
* @date 2024/7/30 0030
|
||||||
|
* @description TODO
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class BomNewHomeBomVO implements Serializable {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "主键-行ID")
|
||||||
|
private Long rowId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "物料编码")
|
||||||
|
private String materialNo;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "图号")
|
||||||
|
private String drawingNo;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "处理状态")
|
||||||
|
private Integer editStatus;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "处理状态名称")
|
||||||
|
private String editStatusName;
|
||||||
|
}
|
||||||
|
|
@ -218,12 +218,19 @@ public class ForwardReportService {
|
||||||
BomNewEbomParentVO ebomParentEntity = parentEntityMap.get(vo.getMaterialNo());
|
BomNewEbomParentVO ebomParentEntity = parentEntityMap.get(vo.getMaterialNo());
|
||||||
vo.setDeviseName(ebomParentEntity.getDeviseName());
|
vo.setDeviseName(ebomParentEntity.getDeviseName());
|
||||||
vo.setDeviseUserCode(ebomParentEntity.getDeviseUserCode());
|
vo.setDeviseUserCode(ebomParentEntity.getDeviseUserCode());
|
||||||
|
// vo.setCreatedBy(ebomParentEntity.getCreatedBy());
|
||||||
vo.setCurrentVersion(ebomParentEntity.getCurrentVersion());
|
vo.setCurrentVersion(ebomParentEntity.getCurrentVersion());
|
||||||
vo.setExpireEndTime(ebomParentEntity.getConvertToEbomTime());
|
vo.setExpireEndTime(ebomParentEntity.getExpireEndTime());
|
||||||
vo.setBomRowId(ebomParentEntity.getRowId());
|
vo.setBomRowId(ebomParentEntity.getRowId());
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
vo.setDeviseName(parentEntity.getDeviseName());
|
if(Objects.nonNull(parentEntity)) {
|
||||||
vo.setDeviseUserCode(parentEntity.getDeviseUserCode());
|
vo.setDeviseName(parentEntity.getDeviseName());
|
||||||
|
vo.setDeviseUserCode(parentEntity.getDeviseUserCode());
|
||||||
|
// vo.setCreatedBy(parentEntity.getCreatedBy());
|
||||||
|
vo.setCurrentVersion(parentEntity.getCurrentVersion());
|
||||||
|
vo.setExpireEndTime(parentEntity.getExpireEndTime());
|
||||||
|
}
|
||||||
// if (MaterialshouldBomExistUtil.checkShouldBomExist(vo)) {
|
// if (MaterialshouldBomExistUtil.checkShouldBomExist(vo)) {
|
||||||
// vo.setCurrentVersion(OriginalConstant.NO_BOM_VERSION);
|
// vo.setCurrentVersion(OriginalConstant.NO_BOM_VERSION);
|
||||||
// }
|
// }
|
||||||
|
|
@ -299,13 +306,19 @@ public class ForwardReportService {
|
||||||
if (Objects.nonNull(parentEntityMap) && parentEntityMap.containsKey(vo.getMaterialNo())) {
|
if (Objects.nonNull(parentEntityMap) && parentEntityMap.containsKey(vo.getMaterialNo())) {
|
||||||
BomNewPbomParentVO pbomParentEntity = parentEntityMap.get(vo.getMaterialNo());
|
BomNewPbomParentVO pbomParentEntity = parentEntityMap.get(vo.getMaterialNo());
|
||||||
vo.setDeviseName(pbomParentEntity.getDeviseName());
|
vo.setDeviseName(pbomParentEntity.getDeviseName());
|
||||||
|
vo.setDeviseUserCode(pbomParentEntity.getDeviseUserCode());
|
||||||
vo.setCurrentVersion(pbomParentEntity.getCurrentVersion());
|
vo.setCurrentVersion(pbomParentEntity.getCurrentVersion());
|
||||||
vo.setExpireEndTime(pbomParentEntity.getReleaseTime());
|
vo.setExpireEndTime(pbomParentEntity.getExpireEndTime());
|
||||||
|
// vo.setCreatedBy(pbomParentEntity.getCreatedBy());
|
||||||
}else{
|
}else{
|
||||||
vo.setExpireEndTime(parentEntity.getReleaseTime());
|
if(Objects.nonNull(parentEntity)) {
|
||||||
vo.setDeviseName(parentEntity.getDeviseName());
|
|
||||||
vo.setDeviseUserCode(parentEntity.getDeviseUserCode());
|
|
||||||
|
|
||||||
|
vo.setDeviseName(parentEntity.getDeviseName());
|
||||||
|
vo.setDeviseUserCode(parentEntity.getDeviseUserCode());
|
||||||
|
vo.setExpireEndTime(parentEntity.getExpireEndTime());
|
||||||
|
vo.setCurrentVersion(parentEntity.getCurrentVersion());
|
||||||
|
// vo.setCreatedBy(parentEntity.getCreatedBy());
|
||||||
|
}
|
||||||
// if (MaterialshouldBomExistUtil.checkShouldBomExist(vo)) {
|
// if (MaterialshouldBomExistUtil.checkShouldBomExist(vo)) {
|
||||||
// vo.setCurrentVersion(OriginalConstant.NO_BOM_VERSION);
|
// vo.setCurrentVersion(OriginalConstant.NO_BOM_VERSION);
|
||||||
// }
|
// }
|
||||||
|
|
|
||||||
|
|
@ -90,7 +90,8 @@ public class EBomFormalTreeTask extends RecursiveTask<List<BomNewEbomParentVO>>
|
||||||
detailVO.setBomExist(ebomParentEntity.getBomExist());
|
detailVO.setBomExist(ebomParentEntity.getBomExist());
|
||||||
detailVO.setStatus(ebomParentEntity.getStatus());
|
detailVO.setStatus(ebomParentEntity.getStatus());
|
||||||
detailVO.setBatchNo(ebomParentEntity.getBatchNo());
|
detailVO.setBatchNo(ebomParentEntity.getBatchNo());
|
||||||
detailVO.setCreatedBy(ebomParentEntity.getCreatedBy());
|
// detailVO.setCreatedBy(ebomParentEntity.getCreatedBy());
|
||||||
|
detailVO.setExpireEndTime(ebomParentEntity.getExpireEndTime());
|
||||||
}else {
|
}else {
|
||||||
BomNewEbomParentEntity parent = SpringUtil.getBean(BomNewEbomParentService.class).lambdaQuery().eq(BomNewEbomParentEntity::getRowId, detailVO.getParentRowId()).one();
|
BomNewEbomParentEntity parent = SpringUtil.getBean(BomNewEbomParentService.class).lambdaQuery().eq(BomNewEbomParentEntity::getRowId, detailVO.getParentRowId()).one();
|
||||||
|
|
||||||
|
|
@ -102,7 +103,10 @@ public class EBomFormalTreeTask extends RecursiveTask<List<BomNewEbomParentVO>>
|
||||||
detailVO.setStatus(parent.getStatus());
|
detailVO.setStatus(parent.getStatus());
|
||||||
detailVO.setEditStatus(parent.getEditStatus());
|
detailVO.setEditStatus(parent.getEditStatus());
|
||||||
detailVO.setVirtualPackageIs(parent.getVirtualPackageIs());
|
detailVO.setVirtualPackageIs(parent.getVirtualPackageIs());
|
||||||
|
// detailVO.setCurrentVersion()
|
||||||
|
// detailVO.setCreatedBy(parent.getCreatedBy());
|
||||||
|
detailVO.setCurrentVersion(parent.getCurrentVersion());
|
||||||
|
detailVO.setExpireEndTime(parent.getExpireEndTime());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -209,15 +209,16 @@ public class EBomForwardReport extends BaseForwardReport {
|
||||||
|
|
||||||
if (Objects.nonNull(parentEntityMap) && parentEntityMap.containsKey(vo.getBomRowId())) {
|
if (Objects.nonNull(parentEntityMap) && parentEntityMap.containsKey(vo.getBomRowId())) {
|
||||||
// vo.setCreatedTime(forwardReportVO.getCreatedTime());
|
// vo.setCreatedTime(forwardReportVO.getCreatedTime());
|
||||||
// vo.setExpireEndTime(parentFormal.getConvertToEbomTime());
|
|
||||||
|
|
||||||
BomNewEbomParentVO ebomParentEntity = parentEntityMap.get(vo.getBomRowId());
|
BomNewEbomParentVO ebomParentEntity = parentEntityMap.get(vo.getBomRowId());
|
||||||
vo.setLevelNum(levelNum);
|
vo.setLevelNum(levelNum);
|
||||||
vo.setOrderNumber(orderNum.getAndIncrement() + "");
|
vo.setOrderNumber(orderNum.getAndIncrement() + "");
|
||||||
vo.setDeviseName(ebomParentEntity.getDeviseName());
|
vo.setDeviseName(ebomParentEntity.getDeviseName());
|
||||||
vo.setDeviseUserCode(ebomParentEntity.getDeviseUserCode());
|
vo.setDeviseUserCode(ebomParentEntity.getDeviseUserCode());
|
||||||
|
// vo.setCreatedBy(ebomParentEntity.getCreatedBy());
|
||||||
vo.setCurrentVersion(ebomParentEntity.getCurrentVersion());
|
vo.setCurrentVersion(ebomParentEntity.getCurrentVersion());
|
||||||
|
vo.setExpireEndTime(ebomParentEntity.getExpireEndTime());
|
||||||
} else {
|
} else {
|
||||||
vo.setLevelNum(levelNum);
|
vo.setLevelNum(levelNum);
|
||||||
vo.setOrderNumber(orderNum.getAndIncrement() + "");
|
vo.setOrderNumber(orderNum.getAndIncrement() + "");
|
||||||
|
|
@ -225,6 +226,9 @@ public class EBomForwardReport extends BaseForwardReport {
|
||||||
BomNewEbomParentVO parentVO = noBomParentEntityMap.get(vo.getParentRowId());
|
BomNewEbomParentVO parentVO = noBomParentEntityMap.get(vo.getParentRowId());
|
||||||
vo.setDeviseName(parentVO.getDeviseName());
|
vo.setDeviseName(parentVO.getDeviseName());
|
||||||
vo.setDeviseUserCode(parentVO.getDeviseUserCode());
|
vo.setDeviseUserCode(parentVO.getDeviseUserCode());
|
||||||
|
// vo.setCreatedBy(parentVO.getCreatedBy());
|
||||||
|
vo.setCurrentVersion(parentVO.getCurrentVersion());
|
||||||
|
vo.setExpireEndTime(parentVO.getExpireEndTime());
|
||||||
}
|
}
|
||||||
|
|
||||||
// if (MaterialshouldBomExistUtil.checkShouldBomExist(vo)) {
|
// if (MaterialshouldBomExistUtil.checkShouldBomExist(vo)) {
|
||||||
|
|
@ -481,7 +485,7 @@ public class EBomForwardReport extends BaseForwardReport {
|
||||||
nodeList) {
|
nodeList) {
|
||||||
vo.setBomVersion(parentFormal.getCurrentVersion());
|
vo.setBomVersion(parentFormal.getCurrentVersion());
|
||||||
// vo.setDeviseName(parentFormal.getDeviseName());
|
// vo.setDeviseName(parentFormal.getDeviseName());
|
||||||
vo.setExpireEndTime(parentFormal.getConvertToEbomTime());
|
// vo.setExpireEndTime(parentFormal.getConvertToEbomTime());
|
||||||
}
|
}
|
||||||
nodesList.addAll(nodeList);
|
nodesList.addAll(nodeList);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -110,7 +110,9 @@ public class PBomFormalTreeTask extends RecursiveTask<List<BomNewPbomParentVO>>
|
||||||
detailVO.setDeviseUserCode(ebomParentEntity.getDeviseUserCode());
|
detailVO.setDeviseUserCode(ebomParentEntity.getDeviseUserCode());
|
||||||
|
|
||||||
detailVO.setCreatedTime(ebomParentEntity.getCreatedTime());
|
detailVO.setCreatedTime(ebomParentEntity.getCreatedTime());
|
||||||
detailVO.setCreatedBy(ebomParentEntity.getCreatedBy());
|
|
||||||
|
detailVO.setExpireEndTime(ebomParentEntity.getExpireEndTime());
|
||||||
|
// detailVO.setCreatedBy(ebomParentEntity.getCreatedBy());
|
||||||
|
|
||||||
detailVO.setDeptName(ebomParentEntity.getDeptName());
|
detailVO.setDeptName(ebomParentEntity.getDeptName());
|
||||||
detailVO.setDeptRowId(ebomParentEntity.getDeptRowId());
|
detailVO.setDeptRowId(ebomParentEntity.getDeptRowId());
|
||||||
|
|
@ -125,11 +127,14 @@ public class PBomFormalTreeTask extends RecursiveTask<List<BomNewPbomParentVO>>
|
||||||
if(Objects.nonNull(parent)) {
|
if(Objects.nonNull(parent)) {
|
||||||
detailVO.setDeviseUserCode(parent.getDeviseUserCode());
|
detailVO.setDeviseUserCode(parent.getDeviseUserCode());
|
||||||
detailVO.setDeviseName(parent.getDeviseName());
|
detailVO.setDeviseName(parent.getDeviseName());
|
||||||
|
// detailVO.setCreatedBy(parent.getCreatedBy());
|
||||||
detailVO.setDeptName(parent.getDeptName());
|
detailVO.setDeptName(parent.getDeptName());
|
||||||
detailVO.setDeptRowId(parent.getDeptRowId());
|
detailVO.setDeptRowId(parent.getDeptRowId());
|
||||||
detailVO.setStatus(parent.getStatus());
|
detailVO.setStatus(parent.getStatus());
|
||||||
detailVO.setEditStatus(parent.getEditStatus());
|
detailVO.setEditStatus(parent.getEditStatus());
|
||||||
detailVO.setVirtualPackageIs(parent.getVirtualPackageIs());
|
detailVO.setVirtualPackageIs(parent.getVirtualPackageIs());
|
||||||
|
detailVO.setExpireEndTime(parent.getExpireEndTime());
|
||||||
|
detailVO.setCurrentVersion(parent.getCurrentVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -412,7 +412,9 @@ public class PBomForwardReport extends BaseForwardReport {
|
||||||
vo.setOrderNumber(orderNum.getAndIncrement() + "");
|
vo.setOrderNumber(orderNum.getAndIncrement() + "");
|
||||||
vo.setDeviseName(ebomParentEntity.getDeviseName());
|
vo.setDeviseName(ebomParentEntity.getDeviseName());
|
||||||
vo.setDeviseUserCode(ebomParentEntity.getDeviseUserCode());
|
vo.setDeviseUserCode(ebomParentEntity.getDeviseUserCode());
|
||||||
|
// vo.setCreatedBy(ebomParentEntity.getCreatedBy());
|
||||||
vo.setCurrentVersion(ebomParentEntity.getCurrentVersion());
|
vo.setCurrentVersion(ebomParentEntity.getCurrentVersion());
|
||||||
|
vo.setExpireEndTime(ebomParentEntity.getExpireEndTime());
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
vo.setLevelNum(levelNum);
|
vo.setLevelNum(levelNum);
|
||||||
|
|
@ -422,7 +424,9 @@ public class PBomForwardReport extends BaseForwardReport {
|
||||||
BomNewPbomParentVO parentVO = noBomParentEntityMap.get(vo.getParentRowId());
|
BomNewPbomParentVO parentVO = noBomParentEntityMap.get(vo.getParentRowId());
|
||||||
vo.setDeviseName(parentVO.getDeviseName());
|
vo.setDeviseName(parentVO.getDeviseName());
|
||||||
vo.setDeviseUserCode(parentVO.getDeviseUserCode());
|
vo.setDeviseUserCode(parentVO.getDeviseUserCode());
|
||||||
|
// vo.setCreatedBy(parentVO.getCreatedBy());
|
||||||
|
vo.setCurrentVersion(parentVO.getCurrentVersion());
|
||||||
|
vo.setExpireEndTime(parentVO.getExpireEndTime());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -511,7 +515,7 @@ public class PBomForwardReport extends BaseForwardReport {
|
||||||
vo.setBomVersion(parentFormal.getCurrentVersion());
|
vo.setBomVersion(parentFormal.getCurrentVersion());
|
||||||
// vo.setDeviseName(parentFormal.getDeviseName());
|
// vo.setDeviseName(parentFormal.getDeviseName());
|
||||||
// vo.setCreatedTime(parentFormal.getCreatedTime());
|
// vo.setCreatedTime(parentFormal.getCreatedTime());
|
||||||
vo.setExpireEndTime(parentFormal.getReleaseTime());
|
// vo.setExpireEndTime(parentFormal.getReleaseTime());
|
||||||
|
|
||||||
}
|
}
|
||||||
nodesList.addAll(nodeList);
|
nodesList.addAll(nodeList);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue