Commit 33333330 by zhanghj

V1.6.0--标准接口派单增加经纬度

git-svn-id: svn://192.168.3.233/frms/code/car-service/trunk/car-service@26035 aeb6102e-e053-11e5-9fec-f9ebc45caf4b
1 parent 92a581af
......@@ -258,13 +258,20 @@ public class StandardOrderServiceImpl implements StandardOrderService {
String channel = sysOrder.getChannel();
String address = sysOrder.getAddress();
Integer district = sysOrder.getDistrict();
String longitude = "";
String latitude = "";
/*
* 调用高德地图接口,解析拿到所在地方的区行政编码
*/
if (org.springframework.util.StringUtils.isEmpty(district)) {
try {
district = Integer.parseInt(AMapUtils.parseAddress(address).get("adcode"));
Map<String, String> map = AMapUtils.parseAddress(address);
if (!map.isEmpty()) {
district = Integer.parseInt(map.get("adcode"));
longitude = map.get("longitude");
latitude = map.get("latitude");
}
} catch (Exception e) {
logger.error("渠道派单,调用高德地图接口,解析拿到所在地方的区行政编码错误", e);
district = -1;
......@@ -349,6 +356,8 @@ public class StandardOrderServiceImpl implements StandardOrderService {
order.setChannel(channel);
order.setMerchantName(merchantName);
order.setServiceCode(sysOrder.getServiceCode());
order.setLongitude(longitude);
order.setLatitude(latitude);
int num = orderDao.insertSelective(order);
if (num == 1) {
SysOrderStatus sysOrderStatus = new SysOrderStatus();
......@@ -451,17 +460,23 @@ public class StandardOrderServiceImpl implements StandardOrderService {
if (result != null) {
return result;
}
String longitude = "";
String latitude = "";
/*
* 调用高德地图接口,解析拿到所在地方的区行政编码
*/
if (org.springframework.util.StringUtils.isEmpty(district)) {
try {
district = Integer.parseInt(AMapUtils.parseAddress(address).get("adcode"));
} catch (Exception e) {
logger.error("渠道修改单,调用高德地图接口,解析拿到所在地方的区行政编码错误", e);
district = -1;
}
try {
Map<String, String> map = AMapUtils.parseAddress(address);
if (!map.isEmpty()) {
district = Integer.parseInt(map.get("adcode"));
longitude = map.get("longitude");
latitude = map.get("latitude");
}
} catch (Exception e) {
logger.error("渠道修改单,调用高德地图接口,解析拿到所在地方的区行政编码错误", e);
district = -1;
}
}
/*
......@@ -536,6 +551,8 @@ public class StandardOrderServiceImpl implements StandardOrderService {
order.setUpdateBy(merchantId);
order.setMerchantName(merchantName);
order.setNewWorkOrderNo(sysOrder.getNewWorkOrderNo());
order.setLongitude(longitude);
order.setLatitude(latitude);
if (oldMerchantId != null) {
if (!oldMerchantId.equals(merchantId)) {
order.setShopId(merchantId);
......
......@@ -637,6 +637,12 @@
<if test="serviceCode != null">
service_code = #{serviceCode},
</if>
<if test="longitude != null">
longitude = #{longitude },
</if>
<if test="latitude != null">
latitude = #{latitude },
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
......@@ -938,7 +944,9 @@
<if test="newWorkOrderNo != null and newWorkOrderNo != ''">
work_order_no = #{newWorkOrderNo,jdbcType=VARCHAR},
</if>
merchant_name = #{merchantName,jdbcType=VARCHAR}
merchant_name = #{merchantName,jdbcType=VARCHAR},
longitude = #{longitude },
latitude = #{latitude }
<where>
<if test="id != null">
and id = #{id,jdbcType=INTEGER}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!