Browse Source

问题修改

zhs 2 years ago
parent
commit
d31afd51ef

+ 4 - 0
src/main/java/com/tld/service/impl/WarehousingServiceImpl.java

@@ -666,6 +666,10 @@ public class WarehousingServiceImpl implements WarehousingService {
                         .setSerial(warehousingVirtual.getSerial())
                         .setWllbCode(material.getWllbCode())
                         .setCompanyNumber(notice1.getCompanyNumber());
+                Double num = Double.parseDouble(notice1.getWarehousingNum()) + Double.parseDouble(warehousingVirtual.getNum());
+                if(Double.doubleToLongBits(num) == Double.doubleToLongBits(Double.parseDouble(notice1.getNum()))){
+                    notice2.setType("1");
+                }
                 warehousingMapper.addInventoryNotice(notice2);//入库存
                 warehousingMapper.updateNotice(notice2);//修改报工单数量
                 //入库流水

+ 36 - 37
src/main/resources/mapper/WarehousingMapper.xml

@@ -78,10 +78,7 @@
     <delete id="delWarehousingVirtual">
         delete
         from tld_warehousing_virtual
-        where serial = #{serial}
-          and wllb_code = #{wllbCode}
-          and produc_date = #{producDate}
-          and supp_id = #{suppId}
+        where id = #{id}
     </delete>
     <!-- 查询虚拟表数据进行入库 -->
     <select id="getVirtual" resultType="com.tld.model.WarehousingVirtual">
@@ -383,25 +380,25 @@
     <!-- 查询报工单 -->
     <select id="getNotice" resultType="com.tld.model.Notice">
         select
-        a.id,
-        a.notice_id,
-        a.entry_number,
-        a.production_code,
-        a.material_id,
-        a.wbs,
-        a.measurement_id,
-        a.num,
-        a.type,
-        a.warehousing_num,
-        b.company_number,
-        c.name as materialName,
-        c.wllb_class as wllbClass,
-        c.code as wllbCode,
-        e.name as companyName,
-        b.notice_time as noticeTime,
-        b.source_type as sourceType,
-        b.move_type as moveType,
-        b.notice_code as noticeCode
+            a.id,
+            a.notice_id,
+            a.entry_number,
+            a.production_code,
+            a.material_id,
+            a.wbs,
+            a.measurement_id,
+            a.num,
+            a.type,
+            a.warehousing_num,
+            b.company_number,
+            c.name as materialName,
+            c.wllb_class as wllbClass,
+            c.code as wllbCode,
+            e.name as companyName,
+            b.notice_time as noticeTime,
+            b.source_type as sourceType,
+            b.move_type as moveType,
+            b.notice_code as noticeCode
         from tld_notice a
         join tld_notice_f b on a.notice_id = b.notice_id
         join tld_material c on a.material_id = c.tld_id
@@ -483,8 +480,10 @@
                                   wllb_code, totime)
             value (#{storageLocationCode},#{materialId},#{warehousingNum},'0','0',#{companyNumber},#{wbs},#{producBatch},now(),#{wllbClass},#{producBatch},#{attribute},#{serial},#{supplierId},#{wllbCode},now());
         update tld_notice
-        set warehousing_num = #{warehousingNum},
-            type            = '1'
+        set warehousing_num = #{warehousingNum}
+        <if test="type != null and type != ''">
+            ,type = '1'
+        </if>
         where notice_id = #{noticeId}
           and material_id = #{materialId}
     </insert>
@@ -670,16 +669,16 @@
     <!-- 查询指定物料内容 -->
     <select id="getMaterial" resultType="com.tld.model.MaterialClass">
         select
-        code as wllbCode,
-        name as wllbName,
-        tld_id,
-        specification_and_model,
-        unit_of_measurement,
-        size,
-        wllb_class,
-        is_not_disable,
-        is_recommend,
-        part_type
+            code as wllbCode,
+            name as wllbName,
+            tld_id,
+            specification_and_model,
+            unit_of_measurement,
+            size,
+            wllb_class,
+            is_not_disable,
+            is_recommend,
+            part_type
         from tld_material
         <trim prefix="WHERE" prefixOverrides="and |or">
             <if test="materialId != null and materialId != ''">
@@ -878,11 +877,11 @@
     </select>
     <!-- 查询昨天没满的库位 -->
     <select id="getStorageLocationCode" resultType="String">
-        SELECT ifnull(storage_location_code, "0")
+        SELECT ifnull(max(storage_location_code), "0")
         FROM tld_inventory
         WHERE attribute = #{attribute} and scrq <![CDATA[${symbol}]]> CURDATE()
         <if test="producBatch != null">
-            produc_batch = #{producBatch}
+            and produc_batch = #{producBatch}
         </if>
         ORDER BY scrq desc LIMIT 1
     </select>