Browse Source

点检计划功能修复

2024年8月26日16:52:30
thing_master
lishuai 1 year ago
parent
commit
2f835b8d26
  1. 26
      modules/equipment/src/main/java/com/thing/eq/eqcheck/controller/EqSpotCheckPlanController.java
  2. 5
      modules/equipment/src/main/java/com/thing/eq/eqcheck/dto/EqCheckStandardDetailDTO.java
  3. 4
      modules/equipment/src/main/java/com/thing/eq/eqcheck/dto/EqSpotCheckPlanDTO.java
  4. 1
      modules/thing/src/main/java/com/thing/sys/tenant/service/impl/SysTenantDetailServiceImpl.java

26
modules/equipment/src/main/java/com/thing/eq/eqcheck/controller/EqSpotCheckPlanController.java

@ -90,9 +90,7 @@ public class EqSpotCheckPlanController {
if (CollectionUtil.isNotEmpty(planDTOS)) { if (CollectionUtil.isNotEmpty(planDTOS)) {
StringBuilder stringBuilder = new StringBuilder(); StringBuilder stringBuilder = new StringBuilder();
planDTOS.forEach(eqSpotCheckPlanDTO -> { planDTOS.forEach(eqSpotCheckPlanDTO -> {
iotThingBaseInfoService.getThingInfo(eqSpotCheckPlanDTO, eqSpotCheckPlanDTO.getThingId(), null, "0", String.valueOf(params.get("relationTypeId"))); iotThingBaseInfoService.getThingInfo(eqSpotCheckPlanDTO, eqSpotCheckPlanDTO.getThingId(), null, "0", String.valueOf(params.get("relationTypeId")));
List<Long> standardList = new ArrayList<>(); List<Long> standardList = new ArrayList<>();
List<EqCheckSettingDTO> settingList = eqCheckSettingService.getSettingList(eqSpotCheckPlanDTO.getThingId(), "0"); List<EqCheckSettingDTO> settingList = eqCheckSettingService.getSettingList(eqSpotCheckPlanDTO.getThingId(), "0");
if (CollectionUtil.isNotEmpty(settingList)) { if (CollectionUtil.isNotEmpty(settingList)) {
@ -100,25 +98,24 @@ public class EqSpotCheckPlanController {
EqCheckStandardDTO eqCheckStandardDTO = eqCheckStandardService.getByIdAs(eqCheckSettingDTO.getStandardId(),EqCheckStandardDTO.class); EqCheckStandardDTO eqCheckStandardDTO = eqCheckStandardService.getByIdAs(eqCheckSettingDTO.getStandardId(),EqCheckStandardDTO.class);
if (!Objects.isNull(eqCheckStandardDTO)) { if (!Objects.isNull(eqCheckStandardDTO)) {
standardList.add(eqCheckStandardDTO.getId()); standardList.add(eqCheckStandardDTO.getId());
stringBuilder.append(eqCheckStandardDTO.getName() + ",");
stringBuilder.append(eqCheckStandardDTO.getName()).append(",");
} }
}); });
eqSpotCheckPlanDTO.setEqCode(eqSpotCheckPlanDTO.getThingCode());
eqSpotCheckPlanDTO.setCheckIdList(standardList); eqSpotCheckPlanDTO.setCheckIdList(standardList);
eqSpotCheckPlanDTO.setCheckNameList(stringBuilder.length() > 0 ? stringBuilder.toString().substring(0, stringBuilder.length() - 1) : "");
eqSpotCheckPlanDTO.setCheckNameList(!stringBuilder.isEmpty() ? stringBuilder.substring(0, stringBuilder.length() - 1) : "");
stringBuilder.setLength(0); stringBuilder.setLength(0);
} }
List<String> useIdList = StringUtils.isNotBlank(eqSpotCheckPlanDTO.getUseId()) ? Arrays.asList(eqSpotCheckPlanDTO.getUseId().split(",")) : new ArrayList<>(); List<String> useIdList = StringUtils.isNotBlank(eqSpotCheckPlanDTO.getUseId()) ? Arrays.asList(eqSpotCheckPlanDTO.getUseId().split(",")) : new ArrayList<>();
if (CollectionUtil.isNotEmpty(useIdList)) { if (CollectionUtil.isNotEmpty(useIdList)) {
useIdList.forEach(idStr -> { useIdList.forEach(idStr -> {
SysUserDTO sysUserDTO = sysUserService.get(Long.parseLong(idStr)); SysUserDTO sysUserDTO = sysUserService.get(Long.parseLong(idStr));
if (!Objects.isNull(sysUserDTO)) { if (!Objects.isNull(sysUserDTO)) {
stringBuilder.append(sysUserDTO.getRealName() + ",");
stringBuilder.append(sysUserDTO.getRealName()).append(",");
} }
}); });
eqSpotCheckPlanDTO.setUseIdList(useIdList); eqSpotCheckPlanDTO.setUseIdList(useIdList);
eqSpotCheckPlanDTO.setOperatorNameList(stringBuilder.length() > 0 ? stringBuilder.toString().substring(0, stringBuilder.length() - 1) : "");
eqSpotCheckPlanDTO.setOperatorNameList(!stringBuilder.isEmpty() ? stringBuilder.substring(0, stringBuilder.length() - 1) : "");
stringBuilder.setLength(0); stringBuilder.setLength(0);
} }
}); });
@ -139,9 +136,9 @@ public class EqSpotCheckPlanController {
} }
iotThingBaseInfoService.getThingInfo(data, data.getThingId(), null, "0", relationTypeId); iotThingBaseInfoService.getThingInfo(data, data.getThingId(), null, "0", relationTypeId);
data.setEqCode(data.getThingCode());
StringBuilder stringBuilder = new StringBuilder(); StringBuilder stringBuilder = new StringBuilder();
List<EqCheckSettingDTO> settingList = eqCheckSettingService.getSettingList(data.getThingId(), "0"); List<EqCheckSettingDTO> settingList = eqCheckSettingService.getSettingList(data.getThingId(), "0");
if (CollectionUtil.isNotEmpty(settingList)) { if (CollectionUtil.isNotEmpty(settingList)) {
List<DataVo> standardList = new ArrayList<>(); List<DataVo> standardList = new ArrayList<>();
List<Long> standardIdList = new ArrayList<>(); List<Long> standardIdList = new ArrayList<>();
@ -153,29 +150,26 @@ public class EqSpotCheckPlanController {
dataVo.setName(eqCheckStandardDTO.getName()); dataVo.setName(eqCheckStandardDTO.getName());
standardIdList.add(eqCheckStandardDTO.getId()); standardIdList.add(eqCheckStandardDTO.getId());
standardList.add(dataVo); standardList.add(dataVo);
stringBuilder.append(eqCheckStandardDTO.getName() + ",");
stringBuilder.append(eqCheckStandardDTO.getName()).append(",");
} }
}); });
data.setCheckIdList(standardIdList); data.setCheckIdList(standardIdList);
data.setDataList(standardList); data.setDataList(standardList);
data.setCheckNameList(stringBuilder.length() > 0 ? stringBuilder.toString().substring(0, stringBuilder.length() - 1) : "");
data.setCheckNameList(!stringBuilder.isEmpty() ? stringBuilder.substring(0, stringBuilder.length() - 1) : "");
stringBuilder.setLength(0); stringBuilder.setLength(0);
} }
List<String> useIdList = StringUtils.isNotBlank(data.getUseId()) ? Arrays.asList(data.getUseId().split(",")) : new ArrayList<>(); List<String> useIdList = StringUtils.isNotBlank(data.getUseId()) ? Arrays.asList(data.getUseId().split(",")) : new ArrayList<>();
if (CollectionUtil.isNotEmpty(useIdList)) { if (CollectionUtil.isNotEmpty(useIdList)) {
useIdList.forEach(idStr -> { useIdList.forEach(idStr -> {
SysUserDTO sysUserDTO = sysUserService.get(Long.parseLong(idStr)); SysUserDTO sysUserDTO = sysUserService.get(Long.parseLong(idStr));
if (!Objects.isNull(sysUserDTO)) { if (!Objects.isNull(sysUserDTO)) {
stringBuilder.append(sysUserDTO.getRealName() + ",");
stringBuilder.append(sysUserDTO.getRealName()).append(",");
} }
}); });
data.setUseIdList(useIdList); data.setUseIdList(useIdList);
data.setOperatorNameList(stringBuilder.length() > 0 ? stringBuilder.toString().substring(0, stringBuilder.length() - 1) : "");
data.setOperatorNameList(!stringBuilder.isEmpty() ? stringBuilder.substring(0, stringBuilder.length() - 1) : "");
} }
List<EqCheckStandardDetailDTO> detailDTOS = eqCheckStandardDetailService.getAllStandardDetailByThingId(data.getThingId(), "0"); List<EqCheckStandardDetailDTO> detailDTOS = eqCheckStandardDetailService.getAllStandardDetailByThingId(data.getThingId(), "0");
data.setDetailDTOS(detailDTOS); data.setDetailDTOS(detailDTOS);

5
modules/equipment/src/main/java/com/thing/eq/eqcheck/dto/EqCheckStandardDetailDTO.java

@ -3,7 +3,9 @@ package com.thing.eq.eqcheck.dto;
import com.thing.common.orm.dto.BaseDTO; import com.thing.common.orm.dto.BaseDTO;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serial;
import java.io.Serializable; import java.io.Serializable;
/** /**
@ -12,9 +14,12 @@ import java.io.Serializable;
* @author xiezw 806671840@qq.com * @author xiezw 806671840@qq.com
* @since 3.0 2021-09-22 * @since 3.0 2021-09-22
*/ */
@EqualsAndHashCode(callSuper = true)
@Data @Data
@Schema(description = "设备检查标准明细") @Schema(description = "设备检查标准明细")
public class EqCheckStandardDetailDTO extends BaseDTO implements Serializable { public class EqCheckStandardDetailDTO extends BaseDTO implements Serializable {
@Serial
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private Long id; private Long id;

4
modules/equipment/src/main/java/com/thing/eq/eqcheck/dto/EqSpotCheckPlanDTO.java

@ -4,8 +4,10 @@ import com.fasterxml.jackson.annotation.JsonFormat;
import com.thing.common.core.utils.DateTimeUtils; import com.thing.common.core.utils.DateTimeUtils;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serial;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
@ -16,9 +18,11 @@ import java.util.List;
* @author zy aa@aa,com * @author zy aa@aa,com
* @since 3.0 2021-10-12 * @since 3.0 2021-10-12
*/ */
@EqualsAndHashCode(callSuper = true)
@Data @Data
@Schema(description = "点检计划") @Schema(description = "点检计划")
public class EqSpotCheckPlanDTO extends ThingDTO implements Serializable { public class EqSpotCheckPlanDTO extends ThingDTO implements Serializable {
@Serial
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private Long id; private Long id;

1
modules/thing/src/main/java/com/thing/sys/tenant/service/impl/SysTenantDetailServiceImpl.java

@ -105,6 +105,7 @@ public class SysTenantDetailServiceImpl extends BaseServiceImpl<SysTenantDetailM
//转换成like //转换成like
params.put("tenantType", StringUtils.isNotBlank((String) params.get("tenantType")) params.put("tenantType", StringUtils.isNotBlank((String) params.get("tenantType"))
? Integer.valueOf((String) params.get("tenantType")) : null); ? Integer.valueOf((String) params.get("tenantType")) : null);
//构建分页对象
Page<SysTenantDetailDTO> page = getPage(params, SysTenantDetailDTO.class); Page<SysTenantDetailDTO> page = getPage(params, SysTenantDetailDTO.class);
//不为超管时查询自己下属 //不为超管时查询自己下属
sysTenantGroupService.paramsAddTenantCodeList(params, true); sysTenantGroupService.paramsAddTenantCodeList(params, true);

Loading…
Cancel
Save