Просмотр исходного кода

1.交坯functioncode 602801-062801
2.成品检验 独立功能完善

李士越 1 год назад
Родитель
Сommit
b445788985

+ 1 - 1
AndroidManifest.xml

@@ -2,7 +2,7 @@
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
     package="com.jiaju.activity"
     android:versionCode="1"
-    android:versionName="1.2.24.0516" >
+    android:versionName="1.2.24.0717" >
 <!-- 23  14-->
     <uses-sdk
         android:minSdkVersion="23"

+ 102 - 105
src/com/jiaju/activity/FinishedProductRegistrationActivity.java

@@ -82,7 +82,7 @@ import android.widget.Toast;
 
 /**
  *     成检登记
- * @author wangyingjie
+ * @author 秦q and wang
  *
  */
 public class FinishedProductRegistrationActivity extends Activity {
@@ -1166,10 +1166,10 @@ public class FinishedProductRegistrationActivity extends Activity {
 								}
 
 							} else {
-								if (classifyInfo.getGoodsLevelTypeID() > 4) {
-									Toast.makeText(getApplicationContext(), "产品必须为正品", Toast.LENGTH_SHORT).show();
-									return;
-								}
+//								if (classifyInfo.getGoodsLevelTypeID() > 4) {
+//									Toast.makeText(getApplicationContext(), "产品必须为正品", Toast.LENGTH_SHORT).show();
+//									return;
+//								}
 							}
 
 							if (operationFlag.equals("modify")) {
@@ -1358,6 +1358,9 @@ public class FinishedProductRegistrationActivity extends Activity {
 					if(saveClassifyInfo.getGoodsLevelTypeID()==6) {//重烧  不管界面 怎么选 写死 返回工序
 				   	    HashMap<String, String> params = new LinkedHashMap<String, String>();
 						params.put("barcode", productNumber.getText().toString().trim().replaceAll("\\n", ""));
+//						ServerAddress_ip
+						//String resultGOODS = mClient.requestGetBySyn(
+						//		"http://" + "172.18.32.31" + ":9100"  +"/main/login/api/UpdateReworkProduce.ashx?barcode="+productNumber.getText().toString().trim().replaceAll("\\n", ""),  new LinkedHashMap<String, String>());
 						String resultGOODS = mClient.requestGetBySyn(
 								"http://" + ServerAddress_ip + ":9100"  +"/main/login/api/UpdateReworkProduce.ashx", params);
 						JSONObject jGOODS = new JSONObject(resultGOODS);
@@ -1384,10 +1387,17 @@ public class FinishedProductRegistrationActivity extends Activity {
 					jsonObject.put("sessionKey", sessionkey);
 					jsonObject.put("procedureID", proId);
 					JSONArray productionDataEntitys = new JSONArray();
+					//后台要inter 数据 带.0   我要处理下
+					String  userIDstr = String.valueOf(userID);
+					int index = userIDstr.indexOf('.');  
+					if (index != -1 && userIDstr.substring(index + 1).equals("0")) {  
+					    // 移除末尾的.0  
+					    userIDstr = userIDstr.substring(0, index);  
+					}  
 					JSONObject productionData = new JSONObject();
 					productionData.put("CheckFlag", checkFlag);
 					productionData.put("Barcode", productionInfo.getBarCode());
-					productionData.put("UserID", userID);
+					productionData.put("UserID", Integer.parseInt(userIDstr));
 					productionData.put("UserCode", worknouserCode);
 					productionData.put("OPTimeStampPDA", timestamp);
 					productionData.put("UserName", workNoName);
@@ -1408,14 +1418,20 @@ public class FinishedProductRegistrationActivity extends Activity {
 							productionData.put("ProductionDataID", productionDataId);
 						}
 					}
+					if (reworkProcedureInfo != null) {
+						productionData.put("ReworkProcedureID",
+								Double.parseDouble(reworkProcedureInfo.getReworkProcedureID()));
 
-					if (productBugList != null && productBugList.size() > 0) {
-						if (reworkProcedureInfo != null) {
-							productionData.put("ReworkProcedureID",
-									Double.parseDouble(reworkProcedureInfo.getReworkProcedureID()));
+						productionData.put("ReworkProcedureName", reworkProcedureInfo.getReworkProcedureName());
+					}
 
-							productionData.put("ReworkProcedureName", reworkProcedureInfo.getReworkProcedureName());
-						}
+					if (productBugList != null && productBugList.size() > 0) {
+//						if (reworkProcedureInfo != null) {
+//							productionData.put("ReworkProcedureID",
+//									Double.parseDouble(reworkProcedureInfo.getReworkProcedureID()));
+//
+//							productionData.put("ReworkProcedureName", reworkProcedureInfo.getReworkProcedureName());
+//						}
 
 						JSONArray productionDefects = new JSONArray();
 						for (int j = 0; j < productBugList.size(); j++) {
@@ -1744,10 +1760,15 @@ public class FinishedProductRegistrationActivity extends Activity {
 				data.put("module","ProductionData");
 				data.put("action","CheckProcedureUser");
 				data.put("UserCode",checkCollectModify_userCode);
-	         	jsonObject.put("jsonData", data.toString());
+	         	 
+	        	JSONObject data_content = new JSONObject();
+	        	data_content.put("UserCode", checkCollectModify_userCode);
+	        	data.put("jsonData", data_content.toString());
+	         	
+	         	
 				result = client.doPost(
 						"http://" + ServerAddress_ip + ":" + ServerAddress_duankou + Constants.serverAction + "/DoAction",
-						jsonObject.toString(), "application/json");
+						 data.toString(), "application/json");
 				b.putString("result", result);
 				message.what = 0;
 				message.setData(b);
@@ -2168,13 +2189,22 @@ public class FinishedProductRegistrationActivity extends Activity {
 					int status = jsonObject.getInt("Status");
 					String message = jsonObject.getString("Message");
 					String json = jsonObject.getString("Result");
+			
 					if (status == 0) {
 						jsonObject = new JSONObject(json);
+						JSONArray table = jsonObject.optJSONArray("Table");
 						String outErrMsg = jsonObject.optString("ErrMsg");
+					
 						if (outErrMsg.equals("null")) {
-							activity.userID = jsonObject.getString("UserID");
-							activity.worknouserCode = jsonObject.getString("UserCode");
-							activity.workNoName = jsonObject.getString("UserName");
+//							activity.userID = jsonObject.getString("USERID");
+//							activity.worknouserCode = jsonObject.getString("USERCODE");
+//							activity.workNoName = jsonObject.getString("USERNAME");
+							if (table != null && table.length() > 0) {
+								JSONObject jsonObjectQINQI =	(JSONObject) table.get(0);
+								activity.userID = jsonObjectQINQI.optString("USERID");
+								activity.worknouserCode = jsonObjectQINQI.optString("USERCODE");
+								activity.workNoName = jsonObjectQINQI.optString("USERNAME"); 
+							}
 							activity.worknovalid = true;
 							activity.barcode.setEnabled(true);
 							activity.barcode.setFocusable(true);
@@ -2247,9 +2277,18 @@ public class FinishedProductRegistrationActivity extends Activity {
 								activity.mHandler.removeCallbacksAndMessages(null);
 								activity.mHandler.getLooper().quit();
 							} 
-							activity.userID = jsonObject.getString("UserID");
-							activity.worknouserCode = jsonObject.getString("UserCode");
-							activity.workNoName = jsonObject.getString("UserName");
+							 
+							
+
+							if (table != null && table.length() > 0) {
+								JSONObject jsonObjectQINQI =	(JSONObject) table.get(0);
+								activity.userID = jsonObjectQINQI.optString("USERID");
+								activity.worknouserCode = jsonObjectQINQI.optString("USERCODE");
+								activity.workNoName = jsonObjectQINQI.optString("USERNAME"); 
+							}
+//							activity.userID = jsonObject.optString("USERID");
+//							activity.worknouserCode = jsonObject.optString("USERCODE");
+//							activity.workNoName = jsonObject.optString("USERNAME");
 							activity.worknovalid = true;
 //							CommonUtil.setDefault(Notification.DEFAULT_VIBRATE, activity.getApplicationContext());
 //							CommonUtil.showWorkNoAlertDialog(status, outErrMsg, activity, activity.worknoEdt,
@@ -2261,9 +2300,10 @@ public class FinishedProductRegistrationActivity extends Activity {
 							activity.mHandler.removeCallbacksAndMessages(null);
 							activity.mHandler.getLooper().quit();
 						}
-						activity.userID = jsonObject.getString("UserID");
-						activity.worknouserCode = jsonObject.getString("UserCode");
-						activity.workNoName = jsonObject.getString("UserName");
+						activity.userID = jsonObject.optString("USERID");
+						activity.worknouserCode = jsonObject.optString("USERCODE");
+						activity.workNoName = jsonObject.optString("USERNAME");
+					 
 						activity.worknovalid = true;
 
 //						CommonUtil.setDefault(Notification.DEFAULT_VIBRATE, activity.getApplicationContext());
@@ -2860,77 +2900,7 @@ public class FinishedProductRegistrationActivity extends Activity {
 		public void run() {
 			synchronized (obj) {
 				try {
-					{//2023/2/23 为了获取大件小件标识
-						JSONObject jsonObject28 = new JSONObject();
-						jsonObject28.put("accountCode", accountCode);
-						jsonObject28.put("userCode", checkCollectModify_userCode);
-						jsonObject28.put("userPassword", password);
-						jsonObject28.put("sessionKey", sessionkey);
-						jsonObject28.put("procedureID", proId);// 工序ID,菜单页面传过来的
-						jsonObject28.put("barcode", barcode);// 产品条码
-						WebClient	client = new WebClient();
-						String result28 = client.doPost(
-								"http://" + ServerAddress_ip + ":" + ServerAddress_duankou
-										+ Constants.BAR_CODE_VALID,
-								jsonObject28.toString(), "application/json");
-						JSONObject jsonObject29 = new JSONObject(result28);
-						JSONObject jsonObject30 = jsonObject29.getJSONObject("d");
-						int status30 = jsonObject30.getInt("Status");
-						String message30 = jsonObject30.getString("Message");
-
-						String result30 = jsonObject30.getString("Result");
-						JSONArray jsonArray321 = new JSONArray(result30);
-						JSONObject jsonObject331 = (JSONObject) jsonArray321.get(0);
-						String outErrMsg331 = jsonObject331.getString("out_errMsg");
-						String missFlag = jsonObject331.optString("out_missFlag");
-						if (status30 == 0) {
-							if (!TextUtils.isEmpty(outErrMsg331)) { //2023/3/10 
-								if (missFlag.equals("0")) {
-									Message m = new Message();
-									Bundle b = new Bundle();
-									b.putInt("status", status30);
-									b.putString("errorMsg", outErrMsg331);
-									m.what = 0;
-									m.setData(b);
-									exceptionHandler.sendMessage(m);
-									return;
-								} else {
-									Message m1 = new Message();
-									Bundle b1 = new Bundle();
-									b1.putString("errmsg", outErrMsg331);
-									b1.putString("flag", missFlag);
-									m1.what = 4;
-									m1.setData(b1);
-									exceptionHandler.sendMessage(m1);
-									return;
-								}
-
-							}else {
-								
-								JSONArray jsonArray30 = new JSONArray(result30);
-								JSONObject jsonObject31 = (JSONObject) jsonArray30.get(0);
-								  GOODSMODELforCheck = jsonObject31.optString("GOODSMODELforCheck");
-					                if((GOODSMODELforCheck==null)||(GOODSMODELforCheck=="")||(GOODSMODELforCheck=="null")) {
-			                    	    HashMap<String, String> params = new LinkedHashMap<String, String>();
-			    						params.put("barcode", barcode);
-			    						String resultGOODS = mClient.requestGetBySyn(
-			    								"http://" + ServerAddress_ip + ":9100" +"/main/login/api/GetCheckBarcode.ashx", params);
-			    						JSONObject jGOODS = new JSONObject(resultGOODS);
-			    						String msgGOODSresult = jGOODS.optString("rows");
-			    						JSONArray jarrayGOODS = new JSONArray(msgGOODSresult);
-			    						JSONObject jobjGOODS = jarrayGOODS.optJSONObject(0);
-			    						 GOODSMODELforCheck = jobjGOODS.optString("GOODSTYPECODE");
-			    						 String GOODSTYPECODE = jobjGOODS.optString("GOODSTYPECODE").substring(0,6);
-			    						 if("001001".equals(GOODSTYPECODE)) {//todo 又被秦琪坑了 2023/3/8 
-			    							 GOODSMODELforCheck  = "CT";
-			    						 }else if("001002".equals(GOODSTYPECODE)){
-			    							 GOODSMODELforCheck  = "11";
-			    						 }
-								  }//
-							}
-						
-						}
-					}
+				 
 					client = null;
 					client = new WebClient();
 					JSONObject js = new JSONObject();
@@ -3181,20 +3151,47 @@ public class FinishedProductRegistrationActivity extends Activity {
 													return;
 												}
 
-											} else { // 正常情况下
+											} else { // 正常情况下  秦q
 												produceCodeIsValid = true;
-												if (worknovalid) {
-													productionInfo = new ProductionInfo();
-													productionInfo.setUserId(Integer.parseInt(userID));
+												productionInfo = new ProductionInfo(); 
+											 
+												String  userIDstr = String.valueOf(userID);
+												if (worknovalid) {  
+													int index = userIDstr.indexOf('.');  
+													if (index != -1 && userIDstr.substring(index + 1).equals("0")) {  
+													    // 移除末尾的.0  
+													    userIDstr = userIDstr.substring(0, index);  
+													} 
+													  
+													productionInfo.setUserId(Integer.parseInt(userIDstr));
 													productionInfo.setUserCode(worknouserCode);
-													productionInfo.setUserName(workNoName);
-
+													productionInfo.setUserName(workNoName); 
+												}
+												{ 
+													  GOODSMODELforCheck = jsonObject31.optString("GOODSMODELforCheck");
+										              if((GOODSMODELforCheck==null)||(GOODSMODELforCheck=="")||(GOODSMODELforCheck=="null")) {
+								                    	    HashMap<String, String> params = new LinkedHashMap<String, String>();
+								    						params.put("barcode", barcode);
+								    						String resultGOODS = mClient.requestGetBySyn(
+								    								"http://" + ServerAddress_ip + ":9100" +"/main/login/api/GetCheckBarcode.ashx", params);
+								    						JSONObject jGOODS = new JSONObject(resultGOODS);
+								    						String msgGOODSresult = jGOODS.optString("rows");
+								    						JSONArray jarrayGOODS = new JSONArray(msgGOODSresult);
+								    						JSONObject jobjGOODS = jarrayGOODS.optJSONObject(0);
+								    						 GOODSMODELforCheck = jobjGOODS.optString("GOODSTYPECODE");
+								    						 String GOODSTYPECODE = jobjGOODS.optString("GOODSTYPECODE").substring(0,6);
+								    						 if("001001".equals(GOODSTYPECODE)) {//todo 又被秦琪坑了 2023/3/8 
+								    							 GOODSMODELforCheck  = "CT";
+								    						 }else if("001002".equals(GOODSTYPECODE)){
+								    							 GOODSMODELforCheck  = "11";
+								    						 }
+													  }
 												}
-												CheckBarcode =  jsonObject31.getString("procedureID");
-												out_goodsID = jsonObject31.getString("out_goodsID");
-												out_goodsCode = jsonObject31.getString("out_goodsCode");
-												out_goodsName = jsonObject31.getString("out_goodsName");
-												out_groutingUserCode = jsonObject31.getString("out_groutingUserCode");
+												CheckBarcode =  jsonObject31.optString("procedureID");
+												out_goodsID = jsonObject31.optString("out_goodsID");
+												out_goodsCode = jsonObject31.optString("out_goodsCode");
+												out_goodsName = jsonObject31.optString("out_goodsName");
+												out_groutingUserCode = jsonObject31.optString("out_groutingUserCode");
 												productionInfo.setBarCode(barcode);
 												productionInfo.setGoodsId(Integer.parseInt(out_goodsID));
 												productionInfo.setGoodsCode(out_goodsCode);

+ 2 - 1
src/com/jiaju/activity/PieceActivity.java

@@ -2147,7 +2147,8 @@ public class PieceActivity extends Activity {
 							exceptionHandler.sendMessage(msg);
 							return;
 						}
-					} else if (collectType == 2) { // 单点
+					} else if (collectType == 2) { // 单点 
+						
 						jsonObject = new JSONObject();
 						// 保存条码信息请求数据
 						jsonObject.put("accountCode", accountCode);

+ 1 - 1
src/com/jiaju/activity/SemiCheckRegisterModifyActivity.java

@@ -132,7 +132,7 @@ public class SemiCheckRegisterModifyActivity extends Activity {
 		String procedureName = b.getString("ProcedureName");
 		String ProductLineMenuCode = b.getString("ProductLineMenuCode");
 		int procedureId = b.getInt("procedureId");
-		if("602801".equals(ProductLineMenuCode)) {
+		if("062801".equals(ProductLineMenuCode)) { // ProductLineMenuCode Đ´´íÁË  062801 Đ´łÉ  602801 ÇŘĆĺ
 			proId = 88; 
 		}else {
 			proId = 89;