|
@@ -11,6 +11,7 @@ import com.tourism.common.core.upload.UploadStoreInfo;
|
|
|
import com.tourism.common.log.annotation.OperationLog;
|
|
|
import com.tourism.common.log.model.constant.SysOperationLogType;
|
|
|
import com.github.pagehelper.page.PageMethod;
|
|
|
+import com.tourism.webadmin.back.dao.TourTravelNotesProjectRelationMapper;
|
|
|
import com.tourism.webadmin.back.vo.*;
|
|
|
import com.tourism.webadmin.back.dto.*;
|
|
|
import com.tourism.webadmin.back.model.*;
|
|
@@ -55,6 +56,8 @@ public class TourTourismProjectTravelNotesController {
|
|
|
private UpDownloaderFactory upDownloaderFactory;
|
|
|
@Autowired
|
|
|
private TourTourismProjectTravelNotesService tourTourismProjectTravelNotesService;
|
|
|
+ @Autowired
|
|
|
+ private TourTravelNotesProjectRelationService tourTravelNotesProjectRelationService;
|
|
|
|
|
|
/**
|
|
|
* 新增旅游项目游记管理数据,及其关联的从表数据。
|
|
@@ -323,6 +326,15 @@ public class TourTourismProjectTravelNotesController {
|
|
|
public ResponseResult<Void> addTourTravelNotesProjectRelation(
|
|
|
@MyRequestBody Long travelNotesId,
|
|
|
@MyRequestBody List<TourTravelNotesProjectRelationDto> tourTravelNotesProjectRelationDtoList) {
|
|
|
+
|
|
|
+ //先验证绑定的项目是否超过三个
|
|
|
+ TourTravelNotesProjectRelation tourTravelNotesProjectRelation =
|
|
|
+ new TourTravelNotesProjectRelation();
|
|
|
+ tourTravelNotesProjectRelation.setTravelNotesId(travelNotesId);
|
|
|
+ long countByFilter = tourTravelNotesProjectRelationService.getCountByFilter(tourTravelNotesProjectRelation);
|
|
|
+ if(countByFilter>=3){
|
|
|
+ return ResponseResult.error(ErrorCodeEnum.DUPLICATED_UNIQUE_KEY,"游记最多绑定三个项目,请先移除绑定项目");
|
|
|
+ }
|
|
|
if (MyCommonUtil.existBlankArgument(travelNotesId, tourTravelNotesProjectRelationDtoList)) {
|
|
|
return ResponseResult.error(ErrorCodeEnum.ARGUMENT_NULL_EXIST);
|
|
|
}
|