固定配置添加最高运输车辆
parent
9fef03457b
commit
6baaaa0a23
|
|
@ -955,6 +955,7 @@ public abstract class BaseOrdercluster<M extends BaseOrdercluster<M>> extends Ba
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return mini_truck 最少指派的车辆数
|
* @return mini_truck 最少指派的车辆数
|
||||||
*/
|
*/
|
||||||
|
|
@ -963,5 +964,21 @@ public abstract class BaseOrdercluster<M extends BaseOrdercluster<M>> extends Ba
|
||||||
return getInt("mini_truck");
|
return getInt("mini_truck");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param maxTruck 最高指派的车辆数
|
||||||
|
*/
|
||||||
|
@JSONField(name = "max_truck")
|
||||||
|
public void setMaxTruck(Integer maxTruck) {
|
||||||
|
set("max_truck", maxTruck);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @return 最高指派车辆数
|
||||||
|
*/
|
||||||
|
@JSONField(name = "max_truck")
|
||||||
|
public Integer getMaxTruck() {
|
||||||
|
return getInt("max_truck");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -84,6 +84,7 @@ public class OrderclusterSyncService extends BaseSyncService {
|
||||||
int supermarket_id = obj.getIntValue("supermarket_id");
|
int supermarket_id = obj.getIntValue("supermarket_id");
|
||||||
int time_interval = obj.getIntValue("time_interval");
|
int time_interval = obj.getIntValue("time_interval");
|
||||||
int mini_truck = obj.getIntValue("mini_truck");
|
int mini_truck = obj.getIntValue("mini_truck");
|
||||||
|
int max_truck = obj.getIntValue("max_truck");
|
||||||
double total_weight = obj.getDouble("total_weight");
|
double total_weight = obj.getDouble("total_weight");
|
||||||
|
|
||||||
Supermarket supermarket = SvrCacheData.SUP_CACHE.get(supermarket_id);
|
Supermarket supermarket = SvrCacheData.SUP_CACHE.get(supermarket_id);
|
||||||
|
|
@ -110,6 +111,12 @@ public class OrderclusterSyncService extends BaseSyncService {
|
||||||
if (mini_truck < 1) {
|
if (mini_truck < 1) {
|
||||||
return Result.failed("最低运输车辆数错误");
|
return Result.failed("最低运输车辆数错误");
|
||||||
}
|
}
|
||||||
|
if(max_truck<1){
|
||||||
|
return Result.failed("最高运输车辆数错误");
|
||||||
|
}
|
||||||
|
if(mini_truck>max_truck){
|
||||||
|
return Result.failed("最低运输车辆不能超过最高运输车辆数错误");
|
||||||
|
}
|
||||||
|
|
||||||
if (total_weight == 0) {
|
if (total_weight == 0) {
|
||||||
log.debug("重量为 0 的砂站(id:%s)跳过", supermarket_id);
|
log.debug("重量为 0 的砂站(id:%s)跳过", supermarket_id);
|
||||||
|
|
@ -154,6 +161,7 @@ public class OrderclusterSyncService extends BaseSyncService {
|
||||||
model.setSupermarketId(supermarket_id);
|
model.setSupermarketId(supermarket_id);
|
||||||
model.setTimeInterval(time_interval);
|
model.setTimeInterval(time_interval);
|
||||||
model.setMiniTruck(mini_truck);
|
model.setMiniTruck(mini_truck);
|
||||||
|
model.setMaxTruck(max_truck);
|
||||||
|
|
||||||
model.setProductId(product.getId());
|
model.setProductId(product.getId());
|
||||||
model.setProductName(product.getName());
|
model.setProductName(product.getName());
|
||||||
|
|
@ -747,6 +755,9 @@ public class OrderclusterSyncService extends BaseSyncService {
|
||||||
if (model.getMiniTruck() != null) {
|
if (model.getMiniTruck() != null) {
|
||||||
oldobj.setMiniTruck(model.getMiniTruck());
|
oldobj.setMiniTruck(model.getMiniTruck());
|
||||||
}
|
}
|
||||||
|
if (model.getMaxTruck() != null) {
|
||||||
|
oldobj.setMaxTruck(model.getMaxTruck());
|
||||||
|
}
|
||||||
|
|
||||||
SyncTask synctask = new SyncTask();
|
SyncTask synctask = new SyncTask();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue