add:增加充电桩管理
This commit is contained in:
@@ -360,7 +360,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
//判断是否已下发充电任务
|
||||
Dict dict1 = dictService.getDictByName3("station",String.valueOf(this.agvaddr),null);
|
||||
if(ObjectUtil.isNotEmpty(dict1)){
|
||||
log.info("当前车辆{}已分配充电桩{},退出后续判断",carno,dict1.getPara1());
|
||||
log.info("当前车辆{}已分配充电桩{},退出后续判断",this.agvaddr,dict1.getPara1());
|
||||
}else{
|
||||
//未下发,判断是否有空闲充电桩
|
||||
Dict dict = dictService.getDictByName2("station");
|
||||
|
||||
@@ -67,6 +67,14 @@ public class SysDictController {
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@PostMapping("/initDict")
|
||||
@Log("初始化字典")
|
||||
@ApiOperation("初始化字典")
|
||||
public ResponseEntity<Object> initDict(@Validated @RequestBody Dict dto){
|
||||
dictService.initDict(dto);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@Log("删除字典")
|
||||
@ApiOperation("删除字典")
|
||||
@DeleteMapping
|
||||
@@ -94,6 +102,13 @@ public class SysDictController {
|
||||
return new ResponseEntity<>(dictMap, HttpStatus.OK);
|
||||
}
|
||||
|
||||
@GetMapping("/showDetail2")
|
||||
@Log("查询字典明细")
|
||||
@ApiOperation("查询字典明细")
|
||||
public ResponseEntity<Object> showDetail2(@RequestParam String name){
|
||||
return new ResponseEntity<>(dictService.getDictByName(name), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Log("新增字典详情")
|
||||
@ApiOperation("新增字典详情")
|
||||
@PostMapping("/dictDetail")
|
||||
|
||||
@@ -41,6 +41,9 @@ public interface ISysDictService extends IService<Dict> {
|
||||
*/
|
||||
void updateDict(Dict dto);
|
||||
|
||||
void initDict(Dict dto);
|
||||
|
||||
|
||||
/**
|
||||
* 通过id批量删除字典
|
||||
* @param ids
|
||||
|
||||
@@ -94,6 +94,24 @@ public class SysDictServiceImpl extends ServiceImpl<SysDictMapper, Dict> impleme
|
||||
});
|
||||
}
|
||||
|
||||
@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
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void deleteBatchByIds(Set<String> ids) {
|
||||
|
||||
Reference in New Issue
Block a user