Commit f4b4ae5a by 霍志良

feat:增加消息类型

parent 9e69e5db
package com.yidianling.im.bean
data class MedicinelistBean(
val medicineList: MutableList<MedicineBean>
)
data class MedicineBean(
val medicineApplyNumber: String? = "",
val medicineName: String? = "",
val medicineSpec: String? = ""
)
\ No newline at end of file
......@@ -55,6 +55,7 @@ import com.yidianling.im.session.extension.CustomAttachmentOrderAlreadyDone;
import com.yidianling.im.session.extension.CustomAttachmentOrderStatus;
import com.yidianling.im.session.extension.CustomAttachmentPatientCheckIn;
import com.yidianling.im.session.extension.CustomAttachmentPatientFullInfo;
import com.yidianling.im.session.extension.CustomAttachmentPatientMedicineApply;
import com.yidianling.im.session.extension.CustomAttachmentPhoneCallSystemNotice;
import com.yidianling.im.session.extension.CustomAttachmentRecipel;
import com.yidianling.im.session.extension.CustomAttachmentRecommendAssistant;
......@@ -87,6 +88,7 @@ import com.yidianling.im.session.viewholder.MsgViewHolderOrderAlreadyDone;
import com.yidianling.im.session.viewholder.MsgViewHolderOrderStatus;
import com.yidianling.im.session.viewholder.MsgViewHolderPatientCheckIn;
import com.yidianling.im.session.viewholder.MsgViewHolderPatientFullInfo;
import com.yidianling.im.session.viewholder.MsgViewHolderPatientMedicineApply;
import com.yidianling.im.session.viewholder.MsgViewHolderPerfectConsultData;
import com.yidianling.im.session.viewholder.MsgViewHolderPhoneCallSystemNotice;
import com.yidianling.im.session.viewholder.MsgViewHolderRecipel;
......@@ -458,6 +460,7 @@ public class SessionHelper {
NimUIKit.registerMsgItemViewHolder(CustomAttachmentRecipel.class, MsgViewHolderRecipel.class);//处方单创建消息类型
NimUIKit.registerMsgItemViewHolder(CustomAttachmentPatientCheckIn.class, MsgViewHolderPatientCheckIn.class);//患者报到
NimUIKit.registerMsgItemViewHolder(CustomAttachmentPatientFullInfo.class, MsgViewHolderPatientFullInfo.class);//就诊者完善信息
NimUIKit.registerMsgItemViewHolder(CustomAttachmentPatientMedicineApply.class, MsgViewHolderPatientMedicineApply.class);//开药申请
}
......
......@@ -42,6 +42,9 @@ public class CustomAttachParser implements MsgAttachmentParser {
case CustomAttachmentType.TYPE_PATIENT_CHECK_IN:
attachment = new CustomAttachmentPatientCheckIn();
break;
case CustomAttachmentType.TYPE_PATIENT_MEDICINE_APPLY:
attachment = new CustomAttachmentPatientMedicineApply();
break;
default:
// attachment = new CustomAttachmentFilter();
break;
......
package com.yidianling.im.session.extension
import com.alibaba.fastjson.JSONObject
import com.yidianling.im.bean.MedicinelistBean
/**
* Created by Ykai on 2021/11/12.
*
* 患者报道消息解析器
*/
class CustomAttachmentPatientMedicineApply :
CustomAttachment(CustomAttachmentType.TYPE_PATIENT_MEDICINE_APPLY) {
private val TITLE = "title"
private val VISITAPPLYNO = "visitApplyNo"
private val MEDICINELIST = "medicineList"
var title: String? = null
var visitApplyNo: String? = null
var medicinelist: MedicinelistBean? = null
override fun parseData(data: JSONObject) {
title = data.getString(TITLE)
visitApplyNo = data.getString(VISITAPPLYNO)
medicinelist = data.getObject(MEDICINELIST, MedicinelistBean::class.java)
}
override fun packData(): JSONObject {
val data = JSONObject()
data[TITLE] = title
data[VISITAPPLYNO] = visitApplyNo
data[MEDICINELIST] = medicinelist
return data
}
}
\ No newline at end of file
......@@ -63,4 +63,5 @@ public interface CustomAttachmentType {
int TYPE_RECIPE = 86;//处方单创建消息类型
int TYPE_PATIENT_FULL_INFO = 87; // 就诊患者完善信息
int TYPE_PATIENT_CHECK_IN = 88; // 患者报到
int TYPE_PATIENT_MEDICINE_APPLY = 89; // 开药申请
}
package com.yidianling.im.session.viewholder
import android.widget.TextView
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import com.yidianling.im.R
import com.yidianling.im.session.extension.CustomAttachmentPatientFullInfo
import com.yidianling.im.session.extension.CustomAttachmentPatientMedicineApply
import com.yidianling.im.session.viewholder.adapter.AdapterMedicineApply
import com.yidianling.medical.archives.MedicalUpdateArchivesActivity
import com.yidianling.medical.extension.YDL_MEDICAL_MESSAGE_DETAIL_PAGE
import com.yidianling.nimbase.common.ui.recyclerview.adapter.BaseMultiItemFetchLoadAdapter
import com.yidianling.uikit.business.session.viewholder.MsgViewHolderBase
/**
* 就诊人提示补充信息ui
*/
class MsgViewHolderPatientMedicineApply(adapter: BaseMultiItemFetchLoadAdapter<*, *>?) :
MsgViewHolderBase(adapter) {
private lateinit var medicine_title: TextView
private lateinit var medicine_list: RecyclerView
private lateinit var itemBean: CustomAttachmentPatientMedicineApply
private lateinit var adapterMedicine: AdapterMedicineApply
override fun getContentResId(): Int {
return R.layout.im_nim_patient_medicine_apply_layout
}
override fun inflateContentView() {
medicine_title = findViewById(R.id.medicine_title)
medicine_list = findViewById(R.id.medicine_list)
medicine_title.text = itemBean.title
adapterMedicine = AdapterMedicineApply()
medicine_list.layoutManager = LinearLayoutManager(context)
medicine_list.adapter = adapterMedicine
itemBean.medicinelist?.medicineList?.let { adapterMedicine.setTagData(it) }
}
override fun bindContentView() {
itemBean = message.attachment as CustomAttachmentPatientMedicineApply
hideItemBg()
}
override fun onItemClick() {
//跳转开药详情页面
}
}
\ No newline at end of file
package com.yidianling.im.session.viewholder.adapter
import androidx.recyclerview.widget.RecyclerView
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.TextView
import com.ydl.ydl_image.module.GlideApp
import com.yidianling.im.R
import com.yidianling.im.bean.MedicineBean
/**
* @author huozhiliang
* @描述:
* @Copyright Copyright (c) 2018
* @Company 壹点灵
* @date 2020/9/7
*/
class AdapterMedicineApply : RecyclerView.Adapter<AdapterMedicineApply.ViewHolder>() {
private lateinit var medicineList: MutableList<MedicineBean>
class ViewHolder(itemView: View) :
RecyclerView.ViewHolder(itemView) {
val medicine_name: TextView = itemView.findViewById(R.id.medicine_name)
val medicine_count: TextView = itemView.findViewById(R.id.medicine_count)
val medicine_spec: TextView = itemView.findViewById(R.id.medicine_spec)
}
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
return ViewHolder(
LayoutInflater.from(parent.context).inflate(
R.layout.im_message_item_medicine_apply,
parent,
false
)
)
}
override fun getItemCount(): Int {
return medicineList.size ?: 0
}
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
holder.medicine_name.text = medicineList[position].medicineName
holder.medicine_spec.text = medicineList[position].medicineSpec
holder.medicine_count.text = "X" + medicineList[position].medicineApplyNumber
}
fun setTagData(data: MutableList<MedicineBean>) {
medicineList = data
notifyDataSetChanged()
}
}
\ No newline at end of file
<?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:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="@dimen/platform_dp_12">
<TextView
android:id="@+id/medicine_name"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:ellipsize="end"
android:singleLine="true"
android:textColor="@color/medical_color_0c1d31"
android:textSize="@dimen/platform_sp_16"
app:layout_constraintEnd_toStartOf="@id/medicine_count"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:text="复方醋酸地塞米松乳膏30g" />
<TextView
android:id="@+id/medicine_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#65758a"
android:textSize="@dimen/platform_sp_16"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:text="x3" />
<TextView
android:id="@+id/medicine_spec"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/platform_dp_6"
android:textColor="#65758a"
android:textSize="@dimen/im_text_size_13"
app:layout_constraintStart_toStartOf="@id/medicine_name"
app:layout_constraintTop_toBottomOf="@id/medicine_name"
tools:text="规格:0.5g*12片*3板/盒">
</TextView>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
<?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:layout_width="match_parent"
android:layout_height="wrap_content">
<View
android:id="@+id/back_top"
android:layout_width="match_parent"
android:layout_height="45dp"
android:background="#ecf5ff"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"></View>
<TextView
android:id="@+id/medicine_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/platform_dp_16"
android:textColor="@color/medical_color_007aef"
android:textSize="@dimen/im_text_size_17"
app:layout_constraintBottom_toBottomOf="@id/back_top"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:text="开药申请"></TextView>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/medicine_list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/platform_dp_16"
android:layout_marginTop="@dimen/platform_dp_16"
android:layout_marginEnd="@dimen/platform_dp_16"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/back_top"
tools:itemCount="2"></androidx.recyclerview.widget.RecyclerView>
<View
android:id="@+id/line_center"
android:layout_width="0dp"
android:layout_height="1px"
android:layout_marginStart="12dp"
android:layout_marginTop="12dp"
android:layout_marginEnd="12dp"
android:background="@color/medical_color_e7ecf0"
app:layout_constraintHorizontal_weight="1"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/medicine_list" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="14dp"
android:layout_marginBottom="2dp"
android:background="@drawable/medical_bg_3464ec_14dp"
android:text="申请详情"
android:textColor="@color/medical_color_007aef"
android:textSize="14sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="@id/line_center"
app:layout_constraintTop_toBottomOf="@id/line_center" />
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
......@@ -71,4 +71,5 @@
<color name="medical_color_c0c9d4">#C0C9D4</color>
<color name="medical_color_e7ecf0">#E7ECF0</color>
<color name="medical_color_ff7766">#FF7766</color>
<color name="medical_color_007aef">#007aef</color>
</resources>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment