riku
2022-06-17 d2ec5bfc26119a08985059ab3dabacea8275e45b
src/main/kotlin/cn/flightfeather/supervision/common/score/AutoScore.kt
@@ -94,8 +94,8 @@
    }
    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 out = FileOutputStream(File(filePath))
        getScoreItem()
@@ -103,10 +103,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")
        })
@@ -166,7 +164,8 @@
                it.realname,
                SCENE_TYPE,
                year,
                month
                month,
                now
            )
            var score = 0
@@ -280,21 +279,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()