liyg 3 vuotta sitten
vanhempi
commit
2d5cc2f030

+ 9 - 8
src/main/java/com/steerinfo/dil/controller/OffSiteTransportationController.java

@@ -524,14 +524,15 @@ public class OffSiteTransportationController extends BaseRESTfulController {
     }
     @GetMapping("/getCurrentLocation")
     public RESTfulResult getCurrentLocation(@RequestParam("capcityNumber") String capcityNumber) throws Exception {
-//        //判断是否自提
-//        int count = offSiteTransportationService.isSelfMention(capcityNumber);
-//        if (count==0){
-        CurrentLocationResult currentLocationResult = routeService.getCurrentLocation(capcityNumber);
-        return success(currentLocationResult);
-//        }else {
-//            return failed(-1);
-//        }
+        //自提 且 运输订单未关闭的,不能查看
+        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);
+        }
 
 
     }

+ 0 - 1
src/main/java/com/steerinfo/dil/controller/TestController.java

@@ -42,7 +42,6 @@ public class TestController extends BaseRESTfulController {
 //        mapValue.put("turnOf","0");
 //        mapValue.put("shipperName","四川达州钢铁集团有限");
 //        mapValue.put("receiveAddress","长沙市");
-        //测试
         return routeService.saveRoute(parem).toString();
     }
     @PostMapping("/fullPath")

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

@@ -44,4 +44,6 @@ public interface OffSiteTransportationMapper {
     int selectIsSelfMention(String capcityNumber);
 
     int isSelfMentionByOrderNumber(String orderNumber);
+
+    int selectIsCloseOrder(String capcityNumber);
 }

+ 2 - 0
src/main/java/com/steerinfo/dil/service/OffSiteTransportationService.java

@@ -37,4 +37,6 @@ public interface OffSiteTransportationService {
     int isSelfMention(String capcityNumber);
 
     int isSelfMentionByOrderNumber(String orderNumber);
+
+    int isCloseOrder(String capcityNumber);
 }

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

@@ -191,8 +191,12 @@ public class OffSiteTransportationServiceImpl implements OffSiteTransportationSe
         return offSiteTransportationMapper.isSelfMentionByOrderNumber(orderNumber);
     }
 
+    @Override
+    public int isCloseOrder(String capcityNumber) {
+        return offSiteTransportationMapper.selectIsCloseOrder(capcityNumber);
+    }
 
-    public synchronized int addTransportationAlarm(TmstruckAbnormalResult tmstruckAbnormalResult,String tripId) {
+    public synchronized int addTransportationAlarm(TmstruckAbnormalResult tmstruckAbnormalResult, String tripId) {
         long id;
         if(tmstruckAbnormalResultMapper.selectMaxId()==null){
             id = 1;

+ 10 - 0
src/main/resources/com/steerinfo/dil/mapper/OffSiteTransportationMapper.xml

@@ -824,4 +824,14 @@
             </if>
         </if>
     </sql>
+    <select id="selectIsCloseOrder" 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  RC.CAPACITY_NUMBER = #{capcityNumber}
+    </select>
 </mapper>