Commit d3d25664 by huangjinxin

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

2 parents 38e13584 f48267f1
......@@ -24,7 +24,7 @@ public class CapacityUtils {
private MapBlockInfoDao mapBlockInfoDao;
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);
return teamIds;
}
......
......@@ -3,7 +3,6 @@ package com.dituhui.pea.order.controller;
import com.dituhui.pea.common.Result;
import com.dituhui.pea.order.common.jackson.DateUtil;
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.service.EngineerCalendarService;
import com.dituhui.pea.order.service.PeaOuterAPIService;
......@@ -82,7 +81,17 @@ public class PeaApiController {
@PostMapping("/capacity/query")
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);
return Result.success(result);
}
......
......@@ -12,9 +12,9 @@ import java.util.List;
@Repository
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);
......@@ -22,10 +22,10 @@ public interface MapBlockInfoDao extends JpaRepository<MapBlockInfoEntity, Integ
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 " +
"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,
@Param("skill") String skill, @Param("blockIds") List<String> blockIds);
}
......@@ -126,6 +126,16 @@ public class OrderDTO {
private String description;
/**
* 是否指定某个工程师/是否排除某个工程师 0:否 1:指定 2:排除 默认0
*/
private int isAppointEngineer;
/**
* 指定某个工程师/排除某个工程师 codes
*/
private List<String> appointEngineerCodes;
/**
* 其他详细信息, 预留的其他详细信息,具体等BEAN提供
*/
private Object extraInfo;
......
......@@ -14,11 +14,11 @@ public class MapBlockInfoEntity {
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
@Column(name = "block_id", length = 50, nullable = false)
private String blockId;
@Column(name = "area_ids", length = 1024, nullable = false)
private String areaIds;
@Column(name = "block_name", length = 20, nullable = false)
private String blockName;
@Column(name = "area_name", length = 50, nullable = false)
private String areaName;
@Column(name = "branch_id", length = 50, nullable = false)
private String branchId;
......@@ -26,26 +26,32 @@ public class MapBlockInfoEntity {
@Column(name = "group_id", length = 50, nullable = false)
private String groupId;
@Column(name = "team_id", length = 50, nullable = false)
private String teamId;
@Column(name = "city_code", nullable = true)
private String cityCode;
@Column(name = "area")
private Long area;
@Column(name = "areaCount")
private Long areaCount;
@Column(name = "area_data", nullable = true, columnDefinition = "json")
private String areaData;
@Column(nullable = true)
private Boolean kind;
@Column(name = "team_id", length = 50, nullable = false)
private String teamId;
private Integer type;
@Column(name = "layer_id", length = 50, nullable = false)
private String layerId;
@Column(length = 50, nullable = false)
private String layer;
@Column(name = "layer_name", length = 50, nullable = false)
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)
private Boolean status;
......
......@@ -22,12 +22,12 @@ public class BlockServiceImpl implements IBlockService {
@Override
public Result<Boolean> synchronizeBlock(String blockId, Long area, RegionDTO region) {
MapBlockInfoEntity mapBlockInfoEntity = mapBlockInfoDao.findByBlockId(blockId);
MapBlockInfoEntity mapBlockInfoEntity = mapBlockInfoDao.findByAreaIds(blockId);
if (null == mapBlockInfoEntity) {
return Result.failure(blockId + " blockId不存在");
}
mapBlockInfoEntity.setAreaData(gson.toJson(region));
mapBlockInfoEntity.setArea(area);
// mapBlockInfoEntity.setArea(area);
mapBlockInfoEntity.setUpdateTime(LocalDateTime.now());
mapBlockInfoDao.save(mapBlockInfoEntity);
mapBlockInfoDao.flush();
......
......@@ -120,14 +120,14 @@ public class BusinessBlockServiceImpl implements BusinessBlockService {
String groupId = team.getGroupId();
String groupName = groupMapping.get(groupId);
block.setId(b.getBlockId());
block.setId(b.getAreaIds());
block.setGroupId(groupId);
block.setGroupName(groupName);
block.setLayerId(b.getLayerId());
block.setLayerName(b.getLayer());
block.setLayerName(b.getLayerName());
block.setTeamId(b.getTeamId());
block.setTeamName(team.getTeamName());
block.setArea(b.getArea().toString());
// block.setArea(b.getArea().toString());
if(null != b.getUpdateTime()) {
block.setUpdateTime(TimeUtils.IsoLocalDateTime2String(b.getUpdateTime()));
}
......@@ -194,15 +194,15 @@ public class BusinessBlockServiceImpl implements BusinessBlockService {
String blockName = String.format("%s_%s", layerName, team.getTeamName()); //区块名称
MapBlockInfoEntity block = new MapBlockInfoEntity();
block.setBlockId(blockId);
block.setBlockName(blockName);
block.setAreaIds(blockId);
block.setAreaName(blockName);
block.setBranchId(team.getBranchId());
block.setGroupId(team.getGroupId());
block.setTeamId(teamId);
block.setLayerId(layerId);
block.setLayer(layerName);
block.setLayerName(layerName);
block.setStatus(true);
block.setArea(0L);
//block.setArea(0L);
block.setCreateTime(LocalDateTime.now());
block.setUpdateTime(block.getCreateTime());
entityManager.persist(block);
......@@ -237,7 +237,7 @@ public class BusinessBlockServiceImpl implements BusinessBlockService {
@Transactional
@Override
public Result<?> businessServiceBlockRemove(String blockId) throws BusinessException {
MapBlockInfoEntity block = mapBlockInfoDao.findByBlockId(blockId);
MapBlockInfoEntity block = mapBlockInfoDao.findByAreaIds(blockId);
if (block == null) {
throw new BusinessException("区块不存在");
}
......@@ -257,7 +257,7 @@ public class BusinessBlockServiceImpl implements BusinessBlockService {
@Override
public Result<?> saasBaseDataLayerUrl(String blockId) throws BusinessException {
MapBlockInfoEntity block = mapBlockInfoDao.findByBlockId(blockId);
MapBlockInfoEntity block = mapBlockInfoDao.findByAreaIds(blockId);
if (block == null) {
throw new BusinessException("区块不存在");
}
......@@ -271,7 +271,7 @@ public class BusinessBlockServiceImpl implements BusinessBlockService {
String saasLayerId = getSaaSLayerId(block.getBranchId(), block.getLayerId());
HashMap<String, String> res = new HashMap<>();
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);
}
......
......@@ -121,8 +121,8 @@ public class EngineerBusinessServiceImpl implements EngineerBusinessService {
return blockInfoList.stream().map(item -> {
EngineerBusinessDTO.Blocks block = new EngineerBusinessDTO.Blocks();
block.setBlockId(item.getBlockId());
block.setBlockName(item.getBlockName());
block.setBlockId(item.getAreaIds());
block.setBlockName(item.getAreaName());
block.setBlockData(item.getAreaData());
block.setTeamId(item.getTeamId());
return block;
......
......@@ -54,7 +54,7 @@ public class FendanServiceImpl implements FendanService {
//2:根据查询出区划匹配工作队
String peaBrand = fixBrand(request.getBrand());
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)) {
return Result.failed(StatusCodeEnum.FENDAN_TEAM_UNMATCHED);
}
......@@ -156,7 +156,7 @@ public class FendanServiceImpl implements FendanService {
//区划所在范围并分配到具体技能的工作队
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)) {
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!