Your Name 3 سال پیش
والد
کامیت
cce3d8e6f1

+ 11 - 7
src/main/java/com/steerinfo/dil/service/impl/TmsTruckQualityService.java

@@ -35,10 +35,10 @@ public class TmsTruckQualityService implements ITmsTruckQualityResultService {
     @Autowired
     TmstruckWeightResultMapper tmstruckWeightResultMapper;
     //定时访问质检系统,获取质检实绩
-//    @Scheduled(cron = "* 1 * * * ?")
-    @Override
+    @Scheduled(cron = "* * * * * ?")
+//    @Override
     public int insertQualityResult() throws IOException, DocumentException {
-        //先查出所有没有质检实绩的磅单号
+        //先查出所有需要质检的但是没有质检的磅单号
         List<Map<String,Object>>mapList=tmstruckWeightResultMapper.selectWzInputId();
         System.out.println(mapList);
         System.out.println(mapList);
@@ -73,18 +73,22 @@ public class TmsTruckQualityService implements ITmsTruckQualityResultService {
                         List<Map<String,Object>>mapList9=mapList2;
                         for (Map<String,Object> map3:mapList9
                         ) {
+                            //判断是否生成报告单,如果生成则生成质检实绩,否则退出
+                            Object value =  map3.get("REPORT_ID");
+                            if(value == null){
+                                continue;
+                            }
                             //质检说明
                             String DeductionDescription=(String)map3.get("DEDUCT_SEASON");
-                            //铁路专用线
+                            //获取卸货点
                             String samplePlaceName=(String) map3.get("SAMPLE_PLACE_NAME");
                             //查询卸货点ID
                             BigDecimal SamplePlaceId=tmstruckQualityResultMapper.selectSamplePlaceId(samplePlaceName);
                             //扣水扣杂量
-
                             BigDecimal Deduction= new BigDecimal(Integer.parseInt(String.valueOf(map3.get("DEDUCT_NUMBER"))));
                             //抽样时间
-                           Date sampleDate= new Date((String)(map3.get("SAMPLE_DATE")));
-                            //根据磅单号修改相应的质检实绩
+                            Date sampleDate= new Date((String)(map3.get("SAMPLE_DATE")));
+                            //根据磅单号新增相应的质检实绩
                             TmstruckQualityResult tmstruckQualityResult = new TmstruckQualityResult();
                             //主键ID
                             tmstruckQualityResult.setId(tmstruckQualityResultMapper.Count());

+ 8 - 3
src/main/resources/com/steerinfo/dil/mapper/TmstruckWeightResultMapper.xml

@@ -619,9 +619,14 @@
         and TWR.MATERIAL_ID=#{materialId,jdbcType=DECIMAL}
     </select>
     <select id="selectWzInputId" resultType="java.util.Map">
-        select twr.RESULT_POUND_NO "WzInputId",
-               twr.RESULT_TOTAL_ID "resultTotalId"
-        from TMSTRUCK_WEIGHT_RESULT twr
+        SELECT twr.RESULT_POUND_NO "WzInputId", twr.RESULT_TOTAL_ID "resultTotalId"
+        from TMSTRUCK_WEIGHT_RESULT TWR
+        LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR
+        ON TTR.RESULT_TOTAL_ID = TWR.RESULT_TOTAL_ID
+        LEFT JOIN OMSTRUCK_ORDER OO
+        ON OO.ORDER_ID = TTR.ORDER_ID
+        WHERE OO.ORDER_TYPE IN (7, 10, 18)
+        AND TWR.ISQUALITY IS NULL
     </select>
     <update id="updateWzInputId">
         update TMSTRUCK_WEIGHT_RESULT twr