diff --git a/src/main/java/com/gxwebsoft/cms/controller/AdController.java b/src/main/java/com/gxwebsoft/cms/controller/AdController.java index ce59be7..2ce1af2 100644 --- a/src/main/java/com/gxwebsoft/cms/controller/AdController.java +++ b/src/main/java/com/gxwebsoft/cms/controller/AdController.java @@ -1,17 +1,12 @@ package com.gxwebsoft.cms.controller; -import com.gxwebsoft.common.core.web.BaseController; -import com.gxwebsoft.cms.service.AdService; import com.gxwebsoft.cms.entity.Ad; import com.gxwebsoft.cms.param.AdParam; -import com.gxwebsoft.common.core.web.ApiResult; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.common.core.web.PageParam; -import com.gxwebsoft.common.core.web.BatchParam; +import com.gxwebsoft.cms.service.AdService; +import com.gxwebsoft.common.core.web.*; import com.gxwebsoft.common.system.entity.User; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; -import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; @@ -21,7 +16,7 @@ import java.util.List; * 广告位管理表控制器 * * @author 科技小王子 - * @since 2023-10-22 15:47:09 + * @since 2024-03-04 21:14:15 */ @Api(tags = "广告位管理表管理") @RestController @@ -33,11 +28,8 @@ public class AdController extends BaseController { @ApiOperation("分页查询广告位管理表") @GetMapping("/page") public ApiResult> page(AdParam param) { - PageParam page = new PageParam<>(param); - page.setDefaultOrder("create_time desc"); - return success(adService.page(page, page.getWrapper())); // 使用关联查询 - //return success(adService.pageRel(param)); + return success(adService.pageRel(param)); } @ApiOperation("查询全部广告位管理表") diff --git a/src/main/java/com/gxwebsoft/cms/controller/AdRecordController.java b/src/main/java/com/gxwebsoft/cms/controller/AdRecordController.java new file mode 100644 index 0000000..b12adf0 --- /dev/null +++ b/src/main/java/com/gxwebsoft/cms/controller/AdRecordController.java @@ -0,0 +1,106 @@ +package com.gxwebsoft.cms.controller; + +import com.gxwebsoft.cms.entity.AdRecord; +import com.gxwebsoft.cms.param.AdRecordParam; +import com.gxwebsoft.cms.service.AdRecordService; +import com.gxwebsoft.common.core.web.*; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.List; + +/** + * 广告图片记录表控制器 + * + * @author 科技小王子 + * @since 2024-03-04 21:14:15 + */ +@Api(tags = "广告图片记录表管理") +@RestController +@RequestMapping("/api/cms/ad-record") +public class AdRecordController extends BaseController { + @Resource + private AdRecordService adRecordService; + + @ApiOperation("分页查询广告图片记录表") + @GetMapping("/page") + public ApiResult> page(AdRecordParam param) { + // 使用关联查询 + return success(adRecordService.pageRel(param)); + } + + @ApiOperation("查询全部广告图片记录表") + @GetMapping() + public ApiResult> list(AdRecordParam param) { + PageParam page = new PageParam<>(param); + page.setDefaultOrder("create_time desc"); + return success(adRecordService.list(page.getOrderWrapper())); + // 使用关联查询 + //return success(adRecordService.listRel(param)); + } + + @ApiOperation("根据id查询广告图片记录表") + @GetMapping("/{id}") + public ApiResult get(@PathVariable("id") Integer id) { + return success(adRecordService.getById(id)); + // 使用关联查询 + //return success(adRecordService.getByIdRel(id)); + } + + @ApiOperation("添加广告图片记录表") + @PostMapping() + public ApiResult save(@RequestBody AdRecord adRecord) { + if (adRecordService.save(adRecord)) { + return success("添加成功"); + } + return fail("添加失败"); + } + + @ApiOperation("修改广告图片记录表") + @PutMapping() + public ApiResult update(@RequestBody AdRecord adRecord) { + if (adRecordService.updateById(adRecord)) { + return success("修改成功"); + } + return fail("修改失败"); + } + + @ApiOperation("删除广告图片记录表") + @DeleteMapping("/{id}") + public ApiResult remove(@PathVariable("id") Integer id) { + if (adRecordService.removeById(id)) { + return success("删除成功"); + } + return fail("删除失败"); + } + + @ApiOperation("批量添加广告图片记录表") + @PostMapping("/batch") + public ApiResult saveBatch(@RequestBody List list) { + if (adRecordService.saveBatch(list)) { + return success("添加成功"); + } + return fail("添加失败"); + } + + @ApiOperation("批量修改广告图片记录表") + @PutMapping("/batch") + public ApiResult removeBatch(@RequestBody BatchParam batchParam) { + if (batchParam.update(adRecordService, "ad_record_id")) { + return success("修改成功"); + } + return fail("修改失败"); + } + + @ApiOperation("批量删除广告图片记录表") + @DeleteMapping("/batch") + public ApiResult removeBatch(@RequestBody List ids) { + if (adRecordService.removeByIds(ids)) { + return success("删除成功"); + } + return fail("删除失败"); + } + +} diff --git a/src/main/java/com/gxwebsoft/cms/controller/DesignController.java b/src/main/java/com/gxwebsoft/cms/controller/DesignController.java new file mode 100644 index 0000000..f607bcf --- /dev/null +++ b/src/main/java/com/gxwebsoft/cms/controller/DesignController.java @@ -0,0 +1,112 @@ +package com.gxwebsoft.cms.controller; + +import com.gxwebsoft.cms.entity.Design; +import com.gxwebsoft.cms.param.DesignParam; +import com.gxwebsoft.cms.service.DesignService; +import com.gxwebsoft.common.core.web.*; +import com.gxwebsoft.common.system.entity.User; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.List; + +/** + * 页面管理记录表控制器 + * + * @author 科技小王子 + * @since 2024-03-04 21:20:40 + */ +@Api(tags = "页面管理记录表管理") +@RestController +@RequestMapping("/api/cms/design") +public class DesignController extends BaseController { + @Resource + private DesignService designService; + + @ApiOperation("分页查询页面管理记录表") + @GetMapping("/page") + public ApiResult> page(DesignParam param) { + // 使用关联查询 + return success(designService.pageRel(param)); + } + + @ApiOperation("查询全部页面管理记录表") + @GetMapping() + public ApiResult> list(DesignParam param) { + PageParam page = new PageParam<>(param); + page.setDefaultOrder("create_time desc"); + return success(designService.list(page.getOrderWrapper())); + // 使用关联查询 + //return success(designService.listRel(param)); + } + + @ApiOperation("根据id查询页面管理记录表") + @GetMapping("/{id}") + public ApiResult get(@PathVariable("id") Integer id) { + return success(designService.getById(id)); + // 使用关联查询 + //return success(designService.getByIdRel(id)); + } + + @ApiOperation("添加页面管理记录表") + @PostMapping() + public ApiResult save(@RequestBody Design design) { + // 记录当前登录用户id + User loginUser = getLoginUser(); + if (loginUser != null) { + design.setUserId(loginUser.getUserId()); + } + if (designService.save(design)) { + return success("添加成功"); + } + return fail("添加失败"); + } + + @ApiOperation("修改页面管理记录表") + @PutMapping() + public ApiResult update(@RequestBody Design design) { + if (designService.updateById(design)) { + return success("修改成功"); + } + return fail("修改失败"); + } + + @ApiOperation("删除页面管理记录表") + @DeleteMapping("/{id}") + public ApiResult remove(@PathVariable("id") Integer id) { + if (designService.removeById(id)) { + return success("删除成功"); + } + return fail("删除失败"); + } + + @ApiOperation("批量添加页面管理记录表") + @PostMapping("/batch") + public ApiResult saveBatch(@RequestBody List list) { + if (designService.saveBatch(list)) { + return success("添加成功"); + } + return fail("添加失败"); + } + + @ApiOperation("批量修改页面管理记录表") + @PutMapping("/batch") + public ApiResult removeBatch(@RequestBody BatchParam batchParam) { + if (batchParam.update(designService, "page_id")) { + return success("修改成功"); + } + return fail("修改失败"); + } + + @ApiOperation("批量删除页面管理记录表") + @DeleteMapping("/batch") + public ApiResult removeBatch(@RequestBody List ids) { + if (designService.removeByIds(ids)) { + return success("删除成功"); + } + return fail("删除失败"); + } + +} diff --git a/src/main/java/com/gxwebsoft/cms/controller/DesignRecordController.java b/src/main/java/com/gxwebsoft/cms/controller/DesignRecordController.java new file mode 100644 index 0000000..94b88b2 --- /dev/null +++ b/src/main/java/com/gxwebsoft/cms/controller/DesignRecordController.java @@ -0,0 +1,112 @@ +package com.gxwebsoft.cms.controller; + +import com.gxwebsoft.cms.entity.DesignRecord; +import com.gxwebsoft.cms.param.DesignRecordParam; +import com.gxwebsoft.cms.service.DesignRecordService; +import com.gxwebsoft.common.core.web.*; +import com.gxwebsoft.common.system.entity.User; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.List; + +/** + * 页面组件表控制器 + * + * @author 科技小王子 + * @since 2024-03-04 21:20:40 + */ +@Api(tags = "页面组件表管理") +@RestController +@RequestMapping("/api/cms/design-record") +public class DesignRecordController extends BaseController { + @Resource + private DesignRecordService designRecordService; + + @ApiOperation("分页查询页面组件表") + @GetMapping("/page") + public ApiResult> page(DesignRecordParam param) { + // 使用关联查询 + return success(designRecordService.pageRel(param)); + } + + @ApiOperation("查询全部页面组件表") + @GetMapping() + public ApiResult> list(DesignRecordParam param) { + PageParam page = new PageParam<>(param); + page.setDefaultOrder("create_time desc"); + return success(designRecordService.list(page.getOrderWrapper())); + // 使用关联查询 + //return success(designRecordService.listRel(param)); + } + + @ApiOperation("根据id查询页面组件表") + @GetMapping("/{id}") + public ApiResult get(@PathVariable("id") Integer id) { + return success(designRecordService.getById(id)); + // 使用关联查询 + //return success(designRecordService.getByIdRel(id)); + } + + @ApiOperation("添加页面组件表") + @PostMapping() + public ApiResult save(@RequestBody DesignRecord designRecord) { + // 记录当前登录用户id + User loginUser = getLoginUser(); + if (loginUser != null) { + designRecord.setUserId(loginUser.getUserId()); + } + if (designRecordService.save(designRecord)) { + return success("添加成功"); + } + return fail("添加失败"); + } + + @ApiOperation("修改页面组件表") + @PutMapping() + public ApiResult update(@RequestBody DesignRecord designRecord) { + if (designRecordService.updateById(designRecord)) { + return success("修改成功"); + } + return fail("修改失败"); + } + + @ApiOperation("删除页面组件表") + @DeleteMapping("/{id}") + public ApiResult remove(@PathVariable("id") Integer id) { + if (designRecordService.removeById(id)) { + return success("删除成功"); + } + return fail("删除失败"); + } + + @ApiOperation("批量添加页面组件表") + @PostMapping("/batch") + public ApiResult saveBatch(@RequestBody List list) { + if (designRecordService.saveBatch(list)) { + return success("添加成功"); + } + return fail("添加失败"); + } + + @ApiOperation("批量修改页面组件表") + @PutMapping("/batch") + public ApiResult removeBatch(@RequestBody BatchParam batchParam) { + if (batchParam.update(designRecordService, "page_id")) { + return success("修改成功"); + } + return fail("修改失败"); + } + + @ApiOperation("批量删除页面组件表") + @DeleteMapping("/batch") + public ApiResult removeBatch(@RequestBody List ids) { + if (designRecordService.removeByIds(ids)) { + return success("删除成功"); + } + return fail("删除失败"); + } + +} diff --git a/src/main/java/com/gxwebsoft/cms/controller/NavigationController.java b/src/main/java/com/gxwebsoft/cms/controller/NavigationController.java new file mode 100644 index 0000000..3bfdd54 --- /dev/null +++ b/src/main/java/com/gxwebsoft/cms/controller/NavigationController.java @@ -0,0 +1,109 @@ +package com.gxwebsoft.cms.controller; + +import com.gxwebsoft.cms.entity.Navigation; +import com.gxwebsoft.cms.param.NavigationParam; +import com.gxwebsoft.cms.service.NavigationService; +import com.gxwebsoft.common.core.web.*; +import com.gxwebsoft.common.system.entity.User; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.List; + +/** + * 网站导航记录表控制器 + * + * @author 科技小王子 + * @since 2024-03-04 21:27:55 + */ +@Api(tags = "网站导航记录表管理") +@RestController +@RequestMapping("/api/cms/navigation") +public class NavigationController extends BaseController { + @Resource + private NavigationService navigationService; + + @ApiOperation("分页查询网站导航记录表") + @GetMapping("/page") + public ApiResult> page(NavigationParam param) { + // 使用关联查询 + return success(navigationService.pageRel(param)); + } + + @ApiOperation("查询全部网站导航记录表") + @GetMapping() + public ApiResult> list(NavigationParam param) { + // 使用关联查询 + return success(navigationService.listRel(param)); + } + + @ApiOperation("根据id查询网站导航记录表") + @GetMapping("/{id}") + public ApiResult get(@PathVariable("id") Integer id) { + return success(navigationService.getById(id)); + // 使用关联查询 + //return success(navigationService.getByIdRel(id)); + } + + @ApiOperation("添加网站导航记录表") + @PostMapping() + public ApiResult save(@RequestBody Navigation navigation) { + // 记录当前登录用户id + User loginUser = getLoginUser(); + if (loginUser != null) { + navigation.setUserId(loginUser.getUserId()); + } + if (navigationService.save(navigation)) { + return success("添加成功"); + } + return fail("添加失败"); + } + + @ApiOperation("修改网站导航记录表") + @PutMapping() + public ApiResult update(@RequestBody Navigation navigation) { + if (navigationService.updateById(navigation)) { + return success("修改成功"); + } + return fail("修改失败"); + } + + @ApiOperation("删除网站导航记录表") + @DeleteMapping("/{id}") + public ApiResult remove(@PathVariable("id") Integer id) { + if (navigationService.removeById(id)) { + return success("删除成功"); + } + return fail("删除失败"); + } + + @ApiOperation("批量添加网站导航记录表") + @PostMapping("/batch") + public ApiResult saveBatch(@RequestBody List list) { + if (navigationService.saveBatch(list)) { + return success("添加成功"); + } + return fail("添加失败"); + } + + @ApiOperation("批量修改网站导航记录表") + @PutMapping("/batch") + public ApiResult removeBatch(@RequestBody BatchParam batchParam) { + if (batchParam.update(navigationService, "navigation_id")) { + return success("修改成功"); + } + return fail("修改失败"); + } + + @ApiOperation("批量删除网站导航记录表") + @DeleteMapping("/batch") + public ApiResult removeBatch(@RequestBody List ids) { + if (navigationService.removeByIds(ids)) { + return success("删除成功"); + } + return fail("删除失败"); + } + +} diff --git a/src/main/java/com/gxwebsoft/cms/controller/WebsiteController.java b/src/main/java/com/gxwebsoft/cms/controller/WebsiteController.java new file mode 100644 index 0000000..1f1cd20 --- /dev/null +++ b/src/main/java/com/gxwebsoft/cms/controller/WebsiteController.java @@ -0,0 +1,162 @@ +package com.gxwebsoft.cms.controller; + +import cn.hutool.http.HttpRequest; +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.gxwebsoft.cms.entity.Website; +import com.gxwebsoft.cms.entity.WebsiteField; +import com.gxwebsoft.cms.param.WebsiteParam; +import com.gxwebsoft.cms.service.WebsiteFieldService; +import com.gxwebsoft.cms.service.WebsiteService; +import com.gxwebsoft.common.core.security.JwtUtil; +import com.gxwebsoft.common.core.web.*; +import com.gxwebsoft.common.system.entity.User; +import com.gxwebsoft.oa.entity.Company; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.util.CollectionUtils; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.util.List; + +/** + * 网站信息记录表控制器 + * + * @author 科技小王子 + * @since 2024-03-04 21:14:15 + */ +@Api(tags = "网站信息记录表管理") +@RestController +@RequestMapping("/api/cms/website") +public class WebsiteController extends BaseController { + @Resource + private WebsiteService websiteService; + @Resource + private WebsiteFieldService websiteFieldService; + + @ApiOperation("分页查询网站信息记录表") + @GetMapping("/page") + public ApiResult> page(WebsiteParam param) { + // 使用关联查询 + return success(websiteService.pageRel(param)); + } + + @ApiOperation("查询全部网站信息记录表") + @GetMapping() + public ApiResult> list(WebsiteParam param) { + PageParam page = new PageParam<>(param); + page.setDefaultOrder("create_time desc"); + return success(websiteService.list(page.getOrderWrapper())); + // 使用关联查询 + //return success(websiteService.listRel(param)); + } + + @ApiOperation("根据id查询网站信息记录表") + @GetMapping("/{id}") + public ApiResult get(@PathVariable("id") Integer id, HttpServletRequest request) { + final Integer tenantId = getTenantId(); + List list = websiteService.list(new LambdaQueryWrapper().eq(Website::getTenantId, tenantId)); + if (CollectionUtils.isEmpty(list)) { + // 请求主服务器获取租户信息 + String access_token = JwtUtil.getAccessToken(request); + // 链式构建请求 + String result = HttpRequest.get("https://server.gxwebsoft.com/api/auth/tenant") + .header("Authorization", access_token) + .header("Tenantid", tenantId.toString()) + .timeout(20000)//超时,毫秒 + .execute().body(); + + JSONObject jsonObject = JSONObject.parseObject(result); + System.out.println("jsonObject = " + jsonObject); + final String data = jsonObject.getString("data"); + System.out.println("data = " + data); + final Company company = JSONObject.parseObject(data, Company.class); + System.out.println("company = " + company); + final Website website = new Website(); + website.setTenantId(company.getTenantId()); + website.setWebsiteName(company.getShortName()); + website.setWebsiteLogo(company.getCompanyLogo()); + website.setWebsiteIcon("/favicon.ico"); + website.setWebsiteType("企业官网"); + website.setDomain(company.getDomain()); + website.setExpirationTime(company.getExpirationTime()); + website.setIndustryParent(company.getIndustryParent()); + website.setIndustryChild(company.getIndustryChild()); + website.setCompanyId(company.getCompanyId()); + website.setAddress(company.getAddress()); + website.setComments(company.getComments()); + website.setKeywords(company.getCompanyName()); + website.setUserId(company.getUserId()); + websiteService.save(website); + List websites = websiteService.list(new LambdaQueryWrapper().eq(Website::getTenantId, getTenantId())); + final Website website1 = websites.get(0); + website1.setFields(websiteFieldService.list(new LambdaQueryWrapper().eq(WebsiteField::getWebsiteId,website1.getWebsiteId()))); + return success(website1); + } + final Website website = list.get(0); + website.setFields(websiteFieldService.list(new LambdaQueryWrapper().eq(WebsiteField::getWebsiteId,website.getWebsiteId()))); + return success(website); + } + + @ApiOperation("添加网站信息记录表") + @PostMapping() + public ApiResult save(@RequestBody Website website) { + // 记录当前登录用户id + User loginUser = getLoginUser(); + if (loginUser != null) { + website.setUserId(loginUser.getUserId()); + } + if (websiteService.save(website)) { + return success("添加成功"); + } + return fail("添加失败"); + } + + @ApiOperation("修改网站信息记录表") + @PutMapping() + public ApiResult update(@RequestBody Website website) { + if (websiteService.updateById(website)) { + return success("修改成功"); + } + return fail("修改失败"); + } + + @ApiOperation("删除网站信息记录表") + @DeleteMapping("/{id}") + public ApiResult remove(@PathVariable("id") Integer id) { + if (websiteService.removeById(id)) { + return success("删除成功"); + } + return fail("删除失败"); + } + + @ApiOperation("批量添加网站信息记录表") + @PostMapping("/batch") + public ApiResult saveBatch(@RequestBody List list) { + if (websiteService.saveBatch(list)) { + return success("添加成功"); + } + return fail("添加失败"); + } + + @ApiOperation("批量修改网站信息记录表") + @PutMapping("/batch") + public ApiResult removeBatch(@RequestBody BatchParam batchParam) { + if (batchParam.update(websiteService, "website_id")) { + return success("修改成功"); + } + return fail("修改失败"); + } + + @ApiOperation("批量删除网站信息记录表") + @DeleteMapping("/batch") + public ApiResult removeBatch(@RequestBody List ids) { + if (websiteService.removeByIds(ids)) { + return success("删除成功"); + } + return fail("删除失败"); + } + +} diff --git a/src/main/java/com/gxwebsoft/cms/controller/WebsiteFieldController.java b/src/main/java/com/gxwebsoft/cms/controller/WebsiteFieldController.java new file mode 100644 index 0000000..0a3ac6e --- /dev/null +++ b/src/main/java/com/gxwebsoft/cms/controller/WebsiteFieldController.java @@ -0,0 +1,116 @@ +package com.gxwebsoft.cms.controller; + +import com.gxwebsoft.cms.entity.WebsiteField; +import com.gxwebsoft.cms.param.WebsiteFieldParam; +import com.gxwebsoft.cms.service.WebsiteFieldService; +import com.gxwebsoft.common.core.web.*; +import com.gxwebsoft.common.system.entity.User; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.List; + +/** + * 应用参数控制器 + * + * @author 科技小王子 + * @since 2024-03-05 15:53:44 + */ +@Api(tags = "应用参数管理") +@RestController +@RequestMapping("/api/cms/website-field") +public class WebsiteFieldController extends BaseController { + @Resource + private WebsiteFieldService websiteFieldService; + + @ApiOperation("分页查询应用参数") + @GetMapping("/page") + public ApiResult> page(WebsiteFieldParam param) { + PageParam page = new PageParam<>(param); + page.setDefaultOrder("sort_number desc"); + page.setDefaultOrder("create_time desc"); + return success(websiteFieldService.page(page, page.getWrapper())); + // 使用关联查询 + //return success(websiteFieldService.pageRel(param)); + } + + @ApiOperation("查询全部应用参数") + @GetMapping() + public ApiResult> list(WebsiteFieldParam param) { + PageParam page = new PageParam<>(param); + page.setDefaultOrder("create_time desc"); + return success(websiteFieldService.list(page.getOrderWrapper())); + // 使用关联查询 + //return success(websiteFieldService.listRel(param)); + } + + @ApiOperation("根据id查询应用参数") + @GetMapping("/{id}") + public ApiResult get(@PathVariable("id") Integer id) { + return success(websiteFieldService.getById(id)); + // 使用关联查询 + //return success(websiteFieldService.getByIdRel(id)); + } + + @ApiOperation("添加应用参数") + @PostMapping() + public ApiResult save(@RequestBody WebsiteField websiteField) { + // 记录当前登录用户id + User loginUser = getLoginUser(); + if (loginUser != null) { + websiteField.setUserId(loginUser.getUserId()); + } + if (websiteFieldService.save(websiteField)) { + return success("添加成功"); + } + return fail("添加失败"); + } + + @ApiOperation("修改应用参数") + @PutMapping() + public ApiResult update(@RequestBody WebsiteField websiteField) { + if (websiteFieldService.updateById(websiteField)) { + return success("修改成功"); + } + return fail("修改失败"); + } + + @ApiOperation("删除应用参数") + @DeleteMapping("/{id}") + public ApiResult remove(@PathVariable("id") Integer id) { + if (websiteFieldService.removeById(id)) { + return success("删除成功"); + } + return fail("删除失败"); + } + + @ApiOperation("批量添加应用参数") + @PostMapping("/batch") + public ApiResult saveBatch(@RequestBody List list) { + if (websiteFieldService.saveBatch(list)) { + return success("添加成功"); + } + return fail("添加失败"); + } + + @ApiOperation("批量修改应用参数") + @PutMapping("/batch") + public ApiResult removeBatch(@RequestBody BatchParam batchParam) { + if (batchParam.update(websiteFieldService, "id")) { + return success("修改成功"); + } + return fail("修改失败"); + } + + @ApiOperation("批量删除应用参数") + @DeleteMapping("/batch") + public ApiResult removeBatch(@RequestBody List ids) { + if (websiteFieldService.removeByIds(ids)) { + return success("删除成功"); + } + return fail("删除失败"); + } + +} diff --git a/src/main/java/com/gxwebsoft/cms/entity/Ad.java b/src/main/java/com/gxwebsoft/cms/entity/Ad.java index 4962509..74ab364 100644 --- a/src/main/java/com/gxwebsoft/cms/entity/Ad.java +++ b/src/main/java/com/gxwebsoft/cms/entity/Ad.java @@ -1,22 +1,21 @@ package com.gxwebsoft.cms.entity; -import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; -import java.time.LocalDateTime; -import java.io.Serializable; -import java.util.Date; - +import com.baomidou.mybatisplus.annotation.TableName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; +import java.io.Serializable; +import java.util.Date; + /** * 广告位管理表 * * @author 科技小王子 - * @since 2023-10-22 15:47:09 + * @since 2024-03-04 21:14:15 */ @Data @EqualsAndHashCode(callSuper = false) diff --git a/src/main/java/com/gxwebsoft/cms/entity/AdRecord.java b/src/main/java/com/gxwebsoft/cms/entity/AdRecord.java new file mode 100644 index 0000000..de6e8a4 --- /dev/null +++ b/src/main/java/com/gxwebsoft/cms/entity/AdRecord.java @@ -0,0 +1,58 @@ +package com.gxwebsoft.cms.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serializable; +import java.util.Date; + +/** + * 广告图片记录表 + * + * @author 科技小王子 + * @since 2024-03-04 21:14:15 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@ApiModel(value = "AdRecord对象", description = "广告图片记录表") +@TableName("cms_ad_record") +public class AdRecord implements Serializable { + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "ID") + @TableId(value = "ad_record_id", type = IdType.AUTO) + private Integer adRecordId; + + @ApiModelProperty(value = "广告标题") + private String title; + + @ApiModelProperty(value = "图片地址") + private String path; + + @ApiModelProperty(value = "链接地址") + private String url; + + @ApiModelProperty(value = "广告位ID") + private Integer adId; + + @ApiModelProperty(value = "排序(数字越小越靠前)") + private Integer sortNumber; + + @ApiModelProperty(value = "备注") + private String comments; + + @ApiModelProperty(value = "状态, 0正常, 1冻结") + private Integer status; + + @ApiModelProperty(value = "租户id") + private Integer tenantId; + + @ApiModelProperty(value = "注册时间") + private Date createTime; + +} diff --git a/src/main/java/com/gxwebsoft/cms/entity/Design.java b/src/main/java/com/gxwebsoft/cms/entity/Design.java new file mode 100644 index 0000000..af88e3d --- /dev/null +++ b/src/main/java/com/gxwebsoft/cms/entity/Design.java @@ -0,0 +1,67 @@ +package com.gxwebsoft.cms.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serializable; +import java.util.Date; + +/** + * 页面管理记录表 + * + * @author 科技小王子 + * @since 2024-03-04 21:20:40 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@ApiModel(value = "Design对象", description = "页面管理记录表") +@TableName("cms_design") +public class Design implements Serializable { + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "ID") + @TableId(value = "page_id", type = IdType.AUTO) + private Integer pageId; + + @ApiModelProperty(value = "上级id, 0是顶级") + private Integer parentId; + + @ApiModelProperty(value = "页面标题") + private String title; + + @ApiModelProperty(value = "页面关键词") + private String keywords; + + @ApiModelProperty(value = "页面描述") + private String description; + + @ApiModelProperty(value = "页面路由地址") + private String path; + + @ApiModelProperty(value = "缩列图") + private String photo; + + @ApiModelProperty(value = "用户ID") + private Integer userId; + + @ApiModelProperty(value = "排序(数字越小越靠前)") + private Integer sortNumber; + + @ApiModelProperty(value = "备注") + private String comments; + + @ApiModelProperty(value = "状态, 0正常, 1冻结") + private Integer status; + + @ApiModelProperty(value = "租户id") + private Integer tenantId; + + @ApiModelProperty(value = "注册时间") + private Date createTime; + +} diff --git a/src/main/java/com/gxwebsoft/cms/entity/DesignRecord.java b/src/main/java/com/gxwebsoft/cms/entity/DesignRecord.java new file mode 100644 index 0000000..44b8a6f --- /dev/null +++ b/src/main/java/com/gxwebsoft/cms/entity/DesignRecord.java @@ -0,0 +1,67 @@ +package com.gxwebsoft.cms.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serializable; +import java.util.Date; + +/** + * 页面组件表 + * + * @author 科技小王子 + * @since 2024-03-04 21:20:40 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@ApiModel(value = "DesignRecord对象", description = "页面组件表") +@TableName("cms_design_record") +public class DesignRecord implements Serializable { + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "ID") + @TableId(value = "page_id", type = IdType.AUTO) + private Integer pageId; + + @ApiModelProperty(value = "上级id, 0是顶级") + private Integer parentId; + + @ApiModelProperty(value = "页面标题") + private String title; + + @ApiModelProperty(value = "页面关键词") + private String keywords; + + @ApiModelProperty(value = "页面描述") + private String description; + + @ApiModelProperty(value = "页面路由地址") + private String path; + + @ApiModelProperty(value = "缩列图") + private String photo; + + @ApiModelProperty(value = "用户ID") + private Integer userId; + + @ApiModelProperty(value = "排序(数字越小越靠前)") + private Integer sortNumber; + + @ApiModelProperty(value = "备注") + private String comments; + + @ApiModelProperty(value = "状态, 0正常, 1冻结") + private Integer status; + + @ApiModelProperty(value = "租户id") + private Integer tenantId; + + @ApiModelProperty(value = "注册时间") + private Date createTime; + +} diff --git a/src/main/java/com/gxwebsoft/cms/entity/Navigation.java b/src/main/java/com/gxwebsoft/cms/entity/Navigation.java new file mode 100644 index 0000000..b47c212 --- /dev/null +++ b/src/main/java/com/gxwebsoft/cms/entity/Navigation.java @@ -0,0 +1,79 @@ +package com.gxwebsoft.cms.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serializable; +import java.util.Date; + +/** + * 网站导航记录表 + * + * @author 科技小王子 + * @since 2024-03-04 21:27:55 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@ApiModel(value = "Navigation对象", description = "网站导航记录表") +@TableName("cms_navigation") +public class Navigation implements Serializable { + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "ID") + @TableId(value = "navigation_id", type = IdType.AUTO) + private Integer navigationId; + + @ApiModelProperty(value = "上级id, 0是顶级") + private Integer parentId; + + @ApiModelProperty(value = "菜单名称") + private String title; + + @ApiModelProperty(value = "菜单路由地址") + private String path; + + @ApiModelProperty(value = "菜单组件地址, 目录可为空") + private String component; + + @ApiModelProperty(value = "打开位置") + private String target; + + @ApiModelProperty(value = "菜单图标") + private String icon; + + @ApiModelProperty(value = "图标颜色") + private String color; + + @ApiModelProperty(value = "是否隐藏, 0否, 1是(仅注册路由不显示在左侧菜单)") + private Integer hide; + + @ApiModelProperty(value = "菜单侧栏选中的path") + private String active; + + @ApiModelProperty(value = "其它路由元信息") + private String meta; + + @ApiModelProperty(value = "用户ID") + private Integer userId; + + @ApiModelProperty(value = "排序(数字越小越靠前)") + private Integer sortNumber; + + @ApiModelProperty(value = "备注") + private String comments; + + @ApiModelProperty(value = "状态, 0正常, 1冻结") + private Integer status; + + @ApiModelProperty(value = "租户id") + private Integer tenantId; + + @ApiModelProperty(value = "注册时间") + private Date createTime; + +} diff --git a/src/main/java/com/gxwebsoft/cms/entity/Website.java b/src/main/java/com/gxwebsoft/cms/entity/Website.java new file mode 100644 index 0000000..47b76af --- /dev/null +++ b/src/main/java/com/gxwebsoft/cms/entity/Website.java @@ -0,0 +1,119 @@ +package com.gxwebsoft.cms.entity; + +import com.baomidou.mybatisplus.annotation.*; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; + +/** + * 网站信息记录表 + * + * @author 科技小王子 + * @since 2024-03-04 21:14:15 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@ApiModel(value = "Website对象", description = "网站信息记录表") +@TableName("cms_website") +public class Website implements Serializable { + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "站点ID") + @TableId(value = "website_id", type = IdType.AUTO) + private Integer websiteId; + + @ApiModelProperty(value = "网站名称") + private String websiteName; + + @ApiModelProperty(value = "网站标识") + private String websiteCode; + + @ApiModelProperty(value = "网站LOGO") + private String websiteIcon; + + @ApiModelProperty(value = "网站LOGO") + private String websiteLogo; + + @ApiModelProperty(value = "网站类型") + private String websiteType; + + @ApiModelProperty(value = "绑定域名") + private String domain; + + @ApiModelProperty(value = "网站关键词") + private String keywords; + + @ApiModelProperty(value = "服务到期时间") + private Date expirationTime; + + @ApiModelProperty(value = "模版ID") + private Integer templateId; + + @ApiModelProperty(value = "行业类型(父级)") + private String industryParent; + + @ApiModelProperty(value = "行业类型(子级)") + private String industryChild; + + @ApiModelProperty(value = "企业ID") + private Integer companyId; + + @ApiModelProperty(value = "所在国家") + private String country; + + @ApiModelProperty(value = "所在省份") + private String province; + + @ApiModelProperty(value = "所在城市") + private String city; + + @ApiModelProperty(value = "所在辖区") + private String region; + + @ApiModelProperty(value = "街道地址") + private String address; + + @ApiModelProperty(value = "经度") + private String longitude; + + @ApiModelProperty(value = "纬度") + private String latitude; + + @ApiModelProperty(value = "备注") + private String comments; + + @ApiModelProperty(value = "是否推荐") + private Integer recommend; + + @ApiModelProperty(value = "状态") + private Integer status; + + @ApiModelProperty(value = "排序号") + private Integer sortNumber; + + @ApiModelProperty(value = "用户ID") + private Integer userId; + + @ApiModelProperty(value = "是否删除, 0否, 1是") + @TableLogic + private Integer deleted; + + @ApiModelProperty(value = "租户id") + private Integer tenantId; + + @ApiModelProperty(value = "创建时间") + private Date createTime; + + @ApiModelProperty(value = "修改时间") + private Date updateTime; + + @ApiModelProperty(value = "预设字段") + @TableField(exist = false) + private List fields; + +} diff --git a/src/main/java/com/gxwebsoft/cms/entity/WebsiteField.java b/src/main/java/com/gxwebsoft/cms/entity/WebsiteField.java new file mode 100644 index 0000000..6aa58c2 --- /dev/null +++ b/src/main/java/com/gxwebsoft/cms/entity/WebsiteField.java @@ -0,0 +1,55 @@ +package com.gxwebsoft.cms.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serializable; +import java.util.Date; + +/** + * 应用参数 + * + * @author 科技小王子 + * @since 2024-03-05 15:53:43 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@ApiModel(value = "WebsiteField对象", description = "应用参数") +@TableName("cms_website_field") +public class WebsiteField implements Serializable { + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "自增ID") + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + @ApiModelProperty(value = "网站ID") + private Integer websiteId; + + @ApiModelProperty(value = "名称") + private String name; + + @ApiModelProperty(value = "备注") + private String comments; + + @ApiModelProperty(value = "用户ID") + private Integer userId; + + @ApiModelProperty(value = "状态, 0正常, 1删除") + private Integer status; + + @ApiModelProperty(value = "排序(数字越小越靠前)") + private Integer sortNumber; + + @ApiModelProperty(value = "租户id") + private Integer tenantId; + + @ApiModelProperty(value = "注册时间") + private Date createTime; + +} diff --git a/src/main/java/com/gxwebsoft/cms/mapper/AdMapper.java b/src/main/java/com/gxwebsoft/cms/mapper/AdMapper.java index 6391b5d..9c8f6f9 100644 --- a/src/main/java/com/gxwebsoft/cms/mapper/AdMapper.java +++ b/src/main/java/com/gxwebsoft/cms/mapper/AdMapper.java @@ -12,7 +12,7 @@ import java.util.List; * 广告位管理表Mapper * * @author 科技小王子 - * @since 2023-10-22 15:47:09 + * @since 2024-03-04 21:14:15 */ public interface AdMapper extends BaseMapper { diff --git a/src/main/java/com/gxwebsoft/cms/mapper/AdRecordMapper.java b/src/main/java/com/gxwebsoft/cms/mapper/AdRecordMapper.java new file mode 100644 index 0000000..5a1822b --- /dev/null +++ b/src/main/java/com/gxwebsoft/cms/mapper/AdRecordMapper.java @@ -0,0 +1,37 @@ +package com.gxwebsoft.cms.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.gxwebsoft.cms.entity.AdRecord; +import com.gxwebsoft.cms.param.AdRecordParam; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 广告图片记录表Mapper + * + * @author 科技小王子 + * @since 2024-03-04 21:14:15 + */ +public interface AdRecordMapper extends BaseMapper { + + /** + * 分页查询 + * + * @param page 分页对象 + * @param param 查询参数 + * @return List + */ + List selectPageRel(@Param("page") IPage page, + @Param("param") AdRecordParam param); + + /** + * 查询全部 + * + * @param param 查询参数 + * @return List + */ + List selectListRel(@Param("param") AdRecordParam param); + +} diff --git a/src/main/java/com/gxwebsoft/cms/mapper/DesignMapper.java b/src/main/java/com/gxwebsoft/cms/mapper/DesignMapper.java new file mode 100644 index 0000000..845ad9f --- /dev/null +++ b/src/main/java/com/gxwebsoft/cms/mapper/DesignMapper.java @@ -0,0 +1,37 @@ +package com.gxwebsoft.cms.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.gxwebsoft.cms.entity.Design; +import com.gxwebsoft.cms.param.DesignParam; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 页面管理记录表Mapper + * + * @author 科技小王子 + * @since 2024-03-04 21:20:40 + */ +public interface DesignMapper extends BaseMapper { + + /** + * 分页查询 + * + * @param page 分页对象 + * @param param 查询参数 + * @return List + */ + List selectPageRel(@Param("page") IPage page, + @Param("param") DesignParam param); + + /** + * 查询全部 + * + * @param param 查询参数 + * @return List + */ + List selectListRel(@Param("param") DesignParam param); + +} diff --git a/src/main/java/com/gxwebsoft/cms/mapper/DesignRecordMapper.java b/src/main/java/com/gxwebsoft/cms/mapper/DesignRecordMapper.java new file mode 100644 index 0000000..a7bd8b0 --- /dev/null +++ b/src/main/java/com/gxwebsoft/cms/mapper/DesignRecordMapper.java @@ -0,0 +1,37 @@ +package com.gxwebsoft.cms.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.gxwebsoft.cms.entity.DesignRecord; +import com.gxwebsoft.cms.param.DesignRecordParam; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 页面组件表Mapper + * + * @author 科技小王子 + * @since 2024-03-04 21:20:40 + */ +public interface DesignRecordMapper extends BaseMapper { + + /** + * 分页查询 + * + * @param page 分页对象 + * @param param 查询参数 + * @return List + */ + List selectPageRel(@Param("page") IPage page, + @Param("param") DesignRecordParam param); + + /** + * 查询全部 + * + * @param param 查询参数 + * @return List + */ + List selectListRel(@Param("param") DesignRecordParam param); + +} diff --git a/src/main/java/com/gxwebsoft/cms/mapper/NavigationMapper.java b/src/main/java/com/gxwebsoft/cms/mapper/NavigationMapper.java new file mode 100644 index 0000000..7e9d9cc --- /dev/null +++ b/src/main/java/com/gxwebsoft/cms/mapper/NavigationMapper.java @@ -0,0 +1,37 @@ +package com.gxwebsoft.cms.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.gxwebsoft.cms.entity.Navigation; +import com.gxwebsoft.cms.param.NavigationParam; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 网站导航记录表Mapper + * + * @author 科技小王子 + * @since 2024-03-04 21:27:55 + */ +public interface NavigationMapper extends BaseMapper { + + /** + * 分页查询 + * + * @param page 分页对象 + * @param param 查询参数 + * @return List + */ + List selectPageRel(@Param("page") IPage page, + @Param("param") NavigationParam param); + + /** + * 查询全部 + * + * @param param 查询参数 + * @return List + */ + List selectListRel(@Param("param") NavigationParam param); + +} diff --git a/src/main/java/com/gxwebsoft/cms/mapper/WebsiteFieldMapper.java b/src/main/java/com/gxwebsoft/cms/mapper/WebsiteFieldMapper.java new file mode 100644 index 0000000..677391b --- /dev/null +++ b/src/main/java/com/gxwebsoft/cms/mapper/WebsiteFieldMapper.java @@ -0,0 +1,37 @@ +package com.gxwebsoft.cms.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.gxwebsoft.cms.entity.WebsiteField; +import com.gxwebsoft.cms.param.WebsiteFieldParam; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 应用参数Mapper + * + * @author 科技小王子 + * @since 2024-03-05 15:53:44 + */ +public interface WebsiteFieldMapper extends BaseMapper { + + /** + * 分页查询 + * + * @param page 分页对象 + * @param param 查询参数 + * @return List + */ + List selectPageRel(@Param("page") IPage page, + @Param("param") WebsiteFieldParam param); + + /** + * 查询全部 + * + * @param param 查询参数 + * @return List + */ + List selectListRel(@Param("param") WebsiteFieldParam param); + +} diff --git a/src/main/java/com/gxwebsoft/cms/mapper/WebsiteMapper.java b/src/main/java/com/gxwebsoft/cms/mapper/WebsiteMapper.java new file mode 100644 index 0000000..83f639b --- /dev/null +++ b/src/main/java/com/gxwebsoft/cms/mapper/WebsiteMapper.java @@ -0,0 +1,37 @@ +package com.gxwebsoft.cms.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.gxwebsoft.cms.entity.Website; +import com.gxwebsoft.cms.param.WebsiteParam; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 网站信息记录表Mapper + * + * @author 科技小王子 + * @since 2024-03-04 21:14:15 + */ +public interface WebsiteMapper extends BaseMapper { + + /** + * 分页查询 + * + * @param page 分页对象 + * @param param 查询参数 + * @return List + */ + List selectPageRel(@Param("page") IPage page, + @Param("param") WebsiteParam param); + + /** + * 查询全部 + * + * @param param 查询参数 + * @return List + */ + List selectListRel(@Param("param") WebsiteParam param); + +} diff --git a/src/main/java/com/gxwebsoft/cms/mapper/xml/AdRecordMapper.xml b/src/main/java/com/gxwebsoft/cms/mapper/xml/AdRecordMapper.xml new file mode 100644 index 0000000..823e88c --- /dev/null +++ b/src/main/java/com/gxwebsoft/cms/mapper/xml/AdRecordMapper.xml @@ -0,0 +1,53 @@ + + + + + + + SELECT a.* + FROM cms_ad_record a + + + AND a.ad_record_id = #{param.adRecordId} + + + AND a.title LIKE CONCAT('%', #{param.title}, '%') + + + AND a.path LIKE CONCAT('%', #{param.path}, '%') + + + AND a.url LIKE CONCAT('%', #{param.url}, '%') + + + AND a.ad_id = #{param.adId} + + + AND a.sort_number = #{param.sortNumber} + + + AND a.comments LIKE CONCAT('%', #{param.comments}, '%') + + + AND a.status = #{param.status} + + + AND a.create_time >= #{param.createTimeStart} + + + AND a.create_time <= #{param.createTimeEnd} + + + + + + + + + + + diff --git a/src/main/java/com/gxwebsoft/cms/mapper/xml/DesignMapper.xml b/src/main/java/com/gxwebsoft/cms/mapper/xml/DesignMapper.xml new file mode 100644 index 0000000..e392a03 --- /dev/null +++ b/src/main/java/com/gxwebsoft/cms/mapper/xml/DesignMapper.xml @@ -0,0 +1,62 @@ + + + + + + + SELECT a.* + FROM cms_design a + + + AND a.page_id = #{param.pageId} + + + AND a.parent_id = #{param.parentId} + + + AND a.title LIKE CONCAT('%', #{param.title}, '%') + + + AND a.keywords LIKE CONCAT('%', #{param.keywords}, '%') + + + AND a.description LIKE CONCAT('%', #{param.description}, '%') + + + AND a.path LIKE CONCAT('%', #{param.path}, '%') + + + AND a.photo LIKE CONCAT('%', #{param.photo}, '%') + + + AND a.user_id = #{param.userId} + + + AND a.sort_number = #{param.sortNumber} + + + AND a.comments LIKE CONCAT('%', #{param.comments}, '%') + + + AND a.status = #{param.status} + + + AND a.create_time >= #{param.createTimeStart} + + + AND a.create_time <= #{param.createTimeEnd} + + + + + + + + + + + diff --git a/src/main/java/com/gxwebsoft/cms/mapper/xml/DesignRecordMapper.xml b/src/main/java/com/gxwebsoft/cms/mapper/xml/DesignRecordMapper.xml new file mode 100644 index 0000000..c1162a2 --- /dev/null +++ b/src/main/java/com/gxwebsoft/cms/mapper/xml/DesignRecordMapper.xml @@ -0,0 +1,62 @@ + + + + + + + SELECT a.* + FROM cms_design_record a + + + AND a.page_id = #{param.pageId} + + + AND a.parent_id = #{param.parentId} + + + AND a.title LIKE CONCAT('%', #{param.title}, '%') + + + AND a.keywords LIKE CONCAT('%', #{param.keywords}, '%') + + + AND a.description LIKE CONCAT('%', #{param.description}, '%') + + + AND a.path LIKE CONCAT('%', #{param.path}, '%') + + + AND a.photo LIKE CONCAT('%', #{param.photo}, '%') + + + AND a.user_id = #{param.userId} + + + AND a.sort_number = #{param.sortNumber} + + + AND a.comments LIKE CONCAT('%', #{param.comments}, '%') + + + AND a.status = #{param.status} + + + AND a.create_time >= #{param.createTimeStart} + + + AND a.create_time <= #{param.createTimeEnd} + + + + + + + + + + + diff --git a/src/main/java/com/gxwebsoft/cms/mapper/xml/NavigationMapper.xml b/src/main/java/com/gxwebsoft/cms/mapper/xml/NavigationMapper.xml new file mode 100644 index 0000000..244b7fe --- /dev/null +++ b/src/main/java/com/gxwebsoft/cms/mapper/xml/NavigationMapper.xml @@ -0,0 +1,74 @@ + + + + + + + SELECT a.* + FROM cms_navigation a + + + AND a.navigation_id = #{param.navigationId} + + + AND a.parent_id = #{param.parentId} + + + AND a.title LIKE CONCAT('%', #{param.title}, '%') + + + AND a.path LIKE CONCAT('%', #{param.path}, '%') + + + AND a.component LIKE CONCAT('%', #{param.component}, '%') + + + AND a.target LIKE CONCAT('%', #{param.target}, '%') + + + AND a.icon LIKE CONCAT('%', #{param.icon}, '%') + + + AND a.color LIKE CONCAT('%', #{param.color}, '%') + + + AND a.hide = #{param.hide} + + + AND a.active LIKE CONCAT('%', #{param.active}, '%') + + + AND a.meta LIKE CONCAT('%', #{param.meta}, '%') + + + AND a.user_id = #{param.userId} + + + AND a.sort_number = #{param.sortNumber} + + + AND a.comments LIKE CONCAT('%', #{param.comments}, '%') + + + AND a.status = #{param.status} + + + AND a.create_time >= #{param.createTimeStart} + + + AND a.create_time <= #{param.createTimeEnd} + + + + + + + + + + + diff --git a/src/main/java/com/gxwebsoft/cms/mapper/xml/WebsiteFieldMapper.xml b/src/main/java/com/gxwebsoft/cms/mapper/xml/WebsiteFieldMapper.xml new file mode 100644 index 0000000..cf46c15 --- /dev/null +++ b/src/main/java/com/gxwebsoft/cms/mapper/xml/WebsiteFieldMapper.xml @@ -0,0 +1,50 @@ + + + + + + + SELECT a.* + FROM cms_website_field a + + + AND a.id = #{param.id} + + + AND a.website_id = #{param.websiteId} + + + AND a.name LIKE CONCAT('%', #{param.name}, '%') + + + AND a.comments LIKE CONCAT('%', #{param.comments}, '%') + + + AND a.user_id = #{param.userId} + + + AND a.status = #{param.status} + + + AND a.sort_number = #{param.sortNumber} + + + AND a.create_time >= #{param.createTimeStart} + + + AND a.create_time <= #{param.createTimeEnd} + + + + + + + + + + + diff --git a/src/main/java/com/gxwebsoft/cms/mapper/xml/WebsiteMapper.xml b/src/main/java/com/gxwebsoft/cms/mapper/xml/WebsiteMapper.xml new file mode 100644 index 0000000..b7df040 --- /dev/null +++ b/src/main/java/com/gxwebsoft/cms/mapper/xml/WebsiteMapper.xml @@ -0,0 +1,107 @@ + + + + + + + SELECT a.* + FROM cms_website a + + + AND a.website_id = #{param.websiteId} + + + AND a.website_name LIKE CONCAT('%', #{param.websiteName}, '%') + + + AND a.website_code LIKE CONCAT('%', #{param.websiteCode}, '%') + + + AND a.website_icon LIKE CONCAT('%', #{param.websiteIcon}, '%') + + + AND a.website_logo LIKE CONCAT('%', #{param.websiteLogo}, '%') + + + AND a.website_type LIKE CONCAT('%', #{param.websiteType}, '%') + + + AND a.domain LIKE CONCAT('%', #{param.domain}, '%') + + + AND a.expiration_time LIKE CONCAT('%', #{param.expirationTime}, '%') + + + AND a.template_id = #{param.templateId} + + + AND a.industry_parent LIKE CONCAT('%', #{param.industryParent}, '%') + + + AND a.industry_child LIKE CONCAT('%', #{param.industryChild}, '%') + + + AND a.company_id = #{param.companyId} + + + AND a.country LIKE CONCAT('%', #{param.country}, '%') + + + AND a.province LIKE CONCAT('%', #{param.province}, '%') + + + AND a.city LIKE CONCAT('%', #{param.city}, '%') + + + AND a.region LIKE CONCAT('%', #{param.region}, '%') + + + AND a.address LIKE CONCAT('%', #{param.address}, '%') + + + AND a.longitude LIKE CONCAT('%', #{param.longitude}, '%') + + + AND a.latitude LIKE CONCAT('%', #{param.latitude}, '%') + + + AND a.comments LIKE CONCAT('%', #{param.comments}, '%') + + + AND a.recommend = #{param.recommend} + + + AND a.status = #{param.status} + + + AND a.sort_number = #{param.sortNumber} + + + AND a.user_id = #{param.userId} + + + AND a.deleted = #{param.deleted} + + + AND a.deleted = 0 + + + AND a.create_time >= #{param.createTimeStart} + + + AND a.create_time <= #{param.createTimeEnd} + + + + + + + + + + + diff --git a/src/main/java/com/gxwebsoft/cms/param/AdParam.java b/src/main/java/com/gxwebsoft/cms/param/AdParam.java index 31bc3e6..27428a5 100644 --- a/src/main/java/com/gxwebsoft/cms/param/AdParam.java +++ b/src/main/java/com/gxwebsoft/cms/param/AdParam.java @@ -13,7 +13,7 @@ import lombok.EqualsAndHashCode; * 广告位管理表查询参数 * * @author 科技小王子 - * @since 2023-10-22 15:47:09 + * @since 2024-03-04 21:14:15 */ @Data @EqualsAndHashCode(callSuper = false) diff --git a/src/main/java/com/gxwebsoft/cms/param/AdRecordParam.java b/src/main/java/com/gxwebsoft/cms/param/AdRecordParam.java new file mode 100644 index 0000000..41b2acf --- /dev/null +++ b/src/main/java/com/gxwebsoft/cms/param/AdRecordParam.java @@ -0,0 +1,53 @@ +package com.gxwebsoft.cms.param; + +import com.gxwebsoft.common.core.annotation.QueryField; +import com.gxwebsoft.common.core.annotation.QueryType; +import com.gxwebsoft.common.core.web.BaseParam; +import com.fasterxml.jackson.annotation.JsonInclude; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 广告图片记录表查询参数 + * + * @author 科技小王子 + * @since 2024-03-04 21:14:15 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@JsonInclude(JsonInclude.Include.NON_NULL) +@ApiModel(value = "AdRecordParam对象", description = "广告图片记录表查询参数") +public class AdRecordParam extends BaseParam { + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "ID") + @QueryField(type = QueryType.EQ) + private Integer adRecordId; + + @ApiModelProperty(value = "广告标题") + private String title; + + @ApiModelProperty(value = "图片地址") + private String path; + + @ApiModelProperty(value = "链接地址") + private String url; + + @ApiModelProperty(value = "广告位ID") + @QueryField(type = QueryType.EQ) + private Integer adId; + + @ApiModelProperty(value = "排序(数字越小越靠前)") + @QueryField(type = QueryType.EQ) + private Integer sortNumber; + + @ApiModelProperty(value = "备注") + private String comments; + + @ApiModelProperty(value = "状态, 0正常, 1冻结") + @QueryField(type = QueryType.EQ) + private Integer status; + +} diff --git a/src/main/java/com/gxwebsoft/cms/param/DesignParam.java b/src/main/java/com/gxwebsoft/cms/param/DesignParam.java new file mode 100644 index 0000000..6a0d0f3 --- /dev/null +++ b/src/main/java/com/gxwebsoft/cms/param/DesignParam.java @@ -0,0 +1,63 @@ +package com.gxwebsoft.cms.param; + +import com.gxwebsoft.common.core.annotation.QueryField; +import com.gxwebsoft.common.core.annotation.QueryType; +import com.gxwebsoft.common.core.web.BaseParam; +import com.fasterxml.jackson.annotation.JsonInclude; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 页面管理记录表查询参数 + * + * @author 科技小王子 + * @since 2024-03-04 21:20:40 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@JsonInclude(JsonInclude.Include.NON_NULL) +@ApiModel(value = "DesignParam对象", description = "页面管理记录表查询参数") +public class DesignParam extends BaseParam { + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "ID") + @QueryField(type = QueryType.EQ) + private Integer pageId; + + @ApiModelProperty(value = "上级id, 0是顶级") + @QueryField(type = QueryType.EQ) + private Integer parentId; + + @ApiModelProperty(value = "页面标题") + private String title; + + @ApiModelProperty(value = "页面关键词") + private String keywords; + + @ApiModelProperty(value = "页面描述") + private String description; + + @ApiModelProperty(value = "页面路由地址") + private String path; + + @ApiModelProperty(value = "缩列图") + private String photo; + + @ApiModelProperty(value = "用户ID") + @QueryField(type = QueryType.EQ) + private Integer userId; + + @ApiModelProperty(value = "排序(数字越小越靠前)") + @QueryField(type = QueryType.EQ) + private Integer sortNumber; + + @ApiModelProperty(value = "备注") + private String comments; + + @ApiModelProperty(value = "状态, 0正常, 1冻结") + @QueryField(type = QueryType.EQ) + private Integer status; + +} diff --git a/src/main/java/com/gxwebsoft/cms/param/DesignRecordParam.java b/src/main/java/com/gxwebsoft/cms/param/DesignRecordParam.java new file mode 100644 index 0000000..4791a31 --- /dev/null +++ b/src/main/java/com/gxwebsoft/cms/param/DesignRecordParam.java @@ -0,0 +1,63 @@ +package com.gxwebsoft.cms.param; + +import com.gxwebsoft.common.core.annotation.QueryField; +import com.gxwebsoft.common.core.annotation.QueryType; +import com.gxwebsoft.common.core.web.BaseParam; +import com.fasterxml.jackson.annotation.JsonInclude; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 页面组件表查询参数 + * + * @author 科技小王子 + * @since 2024-03-04 21:20:40 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@JsonInclude(JsonInclude.Include.NON_NULL) +@ApiModel(value = "DesignRecordParam对象", description = "页面组件表查询参数") +public class DesignRecordParam extends BaseParam { + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "ID") + @QueryField(type = QueryType.EQ) + private Integer pageId; + + @ApiModelProperty(value = "上级id, 0是顶级") + @QueryField(type = QueryType.EQ) + private Integer parentId; + + @ApiModelProperty(value = "页面标题") + private String title; + + @ApiModelProperty(value = "页面关键词") + private String keywords; + + @ApiModelProperty(value = "页面描述") + private String description; + + @ApiModelProperty(value = "页面路由地址") + private String path; + + @ApiModelProperty(value = "缩列图") + private String photo; + + @ApiModelProperty(value = "用户ID") + @QueryField(type = QueryType.EQ) + private Integer userId; + + @ApiModelProperty(value = "排序(数字越小越靠前)") + @QueryField(type = QueryType.EQ) + private Integer sortNumber; + + @ApiModelProperty(value = "备注") + private String comments; + + @ApiModelProperty(value = "状态, 0正常, 1冻结") + @QueryField(type = QueryType.EQ) + private Integer status; + +} diff --git a/src/main/java/com/gxwebsoft/cms/param/NavigationParam.java b/src/main/java/com/gxwebsoft/cms/param/NavigationParam.java new file mode 100644 index 0000000..b3463f8 --- /dev/null +++ b/src/main/java/com/gxwebsoft/cms/param/NavigationParam.java @@ -0,0 +1,76 @@ +package com.gxwebsoft.cms.param; + +import com.gxwebsoft.common.core.annotation.QueryField; +import com.gxwebsoft.common.core.annotation.QueryType; +import com.gxwebsoft.common.core.web.BaseParam; +import com.fasterxml.jackson.annotation.JsonInclude; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 网站导航记录表查询参数 + * + * @author 科技小王子 + * @since 2024-03-04 21:27:55 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@JsonInclude(JsonInclude.Include.NON_NULL) +@ApiModel(value = "NavigationParam对象", description = "网站导航记录表查询参数") +public class NavigationParam extends BaseParam { + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "ID") + @QueryField(type = QueryType.EQ) + private Integer navigationId; + + @ApiModelProperty(value = "上级id, 0是顶级") + @QueryField(type = QueryType.EQ) + private Integer parentId; + + @ApiModelProperty(value = "菜单名称") + private String title; + + @ApiModelProperty(value = "菜单路由地址") + private String path; + + @ApiModelProperty(value = "菜单组件地址, 目录可为空") + private String component; + + @ApiModelProperty(value = "打开位置") + private String target; + + @ApiModelProperty(value = "菜单图标") + private String icon; + + @ApiModelProperty(value = "图标颜色") + private String color; + + @ApiModelProperty(value = "是否隐藏, 0否, 1是(仅注册路由不显示在左侧菜单)") + @QueryField(type = QueryType.EQ) + private Integer hide; + + @ApiModelProperty(value = "菜单侧栏选中的path") + private String active; + + @ApiModelProperty(value = "其它路由元信息") + private String meta; + + @ApiModelProperty(value = "用户ID") + @QueryField(type = QueryType.EQ) + private Integer userId; + + @ApiModelProperty(value = "排序(数字越小越靠前)") + @QueryField(type = QueryType.EQ) + private Integer sortNumber; + + @ApiModelProperty(value = "备注") + private String comments; + + @ApiModelProperty(value = "状态, 0正常, 1冻结") + @QueryField(type = QueryType.EQ) + private Integer status; + +} diff --git a/src/main/java/com/gxwebsoft/cms/param/WebsiteFieldParam.java b/src/main/java/com/gxwebsoft/cms/param/WebsiteFieldParam.java new file mode 100644 index 0000000..8bca9a0 --- /dev/null +++ b/src/main/java/com/gxwebsoft/cms/param/WebsiteFieldParam.java @@ -0,0 +1,51 @@ +package com.gxwebsoft.cms.param; + +import com.gxwebsoft.common.core.annotation.QueryField; +import com.gxwebsoft.common.core.annotation.QueryType; +import com.gxwebsoft.common.core.web.BaseParam; +import com.fasterxml.jackson.annotation.JsonInclude; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 应用参数查询参数 + * + * @author 科技小王子 + * @since 2024-03-05 15:53:43 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@JsonInclude(JsonInclude.Include.NON_NULL) +@ApiModel(value = "WebsiteFieldParam对象", description = "应用参数查询参数") +public class WebsiteFieldParam extends BaseParam { + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "自增ID") + @QueryField(type = QueryType.EQ) + private Integer id; + + @ApiModelProperty(value = "网站ID") + @QueryField(type = QueryType.EQ) + private Integer websiteId; + + @ApiModelProperty(value = "名称") + private String name; + + @ApiModelProperty(value = "备注") + private String comments; + + @ApiModelProperty(value = "用户ID") + @QueryField(type = QueryType.EQ) + private Integer userId; + + @ApiModelProperty(value = "状态, 0正常, 1删除") + @QueryField(type = QueryType.EQ) + private Integer status; + + @ApiModelProperty(value = "排序(数字越小越靠前)") + @QueryField(type = QueryType.EQ) + private Integer sortNumber; + +} diff --git a/src/main/java/com/gxwebsoft/cms/param/WebsiteParam.java b/src/main/java/com/gxwebsoft/cms/param/WebsiteParam.java new file mode 100644 index 0000000..d579818 --- /dev/null +++ b/src/main/java/com/gxwebsoft/cms/param/WebsiteParam.java @@ -0,0 +1,108 @@ +package com.gxwebsoft.cms.param; + +import com.gxwebsoft.common.core.annotation.QueryField; +import com.gxwebsoft.common.core.annotation.QueryType; +import com.gxwebsoft.common.core.web.BaseParam; +import com.fasterxml.jackson.annotation.JsonInclude; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 网站信息记录表查询参数 + * + * @author 科技小王子 + * @since 2024-03-04 21:14:15 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@JsonInclude(JsonInclude.Include.NON_NULL) +@ApiModel(value = "WebsiteParam对象", description = "网站信息记录表查询参数") +public class WebsiteParam extends BaseParam { + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "站点ID") + @QueryField(type = QueryType.EQ) + private Integer websiteId; + + @ApiModelProperty(value = "网站名称") + private String websiteName; + + @ApiModelProperty(value = "网站标识") + private String websiteCode; + + @ApiModelProperty(value = "网站LOGO") + private String websiteIcon; + + @ApiModelProperty(value = "网站LOGO") + private String websiteLogo; + + @ApiModelProperty(value = "网站类型") + private String websiteType; + + @ApiModelProperty(value = "绑定域名") + private String domain; + + @ApiModelProperty(value = "服务到期时间") + private String expirationTime; + + @ApiModelProperty(value = "模版ID") + @QueryField(type = QueryType.EQ) + private Integer templateId; + + @ApiModelProperty(value = "行业类型(父级)") + private String industryParent; + + @ApiModelProperty(value = "行业类型(子级)") + private String industryChild; + + @ApiModelProperty(value = "企业ID") + @QueryField(type = QueryType.EQ) + private Integer companyId; + + @ApiModelProperty(value = "所在国家") + private String country; + + @ApiModelProperty(value = "所在省份") + private String province; + + @ApiModelProperty(value = "所在城市") + private String city; + + @ApiModelProperty(value = "所在辖区") + private String region; + + @ApiModelProperty(value = "街道地址") + private String address; + + @ApiModelProperty(value = "经度") + private String longitude; + + @ApiModelProperty(value = "纬度") + private String latitude; + + @ApiModelProperty(value = "备注") + private String comments; + + @ApiModelProperty(value = "是否推荐") + @QueryField(type = QueryType.EQ) + private Integer recommend; + + @ApiModelProperty(value = "状态") + @QueryField(type = QueryType.EQ) + private Integer status; + + @ApiModelProperty(value = "排序号") + @QueryField(type = QueryType.EQ) + private Integer sortNumber; + + @ApiModelProperty(value = "用户ID") + @QueryField(type = QueryType.EQ) + private Integer userId; + + @ApiModelProperty(value = "是否删除, 0否, 1是") + @QueryField(type = QueryType.EQ) + private Integer deleted; + +} diff --git a/src/main/java/com/gxwebsoft/cms/service/AdRecordService.java b/src/main/java/com/gxwebsoft/cms/service/AdRecordService.java new file mode 100644 index 0000000..56f235b --- /dev/null +++ b/src/main/java/com/gxwebsoft/cms/service/AdRecordService.java @@ -0,0 +1,42 @@ +package com.gxwebsoft.cms.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.cms.entity.AdRecord; +import com.gxwebsoft.cms.param.AdRecordParam; + +import java.util.List; + +/** + * 广告图片记录表Service + * + * @author 科技小王子 + * @since 2024-03-04 21:14:15 + */ +public interface AdRecordService extends IService { + + /** + * 分页关联查询 + * + * @param param 查询参数 + * @return PageResult + */ + PageResult pageRel(AdRecordParam param); + + /** + * 关联查询全部 + * + * @param param 查询参数 + * @return List + */ + List listRel(AdRecordParam param); + + /** + * 根据id查询 + * + * @param adRecordId ID + * @return AdRecord + */ + AdRecord getByIdRel(Integer adRecordId); + +} diff --git a/src/main/java/com/gxwebsoft/cms/service/AdService.java b/src/main/java/com/gxwebsoft/cms/service/AdService.java index 73c4f34..6ec9c42 100644 --- a/src/main/java/com/gxwebsoft/cms/service/AdService.java +++ b/src/main/java/com/gxwebsoft/cms/service/AdService.java @@ -11,7 +11,7 @@ import java.util.List; * 广告位管理表Service * * @author 科技小王子 - * @since 2023-10-22 15:47:09 + * @since 2024-03-04 21:14:15 */ public interface AdService extends IService { diff --git a/src/main/java/com/gxwebsoft/cms/service/DesignRecordService.java b/src/main/java/com/gxwebsoft/cms/service/DesignRecordService.java new file mode 100644 index 0000000..5ec0948 --- /dev/null +++ b/src/main/java/com/gxwebsoft/cms/service/DesignRecordService.java @@ -0,0 +1,42 @@ +package com.gxwebsoft.cms.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.cms.entity.DesignRecord; +import com.gxwebsoft.cms.param.DesignRecordParam; + +import java.util.List; + +/** + * 页面组件表Service + * + * @author 科技小王子 + * @since 2024-03-04 21:20:40 + */ +public interface DesignRecordService extends IService { + + /** + * 分页关联查询 + * + * @param param 查询参数 + * @return PageResult + */ + PageResult pageRel(DesignRecordParam param); + + /** + * 关联查询全部 + * + * @param param 查询参数 + * @return List + */ + List listRel(DesignRecordParam param); + + /** + * 根据id查询 + * + * @param pageId ID + * @return DesignRecord + */ + DesignRecord getByIdRel(Integer pageId); + +} diff --git a/src/main/java/com/gxwebsoft/cms/service/DesignService.java b/src/main/java/com/gxwebsoft/cms/service/DesignService.java new file mode 100644 index 0000000..77fe967 --- /dev/null +++ b/src/main/java/com/gxwebsoft/cms/service/DesignService.java @@ -0,0 +1,42 @@ +package com.gxwebsoft.cms.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.cms.entity.Design; +import com.gxwebsoft.cms.param.DesignParam; + +import java.util.List; + +/** + * 页面管理记录表Service + * + * @author 科技小王子 + * @since 2024-03-04 21:20:40 + */ +public interface DesignService extends IService { + + /** + * 分页关联查询 + * + * @param param 查询参数 + * @return PageResult + */ + PageResult pageRel(DesignParam param); + + /** + * 关联查询全部 + * + * @param param 查询参数 + * @return List + */ + List listRel(DesignParam param); + + /** + * 根据id查询 + * + * @param pageId ID + * @return Design + */ + Design getByIdRel(Integer pageId); + +} diff --git a/src/main/java/com/gxwebsoft/cms/service/NavigationService.java b/src/main/java/com/gxwebsoft/cms/service/NavigationService.java new file mode 100644 index 0000000..66136a8 --- /dev/null +++ b/src/main/java/com/gxwebsoft/cms/service/NavigationService.java @@ -0,0 +1,42 @@ +package com.gxwebsoft.cms.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.cms.entity.Navigation; +import com.gxwebsoft.cms.param.NavigationParam; + +import java.util.List; + +/** + * 网站导航记录表Service + * + * @author 科技小王子 + * @since 2024-03-04 21:27:55 + */ +public interface NavigationService extends IService { + + /** + * 分页关联查询 + * + * @param param 查询参数 + * @return PageResult + */ + PageResult pageRel(NavigationParam param); + + /** + * 关联查询全部 + * + * @param param 查询参数 + * @return List + */ + List listRel(NavigationParam param); + + /** + * 根据id查询 + * + * @param navigationId ID + * @return Navigation + */ + Navigation getByIdRel(Integer navigationId); + +} diff --git a/src/main/java/com/gxwebsoft/cms/service/WebsiteFieldService.java b/src/main/java/com/gxwebsoft/cms/service/WebsiteFieldService.java new file mode 100644 index 0000000..fb9d06f --- /dev/null +++ b/src/main/java/com/gxwebsoft/cms/service/WebsiteFieldService.java @@ -0,0 +1,42 @@ +package com.gxwebsoft.cms.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.cms.entity.WebsiteField; +import com.gxwebsoft.cms.param.WebsiteFieldParam; + +import java.util.List; + +/** + * 应用参数Service + * + * @author 科技小王子 + * @since 2024-03-05 15:53:44 + */ +public interface WebsiteFieldService extends IService { + + /** + * 分页关联查询 + * + * @param param 查询参数 + * @return PageResult + */ + PageResult pageRel(WebsiteFieldParam param); + + /** + * 关联查询全部 + * + * @param param 查询参数 + * @return List + */ + List listRel(WebsiteFieldParam param); + + /** + * 根据id查询 + * + * @param id 自增ID + * @return WebsiteField + */ + WebsiteField getByIdRel(Integer id); + +} diff --git a/src/main/java/com/gxwebsoft/cms/service/WebsiteService.java b/src/main/java/com/gxwebsoft/cms/service/WebsiteService.java new file mode 100644 index 0000000..0207997 --- /dev/null +++ b/src/main/java/com/gxwebsoft/cms/service/WebsiteService.java @@ -0,0 +1,42 @@ +package com.gxwebsoft.cms.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.cms.entity.Website; +import com.gxwebsoft.cms.param.WebsiteParam; + +import java.util.List; + +/** + * 网站信息记录表Service + * + * @author 科技小王子 + * @since 2024-03-04 21:14:15 + */ +public interface WebsiteService extends IService { + + /** + * 分页关联查询 + * + * @param param 查询参数 + * @return PageResult + */ + PageResult pageRel(WebsiteParam param); + + /** + * 关联查询全部 + * + * @param param 查询参数 + * @return List + */ + List listRel(WebsiteParam param); + + /** + * 根据id查询 + * + * @param websiteId 站点ID + * @return Website + */ + Website getByIdRel(Integer websiteId); + +} diff --git a/src/main/java/com/gxwebsoft/cms/service/impl/AdRecordServiceImpl.java b/src/main/java/com/gxwebsoft/cms/service/impl/AdRecordServiceImpl.java new file mode 100644 index 0000000..a82f4f9 --- /dev/null +++ b/src/main/java/com/gxwebsoft/cms/service/impl/AdRecordServiceImpl.java @@ -0,0 +1,47 @@ +package com.gxwebsoft.cms.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gxwebsoft.cms.mapper.AdRecordMapper; +import com.gxwebsoft.cms.service.AdRecordService; +import com.gxwebsoft.cms.entity.AdRecord; +import com.gxwebsoft.cms.param.AdRecordParam; +import com.gxwebsoft.common.core.web.PageParam; +import com.gxwebsoft.common.core.web.PageResult; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 广告图片记录表Service实现 + * + * @author 科技小王子 + * @since 2024-03-04 21:14:15 + */ +@Service +public class AdRecordServiceImpl extends ServiceImpl implements AdRecordService { + + @Override + public PageResult pageRel(AdRecordParam param) { + PageParam page = new PageParam<>(param); + page.setDefaultOrder("create_time desc"); + List list = baseMapper.selectPageRel(page, param); + return new PageResult<>(list, page.getTotal()); + } + + @Override + public List listRel(AdRecordParam param) { + List list = baseMapper.selectListRel(param); + // 排序 + PageParam page = new PageParam<>(); + //page.setDefaultOrder("create_time desc"); + return page.sortRecords(list); + } + + @Override + public AdRecord getByIdRel(Integer adRecordId) { + AdRecordParam param = new AdRecordParam(); + param.setAdRecordId(adRecordId); + return param.getOne(baseMapper.selectListRel(param)); + } + +} diff --git a/src/main/java/com/gxwebsoft/cms/service/impl/AdServiceImpl.java b/src/main/java/com/gxwebsoft/cms/service/impl/AdServiceImpl.java index 1932e86..d565c5b 100644 --- a/src/main/java/com/gxwebsoft/cms/service/impl/AdServiceImpl.java +++ b/src/main/java/com/gxwebsoft/cms/service/impl/AdServiceImpl.java @@ -15,7 +15,7 @@ import java.util.List; * 广告位管理表Service实现 * * @author 科技小王子 - * @since 2023-10-22 15:47:09 + * @since 2024-03-04 21:14:15 */ @Service public class AdServiceImpl extends ServiceImpl implements AdService { @@ -23,7 +23,7 @@ public class AdServiceImpl extends ServiceImpl implements AdServic @Override public PageResult pageRel(AdParam param) { PageParam page = new PageParam<>(param); - //page.setDefaultOrder("create_time desc"); + page.setDefaultOrder("create_time desc"); List list = baseMapper.selectPageRel(page, param); return new PageResult<>(list, page.getTotal()); } diff --git a/src/main/java/com/gxwebsoft/cms/service/impl/DesignRecordServiceImpl.java b/src/main/java/com/gxwebsoft/cms/service/impl/DesignRecordServiceImpl.java new file mode 100644 index 0000000..3c990b4 --- /dev/null +++ b/src/main/java/com/gxwebsoft/cms/service/impl/DesignRecordServiceImpl.java @@ -0,0 +1,47 @@ +package com.gxwebsoft.cms.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gxwebsoft.cms.mapper.DesignRecordMapper; +import com.gxwebsoft.cms.service.DesignRecordService; +import com.gxwebsoft.cms.entity.DesignRecord; +import com.gxwebsoft.cms.param.DesignRecordParam; +import com.gxwebsoft.common.core.web.PageParam; +import com.gxwebsoft.common.core.web.PageResult; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 页面组件表Service实现 + * + * @author 科技小王子 + * @since 2024-03-04 21:20:40 + */ +@Service +public class DesignRecordServiceImpl extends ServiceImpl implements DesignRecordService { + + @Override + public PageResult pageRel(DesignRecordParam param) { + PageParam page = new PageParam<>(param); + page.setDefaultOrder("create_time desc"); + List list = baseMapper.selectPageRel(page, param); + return new PageResult<>(list, page.getTotal()); + } + + @Override + public List listRel(DesignRecordParam param) { + List list = baseMapper.selectListRel(param); + // 排序 + PageParam page = new PageParam<>(); + //page.setDefaultOrder("create_time desc"); + return page.sortRecords(list); + } + + @Override + public DesignRecord getByIdRel(Integer pageId) { + DesignRecordParam param = new DesignRecordParam(); + param.setPageId(pageId); + return param.getOne(baseMapper.selectListRel(param)); + } + +} diff --git a/src/main/java/com/gxwebsoft/cms/service/impl/DesignServiceImpl.java b/src/main/java/com/gxwebsoft/cms/service/impl/DesignServiceImpl.java new file mode 100644 index 0000000..5cdb492 --- /dev/null +++ b/src/main/java/com/gxwebsoft/cms/service/impl/DesignServiceImpl.java @@ -0,0 +1,47 @@ +package com.gxwebsoft.cms.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gxwebsoft.cms.mapper.DesignMapper; +import com.gxwebsoft.cms.service.DesignService; +import com.gxwebsoft.cms.entity.Design; +import com.gxwebsoft.cms.param.DesignParam; +import com.gxwebsoft.common.core.web.PageParam; +import com.gxwebsoft.common.core.web.PageResult; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 页面管理记录表Service实现 + * + * @author 科技小王子 + * @since 2024-03-04 21:20:40 + */ +@Service +public class DesignServiceImpl extends ServiceImpl implements DesignService { + + @Override + public PageResult pageRel(DesignParam param) { + PageParam page = new PageParam<>(param); + page.setDefaultOrder("create_time desc"); + List list = baseMapper.selectPageRel(page, param); + return new PageResult<>(list, page.getTotal()); + } + + @Override + public List listRel(DesignParam param) { + List list = baseMapper.selectListRel(param); + // 排序 + PageParam page = new PageParam<>(); + //page.setDefaultOrder("create_time desc"); + return page.sortRecords(list); + } + + @Override + public Design getByIdRel(Integer pageId) { + DesignParam param = new DesignParam(); + param.setPageId(pageId); + return param.getOne(baseMapper.selectListRel(param)); + } + +} diff --git a/src/main/java/com/gxwebsoft/cms/service/impl/NavigationServiceImpl.java b/src/main/java/com/gxwebsoft/cms/service/impl/NavigationServiceImpl.java new file mode 100644 index 0000000..92e9b92 --- /dev/null +++ b/src/main/java/com/gxwebsoft/cms/service/impl/NavigationServiceImpl.java @@ -0,0 +1,47 @@ +package com.gxwebsoft.cms.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gxwebsoft.cms.mapper.NavigationMapper; +import com.gxwebsoft.cms.service.NavigationService; +import com.gxwebsoft.cms.entity.Navigation; +import com.gxwebsoft.cms.param.NavigationParam; +import com.gxwebsoft.common.core.web.PageParam; +import com.gxwebsoft.common.core.web.PageResult; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 网站导航记录表Service实现 + * + * @author 科技小王子 + * @since 2024-03-04 21:27:55 + */ +@Service +public class NavigationServiceImpl extends ServiceImpl implements NavigationService { + + @Override + public PageResult pageRel(NavigationParam param) { + PageParam page = new PageParam<>(param); + page.setDefaultOrder("sort_number desc,create_time desc"); + List list = baseMapper.selectPageRel(page, param); + return new PageResult<>(list, page.getTotal()); + } + + @Override + public List listRel(NavigationParam param) { + List list = baseMapper.selectListRel(param); + // 排序 + PageParam page = new PageParam<>(); + page.setDefaultOrder("sort_number desc,create_time desc"); + return page.sortRecords(list); + } + + @Override + public Navigation getByIdRel(Integer navigationId) { + NavigationParam param = new NavigationParam(); + param.setNavigationId(navigationId); + return param.getOne(baseMapper.selectListRel(param)); + } + +} diff --git a/src/main/java/com/gxwebsoft/cms/service/impl/WebsiteFieldServiceImpl.java b/src/main/java/com/gxwebsoft/cms/service/impl/WebsiteFieldServiceImpl.java new file mode 100644 index 0000000..8af79fc --- /dev/null +++ b/src/main/java/com/gxwebsoft/cms/service/impl/WebsiteFieldServiceImpl.java @@ -0,0 +1,47 @@ +package com.gxwebsoft.cms.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gxwebsoft.cms.mapper.WebsiteFieldMapper; +import com.gxwebsoft.cms.service.WebsiteFieldService; +import com.gxwebsoft.cms.entity.WebsiteField; +import com.gxwebsoft.cms.param.WebsiteFieldParam; +import com.gxwebsoft.common.core.web.PageParam; +import com.gxwebsoft.common.core.web.PageResult; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 应用参数Service实现 + * + * @author 科技小王子 + * @since 2024-03-05 15:53:44 + */ +@Service +public class WebsiteFieldServiceImpl extends ServiceImpl implements WebsiteFieldService { + + @Override + public PageResult pageRel(WebsiteFieldParam param) { + PageParam page = new PageParam<>(param); + //page.setDefaultOrder("create_time desc"); + List list = baseMapper.selectPageRel(page, param); + return new PageResult<>(list, page.getTotal()); + } + + @Override + public List listRel(WebsiteFieldParam param) { + List list = baseMapper.selectListRel(param); + // 排序 + PageParam page = new PageParam<>(); + //page.setDefaultOrder("create_time desc"); + return page.sortRecords(list); + } + + @Override + public WebsiteField getByIdRel(Integer id) { + WebsiteFieldParam param = new WebsiteFieldParam(); + param.setId(id); + return param.getOne(baseMapper.selectListRel(param)); + } + +} diff --git a/src/main/java/com/gxwebsoft/cms/service/impl/WebsiteServiceImpl.java b/src/main/java/com/gxwebsoft/cms/service/impl/WebsiteServiceImpl.java new file mode 100644 index 0000000..e22c931 --- /dev/null +++ b/src/main/java/com/gxwebsoft/cms/service/impl/WebsiteServiceImpl.java @@ -0,0 +1,47 @@ +package com.gxwebsoft.cms.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gxwebsoft.cms.mapper.WebsiteMapper; +import com.gxwebsoft.cms.service.WebsiteService; +import com.gxwebsoft.cms.entity.Website; +import com.gxwebsoft.cms.param.WebsiteParam; +import com.gxwebsoft.common.core.web.PageParam; +import com.gxwebsoft.common.core.web.PageResult; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 网站信息记录表Service实现 + * + * @author 科技小王子 + * @since 2024-03-04 21:14:15 + */ +@Service +public class WebsiteServiceImpl extends ServiceImpl implements WebsiteService { + + @Override + public PageResult pageRel(WebsiteParam param) { + PageParam page = new PageParam<>(param); + page.setDefaultOrder("create_time desc"); + List list = baseMapper.selectPageRel(page, param); + return new PageResult<>(list, page.getTotal()); + } + + @Override + public List listRel(WebsiteParam param) { + List list = baseMapper.selectListRel(param); + // 排序 + PageParam page = new PageParam<>(); + //page.setDefaultOrder("create_time desc"); + return page.sortRecords(list); + } + + @Override + public Website getByIdRel(Integer websiteId) { + WebsiteParam param = new WebsiteParam(); + param.setWebsiteId(websiteId); + return param.getOne(baseMapper.selectListRel(param)); + } + +} diff --git a/src/main/java/com/gxwebsoft/oa/controller/AssetsController.java b/src/main/java/com/gxwebsoft/oa/controller/AssetsController.java index f0d48c2..9fee1f0 100644 --- a/src/main/java/com/gxwebsoft/oa/controller/AssetsController.java +++ b/src/main/java/com/gxwebsoft/oa/controller/AssetsController.java @@ -54,7 +54,7 @@ public class AssetsController extends BaseController { ); Integer totalNum2 = assetsService.count( new LambdaQueryWrapper() - .eq(Assets::getStatus, "已过期") + .eq(Assets::getStatus, "已到期") ); Integer totalNum3 = assetsService.count( new LambdaQueryWrapper() diff --git a/src/main/java/com/gxwebsoft/oa/controller/GoodsCategoryController.java b/src/main/java/com/gxwebsoft/oa/controller/GoodsCategoryController.java new file mode 100644 index 0000000..066ebf4 --- /dev/null +++ b/src/main/java/com/gxwebsoft/oa/controller/GoodsCategoryController.java @@ -0,0 +1,115 @@ +package com.gxwebsoft.oa.controller; + +import com.gxwebsoft.common.core.web.*; +import com.gxwebsoft.common.system.entity.User; +import com.gxwebsoft.oa.entity.GoodsCategory; +import com.gxwebsoft.oa.param.GoodsCategoryParam; +import com.gxwebsoft.oa.service.GoodsCategoryService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.List; + +/** + * 商品分类表控制器 + * + * @author 科技小王子 + * @since 2024-03-01 12:37:25 + */ +@Api(tags = "商品分类表管理") +@RestController +@RequestMapping("/api/oa/goods-category") +public class GoodsCategoryController extends BaseController { + @Resource + private GoodsCategoryService goodsCategoryService; + + @ApiOperation("分页查询商品分类表") + @GetMapping("/page") + public ApiResult> page(GoodsCategoryParam param) { + PageParam page = new PageParam<>(param); + page.setDefaultOrder("create_time desc"); + return success(goodsCategoryService.page(page, page.getWrapper())); + // 使用关联查询 + //return success(goodsCategoryService.pageRel(param)); + } + + @ApiOperation("查询全部商品分类表") + @GetMapping() + public ApiResult> list(GoodsCategoryParam param) { + PageParam page = new PageParam<>(param); + page.setDefaultOrder("create_time desc"); + return success(goodsCategoryService.list(page.getOrderWrapper())); + // 使用关联查询 + //return success(goodsCategoryService.listRel(param)); + } + + @ApiOperation("根据id查询商品分类表") + @GetMapping("/{id}") + public ApiResult get(@PathVariable("id") Integer id) { + return success(goodsCategoryService.getById(id)); + // 使用关联查询 + //return success(goodsCategoryService.getByIdRel(id)); + } + + @ApiOperation("添加商品分类表") + @PostMapping() + public ApiResult save(@RequestBody GoodsCategory goodsCategory) { + // 记录当前登录用户id + User loginUser = getLoginUser(); + if (loginUser != null) { + goodsCategory.setUserId(loginUser.getUserId()); + } + if (goodsCategoryService.save(goodsCategory)) { + return success("添加成功"); + } + return fail("添加失败"); + } + + @ApiOperation("修改商品分类表") + @PutMapping() + public ApiResult update(@RequestBody GoodsCategory goodsCategory) { + if (goodsCategoryService.updateById(goodsCategory)) { + return success("修改成功"); + } + return fail("修改失败"); + } + + @ApiOperation("删除商品分类表") + @DeleteMapping("/{id}") + public ApiResult remove(@PathVariable("id") Integer id) { + if (goodsCategoryService.removeById(id)) { + return success("删除成功"); + } + return fail("删除失败"); + } + + @ApiOperation("批量添加商品分类表") + @PostMapping("/batch") + public ApiResult saveBatch(@RequestBody List list) { + if (goodsCategoryService.saveBatch(list)) { + return success("添加成功"); + } + return fail("添加失败"); + } + + @ApiOperation("批量修改商品分类表") + @PutMapping("/batch") + public ApiResult removeBatch(@RequestBody BatchParam batchParam) { + if (batchParam.update(goodsCategoryService, "category_id")) { + return success("修改成功"); + } + return fail("修改失败"); + } + + @ApiOperation("批量删除商品分类表") + @DeleteMapping("/batch") + public ApiResult removeBatch(@RequestBody List ids) { + if (goodsCategoryService.removeByIds(ids)) { + return success("删除成功"); + } + return fail("删除失败"); + } + +} diff --git a/src/main/java/com/gxwebsoft/oa/controller/GoodsController.java b/src/main/java/com/gxwebsoft/oa/controller/GoodsController.java new file mode 100644 index 0000000..81ac154 --- /dev/null +++ b/src/main/java/com/gxwebsoft/oa/controller/GoodsController.java @@ -0,0 +1,115 @@ +package com.gxwebsoft.oa.controller; + +import com.gxwebsoft.common.core.web.*; +import com.gxwebsoft.common.system.entity.User; +import com.gxwebsoft.oa.entity.Goods; +import com.gxwebsoft.oa.param.GoodsParam; +import com.gxwebsoft.oa.service.GoodsService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.List; + +/** + * 商品记录表控制器 + * + * @author 科技小王子 + * @since 2024-03-01 12:37:25 + */ +@Api(tags = "商品记录表管理") +@RestController +@RequestMapping("/api/oa/goods") +public class GoodsController extends BaseController { + @Resource + private GoodsService goodsService; + + @ApiOperation("分页查询商品记录表") + @GetMapping("/page") + public ApiResult> page(GoodsParam param) { + PageParam page = new PageParam<>(param); + page.setDefaultOrder("create_time desc"); + return success(goodsService.page(page, page.getWrapper())); + // 使用关联查询 + //return success(goodsService.pageRel(param)); + } + + @ApiOperation("查询全部商品记录表") + @GetMapping() + public ApiResult> list(GoodsParam param) { + PageParam page = new PageParam<>(param); + page.setDefaultOrder("create_time desc"); + return success(goodsService.list(page.getOrderWrapper())); + // 使用关联查询 + //return success(goodsService.listRel(param)); + } + + @ApiOperation("根据id查询商品记录表") + @GetMapping("/{id}") + public ApiResult get(@PathVariable("id") Integer id) { + return success(goodsService.getById(id)); + // 使用关联查询 + //return success(goodsService.getByIdRel(id)); + } + + @ApiOperation("添加商品记录表") + @PostMapping() + public ApiResult save(@RequestBody Goods goods) { + // 记录当前登录用户id + User loginUser = getLoginUser(); + if (loginUser != null) { + goods.setUserId(loginUser.getUserId()); + } + if (goodsService.save(goods)) { + return success("添加成功"); + } + return fail("添加失败"); + } + + @ApiOperation("修改商品记录表") + @PutMapping() + public ApiResult update(@RequestBody Goods goods) { + if (goodsService.updateById(goods)) { + return success("修改成功"); + } + return fail("修改失败"); + } + + @ApiOperation("删除商品记录表") + @DeleteMapping("/{id}") + public ApiResult remove(@PathVariable("id") Integer id) { + if (goodsService.removeById(id)) { + return success("删除成功"); + } + return fail("删除失败"); + } + + @ApiOperation("批量添加商品记录表") + @PostMapping("/batch") + public ApiResult saveBatch(@RequestBody List list) { + if (goodsService.saveBatch(list)) { + return success("添加成功"); + } + return fail("添加失败"); + } + + @ApiOperation("批量修改商品记录表") + @PutMapping("/batch") + public ApiResult removeBatch(@RequestBody BatchParam batchParam) { + if (batchParam.update(goodsService, "goods_id")) { + return success("修改成功"); + } + return fail("修改失败"); + } + + @ApiOperation("批量删除商品记录表") + @DeleteMapping("/batch") + public ApiResult removeBatch(@RequestBody List ids) { + if (goodsService.removeByIds(ids)) { + return success("删除成功"); + } + return fail("删除失败"); + } + +} diff --git a/src/main/java/com/gxwebsoft/oa/controller/OrderController.java b/src/main/java/com/gxwebsoft/oa/controller/OrderController.java index 25c4528..d2b3ee5 100644 --- a/src/main/java/com/gxwebsoft/oa/controller/OrderController.java +++ b/src/main/java/com/gxwebsoft/oa/controller/OrderController.java @@ -1,5 +1,6 @@ package com.gxwebsoft.oa.controller; +import com.gxwebsoft.common.core.utils.CommonUtil; import com.gxwebsoft.common.core.web.*; import com.gxwebsoft.common.system.entity.User; import com.gxwebsoft.oa.entity.Order; @@ -58,6 +59,7 @@ public class OrderController extends BaseController { if (loginUser != null) { order.setUserId(loginUser.getUserId()); } + order.setOrderNo(CommonUtil.createOrderNo()); if (orderService.save(order)) { return success("添加成功"); } diff --git a/src/main/java/com/gxwebsoft/oa/entity/Goods.java b/src/main/java/com/gxwebsoft/oa/entity/Goods.java new file mode 100644 index 0000000..28b60fb --- /dev/null +++ b/src/main/java/com/gxwebsoft/oa/entity/Goods.java @@ -0,0 +1,90 @@ +package com.gxwebsoft.oa.entity; + +import com.baomidou.mybatisplus.annotation.*; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +/** + * 商品记录表 + * + * @author 科技小王子 + * @since 2024-03-01 12:37:25 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@ApiModel(value = "Goods对象", description = "商品记录表") +@TableName("oa_goods") +public class Goods implements Serializable { + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "自增ID") + @TableId(value = "goods_id", type = IdType.AUTO) + private Integer goodsId; + + @ApiModelProperty(value = "类型 1实物商品 2虚拟商品") + private Integer type; + + @ApiModelProperty(value = "商品编码") + private String code; + + @ApiModelProperty(value = "商品标题") + private String title; + + @ApiModelProperty(value = "分类ID") + private Integer categoryId; + + @ApiModelProperty(value = "规格") + private String specs; + + @ApiModelProperty(value = "货架") + private String position; + + @ApiModelProperty(value = "进货价格") + private BigDecimal price; + + @ApiModelProperty(value = "销售价格") + private BigDecimal salePrice; + + @ApiModelProperty(value = "是否推荐") + private Boolean recommend; + + @ApiModelProperty(value = "状态, 0正常, 1待修,2异常已修,3异常未修") + private Integer status; + + @ApiModelProperty(value = "备注") + private String comments; + + @ApiModelProperty(value = "排序号") + private Integer sortNumber; + + @ApiModelProperty(value = "所有人") + private Integer userId; + + @ApiModelProperty(value = "是否删除, 0否, 1是") + @TableLogic + private Integer deleted; + + @ApiModelProperty(value = "租户id") + private Integer tenantId; + + @ApiModelProperty(value = "创建时间") + private Date createTime; + + @ApiModelProperty(value = "修改时间") + private Date updateTime; + + @ApiModelProperty(value = "分类名称") + @TableField(exist = false) + private String categoryName; + + @ApiModelProperty(value = "分类图标") + @TableField(exist = false) + private String categoryImage; + +} diff --git a/src/main/java/com/gxwebsoft/oa/entity/GoodsCategory.java b/src/main/java/com/gxwebsoft/oa/entity/GoodsCategory.java new file mode 100644 index 0000000..28405cb --- /dev/null +++ b/src/main/java/com/gxwebsoft/oa/entity/GoodsCategory.java @@ -0,0 +1,63 @@ +package com.gxwebsoft.oa.entity; + +import com.baomidou.mybatisplus.annotation.*; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + * 商品分类表 + * + * @author 科技小王子 + * @since 2024-03-01 12:37:25 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@ApiModel(value = "GoodsCategory对象", description = "商品分类表") +@TableName("oa_goods_category") +public class GoodsCategory implements Serializable { + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "自增ID") + @TableId(value = "category_id", type = IdType.AUTO) + private Integer categoryId; + + @ApiModelProperty(value = "分类名称") + private String name; + + @ApiModelProperty(value = "分类图标") + private String categoryImage; + + @ApiModelProperty(value = "分类编码") + private String code; + + @ApiModelProperty(value = "状态, 0正常, 1隐藏") + private Integer status; + + @ApiModelProperty(value = "备注") + private String comments; + + @ApiModelProperty(value = "排序号") + private Integer sortNumber; + + @ApiModelProperty(value = "所有人") + private Integer userId; + + @ApiModelProperty(value = "是否删除, 0否, 1是") + @TableLogic + private Integer deleted; + + @ApiModelProperty(value = "租户id") + private Integer tenantId; + + @ApiModelProperty(value = "创建时间") + private LocalDateTime createTime; + + @ApiModelProperty(value = "修改时间") + private LocalDateTime updateTime; + +} diff --git a/src/main/java/com/gxwebsoft/oa/mapper/GoodsCategoryMapper.java b/src/main/java/com/gxwebsoft/oa/mapper/GoodsCategoryMapper.java new file mode 100644 index 0000000..16feed8 --- /dev/null +++ b/src/main/java/com/gxwebsoft/oa/mapper/GoodsCategoryMapper.java @@ -0,0 +1,37 @@ +package com.gxwebsoft.oa.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.gxwebsoft.oa.entity.GoodsCategory; +import com.gxwebsoft.oa.param.GoodsCategoryParam; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 商品分类表Mapper + * + * @author 科技小王子 + * @since 2024-03-01 12:37:25 + */ +public interface GoodsCategoryMapper extends BaseMapper { + + /** + * 分页查询 + * + * @param page 分页对象 + * @param param 查询参数 + * @return List + */ + List selectPageRel(@Param("page") IPage page, + @Param("param") GoodsCategoryParam param); + + /** + * 查询全部 + * + * @param param 查询参数 + * @return List + */ + List selectListRel(@Param("param") GoodsCategoryParam param); + +} diff --git a/src/main/java/com/gxwebsoft/oa/mapper/GoodsMapper.java b/src/main/java/com/gxwebsoft/oa/mapper/GoodsMapper.java new file mode 100644 index 0000000..48aee78 --- /dev/null +++ b/src/main/java/com/gxwebsoft/oa/mapper/GoodsMapper.java @@ -0,0 +1,37 @@ +package com.gxwebsoft.oa.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.gxwebsoft.oa.entity.Goods; +import com.gxwebsoft.oa.param.GoodsParam; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 商品记录表Mapper + * + * @author 科技小王子 + * @since 2024-03-01 12:37:25 + */ +public interface GoodsMapper extends BaseMapper { + + /** + * 分页查询 + * + * @param page 分页对象 + * @param param 查询参数 + * @return List + */ + List selectPageRel(@Param("page") IPage page, + @Param("param") GoodsParam param); + + /** + * 查询全部 + * + * @param param 查询参数 + * @return List + */ + List selectListRel(@Param("param") GoodsParam param); + +} diff --git a/src/main/java/com/gxwebsoft/oa/mapper/xml/GoodsCategoryMapper.xml b/src/main/java/com/gxwebsoft/oa/mapper/xml/GoodsCategoryMapper.xml new file mode 100644 index 0000000..1021758 --- /dev/null +++ b/src/main/java/com/gxwebsoft/oa/mapper/xml/GoodsCategoryMapper.xml @@ -0,0 +1,56 @@ + + + + + + + SELECT a.* + FROM oa_goods_category a + + + AND a.category_id = #{param.categoryId} + + + AND a.name LIKE CONCAT('%', #{param.name}, '%') + + + AND a.code LIKE CONCAT('%', #{param.code}, '%') + + + AND a.status = #{param.status} + + + AND a.comments LIKE CONCAT('%', #{param.comments}, '%') + + + AND a.sort_number = #{param.sortNumber} + + + AND a.user_id = #{param.userId} + + + AND a.deleted = #{param.deleted} + + + AND a.deleted = 0 + + + AND a.create_time >= #{param.createTimeStart} + + + AND a.create_time <= #{param.createTimeEnd} + + + + + + + + + + + diff --git a/src/main/java/com/gxwebsoft/oa/mapper/xml/GoodsMapper.xml b/src/main/java/com/gxwebsoft/oa/mapper/xml/GoodsMapper.xml new file mode 100644 index 0000000..9f1271f --- /dev/null +++ b/src/main/java/com/gxwebsoft/oa/mapper/xml/GoodsMapper.xml @@ -0,0 +1,75 @@ + + + + + + + SELECT a.*,b.name,b.avatar + FROM oa_goods a + LEFT JOIN oa_goods_categroy b ON a.goods_id = b.goods_id + + + AND a.goods_id = #{param.goodsId} + + + AND a.type = #{param.type} + + + AND a.code LIKE CONCAT('%', #{param.code}, '%') + + + AND a.title LIKE CONCAT('%', #{param.title}, '%') + + + AND a.category_id = #{param.categoryId} + + + AND a.specs LIKE CONCAT('%', #{param.specs}, '%') + + + AND a.position LIKE CONCAT('%', #{param.position}, '%') + + + AND a.price = #{param.price} + + + AND a.sale_price = #{param.salePrice} + + + AND a.status = #{param.status} + + + AND a.comments LIKE CONCAT('%', #{param.comments}, '%') + + + AND a.sort_number = #{param.sortNumber} + + + AND a.user_id = #{param.userId} + + + AND a.deleted = #{param.deleted} + + + AND a.deleted = 0 + + + AND a.create_time >= #{param.createTimeStart} + + + AND a.create_time <= #{param.createTimeEnd} + + + + + + + + + + + diff --git a/src/main/java/com/gxwebsoft/oa/param/GoodsCategoryParam.java b/src/main/java/com/gxwebsoft/oa/param/GoodsCategoryParam.java new file mode 100644 index 0000000..8d6a27c --- /dev/null +++ b/src/main/java/com/gxwebsoft/oa/param/GoodsCategoryParam.java @@ -0,0 +1,54 @@ +package com.gxwebsoft.oa.param; + +import com.gxwebsoft.common.core.annotation.QueryField; +import com.gxwebsoft.common.core.annotation.QueryType; +import com.gxwebsoft.common.core.web.BaseParam; +import com.fasterxml.jackson.annotation.JsonInclude; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 商品分类表查询参数 + * + * @author 科技小王子 + * @since 2024-03-01 12:37:25 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@JsonInclude(JsonInclude.Include.NON_NULL) +@ApiModel(value = "GoodsCategoryParam对象", description = "商品分类表查询参数") +public class GoodsCategoryParam extends BaseParam { + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "自增ID") + @QueryField(type = QueryType.EQ) + private Integer categoryId; + + @ApiModelProperty(value = "分类名称") + private String name; + + @ApiModelProperty(value = "分类编码") + private String code; + + @ApiModelProperty(value = "状态, 0正常, 1隐藏") + @QueryField(type = QueryType.EQ) + private Integer status; + + @ApiModelProperty(value = "备注") + private String comments; + + @ApiModelProperty(value = "排序号") + @QueryField(type = QueryType.EQ) + private Integer sortNumber; + + @ApiModelProperty(value = "所有人") + @QueryField(type = QueryType.EQ) + private Integer userId; + + @ApiModelProperty(value = "是否删除, 0否, 1是") + @QueryField(type = QueryType.EQ) + private Integer deleted; + +} diff --git a/src/main/java/com/gxwebsoft/oa/param/GoodsParam.java b/src/main/java/com/gxwebsoft/oa/param/GoodsParam.java new file mode 100644 index 0000000..de9f73b --- /dev/null +++ b/src/main/java/com/gxwebsoft/oa/param/GoodsParam.java @@ -0,0 +1,78 @@ +package com.gxwebsoft.oa.param; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.gxwebsoft.common.core.annotation.QueryField; +import com.gxwebsoft.common.core.annotation.QueryType; +import com.gxwebsoft.common.core.web.BaseParam; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; + +/** + * 商品记录表查询参数 + * + * @author 科技小王子 + * @since 2024-03-01 12:37:25 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@JsonInclude(JsonInclude.Include.NON_NULL) +@ApiModel(value = "GoodsParam对象", description = "商品记录表查询参数") +public class GoodsParam extends BaseParam { + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "自增ID") + @QueryField(type = QueryType.EQ) + private Integer goodsId; + + @ApiModelProperty(value = "类型 1实物商品 2虚拟商品") + @QueryField(type = QueryType.EQ) + private Integer type; + + @ApiModelProperty(value = "商品编码") + private String code; + + @ApiModelProperty(value = "商品标题") + private String title; + + @ApiModelProperty(value = "分类ID") + @QueryField(type = QueryType.EQ) + private Integer categoryId; + + @ApiModelProperty(value = "规格") + private String specs; + + @ApiModelProperty(value = "货架") + private String position; + + @ApiModelProperty(value = "进货价格") + @QueryField(type = QueryType.EQ) + private BigDecimal price; + + @ApiModelProperty(value = "销售价格") + @QueryField(type = QueryType.EQ) + private BigDecimal salePrice; + + @ApiModelProperty(value = "状态, 0正常, 1待修,2异常已修,3异常未修") + @QueryField(type = QueryType.EQ) + private Integer status; + + @ApiModelProperty(value = "备注") + private String comments; + + @ApiModelProperty(value = "排序号") + @QueryField(type = QueryType.EQ) + private Integer sortNumber; + + @ApiModelProperty(value = "所有人") + @QueryField(type = QueryType.EQ) + private Integer userId; + + @ApiModelProperty(value = "是否删除, 0否, 1是") + @QueryField(type = QueryType.EQ) + private Integer deleted; + +} diff --git a/src/main/java/com/gxwebsoft/oa/service/GoodsCategoryService.java b/src/main/java/com/gxwebsoft/oa/service/GoodsCategoryService.java new file mode 100644 index 0000000..01d079e --- /dev/null +++ b/src/main/java/com/gxwebsoft/oa/service/GoodsCategoryService.java @@ -0,0 +1,42 @@ +package com.gxwebsoft.oa.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.oa.entity.GoodsCategory; +import com.gxwebsoft.oa.param.GoodsCategoryParam; + +import java.util.List; + +/** + * 商品分类表Service + * + * @author 科技小王子 + * @since 2024-03-01 12:37:25 + */ +public interface GoodsCategoryService extends IService { + + /** + * 分页关联查询 + * + * @param param 查询参数 + * @return PageResult + */ + PageResult pageRel(GoodsCategoryParam param); + + /** + * 关联查询全部 + * + * @param param 查询参数 + * @return List + */ + List listRel(GoodsCategoryParam param); + + /** + * 根据id查询 + * + * @param categoryId 自增ID + * @return GoodsCategory + */ + GoodsCategory getByIdRel(Integer categoryId); + +} diff --git a/src/main/java/com/gxwebsoft/oa/service/GoodsService.java b/src/main/java/com/gxwebsoft/oa/service/GoodsService.java new file mode 100644 index 0000000..085f650 --- /dev/null +++ b/src/main/java/com/gxwebsoft/oa/service/GoodsService.java @@ -0,0 +1,42 @@ +package com.gxwebsoft.oa.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.oa.entity.Goods; +import com.gxwebsoft.oa.param.GoodsParam; + +import java.util.List; + +/** + * 商品记录表Service + * + * @author 科技小王子 + * @since 2024-03-01 12:37:25 + */ +public interface GoodsService extends IService { + + /** + * 分页关联查询 + * + * @param param 查询参数 + * @return PageResult + */ + PageResult pageRel(GoodsParam param); + + /** + * 关联查询全部 + * + * @param param 查询参数 + * @return List + */ + List listRel(GoodsParam param); + + /** + * 根据id查询 + * + * @param goodsId 自增ID + * @return Goods + */ + Goods getByIdRel(Integer goodsId); + +} diff --git a/src/main/java/com/gxwebsoft/oa/service/impl/GoodsCategoryServiceImpl.java b/src/main/java/com/gxwebsoft/oa/service/impl/GoodsCategoryServiceImpl.java new file mode 100644 index 0000000..5d4b203 --- /dev/null +++ b/src/main/java/com/gxwebsoft/oa/service/impl/GoodsCategoryServiceImpl.java @@ -0,0 +1,47 @@ +package com.gxwebsoft.oa.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gxwebsoft.oa.mapper.GoodsCategoryMapper; +import com.gxwebsoft.oa.service.GoodsCategoryService; +import com.gxwebsoft.oa.entity.GoodsCategory; +import com.gxwebsoft.oa.param.GoodsCategoryParam; +import com.gxwebsoft.common.core.web.PageParam; +import com.gxwebsoft.common.core.web.PageResult; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 商品分类表Service实现 + * + * @author 科技小王子 + * @since 2024-03-01 12:37:25 + */ +@Service +public class GoodsCategoryServiceImpl extends ServiceImpl implements GoodsCategoryService { + + @Override + public PageResult pageRel(GoodsCategoryParam param) { + PageParam page = new PageParam<>(param); + //page.setDefaultOrder("create_time desc"); + List list = baseMapper.selectPageRel(page, param); + return new PageResult<>(list, page.getTotal()); + } + + @Override + public List listRel(GoodsCategoryParam param) { + List list = baseMapper.selectListRel(param); + // 排序 + PageParam page = new PageParam<>(); + //page.setDefaultOrder("create_time desc"); + return page.sortRecords(list); + } + + @Override + public GoodsCategory getByIdRel(Integer categoryId) { + GoodsCategoryParam param = new GoodsCategoryParam(); + param.setCategoryId(categoryId); + return param.getOne(baseMapper.selectListRel(param)); + } + +} diff --git a/src/main/java/com/gxwebsoft/oa/service/impl/GoodsServiceImpl.java b/src/main/java/com/gxwebsoft/oa/service/impl/GoodsServiceImpl.java new file mode 100644 index 0000000..bf67422 --- /dev/null +++ b/src/main/java/com/gxwebsoft/oa/service/impl/GoodsServiceImpl.java @@ -0,0 +1,47 @@ +package com.gxwebsoft.oa.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gxwebsoft.oa.mapper.GoodsMapper; +import com.gxwebsoft.oa.service.GoodsService; +import com.gxwebsoft.oa.entity.Goods; +import com.gxwebsoft.oa.param.GoodsParam; +import com.gxwebsoft.common.core.web.PageParam; +import com.gxwebsoft.common.core.web.PageResult; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 商品记录表Service实现 + * + * @author 科技小王子 + * @since 2024-03-01 12:37:25 + */ +@Service +public class GoodsServiceImpl extends ServiceImpl implements GoodsService { + + @Override + public PageResult pageRel(GoodsParam param) { + PageParam page = new PageParam<>(param); + //page.setDefaultOrder("create_time desc"); + List list = baseMapper.selectPageRel(page, param); + return new PageResult<>(list, page.getTotal()); + } + + @Override + public List listRel(GoodsParam param) { + List list = baseMapper.selectListRel(param); + // 排序 + PageParam page = new PageParam<>(); + //page.setDefaultOrder("create_time desc"); + return page.sortRecords(list); + } + + @Override + public Goods getByIdRel(Integer goodsId) { + GoodsParam param = new GoodsParam(); + param.setGoodsId(goodsId); + return param.getOne(baseMapper.selectListRel(param)); + } + +} diff --git a/src/test/java/com/gxwebsoft/generator/CmsGenerator.java b/src/test/java/com/gxwebsoft/generator/CmsGenerator.java index fddd2df..078cf4c 100644 --- a/src/test/java/com/gxwebsoft/generator/CmsGenerator.java +++ b/src/test/java/com/gxwebsoft/generator/CmsGenerator.java @@ -41,19 +41,18 @@ public class CmsGenerator { private static final String MODULE_NAME = "cms"; // 需要生成的表 private static final String[] TABLE_NAMES = new String[]{ - "cms_article", - "cms_article_category", - "cms_article_like", - "cms_article_comment", - "cms_docs", - "cms_ad", -// "cms_docs", -// "cms_docs", -// "cms_docs", -// "cms_docs", -// "cms_docs", -// "cms_docs", +// "cms_article", +// "cms_article_category", +// "cms_article_like", +// "cms_article_comment", // "cms_docs", +// "cms_ad", +// "cms_ad_record", +// "cms_navigation", +// "cms_design", +// "cms_design_record", +// "cms_website", + "cms_website_field" }; // 需要去除的表前缀 private static final String[] TABLE_PREFIX = new String[]{ diff --git a/src/test/java/com/gxwebsoft/generator/OaGenerator.java b/src/test/java/com/gxwebsoft/generator/OaGenerator.java index 0d60111..77160eb 100644 --- a/src/test/java/com/gxwebsoft/generator/OaGenerator.java +++ b/src/test/java/com/gxwebsoft/generator/OaGenerator.java @@ -58,7 +58,9 @@ public class OaGenerator { // "oa_link", // "oa_company_field", // "oa_company_user", - "oa_order" +// "oa_order", + "oa_goods", + "oa_goods_category" }; // 需要去除的表前缀 private static final String[] TABLE_PREFIX = new String[]{