Browse Source

维修保养功能修复

2024年8月26日15:08:25
thing_master
lishuai 1 year ago
parent
commit
c95d97ee21
  1. 4
      common/orm/src/main/java/com/thing/common/orm/entity/BaseTenantEntity.java
  2. 44
      modules/equipment/src/main/java/com/thing/eq/eqbxwx/controller/EqWxPlanController.java
  3. 34
      modules/equipment/src/main/java/com/thing/eq/eqby/entity/EqByPlanPartEntity.java
  4. 6
      modules/equipment/src/main/java/com/thing/eq/eqby/entity/EqByTemplateEntity.java
  5. 51
      modules/equipment/src/main/java/com/thing/eq/eqby/service/impl/EqByPlanServiceImpl.java
  6. 5
      modules/equipment/src/main/java/com/thing/eq/eqcheck/controller/EqCheckStandardController.java
  7. 10
      modules/equipment/src/main/java/com/thing/eq/eqcheck/entity/EqPatrolCheckPlanEntity.java
  8. 11
      modules/equipment/src/main/java/com/thing/eq/eqcheck/entity/EqSpotCheckPlanEntity.java
  9. 28
      modules/equipment/src/main/java/com/thing/eq/eqcheck/service/impl/EqPatrolCheckPlanServiceImpl.java
  10. 3
      modules/equipment/src/main/java/com/thing/eq/eqcheck/service/impl/EqSpotCheckPlanServiceImpl.java
  11. 11
      modules/equipment/src/main/java/com/thing/eq/eqmanager/service/impl/IotThingBaseInfoServiceImpl.java
  12. 3
      modules/equipment/src/main/java/com/thing/eq/eqmanager/service/impl/IotThingsServiceImpl.java

4
common/orm/src/main/java/com/thing/common/orm/entity/BaseTenantEntity.java

@ -3,6 +3,8 @@ package com.thing.common.orm.entity;
import com.google.common.collect.Maps;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.KeyType;
import com.mybatisflex.core.keygen.KeyGenerators;
import lombok.Data;
import lombok.experimental.Accessors;
@ -26,7 +28,7 @@ public class BaseTenantEntity implements Serializable {
@Serial
private static final long serialVersionUID = 1536009703312548328L;
@Id
@Id(keyType = KeyType.Generator,value = KeyGenerators.snowFlakeId)
private Long id;
/*------------------------租户信息--------------------------------*/

44
modules/equipment/src/main/java/com/thing/eq/eqbxwx/controller/EqWxPlanController.java

@ -28,7 +28,6 @@ import com.thing.eq.file.service.FileService;
import com.thing.sys.biz.dto.SysDeptDTO;
import com.thing.sys.biz.dto.SysDictTypeListDTO;
import com.thing.sys.biz.entity.SysDictDataEntity;
import com.thing.sys.biz.entity.SysDictTypeEntity;
import com.thing.sys.biz.service.SysDeptService;
import com.thing.sys.biz.service.SysDictDataService;
import com.thing.sys.biz.service.SysDictTypeService;
@ -38,11 +37,13 @@ import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.servlet.http.HttpServletResponse;
import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import java.util.*;
import java.util.stream.Collectors;
@ -180,48 +181,52 @@ public class EqWxPlanController {
@Operation(summary = "信息")
// @RequiresPermissions("eqwxplan:eqwxplan:info")
public Result<EqWxInfoRes> get(@PathVariable("id") Long id, @PathVariable(value = "relationTypeId") Long relationTypeId) {
EqWxPlanDTO data = eqWxPlanService.getByIdAs(id,EqWxPlanDTO.class);
EqWxInfoRes data = eqWxPlanService.getByIdAs(id, EqWxInfoRes.class);
if (Objects.isNull(data)) {
throw new SysException("维修计划不存在");
}
EqWxInfoRes eqWxInfoRes = new EqWxInfoRes();
BeanUtils.copyProperties(data, eqWxInfoRes);
//
// EqWxInfoRes eqWxInfoRes = new EqWxInfoRes();
// BeanUtils.copyProperties(data, eqWxInfoRes);
// 查询设备信息
ThingDTO thingDTO = new ThingDTO();
iotThingBaseInfoService.getThingInfo(thingDTO, data.getThingId(), null, "1", String.valueOf(relationTypeId));
eqWxInfoRes.setBaseInfo(thingDTO);
ThingDTO thingInfo = iotThingBaseInfoService.getThingInfo(thingDTO, data.getThingId(), null, "1", String.valueOf(relationTypeId));
data.setBaseInfo(thingInfo);
//调整
String userId = data.getWxUser();
String[] split = userId.split(",");
if (ArrayUtils.isNotEmpty(split)) {
List<Long> longs = new ArrayList<>();
for (String s : split) {
if(StringUtils.isNotBlank(s)){
longs.add(Long.parseLong(s));
} List<String> planUserName = sysUserService.getUserNameLists(longs);
}
}
if(CollectionUtil.isNotEmpty(longs)){
List<String> planUserName = sysUserService.getUserNameLists(longs);
String name = "";
for (String s : planUserName) {
name += s + ",";
}
name = name.substring(0, name.length() - 1);
eqWxInfoRes.setWxUseText(name);
BxInfoDTO bxInfoDTO = new BxInfoDTO();
data.setWxUseText(name);
}
}
// 查询报修信息
EqBxEntity eqBxEntity = eqBxService.getById(data.getEqBxId());
if (!Objects.isNull(eqBxEntity)) {
BeanUtils.copyProperties(eqBxEntity, bxInfoDTO);
eqWxInfoRes.setBxInfo(bxInfoDTO);
BxInfoDTO bxInfoDTO = eqBxService.getByIdAs(data.getEqBxId(),BxInfoDTO.class);
if (!Objects.isNull(bxInfoDTO)) {
data.setBxInfo(bxInfoDTO);
Map<String, List<EqAttacmentDTO>> document = fileService.getDocument(data.getEqBxId());
bxInfoDTO.setImageUrls(document.get("image"));
bxInfoDTO.setAttachmentUrls(document.get("attachment"));
}
// 查询维修备件信息
eqWxInfoRes.setReplacements(eqWxReplacementService.getWxReplacementByWxPlanId(data.getId()));
data.setReplacements(eqWxReplacementService.getWxReplacementByWxPlanId(data.getId()));
return new Result<EqWxInfoRes>().ok(eqWxInfoRes);
return new Result<EqWxInfoRes>().ok(data);
}
@PostMapping
@ -359,7 +364,8 @@ public class EqWxPlanController {
List<Long> longs = new ArrayList<>();
for (String s : split) {
longs.add(Long.parseLong(s));
} List<String> planUserName = sysUserService.getUserNameLists(longs);
}
List<String> planUserName = sysUserService.getUserNameLists(longs);
String name = "";
for (String s : planUserName) {
name += s + ",";

34
modules/equipment/src/main/java/com/thing/eq/eqby/entity/EqByPlanPartEntity.java

@ -1,11 +1,15 @@
package com.thing.eq.eqby.entity;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.KeyType;
import com.mybatisflex.annotation.Table;
import com.thing.common.orm.entity.BaseDateEntity;
import com.mybatisflex.core.keygen.KeyGenerators;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serial;
import java.io.Serializable;
import java.util.Date;
/**
* 部件使用记录
@ -16,11 +20,37 @@ import java.io.Serial;
@Data
@EqualsAndHashCode(callSuper=false)
@Table("eq_by_plan_part")
public class EqByPlanPartEntity extends BaseDateEntity {
public class EqByPlanPartEntity implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
@Id(keyType = KeyType.Generator,value = KeyGenerators.snowFlakeId)
private Long id;
/*------------------------修改记录信息--------------------------------*/
/**
* 创建者
*/
private Long creator;
/**
* 创建时间
*/
private Date createDate;
/**
* 修改人
*/
private Long updater;
/**
* 修改时间
*/
private Date updateDate;
/**
* 更换数量
*/

6
modules/equipment/src/main/java/com/thing/eq/eqby/entity/EqByTemplateEntity.java

@ -5,6 +5,8 @@ import com.mybatisflex.annotation.Table;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serial;
import java.io.Serializable;
import java.util.Date;
/**
@ -16,7 +18,9 @@ import java.util.Date;
@Data
@EqualsAndHashCode(callSuper=false)
@Table("eq_by_template")
public class EqByTemplateEntity {
public class EqByTemplateEntity implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
@Id

51
modules/equipment/src/main/java/com/thing/eq/eqby/service/impl/EqByPlanServiceImpl.java

@ -1,6 +1,7 @@
package com.thing.eq.eqby.service.impl;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.map.MapUtil;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSON;
import com.mybatisflex.core.paginate.Page;
@ -23,7 +24,6 @@ import com.thing.eq.utils.SerialNumberUnit;
import com.thing.sys.biz.dto.SysDictTypeListDTO;
import com.thing.sys.biz.entity.SysDeptEntity;
import com.thing.sys.biz.entity.SysDictDataEntity;
import com.thing.sys.biz.entity.SysDictTypeEntity;
import com.thing.sys.biz.entity.SysUserEntity;
import com.thing.sys.biz.service.SysDeptService;
import com.thing.sys.biz.service.SysDictDataService;
@ -86,24 +86,36 @@ public class EqByPlanServiceImpl extends BaseServiceImpl<EqByPlanMapper, EqByPla
@Override
public QueryWrapper getWrapper(Map<String, Object> params) {
QueryWrapper wrapper = new QueryWrapper();
wrapper.eq(EqByPlanEntity::getTenantCode,UserContext.getRealTenantCode());
String byStatus = MapUtil.getStr(params, "byStatus");
wrapper.eq(EqByPlanEntity::getByStatus, byStatus,StringUtils::isNotBlank);
String by_user = MapUtil.getStr(params, "checkUserId");
wrapper.like(EqByPlanEntity::getByUser, by_user,StringUtils::isNotBlank);
String byNo = MapUtil.getStr(params, "byNo");
wrapper.like(EqByPlanEntity::getByNo, byNo,StringUtils::isNotBlank);
if (params.get("eqIds") != null) {
String eqIds = params.get("eqIds").toString();
List<Long> eqthingIds = Arrays.stream(eqIds.split(",")).map(s -> Long.parseLong(s.trim())).collect(Collectors.toList());
wrapper.in(EqByPlanEntity::getThingsId, eqthingIds,CollectionUtil.isNotEmpty(eqthingIds));
}
Long startTime = MapUtil.getLong(params, "startTime");
Long endTime = MapUtil.getLong(params, "endTime");
String relationTypeId = MapUtil.getStr(params, "relationTypeId");
return wrapper;
}
@Override
public PageData<EqByPlanDTO> page(Map<String, Object> params) {
Page<EqByPlanEntity> page = getPage(params);
int pageNumber = MapUtil.getInt(params, "page",1);
int pageSize = MapUtil.getInt(params, "limit",10);
// IPage<EqByPlanEntity> thingsEntityPage = baseDao.selectPage(page, getWrapper(params));
String eqIds;
List<Long> eqthingIds = new ArrayList<>();
if (params.get("eqIds") != null) {
eqIds = params.get("eqIds").toString();
eqthingIds = Arrays.stream(eqIds.split(",")).map(s -> Long.parseLong(s.trim())).collect(Collectors.toList());
params.put("eqIdList", eqthingIds);
}
params.put("tenantCode", TenantContext.getTenantCode(SecurityUser.getUser()));
Page<EqByPlanDTO> paginate = mapper.paginateAs(new Page<>(pageNumber, pageSize), getWrapper(params),EqByPlanDTO.class);
List<EqByPlanDTO> eqByPlansDTOS = paginate.getRecords();
String relationTypeId = params.get("relationTypeId").toString();
List<EqByPlanDTO> eqByPlansDTOS = eqByPlanDao.getListData(params);
for (EqByPlanDTO eqByPlansDTO : eqByPlansDTOS) {
EqInfo thingsInfo = iotThingsService.getThingInfo(eqByPlansDTO.getThingsId(),relationTypeId);
if (thingsInfo != null) {
@ -160,9 +172,13 @@ public class EqByPlanServiceImpl extends BaseServiceImpl<EqByPlanMapper, EqByPla
for (EqByPlanPartDTO eqpart : dto.getThingParts()) {
//调整
// eqpart.setEqByPlanId(id);
eqpart.setCreateDate(new Date());
eqpart.setUpdateDate(new Date());
eqpart.setCreator(SecurityUser.getUserId());
eqByParts.add(eqpart);
}
eqByPlanPartService.saveDto(ConvertUtils.sourceToTarget(eqByParts, EqByPlanPartEntity.class));
List<EqByPlanPartEntity> eqByPlanPartEntities = ConvertUtils.sourceToTarget(eqByParts, EqByPlanPartEntity.class);
eqByPlanPartService.saveBatch(eqByPlanPartEntities);
}
}
}
@ -197,13 +213,14 @@ public class EqByPlanServiceImpl extends BaseServiceImpl<EqByPlanMapper, EqByPla
//先删除保养计划更换部件
eqByPlanPartService.deleteByEqByPlanId(dto.getId());
//保存保养计划部件
List<EqByPlanPartDTO> eqByParts = new ArrayList<>();
List<EqByPlanPartEntity> eqByParts = new ArrayList<>();
if (CollectionUtil.isNotEmpty(dto.getThingParts())) {
for (EqByPlanPartDTO eqpart : dto.getThingParts()) {
eqpart.setEqByPlanId(dto.getId());
eqByParts.add(eqpart);
EqByPlanPartEntity eqByPlanPartEntity = ConvertUtils.sourceToTarget(eqpart, EqByPlanPartEntity.class);
eqByPlanPartEntity.setEqByPlanId(dto.getId());
eqByParts.add(eqByPlanPartEntity);
}
eqByPlanPartService.saveDto(ConvertUtils.sourceToTarget(eqByParts, EqByPlanPartEntity.class));
eqByPlanPartService.saveBatch(ConvertUtils.sourceToTarget(eqByParts, EqByPlanPartEntity.class));
}
}

5
modules/equipment/src/main/java/com/thing/eq/eqcheck/controller/EqCheckStandardController.java

@ -21,6 +21,7 @@ import com.thing.eq.eqcheck.excel.EqCheckStandardExcel;
import com.thing.eq.eqcheck.service.EqCheckSettingService;
import com.thing.eq.eqcheck.service.EqCheckStandardDetailService;
import com.thing.eq.eqcheck.service.EqCheckStandardService;
import com.thing.sys.security.context.UserContext;
import com.thing.sys.security.domain.SecurityUser;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
@ -139,15 +140,13 @@ public class EqCheckStandardController {
if (CollectionUtil.isEmpty(detailDTOS)) {
throw new SysException("请添加模板检查项");
}
dto.setTenantCode(SecurityUser.getTenantCode());
dto.setTenantCode(UserContext.getRealTenantCode());
dto.setCreateDate(new Date());
eqCheckStandardService.saveDto(dto);
// if (Objects.isNull(dto.getId())) {
// throw new SysException("保存失败");
// }
for (EqCheckStandardDetailDTO detail : detailDTOS) {
if ("0".equals(detail.getType()) && (StringUtils.isBlank(detail.getLowerLimit()) || StringUtils.isBlank(detail.getUpperLimit()))) {
throw new SysException("标准细项为上下限判定类型时,上下限值不能为空");

10
modules/equipment/src/main/java/com/thing/eq/eqcheck/entity/EqPatrolCheckPlanEntity.java

@ -1,10 +1,14 @@
package com.thing.eq.eqcheck.entity;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.KeyType;
import com.mybatisflex.annotation.Table;
import com.mybatisflex.core.keygen.KeyGenerators;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serial;
import java.io.Serializable;
import java.util.Date;
/**
@ -16,13 +20,15 @@ import java.util.Date;
@Data
@EqualsAndHashCode(callSuper = false)
@Table("eq_patrol_check_plan")
public class EqPatrolCheckPlanEntity {
public class EqPatrolCheckPlanEntity implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* id
*/
@Id
@Id(keyType = KeyType.Generator,value = KeyGenerators.snowFlakeId)
private Long id;
/**
* 创建人

11
modules/equipment/src/main/java/com/thing/eq/eqcheck/entity/EqSpotCheckPlanEntity.java

@ -1,10 +1,14 @@
package com.thing.eq.eqcheck.entity;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.KeyType;
import com.mybatisflex.annotation.Table;
import com.mybatisflex.core.keygen.KeyGenerators;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serial;
import java.io.Serializable;
import java.util.Date;
/**
@ -16,10 +20,13 @@ import java.util.Date;
@Data
@EqualsAndHashCode(callSuper=false)
@Table("eq_spot_check_plan")
public class EqSpotCheckPlanEntity {
public class EqSpotCheckPlanEntity implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
@Id
@Id(keyType = KeyType.Generator,value = KeyGenerators.snowFlakeId)
private Long id;
/**
* 设备thingid

28
modules/equipment/src/main/java/com/thing/eq/eqcheck/service/impl/EqPatrolCheckPlanServiceImpl.java

@ -27,6 +27,7 @@ import com.thing.eq.equsergroup.dto.EqUserGroupDTO;
import com.thing.eq.equsergroup.service.EqUserGroupService;
import com.thing.eq.utils.SerialNumberUnit;
import com.thing.sys.security.context.TenantContext;
import com.thing.sys.security.context.UserContext;
import com.thing.sys.security.domain.SecurityUser;
import com.thing.thing.entity.dto.IotThingEntityDTO;
import com.thing.thing.entity.entity.IotThingEntity;
@ -631,26 +632,25 @@ public class EqPatrolCheckPlanServiceImpl extends BaseServiceImpl<EqPatrolCheckP
QueryWrapper queryWrapper = new QueryWrapper();
queryWrapper.orderBy("patrol_check_plan_no",false);
EqPatrolCheckPlanEntity planEntity = mapper.selectOneExt(queryWrapper);
if (Objects.isNull(planEntity)) {
planEntity = new EqPatrolCheckPlanEntity();
}
String lastNo = SerialNumberUnit.generateNumber("XJ", planEntity.getPatrolCheckPlanNo());
dto.setPatrolCheckPlanNo(lastNo);
saveDto(dto);
if (Objects.isNull(dto.getId())) {
dto.setTenantCode(UserContext.getRealTenantCode());
dto.setCreateDate(new Date());
dto.setUpdateDate(new Date());
EqPatrolCheckPlanEntity eqPatrolCheckPlanEntity = ConvertUtils.sourceToTarget(dto, EqPatrolCheckPlanEntity.class);
mapper.insert(eqPatrolCheckPlanEntity);
if (Objects.isNull(eqPatrolCheckPlanEntity.getId())) {
throw new SysException("巡检计划保存失败");
}
saveDeviceList(dto.getId(), dto.getDeviceBaseInfoDTOS());
saveDeviceList(eqPatrolCheckPlanEntity.getId(), dto.getDeviceBaseInfoDTOS());
}
public void saveDeviceList(Long checkPlanId, List<DeviceBaseInfoDTO> deviceBaseInfoDTOS) {
for (DeviceBaseInfoDTO deviceInfo : deviceBaseInfoDTOS) {
eqScrapService.checkThingStatus(deviceInfo.getThingId());
List<Long> standardDTOS = deviceInfo.getStandardIdList();
//todo
if (CollectionUtil.isEmpty(standardDTOS)) {
@ -665,12 +665,12 @@ public class EqPatrolCheckPlanServiceImpl extends BaseServiceImpl<EqPatrolCheckP
}
for (Long standardId : standardDTOS) {
EqCheckSettingEntity eqCheckSettingDTO = new EqCheckSettingEntity();
eqCheckSettingDTO.setThingId(deviceInfo.getThingId());
eqCheckSettingDTO.setStandardId(standardId);
eqCheckSettingDTO.setType("1");
eqCheckSettingDTO.setPatrolcheckPlanId(checkPlanId);
eqCheckSettingService.saveDto(eqCheckSettingDTO);
EqCheckSettingEntity eqCheckSettingEntity = new EqCheckSettingEntity();
eqCheckSettingEntity.setThingId(deviceInfo.getThingId());
eqCheckSettingEntity.setStandardId(standardId);
eqCheckSettingEntity.setType("1");
eqCheckSettingEntity.setPatrolcheckPlanId(checkPlanId);
eqCheckSettingService.save(eqCheckSettingEntity);
}
}
}

3
modules/equipment/src/main/java/com/thing/eq/eqcheck/service/impl/EqSpotCheckPlanServiceImpl.java

@ -17,6 +17,7 @@ import com.thing.eq.eqcheck.service.EqSpotCheckRecordService;
import com.thing.eq.eqmanager.service.EqScrapService;
import com.thing.eq.utils.SerialNumberUnit;
import com.thing.sys.security.context.TenantContext;
import com.thing.sys.security.context.UserContext;
import com.thing.sys.security.domain.SecurityUser;
import com.thing.thing.entity.dto.IotThingEntityDTO;
import com.thing.thing.entity.service.IotThingEntityService;
@ -106,7 +107,7 @@ public class EqSpotCheckPlanServiceImpl extends BaseServiceImpl<EqSpotCheckPlanM
EqSpotCheckPlanEntity eqSpotCheckPlanEntity = new EqSpotCheckPlanEntity();
BeanUtils.copyProperties(dto, eqSpotCheckPlanEntity);
eqSpotCheckPlanEntity.setThingId(thingId);
eqSpotCheckPlanEntity.setTenantCode(SecurityUser.getTenantCode());
eqSpotCheckPlanEntity.setTenantCode(UserContext.getRealTenantCode());
eqSpotCheckPlanEntity.setSpotCheckNo(lastNo);
saveDto(eqSpotCheckPlanEntity);
// if (Objects.isNull(eqSpotCheckPlanEntity.getId())) {

11
modules/equipment/src/main/java/com/thing/eq/eqmanager/service/impl/IotThingBaseInfoServiceImpl.java

@ -31,7 +31,6 @@ import com.thing.thing.entity.service.IotThingEntityService;
import com.thing.thing.relation.detail.entity.IotThingRelationDetailEntity;
import com.thing.thing.relation.detail.service.IotThingRelationDetailService;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.ss.formula.functions.T;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -136,8 +135,8 @@ public class IotThingBaseInfoServiceImpl extends BaseServiceImpl<IotThingBaseInf
keyWord = params.get("keyWord").toString();
}
Long aLong = null;
if(!Objects.isNull(params.get("useDeptId"))){
String useDeptId = params.get("useDeptId").toString();
String useDeptId = (String) params.get("useDeptId");
if(StringUtils.isNotBlank(useDeptId)){
aLong = new Long(useDeptId);
}
List<EqDTO> eqDTOS = iotThingBaseInfoDao.queryDeviceListByThingsId(new Page<>(page, limit), params,aLong,aLong1,aLong2,eqTypeName,keyWord);
@ -150,7 +149,7 @@ public class IotThingBaseInfoServiceImpl extends BaseServiceImpl<IotThingBaseInf
@Override
public ThingDTO getThingInfo(ThingDTO thingDTO, Long thingId, List<EqCheckSettingDTO> settingList, String showDeviceType, String relationTypeId) {
IotThingBaseInfoDTO baseThing = iotThingBaseInfoService.getByThingsId(thingId);
IotThingBaseInfoDTO baseThing = iotThingBaseInfoService.getByIdAs(thingId,IotThingBaseInfoDTO.class);
EqScrapEntity eqScrapEntity = eqScrapService.getByEqId(thingId);
if(!Objects.isNull(eqScrapEntity)){
@ -198,9 +197,9 @@ public class IotThingBaseInfoServiceImpl extends BaseServiceImpl<IotThingBaseInf
StringBuilder stringBuilder = new StringBuilder();
List<EqCheckStandardDTO> standardList = eqCheckStandardService.getStandardListByStandardIdList(standardIdList);
standardList.forEach(standard -> {
stringBuilder.append(standard.getName() + ",");
stringBuilder.append(standard.getName()).append(",");
});
thingDTO.setStandardNameList(stringBuilder.length() > 0 ? stringBuilder.toString().substring(0, stringBuilder.length() - 1) : "");
thingDTO.setStandardNameList(!stringBuilder.isEmpty() ? stringBuilder.substring(0, stringBuilder.length() - 1) : "");
}
}

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

@ -453,13 +453,14 @@ public class IotThingsServiceImpl implements IotThingsService {
result.setCode(eq.getCode());
result.setName(eq.getName());
IotThingBaseInfoDTO baseInfoDTO = iotThingBaseInfoService.getByThingsId(thingId);
if(!Objects.isNull(baseInfoDTO)){
result.setStandard(baseInfoDTO.getStandard());
result.setUseDeptId(baseInfoDTO.getUseDeptId());
result.setEqCode(baseInfoDTO.getEqCode());
result.setScrap(baseInfoDTO.getScrap());
result.setScrapDisposal(baseInfoDTO.getScrapDisposal());
}
return result;
// return iotThingsDao.getThingInfo(thingId,relationTypeId);
}
@Override

Loading…
Cancel
Save