Преглед изворни кода

麻柳新厂厂外库功能

xiaosonghong пре 4 недеља
родитељ
комит
49fd99d768

+ 1 - 2
src/main/java/com/steerinfo/dil/controller/OyeResultController.java

@@ -261,8 +261,7 @@ public class OyeResultController extends BaseRESTfulController {
     @PostMapping("updateRealTimeInventory")
     public RESTfulResult updateRealTimeInventory(@RequestBody Map<String,Object> map) {
         try {
-            OyeRealtimeInventory oyeRealtimeInventory = oyeResultService.updateRealTimeInventory(map);
-            oyeRealtimeInventoryMapper.updateByPrimaryKeySelective(oyeRealtimeInventory);
+            oyeResultService.updateRealTimeInventoryOye(map);
             return success("操作成功");
         } catch (Exception e) {
             e.printStackTrace();

+ 12 - 8
src/main/java/com/steerinfo/dil/service/impl/OyeResultServiceImpl.java

@@ -284,10 +284,10 @@ public class OyeResultServiceImpl implements IOyeResultService {
     }
 
     /**
-     * 更新实时库存
+     * 更新实时库存(2025-4-10 14:00:22)
      */
     @Transactional(rollbackFor = Exception.class)
-    public synchronized OyeRealtimeInventory updateRealTimeInventory(Map<String,Object> map) throws Exception {
+    public OyeRealtimeInventory updateRealTimeInventory(Map<String,Object> map) throws Exception {
         //更新实时库存
         BigDecimal inventoryId = DataChange.dataToBigDecimal(map.get("inventoryId"));
         // flag为1,则为入库,为2则为出库
@@ -315,6 +315,12 @@ public class OyeResultServiceImpl implements IOyeResultService {
         return oyeRealtimeInventory;
     }
 
+    @Transactional(rollbackFor = Exception.class)
+    public synchronized void updateRealTimeInventoryOye(Map<String,Object> map) throws Exception{
+        OyeRealtimeInventory oyeRealtimeInventory = updateRealTimeInventory(map);
+        oyeRealtimeInventoryMapper.updateByPrimaryKeySelective(oyeRealtimeInventory);
+    }
+
     @Transactional(rollbackFor = Exception.class)
     public TmstruckWeightBatch generateWeightBatch(Map<String,Object> map) {
         TmstruckWeightBatch tmstruckWeightBatch = new TmstruckWeightBatch();
@@ -336,8 +342,6 @@ public class OyeResultServiceImpl implements IOyeResultService {
         // 划分实时库存数据
         // 针对原先的库存,需要进行出库;针对划分后的库存需要进行入库;先出后入;
         // 创建出库需要的数据;
-        Map<String, Object> jiChuMap = new HashMap<>();
-        jiChuMap.put("inventoryId",map.get("inventoryId"));
         BigDecimal newInventoryId = DataChange.dataToBigDecimal(map.get("newInventoryId"));
         OyeOutboundResult oyeOutboundResult = new OyeOutboundResult();
         oyeOutboundResult.setId(oyeOutboundResultMapper.getResultId());
@@ -392,8 +396,8 @@ public class OyeResultServiceImpl implements IOyeResultService {
         OyeRealtimeInventory oyeRealtimeInventoryInsert = null;
         OyeRealtimeInventory oyeRealtimeInventoryUpdate = null;
         //根据区域,客户,物资,单重,米数,仓库,库区查询实时库存在不在
-        BigDecimal inventoryId = null ;
-        if(newInventoryId == null || newInventoryId.intValue() == 0) {
+        BigDecimal inventoryId;
+        if(newInventoryId.intValue() == 0) {
             inventoryId = oyeRealtimeInventoryMapper.getInventoryId(map);
         }else{
             inventoryId = newInventoryId;
@@ -544,7 +548,7 @@ public class OyeResultServiceImpl implements IOyeResultService {
      */
     @Transactional(rollbackFor = Exception.class)
     public synchronized String putNewFactory(Map<String, Object> map) throws Exception{
-        map.put("inboundArea", "欧冶库");
+        map.put("inboundArea", "厂外库");
         System.out.println("+++++++++++" + new Date());
         JSONObject jsonObject = new JSONObject(map);
         System.out.println(jsonObject);
@@ -698,7 +702,7 @@ public class OyeResultServiceImpl implements IOyeResultService {
     }
 
     @Transactional(rollbackFor = Exception.class)
-    public int reUpdateOutBound(Map<String, Object> mapValue) throws Exception {
+    public synchronized int reUpdateOutBound(Map<String, Object> mapValue) throws Exception {
         List<OyeOutboundResult> oyeOutboundResults = new ArrayList<>();
         List<TmstruckWeightBatch> tmstruckWeightBatches = new ArrayList<>();
         List<OyeRealtimeInventory> oyeRealtimeInventories = new ArrayList<>();

+ 3 - 0
src/main/resources/com/steerinfo/dil/mapper/OyeInboundResultMapper.xml

@@ -867,6 +867,9 @@
              and  (OIR.SALE_MATERIAL_ID IS NOT NULL or OIR.ALTERNATE_FIELDS2 = '库存重量划拨')
            </if>
            -->
+             <if test="inboundAreaSide != null and inboundAreaSide != ''">
+               AND OIR.inbound_Area = #{inboundAreaSide}
+             </if>
            <if test="startDate != null">
               and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= OIR.INSERT_TIME
               and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= OIR.INSERT_TIME

+ 3 - 0
src/main/resources/com/steerinfo/dil/mapper/OyeOutboundResultMapper.xml

@@ -837,6 +837,9 @@
           and  (OOR.SALE_MATERIAL_ID IS NOT NULL or OOR.ALTERNATE_FIELDS2 = '库存重量划拨')
         </if>
         -->
+      <if test="inboundAreaSide != null and inboundAreaSide != ''">
+        AND OOR.inbound_Area = #{inboundAreaSide}
+      </if>
       <if test="startDate != null">
         and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= OOR.INSERT_TIME
         and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= OOR.INSERT_TIME

+ 3 - 0
src/main/resources/com/steerinfo/dil/mapper/OyeRealtimeInventoryMapper.xml

@@ -695,6 +695,9 @@
     LEFT JOIN RMS_MATERIAL RM on ORI.MATERIAL_ID = RM.MATERIAL_ID
     LEFT JOIN RMS_CONSIGNEE RC on ORI.CONSIGNEE_ID = RC.CONSIGNEE_ID
     <where>
+      <if test="inboundAreaSide != null and inboundAreaSide != ''">
+        AND ORI.inbound_Area = #{inboundAreaSide}
+      </if>
       <if test="startDate != null">
         and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= ORI.INSERT_TIME
         and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= ORI.INSERT_TIME