Selaa lähdekoodia

响应状态统一为0成功,-1失败

songxinlu 3 vuotta sitten
vanhempi
commit
1fd2b6bc06

+ 8 - 2
src/main/java/com/diagbot/dto/CommonResult.java

@@ -44,9 +44,15 @@ public class CommonResult<T> {
         this.data = data;
     }
 
-    public static <T> RespDTO<T> tranResp(CommonResult<T> commonResult){
+    public static <T> RespDTO<T> tranResp(CommonResult<T> commonResult) {
         RespDTO respDTO = new RespDTO();
-        respDTO.code = commonResult.code+"";
+        if (commonResult.code == 500l) {
+            respDTO.code = "-1";
+        } else if (commonResult.code == 200l) {
+            respDTO.code = "0";
+        } else {
+            respDTO.code = commonResult.code + "";
+        }
         respDTO.msg = commonResult.message;
         respDTO.data = commonResult.data;
         return respDTO;

+ 7 - 10
src/main/java/com/diagbot/web/MedAppealExamineInfoController.java

@@ -60,25 +60,23 @@ public class MedAppealExamineInfoController {
             notes = "获取申诉任务接口")
     @PostMapping("/getComplaintRecord")
     @SysLogger("getComplaintRecord")
-    public RespDTO<GetComplaintRecordDTO> getComplaintRecord(@RequestBody GetComplaintRecordVO getComplaintRecordVO) {
+    public RespDTO<Page<GetComplaintRecordDTO>> getComplaintRecord(@RequestBody GetComplaintRecordVO getComplaintRecordVO) {
         String userId = SysUserUtils.getCurrentPrincipleID();
         String hospitalId = SysUserUtils.getCurrentHospitalID();
         getComplaintRecordVO.setHospitalId(Long.valueOf(hospitalId));
         getComplaintRecordVO.setComplaintId(Long.valueOf(userId));
-        RespDTO<Page<GetComplaintRecordDTO>> complaintRecord = medAppealExamineInfoServiceClientFacade.getComplaintRecord(getComplaintRecordVO);
-        return RespDTO.onSuc(complaintRecord);
+        return medAppealExamineInfoServiceClientFacade.getComplaintRecord(getComplaintRecordVO);
     }
 
     @ApiOperation(value = "获取申诉审核列表[by:zhanghang]",
             notes = "获取申诉审核列表")
     @PostMapping("/getAppealReview")
-    public RespDTO<GetAppealReviewDTO> getAppealReview(@RequestBody GetAppealReviewVO getAppealReviewVO) {
+    public RespDTO<Page<GetAppealReviewDTO>> getAppealReview(@RequestBody GetAppealReviewVO getAppealReviewVO) {
         String userId = SysUserUtils.getCurrentPrincipleID();
         String hospitalId = SysUserUtils.getCurrentHospitalID();
         getAppealReviewVO.setHospitalId(Long.valueOf(hospitalId));
         getAppealReviewVO.setAppealId(Long.valueOf(userId));
-        RespDTO<Page<GetAppealReviewDTO>> appealReview = medAppealExamineInfoServiceClientFacade.getAppealReview(getAppealReviewVO);
-        return RespDTO.onSuc(appealReview);
+        return medAppealExamineInfoServiceClientFacade.getAppealReview(getAppealReviewVO);
     }
 
     @ApiOperation(value = "审核通过[by:zhanghang]",
@@ -116,14 +114,13 @@ public class MedAppealExamineInfoController {
             JSONObject mapJSON = JSONObject.parseObject(mapping);
             rejectedVo.setWorkFlowNodeId(mapJSON.getLong("rejected"));
         }
-        return RespDTO.onSuc(medAppealExamineInfoServiceClientFacade.rejected(rejectedVo));
+        return medAppealExamineInfoServiceClientFacade.rejected(rejectedVo);
     }
     @ApiOperation(value = "审核查看[by:zhanghang]",
             notes = "审核查看")
     @PostMapping("/getApprovedView")
     public RespDTO<GetAppealInfoDTO> getApprovedView(@RequestBody GetAppealInfoVO getAppealInfoVO) {
-
-        return RespDTO.onSuc(medAppealExamineInfoServiceClientFacade.getApprovedView(getAppealInfoVO));
+        return medAppealExamineInfoServiceClientFacade.getApprovedView(getAppealInfoVO);
     }
 
     @ApiOperation(value = "获取操作类型及状态[by:zhanghang]",
@@ -140,7 +137,7 @@ public class MedAppealExamineInfoController {
     public RespDTO<Integer> getAuditNumber(@RequestBody GetAuditNumberVO getAuditNumberVO) {
         String userId = SysUserUtils.getCurrentPrincipleID();
         getAuditNumberVO.setId(Long.valueOf(userId));
-        return RespDTO.onSuc(medAppealExamineInfoServiceClientFacade.getAuditNumber(getAuditNumberVO));
+        return medAppealExamineInfoServiceClientFacade.getAuditNumber(getAuditNumberVO);
     }