فهرست منبع

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

luobang 2 سال پیش
والد
کامیت
51da1a6e3b

+ 10 - 2
src/main/java/com/steerinfo/dil/controller/StatisticalReportController.java

@@ -918,7 +918,11 @@ public class StatisticalReportController extends BaseRESTfulController {
                                             String saler,
                                             String easPrimaryId
     ){
-        DataChange.queryDataByDateTimeYestDay(startTime, endTime, map, sdfDateTime);//根时间段查询数据
+        if(map.get("saleMakeDate")!=null){
+            DataChange.queryDataByDateTime(startTime, endTime, map, sdfDateTime);//根据时间段查询数据
+        }else{
+            DataChange.queryDataByDateTimeYestDay(startTime, endTime, map, sdfDateTime);//根据时间段查询数据
+        }
         if(carrierSsoId != null){
             if(!"null".equals(carrierSsoId) && carrierSsoId != null){
                 map.put("carrierSsoId", carrierSsoId);
@@ -1027,7 +1031,11 @@ public class StatisticalReportController extends BaseRESTfulController {
                                                String saler,
                                                String easPrimaryId
     ){
-        DataChange.queryDataByDateTimeYestDay(startTime, endTime, map, sdfDateTime);//根据时间段查询数据
+        if(map.get("saleMakeDate")!=null){
+            DataChange.queryDataByDateTime(startTime, endTime, map, sdfDateTime);//根据时间段查询数据
+        }else{
+            DataChange.queryDataByDateTimeYestDay(startTime, endTime, map, sdfDateTime);//根据时间段查询数据
+        }
         if(carrierSsoId != null){
             if(!"null".equals(carrierSsoId) && carrierSsoId != null){
                 map.put("carrierSsoId", carrierSsoId);

+ 59 - 0
src/main/java/com/steerinfo/dil/service/impl/TmstruckLeaveFactoryResultServiceImpl.java

@@ -11,6 +11,7 @@ import com.steerinfo.dil.service.ITmstruckLeaveFactoryResultService;
 import com.steerinfo.dil.util.DataChange;
 import com.steerinfo.dil.util.HTTPRequestUtils;
 import com.steerinfo.dil.util.getRequestUtils;
+import com.steerinfo.dil.util.newFileTool;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Service;
@@ -650,8 +651,37 @@ public class TmstruckLeaveFactoryResultServiceImpl implements ITmstruckLeaveFact
         Map<String,Object> jsonObject = new HashMap<>();
         jsonObject.remove(token);
         jsonObject.putAll(map);
+        //写入文件
+        try{
+            new Thread( new Runnable() {
+                public void run(){
+                    try {
+                        newFileTool.newFile("发送报文:"+chengJiaSendUrl+":"+jsonObject,"城嘉库报文");
+                    } catch (IOException e) {
+                        e.printStackTrace();
+                    }
+                }
+            }).start();
+        }catch (Exception e) {
+            e.printStackTrace();
+        }
         String jsonData = null;
         jsonData = getRequestUtils.doPostAddHeader(chengJiaSendUrl, jsonObject,token);
+        //写入文件
+        try{
+            String finalJsonData = jsonData;
+            new Thread(new Runnable() {
+                public void run(){
+                    try {
+                        newFileTool.newFile("接收报文:"+chengJiaSendUrl+":"+ finalJsonData,"城嘉库报文");
+                    } catch (IOException e) {
+                        e.printStackTrace();
+                    }
+                }
+            }).start();
+        }catch (Exception e) {
+            e.printStackTrace();
+        }
         if(!"null".equals(jsonData)){
             System.out.println(jsonData);
             HashMap hashMap = JSON.parseObject(jsonData, HashMap.class);
@@ -675,11 +705,40 @@ public class TmstruckLeaveFactoryResultServiceImpl implements ITmstruckLeaveFact
         JSONObject jsonObject = new JSONObject();
         jsonObject.putAll(map);
         String jsonData = null;
+        //写入文件
+        try{
+            new Thread( new Runnable() {
+                public void run(){
+                    try {
+                        newFileTool.newFile("发送报文:"+guoYuanUrl+":"+jsonObject.toJSONString(),"果园库报文");
+                    } catch (IOException e) {
+                        e.printStackTrace();
+                    }
+                }
+            }).start();
+        }catch (Exception e) {
+            e.printStackTrace();
+        }
         try {
             jsonData = HTTPRequestUtils.send(guoYuanUrl, jsonObject, "utf-8");
         } catch (IOException e) {
             e.printStackTrace();
         }
+        //写入文件
+        try{
+            String finalJsonData = jsonData;
+            new Thread(new Runnable() {
+                public void run(){
+                    try {
+                        newFileTool.newFile("接收报文:"+guoYuanUrl+":"+ finalJsonData,"果园库报文");
+                    } catch (IOException e) {
+                        e.printStackTrace();
+                    }
+                }
+            }).start();
+        }catch (Exception e) {
+            e.printStackTrace();
+        }
         if(!"null".equals(jsonData)){
             System.out.println(jsonData);
             try{

+ 33 - 6
src/main/resources/com/steerinfo/dil/mapper/StatisticalReportMapper.xml

@@ -2336,7 +2336,11 @@
             END) "materialAcWeight",
         ASM.EAS_PRIMARY_ID "closeEntryId",
         ASM.DELETED "deletedStatus",
-        RC.CONSIGNEE_COMPANY_NAME "consigneeName",
+        (CASE
+        WHEN RC2.CONSIGNEE_COMPANY_NAME IS NOT NULL
+        THEN RC2.CONSIGNEE_COMPANY_NAME
+        ELSE RC.CONSIGNEE_COMPANY_NAME
+        END)  "consigneeName",
         ASOM.SALE_ORDER_MATERIAL_ID "saleOrderMaterialId",
         RS.SHIPPER_NAME "shipperName",
         RCA.CAPACITY_NUMBER "capacityNo",
@@ -2415,6 +2419,7 @@
         BDO.PRICEIDS "priceIds",
         BDO.REMARK "detailsRemark",
         BDO.PHOTO "photo",
+        BDO.DETAILS_ID "detailsId",
         --理重
         ASM.MATERIAL_WEIGHT "materialWeight",
         --收款客户
@@ -2488,20 +2493,29 @@
         ON TAR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
         LEFT JOIN TMStRUCK_RECEIPT_RESULT TRR
         ON TTR.RESULT_TOTAL_ID = TRR.RESULT_TOTAL_ID
+        LEFT JOIN RMS_CONSIGNEE RC2
+        ON RC2.CONSIGNEE_ID = BDO.CONSIGNEE_ID
         WHERE ASO.SALE_TYPE = 1
         and (aso.DELETED between 1 and 2 and aso.SALE_ORDER_STATUS = 4 or aso.DELETED = 0 and aso.SALE_ORDER_STATUS between 0 and 4)
         and ASM.SALE_MATERIAL_ID IS NOT NULL
         and (BDO.WETHER_TO_STATEMENT IS NULL or BDO.WETHER_TO_STATEMENT != 1)
-        <if test="oneDate != null">
+        <if test="oneDate != null and saleMakeDate == null">
             and to_date(#{oneDate}, 'yyyy-mm-dd') &lt; = to_date(to_char(ASOM.SALE_DATE_OF_RECEIPT-1,'yyyy-mm-dd'),'yyyy-mm-dd')
         </if>
         <if test="carrierSsoId != null">
             and R_CARRIER.CARRIER_SSO_ID = #{carrierSsoId}
         </if>
-        <if test="startDate != null">
+        <if test="startDate != null and saleMakeDate == null">
             and to_date(#{startDate}, 'yyyy-mm-dd') &lt;=  to_date(to_char(ASOM.SALE_DATE_OF_RECEIPT-1,'yyyy-mm-dd'),'yyyy-mm-dd')
             and to_date(#{endDate}, 'yyyy-mm-dd') >=  to_date(to_char(ASOM.SALE_DATE_OF_RECEIPT-1,'yyyy-mm-dd'),'yyyy-mm-dd')
         </if>
+        <if test="oneDate != null and saleMakeDate != null">
+            and to_date(#{oneDate}, 'yyyy-mm-dd') = to_date(to_char(ASM.SALE_MAKE_DATE,'yyyy-mm-dd'),'yyyy-mm-dd')
+        </if>
+        <if test="startDate != null and saleMakeDate != null">
+            and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;=  ASM.SALE_MAKE_DATE
+            and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >=  ASM.SALE_MAKE_DATE
+        </if>
         <if test="remark != null" >
             and RSR.SALER_NAME || RCA.CAPACITY_NUMBER || RC.CONSIGNEE_COMPANY_NAME || R_CARRIER.CARRIER_ABBREVIATION || RM.MATERIAL_NAME || RM.MATERIAL_MODEL || RM.MATERIAL_SPECIFICATION
             || (CASE WHEN RRA_HISTORY.ADDRESS_PROVINCE is not null
@@ -2658,7 +2672,11 @@
         END) "materialAcWeight",
         ASM.EAS_PRIMARY_ID "closeEntryId",
         ASM.DELETED "deletedStatus",
-        RC.CONSIGNEE_COMPANY_NAME "consigneeName",
+        (CASE
+        WHEN RC2.CONSIGNEE_COMPANY_NAME IS NOT NULL
+        THEN RC2.CONSIGNEE_COMPANY_NAME
+        ELSE RC.CONSIGNEE_COMPANY_NAME
+        END)  "consigneeName",
         ASOM.SALE_ORDER_MATERIAL_ID "saleOrderMaterialId",
         RS.SHIPPER_NAME "shipperName",
         RCA.CAPACITY_NUMBER "capacityNo",
@@ -2810,21 +2828,30 @@
         ON TAR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
         LEFT JOIN TMStRUCK_RECEIPT_RESULT TRR
         ON TTR.RESULT_TOTAL_ID = TRR.RESULT_TOTAL_ID
+        LEFT JOIN RMS_CONSIGNEE RC2
+        ON RC2.CONSIGNEE_ID = BDO.CONSIGNEE_ID
         WHERE ASO.SALE_TYPE = 1
         and (aso.DELETED between 1 and 2 and aso.SALE_ORDER_STATUS = 4 or aso.DELETED = 0 and aso.SALE_ORDER_STATUS between 0 and 4)
         and ASM.SALE_MATERIAL_ID IS NOT NULL
         and BDO.WETHER_TO_STATEMENT = 1
         and BDO.STATEMENT_ID IS NULL
-        <if test="oneDate != null">
+        <if test="oneDate != null  and saleMakeDate == null">
             and to_date(#{oneDate}, 'yyyy-mm-dd') &lt; = to_date(to_char(ASOM.SALE_DATE_OF_RECEIPT-1,'yyyy-mm-dd'),'yyyy-mm-dd')
         </if>
         <if test="carrierSsoId != null">
             and R_CARRIER.CARRIER_SSO_ID = #{carrierSsoId}
         </if>
-        <if test="startDate != null">
+        <if test="startDate != null  and saleMakeDate == null">
             and to_date(#{startDate}, 'yyyy-mm-dd') &lt;=  to_date(to_char(ASOM.SALE_DATE_OF_RECEIPT-1,'yyyy-mm-dd'),'yyyy-mm-dd')
             and to_date(#{endDate}, 'yyyy-mm-dd') >=  to_date(to_char(ASOM.SALE_DATE_OF_RECEIPT-1,'yyyy-mm-dd'),'yyyy-mm-dd')
         </if>
+        <if test="oneDate != null and saleMakeDate != null">
+            and to_date(#{oneDate}, 'yyyy-mm-dd') = to_date(to_char(ASM.SALE_MAKE_DATE,'yyyy-mm-dd'),'yyyy-mm-dd')
+        </if>
+        <if test="startDate != null and saleMakeDate != null">
+            and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;=  ASM.SALE_MAKE_DATE
+            and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >=  ASM.SALE_MAKE_DATE
+        </if>
         <if test="remark != null" >
             and RSR.SALER_NAME || RCA.CAPACITY_NUMBER || RC.CONSIGNEE_COMPANY_NAME || R_CARRIER.CARRIER_ABBREVIATION || RM.MATERIAL_NAME || RM.MATERIAL_MODEL || RM.MATERIAL_SPECIFICATION
             || (CASE WHEN RRA_HISTORY.ADDRESS_PROVINCE is not null