From 027bf7da7a012fa36f8835b2419c74da8b2f1c28 Mon Sep 17 00:00:00 2001
From: feiyu02 <risaku@163.com>
Date: 星期二, 15 十一月 2022 11:00:21 +0800
Subject: [PATCH] 2022.11.15

---
 src/main/kotlin/cn/flightfeather/supervision/common/score/AutoScore.kt |   32 ++++++++++++++------------------
 1 files changed, 14 insertions(+), 18 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 d100e3a..29092cd 100644
--- a/src/main/kotlin/cn/flightfeather/supervision/common/score/AutoScore.kt
+++ b/src/main/kotlin/cn/flightfeather/supervision/common/score/AutoScore.kt
@@ -94,8 +94,9 @@
     }
 
     fun go(_year: Int? = null, _month: Int? = null) {
-        val fileName = "姹戒慨鑷姩璇勫垎-${DateUtil().DateToString(Date(), "yyyy-MM-ddhhmmss")}.xls"
-        val filePath = "E:\\宸ヤ綔\\寮�鍙慭\椋炵窘鐜app\\鑷姩璇勫垎\\姹戒慨\\$fileName"
+        val fileName = "${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()
@@ -103,10 +104,8 @@
         val userList = userinfoMapper.selectByExample(Example(Userinfo::class.java).apply {
             createCriteria().andEqualTo("usertypeid", UserType.Enterprise.value.toByte())
                 // FIXME: 2021/4/28 鍦烘櫙绫诲瀷 
-//                    姹戒慨绫诲瀷
                 .andEqualTo("extension2", SCENE_TYPE.value.toString())
-//            椁愰ギ绫诲瀷
-//                .andEqualTo("extension2", SCENE_TYPE.value.toString())
+                .andEqualTo("isenable", true)
 //            orderBy("workno")
         })
 
@@ -149,7 +148,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"
 
@@ -166,7 +165,8 @@
                 it.realname,
                 SCENE_TYPE,
                 year,
-                month
+                month,
+                now
             )
 
             var score = 0
@@ -280,21 +280,17 @@
                 }
             } ?: 0
             // 鍐欏叆鏁版嵁搴�
-//            if (r > 0) {
-//                evaluationList.forEach { el -> evaluationMapper.insert(el) }
-//                itemevaluationList.forEach { il -> itemevaluationMapper.insert(il) }
-                for (e in evaluationList) {
-                    if (e.ertype?.toInt()?.equals(0) == true) {
-                        finalScore(e, year, eMonth, period)
-                        break
-                    }
-                }
+//            for (e in evaluationList) {
+//                if (e.ertype?.toInt()?.equals(0) == true) {
+//                    finalScore(e, year, eMonth, period)
+//                    break
+//                }
 //            }
         }
 
         // 鍐欏叆鏂囨。
-//        ExcelUtil.write2(emptyList(), contents, workbook)
-//        workbook.write(out)
+        ExcelUtil.write2(emptyList(), contents, workbook)
+        workbook.write(out)
         workbook.close()
         out.flush()
         out.close()

--
Gitblit v1.9.3