Commit 2b3a9edf by chenxi

合并1.71.1合1.71.2版本到主干

git-svn-id: svn://192.168.3.233/frms/code/car-service/trunk/car-service@35620 aeb6102e-e053-11e5-9fec-f9ebc45caf4b
1 parent 4a30516a
...@@ -196,6 +196,12 @@ public interface BizConstants { ...@@ -196,6 +196,12 @@ public interface BizConstants {
* 设备验证url前缀 * 设备验证url前缀
*/ */
String DEVICE_VERIFY_PREFIX = "bhg.device.verify."; String DEVICE_VERIFY_PREFIX = "bhg.device.verify.";
/**
* 设备验证url前缀
*/
String DEVICE_DISTANCE_VERIFY_URL = "bhg.device.verify.glsx_edun.distance";
/** /**
* 订单同步url前缀 * 订单同步url前缀
*/ */
......
...@@ -897,7 +897,12 @@ public class IndentServiceImpl implements IndentService { ...@@ -897,7 +897,12 @@ public class IndentServiceImpl implements IndentService {
if (hCell == null) { if (hCell == null) {
throw BusinessException.create(ResultCodeEnum.FAIL.getCode(), "导入的excel数据为空,请检查后重试!"); throw BusinessException.create(ResultCodeEnum.FAIL.getCode(), "导入的excel数据为空,请检查后重试!");
} }
String deviceNo = hCell.getStringCellValue(); String deviceNo = null;
try {
deviceNo = hCell.getStringCellValue();
} catch (Exception e) {
throw BusinessException.create(ResultCodeEnum.FAIL.getCode(), "导入文件与指定模板不匹配,请检查后重试!");
}
if (!"设备号".equals(deviceNo)) { if (!"设备号".equals(deviceNo)) {
throw BusinessException.create(ResultCodeEnum.FAIL.getCode(), "导入文件与指定模板不匹配,请检查后重试!"); throw BusinessException.create(ResultCodeEnum.FAIL.getCode(), "导入文件与指定模板不匹配,请检查后重试!");
} }
......
...@@ -470,7 +470,12 @@ public class SysSecondmentServiceImpl implements SysSecondmentService { ...@@ -470,7 +470,12 @@ public class SysSecondmentServiceImpl implements SysSecondmentService {
if (hCell == null) { if (hCell == null) {
throw BusinessException.create(ResultCodeEnum.FAIL.getCode(), "导入的excel数据为空,请检查后重试!"); throw BusinessException.create(ResultCodeEnum.FAIL.getCode(), "导入的excel数据为空,请检查后重试!");
} }
String deviceNo = hCell.getStringCellValue(); String deviceNo = null;
try {
deviceNo = hCell.getStringCellValue();
} catch (Exception e) {
throw BusinessException.create(ResultCodeEnum.FAIL.getCode(), "导入文件与指定模板不匹配,请检查后重试!");
}
if (!"设备号".equals(deviceNo)) { if (!"设备号".equals(deviceNo)) {
throw BusinessException.create(ResultCodeEnum.FAIL.getCode(), "导入文件与指定模板不匹配,请检查后重试!"); throw BusinessException.create(ResultCodeEnum.FAIL.getCode(), "导入文件与指定模板不匹配,请检查后重试!");
} }
......
...@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON; ...@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.glsx.common.constants.ResultObject; import com.glsx.common.constants.ResultObject;
import com.glsx.common.utils.PropertiesUtil;
import com.glsx.common.utils.StringUtils; import com.glsx.common.utils.StringUtils;
import com.glsx.ordercenter.constants.BizConstants; import com.glsx.ordercenter.constants.BizConstants;
import com.glsx.ordercenter.constants.ResultCodeEnum; import com.glsx.ordercenter.constants.ResultCodeEnum;
...@@ -11,6 +12,8 @@ import com.glsx.ordercenter.pojo.SysOrderDevice; ...@@ -11,6 +12,8 @@ import com.glsx.ordercenter.pojo.SysOrderDevice;
import com.glsx.ordercenter.strategy.BaseDeviceVerifyStrategy; import com.glsx.ordercenter.strategy.BaseDeviceVerifyStrategy;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import java.util.Objects;
/** /**
* <p>Description: 虎哥e盾设备校验 * <p>Description: 虎哥e盾设备校验
* *
...@@ -59,8 +62,8 @@ public class EdunDeviceVerifyStrategy extends BaseDeviceVerifyStrategy { ...@@ -59,8 +62,8 @@ public class EdunDeviceVerifyStrategy extends BaseDeviceVerifyStrategy {
JSONObject resp = JSON.parseObject(respJson); JSONObject resp = JSON.parseObject(respJson);
String respCode = resp.getString("returnCode"); String respCode = resp.getString("returnCode");
if ("0".equals(respCode)) { if ("0".equals(respCode)) {
result = new ResultObject(ResultCodeEnum.SUCCESS.getCode(), //如果设备验证成功,进一步验证设备定位,只校验平安工单
ResultCodeEnum.SUCCESS.getMsg()); return verifyDeviceDistance(req);
} else { } else {
String message = resp.getString("message"); String message = resp.getString("message");
JSONArray data = resp.getJSONArray("data"); JSONArray data = resp.getJSONArray("data");
...@@ -72,4 +75,34 @@ public class EdunDeviceVerifyStrategy extends BaseDeviceVerifyStrategy { ...@@ -72,4 +75,34 @@ public class EdunDeviceVerifyStrategy extends BaseDeviceVerifyStrategy {
this.logger.info("==== EdunDeviceVerifyStrategy result: {}", JSON.toJSONString(result)); this.logger.info("==== EdunDeviceVerifyStrategy result: {}", JSON.toJSONString(result));
return result; return result;
} }
private ResultObject verifyDeviceDistance(JSONObject req) throws Exception {
ResultObject result = new ResultObject(ResultCodeEnum.SUCCESS.getCode(),
ResultCodeEnum.SUCCESS.getMsg());
String orderSource = order.getOrderSource();
//非平安工单不校验,直接返回成功
if (!Objects.equals(orderSource, BizConstants.PINGAN_ORDERSOURCE)) {
return result;
}
req.put("installerId", order.getMechanicId());
String reqJson = JSONObject.toJSONString(req);
String verifyUrl = PropertiesUtil.getProperty(BizConstants.DEVICE_DISTANCE_VERIFY_URL);
logger.info("设备距离验证发送url===" + verifyUrl + ", 设备距离验证发送参数===" + reqJson);
String respJson = httpUtils.postJson(verifyUrl, reqJson);
logger.info("设备距离验证返回结果==" + respJson);
JSONObject resp = JSON.parseObject(respJson);
String respCode = resp.getString("returnCode");
if ("0".equals(respCode)) {
return result;
} else {
String message = resp.getString("message");
JSONArray data = resp.getJSONArray("data");
result = (data != null)
? new ResultObject(ResultCodeEnum.SUCCESS.getCode(), message, data)
: new ResultObject(Integer.parseInt(respCode), message);
}
return result;
}
} }
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!