liyg 2 лет назад
Родитель
Сommit
0a607d6618

+ 17 - 0
src/main/java/com/steerinfo/dil/controller/AmsshipDeliveryAttorneyController.java

@@ -2,6 +2,9 @@ package com.steerinfo.dil.controller;
 
 import com.alibaba.fastjson.JSON;
 import com.steerinfo.dil.feign.ESFeign;
+import com.steerinfo.dil.feign.WmshboundFeign;
+import com.steerinfo.dil.mapper.AmsshipCargoTransferResultMapper;
+import com.steerinfo.dil.mapper.AmsshipDeliveryAttorneyMapper;
 import com.steerinfo.dil.model.AmsshipCargoTransferResult;
 import com.steerinfo.dil.model.AmsshipDeliveryAttorney;
 import com.steerinfo.dil.model.AmsshipDeliveryNotice;
@@ -22,6 +25,7 @@ import oracle.jdbc.proxy.annotation.Post;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.*;
 
 import java.util.*;
@@ -49,6 +53,10 @@ public class AmsshipDeliveryAttorneyController extends BaseRESTfulController {
     @Autowired
     ColumnDataUtil columnDataUtil;
     @Autowired
+    private AmsshipDeliveryAttorneyMapper amsshipDeliveryAttorneyMapper;
+    @Autowired
+    private WmshboundFeign wmshboundFeign;
+    @Autowired
     ESFeign esFeign;
     @ApiOperation(value="展示提货委托表", notes="分页查询")
     @ApiImplicitParams({
@@ -133,12 +141,21 @@ public class AmsshipDeliveryAttorneyController extends BaseRESTfulController {
     @ApiOperation(value="获取详细信息", notes="根据url的id来获取详细信息")
     @ApiImplicitParam(paramType = "path", name = "id", value = "ID", required = true, dataType = "BigDecimal")
     @PostMapping(value = "/sendDeliveryAttorneyStatus/{attorneyId}")
+    @Transactional(rollbackFor = Exception.class)
     public RESTfulResult sendDeliveryAttorneyStatus(@PathVariable("attorneyId") Integer attorneyId){
         AmsshipDeliveryAttorney amsshipDeliveryAttorney=new AmsshipDeliveryAttorney();
         amsshipDeliveryAttorney.setAttorneyId(new BigDecimal(attorneyId));
         short status=1;
         amsshipDeliveryAttorney.setAttorneyDistributionStatus(status);
         amsshipDeliveryAttorneyService.updateByPrimaryKeySelective(amsshipDeliveryAttorney);
+        //下游港口入库
+        AmsshipDeliveryAttorney attorney=amsshipDeliveryAttorneyService.selectByPrimaryKey(new BigDecimal(attorneyId));
+        Map<String,Object> map=new HashMap<>();
+        map.put("batchId",attorney.getBatchId());
+        Map<String,Object> inbound=amsshipDeliveryAttorneyMapper.getDetailsForInbound(map);
+        inbound.put("attorneyTime",attorney.getAttorneyTime().getTime());
+        inbound.put("portId",attorney.getDownSwimPortId());
+        wmshboundFeign.addWarehousingResult(inbound);
         return success(amsshipDeliveryAttorney);
     }
     /**

+ 15 - 24
src/main/java/com/steerinfo/dil/controller/ShipDynamicsController.java

@@ -99,7 +99,7 @@ public class ShipDynamicsController extends BaseRESTfulController {
                 }
                 map.put("portName", list.get(i-1).get("portName"));
                 map.put("materialType",list.get(i-1).get("materialTypeName"));
-                tonnageSum+=Double.parseDouble(list.get(i-1).get("tonnage").toString());
+                //tonnageSum+=Double.parseDouble(list.get(i-1).get("tonnage").toString());
                 map.put("capacity1","小计");
                 map.put("capacity2","小计");
                 map.put("capacity3" ,"小计");
@@ -167,9 +167,12 @@ public class ShipDynamicsController extends BaseRESTfulController {
                 materialTonnageSum=0.0;
                 materialNumberAllSum=0.0;
             }
+            //处理下游港口合计
             if(i==0 || !list.get(i).get("batchId").equals(list.get(i-1).get("batchId")) || !list.get(i).get("portName").equals(list.get(i-1).get("portName"))){
                 //物资大类的下游港口总和
                 materialTonnageSum=new BigDecimal(materialTonnageSum+Double.valueOf(list.get(i).get("tonnage").toString())).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue();
+                //所有下游港口吨位总和
+                tonnageSum+=Double.parseDouble(list.get(i).get("tonnage").toString());
             }
             Map<String, Object> map = new HashMap<>();
             map.put("batchInfacoryId",list.get(i).get("batchInfacoryId"));
@@ -289,7 +292,7 @@ public class ShipDynamicsController extends BaseRESTfulController {
                 list.get(list.size()-1).get("numberOfLoans").toString());
         map.put("tonnage",list.get(list.size()-1).get("tonnage"));
         map.put("portName", list.get(list.size()-1).get("portName"));
-        tonnageSum+=Double.parseDouble(list.get(list.size()-1).get("tonnage").toString());
+        //tonnageSum+=Double.parseDouble(list.get(list.size()-1).get("tonnage").toString());
         map.put("capacity1","小计");
         map.put("capacity2","小计");
         map.put("capacity3","小计");
@@ -349,29 +352,17 @@ public class ShipDynamicsController extends BaseRESTfulController {
         map22.put("type",1);
         map22.put("aaaaa", 2);
         mapList.add(map22);
-        //有下游吨位无江船的
-//        List<Map<String,Object>> unloads=iShipDynamicsService.selectAllUnload(mapVal);
-//        for (Map<String,Object> temp:unloads){
-//            String pm= temp.get("materialName").toString() +"\n\n\n\n\n"+
-//                    "\""+temp.get("shipName").toString()+"\""+"\n\n\n\n\n"+
-//                    temp.get("dateOfLoans").toString().substring(0, 10)+"\n\n\n\n\n"+"放"+
-//                    temp.get("numberOfLoans").toString()+"吨";
-//            temp.put("pm",pm);
-//            temp.put("materialType",temp.get("materialTypeName"));
-//            tonnageSum+=Double.parseDouble(temp.get("tonnage").toString());
-//        }
-//        mapList.addAll(unloads);
         //最下方的两行
         //第一行
         Map<String,Object> map3=new HashMap<>();
         map3.put("batchInfacoryId",Integer.parseInt(list.get(list.size() -1).get("batchInfacoryId").toString()) + 1);
         map3.put("batchId",Integer.parseInt(list.get(list.size()-1).get("batchId").toString())+1);
         //下游吨位总合计
-//        if (list.get(list.size()-1).get("instructionStatus")!=null) {
-//            map3.put("tonnage1",new BigDecimal(tonnageSum).setScale(2,BigDecimal.ROUND_HALF_UP));
-//        }else {
-//            map3.put("tonnage",new BigDecimal(tonnageSum).setScale(2,BigDecimal.ROUND_HALF_UP));
-//        }
+        if (list.get(list.size()-1).get("instructionStatus")!=null) {
+            map3.put("tonnage1",new BigDecimal(tonnageSum).setScale(2,BigDecimal.ROUND_HALF_UP));
+        }else {
+            map3.put("tonnage",new BigDecimal(tonnageSum).setScale(2,BigDecimal.ROUND_HALF_UP));
+        }
         map3.put("pm","合计");
         map3.put("capacityNumber1",capacityNumberAllSum1);
         map3.put("capacityNumber2",capacityNumberAllSum2);
@@ -384,11 +375,11 @@ public class ShipDynamicsController extends BaseRESTfulController {
         map3.put("batchInfacoryId",Integer.parseInt(list.get(list.size() -1).get("batchInfacoryId").toString()) + 1);
         map4.put("batchId",Integer.parseInt(list.get(list.size()-1).get("batchId").toString())+1);
         //下游吨位总合计
-//        if (list.get(list.size()-1).get("instructionStatus")!=null) {
-//            map4.put("tonnage1",new BigDecimal(tonnageSum).setScale(2,BigDecimal.ROUND_HALF_UP));
-//        }else {
-//            map4.put("tonnage",new BigDecimal(tonnageSum).setScale(2,BigDecimal.ROUND_HALF_UP));
-//        }
+        if (list.get(list.size()-1).get("instructionStatus")!=null) {
+            map4.put("tonnage1",new BigDecimal(tonnageSum).setScale(2,BigDecimal.ROUND_HALF_UP));
+        }else {
+            map4.put("tonnage",new BigDecimal(tonnageSum).setScale(2,BigDecimal.ROUND_HALF_UP));
+        }
         map4.put("pm","合计");
         map4.put("capacity1",new BigDecimal(capacityNumberAllSum1+capacityNumberAllSum2+capacityNumberAllSum3+capacityNumberAllSum4).setScale(2,BigDecimal.ROUND_HALF_UP));
         map4.put("type",1);

+ 4 - 4
src/main/java/com/steerinfo/dil/service/impl/AmsshipDeliveryAttorneyServiceImpl.java

@@ -82,10 +82,10 @@ public class AmsshipDeliveryAttorneyServiceImpl implements IAmsshipDeliveryAttor
         amsshipDeliveryAttorney.setDeleted((short) 0);
         amsshipDeliveryAttorney.setRealForeignShipName(map.get("realForeignShipName")+"");
         //下游港口入库
-        Map<String,Object> inbound=amsshipDeliveryAttorneyMapper.getDetailsForInbound(map);
-        inbound.put("attorneyTime",map.get("attorneyTime"));
-        inbound.put("portId",amsshipDeliveryAttorney.getDownSwimPortId());
-        wmshboundFeign.addWarehousingResult(inbound);
+//        Map<String,Object> inbound=amsshipDeliveryAttorneyMapper.getDetailsForInbound(map);
+//        inbound.put("attorneyTime",map.get("attorneyTime"));
+//        inbound.put("portId",amsshipDeliveryAttorney.getDownSwimPortId());
+//        wmshboundFeign.addWarehousingResult(inbound);
         return amsshipDeliveryAttorneyMapper.insertSelective(amsshipDeliveryAttorney);
     }
 

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

@@ -178,7 +178,7 @@
       </if>
     </where>
   </sql>
-  <delete id="deleteByPrimaryKey" parameterType="java.lang.Short">
+  <delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
     delete from AMSSHIP_DELIVERY_ATTORNEY
     where ATTORNEY_ID = #{attorneyId,jdbcType=DECIMAL}
   </delete>
@@ -489,7 +489,7 @@
     </set>
     where ATTORNEY_ID = #{attorneyId,jdbcType=DECIMAL}
   </update>
-  <select id="selectByPrimaryKey" parameterType="java.lang.Short" resultMap="BaseResultMap">
+  <select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap">
     <include refid="select" />
     where ATTORNEY_ID = #{attorneyId,jdbcType=DECIMAL}
   </select>

+ 9 - 2
src/main/resources/com/steerinfo/dil/mapper/DilBatchMapper.xml

@@ -305,6 +305,7 @@
                     DBI.BATCH_INFACOTRY_ID      "batchId",
                     APO.PURCHASE_ORDER_NO       "purchaseOrderNo",
                     DBI.INFACTORY_SHIP_NAME     "infactoryShipName",
+                    ADN.RESULT_NUMBER_OF_LOANS  "resultNumberOfLoads",
                     DB.INSERT_TIME
     from AMSSHIP_DELIVERY_NOTICE ADN
            LEFT JOIN DIL_BATCH_INFACOTRY DBI
@@ -315,9 +316,12 @@
                      ON APO.BATCH_ID = DB.BATCH_ID
            LEFT JOIN RMS_MATERIAL RM
                      ON RM.MATERIAL_ID = DB.MATERIAL_ID
+           LEFT JOIN AMSSHIP_DELIVERY_ATTORNEY ADA
+                    ON ADA.BATCH_ID=ADN.BATCH_ID
     <where>
+      NVL(ADA.DELETED,1) = 1
       <if test="con!=null">
-        (DB.RESULT_FOREIGN_SHIP_NAME like concat('%', concat(#{con},'%'))
+        and (DB.RESULT_FOREIGN_SHIP_NAME like concat('%', concat(#{con},'%'))
         or RM.MATERIAL_NAME like concat('%', concat(#{con}, '%'))
         or DBI.BATCH_INFACOTRY_ID like concat('%', concat(#{con}, '%'))
         or APO.PURCHASE_ORDER_NO like concat('%', concat(#{con}, '%'))
@@ -346,9 +350,12 @@
     ON APO.BATCH_ID = DB.BATCH_ID
     LEFT JOIN RMS_MATERIAL RM
     ON RM.MATERIAL_ID = DB.MATERIAL_ID
+    LEFT JOIN OMSSHIP_SHIPMENT_INSTRUCTIONS OSI
+    ON OSI.BATCH_ID=ADA.BATCH_ID
     <where>
+      NVL(OSI.DELETED,1) = 1
       <if test="con!=null">
-        (DB.RESULT_FOREIGN_SHIP_NAME like concat('%', concat(#{con},'%'))
+        and (DB.RESULT_FOREIGN_SHIP_NAME like concat('%', concat(#{con},'%'))
         or RM.MATERIAL_NAME like concat('%', concat(#{con}, '%'))
         or DBI.BATCH_INFACOTRY_ID like concat('%', concat(#{con}, '%'))
         or APO.PURCHASE_ORDER_NO like concat('%', concat(#{con}, '%'))

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

@@ -16,7 +16,7 @@
                               rc.capacity_number "capacity",
                               tlsr.RESULT_ACTUAL_INSTALLATIONS "capacityNumber",
                               tlsr.RESULT_OUT_PORT_TIME "outPortTime",
-                              tlsr.RESULT_ARRIVAL_PORT_TIME "dgsj",
+                              TO_CHAR(tsl.UPDATE_TIME,'yyyy-mm-dd') "dgsj",
                               tsl.LOCATION_STATUS "locationStatus",
                               tsl.LOCATION_VALUE "locationValue",
                               NVL(ADN.RESULT_MEMO,'进口块矿') "materialTypeName",

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

@@ -475,7 +475,7 @@
       tlsr.RESULT_ACTUAL_INSTALLATIONS as "realWeight",
       tsl.LOCATION_VALUE               as "shipLocation",
       tsl.LOCATION_STATUS              as "locationStatus",
-      tsl.LOCATION_ROUTE_TIME          as "locationRouteTime",
+      to_char(tlsr.RESULT_OUT_PORT_TIME,'yyyy-mm-dd')        as "locationRouteTime",
       tsl.LOCATION_MEMO                as "locationMemo"
     FROM TMSSHIP_SHIP_LOCATION tsl
            LEFT JOIN TMSSHIP_TOTAL_RESULT ttr
@@ -506,6 +506,7 @@
   <if test="con!=null">
     and  (instr(rc.CAPACITY_NUMBER,#{con}) > 0 or instr(rm.MATERIAL_NAME,#{con}) > 0 or   instr(db.RESULT_FOREIGN_SHIP_NAME,#{con}) > 0  )
   </if>
+    order By db.RESULT_FOREIGN_SHIP_NAME
   </select>
 
   <select id="selectShipLocation" parameterType="DECIMAL" resultType="java.util.Map">