|
|
|
@ -122,11 +122,13 @@ public class ScanResultActivity extends BaseActivity { |
|
|
|
integrator.setDesiredBarcodeFormats(IntentIntegrator.QR_CODE_TYPES); |
|
|
|
integrator.setCaptureActivity(ScanActivity.class); |
|
|
|
if (rpcObj == null) { |
|
|
|
integrator.setPrompt("进入养殖场请扫描"); //底部的提示文字,设为""可以置空 |
|
|
|
// integrator.setPrompt("进入养殖场请扫描"); //底部的提示文字,设为""可以置空 |
|
|
|
integrator.setPrompt("离开养殖场请扫描"); |
|
|
|
}else { |
|
|
|
if ("入养殖场".equals(rpcObj.getNamedValue("State").getName())) { |
|
|
|
integrator.setPrompt("离开养殖场请扫描"); |
|
|
|
}else if ("出养殖场".equals(rpcObj.getNamedValue("State").getName())) { |
|
|
|
// if ("入养殖场".equals(rpcObj.getNamedValue("State").getName())) { |
|
|
|
// integrator.setPrompt("离开养殖场请扫描"); |
|
|
|
// }else |
|
|
|
if ("出养殖场".equals(rpcObj.getNamedValue("State").getName())) { |
|
|
|
integrator.setPrompt("到达食品厂请扫描"); |
|
|
|
}else if ("到食品厂".equals(rpcObj.getNamedValue("State").getName())) { |
|
|
|
integrator.setPrompt("到达挂鸡台请扫描"); |
|
|
|
@ -150,11 +152,13 @@ public class ScanResultActivity extends BaseActivity { |
|
|
|
scanStr = result.getContents(); |
|
|
|
|
|
|
|
if (rpcObj == null) { |
|
|
|
EnterBreedFactory(); |
|
|
|
// EnterBreedFactory(); |
|
|
|
LeaveBreedFactoryNoEnter(); |
|
|
|
}else { |
|
|
|
if ("入养殖场".equals(rpcObj.getNamedValue("State").getName())) { |
|
|
|
LeaveBreedFactory(); |
|
|
|
}else if ("出养殖场".equals(rpcObj.getNamedValue("State").getName())) { |
|
|
|
// if ("入养殖场".equals(rpcObj.getNamedValue("State").getName())) { |
|
|
|
// LeaveBreedFactory(); |
|
|
|
// }else |
|
|
|
if ("出养殖场".equals(rpcObj.getNamedValue("State").getName())) { |
|
|
|
ArriveFoodFactory(); |
|
|
|
}else if ("到食品厂".equals(rpcObj.getNamedValue("State").getName())) { |
|
|
|
ArriveUnloadingPoint(); |
|
|
|
@ -166,6 +170,58 @@ public class ScanResultActivity extends BaseActivity { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
private void LeaveBreedFactoryNoEnter() { |
|
|
|
ViewOnClickTask LeaveBreedFactoryNoEnterTask = new ViewOnClickTask(this,"加载中...") { |
|
|
|
@Override |
|
|
|
protected void successUI() { |
|
|
|
MaojiScanBean scanBean = new MaojiScanBean(); |
|
|
|
scanBean.setId(rpcObj.getLong("ID")); |
|
|
|
scanBean.setInfos_carname(rpcObj.getString("Car_Name")); |
|
|
|
scanBean.setInfos_driver(rpcObj.getString("Employee_Name")); |
|
|
|
scanBean.setInfos_yangzhichang(rpcObj.getString("BreedFactory_Name")); |
|
|
|
scanBean.setShipingchang(rpcObj.getString("FoodFactory_Name")); |
|
|
|
if (rpcObj.getDate("InBreedFactoryTime")!=null) { |
|
|
|
scanBean.setDaodayangzhichang(DateTimeUtil.getYMD4(rpcObj.getDate("InBreedFactoryTime"))); |
|
|
|
}else { |
|
|
|
scanBean.setDaodayangzhichang(""); |
|
|
|
} |
|
|
|
if (rpcObj.getDate("OutBreedFactoryTime")!=null) { |
|
|
|
scanBean.setLikaiyangzhichang(DateTimeUtil.getYMD4(rpcObj.getDate("OutBreedFactoryTime"))); |
|
|
|
}else { |
|
|
|
scanBean.setLikaiyangzhichang(""); |
|
|
|
} |
|
|
|
if (rpcObj.getDate("ArriveFoodFactoryTime")!=null) { |
|
|
|
scanBean.setDaodashipingchang(DateTimeUtil.getYMD4(rpcObj.getDate("ArriveFoodFactoryTime"))); |
|
|
|
}else { |
|
|
|
scanBean.setDaodashipingchang(""); |
|
|
|
} |
|
|
|
if (rpcObj.getDate("ArriveUnloadingPointTime")!=null) { |
|
|
|
scanBean.setDaodaguajipingtai(DateTimeUtil.getYMD4(rpcObj.getDate("ArriveUnloadingPointTime"))); |
|
|
|
}else { |
|
|
|
scanBean.setDaodaguajipingtai(""); |
|
|
|
} |
|
|
|
if (rpcObj.getString("Employee_HandPhone")!=null) { |
|
|
|
scanBean.setInfos_phone(rpcObj.getString("Employee_HandPhone")); |
|
|
|
}else { |
|
|
|
scanBean.setInfos_phone(""); |
|
|
|
} |
|
|
|
scanBeanList.clear(); |
|
|
|
scanBeanList.add(scanBean); |
|
|
|
|
|
|
|
scanAdapter = new MaojiScanAdapter(ScanResultActivity.this,scanBeanList); |
|
|
|
lv_infos.setAdapter(scanAdapter); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public Object call() throws Exception { |
|
|
|
JsonRpcResult result = RpcFacade.rpcCall(RpcUrl.ToFoodFactoryTransportLogRpc_LeaveBreedFactoryNoEnter,scanStr); |
|
|
|
rpcObj = result.getRpcObject(RpcUrl.ToFoodFactoryTransportLogRpc_fanhui); |
|
|
|
return null; |
|
|
|
} |
|
|
|
}; |
|
|
|
LeaveBreedFactoryNoEnterTask.execute(); |
|
|
|
} |
|
|
|
|
|
|
|
private void EnterBreedFactory() { |
|
|
|
ViewOnClickTask enterbTask = new ViewOnClickTask(this,"加载中...") { |
|
|
|
@Override |
|
|
|
|