Redeem 2 gadi atpakaļ
vecāks
revīzija
021632c51e

+ 2 - 0
src/main/java/com/steerinfo/dil/controller/AMScontroller.java

@@ -598,4 +598,6 @@ public class AMScontroller {
     ) {
         return amsFeign.getproductionRequirementworkflowList(map == null ? new HashMap<>() : map, apiId, pageNum, pageSize);
     }
+
+
 }

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

@@ -33,14 +33,6 @@ public class BackgroundProcessingController extends BaseRESTfulController {
     @Autowired
     private BackgroundProcessingMapper backgroundProcessingMapper;
 
-    @Autowired
-    private BackgroundProcessingServiceImpl backgroundProcessingService;
-
-    @Autowired
-    private OmstruckOrderMapper omstruckOrderMapper;
-
-    @Autowired
-    private UniversalMapper universalMapper;
 
     @Resource
     SSOUtil ssoUtil;
@@ -54,9 +46,9 @@ public class BackgroundProcessingController extends BaseRESTfulController {
             Map<String, Object> userInfo = (Map<String, Object>) dataMap.get("user");
             // 根据用户名去查询该用户绑定的公司及下属公司
             List<Map<String, Object>> companyList = backgroundProcessingMapper.getCompanyList(loginName);
-            List<Map<String,Object>> currentCompanyList = backgroundProcessingMapper.getCurrentCompanyList(loginName);
+            //List<Map<String,Object>> currentCompanyList = backgroundProcessingMapper.getCurrentCompanyList(loginName);
             userInfo.put("dilCompanyList", companyList);
-            userInfo.put("currentCompanyList",currentCompanyList);
+            //userInfo.put("currentCompanyList",currentCompanyList);
             // 根据查询到的公司ID
             //System.out.println(userInfo);
             //// 获取机构

+ 23 - 0
src/main/java/com/steerinfo/dil/controller/TMSController.java

@@ -104,6 +104,22 @@ public class TMSController extends BaseRESTfulController {
         return tmsFeign.dispatchOrder(map);
     }
 
+    @ApiOperation(value = "批量派发运输订单")
+    @ApiImplicitParam(name = "map", value = "JSON格式数据", required = true, dataType = "Map<String, Object>")
+    @PostMapping(value = "/batchDispatch")
+    @LogAround(foreignKeys = {"transOrderId"}, foreignKeyTypes = {"运输订单"})
+    public Map<String, Object> batchDispatch(@RequestBody(required = false) Map<String, Object> map) {
+        return tmsFeign.batchDispatch(map);
+    }
+
+    @ApiOperation(value = "修改运输订单")
+    @ApiImplicitParam(name = "map", value = "JSON格式数据", required = true, dataType = "Map<String, Object>")
+    @PostMapping(value = "/updateTransOrder")
+    @LogAround(foreignKeys = {"transOrderId"}, foreignKeyTypes = {"运输订单"})
+    public Map<String, Object> updateTransOrder(@RequestBody(required = false) Map<String, Object> map) {
+        return tmsFeign.updateTransOrder(map);
+    }
+
     @ApiOperation(value = "更改运输订单状态")
     @ApiImplicitParam(name = "map", value = "JSON格式数据", required = true, dataType = "Map<String, Object>")
     @PostMapping(value = "/changeTransOrder")
@@ -633,4 +649,11 @@ public class TMSController extends BaseRESTfulController {
                                                        Integer pageSize) {
         return tmsFeign.getDriverTotalResult(map == null ? new HashMap<>() : map, apiId, pageNum, pageSize);
     }
+
+
+    @ApiOperation("生产物流-调度任务新增")
+    @PostMapping("/dispatchTask")
+    Map<String,Object> dispatchTask(@RequestBody Map<String,Object> map) {
+        return tmsFeign.dispatchTask(map);
+    }
 }

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

@@ -103,6 +103,7 @@ public class UniversalController extends BaseRESTfulController {
     @ApiModelProperty(value = "边输边查人员")
     @PostMapping("/getPersonnelByLike")
     public RESTfulResult getPersonnelByLike(@RequestBody(required = false) Map<String,Object> map) {
+        DataChange.getMonthStartEnd(map);
         List<Map<String, Object>> list = universalMapper.getPersonnelByLike(map);
         return success(list);
     }

+ 2 - 0
src/main/java/com/steerinfo/dil/feign/AmsFeign.java

@@ -213,4 +213,6 @@ public interface AmsFeign {
                                                      @RequestParam  Integer pageNum,
                                                      @RequestParam  Integer pageSize);
 
+
+
 }

+ 9 - 0
src/main/java/com/steerinfo/dil/feign/TmsFeign.java

@@ -40,6 +40,12 @@ public interface TmsFeign {
     @PostMapping("api/v1/tms/omstransorders/dispatchOrder")
     Map<String, Object> dispatchOrder(@RequestBody(required = false) Map<String, Object> map);
 
+    @PostMapping("api/v1/tms/omstransorders/batchDispatch")
+    Map<String, Object> batchDispatch(@RequestBody(required = false) Map<String, Object> map);
+
+    @PostMapping("api/v1/tms/omstransorders/updateTransOrder")
+    Map<String, Object> updateTransOrder(@RequestBody(required = false) Map<String, Object> map);
+
     @PostMapping("api/v1/tms/omstransorders/getTransOrderList")
     Map<String, Object> getTransOrderList(@RequestBody(required = false) Map<String, Object> map,
                                           @RequestParam Integer apiId,
@@ -226,6 +232,9 @@ public interface TmsFeign {
                                              @RequestParam Integer pageNum,
                                              @RequestParam Integer pageSize);
 
+    @PostMapping(value = "/api/v1/tms/omstransorders/dispatchTask")
+    Map<String, Object> dispatchTask(@RequestBody Map<String, Object> map);
+
 }
 
 

+ 23 - 0
src/main/java/com/steerinfo/dil/util/DataChange.java

@@ -3,6 +3,7 @@ package com.steerinfo.dil.util;
 import java.math.BigDecimal;
 import java.text.DecimalFormat;
 import java.text.SimpleDateFormat;
+import java.util.Calendar;
 import java.util.Date;
 import java.util.List;
 import java.util.Map;
@@ -266,4 +267,26 @@ public class DataChange {
         map.put("startDate", dayStartTime + " 00:00:00");
         map.put("endDate", dayEndTime + " 00:00:00");
     }
+
+    public static void getMonthStartEnd(Map<String,Object> map) {
+        //
+        Calendar cale = Calendar.getInstance();
+
+        // 获取当月第一天和最后一天
+        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
+        String firstDay, lastDay;
+        // 获取前月的第一天
+        cale.add(Calendar.MONTH, 0);
+        cale.set(Calendar.DAY_OF_MONTH, 1);
+        firstDay = format.format(cale.getTime());
+        // 获取前月的最后一天
+        cale = Calendar.getInstance();
+        cale.add(Calendar.MONTH, 1);
+        cale.set(Calendar.DAY_OF_MONTH, 0);
+        lastDay = format.format(cale.getTime());
+        System.out.println("本月第一天和最后一天分别是 : " + firstDay + " and " + lastDay);
+        map.put("firstDay",firstDay);
+        map.put("lastDay",lastDay);
+
+    }
 }

+ 2 - 1
src/main/resources/com/steerinfo/dil/mapper/BackgroundProcessingMapper.xml

@@ -22,7 +22,8 @@
     <select id="getCompanyList" resultType="java.util.Map">
         SELECT distinct rc.company_id "companyId",
                rc.COMPANY_TYPE "companyType",
-               rc.DELETED "deleted" FROM RMS_COMPANY RC
+               rc.DELETED "deleted",
+               level "level" FROM RMS_COMPANY RC
         START WITH RC.COMPANY_ID IN (
         SELECT RPC.COMPANY_ID FROM RMS_PERSONNEL RP
         LEFT JOIN RMS_PERSONNEL_COMPANY RPC on RP.PERSONNEL_ID = RPC.PERSONNEL_ID

+ 74 - 20
src/main/resources/com/steerinfo/dil/mapper/UniversalMapper.xml

@@ -212,16 +212,18 @@
     </if>
     </select>
     <select id="getPersonnelByLike" resultType="java.util.Map">
+    select * from (
         select * from (
         select
         PERSONNEL_ID "personnelId",
         PERSONNEL_NAME "personnelName",
         PERSONNEL_POST "personnelPost",
+        PERSONNEL_PHONE "personnelPhone",
         PERSONNEL_ID "id",
         PERSONNEL_ID "value",
         PERSONNEL_NAME "label",
         PERSONNEL_NAME "text",
-        'personnelName' "prop"
+        'personnelName' "prop",
         from RMS_PERSONNEL
         where DELETED = 0
         )
@@ -235,14 +237,25 @@
             <if test="index!=null and index!=''">
                 AND REGEXP_LIKE("label", #{index})
             </if>
-           <if test="id!=null and id.size>0 and !(index!=null and index!='')">
-                AND "id" in
-                <foreach collection="id" item="item"  open="(" close=")" separator="," >
-                    #{item}
-                </foreach>
-            </if>
         </where>
         FETCH NEXT 10 ROWS ONLY
+    )
+    <if test="id!=null and id.size>0">
+        UNION
+        select
+        PERSONNEL_ID "personnelId",
+        PERSONNEL_NAME "personnelName",
+        PERSONNEL_POST "personnelPost",
+        PERSONNEL_ID "id",
+        PERSONNEL_ID "value",
+        PERSONNEL_NAME "label",
+        PERSONNEL_NAME "text"
+        from RMS_PERSONNEL
+        WHERE PERSONNEL_ID in
+        <foreach collection="id" item="item"  open="(" close=")" separator="," >
+            #{item}
+        </foreach>
+    </if>
     </select>
     <select id="getCapacityByLike" resultType="java.util.Map">
         select * from (
@@ -268,22 +281,37 @@
             <if test="capacityType == null">
                 AND RCT.CAPACITY_TYPE_NAME != '火车'
             </if>
-        )
-        <where>
             <if test="index!=null and index!=''">
-                AND REGEXP_LIKE("label", #{index})
+                AND REGEXP_LIKE(RCA .CAPACITY_NUMBER, #{index})
             </if>
             <if test="capacityId!=null and capacityId!=''">
-                AND REGEXP_LIKE("capacityId", #{capacityId})
+                AND REGEXP_LIKE(RCA .CAPACITY_ID, #{capacityId})
             </if>
             <if test="id!=null and id.size>0 and !(index!=null and index!='')">
-                AND "id" in
+                AND RCA .CAPACITY_ID in
                 <foreach collection="id" item="item"  open="(" close=")" separator="," >
                     #{item}
                 </foreach>
             </if>
-        </where>
-        FETCH NEXT 10 ROWS ONLY
+            FETCH NEXT 10 ROWS ONLY
+        )
+        <if test="id!=null and id.size>0">
+            UNION
+            SELECT DISTINCT
+            RCA .CAPACITY_ID "capacityId",
+            RCA .CAPACITY_ID "id",
+            RCA .CAPACITY_ID "value",
+            RCA .CAPACITY_NUMBER "label",
+            RCA .CAPACITY_NUMBER "text"
+            FROM RMS_CAPACITY RCA
+            LEFT JOIN RMS_CAPACITY_CARRIER RCC ON RCA .CAPACITY_ID = RCC .CAPACITY_ID
+            LEFT JOIN RMS_COMPANY RC ON RC .COMPANY_ID = RCC .COMPANY_ID
+            LEFT JOIN RMS_CAPACITY_TYPE RCT ON RCA.CAPACITY_TYPE_ID = RCT.CAPACITY_TYPE_ID
+            WHERE RCA .CAPACITY_ID in
+            <foreach collection="id" item="item"  open="(" close=")" separator="," >
+                #{item}
+            </foreach>
+        </if>
     </select>
     <select id="getrmsrmsjobinfosBylike" resultType="java.util.Map">
         select * from(
@@ -415,6 +443,7 @@
         </if>
     </select>
     <select id="getLineByLike" resultType="java.util.Map">
+        select * from(
         select * from(
         select
         RL.LINE_ID "lineId",
@@ -451,14 +480,39 @@
             <if test="lineType!=null and lineType!=''">
                 AND REGEXP_LIKE("lineType" , #{lineType})
             </if>
-            <if test="id!=null and id.size>0 and !(index!=null and index!='')">
-                AND "id" in
-                <foreach collection="id" item="item"  open="(" close=")" separator="," >
-                    #{item}
-                </foreach>
-            </if>
         </where>
         FETCH NEXT 10 ROWS ONLY
+        )
+        <if test="id!=null and id.size>0">
+        UNION
+            select
+            RL.LINE_ID "lineId",
+            RL.LINE_NAME "lineName",
+            RL.LINE_ID "id",
+            RL.LINE_ID "value",
+            RL.LINE_NAME "label",
+            RL.LINE_NAME "text",
+            NVL(RL_TEMP."points",'无') "points",
+            RL.LINE_TYPE    "lineType"
+            from RMS_LINE RL
+            LEFT JOIN
+            (
+            SELECT
+            RLS .LINE_ID "lineId",
+            listagg (DISTINCT ROP .OPERATION_POINT_NAME, ',') WITHIN GROUP (ORDER BY RLS .LINE_ID) "points"
+            FROM
+            RMS_LINE_STEP RLS
+            LEFT JOIN RMS_STEP_POINT RSP
+            ON RLS .STEP_ID = RSP .STEP_ID
+            LEFT JOIN RMS_OPERATION_POINT ROP
+            ON RSP .OPERATION_POINT_ID = ROP .OPERATION_POINT_ID
+            GROUP BY RLS .LINE_ID
+            ) RL_TEMP ON RL_TEMP ."lineId" = RL .LINE_ID
+            where RL.LINE_ID in
+            <foreach collection="id" item="item"  open="(" close=")" separator="," >
+                #{item}
+            </foreach>
+        </if>
     </select>
     <select id="getMaterialByLike" resultType="java.util.Map">
         select * from(