|
@@ -2,6 +2,8 @@ package com.pj.tb_orders;
|
|
|
|
|
|
import cn.dev33.satoken.stp.StpUtil;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
+import cn.hutool.json.JSONUtil;
|
|
|
+import cn.hutool.log.StaticLog;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.service.IService;
|
|
@@ -173,6 +175,8 @@ public class TbOrdersService extends ServiceImpl<TbOrdersMapper, TbOrders> imple
|
|
|
}
|
|
|
orderTwo.setPurchaserId(purchaser.getId());
|
|
|
orderTwo.setPurchaserName(purchaser.getName());
|
|
|
+ orderTwo.setIsPay(3);//支付中
|
|
|
+ orderTwo.setPayTime(new Date());//支付时间
|
|
|
boolean b = updateById(orderTwo);
|
|
|
if (!b) throw new RuntimeException("购买异常,请重新登录或联系管理员!");
|
|
|
|
|
@@ -215,19 +219,21 @@ public class TbOrdersService extends ServiceImpl<TbOrdersMapper, TbOrders> imple
|
|
|
OrderDto orderOne = levelOneServerInterface.getOrderDtoById(orderTwo.getLevelOneOrderId());
|
|
|
if (null == orderOne) new RuntimeException("收到采购商支付扣款回执:一级市场订单不存在");
|
|
|
|
|
|
- if (2 == MKT008Status) {//扣款失败
|
|
|
+ if (2 == MKT008Status) {//支付失败
|
|
|
//todo 订单状态更新
|
|
|
- orderTwo.setIsPay(2);//支付失败
|
|
|
+ orderTwo.setIsPay(2);
|
|
|
orderTwo.setPayTime(new Date());
|
|
|
- } else if (1 == MKT008Status) {//扣款成功
|
|
|
+ } else if (1 == MKT008Status) {//支付成功
|
|
|
//todo 1、订单状态更新
|
|
|
- orderTwo.setIsPay(1);//支付成功
|
|
|
+ orderTwo.setIsPay(1);
|
|
|
orderTwo.setPayTime(new Date());
|
|
|
|
|
|
+ orderTwo.setPayTax(3);//缴费中
|
|
|
+ orderTwo.setPayTaxTime(new Date());//缴费时间
|
|
|
//todo 2、同步订单信息,发送航通
|
|
|
- OrdersDto ordersDto = new OrdersDto();
|
|
|
+ /*OrdersDto ordersDto = new OrdersDto();
|
|
|
BeanUtils.copyProperties(orderTwo, ordersDto);
|
|
|
- asyncServerInterface.sendLevelTwoOrdersDto(ordersDto, DataType.DATA_TYPE_FOUR.getCode());
|
|
|
+ asyncServerInterface.sendLevelTwoOrdersDto(ordersDto, DataType.DATA_TYPE_FOUR.getCode());*/
|
|
|
|
|
|
//todo 3、系统将服务费自动分账,将分账信息自动发送至银行进行划扣
|
|
|
List<TbItemRules> ruleList = new ArrayList<>();
|
|
@@ -640,4 +646,25 @@ public class TbOrdersService extends ServiceImpl<TbOrdersMapper, TbOrders> imple
|
|
|
public List<OrderStaticsDTO> getPurchaserStatistics(SoMap so) {
|
|
|
return tbOrdersMapper.getPurchaserStatistics(so);
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 采购商补扣款
|
|
|
+ */
|
|
|
+ public boolean deduction(Long id) {
|
|
|
+ TbOrders tbOrders = getById(id);
|
|
|
+ if (tbOrders == null) {
|
|
|
+ log.error("采购商补扣款失败:{}不存在", id);
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ OrderDto orderOne = levelOneServerInterface.getOrderDtoById(tbOrders.getLevelOneOrderId());
|
|
|
+ PaymentTwoDto paymentTwoDto = this.getPaymentData(tbOrders, orderOne);
|
|
|
+ StaticLog.info("\n---采购商补扣款---sendMKT006_NoCommission——PaymentTwoDto——:{}", JSONUtil.toJsonStr(paymentTwoDto));
|
|
|
+ paymentServerInterface.sendMKT006_NoCommission(paymentTwoDto);
|
|
|
+
|
|
|
+ tbOrders.setDeductionCount(tbOrders.getDeductionCount() + 1);
|
|
|
+ tbOrders.setDeductionTime(new Date());
|
|
|
+
|
|
|
+ return super.updateById(tbOrders);
|
|
|
+ }
|
|
|
}
|