liyg 3 lat temu
rodzic
commit
5d3a097da7

+ 7 - 17
src/main/java/com/steerinfo/dil/controller/OffSiteTransportationController.java

@@ -99,9 +99,9 @@ public class OffSiteTransportationController extends BaseRESTfulController {
     public RESTfulResult fullPath(String orderNumber) throws Exception {
         //运输订单号:orderNumber、车牌号:capacityNumber、出厂时间:resultOutGateTime、预警开关:turnOf、发货地址:shipperName、收货地址:receiveAddress
         //初始化请求参数
-        //判断是否自提
-        int count = offSiteTransportationService.isSelfMentionByOrderNumber(orderNumber);
-        if (count==0){
+        //判断订单是否可以查看路径
+        int watch = offSiteTransportationService.checkOrder(orderNumber);
+        if (watch==1){
             HashMap<String,Object> mapValue=new HashMap<>();
             mapValue.put("orderNumber",orderNumber);
             return success(routeService.fullPathVisualization(mapValue).get());
@@ -475,14 +475,13 @@ public class OffSiteTransportationController extends BaseRESTfulController {
     public RESTfulResult fullPathVisualizationByCarNumber(@RequestBody HashMap mapValue) throws Exception {
 
         //判断是否自提
-        int count = offSiteTransportationService.isSelfMention(mapValue.get("capacityNumber").toString());
-        if (count==0){
+        /*int count = offSiteTransportationService.isSelfMention(mapValue.get("capacityNumber").toString());
+        if (count==0){*/
             CompletableFuture<RouteVo> createOrder =routeService.fullPathVisualizationByCarNumber(mapValue);
-
             return  success(createOrder.get());
-        }else {
+       /* }else {
             return failed(-1);
-        }
+        }*/
 
     }
 
@@ -524,17 +523,8 @@ public class OffSiteTransportationController extends BaseRESTfulController {
     }
     @GetMapping("/getCurrentLocation")
     public RESTfulResult getCurrentLocation(@RequestParam("capcityNumber") String capcityNumber) throws Exception {
-        //自提 且 运输订单未关闭的,不能查看
-        int isSelfMention = offSiteTransportationService.isSelfMention(capcityNumber);//是否自提,0为非自提
-        int isClose=offSiteTransportationService.isCloseOrder(capcityNumber);//是否关闭,0为未关闭
-        if (isSelfMention!=0 && isClose==0){
-           return failed(-1);
-        }else {
            CurrentLocationResult currentLocationResult = routeService.getCurrentLocation(capcityNumber);
            return success(currentLocationResult);
-        }
-
-
     }
     //在途订单列表
     @PostMapping("/transportationPerformance")

+ 3 - 1
src/main/java/com/steerinfo/dil/mapper/OffSiteTransportationMapper.java

@@ -45,5 +45,7 @@ public interface OffSiteTransportationMapper {
 
     int isSelfMentionByOrderNumber(String orderNumber);
 
-    int selectIsCloseOrder(String capcityNumber);
+    int selectIsClose(String capcityNumber);
+
+    int selectIsCloseByOrderNumber(String orderNumber);
 }

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

@@ -38,5 +38,9 @@ public interface OffSiteTransportationService {
 
     int isSelfMentionByOrderNumber(String orderNumber);
 
-    int isCloseOrder(String capcityNumber);
+    int isClose(String capcityNumber);
+
+    int isCloseByOrderNumber(String orderNumber);
+    //对于车辆运输进行校验,其他不校验
+    int checkOrder(String capcityNumber);
 }

+ 18 - 12
src/main/java/com/steerinfo/dil/service/impl/OffSiteTransportationServiceImpl.java

@@ -192,8 +192,24 @@ public class OffSiteTransportationServiceImpl implements OffSiteTransportationSe
     }
 
     @Override
-    public int isCloseOrder(String capcityNumber) {
-        return offSiteTransportationMapper.selectIsCloseOrder(capcityNumber);
+    public int isClose(String capcityNumber) {
+        return offSiteTransportationMapper.selectIsClose(capcityNumber);
+    }
+
+    @Override
+    public int isCloseByOrderNumber(String orderNumber) {
+        return offSiteTransportationMapper.selectIsCloseByOrderNumber(orderNumber);
+    }
+
+    @Override
+    public int checkOrder(String orderNumber) {
+        //自提 且 运输订单未关闭,不能查看,返回0;能查看则返回1
+        int isSelfMention = offSiteTransportationMapper.isSelfMentionByOrderNumber(orderNumber);//是否自提,0为非自提
+        int isClose=offSiteTransportationMapper.selectIsCloseByOrderNumber(orderNumber);//是否关闭,0为未关闭
+        if(isSelfMention!=0 && isClose==0)
+            return 0;
+        else
+            return 1;
     }
 
     public synchronized int addTransportationAlarm(TmstruckAbnormalResult tmstruckAbnormalResult, String tripId) {
@@ -223,16 +239,6 @@ public class OffSiteTransportationServiceImpl implements OffSiteTransportationSe
         Map<String, Object> parem=offSiteTransportationMapper.getTruckFactoryResult("WYSDD2021091000000002");
         parem.put("turnOf","0");
         return routeService.saveRoute(parem).toString();
-        //运输订单号:orderNumber、车牌号:capacityNumber、出厂时间:resultOutGateTime、预警开关:turnOf、发货地址:shipperName、收货地址:receiveAddress
-        //初始化请求参数
-//        HashMap<String,Object> mapValue=new HashMap<>();
-//        mapValue.put("orderNumber","WYSDD2021091000000001");
-//        mapValue.put("capacityNumber","豫SB6238");
-//        mapValue.put("resultOutGateTime","2021-11-17 14:20:19");
-//        mapValue.put("turnOf","0");
-//        mapValue.put("shipperName","四川达州钢铁集团有限");
-//        mapValue.put("receiveAddress","长沙市");
-//        return routeService.saveRoute(parem).toString();
     }
 
     public Integer addTmstruckReceiptResult(@RequestBody(required = false) Map<String,Object> map){

+ 1 - 1
src/main/resources/application-prod.yml

@@ -23,7 +23,7 @@ piction:
 #feign设置
 openfeign:
   ColumnDataFeign:
-    url: ${COLUMNDATAFEIGN_URL:172.16.33.166:8083}
+    url: ${COLUMNDATAFEIGN_URL:172.16.33.161:8083}
   BmsShipFeign:
     url: ${BMSSHIPFEIGN_URL:172.16.33.166:8078}
   BmsTruckFeign:

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

@@ -824,7 +824,7 @@
             </if>
         </if>
     </sql>
-    <select id="selectIsCloseOrder" resultType="java.lang.Integer">
+    <select id="selectIsClose" resultType="java.lang.Integer">
         select count(*) from RMS_CAPACITY RC
                                  left join OMSTRUCK_ORDER OO
                                            on  RC.CAPACITY_ID=OO.CAPACITY_ID
@@ -834,4 +834,14 @@
                                            on ASOM.SALE_ORDER_ID = ASO.SALE_ORDER_ID
         where OO.ORDER_TYPE in (1) and ASO.CLOSE_STATUS=1 and  RC.CAPACITY_NUMBER = #{capcityNumber}
     </select>
+    <select id="selectIsCloseByOrderNumber" resultType="java.lang.Integer">
+        select count(*) from RMS_CAPACITY RC
+                                 left join OMSTRUCK_ORDER OO
+                                           on  RC.CAPACITY_ID=OO.CAPACITY_ID
+                                 left join AMS_SALE_ORDER_MATERIAL ASOM
+                                           on OO.ORDER_PLAN_ID = ASOM.SALE_ORDER_MATERIAL_ID
+                                 left join AMS_SALE_ORDER ASO
+                                           on ASOM.SALE_ORDER_ID = ASO.SALE_ORDER_ID
+        where OO.ORDER_TYPE in (1) and ASO.CLOSE_STATUS=1 and  OO.ORDER_NUMBER =#{orderNumber}
+    </select>
 </mapper>