Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -291,6 +291,11 @@ public class FinishedProductOutBindLableDeviceDriver extends AbstractOpcDeviceDr
|
|||||||
if (move > 0 && !requireSucess) {
|
if (move > 0 && !requireSucess) {
|
||||||
applyLaStrangulationAndLabeling(mode);
|
applyLaStrangulationAndLabeling(mode);
|
||||||
}
|
}
|
||||||
|
case 17:
|
||||||
|
//申请调试贴标
|
||||||
|
if(move > 0 && !requireSucess){
|
||||||
|
applyLaStrangulationAndLabeling(mode);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -413,6 +418,8 @@ public class FinishedProductOutBindLableDeviceDriver extends AbstractOpcDeviceDr
|
|||||||
String bindingTemplate = jo.get("bindingTemplate").toString();
|
String bindingTemplate = jo.get("bindingTemplate").toString();
|
||||||
String printDevice = jo.get("printDevice").toString();
|
String printDevice = jo.get("printDevice").toString();
|
||||||
String bundleTimes = jo.get("bundleTimes").toString();
|
String bundleTimes = jo.get("bundleTimes").toString();
|
||||||
|
String case1 = jo.get("case").toString();
|
||||||
|
String direction = jo.get("direction").toString();
|
||||||
|
|
||||||
List list = new ArrayList();
|
List list = new ArrayList();
|
||||||
if (mode == 10 || mode == 16) {
|
if (mode == 10 || mode == 16) {
|
||||||
@@ -521,6 +528,41 @@ public class FinishedProductOutBindLableDeviceDriver extends AbstractOpcDeviceDr
|
|||||||
map12.put("value", labelingTemplate);
|
map12.put("value", labelingTemplate);
|
||||||
list.add(map12);
|
list.add(map12);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(mode == 17){
|
||||||
|
Map map = new HashMap();
|
||||||
|
map.put("code", "to_length");
|
||||||
|
map.put("value", length);
|
||||||
|
list.add(map);
|
||||||
|
Map map2 = new HashMap();
|
||||||
|
map2.put("code", "to_weight");
|
||||||
|
map2.put("value", weight);
|
||||||
|
list.add(map2);
|
||||||
|
Map map3 = new HashMap();
|
||||||
|
map3.put("code", "to_height");
|
||||||
|
map3.put("value", height);
|
||||||
|
list.add(map3);
|
||||||
|
Map map5 = new HashMap();
|
||||||
|
map5.put("code", "to_command");
|
||||||
|
map5.put("value", mode);
|
||||||
|
list.add(map5);
|
||||||
|
Map map11 = new HashMap();
|
||||||
|
map11.put("code", "to_binding_times");
|
||||||
|
map11.put("value", bundleTimes);
|
||||||
|
list.add(map11);
|
||||||
|
if(StrUtil.isNotEmpty(case1) && !" ".equals(case1)){
|
||||||
|
Map map12 = new HashMap();
|
||||||
|
map12.put("code", "to_binding_times");
|
||||||
|
map12.put("value", bundleTimes);
|
||||||
|
list.add(map12);
|
||||||
|
}
|
||||||
|
if(StrUtil.isNotEmpty(direction) && !" ".equals(direction)){
|
||||||
|
Map map13 = new HashMap();
|
||||||
|
map13.put("code", "to_direction");
|
||||||
|
map13.put("value", direction);
|
||||||
|
list.add(map13);
|
||||||
|
}
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
this.writing(list);
|
this.writing(list);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver;
|
|||||||
import org.nl.acs.device_driver.driver.ExecutableDeviceDriver;
|
import org.nl.acs.device_driver.driver.ExecutableDeviceDriver;
|
||||||
import org.nl.acs.ext.wms.service.AcsToWmsService;
|
import org.nl.acs.ext.wms.service.AcsToWmsService;
|
||||||
import org.nl.acs.ext.wms.service.impl.AcsToWmsServiceImpl;
|
import org.nl.acs.ext.wms.service.impl.AcsToWmsServiceImpl;
|
||||||
|
import org.nl.acs.history.ErrorUtil;
|
||||||
import org.nl.acs.history.service.DeviceErrorLogService;
|
import org.nl.acs.history.service.DeviceErrorLogService;
|
||||||
import org.nl.acs.history.service.impl.DeviceErrorLogServiceImpl;
|
import org.nl.acs.history.service.impl.DeviceErrorLogServiceImpl;
|
||||||
import org.nl.acs.instruction.domain.Instruction;
|
import org.nl.acs.instruction.domain.Instruction;
|
||||||
@@ -1084,7 +1085,7 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
|
|||||||
jo.put("command", command);
|
jo.put("command", command);
|
||||||
jo.put("action", action);
|
jo.put("action", action);
|
||||||
jo.put("task", task);
|
jo.put("task", task);
|
||||||
jo.put("error", this.getError());
|
jo.put("error", ErrorUtil.getDictDetail("ddj_error_type", String.valueOf(this.getError())));
|
||||||
jo.put("message", LangProcess.msg(message));
|
jo.put("message", LangProcess.msg(message));
|
||||||
jo.put("prohibitInWarehouse", this.prohibitInWarehouse);
|
jo.put("prohibitInWarehouse", this.prohibitInWarehouse);
|
||||||
jo.put("prohibitOutWarehouse", this.prohibitOutWarehouse);
|
jo.put("prohibitOutWarehouse", this.prohibitOutWarehouse);
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ public class ErrorUtil {
|
|||||||
List<Dict> dictDtos = dictDetailService.queryAll();
|
List<Dict> dictDtos = dictDetailService.queryAll();
|
||||||
for (int i = 0; i < dictDtos.size(); i++) {
|
for (int i = 0; i < dictDtos.size(); i++) {
|
||||||
Dict dictDto = dictDtos.get(i);
|
Dict dictDto = dictDtos.get(i);
|
||||||
dictMap.put(dictDto.getName(), getDict(dictDto.getName(), dictDetailService::getDictByName));
|
dictMap.put(dictDto.getCode(), getDict(dictDto.getCode(), dictDetailService::getDictByName));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ import org.nl.system.service.user.dto.UserDto;
|
|||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.data.domain.Pageable;
|
import org.springframework.data.domain.Pageable;
|
||||||
|
import org.springframework.data.redis.core.RedisTemplate;
|
||||||
import org.springframework.scheduling.annotation.Async;
|
import org.springframework.scheduling.annotation.Async;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
@@ -44,6 +45,7 @@ import javax.servlet.http.HttpServletRequest;
|
|||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Zheng Jie
|
* @author Zheng Jie
|
||||||
@@ -58,6 +60,8 @@ public class OnlineUserService {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private ISysRoleService roleService;
|
private ISysRoleService roleService;
|
||||||
private final RedisUtils redisUtils;
|
private final RedisUtils redisUtils;
|
||||||
|
@Autowired
|
||||||
|
private RedisTemplate<Object, Object> redisTemplate;
|
||||||
@Value("${sa-token.cookie.domain}")
|
@Value("${sa-token.cookie.domain}")
|
||||||
private String domain;
|
private String domain;
|
||||||
|
|
||||||
@@ -237,11 +241,53 @@ public class OnlineUserService {
|
|||||||
// if (StrUtil.isEmpty(authUser.getCode()) || !authUser.getCode().equalsIgnoreCase(code)) {
|
// if (StrUtil.isEmpty(authUser.getCode()) || !authUser.getCode().equalsIgnoreCase(code)) {
|
||||||
// throw new BadRequestException("验证码错误");
|
// throw new BadRequestException("验证码错误");
|
||||||
// }
|
// }
|
||||||
// 校验数据库
|
|
||||||
// 根据用户名查询,在比对密码
|
|
||||||
SysUser userInfo = sysUserService.getOne(new QueryWrapper<SysUser>().eq("username", authUser.getUsername()));
|
SysUser userInfo = sysUserService.getOne(new QueryWrapper<SysUser>().eq("username", authUser.getUsername()));
|
||||||
if (userInfo == null || !userInfo.getPassword().equals(SaSecureUtil.md5BySalt(password, "salt"))) { // 这里需要密码加密
|
|
||||||
throw new BadRequestException("账号或密码错误");
|
// 这里需要密码加密
|
||||||
|
if (userInfo == null) {
|
||||||
|
throw new BadRequestException("当前用户不存在!");
|
||||||
|
}
|
||||||
|
String userName = userInfo.getUsername();
|
||||||
|
if (!userInfo.getPassword().equals(SaSecureUtil.md5BySalt(password, "salt"))) {
|
||||||
|
Boolean aBoolean = redisTemplate.hasKey("LoginName:" + userName);
|
||||||
|
if (aBoolean) {
|
||||||
|
String errorLoginCount = redisTemplate.opsForValue().get("LoginName:" + userName).toString();
|
||||||
|
Integer newerrorLoginCount = Integer.parseInt(errorLoginCount);
|
||||||
|
//key为 LoginName: userName value是对应的错误登陆次数
|
||||||
|
if (newerrorLoginCount.intValue() == 3) {
|
||||||
|
Long expire = redisTemplate.opsForValue().getOperations().getExpire("LoginName:" + userName);
|
||||||
|
if (expire.intValue() > 0) {
|
||||||
|
throw new BadRequestException("当前用户锁定中,请" + expire / 60 + "分钟后重试");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
redisTemplate.opsForValue().set("LoginName:" + userName, newerrorLoginCount + 1);
|
||||||
|
if (3 - newerrorLoginCount - 1 == 0) {
|
||||||
|
redisTemplate.opsForValue().getOperations().expire("LoginName:" + userName, 300, TimeUnit.SECONDS);
|
||||||
|
throw new BadRequestException("当前用户已锁定,请5分钟后重试");
|
||||||
|
}
|
||||||
|
throw new BadRequestException("密码错误,还有" + (3 - newerrorLoginCount - 1) + "次机会");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
redisTemplate.opsForValue().set("LoginName:" + userName, "1");
|
||||||
|
throw new BadRequestException("密码错误,还有" + 2 + "次机会");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
{
|
||||||
|
//密码正确,判断redis里面是否有值,有值就代表锁定中
|
||||||
|
Boolean aBoolean = redisTemplate.hasKey("LoginName:" + userName);
|
||||||
|
if (aBoolean) {
|
||||||
|
String errorLoginCount = redisTemplate.opsForValue().get("LoginName:" + userName).toString();
|
||||||
|
Integer newerrorLoginCount = Integer.parseInt(errorLoginCount);
|
||||||
|
if (newerrorLoginCount.intValue() == 3) {
|
||||||
|
Long expire = redisTemplate.opsForValue().getOperations().getExpire("LoginName:" + userName);
|
||||||
|
if (expire.intValue() > 0) {
|
||||||
|
throw new BadRequestException("当前用户锁定中,请" + expire / 60 + "分钟后重试");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
//直接删除key
|
||||||
|
redisTemplate.delete("LoginName:" + userName);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取权限列表 - 登录查找权限
|
// 获取权限列表 - 登录查找权限
|
||||||
|
|||||||
@@ -468,6 +468,23 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
|||||||
throw new BadRequestException("未查询到该木箱对应的包装关系!");
|
throw new BadRequestException("未查询到该木箱对应的包装关系!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//判断是否开启了系统参数生成AGV搬运任务
|
||||||
|
String agv_transport = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("agv_transport").getValue();
|
||||||
|
//如果未开启AGV搬运则不创建从1016到发货区的任务
|
||||||
|
if (agv_transport.equals("0")){
|
||||||
|
log.info("未开启AGV搬运系统参数,不生成AGV搬运["+vehicle_code+"]任务!");
|
||||||
|
JSONArray sub_rows2 = WQLObject.getWQLObject("pdm_bi_subpackagerelation").query("package_box_sn = '" + vehicle_code + "'").getResultJSONArray(0);
|
||||||
|
for (int i = 0; i < sub_rows2.size(); i++) {
|
||||||
|
JSONObject sub_row = sub_rows2.getJSONObject(i);
|
||||||
|
if (StrUtil.isNotEmpty(sub_row.getString("need_delete")) && "1".equals(sub_row.getString("need_delete"))) {
|
||||||
|
WQLObject.getWQLObject("pdm_bi_subpackagerelation").delete(sub_row);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
result.put("status", HttpStatus.OK.value());
|
||||||
|
result.put("message", "下发成功!");
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
// 校验木箱长度类型
|
// 校验木箱长度类型
|
||||||
double box_length = sub_jo.getDoubleValue("box_length");
|
double box_length = sub_jo.getDoubleValue("box_length");
|
||||||
String length_down_1 = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("box_length_down_1").getValue();
|
String length_down_1 = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("box_length_down_1").getValue();
|
||||||
|
|||||||
@@ -377,6 +377,10 @@ export default {
|
|||||||
personName: [
|
personName: [
|
||||||
{ required: true, message: '请输入用户姓名', trigger: 'blur' },
|
{ required: true, message: '请输入用户姓名', trigger: 'blur' },
|
||||||
{ min: 2, max: 20, message: '长度在 2 到 20 个字符', trigger: 'blur' }
|
{ min: 2, max: 20, message: '长度在 2 到 20 个字符', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
password: [
|
||||||
|
{ required: true, message: '请输入用户密码', trigger: 'blur' },
|
||||||
|
{ pattern: /^(?=.*\d)(?=.*[A-z])[\da-zA-Z]{6,12}$/, message: '长度6位以上,数字+密码', trigger: 'blur' }
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
syncDrawer: false,
|
syncDrawer: false,
|
||||||
@@ -463,7 +467,7 @@ export default {
|
|||||||
},
|
},
|
||||||
// 新增前将多选的值设置为空
|
// 新增前将多选的值设置为空
|
||||||
[CRUD.HOOK.beforeToAdd]() {
|
[CRUD.HOOK.beforeToAdd]() {
|
||||||
this.form.password = '123456'
|
// this.form.password = '123456'
|
||||||
this.roleDatas = []
|
this.roleDatas = []
|
||||||
},
|
},
|
||||||
// 初始化编辑时候的角色与岗位
|
// 初始化编辑时候的角色与岗位
|
||||||
@@ -626,10 +630,10 @@ export default {
|
|||||||
cancelButtonText: '取消',
|
cancelButtonText: '取消',
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
row.password = '123456'
|
row.password = 'HL123456'
|
||||||
crudUser.edit(row).then(res => {
|
crudUser.edit(row).then(res => {
|
||||||
this.crud.toQuery()
|
this.crud.toQuery()
|
||||||
this.crud.notify('密码重置成功,密码:123456', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
this.crud.notify('密码重置成功,密码:HL123456', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user