Merge remote-tracking branch 'origin/main'

This commit is contained in:
Jack 2025-12-12 17:03:50 +08:00
commit 8cdc88e00a
4 changed files with 44 additions and 2 deletions

View File

@ -83,6 +83,7 @@ public class ShopPageAppController extends BaseControllerImpl {
if(user.isStore()) {
QueryWrapper<ShopPageApp> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("store_id", user.getStore_id());
queryWrapper.orderByDesc("app_id");
List<ShopPageApp> shopPageAppList= shopPageAppService.list(queryWrapper);
if(shopPageAppList.isEmpty()) {
String resultStr= accountBaseConfigService.getSystemConfig("service_app_tpl");
@ -132,6 +133,7 @@ public class ShopPageAppController extends BaseControllerImpl {
}else {
if (is_use==1&&(shopStoreInfo.getStore_template().equals(tpl_label))) {
current_tpl = item;
it.remove();
}
}
} else {
@ -553,5 +555,18 @@ public class ShopPageAppController extends BaseControllerImpl {
return shopPageAppService.deletePageApp(appId);
}
/**
* 创建空白模板
* @param appName 模板名称
* @param appIndustry 行业
* @return
*/
@ApiOperation(value = "店铺风格表-创建空白模板", notes = "店铺风格表-创建空白模板")
@RequestMapping(value = "/createBlankPageApp", method = RequestMethod.POST)
public CommonResult createBlankPageApp(@RequestParam(name = "appName") String appName,
@RequestParam(name = "appIndustry",required = false,defaultValue = "0") String appIndustry) {
return shopPageAppService.createBlankPageApp(appName,appIndustry);
}
}

View File

@ -60,4 +60,6 @@ public interface ShopPageAppService extends IBaseService<ShopPageApp> {
CommonResult copyDiyByAppId(Integer appId,String newAppName,String appIndustry);
CommonResult deletePageApp(Integer appId);
CommonResult createBlankPageApp(String appName,String appIndustry);
}

View File

@ -1107,6 +1107,32 @@ public class ShopPageAppServiceImpl extends BaseServiceImpl<ShopPageAppMapper, S
return CommonResult.success();
}
@Override
public CommonResult createBlankPageApp(String appName,String appIndustry) {
UserDto userDto= ContextUtil.getCurrentUser();
if (userDto == null) {
throw new ApiException("用户未登录");
}
if(userDto.getRole_id()==0){
throw new ApiException("用户无权限");
}
ShopPageApp shopPageApp = new ShopPageApp();
shopPageApp.setApp_name(appName);
shopPageApp.setApp_code("[]");
shopPageApp.setTpl_id(107);
shopPageApp.setTpl_image("");
shopPageApp.setStore_id(Integer.valueOf(userDto.getStore_id()));
shopPageApp.setUser_id(userDto.getId());
shopPageApp.setSubsite_id(0);
shopPageApp.setApp_buildin(0);
shopPageApp.setApp_type(3);
shopPageApp.setApp_tpl("");
shopPageApp.setApp_member_center("");
shopPageApp.setApp_industry(appIndustry);
shopPageAppService.save(shopPageApp);
return CommonResult.success();
}
/**
* 生产新的id
@ -1121,6 +1147,4 @@ public class ShopPageAppServiceImpl extends BaseServiceImpl<ShopPageAppMapper, S
}
return resultMap;
}
}

View File

@ -0,0 +1 @@
INSERT INTO `admin_base_protocol` (`ctl`, `met`, `db`, `rights_id`, `log`, `path`,`comment`) VALUES ('/admin/shop/shop-page-app/createBlankPageApp', 'index', 'master', '', '0', '/admin/shop/shop-page-app/createBlankPageApp','创建diy空白模板');