完成 报修功能

master
wanghao 7 months ago
parent 609b21dc52
commit c2a2108f85

@ -10,7 +10,7 @@ android {
applicationId "com.example.beijingnopowercon" applicationId "com.example.beijingnopowercon"
minSdk 28 minSdk 28
targetSdk 33 targetSdk 33
versionCode 1 versionCode 2
versionName "1.0" versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
@ -23,8 +23,8 @@ android {
} }
} }
compileOptions { compileOptions {
sourceCompatibility JavaVersion.VERSION_11 sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_11 targetCompatibility JavaVersion.VERSION_17
} }
buildFeatures { buildFeatures {
viewBinding true viewBinding true
@ -51,4 +51,5 @@ dependencies {
implementation 'com.journeyapps:zxing-android-embedded:4.3.0' implementation 'com.journeyapps:zxing-android-embedded:4.3.0'
implementation 'io.github.scwang90:refresh-layout-kernel:2.0.6' // implementation 'io.github.scwang90:refresh-layout-kernel:2.0.6' //
implementation 'io.github.scwang90:refresh-footer-classics:2.0.6' // implementation 'io.github.scwang90:refresh-footer-classics:2.0.6' //
implementation 'com.github.bumptech.glide:glide:4.16.0'
} }

@ -18,9 +18,21 @@
android:label="@string/app_name" android:label="@string/app_name"
android:roundIcon="@mipmap/logo" android:roundIcon="@mipmap/logo"
android:supportsRtl="true" android:supportsRtl="true"
android:usesCleartextTraffic="true"
android:theme="@style/Theme.BeijingNoPowerCon" android:theme="@style/Theme.BeijingNoPowerCon"
android:usesCleartextTraffic="true"
tools:targetApi="31"> tools:targetApi="31">
<provider
android:name="androidx.core.content.FileProvider"
android:authorities="com.example.beijingnopowercon"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/file_paths" />
</provider>
<activity <activity
android:name=".LoginActivity" android:name=".LoginActivity"
android:exported="true" android:exported="true"
@ -40,11 +52,11 @@
android:exported="true" android:exported="true"
android:label="@string/app_name" android:label="@string/app_name"
android:theme="@style/Theme.BeijingNoPowerCon.NoActionBar"> android:theme="@style/Theme.BeijingNoPowerCon.NoActionBar">
<!-- <intent-filter>--> <!-- <intent-filter>-->
<!-- <action android:name="android.intent.action.MAIN" />--> <!-- <action android:name="android.intent.action.MAIN" />-->
<!-- <category android:name="android.intent.category.LAUNCHER" />--> <!-- <category android:name="android.intent.category.LAUNCHER" />-->
<!-- </intent-filter>--> <!-- </intent-filter>-->
</activity> </activity>
</application> </application>

@ -48,7 +48,7 @@ public class LoginActivity extends AppCompatActivity {
String name = loginVm.getName(); String name = loginVm.getName();
if (pass == null || name == null || pass.isEmpty() || name.isEmpty()) return; if (pass == null || name == null || pass.isEmpty() || name.isEmpty()) return;
OkGo.<MyResult>get(MyApplication.url + "/login/finduser").tag(this).params("name", name).params("pass", pass).execute(new MyRecultCall(dialog, this) { OkGo.<MyResult>get(MyApplication.url + "/login/finduser1").tag(this).params("name", name).params("pass", pass).execute(new MyRecultCall(dialog, this) {
@Override @Override
public void onSuccess(Response<MyResult> response) { public void onSuccess(Response<MyResult> response) {
super.onSuccess(response); super.onSuccess(response);
@ -66,6 +66,7 @@ public class LoginActivity extends AppCompatActivity {
startActivity(intent); startActivity(intent);
finish(); finish();
return;
} }
Toast.makeText(context, body.getMsg(), Toast.LENGTH_SHORT).show(); Toast.makeText(context, body.getMsg(), Toast.LENGTH_SHORT).show();
} }

@ -24,16 +24,12 @@ public class MainActivity extends AppCompatActivity {
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
binding = ActivityMainBinding.inflate(getLayoutInflater()); binding = ActivityMainBinding.inflate(getLayoutInflater());
setContentView(binding.getRoot()); setContentView(binding.getRoot());
setSupportActionBar(binding.appBarMain.toolbar); setSupportActionBar(binding.appBarMain.toolbar);
DrawerLayout drawer = binding.drawerLayout; DrawerLayout drawer = binding.drawerLayout;
NavigationView navigationView = binding.navView; NavigationView navigationView = binding.navView;
// Passing each menu ID as a set of Ids because each
// menu should be considered as top level destinations.
mAppBarConfiguration = new AppBarConfiguration.Builder( mAppBarConfiguration = new AppBarConfiguration.Builder(
R.id.nav_home, R.id.nav_gallery, R.id.nav_slideshow) R.id.nav_home, R.id.nav_gallery, R.id.nav_slideshow)
.setOpenableLayout(drawer) .setOpenableLayout(drawer)

@ -0,0 +1,79 @@
package com.example.beijingnopowercon.adapter;
import android.content.Context;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.databinding.DataBindingUtil;
import androidx.recyclerview.widget.RecyclerView;
import com.bumptech.glide.Glide;
import com.example.beijingnopowercon.BR;
import com.example.beijingnopowercon.R;
import com.example.beijingnopowercon.data.CheckInstanceFiles;
import com.example.beijingnopowercon.databinding.ItemDisposalImgBinding;
import java.util.List;
/**
* @author wanghao
* @date 2024/3/11
*/
public class DisposalFileAdapter extends RecyclerView.Adapter<DisposalFileAdapter.MyViewHolder> {
private List<CheckInstanceFiles> list;
private static Context context;
private LayoutInflater inflater;
private ItemClickCall clickCall;
public DisposalFileAdapter(Context context, ItemClickCall clickCall) {
this.context = context;
this.clickCall = clickCall;
inflater = LayoutInflater.from(context);
}
public void setList(List<CheckInstanceFiles> list) {
this.list = list;
}
@NonNull
@Override
public MyViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
ItemDisposalImgBinding binding = DataBindingUtil.inflate(inflater, R.layout.item_disposal_img, parent, false);
return new MyViewHolder(binding);
}
// @SuppressLint("CheckResult")
@Override
public void onBindViewHolder(@NonNull MyViewHolder holder, int position) {
var outstock = list.get(position);
var binding = holder.binding;
binding.setVariable(BR.vm,outstock);
Log.e("TAG", "onBindViewHolder:" + outstock.isState());
Glide.with(context)
.load(outstock.getFaultFile())
.into(binding.disFile);
binding.disFile.setOnClickListener(v -> clickCall.onClick(position,true));
binding.disposalDelect.setOnClickListener(v -> clickCall.onClick(position,false));
}
@Override
public int getItemCount() {
return list==null?0:list.size();
}
class MyViewHolder extends RecyclerView.ViewHolder {
private ItemDisposalImgBinding binding;
public MyViewHolder(ItemDisposalImgBinding binding) {
super(binding.getRoot());
this.binding = binding;
}
}
public interface ItemClickCall {
void onClick(int position,boolean type);
}
}

@ -1,9 +1,21 @@
package com.example.beijingnopowercon.base; package com.example.beijingnopowercon.base;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.core.app.ActivityCompat;
import androidx.core.content.ContextCompat;
import androidx.core.content.FileProvider;
import androidx.fragment.app.Fragment; import androidx.fragment.app.Fragment;
import android.Manifest;
import android.content.Context; import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.provider.MediaStore;
import android.util.Log; import android.util.Log;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
@ -14,12 +26,22 @@ import androidx.annotation.Nullable;
import com.example.beijingnopowercon.dialog.LoadDialog; import com.example.beijingnopowercon.dialog.LoadDialog;
import com.google.gson.Gson; import com.google.gson.Gson;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Date;
public class BaseFragment extends Fragment { public class BaseFragment extends Fragment {
public Context context; public Context context;
public LoadDialog dialog; public LoadDialog dialog;
public String url; public String url;
public Gson gson; public Gson gson;
public static final int CAMERA_PHOTO = 1;
public SimpleDateFormat format= new SimpleDateFormat( "yyyyMMdd_HHmmss");
@Override @Override
public void onAttach(@NonNull Context context) { public void onAttach(@NonNull Context context) {
@ -29,4 +51,53 @@ public class BaseFragment extends Fragment {
url=MyApplication.url; url=MyApplication.url;
gson=new Gson(); gson=new Gson();
} }
// 拍照
private Uri img_uri;
private File outputImage;
public void teke_photo() throws IOException {
outputImage = new File(context.getExternalCacheDir(), "output_imgage" + format.format(new Date()) + ".jpg");
outputImage.createNewFile();
if (Build.VERSION.SDK_INT >= 24) {
img_uri = FileProvider.getUriForFile(context,"com.example.beijingnopowercon" , outputImage);
} else {
img_uri = Uri.fromFile(outputImage);
}
if (PackageManager.PERMISSION_GRANTED == ContextCompat.checkSelfPermission(context, Manifest.permission.CAMERA)) {
Intent intent = new Intent("android.media.action.IMAGE_CAPTURE");
intent.putExtra(MediaStore.EXTRA_OUTPUT, img_uri);
startActivityForResult(intent, CAMERA_PHOTO);
} else {
// 提示用户开户权限 拍照和读写sd卡权限
String[] perms = {Manifest.permission.READ_EXTERNAL_STORAGE, Manifest.permission.WRITE_EXTERNAL_STORAGE, Manifest.permission.CAMERA};
ActivityCompat.requestPermissions(getActivity(), perms, CAMERA_PHOTO);
}
}
public void zipPhoto(){
Bitmap compressedImageBitmap = BitmapFactory.decodeFile(outputImage.getPath());
if (compressedImageBitmap==null) return;
ByteArrayOutputStream baos = new ByteArrayOutputStream();
compressedImageBitmap.compress(Bitmap.CompressFormat.JPEG, 10, baos); // 将Bitmap压缩成JPEG格式
byte[] compressedImageData = baos.toByteArray();
// 清空字节数组输出流
baos.reset();
// 将压缩后的字节数组保存到文件中
FileOutputStream fos = null;
try {
fos = new FileOutputStream(outputImage);
fos.write(compressedImageData);
fos.flush();
fos.close();
tekePhotoResult( img_uri.toString(),outputImage);
} catch (IOException e) {
throw new RuntimeException(e);
}
}
public void tekePhotoResult(String fileUrl,File file){
}
} }

@ -29,8 +29,8 @@ public class MyApplication extends Application {
public static MyApplication getApplication() { public static MyApplication getApplication() {
return application; return application;
} }
// public static String url="http://192.168.137.1:8091/api"; // public static String url="http://119.45.202.115:8090/api";
public static String url="http://119.45.202.115:8091/api"; public static String url="http://10.11.184.221:8090/api";
@Override @Override
public void onCreate() { public void onCreate() {
super.onCreate(); super.onCreate();

@ -0,0 +1,37 @@
package com.example.beijingnopowercon.data;
import androidx.databinding.BaseObservable;
/**
* @author wanghao
*
* @date 2024/3/11 10:00
*/
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;
}
public void setFaultFile(String faultFile) {
this.faultFile = faultFile;
}
@Override
public String toString() {
return "CheckInstanceFiles{" +
"faultFile='" + faultFile + '\'' +
'}';
}
}

@ -0,0 +1,75 @@
package com.example.beijingnopowercon.data;
/**
* device_base_fault
*
* @author wangh
* @date 2025-09-24
*/
public class DeviceBaseFault {
/**
*
*/
private Long objid;
/**
*
*/
private String faultCode;
/**
*
*/
private String faultName;
/**
*
*/
private String faultInfo;
/**
*
*/
private String emergencyMeasures;
public Long getObjid() {
return objid;
}
public void setObjid(Long objid) {
this.objid = objid;
}
public String getFaultCode() {
return faultCode;
}
public void setFaultCode(String faultCode) {
this.faultCode = faultCode;
}
public String getFaultName() {
return faultName;
}
public void setFaultName(String faultName) {
this.faultName = faultName;
}
public String getFaultInfo() {
return faultInfo;
}
public void setFaultInfo(String faultInfo) {
this.faultInfo = faultInfo;
}
public String getEmergencyMeasures() {
return emergencyMeasures;
}
public void setEmergencyMeasures(String emergencyMeasures) {
this.emergencyMeasures = emergencyMeasures;
}
}

@ -0,0 +1,73 @@
package com.example.beijingnopowercon.data;
/**
* @author wanghao
* @date 2024/4/1 10:00
*/
public class DeviceBeen {
private int deviceId;
private String deviceCode;
private String deviceName;
private String deviceLocation;
private Long deviceTypeId;
private String deviceSpec;
private int deviceStatus;
public int getDeviceId() {
return deviceId;
}
public void setDeviceId(int deviceId) {
this.deviceId = deviceId;
}
public String getDeviceCode() {
return deviceCode;
}
public void setDeviceCode(String deviceCode) {
this.deviceCode = deviceCode;
}
public String getDeviceName() {
return deviceName;
}
public void setDeviceName(String deviceName) {
this.deviceName = deviceName;
}
public String getDeviceLocation() {
return deviceLocation;
}
public void setDeviceLocation(String deviceLocation) {
this.deviceLocation = deviceLocation;
}
public Long getDeviceTypeId() {
return deviceTypeId;
}
public void setDeviceTypeId(Long deviceTypeId) {
this.deviceTypeId = deviceTypeId;
}
public String getDeviceSpec() {
return deviceSpec;
}
public void setDeviceSpec(String deviceSpec) {
this.deviceSpec = deviceSpec;
}
public int getDeviceStatus() {
return deviceStatus;
}
public void setDeviceStatus(int deviceStatus) {
this.deviceStatus = deviceStatus;
}
}

@ -57,13 +57,40 @@ public class DeviceInfo {
private Double defaultTime; private Double defaultTime;
private String remark; private String remark;
/** 用户ID */ /**
* ID
*/
private Long userId; private Long userId;
/** 部门ID */ /**
* ID
*/
private Long deptId; private Long deptId;
private String useUser; private String useUser;
// 锁编码
private String openCode;
private String useStateName;
private String deviceStateName;
private String asName;
public String getAsName() {
return asName;
}
public void setAsName(String asName) {
this.asName = asName;
}
public String getOpenCode() {
return openCode;
}
public void setOpenCode(String openCode) {
this.openCode = openCode;
}
public String getUseUser() { public String getUseUser() {
return useUser; return useUser;
} }
@ -164,32 +191,39 @@ public class DeviceInfo {
return deviceState; return deviceState;
} }
private String useStateName; public void setDeviceState(String deviceState) {
private String deviceStateName; this.deviceState = deviceState;
}
public String getUseStateName() { public String getUseStateName() {
if (useState.equals("1")){ if (useState.equals("1")) {
return "使用中"; return "使用中";
} }
return "空闲"; return "空闲";
} }
public void setUseStateName(String useStateName) {
this.useStateName = useStateName;
}
public String getDeviceStateName() { public String getDeviceStateName() {
if (useState.equals("1")){ if (deviceState.equals("0")) {
return "使用中";
}else if (deviceState.equals("0")){
return "停用"; return "停用";
}else if (deviceState.equals("1")){ } else if (deviceState.equals("2")) {
return "正常";
}else if (deviceState.equals("2")){
return "维修"; return "维修";
} else if (useState.equals("1")) {
return "使用中";
} else if (useState.equals("0")) {
return "空闲";
} }
return deviceStateName; return deviceStateName;
} }
public void setDeviceState(String deviceState) { public void setDeviceStateName(String deviceStateName) {
this.deviceState = deviceState; this.deviceStateName = deviceStateName;
} }
public String getLocationName() { public String getLocationName() {

@ -0,0 +1,159 @@
package com.example.beijingnopowercon.data;
import android.view.View;
import android.widget.AdapterView;
import androidx.databinding.BaseObservable;
import java.util.List;
/**
* device_repart_bills
*
* @author ruoyi
* @date 2022-05-26
*/
public class DeviceRepartBills extends BaseObservable {
/**
*
*/
private Long objid;
/**
*
*/
private String workOrder;
/**
*
*/
private String deviceID;
/**
*
*/
private Long faultType;
/**
*
*/
private String operation;
/**
*
*/
private String pictures;
/**
* 0-1-,2-,3-
*/
private Long orderState;
/**
*
*/
private Long billsType;
private String remark;
private String createBy;
private List<DeviceBaseFault> list;
public String getCreateBy() {
return createBy;
}
public void setCreateBy(String createBy) {
this.createBy = createBy;
}
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
setFaultType(list.get(position).getObjid());
}
public List<DeviceBaseFault> getList() {
return list;
}
public void setList(List<DeviceBaseFault> list) {
this.list = list;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
notifyChange();
}
public Long getObjid() {
return objid;
}
public void setObjid(Long objid) {
this.objid = objid;
}
public String getWorkOrder() {
return workOrder;
}
public void setWorkOrder(String workOrder) {
this.workOrder = workOrder;
}
public String getDeviceID() {
return deviceID;
}
public void setDeviceID(String deviceID) {
this.deviceID = deviceID;
}
public Long getFaultType() {
return faultType;
}
public void setFaultType(Long faultType) {
this.faultType = faultType;
}
public String getOperation() {
return operation;
}
public void setOperation(String operation) {
this.operation = operation;
notifyChange();
}
public String getPictures() {
return pictures;
}
public void setPictures(String pictures) {
this.pictures = pictures;
}
public Long getOrderState() {
return orderState;
}
public void setOrderState(Long orderState) {
this.orderState = orderState;
}
public Long getBillsType() {
return billsType;
}
public void setBillsType(Long billsType) {
this.billsType = billsType;
}
}

@ -0,0 +1,52 @@
package com.example.beijingnopowercon.data;
/**
* @author wanghao
* @date 2024/3/22 10:36
*/
public class Dict {
private String dictLabel;
private String dictValue;
private String dictType;
private String dictCode;
public String getDictLabel() {
return dictLabel;
}
public void setDictLabel(String dictLabel) {
this.dictLabel = dictLabel;
}
public String getDictValue() {
return dictValue;
}
public void setDictValue(String dictValue) {
this.dictValue = dictValue;
}
public String getDictType() {
return dictType;
}
public void setDictType(String dictType) {
this.dictType = dictType;
}
public String getDictCode() {
return dictCode;
}
public void setDictCode(String dictCode) {
this.dictCode = dictCode;
}
@Override
public String toString() {
return "Dict{" +
"dictLabel='" + dictLabel + '\'' +
", dictValue='" + dictValue + '\'' +
'}';
}
}

@ -0,0 +1,43 @@
package com.example.beijingnopowercon.data;
/**
* @author wanghao
* @date 2024/4/1 14:02
*
*/
public class Outsourcing {
/**
* outsrcId : 1
* outsrcCode : code0001
* outsrcName :
*/
private int outsrcId;
private String outsrcCode;
private String outsrcName;
public int getOutsrcId() {
return outsrcId;
}
public void setOutsrcId(int outsrcId) {
this.outsrcId = outsrcId;
}
public String getOutsrcCode() {
return outsrcCode;
}
public void setOutsrcCode(String outsrcCode) {
this.outsrcCode = outsrcCode;
}
public String getOutsrcName() {
return outsrcName;
}
public void setOutsrcName(String outsrcName) {
this.outsrcName = outsrcName;
}
}

@ -0,0 +1,39 @@
package com.example.beijingnopowercon.dialog;
import android.app.Dialog;
import android.content.Context;
import android.view.LayoutInflater;
import androidx.annotation.NonNull;
import androidx.databinding.DataBindingUtil;
import com.bumptech.glide.Glide;
import com.example.beijingnopowercon.R;
import com.example.beijingnopowercon.databinding.DialogImgBinding;
/**
* @author wanghao
* @date 2024/2/22 11:07
*/
public class ImgDialog extends Dialog {
private DialogImgBinding binding;
private Context context;
public void setRawReturn(String url) {
Glide.with(context).load(url).into(binding.dialogImg);
binding.executePendingBindings();
show();
}
public ImgDialog(@NonNull Context context) {
super(context,R.style.dialog);
this.context=context;
binding = DataBindingUtil.inflate(LayoutInflater.from(context), R.layout.dialog_img, null, false);
setContentView(binding.getRoot());
binding.dialogImgDis.setOnClickListener(v -> dismiss());
}
}

@ -37,14 +37,27 @@ public class HomeFragment extends BaseFragment implements SanInfoDialog.SanInfoD
private FragmentHomeBinding binding; private FragmentHomeBinding binding;
private SanInfoDialog infoDialog; private SanInfoDialog infoDialog;
private DeviceListAdapter adapter; private DeviceListAdapter adapter;
private boolean buttonClick;
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
binding = FragmentHomeBinding.inflate(inflater, container, false); binding = FragmentHomeBinding.inflate(inflater, container, false);
root = binding.getRoot(); root = binding.getRoot();
binding.homeSan.setOnClickListener(v -> { binding.homeSan.setOnClickListener(v -> {
Intent intent = new Intent(getActivity(), CustomScannerActivity.class); Intent intent = new Intent(getActivity(), CustomScannerActivity.class);
buttonClick = true;
startActivityForResult(intent, IntentIntegrator.REQUEST_CODE); startActivityForResult(intent, IntentIntegrator.REQUEST_CODE);
selectDeviceInfo("DWSW0001");
}); });
binding.homeSanClose.setOnClickListener(v -> {
Intent intent = new Intent(getActivity(), CustomScannerActivity.class);
buttonClick = false;
// startActivityForResult(intent, IntentIntegrator.REQUEST_CODE);
closeDevice("DWSW0001");
});
infoDialog = new SanInfoDialog(context); infoDialog = new SanInfoDialog(context);
infoDialog.setCall(this); infoDialog.setCall(this);
adapter = new DeviceListAdapter(context); adapter = new DeviceListAdapter(context);
@ -62,7 +75,7 @@ public class HomeFragment extends BaseFragment implements SanInfoDialog.SanInfoD
Log.e("TAG", "onCreateView:"); Log.e("TAG", "onCreateView:");
return root; return root;
} }
// 查询所有设备列表
private void initRequest() { private void initRequest() {
OkGo.<MyResult>post(url + "/home/selectDeviceInfoList").execute(new MyRecultCall(dialog, context) { OkGo.<MyResult>post(url + "/home/selectDeviceInfoList").execute(new MyRecultCall(dialog, context) {
@Override @Override
@ -81,6 +94,7 @@ public class HomeFragment extends BaseFragment implements SanInfoDialog.SanInfoD
}); });
} }
// 返回扫码信息
@Override @Override
public void onActivityResult(int requestCode, int resultCode, Intent data) { public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data); super.onActivityResult(requestCode, resultCode, data);
@ -91,11 +105,30 @@ public class HomeFragment extends BaseFragment implements SanInfoDialog.SanInfoD
Snackbar.make(root, "扫描取消", Snackbar.LENGTH_LONG).show(); Snackbar.make(root, "扫描取消", Snackbar.LENGTH_LONG).show();
} else { } else {
// Toast.makeText(context, "扫描成功", Toast.LENGTH_SHORT).show(); // Toast.makeText(context, "扫描成功", Toast.LENGTH_SHORT).show();
selectDeviceInfo(result.getContents()); if (buttonClick) {
selectDeviceInfo(result.getContents());
} else {
closeDevice(result.getContents());
}
} }
} }
} }
} }
// 关锁
private void closeDevice(String contents) {
OkGo.<MyResult>post(url + "/home/closeDevice").params("code", contents).execute(new MyRecultCall(dialog, context) {
@Override
public void onSuccess(Response<MyResult> response) {
super.onSuccess(response);
MyResult body = response.body();
Toast.makeText(getContext(), body.getMsg(), Toast.LENGTH_SHORT).show();
if (body.getCode() == 0) {
initRequest();
}
}
});
}
// 查询设备 // 查询设备
private void selectDeviceInfo(String code) { private void selectDeviceInfo(String code) {
@ -123,25 +156,27 @@ public class HomeFragment extends BaseFragment implements SanInfoDialog.SanInfoD
binding = null; binding = null;
} }
// 弹窗确认开锁
@Override @Override
public void openDeviceLockRequest(DeviceInfo deviceInfo) { public void openDeviceLockRequest(DeviceInfo deviceInfo) {
deviceInfo.setUserId(SharedPreferencesUtils.getLong("userId", 0L)); deviceInfo.setUserId(SharedPreferencesUtils.getLong("userId", 0L));
deviceInfo.setDeptId(SharedPreferencesUtils.getLong("deptId", 0L)); deviceInfo.setDeptId(SharedPreferencesUtils.getLong("deptId", 0L));
deviceInfo.setUseUser(SharedPreferencesUtils.getstring("user", null)); deviceInfo.setUseUser(SharedPreferencesUtils.getstring("user", null));
OkGo.<MyResult>post(url + "/home/openDeviceLock").upRequestBody(RequestBody.create(MediaType.parse("application/json; charset=utf-8"), gson.toJson(deviceInfo))).execute(new MyRecultCall(dialog, context) { OkGo.<MyResult>post(url + "/home/openDeviceLock")
@Override .upRequestBody(RequestBody.create(MediaType.parse("application/json; charset=utf-8"),
public void onSuccess(Response<MyResult> response) { gson.toJson(deviceInfo))).execute(new MyRecultCall(dialog, context) {
super.onSuccess(response); @Override
MyResult body = response.body(); public void onSuccess(Response<MyResult> response) {
if (body.getCode() == 0) { super.onSuccess(response);
Toast.makeText(context, "开锁成功", Toast.LENGTH_SHORT).show(); MyResult body = response.body();
infoDialog.dismiss(); if (body.getCode() == 0) {
initRequest(); Toast.makeText(context, "开锁成功", Toast.LENGTH_SHORT).show();
return; infoDialog.dismiss();
} initRequest();
Toast.makeText(context, body.getMsg(), Toast.LENGTH_LONG).show(); return;
} }
}); Toast.makeText(context, body.getMsg(), Toast.LENGTH_LONG).show();
}
});
} }
} }

@ -1,32 +1,195 @@
package com.example.beijingnopowercon.ui.slideshow; package com.example.beijingnopowercon.ui.slideshow;
import android.annotation.SuppressLint;
import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.TextView; import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ListPopupWindow;
import android.widget.Toast;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment; import androidx.annotation.Nullable;
import androidx.lifecycle.ViewModelProvider;
import com.example.beijingnopowercon.R;
import com.example.beijingnopowercon.adapter.DisposalFileAdapter;
import com.example.beijingnopowercon.base.BaseFragment;
import com.example.beijingnopowercon.data.CheckInstanceFiles;
import com.example.beijingnopowercon.data.DeviceBaseFault;
import com.example.beijingnopowercon.data.DeviceInfo;
import com.example.beijingnopowercon.data.DeviceRepartBills;
import com.example.beijingnopowercon.databinding.FragmentSlideshowBinding; import com.example.beijingnopowercon.databinding.FragmentSlideshowBinding;
import com.example.beijingnopowercon.dialog.ImgDialog;
import com.example.beijingnopowercon.okgo.MyRecultCall;
import com.example.beijingnopowercon.okgo.MyResult;
import com.example.beijingnopowercon.uitls.SharedPreferencesUtils;
import com.google.android.material.snackbar.Snackbar;
import com.google.gson.reflect.TypeToken;
import com.google.zxing.integration.android.IntentIntegrator;
import com.google.zxing.integration.android.IntentResult;
import com.lzy.okgo.OkGo;
import com.lzy.okgo.model.Response;
public class SlideshowFragment extends Fragment { import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
public class SlideshowFragment extends BaseFragment {
private FragmentSlideshowBinding binding; private FragmentSlideshowBinding binding;
private View view;
private ListPopupWindow lpw;
private DeviceRepartBills deviceRepartBills;
private List<String> designOperations;
private List<String> designList;
private DisposalFileAdapter fileAdapter;
private List<CheckInstanceFiles> filesList;
private List<File> files;
public View onCreateView(@NonNull LayoutInflater inflater, public View onCreateView(@NonNull LayoutInflater inflater,
ViewGroup container, Bundle savedInstanceState) { ViewGroup container, Bundle savedInstanceState) {
SlideshowViewModel slideshowViewModel =
new ViewModelProvider(this).get(SlideshowViewModel.class);
binding = FragmentSlideshowBinding.inflate(inflater, container, false); binding = FragmentSlideshowBinding.inflate(inflater, container, false);
View root = binding.getRoot(); view = binding.getRoot();
binding.selectNameView.setOnClickListener(v -> {
// startActivityForResult(new Intent(getActivity(), CustomScannerActivity.class), IntentIntegrator.REQUEST_CODE);
selectDeviceInfo("DWSW0001");
});
binding.bxDesOpe.setOnClickListener(v -> lpw.show());
binding.disposalFileAdd.setOnClickListener(v -> {
try {
teke_photo();
} catch (IOException e) {
throw new RuntimeException(e);
}
});
binding.bxSubmitButton.setOnClickListener(v -> {
deviceRepartBills.setCreateBy(SharedPreferencesUtils.getstring("user",null));
OkGo.<MyResult>post(url + "/bx/subment")
.params("json", gson.toJson(deviceRepartBills))
.addFileParams("file", files)
.execute(new MyRecultCall(dialog, context) {
@Override
public void onSuccess(Response<MyResult> response) {
super.onSuccess(response);
MyResult body = response.body();
if (body.getCode() == 0) {
files.forEach(File::delete);
filesList.clear();
fileAdapter.notifyDataSetChanged();
binding.setDevice(null);
deviceRepartBills.setOperation(null);
deviceRepartBills.setRemark(null);
return;
}
Snackbar.make(view, body.getMsg(), Snackbar.LENGTH_LONG).show();
}
});
});
return view;
}
@SuppressLint("NotifyDataSetChanged")
@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
designList = Arrays.asList(getResources().getStringArray(R.array.open));
initFaultType();
initRequestLpw();
deviceRepartBills = new DeviceRepartBills();
binding.setVm(deviceRepartBills);
designOperations = new ArrayList<>();
ImgDialog imgDialog = new ImgDialog(context);
filesList = new ArrayList<>(10);
files = new ArrayList<>(10);
fileAdapter = new DisposalFileAdapter(context, (position, type) -> {
if (type) {
imgDialog.setRawReturn(filesList.get(position).getFaultFile());
return;
}
filesList.remove(position);
files.remove(position);
fileAdapter.notifyDataSetChanged();
});
fileAdapter.setList(filesList);
binding.setAdapter1(fileAdapter);
}
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == IntentIntegrator.REQUEST_CODE) {
IntentResult result = IntentIntegrator.parseActivityResult(requestCode, resultCode, data);
if (result != null) {
if (result.getContents() == null) {
Snackbar.make(view, "扫描取消", Snackbar.LENGTH_LONG).show();
} else {
Snackbar.make(view, "扫描成功", Snackbar.LENGTH_LONG).show();
selectDeviceInfo(result.getContents());
}
}
} else if (requestCode == CAMERA_PHOTO) {
zipPhoto();
}
}
// 查询设备
private void selectDeviceInfo(String code) {
binding.selectNameView.setText(code);
OkGo.<MyResult>post(url + "/home/selectDeviceInfo").params("code", code).execute(new MyRecultCall(dialog, context) {
@Override
public void onSuccess(Response<MyResult> response) {
super.onSuccess(response);
MyResult body = response.body();
if (body.getCode() == 0) {
DeviceInfo deviceInfo = gson.fromJson(body.getDataJson(), DeviceInfo.class);
binding.setDevice(deviceInfo);
deviceRepartBills.setDeviceID(String.valueOf(deviceInfo.getObjId()));
return;
}
Toast.makeText(context, body.getMsg(), Toast.LENGTH_SHORT).show();
}
});
}
private void initFaultType() {
OkGo.<MyResult>post(url + "/fault/selectFaultList")
.execute(new MyRecultCall(dialog, context) {
@Override
public void onSuccess(Response<MyResult> response) {
MyResult body = response.body();
if (body.getCode() == 0) {
List<DeviceBaseFault> list = gson.fromJson(body.getDataJson(), new TypeToken<List<DeviceBaseFault>>() {
}.getType());
if (list == null || list.isEmpty()) return;
List<String> tagList = new ArrayList<>(list.size());
list.forEach(t -> tagList.add(t.getFaultCode() + " - " + t.getFaultName()));
binding.setFaultTypes(tagList);
deviceRepartBills.setList(list);
return;
}
Toast.makeText(context, body.getMsg(), Toast.LENGTH_SHORT).show();
}
});
final TextView textView = binding.textSlideshow;
slideshowViewModel.getText().observe(getViewLifecycleOwner(), textView::setText);
return root;
} }
@Override @Override
@ -34,4 +197,44 @@ public class SlideshowFragment extends Fragment {
super.onDestroyView(); super.onDestroyView();
binding = null; binding = null;
} }
private void initRequestLpw() {
lpw = new ListPopupWindow(context);
lpw.setAnchorView(binding.bxDesOpe);
lpw.setAdapter(new ArrayAdapter<>(context,
androidx.appcompat.R.layout.support_simple_spinner_dropdown_item, designList));
lpw.setOnItemClickListener((parent, view, position, id) -> {
String tag = designList.get(position);
if (designOperations.contains(tag)) {
designOperations.remove(tag);
} else {
designOperations.add(tag);
}
String replace = designOperations.toString()
.replaceFirst("\\[", "")
.replace("]", "");
binding.bxDesOpe.setText(replace);
deviceRepartBills.setOperation(replace);
lpw.dismiss();
});
}
@SuppressLint("NotifyDataSetChanged")
@Override
public void tekePhotoResult(String fileUrl, File file) {
super.tekePhotoResult(fileUrl, file);
CheckInstanceFiles checkInstanceFiles = new CheckInstanceFiles();
checkInstanceFiles.setFaultFile(fileUrl);
checkInstanceFiles.setState(true);
filesList.add(checkInstanceFiles);
fileAdapter.notifyDataSetChanged();
files.add(file);
}
} }

@ -1,9 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android" <vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp" android:width="1024dp"
android:height="24dp" android:height="1024dp"
android:viewportWidth="24.0" android:viewportWidth="1024"
android:viewportHeight="24.0"> android:viewportHeight="1024">
<path <path
android:fillColor="#FF000000" android:fillColor="#000000"
android:pathData="M4,6H2v14c0,1.1 0.9,2 2,2h14v-2H4V6zm16,-4H8c-1.1,0 -2,0.9 -2,2v12c0,1.1 0.9,2 2,2h12c1.1,0 2,-0.9 2,-2V4c0,-1.1 -0.9,-2 -2,-2zm-8,12.5v-9l6,4.5 -6,4.5z" /> android:pathData="M652,64 C691.187,64,724.524,89.044,736.879,124 L802,124
</vector> C851.209,124,891.193,163.493,891.988,212.512 L892,214 L892,870
C892,919.209,852.507,959.193,803.488,959.988 L802,960 L222,960
C172.791,960,132.807,920.507,132.012,871.488 L132,870 L132,214
C132,164.791,171.493,124.807,220.512,124.012 L222,124 L287.121,124
C299.476,89.044,332.813,64,372,64 Z M282,184 L222,184
C205.597,184,192.269,197.164,192.004,213.504 L192,214 L192,870
C192,886.403,205.164,899.731,221.504,899.996 L222,900 L802,900
C818.403,900,831.731,886.836,831.996,870.496 L832,870 L832,214
C832,197.597,818.836,184.269,802.496,184.004 L802,184 L742,184 L742,204
C742,225.87,724.448,243.641,702.661,243.995 L702,244 L322,244
C299.909,244,282,226.091,282,204 L282,184 Z M512,330
C647.31,330,757,439.69,757,575 S647.31,820,512,820 S267,710.31,267,575
S376.69,330,512,330 Z M512,390 C409.827,390,327,472.827,327,575
S409.827,760,512,760 S697,677.173,697,575 S614.173,390,512,390 Z M512,652
C528.569,652,542,665.431,542,682 C542,698.569,528.569,712,512,712
C495.431,712,482,698.569,482,682 C482,665.431,495.431,652,512,652 Z M512,430
C528.569,430,542,443.431,542,460 L542,602 C542,618.569,528.569,632,512,632
C495.431,632,482,618.569,482,602 L482,460 C482,443.431,495.431,430,512,430 Z
M652,124 L372,124 C355.431,124,342,137.431,342,154 L342,184 L682,184 L682,154
C682,137.597,668.836,124.269,652.496,124.004 L652,124 Z" />
</vector>

Binary file not shown.

After

Width:  |  Height:  |  Size: 262 B

@ -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="@color/black" android:width="1dp"/>
<solid android:color="@color/white"/>
</shape>

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

@ -0,0 +1,46 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android">
<data>
</data>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="400dp"
android:background="@drawable/text_bg"
android:orientation="vertical">
<TextView
style="@style/text_info"
android:layout_width="match_parent"
android:layout_height="45dp"
android:paddingLeft="20dp"
android:paddingRight="20dp"
android:text="查看图片" />
<View
android:layout_width="match_parent"
android:layout_height="2dp"
android:background="#e1e1e1" />
<ImageView
android:id="@+id/dialog_img"
android:layout_width="380dp"
android:layout_gravity="center"
android:layout_height="wrap_content"/>
<Button
style="@style/button_style"
android:id="@+id/dialog_img_dis"
android:layout_width="200dp"
android:layout_height="50dp"
android:layout_marginTop="5dp"
android:layout_gravity="center"
android:layout_marginBottom="10dp"
android:text="关闭" />
</LinearLayout>
</layout>

@ -4,7 +4,7 @@
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="#e1e1e1" android:background="@color/activity_bg"
android:orientation="vertical" android:orientation="vertical"
tools:context=".ui.home.HomeFragment"> tools:context=".ui.home.HomeFragment">
@ -109,7 +109,17 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="55dp" android:layout_height="55dp"
android:layout_gravity="center" android:layout_gravity="center"
android:layout_weight="1"
android:text="扫码开锁" /> android:text="扫码开锁" />
<Button
android:id="@+id/home_san_close"
style="@style/button_20"
android:layout_weight="1"
android:layout_width="match_parent"
android:layout_height="55dp"
android:layout_gravity="center"
android:text="关锁" />
</LinearLayout> </LinearLayout>

@ -1,22 +1,306 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" <layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools">
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ui.slideshow.SlideshowFragment">
<TextView <data>
android:id="@+id/text_slideshow"
<variable
name="title"
type="String" />
<variable
name="adapter1"
type="com.example.beijingnopowercon.adapter.DisposalFileAdapter" />
<variable
name="vm"
type="com.example.beijingnopowercon.data.DeviceRepartBills" />
<variable
name="device"
type="com.example.beijingnopowercon.data.DeviceInfo" />
<import type="android.view.View" />
<variable
name="faultTypes"
type="java.util.List" />
</data>
<ScrollView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="match_parent"
android:layout_marginStart="8dp" android:background="@color/activity_bg">
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp" <LinearLayout
android:textAlignment="center" android:layout_width="match_parent"
android:textSize="20sp" android:layout_height="match_parent"
app:layout_constraintBottom_toBottomOf="parent" android:orientation="vertical"
app:layout_constraintEnd_toEndOf="parent" tools:context=".ui.slideshow.SlideshowFragment">
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="48dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="1dp">
<TextView
style="@style/text_title"
android:layout_width="90dp"
android:layout_height="wrap_content"
android:text="扫描设备:" />
<TextView
android:id="@+id/selectNameView"
style="@style/text_san"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginEnd="5dp"
android:layout_weight="1"
android:drawableEnd="@mipmap/ic_scan"
android:paddingEnd="5dp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginEnd="4dp">
<TextView
style="@style/text_title"
android:layout_width="90dp"
android:layout_height="wrap_content"
android:text="设备名称:" />
<TextView
style="@style/text_info"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@{device.deviceName}" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginEnd="4dp">
<TextView
style="@style/text_title"
android:layout_width="90dp"
android:layout_height="wrap_content"
android:text="设备类型:" />
<TextView
style="@style/text_info"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@{device.typeName}" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginEnd="4dp">
<TextView
style="@style/text_title"
android:layout_width="90dp"
android:layout_height="wrap_content"
android:text="设备位置:" />
<TextView
style="@style/text_info"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@{device.asName}" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginEnd="4dp"
android:background="@drawable/text_bg">
<TextView
style="@style/text_title"
android:layout_width="90dp"
android:layout_height="wrap_content"
android:background="@color/activity_bg"
android:text="故障类别:" />
<Spinner
android:id="@+id/bx_fault_spinner"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:entries="@{faultTypes}"
android:onItemSelected="@{vm.onItemSelected}"
android:spinnerMode="dropdown"
android:textAlignment="center" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginEnd="4dp"
android:background="@drawable/text_bg">
<TextView
style="@style/text_title"
android:layout_width="90dp"
android:layout_height="match_parent"
android:background="@color/activity_bg"
android:text="涉及操作:" />
<TextView
android:id="@+id/bx_des_ope"
style="@style/text_info"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="45dp"
android:drawableRight="@drawable/ic_xl"
android:paddingRight="8dp"
android:spinnerMode="dropdown"
android:text="@={vm.operation}"
android:textAlignment="center" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="65dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="4dp">
<TextView
style="@style/text_title"
android:layout_width="90dp"
android:layout_height="match_parent"
android:gravity="top|center"
android:text="故障情况:" />
<EditText
style="@style/text_san"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@={vm.remark}" />
</LinearLayout>
<!-- <LinearLayout
android:layout_width="match_parent"
android:layout_height="48dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="4dp">
<TextView
style="@style/text_title"
android:layout_width="90dp"
android:layout_height="wrap_content"
android:text="维修类型:" />
<RadioGroup
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<RadioButton
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:onClick="@{()->vm.repairTypeSelect(1)}"
android:text="内部维修" />
<RadioButton
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:onClick="@{()->vm.repairTypeSelect(2)}"
android:text="委外维修" />
</RadioGroup>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="48dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="4dp"
android:background="@drawable/text_bg"
android:visibility="@{vm.outsrcVis?View.VISIBLE: View.GONE}">
<TextView
style="@style/text_title"
android:layout_width="90dp"
android:layout_height="wrap_content"
android:background="@color/activity_bg"
android:text="外协单位:" />
<Spinner
android:layout_width="match_parent"
android:layout_height="match_parent"
android:entries="@{vm.outsourcingStringList}"
android:onItemSelected="@{vm.setOutsrcld}"
android:spinnerMode="dropdown"
android:textAlignment="center" />
</LinearLayout>-->
<TextView
style="@style/text_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:text="故障图片:" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@color/white"
android:orientation="horizontal">
<androidx.recyclerview.widget.RecyclerView
android:layout_width="match_parent"
android:layout_height="90dp"
android:layout_weight="1"
android:adapter="@{adapter1}"
android:orientation="horizontal"
android:paddingLeft="5dp"
android:paddingRight="5dp"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />
<ImageView
android:id="@+id/disposal_file_add"
android:layout_width="50dp"
android:layout_height="match_parent"
android:src="@mipmap/ic_add_file" />
</LinearLayout>
<Button
android:id="@+id/bx_submit_button"
style="@style/button_style"
android:layout_width="380dp"
android:layout_height="55dp"
android:layout_gravity="center"
android:layout_marginTop="8dp"
android:layout_marginBottom="10dp"
android:text="提交" />
</LinearLayout>
</ScrollView>
</layout>

@ -0,0 +1,39 @@
<?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">
<data>
<variable
name="vm"
type="com.example.beijingnopowercon.data.CheckInstanceFiles" />
<import type="android.view.View" />
</data>
<FrameLayout
android:layout_width="80dp"
android:layout_height="match_parent">
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="@mipmap/ic_picture_err"
android:padding="20dp"/>
<ImageView
android:id="@+id/dis_file"
android:paddingTop="5dp"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<ImageView
android:id="@+id/disposal_delect"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_gravity="right"
android:src="@mipmap/ic_cha2"
android:visibility="@{vm.state?View.VISIBLE:View.GONE}" />
</FrameLayout>
</layout>

@ -12,9 +12,9 @@
android:id="@+id/nav_gallery" android:id="@+id/nav_gallery"
android:icon="@drawable/ic_menu_record" android:icon="@drawable/ic_menu_record"
android:title="@string/menu_gallery" /> android:title="@string/menu_gallery" />
<!-- <item--> <item
<!-- android:id="@+id/nav_slideshow"--> android:id="@+id/nav_slideshow"
<!-- android:icon="@drawable/ic_menu_slideshow"--> android:icon="@drawable/ic_menu_slideshow"
<!-- android:title="" />--> android:title="@string/menu_slideshow" />
</group> </group>
</menu> </menu>

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" />
<foreground android:drawable="@drawable/ic_launcher_foreground" />
<monochrome android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" />
<foreground android:drawable="@drawable/ic_launcher_foreground" />
<monochrome android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 982 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.6 KiB

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string-array name="open">
<item>涂装</item>
<item>清洁</item>
<item>除锈</item>
<item>防腐处理</item>
<item>登高</item>
<item>脚手架搭设与拆除</item>
<item>泄漏点封堵</item>
<item>安全附件检修</item>
<item>电气维修</item>
<item>进入受限空间</item>
<item>起重吊装</item>
<item>拆卸与组装</item>
<item>管道维修</item>
<item>机械部件更换</item>
<item>设备调试</item>
<item>液压与气动系统维修</item>
<item>轴承拆装与维护</item>
<item>密封件更换</item>
<item>电缆敷设与接线</item>
<item>仪器仪表校准与维修</item>
</string-array>
</resources>

@ -11,4 +11,5 @@
<color name="yelow">#FFA726</color> <color name="yelow">#FFA726</color>
<color name="blue">#387BE7</color> <color name="blue">#387BE7</color>
<color name="blue_700">#1976D2</color> <color name="blue_700">#1976D2</color>
<color name="activity_bg">#F2F3F5</color>
</resources> </resources>

@ -9,7 +9,7 @@
<string name="menu_home">Home</string> <string name="menu_home">Home</string>
<string name="menu_gallery">借用记录</string> <string name="menu_gallery">借用记录</string>
<string name="menu_slideshow">Slideshow</string> <string name="menu_slideshow">故障报修</string>
<string name="title_activity_login">LoginActivity</string> <string name="title_activity_login">LoginActivity</string>
<string name="prompt_email">Email</string> <string name="prompt_email">Email</string>
<string name="prompt_password">Password</string> <string name="prompt_password">Password</string>

@ -94,4 +94,36 @@
<item name="android:windowEnterAnimation">@anim/dialog_in</item> <item name="android:windowEnterAnimation">@anim/dialog_in</item>
<item name="android:windowExitAnimation">@anim/dialog_out</item> <item name="android:windowExitAnimation">@anim/dialog_out</item>
</style> </style>
<style name="text_san">
<item name="android:textSize">18sp</item>
<item name="android:gravity">center</item>
<item name="android:textColor">@color/black</item>
<item name="android:background">@drawable/san_text_bg</item>
</style>
<style name="text_title">
<item name="android:textSize">18sp</item>
<item name="android:gravity">center</item>
<item name="android:minHeight">45dp</item>
<item name="android:layout_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:layout_gravity">center</item>
<item name="android:minHeight">45dp</item>
<item name="android:background">@drawable/text_bg</item>
</style>
<style name="button_style">
<item name="android:textStyle">bold</item>
<item name="android:textSize">20sp</item>
<item name="android:elevation">2dp</item>
<item name="android:textColor">@color/white</item>
<item name="android:letterSpacing">0.5</item>
</style>
</resources> </resources>

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<paths xmlns:android="http://schemas.android.com/apk/res/android">
<external-path
name="my_images"
path="."/>
<!-- <files-path name="my_images" path="images/"/>-->
</paths>
Loading…
Cancel
Save