新增集团配额时增加指定时间段内是否还有未完成的配额判断-2
parent
31ff341932
commit
85ae9a2da2
|
|
@ -356,17 +356,19 @@ public class OrderclusterService extends BaseService {
|
|||
return Db.find(sql, ts.toArray());
|
||||
}
|
||||
|
||||
public List<Record> undonlist(int supermarket_id, String start_time, String cutoff_time) {
|
||||
public List<Record> undonlist(int supermarket_id, int customer_id, String start_time, String cutoff_time) {
|
||||
List<Object> 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);
|
||||
ts.add(customer_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 = ?";
|
||||
" and t.supermarket_id = ? \n" +
|
||||
" and t.customer_id = ? ";
|
||||
return Db.find(sql, ts.toArray());
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -147,10 +147,10 @@ public class OrderclusterSyncService extends BaseSyncService {
|
|||
// 超时在指定时间段内还有未完成的配额
|
||||
String query_start_time = DateTimeUtil.sdf.get().format(start_time);
|
||||
String query_cutoff_time = DateTimeUtil.sdf.get().format(cutoff_time);
|
||||
List<Record> undonlist = OrderclusterService.me.undonlist(supermarket_id, query_start_time, query_cutoff_time);
|
||||
List<Record> undonlist = OrderclusterService.me.undonlist(supermarket_id, customer_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);
|
||||
return Result.failedstr("客户[%s]在砂站[%s][%s]至[%s]内还有未完成的配额", customerObj.getName(), SvrCacheData.SUP_CACHE.get(supermarket_id).getName(), query_start_time, query_cutoff_time);
|
||||
}
|
||||
|
||||
Ordercluster model = new Ordercluster();
|
||||
|
|
|
|||
Loading…
Reference in New Issue