Browse Source

单车GPS校验

liyg 2 years ago
parent
commit
c190275aa4

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

@@ -198,4 +198,6 @@ public interface AmsSaleOrderMapper extends IBaseMapper<AmsSaleOrder, BigDecimal
 
 
     int updateOldSaleOrderUpload(BigDecimal saleOrderId);
     int updateOldSaleOrderUpload(BigDecimal saleOrderId);
 
 
+    //查找是否允许GPS派车
+    int isGPS(String capacityNumber);
 }
 }

+ 5 - 1
src/main/java/com/steerinfo/dil/service/impl/AmsSaleOrderServiceImpl.java

@@ -874,13 +874,17 @@ public class AmsSaleOrderServiceImpl implements IAmsSaleOrderService {
             //}
             //}
             if(isCheckGps!=null && isCheckGps==0){
             if(isCheckGps!=null && isCheckGps==0){
                 Map<String,Object> locationResult = null;
                 Map<String,Object> locationResult = null;
+                int isGPS=0;
                 try{
                 try{
                     Map<String,Object> data = (Map<String,Object>)otmsFeign.getCurrentLocation(capacityNumber).getData();
                     Map<String,Object> data = (Map<String,Object>)otmsFeign.getCurrentLocation(capacityNumber).getData();
                     locationResult = (Map<String,Object>)data.get("result");
                     locationResult = (Map<String,Object>)data.get("result");
+                    isGPS=amsSaleOrderMapper.isGPS(capacityNumber);
                 }catch (Exception e){
                 }catch (Exception e){
                   //出现任何异常不抛出,不终止程序
                   //出现任何异常不抛出,不终止程序
                 }
                 }
-                if(locationResult==null || locationResult.get("lon")==null || locationResult.get("lat")==null){
+                if(isGPS > 0){
+                    System.out.println(capacityNumber+"允许无GPS派车");
+                }else if(locationResult==null || locationResult.get("lon")==null || locationResult.get("lat")==null){
                     throw new Exception("该车没有GPS定位信息,请联系销售公司物流部,申请是否可以派车。");
                     throw new Exception("该车没有GPS定位信息,请联系销售公司物流部,申请是否可以派车。");
                 }
                 }
             }
             }

+ 3 - 0
src/main/resources/com/steerinfo/dil/mapper/AmsSaleOrderMapper.xml

@@ -4661,5 +4661,8 @@
         on qql.capacity_id=oo.capacity_id
         on qql.capacity_id=oo.capacity_id
         where oo.order_id=#{orderId}
         where oo.order_id=#{orderId}
     </select>
     </select>
+  <select id="isGPS" resultType="java.lang.Integer">
+    SELECT count(*) FROM RMS_CAPACITY WHERE CAPACITY_NUMBER=#{capacityNumber} and CAPACITY_GPS='是'
+  </select>
 
 
 </mapper>
 </mapper>