|
@@ -26,11 +26,15 @@
|
|
|
|
|
|
package com.persagy.server.services.task
|
|
|
|
|
|
+import com.persagy.database.SFilter
|
|
|
import com.persagy.mybatis.SMybatisDao
|
|
|
+import com.persagy.server.Opts
|
|
|
import com.persagy.server.datacenter.models.entities.task.RecordProblems
|
|
|
+import com.persagy.server.scanbuilding.UserLog
|
|
|
import com.persagy.server.services.base.RService
|
|
|
import com.persagy.server.util.IdUtils
|
|
|
import com.persagy.service.SPageContext
|
|
|
+import org.checkerframework.checker.nullness.Opt
|
|
|
|
|
|
|
|
|
/**
|
|
@@ -48,10 +52,42 @@ object RecordProblemsService : RService<RecordProblems>(SMybatisDao(RecordProble
|
|
|
if (entity.projectId.isNullOrEmpty()){
|
|
|
entity.projectId = projectId
|
|
|
}
|
|
|
-
|
|
|
+ try {
|
|
|
+ if (!Opts.account.isNullOrEmpty()) {
|
|
|
+ val entity1 = ModelScanTaskService.userService.select(SFilter.eq("projectId",Opts.projectId!!), SFilter.eq("phone", Opts.account!!)).entity()
|
|
|
+ if (entity1!=null) {
|
|
|
+ entity.author = entity1.name
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } catch (e: Exception) {
|
|
|
+ e.printStackTrace()
|
|
|
+ }
|
|
|
return super.onCreateBefore(entity)
|
|
|
}
|
|
|
|
|
|
+ override fun onCreateSuccess(entityList: ArrayList<RecordProblems>) {
|
|
|
+ super.onCreateSuccess(entityList)
|
|
|
+ try {
|
|
|
+ if (!Opts.coming.isNullOrEmpty()&& Opts.coming == "app"){
|
|
|
+ val entity = ModelScanTaskService.userService.select(SFilter.eq("projectId",Opts.projectId!!), SFilter.eq("phone", Opts.account!!)).entity()
|
|
|
+ val userLog = UserLog()
|
|
|
+ userLog.comming = "app"
|
|
|
+ userLog.action = "问题记录"
|
|
|
+ userLog.id = IdUtils.uuidCreate()
|
|
|
+ userLog.note = "记录扫楼过程的问题"
|
|
|
+ userLog.phone = entity?.phone
|
|
|
+ userLog.projectId = Opts.projectId
|
|
|
+ userLog.userId = entity!!.id
|
|
|
+ userLog.name = entity.name
|
|
|
+ userLog.objectId = entityList[0].id
|
|
|
+ ModelScanTaskService.userLogService.insert(userLog)
|
|
|
+ }
|
|
|
+ } catch (e: Exception) {
|
|
|
+ e.printStackTrace()
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
|
|
|
|