From b9f37aea5587d0fd70d41df672fb1cf1267efead Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=B9=E9=B9=8F=E9=A3=9E?= Date: Mon, 17 Jun 2024 10:43:02 +0800 Subject: [PATCH] =?UTF-8?q?optimize:=20=E6=B7=BB=E5=8A=A0=E7=89=A9?= =?UTF-8?q?=E6=96=99=E6=97=B6=EF=BC=8C=E5=8E=BB=E6=8E=89=E5=90=8C=E6=AD=A5?= =?UTF-8?q?=E5=88=B0OA=EF=BC=8C=E7=94=B1=E4=B8=BB=E7=89=A9=E6=96=99?= =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E6=9D=A5=E5=90=8C=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bomnew/service/MaterialService.java | 28 +++++++++---------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/MaterialService.java b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/MaterialService.java index 7d13797b..cead62b0 100644 --- a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/MaterialService.java +++ b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/MaterialService.java @@ -1,7 +1,6 @@ package com.nflg.product.bomnew.service; -import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.date.DateUtil; @@ -35,7 +34,6 @@ import javax.annotation.Resource; import java.io.IOException; import java.time.LocalDateTime; import java.util.*; -import java.util.concurrent.CompletableFuture; import java.util.stream.Collectors; @Service @@ -192,25 +190,25 @@ public class MaterialService { ma.setApplyUserCode(userInfo.getRealName()); ma.setApplyDeptName(userInfo.getDepartName()); ma.setMaterialUnit("PC"); - ma.setProcessState(10); + // ma.setProcessState(10); if(StrUtil.isNotBlank(md.getProjectType())){ ma.setProjectType(md.getProjectType()); } resultList.add(ma); - AddMaterialMainDTO ent=new AddMaterialMainDTO(); - BeanUtil.copyProperties(ma,ent); - ent.setRelCategoryCode(relMaterialCategory); - ent.setReuseOfOnceState(0); - syncOaEnts.add(ent); + // AddMaterialMainDTO ent=new AddMaterialMainDTO(); + // BeanUtil.copyProperties(ma,ent); + // ent.setRelCategoryCode(relMaterialCategory); + // ent.setReuseOfOnceState(0); + // syncOaEnts.add(ent); md.setMaterialNo(ma.getMaterialNo()); result.put(md.getKey(),md); } materialMainService.saveOrUpdateBatch(resultList); - initCategoryInfo(syncOaEnts); + // initCategoryInfo(syncOaEnts); //同步OA - sysnToOa(syncOaEnts); + // sysnToOa(syncOaEnts, userInfo); // CompletableFuture.runAsync(() -> sysnToOa(syncOaEnts),syncOAThreadPool); return result; } @@ -307,8 +305,8 @@ public class MaterialService { * @param data */ @Transactional(rollbackFor = Exception.class) - public void sysnToOa(List data) { - Map result = getHttpMap(); + public void sysnToOa(List data, LoginUserInfoDTO userInfo) { + Map result = getHttpMap(userInfo.getUserCode()); List> list = new ArrayList<>(); data.forEach(u -> { @@ -329,7 +327,7 @@ public class MaterialService { material.put("MREMA", u.getMaterialDesc()); material.put("MMANU", u.getMaterialBrand()); material.put("ATTYP", relCategoryCode); - material.put("ERNAM", SessionUtil.getUserCode()); + material.put("ERNAM", userInfo.getUserCode()); material.put("MEINS", u.getMaterialUnit()); material.put("DUPLICATEITEMS", u.getReuseOfOnceState().equals(1) ? "2" : "1");// 是否一次性使用物料 0:否1:是 material.put("categoryTreeName", u.getCategoryNameTree()); @@ -368,9 +366,9 @@ public class MaterialService { } } - public Map getHttpMap() { + public Map getHttpMap(String userCode) { Map result = new LinkedHashMap<>(); - result.put("userid", SessionUtil.getUserCode()); + result.put("userid", userCode); result.put("summary", NacosConfig.getNacosConfig().getSummary()); return result; }