Browse Source

9.01 数据对接测试完成

Mechrevo 1 year ago
parent
commit
9a0c736cbf
22 changed files with 954 additions and 103 deletions
  1. 5 0
      sp-core/sp-api/src/main/java/com/pj/api/client/async_server/AsyncServerInterface.java
  2. 7 0
      sp-core/sp-api/src/main/java/com/pj/api/client/async_server/AsyncServerInterfaceFallback.java
  3. 1 0
      sp-core/sp-api/src/main/java/com/pj/api/dto/GoodsDto.java
  4. 2 0
      sp-core/sp-base/src/main/java/com/pj/utils/ht/AESUtil.java
  5. 121 0
      sp-service/async-server/src/main/java/com/pj/ht_border_buy_goods_list/HtBorderBuyGoodsList.java
  6. 87 0
      sp-service/async-server/src/main/java/com/pj/ht_border_buy_goods_list/HtBorderBuyGoodsListController.java
  7. 30 0
      sp-service/async-server/src/main/java/com/pj/ht_border_buy_goods_list/HtBorderBuyGoodsListMapper.java
  8. 67 0
      sp-service/async-server/src/main/java/com/pj/ht_border_buy_goods_list/HtBorderBuyGoodsListMapper.xml
  9. 51 0
      sp-service/async-server/src/main/java/com/pj/ht_border_buy_goods_list/HtBorderBuyGoodsListService.java
  10. 6 1
      sp-service/async-server/src/main/java/com/pj/ht_import_declare_people/HtImportDeclarePeople.java
  11. 12 5
      sp-service/async-server/src/main/java/com/pj/ht_import_declare_people/HtImportDeclarePeopleController.java
  12. 14 0
      sp-service/async-server/src/main/java/com/pj/ht_import_declare_people/HtImportDeclarePeopleService.java
  13. 9 2
      sp-service/async-server/src/main/java/com/pj/ht_pass_card_record/HtPassCardRecord.java
  14. 157 0
      sp-service/async-server/src/main/java/com/pj/ht_sell_goods_list/HtSellGoodsList.java
  15. 87 0
      sp-service/async-server/src/main/java/com/pj/ht_sell_goods_list/HtSellGoodsListController.java
  16. 30 0
      sp-service/async-server/src/main/java/com/pj/ht_sell_goods_list/HtSellGoodsListMapper.java
  17. 83 0
      sp-service/async-server/src/main/java/com/pj/ht_sell_goods_list/HtSellGoodsListMapper.xml
  18. 51 0
      sp-service/async-server/src/main/java/com/pj/ht_sell_goods_list/HtSellGoodsListService.java
  19. 14 5
      sp-service/async-server/src/main/java/com/pj/ht_trade_settlement/HtTradeSettlement.java
  20. 92 88
      sp-service/async-server/src/main/java/com/pj/task/HtByteTask.java
  21. 27 1
      sp-service/async-server/src/main/java/com/pj/task/MethodHtByteTask.java
  22. 1 1
      sp-service/level-one-server/src/main/java/com/pj/tb_people/TbPeopleService.java

+ 5 - 0
sp-core/sp-api/src/main/java/com/pj/api/client/async_server/AsyncServerInterface.java

@@ -2,6 +2,7 @@ package com.pj.api.client.async_server;
 
 import com.pj.api.FeignInterceptor;
 import com.pj.api.consts.FeignConsts;
+import com.pj.api.dto.ImportDeclarePeopleDto;
 import com.pj.api.dto.OrderDto;
 import com.pj.api.dto.OrdersDto;
 import org.springframework.cloud.openfeign.FeignClient;
@@ -37,4 +38,8 @@ public interface AsyncServerInterface {
      */
     @RequestMapping("/async/rpc/sendLevelTwoOrdersDto")
     public void sendLevelTwoOrdersDto(@RequestBody OrdersDto t, @RequestParam("dataType")String dataType);
+
+    /** 远程调用: 根据便民身份证号 和 进出口结算单号查询[进口申报单边民确认] 将该对象返还航通 */
+    @RequestMapping("/HtImportDeclarePeople/rpc/getByIdNoAndPreleportNo")
+    public ImportDeclarePeopleDto getByIdNoAndPreleportNo(@RequestParam("idNo")String idNo, @RequestParam("preleportNo")String preleportNo);
 }

+ 7 - 0
sp-core/sp-api/src/main/java/com/pj/api/client/async_server/AsyncServerInterfaceFallback.java

@@ -1,6 +1,7 @@
 package com.pj.api.client.async_server;
 
 import com.pj.api.client.cfg.SpCfgInterfaceFallback;
+import com.pj.api.dto.ImportDeclarePeopleDto;
 import com.pj.api.dto.OrderDto;
 import com.pj.api.dto.OrdersDto;
 import feign.hystrix.FallbackFactory;
@@ -30,6 +31,12 @@ public class AsyncServerInterfaceFallback implements FallbackFactory<AsyncServer
             public void sendLevelTwoOrdersDto(OrdersDto t, String dataType) {
                 log.error("错误对象:{},类型:{}",t,dataType);
             }
+
+            @Override
+            public ImportDeclarePeopleDto getByIdNoAndPreleportNo(String idNo, String preleportNo) {
+                log.error("边民身份证:{},进出口预申报单号:{}",idNo,preleportNo);
+                return null;
+            }
         };
     }
 }

+ 1 - 0
sp-core/sp-api/src/main/java/com/pj/api/dto/GoodsDto.java

@@ -125,6 +125,7 @@ public class GoodsDto {
      */
     private String storageEnvm;
 
+
     @Override
     public String toString() {
         return "GoodsDto{" +

File diff suppressed because it is too large
+ 2 - 0
sp-core/sp-base/src/main/java/com/pj/utils/ht/AESUtil.java


+ 121 - 0
sp-service/async-server/src/main/java/com/pj/ht_border_buy_goods_list/HtBorderBuyGoodsList.java

@@ -0,0 +1,121 @@
+package com.pj.ht_border_buy_goods_list;
+
+import java.io.Serializable;
+import java.util.Date;
+
+import com.baomidou.mybatisplus.annotation.*;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import lombok.EqualsAndHashCode;
+
+import lombok.Data;
+import lombok.experimental.Accessors;
+
+/**
+ * Model: ht_border_buy_goods_list -- 边民购买商品列表字段说明,主表ht_trade_settlement
+ * @author yzs 
+ */
+@Data
+@Accessors(chain = true)
+@TableName(HtBorderBuyGoodsList.TABLE_NAME)
+@EqualsAndHashCode(callSuper = false)
+public class HtBorderBuyGoodsList extends Model<HtBorderBuyGoodsList> implements Serializable {
+
+	// ---------- 模块常量 ----------
+	/**
+	 * 序列化版本id 
+	 */
+	private static final long serialVersionUID = 1L;	
+	/**
+	 * 此模块对应的表名 
+	 */
+	public static final String TABLE_NAME = "ht_border_buy_goods_list";	
+	/**
+	 * 此模块对应的权限码 
+	 */
+	public static final String PERMISSION_CODE = "ht-border-buy-goods-list";
+	public static final String PERMISSION_CODE_ADD = "ht-border-buy-goods-list-add";
+	public static final String PERMISSION_CODE_EDIT = "ht-border-buy-goods-list-edit";
+	public static final String PERMISSION_CODE_DEL = "ht-border-buy-goods-list-del";
+
+
+
+
+	// ---------- 表中字段 ----------
+	/**
+	 * 主键 
+	 */
+	@TableId(type = IdType.AUTO)
+	private Long id;	
+
+	/**
+	 * 预申报编号(航通主键) 
+	 */
+	private String platSeqNo;	
+
+	/**
+	 * 身份证号 
+	 */
+	private String idno;	
+
+	/**
+	 * 购买金额 
+	 */
+	private Double buyAmount;	
+
+	/**
+	 * 净重 
+	 */
+	private Double netWt;	
+
+	/**
+	 * 毛重 
+	 */
+	private Double grossWt;	
+
+	/**
+	 * 购买数量 
+	 */
+	private Double buyQty;	
+
+	/**
+	 * 第一数量 
+	 */
+	private Double buyQty1;	
+
+	/**
+	 * 第二数量 
+	 */
+	private Double buyQty2;	
+
+	/**
+	 * 商品编码 
+	 */
+	private String codeTs;	
+
+	/**
+	 * 商品名称 
+	 */
+	private String goodsName;	
+
+	/**
+	 * 边民备案号 
+	 */
+	private String borderPutrecNo;	
+
+	/**
+	 * 完成状态 
+	 */
+	private Integer finishStatus;
+
+	/**
+	 * 创建时间
+	 */
+	private Date createTime;
+
+
+
+
+
+
+
+}

+ 87 - 0
sp-service/async-server/src/main/java/com/pj/ht_border_buy_goods_list/HtBorderBuyGoodsListController.java

@@ -0,0 +1,87 @@
+package com.pj.ht_border_buy_goods_list;
+
+import java.util.List;
+import com.pj.utils.so.SoMap;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.bind.annotation.*;
+
+import com.pj.utils.sg.*;
+import com.pj.project4sp.SP;
+
+import com.pj.current.satoken.StpUserUtil;
+import cn.dev33.satoken.annotation.SaCheckPermission;
+
+
+/**
+ * Controller: ht_border_buy_goods_list -- 边民购买商品列表字段说明,主表ht_trade_settlement
+ * @author yzs 
+ */
+@RestController
+@RequestMapping("/HtBorderBuyGoodsList/")
+public class HtBorderBuyGoodsListController {
+
+	/** 底层 Service 对象 */
+	@Autowired
+	HtBorderBuyGoodsListService htBorderBuyGoodsListService;
+
+	/** 增 */  
+	@RequestMapping("add")
+	@SaCheckPermission(HtBorderBuyGoodsList.PERMISSION_CODE_ADD)
+	public AjaxJson add(HtBorderBuyGoodsList h){
+		htBorderBuyGoodsListService.add(h);
+		h = htBorderBuyGoodsListService.getById(SP.publicMapper.getPrimarykey());
+		return AjaxJson.getSuccessData(h);
+	}
+
+	/** 删 */  
+	@RequestMapping("delete")
+	@SaCheckPermission(HtBorderBuyGoodsList.PERMISSION_CODE_DEL)
+	public AjaxJson delete(Long id){
+		 htBorderBuyGoodsListService.delete(id);
+		return AjaxJson.getSuccess();
+	}
+	
+	/** 删 - 根据id列表 */  
+	@RequestMapping("deleteByIds")
+	@SaCheckPermission(HtBorderBuyGoodsList.PERMISSION_CODE_DEL)
+	public AjaxJson deleteByIds(){
+		List<Long> ids = SoMap.getRequestSoMap().getListByComma("ids", long.class); 
+		int line = SP.publicMapper.deleteByIds(HtBorderBuyGoodsList.TABLE_NAME, ids);
+		return AjaxJson.getByLine(line);
+	}
+	
+	/** 改 */  
+	@RequestMapping("update")
+	@SaCheckPermission(HtBorderBuyGoodsList.PERMISSION_CODE_EDIT)
+	public AjaxJson update(HtBorderBuyGoodsList h){
+		htBorderBuyGoodsListService.update(h);
+		return AjaxJson.getSuccess();
+	}
+
+	/** 查 - 根据id */  
+	@RequestMapping("getById")
+		@SaCheckPermission(HtBorderBuyGoodsList.PERMISSION_CODE)
+	public AjaxJson getById(Long id){
+		HtBorderBuyGoodsList h = htBorderBuyGoodsListService.getById(id);
+		return AjaxJson.getSuccessData(h);
+	}
+
+	/** 查集合 - 根据条件(参数为空时代表忽略指定条件) */  
+	@RequestMapping("getList")
+		@SaCheckPermission(HtBorderBuyGoodsList.PERMISSION_CODE)
+	public AjaxJson getList() { 
+		SoMap so = SoMap.getRequestSoMap();
+		List<HtBorderBuyGoodsList> list = htBorderBuyGoodsListService.getList(so.startPage());
+		return AjaxJson.getPageData(so.getDataCount(), list);
+	}
+	
+	
+	
+	
+
+	
+	
+	
+
+}

+ 30 - 0
sp-service/async-server/src/main/java/com/pj/ht_border_buy_goods_list/HtBorderBuyGoodsListMapper.java

@@ -0,0 +1,30 @@
+package com.pj.ht_border_buy_goods_list;
+
+import java.util.List;
+
+import org.apache.ibatis.annotations.Mapper;
+
+import com.pj.utils.so.*;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.springframework.stereotype.Repository;
+
+/**
+ * Mapper: ht_border_buy_goods_list -- 边民购买商品列表字段说明,主表ht_trade_settlement
+ * @author yzs 
+ */
+
+@Mapper
+@Repository
+public interface HtBorderBuyGoodsListMapper extends BaseMapper <HtBorderBuyGoodsList> {
+
+
+
+	/**
+	 * 查集合 - 根据条件(参数为空时代表忽略指定条件)
+	 * @param so 参数集合 
+	 * @return 数据列表 
+	 */
+	List<HtBorderBuyGoodsList> getList(SoMap so);
+
+
+}

+ 67 - 0
sp-service/async-server/src/main/java/com/pj/ht_border_buy_goods_list/HtBorderBuyGoodsListMapper.xml

@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.pj.ht_border_buy_goods_list.HtBorderBuyGoodsListMapper">
+
+
+
+
+	<!-- ================================== 查询相关 ================================== -->
+	<!-- select id, plat_seq_no, idno, buy_amount, net_wt, gross_wt, buy_qty, buy_qty1, buy_qty2, code_ts, goods_name, border_putrec_no, finish_status from ht_border_buy_goods_list  -->
+	
+	<!-- 通用映射:自动模式 -->
+	<resultMap id="model" autoMapping="true" type="com.pj.ht_border_buy_goods_list.HtBorderBuyGoodsList"></resultMap>
+	
+	<!-- 公共查询sql片段 -->
+	<sql id="select_sql">
+		select * 
+		from ht_border_buy_goods_list 
+	</sql>
+
+	
+	<!-- 查集合 - 根据条件(参数为空时代表忽略指定条件) [G] -->
+	<select id="getList" resultMap="model">
+		<include refid="select_sql"></include>
+		<where>
+			<if test=' this.has("id") '> and id = #{id} </if>
+			<if test=' this.has("platSeqNo") '> and plat_seq_no = #{platSeqNo} </if>
+			<if test=' this.has("idno") '> and idno = #{idno} </if>
+			<if test=' this.has("buyAmount") '> and buy_amount = #{buyAmount} </if>
+			<if test=' this.has("netWt") '> and net_wt = #{netWt} </if>
+			<if test=' this.has("grossWt") '> and gross_wt = #{grossWt} </if>
+			<if test=' this.has("buyQty") '> and buy_qty = #{buyQty} </if>
+			<if test=' this.has("buyQty1") '> and buy_qty1 = #{buyQty1} </if>
+			<if test=' this.has("buyQty2") '> and buy_qty2 = #{buyQty2} </if>
+			<if test=' this.has("codeTs") '> and code_ts = #{codeTs} </if>
+			<if test=' this.has("goodsName") '> and goods_name = #{goodsName} </if>
+			<if test=' this.has("borderPutrecNo") '> and border_putrec_no = #{borderPutrecNo} </if>
+			<if test=' this.has("finishStatus") '> and finish_status = #{finishStatus} </if>
+		</where>
+		order by
+		<choose>
+			<when test='sortType == 1'> id desc </when>
+			<when test='sortType == 2'> plat_seq_no desc </when>
+			<when test='sortType == 3'> idno desc </when>
+			<when test='sortType == 4'> buy_amount desc </when>
+			<when test='sortType == 5'> net_wt desc </when>
+			<when test='sortType == 6'> gross_wt desc </when>
+			<when test='sortType == 7'> buy_qty desc </when>
+			<when test='sortType == 8'> buy_qty1 desc </when>
+			<when test='sortType == 9'> buy_qty2 desc </when>
+			<when test='sortType == 10'> code_ts desc </when>
+			<when test='sortType == 11'> goods_name desc </when>
+			<when test='sortType == 12'> border_putrec_no desc </when>
+			<when test='sortType == 13'> finish_status desc </when>
+			<otherwise> id desc </otherwise>
+		</choose>
+	</select>
+	
+	
+	
+	
+	
+	
+	
+	
+	
+
+</mapper>

+ 51 - 0
sp-service/async-server/src/main/java/com/pj/ht_border_buy_goods_list/HtBorderBuyGoodsListService.java

@@ -0,0 +1,51 @@
+package com.pj.ht_border_buy_goods_list;
+
+import java.util.List;
+import com.pj.utils.so.SoMap;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.transaction.annotation.Transactional;
+import com.pj.utils.sg.*;
+
+/**
+ * Service: ht_border_buy_goods_list -- 边民购买商品列表字段说明,主表ht_trade_settlement
+ * @author yzs 
+ */
+@Service
+@Transactional(rollbackFor = Exception.class)
+public class HtBorderBuyGoodsListService extends ServiceImpl<HtBorderBuyGoodsListMapper, HtBorderBuyGoodsList> implements IService<HtBorderBuyGoodsList>{
+
+	/** 底层 Mapper 对象 */
+	@Autowired
+	HtBorderBuyGoodsListMapper htBorderBuyGoodsListMapper;
+
+	/** 增 */
+	void add(HtBorderBuyGoodsList h){
+		save(h);
+	}
+
+	/** 删 */
+	void delete(Long id){
+		removeById(id);
+	}
+
+	/** 改 */
+	void update(HtBorderBuyGoodsList h){
+		updateById(h);
+
+	}
+
+	/** 查 */
+	HtBorderBuyGoodsList getById(Long id){
+		return super.getById(id);
+	}
+
+	/** 查集合 - 根据条件(参数为空时代表忽略指定条件) */  
+	List<HtBorderBuyGoodsList> getList(SoMap so) { 
+		return htBorderBuyGoodsListMapper.getList(so);	
+	}
+	
+
+}

+ 6 - 1
sp-service/async-server/src/main/java/com/pj/ht_import_declare_people/HtImportDeclarePeople.java

@@ -1,6 +1,8 @@
 package com.pj.ht_import_declare_people;
 
 import java.io.Serializable;
+import java.util.Date;
+
 import com.baomidou.mybatisplus.annotation.*;
 import com.baomidou.mybatisplus.extension.activerecord.Model;
 import lombok.EqualsAndHashCode;
@@ -85,7 +87,10 @@ public class HtImportDeclarePeople extends Model<HtImportDeclarePeople> implemen
 	 */
 	private Integer finishStatus;
 
-
+	/**
+	 * 创建时间
+	 */
+	private Date createTime;
 	
 
 

+ 12 - 5
sp-service/async-server/src/main/java/com/pj/ht_import_declare_people/HtImportDeclarePeopleController.java

@@ -1,6 +1,8 @@
 package com.pj.ht_import_declare_people;
 
 import java.util.List;
+
+import com.pj.api.dto.ImportDeclarePeopleDto;
 import com.pj.utils.so.SoMap;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.transaction.annotation.Transactional;
@@ -75,12 +77,17 @@ public class HtImportDeclarePeopleController {
 		List<HtImportDeclarePeople> list = htImportDeclarePeopleService.getList(so.startPage());
 		return AjaxJson.getPageData(so.getDataCount(), list);
 	}
-	
-	
-	
-	
 
-	
+
+	/* ---           正常业务方法 👆👆  rpc远程调用👇👇                              ---*/
+
+
+	/** 远程调用: 根据便民身份证号 和 进出口结算单号查询[进口申报单边民确认] 将该对象返还航通 */
+	@RequestMapping("rpc/getByIdNoAndPreleportNo")
+	public ImportDeclarePeopleDto getByIdNoAndPreleportNo(@RequestParam("idNo")String idNo, @RequestParam("preleportNo")String preleportNo){
+		ImportDeclarePeopleDto byIdNoAndPreleportNo = htImportDeclarePeopleService.getByIdNoAndPreleportNo(idNo, preleportNo);
+		return byIdNoAndPreleportNo;
+	}
 	
 	
 

+ 14 - 0
sp-service/async-server/src/main/java/com/pj/ht_import_declare_people/HtImportDeclarePeopleService.java

@@ -1,7 +1,11 @@
 package com.pj.ht_import_declare_people;
 
 import java.util.List;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.pj.api.dto.ImportDeclarePeopleDto;
 import com.pj.utils.so.SoMap;
+import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.baomidou.mybatisplus.extension.service.IService;
@@ -48,4 +52,14 @@ public class HtImportDeclarePeopleService extends ServiceImpl<HtImportDeclarePeo
 	}
 	
 
+	/** 远程调用: 根据便民身份证号 和 进出口结算单号查询[进口申报单边民确认] 将该对象返还航通 */
+	public ImportDeclarePeopleDto getByIdNoAndPreleportNo(String idNo,String preleportNo){
+		ImportDeclarePeopleDto importDeclarePeopleDto = new ImportDeclarePeopleDto();
+		List<HtImportDeclarePeople> htImportDeclarePeople = htImportDeclarePeopleMapper.selectList(new LambdaQueryWrapper<HtImportDeclarePeople>().eq(HtImportDeclarePeople::getIdno, idNo).eq(HtImportDeclarePeople::getPreIeportNo, preleportNo));
+		if(htImportDeclarePeople.size() == 1){
+			BeanUtils.copyProperties(htImportDeclarePeople.get(0),importDeclarePeopleDto);
+			return importDeclarePeopleDto;
+		}
+		return null;
+	}
 }

+ 9 - 2
sp-service/async-server/src/main/java/com/pj/ht_pass_card_record/HtPassCardRecord.java

@@ -1,8 +1,11 @@
 package com.pj.ht_pass_card_record;
 
 import java.io.Serializable;
+import java.util.Date;
+
 import com.baomidou.mybatisplus.annotation.*;
 import com.baomidou.mybatisplus.extension.activerecord.Model;
+import com.fasterxml.jackson.annotation.JsonProperty;
 import lombok.EqualsAndHashCode;
 
 import lombok.Data;
@@ -53,12 +56,13 @@ public class HtPassCardRecord extends Model<HtPassCardRecord> implements Seriali
 	/**
 	 * 进出口标志 I:进口,E:出口 
 	 */
+	@JsonProperty("iEFlag")
 	private String iEFlag;	
 
 	/**
 	 * 场所名称 
 	 */
-	private String areaName;	
+	private String areaName;
 
 	/**
 	 * 通道代码 
@@ -111,7 +115,10 @@ public class HtPassCardRecord extends Model<HtPassCardRecord> implements Seriali
 	 */
 	private Integer finishStatus;
 
-
+	/**
+	 * 创建时间
+	 */
+	private Date createTime;
 
 
 

+ 157 - 0
sp-service/async-server/src/main/java/com/pj/ht_sell_goods_list/HtSellGoodsList.java

@@ -0,0 +1,157 @@
+package com.pj.ht_sell_goods_list;
+
+import java.io.Serializable;
+import java.util.Date;
+
+import com.baomidou.mybatisplus.annotation.*;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import lombok.EqualsAndHashCode;
+
+import lombok.Data;
+import lombok.experimental.Accessors;
+
+/**
+ * Model: ht_sell_goods_list -- 商铺卖货物列表,主表ht_trade_settlement
+ * @author yzs 
+ */
+@Data
+@Accessors(chain = true)
+@TableName(HtSellGoodsList.TABLE_NAME)
+@EqualsAndHashCode(callSuper = false)
+public class HtSellGoodsList extends Model<HtSellGoodsList> implements Serializable {
+
+	// ---------- 模块常量 ----------
+	/**
+	 * 序列化版本id 
+	 */
+	private static final long serialVersionUID = 1L;	
+	/**
+	 * 此模块对应的表名 
+	 */
+	public static final String TABLE_NAME = "ht_sell_goods_list";	
+	/**
+	 * 此模块对应的权限码 
+	 */
+	public static final String PERMISSION_CODE = "ht-sell-goods-list";
+	public static final String PERMISSION_CODE_ADD = "ht-sell-goods-list-add";
+	public static final String PERMISSION_CODE_EDIT = "ht-sell-goods-list-edit";
+	public static final String PERMISSION_CODE_DEL = "ht-sell-goods-list-del";
+
+
+
+
+	// ---------- 表中字段 ----------
+	/**
+	 * 商铺卖货物列表主键 
+	 */
+	@TableId(type = IdType.AUTO)
+	private Long id;	
+
+	/**
+	 * 预申报编号 
+	 */
+	private String platSeqNo;	
+
+	/**
+	 * 商品序号 
+	 */
+	private String gNo;	
+
+	/**
+	 * 商品编码 
+	 */
+	private String codeTs;	
+
+	/**
+	 * 商品名称 
+	 */
+	private String gName;	
+
+	/**
+	 * 规格型号 
+	 */
+	private String gModel;	
+
+	/**
+	 * 储存条件:常温 1:冷藏,2:冷冻:3 
+	 */
+	private String storageEnvm;	
+
+	/**
+	 * 用 途 : 01 食用 、 02 工 业用、03 药用、04 种 用 、 05饲用、06 其他 
+	 */
+	private String useTo;	
+
+	/**
+	 * 毛重 
+	 */
+	private Double grossWt;	
+
+	/**
+	 * 净重 
+	 */
+	private Double netWt;	
+
+	/**
+	 * 产销国 
+	 */
+	private String originCountry;	
+
+	/**
+	 * 货物数量 
+	 */
+	private Double gQty;	
+
+	/**
+	 * 第一数量 
+	 */
+	private Double qty1;	
+
+	/**
+	 * 第二数量 
+	 */
+	private Double qty2;	
+
+	/**
+	 * 计量单位 
+	 */
+	private String gUnit;	
+
+	/**
+	 * 第一计量单位 
+	 */
+	private String unit1;	
+
+	/**
+	 * 第二计量单位 
+	 */
+	private String unit2;	
+
+	/**
+	 * 单价 
+	 */
+	private Double declPrice;	
+
+	/**
+	 * 总价 
+	 */
+	private Double declTotal;	
+
+	/**
+	 * 完成状态 
+	 */
+	private Integer finishStatus;	
+
+	/**
+	 * 创建时间 
+	 */
+	private Date createTime;
+
+
+
+
+
+	
+
+
+}

+ 87 - 0
sp-service/async-server/src/main/java/com/pj/ht_sell_goods_list/HtSellGoodsListController.java

@@ -0,0 +1,87 @@
+package com.pj.ht_sell_goods_list;
+
+import java.util.List;
+import com.pj.utils.so.SoMap;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.bind.annotation.*;
+
+import com.pj.utils.sg.*;
+import com.pj.project4sp.SP;
+
+import com.pj.current.satoken.StpUserUtil;
+import cn.dev33.satoken.annotation.SaCheckPermission;
+
+
+/**
+ * Controller: ht_sell_goods_list -- 商铺卖货物列表,主表ht_trade_settlement
+ * @author yzs 
+ */
+@RestController
+@RequestMapping("/HtSellGoodsList/")
+public class HtSellGoodsListController {
+
+	/** 底层 Service 对象 */
+	@Autowired
+	HtSellGoodsListService htSellGoodsListService;
+
+	/** 增 */  
+	@RequestMapping("add")
+	@SaCheckPermission(HtSellGoodsList.PERMISSION_CODE_ADD)
+	public AjaxJson add(HtSellGoodsList h){
+		htSellGoodsListService.add(h);
+		h = htSellGoodsListService.getById(SP.publicMapper.getPrimarykey());
+		return AjaxJson.getSuccessData(h);
+	}
+
+	/** 删 */  
+	@RequestMapping("delete")
+	@SaCheckPermission(HtSellGoodsList.PERMISSION_CODE_DEL)
+	public AjaxJson delete(Long id){
+		 htSellGoodsListService.delete(id);
+		return AjaxJson.getSuccess();
+	}
+	
+	/** 删 - 根据id列表 */  
+	@RequestMapping("deleteByIds")
+	@SaCheckPermission(HtSellGoodsList.PERMISSION_CODE_DEL)
+	public AjaxJson deleteByIds(){
+		List<Long> ids = SoMap.getRequestSoMap().getListByComma("ids", long.class); 
+		int line = SP.publicMapper.deleteByIds(HtSellGoodsList.TABLE_NAME, ids);
+		return AjaxJson.getByLine(line);
+	}
+	
+	/** 改 */  
+	@RequestMapping("update")
+	@SaCheckPermission(HtSellGoodsList.PERMISSION_CODE_EDIT)
+	public AjaxJson update(HtSellGoodsList h){
+		htSellGoodsListService.update(h);
+		return AjaxJson.getSuccess();
+	}
+
+	/** 查 - 根据id */  
+	@RequestMapping("getById")
+		@SaCheckPermission(HtSellGoodsList.PERMISSION_CODE)
+	public AjaxJson getById(Long id){
+		HtSellGoodsList h = htSellGoodsListService.getById(id);
+		return AjaxJson.getSuccessData(h);
+	}
+
+	/** 查集合 - 根据条件(参数为空时代表忽略指定条件) */  
+	@RequestMapping("getList")
+		@SaCheckPermission(HtSellGoodsList.PERMISSION_CODE)
+	public AjaxJson getList() { 
+		SoMap so = SoMap.getRequestSoMap();
+		List<HtSellGoodsList> list = htSellGoodsListService.getList(so.startPage());
+		return AjaxJson.getPageData(so.getDataCount(), list);
+	}
+	
+	
+	
+	
+
+	
+	
+	
+
+}

+ 30 - 0
sp-service/async-server/src/main/java/com/pj/ht_sell_goods_list/HtSellGoodsListMapper.java

@@ -0,0 +1,30 @@
+package com.pj.ht_sell_goods_list;
+
+import java.util.List;
+
+import org.apache.ibatis.annotations.Mapper;
+
+import com.pj.utils.so.*;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.springframework.stereotype.Repository;
+
+/**
+ * Mapper: ht_sell_goods_list -- 商铺卖货物列表,主表ht_trade_settlement
+ * @author yzs 
+ */
+
+@Mapper
+@Repository
+public interface HtSellGoodsListMapper extends BaseMapper <HtSellGoodsList> {
+
+
+
+	/**
+	 * 查集合 - 根据条件(参数为空时代表忽略指定条件)
+	 * @param so 参数集合 
+	 * @return 数据列表 
+	 */
+	List<HtSellGoodsList> getList(SoMap so);
+
+
+}

+ 83 - 0
sp-service/async-server/src/main/java/com/pj/ht_sell_goods_list/HtSellGoodsListMapper.xml

@@ -0,0 +1,83 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.pj.ht_sell_goods_list.HtSellGoodsListMapper">
+
+
+
+
+	<!-- ================================== 查询相关 ================================== -->
+	<!-- select id, plat_seq_no, g_no, code_ts, g_name, g_model, storage_envm, use_to, gross_wt, net_wt, origin_country, g_qty, qty1, qty2, g_unit, unit1, unit2, decl_price, decl_total, finish_status, create_time from ht_sell_goods_list  -->
+	
+	<!-- 通用映射:自动模式 -->
+	<resultMap id="model" autoMapping="true" type="com.pj.ht_sell_goods_list.HtSellGoodsList"></resultMap>
+	
+	<!-- 公共查询sql片段 -->
+	<sql id="select_sql">
+		select * 
+		from ht_sell_goods_list 
+	</sql>
+
+	
+	<!-- 查集合 - 根据条件(参数为空时代表忽略指定条件) [G] -->
+	<select id="getList" resultMap="model">
+		<include refid="select_sql"></include>
+		<where>
+			<if test=' this.has("id") '> and id = #{id} </if>
+			<if test=' this.has("platSeqNo") '> and plat_seq_no = #{platSeqNo} </if>
+			<if test=' this.has("gNo") '> and g_no = #{gNo} </if>
+			<if test=' this.has("codeTs") '> and code_ts = #{codeTs} </if>
+			<if test=' this.has("gName") '> and g_name = #{gName} </if>
+			<if test=' this.has("gModel") '> and g_model = #{gModel} </if>
+			<if test=' this.has("storageEnvm") '> and storage_envm = #{storageEnvm} </if>
+			<if test=' this.has("useTo") '> and use_to = #{useTo} </if>
+			<if test=' this.has("grossWt") '> and gross_wt = #{grossWt} </if>
+			<if test=' this.has("netWt") '> and net_wt = #{netWt} </if>
+			<if test=' this.has("originCountry") '> and origin_country = #{originCountry} </if>
+			<if test=' this.has("gQty") '> and g_qty = #{gQty} </if>
+			<if test=' this.has("qty1") '> and qty1 = #{qty1} </if>
+			<if test=' this.has("qty2") '> and qty2 = #{qty2} </if>
+			<if test=' this.has("gUnit") '> and g_unit = #{gUnit} </if>
+			<if test=' this.has("unit1") '> and unit1 = #{unit1} </if>
+			<if test=' this.has("unit2") '> and unit2 = #{unit2} </if>
+			<if test=' this.has("declPrice") '> and decl_price = #{declPrice} </if>
+			<if test=' this.has("declTotal") '> and decl_total = #{declTotal} </if>
+			<if test=' this.has("finishStatus") '> and finish_status = #{finishStatus} </if>
+			<if test=' this.has("createTime") '> and create_time = #{createTime} </if>
+		</where>
+		order by
+		<choose>
+			<when test='sortType == 1'> id desc </when>
+			<when test='sortType == 2'> plat_seq_no desc </when>
+			<when test='sortType == 3'> g_no desc </when>
+			<when test='sortType == 4'> code_ts desc </when>
+			<when test='sortType == 5'> g_name desc </when>
+			<when test='sortType == 6'> g_model desc </when>
+			<when test='sortType == 7'> storage_envm desc </when>
+			<when test='sortType == 8'> use_to desc </when>
+			<when test='sortType == 9'> gross_wt desc </when>
+			<when test='sortType == 10'> net_wt desc </when>
+			<when test='sortType == 11'> origin_country desc </when>
+			<when test='sortType == 12'> g_qty desc </when>
+			<when test='sortType == 13'> qty1 desc </when>
+			<when test='sortType == 14'> qty2 desc </when>
+			<when test='sortType == 15'> g_unit desc </when>
+			<when test='sortType == 16'> unit1 desc </when>
+			<when test='sortType == 17'> unit2 desc </when>
+			<when test='sortType == 18'> decl_price desc </when>
+			<when test='sortType == 19'> decl_total desc </when>
+			<when test='sortType == 20'> finish_status desc </when>
+			<when test='sortType == 21'> create_time desc </when>
+			<otherwise> id desc </otherwise>
+		</choose>
+	</select>
+	
+	
+	
+	
+	
+	
+	
+	
+	
+
+</mapper>

+ 51 - 0
sp-service/async-server/src/main/java/com/pj/ht_sell_goods_list/HtSellGoodsListService.java

@@ -0,0 +1,51 @@
+package com.pj.ht_sell_goods_list;
+
+import java.util.List;
+import com.pj.utils.so.SoMap;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.transaction.annotation.Transactional;
+import com.pj.utils.sg.*;
+
+/**
+ * Service: ht_sell_goods_list -- 商铺卖货物列表,主表ht_trade_settlement
+ * @author yzs 
+ */
+@Service
+@Transactional(rollbackFor = Exception.class)
+public class HtSellGoodsListService extends ServiceImpl<HtSellGoodsListMapper, HtSellGoodsList> implements IService<HtSellGoodsList>{
+
+	/** 底层 Mapper 对象 */
+	@Autowired
+	HtSellGoodsListMapper htSellGoodsListMapper;
+
+	/** 增 */
+	void add(HtSellGoodsList h){
+		save(h);
+	}
+
+	/** 删 */
+	void delete(Long id){
+		removeById(id);
+	}
+
+	/** 改 */
+	void update(HtSellGoodsList h){
+		updateById(h);
+
+	}
+
+	/** 查 */
+	HtSellGoodsList getById(Long id){
+		return super.getById(id);
+	}
+
+	/** 查集合 - 根据条件(参数为空时代表忽略指定条件) */  
+	List<HtSellGoodsList> getList(SoMap so) { 
+		return htSellGoodsListMapper.getList(so);	
+	}
+	
+
+}

+ 14 - 5
sp-service/async-server/src/main/java/com/pj/ht_trade_settlement/HtTradeSettlement.java

@@ -1,8 +1,11 @@
 package com.pj.ht_trade_settlement;
 
 import java.io.Serializable;
+import java.util.Date;
+
 import com.baomidou.mybatisplus.annotation.*;
 import com.baomidou.mybatisplus.extension.activerecord.Model;
+import com.fasterxml.jackson.annotation.JsonProperty;
 import lombok.EqualsAndHashCode;
 
 import lombok.Data;
@@ -43,6 +46,11 @@ public class HtTradeSettlement extends Model<HtTradeSettlement> implements Seria
 	 * 预申报编号 
 	 */
 	@TableId(type = IdType.AUTO)
+	private Long id;
+
+	/**
+	 * 航通主键
+	 */
 	private String platSeqNo;	
 
 	/**
@@ -103,11 +111,13 @@ public class HtTradeSettlement extends Model<HtTradeSettlement> implements Seria
 	/**
 	 * 商品流向, 进出口标志为进口时,必填,01-二次销售;02-生活自用;03-落地加工; 
 	 */
+	@JsonProperty("gFlow")
 	private String gFlow;	
 
 	/**
 	 * 进出口标志:I进口 E 出口 
 	 */
+	@JsonProperty("iEFlag")
 	private String iEFlag;	
 
 	/**
@@ -195,17 +205,16 @@ public class HtTradeSettlement extends Model<HtTradeSettlement> implements Seria
 	 */
 	private String sellGoodsList;	
 
-	/**
-	 * 主键 
-	 */
-	private Long id;
 
 	/**
 	 * 完成情况
 	 */
 	private Integer finishStatus;
 
-
+	/**
+	 * 创建时间
+	 */
+	private Date createTime;
 
 
 

+ 92 - 88
sp-service/async-server/src/main/java/com/pj/task/HtByteTask.java

@@ -7,9 +7,12 @@ import com.pj.api.client.async_server.AsyncServerInterface;
 import com.pj.api.client.level_one_server.LevelOneServerInterface;
 import com.pj.api.client.transport.TransportInterface;
 import com.pj.api.dto.*;
+import com.pj.common.core.exception.ServiceException;
 import com.pj.dto.DataDto;
 import com.pj.enummj.DataType;
 import com.pj.enummj.FinishStatus;
+import com.pj.ht_border_buy_goods_list.HtBorderBuyGoodsList;
+import com.pj.ht_border_buy_goods_list.HtBorderBuyGoodsListMapper;
 import com.pj.ht_borders_list.HtBordersList;
 import com.pj.ht_borders_list.HtBordersListMapper;
 import com.pj.ht_byte.HtByte;
@@ -18,6 +21,8 @@ import com.pj.ht_import_declare_people.HtImportDeclarePeople;
 import com.pj.ht_import_declare_people.HtImportDeclarePeopleMapper;
 import com.pj.ht_pass_card_record.HtPassCardRecord;
 import com.pj.ht_pass_card_record.HtPassCardRecordMapper;
+import com.pj.ht_sell_goods_list.HtSellGoodsList;
+import com.pj.ht_sell_goods_list.HtSellGoodsListMapper;
 import com.pj.ht_trade_settlement.HtTradeSettlement;
 import com.pj.ht_trade_settlement.HtTradeSettlementMapper;
 import com.pj.rabbitmq.RabbitMQ;
@@ -26,6 +31,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.Configuration;
 import org.springframework.scheduling.annotation.EnableScheduling;
 import org.springframework.scheduling.annotation.Scheduled;
+import org.springframework.transaction.annotation.Transactional;
 
 import java.text.SimpleDateFormat;
 import java.util.Date;
@@ -38,6 +44,7 @@ import java.util.List;
  **/
 @Configuration
 @EnableScheduling
+@Transactional(rollbackFor = Exception.class)
 public class HtByteTask {
 
     /**
@@ -51,16 +58,6 @@ public class HtByteTask {
     @Autowired
     private LevelOneServerInterface levelOneServerInterface;
     /**
-     * mq测试
-     */
-    @Autowired
-    private AsyncServerInterface asyncServerInterface;
-    /**
-     * 货运
-     */
-    @Autowired
-    private TransportInterface transportInterface;
-    /**
      * 交易结算信息
      */
     @Autowired
@@ -81,10 +78,20 @@ public class HtByteTask {
     @Autowired
     private HtTradeSettlementMapper htTradeSettlementMapper;
     /**
-     * 边民购买记录
+     * 边民购买记录(主表:ht_trade_settlement)
      */
     @Autowired
     private HtBordersListMapper htBordersListMapper;
+    /**
+     * 边民购买商品信息表(主表:ht_trade_settlement)
+     */
+    @Autowired
+    private HtBorderBuyGoodsListMapper htBorderBuyGoodsListMapper;
+    /**
+     * 商铺卖货物信息表(主表:ht_trade_settlement)
+     */
+    @Autowired
+    private HtSellGoodsListMapper htSellGoodsListMapper;
 
     /**
      * 启动定时任务
@@ -126,149 +133,146 @@ public class HtByteTask {
                     PeopleDto peopleDto = JSONObject.parseObject(body, PeopleDto.class);
                     //根据其内的身份证,有则新增,无则修改???
                     flag = levelOneServerInterface.peopleDto(peopleDto);
+                    methodHtByteTask.updateHtByteInfo(flag,item,dataDto);
                     if(!flag){
-                        //将完成状态设置成 2 , 表示处理失败
-                        item.setFinishStatus(FinishStatus.FINISH_STATUS_TWO.getCode());
-                        item.setMessageId(dataDto.getMsgId());
-                        item.setDataType(dataDto.getDataType());
-                        //保存
-                        htByteMapper.updateById(item);
                         System.out.println("\n边民信息处理失败。 messageId = " + item.getMessageId() + "\n");
-                        //todo: 发送失败信息给管理员
-
-                        break;
+                    }else {
+                        System.out.println("\n边民信息处理成功。 messageId = " + item.getMessageId() + "\n");
                     }
-                    item.setFinishStatus(FinishStatus.FINISH_STATUS_ONE.getCode());
-                    item.setMessageId(dataDto.getMsgId());
-                    item.setDataType(dataDto.getDataType());
-                    htByteMapper.updateById(item);
-                    System.out.println("\n边民信息处理成功。 messageId = " + item.getMessageId() + "\n");
                     break;
                 case "002":
                     //商铺备案
                     ShopDto shopDto = JSONObject.parseObject(body, ShopDto.class);
                     //保存
                     flag = levelOneServerInterface.shopDto(shopDto);
+                    methodHtByteTask.updateHtByteInfo(flag,item,dataDto);
                     if(!flag){
-                        //将完成状态设置成 2 , 表示处理失败
-                        item.setFinishStatus(FinishStatus.FINISH_STATUS_TWO.getCode());
-                        item.setMessageId(dataDto.getMsgId());
-                        item.setDataType(dataDto.getDataType());
-                        //保存
-                        htByteMapper.updateById(item);
                         System.out.println("\n店铺信息处理失败。 messageId = " + item.getMessageId() + "\n");
-                        //todo: 发送失败信息给管理员
-
-                        break;
+                    }else {
+                        System.out.println("\n店铺信息处理完成。 messageId = " + item.getMessageId() + "\n");
                     }
-                    item.setFinishStatus(FinishStatus.FINISH_STATUS_ONE.getCode());
-                    item.setMessageId(dataDto.getMsgId());
-                    item.setDataType(dataDto.getDataType());
-                    htByteMapper.updateById(item);
-                    System.out.println("\n店铺信息处理完成。 messageId = " + item.getMessageId() + "\n");
                     break;
                 case "003":
                     //边民互助组备案
                     GroupDto groupDto = JSONObject.parseObject(body, GroupDto.class);
                     //保存
                     flag = levelOneServerInterface.groupDto(groupDto);
+                    methodHtByteTask.updateHtByteInfo(flag,item,dataDto);
                     if(!flag){
-                        //将完成状态设置成 2 , 表示处理失败
-                        item.setFinishStatus(FinishStatus.FINISH_STATUS_TWO.getCode());
-                        item.setMessageId(dataDto.getMsgId());
-                        item.setDataType(dataDto.getDataType());
-                        //保存
-                        htByteMapper.updateById(item);
                         System.out.println("\n互助组信息处理失败。 messageId = " + item.getMessageId() + "\n");
-                        //todo: 发送失败信息给管理员
-
-                        break;
+                    }else {
+                        System.out.println("\n互助组信息处理完成。 messageId = " + item.getMessageId() + "\n");
                     }
-                    item.setFinishStatus(FinishStatus.FINISH_STATUS_ONE.getCode());
-                    item.setMessageId(dataDto.getMsgId());
-                    item.setDataType(dataDto.getDataType());
-                    htByteMapper.updateById(item);
-                    System.out.println("\n互助组信息处理完成。 messageId = " + item.getMessageId() + "\n");
                     break;
                 case "004":
                     //边民合作社备案
                     CooperativeDto cooperativeDto = JSONObject.parseObject(body, CooperativeDto.class);
                     //保存
                     flag = levelOneServerInterface.cooperativeDto(cooperativeDto);
+                    methodHtByteTask.updateHtByteInfo(flag,item,dataDto);
                     if(!flag){
-                        //将完成状态设置成 2 , 表示处理失败
-                        item.setFinishStatus(FinishStatus.FINISH_STATUS_TWO.getCode());
-                        item.setMessageId(dataDto.getMsgId());
-                        item.setDataType(dataDto.getDataType());
-                        //保存
-                        htByteMapper.updateById(item);
                         System.out.println("\n边民合作社信息处理失败。 messageId = " + item.getMessageId() + "\n");
-                        //todo: 发送失败信息给管理员
-
-                        break;
+                    }else {
+                        System.out.println("\n边民合作社信息处理完成。 messageId = " + item.getMessageId() + "\n");
                     }
-                    item.setFinishStatus(FinishStatus.FINISH_STATUS_ONE.getCode());
-                    item.setMessageId(dataDto.getMsgId());
-                    item.setDataType(dataDto.getDataType());
-                    htByteMapper.updateById(item);
-                    System.out.println("\n边民合作社信息处理完成。 messageId = " + item.getMessageId() + "\n");
                     break;
                 case "005":
                     //商品基础信息
                     GoodsDto goodsDto = JSONObject.parseObject(body, GoodsDto.class);
                     //保存
                     flag = levelOneServerInterface.goodsDto(goodsDto);
+                    methodHtByteTask.updateHtByteInfo(flag,item,dataDto);
                     if(!flag){
-                        //将完成状态设置成 2 , 表示处理失败
-                        item.setFinishStatus(FinishStatus.FINISH_STATUS_TWO.getCode());
-                        item.setMessageId(dataDto.getMsgId());
-                        item.setDataType(dataDto.getDataType());
-                        //保存
-                        htByteMapper.updateById(item);
                         System.out.println("\n海关监管商品信息处理失败。 messageId = " + item.getMessageId() + "\n");
-                        //todo: 发送失败信息给管理员
-
-                        break;
-                    }
-                    item.setFinishStatus(FinishStatus.FINISH_STATUS_ONE.getCode());
-                    item.setMessageId(dataDto.getMsgId());
-                    item.setDataType(dataDto.getDataType());
-                    htByteMapper.updateById(item);
+                    }else {
                     System.out.println("\n海关监管商品信息处理完成。 messageId = " + item.getMessageId() + "\n");
+                    }
                     break;
                 case "006":
                     //交易结算信息
                     HtTradeSettlement importDeclarePeople = JSONObject.parseObject(body, HtTradeSettlement.class);
                     importDeclarePeople.setFinishStatus(FinishStatus.FINISH_STATUS_ZERO.getCode()); // 默认待处理
+                    importDeclarePeople.setCreateTime(new Date());
                     //保存
                     int insert = htTradeSettlementMapper.insert(importDeclarePeople);
                     if(insert == 1){
+                        //购买边民列表
                         List<HtBordersList> bordersLists = JSON.parseArray(importDeclarePeople.getBordersList(), HtBordersList.class);
-                        //创建预申报单号
-                        String platSeqNo = null;
-                        //保存
+                        //边民购买商品列表
+                        List<HtBorderBuyGoodsList> buyGoodsList = JSON.parseArray(importDeclarePeople.getBorderBuyGoodsList(), HtBorderBuyGoodsList.class);
+                        //商铺卖货物列表
+                        List<HtSellGoodsList> htSellGoodsList = JSON.parseArray(importDeclarePeople.getSellGoodsList(), HtSellGoodsList.class);
+                        //航通关联主键
+                        String platSeqNo = importDeclarePeople.getPlatSeqNo();
+                        //保存购买边民
                         if(bordersLists.size() > 0){
-                            for(HtBordersList t: bordersLists){
-                                platSeqNo = t.getPlatSeqNo();
+                            bordersLists.forEach(t -> {
                                 t.setCreateTime(new Date());
                                 t.setFinishStatus(FinishStatus.FINISH_STATUS_ZERO.getCode());
                                 htBordersListMapper.insert(t);
-                            }
+                            });
                         /**
                          * 接收订单推送消息,边民进行交易确认,支付申请,刷脸认证,系统发起进行交易
                          */
                             List<HtBordersList> htBordersLists = htBordersListMapper.selectList(new LambdaQueryWrapper<HtBordersList>().eq(HtBordersList::getPlatSeqNo, platSeqNo));
                             methodHtByteTask.sendMessageToPeople(htBordersLists);
                         }
+                        //保存边民购买商品
+                        if(buyGoodsList.size() > 0){
+                            buyGoodsList.forEach(t -> {
+                                t.setCreateTime(new Date());
+                                t.setFinishStatus(FinishStatus.FINISH_STATUS_ZERO.getCode());
+                                htBorderBuyGoodsListMapper.insert(t);
+                            });
+                            // ???
+                        }
+                        //保存商铺卖货物
+                        if(htSellGoodsList.size() > 0){
+                            htSellGoodsList.forEach(t -> {
+                                t.setCreateTime(new Date());
+                                t.setFinishStatus(FinishStatus.FINISH_STATUS_ZERO.getCode());
+                                htSellGoodsListMapper.insert(t);
+                            });
+                            // ???
+                        }
+                        //保存航通监听记录
+                        methodHtByteTask.updateHtByteInfo(true,item,dataDto);
+                        System.out.println("\n交易结算信息处理成功。 messageId = " + item.getMessageId() + "\n");
+                        break;
                     }
+                    //保存航通监听记录
+                    methodHtByteTask.updateHtByteInfo(false,item,dataDto);
+                    System.out.println("\n交易结算信息处理失败。 messageId = " + item.getMessageId() + "\n");
                     break;
                 case "007":
                     //放行记录(过卡记录)
                     HtPassCardRecord htPassCardRecord = JSONObject.parseObject(body, HtPassCardRecord.class);
                     htPassCardRecord.setFinishStatus(FinishStatus.FINISH_STATUS_ZERO.getCode()); // 默认待处理
+                    htPassCardRecord.setCreateTime(new Date());
                     //保存
-                    htPassCardRecordMapper.insert(htPassCardRecord);
+                    int insert1 = htPassCardRecordMapper.insert(htPassCardRecord);
+                    methodHtByteTask.updateHtByteInfo(true,item,dataDto);
+                    if(insert1 == 1){
+                        System.out.println("\n放行记录(过卡记录)信息处理成功。 messageId = " + item.getMessageId() + "\n");
+                    }else {
+                        System.out.println("\n放行记录(过卡记录)信息处理失败。 messageId = " + item.getMessageId() + "\n");
+                    }
+                    break;
+                case "008":
+                    //进口申报单边民确认
+                    HtImportDeclarePeople htImportDeclarePeople = JSONObject.parseObject(body, HtImportDeclarePeople.class);
+                    htImportDeclarePeople.setFinishStatus(FinishStatus.FINISH_STATUS_ZERO.getCode());
+                    htImportDeclarePeople.setCreateTime(new Date());
+                    int insert2 = htImportDeclarePeopleMapper.insert(htImportDeclarePeople);
+                    methodHtByteTask.updateHtByteInfo(insert2 == 1,item,dataDto);
+                    if(insert2 == 1){
+                        System.out.println("\n进口申报单边民确认信息处理成功。 messageId = " + item.getMessageId() + "\n");
+                    }else {
+                        System.out.println("\n进口申报单边民确认信息处理失败。 messageId = " + item.getMessageId() + "\n");
+                    }
                     break;
+                default:
+                    throw new ServiceException("类型错误。");
             }
         });
 

+ 27 - 1
sp-service/async-server/src/main/java/com/pj/task/MethodHtByteTask.java

@@ -2,9 +2,12 @@ package com.pj.task;
 
 import com.pj.api.dto.AppUserDto;
 import com.pj.api.dto.MessageDto;
+import com.pj.dto.DataDto;
 import com.pj.enummj.FinishStatus;
 import com.pj.ht_borders_list.HtBordersList;
 import com.pj.ht_borders_list.HtBordersListMapper;
+import com.pj.ht_byte.HtByte;
+import com.pj.ht_byte.HtByteMapper;
 import com.pj.project4sp.SP;
 import com.pj.retry.SmsRetryService;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -28,6 +31,8 @@ public class MethodHtByteTask {
     private SmsRetryService smsRetryService;
     @Autowired
     private HtBordersListMapper htBordersListMapper;
+    @Autowired
+    private HtByteMapper htByteMapper;
 
     /**
      *  接收订单推送消息,边民进行交易确认,支付申请,刷脸认证,系统发起进行交易
@@ -62,9 +67,30 @@ public class MethodHtByteTask {
             } catch (Exception e) {
                 item.setFinishStatus(FinishStatus.FINISH_STATUS_TWO.getCode());
                 htBordersListMapper.updateById(item);
-                throw new RuntimeException(e);
             }
         });
     }
 
+    /**
+     * 修改ht_byte数据的状态
+     */
+    public void updateHtByteInfo(boolean flag, HtByte htByte,DataDto dataDto){
+        //处理成功
+        if(flag){
+            htByte.setFinishStatus(FinishStatus.FINISH_STATUS_ONE.getCode());
+            htByte.setMessageId(dataDto.getMsgId());
+            htByte.setDataType(dataDto.getDataType());
+            htByte.setCreateTime(new Date());
+            htByteMapper.updateById(htByte);
+            return;
+        }
+        //将完成状态设置成 2 , 表示处理失败
+        htByte.setFinishStatus(FinishStatus.FINISH_STATUS_TWO.getCode());
+        htByte.setMessageId(dataDto.getMsgId());
+        htByte.setDataType(dataDto.getDataType());
+        htByte.setCreateTime(new Date());
+        //保存
+        htByteMapper.updateById(htByte);
+    }
+
 }

+ 1 - 1
sp-service/level-one-server/src/main/java/com/pj/tb_people/TbPeopleService.java

@@ -548,7 +548,7 @@ public class TbPeopleService extends ServiceImpl<TbPeopleMapper, TbPeople> imple
 				peopleDto.setId(tbPeopleList.get(0).getId());
 				Boolean aBoolean = adminInterface.generatePeopleAccount(peopleDto);
 				if(!aBoolean)
-					throw new RuntimeException("\n边民生成账号时错误。 id = " + tbPeopleList.get(0).getId() + "\n");
+					throw new RuntimeException("\n"+ tbPeopleList.get(0).getBorderName() + "生成账号时错误。 id = " + tbPeopleList.get(0).getId() + "\n");
 				return aBoolean;
 			}
 		}

Some files were not shown because too many files changed in this diff