Browse Source

C端报关单新增返回报关单文件

zhangchenm 1 week ago
parent
commit
5cd077d881

+ 2 - 1
trade-client/src/main/java/com/trade/client/trade/salesorder/service/impl/SalesOrderCServiceImpl.java

@@ -211,7 +211,8 @@ public class SalesOrderCServiceImpl implements SalesOrderCService {
         EnterpriseRelatedPerson contact = relatedPersonBaseService
                 .getContactByChangeRecordId(enterprise.getChangeRecordId());
         String customerName = enterprise.getName();
-        String customerAddress = enterprise.getBusinessAddress();
+        String customerAddress = StringUtils.isEmpty(enterprise.getBusinessAddress()) ? enterprise.getRegisterAddress()
+                : enterprise.getBusinessAddress();
         String contractTel = contact.getMobile();
         if (DictConstants.EXPORT_TYPE_PROXY.equals(enterprise.getExportType())) {
             TradingPlatform tradingPlatform = tradingPlatformBaseService.lambdaQuery()

+ 1 - 1
trade-service/src/main/java/com/trade/service/TransStruct.java

@@ -47,7 +47,7 @@ public interface TransStruct {
     @Mappings({
             @Mapping(source = "price", target = "unitPrice"),
             @Mapping(source = "packingSpecifications", target = "packages"),
-            @Mapping(source = "name", target = "goodsName"), @Mapping(source = "priceTotal", target = "amount")
+            @Mapping(source = "declarationName", target = "goodsName"), @Mapping(source = "priceTotal", target = "amount")
     })
     @Named("transSalesOrder2GoodsInfo4TL")
     GoodsInfo4TL transSalesOrder2GoodsInfo4TL(SalesOrderGoods salesOrderGoods);

+ 8 - 0
trade-service/src/main/java/com/trade/service/enterprise/companyrelated/domain/ImporterEntity.java

@@ -106,33 +106,41 @@ public class ImporterEntity extends BizBaseEntity {
     /**
      * 经营品类
      */
+    @NotBlank(message = "经营品类不能为空")
     private String businessCategory;
     /**
      * 交易年限
      */
+    @NotBlank(message = "交易年限不能为空")
     private String tradingLife;
     /**
      * 结算周期(天)
      */
+    @NotBlank(message = "结算周期(天)不能为空")
     private Integer settlementPeriod;
     /**
      * 过去一年双方交易额
      */
+    @NotNull(message = "过去一年双方交易额不能为空")
     private BigDecimal tradingAmountPastYear;
     /**
      * 过去一年双方交易额货币
      */
+    @NotBlank(message = "过去一年双方交易额货币不能为空")
     private String tradingAmountPastYearCurrency;
     /**
      * 拟申请额度金额
      */
+    @NotNull(message = "拟申请额度金额不能为空")
     private BigDecimal amountToBeApplied;
     /**
      * 拟申请额度金额币种
      */
+    @NotBlank(message = "拟申请额度金额币种不能为空")
     private String amountToBeAppliedCurrency;
     /**
      * 拟申请额度期限(M/Y)
      */
+    @NotBlank(message = "拟申请额度期限不能为空")
     private String periodToBeApplied;
 }

+ 2 - 0
trade-service/src/main/java/com/trade/service/trade/salesorder/service/impl/CustomsDeclarationServiceImpl.java

@@ -71,6 +71,8 @@ public class CustomsDeclarationServiceImpl extends ServiceImpl<CustomsDeclaratio
                 .listWithCustomsDeclarationDtlByOrderId(customsDeclarationDtlVO.getOrderId()));
         customsDeclarationDtlVO.setEntrustFile(new FileAbstractDto(
                 tFileStorageService.getFileStorageById(customsDeclarationDtlVO.getEntrustFileId())));
+        customsDeclarationDtlVO.setCustomsFile(new FileAbstractDto(
+                tFileStorageService.getFileStorageById(customsDeclarationDtlVO.getCustomsFileId())));
         return customsDeclarationDtlVO;
     }
 

+ 6 - 0
trade-service/src/main/java/com/trade/service/trade/salesorder/vo/CustomsDeclarationDtlVO.java

@@ -72,6 +72,12 @@ public class CustomsDeclarationDtlVO {
     private FileAbstractDto entrustFile;
     @ApiModelProperty(name = "entrustFileId", value = "委托报关协议文件id")
     private Long entrustFileId;
+    @ApiModelProperty(name = "customsNo", value = "报关单号")
+    private String customsNo;
+    @ApiModelProperty(name = "customsFile", value = "报关单文件")
+    private FileAbstractDto customsFile;
+    @ApiModelProperty(name = "customsFileId", value = "报关单文件id")
+    private Long customsFileId;
     @ApiModelProperty(name = "customsDeclarationGoodsDtlVOList", value = "商品明细")
     List<CustomsDeclarationGoodsDtlVO> customsDeclarationGoodsDtlVOList;
 }

+ 65 - 0
trade-service/src/main/resources/data.init/v1.1/20241031_zhangchenming.sql

@@ -0,0 +1,65 @@
+-- 20241022
+-- 进口商新增字段
+ALTER TABLE `importer_entity`
+    ADD COLUMN `business_category` varchar(2) DEFAULT '' COMMENT '经营品类' AFTER `vat_no`;
+
+ALTER TABLE `importer_entity`
+    ADD COLUMN `trading_life` varchar(16) DEFAULT '' COMMENT '交易年限(M/Y)' AFTER `business_category`;
+
+ALTER TABLE `importer_entity`
+    ADD COLUMN `settlement_period` SMALLINT(6) DEFAULT 0 COMMENT '结算账期(天)' AFTER `trading_life`;
+
+ALTER TABLE `importer_entity`
+    ADD COLUMN `trading_amount_past_year` DECIMAL(17, 2) DEFAULT 0 COMMENT '过去一年双方交易额' AFTER `settlement_period`;
+
+ALTER TABLE `importer_entity`
+    ADD COLUMN `trading_amount_past_year_currency` varchar(3) DEFAULT '' COMMENT '过去一年双方交易额币种' AFTER `trading_amount_past_year`;
+
+ALTER TABLE `importer_entity`
+    ADD COLUMN `amount_to_be_applied` DECIMAL(17, 2) DEFAULT 0 COMMENT '拟申请额度金额' AFTER `amount_trading_past_year_currency`;
+
+ALTER TABLE `importer_entity`
+    ADD COLUMN `amount_to_be_applied_currency` varchar(3) DEFAULT '' COMMENT '拟申请额度金额币种' AFTER `amount_to_be_applied`;
+
+ALTER TABLE `importer_entity`
+    ADD COLUMN `period_to_be_applied` varchar(16) DEFAULT '' COMMENT '拟申请额度期限(M/Y)' AFTER `amount_to_be_applied_currency`;
+
+
+-- 新建备案单证写入小图任务
+DROP TABLE IF EXISTS `filing_doc_write_task`;
+CREATE TABLE `filing_doc_write_task`
+(
+    `id`      bigint(20)  NOT NULL AUTO_INCREMENT COMMENT '主键id',
+    `cert_no` varchar(50) NOT NULL COMMENT '企业证件号',
+    `biz_no`  varchar(50) NOT NULL COMMENT '业务编号',
+    `part`    tinyint(4)   DEFAULT 1 COMMENT '阶段',
+    `status`  tinyint(4)   DEFAULT 0 COMMENT '状态',
+    `remark`  varchar(128) DEFAULT '' COMMENT '备注',
+    PRIMARY KEY (`id`)
+) ENGINE = InnoDB
+  DEFAULT CHARSET = utf8mb4 COMMENT ='备案单证写入小图任务';
+
+
+-- 报关单相关文件
+DROP TABLE IF EXISTS `customs_declaration_file`;
+CREATE TABLE `customs_declaration_file`
+(
+    `id`              bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID',
+    `customs_no`      varchar(18) COLLATE utf8mb4_bin DEFAULT '' COMMENT '报关单海关编号',
+    `customs_file_id` bigint(20)                      DEFAULT NULL COMMENT '报关单文件id',
+    `entrust_no`      varchar(32) COLLATE utf8mb4_bin DEFAULT '' COMMENT '委托报关协议编号',
+    `entrust_file_id` bigint(20)                      DEFAULT NULL COMMENT '委托报关协议文件id',
+    `deleted`         tinyint(1)                      DEFAULT '0' COMMENT '删除标识',
+    `gmt_create`      timestamp           NOT NULL    DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
+    `gmt_modified`    timestamp           NOT NULL    DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
+    PRIMARY KEY (`id`)
+) ENGINE = InnoDB
+  DEFAULT CHARSET = utf8mb4
+  COLLATE = utf8mb4_bin COMMENT ='报关单相关文件';
+
+
+-- 销售订单物流新增字段
+ALTER TABLE `sales_order_logistics`
+    ADD COLUMN `lading_type` varchar(2) DEFAULT '' COMMENT '提运单类型' AFTER `dest_port`;
+ALTER TABLE `sales_order_logistics`
+    ADD COLUMN `lading_date` datetime DEFAULT NULL COMMENT '提运单日期' AFTER `lading_type`;

+ 3 - 3
trade-service/src/main/resources/mapper/enterprise/companyrelated/ImporterEntityMapper.xml

@@ -12,7 +12,7 @@
         gmt_modified,
         customer_user_id, entity_no, region, country, `status`, entity_name, cert_type, cert_no, business_province, business_city, business_address, business_post_code, contact_direct_ind,
         contact_name, contact_mobile, contact_email, vat_no, business_category, trading_life, settlement_period,
-        trading_amount_past_year, amount_trading_past_year_currency, amount_to_be_applied, amount_to_be_applied_currency, period_to_be_applied
+        trading_amount_past_year, trading_amount_past_year_currency, amount_to_be_applied, amount_to_be_applied_currency, period_to_be_applied
     </sql>
 
     <!-- 根据证件号查询企业相关信息 -->
@@ -37,7 +37,7 @@
         a.gmt_modified,
         a.customer_user_id, a.entity_no, a.region, a.country, a.`status`, a.entity_name, a.cert_type, a.cert_no, a.business_province, a.business_city, a.business_address, a.business_post_code, a.contact_direct_ind,
         a.contact_name, a.contact_mobile, a.contact_email, a.vat_no, b.name as customer_name, b.customer_identifier_no,
-        a.business_category, a.trading_life, a.settlement_period,a.trading_amount_past_year, a.amount_trading_past_year_currency, a.amount_to_be_applied, a.amount_to_be_applied_currency, a.period_to_be_applied
+        a.business_category, a.trading_life, a.settlement_period,a.trading_amount_past_year, a.trading_amount_past_year_currency, a.amount_to_be_applied, a.amount_to_be_applied_currency, a.period_to_be_applied
         FROM
         importer_entity a
         left join enterprise b on a.customer_user_id = b.customer_id
@@ -87,7 +87,7 @@
             a.gmt_modified,
             a.customer_user_id, a.entity_no, a.region, a.country, a.`status`, a.entity_name, a.cert_type, a.cert_no, a.business_province, a.business_city, a.business_address, a.business_post_code, a.contact_direct_ind,
             a.contact_name, a.contact_mobile, a.contact_email, a.vat_no, b.name as customer_name, b.customer_identifier_no,
-            a.business_category, a.trading_life, a.settlement_period,a.trading_amount_past_year, a.amount_trading_past_year_currency, a.amount_to_be_applied, a.amount_to_be_applied_currency, a.period_to_be_applied
+            a.business_category, a.trading_life, a.settlement_period,a.trading_amount_past_year, a.trading_amount_past_year_currency, a.amount_to_be_applied, a.amount_to_be_applied_currency, a.period_to_be_applied
         FROM
         importer_entity a
         left join enterprise b on a.customer_user_id = b.customer_id

+ 3 - 1
trade-service/src/main/resources/mapper/trade/salesorder/CustomsDeclarationMapper.xml

@@ -115,6 +115,7 @@
 
     <select id="getDetailById" resultType="com.trade.service.trade.salesorder.vo.CustomsDeclarationDtlVO">
         select
+            a.bgdhgbh customs_no,
             a.sbhggqka_dm,
             a.sbhggqkajc,
             a.yfje,
@@ -145,7 +146,8 @@
             g.from_port,
             g.dest_port,
             h.entrust_file_id,
-            h.entrust_no
+            h.entrust_no,
+            h.customs_file_id
         From customs_declaration a
                  left join sales_order b on a.sale_order_no = b.order_no
                  left join sales_contract c on b.sale_contract_id = c.id