xiaosonghong преди 5 месеца
родител
ревизия
ee632d3550

+ 3 - 5
src/main/java/com/steerinfo/dil/service/impl/OyeResultServiceImpl.java

@@ -405,11 +405,9 @@ public class OyeResultServiceImpl implements IOyeResultService {
         OyeRealtimeInventory oyeRealtimeInventoryInsert = null;
         OyeRealtimeInventory oyeRealtimeInventoryUpdate = null;
         //根据区域,客户,物资,单重,米数,仓库,库区查询实时库存在不在
-        BigDecimal inventoryId;
-        if(newInventoryId.intValue() == 0) {
-            inventoryId = oyeRealtimeInventoryMapper.getInventoryId(map);
-        }else{
-            inventoryId = newInventoryId;
+        BigDecimal inventoryId = oyeRealtimeInventoryMapper.getInventoryId(map);;
+        if(newInventoryId.intValue() > 0 && newInventoryId.compareTo(inventoryId) != 0) {
+            throw new Exception("库存ID存在错误,无法划分!");
         }
         if (inventoryId != null && inventoryId.compareTo(DataChange.dataToBigDecimal(map.get("inventoryId"))) == 0) {
             throw new Exception("库存ID一致无法划分");

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

@@ -751,9 +751,9 @@
     AND ORI.SALE_AREA = #{saleArea,jdbcType=VARCHAR}
     AND ORI.material_Id = #{materialId,jdbcType=DECIMAL}
     AND ORI.INBOUND_WAREHOUSE = #{inboundWarehouse,jdbcType=VARCHAR}
-    <if test="meter != null">
+   <!-- <if test="meter != null">
       AND ORI.meter = #{meter,jdbcType=DECIMAL}
-    </if>
+    </if> -->
     AND ORI.INBOUND_AREA = #{inboundArea,jdbcType=VARCHAR}
     fetch next 1 rows only
   </select>