完成 保修页面

master
wangh 9 months ago
parent 37ad8fa7b8
commit faff705bd0

1
app/.gitignore vendored

@ -1 +1,2 @@
/build
/release

@ -5,6 +5,7 @@
<uses-feature
android:name="android.hardware.camera"
android:required="false" />
<uses-permission android:name="android.permission.INTERNET" /> <!-- //震动权限 -->
<uses-permission android:name="android.permission.VIBRATE" /> <!-- //外部存储器权限 -->
<uses-permission
@ -18,6 +19,7 @@
<uses-permission
android:name="android.permission.READ_EXTERNAL_STORAGE"
android:maxSdkVersion="32" />
<application
android:name=".base.MyApplication"
android:allowBackup="true"
@ -30,6 +32,12 @@
android:theme="@style/Theme.Jingyuanmes"
android:usesCleartextTraffic="true"
tools:targetApi="31">
<activity
android:name=".device.DeviceCheckInfoActivity"
android:exported="false" />
<activity
android:name=".device.DeviceCheckActivity"
android:exported="false" />
<provider
android:name="androidx.core.content.FileProvider"
@ -44,7 +52,6 @@
<activity
android:name=".device.BxActivity"
android:exported="false" />
<activity
android:name=".check.CheckDisposalActivity"
android:exported="true" />
@ -98,6 +105,7 @@
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
@ -109,9 +117,9 @@
android:exported="true" />
<activity
android:name=".MainActivity"
android:exported="true">
android:exported="true" />
</activity>
</application>
</manifest>

@ -15,6 +15,7 @@ import com.example.jingyuan_mes.check.CheckActivity;
import com.example.jingyuan_mes.check.CheckSelectActivity;
import com.example.jingyuan_mes.databinding.ActivityHomePageBinding;
import com.example.jingyuan_mes.device.BxActivity;
import com.example.jingyuan_mes.device.DeviceCheckActivity;
import com.example.jingyuan_mes.entity.MenuBeen;
import com.example.jingyuan_mes.entity.store.PdaRouters;
import com.example.jingyuan_mes.store.AssemblyOutActivity;
@ -71,6 +72,7 @@ public class HomePageActivity extends BaseActivity implements ItemClickCall {
map.put("物料质检列表", CheckSelectActivity.class);
map.put("不合格处置", CheckSelectActivity.class);
map.put("故障报修", BxActivity.class);
map.put("设备巡检", DeviceCheckActivity.class);
}
private void initRequest() {

@ -52,7 +52,7 @@ public class DisposalFileAdapter extends RecyclerView.Adapter<DisposalFileAdapte
public void onBindViewHolder(@NonNull MyViewHolder holder, int position) {
var outstock = list.get(position);
var binding = holder.binding;
// binding.setVariable(BR.vm,outstock);
binding.setVariable(BR.vm,outstock);
Glide.with(context)
.load(outstock.getFaultFile())
.into(binding.disFile);

@ -1,5 +1,6 @@
package com.example.jingyuan_mes.adapter.store;
import android.annotation.SuppressLint;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.ViewGroup;
@ -10,6 +11,7 @@ import androidx.recyclerview.widget.RecyclerView;
import com.example.jingyuan_mes.BR;
import com.example.jingyuan_mes.R;
import com.example.jingyuan_mes.adapter.ItemClickCall;
import com.example.jingyuan_mes.databinding.ItemOutPassBinding;
import com.example.jingyuan_mes.entity.store.OutstockDetail;
@ -23,9 +25,14 @@ public class MaterialOutPassAdapter extends RecyclerView.Adapter<MaterialOutPass
private List<OutstockDetail> list;
private Context context;
private LayoutInflater inflater;
public MaterialOutPassAdapter(Context context) {
private ItemClickCall clickCall;
public MaterialOutPassAdapter(Context context, ItemClickCall clickCall) {
this.context = context;
inflater = LayoutInflater.from(context);
this.clickCall=clickCall;
}
public void setList(List<OutstockDetail> list) {
@ -38,14 +45,28 @@ public class MaterialOutPassAdapter extends RecyclerView.Adapter<MaterialOutPass
ItemOutPassBinding binding = DataBindingUtil.inflate(inflater, R.layout.item_out_pass, parent, false);
return new MyMaterialOutViewHolder(binding);
}
private int clickTag=-1;
@Override
public void onBindViewHolder(@NonNull MyMaterialOutViewHolder holder, int position) {
public void onBindViewHolder(@NonNull MyMaterialOutViewHolder holder, @SuppressLint("RecyclerView") int position) {
var outstock = list.get(position);
var binding = holder.binding;
binding.setVariable(BR.vm,outstock);
}
binding.materialOutItem.setOnClickListener(t->{
try {
list.get(clickTag).setSelectedState(false);
}catch (Exception e){
}
clickCall.onClick(position);
outstock.setSelectedState(true);
clickTag=position;
notifyDataSetChanged();
});
}
private void clarView(){
list.get(clickTag).setSelectedState(false);
notifyDataSetChanged();
}
@Override
public int getItemCount() {
return list==null?0:list.size();
@ -59,6 +80,5 @@ public class MaterialOutPassAdapter extends RecyclerView.Adapter<MaterialOutPass
this.binding = binding;
}
}
}

@ -26,12 +26,13 @@ import okhttp3.MediaType;
public class BaseActivity extends AppCompatActivity {
public static String url = "http://175.27.215.92:7018/prod-api";
// public static String url = "http://175.27.215.92:7018/prod-api";
public static String url = "http://10.11.40.120:7018/dev-api";
public ProgressDialog dialog;
public Gson gson;
public MediaType JSON = MediaType.parse("application/json; charset=utf-8");
private MyReceiver myReceiver;
public String handle = "eyJhbGciOiJIUzUxMiJ9.eyJ1c2VyX2lkIjoxLCJ1c2VyX2tleSI6IjA4MGY0Yjc2LWYxM2EtNDM5ZC1hYTE4LTNhYjdhMzU2OTU0NiIsInVzZXJuYW1lIjoiYWRtaW4ifQ.x3TIVswwbxV6hbV5ZUgVX2D2pxvZgHW0jN0y-NvgfipcHaaEkLak_ZeTwAdg3YMrm8GMNbHMb8_LoqEhLrjbzA";
public String handle = "eyJhbGciOiJIUzUxMiJ9.eyJ1c2VyX2lkIjoxLCJ1c2VyX2tleSI6IjcyMTlmZTJmLTVlOTItNDFmOC1hMDNkLWRmYWI0NTVhNjI1OCIsInVzZXJuYW1lIjoiYWRtaW4ifQ.FctF5DRaxqfxuwcKnjn2BfmEZ1yvYtsx_-Zlpj9ljiq_C14OXVe5nmC_JX2i6s2ri48n9DfL19cW7xPoMadPbw";
public Context context;
public SimpleDateFormat format= new SimpleDateFormat( "yyyyMMdd_HHmmss");
@Override
@ -39,7 +40,7 @@ public class BaseActivity extends AppCompatActivity {
super.onCreate(savedInstanceState);
Log.e("TAG", this.getLocalClassName() );
gson = new Gson();
SharedPreferencesUtils.putstring("access_token",handle);
// SharedPreferencesUtils.putstring("access_token",handle);
this.context=this;
initDialog();
// initSan();

@ -2,17 +2,41 @@ package com.example.jingyuan_mes.device;
import androidx.appcompat.app.AppCompatActivity;
import androidx.databinding.DataBindingUtil;
import androidx.databinding.ViewDataBinding;
import android.os.Bundle;
import android.view.View;
import com.example.jingyuan_mes.R;
import com.example.jingyuan_mes.adapter.check.DisposalFileAdapter;
import com.example.jingyuan_mes.base.BaseActivity;
import com.example.jingyuan_mes.databinding.ActivityBxBinding;
import com.example.jingyuan_mes.entity.check.CheckInstanceFiles;
public class BxActivity extends BaseActivity {
import java.io.File;
import java.util.ArrayList;
import java.util.List;
public class BxActivity extends BaseActivity implements DisposalFileAdapter.ItemClickCall {
private DisposalFileAdapter adapter;
private List<CheckInstanceFiles> filesList;
private List<File> files;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
DataBindingUtil. setContentView(this,R.layout.activity_bx);
ActivityBxBinding binding = DataBindingUtil.setContentView(this, R.layout.activity_bx);
adapter=new DisposalFileAdapter(this ,this);
filesList=new ArrayList<>();
files=new ArrayList<>();
adapter.setList(filesList);
binding.setAdapter1(adapter);
}
@Override
public void onClick(int position, boolean type) {
}
public void bxTackphoto(View view){
}
}

@ -0,0 +1,17 @@
package com.example.jingyuan_mes.device;
import androidx.appcompat.app.AppCompatActivity;
import androidx.databinding.DataBindingUtil;
import android.os.Bundle;
import com.example.jingyuan_mes.R;
public class DeviceCheckActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
DataBindingUtil.setContentView(this,R.layout.activity_device_check);
}
}

@ -0,0 +1,16 @@
package com.example.jingyuan_mes.device;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import com.example.jingyuan_mes.R;
public class DeviceCheckInfoActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_device_check_info);
}
}

@ -8,6 +8,15 @@ import androidx.databinding.BaseObservable;
*/
public class CheckInstanceFiles extends BaseObservable {
private String faultFile;
private boolean state=false;
public boolean isState() {
return state;
}
public void setState(boolean state) {
this.state = state;
}
public String getFaultFile() {
return faultFile;

@ -11,7 +11,7 @@ import java.util.Objects;
* @date 2023-12-20
*/
public class OutstockDetail {
private boolean selectedState=false;
/**
* ID
*/
@ -204,6 +204,14 @@ private int index;
this.materialProductionDate = materialProductionDate;
}
public boolean isSelectedState() {
return selectedState;
}
public void setSelectedState(boolean selectedState) {
this.selectedState = selectedState;
}
public Date getMaterialProductionDate() {
return materialProductionDate;
}

@ -17,6 +17,7 @@ public class AssemblyOutActivity extends BaseActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// 组装出库& 生产入库
binding = DataBindingUtil.setContentView(this,R.layout.activity_assembly_out);
binding.assemblyOutText.addTextChangedListener(new TextWatcher() {
@Override

@ -7,6 +7,7 @@ import android.view.View;
import android.widget.Toast;
import com.example.jingyuan_mes.R;
import com.example.jingyuan_mes.adapter.ItemClickCall;
import com.example.jingyuan_mes.adapter.store.MaterialOutPassAdapter;
import com.example.jingyuan_mes.base.BaseActivity;
import com.example.jingyuan_mes.base.MyRecultCall;
@ -23,7 +24,7 @@ import java.util.List;
import okhttp3.RequestBody;
public class MaterialPassActivity extends BaseActivity {
public class MaterialPassActivity extends BaseActivity implements ItemClickCall {
private OutStoreSubmit vm;
private List<OutstockDetail> list;
private MaterialOutPassAdapter passAdapter;
@ -34,13 +35,15 @@ public class MaterialPassActivity extends BaseActivity {
ActivityMaterialPassBinding binding = DataBindingUtil.setContentView(this, R.layout.activity_material_pass);
vm = new OutStoreSubmit();
binding.setVm(vm);
passAdapter = new MaterialOutPassAdapter(this);
passAdapter = new MaterialOutPassAdapter(this,this);
binding.setAdapter(passAdapter);
initRequest(null);
}
private void initRequest(String user) {
OkGo.<MyResult>get(url + "/wms/mobile/getAuditPassRawOutstockDetails").tag(this).headers("Authorization", SharedPreferencesUtils.getstring("access_token", "")).params("applyBy", user).execute(new MyRecultCall(dialog, this) {
OkGo.<MyResult>get(url + "/wms/mobile/getAuditPassRawOutstockDetails").tag(this)
.headers("Authorization", SharedPreferencesUtils.getstring("access_token", ""))
.params("applyBy", user).execute(new MyRecultCall(dialog, this) {
@Override
public void onSuccess(Response<MyResult> response) {
super.onSuccess(response);
@ -67,9 +70,9 @@ public class MaterialPassActivity extends BaseActivity {
initRequest(searchText);
vm.subClear();
}
// 提交
public void outPassSubmit(View view) {
var instockBatch = vm.getInstockBatch();
/* var instockBatch = vm.getInstockBatch();
var locationCode = vm.getLocationCode();
var tag = new OutstockDetail();
tag.setLocationCode(locationCode);
@ -78,8 +81,8 @@ public class MaterialPassActivity extends BaseActivity {
if (index == -1) {
Toast.makeText(this, "扫描错误", Toast.LENGTH_SHORT).show();
return;
}
vm.setRawOutstockDetailId(list.get(index).getRawOutstockDetailId());
}*/
vm.setRawOutstockDetailId(rawOutstockDetailId);
OkGo.<MyResult>post(url + "/wms/mobile/confirmRawOutstock")
.headers("Authorization", SharedPreferencesUtils.getstring("access_token", ""))
.upRequestBody(RequestBody.create(JSON, gson.toJson(vm)))
@ -89,6 +92,8 @@ public class MaterialPassActivity extends BaseActivity {
var body = response.body();
if (body.getCode() == 200) {
vm.subClear();
rawOutstockDetailId=null;
initRequest(null);
}
Toast.makeText(MaterialPassActivity.this, body.getMsg(), Toast.LENGTH_SHORT).show();
@ -96,5 +101,10 @@ public class MaterialPassActivity extends BaseActivity {
});
}
private Long rawOutstockDetailId=null;
@Override
public void onClick(int position) {
rawOutstockDetailId=list.get(position).getRawOutstockDetailId();
}
}

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="8dp"/>
<stroke android:color="#009688" android:width="2dp"/>
<solid android:color="#FAFFF9"/>
</shape>

@ -246,8 +246,7 @@
android:id="@+id/disposal_file_add"
android:layout_width="50dp"
android:layout_height="match_parent"
android:visibility="gone"
android:onClick="dispisalTackphoto"
android:onClick="bxTackphoto"
android:src="@mipmap/ic_add_file"/>
</LinearLayout>
<Button

@ -0,0 +1,119 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
<data>
<variable
name="title"
type="String" />
</data>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".device.DeviceCheckActivity">
<include
layout="@layout/toolbar"
app:title='@{title??"待巡检设备列表"}' />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="44dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="4dp"
android:background="@drawable/text_bg">
<TextView
style="@style/text_title"
android:layout_width="120dp"
android:layout_height="match_parent"
android:background="@color/activity_bg"
android:text="选择巡检线路:" />
<Spinner
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:spinnerMode="dropdown"
android:textAlignment="center" />
<Button
android:layout_width="90dp"
android:layout_height="match_parent"
android:background="@drawable/button_bg"
android:text="查询" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="38dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="4dp">
<TextView
style="@style/item_title_blue"
android:layout_width="70dp"
android:layout_height="match_parent"
android:text="巡检工单:" />
<TextView
style="@style/item_info"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1" />
<TextView
style="@style/item_title_blue"
android:layout_width="70dp"
android:layout_height="match_parent"
android:text="工单状态:" />
<TextView
style="@style/item_info"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="38dp"
android:layout_marginTop="5dp"
android:layout_marginEnd="4dp">
<TextView
style="@style/item_title_blue"
android:layout_width="70dp"
android:layout_height="match_parent"
android:text="创建时间:" />
<TextView
style="@style/item_info"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1" />
<TextView
style="@style/item_title_blue"
android:layout_width="70dp"
android:layout_height="match_parent"
android:text="巡检线路:" />
<TextView
style="@style/item_info"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1" />
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
android:padding="5dp"/>
</LinearLayout>
</layout>

@ -0,0 +1,61 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
<data>
<variable
name="title"
type="String" />
</data>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".device.DeviceCheckInfoActivity">
<include
layout="@layout/toolbar"
app:title='@{title??"待巡检设备列表"}' />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="44dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="4dp"
android:background="@drawable/text_bg">
<TextView
style="@style/text_title"
android:layout_width="100dp"
android:layout_height="match_parent"
android:background="@color/activity_bg"
android:text="扫描设备:" />
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
style="@style/text_san"/>
<Button
android:layout_width="90dp"
android:layout_height="match_parent"
android:background="@drawable/button_bg"
android:text="查询" />
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@color/white"
android:layout_marginTop="5dp"
android:padding="5dp"
/>
<Button
style="@style/button_submit"
android:text="提交"/>
</LinearLayout>
</layout>

@ -6,7 +6,7 @@
<variable
name="item"
type="com.example.jingyuan_mes.entity.check.CheckInstanceFiles" />
<import type="com.bumptech.glide.Glide"/>
<import type="android.view.View"/>
</data>
<FrameLayout
@ -24,6 +24,7 @@
android:layout_width="20dp"
android:layout_height="30dp"
android:layout_gravity="right"
android:visibility="@{item.state?View.VISIBLE:View.GONE}"
android:src="@mipmap/ic_cha1" />
</FrameLayout>
</layout>

@ -6,13 +6,15 @@
<variable
name="vm"
type="com.example.jingyuan_mes.entity.store.OutstockDetail" />
<import type="android.view.View"/>
</data>
<LinearLayout
android:id="@+id/material_out_item"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:background="@drawable/san_text_bg"
android:background="@{vm.selectedState?@drawable/bg_item_selected:@drawable/san_text_bg}"
android:orientation="vertical">
@ -75,7 +77,7 @@
android:layout_width="80dp"
android:layout_height="match_parent"
android:gravity="left|center"
android:text="物料条码:"
android:text="物料批次:"
android:textColor="#666666" />
<TextView
@ -83,7 +85,7 @@
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="left|center"
android:text="@{vm.materialBarcode}"
android:text="@{vm.instockBatch}"
android:textColor="#666666" />
</LinearLayout>
@ -176,7 +178,6 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="12dp"
android:layout_weight="1"
android:gravity="left|center"
android:text="@{vm.applyDate}" />

@ -14,12 +14,14 @@
<item name="android:gravity">center</item>
<item name="android:textColor">@color/black</item>
</style>
<style name="text_info">
<item name="android:textSize">18sp</item>
<item name="android:gravity">center</item>
<item name="android:textColor">@color/black</item>
<item name="android:background">@drawable/text_bg</item>
</style>
<style name="item_info">
<item name="android:textSize">13sp</item>
<item name="android:gravity">center</item>
@ -32,20 +34,21 @@
<item name="android:gravity">center</item>
<item name="android:textColor">@color/black</item>
</style>
<style name="item_title_blue">
<style name="item_title_blue">
<item name="android:textSize">13sp</item>
<item name="android:gravity">center</item>
<item name="android:textColor">@color/blue</item>
</style>
<style name="item_text_13">
<style name="item_text_13">
<item name="android:textSize">13sp</item>
<item name="android:gravity">center</item>
<item name="android:textColor">@color/black</item>
</style>
<style name="item_title_left">
<style name="item_title_left">
<item name="android:textSize">13sp</item>
<item name="android:gravity">center|left</item>
<item name="android:textColor">@color/black</item>
@ -71,11 +74,26 @@
<item name="android:textColor">@color/white</item>
<item name="android:letterSpacing">0.5</item>
</style>
<style name="button_2">
<style name="button_submit">
<item name="android:textStyle">bold</item>
<item name="android:textSize">19sp</item>
<item name="android:elevation">2dp</item>
<item name="android:textColor">@color/white</item>
<item name="android:letterSpacing">0.5</item>
<item name="android:layout_gravity">center</item>
<item name="android:layout_marginTop">10dp</item>
<item name="android:layout_marginBottom">10dp</item>
<item name="android:layout_width">380dp</item>
<item name="android:layout_height">49dp</item>
</style>
<style name="button_2">
<item name="android:textSize">18sp</item>
<item name="android:textColor">@color/white</item>
<item name="android:background">@drawable/button_bg</item>
<item name="android:letterSpacing">0.1</item>
<item name="android:background">@drawable/button_bg</item>
<item name="android:letterSpacing">0.1</item>
</style>
<style name="dialog_style" parent="@android:style/Theme.Dialog">
@ -97,6 +115,7 @@
<!--对话框动画-->
<item name="android:windowAnimationStyle">@style/dialog_anim_bottom2top</item>
</style>
<style name="dialog_anim_bottom2top">
<item name="android:windowEnterAnimation">@anim/return_dialog_in</item>
<item name="android:windowExitAnimation">@anim/return_dialog_out</item>

Loading…
Cancel
Save