[6.7.0] replace taxi base f view to new bone
This commit is contained in:
@@ -41,10 +41,10 @@ import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisStatesListener
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoFsm2024Listener
|
||||
import com.mogo.eagle.core.function.api.datacenter.IDataCenterBizListener
|
||||
import com.mogo.eagle.core.function.api.datacenter.msgbox.IMsgBoxListener
|
||||
import com.mogo.eagle.core.function.api.devatools.IMoGoDevaToolsListener
|
||||
import com.mogo.eagle.core.function.api.map.deva.IMoGoMapScreenListener
|
||||
import com.mogo.eagle.core.function.api.order.IOrderListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListenerManager
|
||||
@@ -52,12 +52,12 @@ import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotStatisticsList
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisStatesListenerManager
|
||||
import com.mogo.eagle.core.function.call.datacenter.CallerDataCenterBizListener
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsListenerManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapScreenListenerManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
|
||||
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxListenerManager
|
||||
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager
|
||||
import com.mogo.eagle.core.function.call.order.CallerOrderListenerManager
|
||||
import com.mogo.eagle.core.function.call.takeover.CallerTakeOverManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
@@ -85,7 +85,7 @@ internal object BadCaseManager : LifecycleEventObserver, IMoGoAutopilotRecordLis
|
||||
IMoGoChassisLocationGCJ02Listener, IMsgBoxListener, IMoGoDevaToolsListener,
|
||||
IMogoStatusChangedListener, IMoGoMapScreenListener , IMoGoFsm2024Listener,
|
||||
IMoGoAutopilotStatisticsListener, IMoGoChassisStatesListener, IMoGoAutopilotStatusListener,
|
||||
IOrderListener {
|
||||
IDataCenterBizListener {
|
||||
|
||||
const val TAG = "BadCase"
|
||||
|
||||
@@ -128,7 +128,7 @@ internal object BadCaseManager : LifecycleEventObserver, IMoGoAutopilotRecordLis
|
||||
if(ProjectUtils.isSaas()){
|
||||
// CallerFsm2024ListenerManager.addListener(TAG,this)
|
||||
CallerAutopilotStatisticsListenerManager.addListener(TAG,this)
|
||||
CallerOrderListenerManager.addListener(TAG,this)
|
||||
CallerDataCenterBizListener.addListener(TAG,this)
|
||||
CallerAutoPilotStatusListenerManager.addListener("RecordViewManager",this)
|
||||
CallerChassisStatesListenerManager.addListener(TAG,this)
|
||||
}
|
||||
@@ -690,21 +690,21 @@ internal object BadCaseManager : LifecycleEventObserver, IMoGoAutopilotRecordLis
|
||||
}
|
||||
}
|
||||
|
||||
override fun onOrderLineUpdate(lineName: String) {
|
||||
override fun invokeOrderLine(lineName: String) {
|
||||
BadCaseConfig.lineName = lineName
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取租户ID
|
||||
*/
|
||||
override fun onTenantIdUpdate(tenantId: Long) {
|
||||
override fun invokeTenantId(tenantId: Long) {
|
||||
BadCaseConfig.tenantId = tenantId
|
||||
}
|
||||
|
||||
/**
|
||||
* 监听登录登出状态
|
||||
*/
|
||||
override fun onLoginStatusUpdate(isLogin: Boolean) {
|
||||
override fun invokeLoginStatus(isLogin: Boolean) {
|
||||
if(reportTypeWindow?.getWindowShowStatus() == true){
|
||||
reportTypeWindow?.hideFloatWindow()
|
||||
reportTypeWindow = null
|
||||
|
||||
@@ -4,13 +4,13 @@ import android.content.Context
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoFsm2024Listener
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoNodeStateListener
|
||||
import com.mogo.eagle.core.function.api.order.IOrderListener
|
||||
import com.mogo.eagle.core.function.api.datacenter.IDataCenterBizListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerFsm2024ListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerNodeStateListenerManager
|
||||
import com.mogo.eagle.core.function.call.datacenter.CallerDataCenterBizListener
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
|
||||
import com.mogo.eagle.core.function.call.order.CallerOrderListenerManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_DEVA
|
||||
import com.zhjt.mogo.adas.data.AdasConstants
|
||||
@@ -24,7 +24,7 @@ import kotlinx.coroutines.launch
|
||||
import java.util.concurrent.atomic.AtomicReference
|
||||
|
||||
internal class FSMImpl(ctx: Context) : IFlow<FSMStatus>(ctx), IMoGoAutopilotStatusListener,
|
||||
IMoGoFsm2024Listener, IMoGoNodeStateListener, IOrderListener {
|
||||
IMoGoFsm2024Listener, IMoGoNodeStateListener, IDataCenterBizListener {
|
||||
|
||||
companion object {
|
||||
const val TAG = "FSMImpl"
|
||||
@@ -76,7 +76,7 @@ internal class FSMImpl(ctx: Context) : IFlow<FSMStatus>(ctx), IMoGoAutopilotStat
|
||||
CallerAutoPilotStatusListenerManager.addListener(TAG, this)
|
||||
CallerFsm2024ListenerManager.addListener(TAG, this)
|
||||
CallerNodeStateListenerManager.addNodeStateListener(TAG, setOf(AdasConstants.NodeName.FSM2024), this)
|
||||
CallerOrderListenerManager.addListener(TAG, this)
|
||||
CallerDataCenterBizListener.addListener(TAG, this)
|
||||
}
|
||||
override fun onAutopilotIpcConnectStatusChanged(
|
||||
status: AdasConstants.IpcConnectionStatus,
|
||||
@@ -127,8 +127,8 @@ internal class FSMImpl(ctx: Context) : IFlow<FSMStatus>(ctx), IMoGoAutopilotStat
|
||||
}
|
||||
}
|
||||
|
||||
override fun onLoginStatusUpdate(isLogin: Boolean) {
|
||||
super.onLoginStatusUpdate(isLogin)
|
||||
override fun invokeLoginStatus(isLogin: Boolean) {
|
||||
super.invokeLoginStatus(isLogin)
|
||||
if (!isLogin) {
|
||||
CallerLogger.d(TAG, "onLoginStatusUpdate isLogin=$isLogin")
|
||||
CallerHmiManager.dismissFSMExceptionStatusWindow()
|
||||
@@ -141,6 +141,6 @@ internal class FSMImpl(ctx: Context) : IFlow<FSMStatus>(ctx), IMoGoAutopilotStat
|
||||
CallerAutoPilotStatusListenerManager.removeListener(TAG)
|
||||
CallerFsm2024ListenerManager.removeListener(TAG)
|
||||
CallerNodeStateListenerManager.removeNodeStateListener(TAG)
|
||||
CallerOrderListenerManager.removeListener(TAG)
|
||||
CallerDataCenterBizListener.removeListener(TAG)
|
||||
}
|
||||
}
|
||||
@@ -46,11 +46,9 @@ import com.mogo.eagle.core.data.deva.report.CategoryInfo
|
||||
import com.mogo.eagle.core.data.deva.report.PadAddProblemReq
|
||||
import com.mogo.eagle.core.data.deva.report.PadProblemInfo
|
||||
import com.mogo.eagle.core.function.api.devatools.IMoGoDevaToolsListener
|
||||
import com.mogo.eagle.core.function.api.order.IOrderListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsListenerManager
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager
|
||||
import com.mogo.eagle.core.function.call.order.CallerOrderListenerManager
|
||||
import com.mogo.eagle.core.utilcode.util.BarUtils
|
||||
import com.mogo.eagle.core.utilcode.util.JsonParser
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils
|
||||
@@ -66,9 +64,9 @@ import com.zhjt.mogo_core_function_devatools.workorder.adapter.OrderReasonAdapte
|
||||
* 故障原因编辑窗口
|
||||
*/
|
||||
class FaultReasonWindow constructor(activity: Activity) : View.OnTouchListener,
|
||||
IMoGoDevaToolsListener, IOrderListener {
|
||||
IMoGoDevaToolsListener {
|
||||
|
||||
companion object{
|
||||
companion object {
|
||||
const val TAG = "FaultReasonWindow"
|
||||
}
|
||||
|
||||
@@ -84,6 +82,7 @@ class FaultReasonWindow constructor(activity: Activity) : View.OnTouchListener,
|
||||
|
||||
// 语音听写对象
|
||||
private var mIat: SpeechRecognizer? = null
|
||||
|
||||
// 用HashMap存储听写结果
|
||||
private val mIatResults: HashMap<String, String> = LinkedHashMap()
|
||||
|
||||
@@ -126,8 +125,8 @@ class FaultReasonWindow constructor(activity: Activity) : View.OnTouchListener,
|
||||
private var hasLevel2: Boolean = false //是否有二级分类
|
||||
private var hasLevel3: Boolean = false //是否有三级分类
|
||||
|
||||
private var typeList: List<CategoryInfo> ?= null //故障类型列表
|
||||
private var reasonList: List<CategoryInfo> ?= null //故障原因列表
|
||||
private var typeList: List<CategoryInfo>? = null //故障类型列表
|
||||
private var reasonList: List<CategoryInfo>? = null //故障原因列表
|
||||
|
||||
private var faultTypeSelectStatus: Boolean = false //故障类型选择状态
|
||||
private var faultReasonSelectStatus: Boolean = false //故障原因选择状态
|
||||
@@ -139,8 +138,9 @@ class FaultReasonWindow constructor(activity: Activity) : View.OnTouchListener,
|
||||
}
|
||||
|
||||
@SuppressLint("InflateParams")
|
||||
private fun initFloatWindow(){
|
||||
mFloatLayout = LayoutInflater.from(mActivity).inflate(R.layout.view_fault_reason, null) as View
|
||||
private fun initFloatWindow() {
|
||||
mFloatLayout =
|
||||
LayoutInflater.from(mActivity).inflate(R.layout.view_fault_reason, null) as View
|
||||
mFloatLayout.setOnTouchListener(this)
|
||||
|
||||
// 初始化识别无UI识别对象
|
||||
@@ -160,7 +160,7 @@ class FaultReasonWindow constructor(activity: Activity) : View.OnTouchListener,
|
||||
}
|
||||
}
|
||||
|
||||
private fun initView(){
|
||||
private fun initView() {
|
||||
tvFaultTitle = mFloatLayout.findViewById(R.id.tvFaultTitle)
|
||||
tvFaultTime = mFloatLayout.findViewById(R.id.tvFaultTime)
|
||||
tvFaultType = mFloatLayout.findViewById(R.id.tvFaultType)
|
||||
@@ -179,28 +179,34 @@ class FaultReasonWindow constructor(activity: Activity) : View.OnTouchListener,
|
||||
linearLayoutManager.orientation = LinearLayoutManager.VERTICAL
|
||||
rvFaultList.layoutManager = linearLayoutManager
|
||||
orderReasonAdapter = OrderReasonAdapter()
|
||||
orderReasonAdapter.setListener(object: OrderReasonAdapter.ReasonSelectListener{
|
||||
orderReasonAdapter.setListener(object : OrderReasonAdapter.ReasonSelectListener {
|
||||
override fun onSelectReason(reason: CategoryInfo, mSource: Int) {
|
||||
if(mSource == 1){
|
||||
if (mSource == 1) {
|
||||
//类型
|
||||
tvFaultType.text = reason.name
|
||||
//选择了故障类型
|
||||
tvFaultType.performClick()
|
||||
if(level2Id != 0 && level2Id == reason.id){
|
||||
if (level2Id != 0 && level2Id == reason.id) {
|
||||
//故障类型选择没有变化
|
||||
reasonList?.let { orderReasonAdapter.setData(it,2) }
|
||||
}else{
|
||||
reasonList?.let { orderReasonAdapter.setData(it, 2) }
|
||||
} else {
|
||||
//故障类型发生了变化
|
||||
level2Id = reason.id
|
||||
level2Name = reason.name
|
||||
source = 2
|
||||
//获取故障三级分类即故障原因
|
||||
CallerDevaToolsManager.getCategories(BadCaseConfig.tenantId,3,level2Id,type,0)
|
||||
CallerDevaToolsManager.getCategories(
|
||||
BadCaseConfig.tenantId,
|
||||
3,
|
||||
level2Id,
|
||||
type,
|
||||
0
|
||||
)
|
||||
tvFaultReason.text = ""
|
||||
level3Id = 0
|
||||
level3Name = ""
|
||||
}
|
||||
}else{
|
||||
} else {
|
||||
//原因
|
||||
tvFaultReason.text = reason.name
|
||||
tvFaultReason.performClick()
|
||||
@@ -213,33 +219,32 @@ class FaultReasonWindow constructor(activity: Activity) : View.OnTouchListener,
|
||||
}
|
||||
|
||||
@SuppressLint("SetTextI18n")
|
||||
private fun initEvent(){
|
||||
private fun initEvent() {
|
||||
CallerDevaToolsListenerManager.addListener(TAG, this)
|
||||
CallerOrderListenerManager.addListener(TAG,this)
|
||||
val iconDown = ContextCompat.getDrawable(mActivity, R.drawable.icon_fault_expand)
|
||||
iconDown?.setBounds(0, 0, iconDown.minimumWidth, iconDown.minimumHeight)
|
||||
val iconUp = ContextCompat.getDrawable(mActivity, R.drawable.icon_fault_retract)
|
||||
iconUp?.setBounds(0, 0, iconUp.minimumWidth, iconUp.minimumHeight)
|
||||
//获取一级分类
|
||||
CallerDevaToolsManager.getCategories(BadCaseConfig.tenantId,1,0,type,0)
|
||||
CallerDevaToolsManager.getCategories(BadCaseConfig.tenantId, 1, 0, type, 0)
|
||||
//弹窗展示时间
|
||||
tvFaultTime.text = mActivity.resources.getString(R.string.take_over_time) +
|
||||
millis2String(System.currentTimeMillis(), TimeUtils.getHourMinSecondFormat())
|
||||
//故障类型选择
|
||||
tvFaultType.setOnClickListener {
|
||||
if(!hasLevel2){
|
||||
if (!hasLevel2) {
|
||||
ToastUtils.showShort("运营后台没有配置故障类型")
|
||||
return@setOnClickListener
|
||||
}
|
||||
if(faultTypeSelectStatus){
|
||||
if (faultTypeSelectStatus) {
|
||||
//关闭
|
||||
faultTypeSelectStatus = false
|
||||
tvFaultType.setCompoundDrawables(null, null, iconDown, null)
|
||||
//隐藏列表
|
||||
rvFaultList.visibility = View.GONE
|
||||
}else{
|
||||
} else {
|
||||
//如果故障原因此时为打开状态,则关闭
|
||||
if(faultReasonSelectStatus){
|
||||
if (faultReasonSelectStatus) {
|
||||
tvFaultReason.performClick()
|
||||
}
|
||||
//打开
|
||||
@@ -247,68 +252,76 @@ class FaultReasonWindow constructor(activity: Activity) : View.OnTouchListener,
|
||||
tvFaultType.setCompoundDrawables(null, null, iconUp, null)
|
||||
//展示列表
|
||||
rvFaultList.visibility = View.VISIBLE
|
||||
(rvFaultList.layoutParams as ConstraintLayout.LayoutParams).topToBottom = R.id.tvFaultType
|
||||
(rvFaultList.layoutParams as ConstraintLayout.LayoutParams).topToBottom =
|
||||
R.id.tvFaultType
|
||||
source = 1
|
||||
if(typeList.isNullOrEmpty()){
|
||||
if (typeList.isNullOrEmpty()) {
|
||||
//获取故障二级分类即故障类型
|
||||
CallerDevaToolsManager.getCategories(BadCaseConfig.tenantId,2,level1Id,type,0)
|
||||
}else{
|
||||
orderReasonAdapter.setData(typeList!!,source)
|
||||
CallerDevaToolsManager.getCategories(
|
||||
BadCaseConfig.tenantId,
|
||||
2,
|
||||
level1Id,
|
||||
type,
|
||||
0
|
||||
)
|
||||
} else {
|
||||
orderReasonAdapter.setData(typeList!!, source)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
//故障原因选择
|
||||
tvFaultReason.setOnClickListener {
|
||||
if(tvFaultType.text.isEmpty()){
|
||||
if (tvFaultType.text.isEmpty()) {
|
||||
ToastUtils.showShort("请先选择故障类型")
|
||||
return@setOnClickListener
|
||||
}
|
||||
if(faultReasonSelectStatus){
|
||||
if (faultReasonSelectStatus) {
|
||||
//关闭
|
||||
faultReasonSelectStatus = false
|
||||
tvFaultReason.setCompoundDrawables(null, null, iconDown, null)
|
||||
//隐藏列表
|
||||
rvFaultList.visibility = View.GONE
|
||||
}else{
|
||||
} else {
|
||||
//打开
|
||||
faultReasonSelectStatus = true
|
||||
tvFaultReason.setCompoundDrawables(null, null, iconUp, null)
|
||||
//展示列表
|
||||
rvFaultList.visibility = View.VISIBLE
|
||||
(rvFaultList.layoutParams as ConstraintLayout.LayoutParams).topToBottom = R.id.tvFaultReason
|
||||
(rvFaultList.layoutParams as ConstraintLayout.LayoutParams).topToBottom =
|
||||
R.id.tvFaultReason
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//发生时间
|
||||
tvOccurrenceTime.text = millis2String(workOrderOccurrenceTime, TimeUtils.getHourMinFormat())
|
||||
ivTimeReduce.setOnClickListener {
|
||||
workOrderOccurrenceTime -= 60000
|
||||
tvOccurrenceTime.text = millis2String(workOrderOccurrenceTime, TimeUtils.getHourMinFormat())
|
||||
tvOccurrenceTime.text =
|
||||
millis2String(workOrderOccurrenceTime, TimeUtils.getHourMinFormat())
|
||||
}
|
||||
ivTimeAdd.setOnClickListener {
|
||||
if(workOrderOccurrenceTime + 60000 > System.currentTimeMillis()){
|
||||
if (workOrderOccurrenceTime + 60000 > System.currentTimeMillis()) {
|
||||
ToastUtils.showShort("发生时间应在当前时间之前")
|
||||
return@setOnClickListener
|
||||
}
|
||||
workOrderOccurrenceTime += 60000
|
||||
tvOccurrenceTime.text = millis2String(workOrderOccurrenceTime, TimeUtils.getHourMinFormat())
|
||||
tvOccurrenceTime.text =
|
||||
millis2String(workOrderOccurrenceTime, TimeUtils.getHourMinFormat())
|
||||
}
|
||||
//补充描述
|
||||
etNoteInput.onFocusChangeListener = OnFocusChangeListener { v, hasFocus ->
|
||||
val edit = v as EditText
|
||||
if(hasFocus){
|
||||
if (hasFocus) {
|
||||
edit.hint = ""
|
||||
}else{
|
||||
} else {
|
||||
edit.hint = "手动输入"
|
||||
}
|
||||
}
|
||||
etNoteInput.addTextChangedListener(object: TextWatcher{
|
||||
etNoteInput.addTextChangedListener(object : TextWatcher {
|
||||
override fun beforeTextChanged(s: CharSequence?, start: Int, count: Int, after: Int) {
|
||||
|
||||
}
|
||||
@@ -325,26 +338,30 @@ class FaultReasonWindow constructor(activity: Activity) : View.OnTouchListener,
|
||||
//问题描述录音
|
||||
ivNoteAudio.setOnClickListener {
|
||||
audioStatus = !audioStatus
|
||||
if(audioStatus){
|
||||
ivNoteAudio.setImageDrawable(ContextCompat.getDrawable(
|
||||
mActivity,
|
||||
R.drawable.icon_reason_audio_pressed
|
||||
))
|
||||
}else{
|
||||
ivNoteAudio.setImageDrawable(ContextCompat.getDrawable(
|
||||
mActivity,
|
||||
R.drawable.icon_reason_audio_normal
|
||||
))
|
||||
if (audioStatus) {
|
||||
ivNoteAudio.setImageDrawable(
|
||||
ContextCompat.getDrawable(
|
||||
mActivity,
|
||||
R.drawable.icon_reason_audio_pressed
|
||||
)
|
||||
)
|
||||
} else {
|
||||
ivNoteAudio.setImageDrawable(
|
||||
ContextCompat.getDrawable(
|
||||
mActivity,
|
||||
R.drawable.icon_reason_audio_normal
|
||||
)
|
||||
)
|
||||
}
|
||||
setAudio(audioStatus)
|
||||
}
|
||||
//上报
|
||||
tvFaultReport.setOnClickListener{
|
||||
if(level2Name.isEmpty()){
|
||||
tvFaultReport.setOnClickListener {
|
||||
if (level2Name.isEmpty()) {
|
||||
ToastUtils.showShort("请完整填写再上报")
|
||||
return@setOnClickListener
|
||||
}
|
||||
if(hasLevel3 && level3Name.isEmpty()){
|
||||
if (hasLevel3 && level3Name.isEmpty()) {
|
||||
ToastUtils.showShort("请完整填写再上报")
|
||||
return@setOnClickListener
|
||||
}
|
||||
@@ -354,22 +371,26 @@ class FaultReasonWindow constructor(activity: Activity) : View.OnTouchListener,
|
||||
faultCodeList.add(it.faultId)
|
||||
}
|
||||
val geocodeSearch = GeocodeSearch(mActivity)
|
||||
geocodeSearch.setOnGeocodeSearchListener(object: GeocodeSearch.OnGeocodeSearchListener {
|
||||
geocodeSearch.setOnGeocodeSearchListener(object :
|
||||
GeocodeSearch.OnGeocodeSearchListener {
|
||||
override fun onRegeocodeSearched(regeocodeResult: RegeocodeResult?, p1: Int) {
|
||||
regeocodeResult?.regeocodeAddress?.formatAddress?.let {
|
||||
address = it
|
||||
}
|
||||
val padProblemList= ArrayList<PadProblemInfo>()
|
||||
val note = if(reportNote.isEmpty()){
|
||||
val padProblemList = ArrayList<PadProblemInfo>()
|
||||
val note = if (reportNote.isEmpty()) {
|
||||
"$level1Name-$level2Name-$level3Name"
|
||||
}else{
|
||||
} else {
|
||||
"$level1Name-$level2Name-$level3Name($reportNote)"
|
||||
}
|
||||
val padProblemInfo = PadProblemInfo(address,faultCodeList,millis2String(workOrderOccurrenceTime),level1Id,
|
||||
level2Id,level3Id,BadCaseConfig.lineName,note,reportType,
|
||||
SharedPrefsMgr.getInstance().getString("och_account",""))
|
||||
val padProblemInfo = PadProblemInfo(
|
||||
address, faultCodeList, millis2String(workOrderOccurrenceTime), level1Id,
|
||||
level2Id, level3Id, BadCaseConfig.lineName, note, reportType,
|
||||
SharedPrefsMgr.getInstance().getString("och_account", "")
|
||||
)
|
||||
padProblemList.add(padProblemInfo)
|
||||
val padAddProblemReq = PadAddProblemReq(padProblemList,AppConfigInfo.plateNumber)
|
||||
val padAddProblemReq =
|
||||
PadAddProblemReq(padProblemList, AppConfigInfo.plateNumber)
|
||||
CallerDevaToolsManager.problemPadAdd(padAddProblemReq)
|
||||
}
|
||||
|
||||
@@ -377,8 +398,11 @@ class FaultReasonWindow constructor(activity: Activity) : View.OnTouchListener,
|
||||
|
||||
}
|
||||
})
|
||||
val latLon = LatLonPoint(CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84().latitude, CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84().longitude)
|
||||
val q = RegeocodeQuery(latLon,200f,GeocodeSearch.AMAP)
|
||||
val latLon = LatLonPoint(
|
||||
CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84().latitude,
|
||||
CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84().longitude
|
||||
)
|
||||
val q = RegeocodeQuery(latLon, 200f, GeocodeSearch.AMAP)
|
||||
geocodeSearch.getFromLocationAsyn(q)
|
||||
}
|
||||
//取消
|
||||
@@ -388,8 +412,8 @@ class FaultReasonWindow constructor(activity: Activity) : View.OnTouchListener,
|
||||
|
||||
}
|
||||
|
||||
private fun setAudio(status: Boolean){
|
||||
if(status){
|
||||
private fun setAudio(status: Boolean) {
|
||||
if (status) {
|
||||
//开始录音
|
||||
mIat?.let {
|
||||
//清空之前的内容
|
||||
@@ -405,11 +429,12 @@ class FaultReasonWindow constructor(activity: Activity) : View.OnTouchListener,
|
||||
val scaleAnimation = ScaleAnimation(
|
||||
1.0f, 0.8f, 1.0f, 0.8f,
|
||||
Animation.RELATIVE_TO_SELF, 0.5f,
|
||||
Animation.RELATIVE_TO_SELF, 0.5f)
|
||||
Animation.RELATIVE_TO_SELF, 0.5f
|
||||
)
|
||||
scaleAnimation.duration = 1000
|
||||
scaleAnimation.repeatCount = -1
|
||||
ivNoteAudio.startAnimation(scaleAnimation)
|
||||
}else{
|
||||
} else {
|
||||
//停止语音听写
|
||||
mIat?.stopListening()
|
||||
//结束动画
|
||||
@@ -433,7 +458,7 @@ class FaultReasonWindow constructor(activity: Activity) : View.OnTouchListener,
|
||||
/**
|
||||
* 听写监听器。
|
||||
*/
|
||||
private val mRecognizerListener: RecognizerListener = object : RecognizerListener{
|
||||
private val mRecognizerListener: RecognizerListener = object : RecognizerListener {
|
||||
override fun onVolumeChanged(p0: Int, p1: ByteArray?) {
|
||||
//showTip("当前正在说话,音量大小 = " + volume + " 返回音频数据 = " + data.length);
|
||||
}
|
||||
@@ -479,15 +504,16 @@ class FaultReasonWindow constructor(activity: Activity) : View.OnTouchListener,
|
||||
private fun printResult(results: RecognizerResult) {
|
||||
val text: String = JsonParser.parseIatResult(results.resultString)
|
||||
Log.i(TAG, "语音内容=$text")
|
||||
if(text.isNotEmpty()){
|
||||
if(etNoteInput.text.toString().isEmpty()){
|
||||
if (text.isNotEmpty()) {
|
||||
if (etNoteInput.text.toString().isEmpty()) {
|
||||
etNoteInput.setText(text)
|
||||
etNoteInput.setSelection(text.length)
|
||||
}else{
|
||||
val startStr = etNoteInput.text.toString().substring(0,etNoteInput.selectionStart)
|
||||
val endStr = etNoteInput.text.toString().substring(etNoteInput.selectionEnd,etNoteInput.text.toString().length)
|
||||
etNoteInput.setText(startStr+text+endStr)
|
||||
etNoteInput.setSelection(startStr.length+text.length)
|
||||
} else {
|
||||
val startStr = etNoteInput.text.toString().substring(0, etNoteInput.selectionStart)
|
||||
val endStr = etNoteInput.text.toString()
|
||||
.substring(etNoteInput.selectionEnd, etNoteInput.text.toString().length)
|
||||
etNoteInput.setText(startStr + text + endStr)
|
||||
etNoteInput.setSelection(startStr.length + text.length)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -505,6 +531,7 @@ class FaultReasonWindow constructor(activity: Activity) : View.OnTouchListener,
|
||||
mInScreenX = motionEvent.rawX
|
||||
mInScreenY = motionEvent.rawY
|
||||
}
|
||||
|
||||
MotionEvent.ACTION_MOVE -> {
|
||||
// 更新浮动窗口位置参数
|
||||
mInScreenX = motionEvent.rawX
|
||||
@@ -523,19 +550,16 @@ class FaultReasonWindow constructor(activity: Activity) : View.OnTouchListener,
|
||||
val metrics = DisplayMetrics()
|
||||
// 默认固定位置,靠屏幕右边缘的中间
|
||||
mWindowManager!!.defaultDisplay.getMetrics(metrics)
|
||||
mWindowParams!!.x = metrics.widthPixels-890
|
||||
mWindowParams!!.y = metrics.heightPixels - BarUtils.getStatusBarHeight()-1140
|
||||
mWindowParams!!.x = metrics.widthPixels - 890
|
||||
mWindowParams!!.y = metrics.heightPixels - BarUtils.getStatusBarHeight() - 1140
|
||||
mWindowManager!!.addView(mFloatLayout, mWindowParams)
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
fun hideFloatWindow() {
|
||||
etNoteInput.clearFocus()
|
||||
CallerDevaToolsListenerManager.removeListener(TAG)
|
||||
CallerOrderListenerManager.removeListener(TAG)
|
||||
if (mFloatLayout.parent != null){
|
||||
if (mFloatLayout.parent != null) {
|
||||
mWindowManager!!.removeView(mFloatLayout)
|
||||
}
|
||||
}
|
||||
@@ -563,7 +587,7 @@ class FaultReasonWindow constructor(activity: Activity) : View.OnTouchListener,
|
||||
val successHandler = Handler(Looper.getMainLooper())
|
||||
successHandler.postDelayed({
|
||||
hideFloatWindow()
|
||||
},1500)
|
||||
}, 1500)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -575,28 +599,34 @@ class FaultReasonWindow constructor(activity: Activity) : View.OnTouchListener,
|
||||
override fun getCategoriesSuccess(list: List<CategoryInfo>) {
|
||||
super.getCategoriesSuccess(list)
|
||||
ThreadUtils.runOnUiThread {
|
||||
if(list.isNotEmpty()){
|
||||
if(source == 0){
|
||||
if (list.isNotEmpty()) {
|
||||
if (source == 0) {
|
||||
level1Id = list[0].id
|
||||
level1Name = list[0].name
|
||||
|
||||
source = 1
|
||||
//获取故障二级分类即故障类型
|
||||
CallerDevaToolsManager.getCategories(BadCaseConfig.tenantId,2,level1Id,type,0)
|
||||
}else{
|
||||
if(source == 1){
|
||||
CallerDevaToolsManager.getCategories(
|
||||
BadCaseConfig.tenantId,
|
||||
2,
|
||||
level1Id,
|
||||
type,
|
||||
0
|
||||
)
|
||||
} else {
|
||||
if (source == 1) {
|
||||
typeList = list
|
||||
hasLevel2 = true
|
||||
}else{
|
||||
} else {
|
||||
reasonList = list
|
||||
hasLevel3 = true
|
||||
}
|
||||
orderReasonAdapter.setData(list,source)
|
||||
orderReasonAdapter.setData(list, source)
|
||||
}
|
||||
}else{
|
||||
if(source == 2){
|
||||
} else {
|
||||
if (source == 2) {
|
||||
hasLevel3 = false
|
||||
}else{
|
||||
} else {
|
||||
hasLevel2 = false
|
||||
ToastUtils.showShort("故障类型列表为空")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user