zhs il y a 2 ans
Parent
commit
3a59b6d89e

+ 8 - 10
src/main/java/com/tld/service/impl/AskGoodsServiceImpl.java

@@ -797,12 +797,11 @@ public class AskGoodsServiceImpl implements AskGoodsService {
                     //子表
                     JSONObject returnData = new JSONObject();
                     List<JSONObject> retunList = new LinkedList<>();
+                    JSONObject ReqOutStocks = new JSONObject();
+                    JSONObject BillItems = new JSONObject();
+                    List<JSONObject> list2 = new LinkedList<>();
                     for (Map<String, Object> map : askGoodsMapper.getRemovalz(mapList.get(0).get("askGoodsId").toString(), warehouseWhere)) {
 
-                        List<JSONObject> list = new LinkedList<>();
-                        JSONObject BillItems = new JSONObject();
-                        JSONObject ReqOutStocks = new JSONObject();
-
                         BillItems.put("WMSItemID", map.get("id"));//分录ID
                         BillItems.put("BOLID", map.get("askGoodsId"));//要货申请单ID
                         BillItems.put("BOLItemID", map.get("entryNumber"));//要货申请明细ID
@@ -811,13 +810,12 @@ public class AskGoodsServiceImpl implements AskGoodsService {
                         BillItems.put("FlexField1", map.get("wbsId"));//wbs
                         BillItems.put("FlexField1Code", map.get("wbsCode"));//WBS编号
                         BillItems.put("FlexField1Name", map.get("wbsName"));//WBS名称
-
-                        list.add(BillItems);
-                        strJson.put("BillItems", list);
-                        retunList.add(strJson);
-                        ReqOutStocks.put("BILLs",retunList);
-                        returnData.put("strJson", JSON.toJSONString(ReqOutStocks));
+                        list2.add(BillItems);
                     }
+                    strJson.put("BillItems", list2);
+                    retunList.add(strJson);
+                    ReqOutStocks.put("BILLs",retunList);
+                    returnData.put("strJson", JSON.toJSONString(ReqOutStocks));
                     //添加记录到tld_access
                     String names = "销售发货单" ;
                     String accessType = "1" ;

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

@@ -73,7 +73,7 @@ public class WarehousingServiceImpl implements WarehousingService {
                 map.put("errMsg", "已被扫描");
                 return map;
             }
-            if(materialClass.getPartType().equals("半成品")){
+            if(materialClass.getPartType().equals("半成品")) {
                 List<StorageLocation> listTwo = warehousingMapper.getRecommendTwo("1");
                 map.put("data", listTwo);
                 map.put("listString", new HashMap<>());//返回库位剩余数量

+ 35 - 6
src/main/resources/mapper/QueryListMappeer.xml

@@ -180,10 +180,15 @@
             e.name as supplierName,
             a.wbs,
             a.account_sleeve
-        FROM tld_inventory a
+        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
+        LEFT JOIN tld_company p on a.account_sleeve = p.code
+        LEFT JOIN tld_measurement m on c.unit_of_measurement = m.tld_id
+        left join tld_wbs h on a.wbs = h.tld_id
         <trim prefix="WHERE" prefixOverrides="and |or">
             <if test="storageLocationCode != null and storageLocationCode != ''">
                 and a.storage_location_code = #{storageLocationCode}
@@ -191,14 +196,38 @@
             <if test="materialId != null and materialId != ''">
                 and a.material_id = #{materialId}
             </if>
-            <if test="wbs != null and wbs != ''">
-                and a.wbs = #{wbs}
+            <if test="wllbCode != null and wllbCode != ''">
+                and c.code like CONCAT(CONCAT('%', #{wllbCode}), '%')
+            </if>
+            <if test="materialName != null and materialName != ''">
+                and c.name like CONCAT(CONCAT('%', #{materialName}), '%')
+            </if>
+            <if test="storageLocationName != null and storageLocationName != ''">
+                and b.storage_location_name like CONCAT(CONCAT('%', #{storageLocationName}), '%')
+            </if>
+            <if test="companyName != null and companyName != ''">
+                and p.name like CONCAT(CONCAT('%', #{companyName}), '%')
             </if>
             <if test="companyCode != null and companyCode != ''">
-                and a.account_sleeve = #{companyCode}
+                and p.code = #{companyCode}
+            </if>
+            <if test="supplierId != null and supplierId != ''">
+                and a.supplier_id like CONCAT(CONCAT('%', #{supplierId}), '%')
             </if>
-            <if test="amount != null and amount != ''">
-                and (a.amount + 0) <![CDATA[>]]> #{amount}
+            <if test="wbs != null and wbs != ''">
+                and a.wbs like CONCAT(CONCAT('%', #{wbs}), '%')
+            </if>
+            <if test="warehouseId != null and warehouseId != ''">
+                and f.tld_id = #{warehouseId}
+            </if>
+            <if test="partType != null and partType != ''">
+                and c.part_type = #{partType}
+            </if>
+            <if test="wllbClass != null and wllbClass != ''">
+                and c.wllb_class = #{wllbClass}
+            </if>
+            <if test="unitOfMeasurement != null and unitOfMeasurement != ''">
+                and c.unit_of_measurement = #{unitOfMeasurement}
             </if>
         </trim>
     </select>

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

@@ -623,6 +623,7 @@
             totime = now()
         where storage_location_code = #{storageLocationCode}
           and material_id = #{materialId}
+          and account_sleeve = #{companyNumber}
           and wbs = #{wbs};
     </update>
     <!-- 半成品出库库存查询 -->
@@ -641,7 +642,7 @@
         delete
         from tld_inventory
         where storage_location_code = #{storageLocationCode}
-          and material_id = #{materialId}
+          and material_id = #{materialId} and wbs = #{wbs} and account_sleeve = #{companyNumber}
     </delete>
     <!--删除其它入库信息-->
     <delete id="delOtherReceivingGoods">
@@ -656,7 +657,7 @@
         update tld_inventory
         set amount = amount - #{warehousingNum}
         where storage_location_code = #{storageLocationCode}
-          and material_id = #{materialId}
+          and material_id = #{materialId} and wbs = #{wbs} and account_sleeve = #{companyNumber}
     </update>
     <!-- 新增半成品入库流水 -->
     <insert id="addProduct">