diff --git a/.idea/deployment.xml b/.idea/deployment.xml
new file mode 100644
index 0000000..a263ee1
--- /dev/null
+++ b/.idea/deployment.xml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/webServers.xml b/.idea/webServers.xml
new file mode 100644
index 0000000..ae7d8cb
--- /dev/null
+++ b/.idea/webServers.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/file/qr/friendPay_583486.png b/file/qr/friendPay_583486.png
new file mode 100644
index 0000000..6777c44
Binary files /dev/null and b/file/qr/friendPay_583486.png differ
diff --git a/pom.xml b/pom.xml
index 33a70ea..55c451f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -88,9 +88,9 @@
- com.github.yulichang
- mybatis-plus-join-boot-starter
- 1.4.5
+ com.github.yulichang
+ mybatis-plus-join-boot-starter
+ 1.4.5
@@ -190,108 +190,113 @@
- org.springframework.boot
- spring-boot-starter-data-redis
+ org.springframework.boot
+ spring-boot-starter-data-redis
- com.aliyun
- aliyun-java-sdk-core
- 4.4.3
+ com.aliyun
+ aliyun-java-sdk-core
+ 4.4.3
- com.alipay.sdk
- alipay-sdk-java
- 4.35.0.ALL
+ com.alipay.sdk
+ alipay-sdk-java
+ 4.35.0.ALL
+
+
+
+ org.bouncycastle
+ bcprov-jdk15on
+ 1.70
+
+
+
+ commons-logging
+ commons-logging
+ 1.2
+
+
+
+ com.alibaba
+ fastjson
+ 2.0.20
-
-
- org.bouncycastle
- bcprov-jdk15on
- 1.70
-
-
-
- commons-logging
- commons-logging
- 1.2
-
-
-
- com.alibaba
- fastjson
- 2.0.20
-
-
-
- com.google.zxing
- core
- 3.3.3
-
+
+
+ com.google.zxing
+ core
+ 3.3.3
+
-
- com.google.code.gson
- gson
- 2.8.0
-
+
+ com.google.code.gson
+ gson
+ 2.8.0
+
-
- com.vaadin.external.google
- android-json
- 0.0.20131108.vaadin1
- compile
-
+
+ com.vaadin.external.google
+ android-json
+ 0.0.20131108.vaadin1
+ compile
+
-
-
- com.corundumstudio.socketio
- netty-socketio
- 2.0.2
-
+
+
+ com.corundumstudio.socketio
+ netty-socketio
+ 2.0.2
+
-
-
- com.github.wechatpay-apiv3
- wechatpay-java
- 0.2.9
-
+
+
+ com.github.wechatpay-apiv3
+ wechatpay-java
+ 0.2.9
+
-
- com.github.binarywang
- weixin-java-miniapp
- 4.5.0
-
+
+ com.github.binarywang
+ weixin-java-miniapp
+ 4.6.0
+
-
-
- com.aliyun.oss
- aliyun-sdk-oss
- 3.17.0
-
+
+
+ com.aliyun.oss
+ aliyun-sdk-oss
+ 3.17.0
+
+
+
+ com.github.kuaidi100-api
+ sdk
+ 1.0.13
+
-
-
- com.nuonuo
- open-sdk
- 1.0.5.2
-
+
+
+ com.nuonuo
+ open-sdk
+ 1.0.5.2
+
-
-
- com.github.xiaoymin
- knife4j-spring-boot-starter
- 3.0.3
-
-
-
- com.belerweb
- pinyin4j
- 2.5.1
-
+
+
+ com.github.xiaoymin
+ knife4j-spring-boot-starter
+ 3.0.3
+
+
+ com.belerweb
+ pinyin4j
+ 2.5.1
+
diff --git a/src/main/java/com/gxwebsoft/cms/controller/DesignCollectController.java b/src/main/java/com/gxwebsoft/cms/controller/DesignCollectController.java
new file mode 100644
index 0000000..24e59c3
--- /dev/null
+++ b/src/main/java/com/gxwebsoft/cms/controller/DesignCollectController.java
@@ -0,0 +1,114 @@
+package com.gxwebsoft.cms.controller;
+
+import com.gxwebsoft.common.core.web.BaseController;
+import com.gxwebsoft.cms.service.DesignCollectService;
+import com.gxwebsoft.cms.entity.DesignCollect;
+import com.gxwebsoft.cms.param.DesignCollectParam;
+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.common.core.annotation.OperationLog;
+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;
+import java.util.List;
+
+/**
+ * 设计征集控制器
+ *
+ * @author 科技小王子
+ * @since 2024-10-08 15:21:56
+ */
+@Api(tags = "设计征集管理")
+@RestController
+@RequestMapping("/api/cms/design-collect")
+public class DesignCollectController extends BaseController {
+ @Resource
+ private DesignCollectService designCollectService;
+
+ @ApiOperation("分页查询设计征集")
+ @GetMapping("/page")
+ public ApiResult> page(DesignCollectParam param) {
+ // 使用关联查询
+ return success(designCollectService.pageRel(param));
+ }
+
+ @ApiOperation("查询全部设计征集")
+ @GetMapping()
+ public ApiResult> list(DesignCollectParam param) {
+ // 使用关联查询
+ return success(designCollectService.listRel(param));
+ }
+
+ @ApiOperation("根据id查询设计征集")
+ @GetMapping("/{id}")
+ public ApiResult get(@PathVariable("id") Integer id) {
+ // 使用关联查询
+ return success(designCollectService.getByIdRel(id));
+ }
+
+ @ApiOperation("添加设计征集")
+ @PostMapping()
+ public ApiResult> save(@RequestBody DesignCollect designCollect) {
+ // 记录当前登录用户id
+ User loginUser = getLoginUser();
+ if (loginUser != null) {
+ designCollect.setUserId(loginUser.getUserId());
+ }
+ if (designCollectService.save(designCollect)) {
+ return success("添加成功");
+ }
+ return fail("添加失败");
+ }
+
+ @ApiOperation("修改设计征集")
+ @PutMapping()
+ public ApiResult> update(@RequestBody DesignCollect designCollect) {
+ if (designCollectService.updateById(designCollect)) {
+ return success("修改成功");
+ }
+ return fail("修改失败");
+ }
+
+ @ApiOperation("删除设计征集")
+ @DeleteMapping("/{id}")
+ public ApiResult> remove(@PathVariable("id") Integer id) {
+ if (designCollectService.removeById(id)) {
+ return success("删除成功");
+ }
+ return fail("删除失败");
+ }
+
+ @ApiOperation("批量添加设计征集")
+ @PostMapping("/batch")
+ public ApiResult> saveBatch(@RequestBody List list) {
+ if (designCollectService.saveBatch(list)) {
+ return success("添加成功");
+ }
+ return fail("添加失败");
+ }
+
+ @ApiOperation("批量修改设计征集")
+ @PutMapping("/batch")
+ public ApiResult> removeBatch(@RequestBody BatchParam batchParam) {
+ if (batchParam.update(designCollectService, "id")) {
+ return success("修改成功");
+ }
+ return fail("修改失败");
+ }
+
+ @ApiOperation("批量删除设计征集")
+ @DeleteMapping("/batch")
+ public ApiResult> removeBatch(@RequestBody List ids) {
+ if (designCollectService.removeByIds(ids)) {
+ return success("删除成功");
+ }
+ return fail("删除失败");
+ }
+
+}
diff --git a/src/main/java/com/gxwebsoft/cms/controller/DesignSignUpController.java b/src/main/java/com/gxwebsoft/cms/controller/DesignSignUpController.java
new file mode 100644
index 0000000..dcb1b76
--- /dev/null
+++ b/src/main/java/com/gxwebsoft/cms/controller/DesignSignUpController.java
@@ -0,0 +1,115 @@
+package com.gxwebsoft.cms.controller;
+
+import com.gxwebsoft.common.core.web.BaseController;
+import com.gxwebsoft.cms.service.DesignSignUpService;
+import com.gxwebsoft.cms.entity.DesignSignUp;
+import com.gxwebsoft.cms.param.DesignSignUpParam;
+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.common.core.annotation.OperationLog;
+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;
+import java.util.List;
+
+/**
+ * 设计征集报名控制器
+ *
+ * @author 科技小王子
+ * @since 2024-10-08 15:21:56
+ */
+@Api(tags = "设计征集报名管理")
+@RestController
+@RequestMapping("/api/cms/design-sign-up")
+public class DesignSignUpController extends BaseController {
+ @Resource
+ private DesignSignUpService designSignUpService;
+
+ @ApiOperation("分页查询设计征集报名")
+ @GetMapping("/page")
+ public ApiResult> page(DesignSignUpParam param) {
+ // 使用关联查询
+ return success(designSignUpService.pageRel(param));
+ }
+
+ @ApiOperation("查询全部设计征集报名")
+ @GetMapping()
+ public ApiResult> list(DesignSignUpParam param) {
+ // 使用关联查询
+ return success(designSignUpService.listRel(param));
+ }
+
+ @PreAuthorize("hasAuthority('cms:designSignUp:list')")
+ @ApiOperation("根据id查询设计征集报名")
+ @GetMapping("/{id}")
+ public ApiResult get(@PathVariable("id") Integer id) {
+ // 使用关联查询
+ return success(designSignUpService.getByIdRel(id));
+ }
+
+ @ApiOperation("添加设计征集报名")
+ @PostMapping()
+ public ApiResult> save(@RequestBody DesignSignUp designSignUp) {
+ // 记录当前登录用户id
+ User loginUser = getLoginUser();
+ if (loginUser != null) {
+ designSignUp.setUserId(loginUser.getUserId());
+ }
+ if (designSignUpService.save(designSignUp)) {
+ return success("添加成功");
+ }
+ return fail("添加失败");
+ }
+
+ @ApiOperation("修改设计征集报名")
+ @PutMapping()
+ public ApiResult> update(@RequestBody DesignSignUp designSignUp) {
+ if (designSignUpService.updateById(designSignUp)) {
+ return success("修改成功");
+ }
+ return fail("修改失败");
+ }
+
+ @ApiOperation("删除设计征集报名")
+ @DeleteMapping("/{id}")
+ public ApiResult> remove(@PathVariable("id") Integer id) {
+ if (designSignUpService.removeById(id)) {
+ return success("删除成功");
+ }
+ return fail("删除失败");
+ }
+
+ @ApiOperation("批量添加设计征集报名")
+ @PostMapping("/batch")
+ public ApiResult> saveBatch(@RequestBody List list) {
+ if (designSignUpService.saveBatch(list)) {
+ return success("添加成功");
+ }
+ return fail("添加失败");
+ }
+
+ @ApiOperation("批量修改设计征集报名")
+ @PutMapping("/batch")
+ public ApiResult> removeBatch(@RequestBody BatchParam batchParam) {
+ if (batchParam.update(designSignUpService, "id")) {
+ return success("修改成功");
+ }
+ return fail("修改失败");
+ }
+
+ @ApiOperation("批量删除设计征集报名")
+ @DeleteMapping("/batch")
+ public ApiResult> removeBatch(@RequestBody List ids) {
+ if (designSignUpService.removeByIds(ids)) {
+ return success("删除成功");
+ }
+ return fail("删除失败");
+ }
+
+}
diff --git a/src/main/java/com/gxwebsoft/cms/controller/MpController.java b/src/main/java/com/gxwebsoft/cms/controller/MpController.java
index 9d1856a..917887f 100644
--- a/src/main/java/com/gxwebsoft/cms/controller/MpController.java
+++ b/src/main/java/com/gxwebsoft/cms/controller/MpController.java
@@ -41,279 +41,298 @@ import java.util.stream.Collectors;
@RestController
@RequestMapping("/api/cms/mp")
public class MpController extends BaseController {
- @Resource
- private MpService mpService;
- @Resource
- private MpPagesService mpPagesService;
- @Resource
- private AdService adService;
- @Resource
- private MpMenuService mpMenuService;
- @Resource
- private MpFieldService mpFieldService;
- @Resource
- private GoodsService goodsService;
- @Resource
- private RedisUtil redisUtil;
+ @Resource
+ private MpService mpService;
+ @Resource
+ private MpPagesService mpPagesService;
+ @Resource
+ private AdService adService;
+ @Resource
+ private MpMenuService mpMenuService;
+ @Resource
+ private MpFieldService mpFieldService;
+ @Resource
+ private GoodsService goodsService;
+ @Resource
+ private RedisUtil redisUtil;
- @ApiOperation("分页查询小程序")
- @GetMapping("/page")
- public ApiResult> page(MpParam param) {
- // 使用关联查询
- return success(mpService.pageRel(param));
- }
-
- @ApiOperation("查询全部小程序")
- @GetMapping()
- public ApiResult> list(MpParam param) {
- // 使用关联查询
- return success(mpService.listRel(param));
- }
-
- @PreAuthorize("hasAuthority('cms:mp:list')")
- @ApiOperation("根据id查询小程序")
- @GetMapping("/{id}")
- public ApiResult get(@PathVariable("id") Integer id) {
- // 使用关联查询
- return success(mpService.getByIdRel(id));
- }
-
- @PreAuthorize("hasAuthority('cms:mp:save')")
- @ApiOperation("添加小程序")
- @PostMapping()
- public ApiResult> save(@RequestBody Mp mp) {
- // 记录当前登录用户id
- User loginUser = getLoginUser();
- if (loginUser != null) {
- mp.setUserId(loginUser.getUserId());
- }
- if (mpService.save(mp)) {
- return success("添加成功");
- }
- return fail("添加失败");
- }
-
- @PreAuthorize("hasAuthority('cms:mp:update')")
- @ApiOperation("修改小程序")
- @PutMapping()
- public ApiResult> update(@RequestBody Mp mp) {
- // 只允许一个主账号
- if (mp.getType().equals(1)) {
- mpService.update(new LambdaUpdateWrapper().eq(Mp::getType, 1).set(Mp::getType, 0));
- }
- if (mpService.updateById(mp)) {
- return success("修改成功");
- }
- return fail("修改失败");
- }
-
- @PreAuthorize("hasAuthority('cms:mp:remove')")
- @ApiOperation("删除小程序")
- @DeleteMapping("/{id}")
- public ApiResult> remove(@PathVariable("id") Integer id) {
- if (mpService.removeById(id)) {
- return success("删除成功");
- }
- return fail("删除失败");
- }
-
- @PreAuthorize("hasAuthority('cms:mp:save')")
- @ApiOperation("批量添加小程序")
- @PostMapping("/batch")
- public ApiResult> saveBatch(@RequestBody List list) {
- if (mpService.saveBatch(list)) {
- return success("添加成功");
- }
- return fail("添加失败");
- }
-
- @PreAuthorize("hasAuthority('cms:mp:update')")
- @ApiOperation("批量修改小程序")
- @PutMapping("/batch")
- public ApiResult> removeBatch(@RequestBody BatchParam batchParam) {
- if (batchParam.update(mpService, "mp_id")) {
- return success("修改成功");
- }
- return fail("修改失败");
- }
-
- @PreAuthorize("hasAuthority('cms:mp:remove')")
- @ApiOperation("批量删除小程序")
- @DeleteMapping("/batch")
- public ApiResult> removeBatch(@RequestBody List ids) {
- if (mpService.removeByIds(ids)) {
- return success("删除成功");
- }
- return fail("删除失败");
- }
-
-
-
- @ApiOperation("小程序基本信息")
- @GetMapping("/getMpInfo")
- public ApiResult> getMpInfo() {
- final Integer tenantId = getTenantId();
- String key = "MpInfo:" + tenantId;
- System.out.println("key = " + key);
- final String mpInfo = redisUtil.get(key);
-
- if (tenantId.equals(0)) {
- return fail("租户ID不存在", null);
- }
- System.out.println("mpInfo = " + mpInfo);
- // 从缓存读取信息
- if (StrUtil.isNotBlank(mpInfo)) {
- final Object object = JSONUtil.parseObject(mpInfo, Object.class);
- System.out.println("object = " + object);
- return success(object);
+ @ApiOperation("分页查询小程序")
+ @GetMapping("/page")
+ public ApiResult> page(MpParam param) {
+ // 使用关联查询
+ return success(mpService.pageRel(param));
}
- // 获取小程序
- if (mpService.count(new LambdaUpdateWrapper().eq(Mp::getDeleted, 0)) == 0) {
- // 创建小程序
- createMp();
+ @ApiOperation("查询全部小程序")
+ @GetMapping()
+ public ApiResult> list(MpParam param) {
+ // 使用关联查询
+ return success(mpService.listRel(param));
}
- HashMap map = new HashMap<>();
-
- // 获取小程序
- final Mp mp = mpService.getOne(new LambdaQueryWrapper().eq(Mp::getTenantId, tenantId).last("limit 1"));
- mp.setAppSecret(null);
- map.put("mp", mp);
-
- // 原生导航条
- final List tabBar = mpPagesService.list(new LambdaQueryWrapper().eq(MpPages::getSubpackage, "MainPackage").last("limit 5"));
- map.put("tabBar", tabBar);
-
- // 配置信息
- HashMap config = new HashMap<>();
- config.put("LICENSE_CODE", "");
- config.put("MAP_KEY", "");
- final List fields = mpFieldService.list();
- fields.forEach(d -> {
- config.put(d.getName(), d.getValue());
- });
- map.put("config", config);
-
- // 服务器时间
- HashMap serverTime = new HashMap<>();
- // 今天日期
- DateTime date = DateUtil.date();
- String today = DateUtil.today();
- // 明天日期
- final DateTime dateTime = DateUtil.tomorrow();
- String tomorrow = DateUtil.format(dateTime, "yyyy-MM-dd");
- // 后天日期
- final DateTime dateTime2 = DateUtil.offsetDay(date, 2);
- final String afterDay = DateUtil.format(dateTime2, "yyyy-MM-dd");
- // 今天星期几
- final int week = DateUtil.thisDayOfWeek();
- final DateTime nextWeek = DateUtil.nextWeek();
- serverTime.put("now", DateUtil.now()); // 2024-07-18 22:06:36
- serverTime.put("today", today); // 2024-07-18
- serverTime.put("tomorrow", tomorrow); // 2024-07-19
- serverTime.put("afterDay", afterDay); // 2024-07-20
- serverTime.put("nextWeek", nextWeek); // 2024-07-25 22:06:36
- serverTime.put("week", week); // 5
- map.put("serverTime", serverTime);
- redisUtil.set(key, map, 1L, TimeUnit.DAYS);
- return success(map);
- }
-
- private void createMp() {
- System.out.println("创建小程序 = ");
- final User loginUser = getLoginUser();
- final Integer tenantId = getTenantId();
- // 创建网站记录
- final Mp mp = new Mp();
- mp.setTenantId(tenantId);
- mp.setAppId("小程序ID");
- mp.setMpName("小程序名称");
- mp.setMainPath("/pages/index");
- if (loginUser != null) {
- mp.setUserId(getLoginUserId());
+ @PreAuthorize("hasAuthority('cms:mp:list')")
+ @ApiOperation("根据id查询小程序")
+ @GetMapping("/{id}")
+ public ApiResult get(@PathVariable("id") Integer id) {
+ // 使用关联查询
+ return success(mpService.getByIdRel(id));
}
- mp.setExpirationTime(DateUtil.offset(DateUtil.date(), DateField.YEAR, 1));
- mpService.save(mp);
- // 创建底部导航栏
- final MpPages mpPages = new MpPages();
- mpPages.setHome(1);
- mpPages.setTitle("首页");
- mpPages.setPath("/pages/index");
- mpPages.setSubpackage("MainPackage");
- mpPages.setIcon("HomeOutlined");
- mpPages.setSortNumber(0);
- mpPages.setTenantId(tenantId);
- mpPagesService.save(mpPages);
- mpPages.setHome(0);
- mpPages.setTitle("分类");
- mpPages.setPath("/pages/category");
- mpPages.setSubpackage("MainPackage");
- mpPages.setIcon("AppstoreOutlined");
- mpPages.setSortNumber(0);
- mpPagesService.save(mpPages);
- mpPages.setTitle("购物车");
- mpPages.setPath("/pages/category");
- mpPages.setSubpackage("MainPackage");
- mpPages.setIcon("ShoppingCartOutlined");
- mpPages.setSortNumber(0);
- mpPagesService.save(mpPages);
- mpPages.setTitle("我的");
- mpPages.setPath("/pages/user");
- mpPages.setSubpackage("MainPackage");
- mpPages.setIcon("UserOutlined");
- mpPages.setSortNumber(0);
- mpPagesService.save(mpPages);
+ @PreAuthorize("hasAuthority('cms:mp:save')")
+ @ApiOperation("添加小程序")
+ @PostMapping()
+ public ApiResult> save(@RequestBody Mp mp) {
+ // 记录当前登录用户id
+ User loginUser = getLoginUser();
+ if (loginUser != null) {
+ mp.setUserId(loginUser.getUserId());
+ }
+ if (mpService.save(mp)) {
+ return success("添加成功");
+ }
+ return fail("添加失败");
+ }
- // 创建导航图标
- final MpMenu mpMenu = new MpMenu();
- mpMenu.setTenantId(tenantId);
- mpMenu.setTitle("分类1");
- mpMenu.setIcon("PictureOutlined");
- mpMenu.setPath("/package/order");
- mpMenu.setTarget("uni.navigateTo");
- mpMenuService.save(mpMenu);
- mpMenu.setTitle("分类2");
- mpMenu.setIcon("PictureOutlined");
- mpMenu.setPath("/package/order");
- mpMenuService.save(mpMenu);
- mpMenu.setTitle("分类3");
- mpMenu.setIcon("PictureOutlined");
- mpMenu.setPath("/package/order");
- mpMenuService.save(mpMenu);
- mpMenu.setTitle("分类4");
- mpMenu.setIcon("PictureOutlined");
- mpMenu.setPath("/package/order");
- mpMenuService.save(mpMenu);
+ @PreAuthorize("hasAuthority('cms:mp:update')")
+ @ApiOperation("修改小程序")
+ @PutMapping()
+ public ApiResult> update(@RequestBody Mp mp) {
+ // 只允许一个主账号
+ if (mp.getType().equals(1)) {
+ mpService.update(new LambdaUpdateWrapper().eq(Mp::getType, 1).set(Mp::getType, 0));
+ }
+ if (mpService.updateById(mp)) {
+ return success("修改成功");
+ }
+ return fail("修改失败");
+ }
- // 小程序配置信息
- MpField field = new MpField();
- field.setName("mpLogo");
- mpFieldService.save(field);
- }
+ @PreAuthorize("hasAuthority('cms:mp:remove')")
+ @ApiOperation("删除小程序")
+ @DeleteMapping("/{id}")
+ public ApiResult> remove(@PathVariable("id") Integer id) {
+ if (mpService.removeById(id)) {
+ return success("删除成功");
+ }
+ return fail("删除失败");
+ }
- @ApiOperation("首页数据")
- @GetMapping("/index")
- public ApiResult> index(GoodsParam param) {
- // 使用关联查询
- final HashMap layout = new HashMap<>();
- // 瀑布流商品数据 (type:0 商城商品,1 外卖商品)
+ @PreAuthorize("hasAuthority('cms:mp:save')")
+ @ApiOperation("批量添加小程序")
+ @PostMapping("/batch")
+ public ApiResult> saveBatch(@RequestBody List list) {
+ if (mpService.saveBatch(list)) {
+ return success("添加成功");
+ }
+ return fail("添加失败");
+ }
+
+ @PreAuthorize("hasAuthority('cms:mp:update')")
+ @ApiOperation("批量修改小程序")
+ @PutMapping("/batch")
+ public ApiResult> removeBatch(@RequestBody BatchParam batchParam) {
+ if (batchParam.update(mpService, "mp_id")) {
+ return success("修改成功");
+ }
+ return fail("修改失败");
+ }
+
+ @PreAuthorize("hasAuthority('cms:mp:remove')")
+ @ApiOperation("批量删除小程序")
+ @DeleteMapping("/batch")
+ public ApiResult> removeBatch(@RequestBody List ids) {
+ if (mpService.removeByIds(ids)) {
+ return success("删除成功");
+ }
+ return fail("删除失败");
+ }
+
+
+ @ApiOperation("小程序基本信息")
+ @GetMapping("/getMpInfo")
+ public ApiResult> getMpInfo() {
+ final Integer tenantId = getTenantId();
+ String key = "MpInfo:" + tenantId;
+ System.out.println("key = " + key);
+ final String mpInfo = redisUtil.get(key);
+
+ if (tenantId.equals(0)) {
+ return fail("租户ID不存在", null);
+ }
+ System.out.println("mpInfo = " + mpInfo);
+ // 从缓存读取信息
+ if (StrUtil.isNotBlank(mpInfo)) {
+ final Object object = JSONUtil.parseObject(mpInfo, Object.class);
+ System.out.println("object = " + object);
+ return success(object);
+ }
+
+ // 获取小程序
+ if (mpService.count(new LambdaUpdateWrapper().eq(Mp::getDeleted, 0)) == 0) {
+ // 创建小程序
+ createMp();
+ }
+
+ HashMap map = new HashMap<>();
+
+ // 获取小程序
+ final Mp mp = mpService.getOne(new LambdaQueryWrapper().eq(Mp::getTenantId, tenantId).last("limit 1"));
+ mp.setAppSecret(null);
+ map.put("mp", mp);
+
+ // 原生导航条
+ final List tabBar = mpPagesService.list(new LambdaQueryWrapper().eq(MpPages::getSubpackage, "MainPackage").last("limit 5"));
+ map.put("tabBar", tabBar);
+
+ // 配置信息
+ HashMap config = new HashMap<>();
+ config.put("LICENSE_CODE", "");
+ config.put("MAP_KEY", "");
+ final List fields = mpFieldService.list();
+ fields.forEach(d -> {
+ config.put(d.getName(), d.getValue());
+ });
+ map.put("config", config);
+
+ // 服务器时间
+ HashMap serverTime = new HashMap<>();
+ // 今天日期
+ DateTime date = DateUtil.date();
+ String today = DateUtil.today();
+ // 明天日期
+ final DateTime dateTime = DateUtil.tomorrow();
+ String tomorrow = DateUtil.format(dateTime, "yyyy-MM-dd");
+ // 后天日期
+ final DateTime dateTime2 = DateUtil.offsetDay(date, 2);
+ final String afterDay = DateUtil.format(dateTime2, "yyyy-MM-dd");
+ // 今天星期几
+ final int week = DateUtil.thisDayOfWeek();
+ final DateTime nextWeek = DateUtil.nextWeek();
+ serverTime.put("now", DateUtil.now()); // 2024-07-18 22:06:36
+ serverTime.put("today", today); // 2024-07-18
+ serverTime.put("tomorrow", tomorrow); // 2024-07-19
+ serverTime.put("afterDay", afterDay); // 2024-07-20
+ serverTime.put("nextWeek", nextWeek); // 2024-07-25 22:06:36
+ serverTime.put("week", week); // 5
+ map.put("serverTime", serverTime);
+ redisUtil.set(key, map, 1L, TimeUnit.DAYS);
+ return success(map);
+ }
+
+ private void createMp() {
+ System.out.println("创建小程序 = ");
+ final User loginUser = getLoginUser();
+ final Integer tenantId = getTenantId();
+ // 创建网站记录
+ final Mp mp = new Mp();
+ mp.setTenantId(tenantId);
+ mp.setAppId("小程序ID");
+ mp.setMpName("小程序名称");
+ mp.setMainPath("/pages/index");
+ if (loginUser != null) {
+ mp.setUserId(getLoginUserId());
+ }
+ mp.setExpirationTime(DateUtil.offset(DateUtil.date(), DateField.YEAR, 1));
+ mpService.save(mp);
+
+ // 创建底部导航栏
+ final MpPages mpPages = new MpPages();
+ mpPages.setHome(1);
+ mpPages.setTitle("首页");
+ mpPages.setPath("/pages/index");
+ mpPages.setSubpackage("MainPackage");
+ mpPages.setIcon("HomeOutlined");
+ mpPages.setSortNumber(0);
+ mpPages.setTenantId(tenantId);
+ mpPagesService.save(mpPages);
+ mpPages.setHome(0);
+ mpPages.setTitle("分类");
+ mpPages.setPath("/pages/category");
+ mpPages.setSubpackage("MainPackage");
+ mpPages.setIcon("AppstoreOutlined");
+ mpPages.setSortNumber(0);
+ mpPagesService.save(mpPages);
+ mpPages.setTitle("购物车");
+ mpPages.setPath("/pages/category");
+ mpPages.setSubpackage("MainPackage");
+ mpPages.setIcon("ShoppingCartOutlined");
+ mpPages.setSortNumber(0);
+ mpPagesService.save(mpPages);
+ mpPages.setTitle("我的");
+ mpPages.setPath("/pages/user");
+ mpPages.setSubpackage("MainPackage");
+ mpPages.setIcon("UserOutlined");
+ mpPages.setSortNumber(0);
+ mpPagesService.save(mpPages);
+
+ // 创建导航图标
+ final MpMenu mpMenu = new MpMenu();
+ mpMenu.setTenantId(tenantId);
+ mpMenu.setTitle("分类1");
+ mpMenu.setIcon("PictureOutlined");
+ mpMenu.setPath("/package/order");
+ mpMenu.setTarget("uni.navigateTo");
+ mpMenuService.save(mpMenu);
+ mpMenu.setTitle("分类2");
+ mpMenu.setIcon("PictureOutlined");
+ mpMenu.setPath("/package/order");
+ mpMenuService.save(mpMenu);
+ mpMenu.setTitle("分类3");
+ mpMenu.setIcon("PictureOutlined");
+ mpMenu.setPath("/package/order");
+ mpMenuService.save(mpMenu);
+ mpMenu.setTitle("分类4");
+ mpMenu.setIcon("PictureOutlined");
+ mpMenu.setPath("/package/order");
+ mpMenuService.save(mpMenu);
+
+ // 小程序配置信息
+ MpField field = new MpField();
+ field.setName("mpLogo");
+ mpFieldService.save(field);
+ }
+
+ @ApiOperation("首页数据")
+ @GetMapping("/index")
+ public ApiResult> index(GoodsParam param) {
+ // 使用关联查询
+ final HashMap layout = new HashMap<>();
+ // 瀑布流商品数据 (type:0 商城商品,1 外卖商品)
// final List goods = goodsService.list(new LambdaQueryWrapper().ne(Goods::getType, 0).last("limit 10"));
// final List foods = goodsService.list(new LambdaQueryWrapper().eq(Goods::getType, 1).last("limit 10"));
- layout.put("goods",goodsService.getGoodsSpecType0());
- layout.put("foods", goodsService.getGoodsSpecType1());
+ List goodsList = goodsService.getGoodsSpecType0(param);
+ if (getLoginUser() != null) {
+ for (Goods goods : goodsList) {
+ if (getLoginUser().getGradeId().equals(33)) {
+ if (goods.getDealerGift()) goods.setShowGift(true);
+ goods.setPrice(goods.getDealerPrice());
+ }
+ // 会员店
+ if (getLoginUser().getGradeId().equals(31)) {
+ if (goods.getPriceGift()) goods.setShowGift(true);
+ }
+ if (getLoginUser().getGradeId().equals(0)) {
+ goods.setPrice(goods.getSalePrice());
+ }
+ }
+ }else {
+ for (Goods goods : goodsList) {
+ goods.setPrice(goods.getSalePrice());
+ }
+ }
+ layout.put("goods", goodsList);
+ layout.put("foods", goodsService.getGoodsSpecType1());
- return success(layout);
- }
+ return success(layout);
+ }
- @PreAuthorize("hasAuthority('cms:mp:remove')")
- @ApiOperation("清除缓存")
- @DeleteMapping("/clearMpInfo/{key}")
- public ApiResult> clearSiteInfo(@PathVariable("key") String key) {
- redisUtil.delete("MpInfo:" + getTenantId());
- return success("清除成功");
- }
+ @PreAuthorize("hasAuthority('cms:mp:remove')")
+ @ApiOperation("清除缓存")
+ @DeleteMapping("/clearMpInfo/{key}")
+ public ApiResult> clearSiteInfo(@PathVariable("key") String key) {
+ redisUtil.delete("MpInfo:" + getTenantId());
+ return success("清除成功");
+ }
}
diff --git a/src/main/java/com/gxwebsoft/cms/entity/Article.java b/src/main/java/com/gxwebsoft/cms/entity/Article.java
index 03dd84b..c0d9ed6 100644
--- a/src/main/java/com/gxwebsoft/cms/entity/Article.java
+++ b/src/main/java/com/gxwebsoft/cms/entity/Article.java
@@ -46,6 +46,10 @@ public class Article implements Serializable {
@ApiModelProperty(value = "封面图")
private String image;
+ private Integer imageWidth;
+
+ private Integer imageHeight;
+
@ApiModelProperty(value = "来源")
private String source;
diff --git a/src/main/java/com/gxwebsoft/cms/entity/DesignCollect.java b/src/main/java/com/gxwebsoft/cms/entity/DesignCollect.java
new file mode 100644
index 0000000..a9cbd9c
--- /dev/null
+++ b/src/main/java/com/gxwebsoft/cms/entity/DesignCollect.java
@@ -0,0 +1,61 @@
+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 com.baomidou.mybatisplus.annotation.TableLogic;
+import java.io.Serializable;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 设计征集
+ *
+ * @author 科技小王子
+ * @since 2024-10-08 15:21:56
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@ApiModel(value = "DesignCollect对象", description = "设计征集")
+@TableName("cms_design_collect")
+public class DesignCollect implements Serializable {
+ private static final long serialVersionUID = 1L;
+
+ @TableId(value = "id", type = IdType.AUTO)
+ private Integer id;
+
+ private String title;
+
+ private String content;
+
+ private String image;
+
+ @ApiModelProperty(value = "用户ID")
+ private Integer userId;
+
+ @ApiModelProperty(value = "排序(数字越小越靠前)")
+ private Integer sortNumber;
+
+ @ApiModelProperty(value = "备注")
+ private String comments;
+
+ @ApiModelProperty(value = "状态, 0已发布, 1待审核 2已驳回 3违规内容")
+ private Integer status;
+
+ @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/cms/entity/DesignSignUp.java b/src/main/java/com/gxwebsoft/cms/entity/DesignSignUp.java
new file mode 100644
index 0000000..e5013f9
--- /dev/null
+++ b/src/main/java/com/gxwebsoft/cms/entity/DesignSignUp.java
@@ -0,0 +1,63 @@
+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 com.baomidou.mybatisplus.annotation.TableLogic;
+import java.io.Serializable;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 设计征集报名
+ *
+ * @author 科技小王子
+ * @since 2024-10-08 15:21:56
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@ApiModel(value = "DesignSignUp对象", description = "设计征集报名")
+@TableName("cms_design_sign_up")
+public class DesignSignUp implements Serializable {
+ private static final long serialVersionUID = 1L;
+
+ @TableId(value = "id", type = IdType.AUTO)
+ private Integer id;
+
+ private Integer designId;
+
+ private String name;
+
+ private String phone;
+
+ private String content;
+
+ @ApiModelProperty(value = "用户ID")
+ private Integer userId;
+
+ @ApiModelProperty(value = "排序(数字越小越靠前)")
+ private Integer sortNumber;
+
+ @ApiModelProperty(value = "备注")
+ private String comments;
+
+ @ApiModelProperty(value = "状态, 0已发布, 1待审核 2已驳回 3违规内容")
+ private Integer status;
+
+ @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/cms/mapper/DesignCollectMapper.java b/src/main/java/com/gxwebsoft/cms/mapper/DesignCollectMapper.java
new file mode 100644
index 0000000..e045b50
--- /dev/null
+++ b/src/main/java/com/gxwebsoft/cms/mapper/DesignCollectMapper.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.DesignCollect;
+import com.gxwebsoft.cms.param.DesignCollectParam;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * 设计征集Mapper
+ *
+ * @author 科技小王子
+ * @since 2024-10-08 15:21:56
+ */
+public interface DesignCollectMapper extends BaseMapper {
+
+ /**
+ * 分页查询
+ *
+ * @param page 分页对象
+ * @param param 查询参数
+ * @return List
+ */
+ List selectPageRel(@Param("page") IPage page,
+ @Param("param") DesignCollectParam param);
+
+ /**
+ * 查询全部
+ *
+ * @param param 查询参数
+ * @return List
+ */
+ List selectListRel(@Param("param") DesignCollectParam param);
+
+}
diff --git a/src/main/java/com/gxwebsoft/cms/mapper/DesignSignUpMapper.java b/src/main/java/com/gxwebsoft/cms/mapper/DesignSignUpMapper.java
new file mode 100644
index 0000000..d7c2045
--- /dev/null
+++ b/src/main/java/com/gxwebsoft/cms/mapper/DesignSignUpMapper.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.DesignSignUp;
+import com.gxwebsoft.cms.param.DesignSignUpParam;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * 设计征集报名Mapper
+ *
+ * @author 科技小王子
+ * @since 2024-10-08 15:21:56
+ */
+public interface DesignSignUpMapper extends BaseMapper {
+
+ /**
+ * 分页查询
+ *
+ * @param page 分页对象
+ * @param param 查询参数
+ * @return List
+ */
+ List selectPageRel(@Param("page") IPage page,
+ @Param("param") DesignSignUpParam param);
+
+ /**
+ * 查询全部
+ *
+ * @param param 查询参数
+ * @return List
+ */
+ List selectListRel(@Param("param") DesignSignUpParam param);
+
+}
diff --git a/src/main/java/com/gxwebsoft/cms/mapper/xml/ArticleMapper.xml b/src/main/java/com/gxwebsoft/cms/mapper/xml/ArticleMapper.xml
index d7830e6..2a8510e 100644
--- a/src/main/java/com/gxwebsoft/cms/mapper/xml/ArticleMapper.xml
+++ b/src/main/java/com/gxwebsoft/cms/mapper/xml/ArticleMapper.xml
@@ -110,12 +110,10 @@
AND (a.title LIKE CONCAT('%', #{param.keywords}, '%')
- OR a.phone LIKE CONCAT('%', #{param.keywords}, '%')
- OR a.region LIKE CONCAT('%', #{param.keywords}, '%')
- OR a.user_id = #{param.keywords}
)
+ ORDER BY a.sort_number ASC, a.create_time DESC
diff --git a/src/main/java/com/gxwebsoft/cms/mapper/xml/DesignCollectMapper.xml b/src/main/java/com/gxwebsoft/cms/mapper/xml/DesignCollectMapper.xml
new file mode 100644
index 0000000..0a2fe3a
--- /dev/null
+++ b/src/main/java/com/gxwebsoft/cms/mapper/xml/DesignCollectMapper.xml
@@ -0,0 +1,63 @@
+
+
+
+
+
+
+ SELECT a.*
+ FROM cms_design_collect a
+
+
+ AND a.id = #{param.id}
+
+
+ AND a.title LIKE CONCAT('%', #{param.title}, '%')
+
+
+ AND a.content LIKE CONCAT('%', #{param.content}, '%')
+
+
+ AND a.image LIKE CONCAT('%', #{param.image}, '%')
+
+
+ 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.deleted = #{param.deleted}
+
+
+ AND a.deleted = 0
+
+
+ AND a.create_time >= #{param.createTimeStart}
+
+
+ AND a.create_time <= #{param.createTimeEnd}
+
+
+ AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%')
+ )
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/main/java/com/gxwebsoft/cms/mapper/xml/DesignSignUpMapper.xml b/src/main/java/com/gxwebsoft/cms/mapper/xml/DesignSignUpMapper.xml
new file mode 100644
index 0000000..9f287d3
--- /dev/null
+++ b/src/main/java/com/gxwebsoft/cms/mapper/xml/DesignSignUpMapper.xml
@@ -0,0 +1,66 @@
+
+
+
+
+
+
+ SELECT a.*
+ FROM cms_design_sign_up a
+
+
+ AND a.id = #{param.id}
+
+
+ AND a.design_id = #{param.designId}
+
+
+ AND a.name LIKE CONCAT('%', #{param.name}, '%')
+
+
+ AND a.phone LIKE CONCAT('%', #{param.phone}, '%')
+
+
+ AND a.content LIKE CONCAT('%', #{param.content}, '%')
+
+
+ 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.deleted = #{param.deleted}
+
+
+ AND a.deleted = 0
+
+
+ AND a.create_time >= #{param.createTimeStart}
+
+
+ AND a.create_time <= #{param.createTimeEnd}
+
+
+ AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%')
+ )
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/main/java/com/gxwebsoft/cms/param/DesignCollectParam.java b/src/main/java/com/gxwebsoft/cms/param/DesignCollectParam.java
new file mode 100644
index 0000000..42447fc
--- /dev/null
+++ b/src/main/java/com/gxwebsoft/cms/param/DesignCollectParam.java
@@ -0,0 +1,54 @@
+package com.gxwebsoft.cms.param;
+
+import java.math.BigDecimal;
+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-10-08 15:21:56
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@JsonInclude(JsonInclude.Include.NON_NULL)
+@ApiModel(value = "DesignCollectParam对象", description = "设计征集查询参数")
+public class DesignCollectParam extends BaseParam {
+ private static final long serialVersionUID = 1L;
+
+ @QueryField(type = QueryType.EQ)
+ private Integer id;
+
+ private String title;
+
+ private String content;
+
+ private String image;
+
+ @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待审核 2已驳回 3违规内容")
+ @QueryField(type = QueryType.EQ)
+ private Integer status;
+
+ @ApiModelProperty(value = "是否删除, 0否, 1是")
+ @QueryField(type = QueryType.EQ)
+ private Integer deleted;
+
+}
diff --git a/src/main/java/com/gxwebsoft/cms/param/DesignSignUpParam.java b/src/main/java/com/gxwebsoft/cms/param/DesignSignUpParam.java
new file mode 100644
index 0000000..ead3928
--- /dev/null
+++ b/src/main/java/com/gxwebsoft/cms/param/DesignSignUpParam.java
@@ -0,0 +1,57 @@
+package com.gxwebsoft.cms.param;
+
+import java.math.BigDecimal;
+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-10-08 15:21:56
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@JsonInclude(JsonInclude.Include.NON_NULL)
+@ApiModel(value = "DesignSignUpParam对象", description = "设计征集报名查询参数")
+public class DesignSignUpParam extends BaseParam {
+ private static final long serialVersionUID = 1L;
+
+ @QueryField(type = QueryType.EQ)
+ private Integer id;
+
+ @QueryField(type = QueryType.EQ)
+ private Integer designId;
+
+ private String name;
+
+ private String phone;
+
+ private String content;
+
+ @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待审核 2已驳回 3违规内容")
+ @QueryField(type = QueryType.EQ)
+ private Integer status;
+
+ @ApiModelProperty(value = "是否删除, 0否, 1是")
+ @QueryField(type = QueryType.EQ)
+ private Integer deleted;
+
+}
diff --git a/src/main/java/com/gxwebsoft/cms/service/DesignCollectService.java b/src/main/java/com/gxwebsoft/cms/service/DesignCollectService.java
new file mode 100644
index 0000000..5b143c7
--- /dev/null
+++ b/src/main/java/com/gxwebsoft/cms/service/DesignCollectService.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.DesignCollect;
+import com.gxwebsoft.cms.param.DesignCollectParam;
+
+import java.util.List;
+
+/**
+ * 设计征集Service
+ *
+ * @author 科技小王子
+ * @since 2024-10-08 15:21:56
+ */
+public interface DesignCollectService extends IService {
+
+ /**
+ * 分页关联查询
+ *
+ * @param param 查询参数
+ * @return PageResult
+ */
+ PageResult pageRel(DesignCollectParam param);
+
+ /**
+ * 关联查询全部
+ *
+ * @param param 查询参数
+ * @return List
+ */
+ List listRel(DesignCollectParam param);
+
+ /**
+ * 根据id查询
+ *
+ * @param id
+ * @return DesignCollect
+ */
+ DesignCollect getByIdRel(Integer id);
+
+}
diff --git a/src/main/java/com/gxwebsoft/cms/service/DesignSignUpService.java b/src/main/java/com/gxwebsoft/cms/service/DesignSignUpService.java
new file mode 100644
index 0000000..326d81a
--- /dev/null
+++ b/src/main/java/com/gxwebsoft/cms/service/DesignSignUpService.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.DesignSignUp;
+import com.gxwebsoft.cms.param.DesignSignUpParam;
+
+import java.util.List;
+
+/**
+ * 设计征集报名Service
+ *
+ * @author 科技小王子
+ * @since 2024-10-08 15:21:56
+ */
+public interface DesignSignUpService extends IService {
+
+ /**
+ * 分页关联查询
+ *
+ * @param param 查询参数
+ * @return PageResult
+ */
+ PageResult pageRel(DesignSignUpParam param);
+
+ /**
+ * 关联查询全部
+ *
+ * @param param 查询参数
+ * @return List
+ */
+ List listRel(DesignSignUpParam param);
+
+ /**
+ * 根据id查询
+ *
+ * @param id
+ * @return DesignSignUp
+ */
+ DesignSignUp getByIdRel(Integer id);
+
+}
diff --git a/src/main/java/com/gxwebsoft/cms/service/impl/DesignCollectServiceImpl.java b/src/main/java/com/gxwebsoft/cms/service/impl/DesignCollectServiceImpl.java
new file mode 100644
index 0000000..7c72f61
--- /dev/null
+++ b/src/main/java/com/gxwebsoft/cms/service/impl/DesignCollectServiceImpl.java
@@ -0,0 +1,47 @@
+package com.gxwebsoft.cms.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.gxwebsoft.cms.mapper.DesignCollectMapper;
+import com.gxwebsoft.cms.service.DesignCollectService;
+import com.gxwebsoft.cms.entity.DesignCollect;
+import com.gxwebsoft.cms.param.DesignCollectParam;
+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-10-08 15:21:56
+ */
+@Service
+public class DesignCollectServiceImpl extends ServiceImpl implements DesignCollectService {
+
+ @Override
+ public PageResult pageRel(DesignCollectParam param) {
+ PageParam page = new PageParam<>(param);
+ page.setDefaultOrder("sort_number asc, create_time desc");
+ List list = baseMapper.selectPageRel(page, param);
+ return new PageResult<>(list, page.getTotal());
+ }
+
+ @Override
+ public List listRel(DesignCollectParam param) {
+ List list = baseMapper.selectListRel(param);
+ // 排序
+ PageParam page = new PageParam<>();
+ page.setDefaultOrder("sort_number asc, create_time desc");
+ return page.sortRecords(list);
+ }
+
+ @Override
+ public DesignCollect getByIdRel(Integer id) {
+ DesignCollectParam param = new DesignCollectParam();
+ param.setId(id);
+ return param.getOne(baseMapper.selectListRel(param));
+ }
+
+}
diff --git a/src/main/java/com/gxwebsoft/cms/service/impl/DesignSignUpServiceImpl.java b/src/main/java/com/gxwebsoft/cms/service/impl/DesignSignUpServiceImpl.java
new file mode 100644
index 0000000..b397586
--- /dev/null
+++ b/src/main/java/com/gxwebsoft/cms/service/impl/DesignSignUpServiceImpl.java
@@ -0,0 +1,47 @@
+package com.gxwebsoft.cms.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.gxwebsoft.cms.mapper.DesignSignUpMapper;
+import com.gxwebsoft.cms.service.DesignSignUpService;
+import com.gxwebsoft.cms.entity.DesignSignUp;
+import com.gxwebsoft.cms.param.DesignSignUpParam;
+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-10-08 15:21:56
+ */
+@Service
+public class DesignSignUpServiceImpl extends ServiceImpl implements DesignSignUpService {
+
+ @Override
+ public PageResult pageRel(DesignSignUpParam param) {
+ PageParam page = new PageParam<>(param);
+ page.setDefaultOrder("sort_number asc, create_time desc");
+ List list = baseMapper.selectPageRel(page, param);
+ return new PageResult<>(list, page.getTotal());
+ }
+
+ @Override
+ public List listRel(DesignSignUpParam param) {
+ List list = baseMapper.selectListRel(param);
+ // 排序
+ PageParam page = new PageParam<>();
+ page.setDefaultOrder("sort_number asc, create_time desc");
+ return page.sortRecords(list);
+ }
+
+ @Override
+ public DesignSignUp getByIdRel(Integer id) {
+ DesignSignUpParam param = new DesignSignUpParam();
+ param.setId(id);
+ return param.getOne(baseMapper.selectListRel(param));
+ }
+
+}
diff --git a/src/main/java/com/gxwebsoft/common/core/security/SecurityConfig.java b/src/main/java/com/gxwebsoft/common/core/security/SecurityConfig.java
index 5d42e0d..6f5857b 100644
--- a/src/main/java/com/gxwebsoft/common/core/security/SecurityConfig.java
+++ b/src/main/java/com/gxwebsoft/common/core/security/SecurityConfig.java
@@ -67,7 +67,8 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
"/5zbYEPkyV4.txt",
"/api/love/user-plan-log/wx-pay/**",
"/api/cms/form-record",
- "/api/shop/merchant-account/getMerchantAccountByPhone"
+ "/api/shop/merchant-account/getMerchantAccountByPhone",
+ "/api/shop/order-delivery/notify"
)
.permitAll()
.anyRequest()
diff --git a/src/main/java/com/gxwebsoft/common/core/utils/RequestUtil.java b/src/main/java/com/gxwebsoft/common/core/utils/RequestUtil.java
index e56067f..2f6a6b1 100644
--- a/src/main/java/com/gxwebsoft/common/core/utils/RequestUtil.java
+++ b/src/main/java/com/gxwebsoft/common/core/utils/RequestUtil.java
@@ -24,222 +24,256 @@ import java.util.HashMap;
@Component
public class RequestUtil {
- private static final String host = "https://server.gxwebsoft.com/api";
- private static String ACCESS_TOKEN;
- private static String TENANT_ID;
+ private static final String host = "https://server.gxwebsoft.com/api";
+ private static String ACCESS_TOKEN;
+ private static String TENANT_ID;
- public void setTenantId(String tenantId) {
- TENANT_ID = tenantId;
- }
-
- public void setAccessToken(String token) {
- ACCESS_TOKEN = token;
- }
-
- // 预付请求付款(余额支付)
- public Object balancePay(Order order){
- // 设置租户ID
- setTenantId(order.getTenantId().toString());
- // 设置token
- setAccessToken(order.getAccessToken());
- // 余额支付接口
- String path = "/system/payment/balancePay";
- try {
- // 链式构建请求
- final String body = HttpRequest.post(host.concat(path))
- .header("Tenantid", TENANT_ID)
- .header("Authorization", ACCESS_TOKEN)
- .body(JSONUtil.toJSONString(order))//表单内容
- .timeout(20000)//超时,毫秒
- .execute().body();
-
- return JSONUtil.parseObject(body, ApiResult.class).getData();
-
- } catch (Exception e) {
- e.printStackTrace();
+ public void setTenantId(String tenantId) {
+ TENANT_ID = tenantId;
}
- return null;
- }
- // 微信支付通知
- public String pushWxPayNotify(Transaction transaction, Payment payment){
- // 设置租户ID
- setTenantId(payment.getTenantId().toString());
- // 推送支付通知地址
- String path = payment.getNotifyUrl();
- try {
- // 链式构建请求
- return HttpRequest.post(path)
- .header("Tenantid", TENANT_ID)
- .body(JSONUtil.toJSONString(transaction))//表单内容
- .timeout(20000)//超时,毫秒
- .execute().body();
-
- } catch (Exception e) {
- e.printStackTrace();
+ public void setAccessToken(String token) {
+ ACCESS_TOKEN = token;
}
- return "支付失败";
- }
+ // 预付请求付款(余额支付)
+ public Object balancePay(Order order) {
+ // 设置租户ID
+ setTenantId(order.getTenantId().toString());
+ // 设置token
+ setAccessToken(order.getAccessToken());
+ // 余额支付接口
+ String path = "/system/payment/balancePay";
+ try {
+ // 链式构建请求
+ final String body = HttpRequest.post(host.concat(path))
+ .header("Tenantid", TENANT_ID)
+ .header("Authorization", ACCESS_TOKEN)
+ .body(JSONUtil.toJSONString(order))//表单内容
+ .timeout(20000)//超时,毫秒
+ .execute().body();
+ System.out.println("body:" + body);
+ return JSONUtil.parseObject(body, ApiResult.class).getData();
- public User getUserByPhone(String phone) {
- String path = "/system/user/getByPhone/" + phone;
- try {
- // 链式构建请求
- String result = HttpRequest.get(host.concat(path))
- .header("Authorization", ACCESS_TOKEN)
- .header("Tenantid", TENANT_ID)
- .timeout(20000)//超时,毫秒
- .execute().body();
-
- JSONObject jsonObject = JSONObject.parseObject(result);
- final String data = jsonObject.getString("data");
- return JSONObject.parseObject(data, User.class);
- } catch (Exception e) {
- e.printStackTrace();
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ return null;
}
- return null;
- }
- public User getByUserId(Integer userId) {
- String path = "/system/user/" + userId;
- try {
- // 链式构建请求
- String result = HttpRequest.get(host.concat(path))
- .header("Authorization", ACCESS_TOKEN)
- .header("Tenantid", TENANT_ID)
- .timeout(20000)//超时,毫秒
- .execute().body();
+ // 微信支付通知
+ public String pushWxPayNotify(Transaction transaction, Payment payment) {
+ // 设置租户ID
+ setTenantId(payment.getTenantId().toString());
+ // 推送支付通知地址
+ String path = payment.getNotifyUrl();
+ try {
+ // 链式构建请求
+ return HttpRequest.post(path)
+ .header("Tenantid", TENANT_ID)
+ .body(JSONUtil.toJSONString(transaction))//表单内容
+ .timeout(20000)//超时,毫秒
+ .execute().body();
- JSONObject jsonObject = JSONObject.parseObject(result);
- System.out.println("jsonObject = " + jsonObject);
- final String data = jsonObject.getString("data");
- return JSONObject.parseObject(data, User.class);
- } catch (Exception e) {
- e.printStackTrace();
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ return "支付失败";
}
- return null;
- }
- // 新增用户
- public boolean saveUserByPhone(MerchantAccount merchantAccount) {
- String path = "/system/user/";
- try {
- HashMap map = new HashMap<>();
- map.put("nickname", merchantAccount.getRealName());
- map.put("username", merchantAccount.getPhone());
- map.put("realName", merchantAccount.getRealName());
- map.put("phone", merchantAccount.getPhone());
- map.put("password", merchantAccount.getPassword());
- map.put("merchantId",merchantAccount.getMerchantId());
- map.put("merchantName",merchantAccount.getMerchantName());
- map.put("merchantAvatar",merchantAccount.getMerchantAvatar());
- final ArrayList