Pārlūkot izejas kodu

Merge branch 'master' of https://git.steerinfo.com/DAL-DAZHOU1/DAL-DAZHOU-BMSSHIP-API

liyg 2 gadi atpakaļ
vecāks
revīzija
e482909e02

+ 1 - 22
src/main/java/com/steerinfo/dil/controller/BmsshipDetailsOrderController.java

@@ -56,31 +56,10 @@ public class BmsshipDetailsOrderController extends BaseRESTfulController {
                                           Integer pageNum,
                                           Integer pageSize,
                                           Integer apiId)throws IOException {
-        //初始化过滤
-        List<Map<String, Object>> detailListTotal=null;
-        //如果有条件查询则跳过初始化,和创建索引
-        if(mapValue==null){
-            //将查询结果存入索引中
-            detailListTotal = bmsshipDetailsOrderSerivce.getDetailsOrderList(null);
-            Map<String, Object> map = new HashMap<>();
-            //添加索引
-            map.put("index","get_detail_order_list");
-            //添加id
-            map.put("indexId","detailsId");
-            detailListTotal.add(map);
-            //新建索引
-            String s = JSON.toJSONString(detailListTotal);
-            esFeign.insertIndex(detailListTotal);
-            //删除
-            detailListTotal.remove(detailListTotal.size()-1);
-        }
-        if (detailListTotal == null) {
-            detailListTotal = bmsshipDetailsOrderSerivce.getDetailsOrderList(mapValue);
-        }
         PageHelper.startPage(pageNum, pageSize);
         //分页查询数据
         List<Map<String, Object>> columnList = bmsshipDetailsOrderSerivce.getDetailsOrderList(mapValue);
-        PageListAdd data = columnDataUtil.tableColumnData(apiId, detailListTotal, columnList);
+        PageListAdd data = columnDataUtil.tableColumnData(apiId, null, columnList);
         return success(data);
     }
 

+ 21 - 0
src/main/java/com/steerinfo/dil/controller/BmsshipStatementController.java

@@ -149,6 +149,9 @@ public class BmsshipStatementController extends BaseRESTfulController {
         return success(data);
     }
 
+
+
+
     /**
      * 生成水运费账单
      * @param mapList
@@ -165,6 +168,24 @@ public class BmsshipStatementController extends BaseRESTfulController {
         return success(code1);
     }
 
+
+
+    /**
+     * 生成水运费账单
+     * @param map
+     * @return
+     * @throws Exception
+     */
+    @ApiModelProperty(value = "生成水运费实体")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "mapList", value = "详单列表", required = false, dataType = "java.util.List"),
+    })
+    @PostMapping("/addwaterStatement")
+    public RESTfulResult addwaterStatement(@RequestBody Map<String,Object> map) throws Exception {
+        int code1 = bmsshipStatementService.addwaterStatement(map);
+        return success(code1);
+    }
+
     /**
      * 生成水分质检账单
      * @param mapList

+ 47 - 76
src/main/java/com/steerinfo/dil/model/BmsshipFee.java

@@ -8,121 +8,74 @@ import java.util.Date;
 
 @ApiModel(value="null")
 public class BmsshipFee implements IBasePO<BigDecimal> {
-    /**
-     * 主键id(RESULT_ID,DECIMAL,38)
-     */
-    @ApiModelProperty(value="主键id",required=true)
+    @ApiModelProperty(value="",required=true)
     private BigDecimal resultId;
 
-    /**
-     * 费用(FEE,DECIMAL,38)
-     */
-    @ApiModelProperty(value="费用",required=false)
+    @ApiModelProperty(value="",required=false)
     private BigDecimal fee;
 
-    /**
-     * 费用类型(1:二程船水运费;2:二程船装卸费;
-     3:三程船水运费;4:三程船装卸费;5:水分检测费;
-     6:进口矿火运费;7:国产矿火运费)(FEE_TYPE,DECIMAL,38)
-     */
-    @ApiModelProperty(value="费用类型(1:二程船水运费;2:二程船装卸费;3:三程船水运费;4:三程船装卸费;5:水分检测费;6:进口矿火运费;7:国产矿火运费)",required=false)
+    @ApiModelProperty(value="",required=false)
     private BigDecimal feeType;
 
-    /**
-     * 采购订单ID(PURCHASE_ORDER_ID,DECIMAL,38)
-     */
-    @ApiModelProperty(value="采购订单ID",required=false)
+    @ApiModelProperty(value="",required=false)
     private BigDecimal purchaseOrderId;
 
-    /**
-     * 批次ID(BATCH_ID,DECIMAL,38)
-     */
-    @ApiModelProperty(value="批次ID",required=false)
+    @ApiModelProperty(value="",required=false)
     private BigDecimal batchId;
 
-    /**
-     * 实装吨位(REAL_TONNAGE,DECIMAL,38)
-     */
-    @ApiModelProperty(value="实装吨位",required=false)
+    @ApiModelProperty(value="",required=false)
     private BigDecimal realTonnage;
 
-    /**
-     * 单价(UNIT_PRICE,DECIMAL,38)
-     */
-    @ApiModelProperty(value="单价",required=false)
+    @ApiModelProperty(value="",required=false)
     private BigDecimal unitPrice;
 
-    /**
-     * 单价ID(UNIT_PRICE_ID,DECIMAL,38)
-     */
-    @ApiModelProperty(value="单价ID",required=false)
+    @ApiModelProperty(value="",required=false)
     private BigDecimal unitPriceId;
 
-    /**
-     * 备注(RESULT_REMARKS,VARCHAR,100)
-     */
-    @ApiModelProperty(value="备注",required=false)
+    @ApiModelProperty(value="",required=false)
     private String resultRemarks;
 
-    /**
-     * 记录创建人(INSERT_USERNAME,VARCHAR,20)
-     */
-    @ApiModelProperty(value="记录创建人",required=false)
+    @ApiModelProperty(value="",required=false)
     private String insertUsername;
 
-    /**
-     * 记录创建时间(INSERT_TIME,TIMESTAMP,7)
-     */
-    @ApiModelProperty(value="记录创建时间",required=false)
+    @ApiModelProperty(value="",required=false)
     private Date insertTime;
 
-    /**
-     * 记录修改人(UPDATE_USERNAME,VARCHAR,20)
-     */
-    @ApiModelProperty(value="记录修改人",required=false)
+    @ApiModelProperty(value="",required=false)
     private String updateUsername;
 
-    /**
-     * 记录修改时间(UPDATE_TIME,TIMESTAMP,7)
-     */
-    @ApiModelProperty(value="记录修改时间",required=false)
+    @ApiModelProperty(value="",required=false)
     private Date updateTime;
 
-    /**
-     * 记录创建或修改备注(INSERT_UPDATE_REMARK,VARCHAR,100)
-     */
-    @ApiModelProperty(value="记录创建或修改备注",required=false)
+    @ApiModelProperty(value="",required=false)
     private String insertUpdateRemark;
 
-    /**
-     * 是否删除(DELETED,DECIMAL,0)
-     */
-    @ApiModelProperty(value="是否删除",required=false)
+    @ApiModelProperty(value="",required=false)
     private BigDecimal deleted;
 
-    /**
-     * 水运单图片(IMAGE,VARCHAR,255)
-     */
-    @ApiModelProperty(value="水运单图片",required=false)
+    @ApiModelProperty(value="",required=false)
     private String image;
 
-    /**
-     * 车皮数量(WAGON_NUMBER,DECIMAL,38)
-     */
-    @ApiModelProperty(value="车皮数量",required=false)
+    @ApiModelProperty(value="",required=false)
     private BigDecimal wagonNumber;
 
+    @ApiModelProperty(value="",required=false)
+    private Date makeTime;
+
+    @ApiModelProperty(value="",required=false)
+    private BigDecimal portId;
+
     /**
-     * 开票日期(MAKE_TIME,TIMESTAMP,7)
+     * 港口数(PORT_NUM,DECIMAL,0)
      */
-    @ApiModelProperty(value="开票日期",required=false)
-    private Date makeTime;
+    @ApiModelProperty(value="港口数",required=false)
+    private BigDecimal portNum;
 
     /**
-     * 港口ID(PORT_ID,DECIMAL,38)
+     * 船数(SHIP_NUM,DECIMAL,0)
      */
-    @ApiModelProperty(value="港口ID",required=false)
-    private BigDecimal portId;
+    @ApiModelProperty(value="船数",required=false)
+    private BigDecimal shipNum;
 
     private static final long serialVersionUID = 1L;
 
@@ -288,6 +241,22 @@ public class BmsshipFee implements IBasePO<BigDecimal> {
         this.portId = portId;
     }
 
+    public BigDecimal getPortNum() {
+        return portNum;
+    }
+
+    public void setPortNum(BigDecimal portNum) {
+        this.portNum = portNum;
+    }
+
+    public BigDecimal getShipNum() {
+        return shipNum;
+    }
+
+    public void setShipNum(BigDecimal shipNum) {
+        this.shipNum = shipNum;
+    }
+
     @Override
     public String toString() {
         StringBuilder sb = new StringBuilder();
@@ -313,6 +282,8 @@ public class BmsshipFee implements IBasePO<BigDecimal> {
         sb.append(", wagonNumber=").append(wagonNumber);
         sb.append(", makeTime=").append(makeTime);
         sb.append(", portId=").append(portId);
+        sb.append(", portNum=").append(portNum);
+        sb.append(", shipNum=").append(shipNum);
         sb.append(", serialVersionUID=").append(serialVersionUID);
         sb.append("]");
         return sb.toString();

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

@@ -83,6 +83,6 @@ public interface IBmsshipStatementService {
      */
     List<Map<String,Object>> getBatch(Map<String,Object> mapVal);
 
-
-
+   //生成水运费
+    int addwaterStatement(Map<String, Object> map);
 }

+ 42 - 0
src/main/java/com/steerinfo/dil/service/impl/BmsshipStatementServiceImpl.java

@@ -1,10 +1,13 @@
 package com.steerinfo.dil.service.impl;
 
+import com.steerinfo.dil.mapper.BmsshipFeeMapper;
 import com.steerinfo.dil.mapper.BmsshipStatementMapper;
 import com.steerinfo.dil.model.BmsshipDetailsOrder;
 import com.steerinfo.dil.model.BmsshipDetailsStatement;
+import com.steerinfo.dil.model.BmsshipFee;
 import com.steerinfo.dil.model.BmsshipStatement;
 import com.steerinfo.dil.service.IBmsshipStatementService;
+import com.steerinfo.dil.util.DataChange;
 import com.steerinfo.dil.util.NoUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -32,6 +35,8 @@ public class BmsshipStatementServiceImpl implements IBmsshipStatementService {
     BmstruckFormulaServiceImpl bmstruckFormulaService;
     @Autowired
     NoUtil noUtil;
+    @Autowired
+    BmsshipFeeMapper bmsshipFeeMapper;
 
     /**
      * 生成水运费账单
@@ -95,6 +100,7 @@ public class BmsshipStatementServiceImpl implements IBmsshipStatementService {
      */
     public int insertWaterFeesStatement(List<Map<String,Object>> mapList) throws Exception {
         // 生成水运费账单
+
         BmsshipStatement bmsshipStatement = new BmsshipStatement();
         BigDecimal statementId = selectMaxId();
         bmsshipStatement.setStatementId(statementId);
@@ -237,4 +243,40 @@ public class BmsshipStatementServiceImpl implements IBmsshipStatementService {
     public List<Map<String, Object>> getBatch(Map<String, Object> mapVal) {
         return bmsshipStatementMapper.getBatch(mapVal);
     }
+
+    @Override
+    public int addwaterStatement(Map<String, Object> map) {
+        BigDecimal fee=null;
+        String userId =(String) map.get("userId");
+        BigDecimal portNum = DataChange.dataToBigDecimal(map.get("portNum"));
+        BigDecimal shipNum =DataChange.dataToBigDecimal(map.get("shipNum"));
+        BigDecimal unitPrice =DataChange.dataToBigDecimal(map.get("unitPrice"));
+        BigDecimal unitPriceId =DataChange.dataToBigDecimal(map.get("unitPriceId"));
+        BigDecimal feeType =DataChange.dataToBigDecimal(map.get("feeType"));
+        BigDecimal batchId =DataChange.dataToBigDecimal(map.get("batchId"));
+        BigDecimal purchaseOrderId =DataChange.dataToBigDecimal(map.get("purchaseOrderId"));
+        BmsshipFee bmsshipFee =new BmsshipFee();
+        if (shipNum!=null&&shipNum.intValue()!=0){
+            //无拼装
+            fee=shipNum.multiply(unitPrice);
+            bmsshipFee.setShipNum(shipNum);
+        }else if (portNum!=null&&portNum.intValue()!=0){
+            fee=portNum.multiply(unitPrice);
+            bmsshipFee.setPortNum(portNum);
+        }
+        bmsshipFee.setResultId(bmsshipFeeMapper.MaxId());
+        bmsshipFee.setFeeType(feeType);
+        bmsshipFee.setUnitPriceId(unitPriceId);
+        bmsshipFee.setFee(fee);
+        bmsshipFee.setDeleted(new BigDecimal(0));
+        bmsshipFee.setPurchaseOrderId(purchaseOrderId);
+        bmsshipFee.setUnitPrice(unitPrice);
+        bmsshipFee.setInsertUsername(userId);
+        bmsshipFee.setInsertTime(new Date());
+        bmsshipFee.setBatchId(batchId);
+        long makeTime =(long) map.get("makeTime");
+        bmsshipFee.setMakeTime(new Date(makeTime));
+        bmsshipFee.setInsertUpdateRemark("水分检测费");
+        return bmsshipFeeMapper.insertSelective(bmsshipFee);
+    }
 }

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

@@ -17,8 +17,8 @@ openFeign:
 piction:
   # path: /usr/share/nginx/html/image
   #  path: /test/data/nginx/html/image
-#   path: C:\Users\zx\Pictures\test
-  path: /shared
+   path: C:\Users\zx\Pictures\test
+#  path: /shared
 server:
   port: 8078
 

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

@@ -499,6 +499,8 @@
                BCP.CONTRACT_NO "contractNo",
                DB.RESULT_FOREIGN_SHIP_NAME "resultForeignShipName",
                RM.MATERIAL_NAME "materialName",
+               BF.PORT_NUM "portNum",
+               BF.SHIP_NUM "shipNum",
                BF.FEE "fee",
               (case
                WHEN  BF.FEE_TYPE = 1 then '二程船水运费'

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

@@ -568,6 +568,10 @@
         ON rs.SHIPPER_ID = apo.RECEIVE_UNIT_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 AMSSHIP_DELIVERY_NOTICE adn
+        on adn.BATCH_ID = dbi.BATCH_INFACOTRY_ID
         LEFT JOIN RMS_MATERIAL rm
         ON rm.MATERIAL_ID = db.MATERIAL_ID
         LEFT JOIN OMSSHIP_SHIPMENT_INSTRUCTIONS osi
@@ -582,8 +586,6 @@
         ON tlsr.LOCATION_START_PORT_ID = srp.PORT_ID
         LEFT JOIN RMS_PORT erp
         ON tlsr.ARRIVAL_PORT_ID = erp.PORT_ID
-        LEFT JOIN AMSTRUCK_PURPLAN ap
-        ON ap.BATCH_ID = db.BATCH_ID
         LEFT JOIN TMSTRUCK_WEIGHT_RESULT twr
         ON twr.RESULT_TOTAL_ID = bdo.TRUCK_RESULT_TOTAL_ID
         )

+ 91 - 37
src/main/resources/com/steerinfo/dil/mapper/BmsshipFeeMapper.xml

@@ -21,23 +21,26 @@
     <result column="WAGON_NUMBER" jdbcType="DECIMAL" property="wagonNumber" />
     <result column="MAKE_TIME" jdbcType="TIMESTAMP" property="makeTime" />
     <result column="PORT_ID" jdbcType="DECIMAL" property="portId" />
+    <result column="PORT_NUM" jdbcType="DECIMAL" property="portNum" />
+    <result column="SHIP_NUM" jdbcType="DECIMAL" property="shipNum" />
   </resultMap>
   <sql id="columns">
     RESULT_ID, FEE, FEE_TYPE, PURCHASE_ORDER_ID, BATCH_ID, REAL_TONNAGE, UNIT_PRICE,
     UNIT_PRICE_ID, RESULT_REMARKS, INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME,
-    INSERT_UPDATE_REMARK, DELETED, IMAGE, WAGON_NUMBER, MAKE_TIME, PORT_ID
+    INSERT_UPDATE_REMARK, DELETED, IMAGE, WAGON_NUMBER, MAKE_TIME, PORT_ID, PORT_NUM,
+    SHIP_NUM
   </sql>
   <sql id="columns_alias">
     t.RESULT_ID, t.FEE, t.FEE_TYPE, t.PURCHASE_ORDER_ID, t.BATCH_ID, t.REAL_TONNAGE,
     t.UNIT_PRICE, t.UNIT_PRICE_ID, t.RESULT_REMARKS, t.INSERT_USERNAME, t.INSERT_TIME,
     t.UPDATE_USERNAME, t.UPDATE_TIME, t.INSERT_UPDATE_REMARK, t.DELETED, t.IMAGE, t.WAGON_NUMBER,
-    t.MAKE_TIME, t.PORT_ID
+    t.MAKE_TIME, t.PORT_ID, t.PORT_NUM, t.SHIP_NUM
   </sql>
   <sql id="select">
-    SELECT <include refid="columns"/> FROM BMSSHIP_FEE
+    SELECT <include refid="columns" /> FROM BMSSHIP_FEE
   </sql>
   <sql id="select_alias">
-    SELECT <include refid="columns_alias"/> FROM BMSSHIP_FEE t
+    SELECT <include refid="columns_alias" /> FROM BMSSHIP_FEE t
   </sql>
   <sql id="where">
     <where>
@@ -98,6 +101,12 @@
       <if test="portId != null">
         and PORT_ID = #{portId}
       </if>
+      <if test="portNum != null">
+        and PORT_NUM = #{portNum}
+      </if>
+      <if test="shipNum != null">
+        and SHIP_NUM = #{shipNum}
+      </if>
     </where>
   </sql>
   <sql id="whereLike">
@@ -159,9 +168,15 @@
       <if test="portId != null">
         and PORT_ID = #{portId}
       </if>
+      <if test="portNum != null">
+        and PORT_NUM = #{portNum}
+      </if>
+      <if test="shipNum != null">
+        and SHIP_NUM = #{shipNum}
+      </if>
     </where>
   </sql>
-  <delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Short">
     delete from BMSSHIP_FEE
     where RESULT_ID = #{resultId,jdbcType=DECIMAL}
   </delete>
@@ -222,6 +237,12 @@
     <if test="portId != null">
       or PORT_ID = #{portId}
     </if>
+    <if test="portNum != null">
+      or PORT_NUM = #{portNum}
+    </if>
+    <if test="shipNum != null">
+      or SHIP_NUM = #{shipNum}
+    </if>
   </delete>
   <insert id="insert" parameterType="com.steerinfo.dil.model.BmsshipFee">
     insert into BMSSHIP_FEE (RESULT_ID, FEE, FEE_TYPE,
@@ -230,14 +251,16 @@
                              INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME,
                              UPDATE_TIME, INSERT_UPDATE_REMARK, DELETED,
                              IMAGE, WAGON_NUMBER, MAKE_TIME,
-                             PORT_ID)
+                             PORT_ID, PORT_NUM, SHIP_NUM
+    )
     values (#{resultId,jdbcType=DECIMAL}, #{fee,jdbcType=DECIMAL}, #{feeType,jdbcType=DECIMAL},
             #{purchaseOrderId,jdbcType=DECIMAL}, #{batchId,jdbcType=DECIMAL}, #{realTonnage,jdbcType=DECIMAL},
             #{unitPrice,jdbcType=DECIMAL}, #{unitPriceId,jdbcType=DECIMAL}, #{resultRemarks,jdbcType=VARCHAR},
             #{insertUsername,jdbcType=VARCHAR}, #{insertTime,jdbcType=TIMESTAMP}, #{updateUsername,jdbcType=VARCHAR},
             #{updateTime,jdbcType=TIMESTAMP}, #{insertUpdateRemark,jdbcType=VARCHAR}, #{deleted,jdbcType=DECIMAL},
             #{image,jdbcType=VARCHAR}, #{wagonNumber,jdbcType=DECIMAL}, #{makeTime,jdbcType=TIMESTAMP},
-            #{portId,jdbcType=DECIMAL})
+            #{portId,jdbcType=DECIMAL}, #{portNum,jdbcType=DECIMAL}, #{shipNum,jdbcType=DECIMAL}
+           )
   </insert>
   <insert id="insertSelective" parameterType="com.steerinfo.dil.model.BmsshipFee">
     insert into BMSSHIP_FEE
@@ -299,6 +322,12 @@
       <if test="portId != null">
         PORT_ID,
       </if>
+      <if test="portNum != null">
+        PORT_NUM,
+      </if>
+      <if test="shipNum != null">
+        SHIP_NUM,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
       <if test="resultId != null">
@@ -358,6 +387,12 @@
       <if test="portId != null">
         #{portId,jdbcType=DECIMAL},
       </if>
+      <if test="portNum != null">
+        #{portNum,jdbcType=DECIMAL},
+      </if>
+      <if test="shipNum != null">
+        #{shipNum,jdbcType=DECIMAL},
+      </if>
     </trim>
   </insert>
   <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.BmsshipFee">
@@ -379,7 +414,9 @@
         IMAGE = #{image,jdbcType=VARCHAR},
         WAGON_NUMBER = #{wagonNumber,jdbcType=DECIMAL},
         MAKE_TIME = #{makeTime,jdbcType=TIMESTAMP},
-        PORT_ID = #{portId,jdbcType=DECIMAL}
+        PORT_ID = #{portId,jdbcType=DECIMAL},
+        PORT_NUM = #{portNum,jdbcType=DECIMAL},
+        SHIP_NUM = #{shipNum,jdbcType=DECIMAL}
     where RESULT_ID = #{resultId,jdbcType=DECIMAL}
   </update>
   <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.BmsshipFee">
@@ -439,20 +476,26 @@
       <if test="portId != null">
         PORT_ID = #{portId,jdbcType=DECIMAL},
       </if>
+      <if test="portNum != null">
+        PORT_NUM = #{portNum,jdbcType=DECIMAL},
+      </if>
+      <if test="shipNum != null">
+        SHIP_NUM = #{shipNum,jdbcType=DECIMAL},
+      </if>
     </set>
     where RESULT_ID = #{resultId,jdbcType=DECIMAL}
   </update>
-  <select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap">
-    <include refid="select"/>
+  <select id="selectByPrimaryKey" parameterType="java.lang.Short" resultMap="BaseResultMap">
+    <include refid="select" />
     where RESULT_ID = #{resultId,jdbcType=DECIMAL}
   </select>
   <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
-    <include refid="select"/>
-    <include refid="where"/>
+    <include refid="select" />
+    <include refid="where" />
   </select>
   <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
-    <include refid="select"/>
-    <include refid="whereLike"/>
+    <include refid="select" />
+    <include refid="whereLike" />
   </select>
   <insert id="batchInsert" parameterType="java.util.List">
     insert into BMSSHIP_FEE
@@ -463,7 +506,8 @@
     INSERT_TIME, UPDATE_USERNAME,
     UPDATE_TIME, INSERT_UPDATE_REMARK,
     DELETED, IMAGE, WAGON_NUMBER,
-    MAKE_TIME, PORT_ID)
+    MAKE_TIME, PORT_ID, PORT_NUM,
+    SHIP_NUM)
     ( <foreach collection="list" item="item" separator="union all">
     select
     #{item.resultId,jdbcType=DECIMAL},
@@ -473,97 +517,106 @@
     #{item.insertTime,jdbcType=TIMESTAMP}, #{item.updateUsername,jdbcType=VARCHAR},
     #{item.updateTime,jdbcType=TIMESTAMP}, #{item.insertUpdateRemark,jdbcType=VARCHAR},
     #{item.deleted,jdbcType=DECIMAL}, #{item.image,jdbcType=VARCHAR}, #{item.wagonNumber,jdbcType=DECIMAL},
-    #{item.makeTime,jdbcType=TIMESTAMP}, #{item.portId,jdbcType=DECIMAL} from dual
+    #{item.makeTime,jdbcType=TIMESTAMP}, #{item.portId,jdbcType=DECIMAL}, #{item.portNum,jdbcType=DECIMAL},
+    #{item.shipNum,jdbcType=DECIMAL} from dual
   </foreach> )
   </insert>
   <update id="batchUpdate" parameterType="java.util.List">
     update BMSSHIP_FEE
     set
     RESULT_ID=
-    <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
+    <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
       when #{item.resultId,jdbcType=DECIMAL} then #{item.resultId,jdbcType=DECIMAL}
     </foreach>
     ,FEE=
-    <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
+    <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
       when #{item.resultId,jdbcType=DECIMAL} then #{item.fee,jdbcType=DECIMAL}
     </foreach>
     ,FEE_TYPE=
-    <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
+    <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
       when #{item.resultId,jdbcType=DECIMAL} then #{item.feeType,jdbcType=DECIMAL}
     </foreach>
     ,PURCHASE_ORDER_ID=
-    <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
+    <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
       when #{item.resultId,jdbcType=DECIMAL} then #{item.purchaseOrderId,jdbcType=DECIMAL}
     </foreach>
     ,BATCH_ID=
-    <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
+    <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
       when #{item.resultId,jdbcType=DECIMAL} then #{item.batchId,jdbcType=DECIMAL}
     </foreach>
     ,REAL_TONNAGE=
-    <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
+    <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
       when #{item.resultId,jdbcType=DECIMAL} then #{item.realTonnage,jdbcType=DECIMAL}
     </foreach>
     ,UNIT_PRICE=
-    <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
+    <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
       when #{item.resultId,jdbcType=DECIMAL} then #{item.unitPrice,jdbcType=DECIMAL}
     </foreach>
     ,UNIT_PRICE_ID=
-    <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
+    <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
       when #{item.resultId,jdbcType=DECIMAL} then #{item.unitPriceId,jdbcType=DECIMAL}
     </foreach>
     ,RESULT_REMARKS=
-    <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
+    <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
       when #{item.resultId,jdbcType=DECIMAL} then #{item.resultRemarks,jdbcType=VARCHAR}
     </foreach>
     ,INSERT_USERNAME=
-    <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
+    <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
       when #{item.resultId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
     </foreach>
     ,INSERT_TIME=
-    <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
+    <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
       when #{item.resultId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
     </foreach>
     ,UPDATE_USERNAME=
-    <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
+    <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
       when #{item.resultId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
     </foreach>
     ,UPDATE_TIME=
-    <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
+    <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
       when #{item.resultId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
     </foreach>
     ,INSERT_UPDATE_REMARK=
-    <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
+    <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
       when #{item.resultId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
     </foreach>
     ,DELETED=
-    <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
+    <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
       when #{item.resultId,jdbcType=DECIMAL} then #{item.deleted,jdbcType=DECIMAL}
     </foreach>
     ,IMAGE=
-    <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
+    <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
       when #{item.resultId,jdbcType=DECIMAL} then #{item.image,jdbcType=VARCHAR}
     </foreach>
     ,WAGON_NUMBER=
-    <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
+    <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
       when #{item.resultId,jdbcType=DECIMAL} then #{item.wagonNumber,jdbcType=DECIMAL}
     </foreach>
     ,MAKE_TIME=
-    <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
+    <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
       when #{item.resultId,jdbcType=DECIMAL} then #{item.makeTime,jdbcType=TIMESTAMP}
     </foreach>
     ,PORT_ID=
-    <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
+    <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
       when #{item.resultId,jdbcType=DECIMAL} then #{item.portId,jdbcType=DECIMAL}
     </foreach>
+    ,PORT_NUM=
+    <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.portNum,jdbcType=DECIMAL}
+    </foreach>
+    ,SHIP_NUM=
+    <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.shipNum,jdbcType=DECIMAL}
+    </foreach>
     where RESULT_ID in
-    <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
+    <foreach close=")" collection="list" index="index" item="item" open="(" separator=",">
       #{item.resultId,jdbcType=DECIMAL}
     </foreach>
   </update>
   <delete id="batchDelete" parameterType="java.util.List">
     delete from BMSSHIP_FEE
     where RESULT_ID in
-    <foreach collection="list" item="id" open="(" close=")" separator=",">
+    <foreach close=")" collection="list" item="id" open="(" separator=",">
       #{id}
     </foreach>
   </delete>
@@ -576,4 +629,5 @@
     WHERE  RP.PERSONNEL_SSO_ID =#{userId}
   </select>
 
+
 </mapper>

+ 14 - 12
src/main/resources/com/steerinfo/dil/mapper/BmsshipStatementMapper.xml

@@ -651,19 +651,24 @@
         db.BATCH_ID as "batchId",
         apo.PURCHASE_ORDER_NO as "purchaseOrderNo",
         db.RESULT_FOREIGN_SHIP_NAME as "foreignShipName",
+                        APO.PURCHASE_ORDER_ID "purchaseOrderId",
         rm.MATERIAL_NAME as "materialName",
-        srp.PORT_NAME as "startPort",
         rc.CAPACITY_NUMBER as "capacityName",
-        arp.PORT_NAME as "arrivalPort",
         tlsr.RESULT_ACTUAL_INSTALLATIONS as "loadWeight",
         tlsr.RESULT_LOAD_SHIP_DATE as "insertTime",
         twqr.RESULT_WATER_TONNAGE as "waterWeight",
-        twqr.RESULT_INSPECTION_FEES as "inspectionFees"
-        FROM AMS_PURCHASE_ORDER apo
+        twqr.RESULT_INSPECTION_FEES as "inspectionFees",
+        twqr.IS_NEED_ASSEMBLE "isneedAssemble"
+        FROM OMSSHIP_SHIPMENT_INSTRUCTIONS osi
+
+        left join DIL_BATCH_INFACOTRY dbi
+        on dbi.BATCH_INFACOTRY_ID = osi.batch_id
         LEFT JOIN DIL_BATCH db
-        ON apo.BATCH_ID = db.BATCH_ID
+        ON dbi.BATCH_ID = db.BATCH_ID
+        left join AMS_PURCHASE_ORDER APO
+        ON APO.BATCH_ID = DB.BATCH_ID
         LEFT JOIN OMSSHIP_SHIPMENT_INSTRUCTIONS osi
-        ON osi.BATCH_ID = db.BATCH_ID
+        ON osi.BATCH_ID = dbi.batch_infacotry_id
         LEFT JOIN OMSSHIP_INSTRUCTIONS_CAPACITY oic
         ON oic.INSTRUCTIONS_ID = osi.SHIPMENT_INSTRUCTIONS_ID
         LEFT JOIN RMS_CAPACITY rc
@@ -676,11 +681,6 @@
         ON ttr.RESULT_ID = tlsr.TOTAL_RESULT_ID
         LEFT JOIN TMSSHIP_WATER_QUALITY_RESULT twqr
         ON ttr.RESULT_ID = twqr.TOTAL_RESULT_ID
-        LEFT JOIN RMS_PORT srp
-        ON tlsr.LOCATION_START_PORT_ID = srp.PORT_ID
-        LEFT JOIN RMS_PORT arp
-        ON tlsr.ARRIVAL_PORT_ID = arp.PORT_ID
-        WHERE db.BATCH_ID = #{batchId}
         )
         <where>
             <if test="purchaseOrderNo!= null">
@@ -807,8 +807,10 @@
         ON ttr.ORDER_ID = oic.INSTRUCTIONS_CAPACITY_ID
         LEFT JOIN OMSSHIP_SHIPMENT_INSTRUCTIONS osi
         ON oic.INSTRUCTIONS_ID = osi.SHIPMENT_INSTRUCTIONS_ID
+       left join DIL_BATCH_INFACOTRY DBI
+        ON DBI.BATCH_INFACOTRY_ID =  osi.BATCH_ID
         LEFT JOIN DIL_BATCH db
-        ON osi.BATCH_ID = db.BATCH_ID
+        ON DBI.BATCH_ID = db.BATCH_ID
         LEFT JOIN AMS_PURCHASE_ORDER apo
         ON apo.BATCH_ID = db.BATCH_ID
         LEFT JOIN RMS_MATERIAL rm