parent
10d5c071c9
commit
987ea0ce0c
|
|
@ -32,11 +32,10 @@ public class ConstructionIssueFeedbackController extends BaseController {
|
||||||
private IConstructionIssueFeedbackService constructionIssueFeedbackService;
|
private IConstructionIssueFeedbackService constructionIssueFeedbackService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询施工问题反馈列表(施工方查监理确认的问题、监理查全部)
|
* 查询施工问题反馈列表
|
||||||
* 支持按项目ID、来源、状态筛选
|
* 支持按项目ID、来源、状态筛选
|
||||||
*/
|
*/
|
||||||
@Operation(summary = "查询施工问题反馈列表")
|
@Operation(summary = "查询施工问题反馈列表")
|
||||||
@PreAuthorize("@ss.hasPermi('contractor:constructionIssue:list')")
|
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public TableDataInfo list(ConstructionIssueFeedback query) {
|
public TableDataInfo list(ConstructionIssueFeedback query) {
|
||||||
startPage();
|
startPage();
|
||||||
|
|
@ -48,27 +47,25 @@ public class ConstructionIssueFeedbackController extends BaseController {
|
||||||
* 获取施工问题反馈详情
|
* 获取施工问题反馈详情
|
||||||
*/
|
*/
|
||||||
@Operation(summary = "获取施工问题反馈详情")
|
@Operation(summary = "获取施工问题反馈详情")
|
||||||
@PreAuthorize("@ss.hasPermi('contractor:constructionIssue:query')")
|
|
||||||
@GetMapping("/{id}")
|
@GetMapping("/{id}")
|
||||||
public AjaxResult getInfo(@Parameter(description = "反馈ID") @PathVariable("id") Long id) {
|
public AjaxResult getInfo(@Parameter(description = "反馈 ID") @PathVariable("id") Long id) {
|
||||||
return success(constructionIssueFeedbackService.selectConstructionIssueFeedbackById(id));
|
return success(constructionIssueFeedbackService.selectConstructionIssueFeedbackById(id));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取施工问题反馈详情(级联整改记录)
|
* 统计项目待整改问题数量
|
||||||
*/
|
*/
|
||||||
@Operation(summary = "获取施工问题反馈详情(含整改记录)")
|
@Operation(summary = "统计项目待整改问题数量")
|
||||||
@PreAuthorize("@ss.hasPermi('contractor:constructionIssue:query')")
|
@GetMapping("/pendingCount/{projectId}")
|
||||||
@GetMapping("/{id}/detail")
|
public AjaxResult pendingCount(@Parameter(description = "项目 ID") @PathVariable("projectId") Long projectId) {
|
||||||
public AjaxResult getDetailWithRectifications(@Parameter(description = "反馈ID") @PathVariable("id") Long id) {
|
int count = constructionIssueFeedbackService.countPendingByProjectId(projectId);
|
||||||
return success(constructionIssueFeedbackService.selectDetailWithRectifications(id));
|
return success(count);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 监理人工提交现场问题(检测名称、描述、问题照片URL等)
|
* 监理人工提交现场问题(检测名称、描述、问题照片 URL 等)
|
||||||
*/
|
*/
|
||||||
@Operation(summary = "监理人工提交现场问题")
|
@Operation(summary = "监理人工提交现场问题")
|
||||||
@PreAuthorize("@ss.hasPermi('contractor:constructionIssue:add')")
|
|
||||||
@Log(title = "施工问题反馈", businessType = BusinessType.INSERT)
|
@Log(title = "施工问题反馈", businessType = BusinessType.INSERT)
|
||||||
@PostMapping("/manual")
|
@PostMapping("/manual")
|
||||||
public AjaxResult manualSubmit(@Validated @RequestBody ConstructionIssueFeedback feedback) {
|
public AjaxResult manualSubmit(@Validated @RequestBody ConstructionIssueFeedback feedback) {
|
||||||
|
|
@ -79,7 +76,6 @@ public class ConstructionIssueFeedbackController extends BaseController {
|
||||||
* 更新施工问题反馈(如状态:待处理/已处理/已关闭)
|
* 更新施工问题反馈(如状态:待处理/已处理/已关闭)
|
||||||
*/
|
*/
|
||||||
@Operation(summary = "更新施工问题反馈")
|
@Operation(summary = "更新施工问题反馈")
|
||||||
@PreAuthorize("@ss.hasPermi('contractor:constructionIssue:edit')")
|
|
||||||
@Log(title = "施工问题反馈", businessType = BusinessType.UPDATE)
|
@Log(title = "施工问题反馈", businessType = BusinessType.UPDATE)
|
||||||
@PutMapping
|
@PutMapping
|
||||||
public AjaxResult update(@Validated @RequestBody ConstructionIssueFeedback feedback) {
|
public AjaxResult update(@Validated @RequestBody ConstructionIssueFeedback feedback) {
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ package com.admin.contractor.controller;
|
||||||
import com.admin.contractor.domain.ConstructionIssueRectification;
|
import com.admin.contractor.domain.ConstructionIssueRectification;
|
||||||
import com.admin.contractor.domain.dto.RectificationReviewDTO;
|
import com.admin.contractor.domain.dto.RectificationReviewDTO;
|
||||||
import com.admin.contractor.domain.dto.RectificationSubmitDTO;
|
import com.admin.contractor.domain.dto.RectificationSubmitDTO;
|
||||||
|
import com.admin.contractor.domain.vo.RectificationDetailVO;
|
||||||
import com.admin.contractor.domain.vo.RectificationPendingVO;
|
import com.admin.contractor.domain.vo.RectificationPendingVO;
|
||||||
import com.admin.contractor.service.IConstructionIssueRectificationService;
|
import com.admin.contractor.service.IConstructionIssueRectificationService;
|
||||||
import com.ruoyi.common.core.web.controller.BaseController;
|
import com.ruoyi.common.core.web.controller.BaseController;
|
||||||
|
|
@ -34,22 +35,11 @@ public class ConstructionIssueRectificationController extends BaseController {
|
||||||
@Autowired
|
@Autowired
|
||||||
private IConstructionIssueRectificationService rectificationService;
|
private IConstructionIssueRectificationService rectificationService;
|
||||||
|
|
||||||
/**
|
|
||||||
* 施工单位暂存整改草稿
|
|
||||||
*/
|
|
||||||
@Operation(summary = "暂存整改草稿(施工单位)")
|
|
||||||
@PreAuthorize("@ss.hasPermi('contractor:constructionIssue:edit')")
|
|
||||||
@Log(title = "施工问题整改", businessType = BusinessType.UPDATE)
|
|
||||||
@PostMapping("/saveDraft")
|
|
||||||
public AjaxResult saveDraft(@Validated @RequestBody RectificationSubmitDTO dto) {
|
|
||||||
return toAjax(rectificationService.saveDraft(dto));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 施工单位提交整改
|
* 施工单位提交整改
|
||||||
*/
|
*/
|
||||||
@Operation(summary = "提交整改(施工单位)")
|
@Operation(summary = "提交整改(施工单位)")
|
||||||
@PreAuthorize("@ss.hasPermi('contractor:constructionIssue:edit')")
|
|
||||||
@Log(title = "施工问题整改", businessType = BusinessType.UPDATE)
|
@Log(title = "施工问题整改", businessType = BusinessType.UPDATE)
|
||||||
@PostMapping("/submit")
|
@PostMapping("/submit")
|
||||||
public AjaxResult submitRectification(@Validated @RequestBody RectificationSubmitDTO dto) {
|
public AjaxResult submitRectification(@Validated @RequestBody RectificationSubmitDTO dto) {
|
||||||
|
|
@ -57,21 +47,19 @@ public class ConstructionIssueRectificationController extends BaseController {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 按问题反馈ID查询整改列表(含草稿、已提交,施工方/监理查看)
|
* 按问题反馈 ID 获取问题数据级联整改表数据
|
||||||
*/
|
*/
|
||||||
@Operation(summary = "按问题反馈ID查询整改列表")
|
@Operation(summary = "按问题反馈 ID 获取问题数据")
|
||||||
@PreAuthorize("@ss.hasPermi('contractor:constructionIssue:query')")
|
@GetMapping("/detail/{feedbackId}")
|
||||||
@GetMapping("/list/{feedbackId}")
|
public AjaxResult getDetailByFeedbackId(@Parameter(description = "问题反馈 ID") @PathVariable("feedbackId") Long feedbackId) {
|
||||||
public AjaxResult listByFeedbackId(@Parameter(description = "问题反馈ID") @PathVariable("feedbackId") Long feedbackId) {
|
RectificationDetailVO detail = rectificationService.getDetailByFeedbackId(feedbackId);
|
||||||
List<ConstructionIssueRectification> list = rectificationService.listByFeedbackId(feedbackId);
|
return success(detail);
|
||||||
return success(list);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 施工单位查询整改记录:按项目ID联查 cons_issue_r / cons_issue_fb
|
* 施工单位查询整改记录:按项目 ID 联查 cons_issue_rf / cons_issue_fb
|
||||||
*/
|
*/
|
||||||
@Operation(summary = "施工单位查询整改记录(按项目)")
|
@Operation(summary = "施工单位查询整改记录(按项目id)")
|
||||||
@PreAuthorize("@ss.hasPermi('contractor:constructionIssue:query')")
|
|
||||||
@GetMapping("/listByProject/{projectId}")
|
@GetMapping("/listByProject/{projectId}")
|
||||||
public TableDataInfo listByProjectId(@Parameter(description = "项目ID") @PathVariable("projectId") Long projectId) {
|
public TableDataInfo listByProjectId(@Parameter(description = "项目ID") @PathVariable("projectId") Long projectId) {
|
||||||
startPage();
|
startPage();
|
||||||
|
|
@ -80,22 +68,21 @@ public class ConstructionIssueRectificationController extends BaseController {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 监理待复核整改列表(问题+整改摘要)
|
* 按项目ID查询整改记录(级联问题反馈)
|
||||||
*/
|
*/
|
||||||
@Operation(summary = "待复核整改列表(监理)")
|
@Operation(summary = "按项目ID查询整改记录(含问题反馈)")
|
||||||
@PreAuthorize("@ss.hasPermi('contractor:constructionIssue:list')")
|
@GetMapping("/listDetailByProject/{projectId}")
|
||||||
@GetMapping("/pendingReview")
|
public TableDataInfo listDetailByProjectId(@Parameter(description = "项目ID") @PathVariable("projectId") Long projectId) {
|
||||||
public TableDataInfo pendingReview() {
|
|
||||||
startPage();
|
startPage();
|
||||||
List<RectificationPendingVO> list = rectificationService.listPendingReview();
|
List<RectificationDetailVO> list = rectificationService.listDetailByProjectId(projectId);
|
||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 监理提交复核结果(整改到位/整改未到位,未到位需重新整改)
|
* 监理提交复核结果(整改到位/整改未到位,未到位需重新整改)
|
||||||
*/
|
*/
|
||||||
@Operation(summary = "提交整改复核结果(监理)")
|
@Operation(summary = "提交整改复核结果(监理)")
|
||||||
@PreAuthorize("@ss.hasPermi('contractor:constructionIssue:edit')")
|
|
||||||
@Log(title = "施工问题整改复核", businessType = BusinessType.UPDATE)
|
@Log(title = "施工问题整改复核", businessType = BusinessType.UPDATE)
|
||||||
@PostMapping("/review")
|
@PostMapping("/review")
|
||||||
public AjaxResult submitReview(@Validated @RequestBody RectificationReviewDTO dto) {
|
public AjaxResult submitReview(@Validated @RequestBody RectificationReviewDTO dto) {
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,60 @@
|
||||||
|
package com.admin.contractor.controller;
|
||||||
|
|
||||||
|
import com.admin.contractor.domain.dto.ThirdPartyDeductionDTO;
|
||||||
|
import com.admin.contractor.service.IThirdPartyService;
|
||||||
|
import com.ruoyi.common.core.web.controller.BaseController;
|
||||||
|
import com.ruoyi.common.core.web.domain.AjaxResult;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 第三方接口Controller
|
||||||
|
* 提供调用第三方电力系统接口的能力
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
*/
|
||||||
|
@Tag(name = "第三方接口调用")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/thirdParty")
|
||||||
|
public class ThirdPartyController extends BaseController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IThirdPartyService thirdPartyService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取第三方系统Token
|
||||||
|
*/
|
||||||
|
@Operation(summary = "获取第三方系统Token")
|
||||||
|
@PostMapping("/getToken")
|
||||||
|
public AjaxResult getToken(
|
||||||
|
@Parameter(description = "用户名") @RequestParam String username,
|
||||||
|
@Parameter(description = "密码") @RequestParam String password) {
|
||||||
|
String token = thirdPartyService.getThirdPartyToken(username, password);
|
||||||
|
if (token != null) {
|
||||||
|
return success(token);
|
||||||
|
}
|
||||||
|
return error("获取Token失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 调用第三方扣分上报接口
|
||||||
|
*/
|
||||||
|
@Operation(summary = "调用第三方扣分上报接口")
|
||||||
|
@PostMapping("/callDeduction")
|
||||||
|
public AjaxResult callDeduction(@Validated @RequestBody ThirdPartyDeductionDTO dto) {
|
||||||
|
return thirdPartyService.callThirdPartyDeduction(dto);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 调用第三方获取企业评分接口
|
||||||
|
*/
|
||||||
|
@Operation(summary = "调用第三方获取企业评分接口")
|
||||||
|
@PostMapping("/callGetCompanyScore")
|
||||||
|
public AjaxResult callGetCompanyScore(@Parameter(description = "企业ID") @RequestParam Long companyId) {
|
||||||
|
return thirdPartyService.callThirdPartyGetCompanyScore(companyId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -53,9 +53,9 @@ public class VideoStreamDetectionController extends BaseController {
|
||||||
@PreAuthorize("@ss.hasPermi('contractor:videoDetection:list')")
|
@PreAuthorize("@ss.hasPermi('contractor:videoDetection:list')")
|
||||||
@GetMapping("/allRecords")
|
@GetMapping("/allRecords")
|
||||||
public TableDataInfo allRecords(
|
public TableDataInfo allRecords(
|
||||||
@Parameter(description = "项目ID") @RequestParam(required = false) String projectId,
|
@Parameter(description = "项目 ID") @RequestParam(required = false) String projectId,
|
||||||
@Parameter(description = "帧时间戳") @RequestParam(required = false) Long frameTimestamp,
|
@Parameter(description = "帧时间戳") @RequestParam(required = false) Long frameTimestamp,
|
||||||
@Parameter(description = "报警类型(detect_type)") @RequestParam(required = false) Integer detectType) {
|
@Parameter(description = "报警类型 (detect_type)") @RequestParam(required = false) Integer detectType) {
|
||||||
startPage();
|
startPage();
|
||||||
VideoStreamDetection query = new VideoStreamDetection();
|
VideoStreamDetection query = new VideoStreamDetection();
|
||||||
query.setProjectId(projectId);
|
query.setProjectId(projectId);
|
||||||
|
|
@ -65,6 +65,30 @@ public class VideoStreamDetectionController extends BaseController {
|
||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询已复核的视频推送记录(review_status 为 1 或 2)
|
||||||
|
*/
|
||||||
|
@Operation(summary = "查询已复核视频推送记录")
|
||||||
|
@PreAuthorize("@ss.hasPermi('contractor:videoDetection:list')")
|
||||||
|
@GetMapping("/reviewedRecords")
|
||||||
|
public TableDataInfo reviewedRecords(
|
||||||
|
@Parameter(description = "项目 ID") @RequestParam(required = false) String projectId,
|
||||||
|
@Parameter(description = "复核状态 (1 合格 2 不合格,reviewed 表示已复核)") @RequestParam(required = false) String reviewStatus,
|
||||||
|
@Parameter(description = "报警类型 (detect_type)") @RequestParam(required = false) Integer detectType,
|
||||||
|
@Parameter(description = "帧时间戳") @RequestParam(required = false) Long frameTimestamp) {
|
||||||
|
startPage();
|
||||||
|
VideoStreamDetection query = new VideoStreamDetection();
|
||||||
|
query.setProjectId(projectId);
|
||||||
|
query.setReviewStatus(reviewStatus);
|
||||||
|
query.setDetectType(detectType);
|
||||||
|
query.setFrameTimestamp(frameTimestamp);
|
||||||
|
List<VideoStreamDetection> list = videoStreamDetectionService.listReviewedRecords(query);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取视频检测详情
|
||||||
|
*/
|
||||||
@Operation(summary = "获取视频检测详情")
|
@Operation(summary = "获取视频检测详情")
|
||||||
@PreAuthorize("@ss.hasPermi('contractor:videoDetection:query')")
|
@PreAuthorize("@ss.hasPermi('contractor:videoDetection:query')")
|
||||||
@GetMapping("/{id}")
|
@GetMapping("/{id}")
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,48 @@
|
||||||
|
package com.admin.contractor.domain.dto;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 第三方扣分上报DTO
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Schema(description = "第三方扣分上报")
|
||||||
|
public class ThirdPartyDeductionDTO {
|
||||||
|
|
||||||
|
@Schema(description = "扣分配置ID", example = "47")
|
||||||
|
private Long backConfigId;
|
||||||
|
|
||||||
|
@Schema(description = "风险等级(高、中、低)", example = "高")
|
||||||
|
private String description;
|
||||||
|
|
||||||
|
@Schema(description = "项目ID", example = "116")
|
||||||
|
private Long projectId;
|
||||||
|
|
||||||
|
@Schema(description = "异常原因描述", example = "异常原因描述")
|
||||||
|
private String reason;
|
||||||
|
|
||||||
|
@Schema(description = "状态(0=未处理, 1=处理中, 2=已处理)", example = "2")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@Schema(description = "第三方ID", example = "1111")
|
||||||
|
private Long thirdId;
|
||||||
|
|
||||||
|
@Schema(description = "预警时间,格式: yyyy-MM-dd HH:mm:ss", example = "2026-03-12 17:26:23")
|
||||||
|
private String wainTime;
|
||||||
|
|
||||||
|
@Schema(description = "处理时间,格式: yyyy-MM-dd HH:mm:ss", example = "2026-03-13 17:26:23")
|
||||||
|
private String handTime;
|
||||||
|
|
||||||
|
@Schema(description = "完成时间,格式: yyyy-MM-dd HH:mm:ss", example = "2026-03-14 17:26:23")
|
||||||
|
private String finishTime;
|
||||||
|
|
||||||
|
@Schema(description = "图片路径(URL)")
|
||||||
|
private String pictureUrl;
|
||||||
|
|
||||||
|
@Schema(description = "视频路径 (URL)")
|
||||||
|
private String videoUrl;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,22 @@
|
||||||
|
package com.admin.contractor.domain.vo;
|
||||||
|
|
||||||
|
import com.admin.contractor.domain.ConstructionIssueFeedback;
|
||||||
|
import com.admin.contractor.domain.ConstructionIssueRectification;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 整改记录详情VO(级联问题反馈)
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Schema(description = "整改记录详情(含问题反馈)")
|
||||||
|
public class RectificationDetailVO {
|
||||||
|
|
||||||
|
@Schema(description = "问题反馈信息")
|
||||||
|
private ConstructionIssueFeedback feedback;
|
||||||
|
|
||||||
|
@Schema(description = "整改记录信息")
|
||||||
|
private ConstructionIssueRectification rectification;
|
||||||
|
}
|
||||||
|
|
@ -40,7 +40,12 @@ public interface ConstructionIssueFeedbackMapper {
|
||||||
List<Long> selectIdsByProjectIds(@Param("projectIds") Long[] projectIds);
|
List<Long> selectIdsByProjectIds(@Param("projectIds") Long[] projectIds);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据项目ID列表批量删除反馈(级联删除工作计划时使用)
|
* 根据项目 ID 列表批量删除反馈(级联删除工作计划时使用)
|
||||||
*/
|
*/
|
||||||
int deleteByProjectIds(@Param("projectIds") Long[] projectIds);
|
int deleteByProjectIds(@Param("projectIds") Long[] projectIds);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 统计指定项目的待整改问题数量(status=0,3 待处理和审核不通过)
|
||||||
|
*/
|
||||||
|
int countPendingByProjectId(@Param("projectId") Long projectId);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
package com.admin.contractor.mapper;
|
package com.admin.contractor.mapper;
|
||||||
|
|
||||||
import com.admin.contractor.domain.ConstructionIssueRectification;
|
import com.admin.contractor.domain.ConstructionIssueRectification;
|
||||||
|
import com.admin.contractor.domain.vo.RectificationDetailVO;
|
||||||
import com.admin.contractor.domain.vo.RectificationPendingVO;
|
import com.admin.contractor.domain.vo.RectificationPendingVO;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
@ -18,25 +19,34 @@ public interface ConstructionIssueRectificationMapper {
|
||||||
ConstructionIssueRectification selectConstructionIssueRectificationById(Long id);
|
ConstructionIssueRectification selectConstructionIssueRectificationById(Long id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 按反馈ID查询整改列表(含草稿、已提交),按创建时间倒序
|
* 按反馈 ID 查询整改列表(含草稿、已提交),按创建时间倒序
|
||||||
*/
|
*/
|
||||||
List<ConstructionIssueRectification> selectByFeedbackId(@Param("feedbackId") Long feedbackId);
|
List<ConstructionIssueRectification> selectByFeedbackId(@Param("feedbackId") Long feedbackId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 按反馈ID查询最新草稿(status=0),用于暂存覆盖
|
* 按问题反馈 ID 获取问题数据级联整改表数据
|
||||||
|
*/
|
||||||
|
RectificationDetailVO selectDetailByFeedbackId(@Param("feedbackId") Long feedbackId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 按反馈 ID 查询最新草稿(status=0),用于暂存覆盖
|
||||||
*/
|
*/
|
||||||
ConstructionIssueRectification selectDraftByFeedbackId(@Param("feedbackId") Long feedbackId);
|
ConstructionIssueRectification selectDraftByFeedbackId(@Param("feedbackId") Long feedbackId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 待监理复核的整改列表:feedback.status=1 且 rectification.status=1 且 review_result is null,联查反馈摘要
|
* 待监理复核的整改列表:feedback.status=1 且 rectification.status=1 且 review_result is null,联查反馈摘要
|
||||||
*/
|
*/
|
||||||
List<RectificationPendingVO> selectPendingReviewList();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 施工单位查询整改记录:根据项目ID联查 cons_issue_fb.project_id
|
* 施工单位查询整改记录:根据项目ID联查 cons_issue_fb.project_id
|
||||||
*/
|
*/
|
||||||
List<ConstructionIssueRectification> selectByProjectId(@Param("projectId") Long projectId);
|
List<ConstructionIssueRectification> selectByProjectId(@Param("projectId") Long projectId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据项目 ID 查询整改详情列表(含问题反馈信息)
|
||||||
|
*/
|
||||||
|
List<RectificationDetailVO> selectDetailByProjectId(@Param("projectId") Long projectId);
|
||||||
|
|
||||||
int insertConstructionIssueRectification(ConstructionIssueRectification record);
|
int insertConstructionIssueRectification(ConstructionIssueRectification record);
|
||||||
|
|
||||||
int updateConstructionIssueRectification(ConstructionIssueRectification record);
|
int updateConstructionIssueRectification(ConstructionIssueRectification record);
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,11 @@ public interface VideoStreamDetectionMapper {
|
||||||
*/
|
*/
|
||||||
List<VideoStreamDetection> selectAllPushRecords(VideoStreamDetection query);
|
List<VideoStreamDetection> selectAllPushRecords(VideoStreamDetection query);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询已复核的视频推送记录(review_status 为 1 或 2)
|
||||||
|
*/
|
||||||
|
List<VideoStreamDetection> selectReviewedRecords(VideoStreamDetection query);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新复核结果
|
* 更新复核结果
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
package com.admin.contractor.service;
|
package com.admin.contractor.service;
|
||||||
|
|
||||||
import com.admin.contractor.domain.ConstructionIssueFeedback;
|
import com.admin.contractor.domain.ConstructionIssueFeedback;
|
||||||
import com.admin.contractor.domain.vo.ConstructionIssueFeedbackDetailVO;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
@ -17,11 +16,6 @@ public interface IConstructionIssueFeedbackService {
|
||||||
*/
|
*/
|
||||||
ConstructionIssueFeedback selectConstructionIssueFeedbackById(Long id);
|
ConstructionIssueFeedback selectConstructionIssueFeedbackById(Long id);
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据ID查询详情(级联整改记录)
|
|
||||||
*/
|
|
||||||
ConstructionIssueFeedbackDetailVO selectDetailWithRectifications(Long feedbackId);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 按条件查询列表(施工方/监理查询监理确认的问题)
|
* 按条件查询列表(施工方/监理查询监理确认的问题)
|
||||||
*/
|
*/
|
||||||
|
|
@ -36,4 +30,9 @@ public interface IConstructionIssueFeedbackService {
|
||||||
* 更新状态(施工方处理/关闭等)
|
* 更新状态(施工方处理/关闭等)
|
||||||
*/
|
*/
|
||||||
int updateConstructionIssueFeedback(ConstructionIssueFeedback feedback);
|
int updateConstructionIssueFeedback(ConstructionIssueFeedback feedback);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 统计指定项目的待整改问题数量(status=0 待处理)
|
||||||
|
*/
|
||||||
|
int countPendingByProjectId(Long projectId);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ package com.admin.contractor.service;
|
||||||
import com.admin.contractor.domain.ConstructionIssueRectification;
|
import com.admin.contractor.domain.ConstructionIssueRectification;
|
||||||
import com.admin.contractor.domain.dto.RectificationReviewDTO;
|
import com.admin.contractor.domain.dto.RectificationReviewDTO;
|
||||||
import com.admin.contractor.domain.dto.RectificationSubmitDTO;
|
import com.admin.contractor.domain.dto.RectificationSubmitDTO;
|
||||||
import com.admin.contractor.domain.vo.RectificationPendingVO;
|
import com.admin.contractor.domain.vo.RectificationDetailVO;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
@ -15,10 +15,6 @@ import java.util.List;
|
||||||
*/
|
*/
|
||||||
public interface IConstructionIssueRectificationService {
|
public interface IConstructionIssueRectificationService {
|
||||||
|
|
||||||
/**
|
|
||||||
* 施工单位暂存整改草稿
|
|
||||||
*/
|
|
||||||
int saveDraft(RectificationSubmitDTO dto);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 施工单位提交整改
|
* 施工单位提交整改
|
||||||
|
|
@ -26,19 +22,25 @@ public interface IConstructionIssueRectificationService {
|
||||||
int submitRectification(RectificationSubmitDTO dto);
|
int submitRectification(RectificationSubmitDTO dto);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 按反馈ID查询整改列表(含草稿、已提交)
|
* 按反馈 ID 查询整改列表(含草稿、已提交)
|
||||||
*/
|
*/
|
||||||
List<ConstructionIssueRectification> listByFeedbackId(Long feedbackId);
|
List<ConstructionIssueRectification> listByFeedbackId(Long feedbackId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 施工单位查询整改记录(按项目ID,联查 cons_issue_fb.project_id)
|
* 按问题反馈 ID 获取问题数据级联整改表数据
|
||||||
|
*/
|
||||||
|
RectificationDetailVO getDetailByFeedbackId(Long feedbackId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 施工单位查询整改记录(按项目 ID,联查 cons_issue_fb.project_id)
|
||||||
*/
|
*/
|
||||||
List<ConstructionIssueRectification> listByProjectId(Long projectId);
|
List<ConstructionIssueRectification> listByProjectId(Long projectId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 监理待复核整改列表(问题+整改摘要)
|
* 按项目ID查询整改记录(级联问题反馈)
|
||||||
*/
|
*/
|
||||||
List<RectificationPendingVO> listPendingReview();
|
List<RectificationDetailVO> listDetailByProjectId(Long projectId);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 监理提交复核结果(整改到位/整改未到位,未到位需重新整改)
|
* 监理提交复核结果(整改到位/整改未到位,未到位需重新整改)
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,37 @@
|
||||||
|
package com.admin.contractor.service;
|
||||||
|
|
||||||
|
import com.admin.contractor.domain.dto.ThirdPartyDeductionDTO;
|
||||||
|
import com.ruoyi.common.core.web.domain.AjaxResult;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 第三方接口Service接口
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
*/
|
||||||
|
public interface IThirdPartyService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取第三方系统Token
|
||||||
|
*
|
||||||
|
* @param username 用户名
|
||||||
|
* @param password 密码
|
||||||
|
* @return Token
|
||||||
|
*/
|
||||||
|
String getThirdPartyToken(String username, String password);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 调用第三方扣分上报接口
|
||||||
|
*
|
||||||
|
* @param dto 扣分上报数据
|
||||||
|
* @return 调用结果
|
||||||
|
*/
|
||||||
|
AjaxResult callThirdPartyDeduction(ThirdPartyDeductionDTO dto);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 调用第三方获取企业评分接口
|
||||||
|
*
|
||||||
|
* @param companyId 企业ID
|
||||||
|
* @return 企业评分信息
|
||||||
|
*/
|
||||||
|
AjaxResult callThirdPartyGetCompanyScore(Long companyId);
|
||||||
|
}
|
||||||
|
|
@ -32,7 +32,12 @@ public interface IVideoStreamDetectionService {
|
||||||
List<VideoStreamDetection> listAllPushRecords(VideoStreamDetection query);
|
List<VideoStreamDetection> listAllPushRecords(VideoStreamDetection query);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据ID获取视频检测详情
|
* 查询已复核的视频推送记录(review_status 为 1 或 2)
|
||||||
|
*/
|
||||||
|
List<VideoStreamDetection> listReviewedRecords(VideoStreamDetection query);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据 ID 获取视频检测详情
|
||||||
*/
|
*/
|
||||||
VideoStreamDetection selectVideoStreamDetectionById(Long id);
|
VideoStreamDetection selectVideoStreamDetectionById(Long id);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,6 @@
|
||||||
package com.admin.contractor.service.impl;
|
package com.admin.contractor.service.impl;
|
||||||
|
|
||||||
import com.admin.contractor.domain.ConstructionIssueFeedback;
|
import com.admin.contractor.domain.ConstructionIssueFeedback;
|
||||||
import com.admin.contractor.domain.ConstructionIssueRectification;
|
|
||||||
import com.admin.contractor.domain.vo.ConstructionIssueFeedbackDetailVO;
|
|
||||||
import com.admin.contractor.mapper.ConstructionIssueFeedbackMapper;
|
import com.admin.contractor.mapper.ConstructionIssueFeedbackMapper;
|
||||||
import com.admin.contractor.mapper.ConstructionIssueRectificationMapper;
|
import com.admin.contractor.mapper.ConstructionIssueRectificationMapper;
|
||||||
import com.admin.contractor.service.IConstructionIssueFeedbackService;
|
import com.admin.contractor.service.IConstructionIssueFeedbackService;
|
||||||
|
|
@ -34,18 +32,6 @@ public class ConstructionIssueFeedbackServiceImpl implements IConstructionIssueF
|
||||||
return constructionIssueFeedbackMapper.selectConstructionIssueFeedbackById(id);
|
return constructionIssueFeedbackMapper.selectConstructionIssueFeedbackById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public ConstructionIssueFeedbackDetailVO selectDetailWithRectifications(Long feedbackId) {
|
|
||||||
ConstructionIssueFeedback feedback = constructionIssueFeedbackMapper.selectConstructionIssueFeedbackById(feedbackId);
|
|
||||||
if (feedback == null) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
ConstructionIssueFeedbackDetailVO vo = new ConstructionIssueFeedbackDetailVO();
|
|
||||||
vo.setFeedback(feedback);
|
|
||||||
List<ConstructionIssueRectification> rectifications = constructionIssueRectificationMapper.selectByFeedbackId(feedbackId);
|
|
||||||
vo.setRectifications(rectifications);
|
|
||||||
return vo;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<ConstructionIssueFeedback> selectConstructionIssueFeedbackList(ConstructionIssueFeedback query) {
|
public List<ConstructionIssueFeedback> selectConstructionIssueFeedbackList(ConstructionIssueFeedback query) {
|
||||||
|
|
@ -73,4 +59,9 @@ public class ConstructionIssueFeedbackServiceImpl implements IConstructionIssueF
|
||||||
feedback.setUpdateBy(SecurityUtils.getUsername());
|
feedback.setUpdateBy(SecurityUtils.getUsername());
|
||||||
return constructionIssueFeedbackMapper.updateConstructionIssueFeedback(feedback);
|
return constructionIssueFeedbackMapper.updateConstructionIssueFeedback(feedback);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int countPendingByProjectId(Long projectId) {
|
||||||
|
return constructionIssueFeedbackMapper.countPendingByProjectId(projectId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ import com.admin.contractor.domain.ConstructionIssueFeedback;
|
||||||
import com.admin.contractor.domain.ConstructionIssueRectification;
|
import com.admin.contractor.domain.ConstructionIssueRectification;
|
||||||
import com.admin.contractor.domain.dto.RectificationReviewDTO;
|
import com.admin.contractor.domain.dto.RectificationReviewDTO;
|
||||||
import com.admin.contractor.domain.dto.RectificationSubmitDTO;
|
import com.admin.contractor.domain.dto.RectificationSubmitDTO;
|
||||||
|
import com.admin.contractor.domain.vo.RectificationDetailVO;
|
||||||
import com.admin.contractor.domain.vo.RectificationPendingVO;
|
import com.admin.contractor.domain.vo.RectificationPendingVO;
|
||||||
import com.admin.contractor.mapper.ConstructionIssueFeedbackMapper;
|
import com.admin.contractor.mapper.ConstructionIssueFeedbackMapper;
|
||||||
import com.admin.contractor.mapper.ConstructionIssueRectificationMapper;
|
import com.admin.contractor.mapper.ConstructionIssueRectificationMapper;
|
||||||
|
|
@ -14,7 +15,6 @@ import com.ruoyi.common.security.utils.SecurityUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -31,37 +31,6 @@ public class ConstructionIssueRectificationServiceImpl implements IConstructionI
|
||||||
@Autowired
|
@Autowired
|
||||||
private ConstructionIssueFeedbackMapper feedbackMapper;
|
private ConstructionIssueFeedbackMapper feedbackMapper;
|
||||||
|
|
||||||
@Override
|
|
||||||
@Transactional(rollbackFor = Exception.class)
|
|
||||||
public int saveDraft(RectificationSubmitDTO dto) {
|
|
||||||
if (dto.getFeedbackId() == null) {
|
|
||||||
throw new ServiceException("问题反馈ID不能为空");
|
|
||||||
}
|
|
||||||
ConstructionIssueFeedback feedback = feedbackMapper.selectConstructionIssueFeedbackById(dto.getFeedbackId());
|
|
||||||
if (feedback == null) {
|
|
||||||
throw new ServiceException("问题反馈不存在");
|
|
||||||
}
|
|
||||||
if (!"0".equals(feedback.getStatus()) && !"3".equals(feedback.getStatus())) {
|
|
||||||
throw new ServiceException("仅待处理或复核不通过的问题可暂存整改");
|
|
||||||
}
|
|
||||||
String username = SecurityUtils.getUsername();
|
|
||||||
ConstructionIssueRectification draft = rectificationMapper.selectDraftByFeedbackId(dto.getFeedbackId());
|
|
||||||
if (draft != null) {
|
|
||||||
draft.setRectificationDesc(dto.getRectificationDesc());
|
|
||||||
draft.setRectificationPhotoUrls(dto.getRectificationPhotoUrls());
|
|
||||||
draft.setRectificationTime(dto.getRectificationTime());
|
|
||||||
draft.setUpdateBy(username);
|
|
||||||
return rectificationMapper.updateConstructionIssueRectification(draft);
|
|
||||||
}
|
|
||||||
ConstructionIssueRectification record = new ConstructionIssueRectification();
|
|
||||||
record.setFeedbackId(dto.getFeedbackId());
|
|
||||||
record.setRectificationDesc(dto.getRectificationDesc());
|
|
||||||
record.setRectificationPhotoUrls(dto.getRectificationPhotoUrls());
|
|
||||||
record.setRectificationTime(dto.getRectificationTime());
|
|
||||||
record.setStatus("0"); // 草稿
|
|
||||||
record.setCreateBy(username);
|
|
||||||
return rectificationMapper.insertConstructionIssueRectification(record);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
|
@ -118,16 +87,22 @@ public class ConstructionIssueRectificationServiceImpl implements IConstructionI
|
||||||
return rectificationMapper.selectByFeedbackId(feedbackId);
|
return rectificationMapper.selectByFeedbackId(feedbackId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public RectificationDetailVO getDetailByFeedbackId(Long feedbackId) {
|
||||||
|
return rectificationMapper.selectDetailByFeedbackId(feedbackId);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<ConstructionIssueRectification> listByProjectId(Long projectId) {
|
public List<ConstructionIssueRectification> listByProjectId(Long projectId) {
|
||||||
return rectificationMapper.selectByProjectId(projectId);
|
return rectificationMapper.selectByProjectId(projectId);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<RectificationPendingVO> listPendingReview() {
|
public List<RectificationDetailVO> listDetailByProjectId(Long projectId) {
|
||||||
return rectificationMapper.selectPendingReviewList();
|
return rectificationMapper.selectDetailByProjectId(projectId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public int submitReview(RectificationReviewDTO dto) {
|
public int submitReview(RectificationReviewDTO dto) {
|
||||||
|
|
@ -144,10 +119,7 @@ public class ConstructionIssueRectificationServiceImpl implements IConstructionI
|
||||||
if (rect == null) {
|
if (rect == null) {
|
||||||
throw new ServiceException("整改记录不存在");
|
throw new ServiceException("整改记录不存在");
|
||||||
}
|
}
|
||||||
if (!"1".equals(rect.getStatus())) {
|
if (!"0".equals(rect.getReviewResult())) {
|
||||||
throw new ServiceException("仅已提交的整改可复核");
|
|
||||||
}
|
|
||||||
if (StringUtils.isNotEmpty(rect.getReviewResult())) {
|
|
||||||
throw new ServiceException("该整改已复核");
|
throw new ServiceException("该整改已复核");
|
||||||
}
|
}
|
||||||
String username = SecurityUtils.getUsername();
|
String username = SecurityUtils.getUsername();
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,112 @@
|
||||||
|
package com.admin.contractor.service.impl;
|
||||||
|
|
||||||
|
import com.admin.contractor.domain.dto.ThirdPartyDeductionDTO;
|
||||||
|
import com.admin.contractor.service.IThirdPartyService;
|
||||||
|
import com.admin.contractor.utils.ThirdPartyHttpClient;
|
||||||
|
import com.fasterxml.jackson.databind.JsonNode;
|
||||||
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
|
import com.ruoyi.common.core.web.domain.AjaxResult;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 第三方接口Service实现
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Service
|
||||||
|
public class ThirdPartyServiceImpl implements IThirdPartyService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ThirdPartyHttpClient thirdPartyHttpClient;
|
||||||
|
|
||||||
|
private static final ObjectMapper objectMapper = new ObjectMapper();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取第三方系统Token
|
||||||
|
*
|
||||||
|
* @param username 用户名
|
||||||
|
* @param password 密码
|
||||||
|
* @return Token
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public String getThirdPartyToken(String username, String password) {
|
||||||
|
log.info("获取第三方Token: username={}", username);
|
||||||
|
return thirdPartyHttpClient.getToken(username, password);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 调用第三方扣分上报接口
|
||||||
|
*
|
||||||
|
* @param dto 扣分上报数据
|
||||||
|
* @return 调用结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public AjaxResult callThirdPartyDeduction(ThirdPartyDeductionDTO dto) {
|
||||||
|
try {
|
||||||
|
log.info("调用第三方扣分上报接口:thirdId={}, projectId={}", dto.getThirdId(), dto.getProjectId());
|
||||||
|
|
||||||
|
// 获取 Token
|
||||||
|
String token = getThirdPartyToken("admin", "admin123456");
|
||||||
|
if (token == null) {
|
||||||
|
return AjaxResult.error("获取第三方 Token 失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 转换 DTO 为 JSON 字符串
|
||||||
|
String requestBody = objectMapper.writeValueAsString(dto);
|
||||||
|
|
||||||
|
// 调用第三方接口
|
||||||
|
String response = thirdPartyHttpClient.submitDeduction(token, requestBody);
|
||||||
|
if (response == null) {
|
||||||
|
return AjaxResult.error("调用第三方扣分上报接口失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 检查业务返回码
|
||||||
|
JsonNode jsonNode = objectMapper.readTree(response);
|
||||||
|
if (jsonNode.has("code") && jsonNode.get("code").asInt() != 200) {
|
||||||
|
String message = jsonNode.has("message") ? jsonNode.get("message").asText() : "业务处理失败";
|
||||||
|
log.warn("第三方扣分上报业务失败:{}", message);
|
||||||
|
return AjaxResult.error("扣分上报失败:" + message);
|
||||||
|
}
|
||||||
|
|
||||||
|
log.info("第三方扣分上报成功");
|
||||||
|
return AjaxResult.success("扣分上报成功", response);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("调用第三方扣分上报接口异常", e);
|
||||||
|
return AjaxResult.error("调用第三方扣分上报接口异常:" + e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 调用第三方获取企业评分接口
|
||||||
|
*
|
||||||
|
* @param companyId 企业ID
|
||||||
|
* @return 企业评分信息
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public AjaxResult callThirdPartyGetCompanyScore(Long companyId) {
|
||||||
|
try {
|
||||||
|
log.info("调用第三方获取企业评分接口: companyId={}", companyId);
|
||||||
|
|
||||||
|
// 获取Token
|
||||||
|
String token = getThirdPartyToken("admin", "admin123456");
|
||||||
|
if (token == null) {
|
||||||
|
return AjaxResult.error("获取第三方Token失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 调用第三方接口
|
||||||
|
String response = thirdPartyHttpClient.getCompanyScore(token, companyId);
|
||||||
|
if (response == null) {
|
||||||
|
return AjaxResult.error("调用第三方获取企业评分接口失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
log.info("获取企业评分成功: {}", response);
|
||||||
|
return AjaxResult.success("获取企业评分成功", response);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("调用第三方获取企业评分接口异常", e);
|
||||||
|
return AjaxResult.error("调用第三方获取企业评分接口异常: " + e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -90,6 +90,11 @@ public class VideoStreamDetectionServiceImpl implements IVideoStreamDetectionSer
|
||||||
return videoStreamDetectionMapper.selectAllPushRecords(query);
|
return videoStreamDetectionMapper.selectAllPushRecords(query);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<VideoStreamDetection> listReviewedRecords(VideoStreamDetection query) {
|
||||||
|
return videoStreamDetectionMapper.selectReviewedRecords(query);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public VideoStreamDetection selectVideoStreamDetectionById(Long id) {
|
public VideoStreamDetection selectVideoStreamDetectionById(Long id) {
|
||||||
return videoStreamDetectionMapper.selectVideoStreamDetectionById(id);
|
return videoStreamDetectionMapper.selectVideoStreamDetectionById(id);
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,170 @@
|
||||||
|
package com.admin.contractor.utils;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.databind.JsonNode;
|
||||||
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import java.net.URI;
|
||||||
|
import java.net.http.HttpClient;
|
||||||
|
import java.net.http.HttpRequest;
|
||||||
|
import java.net.http.HttpResponse;
|
||||||
|
import java.time.Duration;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 第三方接口客户端工具类
|
||||||
|
* 用于调用第三方电力系统接口
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Component
|
||||||
|
public class ThirdPartyHttpClient {
|
||||||
|
|
||||||
|
private static final String BASE_URL = "http://1.13.245.108/trainCore";
|
||||||
|
private static final HttpClient httpClient = HttpClient.newBuilder()
|
||||||
|
.connectTimeout(Duration.ofSeconds(10))
|
||||||
|
.build();
|
||||||
|
private static final ObjectMapper objectMapper = new ObjectMapper();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取第三方系统的Token
|
||||||
|
*
|
||||||
|
* @param username 用户名
|
||||||
|
* @param password 密码
|
||||||
|
* @return Token字符串
|
||||||
|
*/
|
||||||
|
public String getToken(String username, String password) {
|
||||||
|
try {
|
||||||
|
String loginUrl = BASE_URL + "/login/getToken";
|
||||||
|
String requestBody = String.format("{\"username\":\"%s\",\"password\":\"%s\"}", username, password);
|
||||||
|
|
||||||
|
HttpRequest request = HttpRequest.newBuilder()
|
||||||
|
.uri(URI.create(loginUrl))
|
||||||
|
.header("Content-Type", "application/json")
|
||||||
|
.POST(HttpRequest.BodyPublishers.ofString(requestBody))
|
||||||
|
.timeout(Duration.ofSeconds(10))
|
||||||
|
.build();
|
||||||
|
|
||||||
|
HttpResponse<String> response = httpClient.send(request, HttpResponse.BodyHandlers.ofString());
|
||||||
|
|
||||||
|
if (response.statusCode() == 200) {
|
||||||
|
log.info("获取第三方Token成功");
|
||||||
|
// 根据实际响应格式解析Token
|
||||||
|
return parseToken(response.body());
|
||||||
|
} else {
|
||||||
|
log.error("获取第三方Token失败,状态码: {}", response.statusCode());
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("获取第三方Token异常", e);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 调用第三方扣分上报接口
|
||||||
|
*
|
||||||
|
* @param token 认证 Token
|
||||||
|
* @param requestBody 请求体 JSON 字符串
|
||||||
|
* @return 响应结果
|
||||||
|
*/
|
||||||
|
public String submitDeduction(String token, String requestBody) {
|
||||||
|
try {
|
||||||
|
String deductionUrl = BASE_URL + "/thirdParty/deduction";
|
||||||
|
|
||||||
|
HttpRequest request = HttpRequest.newBuilder()
|
||||||
|
.uri(URI.create(deductionUrl))
|
||||||
|
.header("Content-Type", "application/json")
|
||||||
|
.header("Authorization", token) // 添加 Bearer 前缀
|
||||||
|
.POST(HttpRequest.BodyPublishers.ofString(requestBody))
|
||||||
|
.timeout(Duration.ofSeconds(10))
|
||||||
|
.build();
|
||||||
|
|
||||||
|
HttpResponse<String> response = httpClient.send(request, HttpResponse.BodyHandlers.ofString());
|
||||||
|
|
||||||
|
if (response.statusCode() == 200) {
|
||||||
|
// 检查业务返回码
|
||||||
|
JsonNode jsonNode = objectMapper.readTree(response.body());
|
||||||
|
if (jsonNode.has("code") && jsonNode.get("code").asInt() != 200) {
|
||||||
|
log.error("第三方扣分上报业务失败,业务码:{}, 消息:{}",
|
||||||
|
jsonNode.get("code").asInt(),
|
||||||
|
jsonNode.has("message") ? jsonNode.get("message").asText() : "未知错误");
|
||||||
|
return response.body(); // 返回原始响应,让上层处理
|
||||||
|
}
|
||||||
|
log.info("第三方扣分上报成功");
|
||||||
|
return response.body();
|
||||||
|
} else {
|
||||||
|
log.error("第三方扣分上报失败,HTTP 状态码:{}", response.statusCode());
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("第三方扣分上报异常", e);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 调用第三方获取企业评分接口
|
||||||
|
*
|
||||||
|
* @param token 认证Token
|
||||||
|
* @param companyId 企业ID
|
||||||
|
* @return 响应结果
|
||||||
|
*/
|
||||||
|
public String getCompanyScore(String token, Long companyId) {
|
||||||
|
try {
|
||||||
|
String scoreUrl = BASE_URL + "/thirdParty/getCompanyScore?companyId=" + companyId;
|
||||||
|
|
||||||
|
HttpRequest request = HttpRequest.newBuilder()
|
||||||
|
.uri(URI.create(scoreUrl))
|
||||||
|
.header("Content-Type", "application/json")
|
||||||
|
.header("Authorization", token) // 添加 Bearer 前缀
|
||||||
|
.POST(HttpRequest.BodyPublishers.ofString(""))
|
||||||
|
.timeout(Duration.ofSeconds(10))
|
||||||
|
.build();
|
||||||
|
|
||||||
|
HttpResponse<String> response = httpClient.send(request, HttpResponse.BodyHandlers.ofString());
|
||||||
|
|
||||||
|
if (response.statusCode() == 200) {
|
||||||
|
log.info("获取企业评分成功,companyId: {}", companyId);
|
||||||
|
return response.body();
|
||||||
|
} else {
|
||||||
|
log.error("获取企业评分失败,状态码: {}", response.statusCode());
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("获取企业评分异常", e);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 从响应体中解析Token
|
||||||
|
* 根据实际的第三方响应格式调整
|
||||||
|
*
|
||||||
|
* @param responseBody 响应体
|
||||||
|
* @return Token
|
||||||
|
*/
|
||||||
|
private String parseToken(String responseBody) {
|
||||||
|
try {
|
||||||
|
// 响应格式:{"code":200,"message":"操作成功","data":{"token":"eyJhbGci..."}}
|
||||||
|
var jsonNode = objectMapper.readTree(responseBody);
|
||||||
|
if (jsonNode.has("data") && !jsonNode.get("data").isNull()) {
|
||||||
|
JsonNode dataNode = jsonNode.get("data");
|
||||||
|
// 如果 data 是对象且包含 token 字段
|
||||||
|
if (dataNode.has("token")) {
|
||||||
|
return dataNode.get("token").asText();
|
||||||
|
}
|
||||||
|
// 如果 data 直接就是 token 字符串
|
||||||
|
if (dataNode.isValueNode()) {
|
||||||
|
return dataNode.asText();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
log.error("无法从响应中解析出 Token: {}", responseBody);
|
||||||
|
return null;
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("解析Token异常", e);
|
||||||
|
return responseBody;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -26,7 +26,7 @@
|
||||||
|
|
||||||
<select id="selectConstructionIssueFeedbackById" resultMap="ConstructionIssueFeedbackResult">
|
<select id="selectConstructionIssueFeedbackById" resultMap="ConstructionIssueFeedbackResult">
|
||||||
select * from cons_issue_fb
|
select * from cons_issue_fb
|
||||||
where id = #{id} and del_flag = '0'
|
where id = #{id}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectConstructionIssueFeedbackList" parameterType="com.admin.contractor.domain.ConstructionIssueFeedback" resultMap="ConstructionIssueFeedbackResult">
|
<select id="selectConstructionIssueFeedbackList" parameterType="com.admin.contractor.domain.ConstructionIssueFeedback" resultMap="ConstructionIssueFeedbackResult">
|
||||||
|
|
@ -83,4 +83,9 @@
|
||||||
</foreach>
|
</foreach>
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
|
<select id="countPendingByProjectId" resultType="int">
|
||||||
|
select count(1) from cons_issue_fb
|
||||||
|
where project_id = #{projectId} and status in (0,3)
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,44 @@
|
||||||
<result property="createTime" column="r_create_time" />
|
<result property="createTime" column="r_create_time" />
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
|
<resultMap id="RectificationDetailVOResult" type="com.admin.contractor.domain.vo.RectificationDetailVO">
|
||||||
|
<association property="rectification" javaType="com.admin.contractor.domain.ConstructionIssueRectification">
|
||||||
|
<id property="id" column="id" />
|
||||||
|
<result property="feedbackId" column="feedback_id" />
|
||||||
|
<result property="rectificationDesc" column="rectification_desc" />
|
||||||
|
<result property="rectificationPhotoUrls" column="rectification_photo_urls" />
|
||||||
|
<result property="rectificationTime" column="rectification_time" />
|
||||||
|
<result property="status" column="status" />
|
||||||
|
<result property="reviewResult" column="review_result" />
|
||||||
|
<result property="reviewComment" column="review_comment" />
|
||||||
|
<result property="reviewPhotoUrls" column="review_photo_urls" />
|
||||||
|
<result property="reviewBy" column="review_by" />
|
||||||
|
<result property="reviewTime" column="review_time" />
|
||||||
|
<result property="createBy" column="create_by" />
|
||||||
|
<result property="createTime" column="create_time" />
|
||||||
|
<result property="updateBy" column="update_by" />
|
||||||
|
<result property="updateTime" column="update_time" />
|
||||||
|
</association>
|
||||||
|
<association property="feedback" javaType="com.admin.contractor.domain.ConstructionIssueFeedback">
|
||||||
|
<id property="id" column="fb_id" />
|
||||||
|
<result property="projectId" column="project_id" />
|
||||||
|
<result property="sourceType" column="source_type" />
|
||||||
|
<result property="videoDetectionId" column="video_detection_id" />
|
||||||
|
<result property="detectionName" column="detection_name" />
|
||||||
|
<result property="description" column="description" />
|
||||||
|
<result property="problemPhotoUrl" column="problem_photo_url" />
|
||||||
|
<result property="attachmentUrls" column="attachment_urls" />
|
||||||
|
<result property="status" column="fb_status" />
|
||||||
|
<result property="submitBy" column="submit_by" />
|
||||||
|
<result property="submitTime" column="submit_time" />
|
||||||
|
<result property="delFlag" column="del_flag" />
|
||||||
|
<result property="createBy" column="fb_create_by" />
|
||||||
|
<result property="createTime" column="fb_create_time" />
|
||||||
|
<result property="updateBy" column="fb_update_by" />
|
||||||
|
<result property="updateTime" column="fb_update_time" />
|
||||||
|
</association>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
<select id="selectConstructionIssueRectificationById" resultMap="ConstructionIssueRectificationResult">
|
<select id="selectConstructionIssueRectificationById" resultMap="ConstructionIssueRectificationResult">
|
||||||
select * from cons_issue_rf where id = #{id}
|
select * from cons_issue_rf where id = #{id}
|
||||||
</select>
|
</select>
|
||||||
|
|
@ -45,26 +83,38 @@
|
||||||
order by create_time desc
|
order by create_time desc
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="selectDetailByFeedbackId" resultMap="RectificationDetailVOResult">
|
||||||
|
select r.*, f.id as fb_id, f.project_id, f.source_type, f.video_detection_id, f.detection_name,
|
||||||
|
f.description, f.problem_photo_url, f.attachment_urls, f.status as fb_status,
|
||||||
|
f.submit_by, f.submit_time, f.del_flag, f.create_by as fb_create_by,
|
||||||
|
f.create_time as fb_create_time, f.update_by as fb_update_by, f.update_time as fb_update_time
|
||||||
|
from cons_issue_rf r
|
||||||
|
inner join cons_issue_fb f on r.feedback_id = f.id
|
||||||
|
where f.id = #{feedbackId} and r.review_result = 0
|
||||||
|
order by r.create_time desc
|
||||||
|
</select>
|
||||||
|
|
||||||
<select id="selectDraftByFeedbackId" resultMap="ConstructionIssueRectificationResult">
|
<select id="selectDraftByFeedbackId" resultMap="ConstructionIssueRectificationResult">
|
||||||
select * from cons_issue_rf
|
select * from cons_issue_rf
|
||||||
where feedback_id = #{feedbackId} and status = '0'
|
where feedback_id = #{feedbackId} and status = '0'
|
||||||
order by create_time desc limit 1
|
order by create_time desc limit 1
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectPendingReviewList" resultMap="RectificationPendingVOResult">
|
|
||||||
select r.id as rectification_id, r.feedback_id, r.rectification_desc, r.rectification_photo_urls,
|
|
||||||
r.rectification_time, r.create_time as r_create_time,
|
|
||||||
f.detection_name, f.description, f.problem_photo_url, f.submit_time
|
|
||||||
from cons_issue_rf r
|
|
||||||
inner join cons_issue_fb f on r.feedback_id = f.id and f.del_flag = '0' and f.status = '1'
|
|
||||||
where r.status = '1' and (r.review_result is null or r.review_result = '')
|
|
||||||
order by r.create_time desc
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<select id="selectByProjectId" parameterType="long" resultMap="ConstructionIssueRectificationResult">
|
<select id="selectByProjectId" parameterType="long" resultMap="ConstructionIssueRectificationResult">
|
||||||
select r.*
|
select r.*
|
||||||
from cons_issue_rf r
|
from cons_issue_rf r
|
||||||
inner join cons_issue_fb f on r.feedback_id = f.id and f.del_flag = '0'
|
inner join cons_issue_fb f on r.feedback_id = f.id
|
||||||
|
where f.project_id = #{projectId}
|
||||||
|
order by r.create_time desc
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectDetailByProjectId" parameterType="long" resultMap="RectificationDetailVOResult">
|
||||||
|
select r.*, f.id as fb_id, f.project_id, f.source_type, f.video_detection_id, f.detection_name,
|
||||||
|
f.description, f.problem_photo_url, f.attachment_urls, f.status as fb_status,
|
||||||
|
f.submit_by, f.submit_time, f.del_flag, f.create_by as fb_create_by,
|
||||||
|
f.create_time as fb_create_time, f.update_by as fb_update_by, f.update_time as fb_update_time
|
||||||
|
from cons_issue_rf r
|
||||||
|
inner join cons_issue_fb f on r.feedback_id = f.id
|
||||||
where f.project_id = #{projectId}
|
where f.project_id = #{projectId}
|
||||||
order by r.create_time desc
|
order by r.create_time desc
|
||||||
</select>
|
</select>
|
||||||
|
|
|
||||||
|
|
@ -71,6 +71,35 @@
|
||||||
order by v.create_time desc
|
order by v.create_time desc
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="selectReviewedRecords" parameterType="com.admin.contractor.domain.VideoStreamDetection" resultMap="VideoStreamDetectionResult">
|
||||||
|
select
|
||||||
|
v.id, v.stream_id, v.project_id, v.frame_timestamp, v.name, v.label, v.need_alert,
|
||||||
|
v.box_json, v.confidence, v.tag, v.detect_type, v.img_url, v.video_url, v.is_first,
|
||||||
|
v.review_status, v.review_by, v.review_time, v.create_time
|
||||||
|
from cons_video_detection v
|
||||||
|
where 1 = 1
|
||||||
|
<if test="projectId != null and projectId != ''">
|
||||||
|
and v.project_id = #{projectId}
|
||||||
|
</if>
|
||||||
|
<if test="reviewStatus != null and reviewStatus != ''">
|
||||||
|
<choose>
|
||||||
|
<when test="reviewStatus == 'reviewed'">
|
||||||
|
and v.review_status in ('1', '2')
|
||||||
|
</when>
|
||||||
|
<otherwise>
|
||||||
|
and v.review_status = #{reviewStatus}
|
||||||
|
</otherwise>
|
||||||
|
</choose>
|
||||||
|
</if>
|
||||||
|
<if test="detectType != null">
|
||||||
|
and v.detect_type = #{detectType}
|
||||||
|
</if>
|
||||||
|
<if test="frameTimestamp != null">
|
||||||
|
and v.frame_timestamp >= #{frameTimestamp}
|
||||||
|
</if>
|
||||||
|
order by v.create_time desc
|
||||||
|
</select>
|
||||||
|
|
||||||
<update id="updateReview">
|
<update id="updateReview">
|
||||||
update cons_video_detection
|
update cons_video_detection
|
||||||
set review_status = #{reviewStatus}, review_by = #{reviewBy}, review_time = now()
|
set review_status = #{reviewStatus}, review_by = #{reviewBy}, review_time = now()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue