Merge remote-tracking branch 'origin/acs_dev' into acs_dev
This commit is contained in:
@@ -148,4 +148,16 @@ public interface AcsConfig {
|
||||
* 选择A点还是B点
|
||||
*/
|
||||
String CHOOSE = "choose";
|
||||
|
||||
String ELECTRIC ="electric";
|
||||
|
||||
String ELECTRIC2 ="electric2";
|
||||
|
||||
String ELECTRIC_BEGIN ="electric_begin";
|
||||
|
||||
String ELECTRIC_END ="electric_end";
|
||||
|
||||
String IS_ATUO_ELECTRIC ="is_atuo_electric";
|
||||
|
||||
String IS_ATUO_CAR ="is_atuo_car";
|
||||
}
|
||||
|
||||
@@ -84,4 +84,6 @@ public interface NDCAgvService {
|
||||
* @return
|
||||
*/
|
||||
public boolean createChargingTaskToNDC(String carno);
|
||||
|
||||
public void charge(String carno);
|
||||
}
|
||||
|
||||
@@ -17,10 +17,13 @@ import org.nl.acs.instruction.domain.Instruction;
|
||||
import org.nl.acs.log.service.DeviceExecuteLogService;
|
||||
import org.nl.acs.opc.DeviceAppService;
|
||||
import org.nl.acs.opc.DeviceAppServiceImpl;
|
||||
import org.nl.system.service.dict.ISysDictService;
|
||||
import org.nl.system.service.dict.dao.Dict;
|
||||
import org.nl.system.service.param.ISysParamService;
|
||||
import org.nl.common.utils.CodeUtil;
|
||||
import org.nl.config.SpringContextHolder;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
@@ -36,7 +39,7 @@ public class NDCAgvServiceImpl implements NDCAgvService {
|
||||
private final DeviceAppService deviceAppService;
|
||||
private final ISysParamService paramService;
|
||||
// private final AcsToWmsService acsToWmsService;
|
||||
|
||||
private final ISysDictService dictService;
|
||||
private final DeviceExecuteLogService logServer;
|
||||
|
||||
Map<String, AgvDto> AGVDeviceStatus = new HashMap();
|
||||
@@ -441,6 +444,69 @@ public class NDCAgvServiceImpl implements NDCAgvService {
|
||||
return new byte[0];
|
||||
}*/
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void charge(String carno) {
|
||||
//检查数据字典station为0的参数
|
||||
//分配车辆
|
||||
Dict dict = dictService.getDictByName3("station",carno,null);
|
||||
int satation=0;
|
||||
if(ObjectUtil.isNotEmpty(dict)){
|
||||
log.info("当前车辆{}已分配充电桩{},退出后续判断",carno,dict.getPara1());
|
||||
return;
|
||||
}
|
||||
Dict temp = dictService.getDictByName2("station");
|
||||
if(ObjectUtil.isNotEmpty(temp)){
|
||||
satation = Integer.parseInt(temp.getPara1());
|
||||
}
|
||||
if(satation!=0){
|
||||
String instcode =CodeUtil.getNewCode("INSTRUCT_NO");
|
||||
byte ikeyhigh = (byte) IntToHexHigh(Integer.parseInt(instcode));
|
||||
byte ikeylow = (byte) IntToHexLow(Integer.parseInt(instcode));
|
||||
byte carhigh = (byte) IntToHexHigh(Integer.parseInt(carno));
|
||||
byte carlow = (byte) IntToHexLow(Integer.parseInt(carno));
|
||||
byte satationhigh = (byte) IntToHexHigh(satation);
|
||||
byte satationlow = (byte) IntToHexLow(satation);
|
||||
String str = "十进制下发:";
|
||||
String str1 = "十六进制下发:";
|
||||
str += "ikey:" + (Integer.parseInt(instcode));
|
||||
str1 += "ikey:" + hexToString(ikeyhigh & 0xFF) + hexToString(ikeylow & 0xFF);
|
||||
str += "carno:" + (Integer.parseInt(carno));
|
||||
str1 += "carno:" + hexToString(carhigh & 0xFF) + hexToString(carlow & 0xFF);
|
||||
str += "/satation:" + (satation);
|
||||
str1 += "/satation:" + hexToString(satationhigh & 0xFF) + hexToString(satationlow & 0xFF);
|
||||
|
||||
byte[] b = new byte[]{(byte) 0X87, (byte) 0XCD,
|
||||
(byte) 0X00, (byte) 0X08,
|
||||
(byte) 0X00, (byte) 0X0E,
|
||||
(byte) 0X00, (byte) 0X01,
|
||||
(byte) 0X00, (byte) 0X71,
|
||||
(byte) 0X00, (byte) 0X0A,
|
||||
(byte) 0X64, (byte) 0X80,
|
||||
(byte) 0X00, (byte) 0X01,
|
||||
(byte) ikeyhigh, (byte) ikeylow,
|
||||
(byte) carhigh, (byte) carlow,
|
||||
(byte) satationhigh, (byte) satationlow
|
||||
|
||||
};
|
||||
log.info("下发AGV充电任务--{}", str1);
|
||||
|
||||
try{
|
||||
OneNDCSocketConnectionAutoRun.write(b);
|
||||
} catch (Exception e){
|
||||
log.error("下发充电任务失败{}{}",e,e.getMessage());
|
||||
}
|
||||
|
||||
temp.setValue("1");
|
||||
temp.setPara2(carno);
|
||||
temp.setPara3("下发充电");
|
||||
dictService.updateDetail(temp);
|
||||
|
||||
}else{
|
||||
log.error("目前暂无可使用充电桩充电桩,暂不分配{}充电任务",carno);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean createChargingTaskToNDC(String carno) {
|
||||
byte carhigh = (byte) IntToHexHigh(Integer.parseInt(carno));
|
||||
|
||||
@@ -21,6 +21,8 @@ import org.nl.acs.opc.DeviceAppService;
|
||||
import org.nl.config.SpringContextHolder;
|
||||
import org.nl.config.lucene.service.LuceneExecuteLogService;
|
||||
import org.nl.config.lucene.service.dto.LuceneLogDto;
|
||||
import org.nl.system.service.dict.ISysDictService;
|
||||
import org.nl.system.service.dict.dao.Dict;
|
||||
import org.nl.system.service.param.ISysParamService;
|
||||
import org.nl.system.service.param.impl.SysParamServiceImpl;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -68,7 +70,8 @@ public class TwoNDCSocketConnectionAutoRun extends AbstractAutoRunnable {
|
||||
AutoRunService autoRunService;
|
||||
@Autowired
|
||||
LuceneExecuteLogService luceneExecuteLogService;
|
||||
|
||||
@Autowired
|
||||
ISysDictService dictService;
|
||||
|
||||
public TwoNDCSocketConnectionAutoRun() {
|
||||
this.recordTime = new Date((new Date()).getTime() - (long) this.recordTimeOut);
|
||||
@@ -163,6 +166,8 @@ public class TwoNDCSocketConnectionAutoRun extends AbstractAutoRunnable {
|
||||
int agvaddr = arr[18] * 256 + arr[19];
|
||||
//车号
|
||||
int carno = arr[20];
|
||||
//充电桩站点号
|
||||
int station = arr[25];
|
||||
Instruction inst = null;
|
||||
if (ikey != 0) {
|
||||
inst = instructionService.findByCodeFromCache(String.valueOf(ikey));
|
||||
@@ -330,7 +335,30 @@ public class TwoNDCSocketConnectionAutoRun extends AbstractAutoRunnable {
|
||||
} else {
|
||||
log.info(device_code + "对应设备号为空!");
|
||||
}
|
||||
} else {
|
||||
} else if (phase == 0x64){
|
||||
log.info("AGV车号{}反馈充电任务下发成功,锁定充电桩{}",agvaddr,station);
|
||||
Dict dict = dictService.getDictByName3("station",String.valueOf(agvaddr),null);
|
||||
if (ObjectUtil.isNotEmpty(dict)){
|
||||
dict.setValue("1");
|
||||
dict.setPara2(String.valueOf(agvaddr));
|
||||
dict.setPara3("下发成功");
|
||||
dictService.updateDetail(dict);
|
||||
}
|
||||
//充电成功
|
||||
}else if (phase == 0x65){
|
||||
log.info("AGV车号{}反馈充电中,充电桩{}",agvaddr,station);
|
||||
//充电取消上报
|
||||
}else if (phase == 0x66){
|
||||
log.info("AGV车号{}反馈充电任务已取消,释放充电桩{}",agvaddr,station);
|
||||
Dict dict = dictService.getDictByName3("station",String.valueOf(agvaddr),null);
|
||||
if (ObjectUtil.isNotEmpty(dict)){
|
||||
dict.setValue("0");
|
||||
dict.setPara2("");
|
||||
dict.setPara3("充电桩空闲");
|
||||
dictService.updateDetail(dict);
|
||||
}
|
||||
}
|
||||
else {
|
||||
//上报异常信息
|
||||
//(不需要WCS反馈)
|
||||
if (phase == 0x67 || phase == 0x70 || phase == 0x71 || phase == 0x72 || phase == 0x73 || phase == 0x74) {
|
||||
|
||||
@@ -7,6 +7,7 @@ import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.Data;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.acs.AcsConfig;
|
||||
import org.nl.acs.agv.server.NDCAgvService;
|
||||
import org.nl.acs.auto.run.TwoNDCSocketConnectionAutoRun;
|
||||
import org.nl.acs.common.base.CommonFinalParam;
|
||||
@@ -42,9 +43,12 @@ import org.nl.acs.task.service.impl.TaskServiceImpl;
|
||||
import org.nl.config.lucene.service.LuceneExecuteLogService;
|
||||
import org.nl.config.lucene.service.dto.LuceneLogDto;
|
||||
import org.nl.config.thread.ThreadPoolExecutorUtil;
|
||||
import org.nl.system.service.dict.ISysDictService;
|
||||
import org.nl.system.service.dict.dao.Dict;
|
||||
import org.nl.system.service.param.ISysParamService;
|
||||
import org.nl.config.SpringContextHolder;
|
||||
|
||||
import java.time.LocalTime;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
@@ -70,6 +74,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
DeviceService deviceService = SpringContextHolder.getBean(DeviceService.class);
|
||||
LuceneExecuteLogService luceneExecuteLogService = SpringContextHolder.getBean(LuceneExecuteLogService.class);
|
||||
TwoAgvPhase twoAgvPhase = new TwoAgvPhase();
|
||||
ISysDictService dictService = SpringContextHolder.getBean(ISysDictService.class);
|
||||
|
||||
String error_code = "0";
|
||||
int agvaddr = 0;
|
||||
@@ -93,6 +98,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
String error_type = "agv_error_type";
|
||||
Boolean isonline = true;
|
||||
Boolean iserror = false;
|
||||
boolean isCharge = false;
|
||||
|
||||
private synchronized void setErrorInfo(int error, String error_code, String error_message) {
|
||||
this.error = error;
|
||||
@@ -2206,6 +2212,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
logDto.setLog_level(4);
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
} else if (phase == 0x73) {
|
||||
log.info("接收agv上报信息,phase == 0x73:" + phase);
|
||||
//agv电量
|
||||
electric_qty = ikey;
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
@@ -2214,6 +2221,53 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
.build();
|
||||
logDto.setLog_level(4);
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
//自动充电的车号
|
||||
String is_atuo_car = ISysParamService.findByCode(AcsConfig.IS_ATUO_CAR).getValue();
|
||||
//当前上报的车号
|
||||
String now_car = String.valueOf(this.agvaddr);
|
||||
//如果配置的车号是诺宝车号
|
||||
if(now_car.equals(is_atuo_car)){
|
||||
//是否开启自动充电
|
||||
String is_atuo_electric = ISysParamService.findByCode(AcsConfig.IS_ATUO_ELECTRIC).getValue();
|
||||
log.info("接收agv上报信息,is_atuo_electric:" + is_atuo_electric);
|
||||
if("1".equals(is_atuo_electric)){
|
||||
String electric_begin = ISysParamService.findByCode(AcsConfig.ELECTRIC_BEGIN).getValue();
|
||||
String[] begins = electric_begin.split(":");
|
||||
String electric_end = ISysParamService.findByCode(AcsConfig.ELECTRIC_END).getValue();
|
||||
String[] ends = electric_end.split(":");
|
||||
// 定义时间段
|
||||
LocalTime startTime = LocalTime.of(Integer.parseInt(begins[0]), Integer.parseInt(begins[1])); // 上午8点
|
||||
LocalTime endTime = LocalTime.of(Integer.parseInt(ends[0]), Integer.parseInt(ends[1])); // 晚上22点
|
||||
// 获取当前时间
|
||||
LocalTime now = LocalTime.now();
|
||||
// 判断当前时间是否在时间段内
|
||||
boolean isInRange = !now.isBefore(startTime) && !now.isAfter(endTime);
|
||||
int electric = 0 ;
|
||||
//早上8-22点
|
||||
if(isInRange){
|
||||
electric = Integer.parseInt(ISysParamService.findByCode(AcsConfig.ELECTRIC).getValue());
|
||||
}else{
|
||||
electric = Integer.parseInt(ISysParamService.findByCode(AcsConfig.ELECTRIC2).getValue());
|
||||
}
|
||||
if (electric_qty>0 && electric_qty < electric) {
|
||||
log.info("当前车辆{}电量为{}低于{},开始判断是否需要充电!", this.agvaddr, electric_qty,electric);
|
||||
//判断是否已下发充电任务
|
||||
Dict dict1 = dictService.getDictByName3("station",String.valueOf(this.agvaddr),null);
|
||||
if(ObjectUtil.isNotEmpty(dict1)){
|
||||
log.info("当前车辆{}已分配充电桩{},退出后续判断",this.agvaddr,dict1.getPara1());
|
||||
}else{
|
||||
//未下发,判断是否有空闲充电桩
|
||||
Dict dict = dictService.getDictByName2("station");
|
||||
if(ObjectUtil.isNotEmpty(dict)){
|
||||
ndcAgvService.charge(String.valueOf(this.agvaddr));
|
||||
isCharge =true;
|
||||
}else{
|
||||
log.info("当前车辆{}电量为{}低于{},但无空闲充电桩!", this.agvaddr, electric_qty,electric);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (phase == 0x74) {
|
||||
//三色灯状态
|
||||
status = ikey;
|
||||
|
||||
@@ -120,6 +120,17 @@ public class SysDictController {
|
||||
dictService.deleteDetail(id);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
@PostMapping("/initDict")
|
||||
@Log("初始化充电桩点位信息")
|
||||
public ResponseEntity<Object> initDict(@Validated @RequestBody Dict dto){
|
||||
dictService.initDict(dto);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@GetMapping("/showDetail2")
|
||||
@Log("查询字典明细")
|
||||
public ResponseEntity<Object> showDetail2(@RequestParam String name){
|
||||
return new ResponseEntity<>(dictService.getDictByName(name), HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -75,7 +75,18 @@ class SysParamController {
|
||||
public ResponseEntity<Object> getValueByCode(@PathVariable String code) {
|
||||
return new ResponseEntity<>(paramService.findByCode(code), HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@GetMapping("/queryParam")
|
||||
@Log("查询自动充电配置")
|
||||
public ResponseEntity<Object> queryParam(){
|
||||
return new ResponseEntity<>(paramService.queryParam(), HttpStatus.OK);
|
||||
}
|
||||
@PostMapping("/setParam")
|
||||
@Log("保存参数")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> setParam(@RequestBody Map whereJson) {
|
||||
paramService.setParam(whereJson);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -85,4 +85,22 @@ public interface ISysDictService extends IService<Dict> {
|
||||
* @return
|
||||
*/
|
||||
List<Dict> queryAll();
|
||||
/**
|
||||
* 初始化充电桩点位信息
|
||||
* @param dto
|
||||
*/
|
||||
void initDict(Dict dto);
|
||||
/**
|
||||
* 获取字典明细
|
||||
* @param name
|
||||
* @return
|
||||
*/
|
||||
Dict getDictByName2(String name);
|
||||
|
||||
/**
|
||||
* 获取字典明细
|
||||
* @param name
|
||||
* @return
|
||||
*/
|
||||
Dict getDictByName3(String name,String carno,String station);
|
||||
}
|
||||
|
||||
@@ -205,4 +205,55 @@ public class SysDictServiceImpl extends ServiceImpl<SysDictMapper, Dict> impleme
|
||||
.groupBy(Dict::getCode, Dict::getName));
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void initDict(Dict dto) {
|
||||
Dict dict = sysDictMapper.selectById(dto.getDict_id());
|
||||
if (ObjectUtil.isEmpty(dict)) {
|
||||
throw new BadRequestException("字典不存在");
|
||||
}
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String currentNickName = SecurityUtils.getCurrentNickName();
|
||||
dict.setValue("0");
|
||||
dict.setPara2("");
|
||||
dict.setPara3("充电桩空闲");
|
||||
dict.setUpdate_id(currentUserId);
|
||||
dict.setUpdate_name(currentNickName);
|
||||
dict.setUpdate_time(DateUtil.now());
|
||||
sysDictMapper.updateById(dict);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Dict getDictByName2(String name) {
|
||||
Dict dict = null;
|
||||
List<Dict> dictList = sysDictMapper.selectList(
|
||||
new LambdaQueryWrapper<Dict>()
|
||||
.eq(Dict::getCode, name)
|
||||
.eq(Dict::getValue, "0")
|
||||
.and(slam -> slam.isNull(Dict::getPara2)
|
||||
.or()
|
||||
.eq(Dict::getPara2, ""))
|
||||
);
|
||||
if (ObjectUtil.isNotEmpty(dictList) && dictList.size()>0){
|
||||
dict = dictList.get(0);
|
||||
}
|
||||
return dict;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Dict getDictByName3(String name,String carno,String station) {
|
||||
Dict dict = null;
|
||||
List<Dict> dictList = sysDictMapper.selectList(
|
||||
new LambdaQueryWrapper<Dict>()
|
||||
.eq(Dict::getCode, name)
|
||||
.eq(ObjectUtil.isNotEmpty(carno),Dict::getPara2, carno)
|
||||
.eq(ObjectUtil.isNotEmpty(station),Dict::getPara1, station)
|
||||
.eq(Dict::getValue,"1")
|
||||
);
|
||||
if (ObjectUtil.isNotEmpty(dictList) && dictList.size()>0){
|
||||
dict = dictList.get(0);
|
||||
}
|
||||
return dict;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -57,4 +57,8 @@ public interface ISysParamService extends IService<Param> {
|
||||
* @return Param
|
||||
*/
|
||||
Param findByCode(String code);
|
||||
|
||||
Map<String, Object> queryParam();
|
||||
|
||||
void setParam(Map whereJson);
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.acs.AcsConfig;
|
||||
import org.nl.acs.task.domain.Task;
|
||||
import org.nl.acs.utils.PageUtil;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
@@ -24,6 +25,7 @@ import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -102,4 +104,70 @@ public class SysParamServiceImpl extends ServiceImpl<SysParamMapper, Param> impl
|
||||
Param param = paramMapper.selectOne(queryWrapper);
|
||||
return param;
|
||||
}
|
||||
|
||||
public Map<String, Object> queryParam(){
|
||||
HashMap<String, Object> map = new HashMap<String, Object>();
|
||||
//白班充电阈值
|
||||
Param electric = this.findByCode(AcsConfig.ELECTRIC);
|
||||
if (ObjectUtil.isEmpty(electric)) throw new BadRequestException("白班充电阈值参数异常");
|
||||
//晚班充电阈值
|
||||
Param electric2 = this.findByCode(AcsConfig.ELECTRIC2);
|
||||
if (ObjectUtil.isEmpty(electric2)) throw new BadRequestException("晚班充电阈值参数异常");
|
||||
//白班开始时间
|
||||
Param electric_begin = this.findByCode(AcsConfig.ELECTRIC_BEGIN);
|
||||
if (ObjectUtil.isEmpty(electric_begin)) throw new BadRequestException("白班开始时间参数异常");
|
||||
//白班结束时间
|
||||
Param electric_end = this.findByCode(AcsConfig.ELECTRIC_END);
|
||||
if (ObjectUtil.isEmpty(electric_end)) throw new BadRequestException("白班结束时间参数异常");
|
||||
|
||||
map.put("electric",electric.getValue());
|
||||
map.put("electric2",electric2.getValue());
|
||||
map.put("electric_begin",electric_begin.getValue());
|
||||
map.put("electric_end",electric_end.getValue());
|
||||
return map;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void setParam(Map whereJson){
|
||||
Integer electric = (Integer) whereJson.get("electric");
|
||||
Integer electric2 = (Integer) whereJson.get("electric2");
|
||||
String electric_begin = (String) whereJson.get("electric_begin");
|
||||
String electric_end = (String) whereJson.get("electric_end");
|
||||
|
||||
String now_time = DateUtil.now();
|
||||
//白班充电阈值
|
||||
Param param_electric = this.findByCode(AcsConfig.ELECTRIC);
|
||||
if (ObjectUtil.isEmpty(param_electric)) throw new BadRequestException("白班充电阈值参数异常");
|
||||
param_electric.setValue(electric.toString());
|
||||
param_electric.setUpdate_id(SecurityUtils.getCurrentUserId());
|
||||
param_electric.setUpdate_name(SecurityUtils.getCurrentNickName());
|
||||
param_electric.setUpdate_time(now_time);
|
||||
paramMapper.updateById(param_electric);
|
||||
//晚班充电阈值
|
||||
Param param_electric2 = this.findByCode(AcsConfig.ELECTRIC2);
|
||||
if (ObjectUtil.isEmpty(param_electric2)) throw new BadRequestException("晚班充电阈值参数异常");
|
||||
param_electric2.setValue(electric2.toString());
|
||||
param_electric2.setUpdate_id(SecurityUtils.getCurrentUserId());
|
||||
param_electric2.setUpdate_name(SecurityUtils.getCurrentNickName());
|
||||
param_electric2.setUpdate_time(now_time);
|
||||
paramMapper.updateById(param_electric2);
|
||||
//白班开始时间
|
||||
Param param_electric_begin = this.findByCode(AcsConfig.ELECTRIC_BEGIN);
|
||||
if (ObjectUtil.isEmpty(param_electric_begin)) throw new BadRequestException("白班开始时间参数异常");
|
||||
param_electric_begin.setValue(electric_begin);
|
||||
param_electric_begin.setUpdate_id(SecurityUtils.getCurrentUserId());
|
||||
param_electric_begin.setUpdate_name(SecurityUtils.getCurrentNickName());
|
||||
param_electric_begin.setUpdate_time(now_time);
|
||||
paramMapper.updateById(param_electric_begin);
|
||||
//白班结束时间
|
||||
Param param_electric_end = this.findByCode(AcsConfig.ELECTRIC_END);
|
||||
if (ObjectUtil.isEmpty(param_electric_end)) throw new BadRequestException("白班开始时间参数异常");
|
||||
param_electric_end.setValue(electric_end);
|
||||
param_electric_end.setUpdate_id(SecurityUtils.getCurrentUserId());
|
||||
param_electric_end.setUpdate_name(SecurityUtils.getCurrentNickName());
|
||||
param_electric_end.setUpdate_time(now_time);
|
||||
paramMapper.updateById(param_electric_end);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user