luobang 2 năm trước cách đây
mục cha
commit
ad808d7a5d

+ 1 - 0
src/main/java/com/steerinfo/dil/mapper/TmstruckWeightResultMapper.java

@@ -180,4 +180,5 @@ public interface TmstruckWeightResultMapper extends IBaseMapper<TmstruckWeightRe
 
     int updateQuitSaleMaterialId(Map<String, Object> map);
 
+    int updateMakeDate(BigDecimal saleMaterialId);
 }

+ 42 - 1
src/main/java/com/steerinfo/dil/service/impl/TmstruckWeightResultServiceImpl.java

@@ -173,6 +173,19 @@ public class TmstruckWeightResultServiceImpl implements ITmstruckWeightResultSer
                 utilsService.pushMesToWebsocket((String) map.get("carNo"), "计量");
                 return map.get("carNo") + "传输成功";
             } catch (Exception e) {
+                try{
+                    new Thread( new Runnable() {
+                        public void run(){
+                            try {
+                                newFileTool.newFile(map.get("carNo") + e.getMessage() + "传输失败","计量传输物流实绩");
+                            } catch (IOException e) {
+                                e.printStackTrace();
+                            }
+                        }
+                    }).start();
+                }catch (Exception e1) {
+                    e1.printStackTrace();
+                }
                 System.out.println(map.get("carNo") + e.getMessage() + "传输失败");
                 return map.get("carNo")  + e.getMessage() + "传输失败";
             }
@@ -180,6 +193,19 @@ public class TmstruckWeightResultServiceImpl implements ITmstruckWeightResultSer
         //首先通过运输订单号查询订单类型
         Map<String, Object> oneMap = utilsMapper.getOrderTypeByOrderNumber((String) map.get("orderNumber")); //用于判断订单类型
         if(oneMap == null){
+            try{
+                new Thread( new Runnable() {
+                    public void run(){
+                        try {
+                            newFileTool.newFile(map.get("orderNumber") + "系统无此订单" + "传输失败","计量传输物流实绩");
+                        } catch (IOException e) {
+                            e.printStackTrace();
+                        }
+                    }
+                }).start();
+            }catch (Exception e) {
+                e.printStackTrace();
+            }
             return map.get("orderNumber") + "系统无此订单";
         }
         int orderType= DataChange.dataToBigDecimal(oneMap.get("orderType")).intValue();
@@ -196,6 +222,19 @@ public class TmstruckWeightResultServiceImpl implements ITmstruckWeightResultSer
             //通过传来的运输订单号 与 物资ID查询计重实绩ID
             stringObjectMap = tmstruckWeightResultMapper.selectTotalIdByOrderNo(map);
             if(stringObjectMap == null){
+                try{
+                    new Thread( new Runnable() {
+                        public void run(){
+                            try {
+                                newFileTool.newFile(map.get("orderNumber") + "没有此订单信息或物资信息(" + map.get("materialId") + ")错误" + "传输失败","计量传输物流实绩");
+                            } catch (IOException e) {
+                                e.printStackTrace();
+                            }
+                        }
+                    }).start();
+                }catch (Exception e) {
+                    e.printStackTrace();
+                }
                 return map.get("orderNumber") + "没有此订单信息或物资信息(" + map.get("materialId") + ")错误";
             }
         }
@@ -889,7 +928,7 @@ public class TmstruckWeightResultServiceImpl implements ITmstruckWeightResultSer
                     weightMap.put("resultGrossWeightTime",resultGrossWeightTime);
                     weightMap.put("saleMaterialId",map.get("saleMaterialId"));
                     Map<String,Object> map1 = tmstruckWeightResultMapper.selectWeightMes(weightMap);
-
+                    tmstruckWeightResultMapper.updateMakeDate(DataChange.dataToBigDecimal(weightMap.get("saleMaterialId")));
                     //根据查询信息判断是哪一拼
                     Integer spellNum = (DataChange.dataToBigDecimal(map1.get("grossSqe")).intValue() + DataChange.dataToBigDecimal(map1.get("tareSqe")).intValue()) / 6;
                     if(spellNum == 1){
@@ -1113,6 +1152,8 @@ public class TmstruckWeightResultServiceImpl implements ITmstruckWeightResultSer
                     //查询该物资id及对应的净重还有毛重时间是哪一拼
                     //判断该总实绩下净重的条数
                     int netWeightCount = tmstruckWeightResultMapper.getNetWeightCount(resultTotalId);
+                    //去除制单日期
+                    tmstruckWeightResultMapper.updateMakeDate(DataChange.dataToBigDecimal(orderMes.get("saleMaterialId")));
                     //根据查询信息判断是哪一拼
                     Integer spellNum = (DataChange.dataToBigDecimal(orderMes.get("grossSqe")).intValue() + DataChange.dataToBigDecimal(orderMes.get("tareSqe")).intValue()) / 6;
                     if(spellNum == 1){

+ 11 - 1
src/main/resources/com/steerinfo/dil/mapper/TmstruckWeightResultMapper.xml

@@ -1323,7 +1323,8 @@
               TWR.WEIGHT_TASK_RESULT_ID "weightTaskResultId",
               TWR.TARE_SEGMENT_SQE "tareSqe",
               TWR.GROSS_SEGMENT_SQE "grossSqe",
-              TWR.RESULT_NET_WEIGHT "netWeight"
+              TWR.RESULT_NET_WEIGHT "netWeight",
+              TWR.SALE_MATERIAL_ID  "saleMaterialId"
               FROM TMSTRUCK_WEIGHT_RESULT TWR
        LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR
        ON TTR.RESULT_TOTAL_ID = TWR.RESULT_TOTAL_ID
@@ -1536,4 +1537,13 @@
         AND
         TWR.RESULT_TOTAL_ID = #{resultTotalId}
     </update>
+    <update id="updateMakeDate">
+        UPDATE AMS_SALE_MATERIAL ASM
+        SET ASM.SALE_MAKE_DATE = NULL
+        WHERE 1 != 1
+        <if test="saleMaterialId != null">
+            or ASM.SALE_MATERIAL_ID = #{saleMaterialId}
+        </if>
+
+    </update>
 </mapper>