luobang 2 år sedan
förälder
incheckning
a0d2a5f732

+ 2 - 0
src/main/java/com/steerinfo/dil/mapper/TmstruckLeaveFactoryResultMapper.java

@@ -164,4 +164,6 @@ public interface TmstruckLeaveFactoryResultMapper extends IBaseMapper<TmstruckLe
 
     int updateResultTotalOutStatus(BigDecimal resultTotalId);
 
+    String getSaleRemark(BigDecimal saleMaterialId);
+
 }

+ 5 - 0
src/main/java/com/steerinfo/dil/service/impl/TmstruckSelfMachineService.java

@@ -3,6 +3,7 @@ package com.steerinfo.dil.service.impl;
 import com.steerinfo.dil.mapper.TmstruckEnfactoryResultMapper;
 import com.steerinfo.dil.mapper.TmstruckLeaveFactoryResultMapper;
 import com.steerinfo.dil.service.ITmstruckSelfMachineService;
+import com.steerinfo.dil.util.DataChange;
 import org.checkerframework.checker.regex.RegexUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -100,6 +101,10 @@ public class TmstruckSelfMachineService implements ITmstruckSelfMachineService {
                                 BigDecimal nowNetWeight = (BigDecimal) stringObjectMap.get("nowNetWeight");
                                 if (nowNetWeight != null) {
                                     map1.put("netWeightTime",stringObjectMap.get("netWeightTime"));
+                                    if(stringObjectMap.get("saleMaterialId") != null) {
+                                        String saleRemark = tmstruckLeaveFactoryResultMapper.getSaleRemark(DataChange.dataToBigDecimal(stringObjectMap.get("saleMaterialId")));
+                                        map1.put("saleRemark",saleRemark);
+                                    }
                                 }
                             }
                         }else {

+ 10 - 4
src/main/resources/com/steerinfo/dil/mapper/TmstruckLeaveFactoryResultMapper.xml

@@ -1087,8 +1087,7 @@
         rm.material_specification "materialSpe",
         rm.material_model "materialModel",
         rm.material_id "materialId",
-        asm.is_pound_sale "isPoundSale",
-        ASO.SALE_REMARK    "saleRemark"
+        asm.is_pound_sale "isPoundSale"
         FROM
         omstruck_order oo
         LEFT JOIN rms_capacity rc ON rc.capacity_id = oo.capacity_id
@@ -1288,7 +1287,8 @@
     <select id="getNetWeightByOrder" resultType="java.util.Map" parameterType="java.util.Map">
         SELECT TWR.RESULT_NET_WEIGHT AS "nowNetWeight",
         TWR.MATERIAL_ID AS "materialid",
-        TWR.RESULT_GROSS_WEIGHT_TIME AS "netWeightTime"
+        TWR.RESULT_GROSS_WEIGHT_TIME AS "netWeightTime",
+        TWR.SALE_MATERIAL_ID AS "saleMaterialId"
         FROM OMSTRUCK_ORDER OO
         left join OMSTRUCK_ORDER_MATERIAL OOM
         ON OOM.ORDER_ID=OO.ORDER_ID
@@ -1547,6 +1547,7 @@
         AND TLFR .RESULT_OUT_GATE_TIME IS NULL
         AND #{nowDate} > OO .PRINTDATE
     </select>
+
     <update id="updateLeaveTime">
         UPDATE TMSTRUCK_LEAVE_FACTORY_RESULT
         SET TMSTRUCK_LEAVE_FACTORY_RESULT.RESULT_OUT_GATE_TIME = SYSDATE,
@@ -1565,5 +1566,10 @@
             TTR.OUTFACTORY_TIME = sysdate
         where TTR.RESULT_TOTAL_ID = #{resultTotalId}
     </update>
-
+    <select id="getSaleRemark" resultType="java.lang.String" parameterType="decimal">
+        SELECT DISTINCT ASO.SALE_REMARK
+        FROM AMS_SALE_MATERIAL ASM
+        LEFT JOIN AMS_SALE_ORDER ASO ON ASO.SALE_ORDER_ID = ASM.SALE_ORDER_ID
+        WHERE ASM.SALE_MATERIAL_ID = #{saleMaterialId}
+    </select>
 </mapper>