ソースを参照

Merge branch 'master' into dev

txf 3 年 前
コミット
da30a191b4

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

@@ -4,6 +4,7 @@ import com.steerinfo.dil.feign.ESFeign;
 import com.steerinfo.dil.service.ITmstruckEnfactoryResultService;
 import com.steerinfo.dil.util.BaseRESTfulController;
 import com.steerinfo.dil.util.ColumnDataUtil;
+import com.steerinfo.dil.util.DataChange;
 import com.steerinfo.dil.util.PageListAdd;
 import com.steerinfo.framework.controller.RESTfulResult;
 import com.steerinfo.framework.service.pagehelper.PageHelper;
@@ -13,6 +14,7 @@ import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
+import java.text.SimpleDateFormat;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -42,7 +44,7 @@ public class TmstruckEnfactoryResultController extends BaseRESTfulController {
 
     @Autowired
     ColumnDataUtil columnDataUtil;
-
+    private final SimpleDateFormat sdfDateTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
     @ApiOperation(value="查询所有的进厂实绩")
     @ApiImplicitParams({
             @ApiImplicitParam(name = "mapValue", value = "表头和参数", required = false, dataType = "map"),
@@ -57,14 +59,12 @@ public class TmstruckEnfactoryResultController extends BaseRESTfulController {
                                        Integer pageNum,
                                        Integer pageSize,
                                        Integer orderType,
-                                       String con,
+                                       String startTime,
+                                       String endTime,
                                        String userId,
                                        String userIds
                                        ){
-
-        if(con!=null&&con.equals("undefined")){
-            mapValue.put("con","%"+con+"%");
-        }
+        DataChange.queryDataByDateTime(startTime, endTime, mapValue, sdfDateTime);//根据时间段查询数据
         if (userId!=null){
             mapValue.put("userId",userId);
         }

+ 8 - 1
src/main/java/com/steerinfo/dil/controller/TmstruckLeaveFactoryResultController.java

@@ -5,6 +5,7 @@ import com.steerinfo.dil.model.TmstruckLeaveFactoryResult;
 import com.steerinfo.dil.service.ITmstruckLeaveFactoryResultService;
 import com.steerinfo.dil.util.BaseRESTfulController;
 import com.steerinfo.dil.util.ColumnDataUtil;
+import com.steerinfo.dil.util.DataChange;
 import com.steerinfo.dil.util.PageListAdd;
 import com.steerinfo.framework.controller.RESTfulResult;
 import com.steerinfo.framework.service.pagehelper.PageHelper;
@@ -18,6 +19,7 @@ import org.springframework.web.bind.annotation.*;
 
 import java.io.File;
 import java.math.BigDecimal;
+import java.text.SimpleDateFormat;
 import java.util.Arrays;
 import java.util.HashMap;
 import java.util.List;
@@ -50,6 +52,8 @@ public class TmstruckLeaveFactoryResultController extends BaseRESTfulController
     @Autowired
     ColumnDataUtil columnDataUtil;
 
+    private final SimpleDateFormat sdfDateTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+
     @ApiOperation(value="新增汽车出厂实绩:oms远程调用")
     @ApiImplicitParams({
             @ApiImplicitParam(name = "mapValue", value = "总实绩ID、线路终点", required = false, dataType = "Map"),
@@ -77,7 +81,9 @@ public class TmstruckLeaveFactoryResultController extends BaseRESTfulController
                                                String con,
                                                String carrierSsoId,
                                                String userId,
-                                               String userIds){
+                                               String userIds,
+                                               String startTime,
+                                               String endTime){
 
         if (userId!=null){
             mapValue.put("userId",userId);
@@ -96,6 +102,7 @@ public class TmstruckLeaveFactoryResultController extends BaseRESTfulController
         if(con!=null&&con.equals("undefined")){
             mapValue.put("con","%"+con+"%");
         }
+        DataChange.queryDataByDateTime(startTime,endTime,mapValue,sdfDateTime);
         PageHelper.startPage(pageNum,pageSize);
         //分页数据
         List<Map<String, Object>> leaveFactoryResult = tmstruckLeaveFactoryResultService.getLeaveFactoryResult(mapValue);

+ 9 - 1
src/main/java/com/steerinfo/dil/controller/TmstruckMeasureCommissionController.java

@@ -76,5 +76,13 @@ public class TmstruckMeasureCommissionController extends BaseRESTfulController {
         return success("委托发送成功");
     }
 
-
+    @ApiOperation(value="发送留皮计量委托(neizhuan)")
+    @GetMapping("/sendLiuPiMeasureCommission")
+    public RESTfulResult sendLiuPiMeasureCommission(String capacityNumber){
+        String str = tmstruckMeasureCommissionService.sendLiuPiMeasureCommission(capacityNumber);
+        if("no".equals(str)){
+            return failed("发送失败!请联系管理员");
+        }
+        return success(str);
+    }
 }

+ 1 - 0
src/main/java/com/steerinfo/dil/service/ITmstruckMeasureCommissionService.java

@@ -31,4 +31,5 @@ public interface ITmstruckMeasureCommissionService{
     //发送计量委托
     int sendMeasureCommssion(Map<String,Object> map);
 
+    String sendLiuPiMeasureCommission(String capacityNumber);
 }

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

@@ -309,15 +309,11 @@ public class TmstruckLoadResultServiceImpl implements ITmstruckLoadResultService
         //判断是否为未装货
         if (map.get("insertUpdateRemark")!=null) {
             String insertUpdateRemark = (String) map.get("insertUpdateRemark");
-            if("未装货".equals(insertUpdateRemark)){
+            if("未装货".equals(insertUpdateRemark) && orderType.intValue() != 11){
                 loadJudge(orderMap);
             }
             tmstruckLoadResult.setInsertUpdateRemark(insertUpdateRemark);
         }
-
-//        if (j == 0) {
-//            throw new Exception("第二次委托发送失败");
-//        }
         tmstruckLoadResult.setCaseNumber((String) map.get("caseNumber"));
         i += tmstruckLoadResultMapper.updateByPrimaryKeySelective(tmstruckLoadResult);
         //推送消息到websocket

+ 59 - 7
src/main/java/com/steerinfo/dil/service/impl/TmstruckMeasureCommissionServiceImpl.java

@@ -45,6 +45,8 @@ public class TmstruckMeasureCommissionServiceImpl implements ITmstruckMeasureCom
 
     private static final  String daGangUrl = "http://172.16.33.122:44325/api/logistics/TareApplyFor";
 
+    private static final String liuPiUrl = "http://172.16.33.122:44325/api/logistics/updateTareWeight";
+
     private static final String daXingUrl = "http://172.16.59.251:8121/daXingWeight/OrderBusiness/addOrder.do";
 
     //给达钢发送委托
@@ -233,11 +235,7 @@ public class TmstruckMeasureCommissionServiceImpl implements ITmstruckMeasureCom
                 if(measureCommission == null){
                     return 0;
                 }
-                if(orderType == 6){
-                    measureCommission.put("isRelationEAS", false);
-                }else {
-                    measureCommission.put("isRelationEAS", true);
-                }
+                measureCommission.put("isRelationEAS", true);
                 measureCommission.put("flowTo", "进厂");
                 measureCommission.put("isDel", false);
                 measureCommission.put("isInsert", true);
@@ -325,8 +323,7 @@ public class TmstruckMeasureCommissionServiceImpl implements ITmstruckMeasureCom
         if(measureCommission != null)
             map.put("materialId", measureCommission.get("materialId"));
         addMeasureCommission(map); // 添加计量委托
-//        System.out.println(measureCommission);
-//        return 1;
+
         /*访问接口发送数据*/
         return sendMesToMeasure(measureCommission);
 
@@ -543,4 +540,59 @@ public class TmstruckMeasureCommissionServiceImpl implements ITmstruckMeasureCom
         return i;
     }
 
+    /**
+     * 发送留皮委托
+     * @Author TXF
+     * @Date 2022/3/8 14:35
+     * @param capacityNumber
+     * @return
+     **/
+    @Override
+    synchronized public String sendLiuPiMeasureCommission(String capacityNumber) {
+        Map<String, Object> map = new HashMap<>();
+        String num = "LP" + System.currentTimeMillis();
+        map.put("carNumber", capacityNumber);
+        map.put("purchOrder", num);
+        int i = sendMesToMeasure2(map, liuPiUrl);
+        if(i != 1){
+            return "no";
+        }
+        // 设置单线程避免因网络问题同一时间高并发导致时间戳重复  (访问接口需要时间 也可能不需要)
+        try {
+            Thread.sleep(1);
+        } catch (InterruptedException e) {
+            e.printStackTrace();
+        }
+        return num;
+    }
+
+    /**
+     * 上面方法儿子方法
+     * @Author TXF
+     * @Date 2022/3/8 16:19
+     * @param map
+     * @param url
+     * @return
+     **/
+    public int sendMesToMeasure2(Map<String, Object> map, String url){
+        JSONObject jsonObject = new JSONObject(map);
+        String jsonData = null;
+        try {
+            jsonData = HTTPRequestUtils.send(url, jsonObject, "utf-8");
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+        if(!"null".equals(jsonData)){
+            System.out.println(jsonData);
+            HashMap hashMap = JSON.parseObject(jsonData, HashMap.class);
+            boolean success = (boolean) hashMap.get("success");
+            System.out.println(hashMap.get("msg"));
+            if(success){
+                return 1;
+            }
+        }else{
+            System.out.println("委托发送失败:" + jsonData);
+        }
+        return 0;
+    }
 }

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

@@ -497,6 +497,13 @@
         left join RMS_GATEPOST RG
         on RG.GATEPOST_ID = TER.GATEPOST_ID
         where TER.RESULT_ENTRY_GATE_TIME is not null and OO.ORDER_TYPE = #{orderTypee}
+        <if test="oneDate != null">
+            and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= TER.RESULT_ENTRY_GATE_TIME
+        </if>
+        <if test="startDate != null">
+            and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= TER.RESULT_ENTRY_GATE_TIME
+            and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= TER.RESULT_ENTRY_GATE_TIME
+        </if>
         )
         <where>
             <if test="purchaseOrderId != null">
@@ -589,6 +596,13 @@
         left join RMS_GATEPOST RG
         on RG.GATEPOST_ID = TER.GATEPOST_ID
         where TER.RESULT_ENTRY_GATE_TIME is not null and OO.ORDER_TYPE = 4
+        <if test="oneDate != null">
+            and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= TER.RESULT_ENTRY_GATE_TIME
+        </if>
+        <if test="startDate != null">
+            and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= TER.RESULT_ENTRY_GATE_TIME
+            and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= TER.RESULT_ENTRY_GATE_TIME
+        </if>
         )
         <where>
             <if test="materialName != null">
@@ -727,6 +741,13 @@
         LEFT JOIN RMS_CONSIGNEE RCON
         ON RCON.CONSIGNEE_ID = ASO.RECEIVE_ID
         WHERE TER.RESULT_ENTRY_GATE_TIME IS NOT NULL
+        <if test="oneDate != null">
+            and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= TER.RESULT_ENTRY_GATE_TIME
+        </if>
+        <if test="startDate != null">
+            and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= TER.RESULT_ENTRY_GATE_TIME
+            and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= TER.RESULT_ENTRY_GATE_TIME
+        </if>
               AND OO.ORDER_TYPE IN (1, 2, 3)
         )
         <where>
@@ -854,6 +875,13 @@
                                     ON RC.CAPACITY_ID = OO.CAPACITY_ID
                  WHERE OO.ORDER_TYPE = 4
                    AND TER.RESULT_ENTRY_GATE_TIME IS NOT NULL
+        <if test="oneDate != null">
+            and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= TER.RESULT_ENTRY_GATE_TIME
+        </if>
+        <if test="startDate != null">
+            and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= TER.RESULT_ENTRY_GATE_TIME
+            and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= TER.RESULT_ENTRY_GATE_TIME
+        </if>
              )
         <where>
             <if test="dayplanNo != null">
@@ -947,6 +975,13 @@
                                     on RG.GATEPOST_ID = TER.GATEPOST_ID
                  where TER.RESULT_ENTRY_GATE_TIME is not null
                    and OO.ORDER_TYPE = 9
+        <if test="oneDate != null">
+            and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= TER.RESULT_ENTRY_GATE_TIME
+        </if>
+        <if test="startDate != null">
+            and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= TER.RESULT_ENTRY_GATE_TIME
+            and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= TER.RESULT_ENTRY_GATE_TIME
+        </if>
              )
         <where>
             <if test="purchaseOrderId != null">
@@ -1043,6 +1078,13 @@
         on RG.GATEPOST_ID = TER.GATEPOST_ID
         where TER.RESULT_ENTRY_GATE_TIME is not null
         and OO.ORDER_TYPE = 11
+        <if test="oneDate != null">
+            and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= TER.RESULT_ENTRY_GATE_TIME
+        </if>
+        <if test="startDate != null">
+            and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= TER.RESULT_ENTRY_GATE_TIME
+            and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= TER.RESULT_ENTRY_GATE_TIME
+        </if>
         )
         <where>
             <if test="materialName != null">
@@ -1192,6 +1234,13 @@
         left join RMS_CAPACITY RC
         on RC.CAPACITY_ID = OO.CAPACITY_ID
         WHERE OO.ORDER_TYPE = #{orderTypee} and TER.RESULT_ENTRY_GATE_TIME IS NOT NULL
+            <if test="oneDate != null">
+                and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= TER.RESULT_ENTRY_GATE_TIME
+            </if>
+            <if test="startDate != null">
+                and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= TER.RESULT_ENTRY_GATE_TIME
+                and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= TER.RESULT_ENTRY_GATE_TIME
+            </if>
             <if test="userId!=null">
                and ASO.INSERT_USERNAME=#{userId}
             </if>
@@ -1284,6 +1333,13 @@
         <if test="userId">
             and air.INSERT_USERNAME=#{userId}
         </if>
+        <if test="oneDate != null">
+            and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= TER.RESULT_ENTRY_GATE_TIME
+        </if>
+        <if test="startDate != null">
+            and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= TER.RESULT_ENTRY_GATE_TIME
+            and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= TER.RESULT_ENTRY_GATE_TIME
+        </if>
         )
         <where>
             <if test="purchaseOrderId != null">
@@ -1380,6 +1436,13 @@
    <if test="userId !=null">
       and AIR.INSERT_USERNAME = #{userId}
    </if>
+        <if test="oneDate != null">
+            and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= TLFR.RESULT_OUT_GATE_TIME
+        </if>
+        <if test="startDate != null">
+            and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= TLFR.RESULT_OUT_GATE_TIME
+            and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= TLFR.RESULT_OUT_GATE_TIME
+        </if>
     order by tlfr.result_out_gate_time desc
         <where>
             <if test="capacityNumber != null">

+ 42 - 0
src/main/resources/com/steerinfo/dil/mapper/TmstruckLeaveFactoryResultMapper.xml

@@ -501,6 +501,13 @@
             <if test="carrierSsoId != null">
                 and RCA.CARRIER_SSO_ID = #{carrierSsoId}
             </if>
+            <if test="oneDate != null">
+              and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= TLFR.RESULT_OUT_GATE_TIME
+            </if>
+            <if test="startDate != null">
+              and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= TLFR.RESULT_OUT_GATE_TIME
+              and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= TLFR.RESULT_OUT_GATE_TIME
+           </if>
         )
         <where>
             <if test="purchaseOrderNo != null">
@@ -641,6 +648,13 @@
         ON RCON.CONSIGNEE_ID = ASO.RECEIVE_ID
         WHERE TLFR.RESULT_OUT_GATE_TIME IS NOT NULL
         AND OO.ORDER_TYPE IN (1, 2, 3)
+        <if test="oneDate != null">
+            and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= TLFR.RESULT_OUT_GATE_TIME
+        </if>
+        <if test="startDate != null">
+            and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= TLFR.RESULT_OUT_GATE_TIME
+            and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= TLFR.RESULT_OUT_GATE_TIME
+        </if>
         )
         <where>
             <if test="saleNum != null">
@@ -799,6 +813,13 @@
                                     ON RG.GATEPOST_ID = TLFR.GATEPOST_ID
                  WHERE OO.ORDER_TYPE = 4
                    AND TLFR.RESULT_OUT_GATE_TIME IS NOT NULL
+        <if test="oneDate != null">
+            and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= TLFR.RESULT_OUT_GATE_TIME
+        </if>
+        <if test="startDate != null">
+            and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= TLFR.RESULT_OUT_GATE_TIME
+            and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= TLFR.RESULT_OUT_GATE_TIME
+        </if>
              )
         <where>
             <if test="dayplanNo != null">
@@ -880,6 +901,13 @@
 
                  where RESULT_OUT_GATE_TIME is not null
                    and OO.ORDER_TYPE = 9
+        <if test="oneDate != null">
+            and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= TLFR.RESULT_OUT_GATE_TIME
+        </if>
+        <if test="startDate != null">
+            and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= TLFR.RESULT_OUT_GATE_TIME
+            and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= TLFR.RESULT_OUT_GATE_TIME
+        </if>
              )
         <where>
             <if test="purchaseOrderNo != null">
@@ -961,6 +989,13 @@
         on RG.GATEPOST_ID = TLFR.GATEPOST_ID
         where RESULT_OUT_GATE_TIME is not null
         and OO.ORDER_TYPE = 11
+        <if test="oneDate != null">
+            and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= TLFR.RESULT_OUT_GATE_TIME
+        </if>
+        <if test="startDate != null">
+            and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= TLFR.RESULT_OUT_GATE_TIME
+            and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= TLFR.RESULT_OUT_GATE_TIME
+        </if>
         )
         <where>
             <if test="orderNumber != null">
@@ -1129,6 +1164,13 @@
                 where "orderNumber" like #{con} or "capacityNumber" like #{con}
                 or "gatepostName" like #{con}  or  "materialName" like #{con}
             </if>
+        <if test="oneDate != null">
+            and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= TLFR.RESULT_OUT_GATE_TIME
+        </if>
+        <if test="startDate != null">
+            and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= TLFR.RESULT_OUT_GATE_TIME
+            and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= TLFR.RESULT_OUT_GATE_TIME
+        </if>
         )
         <where>
             <if test="orderNumber != null">