调整问题类型列表

添加安装问题,调试问题,外购件质量问题,运输问题
选择值“操作不当”,改为“客户操作不当”
This commit is contained in:
曹鹏飞 2026-03-10 16:32:00 +08:00
parent 896cfa3752
commit 8d3a43d152
1 changed files with 4 additions and 44 deletions

View File

@ -152,8 +152,9 @@ public class TicketController extends ControllerBase {
@GetMapping("getQuestions") @GetMapping("getQuestions")
@ApiMark(moduleName = "工单管理", apiName = "获取问题类型", isPublic = true) @ApiMark(moduleName = "工单管理", apiName = "获取问题类型", isPublic = true)
public ApiResult<List<String>> getQuestions() { public ApiResult<List<String>> getQuestions() {
return ApiResult.success(Arrays.asList("技术设计问题", "装配工艺问题", "焊接质量问题", "机组装配质量问题", "电控问题"
return ApiResult.success(Arrays.asList("技术设计问题", "装配工艺问题", "焊接质量问题", "机组装配质量问题", "电控问题", "工况方案问题", "操作不当", "原材料配件质量问题", "QC检验遗漏/误差", "部件/整机外观")); , "工况方案问题", "客户操作不当", "原材料配件质量问题", "QC检验遗漏/误差", "部件/整机外观", "安装问题", "调试问题"
, "外购件质量问题", "运输问题"));
} }
/** /**
@ -164,7 +165,6 @@ public class TicketController extends ControllerBase {
@GetMapping("getFavorites") @GetMapping("getFavorites")
@ApiMark(moduleName = "工单管理", apiName = "获取收藏夹", isPublic = true) @ApiMark(moduleName = "工单管理", apiName = "获取收藏夹", isPublic = true)
public ApiResult<FavoritesVO> getFavorites(@RequestParam(defaultValue = "0") Integer id) { public ApiResult<FavoritesVO> getFavorites(@RequestParam(defaultValue = "0") Integer id) {
return ApiResult.success(ticketFavoritesService.getMBList(AdminUserUtil.getUserId(), Constant.FROM_ADMIN, id)); return ApiResult.success(ticketFavoritesService.getMBList(AdminUserUtil.getUserId(), Constant.FROM_ADMIN, id));
} }
@ -175,7 +175,6 @@ public class TicketController extends ControllerBase {
*/ */
@GetMapping("getFavoritesTree") @GetMapping("getFavoritesTree")
public ApiResult<FavoritesVO> getFavoritesTree(@RequestParam(defaultValue = "0") Integer id) { public ApiResult<FavoritesVO> getFavoritesTree(@RequestParam(defaultValue = "0") Integer id) {
return ApiResult.success(ticketFavoritesService.getTree(AdminUserUtil.getUserId(), Constant.FROM_ADMIN, id)); return ApiResult.success(ticketFavoritesService.getTree(AdminUserUtil.getUserId(), Constant.FROM_ADMIN, id));
} }
@ -187,7 +186,6 @@ public class TicketController extends ControllerBase {
@PostMapping("addFavorites") @PostMapping("addFavorites")
@ApiMark(moduleName = "工单管理", apiName = "添加收藏夹", isPublic = true) @ApiMark(moduleName = "工单管理", apiName = "添加收藏夹", isPublic = true)
public ApiResult<Void> addFavorites(@Valid @RequestBody AdminFavoritesRequest request) { public ApiResult<Void> addFavorites(@Valid @RequestBody AdminFavoritesRequest request) {
ticketFavoritesService.addFavorites(request, AdminUserUtil.getUserId(), Constant.FROM_ADMIN); ticketFavoritesService.addFavorites(request, AdminUserUtil.getUserId(), Constant.FROM_ADMIN);
return ApiResult.success(); return ApiResult.success();
} }
@ -198,7 +196,6 @@ public class TicketController extends ControllerBase {
*/ */
@PostMapping("updateFavorites") @PostMapping("updateFavorites")
public ApiResult<Void> updateFavorites(@Valid @RequestBody FavoritesUpdateRequest request) { public ApiResult<Void> updateFavorites(@Valid @RequestBody FavoritesUpdateRequest request) {
ticketFavoritesService.updateFavorites(request, AdminUserUtil.getUserId(), Constant.FROM_ADMIN); ticketFavoritesService.updateFavorites(request, AdminUserUtil.getUserId(), Constant.FROM_ADMIN);
return ApiResult.success(); return ApiResult.success();
} }
@ -211,7 +208,6 @@ public class TicketController extends ControllerBase {
@PostMapping("deleteFavorites") @PostMapping("deleteFavorites")
@ApiMark(moduleName = "工单管理", apiName = "删除收藏夹", isPublic = true) @ApiMark(moduleName = "工单管理", apiName = "删除收藏夹", isPublic = true)
public ApiResult<Void> deleteFavorites(@Valid @RequestParam @NotNull Integer favoritesId) { public ApiResult<Void> deleteFavorites(@Valid @RequestParam @NotNull Integer favoritesId) {
ticketFavoritesService.deleteFavorites(AdminUserUtil.getUserId(), Constant.FROM_ADMIN, favoritesId); ticketFavoritesService.deleteFavorites(AdminUserUtil.getUserId(), Constant.FROM_ADMIN, favoritesId);
return ApiResult.success(); return ApiResult.success();
} }
@ -222,7 +218,6 @@ public class TicketController extends ControllerBase {
*/ */
@PostMapping("moveFavorites") @PostMapping("moveFavorites")
public ApiResult<Void> moveFavorites(@Valid @RequestBody FavoritesMoveRequest request) { public ApiResult<Void> moveFavorites(@Valid @RequestBody FavoritesMoveRequest request) {
ticketFavoritesService.moveFavorites(request); ticketFavoritesService.moveFavorites(request);
return ApiResult.success(); return ApiResult.success();
} }
@ -233,7 +228,6 @@ public class TicketController extends ControllerBase {
*/ */
@PostMapping("moveFavoritesTicket") @PostMapping("moveFavoritesTicket")
public ApiResult<Void> moveFavoritesTicket(@Valid @RequestBody FavoritesTicketMoveRequest request) { public ApiResult<Void> moveFavoritesTicket(@Valid @RequestBody FavoritesTicketMoveRequest request) {
ticketFavoritesService.moveFavoritesTicket(AdminUserUtil.getUserId(), Constant.FROM_ADMIN, request); ticketFavoritesService.moveFavoritesTicket(AdminUserUtil.getUserId(), Constant.FROM_ADMIN, request);
return ApiResult.success(); return ApiResult.success();
} }
@ -245,7 +239,6 @@ public class TicketController extends ControllerBase {
@PostMapping("followTiket") @PostMapping("followTiket")
@ApiMark(moduleName = "工单管理", apiName = "关注工单") @ApiMark(moduleName = "工单管理", apiName = "关注工单")
public ApiResult<Void> followTiket(@Valid @RequestBody AdminFollowRequest request) { public ApiResult<Void> followTiket(@Valid @RequestBody AdminFollowRequest request) {
ticketFollowService.follow(request, AdminUserUtil.getUserId(), Constant.FROM_ADMIN); ticketFollowService.follow(request, AdminUserUtil.getUserId(), Constant.FROM_ADMIN);
return ApiResult.success(); return ApiResult.success();
} }
@ -256,7 +249,6 @@ public class TicketController extends ControllerBase {
**/ **/
@PostMapping("unfollowTicket") @PostMapping("unfollowTicket")
public ApiResult<Void> unfollowTicket(@Valid @RequestParam @NotNull Integer ticketId) { public ApiResult<Void> unfollowTicket(@Valid @RequestParam @NotNull Integer ticketId) {
ticketFollowService.unfollow(AdminUserUtil.getUserId(), Constant.FROM_ADMIN, Long.valueOf(ticketId)); ticketFollowService.unfollow(AdminUserUtil.getUserId(), Constant.FROM_ADMIN, Long.valueOf(ticketId));
return ApiResult.success(); return ApiResult.success();
} }
@ -268,7 +260,6 @@ public class TicketController extends ControllerBase {
*/ */
@GetMapping("getDeviceComponents") @GetMapping("getDeviceComponents")
public ApiResult<List<ComponentInfo>> getDeviceComponents(@RequestParam String name) { public ApiResult<List<ComponentInfo>> getDeviceComponents(@RequestParam String name) {
return ApiResult.success(partService.getSimpleList(name)); return ApiResult.success(partService.getSimpleList(name));
} }
@ -278,7 +269,6 @@ public class TicketController extends ControllerBase {
*/ */
@GetMapping("getDeviceAgents") @GetMapping("getDeviceAgents")
public ApiResult<List<DeviceAgentVO>> getDeviceAgents() { public ApiResult<List<DeviceAgentVO>> getDeviceAgents() {
return ApiResult.success(deviceService.getAgents()); return ApiResult.success(deviceService.getAgents());
} }
@ -290,7 +280,6 @@ public class TicketController extends ControllerBase {
@PostMapping("searchTicket") @PostMapping("searchTicket")
@ApiMark(moduleName = "工单管理", apiName = "搜索工单") @ApiMark(moduleName = "工单管理", apiName = "搜索工单")
public ApiResult<PageData<AdminTicketVO>> searchTicket(@Valid @RequestBody AdminTicketSearchRequest request) { public ApiResult<PageData<AdminTicketVO>> searchTicket(@Valid @RequestBody AdminTicketSearchRequest request) {
return ApiResult.success(PageUtil.convert(ticketService.searchPage(request), d -> { return ApiResult.success(PageUtil.convert(ticketService.searchPage(request), d -> {
d.setEvaluate(getTicketEvaluateForList(Math.toIntExact(d.getId()))); d.setEvaluate(getTicketEvaluateForList(Math.toIntExact(d.getId())));
return d; return d;
@ -298,7 +287,6 @@ public class TicketController extends ControllerBase {
} }
private TicketEvaluateVO getTicketEvaluateForList(Integer ticketId) { private TicketEvaluateVO getTicketEvaluateForList(Integer ticketId) {
TicketEvaluate ticketEvaluate = ticketEvaluateService.lambdaQuery().eq(TicketEvaluate::getTicketId, ticketId).one(); TicketEvaluate ticketEvaluate = ticketEvaluateService.lambdaQuery().eq(TicketEvaluate::getTicketId, ticketId).one();
if (Objects.isNull(ticketEvaluate)) { if (Objects.isNull(ticketEvaluate)) {
return null; return null;
@ -354,7 +342,6 @@ public class TicketController extends ControllerBase {
@GetMapping("getReason") @GetMapping("getReason")
@ApiMark(moduleName = "工单管理", apiName = "获取工单根本原因分析", isPublic = true) @ApiMark(moduleName = "工单管理", apiName = "获取工单根本原因分析", isPublic = true)
public ApiResult<String> getReason(@Valid @RequestParam @NotNull Integer ticketId) { public ApiResult<String> getReason(@Valid @RequestParam @NotNull Integer ticketId) {
Ticket ticket = ticketService.getById(ticketId); Ticket ticket = ticketService.getById(ticketId);
VUtils.trueThrowBusinessError(Objects.isNull(ticket)).throwMessage("工单不存在"); VUtils.trueThrowBusinessError(Objects.isNull(ticket)).throwMessage("工单不存在");
return ApiResult.success(ticket.getReason()); return ApiResult.success(ticket.getReason());
@ -367,7 +354,6 @@ public class TicketController extends ControllerBase {
@PostMapping("exportSearchTicket") @PostMapping("exportSearchTicket")
@ApiMark(moduleName = "工单管理", apiName = "导出搜索工单") @ApiMark(moduleName = "工单管理", apiName = "导出搜索工单")
public void exportSearchTicket(HttpServletResponse response, @Valid @RequestBody AdminTicketSearchRequest request) throws IOException { public void exportSearchTicket(HttpServletResponse response, @Valid @RequestBody AdminTicketSearchRequest request) throws IOException {
request.setPageSize(Integer.MAX_VALUE); request.setPageSize(Integer.MAX_VALUE);
List<AdminTicketVO> datas = ticketService.exportSearch(request); List<AdminTicketVO> datas = ticketService.exportSearch(request);
EecExcelUtil.export("工单", "sheet1", datas, response); EecExcelUtil.export("工单", "sheet1", datas, response);
@ -381,7 +367,6 @@ public class TicketController extends ControllerBase {
@MethodInfoMark(value = "分派工单", menuName = "工单管理") @MethodInfoMark(value = "分派工单", menuName = "工单管理")
@ApiMark(moduleName = "工单管理", apiName = "分派工单") @ApiMark(moduleName = "工单管理", apiName = "分派工单")
public ApiResult<Void> assignmentTicket(@Valid @RequestBody AssignmentTicketRequest request) { public ApiResult<Void> assignmentTicket(@Valid @RequestBody AssignmentTicketRequest request) {
Ticket ticket = ticketService.assignmentTicket(request); Ticket ticket = ticketService.assignmentTicket(request);
ticketEventPublisher.publishTicketAssignedEvent(ticket, request.getUserIds()); ticketEventPublisher.publishTicketAssignedEvent(ticket, request.getUserIds());
ChatMessageDTO message = new ChatMessageDTO() ChatMessageDTO message = new ChatMessageDTO()
@ -411,7 +396,6 @@ public class TicketController extends ControllerBase {
@GetMapping("getTicketHandle") @GetMapping("getTicketHandle")
@ApiMark(moduleName = "工单管理", apiName = "获取工单处理人") @ApiMark(moduleName = "工单管理", apiName = "获取工单处理人")
public ApiResult<List<AdminUserSimpleVO>> getTicketHandle(@Valid @RequestParam @NotNull(message = "工单编号不能为空") Long id) { public ApiResult<List<AdminUserSimpleVO>> getTicketHandle(@Valid @RequestParam @NotNull(message = "工单编号不能为空") Long id) {
return ApiResult.success(ticketService.getTicketHandle(id)); return ApiResult.success(ticketService.getTicketHandle(id));
} }
@ -423,7 +407,6 @@ public class TicketController extends ControllerBase {
@MethodInfoMark(value = "添加工单处理人", menuName = "工单管理") @MethodInfoMark(value = "添加工单处理人", menuName = "工单管理")
@ApiMark(moduleName = "工单管理", apiName = "添加工单处理人") @ApiMark(moduleName = "工单管理", apiName = "添加工单处理人")
public ApiResult<Void> addTicketHandle(@Valid @RequestBody TicketHandleAddRequest request) { public ApiResult<Void> addTicketHandle(@Valid @RequestBody TicketHandleAddRequest request) {
Ticket ticket = ticketService.getById(request.getTicketId()); Ticket ticket = ticketService.getById(request.getTicketId());
List<Integer> handleIds = StrUtil.split(ticket.getHandle(), ",").stream().map(Integer::parseInt).collect(Collectors.toList()); List<Integer> handleIds = StrUtil.split(ticket.getHandle(), ",").stream().map(Integer::parseInt).collect(Collectors.toList());
// VUtils.trueThrowBusinessError(handleIds.stream().anyMatch(uid -> Objects.equals(uid, AdminUserUtil.getUserId())) // VUtils.trueThrowBusinessError(handleIds.stream().anyMatch(uid -> Objects.equals(uid, AdminUserUtil.getUserId()))
@ -445,7 +428,6 @@ public class TicketController extends ControllerBase {
@MethodInfoMark(value = "完成工单", menuName = "工单管理") @MethodInfoMark(value = "完成工单", menuName = "工单管理")
@ApiMark(moduleName = "工单管理", apiName = "完成工单") @ApiMark(moduleName = "工单管理", apiName = "完成工单")
public ApiResult<Void> completeTicket(@Valid @RequestBody @NotEmpty List<Integer> ids) { public ApiResult<Void> completeTicket(@Valid @RequestBody @NotEmpty List<Integer> ids) {
for (Integer id : ids) { for (Integer id : ids) {
Ticket ticket = ticketService.completeTicket(id); Ticket ticket = ticketService.completeTicket(id);
ticketEventPublisher.publishTicketCompleteEvent(ticket); ticketEventPublisher.publishTicketCompleteEvent(ticket);
@ -477,7 +459,6 @@ public class TicketController extends ControllerBase {
@MethodInfoMark(value = "驳回工单", menuName = "工单管理") @MethodInfoMark(value = "驳回工单", menuName = "工单管理")
@ApiMark(moduleName = "工单管理", apiName = "驳回工单") @ApiMark(moduleName = "工单管理", apiName = "驳回工单")
public ApiResult<Void> rejectTicket(@Valid @RequestBody @NotEmpty List<Integer> ids) { public ApiResult<Void> rejectTicket(@Valid @RequestBody @NotEmpty List<Integer> ids) {
for (Integer id : ids) { for (Integer id : ids) {
Ticket ticket = ticketService.rejectTicket(id); Ticket ticket = ticketService.rejectTicket(id);
// ticketEventPublisher.publishTicketCompleteEvent(ticket); // ticketEventPublisher.publishTicketCompleteEvent(ticket);
@ -505,7 +486,6 @@ public class TicketController extends ControllerBase {
**/ **/
@GetMapping("revokedTicket") @GetMapping("revokedTicket")
public ApiResult<Void> revokedTicket(@Valid @RequestParam @NotNull Integer id) { public ApiResult<Void> revokedTicket(@Valid @RequestParam @NotNull Integer id) {
ticketService.revokedFromAdmin(id); ticketService.revokedFromAdmin(id);
return ApiResult.success(); return ApiResult.success();
} }
@ -657,7 +637,7 @@ public class TicketController extends ControllerBase {
} else if (Objects.nonNull(user.getAreaId())) { } else if (Objects.nonNull(user.getAreaId())) {
areaName = appAreaService.getById(user.getAreaId()).getName(); areaName = appAreaService.getById(user.getAreaId()).getName();
} }
}else { } else {
areaName = Optional.ofNullable(areaService.getById(user.getAreaId())).map(TBaseArea::getAreaName).orElse(""); areaName = Optional.ofNullable(areaService.getById(user.getAreaId())).map(TBaseArea::getAreaName).orElse("");
} }
} }
@ -736,7 +716,6 @@ public class TicketController extends ControllerBase {
} }
private List<FileUploadVO> getFileVOs(String ids) { private List<FileUploadVO> getFileVOs(String ids) {
if (StrUtil.isBlank(ids)) { if (StrUtil.isBlank(ids)) {
return Collections.emptyList(); return Collections.emptyList();
} }
@ -747,7 +726,6 @@ public class TicketController extends ControllerBase {
} }
private TicketEvaluateVO getTicketEvaluate(Integer ticketId) { private TicketEvaluateVO getTicketEvaluate(Integer ticketId) {
TicketEvaluate ticketEvaluate = ticketEvaluateService.lambdaQuery().eq(TicketEvaluate::getTicketId, ticketId).one(); TicketEvaluate ticketEvaluate = ticketEvaluateService.lambdaQuery().eq(TicketEvaluate::getTicketId, ticketId).one();
if (Objects.isNull(ticketEvaluate)) { if (Objects.isNull(ticketEvaluate)) {
return null; return null;
@ -795,7 +773,6 @@ public class TicketController extends ControllerBase {
@GetMapping("getChatMessages") @GetMapping("getChatMessages")
@ApiMark(moduleName = "工单管理", apiName = "获取工单聊天记录") @ApiMark(moduleName = "工单管理", apiName = "获取工单聊天记录")
public ApiResult<MessageVO> getChatMessages(@Valid @RequestParam @NotNull Integer ticketId) { public ApiResult<MessageVO> getChatMessages(@Valid @RequestParam @NotNull Integer ticketId) {
Integer userId = AdminUserUtil.getUserId(); Integer userId = AdminUserUtil.getUserId();
MessageVO vo = new MessageVO(); MessageVO vo = new MessageVO();
List<ChatMessageVO> messageVOS = ticketChatService.getMessages(Long.valueOf(ticketId), userId); List<ChatMessageVO> messageVOS = ticketChatService.getMessages(Long.valueOf(ticketId), userId);
@ -835,7 +812,6 @@ public class TicketController extends ControllerBase {
**/ **/
@PostMapping("setChatMessageReaded") @PostMapping("setChatMessageReaded")
public ApiResult<Void> setChatMessageReaded(@RequestBody Long ticketId) { public ApiResult<Void> setChatMessageReaded(@RequestBody Long ticketId) {
stringRedisTemplate.delete("chatMessage:notreaded:" + ticketId + ":admin:" + AdminUserUtil.getUserId()); stringRedisTemplate.delete("chatMessage:notreaded:" + ticketId + ":admin:" + AdminUserUtil.getUserId());
return ApiResult.success(); return ApiResult.success();
} }
@ -847,7 +823,6 @@ public class TicketController extends ControllerBase {
@PostMapping("addChatMessage") @PostMapping("addChatMessage")
@ApiMark(moduleName = "工单管理", apiName = "添加聊天记录") @ApiMark(moduleName = "工单管理", apiName = "添加聊天记录")
public ApiResult<Void> addChatMessage(@Valid @RequestBody AddChatMessageRequest request) { public ApiResult<Void> addChatMessage(@Valid @RequestBody AddChatMessageRequest request) {
Ticket ticket = ticketService.getById(request.getTicketId()); Ticket ticket = ticketService.getById(request.getTicketId());
VUtils.trueThrowBusinessError(Objects.isNull(ticket)).throwMessage("工单不存在"); VUtils.trueThrowBusinessError(Objects.isNull(ticket)).throwMessage("工单不存在");
VUtils.trueThrowBusinessError(Byte.compare(ticket.getState(), TicketState.Processing.getState()) > 1) VUtils.trueThrowBusinessError(Byte.compare(ticket.getState(), TicketState.Processing.getState()) > 1)
@ -911,7 +886,6 @@ public class TicketController extends ControllerBase {
@PostMapping("withdrawChatMessage") @PostMapping("withdrawChatMessage")
@ApiMark(moduleName = "工单管理", apiName = "撤回聊天记录") @ApiMark(moduleName = "工单管理", apiName = "撤回聊天记录")
public ApiResult<Void> withdrawChatMessage(@Valid @RequestBody WithdrawChatMessageRequest request) { public ApiResult<Void> withdrawChatMessage(@Valid @RequestBody WithdrawChatMessageRequest request) {
ticketChatService.withdrawMessage(request.getTicketId(), request.getMessageId()); ticketChatService.withdrawMessage(request.getTicketId(), request.getMessageId());
//推送消息 //推送消息
ssePushService.sendTicketMessageWithdrawToAdmin(request.getTicketId(), request.getMessageId()); ssePushService.sendTicketMessageWithdrawToAdmin(request.getTicketId(), request.getMessageId());
@ -973,7 +947,6 @@ public class TicketController extends ControllerBase {
@GetMapping("getSolutionReviewDepartment") @GetMapping("getSolutionReviewDepartment")
@ApiMark(moduleName = "工单管理", apiName = "获取工单解决方案评审部门") @ApiMark(moduleName = "工单管理", apiName = "获取工单解决方案评审部门")
public ApiResult<List<SolutionReviewDepartmentVO>> getSolutionReviewDepartment(@Valid @RequestParam @NotNull Integer ticketId) { public ApiResult<List<SolutionReviewDepartmentVO>> getSolutionReviewDepartment(@Valid @RequestParam @NotNull Integer ticketId) {
return ApiResult.success(ticketSolutionAuditService.getByTicket(Long.valueOf(ticketId))); return ApiResult.success(ticketSolutionAuditService.getByTicket(Long.valueOf(ticketId)));
} }
@ -984,7 +957,6 @@ public class TicketController extends ControllerBase {
@PostMapping("saveSolutionReviewDepartment") @PostMapping("saveSolutionReviewDepartment")
@ApiMark(moduleName = "工单管理", apiName = "保存工单解决方案评审部门") @ApiMark(moduleName = "工单管理", apiName = "保存工单解决方案评审部门")
public ApiResult<Void> saveSolutionReviewDepartment(@Valid @RequestBody SolutionReviewDepartmentSaveRequest request) { public ApiResult<Void> saveSolutionReviewDepartment(@Valid @RequestBody SolutionReviewDepartmentSaveRequest request) {
ticketSolutionAuditService.saveSolutionReviewDepartment(request); ticketSolutionAuditService.saveSolutionReviewDepartment(request);
adminMessageService.setReaded(AdminUserUtil.getUserId(), Long.valueOf(request.getTicketId()), MessageSubType.TicketCompletion.getState()); adminMessageService.setReaded(AdminUserUtil.getUserId(), Long.valueOf(request.getTicketId()), MessageSubType.TicketCompletion.getState());
return ApiResult.success(); return ApiResult.success();
@ -997,7 +969,6 @@ public class TicketController extends ControllerBase {
@PostMapping("rejectSolution") @PostMapping("rejectSolution")
@ApiMark(moduleName = "工单管理", apiName = "驳回工单解决方案") @ApiMark(moduleName = "工单管理", apiName = "驳回工单解决方案")
public ApiResult<Void> rejectSolution(@Valid @RequestBody SolutionRejectRequest request) { public ApiResult<Void> rejectSolution(@Valid @RequestBody SolutionRejectRequest request) {
Ticket ticket = ticketSolutionAuditService.reject(request); Ticket ticket = ticketSolutionAuditService.reject(request);
if (Objects.nonNull(ticket)) { if (Objects.nonNull(ticket)) {
TicketSolutionAudit audit = ticketSolutionAuditService.lambdaQuery() TicketSolutionAudit audit = ticketSolutionAuditService.lambdaQuery()
@ -1030,7 +1001,6 @@ public class TicketController extends ControllerBase {
@GetMapping("passSolution") @GetMapping("passSolution")
@ApiMark(moduleName = "工单管理", apiName = "通过工单解决方案") @ApiMark(moduleName = "工单管理", apiName = "通过工单解决方案")
public ApiResult<Void> passSolution(@Valid @RequestParam @NotNull Integer ticketId) { public ApiResult<Void> passSolution(@Valid @RequestParam @NotNull Integer ticketId) {
if (ticketSolutionAuditService.pass(ticketId)) { if (ticketSolutionAuditService.pass(ticketId)) {
Ticket ticket = ticketService.getById(ticketId); Ticket ticket = ticketService.getById(ticketId);
ticketEventPublisher.publishTicketCloseEvent(ticket); ticketEventPublisher.publishTicketCloseEvent(ticket);
@ -1058,7 +1028,6 @@ public class TicketController extends ControllerBase {
@PostMapping("exportTicketReport") @PostMapping("exportTicketReport")
@ApiMark(moduleName = "工单管理", apiName = "导出工单报表") @ApiMark(moduleName = "工单管理", apiName = "导出工单报表")
public void exportTicketReport(HttpServletResponse response, @Valid @RequestBody AdminTicketSearchRequest request) throws IOException { public void exportTicketReport(HttpServletResponse response, @Valid @RequestBody AdminTicketSearchRequest request) throws IOException {
request.setPageSize(Integer.MAX_VALUE); request.setPageSize(Integer.MAX_VALUE);
List<AdminTicketVO> datas = ticketService.exportSearch(request); List<AdminTicketVO> datas = ticketService.exportSearch(request);
EecExcelUtil.export("工单报表", "sheet1", Convert.toList(AdminTicketReportVO.class, datas), response); EecExcelUtil.export("工单报表", "sheet1", Convert.toList(AdminTicketReportVO.class, datas), response);
@ -1071,7 +1040,6 @@ public class TicketController extends ControllerBase {
@GetMapping("/exportTicketExcel") @GetMapping("/exportTicketExcel")
@ApiMark(moduleName = "工单管理", apiName = "导出工单详情为excel") @ApiMark(moduleName = "工单管理", apiName = "导出工单详情为excel")
public void exportExcel(HttpServletResponse response, @Valid @RequestParam @NotNull Integer ticketId) throws Exception { public void exportExcel(HttpServletResponse response, @Valid @RequestParam @NotNull Integer ticketId) throws Exception {
Ticket ticket = ticketService.getById(ticketId); Ticket ticket = ticketService.getById(ticketId);
VUtils.trueThrowBusinessError(Objects.isNull(ticket)).throwMessage("工单不存在"); VUtils.trueThrowBusinessError(Objects.isNull(ticket)).throwMessage("工单不存在");
Workbook workbook = new XSSFWorkbook(); Workbook workbook = new XSSFWorkbook();
@ -1273,7 +1241,6 @@ public class TicketController extends ControllerBase {
} }
private void addMergedRegion(Sheet sheet, int firstRow, int lastRow, int firstCol, int lastCol) { private void addMergedRegion(Sheet sheet, int firstRow, int lastRow, int firstCol, int lastCol) {
CellRangeAddress region = new CellRangeAddress(firstRow, lastRow, firstCol, lastCol); CellRangeAddress region = new CellRangeAddress(firstRow, lastRow, firstCol, lastCol);
sheet.addMergedRegion(region); sheet.addMergedRegion(region);
RegionUtil.setBorderBottom(BorderStyle.THIN, region, sheet); RegionUtil.setBorderBottom(BorderStyle.THIN, region, sheet);
@ -1283,14 +1250,12 @@ public class TicketController extends ControllerBase {
} }
private void createCell(Row row, int index, CellStyle style, String value) { private void createCell(Row row, int index, CellStyle style, String value) {
Cell cell = row.createCell(index); Cell cell = row.createCell(index);
cell.setCellValue(value); cell.setCellValue(value);
cell.setCellStyle(style); cell.setCellStyle(style);
} }
private void bindPic(String url, Workbook workbook, Sheet sheet, int rowIndex, int colStart, int colEnd) { private void bindPic(String url, Workbook workbook, Sheet sheet, int rowIndex, int colStart, int colEnd) {
try { try {
byte[] imageBytes; byte[] imageBytes;
try (InputStream inputStream = new URL(url).openStream()) { try (InputStream inputStream = new URL(url).openStream()) {
@ -1316,7 +1281,6 @@ public class TicketController extends ControllerBase {
} }
private CellStyle getNormalStyle(Workbook workbook) { private CellStyle getNormalStyle(Workbook workbook) {
CellStyle centerStyle = workbook.createCellStyle(); CellStyle centerStyle = workbook.createCellStyle();
centerStyle.setAlignment(HorizontalAlignment.LEFT); centerStyle.setAlignment(HorizontalAlignment.LEFT);
centerStyle.setVerticalAlignment(VerticalAlignment.CENTER); centerStyle.setVerticalAlignment(VerticalAlignment.CENTER);
@ -1336,7 +1300,6 @@ public class TicketController extends ControllerBase {
} }
private CellStyle getCenterStyle(Workbook workbook) { private CellStyle getCenterStyle(Workbook workbook) {
CellStyle centerStyle = workbook.createCellStyle(); CellStyle centerStyle = workbook.createCellStyle();
centerStyle.setAlignment(HorizontalAlignment.CENTER); centerStyle.setAlignment(HorizontalAlignment.CENTER);
centerStyle.setVerticalAlignment(VerticalAlignment.CENTER); centerStyle.setVerticalAlignment(VerticalAlignment.CENTER);
@ -1356,7 +1319,6 @@ public class TicketController extends ControllerBase {
} }
private CellStyle getTitleStyle(Workbook workbook) { private CellStyle getTitleStyle(Workbook workbook) {
CellStyle titleStyle = workbook.createCellStyle(); CellStyle titleStyle = workbook.createCellStyle();
titleStyle.setAlignment(HorizontalAlignment.CENTER); titleStyle.setAlignment(HorizontalAlignment.CENTER);
titleStyle.setVerticalAlignment(VerticalAlignment.CENTER); titleStyle.setVerticalAlignment(VerticalAlignment.CENTER);
@ -1383,7 +1345,6 @@ public class TicketController extends ControllerBase {
@GetMapping("/getHandlers") @GetMapping("/getHandlers")
@ApiMark(moduleName = "工单管理", apiName = "获取工单处理人") @ApiMark(moduleName = "工单管理", apiName = "获取工单处理人")
public ApiResult<List<AdminUserSimpleVO>> getHandlers(@Valid @RequestParam @NotNull Long ticketId) { public ApiResult<List<AdminUserSimpleVO>> getHandlers(@Valid @RequestParam @NotNull Long ticketId) {
return ApiResult.success(ticketService.getTicketHandle(ticketId)); return ApiResult.success(ticketService.getTicketHandle(ticketId));
} }
@ -1609,7 +1570,6 @@ public class TicketController extends ControllerBase {
*/ */
@GetMapping("getShengWangChannelUsers") @GetMapping("getShengWangChannelUsers")
public ApiResult<List<Integer>> getShengWangChannelUsers(Long ticketId) throws IOException, InterruptedException { public ApiResult<List<Integer>> getShengWangChannelUsers(Long ticketId) throws IOException, InterruptedException {
return ApiResult.success(shengWangService.getChannelUsers("ticket" + ticketId).getUsers()); return ApiResult.success(shengWangService.getChannelUsers("ticket" + ticketId).getUsers());
} }
} }