From 5670e4a15fba292ef5f8fb90e96072de976bb621 Mon Sep 17 00:00:00 2001
From: feiyu02 <risaku@163.com>
Date: 星期二, 28 六月 2022 14:00:22 +0800
Subject: [PATCH] 1. 中小企业守法自助相关接口更新
---
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/EvaluationService.kt | 5
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/LedgerServiceImpl.kt | 106 ++++++
src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/GradeDetailVo.kt | 28 +
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/EvaluationsubruleService.kt | 3
src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/LedgerSubTypeVo.kt | 14
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/EvaluationsubruleServiceImpl.kt | 147 +++++++++
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/LedgerService.kt | 6
src/main/resources/mapper/LedgerSubTypeMapper.xml | 40 --
src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/EvaluationVo.kt | 45 +++
src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/CopyLedgerVo.kt | 15 +
src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/LedgerCheckVo.kt | 19 +
src/main/kotlin/cn/flightfeather/supervision/lightshare/web/LedgerController.kt | 18 +
src/main/kotlin/cn/flightfeather/supervision/lightshare/web/EvaluationsubruleController.kt | 7
src/main/resources/mapper/LedgerRecordMapper.xml | 2
src/main/kotlin/cn/flightfeather/supervision/lightshare/web/EvaluationController.kt | 17 +
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/UserinfoServiceImpl.kt | 1
src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/AssessmentGradeVo.kt | 3
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/EvaluationServiceImpl.kt | 366 +++++++++++++++++++++++-
src/main/kotlin/cn/flightfeather/supervision/domain/entity/LedgerRecord.java | 6
src/main/resources/application.yml | 12
20 files changed, 776 insertions(+), 84 deletions(-)
diff --git a/src/main/kotlin/cn/flightfeather/supervision/domain/entity/LedgerRecord.java b/src/main/kotlin/cn/flightfeather/supervision/domain/entity/LedgerRecord.java
index 12d937c..3177476 100644
--- a/src/main/kotlin/cn/flightfeather/supervision/domain/entity/LedgerRecord.java
+++ b/src/main/kotlin/cn/flightfeather/supervision/domain/entity/LedgerRecord.java
@@ -43,7 +43,7 @@
private Byte lrEasubmitkind;
@Column(name = "LR_VerifierID")
- private Integer lrVerifierid;
+ private String lrVerifierid;
@Column(name = "LR_VerifierRealName")
private String lrVerifierrealname;
@@ -243,14 +243,14 @@
/**
* @return LR_VerifierID
*/
- public Integer getLrVerifierid() {
+ public String getLrVerifierid() {
return lrVerifierid;
}
/**
* @param lrVerifierid
*/
- public void setLrVerifierid(Integer lrVerifierid) {
+ public void setLrVerifierid(String lrVerifierid) {
this.lrVerifierid = lrVerifierid;
}
diff --git a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/EvaluationService.kt b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/EvaluationService.kt
index 7022128..32eac49 100644
--- a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/EvaluationService.kt
+++ b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/EvaluationService.kt
@@ -4,6 +4,7 @@
import cn.flightfeather.supervision.lightshare.vo.AssessmentGradeVo
import cn.flightfeather.supervision.lightshare.vo.AssessmentSearchCondition
import cn.flightfeather.supervision.lightshare.vo.CreditInfoVo
+import cn.flightfeather.supervision.lightshare.vo.GradeDetailVo
import javax.servlet.http.HttpServletResponse
@@ -27,4 +28,8 @@
fun getAssessments(userId: String, condition: AssessmentSearchCondition, page: Int, perPage: Int, response: HttpServletResponse): List<AssessmentGradeVo>
fun autoScore(year: Int, month: Int, sceneType: Int, response: HttpServletResponse): HttpServletResponse
+
+ fun uploadScore(userId: String, period: String, ruleId: String?, itemList: List<Pair<String, String>>): Boolean
+
+ fun getDetail(userId: String, period: String): GradeDetailVo
}
\ No newline at end of file
diff --git a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/EvaluationsubruleService.kt b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/EvaluationsubruleService.kt
index f138b32..2574606 100644
--- a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/EvaluationsubruleService.kt
+++ b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/EvaluationsubruleService.kt
@@ -1,6 +1,7 @@
package cn.flightfeather.supervision.lightshare.service
import cn.flightfeather.supervision.domain.entity.Evaluationsubrule
+import cn.flightfeather.supervision.lightshare.vo.EvaluationVo
interface EvaluationsubruleService {
@@ -16,4 +17,6 @@
fun findByRuleId(erguid: String): List<Evaluationsubrule>
+ fun getScore(userId:String, time: String):List<EvaluationVo>
+
}
\ No newline at end of file
diff --git a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/EvaluationServiceImpl.kt b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/EvaluationServiceImpl.kt
index d527077..f7007b5 100644
--- a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/EvaluationServiceImpl.kt
+++ b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/EvaluationServiceImpl.kt
@@ -1,18 +1,18 @@
package cn.flightfeather.supervision.lightshare.service.Impl
import cn.flightfeather.supervision.common.score.AutoScore
-import cn.flightfeather.supervision.domain.entity.Company
-import cn.flightfeather.supervision.domain.entity.Evaluation
-import cn.flightfeather.supervision.domain.entity.Evaluationrule
-import cn.flightfeather.supervision.domain.entity.OverallEvaluation
+import cn.flightfeather.supervision.domain.entity.*
import cn.flightfeather.supervision.domain.enumeration.AssessmentRuleType
import cn.flightfeather.supervision.domain.enumeration.SceneType
import cn.flightfeather.supervision.domain.mapper.*
import cn.flightfeather.supervision.infrastructure.utils.DateUtil
+import cn.flightfeather.supervision.infrastructure.utils.UUIDGenerator
import cn.flightfeather.supervision.lightshare.service.EvaluationService
+import cn.flightfeather.supervision.lightshare.service.ItemevaluationService
import cn.flightfeather.supervision.lightshare.vo.AssessmentGradeVo
import cn.flightfeather.supervision.lightshare.vo.AssessmentSearchCondition
import cn.flightfeather.supervision.lightshare.vo.CreditInfoVo
+import cn.flightfeather.supervision.lightshare.vo.GradeDetailVo
import com.github.pagehelper.PageHelper
import org.springframework.stereotype.Service
import tk.mybatis.mapper.entity.Example
@@ -23,11 +23,13 @@
class EvaluationServiceImpl(
val evaluationMapper: EvaluationMapper,
val evaluationruleMapper: EvaluationruleMapper,
+ val evaluationsubruleMapper: EvaluationsubruleMapper,
val userinfoMapper: UserinfoMapper,
val baseInfoMapper: BaseInfoMapper,
val companyMapper: CompanyMapper,
val overallEvaluationMapper: OverallEvaluationMapper,
- val autoScore: AutoScore
+ val autoScore: AutoScore,
+ val itemevaluationService: ItemevaluationService
) : EvaluationService {
override fun findOne(id: String): Evaluation = evaluationMapper.selectByPrimaryKey(id)
@@ -75,13 +77,39 @@
override fun getHistoryPoint(userId: String, page: Int, per_page: Int, response: HttpServletResponse): List<AssessmentGradeVo> {
val userInfo = userinfoMapper.selectByPrimaryKey(userId) ?: return emptyList()
+
+ //璇勫垎瑙勫垯涓嬬殑鍒嗙骇銆佺瓑绾ч鑹插強绛夌骇璇勮
+ val pointLevel = mutableListOf<Pair<Int, Int>>()
+ val evaluateLevel = mutableListOf<String>()
+ val creditTexts = mutableListOf<String>()
+ val levelColors = mutableListOf<String>()
+ val rule = evaluationruleMapper.selectByExample(Example(Evaluationrule::class.java).apply {
+ createCriteria().andEqualTo("scensetypeid", userInfo.extension2)
+ .andEqualTo("ruletype", "0")
+ })
+ if (rule.isNotEmpty()) {
+ val r = rule[0]
+ r.extension1?.split("#")?.forEach {
+ val pStr = it.split(",")
+ pointLevel.add(Pair(pStr[0].toInt(), pStr[1].toInt()))
+ }
+ r.extension2?.split("#")?.forEach {
+ evaluateLevel.add(it)
+ }
+ r.extension3?.split("#")?.forEach {
+ creditTexts.add(it)
+ }
+ r.remark?.split(";")?.forEach {
+ levelColors.add(it)
+ }
+ }
val example = Example(Evaluation::class.java).apply {
createCriteria().andEqualTo("iguid", userId)
.andEqualTo("ertype", AssessmentRuleType.Total.value.toByte())
//鏍规嵁璇勪及浜虹殑绫诲瀷杩涜绛涢�夛紝鑷瘎鍜屽畼鏂硅瘎鍒嗗垎寮�鎺掑悕
and(createCriteria().orIsNull("evaluatorrealname")
.orEqualTo("evaluatorrealname", 0))
- orderBy("updatedate").desc()
+ orderBy("createdate").desc()
}
val counts = evaluationMapper.selectCountByExample(example)
val totalPage = Math.ceil(counts.toDouble() / per_page.toDouble()).toInt()
@@ -100,9 +128,13 @@
tPGuid = it.guid
tPRuleGuid = it.stguid
totalPoint = it.resultscorebef?.toInt() ?: 0
- level = getEvaluationLevel(tPRuleGuid, totalPoint)
+ val l = getEvaluationLevel(totalPoint, pointLevel, evaluateLevel, creditTexts, levelColors)
+ level = l["evaluateLevel"]
+ color = l["color"]
+ creditText = l["creditText"]
rank = it.promissednum ?: 1
- updateDate = it.updatedate
+ updateDate = it.createdate
+ period = it.scensename
})
}
@@ -202,7 +234,7 @@
tPGuid = it["tPGuid"] as String?
tPRuleGuid = it["tPRuleGuid"] as String?
totalPoint = (it["totalPoint"] as String?)?.toIntOrNull() ?: 0
- level = getEvaluationLevel(tPRuleGuid, totalPoint)
+ level = getEvaluationLevel(totalPoint)["evaluateLevel"]
rank = (it["rank"] as Int?) ?: -1
updateDate = it["updateDate"] as Date?
})
@@ -220,18 +252,317 @@
return response
}
+ override fun uploadScore(userId: String, period: String, ruleId: String?, itemList: List<Pair<String, String>>): Boolean {
+ val userinfo = userinfoMapper.selectByPrimaryKey(userId) ?: return false
+
+ //璇ュ満鏅被鍨嬩笅鐨勬�诲緱鍒嗚鍒�
+ val tRule = evaluationruleMapper.selectByExample(Example(Evaluationrule::class.java).apply {
+ createCriteria().andEqualTo("scensetypeid", userinfo.extension2)
+ .andEqualTo("ruletype", AssessmentRuleType.Total.value)
+ .andIsNull("tasktypeid")
+ }).takeIf { it.isNotEmpty() }?.get(0)
+
+ var totalPoint = 0
+ var tEvaluation = Evaluation()
+
+ //涓婁紶鐨勫緱鍒嗚鍒�
+// var rule = Evaluationrule()
+// val subRules:List<Evaluationsubrule> = if (ruleId != null) {
+// rule = evaluationruleMapper.selectByPrimaryKey(ruleId)
+// evaluationsubruleMapper.selectByExample(Example(Evaluationsubrule::class.java).apply {
+// createCriteria().andEqualTo("erguid", ruleId)
+// })
+// }
+
+ val ruleList = evaluationruleMapper.selectByExample(Example(Evaluationrule::class.java).apply {
+ createCriteria().andEqualTo("scensetypeid", userinfo.extension2)
+ .andNotEqualTo("ruletype", AssessmentRuleType.Total.value)
+ .andIsNull("tasktypeid")
+ }).forEach {rule->
+ val subRules = evaluationsubruleMapper.selectByExample(Example(Evaluationsubrule::class.java).apply {
+ createCriteria().andEqualTo("erguid", rule.guid)
+ })
+ if (subRules.isEmpty()) return@forEach
+ //鎬诲垎璁板綍
+ val evaluation = Evaluation().apply { guid = UUIDGenerator.generate16ShortUUID() }
+ //鍏蜂綋椤瑰緱鍒嗚褰�
+ val itemEvaluationList = mutableListOf<Itemevaluation>()
+ //鎬诲緱鍒�
+ var totalScore = 0
+
+ itemList.forEach {
+ for (s in subRules) {
+ if (s.guid == it.first) {
+ var fatherId: String?
+ var subRule = s
+ var score = it.second
+ do {
+ val result = calculateScore(rule, evaluation.guid!!, userId, subRule, score, itemEvaluationList)
+ fatherId = result.first
+ for (s in subRules) {
+ if (s.guid == fatherId) {
+ subRule = s
+ score = result.second ?: "0"
+ break
+ }
+ }
+ } while (fatherId?.isNotBlank() == true)
+
+ totalScore += it.second.toInt()
+ break
+ }
+ }
+ }
+
+ //鎬诲垎
+ var maxScore = 0
+ subRules.forEach subRules@{s ->
+ if (s.ertype == 2) {
+ maxScore += s.maxscore ?: 0
+ }
+ //瑙勫垯宸茬粡鎵撳垎瀹屾瘯锛屽垯璺宠繃
+ itemEvaluationList.forEach {i ->
+ if (i.esrguid == s.guid) {
+ return@subRules
+ }
+ }
+ //鍚﹀垯鏂板涓�鏉℃湭鎵e垎鐨勮褰�
+ itemEvaluationList.add(Itemevaluation().apply {
+ ieguid = UUIDGenerator.generate16ShortUUID()
+ iguid = userId
+ sguid = evaluation.guid
+ erguid = rule.guid
+ rulename = rule.rulename
+ ruletype = rule.ruletype?.toInt()
+ ertype = s.ertype
+ esrguid = s.guid
+ name = s.itemname
+ value = "0"
+ extension1 = "false"
+ })
+ }
+ //璁$畻鎬诲垎
+ evaluation.apply {
+ iguid = userId
+ stguid = rule.guid
+ scensetypeid = userinfo.extension2?.toByte()
+ ertype = rule.ruletype?.toByte()
+ scensename = period
+ evaluatorguid = userId
+ evaluatorusername = userinfo.acountname
+ evaluatorrealname = "0"
+ resultscorebef = (maxScore + totalScore).toString()
+ createdate = Date()
+ updatedate = Date()
+ }
+ save(evaluation)
+ itemevaluationService.savelist(itemEvaluationList)
+ tEvaluation = evaluation
+
+ totalPoint += evaluation.resultscorebef?.toInt() ?: 0
+ }
+
+ //璁$畻鎵�鏈夎〃鐨勬�诲垎
+ tRule?.let {
+ tEvaluation.apply {
+ guid = UUIDGenerator.generate16ShortUUID()
+ stguid = it.guid
+ ertype = it.ruletype?.toByte()
+ resultscorebef = totalPoint.toString()
+ }
+ save(tEvaluation)
+ }
+ return true
+ }
+
+ override fun getDetail(userId: String, period: String): GradeDetailVo {
+ val result = GradeDetailVo()
+
+ val userinfo = userinfoMapper.selectByPrimaryKey(userId) ?: return result
+
+ //璇ュ満鏅被鍨嬩笅鐨勬墍鏈夊緱鍒嗚鍒�
+ var rule0: Evaluationrule? = null
+ val rule1List = mutableListOf<Evaluationrule>()
+ evaluationruleMapper.selectByExample(Example(Evaluationrule::class.java).apply {
+ createCriteria().andEqualTo("scensetypeid", userinfo.extension2)
+ and(createCriteria().orIsNull("tasktypeid").orNotEqualTo("tasktypeid", 1))
+ }).forEach {
+ if (it.ruletype == AssessmentRuleType.Total.value.toString()) {
+ rule0 = it
+ } else {
+ rule1List.add(it)
+ }
+ }
+ if (rule0 == null) return result
+ //寰楀垎瑙h鍜屽緱鍒嗚鎯�
+ evaluationMapper.selectByExample(Example(Evaluation::class.java).apply {
+ createCriteria().andEqualTo("iguid", userId)
+ .andEqualTo("ertype", AssessmentRuleType.Total.value.toByte())
+ .andEqualTo("scensename", period)
+ }).takeIf { it.isNotEmpty() }?.get(0)?.let {
+ rule0?.apply {
+ val pointLevel = mutableListOf<Pair<Int, Int>>()
+ val evaluateLevel = mutableListOf<String>()
+ val creditTexts = mutableListOf<String>()
+ val levelColors = mutableListOf<String>()
+ extension1?.split("#")?.forEach {
+ val pStr = it.split(",")
+ pointLevel.add(Pair(pStr[0].toInt(), pStr[1].toInt()))
+ }
+ extension2?.split("#")?.forEach {
+ evaluateLevel.add(it)
+ }
+ extension3?.split("#")?.forEach {
+ creditTexts.add(it)
+ }
+ remark?.split(";")?.forEach {
+ levelColors.add(it)
+ }
+
+ val l = getEvaluationLevel(it.resultscorebef?.toInt()
+ ?: 0, pointLevel, evaluateLevel, creditTexts, levelColors)
+ result.apply {
+ creditText = l["creditText"]
+
+ score = it.resultscorebef?.toInt() ?: 0
+ rank = it.promissednum
+ level = l["evaluateLevel"]
+ this.period = it.scensename
+ time = it.createdate
+// color = l["color"]
+ }
+ }
+ }
+
+ //鍒嗙被鍒殑寰楀垎(姣忎釜璇勫垎琛ㄧ殑璇勫垎澶ч」鐨勫緱鍒�)鍜屽け鍒嗘潯鐩�
+ rule1List.forEach {
+ val evaluation = evaluationMapper.selectByExample(Example(Evaluation::class.java).apply {
+ createCriteria().andEqualTo("iguid", userId)
+ .andEqualTo("ertype", it.ruletype)
+ .andEqualTo("scensename", period)
+ }).takeIf { it.isNotEmpty() }?.get(0)?.let {e ->
+ val subRules = evaluationsubruleMapper.selectByExample(Example(Evaluationsubrule::class.java).apply {
+ createCriteria().andEqualTo("erguid", it.guid)
+ })
+ val itemEvaluations = itemevaluationService.getItemEvaluationList(e.guid!!)
+
+ itemEvaluations.forEach {item ->
+ when (item.ertype) {
+ //鍒嗙被鍒殑寰楀垎
+ 2 -> {
+ for (s in subRules) {
+ if (s.guid == item.esrguid) {
+ val score = if ((item.value?.toInt() ?: 0) <= 0) {
+ s.maxscore?.plus(item.value?.toInt() ?: 0)
+ } else {
+ item.value?.toInt() ?: 0
+ }
+ result.classScore.add(Triple(item.name ?: "", s.maxscore?.toString()?:"0", score.toString()))
+ break
+ }
+ }
+ }
+ //澶卞垎鏉$洰
+ 4 -> {
+ if ((item.value?.toInt() ?: 0) != 0 && item.extension1 == "true") {
+ for (s in subRules) {
+ if (s.guid == item.esrguid) {
+ result.loseScore.add(
+ Triple(
+ item.name ?: "",
+ if ((item.value?.toInt() ?: 0) < 0) {
+ item . value ?: "0"
+ } else {
+ (item.value?.toInt() ?: 0).minus(s.maxscore ?: 0).toString()
+ },
+ s.remark ?: ""
+ )
+ )
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ return result
+ }
+
+ /**
+ * 鏍规嵁涓婁紶鐨勫瓙瑙勫垯鎵e垎鎯呭喌锛岀敓浜у瓙椤瑰緱鍒嗚褰�
+ * @param rule 鎬昏鍒�
+ * @param eGuid 鎬诲垎璁板綍id
+ * @param userId 鐢ㄦ埛id
+ * @param subRule 鎵e垎鐨勮鍒�
+ * @param score 鎵e垎
+ * @param itemEvaluationList 寰楀垎璁板綍琛�
+ * @return 璇勫垎椤圭殑鐖秈d鍜屽緱鍒�
+ */
+ private fun calculateScore(rule:Evaluationrule, eGuid: String, userId: String, subRule: Evaluationsubrule, score: String, itemEvaluationList: MutableList<Itemevaluation>): Pair<String?, String?> {
+ var result: Pair<String?, String?> = Pair(null, null)
+ var exist = false
+ for (i in itemEvaluationList) {
+ //璁板綍宸插瓨鍦紝璇存槑鏄埗椤圭殑璇勫垎瑙勫垯涓嬬殑鏌愪釜瀛愰」鐨勪竴閮ㄥ垎鎵e垎锛屾墸鍒嗙疮鍔�
+ if (subRule.guid == i.esrguid) {
+ i.value = i.value?.toInt()?.plus(score.toInt())?.toString()
+ result = Pair(subRule.fatherid, i.value)
+ exist = true
+ break
+ }
+ }
+ //璁板綍涓嶅瓨鍦ㄦ椂锛岃鏄庢槸瀛愰」绗竴娆℃墸鍒嗭紝鏂板涓�鏉¤褰�
+ if (!exist) {
+ itemEvaluationList.add(Itemevaluation().apply {
+ ieguid = UUIDGenerator.generate16ShortUUID()
+ iguid = userId
+ sguid = eGuid
+ erguid = rule.guid
+ rulename = rule.rulename
+ ruletype = rule.ruletype?.toInt()
+ ertype = subRule.ertype
+ esrguid = subRule.guid
+ name = subRule.itemname
+ value = score
+ extension1 = "true"
+ })
+ result = Pair(subRule.fatherid, score)
+ }
+ return result
+ }
+
/**
* 鏍规嵁鍒嗘暟鑾峰彇绛夌骇
*/
- private fun getEvaluationLevel(ruleId:String?, score: Int): String {
- return when (score) {
- in 0..40 -> "鏋佸樊"
- in 41..64 -> "杈冨樊"
- in 65..79 -> "涓�鑸�"
- in 80..94 -> "鑹ソ"
- in 95..Int.MAX_VALUE -> "浼樼"
- else -> "鏋佸樊"
+ private fun getEvaluationLevel(
+ score: Int,
+ pointLevel: MutableList<Pair<Int, Int>> = mutableListOf(),
+ evaluateLevel: MutableList<String> = mutableListOf(),
+ creditTexts: MutableList<String> = mutableListOf(),
+ levelColors: MutableList<String> = mutableListOf()
+ ): Map<String, String> {
+ val result = mutableMapOf<String, String>()
+ if (pointLevel.isEmpty() || evaluateLevel.isEmpty() || creditTexts.isEmpty() || levelColors.isEmpty()) {
+ result["evaluateLevel"] = when (score) {
+ in 0..40 -> "鏋佸樊"
+ in 41..64 -> "杈冨樊"
+ in 65..79 -> "涓�鑸�"
+ in 80..94 -> "鑹ソ"
+ in 95..Int.MAX_VALUE -> "浼樼"
+ else -> "鏋佸樊"
+ }
+ } else {
+ for (i in pointLevel.indices) {
+ if (score in pointLevel[i].first..pointLevel[i].second) {
+ result["color"] = levelColors[i % levelColors.size]
+ result["creditText"] = creditTexts[i % creditTexts.size]
+ result["evaluateLevel"] = evaluateLevel[i % evaluateLevel.size]
+ }
+ }
}
+ return result
+
}
private fun updateRank(evaluation: Evaluation, isInsert: Boolean) {
@@ -239,6 +570,7 @@
val eList = evaluationMapper.selectByExample(Example(Evaluation::class.java).apply {
createCriteria().andEqualTo("scensename", evaluation.scensename)
.andIsNotNull("scensename")
+ .andEqualTo("ertype", AssessmentRuleType.Total.value)
//鏍规嵁璇勪及浜虹殑绫诲瀷杩涜绛涢�夛紝鑷瘎鍜屽畼鏂硅瘎鍒嗗皝闈㈠紑鎺掑悕
if (evaluation.evaluatorrealname == null || evaluation.evaluatorrealname == "0") {
and(createCriteria().orIsNull("evaluatorrealname")
diff --git a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/EvaluationsubruleServiceImpl.kt b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/EvaluationsubruleServiceImpl.kt
index 65bf182..d80effc 100644
--- a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/EvaluationsubruleServiceImpl.kt
+++ b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/EvaluationsubruleServiceImpl.kt
@@ -1,13 +1,25 @@
package cn.flightfeather.supervision.lightshare.service.Impl
+import cn.flightfeather.supervision.domain.entity.Evaluation
+import cn.flightfeather.supervision.domain.entity.Evaluationrule
import cn.flightfeather.supervision.domain.entity.Evaluationsubrule
-import cn.flightfeather.supervision.domain.mapper.EvaluationsubruleMapper
+import cn.flightfeather.supervision.domain.entity.Itemevaluation
+import cn.flightfeather.supervision.domain.mapper.*
import cn.flightfeather.supervision.lightshare.service.EvaluationsubruleService
+import cn.flightfeather.supervision.lightshare.vo.EvaluationVo
+import cn.flightfeather.supervision.lightshare.vo.SubEvaluationVo
+import cn.flightfeather.supervision.lightshare.vo.ThirdEvaluationVo
import org.springframework.stereotype.Service
import tk.mybatis.mapper.entity.Example
@Service
-class EvaluationsubruleServiceImpl (val evaluationsubruleMapper: EvaluationsubruleMapper):EvaluationsubruleService {
+class EvaluationsubruleServiceImpl(
+ val evaluationsubruleMapper: EvaluationsubruleMapper,
+ private val userinfoMapper: UserinfoMapper,
+ private val evaluationruleMapper: EvaluationruleMapper,
+ private val evaluationMapper: EvaluationMapper,
+ private val itemevaluationMapper: ItemevaluationMapper
+):EvaluationsubruleService {
override fun findOne(id: String): Evaluationsubrule = evaluationsubruleMapper.selectByPrimaryKey(id)
@@ -25,4 +37,135 @@
criteria.andEqualTo("erguid", erguid)
return evaluationsubruleMapper.selectByExample(example)
}
+
+ override fun getScore(userId: String, time: String): List<EvaluationVo> {
+ val userinfo = userinfoMapper.selectByPrimaryKey(userId) ?: return emptyList()
+ val sceneType = userinfo.extension2
+ //璇勫垎鎬昏鍒�
+ val rules = evaluationruleMapper.selectByExample(Example(Evaluationrule::class.java).apply {
+ createCriteria().andEqualTo("scensetypeid", sceneType)
+// .andEqualTo("ruletype", "1")
+ .andIsNull("tasktypeid")
+ })
+ if (rules.isEmpty()) return emptyList()
+
+ val rIdList = mutableListOf<String?>()
+ rules.forEach {
+ rIdList.add(it.guid)
+ }
+
+ //鎬昏鍒欏搴旂殑璇勫垎瀛愯鍒�
+ val subRules = mutableListOf<Evaluationsubrule>()
+ val sr = evaluationsubruleMapper.selectByExample(Example(Evaluationsubrule::class.java).apply {
+ createCriteria().andIn("erguid", rIdList)
+ orderBy("ertype")
+ orderBy("displayid")
+ })
+ subRules.addAll(sr)
+
+ //鎬昏鍒欑殑寰楀垎
+ val ruleScore = evaluationMapper.selectByExample(Example(Evaluation::class.java).apply {
+ createCriteria().andIn("stguid", rIdList)//瑙勫垯id
+ .andEqualTo("evaluatorguid", userId)//鐢ㄦ埛id
+ .andEqualTo("scensename", time)//璇勪及鍛ㄦ湡锛屼緥锛�2020/6-6
+ })
+ //瀛愯鍒欓�愭潯寰楀垎
+ val subRuleScores = if (ruleScore.isEmpty()) {
+ mutableListOf<Itemevaluation>()
+ } else {
+ val scoreIds = mutableListOf<String?>()
+ ruleScore.forEach { scoreIds.add(it.guid) }
+ itemevaluationMapper.selectByExample(Example(Itemevaluation::class.java).apply {
+ createCriteria().andIn("sguid", scoreIds)
+ })
+ }
+
+ val resultList = mutableListOf<EvaluationVo>()
+
+ var _group = 0
+ subRules.forEach {
+ when (it.ertype) {
+ 2 -> resultList.add(EvaluationVo().apply {
+ id = it.guid
+ title1 = it.itemname
+ score = it.minscore?.minus(it.maxscore ?: 0) ?: 0
+
+ //濡傛灉鏈夊緱鍒嗚褰曪紝鍒欐敼鍙樼姸鎬佷负閫変腑
+ for (s in subRuleScores) {
+ if (it.guid == s.esrguid) {
+ select = s.extension1 == "true"
+ break
+ }
+ }
+ })
+ 3 -> {
+ for (r in resultList) {
+ if (it.fatherid == r.id) {
+ r.sub1.add(SubEvaluationVo().apply {
+ id = it.guid
+ title2 = it.itemname
+ score = it.minscore?.minus(it.maxscore ?: 0) ?: 0
+ group = _group++
+
+ //濡傛灉鏈夊緱鍒嗚褰曪紝鍒欐敼鍙樼姸鎬佷负閫変腑
+ for (s in subRuleScores) {
+ if (it.guid == s.esrguid) {
+ select = s.extension1 == "true"
+ break
+ }
+ }
+ })
+ break
+ }
+ }
+ }
+ 4 -> {
+ resultList.forEach{ r ->
+ if (r.id == it.fatherid) {
+ if (r.sub1.isEmpty()) {
+ r.sub1.add(SubEvaluationVo().apply {
+ placeholder = true
+ id = it.guid
+ title2 = r.title1
+ score = r.score
+ group = _group++
+ })
+ }
+ r.sub1[0].sub2.add(ThirdEvaluationVo().apply {
+ id = it.guid
+ content = it.itemname
+ score = r.score.plus(it.maxscore ?: 0)
+ //濡傛灉鏈夊緱鍒嗚褰曪紝鍒欐敼鍙樼姸鎬佷负閫変腑
+ for (s in subRuleScores) {
+ if (it.guid == s.esrguid) {
+ select = s.extension1 == "true"
+ break
+ }
+ }
+ })
+ } else {
+ r.sub1.forEach { sr ->
+ if (sr.id == it.fatherid){
+ sr.sub2.add(ThirdEvaluationVo().apply {
+ id = it.guid
+ content = it.itemname
+ score = sr.score.plus(it.maxscore ?: 0)
+ //濡傛灉鏈夊緱鍒嗚褰曪紝鍒欐敼鍙樼姸鎬佷负閫変腑
+ for (s in subRuleScores) {
+ if (it.guid == s.esrguid) {
+ select = s.extension1 == "true"
+ break
+ }
+ }
+ })
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ return resultList
+ }
}
\ No newline at end of file
diff --git a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/LedgerServiceImpl.kt b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/LedgerServiceImpl.kt
index 868eb5b..5aa39e2 100644
--- a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/LedgerServiceImpl.kt
+++ b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/LedgerServiceImpl.kt
@@ -13,8 +13,7 @@
import cn.flightfeather.supervision.infrastructure.utils.FileUtil
import cn.flightfeather.supervision.infrastructure.utils.UUIDGenerator
import cn.flightfeather.supervision.lightshare.service.LedgerService
-import cn.flightfeather.supervision.lightshare.vo.LedgerSubTypeVo
-import cn.flightfeather.supervision.lightshare.vo.LedgerVo
+import cn.flightfeather.supervision.lightshare.vo.*
import com.fasterxml.jackson.core.type.TypeReference
import com.fasterxml.jackson.databind.ObjectMapper
import com.github.pagehelper.PageHelper
@@ -66,19 +65,24 @@
val resultList = mutableListOf<LedgerSubTypeVo>()
ledgerSubTypes.forEach {
val l = LedgerSubTypeVo(
- it.lsSubtypeid,
- it.lsName,
- it.getlTypeid(),
- it.getlTypename(),
- needUpdate = it.getlNeedupdate(),
- sceneType = it.getlScenetype(),
- iconUrl = it.getlIconurl()
+ it.lsSubtypeid,
+ it.lsName,
+ it.getlTypeid(),
+ it.getlTypename(),
+ needUpdate = it.getlNeedupdate(),
+ sceneType = it.getlScenetype(),
+ iconUrl = it.getlIconurl(),
+ realTime = it.getlRealTime()
)
for (r in records) {
if (l.ledgerSubTypeId == r.lsSubtypeid) {
l.ledgerFinished = true
l.upLoad = true
- l.checkStatus = r.lrVerifyrst?.toIntOrNull() ?: LedgerCheckStatus.UnCheck.value
+// l.checkStatus = r.lrVerifyrst?.toIntOrNull() ?: LedgerCheckStatus.UnCheck.value
+ l.verified
+ l.verifierName = r.lrVerifierrealname
+ l.verified = r.lrIsverify
+ l.verifyRst = l.verifyRst
break
}
}
@@ -373,4 +377,86 @@
return records
}
+
+ override fun copyLedger(userId: String, time: String, copyLedgerList: List<CopyLedgerVo>): BaseResponse<String> {
+ val year = time.split("-")[0]
+ val month = time.split("-")[1]
+ copyLedgerList.forEach {
+ //鍘婚噸鍒ゆ柇
+ val r = ledgerRecordMapper.selectByExample(Example(LedgerRecord::class.java).apply {
+ createCriteria().andEqualTo("lrSubmitid", userId)
+ .andEqualTo("lsSubtypeid", it.subTypeId)
+ .andEqualTo("lrYear", year)
+ .andEqualTo("lrMonth", month)
+ })
+ if (r.size > 0) {
+ return@forEach
+ }
+
+ val y = it.time?.split("-")?.get(0) ?: return@forEach
+ val m = it.time?.split("-")?.get(1) ?: return@forEach
+ ledgerRecordMapper.selectByExample(Example(LedgerRecord::class.java).apply {
+ createCriteria().andEqualTo("lrSubmitid", userId)
+ .andEqualTo("lsSubtypeid", it.subTypeId)
+ .andEqualTo("lrYear", y)
+ .andEqualTo("lrMonth", m)
+ }).forEach record@ {lr ->
+ //鑾峰彇璁板綍瀵瑰簲鐨勬枃浠朵俊鎭�
+ val fileList = ledgerMediaFileMapper.selectByExample(Example(LedgerMediaFile::class.java).apply {
+ createCriteria().andEqualTo("lrGuid", lr.lrGuid)
+ })
+ if (fileList.size == 0) return@record
+ val file = fileList[0] ?: return@record
+
+ //淇敼璁板綍淇℃伅锛屽鍒朵负鏂扮殑鍙拌处
+ lr.lrGuid = UUIDGenerator.generate16ShortUUID()
+ lr.lrYear = year.toInt()
+ lr.lrMonth = month.toByte()
+ lr.lrIssubmitontime = true
+ lr.lrSubmitdate = Date()
+ lr.lrExtension2 = "copy"//琛ㄦ槑鏄鍒剁殑鍙拌处
+ ledgerRecordMapper.insert(lr)
+
+ //淇敼瀵瑰簲鐨勬枃浠朵俊鎭�
+ file.apply {
+ mfGuid = UUIDGenerator.generate16ShortUUID()
+ lrGuid = lr.lrGuid
+ mfSavetime = Date()
+ }
+ ledgerMediaFileMapper.insert(file)
+ }
+ }
+
+ return BaseResponse(true)
+ }
+
+ override fun checkLedger(verifierId: String, remark: String?, recordList: List<LedgerCheckVo>): BaseResponse<Boolean> {
+ val recordIdList = mutableListOf<String?>()
+ recordList.forEach { recordIdList.add(it.recordId) }
+ val records = ledgerRecordMapper.selectByExample(Example(LedgerRecord::class.java).apply {
+ createCriteria().andIn("lrGuid", recordIdList)
+ .andIsNotNull("lrGuid")
+ })
+ return if (records.isEmpty()) {
+ BaseResponse(false, "鎵�閫夎褰曚笉瀛樺湪")
+ } else {
+ records.forEach {
+ for (r in recordList) {
+ if (r.recordId == it.lrGuid) {
+ it.lrVerifierid = verifierId
+ it.lrVerifierrealname
+ it.lrVerifydate = Date()
+ it.lrIsverify = r.result
+ it.lrVerifyrst = r.remark
+ it.lrAiverifytime = if (it.lrAiverifytime == null) 0 else it.lrAiverifytime++
+ it.lrIsai = false
+
+ ledgerRecordMapper.updateByPrimaryKey(it)
+ continue
+ }
+ }
+ }
+ BaseResponse(true)
+ }
+ }
}
\ No newline at end of file
diff --git a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/UserinfoServiceImpl.kt b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/UserinfoServiceImpl.kt
index b0105f7..b54c7fe 100644
--- a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/UserinfoServiceImpl.kt
+++ b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/UserinfoServiceImpl.kt
@@ -54,6 +54,7 @@
override fun delete(id: String): Int = userinfoMapper.deleteByPrimaryKey(id)
override fun login(loginRequestVo: LoginRequestVo): AccessToken {
+ if (loginRequestVo.userName.isNullOrEmpty() || loginRequestVo.password.isNullOrEmpty()) return AccessToken()
val example = Example(Userinfo::class.java)
val criteria = example.createCriteria()
criteria.andEqualTo("acountname", loginRequestVo.userName)
diff --git a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/LedgerService.kt b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/LedgerService.kt
index 6290a03..7dca21d 100644
--- a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/LedgerService.kt
+++ b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/LedgerService.kt
@@ -1,7 +1,6 @@
package cn.flightfeather.supervision.lightshare.service
-import cn.flightfeather.supervision.lightshare.vo.LedgerSubTypeVo
-import cn.flightfeather.supervision.lightshare.vo.LedgerVo
+import cn.flightfeather.supervision.lightshare.vo.*
import org.springframework.http.client.MultipartBodyBuilder
import org.springframework.web.multipart.MultipartFile
import java.util.*
@@ -24,4 +23,7 @@
fun getLedgerImgs(userId: String, ledgerType: List<Int>): List<LedgerVo>
+ fun copyLedger(userId: String, time: String, copyLedgerList: List<CopyLedgerVo>): BaseResponse<String>
+
+ fun checkLedger(verifierId: String, remark: String?, recordList: List<LedgerCheckVo>):BaseResponse<Boolean>
}
\ No newline at end of file
diff --git a/src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/AssessmentGradeVo.kt b/src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/AssessmentGradeVo.kt
index e878825..03a2d7b 100644
--- a/src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/AssessmentGradeVo.kt
+++ b/src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/AssessmentGradeVo.kt
@@ -16,8 +16,11 @@
var tPRuleGuid: String? = null
var totalPoint: Int = 0
var level: String? = null
+ var color: String? = null
+ var creditText: String? = null
var rank: Int = 1
var updateDate: Date? = null
+ var period: String? = null
var subGradeList: List<SubGradeVo> = emptyList()
}
diff --git a/src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/CopyLedgerVo.kt b/src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/CopyLedgerVo.kt
new file mode 100644
index 0000000..421640b
--- /dev/null
+++ b/src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/CopyLedgerVo.kt
@@ -0,0 +1,15 @@
+package cn.flightfeather.supervision.lightshare.vo
+
+import com.fasterxml.jackson.annotation.JsonInclude
+import java.math.BigDecimal
+
+/**
+ * 闇�瑕佸鍒剁殑鍙拌处淇℃伅
+ */
+@JsonInclude(JsonInclude.Include.NON_NULL)
+class CopyLedgerVo {
+
+ var subTypeId: String? = null
+ //YYYY-MM
+ var time: String? = null
+}
\ No newline at end of file
diff --git a/src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/EvaluationVo.kt b/src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/EvaluationVo.kt
new file mode 100644
index 0000000..6dc80d3
--- /dev/null
+++ b/src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/EvaluationVo.kt
@@ -0,0 +1,45 @@
+package cn.flightfeather.supervision.lightshare.vo
+
+/**
+ * 璇勫垎瑙勫垯鍙婂緱鍒�
+ */
+class EvaluationVo {
+ //瑙勫垯id
+ var id: String? = null
+ //瑙勫垯鎻忚堪
+ var title1: String? = null
+ //鍒嗗��
+ var score: Int = 0
+ //鏄惁閫変腑
+ var select: Boolean = false
+ //浜岀骇瀛愯鍒�
+ var sub1: MutableList<SubEvaluationVo> = mutableListOf()
+}
+
+class SubEvaluationVo {
+ //鏈夋椂鍊欎竴绾х殑瑙勫垯涓嬮潰鐩存帴鏄笁绾ц鍒欙紝娌℃湁浜岀骇瑙勫垯锛屽洜姝ゆ鏃剁殑浜岀骇瑙勫垯鍙槸涓轰簡缁撴瀯瀹屾暣鎬ц�屽嚭鐜扮殑
+ var placeholder: Boolean = false
+ //瑙勫垯id
+ var id: String? = null
+ //瑙勫垯鎻忚堪
+ var title2: String? = null
+ //鍒嗗��
+ var score: Int = 0
+ //鏄惁閫変腑
+ var select: Boolean = false
+ //浜岀骇瑙勫垯鍒嗙粍
+ var group: Int? = null
+ //涓夌骇瀛愯鍒�
+ var sub2: MutableList<ThirdEvaluationVo> = mutableListOf()
+}
+
+class ThirdEvaluationVo {
+ //瑙勫垯id
+ var id: String? = null
+ //瑙勫垯鎻忚堪
+ var content: String? = null
+ //鍒嗗��
+ var score: Int = 0
+ //鏄惁閫変腑
+ var select: Boolean = false
+}
\ No newline at end of file
diff --git a/src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/GradeDetailVo.kt b/src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/GradeDetailVo.kt
new file mode 100644
index 0000000..b9aa529
--- /dev/null
+++ b/src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/GradeDetailVo.kt
@@ -0,0 +1,28 @@
+package cn.flightfeather.supervision.lightshare.vo
+
+import java.util.*
+
+/**
+ * 娴嬭瘎璇︽儏
+ */
+class GradeDetailVo {
+ //寰楀垎瑙h
+ var creditText: String? = null
+
+ //鑰冩牳寰楀垎
+ var score: Int = 0
+ //椋庨櫓鎺掑悕
+ var rank: Int? = null
+ //椋庨櫓绛夌骇
+ var level: String? = null
+ //鑰冩牳鍛ㄦ湡
+ var period: String? = null
+ //鑷瘎鏃堕棿
+ var time: Date? = null
+
+ //鍒嗙被寰楀垎
+ var classScore: MutableList<Triple<String, String, String>> = mutableListOf()
+
+ //澶卞垎椤圭洰
+ var loseScore: MutableList<Triple<String, String, String>> = mutableListOf()
+}
\ No newline at end of file
diff --git a/src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/LedgerCheckVo.kt b/src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/LedgerCheckVo.kt
new file mode 100644
index 0000000..320269e
--- /dev/null
+++ b/src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/LedgerCheckVo.kt
@@ -0,0 +1,19 @@
+package cn.flightfeather.supervision.lightshare.vo
+
+import com.fasterxml.jackson.annotation.JsonInclude
+import java.math.BigDecimal
+
+/**
+ * 鍙拌处瀹℃牳缁撴灉淇℃伅
+ */
+@JsonInclude(JsonInclude.Include.NON_NULL)
+class LedgerCheckVo {
+ //瀹℃牳鐨勫彴璐﹁褰昳d
+ var recordId: String? = null
+
+ //瀹℃牳缁撴灉
+ var result: Boolean = false
+
+ //瀹℃牳澶囨敞
+ var remark: String? = null
+}
\ No newline at end of file
diff --git a/src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/LedgerSubTypeVo.kt b/src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/LedgerSubTypeVo.kt
index d7b2d70..a34da29 100644
--- a/src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/LedgerSubTypeVo.kt
+++ b/src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/LedgerSubTypeVo.kt
@@ -25,9 +25,19 @@
//鍙拌处鏄惁闇�瑕佷笂浼�
var needUpdate: Boolean = true,
//鍙拌处瀹℃牳鐘舵�侊紙0锛氭湭瀹℃牳锛�1锛氶�氳繃锛�2锛氭湭閫氳繃锛�
- var checkStatus: Int = LedgerCheckStatus.UnCheck.value,
+// var checkStatus: Int = LedgerCheckStatus.UnCheck.value,
var sceneType: Int = SceneType.Restaurant.value,
//鍙拌处鍥炬爣
- var iconUrl: String? = null
+ var iconUrl: String? = null,
+ //鍙拌处鏄惁鏈夊疄鏃舵�ц姹�
+ var realTime: Boolean = false,
+ //瀹℃牳浜篿d
+ var verifierId: String? = null,
+ //瀹℃牳浜哄悕绉�
+ var verifierName: String? = null,
+ //瀹℃牳缁撴灉銆俷ull锛氭湭瀹℃牳锛沠alse锛氬鏍镐笉閫氳繃锛泃rue锛氬鏍搁�氳繃
+ var verified: Boolean? = null,
+ //瀹℃牳澶囨敞
+ var verifyRst: String? = null
)
\ No newline at end of file
diff --git a/src/main/kotlin/cn/flightfeather/supervision/lightshare/web/EvaluationController.kt b/src/main/kotlin/cn/flightfeather/supervision/lightshare/web/EvaluationController.kt
index bf504b5..cb04c6e 100644
--- a/src/main/kotlin/cn/flightfeather/supervision/lightshare/web/EvaluationController.kt
+++ b/src/main/kotlin/cn/flightfeather/supervision/lightshare/web/EvaluationController.kt
@@ -78,4 +78,21 @@
@RequestParam("sceneType") sceneType: Int,
response: HttpServletResponse
) = evaluationService.autoScore(year, month, sceneType, response)
+
+
+ @ApiOperation(value = "涓婁紶鑷瘎寰楀垎")
+ @PostMapping("/upload")
+ fun uploadScore(
+ @ApiParam(value = "鐢ㄦ埛id") @RequestParam("userId") userId: String,
+ @ApiParam(value = "璇勫垎鍛ㄦ湡") @RequestParam("period") period: String,
+ @ApiParam(value = "璇勫垎瑙勫垯id") @RequestParam(value = "ruleId", required = false) ruleId: String?,
+ @ApiParam(value = "鍏蜂綋鎵e垎鏉$洰") @RequestBody itemList: List<Pair<String, String>>,
+ ) = evaluationService.uploadScore(userId, period, ruleId, itemList)
+
+ @ApiOperation(value = "鑾峰彇娴嬭瘎璇︽儏")
+ @GetMapping("/detail")
+ fun getDetail(
+ @ApiParam(value = "鐢ㄦ埛id") @RequestParam("userId") userId: String,
+ @ApiParam(value = "璇勫垎鍛ㄦ湡") @RequestParam("period") period: String,
+ ) = evaluationService.getDetail(userId, period)
}
\ No newline at end of file
diff --git a/src/main/kotlin/cn/flightfeather/supervision/lightshare/web/EvaluationsubruleController.kt b/src/main/kotlin/cn/flightfeather/supervision/lightshare/web/EvaluationsubruleController.kt
index 19e0088..c80bb9b 100644
--- a/src/main/kotlin/cn/flightfeather/supervision/lightshare/web/EvaluationsubruleController.kt
+++ b/src/main/kotlin/cn/flightfeather/supervision/lightshare/web/EvaluationsubruleController.kt
@@ -33,5 +33,10 @@
@DeleteMapping("/{id}")
fun delete (@PathVariable id: String) = evaluationsubruleService.delete(id)
-
+ @ApiOperation(value = "鏌ユ壘璇勫垎瑙勫垯瀛愰」琛ㄤ互鍙婂搴旂殑鍏蜂綋寰楀垎")
+ @GetMapping("/score")
+ fun getScore(
+ @ApiParam(value = "鐢ㄦ埛id") @RequestParam("userId") userId:String,
+ @ApiParam(value = "璇勪及鍛ㄦ湡", example = "yyyy/M-M") @RequestParam("time") time:String,
+ ) = evaluationsubruleService.getScore(userId, time)
}
\ No newline at end of file
diff --git a/src/main/kotlin/cn/flightfeather/supervision/lightshare/web/LedgerController.kt b/src/main/kotlin/cn/flightfeather/supervision/lightshare/web/LedgerController.kt
index f26771b..4ddc139 100644
--- a/src/main/kotlin/cn/flightfeather/supervision/lightshare/web/LedgerController.kt
+++ b/src/main/kotlin/cn/flightfeather/supervision/lightshare/web/LedgerController.kt
@@ -1,6 +1,8 @@
package cn.flightfeather.supervision.lightshare.web
import cn.flightfeather.supervision.lightshare.service.LedgerService
+import cn.flightfeather.supervision.lightshare.vo.CopyLedgerVo
+import cn.flightfeather.supervision.lightshare.vo.LedgerCheckVo
import cn.flightfeather.supervision.lightshare.vo.LedgerVo
import io.swagger.annotations.Api
import io.swagger.annotations.ApiOperation
@@ -75,4 +77,20 @@
@ApiParam("鐢ㄦ埛id") @PathVariable userId: String,
@ApiParam("鍙拌处绫诲瀷id鏁扮粍") @RequestParam("ledgerTypes") ledgerTypes: List<Int>
) = ledgerService.getLedgerImgs(userId, ledgerTypes)
+
+ @ApiOperation("澶嶅埗鍦烘櫙鐨勫彴璐�")
+ @PostMapping("/copy")
+ fun copyLedger(
+ @RequestParam("userId") userId: String,
+ @RequestParam("time") time: String,
+ @RequestBody copyLedgerList: List<CopyLedgerVo>
+ ) = ledgerService.copyLedger(userId, time, copyLedgerList)
+
+ @ApiOperation("瀹℃牳鍙拌处")
+ @PostMapping("/check")
+ fun checkLedger(
+ @RequestParam("verifierId") verifierId: String,
+ @RequestParam(value = "remark", required = false) remark: String?,
+ @RequestBody recordList: List<LedgerCheckVo>
+ ) = ledgerService.checkLedger(verifierId, remark, recordList)
}
\ No newline at end of file
diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml
index af25bea..bcaccfa 100644
--- a/src/main/resources/application.yml
+++ b/src/main/resources/application.yml
@@ -12,14 +12,14 @@
# password: 123456
#-TestEnd-
-# url: jdbc:mysql://localhost:3306/ledger?serverTimezone=Asia/Shanghai&prepStmtCacheSize=517&cachePrepStmts=true&autoReconnect=true&characterEncoding=utf-8&allowMultiQueries=true&useSSL=false
-# username: ledger
-# password: ledger_fxxchackxr
+ url: jdbc:mysql://localhost:3306/ledger?serverTimezone=Asia/Shanghai&prepStmtCacheSize=517&cachePrepStmts=true&autoReconnect=true&characterEncoding=utf-8&allowMultiQueries=true&useSSL=false
+ username: ledger
+ password: ledger_fxxchackxr
# 寮�鍙戣繙绋嬫湇鍔″櫒
- url: jdbc:mysql://47.100.191.150:3306/ledger?serverTimezone=Asia/Shanghai&prepStmtCacheSize=517&cachePrepStmts=true&autoReconnect=true&characterEncoding=utf-8&allowMultiQueries=true&useSSL=false
- username: remoteU1
- password: eSoF8DnzfGTlhAjE
+# url: jdbc:mysql://47.100.191.150:3306/ledger?serverTimezone=Asia/Shanghai&prepStmtCacheSize=517&cachePrepStmts=true&autoReconnect=true&characterEncoding=utf-8&allowMultiQueries=true&useSSL=false
+# username: remoteU1
+# password: eSoF8DnzfGTlhAjE
initialSize: 5
minIdle: 5
diff --git a/src/main/resources/mapper/LedgerRecordMapper.xml b/src/main/resources/mapper/LedgerRecordMapper.xml
index c941cb4..f493a1c 100644
--- a/src/main/resources/mapper/LedgerRecordMapper.xml
+++ b/src/main/resources/mapper/LedgerRecordMapper.xml
@@ -14,7 +14,7 @@
<result column="CI_GUID" property="ciGuid" jdbcType="VARCHAR" />
<result column="CI_Name" property="ciName" jdbcType="VARCHAR" />
<result column="LR_EASubmitKind" property="lrEasubmitkind" jdbcType="TINYINT" />
- <result column="LR_VerifierID" property="lrVerifierid" jdbcType="INTEGER" />
+ <result column="LR_VerifierID" property="lrVerifierid" jdbcType="VARCHAR" />
<result column="LR_VerifierRealName" property="lrVerifierrealname" jdbcType="VARCHAR" />
<result column="LR_VerifyDate" property="lrVerifydate" jdbcType="TIMESTAMP" />
<result column="LR_IsVerify" property="lrIsverify" jdbcType="BIT" />
diff --git a/src/main/resources/mapper/LedgerSubTypeMapper.xml b/src/main/resources/mapper/LedgerSubTypeMapper.xml
index 07fa64b..4e28a3f 100644
--- a/src/main/resources/mapper/LedgerSubTypeMapper.xml
+++ b/src/main/resources/mapper/LedgerSubTypeMapper.xml
@@ -22,44 +22,4 @@
LS_SubTypeId, LS_Name, L_TypeId, L_TypeName, L_IconUrl, L_SceneType, L_NeedUpdate,
L_Period, L_Real_Time
</sql>
- <resultMap id="BaseResultMap" type="cn.flightfeather.supervision.domain.entity.LedgerSubType">
- <!--
- WARNING - @mbg.generated
- -->
- <id column="LS_SubTypeId" jdbcType="INTEGER" property="lsSubtypeid" />
- <result column="LS_Name" jdbcType="VARCHAR" property="lsName" />
- <result column="L_TypeId" jdbcType="INTEGER" property="lTypeid" />
- <result column="L_TypeName" jdbcType="VARCHAR" property="lTypename" />
- <result column="L_IconUrl" jdbcType="VARCHAR" property="lIconurl" />
- <result column="L_SceneType" jdbcType="INTEGER" property="lScenetype" />
- <result column="L_NeedUpdate" jdbcType="BIT" property="lNeedupdate" />
- <result column="L_Period" jdbcType="INTEGER" property="lPeriod" />
- </resultMap>
- <sql id="Base_Column_List">
- <!--
- WARNING - @mbg.generated
- -->
- LS_SubTypeId, LS_Name, L_TypeId, L_TypeName, L_IconUrl, L_SceneType, L_NeedUpdate,
- L_Period
- </sql>
- <resultMap id="BaseResultMap" type="cn.flightfeather.supervision.domain.entity.LedgerSubType">
- <!--
- WARNING - @mbg.generated
- -->
- <id column="LS_SubTypeId" jdbcType="INTEGER" property="lsSubtypeid" />
- <result column="LS_Name" jdbcType="VARCHAR" property="lsName" />
- <result column="L_TypeId" jdbcType="INTEGER" property="lTypeid" />
- <result column="L_TypeName" jdbcType="VARCHAR" property="lTypename" />
- <result column="L_IconUrl" jdbcType="VARCHAR" property="lIconurl" />
- <result column="L_SceneType" jdbcType="INTEGER" property="lScenetype" />
- <result column="L_NeedUpdate" jdbcType="BIT" property="lNeedupdate" />
- <result column="L_Period" jdbcType="INTEGER" property="lPeriod" />
- </resultMap>
- <sql id="Base_Column_List">
- <!--
- WARNING - @mbg.generated
- -->
- LS_SubTypeId, LS_Name, L_TypeId, L_TypeName, L_IconUrl, L_SceneType, L_NeedUpdate,
- L_Period
- </sql>
</mapper>
\ No newline at end of file
--
Gitblit v1.9.3