充电优化
This commit is contained in:
@@ -200,9 +200,17 @@ public class NDCAgvServiceImpl implements NDCAgvService {
|
|||||||
//分配车辆
|
//分配车辆
|
||||||
List<Dict> dictList= dictService.getDictByName("station");
|
List<Dict> dictList= dictService.getDictByName("station");
|
||||||
int satation=0;
|
int satation=0;
|
||||||
|
Dict temp=new Dict();
|
||||||
|
for(Dict dict : dictList){
|
||||||
|
if ("1".equals(dict.getValue())&&carno.equals(dict.getPara2())){
|
||||||
|
log.info("当前车辆{}已分配充电桩{},退出后续判断",carno,dict.getPara1());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
for(Dict dict : dictList){
|
for(Dict dict : dictList){
|
||||||
if ("0".equals(dict.getValue())){
|
if ("0".equals(dict.getValue())){
|
||||||
satation = Integer.parseInt(dict.getPara1());
|
satation = Integer.parseInt(dict.getPara1());
|
||||||
|
temp=dict;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -242,6 +250,11 @@ public class NDCAgvServiceImpl implements NDCAgvService {
|
|||||||
} catch (Exception e){
|
} catch (Exception e){
|
||||||
log.error("下发充电任务失败{}{}",e,e.getMessage());
|
log.error("下发充电任务失败{}{}",e,e.getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
temp.setValue("1");
|
||||||
|
temp.setPara2(String.valueOf(carno));
|
||||||
|
dictService.updateDetail(temp);
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
log.error("目前暂无可使用充电桩充电桩,暂不分配{}充电任务",carno);
|
log.error("目前暂无可使用充电桩充电桩,暂不分配{}充电任务",carno);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -328,8 +328,8 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
|||||||
//agv电量
|
//agv电量
|
||||||
electric_qty = ikey;
|
electric_qty = ikey;
|
||||||
int electric = Integer.parseInt(paramService.findByCode(AcsConfig.ELECTRIC).getValue());
|
int electric = Integer.parseInt(paramService.findByCode(AcsConfig.ELECTRIC).getValue());
|
||||||
if (electric_qty < electric && !isCharge) {
|
if (electric_qty < electric) {
|
||||||
log.info("当前车辆{}电量为{}低于40,开始充电!", this.device_code, electric_qty);
|
log.info("当前车辆{}电量为{}低于{},开始判断是否需要充电!", this.device_code, electric_qty,electric);
|
||||||
NDCAgvService.charge(this.device_code);
|
NDCAgvService.charge(this.device_code);
|
||||||
isCharge =true;
|
isCharge =true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user