Browse Source

毛鸡3次扫码

master
lh 7 years ago
parent
commit
2d478ad1eb
3 changed files with 67 additions and 9 deletions
  1. +1
    -0
      app/src/main/java/com/qhclh/ytzh/home/RpcUrl.java
  2. +64
    -8
      app/src/main/java/com/qhclh/ytzh/work/scan/ScanResultActivity.java
  3. +2
    -1
      app/src/main/res/layout/item_maojiinfos.xml

+ 1
- 0
app/src/main/java/com/qhclh/ytzh/home/RpcUrl.java View File

@ -71,6 +71,7 @@ public class RpcUrl {
public static String ToFoodFactoryTransportLogRpc_LeaveBreedFactory ="/MainSystem/B3_ZhongHui/Rpcs/ToFoodFactoryTransportLogRpc/LeaveBreedFactory";
public static String ToFoodFactoryTransportLogRpc_ArriveFoodFactory ="/MainSystem/B3_ZhongHui/Rpcs/ToFoodFactoryTransportLogRpc/ArriveFoodFactory";
public static String ToFoodFactoryTransportLogRpc_ArriveUnloadingPoint ="/MainSystem/B3_ZhongHui/Rpcs/ToFoodFactoryTransportLogRpc/ArriveUnloadingPoint";
public static String ToFoodFactoryTransportLogRpc_LeaveBreedFactoryNoEnter ="/MainSystem/B3_ZhongHui/Rpcs/ToFoodFactoryTransportLogRpc/LeaveBreedFactoryNoEnter";
public static String BreedReportRpcCountInfo ="/MainSystem/B3_ZhongHui/Rpcs/BreedReportRpc/CountInfo";


+ 64
- 8
app/src/main/java/com/qhclh/ytzh/work/scan/ScanResultActivity.java View File

@ -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


+ 2
- 1
app/src/main/res/layout/item_maojiinfos.xml View File

@ -105,6 +105,7 @@
<include layout="@layout/include_line" />
<LinearLayout
android:visibility="gone"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
@ -127,7 +128,7 @@
</LinearLayout>
<include layout="@layout/include_line" />
<!--<include layout="@layout/include_line" />-->
<LinearLayout
android:layout_width="match_parent"


Loading…
Cancel
Save