Selaa lähdekoodia

Merge branch 'master' of https://git.steerinfo.com/DAL-DAZHOU1/DAL-TMS-TRUCK-API

txf 3 vuotta sitten
vanhempi
commit
85c5d05617

+ 7 - 0
src/main/java/com/steerinfo/dil/controller/TmstruckEnfactoryResultController.java

@@ -141,4 +141,11 @@ public class TmstruckEnfactoryResultController extends BaseRESTfulController {
         return success(mapList);
     }
 
+    @ApiOperation(value="更新进厂实绩")
+    @PostMapping("/updateEnSge")
+    public int updateEnSge() {
+        int i = tmstruckEnfactoryResultService.updateEnSge();
+        return i;
+    }
+
 }

+ 52 - 7
src/main/java/com/steerinfo/dil/controller/TmstruckReceiptResultController.java

@@ -21,10 +21,7 @@ import org.springframework.web.bind.annotation.*;
 
 import java.math.BigDecimal;
 import java.text.SimpleDateFormat;
-import java.util.Calendar;
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 
 /**
  * TmstruckReceiptResult RESTful接口:
@@ -155,7 +152,7 @@ public class TmstruckReceiptResultController extends BaseRESTfulController {
 
 
 
-    @ApiOperation(value="展示收货实绩信息")
+    @ApiOperation(value="展示抵达实绩信息")
     @ApiImplicitParams({
             @ApiImplicitParam(name = "apiId(470)", value = "表头", required = false, dataType = "Interger")
     })
@@ -167,8 +164,11 @@ public class TmstruckReceiptResultController extends BaseRESTfulController {
                                           String startTime,
                                           String endTime,
                                           String con){
-        if(con!=null) {
-            mapValue.put("con", con);
+        if (con != null && (con.equals("") || con.equals("undefined")) ) {
+            con = null;
+        }
+        if (con != null && con.length() != 0) {
+            mapValue.put("con","%" + con + "%");
         }
         DataChange.queryDataByDateTime(startTime, endTime, mapValue, sdfDateTime);
         PageHelper.startPage(pageNum,pageSize);
@@ -189,4 +189,49 @@ public class TmstruckReceiptResultController extends BaseRESTfulController {
         }
         return success(photo);
     }
+
+    @ApiOperation(value="展示收货实绩信息")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "apiId(470)", value = "表头", required = false, dataType = "Interger")
+    })
+    @PostMapping("/getReceivingResult")
+    public RESTfulResult getReceivingResult(@RequestBody(required=false) Map<String, Object> mapValue,
+                                          Integer apiId,
+                                          Integer pageNum,
+                                          Integer pageSize,
+                                          String startTime,
+                                          String endTime,
+                                          String con){
+        if (con != null && (con.equals("") || con.equals("undefined")) ) {
+            con = null;
+        }
+        if (con != null && con.length() != 0) {
+            mapValue.put("con","%" + con + "%");
+        }
+        DataChange.queryDataByDateTime(startTime, endTime, mapValue, sdfDateTime);
+        PageHelper.startPage(pageNum,pageSize);
+        List<Map<String, Object>> receiptResultInfo = tmstruckReceiptResultService.getReceivingResult(mapValue);
+        PageListAdd pageList = columnDataUtil.tableColumnData(apiId,null,receiptResultInfo);
+        return success(pageList);
+    }
+
+    @ApiOperation(value = "获取收货作业照片")
+    @PostMapping("/getReceivingPhoto")
+    public RESTfulResult getReceivingPhoto(@RequestParam String orderNumber) throws Exception {
+        List<Map<String,Object>> mapList = tmstruckReceiptResultService.getReceivingPhoto(orderNumber);
+
+        for(Map<String,Object> map:mapList){
+            if(map.containsKey("resultEmptyContainerPhoto") && map.get("resultEmptyContainerPhoto")!=null){
+                String resultEmptyContainerPhoto = (String) imageFileUtils.downloadFile(map.get("resultEmptyContainerPhoto").toString());
+                map.put("resultEmptyContainerPhoto",resultEmptyContainerPhoto);
+            }
+            if(map.containsKey("resultSignedNotePhoto") && map.get("resultSignedNotePhoto")!=null){
+                String resultSignedNotePhoto = (String) imageFileUtils.downloadFile(map.get("resultSignedNotePhoto").toString());
+              map.put("resultSignedNotePhoto",resultSignedNotePhoto);
+            }
+        }
+
+        return success(mapList.get(0));
+    }
+
 }

+ 3 - 0
src/main/java/com/steerinfo/dil/mapper/TmstruckEnfactoryResultMapper.java

@@ -70,4 +70,7 @@ public interface TmstruckEnfactoryResultMapper extends IBaseMapper<TmstruckEnfac
     //辅料查询 有几次进厂 并进了几次厂
     Integer selectEnFactoryNumber(BigDecimal resultTotalId);
     Integer selectAllEnFactoryNum(BigDecimal resultTotalId);
+
+    List<Map<String, Object>> getEnResult();
+
 }

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

@@ -34,4 +34,8 @@ public interface TmstruckReceiptResultMapper extends IBaseMapper<TmstruckReceipt
     List<Map<String, Object>> getReceiptResultInfo(Map<String, Object> map);
 
     String getReceiptPhoto(String orderNumber);
+
+    List<Map<String, Object>> getReceivingResult(Map<String, Object> mapValue);
+
+    List<Map<String, Object>> getReceivingPhoto(String orderNumber);
 }

+ 3 - 0
src/main/java/com/steerinfo/dil/service/ITmstruckEnfactoryResultService.java

@@ -40,4 +40,7 @@ public interface ITmstruckEnfactoryResultService{
     List<Map<String, Object>> getEnfactoryResultList();
     // APP通过运输订单id查询进厂实绩
     List<Map<String, Object>> getEnfactoryMessageByOrderId(String orderNumber);
+
+    int updateEnSge();
+
 }

+ 4 - 0
src/main/java/com/steerinfo/dil/service/ITmstruckReceiptResultService.java

@@ -35,4 +35,8 @@ public interface ITmstruckReceiptResultService{
     List<Map<String, Object>> getReceiptResultInfo(Map<String, Object> map);
     //获取抵达作业照片
     String getReceiptPhoto(String orderNumber);
+
+    List<Map<String, Object>> getReceivingResult(Map<String, Object> mapValue);
+
+    List<Map<String, Object>> getReceivingPhoto(String orderNumber);
 }

+ 16 - 0
src/main/java/com/steerinfo/dil/service/impl/TmstruckEnfactoryResultServiceImpl.java

@@ -74,6 +74,7 @@ public class TmstruckEnfactoryResultServiceImpl implements ITmstruckEnfactoryRes
         tmstruckEnfactoryResult.setGatepostId(new BigDecimal(gatepostId));
         // 添加路段顺序号
         tmstruckEnfactoryResult.setSegmenSqe(DataChange.dataToBigDecimal(map.get("segmentSqe")));
+        System.out.println(DataChange.dataToBigDecimal(map.get("segmentSqe")));
         return tmstruckEnfactoryResultMapper.insertSelective(tmstruckEnfactoryResult);
     }
 
@@ -348,6 +349,21 @@ public class TmstruckEnfactoryResultServiceImpl implements ITmstruckEnfactoryRes
         return tmstruckEnfactoryResultMapper.getEnfactoryMessageByOrderId(orderNumber);
     }
 
+    @Override
+    public int updateEnSge() {
+        List<Map<String,Object>>maplist = tmstruckEnfactoryResultMapper.getEnResult();
+        int i = 0;
+        for (Map<String,Object>map:maplist
+             ) {
+            BigDecimal resultId = DataChange.dataToBigDecimal(map.get("resultId"));
+            TmstruckEnfactoryResult tmstruckEnfactoryResult = new TmstruckEnfactoryResult();
+            tmstruckEnfactoryResult.setResultId(resultId);
+            tmstruckEnfactoryResult.setSegmenSqe(new BigDecimal(6));
+            i = tmstruckEnfactoryResultMapper.updateByPrimaryKeySelective(tmstruckEnfactoryResult);
+        }
+        return i;
+    }
+
     /**
      * 生成进厂实绩
      * @param map

+ 10 - 0
src/main/java/com/steerinfo/dil/service/impl/TmstruckReceiptResultServiceImpl.java

@@ -76,6 +76,16 @@ public class TmstruckReceiptResultServiceImpl implements ITmstruckReceiptResultS
         return tmstruckReceiptResultMapper.getReceiptPhoto(orderNumber);
     }
 
+    @Override
+    public List<Map<String, Object>> getReceivingResult(Map<String, Object> mapValue) {
+        return tmstruckReceiptResultMapper.getReceivingResult(mapValue);
+    }
+
+    @Override
+    public List<Map<String, Object>> getReceivingPhoto(String orderNumber) {
+        return tmstruckReceiptResultMapper.getReceivingPhoto(orderNumber);
+    }
+
     /**
      * 查询所有收货实绩
      * @param map

+ 2 - 1
src/main/java/com/steerinfo/dil/service/impl/TmstruckSmsRusultServiceImpl.java

@@ -55,6 +55,7 @@ public class TmstruckSmsRusultServiceImpl  implements ITmstruckSmsRusultService
         BigDecimal resultTotalId = utilsMapper.getTotalIdByOrderId(orderId);
         tmstruckSmsRusult.setTotalResultId(resultTotalId);
         tmstruckSmsRusult.setResultSendingTime(new Date());
+        tmstruckSmsRusult.setResultSmsContent("【达州钢铁】您好!您在达钢购买的钢材已发车.欲知详情,请前往https://wl.dasteel.cn:32322/views/#/地址,浏览车辆实时运输状态。退订");
         //新增短信实绩
         tmstruckSmsRusult.setInsertTime(new Date());
         tmstruckSmsRusultMapper.insertSelective(tmstruckSmsRusult);
@@ -66,7 +67,7 @@ public class TmstruckSmsRusultServiceImpl  implements ITmstruckSmsRusultService
         String tmpTmp = MD5Util.formatTimeTmp();
         String sign = MD5Util.sign("EUCP-EMY-SMS1-10QNI","EE20B0B28B75E567");
         String mobile1 = mobile;
-        String content = "【达州钢铁】您好,您在达钢购买的钢材已发车,司机车牌号:" + capacityNum + "。退订";
+        String content = "【达州钢铁】您好!您在达钢购买的钢材已发车.欲知详情,请前往https://wl.dasteel.cn:32322/views/#/地址,浏览车辆实时运输状态。退订";
         String sendUrl = url+"timestamp=" + tmpTmp + "&sign=" + sign + "&mobiles=" + mobile1 + "&content=" + content;
         String jsonData = null;
         JSONObject jsonObject = new JSONObject();

+ 0 - 1
src/main/java/com/steerinfo/dil/util/MD5Util.java

@@ -66,6 +66,5 @@ import java.util.SimpleTimeZone;
             System.out.println(sign(ApiId,sererct));
         }
 
-
     }
 

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

@@ -1473,5 +1473,15 @@
         where TER.RESULT_TOTAL_ID = #{resultTotalId}
         and TER.RESULT_ENTRY_GATE_TIME is null
     </select>
+    <select id="getEnResult" resultType="java.util.Map">
+        SELECT TER.RESULT_ID "resultId", TER.SEGMEN_SQE,TER.INSERT_TIME,oo.ORDER_TYPE
+        FROM OMSTRUCK_ORDER OO
+        LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR
+        ON TTR.ORDER_ID = OO.ORDER_ID
+        LEFT JOIN TMSTRUCK_ENFACTORY_RESULT TER
+        ON TER.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
+        WHERE OO.ORDER_TYPE = 20
+        AND TER.SEGMEN_SQE = 5
+    </select>
 
 </mapper>

+ 218 - 0
src/main/resources/com/steerinfo/dil/mapper/TmstruckReceiptResultMapper.xml

@@ -999,4 +999,222 @@
     on oo.ORDER_ID = ttr.ORDER_ID
     where oo.ORDER_NUMBER = #{orderNumber}
   </select>
+
+
+  <select id="getReceivingResult" parameterType="java.util.Map" resultType="java.util.LinkedHashMap">
+    select
+    *
+    from (
+    select  distinct  OO.ORDER_NUMBER              "orderNumber", --运单订单号
+    RC.CAPACITY_NUMBER           "capacityNumber",--车牌号
+    TWR.RESULT_GROSS_WEIGHT_TIME "resultGrossWeightTime",--计毛时间
+    TWR.RESULT_NET_WEIGHT        "resultNetWeight",--净重
+    TLFR.RESULT_OUT_GATE_TIME    "resultOutGateTime",--出厂时间
+    RGOUT.GATEPOST_NAME          "outGatepostName",--出厂门禁
+    RCR.CARRIER_NAME             "carrierName" , --承运商名称
+    RRP.ADDRESS_DELIVERY_ADDRESS "deliveryAddress",  --详细收货地址
+    RM.MATERIAL_NAME             "materialName" , --"物质名称"
+    RM.MATERIAL_SPECIFICATION    "materialSpecification", -- "物质规格"
+    RM.MATERIAL_MODEL            "materialModel", --"物质型号"
+    RCON.CONSIGNEE_COMPANY_NAME   "receiveName",--客户名称
+    TRR.RESULT_ARRIVAL_ADDRESS "resultArrivalAddress",--签收收货点的地址
+    TRR.INSERT_TIME "insertTime",--签收作业时间
+    TRR.ORDER_MILEAGE "orderMileage" --运输距离
+    from OMSTRUCK_ORDER OO --运输订单
+    left join AMS_SALE_ORDER_MATERIAL ASOM --销售订单物质表
+    on ASOM.SALE_ORDER_MATERIAL_ID = OO.ORDER_PLAN_ID
+    left join AMS_SALE_ORDER ASO --销售订单
+    on ASO.SALE_ORDER_ID = ASOM.SALE_ORDER_ID
+    left join RMS_CONSIGNEE RCON --收货客户
+    on RCON.CONSIGNEE_ID = ASO.RECEIVE_ID
+    left join TMSTRUCK_TOTAL_RESULT TTR --运输总实绩
+    on TTR.ORDER_ID = OO.ORDER_ID
+    left join TMSTRUCK_LOAD_RESULT TLR --汽车运输实绩表
+    on TLR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
+    left join TMSTRUCK_RECEIPT_RESULT TRR
+    on TRR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
+    left join RMS_WAREHOUSE RW --装卸货仓库
+    on RW.WAREHOUSE_ID = TLR.LOADING_ID
+
+    left join TMSTRUCK_LEAVE_FACTORY_RESULT TLFR --离厂实绩
+    on TLFR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
+    left join RMS_GATEPOST RGOUT --门岗
+    on RGOUT.GATEPOST_ID = TLFR.GATEPOST_ID
+    left join RMS_CAPACITY RC --运力
+    on RC.CAPACITY_ID = OO.CAPACITY_ID
+
+
+    left join AMS_DISPATCH_SALE_ORDER  ADSO
+    on ASOM.SALE_ORDER_MATERIAL_ID=ADSO.SALE_ORDER_MATERIAL_ID
+    left join RMS_CARRIER RCR --承运单位
+    on ADSO.CARRIER_ID=RCR.CARRIER_ID
+
+
+    left join RMS_RECEIVE_PLACE RRP  --收货地址
+    on ASOM.SALE_SHIPPING_ADDRESS_ID=RRP.PLACE_ID
+    left join RMS_RECEIVE_ADDRESS REA
+    on RRP.ADDRESS_ID=REA.ADDRESS_ID
+
+    left join AMS_SALE_TRUCKNO_MATERIAL ASTM
+    on ASOM.SALE_ORDER_MATERIAL_ID=ASTM.SALE_ORDER_MATERIAL_ID
+    left join AMS_SALE_MATERIAL ASM1
+    on ASTM.MATERIAL_ID =ASM1.SALE_MATERIAL_ID
+    left join TMSTRUCK_WEIGHT_RESULT TWR --运输实绩计重
+    on TWR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID  and  ASM1.MATERIAL_ID =TWR.MATERIAL_ID
+    left join RMS_MATERIAL RM
+    on ASM1.MATERIAL_ID=RM.MATERIAL_ID
+    where OO.ORDER_TYPE in (1) and TRR.INSERT_TIME IS NOT NULL
+    <if test="oneDate != null">
+      and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') &lt; = TAR.INSERT_TIME
+    </if>
+    <if test="startDate != null">
+      and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= TAR.INSERT_TIME
+      and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= TAR.INSERT_TIME
+    </if>
+    <if test="con!=null">
+      and (instr(RC.CAPACITY_NUMBER,#{con})>0 or instr(RM.MATERIAL_NAME,#{con})>0
+      or instr(RCON.CONSIGNEE_COMPANY_NAME,#{con})>0)
+    </if>
+    )
+    <where>
+      <if test="orderNumbers !=null">
+        and "orderNumber" like '${orderNumbers}'
+      </if>
+      <if test="capacityNumbers !=null">
+        and "capacityNumber" like '${capacityNumbers}'
+      </if>
+      <if test="resultGrossWeightTimes !=null">
+        and "resultGrossWeightTime" like '${resultGrossWeightTimes}'
+      </if>
+      <if test="resultGrossWeightTimes !=null">
+        and "resultGrossWeightTime" like '${resultGrossWeightTimes}'
+      </if>
+      <if test="resultOutGateTimes !=null">
+        and "resultOutGateTime" like '${resultOutGateTimes}'
+      </if>
+      <if test="resultNetWeights !=null">
+        and "resultNetWeight" like '${resultNetWeights}'
+      </if>
+      <if test="resultOutGateTimes !=null">
+        and "resultOutGateTime" like '${resultOutGateTimes}'
+      </if>
+      <if test="outGatepostNames !=null">
+        and "outGatepostName" like '${outGatepostNames}'
+      </if>
+      <if test="carrierNames !=null">
+        and "carrierName" like '${carrierNames}'
+      </if>
+      <if test="deliveryAddresss !=null">
+        and "deliveryAddress" like '${deliveryAddresss}'
+      </if>
+      <if test="materialNames !=null">
+        and "materialName" like '${materialNames}'
+      </if>
+      <if test="materialSpecifications !=null">
+        and "materialSpecification" like '${materialSpecifications}'
+      </if>
+      <if test="materialModels !=null">
+        and "materialModel" like '${materialModels}'
+      </if>
+      <if test="receiveNames !=null">
+        and "receiveName" like '${receiveNames}'
+      </if>
+      <if test="orderNumber !=null">
+        and  "orderNumber" in
+        <foreach collection="orderNumber" separator="," open="(" close=")" item="item" >
+          #{item}
+        </foreach>
+      </if>
+      <if test="capacityNumber !=null">
+        and  "capacityNumber" in
+        <foreach collection="capacityNumber" separator="," open="(" close=")" item="item" >
+          #{item}
+        </foreach>
+      </if>
+      <if test="resultGrossWeightTime !=null">
+        and  "resultGrossWeightTime" in
+        <foreach collection="resultGrossWeightTime" separator="," open="(" close=")" item="item" >
+          #{item}
+        </foreach>
+      </if>
+      <if test="resultNetWeight !=null">
+        and  "resultNetWeight" in
+        <foreach collection="resultNetWeight" separator="," open="(" close=")" item="item" >
+          #{item}
+        </foreach>
+      </if>
+      <if test="resultOutGateTime !=null">
+        and  "resultOutGateTime" in
+        <foreach collection="resultOutGateTime" separator="," open="(" close=")" item="item" >
+          #{item}
+        </foreach>
+      </if>
+      <if test="outGatepostName !=null">
+        and  "outGatepostName" in
+        <foreach collection="outGatepostName" separator="," open="(" close=")" item="item" >
+          #{item}
+        </foreach>
+      </if>
+      <if test="carrierName !=null">
+        and  "carrierName" in
+        <foreach collection="carrierName" separator="," open="(" close=")" item="item" >
+          #{item}
+        </foreach>
+      </if>
+      <if test="deliveryAddress !=null">
+        and  "deliveryAddress" in
+        <foreach collection="deliveryAddress" separator="," open="(" close=")" item="item" >
+          #{item}
+        </foreach>
+      </if>
+      <if test="materialSpecification !=null">
+        and  "materialSpecification" in
+        <foreach collection="materialSpecification" separator="," open="(" close=")" item="item" >
+          #{item}
+        </foreach>
+      </if>
+      <if test="materialModel !=null">
+        and  "materialModel" in
+        <foreach collection="materialModel" separator="," open="(" close=")" item="item" >
+          #{item}
+        </foreach>
+      </if>
+      <if test="receiveName !=null">
+        and  "receiveName" in
+        <foreach collection="receiveName" separator="," open="(" close=")" item="item" >
+          #{item}
+        </foreach>
+      </if>
+      <if test="resultArrivalAddress !=null">
+        and  "resultArrivalAddress" in
+        <foreach collection="resultArrivalAddress" separator="," open="(" close=")" item="item" >
+          #{item}
+        </foreach>
+      </if>
+      <if test="insertTime !=null">
+        and  "insertTime" in
+        <foreach collection="insertTime" separator="," open="(" close=")" item="item" >
+          #{item}
+        </foreach>
+      </if>
+      <if test="orderMileage !=null">
+        and  "orderMileage" in
+        <foreach collection="orderMileage" separator="," open="(" close=")" item="item" >
+          #{item}
+        </foreach>
+      </if>
+    </where>
+    <include refid="orderBy"></include>
+  </select>
+
+  <select id="getReceivingPhoto" parameterType="java.lang.String" resultType="map">
+    select trr.RESULT_EMPTY_CONTAINER_PHOTO "resultEmptyContainerPhoto",
+           trr.RESULT_SIGNED_NOTE_PHOTO "resultSignedNotePhoto"
+    from TMSTRUCK_RECEIPT_RESULT trr
+    left join TMSTRUCK_TOTAL_RESULT ttr
+    on ttr.RESULT_TOTAL_ID = trr.RESULT_TOTAL_ID
+    left join OMSTRUCK_ORDER oo
+    on oo.ORDER_ID = ttr.ORDER_ID
+    where oo.ORDER_NUMBER = #{orderNumber}
+  </select>
 </mapper>

+ 10 - 6
src/main/resources/com/steerinfo/dil/mapper/TmstruckSmsRusultMapper.xml

@@ -361,12 +361,16 @@
   </select>
 <!-- 查询短信实绩 -->
   <select id="selectSmsResult" parameterType="java.util.Map" resultType="java.util.Map">
-    SELECT  RS.SHIPPER_NAME "shipperName",
-            TSR.RESULT_SENDING_TIME "sendIngTime",
-            TSR.RESULT_SMS_CONTENT "content"
-    from TMSTRUCK_SMS_RUSULT TSR
-    left join RMS_SHIPPER RS
-    on TSR.SENDER_ID=RS.SHIPPER_ID
+    SELECT TSR.RESULT_SENDING_TIME "sendIngTime",
+           TSR.RESULT_SMS_CONTENT  "content",
+           rc.capacity_number      "capacityNo"
+    FROM TMSTRUCK_SMS_RUSULT TSR
+           LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR
+                     ON TTR.RESULT_TOTAL_ID = TSR.TOTAL_RESULT_ID
+           left join omstruck_order oo
+                     on oo.order_id = ttr.order_id
+           left join rms_capacity rc
+                     on rc.capacity_id = oo.capacity_id
   </select>
     <select id="selectIdApp" resultType="java.util.Map">
       select rs.SHIPPER_APPID "AppId",