‘linchangsheng’ 2 周之前
父节点
当前提交
b313ffa11f
共有 1 个文件被更改,包括 14 次插入1 次删除
  1. 14 1
      src/main/java/com/gree/mall/manager/logic/goods/GoodsLogic.java

+ 14 - 1
src/main/java/com/gree/mall/manager/logic/goods/GoodsLogic.java

@@ -433,7 +433,7 @@ public class GoodsLogic {
         goodsBean.setUpdateTime(new Date());
         goodsBean.setCreateTime(creatDate);
 
-        if (StringUtil.isEmpty(goodsBean.getPutCompanyId())) {
+        if (!StringUtil.isEmpty(goodsBean.getPutCompanyId())) {
             goodsBean.setPutCompanyId(goodsBean.getPutCompanyId());
             String[] split = StringUtils.split(goodsBean.getPutCompanyId(), ",");
 
@@ -587,6 +587,19 @@ public class GoodsLogic {
         goodsBean.setCompanyWechatId(adminUser.getLoginCompanyWechatId());
         goodsBean.setCompanyName(adminUser.getLoginCompanyName());
 
+        if (!StringUtil.isEmpty(goodsBean.getPutCompanyId())) {
+            goodsBean.setPutCompanyId(goodsBean.getPutCompanyId());
+            String[] split = StringUtils.split(goodsBean.getPutCompanyId(), ",");
+
+            String name ="";
+            for (String s : split) {
+                AdminCompanyWechat adminCompanyWechat = adminCompanyWechatService.getById(s);
+                name = name+adminCompanyWechat.getCompanyName()+",";
+            }
+
+            goodsBean.setPutCompanyName(name);
+        }
+
         final AdminCompanyWechat companyWechat = adminCompanyWechatService.getById(adminUser.getLoginCompanyWechatId());
 
         List<GoodsSpec> notRemoveList = new ArrayList<>();