refactor(mobilebroken): 优化错误状态码使用和功能扩展- 在 DeviceController 中将 STATE.BusinessError 修改为 STATE.DataNoCheckPass,更准确地反映导入文件失败的错误类型
- 在 SsePushService 中为 ChatMessageVO 添加 remindUsers 字段,支持消息提醒功能 - 在 TiketController 中新增 getHandlers 方法,用于获取工单处理人信息
This commit is contained in:
parent
e8a37d2a02
commit
c20c100054
|
|
@ -297,7 +297,7 @@ public class DeviceController extends ControllerBase {
|
||||||
.stream().map(DictionaryItem::getName).collect(Collectors.toList())))
|
.stream().map(DictionaryItem::getName).collect(Collectors.toList())))
|
||||||
.writeTo(osOut);
|
.writeTo(osOut);
|
||||||
try(ByteArrayInputStream isIn = new ByteArrayInputStream(osOut.toByteArray())) {
|
try(ByteArrayInputStream isIn = new ByteArrayInputStream(osOut.toByteArray())) {
|
||||||
return ApiResult.error(STATE.BusinessError, "导入文件失败",fileUploadService.upload("temp/" +DateTimeUtil.format(LocalDate.now(),"yyyyMMdd")+"/"+ IdUtil.fastUUID() + ".xlsx", isIn));
|
return ApiResult.error(STATE.DataNoCheckPass, "导入文件失败",fileUploadService.upload("temp/" +DateTimeUtil.format(LocalDate.now(),"yyyyMMdd")+"/"+ IdUtil.fastUUID() + ".xlsx", isIn));
|
||||||
}
|
}
|
||||||
}catch (Exception e){
|
}catch (Exception e){
|
||||||
return ApiResult.error(STATE.BusinessError, "保存文件出错");
|
return ApiResult.error(STATE.BusinessError, "保存文件出错");
|
||||||
|
|
@ -510,7 +510,7 @@ public class DeviceController extends ControllerBase {
|
||||||
.stream().map(DictionaryItem::getName).collect(Collectors.toList())))
|
.stream().map(DictionaryItem::getName).collect(Collectors.toList())))
|
||||||
.writeTo(osOut);
|
.writeTo(osOut);
|
||||||
try(ByteArrayInputStream isIn = new ByteArrayInputStream(osOut.toByteArray())) {
|
try(ByteArrayInputStream isIn = new ByteArrayInputStream(osOut.toByteArray())) {
|
||||||
return ApiResult.error(STATE.BusinessError, "导入文件失败",fileUploadService.upload("temp/" +DateTimeUtil.format(LocalDate.now(),"yyyyMMdd")+"/"+ IdUtil.fastUUID() + ".xlsx", isIn));
|
return ApiResult.error(STATE.DataNoCheckPass, "导入文件失败",fileUploadService.upload("temp/" +DateTimeUtil.format(LocalDate.now(),"yyyyMMdd")+"/"+ IdUtil.fastUUID() + ".xlsx", isIn));
|
||||||
}
|
}
|
||||||
}catch (Exception e){
|
}catch (Exception e){
|
||||||
return ApiResult.error(STATE.BusinessError, "保存文件出错");
|
return ApiResult.error(STATE.BusinessError, "保存文件出错");
|
||||||
|
|
|
||||||
|
|
@ -426,4 +426,13 @@ public class TiketController extends ControllerBase {
|
||||||
public ApiResult<SolutionMeasuresVO> getSolutionMeasures(@Valid @RequestParam @NotNull Integer ticketId){
|
public ApiResult<SolutionMeasuresVO> getSolutionMeasures(@Valid @RequestParam @NotNull Integer ticketId){
|
||||||
return ApiResult.success(ticketSolutionService.getSolutionMeasures(ticketId));
|
return ApiResult.success(ticketSolutionService.getSolutionMeasures(ticketId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取工单处理人
|
||||||
|
* @param ticketId 工单编号
|
||||||
|
*/
|
||||||
|
@GetMapping("/getHandlers")
|
||||||
|
public ApiResult<List<AdminUserSimpleVO>> getHandlers(@Valid @RequestParam @NotNull Integer ticketId) {
|
||||||
|
return ApiResult.success(ticketService.getTicketHandle(ticketId));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -63,6 +63,7 @@ public class SsePushService {
|
||||||
.setCreateTime(formatter.format(message.getCreateTime()))
|
.setCreateTime(formatter.format(message.getCreateTime()))
|
||||||
.setImages(message.getImages())
|
.setImages(message.getImages())
|
||||||
.setAttachments(message.getAttachments())
|
.setAttachments(message.getAttachments())
|
||||||
|
.setRemindUsers(message.getRemindUsers())
|
||||||
.setQuote(Objects.isNull(message.getQuote()) ? null : new ChatMessageVO()
|
.setQuote(Objects.isNull(message.getQuote()) ? null : new ChatMessageVO()
|
||||||
.setId(message.getQuote().getId())
|
.setId(message.getQuote().getId())
|
||||||
.setFrom(message.getQuote().getFrom())
|
.setFrom(message.getQuote().getFrom())
|
||||||
|
|
@ -73,6 +74,7 @@ public class SsePushService {
|
||||||
.setContent(message.getQuote().getContent())
|
.setContent(message.getQuote().getContent())
|
||||||
.setAttachments(message.getQuote().getAttachments())
|
.setAttachments(message.getQuote().getAttachments())
|
||||||
.setImages(message.getQuote().getImages())
|
.setImages(message.getQuote().getImages())
|
||||||
|
.setRemindUsers(message.getQuote().getRemindUsers())
|
||||||
.setCreateTime(formatter.format(message.getQuote().getCreateTime())));
|
.setCreateTime(formatter.format(message.getQuote().getCreateTime())));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue