Commit 100b1ee7 by 张晓

技术员中心点增加分站内所有区块数据

1 parent 4598058a
......@@ -41,6 +41,7 @@ public class EngineerCenterPoiController {
result.setGroup(engineerBusinessService.getGroupInfo(engineerReq));
result.setWarehouse(engineerBusinessService.getWareHouse(result.getGroup().getWarehouseId()));
result.setBlocks(engineerBusinessService.getBlocks(engineerReq));
res = Result.success(result);
} catch (BusinessException e) {
return Result.failed(e.getMessage());
......
......@@ -14,4 +14,6 @@ public interface MapBlockInfoDao extends JpaRepository<MapBlockInfoEntity, Integ
MapBlockInfoEntity findByBlockId(String blockId);
List<MapBlockInfoEntity> findByGroupId(String groupId);
}
......@@ -28,7 +28,7 @@ public class EngineerBusinessDTO {
private Group group;
private WareHouse warehouse;
// @JsonIgnore
// private List<Blocks> blocks;
private List<Blocks> blocks;
}
......@@ -59,6 +59,14 @@ public class EngineerBusinessDTO {
private String location;
}
@lombok.Data
public static class Blocks {
private String blockId;
private String blockName;
private String blockData;
private String teamId;
}
@lombok.Data
public static class EngineerCenterUpdateReqDTO {
......
......@@ -12,4 +12,6 @@ public interface EngineerBusinessService {
EngineerBusinessDTO.WareHouse getWareHouse(String wareHouseId);
void updateEngineerCenter(EngineerBusinessDTO.EngineerCenterUpdateReqDTO centerReq );
List<EngineerBusinessDTO.Blocks> getBlocks(EngineerBusinessDTO.Request engineerReq);
}
package com.dituhui.pea.order.service.impl;
import com.dituhui.pea.order.dao.EngineerBusinessDao;
import com.dituhui.pea.order.dao.EngineerInfoDao;
import com.dituhui.pea.order.dao.OrgGroupDao;
import com.dituhui.pea.order.dao.WarehouseInfoDao;
import com.dituhui.pea.order.dao.*;
import com.dituhui.pea.order.dto.EngineerBusinessDTO;
import com.dituhui.pea.order.entity.*;
import com.dituhui.pea.order.service.EngineerBusinessService;
......@@ -37,6 +34,8 @@ public class EngineerBusinessServiceImpl implements EngineerBusinessService {
@Autowired
private WarehouseInfoDao warehouseInfoDao;
@Autowired
private MapBlockInfoDao mapBlockInfoDao;
@Autowired
private JdbcTemplate jdbcTemplate;
......@@ -115,4 +114,18 @@ public class EngineerBusinessServiceImpl implements EngineerBusinessService {
String[] xyArr = location.split(",");
engineerBusinessDao.updateEngineerCenter(centerReq.getAddress(), xyArr[0], xyArr[1], centerReq.getEngineerCode());
}
@Override
public List<EngineerBusinessDTO.Blocks> getBlocks(EngineerBusinessDTO.Request engineerReq) {
List<MapBlockInfoEntity> blockInfoList = mapBlockInfoDao.findByGroupId(engineerReq.getLevelValue());
return blockInfoList.stream().map(item -> {
EngineerBusinessDTO.Blocks block = new EngineerBusinessDTO.Blocks();
block.setBlockId(item.getBlockId());
block.setBlockName(item.getBlockName());
block.setBlockData(item.getAreaData());
block.setTeamId(item.getTeamId());
return block;
}).collect(Collectors.toList());
}
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!