|
@@ -248,15 +248,16 @@ public class WebSiteTourismTravelNotesPublishController {
|
|
|
}
|
|
|
TourismProjectTravelNotesWrite tourismProjectTravelNotesWrite = tourismProjectTravelNotesWriteService.getById(Long.valueOf(writeId));
|
|
|
//判断状态是否为审核中
|
|
|
+ if(tourismProjectTravelNotesWrite == null){
|
|
|
+ return ResponseResult.error(ErrorCodeEnum.DATA_ACCESS_FAILED,"该游记内容不存在,请刷新重试!");
|
|
|
+ }
|
|
|
if(!tourismProjectTravelNotesWrite.getState().equals(AuditState.UNAUDITSTATE)){
|
|
|
return ResponseResult.error(ErrorCodeEnum.DATA_ACCESS_FAILED,"当前状态无法撤回");
|
|
|
}else if(!tourismProjectTravelNotesWrite.getCreateUserId().equals(TokenData.takeFromRequest().getUserId())){
|
|
|
return ResponseResult.error(ErrorCodeEnum.DATA_ACCESS_FAILED,"当前用户无法撤回");
|
|
|
}else {
|
|
|
- TourismProjectTravelNotesWrite tourismProjectTravelNotesWrite1 =
|
|
|
- MyModelUtil.copyTo(tourismProjectTravelNotesWrite, TourismProjectTravelNotesWrite.class);
|
|
|
tourismProjectTravelNotesWrite.setState(AuditState.DRAFT);
|
|
|
- tourismProjectTravelNotesWriteService.update(tourismProjectTravelNotesWrite,tourismProjectTravelNotesWrite1);
|
|
|
+ tourismProjectTravelNotesWriteService.updateById(tourismProjectTravelNotesWrite);
|
|
|
return ResponseResult.success();
|
|
|
}
|
|
|
}
|
|
@@ -279,10 +280,9 @@ public class WebSiteTourismTravelNotesPublishController {
|
|
|
}
|
|
|
//校验数据状态是否允许下架状态
|
|
|
if(tourismProjectTravelNotesWrite.getUnmountState().equals(UnmountState.LISTING) && tourismProjectTravelNotesWrite.getState().equals(AuditState.SUCCEEDAUDIT)){
|
|
|
- TourismProjectTravelNotesWrite tourismProjectTravelNotesWrite1 = MyModelUtil.copyTo(tourismProjectTravelNotesWrite, TourismProjectTravelNotesWrite.class);
|
|
|
tourismProjectTravelNotesWrite.setUnmountState(UnmountState.DELIST);
|
|
|
tourismProjectTravelNotesWrite.setState(AuditState.DRAFT);
|
|
|
- tourismProjectTravelNotesWriteService.update(tourismProjectTravelNotesWrite, tourismProjectTravelNotesWrite1);
|
|
|
+ tourismProjectTravelNotesWriteService.updateById(tourismProjectTravelNotesWrite);
|
|
|
return ResponseResult.success();
|
|
|
}else {
|
|
|
return ResponseResult.error(ErrorCodeEnum.DATA_ACCESS_FAILED,"数据状态不允许下架");
|