Browse Source

设备台账管理物关系的调整

2024年8月23日17:08:55
thing_master
lishuai 1 year ago
parent
commit
2da0b65971
  1. 3
      modules/equipment/src/main/java/com/thing/eq/eqbxwx/service/impl/EqBxServiceImpl.java
  2. 15
      modules/equipment/src/main/java/com/thing/eq/eqmanager/service/impl/IotThingsServiceImpl.java

3
modules/equipment/src/main/java/com/thing/eq/eqbxwx/service/impl/EqBxServiceImpl.java

@ -28,6 +28,7 @@ import com.thing.sys.biz.mapper.SysDeptMapper;
import com.thing.sys.biz.mapper.SysUserMapper;
import com.thing.sys.biz.service.SysUserService;
import com.thing.sys.security.context.TenantContext;
import com.thing.sys.security.context.UserContext;
import com.thing.sys.security.domain.SecurityUser;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
@ -256,7 +257,7 @@ public class EqBxServiceImpl extends BaseServiceImpl<EqBxMapper, EqBxEntity> imp
lastNo = SerialNumberUnit.generateNumber("BX", eqBxEntity.getBxNo());
dto.setBxNo(lastNo);
dto.setTenantCode(SecurityUser.getTenantCode());
dto.setTenantCode(UserContext.getRealTenantCode());
// Long eqBxId = IdWorker.getId();
// dto.setId(eqBxId);

15
modules/equipment/src/main/java/com/thing/eq/eqmanager/service/impl/IotThingsServiceImpl.java

@ -393,9 +393,19 @@ public class IotThingsServiceImpl implements IotThingsService {
@Override
public EqDTO getInfo(Long id) {
EqDTO info = new EqDTO();
//获取设备
IotThingEntity eq = iotThingEntityDao.selectOneById(id);
IotThingBaseInfoEntity baseInfoEntity = iotThingBaseInfoService.getById(id);
if (baseInfoEntity==null){
return null;
}
Long thingId = baseInfoEntity.getThingId();
if (thingId==null){
return null;
}
IotThingEntity eq = iotThingEntityDao.selectOneById(thingId);
if (eq==null){
return null;
}
@ -411,8 +421,7 @@ public class IotThingsServiceImpl implements IotThingsService {
info.setUpdateDate(eq.getUpdateDate());
// BeanUtils.copyProperties(eq,info);
//获取设备基础信息
IotThingBaseInfoDTO baseInfoDTO = iotThingBaseInfoService.getByThingsId(id);
BeanUtils.copyProperties(baseInfoDTO,info);
BeanUtils.copyProperties(baseInfoEntity,info);
List<EqAttacmentDTO> imageUrls = new ArrayList<>();
List<EqAttacmentDTO> attachmentUrls = new ArrayList<>();

Loading…
Cancel
Save