zhs 2 anni fa
parent
commit
f2873cdcd3

+ 2 - 2
src/main/java/com/tld/mapper/WarehouseTransferMapper.java

@@ -33,9 +33,9 @@ public interface WarehouseTransferMapper {
 
     void delWarehouseTransfer(@Param("id") String id);
 
-    String getScanNum(WarehouseTransfer warehouseTransfer1);
+    Integer getScanNum(WarehouseTransfer warehouseTransfer1);
 
-    String getScanNumWare(WarehouseTransfer warehouseTransfer1);
+    Integer getScanNumWare(WarehouseTransfer warehouseTransfer1);
 
     WarehouseTransfer getAsknInfo(AskGoods askGoods);
 }

+ 8 - 0
src/main/java/com/tld/model/WarehouseTransfer.java

@@ -110,4 +110,12 @@ public class WarehouseTransfer {
      * 账套
      */
     private String accountSleeve;
+    /**
+     * 物料类别
+     */
+    private String partType;
+    /**
+     * 要货仓库状态
+     */
+    private String askType;
 }

+ 0 - 5
src/main/java/com/tld/service/impl/AskGoodsServiceImpl.java

@@ -535,11 +535,6 @@ public class AskGoodsServiceImpl implements AskGoodsService {
             //查询物料信息
             MaterialClass material = warehousingMapper.getMaterial(new Notice().setMaterialCode(askGoods.getWllbCode()));
             askGoods.setMaterialId(material.getTldId());
-            if(material.getPartType().equals("半成品")){
-                askGoods.setStorageLocationCode("000000");
-            } else if(material.getPartType().equals("产成品") && material.getIsRecommend().equals("0")){
-                askGoods.setStorageLocationCode("111111");
-            }
             //查询库存
             List<Inventory> inventory = askGoodsMapper.getInventoryInfo(askGoods);
             if(inventory.size() == 0){

+ 1 - 2
src/main/java/com/tld/service/impl/DeliveryServiceImpl.java

@@ -71,9 +71,8 @@ public class DeliveryServiceImpl implements DeliveryService {
                 }
                 map.put("data", list);
             } else if(materialClass.getPartType().equals("半成品")){
-                String storageLocationCode = "000000,";
                 List<Inventory> list = new LinkedList<>();
-                for(Inventory inventory : deliveryMapper.getInventory(storageLocationCode, delivery)){
+                for(Inventory inventory : deliveryMapper.getInventory(delivery.getStorageCode(), delivery)){
                     int productNum = deliveryMapper.getProductNumVitrual(inventory);
                     if(Integer.parseInt(inventory.getAmount()) < 0){
                         map.put("msg", "500");

+ 40 - 24
src/main/java/com/tld/service/impl/WarehouseTransferServiceImpl.java

@@ -28,6 +28,8 @@ public class WarehouseTransferServiceImpl implements WarehouseTransferService {
     private final WarehousingMapper warehousingMapper;
     //字典
     private final DictionaryMapper dictionaryMapper;
+    //产成品
+    private final DeliveryMapper deliveryMapper;
     //用户
     private final UserMapper userMapper;
 
@@ -36,10 +38,11 @@ public class WarehouseTransferServiceImpl implements WarehouseTransferService {
         Map<String, Object> map = new HashMap<>();
         try{
             List<WarehouseTransfer> list = warehouseTransferMapper.getWarehouseTransfer(warehouseTransfer);
-            List<String> scanNum = new LinkedList<>();
+            List<Integer> scanNum = new LinkedList<>();
             Map<String, Object> mapVal = new HashMap<>();
             for(WarehouseTransfer warehouseTransfer1 : list){
-                if(warehouseTransfer1.getAskGoodsWarehouseId().equals("6062e900-b3f0-4a5a-b")){
+                if(warehouseTransfer1.getAskType().equals("0") || warehouseTransfer1.getAskType().equals("1")
+                    || warehouseTransfer1.getAskType().equals("2")){
                     warehouseTransfer1.setUniqueCode(warehouseTransfer.getUniqueCode());
                     warehouseTransfer.setMaterialCode(warehouseTransfer.getMaterialCode());
                     scanNum.add(warehouseTransferMapper.getScanNum(warehouseTransfer1));//扫描总数
@@ -68,11 +71,6 @@ public class WarehouseTransferServiceImpl implements WarehouseTransferService {
         Map<String, Object> map = new HashMap<>();
         try{
             Dictionary dictionary = dictionaryMapper.getWarehouseInfo(warehouseTransfer);
-            if(dictionary.getName().indexOf("原材料库") != -1){
-                map.put("msg", "500");
-                map.put("errMsg", "请扫描标签");
-                return map;
-            }
             List<Inventory> list = new LinkedList<>();
             for(Inventory inventory : warehouseTransferMapper.getMaterialCk(warehouseTransfer)){
                 AskGoods askGoods1 = warehouseTransferMapper.getAsk(inventory);
@@ -103,11 +101,20 @@ public class WarehouseTransferServiceImpl implements WarehouseTransferService {
         try{
             List<AskGoods> list = askGoodsMapper.getVirtualUniqueCode(uniqueCode, type, askGoodsId);
             //入库信息
-//            List<WarehousingVirtual> warehousing = new LinkedList<>();
+            List<WarehousingVirtual> warehousing = new LinkedList<>();
             String warehouseTransferCode = codeGenerateYK(); //移库单
             for(AskGoods askGoods : list){
                 askGoods.setStorageCode(warehouseTransferCode);
-                Inventory inventory = askGoodsMapper.getInventory(askGoods);
+                //查询物料信息
+                MaterialClass material = warehousingMapper.getMaterial(new Notice().setMaterialCode(askGoods.getWllbCode()));
+                Inventory inventory = new Inventory();
+                if(material.getPartType().equals("原材料")){
+                    inventory = askGoodsMapper.getInventory(askGoods);
+                } else if(material.getPartType().equals("产成品")){
+                    inventory = deliveryMapper.getInventoryHalf(askGoods);
+                } else if(material.getPartType().equals("半成品")){
+                    inventory = askGoodsMapper.getInventoryInfo(askGoods).get(0);
+                }
                 if(inventory == null){
                     throw new Exception("库存不存在");
                 }
@@ -121,20 +128,20 @@ public class WarehouseTransferServiceImpl implements WarehouseTransferService {
                 String materialId = askGoodsMapper.getMaterialId(askGoods.getWllbCode());//查询物料id
                 WarehouseTransfer warehouseTransfer = warehouseTransferMapper.getWarehouseTransferDetailed(askGoodsId, materialId);//查询移库申请内容
 //                //入库流水信息
-//                WarehousingVirtual WarehousingVirtual1 = new WarehousingVirtual()
-//                        .setWllbCode(askGoods.getWllbCode()) //物料code
-//                        .setSuppId(askGoods.getSupplierId())//供应商id
-//                        .setSerial(askGoods.getSerial())//连翻号
-//                        .setProducDate(askGoods.getProducDate())//批次
-//                        .setNum(askGoods.getNum())//入库数量
-//                        .setSeq("0")
-//                        .setType(askGoods.getType())//入库类型
-//                        .setUserId(askGoods.getUserId())//用户
-//                        .setDepartmentId(askGoods.getDepartmentId())//部门
-//                        .setStorageLocationCode(askGoods.getStorageLocationCode())//库位编号
-//                        .setStorageCode(warehouseTransferCode)//移库单号
-//                        .setWbs(warehouseTransfer.getWbs());//wbs
-//                warehousing.add(WarehousingVirtual1);
+                WarehousingVirtual WarehousingVirtual1 = new WarehousingVirtual()
+                        .setWllbCode(askGoods.getWllbCode()) //物料code
+                        .setSuppId(askGoods.getSupplierId())//供应商id
+                        .setSerial(askGoods.getSerial())//连翻号
+                        .setProducDate(askGoods.getProducDate())//批次
+                        .setNum(askGoods.getNum())//入库数量
+                        .setSeq("0")
+                        .setType(askGoods.getType())//入库类型
+                        .setUserId(askGoods.getUserId())//用户
+                        .setDepartmentId(askGoods.getDepartmentId())//部门
+                        .setStorageLocationCode(askGoods.getStorageLocationCode())//库位编号
+                        .setStorageCode(warehouseTransferCode)//移库单号
+                        .setWbs(warehouseTransfer.getWbs());//wbs
+                warehousing.add(WarehousingVirtual1);
                 askGoodsMapper.addRemoval(askGoods);//插入出库流水
                 askGoodsMapper.deleteVirtual(askGoods.getId());//删除已出虚拟表库存
                 warehouseTransferMapper.updateOutNum(askGoods.getNum(), askGoodsId, materialId);//修改出库数量
@@ -154,7 +161,7 @@ public class WarehouseTransferServiceImpl implements WarehouseTransferService {
                     .setAskGoodsWarehouseId(warehouseTransferF.getAskGoodsWarehouseId()) //要货仓库id
                     .setWarehouseTransferType(warehouseTransferF.getWarehouseTransferType()); //移库类型
             warehouseTransferMapper.addReturnGsWarehouseTransferF(warehouseTransfer1);//新增返回gs数据父表信息
-//            warehousingMapper.addStorage(warehousing);//入库流水
+            warehousingMapper.addStorage(warehousing);//入库流水
             map.put("data", warehouseTransferCode);
             map.put("msg", "200");
         }catch (Exception e){
@@ -178,6 +185,9 @@ public class WarehouseTransferServiceImpl implements WarehouseTransferService {
             String warehouseTransferCode = codeGenerateYK(); //移库单
             //查询入库所需要的信息
             for(WarehousingVirtual warehousingVirtual : warehousingVirtualList) {
+                //查询物料信息
+                Notice notice = new Notice().setMaterialCode(warehousingVirtual.getWllbCode());
+                MaterialClass material = warehousingMapper.getMaterial(notice);
                 //查询采购单信息
                 String materialId = askGoodsMapper.getMaterialId(warehousingVirtual.getWllbCode());//查询物料id
                 WarehouseTransfer warehouseTransfer = warehouseTransferMapper.getWarehouseTransferDetailed(warehousingVirtual.getWarehouseTransferId(), materialId);//查询移库申请内容
@@ -196,6 +206,12 @@ public class WarehouseTransferServiceImpl implements WarehouseTransferService {
                 warehousingVirtual.setStorageCode(warehouseTransferCode);
                 list.add(warehousingVirtual);
                 warehouseTransferMapper.updateOutNum(warehousingVirtual.getNum(), warehousingVirtual.getWarehouseTransferId(), materialId);//修改出库数量
+
+
+                AskGoods askGoods = new AskGoods();
+                askGoodsMapper.addRemoval(askGoods);//插入出库流水
+
+
                 WarehouseTransfer warehouseTransfer1 = new WarehouseTransfer()
                         .setWarehouseTransferId(warehouseTransfer.getWarehouseTransferId()) //移库单id
                         .setEntryNumber(warehouseTransfer.getEntryNumber())//分录号

+ 2 - 5
src/main/java/com/tld/service/impl/WarehousingServiceImpl.java

@@ -397,7 +397,6 @@ public class WarehousingServiceImpl implements WarehousingService {
 //                map.put("errMsg", "入库数量大于通知单数量!");
 //                return map;
 //            }
-            notice.setStorageLocationCode("000000");
             if(warehousingMapper.getInventoryNotice(notice) != 0){
                 warehousingMapper.updateInventoryNotice(notice);
             } else {
@@ -409,7 +408,7 @@ public class WarehousingServiceImpl implements WarehousingService {
             WarehousingVirtual warehousingVirtual = new WarehousingVirtual()
                     .setWllbCode(notice1.getMaterialCode())
                     .setUserId(notice.getUserId())
-                    .setStorageLocationCode("000000")
+                    .setStorageLocationCode(notice.getStorageLocationCode())
                     .setProducDate(notice1.getNoticeTime())
                     .setNum(notice.getWarehousingNum())
                     .setStorageCode(storageCode)
@@ -426,7 +425,7 @@ public class WarehousingServiceImpl implements WarehousingService {
                     .setMaterialId(notice1.getMaterialId())//物料id
                     .setId(notice1.getId())//分录单id
                     .setWarehousingNum(notice.getWarehousingNum())//入库数量
-                    .setStorageLocationCode("000000")//库位编号
+                    .setStorageLocationCode(notice.getStorageLocationCode())//库位编号
                     .setUserName(notice.getUserName());//用户名称
             warehousingMapper.addReturnWarehousing(returnWarehousing);
             map.put("data", storageCode);
@@ -447,7 +446,6 @@ public class WarehousingServiceImpl implements WarehousingService {
         RLock lock = redissonClient.getLock(notice.getMaterialId());
         lock.lock();
         try{
-            notice.setStorageLocationCode("000000");
             Inventory inventory = warehousingMapper.getHalfInventory(notice);//库存信息
             AskGoods askGoods = warehousingMapper.getAskGoodsHalf(notice);//要货单信息
             if(askGoods.getType().equals("1")){
@@ -610,7 +608,6 @@ public class WarehousingServiceImpl implements WarehousingService {
                     map.put("data", list);
                     map.put("msg", "210");
                 } else {
-                    notice.setStorageLocationCode("111111");
                     if(warehousingMapper.getInventoryNotice(notice) != 0){
                         warehousingMapper.updateInventoryNotice(notice);
                     } else {

+ 136 - 0
src/main/java/com/tld/util/SnowflakeUtil.java

@@ -0,0 +1,136 @@
+package com.tld.util;
+
+/**
+ * 雪花算法
+ * Twitter_Snowflake<br>
+ * SnowFlake的结构如下(每部分用-分开):<br>
+ * 0 - 0000000000 0000000000 0000000000 0000000000 0 - 00000 - 00000 - 000000000000 <br>
+ * 1位标识,由于long基本类型在Java中是带符号的,最高位是符号位,正数是0,负数是1,所以id一般是正数,最高位是0<br>
+ * 41位时间截(毫秒级),注意,41位时间截不是存储当前时间的时间截,而是存储时间截的差值(当前时间截 - 开始时间截)
+ * 得到的值),这里的的开始时间截,一般是我们的id生成器开始使用的时间,由我们程序来指定的(如下下面程序IdWorker类的startTime属性)。41位的时间截,可以使用69年,年T = (1L << 41) / (1000L * 60 * 60 * 24 * 365) = 69<br>
+ * 10位的数据机器位,可以部署在1024个节点,包括5位datacenterId和5位workerId<br>
+ * 12位序列,毫秒内的计数,12位的计数顺序号支持每个节点每毫秒(同一机器,同一时间截)产生4096个ID序号<br>
+ * 加起来刚好64位,为一个Long型。<br>
+ * SnowFlake的优点是,整体上按照时间自增排序,并且整个分布式系统内不会产生ID碰撞(由数据中心ID和机器ID作区分),并且效率较高,经测试,SnowFlake每秒能够产生26万ID左右。
+ * @author curry
+ */
+public class SnowflakeUtil {
+//因为二进制里第一个 bit 为如果是 1,那么都是负数,但是我们生成的 id 都是正数,所以第一个 bit 统一都是 0。
+
+    //机器ID  2进制5位  32位减掉1位 31个
+    private long workerId;
+    //机房ID 2进制5位  32位减掉1位 31个
+    private long datacenterId;
+    //代表一毫秒内生成的多个id的最新序号  12位 4096 -1 = 4095 个
+    private long sequence;
+    //设置一个时间初始值    2^41 - 1   差不多可以用69年
+    private long twepoch = 1585644268888L;
+    //5位的机器id
+    private long workerIdBits = 5L;
+    //5位的机房id
+    private long datacenterIdBits = 5L;
+    //每毫秒内产生的id数 2 的 12次方
+    private long sequenceBits = 12L;
+    // 这个是二进制运算,就是5 bit最多只能有31个数字,也就是说机器id最多只能是32以内
+    private long maxWorkerId = -1L ^ (-1L << workerIdBits);
+    // 这个是一个意思,就是5 bit最多只能有31个数字,机房id最多只能是32以内
+    private long maxDatacenterId = -1L ^ (-1L << datacenterIdBits);
+
+    private long workerIdShift = sequenceBits;
+    private long datacenterIdShift = sequenceBits + workerIdBits;
+    private long timestampLeftShift = sequenceBits + workerIdBits + datacenterIdBits;
+    private long sequenceMask = -1L ^ (-1L << sequenceBits);
+    //记录产生时间毫秒数,判断是否是同1毫秒
+    private long lastTimestamp = -1L;
+
+    public long getWorkerId(){
+        return workerId;
+    }
+    public long getDatacenterId() {
+        return datacenterId;
+    }
+    public long getTimestamp() {
+        return System.currentTimeMillis();
+    }
+
+
+
+    public SnowflakeUtil(long workerId, long datacenterId, long sequence) {
+
+        // 检查机房id和机器id是否超过31 不能小于0
+        if (workerId > maxWorkerId || workerId < 0) {
+            throw new IllegalArgumentException(
+                    String.format("worker Id can't be greater than %d or less than 0",maxWorkerId));
+        }
+
+        if (datacenterId > maxDatacenterId || datacenterId < 0) {
+
+            throw new IllegalArgumentException(
+                    String.format("datacenter Id can't be greater than %d or less than 0",maxDatacenterId));
+        }
+        this.workerId = workerId;
+        this.datacenterId = datacenterId;
+        this.sequence = sequence;
+    }
+
+    /**
+     * 这个是核心方法,通过调用nextId()方法,让当前这台机器上的snowflake算法程序生成一个全局唯一的id
+      */
+    public synchronized long nextId() {
+        // 这儿就是获取当前时间戳,单位是毫秒
+        long timestamp = timeGen();
+        if (timestamp < lastTimestamp) {
+
+            System.err.printf(
+                    "clock is moving backwards. Rejecting requests until %d.", lastTimestamp);
+            throw new RuntimeException(
+                    String.format("Clock moved backwards. Refusing to generate id for %d milliseconds",
+                            lastTimestamp - timestamp));
+        }
+
+        // 下面是说假设在同一个毫秒内,又发送了一个请求生成一个id
+        // 这个时候就得把seqence序号给递增1,最多就是4096
+        if (lastTimestamp == timestamp) {
+
+            // 这个意思是说一个毫秒内最多只能有4096个数字,无论你传递多少进来,
+            //这个位运算保证始终就是在4096这个范围内,避免你自己传递个sequence超过了4096这个范围
+            sequence = (sequence + 1) & sequenceMask;
+            //当某一毫秒的时间,产生的id数 超过4095,系统会进入等待,直到下一毫秒,系统继续产生ID
+            if (sequence == 0) {
+                timestamp = tilNextMillis(lastTimestamp);
+            }
+
+        } else {
+            sequence = 0;
+        }
+        // 这儿记录一下最近一次生成id的时间戳,单位是毫秒
+        lastTimestamp = timestamp;
+        // 这儿就是最核心的二进制位运算操作,生成一个64bit的id
+        // 先将当前时间戳左移,放到41 bit那儿;将机房id左移放到5 bit那儿;将机器id左移放到5 bit那儿;将序号放最后12 bit
+        // 最后拼接起来成一个64 bit的二进制数字,转换成10进制就是个long型
+        return ((timestamp - twepoch) << timestampLeftShift) |
+                (datacenterId << datacenterIdShift) |
+                (workerId << workerIdShift) | sequence;
+    }
+
+    /**
+     * 当某一毫秒的时间,产生的id数 超过4095,系统会进入等待,直到下一毫秒,系统继续产生ID
+     * @param lastTimestamp
+     * @return
+     */
+    private long tilNextMillis(long lastTimestamp) {
+
+        long timestamp = timeGen();
+
+        while (timestamp <= lastTimestamp) {
+            timestamp = timeGen();
+        }
+        return timestamp;
+    }
+    /**
+     *  获取当前时间戳
+     */
+    private long timeGen(){
+        return System.currentTimeMillis();
+    }
+}

+ 2 - 2
src/main/resources/mapper/DeliveryMapper.xml

@@ -85,7 +85,7 @@
             b.storage_location_name as storageLocationName
         FROM tld_inventory a
         JOIN tld_material b on a.material_id = b.tld_id
-        WHERE a.attribute = #{attribute} and a.produc_batch = #{producDate} and a.serial = #{serial} and b.code = #{wllbCode}
+        WHERE a.attribute = #{attribute} and a.produc_batch = #{producDate} and a.serial = #{serial} and b.code = #{wllbCode} and a.account_sleeve = #{companyNumber}
     </select>
     <!-- 查询指定库存被占用数量 -->
     <select id="getVitrual" resultType="int">
@@ -126,7 +126,7 @@
             wllb_code,
             produc_batch
         FROM tld_inventory
-        WHERE CONCAT(#{storageLocationCode},'111111,') LIKE CONCAT( '%', CONCAT( storage_location_code, ',' ), '%' )
+        WHERE CONCAT(#{storageLocationCode}) LIKE CONCAT( '%', CONCAT( storage_location_code, ',' ), '%' )
           AND material_id = #{delivery.materialId} AND hold = '0'
     </select>
     <!-- 查询库存 -->

+ 3 - 1
src/main/resources/mapper/QueryListMappeer.xml

@@ -68,12 +68,14 @@
             b.is_product as isProduct,
             c.name as name,
             c.code as code,
-            e.name as supplierName
+            e.name as supplierName,
+            f.name as warehouseName
         FROM
             tld_inventory a
             LEFT JOIN tld_storage_location b ON a.storage_location_code = b.storage_location_code
             LEFT JOIN tld_material c ON a.material_id = c.tld_id
             LEFT JOIN tld_customer e ON a.supplier_id = e.code
+            LEFT JOIN tld_warehouse f on b.warehouse_where = f.tld_id
         <trim prefix="WHERE" prefixOverrides="and |or">
             <if test="storageLocationCode != null and storageLocationCode != ''">
                 and a.storage_location_code = #{storageLocationCode}

+ 11 - 8
src/main/resources/mapper/WarehouseTransferMapper.xml

@@ -21,8 +21,10 @@
             b.warehouse_transfer_type,
             c.name as materialName,
             c.code as materialCode,
+            c.part_type as partType,
             f.name as askGoodsWarehouseaName,
-            e.name as supplyWarehouseName
+            e.name as supplyWarehouseName,
+            ifnull(f.warehouse_type, 10) as askType
         from tld_warehouse_transfer a
         join tld_warehouse_transfer_f b on a.warehouse_transfer_id = b.warehouse_transfer_id
         join tld_material c on a.material_id = c.tld_id
@@ -68,7 +70,8 @@
             b.storage_location_name as storageLocationName
         from tld_inventory a
         join tld_storage_location b on a.storage_location_code = b.storage_location_code
-        where a.material_id = #{materialId} and a.hold = '0' and a.account_sleeve = #{accountSleeve} and b.warehouse_where = #{warehouseWhere} order by a.produc_date
+        where a.material_id = #{materialId} and a.hold = '0' and a.account_sleeve = #{accountSleeve} and a.wbs = #{wbs} and b.warehouse_where = #{warehouseWhere}
+        order by a.produc_date
     </select>
     <!-- 查询库存是否充足 -->
     <select id="getAsk" resultType="com.tld.model.AskGoods">
@@ -132,16 +135,16 @@
         value(#{warehouseTransferId},#{warehouseTransferCode},#{askGoodsWarehouseId},#{warehouseTransferType},now())
     </insert>
     <!-- 查询指定pda 指定物料扫描总数 -->
-    <select id="getScanNum" resultType="String">
+    <select id="getScanNum" resultType="integer">
         select if(sum(num) is null, 0, num)
-        from tld_ask_goods_vitrual
-        where unique_code = #{uniqueCode} and ask_goods_id = #{warehouseTransferId} and wllb_code = #{materialCode}
+        from tld_warehousing_virtual
+        where unique_code = #{uniqueCode} and warehouse_transfer_id = #{warehouseTransferId} and wllb_code = #{materialCode}
     </select>
     <!-- 查询指定pda 指定物料扫描总数 -->
-    <select id="getScanNumWare" resultType="String">
+    <select id="getScanNumWare" resultType="integer">
         select if(sum(num) is null, 0, num)
-        from tld_warehousing_virtual
-        where unique_code = #{uniqueCode} and warehouse_transfer_id = #{warehouseTransferId} and wllb_code = #{materialCode}
+        from tld_ask_goods_vitrual
+        where unique_code = #{uniqueCode} and ask_goods_id = #{warehouseTransferId} and wllb_code = #{materialCode}
     </select>
     <!-- 查询指定送货单信息 -->
     <select id="getAsknInfo" resultType="com.tld.model.WarehouseTransfer">

+ 3 - 3
src/main/resources/mapper/WarehousingMapper.xml

@@ -21,7 +21,7 @@
             b.id,
             b.storage_location_code
         from tld_material a
-        join tld_storage_location b on a.wllb_class = b.storage_location_type
+        join tld_storage_location b on b.storage_location_type like CONCAT('%',a.wllb_class,'%')
         where a.code = #{wllbCode}
     </select>
     <!-- 新增库位信息虚拟表 -->
@@ -152,10 +152,10 @@
     </insert>
     <!-- 插入库存 -->
     <insert id="addInventory">
-        insert into tld_inventory(storage_location_code,wllb_class,material_id,amount,totime,hold,amount_lock,account_sleeve,wbs,supplier_id,serial,wllb_code,produc_date,scrq,produc_batch)
+        insert into tld_inventory(storage_location_code,wllb_class,material_id,amount,totime,hold,amount_lock,account_sleeve,wbs,supplier_id,serial,wllb_code,produc_date,scrq,produc_batch,attribute)
         values
         <foreach collection="list" index="index" item="item" separator=",">
-            (#{item.storageLocationCode},#{item.wllbClass},#{item.materialId},#{item.num},now(),'0','0',#{item.accountSleeve},#{item.wbs},#{item.suppId},#{item.serial},#{item.wllbCode},#{item.producDate}, now(),#{item.producDate})
+            (#{item.storageLocationCode},#{item.wllbClass},#{item.materialId},#{item.num},now(),'0','0',#{item.accountSleeve},#{item.wbs},#{item.suppId},#{item.serial},#{item.wllbCode},#{item.producDate}, now(),#{item.producDate},#{item.attribute})
         </foreach>
     </insert>
     <!-- 删除临时表数据 -->