|
@@ -123,5 +123,25 @@ class JobProgressPresenter : BasePresenter<IJobProgressVIew>() {
|
|
|
*/
|
|
*/
|
|
|
fun handleUnlockProcess(ticketId: Long) {
|
|
fun handleUnlockProcess(ticketId: Long) {
|
|
|
// TODO 上锁人解锁流程
|
|
// TODO 上锁人解锁流程
|
|
|
|
|
+ getTicketDetail(ticketId) { ticketDetail ->
|
|
|
|
|
+ val role = ticketDetail?.jobTicketUserList?.find { it.userId == SPUtils.getLoginUser(mContext!!)?.userId && it.userType == USER_TYPE_LOCKER }
|
|
|
|
|
+ if (role == null) {
|
|
|
|
|
+ return@getTicketDetail
|
|
|
|
|
+ }
|
|
|
|
|
+ BusinessManager.checkEquipCount(0) { keyPair, _ ->
|
|
|
|
|
+ // null表示锁具数量不够,不给钥匙
|
|
|
|
|
+ if (keyPair != null) {
|
|
|
|
|
+ // 更新钥匙信息
|
|
|
|
|
+ NetApi.updateKeyTake(ticketDetail.ticketId!!, keyPair.second?.rfid!!, mContext!!.serialNo()) {
|
|
|
|
|
+ if (it) {
|
|
|
|
|
+ // 下发工作票
|
|
|
|
|
+ BusinessManager.sendTicketBusiness(keyPair.second?.mac!!, ticketDetail, mvpView as TicketDetailActivity) { b, s, rst ->
|
|
|
|
|
+ (mvpView as TicketDetailActivity).handleLoading(b, s)
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|