1.配置文件

1.1开发环境配置文件

IM和Mall的配置文件去除发票相关配置项

  1. invoice:
  2. terminalCode: 0
  3. appId: ZZS_PT_DZFP
  4. version: 2.0
  5. kjinterfaceCode: ECXML.FPKJ.BC.E_INV
  6. xzinterfaceCode: ECXML.FPXZ.CX.E_INV
  7. userName: P0000001
  8. password: 3201000020MzkwM2IwZDAxM2MxY2ExOQ==
  9. tax: 150300201007206301
  10. authorizationCode: 5056bf7539
  11. responseCode: 144
  12. zipCode: 0
  13. encryptCode: 0
  14. codeType: 0
  15. qymc: 51盒子开发十
  16. nsrdzdah:
  17. swjgDm:
  18. pydm: "000001"
  19. bmbBbh: 18.0
  20. xhfDz: 江苏南京中山路129号中南国际大厦2021
  21. xhfDh: 025-84701918
  22. xhfYhzh: 中国银行股份有限公司南京中南大厦支行 531358191694
  23. czdm: 10

IM的配置文件添加 RocketMQ配置内容

  1. rocketmq:
  2. nameServer: 10.11.0.215:9876
  3. producer:
  4. #超时时间
  5. sendMessageTimeout: 30000
  6. #发送组
  7. group: biGroup
  8. topic:
  9. invoiceApply: invoiceApply_dev
  10. invoiceResult: invoiceResult_dev
  11. consumerGroup:
  12. invoiceResult: invoiceResult_im_dev

MALL的配置

  1. rocketmq:
  2. nameServer: 10.11.0.215:9876
  3. producer:
  4. #超时时间
  5. sendMessageTimeout: 30000
  6. #发送组
  7. group: mallGroup
  8. topic:
  9. autoCancel: autoCancel_dev
  10. autoComplete: autoComplete_dev
  11. autoCloseReturn: autoCloseReturn_dev
  12. invoiceApply: invoiceApply_dev
  13. invoiceResult: invoiceResult_dev
  14. consumerGroup:
  15. autoCancel: autoCancel_dev
  16. autoComplete: autoComplete_dev
  17. autoCloseReturn: autoCloseReturn_dev
  18. invoiceResult: invoiceResult_trade_dev

Invoice-Service的配置项

  1. # 数据源配置
  2. spring:
  3. datasource:
  4. url: jdbc:mysql://10.11.0.215:3306/yurun_common?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
  5. username: root
  6. password: 123456
  7. invoice:
  8. url: "http://open.jsaisino.com//FPKJService/invoice/accept"
  9. rocketmq:
  10. nameServer: 10.11.0.215:9876
  11. producer:
  12. #超时时间
  13. sendMessageTimeout: 30000
  14. #发送组
  15. group: publicInvoiceGroup
  16. topic:
  17. invoiceApply: invoiceApply_dev
  18. invoiceDownload: invoiceDownload_dev
  19. invoiceResult: invoiceResult_dev
  20. consumerGroup:
  21. invoiceApply: invoiceApply_dev
  22. invoiceDownload: invoiceDownload_dev

2.数据库

2.1发票申请表添加字段 apply_result

1.电商

  1. ALTER TABLE mall_trade.invoice_apply_record ADD apply_result CHAR(1) NULL COMMENT '申请结果:1:等待中 2:申请失败 3:申请成功';

2.IM

  1. ALTER TABLE im.invoice_apply_record ADD apply_result CHAR(1) NULL COMMENT '申请结果:1:等待中 2:申请失败 3:申请成功';

初始化字段值

  1. #所有已开票和已邮寄的发票申请 均是申请成功
  2. update im.invoice_apply_record
  3. set apply_result = '3'
  4. where `status` in ('2','3');
  5. #所有纸质(专用)发票申请未开票的 均是等待中
  6. update im.invoice_apply_record
  7. set apply_result ='1'
  8. where `status` = '1' and invoice_type = '2';
  9. #所有电票申请 未开票的 均为开票失败
  10. update im.invoice_apply_record
  11. set apply_result = '2'
  12. where `status`='1' and invoice_type='1';

2.2数据迁移

1.IM
发票单数据迁移

  1. insert into yurun_common.invoice_record
  2. (id,apply_id,invoice_from,invoice_type,order_id,invoice_serial_no,invoice_no,invoice_code,
  3. total_amount_tax,total_amount_notax,total_tax,invoice_url,invoice_status,invoice_time,is_red,
  4. original_invoice_no,original_invoice_code,invoice_config_id)
  5. select
  6. id,apply_id,'2',IF(invoice_type = '2','1','2') ,order_id,invoice_serial_no,invoice_no,invoice_code,total_amount_tax,total_amount_notax,
  7. total_tax,invoice_url, IF(invoice_status = '4','3',invoice_status),create_time,is_red,original_invoice_no,original_invoice_code,1
  8. from
  9. im.invoice_no_record;

发票单明细数据迁移

  1. insert into
  2. yurun_common.invoice_detail
  3. (id,invoice_id,price,num,amount,tax_amount,tax_rate,order_detail_id)
  4. select
  5. id,invoice_id,price,num,amount,tax_amount,tax_rate,order_detail_id
  6. from im.invoice_item_detail;

2.电商不做数据迁移

2.3 无用表整理

  1. MALL-TRADE库和IM库中 发票单和发票明细表都无用了