提交 aa584296 authored 作者: huyufan's avatar huyufan

增加解冻释放保证金处理

上级 54dc3aa5
...@@ -18,9 +18,14 @@ public class ThirdComponent { ...@@ -18,9 +18,14 @@ public class ThirdComponent {
public static final String TRANSPORT_KEY = "9Y1N5AUP8N2TI359"; public static final String TRANSPORT_KEY = "9Y1N5AUP8N2TI359";
public static String encrypt(String param) throws Exception { public static String encrypt(String param){
HttpDTO httpDTO = EncryptUtil.buildDTO(TRANSPORT_USER, param, TRANSPORT_KEY, System.currentTimeMillis()); HttpDTO httpDTO = null;
try {
httpDTO = EncryptUtil.buildDTO(TRANSPORT_USER, param, TRANSPORT_KEY, System.currentTimeMillis());
} catch (GeneralSecurityException e) {
throw new RuntimeException(e);
}
return JSONUtil.parse(httpDTO).toString(); return JSONUtil.parse(httpDTO).toString();
} }
......
...@@ -60,7 +60,8 @@ public class TransportSyncController { ...@@ -60,7 +60,8 @@ public class TransportSyncController {
log.info("payStatusNotify 原始报文:{}", JSONUtil.parse(param)); log.info("payStatusNotify 原始报文:{}", JSONUtil.parse(param));
String decrypt = ThirdComponent.decrypt(param.getChildNo()); String decrypt = ThirdComponent.decrypt(param.getChildNo());
log.info("payStatusNotify 解密后:{}", decrypt); log.info("payStatusNotify 解密后:{}", decrypt);
return Result.ok(decrypt);
return Result.ok(ThirdComponent.encrypt("success"));
} }
......
...@@ -27,6 +27,7 @@ public class SettlementDriverDetailDaoImpl extends BaseDaoImpl<SettlementDriverD ...@@ -27,6 +27,7 @@ public class SettlementDriverDetailDaoImpl extends BaseDaoImpl<SettlementDriverD
return update(lUdWrapper() return update(lUdWrapper()
.eq(SettlementDriverDetail::getId, item.getId()) .eq(SettlementDriverDetail::getId, item.getId())
.set(SettlementDriverDetail::getInvoiceType, item.getInvoiceType()) .set(SettlementDriverDetail::getInvoiceType, item.getInvoiceType())
.set(SettlementDriverDetail::getPrepayFreight, item.getPrepayFreight())
.set(SettlementDriverDetail::getPrepayFreightFlag, item.getPrepayFreightFlag()) .set(SettlementDriverDetail::getPrepayFreightFlag, item.getPrepayFreightFlag())
); );
} }
......
...@@ -13,6 +13,7 @@ import com.clx.performance.component.OrderCancelComponent; ...@@ -13,6 +13,7 @@ import com.clx.performance.component.OrderCancelComponent;
import com.clx.performance.constant.RabbitKeyConstants; import com.clx.performance.constant.RabbitKeyConstants;
import com.clx.performance.dao.OrderChildDao; import com.clx.performance.dao.OrderChildDao;
import com.clx.performance.dao.OrderGoodsDao; import com.clx.performance.dao.OrderGoodsDao;
import com.clx.performance.dao.settle.SettlementOwnerDetailDao;
import com.clx.performance.enums.*; import com.clx.performance.enums.*;
import com.clx.performance.extranal.user.DriverService; import com.clx.performance.extranal.user.DriverService;
import com.clx.performance.model.OrderChild; import com.clx.performance.model.OrderChild;
...@@ -76,6 +77,8 @@ public class OrderCancelServiceImpl implements OrderCancelService { ...@@ -76,6 +77,8 @@ public class OrderCancelServiceImpl implements OrderCancelService {
private final OrderChildPostService orderChildPostService; private final OrderChildPostService orderChildPostService;
private final SettlementOwnerDetailDao settlementOwnerDetailDao;
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
...@@ -178,13 +181,16 @@ public class OrderCancelServiceImpl implements OrderCancelService { ...@@ -178,13 +181,16 @@ public class OrderCancelServiceImpl implements OrderCancelService {
} }
//TODO 注意判断普通单还是网运单 普通单类型 1 网运单 2 //TODO 注意判断普通单还是网运单 普通单类型 1 网运单 2
Integer invoiceType = settlementOwnerDetailDao.getInvoiceType(orderNo);
ThawAccountParam thawAccountParam = new ThawAccountParam(); ThawAccountParam thawAccountParam = new ThawAccountParam();
thawAccountParam.setOrderNo(orderNo); if (OwnerAccountEnum.OrderChildTypeStatus.ORDINARY.getCode().equals(invoiceType)) {
thawAccountParam.setOrderType(OwnerAccountEnum.OrderChildTypeStatus.ORDINARY.getCode()); thawAccountParam.setOrderType(OwnerAccountEnum.OrderChildTypeStatus.ORDINARY.getCode());
} else {
thawAccountParam.setOrderType(OwnerAccountEnum.OrderChildTypeStatus.NETWORK.getCode());
}
thawAccountParam.setOrderNo(orderNo);
log.info("执行解冻账户,参数:{}", JSONUtil.parse(thawAccountParam)); log.info("执行解冻账户,参数:{}", JSONUtil.parse(thawAccountParam));
ownerAccountService.ownerAccountThaw(thawAccountParam); ownerAccountService.ownerAccountThaw(thawAccountParam);
Result<Object> result = orderFeign.updateOrderStatusByOrderNo(orderNo, orderStatusCode); Result<Object> result = orderFeign.updateOrderStatusByOrderNo(orderNo, orderStatusCode);
if (!result.succeed()) { if (!result.succeed()) {
throw new RuntimeException("货主取消订单失败,原因:远程调用取消订单失败"); throw new RuntimeException("货主取消订单失败,原因:远程调用取消订单失败");
...@@ -337,10 +343,14 @@ public class OrderCancelServiceImpl implements OrderCancelService { ...@@ -337,10 +343,14 @@ public class OrderCancelServiceImpl implements OrderCancelService {
orderFeign.orderCancelReason(orderCancelReasonParam); orderFeign.orderCancelReason(orderCancelReasonParam);
//TODO 注意判断普通单还是网运单 普通单类型 1 网运单 2 //TODO 注意判断普通单还是网运单 普通单类型 1 网运单 2
Integer invoiceType = settlementOwnerDetailDao.getInvoiceType(orderNo);
ThawAccountParam thawAccountParam = new ThawAccountParam(); ThawAccountParam thawAccountParam = new ThawAccountParam();
thawAccountParam.setOrderNo(orderNo); if (OwnerAccountEnum.OrderChildTypeStatus.ORDINARY.getCode().equals(invoiceType)) {
thawAccountParam.setOrderType(OwnerAccountEnum.OrderChildTypeStatus.ORDINARY.getCode()); thawAccountParam.setOrderType(OwnerAccountEnum.OrderChildTypeStatus.ORDINARY.getCode());
} else {
thawAccountParam.setOrderType(OwnerAccountEnum.OrderChildTypeStatus.NETWORK.getCode());
}
thawAccountParam.setOrderNo(orderNo);
log.info("执行解冻账户,参数:{}", JSONUtil.parse(thawAccountParam)); log.info("执行解冻账户,参数:{}", JSONUtil.parse(thawAccountParam));
ownerAccountService.ownerAccountThaw(thawAccountParam); ownerAccountService.ownerAccountThaw(thawAccountParam);
...@@ -471,9 +481,14 @@ public class OrderCancelServiceImpl implements OrderCancelService { ...@@ -471,9 +481,14 @@ public class OrderCancelServiceImpl implements OrderCancelService {
orderFeign.orderCancelReason(orderCancelReasonParam); orderFeign.orderCancelReason(orderCancelReasonParam);
//TODO 注意判断普通单还是网运单 普通单类型 1 网运单 2 //TODO 注意判断普通单还是网运单 普通单类型 1 网运单 2
Integer invoiceType = settlementOwnerDetailDao.getInvoiceType(orderNo);
ThawAccountParam thawAccountParam = new ThawAccountParam(); ThawAccountParam thawAccountParam = new ThawAccountParam();
thawAccountParam.setOrderNo(orderNo); if (OwnerAccountEnum.OrderChildTypeStatus.ORDINARY.getCode().equals(invoiceType)) {
thawAccountParam.setOrderType(OwnerAccountEnum.OrderChildTypeStatus.ORDINARY.getCode()); thawAccountParam.setOrderType(OwnerAccountEnum.OrderChildTypeStatus.ORDINARY.getCode());
} else {
thawAccountParam.setOrderType(OwnerAccountEnum.OrderChildTypeStatus.NETWORK.getCode());
}
thawAccountParam.setOrderNo(orderNo);
log.info("执行解冻账户,参数:{}", JSONUtil.parse(thawAccountParam)); log.info("执行解冻账户,参数:{}", JSONUtil.parse(thawAccountParam));
ownerAccountService.ownerAccountThaw(thawAccountParam); ownerAccountService.ownerAccountThaw(thawAccountParam);
......
...@@ -181,7 +181,9 @@ public class SettlementMqHandlerServiceImpl implements SettlementMqHandlerServic ...@@ -181,7 +181,9 @@ public class SettlementMqHandlerServiceImpl implements SettlementMqHandlerServic
settlementDriver.setPrepayFreightFlag(detail.getPrepayFreightFlag()); settlementDriver.setPrepayFreightFlag(detail.getPrepayFreightFlag());
settlementDriver.setSettlementFreight(detail.getSettlementFreight()); settlementDriver.setSettlementFreight(detail.getSettlementFreight());
settlementDriver.setInvoiceType(detail.getInvoiceType()); settlementDriver.setInvoiceType(detail.getInvoiceType());
settlementDriver.setSettlementPlatform(String.valueOf(SettlementPlatformEnum.Platform.MSL.getCode())); settlementDriver.setSettlementPlatform(detail.getInvoiceType() == 1 ?
String.valueOf(SettlementPlatformEnum.Platform.WY.getCode()):
String.valueOf(SettlementPlatformEnum.Platform.MSL.getCode()));
if (settlementDriver.getInvoiceType().equals(SettlementOwnerEnum.InvoiceType.ONLINE.getCode())) { if (settlementDriver.getInvoiceType().equals(SettlementOwnerEnum.InvoiceType.ONLINE.getCode())) {
settlementDriver.setStatus(SettlementDriverEnum.Status.SETTLED.getCode()); settlementDriver.setStatus(SettlementDriverEnum.Status.SETTLED.getCode());
} else { } else {
......
...@@ -104,11 +104,10 @@ public class SettlementServiceImpl implements SettlementService { ...@@ -104,11 +104,10 @@ public class SettlementServiceImpl implements SettlementService {
BigDecimal subtract = frozen.subtract(takeOut); BigDecimal subtract = frozen.subtract(takeOut);
if (subtract.compareTo(BigDecimal.ZERO) <= 0) { if (subtract.compareTo(BigDecimal.ZERO) <= 0) {
settlementOwnerDetail.setPrepayFreight(BigDecimal.ZERO); settlementOwnerDetail.setPrepayFreight(BigDecimal.ZERO);
} } else {
if (subtract.subtract(ans).compareTo(BigDecimal.ZERO) >= 0) { if (subtract.subtract(ans).compareTo(BigDecimal.ZERO) >= 0) {
OwnerAccount account = ownerAccountDao.getAccountByOwnerUserNoAndAccountType(orderChild.getOwnerUserNo(), OwnerAccount account = ownerAccountDao.getAccountByOwnerUserNoAndAccountType(orderChild.getOwnerUserNo(),
OwnerAccountEnum.AccountTypeStatus.PREPAID_FREIGHT_ACCOUNT.getCode()); OwnerAccountEnum.AccountTypeStatus.PREPAID_FREIGHT_ACCOUNT.getCode());
settlementOwnerDetail.setPrepayFreight(ans); settlementOwnerDetail.setPrepayFreight(ans);
//生成扣除流水 //生成扣除流水
OwnerRunningWaterRecord runningWaterRecord = new OwnerRunningWaterRecord(); OwnerRunningWaterRecord runningWaterRecord = new OwnerRunningWaterRecord();
...@@ -133,6 +132,8 @@ public class SettlementServiceImpl implements SettlementService { ...@@ -133,6 +132,8 @@ public class SettlementServiceImpl implements SettlementService {
} else { } else {
settlementOwnerDetail.setPrepayFreight(BigDecimal.ZERO); settlementOwnerDetail.setPrepayFreight(BigDecimal.ZERO);
} }
}
} else { } else {
settlementDriverDetail.setPrepayFreightFlag(0); settlementDriverDetail.setPrepayFreightFlag(0);
invoiceType = SettlementOwnerEnum.InvoiceType.ORDINARY.getCode(); invoiceType = SettlementOwnerEnum.InvoiceType.ORDINARY.getCode();
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论