Browse Source

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	.idea/misc.xml
songw 10 months ago
parent
commit
742e51723b
44 changed files with 4769 additions and 43 deletions
  1. 1 1
      .idea/compiler.xml
  2. 1 0
      .idea/gradle.xml
  3. 5 0
      app/build.gradle
  4. 3 0
      app/src/main/AndroidManifest.xml
  5. 455 0
      app/src/main/java/com/uas/hystorage/activity/BlueToothPrintAct.java
  6. 6 4
      app/src/main/java/com/uas/hystorage/activity/IndexActivity.java
  7. 688 0
      app/src/main/java/com/uas/hystorage/activity/InspectionSendSamplesAct.java
  8. 613 0
      app/src/main/java/com/uas/hystorage/activity/SampleDeliveryListAct.java
  9. 0 1
      app/src/main/java/com/uas/hystorage/activity/SelectNetAcitivty.java
  10. 142 0
      app/src/main/java/com/uas/hystorage/adapter/AnnexAdapter.java
  11. 0 1
      app/src/main/java/com/uas/hystorage/adapter/BluetoothAdapter.java
  12. 1 3
      app/src/main/java/com/uas/hystorage/application/PdaApplication.java
  13. 50 0
      app/src/main/java/com/uas/hystorage/bean/AnnexBean.java
  14. 68 0
      app/src/main/java/com/uas/hystorage/bean/AnnexInfo.java
  15. 146 0
      app/src/main/java/com/uas/hystorage/bean/InspectionPaintBean.java
  16. 128 0
      app/src/main/java/com/uas/hystorage/bean/SampleDeliveryBean.java
  17. 0 2
      app/src/main/java/com/uas/hystorage/fragment/HePiFragment.java
  18. 0 1
      app/src/main/java/com/uas/hystorage/fragment/PostPunchFragment.java
  19. 17 2
      app/src/main/java/com/uas/hystorage/fragment/QualityManageFragment.java
  20. 986 0
      app/src/main/java/com/uas/hystorage/fragment/ReportPageFra.java
  21. 55 12
      app/src/main/java/com/uas/hystorage/global/GloableParams.java
  22. 18 0
      app/src/main/java/com/uas/hystorage/util/ClickUtils.java
  23. 9 0
      app/src/main/java/com/uas/hystorage/util/HttpParams.java
  24. 161 0
      app/src/main/java/com/uas/hystorage/util/MyLog.java
  25. 164 0
      app/src/main/java/com/uas/hystorage/util/OKHttpUitls.java
  26. 11 0
      app/src/main/java/com/uas/hystorage/util/OnDownloadListener.java
  27. 52 12
      app/src/main/java/com/uas/hystorage/util/PrintUtils.java
  28. 2 1
      app/src/main/java/com/uas/hystorage/util/VollyRequest.java
  29. 152 0
      app/src/main/java/com/uas/hystorage/util/YLDownload.java
  30. BIN
      app/src/main/res/drawable-xhdpi/jianyansongyang.png
  31. BIN
      app/src/main/res/drawable-xhdpi/shouyebaogao.png
  32. BIN
      app/src/main/res/drawable-xhdpi/tupian.png
  33. BIN
      app/src/main/res/drawable-xhdpi/xunchabaogao.png
  34. BIN
      app/src/main/res/drawable-xhdpi/zengjiatu.png
  35. 46 0
      app/src/main/res/layout/act_blue_tooth_print.xml
  36. 246 0
      app/src/main/res/layout/act_inspection_send_samples.xml
  37. 65 0
      app/src/main/res/layout/act_sample_selivery_list.xml
  38. 161 0
      app/src/main/res/layout/fra_report_page.xml
  39. 40 0
      app/src/main/res/layout/item_annex_image.xml
  40. 230 0
      app/src/main/res/layout/item_sample_delivery.xml
  41. 39 0
      app/src/main/res/layout/view_head.xml
  42. 1 0
      app/src/main/res/values/strings.xml
  43. 6 2
      build.gradle
  44. 1 1
      pda_libs/pulltoreflashlibrary/build/intermediates/incremental/packageDebugResources/compile-file-map.properties

+ 1 - 1
.idea/compiler.xml

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <project version="4">
   <component name="CompilerConfiguration">
-    <bytecodeTargetLevel target="11" />
+    <bytecodeTargetLevel target="1.8" />
   </component>
 </project>

+ 1 - 0
.idea/gradle.xml

@@ -22,5 +22,6 @@
         <option name="resolveModulePerSourceSet" value="false" />
       </GradleProjectSettings>
     </option>
+    <option name="offlineMode" value="true" />
   </component>
 </project>

+ 5 - 0
app/build.gradle

@@ -100,6 +100,11 @@ dependencies {
     implementation 'com.lzy.net:okserver:2.0.5'
     implementation 'com.contrarywind:Android-PickerView:4.1.9'
 
+//    implementation 'com.github.bumptech.glide:glide:4.12.0'
+//    annotationProcessor 'com.github.bumptech.glide:compiler:4.12.0'
+
+    implementation 'com.squareup.okhttp3:okhttp:3.10.0'
+
 }
 
 def getVersionName() {

+ 3 - 0
app/src/main/AndroidManifest.xml

@@ -66,6 +66,9 @@
             android:screenOrientation="portrait" />
         <activity android:name=".activity.LineSelectActivity" />
         <activity android:name=".activity.SelectNetAcitivty" />
+        <activity android:name=".activity.InspectionSendSamplesAct" />
+        <activity android:name=".activity.SampleDeliveryListAct" />
+        <activity android:name=".activity.BlueToothPrintAct" />
 
         <provider xmlns:tools="http://schemas.android.com/tools"
             android:name="android.support.v4.content.FileProvider"

+ 455 - 0
app/src/main/java/com/uas/hystorage/activity/BlueToothPrintAct.java

@@ -0,0 +1,455 @@
+package com.uas.hystorage.activity;
+
+import android.bluetooth.BluetoothDevice;
+import android.content.Intent;
+import android.graphics.drawable.BitmapDrawable;
+import android.os.Build;
+import android.os.Bundle;
+import android.support.v7.widget.LinearLayoutManager;
+import android.support.v7.widget.RecyclerView;
+import android.text.TextUtils;
+import android.util.Log;
+import android.view.View;
+import android.view.animation.Animation;
+import android.view.animation.LinearInterpolator;
+import android.view.animation.RotateAnimation;
+import android.widget.Button;
+import android.widget.ImageView;
+import android.widget.LinearLayout;
+import android.widget.PopupWindow;
+import android.widget.TextView;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.chad.library.adapter.base.BaseQuickAdapter;
+import com.chad.library.adapter.base.BaseViewHolder;
+import com.uas.bluetooth.ConnectHelper;
+import com.uas.hystorage.R;
+import com.uas.hystorage.adapter.BluetoothAdapter;
+import com.uas.hystorage.tools.SharedPreUtil;
+import com.uas.hystorage.util.CommonUtil;
+import com.uas.hystorage.util.Constants;
+import com.uas.hystorage.util.FastjsonUtil;
+import com.uas.hystorage.util.ListUtils;
+import com.uas.hystorage.util.PrintUtils;
+import com.uas.hystorage.view.RecyclerItemDecoration;
+import com.yanzhenjie.permission.Action;
+import com.yanzhenjie.permission.AndPermission;
+import com.yanzhenjie.permission.Permission;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Set;
+
+import vn.luongvo.widget.iosswitchview.SwitchView;
+
+public class BlueToothPrintAct extends BaseActivity {
+
+    public static final int REQUEST_ENABLE_BT = 1;//开启蓝牙的请求回调
+
+    private ImageView mRefreshImageView;
+    private SwitchView mSwitchView;
+    private TextView mDpiTextView;
+    private RecyclerView mRecyclerView;
+    private ConnectHelper connectHelper;
+    private RotateAnimation mRotateAnimation;//动画
+    private BluetoothAdapter mBluetoothAdapter;
+    private boolean isConnected = false;
+    private String mOldAddress = "";
+    private List<Integer> mDpiList;
+    private View mMenuView;
+    private PopupWindow mMenuPopupWindow;
+    private RecyclerView mMenuRecyclerView;
+    private BaseQuickAdapter<Integer, BaseViewHolder> mMenuAdapter;
+    private int mDpi;
+    private String mPrintJson;
+    private int mRetryCount = 0;
+    private boolean isPrinting = false;
+
+
+    private Button bt_return;
+    private TextView tv_title;
+    private ImageView iv_icon;
+    private TextView tv_type;
+
+    @Override
+    protected void initViews() {
+        setContentView(R.layout.act_blue_tooth_print);
+
+        bt_return = findViewById(R.id.bt_return);
+        tv_title = findViewById(R.id.tv_title);
+        iv_icon = findViewById(R.id.iv_icon);
+        tv_type = findViewById(R.id.tv_type);
+
+        tv_title.setText("打印机连接");
+        tv_type.setVisibility(View.VISIBLE);
+
+        mDpi = SharedPreUtil.getInt(BlueToothPrintAct.this, "printDpi", 203);
+        tv_type.setText(mDpi + "dpi");
+
+        mPrintJson = getIntent().getStringExtra(Constants.KEY.BARCODE_PRINT_ARRAY);
+
+        mRefreshImageView = findViewById(R.id.bluetooth_print_refresh_iv);
+        mSwitchView = findViewById(R.id.bluetooth_print_sv);
+        mRecyclerView = findViewById(R.id.bluetooth_print_rv);
+        mRecyclerView.setLayoutManager(new LinearLayoutManager(BlueToothPrintAct.this));
+
+        mRecyclerView.addItemDecoration(new RecyclerItemDecoration(1));
+        mDpiList = new ArrayList<>();
+
+        isConnected = (SharedPreUtil.getInt(BlueToothPrintAct.this, "printConnect", 0) == 1);
+        mOldAddress = SharedPreUtil.getString(BlueToothPrintAct.this, "printAddress", "");
+    }
+
+    @Override
+    protected void initEvents() {
+        bt_return.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                finish();
+            }
+        });
+        mRefreshImageView.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View view) {
+                if (connectHelper.isOpenBluetooth()) {
+                    mRefreshImageView.setAnimation(getImgAnimation());
+                    mRefreshImageView.startAnimation(getImgAnimation());
+                    connectHelper.searchDevices();
+                }
+            }
+        });
+
+        mDpiList.add(152);
+        mDpiList.add(203);
+        mDpiList.add(300);
+        mDpiList.add(600);
+
+        tv_type.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                if (mMenuView == null) {
+                    mMenuView = View.inflate(BlueToothPrintAct.this, R.layout.pop_common_list_menu, null);
+                }
+
+                if (mMenuRecyclerView == null) {
+                    mMenuRecyclerView = mMenuView.findViewById(R.id.common_list_menu_rv);
+                    mMenuRecyclerView.setLayoutManager(new LinearLayoutManager(BlueToothPrintAct.this));
+
+                    mMenuRecyclerView.addItemDecoration(new RecyclerItemDecoration(1));
+
+                }
+
+                if (mMenuAdapter == null) {
+                    mMenuAdapter = new BaseQuickAdapter<Integer, BaseViewHolder>(R.layout.item_common_list_menu, mDpiList) {
+                        @Override
+                        protected void convert(BaseViewHolder helper, Integer item) {
+                            helper.setText(R.id.item_common_list_menu_btn, item + "dpi");
+                        }
+                    };
+
+                    mMenuRecyclerView.setAdapter(mMenuAdapter);
+
+                    mMenuAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
+                        @Override
+                        public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
+                            closeMenuPopupWindow();
+                            mDpi = mDpiList.get(position);
+                            SharedPreUtil.saveInt(BlueToothPrintAct.this, "printDpi", mDpi);
+                            tv_type.setText(mDpi + "dpi");
+                        }
+                    });
+                }
+
+                if (mMenuPopupWindow == null) {
+                    mMenuPopupWindow = new PopupWindow(mMenuView, LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT, true);
+                    mMenuPopupWindow.setBackgroundDrawable(new BitmapDrawable());
+                    mMenuPopupWindow.setOnDismissListener(new PopupWindow.OnDismissListener() {
+                        @Override
+                        public void onDismiss() {
+                            closeMenuPopupWindow();
+                        }
+                    });
+                }
+
+                CommonUtil.setBackgroundAlpha(BlueToothPrintAct.this, 0.5f);
+                mMenuPopupWindow.showAsDropDown(tv_type);
+            }
+        });
+    }
+
+    @Override
+    protected void initDatas() {
+        if (Build.VERSION.SDK_INT >= 6.0) {
+            try {
+                AndPermission.with(BlueToothPrintAct.this)
+                        .runtime()
+                        .permission(Permission.Group.LOCATION)
+                        .onGranted(new Action<List<String>>() {
+                            @Override
+                            public void onAction(List<String> data) {
+                                initHelper();
+                            }
+                        })
+                        .start();
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+
+        } else {
+            initHelper();
+        }
+    }
+
+
+    private void closeMenuPopupWindow() {
+        if (mMenuPopupWindow != null) {
+            mMenuPopupWindow.dismiss();
+            mMenuPopupWindow = null;
+            CommonUtil.setBackgroundAlpha(BlueToothPrintAct.this, 1f);
+        }
+    }
+
+    private void initHelper() {
+        connectHelper = new ConnectHelper(BlueToothPrintAct.this);
+        connectHelper.setConnectListener(new ConnectHelper.ConnectListener() {
+            @Override
+            public void onDeviceChange(int state, BluetoothDevice device) {
+                try {
+                    List<BluetoothDevice> models = mBluetoothAdapter.getModels();
+                    boolean hasConflict = false;
+                    if (!ListUtils.isEmpty(models)) {
+                        for (int i = 0; i < models.size(); i++) {
+                            BluetoothDevice model = models.get(i);
+                            if (model.getAddress().equals(device.getAddress())) {
+                                if (model.getBondState() != device.getBondState()) {
+                                    models.remove(i);
+                                    models.add(0, device);
+                                }
+                                hasConflict = true;
+                                break;
+                            }
+                        }
+                    }
+                    if (!hasConflict) {
+                        if (models == null) {
+                            models = new ArrayList<>();
+                        }
+                        if (device.getBondState() == BluetoothDevice.BOND_BONDED) {
+                            models.add(0, device);
+                        } else {
+                            models.add(device);
+                        }
+                    }
+                    setAdapter(models);
+                } catch (Exception e) {
+                    e.printStackTrace();
+                    CommonUtil.toastNoRepeat(BlueToothPrintAct.this, "蓝牙设备搜索异常,请重新搜索");
+                }
+            }
+
+            @Override
+            public void bindResult(int portOpen, BluetoothDevice device) {
+                progressDialog.dismiss();
+                if (portOpen == -11) {
+                    CommonUtil.toastNoRepeat(BlueToothPrintAct.this, "打印机连接异常");
+                    isConnected = false;
+                    SharedPreUtil.saveInt(BlueToothPrintAct.this, "printConnect", 0);
+                } else if (portOpen == -1) {
+                    mRetryCount++;
+                    if (mRetryCount > 3) {
+                        CommonUtil.toastNoRepeat(BlueToothPrintAct.this, "打印机连接失败,请检查打印机是否启动");
+                        isConnected = false;
+                        SharedPreUtil.saveInt(BlueToothPrintAct.this, "printConnect", 0);
+                        mRetryCount = 0;
+                    } else {
+                        connectHelper.toConnectDeviceHY(device);
+                    }
+                } else {
+                    // TODO: 2018/12/24 执行打印操作
+                    mRetryCount = 0;
+                    isConnected = true;
+                    SharedPreUtil.saveInt(BlueToothPrintAct.this, "printConnect", 1);
+                    mOldAddress = device.getAddress();
+                    SharedPreUtil.saveString(BlueToothPrintAct.this, "printAddress", mOldAddress);
+                    printEvent();
+                }
+            }
+
+            @Override
+            public void onFinished() {
+                mRefreshImageView.setAnimation(null);
+            }
+        });
+        Set<BluetoothDevice> devices = connectHelper.getBondedDevices();
+        List<BluetoothDevice> models = new ArrayList<>();
+        if (!ListUtils.isEmptyBlue(devices)) {
+            for (BluetoothDevice device : devices) {
+                models.add(device);
+            }
+        }
+        setAdapter(models);
+
+        mSwitchView.setChecked(connectHelper.isOpenBluetooth());
+        mSwitchView.setOnCheckedChangeListener(mOnCheckedChangeListener);
+    }
+
+    private void printEvent() {
+        if (isPrinting) {
+            CommonUtil.toastNoRepeat(BlueToothPrintAct.this, "正在打印中,请勿重复操作");
+            return;
+        }
+        isPrinting = true;
+        if (FastjsonUtil.validate(mPrintJson)) {
+            JSONArray printArray = JSON.parseArray(mPrintJson);
+            if (printArray != null && printArray.size() > 0) {
+                boolean isFail = false;
+                for (int i = 0; i < printArray.size(); i++) {
+                    JSONObject printObject = printArray.getJSONObject(i);
+                    int printResult = PrintUtils.printBar(BlueToothPrintAct.this, printObject.toJSONString(), mDpi, null);
+                    if (printResult <= 0) {
+                        isFail = true;
+                    }
+                }
+                if (isFail) {
+                    isConnected = false;
+                    SharedPreUtil.saveInt(BlueToothPrintAct.this, "printConnect", 0);
+                    CommonUtil.toastNoRepeat(BlueToothPrintAct.this, "打印失败,请确定打印机是否正常");
+                } else {
+                    CommonUtil.toastNoRepeat(BlueToothPrintAct.this, "打印成功");
+                    getSupportFragmentManager().popBackStack();
+                }
+            } else {
+                CommonUtil.toastNoRepeat(BlueToothPrintAct.this, "打印失败,条码数据为空");
+            }
+        } else {
+            CommonUtil.toastNoRepeat(BlueToothPrintAct.this, "打印失败,条码数据为空");
+        }
+        isPrinting = false;
+    }
+
+
+    private Animation getImgAnimation() {
+        if (mRotateAnimation == null) {
+            mRotateAnimation = new RotateAnimation(0f, 360f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
+            LinearInterpolator lin = new LinearInterpolator();
+            mRotateAnimation.setInterpolator(lin);
+            mRotateAnimation.setDuration(1000);//设置动画持续时间
+            mRotateAnimation.setRepeatCount(-1);//设置重复次数
+            mRotateAnimation.setFillAfter(true);//动画执行完后是否停留在执行完的状态
+            mRotateAnimation.setStartOffset(10);//执行前的等待时间
+        }
+        return mRotateAnimation;
+    }
+
+    private void setAdapter(List<BluetoothDevice> models) {
+        List<BluetoothDevice> printDevices = new ArrayList<>();
+        if (!ListUtils.isEmpty(models)) {
+            for (int i = 0; i < models.size(); i++) {
+                BluetoothDevice bluetoothDevice = models.get(i);
+                if (bluetoothDevice != null && bluetoothDevice.getBluetoothClass().getDeviceClass() == ConnectHelper.PRINT_TYPE) {
+                    printDevices.add(bluetoothDevice);
+                }
+            }
+        }
+
+        if (mBluetoothAdapter == null) {
+            mBluetoothAdapter = new BluetoothAdapter(BlueToothPrintAct.this, printDevices);
+            mBluetoothAdapter.setOnSendListener(mOnSendListener);
+            mRecyclerView.setAdapter(mBluetoothAdapter);
+        } else {
+            mBluetoothAdapter.setModels(printDevices);
+        }
+    }
+
+
+    private BluetoothAdapter.OnSendListener mOnSendListener = new BluetoothAdapter.OnSendListener() {
+        @Override
+        public void send(final BluetoothDevice device) {
+            //TODO 对指定设备发送消息(必须先连接)
+            /*AlertDialog.Builder builder = new AlertDialog.Builder(mActivity);
+            builder.setTitle("选择连接类型");
+            final String[] str = {"ESP机型", "汉印打印机"};
+            builder.setSingleChoiceItems(str, -1, new DialogInterface.OnClickListener() {
+                        @Override
+                        public void onClick(DialogInterface dialog, int which) {
+                            //客户点击后,对话框记得消失
+                            dialog.dismiss();
+                            if (which == 0) {
+                                //ESC机型
+                                boolean bindOk = connectHelper.toConnectDevice(device);
+                                if (bindOk) {
+
+                                }
+                            } else {
+                                //汉印打印机
+                                connectHelper.toConnectDeviceHY(device);
+                            }
+
+                        }
+                    }
+            );
+            builder.show();*/
+
+            String newAddress = device.getAddress();
+            if (!TextUtils.isEmpty(newAddress) && newAddress.equals(mOldAddress)) {
+                if (isConnected) {
+                    printEvent();
+                } else {
+                    mRetryCount = 0;
+                    progressDialog.show();
+                    connectHelper.toConnectDeviceHY(device);
+                }
+            } else {
+                mRetryCount = 0;
+                isConnected = false;
+                SharedPreUtil.saveInt(BlueToothPrintAct.this, "printConnect", 0);
+                progressDialog.show();
+                connectHelper.toConnectDeviceHY(device);
+            }
+
+        }
+
+        @Override
+        public void itemClick(BluetoothDevice device) {
+            connectHelper.toConnectDevice(device);
+        }
+    };
+
+    @Override
+    public void onActivityResult(int requestCode, int resultCode, Intent data) {
+        super.onActivityResult(requestCode, resultCode, data);
+        if (requestCode == REQUEST_ENABLE_BT) {
+            mSwitchView.setOnCheckedChangeListener(null);
+            if (resultCode == RESULT_OK) {
+                mSwitchView.setChecked(true);
+                CommonUtil.toastNoRepeat(BlueToothPrintAct.this, "蓝牙开启成功");
+            } else {
+                mSwitchView.setChecked(false);
+
+                CommonUtil.toastNoRepeat(BlueToothPrintAct.this, "蓝牙开启失败");
+            }
+            mSwitchView.setOnCheckedChangeListener(mOnCheckedChangeListener);
+        }
+    }
+
+    private SwitchView.OnCheckedChangeListener mOnCheckedChangeListener = new SwitchView.OnCheckedChangeListener() {
+        @Override
+        public void onCheckedChanged(SwitchView switchView, boolean b) {
+            if (b) {
+                connectHelper.openBluetooth(REQUEST_ENABLE_BT);
+            } else {
+                connectHelper.closeBluetooth();
+            }
+        }
+    };
+
+    @Override
+    protected void onDestroy() {
+        super.onDestroy();
+        if (connectHelper != null) {
+            connectHelper.onDestroy();
+        }
+    }
+}

+ 6 - 4
app/src/main/java/com/uas/hystorage/activity/IndexActivity.java

@@ -211,11 +211,9 @@ public class IndexActivity extends BaseActivity implements AdapterView.OnItemCli
             }
         },500);
 
-
         getPrintTemplate();
         EventBus.getDefault().register(this);
 
-
         iv_add_data.setOnClickListener(new View.OnClickListener() {
             @Override
             public void onClick(View v) {
@@ -1203,13 +1201,18 @@ public class IndexActivity extends BaseActivity implements AdapterView.OnItemCli
     @Override
     public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
         String itemName = (String) gridItemList.get(position).get(DataSourceManager.KEY_GRID_ITEMNAME);
+        //检验送样
+        if(GloableParams.INSPECT_AND_SEND_SAMPLES.equals(itemName)) {
+            Intent intent = new Intent(IndexActivity.this, InspectionSendSamplesAct.class);
+            startActivity(intent);
+            return;
+        }
         //岗位
         String station = ct_indexgangwei.getText().toString().trim();//岗位资源
         if (StringUtil.isEmpty(station)) {
             CommonUtil.toastNoRepeat(this, "请先采集岗位资源");
             return;
         } else {
-
             //工单暂停,工单切换,实时报工
             if (TextUtils.isEmpty(mStaffCode) && (GloableParams.GRIDNAME_WORK_PAUSE.equals(itemName)
                     || GloableParams.GRIDNAME_WORK_SWITCH.equals(itemName)
@@ -1306,7 +1309,6 @@ public class IndexActivity extends BaseActivity implements AdapterView.OnItemCli
                     });
 
                 }else{
-
                     if (StringUtil.isEmpty(workOrder)){
                         //工单启动,人员换岗
                         if (GloableParams.GRIDNAME_WORK_START.equals(itemName)) {

+ 688 - 0
app/src/main/java/com/uas/hystorage/activity/InspectionSendSamplesAct.java

@@ -0,0 +1,688 @@
+package com.uas.hystorage.activity;
+
+import android.content.Intent;
+import android.graphics.drawable.BitmapDrawable;
+import android.os.Bundle;
+import android.support.annotation.Nullable;
+import android.support.v7.widget.DividerItemDecoration;
+import android.support.v7.widget.LinearLayoutManager;
+import android.support.v7.widget.RecyclerView;
+import android.text.TextUtils;
+import android.util.Log;
+import android.view.Gravity;
+import android.view.KeyEvent;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.Window;
+import android.view.inputmethod.EditorInfo;
+import android.widget.Button;
+import android.widget.FrameLayout;
+import android.widget.ImageView;
+import android.widget.LinearLayout;
+import android.widget.PopupWindow;
+import android.widget.RadioGroup;
+import android.widget.TextView;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.android.volley.Request;
+import com.android.volley.toolbox.StringRequest;
+import com.chad.library.adapter.base.BaseQuickAdapter;
+import com.chad.library.adapter.base.BaseViewHolder;
+import com.google.gson.Gson;
+import com.uas.hystorage.R;
+import com.uas.hystorage.bean.InspectionPaintBean;
+import com.uas.hystorage.fragment.BlueToothPrintFragment;
+import com.uas.hystorage.fragment.HePiFragment;
+import com.uas.hystorage.global.GloableParams;
+import com.uas.hystorage.listener.MyEditorActionListener;
+import com.uas.hystorage.tools.SharedPreUtil;
+import com.uas.hystorage.util.CommonUtil;
+import com.uas.hystorage.util.Constants;
+import com.uas.hystorage.util.FastjsonUtil;
+import com.uas.hystorage.util.FragmentUtils;
+import com.uas.hystorage.util.HttpCallback;
+import com.uas.hystorage.util.HttpParams;
+import com.uas.hystorage.util.LogUtil;
+import com.uas.hystorage.util.PrintUtils;
+import com.uas.hystorage.util.StringUtil;
+import com.uas.hystorage.util.VolleyRequest;
+import com.uas.hystorage.util.VollyRequest;
+import com.uas.hystorage.view.ClearableEditText;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import razerdp.basepopup.BasePopupWindow;
+
+public class InspectionSendSamplesAct extends BaseActivity {
+
+    protected String TAG = getClass().getName();
+    private Button bt_return;
+    private TextView tv_title, tv_gangweiname;
+    private ImageView iv_icon, iv_search;
+    private RadioGroup rg_jianyanleixin;
+    private ClearableEditText cet_gangweiziyuan;
+    private TextView cet_jitai, cet_gondanhao, cet_xiangmuhao;
+    private TextView tv_isok, tv_details;
+    private Button bt_dayinbiaoqian;
+    private LinearLayout ll_inspection;
+    private FrameLayout fl_dayin;
+
+    private String rb_changetext = "首件";
+    private StringRequest mStringRequest;
+    private ClearableEditText edit_et;
+    private RecyclerView rv_line_ip_port_data;
+    private PopupWindow editPW;
+    private IpAndResourcesPortAdapter ipAndResourcesPortAdapter;
+    private ArrayList<ComDataBean> ComDataBeanList;
+    private String sc_name;
+    private String sc_code;
+    private boolean isPrinting = false;
+    private boolean isConnected = false;
+    private int mPrintDpi = 203;
+
+    @Override
+    protected void initViews() {
+        setContentView(R.layout.act_inspection_send_samples);
+        bt_return = findViewById(R.id.bt_return);
+        tv_title = findViewById(R.id.tv_title);
+        iv_icon = findViewById(R.id.iv_icon);
+
+        ll_inspection = findViewById(R.id.ll_inspection);
+        fl_dayin = findViewById(R.id.fl_dayin);
+
+        rg_jianyanleixin = findViewById(R.id.rg_jianyanleixin);
+        cet_gangweiziyuan = findViewById(R.id.cet_gangweiziyuan);
+        iv_search = findViewById(R.id.iv_search);
+        tv_gangweiname = findViewById(R.id.tv_gangweiname);
+
+        cet_jitai = findViewById(R.id.cet_jitai);
+        cet_gondanhao = findViewById(R.id.cet_gondanhao);
+        cet_xiangmuhao = findViewById(R.id.cet_xiangmuhao);
+
+        bt_dayinbiaoqian = findViewById(R.id.bt_dayinbiaoqian);
+        tv_isok = findViewById(R.id.tv_isok);
+        tv_details = findViewById(R.id.tv_details);
+
+        ComDataBeanList = new ArrayList<>();
+        isConnected = (SharedPreUtil.getInt(InspectionSendSamplesAct.this, "printConnect", 0) == 1);
+        mPrintDpi = SharedPreUtil.getInt(InspectionSendSamplesAct.this, "printDpi", 203);
+    }
+
+    @Override
+    protected void initEvents() {
+        bt_return.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                finish();
+            }
+        });
+        iv_icon.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                //送样清单列表
+                startActivity(new Intent(InspectionSendSamplesAct.this,SampleDeliveryListAct.class));
+            }
+        });
+        rg_jianyanleixin.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
+            @Override
+            public void onCheckedChanged(RadioGroup group, int checkedId) {
+                switch (checkedId) {
+                    case R.id.rb_shoujian:
+                        rb_changetext = "首件";
+                        break;
+                    case R.id.rb_xunjian:
+                        rb_changetext = "巡检";
+                        break;
+                }
+            }
+        });
+
+        CommonUtil.setEditorActionListener(cet_gangweiziyuan, new MyEditorActionListener() {
+            @Override
+            public void MyEditorAction(String text, int actionId, KeyEvent event) {
+                getSourcePunchInfo(text);
+            }
+        });
+
+        iv_search.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                getRepairStep();
+            }
+        });
+
+        bt_dayinbiaoqian.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                getPrintLabel();
+            }
+        });
+    }
+
+    /**
+     * 打印标签按钮
+     * */
+    private void getPrintLabel() {
+        //String  data   --json 串
+        //{sr_sccode:岗位资源编号,sr_devcode:机台号,sr_makecode:工单号,sr_itemcode:项目号,sr_sendtype:送样类型(首件或者巡检)}
+        //测试数据:
+        //{"sr_sccode":"ZX0000-104","sr_devcode":"DEV001","sr_makecode":"5106-24090610269-5","sr_itemcode":"2323342","sr_sendtype":"首件"}
+        if (TextUtils.isEmpty(cet_gangweiziyuan.getText().toString().trim())) {
+            CommonUtil.toastNoRepeat(InspectionSendSamplesAct.this, "岗位资源不能为空");
+            return;
+        }
+        if (TextUtils.isEmpty(cet_jitai.getText().toString().trim())) {
+            CommonUtil.toastNoRepeat(InspectionSendSamplesAct.this, "机台号不能为空");
+            return;
+        }
+        if (TextUtils.isEmpty(cet_gondanhao.getText().toString().trim())) {
+            CommonUtil.toastNoRepeat(InspectionSendSamplesAct.this, "工单号不能为空");
+            return;
+        }
+        if (TextUtils.isEmpty(cet_xiangmuhao.getText().toString().trim())) {
+            CommonUtil.toastNoRepeat(InspectionSendSamplesAct.this, "项目号不能为空");
+            return;
+        }
+        Map<String, Object> params = new HashMap<>();
+        params.put("sr_sccode",cet_gangweiziyuan.getText().toString().trim());
+        params.put("sr_devcode",cet_jitai.getText().toString().trim());
+        params.put("sr_makecode",cet_gondanhao.getText().toString().trim());
+        params.put("sr_itemcode",cet_xiangmuhao.getText().toString().trim());
+        params.put("sr_sendtype",rb_changetext);
+        String data = JSON.toJSONString(params);
+        progressDialog.show();
+        VollyRequest.getInstance().stringRequest(mStringRequest,
+                new HttpParams.Builder()
+                        .url(GloableParams.ADDRESS_SAVESAMPLEREPORT)
+                        .method(Request.Method.POST)
+                        .addParam("data",data)
+                        .tag("getMaCode")
+                        .flag(0)
+                        .build(), new HttpCallback() {
+                    @Override
+                    public void onSuccess(int flag, Object o) throws Exception {
+                        progressDialog.dismiss();
+                        try{
+                            InspectionPaintBean inspectionPaintBean = new Gson().fromJson(o.toString(), InspectionPaintBean.class);
+                            if (inspectionPaintBean != null && inspectionPaintBean.isSuccess()) {
+                                InspectionPaintBean.DataBean data1 = inspectionPaintBean.getData().get(0);
+                                tv_isok.setTextColor(getResources().getColor(R.color.blue));
+                                tv_isok.setText("生成送样单成功");
+                                tv_details.setText("单号: " + data1.getSR_CODE() + "\n" +
+                                        "检验类型: " + data1.getSR_SENDTYPE() +  "\n" +
+                                        "岗位资源: " + data1.getSR_SCCODE() + "(" + data1.getSR_SCNAME() + ")" +  "\n" +
+                                        "机台: " + data1.getSR_DEVCODE() +  "\n" +
+                                        "工单号: " + data1.getSR_MAKECODE() +  "\n" +
+                                        "项目号: " + data1.getSR_ITEMCODE()
+                                );
+                                //调用打印接口
+                                JSONObject resultObject = JSON.parseObject(o.toString());
+                                JSONArray savedataArrays = resultObject.getJSONArray("data");
+                                if (savedataArrays != null && savedataArrays.size() > 0) {
+                                    getPrintTemplate(savedataArrays);
+                                }
+                            }
+                        }catch (Exception e) {
+                            e.printStackTrace();
+                        }
+                    }
+                    @Override
+                    public void onFail(int flag, String failStr) throws Exception {
+                        progressDialog.dismiss();
+                        tv_isok.setTextColor(getResources().getColor(R.color.red));
+                        tv_isok.setText(failStr);
+                    }
+                });
+    }
+
+    /**
+     * 打印
+     * */
+    private void getPrintTemplate(JSONArray savedataArrays) {
+        progressDialog.show();
+        VolleyRequest.getInstance().stringRequest(mStringRequest,
+                new HttpParams.Builder()
+                        .url(GloableParams.ADDRESS_BARINFO_PRINTMODEL)
+                        .method(Request.Method.GET)
+                        .flag(0)
+                        .tag("barinfoPrint")
+                        .addParam("caller", "SampleReportBarPrint")//Barcode!PDAPrint仓库
+                        .build(), new HttpCallback() {
+                    @Override
+                    public void onSuccess(int flag, Object o) throws Exception {
+                        progressDialog.dismiss();
+                        try {
+                            String result = o.toString();
+                            Log.e("aaa", "打印接口数据" + result);
+                            if (FastjsonUtil.validate(result)) {
+                                JSONObject resultObject = JSON.parseObject(result);
+                                JSONArray dataArray = resultObject.getJSONArray("data");
+                                if (dataArray != null && dataArray.size() > 0) {
+                                    SharedPreUtil.saveString(InspectionSendSamplesAct.this, Constants.FLAG.PRINT_TEMPLATE_CACHE, dataArray.toJSONString());
+                                }
+                                //打印时传递保存的数据,非打印模板的数据
+                                printEvent(savedataArrays);
+                            }
+                        } catch (Exception e) {
+                            e.printStackTrace();
+                        }
+
+                    }
+
+                    @Override
+                    public void onFail(int flag, String failStr) throws Exception {
+                        progressDialog.dismiss();
+                        CommonUtil.toastNoRepeat(InspectionSendSamplesAct.this, failStr);
+                    }
+                });
+    }
+
+
+    /**
+     * 搜索
+     * */
+    private void getRepairStep() {
+        progressDialog.show();
+        VollyRequest.getInstance().stringRequest(mStringRequest,
+                new HttpParams.Builder()
+                        .url(GloableParams.ADDRESS_PAD_GETSOURCEBYEMP)
+                        .method(Request.Method.GET)
+                        .tag("getMaCode")
+                        .flag(0)
+                        .build(), new HttpCallback() {
+                    @Override
+                    public void onSuccess(int flag, Object o) throws Exception {
+                        progressDialog.dismiss();
+                        Boolean isSuccess = FastjsonUtil.getBoolean(o.toString(),"success");
+                        JSONArray dataArray = FastjsonUtil.getJSONArray(o.toString(), "data");
+                        if (isSuccess){
+                            if (dataArray == null){
+                                CommonUtil.toastNoRepeat(InspectionSendSamplesAct.this,"未搜索到匹配数据");
+                            }else {
+                                handleFeededlineData(dataArray);
+                            }
+                        }
+                    }
+                    @Override
+                    public void onFail(int flag, String failStr) throws Exception {
+                        progressDialog.dismiss();
+                        tv_isok.setTextColor(getResources().getColor(R.color.red));
+                        tv_isok.setText(failStr);
+                        //CommonUtil.toastNoRepeat(InspectionSendSamplesAct.this, failStr);
+                    }
+                });
+    }
+
+    private void printEvent(com.alibaba.fastjson.JSONArray printArray) {
+        if (isPrinting) {
+            CommonUtil.toastNoRepeat(InspectionSendSamplesAct.this, "正在打印中,请勿重复操作");
+            return;
+        }
+        isPrinting = true;
+        if (printArray != null && printArray.size() > 0) {
+            boolean isFail = false;
+            for (int i = 0; i < printArray.size(); i++) {
+                try {
+                    JSONObject printObject = printArray.getJSONObject(i);
+                    int printResult = PrintUtils.printBar(InspectionSendSamplesAct.this, printObject.toString(), mPrintDpi, null);
+                    if (printResult <= 0) {
+                        isFail = true;
+                    }
+                } catch (Exception e) {
+                    e.printStackTrace();
+                }
+            }
+            progressDialog.dismiss();
+            if (isFail) {
+                isConnected = false;
+                SharedPreUtil.saveInt(InspectionSendSamplesAct.this, "printConnect", 0);
+                CommonUtil.toastNoRepeat(InspectionSendSamplesAct.this, "打印失败,请重新连接打印机");
+
+                Intent intent = new Intent(InspectionSendSamplesAct.this, BlueToothPrintAct.class);
+                intent.putExtra(Constants.KEY.BARCODE_PRINT_ARRAY, printArray.toString());
+                startActivity(intent);
+            } else {
+                bt_dayinbiaoqian.setEnabled(false);
+                CommonUtil.toastNoRepeat(InspectionSendSamplesAct.this, "打印成功");
+            }
+        } else {
+            CommonUtil.toastNoRepeat(InspectionSendSamplesAct.this, "打印失败,条码数据为空");
+        }
+        isPrinting = false;
+    }
+
+    @Override
+    protected void initDatas() {
+        tv_title.setText("检验送样");
+        iv_icon.setBackground(getResources().getDrawable(R.drawable.ic_jump_smt_query));
+    }
+
+    private void handleFeededlineData(JSONArray dataArray) {
+        ComDataBean bean;
+        ComDataBeanList.clear();
+        for (Object index : dataArray) {
+            JSONObject data = (JSONObject) index;
+            bean= new ComDataBean();
+            bean.setItemName(data.getString("SC_NAME"));
+            bean.setItemremark(data.getString("SC_CODE"));
+            ComDataBeanList.add(bean);
+        }
+        initresourcesPopupWindow();
+    }
+
+    private void initresourcesPopupWindow() {
+        View contView = LayoutInflater.from(InspectionSendSamplesAct.this).inflate(R.layout.index_recycle_item, null);
+        edit_et = (ClearableEditText) contView.findViewById(R.id.edit_et);
+        TextView sure_tv = (TextView) contView.findViewById(R.id.sure_tv);
+        TextView cancle_tv = (TextView) contView.findViewById(R.id.cancle_tv);
+        ImageView search_im = contView.findViewById(R.id.search_im);
+        LinearLayout line_top = contView.findViewById(R.id.line_top);
+        rv_line_ip_port_data = contView.findViewById(R.id.rv_ip_port_data);
+        rv_line_ip_port_data.addItemDecoration(new DividerItemDecoration(InspectionSendSamplesAct.this, LinearLayout.VERTICAL));
+        rv_line_ip_port_data.setLayoutManager(new LinearLayoutManager(InspectionSendSamplesAct.this));
+        ipAndResourcesPortAdapter = new IpAndResourcesPortAdapter(ComDataBeanList);
+        ipAndResourcesPortAdapter.setmList(ComDataBeanList);
+        rv_line_ip_port_data.setAdapter(ipAndResourcesPortAdapter);
+        setlineAdapter(ComDataBeanList);
+        //        edit_et.setText(ct_qty.getText().toString().trim());
+
+        edit_et.requestFocus();
+        editPW = new PopupWindow(contView, LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT, true);
+        editPW.setTouchable(true);
+        editPW.setBackgroundDrawable(new BitmapDrawable());
+        editPW.setOnDismissListener(new BasePopupWindow.OnDismissListener() {
+            @Override
+            public void onDismiss() {
+                closeListPopupWindow();
+            }
+        });
+        View parentView = InspectionSendSamplesAct.this.getWindow().findViewById(Window.ID_ANDROID_CONTENT);
+        editPW.showAtLocation(parentView, Gravity.CENTER, 0, 0);
+        CommonUtil.setBackgroundAlpha(InspectionSendSamplesAct.this, 0.5f);
+        edit_et.setOnEditorActionListener(new TextView.OnEditorActionListener() {
+            @Override
+            public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
+                if (actionId == EditorInfo.IME_ACTION_DONE
+                        || actionId == EditorInfo.IME_ACTION_SEND
+                        || (event != null && event.getAction() == KeyEvent.ACTION_DOWN && event.getKeyCode() == KeyEvent.KEYCODE_ENTER)) {
+                    String mSearchStr = edit_et.getText().toString().trim();
+                    if (!mSearchStr.isEmpty()) {
+                        List<ComDataBean> thisList = new ArrayList<>();
+                        for(int i=0;i<ComDataBeanList.size();i++){
+                            if(ComDataBeanList.get(i).getItemremark().contains(mSearchStr)||ComDataBeanList.get(i).getItemName().contains(mSearchStr)){
+                                thisList.add(ComDataBeanList.get(i));
+                            }
+                            if(i == ComDataBeanList.size() -1){
+                                ipAndResourcesPortAdapter = new IpAndResourcesPortAdapter(thisList);
+                                rv_line_ip_port_data.setAdapter(ipAndResourcesPortAdapter);
+                                LogUtil.i("mSearchStr", JSON.toJSONString(thisList));
+
+                            }
+                            List<ComDataBean> lineCodeEntities = ipAndResourcesPortAdapter.getmList();
+                            for (int j = 0; j < lineCodeEntities.size(); j++) {
+                                lineCodeEntities.get(j).setChecked(false);
+                            }
+                            ipAndResourcesPortAdapter.notifyDataSetChanged();
+                        }
+                    } else {
+                        ipAndResourcesPortAdapter = new IpAndResourcesPortAdapter(ComDataBeanList);
+                        rv_line_ip_port_data.setAdapter(ipAndResourcesPortAdapter);
+                        List<ComDataBean> lineCodeEntities = ipAndResourcesPortAdapter.getmList();
+                        for (int i = 0; i < lineCodeEntities.size(); i++) {
+                            lineCodeEntities.get(i).setChecked(false);
+                        }
+                        ipAndResourcesPortAdapter.notifyDataSetChanged();
+
+                    }
+                    ipAndResourcesPortAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
+
+                        @Override
+                        public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
+                            List<ComDataBean> ipAndPortBeans = ipAndResourcesPortAdapter.getmList();
+                            sc_name = ipAndPortBeans.get(position).getItemName();
+                            sc_code = ipAndPortBeans.get(position).getItemremark();
+                            for (int i = 0; i < ipAndPortBeans.size(); i++) {
+                                ipAndPortBeans.get(i).setChecked(false);
+                            }
+                            ipAndPortBeans.get(position).setChecked(true);
+                            ipAndResourcesPortAdapter.notifyDataSetChanged();
+                        }
+                    });
+                    return true;
+                }
+                return false;
+            }
+        });
+
+        search_im.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                String mSearchStr = edit_et.getText().toString().trim();
+                if (!mSearchStr.isEmpty()) {
+                    List<ComDataBean> thisList = new ArrayList<>();
+                    for(int i=0;i<ComDataBeanList.size();i++){
+                        if(ComDataBeanList.get(i).getItemremark().contains(mSearchStr)||ComDataBeanList.get(i).getItemName().contains(mSearchStr)){
+                            thisList.add(ComDataBeanList.get(i));
+                        }
+                        if(i == ComDataBeanList.size() -1){
+                            ipAndResourcesPortAdapter = new IpAndResourcesPortAdapter(thisList);
+                            rv_line_ip_port_data.setAdapter(ipAndResourcesPortAdapter);
+                            LogUtil.i("mSearchStr", JSON.toJSONString(thisList));
+
+                        }
+                        List<ComDataBean> lineCodeEntities = ipAndResourcesPortAdapter.getmList();
+                        for (int j = 0; j < lineCodeEntities.size(); j++) {
+                            lineCodeEntities.get(j).setChecked(false);
+                        }
+                        ipAndResourcesPortAdapter.notifyDataSetChanged();
+                    }
+
+
+                } else {
+                    ipAndResourcesPortAdapter = new IpAndResourcesPortAdapter(ComDataBeanList);
+                    rv_line_ip_port_data.setAdapter(ipAndResourcesPortAdapter);
+                    List<ComDataBean> lineCodeEntities = ipAndResourcesPortAdapter.getmList();
+                    for (int i = 0; i < lineCodeEntities.size(); i++) {
+                        lineCodeEntities.get(i).setChecked(false);
+                    }
+                    ipAndResourcesPortAdapter.notifyDataSetChanged();
+
+                }
+                ipAndResourcesPortAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
+
+                    @Override
+                    public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
+                        List<ComDataBean> ipAndPortBeans = ipAndResourcesPortAdapter.getmList();
+                        sc_name = ipAndPortBeans.get(position).getItemName();
+                        sc_code = ipAndPortBeans.get(position).getItemremark();
+                        for (int i = 0; i < ipAndPortBeans.size(); i++) {
+                            ipAndPortBeans.get(i).setChecked(false);
+                        }
+                        ipAndPortBeans.get(position).setChecked(true);
+                        ipAndResourcesPortAdapter.notifyDataSetChanged();
+                    }
+                });
+            }
+        });
+
+        List<String> list=new ArrayList<>();
+        //确定
+        sure_tv.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                list.clear();
+
+                if (StringUtil.isEmpty(sc_code)){
+                    CommonUtil.toastNoRepeat(InspectionSendSamplesAct.this,"请选择工序");
+                    return;
+                }
+                cet_gangweiziyuan.setText(sc_code);
+                cet_gangweiziyuan.requestFocus();
+                cet_gangweiziyuan.setSelection(cet_gangweiziyuan.getText().length());
+                getSourcePunchInfo(cet_gangweiziyuan.getText().toString().trim());
+                closeListPopupWindow();
+            }
+        });
+
+        //取消
+        cancle_tv.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                closeListPopupWindow();
+            }
+        });
+
+        String mSearchStr = edit_et.getText().toString().trim();
+        if (mSearchStr.isEmpty()) {
+            ipAndResourcesPortAdapter = new IpAndResourcesPortAdapter(ComDataBeanList);
+            rv_line_ip_port_data.setAdapter(ipAndResourcesPortAdapter);
+            List<ComDataBean> lineCodeEntities = ipAndResourcesPortAdapter.getmList();
+            for (int i = 0; i < lineCodeEntities.size(); i++) {
+                lineCodeEntities.get(i).setChecked(false);
+            }
+            ipAndResourcesPortAdapter.notifyDataSetChanged();
+
+            ipAndResourcesPortAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
+
+                @Override
+                public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
+                    List<ComDataBean> ipAndPortBeans = ipAndResourcesPortAdapter.getmList();
+                    sc_name = ipAndPortBeans.get(position).getItemName();
+                    sc_code = ipAndPortBeans.get(position).getItemremark();
+                    for (int i = 0; i < ipAndPortBeans.size(); i++) {
+                        ipAndPortBeans.get(i).setChecked(false);
+                    }
+                    ipAndPortBeans.get(position).setChecked(true);
+                    ipAndResourcesPortAdapter.notifyDataSetChanged();
+                }
+            });
+        }
+    }
+
+    /**
+     * 岗位资源enter事件
+     */
+    private void getSourcePunchInfo(String sccode) {
+        if (sccode.isEmpty()){
+            CommonUtil.toastNoRepeat(InspectionSendSamplesAct.this, "请输入岗位编号");
+            return;
+        }
+
+        progressDialog.show();
+        VollyRequest.getInstance().stringRequest(mStringRequest,
+                new HttpParams.Builder()
+                        .url(GloableParams.ADDRESS_GETSOURCEDATA)
+                        .method(Request.Method.GET)
+                        .tag(TAG + "getMaCode")
+                        .flag(0)
+                        .addParam("sc_code",sccode)//岗位资源编号
+                        .build(), new HttpCallback() {
+                    @Override
+                    public void onSuccess(int flag, Object o) throws Exception {
+                        progressDialog.dismiss();
+                        Boolean isSuccess = FastjsonUtil.getBoolean(o.toString(),"success");
+                        if (isSuccess){
+                            JSONObject dataObject = FastjsonUtil.getJSONObject(o.toString(),"data");
+                            if (dataObject == null){
+
+                            }else {
+                                String SC_CODE = dataObject.getString("SC_CODE") == null ? "" : dataObject.getString("SC_CODE");
+                                String SC_NAME = dataObject.getString("SC_NAME") == null ? "" : dataObject.getString("SC_NAME");
+                                tv_gangweiname.setText(SC_NAME);
+                            }
+                        }
+                    }
+                    @Override
+                    public void onFail(int flag, String failStr) throws Exception {
+                        progressDialog.dismiss();
+                        tv_isok.setText(failStr);
+                        tv_isok.setTextColor(getResources().getColor(R.color.red));
+                        cet_gangweiziyuan.requestFocus();
+                    }
+                });
+    }
+
+    private void setlineAdapter(ArrayList<ComDataBean> mList) {
+        LogUtil.i("mList", JSON.toJSONString(mList));
+        ipAndResourcesPortAdapter = new IpAndResourcesPortAdapter(mList);
+        ipAndResourcesPortAdapter.setmList(ComDataBeanList);
+        ipAndResourcesPortAdapter.notifyDataSetChanged();
+        rv_line_ip_port_data.setAdapter(ipAndResourcesPortAdapter);
+    }
+
+    private void closeListPopupWindow() {
+        if (editPW != null) {
+            editPW.dismiss();
+            editPW = null;
+            CommonUtil.setBackgroundAlpha(InspectionSendSamplesAct.this, 1f);
+        }
+
+    }
+
+    private class IpAndResourcesPortAdapter extends BaseQuickAdapter<ComDataBean, BaseViewHolder> {
+        private List<ComDataBean> mmmmList;
+
+        public List<ComDataBean> getmList() {
+            return mmmmList;
+        }
+
+        public void setmList(List<ComDataBean> mList) {
+            this.mmmmList = mList;
+        }
+        public ComDataBean getBeanByPositon(int position){
+            return mmmmList.get(position);
+        }
+
+        private IpAndResourcesPortAdapter(@Nullable List<ComDataBean> data) {
+            super(R.layout.fuzzy_ipandport_item, data);
+            this.mmmmList = data;
+        }
+        @Override
+        protected void convert(BaseViewHolder helper, ComDataBean item) {
+            helper.setText(R.id.macode_ip__Tv,item.getItemremark()+"-("+item.getItemName()+")");
+            LinearLayout line_true = helper.itemView.findViewById(R.id.line_true);
+            if (item.getChecked()) {
+                line_true.setSelected(true);
+            } else {
+                line_true.setSelected(false);
+            }
+        }
+    }
+
+
+    private class ComDataBean{
+        String itemName = null;
+        String itemremark = null;
+        boolean Checked;
+
+        public boolean getChecked() {
+            return Checked;
+        }
+
+        public void setChecked(boolean checked) {
+            Checked = checked;
+        }
+
+        public String getItemName() {
+            return itemName;
+        }
+
+        public void setItemName(String itemName) {
+            this.itemName = itemName;
+        }
+
+        public String getItemremark() {
+            return itemremark;
+        }
+
+        public void setItemremark(String itemremark) {
+            this.itemremark = itemremark;
+        }
+    }
+    
+}

+ 613 - 0
app/src/main/java/com/uas/hystorage/activity/SampleDeliveryListAct.java

@@ -0,0 +1,613 @@
+package com.uas.hystorage.activity;
+
+import android.app.AlertDialog;
+import android.content.DialogInterface;
+import android.content.Intent;
+import android.os.Bundle;
+import android.support.annotation.Nullable;
+import android.support.v4.app.FragmentManager;
+import android.support.v4.app.FragmentTransaction;
+import android.support.v7.widget.DividerItemDecoration;
+import android.support.v7.widget.LinearLayoutManager;
+import android.support.v7.widget.RecyclerView;
+import android.text.Editable;
+import android.text.TextUtils;
+import android.text.TextWatcher;
+import android.util.Log;
+import android.view.KeyEvent;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.view.inputmethod.EditorInfo;
+import android.widget.AdapterView;
+import android.widget.BaseAdapter;
+import android.widget.Button;
+import android.widget.CheckBox;
+import android.widget.FrameLayout;
+import android.widget.ImageView;
+import android.widget.LinearLayout;
+import android.widget.ListView;
+import android.widget.TextView;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.android.volley.Request;
+import com.android.volley.toolbox.StringRequest;
+import com.chad.library.adapter.base.BaseQuickAdapter;
+import com.chad.library.adapter.base.BaseViewHolder;
+import com.handmark.pulltorefresh.library.PullToRefreshBase;
+import com.handmark.pulltorefresh.library.PullToRefreshListView;
+import com.uas.hystorage.R;
+import com.uas.hystorage.bean.SampleDeliveryBean;
+import com.uas.hystorage.fragment.BlueToothPrintFragment;
+import com.uas.hystorage.fragment.HePiFragment;
+import com.uas.hystorage.global.GloableParams;
+import com.uas.hystorage.tools.SharedPreUtil;
+import com.uas.hystorage.util.CommonUtil;
+import com.uas.hystorage.util.Constants;
+import com.uas.hystorage.util.FastjsonUtil;
+import com.uas.hystorage.util.FragmentUtils;
+import com.uas.hystorage.util.HttpCallback;
+import com.uas.hystorage.util.HttpParams;
+import com.uas.hystorage.util.ListUtils;
+import com.uas.hystorage.util.LogUtil;
+import com.uas.hystorage.util.PrintUtils;
+import com.uas.hystorage.util.StringUtil;
+import com.uas.hystorage.util.VolleyRequest;
+import com.uas.hystorage.util.VollyRequest;
+import com.uas.hystorage.view.ClearableEditText;
+import com.uas.hystorage.view.EmptyLayout;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class SampleDeliveryListAct extends BaseActivity{
+
+    private StringRequest mStringRequest;
+    private List<SampleDeliveryBean> ComDataBeanList;
+//    private RecyclerView rv_data;
+//    private InspectionAdapter inspectionAdapter;
+    private ClearableEditText cet_search_et;
+    private TextView tv_title,tv_search_btn;
+    private Button bt_return;
+
+    private boolean isPrinting = false;
+    private boolean isConnected = false;
+    private int mPrintDpi = 203;
+    private PullToRefreshListView refreshListView;
+    private int page = 1;
+    private int pageSize = 20;
+    private EmptyLayout mEmptyLayout;
+
+    private ListAdapter mAdapter = null;
+
+    @Override
+    protected void initViews() {
+        setContentView(R.layout.act_sample_selivery_list);
+
+        bt_return = findViewById(R.id.bt_return);
+        tv_title = findViewById(R.id.tv_title);
+
+        cet_search_et = findViewById(R.id.cet_search_et);
+        tv_search_btn = findViewById(R.id.tv_search_btn);
+        refreshListView = findViewById(R.id.refreshListView);
+//        rv_data = findViewById(R.id.rv_data);
+
+        ComDataBeanList = new ArrayList<>();
+//        rv_data.addItemDecoration(new DividerItemDecoration(SampleDeliveryListAct.this, LinearLayout.VERTICAL));
+//        rv_data.setLayoutManager(new LinearLayoutManager(SampleDeliveryListAct.this));
+//        inspectionAdapter = new InspectionAdapter(ComDataBeanList);
+//        inspectionAdapter.setmList(ComDataBeanList);
+//        rv_data.setAdapter(inspectionAdapter);
+
+    }
+
+    @Override
+    protected void initEvents() {
+        bt_return.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                finish();
+            }
+        });
+        cet_search_et.setOnEditorActionListener(new TextView.OnEditorActionListener() {
+            @Override
+            public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
+                if (actionId == EditorInfo.IME_ACTION_DONE
+                        || actionId == EditorInfo.IME_ACTION_SEND
+                        || (event != null && event.getAction() == KeyEvent.ACTION_DOWN
+                        && event.getKeyCode() == KeyEvent.KEYCODE_ENTER)) {
+                    String mSearchStr = cet_search_et.getText().toString().trim();
+                    if (!mSearchStr.isEmpty()) {
+                        getQualityController(page,pageSize,mSearchStr);
+                    }
+                }
+                return false;
+            }
+        });
+        tv_search_btn.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                getQualityController(page,pageSize,cet_search_et.getText().toString().trim());
+            }
+        });
+
+//        inspectionAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
+//            @Override
+//            public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
+//                try{
+//                    int numberId = ComDataBeanList.get(position).getSR_ID();
+//                    new AlertDialog.Builder(SampleDeliveryListAct.this).setTitle("提示").setMessage("是否打印标签?")
+//                            .setPositiveButton(getString(R.string.confirm), new DialogInterface.OnClickListener() {
+//                                @Override
+//                                public void onClick(DialogInterface dialog, int which) {
+//                                    printLabel(numberId);
+//                                }
+//                            }).setNegativeButton(getString(R.string.cancel), null)
+//                            .create()
+//                            .show();
+//                }catch (Exception e) {
+//                    e.printStackTrace();
+//                }
+//            }
+//        });
+
+        cet_search_et.addTextChangedListener(new TextWatcher() {
+            @Override
+            public void beforeTextChanged(CharSequence s, int start, int count, int after) {
+
+            }
+
+            @Override
+            public void onTextChanged(CharSequence s, int start, int before, int count) {
+
+            }
+
+            @Override
+            public void afterTextChanged(Editable s) {
+                if (s.length() >= 0) {
+                    String mSearchStr = s.toString().trim();
+                    LogUtil.i("mSearchStr",mSearchStr);
+                    List<SampleDeliveryBean> sampleList = new ArrayList<>();
+                    for(int i=0;i < ComDataBeanList.size();i++){
+                        if(ComDataBeanList.get(i).getSR_CODE().contains(mSearchStr)
+                                || ComDataBeanList.get(i).getSR_SCCODE().contains(mSearchStr)
+                                || ComDataBeanList.get(i).getSR_SCNAME().contains(mSearchStr)
+                                || ComDataBeanList.get(i).getSR_SENDTYPE().contains(mSearchStr)
+                                || ComDataBeanList.get(i).getSR_MAKECODE().contains(mSearchStr)
+                                || ComDataBeanList.get(i).getSR_ITEMCODE().contains(mSearchStr)
+                                || ComDataBeanList.get(i).getSR_DEVCODE().contains(mSearchStr)
+                        ){
+                            sampleList.add(ComDataBeanList.get(i));
+                        }
+                    }
+                    mAdapter.setModels(sampleList);
+                } else {
+                    mAdapter.setModels(ComDataBeanList);
+                }
+            }
+        });
+
+        refreshListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
+            @Override
+            public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
+                try{
+                    int numberId = ComDataBeanList.get((int) l).getSR_ID();
+                    new AlertDialog.Builder(SampleDeliveryListAct.this).setTitle("提示").setMessage("是否打印标签?")
+                            .setPositiveButton(getString(R.string.confirm), new DialogInterface.OnClickListener() {
+                                @Override
+                                public void onClick(DialogInterface dialog, int which) {
+                                    printLabel(numberId);
+                                }
+                            }).setNegativeButton(getString(R.string.cancel), null)
+                            .create()
+                            .show();
+                }catch (Exception e) {
+                    e.printStackTrace();
+                }
+            }
+        });
+    }
+
+    @Override
+    protected void initDatas() {
+        refreshListView = (PullToRefreshListView) findViewById(R.id.refreshListView);
+        refreshListView.setMode(PullToRefreshBase.Mode.BOTH);
+        mEmptyLayout = new EmptyLayout(this, refreshListView.getRefreshableView());
+        mEmptyLayout.setShowLoadingButton(false);
+        mEmptyLayout.setShowEmptyButton(false);
+        mEmptyLayout.setShowErrorButton(false);
+        mEmptyLayout.setEmptyMessage("暂无数据");
+
+        refreshListView.setOnRefreshListener(new PullToRefreshBase.OnRefreshListener2<ListView>() {
+            @Override
+            public void onPullDownToRefresh(PullToRefreshBase<ListView> refreshView) {
+                getQualityController(page = 1,pageSize,"");
+            }
+
+            @Override
+            public void onPullUpToRefresh(PullToRefreshBase<ListView> refreshView) {
+                getQualityController(page++,pageSize,"");
+            }
+        });
+
+        getQualityController(page,pageSize,"");
+    }
+
+    private void printLabel(int sr_id) {
+        progressDialog.show();
+        VollyRequest.getInstance().stringRequest(mStringRequest,
+                new HttpParams.Builder()
+                        .url(GloableParams.ADDRESS_PRINTSAMPLEREPORT)
+                        .method(Request.Method.GET)
+                        .addParam("sr_id","" + sr_id)
+                        .tag("getMaCode")
+                        .flag(0)
+                        .build(), new HttpCallback() {
+                    @Override
+                    public void onSuccess(int flag, Object o) throws Exception {
+                        progressDialog.dismiss();
+                        Boolean isSuccess = FastjsonUtil.getBoolean(o.toString(),"success");
+                        JSONArray dataArray = FastjsonUtil.getJSONArray(o.toString(), "data");
+                        if (isSuccess){
+                            if (dataArray == null){
+                                CommonUtil.toastNoRepeat(SampleDeliveryListAct.this,"未搜索到匹配数据");
+                            }else {
+                                //调用打印接口
+                                if (dataArray != null && dataArray.size() > 0) {
+                                    getPrintTemplate(dataArray);
+                                }
+                            }
+                        }
+                    }
+                    @Override
+                    public void onFail(int flag, String failStr) throws Exception {
+                        progressDialog.dismiss();
+                        CommonUtil.toastNoRepeat(SampleDeliveryListAct.this, failStr);
+                    }
+                });
+    }
+
+    private void getQualityController(int page,int pageSize,String condition) {
+        progressDialog.show();
+        if (!TextUtils.isEmpty(condition)) {
+            VollyRequest.getInstance().stringRequest(mStringRequest,
+                    new HttpParams.Builder()
+                            .url(GloableParams.ADDRESS_FUZZYSEARCHSAMPLEREPORT)
+                            .method(Request.Method.GET)
+                            .addParam("condition", condition)
+                            .addParam("page", page + "")
+                            .addParam("pageSize", pageSize + "")
+                            .tag("getMaCode")
+                            .flag(0)
+                            .build(), new HttpCallback() {
+                        @Override
+                        public void onSuccess(int flag, Object o) throws Exception {
+                            progressDialog.dismiss();
+                            boolean isSuccess = FastjsonUtil.getBoolean(o.toString(), "success");
+                            JSONArray dataArray = FastjsonUtil.getJSONArray(o.toString(), "data");
+                            if (isSuccess) {
+                                if (dataArray == null) {
+                                    CommonUtil.toastNoRepeat(SampleDeliveryListAct.this, "未搜索到匹配数据");
+                                } else {
+                                    handleFeededlineData(dataArray);
+                                }
+                                refreshListView.onRefreshComplete();
+                            }
+                        }
+
+                        @Override
+                        public void onFail(int flag, String failStr) throws Exception {
+                            progressDialog.dismiss();
+                            CommonUtil.toastNoRepeat(SampleDeliveryListAct.this, failStr);
+                            refreshListView.onRefreshComplete();
+                        }
+                    });
+        }else {
+            VollyRequest.getInstance().stringRequest(mStringRequest,
+                    new HttpParams.Builder()
+                            .url(GloableParams.ADDRESS_FUZZYSEARCHSAMPLEREPORT)
+                            .method(Request.Method.GET)
+                            .tag("getMaCode")
+                            .flag(0)
+                            .build(), new HttpCallback() {
+                        @Override
+                        public void onSuccess(int flag, Object o) throws Exception {
+                            progressDialog.dismiss();
+                            boolean isSuccess = FastjsonUtil.getBoolean(o.toString(), "success");
+                            JSONArray dataArray = FastjsonUtil.getJSONArray(o.toString(), "data");
+                            if (isSuccess) {
+                                if (dataArray == null) {
+                                    CommonUtil.toastNoRepeat(SampleDeliveryListAct.this, "未搜索到匹配数据");
+                                } else {
+                                    handleFeededlineData(dataArray);
+                                }
+                                refreshListView.onRefreshComplete();
+                            }
+                        }
+
+                        @Override
+                        public void onFail(int flag, String failStr) throws Exception {
+                            progressDialog.dismiss();
+                            CommonUtil.toastNoRepeat(SampleDeliveryListAct.this, failStr);
+                            refreshListView.onRefreshComplete();
+                        }
+                    });
+        }
+    }
+
+    private void handleFeededlineData(JSONArray dataArray) {
+        // "SR_ID": 3,                       //单据ID
+        //            "SR_CODE": "XJ24090003",    //单据编号
+        //            "SR_DATE": "2024-09-06 11:03:44", //单据日期
+        //            "SR_SOURCETYPE": "PDA新增",
+        //            "SR_SCCODE": "ZX0000-104",  //岗位资源编号
+        //            "SR_SCNAME": "半检五线12",  //岗位资源名称
+        //            "SR_DEVCODE": "DEV001",  //机台号
+        //            "SR_MAKECODE": "5106-24090610269-5",//工单号
+        //            "SR_ITEMCODE": "2323342",  //项目号
+        //            "SR_STATUS": "在录入"   //单据状态
+        ////sr_sendtype   --送样类型    sr_sendmanname  --检验人
+        SampleDeliveryBean sampleDeliveryBean;
+        ComDataBeanList.clear();
+        for (Object index : dataArray) {
+            JSONObject data = (JSONObject) index;
+            sampleDeliveryBean = new SampleDeliveryBean();
+            sampleDeliveryBean.setSR_ID(data.getInteger("SR_ID"));
+            sampleDeliveryBean.setSR_CODE(data.getString("SR_CODE"));
+            sampleDeliveryBean.setSR_DATE(data.getString("SR_DATE"));
+            sampleDeliveryBean.setSR_SOURCETYPE(data.getString("SR_SOURCETYPE"));
+            sampleDeliveryBean.setSR_SCCODE(data.getString("SR_SCCODE"));
+            sampleDeliveryBean.setSR_SCNAME(data.getString("SR_SCNAME"));
+            sampleDeliveryBean.setSR_DEVCODE(data.getString("SR_DEVCODE"));
+            sampleDeliveryBean.setSR_MAKECODE(data.getString("SR_MAKECODE"));
+            sampleDeliveryBean.setSR_ITEMCODE(data.getString("SR_ITEMCODE"));
+            sampleDeliveryBean.setSR_STATUS(data.getString("SR_STATUS"));
+            sampleDeliveryBean.setSR_SENDTYPE(data.getString("SR_SENDTYPE"));
+            sampleDeliveryBean.setSR_SENDMANNAME(data.getString("SR_SENDMANNAME"));
+            ComDataBeanList.add(sampleDeliveryBean);
+        }
+//        inspectionAdapter.setmList(ComDataBeanList);
+        if (ComDataBeanList.size() <= 0) {
+            mEmptyLayout.showEmpty();
+        }
+        showByAdapter(ComDataBeanList);
+    }
+
+    private class InspectionAdapter extends BaseQuickAdapter<SampleDeliveryBean, BaseViewHolder> {
+        private List<SampleDeliveryBean> mmmmList;
+
+        public List<SampleDeliveryBean> getmList() {
+            return mmmmList;
+        }
+
+        public void setmList(List<SampleDeliveryBean> mList) {
+            this.mmmmList = mList;
+            notifyDataSetChanged();
+        }
+        public SampleDeliveryBean getBeanByPositon(int position){
+            return mmmmList.get(position);
+        }
+
+        private InspectionAdapter(@Nullable List<SampleDeliveryBean> data) {
+            super(R.layout.item_sample_delivery, data);
+            this.mmmmList = data;
+        }
+        @Override
+        protected void convert(BaseViewHolder helper, SampleDeliveryBean item) {
+            //"SR_ID": 3,                       //单据ID
+            //            "SR_CODE": "XJ24090003",    //单据编号
+            //            "SR_DATE": "2024-09-06 11:03:44", //单据日期
+            //            "SR_SOURCETYPE": "PDA新增",
+            //            "SR_SCCODE": "ZX0000-104",  //岗位资源编号
+            //            "SR_SCNAME": "半检五线12",  //岗位资源名称
+            //            "SR_DEVCODE": "DEV001",  //机台号
+            //            "SR_MAKECODE": "5106-24090610269-5",//工单号
+            //            "SR_ITEMCODE": "2323342",  //项目号
+            //            "SR_STATUS": "在录入"   //单据状态
+
+            ////sr_sendtype   --送样类型    sr_sendmanname  --检验人
+            helper.setText(R.id.tv_danhao_num,item.getSR_CODE());     //单据编号
+            helper.setText(R.id.tv_type_num,item.getSR_SENDTYPE());          //类型
+            helper.setText(R.id.tv_jianchariqi_num,item.getSR_DATE());     //检验日期
+            helper.setText(R.id.tv_jianyanren_num,item.getSR_SENDMANNAME());     //检验人
+            helper.setText(R.id.tv_gangweiziyuan_num,item.getSR_SCCODE() + "(" + item.getSR_SCNAME() + ")");     //岗位资源:编号(名称)
+            helper.setText(R.id.tv_jitai_num,item.getSR_DEVCODE());     //机台
+            helper.setText(R.id.tv_xiangmuhao_num,item.getSR_ITEMCODE());     //项目号
+            helper.setText(R.id.tv_gongdanhao_num,item.getSR_MAKECODE());     //工单号
+        }
+    }
+
+
+    /**
+     * 打印
+     * */
+    private void getPrintTemplate(JSONArray savedataArrays) {
+        progressDialog.show();
+        VolleyRequest.getInstance().stringRequest(mStringRequest,
+                new HttpParams.Builder()
+                        .url(GloableParams.ADDRESS_BARINFO_PRINTMODEL)
+                        .method(Request.Method.GET)
+                        .flag(0)
+                        .tag("barinfoPrint")
+                        .addParam("caller", "SampleReportBarPrint")//Barcode!PDAPrint仓库
+                        .build(), new HttpCallback() {
+                    @Override
+                    public void onSuccess(int flag, Object o) throws Exception {
+                        progressDialog.dismiss();
+                        try {
+                            String result = o.toString();
+                            Log.e("aaa", "打印接口数据" + result);
+                            if (FastjsonUtil.validate(result)) {
+                                JSONObject resultObject = JSON.parseObject(result);
+                                JSONArray dataArray = resultObject.getJSONArray("data");
+                                if (dataArray != null && dataArray.size() > 0) {
+                                    SharedPreUtil.saveString(SampleDeliveryListAct.this, Constants.FLAG.PRINT_TEMPLATE_CACHE, dataArray.toJSONString());
+                                }
+                                //打印时传递保存的数据,非打印模板的数据
+                                printEvent(savedataArrays);
+                            }
+                        } catch (Exception e) {
+                            e.printStackTrace();
+                        }
+
+                    }
+
+                    @Override
+                    public void onFail(int flag, String failStr) throws Exception {
+                        progressDialog.dismiss();
+                        CommonUtil.toastNoRepeat(SampleDeliveryListAct.this, failStr);
+                    }
+                });
+    }
+
+    private void printEvent(com.alibaba.fastjson.JSONArray printArray) {
+        if (isPrinting) {
+            CommonUtil.toastNoRepeat(SampleDeliveryListAct.this, "正在打印中,请勿重复操作");
+            return;
+        }
+        isPrinting = true;
+        if (printArray != null && printArray.size() > 0) {
+            boolean isFail = false;
+            for (int i = 0; i < printArray.size(); i++) {
+                try {
+                    JSONObject printObject = printArray.getJSONObject(i);
+                    int printResult = PrintUtils.printBar(SampleDeliveryListAct.this, printObject.toString(), mPrintDpi, null);
+                    if (printResult <= 0) {
+                        isFail = true;
+                    }
+                } catch (Exception e) {
+                    e.printStackTrace();
+                }
+            }
+            progressDialog.dismiss();
+            if (isFail) {
+                isConnected = false;
+                SharedPreUtil.saveInt(SampleDeliveryListAct.this, "printConnect", 0);
+                CommonUtil.toastNoRepeat(SampleDeliveryListAct.this, "打印失败,请重新连接打印机");
+
+                try {
+//                    BlueToothPrintFragment blueToothPrintFragment = new BlueToothPrintFragment();
+//                    Bundle bundle = new Bundle();
+//                    bundle.putString(Constants.KEY.BARCODE_PRINT_ARRAY, printArray.toString());
+//                    Log.e("listArraythree",printArray.toString());
+//                    blueToothPrintFragment.setArguments(bundle);
+//                    getSupportFragmentManager()
+//                            .beginTransaction()
+//                            .replace(R.id.fl_dayin, blueToothPrintFragment)
+//                            .addToBackStack(blueToothPrintFragment.getClass().getSimpleName())
+//                            .commit();
+
+                    Intent intent = new Intent(SampleDeliveryListAct.this, BlueToothPrintAct.class);
+                    intent.putExtra(Constants.KEY.BARCODE_PRINT_ARRAY, printArray.toString());
+                    startActivity(intent);
+
+                }catch (Exception e) {
+                    e.printStackTrace();
+                }
+            } else {
+                CommonUtil.toastNoRepeat(SampleDeliveryListAct.this, "打印成功");
+            }
+        } else {
+            CommonUtil.toastNoRepeat(SampleDeliveryListAct.this, "打印失败,条码数据为空");
+        }
+        isPrinting = false;
+    }
+
+    private void showByAdapter(List<SampleDeliveryBean> models) {
+        if (mAdapter == null) {
+            mAdapter = new ListAdapter(models);
+            refreshListView.setAdapter(mAdapter);
+        } else {
+            if (page == 1) {
+                mAdapter.setModels(models);
+            } else {
+                mAdapter.addModls(models);
+            }
+        }
+        if (ListUtils.isEmpty(models)) {
+            mEmptyLayout.showEmpty();
+        }
+    }
+
+    class ListAdapter extends BaseAdapter {
+        private List<SampleDeliveryBean> models;
+
+        public SampleDeliveryBean getModels(int item) {
+            if (ListUtils.getSize(models) > item) {
+                return models.get(item);
+            }
+            return null;
+        }
+
+        public ListAdapter(List<SampleDeliveryBean> models) {
+            this.models = models;
+        }
+
+        public void setModels(List<SampleDeliveryBean> models) {
+            this.models = models;
+            notifyDataSetChanged();
+        }
+
+        private void addModls(List<SampleDeliveryBean> models) {
+            if (this.models == null) {
+                this.models = new ArrayList<>();
+            }
+            this.models.addAll(models);
+            notifyDataSetChanged();
+        }
+
+        @Override
+        public int getCount() {
+            return ListUtils.getSize(this.models);
+        }
+
+        @Override
+        public Object getItem(int i) {
+            return models.get(i);
+        }
+
+        @Override
+        public long getItemId(int i) {
+            return i;
+        }
+
+        @Override
+        public View getView(int i, View view, ViewGroup viewGroup) {
+            ListAdapter.ViewHoler holer = null;
+            if (view == null) {
+                holer = new ListAdapter.ViewHoler();
+                view = LayoutInflater.from(SampleDeliveryListAct.this).inflate(R.layout.item_sample_delivery, null);
+                holer.tv_danhao_num = view.findViewById(R.id.tv_danhao_num);    //单据编号
+                holer.tv_type_num = view.findViewById(R.id.tv_type_num);            //类型
+                holer.tv_jianchariqi_num = view.findViewById(R.id.tv_jianchariqi_num);      //检验日期
+                holer.tv_jianyanren_num = view.findViewById(R.id.tv_jianyanren_num);       //检验人
+                holer.tv_gangweiziyuan_num = view.findViewById(R.id.tv_gangweiziyuan_num);      //岗位资源:编号(名称)
+                holer.tv_jitai_num = view.findViewById(R.id.tv_jitai_num);       //机台
+                holer.tv_xiangmuhao_num = view.findViewById(R.id.tv_xiangmuhao_num);       //项目号
+                holer.tv_gongdanhao_num = view.findViewById(R.id.tv_gongdanhao_num);       //工单号
+                view.setTag(holer);
+            } else {
+                holer = (ListAdapter.ViewHoler) view.getTag();
+            }
+            SampleDeliveryBean bean = models.get(i);
+            holer.tv_danhao_num.setText(bean.getSR_CODE());     //单据编号
+            holer.tv_type_num.setText(bean.getSR_SENDTYPE());          //类型
+            holer.tv_jianchariqi_num.setText(bean.getSR_DATE());     //检验日期
+            holer.tv_jianyanren_num.setText(bean.getSR_SENDMANNAME());     //检验人
+            holer.tv_gangweiziyuan_num.setText(bean.getSR_SCCODE() + "(" + bean.getSR_SCNAME() + ")"); //岗位资源:编号(名称)
+            holer.tv_jitai_num.setText(bean.getSR_DEVCODE());     //机台
+            holer.tv_xiangmuhao_num.setText(bean.getSR_ITEMCODE());     //项目号
+            holer.tv_gongdanhao_num.setText(bean.getSR_MAKECODE());     //工单号
+            return view;
+        }
+
+        class ViewHoler {
+            TextView tv_danhao_num,tv_type_num,tv_jianchariqi_num,tv_jianyanren_num,tv_gangweiziyuan_num,
+                    tv_jitai_num,tv_xiangmuhao_num,tv_gongdanhao_num;
+
+        }
+    }
+
+}

+ 0 - 1
app/src/main/java/com/uas/hystorage/activity/SelectNetAcitivty.java

@@ -124,7 +124,6 @@ public class SelectNetAcitivty extends BaseActivity implements View.OnClickListe
             }
         });
         mSearchButton.setOnClickListener(this);
-
     }
 
     @Override

+ 142 - 0
app/src/main/java/com/uas/hystorage/adapter/AnnexAdapter.java

@@ -0,0 +1,142 @@
+package com.uas.hystorage.adapter;
+
+import android.content.Context;
+import android.graphics.Bitmap;
+import android.graphics.BitmapFactory;
+import android.support.v7.widget.RecyclerView;
+import android.text.TextUtils;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.ImageView;
+import android.widget.RelativeLayout;
+import android.widget.TextView;
+
+import com.bumptech.glide.Glide;
+import com.bumptech.glide.request.target.Target;
+import com.uas.hystorage.R;
+import com.uas.hystorage.bean.AnnexBean;
+
+import java.util.List;
+
+public class AnnexAdapter extends RecyclerView.Adapter<AnnexAdapter.ViewHolder> {
+
+    private Context context;
+    private List<AnnexBean> itemList;
+    private int index;
+
+    public AnnexAdapter(Context context,List<AnnexBean> itemList) {
+        this.context = context;
+        this.itemList = itemList;
+    }
+
+    public void setListNotTitle(List<AnnexBean> itemList){
+        this.itemList = itemList;
+        notifyDataSetChanged();
+    }
+
+    public void setList(List<AnnexBean> itemList){
+        this.itemList = itemList;
+        this.itemList.add(0,new AnnexBean(true,"","",true));
+        notifyDataSetChanged();
+    }
+
+    public void addList(List<AnnexBean> itemList){
+        this.itemList.addAll(itemList);
+        notifyDataSetChanged();
+    }
+
+    @Override
+    public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
+        View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_annex_image, parent, false);
+        return new ViewHolder(view);
+    }
+
+    @Override
+    public void onBindViewHolder(ViewHolder holder,int position) {
+        index = position;
+        if (itemList.get(position).isAddImage()) {
+            holder.rl_image.setVisibility(View.GONE);
+            holder.iv_zengjiatu.setVisibility(View.VISIBLE);
+        }else {
+            holder.rl_image.setVisibility(View.VISIBLE);
+            holder.iv_zengjiatu.setVisibility(View.GONE);
+        }
+
+        AnnexBean annexBean = itemList.get(position);
+        if (!annexBean.isUsable()) {
+            return;
+        }
+        if (!TextUtils.isEmpty(annexBean.getImagePath())) {
+            String imagePath = annexBean.getImagePath();
+            BitmapFactory.Options options = new BitmapFactory.Options();
+            options.inJustDecodeBounds = true;
+            Bitmap bitmap = BitmapFactory.decodeFile(imagePath, options);
+            float realWidth = options.outWidth;
+            float realHeight = options.outHeight;
+            int scale = (int) ((realHeight > realWidth ? realHeight : realWidth) / 100);
+            options.inSampleSize = scale;
+            options.inJustDecodeBounds = false;
+            bitmap = BitmapFactory.decodeFile(imagePath, options);
+            holder.iv_fujiantu.setImageBitmap(bitmap);
+        }
+
+        holder.iv_zengjiatu.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                if (addImage != null) {
+                    addImage.startAdd();
+                }
+            }
+        });
+
+        holder.iv_fujiantu.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+
+            }
+        });
+
+        holder.iv_cancel.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                if (position > 0) {
+//                    itemList.remove(position);
+                    if (addImage != null) {
+                        addImage.delete(position);
+                    }
+                }
+            }
+        });
+    }
+
+    @Override
+    public int getItemCount() {
+        return itemList.size();
+    }
+
+    static class ViewHolder extends RecyclerView.ViewHolder {
+        ImageView iv_fujiantu,iv_cancel,iv_zengjiatu;
+        RelativeLayout rl_image;
+
+        ViewHolder(View itemView) {
+            super(itemView);
+            iv_fujiantu = itemView.findViewById(R.id.iv_fujiantu);
+            iv_cancel = itemView.findViewById(R.id.iv_cancel);
+            iv_zengjiatu = itemView.findViewById(R.id.iv_zengjiatu);
+            rl_image = itemView.findViewById(R.id.rl_image);
+        }
+    }
+
+    private AddImage addImage;
+
+    public void setImageUpload(AddImage addImage){
+        this.addImage = addImage;
+    }
+
+    public interface AddImage {
+        void startAdd();
+        void delete(int position);
+    }
+
+}

+ 0 - 1
app/src/main/java/com/uas/hystorage/adapter/BluetoothAdapter.java

@@ -67,7 +67,6 @@ public class BluetoothAdapter extends RecyclerView.Adapter<BluetoothAdapter.Blue
     @NonNull
     @Override
     public BlueTootViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
-
         return new BlueTootViewHolder(parent);
     }
 

+ 1 - 3
app/src/main/java/com/uas/hystorage/application/PdaApplication.java

@@ -45,6 +45,7 @@ public class PdaApplication extends Application {
     public static HashMap<Integer, Integer> mSoundMap;
     public static int mVersionCode = 1;
     public static Context context;
+
     @Override
     public void onCreate() {
         super.onCreate();
@@ -72,7 +73,6 @@ public class PdaApplication extends Application {
             mSoundPool = new SoundPool(4, AudioAttributes.CONTENT_TYPE_MUSIC, 0);
         }
 
-
         mSoundMap = new HashMap<>();
         mSoundMap.put(SoundUtil.SOUND_ARIEL, mSoundPool.load(this, R.raw.ariel, 1));
         mSoundMap.put(SoundUtil.SOUND_CARME, mSoundPool.load(this, R.raw.carme, 1));
@@ -121,7 +121,6 @@ public class PdaApplication extends Application {
 
     /**
      * 获取本地缓存
-     *
      * @param key
      * @return
      */
@@ -134,7 +133,6 @@ public class PdaApplication extends Application {
 
     /**
      * 移除本地缓存
-     *
      * @param key
      */
     public static void removeDataCacheFromMap(String key) {

+ 50 - 0
app/src/main/java/com/uas/hystorage/bean/AnnexBean.java

@@ -0,0 +1,50 @@
+package com.uas.hystorage.bean;
+
+public class AnnexBean {
+
+    private boolean isAddImage;     //是否是添加的图标
+    private String imagePath;   //图片路径
+    private String imageID;     //图片附件的ID,每张图片都带";"号
+    private boolean isUsable;   //是否可用
+
+    public AnnexBean(boolean isAddImage, String imagePath, String imageID, boolean isUsable) {
+        this.isAddImage = isAddImage;
+        this.imagePath = imagePath;
+        this.imageID = imageID;
+        this.isUsable = isUsable;
+    }
+
+    public boolean isAddImage() {
+        return isAddImage;
+    }
+
+    public void setAddImage(boolean addImage) {
+        isAddImage = addImage;
+    }
+
+
+    public String getImagePath() {
+        return imagePath;
+    }
+
+    public void setImagePath(String imagePath) {
+        this.imagePath = imagePath;
+    }
+
+
+    public String getImageID() {
+        return imageID;
+    }
+
+    public void setImageID(String imageID) {
+        this.imageID = imageID;
+    }
+
+    public boolean isUsable() {
+        return isUsable;
+    }
+
+    public void setUsable(boolean usable) {
+        isUsable = usable;
+    }
+}

+ 68 - 0
app/src/main/java/com/uas/hystorage/bean/AnnexInfo.java

@@ -0,0 +1,68 @@
+package com.uas.hystorage.bean;
+
+public class AnnexInfo {
+
+    //{
+    //	"fp_id": 159438,
+    //	"fp_path": "/app/mes/webapps/postattach/xiaost@manage/7648a18a3bea46a1af402deea0ad567e.png",
+    //	"fp_size": 16857,
+    //	"fp_name": "出勤人数PNG.png",
+    //	"fp_date": "2024-09-14 11:53:47",
+    //	"fp_man": "管理员"
+    //}
+
+    private int fp_id;
+    private String fp_path;
+    private String fp_size;
+    private String fp_name;
+    private String fp_date;
+    private String fp_man;
+
+    public int getFp_id() {
+        return fp_id;
+    }
+
+    public void setFp_id(int fp_id) {
+        this.fp_id = fp_id;
+    }
+
+    public String getFp_path() {
+        return fp_path;
+    }
+
+    public void setFp_path(String fp_path) {
+        this.fp_path = fp_path;
+    }
+
+    public String getFp_size() {
+        return fp_size;
+    }
+
+    public void setFp_size(String fp_size) {
+        this.fp_size = fp_size;
+    }
+
+    public String getFp_name() {
+        return fp_name;
+    }
+
+    public void setFp_name(String fp_name) {
+        this.fp_name = fp_name;
+    }
+
+    public String getFp_date() {
+        return fp_date;
+    }
+
+    public void setFp_date(String fp_date) {
+        this.fp_date = fp_date;
+    }
+
+    public String getFp_man() {
+        return fp_man;
+    }
+
+    public void setFp_man(String fp_man) {
+        this.fp_man = fp_man;
+    }
+}

+ 146 - 0
app/src/main/java/com/uas/hystorage/bean/InspectionPaintBean.java

@@ -0,0 +1,146 @@
+package com.uas.hystorage.bean;
+
+import java.util.List;
+
+public class InspectionPaintBean {
+
+    /**
+     * success : true
+     * data : [{"SR_ID":60,"SR_CODE":"SJ24090018","SR_DATE":"2024-09-12 17:43:00","SR_SOURCETYPE":"PDA新增","SR_SCCODE":"CX0266","SR_SCNAME":"CX0266成型","SR_DEVCODE":"55","SR_MAKECODE":"52","SR_ITEMCODE":"56","SR_SENDTYPE":"首件","SR_SENDMANNAME":"管理员"},{"SR_ID":60,"SR_CODE":"SJ24090018","SR_DATE":"2024-09-12 17:43:00","SR_SOURCETYPE":"PDA新增","SR_SCCODE":"CX0266","SR_SCNAME":"CX0266成型","SR_DEVCODE":"55","SR_MAKECODE":"52","SR_ITEMCODE":"56","SR_SENDTYPE":"首件","SR_SENDMANNAME":"管理员"}]
+     */
+
+    private boolean success;
+    private List<DataBean> data;
+
+    public boolean isSuccess() {
+        return success;
+    }
+
+    public void setSuccess(boolean success) {
+        this.success = success;
+    }
+
+    public List<DataBean> getData() {
+        return data;
+    }
+
+    public void setData(List<DataBean> data) {
+        this.data = data;
+    }
+
+    public static class DataBean {
+        /**
+         * SR_ID : 60
+         * SR_CODE : SJ24090018
+         * SR_DATE : 2024-09-12 17:43:00
+         * SR_SOURCETYPE : PDA新增
+         * SR_SCCODE : CX0266
+         * SR_SCNAME : CX0266成型
+         * SR_DEVCODE : 55
+         * SR_MAKECODE : 52
+         * SR_ITEMCODE : 56
+         * SR_SENDTYPE : 首件
+         * SR_SENDMANNAME : 管理员
+         */
+
+        private int SR_ID;
+        private String SR_CODE;
+        private String SR_DATE;
+        private String SR_SOURCETYPE;
+        private String SR_SCCODE;
+        private String SR_SCNAME;
+        private String SR_DEVCODE;
+        private String SR_MAKECODE;
+        private String SR_ITEMCODE;
+        private String SR_SENDTYPE;
+        private String SR_SENDMANNAME;
+
+        public int getSR_ID() {
+            return SR_ID;
+        }
+
+        public void setSR_ID(int SR_ID) {
+            this.SR_ID = SR_ID;
+        }
+
+        public String getSR_CODE() {
+            return SR_CODE;
+        }
+
+        public void setSR_CODE(String SR_CODE) {
+            this.SR_CODE = SR_CODE;
+        }
+
+        public String getSR_DATE() {
+            return SR_DATE;
+        }
+
+        public void setSR_DATE(String SR_DATE) {
+            this.SR_DATE = SR_DATE;
+        }
+
+        public String getSR_SOURCETYPE() {
+            return SR_SOURCETYPE;
+        }
+
+        public void setSR_SOURCETYPE(String SR_SOURCETYPE) {
+            this.SR_SOURCETYPE = SR_SOURCETYPE;
+        }
+
+        public String getSR_SCCODE() {
+            return SR_SCCODE;
+        }
+
+        public void setSR_SCCODE(String SR_SCCODE) {
+            this.SR_SCCODE = SR_SCCODE;
+        }
+
+        public String getSR_SCNAME() {
+            return SR_SCNAME;
+        }
+
+        public void setSR_SCNAME(String SR_SCNAME) {
+            this.SR_SCNAME = SR_SCNAME;
+        }
+
+        public String getSR_DEVCODE() {
+            return SR_DEVCODE;
+        }
+
+        public void setSR_DEVCODE(String SR_DEVCODE) {
+            this.SR_DEVCODE = SR_DEVCODE;
+        }
+
+        public String getSR_MAKECODE() {
+            return SR_MAKECODE;
+        }
+
+        public void setSR_MAKECODE(String SR_MAKECODE) {
+            this.SR_MAKECODE = SR_MAKECODE;
+        }
+
+        public String getSR_ITEMCODE() {
+            return SR_ITEMCODE;
+        }
+
+        public void setSR_ITEMCODE(String SR_ITEMCODE) {
+            this.SR_ITEMCODE = SR_ITEMCODE;
+        }
+
+        public String getSR_SENDTYPE() {
+            return SR_SENDTYPE;
+        }
+
+        public void setSR_SENDTYPE(String SR_SENDTYPE) {
+            this.SR_SENDTYPE = SR_SENDTYPE;
+        }
+
+        public String getSR_SENDMANNAME() {
+            return SR_SENDMANNAME;
+        }
+
+        public void setSR_SENDMANNAME(String SR_SENDMANNAME) {
+            this.SR_SENDMANNAME = SR_SENDMANNAME;
+        }
+    }
+}

+ 128 - 0
app/src/main/java/com/uas/hystorage/bean/SampleDeliveryBean.java

@@ -0,0 +1,128 @@
+package com.uas.hystorage.bean;
+
+public class SampleDeliveryBean {
+    /**
+     * SR_ID : 3
+     * SR_CODE : XJ24090003
+     * SR_DATE : 2024-09-06 11:03:44
+     * SR_SOURCETYPE : PDA新增
+     * SR_SCCODE : ZX0000-104
+     * SR_SCNAME : 半检五线12
+     * SR_DEVCODE : DEV001
+     * SR_MAKECODE : 5106-24090610269-5
+     * SR_ITEMCODE : 2323342
+     * SR_STATUS : 在录入
+     * //   data.getString("SR_SENDTYPE"));     //类型
+     *     data.getString("SR_SENDMANNAME"));   //检验人
+     */
+
+    private int SR_ID;
+    private String SR_CODE;
+    private String SR_DATE;
+    private String SR_SOURCETYPE;
+    private String SR_SCCODE;
+    private String SR_SCNAME;
+    private String SR_DEVCODE;
+    private String SR_MAKECODE;
+    private String SR_ITEMCODE;
+    private String SR_STATUS;
+    private String SR_SENDTYPE;
+    private String SR_SENDMANNAME;
+
+
+    public String getSR_SENDTYPE() {
+        return SR_SENDTYPE;
+    }
+
+    public void setSR_SENDTYPE(String SR_SENDTYPE) {
+        this.SR_SENDTYPE = SR_SENDTYPE;
+    }
+
+    public String getSR_SENDMANNAME() {
+        return SR_SENDMANNAME;
+    }
+
+    public void setSR_SENDMANNAME(String SR_SENDMANNAME) {
+        this.SR_SENDMANNAME = SR_SENDMANNAME;
+    }
+
+    public int getSR_ID() {
+        return SR_ID;
+    }
+
+    public void setSR_ID(int SR_ID) {
+        this.SR_ID = SR_ID;
+    }
+
+    public String getSR_CODE() {
+        return SR_CODE;
+    }
+
+    public void setSR_CODE(String SR_CODE) {
+        this.SR_CODE = SR_CODE;
+    }
+
+    public String getSR_DATE() {
+        return SR_DATE;
+    }
+
+    public void setSR_DATE(String SR_DATE) {
+        this.SR_DATE = SR_DATE;
+    }
+
+    public String getSR_SOURCETYPE() {
+        return SR_SOURCETYPE;
+    }
+
+    public void setSR_SOURCETYPE(String SR_SOURCETYPE) {
+        this.SR_SOURCETYPE = SR_SOURCETYPE;
+    }
+
+    public String getSR_SCCODE() {
+        return SR_SCCODE;
+    }
+
+    public void setSR_SCCODE(String SR_SCCODE) {
+        this.SR_SCCODE = SR_SCCODE;
+    }
+
+    public String getSR_SCNAME() {
+        return SR_SCNAME;
+    }
+
+    public void setSR_SCNAME(String SR_SCNAME) {
+        this.SR_SCNAME = SR_SCNAME;
+    }
+
+    public String getSR_DEVCODE() {
+        return SR_DEVCODE;
+    }
+
+    public void setSR_DEVCODE(String SR_DEVCODE) {
+        this.SR_DEVCODE = SR_DEVCODE;
+    }
+
+    public String getSR_MAKECODE() {
+        return SR_MAKECODE;
+    }
+
+    public void setSR_MAKECODE(String SR_MAKECODE) {
+        this.SR_MAKECODE = SR_MAKECODE;
+    }
+
+    public String getSR_ITEMCODE() {
+        return SR_ITEMCODE;
+    }
+
+    public void setSR_ITEMCODE(String SR_ITEMCODE) {
+        this.SR_ITEMCODE = SR_ITEMCODE;
+    }
+
+    public String getSR_STATUS() {
+        return SR_STATUS;
+    }
+
+    public void setSR_STATUS(String SR_STATUS) {
+        this.SR_STATUS = SR_STATUS;
+    }
+}

+ 0 - 2
app/src/main/java/com/uas/hystorage/fragment/HePiFragment.java

@@ -90,8 +90,6 @@ public class HePiFragment extends BaseFragment {
 
     private List<CaiPiBlueBean.DataBean> messages = new ArrayList<>();
 
-
-
     @Override
     protected int getLayout() {
         return R.layout.fragment_hepi;

+ 0 - 1
app/src/main/java/com/uas/hystorage/fragment/PostPunchFragment.java

@@ -266,7 +266,6 @@ public class PostPunchFragment extends BaseFragment implements View.OnClickListe
             ComDataBeanList.add(bean);
         }
         initresourcesPopupWindow();
-
     }
 
     private void initresourcesPopupWindow() {

+ 17 - 2
app/src/main/java/com/uas/hystorage/fragment/QualityManageFragment.java

@@ -1,5 +1,6 @@
 package com.uas.hystorage.fragment;
 
+import android.os.Bundle;
 import android.support.v4.app.Fragment;
 import android.support.v7.widget.GridLayoutManager;
 import android.support.v7.widget.RecyclerView;
@@ -42,6 +43,8 @@ public class QualityManageFragment extends BaseFragment {
         mMenuBeanList = new ArrayList<>();
         mMenuBeanList.add(new CommonMenuBean("抽检判定", R.drawable.ic_first_last_manage, DecisionByLotFragment.class));
         mMenuBeanList.add(new CommonMenuBean("返工判定", R.drawable.ic_production_quality, ReworkDecisionFragment.class));
+        mMenuBeanList.add(new CommonMenuBean("首件报告", R.drawable.shouyebaogao, ReportPageFra.class));
+        mMenuBeanList.add(new CommonMenuBean("巡检报告", R.drawable.xunchabaogao, ReportPageFra.class));
 //        mMenuBeanList.add(new CommonMenuBean("首检判定", R.drawable.ic_first_last_manage, FirstLastManageListFragment.class));
 //        mMenuBeanList.add(new CommonMenuBean("首末件管理", R.drawable.ic_first_last_manage, FirstLastManageListFragment.class));
 //        Bundle bundle = new Bundle();
@@ -73,9 +76,21 @@ public class QualityManageFragment extends BaseFragment {
 //                        startActivity(intent);
                     } else if (position == 1) {
                         fragment = new ReworkDecisionFragment();
+                    }else if (position == 2) {
+                        Bundle bundle = new Bundle();
+                        bundle.putString("sr_sendtype", "首件");
+                        mMenuBeanList.get(position).setBundle(bundle);
+                        fragment = new ReportPageFra();
                     }else if (position == 3) {
-                        fragment = new QualityComplaintsListFragment<QualityComplaintsBean>();
-                    } else {
+                        Bundle bundle = new Bundle();
+                        bundle.putString("sr_sendtype", "巡检");
+                        mMenuBeanList.get(position).setBundle(bundle);
+                        fragment = new ReportPageFra();
+                    }
+//                    else if (position == 3) {
+//                        fragment = new QualityComplaintsListFragment<QualityComplaintsBean>();
+//                    }
+                    else {
                         fragment = (Fragment) mMenuBeanList.get(position).getPage().newInstance();
                     }
                     FragmentUtils.switchFragment(QualityManageFragment.this, fragment,

+ 986 - 0
app/src/main/java/com/uas/hystorage/fragment/ReportPageFra.java

@@ -0,0 +1,986 @@
+package com.uas.hystorage.fragment;
+
+import android.Manifest;
+import android.app.Activity;
+import android.content.Intent;
+import android.content.pm.PackageManager;
+import android.database.Cursor;
+import android.graphics.Color;
+import android.net.Uri;
+import android.os.Bundle;
+import android.os.Handler;
+import android.provider.MediaStore;
+import android.support.v4.app.ActivityCompat;
+import android.support.v7.widget.LinearLayoutManager;
+import android.support.v7.widget.RecyclerView;
+import android.text.TextUtils;
+import android.util.Log;
+import android.view.KeyEvent;
+import android.view.View;
+import android.widget.Button;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.android.volley.Request;
+import com.android.volley.toolbox.StringRequest;
+import com.google.gson.Gson;
+import com.uas.hystorage.R;
+import com.uas.hystorage.activity.SampleDeliveryListAct;
+import com.uas.hystorage.adapter.AnnexAdapter;
+import com.uas.hystorage.bean.AnnexBean;
+import com.uas.hystorage.bean.AnnexInfo;
+import com.uas.hystorage.bean.InspectionPaintBean;
+import com.uas.hystorage.bean.SampleDeliveryBean;
+import com.uas.hystorage.global.GloableParams;
+import com.uas.hystorage.interfaces.ProgressListener;
+import com.uas.hystorage.listener.MyEditorActionListener;
+import com.uas.hystorage.util.ClickUtils;
+import com.uas.hystorage.util.CommonUtil;
+import com.uas.hystorage.util.Constants;
+import com.uas.hystorage.util.FastjsonUtil;
+import com.uas.hystorage.util.HttpCallback;
+import com.uas.hystorage.util.HttpParams;
+import com.uas.hystorage.util.MyLog;
+import com.uas.hystorage.util.OKHttpUitls;
+import com.uas.hystorage.util.OnDownloadListener;
+import com.uas.hystorage.util.UploadUtils;
+import com.uas.hystorage.util.VollyRequest;
+import com.uas.hystorage.util.YLDownload;
+import com.uas.hystorage.view.ClearableEditText;
+import com.uas.hystorage.view.business.ProgressPopup;
+import com.umeng.commonsdk.debug.E;
+import com.uuzuche.lib_zxing.activity.CodeUtils;
+
+import org.json.JSONException;
+import org.w3c.dom.Text;
+
+import java.io.BufferedInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.HttpURLConnection;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import okhttp3.Call;
+import okhttp3.Callback;
+import okhttp3.MediaType;
+import okhttp3.MultipartBody;
+import okhttp3.RequestBody;
+import okhttp3.Response;
+
+public class ReportPageFra extends BaseFragment {
+
+    private Button bt_gengxin;
+    private ClearableEditText cet_danhao, cet_beizhu1, cet_beizhu2;
+    private ImageView iv_qc_fujian, iv_shiyanfujian;
+    private RecyclerView rv_qc_fujian, rv_shiyanfujian;
+    private StringRequest mStringRequest;
+    private String sr_sendtype;
+
+    private final int REQUEST_EXTERNAL_STORAGE = 1;
+    private String[] PERMISSIONS_STORAGE = {
+            Manifest.permission.READ_EXTERNAL_STORAGE,
+            Manifest.permission.WRITE_EXTERNAL_STORAGE};
+    private static final int REQUEST_CODE1 = 1;
+    private static final int REQUEST_CODE2 = 2;
+
+    private List<String> selectedImagePaths = new ArrayList<>();
+    private ProgressPopup mProgressPopup;
+
+    private int fujian = 0;
+    private List<AnnexBean> fujianList1;
+    private List<AnnexBean> fujianList2;
+    private AnnexAdapter annexQCFuJianAdapter;
+    private AnnexAdapter annexShiYanFuJianAdapter;
+    private int uploadRecords;
+    private int uploadRecordsNumber;
+    private List<AnnexBean> templist;
+    private TextView tv_updater_info;
+
+    private String sr_qcattach;
+    private String sr_laboratoryattach;
+    private String sr_qcremark;
+    private String sr_laboratoryremark;
+    private List<AnnexInfo> imageQCUrlList;
+    private List<AnnexInfo> imageTestUrlList;
+    private int numberOfTimes = 0;  //下载完成次数
+    private String pathQc;
+    private String pathTest;
+
+    @Override
+    protected int getLayout() {
+        return R.layout.fra_report_page;
+    }
+
+    @Override
+    protected void initViews() {
+        cet_danhao = root.findViewById(R.id.cet_danhao);
+        rv_qc_fujian = root.findViewById(R.id.rv_qc_fujian);
+        rv_shiyanfujian = root.findViewById(R.id.rv_shiyanfujian);
+
+        iv_qc_fujian = root.findViewById(R.id.iv_qc_fujian);
+        iv_shiyanfujian = root.findViewById(R.id.iv_shiyanfujian);
+
+        cet_beizhu1 = root.findViewById(R.id.cet_beizhu1);
+        cet_beizhu2 = root.findViewById(R.id.cet_beizhu2);
+        bt_gengxin = root.findViewById(R.id.bt_gengxin);
+        tv_updater_info = root.findViewById(R.id.tv_updater_info);
+
+    }
+
+    @Override
+    protected void initEvents() {
+        CommonUtil.setEditorActionListener(cet_danhao, new MyEditorActionListener() {
+            @Override
+            public void MyEditorAction(String text, int actionId, KeyEvent event) {
+                getTrackingNumberInquiry(text);
+            }
+        });
+
+        bt_gengxin.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                ClickUtils.pauseTime = 2000;
+                if (ClickUtils.isFastClick()) {
+                    CommonUtil.toastNoRepeat(mActivity, "请勿点击过快");
+                    return;
+                }
+                getUpdater();
+            }
+        });
+
+        iv_qc_fujian.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                verifyStoragePermissions(mActivity);
+                // 启动文件选择器
+                Intent intent = new Intent(Intent.ACTION_PICK);
+                intent.setType("image/*");
+                intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true);
+                startActivityForResult(Intent.createChooser(intent, "Select Images"), REQUEST_CODE1);
+            }
+        });
+
+        iv_shiyanfujian.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                verifyStoragePermissions(mActivity);
+                // 启动文件选择器
+                Intent intent = new Intent(Intent.ACTION_PICK);
+                intent.setType("image/*");
+                intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true);
+                startActivityForResult(Intent.createChooser(intent, "Select Images"), REQUEST_CODE2);
+            }
+        });
+    }
+
+    @Override
+    protected void initDatas() {
+        pathQc = Constants.CONSTANT.APP_DIR_NAME + getActivity().getPackageName() + "/imageQC/";
+        pathTest = Constants.CONSTANT.APP_DIR_NAME + getActivity().getPackageName() + "/imageTest/";
+        deleteFile();
+
+
+        cet_danhao.requestFocus();
+        Bundle arguments = getArguments();
+        if (arguments != null) {
+            sr_sendtype = arguments.getString("sr_sendtype", "");
+            setTitle(sr_sendtype + "报告");
+        }
+        //如果单号没有数据,并且没有执行enter 校验不成功的情况,不允许编辑下面的字段,包含上传图片、备注、点更新按钮(新增)
+
+        LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getActivity(), LinearLayoutManager.HORIZONTAL, false);
+        rv_qc_fujian.setLayoutManager(linearLayoutManager);
+
+        LinearLayoutManager linearLayoutManager2 = new LinearLayoutManager(getActivity(), LinearLayoutManager.HORIZONTAL, false);
+        rv_shiyanfujian.setLayoutManager(linearLayoutManager2);
+
+        fujianList1 = new ArrayList<>();
+//        fujianList1.add(new AnnexBean(true, "", "", false));
+        annexQCFuJianAdapter = new AnnexAdapter(getActivity(), fujianList1);
+        rv_qc_fujian.setAdapter(annexQCFuJianAdapter);
+        annexQCFuJianAdapter.setImageUpload(new AnnexAdapter.AddImage() {
+            @Override
+            public void startAdd() {
+                verifyStoragePermissions(mActivity);
+                // 启动文件选择器
+                Intent intent = new Intent(Intent.ACTION_PICK);
+                intent.setType("image/*");
+                intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true);
+                startActivityForResult(Intent.createChooser(intent, "Select Images"), REQUEST_CODE1);
+            }
+
+            @Override
+            public void delete(int position) {
+                if(position < fujianList1.size()) {
+                    fujianList1.remove(position);
+                    annexQCFuJianAdapter.setListNotTitle(fujianList1);
+                }
+            }
+        });
+
+        fujianList2 = new ArrayList<>();
+//        fujianList2.add(new AnnexBean(true, "", "", false));
+        annexShiYanFuJianAdapter = new AnnexAdapter(getActivity(), fujianList2);
+        rv_shiyanfujian.setAdapter(annexShiYanFuJianAdapter);
+        annexShiYanFuJianAdapter.setImageUpload(new AnnexAdapter.AddImage() {
+            @Override
+            public void startAdd() {
+                verifyStoragePermissions(mActivity);
+                // 启动文件选择器
+                Intent intent = new Intent(Intent.ACTION_PICK);
+                intent.setType("image/*");
+                intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true);
+                startActivityForResult(Intent.createChooser(intent, "Select Images"), REQUEST_CODE2);
+            }
+
+            @Override
+            public void delete(int position) {
+                if(position < fujianList2.size()) {
+                    fujianList2.remove(position);
+                    annexShiYanFuJianAdapter.setListNotTitle(fujianList2);
+                }
+            }
+        });
+
+        imageQCUrlList = new ArrayList<>();
+        imageTestUrlList = new ArrayList<>();
+
+        cet_beizhu1.setEnabled(false);
+        cet_beizhu2.setEnabled(false);
+        bt_gengxin.setEnabled(false);
+    }
+
+    private void deleteFile() {
+        try{
+            File fileQc = new File(pathQc);
+            File fileTest = new File(pathTest);
+            if (!fileQc.exists()) {
+                fileQc.mkdirs();
+            }
+            if (!fileTest.exists()) {
+                fileTest.mkdirs();
+            }
+            deleteFiles(fileQc);
+            deleteFiles(fileTest);
+        }catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    private void deleteFiles(File file) {
+        if (file.exists()) {
+            if (file.isDirectory()) {
+                File[] files = file.listFiles();
+                if (files != null) {
+                    for (File f : files) {
+                        deleteFiles(f);
+                    }
+                }
+            } else {
+                file.delete();
+            }
+        }
+    }
+
+    public void verifyStoragePermissions(Activity activity) {
+        int permission = ActivityCompat.checkSelfPermission(activity, Manifest.permission.WRITE_EXTERNAL_STORAGE);
+        if (permission != PackageManager.PERMISSION_GRANTED) {
+            ActivityCompat.requestPermissions(activity, PERMISSIONS_STORAGE, REQUEST_EXTERNAL_STORAGE);
+        }
+    }
+
+    private void getUpdater() {
+        if (TextUtils.isEmpty(cet_danhao.getText().toString().trim())) {
+            CommonUtil.toastNoRepeat(getActivity(), "请输入单号");
+            return;
+        }
+
+        String fujianStr1 = "";
+        if (fujianList1.size() > 0) {
+            for (int i = 1; i < fujianList1.size(); i++) {
+                String s = fujianList1.get(i).getImageID();
+                fujianStr1 += s;
+            }
+        }
+        String fujianStr2 = "";
+        if (fujianList2.size() > 0) {
+            for (int i = 1; i < fujianList2.size(); i++) {
+                String s = fujianList2.get(i).getImageID();
+                fujianStr2 += s;
+            }
+        }
+
+        Map<String, Object> params = new HashMap<>();
+        params.put("sr_qcattach", fujianStr1);
+        params.put("sr_qcremark ", cet_beizhu1.getText().toString().trim());
+        params.put("sr_laboratoryattach", fujianStr2);
+        params.put("sr_laboratoryremark", cet_beizhu2.getText().toString().trim());
+        params.put("sr_sendtype", sr_sendtype);
+        String data = JSON.toJSONString(params);
+        progressDialog.show();
+        VollyRequest.getInstance().stringRequest(mStringRequest,
+                new HttpParams.Builder()
+                        .url(GloableParams.ADDRESS_UPDATESAMPLEREPORT)
+                        .method(Request.Method.POST)
+                        .tag("getMaCode")
+                        .flag(0)
+                        .addParam("sr_code", cet_danhao.getText().toString().trim())
+                        .addParam("data", data) //首件或巡检
+                        .build(), new HttpCallback() {
+                    @Override
+                    public void onSuccess(int flag, Object o) throws Exception {
+                        progressDialog.dismiss();
+                        Boolean isSuccess = FastjsonUtil.getBoolean(o.toString(), "success");
+                        if (isSuccess) {
+                            tv_updater_info.setTextColor(getResources().getColor(R.color.blue));
+                            tv_updater_info.setText("更新成功");
+                            CommonUtil.toastNoRepeat(mActivity, "更新成功");
+                        }
+                    }
+
+                    @Override
+                    public void onFail(int flag, String failStr) throws Exception {
+                        progressDialog.dismiss();
+                        CommonUtil.toastNoRepeat(mActivity, failStr);
+                        tv_updater_info.setTextColor(getResources().getColor(R.color.red));
+                        tv_updater_info.setText(failStr);
+                    }
+                });
+    }
+
+    private void getTrackingNumberInquiry(String text) {
+        if (TextUtils.isEmpty(text)) {
+            CommonUtil.toastNoRepeat(getActivity(), "请输入单号");
+            return;
+        }
+        progressDialog.show();
+        VollyRequest.getInstance().stringRequest(mStringRequest,
+                new HttpParams.Builder()
+                        .url(GloableParams.ADDRESS_GETSAMPLEREPORT)
+                        .method(Request.Method.GET)
+                        .tag("getMaCode")
+                        .flag(0)
+                        .addParam("sr_code", text)
+                        .addParam("sr_sendtype", sr_sendtype) //首件或巡检
+                        .build(), new HttpCallback() {
+                    @Override
+                    public void onSuccess(int flag, Object o) throws Exception {
+                        //progressDialog.dismiss();
+                        Boolean isSuccess = FastjsonUtil.getBoolean(o.toString(), "success");
+                        if (isSuccess) {
+                            JSONObject dataObject = FastjsonUtil.getJSONObject(o.toString(), "data");
+                            if (dataObject != null) {
+                                String SC_CODE = dataObject.getString("SR_CODE") == null ? "" : dataObject.getString("SC_CODE");
+                                sr_qcattach = dataObject.getString("SR_QCATTACH") == null ? "" : dataObject.getString("SR_QCATTACH");
+                                sr_laboratoryattach = dataObject.getString("SR_LABORATORYATTACH") == null ? "" : dataObject.getString("SR_LABORATORYATTACH");
+                                sr_qcremark = dataObject.getString("SR_QCREMARK") == null ? "" : dataObject.getString("SR_QCREMARK");
+                                sr_laboratoryremark = dataObject.getString("SR_LABORATORYREMARK") == null ? "" : dataObject.getString("SR_LABORATORYREMARK");
+                                cet_beizhu1.setText(sr_qcremark);
+                                cet_beizhu2.setText(sr_laboratoryremark);
+                                //先删除文件在下载
+                                deleteFile();
+                                numberOfTimes = 0;
+                                imageQCUrlList.clear();
+                                imageTestUrlList.clear();
+                                fujianList1.clear();
+                                fujianList2.clear();
+                                fujianList1.add(new AnnexBean(true, "", "", false));
+                                fujianList2.add(new AnnexBean(true, "", "", false));
+                                cet_beizhu1.setEnabled(true);
+                                cet_beizhu2.setEnabled(true);
+                                bt_gengxin.setEnabled(true);
+                                for (int i = 0; i < fujianList1.size(); i++) {
+                                    fujianList1.get(i).setUsable(true);
+                                }
+                                annexQCFuJianAdapter.setListNotTitle(fujianList1);
+                                for (int i = 0; i < fujianList2.size(); i++) {
+                                    fujianList2.get(i).setUsable(true);
+                                }
+                                annexShiYanFuJianAdapter.setListNotTitle(fujianList2);
+                                //获取附件图片数据
+                                if (!TextUtils.isEmpty(sr_qcattach)) {
+                                    getImageData(sr_qcattach);
+                                }
+                                if (!TextUtils.isEmpty(sr_laboratoryattach)) {
+                                    getImageData2(sr_laboratoryattach, "Test");
+                                }
+                                if (TextUtils.isEmpty(sr_qcattach) && TextUtils.isEmpty(sr_laboratoryattach)) {
+                                    progressDialog.dismiss();
+                                }
+                            }
+                        }
+                    }
+
+                    @Override
+                    public void onFail(int flag, String failStr) throws Exception {
+                        progressDialog.dismiss();
+                        CommonUtil.toastNoRepeat(mActivity, failStr);
+                    }
+                });
+    }
+
+    private synchronized void getImageData(String imageDataID) {
+//        new Handler().postDelayed(new Runnable() {
+//            @Override
+//            public void run() {
+                VollyRequest.getInstance().stringRequest(mStringRequest,
+                        new HttpParams.Builder()
+                                .url(GloableParams.ADDRESS_GETFILEPATHS)
+                                .method(Request.Method.GET)
+                                .tag("getMaCode1")
+                                .flag(1)
+                                .addParam("id",imageDataID)
+                                .build(), new HttpCallback() {
+                            @Override
+                            public void onSuccess(int flag, Object o) throws Exception {
+                                Boolean isSuccess = FastjsonUtil.getBoolean(o.toString(), "success");
+                                JSONArray dataArray = FastjsonUtil.getJSONArray(o.toString(), "files");
+                                if (isSuccess) {
+                                    if (dataArray == null) {
+                                        CommonUtil.toastNoRepeat(getActivity(), "未搜索到匹配数据");
+                                    } else {
+                                        if (dataArray.size() <= 0) {
+                                            progressDialog.dismiss();
+                                        }else {
+                                            downloadImages(dataArray,"QC");
+                                        }
+                                    }
+                                }
+                            }
+                            @Override
+                            public void onFail(int flag, String failStr) throws Exception {
+                                progressDialog.dismiss();
+                                CommonUtil.toastNoRepeat(mActivity, failStr);
+                            }
+                        });
+
+//            }
+//        }, 3 * 1000);
+
+
+//                VollyRequest.getInstance().stringRequest(mStringRequest,
+//                        new HttpParams.Builder()
+//                                .url(GloableParams.ADDRESS_GETFILEPATHS)
+//                                .method(Request.Method.GET)
+//                                .tag("getMaCode1")
+//                                .flag(1)
+//                                .addParam("id",imageDataID)
+//                                .build(), new HttpCallback() {
+//                            @Override
+//                            public void onSuccess(int flag, Object o) throws Exception {
+//                                Boolean isSuccess = FastjsonUtil.getBoolean(o.toString(), "success");
+//                                JSONArray dataArray = FastjsonUtil.getJSONArray(o.toString(), "files");
+//                                if (isSuccess) {
+//                                    if (dataArray == null) {
+//                                        CommonUtil.toastNoRepeat(getActivity(), "未搜索到匹配数据");
+//                                    } else {
+//                                        if (dataArray.size() <= 0) {
+//                                            progressDialog.dismiss();
+//                                        }else {
+//                                            downloadImages(dataArray,"QC");
+//                                        }
+//                                    }
+//                                }
+//                            }
+//                            @Override
+//                            public void onFail(int flag, String failStr) throws Exception {
+//                                progressDialog.dismiss();
+//                                CommonUtil.toastNoRepeat(mActivity, failStr);
+//                            }
+//                        });
+//
+
+
+
+//        String url = GloableParams.ADDRESS_GETFILEPATHS + "?" + "id=" + imageDataID;
+//        OKHttpUitls okHttpUitls = new OKHttpUitls();
+//        okHttpUitls.get(url);
+//        okHttpUitls.setOnOKHttpGetListener(new OKHttpUitls.OKHttpGetListener() {
+//            @Override
+//            public void error(String error) {
+//                progressDialog.dismiss();
+//                CommonUtil.toastNoRepeat(mActivity, "附件加载失败");
+//            }
+//
+//            @Override
+//            public void success(String json) {
+//                try {
+//                    //                    org.json.JSONObject jsonObject = new org.json.JSONObject(json);
+//                    Boolean isSuccess = FastjsonUtil.getBoolean(json, "success");
+//                    //                    String success = jsonObject.getString("success");
+//                    JSONArray dataArray = FastjsonUtil.getJSONArray(json, "files");
+//                    if (isSuccess) {
+//                        if (dataArray == null) {
+//                            CommonUtil.toastNoRepeat(getActivity(), "未搜索到匹配数据");
+//                        } else {
+//                            if (dataArray.size() <= 0) {
+//                                progressDialog.dismiss();
+//                            } else {
+//                                downloadImages(dataArray, "QC");
+//                            }
+//                        }
+//                    }
+//                } catch (Exception e) {
+//                    e.printStackTrace();
+//                }
+//            }
+//        });
+
+
+    }
+
+    private synchronized void getImageData2(String imageDataID, String type) {
+        VollyRequest.getInstance().stringRequest(mStringRequest,
+                new HttpParams.Builder()
+                        .url(GloableParams.ADDRESS_GETFILEPATHS)
+                        .method(Request.Method.GET)
+                        .tag("getMaCode")
+                        .flag(0)
+                        .addParam("id", imageDataID)
+                        .build(), new HttpCallback() {
+                    @Override
+                    public void onSuccess(int flag, Object o) throws Exception {
+                        Boolean isSuccess = FastjsonUtil.getBoolean(o.toString(), "success");
+                        JSONArray dataArray = FastjsonUtil.getJSONArray(o.toString(), "files");
+                        if (isSuccess) {
+                            if (dataArray == null) {
+                                CommonUtil.toastNoRepeat(getActivity(), "未搜索到匹配数据");
+                            } else {
+                                if (dataArray.size() <= 0) {
+                                    progressDialog.dismiss();
+                                } else {
+                                    downloadImages(dataArray, "Test");
+                                }
+                            }
+                        }
+                    }
+
+                    @Override
+                    public void onFail(int flag, String failStr) throws Exception {
+                        progressDialog.dismiss();
+                        CommonUtil.toastNoRepeat(mActivity, failStr);
+                    }
+                });
+    }
+
+    private synchronized void downloadImages(JSONArray dataArray,String type) {
+        if (type.equals("QC")) {
+            for (Object index : dataArray) {
+                JSONObject data = (JSONObject) index;
+                AnnexInfo annexInfo = new Gson().fromJson(data.toString(), AnnexInfo.class);
+                imageQCUrlList.add(annexInfo);
+            }
+            getImageStream(imageQCUrlList, type);
+        } else if (type.equals("Test")) {
+            for (Object index : dataArray) {
+                JSONObject data = (JSONObject) index;
+                AnnexInfo annexInfo = new Gson().fromJson(data.toString(), AnnexInfo.class);
+                imageTestUrlList.add(annexInfo);
+            }
+            getImageStream2(imageTestUrlList, type);
+        }
+
+    }
+
+    private int index;
+    private String path = "";
+    private List<AnnexInfo> qcList;
+    private synchronized void getImageStream(List<AnnexInfo> list, String type) {
+        index = 0;
+        qcList = list;
+        for (int i = 0; i < list.size(); i++) {
+            String Path = "http://" + GloableParams.IP + ":"
+                    + GloableParams.PORT + "/" + GloableParams.SITE
+                    + "/api/pdashop/quality/download.action?" + "path="
+                    + list.get(i).getFp_path() + "&" + "size=" + list.get(i).getFp_size()
+                    + "&" + "fileName=" + list.get(i).getFp_name();
+            path = "";
+            if (type.equals("QC")) {
+                path = pathQc;
+            } else if (type.equals("Test")) {
+                path = pathTest;
+            }
+//            new Thread(new Runnable() {
+//                @Override
+//                public void run() {
+            String fileName = list.get(i).getFp_name();
+            fileName = System.currentTimeMillis() + fileName;
+            YLDownload.getInstance().download(Path, path, fileName, new OnDownloadListener() {
+                        @Override
+                        public void onDownloadFailed(Exception e) {
+                            e.printStackTrace();
+                            progressDialog.dismiss();
+                            CommonUtil.toastNoRepeat(mActivity, "附件下载出错,请重试");
+                        }
+
+                        @Override
+                        public void onDownloadSuccess() {
+                            MyLog.e("aaa","Qc下载次数:" + index + ",list大小:" + qcList.size());
+                            index++;
+                            if (index == qcList.size()) {
+                                //校验完整性
+                                if (type.equals("QC")) {
+                                    File dirFire = new File(pathQc);
+                                    setImagePath(dirFire, imageQCUrlList, "QC");
+                                } else if (type.equals("Test")) {
+                                    File dirFire = new File(pathTest);
+                                    setImagePath(dirFire, imageTestUrlList, "Test");
+                                }
+                            }
+                        }
+
+                        @Override
+                        public void onDownloading(int i) {
+                            Log.e("aaa", "下载图片的进度是: " + i);
+                        }
+                    });
+//                }
+//            }).start();
+        }
+    }
+
+    private int index2;
+    private String path2 = "";
+    private List<AnnexInfo> testList;
+    private synchronized void getImageStream2(List<AnnexInfo> list, String type) {
+        index2 = 0;
+        testList = list;
+        for (int i = 0; i < list.size(); i++) {
+            String Path = "http://" + GloableParams.IP + ":"
+                    + GloableParams.PORT + "/" + GloableParams.SITE
+                    + "/api/pdashop/quality/download.action?" + "path="
+                    + list.get(i).getFp_path() + "&" + "size=" + list.get(i).getFp_size()
+                    + "&" + "fileName=" + list.get(i).getFp_name();
+            path2 = "";
+            if (type.equals("QC")) {
+                path2 = pathQc;
+            } else if (type.equals("Test")) {
+                path2 = pathTest;
+            }
+            //            new Thread(new Runnable() {
+            //                @Override
+            //                public void run() {
+            String fileName = list.get(i).getFp_name();
+            fileName = System.currentTimeMillis() + fileName;
+            YLDownload.getInstance().download(Path, path2, fileName, new OnDownloadListener() {
+                @Override
+                public void onDownloadFailed(Exception e) {
+                    e.printStackTrace();
+                    progressDialog.dismiss();
+                    CommonUtil.toastNoRepeat(mActivity, "附件下载出错,请重试");
+                }
+
+                @Override
+                public void onDownloadSuccess() {
+                    MyLog.e("aaa","Test下载次数:" + index2 + ",list大小:" + testList.size());
+                    index2++;
+                    if (index2 == testList.size()) {
+                        //校验完整性
+                        if (type.equals("QC")) {
+                            File dirFire = new File(pathQc);
+                            setImagePath(dirFire, imageQCUrlList, "QC");
+                        } else if (type.equals("Test")) {
+                            File dirFire = new File(pathTest);
+                            setImagePath(dirFire, imageTestUrlList, "Test");
+                        }
+                    }
+                }
+
+                @Override
+                public void onDownloading(int i) {
+                    Log.e("aaa", "下载图片的进度是: " + i);
+                }
+            });
+            //                }
+            //            }).start();
+        }
+    }
+
+    private synchronized void setImagePath(File dirFire, List<AnnexInfo> list, String type) {
+        try{
+            MyLog.e("aaa","我执行了type:" + type + ",数量是:" + list.size());
+            long QCDownloadFileSize = 0;
+            for (int i1 = 0; i1 < list.size(); i1++) {
+                QCDownloadFileSize += Long.parseLong(list.get(i1).getFp_size());
+            }
+            File[] listOfFiles = dirFire.listFiles();
+            long QCFileSize = 0;
+            String filePath = "";
+            List<AnnexBean> fujianList = new ArrayList<>();
+            for (int i = 0; i < listOfFiles.length; i++) {
+                if (listOfFiles[i].isFile()) {
+                    // 获取文件路径
+                    filePath = listOfFiles[i].getAbsolutePath();
+                    fujianList.add(new AnnexBean(false, filePath,
+                            list.get(i).getFp_id() + ";", true));
+                    // 获取文件大小
+                    QCFileSize += listOfFiles[i].length();
+                }
+            }
+
+            //        if (QCDownloadFileSize == QCFileSize) {
+            //        if (listOfFiles.length == list.size()) {
+            getActivity().runOnUiThread(new Runnable() {
+                @Override
+                public void run() {
+                    MyLog.e("aaa","22222添加了文件类型:" + type + ",数量是:" + fujianList.size());
+                    if (type.equals("QC")) {
+                        //                        annexQCFuJianAdapter.addList(fujianList);
+//                        annexQCFuJianAdapter.setList(fujianList);
+//                        fujianList1.addAll(fujianList);
+
+//                        fujianList1.addAll(fujianList);
+//                        annexQCFuJianAdapter.addList(fujianList);
+
+                        fujianList1.clear();
+                        fujianList1.add(new AnnexBean(true, "", "", false));
+                        fujianList1.addAll(fujianList);
+                        annexQCFuJianAdapter.setListNotTitle(fujianList1);
+                        for (int i = 0; i < fujianList1.size(); i++) {
+                            MyLog.e("aaa","33333添加了文件类型:" + type + ",id是:" + fujianList1.get(i)+",是否是加号:" + fujianList1.get(i).isAddImage());
+                        }
+                    } else if (type.equals("Test")) {
+                        //                        annexShiYanFuJianAdapter.addList(fujianList);
+//                        annexShiYanFuJianAdapter.setList(fujianList);
+//                        fujianList2.addAll(fujianList);
+
+                        fujianList2.clear();
+                        fujianList2.add(new AnnexBean(true, "", "", false));
+                        fujianList2.addAll(fujianList);
+                        annexShiYanFuJianAdapter.setListNotTitle(fujianList2);
+
+//                        fujianList2.addAll(fujianList);
+//                        annexShiYanFuJianAdapter.addList(fujianList);
+
+                        for (int i = 0; i < fujianList2.size(); i++) {
+                            MyLog.e("aaa","33333添加了文件类型:" + type + ",id是:" + fujianList2.get(i)+",是否是加号:" + fujianList2.get(i).isAddImage());
+                        }
+                    }
+                }
+            });
+            if (imageQCUrlList.size() > 0 && imageTestUrlList.size() > 0) {
+                numberOfTimes++;
+                if (numberOfTimes >= 2) {
+                    progressDialog.dismiss();
+                }
+            }else {
+                progressDialog.dismiss();
+            }
+            //        }
+        }catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    @Override
+    public boolean onKeyDown(int keyCode, KeyEvent event) {
+        return false;
+    }
+
+    @Override
+    public boolean onFragmentBackPressed() {
+        return false;
+    }
+
+    @Override
+    public void onActivityResult(int requestCode, int resultCode, Intent data) {
+        super.onActivityResult(requestCode, resultCode, data);
+        if (resultCode != Activity.RESULT_OK) {
+            return;
+        }
+        if (requestCode == REQUEST_CODE1 && data != null) {
+            fujian = 1;
+        } else if (requestCode == REQUEST_CODE2 && data != null) {
+            fujian = 2;
+        }
+        selectedImagePaths.clear();
+        if (data.getClipData() != null) {
+            // 用户选择了多个图片
+            int count = data.getClipData().getItemCount();
+            for (int i = 0; i < count; i++) {
+                Uri imageUri = data.getClipData().getItemAt(i).getUri();
+                selectedImagePaths.add(getRealPathFromUri(imageUri));
+            }
+        } else if (data.getData() != null) {
+            // 用户选择了单个图片
+            Uri imageUri = data.getData();
+            selectedImagePaths.add(getRealPathFromUri(imageUri));
+        }
+        // 批量上传图片
+        uploadImages(selectedImagePaths);
+    }
+
+    private String getRealPathFromUri(Uri uri) {
+        // 获取真实的文件路径
+        String filePath;
+        String[] projection = {MediaStore.Images.Media.DATA};
+        Cursor cursor = mActivity.getContentResolver().query(uri, projection, null, null, null);
+        if (cursor == null) {
+            filePath = uri.getPath();
+        } else {
+            cursor.moveToFirst();
+            int columnIndex = cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA);
+            filePath = cursor.getString(columnIndex);
+            cursor.close();
+        }
+        return filePath;
+    }
+
+    private void uploadImages(List<String> imagePaths) {
+        uploadRecords = 0;
+        if (templist == null) {
+            templist = new ArrayList<>();
+        } else {
+            templist.clear();
+        }
+        uploadRecordsNumber = imagePaths.size();
+        for (String imagePath : imagePaths) {
+            try {
+                File mFile = new File(imagePath);
+                // 获得文件名
+                String fileName = mFile.getName();
+                MultipartBody.Builder builder = new MultipartBody.Builder();
+                builder.setType(MultipartBody.FORM);
+                //第一个参数要与Servlet中的一致
+                builder.addFormDataPart("file", fileName,
+                        RequestBody.create(MediaType.parse("application/octet-stream"), mFile))
+                        .addFormDataPart("type", "common")
+                        .addFormDataPart("master", CommonUtil.getMaster(mActivity));
+                RequestBody multipartBody = builder.build();
+                if (mProgressPopup == null) {
+                    mProgressPopup = new ProgressPopup(mActivity);
+                    mProgressPopup.setTitle("附件上传中...");
+                }
+                mProgressPopup.setProgress(0);
+                mProgressPopup.showPopupWindow();
+
+                UploadUtils.getInstance().postFile(GloableParams.ADDRESS_MOBILE_UPLOADATTACHS, multipartBody, new ProgressListener() {
+                    @Override
+                    public void onProgress(long currentBytes, long contentLength, boolean isDone) {
+                        int progress = (int) ((double) currentBytes * 100 / (double) contentLength);
+                        mProgressPopup.setProgress(progress);
+                        if (isDone || progress == 100) {
+                            mProgressPopup.dismiss();
+                        }
+                    }
+                }, new Callback() {
+                    @Override
+                    public void onFailure(Call call, IOException e) {
+                        mProgressPopup.dismiss();
+                        Log.d("raomeng_uploadf", e.getMessage());
+                        mActivity.runOnUiThread(new Runnable() {
+                            @Override
+                            public void run() {
+                                //CommonUtil.toastNoRepeat(mActivity, "附件上传失败");
+                                tv_updater_info.setTextColor(getResources().getColor(R.color.red));
+                                tv_updater_info.setText("附件上传失败");
+                            }
+                        });
+                    }
+
+                    @Override
+                    public void onResponse(Call call, Response response) throws IOException {
+                        mProgressPopup.dismiss();
+                        if (response.code() == 200) {
+                            try {
+                                String result = response.body().string();
+                                JSONObject resultObject = JSON.parseObject(result);
+                                String mEnclusureId = FastjsonUtil.getText(resultObject, "id");
+                                String s = removeSpace(mEnclusureId);
+                                String s1 = removeSpace2(s);
+                                Log.d("aaa", "切割后的数据: " + s1 + "");
+                                if (fujian == 1) {
+//                                    templist.add(new AnnexBean(false, mFile.getAbsolutePath(), s1 + ";", true));
+                                    for (int i = 0; i < fujianList1.size(); i++) {
+                                        MyLog.e("aaa","是否为+号" + fujianList1.get(i).isAddImage() + "当前的id是:" + fujianList1.get(i).getImageID());
+                                    }
+                                    fujianList1.add(new AnnexBean(false, mFile.getAbsolutePath(), s1 + ";", true));
+
+                                } else if (fujian == 2) {
+//                                    templist.add(new AnnexBean(false, mFile.getAbsolutePath(), s1 + ";", true));
+                                    fujianList2.add(new AnnexBean(false, mFile.getAbsolutePath(), s1 + ";", true));
+                                }
+                            } catch (IOException e) {
+                                e.printStackTrace();
+                            }
+                            mActivity.runOnUiThread(new Runnable() {
+                                @Override
+                                public void run() {
+                                    uploadRecords++;
+                                    if (uploadRecords == uploadRecordsNumber) {
+                                        tv_updater_info.setTextColor(getResources().getColor(R.color.blue));
+                                        tv_updater_info.setText("附件上传成功");
+                                        // CommonUtil.toastNoRepeat(mActivity,  "附件上传成功");
+                                        if (fujian == 1) {
+                                            //                                            Collections.reverse(fujianList1);
+//                                            annexQCFuJianAdapter.addList(templist);
+//                                            fujianList1.addAll(templist);
+                                            annexQCFuJianAdapter.setListNotTitle(fujianList1);
+                                            for (int i = 0; i < fujianList1.size(); i++) {
+                                                MyLog.e("aaa","2222是否为+号" + fujianList1.get(i).isAddImage() + "当前的id是:" + fujianList1.get(i).getImageID());
+                                            }
+                                        } else if (fujian == 2) {
+                                            //                                            Collections.reverse(fujianList2);
+//                                            annexShiYanFuJianAdapter.addList(templist);
+//                                            fujianList2.addAll(templist);
+                                            annexShiYanFuJianAdapter.setListNotTitle(fujianList2);
+                                        }
+                                        cet_beizhu1.setEnabled(true);
+                                        cet_beizhu2.setEnabled(true);
+                                        bt_gengxin.setEnabled(true);
+                                    }
+                                }
+                            });
+                        }
+                    }
+                }, new File[]{mFile});
+            } catch (Exception e) {
+                if (mProgressPopup != null) {
+                    mProgressPopup.dismiss();
+                }
+                tv_updater_info.setTextColor(getResources().getColor(R.color.red));
+                tv_updater_info.setText("附件上传失败");
+                //CommonUtil.toastNoRepeat(mActivity, "附件上传失败");
+            }
+        }
+
+    }
+
+    public String removeSpace(String s) {
+        String regex = "\\[";
+        Pattern pattern = Pattern.compile(regex);
+        Matcher matcher = pattern.matcher(s);
+        return matcher.replaceAll("");
+    }
+
+    public String removeSpace2(String s) {
+        String regex = "]";
+        Pattern pattern = Pattern.compile(regex);
+        Matcher matcher = pattern.matcher(s);
+        return matcher.replaceAll("");
+    }
+
+    @Override
+    public void onHiddenChanged(boolean hidden) {
+        super.onHiddenChanged(hidden);
+        //        if (!hidden) {
+        //            setTitle("质量管理");
+        //        }
+    }
+
+}

+ 55 - 12
app/src/main/java/com/uas/hystorage/global/GloableParams.java

@@ -14,9 +14,9 @@ import com.uas.hystorage.util.Constants;
  */
 public class GloableParams {
     //记录用户请求IP
-    private static String IP = null;
-    private static String PORT = null;
-    private static String SITE = null;
+    public static String IP = null;
+    public static String PORT = null;
+    public static String SITE = null;
     public static String ADDRESS_CONNECT_SERVER;
     public static String ADDRESS_LOGIN_APPLY;
     public static String ADDRESS_INOUTNO_APPLY;
@@ -349,6 +349,24 @@ public class GloableParams {
     public static String ADDRESS_GETCANTRANSFERWIP;
     public static String ADDRESS_TRANSFERWIP;
     public static String ADDRESS_GETBOXDETAIL;
+
+    /**
+     * 检验送样
+     * */
+    public static String ADDRESS_GETSOURCEDATA;  //岗位ENTER
+    public static String ADDRESS_SAVESAMPLEREPORT;  //打印标签按钮点击
+    public static String ADDRESS_FUZZYSEARCHSAMPLEREPORT;  //搜索按钮点击或者输入框ENTER事件
+    public static String ADDRESS_PRINTSAMPLEREPORT;  //送样单列表页面打印事件
+
+
+    /**
+     * 送样报告
+     * */
+    public static String ADDRESS_GETSAMPLEREPORT;  //送样报告---单号enter
+    public static String ADDRESS_UPDATESAMPLEREPORT;  //送样报告---更新
+    public static String ADDRESS_GETFILEPATHS;  //通过附件图片的id获取图片
+    public static String ADDRESS_DOWNLOAD;  //根据地质url获取数据流
+
     /**
      * 高登
      */
@@ -977,13 +995,6 @@ public class GloableParams {
     private static final String ADDRESSTAIL_COUNTING_TRANSFERWIP = "/api/pdashop/loading/transferWIP.action";
 
 
-
-
-
-
-
-
-
     /**
      * 良品入库
      */
@@ -1033,6 +1044,24 @@ public class GloableParams {
      */
     private static final String ADDRESSTAIL_ADDMA = "/api/pdashop/start/addMa.action";
 
+    //岗位ENTER
+    private static final String ADDRESSTAIL_GETSOURCEDATA = "/api/pdashop/source/getSourceData.action";
+    //打印标签按钮点击
+    private static final String ADDRESSTAIL_SAVESAMPLEREPORT = "/api/pdashop/quality/saveSampleReport.action";
+    //搜索按钮点击或者输入框ENTER事件
+    private static final String ADDRESSTAIL_FUZZYSEARCHSAMPLEREPORT = "/api/pdashop/quality/fuzzySearchSampleReport.action";
+    //打印事件
+    private static final String ADDRESSTAIL_PRINTSAMPLEREPORT = "/api/pdashop/quality/printSampleReport.action";
+
+    //送样报告
+    private static final String ADDRESSTAIL_GETSAMPLEREPORT = "/api/pdashop/quality/getSampleReport.action";
+    //更新按钮点击事件
+    private static final String ADDRESSTAIL_UPDATESAMPLEREPORT = "/api/pdashop/quality/updateSampleReport.action";
+    //通过图片ID获取图片url
+    private static final String ADDRESSTAIL_GETFILEPATHS = "/common/getFilePaths.action";
+    //根据地址URL获取数据流
+    private static final String ADDRESSTAIL_DOWNLOAD = "/api/pdashop/quality/download.action";
+
 
 
     /***********************************************************************************************/
@@ -1093,6 +1122,7 @@ public class GloableParams {
     public static final String GRIDNAME_ROLLOUT= "工序转出";
     public static final String GRIDNAME_PACKAGE= "包装采集";
     public static final String GRIDNAME_BAD_EXCHANGE = "换票";
+    public static final String INSPECT_AND_SEND_SAMPLES = "检验送样";
    // public static final String GRIDNAME_STAFF_CHANGE = "人员换岗";
     //public static final String GRIDNAME_STAFF_UP = "人员上线";
   //  public static final String GRIDNAME_STAFF_DOWN = "人员下线";
@@ -1109,7 +1139,8 @@ public class GloableParams {
 
 //           GRIDNAME_CHAI_PI,
            GRIDNAME_TIAO_ZHAN,
-           GRIDNAME_BAD_EXCHANGE
+           GRIDNAME_BAD_EXCHANGE,
+                   INSPECT_AND_SEND_SAMPLES
    };
 
     public static int[] indexMainGridImgs = {
@@ -1121,7 +1152,8 @@ public class GloableParams {
             R.drawable.iv_rollout,R.drawable.report,
 //            R.drawable.storage_bach_operation,
             R.drawable.index_smt_up,
-            R.mipmap.badchange
+            R.mipmap.badchange,
+            R.drawable.jianyansongyang
     };
 
     //INDEX:出入库管理Index
@@ -1610,5 +1642,16 @@ public class GloableParams {
         GloableParams.ADDRESS_GETCANTRANSFERWIP = uriHead + GloableParams.ADDRESSTAIL_COUNTING_GETCANTRANSFERWIP;
         GloableParams.ADDRESS_TRANSFERWIP = uriHead + GloableParams.ADDRESSTAIL_COUNTING_TRANSFERWIP;
         GloableParams.ADDRESS_GETBOXDETAIL = uriHead + GloableParams.ADDRESSTAIL_COUNTING_GETBOXDETAIL;
+
+        GloableParams.ADDRESS_GETSOURCEDATA = uriHead + GloableParams.ADDRESSTAIL_GETSOURCEDATA;
+        GloableParams.ADDRESS_SAVESAMPLEREPORT = uriHead + GloableParams.ADDRESSTAIL_SAVESAMPLEREPORT;
+        GloableParams.ADDRESS_FUZZYSEARCHSAMPLEREPORT = uriHead + GloableParams.ADDRESSTAIL_FUZZYSEARCHSAMPLEREPORT;
+        GloableParams.ADDRESS_PRINTSAMPLEREPORT = uriHead + GloableParams.ADDRESSTAIL_PRINTSAMPLEREPORT;
+        GloableParams.ADDRESS_GETSAMPLEREPORT = uriHead + GloableParams.ADDRESSTAIL_GETSAMPLEREPORT;
+        GloableParams.ADDRESS_UPDATESAMPLEREPORT = uriHead + GloableParams.ADDRESSTAIL_UPDATESAMPLEREPORT;
+        GloableParams.ADDRESS_GETFILEPATHS = uriHead + GloableParams.ADDRESSTAIL_GETFILEPATHS;
+        GloableParams.ADDRESS_DOWNLOAD = uriHead + GloableParams.ADDRESSTAIL_DOWNLOAD;
+
+
     }
 }

+ 18 - 0
app/src/main/java/com/uas/hystorage/util/ClickUtils.java

@@ -0,0 +1,18 @@
+package com.uas.hystorage.util;
+
+public class ClickUtils {
+
+    private static long lastClickTime;
+    public static long pauseTime = 1000;
+
+    public static boolean isFastClick() {
+        long currentTime = System.currentTimeMillis();
+        if (currentTime - lastClickTime < pauseTime) {
+            return true;
+        }
+        lastClickTime = currentTime;
+        return false;
+    }
+
+
+}

+ 9 - 0
app/src/main/java/com/uas/hystorage/util/HttpParams.java

@@ -26,6 +26,11 @@ public class HttpParams {
      */
     private Map<String, String> params;
 
+    /**
+     * 请求参数(任意类型参数)
+     */
+    private Map<String, Object> paramsObj;
+
     /**
      * 请求头
      */
@@ -59,6 +64,10 @@ public class HttpParams {
         return flag;
     }
 
+    public Map<String,Object> getParamsObj(){
+        return paramsObj;
+    }
+
     public Map<String, String> getParams() {
         return params;
     }

+ 161 - 0
app/src/main/java/com/uas/hystorage/util/MyLog.java

@@ -0,0 +1,161 @@
+package com.uas.hystorage.util;
+
+import android.annotation.SuppressLint;
+import android.util.Log;
+
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+/**
+ * 带日志文件输入,又可控开关的日志调试
+ */
+@SuppressLint("SimpleDateFormat")
+public class MyLog {
+	public static Boolean MYLOG_SWITCH = true; // 日志文件总开关
+	private static Boolean MYLOG_WRITE_TO_FILE = true;// 日志写入文件开关
+	private static char MYLOG_TYPE = 'v';// 输入日志类型,w代表只输出告警信息等,v代表输出所有信息
+	@SuppressLint("SdCardPath")
+	private static String MYLOG_PATH_SDCARD_DIR1 = "/sdcard/MSShow";    // 日志文件在sdcard中的路径
+	private static String MYLOG_PATH_SDCARD_DIR2 = "/Log";
+	private static String MYLOG_PATH_SDCARD_DIR = MYLOG_PATH_SDCARD_DIR1+MYLOG_PATH_SDCARD_DIR2;
+	private static String MYLOGFILEName = "Log.txt";// 本类输出的日志文件名称
+
+	@SuppressLint("SimpleDateFormat")
+	private static SimpleDateFormat myLogSdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");// 日志的输出格式
+
+	private static boolean isDebug = true;		//普通log的开关
+	private static String TAG = "我的天啊" +"-----------";
+
+	public static void e(String msg){
+		if(isDebug){
+			Log.e(TAG, msg);
+		}
+	}
+
+	public static void w(String msg){
+		if(isDebug){
+			Log.w(TAG, msg);
+		}
+	}
+
+	public static void d(String msg){
+		if(isDebug){
+			Log.d(TAG, msg);
+		}
+	}
+
+	public static void i(String msg){
+		if(isDebug){
+			Log.i(TAG, msg);
+		}
+	}
+
+	public static void w(String tag, Object msg) { // 警告信息
+		log(tag, msg.toString(), 'w');
+	}
+
+	public static void e(String tag, Object msg) { // 错误信息
+		log(tag, msg.toString(), 'e');
+	}
+
+	public static void d(String tag, Object msg) {// 调试信息
+		log(tag, msg.toString(), 'd');
+	}
+
+	public static void i(String tag, Object msg) {//
+		log(tag, msg.toString(), 'i');
+	}
+
+	public static void v(String tag, Object msg) {
+		log(tag, msg.toString(), 'v');
+	}
+
+	public static void w(String tag, String text) {
+		log(tag, text, 'w');
+	}
+
+	public static void e(String tag, String text) {
+		log(tag, text, 'e');
+	}
+
+	public static void d(String tag, String text) {
+		log(tag, text, 'd');
+	}
+
+	public static void i(String tag, String text) {
+		log(tag, text, 'i');
+	}
+
+	public static void v(String tag, String text) {
+		log(tag, text, 'v');
+	}
+
+	/**
+	 * 根据tag, msg和等级,输出日志
+	 */
+	private static void log(String tag, String msg, char level) {
+		msg = "\r\n"+msg;
+		if (MYLOG_SWITCH) {
+			if ('e' == level && ('e' == MYLOG_TYPE || 'v' == MYLOG_TYPE)) { // 输出错误信息
+				Log.e(tag, msg);
+			} else if ('w' == level && ('w' == MYLOG_TYPE || 'v' == MYLOG_TYPE)) {
+				Log.w(tag, msg);
+			} else if ('d' == level && ('d' == MYLOG_TYPE || 'v' == MYLOG_TYPE)) {
+				Log.d(tag, msg);
+			} else if ('i' == level && ('d' == MYLOG_TYPE || 'v' == MYLOG_TYPE)) {
+				Log.i(tag, msg);
+			} else {
+				Log.v(tag, msg);
+			}
+			if (MYLOG_WRITE_TO_FILE) {
+				writeLogtoFile(String.valueOf(level), tag, msg);
+			}
+		}
+	}
+
+	/**
+	 * 打开日志文件并写入日志
+	 * **/
+	private static void writeLogtoFile(String mylogtype, String tag, String text) {// 新建或打开日志文件
+		isExist(MYLOG_PATH_SDCARD_DIR1);
+		isExist(MYLOG_PATH_SDCARD_DIR);
+		Date nowtime = new Date();
+//		String needWriteFiel = logfile.format(nowtime);
+		String needWriteMessage = myLogSdf.format(nowtime) + "    " + mylogtype
+				+ "    " + tag + "    " + text;
+		File file = new File(MYLOG_PATH_SDCARD_DIR, MYLOGFILEName);
+		try {
+			FileWriter filerWriter = new FileWriter(file, true);// 后面这个参数代表是不是要接上文件中原来的数据,不进行覆盖
+			BufferedWriter bufWriter = new BufferedWriter(filerWriter);
+			bufWriter.write(needWriteMessage);
+			bufWriter.newLine();
+			bufWriter.close();
+			filerWriter.close();
+		} catch (IOException e) {
+			e.printStackTrace();
+		}
+	}
+
+	/**
+	 * 删除制定的日志文件
+	 * */
+	public static void delFile() {// 删除日志文件
+		File file = new File(MYLOG_PATH_SDCARD_DIR, MYLOGFILEName);
+		if (file.exists()) {
+			file.delete();
+		}
+	}
+
+	public static void isExist(String path) {
+		File file = new File(path);
+		// 判断文件夹是否存在,如果不存在则创建文件夹
+		if (!file.exists()) {
+			file.mkdir();
+		}
+
+	}
+}

+ 164 - 0
app/src/main/java/com/uas/hystorage/util/OKHttpUitls.java

@@ -0,0 +1,164 @@
+package com.uas.hystorage.util;
+
+import android.os.Handler;
+import android.os.Message;
+import android.text.TextUtils;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Iterator;
+
+import okhttp3.Call;
+import okhttp3.Callback;
+import okhttp3.FormBody;
+import okhttp3.OkHttpClient;
+import okhttp3.Request;
+import okhttp3.RequestBody;
+import okhttp3.Response;
+
+public class OKHttpUitls {
+
+    private OKHttpGetListener onOKHttpGetListener;
+    private MyHandler myHandler = new MyHandler();
+
+    private static final String TAG = "OKHttpUitls";
+
+    // get
+    public void get(String url) {
+        OkHttpClient.Builder builderlog = new OkHttpClient.Builder();
+//        if (BuildConfig.DEBUG) {
+//            builderlog.addNetworkInterceptor(new StethoInterceptor());
+//        }
+        OkHttpClient client = builderlog.build();
+
+//        OkHttpClient client = new OkHttpClient();
+        //创建请求对象
+        Request request = new Request.Builder().url(url).build();
+        //创建Call请求队列
+        //请求都是放到一个队列里面的
+        Call call = client.newCall(request);
+        MyLog.i(TAG,"get请求到的数据: " + call + "------------");
+        //开始请求
+        call.enqueue(new Callback() {
+            //       失败,成功的方法都是在子线程里面,不能直接更新UI
+            @Override
+            public void onFailure(Call call, IOException e) {
+                Message message = myHandler.obtainMessage();
+                message.obj = "请求失败";
+                message.what = 0;
+                myHandler.sendMessage(message);
+            }
+
+            @Override
+            public void onResponse(Call call, Response response) throws IOException {
+                Message message = myHandler.obtainMessage();
+                String json = response.body().string();
+                message.obj = json;
+                message.what = 1;
+                myHandler.sendMessage(message);
+            }
+        });
+    }
+
+    public void post(HashMap<String,String> map,String url){
+        OkHttpClient.Builder builderlog = new OkHttpClient.Builder();
+//        if (BuildConfig.DEBUG) {
+//            builderlog.addNetworkInterceptor(new StethoInterceptor());
+//        }
+        OkHttpClient okHttpClient = builderlog.build();
+
+//        OkHttpClient okHttpClient = new OkHttpClient();
+
+//        RequestBody requestBody = new FormBody.Builder()
+//                .add("companycode","1031")
+//                .add("password","a123456")
+//                .add("username","admin")
+//                .build();
+
+
+//        if (!url.equals(Http.loginUrl)) {
+//            SharedPreferencesHelper sp = App.getSP();
+//            String token = (String) sp.getSharedPreference("token", "");
+//            if (!TextUtils.isEmpty(token)) {
+//                map.put("token", token);
+//            }
+//        }
+
+        FormBody.Builder builder = new FormBody.Builder();
+        Iterator<String> iterator = map.keySet().iterator();
+        while (iterator.hasNext()) {
+            String key = iterator.next();
+            builder.add(key,"" + map.get(key));
+            MyLog.i(TAG,"post的参数是:" + key +",值是:" + map.get(key));
+        }
+        RequestBody requestBody = builder.build();
+        Request request = new Request.Builder()
+                .addHeader("content-type", "application/json")
+                .url(url)
+                .post(requestBody)
+                .build();
+
+        //方式二: 如果后端接收的使字符串就可以用这种方式
+ //       OkHttpClient client = new OkHttpClient();
+//        Request request = new Request.Builder()
+//                .addHeader("content-type", "application/json")
+//                .url(url)
+//                .post(RequestBody.create(MediaType.parse("application/json; charset=utf-8"),map.toString()))
+//                .build();
+
+        Call call = okHttpClient.newCall(request);
+        MyLog.i(TAG,"post() returned: " + call + "------------");
+        call.enqueue(new Callback() {
+            //       失败,成功的方法都是在子线程里面,不能直接更新UI
+            @Override
+            public void onFailure(Call call, IOException e) {
+                Message message = myHandler.obtainMessage();
+                message.obj = "请求失败";
+                message.what = 0;
+                myHandler.sendMessage(message);
+            }
+
+            @Override
+            public void onResponse(Call call, Response response) throws IOException {
+                Message message = myHandler.obtainMessage();
+                String json = response.body().string();
+                message.obj = json;
+                message.what = 1;
+                myHandler.sendMessage(message);
+            }
+        });
+
+
+    }
+
+    //使用接口回到,将数据返回
+    public interface OKHttpGetListener {
+        void error(String error);
+
+        void success(String json);
+    }
+
+    //给外部调用的方法
+    public void setOnOKHttpGetListener(OKHttpGetListener onOKHttpGetListener) {
+        this.onOKHttpGetListener = onOKHttpGetListener;
+    }
+
+    //使用Handler,将数据在主线程返回
+    class MyHandler extends Handler {
+        @Override
+        public void handleMessage(Message msg) {
+            int w = msg.what;
+            MyLog.i(TAG, "handleMessage() returned: " + msg);
+            if (w == 0) {
+                String error = (String) msg.obj;
+                onOKHttpGetListener.error(error);
+            }
+            if (w == 1) {
+                String json = (String) msg.obj;
+                onOKHttpGetListener.success(json);
+            }
+        }
+    }
+
+
+}

+ 11 - 0
app/src/main/java/com/uas/hystorage/util/OnDownloadListener.java

@@ -0,0 +1,11 @@
+package com.uas.hystorage.util;
+
+public interface OnDownloadListener {
+
+    void onDownloadFailed(Exception e);
+
+    void onDownloadSuccess();
+
+    void onDownloading(int i);
+
+}

+ 52 - 12
app/src/main/java/com/uas/hystorage/util/PrintUtils.java

@@ -2,6 +2,7 @@ package com.uas.hystorage.util;
 
 import android.content.Context;
 import android.text.TextUtils;
+import android.util.Log;
 
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
@@ -22,10 +23,18 @@ public class PrintUtils {
                 printTemplate = SharedPreUtil.getString(context, Constants.FLAG.PRINT_TEMPLATE_CACHE, "");
             }
 
+            //     * @param offset 偏移值
+            //     * @param h      横向分辨率
+            //     * @param v      纵向分辨率
+            //     * @param height 最大高度----实际的打印纸张的高度
+            //     * @param qty    重复打印次数
             int offset = 6,
-                    h = 400,
-                    v = 800,
-                    height = 400,
+//                    h = 400,
+//                    v = 800,
+//                    height = 400,
+                                        h = 400,
+                                        v = 800,
+                                        height = 400,
                     qty = 1;
 
             JSONArray templateArray = JSON.parseArray(printTemplate);
@@ -33,8 +42,19 @@ public class PrintUtils {
                 PrintHelper printHelper = new PrintHelper(offset, h, v, height, qty);
                 for (int i = 0; i < templateArray.size(); i++) {
                     JSONObject templateObject = templateArray.getJSONObject(i);
-
                     if (templateObject != null) {
+                        //la_offset 偏移值
+                        //la_h    横向分辨率
+                        //la_y   纵向分辨率
+                        //la_height  最大高度
+                        //la_qty  重复打印次数
+                        int la_offset = FastjsonUtil.getInt(templateObject, "LA_OFFSET") == 0 ? 6:FastjsonUtil.getInt(templateObject, "LA_OFFSET");
+                        int la_h = FastjsonUtil.getInt(templateObject, "LA_H") == 0 ? 400:FastjsonUtil.getInt(templateObject, "LA_H");
+                        int la_y = FastjsonUtil.getInt(templateObject, "LA_Y") == 0 ? 800:FastjsonUtil.getInt(templateObject, "LA_Y");
+                        int la_height = FastjsonUtil.getInt(templateObject, "LA_HEIGHT") == 0 ? 300:FastjsonUtil.getInt(templateObject, "LA_HEIGHT");
+                        int la_qty = FastjsonUtil.getInt(templateObject, "LA_QTY") == 0 ? 1:FastjsonUtil.getInt(templateObject, "LA_QTY");
+                        printHelper = new PrintHelper(la_offset, la_h, la_y, la_height, la_qty);
+
                         String valuetype = FastjsonUtil.getText(templateObject, "LP_VALUETYPE");
                         double leftrate = FastjsonUtil.getDouble(templateObject, "LP_LEFTRATE");
                         int printX = (int) (leftrate * dpi / 25.4);
@@ -46,19 +66,25 @@ public class PrintUtils {
                         String printKey = FastjsonUtil.getText(templateObject, "LP_NAME");
 
                         String printText = FastjsonUtil.getText(dataJson, printKey);
+                        Log.e("aaa", "打印内容: " + printText +
+                                ",dataJson:" + dataJson + ",printKey:" + printKey + ",valuetype:" + valuetype);
+
+                        if (valuetype.equals("constant")) {
+                            printText = printKey;
+                        }
 
                         if (!TextUtils.isEmpty(printText)) {
                             switch (valuetype) {
-                                case "barcode":
+                                case "barcode":     //条形码
                                     printHelper = printHelper.printBarCode(printText)
-                                            .setX(printX)
-                                            .setY(printY)
-                                            .setHeight(barHeightInt - (int) (2 * dpi / 25.4))
+                                            .setX(printX)//宽
+                                            .setY(printY)//高
+                                            .setHeight(barHeightInt - (int) (2 * dpi / 25.4))//条码单位高度
                                             .setCodeTextFont(4)
-                                            .setCodeTextSize(2)
+                                            .setCodeTextSize(fontSize)
                                             .build();
                                     break;
-                                case "text":
+                                case "text":    //文字
                                     int textFont = 7;
                                     if ("BAR_BATCHCODE".equals(printKey)) {
                                         textFont = 7;
@@ -66,8 +92,9 @@ public class PrintUtils {
                                     printHelper = printHelper.printText(printText)
                                             .setX(printX)
                                             .setY(printY)
-                                            .setBold(2)
-                                            .setTextFont(textFont)
+                                            .setBold(1)
+                                            .setTextFont(textFont)//字号
+                                            .setTextSize(fontSize)//字体大小,取接口的值
                                             .build();
                                     break;
                                 case "qrcode"://打印二维码
@@ -78,6 +105,19 @@ public class PrintUtils {
                                             .setModel(2)
                                             .build();
                                     break;
+                                case "constant":        //文字
+                                    int textFont2 = 7;
+                                    if ("BAR_BATCHCODE".equals(printKey)) {
+                                        textFont2 = 7;
+                                    }
+                                    printHelper = printHelper.printText(printText)
+                                            .setX(printX)
+                                            .setY(printY)
+                                            .setBold(2)
+                                            .setTextFont(textFont2)//字号
+                                            .setTextSize(fontSize)//字体大小,取接口的值
+                                            .build();
+                                    break;
                             }
                         }
                     }

+ 2 - 1
app/src/main/java/com/uas/hystorage/util/VollyRequest.java

@@ -92,7 +92,8 @@ public class VollyRequest {
             }
         }
 
-        PdaApplication.mRequestQueue.cancelAll(httpParams.getUrl());
+        // 取消所有带有这个tag的请求
+//        PdaApplication.mRequestQueue.cancelAll(httpParams.getUrl());
 
         stringRequest = new StringRequest(httpParams.getMethod(), url,
                 new Response.Listener<String>() {

+ 152 - 0
app/src/main/java/com/uas/hystorage/util/YLDownload.java

@@ -0,0 +1,152 @@
+package com.uas.hystorage.util;
+
+import android.graphics.Bitmap;
+import android.graphics.BitmapFactory;
+import android.support.annotation.NonNull;
+import android.util.Log;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.concurrent.TimeUnit;
+
+import okhttp3.Call;
+import okhttp3.OkHttpClient;
+
+import okhttp3.Callback;
+import okhttp3.Request;
+import okhttp3.Response;
+import okhttp3.ResponseBody;
+
+/**
+ * 文件下载工具栏
+ */
+public class YLDownload {
+    private static YLDownload ylDownload;
+    private OkHttpClient client = new OkHttpClient.Builder()
+            .connectTimeout(60, TimeUnit.SECONDS)
+            .readTimeout(60, TimeUnit.SECONDS)
+            .writeTimeout(60, TimeUnit.SECONDS)
+            .build();
+
+    //    private OkHttpClient client = new OkHttpClient();
+
+
+    private YLDownload() {
+    }
+
+    public static YLDownload getInstance() {
+        if (ylDownload == null) {
+            ylDownload = new YLDownload();
+        }
+        return ylDownload;
+    }
+
+    /**
+     * @param url                下载地址
+     * @param fileDir            储存下载文件的目录
+     * @param fileName           文件名称
+     * @param onDownloadListener 下载监听
+     */
+    public void download(String url, String fileDir, String fileName, OnDownloadListener onDownloadListener) {
+        Request request = new Request.Builder()
+                .url(url)
+                .build();
+        //MyLog.e("aaa","下载路径是:" + url + ",文件夹:" + fileDir + ",文件名:" + fileName);
+        Call call = client.newCall(request);
+        call.enqueue(new Callback() {
+            @Override
+            public void onFailure(@NonNull Call call, @NonNull IOException e) {
+                onDownloadListener.onDownloadFailed(e);
+            }
+
+            @Override
+            public void onResponse(@NonNull Call call, @NonNull Response response) throws IOException {
+                if (response.isSuccessful()) {
+                    MyLog.e("aaa","下载路径是:" + url + ",文件夹:" + fileDir + ",文件名:" + fileName);
+                    ResponseBody responseBody = response.body();
+                    File file_dir = new File(fileDir);
+                    if (!file_dir.exists()) {
+                        file_dir.mkdirs();
+                    }
+                    File file = new File(file_dir, fileName);
+                    FileOutputStream fos = new FileOutputStream(file);
+
+
+//                    // 获取输入流
+//                    InputStream inputStream = responseBody.byteStream();
+//                    // 创建文件输出流
+//                    FileOutputStream fos = new FileOutputStream(file);
+//                    // 定义缓冲区
+//                    byte[] buffer = new byte[4096];
+//                    int bytesRead;
+//
+//                    // 读取文件并写入到本地
+//                    while ((bytesRead = inputStream.read(buffer)) != -1) {
+//                        fos.write(buffer, 0, bytesRead);
+//                    }
+//                    // 关闭流
+//                    fos.close();
+//                    inputStream.close();
+
+
+
+                    fos.write(responseBody.bytes());
+                    fos.close();
+                    onDownloadListener.onDownloadSuccess();
+                }else {
+                    MyLog.e("aaa","下载失败路径是:" + url + ",文件名:" + fileName);
+                }
+
+
+                //                InputStream inputStream = null;
+                //                FileOutputStream outputStream = null;
+                //                byte[] buff = new byte[2048];
+                //                int length = 0;
+                //
+                //                // 储存下载文件的目录
+                //                File file_dir = new File(fileDir);
+                //                if (!file_dir.exists()) {
+                //                    file_dir.mkdirs();
+                //                }
+                //                File file = new File(file_dir, fileName);
+                //
+                //                try {
+                //                    inputStream = response.body().byteStream();
+                //                    long total = response.body().contentLength();
+                //                    outputStream = new FileOutputStream(file);
+                //                    length = inputStream.read(buff);
+                //                    long sum = 0;
+                //                    while (length != -1) {
+                //                        outputStream.write(buff, 0, length);
+                //                        sum += length;
+                //                        int progress = (int) (sum * 1.0f / total * 100);
+                //                        // 下载中更新进度条
+                //                        onDownloadListener.onDownloading(progress);
+                //                    }
+                //                    outputStream.flush();
+                //                    // 下载完成
+                //                    onDownloadListener.onDownloadSuccess();
+                //                } catch (Exception e) {
+                //                    onDownloadListener.onDownloadFailed(e);
+                //                } finally {
+                //                    if (inputStream != null) {
+                //                        inputStream.close();
+                //                    }
+                //                    if (outputStream != null) {
+                //                        outputStream.close();
+                //                    }
+                //                }
+
+
+            }
+        });
+
+        //        try {
+        //            call.execute();
+        //        } catch (IOException e) {
+        //            e.printStackTrace();
+        //        }
+    }
+}

BIN
app/src/main/res/drawable-xhdpi/jianyansongyang.png


BIN
app/src/main/res/drawable-xhdpi/shouyebaogao.png


BIN
app/src/main/res/drawable-xhdpi/tupian.png


BIN
app/src/main/res/drawable-xhdpi/xunchabaogao.png


BIN
app/src/main/res/drawable-xhdpi/zengjiatu.png


+ 46 - 0
app/src/main/res/layout/act_blue_tooth_print.xml

@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:orientation="vertical">
+
+
+    <include layout="@layout/view_head"/>
+
+    <RelativeLayout
+
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:background="#F2F2F2"
+        android:padding="8dp">
+
+        <TextView
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_centerVertical="true"
+            android:text="开启蓝牙"
+            android:textColor="#000000"
+            android:textSize="14sp" />
+
+        <vn.luongvo.widget.iosswitchview.SwitchView
+            android:id="@+id/bluetooth_print_sv"
+            android:layout_width="40dp"
+            android:layout_height="24dp"
+            android:layout_alignParentRight="true" />
+
+        <ImageView
+            android:id="@+id/bluetooth_print_refresh_iv"
+            android:layout_width="24dp"
+            android:layout_height="24dp"
+            android:layout_centerVertical="true"
+            android:layout_marginRight="20dp"
+            android:layout_toLeftOf="@id/bluetooth_print_sv"
+            android:src="@drawable/ic_refresh" />
+    </RelativeLayout>
+
+    <android.support.v7.widget.RecyclerView
+        android:id="@+id/bluetooth_print_rv"
+        android:layout_width="match_parent"
+        android:layout_height="0dp"
+        android:layout_weight="1" />
+</LinearLayout>

+ 246 - 0
app/src/main/res/layout/act_inspection_send_samples.xml

@@ -0,0 +1,246 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:orientation="vertical">
+
+    <include layout="@layout/view_head"/>
+
+    <LinearLayout
+        android:id="@+id/ll_inspection"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:orientation="vertical"
+        >
+
+        <LinearLayout
+            android:layout_width="match_parent"
+            android:layout_marginTop="20dp"
+            android:layout_height="40dp"
+            android:layout_marginStart="10dp"
+            android:layout_marginEnd="10dp"
+            android:gravity="center_vertical"
+            android:orientation="horizontal">
+
+            <TextView
+                android:layout_width="70dp"
+                android:gravity="end"
+                android:layout_height="wrap_content"
+                android:text="检验类型"
+                android:textSize="16sp"
+                android:textColor="@color/red"
+                />
+
+            <RadioGroup
+                android:id="@+id/rg_jianyanleixin"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginStart="20dp"
+                android:orientation="horizontal">
+
+                <RadioButton
+                    android:id="@+id/rb_shoujian"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:checked="true"
+                    android:text="首件"
+                    android:textSize="16sp" />
+
+                <RadioButton
+                    android:id="@+id/rb_xunjian"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_marginStart="80dp"
+                    android:text="巡检"
+                    android:textSize="16sp"
+                    />
+
+            </RadioGroup>
+        </LinearLayout>
+
+        <LinearLayout
+            android:layout_marginTop="10dp"
+            android:layout_width="wrap_content"
+            android:layout_height="40dp"
+            android:orientation="horizontal"
+            android:gravity="center_vertical"
+            android:layout_marginStart="10dp"
+            android:layout_marginEnd="10dp"
+            >
+
+            <TextView
+                android:layout_width="70dp"
+                android:gravity="end"
+                android:layout_height="wrap_content"
+                android:text="岗位资源"
+                android:textColor="@color/red"
+                android:textSize="16sp"
+                />
+
+            <LinearLayout
+                android:layout_width="160dp"
+                android:layout_height="wrap_content"
+                android:background="@color/white"
+                android:layout_marginStart="10dp"
+                android:orientation="horizontal">
+
+                <com.uas.hystorage.view.ClearableEditText
+                    android:id="@+id/cet_gangweiziyuan"
+                    style="@style/EditTextStyle"
+                    android:layout_width="0dp"
+                    android:layout_weight="1"
+                    android:layout_margin="3dp"
+                    android:background="@drawable/bg_line_edittext"
+                    android:hint=""
+                    android:textColor="@color/black"/>
+
+                <ImageView
+                    android:id="@+id/iv_search"
+                    android:layout_width="34dp"
+                    android:layout_height="34dp"
+                    android:layout_gravity="center_vertical"
+                    android:layout_marginEnd="5dp"
+                    android:background="@drawable/bg_button"
+                    android:src="@drawable/search_48" />
+            </LinearLayout>
+
+            <TextView
+                android:id="@+id/tv_gangweiname"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginStart="10dp"
+                android:text="岗位资源名称"
+                android:textSize="16sp"
+                />
+
+        </LinearLayout>
+
+        <LinearLayout
+            android:layout_marginTop="10dp"
+            android:layout_width="match_parent"
+            android:layout_height="40dp"
+            android:orientation="horizontal"
+            android:layout_marginStart="10dp"
+            android:layout_marginEnd="20dp"
+            android:gravity="center_vertical"
+            >
+
+            <TextView
+                android:layout_width="70dp"
+                android:gravity="end"
+                android:layout_height="wrap_content"
+                android:text="机台"
+                android:textSize="16sp"
+                android:textColor="@color/red"
+                />
+
+            <com.uas.hystorage.view.ClearableEditText
+                android:id="@+id/cet_jitai"
+                android:layout_width="match_parent"
+                android:layout_height="match_parent"
+                android:layout_marginStart="20dp"
+                android:layout_margin="3dp"
+                android:background="@drawable/bg_line_edittext"
+                android:hint=""
+                android:textColor="@color/black"/>
+
+        </LinearLayout>
+
+        <LinearLayout
+            android:layout_marginTop="10dp"
+            android:layout_width="match_parent"
+            android:layout_height="40dp"
+            android:orientation="horizontal"
+            android:layout_marginStart="10dp"
+            android:layout_marginEnd="20dp"
+            android:gravity="center_vertical"
+            >
+
+            <TextView
+                android:layout_width="70dp"
+                android:gravity="end"
+                android:layout_height="wrap_content"
+                android:text="工单号"
+                android:textSize="16sp"
+                android:textColor="@color/red"
+                />
+
+            <com.uas.hystorage.view.ClearableEditText
+                android:id="@+id/cet_gondanhao"
+                android:layout_height="match_parent"
+                android:layout_width="match_parent"
+                android:layout_marginStart="20dp"
+                android:layout_margin="3dp"
+                android:background="@drawable/bg_line_edittext"
+                android:hint=""
+                android:textColor="@color/black"/>
+
+        </LinearLayout>
+
+        <LinearLayout
+            android:layout_marginTop="10dp"
+            android:layout_width="match_parent"
+            android:layout_height="40dp"
+            android:orientation="horizontal"
+            android:layout_marginStart="10dp"
+            android:layout_marginEnd="20dp"
+            android:gravity="center_vertical"
+            >
+
+            <TextView
+                android:layout_width="70dp"
+                android:gravity="end"
+                android:layout_height="wrap_content"
+                android:text="项目号"
+                android:textSize="16sp"
+                android:textColor="@color/red"
+                />
+
+            <com.uas.hystorage.view.ClearableEditText
+                android:id="@+id/cet_xiangmuhao"
+                android:layout_height="match_parent"
+                android:layout_width="match_parent"
+                android:layout_marginStart="20dp"
+                android:layout_margin="3dp"
+                android:background="@drawable/bg_line_edittext"
+                android:hint=""
+                android:textColor="@color/black"/>
+
+        </LinearLayout>
+
+        <Button
+            android:id="@+id/bt_dayinbiaoqian"
+            style="@style/ButtonStyle"
+            android:layout_width="match_parent"
+            android:layout_margin="12dp"
+            android:layout_alignParentBottom="true"
+            android:text="打印标签" />
+
+        <TextView
+            android:id="@+id/tv_isok"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginStart="20dp"
+            android:layout_marginEnd="20dp"
+            android:textColor="@color/blue"
+            />
+
+        <TextView
+            android:id="@+id/tv_details"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:textColor="@color/black"
+            android:layout_marginStart="20dp"
+            android:layout_marginEnd="20dp"
+            />
+
+    </LinearLayout>
+
+    <FrameLayout
+        android:id="@+id/fl_dayin"
+        android:visibility="gone"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        />
+
+</LinearLayout>

+ 65 - 0
app/src/main/res/layout/act_sample_selivery_list.xml

@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:focusableInTouchMode="true"
+    android:orientation="vertical">
+
+    <include layout="@layout/view_head"/>
+
+    <LinearLayout
+        android:id="@+id/ll_sample_selivery"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:orientation="vertical"
+        >
+        <LinearLayout
+            android:layout_width="match_parent"
+            android:layout_height="50dp"
+            android:orientation="horizontal"
+            android:layout_marginStart="10dp"
+            android:layout_marginEnd="10dp"
+            android:layout_marginTop="20dp"
+            android:padding="5dp">
+
+            <com.uas.hystorage.view.ClearableEditText
+                android:id="@+id/cet_search_et"
+                style="@style/EditTextStyle"
+                android:layout_width="0dp"
+                android:layout_height="match_parent"
+                android:layout_weight="1"
+                android:background="@drawable/shape_msg_block"
+                android:drawableLeft="@drawable/icon_search"
+                android:hint="搜索"
+                android:imeOptions="actionSearch"
+                android:paddingLeft="5dp" />
+
+            <TextView
+                android:id="@+id/tv_search_btn"
+                android:layout_width="wrap_content"
+                android:layout_height="match_parent"
+                android:gravity="center"
+                android:paddingLeft="10dp"
+                android:paddingRight="10dp"
+                android:text="@string/btn_search"
+                android:textColor="@color/text_blue" />
+
+        </LinearLayout>
+
+
+        <com.handmark.pulltorefresh.library.PullToRefreshListView
+            android:id="@+id/refreshListView"
+            style="@style/ListViewBasic"
+            android:layout_width="match_parent"
+            android:layout_height="match_parent"
+            android:layout_marginStart="10dp"
+            android:layout_marginEnd="10dp"
+            android:layout_marginBottom="30dp"
+            android:layout_marginTop="20dp"
+            android:scrollbars="none"
+            android:scrollingCache="false" />
+
+    </LinearLayout>
+
+
+</LinearLayout>

+ 161 - 0
app/src/main/res/layout/fra_report_page.xml

@@ -0,0 +1,161 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:orientation="vertical"
+    >
+
+    <android.support.v4.widget.NestedScrollView
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        >
+
+        <LinearLayout
+            android:layout_width="match_parent"
+            android:layout_height="match_parent"
+            android:layout_marginStart="20dp"
+            android:layout_marginEnd="20dp"
+            android:orientation="vertical"
+            >
+
+            <LinearLayout
+                android:layout_width="match_parent"
+                android:layout_height="40dp"
+                android:orientation="horizontal"
+                android:gravity="center_vertical"
+                android:layout_marginTop="5dp"
+                >
+
+                <TextView
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:text="单号"
+                    android:textSize="16sp"
+                    android:textColor="@color/red"
+                    />
+
+                <com.uas.hystorage.view.ClearableEditText
+                    android:id="@+id/cet_danhao"
+                    android:background="@drawable/bg_line_edittext"
+                    android:layout_height="40dp"
+                    android:layout_width="match_parent"
+                    android:layout_marginStart="10dp"
+                    android:hint=""
+                    android:textColor="@color/black"/>
+
+            </LinearLayout>
+
+            <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:text="QC检验附件"
+                android:textSize="16sp"
+                android:textColor="@color/black"
+                />
+
+            <android.support.v7.widget.RecyclerView
+                android:id="@+id/rv_qc_fujian"
+                android:layout_width="match_parent"
+                android:layout_height="80dp"
+
+                />
+
+            <ImageView
+                android:visibility="gone"
+                android:id="@+id/iv_qc_fujian"
+                android:layout_width="150dp"
+                android:layout_height="80dp"
+                android:layout_marginStart="30dp"
+                android:background="@drawable/tupian"
+                />
+
+            <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:text="QC检验备注"
+                android:textSize="16sp"
+                android:textColor="@color/black"
+                />
+
+            <com.uas.hystorage.view.ClearableEditText
+                android:id="@+id/cet_beizhu1"
+                android:background="@drawable/bg_line_edittext"
+                android:layout_height="40dp"
+                android:layout_width="match_parent"
+                android:layout_marginStart="30dp"
+                android:hint=""
+                android:textColor="@color/black"/>
+
+            <TextView
+                android:layout_marginTop="20dp"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:text="实验室检验附件"
+                android:textSize="16sp"
+                android:textColor="@color/black"
+                />
+
+            <android.support.v7.widget.RecyclerView
+                android:id="@+id/rv_shiyanfujian"
+                android:layout_width="match_parent"
+                android:layout_height="80dp"
+                />
+
+            <ImageView
+                android:visibility="gone"
+                android:id="@+id/iv_shiyanfujian"
+                android:layout_width="150dp"
+                android:layout_height="80dp"
+                android:layout_marginStart="30dp"
+                android:background="@drawable/tupian"
+                />
+
+            <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:text="实验室检验备注"
+                android:textSize="16sp"
+                android:textColor="@color/black"
+                />
+
+            <com.uas.hystorage.view.ClearableEditText
+                android:id="@+id/cet_beizhu2"
+                android:background="@drawable/bg_line_edittext"
+                android:layout_height="40dp"
+                android:layout_width="match_parent"
+                android:layout_marginStart="30dp"
+                android:hint=""
+                android:textColor="@color/black"/>
+
+            <TextView
+                android:id="@+id/tv_updater_info"
+                android:layout_marginTop="10dp"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:text=""
+                android:textSize="16sp"
+                android:textColor="@color/red"
+                />
+
+
+            <Button
+                android:layout_marginTop="10dp"
+                android:id="@+id/bt_gengxin"
+                android:layout_width="match_parent"
+                android:layout_margin="12dp"
+                android:layout_height="wrap_content"
+                android:textSize="16sp"
+                android:background="@drawable/selector_confirm_bg"
+                android:layout_alignParentBottom="true"
+                android:text="更新" />
+
+
+
+
+        </LinearLayout>
+
+    </android.support.v4.widget.NestedScrollView>
+
+
+</LinearLayout>

+ 40 - 0
app/src/main/res/layout/item_annex_image.xml

@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="wrap_content"
+    android:layout_height="wrap_content"
+    android:layout_margin="10dp">
+
+    <RelativeLayout
+        android:id="@+id/rl_image"
+        android:layout_width="120dp"
+        android:layout_height="80dp"
+        >
+
+        <ImageView
+            android:id="@+id/iv_fujiantu"
+            android:layout_width="match_parent"
+            android:layout_height="match_parent"
+            android:src="@drawable/tupian"
+            />
+
+        <ImageView
+            android:id="@+id/iv_cancel"
+            android:layout_width="25dp"
+            android:layout_height="25dp"
+            android:src="@drawable/ic_delete"
+            android:layout_alignParentEnd="true"
+            />
+
+    </RelativeLayout>
+
+    <ImageView
+        android:visibility="gone"
+        android:id="@+id/iv_zengjiatu"
+        android:src="@drawable/zengjiatu"
+        android:layout_width="120dp"
+        android:layout_height="80dp"
+        android:padding="12dp"
+        />
+
+</RelativeLayout>

+ 230 - 0
app/src/main/res/layout/item_sample_delivery.xml

@@ -0,0 +1,230 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content"
+    android:orientation="vertical"
+    >
+
+    <RelativeLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_marginStart="5dp"
+        android:layout_marginEnd="5dp"
+        android:layout_marginTop="10dp"
+        >
+
+        <TextView
+            android:id="@+id/tv_danhao"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="单号:"
+            android:textSize="14sp"
+            android:textColor="@color/black"
+            />
+
+        <TextView
+            android:id="@+id/tv_danhao_num"
+            android:layout_toEndOf="@+id/tv_danhao"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginStart="10dp"
+            android:text=""
+            android:textSize="14sp"
+            android:textColor="@color/black"
+            />
+
+        <TextView
+            android:id="@+id/tv_type"
+            android:layout_toStartOf="@+id/tv_type_num"
+            android:layout_marginEnd="10dp"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="类型:"
+            android:textSize="14sp"
+            android:textColor="@color/black"
+            />
+
+        <TextView
+            android:id="@+id/tv_type_num"
+            android:layout_alignParentEnd="true"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text=""
+            android:textSize="14sp"
+            android:textColor="@color/black"
+            />
+
+    </RelativeLayout>
+
+    <RelativeLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_marginStart="5dp"
+        android:layout_marginEnd="5dp"
+        >
+
+        <TextView
+            android:id="@+id/tv_jianchariqi"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="检验日期:"
+            android:textSize="14sp"
+            android:textColor="@color/black"
+            />
+
+        <TextView
+            android:id="@+id/tv_jianchariqi_num"
+            android:layout_toEndOf="@+id/tv_jianchariqi"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginStart="5dp"
+            android:text=""
+            android:textSize="14sp"
+            android:textColor="@color/black"
+            />
+
+
+        <TextView
+            android:id="@+id/tv_jianyanren"
+            android:layout_toStartOf="@+id/tv_jianyanren_num"
+            android:layout_marginEnd="10dp"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="检验人:"
+            android:textSize="14sp"
+            android:textColor="@color/black"
+            />
+
+
+        <TextView
+            android:id="@+id/tv_jianyanren_num"
+            android:layout_alignParentEnd="true"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text=""
+            android:textSize="14sp"
+            android:textColor="@color/black"
+            />
+
+    </RelativeLayout>
+
+    <RelativeLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_marginStart="5dp"
+        android:layout_marginEnd="5dp"
+        >
+
+        <TextView
+            android:id="@+id/tv_gangweiziyuan"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="岗位资源:"
+            android:textSize="14sp"
+            android:textColor="@color/black"
+            />
+
+        <TextView
+            android:id="@+id/tv_gangweiziyuan_num"
+            android:layout_toEndOf="@+id/tv_gangweiziyuan"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginStart="10dp"
+            android:text="编号(名称)"
+            android:textSize="14sp"
+            android:textColor="@color/black"
+            />
+
+    </RelativeLayout>
+
+    <RelativeLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_marginStart="5dp"
+        android:layout_marginEnd="5dp"
+        >
+
+        <TextView
+            android:id="@+id/tv_jitai"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="机台:"
+            android:textSize="14sp"
+            android:textColor="@color/black"
+            />
+
+        <TextView
+            android:id="@+id/tv_jitai_num"
+            android:layout_toEndOf="@+id/tv_jitai"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginStart="10dp"
+            android:text=""
+            android:textSize="14sp"
+            android:textColor="@color/black"
+            />
+
+
+        <TextView
+            android:id="@+id/tv_xiangmuhao"
+            android:layout_toStartOf="@+id/tv_xiangmuhao_num"
+            android:layout_marginEnd="10dp"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="项目号:"
+            android:textSize="14sp"
+            android:textColor="@color/black"
+            />
+
+
+        <TextView
+            android:id="@+id/tv_xiangmuhao_num"
+            android:layout_alignParentEnd="true"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text=""
+            android:textSize="14sp"
+            android:textColor="@color/black"
+            />
+
+    </RelativeLayout>
+
+    <RelativeLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_marginStart="5dp"
+        android:layout_marginEnd="5dp"
+        >
+
+        <TextView
+            android:id="@+id/tv_gongdanhao"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="工单号:"
+            android:textSize="14sp"
+            android:textColor="@color/black"
+            />
+
+        <TextView
+            android:id="@+id/tv_gongdanhao_num"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginStart="10dp"
+            android:layout_toEndOf="@+id/tv_gongdanhao"
+            android:text=""
+            android:textColor="@color/black"
+            android:textSize="14sp" />
+
+    </RelativeLayout>
+
+    <View
+        android:layout_width="match_parent"
+        android:layout_height="1dp"
+        android:layout_marginTop="10dp"
+        android:background="@color/black"
+        android:layout_marginStart="1dp"
+        android:layout_marginEnd="1dp"
+        />
+
+</LinearLayout>

+ 39 - 0
app/src/main/res/layout/view_head.xml

@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:tools="http://schemas.android.com/tools"
+    style="@style/ActionBar">
+
+    <Button
+        android:id="@+id/bt_return"
+        style="@style/ActionBarLeftButton" />
+
+    <TextView
+        android:id="@+id/tv_title"
+        style="@style/ActionBarTextView"
+        tools:text=""/>
+
+    <ImageView
+        android:id="@+id/iv_icon"
+        android:layout_alignParentEnd="true"
+        android:layout_centerVertical="true"
+        android:layout_width="25dp"
+        android:layout_height="25dp"
+        android:layout_gravity="center_vertical"
+        android:layout_marginEnd="15dp"
+        />
+
+    <TextView
+        android:visibility="gone"
+        android:id="@+id/tv_type"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:textColor="@color/black"
+        android:layout_alignParentEnd="true"
+        android:text=""
+        android:textSize="16sp"
+        android:layout_centerVertical="true"
+        android:layout_marginEnd="15dp"
+        />
+
+
+</RelativeLayout>

+ 1 - 0
app/src/main/res/values/strings.xml

@@ -435,5 +435,6 @@
     </string-array>
     <!--hi-->
 
+    <string name="inspect_and_send_samples">检验送样</string>
 
 </resources>

+ 6 - 2
build.gradle

@@ -3,6 +3,10 @@
 buildscript {
 //    ext.kotlin_version = '1.2.30'
     repositories {
+        maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
+        maven { url 'http://maven.aliyun.com/nexus/content/repositories/jcenter' }
+        maven { url 'http://maven.aliyun.com/nexus/content/repositories/google' }
+        maven { url 'http://maven.aliyun.com/nexus/content/repositories/gradle-plugin' }
         maven { url "https://jitpack.io" }
         mavenCentral()
         google()
@@ -54,8 +58,8 @@ ext {
             targetSdkVersion : 28,
             compileSdkVersion: 28,
             buildToolsVersion: "28.0.3",
-            versionCode      : 33,
-            versionName      : "v1.2.3"
+            versionCode      : 34,
+            versionName      : "v1.2.4"
     ]
 
     depsVersion = [

+ 1 - 1
pda_libs/pulltoreflashlibrary/build/intermediates/incremental/packageDebugResources/compile-file-map.properties

@@ -1,4 +1,4 @@
-#Tue Sep 03 17:33:16 CST 2024
+#Fri Sep 13 11:46:54 CST 2024
 D\:\\GongSi\\AS_XiangMu\\hyuas-mes\\hyuas-mes\\pda_libs\\pulltoreflashlibrary\\src\\main\\res\\drawable-mdpi\\indicator_arrow.png=D\:\\GongSi\\AS_XiangMu\\hyuas-mes\\hyuas-mes\\pda_libs\\pulltoreflashlibrary\\build\\intermediates\\packaged_res\\debug\\drawable-mdpi-v4\\indicator_arrow.png
 D\:\\GongSi\\AS_XiangMu\\hyuas-mes\\hyuas-mes\\pda_libs\\pulltoreflashlibrary\\src\\main\\res\\drawable-mdpi\\default_ptr_flip.png=D\:\\GongSi\\AS_XiangMu\\hyuas-mes\\hyuas-mes\\pda_libs\\pulltoreflashlibrary\\build\\intermediates\\packaged_res\\debug\\drawable-mdpi-v4\\default_ptr_flip.png
 D\:\\GongSi\\AS_XiangMu\\hyuas-mes\\hyuas-mes\\pda_libs\\pulltoreflashlibrary\\src\\main\\res\\anim\\slide_out_to_bottom.xml=D\:\\GongSi\\AS_XiangMu\\hyuas-mes\\hyuas-mes\\pda_libs\\pulltoreflashlibrary\\build\\intermediates\\packaged_res\\debug\\anim\\slide_out_to_bottom.xml