From 53ce8de426561e7a43847afda23b5e24e6f76c4e Mon Sep 17 00:00:00 2001
From: feiyu02 <risaku@163.com>
Date: 星期一, 19 一月 2026 17:29:55 +0800
Subject: [PATCH] 2026.1.19 1. 新增可配置的台账提交期限 2. 新增可配置的自巡查承诺
---
src/main/kotlin/cn/flightfeather/supervision/common/score/AutoScore.kt | 62 +++++-------------------------
1 files changed, 11 insertions(+), 51 deletions(-)
diff --git a/src/main/kotlin/cn/flightfeather/supervision/common/score/AutoScore.kt b/src/main/kotlin/cn/flightfeather/supervision/common/score/AutoScore.kt
index d0305c5..62138e6 100644
--- a/src/main/kotlin/cn/flightfeather/supervision/common/score/AutoScore.kt
+++ b/src/main/kotlin/cn/flightfeather/supervision/common/score/AutoScore.kt
@@ -38,6 +38,8 @@
// private val SCENE_TYPE = SceneType.Restaurant
private val SCENE_TYPE = SceneType.VehicleRepair
+
+ private val district = "寰愭眹鍖�"
}
@PostConstruct
@@ -94,20 +96,19 @@
}
fun go(_year: Int? = null, _month: Int? = null) {
- val fileName = "姹戒慨鑷姩璇勫垎-${DateUtil().DateToString(Date(), "yyyy-MM-ddhhmmss")}.xls"
- val filePath = "E:\\宸ヤ綔\\寮�鍙慭\椋炵窘鐜app\\鑷姩璇勫垎\\姹戒慨\\$fileName"
+ val fileName = "${district}${SCENE_TYPE.des}鑷姩璇勫垎-${DateUtil.DateToString(Date(), "yyyy-MM-ddhhmmss")}.xls"
+// val filePath = "E:\\宸ヤ綔\\寮�鍙慭\椋炵窘鐜app\\鑷姩璇勫垎\\${SCENE_TYPE.des}\\$fileName"
+ val filePath = "C:\\work\\宸ヤ綔\\绗笁鏂圭洃绠\鑷姩璇勫垎\\${SCENE_TYPE.des}\\$fileName"
val out = FileOutputStream(File(filePath))
getScoreItem()
val userList = userinfoMapper.selectByExample(Example(Userinfo::class.java).apply {
createCriteria().andEqualTo("usertypeid", UserType.Enterprise.value.toByte())
- // FIXME: 2021/4/28 鍦烘櫙绫诲瀷
-// 姹戒慨绫诲瀷
+ .andEqualTo("extension1", district)
.andEqualTo("extension2", SCENE_TYPE.value.toString())
.andEqualTo("isenable", true)
-// 椁愰ギ绫诲瀷
-// .andEqualTo("extension2", SCENE_TYPE.value.toString())
+ and(createCriteria().orNotEqualTo("workno", "test").orIsNull("workno"))
// orderBy("workno")
})
@@ -150,7 +151,7 @@
val now = LocalDate.now()
val year = _year ?: now.year
val month = _month ?: now.monthValue
- val sMonth = DateUtil().getStartMonthByPeriod(month, 3) ?: 1
+ val sMonth = DateUtil.getStartMonthByPeriod(month, 3) ?: 1
val eMonth = sMonth + 2
val period = "${year}/$sMonth-$eMonth"
@@ -162,9 +163,9 @@
}
val info = Info(
- it.guid,
- it.acountname,
- it.realname,
+ it?.guid,
+ it?.acountname,
+ it?.realname,
SCENE_TYPE,
year,
month,
@@ -377,47 +378,6 @@
name = itemRule.itemname
value = itemRule.extension1 ?: "0"
extension1 = (itemRule.extension1 != null).toString()
- }
-
- private fun write2File(info: Info, evaluations: List<Evaluation>, topItems: MutableList<Evaluationsubrule>,
- rules: MutableList<Pair<Evaluationsubrule, MutableList<Evaluationsubrule>>>) {
-
- val heads = mutableListOf<Array<String>>()
- val contents = mutableListOf<Array<Any>>()
- topItems.forEach {
- val cList = mutableListOf<Any>()
- cList.add(it.itemname ?: "")
- val array1 = mutableListOf<ExcelUtil.MyCell>()
- val array2 = mutableListOf<ExcelUtil.MyCell>()
- val array3 = mutableListOf<ExcelUtil.MyCell>()
- for (r in rules) {
- if (r.first.fatherid == it.guid || r.first.guid == it.guid) {
- array1.add(ExcelUtil.MyCell(r.first.itemname?:"", 0))
-
- r.second.forEach { s ->
- if (s.fatherid == r.first.guid) {
- array2.add(ExcelUtil.MyCell(s.itemname?:"", 1))
- array3.add(ExcelUtil.MyCell(s.extension1?:"", 1))
- array1.last().rowSpan++
- }
- }
- }
- }
- cList.add(array1.toTypedArray())
- cList.add(array2.toTypedArray())
- cList.add(array3.toTypedArray())
- contents.add(cList.toTypedArray())
- }
- evaluations.forEach {
- if ((it.ertype?.toInt() == 0)) {
- val totalScoreList = mutableListOf<Any>()
- totalScoreList.add("鎬诲垎")
- totalScoreList.add(it.resultscorebef ?: "0")
- contents.add(totalScoreList.toTypedArray())
- }
- }
-
- ExcelUtil.write2(heads, contents, workbook!!, info.userName ?: "鏈煡鐢ㄦ埛")
}
private fun addToFile(contents: MutableList<Array<Any>>, info: Info, evaluations: List<Evaluation>, topItems: MutableList<Evaluationsubrule>,
--
Gitblit v1.9.3