wzh 1 år sedan
förälder
incheckning
04a5a89135
1 ändrade filer med 37 tillägg och 28 borttagningar
  1. 37 28
      src/main/java/com/qlm/controller/jinzai/MobileController.java

+ 37 - 28
src/main/java/com/qlm/controller/jinzai/MobileController.java

@@ -256,42 +256,50 @@ public class MobileController extends Controller{
 		}else if(code.length() == 20){
 		}else if(code.length() == 20){
 			if(code.startsWith("jz") || code.startsWith("JZ")){//小码
 			if(code.startsWith("jz") || code.startsWith("JZ")){//小码
 				Record jinzai_upload_child = Db.findFirst("select * from jinzai_upload_child where child_code = ?",code.toLowerCase());
 				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;
 			String master_code = code;
 			master_code = master_code.toUpperCase();
 			master_code = master_code.toUpperCase();
 			Record masterInfo = Db.findFirst("select * from jinzai_upload_master where id = ?",master_code);
 			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{
 		else{
@@ -336,10 +344,12 @@ public class MobileController extends Controller{
 					
 					
 					
 					
 				}
 				}
+			}else{
+				cuan = false;
 			}
 			}
 		}
 		}
 		
 		
-	
+		
 		if(cuan){
 		if(cuan){
 			searchInfo.set("status", 0);
 			searchInfo.set("status", 0);
 		}else{
 		}else{
@@ -348,7 +358,6 @@ public class MobileController extends Controller{
 		if(!isThird){
 		if(!isThird){
 			Db.save("t_jz_searchrecord", searchInfo);
 			Db.save("t_jz_searchrecord", searchInfo);
 		}
 		}
-		
 		result.set("status", status).set("msg", msg).set("cuan", cuan).set("location", compareProvice+compareCity);
 		result.set("status", status).set("msg", msg).set("cuan", cuan).set("location", compareProvice+compareCity);
 		renderJson(result);
 		renderJson(result);