设备修改
This commit is contained in:
@@ -53,16 +53,6 @@ public class DeviceServiceImpl implements DeviceService {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public DeviceDto findById(String device_code) {
|
|
||||||
WQLObject wo = WQLObject.getWQLObject("pdm_bi_device");
|
|
||||||
JSONObject json = wo.query("device_code = '" + device_code + "'").uniqueResult(0);
|
|
||||||
if (ObjectUtil.isNotEmpty(json)){
|
|
||||||
return json.toJavaObject( DeviceDto.class);
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public DeviceDto findByCode(String code) {
|
public DeviceDto findByCode(String code) {
|
||||||
WQLObject wo = WQLObject.getWQLObject("pdm_bi_device");
|
WQLObject wo = WQLObject.getWQLObject("pdm_bi_device");
|
||||||
@@ -94,7 +84,7 @@ public class DeviceServiceImpl implements DeviceService {
|
|||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void update(DeviceDto dto) {
|
public void update(DeviceDto dto) {
|
||||||
DeviceDto entity = this.findById(dto.getDevice_code());
|
DeviceDto entity = this.findByCode(dto.getDevice_code());
|
||||||
if (entity == null) throw new BadRequestException("被删除或无权限,操作失败!");
|
if (entity == null) throw new BadRequestException("被删除或无权限,操作失败!");
|
||||||
|
|
||||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||||
@@ -121,19 +111,9 @@ public class DeviceServiceImpl implements DeviceService {
|
|||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void deleteAll(String[] ids) {
|
public void deleteAll(String[] ids) {
|
||||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
|
||||||
String nickName = SecurityUtils.getCurrentNickName();
|
|
||||||
|
|
||||||
|
|
||||||
WQLObject wo = WQLObject.getWQLObject("pdm_bi_device");
|
WQLObject wo = WQLObject.getWQLObject("pdm_bi_device");
|
||||||
for (String device_code: ids) {
|
for (String device_code: ids) {
|
||||||
JSONObject param = new JSONObject();
|
wo.delete("device_code = '" + device_code + "'");
|
||||||
param.put("device_code", String.valueOf(device_code));
|
|
||||||
param.put("is_delete", "1");
|
|
||||||
param.put("update_optid", currentUserId);
|
|
||||||
param.put("update_optname", nickName);
|
|
||||||
param.put("update_time", DateUtil.now());
|
|
||||||
wo.update(param);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user