package cn.flightfeather.supervision
|
|
|
import cn.flightfeather.supervision.domain.entity.Evaluation
|
import cn.flightfeather.supervision.domain.entity.Userinfo
|
import cn.flightfeather.supervision.domain.enumeration.UserType
|
import cn.flightfeather.supervision.domain.mapper.*
|
import cn.flightfeather.supervision.lightshare.service.DeviceService
|
import cn.flightfeather.supervision.lightshare.service.EvaluationService
|
import cn.flightfeather.supervision.lightshare.service.LedgerService
|
import cn.flightfeather.supervision.lightshare.service.NotificationService
|
import cn.flightfeather.supervision.lightshare.vo.NoticeReadStateVo
|
import org.junit.Test
|
import org.junit.jupiter.api.extension.ExtendWith
|
import org.junit.runner.RunWith
|
import org.springframework.beans.factory.annotation.Autowired
|
import org.springframework.boot.test.context.SpringBootTest
|
import org.springframework.test.context.junit.jupiter.SpringExtension
|
import org.springframework.test.context.junit4.SpringRunner
|
import tk.mybatis.mapper.entity.Example
|
|
@RunWith(SpringRunner::class)
|
@ExtendWith(SpringExtension::class)
|
@SpringBootTest
|
class SupervisionApplicationTests {
|
|
@Autowired
|
private lateinit var participantMapper: ParticipantMapper
|
|
@Autowired
|
private lateinit var deviceService: DeviceService
|
|
@Autowired
|
private lateinit var ledgerRecordMapper: LedgerRecordMapper
|
@Autowired
|
private lateinit var ledgerService: LedgerService
|
@Autowired
|
private lateinit var evaluationMapper: EvaluationMapper
|
@Autowired
|
private lateinit var evaluService: EvaluationService
|
@Autowired
|
private lateinit var userinfoMapper: UserinfoMapper
|
@Autowired
|
private lateinit var notificationService: NotificationService
|
|
@Test
|
fun contextLoads() {
|
|
}
|
|
@Test
|
fun foo3() {
|
val l = deviceService.getLatestHourValue("nVMiV6i1UvLqahOc")
|
println(l)
|
}
|
|
@Test
|
fun foo4() {
|
val timeList = listOf("2023-06-01","2023-07-01","2023-08-01")
|
val lList = listOf("ziYYMBiyZiKCj3Kw","bAdaVtgd8HF6NLAc","b9qhmvqYgXIVsGZS")
|
val timeList2 = listOf("2023/6-6","2023/7-7 ","2023/8-8")
|
val lList2 = listOf("h3s6FvnHoEizF0xp","WpZnJupKfZ8ovw1P","uUddc0pOrkaFgRFq")
|
userinfoMapper.selectByExample(Example(Userinfo::class.java).apply {
|
createCriteria().andEqualTo("usertypeid", UserType.Enterprise.value)
|
.andIsNotNull("uiLoginTime")
|
and(createCriteria().orIsNull("workno").orNotEqualTo("workno", "test"))
|
}).forEach {
|
it ?: return@forEach
|
it.guid ?: return@forEach
|
it.extension2 ?: return@forEach
|
for (y in timeList.indices) {
|
val t = timeList[y]
|
val l1 = ledgerService.getUserLedgerSummary(it.guid!!, it.extension2!!.toInt(), t)
|
for (i in l1.indices) {
|
if (l1[i].upLoad && l1[i].involved) {
|
notificationService.updateReadState(it.guid!!, listOf(NoticeReadStateVo(lList[y],
|
hasRead = true,
|
hasSigned = true)))
|
break
|
}
|
}
|
}
|
for (y in timeList2.indices) {
|
val t = timeList2[y]
|
val l = evaluationMapper.selectByExample(Example(Evaluation::class.java).apply {
|
createCriteria().andEqualTo("evaluatorguid", it.guid)
|
.andEqualTo("scensename", t)
|
})
|
if (l.isNotEmpty()) {
|
notificationService.updateReadState(it.guid!!, listOf(NoticeReadStateVo(lList2[y],
|
hasRead = true,
|
hasSigned = true)))
|
}
|
}
|
println("")
|
}
|
}
|
|
}
|