| | |
| | | import com.panzhihua.sangeshenbian.annotation.DistributedLock; |
| | | import com.panzhihua.sangeshenbian.model.dto.*; |
| | | import com.panzhihua.sangeshenbian.model.entity.Complaint; |
| | | import com.panzhihua.sangeshenbian.model.entity.ComplaintAuditRecord; |
| | | import com.panzhihua.sangeshenbian.model.entity.ComplaintProgress; |
| | | import com.panzhihua.sangeshenbian.model.entity.ProblemType; |
| | | import com.panzhihua.sangeshenbian.model.query.ComplaintQuery; |
| | | import com.panzhihua.sangeshenbian.model.vo.ComplaintVO; |
| | | import com.panzhihua.sangeshenbian.model.vo.DispatchVO; |
| | | import com.panzhihua.sangeshenbian.service.IComplaintService; |
| | | import com.panzhihua.sangeshenbian.service.IProblemTypeService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import io.swagger.annotations.ApiParam; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.annotation.Lazy; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.validation.Valid; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @Validated |
| | | @RestController |
| | | @RequestMapping("/applet/complaint") |
| | | @RequiredArgsConstructor |
| | | @RequiredArgsConstructor(onConstructor_ = {@Lazy}) |
| | | @Api(tags = "诉求管理") |
| | | public class ComplaintController extends BaseController { |
| | | |
| | | private final IComplaintService complaintService; |
| | | |
| | | |
| | | private final IProblemTypeService problemTypeService; |
| | | @GetMapping("/problem-type/list") |
| | | @ApiOperation("获取诉求问题类型列表") |
| | | public R<List<ProblemType>> problemTypeList() { |
| | | return R.ok(problemTypeService.list()); |
| | | } |
| | | /** |
| | | * 录入诉求 |
| | | */ |
| | | @PostMapping("/save") |
| | | @ApiOperation(value = "录入诉求") |
| | | @DistributedLock(lockName = "complaint_serial_number_lock") |
| | | public void save(Complaint complaint) { |
| | | public R<?> save(@RequestBody Complaint complaint) { |
| | | complaintService.saveComplaint(complaint, getUserId()); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @PostMapping("/list") |
| | |
| | | public R<Page<ComplaintVO>> complaintList(@RequestBody ComplaintQuery query) { |
| | | return R.ok(complaintService.complaintList(query,getLoginUserInfo())); |
| | | } |
| | | |
| | | @GetMapping("/detail") |
| | | @ApiOperation("工单详情") |
| | | public R<ComplaintVO> detail(@ApiParam(name = "id", value = "工单id", required = true) Long id) { |
| | | return R.ok(complaintService.detail(id)); |
| | | } |
| | | @PostMapping("/saveProcess") |
| | | |
| | | @GetMapping("/progress/{complaintId}") |
| | | @ApiOperation("办理进度") |
| | | public R<List<ComplaintProgress>> progress(@ApiParam(name = "complaintId", value = "诉求id", required = true) @PathVariable("complaintId") Long complaintId) { |
| | | return R.ok(complaintService.progress(complaintId)); |
| | | } |
| | | |
| | | @PostMapping("/save-process") |
| | | @ApiOperation("办理进度录入") |
| | | public R<?> saveProcess(@Valid @RequestBody ComplaintProcessDTO dto){ |
| | | complaintService.saveProcess(dto,getUserId()); |
| | | complaintService.saveProcess(dto,getLoginUserInfo()); |
| | | return R.ok(); |
| | | } |
| | | @PostMapping("/saveResult") |
| | | |
| | | @PostMapping("/save-result") |
| | | @ApiOperation("办理结果录入") |
| | | public R<?> saveResult(@RequestBody ComplaintCompletionDTO dto){ |
| | | complaintService.saveResult(dto,getLoginUserInfo()); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @GetMapping("/delay-detail/{complaintId}") |
| | | @ApiOperation("延期情况说明") |
| | | public R<ComplaintAuditRecord> delayDetail(@ApiParam(name = "complaintId", value = "诉求id", required = true) @PathVariable("complaintId") Long complaintId) { |
| | | return R.ok(complaintService.delayDetail(complaintId)); |
| | | } |
| | | |
| | | /** |
| | |
| | | * 诉求下派 |
| | | */ |
| | | @PostMapping("/saveDispatch") |
| | | @ApiOperation("诉求下派") |
| | | public R<?> saveDispatch(@RequestBody ComplaintDispatch dto){ |
| | | complaintService.saveDispatch(dto, getLoginUserInfo()); |
| | | return R.ok(); |
| | |
| | | * 延期申请 |
| | | */ |
| | | @PostMapping("/saveDelay") |
| | | @ApiOperation(value = "延期申请") |
| | | public R<?> saveDelay(@RequestBody ComplaintDelayDTO dto){ |
| | | complaintService.saveDelay(dto, getLoginUserInfo()); |
| | | return R.ok(); |
| | |
| | | */ |
| | | @GetMapping("/getDispatchList") |
| | | @ApiOperation(value = "获取下派单位列表") |
| | | public R<?> getDispatchList() { |
| | | public R<List<DispatchVO>> getDispatchList() { |
| | | return R.ok(complaintService.getDispatchList(getLoginUserInfo())); |
| | | } |
| | | |