| | |
| | | */ |
| | | 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; |
| | | |
| | | /** |
| | | * 事件表(线索事件) 详情 |
| | |
| | | } |
| | | |
| | | /** |
| | | * 事件表(线索事件) 列表 |
| | | * 事件表(线索事件) 列表(分页) |
| | | */ |
| | | @GetMapping("/list") |
| | | @ApiOperationSupport(order = 2) |
| | | @ApiOperation(value = "列表", notes = "固定过滤本部门,onlyMine=1时仅我的数据") |
| | | public R<List<GdClueEventListVO>> list(@ApiParam(value = "是否仅我的数据,1为是,0为否") |
| | | @ApiOperation(value = "列表(分页)", notes = "固定过滤本部门,onlyMine=1时仅我的数据") |
| | | public R<IPage<GdClueEventListVO>> list(@ApiParam(value = "是否仅我的数据,1为是,0为否") |
| | | @RequestParam(value = "onlyMine", required = false, defaultValue = "0") Integer onlyMine, |
| | | @ApiParam(value = "事件编号关键字") |
| | | @RequestParam(value = "keyword", required = false) String keyword) { |
| | | List<GdClueEventListVO> list = gdClueEventService.listGdClueEventByDept(onlyMine, keyword); |
| | | return R.data(list); |
| | | @RequestParam(value = "keyword", required = false) String keyword, |
| | | @ApiParam(value = "事件状态:0待确认、1处置中、2已退回、3已处置、4已完成") |
| | | @RequestParam(value = "eventStatus", required = false) Integer eventStatus, |
| | | @ApiParam(value = "开始时间(创建时间)") |
| | | @RequestParam(value = "startTime", required = false) String startTime, |
| | | @ApiParam(value = "结束时间(创建时间)") |
| | | @RequestParam(value = "endTime", required = false) String endTime, |
| | | @ApiParam(value = "分页参数") Query query) { |
| | | // 1. 构建分页对象 |
| | | IPage<GdClueEventListVO> pages = Condition.getPage(query); |
| | | |
| | | // 2. 查询分页数据 |
| | | IPage<GdClueEventListVO> result = gdClueEventService.pageGdClueEventByDept( |
| | | pages, onlyMine, keyword, eventStatus, startTime, endTime); |
| | | |
| | | // 3. 返回分页结果 |
| | | return R.data(result); |
| | | } |
| | | |
| | | /** |
| | |
| | | @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)); |
| | | } |
| | | |
| | | // /** |
| | | // * 导出数据 |
| | | // */ |