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; }