Prechádzať zdrojové kódy

1. 新增待入库页面
2.实现待入库UI

JaycePC 8 mesiacov pred
rodič
commit
8c3a30a8a2
39 zmenil súbory, kde vykonal 1993 pridanie a 78 odobranie
  1. 9 2
      HttpCoreLibrary/src/main/java/com/rc/httpcore/HttpClient.kt
  2. 39 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/OkHttpUtils.java
  3. 57 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/locker/HxpCabinetAdminVo.java
  4. 168 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/locker/HxpCabinetDoorVo.java
  5. 43 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/locker/HxpCabinetListVo.java
  6. 82 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/locker/HxpCabinetLockVo.java
  7. 278 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/locker/HxpCabinetVo.java
  8. 36 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/client/HttpTool.java
  9. 0 1
      HttpCoreLibrary/src/main/java/com/rc/httpcore/interceptor/TokenHeaderInterceptor.kt
  10. 6 5
      app/build.gradle
  11. 7 0
      app/src/main/AndroidManifest.xml
  12. 4 0
      app/src/main/java/com/example/chemical/ChemicalApp.kt
  13. 13 12
      app/src/main/java/com/example/chemical/ui/MainActivity.kt
  14. 16 0
      app/src/main/java/com/example/chemical/ui/add/AddActivity.java
  15. 13 0
      app/src/main/java/com/example/chemical/ui/add/FragmentCallBack.java
  16. 37 0
      app/src/main/java/com/example/chemical/ui/add/LockerAdapter.java
  17. 212 0
      app/src/main/java/com/example/chemical/ui/add/PlanAddActivity.java
  18. 57 0
      app/src/main/java/com/example/chemical/ui/add/locker/DrawerUiBean.java
  19. 161 0
      app/src/main/java/com/example/chemical/ui/add/locker/LockerFragment.java
  20. 7 0
      app/src/main/res/drawable/locker_name_round.xml
  21. BIN
      app/src/main/res/drawable/save_locker_selected.9.png
  22. BIN
      app/src/main/res/drawable/save_locker_unselected.9.png
  23. 5 0
      app/src/main/res/drawable/selector_locker_drawer.xml
  24. 10 0
      app/src/main/res/layout/activity_add.xml
  25. 58 57
      app/src/main/res/layout/activity_main.xml
  26. 329 0
      app/src/main/res/layout/activity_plan_add.xml
  27. 239 0
      app/src/main/res/layout/fragment_locker.xml
  28. 7 0
      app/src/main/res/layout/fragment_locker1.xml
  29. 7 0
      app/src/main/res/layout/fragment_locker2.xml
  30. 92 0
      app/src/main/res/layout/item_in_storage.xml
  31. BIN
      app/src/main/res/mipmap-hdpi/bg.png
  32. BIN
      app/src/main/res/mipmap-hdpi/home_save.webp
  33. BIN
      app/src/main/res/mipmap-xhdpi/home_discard.png
  34. BIN
      app/src/main/res/mipmap-xhdpi/home_query.png
  35. BIN
      app/src/main/res/mipmap-xhdpi/img.png
  36. BIN
      app/src/main/res/mipmap-xhdpi/img_gh_smsb.png
  37. BIN
      app/src/main/res/mipmap-xhdpi/img_gh_smsb.webp
  38. BIN
      app/src/main/res/mipmap-xhdpi/locker.png
  39. 1 1
      config/config.gradle

+ 9 - 2
HttpCoreLibrary/src/main/java/com/rc/httpcore/HttpClient.kt

@@ -22,6 +22,7 @@ object HttpClient {
     const val TIMEOUT_DEFAULT = 10L
 
     private var mAppContext: Context? = null
+    private var okHttpClient: OkHttpClient? = null
 
     @Volatile
     var token: String? = null
@@ -61,7 +62,10 @@ object HttpClient {
             .build()
     }
 
-    private fun buildHttpClient(): OkHttpClient {
+    public fun buildHttpClient(): OkHttpClient {
+        if (null != okHttpClient) {
+            return okHttpClient!!
+        }
         val logPath = "/sdcard/logs/"
         val config = LogUtils.getConfig()
         // log开关控制
@@ -83,7 +87,8 @@ object HttpClient {
         config.setSaveDays(7)
 //        val httpLoggingInterceptor = HttpLoggingInterceptor(HttpLoggingInterceptorLog())//创建拦截对象
 //        httpLoggingInterceptor.level = HttpLoggingInterceptor.Level.BODY//这一句一定要记得写,否则没有数据输出
-        return OkHttpClient.Builder()
+
+        okHttpClient = OkHttpClient.Builder()
             .readTimeout(TIMEOUT_DEFAULT, TimeUnit.SECONDS) // 设置读取超时时间
             .connectTimeout(TIMEOUT_DEFAULT, TimeUnit.SECONDS) // 设置请求超时时间
             .writeTimeout(TIMEOUT_DEFAULT, TimeUnit.SECONDS) // 设置写入超时时间
@@ -96,6 +101,8 @@ object HttpClient {
             .retryOnConnectionFailure(true) // 设置出现错误进行重新连接
             .dns(OkHttpDNS())
             .build()
+
+        return okHttpClient!!
 //        if (!BuildConfig.DEBUG) {//debug模式下打印
 //        }else{
 //            return OkHttpClient.Builder()

+ 39 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/OkHttpUtils.java

@@ -0,0 +1,39 @@
+package com.rc.httpcore;
+
+import java.io.IOException;
+
+import okhttp3.Call;
+import okhttp3.MediaType;
+import okhttp3.OkHttpClient;
+import okhttp3.Request;
+import okhttp3.RequestBody;
+import okhttp3.Response;
+
+public class OkHttpUtils {
+
+    private static final OkHttpClient client = HttpClient.INSTANCE.buildHttpClient();
+    private static final MediaType JSON = MediaType.parse("application/json; charset=utf-8");
+
+    private OkHttpUtils() {
+    }
+
+    // 同步 GET 请求
+    public static Response getSync(String url) throws IOException {
+        Request request = new Request.Builder()
+                .url(url)
+                .build();
+        Call call = client.newCall(request);
+        return call.execute();
+    }
+
+    // 同步 POST 请求
+    public static Response postSync(String url, String json) throws IOException {
+        RequestBody body = RequestBody.create(JSON, json);
+        Request request = new Request.Builder()
+                .url(url)
+                .post(body)
+                .build();
+        Call call = client.newCall(request);
+        return call.execute();
+    }
+}

+ 57 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/locker/HxpCabinetAdminVo.java

@@ -0,0 +1,57 @@
+package com.rc.httpcore.bean.locker;
+
+public class HxpCabinetAdminVo {
+    // ("柜门id")
+    private long doorId;
+
+    // ("用户id")
+    private long userId;
+
+    // ("用户名")
+    private String userName;
+
+    // ("实验室id")
+    private long subId;
+
+    public long getDoorId() {
+        return doorId;
+    }
+
+    public void setDoorId(long doorId) {
+        this.doorId = doorId;
+    }
+
+    public long getUserId() {
+        return userId;
+    }
+
+    public void setUserId(long userId) {
+        this.userId = userId;
+    }
+
+    public String getUserName() {
+        return userName;
+    }
+
+    public void setUserName(String userName) {
+        this.userName = userName;
+    }
+
+    public long getSubId() {
+        return subId;
+    }
+
+    public void setSubId(long subId) {
+        this.subId = subId;
+    }
+
+    @Override
+    public String toString() {
+        return "HxpCabinetAdminVo{" +
+                "doorId=" + doorId +
+                ", userId=" + userId +
+                ", userName='" + userName + '\'' +
+                ", subId=" + subId +
+                '}';
+    }
+}

+ 168 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/locker/HxpCabinetDoorVo.java

@@ -0,0 +1,168 @@
+package com.rc.httpcore.bean.locker;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class HxpCabinetDoorVo {
+    // ("主键id")
+    private long doorId;
+
+    // ("关键机柜id")
+    private long cabinetId;
+
+    // ("柜门名称")
+    private String doorName;
+
+    // ("门里面的层数")
+    private int doorLayers;
+
+    // ("机柜唯一id,用于化学品入库绑定唯一编码")
+    private long doorUniqueId;
+
+    // ("开始方式:1无锁,2是智能锁,3是钥匙柜")
+    private int unlockingMethod;
+
+    // ("化学品库存数量")
+    private int stockNum;
+
+    // ("化学品使用数量")
+    private int useNum;
+
+    // ("是否管控")
+    private boolean isControl;
+
+    // ("是否双人认证")
+    private boolean verify;
+
+    // ("是否开启关闭")
+    private boolean openOrClose = false;
+
+    // ("管理员列表")
+    private List<HxpCabinetAdminVo> cabinetAdminVoList = new ArrayList<>();
+
+    // ("机柜锁列表")
+    private List<HxpCabinetLockVo> cabinetLockVoList = new ArrayList<>();
+
+    public long getDoorId() {
+        return doorId;
+    }
+
+    public void setDoorId(long doorId) {
+        this.doorId = doorId;
+    }
+
+    public long getCabinetId() {
+        return cabinetId;
+    }
+
+    public void setCabinetId(long cabinetId) {
+        this.cabinetId = cabinetId;
+    }
+
+    public String getDoorName() {
+        return doorName;
+    }
+
+    public void setDoorName(String doorName) {
+        this.doorName = doorName;
+    }
+
+    public int getDoorLayers() {
+        return doorLayers;
+    }
+
+    public void setDoorLayers(int doorLayers) {
+        this.doorLayers = doorLayers;
+    }
+
+    public long getDoorUniqueId() {
+        return doorUniqueId;
+    }
+
+    public void setDoorUniqueId(long doorUniqueId) {
+        this.doorUniqueId = doorUniqueId;
+    }
+
+    public int getUnlockingMethod() {
+        return unlockingMethod;
+    }
+
+    public void setUnlockingMethod(int unlockingMethod) {
+        this.unlockingMethod = unlockingMethod;
+    }
+
+    public int getStockNum() {
+        return stockNum;
+    }
+
+    public void setStockNum(int stockNum) {
+        this.stockNum = stockNum;
+    }
+
+    public int getUseNum() {
+        return useNum;
+    }
+
+    public void setUseNum(int useNum) {
+        this.useNum = useNum;
+    }
+
+    public boolean isControl() {
+        return isControl;
+    }
+
+    public void setControl(boolean control) {
+        isControl = control;
+    }
+
+    public boolean isVerify() {
+        return verify;
+    }
+
+    public void setVerify(boolean verify) {
+        this.verify = verify;
+    }
+
+    public boolean isOpenOrClose() {
+        return openOrClose;
+    }
+
+    public void setOpenOrClose(boolean openOrClose) {
+        this.openOrClose = openOrClose;
+    }
+
+    public List<HxpCabinetAdminVo> getCabinetAdminVoList() {
+        return cabinetAdminVoList;
+    }
+
+    public void setCabinetAdminVoList(List<HxpCabinetAdminVo> cabinetAdminVoList) {
+        this.cabinetAdminVoList = cabinetAdminVoList;
+    }
+
+    public List<HxpCabinetLockVo> getCabinetLockVoList() {
+        return cabinetLockVoList;
+    }
+
+    public void setCabinetLockVoList(List<HxpCabinetLockVo> cabinetLockVoList) {
+        this.cabinetLockVoList = cabinetLockVoList;
+    }
+
+    @Override
+    public String toString() {
+        return "HxpCabinetDoorVo{" +
+                "doorId=" + doorId +
+                ", cabinetId=" + cabinetId +
+                ", doorName='" + doorName + '\'' +
+                ", doorLayers=" + doorLayers +
+                ", doorUniqueId=" + doorUniqueId +
+                ", unlockingMethod=" + unlockingMethod +
+                ", stockNum=" + stockNum +
+                ", useNum=" + useNum +
+                ", isControl=" + isControl +
+                ", verify=" + verify +
+                ", openOrClose=" + openOrClose +
+                ", cabinetAdminVoList=" + cabinetAdminVoList +
+                ", cabinetLockVoList=" + cabinetLockVoList +
+                '}';
+    }
+}

+ 43 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/locker/HxpCabinetListVo.java

@@ -0,0 +1,43 @@
+package com.rc.httpcore.bean.locker;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class HxpCabinetListVo {
+    private int code;
+    private String message;
+    private List<HxpCabinetVo> data = new ArrayList<>();
+
+    public int getCode() {
+        return code;
+    }
+
+    public void setCode(int code) {
+        this.code = code;
+    }
+
+    public String getMessage() {
+        return message;
+    }
+
+    public void setMessage(String message) {
+        this.message = message;
+    }
+
+    public List<HxpCabinetVo> getData() {
+        return data;
+    }
+
+    public void setData(List<HxpCabinetVo> data) {
+        this.data = data;
+    }
+
+    @Override
+    public String toString() {
+        return "HxpCabinetListVo{" +
+                "code=" + code +
+                ", message='" + message + '\'' +
+                ", data=" + data +
+                '}';
+    }
+}

+ 82 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/locker/HxpCabinetLockVo.java

@@ -0,0 +1,82 @@
+package com.rc.httpcore.bean.locker;
+
+public class HxpCabinetLockVo {
+    // ("柜门id")
+    private long doorId;
+
+    // ("柜锁id")
+    private long lockId;
+
+    // ("锁类型:2是智能锁,3是钥匙柜")
+    private int unlockingMethod;
+
+    // ("锁名称")
+    private String lockName;
+
+    // ("锁编号")
+    private String lockNum;
+
+    // ("柜格编号:1,2,3 参考数据")
+    private String cabinetLattice;
+
+
+    public long getDoorId() {
+        return doorId;
+    }
+
+    public void setDoorId(long doorId) {
+        this.doorId = doorId;
+    }
+
+    public long getLockId() {
+        return lockId;
+    }
+
+    public void setLockId(long lockId) {
+        this.lockId = lockId;
+    }
+
+    public int getUnlockingMethod() {
+        return unlockingMethod;
+    }
+
+    public void setUnlockingMethod(int unlockingMethod) {
+        this.unlockingMethod = unlockingMethod;
+    }
+
+    public String getLockName() {
+        return lockName;
+    }
+
+    public void setLockName(String lockName) {
+        this.lockName = lockName;
+    }
+
+    public String getLockNum() {
+        return lockNum;
+    }
+
+    public void setLockNum(String lockNum) {
+        this.lockNum = lockNum;
+    }
+
+    public String getCabinetLattice() {
+        return cabinetLattice;
+    }
+
+    public void setCabinetLattice(String cabinetLattice) {
+        this.cabinetLattice = cabinetLattice;
+    }
+
+    @Override
+    public String toString() {
+        return "HxpCabinetLockVo{" +
+                "doorId=" + doorId +
+                ", lockId=" + lockId +
+                ", unlockingMethod=" + unlockingMethod +
+                ", lockName='" + lockName + '\'' +
+                ", lockNum='" + lockNum + '\'' +
+                ", cabinetLattice='" + cabinetLattice + '\'' +
+                '}';
+    }
+}

+ 278 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/locker/HxpCabinetVo.java

@@ -0,0 +1,278 @@
+package com.rc.httpcore.bean.locker;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class HxpCabinetVo {
+    // ("机柜id")
+    private long cabinetId;
+    // ("机柜名称")
+    private String cabinetName;
+    // ("学院id")
+    private long deptId;
+    // ("学院名称")
+    private String deptName;
+    // ("楼栋id")
+    private long buildId;
+    // ("楼栋名称")
+    private String buildName;
+    // ("楼层id")
+    private long floorId;
+    // ("楼层名称")
+    private String floorName;
+    // ("实验室id")
+    private long subId;
+    // ("实验室名称")
+    private String subName;
+    // ("房间编号")
+    private String roomNum;
+    // ("安全员信息")
+    private String safeInfo;
+    // ("摄像头id")
+    private long cameraId;
+    // ("采集器id")
+    private long collectorId;
+    // ("柜门数量")
+    private int doorNum;
+    // ("柜锁数量")
+    private int lockNum;
+    // ("化学品数量")
+    private int chemicalNum;
+    // ("创建人id")
+    private long createBy;
+    // ("创建人姓名")
+    private String createName;
+    // ("创建时间")
+    private String createTime;
+    // ("修改人id")
+    private long updateBy;
+    // ("修改人姓名")
+    private String updateName;
+    // ("修改时间")
+    private String updateTime;
+    // ("柜门列表")
+    private List<HxpCabinetDoorVo> cabinetDoorVoList = new ArrayList<>();
+
+    public long getCabinetId() {
+        return cabinetId;
+    }
+
+    public void setCabinetId(long cabinetId) {
+        this.cabinetId = cabinetId;
+    }
+
+    public String getCabinetName() {
+        return cabinetName;
+    }
+
+    public void setCabinetName(String cabinetName) {
+        this.cabinetName = cabinetName;
+    }
+
+    public long getDeptId() {
+        return deptId;
+    }
+
+    public void setDeptId(long deptId) {
+        this.deptId = deptId;
+    }
+
+    public String getDeptName() {
+        return deptName;
+    }
+
+    public void setDeptName(String deptName) {
+        this.deptName = deptName;
+    }
+
+    public long getBuildId() {
+        return buildId;
+    }
+
+    public void setBuildId(long buildId) {
+        this.buildId = buildId;
+    }
+
+    public String getBuildName() {
+        return buildName;
+    }
+
+    public void setBuildName(String buildName) {
+        this.buildName = buildName;
+    }
+
+    public long getFloorId() {
+        return floorId;
+    }
+
+    public void setFloorId(long floorId) {
+        this.floorId = floorId;
+    }
+
+    public String getFloorName() {
+        return floorName;
+    }
+
+    public void setFloorName(String floorName) {
+        this.floorName = floorName;
+    }
+
+    public long getSubId() {
+        return subId;
+    }
+
+    public void setSubId(long subId) {
+        this.subId = subId;
+    }
+
+    public String getSubName() {
+        return subName;
+    }
+
+    public void setSubName(String subName) {
+        this.subName = subName;
+    }
+
+    public String getRoomNum() {
+        return roomNum;
+    }
+
+    public void setRoomNum(String roomNum) {
+        this.roomNum = roomNum;
+    }
+
+    public String getSafeInfo() {
+        return safeInfo;
+    }
+
+    public void setSafeInfo(String safeInfo) {
+        this.safeInfo = safeInfo;
+    }
+
+    public long getCameraId() {
+        return cameraId;
+    }
+
+    public void setCameraId(long cameraId) {
+        this.cameraId = cameraId;
+    }
+
+    public long getCollectorId() {
+        return collectorId;
+    }
+
+    public void setCollectorId(long collectorId) {
+        this.collectorId = collectorId;
+    }
+
+    public int getDoorNum() {
+        return doorNum;
+    }
+
+    public void setDoorNum(int doorNum) {
+        this.doorNum = doorNum;
+    }
+
+    public int getLockNum() {
+        return lockNum;
+    }
+
+    public void setLockNum(int lockNum) {
+        this.lockNum = lockNum;
+    }
+
+    public int getChemicalNum() {
+        return chemicalNum;
+    }
+
+    public void setChemicalNum(int chemicalNum) {
+        this.chemicalNum = chemicalNum;
+    }
+
+    public long getCreateBy() {
+        return createBy;
+    }
+
+    public void setCreateBy(long createBy) {
+        this.createBy = createBy;
+    }
+
+    public String getCreateName() {
+        return createName;
+    }
+
+    public void setCreateName(String createName) {
+        this.createName = createName;
+    }
+
+    public long getUpdateBy() {
+        return updateBy;
+    }
+
+    public void setUpdateBy(long updateBy) {
+        this.updateBy = updateBy;
+    }
+
+    public String getUpdateName() {
+        return updateName;
+    }
+
+    public void setUpdateName(String updateName) {
+        this.updateName = updateName;
+    }
+
+
+    public List<HxpCabinetDoorVo> getCabinetDoorVoList() {
+        return cabinetDoorVoList;
+    }
+
+    public void setCabinetDoorVoList(List<HxpCabinetDoorVo> cabinetDoorVoList) {
+        this.cabinetDoorVoList = cabinetDoorVoList;
+    }
+
+    public String getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(String createTime) {
+        this.createTime = createTime;
+    }
+
+    public String getUpdateTime() {
+        return updateTime;
+    }
+
+    public void setUpdateTime(String updateTime) {
+        this.updateTime = updateTime;
+    }
+
+    @Override
+    public String toString() {
+        return "HxpCabinetVo{" +
+                "cabinetId=" + cabinetId +
+                ", cabinetName='" + cabinetName + '\'' +
+                ", deptId=" + deptId +
+                ", deptName='" + deptName + '\'' +
+                ", buildId=" + buildId +
+                ", buildName='" + buildName + '\'' +
+                ", floorId=" + floorId +
+                ", floorName='" + floorName + '\'' +
+                ", subId=" + subId +
+                ", subName='" + subName + '\'' +
+                ", roomNum='" + roomNum + '\'' +
+                ", safeInfo='" + safeInfo + '\'' +
+                ", cameraId=" + cameraId +
+                ", collectorId=" + collectorId +
+                ", doorNum=" + doorNum +
+                ", lockNum=" + lockNum +
+                ", chemicalNum=" + chemicalNum +
+                ", createBy=" + createBy +
+                ", createName='" + createName + '\'' +
+                ", createTime='" + createTime + '\'' +
+                ", updateBy=" + updateBy +
+                ", updateName='" + updateName + '\'' +
+                ", updateTime='" + updateTime + '\'' +
+                ", cabinetDoorVoList=" + cabinetDoorVoList +
+                '}';
+    }
+}

+ 36 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/client/HttpTool.java

@@ -0,0 +1,36 @@
+package com.rc.httpcore.client;
+
+import android.net.Uri;
+import android.util.Log;
+
+import com.blankj.utilcode.util.LogUtils;
+import com.rc.httpcore.HttpConfig;
+import com.rc.httpcore.OkHttpUtils;
+
+import java.io.IOException;
+
+import okhttp3.Response;
+
+public final class HttpTool {
+
+    public static String checkUrl(String url) {
+        try {
+            String uriStr = url;
+            if (!url.matches("https?://.*") && !url.matches("http?://.*")) {
+                uriStr = Uri.parse(HttpConfig.Companion.getAPI_BASE_URL() + url).toString();
+            }
+            return uriStr;
+        } catch (Exception e) {
+            LogUtils.e(Log.getStackTraceString(e));
+            return url;
+        }
+    }
+
+    /**
+     * 获取柜子信息
+     */
+    public static Response getCabinetList(String labId) throws IOException {
+        return OkHttpUtils.getSync(HttpConfig.Companion.getAPI_BASE_URL() + "chemical/aio/getCabinetList?subId=" + labId);
+    }
+
+}

+ 0 - 1
HttpCoreLibrary/src/main/java/com/rc/httpcore/interceptor/TokenHeaderInterceptor.kt

@@ -25,7 +25,6 @@ class TokenHeaderInterceptor : Interceptor {
             requestBuilder.addHeader("authorization", HttpClient.token!!)
             Log.d("===========", HttpClient.token!!)
             LogUtils.d("Token", HttpClient.token!!)
-//            requestBuilder.addHeader("authorization", "2cb6ac5a-33e7-404f-a3a7-145fc7420763")
         }
 
         requestBuilder

+ 6 - 5
app/build.gradle

@@ -20,11 +20,11 @@ android {
             abiFilters "armeabi-v7a"/*, "arm64-v8a", "x86"*/
         }
     }
-//    sourceSets {
-//        main {
-//            jniLibs.srcDirs = ['libs']
-//        }
-//    }
+    sourceSets {
+        main {
+            jniLibs.srcDirs = ['libs']
+        }
+    }
     signingConfigs {
         signing {
             keyAlias 'winds'
@@ -134,6 +134,7 @@ dependencies {
     implementation 'com.github.getActivity:XXPermissions:20.0'
     implementation "com.kongzue.dialogx:DialogX:0.0.49"
     implementation 'com.blankj:utilcodex:1.31.1'
+    implementation 'androidx.activity:activity:1.9.3'
 
 
 }

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

@@ -73,6 +73,13 @@
         android:theme="@style/Theme.AppFullTheme"
         android:usesCleartextTraffic="true"
         tools:targetApi="m">
+        <activity
+            android:name=".ui.add.AddActivity"
+            android:exported="false" />
+        <activity
+            android:name=".ui.add.PlanAddActivity"
+            android:exported="false" />
+
         <meta-data
             android:name="ScopedStorage"
             android:value="true" />

+ 4 - 0
app/src/main/java/com/example/chemical/ChemicalApp.kt

@@ -25,10 +25,14 @@ class ChemicalApp : Application() {
 
         @JvmField
         var userData: UserData? = null
+        @JvmField
         var subjectId: String? = null   //实验室id
+        @JvmField
         var subjectName: String? = null //实验室name
+        @JvmField
         var confs: ConfigBean? = null   //基础信息以及 双人 认证方式
         var labInfo: LabInfo? = null    //基础信息以及 双人 认证方式
+        @JvmField
         var subRoom: String? = null     //房间号
         var administrators = false      //是否是校院级管理员  管控类的仅校级管理员或院级管理员可操作  新增入库  操作管控or非管控
         var responsibles = false        //是否是 责任人      实验室负责人或安全责任人、柜门管理员   新增入库  只能操作非管控

+ 13 - 12
app/src/main/java/com/example/chemical/ui/MainActivity.kt

@@ -27,6 +27,7 @@ import com.example.chemical.databinding.ActivityMainBinding
 import com.example.chemical.receiver.TimeTickReceiver
 import com.example.chemical.receiver.UsbReceiver
 import com.example.chemical.ui.adapter.CabinetAdapter
+import com.example.chemical.ui.add.PlanAddActivity
 import com.example.chemical.ui.discard.LedgerActivity
 import com.example.chemical.ui.discard.WasteChemicalsActivity
 import com.example.chemical.ui.inquiry.InquiryActivity
@@ -34,13 +35,11 @@ import com.example.chemical.ui.login.FacialCardActivity
 import com.example.chemical.ui.login.FacialLoginActivity
 import com.example.chemical.ui.login.ScanLoginActivity
 import com.example.chemical.ui.login.SwipeActivity
-import com.example.chemical.ui.newly.AddedChemicalsActivity
 import com.example.chemical.ui.still.ChemicalsAlsoActivity
 import com.example.chemical.ui.still.MsdsActivity
 import com.example.chemical.ui.uses.UseActivity
 import com.example.chemical.ui.uses.WarningEventsActivity
 import com.example.chemical.ui.warehousing.ChemicalLabelingActivity
-import com.example.chemical.ui.warehousing.WarehousingActivity
 import com.example.chemical.utils.RelativeLayoutDebouncer
 import com.example.chemical.utils.SharedPreferencesHelper
 import com.example.chemical.utils.TimeUpdater
@@ -114,13 +113,14 @@ class MainActivity : RcBaseActivity<ActivityMainBinding>() {
         timeUpdater.startUpdating()
     }
 
+    var timeTickReceiver: TimeTickReceiver = TimeTickReceiver()
 
     //必须在创建时注册信息
     override fun onCreate(savedInstanceState: Bundle?) {
         super.onCreate(savedInstanceState)
 
         // 监听分钟广播
-        registerReceiver(TimeTickReceiver(), IntentFilter(Intent.ACTION_TIME_TICK))
+        registerReceiver(timeTickReceiver, IntentFilter(Intent.ACTION_TIME_TICK))
 
 
 //        hPrints = AutoReplyPrint.INSTANCE.CP_Port_OpenUsb("VID:0x0FE6,PID:0x811E", 1)
@@ -254,7 +254,7 @@ class MainActivity : RcBaseActivity<ActivityMainBinding>() {
             //新增
             if (ChemicalApp.userData != null) {
                 if (ChemicalApp.administrators || ChemicalApp.responsibles) {
-                    UiManager.switcher(this, AddedChemicalsActivity::class.java)
+                    UiManager.switcher(this, PlanAddActivity::class.java)
                 } else {
                     customDialogView(2, "当前人员无权限")
                 }
@@ -264,14 +264,14 @@ class MainActivity : RcBaseActivity<ActivityMainBinding>() {
         }
 
 
-        //待入库
-        viewBinding.reSto.setOnClickListener {
-            if (ChemicalApp.userData != null) {
-                UiManager.switcher(this, WarehousingActivity::class.java)
-            } else {
-                basicConfLog()
-            }
-        }
+        //待入库 TODO 暂时隐藏
+//        viewBinding.reSto.setOnClickListener {
+//            if (ChemicalApp.userData != null) {
+//                UiManager.switcher(this, WarehousingActivity::class.java)
+//            } else {
+//                basicConfLog()
+//            }
+//        }
 
         //废弃
         viewBinding.reDis.setOnClickListener {
@@ -532,6 +532,7 @@ class MainActivity : RcBaseActivity<ActivityMainBinding>() {
 
     override fun onDestroy() {
         super.onDestroy()
+        unregisterReceiver(timeTickReceiver)
         try {
             // 停止定时更新
             timeUpdater.stopUpdating()

+ 16 - 0
app/src/main/java/com/example/chemical/ui/add/AddActivity.java

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

+ 13 - 0
app/src/main/java/com/example/chemical/ui/add/FragmentCallBack.java

@@ -0,0 +1,13 @@
+package com.example.chemical.ui.add;
+
+import com.rc.httpcore.bean.locker.HxpCabinetVo;
+
+public interface FragmentCallBack {
+    /**
+     * 当前选中的是哪个柜子的哪层
+     *
+     * @param hxpCabinetVo 柜子信息
+     * @param position     选中的是哪层
+     */
+    void onSelected(HxpCabinetVo hxpCabinetVo, int position);
+}

+ 37 - 0
app/src/main/java/com/example/chemical/ui/add/LockerAdapter.java

@@ -0,0 +1,37 @@
+package com.example.chemical.ui.add;
+
+import androidx.annotation.NonNull;
+import androidx.fragment.app.Fragment;
+import androidx.fragment.app.FragmentActivity;
+import androidx.viewpager2.adapter.FragmentStateAdapter;
+
+import com.example.chemical.ui.add.locker.LockerFragment;
+import com.rc.httpcore.bean.locker.HxpCabinetVo;
+
+import java.util.LinkedList;
+import java.util.List;
+
+public class LockerAdapter extends FragmentStateAdapter {
+    private List<Fragment> fragments = new LinkedList<>();
+    private List<HxpCabinetVo> hxpCabinetVoList;
+
+    public LockerAdapter(@NonNull FragmentActivity fragmentActivity, List<HxpCabinetVo> hxpCabinetVoList, FragmentCallBack fragmentCallBack) {
+        super(fragmentActivity);
+        for (int i = 0; i < hxpCabinetVoList.size(); i++) {
+            HxpCabinetVo hxpCabinetVo = hxpCabinetVoList.get(i);
+            fragments.add(new LockerFragment(hxpCabinetVo, fragmentCallBack));
+        }
+    }
+
+    @NonNull
+    @Override
+    public Fragment createFragment(int position) {
+        return fragments.get(position);
+    }
+
+    @Override
+    public int getItemCount() {
+        return fragments.size();
+    }
+
+}

+ 212 - 0
app/src/main/java/com/example/chemical/ui/add/PlanAddActivity.java

@@ -0,0 +1,212 @@
+package com.example.chemical.ui.add;
+
+import android.os.Bundle;
+import android.text.TextUtils;
+import android.util.Log;
+import android.view.KeyEvent;
+import android.view.View;
+
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+import androidx.viewpager2.widget.ViewPager2;
+
+import com.blankj.utilcode.util.GsonUtils;
+import com.blankj.utilcode.util.LogUtils;
+import com.blankj.utilcode.util.ThreadUtils;
+import com.blankj.utilcode.util.TimeUtils;
+import com.bumptech.glide.Glide;
+import com.example.chemical.ChemicalApp;
+import com.example.chemical.databinding.ActivityPlanAddBinding;
+import com.example.chemical.databinding.ActivityPlanAddBinding;
+import com.example.chemical.receiver.ScanKeyEventHelper;
+import com.example.chemical.ui.SplashActivity;
+import com.example.chemical.ui.common.BaseCountDownActivity;
+import com.example.chemical.utils.UiManager;
+import com.rc.httpcore.HttpConfig;
+import com.rc.httpcore.bean.ChemicalInfoBean;
+import com.rc.httpcore.bean.locker.HxpCabinetListVo;
+import com.rc.httpcore.bean.locker.HxpCabinetVo;
+import com.rc.httpcore.client.ApiRepository;
+import com.rc.httpcore.client.HttpTool;
+import com.rc.httpcore.exception.NetException;
+
+import java.text.SimpleDateFormat;
+import java.util.List;
+import java.util.Locale;
+
+import io.reactivex.functions.Consumer;
+import kotlin.Unit;
+import kotlin.jvm.functions.Function1;
+import okhttp3.Response;
+
+/**
+ * 待录入页面
+ */
+public class PlanAddActivity extends BaseCountDownActivity<ActivityPlanAddBinding> {
+
+    private ActivityPlanAddBinding binding;
+    // 柜子fragmentAdapter
+    private LockerAdapter lockerAdapter;
+    // 二维码/条形码扫描工具
+    private ScanKeyEventHelper scanKeyEventHelper;
+    // 实验室基本信息
+    private ChemicalInfoBean chemicalInfo;
+    // 实验室所有柜子信息
+    private List<HxpCabinetVo> allCabinetVoList;
+
+    // 待录入化学品信息
+//    private Map<Long,List<>>
+
+    @NonNull
+    @Override
+    protected ActivityPlanAddBinding createViewBinding() {
+        return binding = ActivityPlanAddBinding.inflate(getLayoutInflater());
+    }
+
+    @Override
+    protected void initViews(@Nullable Bundle savedInstanceState) {
+        super.initViews(savedInstanceState);
+        binding.lockerVP2.registerOnPageChangeCallback(new ViewPager2.OnPageChangeCallback() {
+            @Override
+            public void onPageSelected(int position) {
+                super.onPageSelected(position);
+                binding.countTV.setText((position + 1) + "/" + lockerAdapter.getItemCount());
+            }
+        });
+        binding.nextBT.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View view) {
+                binding.lockerVP2.setCurrentItem(binding.lockerVP2.getCurrentItem() + 1, true);
+            }
+        });
+        binding.lastBT.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View view) {
+                binding.lockerVP2.setCurrentItem(binding.lockerVP2.getCurrentItem() - 1, true);
+            }
+        });
+
+        scanKeyEventHelper = new ScanKeyEventHelper(new Function1<String, Unit>() {
+            @Override
+            public Unit invoke(String s) {
+                Log.d("结果", s);
+                return null;
+            }
+        });
+    }
+
+    @Override
+    protected void initData() {
+        super.initData();
+        // 日期
+        binding.nowTime.setText(TimeUtils.getNowString(new SimpleDateFormat("MM月dd日 EEEE ", Locale.getDefault())));
+        // 用户
+        Glide.with(this).load(HttpConfig.Companion.getAPI_BASE_IMG_URL() + ChemicalApp.userData.getAvatar()).into(binding.imageName);
+        String userName = ChemicalApp.userData.getUserName();
+        binding.tvName.setText(TextUtils.isEmpty(userName) ? "" : userName);
+        // 实验室logo
+        Glide.with(this).load(HttpConfig.Companion.getAPI_BASE_IMG_URL() + ChemicalApp.confs.getCircularLogo()).into(binding.image);
+        // 实验室名称
+        String subName = ChemicalApp.subjectName;
+        subName = TextUtils.isEmpty(subName) ? "" : subName;
+        // 房间号
+        String roomNum = ChemicalApp.subRoom;
+        roomNum = TextUtils.isEmpty(roomNum) ? "" : roomNum;
+        binding.deptName.setText(subName + "-" + roomNum);
+        // 退出
+        binding.tvOutLogin.setOnClickListener(v -> callLogoutApi(aBoolean -> {
+            ChemicalApp.userData = null;
+            ChemicalApp.subjectId = null;
+            UiManager.INSTANCE.switcherCashier(PlanAddActivity.this, SplashActivity.class);
+            return null;
+        }));
+
+        //获取实验室基本信息
+        getLabInfo();
+
+    }
+
+    /**
+     * 获取实验室基本信息
+     */
+    private void getLabInfo() {
+        showLoading("加载中...", false);
+        // 实验室基本信息
+        addDisposable(ApiRepository.INSTANCE.getRelList(ChemicalApp.subjectId).subscribe(new Consumer<ChemicalInfoBean>() {
+            @Override
+            public void accept(ChemicalInfoBean chemicalInfoBean) throws Exception {
+                chemicalInfo = chemicalInfoBean;
+                // 获取实验室柜子信息
+                ThreadUtils.executeByCached(new ThreadUtils.SimpleTask<List<HxpCabinetVo>>() {
+                    @Override
+                    public List<HxpCabinetVo> doInBackground() throws Throwable {
+                        Response response = HttpTool.getCabinetList(chemicalInfoBean.getSubId());
+                        if (response.isSuccessful()) {
+                            String json = response.body().string();
+                            HxpCabinetListVo hxpCabinetListVo = GsonUtils.fromJson(json, HxpCabinetListVo.class);
+                            if (hxpCabinetListVo.getCode() == 200) {
+                                return hxpCabinetListVo.getData();
+                            } else {
+                                throw new NetException("" + hxpCabinetListVo.getCode(), hxpCabinetListVo.getMessage());
+                            }
+                        } else {
+                            throw new NetException("" + response.code(), response.message());
+                        }
+                    }
+
+                    @Override
+                    public void onSuccess(List<HxpCabinetVo> hxpCabinetVoList) {
+                        dismissLoading();
+                        if (null != hxpCabinetVoList && !hxpCabinetVoList.isEmpty()) {
+                            lockerAdapter = new LockerAdapter(PlanAddActivity.this, allCabinetVoList = hxpCabinetVoList, fragmentCallBack);
+                            binding.lockerVP2.setAdapter(lockerAdapter);
+
+                        } else {
+                            showToast("未找到化学品柜!");
+                        }
+                    }
+
+                    @Override
+                    public void onFail(Throwable t) {
+                        super.onFail(t);
+                        showNetError(t);
+                        dismissLoading();
+                        LogUtils.d(ThreadUtils.isMainThread());
+                    }
+                });
+            }
+        }, new Consumer<Throwable>() {
+            @Override
+            public void accept(Throwable throwable) throws Exception {
+                LogUtils.e(Log.getStackTraceString(throwable));
+                dismissLoading();
+                showNetError(throwable);
+            }
+        }));
+    }
+
+    @Override
+    public boolean dispatchKeyEvent(KeyEvent event) {
+        scanKeyEventHelper.analysisKeyEvent(event);
+        return super.dispatchKeyEvent(event);
+    }
+
+    FragmentCallBack fragmentCallBack = new FragmentCallBack() {
+        /**
+         * 柜层被选中
+         * @param hxpCabinetVo 柜子信息
+         * @param position     选中的是哪层
+         */
+        @Override
+        public void onSelected(HxpCabinetVo hxpCabinetVo, int position) {
+
+        }
+    };
+
+    @Override
+    protected void onDestroy() {
+        fragmentCallBack = null;
+        super.onDestroy();
+    }
+
+}

+ 57 - 0
app/src/main/java/com/example/chemical/ui/add/locker/DrawerUiBean.java

@@ -0,0 +1,57 @@
+package com.example.chemical.ui.add.locker;
+
+import android.widget.RadioButton;
+import android.widget.TextView;
+
+public class DrawerUiBean {
+    private RadioButton radioButton;
+    private TextView textView;
+    private boolean isVisible;
+    private String drawer;// 层数
+
+    public DrawerUiBean(RadioButton radioButton, TextView textView, boolean isVisible) {
+        this.radioButton = radioButton;
+        this.textView = textView;
+        this.isVisible = isVisible;
+    }
+
+    public RadioButton getRadioButton() {
+        return radioButton;
+    }
+
+    public void setRadioButton(RadioButton radioButton) {
+        this.radioButton = radioButton;
+    }
+
+    public TextView getTextView() {
+        return textView;
+    }
+
+    public void setTextView(TextView textView) {
+        this.textView = textView;
+    }
+
+    public boolean isVisible() {
+        return isVisible;
+    }
+
+    public void setVisible(boolean visible) {
+        isVisible = visible;
+    }
+
+    public String getDrawer() {
+        return drawer;
+    }
+
+    public void setDrawer(String drawer) {
+        this.drawer = drawer;
+    }
+
+    @Override
+    public String toString() {
+        return "DrawerUiBean{" +
+                "drawer='" + drawer + '\'' +
+                ", isVisible=" + isVisible +
+                '}';
+    }
+}

+ 161 - 0
app/src/main/java/com/example/chemical/ui/add/locker/LockerFragment.java

@@ -0,0 +1,161 @@
+package com.example.chemical.ui.add.locker;
+
+import android.os.Bundle;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.RadioButton;
+import android.widget.RadioGroup;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+import androidx.fragment.app.Fragment;
+
+import com.blankj.utilcode.util.LogUtils;
+import com.example.chemical.databinding.FragmentLockerBinding;
+import com.example.chemical.ui.add.FragmentCallBack;
+import com.rc.httpcore.bean.locker.HxpCabinetDoorVo;
+import com.rc.httpcore.bean.locker.HxpCabinetVo;
+
+import java.util.LinkedList;
+import java.util.List;
+
+public class LockerFragment extends Fragment {
+    private FragmentLockerBinding binding;
+    private HxpCabinetVo hxpCabinetVo;
+    // 所有柜层
+    private List<DrawerUiBean> drawerUiList = new LinkedList<>();
+    private FragmentCallBack fragmentCallBack;
+
+    public LockerFragment(HxpCabinetVo hxpCabinetVo, FragmentCallBack fragmentCallBack) {
+        this.hxpCabinetVo = hxpCabinetVo;
+    }
+
+    @Nullable
+    @Override
+    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
+        binding = FragmentLockerBinding.inflate(inflater, container, false);
+        return binding.getRoot();
+    }
+
+    @Override
+    public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
+        super.onViewCreated(view, savedInstanceState);
+        drawerUiList.add(new DrawerUiBean(binding.lockerUpDrawer1RB, binding.lockerUpDrawer1TV, false));
+        drawerUiList.add(new DrawerUiBean(binding.lockerUpDrawer2RB, binding.lockerUpDrawer2TV, false));
+        drawerUiList.add(new DrawerUiBean(binding.lockerUpDrawer3RB, binding.lockerUpDrawer3TV, false));
+        drawerUiList.add(new DrawerUiBean(binding.lockerUpDrawer4RB, binding.lockerUpDrawer4TV, false));
+        drawerUiList.add(new DrawerUiBean(binding.lockerUpDrawer5RB, binding.lockerUpDrawer5TV, false));
+        drawerUiList.add(new DrawerUiBean(binding.lockerUpDrawer6RB, binding.lockerUpDrawer6TV, false));
+        drawerUiList.add(new DrawerUiBean(binding.lockerUpDrawer7RB, binding.lockerUpDrawer7TV, false));
+        drawerUiList.add(new DrawerUiBean(binding.lockerUpDrawer8RB, binding.lockerUpDrawer8TV, false));
+        // 所有柜门
+        List<HxpCabinetDoorVo> doorVoList = hxpCabinetVo.getCabinetDoorVoList();
+        String[] drawerArray = new String[]{"①  层", "②  层", "③  层", "④  层", "⑤  层", "⑥  层", "⑦  层", "⑧  层"};
+        if (doorVoList.size() == 1) {
+            HxpCabinetDoorVo hxpCabinetDoorVo = doorVoList.get(0);
+            // 层数
+            int doorLayers = hxpCabinetDoorVo.getDoorLayers();
+            for (int i = 0; i < 8; i++) {
+                DrawerUiBean drawerUiBean = drawerUiList.get(i);
+                drawerUiBean.setVisible(i < doorLayers);
+            }
+            LogUtils.dTag("DEBUG", drawerUiList);
+            for (int i = 0; i < drawerUiList.size(); i++) {
+                DrawerUiBean drawerUiBean = drawerUiList.get(i);
+                if (drawerUiBean.isVisible()) {
+                    drawerUiBean.getRadioButton().setVisibility(View.VISIBLE);
+                    drawerUiBean.getTextView().setVisibility(View.VISIBLE);
+                    drawerUiBean.setDrawer(drawerArray[i]);
+                    drawerUiBean.getTextView().setText(drawerUiBean.getDrawer());
+                }
+            }
+        } else if (doorVoList.size() > 1) {
+            HxpCabinetDoorVo hxpCabinetDoorUpVo = doorVoList.get(0);
+            // 层数
+            int doorUpLayers = hxpCabinetDoorUpVo.getDoorLayers();
+            for (int i = 0; i < 4; i++) {
+                DrawerUiBean drawerUiBean = drawerUiList.get(i);
+                drawerUiBean.setVisible(i < doorUpLayers);
+            }
+
+            // 设置柜1层高   柜内高484px
+            int itemUpH = 484 / 2 / doorUpLayers;
+            for (int i = 0; i < doorUpLayers; i++) {
+                for (int j = 0; j < 4; j++) {
+                    DrawerUiBean drawerUiBean = drawerUiList.get(j);
+                    RadioButton radioButton = drawerUiBean.getRadioButton();
+                    ViewGroup.LayoutParams radioButtonLayoutParams = radioButton.getLayoutParams();
+                    radioButtonLayoutParams.height = itemUpH;
+                    radioButton.setLayoutParams(radioButtonLayoutParams);
+
+                    TextView textView = drawerUiBean.getTextView();
+                    ViewGroup.LayoutParams textViewLayoutParams = textView.getLayoutParams();
+                    textViewLayoutParams.height = itemUpH;
+                    textView.setLayoutParams(textViewLayoutParams);
+                }
+            }
+
+
+            HxpCabinetDoorVo hxpCabinetDoorDownVo = doorVoList.get(1);
+            // 层数
+            int doorDownLayers = hxpCabinetDoorDownVo.getDoorLayers();
+            for (int i = 4; i < 8; i++) {
+                DrawerUiBean drawerUiBean = drawerUiList.get(i);
+                drawerUiBean.setVisible(i < (doorDownLayers + 4));
+            }
+
+            // 设置柜2层高   柜内高484px
+            int itemDownH = 484 / 2 / doorDownLayers;
+            for (int i = 0; i < doorDownLayers; i++) {
+                for (int j = 4; j < 8; j++) {
+                    DrawerUiBean drawerUiBean = drawerUiList.get(j);
+                    RadioButton radioButton = drawerUiBean.getRadioButton();
+                    ViewGroup.LayoutParams radioButtonLayoutParams = radioButton.getLayoutParams();
+                    radioButtonLayoutParams.height = itemDownH;
+                    radioButton.setLayoutParams(radioButtonLayoutParams);
+
+                    TextView textView = drawerUiBean.getTextView();
+                    ViewGroup.LayoutParams textViewLayoutParams = textView.getLayoutParams();
+                    textViewLayoutParams.height = itemDownH;
+                    textView.setLayoutParams(textViewLayoutParams);
+                }
+            }
+            LogUtils.dTag("DEBUG", drawerUiList);
+            for (int i = 0; i < drawerUiList.size(); i++) {
+                DrawerUiBean drawerUiBean = drawerUiList.get(i);
+                if (drawerUiBean.isVisible()) {
+                    drawerUiBean.getRadioButton().setVisibility(View.VISIBLE);
+                    drawerUiBean.getTextView().setVisibility(View.VISIBLE);
+                    drawerUiBean.setDrawer(drawerArray[i >= 4 ? i - doorUpLayers : i]);
+                    drawerUiBean.getTextView().setText(drawerUiBean.getDrawer());
+                } else {
+                    drawerUiBean.getRadioButton().setVisibility(View.GONE);
+                    drawerUiBean.getTextView().setVisibility(View.GONE);
+                }
+            }
+        }
+
+        binding.lockerUpDrawerRG.setOnCheckedChangeListener((group, checkedId) -> {
+            int radioButtonIndex = -1;
+            for (int i = 0; i < group.getChildCount(); i++) {
+                RadioButton radioButton = (RadioButton) group.getChildAt(i);
+                if (radioButton.getId() == checkedId) {
+                    radioButtonIndex = i;
+                    break;
+                }
+            }
+            if (radioButtonIndex != -1) {
+                fragmentCallBack.onSelected(hxpCabinetVo, radioButtonIndex);
+            }
+        });
+    }
+
+    @Override
+    public void onDestroyView() {
+        super.onDestroyView();
+        binding = null;
+    }
+}

+ 7 - 0
app/src/main/res/drawable/locker_name_round.xml

@@ -0,0 +1,7 @@
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+    android:shape="oval">
+    <solid android:color="@color/white" />
+    <size
+        android:width="24px"
+        android:height="24px" />
+</shape>

BIN
app/src/main/res/drawable/save_locker_selected.9.png


BIN
app/src/main/res/drawable/save_locker_unselected.9.png


+ 5 - 0
app/src/main/res/drawable/selector_locker_drawer.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+    <item android:drawable="@drawable/save_locker_selected" android:state_checked="true" />
+    <item android:drawable="@drawable/save_locker_unselected" android:state_checked="false" />
+</selector>

+ 10 - 0
app/src/main/res/layout/activity_add.xml

@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<androidx.constraintlayout.widget.ConstraintLayout 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"
+    android:id="@+id/main"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    tools:context=".ui.add.AddActivity">
+
+</androidx.constraintlayout.widget.ConstraintLayout>

+ 58 - 57
app/src/main/res/layout/activity_main.xml

@@ -36,9 +36,9 @@
                     android:id="@+id/tvNoName"
                     android:layout_width="20dp"
                     android:layout_height="35dp"
+                    android:background="@drawable/round_button_gb"
                     android:gravity="center"
                     android:textColor="@color/white"
-                    android:background="@drawable/round_button_gb"
                     android:textSize="9sp" />
 
                 <TextView
@@ -152,7 +152,7 @@
                         <TextView
                             android:layout_width="wrap_content"
                             android:layout_height="wrap_content"
-                            android:text="新增入库"
+                            android:text="存储"
                             android:textColor="@color/white"
                             android:textSize="14sp"
                             android:textStyle="bold" />
@@ -169,32 +169,32 @@
                 </RelativeLayout>
 
                 <RelativeLayout
-                    android:id="@+id/reSto"
+                    android:id="@+id/reDis"
                     android:layout_width="260dp"
                     android:layout_height="125dp"
                     android:layout_marginLeft="10dp"
-                    android:background="@mipmap/img_bg_rk">
+                    android:background="@mipmap/img_bg_fq">
 
                     <ImageView
-                        android:id="@+id/imgB"
+                        android:id="@+id/imgC"
                         android:layout_width="wrap_content"
                         android:layout_height="wrap_content"
                         android:layout_centerVertical="true"
                         android:layout_marginLeft="45dp"
-                        android:background="@mipmap/icon_sy_rk" />
+                        android:background="@mipmap/icon_sy_fq" />
 
                     <LinearLayout
                         android:layout_width="wrap_content"
                         android:layout_height="wrap_content"
                         android:layout_centerVertical="true"
                         android:layout_marginLeft="6dp"
-                        android:layout_toRightOf="@+id/imgB"
+                        android:layout_toRightOf="@+id/imgC"
                         android:orientation="vertical">
 
                         <TextView
                             android:layout_width="wrap_content"
                             android:layout_height="wrap_content"
-                            android:text="待入库"
+                            android:text="废弃"
                             android:textColor="@color/white"
                             android:textSize="16sp"
                             android:textStyle="bold" />
@@ -202,7 +202,7 @@
                         <TextView
                             android:layout_width="wrap_content"
                             android:layout_height="wrap_content"
-                            android:text="Stock pending"
+                            android:text="Discard"
                             android:textColor="@color/white"
                             android:textSize="14sp"
                             android:textStyle="bold" />
@@ -210,39 +210,34 @@
 
                 </RelativeLayout>
 
-            </LinearLayout>
-
-            <LinearLayout
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                android:paddingLeft="15dp">
-
                 <RelativeLayout
-                    android:id="@+id/reDis"
+                    android:id="@+id/reSto"
                     android:layout_width="260dp"
                     android:layout_height="125dp"
-                    android:background="@mipmap/img_bg_fq">
+                    android:layout_marginLeft="10dp"
+                    android:background="@mipmap/img_bg_rk"
+                    android:visibility="gone">
 
                     <ImageView
-                        android:id="@+id/imgC"
+                        android:id="@+id/imgB"
                         android:layout_width="wrap_content"
                         android:layout_height="wrap_content"
                         android:layout_centerVertical="true"
                         android:layout_marginLeft="45dp"
-                        android:background="@mipmap/icon_sy_fq" />
+                        android:background="@mipmap/icon_sy_rk" />
 
                     <LinearLayout
                         android:layout_width="wrap_content"
                         android:layout_height="wrap_content"
                         android:layout_centerVertical="true"
                         android:layout_marginLeft="6dp"
-                        android:layout_toRightOf="@+id/imgC"
+                        android:layout_toRightOf="@+id/imgB"
                         android:orientation="vertical">
 
                         <TextView
                             android:layout_width="wrap_content"
                             android:layout_height="wrap_content"
-                            android:text="废弃"
+                            android:text="待入库"
                             android:textColor="@color/white"
                             android:textSize="16sp"
                             android:textStyle="bold" />
@@ -250,7 +245,7 @@
                         <TextView
                             android:layout_width="wrap_content"
                             android:layout_height="wrap_content"
-                            android:text="Discard"
+                            android:text="Stock pending"
                             android:textColor="@color/white"
                             android:textSize="14sp"
                             android:textStyle="bold" />
@@ -258,11 +253,17 @@
 
                 </RelativeLayout>
 
+            </LinearLayout>
+
+            <LinearLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:paddingLeft="15dp">
+
                 <RelativeLayout
                     android:id="@+id/reInq"
                     android:layout_width="260dp"
                     android:layout_height="125dp"
-                    android:layout_marginLeft="10dp"
                     android:background="@mipmap/img_bg_cx">
 
                     <ImageView
@@ -300,6 +301,39 @@
 
                 </RelativeLayout>
 
+                <RelativeLayout
+                    android:id="@+id/reLedger"
+                    android:layout_width="260dp"
+                    android:layout_height="125dp"
+                    android:layout_marginLeft="@dimen/dp_10"
+                    android:background="@mipmap/img_bg_xz">
+
+                    <LinearLayout
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:layout_centerInParent="true"
+                        android:layout_centerVertical="true"
+                        android:orientation="vertical">
+
+                        <TextView
+                            android:layout_width="wrap_content"
+                            android:layout_height="wrap_content"
+                            android:layout_gravity="center"
+                            android:text="标签管理"
+                            android:textColor="@color/white"
+                            android:textSize="14sp"
+                            android:textStyle="bold" />
+
+                        <TextView
+                            android:layout_width="wrap_content"
+                            android:layout_height="wrap_content"
+                            android:text="Label management"
+                            android:textColor="@color/white"
+                            android:textSize="14sp"
+                            android:textStyle="bold" />
+                    </LinearLayout>
+                </RelativeLayout>
+
             </LinearLayout>
 
             <LinearLayout
@@ -434,39 +468,6 @@
 
 
                 <RelativeLayout
-                    android:id="@+id/reLedger"
-                    android:layout_width="116dp"
-                    android:layout_height="80dp"
-                    android:layout_weight="1"
-                    android:background="@mipmap/img_bg_bqgl">
-
-                    <LinearLayout
-                        android:layout_width="wrap_content"
-                        android:layout_height="wrap_content"
-                        android:layout_centerInParent="true"
-                        android:layout_centerVertical="true"
-                        android:orientation="vertical">
-
-                        <TextView
-                            android:layout_width="wrap_content"
-                            android:layout_height="wrap_content"
-                            android:layout_gravity="center"
-                            android:text="标签管理"
-                            android:textColor="@color/white"
-                            android:textSize="12sp"
-                            android:textStyle="bold" />
-
-                        <TextView
-                            android:layout_width="wrap_content"
-                            android:layout_height="wrap_content"
-                            android:text="Label management"
-                            android:textColor="@color/white"
-                            android:textSize="8sp"
-                            android:textStyle="bold" />
-                    </LinearLayout>
-                </RelativeLayout>
-
-                <RelativeLayout
                     android:id="@+id/rlWarning"
                     android:layout_width="116dp"
                     android:layout_height="80dp"

+ 329 - 0
app/src/main/res/layout/activity_plan_add.xml

@@ -0,0 +1,329 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout 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"
+    android:id="@+id/main"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:animateLayoutChanges="true"
+    android:background="@mipmap/icon_add_bg"
+    tools:context=".ui.add.PlanAddActivity">
+
+    <RelativeLayout
+        android:id="@+id/rel1"
+        android:layout_width="match_parent"
+        android:layout_height="45dp"
+        android:layout_marginTop="10dp">
+
+        <ImageView
+            android:id="@+id/image"
+            android:layout_width="30dp"
+            android:layout_height="30dp"
+            android:layout_centerVertical="true"
+            android:layout_marginLeft="20dp" />
+
+        <TextView
+            android:id="@+id/deptName"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_centerVertical="true"
+            android:layout_marginLeft="10dp"
+            android:layout_toRightOf="@+id/image"
+            android:text="实验室名称-房间号"
+            android:textColor="@color/white"
+            android:textSize="22sp" />
+
+        <LinearLayout
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_centerInParent="true"
+            android:layout_centerVertical="true"
+            android:layout_marginTop="2dp">
+
+            <TextView
+                android:id="@+id/tvTitle"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_centerHorizontal="true"
+                android:layout_centerVertical="true"
+                android:text="化学品智能管理"
+                android:textColor="@color/white"
+                android:textSize="24sp"
+                android:textStyle="bold" />
+
+            <TextView
+                android:id="@+id/nowTime"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="6dp"
+                android:layout_toRightOf="@+id/tvTitle"
+                android:textColor="@color/white" />
+
+        </LinearLayout>
+
+
+        <RelativeLayout
+            android:id="@+id/loggedIn"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_alignParentRight="true"
+            android:layout_centerVertical="true"
+            android:gravity="center_vertical"
+            android:paddingRight="18dp">
+
+            <ImageView
+                android:id="@+id/imageName"
+                android:layout_width="30dp"
+                android:layout_height="30dp"
+                android:layout_centerVertical="true"
+                android:layout_marginRight="6dp" />
+
+            <TextView
+                android:id="@+id/tvName"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_centerVertical="true"
+                android:layout_marginLeft="6dp"
+                android:layout_marginRight="6dp"
+                android:layout_toRightOf="@+id/imageName"
+                android:text="李XX"
+                android:textColor="@color/white" />
+
+            <ImageView
+                android:id="@+id/imgOut"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_centerVertical="true"
+                android:layout_marginLeft="6dp"
+                android:layout_marginRight="6dp"
+                android:layout_toRightOf="@+id/tvName"
+                android:background="@mipmap/cshrk_dl_tc" />
+
+            <TextView
+                android:id="@+id/tvOutLogin"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_centerVertical="true"
+                android:layout_marginRight="10dp"
+                android:layout_toRightOf="@+id/imgOut"
+                android:text="退出"
+                android:textColor="@color/white"
+                android:textSize="16sp" />
+        </RelativeLayout>
+    </RelativeLayout>
+
+    <RelativeLayout
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:layout_below="@+id/rel1"
+        android:layout_marginLeft="31dp"
+        android:layout_marginTop="15dp"
+        android:layout_marginRight="31dp"
+        android:layout_marginBottom="69dp"
+        android:background="@drawable/bg_add_chemicals_one">
+
+        <LinearLayout
+            android:id="@+id/bottom_bar"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:layout_alignParentBottom="true"
+            android:orientation="horizontal">
+
+            <LinearLayout
+                android:id="@+id/count_LL"
+                android:layout_width="390dp"
+                android:layout_height="wrap_content"
+                android:gravity="center"
+                android:orientation="horizontal">
+
+                <Button
+                    android:id="@+id/last_BT"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:text="上一页" />
+
+                <TextView
+                    android:id="@+id/countTV"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content" />
+
+                <Button
+                    android:id="@+id/next_BT"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:text="下一页" />
+            </LinearLayout>
+
+            <LinearLayout
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_weight="1"
+                android:gravity="center">
+
+                <Button
+                    android:id="@+id/input_BT"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:text="手动录入化学品" />
+            </LinearLayout>
+        </LinearLayout>
+
+
+        <androidx.viewpager2.widget.ViewPager2
+            android:id="@+id/locker_VP2"
+            android:layout_width="350dp"
+            android:layout_height="match_parent"
+            android:layout_above="@id/bottom_bar"
+            android:layout_margin="20dp" />
+
+        <LinearLayout
+            android:layout_width="match_parent"
+            android:layout_height="match_parent"
+            android:layout_above="@id/bottom_bar"
+            android:layout_margin="10dp"
+            android:layout_toEndOf="@id/locker_VP2"
+            android:orientation="vertical">
+
+            <RelativeLayout
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginVertical="10dp">
+
+                <TextView
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:text="待存储列表"
+                    android:textSize="18sp"
+                    android:textStyle="bold" />
+
+                <TextView
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_alignParentEnd="true"
+                    android:text="总数:0"
+                    android:textSize="18sp"
+                    android:textStyle="bold" />
+            </RelativeLayout>
+
+            <LinearLayout
+                android:layout_width="match_parent"
+                android:layout_height="40dp"
+                android:background="#f5f5f5"
+                android:gravity="center_vertical">
+
+                <TextView
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_marginStart="10dp"
+                    android:layout_weight="1"
+                    android:text="名称"
+                    android:textSize="16sp" />
+
+                <TextView
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_weight="1"
+                    android:text="CAS"
+                    android:textSize="16sp" />
+
+                <TextView
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_weight="1"
+                    android:text="类别"
+                    android:textSize="16sp" />
+
+                <TextView
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_weight="1"
+                    android:text="级别"
+                    android:textSize="16sp" />
+
+                <TextView
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_weight="1"
+                    android:text="规格"
+                    android:textSize="16sp" />
+
+                <TextView
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_weight="1"
+                    android:text="净含量"
+                    android:textSize="16sp" />
+
+                <TextView
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_weight="1"
+                    android:gravity="center"
+                    android:text="数量"
+                    android:textSize="16sp" />
+
+                <TextView
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_weight="1"
+                    android:textSize="16sp" />
+            </LinearLayout>
+
+            <ListView
+                android:layout_width="match_parent"
+                android:layout_height="match_parent"
+                android:visibility="gone"
+                tools:listitem="@layout/item_in_storage" />
+
+            <LinearLayout
+                android:id="@+id/ne"
+                android:layout_width="match_parent"
+                android:layout_height="match_parent"
+                android:gravity="center"
+                android:orientation="vertical">
+
+                <ImageView
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_gravity="center_horizontal"
+                    android:src="@mipmap/img_gh_smsb" />
+
+                <TextView
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_gravity="center_horizontal"
+                    android:layout_marginTop="10dp"
+                    android:gravity="center_horizontal"
+                    android:text="扫描化学品标签\n或手动录入化学品"
+                    android:textSize="18sp" />
+            </LinearLayout>
+        </LinearLayout>
+
+
+    </RelativeLayout>
+
+    <TextView
+        android:id="@+id/tvReturn"
+        android:layout_width="85dp"
+        android:layout_height="30dp"
+        android:layout_alignParentBottom="true"
+        android:layout_marginBottom="20dp"
+        android:background="@drawable/bg_retrun"
+        android:gravity="center"
+        android:text="返回180s"
+        android:textColor="@color/white"
+        android:textSize="10sp" />
+
+
+    <Button
+        android:id="@+id/subAdd"
+        android:layout_width="85dp"
+        android:layout_height="30dp"
+        android:layout_alignParentRight="true"
+        android:layout_alignParentBottom="true"
+        android:layout_marginBottom="20dp"
+        android:background="@drawable/bg_retrun_two"
+        android:text="确认入库"
+        android:textColor="@color/white"
+        android:textSize="10sp" />
+</RelativeLayout>

+ 239 - 0
app/src/main/res/layout/fragment_locker.xml

@@ -0,0 +1,239 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout 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"
+    android:animateLayoutChanges="true"
+    tools:ignore="PxUsage">
+
+    <RelativeLayout
+        android:layout_width="610px"
+        android:layout_height="650px"
+        android:layout_centerInParent="true"
+        android:background="@mipmap/locker">
+
+        <RelativeLayout
+            android:layout_width="372px"
+            android:layout_height="484px"
+            android:layout_centerHorizontal="true"
+            android:layout_marginTop="108px"
+            android:orientation="vertical">
+
+
+            <RadioGroup
+                android:id="@+id/locker_up_drawer_RG"
+                android:layout_width="match_parent"
+                android:layout_height="match_parent"
+                android:orientation="vertical">
+
+                <RadioButton
+                    android:id="@+id/locker_up_drawer_1_RB"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_weight="1"
+                    android:background="@drawable/selector_locker_drawer"
+                    android:button="@null"
+                    android:visibility="gone" />
+
+                <RadioButton
+                    android:id="@+id/locker_up_drawer_2_RB"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_weight="1"
+                    android:background="@drawable/selector_locker_drawer"
+                    android:button="@null"
+                    android:visibility="gone" />
+
+                <RadioButton
+                    android:id="@+id/locker_up_drawer_3_RB"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_weight="1"
+                    android:background="@drawable/selector_locker_drawer"
+                    android:button="@null"
+                    android:visibility="gone" />
+
+                <RadioButton
+                    android:id="@+id/locker_up_drawer_4_RB"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_weight="1"
+                    android:background="@drawable/selector_locker_drawer"
+                    android:button="@null"
+                    android:visibility="gone" />
+
+                <RadioButton
+                    android:id="@+id/locker_up_drawer_5_RB"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_weight="1"
+                    android:background="@drawable/selector_locker_drawer"
+                    android:button="@null"
+                    android:visibility="gone" />
+
+                <RadioButton
+                    android:id="@+id/locker_up_drawer_6_RB"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_weight="1"
+                    android:background="@drawable/selector_locker_drawer"
+                    android:button="@null"
+                    android:visibility="gone" />
+
+                <RadioButton
+                    android:id="@+id/locker_up_drawer_7_RB"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_weight="1"
+                    android:background="@drawable/selector_locker_drawer"
+                    android:button="@null"
+                    android:visibility="gone" />
+
+                <RadioButton
+                    android:id="@+id/locker_up_drawer_8_RB"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_weight="1"
+                    android:background="@drawable/selector_locker_drawer"
+                    android:button="@null"
+                    android:visibility="gone" />
+
+            </RadioGroup>
+
+            <LinearLayout
+                android:layout_width="match_parent"
+                android:layout_height="match_parent"
+                android:orientation="vertical">
+
+                <TextView
+                    android:id="@+id/locker_up_drawer_1_TV"
+                    android:layout_width="wrap_content"
+                    android:layout_height="match_parent"
+                    android:layout_marginStart="30px"
+                    android:layout_marginBottom="10px"
+                    android:layout_weight="1"
+                    android:gravity="bottom"
+                    android:text="①  层"
+                    android:textColor="@color/white"
+                    android:textSize="14sp"
+                    android:visibility="gone" />
+
+                <TextView
+                    android:id="@+id/locker_up_drawer_2_TV"
+                    android:layout_width="wrap_content"
+                    android:layout_height="match_parent"
+                    android:layout_marginStart="30px"
+                    android:layout_marginBottom="10px"
+                    android:layout_weight="1"
+                    android:gravity="bottom"
+                    android:text="②  层"
+                    android:textColor="@color/white"
+                    android:textSize="14sp"
+                    android:visibility="gone" />
+
+                <TextView
+                    android:id="@+id/locker_up_drawer_3_TV"
+                    android:layout_width="wrap_content"
+                    android:layout_height="match_parent"
+                    android:layout_marginStart="30px"
+                    android:layout_marginBottom="10px"
+                    android:layout_weight="1"
+                    android:gravity="bottom"
+                    android:text="③  层"
+                    android:textColor="@color/white"
+                    android:textSize="14sp"
+                    android:visibility="gone" />
+
+                <TextView
+                    android:id="@+id/locker_up_drawer_4_TV"
+                    android:layout_width="wrap_content"
+                    android:layout_height="match_parent"
+                    android:layout_marginStart="30px"
+                    android:layout_marginBottom="10px"
+                    android:layout_weight="1"
+                    android:gravity="bottom"
+                    android:text="④  层"
+                    android:textColor="@color/white"
+                    android:textSize="14sp"
+                    android:visibility="gone" />
+
+                <TextView
+                    android:id="@+id/locker_up_drawer_5_TV"
+                    android:layout_width="wrap_content"
+                    android:layout_height="match_parent"
+                    android:layout_marginStart="30px"
+                    android:layout_marginBottom="10px"
+                    android:layout_weight="1"
+                    android:gravity="bottom"
+                    android:text="⑤  层"
+                    android:textColor="@color/white"
+                    android:textSize="14sp"
+                    android:visibility="gone" />
+
+                <TextView
+                    android:id="@+id/locker_up_drawer_6_TV"
+                    android:layout_width="wrap_content"
+                    android:layout_height="match_parent"
+                    android:layout_marginStart="30px"
+                    android:layout_marginBottom="10px"
+                    android:layout_weight="1"
+                    android:gravity="bottom"
+                    android:text="⑥  层"
+                    android:textColor="@color/white"
+                    android:textSize="14sp"
+                    android:visibility="gone" />
+
+                <TextView
+                    android:id="@+id/locker_up_drawer_7_TV"
+                    android:layout_width="wrap_content"
+                    android:layout_height="match_parent"
+                    android:layout_marginStart="30px"
+                    android:layout_marginBottom="10px"
+                    android:layout_weight="1"
+                    android:gravity="bottom"
+                    android:text="⑦  层"
+                    android:textColor="@color/white"
+                    android:textSize="14sp"
+                    android:visibility="gone" />
+
+                <TextView
+                    android:id="@+id/locker_up_drawer_8_TV"
+                    android:layout_width="wrap_content"
+                    android:layout_height="match_parent"
+                    android:layout_marginStart="30px"
+                    android:layout_marginBottom="10px"
+                    android:layout_weight="1"
+                    android:gravity="bottom"
+                    android:text="⑧  层"
+                    android:textColor="@color/white"
+                    android:textSize="14sp"
+                    android:visibility="gone" />
+            </LinearLayout>
+
+        </RelativeLayout>
+
+        <TextView
+            android:layout_width="60px"
+            android:layout_height="wrap_content"
+            android:layout_marginStart="33px"
+            android:layout_marginTop="168px"
+            android:maxLines="4"
+            android:text="柜子柜子柜子柜子柜子"
+            android:textColor="@color/white" />
+
+        <TextView
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginStart="120px"
+            android:layout_marginTop="30px"
+            android:drawableStart="@drawable/locker_name_round"
+            android:drawablePadding="15px"
+            android:gravity="center_vertical"
+            android:text="化学品柜名称"
+            android:textColor="@color/white"
+            android:textSize="16sp" />
+
+    </RelativeLayout>
+
+
+</RelativeLayout>

+ 7 - 0
app/src/main/res/layout/fragment_locker1.xml

@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:background="@color/white">
+
+</RelativeLayout>

+ 7 - 0
app/src/main/res/layout/fragment_locker2.xml

@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:background="@color/viewfinder_result_point_color">
+
+</RelativeLayout>

+ 92 - 0
app/src/main/res/layout/item_in_storage.xml

@@ -0,0 +1,92 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout 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"
+    android:layout_width="match_parent"
+    android:layout_height="35dp"
+    android:gravity="center_vertical"
+    android:orientation="horizontal">
+
+    <TextView
+        android:id="@+id/item_name_TV"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_marginStart="10dp"
+        android:layout_weight="1"
+        android:duplicateParentState="true"
+        android:ellipsize="marquee"
+        android:focusable="true"
+        android:focusableInTouchMode="true"
+        android:marqueeRepeatLimit="marquee_forever"
+        android:singleLine="true"
+        android:text="化学品名称" />
+
+    <TextView
+        android:id="@+id/cas_TV"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_weight="1"
+        android:duplicateParentState="true"
+        android:ellipsize="marquee"
+        android:focusable="true"
+        android:focusableInTouchMode="true"
+        android:marqueeRepeatLimit="marquee_forever"
+        android:singleLine="true"
+        android:text="123456789" />
+
+    <TextView
+        android:id="@+id/item_type_TV"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_weight="1"
+        android:duplicateParentState="true"
+        android:ellipsize="marquee"
+        android:focusable="true"
+        android:focusableInTouchMode="true"
+        android:marqueeRepeatLimit="marquee_forever"
+        android:singleLine="true"
+        android:text="普通危化品" />
+
+    <TextView
+        android:id="@+id/item_level_TV"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_weight="1"
+        android:text="非管控" />
+
+    <TextView
+        android:id="@+id/item_norms_TV"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_weight="1"
+        android:duplicateParentState="true"
+        android:ellipsize="marquee"
+        android:focusable="true"
+        android:focusableInTouchMode="true"
+        android:marqueeRepeatLimit="marquee_forever"
+        android:singleLine="true"
+        android:text="AR(分析纯)" />
+
+    <TextView
+        android:id="@+id/item_net_Wt_TV"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_weight="1"
+        android:text="300ml" />
+
+    <TextView
+        android:id="@+id/item_num_TV"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_weight="1"
+        android:gravity="center"
+        android:text="100" />
+
+    <TextView
+        android:id="@+id/item_del_TV"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_weight="1"
+        android:gravity="center"
+        android:text="删除" />
+</LinearLayout>

BIN
app/src/main/res/mipmap-hdpi/bg.png


BIN
app/src/main/res/mipmap-hdpi/home_save.webp


BIN
app/src/main/res/mipmap-xhdpi/home_discard.png


BIN
app/src/main/res/mipmap-xhdpi/home_query.png


BIN
app/src/main/res/mipmap-xhdpi/img.png


BIN
app/src/main/res/mipmap-xhdpi/img_gh_smsb.png


BIN
app/src/main/res/mipmap-xhdpi/img_gh_smsb.webp


BIN
app/src/main/res/mipmap-xhdpi/locker.png


+ 1 - 1
config/config.gradle

@@ -10,7 +10,7 @@ ext {
             targetSdkVersion : 28,
             applicationId    : "com.zhong.che",
             versionCode      : 20,
-            versionName      : "1.29"
+            versionName      : "1.30"
     ]
 
     test = [