瀏覽代碼

删除冗余页面代码

Frankensteinly 8 月之前
父節點
當前提交
a1035290f7

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

@@ -35,9 +35,6 @@
         <activity
             android:name=".view.activity.HomeActivity"
             android:exported="false" />
-        <activity
-            android:name=".view.activity.test.ProcessDemoActivity"
-            android:exported="false" />
         <activity
             android:name=".view.activity.LoginActivity"
             android:launchMode="singleTask"

+ 0 - 5
app/src/main/java/com/grkj/iscs/view/activity/MainActivity.kt

@@ -8,7 +8,6 @@ import com.grkj.iscs.presentation.PresentationLoginActivity
 import com.grkj.iscs.view.activity.test.BleActivity
 import com.grkj.iscs.view.activity.test.RfidActivity
 import com.grkj.iscs.view.activity.test.ModbusActivity
-import com.grkj.iscs.view.activity.test.ProcessDemoActivity
 import com.grkj.iscs.view.activity.test.WidgetTestActivity
 import com.grkj.iscs.view.activity.test.WebSocketActivity
 
@@ -57,9 +56,5 @@ class MainActivity : BaseActivity<ActivityMainBinding>() {
         mBinding?.createTicket?.setOnClickListener {
             startActivity(Intent(this, CreateTicketActivity::class.java))
         }
-
-        mBinding?.processDemo?.setOnClickListener {
-            startActivity(Intent(this, ProcessDemoActivity::class.java))
-        }
     }
 }

+ 0 - 220
app/src/main/java/com/grkj/iscs/view/activity/test/ProcessDemoActivity.kt

@@ -1,220 +0,0 @@
-package com.grkj.iscs.view.activity.test
-
-import com.grkj.iscs.view.base.BaseActivity
-import com.grkj.iscs.databinding.ActivityProcessDemoBinding
-import com.grkj.iscs.model.vo.lock.LockTakeUpdateReqVO
-import com.grkj.iscs.model.vo.ticket.LockPointUpdateReqVO
-import com.grkj.iscs.model.vo.ticket.TicketDetailRespVO
-import com.grkj.iscs.model.vo.ticket.TicketEquipDetailRespVO
-import com.grkj.iscs.util.NetApi
-import com.grkj.iscs.util.SPUtils
-import com.grkj.iscs.util.ToastUtils
-
-/**
- * 后端流程辅助演示页
- */
-class ProcessDemoActivity : BaseActivity<ActivityProcessDemoBinding>() {
-
-    private var ticketDetail: TicketDetailRespVO? = null
-    private var equipDetail: TicketEquipDetailRespVO? = null
-    private var lockList = mutableListOf<String>()
-
-    override val viewBinding: ActivityProcessDemoBinding
-        get() = ActivityProcessDemoBinding.inflate(layoutInflater)
-
-    override fun initView() {
-//        mBinding?.etSerialNo?.setText(serialNo())
-        mBinding?.etSerialNo?.setText("XL0YVRC62W")
-        mBinding?.cbIsLock?.isChecked = true
-        mBinding?.login?.setOnClickListener { login() }
-        mBinding?.logout?.setOnClickListener { NetApi.logout() }
-        mBinding?.ticketDetail?.setOnClickListener { getTicketDetail() }
-        mBinding?.equipDetail?.setOnClickListener { getTicketEquipDetail() }
-        mBinding?.lockTake?.setOnClickListener { updateLockTake() }
-        mBinding?.lockReturn?.setOnClickListener { updateLockReturn() }
-        mBinding?.keyTake?.setOnClickListener { updateKeyTake() }
-        mBinding?.keyReturn?.setOnClickListener { updateKeyReturn() }
-        mBinding?.updateProgress?.setOnClickListener { updateProgress() }
-        mBinding?.updatePoint?.setOnClickListener { updatePoint() }
-        mBinding?.refreshList?.setOnClickListener {
-            val str = mBinding?.etLockList!!.text.toString()
-            if (str.contains('[') || str.contains(']')) {
-                lockList = str.substring(str.indexOf('[') + 1, str.indexOf(']')).split(',').toMutableList()
-            }
-        }
-    }
-
-    private fun login() {
-        if (mBinding?.etUsername?.text.isNullOrEmpty() || mBinding?.etPassword?.text.isNullOrEmpty()) {
-            ToastUtils.tip("请填写用户名和密码")
-            return
-        }
-        NetApi.login(mBinding?.etUsername?.text.toString(), mBinding?.etPassword?.text.toString()) {
-            if (it == true) {
-                NetApi.getCardInfoByLoginUser { itInfo ->
-                    itInfo?.let { info ->
-                        SPUtils.setLoginUser(this, info)
-                        ToastUtils.tip("登录成功")
-                    }
-                }
-            }
-        }
-    }
-
-    private fun getTicketDetail() {
-        if (mBinding?.etTicketId?.text.isNullOrEmpty()) {
-            ToastUtils.tip("请填写工单号")
-            return
-        }
-        NetApi.getTicketDetail(mBinding?.etTicketId?.text.toString().toLong()) {
-            ticketDetail = it
-            ToastUtils.tip("获取工作票详情成功")
-        }
-    }
-
-    private fun getTicketEquipDetail() {
-        if (mBinding?.etTicketId?.text.isNullOrEmpty()) {
-            ToastUtils.tip("请填写工单号")
-            return
-        }
-        NetApi.getTicketEquipDetail(mBinding?.etTicketId?.text.toString().toLong()) {
-            equipDetail = it
-            ToastUtils.tip("获取设备详情成功")
-        }
-    }
-
-    private fun updateLockTake() {
-        val str = mBinding?.etLockNfc?.text.toString()
-        if (str.isEmpty()) {
-            ToastUtils.tip("请填写锁的NFC")
-            return
-        }
-        if (ticketDetail == null) {
-            ToastUtils.tip("请先获取工单详情")
-            return
-        }
-        if (mBinding?.etSerialNo?.text.isNullOrEmpty()) {
-            ToastUtils.tip("请填写序列号")
-            return
-        }
-        val list = mutableListOf<LockTakeUpdateReqVO>()
-        str.split(',').forEach {
-            list.add(LockTakeUpdateReqVO(ticketDetail?.ticketId, it, mBinding?.etSerialNo?.text.toString()))
-            lockList.add(it)
-            mBinding?.etLockList?.setText("LockList : $lockList")
-        }
-
-        NetApi.updateLockTake(list) {
-            ToastUtils.tip("更新取锁成功")
-        }
-    }
-
-    private fun updateLockReturn() {
-        val str = mBinding?.etLockNfc?.text.toString()
-        if (str.isEmpty()) {
-            ToastUtils.tip("请填写锁的NFC")
-            return
-        }
-        if (mBinding?.etSerialNo?.text.isNullOrEmpty()) {
-            ToastUtils.tip("请填写序列号")
-            return
-        }
-        str.split(',').forEach { lockNfc ->
-            NetApi.updateLockReturn(lockNfc, mBinding?.etSerialNo?.text.toString()) {
-                ToastUtils.tip("更新还锁成功")
-//                lockList.remove(lockNfc)
-//                mBinding?.etLockList?.setText("LockList : $lockList")
-            }
-        }
-    }
-
-    private fun updateKeyTake() {
-        if (mBinding?.etKeyNfc?.text.isNullOrEmpty()) {
-            ToastUtils.tip("请填写钥匙的NFC")
-            return
-        }
-        if (ticketDetail == null) {
-            ToastUtils.tip("请先获取工单详情")
-            return
-        }
-        if (mBinding?.etSerialNo?.text.isNullOrEmpty()) {
-            ToastUtils.tip("请填写序列号")
-            return
-        }
-        NetApi.updateKeyTake(ticketDetail?.ticketId!!, mBinding?.etKeyNfc?.text.toString(), mBinding?.etSerialNo?.text.toString()) {
-            if (it) {
-                ToastUtils.tip("更新取钥匙成功")
-            }
-        }
-    }
-
-    private fun updateKeyReturn() {
-        if (mBinding?.etKeyNfc?.text.isNullOrEmpty()) {
-            ToastUtils.tip("请填写钥匙的NFC")
-            return
-        }
-        if (ticketDetail == null) {
-            ToastUtils.tip("请先获取工单详情")
-            return
-        }
-        if (mBinding?.etSerialNo?.text.isNullOrEmpty()) {
-            ToastUtils.tip("请填写序列号")
-            return
-        }
-        NetApi.updateKeyReturn(ticketDetail?.ticketId!!, mBinding?.etKeyNfc?.text.toString(), mBinding?.etSerialNo?.text.toString()) {
-            if (it) {
-                ToastUtils.tip("更新还钥匙成功")
-            }
-        }
-    }
-
-    private fun updateProgress() {
-        if (ticketDetail == null) {
-            ToastUtils.tip("请先获取工单详情")
-            return
-        }
-        if (SPUtils.getLoginUser(this) == null) {
-            ToastUtils.tip("请先登录")
-            return
-        }
-        NetApi.updateTicketProgress(ticketDetail?.ticketId!!, SPUtils.getLoginUser(this)?.userId!!) {
-            if (it) {
-                ToastUtils.tip("更新工单进度成功")
-            }
-        }
-    }
-
-    private fun updatePoint() {
-        if (ticketDetail == null) {
-            ToastUtils.tip("请先获取工单详情")
-            return
-        }
-        if (equipDetail == null) {
-            ToastUtils.tip("请先获取设备详情")
-            return
-        }
-        if (mBinding?.etKeyNfc?.text.isNullOrEmpty()) {
-            ToastUtils.tip("请填写钥匙的NFC")
-            return
-        }
-        val isLock = mBinding?.cbIsLock!!.isChecked
-        val list = mutableListOf<LockPointUpdateReqVO>()
-        for (i in equipDetail?.ticketLockVOList!!.indices) {
-            val updateReqVO = LockPointUpdateReqVO(
-                ticketDetail!!.ticketId,
-                lockList[i],
-                "P$i",
-                mBinding?.etKeyNfc?.text.toString(),
-                if (isLock) 0 else 1,
-                if (isLock) 0 else 1
-            )
-            list.add(updateReqVO)
-        }
-        NetApi.updateLockPointBatch(list) {
-            if (it) {
-                ToastUtils.tip("更新点位成功")
-                updateKeyReturn()
-            }
-        }
-    }
-}

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

@@ -99,16 +99,6 @@
             android:text="Presentation Login"
             android:textSize="10sp"
             android:layout_margin="5dp"/>
-
-        <Button
-            android:id="@+id/process_demo"
-            android:layout_width="wrap_content"
-            android:layout_height="50dp"
-            android:minWidth="0dp"
-            android:minHeight="0dp"
-            android:text="Process Demo"
-            android:textSize="10sp"
-            android:layout_margin="5dp"/>
     </LinearLayout>
 
     <LinearLayout

+ 0 - 213
app/src/main/res/layout/activity_process_demo.xml

@@ -1,213 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:tools="http://schemas.android.com/tools"
-    android:id="@+id/main"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    android:orientation="vertical"
-    tools:context=".view.activity.test.ProcessDemoActivity">
-
-    <LinearLayout
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:gravity="center_vertical"
-        android:orientation="horizontal">
-
-        <EditText
-            android:id="@+id/et_username"
-            android:layout_width="100dp"
-            android:layout_height="wrap_content"
-            android:hint="User name" />
-
-        <EditText
-            android:id="@+id/et_password"
-            android:layout_width="100dp"
-            android:layout_height="wrap_content"
-            android:hint="Password" />
-
-        <Button
-            android:id="@+id/login"
-            android:layout_width="wrap_content"
-            android:layout_height="50dp"
-            android:layout_margin="5dp"
-            android:minWidth="0dp"
-            android:minHeight="0dp"
-            android:text="Login"
-            android:textSize="10sp" />
-
-        <Button
-            android:id="@+id/logout"
-            android:layout_width="wrap_content"
-            android:layout_height="50dp"
-            android:layout_margin="5dp"
-            android:minWidth="0dp"
-            android:minHeight="0dp"
-            android:text="Logout"
-            android:textSize="10sp" />
-
-        <EditText
-            android:id="@+id/et_serial_no"
-            android:layout_width="200dp"
-            android:layout_height="wrap_content"
-            android:hint="Serial Number" />
-    </LinearLayout>
-
-    <LinearLayout
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:gravity="center_vertical"
-        android:orientation="horizontal">
-
-        <EditText
-            android:id="@+id/et_ticket_id"
-            android:layout_width="100dp"
-            android:layout_height="wrap_content"
-            android:hint="Ticket ID"
-            android:inputType="number" />
-
-        <Button
-            android:id="@+id/ticket_detail"
-            android:layout_width="wrap_content"
-            android:layout_height="50dp"
-            android:layout_margin="5dp"
-            android:minWidth="0dp"
-            android:minHeight="0dp"
-            android:text="Get Ticket Detail"
-            android:textSize="10sp" />
-
-        <Button
-            android:id="@+id/equip_detail"
-            android:layout_width="wrap_content"
-            android:layout_height="50dp"
-            android:layout_margin="5dp"
-            android:minWidth="0dp"
-            android:minHeight="0dp"
-            android:text="Get Equip Detail"
-            android:textSize="10sp" />
-    </LinearLayout>
-
-    <LinearLayout
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:gravity="center_vertical"
-        android:orientation="horizontal">
-
-        <EditText
-            android:id="@+id/et_lock_nfc"
-            android:layout_width="300dp"
-            android:layout_height="wrap_content"
-            android:hint="Lock NFC" />
-
-        <Button
-            android:id="@+id/lock_take"
-            android:layout_width="wrap_content"
-            android:layout_height="50dp"
-            android:layout_margin="5dp"
-            android:minWidth="0dp"
-            android:minHeight="0dp"
-            android:text="Update Lock Take"
-            android:textSize="10sp" />
-
-        <Button
-            android:id="@+id/lock_return"
-            android:layout_width="wrap_content"
-            android:layout_height="50dp"
-            android:layout_margin="5dp"
-            android:minWidth="0dp"
-            android:minHeight="0dp"
-            android:text="Update Lock Return"
-            android:textSize="10sp" />
-    </LinearLayout>
-
-    <LinearLayout
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:gravity="center_vertical"
-        android:orientation="horizontal">
-
-        <EditText
-            android:id="@+id/et_key_nfc"
-            android:layout_width="100dp"
-            android:layout_height="wrap_content"
-            android:hint="Key NFC" />
-
-        <Button
-            android:id="@+id/key_take"
-            android:layout_width="wrap_content"
-            android:layout_height="50dp"
-            android:layout_margin="5dp"
-            android:minWidth="0dp"
-            android:minHeight="0dp"
-            android:text="Update Key Take"
-            android:textSize="10sp" />
-
-        <Button
-            android:id="@+id/key_return"
-            android:layout_width="wrap_content"
-            android:layout_height="50dp"
-            android:layout_margin="5dp"
-            android:minWidth="0dp"
-            android:minHeight="0dp"
-            android:text="Update Key Return"
-            android:textSize="10sp" />
-    </LinearLayout>
-
-    <LinearLayout
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:gravity="center_vertical"
-        android:orientation="horizontal">
-
-        <CheckBox
-            android:id="@+id/cb_is_lock"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="isLock"/>
-
-        <Button
-            android:id="@+id/update_point"
-            android:layout_width="wrap_content"
-            android:layout_height="50dp"
-            android:layout_margin="5dp"
-            android:minWidth="0dp"
-            android:minHeight="0dp"
-            android:text="Update Point(Locker Only)"
-            android:textSize="10sp" />
-
-        <Button
-            android:id="@+id/update_progress"
-            android:layout_width="wrap_content"
-            android:layout_height="50dp"
-            android:layout_margin="5dp"
-            android:minWidth="0dp"
-            android:minHeight="0dp"
-            android:text="Update Progress(CoLocker Only)"
-            android:textSize="10sp" />
-    </LinearLayout>
-
-    <LinearLayout
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:gravity="center_vertical"
-        android:orientation="horizontal">
-
-        <Button
-            android:id="@+id/refresh_list"
-            android:layout_width="wrap_content"
-            android:layout_height="50dp"
-            android:layout_margin="5dp"
-            android:minWidth="0dp"
-            android:minHeight="0dp"
-            android:text="Refresh List"
-            android:textSize="10sp" />
-
-        <EditText
-            android:id="@+id/et_lock_list"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:textColor="@color/main_color"
-            android:padding="10dp"
-            android:text="LockList : "
-            android:textSize="15sp" />
-    </LinearLayout>
-</LinearLayout>