소스 검색

增加分拣功能

guilin 1 년 전
부모
커밋
bcb8d885de

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

@@ -286,6 +286,11 @@
             android:windowSoftInputMode="stateHidden|adjustPan"
             android:screenOrientation="portrait"
             tools:ignore="LockedOrientationActivity"/>
+        <activity
+            android:name=".putIn.SortationMainActivity"
+            android:windowSoftInputMode="stateHidden|adjustPan"
+            android:screenOrientation="portrait"
+            tools:ignore="LockedOrientationActivity"/>
     </application>
 
 

+ 6 - 2
app/src/main/java/com/fxy/main/fragment/HomePagerFragment.java

@@ -16,6 +16,7 @@ import android.widget.LinearLayout;
 
 import com.fxy.common.VersionUpgrades;
 import com.elvishew.xlog.XLog;
+import com.fxy.putIn.SortationMainActivity;
 import com.fxy.putIn.TallyMainActivity;
 import com.fxy.putIn.TrayMainActivity;
 import com.fxy.putOut.DeliveryGoodsMainActivity;
@@ -127,7 +128,8 @@ public class HomePagerFragment extends BaseFragment implements View.OnClickListe
      * 绑定事件
      * @param v
      */
-    @OnClick({R.id.search_view, R.id.ima_or_code,R.id.ivt_tally,R.id.ivt_cargo_storage,R.id.ivt_tray,R.id.ivt_quality,R.id.ivt_order_tool})
+    @OnClick({R.id.search_view, R.id.ima_or_code,R.id.ivt_tally,R.id.ivt_cargo_storage,R.id.ivt_tray,
+            R.id.ivt_quality,R.id.ivt_order_tool,R.id.ivt_sortation})
     public void onClick(View v) {
         Bundle bundle = new Bundle();
         switch (v.getId()) {
@@ -150,7 +152,9 @@ public class HomePagerFragment extends BaseFragment implements View.OnClickListe
             case R.id.ivt_order_tool:
                 intent2Page(getActivity(), OrderToolMainActivity.class, false,bundle);;
                 break;
-
+            case R.id.ivt_sortation:
+                intent2Page(getActivity(), SortationMainActivity.class, false,bundle);;
+                break;
             default:
                 showToast("还没有配置点击事件");
                 break;

+ 5 - 0
app/src/main/java/com/fxy/net/Urls.java

@@ -119,6 +119,11 @@ public class Urls {
     //添加扫码结果
     public static final String FXY_ADD_SCAN_RESULT = "/pda/tool/scanLog";
 
+    //入库分拣
+    public static final String FXY_GROUP_PCS = "/pda/inbound/groupPcs";
+
+
+
     /*返修易 -- end*/
 
 

+ 708 - 0
app/src/main/java/com/fxy/putIn/SortationMainActivity.java

@@ -0,0 +1,708 @@
+package com.fxy.putIn;
+
+import android.annotation.SuppressLint;
+import android.app.AlertDialog;
+import android.app.Dialog;
+import android.content.BroadcastReceiver;
+import android.content.Context;
+import android.content.DialogInterface;
+import android.content.Intent;
+import android.content.IntentFilter;
+import android.os.Build;
+import android.os.Bundle;
+import android.os.Handler;
+import android.os.Message;
+import android.support.v7.widget.LinearLayoutManager;
+import android.support.v7.widget.RecyclerView;
+import android.text.Editable;
+import android.text.TextWatcher;
+import android.view.KeyEvent;
+import android.view.View;
+import android.view.ViewGroup;
+import android.view.inputmethod.EditorInfo;
+import android.widget.CheckBox;
+import android.widget.CompoundButton;
+import android.widget.EditText;
+import android.widget.ImageButton;
+import android.widget.ImageView;
+import android.widget.LinearLayout;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import androidx.annotation.RequiresApi;
+
+import com.chad.library.adapter.base.BaseQuickAdapter;
+import com.chad.library.adapter.base.BaseViewHolder;
+import com.elvishew.xlog.XLog;
+import com.fxy.R;
+import com.fxy.baselibrary.base.BaseActivity;
+import com.fxy.baselibrary.bean.BaseEventBusBean;
+import com.fxy.baselibrary.interfaces.OnRxScanerListener;
+import com.fxy.baselibrary.qrcode.ActivityScanerCode;
+import com.fxy.baselibrary.util.JsonUtil;
+import com.fxy.baselibrary.views.MarqueeTextView;
+import com.fxy.bean.ActionBean;
+import com.fxy.bean.ScanBean;
+import com.fxy.common.PictureSelectorUpload;
+import com.fxy.constant.BaseConfig;
+import com.fxy.constant.EventCode;
+import com.fxy.net.MyDialogCallback;
+import com.fxy.net.Urls;
+import com.fxy.view.FloatingImageView;
+import com.google.zxing.Result;
+import com.luck.picture.lib.config.PictureConfig;
+import com.lzy.okgo.OkGo;
+import com.lzy.okgo.model.Response;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import butterknife.BindView;
+import butterknife.ButterKnife;
+import butterknife.OnClick;
+import butterknife.Unbinder;
+import sto.android.app.StoJNI;
+import sto.android.app.StoPdaKeyEvent;
+import sto.android.app.StoTongJNI;
+
+public class SortationMainActivity extends  BaseActivity implements StoJNI.ScanCallBack {
+    /**
+     * 列表适配器
+     */
+    Context mContext = this;
+
+    //单号清除
+    @BindView(R.id.ib_order_no_clear)
+    ImageButton ibOrderNoClear;
+
+    //单号
+    @BindView(R.id.et_order_no)
+    EditText etOrderNo;
+
+    @BindView(R.id.mt_recent_scan)
+    MarqueeTextView mtRecentScan;
+
+    @BindView(R.id.mt_send_way)
+    MarqueeTextView mtSendWay;
+
+
+
+
+
+    //浮动按钮
+    @BindView(R.id.iv_drag)
+    FloatingImageView iv_drag;
+
+
+
+    @BindView(R.id.rv_show_img)
+    RecyclerView rvShowImg;
+
+
+    @BindView(R.id.ll_pictures_box)
+    LinearLayout llPicturesBox;
+
+    @BindView(R.id.cb_is_hold)
+    CheckBox cbIsHold;
+
+
+    //扫码扫码动作
+    private ScanBean scanBean;
+
+
+    private Unbinder unbinder;
+
+
+    //图片列表
+    private ArrayList photoList =new ArrayList<>();
+
+    private PictureSelectorUpload pictureSelectorUpload;
+
+    //这个表示需要调拍照功能
+    private boolean needPictures;
+
+    //订单转扣件
+    private int isHold=0;
+
+
+
+    @Override
+    public int getContentViewResId() {
+        return R.layout.activity_fxy_sortation;
+    }
+
+    @Override
+    public boolean showToolBar() {
+        return true;
+    }
+
+    @Override
+    public boolean openEventBus() {
+        return true;
+    }
+
+    @Override
+    protected void getBundleExtras(Bundle bundle) {
+
+    }
+    //finish的返回监听
+    //这里的requestCode参数,就是上面设置的 1 ,当跳转的页面返回的时候,通过这个加以判断
+    //resultCode ,这个参数是在跳转的页面里面规定的,它也是一个int类型的标志
+    //第三个参数包含了返回的值
+    //如果不需要所跳转的页面返回值,也就不需要这个方法了
+    @Override
+    public void onActivityResult(int requestCode, int resultCode, Intent data) {
+        super.onActivityResult(requestCode, resultCode, data);
+//        XLog.e("requestCode:"+requestCode);
+//        XLog.e("resultCode:"+resultCode);
+        if (requestCode == 200 && resultCode == 200)//之前提到的两个标志,在这里显示出了作用
+        {
+        }else if (resultCode==0){
+        }
+
+        if (resultCode == RESULT_OK) {
+            if (requestCode == PictureConfig.CHOOSE_REQUEST) {// 图片选择结果回调
+                pictureSelectorUpload.getSelectImg(data);
+            }
+        }
+    }
+
+
+    /**
+     * EventBus接收信息的方法,开启后才会调用(非粘性事件)
+     *
+     * @param event
+     */
+    @Override
+    protected void EventBean(BaseEventBusBean event) {
+//        XLog.e("----------接收返回--------------");
+//        XLog.e("接收返回:"+event.getEventCode());
+        if (event != null && event.getEventCode() == EventCode.displacement_refresh){
+
+        }
+    }
+
+    @Override
+    public boolean isPlayMusic() {
+        return true;
+    }
+
+    @Override
+    protected void initView() {
+        unbinder = ButterKnife.bind(this);
+        setTitleName("入库分拣");
+
+        initData();
+        initEdit();
+        //监听浮动按钮
+        iv_drag.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                if(!iv_drag.isDrag()){
+                    ActivityScanerCode.setScanerListener(mScanerListener);
+                    ActivityScanerCode.intent2Activity(mContext, BaseConfig.COMMON_SCANNER_ONLY);
+                }
+            }
+        });
+
+        initUpload();
+
+
+    }
+
+
+    private void initUpload(){
+        pictureSelectorUpload = new PictureSelectorUpload(SortationMainActivity.this,rvShowImg,"sortation",1);
+        pictureSelectorUpload.setCompress(true,100,500);
+        pictureSelectorUpload.setOnChangeListener(new PictureSelectorUpload.UploadChangeListener() {
+            @Override
+            public void uploadResult(boolean State,String actionType) {
+                if (State) {
+                    System.out.println("文件上传回调成功");
+                    doPutIn();
+                } else {
+                    System.out.println("文件上传失败");
+                }
+            }
+
+            @Override
+            public void uploadActionType(String actionType) {
+
+            }
+        });
+    }
+
+
+    private void initData(){
+    }
+
+
+
+
+
+
+    @Override
+    public boolean dispatchKeyEvent(KeyEvent event) {
+        //XLog.e("Action:"+event.getAction()+"---event:"+event.getKeyCode());
+        if ((event.getKeyCode()==KeyEvent.KEYCODE_DPAD_CENTER )  && event.getAction() == KeyEvent.ACTION_DOWN){
+            if(validate()){
+                doPutIn();
+            }
+            return true;
+        }
+        return super.dispatchKeyEvent(event);
+    }
+
+    //监听按键
+    public boolean onKeyDown(int keyCode, KeyEvent event) {
+        //XLog.e("监听按键:"+keyCode);XLog.e(event);
+        if (scanBean.getIsBroadcast()==0 && StoTongJNI.getIns(mContext).getEventFuction(keyCode)  == StoPdaKeyEvent.KEYCODE_SCAN
+                && event.getRepeatCount() == 0) {
+
+            if (StoTongJNI.getIns(mContext).GetScannerIsScanning()) {
+//
+            } else {
+                StoTongJNI.getIns(mContext).SetScannerStart();
+            }
+        }
+        return super.onKeyDown(keyCode, event);
+    }
+
+    @SuppressLint("HandlerLeak")
+    Handler scanHandler = new Handler() {
+
+        @Override
+        public void handleMessage(Message msg) {
+            // TODO Auto-generated method stub
+            if (msg.obj != null) {
+
+                String scanResult = msg.obj.toString().trim();
+                if (!scanResult.isEmpty()){
+                    setScanResult(scanResult);
+                }
+            }
+
+        }
+
+    };
+    @Override
+    public void onScanResults(String str) {
+        Message msg = new Message();
+        msg.obj = str;
+        scanHandler.sendMessage(msg);
+
+
+    }
+
+
+    @Override
+    public void onScanResults(String str, int type) {
+
+    }
+    /**
+     * 定义广播接受
+     */
+    BroadcastReceiver mReceiver = new BroadcastReceiver() {
+        @Override
+        public void onReceive(Context context, Intent intent) {
+            String scanResult = intent.getStringExtra(scanBean.getDataName());
+            if (scanResult==null){return; }
+            String scanStatus = "";
+            if (!scanBean.getStatusName().isEmpty()){
+                scanStatus = intent.getStringExtra(scanBean.getStatusName());
+            }else{
+                scanStatus = scanResult.isEmpty()? "" : "ok"; //有值 默认是扫码成功;
+            }
+
+            //新大陆(MT65,MT90) 需要手动关闭
+            if (!scanBean.getActionStop().isEmpty()){
+                Intent stopIntent = new Intent(scanBean.getActionStop());
+                mContext.sendBroadcast(stopIntent);
+            }
+
+            if ("ok".equals(scanStatus)){
+                setScanResult(scanResult);
+            }else{
+                showErrorToast(getString(R.string.scan_failed));
+            }
+        }
+    };
+
+    /**
+     * 注册广播
+     */
+    private void initReceiver(){
+
+        try {
+
+            String scanStr = getScanSetting();
+            scanBean = JsonUtil.getObject(scanStr, ScanBean.class);
+            Integer is_broadcast = scanBean.getIsBroadcast();//是否广播
+
+            if (is_broadcast ==1){
+                IntentFilter mFilter = new IntentFilter(scanBean.getAction());
+                this.registerReceiver(mReceiver, mFilter);
+            }else{
+                //不广播进行处理 jni模式
+                String pdaBrand = StoTongJNI.getmPdaBrand();
+                if (!pdaBrand.isEmpty()){
+                    StoTongJNI.getIns(this).setmScanCB(this);
+                    StoTongJNI.getIns(this).SetScannerOn();
+                }
+            }
+
+
+        }catch (Exception e) {
+            showErrorToast("获取扫码配置失败"+e.getMessage());
+            XLog.e("获取扫码配置失败:" + e.getMessage());
+        }
+    }
+
+
+    //统一按钮回调
+    public void callbackEditor(View v){
+        switch (v.getId()) {
+            case R.id.et_order_no:
+                firstPutIn();
+                break;
+            default:
+        }
+    }
+
+
+    /**
+     * 复选框选中与不选中的事件
+     */
+    public void onCheckedChanged(CompoundButton checkBox, boolean checked) {
+        // TODO Auto-generated method stub
+        switch (checkBox.getId()) {
+            case R.id.cb_is_hold:
+                if (checked) {// 选中吃
+                    isHold = 0;
+                } else {
+                    isHold = 1;
+                }
+                break;
+            default:
+                break;
+        }
+    }
+
+
+    private void initEdit() {
+        List<EditText> list = new ArrayList<>();
+        list.add(etOrderNo);
+        unifyEdit(list);
+    }
+
+    private OnRxScanerListener mScanerListener = new OnRxScanerListener() {
+        @Override
+        public void onSuccess(String type, Result result) {
+            String scanResult = result.getText();
+            switch (type){
+                case BaseConfig.COMMON_SCANNER_ONLY:
+                    setScanResult(scanResult);
+
+                    break;
+            }
+        }
+        @Override
+        public void onFail(String type, String message) {
+
+        }
+    };
+
+    //把扫描结果赋值
+    private void setScanResult(String scanResult){
+        //获取焦点的view对象
+        View view=getWindow().getDecorView().findFocus();
+        //如果是EditText
+        if(view instanceof EditText)
+        {
+            ((EditText) view).setText(scanResult);
+            //执行回调
+            callbackEditor(view);
+        }
+    }
+
+    public void firstPutIn(){
+        if(!checkNull(etOrderNo)){
+            setEditTextFocused(etOrderNo,true);
+            showWarningToast(etOrderNo.getHint().toString());
+            return;
+        }
+        submitData();
+    }
+
+
+    public void doPutIn() {
+        //校验数据
+        if (!validate()){
+            return;
+        }
+        submitData();
+    }
+
+    /**
+     * 提交数据
+     */
+    private void submitData(){
+        try {
+            String tracking_number = etOrderNo.getText().toString().trim();
+            JSONObject param = new JSONObject();
+            param.put("tracking_number",tracking_number);
+
+            if (photoList.size()>0){
+                param.put("label_img",photoList.get(0));
+            }
+            if (isHold>0){
+                param.put("is_hold",isHold);
+            }
+
+            if (!checkRepeat(Urls.FXY_GROUP_PCS+(param.toString()))){return;}
+
+            OkGo.<String>post(Urls.getServiceAddress(this) + Urls.FXY_GROUP_PCS)
+                    .upJson(param)
+                    .execute(new MyDialogCallback(this, true, true) {
+                        @Override
+                        public void onSuccess(Response<String> response) {
+                            super.onSuccess(response);
+                            try {
+                                ActionBean bean = JsonUtil.getObject(response.body(), ActionBean.class);
+                                JSONObject result = new JSONObject();
+                                if (bean.data!=null && !bean.data.isEmpty() && !bean.data.equals("[]")){
+                                    result = new JSONObject(bean.data);
+                                }
+
+                                String voiceName = result.has("voice_name") ? result.getString("voice_name"):"";
+                                setPageViewData(result);
+                                if(bean.code == 1){
+                                    showSuccessToast(bean.msg,voiceName);
+                                    llPicturesBox.setVisibility(View.GONE);
+                                    clearData(false);
+                                }else{
+
+                                    showWarningToast(bean.msg,voiceName);
+                                    if (result.has("deal_tracking_number")){
+                                        etOrderNo.setText(result.getString("deal_tracking_number"));
+                                    }
+
+                                    if (result.has("tag") && result.getString("tag").equals("need_customer")){
+                                        pictureSelectorUpload.emptyRemake();
+                                        photoList.clear();
+                                        needPictures = true;
+                                        llPicturesBox.setVisibility(View.VISIBLE);
+                                        pictureSelectorUpload.authCamera();
+
+                                    }
+
+                                }
+                            } catch (Exception e) {
+                                e.printStackTrace();
+                                XLog.e("请求入库返回错误",e.getMessage());
+                            }
+                        }
+                    });
+        } catch (JSONException e) {
+            showEmptyView("请求入库失败:"+e.getMessage());
+            e.printStackTrace();
+        }
+    }
+
+    /*
+     * 校验必录
+     */
+    private boolean validate(){
+        if(!checkNull(etOrderNo)){
+            setEditTextFocused(etOrderNo,true);
+            showWarningToast(etOrderNo.getHint().toString());
+            return false;
+        }
+        if (needPictures){
+            photoList = pictureSelectorUpload.getPhotoList();
+            if (photoList.size()==0){
+                showWarningToast("请拍照");
+                return false;
+            }
+        }
+
+        return true;
+    }
+
+
+    private void setPageViewData(JSONObject jsonObject){
+        try {
+            String ot_type = "";
+            String recent_scan = "";
+
+            if (jsonObject.has("ot_type")){
+                ot_type = jsonObject.getString("ot_type");
+            }
+
+            if (jsonObject.has("deal_tracking_number")){
+                recent_scan = jsonObject.getString("deal_tracking_number");
+            }
+
+
+            mtSendWay.setText(ot_type);
+            mtRecentScan.setText(recent_scan);
+
+        }catch (JSONException e) {
+            XLog.e("获取理货缓存数据错误",e);
+            e.printStackTrace();
+        }
+    }
+    //清除订单信息
+    private void clearData(boolean isAll) {
+        etOrderNo.setText("");
+        needPictures = false;
+        isHold = 0;
+        setEditTextNormal(etOrderNo,true);
+        pictureSelectorUpload.emptyRemake();//清空图片
+        cbIsHold.setChecked(false);
+        photoList.clear();
+    }
+
+    @OnClick({})
+    public void onViewClicked(View view) {
+        Bundle bundle = new Bundle();
+        switch (view.getId()) {
+            default:
+                break;
+        }
+    }
+
+    /**
+     * 统一设置Edit监听
+     * @param  list
+     */
+    public void unifyEdit(List<EditText> list){
+        for (int i=0;i<list.size();i++){
+            EditText editText = list.get(i);
+
+            LinearLayout linearLayout = (LinearLayout)editText.getParent();
+            ImageButton imageButton = getChildImageButton(linearLayout);
+
+            //监听扫描
+            ImageView imageView = linearLayout.findViewById(R.id.ima_or_code);
+            imageView.setOnClickListener(new View.OnClickListener() {
+                @Override
+                public void onClick(View v) {
+                    LinearLayout linearLayout = (LinearLayout)v.getParent();
+                    for( int i = 0; i < linearLayout.getChildCount(); i++ ){
+                        if( linearLayout.getChildAt(i) instanceof EditText ){
+                            ((EditText)linearLayout.getChildAt(i)).requestFocus();
+                            break;
+                        }
+                    }
+                    ActivityScanerCode.setScanerListener(mScanerListener);
+                    ActivityScanerCode.intent2Activity(mContext, BaseConfig.COMMON_SCANNER_ONLY);
+                }
+            });
+
+
+            //监听按确定
+            editText.setOnEditorActionListener(new TextView.OnEditorActionListener() {
+                @Override
+                public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
+                    //XLog.e("actionId:"+actionId);
+                    if (actionId == EditorInfo.IME_ACTION_SEND || actionId == EditorInfo.IME_ACTION_DONE   ) {
+                        if (v.getText().toString().trim().isEmpty()) {
+                            setEditTextFocused(v,true);
+                            showWarningToast(v.getHint().toString());
+                            return false;
+                        }else{
+                            setEditTextNormal(v,true);
+                        }
+
+                        callbackEditor(v);
+
+                        return false;
+                    }
+                    return false;
+                }
+            });
+            editText.addTextChangedListener(new TextWatcher() {
+                public void onTextChanged(CharSequence s, int start, int before, int count) {
+                    EditText currentEditText = null;
+                    ImageButton currentImage = null;
+                    //获取焦点的view对象
+                    View view=getWindow().getDecorView().findFocus();
+                    //如果是EditText
+                    if(view instanceof EditText){
+                        currentEditText = (EditText) view;
+                        currentImage = getChildImageButton((LinearLayout)currentEditText.getParent());
+                    }
+
+                    if (s.length() > 0  ) {
+
+                        if (currentImage !=null ){
+                            currentImage.setVisibility(View.VISIBLE);
+                        }
+                        if (currentEditText!=null){
+                            setEditTextNormal(currentEditText,true);
+                        }
+
+                    } else {
+                        if (currentImage !=null ){
+                            currentImage.setVisibility(View.INVISIBLE);
+                        }
+                        if (currentEditText!=null){
+                            setEditTextFocused(currentEditText,true);
+                        }
+                    }
+                }
+
+                public void beforeTextChanged(CharSequence s, int start, int count, int after) {
+                }
+
+                public void afterTextChanged(Editable s) {
+
+                }
+            });
+
+            if (imageButton !=null ){
+                unifyClearEdit(imageButton);
+            }
+        }
+    }
+
+
+    @Override
+    protected void onDestroy() {
+        unbinder.unbind();
+        if (pictureSelectorUpload!=null){
+            pictureSelectorUpload.removeHandler();
+        }
+
+
+        super.onDestroy();
+    }
+    @Override
+    protected void onResume() {
+        super.onResume();
+        initReceiver();
+    }
+    @Override
+    protected void onPause() {
+        super.onPause();
+        //销毁在onResume()方法中的广播
+        try {
+            //停止扫描
+            Integer is_broadcast = scanBean.getIsBroadcast();//是否广播
+            if (is_broadcast==0){
+                StoTongJNI.getIns(mContext).SetScannerStop();
+                StoTongJNI.getIns(mContext).SetScannerOff();
+            }else{
+                unregisterReceiver(mReceiver);
+            }
+        }catch (Exception e){
+            XLog.e("销毁广播失败:",e.getMessage());
+        }
+    }
+
+
+}

+ 6 - 29
app/src/main/java/com/fxy/putIn/TallyMainActivity.java

@@ -255,7 +255,7 @@ public class TallyMainActivity extends  BaseActivity implements StoJNI.ScanCallB
     @Override
     protected void initView() {
         unbinder = ButterKnife.bind(this);
-        setTitleName("快速入库");
+        setTitleName("打板操作");
 
         initAdapter();
         initData();
@@ -703,34 +703,11 @@ public class TallyMainActivity extends  BaseActivity implements StoJNI.ScanCallB
                                     }
 
                                     if (result.has("tag") && result.getString("tag").equals("need_customer")){
-
-//                                        commonDialog.setTitle("客户编号","请输入客户编号")
-//                                                .setTypeCode("need_customer")
-//                                                .setContent("")
-//                                                .show();
-//                                        llCustomerCode.setVisibility(View.VISIBLE);
-                                        new AlertDialog.Builder(mContext)
-                                                .setTitle(R.string.dl_hint)
-                                                .setMessage(bean.msg)
-                                                .setNegativeButton(R.string.str_submit, new DialogInterface.OnClickListener() {
-                                                    @RequiresApi(api = Build.VERSION_CODES.KITKAT)
-                                                    @Override
-                                                    public void onClick(DialogInterface dialogInterface, int i) {
-                                                        pictureSelectorUpload.emptyRemake();
-                                                        photoList.clear();
-                                                        needCustomer = true;
-                                                        llPicturesBox.setVisibility(View.VISIBLE);
-                                                        pictureSelectorUpload.authCamera();
-
-                                                    }
-                                                }).setPositiveButton(R.string.str_cancel, new DialogInterface.OnClickListener() {
-                                            @Override
-                                            public void onClick(DialogInterface dialogInterface, int i) {
-                                                //取消不做操作
-
-                                            }
-                                        }).show();
-
+                                        pictureSelectorUpload.emptyRemake();
+                                        photoList.clear();
+                                        needCustomer = true;
+                                        llPicturesBox.setVisibility(View.VISIBLE);
+                                        pictureSelectorUpload.authCamera();
 
                                     }else if (result.has("is_change") && result.getInt("is_change")==1){
                                         new AlertDialog.Builder(mContext)

+ 202 - 0
app/src/main/res/layout/activity_fxy_sortation.xml

@@ -0,0 +1,202 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    android:background="@color/md_grey_100"
+    android:orientation="vertical">
+
+    <ScrollView
+        android:id="@+id/ll_scroll_view"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:scrollbars="none">
+
+        <LinearLayout
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:orientation="vertical">
+            <View
+                android:layout_width="match_parent"
+                android:layout_height="4dp"
+                android:background="@color/md_grey_100" />
+
+
+
+            <LinearLayout
+                style="@style/FromLinearLayoutItem"
+                android:orientation="horizontal">
+                <EditText
+                    style="@style/EditTextStyle"
+                    android:id="@+id/et_order_no"
+                    android:hint="@string/hint_please_scan_no"
+                    android:text=""/>
+                <ImageButton
+                    style="@style/ClearImg"
+                    android:id="@+id/ib_order_no_clear"
+                    />
+
+                <include   layout="@layout/item_image_code" />
+            </LinearLayout>
+
+            <View
+                android:layout_width="match_parent"
+                android:layout_height="4dp"
+                android:background="@color/md_grey_100" />
+            <LinearLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="@dimen/dp_10"
+                android:layout_marginRight="@dimen/dp_10"
+                android:layout_marginTop="5dp"
+                android:layout_marginBottom="5dp"
+                android:gravity="center_vertical"
+                android:orientation="horizontal"
+                android:visibility="gone"
+                >
+                <CheckBox
+                    android:id="@+id/cb_is_hold"
+                    android:layout_width="wrap_content"
+                    android:layout_height="match_parent"
+                    android:background="@null"/>
+                <TextView
+                    style="@style/tvLeftStyle"
+                    android:layout_marginLeft="5dp"
+                    android:text="订单转扣件" />
+            </LinearLayout>
+
+
+            <LinearLayout
+                android:id="@+id/ll_pictures_box"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:visibility="gone"
+                android:orientation="vertical">
+                <include layout="@layout/fragment_show_img"/>
+                <View
+                    android:layout_width="match_parent"
+                    android:layout_height="1dp"
+                    android:background="@color/md_grey_100" />
+                <LinearLayout
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_marginLeft="@dimen/dp_10"
+                    android:layout_marginTop="@dimen/dp_10"
+                    android:layout_marginRight="@dimen/dp_10"
+                    android:layout_marginBottom="@dimen/dp_4"
+                    android:background="@drawable/bg_white_et"
+                    android:gravity="center_vertical"
+                    android:orientation="horizontal"
+                    android:padding="10dp">
+                    <TextView
+                        style="@style/fontSize"
+                        android:id="@+id/add_tally"
+                        android:layout_width="match_parent"
+                        android:layout_height="wrap_content"
+                        android:layout_marginLeft="@dimen/dp_10"
+                        android:layout_marginRight="@dimen/dp_10"
+                        android:background="@drawable/bg_orange_item"
+                        android:gravity="center"
+                        android:text="确定提交"
+                        android:padding="10dp"
+                        android:textColor="@color/white"
+                        android:visibility="visible" />
+                </LinearLayout>
+
+            </LinearLayout>
+
+
+
+
+            <View
+                android:layout_width="match_parent"
+                android:layout_height="1dp"
+                android:background="@color/md_grey_100" />
+
+
+            <LinearLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="@dimen/dp_10"
+                android:layout_marginRight="@dimen/dp_10"
+                android:layout_marginTop="@dimen/dp_10"
+                android:background="@drawable/bg_white_et"
+                android:gravity="center_vertical"
+                android:orientation="vertical"
+                android:paddingLeft="10dp"
+                android:paddingRight="10dp">
+
+
+
+
+
+
+                <LinearLayout
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:paddingBottom="5dp"
+                    android:paddingTop="5dp"
+                    android:orientation="horizontal">
+
+                    <TextView
+                        style="@style/tvLeftStyle"
+                        android:text="货物类型" />
+                    <TextView
+                        style="@style/tvLeftStyle"
+                        android:text=":" />
+
+                    <com.fxy.baselibrary.views.MarqueeTextView
+                        style="@style/mtRightStyle"
+                        android:id="@+id/mt_send_way"
+                        />
+
+                </LinearLayout>
+
+                <LinearLayout
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:paddingBottom="5dp"
+                    android:paddingTop="5dp"
+                    android:orientation="horizontal">
+
+                    <TextView
+                        style="@style/tvLeftStyle"
+                        android:text="最近扫描" />
+                    <TextView
+                        style="@style/tvLeftStyle"
+                        android:text=":" />
+
+                    <com.fxy.baselibrary.views.MarqueeTextView
+                        style="@style/mtRightStyle"
+                        android:id="@+id/mt_recent_scan"
+                        />
+                </LinearLayout>
+            </LinearLayout>
+
+            <LinearLayout
+                android:layout_width="fill_parent"
+                android:layout_height="wrap_content"
+                android:background="@drawable/bg_white_et"
+                android:layout_marginLeft="@dimen/dp_10"
+                android:layout_marginRight="@dimen/dp_10"
+                android:gravity="center_vertical"
+                android:orientation="horizontal"
+                android:scrollbars="vertical"
+                android:paddingTop="@dimen/dp_10"
+                android:paddingBottom="@dimen/dp_10"
+                >
+                <android.support.v7.widget.RecyclerView
+                    android:id="@+id/recyclerview"
+                    android:layout_width="match_parent"
+                    android:layout_height="match_parent"
+                    android:background="#fff"
+                    android:overScrollMode="never"/>
+            </LinearLayout>
+
+        </LinearLayout>
+    </ScrollView>
+
+
+    <include layout="@layout/item_float_image" />
+</LinearLayout>

+ 18 - 3
app/src/main/res/layout/fragment_homepager.xml

@@ -96,14 +96,26 @@
                     android:layout_height="wrap_content"
                     android:layout_marginTop="@dimen/t12"
                     android:weightSum="2">
-
+                    <TextView
+                        style="@style/ImageViewWithTextStyle.FontSize"
+                        android:id="@+id/ivt_sortation"
+                        android:drawableTop="@drawable/ic_mapan"
+                        android:drawablePadding="5dp"
+                        android:text="入库分拣" />
 
                     <TextView
                         style="@style/ImageViewWithTextStyle.FontSize"
                         android:id="@+id/ivt_tally"
                         android:drawableTop="@drawable/ic_mapan"
                         android:drawablePadding="5dp"
-                        android:text="快速入库" />
+                        android:text="打板操作" />
+
+                </TableRow>
+                <TableRow
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_marginTop="@dimen/t12"
+                    android:weightSum="2">
                     <TextView
                         style="@style/ImageViewWithTextStyle.FontSize"
                         android:id="@+id/ivt_tray"
@@ -111,8 +123,9 @@
                         android:drawablePadding="5dp"
                         android:text="托盘入库" />
 
-
                 </TableRow>
+
+
             </LinearLayout>
 
 
@@ -156,6 +169,8 @@
                         android:text="@string/str_cargo_storage" />
 
 
+
+
                 </TableRow>
             </LinearLayout>
 

+ 38 - 3
baselibrary/src/main/java/com/fxy/baselibrary/base/BaseActivity.java

@@ -35,6 +35,7 @@ import android.widget.TextView;
 import android.widget.Toast;
 
 import com.elvishew.xlog.XLog;
+import com.fxy.baselibrary.util.RxTool;
 import com.jaeger.library.StatusBarUtil;
 import com.fxy.baselibrary.R;
 import com.fxy.baselibrary.bean.BaseEventBusBean;
@@ -60,6 +61,8 @@ import org.json.JSONObject;
 
 import java.io.IOException;
 import java.security.MessageDigest;
+import java.util.HashMap;
+import java.util.Map;
 import java.util.Observable;
 import java.util.Observer;
 import java.util.regex.Matcher;
@@ -103,10 +106,7 @@ public abstract class BaseActivity extends SupportActivity implements Observer {
     protected Realm mRealm;
     protected static final int REQUESTCODE_CAMERA = 5001 ;
     protected static final int GET_IMAGE_BY_CAMERA = 5002 ;
-
-
     //记录
-
     MyPageManager pageStateManager;
     /**
      * 在使用自定义toolbar时候的根布局 =toolBarView+childView
@@ -173,6 +173,7 @@ public abstract class BaseActivity extends SupportActivity implements Observer {
     public void playMusic(int musicId) {
         if(isPlayMusic()) {
             mediaPlayer = MediaPlayer.create(this, musicId);
+            mediaPlayer.setVolume(1.0f, 1.0f);//调试声音最大
             mediaPlayer.start();
 
             // 播放完成可以释放资源 执行这个回调
@@ -199,18 +200,29 @@ public abstract class BaseActivity extends SupportActivity implements Observer {
 
     }
     public void customPlayMusic(String voice){
+
         try {
+            //判断是否需要本地播放
+            if(!voice.contains("http")){
+                int resourceId = RxTool.getResIdByName(this,voice,"raw");
+                playMusic(resourceId);
+                return;
+            }
+
             //自定义播放
             AssetFileDescriptor fd = getAssets().openFd(voice);
             MediaPlayer mediaPlayer = new MediaPlayer();
             mediaPlayer.setDataSource(fd.getFileDescriptor(), fd.getStartOffset(), fd.getLength());
             mediaPlayer.prepare();
             mediaPlayer.start();
+
         } catch (IOException e) {
             //XLog.e(e.getMessage());
             e.printStackTrace();
         }
     }
+
+
     /**
      * 初始化多语言(处理高版本多语言问题)
      * @param context
@@ -567,6 +579,17 @@ public abstract class BaseActivity extends SupportActivity implements Observer {
         }
     }
 
+    protected void showSuccessToast(String content,int voiceID) {
+        if (!StringUtils.isEmpty(content)) {
+            Toasty.success(this, content , Toast.LENGTH_SHORT).show();
+            if (voiceID>0) {
+                playMusic(voiceID);
+            }else{
+                playMusic(R.raw.success);
+            }
+        }
+    }
+
     protected void showInfoToast(String content) {
         if (!StringUtils.isEmpty(content)) {
             Toasty.info(this, content , Toast.LENGTH_SHORT).show();
@@ -591,6 +614,18 @@ public abstract class BaseActivity extends SupportActivity implements Observer {
         }
     }
 
+    protected void showWarningToast(String content,int voiceID) {
+        if (!StringUtils.isEmpty(content)) {
+            Toasty.warning(this, content , Toast.LENGTH_SHORT).show();
+            if (voiceID>0) {
+                playMusic(voiceID);
+            }else{
+                playMusic(R.raw.success);
+            }
+        }
+    }
+
+
     protected void showIconToast(String content, int img) {
         Drawable icon = ContextCompat.getDrawable(this, img);
         if (!StringUtils.isEmpty(content)) {

+ 2 - 2
baselibrary/src/main/java/com/fxy/baselibrary/util/RxTool.java

@@ -173,8 +173,8 @@ public class RxTool {
      * @param defType
      * @return
      */
-    public static final int getResIdByName(Context context, String name, String defType) {
-        return context.getResources().getIdentifier("ic_launcher", "drawable", context.getPackageName());
+    public static  int getResIdByName(Context context, String name, String defType) {
+        return context.getResources().getIdentifier(name, defType, context.getPackageName());
     }
 
     public static boolean isFastClick(int millisecond) {

BIN
baselibrary/src/main/res/raw/eight.mp3


BIN
baselibrary/src/main/res/raw/five.mp3


BIN
baselibrary/src/main/res/raw/four.mp3


BIN
baselibrary/src/main/res/raw/nine.mp3


BIN
baselibrary/src/main/res/raw/one.mp3


BIN
baselibrary/src/main/res/raw/picture.mp3


BIN
baselibrary/src/main/res/raw/seven.mp3


BIN
baselibrary/src/main/res/raw/six.mp3


BIN
baselibrary/src/main/res/raw/three.mp3


BIN
baselibrary/src/main/res/raw/two.mp3


+ 2 - 2
config.gradle

@@ -8,8 +8,8 @@ ext {
             minSdkVersion    : 17,
             targetSdkVersion : 23,
             versionCode      : 1,
-            versionName      : "2.3.0",
-            versionApi       : "2.1",
+            versionName      : "2.4.0",
+            versionApi       : "2.4",
     ]
 
     dependencies = [