Browse Source

ERP同步表

LZH 2 years ago
parent
commit
e306def9f3

+ 23 - 1
ruoyi-admin/src/main/java/com/ruoyi/init/StartService.java

@@ -5,13 +5,17 @@ import com.ruoyi.ams.agv.ndc.config.TestTagConfig;
 import com.ruoyi.ams.agv.ndc.thread.AciServiceThread;
 import com.ruoyi.ams.agv.ndc.thread.AutoTaskThread;
 import com.ruoyi.ams.business.IBusinessService;
+import com.ruoyi.ams.erp.service.ISyncService;
+import com.ruoyi.ams.erp.service.impl.SyncServiceImpl;
+import com.ruoyi.common.utils.http.HttpRequest;
+import com.ruoyi.common.utils.http.HttpUtils;
 import com.ruoyi.system.service.ISysConfigService;
 import com.ruoyi.thread.ServerGs;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.CommandLineRunner;
 import org.springframework.stereotype.Component;
 
-@Component
+@Component("startService")
 public class StartService implements CommandLineRunner {
 
     @Autowired
@@ -22,6 +26,9 @@ public class StartService implements CommandLineRunner {
     private TestTagConfig testTagConfig;
     @Autowired
     private AciService aciService;
+    @Autowired
+    private ISyncService iSyncService;
+
 
     @Override
     public void run(String... args) throws Exception {
@@ -42,5 +49,20 @@ public class StartService implements CommandLineRunner {
             ServerGs server = new ServerGs(2002, configService);
             server.start();
         }
+
+
+    }
+
+    // 同步ERP表,插入mysql
+    public void syncService(){
+        iSyncService.syncSkuType();
+        iSyncService.syncSku();
+        iSyncService.syncSkuBarcode();
+        iSyncService.syncOrderList();
+    }
+
+    // 同步ERP表,sqlserver插入redis
+    public void yongHuErp() throws Exception {
+        HttpRequest.postData(SyncServiceImpl.ERP_SYNC_URL);
     }
 }

+ 26 - 4
ruoyi-admin/src/test/java/com/ruoyi/admin/test/base/WarehouseTest.java

@@ -19,7 +19,10 @@ import com.ruoyi.ams.config.domain.dto.OutWarehouseDTO;
 import com.ruoyi.ams.config.mapper.AsnSoStrategyMapper;
 import com.ruoyi.ams.config.service.IFlowConfigHeaderService;
 import com.ruoyi.ams.config.service.LocationAllocationStrategy;
+import com.ruoyi.ams.erp.domain.ErpBarCodeList;
+import com.ruoyi.ams.erp.domain.ErpOrderList;
 import com.ruoyi.ams.erp.service.ISyncService;
+import com.ruoyi.ams.erp.service.impl.SyncServiceImpl;
 import com.ruoyi.ams.inv.domain.InvLotLocId;
 import com.ruoyi.ams.inv.mapper.InvLotLocIdMapper;
 import com.ruoyi.ams.locationView.domain.form.LocationViewForm;
@@ -180,7 +183,7 @@ public class WarehouseTest {
 
     @Test
     public void test6() {
-        List<BaseLocationInfo> loc1 = baseLocationInfoService.selectSortedLocatinListByZoneId(2L, 1L,null);
+        List<BaseLocationInfo> loc1 = baseLocationInfoService.selectSortedLocatinListByZoneId(2L, 1L, null);
         //List<BaseLocationInfo> loc2 = baseLocationInfoService.selectSortedLocatinListByZoneId(1L,1L);
         //List<BaseLocationInfo> loc3 = baseLocationInfoService.selectSortedLocatinListByZoneId(1L,1L);
         List<Long> locationIdList = new ArrayList<>();
@@ -314,18 +317,37 @@ public class WarehouseTest {
             String order = amsHexdefineDetailService.concatOrder(amsTask, basTask);
             System.out.println("-------------------------->");
             System.out.println(order);
-        }catch (Exception e) {
+        } catch (Exception e) {
             e.printStackTrace();
         }
 
     }
 
     @Test
-    public void testSync(){
+    public void testSync() throws Exception {
         //syncService.syncSkuType();
         //syncService.syncSku();
         //syncService.syncSkuBarcode();
-        syncService.syncOrderList();
+//        syncService.syncOrderList();
+        List<ErpBarCodeList> erpBarCodeListList = new ArrayList<>();
+        ErpBarCodeList erpBarCodeList = new ErpBarCodeList();
+        erpBarCodeList.setOrderName("SO1");
+        erpBarCodeList.setOrderNo(1);
+        erpBarCodeList.setBarcode("11");
+        erpBarCodeListList.add(erpBarCodeList);
+        ErpBarCodeList erpBarCodeList1 = new ErpBarCodeList();
+        erpBarCodeList1.setOrderName("SO1");
+        erpBarCodeList1.setOrderNo(2);
+        erpBarCodeList1.setBarcode("11");
+        erpBarCodeListList.add(erpBarCodeList1);
+
+        ErpOrderList erpOrderList = new ErpOrderList();
+        erpOrderList.setOrderName("rtyu");
+        erpOrderList.setOrderNo(8);
+        erpOrderList.setOrderState("99");
+        boolean b = syncService.writeBack(erpBarCodeListList);
+        boolean b1 = syncService.updaErpOrderStatus(erpOrderList);
+        System.out.println(b + "|" + b1);
     }
 
 }

+ 10 - 7
ruoyi-ui/src/views/base/baseSku/index.vue

@@ -90,10 +90,13 @@
       <el-table-column label="规格" align="center" prop="specs" />
 <!--      <el-table-column label="型号" align="center" prop="model" />-->
       <el-table-column label="物料名称" align="center" prop="desc1" />
+      <el-table-column label="单位" align="center" prop="userdefine1" />
+      <el-table-column label="有无条码" align="center" prop="userdefine2" />
+      <el-table-column label="是否有效" align="center" prop="status" />
 <!--      <el-table-column label="描述2" align="center" prop="desc2" />-->
 <!--      <el-table-column label="自赋码1" align="center" prop="selfCode1" />-->
 <!--      <el-table-column label="自赋码2" align="center" prop="selfCode2" />-->
-      <el-table-column label="是否危险品" align="center" prop="hazardFlag">
+      <el-table-column label="是否托盘" align="center" prop="hazardFlag">
         <template slot-scope="scope">
           <dict-tag :options="dict.type.sys_yes_no" :value="scope.row.hazardFlag"/>
         </template>
@@ -102,11 +105,11 @@
 <!--      <el-table-column label="皮重" align="center" prop="tare" />-->
 <!--      <el-table-column label="毛重" align="center" prop="grossweight" />-->
 <!--      <el-table-column label="净重" align="center" prop="netweight" />-->
-      <el-table-column label="是否激活" align="center" prop="activeFlag">
-        <template slot-scope="scope">
-          <dict-tag :options="dict.type.sys_yes_no" :value="scope.row.activeFlag"/>
-        </template>
-      </el-table-column>
+<!--      <el-table-column label="是否激活" align="center" prop="activeFlag">-->
+<!--        <template slot-scope="scope">-->
+<!--          <dict-tag :options="dict.type.sys_yes_no" :value="scope.row.activeFlag"/>-->
+<!--        </template>-->
+<!--      </el-table-column>-->
 <!--      <el-table-column label="上架库位" align="center" prop="putawayLocation" />-->
 <!--      <el-table-column label="高" align="center" prop="skuHigh" />-->
 <!--      <el-table-column label="长" align="center" prop="skuLength" />-->
@@ -130,7 +133,7 @@
 <!--      </el-table-column>-->
 <!--      <el-table-column label="养护周期(天)" align="center" prop="curingCycle" />-->
 <!--      <el-table-column label="生产企业" align="center" prop="manufacturer" />-->
-      <!--<el-table-column label="${comment}" align="center" prop="userdefine1" />
+      <!--
       <el-table-column label="${comment}" align="center" prop="userdefine2" />
       <el-table-column label="${comment}" align="center" prop="userdefine3" />
       <el-table-column label="${comment}" align="center" prop="userdefine4" />

+ 3 - 1
ruoyi-ui/src/views/base/skuType/index.vue

@@ -47,8 +47,10 @@
       default-expand-all
       :tree-props="{children: 'children', hasChildren: 'hasChildren'}"
     >
+
+      <el-table-column label="ID" prop="itemCode"></el-table-column>
+      <!--      <el-table-column label="父id" align="center" prop="parentCode" />-->
       <el-table-column label="种类名称" prop="itemName"></el-table-column>
-      <!--<el-table-column label="父id" align="center" prop="parentCode" />-->
       <el-table-column label="启用状态" align="center" prop="status">
         <template slot-scope="scope">
           <dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.status"/>

+ 48 - 0
ruoyi-ui/src/views/wms/docAsn/docAsnDetails.vue

@@ -67,6 +67,54 @@
         align="center"
         label="创建时间" width="160">
       </el-table-column>
+      <el-table-column
+        prop="sku"
+        header-align="center"
+        align="center"
+        label="erp品号" width="160">
+      </el-table-column>
+      <el-table-column
+        prop="expectedQty"
+        header-align="center"
+        align="center"
+        label="erp数量" width="100">
+      </el-table-column>
+      <el-table-column
+        prop="dEdi04"
+        header-align="center"
+        align="center"
+        label="erp单据状态" width="160">
+      </el-table-column>
+      <el-table-column
+        prop="dEdi05"
+        header-align="center"
+        align="center"
+        label="erp仓库编号" width="160">
+      </el-table-column>
+      <el-table-column
+        prop="dEdi06"
+        header-align="center"
+        align="center"
+        label="erp是否扫描完成" width="160">
+      </el-table-column>
+      <el-table-column
+        prop="dEdi07"
+        header-align="center"
+        align="center"
+        label="erp项次" width="160">
+      </el-table-column>
+      <el-table-column
+        prop="dEdi08"
+        header-align="center"
+        align="center"
+        label="erp单据类型" width="160">
+      </el-table-column>
+      <el-table-column
+        prop="dEdi09"
+        header-align="center"
+        align="center"
+        label="erp出入库类型" width="160">
+      </el-table-column>
 <!--      <el-table-column-->
 <!--        v-for="(item, index) in tableOption"-->
 <!--        :key="index"-->

+ 42 - 0
ruoyi-ui/src/views/wms/docOrder/docOrderDetails.vue

@@ -57,6 +57,48 @@
         align="center"
         label="拣货数量">
       </el-table-column>
+      <el-table-column
+        prop="sku"
+        header-align="center"
+        align="center"
+        label="erp品号" width="160">
+      </el-table-column>
+      <el-table-column
+        prop="dEdi04"
+        header-align="center"
+        align="center"
+        label="erp单据状态" width="160">
+      </el-table-column>
+      <el-table-column
+        prop="dEdi05"
+        header-align="center"
+        align="center"
+        label="erp仓库编号" width="160">
+      </el-table-column>
+      <el-table-column
+        prop="dEdi06"
+        header-align="center"
+        align="center"
+        label="erp是否扫描完成" width="160">
+      </el-table-column>
+      <el-table-column
+        prop="dEdi07"
+        header-align="center"
+        align="center"
+        label="erp项次" width="160">
+      </el-table-column>
+      <el-table-column
+        prop="dEdi08"
+        header-align="center"
+        align="center"
+        label="erp单据类型" width="160">
+      </el-table-column>
+      <el-table-column
+        prop="dEdi09"
+        header-align="center"
+        align="center"
+        label="erp出入库类型" width="160">
+      </el-table-column>
 <!--       <el-table-column-->
 <!--         v-for="(item, index) in tableOption"-->
 <!--         :key="index"-->

+ 10 - 3
warewms-ams/src/main/java/com/ruoyi/ams/asn/service/impl/WmsDocAsnHeaderServiceImpl.java

@@ -682,7 +682,14 @@ public class WmsDocAsnHeaderServiceImpl implements IWmsDocAsnHeaderService {
     @Transactional
     @Override
     public void addOrUpdateErp(List<ErpOrderList> erpOrderList) {
-        String asnNo = idSequenceUtils.generateId("ASNNO");
+        String asnNo = "";
+//        String erpName = erpOrderList.get(0).getOrderName();
+//        WmsDocAsnHeader asnHeader = this.selectWmsDocAsnHeaderByErpNo(erpName);
+//        if (asnHeader != null && StringUtils.isNotEmpty(asnHeader.getAsnNo())) {
+//            asnNo = asnHeader.getAsnNo();
+//        }else {
+            asnNo = idSequenceUtils.generateId("ASNNO");
+//        }
         String orderNo = "";
         String orderName = "";
         int index = 1;
@@ -695,14 +702,14 @@ public class WmsDocAsnHeaderServiceImpl implements IWmsDocAsnHeaderService {
             details.setSku(erpOrder.getIma01());            //品号
             details.setReceivedQty(BigDecimal.ZERO);
             details.setReceivedQtyEach(BigDecimal.ZERO);
-            details.setExpectedQtyEach(erpOrder.getQty());  //数量
+            details.setExpectedQty(erpOrder.getQty());  //数量
             details.setExpectedQtyEach(erpOrder.getQty());
             details.setCreateTime(new Date());
             details.setCreateBy(erpOrder.getCreateUser());
             details.setdEdi04(erpOrder.getVaild());         //单据状态
             details.setdEdi05(erpOrder.getStockId());       //仓库编号
             details.setdEdi06(erpOrder.getOrderState());    //是否扫描完成
-            details.setdEdi07(erpOrder.getOrderNo() + "");    //项次
+            details.setdEdi07(orderNo);    //项次
             details.setdEdi08(erpOrder.getOrderType());     //erp单据类型
             details.setdEdi09(erpOrder.getInout());         //erp出入库类型
             wmsDocAsnDetailsMapper.insertWmsDocAsnDetails(details);

+ 28 - 0
warewms-ams/src/main/java/com/ruoyi/ams/erp/domain/ErpBarCodeList.java

@@ -0,0 +1,28 @@
+package com.ruoyi.ams.erp.domain;
+
+import lombok.Data;
+
+import java.math.BigDecimal;
+
+@Data
+public class ErpBarCodeList {
+    private String barcode;
+    private String orderName;
+    private Integer orderNo;
+    private BigDecimal qty;
+    private String order_type;
+    private String inOut;
+    private String stockId;
+    private String boxNo;
+    private String erpResult;
+    private String vaild;
+    private String createUser;
+    private String createDate;
+    private String alterUser;
+    private String alterDate;
+    private String userdefine1;
+    private String userdefine2;
+    private String userdefine3;
+    private String userdefine4;
+    private String userdefine5;
+}

+ 10 - 1
warewms-ams/src/main/java/com/ruoyi/ams/erp/service/ISyncService.java

@@ -1,11 +1,20 @@
 package com.ruoyi.ams.erp.service;
 
+import com.ruoyi.ams.erp.domain.ErpBarCodeList;
+import com.ruoyi.ams.erp.domain.ErpOrderList;
+import com.ruoyi.common.exception.ServiceException;
+
+import java.util.List;
+
 public interface ISyncService {
     void syncSkuType();
 
-    void syncSku();
+    void syncSku() throws ServiceException;
 
     void syncSkuBarcode();
 
     void syncOrderList();
+
+    boolean writeBack(List<ErpBarCodeList> erpBarCodeListList) throws Exception;
+    boolean updaErpOrderStatus(ErpOrderList erpOrderList) throws Exception;
 }

+ 31 - 11
warewms-ams/src/main/java/com/ruoyi/ams/erp/service/impl/SyncServiceImpl.java

@@ -3,6 +3,7 @@ package com.ruoyi.ams.erp.service.impl;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.ruoyi.ams.asn.service.IWmsDocAsnHeaderService;
+import com.ruoyi.ams.erp.domain.ErpBarCodeList;
 import com.ruoyi.ams.erp.domain.ErpOrderList;
 import com.ruoyi.ams.erp.service.ISyncService;
 import com.ruoyi.ams.order.service.IWmsDocOrderHeaderService;
@@ -14,6 +15,9 @@ import com.ruoyi.base.service.IBaseSkuService;
 import com.ruoyi.base.service.IBaseSkuTypeService;
 import com.ruoyi.base.service.ICodeSkuRelationshipService;
 import com.ruoyi.common.exception.ServiceException;
+import com.ruoyi.common.utils.http.HttpRequest;
+import com.ruoyi.common.utils.http.HttpUtils;
+import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.data.redis.core.RedisTemplate;
 import org.springframework.stereotype.Service;
@@ -24,10 +28,13 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
+@Slf4j
 @Service
 public class SyncServiceImpl implements ISyncService {
 
-
+    public static final String ERP_SYNC_URL = "http://localhost:8089/warewms/erp/erpWriteData/erpSync";
+    public static final String ERP_WRITE_BACK_URL = "http://192.168.1.46:8089/warewms/erp/erpWriteData/writeData";
+    public static final String ERP_UPDATE_STATUS_URL = "http://192.168.1.46:8089/warewms/erp/erpWriteData/updateOrderStatus";
     @Autowired
     private IBaseSkuTypeService baseSkuTypeService;
     @Autowired
@@ -60,14 +67,15 @@ public class SyncServiceImpl implements ISyncService {
 
     @Transactional
     @Override
-    public void syncSku() {
+    public void syncSku()  {
         // 品号基础表
         List<JSONObject> list = (List<JSONObject>) redisTemplate.opsForValue().get("erpProOb");
         if (list != null && list.size() > 0) {
             for (JSONObject jsonObject : list) {
                 BaseSkuType skuType = baseSkuTypeService.selectBaseSkuTypeByRemark(jsonObject.getString("imaType"));
                 if (skuType == null) {
-                    throw new ServiceException("物料类型不存在");
+                  log.error("ERP同步表-物料类型不存在:"+jsonObject.getString("imaType"));
+                    return;
                 }
                 BaseSku baseSku = new BaseSku();
                 baseSku.setCustomerId(Constant.CUSTOMER_ID);
@@ -111,33 +119,45 @@ public class SyncServiceImpl implements ISyncService {
                 ErpOrderList erpOrderList = JSON.parseObject(code.toJSONString(), ErpOrderList.class);
                 if (erpOrderList.getInout().equals("1")) {
                     List<ErpOrderList> current;
-                    if (inmap.get(erpOrderList.getOrderName() + erpOrderList.getOrderNo()) != null) {
-                        current = inmap.get(erpOrderList.getOrderName() + erpOrderList.getOrderNo());
+                    if (inmap.get(erpOrderList.getOrderName()) != null ) {
+                        current = inmap.get(erpOrderList.getOrderName());
                     } else {
                         current = new ArrayList<>();
                     }
                     current.add(erpOrderList);
-                    inmap.put(erpOrderList.getOrderName() + erpOrderList.getOrderNo(), current);
+                    inmap.put(erpOrderList.getOrderName(), current);
                 } else {
                     List<ErpOrderList> current;
-                    if (outmap.get(erpOrderList.getOrderName() + erpOrderList.getOrderNo()) != null) {
-                        current = outmap.get(erpOrderList.getOrderName() + erpOrderList.getOrderNo());
+                    if (outmap.get(erpOrderList.getOrderName()) != null) {
+                        current = outmap.get(erpOrderList.getOrderName());
                     } else {
                         current = new ArrayList<>();
                     }
                     current.add(erpOrderList);
-                    outmap.put(erpOrderList.getOrderName() + erpOrderList.getOrderNo(), current);
+                    outmap.put(erpOrderList.getOrderName(), current);
                 }
             }
-//            System.out.println(JSON.toJSONString(inmap));
             for (Map.Entry<String, List<ErpOrderList>> entry : inmap.entrySet()) {
                 wmsDocAsnHeaderService.addOrUpdateErp(entry.getValue());
             }
             for (Map.Entry<String, List<ErpOrderList>> entry : outmap.entrySet()) {
                 wmsDocOrderHeaderService.addOrUpdateErp(entry.getValue());
             }
-
             redisTemplate.delete("erpOrderList");
         }
     }
+
+    @Override
+    public boolean writeBack(List<ErpBarCodeList> erpBarCodeListList) throws Exception {
+        String jsonString = JSON.toJSONString(erpBarCodeListList);
+        String result = HttpRequest.postData(SyncServiceImpl.ERP_WRITE_BACK_URL, jsonString);
+        return result.equals("200");
+    }
+
+    @Override
+    public boolean updaErpOrderStatus(ErpOrderList erpOrderList) throws Exception {
+        String jsonString = JSON.toJSONString(erpOrderList);
+        String result = HttpRequest.postData(SyncServiceImpl.ERP_UPDATE_STATUS_URL, jsonString);
+        return result.equals("200");
+    }
 }

+ 16 - 5
warewms-ams/src/main/java/com/ruoyi/ams/order/service/impl/WmsDocOrderHeaderServiceImpl.java

@@ -1223,12 +1223,19 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
     }
 
     @Override
-    public void addOrUpdateErp(List<ErpOrderList> erpOrderLists) {
-        String orderNo = idSequenceUtils.generateId("ORDERNO");
+    public void addOrUpdateErp(List<ErpOrderList> erpOrderList) {
+        String orderNo = "";
+//        String erpName = erpOrderList.get(0).getOrderName();
+//        WmsDocOrderHeader header = this.selectWmsDocOrderHeaderByErpNo(erpName);
+//        if (header != null && StringUtils.isNotEmpty(header.getOrderNo())) {
+//            orderNo = header.getOrderNo();
+//        } else {
+            orderNo = idSequenceUtils.generateId("ORDERNO");
+//        }
         String erpOrderNo = "";
         String erpOrderName = "";
         int index = 1;
-        for (ErpOrderList erpOrder : erpOrderLists) {
+        for (ErpOrderList erpOrder : erpOrderList) {
             erpOrderName = erpOrder.getOrderName();
             erpOrderNo = erpOrder.getOrderNo() + "";
             WmsDocOrderDetails details = new WmsDocOrderDetails();
@@ -1251,7 +1258,7 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
             details.setdEdi04(erpOrder.getVaild());         //单据状态
             details.setdEdi05(erpOrder.getStockId());       //仓库编号
             details.setdEdi06(erpOrder.getOrderState());    //是否扫描完成
-            details.setdEdi07(erpOrder.getOrderNo() + "");    //项次
+            details.setdEdi07(orderNo);    //项次
             details.setdEdi08(erpOrder.getOrderType());     //erp单据类型
             details.setdEdi09(erpOrder.getInout());         //erp出入库类型
             details.setLineStatus("00");
@@ -1262,7 +1269,11 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
         }
         WmsDocOrderHeader orderHeader = new WmsDocOrderHeader();
         orderHeader.setOrderNo(orderNo);            //erp单号
-        orderHeader.setOrderType("OD");
+        if (erpOrderList.get(0).getOrderType()=="axmt620"){
+            orderHeader.setOrderType("BH");
+        }else {
+            orderHeader.setOrderType("ZC");
+        }
         orderHeader.setOrderStatus("00");
         orderHeader.setCustomerId(Constant.CUSTOMER_ID);
         orderHeader.setEdiSendFlag("N");

+ 2 - 2
warewms-base/src/main/java/com/ruoyi/base/service/impl/BaseSkuServiceImpl.java

@@ -97,8 +97,8 @@ public class BaseSkuServiceImpl implements IBaseSkuService {
 
     @Override
     public int saveOrUpdate(BaseSku baseSku) {
-        BaseSku query = baseSkuMapper.selectBaseSkuByCustomerId(Constant.CUSTOMER_ID, baseSku.getSku());
-        if (query == null) {
+        BaseSku basSku = baseSkuMapper.selectBaseSkuByCustomerId(Constant.CUSTOMER_ID, baseSku.getSku());
+        if (basSku == null) {
             return baseSkuMapper.insertBaseSku(baseSku);
         } else {
             return baseSkuMapper.updateBaseSku(baseSku);

+ 2 - 0
warewms-base/src/main/java/com/ruoyi/base/service/impl/BaseSkuTypeServiceImpl.java

@@ -101,6 +101,8 @@ public class BaseSkuTypeServiceImpl implements IBaseSkuTypeService {
         query.setRemark(baseSkuType.getRemark());
         List<BaseSkuType> list = baseSkuTypeMapper.selectBaseSkuTypeList(query);
         if (list != null && list.size() > 0) {
+            BaseSkuType skuTypeUpdate = list.get(0);
+            skuTypeUpdate.setItemName(baseSkuType.getItemName());
             return baseSkuTypeMapper.updateBaseSkuType(baseSkuType);
         } else {
             return baseSkuTypeMapper.insertBaseSkuType(baseSkuType);

+ 5 - 0
warewms-base/src/main/java/com/ruoyi/base/service/impl/CodeSkuRelationshipServiceImpl.java

@@ -172,6 +172,11 @@ public class CodeSkuRelationshipServiceImpl implements ICodeSkuRelationshipServi
         if (query == null || query.size() == 0) {
             return codeSkuRelationshipMapper.insertCodeSkuRelationship(codeSkuRelationship);
         } else {
+            CodeSkuRelationship relationshipUpdate = new CodeSkuRelationship();
+            relationshipUpdate.setId(codeSkuRelationship.getId());
+            relationshipUpdate.setSku(codeSkuRelationship.getSku());
+            relationshipUpdate.setSn(codeSkuRelationship.getSn());
+            relationshipUpdate.setStatus(codeSkuRelationship.getStatus());
             return codeSkuRelationshipMapper.updateCodeSkuRelationship(codeSkuRelationship);
         }
     }

+ 1 - 6
warewms-base/src/main/resources/mapper/base/BaseSkuMapper.xml

@@ -62,12 +62,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </sql>
 
     <select id="selectBaseSkuList" parameterType="BaseSku" resultMap="BaseSkuResult">
-        select b.customer_id, b.sku, sk.item_name sku_type, b.specs, b.model, b.desc1, b.desc2, b.self_code1, b.self_code2, b.hazard_flag, b.pack_id, b.tare,
-        b.grossweight, b.netweight, b.active_flag, b.putaway_location, b.putaway_zone, b.putaway_rule, b.sku_high, b.sku_length,
-        b.sku_width, b.qtymax, b.qtymin, b.default_receiving_uom, b.default_shipment_uom, b.qc_rule, b.qc_time, b.shelflife, b.cold_flag,
-        b.sterilization_flag, b.curing_cycle, b.manufacturer, b.userdefine1, b.userdefine2, b.userdefine3, b.userdefine4, b.userdefine5,
-        b.userdefine6, b.userdefine7, b.userdefine8, b.userdefine9, b.userdefine10, b.expiration_date_check, b.overcharge_check,
-        b.qc_check, b.create_by, b.create_time, b.update_by, b.update_time, b.remark
+        select b.*,sk.item_name sku_type
         from base_sku b
         left join base_sku_type sk on b.sku_type = sk.item_code
         <where>