Sfoglia il codice sorgente

修改卸车作业业

liyg 2 anni fa
parent
commit
584911fd43

+ 7 - 1
src/main/java/com/steerinfo/dil/controller/TmstrainLoadingResultController.java

@@ -195,8 +195,14 @@ public class TmstrainLoadingResultController extends BaseRESTfulController {
                                     @RequestBody(required = false) Map<String, Object> mapValue,
                                     Integer apiId,
                                     Integer pageNum,
-                                    Integer pageSize) {
+                                    Integer pageSize,
+                                    String wagon,
+                                    String purchaseOrderNum,
+                                    String materialName) {
         mapValue.put("resultType", resultType);
+        mapValue.put("wagon",wagon);
+        mapValue.put("purchaseOrderNum",purchaseOrderNum);
+        mapValue.put("materialName",materialName);
         //不分页筛选数据
         PageHelper.startPage(pageNum, pageSize);
         //分页数据

+ 4 - 2
src/main/java/com/steerinfo/dil/controller/TmstrainMeasureCommissionController.java

@@ -39,7 +39,7 @@ public class TmstrainMeasureCommissionController extends BaseRESTfulController {
     ColumnDataUtil columnDataUtil;
 
 
-    @ApiOperation(value = "查询需要发送计量委托的车皮信息")
+    @ApiOperation(value = "查询已发送的计量委托并展示")
     @ApiImplicitParams({
             @ApiImplicitParam(name = "apiId(209)", value = "表头", required = false, dataType = "Interger")
     })
@@ -49,8 +49,10 @@ public class TmstrainMeasureCommissionController extends BaseRESTfulController {
             Integer apiId,
             Integer pageNum,
             Integer pageSize,
-            Integer resultType) {
+            Integer resultType,
+            String con) {
         mapValue.put("resultType",resultType);
+        mapValue.put("con",con);
         //不分页筛选数据
         PageHelper.startPage(pageNum, pageSize);
         //分页数据

+ 1 - 1
src/main/java/com/steerinfo/dil/mapper/TmstrainMeasureCommissionMapper.java

@@ -18,6 +18,6 @@ public interface TmstrainMeasureCommissionMapper extends IBaseMapper<TmstrainMea
     //查询车皮计量委托
     Map<String, Object> getTrainMeasureCommission(Map<String, Object> map);
 
-    //查询没有发送过计量委托的车皮装车实绩并且到站是新区轨道衡和老区轨道衡的车皮装车实绩(不是补录)
+    //查询已发送的计量委托的车皮装车实绩并且到站是新区轨道衡和老区轨道衡的车皮装车实绩(不是补录)
     List<Map<String, Object>> getLoadResultToSendMC(Map<String, Object> map);
 }

+ 2 - 2
src/main/java/com/steerinfo/dil/service/impl/TmstrainWagonUnloadResultServiceImpl.java

@@ -121,8 +121,8 @@ public class TmstrainWagonUnloadResultServiceImpl implements ITmstrainWagonUnloa
             tmstrainWagonUnloadResult.setPurchaseOrderRailPlanId(DataChange.dataToBigDecimal(map.get("purchaseOrderId")));
             //生成主键id
             tmstrainWagonUnloadResult.setUnloadingId(tmstrainWagonUnloadResultMapper.selectMaxId());
-            //查询装车实绩中的卸货点
-            tmstrainWagonUnloadResult.setUnloadingPointId(DataChange.dataToBigDecimal(map.get("unloadingPointId")));
+            //查询装车实绩中的卸货点传入数据(改成前端传入)
+            //tmstrainWagonUnloadResult.setUnloadingPointId(DataChange.dataToBigDecimal(map.get("unloadingPointId")));
             tmstrainWagonUnloadResult.setResultWagonNo(resultWagonNo);
             count += tmstrainWagonUnloadResultMapper.insertSelective(tmstrainWagonUnloadResult);
             count += updateLoadingResult(map); //修改装车实绩为已卸货

+ 1 - 1
src/main/resources/bootstrap.yml

@@ -1,7 +1,7 @@
 api.version: api/v1/trainTms
 spring:
   profiles:
-    include: ${SPRING_PROFILES:dev}
+    include: ${SPRING_PROFILES:prod}
   jackson:
         date-format: yyyy-MM-dd HH:mm:ss
         time-zone: GMT+8

+ 14 - 26
src/main/resources/com/steerinfo/dil/mapper/TmstrainLoadingResultMapper.xml

@@ -900,12 +900,16 @@
     to_char(TLR.RESULT_LOADING_DATE ,'yyyy-mm-dd') "resultLoadingDate",
     APO.PURCHASE_ORDER_NO   "purchaseOrderNo",
     RM.MATERIAL_NAME        "materialName",
-    APO.PURCHASE_ORDER_ID     "purchaseOrderId"
+    APO.PURCHASE_ORDER_ID     "purchaseOrderId",
+    DBI.INFACTORY_SHIP_NAME "infactoryShipName",
+    DB.RESULT_FOREIGN_SHIP_NAME "resultForeignShipName"
     from TMSTRAIN_LOADING_RESULT TLR
     left join AMS_PURCHASE_ORDER APO
     on APO.PURCHASE_ORDER_ID = TLR.PURCHASE_ORDER_RAIL_PLAN_ID
     left join DIL_BATCH DB
     on DB.BATCH_ID = APO.BATCH_ID
+    left join DIL_BATCH_INFACOTRY DBI
+    on DBI.BATCH_ID = DB.BATCH_ID
     left join RMS_MATERIAL RM
     on DB.MATERIAL_ID = RM.MATERIAL_ID
     left join RMS_WAREHOUSE   RW
@@ -913,32 +917,16 @@
     where TLR.DELETED not in (2, 1)
     and TLR.RESULT_TYPE = #{resultType}
     and TLR.PURCHASE_ORDER_RAIL_PLAN_ID is not null
+    <if test="wagon!=null and wagon!=''.toString()">
+      and TLR.RESULT_WAGON_NO like concat('%',concat(#{wagon},'%'))
+    </if>
+    <if test="purchaseOrderNum!=null and purchaseOrderNum!=''.toString()">
+      and APO.PURCHASE_ORDER_NO like concat('%',concat(#{purchaseOrderNum},'%'))
+    </if>
+    <if test="materialName!=null and materialName!=''.toString()">
+      and RM.MATERIAL_NAME like concat('%',concat(#{materialName},'%'))
+    </if>
     )
-    <where>
-      <if test="resultWagonNo != null">
-        <foreach collection="resultWagonNo" item="item" open="(" separator="or" close=")">
-          "resultWagonNo" like '%${item}%'
-        </foreach>
-      </if>
-      <if test="resultLoadingDate != null">
-        and
-        <foreach collection="resultLoadingDate" item="item" open="(" separator="or" close=")">
-          "resultLoadingDate" like '%${item}%'
-        </foreach>
-      </if>
-      <if test="purchaseOrderNo != null">
-        and
-        <foreach collection="purchaseOrderNo" item="item" open="(" separator="or" close=")">
-          "purchaseOrderNo" like '%${item}%'
-        </foreach>
-      </if>
-      <if test="materialName != null">
-        and
-        <foreach collection="materialName" item="item" open="(" separator="or" close=")">
-          "materialName" like '%${item}%'
-        </foreach>
-      </if>
-    </where>
     <include refid="orderBy"></include>
     <if test="orderField == null  ">
       order by "resultLoadingDate" desc

+ 53 - 33
src/main/resources/com/steerinfo/dil/mapper/TmstrainMeasureCommissionMapper.xml

@@ -375,46 +375,66 @@
     where TLR.RESULT_ID = #{resultId}
   </select>
 
-<!-- 查询没有发送过计量委托的车皮装车实绩并且到站是新区轨道衡和老区轨道衡的车皮装车实绩 -->
+<!-- 查询发送过计量委托的车皮装车实绩并且到站是新区轨道衡和老区轨道衡的车皮装车实绩 -->
   <select id="getLoadResultToSendMC" parameterType="map" resultType="java.util.Map">
     select
            *
     from (
-           select TTR.TOTAL_RESULT_ID                            "resultTotalId",
-                  TLR.RESULT_ID                                  "resultId",
-                  APO.PURCHASE_ORDER_NO                          "purchaseOrderNo",
-                  TLR.RESULT_WAGON_NO                            "resultWagonNo",
-                  to_char(TLR.RESULT_LOADING_DATE, 'yyyy-mm-dd') "resultLoadingDate",
-                  TLR.RESULT_CLASS                               "resultClass",
-                  DB.RESULT_FOREIGN_SHIP_NAME                    "resultForeignShipName",
-                  RM.MATERIAL_NAME                               "materialName",
-                  RAS.ARRIVAL_NAME                               "sendStationName",
-                  RAS2.ARRIVAL_NAME                              "arrivalStationName",
-                  TLR.RESULT_BILLABLE_TONNAGE                    "resultBillableTonnage",
-                  TLR.RESULT_ISCLEAR                             "resultIsclear",
-                  TLR.RESULT_REMARKS                             "resultRemarks",
-                  RS.SUPPLIER_NAME                               "supplierName",
-                  TLR.INSERT_TIME                                "insertTime",
-                  TTR.TRANSPORT_NUM                              "transportNum"
-           from TMSTRAIN_LOADING_RESULT TLR
-                  left join AMS_PURCHASE_ORDER APO
-                            on TLR.PURCHASE_ORDER_RAIL_PLAN_ID = APO.PURCHASE_ORDER_ID
-                  left join RMS_SUPPLIER RS
-                            on RS.SUPPLIER_ID = APO.SUPPLIER_UNIT_ID
-                  left join DIL_BATCH DB
-                            on TLR.BATCH_ID = DB.BATCH_ID
-                  left join RMS_MATERIAL RM
-                            on DB.MATERIAL_ID = RM.MATERIAL_ID
-                  left join RMSTRAIN_ARRIVAL_SEND RAS
-                            on RAS.ARRIVAL_ID = TLR.SEND_STATION_ID
-                  left join RMSTRAIN_ARRIVAL_SEND RAS2
-                            on RAS2.ARRIVAL_ID = TLR.ARRIVAL_STATION_ID
-                  left join TMSTRAIN_TOTAL_RESULT TTR
-                            on TTR.LOADING_ID = TLR.RESULT_ID
+          select TTR.TOTAL_RESULT_ID                            "resultTotalId",
+            TLR.RESULT_ID                                  "resultId",
+            APO.PURCHASE_ORDER_NO                          "purchaseOrderNo",
+            TLR.RESULT_WAGON_NO                            "resultWagonNo",
+            to_char(TLR.RESULT_LOADING_DATE, 'yyyy-mm-dd') "resultLoadingDate",
+            TLR.RESULT_CLASS                               "resultClass",
+            DB.RESULT_FOREIGN_SHIP_NAME                    "resultForeignShipName",
+            RM.MATERIAL_NAME                               "materialName",
+            RAS.ARRIVAL_NAME                               "sendStationName",
+            RAS2.ARRIVAL_NAME                              "arrivalStationName",
+            TLR.RESULT_BILLABLE_TONNAGE                    "resultBillableTonnage",
+            TLR.RESULT_ISCLEAR                             "resultIsclear",
+            TLR.RESULT_REMARKS                             "resultRemarks",
+            RS.SUPPLIER_NAME                               "supplierName",
+            TLR.INSERT_TIME                                "insertTime",
+            TTR.TRANSPORT_NUM                              "transportNum",
+            (CASE
+            WHEN TWUR.UNLOADING_ID IS NULL THEN
+            '未卸货'
+            ELSE
+            '已卸货'
+            END) as isUnload
+            from TMSTRAIN_LOADING_RESULT TLR
+            left join AMS_PURCHASE_ORDER APO
+            on TLR.PURCHASE_ORDER_RAIL_PLAN_ID = APO.PURCHASE_ORDER_ID
+            left join RMS_SUPPLIER RS
+            on RS.SUPPLIER_ID = APO.SUPPLIER_UNIT_ID
+            left join DIL_BATCH DB
+            on TLR.BATCH_ID = DB.BATCH_ID
+            left join RMS_MATERIAL RM
+            on DB.MATERIAL_ID = RM.MATERIAL_ID
+            left join RMSTRAIN_ARRIVAL_SEND RAS
+            on RAS.ARRIVAL_ID = TLR.SEND_STATION_ID
+            left join RMSTRAIN_ARRIVAL_SEND RAS2
+            on RAS2.ARRIVAL_ID = TLR.ARRIVAL_STATION_ID
+            left join TMSTRAIN_TOTAL_RESULT TTR
+            on TTR.LOADING_ID = TLR.RESULT_ID
+            left join TMSTRAIN_WAGON_UNLOAD_RESULT TWUR
+            on (TLR.PURCHASE_ORDER_RAIL_PLAN_ID=TWUR.PURCHASE_ORDER_RAIL_PLAN_ID and  TLR.RESULT_WAGON_NO=TWUR.RESULT_WAGON_NO)
            where TLR.DELETED = 0
              and TLR.RESULT_TYPE = #{resultType}
-             and TLR.SEND_REQUEST = 1
+             and TLR.SEND_REQUEST = 2
              and APO.PURCHASE_ORDER_NO IS NOT NULL
+             <if test="con!=null and con!=''.toString()">
+             and (
+                    APO.PURCHASE_ORDER_NO like concat('%',concat(#{con},'%'))
+                 or TLR.RESULT_WAGON_NO like concat('%',concat(#{con},'%'))
+                 or TLR.RESULT_CLASS like concat('%',concat(#{con},'%'))
+                 or DB.RESULT_FOREIGN_SHIP_NAME like concat('%',concat(#{con},'%'))
+                 or RM.MATERIAL_NAME like concat('%',concat(#{con},'%'))
+                 or RAS.ARRIVAL_NAME like concat('%',concat(#{con},'%'))
+                 or RAS2.ARRIVAL_NAME like concat('%',concat(#{con},'%'))
+                 or RS.SUPPLIER_NAME like concat('%',concat(#{con},'%'))
+               )
+             </if>
          )
 
     <where>

+ 18 - 88
src/main/resources/com/steerinfo/dil/mapper/TmstrainWagonUnloadResultMapper.xml

@@ -517,7 +517,8 @@
     RW.WAREHOUSE_NAME "unloadPointName",
     t_unload.RESULT_BIG_TICKET_WEIGHT "resultBigTicketWeight",
     t_unload.RESULT_RAIL_HORIZONTAL_WEIGHT "resultRailHorizontalWeight",
-    t_unload.RESULT_REMARK "resultRemark"
+    t_unload.RESULT_REMARK "resultRemark",
+    DBI.INFACTORY_SHIP_NAME "infactoryShipName"
     from TMSTRAIN_LOADING_RESULT t_load
     left join TMSTRAIN_WAGON_UNLOAD_RESULT t_unload
     on t_load.RESULT_WAGON_NO=t_unload.RESULT_WAGON_NO
@@ -526,101 +527,30 @@
     left join DIL_BATCH d_batch
     on t_load.BATCH_ID=d_batch.BATCH_ID
     left join RMS_MATERIAL r_material
-    on d_batch.MATERIAL_ID=r_material.MATERIAL_ID
+    on t_load.MATERIAL_ID=r_material.MATERIAL_ID
     left join RMSTRAIN_ARRIVAL_SEND r_s_arrival
     on r_s_arrival.ARRIVAL_ID=t_load.SEND_STATION_ID
     left join RMSTRAIN_ARRIVAL_SEND r_a_arrival
     on r_a_arrival.ARRIVAL_ID=t_load.ARRIVAL_STATION_ID
     left join RMS_WAREHOUSE RW
     on RW.WAREHOUSE_ID = t_unload.UNLOADING_POINT_ID
+    left join DIL_BATCH_INFACOTRY DBI
+    on DBI.BATCH_ID = d_batch.BATCH_ID
     where  t_unload.DELETED = 0 and t_load.DELETED = 2 and t_unload.RESULT_TYPE = #{resultType}
+    <if test="con!=null and con!=''.toString()">
+      and (
+      a_order.PURCHASE_ORDER_NO like concat('%',concat(#{con},'%'))
+      or t_unload.RESULT_WAGON_NO like concat('%',concat(#{con},'%'))
+      or t_unload.RESULT_WAGON_NO like concat('%',concat(#{con},'%'))
+      or t_load.RESULT_CLASS like concat('%',concat(#{con},'%'))
+      or d_batch.RESULT_FOREIGN_SHIP_NAME like concat('%',concat(#{con},'%'))
+      or r_material.MATERIAL_NAME like concat('%',concat(#{con},'%'))
+      or r_s_arrival.ARRIVAL_NAME like concat('%',concat(#{con},'%'))
+      or r_a_arrival.ARRIVAL_NAME like concat('%',concat(#{con},'%'))
+      or RW.WAREHOUSE_NAME like concat('%',concat(#{con},'%'))
+      )
+    </if>
     )
-    <where>
-      <if test="purchaseOrderNo != null">
-        and
-        <foreach collection="purchaseOrderNo" item="item" open="(" separator="or" close=")">
-          "purchaseOrderNo" like '%${item}%'
-        </foreach>
-      </if>
-      <if test="resultWagonNo != null">
-        and
-        <foreach collection="resultWagonNo" item="item" open="(" separator="or" close=")">
-          "resultWagonNo" like '%${item}%'
-        </foreach>
-      </if>
-      <if test="resultLoadingDate != null">
-        and
-        <foreach collection="resultLoadingDate" item="item" open="(" separator="or" close=")">
-          "resultLoadingDate" like '%${item}%'
-        </foreach>
-      </if>
-      <if test="resultArrivalDate != null">
-        and
-        <foreach collection="resultArrivalDate" item="item" open="(" separator="or" close=")">
-          "resultArrivalDate" like '%${item}%'
-        </foreach>
-      </if>
-      <if test="resultUnloadTime != null">
-        and
-        <foreach collection="resultUnloadTime" item="item" open="(" separator="or" close=")">
-          "resultUnloadTime" like '%${item}%'
-        </foreach>
-      </if>
-      <if test="resultClass != null">
-        and
-        <foreach collection="resultClass" item="item" open="(" separator="or" close=")">
-          "resultClass" like '%${item}%'
-        </foreach>
-      </if>
-      <if test="resultForeignShipName != null">
-        and
-        <foreach collection="resultForeignShipName" item="item" open="(" separator="or" close=")">
-          "resultForeignShipName" like '%${item}%'
-        </foreach>
-      </if>
-      <if test="materialName != null">
-        and
-        <foreach collection="materialName" item="item" open="(" separator="or" close=")">
-          "materialName" like '%${item}%'
-        </foreach>
-      </if>
-      <if test="sendStationName != null">
-        and
-        <foreach collection="sendStationName" item="item" open="(" separator="or" close=")">
-          "sendStationName" like '%${item}%'
-        </foreach>
-      </if>
-      <if test="arrivalStationName != null">
-        and
-        <foreach collection="arrivalStationName" item="item" open="(" separator="or" close=")">
-          arrivalStationName like '%${item}%'
-        </foreach>
-      </if>
-      <if test="unloadPointName != null">
-        and
-        <foreach collection="unloadPointName" item="item" open="(" separator="or" close=")">
-          "unloadPointName" like '%${item}%'
-        </foreach>
-      </if>
-      <if test="resultBigTicketWeight != null">
-        and
-        <foreach collection="resultBigTicketWeight" item="item" open="(" separator="or" close=")">
-          "resultBigTicketWeight" like '%${item}%'
-        </foreach>
-      </if>
-      <if test="resultRailHorizontalWeight != null">
-        and
-        <foreach collection="resultRailHorizontalWeight" item="item" open="(" separator="or" close=")">
-          "resultRailHorizontalWeight" like '%${item}%'
-        </foreach>
-      </if>
-      <if test="resultRemark != null">
-        and
-        <foreach collection="resultRemark" item="item" open="(" separator="or" close=")">
-          "resultRemark" like '%${item}%'
-        </foreach>
-      </if>
-    </where>
     <include refid="orderBy"></include>
     <if test="orderField == null  ">
       order by "resultUnloadTime" desc