Commit cc2df2c2cbcd843787ab507a273fbcb811aa5f35

Authored by zhangmeiyang
1 parent 51fdd8e1

新增保证金扣减业务

etrade-thirdparty/src/main/java/com/diligrp/etrade/thirdparty/demarcate/AbstractBillHandler.java
... ... @@ -161,20 +161,22 @@ public abstract class AbstractBillHandler<T extends BaseBillCo> extends Abstract
161 161 * @param systemCode 系统代码
162 162 */
163 163 protected void transferDataListWithFeeItem(List<T> ts, Long marketId, String systemCode) {
164   - ts.forEach(e -> {
165   - DynamicType dynamicType = DynamicType.fromCode(e.getSystemDynamicCode());
166   - billTrans.transBillCo(e, marketId, systemCode);
167   - transferPayMethod(e.getFEntityDetail(), marketId, systemCode);
168   - billTrans.transFeeItem(e.getFEntityDetail());
169   - getFilteredDynamicDataSingle(dynamicType, marketId, systemCode)
170   - .forEach((k, v) ->
171   - TRANSFER_FUNCTION_SINGLE_MAP.get(k).transferDynamic(e, v)
172   - );
173   - getFilteredDynamicDataMulti(dynamicType, marketId, systemCode)
174   - .forEach((k, v) ->
175   - TRANSFER_FUNCTION_MULTI_MAP.get(k).transferDynamic(e, v)
176   - );
177   - });
  164 + ts.forEach(e -> transferDataListWithFeeItemSingle(marketId, systemCode, e));
  165 + }
  166 +
  167 + protected void transferDataListWithFeeItemSingle(Long marketId, String systemCode, T e) {
  168 + DynamicType dynamicType = DynamicType.fromCode(e.getSystemDynamicCode());
  169 + billTrans.transBillCo(e, marketId, systemCode);
  170 + transferPayMethod(e.getFEntityDetail(), marketId, systemCode);
  171 + billTrans.transFeeItem(e.getFEntityDetail());
  172 + getFilteredDynamicDataSingle(dynamicType, marketId, systemCode)
  173 + .forEach((k, v) ->
  174 + TRANSFER_FUNCTION_SINGLE_MAP.get(k).transferDynamic(e, v)
  175 + );
  176 + getFilteredDynamicDataMulti(dynamicType, marketId, systemCode)
  177 + .forEach((k, v) ->
  178 + TRANSFER_FUNCTION_MULTI_MAP.get(k).transferDynamic(e, v)
  179 + );
178 180 }
179 181  
180 182 /**
... ... @@ -185,19 +187,21 @@ public abstract class AbstractBillHandler&lt;T extends BaseBillCo&gt; extends Abstract
185 187 * @param systemCode 系统代码
186 188 */
187 189 protected void transferDataListWithOutFeeItem(List<T> ts, Long marketId, String systemCode) {
188   - ts.forEach(e -> {
189   - DynamicType dynamicType = DynamicType.fromCode(e.getSystemDynamicCode());
190   - billTrans.transBillCo(e, marketId, systemCode);
191   - transferPayMethod(e.getFEntityDetail(), marketId, systemCode);
192   - getFilteredDynamicDataSingle(dynamicType, marketId, systemCode)
193   - .forEach((k, v) ->
194   - TRANSFER_FUNCTION_SINGLE_MAP.get(k).transferDynamic(e, v)
195   - );
196   - getFilteredDynamicDataMulti(dynamicType, marketId, systemCode)
197   - .forEach((k, v) ->
198   - TRANSFER_FUNCTION_MULTI_MAP.get(k).transferDynamic(e, v)
199   - );
200   - });
  190 + ts.forEach(e -> transferDataListWithOutFeeItemSingle(marketId, systemCode, e));
  191 + }
  192 +
  193 + protected void transferDataListWithOutFeeItemSingle(Long marketId, String systemCode, T e) {
  194 + DynamicType dynamicType = DynamicType.fromCode(e.getSystemDynamicCode());
  195 + billTrans.transBillCo(e, marketId, systemCode);
  196 + transferPayMethod(e.getFEntityDetail(), marketId, systemCode);
  197 + getFilteredDynamicDataSingle(dynamicType, marketId, systemCode)
  198 + .forEach((k, v) ->
  199 + TRANSFER_FUNCTION_SINGLE_MAP.get(k).transferDynamic(e, v)
  200 + );
  201 + getFilteredDynamicDataMulti(dynamicType, marketId, systemCode)
  202 + .forEach((k, v) ->
  203 + TRANSFER_FUNCTION_MULTI_MAP.get(k).transferDynamic(e, v)
  204 + );
201 205 }
202 206  
203 207 protected void transferPayMethod(List<FEntityDetail> fEntityDetail,Long marketId, String systemCode){
... ...
etrade-thirdparty/src/main/java/com/diligrp/etrade/thirdparty/domain/model/FEntityDetail.java
... ... @@ -18,7 +18,6 @@ public class FEntityDetail {
18 18 private BigDecimal FNoTaxAmountFor_D;
19 19 private FSettleTypeID FSettleTypeID;
20 20 private FCOSTDEPARTMENTID FCOSTDEPARTMENTID;
21   - private String systemBackUp;
22 21  
23 22 @JsonProperty("FCOSTID")
24 23 public FCOSTID getFCOSTID() {
... ... @@ -91,13 +90,4 @@ public class FEntityDetail {
91 90 public void setFCOSTDEPARTMENTID(FCOSTDEPARTMENTID FCOSTDEPARTMENTID) {
92 91 this.FCOSTDEPARTMENTID = FCOSTDEPARTMENTID;
93 92 }
94   -
95   - @JsonProperty("systemBackUp")
96   - public String getSystemBackUp() {
97   - return systemBackUp;
98   - }
99   -
100   - public void setSystemBackUp(String systemBackUp) {
101   - this.systemBackUp = systemBackUp;
102   - }
103 93 }
... ...
etrade-thirdparty/src/main/java/com/diligrp/etrade/thirdparty/handler/business/bill/SettleBillHandler.java
... ... @@ -4,10 +4,12 @@ import com.diligrp.etrade.core.util.JsonUtils;
4 4 import com.diligrp.etrade.thirdparty.demarcate.AbstractBillHandler;
5 5 import com.diligrp.etrade.thirdparty.domain.co.business.bill.SettleBillCo;
6 6 import com.diligrp.etrade.thirdparty.type.BusinessEnum;
  7 +import com.diligrp.etrade.thirdparty.type.DynamicType;
7 8 import com.fasterxml.jackson.core.type.TypeReference;
8 9 import org.springframework.stereotype.Component;
9 10  
10 11 import java.util.List;
  12 +import java.util.Optional;
11 13  
12 14 /**
13 15 * @Author: zhangmeiyang
... ... @@ -20,8 +22,12 @@ public class SettleBillHandler extends AbstractBillHandler&lt;SettleBillCo&gt; {
20 22 @Override
21 23 public void handle(String json, Long marketId, String systemCode) throws Exception {
22 24 List<SettleBillCo> settleBillCos = JsonUtils.fromJsonString(json, new TypeReference<>() {});
23   - transferDataListWithFeeItem(settleBillCos, marketId, systemCode);
24   - sendPurchaseOrder(settleBillCos,marketId, systemCode);
  25 + settleBillCos.forEach(e ->
  26 + Optional.of(e).filter(x -> DynamicType.BAIL.code.equals(x.getSystemDynamicCode()))
  27 + .ifPresentOrElse(
  28 + x -> transferDataListWithOutFeeItemSingle(marketId, systemCode, x),
  29 + () -> transferDataListWithFeeItemSingle(marketId, systemCode, e)));
  30 + sendPurchaseOrder(settleBillCos, marketId, systemCode);
25 31 }
26 32  
27 33 @Override
... ...