Merge branch 'dev'

This commit is contained in:
wangliwen 2022-10-09 09:01:38 +08:00
commit 286df76ec3
4 changed files with 15 additions and 12 deletions

View File

@ -84,7 +84,7 @@ public class ResourceCarController {
@ApiOperation("批量添加申购车") @ApiOperation("批量添加申购车")
@LogOperation(value = "批量添加申购车", operationTable = "tb_resource_car;") @LogOperation(value = "批量添加申购车", operationTable = "tb_resource_car;")
public Result save(@RequestBody List<ResourceCarDTO> dtoList) { public Result save(@RequestBody List<ResourceCarDTO> dtoList) {
dtoList.stream().forEach(dto->resourceCarService.insertOrUpdate(dto)); dtoList.stream().forEach(dto -> resourceCarService.insertOrUpdate(dto));
return new Result(); return new Result();
} }

View File

@ -40,13 +40,13 @@ public interface ResourceCarDao extends BaseDao<ResourceCarEntity> {
Integer selectProvideDeptCount(@Param("userId") Long userId, @Param("name") String name); Integer selectProvideDeptCount(@Param("userId") Long userId, @Param("name") String name);
List<Map> selectInfrastructureCarGroupByDept(@Param("userId") Long userId, List<Map> selectInfrastructureCarGroupByDept(@Param("userId") Long userId,
@Param("pageNum") Integer pageNum, @Param("pageNum") Integer pageNum,
@Param("pageSize") Integer pageSize, @Param("pageSize") Integer pageSize,
@Param("name") String name); @Param("name") String name);
List<Map> selectInfrastructureListByDept(@Param("name") String name, List<Map> selectInfrastructureListByDept(@Param("name") String name,
@Param("userId") Long userId, @Param("userId") Long userId,
@Param("deptId") Long deptId, @Param("deptId") Long deptId,
@Param("pageNum") Integer pageNum, @Param("pageNum") Integer pageNum,
@Param("pageSize") Integer pageSize); @Param("pageSize") Integer pageSize);
} }

View File

@ -119,7 +119,7 @@ public class ResourceCarServiceImpl extends CrudServiceImpl<ResourceCarDao, Reso
case TSINGTAO_XHA: { case TSINGTAO_XHA: {
List<Map> maps = resourceCarDao.selectInfrastructureCarGroupByDept(userId, (pageNum - 1) * pageSize, pageSize, name); List<Map> maps = resourceCarDao.selectInfrastructureCarGroupByDept(userId, (pageNum - 1) * pageSize, pageSize, name);
resultMap.put("list", maps); resultMap.put("list", maps);
resultMap.put("deptCount", maps.stream().collect(Collectors.groupingBy(it->it.get("deptId"))).size()); resultMap.put("deptCount", maps.stream().collect(Collectors.groupingBy(it -> it.get("deptId"))).size());
} }
break; break;
} }
@ -129,7 +129,7 @@ public class ResourceCarServiceImpl extends CrudServiceImpl<ResourceCarDao, Reso
@Override @Override
public Object selectResourceListByDept(String name, Long deptId, Integer pageNum, Integer pageSize) { public Object selectResourceListByDept(String name, Long deptId, Integer pageNum, Integer pageSize) {
Long userId = SecurityUser.getUserId(); Long userId = SecurityUser.getUserId();
List<Map> result=new ArrayList<>(); List<Map> result = new ArrayList<>();
switch (Constant.ProjectPlace.getByFlag(projectPlace)) { switch (Constant.ProjectPlace.getByFlag(projectPlace)) {
case TSINGTAO: { case TSINGTAO: {
result.addAll(resourceCarDao.selectResourceListByDept(name, userId, deptId, (pageNum - 1) * pageSize, pageSize)); result.addAll(resourceCarDao.selectResourceListByDept(name, userId, deptId, (pageNum - 1) * pageSize, pageSize));

View File

@ -88,7 +88,8 @@
dept.name AS "deptName", dept.name AS "deptName",
COUNT(car.id) AS "count" COUNT(car.id) AS "count"
FROM FROM
(select del_flag, user_id, json_extract(note1, '$[0].idtCameraChannel') as id, TRIM(BOTH '"' FROM json_extract(note1, '$[0].managementUnitName')) as dept_name, json_extract(note1, '$[0].channelName') as name (select del_flag, user_id, json_extract(note1, '$[0].idtCameraChannel') as id, TRIM(BOTH '"' FROM
json_extract(note1, '$[0].managementUnitName')) as dept_name, json_extract(note1, '$[0].channelName') as name
from tb_resource_car where note1 IS NOT NULL) car, from tb_resource_car where note1 IS NOT NULL) car,
sys_dept dept sys_dept dept
WHERE car.user_id = #{userId} WHERE car.user_id = #{userId}
@ -162,7 +163,9 @@
car.note1, car.note1,
car.create_date AS "time" car.create_date AS "time"
FROM FROM
(select del_flag, user_id, note1, create_date, resource_id, json_extract(note1, '$[0].idtCameraChannel') as id, TRIM(BOTH '"' FROM json_extract(note1, '$[0].managementUnitName')) as dept_name, json_extract(note1, '$[0].channelName') as name (select del_flag, user_id, note1, create_date, resource_id, json_extract(note1, '$[0].idtCameraChannel') as id,
TRIM(BOTH '"' FROM json_extract(note1, '$[0].managementUnitName')) as dept_name, json_extract(note1,
'$[0].channelName') as name
from tb_resource_car where note1 IS NOT NULL) car from tb_resource_car where note1 IS NOT NULL) car
left join sys_dept dept on car.dept_name=dept.name left join sys_dept dept on car.dept_name=dept.name
WHERE 1 = 1 WHERE 1 = 1