|
@@ -1,6 +1,7 @@
|
|
|
package com.wdkl.ncs.android.component.nursehome.fragment
|
|
|
|
|
|
import android.support.v7.widget.LinearLayoutManager
|
|
|
+import android.text.TextUtils
|
|
|
import android.text.method.ScrollingMovementMethod
|
|
|
import android.util.Log
|
|
|
import android.view.View
|
|
@@ -10,8 +11,9 @@ import com.enation.javashop.net.engine.model.NetState
|
|
|
import com.scwang.smartrefresh.layout.footer.ClassicsFooter
|
|
|
import com.wdkl.ncs.android.component.nursehome.R
|
|
|
import com.wdkl.ncs.android.component.nursehome.activity.NurseHomeActivity
|
|
|
-import com.wdkl.ncs.android.component.nursehome.adapter.*
|
|
|
-import com.wdkl.ncs.android.middleware.common.Constants
|
|
|
+import com.wdkl.ncs.android.component.nursehome.adapter.CostItemAdapter
|
|
|
+import com.wdkl.ncs.android.component.nursehome.adapter.ExamAdapter
|
|
|
+import com.wdkl.ncs.android.component.nursehome.adapter.FrameBedVosConfinementAdapter
|
|
|
import com.wdkl.ncs.android.component.nursehome.databinding.FragmentFramePartBinding
|
|
|
import com.wdkl.ncs.android.component.nursehome.launch.NurseHomeLaunch
|
|
|
import com.wdkl.ncs.android.component.nursehome.util.RingPlayHelper
|
|
@@ -21,12 +23,16 @@ import com.wdkl.ncs.android.lib.base.BaseFragment
|
|
|
import com.wdkl.ncs.android.lib.utils.debugLog
|
|
|
import com.wdkl.ncs.android.lib.utils.showMessage
|
|
|
import com.wdkl.ncs.android.lib.vo.filter
|
|
|
+import com.wdkl.ncs.android.middleware.common.Constants
|
|
|
import com.wdkl.ncs.android.middleware.logic.contract.nursehome.FramePartContract
|
|
|
import com.wdkl.ncs.android.middleware.logic.presenter.nursehome.FramePartPresenter
|
|
|
import com.wdkl.ncs.android.middleware.model.bean.SettingConfiguration
|
|
|
import com.wdkl.ncs.android.middleware.model.dto.ExaminationConfigByGroupNameDto
|
|
|
import com.wdkl.ncs.android.middleware.model.dto.FeeConfigByGroupNameDto
|
|
|
-import com.wdkl.ncs.android.middleware.model.vo.*
|
|
|
+import com.wdkl.ncs.android.middleware.model.vo.CustomerInfoVO
|
|
|
+import com.wdkl.ncs.android.middleware.model.vo.FrameBedVO
|
|
|
+import com.wdkl.ncs.android.middleware.model.vo.FramePartVO
|
|
|
+import com.wdkl.ncs.android.middleware.model.vo.FrameRoomVO
|
|
|
import com.wdkl.ncs.android.middleware.tcp.channel.VoiceUtil
|
|
|
import com.wdkl.ncs.android.middleware.tcp.dto.TcpModel
|
|
|
import com.wdkl.ncs.android.middleware.tcp.enums.TcpAction
|
|
@@ -230,7 +236,7 @@ class FramePartFragment: BaseFragment<FramePartPresenter, FragmentFramePartBindi
|
|
|
if (System.currentTimeMillis() - clickTime < 3000) {
|
|
|
showMessage("请勿频繁点击")
|
|
|
} else {
|
|
|
- if (frame.customerName != null) {
|
|
|
+ if (frame.customerName != null && frame.bedDeviceId != null) {
|
|
|
//呼出时停止语音播报及铃声
|
|
|
SpeechUtil.getInstance().stopSpeak()
|
|
|
RingPlayHelper.stopRingTone()
|
|
@@ -325,7 +331,6 @@ class FramePartFragment: BaseFragment<FramePartPresenter, FragmentFramePartBindi
|
|
|
* @Note 页面销毁回调
|
|
|
*/
|
|
|
override fun destory() {
|
|
|
- debugLog("HomeFragment","Destory")
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -358,20 +363,28 @@ class FramePartFragment: BaseFragment<FramePartPresenter, FragmentFramePartBindi
|
|
|
*/
|
|
|
override fun showData(data: FramePartVO) {
|
|
|
if (data.frameRoomVos != null){
|
|
|
- var frameRoomVos = data.frameRoomVos as ArrayList<FrameRoomVO>
|
|
|
- var frameBedVO = ArrayList<FrameBedVO>()
|
|
|
+ val frameRoomVos = data.frameRoomVos as ArrayList<FrameRoomVO>
|
|
|
+ val frameBedVO = ArrayList<FrameBedVO>()
|
|
|
+ val emptyFrameBedVOs = ArrayList<FrameBedVO>()
|
|
|
|
|
|
for (frameRoomVo in frameRoomVos) {
|
|
|
- var frameBedVOs = frameRoomVo.frameBedList
|
|
|
+ val frameBedVOs = frameRoomVo.frameBedList
|
|
|
if (frameBedVOs != null && frameBedVOs.size > 0) {
|
|
|
- frameBedVO.addAll(frameBedVOs)
|
|
|
+ for (bedVO in frameBedVOs) {
|
|
|
+ if (TextUtils.isEmpty(bedVO.customerName)) {
|
|
|
+ emptyFrameBedVOs.add(bedVO)
|
|
|
+ } else {
|
|
|
+ frameBedVO.add(bedVO)
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
CommonUtils.setInBedVos(frameBedVO)
|
|
|
|
|
|
adapter!!.data.clear()
|
|
|
adapter!!.data.addAll(frameBedVO)
|
|
|
- Log.i("abc2", " " + frameRoomVos.size);
|
|
|
+ adapter!!.data.addAll(emptyFrameBedVOs)
|
|
|
+ Log.i(TAG, "empty bed: " + emptyFrameBedVOs.size + ", custom bed: " + frameBedVO.size);
|
|
|
adapter!!.notifyDataSetChanged()
|
|
|
}
|
|
|
refresh.finishRefresh()
|
|
@@ -426,7 +439,7 @@ class FramePartFragment: BaseFragment<FramePartPresenter, FragmentFramePartBindi
|
|
|
fun onMoonEvent(messageEvent: MessageEvent) {
|
|
|
when (messageEvent.getType()) {
|
|
|
Constants.EVENT_TCP_MSG -> {
|
|
|
- var tcpModel = messageEvent.getMessage() as TcpModel
|
|
|
+ val tcpModel = messageEvent.getMessage() as TcpModel
|
|
|
if (tcpModel.action == TcpAction.DataAction.REFRESH) {
|
|
|
//更新数据
|
|
|
presenter.loadData(Constants.part_id)
|