1. 修改自评逻辑中,问题整改的判断方式为已整改并且整改审核通过;
2. 新增评估详情获取接口;
已修改19个文件
已删除1个文件
已重命名2个文件
| | |
| | | <dependencies> |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-quartz</artifactId> |
| | | <exclusions> |
| | | <exclusion> |
| | | <artifactId>spring-boot-starter-logging</artifactId> |
| | | <groupId>org.springframework.boot</groupId> |
| | | </exclusion> |
| | | </exclusions> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-data-mongodb-reactive</artifactId> |
| | | <exclusions> |
| | | <exclusion> |
| | |
| | | val map = mutableMapOf<String?, MutableList<FumeDailyAnalysis?>>() |
| | | fumeDailyAnalysisMapper.selectByExample(Example(FumeDailyAnalysis::class.java).apply { |
| | | createCriteria().andBetween("fumeDate", evaluationScene.config?.startTime, evaluationScene.config?.endTime) |
| | | .andIn("fumeDevId", deviceCodeList) |
| | | .apply { |
| | | if (deviceCodeList.isNotEmpty()) { |
| | | andIn("fumeDevId", deviceCodeList) |
| | | } |
| | | } |
| | | }).forEach { |
| | | if (!map.containsKey(it?.fumeDevId)) { |
| | | map[it?.fumeDevId] = mutableListOf() |
| | |
| | | } else { |
| | | val code = deviceCodeList[0] |
| | | fumeExceptionDataMapper.selectByExample(Example(FumeExceptionData::class.java).apply { |
| | | createCriteria().andBetween("beginTime", evaluationScene.config?.startTime, evaluationScene.config?.endTime) |
| | | createCriteria().andBetween("beginTime", |
| | | evaluationScene.config?.startTime, |
| | | evaluationScene.config?.endTime) |
| | | .andEqualTo("devId", code) |
| | | .andEqualTo("exception", "æ°æ®å¼å¸¸") |
| | | .andEqualTo("exceptionType", "0") |
| | |
| | | package cn.flightfeather.supervision.business.autooutput.score.construction |
| | | |
| | | import cn.flightfeather.supervision.business.autooutput.score.ScoreItem |
| | | import cn.flightfeather.supervision.common.utils.Constant |
| | | import cn.flightfeather.supervision.domain.ds1.entity.Problemlist |
| | | import org.springframework.stereotype.Component |
| | | import tk.mybatis.mapper.entity.Example |
| | |
| | | val total = p.size |
| | | var changed = 0 |
| | | p.forEach { |
| | | if (it.ischanged == true) { |
| | | if (it.ischanged == true && it.extension3 == Constant.CHANGE_CHECK_PASS) { |
| | | changed++ |
| | | } |
| | | } |
| | |
| | | */ |
| | | private fun transform(oldS: Int): Int { |
| | | return when { |
| | | // åºæ¬è§è |
| | | // åºæ¬è§è(90..94)åè§èï¼>=95ï¼ |
| | | oldS >= 90 -> 50 |
| | | // ä¸è§è |
| | | oldS >= 50 -> 30 |
| | |
| | | package cn.flightfeather.supervision.business.autooutput.score.mixingplant |
| | | |
| | | import cn.flightfeather.supervision.business.autooutput.score.ScoreItem |
| | | import cn.flightfeather.supervision.common.utils.Constant |
| | | import cn.flightfeather.supervision.domain.ds1.entity.Problemlist |
| | | import org.springframework.stereotype.Component |
| | | import tk.mybatis.mapper.entity.Example |
| | |
| | | val total = p.size |
| | | var changed = 0 |
| | | p.forEach { |
| | | if (it.ischanged == true) { |
| | | if (it.ischanged == true && it.extension3 == Constant.CHANGE_CHECK_PASS) { |
| | | changed++ |
| | | } |
| | | } |
| | |
| | | package cn.flightfeather.supervision.business.autooutput.score.restaurant |
| | | |
| | | import cn.flightfeather.supervision.business.autooutput.score.ScoreItem |
| | | import cn.flightfeather.supervision.common.utils.Constant |
| | | import cn.flightfeather.supervision.domain.ds1.entity.Problemlist |
| | | import org.springframework.stereotype.Component |
| | | import tk.mybatis.mapper.entity.Example |
| | |
| | | val total = p.size |
| | | var changed = 0 |
| | | p.forEach { |
| | | if (it.ischanged == true) { |
| | | if (it.ischanged == true && it.extension3 == Constant.CHANGE_CHECK_PASS) { |
| | | changed++ |
| | | } |
| | | } |
| | |
| | | package cn.flightfeather.supervision.business.autooutput.score.storage |
| | | |
| | | import cn.flightfeather.supervision.business.autooutput.score.ScoreItem |
| | | import cn.flightfeather.supervision.common.utils.Constant |
| | | import cn.flightfeather.supervision.domain.ds1.entity.Problemlist |
| | | import org.springframework.stereotype.Component |
| | | import tk.mybatis.mapper.entity.Example |
| | |
| | | val total = p.size |
| | | var changed = 0 |
| | | p.forEach { |
| | | if (it.ischanged == true) { |
| | | if (it.ischanged == true && it.extension3 == Constant.CHANGE_CHECK_PASS) { |
| | | changed++ |
| | | } |
| | | } |
| | |
| | | package cn.flightfeather.supervision.business.autooutput.score.wharf |
| | | |
| | | import cn.flightfeather.supervision.business.autooutput.score.ScoreItem |
| | | import cn.flightfeather.supervision.common.utils.Constant |
| | | import cn.flightfeather.supervision.domain.ds1.entity.Problemlist |
| | | import org.springframework.stereotype.Component |
| | | import tk.mybatis.mapper.entity.Example |
| | |
| | | val total = p.size |
| | | var changed = 0 |
| | | p.forEach { |
| | | if (it.ischanged == true) { |
| | | if (it.ischanged == true && it.extension3 == Constant.CHANGE_CHECK_PASS) { |
| | | changed++ |
| | | } |
| | | } |
ÎļþÃû´Ó src/main/kotlin/cn/flightfeather/supervision/business/bgtask/JingAnScoreTaskCtrl.kt ÐÞ¸Ä |
| | |
| | | * éå®åº50åå¶è¯å转æ¢ä»»å¡ |
| | | */ |
| | | @Component |
| | | class JingAnScoreTaskCtrl( |
| | | class JinAnScoreTaskCtrl( |
| | | private val backgroundTaskCtrl: BackgroundTaskCtrl, |
| | | private val jaScore: JAScore, |
| | | private val evaluationRep: EvaluationRep |
| | |
| | | /** |
| | | * éå®å·¥å°åæ°è½¬æ¢ä»»å¡ |
| | | */ |
| | | fun startTaskJingAn(startTime: LocalDateTime) { |
| | | fun startTaskJinAn(startTime: LocalDateTime) { |
| | | startTask("31", "3100", "310106", startTime) |
| | | } |
| | | |
| | |
| | | |
| | | import cn.flightfeather.supervision.common.utils.Constant |
| | | import cn.flightfeather.supervision.domain.ds1.entity.Evaluationrule |
| | | import cn.flightfeather.supervision.domain.ds1.entity.Evaluationsubrule2 |
| | | import cn.flightfeather.supervision.domain.ds1.mapper.EvaluationruleMapper |
| | | import cn.flightfeather.supervision.domain.ds1.mapper.EvaluationsubruleMapper2 |
| | | import cn.flightfeather.supervision.lightshare.vo.AreaEvaVo |
| | | import org.springframework.stereotype.Repository |
| | | import tk.mybatis.mapper.entity.Example |
| | |
| | | @Repository |
| | | class EvaluationRuleRep( |
| | | private val evaluationruleMapper: EvaluationruleMapper, |
| | | private val evaluationsubruleMapper2: EvaluationsubruleMapper2, |
| | | private val sceneRep: SceneRep, |
| | | ) { |
| | | |
| | | /** |
| | | * æ ¹æ®åæ°æ¥è¯¢æ»è§å |
| | | * @param areaEvaVo æ¥è¯¢åæ° |
| | | * @return |
| | | */ |
| | | fun findBaseRule(areaEvaVo: AreaEvaVo): List<Evaluationrule?> { |
| | | return evaluationruleMapper.selectByExample(Example(Evaluationrule::class.java).apply { |
| | |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®å·¡æ¥ä»»å¡idæ¾å°å¯¹åºèªå¨è¯ä¼°è§å |
| | | * @param subTaskId |
| | | * @return |
| | | */ |
| | | fun findAutoEvaluationRule(subTaskId:String): Evaluationrule? { |
| | | val scene = sceneRep.findBySubTask(subTaskId) |
| | | return findAutoEvaluationRule(Constant.SceneType.getByValue(scene?.typeid.toString())) |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®åºæ¯ç±»åæ¾å°èªå¨è¯ä¼°è§å |
| | | * èªå¨è¯ä¼°è§ååæ°[Evaluationrule.tasktypeid] = 99 |
| | | * @param sceneType |
| | | * @return |
| | | */ |
| | | fun findAutoEvaluationRule(sceneType: Constant.SceneType): Evaluationrule? { |
| | | return evaluationruleMapper.selectOne(Evaluationrule().apply { |
| | | scensetypeid = sceneType.value.toByteOrNull() |
| | |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®æ»è§åidæ¾å°åè§å |
| | | * @param ruleId |
| | | * @return |
| | | */ |
| | | fun findSubRule(ruleId: String?): List<Evaluationsubrule2> { |
| | | return evaluationsubruleMapper2.selectByExample(Example(Evaluationsubrule2::class.java).apply { |
| | | createCriteria().andEqualTo("erguid", ruleId) |
| | | orderBy("ertype").orderBy("displayid") |
| | | }) |
| | | } |
| | | |
| | | } |
| | |
| | | fun searchSubTaskByKeyword(userId: String, keyword: String, page: Int, perPage: Int): BaseResponse<List<SubtaskVo>> |
| | | |
| | | fun getDailyReport(config: ExcelConfigVo): BaseTableVo |
| | | |
| | | fun getScoreDetail(subTaskId: String): ScoreDetail |
| | | } |
| | |
| | | package cn.flightfeather.supervision.lightshare.service.impl |
| | | |
| | | import cn.flightfeather.supervision.common.exception.BizException |
| | | import cn.flightfeather.supervision.domain.ds1.entity.* |
| | | import cn.flightfeather.supervision.domain.ds1.mapper.EvaluationruleMapper |
| | | import cn.flightfeather.supervision.domain.ds1.mapper.EvaluationsubruleMapper |
| | |
| | | override fun getAutoScore(subTaskId: String): List<EvaluationVo> { |
| | | //åè§åéæ¡å¾å |
| | | val subRuleScores = evaluationRep.findItemEvaluation(subTaskId) |
| | | //æ»è§åid |
| | | val ruleId = mutableListOf<Evaluation>() |
| | | //è¯åæ»è§å |
| | | val rule = evaluationRuleRep.findAutoEvaluationRule(subTaskId) |
| | | val rule = evaluationRuleRep.findAutoEvaluationRule(subTaskId) ?: throw BizException("æªæ¾å°ç¸å
³èªå¨è¯ä¼°è§å") |
| | | //æ»è§å对åºçè¯ååè§å |
| | | val subRules = mutableListOf<Evaluationsubrule2>() |
| | | val subRules = evaluationRuleRep.findSubRule(rule.guid) |
| | | //æ¥è¯¢ç»æ |
| | | val resultList = mutableListOf<EvaluationVo>() |
| | | |
| | |
| | | when (it.ertype) { |
| | | 2 -> resultList.add(EvaluationVo().apply { |
| | | id = it.guid |
| | | title1 = it.itemname |
| | | title = it.itemname |
| | | scoreMode = it.extension1 |
| | | gradeMode = it.extension2 |
| | | score = when (gradeMode) { |
| | | maxScore = when (gradeMode) { |
| | | "minus_mode" -> it.minscore?.minus(it.maxscore ?: 0) ?: 0 |
| | | "add_mode" -> it.maxscore ?: 0 |
| | | else -> it.minscore?.minus(it.maxscore ?: 0) ?: 0 |
| | |
| | | 3 -> { |
| | | for (r in resultList) { |
| | | if (it.fatherid == r.id) { |
| | | r.sub1.add(SubEvaluationVo().apply { |
| | | r.subList.add(SubEvaluationVo().apply { |
| | | id = it.guid |
| | | title2 = it.itemname |
| | | gradeMode = it.extension2 |
| | |
| | | resultList.forEach{ r -> |
| | | //4级çè¯ä¼°é¡¹ç´æ¥éå±äº2级è¯ä¼°é¡¹ |
| | | if (r.id == it.fatherid) { |
| | | if (r.sub1.isEmpty()) { |
| | | r.sub1.add(SubEvaluationVo().apply { |
| | | if (r.subList.isEmpty()) { |
| | | r.subList.add(SubEvaluationVo().apply { |
| | | placeholder = true |
| | | id = it.guid |
| | | title2 = r.title1 |
| | | score = r.score |
| | | title2 = r.title |
| | | score = r.maxScore |
| | | gradeMode = r.gradeMode |
| | | selectMode = r.selectMode |
| | | group = _group++ |
| | | }) |
| | | } |
| | | r.sub1[0].sub2.add(ThirdEvaluationVo().apply { |
| | | r.subList[0].sub2.add(ThirdEvaluationVo().apply { |
| | | id = it.guid |
| | | content = it.itemname |
| | | score = when (r.sub1[0].gradeMode) { |
| | | "minus_mode" -> r.score.plus(it.maxscore ?: 0) |
| | | score = when (r.subList[0].gradeMode) { |
| | | "minus_mode" -> r.maxScore.plus(it.maxscore ?: 0) |
| | | "add_mode" -> it.maxscore ?: 0 |
| | | else -> r.score.plus(it.maxscore ?: 0) |
| | | else -> r.maxScore.plus(it.maxscore ?: 0) |
| | | } |
| | | //妿æå¾åè®°å½ï¼åæ¹åç¶æä¸ºéä¸ |
| | | for (s in subRuleScores) { |
| | |
| | | } |
| | | }) |
| | | } else { |
| | | r.sub1.forEach { sr -> |
| | | r.subList.forEach { sr -> |
| | | if (sr.id == it.fatherid){ |
| | | sr.sub2.add(ThirdEvaluationVo().apply { |
| | | id = it.guid |
| | |
| | | |
| | | override fun createOneScene(scense: Scense) { |
| | | //1. æå
¥åºæ¯è¡¨ |
| | | scense.townname = scense.townname?.trim() |
| | | sceneRep.insert(scense) |
| | | //2. çæå¯¹åºè´¦æ·ä¿¡æ¯ |
| | | val userInfo = userinfoService.createAccount(scense) |
| | |
| | | import cn.flightfeather.supervision.business.report.file.ReportThree |
| | | import cn.flightfeather.supervision.business.report.file.ReportTwo |
| | | import cn.flightfeather.supervision.business.report.template.* |
| | | import cn.flightfeather.supervision.common.exception.BizException |
| | | import cn.flightfeather.supervision.common.utils.* |
| | | import cn.flightfeather.supervision.domain.ds1.entity.* |
| | | import cn.flightfeather.supervision.domain.ds1.mapper.* |
| | | import cn.flightfeather.supervision.domain.ds1.repository.EvaluationRep |
| | | import cn.flightfeather.supervision.domain.ds1.repository.EvaluationRuleRep |
| | | import cn.flightfeather.supervision.domain.ds2.mapper.LedgerRecordMapper |
| | | import cn.flightfeather.supervision.domain.ds2.mapper.LedgerSubTypeMapper |
| | | import cn.flightfeather.supervision.domain.ds2.mapper.UserMapMapper |
| | |
| | | val ledgerRecordMapper: LedgerRecordMapper, |
| | | val userMapMapper: UserMapMapper, |
| | | val taskService: TaskService, |
| | | private val evaluationRep: EvaluationRep, |
| | | private val evaluationRuleRep: EvaluationRuleRep, |
| | | @Value("\${filePath}") var filePath: String, |
| | | @Value("\${imgPath}") var imgPath: String |
| | | @Value("\${imgPath}") var imgPath: String, |
| | | ) : SearchService { |
| | | |
| | | private val dateUtil = DateUtil() |
| | |
| | | |
| | | //建ç«ç¬¬ä¸å±ç®å½ï¼å
嫿æçä»»å¡ |
| | | val time = dateUtil.DateToString(Date(), "yyyy-MM-dd_HH-mm-ss") |
| | | var basePath = Constant.DEFAULT_FILE_PATH + File.separator + "images" + File.separator + "temp" + File.separator + time |
| | | var basePath = |
| | | Constant.DEFAULT_FILE_PATH + File.separator + "images" + File.separator + "temp" + File.separator + time |
| | | var file = File(basePath) |
| | | var i = 1 |
| | | while (file.exists() && i <= 100) { |
| | |
| | | mediafileMapper.selectByExample(Example(Mediafile::class.java).apply { |
| | | createCriteria().andEqualTo("businessguid", p.guid) |
| | | }).forEach { m -> |
| | | val picPath = Constant.DEFAULT_FILE_PATH + File.separator + "images" + File.separator + m.extension1 + m.guid + ".jpg" |
| | | val picPath = |
| | | Constant.DEFAULT_FILE_PATH + File.separator + "images" + File.separator + m.extension1 + m.guid + ".jpg" |
| | | val fromFile = File(picPath) |
| | | val picName = p.problemname + "_" + p.location + "($y).jpg" |
| | | val toFile = File(pPath + File.separator + picName) |
| | |
| | | //建ç«ç¬¬ä¸å±ç®å½ï¼å
嫿æçä»»å¡ |
| | | val topTask = taskMapper.selectByPrimaryKey(topTaskId) |
| | | val time = dateUtil.DateToString(Date(), "yyyy-MM-dd_HH-mm-ss") |
| | | val basePath = Constant.DEFAULT_FILE_PATH + File.separator + "images" + File.separator + "temp" + File.separator + topTask.name |
| | | val basePath = |
| | | Constant.DEFAULT_FILE_PATH + File.separator + "images" + File.separator + "temp" + File.separator + topTask.name |
| | | val file = File(basePath) |
| | | if (!file.exists()) { |
| | | file.mkdirs() |
| | |
| | | return response |
| | | } |
| | | |
| | | override fun searchScore4JingAn(token: String, year: Int, month: Int, page: Int?, perPage: Int?): BaseResponse<List<ScoreVo>> { |
| | | override fun searchScore4JingAn( |
| | | token: String, |
| | | year: Int, |
| | | month: Int, |
| | | page: Int?, |
| | | perPage: Int?, |
| | | ): BaseResponse<List<ScoreVo>> { |
| | | if (token != "jingan") { |
| | | return BaseResponse(false) |
| | | } |
| | |
| | | return BaseResponse(true, head = DataHead(p.pageNum, p.pages), data = result) |
| | | } |
| | | |
| | | override fun searchSubTaskByKeyword(userId: String, keyword: String, page: Int, perPage: Int): BaseResponse<List<SubtaskVo>> { |
| | | override fun searchSubTaskByKeyword( |
| | | userId: String, |
| | | keyword: String, |
| | | page: Int, |
| | | perPage: Int, |
| | | ): BaseResponse<List<SubtaskVo>> { |
| | | val userInfo = userinfoMapper.selectByPrimaryKey(userId) |
| | | if (userInfo.usertypeid?.toInt() == 3) return BaseResponse(false, "ä¼ä¸ç¨æ·æ æ¥è¯¢æé")//ä¼ä¸ç¨æ·æ æ³æ¥è¯¢ |
| | | val result = mutableListOf<SubtaskVo>() |
| | |
| | | evaluationruleMapper, evaluationsubruleMapper, evaluationMapper, itemevaluationMapper, |
| | | ledgerSubTypeMapper, ledgerRecordMapper, userinfoMapper, userMapMapper, townMapper |
| | | ) |
| | | val task = taskService.getByDistrictCode(config.districtCode, config.startTime)?.takeIf { it.isNotEmpty() }?.get(0) |
| | | val task = |
| | | taskService.getByDistrictCode(config.districtCode, config.startTime)?.takeIf { it.isNotEmpty() }?.get(0) |
| | | config.topTaskGuid = task?.tguid ?: "" |
| | | val dataSource = mutableListOf<DataSource>() |
| | | config.sceneType = Constant.SceneType.TYPE1.value.toInt() |
| | |
| | | |
| | | return BaseTableVo(result.first, result.second) |
| | | } |
| | | |
| | | override fun getScoreDetail(subTaskId: String): ScoreDetail { |
| | | //åè§åéæ¡å¾å |
| | | val subRuleScores = evaluationRep.findItemEvaluation(subTaskId) |
| | | //è¯åæ»è§å |
| | | val rule = evaluationRuleRep.findAutoEvaluationRule(subTaskId) ?: throw BizException("æªæ¾å°ç¸å
³èªå¨è¯ä¼°è§å") |
| | | //æ»è§å对åºçè¯ååè§å |
| | | val subRules = evaluationRuleRep.findSubRule(rule.guid) |
| | | //æ¥è¯¢ç»æ |
| | | val result = ScoreDetail() |
| | | |
| | | subRules.forEach { |
| | | it.ertype ?: return@forEach |
| | | result.addDetail(result.details, it, it.ertype!! - 1, subRuleScores, true) |
| | | } |
| | | result.calScore() |
| | | |
| | | return result |
| | | } |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | // val example = Example(Subtask::class.java).apply { |
| | | // createCriteria().andEqualTo("districtcode", _districtCode) |
| | | // .andGreaterThanOrEqualTo("planstarttime", _startTime) |
| | | // .andLessThanOrEqualTo("planendtime", _endTime) |
| | | // } |
| | | // |
| | | // var counts = 0 |
| | | // |
| | | // val p = PageHelper.startPage<Subtask>(page ?: 1, perPage ?: 30) |
| | | // |
| | | // subtaskMapper.selectByExample(example).forEach { s -> |
| | | // |
| | | // val scene = scenseMapper.selectByPrimaryKey(s.scenseid) |
| | | // val inspection = inspectionMapper.selectByExample(Example(Inspection::class.java).apply { |
| | | // createCriteria().andEqualTo("stguid", s.stguid) |
| | | // }).takeIf { it.isNotEmpty() }?.get(0) |
| | | // val evaluation = evaluationMapper.selectByExample(Example(Evaluation::class.java).apply { |
| | | // createCriteria().andEqualTo("stguid", s.stguid) |
| | | // }).takeIf { it.isNotEmpty() }?.get(0) |
| | | // |
| | | // if (scene.typeid != _sceneType.toByte()) { |
| | | // return@forEach |
| | | // } else { |
| | | // counts++ |
| | | // } |
| | | // |
| | | // |
| | | // val subtaskSearchResultVo = SubtaskSearchResultVo().apply { |
| | | // this.subTaskId = s.stguid |
| | | // this.districtName = scene.districtname |
| | | // this.townName = scene.townname |
| | | // this.sceneName = scene.name |
| | | // this.sceneAddress = scene.location |
| | | // this.planStartTime = s.planstarttime |
| | | // this.planEndTime = s.planendtime |
| | | // this.status = s.status |
| | | // this.path= inspection?.extension1 |
| | | // this.score = evaluation?.resultscorebef?.toIntOrNull() |
| | | // this.level = when { |
| | | // score == null -> null |
| | | // score!! >= 54 -> "åæ ¼" |
| | | // else -> "ä¸åæ ¼" |
| | | // } |
| | | // } |
| | | // tempResult.data.add(subtaskSearchResultVo) |
| | | // |
| | | // problemlistMapper.selectByExample(Example(Problemlist::class.java).apply { |
| | | // createCriteria().andEqualTo("stguid", s.stguid) |
| | | // }).forEach { p -> |
| | | // val problem = ProblemDetail().apply { |
| | | // this.problemId = p.guid |
| | | // this.problemName = p.problemname |
| | | // this.longitude = p.longitude?.toDouble() |
| | | // this.latitude = p.latitude?.toDouble() |
| | | // this.location = p.location |
| | | // this.rectification = p.ischanged |
| | | // this.rectificationTime = p.changedtime |
| | | // } |
| | | // subtaskSearchResultVo.problemList.add(problem) |
| | | // |
| | | // mediafileMapper.selectByExample(Example(Mediafile::class.java).apply { |
| | | // createCriteria().andEqualTo("businessguid", p.guid) |
| | | // }).forEach { m -> |
| | | // val url = m.extension1 + m.guid + ".jpg" |
| | | // if (m.ischanged == true) { |
| | | // problem.rectificationPics.add(url) |
| | | // } else { |
| | | // problem.problemPics.add(url) |
| | | // } |
| | | // } |
| | | // } |
| | | // } |
| | | // |
| | | // tempResult.head = DataHead().apply { |
| | | // this.page = p.pageNum |
| | | // this.totalPage = p.pages |
| | | // } |
| | | |
| | | return result |
| | | } |
| | | |
| | | override fun searchSubTask2(token: String, updateTime: String?, sceneType: Int?, districtCode: String?, startTime: String?, endTime: String?, page: Int?, perPage: Int?): BaseResponse<BaseSearchResultVo> { |
| | | override fun searchSubTask2( |
| | | token: String, |
| | | updateTime: String?, |
| | | sceneType: Int?, |
| | | districtCode: String?, |
| | | startTime: String?, |
| | | endTime: String?, |
| | | page: Int?, |
| | | perPage: Int?, |
| | | ): BaseResponse<BaseSearchResultVo> { |
| | | if (token != "jinshan") { |
| | | return BaseResponse(false, "请æ±tokené误") |
| | | } |
| | |
| | | scence.let { |
| | | // å¤æè¯¥åºæ¯æ¯å¦å·²æå¯¹åºè´¦æ· |
| | | val user = userInfoSVRep.findUser(it.guid) |
| | | if (user != null) return Userinfo() |
| | | if (user != null) return user |
| | | |
| | | val sceneName = it.name ?: return Userinfo() |
| | | val uName = getUName(sceneName) |
| | |
| | | package cn.flightfeather.supervision.lightshare.vo |
| | | |
| | | import cn.flightfeather.supervision.domain.ds1.entity.Evaluationsubrule2 |
| | | import cn.flightfeather.supervision.domain.ds1.entity.Itemevaluation |
| | | import com.fasterxml.jackson.annotation.JsonInclude |
| | | |
| | | /** |
| | | * è¯åè§ååå¾å |
| | | */ |
| | | @JsonInclude(JsonInclude.Include.NON_NULL) |
| | | class ScoreDetail { |
| | | // æ»å |
| | | var totalScore: Int = 0 |
| | | |
| | | // å¾å |
| | | var score: Int = 0 |
| | | |
| | | // å¾åç»å |
| | | var details = mutableListOf<ScoreItem>() |
| | | |
| | | /** |
| | | * æ°å¢ä¸æ¡è¯ä¼°è§åè®°å½ |
| | | * è¯ä¼°è§åçä¼ å
¥æé¡ºåºè¦æ±ï¼å¿
é¡»æ¯æç
§æµ
å±çº§è³æ·±å±çº§ç顺åºä¼ å
¥ï¼è¯ä¼°å±çº§ @see [Evaluationsubrule2.ertype] |
| | | * @param details ç»æ |
| | | * @param rule è¯ä¼°è§å |
| | | * @param level è¯ä¼°è§å对åºçå±çº§æ·±åº¦ï¼ä»1å¼å§éå¢ï¼1为æé¡¶å± |
| | | * @param resList åæ¡è§å对åºçè¯ä¼°ç»æ |
| | | * @param onlyShowSelected åªæ·»å éä¸çé项 |
| | | */ |
| | | fun addDetail( |
| | | details: MutableList<ScoreItem>, |
| | | rule: Evaluationsubrule2, |
| | | level: Int, |
| | | resList: List<Itemevaluation>, |
| | | onlyShowSelected: Boolean = false, |
| | | ) { |
| | | if (level == 1) { |
| | | val scoreItem = ScoreItem.fromRule(rule, resList) |
| | | if (onlyShowSelected) { |
| | | if (scoreItem.select) details.add(scoreItem) |
| | | } else { |
| | | details.add(scoreItem) |
| | | } |
| | | } else if (level > 1) { |
| | | var isFind = false |
| | | // 夿æå
¥è§åæ¯å¦æ¯å½åå±çº§è¯ä¼°éå䏿ä¸é¡¹çåè¯ä¼° |
| | | for (d in details) { |
| | | if (rule.fatherid == d.id) { |
| | | if (d.subList == null) d.subList = mutableListOf() |
| | | addDetail(d.subList!!, rule, 1, resList, onlyShowSelected) |
| | | isFind = true |
| | | break |
| | | } |
| | | } |
| | | // è¥æªæ¾å°ï¼åå¾ä¸ä¸å±çº§ç»§ç»æ¥æ¾ |
| | | if (!isFind && (level - 1 > 1)) { |
| | | details.forEach { d -> |
| | | d.subList?.let { |
| | | addDetail(it, rule, level - 1, resList, onlyShowSelected) |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * è®¡ç®æ»ååå¾å |
| | | */ |
| | | fun calScore() { |
| | | details.forEach { |
| | | totalScore += it.maxScore |
| | | if (it.gradeMode == "minus_mode") { |
| | | score += (it.score + it.maxScore) |
| | | } else if (it.gradeMode == "add_mode") { |
| | | score += it.score |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | @JsonInclude(JsonInclude.Include.NON_NULL) |
| | | class ScoreItem { |
| | | //æåºç´¢å¼ |
| | | var index: Int? = null |
| | | |
| | | //è¯ä¼°è§å级å«ï¼2ï¼3ï¼4)ï¼å¼è¶å¤§çº§å«è¶ä½ |
| | | var level: Int? = null |
| | | |
| | | //è§åid |
| | | var id: String? = null |
| | | |
| | | //è§åæè¿° |
| | | var title: String? = null |
| | | |
| | | //æ»åå¼ |
| | | var maxScore: Int = 0 |
| | | |
| | | //å®é
å¾å |
| | | var score: Int = 0 |
| | | |
| | | //æ¯å¦éä¸ |
| | | var select: Boolean = false |
| | | |
| | | //basic_score: åºç¡åï¼å¿
éï¼addition_scoreï¼éå åï¼å¯éï¼nullï¼é»è®¤åºç¡å |
| | | var scoreMode: String? = null |
| | | |
| | | //minus_mode: å忍¡å¼ï¼add_modeï¼å 忍¡å¼ï¼nullï¼ä¸å设å®ï¼è¯´æå
¶å项䏿¯å
·ä½çè¯ä¼°ç»å |
| | | var gradeMode: String? = null |
| | | |
| | | //single_mode: å鿍¡å¼ï¼multi_modeï¼å¤é模å¼ï¼nullï¼ä¸å设å®ï¼è¯´æå
¶å项䏿¯å
·ä½çè¯ä¼°ç»å |
| | | var selectMode: String? = null |
| | | |
| | | //äºçº§åè§å |
| | | var subList: MutableList<ScoreItem>? = null |
| | | |
| | | companion object { |
| | | /** |
| | | * æ ¹æ®è§ååå¾åç»æçæå¾å项 |
| | | * @param rule |
| | | * @param resList |
| | | */ |
| | | fun fromRule(rule: Evaluationsubrule2, resList: List<Itemevaluation>): ScoreItem { |
| | | return ScoreItem().apply { |
| | | index = rule.displayid?.toInt() |
| | | level = rule.ertype |
| | | id = rule.guid |
| | | title = rule.itemname |
| | | scoreMode = rule.extension1 |
| | | gradeMode = rule.extension2 |
| | | maxScore = rule.maxscore ?: 0 |
| | | selectMode = rule.extension3 |
| | | |
| | | //妿æå¾åè®°å½ï¼åæ¹åç¶æä¸ºéä¸ |
| | | for (s in resList) { |
| | | if (rule.guid == s.esrguid) { |
| | | score = s.value?.toInt() ?: 0 |
| | | select = s.extension1 == "true" |
| | | break |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | @JsonInclude(JsonInclude.Include.NON_NULL) |
| | | class EvaluationVo { |
| | | //è§åid |
| | | var id: String? = null |
| | | |
| | | //è§åæè¿° |
| | | var title1: String? = null |
| | | //åå¼ |
| | | var title: String? = null |
| | | |
| | | //æ»åå¼ |
| | | var maxScore: Int = 0 |
| | | |
| | | //å®é
å¾å |
| | | var score: Int = 0 |
| | | |
| | | //æ¯å¦éä¸ |
| | | var select: Boolean = false |
| | | |
| | | //basic_score: åºç¡åï¼å¿
éï¼addition_scoreï¼éå åï¼å¯éï¼nullï¼é»è®¤åºç¡å |
| | | var scoreMode: String? = "basic_score" |
| | | |
| | | //minus_mode: å忍¡å¼ï¼add_modeï¼å 忍¡å¼ï¼nullï¼ä¸å设å®ï¼è¯´æå
¶å项䏿¯å
·ä½çè¯ä¼°ç»å |
| | | var gradeMode: String? = "minus_mode" |
| | | |
| | | //single_mode: å鿍¡å¼ï¼multi_modeï¼å¤é模å¼ï¼nullï¼ä¸å设å®ï¼è¯´æå
¶å项䏿¯å
·ä½çè¯ä¼°ç»å |
| | | var selectMode: String? = "single_mode" |
| | | |
| | | //äºçº§åè§å |
| | | var sub1: MutableList<SubEvaluationVo> = mutableListOf() |
| | | var subList: 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 |
| | | |
| | | //minus_mode: å忍¡å¼ï¼add_modeï¼å 忍¡å¼ï¼ |
| | | var gradeMode: String? = "minus_mode" |
| | | |
| | | //single_mode: å鿍¡å¼ï¼multi_modeï¼å¤é模å¼ï¼ |
| | | var selectMode: String? = "single_mode" |
| | | |
| | | //äºçº§è§ååç» |
| | | 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 |
| | | } |
| | |
| | | |
| | | class ScoreVo { |
| | | |
| | | var sceneId: String? = null |
| | | |
| | | var sceneName: String? = null |
| | | |
| | | var year: Int? = null |
| | |
| | | import cn.flightfeather.supervision.lightshare.vo.ExcelConfigVo |
| | | import io.swagger.annotations.Api |
| | | import io.swagger.annotations.ApiOperation |
| | | import io.swagger.annotations.ApiParam |
| | | import org.springframework.beans.factory.annotation.Autowired |
| | | import org.springframework.web.bind.annotation.* |
| | | import springfox.documentation.annotations.ApiIgnore |
| | |
| | | @RequestParam("per_page", required = false) perPage: Int? |
| | | ) = searchService.searchScore4JingAn(token, year, month, page, perPage) |
| | | |
| | | @ApiOperation(value = "æ¥æ¾å·¡æ¥ä»»å¡èªå¨è¯ä¼°çè¯åç»è") |
| | | @GetMapping("/score/detail") |
| | | fun getAutoScore( |
| | | @ApiParam(value = "å·¡æ¥ä»»å¡id") @RequestParam subTaskId: String, |
| | | ) = resPack { searchService.getScoreDetail(subTaskId) } |
| | | |
| | | @GetMapping("/subtask/jinshan") |
| | | fun searchSubTask2( |
| | | @RequestParam("token") token: String, |
ÎļþÃû´Ó src/test/kotlin/cn/flightfeather/supervision/business/bgtask/JingAnScoreTaskCtrlTest.kt ÐÞ¸Ä |
| | |
| | | package cn.flightfeather.supervision.business.bgtask |
| | | |
| | | import org.junit.Test |
| | | import org.junit.jupiter.api.Assertions.* |
| | | import org.junit.jupiter.api.extension.ExtendWith |
| | | import org.junit.runner.RunWith |
| | | import org.springframework.beans.factory.annotation.Autowired |
| | |
| | | @RunWith(SpringRunner::class) |
| | | @ExtendWith(SpringExtension::class) |
| | | @SpringBootTest |
| | | class JingAnScoreTaskCtrlTest() { |
| | | class JinAnScoreTaskCtrlTest() { |
| | | @Autowired |
| | | lateinit var jingAnScoreTaskCtrl: JingAnScoreTaskCtrl |
| | | lateinit var jinAnScoreTaskCtrl: JinAnScoreTaskCtrl |
| | | |
| | | @Test |
| | | fun startTask() { |
| | | var time = LocalDateTime.of(2023, 10, 1, 0, 0, 0) |
| | | repeat(4) { |
| | | jingAnScoreTaskCtrl.startTaskJingAn(time) |
| | | var time = LocalDateTime.of(2024, 2, 1, 0, 0, 0) |
| | | repeat(3) { |
| | | jinAnScoreTaskCtrl.startTaskJinAn(time) |
| | | time = time.plusMonths(1) |
| | | } |
| | | } |
| | |
| | | |
| | | @Test |
| | | fun createTZUserInfo() { |
| | | val sId = listOf("lMqvVUjDrcAfb5l9", |
| | | "iRn69RgMMJVCnvVy", |
| | | "BHkeYXhWBIN7dpm4", |
| | | "moT0gClykLAgTedp", |
| | | "9tNfxmcUBspynqOB", |
| | | "dXcHOIqFvFRSeKhg", |
| | | "XNoilpfLZESw5DP0", |
| | | "f4fOMCcBAtrmqDO7", |
| | | "GyOZyyiouI15lfdZ", |
| | | "k2FSexhq1Yj3GXAA", |
| | | "K7FTWRkLFrfenq4G", |
| | | "0nPo3EoR7K0JHq6d", |
| | | "YHYxGucNfjkMjSLI", |
| | | "ppzbVvgaqTbHLMFL", |
| | | "eJcnnfg6joXLUlYN", |
| | | "dSuH4hr66NAfflti", |
| | | "Ba8jWakmIYexMxvK", |
| | | "jYRzLMfB81qfOaec", |
| | | "L5ABNgmzgqDLGWnw", |
| | | "yYy88ocNnnZDreIK", |
| | | val sId = listOf( |
| | | "9jqhywmfvpgvxrT2" |
| | | ) |
| | | sId.forEach { |
| | | val scene = sceneRep.findScene(sceneId = it) ?: return@forEach |