瀏覽代碼

问题修改

zhs 2 年之前
父節點
當前提交
cf9f215dbf

+ 2 - 2
src/main/java/com/tld/config/MyRedissonConfig.java

@@ -16,8 +16,8 @@ public class MyRedissonConfig {
     public RedissonClient redissonClient(){
         // 创建配置 指定redis地址及节点信息
         Config config = new Config();
-        config.useSingleServer().setAddress("redis://8.142.144.205:6379").setPassword("#09SilverB");
-//        config.useSingleServer().setAddress("redis://10.2.111.91:6379").setPassword("#09SilverB");
+//        config.useSingleServer().setAddress("redis://8.142.144.205:6379").setPassword("#09SilverB");
+        config.useSingleServer().setAddress("redis://10.2.111.91:6379").setPassword("#09SilverB");
         //redis集群使用
 //        config.useClusterServers().addNodeAddress("redis://8.142.144.205:6379");
         // 根据config创建出RedissonClient实例

+ 1 - 0
src/main/java/com/tld/mapper/WarehousingMapper.java

@@ -141,4 +141,5 @@ public interface WarehousingMapper {
 
     List<Map<String, Object>> exportNotice(Notice notice);
 
+    String getFinishedInfo(WarehousingVirtual warehousingVirtual);
 }

+ 4 - 0
src/main/java/com/tld/model/Delivery.java

@@ -143,6 +143,10 @@ public class Delivery implements Serializable {
      * wbs编号
      */
     private String wbsCode;
+    /**
+     * WBS名称
+     */
+    private String wbsName;
     /**
      * 连翻号
      */

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

@@ -167,7 +167,7 @@ public class QueryListServiceImpl implements QueryListService {
             //导出数据汇总
             List<List<Object>> sheetDataList = new ArrayList<>();
             //表头数据
-            List<Object> head = Arrays.asList("生产领料单", "物料ID", "要货数量", "已出库数量", "物料名称", "物料编号", "要料单编号","WBS编号", "公司编号","公司名称");
+            List<Object> head = Arrays.asList("生产订单号", "要货数量", "已出库数量", "物料名称", "物料编号", "要料单编号","WBS编号", "公司编号","公司名称");
             //查询数据
             List<Map<String, Object>> list = queryListMapper.getAskGoodsExcel(askGoods);
             sheetDataList.add(head);

+ 12 - 1
src/main/java/com/tld/service/impl/WarehousingServiceImpl.java

@@ -780,7 +780,18 @@ public class WarehousingServiceImpl implements WarehousingService {
                 if(Double.doubleToLongBits(num) == Double.doubleToLongBits(Double.parseDouble(notice1.getNum()))){
                     notice2.setType("1");
                 }
-                warehousingMapper.addInventoryNotice(notice2);//入库存
+                //产成品存在不扫码的情况,如果没有连番则累加 有则单条
+                if(warehousingVirtual.getSerial() != null){
+                    warehousingMapper.addInventoryNotice(notice2);//入库存
+                } else {
+                    String id = warehousingMapper.getFinishedInfo(warehousingVirtual);
+                    if(id != null){
+                        Inventory inventory = new Inventory().setId(id).setAmount(warehousingVirtual.getNum());
+                        warehousingMapper.updateInventoryOther(inventory);
+                    } else {
+                        warehousingMapper.addInventoryNotice(notice2);//入库存
+                    }
+                }
                 warehousingMapper.updateNotice(notice2);//修改报工单数量
                 WarehousingVirtual warehousingVirtual1 = new WarehousingVirtual()
                         .setWllbCode(material.getWllbCode())

+ 3 - 0
src/main/resources/mapper/AskGoodsMapper.xml

@@ -652,6 +652,9 @@
         WHERE
 --         (a.num + 0) <![CDATA[>]]> (a.out_num + 0)
           b.part_type = #{partType}
+        <if test="userId != null and userId != ''">
+            and b.code in (select material_id from tld_user_material where user_id = #{userId})
+        </if>
         <if test="productionCode != null and productionCode != ''">
             and a.production_code like CONCAT(CONCAT('%', #{productionCode}), '%')
         </if>

+ 5 - 1
src/main/resources/mapper/DeliveryMapper.xml

@@ -11,6 +11,7 @@
             a.entry_number,
             a.material_id,
             d.code as wbsCode,
+            d.name as wbsName,
             a.wbs,
             a.measurement_id,
             a.gs_delivery_num,
@@ -31,7 +32,7 @@
         left join tld_material c on a.material_id = c.tld_id
         left join tld_wbs d on a.wbs = d.tld_id
         where (a.gs_delivery_num - a.gs_cancel_num) != a.out_num
-        and a.status != '1'
+        and a.status != '1' and c.code in (select material_id from tld_user_material where user_id = #{userId})
         <if test="deliveryId != null and deliveryId != ''">
             and a.delivery_id = #{deliveryId}
         </if>
@@ -138,6 +139,9 @@
         <if test="storageLocationCode != null and storageLocationCode != ''">
             and a.storage_location_code = #{storageLocationCode}
         </if>
+        <if test="supplierId != null and supplierId != ''">
+            and a.supplier_id = #{supplierId}
+        </if>
         and (a.amount + 0) <![CDATA[>=]]> (#{num} + 0) limit 1
     </select>
     <!--    暂时使用 后期删除-->

+ 1 - 1
src/main/resources/mapper/InviteMapper.xml

@@ -156,7 +156,7 @@
         and account_sleeve = #{companyNumber}
         <if test="wbs != null">
             and wbs = #{wbs}
-        </if>
+        </if> limit 1
     </select>
     <!-- 查询库存是否充足 -->
     <select id="getAsk" resultType="com.tld.model.AskGoods">

+ 9 - 10
src/main/resources/mapper/QueryListMappeer.xml

@@ -346,16 +346,15 @@
     <!-- 查询生产领料要货 -->
     <select id="getAskGoodsExcel" resultType="java.util.LinkedHashMap">
         SELECT
-        a.ask_goods_id,
-        a.material_id,
-        a.num,
-        IFNULL( a.out_num, 0 ) AS out_num,
-        e.NAME AS materialName,
-        e.CODE AS materialCode,
-        b.ask_goods_code,
-        a.wbs,
-        b.company_number,
-        g.name as companyName
+            a.production_code,
+            a.num,
+            IFNULL( a.out_num, 0 ) AS out_num,
+            e.NAME AS materialName,
+            e.CODE AS materialCode,
+            b.ask_goods_code,
+            a.wbs,
+            b.company_number,
+            g.name as companyName
         FROM
         tld_ask_goods a
         JOIN tld_ask_goods_f b ON a.ask_goods_id = b.ask_goods_id

+ 8 - 2
src/main/resources/mapper/WarehousingMapper.xml

@@ -451,7 +451,9 @@
         join tld_material c on a.material_id = c.tld_id
         join tld_company e on b.company_number = e.code
         <trim prefix="WHERE" prefixOverrides="and |or">
-            and c.code in (select material_id from tld_user_material where user_id = #{userId})
+            <if test="userId != null and userId != ''">
+                and c.code in (select material_id from tld_user_material where user_id = #{userId})
+            </if>
             <if test="type != null and type != ''">
                 and a.type = #{type}
             </if>
@@ -884,7 +886,7 @@
                b.user_name,
                a.account_sleeve
         from tld_warehousing_virtual a
-                 left join tld_user b on a.user_id = b.id
+        left join tld_user b on a.user_id = b.id
         where a.unique_code = #{uniqueCode}
           and a.type = #{type}
           and a.notice_id = #{noticeId}
@@ -1169,4 +1171,8 @@
     <update id="updateNoticesWarehousingNum">
         update tld_notices set warehousing_num = warehousing_num + #{amount} where notice_id = #{noticeId} and entry_number = #{entryNumber}
     </update>
+    <!-- 查询库存是否存在此产成品 -->
+    <select id="getFinishedInfo" resultType="String">
+        select id from tld_inventory where wllb_code = #{wllbCode} and wbs = #{wbs} and account_sleeve = #{accountSleeve} limit 1
+    </select>
 </mapper>