Bladeren bron

fix:运力实时调度列表查询bug

wangweiyu 4 jaren geleden
bovenliggende
commit
e57279e57e

+ 4 - 1
src/main/java/com/aoyang/tms/service/impl/CommonServiceImpl.java

@@ -370,6 +370,9 @@ public class CommonServiceImpl implements CommonService {
             }
             clientIds.add(truckSimCard.getSimCard());
         }
+
+        log.info("getLocations clientIds:{}", JSON.toJSONString(clientIds));
+
         Query query = new Query(Criteria.where("clientId").in(clientIds).and("messageId").is(512));
         query.with(new Sort(Sort.Direction.DESC, "dateTime"));
 
@@ -413,7 +416,7 @@ public class CommonServiceImpl implements CommonService {
         Map<String, LocationVO> result = new HashMap();
         for (TmsMongoDoc doc : tmsMongoDocs) {
             for (int i=0;i<clientIds.size();i++) {
-                if (clientIds.get(i).equals(doc.getClientId())) {
+                if (StringUtils.isNotBlank(doc.getClientId()) && clientIds.get(i).equals(doc.getClientId())) {
                     LocationVO location = new LocationVO();
                     location.setLatitude(doc.getLatitude() + "");
                     location.setLongitude(doc.getLongitude() + "");

+ 1 - 1
src/main/resources/mapper/TruckMapper.xml

@@ -262,7 +262,7 @@
             and wo.type = #{param.orderType}
         </if>
         left join tms_work_cycle wc on truck.truck_id = wc.truck_id and wc.status = 1
-        WHERE truck.org_id = #{param.orgId} and two.id is null
+        WHERE truck.org_id = #{param.orgId} and wo.id is null
         <if test="param.orderType == 1">
             and ( wc.jing_weight = 0 or wc.jing_weight is null )
         </if>