Эх сурвалжийг харах

Merge branch 'master' of http://62.234.61.92:3000/wjm/mec-cloud_IntelligentManufacturing_CLIENT

lph 1 жил өмнө
parent
commit
2c5093222c

+ 9 - 12
zkqy-custom-business/src/main/java/com/zkqy/business/service/impl/DetailsOfTheRefuelingPlanSpinningServiceImpl.java

@@ -285,6 +285,8 @@ public class DetailsOfTheRefuelingPlanSpinningServiceImpl implements IDetailsOfT
     public int insertDetailsOfTheRefuelingPlanSpinningBatch(List<DetailsOfTheRefuelingPlanSpinning> detailsOfTheRefuelingPlanSpinning) {
         //批量插入修改产线号和批号
         List<SaleProducts> saleProductsList=new ArrayList<>();
+        //批量插入修改产线号和批号
+        List<SaleProducts> saleProductsList2=new ArrayList<>();
         //改批号,和产线号
         detailsOfTheRefuelingPlanSpinning.forEach(item->{
             //改产品的线号,批号
@@ -292,20 +294,15 @@ public class DetailsOfTheRefuelingPlanSpinningServiceImpl implements IDetailsOfT
             saleProducts.setId(Long.valueOf(item.getProductId()));
             saleProducts.setProductionLineNo(item.getMacId());//产线iD
             saleProducts.setLotNumber(item.getCurrentLotNumber().toString());//批号
+            //产品对应的信息
+            SaleProducts saleProducts1 = saleProductsMapper.selectSaleProductsById(Long.valueOf(item.getProductId()));
+            item.setProductTypeName(saleProducts1.getProductName());
+            saleProductsList.add(saleProducts);
             if(item.getPlanStatus().equals("1")){
-                //产品对应的信息
-                SaleProducts saleProducts1 = saleProductsMapper.selectSaleProductsById(Long.valueOf(item.getProductId()));
-                item.setProductTypeName(saleProducts1.getProductName());
-                saleProductsList.add(saleProducts);
+                saleProductsList2.add(saleProducts);
             }
             saleProducts.setOnBoardState(item.getPlanStatus());//状态信息
             saleProducts.setProductNumber(Double.valueOf(item.getNumber()));//数量
-            if(saleProductsList.size()<=0){
-                //产品对应的信息
-                SaleProducts saleProducts1 = saleProductsMapper.selectSaleProductsById(Long.valueOf(item.getProductId()));
-                item.setProductTypeName(saleProducts1.getProductName());
-                saleProductsList.add(saleProducts);
-            }
             DetailsOfTheRefuelingPlanSpinningLogs detailsOfTheRefuelingPlanSpinningLogs=new DetailsOfTheRefuelingPlanSpinningLogs();
             BeanUtils.copyProperties(item,detailsOfTheRefuelingPlanSpinningLogs);
             detailsOfTheRefuelingPlanSpinningLogs.setCreateBy(SecurityUtils.getUsername());
@@ -315,13 +312,13 @@ public class DetailsOfTheRefuelingPlanSpinningServiceImpl implements IDetailsOfT
             detailsOfTheRefuelingPlanSpinningLogs.setOrderId(item.getSalesmanId());//订单
             detailsOfTheRefuelingPlanSpinningLogs.setOperation("0");
             detailsOfTheRefuelingPlanSpinningLogsMapper.insertDetailsOfTheRefuelingPlanSpinningLogs(detailsOfTheRefuelingPlanSpinningLogs);
-
         });
         //更新产线
         int i2 = saleProductsMapper.updateSaleProductBatch(saleProductsList);
+        //更新产线
+        int i3= saleProductsMapper.updateSaleProductBatch(saleProductsList2);
         return detailsOfTheRefuelingPlanSpinningMapper.insertBatchDetailsOfTheRefuelingPlanSpinning(detailsOfTheRefuelingPlanSpinning);
     }
-
     @Override
     public List<DetailsOfTheRefuelingPlanSpinning> getCurrentProductionLineSuperior(DetailsOfTheRefuelingPlanSpinningVo detailsOfTheRefuelingPlanSpinning) {
         return detailsOfTheRefuelingPlanSpinningMapper.getCurrentProductionLineSuperior(detailsOfTheRefuelingPlanSpinning);

+ 2 - 0
zkqy-custom-business/src/main/resources/mapper/business/ProductCodeListMapper.xml

@@ -127,6 +127,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <insert id="insertProductCodeList" parameterType="com.zkqy.business.domain.ProductCodeList" useGeneratedKeys="true" keyProperty="id">
         insert into {DBNAME}.product_code_list
         <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="id != null">id,</if>
             <if test="qrCode != null">qr_code,</if>
             <if test="lotNum != null">lot_num,</if>
             <if test="productId != null">product_id,</if>
@@ -160,6 +161,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             del_flag
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="id != null">#{id},</if>
             <if test="qrCode != null">#{qrCode},</if>
             <if test="lotNum != null">#{lotNum},</if>
             <if test="productId != null">#{productId},</if>

+ 2 - 2
zkqy-custom-business/src/main/resources/mapper/business/SaleProductsMapper.xml

@@ -437,7 +437,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                     r.levels
             ) AS a
                 LEFT JOIN {DBNAME}.sale_products sp ON sp.sale_order_no = a.sale_order_no
-                AND sp.product_no = a.productCode
+                AND sp.product_no = a.productCode and sp.del_flag = '0'
 
     </select>
 
@@ -476,7 +476,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                     r.levels
             ) AS a
                 LEFT JOIN {DBNAME}.sale_products sp ON sp.sale_order_no = a.sale_order_no
-            AND sp.product_no = a.productCode
+            AND sp.product_no = a.productCode and sp.del_flag = '0'
 
     </select>