Browse Source

Merge remote-tracking branch 'origin/develop' into develop

tags/V1.3.3^2
suqin 11 months ago
parent
commit
04d53321ae
5 changed files with 11 additions and 29 deletions
  1. +1
    -1
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/controller/InspectionFileController.java
  2. +0
    -2
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/controller/IotEquipmentController.java
  3. +0
    -5
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/request/iotequipment/QueryIotEquipmentPageListRequest.java
  4. +1
    -1
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspectionfile/export/ExportInspectionFileByIdListService.java
  5. +9
    -20
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/iotequipment/query/QueryEditIotEquipmentPageListService.java

+ 1
- 1
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/controller/InspectionFileController.java View File

@@ -153,7 +153,7 @@ public class InspectionFileController {
* @param request
* @return
*/
@GetMapping("/export")
@PostMapping("/export")
public void exportExcleByIdList(HttpServletResponse response, ExportInspectionFileRequest request) {
iInspectionFileService.exportExcle(response, request);
}

+ 0
- 2
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/controller/IotEquipmentController.java View File

@@ -83,6 +83,4 @@ public class IotEquipmentController {
return iotEquipmentService.isEnabled(id,status);
}



}

+ 0
- 5
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/request/iotequipment/QueryIotEquipmentPageListRequest.java View File

@@ -20,11 +20,6 @@ public class QueryIotEquipmentPageListRequest extends BaseQuery {
*/
private String tenantId;

/**
* 部门Id
*/
private String deptId;

/**
* 公路名称
*/

+ 1
- 1
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspectionfile/export/ExportInspectionFileByIdListService.java View File

@@ -86,7 +86,7 @@ public class ExportInspectionFileByIdListService {
return JsonResult.success();
}

String fileName = inspection.getCode() + "-疑似问题清单.xlsx";
String fileName = "疑似问题清单 - " + inspection.getCode() + ".xlsx";
String filePath = UploadFileConfig.uploadFolder + "inspection_file/" + fileName;
File fd = new File(UploadFileConfig.uploadFolder + "inspection_file");
if (!fd.exists()) {

+ 9
- 20
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/iotequipment/query/QueryEditIotEquipmentPageListService.java View File

@@ -15,13 +15,11 @@ import com.tuoheng.admin.request.iotequipment.QueryIotEquipmentPageListRequest;
import com.tuoheng.admin.utils.CurrentUserUtil;
import com.tuoheng.admin.vo.IotEquipmentVo;
import com.tuoheng.common.core.utils.JsonResult;
import com.tuoheng.common.core.utils.StringUtils;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.function.Function;
@@ -57,7 +55,7 @@ public class QueryEditIotEquipmentPageListService {
}

// 获取部门Id的查询范围
List<String> deptIdList = this.getDeptIdList(user, user.getDeptId());
List<String> deptIdList = this.getDeptIdList(user);
request.setDeptIdList(deptIdList);
request.setTenantId(user.getTenantId());

@@ -94,21 +92,18 @@ public class QueryEditIotEquipmentPageListService {
/**
* 获取部门Id的查询范围
*
* @param deptId
* @return
*/
private List<String> getDeptIdList(User user, String deptId) {
private List<String> getDeptIdList(User user) {
List<String> deptIdList = new ArrayList<>();
if (!StringUtils.isEmpty(deptId)) {
deptIdList.add(deptId);
return deptIdList;
}
if (DataPermissionEnum.ALL.getCode() == user.getDataPermission()) {
return null;
} else {
deptIdList = deptMapper.selectAllChildListById(user.getDeptId());
return deptIdList;
} else if (DataPermissionEnum.DEPT_AND_SUB_DEPT.getCode() == user.getDataPermission()) {
deptIdList = deptMapper.selectAllChildListById(user.getDeptId());
} else if (DataPermissionEnum.DEPT.getCode() == user.getDataPermission()) {
deptIdList.add(user.getDeptId());
}
return deptIdList;
}

private List<IotEquipmentVo> buildIotEquipmentVoList(List<IotEquipment> iotEquipmentList) {
@@ -116,17 +111,14 @@ public class QueryEditIotEquipmentPageListService {
return null;
}
List<IotEquipmentVo> iotEquipmentVoList = IotEquipmentConverMapper.INSTANCE.fromIotEquipmentToIotEquipmentVoList(iotEquipmentList);

Map<String, Dept> deptMap = this.getDeptMap(iotEquipmentList);
Map<String, RoadInformation> roadInformationMap = this.getRoadInformationMap(iotEquipmentList);
Map<String, Section> sectionMap = this.getSectionMap(iotEquipmentList);
Map<String, User> userMap = this.getUserMap(iotEquipmentList);

Dept dept;
RoadInformation roadInformation;
Section section;
User user;

for (IotEquipmentVo iotEquipmentVo : iotEquipmentVoList) {
if (ObjectUtil.isNotEmpty(deptMap)) {
dept = deptMap.get(iotEquipmentVo.getDeptId());
@@ -156,12 +148,12 @@ public class QueryEditIotEquipmentPageListService {
}
}
}

return iotEquipmentVoList;
}

/**
* 获取用户列表,放到map,减少循环次数
*
* @param iotEquipmentList
* @return
*/
@@ -172,11 +164,11 @@ public class QueryEditIotEquipmentPageListService {
.eq(User::getMark, MarkEnum.VALID.getCode()));
Map<String, User> userMap = userList.stream().collect(Collectors.toMap(User::getId, Function.identity()));
return userMap;

}

/**
* 获取路段列表,放到map,减少循环次数
*
* @param iotEquipmentList
* @return
*/
@@ -187,8 +179,6 @@ public class QueryEditIotEquipmentPageListService {
.eq(Section::getMark, MarkEnum.VALID.getCode()));
Map<String, Section> sectionMap = sectionList.stream().collect(Collectors.toMap(Section::getId, Function.identity()));
return sectionMap;


}

/**
@@ -212,7 +202,6 @@ public class QueryEditIotEquipmentPageListService {
}

/**
*
* 获取公路列表,放到map,减少循环次数
*
* @param iotEquipmentList

Loading…
Cancel
Save