feiyu02
2025-09-30 6904763f0e74d9a9fa4dbc39f635d2aee39416c6
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
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("")
        }
    }
 
}