| | |
| | | val name = "${districtName}${Constant.SceneType.getDes(sceneType)}èªå¨è¯å" |
| | | val bgTask = backgroundTaskCtrl.startNewTask(BgTaskType.AUTO_SCORE, id, name) { |
| | | // çæµæ°æ®åæå
¥åº |
| | | dataAnalysis(districtCode, sceneType, taskId, year, month) |
| | | // dataAnalysis(districtCode, sceneType, taskId, year, month) |
| | | // èªå¨è¯ä¼°è®¡ç®å
¥åº |
| | | aopEvaluation.executeByTopTask(taskId, sceneType) |
| | | // ç¯ä¿¡ç ç»æè½¬æ¢å
¥åº |
| | |
| | | |
| | | //1. æ¥æ¾ç¹å®çå·¡æ¥ä»»å¡æè
ææç计åå·¡æ¥ä»»å¡ |
| | | var taskSceneIdList = listOf<String>() |
| | | val subTaskList = if (config.subTaskIdList?.isNotEmpty() == true || |
| | | (config.startTime != null || config.endTime != null) |
| | | ) { |
| | | val subTaskList = if (config.subTaskIdList?.isNotEmpty() == true) { |
| | | dbMapper.subtaskMapper.selectByExample(Example(Subtask::class.java).apply { |
| | | createCriteria().apply { |
| | | if (config.subTaskIdList?.isNotEmpty() == true) { |
| | | andIn("stguid", config.subTaskIdList) |
| | | } |
| | | andIn("stguid", config.subTaskIdList) |
| | | config.startTime?.let { andGreaterThanOrEqualTo("planstarttime", it) } |
| | | config.endTime?.let { andLessThanOrEqualTo("planendtime", it) } |
| | | config.districtCode?.let { andEqualTo("districtcode", it) } |
| | |
| | | taskSceneIdList = dbMapper.scenseMapper.getSceneByType(config.topTaskGuid, config |
| | | .sceneType, config.townCode).map { it.guid ?: "" } |
| | | dbMapper.subtaskMapper.selectByExample(Example(Subtask::class.java).apply { |
| | | createCriteria().andIn("scenseid", taskSceneIdList) |
| | | .andEqualTo("tguid", config.topTaskGuid) |
| | | createCriteria().apply { |
| | | if (taskSceneIdList.isNotEmpty()) andIn("scenseid", taskSceneIdList) |
| | | }.andEqualTo("tguid", config.topTaskGuid) |
| | | }) |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.flightfeather.supervision.business.report.file |
| | | |
| | | import cn.flightfeather.supervision.business.report.BaseExcel |
| | | import cn.flightfeather.supervision.business.report.BaseTemplate |
| | | import cn.flightfeather.supervision.business.report.DataSource |
| | | import cn.flightfeather.supervision.business.report.template.ScoreAnalysisSummary |
| | | import cn.flightfeather.supervision.business.report.template.ScoreDetailSummary |
| | | |
| | | /** |
| | | * èªå¨è¯ä¼°ç»æä¸ä¼ æ¨¡æ¿ |
| | | * @date 2024/9/27 |
| | | * @author feiyu02 |
| | | */ |
| | | class TemplateScore(dataSource: DataSource) : BaseExcel(dataSource) { |
| | | override val templates: List<BaseTemplate> = listOf(ScoreDetailSummary(dataSource), ScoreAnalysisSummary(dataSource)) |
| | | override val fileName: String = "è§èæ§è¯ä¼°æ¨¡æ¿" |
| | | } |
| | |
| | | } |
| | | |
| | | /** |
| | | * èªå¨å¤çè¡åå¹¶æ°æ® |
| | | * åå
¥excel |
| | | */ |
| | | fun write(heads: List<Array<Any>>, contents: MutableList<Array<Any>>, workbook: HSSFWorkbook, sheetName: String |
| | | = "sheet1") { |
| | |
| | | } |
| | | |
| | | /** |
| | | * èªå¨å¤çè¡åå¹¶æ°æ® |
| | | * åå
¥excel |
| | | */ |
| | | fun write2(out: OutputStream, heads: List<Array<Any>>, contents: MutableList<Array<Any>>, sheetName: String = "sheet1") { |
| | | |
| | |
| | | import cn.flightfeather.supervision.lightshare.vo.AutoScoreResultVo |
| | | import cn.flightfeather.supervision.lightshare.vo.BaseResponse |
| | | import cn.flightfeather.supervision.lightshare.vo.EvaluateResVo |
| | | import org.springframework.web.multipart.MultipartFile |
| | | import springfox.documentation.annotations.ApiIgnore |
| | | import javax.servlet.http.HttpServletResponse |
| | | |
| | |
| | | fun findAutoEvaluation(areaVo: AreaVo): List<AutoScoreResultVo?>? |
| | | |
| | | fun downloadAutoEvaluation(areaVo: AreaVo, forceUpdate: Boolean, response: HttpServletResponse): Boolean |
| | | |
| | | fun downloadAutoEvaTemplate(areaVo: AreaVo, response: HttpServletResponse) |
| | | |
| | | fun uploadAutoEvaluation(areaVo: AreaVo, file: MultipartFile): Boolean |
| | | } |
| | |
| | | package cn.flightfeather.supervision.lightshare.service |
| | | |
| | | import cn.flightfeather.supervision.domain.ds1.entity.Evaluationsubrule |
| | | import cn.flightfeather.supervision.domain.ds1.entity.Evaluationsubrule2 |
| | | import cn.flightfeather.supervision.lightshare.vo.ScoreDetail |
| | | |
| | | |
| | | interface EvaluationsubruleService { |
| | | fun findOne(id:String): Evaluationsubrule |
| | | fun findOne(id:String): Evaluationsubrule2 |
| | | |
| | | fun findAll(): MutableList<Evaluationsubrule> |
| | | fun findAll(): MutableList<Evaluationsubrule2> |
| | | |
| | | fun save(evaluationsubrule: Evaluationsubrule): Int |
| | | fun save(evaluationsubrule: Evaluationsubrule2): Int |
| | | |
| | | fun update(evaluationsubrule: Evaluationsubrule): Int |
| | | fun update(evaluationsubrule: Evaluationsubrule2): Int |
| | | |
| | | fun delete(id:String): Int |
| | | |
| | | fun findByRuleId(erguid: String): List<Evaluationsubrule2> |
| | | |
| | | fun search(districtCode: String, sceneTypeId: String, version: String? = null): List<Evaluationsubrule> |
| | | fun search(districtCode: String, sceneTypeId: String, version: String? = null): List<Evaluationsubrule2> |
| | | |
| | | fun getAutoScore(subTaskId: String): ScoreDetail |
| | | |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired |
| | | import org.springframework.beans.factory.annotation.Value |
| | | import org.springframework.stereotype.Service |
| | | import org.springframework.web.multipart.MultipartFile |
| | | import tk.mybatis.mapper.entity.Example |
| | | import java.io.File |
| | | import java.util.* |
| | |
| | | return true |
| | | } |
| | | } |
| | | |
| | | override fun downloadAutoEvaTemplate(areaVo: AreaVo, response: HttpServletResponse) { |
| | | TODO("Not yet implemented") |
| | | } |
| | | |
| | | override fun uploadAutoEvaluation(areaVo: AreaVo, file: MultipartFile): Boolean { |
| | | TODO("Not yet implemented") |
| | | } |
| | | } |
| | |
| | | |
| | | import cn.flightfeather.supervision.common.exception.BizException |
| | | import cn.flightfeather.supervision.domain.ds1.entity.Evaluationrule |
| | | import cn.flightfeather.supervision.domain.ds1.entity.Evaluationsubrule |
| | | import cn.flightfeather.supervision.domain.ds1.entity.Evaluationsubrule2 |
| | | import cn.flightfeather.supervision.domain.ds1.mapper.EvaluationruleMapper |
| | | import cn.flightfeather.supervision.domain.ds1.mapper.EvaluationsubruleMapper |
| | | import cn.flightfeather.supervision.domain.ds1.mapper.EvaluationsubruleMapper2 |
| | | import cn.flightfeather.supervision.domain.ds1.repository.EvaluationRep |
| | | import cn.flightfeather.supervision.domain.ds1.repository.EvaluationRuleRep |
| | | import cn.flightfeather.supervision.domain.ds1.repository.SceneRep |
| | |
| | | |
| | | @Service |
| | | class EvaluationsubruleServiceImpl( |
| | | val evaluationsubruleMapper: EvaluationsubruleMapper, |
| | | val evaluationsubruleMapper: EvaluationsubruleMapper2, |
| | | val evaluationruleMapper: EvaluationruleMapper, |
| | | private val evaluationRep: EvaluationRep, |
| | | private val evaluationRuleRep: EvaluationRuleRep, |
| | | private val sceneRep: SceneRep, |
| | | ) : EvaluationsubruleService { |
| | | |
| | | override fun findOne(id: String): Evaluationsubrule = evaluationsubruleMapper.selectByPrimaryKey(id) |
| | | override fun findOne(id: String): Evaluationsubrule2 = evaluationsubruleMapper.selectByPrimaryKey(id) |
| | | |
| | | override fun findAll(): MutableList<Evaluationsubrule> = evaluationsubruleMapper.selectAll() |
| | | override fun findAll(): MutableList<Evaluationsubrule2> = evaluationsubruleMapper.selectAll() |
| | | |
| | | override fun save(evaluationsubrule: Evaluationsubrule): Int = evaluationsubruleMapper.insert(evaluationsubrule) |
| | | override fun save(evaluationsubrule: Evaluationsubrule2): Int = evaluationsubruleMapper.insert(evaluationsubrule) |
| | | |
| | | override fun update(evaluationsubrule: Evaluationsubrule): Int = |
| | | override fun update(evaluationsubrule: Evaluationsubrule2): Int = |
| | | evaluationsubruleMapper.updateByPrimaryKey(evaluationsubrule) |
| | | |
| | | override fun delete(id: String): Int = evaluationsubruleMapper.deleteByPrimaryKey(id) |
| | |
| | | return evaluationRuleRep.findSubRule(erguid) |
| | | } |
| | | |
| | | override fun search(districtCode: String, sceneTypeId: String, version: String?): List<Evaluationsubrule> { |
| | | val result = mutableListOf<Evaluationsubrule>() |
| | | override fun search(districtCode: String, sceneTypeId: String, version: String?): List<Evaluationsubrule2> { |
| | | val result = mutableListOf<Evaluationsubrule2>() |
| | | evaluationruleMapper.selectByExample(Example(Evaluationrule::class.java).apply { |
| | | createCriteria().andEqualTo("districtcode", districtCode) |
| | | .andEqualTo("scensetypeid", sceneTypeId) |
| | | }).takeIf { it.isNotEmpty() }?.get(0)?.let { rule -> |
| | | evaluationsubruleMapper.selectByExample(Example(Evaluationsubrule::class.java).apply { |
| | | evaluationsubruleMapper.selectByExample(Example(Evaluationsubrule2::class.java).apply { |
| | | createCriteria().andEqualTo("erguid", rule.guid) |
| | | }) |
| | | }?.also { |
| | |
| | | import cn.flightfeather.supervision.lightshare.vo.AreaVo |
| | | import io.swagger.annotations.Api |
| | | import io.swagger.annotations.ApiOperation |
| | | import io.swagger.annotations.ApiParam |
| | | import org.springframework.web.bind.annotation.* |
| | | import org.springframework.web.multipart.MultipartFile |
| | | import springfox.documentation.annotations.ApiIgnore |
| | | import javax.servlet.http.HttpServletResponse |
| | | |
| | |
| | | @ApiOperation(value = "ä¸è½½èªå¨è¯ä¼°ç»æ") |
| | | @PostMapping("/auto/record/download") |
| | | fun downloadAutoEvaluation( |
| | | @RequestBody areaVo: AreaVo, @RequestParam forceUpdate: Boolean, |
| | | @ApiParam("åºåæ¡ä»¶ä¿¡æ¯") @RequestBody areaVo: AreaVo, |
| | | @ApiParam("æ¯å¦å¼ºå¶çææ°çæ¥å") @RequestParam forceUpdate: Boolean, |
| | | @ApiIgnore response: HttpServletResponse, |
| | | ) = resPack { evaluationService.downloadAutoEvaluation(areaVo, forceUpdate, response) } |
| | | |
| | | @ApiOperation(value = "ä¸è½½èªå¨è¯ä¼°ç»æå¯¼å
¥æ¨¡æ¿") |
| | | @PostMapping("/auto/record/template") |
| | | fun downloadAutoEvaTemplate( |
| | | @ApiParam("åºåæ¡ä»¶ä¿¡æ¯") @RequestBody areaVo: AreaVo, |
| | | @ApiIgnore response: HttpServletResponse, |
| | | ) = resPack { evaluationService.downloadAutoEvaTemplate(areaVo, response) } |
| | | |
| | | @ApiOperation(value = "ä¸ä¼ èªå¨è¯ä¼°ç»æ") |
| | | @PutMapping("/auto/record/upload") |
| | | fun uploadAutoEvaluation( |
| | | @ApiParam("åºåæ¡ä»¶ä¿¡æ¯") @RequestBody areaVo: AreaVo, |
| | | @ApiParam("excelæä»¶") @RequestPart("excel") file: MultipartFile, |
| | | ) = resPack { evaluationService.uploadAutoEvaluation(areaVo, file) } |
| | | } |
| | |
| | | package cn.flightfeather.supervision.lightshare.web |
| | | |
| | | import cn.flightfeather.supervision.domain.ds1.entity.Evaluationsubrule |
| | | import cn.flightfeather.supervision.domain.ds1.entity.Evaluationsubrule2 |
| | | import cn.flightfeather.supervision.lightshare.service.EvaluationsubruleService |
| | | import io.swagger.annotations.Api |
| | | import io.swagger.annotations.ApiOperation |
| | |
| | | fun getAll() = evaluationsubruleService.findAll() |
| | | |
| | | @PutMapping |
| | | fun add(@RequestBody evaluationsubrule: Evaluationsubrule) = evaluationsubruleService.save(evaluationsubrule) |
| | | fun add(@RequestBody evaluationsubrule: Evaluationsubrule2) = evaluationsubruleService.save(evaluationsubrule) |
| | | |
| | | @PostMapping |
| | | fun update(@RequestBody evaluationsubrule: Evaluationsubrule) = evaluationsubruleService.update(evaluationsubrule) |
| | | fun update(@RequestBody evaluationsubrule: Evaluationsubrule2) = evaluationsubruleService.update(evaluationsubrule) |
| | | |
| | | @GetMapping("/{id}") |
| | | fun getById(@PathVariable id: String) = evaluationsubruleService.findOne(id) |