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 { ...@@ -258,13 +258,20 @@ public class StandardOrderServiceImpl implements StandardOrderService {
String channel = sysOrder.getChannel(); String channel = sysOrder.getChannel();
String address = sysOrder.getAddress(); String address = sysOrder.getAddress();
Integer district = sysOrder.getDistrict(); Integer district = sysOrder.getDistrict();
String longitude = "";
String latitude = "";
/* /*
* 调用高德地图接口,解析拿到所在地方的区行政编码 * 调用高德地图接口,解析拿到所在地方的区行政编码
*/ */
if (org.springframework.util.StringUtils.isEmpty(district)) { if (org.springframework.util.StringUtils.isEmpty(district)) {
try { 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) { } catch (Exception e) {
logger.error("渠道派单,调用高德地图接口,解析拿到所在地方的区行政编码错误", e); logger.error("渠道派单,调用高德地图接口,解析拿到所在地方的区行政编码错误", e);
district = -1; district = -1;
...@@ -349,6 +356,8 @@ public class StandardOrderServiceImpl implements StandardOrderService { ...@@ -349,6 +356,8 @@ public class StandardOrderServiceImpl implements StandardOrderService {
order.setChannel(channel); order.setChannel(channel);
order.setMerchantName(merchantName); order.setMerchantName(merchantName);
order.setServiceCode(sysOrder.getServiceCode()); order.setServiceCode(sysOrder.getServiceCode());
order.setLongitude(longitude);
order.setLatitude(latitude);
int num = orderDao.insertSelective(order); int num = orderDao.insertSelective(order);
if (num == 1) { if (num == 1) {
SysOrderStatus sysOrderStatus = new SysOrderStatus(); SysOrderStatus sysOrderStatus = new SysOrderStatus();
...@@ -451,13 +460,19 @@ public class StandardOrderServiceImpl implements StandardOrderService { ...@@ -451,13 +460,19 @@ public class StandardOrderServiceImpl implements StandardOrderService {
if (result != null) { if (result != null) {
return result; return result;
} }
String longitude = "";
String latitude = "";
/* /*
* 调用高德地图接口,解析拿到所在地方的区行政编码 * 调用高德地图接口,解析拿到所在地方的区行政编码
*/ */
if (org.springframework.util.StringUtils.isEmpty(district)) { if (org.springframework.util.StringUtils.isEmpty(district)) {
try { 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) { } catch (Exception e) {
logger.error("渠道修改单,调用高德地图接口,解析拿到所在地方的区行政编码错误", e); logger.error("渠道修改单,调用高德地图接口,解析拿到所在地方的区行政编码错误", e);
district = -1; district = -1;
...@@ -536,6 +551,8 @@ public class StandardOrderServiceImpl implements StandardOrderService { ...@@ -536,6 +551,8 @@ public class StandardOrderServiceImpl implements StandardOrderService {
order.setUpdateBy(merchantId); order.setUpdateBy(merchantId);
order.setMerchantName(merchantName); order.setMerchantName(merchantName);
order.setNewWorkOrderNo(sysOrder.getNewWorkOrderNo()); order.setNewWorkOrderNo(sysOrder.getNewWorkOrderNo());
order.setLongitude(longitude);
order.setLatitude(latitude);
if (oldMerchantId != null) { if (oldMerchantId != null) {
if (!oldMerchantId.equals(merchantId)) { if (!oldMerchantId.equals(merchantId)) {
order.setShopId(merchantId); order.setShopId(merchantId);
......
...@@ -637,6 +637,12 @@ ...@@ -637,6 +637,12 @@
<if test="serviceCode != null"> <if test="serviceCode != null">
service_code = #{serviceCode}, service_code = #{serviceCode},
</if> </if>
<if test="longitude != null">
longitude = #{longitude },
</if>
<if test="latitude != null">
latitude = #{latitude },
</if>
</set> </set>
where id = #{id,jdbcType=INTEGER} where id = #{id,jdbcType=INTEGER}
</update> </update>
...@@ -938,7 +944,9 @@ ...@@ -938,7 +944,9 @@
<if test="newWorkOrderNo != null and newWorkOrderNo != ''"> <if test="newWorkOrderNo != null and newWorkOrderNo != ''">
work_order_no = #{newWorkOrderNo,jdbcType=VARCHAR}, work_order_no = #{newWorkOrderNo,jdbcType=VARCHAR},
</if> </if>
merchant_name = #{merchantName,jdbcType=VARCHAR} merchant_name = #{merchantName,jdbcType=VARCHAR},
longitude = #{longitude },
latitude = #{latitude }
<where> <where>
<if test="id != null"> <if test="id != null">
and id = #{id,jdbcType=INTEGER} 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!