Merge remote-tracking branch 'origin/test' into test

This commit is contained in:
2025-12-18 17:58:42 +08:00
2 changed files with 5 additions and 1 deletions

View File

@@ -11,6 +11,7 @@ import com.czg.validator.group.InsertGroup;
import com.czg.validator.group.UpdateGroup;
import com.mybatisflex.core.paginate.Page;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
@@ -20,6 +21,7 @@ import org.springframework.web.bind.annotation.*;
* @author yjjie
* @date 2025/12/18 11:18
*/
@Slf4j
@RestController
@RequestMapping("/admin/package")
public class PpPackageController {
@@ -93,9 +95,11 @@ public class PpPackageController {
@PutMapping("/switch")
@SaAdminCheckPermission(parentName = "套餐推广", value = "market:package:updateSwitch", name = "修改套餐推广开关")
public CzgResult<Boolean> updatePackagePromotionSwitch(@RequestBody JSONObject param) {
log.info("修改套餐推广开关: {}", param);
AssertUtil.isNull(param, "参数错误");
Integer status = param.getInteger("status");
AssertUtil.isNull(status, "参数错误");
log.info("修改套餐推广开关 status == {}", status);
return CzgResult.success(ppPackageService.updatePackagePromotionSwitch(status));
}
}

View File

@@ -63,7 +63,7 @@ public class PpPackageServiceImpl extends ServiceImpl<PpPackageMapper, PpPackage
Long shopId = StpKit.USER.getShopId();
ShopConfig shopConfig = new ShopConfig();
shopConfig.setIsPackagePromotion(status);
boolean update = shopConfigService.update(shopConfig, query().eq(ShopConfig::getId, shopId));
boolean update = shopConfigService.update(shopConfig, QueryWrapper.create().eq(ShopConfig::getId, shopId));
if (update && status == 0) {
// 下架所有进行中的套餐订单
UpdateChain.of(PpPackage.class)