|
|
|
@ -86,7 +86,9 @@ public class DeviceStaticServiceImpl implements DeviceStaticService { |
|
|
|
|
EquipmentTypeVO typeVO = deviceTypeManager.findEquipmentType(detailVO.getTypeAndVerId()); |
|
|
|
|
|
|
|
|
|
EquipmentCustomerVO customerVO = customerManager.equipmentCustomer(detailVO.getCustomId()); |
|
|
|
|
|
|
|
|
|
if (customerVO==null){ |
|
|
|
|
customerVO = new EquipmentCustomerVO(); |
|
|
|
|
} |
|
|
|
|
detailVO.setDevOnline(IBaseEnum.getLabelByValue(detailVO.getDevOnline(), DevOnlineEnum.class)); |
|
|
|
|
detailVO.setDevStatus(IBaseEnum.getLabelByValue(detailVO.getDevStatus(), DevStatusEnum.class)); |
|
|
|
|
String devRemark4 = detailVO.getDevRemark4(); |
|
|
|
@ -176,6 +178,7 @@ public class DeviceStaticServiceImpl implements DeviceStaticService { |
|
|
|
|
fileRecord.setFileDesc(form.getFileDesc()); |
|
|
|
|
fileRecord.setUserName(SecurityUtils.getUsername()); |
|
|
|
|
fileRecord.setFileCreateTime(LocalDateTime.now()); |
|
|
|
|
fileRecord.setFileServId(1L); |
|
|
|
|
Long fileId = fileRecordManager.addPrivateProfile(fileRecord); |
|
|
|
|
|
|
|
|
|
FileDevMap fileDevMap = new FileDevMap(); |
|
|
|
@ -187,9 +190,44 @@ public class DeviceStaticServiceImpl implements DeviceStaticService { |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public Result<String> bindingCustom(Long customId, Long devId) { |
|
|
|
|
Customer customer = customerManager.findByCustomId(customId); |
|
|
|
|
if (customer==null){ |
|
|
|
|
return Result.failed(ResultCode.CUSTOM_NOT_FIND); |
|
|
|
|
} |
|
|
|
|
// Long count = deviceStaticMapper.countJoinDevVerDomain(devId,customer.getRegionAreaId());
|
|
|
|
|
// if(count==null || count!=1){
|
|
|
|
|
// return Result.failed(ResultCode.DEV_DOMAIN_MAP_NOT_FOUNT);
|
|
|
|
|
// }
|
|
|
|
|
deviceStaticMapper.update(null,new LambdaUpdateWrapper<DeviceStatic>() |
|
|
|
|
.eq(DeviceStatic::getDevId,devId) |
|
|
|
|
.set(DeviceStatic::getCustomId,customId) |
|
|
|
|
.set(customer.getCorpAreaId()!=null,DeviceStatic::getCorpAreaId,customer.getCorpAreaId()) |
|
|
|
|
.set(customer.getRegionAreaId()!=null,DeviceStatic::getRegionAreaId,customer.getRegionAreaId()) |
|
|
|
|
); |
|
|
|
|
return Result.success(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public Result<String> deleteDev(List<Long> ids) { |
|
|
|
|
if(ids.isEmpty()){ |
|
|
|
|
return Result.failed(ResultCode.IDS_IS_NULL); |
|
|
|
|
} |
|
|
|
|
for (Long devId: ids){ |
|
|
|
|
deviceStaticMapper.update(null,new LambdaUpdateWrapper<DeviceStatic>() |
|
|
|
|
.eq(DeviceStatic::getDevId,devId) |
|
|
|
|
.set(DeviceStatic::getDevStatus,DevStatusEnum.SIGN_OUT.getValue()) |
|
|
|
|
|
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
return Result.success(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public Result<String> unbindingCustom(Long devId) { |
|
|
|
|
deviceStaticMapper.update(null,new LambdaUpdateWrapper<DeviceStatic>() |
|
|
|
|
.eq(DeviceStatic::getDevId,devId) |
|
|
|
|
.set(DeviceStatic::getDevModifyTime,LocalDateTime.now()) |
|
|
|
|
.set(DeviceStatic::getCustomId,null) |
|
|
|
|
); |
|
|
|
|
return Result.success(); |
|
|
|
|
} |
|
|
|
|