Commit 1ba38560 by 刘鑫

fix(ID1004248): 博西PEA_V1.1-推荐工程师页-地图常规位置:取值“派单首选地点,数据源在工程师的「位置配置」”,部分工程师没有位置信息时,地图上可不标注。

1 parent cd915f07
......@@ -19,7 +19,7 @@ public interface EngineerBusinessService {
/**
* 获取工程师出发位置
* @param engineerCode 工程师编号
* @return 工程师出发位置
* @return 工程师出发位置 注意: 此方法可能返回null值
*/
TLocation engineerDepartLocation(String engineerCode);
}
......@@ -134,11 +134,14 @@ public class EngineerBusinessServiceImpl implements EngineerBusinessService {
@Override
public TLocation engineerDepartLocation(String engineerCode) {
EngineerBusinessEntity byEngineerCode = engineerBusinessDao.getByEngineerCode(engineerCode);
TLocation location = new TLocation();
location.setAddress(byEngineerCode.getAddress());
location.setLongitude(StringUtils.isNotBlank(byEngineerCode.getX()) ? Double.parseDouble(byEngineerCode.getX()) : 0.0);
location.setLatitude(StringUtils.isNotBlank(byEngineerCode.getY()) ? Double.parseDouble(byEngineerCode.getY()) : 0.0);
location.setLocationType(LocationType.GENERAL);
return location;
if (StringUtils.isNotBlank(byEngineerCode.getX()) || StringUtils.isNotBlank(byEngineerCode.getY())) {
TLocation location = new TLocation();
location.setAddress(byEngineerCode.getAddress());
location.setLongitude(Double.parseDouble(byEngineerCode.getX()));
location.setLatitude(Double.parseDouble(byEngineerCode.getY()));
location.setLocationType(LocationType.GENERAL);
return location;
}
return null;
}
}
......@@ -433,15 +433,16 @@ public class OrderAssignImpl implements OrderAssign {
ArrayList<TLocation> resultLocationList = new ArrayList<>();
TLocation generalLocation = engineerBusinessService.engineerDepartLocation(engineerCode);
//常规位置, 出发地
resultLocationList.add(generalLocation);
if (finishedOrder.isPresent()) {
OrderInfoEntity finishedOrderInfo = finishedOrder.get();
quasiRealTimeLocation.setAddress(finishedOrderInfo.getAddress());
quasiRealTimeLocation.setLongitude(Double.parseDouble(finishedOrderInfo.getX()));
quasiRealTimeLocation.setLatitude(Double.parseDouble(finishedOrderInfo.getY()));
currentOrder = finishedOrderInfo;
} else {
} else if (Objects.nonNull(generalLocation)){
//常规位置, 出发地
resultLocationList.add(generalLocation);
//准实时位置
quasiRealTimeLocation.setAddress(generalLocation.getAddress());
quasiRealTimeLocation.setLongitude(generalLocation.getLongitude());
quasiRealTimeLocation.setLatitude(generalLocation.getLatitude());
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!