|
@@ -0,0 +1,193 @@
|
|
|
+package org.jeecg.modules.adweb.controller;
|
|
|
+
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
+import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
+import io.swagger.v3.oas.annotations.Operation;
|
|
|
+import io.swagger.v3.oas.annotations.tags.Tag;
|
|
|
+import jakarta.servlet.http.HttpServletRequest;
|
|
|
+import jakarta.servlet.http.HttpServletResponse;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.jeecg.common.api.vo.Result;
|
|
|
+import org.jeecg.common.aspect.annotation.AutoLog;
|
|
|
+import org.jeecg.common.system.base.controller.JeecgController;
|
|
|
+import org.jeecg.common.system.query.QueryGenerator;
|
|
|
+import org.jeecg.modules.adweb.materialcollect.entity.AdwebMaterialCheck;
|
|
|
+import org.jeecg.modules.adweb.entity.SeoMarketPlan;
|
|
|
+import org.jeecg.modules.adweb.materialcollect.service.IAdwebMaterialCheckService;
|
|
|
+import org.jeecg.modules.adweb.service.ISeoMarketPlanService;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+import org.springframework.web.servlet.ModelAndView;
|
|
|
+
|
|
|
+import java.util.Arrays;
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+/**
|
|
|
+ * @Description: 网站营销方案套餐表
|
|
|
+ * @Author: jeecg-boot
|
|
|
+ * @Date: 2024-09-27
|
|
|
+ * @Version: V1.0
|
|
|
+ */
|
|
|
+@Tag(name="网站营销方案套餐表")
|
|
|
+@RestController
|
|
|
+@RequestMapping("/adweb/seoMarketPlan")
|
|
|
+@Slf4j
|
|
|
+public class SeoMarketPlanController extends JeecgController<SeoMarketPlan, ISeoMarketPlanService> {
|
|
|
+ @Autowired
|
|
|
+ private ISeoMarketPlanService seoMarketPlanService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private IAdwebMaterialCheckService checkService;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 分页列表查询
|
|
|
+ *
|
|
|
+ * @param seoMarketPlan
|
|
|
+ * @param pageNo
|
|
|
+ * @param pageSize
|
|
|
+ * @param req
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ //@AutoLog(value = "网站营销方案套餐表-分页列表查询")
|
|
|
+ @Operation(summary="网站营销方案套餐表-分页列表查询")
|
|
|
+ @GetMapping(value = "/list")
|
|
|
+ public Result<IPage<SeoMarketPlan>> queryPageList(SeoMarketPlan seoMarketPlan,
|
|
|
+ @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
|
|
+ @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
|
|
+ HttpServletRequest req) {
|
|
|
+ QueryWrapper<SeoMarketPlan> queryWrapper = QueryGenerator.initQueryWrapper(seoMarketPlan, req.getParameterMap());
|
|
|
+ Page<SeoMarketPlan> page = new Page<SeoMarketPlan>(pageNo, pageSize);
|
|
|
+ IPage<SeoMarketPlan> pageList = seoMarketPlanService.page(page, queryWrapper);
|
|
|
+ return Result.OK(pageList);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 添加
|
|
|
+ *
|
|
|
+ * @param seoMarketPlan
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @AutoLog(value = "网站营销方案套餐表-添加")
|
|
|
+ @Operation(summary="网站营销方案套餐表-添加")
|
|
|
+ @PreAuthorize("@jps.requiresPermissions('adweb:seo_market_plan:add')")
|
|
|
+ @PostMapping(value = "/add")
|
|
|
+ public Result<String> add(@RequestBody SeoMarketPlan seoMarketPlan) {
|
|
|
+ seoMarketPlanService.save(seoMarketPlan);
|
|
|
+ return Result.OK("添加成功!");
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 编辑
|
|
|
+ *
|
|
|
+ * @param seoMarketPlan
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @AutoLog(value = "网站营销方案套餐表-编辑")
|
|
|
+ @Operation(summary="网站营销方案套餐表-编辑")
|
|
|
+ @PreAuthorize("@jps.requiresPermissions('adweb:seo_market_plan:edit')")
|
|
|
+ @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
|
|
+ public Result<String> edit(@RequestBody SeoMarketPlan seoMarketPlan) {
|
|
|
+ seoMarketPlanService.updateById(seoMarketPlan);
|
|
|
+ return Result.OK("编辑成功!");
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 通过id删除
|
|
|
+ *
|
|
|
+ * @param id
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @AutoLog(value = "网站营销方案套餐表-通过id删除")
|
|
|
+ @Operation(summary="网站营销方案套餐表-通过id删除")
|
|
|
+ @PreAuthorize("@jps.requiresPermissions('adweb:seo_market_plan:delete')")
|
|
|
+ @DeleteMapping(value = "/delete")
|
|
|
+ public Result<String> delete(@RequestParam(name="id",required=true) String id) {
|
|
|
+ seoMarketPlanService.removeById(id);
|
|
|
+ return Result.OK("删除成功!");
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 批量删除
|
|
|
+ *
|
|
|
+ * @param ids
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @AutoLog(value = "网站营销方案套餐表-批量删除")
|
|
|
+ @Operation(summary="网站营销方案套餐表-批量删除")
|
|
|
+ @PreAuthorize("@jps.requiresPermissions('adweb:seo_market_plan:deleteBatch')")
|
|
|
+ @DeleteMapping(value = "/deleteBatch")
|
|
|
+ public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
|
|
+ this.seoMarketPlanService.removeByIds(Arrays.asList(ids.split(",")));
|
|
|
+ return Result.OK("批量删除成功!");
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 通过id查询
|
|
|
+ *
|
|
|
+ * @param id
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ //@AutoLog(value = "网站营销方案套餐表-通过id查询")
|
|
|
+ @Operation(summary="网站营销方案套餐表-通过id查询")
|
|
|
+ @GetMapping(value = "/queryById")
|
|
|
+ public Result<SeoMarketPlan> queryById(@RequestParam(name="id",required=true) String id) {
|
|
|
+ SeoMarketPlan seoMarketPlan = seoMarketPlanService.getById(id);
|
|
|
+ if(seoMarketPlan==null) {
|
|
|
+ return Result.error("未找到对应数据");
|
|
|
+ }
|
|
|
+ return Result.OK(seoMarketPlan);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 导出excel
|
|
|
+ *
|
|
|
+ * @param request
|
|
|
+ * @param seoMarketPlan
|
|
|
+ */
|
|
|
+ @PreAuthorize("@jps.requiresPermissions('adweb:seo_market_plan:exportXls')")
|
|
|
+ @RequestMapping(value = "/exportXls")
|
|
|
+ public ModelAndView exportXls(HttpServletRequest request, SeoMarketPlan seoMarketPlan) {
|
|
|
+ return super.exportXls(request, seoMarketPlan, SeoMarketPlan.class, "网站营销方案套餐表");
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 通过excel导入数据
|
|
|
+ *
|
|
|
+ * @param request
|
|
|
+ * @param response
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @PreAuthorize("@jps.requiresPermissions('adweb:seo_market_plan:importExcel')")
|
|
|
+ @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
|
|
+ public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
|
|
+ return super.importExcel(request, response, SeoMarketPlan.class);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 物料完整性检测模板设置
|
|
|
+ *
|
|
|
+ * @Author:yangjingwen
|
|
|
+ * @Date:2022/5/7
|
|
|
+ */
|
|
|
+ @GetMapping(value="/integrityChecking")
|
|
|
+ public Result<?> integrityChecking(String planId){
|
|
|
+ QueryWrapper<AdwebMaterialCheck> queryWrapper=new QueryWrapper<>();
|
|
|
+ queryWrapper.eq("plan_id",planId).orderByAsc("sort");
|
|
|
+ List<AdwebMaterialCheck> checkList = checkService.list(queryWrapper);
|
|
|
+ if(!checkList.isEmpty()){
|
|
|
+ return Result.OK(checkList);
|
|
|
+ }
|
|
|
+ //查出模板数据
|
|
|
+ QueryWrapper<AdwebMaterialCheck> queryWrapper1 = new QueryWrapper<>();
|
|
|
+ queryWrapper1.isNull("plan_id").orderByAsc("sort");
|
|
|
+ List<AdwebMaterialCheck> checkTemplateList = checkService.list(queryWrapper1);
|
|
|
+ checkTemplateList.forEach(check -> {
|
|
|
+ check.setPlanId(planId);
|
|
|
+ });
|
|
|
+ checkService.saveBatch(checkTemplateList);
|
|
|
+ return Result.OK(checkTemplateList);
|
|
|
+ }
|
|
|
+
|
|
|
+}
|