Bladeren bron

Merge branch 'master' of https://gitee.com/antai-wuliu/ANTAI-API

liyg 1 jaar geleden
bovenliggende
commit
6139b7d8bc

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

@@ -67,16 +67,8 @@ public class TMSController extends BaseRESTfulController {
     @ApiImplicitParam(name = "map", value = "JSON格式数据", required = true, dataType = "Map<String, Object>")
     @LogAround(foreignKeys = {"resultId"}, foreignKeyTypes = {"计算公式"})
     @PostMapping("/addcomprehensiveresults")
-    public Map<String, Object> insertcomprehensiveresults(@RequestBody(required = false) Map<String, Object> map) throws ParseException {
-        if (!map.isEmpty()) {
-            if (!map.get("resultTime").toString().isEmpty()) {
-                SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
-                Date resultTime = simpleDateFormat.parse(map.get("resultTime").toString());
-                map.put("resultTime", resultTime);
-            }
-        }
-        map.put("insertUsername", map.get("userName").toString());
-        return tmsFeign.insertAmsSalaryContrac(map);
+    public Map<String, Object> insertcomprehensiveresults(@RequestBody(required = false) Map<String, Object> map)  {
+        return tmsFeign.addComprehensiveResult(map);
     }
 
     @ApiOperation(value = "车辆实绩删除")

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

@@ -31,7 +31,7 @@ public interface TmsFeign {
                                                 @RequestParam Integer pageSize);
 
     @PostMapping("api/v1/tms/tmscomprehensiveresults/add")
-    Map<String, Object> insertAmsSalaryContrac(@RequestBody(required = false) Map<String, Object> map);
+    Map<String, Object> addComprehensiveResult(@RequestBody(required = false) Map<String, Object> map);
 
     @PostMapping("api/v1/tms/tmscomprehensiveresults/tmscomprehensiveresultsupdate")
     Map<String, Object> updateAmsSalaryContrac(@RequestBody(required = false) Map<String, Object> map);

+ 2 - 2
src/main/resources/application-prod.yml

@@ -29,8 +29,8 @@ openfeign:
     url: ${AMSFEIGN_URL:172.16.90.202:8000}
 #    url: ${AMSFEIGN_URL:localhost:8079}
   TmsFeign:
-    url: ${TMSFEIGN_URL:172.16.90.202:8000}
-#    url: ${RMSFEIGN_URL:localhost:8086}
+#    url: ${TMSFEIGN_URL:172.16.90.202:8000}
+    url: ${RMSFEIGN_URL:localhost:8086}
   WMSFeign:
     url: ${WMSFEIGN_URL:172.16.90.202:8000}
   RmsFeign:

+ 26 - 41
src/main/resources/com/steerinfo/dil/mapper/UniversalMapper.xml

@@ -447,6 +447,7 @@
     </select>
 
     <select id="getCapacityByLike" resultType="java.util.Map">
+        select * from (
         select * from (
         select * from (
         SELECT DISTINCT
@@ -476,14 +477,8 @@
         END "receivingCompanyId",
         RCA.CAPACITY_NUMBER "label",
         RCA.CAPACITY_NUMBER "text",
-        CASE WHEN RCA.REMARK1 is null
-        then RCA.CAPACITY_NUMBER
-        else RCA.REMARK1
-        end "remark1",
-        CASE WHEN RCA.REMARK1 is null
-        then RCA.CAPACITY_NUMBER
-        else RCA.REMARK1
-        end "capacityNumber",
+        RCA.REMARK1 "remark1",
+        RCA.CAPACITY_NUMBER "capacityNumber",
         (case
         when oto.capacity_id is null then '空闲'
         when oto.deleted != '2' and oto.capacity_id is not null then '已派'
@@ -531,24 +526,20 @@
             <if test="capacityType == null">
                 AND RCT.CAPACITY_TYPE_NAME != '火车'
             </if>
-            <if test="index!=null and index!=''">
-                AND REGEXP_LIKE(RCA.CAPACITY_NUMBER, #{index})
-            </if>
             <if test="capacityId!=null and capacityId!=''">
                 AND RCA .CAPACITY_ID = #{capacityId}
             </if>
-
-            <if test="lastIndex!=null">
-                and RCA.CAPACITY_ID &lt; #{lastIndex}
-            </if>
             <if test="(driverId!=null and driverId!='') or (driverId2!=null and driverId2!='')">
                 ORDER BY "countNumber" DESC
             </if>
-            <if test="!((driverId!=null and driverId!='') or (driverId2!=null and driverId2!=''))">
-                order by RCA.CAPACITY_ID desc
+
+        ) <where>
+            <if test="index!=null and index!=''">
+                AND REGEXP_LIKE("capacityNumber", #{index})
             </if>
-            FETCH NEXT 10 ROWS ONLY
-        )
+          </where>
+            order by LENGTH("capacityNumber")
+            FETCH NEXT 10 ROWS ONLY)
         <if test="id!=null and id.size>0">
             UNION
             SELECT DISTINCT
@@ -578,14 +569,8 @@
             END "receivingCompanyId",
             RCA.CAPACITY_NUMBER "label",
             RCA.CAPACITY_NUMBER "text",
-            CASE WHEN RCA.REMARK1 is null
-            then RCA.CAPACITY_NUMBER
-            else RCA.REMARK1
-            end "remark1",
-            CASE WHEN RCA.REMARK1 is null
-            then RCA.CAPACITY_NUMBER
-            else RCA.REMARK1
-            end "capacityNumber",
+            RCA.REMARK1 "remark1",
+            RCA.CAPACITY_NUMBER "capacityNumber",
             (case
             when oto.capacity_id is null then '空闲'
             when oto.deleted != '2' and oto.capacity_id is not null then '已派'
@@ -622,16 +607,17 @@
             <foreach collection="id" item="item" open="(" close=")" separator="," >
                 #{item}
             </foreach>
+        </if>)
+        <if test="(driverId!=null and driverId!='') or (driverId2!=null and driverId2!='')">
+            ORDER BY "countNumber" DESC
         </if>
-    )
-    <if test="(driverId!=null and driverId!='') or (driverId2!=null and driverId2!='')">
-        ORDER BY "countNumber" DESC
-    </if>
     </select>
 
     <select id="getCapacityByLikeSc" resultType="java.util.Map">
         select * from (
         select * from (
+        select * from (
+        select rownum id,t.* from (
         SELECT DISTINCT
         RCA .CAPACITY_ID "capacityId",
         RCA .CAPACITY_ID "id",
@@ -731,21 +717,23 @@
         <if test="capacityId!=null and capacityId!=''">
             AND RCA .CAPACITY_ID = #{capacityId}
         </if>
-
-        <if test="lastIndex!=null">
-            and RCA.CAPACITY_ID &lt; #{lastIndex}
-        </if>
         <if test="(driverId!=null and driverId!='') or (driverId2!=null and driverId2!='')">
             ORDER BY "countNumber" DESC
         </if>
         <if test="!((driverId!=null and driverId!='') or (driverId2!=null and driverId2!=''))">
-            order by RCA.CAPACITY_ID desc
+            order by length("capacityNumber"),"capacityNumber"
         </if>
-        FETCH NEXT 10 ROWS ONLY
-        )
+        )t)t1
+        <where>
+            <if test="lastIndex!=null">
+                and t1.id > #{lastIndex}
+            </if>
+        </where>
+        FETCH NEXT 10 ROWS ONLY)
         <if test="id!=null and id.size>0">
             UNION
             SELECT DISTINCT
+            0 id,
             RCA .CAPACITY_ID "capacityId",
             RCA .CAPACITY_ID "id",
             RCA .CAPACITY_ID "value",
@@ -824,9 +812,6 @@
             </foreach>
         </if>
         )
-        <where>
-            <include refid="com.steerinfo.dil.mapper.CommonMapper.filterCompanyData"></include>
-        </where>
         <if test="(driverId!=null and driverId!='') or (driverId2!=null and driverId2!='')">
             ORDER BY "countNumber" DESC
         </if>