|
@@ -1061,13 +1061,36 @@ public class PayOrderLogic {
|
|
|
|
|
|
}
|
|
|
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
public void cancel(String orderId) {
|
|
|
if (workerOrderService.lambdaQuery().eq(WorkerOrder::getOrderId,orderId)
|
|
|
.eq(WorkerOrder::getPayStatus,"WAIT").count() < 1){
|
|
|
throw new RemoteServiceException("订单不属于未支付不可取消");
|
|
|
}
|
|
|
+ WorkerOrder workerOrder = workerOrderService.getById(orderId);
|
|
|
+
|
|
|
workerOrderService.lambdaUpdate().eq(WorkerOrder::getOrderId,orderId)
|
|
|
.set(WorkerOrder::getPayStatus,"CANCEL").update();
|
|
|
+
|
|
|
+ if (!StringUtil.isEmpty(workerOrder.getWorkerOrderId())) {
|
|
|
+ Integer count = workerOrderService.lambdaQuery()
|
|
|
+ .eq(WorkerOrder::getTotalAmount, workerOrder.getTotalAmount())
|
|
|
+ .isNotNull(WorkerOrder::getGreeOrderId)
|
|
|
+ .eq(WorkerOrder::getWorkerOrderId, workerOrder.getWorkerOrderId())
|
|
|
+ .count();
|
|
|
+ if (count > 0){
|
|
|
+ Integer countWait = workerOrderService.lambdaQuery()
|
|
|
+ .eq(WorkerOrder::getTotalAmount, workerOrder.getTotalAmount())
|
|
|
+ .eq(WorkerOrder::getPayStatus, PayStatusEnum.WAIT.getKey())
|
|
|
+ .eq(WorkerOrder::getWorkerOrderId, workerOrder.getWorkerOrderId())
|
|
|
+ .count();
|
|
|
+
|
|
|
+ if (countWait < 1)
|
|
|
+ throw new RemoteServiceException("存在4.0辅材支付单,请必须支付");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
|
|
|
public List<SysDictCompany> sysDict(String dictType, String status) {
|