Browse Source

安捷诚【储位转移】添加字段【客户料号】

RaoMeng 4 years ago
parent
commit
2b3e170a2f

+ 21 - 2
app/src/main/java/com/uas/pda_smart_com/adapter/TransferLocationAdapter.java

@@ -5,6 +5,7 @@ import android.text.TextUtils;
 import android.view.View;
 import android.view.ViewGroup;
 import android.widget.BaseAdapter;
+import android.widget.TableRow;
 import android.widget.TextView;
 
 import com.uas.pda_smart_com.R;
@@ -48,9 +49,14 @@ public class TransferLocationAdapter extends BaseAdapter {
         TextView tvProdcode = (TextView) view.findViewById(R.id.tv_barprodcode);
         TextView tvBarRemain = (TextView) view.findViewById(R.id.tv_barremain);
         TextView tvOrispeccode = (TextView) view.findViewById(R.id.transfer_orispeccode);
+        TableRow trDetail = view.findViewById(R.id.transfer_detail_tr);
         TextView tvDetail = (TextView) view.findViewById(R.id.transfer_detail);
+        TableRow trSpec = view.findViewById(R.id.transfer_spec_tr);
         TextView tvSpec = (TextView) view.findViewById(R.id.transfer_spec);
 
+        TableRow trCustprodcode = view.findViewById(R.id.transfer_custprodcode_tr);
+        TextView tvCustprodcode = (TextView) view.findViewById(R.id.transfer_custprodcode);
+
         //配置数据
         WHTransfer tmpTransfer = (WHTransfer) getItem(position);
         //获取箱号
@@ -72,8 +78,21 @@ public class TransferLocationAdapter extends BaseAdapter {
         tvBarRemain.setText(CommonUtil.doubleFormat(tmpTransfer.getBAR_REMAIN()));
 
         tvOrispeccode.setText(tmpTransfer.getPR_ORISPECCODE());
-        tvDetail.setText(tmpTransfer.getPR_DETAIL());
-        tvSpec.setText(tmpTransfer.getPR_SPEC());
+
+        if (CommonUtil.isAJCMaster(context)) {
+            trCustprodcode.setVisibility(View.VISIBLE);
+            trDetail.setVisibility(View.GONE);
+            trSpec.setVisibility(View.GONE);
+
+            tvCustprodcode.setText(tmpTransfer.getPC_CUSTPRODCODE());
+        } else {
+            trCustprodcode.setVisibility(View.GONE);
+            trDetail.setVisibility(View.VISIBLE);
+            trSpec.setVisibility(View.VISIBLE);
+
+            tvDetail.setText(tmpTransfer.getPR_DETAIL());
+            tvSpec.setText(tmpTransfer.getPR_SPEC());
+        }
         return view;
     }
 }

+ 10 - 0
app/src/main/java/com/uas/pda_smart_com/bean/WHTransfer.java

@@ -24,6 +24,8 @@ public class WHTransfer {
     String BAR_CODE;
     @JSONField(name = "PR_ORISPECCODE")
     String PR_ORISPECCODE;
+    @JSONField(name = "PC_CUSTPRODCODE")
+    String PC_CUSTPRODCODE;
 
     public double getBAR_REMAIN() {
         return BAR_REMAIN;
@@ -96,4 +98,12 @@ public class WHTransfer {
     public void setPR_ORISPECCODE(String PR_ORISPECCODE) {
         this.PR_ORISPECCODE = PR_ORISPECCODE;
     }
+
+    public String getPC_CUSTPRODCODE() {
+        return PC_CUSTPRODCODE;
+    }
+
+    public void setPC_CUSTPRODCODE(String PC_CUSTPRODCODE) {
+        this.PC_CUSTPRODCODE = PC_CUSTPRODCODE;
+    }
 }

+ 15 - 0
app/src/main/java/com/uas/pda_smart_com/util/CommonUtil.java

@@ -925,6 +925,21 @@ public class CommonUtil {
         return SharedPreUtil.getString(context, Constants.FLAG.ACCOUNT_NAME_CACHE, null);
     }
 
+    /**
+     * 是否是安捷诚账套
+     */
+    public static boolean isAJCMaster(Context context) {
+        String master = getMaster(context);
+        return (!TextUtils.isEmpty(master)
+                && (master.equals("AJC")
+                || master.equals("SHYZ")
+                || master.equals("HQGT")
+                || master.equals("N_AJC")
+                || master.equals("N_HQGT")
+                || master.equals("N_SHYZ")
+                || master.equals("AJK")));
+    }
+
     /**
      * 是否是高登账套
      */

+ 21 - 4
app/src/main/res/layout/item_list_transfer.xml

@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>
 <TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
-             android:layout_width="match_parent"
-             android:layout_height="wrap_content">
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content">
     <!--条码号-->
     <TableRow>
 
@@ -58,7 +58,22 @@
             style="@style/CardContentTextStyle" />
     </TableRow>
 
-    <TableRow>
+    <TableRow
+        android:id="@+id/transfer_custprodcode_tr"
+        android:visibility="gone">
+
+        <TextView
+            style="@style/CardContentTextStyle"
+            android:text="客户料号:" />
+
+        <TextView
+            android:id="@+id/transfer_custprodcode"
+            style="@style/CardContentTextStyle" />
+    </TableRow>
+
+    <TableRow
+        android:id="@+id/transfer_detail_tr"
+        android:visibility="gone">
 
         <TextView
             style="@style/CardContentTextStyle"
@@ -69,7 +84,9 @@
             style="@style/CardContentTextStyle" />
     </TableRow>
 
-    <TableRow>
+    <TableRow
+        android:id="@+id/transfer_spec_tr"
+        android:visibility="gone">
 
         <TextView
             style="@style/CardContentTextStyle"

+ 2 - 2
build.gradle

@@ -45,8 +45,8 @@ ext {
             targetSdkVersion : 28,
             compileSdkVersion: 28,
             buildToolsVersion: "28.0.3",
-            versionCode      : 7,
-            versionName      : "v1.7"
+            versionCode      : 8,
+            versionName      : "v1.8"
     ]
 
     depsVersion = [