liyg 2 år sedan
förälder
incheckning
5f79a5e76c

+ 3 - 0
src/main/java/com/steerinfo/dil/mapper/TmstruckTotalResultMapper.java

@@ -22,4 +22,7 @@ public interface TmstruckTotalResultMapper extends IBaseMapper<TmstruckTotalResu
 
     //查询倒库
     List<Map<String,Object>>  getAllReverseResult(Map<String,Object> map);
+
+    //查询当前没有总实绩的运输订单,为其补录
+    List<BigDecimal> getOrderForBulu();
 }

+ 12 - 0
src/main/java/com/steerinfo/dil/service/impl/TmstruckTotalResultServiceImpl.java

@@ -10,6 +10,7 @@ import com.steerinfo.dil.model.TmstruckTotalResult;
 import com.steerinfo.dil.model.TmstruckWeightResult;
 import com.steerinfo.dil.service.ITmstruckTotalResultService;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
@@ -147,4 +148,15 @@ public class TmstruckTotalResultServiceImpl implements ITmstruckTotalResultServi
     public List<Map<String, Object>> getAllReverseResult(Map<String, Object> mapValue) {
         return tmstruckTotalResultMapper.getAllReverseResult(mapValue);
     }
+
+    /**
+     * 为已接收没有总实绩的运输订单补录总实绩
+     */
+    @Scheduled(fixedRate = 1000*60*5)
+    public void insertTotalForNullOrder(){
+        List<BigDecimal> list=tmstruckTotalResultMapper.getOrderForBulu();
+        for(BigDecimal orderId:list){
+            addTotalResult(orderId);
+        }
+    }
 }

+ 5 - 0
src/main/resources/com/steerinfo/dil/mapper/TmstruckTotalResultMapper.xml

@@ -590,4 +590,9 @@
             </if>
         </if>
     </sql>
+    <select id="getOrderForBulu" resultType="java.math.BigDecimal">
+        SELECT OO .ORDER_ID FROM OMSTRUCK_ORDER OO
+                                     LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR ON TTR .ORDER_ID = OO .ORDER_ID
+        WHERE TTR .RESULT_TOTAL_ID IS NULL and ORDER_STATUS=5
+    </select>
 </mapper>