Index: jinan/trunk/yunna/src/main/java/com/freshport/control/FruitShipPortControl.java
===================================================================
--- jinan/trunk/yunna/src/main/java/com/freshport/control/FruitShipPortControl.java	(revision 34921)
+++ jinan/trunk/yunna/src/main/java/com/freshport/control/FruitShipPortControl.java	(revision 34922)
@@ -12,6 +12,7 @@
 import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 
+import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.freshport.entity.JsonModel;
 import com.freshport.entity.yunna.LoadingNumberQueryParam;
@@ -122,7 +123,29 @@
         fruitShipPortService.savePortInfo(params);
         return JsonModel.success(null);
     }
+    
+    /**
+     * 
+     * savePortData(云纳回传上海港信息接口)        
+     * @param params
+     * @return  
+     * @return JsonModel<Object>  
+     * @Exception 异常对象    
+     * @author gubj  
+     * @date 2023-03-20 15:44:58
+     */
+    @PostMapping("/savePortData")
+    public JsonModel<Object> savePortData(@RequestBody String params) {
 
+    	JSONArray jsonList = JSONArray.parseArray(params);
+        if (CommonUtils.isEmpty(params) || jsonList.size() == 0) {
+            return JsonModel.errorParam(CommonEnum.PARAM_ERROR.getCode(), "参数为空");
+        }
+        // params List<List<ShipShPortResultVO>> 类型
+        fruitShipPortService.saveShPortInfo(params);
+        return JsonModel.success(null);
+    }
+
     /**
      * 
      * savePortOrShipInfo(手动调用，重新更新船司/港口信息)      
Index: jinan/trunk/yunna/src/main/java/com/freshport/dao/Mapper/ShipPortMapper.xml
===================================================================
--- jinan/trunk/yunna/src/main/java/com/freshport/dao/Mapper/ShipPortMapper.xml	(revision 34921)
+++ jinan/trunk/yunna/src/main/java/com/freshport/dao/Mapper/ShipPortMapper.xml	(revision 34922)
@@ -415,4 +415,9 @@
 		AND yspr.type = 'PORT'
 		and yspr.status in ('0')
   </select>
+  <select id="listUnloadingByPort" parameterType="java.lang.String" resultType="com.freshport.entity.yunna.UnloadingPort">
+  	SELECT id,unloading_port unloadingPort,unloading_port_code unloadingPortCode,
+  	unloading_port_short_name unloadingPortShortName,unloading_port_full_name unloadingPortFullName 
+  	from yw_ship_unloading_port where unloading_port = #{unloadingPort}
+  </select>
 </mapper>
\ No newline at end of file
Index: jinan/trunk/yunna/src/main/java/com/freshport/dao/Mapper/YwShipPortResultMapper.xml
===================================================================
--- jinan/trunk/yunna/src/main/java/com/freshport/dao/Mapper/YwShipPortResultMapper.xml	(revision 34921)
+++ jinan/trunk/yunna/src/main/java/com/freshport/dao/Mapper/YwShipPortResultMapper.xml	(revision 34922)
@@ -514,4 +514,45 @@
 			#{str} 
 	</foreach>
   </delete>
+  
+<!--   保存上海港返回数据 -->
+   <insert id="insertShPortList" parameterType="java.util.List">
+		insert into yw_port_sh_result (id,loading_number,container_number,business_no,dock,out_type,out_time,in_type,
+			in_time,cn_shipname,en_shipName,expect_arrival_time,actual_port_time,
+			actual_sailing_time,import_voyage,export_voyage,expect_anchorage_time,actual_anchorage_time,
+			data_grab_type,shipname_type,batch_no,type,state
+			)
+	   values
+	  <foreach collection ="list" item="item" index= "index" separator =",">
+	      (#{item.id,jdbcType=VARCHAR}, #{item.loadingNumber,jdbcType=VARCHAR}, #{item.containerNumber,jdbcType=VARCHAR}, 
+	       #{item.businessNo,jdbcType=VARCHAR}, #{item.dock,jdbcType=VARCHAR}, 
+	       #{item.outType,jdbcType=VARCHAR}, #{item.outTime,jdbcType=TIMESTAMP}, #{item.inType,jdbcType=VARCHAR}, 
+	       #{item.inTime,jdbcType=TIMESTAMP}, #{item.CNShipName,jdbcType=VARCHAR}, #{item.ENShipName,jdbcType=VARCHAR}, 
+	       #{item.expectArrivalTime,jdbcType=TIMESTAMP}, #{item.actualPortTime,jdbcType=TIMESTAMP}, #{item.actualSailingTime,jdbcType=TIMESTAMP}, 
+	       #{item.importVoyage,jdbcType=VARCHAR}, #{item.exportVoyage,jdbcType=VARCHAR}, #{item.expectAnchorageTime,jdbcType=TIMESTAMP}, 
+	       #{item.actualAnchorageTime,jdbcType=TIMESTAMP}, #{item.dataGrabType,jdbcType=VARCHAR}, #{item.shipNameType,jdbcType=VARCHAR}, 
+	       #{item.batchNo,jdbcType=VARCHAR}, #{item.type,jdbcType=VARCHAR}, #{item.status,jdbcType=VARCHAR})
+	  </foreach>
+  </insert>
+  <update id="updateShipShPortResult" parameterType="java.lang.String">
+    update yw_port_sh_result
+    <set>
+      <if test="loadingNumber != null">
+        state = #{state},
+      </if>
+    </set>
+    where batch_no = #{batchNo,jdbcType=VARCHAR} and business_no = #{ywbh}
+  </update>
+  <select id="queryVoyageErrorList" parameterType="java.lang.String" resultType="com.freshport.entity.yunna.ShipShPortResultVO">
+  	SELECT loading_number loadingNumber,container_number containerNumber,business_no businessNo,
+  	shipname_type shipNameType,expect_arrival_time expectArrivalTime,expect_anchorage_time expectAnchorageTime,actual_anchorage_time actualAnchorageTime
+  	 FROM yw_port_sh_result where crt_time = (select max(crt_time) from yw_port_sh_result where type = #{type} and business_no = #{ywbh}) and business_no = #{ywbh}
+  </select>
+    <!-- (根据批次号批量删除数据)   -->
+   <delete id="deleteShByBatchNoList" parameterType="java.lang.String">
+    delete from yw_port_sh_result where batch_no in 
+    <foreach collection="list"  index="index" item="str"  open="(" separator="," close=")">
+			#{str} 
+	</foreach>
+  </delete>
 </mapper>
\ No newline at end of file


Index: jinan/trunk/yunna/src/main/java/com/freshport/dao/ShipPortMapper.java
===================================================================
--- jinan/trunk/yunna/src/main/java/com/freshport/dao/ShipPortMapper.java	(revision 34921)
+++ jinan/trunk/yunna/src/main/java/com/freshport/dao/ShipPortMapper.java	(revision 34922)
@@ -9,6 +9,7 @@
 import com.freshport.entity.yunna.LoadingNumberResultVO;
 import com.freshport.entity.yunna.PortForHddzVO;
 import com.freshport.entity.yunna.ShipForHddzVO;
+import com.freshport.entity.yunna.UnloadingPort;
 
 /**
  * 
@@ -159,5 +160,7 @@
      * @version 1.0
      */
     List<PortForHddzVO> listPortInfoForHddzNew(String batchNo);
+    
+    UnloadingPort listUnloadingByPort(String unloadingPort);
 
 }
\ No newline at end of file
Index: jinan/trunk/yunna/src/main/java/com/freshport/dao/YwShipPortResultMapper.java
===================================================================
--- jinan/trunk/yunna/src/main/java/com/freshport/dao/YwShipPortResultMapper.java	(revision 34921)
+++ jinan/trunk/yunna/src/main/java/com/freshport/dao/YwShipPortResultMapper.java	(revision 34922)
@@ -5,6 +5,7 @@
 import org.apache.ibatis.annotations.Param;
 
 import com.freshport.entity.YwShipPortResult;
+import com.freshport.entity.yunna.ShipShPortResultVO;
 import com.freshport.entity.yunna.YunnaDataChackVo;
 
 public interface YwShipPortResultMapper {
@@ -15,6 +16,8 @@
     int insertSelective(YwShipPortResult record);
 
     int insertList(List<YwShipPortResult> list);
+    
+    int insertShPortList(List<ShipShPortResultVO> list);
 
     YwShipPortResult selectByPrimaryKey(String ysprId);
 
@@ -123,4 +126,29 @@
      * @version 1.0
      */
     void deleteByBatchNoList(List<String> list);
+    
+    /**
+     * 
+     * @Title:        deleteShByBatchNoList 
+     * @Description:  根据批次号删除上海港历史数据
+     * @param:        @param list    
+     * @return:       void    
+     * @author:       gubj
+     * @Date:         2023年9月5日 下午5:18:26
+     */
+    void deleteShByBatchNoList(List<String> list);
+    
+    /**
+     * 
+     * @Title:        updateShipShPortResult 
+     * @Description:  更新上海港状态
+     * @param:        @param batchNo
+     * @param:        @param state    
+     * @return:       void    
+     * @author:       gubj
+     * @Date:         2023年8月29日 上午11:23:44
+     */
+    void updateShipShPortResult(@Param("batchNo") String batchNo, @Param("ywbh") String ywbh, @Param("state") String state);
+    
+    List<ShipShPortResultVO> queryVoyageErrorList(@Param("ywbh") String ywbh, @Param("type") String type);
 }
\ No newline at end of file
Index: jinan/trunk/yunna/src/main/java/com/freshport/entity/yunna/LoadingNumberQueryParam.java
===================================================================
--- jinan/trunk/yunna/src/main/java/com/freshport/entity/yunna/LoadingNumberQueryParam.java	(revision 34921)
+++ jinan/trunk/yunna/src/main/java/com/freshport/entity/yunna/LoadingNumberQueryParam.java	(revision 34922)
@@ -31,7 +31,7 @@
 public class LoadingNumberQueryParam {
 
     /**
-     *  提单号查询类型：SHIP-船司；SHIP_TMP-船司(当天)；PORT-港口；PORT_TMP-港口(当天);
+     *  提单号查询类型：SHIP-船司；SHIP_TMP-船司(当天)；PORT-港口；PORT_TMP-港口(当天)；PORT_SH-上海港(10分钟一次)；PORT_SH_TMP-上海港(四个全天整点);
      */
     @NotBlank(message = "提单号类型不能为空")
     private String type;
Index: jinan/trunk/yunna/src/main/java/com/freshport/entity/yunna/ShipShPortResultVO.java
===================================================================
--- jinan/trunk/yunna/src/main/java/com/freshport/entity/yunna/ShipShPortResultVO.java	(revision 0)
+++ jinan/trunk/yunna/src/main/java/com/freshport/entity/yunna/ShipShPortResultVO.java	(revision 34922)
@@ -0,0 +1,139 @@
+package com.freshport.entity.yunna;
+
+import java.util.Date;
+
+import org.springframework.format.annotation.DateTimeFormat;
+
+import com.alibaba.fastjson.annotation.JSONField;
+import com.fasterxml.jackson.annotation.JsonFormat;
+
+import lombok.Data;
+
+/**
+ * 
+ *     
+ * 项目名称：yunna    
+ * 类名称：ShipShPortResultVO    
+ * 类描述：上海港 回传结果vo    
+ * 创建人：gubj    
+ * 创建时间：2023年8月23日 上午10:59:39    
+ * 修改人：gubj    
+ * 修改时间：2023年8月23日 上午10:59:39    
+ * 修改备注：    
+ * @version     
+ *
+ */
+@Data
+public class ShipShPortResultVO {
+	
+	private String id;
+
+    /**
+     *  提单号
+     */
+    private String loadingNumber;
+
+    /**
+     *  集装箱号
+     */
+    private String containerNumber;
+
+    /**
+     *  业务编号
+     */
+    private String businessNo;
+    
+    //码头
+    private String dock;
+    //出场方式
+    private String outType;
+    //出场时间
+    @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy/MM/dd HH:mm")
+    @DateTimeFormat(pattern = "yyyy/MM/dd HH:mm")
+    @JSONField(format = "yyyy/MM/dd HH:mm")
+    private Date outTime;
+    //进场方式
+    private String inType;
+    //进场时间
+    @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy/MM/dd HH:mm")
+    @DateTimeFormat(pattern = "yyyy/MM/dd HH:mm")
+    @JSONField(format = "yyyy/MM/dd HH:mm")
+    private Date inTime;
+    /**
+     *  船名-英文船名
+     */
+    private String ENShipName;
+
+    /**
+     *  船名—中文船名
+     */
+    private String CNShipName;
+
+    /**
+     *  预计靠港时间
+     */
+    @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy/MM/dd HH:mm")
+    @DateTimeFormat(pattern = "yyyy/MM/dd HH:mm")
+    @JSONField(format = "yyyy/MM/dd HH:mm")
+    private Date expectArrivalTime;
+
+    /**
+     *  实际靠港时间
+     */
+    @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy/MM/dd HH:mm")
+    @DateTimeFormat(pattern = "yyyy/MM/dd HH:mm")
+    @JSONField(format = "yyyy/MM/dd HH:mm")
+    private Date actualPortTime;
+    /**
+     *  实际离泊时间
+     */
+    @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy/MM/dd HH:mm")
+    @DateTimeFormat(pattern = "yyyy/MM/dd HH:mm")
+    @JSONField(format = "yyyy/MM/dd HH:mm")
+    private Date actualSailingTime;
+
+    /**
+     *  进口航次
+     */
+    private String importVoyage;
+    //出口航次
+    private String exportVoyage;
+    /**
+     *  计划抵锚时间
+     */
+    @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy/MM/dd HH:mm")
+    @DateTimeFormat(pattern = "yyyy/MM/dd HH:mm")
+    @JSONField(format = "yyyy/MM/dd HH:mm")
+    private Date expectAnchorageTime;
+    
+    /**
+     *  实际抵锚时间
+     */
+    @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy/MM/dd HH:mm")
+    @DateTimeFormat(pattern = "yyyy/MM/dd HH:mm")
+    @JSONField(format = "yyyy/MM/dd HH:mm")
+    private Date actualAnchorageTime;
+
+    //数据抓取类型 0按提单抓取；1按船名抓取
+    private String dataGrabType;
+    //船名数据类型 0靠泊；1船期
+    private String shipNameType;
+    /**
+     *  批次号
+     */
+    private String batchNo;
+
+    /**
+     * 查询提单号类型 PORT_SH  PORT_SH_TMP
+     */
+    private String type;
+    // 云呐返回数据状态，0正常，2未查询到
+    private String status;
+
+    // 冗余字段，反写水果通
+    private String errorCode;//异常编码
+//    private String hddzShipName;//水果通船名，先中转再提单
+    private String hddzVoyage;//水果通航次，先中转再提单
+    private String compareVoyage;//云呐要反写到水果通的航次
+    
+}
Index: jinan/trunk/yunna/src/main/java/com/freshport/entity/yunna/UnloadingPort.java
===================================================================
--- jinan/trunk/yunna/src/main/java/com/freshport/entity/yunna/UnloadingPort.java	(revision 0)
+++ jinan/trunk/yunna/src/main/java/com/freshport/entity/yunna/UnloadingPort.java	(revision 34922)
@@ -0,0 +1,13 @@
+package com.freshport.entity.yunna;
+
+import lombok.Data;
+
+@Data
+public class UnloadingPort {
+
+	private String id;
+	private String unloadingPort;
+	private String unloadingPortCode;
+	private String unloadingPortShortName;
+	private String unloadingPortFullName;
+}
Index: jinan/trunk/yunna/src/main/java/com/freshport/entity/yunna/YwHddzJzxxxYncheck.java
===================================================================
--- jinan/trunk/yunna/src/main/java/com/freshport/entity/yunna/YwHddzJzxxxYncheck.java	(revision 34921)
+++ jinan/trunk/yunna/src/main/java/com/freshport/entity/yunna/YwHddzJzxxxYncheck.java	(revision 34922)
@@ -29,6 +29,8 @@
     private String updUser;
 
     private String updHost;
+    
+    private String sjzqCcfs;
 
     public String getId() {
         return id;
@@ -109,4 +111,13 @@
     public void setUpdHost(String updHost) {
         this.updHost = updHost;
     }
+
+	public String getSjzqCcfs() {
+		return sjzqCcfs;
+	}
+
+	public void setSjzqCcfs(String sjzqCcfs) {
+		this.sjzqCcfs = sjzqCcfs;
+	}
+    
 }
\ No newline at end of file
Index: jinan/trunk/yunna/src/main/java/com/freshport/fdao/Mapper/ShipPortSgtMapper.xml
===================================================================
--- jinan/trunk/yunna/src/main/java/com/freshport/fdao/Mapper/ShipPortSgtMapper.xml	(revision 34921)
+++ jinan/trunk/yunna/src/main/java/com/freshport/fdao/Mapper/ShipPortSgtMapper.xml	(revision 34922)
@@ -223,44 +223,7 @@
     		 and yh.zbrq between CONVERT ( CHAR ( 10 ), getdate(), 126 ) + ' 00:00:00' and CONVERT ( CHAR ( 10 ), getdate(), 126 ) + ' 16:00:00'
     	</if>
 		</where>
-		 
-		union
 		
-		SELECT DISTINCT
-		 
-		yh.ztdh AS loadingNumber, 
-		yh.ywbh as businessNo,
-		jzxxx.jzxh AS containerNumber,
-		''  as destinationPort,
-		isnull( yh.cm, '' ) AS shipName,
-		isnull( yh.zz_cm, '' ) AS transitShipName,
-		'' AS firmName ,
-		yh.mdg as mdg,
-		yh.hcorhbh as voyage,
-		yh.zz_hcorhbh as transitVoyage
-	FROM
-		yw_hddz_jzxxx jzxxx
-		LEFT JOIN yw_hddz yh ON yh.ywbh = jzxxx.ywbh 
-	<where>
-		yh.ysfs = '海运' 
-		AND isnull( yh.state, '新制' ) = '新制' 
-		 
-		AND isnull( yh.jckfs, '' ) = '进口' 
-		AND isnull( yh.ztdh, '' ) != '' 
-		AND isnull( jzxxx.jzxh, '' ) != '' 
-		AND yh.mdg ='上海'
-		AND jzxxx.cgqsj is null 
-		AND DATEDIFF( HOUR, getdate(), yh.yjkgsj )  <![CDATA[ <= ]]> 72 
-		AND yh.yjkgsj <![CDATA[ >= ]]> '2023-05-21 00:00:00'
-		<if test="type=='PORT'.toString()">
-    	and yh.zbrq &lt;= getdate() and yh.zbrq  &gt;= '2022-01-01 00:00:00'
-    	</if>
-    	 
-    	<if test="type=='PORT_TMP'.toString()">
-    		 and yh.zbrq between CONVERT ( CHAR ( 10 ), getdate(), 126 ) + ' 00:00:00' and CONVERT ( CHAR ( 10 ), getdate(), 126 ) + ' 16:00:00'
-    	</if>
-		</where>
-		
   </select>
   
   <!-- 查询提单号信息 港口类型  合并到 listLoadingNumberForPort
@@ -325,7 +288,7 @@
   <select id="queryCmAndMdgAndZzList" parameterType="java.util.ArrayList" resultType="com.freshport.entity.YwHddzYunna">
     select hddz.zz_cm as zzCm, hddz.cm , hddz.mdg,hddz.zz_hcorhbh as zzHcorhbh,
     hddz.ywbh as ywbh,hddz.yjkgsjtzgx,hddz.sjkgsjtzgx,hddz.sjkgsj,
-    (select count(jzxxx.xcsj) from yw_hddz_jzxxx jzxxx where jzxxx.ywbh = hddz.ywbh   ) as xcsjbj   
+    (select count(jzxxx.xcsj) from yw_hddz_jzxxx jzxxx where jzxxx.ywbh = hddz.ywbh   ) as xcsjbj,hcorhbh
     from yw_hddz hddz where hddz.ywbh in 
     <foreach collection="list"  index="index" item="str"  open="(" separator="," close=")">
 			#{str} 
@@ -594,4 +557,37 @@
    <select id="queryJtg" parameterType="java.lang.String" resultType="com.freshport.entity.YwBg">
   select ywbh, jtg from yw_bg where ywbh = #{ywbh}
   </select>
+  <!-- 查询提单号信息 港口类型 -->
+  <select id="listLoadingNumberForShPort" resultType="com.freshport.entity.yunna.LoadingNumberResultVO">
+	  SELECT
+		yh.ywbh businessNo,
+		yh.ztdh loadingNumber,
+		(CASE
+			WHEN isnull( yh.zz_cm, '' ) = '' THEN
+			yh.cm ELSE yh.zz_cm 
+		END) shipName,
+		jzxxx.jzxh containerNumber,
+		yh.mdg destinationPort 
+	FROM
+		yw_hddz_jzxxx jzxxx
+		LEFT JOIN yw_hddz yh ON yh.ywbh = jzxxx.ywbh 
+	WHERE
+		yh.ysfs = '海运' 
+		AND isnull( yh.state, '新制' ) = '新制' 
+		AND isnull( yh.jckfs, '' ) = '进口' 
+		AND yh.mdg = '上海' 
+		AND isnull( jzxxx.jzxh, '' ) != '' 
+		and (isnull(yh.ztdh, '')!='' or isnull(yh.cm, '' )!='' or isnull(yh.zz_cm, '' )!='')
+		AND jzxxx.cgqsj IS NULL 
+		AND yh.yjkgsj >= '2023-05-21 00:00:00'
+		<if test="type=='PORT_SH'.toString()">
+	    	AND DATEDIFF( HOUR, getdate( ), yh.yjkgsj ) &lt;= 72
+    	</if>
+    	<if test="type=='PORT_SH_TMP'.toString()">
+    		AND DATEDIFF( HOUR, getdate( ), yh.yjkgsj ) &lt;= 168
+			AND DATEDIFF( HOUR, getdate( ), yh.yjkgsj ) &gt; 72
+    	</if>
+	ORDER BY
+		yh.ywbh
+  </select>
 </mapper>
\ No newline at end of file
Index: jinan/trunk/yunna/src/main/java/com/freshport/fdao/Mapper/YwHddzJzxxxYncheckMapper.xml
===================================================================
--- jinan/trunk/yunna/src/main/java/com/freshport/fdao/Mapper/YwHddzJzxxxYncheckMapper.xml	(revision 34921)
+++ jinan/trunk/yunna/src/main/java/com/freshport/fdao/Mapper/YwHddzJzxxxYncheckMapper.xml	(revision 34922)
@@ -21,11 +21,11 @@
     insert into yw_hddz_jzxxx_yncheck (id, ywbh, jzxh, 
       xcsj, crt_time, crt_user, 
       crt_host, upd_time, upd_user, 
-      upd_host)
+      upd_host, sjzq_ccfs)
     values (#{id,jdbcType=VARCHAR}, #{ywbh,jdbcType=VARCHAR}, #{jzxh,jdbcType=VARCHAR}, 
       #{xcsj,jdbcType=TIMESTAMP}, #{crtTime,jdbcType=TIMESTAMP}, #{crtUser,jdbcType=VARCHAR}, 
       #{crtHost,jdbcType=VARCHAR}, #{updTime,jdbcType=TIMESTAMP}, #{updUser,jdbcType=VARCHAR}, 
-      #{updHost,jdbcType=VARCHAR})
+      #{updHost,jdbcType=VARCHAR},#{sjzqCcfs,jdbcType=VARCHAR)
   </insert>
   <update id="updateByPrimaryKey" parameterType="com.freshport.entity.yunna.YwHddzJzxxxYncheck">
     update yw_hddz_jzxxx_yncheck
@@ -59,7 +59,8 @@
     update yw_hddz_jzxxx_yncheck
     set  
       xcsj = #{xcsj,jdbcType=TIMESTAMP},
-      upd_time = #{updTime,jdbcType=TIMESTAMP}
+      upd_time = #{updTime,jdbcType=TIMESTAMP},
+      sjzq_ccfs = #{sjzqCcfs,jdbcType=TIMESTAMP}
     where ywbh = #{ywbh,jdbcType=VARCHAR} AND jzxh = #{jzxh,jdbcType=VARCHAR}
   </update>
 </mapper>
\ No newline at end of file
Index: jinan/trunk/yunna/src/main/java/com/freshport/fdao/ShipPortSgtMapper.java
===================================================================
--- jinan/trunk/yunna/src/main/java/com/freshport/fdao/ShipPortSgtMapper.java	(revision 34921)
+++ jinan/trunk/yunna/src/main/java/com/freshport/fdao/ShipPortSgtMapper.java	(revision 34922)
@@ -314,4 +314,13 @@
      */
     List<YwBg> queryJtg(@Param("ywbh") String ywbh);
 
+    /**
+     * listLoadingNumberForShPort(查询提单号信息-上海港)      
+     * @return List<LoadingNumberResultVO>
+     * @author gubj
+     * @date 2023年8月23日 下午1:12:13  
+     * @Exception 异常对象  
+     * @version 1.0
+     */
+    List<LoadingNumberResultVO> listLoadingNumberForShPort(@Param("type") String type);
 }
Index: jinan/trunk/yunna/src/main/java/com/freshport/service/DataProcessService.java
===================================================================
--- jinan/trunk/yunna/src/main/java/com/freshport/service/DataProcessService.java	(revision 34921)
+++ jinan/trunk/yunna/src/main/java/com/freshport/service/DataProcessService.java	(revision 34922)
@@ -55,5 +55,16 @@
      * @version 1.0
      */
     void deleteResultData(List<String> list);
+    
+    /**
+     * 
+     * @Title:        deleteShByBatchNoList 
+     * @Description:  (根据批次号批量删除上海港返回数据)  
+     * @param:        @param list    
+     * @return:       void    
+     * @author:       gubj
+     * @Date:         2023年9月5日 下午5:19:39
+     */
+    void deleteShByBatchNoList(List<String> list);
 
 }
Index: jinan/trunk/yunna/src/main/java/com/freshport/service/FruitShipPortService.java
===================================================================
--- jinan/trunk/yunna/src/main/java/com/freshport/service/FruitShipPortService.java	(revision 34921)
+++ jinan/trunk/yunna/src/main/java/com/freshport/service/FruitShipPortService.java	(revision 34922)
@@ -15,6 +15,7 @@
 import com.freshport.entity.yunna.LoadingNumberQueryParam;
 import com.freshport.entity.yunna.LoadingNumberResultVO;
 import com.freshport.entity.yunna.ShipPortResultVO;
+import com.freshport.entity.yunna.ShipShPortResultVO;
 
 /**
  * 
@@ -189,4 +190,29 @@
 
     // void shiwutest();
 
+    /**
+     * 
+     * savePortInfo(保存上海港信息到消息队列)       
+     * @param params  
+     * @return void  
+     * @Exception 异常对象    
+     * @author gubj  
+     * @date 2023-08-23 14:57:42
+     */
+    void saveShPortInfo(String params);
+
+    /**
+     * 保存上海港返回数据到mysql
+     * @Title:        saveShipShPortResult 
+     * @Description:  TODO
+     * @param:        @param list
+     * @param:        @param type
+     * @param:        @param batchNo
+     * @param:        @param logType    
+     * @return:       void    
+     * @author:       gubj
+     * @Date:         2023年8月23日 下午2:08:45
+     */
+	void saveShipShPortResult(List<ShipShPortResultVO> list, String type, String batchNo, String logType);
+	
 }
Index: jinan/trunk/yunna/src/main/java/com/freshport/service/PortService.java
===================================================================
--- jinan/trunk/yunna/src/main/java/com/freshport/service/PortService.java	(revision 34921)
+++ jinan/trunk/yunna/src/main/java/com/freshport/service/PortService.java	(revision 34922)
@@ -95,5 +95,15 @@
      * @date 2023-03-27 13:35:42
      */
     void updatePortResultUpdStatus(List<PortForHddzVO> list);
+    /**
+     * 
+     * queryLoadingNumberShInfoList(查询上海港提单号类型信息)      
+     * @return  
+     * @return List<LoadingNumberResultVO>  
+     * @Exception 异常对象    
+     * @author gubj  
+     * @date 2023-08-15 13:52:58
+     */
+    List<LoadingNumberResultVO> queryLoadingNumberShInfoList(String type);
 
 }
Index: jinan/trunk/yunna/src/main/java/com/freshport/service/StrategyFactory.java
===================================================================
--- jinan/trunk/yunna/src/main/java/com/freshport/service/StrategyFactory.java	(revision 0)
+++ jinan/trunk/yunna/src/main/java/com/freshport/service/StrategyFactory.java	(revision 34922)
@@ -0,0 +1,25 @@
+package com.freshport.service;
+
+import com.freshport.util.YunnaStrategyEnum;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.ApplicationContext;
+import org.springframework.stereotype.Component;
+
+@Component
+public class StrategyFactory {
+	
+    @Autowired
+    private ApplicationContext applicationContext;
+
+	public YunnaStrategy getDeduction(String yse) {
+		YunnaStrategy deduction = null;
+		try {
+			String className = YunnaStrategyEnum.valueOf(yse).getClassName();
+			deduction = (YunnaStrategy) applicationContext.getBean(Class.forName(className));
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+		return deduction;
+	}
+}
Index: jinan/trunk/yunna/src/main/java/com/freshport/service/YunnaPortService.java
===================================================================
--- jinan/trunk/yunna/src/main/java/com/freshport/service/YunnaPortService.java	(revision 34921)
+++ jinan/trunk/yunna/src/main/java/com/freshport/service/YunnaPortService.java	(revision 34922)
@@ -1,6 +1,9 @@
 package com.freshport.service;
 
+import java.util.List;
+
 import com.freshport.entity.yunna.PortForHddzVO;
+import com.freshport.entity.yunna.ShipShPortResultVO;
 
 public interface YunnaPortService {
     /**
@@ -25,5 +28,39 @@
      * @version 1.0
      */
     void updatePortResultUpdStatusSingle(PortForHddzVO pvo, String batchNo);
+    
+    /**
+     * 处理上海港数据
+     * @Title:        handleShDate 
+     * @Description:  TODO
+     * @param:        @param batchNo    
+     * @return:       void    
+     * @author:       gubj
+     * @Date:         2023年8月23日 下午1:19:40
+     */
+    void handleShDate(String batchNo);
+    
+    /**
+     * 
+     * @Title:        updateShipShPortResult 
+     * @Description:  更新上海港状态
+     * @param:        @param batchNo
+     * @param:        @param ywbh
+     * @param:        @param state    
+     * @return:       void    
+     * @author:       gubj
+     * @Date:         2023年9月4日 下午2:07:34
+     */
+    void updateShipShPortResult(String batchNo, String ywbh, String state);
+    /**
+     * 
+     * @Title:        updateStrategyJzxxx 
+     * @Description:  更新上海港集装箱抓取结果
+     * @param:        @param strategy    
+     * @return:       void    
+     * @author:       gubj
+     * @Date:         2023年9月4日 下午2:08:02
+     */
+    void updateStrategyJzxxx(List<ShipShPortResultVO> strategy);
 
 }
Index: jinan/trunk/yunna/src/main/java/com/freshport/service/YunnaStrategy.java
===================================================================
--- jinan/trunk/yunna/src/main/java/com/freshport/service/YunnaStrategy.java	(revision 0)
+++ jinan/trunk/yunna/src/main/java/com/freshport/service/YunnaStrategy.java	(revision 34922)
@@ -0,0 +1,12 @@
+package com.freshport.service;
+
+import java.util.List;
+import java.util.Map;
+
+import com.freshport.entity.yunna.ShipShPortResultVO;
+
+
+public interface YunnaStrategy {
+
+	Map<String, List<ShipShPortResultVO>> execute(List<ShipShPortResultVO> strategy);
+}
Index: jinan/trunk/yunna/src/main/java/com/freshport/service/impl/DataProcessServiceImpl.java
===================================================================
--- jinan/trunk/yunna/src/main/java/com/freshport/service/impl/DataProcessServiceImpl.java	(revision 34921)
+++ jinan/trunk/yunna/src/main/java/com/freshport/service/impl/DataProcessServiceImpl.java	(revision 34922)
@@ -295,6 +295,7 @@
             for (List<String> list : splitList) {
                 dataProcessService.deleteLoadData(list);
                 dataProcessService.deleteResultData(list);
+                dataProcessService.deleteShByBatchNoList(list);
             }
 
         }
@@ -314,6 +315,21 @@
     public void deleteResultData(List<String> list) {
         ywShipPortResultMapper.deleteByBatchNoList(list);
     }
+    
+    /**
+     * 
+     * @Title:        deleteShByBatchNoList 
+     * @Description:  删除上海港历史数据
+     * @param:        @param list    
+     * @return:       void    
+     * @author:       gubj
+     * @Date:         2023年9月5日 下午5:18:44
+     */
+    @Transactional(propagation = Propagation.REQUIRES_NEW)
+    @Override
+    public void deleteShByBatchNoList(List<String> list) {
+    	ywShipPortResultMapper.deleteShByBatchNoList(list);
+    }
 
     /**
      * deleteLoadData(根据批次号批量删除发送数据)  
Index: jinan/trunk/yunna/src/main/java/com/freshport/service/impl/FruitShipPortServiceImpl.java
===================================================================
--- jinan/trunk/yunna/src/main/java/com/freshport/service/impl/FruitShipPortServiceImpl.java	(revision 34921)
+++ jinan/trunk/yunna/src/main/java/com/freshport/service/impl/FruitShipPortServiceImpl.java	(revision 34922)
@@ -44,6 +44,7 @@
 import com.freshport.entity.yunna.LoadingNumberQueryParam;
 import com.freshport.entity.yunna.LoadingNumberResultVO;
 import com.freshport.entity.yunna.ShipPortResultVO;
+import com.freshport.entity.yunna.ShipShPortResultVO;
 import com.freshport.entity.yunna.YunnaDataChackVo;
 import com.freshport.fdao.ShipPortSgtMapper;
 import com.freshport.service.FruitShipPortService;
@@ -110,7 +111,7 @@
 
     @SuppressWarnings("rawtypes")
     @Resource
-    private RedisTemplate redisTemplate;
+    private RedisTemplate<String,String> redisTemplate;
 
     @Resource
     private ShipPortSgtMapper shipPortSgtMapper;
@@ -151,6 +152,9 @@
         }
         // 保存传过去原始提单号数据
         String logType = handleLogTypeForLoading(type);
+        if(params.getType().contains(CommonInfo.TYPE_PORT_SH)) {
+        	type = params.getType();
+        }
         fruitShipPortService.saveShipPortLoading(result, type, batchNo, logType);
         // 保存日志表 --> 放到 YunnaLogAspect 中统一处理
         // fruitShipPortService.saveShipPortLog(JSONObject.toJSON(params).toString(),
@@ -201,6 +205,10 @@
         } else if (ShipPortEnum.PORT.getCode().equals(params.getType())
                 || ShipPortEnum.PORT_TMP.getCode().equals(params.getType())) {
             result = portService.queryLoadingNumberInfoList(params.getType());
+        } else if (ShipPortEnum.PORT_SH.getCode().equals(params.getType())
+                || ShipPortEnum.PORT_SH_TMP.getCode().equals(params.getType())) {
+        	//上海港抓取
+            result = portService.queryLoadingNumberShInfoList(params.getType());
         }
         log.info("===============查询提单号类型：{}, 返回结果条数：{}", params.getType(), result.size());
 
@@ -383,7 +391,39 @@
         // 3. 预警 / 反写 TODO 上线前三天不更新，比对数据
         // portService.updateHddzAndWarnningInfo(batchNo);
     }
+    /**
+     * 保存上海港回传信息
+     */
+    @Transactional(propagation = Propagation.NOT_SUPPORTED)
+    @Override
+    @SuppressWarnings("unchecked")
+    public void saveShPortInfo(String result) {
+    	
+    	ShipShPortResultVO resultMysql = new ShipShPortResultVO();
+     	JSONArray jsonList = JSONArray.parseArray(result);
+ 
+     	JSONArray temp = JSONArray.parseArray(jsonList.get(0).toString());
+     	resultMysql = JSONObject.parseObject(temp.get(0).toString(), ShipShPortResultVO.class);
 
+    	
+    	log.info("======================回传上海港结果，总条数：{}", jsonList.size());
+    	String batchNo = resultMysql.getBatchNo();
+    	
+    	// 判断数据量是否一致，不一致放入异常信息表
+    	int loadingNum = ywShipPortLoadingMapper.countByBatchNo(batchNo);
+    	if (loadingNum != jsonList.size()) {
+    		fruitShipPortService.saveShipPortError(CommonInfo.ERROR_CODE_PORT_NUM, batchNo,
+    				"上海港数量异常：(推送数量" + loadingNum + " 返回数量" + jsonList.size() + ")");
+    	}
+    	
+    	// 1. 保存原始数据到redis
+    	redisTemplate.opsForValue().set(batchNo, JSONObject.toJSONString(result));
+    	
+    	// 将批次号放入消息队列 ， 然后与云娜通信结束。 后面与水果通系统交互与本次通信无关， 拆分执行。
+    	ActivemqParams mq = ActivemqParams.builder().batchNo(batchNo).type(resultMysql.getType()).build();
+    	producerQueue.sendQueue(JSONArray.toJSONString(mq));
+    }
+
     /**
      * 修改时间：2023-04-26 与魏老师确认， 批次号前缀添加上小时分钟
      * 
@@ -680,5 +720,29 @@
         }
         return errorList;
     }
-
+    
+    /**
+     * 保存上海港返回数据到mysql
+     */
+    @SystemYunnaLog
+    @Transactional
+    @Override
+    public void saveShipShPortResult(List<ShipShPortResultVO> list, String type, String batchNo, String logType) {
+    	try {
+    		for (ShipShPortResultVO vo : list) {
+                vo.setId(UUID.randomUUID().toString());
+            }
+            if (!CommonUtils.isEmpty(list)) {
+                // 批量保存
+                List<List<ShipShPortResultVO>> splitList = CommonUtils.splitList(list,
+                        CommonInfo.SQLSERVER_BATCH_GROUPING_COUNT_HUNDRED_80);
+                for (int i = 0; i < splitList.size(); i++) {
+                    ywShipPortResultMapper.insertShPortList(splitList.get(i));
+                }
+            }
+		} catch (Exception e) {
+			fruitShipPortService.saveShipPortError(CommonInfo.ERROR_CODE_DATABASE_YUNNA, batchNo,
+                    "保存数据库异常:" + CommonInfo.SHIP_ERROR_BATCH + batchNo);
+		}
+    }
 }
Index: jinan/trunk/yunna/src/main/java/com/freshport/service/impl/PortServiceImpl.java
===================================================================
--- jinan/trunk/yunna/src/main/java/com/freshport/service/impl/PortServiceImpl.java	(revision 34921)
+++ jinan/trunk/yunna/src/main/java/com/freshport/service/impl/PortServiceImpl.java	(revision 34922)
@@ -424,4 +424,32 @@
         }
     }
 
+    /**
+     * 上海港提单信息查询，返回云呐
+     */
+    @Transactional(propagation = Propagation.NOT_SUPPORTED, readOnly = true)
+    @Override
+    public List<LoadingNumberResultVO> queryLoadingNumberShInfoList(String type) {
+
+        List<LoadingNumberResultVO> resultList = new ArrayList<LoadingNumberResultVO>();
+        // 根据条件获取数据
+        List<LoadingNumberResultVO> basicList = shipPortSgtMapper.listLoadingNumberForShPort(type);
+        /**
+         * 查询时， 提单号中如果存在*号， 则把*号及星号后面的去掉
+         * 筛掉提单号和船名同时为空的
+         */
+        if (!CommonUtils.isEmpty(basicList)) {
+            for (LoadingNumberResultVO vo : basicList) {
+            	if(CommonUtils.isEmpty(vo.getLoadingNumber()) && CommonUtils.isEmpty(vo.getShipName())) {
+            		continue;
+            	}
+                // 处理主提单号。存在*号时， 只保留*号前面的数据
+                if (!CommonUtils.isEmpty(vo.getLoadingNumber()) && vo.getLoadingNumber().contains("*")) {
+                    vo.setLoadingNumber(vo.getLoadingNumber().split("\\*")[0]);
+                }
+                resultList.add(vo);
+            }
+        }
+        return resultList;
+    }
 }
Index: jinan/trunk/yunna/src/main/java/com/freshport/service/impl/YunnaChcekServiceImpl.java
===================================================================
--- jinan/trunk/yunna/src/main/java/com/freshport/service/impl/YunnaChcekServiceImpl.java	(revision 34921)
+++ jinan/trunk/yunna/src/main/java/com/freshport/service/impl/YunnaChcekServiceImpl.java	(revision 34922)
@@ -117,6 +117,7 @@
             ywHddzYncheckMapper.updateForPortInfo(hddzcheck);
         } else {
             hddzcheck.setCrtTime(new Date());
+            hddzcheck.setUpdTime(new Date());//如果只有一次写入，保证第一次也存在更新时间，后续BI好处理
             ywHddzYncheckMapper.insert(hddzcheck);
         }
 
@@ -136,7 +137,7 @@
     @Override
     public void updateContainerNoInfoForCheck(YwHddzJzxxx ywHddzJzxxx, String batchNo) {
         YwHddzJzxxxYncheck jzxxx = YwHddzJzxxxYncheck.builder().id(UUID.randomUUID().toString())
-                .jzxh(ywHddzJzxxx.getJzxh()).ywbh(ywHddzJzxxx.getYwbh()).xcsj(ywHddzJzxxx.getXcsj()).build();
+                .jzxh(ywHddzJzxxx.getJzxh()).ywbh(ywHddzJzxxx.getYwbh()).xcsj(ywHddzJzxxx.getXcsj()).sjzqCcfs(ywHddzJzxxx.getSjzqCcfs()).build();
         // 判断数据是否存在
         int count = ywHddzJzxxxYncheckMapper.queryCount(jzxxx.getYwbh(), jzxxx.getJzxh());
         if (count > 0) {
@@ -144,6 +145,7 @@
             ywHddzJzxxxYncheckMapper.updateForContainerNo(jzxxx);
         } else {
             jzxxx.setCrtTime(new Date());
+            jzxxx.setUpdTime(new Date());
             ywHddzJzxxxYncheckMapper.insert(jzxxx);
         }
     }
Index: jinan/trunk/yunna/src/main/java/com/freshport/service/impl/YunnaPortServiceImpl.java
===================================================================
--- jinan/trunk/yunna/src/main/java/com/freshport/service/impl/YunnaPortServiceImpl.java	(revision 34921)
+++ jinan/trunk/yunna/src/main/java/com/freshport/service/impl/YunnaPortServiceImpl.java	(revision 34922)
@@ -4,14 +4,19 @@
 import java.util.Date;
 import java.util.List;
 import java.util.Map;
+import java.util.concurrent.CopyOnWriteArrayList;
 import java.util.stream.Collectors;
 
 import javax.annotation.Resource;
 
+import org.springframework.data.redis.core.RedisTemplate;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Propagation;
 import org.springframework.transaction.annotation.Transactional;
 
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
 import com.freshport.dao.ShipPortMapper;
 import com.freshport.dao.YwShipPortResultMapper;
 import com.freshport.entity.YwHddz;
@@ -19,10 +24,12 @@
 import com.freshport.entity.YwHddzYunna;
 import com.freshport.entity.YwShipPortResult;
 import com.freshport.entity.yunna.PortForHddzVO;
+import com.freshport.entity.yunna.ShipShPortResultVO;
 import com.freshport.service.FruitShipPortService;
 import com.freshport.service.SgtDataService;
 import com.freshport.service.YunnaChcekService;
 import com.freshport.service.YunnaPortService;
+import com.freshport.service.impl.strategy.YunnaStrategy000;
 import com.freshport.util.CommonInfo;
 import com.freshport.util.CommonUtils;
 import com.freshport.util.DateUtils;
@@ -51,6 +58,12 @@
     @Resource
     private YunnaChcekService yunnaChcekService;
 
+    @Resource
+    private RedisTemplate<String, String> redisTemplate;
+    
+    @Resource
+    private YunnaStrategy000 yunnaStrategy000;
+
     /**
      * handleDate(根据批次号处理数据)  
      * @param batchNo
@@ -415,4 +428,90 @@
                     + CommonInfo.SHIP_ERROR_YUNNA_YWBH + pvo.getBusinessNo() + CommonInfo.SHIP_ERROR_BATCH + batchNo);
         }
     }
+    /**
+     * 根据批次号，查询上海港数据，进入策略
+     */
+	@Override
+	@Transactional
+    public void handleShDate(String batchNo) {
+    	// 合并小list，写入mysql
+    	CopyOnWriteArrayList<ShipShPortResultVO> resultMysql = new CopyOnWriteArrayList<ShipShPortResultVO>(); 
+		// 云呐返回是按照集装箱分组，结构为List<List<>>，将其改为List<>
+    	JSONArray jsonList = JSONArray.parseArray(JSON.parse(redisTemplate.opsForValue().get(batchNo).toString()).toString());
+    	jsonList.parallelStream().forEach(l->{
+            List<JSONObject> list = JSONObject.parseArray(l.toString() ,JSONObject.class);
+            resultMysql.addAll(
+            		list.stream().map(vo -> JSONObject.parseObject(vo.toJSONString(), ShipShPortResultVO.class)).collect(Collectors.toList())
+            		);
+    	});
+    	// 云呐未查询到的数据记录
+		List<String> ywbhNotList = new ArrayList<String>();
+		// 保存数据到mysql
+		fruitShipPortService.saveShipShPortResult(resultMysql, resultMysql.get(0).getType(), batchNo, CommonInfo.LOG_TYPE_RESULT_PORT);
+		// 云呐返回是按照集装箱分组，改成按照业务编号分组
+		Map<String, List<ShipShPortResultVO>> groupTemp = resultMysql.stream().collect(Collectors.groupingBy(vo -> vo.getBusinessNo()));
+		for(Map.Entry<String, List<ShipShPortResultVO>> entry : groupTemp.entrySet()) {
+			// 如果status未查询到
+			if (CommonInfo.PORT_SH_DATA_STATUS_EMPTY.equals(entry.getValue().get(0).getStatus())) {
+				ywbhNotList.add(entry.getValue().get(0).getBusinessNo());
+				continue;
+			}
+			try {
+				// 传入第一个策略
+    			yunnaStrategy000.execute(entry.getValue());
+			} catch (Exception e) {
+				e.printStackTrace();
+	            fruitShipPortService.saveShipPortError(CommonInfo.ERROR_CODE_DATABASE_YUNNA, batchNo,
+	                     "数据处理异常:" + entry.getValue().get(0).getBusinessNo());
+			}
+		}
+		if(!ywbhNotList.isEmpty()) {
+			// 记录所有未查询数据的业务
+    		fruitShipPortService.saveShipPortError(CommonInfo.ERROR_CODE_DATAERROR_EMPTY, batchNo,
+                    "未查询到数据！批次号：" + CommonInfo.SHIP_ERROR_BATCH + batchNo + "；业务编号： " + JSON.toJSONString(ywbhNotList));
+		}		
+    	// 将redis中的数据删除
+    	redisTemplate.delete(batchNo);
+    }
+    /**
+     * 更新上海港批次数据状态
+     */
+    @Override
+    @Transactional(propagation = Propagation.REQUIRES_NEW)
+    public void updateShipShPortResult(String batchNo, String ywbh, String state) {
+    	//保存数据到mysql
+    	try {
+    		ywShipPortResultMapper.updateShipShPortResult(batchNo, ywbh, state);
+    	} catch (Exception e) {
+    		e.printStackTrace();
+            fruitShipPortService.saveShipPortError(CommonInfo.ERROR_CODE_DATABASE_YUNNA, batchNo,
+                     "保存数据库异常:" + CommonInfo.SHIP_ERROR_BATCH + batchNo);
+        }
+    }
+    /**
+     * 上海港更新集装箱信息
+     */
+    @Transactional
+    @Override
+	public void updateStrategyJzxxx(List<ShipShPortResultVO> strategy) {
+		for(ShipShPortResultVO vo : strategy) {
+			YwHddzJzxxx ywHddzJzxxx = YwHddzJzxxx.customizeBuilder().ywbh(vo.getBusinessNo()).jzxh(vo.getContainerNumber())
+					.xcsj(null).sjzqCcfs(null).build();
+			//必须卸船进场才能反写卸船时间、必须提单反写
+			if((CommonInfo.PORT_SH_DATEGRABTYPE_BILL.equals(vo.getDataGrabType())) && (CommonInfo.PORT_SH_DATA_INTYPE).equals(vo.getInType())) {
+				ywHddzJzxxx.setXcsj(vo.getInTime());
+			}
+			//必须疏运才能反写出场方式
+			if((CommonInfo.PORT_SH_DATA_OUTTYPE).equals(vo.getOutType())) {
+				ywHddzJzxxx.setSjzqCcfs(vo.getOutType());
+			}
+			if(CommonUtils.isEmpty(ywHddzJzxxx.getXcsj()) && CommonUtils.isEmpty(ywHddzJzxxx.getSjzqCcfs())) {
+				continue;
+			}
+			//更新集装箱数据
+			sgtDataService.updateContainerNoInfoForPortSingle(ywHddzJzxxx, vo.getBatchNo());
+			//记录check
+			yunnaChcekService.updateContainerNoInfoForCheck(ywHddzJzxxx, vo.getBatchNo());
+		}
+	}
 }
Index: jinan/trunk/yunna/src/main/java/com/freshport/service/impl/strategy/YunnaStrategy000.java
===================================================================
--- jinan/trunk/yunna/src/main/java/com/freshport/service/impl/strategy/YunnaStrategy000.java	(revision 0)
+++ jinan/trunk/yunna/src/main/java/com/freshport/service/impl/strategy/YunnaStrategy000.java	(revision 34922)
@@ -0,0 +1,32 @@
+package com.freshport.service.impl.strategy;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.springframework.stereotype.Service;
+
+import com.freshport.entity.yunna.ShipShPortResultVO;
+import com.freshport.service.YunnaStrategy;
+import com.freshport.util.CommonInfo;
+import com.freshport.util.aspect.StrategyAsp;
+
+@Service
+public class YunnaStrategy000 implements YunnaStrategy{
+	
+	/**
+	 * 000策略：第一个策略，所有数据先进入此策略，判断船名抓取类型
+	 * 提单抓取进入001策略，船名抓取进入002策略
+	 */
+	@Override
+	@StrategyAsp
+	public Map<String, List<ShipShPortResultVO>> execute(List<ShipShPortResultVO> strategy) {
+		Map<String, List<ShipShPortResultVO>> result = new HashMap<String, List<ShipShPortResultVO>>();
+		if((CommonInfo.PORT_SH_DATEGRABTYPE_BILL).equals(strategy.get(0).getDataGrabType())) {
+			result.put(CommonInfo.PORT_SH_STRATEGY_001, strategy);
+			return result;
+		}
+		result.put(CommonInfo.PORT_SH_STRATEGY_002, strategy);
+		return result;
+	}
+}
Index: jinan/trunk/yunna/src/main/java/com/freshport/service/impl/strategy/YunnaStrategy001.java
===================================================================
--- jinan/trunk/yunna/src/main/java/com/freshport/service/impl/strategy/YunnaStrategy001.java	(revision 0)
+++ jinan/trunk/yunna/src/main/java/com/freshport/service/impl/strategy/YunnaStrategy001.java	(revision 34922)
@@ -0,0 +1,51 @@
+package com.freshport.service.impl.strategy;
+
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.annotation.Resource;
+
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Propagation;
+import org.springframework.transaction.annotation.Transactional;
+
+import com.freshport.entity.YwHddzYunna;
+import com.freshport.entity.yunna.ShipShPortResultVO;
+import com.freshport.fdao.ShipPortSgtMapper;
+import com.freshport.service.YunnaStrategy;
+import com.freshport.util.CommonInfo;
+import com.freshport.util.CommonUtils;
+import com.freshport.util.aspect.StrategyAsp;
+
+
+@Service
+public class YunnaStrategy001 implements YunnaStrategy{
+	
+	@Resource
+	private ShipPortSgtMapper shipPortSgtMapper;
+	
+	/**
+	 * 001策略：按提单抓取
+	 * 判断英文船名与水果通船名是否一致，一致进入反写策略，不一致进入异常策略
+	 */
+	@Override
+	@StrategyAsp
+	@Transactional(propagation = Propagation.NOT_SUPPORTED)
+	public Map<String, List<ShipShPortResultVO>> execute(List<ShipShPortResultVO> strategy) {
+		Map<String, List<ShipShPortResultVO>> result = new HashMap<String, List<ShipShPortResultVO>>();
+		//查询水果通船名
+		List<YwHddzYunna> ywHddz = shipPortSgtMapper.queryCmAndMdgAndZzList(Arrays.asList(strategy.get(0).getBusinessNo()));
+		String shipName = CommonUtils.isEmpty(ywHddz.get(0).getZzCm()) ? ywHddz.get(0).getCm() : ywHddz.get(0).getZzCm();
+		//判断船名(云呐英文船名是中文船名截取的)
+		if(strategy.get(0).getCNShipName().split("/")[0].equals(shipName)) {
+			result.put(CommonInfo.PORT_SH_STRATEGY_012, strategy);
+			return result;
+		}
+		//船名异常
+		strategy.get(0).setErrorCode(CommonInfo.PORT_SH_DATAERROR_BLCM);
+		result.put(CommonInfo.PORT_SH_STRATEGY_014, strategy);
+		return result;
+	}
+}
Index: jinan/trunk/yunna/src/main/java/com/freshport/service/impl/strategy/YunnaStrategy002.java
===================================================================
--- jinan/trunk/yunna/src/main/java/com/freshport/service/impl/strategy/YunnaStrategy002.java	(revision 0)
+++ jinan/trunk/yunna/src/main/java/com/freshport/service/impl/strategy/YunnaStrategy002.java	(revision 34922)
@@ -0,0 +1,47 @@
+package com.freshport.service.impl.strategy;
+
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.annotation.Resource;
+
+import org.springframework.stereotype.Service;
+
+import com.freshport.entity.YwHddzYunna;
+import com.freshport.entity.yunna.ShipShPortResultVO;
+import com.freshport.fdao.ShipPortSgtMapper;
+import com.freshport.service.YunnaStrategy;
+import com.freshport.util.CommonInfo;
+import com.freshport.util.CommonUtils;
+import com.freshport.util.aspect.StrategyAsp;
+
+
+@Service
+public class YunnaStrategy002 implements YunnaStrategy{
+	
+	@Resource
+	private ShipPortSgtMapper shipPortSgtMapper;
+	
+	/**
+	 * 002策略：按船名抓取
+	 * 判断英文船名与水果通船名是否一致，一致进入003策略，不一致进入004策略
+	 */
+	@Override
+	@StrategyAsp
+	public Map<String, List<ShipShPortResultVO>> execute(List<ShipShPortResultVO> strategy) {
+		Map<String, List<ShipShPortResultVO>> result = new HashMap<String, List<ShipShPortResultVO>>();
+		//查询水果通船名
+		List<YwHddzYunna> ywHddz = shipPortSgtMapper.queryCmAndMdgAndZzList(Arrays.asList(strategy.get(0).getBusinessNo()));
+		String shipName = CommonUtils.isEmpty(ywHddz.get(0).getZzCm()) ? ywHddz.get(0).getCm() : ywHddz.get(0).getZzCm();
+		//判断船名
+		if(strategy.get(0).getENShipName().equals(shipName)) {
+			result.put(CommonInfo.PORT_SH_STRATEGY_003, strategy);
+			return result;
+		}
+		strategy.get(0).setErrorCode(CommonInfo.PORT_SH_DATAERROR_CM);
+		result.put(CommonInfo.PORT_SH_STRATEGY_004, strategy);
+		return result;
+	}
+}
Index: jinan/trunk/yunna/src/main/java/com/freshport/service/impl/strategy/YunnaStrategy003.java
===================================================================
--- jinan/trunk/yunna/src/main/java/com/freshport/service/impl/strategy/YunnaStrategy003.java	(revision 0)
+++ jinan/trunk/yunna/src/main/java/com/freshport/service/impl/strategy/YunnaStrategy003.java	(revision 34922)
@@ -0,0 +1,71 @@
+package com.freshport.service.impl.strategy;
+
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+import javax.annotation.Resource;
+
+import org.springframework.stereotype.Service;
+
+import com.freshport.entity.YwHddzYunna;
+import com.freshport.entity.yunna.ShipShPortResultVO;
+import com.freshport.fdao.ShipPortSgtMapper;
+import com.freshport.service.YunnaStrategy;
+import com.freshport.util.CommonInfo;
+import com.freshport.util.CommonUtils;
+import com.freshport.util.StrategyUtil;
+import com.freshport.util.aspect.StrategyAsp;
+
+
+
+@Service
+public class YunnaStrategy003 implements YunnaStrategy{
+	
+	@Resource
+	private ShipPortSgtMapper shipPortSgtMapper;
+	
+	/**
+	 * 003策略：按船名抓取，且英文船名与水果通船名一致
+	 * 判断进口航次、出口航次与水果通航次是否一致或者互相包含，进口一致进入005策略，出口航次一致进入006策略
+	 * 必须先判断进口航次，再判断出口航次
+	 */
+	@Override
+	@StrategyAsp
+	public Map<String, List<ShipShPortResultVO>> execute(List<ShipShPortResultVO> strategy) {
+		Map<String, List<ShipShPortResultVO>> result = new HashMap<String, List<ShipShPortResultVO>>();
+		//查询水果通航次
+		List<YwHddzYunna> ywHddz = shipPortSgtMapper.queryCmAndMdgAndZzList(Arrays.asList(strategy.get(0).getBusinessNo()));
+		String voyage = CommonUtils.isEmpty(ywHddz.get(0).getZzHcorhbh()) ? ywHddz.get(0).getHcorhbh() : ywHddz.get(0).getZzHcorhbh();
+		// 如果水果通航次为空，算都不一致
+		if(CommonUtils.isEmpty(voyage)) {
+			//进口航次与出口航次都不一致，进入11策略
+			result.put(CommonInfo.PORT_SH_STRATEGY_011, strategy);
+			return result;
+		}
+		//将航次写入ShipShPortResultVO
+		strategy.get(0).setHddzVoyage(voyage);
+		//先处理下数据，因为strategy是集装箱维度，同一条数据条数等于集装箱个数，
+		//所以判断近出口航次的数量，要去重，每个箱子中只保留一条。但是往下传递要全部传递，不能删减
+		//因为箱子在每条数据中都会重复，所以只需要其中一个箱子的所有数据即可
+		Map<String, List<ShipShPortResultVO>> groupTemp = strategy.stream().collect(Collectors.groupingBy(vo -> vo.getContainerNumber()));
+		
+		List<ShipShPortResultVO> strategyTemp = groupTemp.get(strategy.get(0).getContainerNumber()); 
+		
+		//如果是进口航次一致
+		if(StrategyUtil.getVoyageCount(strategyTemp, voyage, CommonInfo.PORT_SH_FIELDNAME_IMPORT) > 0) {
+			result.put(CommonInfo.PORT_SH_STRATEGY_005, strategy);
+			return result;
+		}
+		//如果是出口航次一致
+		if(StrategyUtil.getVoyageCount(strategyTemp, voyage, CommonInfo.PORT_SH_FIELDNAME_EXPORT) > 0) {
+			result.put(CommonInfo.PORT_SH_STRATEGY_006, strategy);
+			return result;
+		}
+		//进口航次与出口航次都不一致，进入11策略
+		result.put(CommonInfo.PORT_SH_STRATEGY_011, strategy);
+		return result;
+	}
+}
Index: jinan/trunk/yunna/src/main/java/com/freshport/service/impl/strategy/YunnaStrategy004.java
===================================================================
--- jinan/trunk/yunna/src/main/java/com/freshport/service/impl/strategy/YunnaStrategy004.java	(revision 0)
+++ jinan/trunk/yunna/src/main/java/com/freshport/service/impl/strategy/YunnaStrategy004.java	(revision 34922)
@@ -0,0 +1,36 @@
+package com.freshport.service.impl.strategy;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.annotation.Resource;
+
+import org.springframework.stereotype.Service;
+
+import com.freshport.entity.yunna.ShipShPortResultVO;
+import com.freshport.fdao.ShipPortSgtMapper;
+import com.freshport.service.YunnaStrategy;
+import com.freshport.util.CommonInfo;
+import com.freshport.util.aspect.StrategyAsp;
+
+
+@Service
+public class YunnaStrategy004 implements YunnaStrategy{
+	
+	@Resource
+	private ShipPortSgtMapper shipPortSgtMapper;
+	
+	/**
+	 * 004策略：按船名抓取，且英文船名与水果通船名不一致
+	 * 进入异常策略
+	 */
+	@Override
+	@StrategyAsp
+	public Map<String, List<ShipShPortResultVO>> execute(List<ShipShPortResultVO> strategy) {
+		Map<String, List<ShipShPortResultVO>> result = new HashMap<String, List<ShipShPortResultVO>>();
+		strategy.get(0).setErrorCode(CommonInfo.PORT_SH_DATAERROR_CM);
+		result.put(CommonInfo.PORT_SH_STRATEGY_014, strategy);
+		return result;
+	}
+}
Index: jinan/trunk/yunna/src/main/java/com/freshport/service/impl/strategy/YunnaStrategy005.java
===================================================================
--- jinan/trunk/yunna/src/main/java/com/freshport/service/impl/strategy/YunnaStrategy005.java	(revision 0)
+++ jinan/trunk/yunna/src/main/java/com/freshport/service/impl/strategy/YunnaStrategy005.java	(revision 34922)
@@ -0,0 +1,41 @@
+package com.freshport.service.impl.strategy;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.annotation.Resource;
+
+import org.springframework.stereotype.Service;
+
+import com.freshport.entity.yunna.ShipShPortResultVO;
+import com.freshport.fdao.ShipPortSgtMapper;
+import com.freshport.service.YunnaStrategy;
+import com.freshport.util.CommonInfo;
+import com.freshport.util.StrategyUtil;
+import com.freshport.util.aspect.StrategyAsp;
+
+
+@Service
+public class YunnaStrategy005 implements YunnaStrategy{
+	
+	@Resource
+	private ShipPortSgtMapper shipPortSgtMapper;
+	
+	/**
+	 * 004策略：按船名抓取，且英文船名与水果通船名一致，且进口航次与水果通航次存在一致或者互相包含
+	 * 进口航次与水果通航次存在一致或者互相包含的数量大于1，进入策略7，否则进入策略8
+	 */
+	@Override
+	@StrategyAsp
+	public Map<String, List<ShipShPortResultVO>> execute(List<ShipShPortResultVO> strategy) {
+		Map<String, List<ShipShPortResultVO>> result = new HashMap<String, List<ShipShPortResultVO>>();
+		//如果进口航次一致的数量大于1
+		if(StrategyUtil.getVoyageCount(strategy, strategy.get(0).getHddzVoyage(), CommonInfo.PORT_SH_FIELDNAME_IMPORT) > 1) {
+			result.put(CommonInfo.PORT_SH_STRATEGY_007, strategy);
+			return result;
+		}
+		result.put(CommonInfo.PORT_SH_STRATEGY_008, strategy);
+		return result;
+	}
+}
Index: jinan/trunk/yunna/src/main/java/com/freshport/service/impl/strategy/YunnaStrategy006.java
===================================================================
--- jinan/trunk/yunna/src/main/java/com/freshport/service/impl/strategy/YunnaStrategy006.java	(revision 0)
+++ jinan/trunk/yunna/src/main/java/com/freshport/service/impl/strategy/YunnaStrategy006.java	(revision 34922)
@@ -0,0 +1,41 @@
+package com.freshport.service.impl.strategy;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.annotation.Resource;
+
+import org.springframework.stereotype.Service;
+
+import com.freshport.entity.yunna.ShipShPortResultVO;
+import com.freshport.fdao.ShipPortSgtMapper;
+import com.freshport.service.YunnaStrategy;
+import com.freshport.util.CommonInfo;
+import com.freshport.util.StrategyUtil;
+import com.freshport.util.aspect.StrategyAsp;
+
+
+@Service
+public class YunnaStrategy006 implements YunnaStrategy{
+	
+	@Resource
+	private ShipPortSgtMapper shipPortSgtMapper;
+	
+	/**
+	 * 按船名抓取，且英文船名与水果通船名一致，且出口航次与水果通航次存在一致或者互相包含
+	 * 出口航次与水果通航次存在一致或者互相包含的数量大于1，进入策略9，否则进入策略10
+	 */
+	@Override
+	@StrategyAsp
+	public Map<String, List<ShipShPortResultVO>> execute(List<ShipShPortResultVO> strategy) {
+		Map<String, List<ShipShPortResultVO>> result = new HashMap<String, List<ShipShPortResultVO>>();
+		//如果出口航次一致的数量大于1
+		if(StrategyUtil.getVoyageCount(strategy, strategy.get(0).getHddzVoyage(), CommonInfo.PORT_SH_FIELDNAME_EXPORT) > 1) {
+			result.put(CommonInfo.PORT_SH_STRATEGY_009, strategy);
+			return result;
+		}
+		result.put(CommonInfo.PORT_SH_STRATEGY_010, strategy);
+		return result;
+	}
+}
Index: jinan/trunk/yunna/src/main/java/com/freshport/service/impl/strategy/YunnaStrategy007.java
===================================================================
--- jinan/trunk/yunna/src/main/java/com/freshport/service/impl/strategy/YunnaStrategy007.java	(revision 0)
+++ jinan/trunk/yunna/src/main/java/com/freshport/service/impl/strategy/YunnaStrategy007.java	(revision 34922)
@@ -0,0 +1,48 @@
+package com.freshport.service.impl.strategy;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.annotation.Resource;
+
+import org.springframework.stereotype.Service;
+
+import com.freshport.entity.yunna.ShipShPortResultVO;
+import com.freshport.fdao.ShipPortSgtMapper;
+import com.freshport.service.YunnaStrategy;
+import com.freshport.util.CommonInfo;
+import com.freshport.util.StrategyUtil;
+import com.freshport.util.aspect.StrategyAsp;
+
+
+@Service
+public class YunnaStrategy007 implements YunnaStrategy{
+	
+	@Resource
+	private ShipPortSgtMapper shipPortSgtMapper;
+	
+	/**
+	 * 按船名抓取，且英文船名与水果通船名一致，且进口航次与水果通航次存在一致或者互相包含的数量大于1
+	 * 符合反写条件，进入策略13船名反写，否则进入异常策略14
+	 */
+	@Override
+	@StrategyAsp
+	public Map<String, List<ShipShPortResultVO>> execute(List<ShipShPortResultVO> strategy) {
+		Map<String, List<ShipShPortResultVO>> result = new HashMap<String, List<ShipShPortResultVO>>();
+		// 对云呐返回的数据进行处理，取进口航次与水果通航次一致或者互相包含的数据
+		strategy = StrategyUtil.getVoyageList(strategy, strategy.get(0).getHddzVoyage(), CommonInfo.PORT_SH_FIELDNAME_IMPORT);
+		// 判断是否可以反写
+		List<ShipShPortResultVO> strategyHandle = StrategyUtil.publicStrategyHandle(strategy, CommonInfo.PORT_SH_FIELDNAME_IMPORT);
+		if(null == strategyHandle) {
+			// 其他情况全是异常
+			strategy.get(0).setErrorCode(CommonInfo.PORT_SH_DATAERROR_JKHC);
+			result.put(CommonInfo.PORT_SH_STRATEGY_014, strategy);
+			return result;
+		}
+		strategyHandle.get(0).setCompareVoyage(strategyHandle.get(0).getImportVoyage());
+		result.put(CommonInfo.PORT_SH_STRATEGY_013, strategyHandle);
+		return result;
+	}
+
+}
Index: jinan/trunk/yunna/src/main/java/com/freshport/service/impl/strategy/YunnaStrategy008.java
===================================================================
--- jinan/trunk/yunna/src/main/java/com/freshport/service/impl/strategy/YunnaStrategy008.java	(revision 0)
+++ jinan/trunk/yunna/src/main/java/com/freshport/service/impl/strategy/YunnaStrategy008.java	(revision 34922)
@@ -0,0 +1,45 @@
+package com.freshport.service.impl.strategy;
+
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.annotation.Resource;
+
+import org.springframework.stereotype.Service;
+
+import com.freshport.entity.yunna.ShipShPortResultVO;
+import com.freshport.fdao.ShipPortSgtMapper;
+import com.freshport.service.YunnaStrategy;
+import com.freshport.util.CommonInfo;
+import com.freshport.util.StrategyUtil;
+import com.freshport.util.aspect.StrategyAsp;
+
+
+@Service
+public class YunnaStrategy008 implements YunnaStrategy{
+	
+	@Resource
+	private ShipPortSgtMapper shipPortSgtMapper;
+	
+	/**
+	 * 按船名抓取，且英文船名与水果通船名一致，且进口航次与水果通航次存在一致或者互相包含的数量等于1
+	 * 符合反写条件，进入策略13船名反写
+	 */
+	@Override
+	@StrategyAsp
+	public Map<String, List<ShipShPortResultVO>> execute(List<ShipShPortResultVO> strategy) {
+		Map<String, List<ShipShPortResultVO>> result = new HashMap<String, List<ShipShPortResultVO>>();
+		// 整理数据，只保留要反写的那一条往下传
+		strategy = StrategyUtil.getVoyageList(strategy, strategy.get(0).getHddzVoyage(), CommonInfo.PORT_SH_FIELDNAME_IMPORT);
+		strategy.get(0).setCompareVoyage(strategy.get(0).getImportVoyage());
+		// 整理ETA 如果是船期的数据，要用最晚的地锚时间做ETA
+		if((CommonInfo.PORT_SH_SHIPNAMETYPE_SHIP).equals(strategy.get(0).getShipNameType())) {
+			Date lastTime = StrategyUtil.dateCompare(strategy.get(0).getExpectAnchorageTime(), strategy.get(0).getActualAnchorageTime());
+			strategy.forEach(v -> v.setExpectArrivalTime(lastTime));
+		}
+		result.put(CommonInfo.PORT_SH_STRATEGY_013, strategy);
+		return result;
+	}
+}
Index: jinan/trunk/yunna/src/main/java/com/freshport/service/impl/strategy/YunnaStrategy009.java
===================================================================
--- jinan/trunk/yunna/src/main/java/com/freshport/service/impl/strategy/YunnaStrategy009.java	(revision 0)
+++ jinan/trunk/yunna/src/main/java/com/freshport/service/impl/strategy/YunnaStrategy009.java	(revision 34922)
@@ -0,0 +1,47 @@
+package com.freshport.service.impl.strategy;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.annotation.Resource;
+
+import org.springframework.stereotype.Service;
+
+import com.freshport.entity.yunna.ShipShPortResultVO;
+import com.freshport.fdao.ShipPortSgtMapper;
+import com.freshport.service.YunnaStrategy;
+import com.freshport.util.CommonInfo;
+import com.freshport.util.StrategyUtil;
+import com.freshport.util.aspect.StrategyAsp;
+
+
+@Service
+public class YunnaStrategy009 implements YunnaStrategy{
+	
+	@Resource
+	private ShipPortSgtMapper shipPortSgtMapper;
+	
+	/**
+	 * 按船名抓取，且英文船名与水果通船名一致，且出口航次与水果通航次存在一致或者互相包含的数量大于1
+	 * 符合反写条件，进入策略13船名反写，否则进入异常策略14
+	 */
+	@Override
+	@StrategyAsp
+	public Map<String, List<ShipShPortResultVO>> execute(List<ShipShPortResultVO> strategy) {
+		Map<String, List<ShipShPortResultVO>> result = new HashMap<String, List<ShipShPortResultVO>>();
+		// 对云呐返回的数据进行处理，取出出口航次与水果通航次一致或者互相包含的数据
+		strategy = StrategyUtil.getVoyageList(strategy, strategy.get(0).getHddzVoyage(), CommonInfo.PORT_SH_FIELDNAME_EXPORT);
+		// 判断是否可以反写
+		List<ShipShPortResultVO> strategyHandle = StrategyUtil.publicStrategyHandle(strategy, CommonInfo.PORT_SH_FIELDNAME_EXPORT);
+		if(null == strategyHandle) {
+			// 其他情况全是异常
+			strategy.get(0).setErrorCode(CommonInfo.PORT_SH_DATAERROR_CKHC);
+			result.put(CommonInfo.PORT_SH_STRATEGY_014, strategy);
+			return result;
+		}
+		strategyHandle.get(0).setCompareVoyage(strategyHandle.get(0).getExportVoyage());
+		result.put(CommonInfo.PORT_SH_STRATEGY_013, strategyHandle);
+		return result;
+	}
+}
Index: jinan/trunk/yunna/src/main/java/com/freshport/service/impl/strategy/YunnaStrategy010.java
===================================================================
--- jinan/trunk/yunna/src/main/java/com/freshport/service/impl/strategy/YunnaStrategy010.java	(revision 0)
+++ jinan/trunk/yunna/src/main/java/com/freshport/service/impl/strategy/YunnaStrategy010.java	(revision 34922)
@@ -0,0 +1,39 @@
+package com.freshport.service.impl.strategy;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.annotation.Resource;
+
+import org.springframework.stereotype.Service;
+
+import com.freshport.entity.yunna.ShipShPortResultVO;
+import com.freshport.fdao.ShipPortSgtMapper;
+import com.freshport.service.YunnaStrategy;
+import com.freshport.util.CommonInfo;
+import com.freshport.util.StrategyUtil;
+import com.freshport.util.aspect.StrategyAsp;
+
+
+@Service
+public class YunnaStrategy010 implements YunnaStrategy{
+	
+	@Resource
+	private ShipPortSgtMapper shipPortSgtMapper;
+	
+	/**
+	 * 按船名抓取，且英文船名与水果通船名一致，且出口航次与水果通航次存在一致或者互相包含的数量等于1
+	 * 符合反写条件，进入策略13船名反写
+	 */
+	@Override
+	@StrategyAsp
+	public Map<String, List<ShipShPortResultVO>> execute(List<ShipShPortResultVO> strategy) {
+		Map<String, List<ShipShPortResultVO>> result = new HashMap<String, List<ShipShPortResultVO>>();
+		// 整理数据，只保留要反写的那一条往下传
+		strategy = StrategyUtil.getVoyageList(strategy, strategy.get(0).getHddzVoyage(), CommonInfo.PORT_SH_FIELDNAME_EXPORT);
+		strategy.get(0).setCompareVoyage(strategy.get(0).getExportVoyage());
+		result.put(CommonInfo.PORT_SH_STRATEGY_013, strategy);
+		return result;
+	}
+}
Index: jinan/trunk/yunna/src/main/java/com/freshport/service/impl/strategy/YunnaStrategy011.java
===================================================================
--- jinan/trunk/yunna/src/main/java/com/freshport/service/impl/strategy/YunnaStrategy011.java	(revision 0)
+++ jinan/trunk/yunna/src/main/java/com/freshport/service/impl/strategy/YunnaStrategy011.java	(revision 34922)
@@ -0,0 +1,38 @@
+package com.freshport.service.impl.strategy;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.annotation.Resource;
+
+import org.springframework.stereotype.Service;
+
+import com.freshport.entity.yunna.ShipShPortResultVO;
+import com.freshport.fdao.ShipPortSgtMapper;
+import com.freshport.service.YunnaStrategy;
+import com.freshport.util.CommonInfo;
+import com.freshport.util.aspect.StrategyAsp;
+
+
+@Service
+public class YunnaStrategy011 implements YunnaStrategy{
+	
+	@Resource
+	private ShipPortSgtMapper shipPortSgtMapper;
+	
+	/**
+	 * 按船名抓取，且英文船名与水果通船名一致，且出口航次、进口航次与水果通航次都不存在一致或者互相包含的数量
+	 * 进入异常策略14
+	 */
+	@Override
+	@StrategyAsp
+	public Map<String, List<ShipShPortResultVO>> execute(List<ShipShPortResultVO> strategy) {
+		Map<String, List<ShipShPortResultVO>> result = new HashMap<String, List<ShipShPortResultVO>>();
+		// "出口航次、进口航次与水果通航次都不存在一致或者互相包含的数量"
+		// 进出/出口航次都人满足，取7天内最近的一条船期数据ETA (靠泊页面:计划靠泊时间或者船期页面:计划抵错地时间、实际抵错地时间一个时间里取其没有最近7天内船期数据不反写
+		strategy.get(0).setErrorCode(CommonInfo.PORT_SH_DATAERROR_VOYAGE);
+		result.put(CommonInfo.PORT_SH_STRATEGY_014, strategy);
+		return result;
+	}
+}
Index: jinan/trunk/yunna/src/main/java/com/freshport/service/impl/strategy/YunnaStrategy012.java
===================================================================
--- jinan/trunk/yunna/src/main/java/com/freshport/service/impl/strategy/YunnaStrategy012.java	(revision 0)
+++ jinan/trunk/yunna/src/main/java/com/freshport/service/impl/strategy/YunnaStrategy012.java	(revision 34922)
@@ -0,0 +1,96 @@
+package com.freshport.service.impl.strategy;
+
+import java.util.Arrays;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+import javax.annotation.Resource;
+
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import com.freshport.dao.ShipPortMapper;
+import com.freshport.entity.YwHddz;
+import com.freshport.entity.YwHddzJzxxxYunna;
+import com.freshport.entity.yunna.ShipShPortResultVO;
+import com.freshport.entity.yunna.UnloadingPort;
+import com.freshport.fdao.ShipPortSgtMapper;
+import com.freshport.service.FruitShipPortService;
+import com.freshport.service.SgtDataService;
+import com.freshport.service.YunnaChcekService;
+import com.freshport.service.YunnaPortService;
+import com.freshport.service.YunnaStrategy;
+import com.freshport.util.CommonInfo;
+import com.freshport.util.CommonUtils;
+import com.freshport.util.StrategyUtil;
+
+
+@Service
+public class YunnaStrategy012 implements YunnaStrategy{
+	
+	@Resource
+	private ShipPortSgtMapper shipPortSgtMapper;
+	@Resource
+	private ShipPortMapper shipPortMapper;
+	@Resource
+	private SgtDataService sgtDataService;
+	@Resource
+	private FruitShipPortService fruitShipPortService;
+	@Resource
+	private YunnaChcekService yunnaChcekService;
+	@Resource
+	private YunnaPortService yunnaPortService;
+	
+	/**
+	 * 提单反写
+	 * 不再需要往下传递
+	 */
+	@Override
+	@Transactional
+	public Map<String, List<ShipShPortResultVO>> execute(List<ShipShPortResultVO> strategy) {
+		ShipShPortResultVO strategyHandle = strategy.get(0);
+		//查询该业务的水果通卸船时间
+		List<YwHddzJzxxxYunna> containerInfo = shipPortSgtMapper.queryJzxxxInfo(Arrays.asList(strategyHandle.getBusinessNo()));
+		//通过Builder方式创建对象
+        YwHddz ywHddz = YwHddz.customizeBuilder().ywbh(strategyHandle.getBusinessNo()).ztdh(strategyHandle.getLoadingNumber())
+                .yjkgsj(null).sjkgsj(null)
+                .hcorhbh(null).zzHcorhbh(null)
+                .xhgq(null).xhgqjc(null)
+                .xhgqbm(null).build();
+		//卸船时间
+		List<Date> xcsjList = containerInfo.stream().filter(vo -> vo.getXcsj() != null).map(item -> item.getXcsj()).collect(Collectors.toList());
+		//给卸船时间排序
+		xcsjList.sort((a, b) -> a.compareTo(b));
+		// 1、ETA反写(包含预计靠港时间和系统抓取靠港时间)
+		ywHddz = StrategyUtil.publicStrategyETAHandle(strategyHandle, xcsjList, ywHddz);
+		// 2、海博航次(英文船名/中文船名/航次)
+		ywHddz.setHbHc(strategyHandle.getCNShipName().substring(strategyHandle.getCNShipName().lastIndexOf("/")+1));
+		// 3、ATA
+		ywHddz = StrategyUtil.publicStrategyATAHandle(strategyHandle, xcsjList, ywHddz);
+		// 4、卸船时间（存在卸船时间且进场方式为卸船进场即反写）
+		// 5、卸货港区（存在且eta反写时，反写卸货港区。根据strategyHandle.getDock()查询字段，反写卸货港区简称到海博码头）
+		if(!CommonUtils.isEmpty(ywHddz.getYjkgsj()) || !CommonUtils.isEmpty(ywHddz.getJhkbsj())) {
+			UnloadingPort hddzDock = shipPortMapper.listUnloadingByPort(strategyHandle.getDock());
+			if(!CommonUtils.isEmpty(hddzDock)) {
+				ywHddz.setHbMt(hddzDock.getUnloadingPortShortName());
+			}else {
+				// 写一条异常
+				fruitShipPortService.saveShipPortError(CommonInfo.ERROR_CODE_DATAERROR_XHQU, strategyHandle.getBatchNo(),
+						"卸货港区映射异常:" + strategyHandle.getDock() + "; 业务编号" + strategyHandle.getBusinessNo());
+			}
+		}
+		// 6、出场方式和卸船时间同时反写
+		//================== 反写分步，
+		// 1、反写单证表eta、ata、海博航次、海博码头；
+		sgtDataService.updatePortInfoListForHddzSingle(ywHddz, strategyHandle.getBatchNo());
+		// 2、反写集装箱表卸船时间、出场方式
+		yunnaPortService.updateStrategyJzxxx(strategy);
+		// 3、反写云呐状态
+		yunnaPortService.updateShipShPortResult(strategyHandle.getBatchNo(), strategyHandle.getBusinessNo(), CommonInfo.PORT_SH_DATABASE_TYPE_END);
+		// 4、记录yncheck表
+		yunnaChcekService.updatePortInfoForCheck(ywHddz, strategyHandle.getBatchNo());
+		return null;
+	}
+}
Index: jinan/trunk/yunna/src/main/java/com/freshport/service/impl/strategy/YunnaStrategy013.java
===================================================================
--- jinan/trunk/yunna/src/main/java/com/freshport/service/impl/strategy/YunnaStrategy013.java	(revision 0)
+++ jinan/trunk/yunna/src/main/java/com/freshport/service/impl/strategy/YunnaStrategy013.java	(revision 34922)
@@ -0,0 +1,95 @@
+package com.freshport.service.impl.strategy;
+
+import java.util.Arrays;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+import javax.annotation.Resource;
+
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import com.freshport.dao.ShipPortMapper;
+import com.freshport.entity.YwHddz;
+import com.freshport.entity.YwHddzJzxxxYunna;
+import com.freshport.entity.yunna.ShipShPortResultVO;
+import com.freshport.entity.yunna.UnloadingPort;
+import com.freshport.fdao.ShipPortSgtMapper;
+import com.freshport.service.FruitShipPortService;
+import com.freshport.service.SgtDataService;
+import com.freshport.service.YunnaChcekService;
+import com.freshport.service.YunnaPortService;
+import com.freshport.service.YunnaStrategy;
+import com.freshport.util.CommonInfo;
+import com.freshport.util.CommonUtils;
+import com.freshport.util.StrategyUtil;
+
+
+@Service
+public class YunnaStrategy013 implements YunnaStrategy{
+	
+	@Resource
+	private ShipPortSgtMapper shipPortSgtMapper;
+	@Resource
+	private ShipPortMapper shipPortMapper;
+	@Resource
+	private SgtDataService sgtDataService;
+	@Resource
+	private FruitShipPortService fruitShipPortService;
+	@Resource
+	private YunnaChcekService yunnaChcekService;
+	@Resource
+	private YunnaPortService yunnaPortService;
+	
+	/**
+	 * 船名反写
+	 * 不再需要往下传递
+	 */
+	@Override
+	@Transactional
+	public Map<String, List<ShipShPortResultVO>> execute(List<ShipShPortResultVO> strategy) {
+		ShipShPortResultVO strategyHandle = strategy.get(0);
+		//查询该业务的水果通卸船时间
+		List<YwHddzJzxxxYunna> containerInfo = shipPortSgtMapper.queryJzxxxInfo(Arrays.asList(strategyHandle.getBusinessNo()));
+		//通过Builder方式创建对象
+        YwHddz ywHddz = YwHddz.customizeBuilder().ywbh(strategyHandle.getBusinessNo()).ztdh(strategyHandle.getLoadingNumber())
+                .yjkgsj(null).sjkgsj(null)
+                .hcorhbh(null).zzHcorhbh(null)
+                .xhgq(null).xhgqjc(null)
+                .xhgqbm(null).build();
+		//卸船时间
+		List<Date> xcsjList = containerInfo.stream().filter(vo -> vo.getXcsj() != null).map(item -> item.getXcsj()).collect(Collectors.toList());
+		//给卸船时间排序
+		xcsjList.sort((a, b) -> a.compareTo(b));
+		// 1、ETA反写(包含预计靠港时间和系统抓取靠港时间)
+		ywHddz = StrategyUtil.publicStrategyETAHandle(strategyHandle, xcsjList, ywHddz);;
+		// 2、海博航次
+		ywHddz.setHbHc(strategyHandle.getCompareVoyage());
+		// 3、ATA
+		ywHddz = StrategyUtil.publicStrategyATAHandle(strategyHandle, xcsjList, ywHddz);
+		// 5、卸货港区（存在且eta反写时，反写卸货港区。根据strategyHandle.getDock()查询字段，反写卸货港区简称到海博码头）
+		if(!CommonUtils.isEmpty(ywHddz.getYjkgsj()) || !CommonUtils.isEmpty(ywHddz.getJhkbsj())) {
+			UnloadingPort hddzDock = shipPortMapper.listUnloadingByPort(strategyHandle.getDock());
+			if(!CommonUtils.isEmpty(hddzDock)) {
+				ywHddz.setHbMt(hddzDock.getUnloadingPortShortName());
+			}else{
+				// 写一条异常
+				fruitShipPortService.saveShipPortError(CommonInfo.ERROR_CODE_DATAERROR_XHQU, strategyHandle.getBatchNo(),
+	                     "卸货港区映射异常:" + strategyHandle.getDock() + "; 业务编号" + strategyHandle.getBusinessNo());
+			}
+		}
+		// 6、出场方式（存在且必须是疏运即反写）
+		//================== 反写分步，
+		// 1、反写单证表eta、ata、海博航次、海博码头；
+		sgtDataService.updatePortInfoListForHddzSingle(ywHddz, strategyHandle.getBatchNo());
+		// 2、反写集装箱表出场方式
+		yunnaPortService.updateStrategyJzxxx(strategy);
+		// 3、反写云呐状态
+		yunnaPortService.updateShipShPortResult(strategyHandle.getBatchNo(), strategyHandle.getBusinessNo(), CommonInfo.PORT_SH_DATABASE_TYPE_END);
+		// 4、记录yncheck表
+		yunnaChcekService.updatePortInfoForCheck(ywHddz, strategyHandle.getBatchNo());
+		return null;
+	}
+}
Index: jinan/trunk/yunna/src/main/java/com/freshport/service/impl/strategy/YunnaStrategy014.java
===================================================================
--- jinan/trunk/yunna/src/main/java/com/freshport/service/impl/strategy/YunnaStrategy014.java	(revision 0)
+++ jinan/trunk/yunna/src/main/java/com/freshport/service/impl/strategy/YunnaStrategy014.java	(revision 34922)
@@ -0,0 +1,74 @@
+package com.freshport.service.impl.strategy;
+
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+
+import javax.annotation.Resource;
+
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Propagation;
+import org.springframework.transaction.annotation.Transactional;
+
+import com.alibaba.fastjson.JSON;
+import com.freshport.dao.YwShipPortResultMapper;
+import com.freshport.entity.YwHddz;
+import com.freshport.entity.yunna.ShipShPortResultVO;
+import com.freshport.service.SgtDataService;
+import com.freshport.service.YunnaStrategy;
+import com.freshport.util.CommonInfo;
+import com.freshport.util.StrategyUtil;
+
+import lombok.extern.log4j.Log4j;
+
+
+@Service
+@Log4j
+public class YunnaStrategy014 implements YunnaStrategy{
+	
+	@Resource
+	private SgtDataService sgtDataService;
+	
+	@Resource
+	private YwShipPortResultMapper ywShipPortResultMapper;
+	
+	/**
+	 * 异常反写
+	 * 不再需要往下传递
+	 */
+	@Override
+	@Transactional(propagation = Propagation.REQUIRES_NEW)
+	public Map<String, List<ShipShPortResultVO>> execute(List<ShipShPortResultVO> strategy) {
+		// 初始化ywhddz
+		YwHddz ywHddz = YwHddz.customizeBuilder().ywbh(strategy.get(0).getBusinessNo()).ztdh(strategy.get(0).getLoadingNumber())
+                .yjkgsj(null).sjkgsj(null)
+                .hcorhbh(null).zzHcorhbh(null)
+                .xhgq(null).xhgqjc(null)
+                .xhgqbm(null).build();
+		// 异常编码
+		String errotCode = strategy.get(0).getErrorCode();
+		if((CommonInfo.PORT_SH_DATAERROR_VOYAGE).equals(errotCode)) {
+			// 进出/出口航次都不满足，取7天内最近的一条船期数据ETA (靠泊页面:计划靠泊时间或者船期页面:计划抵错地时间、实际抵错地时间一个时间里取其没有最近7天内船期数据不反写
+			List<ShipShPortResultVO> voyageErrorList = ywShipPortResultMapper.queryVoyageErrorList(strategy.get(0).getBusinessNo(),strategy.get(0).getType());
+			// 取最近的一条数据的计划地锚和实际地锚、计划靠泊的最近时间，反写
+			Optional<ShipShPortResultVO> opAnchorageTime = voyageErrorList.stream().filter(vo -> vo.getShipNameType().equals(CommonInfo.PORT_SH_SHIPNAMETYPE_SHIP)).findAny();
+			// 计划地锚
+			Date expectAnchorageTime = opAnchorageTime.isPresent() ? opAnchorageTime.get().getExpectAnchorageTime() : null;
+			// 实际地锚
+			Date actualAnchorageTime = opAnchorageTime.isPresent() ? opAnchorageTime.get().getActualAnchorageTime() : null;
+			// 计划靠泊
+			Optional<ShipShPortResultVO> opArrivalTime = voyageErrorList.stream().filter(vo -> vo.getShipNameType().equals(CommonInfo.PORT_SH_SHIPNAMETYPE_ANCHORAGE)).findAny();
+			Date expectArrivalTime = opArrivalTime.isPresent() ? opArrivalTime.get().getExpectArrivalTime() : null;
+			// 先比较地锚时间
+			Date anchorageTime = StrategyUtil.dateCompare(expectAnchorageTime, actualAnchorageTime);
+			ywHddz.setYjkgsj(StrategyUtil.dateCompare(anchorageTime, expectArrivalTime));
+			sgtDataService.updatePortInfoListForHddzSingle(ywHddz, voyageErrorList.get(0).getBatchNo());
+			return null;
+		}
+		//反写到靠港管理-海博航次
+		ywHddz.setHbHc(errotCode);
+		sgtDataService.updatePortInfoListForHddzSingle(ywHddz, strategy.get(0).getBatchNo());
+		return null;
+	}
+}
Index: jinan/trunk/yunna/src/main/java/com/freshport/util/CommonInfo.java
===================================================================
--- jinan/trunk/yunna/src/main/java/com/freshport/util/CommonInfo.java	(revision 34921)
+++ jinan/trunk/yunna/src/main/java/com/freshport/util/CommonInfo.java	(revision 34922)
@@ -49,6 +49,8 @@
 
     /** 查询类型-港口  10>ETA>72h*/
     public static final String TYPE_PORT_TMP = "PORT_TMP";
+    
+    public static final String TYPE_PORT_SH = "PORT_SH";
 
     /** 保存日志类型 1-提单号查询船司*/
     public static final String LOG_TYPE_LOADING_SHIP = "1";
@@ -88,6 +90,13 @@
 
     /** 异常日志，错误码 6-港口回传数量不对 */
     public static final String ERROR_CODE_PORT_NUM = "7";
+    
+    // 8:抓取库数据库崩溃
+    public static final String ERROR_CODE_DATABASE_YUNNA = "8";
+    // 9：卸货港区不存在
+    public static final String ERROR_CODE_DATAERROR_XHQU = "9";
+    // 10、未查询到数据
+    public static final String ERROR_CODE_DATAERROR_EMPTY = "10";
 
     /** 通用时间字符串  开始 */
     public static final String DATE_STRING_START = " 00:00:00";
@@ -112,5 +121,52 @@
 
     /**  目的港 香港 */
     public static final String MDG_HK = "香港";
+    
+    // 上海港用
+    // 提单抓取，船名异常
+    public static final String PORT_SH_DATAERROR_BLCM = "BLCM YICHANG";
+    // 船名抓取，船名异常
+    public static final String PORT_SH_DATAERROR_CM = "CM YICHANG";
+    // 进口航次异常
+    public static final String PORT_SH_DATAERROR_JKHC = "JKHC YICHANG";
+    // 出口航次异常
+    public static final String PORT_SH_DATAERROR_CKHC = "CKHC YICHANG";
+    // 进出口航次全部异常
+    public static final String PORT_SH_DATAERROR_VOYAGE = "VOYAGE YICHANG";
+    // 进口航次字段名
+    public static final String PORT_SH_FIELDNAME_IMPORT = "importVoyage";
+    // 出口航次字段名
+    public static final String PORT_SH_FIELDNAME_EXPORT = "exportVoyage";
+    // 船名数据类型-船期
+    public static final String PORT_SH_SHIPNAMETYPE_SHIP = "1";
+    // 船名数据类型-靠泊
+    public static final String PORT_SH_SHIPNAMETYPE_ANCHORAGE = "0";
+    // 进场方式-卸船进场
+    public static final String PORT_SH_DATA_INTYPE = "卸船进场";
+    // 出场方式-疏运
+    public static final String PORT_SH_DATA_OUTTYPE = "疏运";
+    // result状态，已反写
+    public static final String PORT_SH_DATABASE_TYPE_END = "1";
+    // 云呐数据状态，未查询到
+    public static final String PORT_SH_DATA_STATUS_EMPTY = "2";
+    // 数据抓取类型-提单
+    public static final String PORT_SH_DATEGRABTYPE_BILL = "0";
+    // 数据抓取类型-船名
+    public static final String PORT_SH_DATEGRABTYPE_SHIPNAME = "1";
+    // 策略编码
+    public static final String PORT_SH_STRATEGY_001 = "YS001";
+    public static final String PORT_SH_STRATEGY_002 = "YS002";
+    public static final String PORT_SH_STRATEGY_003 = "YS003";
+    public static final String PORT_SH_STRATEGY_004 = "YS004";
+    public static final String PORT_SH_STRATEGY_005 = "YS005";
+    public static final String PORT_SH_STRATEGY_006 = "YS006";
+    public static final String PORT_SH_STRATEGY_007 = "YS007";
+    public static final String PORT_SH_STRATEGY_008 = "YS008";
+    public static final String PORT_SH_STRATEGY_009 = "YS009";
+    public static final String PORT_SH_STRATEGY_010 = "YS010";
+    public static final String PORT_SH_STRATEGY_011 = "YS011";
+    public static final String PORT_SH_STRATEGY_012 = "YS012";
+    public static final String PORT_SH_STRATEGY_013 = "YS013";
+    public static final String PORT_SH_STRATEGY_014 = "YS014";
 
 }
Index: jinan/trunk/yunna/src/main/java/com/freshport/util/ShipPortEnum.java
===================================================================
--- jinan/trunk/yunna/src/main/java/com/freshport/util/ShipPortEnum.java	(revision 34921)
+++ jinan/trunk/yunna/src/main/java/com/freshport/util/ShipPortEnum.java	(revision 34922)
@@ -16,8 +16,12 @@
  */
 public enum ShipPortEnum {
 
-    SHIP("SHIP", "船司提单号", "SHIP", "1"), SHIP_TMP("SHIP_TMP", "船司-当天提单号", "SHIP", "1"), PORT("PORT", "港口提单号", "PORT",
-            "2"), PORT_TMP("PORT_TMP", "港口当天-提单号", "PORT", "2");
+    SHIP("SHIP", "船司提单号", "SHIP", "1"), 
+    SHIP_TMP("SHIP_TMP", "船司-当天提单号", "SHIP", "1"), 
+    PORT("PORT", "港口提单号", "PORT","2"), 
+    PORT_TMP("PORT_TMP", "港口当天-提单号", "PORT", "2"),
+	PORT_SH("PORT_SH", "上海港-10分钟抓取", "PORT", "2"),
+	PORT_SH_TMP("PORT_SH_TMP", "上海港-四个整点抓取", "PORT", "2");
 
     private String code;
 
Index: jinan/trunk/yunna/src/main/java/com/freshport/util/StrategyUtil.java
===================================================================
--- jinan/trunk/yunna/src/main/java/com/freshport/util/StrategyUtil.java	(revision 0)
+++ jinan/trunk/yunna/src/main/java/com/freshport/util/StrategyUtil.java	(revision 34922)
@@ -0,0 +1,194 @@
+package com.freshport.util;
+
+import java.lang.reflect.Field;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+import com.freshport.entity.YwHddz;
+import com.freshport.entity.yunna.ShipShPortResultVO;
+
+public class StrategyUtil {
+	
+	/**
+	 * 
+	 * @Title:        getVoyageList 
+	 * @Description:  获取航次包含的list
+	 * @param:        @param ynhc
+	 * @param:        @param hbhc
+	 * @param:        @param fieldName
+	 * @param:        @return    
+	 * @return:       List<ShipShPortResultVO>    
+	 * @author:       gubj
+	 * @Date:         2023年8月24日 下午2:56:33
+	 */
+	public static List<ShipShPortResultVO> getVoyageList(List<ShipShPortResultVO> ynhc, String hbhc, String fieldName) {
+		return ynhc.stream()
+		.filter(item -> getFieldInfo(item, fieldName).contains(hbhc) || hbhc.contains(getFieldInfo(item, fieldName)))
+		.collect(Collectors.toList());
+	}
+	/**
+	 * @Title:        getVoyageCount 
+	 * @Description:  获取航次包含的数量
+	 * @param:        @param ynhc
+	 * @param:        @param hbhc
+	 * @param:        @param fieldName
+	 * @param:        @return    
+	 * @return:       int    
+	 * @author:       gubj
+	 * @Date:         2023年8月24日 下午1:59:09
+	 */
+	public static int getVoyageCount(List<ShipShPortResultVO> ynhc, String hbhc, String fieldName) {
+		return ynhc.stream()
+		.filter(item -> getFieldInfo(item, fieldName).contains(hbhc) || hbhc.contains(getFieldInfo(item, fieldName)))
+		.collect(Collectors.toList()).size();
+	}
+	/**
+	 * @Title:        getFieldInfo 
+	 * @Description:  反射获取字段值
+	 * @param:        @param obj
+	 * @param:        @param fieldName
+	 * @param:        @return    
+	 * @return:       String    
+	 * @author:       gubj
+	 * @Date:         2023年8月24日 下午1:58:58
+	 */
+	public static String getFieldInfo(ShipShPortResultVO obj, String fieldName) {
+		try {
+			Field field = obj.getClass().getDeclaredField(fieldName);
+			field.setAccessible(Boolean.TRUE);
+			return (String) field.get(obj);
+		} catch (Exception e1) {
+			e1.printStackTrace();
+		}
+		return "!@#";
+	}
+	/**
+	 * 
+	 * @Title:        dateCompare 
+	 * @Description:  返回时间靠后的那一笔
+	 * @param:        @param first
+	 * @param:        @param last
+	 * @param:        @return    
+	 * @return:       Date    
+	 * @author:       gubj
+	 * @Date:         2023年8月25日 上午11:19:00
+	 */
+	public static Date dateCompare(Date first, Date last){
+		if(CommonUtils.isEmpty(last) && CommonUtils.isEmpty(first)) {
+			return null;
+		}
+		if(CommonUtils.isEmpty(first)) {
+			return last;
+		}
+		if(CommonUtils.isEmpty(last)) {
+			return first;
+		}
+		if (first.after(last)) {
+			return first;
+		}
+		return last;
+	}
+	/**
+	 * 
+	 * @Title:        publicStrategyHandle 
+	 * @Description:  策略007和策略009中公用的一些逻辑处理
+	 * @param:        @param strategy
+	 * @param:        @param voyageFieldName
+	 * @param:        @return    
+	 * @return:       List<ShipShPortResultVO>    
+	 * @author:       gubj
+	 * @Date:         2023年8月25日 下午1:37:22
+	 */
+	public static List<ShipShPortResultVO> publicStrategyHandle(List<ShipShPortResultVO> strategy, String voyageFieldName) {
+		// 每笔数据只保留一个箱子
+		Map<String, List<ShipShPortResultVO>> groupTemp = strategy.stream().collect(Collectors.groupingBy(vo -> vo.getContainerNumber()));
+		
+		List<ShipShPortResultVO> strategyTemp = groupTemp.get(strategy.get(0).getContainerNumber()); 
+		// 按照船名数据类型分组，一组靠泊，一组船期
+		Map<String, List<ShipShPortResultVO>> shipTypeList = strategyTemp.stream().collect(Collectors.groupingBy(vo -> vo.getShipNameType()));
+		if(shipTypeList.size() < 2) {
+			// 说明全是靠泊或者全是船期
+			return null;
+		}
+		// 判断靠泊航次和船期航次是否有些仅有一条，并且完全一致
+		if(shipTypeList.get(CommonInfo.PORT_SH_SHIPNAMETYPE_ANCHORAGE).size() == 1 && shipTypeList.get(CommonInfo.PORT_SH_SHIPNAMETYPE_SHIP).size() == 1
+			&& getFieldInfo(shipTypeList.get(CommonInfo.PORT_SH_SHIPNAMETYPE_ANCHORAGE).get(0), voyageFieldName).equals(getFieldInfo(shipTypeList.get(CommonInfo.PORT_SH_SHIPNAMETYPE_SHIP).get(0), voyageFieldName))) {
+				//船期里面的 （计划地锚地时间或者实际地锚地时间 - 取晚的） 与  靠泊里面的  预计靠泊时间 对比， 取晚的时间对应的数据
+				//先判断计划地锚和实际地锚，取晚的
+				Date anchorageTime = StrategyUtil.dateCompare(shipTypeList.get(CommonInfo.PORT_SH_SHIPNAMETYPE_SHIP).get(0).getExpectAnchorageTime(), shipTypeList.get(CommonInfo.PORT_SH_SHIPNAMETYPE_SHIP).get(0).getActualAnchorageTime());
+				//再判断地锚和靠泊，取晚的时间对应的那一笔数据
+				if(anchorageTime == null || (shipTypeList.get(CommonInfo.PORT_SH_SHIPNAMETYPE_SHIP).get(0).getExpectArrivalTime() != null && anchorageTime.after(shipTypeList.get(CommonInfo.PORT_SH_SHIPNAMETYPE_SHIP).get(0).getExpectArrivalTime()))) {
+					//选船期的数据  anchorageTime就是最晚的
+					strategy = strategy.stream().filter(vo -> vo.getShipNameType().equals(CommonInfo.PORT_SH_SHIPNAMETYPE_SHIP)).collect(Collectors.toList());
+					strategy.forEach(v -> v.setExpectArrivalTime(anchorageTime));
+				}else {
+					//选靠泊的数据  shipTypeList.get(CommonInfo.PORT_SH_SHIPNAMETYPE_SHIP).get(0).getExpectArrivalTime()就是最晚的
+					strategy = strategy.stream().filter(vo -> vo.getShipNameType().equals(CommonInfo.PORT_SH_SHIPNAMETYPE_ANCHORAGE)).collect(Collectors.toList());
+					strategy.forEach(v -> v.setExpectArrivalTime(shipTypeList.get(CommonInfo.PORT_SH_SHIPNAMETYPE_ANCHORAGE).get(0).getExpectArrivalTime()));
+				}
+			return strategy;
+		}
+		return null;
+	}
+	/**
+	 * 
+	 * @Title:        publicStrategyETAHandle 
+	 * @Description:  处理预计靠港时间
+	 * @param:        @param strategyHandle
+	 * @param:        @param xcsjList
+	 * @param:        @param ywHddz
+	 * @param:        @return    
+	 * @return:       YwHddz    
+	 * @author:       gubj
+	 * @Date:         2023年8月28日 下午1:18:37
+	 */
+	public static YwHddz publicStrategyETAHandle(ShipShPortResultVO strategyHandle, List<Date> xcsjList, YwHddz ywHddz) {
+		if(strategyHandle.getExpectArrivalTime() != null) {
+			if(xcsjList.size() > 0 && xcsjList.get(0).after(strategyHandle.getExpectArrivalTime())) {
+				//将最早的卸船时间当作eta
+				ywHddz.setYjkgsj(xcsjList.get(0));
+			}else {
+				//eta小于等于当前时间且有ata  或者eta大于当前时间，直接反写
+				if((null != strategyHandle.getActualPortTime() && !(new Date().after(strategyHandle.getExpectArrivalTime())))
+						|| new Date().before(strategyHandle.getExpectArrivalTime())
+						) {
+					//直接反写
+					ywHddz.setYjkgsj(strategyHandle.getExpectArrivalTime());
+				}
+				if((null == strategyHandle.getActualPortTime() && !(new Date().before(strategyHandle.getExpectArrivalTime())))
+					) {
+					// ETA<=当前时间&无ATA，反写到靠港管理_系统抓取靠泊时间
+					ywHddz.setJhkbsj(strategyHandle.getExpectArrivalTime());
+				}
+			}
+		}
+		return ywHddz;
+	}
+	/**
+	 * 
+	 * @Title:        publicStrategyATAHandle 
+	 * @Description:  处理实际靠港时间
+	 * @param:        @param strategyHandle
+	 * @param:        @param xcsjList
+	 * @param:        @param ywHddz
+	 * @param:        @return    
+	 * @return:       YwHddz    
+	 * @author:       gubj
+	 * @Date:         2023年8月28日 下午1:19:58
+	 */
+	public static YwHddz publicStrategyATAHandle(ShipShPortResultVO strategyHandle, List<Date> xcsjList, YwHddz ywHddz) {
+		if(strategyHandle.getActualPortTime() != null) {
+			//判断卸船时间
+			if(xcsjList.size() > 0 && !(xcsjList.get(0).before(strategyHandle.getActualPortTime()))) {
+				// 取最早卸船时间>=ATA，反写
+				ywHddz.setSjkgsj(strategyHandle.getActualPortTime());
+			}else if(!(new Date().before(strategyHandle.getActualPortTime()))){
+				// ATA<=当前时间，直接反写
+				ywHddz.setSjkgsj(strategyHandle.getActualPortTime());
+			}
+		}
+		return ywHddz;
+	}
+}
Index: jinan/trunk/yunna/src/main/java/com/freshport/util/YunnaStrategyEnum.java
===================================================================
--- jinan/trunk/yunna/src/main/java/com/freshport/util/YunnaStrategyEnum.java	(revision 0)
+++ jinan/trunk/yunna/src/main/java/com/freshport/util/YunnaStrategyEnum.java	(revision 34922)
@@ -0,0 +1,41 @@
+package com.freshport.util;
+
+public enum YunnaStrategyEnum {
+
+
+	YS000("com.freshport.service.impl.strategy.YunnaStrategy000"),
+	YS001("com.freshport.service.impl.strategy.YunnaStrategy001"),
+	
+	YS002("com.freshport.service.impl.strategy.YunnaStrategy002"),
+    
+	YS003("com.freshport.service.impl.strategy.YunnaStrategy003"),
+	
+	YS004("com.freshport.service.impl.strategy.YunnaStrategy004"),
+    
+	YS005("com.freshport.service.impl.strategy.YunnaStrategy005"),
+	
+	YS006("com.freshport.service.impl.strategy.YunnaStrategy006"),
+	
+	YS007("com.freshport.service.impl.strategy.YunnaStrategy007"),
+	YS008("com.freshport.service.impl.strategy.YunnaStrategy008"),
+	YS009("com.freshport.service.impl.strategy.YunnaStrategy009"),
+	YS010("com.freshport.service.impl.strategy.YunnaStrategy010"),
+	YS011("com.freshport.service.impl.strategy.YunnaStrategy011"),
+	YS012("com.freshport.service.impl.strategy.YunnaStrategy012"),
+	YS013("com.freshport.service.impl.strategy.YunnaStrategy013"),
+	YS014("com.freshport.service.impl.strategy.YunnaStrategy014");
+
+    YunnaStrategyEnum(String className) {
+        this.setClassName(className);
+    }
+
+    private String className;
+
+    public String getClassName() {
+        return className;
+    }
+
+    public void setClassName(String className) {
+        this.className = className;
+    }
+}
Index: jinan/trunk/yunna/src/main/java/com/freshport/util/activemq/CustomerQueueYunna.java
===================================================================
--- jinan/trunk/yunna/src/main/java/com/freshport/util/activemq/CustomerQueueYunna.java	(revision 34921)
+++ jinan/trunk/yunna/src/main/java/com/freshport/util/activemq/CustomerQueueYunna.java	(revision 34922)
@@ -12,6 +12,7 @@
 import com.freshport.service.YunnaShipService;
 import com.freshport.util.CommonInfo;
 import com.freshport.util.CommonUtils;
+import com.freshport.util.ShipPortEnum;
 
 import lombok.extern.slf4j.Slf4j;
 
@@ -57,6 +58,9 @@
                 yunnaShipService.handleDate(queueVo.getBatchNo());
             } else if (CommonInfo.TYPE_PORT.equals(queueVo.getType())) { // 处理港口信息
                 yunnaPortService.handleDate(queueVo.getBatchNo());
+            } else if (ShipPortEnum.PORT_SH.getCode().equals(queueVo.getType()) || 
+            		ShipPortEnum.PORT_SH_TMP.getCode().equals(queueVo.getType())) { // 处理上海港信息
+            	yunnaPortService.handleShDate(queueVo.getBatchNo());
             }
         }
     }
Index: jinan/trunk/yunna/src/main/java/com/freshport/util/aspect/StrategyAsp.java
===================================================================
--- jinan/trunk/yunna/src/main/java/com/freshport/util/aspect/StrategyAsp.java	(revision 0)
+++ jinan/trunk/yunna/src/main/java/com/freshport/util/aspect/StrategyAsp.java	(revision 34922)
@@ -0,0 +1,14 @@
+package com.freshport.util.aspect;
+import java.lang.annotation.Documented;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+
+@Target({ ElementType.METHOD })
+@Retention(RetentionPolicy.RUNTIME)
+@Documented
+public @interface StrategyAsp {
+
+}
Index: jinan/trunk/yunna/src/main/java/com/freshport/util/aspect/YunnaStrateguAspect.java
===================================================================
--- jinan/trunk/yunna/src/main/java/com/freshport/util/aspect/YunnaStrateguAspect.java	(revision 0)
+++ jinan/trunk/yunna/src/main/java/com/freshport/util/aspect/YunnaStrateguAspect.java	(revision 34922)
@@ -0,0 +1,46 @@
+package com.freshport.util.aspect;
+
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+import javax.annotation.Resource;
+
+import org.aspectj.lang.JoinPoint;
+import org.aspectj.lang.annotation.AfterReturning;
+import org.aspectj.lang.annotation.Aspect;
+import org.aspectj.lang.annotation.Pointcut;
+import org.springframework.stereotype.Component;
+
+import com.freshport.entity.yunna.ShipShPortResultVO;
+import com.freshport.service.StrategyFactory;
+import com.freshport.service.YunnaStrategy;
+
+
+@Aspect
+@Component
+public class YunnaStrateguAspect {
+	
+	@Resource
+	private StrategyFactory strategyFactory;
+    
+    @Pointcut(value = "@annotation(com.freshport.util.aspect.StrategyAsp)")
+    public void yunnaAspect() {
+    }
+    
+    //策略分发器
+    @AfterReturning(value = "yunnaAspect()", returning = "returnValue")
+    public void afterReutrn(JoinPoint joinPoint, Map<String, List<ShipShPortResultVO>> returnValue) throws Exception {
+		String nextKey = "";
+		List<ShipShPortResultVO> nextList = new ArrayList<ShipShPortResultVO>();
+		for (Map.Entry<String, List<ShipShPortResultVO>> entry : returnValue.entrySet()) {
+			nextKey = entry.getKey();
+			nextList = entry.getValue();
+		}
+		// 初始化一个策略对象
+		YunnaStrategy strategy = strategyFactory.getDeduction(nextKey);
+		//ִ 执行
+		strategy.execute(nextList);
+    }
+}
