Commit 50196369dafa955870da3319010179bfc7fb13bc

Authored by fengliang
1 parent 3bf2e3dc

update:修改层级结构

etrade-order/src/main/java/com/diligrp/etrade/order/domain/collector/co/BusinessBillCo.java
@@ -4,6 +4,7 @@ import com.diligrp.etrade.order.domain.collector.model.*; @@ -4,6 +4,7 @@ import com.diligrp.etrade.order.domain.collector.model.*;
4 import com.fasterxml.jackson.annotation.JsonProperty; 4 import com.fasterxml.jackson.annotation.JsonProperty;
5 5
6 import java.math.BigDecimal; 6 import java.math.BigDecimal;
  7 +import java.util.List;
7 8
8 /** 9 /**
9 * @Author: zhangmeiyang 10 * @Author: zhangmeiyang
@@ -62,31 +63,6 @@ public class BusinessBillCo { @@ -62,31 +63,6 @@ public class BusinessBillCo {
62 private String FAR_Remark; 63 private String FAR_Remark;
63 64
64 /** 65 /**
65 - * 单据金额  
66 - */  
67 - private BigDecimal FPrice;  
68 - /**  
69 - * 含税单价  
70 - */  
71 - private BigDecimal FTaxPrice;  
72 - /**  
73 - * 计价数量 出款方为-1,收款方为+1  
74 - */  
75 - private BigDecimal FPriceQty;  
76 - /**  
77 - * 价税合计  
78 - */  
79 - private BigDecimal FNoTaxAmountFor_D;  
80 - /**  
81 - * 费用项  
82 - */  
83 - private FCOSTID FCOSTID;  
84 - /**  
85 - * 卡号  
86 - */  
87 - private FASSETID FASSETID;  
88 -  
89 - /**  
90 * 收货方(用户id) 66 * 收货方(用户id)
91 */ 67 */
92 private FTRANSFERID FTRANSFERID; 68 private FTRANSFERID FTRANSFERID;
@@ -109,6 +85,8 @@ public class BusinessBillCo { @@ -109,6 +85,8 @@ public class BusinessBillCo {
109 */ 85 */
110 private FMAINBOOKSTDCURRID FMAINBOOKSTDCURRID; 86 private FMAINBOOKSTDCURRID FMAINBOOKSTDCURRID;
111 87
  88 + private List<FEntityDetail> FEntityDetail;
  89 +
112 @JsonProperty("FAR_Remark") 90 @JsonProperty("FAR_Remark")
113 public String getFAR_Remark() { 91 public String getFAR_Remark() {
114 return FAR_Remark; 92 return FAR_Remark;
@@ -118,33 +96,6 @@ public class BusinessBillCo { @@ -118,33 +96,6 @@ public class BusinessBillCo {
118 this.FAR_Remark = FAR_Remark; 96 this.FAR_Remark = FAR_Remark;
119 } 97 }
120 98
121 - @JsonProperty("FPrice")  
122 - public BigDecimal getFPrice() {  
123 - return FPrice;  
124 - }  
125 -  
126 - public void setFPrice(BigDecimal FPrice) {  
127 - this.FPrice = FPrice;  
128 - }  
129 -  
130 - @JsonProperty("FTaxPrice")  
131 - public BigDecimal getFTaxPrice() {  
132 - return FTaxPrice;  
133 - }  
134 -  
135 - public void setFTaxPrice(BigDecimal FTaxPrice) {  
136 - this.FTaxPrice = FTaxPrice;  
137 - }  
138 -  
139 - @JsonProperty("FPriceQty")  
140 - public BigDecimal getFPriceQty() {  
141 - return FPriceQty;  
142 - }  
143 -  
144 - public void setFPriceQty(BigDecimal FPriceQty) {  
145 - this.FPriceQty = FPriceQty;  
146 - }  
147 -  
148 @JsonProperty("FBUSINESSTYPE") 99 @JsonProperty("FBUSINESSTYPE")
149 public String getFBUSINESSTYPE() { 100 public String getFBUSINESSTYPE() {
150 return FBUSINESSTYPE; 101 return FBUSINESSTYPE;
@@ -253,24 +204,6 @@ public class BusinessBillCo { @@ -253,24 +204,6 @@ public class BusinessBillCo {
253 this.FMAINBOOKSTDCURRID = FMAINBOOKSTDCURRID; 204 this.FMAINBOOKSTDCURRID = FMAINBOOKSTDCURRID;
254 } 205 }
255 206
256 - @JsonProperty("FCOSTID")  
257 - public FCOSTID getFCOSTID() {  
258 - return FCOSTID;  
259 - }  
260 -  
261 - public void setFCOSTID(FCOSTID FCOSTID) {  
262 - this.FCOSTID = FCOSTID;  
263 - }  
264 -  
265 - @JsonProperty("FASSETID")  
266 - public FASSETID getFASSETID() {  
267 - return FASSETID;  
268 - }  
269 -  
270 - public void setFASSETID(FASSETID FASSETID) {  
271 - this.FASSETID = FASSETID;  
272 - }  
273 -  
274 @JsonProperty("FChargeId") 207 @JsonProperty("FChargeId")
275 public FChargeId getFChargeId() { 208 public FChargeId getFChargeId() {
276 return FChargeId; 209 return FChargeId;
@@ -288,12 +221,13 @@ public class BusinessBillCo { @@ -288,12 +221,13 @@ public class BusinessBillCo {
288 public void setFSettleTypeID(FSettleTypeID FSettleTypeID) { 221 public void setFSettleTypeID(FSettleTypeID FSettleTypeID) {
289 this.FSettleTypeID = FSettleTypeID; 222 this.FSettleTypeID = FSettleTypeID;
290 } 223 }
291 - @JsonProperty("FNoTaxAmountFor_D")  
292 - public BigDecimal getFNoTaxAmountFor_D() {  
293 - return FNoTaxAmountFor_D; 224 +
  225 + @JsonProperty("FEntityDetail")
  226 + public List<FEntityDetail> getFEntityDetail() {
  227 + return FEntityDetail;
294 } 228 }
295 229
296 - public void setFNoTaxAmountFor_D(BigDecimal FNoTaxAmountFor_D) {  
297 - this.FNoTaxAmountFor_D = FNoTaxAmountFor_D; 230 + public void setFEntityDetail(List<FEntityDetail> FEntityDetail) {
  231 + this.FEntityDetail = FEntityDetail;
298 } 232 }
299 } 233 }
etrade-order/src/main/java/com/diligrp/etrade/order/domain/collector/model/FEntityDetail.java 0 → 100644
  1 +package com.diligrp.etrade.order.domain.collector.model;
  2 +
  3 +import com.fasterxml.jackson.annotation.JsonProperty;
  4 +
  5 +import java.math.BigDecimal;
  6 +
  7 +/**
  8 + * @Author: zhangmeiyang
  9 + * @CreateTime: 2024-10-28 16:41
  10 + * @Version: todo
  11 + */
  12 +public class FEntityDetail {
  13 + /**
  14 + * 费用项
  15 + */
  16 + private FCOSTID FCOSTID;
  17 + /**
  18 + * 卡号
  19 + */
  20 + private FASSETID FASSETID;
  21 + /**
  22 + * 单据金额
  23 + */
  24 + private BigDecimal FPrice;
  25 + /**
  26 + * 含税单价
  27 + */
  28 + private BigDecimal FTaxPrice;
  29 + /**
  30 + * 计价数量 出款方为-1,收款方为+1
  31 + */
  32 + private BigDecimal FPriceQty;
  33 + /**
  34 + * 价税合计
  35 + */
  36 + private BigDecimal FNoTaxAmountFor_D;
  37 +
  38 + @JsonProperty("FCOSTID")
  39 + public FCOSTID getFCOSTID() {
  40 + return FCOSTID;
  41 + }
  42 +
  43 + public void setFCOSTID(FCOSTID FCOSTID) {
  44 + this.FCOSTID = FCOSTID;
  45 + }
  46 +
  47 + @JsonProperty("FASSETID")
  48 + public FASSETID getFASSETID() {
  49 + return FASSETID;
  50 + }
  51 +
  52 + public void setFASSETID(FASSETID FASSETID) {
  53 + this.FASSETID = FASSETID;
  54 + }
  55 +
  56 + @JsonProperty("FPriceQty")
  57 + public BigDecimal getFPriceQty() {
  58 + return FPriceQty;
  59 + }
  60 +
  61 + public void setFPriceQty(BigDecimal FPriceQty) {
  62 + this.FPriceQty = FPriceQty;
  63 + }
  64 +
  65 + @JsonProperty("FTaxPrice")
  66 + public BigDecimal getFTaxPrice() {
  67 + return FTaxPrice;
  68 + }
  69 +
  70 + public void setFTaxPrice(BigDecimal FTaxPrice) {
  71 + this.FTaxPrice = FTaxPrice;
  72 + }
  73 +
  74 + @JsonProperty("FPrice")
  75 + public BigDecimal getFPrice() {
  76 + return FPrice;
  77 + }
  78 +
  79 + public void setFPrice(BigDecimal FPrice) {
  80 + this.FPrice = FPrice;
  81 + }
  82 +
  83 + @JsonProperty("FNoTaxAmountFor_D")
  84 + public BigDecimal getFNoTaxAmountFor_D() {
  85 + return FNoTaxAmountFor_D;
  86 + }
  87 +
  88 + public void setFNoTaxAmountFor_D(BigDecimal FNoTaxAmountFor_D) {
  89 + this.FNoTaxAmountFor_D = FNoTaxAmountFor_D;
  90 + }
  91 +}
etrade-order/src/main/java/com/diligrp/etrade/order/service/impl/SendToCollectorImpl.java
@@ -84,12 +84,16 @@ public class SendToCollectorImpl implements SendToCollector { @@ -84,12 +84,16 @@ public class SendToCollectorImpl implements SendToCollector {
84 billCo.setFBUSINESSTYPE(BizNumberTypeEnum.HK.getCode()); 84 billCo.setFBUSINESSTYPE(BizNumberTypeEnum.HK.getCode());
85 billCo.setFAR_Remark("欠款单"+ledgerPayDto.getLedgerLog().getCode()); 85 billCo.setFAR_Remark("欠款单"+ledgerPayDto.getLedgerLog().getCode());
86 BigDecimal price = new BigDecimal(ledgerPayDto.getLedgerLog().getAmount()).divide(NumberTransform.ONE_HUNDERD,2, RoundingMode.HALF_UP).abs(); 86 BigDecimal price = new BigDecimal(ledgerPayDto.getLedgerLog().getAmount()).divide(NumberTransform.ONE_HUNDERD,2, RoundingMode.HALF_UP).abs();
87 - billCo.setFPrice(price);  
88 - billCo.setFTaxPrice(price);  
89 - billCo.setFPriceQty(NumberTransform.POSITIVE);  
90 - billCo.setFNoTaxAmountFor_D(price);  
91 - billCo.setFCOSTID(new FCOSTID(OrderConstant.ORDER_BACK_CHARGE_ITEM_CODE));//费用项  
92 - billCo.setFASSETID(new FASSETID(ledgerPayDto.getLedgerLog().getCardNo())); 87 + List<FEntityDetail> fEntityDetailList = new ArrayList<>();
  88 + FEntityDetail fEntityDetail = new FEntityDetail();
  89 + fEntityDetail.setFPrice(price);
  90 + fEntityDetail.setFTaxPrice(price);
  91 + fEntityDetail.setFPriceQty(NumberTransform.POSITIVE);
  92 + fEntityDetail.setFNoTaxAmountFor_D(price);
  93 + fEntityDetail.setFCOSTID(new FCOSTID(OrderConstant.ORDER_BACK_CHARGE_ITEM_CODE));//费用项
  94 + fEntityDetail.setFASSETID(new FASSETID(ledgerPayDto.getLedgerLog().getCardNo()));
  95 + fEntityDetailList.add(fEntityDetail);
  96 + billCo.setFEntityDetail(fEntityDetailList);
93 billCo.setFTRANSFERID(new FTRANSFERID(ledgerPayDto.getLedgerLog().getCustomerId().toString())); 97 billCo.setFTRANSFERID(new FTRANSFERID(ledgerPayDto.getLedgerLog().getCustomerId().toString()));
94 billCo.setFChargeId(new FChargeId(ledgerPayDto.getShopVo().getCustomerId().toString())); 98 billCo.setFChargeId(new FChargeId(ledgerPayDto.getShopVo().getCustomerId().toString()));
95 //不传订货方 99 //不传订货方
@@ -112,12 +116,16 @@ public class SendToCollectorImpl implements SendToCollector { @@ -112,12 +116,16 @@ public class SendToCollectorImpl implements SendToCollector {
112 billCo.setFBUSINESSTYPE(BizNumberTypeEnum.HK.getCode()); 116 billCo.setFBUSINESSTYPE(BizNumberTypeEnum.HK.getCode());
113 billCo.setFAR_Remark("欠款单"+ledgerPayDto.getLedgerLog().getCode()); 117 billCo.setFAR_Remark("欠款单"+ledgerPayDto.getLedgerLog().getCode());
114 BigDecimal price = new BigDecimal(ledgerPayDto.getLedgerLog().getAmount()).divide(NumberTransform.ONE_HUNDERD,2, RoundingMode.HALF_UP).abs(); 118 BigDecimal price = new BigDecimal(ledgerPayDto.getLedgerLog().getAmount()).divide(NumberTransform.ONE_HUNDERD,2, RoundingMode.HALF_UP).abs();
115 - billCo.setFPrice(price);  
116 - billCo.setFTaxPrice(price);  
117 - billCo.setFPriceQty(NumberTransform.NEGATIVE);  
118 - billCo.setFNoTaxAmountFor_D(price);  
119 - billCo.setFCOSTID(new FCOSTID(OrderConstant.ORDER_BACK_CHARGE_ITEM_CODE));//费用项  
120 - billCo.setFASSETID(new FASSETID(ledgerPayDto.getLedgerLog().getCustomerCardNo())); 119 + List<FEntityDetail> fEntityDetailList = new ArrayList<>();
  120 + FEntityDetail fEntityDetail = new FEntityDetail();
  121 + fEntityDetail.setFPrice(price);
  122 + fEntityDetail.setFTaxPrice(price);
  123 + fEntityDetail.setFPriceQty(NumberTransform.NEGATIVE);
  124 + fEntityDetail.setFNoTaxAmountFor_D(price);
  125 + fEntityDetail.setFCOSTID(new FCOSTID(OrderConstant.ORDER_BACK_CHARGE_ITEM_CODE));//费用项
  126 + fEntityDetail.setFASSETID(new FASSETID(ledgerPayDto.getLedgerLog().getCustomerCardNo()));
  127 + fEntityDetailList.add(fEntityDetail);
  128 + billCo.setFEntityDetail(fEntityDetailList);
121 billCo.setFTRANSFERID(new FTRANSFERID(ledgerPayDto.getShopVo().getCustomerId().toString())); 129 billCo.setFTRANSFERID(new FTRANSFERID(ledgerPayDto.getShopVo().getCustomerId().toString()));
122 billCo.setFChargeId(new FChargeId(ledgerPayDto.getLedgerLog().getCustomerId().toString())); 130 billCo.setFChargeId(new FChargeId(ledgerPayDto.getLedgerLog().getCustomerId().toString()));
123 //不传订货方 131 //不传订货方
@@ -137,16 +145,20 @@ public class SendToCollectorImpl implements SendToCollector { @@ -137,16 +145,20 @@ public class SendToCollectorImpl implements SendToCollector {
137 billCo.setFBUSINESSTYPE(BizNumberTypeEnum.ETRADE_TRADE.getCode()); 145 billCo.setFBUSINESSTYPE(BizNumberTypeEnum.ETRADE_TRADE.getCode());
138 billCo.setFAR_Remark("销售单"+order.getCode()); 146 billCo.setFAR_Remark("销售单"+order.getCode());
139 BigDecimal price = new BigDecimal(order.getTotleAmount()).divide(NumberTransform.ONE_HUNDERD,2, RoundingMode.HALF_UP).abs(); 147 BigDecimal price = new BigDecimal(order.getTotleAmount()).divide(NumberTransform.ONE_HUNDERD,2, RoundingMode.HALF_UP).abs();
140 - billCo.setFPrice(price);  
141 - billCo.setFTaxPrice(price); 148 + List<FEntityDetail> fEntityDetailList = new ArrayList<>();
  149 + FEntityDetail fEntityDetail = new FEntityDetail();
  150 + fEntityDetail.setFPrice(price);
  151 + fEntityDetail.setFTaxPrice(price);
142 if(order.getOrderStatus()!=null&&order.getOrderStatus().equals(OrderStatus.INVALID.getCode())){ 152 if(order.getOrderStatus()!=null&&order.getOrderStatus().equals(OrderStatus.INVALID.getCode())){
143 - billCo.setFPriceQty(NumberTransform.POSITIVE); 153 + fEntityDetail.setFPriceQty(NumberTransform.POSITIVE);
144 }else{ 154 }else{
145 - billCo.setFPriceQty(NumberTransform.NEGATIVE); 155 + fEntityDetail.setFPriceQty(NumberTransform.NEGATIVE);
146 } 156 }
147 - billCo.setFNoTaxAmountFor_D(price);  
148 - billCo.setFCOSTID(new FCOSTID(OrderConstant.ORDER_TRADE_CHARGE_ITEM_CODE));//费用项  
149 - billCo.setFASSETID(new FASSETID(order.getBuyerCardNo())); 157 + fEntityDetail.setFNoTaxAmountFor_D(price);
  158 + fEntityDetail.setFCOSTID(new FCOSTID(OrderConstant.ORDER_TRADE_CHARGE_ITEM_CODE));//费用项
  159 + fEntityDetail.setFASSETID(new FASSETID(order.getBuyerCardNo()));
  160 + fEntityDetailList.add(fEntityDetail);
  161 + billCo.setFEntityDetail(fEntityDetailList);
150 billCo.setFTRANSFERID(new FTRANSFERID(order.getShopCustomerId().toString())); 162 billCo.setFTRANSFERID(new FTRANSFERID(order.getShopCustomerId().toString()));
151 billCo.setFChargeId(new FChargeId(order.getBuyerId().toString())); 163 billCo.setFChargeId(new FChargeId(order.getBuyerId().toString()));
152 //不传订货方 164 //不传订货方
@@ -164,16 +176,20 @@ public class SendToCollectorImpl implements SendToCollector { @@ -164,16 +176,20 @@ public class SendToCollectorImpl implements SendToCollector {
164 billCo.setFBUSINESSTYPE(BizNumberTypeEnum.ETRADE_TRADE.getCode()); 176 billCo.setFBUSINESSTYPE(BizNumberTypeEnum.ETRADE_TRADE.getCode());
165 billCo.setFAR_Remark("销售单"+order.getCode()); 177 billCo.setFAR_Remark("销售单"+order.getCode());
166 BigDecimal price = new BigDecimal(order.getTotleAmount()).divide(NumberTransform.ONE_HUNDERD,2, RoundingMode.HALF_UP).abs(); 178 BigDecimal price = new BigDecimal(order.getTotleAmount()).divide(NumberTransform.ONE_HUNDERD,2, RoundingMode.HALF_UP).abs();
167 - billCo.setFPrice(price);  
168 - billCo.setFTaxPrice(price); 179 + List<FEntityDetail> fEntityDetailList = new ArrayList<>();
  180 + FEntityDetail fEntityDetail = new FEntityDetail();
  181 + fEntityDetail.setFPrice(price);
  182 + fEntityDetail.setFTaxPrice(price);
169 if(order.getOrderStatus()!=null&&order.getOrderStatus().equals(OrderStatus.INVALID.getCode())){ 183 if(order.getOrderStatus()!=null&&order.getOrderStatus().equals(OrderStatus.INVALID.getCode())){
170 - billCo.setFPriceQty(NumberTransform.NEGATIVE); 184 + fEntityDetail.setFPriceQty(NumberTransform.NEGATIVE);
171 }else{ 185 }else{
172 - billCo.setFPriceQty(NumberTransform.POSITIVE); 186 + fEntityDetail.setFPriceQty(NumberTransform.POSITIVE);
173 } 187 }
174 - billCo.setFNoTaxAmountFor_D(price);  
175 - billCo.setFCOSTID(new FCOSTID(OrderConstant.ORDER_TRADE_CHARGE_ITEM_CODE));//费用项  
176 - billCo.setFASSETID(new FASSETID(order.getShopCardNo())); 188 + fEntityDetail.setFNoTaxAmountFor_D(price);
  189 + fEntityDetail.setFCOSTID(new FCOSTID(OrderConstant.ORDER_TRADE_CHARGE_ITEM_CODE));//费用项
  190 + fEntityDetail.setFASSETID(new FASSETID(order.getShopCardNo()));
  191 + fEntityDetailList.add(fEntityDetail);
  192 + billCo.setFEntityDetail(fEntityDetailList);
177 billCo.setFTRANSFERID(new FTRANSFERID(order.getBuyerId().toString())); 193 billCo.setFTRANSFERID(new FTRANSFERID(order.getBuyerId().toString()));
178 billCo.setFChargeId(new FChargeId(order.getShopCustomerId().toString())); 194 billCo.setFChargeId(new FChargeId(order.getShopCustomerId().toString()));
179 //不传订货方 195 //不传订货方
etrade-order/src/main/java/com/diligrp/etrade/order/type/DynamicType.java 0 → 100644
  1 +package com.diligrp.etrade.order.type;
  2 +
  3 +import com.diligrp.etrade.order.exception.OrderErrorCode;
  4 +import com.diligrp.etrade.order.exception.OrderException;
  5 +import com.diligrp.etrade.thirdparty.error.ThirdPartyException;
  6 +
  7 +/**
  8 + * @Author: zhangmeiyang
  9 + * @CreateTime: 2024-10-28 12:33
  10 + * @Version: todo
  11 + */
  12 +public enum DynamicType {
  13 + JMSF_ITEM_CHARGE("JMSF_ITEM_CHARGE"),
  14 + JMSF_ITEM_WEIGHT("JMSF_ITEM_WEIGHT"),
  15 + COLD("506"),
  16 + CARD("CARD"),
  17 + ENTIRE_TENANCY("1"),
  18 + SUBLET("4"),
  19 + ACCOMMODATION("5"),
  20 + BAIL("3"),
  21 + EARNEST("2"),
  22 + OTHER_CHARGES("10"),
  23 + TRADE("5502"),
  24 + REFUND("5503");
  25 + public final String code;
  26 +
  27 + DynamicType(String code) {
  28 + this.code = code;
  29 + }
  30 +
  31 + public static DynamicType fromCode(String code) {
  32 + for (DynamicType type : values()) {
  33 + if (type.code.equals(code)) {
  34 + return type;
  35 + }
  36 + }
  37 + throw new OrderException(OrderErrorCode.PARAM_ERROR,"业务类型匹配错误");
  38 + }
  39 +}