Commit d3d25664 by huangjinxin

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

2 parents 38e13584 f48267f1
...@@ -24,7 +24,7 @@ public class CapacityUtils { ...@@ -24,7 +24,7 @@ public class CapacityUtils {
private MapBlockInfoDao mapBlockInfoDao; private MapBlockInfoDao mapBlockInfoDao;
public List<String> getTeamIdsByBlockIdsAndLayerIds(List<String> blockIds, List<String> layerIds) { public List<String> getTeamIdsByBlockIdsAndLayerIds(List<String> blockIds, List<String> layerIds) {
List<String> teamIds = mapBlockInfoDao.findByBlockIdInAndLayerIdIn(blockIds, layerIds).stream().map(MapBlockInfoEntity::getTeamId).collect(Collectors.toList()); List<String> teamIds = mapBlockInfoDao.findByAreaIdsInAndLayerIdIn(blockIds, layerIds).stream().map(MapBlockInfoEntity::getTeamId).collect(Collectors.toList());
log.info("根据输入信息返回对应的可能的工作队列表({}/{}) ===> {}", blockIds, layerIds, teamIds); log.info("根据输入信息返回对应的可能的工作队列表({}/{}) ===> {}", blockIds, layerIds, teamIds);
return teamIds; return teamIds;
} }
......
...@@ -3,7 +3,6 @@ package com.dituhui.pea.order.controller; ...@@ -3,7 +3,6 @@ package com.dituhui.pea.order.controller;
import com.dituhui.pea.common.Result; import com.dituhui.pea.common.Result;
import com.dituhui.pea.order.common.jackson.DateUtil; import com.dituhui.pea.order.common.jackson.DateUtil;
import com.dituhui.pea.order.common.jackson.JsonUtil; import com.dituhui.pea.order.common.jackson.JsonUtil;
import com.dituhui.pea.order.dto.OrganizationTreeDTO;
import com.dituhui.pea.order.dto.param.*; import com.dituhui.pea.order.dto.param.*;
import com.dituhui.pea.order.service.EngineerCalendarService; import com.dituhui.pea.order.service.EngineerCalendarService;
import com.dituhui.pea.order.service.PeaOuterAPIService; import com.dituhui.pea.order.service.PeaOuterAPIService;
...@@ -82,7 +81,17 @@ public class PeaApiController { ...@@ -82,7 +81,17 @@ public class PeaApiController {
@PostMapping("/capacity/query") @PostMapping("/capacity/query")
public Result<CapacityQueryDTO.Result> capacityQuery(@Validated @RequestBody CapacityQueryDTO.Request reqDTO) throws IOException { public Result<CapacityQueryDTO.Result> capacityQuery(@Validated @RequestBody CapacityQueryDTO.Request reqDTO) throws IOException {
//查询日期起止参数限制为一月 //查询日期起止参数限制为一月
CapacityQueryDTO.Result result = JsonUtil.parse(makeMap.get(reqDTO.getLocation().getLongitude() + "," + reqDTO.getLocation().getLatitude()), CapacityQueryDTO.Result.class).get();
ArrayList<String> strings = new ArrayList<>();
strings.add(half_capacity);
strings.add(day_capacity);
strings.add(half_capacity2);
strings.add(date_capacity);
Random random = new Random();
int i = random.nextInt(4);
CapacityQueryDTO.Result result = JsonUtil.parse(strings.get(i), CapacityQueryDTO.Result.class).get();
result.setParams(reqDTO); result.setParams(reqDTO);
return Result.success(result); return Result.success(result);
} }
......
...@@ -12,9 +12,9 @@ import java.util.List; ...@@ -12,9 +12,9 @@ import java.util.List;
@Repository @Repository
public interface MapBlockInfoDao extends JpaRepository<MapBlockInfoEntity, Integer>, JpaSpecificationExecutor<MapBlockInfoEntity> { public interface MapBlockInfoDao extends JpaRepository<MapBlockInfoEntity, Integer>, JpaSpecificationExecutor<MapBlockInfoEntity> {
List<MapBlockInfoEntity> findByBlockIdInAndLayerIdIn(List<String> blockIds, List<String> layerIds); List<MapBlockInfoEntity> findByAreaIdsInAndLayerIdIn(List<String> blockIds, List<String> layerIds);
MapBlockInfoEntity findByBlockId(String blockId); MapBlockInfoEntity findByAreaIds(String blockId);
List<MapBlockInfoEntity> findByGroupId(String groupId); List<MapBlockInfoEntity> findByGroupId(String groupId);
...@@ -22,10 +22,10 @@ public interface MapBlockInfoDao extends JpaRepository<MapBlockInfoEntity, Integ ...@@ -22,10 +22,10 @@ public interface MapBlockInfoDao extends JpaRepository<MapBlockInfoEntity, Integ
MapBlockInfoEntity findByTeamIdAndLayerId(String teamId, String layerId); MapBlockInfoEntity findByTeamIdAndLayerId(String teamId, String layerId);
List<MapBlockInfoEntity> findByBlockIdIn(List<String> blockIds); List<MapBlockInfoEntity> findByAreaIdsIn(List<String> blockIds);
@Query(value = "select mbi.* from map_block_info mbi left join skill_info si on mbi.layer_id = si.layer_id left join map_layer_customize mlc on mlc.layer_id = mbi.layer_id " + @Query(value = "select mbi.* from map_block_info mbi left join skill_info si on mbi.layer_id = si.layer_id left join map_layer_customize mlc on mlc.layer_id = mbi.layer_id " +
"where si.brand = :brand and si.`type` = :productType and si.skill = :skill and mbi.block_id in ( :blockIds ) order by mlc.priority ", nativeQuery = true) "where si.brand = :brand and si.`type` = :productType and si.skill = :skill and mbi.area_ids in ( :blockIds ) order by mlc.priority ", nativeQuery = true)
List<MapBlockInfoEntity> listTeamIdByBrandAndSkillAndBlockIds(@Param("brand") String brand, @Param("productType") String productType, List<MapBlockInfoEntity> listTeamIdByBrandAndSkillAndBlockIds(@Param("brand") String brand, @Param("productType") String productType,
@Param("skill") String skill, @Param("blockIds") List<String> blockIds); @Param("skill") String skill, @Param("blockIds") List<String> blockIds);
} }
...@@ -126,6 +126,16 @@ public class OrderDTO { ...@@ -126,6 +126,16 @@ public class OrderDTO {
private String description; private String description;
/** /**
* 是否指定某个工程师/是否排除某个工程师 0:否 1:指定 2:排除 默认0
*/
private int isAppointEngineer;
/**
* 指定某个工程师/排除某个工程师 codes
*/
private List<String> appointEngineerCodes;
/**
* 其他详细信息, 预留的其他详细信息,具体等BEAN提供 * 其他详细信息, 预留的其他详细信息,具体等BEAN提供
*/ */
private Object extraInfo; private Object extraInfo;
......
...@@ -14,38 +14,44 @@ public class MapBlockInfoEntity { ...@@ -14,38 +14,44 @@ public class MapBlockInfoEntity {
@GeneratedValue(strategy = GenerationType.IDENTITY) @GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id; private Integer id;
@Column(name = "block_id", length = 50, nullable = false) @Column(name = "area_ids", length = 1024, nullable = false)
private String blockId; private String areaIds;
@Column(name = "block_name", length = 20, nullable = false) @Column(name = "area_name", length = 50, nullable = false)
private String blockName; private String areaName;
@Column(name = "branch_id", length = 50, nullable = false) @Column(name = "branch_id", length = 50, nullable = false)
private String branchId; private String branchId;
@Column(name = "group_id", length = 50, nullable = false) @Column(name = "group_id", length = 50, nullable = false)
private String groupId; private String groupId;
@Column(name = "team_id", length = 50, nullable = false)
private String teamId;
@Column(name = "city_code", nullable = true) @Column(name = "city_code", nullable = true)
private String cityCode; private String cityCode;
@Column(name = "area") @Column(name = "areaCount")
private Long area; private Long areaCount;
@Column(name = "area_data", nullable = true, columnDefinition = "json") @Column(name = "area_data", nullable = true, columnDefinition = "json")
private String areaData; private String areaData;
@Column(nullable = true) @Column(nullable = true)
private Boolean kind; private Integer type;
@Column(name = "team_id", length = 50, nullable = false)
private String teamId;
@Column(name = "layer_id", length = 50, nullable = false) @Column(name = "layer_id", length = 50, nullable = false)
private String layerId; private String layerId;
@Column(length = 50, nullable = false) @Column(name = "layer_name", length = 50, nullable = false)
private String layer; private String layerName;
@Column(name = "saas_layercode", length = 50, nullable = false)
private String saasLayercode;
@Column(name = "saas_layer_id", length = 50, nullable = false)
private String saasLayerName;
@Column(nullable = false) @Column(nullable = false)
private Boolean status; private Boolean status;
......
...@@ -22,12 +22,12 @@ public class BlockServiceImpl implements IBlockService { ...@@ -22,12 +22,12 @@ public class BlockServiceImpl implements IBlockService {
@Override @Override
public Result<Boolean> synchronizeBlock(String blockId, Long area, RegionDTO region) { public Result<Boolean> synchronizeBlock(String blockId, Long area, RegionDTO region) {
MapBlockInfoEntity mapBlockInfoEntity = mapBlockInfoDao.findByBlockId(blockId); MapBlockInfoEntity mapBlockInfoEntity = mapBlockInfoDao.findByAreaIds(blockId);
if (null == mapBlockInfoEntity) { if (null == mapBlockInfoEntity) {
return Result.failure(blockId + " blockId不存在"); return Result.failure(blockId + " blockId不存在");
} }
mapBlockInfoEntity.setAreaData(gson.toJson(region)); mapBlockInfoEntity.setAreaData(gson.toJson(region));
mapBlockInfoEntity.setArea(area); // mapBlockInfoEntity.setArea(area);
mapBlockInfoEntity.setUpdateTime(LocalDateTime.now()); mapBlockInfoEntity.setUpdateTime(LocalDateTime.now());
mapBlockInfoDao.save(mapBlockInfoEntity); mapBlockInfoDao.save(mapBlockInfoEntity);
mapBlockInfoDao.flush(); mapBlockInfoDao.flush();
......
...@@ -120,14 +120,14 @@ public class BusinessBlockServiceImpl implements BusinessBlockService { ...@@ -120,14 +120,14 @@ public class BusinessBlockServiceImpl implements BusinessBlockService {
String groupId = team.getGroupId(); String groupId = team.getGroupId();
String groupName = groupMapping.get(groupId); String groupName = groupMapping.get(groupId);
block.setId(b.getBlockId()); block.setId(b.getAreaIds());
block.setGroupId(groupId); block.setGroupId(groupId);
block.setGroupName(groupName); block.setGroupName(groupName);
block.setLayerId(b.getLayerId()); block.setLayerId(b.getLayerId());
block.setLayerName(b.getLayer()); block.setLayerName(b.getLayerName());
block.setTeamId(b.getTeamId()); block.setTeamId(b.getTeamId());
block.setTeamName(team.getTeamName()); block.setTeamName(team.getTeamName());
block.setArea(b.getArea().toString()); // block.setArea(b.getArea().toString());
if(null != b.getUpdateTime()) { if(null != b.getUpdateTime()) {
block.setUpdateTime(TimeUtils.IsoLocalDateTime2String(b.getUpdateTime())); block.setUpdateTime(TimeUtils.IsoLocalDateTime2String(b.getUpdateTime()));
} }
...@@ -194,15 +194,15 @@ public class BusinessBlockServiceImpl implements BusinessBlockService { ...@@ -194,15 +194,15 @@ public class BusinessBlockServiceImpl implements BusinessBlockService {
String blockName = String.format("%s_%s", layerName, team.getTeamName()); //区块名称 String blockName = String.format("%s_%s", layerName, team.getTeamName()); //区块名称
MapBlockInfoEntity block = new MapBlockInfoEntity(); MapBlockInfoEntity block = new MapBlockInfoEntity();
block.setBlockId(blockId); block.setAreaIds(blockId);
block.setBlockName(blockName); block.setAreaName(blockName);
block.setBranchId(team.getBranchId()); block.setBranchId(team.getBranchId());
block.setGroupId(team.getGroupId()); block.setGroupId(team.getGroupId());
block.setTeamId(teamId); block.setTeamId(teamId);
block.setLayerId(layerId); block.setLayerId(layerId);
block.setLayer(layerName); block.setLayerName(layerName);
block.setStatus(true); block.setStatus(true);
block.setArea(0L); //block.setArea(0L);
block.setCreateTime(LocalDateTime.now()); block.setCreateTime(LocalDateTime.now());
block.setUpdateTime(block.getCreateTime()); block.setUpdateTime(block.getCreateTime());
entityManager.persist(block); entityManager.persist(block);
...@@ -237,7 +237,7 @@ public class BusinessBlockServiceImpl implements BusinessBlockService { ...@@ -237,7 +237,7 @@ public class BusinessBlockServiceImpl implements BusinessBlockService {
@Transactional @Transactional
@Override @Override
public Result<?> businessServiceBlockRemove(String blockId) throws BusinessException { public Result<?> businessServiceBlockRemove(String blockId) throws BusinessException {
MapBlockInfoEntity block = mapBlockInfoDao.findByBlockId(blockId); MapBlockInfoEntity block = mapBlockInfoDao.findByAreaIds(blockId);
if (block == null) { if (block == null) {
throw new BusinessException("区块不存在"); throw new BusinessException("区块不存在");
} }
...@@ -257,7 +257,7 @@ public class BusinessBlockServiceImpl implements BusinessBlockService { ...@@ -257,7 +257,7 @@ public class BusinessBlockServiceImpl implements BusinessBlockService {
@Override @Override
public Result<?> saasBaseDataLayerUrl(String blockId) throws BusinessException { public Result<?> saasBaseDataLayerUrl(String blockId) throws BusinessException {
MapBlockInfoEntity block = mapBlockInfoDao.findByBlockId(blockId); MapBlockInfoEntity block = mapBlockInfoDao.findByAreaIds(blockId);
if (block == null) { if (block == null) {
throw new BusinessException("区块不存在"); throw new BusinessException("区块不存在");
} }
...@@ -271,7 +271,7 @@ public class BusinessBlockServiceImpl implements BusinessBlockService { ...@@ -271,7 +271,7 @@ public class BusinessBlockServiceImpl implements BusinessBlockService {
String saasLayerId = getSaaSLayerId(block.getBranchId(), block.getLayerId()); String saasLayerId = getSaaSLayerId(block.getBranchId(), block.getLayerId());
HashMap<String, String> res = new HashMap<>(); HashMap<String, String> res = new HashMap<>();
res.put("url", url + "/mlAutoLogin?userAccount=" + userAccount + "&password=" + password res.put("url", url + "/mlAutoLogin?userAccount=" + userAccount + "&password=" + password
+ "&jump=basedata&navHidden=true&layerId=" + saasLayerId + "&areaId=" + block.getBlockId()); + "&jump=basedata&navHidden=true&layerId=" + saasLayerId + "&areaId=" + block.getAreaIds());
return Result.success(res); return Result.success(res);
} }
......
...@@ -121,8 +121,8 @@ public class EngineerBusinessServiceImpl implements EngineerBusinessService { ...@@ -121,8 +121,8 @@ public class EngineerBusinessServiceImpl implements EngineerBusinessService {
return blockInfoList.stream().map(item -> { return blockInfoList.stream().map(item -> {
EngineerBusinessDTO.Blocks block = new EngineerBusinessDTO.Blocks(); EngineerBusinessDTO.Blocks block = new EngineerBusinessDTO.Blocks();
block.setBlockId(item.getBlockId()); block.setBlockId(item.getAreaIds());
block.setBlockName(item.getBlockName()); block.setBlockName(item.getAreaName());
block.setBlockData(item.getAreaData()); block.setBlockData(item.getAreaData());
block.setTeamId(item.getTeamId()); block.setTeamId(item.getTeamId());
return block; return block;
......
...@@ -54,7 +54,7 @@ public class FendanServiceImpl implements FendanService { ...@@ -54,7 +54,7 @@ public class FendanServiceImpl implements FendanService {
//2:根据查询出区划匹配工作队 //2:根据查询出区划匹配工作队
String peaBrand = fixBrand(request.getBrand()); String peaBrand = fixBrand(request.getBrand());
List<String> blockIds = blockInfos.stream().map(SaasUtils.BlockInfo::getBlockId).distinct().collect(Collectors.toList()); List<String> blockIds = blockInfos.stream().map(SaasUtils.BlockInfo::getBlockId).distinct().collect(Collectors.toList());
List<MapBlockInfoEntity> mapBlockInfoEntities = mapBlockInfoDao.findByBlockIdIn(blockIds); List<MapBlockInfoEntity> mapBlockInfoEntities = mapBlockInfoDao.findByAreaIdsIn(blockIds);
if (CollectionUtils.isEmpty(mapBlockInfoEntities)) { if (CollectionUtils.isEmpty(mapBlockInfoEntities)) {
return Result.failed(StatusCodeEnum.FENDAN_TEAM_UNMATCHED); return Result.failed(StatusCodeEnum.FENDAN_TEAM_UNMATCHED);
} }
...@@ -156,7 +156,7 @@ public class FendanServiceImpl implements FendanService { ...@@ -156,7 +156,7 @@ public class FendanServiceImpl implements FendanService {
//区划所在范围并分配到具体技能的工作队 //区划所在范围并分配到具体技能的工作队
List<MapBlockInfoEntity> mapBlockInfoList = mapBlockInfoDao.listTeamIdByBrandAndSkillAndBlockIds(peaBrand, request.getProductType(), request.getServiceType(), blockIds); List<MapBlockInfoEntity> mapBlockInfoList = mapBlockInfoDao.listTeamIdByBrandAndSkillAndBlockIds(peaBrand, request.getProductType(), request.getServiceType(), blockIds);
//区划所在范围所有工作队 //区划所在范围所有工作队
List<MapBlockInfoEntity> mapBlockInBlockIdsList = mapBlockInfoDao.findByBlockIdIn(blockIds); List<MapBlockInfoEntity> mapBlockInBlockIdsList = mapBlockInfoDao.findByAreaIdsIn(blockIds);
if (CollectionUtils.isEmpty(mapBlockInfoList) && CollectionUtils.isEmpty(mapBlockInBlockIdsList)) { if (CollectionUtils.isEmpty(mapBlockInfoList) && CollectionUtils.isEmpty(mapBlockInBlockIdsList)) {
return Result.failed(StatusCodeEnum.FENDAN_TEAM_UNMATCHED); return Result.failed(StatusCodeEnum.FENDAN_TEAM_UNMATCHED);
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!