覆盖时绑定订单取消使用标志
This commit is contained in:
@@ -2,9 +2,11 @@ package com.zmzm.finance.common.controller;
|
|||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.zmzm.finance.common.entity.Import;
|
import com.zmzm.finance.common.entity.Import;
|
||||||
|
import com.zmzm.finance.common.entity.Orders;
|
||||||
import com.zmzm.finance.common.entity.Payment;
|
import com.zmzm.finance.common.entity.Payment;
|
||||||
import com.zmzm.finance.common.entity.PaymentToOrder;
|
import com.zmzm.finance.common.entity.PaymentToOrder;
|
||||||
import com.zmzm.finance.common.service.IImportService;
|
import com.zmzm.finance.common.service.IImportService;
|
||||||
|
import com.zmzm.finance.common.service.IOrdersService;
|
||||||
import com.zmzm.finance.common.service.IPaymentService;
|
import com.zmzm.finance.common.service.IPaymentService;
|
||||||
import com.zmzm.finance.common.service.IPaymentToOrderService;
|
import com.zmzm.finance.common.service.IPaymentToOrderService;
|
||||||
import com.zmzm.finance.util.ExcelUtil;
|
import com.zmzm.finance.util.ExcelUtil;
|
||||||
@@ -42,6 +44,8 @@ public class ImportController {
|
|||||||
private IPaymentService paymentService;
|
private IPaymentService paymentService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private IPaymentToOrderService paymentToOrderService;
|
private IPaymentToOrderService paymentToOrderService;
|
||||||
|
@Autowired
|
||||||
|
private IOrdersService ordersService;
|
||||||
|
|
||||||
//导入文件列表
|
//导入文件列表
|
||||||
@RequestMapping("/getImportList")
|
@RequestMapping("/getImportList")
|
||||||
@@ -78,8 +82,15 @@ public class ImportController {
|
|||||||
if (!oldPaymentIds.isEmpty()) {
|
if (!oldPaymentIds.isEmpty()) {
|
||||||
List<PaymentToOrder> ptos = paymentToOrderService.list(new LambdaQueryWrapper<PaymentToOrder>()
|
List<PaymentToOrder> ptos = paymentToOrderService.list(new LambdaQueryWrapper<PaymentToOrder>()
|
||||||
.in(PaymentToOrder::getPaymentId,oldPaymentIds));
|
.in(PaymentToOrder::getPaymentId,oldPaymentIds));
|
||||||
|
List<Orders> os = new ArrayList<>();
|
||||||
|
for (PaymentToOrder pto:ptos) {
|
||||||
|
Orders o = ordersService.getById(pto.getOrderId());
|
||||||
|
o.setUseFlag(0);
|
||||||
|
os.add(o);
|
||||||
|
}
|
||||||
paymentService.removeBatchByIds(oldPaymentIds);
|
paymentService.removeBatchByIds(oldPaymentIds);
|
||||||
paymentToOrderService.removeByIds(ptos);
|
paymentToOrderService.removeByIds(ptos);
|
||||||
|
ordersService.updateBatchById(os);
|
||||||
}
|
}
|
||||||
}else {
|
}else {
|
||||||
imp = new Import();
|
imp = new Import();
|
||||||
|
|||||||
Reference in New Issue
Block a user