|
|
@@ -100,6 +100,66 @@ public class MobileController extends Controller{
|
|
|
Record result = new Record();
|
|
|
boolean cuan = true;
|
|
|
boolean isThird = false;
|
|
|
+ if(code.length() == 6){//6位码先查爱创的,没查到就走老逻辑
|
|
|
+ Map<String,String> header =new HashMap<String,String>();
|
|
|
+ header.put("content-type", "application/json;charset=UTF-8");
|
|
|
+ JSONObject obj = new JSONObject();
|
|
|
+ obj.put("code", code);
|
|
|
+ obj.put("latitude", 34.16559);
|
|
|
+
|
|
|
+ obj.put("longitude", 112.824936);
|
|
|
+ String jsonData = HttpKit.post("http://183.215.13.140:324/api/trace/inspect/customer/find",obj.toJSONString(),header);
|
|
|
+ JSONObject parseObject = JSONObject.parseObject(jsonData);
|
|
|
+
|
|
|
+ JSONObject data = parseObject.getJSONObject("data");
|
|
|
+ if(data != null){
|
|
|
+ String distributorName = data.getString("bizCorpName");
|
|
|
+
|
|
|
+ String operateDate = data.getString("billTime");
|
|
|
+
|
|
|
+
|
|
|
+ String productName = data.getString("productName");
|
|
|
+
|
|
|
+ result.set("pinxiang", productName);
|
|
|
+ Record fahuoInfo = new Record();
|
|
|
+ fahuoInfo.set("DeliveryTime", operateDate).set("CustomerName", distributorName);
|
|
|
+
|
|
|
+
|
|
|
+ Record jxsInfo = Db.findFirst("select * from jinzai_jxs_area where jxs = ?",distributorName);
|
|
|
+
|
|
|
+ if(jxsInfo != null){
|
|
|
+ String saleCity = jxsInfo.getStr("city");
|
|
|
+ String saleProvince = jxsInfo.getStr("province");
|
|
|
+
|
|
|
+ if(saleCity!=null&&saleCity.equals(compareCity)){
|
|
|
+ cuan = false;
|
|
|
+ }
|
|
|
+ result.set("saleLocation", saleProvince+saleCity);
|
|
|
+
|
|
|
+ searchInfo.set("kehu", saleProvince+saleCity);
|
|
|
+ }else{
|
|
|
+ result.set("saleLocation", "未发货");
|
|
|
+ }
|
|
|
+ result.set("fahuoInfo", fahuoInfo);
|
|
|
+
|
|
|
+ status = true;
|
|
|
+
|
|
|
+ if(cuan){
|
|
|
+ searchInfo.set("status", 0);
|
|
|
+ }else{
|
|
|
+ searchInfo.set("status", 1);
|
|
|
+ }
|
|
|
+ if(!isThird){
|
|
|
+ Db.save("t_jz_searchrecord", searchInfo);
|
|
|
+ }
|
|
|
+
|
|
|
+ result.set("status", status).set("msg", msg).set("cuan", cuan).set("location", compareProvice+compareCity);
|
|
|
+ renderJson(result);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
if(code.length() ==14){//易码
|
|
|
try{
|
|
|
isThird = true;
|
|
|
@@ -141,7 +201,7 @@ public class MobileController extends Controller{
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
|
|
|
- }else if(code.length() == 21 || code.length() == 5 || code.length() == 11){
|
|
|
+ }else if(code.length() == 21 || code.length() == 5 || code.length() == 11){
|
|
|
try{
|
|
|
isThird = true;
|
|
|
Map<String,String> header =new HashMap<String,String>();
|