|
|
@@ -10,7 +10,7 @@ import java.util.List;
|
|
|
import org.json.JSONArray;
|
|
|
import org.json.JSONException;
|
|
|
import org.json.JSONObject;
|
|
|
-
|
|
|
+
|
|
|
import com.jiaju.adapter.ProductClassifyAdapter;
|
|
|
import com.jiaju.adapter.ReworkProcedureSpinnerAdapter;
|
|
|
import com.jiaju.adapter.SwipeAdapter;
|
|
|
@@ -102,13 +102,17 @@ public class CheckCollectModifyActivity extends Activity {
|
|
|
private TextView productCode;
|
|
|
private SwipeAdapter mAdapter;
|
|
|
private int defectflag = 1;
|
|
|
+ private int luociFlag = 0; // 0非裸瓷 1裸瓷
|
|
|
private List<ProductClassifyInfo> listProductClassify = null;
|
|
|
private List<ProductClassifyInfo> listMissedDetection = null;
|
|
|
+ private List<ProductClassifyInfo> listLuoci = null;// 裸瓷数据源
|
|
|
private String defectLocation;
|
|
|
private Spinner classifySpin;
|
|
|
+ private Spinner checkLuociSpin;// 裸瓷标识
|
|
|
private ProductClassifyInfo classifyInfo = null;
|
|
|
private ProductClassifyAdapter adapterProductClassify;
|
|
|
private ProductClassifyAdapter adapterMissedDetection;
|
|
|
+ private ProductClassifyAdapter adapterProductLuoci;
|
|
|
private Button recordBug;// 记录缺陷按钮
|
|
|
private SwipeListView mListView;
|
|
|
private int modelType;
|
|
|
@@ -214,7 +218,13 @@ public class CheckCollectModifyActivity extends Activity {
|
|
|
// savePath+"meslog.db", 1);
|
|
|
// dataBaseOpenHelper.createTable(sqllist);
|
|
|
AllListeners();
|
|
|
-
|
|
|
+ // LoadRunnable 裸瓷交接 提供数据源
|
|
|
+ // start -----------------
|
|
|
+ HandlerThread thread = new HandlerThread("trademarkThread", 5);
|
|
|
+ thread.start();
|
|
|
+ mHandler = new Handler(thread.getLooper());
|
|
|
+ LoadRunnable loadRunnable = new LoadRunnable();
|
|
|
+ mHandler.post(loadRunnable);
|
|
|
}
|
|
|
|
|
|
private void initView() {
|
|
|
@@ -228,6 +238,7 @@ public class CheckCollectModifyActivity extends Activity {
|
|
|
save = (Button) findViewById(R.id.check_save);
|
|
|
back = (TextView) findViewById(R.id.back);
|
|
|
classifySpin = (Spinner) findViewById(R.id.check_classify);
|
|
|
+ checkLuociSpin= (Spinner) findViewById(R.id.check_luoci);
|
|
|
productNumber = (TextView) findViewById(R.id.check_product_number);
|
|
|
productCode = (TextView) findViewById(R.id.check_product_code);
|
|
|
mListView = (SwipeListView) findViewById(R.id.listview);
|
|
|
@@ -1300,8 +1311,9 @@ public class CheckCollectModifyActivity extends Activity {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- if ((!isModify) && (!deleteFlag) && (GoodsLevelTypeID == originalGoodsLevelTypeId)) {
|
|
|
+ ProductClassifyInfo pClassifyInfo = (ProductClassifyInfo) checkLuociSpin.getSelectedItem();
|
|
|
+ if ((!isModify) && (!deleteFlag) && (GoodsLevelTypeID == originalGoodsLevelTypeId)
|
|
|
+ && luociFlag == pClassifyInfo.getDefectFlagId() ) {
|
|
|
CustomToast.showToast(getApplicationContext(), "数据没有修改不能保存", 2000);
|
|
|
return;
|
|
|
}
|
|
|
@@ -1711,6 +1723,8 @@ public class CheckCollectModifyActivity extends Activity {
|
|
|
productionData.put("ProductionDefects", productionDefects);
|
|
|
|
|
|
}
|
|
|
+ ProductClassifyInfo pClassifyInfo = (ProductClassifyInfo) checkLuociSpin.getSelectedItem();
|
|
|
+ productionData.put("LuociFlag", pClassifyInfo.getDefectFlagId());// 裸瓷标识
|
|
|
productionDataEntitys.put(productionData);
|
|
|
jsonObject.put("productionDataEntitys", productionDataEntitys);
|
|
|
|
|
|
@@ -2444,6 +2458,17 @@ public class CheckCollectModifyActivity extends Activity {
|
|
|
activity.classifySpin.setSelection(position);
|
|
|
activity.classifySpin.setEnabled(true);
|
|
|
}
|
|
|
+
|
|
|
+ for (int i = 0; i < activity.listLuoci.size(); i++) {
|
|
|
+ if ((activity.listLuoci.get(i).getDefectFlagId() + "")
|
|
|
+ .equals(activity.luociFlag + "")) {
|
|
|
+ activity.adapterProductLuoci = new ProductClassifyAdapter(
|
|
|
+ activity.listLuoci, activity.getApplicationContext());
|
|
|
+ activity.checkLuociSpin.setAdapter(activity.adapterProductLuoci);
|
|
|
+ activity.checkLuociSpin.setPrompt("请选择");
|
|
|
+ activity.checkLuociSpin.setSelection(i, true);
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
// endTime=System.currentTimeMillis();
|
|
|
// long time=endTime-startTime;
|
|
|
@@ -2940,10 +2965,30 @@ public class CheckCollectModifyActivity extends Activity {
|
|
|
@Override
|
|
|
public void run() {
|
|
|
synchronized (obj) {
|
|
|
- try {
|
|
|
-
|
|
|
- WebClient client = null;
|
|
|
+ try {
|
|
|
+ WebClient client = null;
|
|
|
client = new WebClient();
|
|
|
+ // 裸瓷
|
|
|
+ JSONObject jsonObjectLuoci = new JSONObject();
|
|
|
+ jsonObjectLuoci.put("accountCode", accountCode);
|
|
|
+ jsonObjectLuoci.put("userCode", checkCollectModify_userCode);
|
|
|
+ jsonObjectLuoci.put("userPassword", password);
|
|
|
+ jsonObjectLuoci.put("sessionKey", sessionkey);
|
|
|
+ jsonObjectLuoci.put("procedureID", proId);// 工序ID,菜单页面传过来的
|
|
|
+ jsonObjectLuoci.put("barcode", barcode);// 产品条码
|
|
|
+
|
|
|
+ String resultLuoci = client.doPost(
|
|
|
+ "http://" + ServerAddress_ip + ":" + ServerAddress_duankou + Constants.BAR_CODE_VALID,
|
|
|
+ jsonObjectLuoci.toString(), "application/json");
|
|
|
+ JSONObject jsonObjectLuociR = new JSONObject(resultLuoci);
|
|
|
+ JSONObject jsonObjectLuociRD = jsonObjectLuociR.getJSONObject("d");
|
|
|
+ String rd = jsonObjectLuociRD.getString("Result");
|
|
|
+ JSONArray jsonArrayLuoci = new JSONArray(rd);
|
|
|
+ JSONObject jsLuoci = (JSONObject) jsonArrayLuoci.get(0);
|
|
|
+ luociFlag = jsLuoci.getInt("LuociFlag");
|
|
|
+
|
|
|
+ client = null;
|
|
|
+ client = new WebClient();
|
|
|
JSONObject js = new JSONObject();
|
|
|
js.put("accountCode", accountCode);
|
|
|
js.put("userCode", checkCollectModify_userCode);
|
|
|
@@ -4413,6 +4458,32 @@ public class CheckCollectModifyActivity extends Activity {
|
|
|
|
|
|
};
|
|
|
|
|
|
+ // 调用数据源 裸瓷
|
|
|
+ private class LoadRunnable implements Runnable {
|
|
|
+ public LoadRunnable() {
|
|
|
+
|
|
|
+ }
|
|
|
+ @Override
|
|
|
+ public void run() {
|
|
|
+ // 代码块 给 下线标识 赋值(写死 1:裸瓷 0:非裸瓷)
|
|
|
+ ProductClassifyInfo classifyInfo;
|
|
|
+ listLuoci = new ArrayList<ProductClassifyInfo>();// 试水不合格位置数据源
|
|
|
+ classifyInfo = new ProductClassifyInfo();
|
|
|
+ classifyInfo.setDefectFlagName("非裸瓷");
|
|
|
+ classifyInfo.setDefectFlagId(0);
|
|
|
+ listLuoci.add(classifyInfo);
|
|
|
+ classifyInfo = new ProductClassifyInfo();
|
|
|
+ classifyInfo.setDefectFlagName("裸瓷");
|
|
|
+ classifyInfo.setDefectFlagId(1);
|
|
|
+ listLuoci.add(classifyInfo);
|
|
|
+ adapterProductLuoci = new ProductClassifyAdapter(listLuoci, getApplicationContext());
|
|
|
+ checkLuociSpin.setAdapter(adapterProductLuoci);
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
@SuppressWarnings("unchecked")
|
|
|
@Override
|
|
|
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|