zx il y a 3 ans
Parent
commit
2b9877be93

+ 14 - 0
src/main/java/com/steerinfo/dil/controller/BackgroundProcessingController.java

@@ -8,10 +8,12 @@ import com.steerinfo.framework.controller.RESTfulResult;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
 import java.util.List;
+import java.util.Map;
 
 /*
  * 后台处理程序
@@ -37,4 +39,16 @@ public class BackgroundProcessingController extends BaseRESTfulController {
         }
         return success("关闭成功");
     }
+
+    @ApiOperation(value = "更改所属厂区方法")
+    @PostMapping("/updatePurOrgId")
+    public RESTfulResult updatePurOrgId(@RequestBody(required = false) Map<String, Object> map){
+        return success(backgroundProcessingService.updatePurOrgId(map));
+    }
+
+    @ApiOperation(value = "删除没用的表实绩 ")
+    @PostMapping("/deleteErrorResult")
+    public RESTfulResult deleteErrorResult(String orderNumber){
+        return success(backgroundProcessingService.deleteErrorResult(orderNumber));
+    }
 }

+ 4 - 1
src/main/java/com/steerinfo/dil/controller/OMSController.java

@@ -307,9 +307,12 @@ public class OMSController {
                                                    String con,
                                                    String carrierSsoId,
                                                    Integer shipperId
+
     )
+
     {
-        return omsFeign.getDriverInfoForSale(mapValue==null?new HashMap<>():mapValue, apiId, pageNum, pageSize,orderStatus, con);
+        return omsFeign.getDriverInfoForSale(mapValue==null?new HashMap<>():mapValue, apiId, pageNum, pageSize,orderType,orderStatus,con,carrierSsoId,shipperId);
+
     }
     @PostMapping("/getDriverInfoForSale1")
     public Map<String,Object> getDriverInfoForSale1(@RequestBody(required=false) Map<String,Object> mapValue,

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

@@ -1106,4 +1106,10 @@ public class RMScontroller {
     public RESTfulResult deleteCapacityCarrier(@RequestBody(required = false) Map<String,Object> map){
         return rmsFeign.deleteCapacityCarrier(map!=null?map:new HashMap<>());
     }
+
+    @ApiOperation("渲染运力修改数据")
+    @PostMapping("/getCapacityInfoById/{id}")
+    public Map<String, Object> getCapacityInfoById(@PathVariable("id") Integer id){
+        return rmsFeign.getCapacityInfoById(id);
+    }
 }

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

@@ -152,7 +152,8 @@ public class UniversalController extends BaseRESTfulController {
                                         Integer pageSize,
                                         String carrierSsoId,
                                         String index,
-                                        String con
+                                        String con,
+                                        String indexText
     ){
         if(mapValue == null){
             mapValue = new HashMap<>();
@@ -163,6 +164,10 @@ public class UniversalController extends BaseRESTfulController {
         if (con != null&& !con.equals("undefined")){
             mapValue.put("con",con);
         }
+        if (indexText != null&& !indexText.equals("undefined")){
+            mapValue.put("indexText",indexText);
+        }
+
         if (carrierSsoId != null && carrierSsoId.equals("undefined")) {
             carrierSsoId = null;
         }

+ 6 - 5
src/main/java/com/steerinfo/dil/feign/OmsFeign.java

@@ -134,11 +134,12 @@ public interface OmsFeign {
                                             @RequestParam("apiId") Integer apiId,
                                             @RequestParam("pageNum") Integer pageNum,
                                             @RequestParam("pageSize") Integer pageSize,
-                                            Integer orderType,
-                                            Integer orderStatus,
-                                            String con,
-                                            String carrierSsoId,
-                                            Integer shipperId
+                                            @RequestParam("orderType") Integer orderType,
+                                            @RequestParam("orderStatus") Integer orderStatus,
+                                            @RequestParam("con") String con,
+                                            @RequestParam("carrierSsoId") String carrierSsoId,
+                                            @RequestParam("shipperId") Integer shipperId
+
     );
 
 

+ 3 - 0
src/main/java/com/steerinfo/dil/feign/RmsFeign.java

@@ -605,4 +605,7 @@ public interface RmsFeign {
     @ApiOperation("解除承运商和车辆的绑定关系")
     @PostMapping("api/v1/rms/rmscapacity/deleteCapacityCarrier")
     public RESTfulResult deleteCapacityCarrier(@RequestBody(required = false) Map<String,Object> map);
+
+    @PostMapping("api/v1/rms/rmscapacity/getCapacityInfoById/{id}")
+    Map<String,Object> getCapacityInfoById(@PathVariable("id") Integer id);
 }

+ 6 - 2
src/main/java/com/steerinfo/dil/mapper/BackgroundProcessingMapper.java

@@ -2,6 +2,7 @@ package com.steerinfo.dil.mapper;
 
 import org.mapstruct.Mapper;
 
+import java.math.BigDecimal;
 import java.util.Map;
 
 @Mapper
@@ -9,8 +10,11 @@ public interface BackgroundProcessingMapper {
     //通过采购订单号关闭一车多趟
     int closePurOrderMoreTrips(String purchaseOrderNo);
 
-    int updatePurOrgId(Integer orderId);
+    Integer getOrderType(Map<String, Object> map);
 
-    Integer getOrderType(Integer orderId);
+    int updatePurOrderOrgId(Map<String, Object> map);
 
+    Map<String, Object> getOrderMesByOrderNum(String orderNumber);
+
+    Map<String, Object> getEnFactoryResult(BigDecimal resultTotalId);
 }

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

@@ -1,5 +1,9 @@
 package com.steerinfo.dil.service;
 
+import java.util.Map;
+
 public interface IBackgroundProcessService {
-    int updatePurOrgId(Integer orderId);
+
+    int updatePurOrgId(Map<String, Object> map);
+
 }

+ 33 - 7
src/main/java/com/steerinfo/dil/service/impl/BackgroundProcessingServiceImpl.java

@@ -1,23 +1,49 @@
 package com.steerinfo.dil.service.impl;
 
 import com.steerinfo.dil.mapper.BackgroundProcessingMapper;
+import com.steerinfo.dil.mapper.UniversalMapper;
 import com.steerinfo.dil.service.IBackgroundProcessService;
+import com.steerinfo.dil.util.DataChange;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
 @Service(value = "backgroundProcessingService")
 public class BackgroundProcessingServiceImpl implements IBackgroundProcessService {
 
     @Autowired
-    BackgroundProcessingMapper backgroundProcessingMapper;
+    private BackgroundProcessingMapper backgroundProcessingMapper;
+
 
+    /**
+     * 更新订单所属厂区
+     * @param map
+     * @return
+     */
     @Override
-    public  int updatePurOrgId(Integer orderId) {
-        //获取订单类型
-        Integer orderType = backgroundProcessingMapper.getOrderType(orderId);
-        if(orderType == 10 || orderType == 20){
-            backgroundProcessingMapper.updatePurOrgId(orderId);
+    public int updatePurOrgId(Map<String, Object> map) {
+        return backgroundProcessingMapper.updatePurOrderOrgId(map);
+    }
+
+    /**
+     * 删除重复实绩
+     * @param orderNumber
+     * @return
+     */
+    public int deleteErrorResult(String orderNumber) {
+        Map<String, Object> orderMes = backgroundProcessingMapper.getOrderMesByOrderNum(orderNumber);
+        int orderType = DataChange.dataToBigDecimal(orderMes.get("orderType")).intValue();
+        List<Integer> arrayList = Arrays.asList(11, 15, 16, 21); //没有固定路线不支持此操作
+        if(arrayList.contains(orderType)){
+            return 0;
         }
-        return 1;
+        BigDecimal resultTotalId = DataChange.dataToBigDecimal(orderMes.get("resultTotalId"));
+
+        return 0;
     }
 }

+ 21 - 3
src/main/resources/com/steerinfo/dil/mapper/BackgroundProcessingMapper.xml

@@ -9,12 +9,30 @@
     </update>
 
     <update id="updatePurOrderOrgId" parameterType="java.util.Map">
-
-    </update>
-    <update id="updatePurOrgId">
+        update AMS_PURCHASE_ORDER APO
+        set APO.PURCHASING_ORGANIZATION_ID = #{orgId}
+        where APO.PURCHASE_ORDER_NO = #{purchaseOrderNo}
     </update>
+
     <select id="getOrderType" resultType="java.lang.Integer" parameterType="java.lang.Integer">
         select OO.ORDER_TYPE from OMSTRUCK_ORDER OO
         where oo.ORDER_ID = #{orderId}
     </select>
+
+    <select id="getOrderMesByOrderNum" resultType="java.util.Map">
+        select OO.ORDER_ID  "orderId",
+               OO.ORDER_TYPE    "orderType",
+               TTR.RESULT_TOTAL_ID  "resultTotalId"
+        from OMSTRUCK_ORDER OO
+                 left join TMSTRUCK_TOTAL_RESULT TTR on OO.ORDER_ID = TTR.ORDER_ID
+        where OO.ORDER_NUMBER = #{orderNumber}
+    </select>
+
+    <select id="getEnFactoryResult" resultType="java.util.Map">
+        select TER.RESULT_ID    "resultId",
+               TER.SEGMEN_SQE   "segmentSqe",
+               TER.RESULT_ENTRY_GATE_TIME   "resultEntryGateTime"
+        from TMSTRUCK_ENFACTORY_RESULT TER
+        where TER.RESULT_TOTAL_ID = #{resultTotalId}
+    </select>
 </mapper>

+ 17 - 16
src/main/resources/com/steerinfo/dil/mapper/UniversalMapper.xml

@@ -149,18 +149,18 @@
     <select id="getAllCapacityByCarrierLike" parameterType="java.util.Map" resultType="java.util.LinkedHashMap">
         SELECT *
         FROM (
-                 SELECT
-                        RC.CAPACITY_ID        "capacityId",
-                        RCC.CARRIER_ID         "carrierId",
-                        RC.CAPACITY_NUMBER     "capacityNumber",
-                        RCA.CARRIER_NAME       "carrierName",
-                        RC.INSERT_UPDATE_REMARK "remark"
-                 FROM RMS_CAPACITY_CARRIER RCC
-                            LEFT JOIN RMS_CAPACITY RC
-                     ON RCC.CAPACITY_ID = RC.CAPACITY_ID
-                          JOIN RMS_CARRIER RCA
-                                ON RCA.CARRIER_ID = RCC.CARRIER_ID
-                 WHERE RC.CAPACITY_SSO_ID is not NULL
+        SELECT
+        RC.CAPACITY_ID "capacityId",
+        RCC.CARRIER_ID "carrierId",
+        RCC.CAPACITY_CARRIER_ID,
+        RC.CAPACITY_NUMBER "capacityNumber",
+        RCA.CARRIER_NAME "carrierName",
+        RCC.INSERT_UPDATE_REMARK "remark"
+        FROM
+        RMS_CAPACITY_CARRIER RCC
+        LEFT JOIN RMS_CAPACITY RC ON RCC.CAPACITY_ID = RC.CAPACITY_ID
+        JOIN RMS_CARRIER RCA ON RCA.CARRIER_ID = RCC.CARRIER_ID
+        WHERE RC.CAPACITY_SSO_ID is not NULL
             <if test="carrierId != null" >
                 and RCC.CARRIER_ID = #{carrierId}
             </if>
@@ -168,7 +168,10 @@
                 and (instr(RC.CAPACITY_NUMBER, #{index}) > 0 or instr(RCA.CARRIER_NAME, #{index}) > 0 or  instr(RC.INSERT_UPDATE_REMARK, #{index})>0)
             </if>
             <if test="con != null">
-                and instr(RC.INSERT_UPDATE_REMARK, #{con}) > 0
+                and instr(RCA.INSERT_UPDATE_REMARK, #{con}) > 0
+            </if>
+            <if test="indexText!=null">
+                and instr(RCC.CAPACITY_USER_DEP, #{indexText}) > 0
             </if>
         )
         <where>
@@ -691,10 +694,8 @@
                         CONCAT(DB.RESULT_FOREIGN_SHIP_NAME, '"' || RM.MATERIAL_NAME || '"') "value"
                  from DIL_BATCH DB
                           left join RMS_MATERIAL RM on RM.MATERIAL_ID = DB.MATERIAL_ID
+                          join AMS_PURCHASE_ORDER APO on APO.BATCH_ID = DB.BATCH_ID
                  where DB.RESULT_FOREIGN_SHIP_NAME is not null
-                <if test="materialId != null">
-                    and DB.MATERIAL_ID = #{materialId}
-                </if>
              )
         where instr("foreignShipName", #{index}) > 0