Browse Source

rev:优化报警代码、修改密码报错

master
gengby 4 weeks ago
parent
commit
010c8eea23
  1. 4
      nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/driver/conveyor/appearance_inspection_scannner_conveyor/AppearanceInspectionScannerConveyorDeviceDriver.java
  2. 13
      nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/driver/screen/led_screen/LedScreenDeviceDriver.java
  3. 12
      nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/driver/stacker/double_stacker/StandardStackerDeviceDriver.java
  4. 22
      nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/driver/stacker/double_stacker/enums/ErrorEnum.java
  5. 2
      nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java
  6. 12
      nladmin-system/nlsso-server/src/main/java/org/nl/system/controller/user/UserController.java

4
nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/driver/conveyor/appearance_inspection_scannner_conveyor/AppearanceInspectionScannerConveyorDeviceDriver.java

@ -315,6 +315,10 @@ public class AppearanceInspectionScannerConveyorDeviceDriver extends AbstractOpc
if (scanApplyFlag) {
this.message = "正在执行申请AGV任务";
this.applyAgvTask();
} else {
//TODO 等AGV上线后删除
this.writing(ItemProtocol.TO_COMMAND.getKey(), CommandEnum.COMMAND_7.getValue());
this.requireSuccess = true;
}
} else if (this.mode == AppModeEnum.MODE_8.getCode() && this.move > 0 && StrUtil.isNotEmpty(this.barcode) && !requireSuccess) {
this.message = "正在获取外形检测高度";

13
nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/driver/screen/led_screen/LedScreenDeviceDriver.java

@ -66,11 +66,12 @@ public class LedScreenDeviceDriver extends AbstractDeviceDriver implements Devic
@Override
public void execute() throws Exception {
try {
if (isInitialized.compareAndSet(false, true)) {
Bx6GEnv.initial(30000);
}
//建立连接
if (this.screen == null) {
if (this.screen == null || !this.screen.isConnected()) {
String ip = Optional.ofNullable(this.getDevice().getExtraValue().get("ip_address")).map(Object::toString).orElse(null);
int port = Optional.ofNullable(this.getDevice().getExtraValue().get("ip_port")).map(Object::toString).map(Integer::parseInt).orElse(0);
if (ip == null || port == 0) {
@ -79,7 +80,6 @@ public class LedScreenDeviceDriver extends AbstractDeviceDriver implements Devic
this.screen = new Bx6GScreenClient(this.getDevice().getDevice_code(), new Bx6E());
this.screen.connect(ip, port);
}
//设置节目
DisplayStyle[] styles = DisplayStyleFactory.getStyles().toArray(new DisplayStyle[0]);
ProgramBxFile pf = new ProgramBxFile(0, this.screen.getProfile());
@ -110,7 +110,6 @@ public class LedScreenDeviceDriver extends AbstractDeviceDriver implements Devic
this.screen.writeProgram(pf);
this.modeMsgInfo = sb.toString();
}
//设置动态区1报警信息
List<String> errorDevices = this.getExtraDeviceCodes("errorDevices");
StringBuilder sbMsg = new StringBuilder();
@ -169,7 +168,6 @@ public class LedScreenDeviceDriver extends AbstractDeviceDriver implements Devic
this.screen.writeDynamic(rule_2, area_2);
this.errorMsgInfo = sbMsg.toString();
}
//设置动态区2任务信息
StringBuilder sb2 = new StringBuilder();
sb2.append("任务信息: ");
@ -224,6 +222,13 @@ public class LedScreenDeviceDriver extends AbstractDeviceDriver implements Devic
this.taskMsgInfo = sb2.toString();
}
} catch (Exception e) {
if (this.screen != null) {
this.screen.disconnect();
System.out.println(this.getDevice().getDevice_code() + "关闭Screen连接!");
Thread.sleep(60000);
}
}
Integer upTime = Optional.ofNullable(this.getDevice().getExtraValue().get("upTime")).map(Object::toString).map(Integer::parseInt).orElse(60);
Thread.sleep(upTime * 1000);
Runtime.getRuntime().addShutdownHook(new Thread(() -> {

12
nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/driver/stacker/double_stacker/StandardStackerDeviceDriver.java

@ -1469,6 +1469,7 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
if (CollectionUtil.isNotEmpty(frontInsts)) {
frontInst = frontInsts.get(0);
if (ObjectUtil.isNotEmpty(frontInst)) {
logService.deviceExecuteLog(new LuceneLogDto(this.currentDeviceCode, "第一次查询到前叉指令号:" + frontInst.getInstruction_code()));
String front_start_device_code = frontInst.getStart_device_code();
front_start_device = deviceAppService.findDeviceByCode(front_start_device_code);
if (front_start_device != null) {
@ -1503,6 +1504,11 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
if (ObjectUtil.isNotEmpty(inst)) {
return;
}
} else {
logService.deviceExecuteLog(new LuceneLogDto(this.currentDeviceCode, "第二次查询到前叉指令号:" + frontInst.getInstruction_code()));
if (frontInst.getTo_y() != null && (1 == Integer.parseInt(frontInst.getTo_y()) || 2 == Integer.parseInt(frontInst.getTo_y()))) {
frontInst = null;
}
}
}
}
@ -1511,6 +1517,7 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
if (CollectionUtil.isNotEmpty(frontInsts)) {
frontInst = frontInsts.get(0);
if (ObjectUtil.isNotEmpty(frontInst)) {
logService.deviceExecuteLog(new LuceneLogDto(this.currentDeviceCode, "第三次查询到前叉指令号:" + frontInst.getInstruction_code()));
String front_start_device_code = frontInst.getStart_device_code();
front_start_device = deviceAppService.findDeviceByCode(front_start_device_code);
if (front_start_device != null) {
@ -1544,6 +1551,11 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
if (ObjectUtil.isNotEmpty(inst)) {
return;
}
}else {
logService.deviceExecuteLog(new LuceneLogDto(this.currentDeviceCode, "第四次查询到前叉指令号:" + frontInst.getInstruction_code()));
if (frontInst.getTo_y() != null && (1 == Integer.parseInt(frontInst.getTo_y()) || 2 == Integer.parseInt(frontInst.getTo_y()))) {
frontInst = null;
}
}
}
}

22
nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/driver/stacker/double_stacker/enums/ErrorEnum.java

@ -13,7 +13,7 @@ import lombok.Getter;
public enum ErrorEnum {
NO(0, "无故障"),
ERROR_1(1, "货位超限"),
ERROR_2(2, "作业条件不满足"),
ERROR_2(2, "堆垛机未停准"),
ERROR_3(3, "与输送线通讯故障"),
ERROR_4(4, "传送地址错误"),
MR(5, "满入"),
@ -30,26 +30,26 @@ public enum ErrorEnum {
ZD(16, "阻挡/浅货位有货"),
ERROR_17(17, "烟感报警"),
ERROR_18(18, "货叉数据出错"),
ERROR_19(19, "货叉左超限"),
ERROR_20(20, "货叉货叉右报警"),
ERROR_21(21, "货叉伸缩过头报警"),
ERROR_19(19, "货叉左超限"),
ERROR_20(20, "货叉右超限"),
ERROR_21(21, "货叉伸叉受阻"),
ERROR_22(22, "低位上升过头报警"),
ERROR_23(23, "高位下降过头报警"),
ERROR_24(24, "松绳报警"),
ERROR_24(24, "松绳保护"),
ERROR_25(25, "急停触发"),
ERROR_26(26, "安全门打开"),
ERROR_27(27, "红外温感报警"),
ERROR_28(28, "红外温感探测"),
ERROR_29(29, "行走超时保护触发"),
ERROR_27(27, "红外温感报警"),
ERROR_28(28, "红外温感探测"),
ERROR_29(29, "执行烟感探测"),
ERROR_30(30, "放货完成确认超时"),
ERROR_31(31, "对接设备不允许取/放货"),
ERROR_32(32, "未探测到检测"),
ERROR_32(32, "未探测到检测"),
ERROR_33(33, "行走超速度保护触发"),
ERROR_34(34, "升降超速度保护触发"),
ERROR_35(35, "减速开关信号异常"),
ERROR_36(36, "防撞开关被触"),
ERROR_36(36, "防撞开关被触"),
ERROR_37(37, "防撞激光被遮挡"),
ERROR_38(38, "高货物禁止上楼承接位");
ERROR_38(38, "高货物禁止放入矮库位");
private int code;
private String desc;

2
nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java

@ -368,7 +368,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
JSONObject data = new JSONObject();
if (device != null && device.getDeviceDriver() instanceof AppearanceInspectionScannerConveyorDeviceDriver){
AppearanceInspectionScannerConveyorDeviceDriver appearanceInspectionScannerConveyorDeviceDriver = (AppearanceInspectionScannerConveyorDeviceDriver) device.getDeviceDriver();
data.put("weight",appearanceInspectionScannerConveyorDeviceDriver.getWeight());
data.put("weight",appearanceInspectionScannerConveyorDeviceDriver.getWeight() * 1000);
} else {
throw new BadRequestException("设备不存在");
}

12
nladmin-system/nlsso-server/src/main/java/org/nl/system/controller/user/UserController.java

@ -106,11 +106,17 @@ public class UserController {
// 解密,得到字符密码
String oldPass = RsaUtils.decryptByPrivateKey(RsaProperties.privateKey,passVo.getString("oldPass"));
String newPass = RsaUtils.decryptByPrivateKey(RsaProperties.privateKey,passVo.getString("newPass"));
SysUser user = userService.getOne(new LambdaQueryWrapper<SysUser>().eq(SysUser::getUsername, SecurityUtils.getCurrentNickName()));
if (!SaSecureUtil.md5BySalt(user.getPassword(), "salt").equals(SaSecureUtil.md5BySalt(oldPass, "salt"))) {
SysUser user = userService.getOne(new LambdaQueryWrapper<SysUser>().eq(SysUser::getUsername, SecurityUtils.getCurrentUsername()));
// if (!SaSecureUtil.md5BySalt(user.getPassword(), "salt").equals(SaSecureUtil.md5BySalt(oldPass, "salt"))) {
// throw new BadRequestException(LangProcess.msg("login_pwdWrong_1"));
// }
// if (!SaSecureUtil.md5BySalt(user.getPassword(), "salt").equals(SaSecureUtil.md5BySalt(newPass, "salt"))) {
// throw new BadRequestException(LangProcess.msg("login_pwdWrong_2"));
// }
if (!user.getPassword().equals(SaSecureUtil.md5BySalt(oldPass, "salt"))) {
throw new BadRequestException(LangProcess.msg("login_pwdWrong_1"));
}
if (!SaSecureUtil.md5BySalt(user.getPassword(), "salt").equals(SaSecureUtil.md5BySalt(newPass, "salt"))) {
if (user.getPassword().equals(SaSecureUtil.md5BySalt(newPass, "salt"))) {
throw new BadRequestException(LangProcess.msg("login_pwdWrong_2"));
}
user.setPassword(SaSecureUtil.md5BySalt(newPass, "salt"));

Loading…
Cancel
Save