Redeem 1 year ago
parent
commit
966af7cbbe

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

@@ -87,10 +87,10 @@ public class OyeResultServiceImpl implements IOyeResultService {
             if (oyeInboundResultMapper.selectSaleMaterialID(DataChange.dataToBigDecimal(map.get("saleMaterialId"))) != null) {
                 throw new Exception("该分录已入库,无法继续入库");
             }
-            //判断该分录是否有净重
-            if (DataChange.dataToBigDecimal(map.get("netWeight")) == null || DataChange.dataToBigDecimal(map.get("netWeight")).intValue() == 0) {
-                throw new Exception("该分录无净重,不允许入库");
-            }
+            ////判断该分录是否有净重
+            //if (DataChange.dataToBigDecimal(map.get("netWeight")) == null || DataChange.dataToBigDecimal(map.get("netWeight")).intValue() == 0) {
+            //    throw new Exception("该分录无净重,不允许入库");
+            //}
         }
         for (Map<String,Object> map : mapList) {
             insertInboundResultReal(map);
@@ -120,7 +120,7 @@ public class OyeResultServiceImpl implements IOyeResultService {
         oyeInboundResult.setInboundArea(map.get("inboundArea").toString());
         oyeInboundResult.setInboundWarehouse(map.get("inboundWarehouse").toString());
         oyeInboundResult.setSaleNo(map.get("saleNo") + "");
-        if (meter != null || meter.intValue() !=0) {
+        if (meter != null && meter.intValue() != 0) {
             oyeInboundResult.setMeter(meter);
         }
         oyeInboundResult.setMaterialId(materialId);
@@ -266,7 +266,7 @@ public class OyeResultServiceImpl implements IOyeResultService {
         oyeRealtimeInventory.setInboundArea(map.get("inboundArea").toString());
         oyeRealtimeInventory.setMaterialId(DataChange.dataToBigDecimal(map.get("materialId")));
         BigDecimal meter = DataChange.dataToBigDecimal(map.get("meter"));
-        if (meter != null || meter.intValue() !=0) {
+        if (meter != null && meter.intValue() != 0) {
             oyeRealtimeInventory.setMeter(meter);
         }
         oyeRealtimeInventory.setSingleWeight(DataChange.dataToBigDecimal(map.get("singleWeight")));
@@ -410,4 +410,6 @@ public class OyeResultServiceImpl implements IOyeResultService {
     public List<Map<String, Object>> receiveSendReport(Map<String, Object> map) {
         return oyeRealtimeInventoryMapper.receiveSendReport(map);
     }
+
+
 }

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

@@ -775,7 +775,9 @@
     AND ORI.SALE_AREA = #{saleArea,jdbcType=VARCHAR}
     AND ORI.material_Id = #{materialId,jdbcType=DECIMAL}
     AND ORI.INBOUND_WAREHOUSE = #{inboundWarehouse,jdbcType=VARCHAR}
-    AND ORI.meter = #{meter,jdbcType=DECIMAL}
+    <if test="meter != null">
+      AND ORI.meter = #{meter,jdbcType=DECIMAL}
+    </if>
     AND ORI.INBOUND_AREA = #{inboundArea,jdbcType=VARCHAR}
     fetch next 1 rows only
   </select>
@@ -980,7 +982,11 @@
     WHERE RSR.SALER_NAME = #{saler}
   </select>
   <select id="getTheoryWeight" resultType="java.math.BigDecimal" parameterType="java.math.BigDecimal">
-    SELECT ASM.MATERIAL_WEIGHT FROM AMS_SALE_MATERIAL ASM
+    SELECT
+    ASM.MATERIAL_WEIGHT
+    FROM AMS_SALE_MATERIAL ASM
+    LEFT JOIN TMSTRUCK_WEIGHT_BATCH TWB
+    ON TWB.WEIGHT_BATCH_ID = ASM.WEIGHT_BATCH_ID
     WHERE ASM.SALE_MATERIAL_ID = #{saleMaterialId}
   </select>
   <select id="getSingleWeight" resultType="java.math.BigDecimal">

+ 1 - 1
src/main/resources/log4j.properties

@@ -1,5 +1,5 @@
 ## LOG4J配置
-log4j.rootCategory=INFO,file, RUNNING,errorfile
+log4j.rootCategory=INFO,file, RUNNING,errorfile,stdout
 ## 控制台输出
 log4j.appender.stdout=org.apache.log4j.ConsoleAppender
 log4j.appender.stdout.layout=org.apache.log4j.PatternLayout