From 3a8ab950ac6527aa3148480cff82e84856764738 Mon Sep 17 00:00:00 2001 From: HH Date: Wed, 25 May 2022 11:48:07 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B4=A2=E5=8A=A1=E5=AD=90=E5=8D=95mapper?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../web/controller/order/OrderController.java | 6 +- .../ghy/payment/domain/FinancialDetail.java | 9 +- .../financial/FinancialDetailMapper.xml | 112 +++++++++--------- 3 files changed, 64 insertions(+), 63 deletions(-) diff --git a/ghy-admin/src/main/java/com/ghy/web/controller/order/OrderController.java b/ghy-admin/src/main/java/com/ghy/web/controller/order/OrderController.java index bf9818db..e51d87d7 100644 --- a/ghy-admin/src/main/java/com/ghy/web/controller/order/OrderController.java +++ b/ghy-admin/src/main/java/com/ghy/web/controller/order/OrderController.java @@ -152,7 +152,7 @@ public class OrderController extends BaseController { BigDecimal fdPayMoney = payMoney.multiply(PERCENT7); // 生成上级分销的子财务单 FinancialDetail financialDetail = new FinancialDetail(financialDetailService.createCode(), deptId, - financialMaster.getId(), fdPayMoney, 2, customerPlaceId); + financialMaster.getId(), financialMaster.getCode(), fdPayMoney, 2, customerPlaceId); financialDetailService.insertFinancialDetail(financialDetail); companyRatio = companyRatio.subtract(PERCENT7); } @@ -164,7 +164,7 @@ public class OrderController extends BaseController { BigDecimal fdPayMoney = payMoney.multiply(PERCENT2); // 生成祖级分销的子财务单 FinancialDetail financialDetail = new FinancialDetail(financialDetailService.createCode(), deptId, - financialMaster.getId(), fdPayMoney, 2, parentCustomerPlaceId); + financialMaster.getId(), financialMaster.getCode(), fdPayMoney, 2, parentCustomerPlaceId); financialDetailService.insertFinancialDetail(financialDetail); companyRatio = companyRatio.subtract(PERCENT2); } @@ -173,7 +173,7 @@ public class OrderController extends BaseController { BigDecimal fdPayMoney = payMoney.multiply(companyRatio); // 生成平台抽成的子财务单 FinancialDetail financialDetail = new FinancialDetail(financialDetailService.createCode(), deptId, - financialMaster.getId(), fdPayMoney, 2, parentCustomerPlaceId); + financialMaster.getId(), financialMaster.getCode(), fdPayMoney, 2, parentCustomerPlaceId); financialDetailService.insertFinancialDetail(financialDetail); } diff --git a/ghy-payment/src/main/java/com/ghy/payment/domain/FinancialDetail.java b/ghy-payment/src/main/java/com/ghy/payment/domain/FinancialDetail.java index 70edd457..0a5de37c 100644 --- a/ghy-payment/src/main/java/com/ghy/payment/domain/FinancialDetail.java +++ b/ghy-payment/src/main/java/com/ghy/payment/domain/FinancialDetail.java @@ -27,6 +27,9 @@ public class FinancialDetail extends BaseEntity { @Excel(name = "主财务单ID", cellType = Excel.ColumnType.NUMERIC) private Long financialMasterId; + @Excel(name = "主财务单编码", cellType = Excel.ColumnType.STRING) + private String financialMasterCode; + @Excel(name = "子订单ID", cellType = Excel.ColumnType.NUMERIC) private Long orderDetailId; @@ -42,7 +45,7 @@ public class FinancialDetail extends BaseEntity { @Excel(name = "实付金额", cellType = Excel.ColumnType.STRING) private BigDecimal payMoney; - @Excel(name = "财务子单类型,师傅转派/多级分销/平台抽成", cellType = Excel.ColumnType.NUMERIC) + @Excel(name = "财务子单类型,1师傅转派/2多级分销/3平台抽成", cellType = Excel.ColumnType.NUMERIC) private Integer financialDetailType; /** @@ -66,9 +69,11 @@ public class FinancialDetail extends BaseEntity { public FinancialDetail() { } - public FinancialDetail(String code, Long deptId, Long financialMasterId, BigDecimal payMoney, Integer financialDetailType, Long payeeId) { + public FinancialDetail(String code, Long deptId, Long financialMasterId, String financialMasterCode, BigDecimal payMoney, Integer financialDetailType, Long payeeId) { + this.deptId = deptId; this.code = code; this.financialMasterId = financialMasterId; + this.financialMasterCode = financialMasterCode; this.payMoney = payMoney; this.financialDetailType = financialDetailType; this.payeeId = payeeId; diff --git a/ghy-payment/src/main/resources/mapper/financial/FinancialDetailMapper.xml b/ghy-payment/src/main/resources/mapper/financial/FinancialDetailMapper.xml index 99999bc9..4fb5b666 100644 --- a/ghy-payment/src/main/resources/mapper/financial/FinancialDetailMapper.xml +++ b/ghy-payment/src/main/resources/mapper/financial/FinancialDetailMapper.xml @@ -9,6 +9,7 @@ + @@ -27,20 +28,9 @@ - SELECT id, - code, - order_master_id, - order_master_code, - total_money, - discount_money, - pay_money, - pay_type, - pay_status, - pay_time, - financial_detail_type, - create_by, - create_time, - remark + SELECT id, dept_id, code, financial_master_id, financial_master_code, order_detail_id, + order_detail_code, total_money, discount_money, pay_money, financial_detail_type, + payee_id, pay_type, pay_status, pay_time, create_by, create_time, update_by, update_time, remark FROM financial_detail @@ -48,31 +38,32 @@ resultMap="FinancialDetailResult"> - - AND order_master_id = #{orderMasterId} + + AND financial_master_id = #{financialMasterId} - - AND order_master_code LIKE concat('%', #{orderMasterCode}, '%') + + AND financial_master_code LIKE concat('%', #{financialMasterCode}, '%') - + + AND order_detail_id = #{orderDetailId} + + + AND order_detail_code LIKE concat('%', #{orderDetailCode}, '%') + + AND pay_type = #{payType} - + AND pay_status = #{payStatus} - + AND financial_detail_type = #{financialDetailType} @@ -85,16 +76,13 @@ UPDATE financial_detail - code = #{code}, - order_master_id = #{orderMasterId}, - order_master_code = #{orderMasterCode}, - total_money = #{totalMoney}, - discount_money = #{discountMoney}, - pay_type = #{payType}, - pay_status = #{payStatus}, - pay_time = #{payTime}, - pay_money = #{payMoney}, - financial_detail_type = #{financialDetailType}, + code = #{code}, + total_money = #{totalMoney}, + discount_money = #{discountMoney}, + pay_type = #{payType}, + pay_status = #{payStatus}, + pay_time = #{payTime}, + pay_money = #{payMoney}, update_by = #{updateBy}, update_time = SYSDATE() @@ -104,29 +92,37 @@ INSERT INTO financial_detail( - code, - order_master_id, - order_master_code, - total_money, - discount_money, - pay_type, - pay_status, - pay_time, - pay_money, - financial_detail_type, + dept_id, + code, + financial_master_id, + financial_master_code, + order_detail_id, + order_detail_code, + total_money, + discount_money, + pay_money, + financial_detail_type, + payee_id, + pay_type, + pay_status, + pay_time, create_by, create_time )VALUES( - #{code}, - #{orderMasterId}, - #{orderMasterCode}, - #{totalMoney}, - #{discountMoney}, - #{payType}, - #{payStatus}, - #{payTime}, - #{payMoney}, - #{financialDetailType}, + #{deptId}, + #{code}, + #{financialMasterId}, + #{financialMasterCode}, + #{orderDetailId}, + #{orderDetailCode}, + #{totalMoney}, + #{discountMoney}, + #{payMoney}, + #{financialDetailType}, + #{payeeId}, + #{payType}, + #{payStatus}, + #{payTime}, #{createBy}, SYSDATE() ) @@ -134,7 +130,7 @@ \ No newline at end of file