Index: jinan/trunk/yunna/src/main/java/com/freshport/common/filter/XSSFilter.java
===================================================================
--- jinan/trunk/yunna/src/main/java/com/freshport/common/filter/XSSFilter.java	(revision 33825)
+++ jinan/trunk/yunna/src/main/java/com/freshport/common/filter/XSSFilter.java	(revision 33826)
@@ -27,10 +27,10 @@
     @Override
     public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
             throws IOException, ServletException {
-        log.info("======XSSFilter==1111====");
+        // log.info("======XSSFilter==1111====");
         NewXssHttpServletRequestWrapper xssRequest = new NewXssHttpServletRequestWrapper((HttpServletRequest) request);
         chain.doFilter(xssRequest, response);
-        log.info("======XSSFilter=2222=====");
+        // log.info("======XSSFilter=2222=====");
     }
 
     @Override


Index: jinan/trunk/yunna/src/main/java/com/freshport/config/GlobalExceptionHandler.java
===================================================================
--- jinan/trunk/yunna/src/main/java/com/freshport/config/GlobalExceptionHandler.java	(revision 0)
+++ jinan/trunk/yunna/src/main/java/com/freshport/config/GlobalExceptionHandler.java	(revision 33826)
@@ -0,0 +1,97 @@
+package com.freshport.config;
+
+import javax.annotation.Resource;
+
+import org.springframework.web.bind.annotation.ControllerAdvice;
+import org.springframework.web.bind.annotation.ExceptionHandler;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+import com.freshport.entity.JsonModel;
+import com.freshport.service.FruitShipPortService;
+import com.freshport.util.BaseException;
+import com.freshport.util.CommonInfo;
+import com.freshport.util.ShipPortDBException;
+
+import lombok.extern.slf4j.Slf4j;
+
+/**
+ * 全局异常处理器
+ *     
+ * 项目名称：yunna    
+ * 类名称：GlobalExceptionHandler    
+ * 类描述：    
+ * 创建人：lixd    
+ * 创建时间：2023年4月8日 下午5:21:27    
+ * 修改人：lixd    
+ * 修改时间：2023年4月8日 下午5:21:27    
+ * 修改备注：    
+ * @version     
+ *
+ */
+@Slf4j
+@ControllerAdvice
+public class GlobalExceptionHandler {
+
+    @Resource
+    private FruitShipPortService fruitShipPortService;
+
+    /**
+     * 
+     * handleDataBaseException(处理数据库异常)        
+     * @param e
+     * @return  
+     * @return JsonModel<Object>  
+     * @Exception 异常对象    
+     * @author lixd  
+     * @date 2023-04-08 17:21:58
+     */
+    @ExceptionHandler(ShipPortDBException.class)
+    @ResponseBody
+    public JsonModel<Object> handleDataBaseException(ShipPortDBException e) {
+        log.info("-----handleDataBaseException--code:{}, msg:{}", e.getErrorCode(), e.getMessage());
+        e.printStackTrace();
+        fruitShipPortService.saveShipPortError(CommonInfo.ERROR_CODE_DATABASE, "", e.getMessage());
+
+        return JsonModel.error();
+    }
+
+    /**
+     * 
+     * handleBaseException(处理业务异常)      
+     * @param e
+     * @return  
+     * @return JsonModel<Object>  
+     * @Exception 异常对象    
+     * @author lixd  
+     * @date 2023-04-08 17:22:13
+     */
+    @ExceptionHandler(BaseException.class)
+    @ResponseBody
+    public JsonModel<Object> handleBaseException(BaseException e) {
+        log.info("-----handleBaseException--code:{}, msg:{}", e.getErrorCode(), e.getMessage());
+        e.printStackTrace();
+
+        return JsonModel.errorParam(e.getErrorCode(), e.getMessage());
+    }
+
+    /**
+     * 
+     * handleException(处理系统异常)        
+     * @param e
+     * @return  
+     * @return JsonModel<Object>  
+     * @Exception 异常对象    
+     * @author lixd  
+     * @date 2023-04-08 17:22:33
+     */
+    @ExceptionHandler(Exception.class)
+    @ResponseBody
+    public JsonModel<Object> handleException(Exception e) {
+        log.info("-----handleException--msg:{}", e.getMessage());
+        e.printStackTrace();
+        fruitShipPortService.saveShipPortError(CommonInfo.ERROR_CODE_PROGRAM, "", e.getMessage());
+
+        return JsonModel.error();
+    }
+
+}
Index: jinan/trunk/yunna/src/main/java/com/freshport/config/LogRecordAspect.java
===================================================================
--- jinan/trunk/yunna/src/main/java/com/freshport/config/LogRecordAspect.java	(revision 0)
+++ jinan/trunk/yunna/src/main/java/com/freshport/config/LogRecordAspect.java	(revision 33826)
@@ -0,0 +1,120 @@
+package com.freshport.config;
+
+import java.lang.reflect.Field;
+import java.net.URLDecoder;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.aspectj.lang.ProceedingJoinPoint;
+import org.aspectj.lang.annotation.Around;
+import org.aspectj.lang.annotation.Aspect;
+import org.aspectj.lang.annotation.Pointcut;
+import org.slf4j.MDC;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.web.context.request.RequestAttributes;
+import org.springframework.web.context.request.RequestContextHolder;
+import org.springframework.web.context.request.ServletRequestAttributes;
+import org.springframework.web.servlet.HandlerMapping;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+
+import lombok.extern.slf4j.Slf4j;
+
+/**
+ * controller层入参/出参日志打印，复制admin项目
+ *     
+ * 项目名称：yunna    
+ * 类名称：LogRecordAspect    
+ * 类描述：    
+ * 创建人：lixd    
+ * 创建时间：2023年4月8日 下午6:05:14    
+ * 修改人：lixd    
+ * 修改时间：2023年4月8日 下午6:05:14    
+ * 修改备注：    
+ * @version     
+ *
+ */
+@Aspect
+@Configuration // 定义一个切面
+@Slf4j
+public class LogRecordAspect {
+
+    // 定义切点Pointcut
+    @Pointcut("execution(* com.freshport.control..*.*(..))")
+    public void excudeService() {
+    }
+
+    @SuppressWarnings("rawtypes")
+    @Around("excudeService()")
+    public Object doAround(ProceedingJoinPoint pjp) throws Throwable {
+        RequestAttributes ra = RequestContextHolder.getRequestAttributes();
+        ServletRequestAttributes sra = (ServletRequestAttributes) ra;
+        HttpServletRequest request = sra.getRequest();
+
+        String userId = String.valueOf(request.getHeader("userId"));
+        String name = String.valueOf(request.getHeader("userName"));
+        String hostIp = String.valueOf(request.getHeader("userHost"));
+        name = URLDecoder.decode(name, "utf-8");
+        MDC.put("userId", userId);
+        MDC.put("userName", name);
+        MDC.put("hostIp", hostIp);
+
+        String method = request.getMethod();
+        String methodName = pjp.getSignature().getName();
+        String queryString = request.getQueryString();
+        Object[] args = pjp.getArgs();
+        String params = "";
+        // 获取请求参数集合并进行遍历拼接
+        if (args.length > 0) {
+            if ("POST".equals(method)) {
+                Object object = args[0];
+                if (!(object instanceof HttpServletRequest)) {
+                    Map<String, Object> map = getKeyAndValue(object);
+                    params = JSON.toJSONString(map);
+                }
+            } else if ("GET".equals(method)) {
+                params = queryString;
+                Map pathVariables = (Map) request.getAttribute(HandlerMapping.URI_TEMPLATE_VARIABLES_ATTRIBUTE);
+                if (pathVariables != null && pathVariables.size() > 0) {
+                    params = JSONObject.toJSONString(pathVariables);
+                }
+            }
+        }
+        log.info("用户id:" + userId + ", 用户名:" + name + ", IP:" + hostIp + ", inner " + methodName + "");
+        log.info("请求参数:" + params);
+        // result的值就是被拦截方法的返回值
+        Object result = pjp.proceed();
+        log.info("返回参数:" + JSONObject.toJSONString(result));
+        log.info("用户id:" + userId + ", 用户名:" + name + ", IP:" + hostIp + ", out " + methodName);
+        MDC.clear();
+        return result;
+    }
+
+    @SuppressWarnings("rawtypes")
+    public static Map<String, Object> getKeyAndValue(Object obj) {
+        Map<String, Object> map = new HashMap<String, Object>();
+        // 得到类对象
+        Class userCla = (Class) obj.getClass();
+        /* 得到类中的所有属性集合 */
+        Field[] fs = userCla.getDeclaredFields();
+        for (int i = 0; i < fs.length; i++) {
+            Field f = fs[i];
+            f.setAccessible(true); // 设置些属性是可以访问的
+            Object val = new Object();
+            try {
+                val = f.get(obj);
+                // 得到此属性的值
+                map.put(f.getName(), val);// 设置键值
+            } catch (IllegalArgumentException e) {
+                e.printStackTrace();
+            } catch (IllegalAccessException e) {
+                e.printStackTrace();
+            }
+
+        }
+        return map;
+    }
+}
Index: jinan/trunk/yunna/src/main/java/com/freshport/control/FruitShipPortControl.java
===================================================================
--- jinan/trunk/yunna/src/main/java/com/freshport/control/FruitShipPortControl.java	(revision 33825)
+++ jinan/trunk/yunna/src/main/java/com/freshport/control/FruitShipPortControl.java	(revision 33826)
@@ -1,6 +1,5 @@
 package com.freshport.control;
 
-import java.util.ArrayList;
 import java.util.List;
 
 import javax.annotation.Resource;
@@ -11,16 +10,11 @@
 import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 
-import com.alibaba.fastjson.JSONObject;
 import com.freshport.entity.JsonModel;
 import com.freshport.entity.yunna.LoadingNumberQueryParam;
 import com.freshport.entity.yunna.LoadingNumberResultVO;
 import com.freshport.entity.yunna.ShipPortResultVO;
 import com.freshport.service.FruitShipPortService;
-import com.freshport.util.BaseException;
-import com.freshport.util.CommonEnum;
-import com.freshport.util.CommonInfo;
-import com.freshport.util.CommonUtils;
 
 import lombok.extern.slf4j.Slf4j;
 
@@ -59,71 +53,8 @@
     @PostMapping("/getLoadingNumberInfo")
     public JsonModel<List<LoadingNumberResultVO>> getLoadingNumberInfo(@RequestBody LoadingNumberQueryParam params) {
 
-        JsonModel<List<LoadingNumberResultVO>> model = new JsonModel<List<LoadingNumberResultVO>>();
-        log.info("========获取提单号接口参数：{}", JSONObject.toJSONString(params));
-
-        if (CommonUtils.isEmpty(params) || CommonUtils.isEmpty(params.getType())) {
-
-            model.setCode(CommonEnum.PARAM_ERROR.getCode());
-            model.setDes(CommonEnum.PARAM_ERROR.getRes());
-            fruitShipPortService.saveShipPortLog(JSONObject.toJSON(params).toString(),
-                    JSONObject.toJSON(model).toString(), CommonInfo.LOG_TYPE_LOADING_SHIP, 0, "");
-
-            log.info("========获取提单号接口返回结果：{}", JSONObject.toJSONString(model));
-            return model;
-        }
-        if (!CommonInfo.TYPE_SHIP.equals(params.getType()) && !CommonInfo.TYPE_PORT.equals(params.getType())
-                && !CommonInfo.TYPE_SHIP_TMP.equals(params.getType())
-                && !CommonInfo.TYPE_PORT_TMP.equals(params.getType())) {
-
-            model.setCode(CommonEnum.PARAM_ERROR.getCode());
-            model.setDes(CommonEnum.PARAM_ERROR.getRes());
-            fruitShipPortService.saveShipPortLog(JSONObject.toJSON(params).toString(),
-                    JSONObject.toJSON(model).toString(), params.getType(), 0, "");
-
-            log.info("========获取提单号接口返回结果：{}", JSONObject.toJSONString(model));
-            return model;
-        }
-
-        List<LoadingNumberResultVO> resultList = new ArrayList<LoadingNumberResultVO>();
-        try {
-
-            try {
-                resultList = fruitShipPortService.queryLoadingNumberInfoList(params);
-            } catch (Exception e) {
-                e.printStackTrace();
-                fruitShipPortService.saveShipPortError(CommonInfo.ERROR_CODE_PROGRAM, "",
-                        "查询提单号接口-程序异常：" + e.getMessage());
-            }
-
-            model = JsonModel.success(resultList);
-        } catch (BaseException e) {
-            e.printStackTrace();
-            log.error("getLoadingNumberInfo_error", e.getMessage());
-            model = JsonModel.error(e.getMessage());
-        } catch (Exception e) {
-            e.printStackTrace();
-            log.error("getLoadingNumberInfo_error", e.getMessage());
-            model = JsonModel.error(CommonEnum.API_ERROR.getRes());
-
-            try {
-                fruitShipPortService.saveShipPortError(CommonInfo.ERROR_CODE_PROGRAM, "",
-                        "查询提单号接口-程序异常：" + e.getMessage());
-            } catch (Exception ex) {
-                ex.printStackTrace();
-            }
-        }
-        String batchNo = "";
-        if (!CommonUtils.isEmpty(resultList) && resultList.size() > 0) {
-
-            // 1. 保存日志表
-            batchNo = resultList.get(0).getBatchNo();
-        }
-        fruitShipPortService.saveShipPortLog(JSONObject.toJSON(params).toString(), JSONObject.toJSON(model).toString(),
-                params.getType(), resultList.size(), batchNo);
-
-        log.info("========获取提单号接口返回结果：{}", JSONObject.toJSONString(model));
-        return model;
+        List<LoadingNumberResultVO> resultList = fruitShipPortService.queryLoadingNumberInfoList(params);
+        return JsonModel.success(resultList);
     }
 
     /**
@@ -139,58 +70,8 @@
     @PostMapping("/saveShipInfo")
     public JsonModel<Object> saveShipInfo(@RequestBody List<ShipPortResultVO> params) {
 
-        JsonModel<Object> model = new JsonModel<Object>();
-        log.info("========回传船司参数：{}", JSONObject.toJSONString(params));
-
-        if (CommonUtils.isEmpty(params)) {
-            model.setCode(CommonEnum.PARAM_ERROR.getCode());
-            model.setDes(CommonEnum.PARAM_ERROR.getRes());
-            fruitShipPortService.saveShipPortLog(JSONObject.toJSON(params).toString(),
-                    JSONObject.toJSON(model).toString(), CommonInfo.LOG_TYPE_RESULT_SHIP, params.size(), "");
-
-            log.info("========回传船司返回结果：{}", JSONObject.toJSONString(model));
-            return model;
-        }
-
-        try {
-
-            try {
-                fruitShipPortService.saveShipInfo(params);
-            } catch (Exception e) {
-                e.printStackTrace();
-                fruitShipPortService.saveShipPortError(CommonInfo.ERROR_CODE_PROGRAM, "",
-                        "回传船司信息接口-程序异常：" + e.getMessage());
-            }
-
-            model = JsonModel.success(CommonEnum.API_SUCCESS.getRes());
-        } catch (BaseException e) {
-            e.printStackTrace();
-            log.error("saveShipInfo_error", e.getMessage());
-            model = JsonModel.error(e.getMessage());
-        } catch (Exception e) {
-            e.printStackTrace();
-            log.error("saveShipInfo_error", e.getMessage());
-            model = JsonModel.error(CommonEnum.API_ERROR.getRes());
-
-            try {
-                fruitShipPortService.saveShipPortError(CommonInfo.ERROR_CODE_PROGRAM, "",
-                        "回传船司信息接口-程序异常：" + e.getMessage());
-            } catch (Exception ex) {
-                ex.printStackTrace();
-            }
-        }
-
-        String batchNo = "";
-        if (!CommonUtils.isEmpty(params) && params.size() > 0) {
-
-            // 1. 保存日志表
-            batchNo = params.get(0).getBatchNo();
-        }
-        fruitShipPortService.saveShipPortLog(JSONObject.toJSON(params).toString(), JSONObject.toJSON(model).toString(),
-                CommonInfo.LOG_TYPE_RESULT_SHIP, params.size(), batchNo);
-
-        log.info("========回传船司返回结果：{}", JSONObject.toJSONString(model));
-        return model;
+        fruitShipPortService.saveShipInfo(params);
+        return JsonModel.success(null);
     }
 
     /**
@@ -206,58 +87,8 @@
     @PostMapping("/savePortInfo")
     public JsonModel<Object> savePortInfo(@RequestBody List<ShipPortResultVO> params) {
 
-        JsonModel<Object> model = new JsonModel<Object>();
-        log.info("========回传港口参数：{}", JSONObject.toJSONString(params));
-
-        if (CommonUtils.isEmpty(params)) {
-            model.setCode(CommonEnum.PARAM_ERROR.getCode());
-            model.setDes(CommonEnum.PARAM_ERROR.getRes());
-
-            fruitShipPortService.saveShipPortLog(JSONObject.toJSON(params).toString(),
-                    JSONObject.toJSON(model).toString(), CommonInfo.LOG_TYPE_RESULT_PORT, params.size(), "");
-
-            log.info("========回传港口返回结果：{}", JSONObject.toJSONString(model));
-            return model;
-        }
-        try {
-
-            try {
-                fruitShipPortService.savePortInfo(params);
-            } catch (Exception e) {
-                e.printStackTrace();
-                fruitShipPortService.saveShipPortError(CommonInfo.ERROR_CODE_PROGRAM, "",
-                        "回传港口信息接口-程序异常：" + e.getMessage());
-            }
-
-            model = JsonModel.success(CommonEnum.API_SUCCESS.getRes());
-        } catch (BaseException e) {
-            e.printStackTrace();
-            log.error("savePortInfo_error", e.getMessage());
-            model = JsonModel.error(e.getMessage());
-        } catch (Exception e) {
-            e.printStackTrace();
-            log.error("savePortInfo_error", e.getMessage());
-            model = JsonModel.error(CommonEnum.API_ERROR.getRes());
-
-            try {
-                fruitShipPortService.saveShipPortError(CommonInfo.ERROR_CODE_PROGRAM, "",
-                        "回传港口信息接口-程序异常：" + e.getMessage());
-            } catch (Exception ex) {
-                ex.printStackTrace();
-            }
-        }
-
-        String batchNo = "";
-        if (!CommonUtils.isEmpty(params) && params.size() > 0) {
-
-            // 1. 保存日志表
-            batchNo = params.get(0).getBatchNo();
-        }
-        fruitShipPortService.saveShipPortLog(JSONObject.toJSON(params).toString(), JSONObject.toJSON(model).toString(),
-                CommonInfo.LOG_TYPE_RESULT_PORT, params.size(), batchNo);
-
-        log.info("========回传港口返回结果：{}", JSONObject.toJSONString(model));
-        return model;
+        fruitShipPortService.savePortInfo(params);
+        return JsonModel.success(null);
     }
 
     /**
@@ -275,33 +106,8 @@
     public JsonModel<Object> savePortOrShipInfo(@RequestParam("type") String type,
             @RequestParam("batchNo") String batchNo) {
 
-        JsonModel<Object> model = new JsonModel<Object>();
-        log.info("========手动更新船司/港口信息-参数：type:{}, batchNo:{}", type, batchNo);
-
-        if (CommonUtils.isEmpty(type) || CommonUtils.isEmpty(batchNo)) {
-            model.setCode(CommonEnum.PARAM_ERROR.getCode());
-            model.setDes(CommonEnum.PARAM_ERROR.getRes());
-
-            log.info("========手动更新船司/港口信息-返回结果：{}", JSONObject.toJSONString(model));
-            return model;
-        }
-        try {
-
-            fruitShipPortService.savePortOrShipInfo(type, batchNo);
-
-            model = JsonModel.success(CommonEnum.API_SUCCESS.getRes());
-        } catch (BaseException e) {
-            e.printStackTrace();
-            log.error("savePortOrShipInfo_error", e.getMessage());
-            model = JsonModel.error(e.getMessage());
-        } catch (Exception e) {
-            e.printStackTrace();
-            log.error("savePortOrShipInfo_error", e.getMessage());
-            model = JsonModel.error(CommonEnum.API_ERROR.getRes());
-        }
-
-        log.info("========手动更新船司/港口信息-返回结果：{}", JSONObject.toJSONString(model));
-        return model;
+        fruitShipPortService.savePortOrShipInfo(type, batchNo);
+        return JsonModel.success(null);
     }
 
 }
Index: jinan/trunk/yunna/src/main/java/com/freshport/entity/YwShipPortError.java
===================================================================
--- jinan/trunk/yunna/src/main/java/com/freshport/entity/YwShipPortError.java	(revision 33825)
+++ jinan/trunk/yunna/src/main/java/com/freshport/entity/YwShipPortError.java	(revision 33826)
@@ -2,6 +2,9 @@
 
 import java.util.Date;
 
+import lombok.Builder;
+
+@Builder
 public class YwShipPortError {
     private String id;
 
Index: jinan/trunk/yunna/src/main/java/com/freshport/entity/YwShipPortLog.java
===================================================================
--- jinan/trunk/yunna/src/main/java/com/freshport/entity/YwShipPortLog.java	(revision 33825)
+++ jinan/trunk/yunna/src/main/java/com/freshport/entity/YwShipPortLog.java	(revision 33826)
@@ -2,6 +2,9 @@
 
 import java.util.Date;
 
+import lombok.Builder;
+
+@Builder
 public class YwShipPortLog {
     private String ysplId;
 
Index: jinan/trunk/yunna/src/main/java/com/freshport/entity/YwShipPortLogWithBLOBs.java
===================================================================
--- jinan/trunk/yunna/src/main/java/com/freshport/entity/YwShipPortLogWithBLOBs.java	(revision 33825)
+++ jinan/trunk/yunna/src/main/java/com/freshport/entity/YwShipPortLogWithBLOBs.java	(revision 33826)
@@ -1,6 +1,20 @@
 package com.freshport.entity;
 
+import java.util.Date;
+
+import lombok.Builder;
+
 public class YwShipPortLogWithBLOBs extends YwShipPortLog {
+
+    @Builder(builderMethodName = "childBuilder")
+    YwShipPortLogWithBLOBs(String ysplId, String type, String remark, String crtUser, Date crtTime, String crtHost,
+            String updUser, Date updTime, String updHost, String batchNo, Integer totalNumber, String msg,
+            String result) {
+        super(ysplId, type, remark, crtUser, crtTime, crtHost, updUser, updTime, updHost, batchNo, totalNumber);
+        this.msg = msg;
+        this.result = result;
+    }
+
     private String msg;
 
     private String result;
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 33825)
+++ jinan/trunk/yunna/src/main/java/com/freshport/service/impl/FruitShipPortServiceImpl.java	(revision 33826)
@@ -9,19 +9,19 @@
  */
 package com.freshport.service.impl;
 
+import java.lang.reflect.InvocationTargetException;
 import java.util.ArrayList;
-import java.util.Arrays;
 import java.util.Calendar;
 import java.util.Date;
 import java.util.List;
 import java.util.UUID;
-import java.util.concurrent.ThreadPoolExecutor;
 
 import javax.annotation.Resource;
 
-import org.springframework.beans.factory.annotation.Autowired;
+import org.apache.commons.beanutils.BeanUtils;
 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.JSONObject;
@@ -29,6 +29,7 @@
 import com.freshport.dao.YwShipPortLoadingMapper;
 import com.freshport.dao.YwShipPortLogMapper;
 import com.freshport.dao.YwShipPortResultMapper;
+import com.freshport.entity.JsonModel;
 import com.freshport.entity.YwShipPortError;
 import com.freshport.entity.YwShipPortLoading;
 import com.freshport.entity.YwShipPortLogWithBLOBs;
@@ -40,9 +41,12 @@
 import com.freshport.service.PortService;
 import com.freshport.service.ShipService;
 import com.freshport.util.BaseException;
+import com.freshport.util.CommonEnum;
 import com.freshport.util.CommonInfo;
 import com.freshport.util.CommonUtils;
 import com.freshport.util.DateUtils;
+import com.freshport.util.ShipPortDBException;
+import com.freshport.util.ShipPortEnum;
 
 import lombok.extern.slf4j.Slf4j;
 
@@ -64,9 +68,6 @@
 @Service("fruitShipPortService")
 public class FruitShipPortServiceImpl implements FruitShipPortService {
 
-    public static List<String> prefixList = new ArrayList<String>(
-            Arrays.asList(CommonInfo.TYPE_SHIP, CommonInfo.TYPE_PORT));
-
     @Resource
     private ShipService shipService;
 
@@ -88,54 +89,42 @@
     @Resource
     private YwShipPortErrorMapper ywShipPortErrorMapper;
 
+    @SuppressWarnings("rawtypes")
     @Resource
     private RedisTemplate redisTemplate;
 
-    @Autowired
-    private ThreadPoolExecutor threadPoolExecutor;
-
-    // @Transactional(propagation = Propagation.NOT_SUPPORTED, readOnly = true)
+    @Transactional(propagation = Propagation.NOT_SUPPORTED, readOnly = true)
     @Override
     public List<LoadingNumberResultVO> queryLoadingNumberInfoList(LoadingNumberQueryParam params) {
 
+        if (CommonUtils.isEmpty(params)) {
+            throw new BaseException(CommonEnum.PARAM_ERROR.getCode(), "参数为空");
+        }
+        if (CommonUtils.isEmpty(ShipPortEnum.getShipPortEnum(params.getType()))) {
+            throw new BaseException(CommonEnum.PARAM_ERROR.getCode(), "参数类型错误");
+        }
+
         List<LoadingNumberResultVO> result = new ArrayList<LoadingNumberResultVO>();
+        if (ShipPortEnum.SHIP.getCode().equals(params.getType())) {
 
-        try {
-            if (CommonInfo.TYPE_SHIP.equals(params.getType())) {
+            result = shipService.queryLoadingNumberInfoList();
+        } else if (ShipPortEnum.SHIP_TMP.getCode().equals(params.getType())) {
 
-                result = shipService.queryLoadingNumberInfoList();
-            } else if (CommonInfo.TYPE_SHIP_TMP.equals(params.getType())) {
+            result = shipService.queryLoadingNumberInfoListForTmp();
+        } else if (ShipPortEnum.PORT.getCode().equals(params.getType())) {
 
-                result = shipService.queryLoadingNumberInfoListForTmp();
-            } else if (CommonInfo.TYPE_PORT.equals(params.getType())) {
+            result = portService.queryLoadingNumberInfoList();
+        } else if (ShipPortEnum.PORT_TMP.getCode().equals(params.getType())) {
 
-                result = portService.queryLoadingNumberInfoList();
-            } else if (CommonInfo.TYPE_PORT_TMP.equals(params.getType())) {
-
-                result = portService.queryLoadingNumberInfoListForTmp();
-            }
-        } catch (Exception e) {
-            try {
-                fruitShipPortService.saveShipPortError(CommonInfo.ERROR_CODE_PROGRAM, "",
-                        "查询提单号信息-程序异常：" + e.getMessage());
-            } catch (Exception ex) {
-                ex.printStackTrace();
-            }
+            result = portService.queryLoadingNumberInfoListForTmp();
         }
         log.info("===============查询提单号类型：{}, 返回结果条数：{}", params.getType(), result.size());
 
-        if (!CommonUtils.isEmpty(result) && result.size() > 0) {
+        String batchNo = "";
+        if (!CommonUtils.isEmpty(result)) {
 
-            String batchNo = "";
-            String type = "";
-            if (CommonInfo.TYPE_SHIP.equals(params.getType()) || CommonInfo.TYPE_SHIP_TMP.equals(params.getType())) {
-                batchNo = getShipPortNoFromRedis(CommonInfo.TYPE_SHIP);
-                type = CommonInfo.TYPE_SHIP;
-            } else if (CommonInfo.TYPE_PORT.equals(params.getType())
-                    || CommonInfo.TYPE_PORT_TMP.equals(params.getType())) {
-                batchNo = getShipPortNoFromRedis(CommonInfo.TYPE_PORT);
-                type = CommonInfo.TYPE_PORT;
-            }
+            String type = ShipPortEnum.getShipPortEnum(params.getType()).getPrefix();
+            batchNo = getShipPortNoFromRedis(type);
             log.info("===============生成批次号：{}", batchNo);
 
             for (LoadingNumberResultVO vo : result) {
@@ -145,6 +134,10 @@
             // 保存传过去原始提单号数据
             fruitShipPortService.saveShipPortLoading(result, type, batchNo);
         }
+        // 保存日志表
+        fruitShipPortService.saveShipPortLog(JSONObject.toJSON(params).toString(),
+                JSONObject.toJSON(JsonModel.success(result)).toString(),
+                ShipPortEnum.getShipPortEnum(params.getType()).getLogType(), result.size(), batchNo);
 
         return result;
     }
@@ -161,7 +154,7 @@
         }
 
         try {
-            if (!CommonUtils.isEmpty(loadingList) && loadingList.size() > 0) {
+            if (!CommonUtils.isEmpty(loadingList)) {
                 // 分组保存
                 List<List<YwShipPortLoading>> splitList = CommonUtils.splitList(loadingList,
                         CommonInfo.SQLSERVER_BATCH_GROUPING_COUNT_HUNDRED_150);
@@ -170,12 +163,10 @@
                 }
             }
         } catch (Exception e) {
-            try {
-                fruitShipPortService.saveShipPortError(CommonInfo.ERROR_CODE_DATABASE, batchNo,
-                        "保存yw_ship_port_loading-数据库异常：" + e.getMessage());
-            } catch (Exception ex) {
-                ex.printStackTrace();
-            }
+
+            e.printStackTrace();
+            throw new ShipPortDBException("saveShipPortLoading_error",
+                    "保存yw_ship_port_loading-数据库异常:" + e.getMessage());
         }
     }
 
@@ -191,48 +182,33 @@
      * @date 2023-03-27 09:46:36
      */
     private YwShipPortLoading createShipPortLoading(String type, LoadingNumberResultVO vo) {
+
         YwShipPortLoading lad = new YwShipPortLoading();
+        try {
+            BeanUtils.copyProperties(lad, vo);
+        } catch (IllegalAccessException | InvocationTargetException e) {
+            e.printStackTrace();
+        }
         lad.setYsplId(UUID.randomUUID().toString());
-        lad.setBatchNo(vo.getBatchNo());
-        lad.setLoadingNumber(vo.getLoadingNumber());
-        lad.setContainerNumber(vo.getContainerNumber());
-        lad.setBusinessNo(vo.getBusinessNo());
         lad.setType(type);
-        lad.setDestinationPort(vo.getDestinationPort());
-        lad.setShipName(vo.getShipName());
-        lad.setTransitShipName(vo.getTransitShipName());
-        lad.setFirmName(vo.getFirmName());
+
         return lad;
     }
 
     @Transactional
     @Override
     public void saveShipPortLog(String msg, String result, String type, Integer totalNumber, String batchNo) {
-        YwShipPortLogWithBLOBs log = new YwShipPortLogWithBLOBs();
-        log.setYsplId(UUID.randomUUID().toString());
-        log.setMsg(msg);
-        log.setResult(result);
-        if (type.contains(CommonInfo.TYPE_SHIP)) {
-            log.setType(CommonInfo.LOG_TYPE_LOADING_SHIP);
-        } else if (type.contains(CommonInfo.TYPE_PORT)) {
-            log.setType(CommonInfo.LOG_TYPE_LOADING_PORT);
-        } else {
-            log.setType(type);
-        }
-        log.setTotalNumber(totalNumber);
-        log.setBatchNo(batchNo);
-        log.setCrtTime(new Date());
+        YwShipPortLogWithBLOBs log = YwShipPortLogWithBLOBs.childBuilder().ysplId(UUID.randomUUID().toString()).msg(msg)
+                .result(result).totalNumber(totalNumber).batchNo(batchNo).crtTime(new Date()).type(type).build();
 
         try {
             ywShipPortLogMapper.insert(log);
         } catch (Exception e) {
-            try {
-                fruitShipPortService.saveShipPortError(CommonInfo.ERROR_CODE_DATABASE, batchNo,
-                        "保存yw_ship_port_log-数据库异常：" + e.getMessage());
-            } catch (Exception ex) {
-                ex.printStackTrace();
-            }
+
+            e.printStackTrace();
+            throw new ShipPortDBException("saveShipPortLog_error", "保存yw_ship_port_log-数据库异常:" + e.getMessage());
         }
+
     }
 
     @Transactional
@@ -248,7 +224,7 @@
         }
 
         try {
-            if (!CommonUtils.isEmpty(resultList) && resultList.size() > 0) {
+            if (!CommonUtils.isEmpty(resultList)) {
                 // 分组保存
                 List<List<YwShipPortResult>> splitList = CommonUtils.splitList(resultList,
                         CommonInfo.SQLSERVER_BATCH_GROUPING_COUNT_HUNDRED_80);
@@ -257,12 +233,9 @@
                 }
             }
         } catch (Exception e) {
-            try {
-                fruitShipPortService.saveShipPortError(CommonInfo.ERROR_CODE_DATABASE, batchNo,
-                        "保存yw_ship_port_result-数据库异常：" + e.getMessage());
-            } catch (Exception ex) {
-                ex.printStackTrace();
-            }
+
+            e.printStackTrace();
+            throw new ShipPortDBException("saveShipPortResult_error", "保存yw_ship_port_result-数据库异常:" + e.getMessage());
         }
     }
 
@@ -279,27 +252,13 @@
      */
     private YwShipPortResult createShipPortResult(String type, ShipPortResultVO vo) {
         YwShipPortResult rs = new YwShipPortResult();
+        try {
+            BeanUtils.copyProperties(rs, vo);
+        } catch (IllegalAccessException | InvocationTargetException e) {
+            e.printStackTrace();
+        }
         rs.setYsprId(UUID.randomUUID().toString());
         rs.setType(type);
-        rs.setBatchNo(vo.getBatchNo());
-        rs.setLoadingNumber(vo.getLoadingNumber());
-        rs.setContainerNumber(vo.getContainerNumber());
-        rs.setBusinessNo(vo.getBusinessNo());
-        rs.setExpectArrivalTime(vo.getExpectArrivalTime());
-        rs.setActualPortTime(vo.getActualPortTime());
-        rs.setActualSailingTime(vo.getActualSailingTime());
-        rs.setApproachTime(vo.getApproachTime());
-        rs.setActualAnchorageTime(vo.getActualAnchorageTime());
-        rs.setUnloadingTime(vo.getUnloadingTime());
-        rs.setUnloadingPort(vo.getUnloadingPort());
-        rs.setDeparturePort(vo.getDeparturePort());
-        rs.setDestinationPort(vo.getDestinationPort());
-        rs.setTransitPort(vo.getTransitPort());
-        rs.setShipName(vo.getShipName());
-        rs.setTransitShipName(vo.getTransitShipName());
-        rs.setVoyage(vo.getVoyage());
-        rs.setTransitVoyage(vo.getTransitVoyage());
-        rs.setStatus(vo.getStatus());
         // 默认未更新
         rs.setUpdStatus(CommonInfo.COMMON_N_CODE);
         rs.setEtaStatus(CommonInfo.COMMON_N_CODE);
@@ -312,82 +271,69 @@
         return rs;
     }
 
+    @Transactional(propagation = Propagation.NOT_SUPPORTED, readOnly = true)
     @Override
     public void saveShipInfo(List<ShipPortResultVO> result) {
 
         log.info("======================回传船司结果，总条数：{}", result.size());
-        if (!CommonUtils.isEmpty(result) && result.size() > 0) {
+        if (CommonUtils.isEmpty(result)) {
+            throw new BaseException(CommonEnum.PARAM_ERROR.getCode(), "参数为空");
+        }
 
+        if (!CommonUtils.isEmpty(result)) {
+
             String batchNo = result.get(0).getBatchNo();
 
             // 判断数据量是否一致，不一致放入异常信息表
             int loadingNum = ywShipPortLoadingMapper.countByBatchNo(batchNo);
             if (loadingNum != result.size()) {
-                try {
-                    fruitShipPortService.saveShipPortError(CommonInfo.ERROR_CODE_SHIP_NUM, batchNo,
-                            "船司数量异常：(推送数量" + loadingNum + " 返回数量" + result.size() + ")");
-                } catch (Exception ex) {
-                    ex.printStackTrace();
-                }
+                fruitShipPortService.saveShipPortError(CommonInfo.ERROR_CODE_SHIP_NUM, batchNo,
+                        "船司数量异常：(推送数量" + loadingNum + " 返回数量" + result.size() + ")");
             }
 
             // 1. 保存原始数据表
             fruitShipPortService.saveShipPortResult(result, CommonInfo.TYPE_SHIP, batchNo);
 
-            // 2. 预警 / 反写
-            threadPoolExecutor.execute(new Runnable() {
+            // 2. 保存日志
+            fruitShipPortService.saveShipPortLog(JSONObject.toJSON(result).toString(),
+                    JSONObject.toJSON(JsonModel.success(null)).toString(), CommonInfo.LOG_TYPE_RESULT_SHIP,
+                    result.size(), batchNo);
 
-                @Override
-                public void run() {
-
-                    try {
-                        shipService.updateHddzAndWarnningInfo(batchNo);
-                    } catch (Exception e) {
-                        e.printStackTrace();
-                        fruitShipPortService.saveShipPortError(CommonInfo.ERROR_CODE_PROGRAM, batchNo,
-                                "回传船司-反写货代单证信息-程序异常：" + e.getMessage());
-                    }
-                }
-            });
+            // 3. 预警 / 反写
+            shipService.updateHddzAndWarnningInfo(batchNo);
         }
     }
 
+    @Transactional(propagation = Propagation.NOT_SUPPORTED, readOnly = true)
     @Override
     public void savePortInfo(List<ShipPortResultVO> result) {
 
-        if (!CommonUtils.isEmpty(result) && result.size() > 0) {
+        log.info("======================回传港口结果，总条数：{}", result.size());
+        if (CommonUtils.isEmpty(result)) {
+            throw new BaseException(CommonEnum.PARAM_ERROR.getCode(), "参数为空");
+        }
 
+        if (!CommonUtils.isEmpty(result)) {
+
             String batchNo = result.get(0).getBatchNo();
 
             // 判断数据量是否一致，不一致放入异常信息表
             int loadingNum = ywShipPortLoadingMapper.countByBatchNo(batchNo);
             if (loadingNum != result.size()) {
-                try {
-                    fruitShipPortService.saveShipPortError(CommonInfo.ERROR_CODE_PORT_NUM, batchNo,
-                            "港口数量异常：(推送数量" + loadingNum + " 返回数量" + result.size() + ")");
-                } catch (Exception ex) {
-                    ex.printStackTrace();
-                }
+                fruitShipPortService.saveShipPortError(CommonInfo.ERROR_CODE_PORT_NUM, batchNo,
+                        "港口数量异常：(推送数量" + loadingNum + " 返回数量" + result.size() + ")");
             }
 
             // 1. 保存原始数据表
             fruitShipPortService.saveShipPortResult(result, CommonInfo.TYPE_PORT, batchNo);
 
-            // 2. 预警 / 反写 异步 TODO 上线前三天不更新，比对数据
-            threadPoolExecutor.execute(new Runnable() {
+            // 2. 保存日志
+            fruitShipPortService.saveShipPortLog(JSONObject.toJSON(result).toString(),
+                    JSONObject.toJSON(JsonModel.success(null)).toString(), CommonInfo.LOG_TYPE_RESULT_PORT,
+                    result.size(), batchNo);
 
-                @Override
-                public void run() {
-
-                    try {
-                        portService.updateHddzAndWarnningInfo(batchNo);
-                    } catch (Exception e) {
-                        e.printStackTrace();
-                        fruitShipPortService.saveShipPortError(CommonInfo.ERROR_CODE_PROGRAM, batchNo,
-                                "回传港口-反写货代单证信息-程序异常：" + e.getMessage());
-                    }
-                }
-            });
+            // 3. 预警 / 反写 TODO 上线前三天不更新，比对数据
+            portService.updateHddzAndWarnningInfo(batchNo);
         }
     }
 
@@ -414,20 +360,24 @@
             }
 
         } catch (Exception e) {
-            try {
-                fruitShipPortService.saveShipPortError(CommonInfo.ERROR_CODE_DATABASE, "",
-                        "生成Redis批次号失败-数据库异常：" + e.getMessage());
-            } catch (Exception ex) {
-                ex.printStackTrace();
-            }
+            e.printStackTrace();
 
-            // TODO 是否要抛出异常？
-            throw new BaseException("getShipPortNoFromRedis_error", "生成批次号失败");
+            throw new ShipPortDBException(CommonInfo.ERROR_CODE_DATABASE, "生成Redis批次号失败-数据库异常：" + e.getMessage());
         }
 
         return serialNum;
     }
 
+    /**
+     * 
+     * saveShipPortNum2Redis(保存流水号到Redis)      
+     * @param key  
+     * @return void  
+     * @Exception 异常对象    
+     * @author lixd  
+     * @date 2023-04-07 16:24:22
+     */
+    @SuppressWarnings("unchecked")
     private void saveShipPortNum2Redis(String key) {
 
         int totalCount;
@@ -445,6 +395,17 @@
         redisTemplate.opsForValue().set(key, JSONObject.toJSONString(totalCount));
     }
 
+    /**
+     * 
+     * getShipPortSerialNum(获取流水号,重新+1放回Redis)      
+     * @param key
+     * @return  
+     * @return int  
+     * @Exception 异常对象    
+     * @author lixd  
+     * @date 2023-04-07 16:20:31
+     */
+    @SuppressWarnings("unchecked")
     private int getShipPortSerialNum(String key) {
 
         int sqdbhNum = 0;
@@ -463,6 +424,7 @@
         return sqdbhNum;
     }
 
+    @SuppressWarnings("unchecked")
     @Transactional
     @Override
     public void deleteSerialNumFromRedis() {
@@ -475,9 +437,8 @@
             String dataStr = DateUtils.Date2String(date.getTime(), "yyyyMMdd");
             log.info("deleteSerialNumFromRedis--当前日期前一天：{}", dataStr);
 
-            for (String prefix : prefixList) {
-
-                String key = prefix + dataStr;
+            for (ShipPortEnum sp : ShipPortEnum.values()) {
+                String key = sp.getPrefix() + dataStr;
                 log.info("删除的key：{}", key);
                 redisTemplate.delete(key);
             }
@@ -489,29 +450,13 @@
     @Transactional
     @Override
     public void saveShipPortError(String errorCode, String batchNo, String msg) {
-        YwShipPortError error = new YwShipPortError();
-        error.setId(UUID.randomUUID().toString());
-        error.setBatchNo(batchNo);
-        error.setErrorCode(errorCode);
-        error.setCrtTime(new Date());
-        if (msg.length() > 1000) {
-            error.setMsg(msg.substring(0, 1000));
-        } else {
-            error.setMsg(msg);
-        }
-
-        try {
-            ywShipPortErrorMapper.insert(error);
-        } catch (Exception e) {
-            try {
-                fruitShipPortService.saveShipPortError(CommonInfo.ERROR_CODE_DATABASE, batchNo,
-                        "保存yw_ship_port_error-数据库异常：" + e.getMessage());
-            } catch (Exception ex) {
-                ex.printStackTrace();
-            }
-        }
+        YwShipPortError error = YwShipPortError.builder().id(UUID.randomUUID().toString()).batchNo(batchNo)
+                .errorCode(errorCode).crtTime(new Date()).msg(msg.length() > 1000 ? msg.substring(0, 1000) : msg)
+                .build();
+        ywShipPortErrorMapper.insert(error);
     }
 
+    @Transactional(propagation = Propagation.NOT_SUPPORTED, readOnly = true)
     @Override
     public void savePortOrShipInfo(String type, String batchNo) {
         if (CommonInfo.TYPE_SHIP.equals(type)) {
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 33825)
+++ jinan/trunk/yunna/src/main/java/com/freshport/service/impl/PortServiceImpl.java	(revision 33826)
@@ -9,6 +9,7 @@
  */
 package com.freshport.service.impl;
 
+import java.lang.reflect.InvocationTargetException;
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
@@ -17,6 +18,7 @@
 
 import javax.annotation.Resource;
 
+import org.apache.commons.beanutils.BeanUtils;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Propagation;
 import org.springframework.transaction.annotation.Transactional;
@@ -30,6 +32,7 @@
 import com.freshport.util.CommonInfo;
 import com.freshport.util.CommonUtils;
 import com.freshport.util.DateUtils;
+import com.freshport.util.ShipPortDBException;
 
 import lombok.extern.slf4j.Slf4j;
 
@@ -75,25 +78,23 @@
         return shipPortMapper.listLoadingNumberForPortTmp();
     }
 
-    /**
-     *  港口查询到的航次是反写水果通规则：如果水果通里航次有值就直接反写航次，如果水果通航次无值就直接反写提单航次/航班号 字段；
-     *  卸货港区：做映射表后对就反写，没有的就预警出来追加(放bi了)
-     */
+    @Transactional(propagation = Propagation.NOT_SUPPORTED, readOnly = true)
     @Override
     public void updateHddzAndWarnningInfo(String batchNo) {
 
+        /**
+         *  港口查询到的航次是反写水果通规则：如果水果通里航次有值就直接反写航次，如果水果通航次无值就直接反写提单航次/航班号 字段；
+         *  卸货港区：做映射表后对就反写，没有的就预警出来追加(放bi了)
+         */
         List<PortForHddzVO> baseDataList = shipPortMapper.listPortInfoForHddz(batchNo);
         log.info("===========PORT-batchNo={}, 总list.size={}", batchNo, baseDataList.size());
 
-        List<PortForHddzVO> withUnloadingPortList = baseDataList.stream()
-                .filter(vo -> !CommonUtils.isEmpty(vo.getUnloadingPortCode())).collect(Collectors.toList());
-        log.info("=================水果通映射到xhgq的数据有{}条", withUnloadingPortList.size());
+        if (!CommonUtils.isEmpty(baseDataList)) {
 
-        // 获取符合更新条件的数据，更新港口信息
-        if (!CommonUtils.isEmpty(baseDataList) && baseDataList.size() > 0) {
+            // 循环处理ETA和上海抵锚时间
+            for (int i = 0; i < baseDataList.size(); i++) {
 
-            for (PortForHddzVO vo : baseDataList) {
-
+                PortForHddzVO vo = baseDataList.get(i);
                 // 目的港为上海，处理ETA和上海实际抵锚时间 ETA和抵锚时间，两个取最晚的时间
                 if (CommonInfo.PORT_SH.equals(vo.getDestinationPort())) {
                     vo.setNewExpectArrivalTime(handleActualAnchorageTime(vo));
@@ -118,7 +119,7 @@
     public void updatePortResultUpdStatus(List<PortForHddzVO> list) {
 
         try {
-            if (!CommonUtils.isEmpty(list) && list.size() > 0) {
+            if (!CommonUtils.isEmpty(list)) {
                 // 分组保存
                 List<List<PortForHddzVO>> splitList = CommonUtils.splitList(list,
                         CommonInfo.SQLSERVER_BATCH_GROUPING_COUNT_HUNDRED);
@@ -128,12 +129,9 @@
             }
         } catch (Exception e) {
             e.printStackTrace();
-            try {
-                fruitShipPortService.saveShipPortError(CommonInfo.ERROR_CODE_DATABASE, "",
-                        "更新yw_ship_port_result港口upd_status和new_eta_time反写状态-数据库异常：" + e.getMessage());
-            } catch (Exception ex) {
-                ex.printStackTrace();
-            }
+
+            throw new ShipPortDBException("updatePortResultUpdStatus_error",
+                    "更新yw_ship_port_result港口upd_status和new_eta_time反写状态-数据库异常:" + e.getMessage());
         }
     }
 
@@ -171,18 +169,12 @@
             String eta = DateUtils.Date2String(vo.getExpectArrivalTime());
             String dmsj = DateUtils.Date2String(vo.getActualAnchorageTime());
 
-            // eta <= dmsj 抵锚时间晚于ETA
-            if (DateUtils.checkStartAndEndDate(eta, dmsj)) {
-                return vo.getActualAnchorageTime();
-            } else {
-
-                // eta >= dmsj
-                return vo.getExpectArrivalTime();
-            }
+            return DateUtils.checkStartAndEndDate(eta, dmsj) ? vo.getActualAnchorageTime() : vo.getExpectArrivalTime();
         }
         return null;
     }
 
+    @SuppressWarnings("unused")
     @Transactional
     @Override
     public void updateHddzInfoForPort(List<PortForHddzVO> baseDataList) {
@@ -196,14 +188,17 @@
 
             // 分组后的每一组数据都对应列表的一条数据
             String mapKey = entry.getKey();
-            log.debug("@@@@@@@@@@@@@@@@@@@@@ ywbh-mapKey :{} ", mapKey);
             List<PortForHddzVO> mapList = entry.getValue();
-            log.debug("@@@@@@@@@@@@@@@@@@@@@ ywbh-mapList.size= {} ", mapList.size());
 
-            if (!CommonUtils.isEmpty(mapList) && mapList.size() > 0) {
+            if (!CommonUtils.isEmpty(mapList)) {
                 PortForHddzVO list0 = mapList.get(0);
                 PortForHddzVO ywbhVo = new PortForHddzVO();
-                ywbhVo.setLoadingNumber(list0.getLoadingNumber());
+                try {
+                    BeanUtils.copyProperties(ywbhVo, list0);
+                } catch (IllegalAccessException | InvocationTargetException e1) {
+                    e1.printStackTrace();
+                }
+                /**ywbhVo.setLoadingNumber(list0.getLoadingNumber());
                 ywbhVo.setBusinessNo(list0.getBusinessNo());
                 ywbhVo.setExpectArrivalTime(list0.getExpectArrivalTime());
                 ywbhVo.setNewExpectArrivalTime(list0.getNewExpectArrivalTime());
@@ -213,7 +208,7 @@
                 ywbhVo.setUnloadingPort(list0.getUnloadingPort());
                 ywbhVo.setUnloadingPortShortName(list0.getUnloadingPortShortName());
                 ywbhVo.setUnloadingPortFullName(list0.getUnloadingPortFullName());
-                ywbhVo.setUnloadingPortCode(list0.getUnloadingPortCode());
+                ywbhVo.setUnloadingPortCode(list0.getUnloadingPortCode());*/
 
                 ywbhList.add(ywbhVo);
             }
@@ -222,7 +217,7 @@
         log.info("=======================符合更新yw_hddz表港口信息条件的有{}条", ywbhList.size());
         try {
             // 根据业务编号更新ATA、ETA、航次、卸货港区
-            if (!CommonUtils.isEmpty(ywbhList) && ywbhList.size() > 0) {
+            if (!CommonUtils.isEmpty(ywbhList)) {
                 // 分组保存
                 List<List<PortForHddzVO>> splitList = CommonUtils.splitList(ywbhList,
                         CommonInfo.SQLSERVER_BATCH_GROUPING_COUNT_HUNDRED);
@@ -233,20 +228,18 @@
 
         } catch (Exception e) {
             e.printStackTrace();
-            try {
-                fruitShipPortService.saveShipPortError(CommonInfo.ERROR_CODE_DATABASE, "",
-                        "反写yw_hddz港口信息-数据库异常：" + e.getMessage());
-            } catch (Exception ex) {
-                ex.printStackTrace();
-            }
+
+            throw new ShipPortDBException("updateHddzInfoForPort_error", "反写yw_hddz港口信息-数据库异常:" + e.getMessage());
         }
     }
 
+    @SuppressWarnings("unused")
     @Transactional
     @Override
     public void updateContainerNoInfoForPort(List<PortForHddzVO> baseDataList) {
+
+        // 要更新卸船时间的list
         List<PortForHddzVO> jzxhList = new ArrayList<PortForHddzVO>();
-
         List<PortForHddzVO> withUnloadingTimeList = baseDataList.stream()
                 .filter(vo -> !CommonUtils.isEmpty(vo.getUnloadingTime())).collect(Collectors.toList());
         log.info("=================有卸船时间的数据有{}条", withUnloadingTimeList.size());
@@ -258,16 +251,20 @@
 
             // 分组后的每一组数据都对应列表的一条数据
             String mapKey = entry.getKey();
-            log.debug("@@@@@@@@@@@@@@@@@@@@@ jzxh-mapKey :{} ", mapKey);
             List<PortForHddzVO> mapList = entry.getValue();
-            log.debug("@@@@@@@@@@@@@@@@@@@@@ jzxh-mapList.size= {} ", mapList.size());
 
-            if (!CommonUtils.isEmpty(mapList) && mapList.size() > 0) {
+            if (!CommonUtils.isEmpty(mapList)) {
                 PortForHddzVO list0 = mapList.get(0);
                 PortForHddzVO jzxhVo = new PortForHddzVO();
-                jzxhVo.setBusinessNo(list0.getBusinessNo());
+                try {
+                    BeanUtils.copyProperties(jzxhVo, list0);
+                } catch (IllegalAccessException | InvocationTargetException e1) {
+                    e1.printStackTrace();
+                }
+
+                /**jzxhVo.setBusinessNo(list0.getBusinessNo());
                 jzxhVo.setContainerNumber(list0.getContainerNumber());
-                jzxhVo.setUnloadingTime(list0.getUnloadingTime());
+                jzxhVo.setUnloadingTime(list0.getUnloadingTime());*/
 
                 jzxhList.add(jzxhVo);
             }
@@ -276,7 +273,7 @@
         log.info("=======================符合更新yw_hddz_jzxxx表港口信息条件的有{}条", jzxhList.size());
         try {
             // 根据业务编号+集装箱号更新卸船时间
-            if (!CommonUtils.isEmpty(jzxhList) && jzxhList.size() > 0) {
+            if (!CommonUtils.isEmpty(jzxhList)) {
                 // 分组保存
                 List<List<PortForHddzVO>> splitList = CommonUtils.splitList(jzxhList,
                         CommonInfo.SQLSERVER_BATCH_GROUPING_COUNT_HUNDRED);
@@ -286,12 +283,9 @@
             }
         } catch (Exception e) {
             e.printStackTrace();
-            try {
-                fruitShipPortService.saveShipPortError(CommonInfo.ERROR_CODE_DATABASE, "",
-                        "反写yw_hddz_jzxxx港口信息-数据库异常：" + e.getMessage());
-            } catch (Exception ex) {
-                ex.printStackTrace();
-            }
+
+            throw new ShipPortDBException("updateContainerNoInfoForPort_error",
+                    "反写yw_hddz_jzxxx港口信息-数据库异常:" + e.getMessage());
         }
     }
 
Index: jinan/trunk/yunna/src/main/java/com/freshport/service/impl/ShipServiceImpl.java
===================================================================
--- jinan/trunk/yunna/src/main/java/com/freshport/service/impl/ShipServiceImpl.java	(revision 33825)
+++ jinan/trunk/yunna/src/main/java/com/freshport/service/impl/ShipServiceImpl.java	(revision 33826)
@@ -32,6 +32,7 @@
 import com.freshport.util.CommonInfo;
 import com.freshport.util.CommonUtils;
 import com.freshport.util.DateUtils;
+import com.freshport.util.ShipPortDBException;
 
 import lombok.extern.slf4j.Slf4j;
 
@@ -77,6 +78,7 @@
         return shipPortMapper.listLoadingNumberForShipTmp();
     }
 
+    @Transactional(propagation = Propagation.NOT_SUPPORTED, readOnly = true)
     @Override
     public void updateHddzAndWarnningInfo(String batchNo) {
 
@@ -84,6 +86,7 @@
         log.info("===========SHIP-batchNo={}, 总list.size={}", batchNo, baseDataList.size());
         // 要更新回写状态的业务编号list
         List<String> totalBusinessNoStrList = new ArrayList<String>();
+        // 要回写eta状态的list
         List<ShipForHddzVO> etaStatusList = new ArrayList<ShipForHddzVO>();
 
         List<ShipForHddzVO> sameShipList = baseDataList.stream().filter(
@@ -91,7 +94,7 @@
                 .collect(Collectors.toList());
         log.info("=================云纳船名/目的港和水果通目的港/提单船名一样的数据有{}条", sameShipList.size());
         // 获取符合更新条件的数据，更新中转港口信息
-        if (!CommonUtils.isEmpty(sameShipList) && sameShipList.size() > 0) {
+        if (!CommonUtils.isEmpty(sameShipList)) {
 
             // 1. 更新货代单证表船司相关字段信息(中转港、开船时间)
             shipService.updateHddzInfoForShip(sameShipList, totalBusinessNoStrList);
@@ -111,10 +114,9 @@
     @Override
     public void updateShipResultEtaStatus(List<ShipForHddzVO> etaStatusList) {
 
-        log.info("=======================符合更新船司结果表eta_status状态的有{}条, etaStatusList:{}", etaStatusList.size(),
-                JSONObject.toJSON(etaStatusList));
+        log.info("=======================符合更新船司结果表eta_status状态的有{}条", etaStatusList.size());
         try {
-            if (!CommonUtils.isEmpty(etaStatusList) && etaStatusList.size() > 0) {
+            if (!CommonUtils.isEmpty(etaStatusList)) {
                 // 分组保存
                 List<List<ShipForHddzVO>> splitList = CommonUtils.splitList(etaStatusList,
                         CommonInfo.SQLSERVER_BATCH_GROUPING_COUNT_HUNDRED);
@@ -124,12 +126,9 @@
             }
         } catch (Exception e) {
             e.printStackTrace();
-            try {
-                fruitShipPortService.saveShipPortError(CommonInfo.ERROR_CODE_DATABASE, "",
-                        "更新yw_ship_port_result船司eta_status和new_eta_time反写状态-数据库异常：" + e.getMessage());
-            } catch (Exception ex) {
-                ex.printStackTrace();
-            }
+
+            throw new ShipPortDBException("updateShipResultEtaStatus_error",
+                    "更新yw_ship_port_result船司eta_status和new_eta_time反写状态-数据库异常:" + e.getMessage());
         }
     }
 
@@ -139,11 +138,10 @@
 
         // 业务编号去重
         List<String> totalBusinessNoStrList = ywbhList.stream().distinct().collect(Collectors.toList());
-
         log.info("=======================符合更新船司结果表反写状态的有{}条, ywbhList:{}", totalBusinessNoStrList.size(),
                 JSONObject.toJSON(totalBusinessNoStrList));
         try {
-            if (!CommonUtils.isEmpty(totalBusinessNoStrList) && totalBusinessNoStrList.size() > 0) {
+            if (!CommonUtils.isEmpty(totalBusinessNoStrList)) {
                 // 分组保存
                 List<List<String>> splitList = CommonUtils.splitList(totalBusinessNoStrList,
                         CommonInfo.SQLSERVER_BATCH_GROUPING_COUNT_HUNDRED);
@@ -153,15 +151,13 @@
             }
         } catch (Exception e) {
             e.printStackTrace();
-            try {
-                fruitShipPortService.saveShipPortError(CommonInfo.ERROR_CODE_DATABASE, "",
-                        "更新yw_ship_port_result船司upd_status反写状态-数据库异常：" + e.getMessage());
-            } catch (Exception ex) {
-                ex.printStackTrace();
-            }
+
+            throw new ShipPortDBException("updateShipResultUpdStatus_error",
+                    "更新yw_ship_port_result船司upd_status反写状态-数据库异常:" + e.getMessage());
         }
     }
 
+    @SuppressWarnings("unused")
     @Transactional
     @Override
     public void updateHddzEtaForShip(List<ShipForHddzVO> baseDataList, List<ShipForHddzVO> etaStatusList) {
@@ -188,19 +184,18 @@
 
             // 分组后的每一组数据都对应列表的一条数据
             String mapKey = entry.getKey();
-            log.info("@@@@@@@@@@@@@@@@@@@@@ eta-mapKey :{} ", mapKey);
             List<ShipForHddzVO> mapList = entry.getValue();
-            log.info("@@@@@@@@@@@@@@@@@@@@@ eta-mapList.size= {} ", mapList.size());
 
-            if (!CommonUtils.isEmpty(mapList) && mapList.size() > 0) {
+            if (!CommonUtils.isEmpty(mapList)) {
                 // 过滤掉ETA < 当前时间的数据， 取最小值
                 Optional<ShipForHddzVO> min = mapList.stream()
                         .filter(e -> DateUtils.checkStartAndEndDate(DateUtils.Date2String(e.getCrtTime()),
                                 DateUtils.Date2String(e.getExpectArrivalTime())))
                         .min(Comparator.comparing(ShipForHddzVO::getExpectArrivalTime));
+
                 if (min.isPresent() && min.get().getExpectArrivalTime() != null) {
                     ShipForHddzVO minEta = min.get();
-                    log.info("@@@@@@@@@@@@@@@@@@@@@ ywbh={}, 最小ETA= {} ", minEta.getBusinessNo(),
+                    log.debug("@@@@@@@@@@@@@@@@@@@@@ ywbh={}, 最小ETA= {} ", minEta.getBusinessNo(),
                             DateUtils.Date2String(minEta.getExpectArrivalTime()));
 
                     for (ShipForHddzVO eta72 : eta72List) {
@@ -225,7 +220,7 @@
         log.info("=======================符合更新yw_hddz表ETA信息的有{}条", ywbhList.size());
         try {
             // 根据业务编号更新ETA
-            if (!CommonUtils.isEmpty(ywbhList) && ywbhList.size() > 0) {
+            if (!CommonUtils.isEmpty(ywbhList)) {
                 // 分组保存
                 List<List<ShipForHddzVO>> splitList = CommonUtils.splitList(ywbhList,
                         CommonInfo.SQLSERVER_BATCH_GROUPING_COUNT_HUNDRED);
@@ -237,15 +232,12 @@
             }
         } catch (Exception e) {
             e.printStackTrace();
-            try {
-                fruitShipPortService.saveShipPortError(CommonInfo.ERROR_CODE_DATABASE, "",
-                        "反写yw_hddz船司ETA信息-数据库异常：" + e.getMessage());
-            } catch (Exception ex) {
-                ex.printStackTrace();
-            }
+
+            throw new ShipPortDBException("updateHddzEtaForShip_error", "反写yw_hddz船司ETA信息-数据库异常:" + e.getMessage());
         }
     }
 
+    @SuppressWarnings("unused")
     @Transactional
     @Override
     public void updateHddzInfoForShip(List<ShipForHddzVO> baseDataList, List<String> ywbhStrList) {
@@ -272,13 +264,10 @@
 
             // 分组后的每一组数据都对应列表的一条数据
             String mapKey = entry.getKey();
-            log.debug("@@@@@@@@@@@@@@@@@@@@@ ywbh-mapKey :{} ", mapKey);
             List<ShipForHddzVO> mapList = entry.getValue();
-            log.debug("@@@@@@@@@@@@@@@@@@@@@ ywbh-mapList.size= {} ", mapList.size());
 
-            if (!CommonUtils.isEmpty(mapList) && mapList.size() > 0) {
+            if (!CommonUtils.isEmpty(mapList)) {
                 ShipForHddzVO list0 = mapList.get(0);
-
                 ShipForHddzVO ywbhVo = createShipForHddzVO(list0);
 
                 ywbhList.add(ywbhVo);
@@ -288,7 +277,7 @@
         log.info("=======================符合更新yw_hddz表船司信息条件的有{}条", ywbhList.size());
         try {
             // 根据业务编号更新ATA、ETA、航次、卸货港区
-            if (!CommonUtils.isEmpty(ywbhList) && ywbhList.size() > 0) {
+            if (!CommonUtils.isEmpty(ywbhList)) {
                 // 分组保存
                 List<List<ShipForHddzVO>> splitList = CommonUtils.splitList(ywbhList,
                         CommonInfo.SQLSERVER_BATCH_GROUPING_COUNT_HUNDRED);
@@ -302,15 +291,21 @@
             }
         } catch (Exception e) {
             e.printStackTrace();
-            try {
-                fruitShipPortService.saveShipPortError(CommonInfo.ERROR_CODE_DATABASE, "",
-                        "反写yw_hddz船司信息-数据库异常：" + e.getMessage());
-            } catch (Exception ex) {
-                ex.printStackTrace();
-            }
+
+            throw new ShipPortDBException("updateHddzInfoForShip_error", "反写yw_hddz船司信息-数据库异常:" + e.getMessage());
         }
     }
 
+    /**
+     * 
+     * createShipForHddzVO(创建更新船司信息封装类)      
+     * @param list0
+     * @return  
+     * @return ShipForHddzVO  
+     * @Exception 异常对象    
+     * @author lixd  
+     * @date 2023-04-08 16:22:04
+     */
     private ShipForHddzVO createShipForHddzVO(ShipForHddzVO list0) {
         ShipForHddzVO ywbhVo = new ShipForHddzVO();
         ywbhVo.setLoadingNumber(list0.getLoadingNumber());
Index: jinan/trunk/yunna/src/main/java/com/freshport/util/ShipPortDBException.java
===================================================================
--- jinan/trunk/yunna/src/main/java/com/freshport/util/ShipPortDBException.java	(revision 0)
+++ jinan/trunk/yunna/src/main/java/com/freshport/util/ShipPortDBException.java	(revision 33826)
@@ -0,0 +1,70 @@
+package com.freshport.util;
+
+import java.util.HashMap;
+
+/**
+ * 
+ * 自定义-数据库类型异常    
+ * 项目名称：yunna    
+ * 类名称：ShipPortDBException    
+ * 类描述：    
+ * 创建人：lixd    
+ * 创建时间：2023年4月7日 下午5:01:08    
+ * 修改人：lixd    
+ * 修改时间：2023年4月7日 下午5:01:08    
+ * 修改备注：    
+ * @version     
+ *
+ */
+public class ShipPortDBException extends RuntimeException {
+
+    /**    
+     * serialVersionUID:TODO（用一句话描述这个变量表示什么）    
+     *    
+     * @since Ver 1.1    
+     */
+    private static final long serialVersionUID = -2125358492885046143L;
+
+    // 错误编码
+    private String errorCode;
+
+    /**
+     * 构造函数
+     * @param errorCode 错误编码
+     * @param errorInfo 错误信息
+     * @param ex
+     */
+    public ShipPortDBException(String errorCode, String errorInfo, Exception ex) {
+        super(errorInfo, ex);
+        this.errorCode = errorCode;
+    }
+
+    public ShipPortDBException(String errorCode, String errorInfo) {
+        super(errorInfo);
+        this.errorCode = errorCode;
+    }
+
+    /**
+     * 返回json错误信息数据
+     * @return
+     */
+    public HashMap<String, Object> getJsonData() {
+        StringBuilder message = new StringBuilder(this.getMessage());
+
+        Throwable tempEx = this.getCause();
+        while (tempEx != null) {
+            message.append(tempEx.getMessage());
+            tempEx = tempEx.getCause();
+        }
+
+        HashMap<String, Object> json = new HashMap<String, Object>();
+        json.put("code", this.getErrorCode());
+        json.put("message", message.toString());
+        return json;
+    }
+
+    public String getErrorCode() {
+        return this.errorCode;
+    }
+
+}
Index: jinan/trunk/yunna/src/main/java/com/freshport/util/ShipPortEnum.java
===================================================================
--- jinan/trunk/yunna/src/main/java/com/freshport/util/ShipPortEnum.java	(revision 0)
+++ jinan/trunk/yunna/src/main/java/com/freshport/util/ShipPortEnum.java	(revision 33826)
@@ -0,0 +1,79 @@
+package com.freshport.util;
+
+/**
+ * 
+ *     
+ * 项目名称：yunna    
+ * 类名称：ShipPortEnum    
+ * 类描述：船司/港口变量枚举    
+ * 创建人：lixd    
+ * 创建时间：2023年4月7日 下午4:29:11    
+ * 修改人：lixd    
+ * 修改时间：2023年4月7日 下午4:29:11    
+ * 修改备注：    
+ * @version     
+ *
+ */
+public enum ShipPortEnum {
+
+    SHIP("SHIP", "船司提单号", "SHIP", "1"), SHIP_TMP("SHIP_TMP", "船司-当天提单号", "SHIP", "1"), PORT("PORT", "港口提单号", "PORT",
+            "2"), PORT_TMP("PORT_TMP", "港口当天-提单号", "PORT", "2");
+
+    private String code;
+
+    private String res;
+
+    private String prefix;
+
+    private String logType;
+
+    ShipPortEnum(String code, String res, String prefix, String logType) {
+        this.code = code;
+        this.res = res;
+        this.prefix = prefix;
+        this.logType = logType;
+    }
+
+    public String getCode() {
+        return code;
+    }
+
+    public void setCode(String code) {
+        this.code = code;
+    }
+
+    public String getRes() {
+        return res;
+    }
+
+    public void setRes(String res) {
+        this.res = res;
+    }
+
+    public String getPrefix() {
+        return prefix;
+    }
+
+    public void setPrefix(String prefix) {
+        this.prefix = prefix;
+    }
+
+    public String getLogType() {
+        return logType;
+    }
+
+    public void setLogType(String logType) {
+        this.logType = logType;
+    }
+
+    public static ShipPortEnum getShipPortEnum(String code) {
+        ShipPortEnum[] enums = values();
+        for (ShipPortEnum en : enums) {
+            if (en.getCode().equals(code)) {
+                return en;
+            }
+        }
+        return null;
+    }
+
+}
