| | |
| | | */ |
| | | package org.sxkj.gd.workorder.controller; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | |
| | | import lombok.AllArgsConstructor; |
| | | import javax.validation.Valid; |
| | | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springblade.core.secure.BladeUser; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.sxkj.gd.workorder.entity.GdClueEventEntity; |
| | | import org.sxkj.gd.workorder.param.GdClueDisposeRecordAddParam; |
| | | import org.sxkj.gd.workorder.param.GdClueEventRejectParam; |
| | | import org.sxkj.gd.workorder.vo.GdClueEventCountVO; |
| | | import org.sxkj.gd.workorder.vo.GdClueEventListVO; |
| | | import org.sxkj.gd.workorder.vo.GdClueEventVO; |
| | | import org.sxkj.gd.workorder.param.GdClueEventStatusUpdateParam; |
| | | import org.sxkj.gd.workorder.vo.*; |
| | | import org.sxkj.gd.workorder.excel.GdClueEventExcel; |
| | | import org.sxkj.gd.workorder.service.IGdClueDisposeRecordService; |
| | | import org.sxkj.gd.workorder.service.IGdClueEventService; |
| | | import org.sxkj.gd.workorder.service.IGdClueEventStatusFlowService; |
| | | import org.springblade.core.boot.ctrl.BladeController; |
| | | import org.springblade.core.tool.utils.DateUtil; |
| | | import org.springblade.core.excel.util.ExcelUtil; |
| | |
| | | * @author lw |
| | | * @since 2026-01-14 |
| | | */ |
| | | @Slf4j |
| | | @RestController |
| | | @AllArgsConstructor |
| | | @RequestMapping("workOrder/gdClueEvent") |
| | |
| | | public class GdClueEventController extends BladeController { |
| | | |
| | | private final IGdClueEventService gdClueEventService; |
| | | private final IGdClueDisposeRecordService gdClueDisposeRecordService; |
| | | private final IGdClueEventStatusFlowService gdClueEventStatusFlowService; |
| | | |
| | | /** |
| | | * 事件表(线索事件) 详情 |
| | |
| | | @ApiOperationSupport(order = 6) |
| | | @ApiOperation(value = "新增或修改", notes = "传入gdClueEvent") |
| | | public R submitExternal(@Valid @RequestBody GdClueEventEntity gdClueEvent) { |
| | | log.info("submitExternal-gdClueEvent:{}", JSON.toJSONString(gdClueEvent)); |
| | | return R.status(gdClueEventService.saveOrUpdateExternal(gdClueEvent)); |
| | | } |
| | | |
| | |
| | | return R.status(gdClueEventService.handleClueEvent(rejectParam)); |
| | | } |
| | | |
| | | /** |
| | | * 事件详情(包含处置记录和状态流转) |
| | | */ |
| | | @GetMapping("/detailFull") |
| | | @ApiOperationSupport(order = 9) |
| | | @ApiOperation(value = "事件详情(包含处置记录和状态流转)", notes = "传入事件ID") |
| | | public R<GdClueEventDetailVO> detailFull(@ApiParam(value = "事件ID", required = true) @RequestParam Long id) { |
| | | // 1. 查询事件基本信息 |
| | | GdClueEventVO eventInfo = gdClueEventService.getGdClueEventDetail(id); |
| | | |
| | | // 2. 查询处置记录时间线 |
| | | List<GdClueDisposeRecordVO> disposeRecords = gdClueDisposeRecordService.getDisposeRecordsByEventId(id); |
| | | |
| | | // 3. 查询状态流转时间线 |
| | | List<GdClueEventStatusFlowVO> statusFlows = gdClueEventStatusFlowService.getStatusFlowsByEventId(id); |
| | | |
| | | // 4. 组装返回数据 |
| | | GdClueEventDetailVO detailVO = new GdClueEventDetailVO(); |
| | | detailVO.setEventInfo(eventInfo); |
| | | detailVO.setDisposeRecords(disposeRecords); |
| | | detailVO.setStatusFlows(statusFlows); |
| | | |
| | | return R.data(detailVO); |
| | | } |
| | | |
| | | /** |
| | | * 查询处置记录列表 |
| | | */ |
| | | @GetMapping("/disposeRecords") |
| | | @ApiOperationSupport(order = 10) |
| | | @ApiOperation(value = "查询处置记录列表", notes = "传入事件ID") |
| | | public R<List<GdClueDisposeRecordVO>> getDisposeRecords(@ApiParam(value = "事件ID", required = true) @RequestParam Long eventId) { |
| | | return R.data(gdClueDisposeRecordService.getDisposeRecordsByEventId(eventId)); |
| | | } |
| | | |
| | | /** |
| | | * 新增处置记录 |
| | | */ |
| | | @PostMapping("/addDisposeRecord") |
| | | @ApiOperationSupport(order = 11) |
| | | @ApiOperation(value = "新增处置记录", notes = "传入处置记录参数,可同步更新事件状态") |
| | | public R addDisposeRecord(@Valid @RequestBody GdClueDisposeRecordAddParam addParam) { |
| | | return R.status(gdClueDisposeRecordService.addDisposeRecord(addParam)); |
| | | } |
| | | |
| | | /** |
| | | * 查询状态流转记录列表 |
| | | */ |
| | | @GetMapping("/statusFlows") |
| | | @ApiOperationSupport(order = 12) |
| | | @ApiOperation(value = "查询状态流转记录列表", notes = "传入事件ID") |
| | | public R<List<GdClueEventStatusFlowVO>> getStatusFlows(@ApiParam(value = "事件ID", required = true) @RequestParam Long eventId) { |
| | | return R.data(gdClueEventStatusFlowService.getStatusFlowsByEventId(eventId)); |
| | | } |
| | | |
| | | /** |
| | | * 更新事件状态 |
| | | */ |
| | | @PostMapping("/updateStatus") |
| | | @ApiOperationSupport(order = 13) |
| | | @ApiOperation(value = "更新事件状态", notes = "传入事件ID和目标状态,必须符合状态流转矩阵") |
| | | public R updateStatus(@Valid @RequestBody GdClueEventStatusUpdateParam updateParam) { |
| | | return R.status(gdClueEventService.updateEventStatus(updateParam)); |
| | | } |
| | | |
| | | // /** |
| | | // * 导出数据 |
| | | // */ |