Commit d0f2a375 by 丁伟峰

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

2 parents 36fd1d7d 072e352b
...@@ -41,6 +41,7 @@ public class EngineerCenterPoiController { ...@@ -41,6 +41,7 @@ public class EngineerCenterPoiController {
result.setGroup(engineerBusinessService.getGroupInfo(engineerReq)); result.setGroup(engineerBusinessService.getGroupInfo(engineerReq));
result.setWarehouse(engineerBusinessService.getWareHouse(result.getGroup().getWarehouseId())); result.setWarehouse(engineerBusinessService.getWareHouse(result.getGroup().getWarehouseId()));
result.setBlocks(engineerBusinessService.getBlocks(engineerReq));
res = Result.success(result); res = Result.success(result);
} catch (BusinessException e) { } catch (BusinessException e) {
return Result.failed(e.getMessage()); return Result.failed(e.getMessage());
......
package com.dituhui.pea.order.dao;
import com.dituhui.pea.order.entity.EngineerSkillGroupEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import java.util.List;
public interface EngineerSkillGroupDao extends JpaRepository<EngineerSkillGroupEntity, Integer> {
List<EngineerSkillGroupEntity> findByEngineerCode(String engineerCode);
List<EngineerSkillGroupEntity> findByEngineerCodeAndStatus(String engineerCode, boolean status);
List<EngineerSkillGroupEntity> findByEngineerCodeInAndStatus(List<String> engineerCodes, boolean status);
List<EngineerSkillGroupEntity> findBySkillGroupCode(String skillGroupCode);
List<EngineerSkillGroupEntity> findBySkillGroupCodeAndStatus(String skillGroupCode, boolean status);
}
...@@ -14,4 +14,6 @@ public interface MapBlockInfoDao extends JpaRepository<MapBlockInfoEntity, Integ ...@@ -14,4 +14,6 @@ public interface MapBlockInfoDao extends JpaRepository<MapBlockInfoEntity, Integ
MapBlockInfoEntity findByBlockId(String blockId); MapBlockInfoEntity findByBlockId(String blockId);
List<MapBlockInfoEntity> findByGroupId(String groupId);
} }
...@@ -8,10 +8,13 @@ import org.springframework.data.jpa.repository.Query; ...@@ -8,10 +8,13 @@ import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import java.util.Date; import java.util.Date;
import java.util.List;
@Repository @Repository
public interface OrderEventDao extends JpaRepository<OrderEventEntity, Integer> { public interface OrderEventDao extends JpaRepository<OrderEventEntity, Integer> {
List<OrderEventEntity> findByOrderId(String orderId);
@Query("select a from OrderEventEntity a join OrderInfoEntity b on a.orderId=b.orderId where b.orgClusterId = :clusterId and DATE(a.createTime) = :date") @Query("select a from OrderEventEntity a join OrderInfoEntity b on a.orderId=b.orderId where b.orgClusterId = :clusterId and DATE(a.createTime) = :date")
Page<OrderEventEntity> findAllByClusterId(String clusterId, Date date, Pageable pageable); Page<OrderEventEntity> findAllByClusterId(String clusterId, Date date, Pageable pageable);
......
...@@ -10,6 +10,8 @@ import java.util.List; ...@@ -10,6 +10,8 @@ import java.util.List;
public interface OrderInfoDao extends JpaRepository<OrderInfoEntity, Long> { public interface OrderInfoDao extends JpaRepository<OrderInfoEntity, Long> {
OrderInfoEntity getByOrderId(String orderId); OrderInfoEntity getByOrderId(String orderId);
List<OrderInfoEntity> findByOrderId(String orderId);
List<OrderInfoEntity> findByDtAndEngineerCodeIn(LocalDate date, List<String> engineerCodes); List<OrderInfoEntity> findByDtAndEngineerCodeIn(LocalDate date, List<String> engineerCodes);
@Query("SELECT o.orderId, s.skillCategory as skillCaption FROM OrderInfoEntity o JOIN SkillInfoEntity s on o.brand=s.brand and o.type=s.type and o.skill=s.skill WHERE o.orderId = :orderId") @Query("SELECT o.orderId, s.skillCategory as skillCaption FROM OrderInfoEntity o JOIN SkillInfoEntity s on o.brand=s.brand and o.type=s.type and o.skill=s.skill WHERE o.orderId = :orderId")
......
...@@ -28,7 +28,7 @@ public class EngineerBusinessDTO { ...@@ -28,7 +28,7 @@ public class EngineerBusinessDTO {
private Group group; private Group group;
private WareHouse warehouse; private WareHouse warehouse;
// @JsonIgnore // @JsonIgnore
// private List<Blocks> blocks; private List<Blocks> blocks;
} }
...@@ -59,6 +59,14 @@ public class EngineerBusinessDTO { ...@@ -59,6 +59,14 @@ public class EngineerBusinessDTO {
private String location; private String location;
} }
@lombok.Data
public static class Blocks {
private String blockId;
private String blockName;
private String blockData;
private String teamId;
}
@lombok.Data @lombok.Data
public static class EngineerCenterUpdateReqDTO { public static class EngineerCenterUpdateReqDTO {
......
...@@ -12,4 +12,6 @@ public interface EngineerBusinessService { ...@@ -12,4 +12,6 @@ public interface EngineerBusinessService {
EngineerBusinessDTO.WareHouse getWareHouse(String wareHouseId); EngineerBusinessDTO.WareHouse getWareHouse(String wareHouseId);
void updateEngineerCenter(EngineerBusinessDTO.EngineerCenterUpdateReqDTO centerReq ); void updateEngineerCenter(EngineerBusinessDTO.EngineerCenterUpdateReqDTO centerReq );
List<EngineerBusinessDTO.Blocks> getBlocks(EngineerBusinessDTO.Request engineerReq);
} }
package com.dituhui.pea.order.service.impl; package com.dituhui.pea.order.service.impl;
import com.dituhui.pea.order.dao.EngineerBusinessDao; import com.dituhui.pea.order.dao.*;
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.dto.EngineerBusinessDTO; import com.dituhui.pea.order.dto.EngineerBusinessDTO;
import com.dituhui.pea.order.entity.*; import com.dituhui.pea.order.entity.*;
import com.dituhui.pea.order.service.EngineerBusinessService; import com.dituhui.pea.order.service.EngineerBusinessService;
...@@ -37,6 +34,8 @@ public class EngineerBusinessServiceImpl implements EngineerBusinessService { ...@@ -37,6 +34,8 @@ public class EngineerBusinessServiceImpl implements EngineerBusinessService {
@Autowired @Autowired
private WarehouseInfoDao warehouseInfoDao; private WarehouseInfoDao warehouseInfoDao;
@Autowired
private MapBlockInfoDao mapBlockInfoDao;
@Autowired @Autowired
private JdbcTemplate jdbcTemplate; private JdbcTemplate jdbcTemplate;
...@@ -115,4 +114,18 @@ public class EngineerBusinessServiceImpl implements EngineerBusinessService { ...@@ -115,4 +114,18 @@ public class EngineerBusinessServiceImpl implements EngineerBusinessService {
String[] xyArr = location.split(","); String[] xyArr = location.split(",");
engineerBusinessDao.updateEngineerCenter(centerReq.getAddress(), xyArr[0], xyArr[1], centerReq.getEngineerCode()); 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!