add:增加CNC区域业务;
This commit is contained in:
@@ -76,4 +76,13 @@ public interface NDCAgvService {
|
||||
* @return
|
||||
*/
|
||||
public boolean createChargingTaskToNDC(String carno);
|
||||
|
||||
|
||||
/**
|
||||
* 自动充电下发充电任务
|
||||
*
|
||||
* @param carno
|
||||
* @return
|
||||
*/
|
||||
public void charge(String carno);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.nl.acs.agv.server.impl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -19,11 +20,15 @@ import org.nl.acs.opc.DeviceAppService;
|
||||
import org.nl.acs.opc.DeviceAppServiceImpl;
|
||||
import org.nl.common.utils.CodeUtil;
|
||||
import org.nl.config.SpringContextHolder;
|
||||
import org.nl.system.service.dict.ISysDictService;
|
||||
import org.nl.system.service.dict.dao.Dict;
|
||||
import org.nl.system.service.param.ISysParamService;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
@@ -38,7 +43,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();
|
||||
@@ -179,12 +184,12 @@ public class NDCAgvServiceImpl implements NDCAgvService {
|
||||
(byte) typehigh, (byte) typelow,
|
||||
(byte) qhdhigh, (byte) qhdlow,
|
||||
(byte) fhdhigh, (byte) fhdlow,
|
||||
(byte) car_width1,(byte) car_width2,
|
||||
};}
|
||||
|
||||
log.info("下发AGV作业指令--{}", str1);
|
||||
(byte) car_width1, (byte) car_width2,
|
||||
};
|
||||
}
|
||||
log.info("准备下发AGV作业指令号:{},十进制:{},十六进制{}", instcode, str, str1);
|
||||
OneNDCSocketConnectionAutoRun.write(b);
|
||||
System.out.println("下发agv指令数据:" + Bytes2HexString(b));
|
||||
log.info("下发AGV作业指令号:{},下发成功:报文:{}", instcode, Bytes2HexString(b));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -350,18 +355,86 @@ public class NDCAgvServiceImpl implements NDCAgvService {
|
||||
(byte) instcodehigh, (byte) instcodelow,
|
||||
(byte) carhigh, (byte) carlow
|
||||
};
|
||||
log.info("下发AGV充电任务--{}", str1);
|
||||
|
||||
log.info("当前车辆{},开始下发AGV充电任务--十六进制:{},{},十进制:{}", carno, str1, Bytes2HexString(b), str);
|
||||
try {
|
||||
OneNDCSocketConnectionAutoRun.write(b);
|
||||
} catch (Exception e) {
|
||||
e.getMessage();
|
||||
log.info("当前车辆{},开始下发AGV充电任务失败--十六进制:{},{},十进制:{},异常信息:{}", carno, str1, Bytes2HexString(b), str, e.getMessage());
|
||||
return false;
|
||||
}
|
||||
System.out.println("下发agv充电任务数据:" + Bytes2HexString(b));
|
||||
log.info("当前车辆{},下发AGV充电任务成功--十六进制:{},{},十进制:{}", carno, str1, Bytes2HexString(b), str);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void charge(String carno) {
|
||||
//检查数据字典station为0的参数
|
||||
//分配车辆
|
||||
Dict dict = dictService.getDictByName3("station", carno, null);
|
||||
int satation = 0;
|
||||
if (dict != null) {
|
||||
log.info("当前车辆{}已分配充电桩{},退出后续判断", carno, dict.getPara1());
|
||||
return;
|
||||
}
|
||||
Dict temp = null;
|
||||
List<Dict> tempList = dictService.getDictByName2("station");
|
||||
if ("7".equals(carno) || "8".equals(carno)) {
|
||||
tempList.removeIf(r -> !"四号站点(RT)".equals(r.getLabel()));
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(tempList)) {
|
||||
temp = tempList.get(0);
|
||||
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充电任务--十六进制:{},{},十进制:{}", carno, str1, Bytes2HexString(b), str);
|
||||
try {
|
||||
OneNDCSocketConnectionAutoRun.write(b);
|
||||
} catch (Exception e) {
|
||||
log.info("当前车辆{},开始下发AGV充电任务失败--十六进制:{},{},十进制:{},异常信息:{}", carno, str1, Bytes2HexString(b), str, e.getMessage());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(temp)) {
|
||||
temp.setValue("1");
|
||||
temp.setPara2(carno);
|
||||
temp.setPara3("下发充电");
|
||||
dictService.updateDetail(temp);
|
||||
}
|
||||
log.info("当前车辆{},下发AGV充电任务成功--十六进制:{},{},十进制:{}", carno, str1, Bytes2HexString(b), str);
|
||||
} else {
|
||||
log.error("目前暂无可使用充电桩充电桩,暂不分配{}充电任务", carno);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
String hexToString(int i) {
|
||||
return (i < 16 ? "0" + Integer.toHexString(i) : Integer.toHexString(i)).toUpperCase();
|
||||
}
|
||||
|
||||
@@ -20,6 +20,8 @@ import org.nl.acs.instruction.service.impl.InstructionServiceImpl;
|
||||
import org.nl.acs.log.service.DeviceExecuteLogService;
|
||||
import org.nl.acs.opc.DeviceAppService;
|
||||
import org.nl.config.SpringContextHolder;
|
||||
import org.nl.system.service.dict.ISysDictService;
|
||||
import org.nl.system.service.dict.dao.Dict;
|
||||
import org.nl.system.service.lucene.LuceneExecuteLogService;
|
||||
import org.nl.system.service.param.ISysParamService;
|
||||
import org.nl.system.service.param.impl.SysParamServiceImpl;
|
||||
@@ -65,7 +67,8 @@ public class OneNDCSocketConnectionAutoRun extends AbstractAutoRunnable {
|
||||
AutoRunService autoRunService;
|
||||
@Autowired
|
||||
LuceneExecuteLogService luceneExecuteLogService;
|
||||
|
||||
@Autowired
|
||||
ISysDictService dictService;
|
||||
|
||||
public OneNDCSocketConnectionAutoRun() {
|
||||
this.recordTime = new Date((new Date()).getTime() - (long) this.recordTimeOut);
|
||||
@@ -134,8 +137,11 @@ public class OneNDCSocketConnectionAutoRun extends AbstractAutoRunnable {
|
||||
int ikey = arr[26] * 256 + arr[27];
|
||||
//站点号
|
||||
int agvaddr = arr[18] * 256 + arr[19];
|
||||
|
||||
//车号
|
||||
int carno = arr[20];
|
||||
//充电桩站点号
|
||||
int station = arr[25];
|
||||
Instruction link_inst = null;
|
||||
Instruction inst = null;
|
||||
List<Instruction> insts = null;
|
||||
@@ -288,11 +294,40 @@ public class OneNDCSocketConnectionAutoRun extends AbstractAutoRunnable {
|
||||
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
|
||||
}
|
||||
}
|
||||
}else {
|
||||
}else if (phase == 0x64){
|
||||
//100
|
||||
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){
|
||||
//101
|
||||
log.info("AGV车号{}反馈充电中,充电桩{}",agvaddr,station);
|
||||
//充电取消上报
|
||||
}else if (phase == 0x66){
|
||||
//102
|
||||
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反馈)
|
||||
//67->103,73->115
|
||||
if (phase == 0x67) {
|
||||
device = deviceAppService.findDeviceByCode(Integer.toString(agvaddr));
|
||||
} else if (phase == 0x73) {
|
||||
device = deviceAppService.findDeviceByCode(Integer.toString(agvaddr));
|
||||
} else {
|
||||
device = deviceAppService.findDeviceByCode(Integer.toString(arr[20]));
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.Data;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.nl.acs.AcsConfig;
|
||||
import org.nl.acs.agv.server.NDCAgvService;
|
||||
@@ -34,12 +35,14 @@ import org.nl.acs.task.service.impl.TaskServiceImpl;
|
||||
import org.nl.common.exception.BadRequestException;
|
||||
import org.nl.config.SpringContextHolder;
|
||||
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.lucene.LuceneExecuteLogService;
|
||||
import org.nl.system.service.param.ISysParamService;
|
||||
import org.nl.system.service.param.impl.SysParamServiceImpl;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
|
||||
import java.time.LocalTime;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
@@ -61,6 +64,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
DeviceExecuteLogService logServer = SpringContextHolder.getBean(DeviceExecuteLogService.class);
|
||||
DeviceAppService deviceAppService = SpringContextHolder.getBean(DeviceAppService.class);
|
||||
DeviceService deviceService = SpringContextHolder.getBean(DeviceService.class);
|
||||
ISysDictService dictService = SpringContextHolder.getBean(ISysDictService.class);
|
||||
@Autowired
|
||||
LuceneExecuteLogService luceneExecuteLogService = SpringContextHolder.getBean("luceneExecuteLogServiceImpl");
|
||||
@Autowired
|
||||
@@ -142,7 +146,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
Map<String, String> error = ErrorUtil.getAgvErrorMsg(ikey);
|
||||
String code = error.get("code");
|
||||
String info = error.get("info");
|
||||
log.error("车辆" + agvaddr + "故障:故障码:" + error + ",ikey为:" + ikey + ",已解析报警信息:code:" + code + ",info" + info);
|
||||
//log.error("车辆" + agvaddr + "故障:故障码:" + error + ",ikey为:" + ikey + ",已解析报警信息:code:" + code + ",info" + info);
|
||||
//通过ikey
|
||||
if (StringUtils.isNotBlank(info)) {
|
||||
sendFeiShuAlert(info);
|
||||
@@ -218,7 +222,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
data = ndcAgvService.sendAgvOneModeInst(phase, index, 0);
|
||||
flag = true;
|
||||
} else if (phase == 0x09) {
|
||||
log.info("agv进入" + this.device_code + "放货完成" + task.getTo_x());
|
||||
//log.info("agv进入" + this.device_code + "放货完成" + task.getTo_x());
|
||||
data = ndcAgvService.sendAgvOneModeInst(phase, index, 0);
|
||||
flag = true;
|
||||
}
|
||||
@@ -246,15 +250,54 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
//车辆角度
|
||||
angle = ikey;
|
||||
} else if (phase == 0x73) {
|
||||
log.info("接收agv上报信息,phase == 0x73:" + phase);
|
||||
//agv电量
|
||||
electric_qty = ikey;
|
||||
// 电量不足充电
|
||||
// int electric = Integer.parseInt(paramService.findByCode(AcsConfig.ELECTRIC).getValue());
|
||||
// if (electric_qty > 0 && electric_qty < electric) {
|
||||
// log.info("当前车辆{}电量为{}低于{},开始判断是否需要充电!", this.device_code, electric_qty, electric);
|
||||
// ndcAgvService.charge(String.valueOf(this.agvaddr));
|
||||
// isCharge = true;
|
||||
// }
|
||||
//是否开启自动充电
|
||||
String is_atuo_electric = paramService.findByCode(AcsConfig.IS_ATUO_ELECTRIC).getValue();
|
||||
log.info("接收agv上报信息,is_atuo_electric:" + is_atuo_electric);
|
||||
if ("1".equals(is_atuo_electric)) {
|
||||
String electric_begin = paramService.findByCode(AcsConfig.ELECTRIC_BEGIN).getValue();
|
||||
String[] begins = electric_begin.split(":");
|
||||
String electric_end = paramService.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(paramService.findByCode(AcsConfig.ELECTRIC).getValue());
|
||||
} else {
|
||||
electric = Integer.parseInt(paramService.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);
|
||||
log.info("当前车辆{}电量为{}低于{},开始查询分配充电桩信息", this.agvaddr, electric_qty, electric);
|
||||
if (ObjectUtil.isNotEmpty(dict1)) {
|
||||
log.info("当前车辆{}已分配充电桩{},退出后续判断", this.agvaddr, dict1.getPara1());
|
||||
} else {
|
||||
List<Dict> dictList = dictService.getDictByName2("station");
|
||||
if (ObjectUtils.isNotEmpty(dictList) && (this.agvaddr == 7 || this.agvaddr == 8)) {
|
||||
dictList.removeIf(r -> !"四号站点(RT)".equals(r.getLabel()));
|
||||
}
|
||||
if (ObjectUtils.isNotEmpty(dictList)) {
|
||||
log.info("当前车辆{}电量为{}低于{},充电桩数量", this.agvaddr, electric_qty, dictList.size());
|
||||
log.info("当前车辆{}成功分配充电桩:{},准备下发充电任务", this.agvaddr, dictList.get(0).getLabel());
|
||||
ndcAgvService.charge(String.valueOf(this.agvaddr));
|
||||
isCharge = true;
|
||||
} else {
|
||||
log.info("当前车辆{}电量为{}低于{},但无空闲充电桩!", this.agvaddr, electric_qty, electric);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (phase == 0x74) {
|
||||
status = ikey;
|
||||
} else if (phase == 0x75) {
|
||||
|
||||
@@ -84,7 +84,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
|
||||
String ext_task_id = request.getExt_task_uuid();
|
||||
String task_code = request.getTask_code();
|
||||
//车辆类型
|
||||
String car_type=request.getCar_type();
|
||||
String car_type=request.getCar_type()==null?"1":request.getCar_type();
|
||||
String car_width=request.getCar_width();
|
||||
String start_device_code = request.getStart_device_code();
|
||||
String start_device_code2 = request.getStart_device_code2();
|
||||
|
||||
@@ -76,6 +76,11 @@ class SysParamController {
|
||||
paramService.setParam(whereJson);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
@GetMapping("/queryParam")
|
||||
@Log("查询自动充电配置")
|
||||
public ResponseEntity<Object> queryParam(){
|
||||
return new ResponseEntity<>(paramService.queryParam(), HttpStatus.OK);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -89,6 +89,19 @@ public interface ISysDictService extends IService<Dict> {
|
||||
*/
|
||||
void deleteDetail(String id);
|
||||
|
||||
/**
|
||||
* 获取字典明细
|
||||
* @param name
|
||||
* @return
|
||||
*/
|
||||
List<Dict> getDictByName2(String name);
|
||||
|
||||
/**
|
||||
* 获取字典明细
|
||||
* @param name
|
||||
* @return
|
||||
*/
|
||||
Dict getDictByName3(String name,String carno,String station);
|
||||
/**
|
||||
* 查询所有字典信息
|
||||
* @return
|
||||
|
||||
@@ -215,6 +215,32 @@ public class SysDictServiceImpl extends ServiceImpl<SysDictMapper, Dict> impleme
|
||||
sysDictMapper.updateById(dict);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Dict> getDictByName2(String name) {
|
||||
return sysDictMapper.selectList(
|
||||
new LambdaQueryWrapper<Dict>()
|
||||
.eq(Dict::getCode, name)
|
||||
.eq(Dict::getValue, "0")
|
||||
.and(slam -> slam.isNull(Dict::getPara2)
|
||||
.or()
|
||||
.eq(Dict::getPara2, "")).orderByAsc(Dict::getDict_id)
|
||||
);
|
||||
}
|
||||
|
||||
@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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -60,6 +60,6 @@ public interface ISysParamService extends IService<Param> {
|
||||
*/
|
||||
/*@Cached(name = "paramDataCode.", key = "#code", expire = 3600, cacheType = CacheType.REMOTE)*/
|
||||
Param findByCode(String code);
|
||||
|
||||
Map<String, Object> queryParam();
|
||||
void setParam(Map whereJson);
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -99,6 +100,27 @@ 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){
|
||||
|
||||
@@ -0,0 +1,192 @@
|
||||
server:
|
||||
port: 8010
|
||||
#配置数据源
|
||||
spring:
|
||||
messages:
|
||||
basename: language/login/login,language/error/error,language/buss/buss,language/task/CallEmpReelTask,language/task/common,language/monitor/one_device/one_device,language/monitor/two_device/two_device,language/monitor/universal/universal
|
||||
datasource:
|
||||
druid:
|
||||
db-type: com.alibaba.druid.pool.DruidDataSource
|
||||
driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
|
||||
# url: jdbc:log4jdbc:mysql://${DB_HOST:192.168.81.252}:${DB_PORT:3306}/${DB_NAME:stand_acs}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true
|
||||
# url: jdbc:log4jdbc:mysql://${DB_HOST:127.0.0.1}:${DB_PORT:3306}/${DB_NAME:beian_xinshengacs}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true
|
||||
url: jdbc:log4jdbc:mysql://${DB_HOST:127.0.0.1}:${DB_PORT:3306}/${DB_NAME:hyjm_acs}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true
|
||||
username: ${DB_USER:root}
|
||||
# password: ${DB_PWD:Root.123456}
|
||||
password: ${DB_PWD:123456}
|
||||
# 初始连接数
|
||||
initial-size: 5
|
||||
# 最小连接数
|
||||
min-idle: 15
|
||||
# 最大连接数
|
||||
max-active: 30
|
||||
# 超时时间(以秒数为单位)
|
||||
remove-abandoned-timeout: 180
|
||||
# 获取连接超时时间
|
||||
max-wait: 3000
|
||||
# 连接有效性检测时间
|
||||
time-between-eviction-runs-millis: 60000
|
||||
# 连接在池中最小生存的时间
|
||||
min-evictable-idle-time-millis: 300000
|
||||
# 连接在池中最大生存的时间
|
||||
max-evictable-idle-time-millis: 900000
|
||||
# 指明连接是否被空闲连接回收器(如果有)进行检验.如果检测失败,则连接将被从池中去除
|
||||
test-while-idle: true
|
||||
# 指明是否在从池中取出连接前进行检验,如果检验失败, 则从池中去除连接并尝试取出另一个
|
||||
test-on-borrow: true
|
||||
# 是否在归还到池中前进行检验
|
||||
test-on-return: false
|
||||
# 检测连接是否有效
|
||||
validation-query: select 1
|
||||
# 配置监控统计
|
||||
webStatFilter:
|
||||
enabled: true
|
||||
stat-view-servlet:
|
||||
enabled: true
|
||||
url-pattern: /druid/*
|
||||
reset-enable: false
|
||||
filter:
|
||||
stat:
|
||||
enabled: true
|
||||
# 记录慢SQL
|
||||
log-slow-sql: true
|
||||
slow-sql-millis: 1000
|
||||
merge-sql: true
|
||||
wall:
|
||||
config:
|
||||
multi-statement-allow: true
|
||||
flyway:
|
||||
# 是否启用flyway
|
||||
enabled: true
|
||||
# 编码格式,默认UTF-8
|
||||
encoding: UTF-8
|
||||
# 迁移sql脚本文件存放路径,默认db/migration
|
||||
locations: classpath:db/migration
|
||||
# 迁移sql脚本文件名称的前缀,默认V
|
||||
sql-migration-prefix: V
|
||||
# 迁移sql脚本文件名称的分隔符,默认2个下划线__
|
||||
sql-migration-separator: __
|
||||
# 迁移sql脚本文件名称的后缀
|
||||
sql-migration-suffixes: .sql
|
||||
# 迁移时是否进行校验,默认true
|
||||
validate-on-migrate: true
|
||||
# 当迁移发现数据库非空且存在没有元数据的表时,自动执行基准迁移,新建schema_version表
|
||||
baseline-on-migrate: true
|
||||
redis:
|
||||
#数据库索引
|
||||
database: ${REDIS_DB:2}
|
||||
host: ${REDIS_HOST:127.0.0.1}
|
||||
port: ${REDIS_PORT:6379}
|
||||
jpa:
|
||||
show-sql: true
|
||||
|
||||
# 登录相关配置
|
||||
login:
|
||||
# 登录缓存
|
||||
cache-enable: true
|
||||
# 是否限制单用户登录
|
||||
single-login: false
|
||||
# 验证码
|
||||
login-code:
|
||||
# 验证码类型配置 查看 LoginProperties 类
|
||||
code-type: arithmetic
|
||||
# 登录图形验证码有效时间/分钟
|
||||
expiration: 2
|
||||
# 验证码高度
|
||||
width: 111
|
||||
# 验证码宽度
|
||||
heigth: 36
|
||||
# 内容长度
|
||||
length: 2
|
||||
# 字体名称,为空则使用默认字体
|
||||
font-name:
|
||||
# 字体大小
|
||||
font-size: 25
|
||||
|
||||
#是否允许生成代码,生产环境设置为false
|
||||
generator:
|
||||
enabled: true
|
||||
|
||||
# IP 本地解析
|
||||
ip:
|
||||
local-parsing: true
|
||||
|
||||
# 文件存储路径
|
||||
file:
|
||||
mac:
|
||||
path: ~/file/
|
||||
avatar: ~/avatar/
|
||||
linux:
|
||||
path: /home/eladmin/file/
|
||||
avatar: /home/eladmin/avatar/
|
||||
windows:
|
||||
path: C:\eladmin\file\
|
||||
avatar: C:\eladmin\avatar\
|
||||
# 文件大小 /M
|
||||
maxSize: 100
|
||||
avatarMaxSize: 5
|
||||
logging:
|
||||
file:
|
||||
path: D:\log\beian\acs # /Users/onepiece/myFile/acs_logs
|
||||
config: classpath:logback-spring.xml
|
||||
lucene:
|
||||
index:
|
||||
path: D:\lucene\index
|
||||
|
||||
# Sa-Token配置
|
||||
sa-token:
|
||||
# token 名称 (同时也是cookie名称)
|
||||
token-name: Authorization
|
||||
# token 有效期,单位s 默认30天, -1代表永不过期
|
||||
timeout: 2592000
|
||||
# token 临时有效期 (指定时间内无操作就视为token过期) 单位: 秒
|
||||
activity-timeout: -1
|
||||
# 是否允许同一账号并发登录 (为true时允许一起登录, 为false时新登录挤掉旧登录)
|
||||
is-concurrent: true
|
||||
# 在多人登录同一账号时,是否共用一个token (为true时所有登录共用一个token, 为false时每次登录新建一个token)
|
||||
is-share: false
|
||||
# token风格
|
||||
token-style: random-128
|
||||
# 是否输出操作日志
|
||||
is-log: false
|
||||
jwt-secret-key: opsjajisdnnca0sdkksdfaaasdfwwq
|
||||
# token 前缀
|
||||
token-prefix: Bearer
|
||||
sso:
|
||||
# Ticket有效期 (单位: 秒),默认五分钟
|
||||
ticket-timeout: 300
|
||||
# 所有允许的授权回调地址
|
||||
allow-url: "*"
|
||||
# 是否打开单点注销功能
|
||||
is-slo: true
|
||||
|
||||
# ------- SSO-模式三相关配置 (下面的配置在SSO模式三并且 is-slo=true 时打开)
|
||||
# 是否打开模式三
|
||||
isHttp: true
|
||||
# 接口调用秘钥(用于SSO模式三的单点注销功能)
|
||||
secretkey: kQwIOrYvnXmSDkwEiFngrKidMcdrgKor
|
||||
# ---- 除了以上配置项,你还需要为 Sa-Token 配置http请求处理器(文档有步骤说明)
|
||||
is-read-cookie: true
|
||||
is-print: false
|
||||
# 未登录 StpUtil.getTokenSession() 设置值,获取值 @SaIgnore 得忽略接口
|
||||
token-session-check-login: false
|
||||
alone-redis:
|
||||
# Redis数据库索引(默认为0)
|
||||
database: 2
|
||||
# Redis服务器地址
|
||||
host: 127.0.0.1
|
||||
# Redis服务器连接端口
|
||||
port: 6379
|
||||
# Redis服务器连接密码(默认为空)
|
||||
password:
|
||||
# 连接超时时间
|
||||
timeout: 10s
|
||||
#comPort:
|
||||
# need: true
|
||||
# cname: COM5
|
||||
# newBaudRate: 9600
|
||||
# newDataBits: 8
|
||||
# newStopBits: 1
|
||||
# newParity: 0
|
||||
agvToAcs:
|
||||
addr: http://localhost
|
||||
@@ -6,7 +6,7 @@ spring:
|
||||
freemarker:
|
||||
check-template-location: false
|
||||
profiles:
|
||||
active: dev
|
||||
active: prod
|
||||
# active: dev
|
||||
# active: prod
|
||||
jackson:
|
||||
|
||||
Reference in New Issue
Block a user