|
|
@@ -256,42 +256,50 @@ public class MobileController extends Controller{
|
|
|
}else if(code.length() == 20){
|
|
|
if(code.startsWith("jz") || code.startsWith("JZ")){//小码
|
|
|
Record jinzai_upload_child = Db.findFirst("select * from jinzai_upload_child where child_code = ?",code.toLowerCase());
|
|
|
- code = jinzai_upload_child.getStr("master_code");
|
|
|
+ if(jinzai_upload_child != null){
|
|
|
+ code = jinzai_upload_child.getStr("master_code");
|
|
|
+ }else{
|
|
|
+ cuan = false;
|
|
|
+ }
|
|
|
}
|
|
|
String master_code = code;
|
|
|
master_code = master_code.toUpperCase();
|
|
|
Record masterInfo = Db.findFirst("select * from jinzai_upload_master where id = ?",master_code);
|
|
|
-
|
|
|
- String pinxiang = masterInfo.getStr("pinxiang");
|
|
|
- String kouwei = masterInfo.getStr("kouwei");
|
|
|
- result.set("pinxiang", pinxiang+kouwei);
|
|
|
- searchInfo.set("product_name", pinxiang);
|
|
|
- if(!WxUtil.isNull(master_code)){
|
|
|
- status = true;
|
|
|
- Record fahuoInfo = Db.findFirst("select * from deliveryorders where CaseCode =?",master_code);
|
|
|
- if(fahuoInfo != null){
|
|
|
- String CustomerNo = fahuoInfo.getStr("CustomerNo");
|
|
|
-
|
|
|
- String ProductName = fahuoInfo.getStr("ProductName");
|
|
|
-
|
|
|
- Record jxsInfo = Db.findFirst("select * from jinzai_jxs_area where code = ?",CustomerNo);
|
|
|
- if(jxsInfo != null){
|
|
|
- String saleCity = jxsInfo.getStr("city");
|
|
|
- String saleProvince = jxsInfo.getStr("province");
|
|
|
+ if(masterInfo != null){
|
|
|
+ String pinxiang = masterInfo.getStr("pinxiang");
|
|
|
+ String kouwei = masterInfo.getStr("kouwei");
|
|
|
+ result.set("pinxiang", pinxiang+kouwei);
|
|
|
+ searchInfo.set("product_name", pinxiang);
|
|
|
+ if(!WxUtil.isNull(master_code)){
|
|
|
+ status = true;
|
|
|
+ Record fahuoInfo = Db.findFirst("select * from deliveryorders where CaseCode =?",master_code);
|
|
|
+ if(fahuoInfo != null){
|
|
|
+ String CustomerNo = fahuoInfo.getStr("CustomerNo");
|
|
|
|
|
|
- if(saleCity.equals(compareCity)){
|
|
|
- cuan = false;
|
|
|
+ String ProductName = fahuoInfo.getStr("ProductName");
|
|
|
+
|
|
|
+ Record jxsInfo = Db.findFirst("select * from jinzai_jxs_area where code = ?",CustomerNo);
|
|
|
+ if(jxsInfo != null){
|
|
|
+ String saleCity = jxsInfo.getStr("city");
|
|
|
+ String saleProvince = jxsInfo.getStr("province");
|
|
|
+
|
|
|
+ if(saleCity.equals(compareCity)){
|
|
|
+ cuan = false;
|
|
|
+ }
|
|
|
+ result.set("saleLocation", saleProvince+saleCity);
|
|
|
+
|
|
|
+ searchInfo.set("kehu", saleProvince+saleCity);
|
|
|
+ result.set("fahuoInfo", fahuoInfo);
|
|
|
}
|
|
|
- result.set("saleLocation", saleProvince+saleCity);
|
|
|
|
|
|
- searchInfo.set("kehu", saleProvince+saleCity);
|
|
|
- result.set("fahuoInfo", fahuoInfo);
|
|
|
}
|
|
|
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ cuan = false;
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
|
|
|
else{
|
|
|
@@ -336,10 +344,12 @@ public class MobileController extends Controller{
|
|
|
|
|
|
|
|
|
}
|
|
|
+ }else{
|
|
|
+ cuan = false;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+
|
|
|
if(cuan){
|
|
|
searchInfo.set("status", 0);
|
|
|
}else{
|
|
|
@@ -348,7 +358,6 @@ public class MobileController extends Controller{
|
|
|
if(!isThird){
|
|
|
Db.save("t_jz_searchrecord", searchInfo);
|
|
|
}
|
|
|
-
|
|
|
result.set("status", status).set("msg", msg).set("cuan", cuan).set("location", compareProvice+compareCity);
|
|
|
renderJson(result);
|
|
|
|