zx 2 years ago
parent
commit
0c6269165d

+ 14 - 0
src/main/java/com/steerinfo/dil/controller/DilBatchController.java

@@ -155,4 +155,18 @@ public class DilBatchController extends BaseRESTfulController {
     public RESTfulResult  getPersonByName(@RequestParam(value ="personName")String personName){
         return success(dilBatchService.getPersonByName(personName));
     }
+
+
+
+
+
+    //根据用户输入提货联系人模糊查询提货联系人、提货人身份证号、联系电话
+    @ApiOperation(value="根据用户在发货通知输入的提货联系人模糊查询提货联系人", notes="模糊查询")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "con",value = "用户输入的联系人", required = false, dataType = "String")
+    })
+    @PostMapping("/getNoticeContactNumberByPerson")
+    public RESTfulResult  getNoticeContactNumberByPerson(@RequestParam(value ="personName")String personName){
+        return success(dilBatchService.getNoticeContactNumberByPerson(personName));
+    }
 }

+ 9 - 0
src/main/java/com/steerinfo/dil/mapper/DilBatchMapper.java

@@ -27,9 +27,15 @@ public interface DilBatchMapper extends IBaseMapper<DilBatch, Short> {
     //根据用户输入提货联系人模糊查询提货联系人、提货人身份证号、联系电话
     Map<String,Object> getPersonByName(String personName);
 
+
+
+
     //根据外轮船名和物资名称以及进厂船名查找新增批次是否存在
     BigDecimal selectBatchIdByName(Map<String,Object> map);
 
+    //根据portId查找portName
+    String getPortName(BigDecimal portId);
+
     //根据外轮船名和物资名称查找批次主表id是否存在
     List<Map<String,Object>> selectBatchIdByForeign(Map<String,Object> map);
 
@@ -37,4 +43,7 @@ public interface DilBatchMapper extends IBaseMapper<DilBatch, Short> {
 
     //为装船指令查询批次展示列表
     List<Map<String, Object>> getBatchListForInstruction(Map<String, Object> map);
+
+//    根据发货通知的用户姓名查找用户联系方式
+    Map<String, Object> getNoticeContactNumberByPerson(String personName);
 }

+ 16 - 0
src/main/java/com/steerinfo/dil/model/AmsshipDeliveryNotice.java

@@ -1,4 +1,5 @@
 package com.steerinfo.dil.model;
+
 import com.steerinfo.framework.model.IBasePO;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
@@ -229,6 +230,12 @@ public class AmsshipDeliveryNotice implements IBasePO<BigDecimal> {
     @ApiModelProperty(value="是否需要宁波保税",required=false)
     private String isNeedBonded;
 
+    /**
+     * S含量(SULFUR_CONTENT,VARCHAR,20)
+     */
+    @ApiModelProperty(value="S含量",required=false)
+    private String sulfurContent;
+
     private static final long serialVersionUID = 1L;
 
     @Override
@@ -537,6 +544,14 @@ public class AmsshipDeliveryNotice implements IBasePO<BigDecimal> {
         this.isNeedBonded = isNeedBonded == null ? null : isNeedBonded.trim();
     }
 
+    public String getSulfurContent() {
+        return sulfurContent;
+    }
+
+    public void setSulfurContent(String sulfurContent) {
+        this.sulfurContent = sulfurContent == null ? null : sulfurContent.trim();
+    }
+
     @Override
     public String toString() {
         StringBuilder sb = new StringBuilder();
@@ -580,6 +595,7 @@ public class AmsshipDeliveryNotice implements IBasePO<BigDecimal> {
         sb.append(", cargoId=").append(cargoId);
         sb.append(", cargoImageUrl=").append(cargoImageUrl);
         sb.append(", isNeedBonded=").append(isNeedBonded);
+        sb.append(", sulfurContent=").append(sulfurContent);
         sb.append(", serialVersionUID=").append(serialVersionUID);
         sb.append("]");
         return sb.toString();

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

@@ -43,4 +43,6 @@ public interface IDilBatchService {
 
     List<Map<String, Object>> getBatchIdByForeign(Map<String, Object> mapValue);
 
+//    根据发货通知的用户名查找用户联系方式
+    Map<String,Object> getNoticeContactNumberByPerson(String personName);
 }

+ 19 - 16
src/main/java/com/steerinfo/dil/service/impl/AmsshipDeliveryNoticeServiceImpl.java

@@ -61,6 +61,7 @@ public class AmsshipDeliveryNoticeServiceImpl implements IAmsshipDeliveryNoticeS
     @Transactional(rollbackFor = {Exception.class})
     public int insert(Map<String,Object> map) throws Exception{
         int i=0;
+        String inFactoryShipName=null;
         AmsshipDeliveryNotice amsshipDeliveryNotice=new AmsshipDeliveryNotice();
         String userId =(String) map.get("userId");
         String userName=null;
@@ -76,6 +77,7 @@ public class AmsshipDeliveryNoticeServiceImpl implements IAmsshipDeliveryNoticeS
             amsshipDeliveryNotice.setPortId(DataChange.dataToBigDecimal(map.get("portId")));
         }
 
+
         if (map.get("noticePortConstructionFee")!=null) {
             amsshipDeliveryNotice.setNoticePortConstructionFee(DataChange.dataToBigDecimal(map.get("noticePortConstructionFee")));
         }
@@ -112,6 +114,10 @@ public class AmsshipDeliveryNoticeServiceImpl implements IAmsshipDeliveryNoticeS
         if (map.get("manganeseContent")!=null){
             amsshipDeliveryNotice.setManganeseContent((String)map.get("manganeseContent"));
         }
+       //设置S含量
+        if(map.get("sulfurcontent")!=null){
+           amsshipDeliveryNotice.setSulfurContent((String) map.get("sulfurcontent"));
+        }
         amsshipDeliveryNotice.setInsertTime(new Date());
         amsshipDeliveryNotice.setInsertUsername(userId);
         amsshipDeliveryNotice.setDeleted(new BigDecimal(0));
@@ -133,22 +139,19 @@ public class AmsshipDeliveryNoticeServiceImpl implements IAmsshipDeliveryNoticeS
         amsshipDeliveryNotice.setIsNeedPortCharge((String) map.get("isNeedPortDisCharge"));
         amsshipDeliveryNotice.setCargoImageUrl((String) map.get("cargoPictureUrl"));
         //生成批次
-        //根据物资和外轮船名判断批次是否存在
-        BigDecimal batchFacotryId = dilBatchMapper.selectBatchIdByName(map);
-        //如果存在则取批次id
-        if (batchFacotryId != null && batchFacotryId.intValue() != 0){
-            amsshipDeliveryNotice.setBatchId(batchFacotryId);
-            throw new Exception("进厂船名重复,请输入唯一的进厂船名");
-        }else {
-            Map<String, Object> map1 = dilBatchService.insertBatchId(map);
-            if (map1 != null) {
-                System.out.println("新增批次成功");
-                BigDecimal batchIdInfacotryId = DataChange.dataToBigDecimal(map1.get("batchIdInfacotryId"));
-                amsshipDeliveryNotice.setBatchId(batchIdInfacotryId);
-            } else {
-                System.out.println("新增批次失败");
-            }
-        }
+        //根据portId查找portName
+        String portName = dilBatchMapper.getPortName(DataChange.dataToBigDecimal(map.get("portId")));
+        if (portName==null||portName.equals("")){
+            throw new Exception("港口不存在");
+        }
+        SimpleDateFormat sdf= new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        Date time =new Date(noticeDeliveryTime);
+        inFactoryShipName = portName + sdf.format(time);
+        map.put("inFactoryShipName",inFactoryShipName);
+         //新增批次
+        Map<String, Object> map1 = dilBatchService.insertBatchId(map);
+        BigDecimal batchIdInfacotryId =DataChange.dataToBigDecimal(map1.get("batchIdInfacotryId"));
+        amsshipDeliveryNotice.setBatchId(batchIdInfacotryId);
         i += amsshipDeliveryNoticeMapper.insertSelective(amsshipDeliveryNotice);
         return i ;
     }

+ 5 - 0
src/main/java/com/steerinfo/dil/service/impl/DilBatchServiceImpl.java

@@ -112,4 +112,9 @@ public class DilBatchServiceImpl  implements IDilBatchService {
         return dilBatchMapper.getBatchIdByForeign(mapValue);
     }
 
+    @Override
+    public Map<String, Object> getNoticeContactNumberByPerson(String personName) {
+        return dilBatchMapper.getNoticeContactNumberByPerson(personName);
+    }
+
 }

+ 2 - 1
src/main/resources/application-dev.yml

@@ -9,6 +9,7 @@ spring:
 
 piction:
   path: /shared
+#  path:C:\Users\zx\Pictures\test
 
 
 openfeign:
@@ -18,5 +19,5 @@ openfeign:
     url: ${COLUMNDATAFEIGN_URL:172.16.33.161:8083}
 
 server:
-  port: 8090
+  port: 8003
 

+ 37 - 9
src/main/resources/com/steerinfo/dil/mapper/AmsshipDeliveryNoticeMapper.xml

@@ -39,6 +39,7 @@
     <result column="CARGO_ID" jdbcType="DECIMAL" property="cargoId" />
     <result column="CARGO_IMAGE_URL" jdbcType="VARCHAR" property="cargoImageUrl" />
     <result column="IS_NEED_BONDED" jdbcType="VARCHAR" property="isNeedBonded" />
+    <result column="SULFUR_CONTENT" jdbcType="VARCHAR" property="sulfurContent" />
   </resultMap>
   <sql id="columns">
     NOTICE_ID, NOTICE_COMMERCE_METHOD, NOTICE_HANDOVER_METHOD, PORT_ID, NOTICE_PORT_CONSTRUCTION_FEE,
@@ -48,7 +49,7 @@
     SILICA_CONTENT, ALUMINA_CONTENT, PHOSPHORUS_CONTENT, MANGANESE_CONTENT, IS_NEED_PORT_FEE,
     IS_NEED_PORT_CHARGE, MATERIAL_TYPE_ID, RESULT_CONTACT_PERSON, RESULT_TELEPHONE_FAX,
     GROUP_ID, RESULT_NUMBER_OF_LOANS, RESULT_FREIGHT_FORWARDING_INFO, RESULT_MEMO, RESULT_DATE_OF_LOANS,
-    CARGO_ID, CARGO_IMAGE_URL, IS_NEED_BONDED
+    CARGO_ID, CARGO_IMAGE_URL, IS_NEED_BONDED, SULFUR_CONTENT
   </sql>
   <sql id="columns_alias">
     t.NOTICE_ID, t.NOTICE_COMMERCE_METHOD, t.NOTICE_HANDOVER_METHOD, t.PORT_ID, t.NOTICE_PORT_CONSTRUCTION_FEE,
@@ -58,7 +59,8 @@
     t.TFE_CONTENT, t.SILICA_CONTENT, t.ALUMINA_CONTENT, t.PHOSPHORUS_CONTENT, t.MANGANESE_CONTENT,
     t.IS_NEED_PORT_FEE, t.IS_NEED_PORT_CHARGE, t.MATERIAL_TYPE_ID, t.RESULT_CONTACT_PERSON,
     t.RESULT_TELEPHONE_FAX, t.GROUP_ID, t.RESULT_NUMBER_OF_LOANS, t.RESULT_FREIGHT_FORWARDING_INFO,
-    t.RESULT_MEMO, t.RESULT_DATE_OF_LOANS, t.CARGO_ID, t.CARGO_IMAGE_URL, t.IS_NEED_BONDED
+    t.RESULT_MEMO, t.RESULT_DATE_OF_LOANS, t.CARGO_ID, t.CARGO_IMAGE_URL, t.IS_NEED_BONDED,
+    t.SULFUR_CONTENT
   </sql>
   <sql id="select">
     SELECT <include refid="columns" /> FROM AMSSHIP_DELIVERY_NOTICE
@@ -179,6 +181,9 @@
       <if test="isNeedBonded != null and isNeedBonded != ''">
         and IS_NEED_BONDED = #{isNeedBonded}
       </if>
+      <if test="sulfurContent != null and sulfurContent != ''">
+        and SULFUR_CONTENT = #{sulfurContent}
+      </if>
     </where>
   </sql>
   <sql id="whereLike">
@@ -294,6 +299,9 @@
       <if test="isNeedBonded != null and isNeedBonded != ''">
         and IS_NEED_BONDED LIKE '%${isNeedBonded}%'
       </if>
+      <if test="sulfurContent != null and sulfurContent != ''">
+        and SULFUR_CONTENT LIKE '%${sulfurContent}%'
+      </if>
     </where>
   </sql>
   <delete id="deleteByPrimaryKey" parameterType="java.lang.Short">
@@ -411,6 +419,9 @@
     <if test="isNeedBonded != null and isNeedBonded != ''">
       or IS_NEED_BONDED = #{isNeedBonded}
     </if>
+    <if test="sulfurContent != null and sulfurContent != ''">
+      or SULFUR_CONTENT = #{sulfurContent}
+    </if>
   </delete>
   <insert id="insert" parameterType="com.steerinfo.dil.model.AmsshipDeliveryNotice">
     insert into AMSSHIP_DELIVERY_NOTICE (NOTICE_ID, NOTICE_COMMERCE_METHOD, NOTICE_HANDOVER_METHOD,
@@ -425,7 +436,8 @@
                                          RESULT_CONTACT_PERSON, RESULT_TELEPHONE_FAX,
                                          GROUP_ID, RESULT_NUMBER_OF_LOANS, RESULT_FREIGHT_FORWARDING_INFO,
                                          RESULT_MEMO, RESULT_DATE_OF_LOANS, CARGO_ID,
-                                         CARGO_IMAGE_URL, IS_NEED_BONDED)
+                                         CARGO_IMAGE_URL, IS_NEED_BONDED, SULFUR_CONTENT
+    )
     values (#{noticeId,jdbcType=DECIMAL}, #{noticeCommerceMethod,jdbcType=VARCHAR}, #{noticeHandoverMethod,jdbcType=VARCHAR},
             #{portId,jdbcType=DECIMAL}, #{noticePortConstructionFee,jdbcType=DECIMAL}, #{noticeDeliveryTime,jdbcType=TIMESTAMP},
             #{noticePileFreeDays,jdbcType=DECIMAL}, #{deleteName,jdbcType=VARCHAR}, #{deleteTime,jdbcType=VARCHAR},
@@ -438,7 +450,8 @@
             #{resultContactPerson,jdbcType=VARCHAR}, #{resultTelephoneFax,jdbcType=VARCHAR},
             #{groupId,jdbcType=DECIMAL}, #{resultNumberOfLoans,jdbcType=DECIMAL}, #{resultFreightForwardingInfo,jdbcType=VARCHAR},
             #{resultMemo,jdbcType=VARCHAR}, #{resultDateOfLoans,jdbcType=TIMESTAMP}, #{cargoId,jdbcType=DECIMAL},
-            #{cargoImageUrl,jdbcType=VARCHAR}, #{isNeedBonded,jdbcType=VARCHAR})
+            #{cargoImageUrl,jdbcType=VARCHAR}, #{isNeedBonded,jdbcType=VARCHAR}, #{sulfurContent,jdbcType=VARCHAR}
+           )
   </insert>
   <insert id="insertSelective" parameterType="com.steerinfo.dil.model.AmsshipDeliveryNotice">
     insert into AMSSHIP_DELIVERY_NOTICE
@@ -554,6 +567,9 @@
       <if test="isNeedBonded != null">
         IS_NEED_BONDED,
       </if>
+      <if test="sulfurContent != null">
+        SULFUR_CONTENT,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
       <if test="noticeId != null">
@@ -667,6 +683,9 @@
       <if test="isNeedBonded != null">
         #{isNeedBonded,jdbcType=VARCHAR},
       </if>
+      <if test="sulfurContent != null">
+        #{sulfurContent,jdbcType=VARCHAR},
+      </if>
     </trim>
   </insert>
   <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.AmsshipDeliveryNotice">
@@ -706,7 +725,8 @@
         RESULT_DATE_OF_LOANS = #{resultDateOfLoans,jdbcType=TIMESTAMP},
         CARGO_ID = #{cargoId,jdbcType=DECIMAL},
         CARGO_IMAGE_URL = #{cargoImageUrl,jdbcType=VARCHAR},
-        IS_NEED_BONDED = #{isNeedBonded,jdbcType=VARCHAR}
+        IS_NEED_BONDED = #{isNeedBonded,jdbcType=VARCHAR},
+        SULFUR_CONTENT = #{sulfurContent,jdbcType=VARCHAR}
     where NOTICE_ID = #{noticeId,jdbcType=DECIMAL}
   </update>
   <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.AmsshipDeliveryNotice">
@@ -820,6 +840,9 @@
       <if test="isNeedBonded != null">
         IS_NEED_BONDED = #{isNeedBonded,jdbcType=VARCHAR},
       </if>
+      <if test="sulfurContent != null">
+        SULFUR_CONTENT = #{sulfurContent,jdbcType=VARCHAR},
+      </if>
     </set>
     where NOTICE_ID = #{noticeId,jdbcType=DECIMAL}
   </update>
@@ -854,8 +877,8 @@
     RESULT_TELEPHONE_FAX, GROUP_ID,
     RESULT_NUMBER_OF_LOANS, RESULT_FREIGHT_FORWARDING_INFO,
     RESULT_MEMO, RESULT_DATE_OF_LOANS,
-    CARGO_ID, CARGO_IMAGE_URL, IS_NEED_BONDED
-    )
+    CARGO_ID, CARGO_IMAGE_URL, IS_NEED_BONDED,
+    SULFUR_CONTENT)
     ( <foreach collection="list" item="item" separator="union all">
     select
     #{item.noticeId,jdbcType=DECIMAL},
@@ -875,8 +898,8 @@
     #{item.resultTelephoneFax,jdbcType=VARCHAR}, #{item.groupId,jdbcType=DECIMAL},
     #{item.resultNumberOfLoans,jdbcType=DECIMAL}, #{item.resultFreightForwardingInfo,jdbcType=VARCHAR},
     #{item.resultMemo,jdbcType=VARCHAR}, #{item.resultDateOfLoans,jdbcType=TIMESTAMP},
-    #{item.cargoId,jdbcType=DECIMAL}, #{item.cargoImageUrl,jdbcType=VARCHAR}, #{item.isNeedBonded,jdbcType=VARCHAR}
-    from dual
+    #{item.cargoId,jdbcType=DECIMAL}, #{item.cargoImageUrl,jdbcType=VARCHAR}, #{item.isNeedBonded,jdbcType=VARCHAR},
+    #{item.sulfurContent,jdbcType=VARCHAR} from dual
   </foreach> )
   </insert>
   <update id="batchUpdate" parameterType="java.util.List">
@@ -1030,6 +1053,10 @@
     <foreach close="end" collection="list" index="index" item="item" open="case NOTICE_ID" separator=" ">
       when #{item.noticeId,jdbcType=DECIMAL} then #{item.isNeedBonded,jdbcType=VARCHAR}
     </foreach>
+    ,SULFUR_CONTENT=
+    <foreach close="end" collection="list" index="index" item="item" open="case NOTICE_ID" separator=" ">
+      when #{item.noticeId,jdbcType=DECIMAL} then #{item.sulfurContent,jdbcType=VARCHAR}
+    </foreach>
     where NOTICE_ID in
     <foreach close=")" collection="list" index="index" item="item" open="(" separator=",">
       #{item.noticeId,jdbcType=DECIMAL}
@@ -1268,4 +1295,5 @@
     WHERE ADN.NOTICE_ID=#{noticeId}
   </select>
 
+
 </mapper>

+ 22 - 0
src/main/resources/com/steerinfo/dil/mapper/DilBatchMapper.xml

@@ -419,4 +419,26 @@
     ORDER BY INSERT_TIME	desc
     FETCH NEXT 1 ROWS ONLY
   </select>
+
+
+
+
+<!--  根据港口id查找港口名称-->
+  <select id="getPortName" parameterType="java.math.BigDecimal" resultType="java.lang.String">
+    select RP.PORT_NAME "portName"
+    from RMS_PORT RP
+    WHERE  RP.PORT_ID = #{portId}
+  </select>
+
+  <select id="getNoticeContactNumberByPerson" resultType="java.util.Map">
+    SELECT DISTINCT ADN.RESULT_CONTACT_PERSON as "personName",
+                    ADN.RESULT_TELEPHONE_FAX as "personPhone",
+                    INSERT_TIME as "insertTime"
+    FROM AMSSHIP_DELIVERY_NOTICE ADN
+    WHERE ADN.RESULT_CONTACT_PERSON
+            LIKE CONCAT('%', CONCAT(#{personName}, '%'))
+    ORDER BY INSERT_TIME	desc
+      FETCH NEXT 1 ROWS ONLY
+  </select>
+
 </mapper>