|
@@ -448,7 +448,7 @@ public class TbOrderService extends ServiceImpl<TbOrderMapper, TbOrder> implemen
|
|
StaticLog.info("getPaymentData:{}", JSONUtil.toJsonStr(htTradeSettlement));
|
|
StaticLog.info("getPaymentData:{}", JSONUtil.toJsonStr(htTradeSettlement));
|
|
PaymentDto paymentDto = new PaymentDto();
|
|
PaymentDto paymentDto = new PaymentDto();
|
|
BeanUtils.copyProperties(htTradeSettlement, paymentDto);
|
|
BeanUtils.copyProperties(htTradeSettlement, paymentDto);
|
|
-
|
|
|
|
|
|
+ paymentDto.setId(tbOrder.getId());
|
|
paymentDto.setTradeNo(tbOrder.getTradeNo());
|
|
paymentDto.setTradeNo(tbOrder.getTradeNo());
|
|
paymentDto.setCodeTs(tbOrder.getCodeTs());
|
|
paymentDto.setCodeTs(tbOrder.getCodeTs());
|
|
paymentDto.setBuyQty(tbOrder.getBuyQty());
|
|
paymentDto.setBuyQty(tbOrder.getBuyQty());
|
|
@@ -720,11 +720,16 @@ public class TbOrderService extends ServiceImpl<TbOrderMapper, TbOrder> implemen
|
|
*/
|
|
*/
|
|
public boolean orderRefund(Long id) {
|
|
public boolean orderRefund(Long id) {
|
|
TbOrder order = getById(id);
|
|
TbOrder order = getById(id);
|
|
- if (order.getPeopleConfirmStatus() != 1
|
|
|
|
- || order.getSxb010Status() != 1
|
|
|
|
- || order.getRefundStatus() != 0
|
|
|
|
- )
|
|
|
|
- throw new AjaxError("当前订单状态已改变,不可做退款操作,请刷新后操作!");
|
|
|
|
|
|
+ int refundStatus=order.getRefundStatus();
|
|
|
|
+ if(refundStatus==1||refundStatus==3){
|
|
|
|
+ StaticLog.error("\n---------退货退款失败:{}已退货退款", id);
|
|
|
|
+ throw new AjaxError("订单已退款或者退款中");
|
|
|
|
+ }
|
|
|
|
+ int sx010Status=order.getSxb010Status();
|
|
|
|
+ if (sx010Status!=1){
|
|
|
|
+ StaticLog.error("\n---------退货退款失败:{}银行��边民的款未成功", id);
|
|
|
|
+ throw new AjaxError("银行扣边民的款未成功");
|
|
|
|
+ }
|
|
|
|
|
|
PaymentDto paymentDto = this.getPaymentData(order);
|
|
PaymentDto paymentDto = this.getPaymentData(order);
|
|
paymentServerInterface.sendSXB013(paymentDto);
|
|
paymentServerInterface.sendSXB013(paymentDto);
|
|
@@ -746,23 +751,30 @@ public class TbOrderService extends ServiceImpl<TbOrderMapper, TbOrder> implemen
|
|
TbOrder tbOrder = getById(id);
|
|
TbOrder tbOrder = getById(id);
|
|
if (tbOrder == null) {
|
|
if (tbOrder == null) {
|
|
StaticLog.error("\n---------补扣款失败:{}不存在", id);
|
|
StaticLog.error("\n---------补扣款失败:{}不存在", id);
|
|
- return false;
|
|
|
|
|
|
+ throw new AjaxError("订单不存在");
|
|
}
|
|
}
|
|
- if (tbOrder.getSxb010Status() == 1) {
|
|
|
|
- StaticLog.error("\n---------补扣款失败:{}不存在", id);
|
|
|
|
- return false;
|
|
|
|
|
|
+ if (tbOrder.getSxb010Status() == 1 && tbOrder.getRefundStatus() == 0) {
|
|
|
|
+ StaticLog.error("\n---------补扣款失败:{}已扣款", id);
|
|
|
|
+ throw new AjaxError("订单已扣款");
|
|
|
|
+ }
|
|
|
|
+ if (tbOrder.getSxb010Status() == 3) {
|
|
|
|
+ StaticLog.error("\n---------补扣款失败:{}退款中", id);
|
|
|
|
+ throw new AjaxError("订单退款中");
|
|
}
|
|
}
|
|
if (StrUtil.isEmpty(tbOrder.getGoodsNames())) {
|
|
if (StrUtil.isEmpty(tbOrder.getGoodsNames())) {
|
|
StaticLog.error("\n---------无商品信息:{}", id);
|
|
StaticLog.error("\n---------无商品信息:{}", id);
|
|
- return false;
|
|
|
|
|
|
+ throw new AjaxError("订单无商品信息");
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ Integer deductionCount = tbOrder.getDeductionCount() + 1;
|
|
|
|
+ String tradeNo=tbOrder.getTradeNo();
|
|
|
|
+ tradeNo=StrUtil.subBefore(tradeNo,"_",false);
|
|
|
|
+ tbOrder.setTradeNo(tradeNo + "_" + deductionCount);
|
|
PaymentDto paymentDto = this.getPaymentData(tbOrder);
|
|
PaymentDto paymentDto = this.getPaymentData(tbOrder);
|
|
StaticLog.info("\n---订单补扣款---sendSXB010——PaymentDto——:{}", JSONUtil.toJsonStr(paymentDto));
|
|
StaticLog.info("\n---订单补扣款---sendSXB010——PaymentDto——:{}", JSONUtil.toJsonStr(paymentDto));
|
|
paymentServerInterface.sendSXB010(paymentDto);
|
|
paymentServerInterface.sendSXB010(paymentDto);
|
|
-
|
|
|
|
- tbOrder.setDeductionCount(tbOrder.getDeductionCount() + 1);
|
|
|
|
- tbOrder.setDeductionTime(new Date());
|
|
|
|
|
|
+ tbOrder.setDeductionCount(deductionCount);
|
|
|
|
+ tbOrder.setDeductionTime(new Date())
|
|
|
|
+ .setSxb010Status(3);
|
|
|
|
|
|
return super.updateById(tbOrder);
|
|
return super.updateById(tbOrder);
|
|
}
|
|
}
|
|
@@ -774,15 +786,20 @@ public class TbOrderService extends ServiceImpl<TbOrderMapper, TbOrder> implemen
|
|
LambdaQueryWrapper<TbOrder> wrapper = new LambdaQueryWrapper<>();
|
|
LambdaQueryWrapper<TbOrder> wrapper = new LambdaQueryWrapper<>();
|
|
wrapper.eq(TbOrder::getVeNo, veNo);
|
|
wrapper.eq(TbOrder::getVeNo, veNo);
|
|
wrapper.eq(TbOrder::getSaleMainId, id);
|
|
wrapper.eq(TbOrder::getSaleMainId, id);
|
|
- wrapper.ne(TbOrder::getSxb010Status, 1).orderByDesc(TbOrder::getCreateTime);
|
|
|
|
|
|
+ wrapper.and(i -> i.ne(TbOrder::getSxb010Status, 1).ne(TbOrder::getSxb010Status, 3))
|
|
|
|
+ .orderByDesc(TbOrder::getCreateTime);
|
|
List<TbOrder> tbOrders = tbOrderMapper.selectList(wrapper);
|
|
List<TbOrder> tbOrders = tbOrderMapper.selectList(wrapper);
|
|
if (!tbOrders.isEmpty()) {
|
|
if (!tbOrders.isEmpty()) {
|
|
for (TbOrder tbOrder : tbOrders) {
|
|
for (TbOrder tbOrder : tbOrders) {
|
|
|
|
+ Integer deductionCount = tbOrder.getDeductionCount() + 1;
|
|
|
|
+ String tradeNo=tbOrder.getTradeNo();
|
|
|
|
+ tradeNo=StrUtil.subBefore(tradeNo,"_",false);
|
|
|
|
+ tbOrder.setTradeNo(tradeNo + "_" + deductionCount);
|
|
PaymentDto paymentDto = this.getPaymentData(tbOrder);
|
|
PaymentDto paymentDto = this.getPaymentData(tbOrder);
|
|
StaticLog.info("\n---订单补扣款——按车---sendSXB010——PaymentDto——:{}", JSONUtil.toJsonStr(paymentDto));
|
|
StaticLog.info("\n---订单补扣款——按车---sendSXB010——PaymentDto——:{}", JSONUtil.toJsonStr(paymentDto));
|
|
- paymentServerInterface.sendSXB010(paymentDto);
|
|
|
|
|
|
+ //paymentServerInterface.sendSXB010(paymentDto);
|
|
|
|
|
|
- tbOrder.setDeductionCount(tbOrder.getDeductionCount() + 1);
|
|
|
|
|
|
+ tbOrder.setDeductionCount(deductionCount);
|
|
tbOrder.setDeductionTime(new Date());
|
|
tbOrder.setDeductionTime(new Date());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -866,7 +883,10 @@ public class TbOrderService extends ServiceImpl<TbOrderMapper, TbOrder> implemen
|
|
if (2 == SXB013Status) {//退款失败
|
|
if (2 == SXB013Status) {//退款失败
|
|
tbOrder.setRefundStatus(2).setRefundReason(note).setRefundTime(new Date());
|
|
tbOrder.setRefundStatus(2).setRefundReason(note).setRefundTime(new Date());
|
|
} else if (1 == SXB013Status) {//退款成功
|
|
} else if (1 == SXB013Status) {//退款成功
|
|
- tbOrder.setRefundStatus(1).setRefundReason(note).setRefundTime(new Date());
|
|
|
|
|
|
+ tbOrder.setRefundStatus(1)
|
|
|
|
+ .setRefundReason(note)
|
|
|
|
+ .setSxb010Status(0)
|
|
|
|
+ .setRefundTime(new Date());
|
|
}
|
|
}
|
|
return updateById(tbOrder);
|
|
return updateById(tbOrder);
|
|
}
|
|
}
|