From 31ff341932292a052a610fc263e8c8a204b28f94 Mon Sep 17 00:00:00 2001 From: wuwenxiong <646448316@qq.com> Date: Tue, 14 Sep 2021 16:50:30 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E9=9B=86=E5=9B=A2=E9=85=8D?= =?UTF-8?q?=E9=A2=9D=E6=97=B6=E5=A2=9E=E5=8A=A0=E6=8C=87=E5=AE=9A=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E6=AE=B5=E5=86=85=E6=98=AF=E5=90=A6=E8=BF=98=E6=9C=89?= =?UTF-8?q?=E6=9C=AA=E5=AE=8C=E6=88=90=E7=9A=84=E9=85=8D=E9=A2=9D=E5=88=A4?= =?UTF-8?q?=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../order/ordercluster/OrderclusterService.java | 14 ++++++++++++++ .../ordercluster/OrderclusterSyncService.java | 9 +++++++++ 2 files changed, 23 insertions(+) diff --git a/ssjygl-xsx-common/src/main/java/com/cowr/ssjygl/order/ordercluster/OrderclusterService.java b/ssjygl-xsx-common/src/main/java/com/cowr/ssjygl/order/ordercluster/OrderclusterService.java index 7c397bc..4a30f0d 100644 --- a/ssjygl-xsx-common/src/main/java/com/cowr/ssjygl/order/ordercluster/OrderclusterService.java +++ b/ssjygl-xsx-common/src/main/java/com/cowr/ssjygl/order/ordercluster/OrderclusterService.java @@ -356,6 +356,20 @@ public class OrderclusterService extends BaseService { return Db.find(sql, ts.toArray()); } + public List undonlist(int supermarket_id, String start_time, String cutoff_time) { + List ts = new ArrayList<>(); + ts.add(OrderStateEnum.RECEIVED.getStateid()); + ts.add(cutoff_time + " 23:59:59"); + ts.add(start_time + " 00:00:00"); + ts.add(supermarket_id); + String sql = "select * from ordercluster t \n" + + " where t.state < ? \n" + + " and t.start_time <= ? \n" + + " and t.cutoff_time >= ? \n" + + " and t.supermarket_id = ?"; + return Db.find(sql, ts.toArray()); + } + /** * 查询未完成的集团订单 * 设置已执行、剩余量 diff --git a/ssjygl-xsx-service/src/main/java/com/cowr/service/ssjygl/order/ordercluster/OrderclusterSyncService.java b/ssjygl-xsx-service/src/main/java/com/cowr/service/ssjygl/order/ordercluster/OrderclusterSyncService.java index 956c2ef..f813de9 100644 --- a/ssjygl-xsx-service/src/main/java/com/cowr/service/ssjygl/order/ordercluster/OrderclusterSyncService.java +++ b/ssjygl-xsx-service/src/main/java/com/cowr/service/ssjygl/order/ordercluster/OrderclusterSyncService.java @@ -144,6 +144,15 @@ public class OrderclusterSyncService extends BaseSyncService { return Result.failedstr("共计总配额达 %.2f元,客户余额(%.2f元)不足", plan_total_price, prepayCustomer.getSurplus()); } + // 超时在指定时间段内还有未完成的配额 + String query_start_time = DateTimeUtil.sdf.get().format(start_time); + String query_cutoff_time = DateTimeUtil.sdf.get().format(cutoff_time); + List undonlist = OrderclusterService.me.undonlist(supermarket_id, query_start_time, query_cutoff_time); + + if (undonlist != null && !undonlist.isEmpty()) { + return Result.failedstr("砂站[%s]在[%s]至[%s]内还有未完成的配额", SvrCacheData.SUP_CACHE.get(supermarket_id).getName(), query_start_time, query_cutoff_time); + } + Ordercluster model = new Ordercluster(); model.setCustomerId(customerObj.getId()); model.setCustomerAddress(customerObj.getAddress());