|
|
@@ -7,10 +7,12 @@ import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
import shop.alien.entity.result.R;
|
|
|
import shop.alien.entity.store.StoreImg;
|
|
|
+import shop.alien.entity.store.StoreOfficialAlbum;
|
|
|
import shop.alien.entity.store.vo.StoreImgInfoVo;
|
|
|
import shop.alien.entity.store.vo.StoreImgTypeVo;
|
|
|
import shop.alien.store.service.StoreImgService;
|
|
|
import shop.alien.store.service.StoreInfoService;
|
|
|
+import shop.alien.store.service.StoreOfficialAlbumService;
|
|
|
import shop.alien.store.util.GroupConstant;
|
|
|
|
|
|
import java.util.List;
|
|
|
@@ -31,7 +33,7 @@ import java.util.List;
|
|
|
public class StoreImgController {
|
|
|
private final StoreImgService storeImgService;
|
|
|
private final StoreInfoService storeInfoService;
|
|
|
-
|
|
|
+ private final StoreOfficialAlbumService storeOfficialAlbumService;
|
|
|
@ApiOperation("获取图片")
|
|
|
@ApiOperationSupport(order = 1)
|
|
|
@ApiImplicitParams({@ApiImplicitParam(name = "storeId", value = "门店id", dataType = "Integer", paramType = "query", required = true),
|
|
|
@@ -79,7 +81,20 @@ public class StoreImgController {
|
|
|
// 判断是否是头图(20:单图模式, 21:多图模式)
|
|
|
Integer imgType = storeImgInfoVo.getImgType();
|
|
|
boolean isHeadImage = (imgType == 20 || imgType == 21);
|
|
|
-
|
|
|
+ if(imgType==4){
|
|
|
+ Integer storeId = storeImgInfoVo.getStoreId();
|
|
|
+ StoreOfficialAlbum album = storeOfficialAlbumService.lambdaQuery()
|
|
|
+ .eq(StoreOfficialAlbum::getStoreId, storeId).one();
|
|
|
+ if (null == album) {
|
|
|
+ return R.fail("没有默认环境相册");
|
|
|
+ }
|
|
|
+ storeImgList.forEach(storeImg -> storeImg.setBusinessId(album.getId()));
|
|
|
+ // 添加图片时 ,修改数量
|
|
|
+ storeOfficialAlbumService.lambdaUpdate()
|
|
|
+ .eq(StoreOfficialAlbum::getStoreId, storeId)
|
|
|
+ .setSql("img_count = img_count + " + storeImgList.size())
|
|
|
+ .update();
|
|
|
+ }
|
|
|
// 清空storeid,imgType下图片
|
|
|
int deleteCount = storeImgService.saveOrUpdateImg(storeImgInfoVo.getStoreId(),storeImgInfoVo.getImgType());
|
|
|
log.info("StoreImgController.updateStoreImgModeInfo?deleteCount={}", deleteCount);
|