rev 用户管理登录.下发分拣数据和贴标信息
This commit is contained in:
@@ -30,10 +30,7 @@ import org.nl.modules.wql.util.SpringContextHolder;
|
||||
import org.openscada.opc.lib.da.Server;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 晟华-包装线工位
|
||||
@@ -265,8 +262,10 @@ public class PackageSiteDeviceDriver extends AbstractOpcDeviceDriver implements
|
||||
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message + "参数:" + JSON.toJSONString(request)));
|
||||
|
||||
if (resp.getCode() == 200) {
|
||||
this.writing("to_message",resp.getLabel_message());
|
||||
this.writing(200);
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
map.put("to_command",200);
|
||||
map.put("to_message",resp.getLabel_message());
|
||||
this.writing(map);
|
||||
this.setRequireSucess(true);
|
||||
message = RequestMethodEnum.getName("apply_labelling") + "apply_labelling 接口请求成功" + resp.getMessage();
|
||||
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message + "返回参数:" + JSON.toJSONString(resp)));
|
||||
@@ -405,4 +404,42 @@ public class PackageSiteDeviceDriver extends AbstractOpcDeviceDriver implements
|
||||
public void setDeviceStatus(JSONObject data) {
|
||||
|
||||
}
|
||||
/**
|
||||
* 多个信号一起下发电气
|
||||
*
|
||||
* @param map
|
||||
*/
|
||||
|
||||
public void writing(Map<String, Object> map) {
|
||||
LuceneExecuteLogService lucene = SpringContextHolder.getBean(LuceneExecuteLogService.class);
|
||||
DeviceExecuteLogService logServer = SpringContextHolder.getBean("deviceExecuteLogServiceImpl");
|
||||
Map<String, Object> itemMap = new LinkedHashMap<>();
|
||||
map.forEach((key, value) -> {
|
||||
if (ObjectUtil.isNotEmpty(value)) {
|
||||
itemMap.put(getToParam() + key, value);
|
||||
}
|
||||
});
|
||||
if (ObjectUtil.isNotEmpty(itemMap)) {
|
||||
try {
|
||||
this.checkcontrol(itemMap);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
try{
|
||||
this.checkcontrol(itemMap);
|
||||
} catch (Exception e1){
|
||||
e1.printStackTrace();
|
||||
}
|
||||
}
|
||||
logServer.deviceExecuteLog(this.getDevice().getDevice_code(), "", "", "下发多个电气信号:" + itemMap);
|
||||
lucene.deviceExecuteLog(new LuceneLogDto(this.getDeviceCode(), "下发多个电气信号:" + itemMap));
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 抽取统一下发电气信号前缀
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String getToParam() {
|
||||
return this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code() + ".";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -468,6 +468,8 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
|
||||
map.put("to_BshortSide", BshortSide);
|
||||
map.put("to_Htrapezoidal", Htrapezoidal);
|
||||
map.put("to_Wthickness", Wthickness);
|
||||
map.put("to_brick_code", product_code+formula);
|
||||
map.put("to_formula", order_number);
|
||||
map.put("to_feedback",100);
|
||||
lnshPackagePalletManipulatorDeviceDriver.writing(map);
|
||||
is_flag = true;
|
||||
|
||||
@@ -680,15 +680,15 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
|
||||
}
|
||||
|
||||
//变更三色灯状态
|
||||
if (!ObjectUtils.isEmpty(device.getExtraValue().get("link_three_lamp"))) {
|
||||
String lamd_device = device.getExtraValue().get("link_three_lamp").toString();
|
||||
Device lamddevice = appService.findDeviceByCode(lamd_device);
|
||||
|
||||
if (lamddevice.getDeviceDriver() instanceof LampThreecolorDeviceDriver) {
|
||||
lampThreecolorDeviceDriver = (LampThreecolorDeviceDriver) lamddevice.getDeviceDriver();
|
||||
lampThreecolorDeviceDriver.writing(0);
|
||||
}
|
||||
}
|
||||
// if (!ObjectUtils.isEmpty(device.getExtraValue().get("link_three_lamp"))) {
|
||||
// String lamd_device = device.getExtraValue().get("link_three_lamp").toString();
|
||||
// Device lamddevice = appService.findDeviceByCode(lamd_device);
|
||||
//
|
||||
// if (lamddevice.getDeviceDriver() instanceof LampThreecolorDeviceDriver) {
|
||||
// lampThreecolorDeviceDriver = (LampThreecolorDeviceDriver) lamddevice.getDeviceDriver();
|
||||
// lampThreecolorDeviceDriver.writing(0);
|
||||
// }
|
||||
// }
|
||||
|
||||
removeByCodeFromCache(dto.getInstruction_code());
|
||||
|
||||
|
||||
@@ -39,6 +39,7 @@ import org.nl.modules.security.service.dto.AuthUserDto;
|
||||
import org.nl.modules.system.service.RoleService;
|
||||
import org.nl.modules.system.service.UserService;
|
||||
import org.nl.modules.system.service.dto.UserDto;
|
||||
import org.springframework.cache.annotation.CacheEvict;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
@@ -109,7 +109,7 @@ public class UserController {
|
||||
public ResponseEntity<Object> create(@Validated @RequestBody User resources){
|
||||
checkLevel(resources);
|
||||
// 默认密码 123456
|
||||
resources.setPassword(SaSecureUtil.md5BySalt("123456", "salt"));
|
||||
resources.setPassword(SaSecureUtil.md5BySalt(resources.getPassword(), "salt"));
|
||||
userService.create(resources);
|
||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
*/
|
||||
package org.nl.modules.system.service.impl;
|
||||
|
||||
import cn.dev33.satoken.secure.SaSecureUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.nl.modules.common.config.FileProperties;
|
||||
@@ -135,6 +136,7 @@ public class UserServiceImpl implements UserService {
|
||||
clone.setPhone(resources.getPhone());
|
||||
clone.setNickName(resources.getNickName());
|
||||
clone.setGender(resources.getGender());
|
||||
clone.setPassword(SaSecureUtil.md5BySalt(resources.getPassword(), "salt"));
|
||||
|
||||
userRepository.save(clone);
|
||||
// 清除缓存
|
||||
@@ -169,7 +171,7 @@ public class UserServiceImpl implements UserService {
|
||||
}
|
||||
|
||||
@Override
|
||||
@Cacheable(key = "'username:' + #p0")
|
||||
// @Cacheable(key = "'username:' + #p0")
|
||||
public UserDto findByName(String userName) {
|
||||
User user = userRepository.findByUsername(userName);
|
||||
if (user == null) {
|
||||
|
||||
@@ -96,6 +96,9 @@
|
||||
<el-radio label="女">女</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="密码" prop="password">
|
||||
<el-input v-model="form.password" style="width: 200px;" show-password auto-complete="new-password" />
|
||||
</el-form-item>
|
||||
<el-form-item label="状态">
|
||||
<el-radio-group v-model="form.enabled" :disabled="form.id === user.id">
|
||||
<el-radio
|
||||
@@ -256,7 +259,7 @@ export default {
|
||||
])
|
||||
},
|
||||
created() {
|
||||
this.crud.msg.add = '新增成功,默认密码:123456'
|
||||
this.crud.msg.add = '新增成功'
|
||||
},
|
||||
mounted: function() {
|
||||
const that = this
|
||||
|
||||
Reference in New Issue
Block a user