| | |
| | | } |
| | | } |
| | | |
| | | |
| | | // 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错误") |
| | | } |