Ver código fonte

Merge branch 'master' of https://git.steerinfo.com/DAL-DAZHOU2/DAL-DAZHOU-OTMS-API

luobang 2 anos atrás
pai
commit
5d69450bb8

+ 4 - 0
pom.xml

@@ -141,6 +141,10 @@
             <version>RELEASE</version>
             <scope>compile</scope>
         </dependency>
+        <dependency>
+            <groupId>org.projectlombok</groupId>
+            <artifactId>lombok</artifactId>
+        </dependency>
     </dependencies>
     <build>
         <plugins>

+ 46 - 38
src/main/java/com/steerinfo/dil/controller/OffSiteTransportationController.java

@@ -2,6 +2,7 @@ package com.steerinfo.dil.controller;
 
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
+import com.steerinfo.dil.gaode.SearchPoint2;
 import com.steerinfo.dil.service.ITmstruckLeaveFactoryResultService;
 import com.steerinfo.dil.service.ITmstruckReceiptResultService;
 import com.steerinfo.dil.service.impl.OffSiteTransportationServiceImpl;
@@ -30,6 +31,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.data.redis.core.RedisTemplate;
 import org.springframework.http.MediaType;
+import org.springframework.util.StringUtils;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
 import org.springframework.web.multipart.MultipartRequest;
@@ -67,6 +69,7 @@ public class OffSiteTransportationController extends BaseRESTfulController {
     private String suffix;
     @Autowired
     private RedisTemplate redisTemplate;
+    private String gaodeTonken = "6488b963467353c2837c955cbb03104f";
 
     @Autowired
     ITmstruckReceiptResultService tmstruckReceiptResultService;
@@ -99,15 +102,15 @@ 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());
-        }else {
-            return failed("-1");
-        }
+//        }else {
+//            return failed("-1");
+//        }
 
     }
 
@@ -283,7 +286,7 @@ public class OffSiteTransportationController extends BaseRESTfulController {
         map.putAll(value);
         //添加入库实绩
         Integer resTfulResult = offSiteTransportationService.addTmstruckReceiptResult(map);
-        if (!resTfulResult.equals("4")){
+        if (resTfulResult!=4){
             //保存路线
             String redisJson = (String) redisTemplate.opsForValue().get(prefixOrder+":"+orderNumber);
             HashMap mapValue = JSON.parseObject(redisJson, HashMap.class);
@@ -301,7 +304,7 @@ public class OffSiteTransportationController extends BaseRESTfulController {
                 redisTemplate.delete(prefixOrder+":"+orderNumber);
                 redisTemplate.delete(prefixOrder+":"+orderNumber+suffix);
                 //添加运输距离
-                to= (ViewVisualization) DataConversionTool.jsonToBean(json,ViewVisualization.class);
+                to= (ViewVisualization) JSON.parseObject(json,ViewVisualization.class);
 
             }else {
                 HashMap<String,Object> hashMap=new HashMap();
@@ -313,7 +316,7 @@ public class OffSiteTransportationController extends BaseRESTfulController {
 
 
                     if (json!=null&&!json.equals("")){
-                        to= (ViewVisualization) DataConversionTool.jsonToBean(json,ViewVisualization.class);
+                        to= (ViewVisualization) JSON.parseObject(json,ViewVisualization.class);
                     }
                 }
             }
@@ -349,7 +352,7 @@ public class OffSiteTransportationController extends BaseRESTfulController {
         }
 
 
-        return success(1);
+        return success(resTfulResult);
     }
 
     //如果内容丢失重新获得
@@ -359,18 +362,22 @@ public class OffSiteTransportationController extends BaseRESTfulController {
         String netValidationResult = zhongJiaoXingLu.netValidation(capacityNumber);
         Map netValidationMap = (Map) JSONObject.parse(netValidationResult);
         if (Integer.parseInt(netValidationMap.get("status").toString())==1001&&netValidationMap.get("result").toString().equals("yes")){
-            String searchPointJson = HTTPRequestUtils.sendGet("https://apis.map.qq.com/ws/geocoder/v1/", "address="+ URLEncoder.encode("四川省达州钢铁集团有限责任公司","utf-8")+"&key=WDTBZ-A5VKJ-UDLFI-KYJY6-WTP2S-A6B4Y");
-            SearchPoint searchPoint= (SearchPoint) DataConversionTool.jsonToBean(searchPointJson, SearchPoint.class);
-            String searchPointJson2 = HTTPRequestUtils.sendGet("https://apis.map.qq.com/ws/geocoder/v1/", "address="+URLEncoder.encode("四川省达州钢铁集团有限责任公司","utf-8")+"&key=WDTBZ-A5VKJ-UDLFI-KYJY6-WTP2S-A6B4Y");
-            SearchPoint searchPoint2= (SearchPoint) DataConversionTool.jsonToBean(searchPointJson2, SearchPoint.class);
+            String searchPointJson = HTTPRequestUtils.sendGet("https://restapi.amap.com/v3/geocode/geo", "address="+ URLEncoder.encode("四川省达州钢铁集团有限责任公司","utf-8")+"&key="+gaodeTonken);
+            SearchPoint2 searchPoint=  JSON.parseObject(searchPointJson, SearchPoint2.class);
+            String searchPointJson2 = HTTPRequestUtils.sendGet("https://restapi.amap.com/v3/geocode/geo", "address="+URLEncoder.encode("四川省达州钢铁集团有限责任公司","utf-8")+"&key="+gaodeTonken);
+            SearchPoint2 searchPoint2= JSON.parseObject(searchPointJson2, SearchPoint2.class);
             //运单生成之后保存
             HashMap<String,String> redisMap=new HashMap<>();
-            String startLon=searchPoint.getResult().getLocation().getLng().toString().length()>9?searchPoint.getResult().getLocation().getLng().toString().substring(0,9):searchPoint.getResult().getLocation().getLng().toString();
-            String startLat=searchPoint.getResult().getLocation().getLat().toString().length()>9?searchPoint.getResult().getLocation().getLat().toString().substring(0,8):searchPoint.getResult().getLocation().getLat().toString();
-            redisMap.put("startLonlat", startLon+","+startLat);
-            String endLon= searchPoint2.getResult().getLocation().getLng().toString().length()>9?searchPoint2.getResult().getLocation().getLng().toString().substring(0,9):searchPoint2.getResult().getLocation().getLng().toString();
-            String endLat= searchPoint2.getResult().getLocation().getLat().toString().length()>9?searchPoint2.getResult().getLocation().getLat().toString().substring(0,8):searchPoint2.getResult().getLocation().getLat().toString();
-            redisMap.put("endLonlat",endLon+","+endLat);
+            String location = searchPoint.getGeocodes().get(0).getLocation();
+            String[] split = StringUtils.split(location, ",");
+            String Lng = split[0];
+            String Lat = split[1];
+            redisMap.put("startLonlat", Lng.substring(0, 9) + "," + Lat.substring(0, 8));
+            String location2 = searchPoint2.getGeocodes().get(0).getLocation();
+            String[] split2 = StringUtils.split(location2, ",");
+            String Lng2 = split2[0];
+            String Lat2 = split2[1];
+            redisMap.put("endLonlat", Lng2.substring(0, 9) + "," + Lat2.substring(0, 8));
             redisMap.put("vclN", capacityNumber);
             redisMap.put("vco","2");
             SimpleDateFormat simpleDateFormat=new SimpleDateFormat("yyyy-MM-dd HH:ss:mm");
@@ -429,7 +436,7 @@ public class OffSiteTransportationController extends BaseRESTfulController {
     @PostMapping("/abnormalLineWarn")
     public String abnormalLineWarn(@RequestParam(value = "data") String data) throws Exception {
 
-        ResultWarn resultWarn= (ResultWarn) DataConversionTool.jsonToBean(data, ResultWarn.class);
+        ResultWarn resultWarn= (ResultWarn) JSON.parseObject(data, ResultWarn.class);
         Map<String, Object> map=  DataConversionTool.objectToMap(resultWarn);
         int i= offSiteTransportationService.addTransportationAlarm(map);
         return "success";
@@ -437,7 +444,7 @@ public class OffSiteTransportationController extends BaseRESTfulController {
     @PostMapping("/parkWarn")
     public String parkWarn(@RequestParam(value = "data",required = false) String data) throws Exception {
 
-        ResultWarn resultWarn= (ResultWarn) DataConversionTool.jsonToBean(data, ResultWarn.class);
+        ResultWarn resultWarn= (ResultWarn) JSON.parseObject(data, ResultWarn.class);
         Map<String, Object> map=  DataConversionTool.objectToMap(resultWarn);
         int i=offSiteTransportationService.addTransportationAlarm(map);
 
@@ -446,7 +453,7 @@ public class OffSiteTransportationController extends BaseRESTfulController {
     @PostMapping("/offLineWarn")
     public String offLineWarn(@RequestParam(value = "data") String data) throws Exception {
 
-        ResultWarn resultWarn= (ResultWarn) DataConversionTool.jsonToBean(data, ResultWarn.class);
+        ResultWarn resultWarn= (ResultWarn) JSON.parseObject(data, ResultWarn.class);
         Map<String, Object> map=  DataConversionTool.objectToMap(resultWarn);
         int i=offSiteTransportationService.addTransportationAlarm(map);
         return "success";
@@ -475,14 +482,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,16 +530,8 @@ 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);
-//        }
-
-
+           CurrentLocationResult currentLocationResult = routeService.getCurrentLocation(capcityNumber);
+           return success(currentLocationResult);
     }
     //在途订单列表
     @PostMapping("/transportationPerformance")
@@ -571,4 +569,14 @@ public class OffSiteTransportationController extends BaseRESTfulController {
         PageListAdd pageList = columnDataUtil.tableColumnData(apiId, filter,list);
         return success(pageList);
     }
+
+    @GetMapping("/getLocationForAddress")
+    public RESTfulResult getAddress(@RequestParam("address") String address) {
+        try{
+            return success(routeService.getLocationForAddress(address));
+        }catch (Exception e){
+            e.printStackTrace();
+            return failed("没有查询到地址!请检查输入");
+        }
+    }
 }

+ 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")

+ 97 - 0
src/main/java/com/steerinfo/dil/gaode/Geocodes.java

@@ -0,0 +1,97 @@
+package com.steerinfo.dil.gaode;
+
+import lombok.Data;
+
+import java.util.Arrays;
+
+/**
+ * @program: Test
+ * @description
+ * @author: Dengyu
+ * @create: 2022-07-11 17:51
+ **/
+@Data
+public class Geocodes {
+    private String formatted_address;
+    private String country;
+    private String province;
+    private String citycode;
+    private String city;
+    private String district;
+    private String adcode;
+    private String location;
+    private String level;
+
+
+    public String getFormatted_address() {
+        return formatted_address;
+    }
+
+    public void setFormatted_address(String formatted_address) {
+        this.formatted_address = formatted_address;
+    }
+
+    public String getCountry() {
+        return country;
+    }
+
+    public void setCountry(String country) {
+        this.country = country;
+    }
+
+    public String getProvince() {
+        return province;
+    }
+
+    public void setProvince(String province) {
+        this.province = province;
+    }
+
+    public String getCitycode() {
+        return citycode;
+    }
+
+    public void setCitycode(String citycode) {
+        this.citycode = citycode;
+    }
+
+    public String getCity() {
+        return city;
+    }
+
+    public void setCity(String city) {
+        this.city = city;
+    }
+
+    public String getDistrict() {
+        return district;
+    }
+
+    public void setDistrict(String district) {
+        this.district = district;
+    }
+
+    public String getAdcode() {
+        return adcode;
+    }
+
+    public void setAdcode(String adcode) {
+        this.adcode = adcode;
+    }
+
+    public String getLocation() {
+        return location;
+    }
+
+    public void setLocation(String location) {
+        this.location = location;
+    }
+
+    public String getLevel() {
+        return level;
+    }
+
+    public void setLevel(String level) {
+        this.level = level;
+    }
+}

+ 60 - 0
src/main/java/com/steerinfo/dil/gaode/SearchPoint2.java

@@ -0,0 +1,60 @@
+package com.steerinfo.dil.gaode;
+
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * @program: Test
+ * @description
+ * @author: Dengyu
+ * @create: 2022-07-11 17:50
+ **/
+@Data
+public class SearchPoint2 {
+    private String status;
+    private String info;
+    private List<Geocodes> geocodes;
+    private String infocode;
+    private int count;
+
+    public String getStatus() {
+        return status;
+    }
+
+    public void setStatus(String status) {
+        this.status = status;
+    }
+
+    public String getInfo() {
+        return info;
+    }
+
+    public void setInfo(String info) {
+        this.info = info;
+    }
+
+    public List<Geocodes> getGeocodes() {
+        return geocodes;
+    }
+
+    public void setGeocodes(List<Geocodes> geocodes) {
+        this.geocodes = geocodes;
+    }
+
+    public String getInfocode() {
+        return infocode;
+    }
+
+    public void setInfocode(String infocode) {
+        this.infocode = infocode;
+    }
+
+    public int getCount() {
+        return count;
+    }
+
+    public void setCount(int count) {
+        this.count = count;
+    }
+}

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

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

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

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

+ 21 - 11
src/main/java/com/steerinfo/dil/service/impl/OffSiteTransportationServiceImpl.java

@@ -191,8 +191,28 @@ public class OffSiteTransportationServiceImpl implements OffSiteTransportationSe
         return offSiteTransportationMapper.isSelfMentionByOrderNumber(orderNumber);
     }
 
+    @Override
+    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) {
+    public synchronized int addTransportationAlarm(TmstruckAbnormalResult tmstruckAbnormalResult, String tripId) {
         long id;
         if(tmstruckAbnormalResultMapper.selectMaxId()==null){
             id = 1;
@@ -219,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/java/com/steerinfo/route/config/ImageFileUtils.java

@@ -1,7 +1,7 @@
 package com.steerinfo.route.config;
 
 import com.steerinfo.framework.utils.misc.IdGenerator;
-import com.steerinfo.framework.utils.upload.UploadUtils;
+import com.steerinfo.route.util.UploadUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Component;

+ 4 - 0
src/main/java/com/steerinfo/route/mapper/TmstruckReceiptResultChildMapper.java

@@ -5,9 +5,13 @@ import com.steerinfo.route.model.TmstruckReceiptResultChild;
 import org.apache.ibatis.annotations.Mapper;
 
 import java.math.BigDecimal;
+import java.util.Map;
 
 @Mapper
 public interface TmstruckReceiptResultChildMapper extends IBaseMapper<TmstruckReceiptResultChild, BigDecimal> {
     //获取主键最大值
     BigDecimal selectMaxId();
+
+    //查询收货地址等信息
+    Map<String,Object> getAddress(Map<String,Object> map);
 }

+ 3 - 0
src/main/java/com/steerinfo/route/service/RouteService.java

@@ -4,6 +4,7 @@ import com.steerinfo.route.vo.Map.RouteVo;
 import com.steerinfo.route.vo.currentLocation.CurrentLocation;
 import com.steerinfo.route.vo.currentLocation.CurrentLocationResult;
 
+import java.io.UnsupportedEncodingException;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.concurrent.CompletableFuture;
@@ -18,4 +19,6 @@ public interface RouteService {
     public CompletableFuture<RouteVo> fullPathVisualizationByCarNumber(HashMap mapValue) throws Exception;
 
     CurrentLocationResult getCurrentLocation(String capcityNumber) throws Exception;
+
+    Map<String,Object> getLocationForAddress(String address) throws UnsupportedEncodingException;
 }

Diferenças do arquivo suprimidas por serem muito extensas
+ 408 - 350
src/main/java/com/steerinfo/route/service/impl/RouteServiceImpl.java


+ 75 - 0
src/main/java/com/steerinfo/route/util/UploadUtils.java

@@ -0,0 +1,75 @@
+package com.steerinfo.route.util;
+
+import com.google.common.io.Files;
+import com.steerinfo.framework.exception.BaseException;
+import com.steerinfo.framework.utils.io.FileUtils;
+import com.steerinfo.framework.utils.misc.IdGenerator;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.imageio.ImageIO;
+import java.awt.image.BufferedImage;
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+
+/**
+ * @author zx
+ * @Description:
+ * @CreateTime 2022/7/15 19:05
+ * @Version:1.0
+ */
+
+    public class UploadUtils {
+        public UploadUtils() {
+        }
+
+        public static String uploadFile(MultipartFile file, IdGenerator idGenerator, String uploadPath, String imgPath) {
+            String profilePhoto = null;
+            if (file != null) {
+                String fileId = idGenerator.getNextStr();
+                String fileName = file.getOriginalFilename();
+                String ext = Files.getFileExtension(fileName.toLowerCase());
+                try {
+                    String filePath = uploadPath + imgPath + fileId + "." + ext;
+                    File newFile = new File(filePath);
+                    FileUtils.makesureParentDirExists(newFile);
+                    Files.write(file.getBytes(), newFile);
+                } catch (IOException var10) {
+                    throw new BaseException("上传文件为空:" + var10.getMessage());
+                }
+
+                profilePhoto = uploadPath + imgPath + fileId + "." + ext;
+            }
+
+            return profilePhoto;
+        }
+
+        public static byte[] imageToByte(String imgUrl) {
+            if (StringUtils.isEmpty(imgUrl)) {
+                return null;
+            } else {
+                File file = new File(imgUrl);
+                byte[] data = null;
+                if (file.exists()) {
+                    String ext = Files.getFileExtension(imgUrl.toLowerCase());
+                    ByteArrayOutputStream out = new ByteArrayOutputStream();
+
+                    try {
+                        BufferedImage bi = ImageIO.read(file);
+                        ImageIO.write(bi, ext, out);
+                        data = out.toByteArray();
+                    } catch (FileNotFoundException var7) {
+                        var7.printStackTrace();
+                    } catch (IOException var8) {
+                        var8.printStackTrace();
+                    }
+                }
+
+                return data;
+            }
+        }
+    }
+
+

+ 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:

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

@@ -824,4 +824,24 @@
             </if>
         </if>
     </sql>
+    <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
+                                 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>
+    <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>

+ 34 - 0
src/main/resources/com/steerinfo/route/mapper/TmstruckReceiptResultChildMapper.xml

@@ -344,4 +344,38 @@
   <select id="selectMaxId"  resultType="java.math.BigDecimal">
     select max(CHILD_ID) from TMSTRUCK_RECEIPT_RESULT_CHILD
   </select>
+    <select id="getAddress" resultType="java.util.Map">
+      SELECT distinct
+        OO.ORDER_NUMBER "orderNumber",
+        R_CARRIER.CARRIER_NAME "carrierName",
+        RCA.CAPACITY_NUMBER "capacityNumber",
+        RS.SHIPPER_NAME "shipperName",
+        RC.CONSIGNEE_COMPANY_NAME "consigneeName",
+        ASOM.SALE_ORDER_CONSIGNEE_TEL "consigneeTel",
+        RRA.ADDRESS_PROVINCE || RRA.ADDRESS_DISTRICT ||
+        RRA.ADDRESS_TOWN || RRP.ADDRESS_DELIVERY_ADDRESS AS "addressPlace",
+        ASOM.SALE_DATE_OF_RECEIPT "deadLine",
+        OO.DRIVER_TEL "capacityTel"
+      FROM AMS_SALE_ORDER ASO
+             LEFT JOIN RMS_CONSIGNEE RC
+                       ON RC.CONSIGNEE_ID = ASO.RECEIVE_ID
+             LEFT JOIN RMS_SHIPPER RS
+                       ON RS.SHIPPER_ID = ASO.SHIPPER_ID
+             LEFT JOIN AMS_SALE_ORDER_MATERIAL ASOM
+                       ON ASOM.SALE_ORDER_ID = ASO.SALE_ORDER_ID
+             LEFT JOIN RMS_RECEIVE_PLACE RRP
+                       ON RRP.PLACE_ID = ASOM.SALE_SHIPPING_ADDRESS_ID
+             LEFT JOIN RMS_RECEIVE_ADDRESS RRA
+                       ON RRA.ADDRESS_ID = RRP.ADDRESS_ID
+             LEFT JOIN AMS_DISPATCH_SALE_ORDER ADSO
+                       ON ADSO.SALE_ORDER_MATERIAL_ID = ASOM.SALE_ORDER_MATERIAL_ID
+             LEFT JOIN RMS_CARRIER R_CARRIER
+                       ON R_CARRIER.CARRIER_ID = ADSO.CARRIER_ID
+             LEFT JOIN OMSTRUCK_ORDER OO
+                       ON OO.ORDER_PLAN_ID = ASOM.SALE_ORDER_MATERIAL_ID
+             LEFT JOIN RMS_CAPACITY RCA
+                       ON RCA.CAPACITY_ID = OO.CAPACITY_ID
+      WHERE OO.ORDER_STATUS = 5
+        AND RCA.CAPACITY_NUMBER=#{capacityNumber}
+    </select>
 </mapper>

Alguns arquivos não foram mostrados porque muitos arquivos mudaram nesse diff