diff --git a/Cpop-Common/src/main/java/com/cpop/common/utils/JsonUtils.java b/Cpop-Common/src/main/java/com/cpop/common/utils/JsonUtils.java
new file mode 100644
index 0000000..b40f920
--- /dev/null
+++ b/Cpop-Common/src/main/java/com/cpop/common/utils/JsonUtils.java
@@ -0,0 +1,29 @@
+package com.cpop.common.utils;
+
+import com.fasterxml.jackson.annotation.JsonInclude.Include;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.SerializationFeature;
+
+/**
+ * @author Binary Wang
+ */
+public class JsonUtils {
+ private static final ObjectMapper JSON = new ObjectMapper();
+
+ static {
+ JSON.setSerializationInclusion(Include.NON_NULL);
+ JSON.configure(SerializationFeature.INDENT_OUTPUT, Boolean.TRUE);
+ }
+
+ public static String toJson(Object obj) {
+ try {
+ return JSON.writeValueAsString(obj);
+ } catch (JsonProcessingException e) {
+ e.printStackTrace();
+ }
+
+ return null;
+ }
+}
+
diff --git a/Cpop-Common/src/main/java/com/cpop/common/utils/ServletUtils.java b/Cpop-Common/src/main/java/com/cpop/common/utils/ServletUtils.java
index 3d3fc8f..8a847d9 100644
--- a/Cpop-Common/src/main/java/com/cpop/common/utils/ServletUtils.java
+++ b/Cpop-Common/src/main/java/com/cpop/common/utils/ServletUtils.java
@@ -2,6 +2,7 @@ package com.cpop.common.utils;
import com.alibaba.fastjson.JSONObject;
import com.cpop.common.utils.text.Convert;
+import com.sun.xml.internal.ws.util.UtilException;
import org.springframework.web.context.request.RequestAttributes;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
@@ -56,7 +57,7 @@ public class ServletUtils {
}
parameter = json.getString(name);
} catch (IOException e) {
- throw new RuntimeException(e);
+ throw new UtilException("获取分页参数失败!");
}
}
return Convert.toInt(parameter);
diff --git a/Cpop-Core/src/main/java/com/cpop/core/base/enums/OrderSource.java b/Cpop-Core/src/main/java/com/cpop/core/base/enums/OrderSource.java
new file mode 100644
index 0000000..18791b7
--- /dev/null
+++ b/Cpop-Core/src/main/java/com/cpop/core/base/enums/OrderSource.java
@@ -0,0 +1,36 @@
+package com.cpop.core.base.enums;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * 订单来源
+ */
+@Getter
+public enum OrderSource {
+
+ /**
+ * 商城
+ */
+ MALL("Mall",0.06);
+
+ OrderSource(String name, Double rate) {
+ this.rate = rate;
+ this.name = name;
+ }
+
+ /**
+ * 分账比例
+ */
+ private Double rate;
+
+ private String name;
+
+ public void setRate(Double rate) {
+ this.rate = rate;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+}
diff --git a/Cpop-Core/src/main/java/com/cpop/core/base/table/SysUser.java b/Cpop-Core/src/main/java/com/cpop/core/base/table/SysUser.java
index 2822efa..66b82fd 100644
--- a/Cpop-Core/src/main/java/com/cpop/core/base/table/SysUser.java
+++ b/Cpop-Core/src/main/java/com/cpop/core/base/table/SysUser.java
@@ -86,7 +86,7 @@ public class SysUser extends BaseEntity implements Serializable {
/**
* 用户类型
*/
- private UserType userType;
+ private String userType;
/**
* 逻辑删除(0否1是)
diff --git a/Cpop-Core/src/main/java/com/cpop/core/gateway/miniProgram/MiniUserLoginInfoBuild.java b/Cpop-Core/src/main/java/com/cpop/core/gateway/miniProgram/MiniUserLoginInfoBuild.java
index 1be508f..f9b1456 100644
--- a/Cpop-Core/src/main/java/com/cpop/core/gateway/miniProgram/MiniUserLoginInfoBuild.java
+++ b/Cpop-Core/src/main/java/com/cpop/core/gateway/miniProgram/MiniUserLoginInfoBuild.java
@@ -93,7 +93,7 @@ public class MiniUserLoginInfoBuild extends AbstractLoginInfoBuild {
.and("cmu.app_id = ?",credentials.get("appId"))
.and("cmu.open_id = ?",credentials.get("openId"))
//用户来源
- .and("cmu.source_type = ?",sourceType)
+ .and("cmu.source_type = ?",sourceType.toString())
.and("cmu.is_delete = 0")
.one();
if (row == null) {
@@ -110,7 +110,7 @@ public class MiniUserLoginInfoBuild extends AbstractLoginInfoBuild {
//保存小程序用户信息
LocalDateTime now = LocalDateTime.now();
RowKey snowFlakeId = RowKey.SNOW_FLAKE_ID;
- DbChain.table("cp_mini_user")
+ boolean save = DbChain.table("cp_mini_user")
.setId(snowFlakeId)
.set("user_id", loginInfo.getUserId())
.set("open_id", credentials.get("openId"))
@@ -118,20 +118,22 @@ public class MiniUserLoginInfoBuild extends AbstractLoginInfoBuild {
.set("brand_id", brand.getString("id"))
.set("nick_name", credentials.get("nickName"))
.set("avatar", credentials.get("avatar"))
- .set("source_type", sourceType)
+ .set("source_type", sourceType.toString())
.set("create_time", now)
.set("update_time", now)
.set("create_user_id", 1)
.set("update_user_id", 1)
.save();
- loginInfo.setOpenId((String) credentials.get("openId"))
- .setAppId((String) credentials.get("appId"))
- .setUserId(loginInfo.getUserId())
- .setBrandId(brand.getString("id"))
- .setNickName((String) credentials.get("nickName"))
- .setAvatar((String) credentials.get("avatar"))
- .setId(snowFlakeId.getValue())
- .setSourceType(sourceType);
+ if (save){
+ loginInfo.setOpenId((String) credentials.get("openId"))
+ .setAppId((String) credentials.get("appId"))
+ .setUserId(loginInfo.getUserId())
+ .setBrandId(brand.getString("id"))
+ .setNickName((String) credentials.get("nickName"))
+ .setAvatar((String) credentials.get("avatar"))
+ .setId(snowFlakeId.getValue())
+ .setSourceType(sourceType);
+ }
} else {
loginInfo.setOpenId(row.getString("openId"))
.setAppId(row.getString("appId"))
diff --git a/Cpop-Core/src/main/java/com/cpop/core/gateway/sys/SysLoginInfoBuild.java b/Cpop-Core/src/main/java/com/cpop/core/gateway/sys/SysLoginInfoBuild.java
index f8e67ac..8f5fab4 100644
--- a/Cpop-Core/src/main/java/com/cpop/core/gateway/sys/SysLoginInfoBuild.java
+++ b/Cpop-Core/src/main/java/com/cpop/core/gateway/sys/SysLoginInfoBuild.java
@@ -8,6 +8,7 @@ import com.cpop.core.base.entity.Permission;
import com.cpop.core.base.entity.loginInfo.MallStaffLoginInfo;
import com.cpop.core.base.entity.loginInfo.OamStaffLoginInfo;
import com.cpop.core.base.enums.SourceType;
+import com.cpop.core.base.enums.UserType;
import com.cpop.core.base.exception.CpopAuthenticationException;
import com.cpop.core.base.table.SysUser;
import com.mybatisflex.core.row.DbChain;
@@ -29,7 +30,7 @@ public class SysLoginInfoBuild extends AbstractLoginInfoBuild {
@Override
public LoginUser buildLoginUser(SysUser sysUser, Map credentials) {
- switch (sysUser.getUserType()) {
+ switch (UserType.valueOf(sysUser.getUserType())) {
case OAM_USER:
return getOamStaffLoginInfo(sysUser);
case MALL_USER:
diff --git a/Cpop-Core/src/main/java/com/cpop/core/mapper/CoreMapper.java b/Cpop-Core/src/main/java/com/cpop/core/mapper/CoreMapper.java
index e083c5e..47f693b 100644
--- a/Cpop-Core/src/main/java/com/cpop/core/mapper/CoreMapper.java
+++ b/Cpop-Core/src/main/java/com/cpop/core/mapper/CoreMapper.java
@@ -32,7 +32,7 @@ public interface CoreMapper {
* @Author DB
* @Date: 2023/8/27 23:39
*/
- SysUser getSysUserByUsername(@Param("username") String username, @Param("userType") UserType userType);
+ SysUser getSysUserByUsername(@Param("username") String username, @Param("userType") String userType);
/**
* @Description: 更新登录地址
@@ -42,7 +42,7 @@ public interface CoreMapper {
* @author DB
* @Date: 2023/8/28 0028 13:49
*/
- void updateSysUserLoginIp(String ipAddr, String username, UserType userType);
+ void updateSysUserLoginIp(String ipAddr, String username, String userType);
/**
* @Description: 加载参数缓存数据
@@ -129,5 +129,5 @@ public interface CoreMapper {
* @Author: DB
* @Date: 2023/8/27 23:37
*/
- SysUser getSysUserByPhone(@Param("phoneNumber") String phoneNumber, @Param("userType") UserType userType);
+ SysUser getSysUserByPhone(@Param("phoneNumber") String phoneNumber, @Param("userType") String userType);
}
diff --git a/Cpop-Core/src/main/java/com/cpop/core/service/RedisService.java b/Cpop-Core/src/main/java/com/cpop/core/service/RedisService.java
index 0a3a566..b5abafe 100644
--- a/Cpop-Core/src/main/java/com/cpop/core/service/RedisService.java
+++ b/Cpop-Core/src/main/java/com/cpop/core/service/RedisService.java
@@ -177,6 +177,13 @@ public interface RedisService {
*/
Collection keys(final String pattern);
+ /**
+ * 原子类递增减
+ * @param key 键
+ * @param stock 值
+ */
+ Long longIncrement(final String key, Long stock);
+
/**
* @param key
* @return
diff --git a/Cpop-Core/src/main/java/com/cpop/core/service/impl/CoreServiceImpl.java b/Cpop-Core/src/main/java/com/cpop/core/service/impl/CoreServiceImpl.java
index c770306..56f92be 100644
--- a/Cpop-Core/src/main/java/com/cpop/core/service/impl/CoreServiceImpl.java
+++ b/Cpop-Core/src/main/java/com/cpop/core/service/impl/CoreServiceImpl.java
@@ -94,7 +94,7 @@ public class CoreServiceImpl implements CoreService {
*/
@Override
public SysUser getSysUserByUsername(String username, UserType userType) {
- return coreMapper.getSysUserByUsername(username, userType);
+ return coreMapper.getSysUserByUsername(username, userType.toString());
}
/**
@@ -106,7 +106,7 @@ public class CoreServiceImpl implements CoreService {
*/
@Override
public void updateSysUserLoginIp(String ipAddr, String username, UserType userType) {
- coreMapper.updateSysUserLoginIp(ipAddr, username, userType);
+ coreMapper.updateSysUserLoginIp(ipAddr, username, userType.toString());
}
/**
@@ -244,7 +244,7 @@ public class CoreServiceImpl implements CoreService {
.setUserName(phoneNumber)
.setPhoneNumber(phoneNumber)
.setStatus(true)
- .setUserType(userType)
+ .setUserType(userType.toString())
.setCreateUserId("1");
sysUser.setUpdateUserId("1");
this.coreMapper.insertSysUser(sysUser);
@@ -272,6 +272,6 @@ public class CoreServiceImpl implements CoreService {
*/
@Override
public SysUser getSysUserByPhone(String phoneNumber, UserType userType) {
- return coreMapper.getSysUserByPhone(phoneNumber, userType);
+ return coreMapper.getSysUserByPhone(phoneNumber, userType.toString());
}
}
diff --git a/Cpop-Core/src/main/java/com/cpop/core/service/impl/RedisServiceImpl.java b/Cpop-Core/src/main/java/com/cpop/core/service/impl/RedisServiceImpl.java
index 170eeda..10f8cbe 100644
--- a/Cpop-Core/src/main/java/com/cpop/core/service/impl/RedisServiceImpl.java
+++ b/Cpop-Core/src/main/java/com/cpop/core/service/impl/RedisServiceImpl.java
@@ -134,6 +134,11 @@ public class RedisServiceImpl implements RedisService {
return redisTemplate.keys(pattern);
}
+ @Override
+ public Long longIncrement(final String key, Long stock) {
+ return redisTemplate.opsForValue().increment(key, stock);
+ }
+
/**
* @Description: 分布式锁
* @param key
diff --git a/Cpop-Core/src/main/java/com/cpop/core/utils/SecurityUtils.java b/Cpop-Core/src/main/java/com/cpop/core/utils/SecurityUtils.java
index dd3f01d..f8ca5ce 100644
--- a/Cpop-Core/src/main/java/com/cpop/core/utils/SecurityUtils.java
+++ b/Cpop-Core/src/main/java/com/cpop/core/utils/SecurityUtils.java
@@ -39,7 +39,8 @@ public class SecurityUtils {
**/
public LoginUser getLoginUser() {
Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
- if (authentication == null) {
+ //匿名用户
+ if (authentication.getPrincipal() == "anonymousUser") {
return null;
}
if (null != authentication.getCredentials()) {
@@ -58,6 +59,10 @@ public class SecurityUtils {
public JSONObject getLoginUserInfo() {
//获取当前登录用户信息
LoginUser loginUser = SecurityUtils.getInstance().getLoginUser();
+ //系统内部进行程序没有用户
+ if (loginUser == null) {
+ return null;
+ }
//获取缓存信息
JSONObject jsonObject = SpringUtils.getBean(RedisService.class).getCacheObject(loginUser.getUserType().getKey() + loginUser.getIdentification());
return jsonObject.getJSONObject("user");
diff --git a/Cpop-Generator/src/main/java/com/cpop/generator/CpopGenerator.java b/Cpop-Generator/src/main/java/com/cpop/generator/CpopGenerator.java
index 93a032f..f79a6c4 100644
--- a/Cpop-Generator/src/main/java/com/cpop/generator/CpopGenerator.java
+++ b/Cpop-Generator/src/main/java/com/cpop/generator/CpopGenerator.java
@@ -25,8 +25,8 @@ public class CpopGenerator {
/**
* 数据库 URL
*/
- private static final String URL = "jdbc:mysql://localhost:3306/cpop-dev?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8";
-
+ // private static final String URL = "jdbc:mysql://localhost:3306/cpop-dev?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8";
+ private static final String URL = "jdbc:mysql://sh-cynosdbmysql-grp-fggo83js.sql.tencentcdb.com:20965/cpop_test?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8";
/**
* 数据库用户名
*/
@@ -34,22 +34,23 @@ public class CpopGenerator {
/**
* 数据库密码
*/
- private static final String PASSWORD = "root";
+ //private static final String PASSWORD = "root";
+ private static final String PASSWORD = "Customer0401";
/**
* 输出路径
*/
- private static final String EXPORT_URL = "/Cpop-Mall";
+ private static final String EXPORT_URL = "/Cpop-System";
/**
* 模块
*/
- private static final String EXPORT_ITEM = "mall";
+ private static final String EXPORT_ITEM = "system";
/**
* 表前缀
*/
- private static final String TABLE_PREFIX = "cp_mall_";
+ private static final String TABLE_PREFIX = "cp_sys_";
/**
* 主入口
diff --git a/Cpop-Jambox/pom.xml b/Cpop-Jambox/pom.xml
index 7d276b0..baea947 100644
--- a/Cpop-Jambox/pom.xml
+++ b/Cpop-Jambox/pom.xml
@@ -18,10 +18,6 @@
com.cpop
Cpop-Core
-
- com.cpop
- Cpop-Sdk
-
diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/bo/BrandBo.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/bo/BrandBo.java
deleted file mode 100644
index 34dd05d..0000000
--- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/bo/BrandBo.java
+++ /dev/null
@@ -1,43 +0,0 @@
-package com.cpop.jambox.business.bo;
-
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import lombok.Data;
-import lombok.experimental.Accessors;
-
-import javax.validation.constraints.NotBlank;
-import java.io.Serializable;
-
-/**
- * 品牌表Bo
- *
- * @author DB.lost
- * @since 2023-06-01
- */
-@Data
-@Accessors(chain = true)
-@ApiModel(value = "Brand对象", description = "品牌表")
-public class BrandBo implements Serializable {
-
- private static final long serialVersionUID = 1L;
-
- /**
- * 主键
- */
- @ApiModelProperty("主键")
- private String id;
-
- /**
- * 品牌名
- */
- @NotBlank(message = "品牌名不能为空")
- @ApiModelProperty(value = "品牌名",required = true)
- private String name;
-
- /**
- * 背景地址
- */
- @ApiModelProperty("背景地址")
- private String backgroundUrl;
-
-}
diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/bo/BrandStaffBo.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/bo/BrandStaffBo.java
deleted file mode 100644
index 489f981..0000000
--- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/bo/BrandStaffBo.java
+++ /dev/null
@@ -1,63 +0,0 @@
-package com.cpop.jambox.business.bo;
-
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import lombok.Data;
-import lombok.experimental.Accessors;
-
-import javax.validation.constraints.NotBlank;
-import java.io.Serializable;
-import java.util.List;
-
-/**
- * 品牌管理员表Bo
- *
- * @author DB.lost
- * @since 2023-06-02
- */
-@Data
-@Accessors(chain = true)
-@ApiModel(value = "BrandStaff对象", description = "品牌管理员新增信息")
-public class BrandStaffBo implements Serializable {
-
- private static final long serialVersionUID = 1L;
-
- /**
- * 主键
- */
- @ApiModelProperty("主键")
- private String id;
-
- /**
- * 姓名
- */
- @NotBlank(message = "不能为空")
- @ApiModelProperty("姓名")
- private String name;
-
- /**
- * 身份(定位)
- */
- @ApiModelProperty("身份(定位)")
- private String position = "管理员";
-
- /**
- * 手机号
- */
- @NotBlank(message = "不能为空")
- @ApiModelProperty("手机号")
- private String phoneNumber;
-
- /**
- * 品牌id
- */
- @ApiModelProperty("品牌id")
- private List brandIds;
-
- /**
- * 校区id
- */
- @ApiModelProperty("校区id")
- private List campusIds;
-
-}
diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/bo/BrandStaffPageBo.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/bo/BrandStaffPageBo.java
deleted file mode 100644
index 125ced2..0000000
--- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/bo/BrandStaffPageBo.java
+++ /dev/null
@@ -1,41 +0,0 @@
-package com.cpop.jambox.business.bo;
-
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import lombok.Data;
-import lombok.experimental.Accessors;
-
-import java.io.Serializable;
-
-/**
- * Description:
- * date: 2023/6/2 11:59
- *
- * @Author ST
- */
-@Data
-@Accessors(chain = true)
-@ApiModel(value = "BrandManagementStaff分页对象", description = "品牌管理员表")
-public class BrandStaffPageBo implements Serializable {
-
- private static final long serialVersionUID = 1L;
-
- /**
- * 姓名
- */
- @ApiModelProperty("姓名")
- private String name;
-
- /**
- * 手机号
- */
- @ApiModelProperty("手机号")
- private String phoneNumber;
-
- /**
- * 品牌名
- */
- @ApiModelProperty("品牌名")
- private String brandName;
-
-}
diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/bo/CampusBo.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/bo/CampusBo.java
deleted file mode 100644
index dd85b6d..0000000
--- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/bo/CampusBo.java
+++ /dev/null
@@ -1,57 +0,0 @@
-package com.cpop.jambox.business.bo;
-
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import lombok.Data;
-import lombok.experimental.Accessors;
-
-import javax.validation.constraints.NotBlank;
-import java.io.Serializable;
-
-/**
- * 校区表Bo
- *
- * @author DB.lost
- * @since 2023-06-07
- */
-@Data
-@Accessors(chain = true)
-@ApiModel(value = "Campus对象", description = "校区表")
-public class CampusBo implements Serializable {
-
- private static final long serialVersionUID = 1L;
-
- /**
- * 主键
- */
- @ApiModelProperty("主键")
- private String id;
-
- /**
- * 品牌id
- */
- @ApiModelProperty(value = "品牌id")
- private String brandId;
-
- /**
- * 校区名
- */
- @NotBlank(message = "校区名不能为空")
- @ApiModelProperty(value = "校区名",required = true)
- private String name;
-
- /**
- * 负责人
- */
- @NotBlank(message = "负责人不能为空")
- @ApiModelProperty(value = "负责人",required = true)
- private String responsiblePerson;
-
- /**
- * 负责人手机号
- */
- @NotBlank(message = "负责人手机号不能为空")
- @ApiModelProperty(value = "负责人手机号",required = true)
- private String responsiblePersonPhone;
-
-}
diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/bo/CampusListByBrandBo.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/bo/CampusListByBrandBo.java
deleted file mode 100644
index c0da08c..0000000
--- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/bo/CampusListByBrandBo.java
+++ /dev/null
@@ -1,29 +0,0 @@
-package com.cpop.jambox.business.bo;
-
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import lombok.Data;
-import lombok.experimental.Accessors;
-
-import java.io.Serializable;
-import java.util.List;
-
-/**
- * @author: DB
- * @Date: 2023/07/04/18:06
- * @Description:
- */
-@Data
-@Accessors(chain = true)
-@ApiModel(value = "CampusListByBrandBo对象")
-public class CampusListByBrandBo implements Serializable {
-
- private static final long serialVersionUID = 1L;
-
- /**
- * 品牌id集合
- */
- @ApiModelProperty("品牌id集合")
- private List brandIds;
-
-}
diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/bo/CampusPageBo.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/bo/CampusPageBo.java
deleted file mode 100644
index d27a68f..0000000
--- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/bo/CampusPageBo.java
+++ /dev/null
@@ -1,26 +0,0 @@
-package com.cpop.jambox.business.bo;
-
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import lombok.Data;
-import lombok.experimental.Accessors;
-
-import java.io.Serializable;
-
-/**
- * @author: Administrator
- * @Date: 2023/06/07/10:16
- * @Description:
- */@Data
-@Accessors(chain = true)
-@ApiModel(value = "Campus分页list对象", description = "校区表")
-public class CampusPageBo implements Serializable {
-
- private static final long serialVersionUID = 1L;
-
- /**
- * 校区名
- */
- @ApiModelProperty("校区名")
- private String name;
-}
diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/bo/CardTemplateListBo.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/bo/CardTemplateListBo.java
deleted file mode 100644
index 6b436ee..0000000
--- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/bo/CardTemplateListBo.java
+++ /dev/null
@@ -1,29 +0,0 @@
-package com.cpop.jambox.business.bo;
-
-import io.swagger.annotations.ApiModelProperty;
-import lombok.Data;
-import lombok.experimental.Accessors;
-
-import java.io.Serializable;
-
-/**
- * @author DB
- * @createTime 2023/09/27 17:00
- * @description
- */
-@Data
-@Accessors(chain = true)
-public class CardTemplateListBo implements Serializable {
-
- /**
- * 云品牌id
- */
- @ApiModelProperty(value = "云品牌id")
- private String cloudBrandId;
-
- /**
- * 云校区id
- */
- @ApiModelProperty(value = "云校区id")
- private String cloudCampusId;
-}
diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/bo/CardTemplateUnionBo.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/bo/CardTemplateUnionBo.java
deleted file mode 100644
index b15a9d2..0000000
--- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/bo/CardTemplateUnionBo.java
+++ /dev/null
@@ -1,123 +0,0 @@
-package com.cpop.jambox.business.bo;
-
-import com.fasterxml.jackson.annotation.JsonFormat;
-import com.cpop.core.annontation.StringArrayConvert;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import lombok.Data;
-
-import javax.validation.constraints.NotBlank;
-import javax.validation.constraints.NotNull;
-import java.io.Serializable;
-import java.math.BigDecimal;
-import java.sql.Date;
-
-/**
- * @author: DB
- * @Date: 2023/08/31/11:18
- * @Description:
- */
-@Data
-@ApiModel(value = "课卡模板整合bo")
-public class CardTemplateUnionBo implements Serializable {
-
- private static final long serialVersionUID = 1L;
-
- /**
- * 主键
- */
- @ApiModelProperty("主键")
- private String id;
-
- /**
- * 课卡模板名
- */
- @NotBlank(message = "课卡模板名不能为空")
- @ApiModelProperty(value = "课卡模板名",required = true)
- private String name;
-
- /**
- * 云校区id
- */
- @ApiModelProperty("云校区id")
- private String cloudCampusId;
-
- /**
- * 云品牌id
- */
- @ApiModelProperty("云品牌id")
- private String cloudBrandId;
-
- /**
- * 使用范围
- */
- @NotBlank(message = "使用范围不能为空")
- @ApiModelProperty(value = "使用范围(少儿,成人...)", required = true)
- private String scopeUse;
-
- /**
- * 模板类型(0:课时卡,1:时限卡,2:储值卡)
- */
- @NotBlank(message = "模板类型不能为空")
- @ApiModelProperty(value = "模板类型(0:课时卡,1:时限卡,2:储值卡)",required = true)
- private String templateType;
-
- /**
- * 有效日期数
- */
- @ApiModelProperty(value = "有效日期数")
- private Integer validDay;
-
- /**
- * 结束时间
- */
- @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
- @ApiModelProperty(value = "结束日期")
- private Date endDate;
-
- /**
- * 价格
- */
- @NotNull(message = "价格不能为空")
- @ApiModelProperty(value = "价格",required = true)
- private BigDecimal price;
-
- /**
- * 周预约次数
- */
- @ApiModelProperty(value = "周预约次数")
- private Integer weekAppointment;
-
- /**
- * 日预约次数
- */
- @ApiModelProperty(value = "日预约次数")
- private Integer dayAppointment;
-
- /**
- * 缓冲天数
- */
- @ApiModelProperty(value = "缓冲天数")
- private Integer bufferDay;
-
- /**
- * 支付类型(0:微信支付;1:微信先学后付;2:放心学合约支付;3:数字人民币支付)
- */
- @StringArrayConvert
- @NotBlank(message = "支付类型不能为空")
- @ApiModelProperty(value = "支付类型(0:微信支付;1:微信先学后付;2:放心学合约支付;3:数字人民币支付;4:线下支付)",required = true)
- private String payType;
-
- /**
- * 课时(课时卡必穿)
- */
- @ApiModelProperty("课时(课时卡必穿)")
- private Integer classNumber;
-
- /**
- * 是否是会员(0否1是)
- */
- @ApiModelProperty("是否是会员(0否1是)")
- private Boolean isMember;
-
-}
diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/controller/CardTemplateController.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/controller/CardTemplateController.java
index f7eb892..0ec2687 100644
--- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/controller/CardTemplateController.java
+++ b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/controller/CardTemplateController.java
@@ -2,8 +2,6 @@ package com.cpop.jambox.business.controller;
import com.mybatisflex.core.paginate.Page;
import com.cpop.core.base.R;
-import com.cpop.jambox.business.bo.CardTemplateListBo;
-import com.cpop.jambox.business.bo.CardTemplateUnionBo;
import com.cpop.jambox.business.entity.CardTemplate;
import com.cpop.jambox.business.service.CardTemplateService;
import com.cpop.jambox.business.vo.CardTemplateListVo;
@@ -30,80 +28,4 @@ public class CardTemplateController {
@Autowired
private CardTemplateService cardTemplateService;
- /**
- * @descriptions 根据品牌或校区获取模板
- * @author DB
- * @date 2023/09/27 17:03
- * @param bo 请求参数
- * @return com.cpop.core.base.R>
- */
- @GetMapping("/getListByBrandOrCampus")
- @ApiOperation("根据品牌或校区获取模板")
- public R> getListByBrandOrCampus(CardTemplateListBo bo) {
- List list = cardTemplateService.getListByBrandOrCampus(bo);
- return R.ok(list);
- }
-
- /**
- * @descriptions 保存课卡模板
- * @author DB
- * @date 2023/09/27 17:37
- * @param bo 请求参数
- * @return com.cpop.core.base.R
- */
- @PostMapping("saveUnionCardTemplate")
- @ApiOperation("保存课卡模板")
- public R saveUnionCardTemplate(@RequestBody @ApiParam("果酱-课卡模板整合bo") CardTemplateUnionBo bo) {
- cardTemplateService.saveUnionCardTemplate(bo);
- return R.ok();
- }
-
- /**
- * 根据主键删除果酱-课卡模板。
- *
- * @param id 主键
- * @return {@code true} 删除成功,{@code false} 删除失败
- */
- @DeleteMapping("remove/{id}")
- @ApiOperation("根据主键果酱-课卡模板")
- public boolean remove(@PathVariable @ApiParam("果酱-课卡模板主键") Serializable id) {
- return cardTemplateService.removeById(id);
- }
-
- /**
- * 根据主键更新果酱-课卡模板。
- *
- * @param cardTemplate 果酱-课卡模板
- * @return {@code true} 更新成功,{@code false} 更新失败
- */
- @PutMapping("update")
- @ApiOperation("根据主键更新果酱-课卡模板")
- public boolean update(@RequestBody @ApiParam("果酱-课卡模板主键") CardTemplate cardTemplate) {
- return cardTemplateService.updateById(cardTemplate);
- }
-
- /**
- * 根据果酱-课卡模板主键获取详细信息。
- *
- * @param id 果酱-课卡模板主键
- * @return 果酱-课卡模板详情
- */
- @GetMapping("getInfo/{id}")
- @ApiOperation("根据主键获取果酱-课卡模板")
- public CardTemplate getInfo(@PathVariable @ApiParam("果酱-课卡模板主键") Serializable id) {
- return cardTemplateService.getById(id);
- }
-
- /**
- * 分页查询果酱-课卡模板。
- *
- * @param page 分页对象
- * @return 分页对象
- */
- @GetMapping("page")
- @ApiOperation("分页查询果酱-课卡模板")
- public Page page(@ApiParam("分页信息") Page page) {
- return cardTemplateService.page(page);
- }
-
}
diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/entity/BrandStaff.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/entity/BrandStaff.java
deleted file mode 100644
index d70f0cc..0000000
--- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/entity/BrandStaff.java
+++ /dev/null
@@ -1,65 +0,0 @@
-package com.cpop.jambox.business.entity;
-
-import com.mybatisflex.annotation.Column;
-import com.mybatisflex.annotation.Id;
-import com.mybatisflex.annotation.Table;
-import com.cpop.core.base.entity.BaseEntity;
-import com.cpop.core.base.entity.BaseInsertListener;
-import com.cpop.core.base.entity.BaseUpdateListener;
-import lombok.*;
-import lombok.experimental.Accessors;
-
-import java.io.Serializable;
-
-/**
- * 品牌管理员表 实体类。
- *
- * @author DB
- * @since 2023-09-13
- */
-@Data
-@EqualsAndHashCode(callSuper=false)
-@Builder
-@NoArgsConstructor
-@AllArgsConstructor
-@Accessors(chain = true)
-@Table(value = "cp_j_brand_staff", onInsert = BaseInsertListener.class, onUpdate = BaseUpdateListener.class, mapperGenerateEnable = false)
-public class BrandStaff extends BaseEntity implements Serializable {
-
- /**
- * 主键
- */
- @Id
- private String id;
-
- /**
- * 云id
- */
- private String brandStaffCloudId;
-
- /**
- * 姓名
- */
- private String name;
-
- /**
- * 手机号
- */
- private String phoneNumber;
-
- /**
- * 身份(定位)
- */
- private String position;
-
-
-
-
-
- /**
- * 是否删除(0否1是)
- */
- @Column(isLogicDelete = true)
- private Boolean isDelete;
-
-}
diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/entity/BrandStaffMidCampus.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/entity/BrandStaffMidCampus.java
deleted file mode 100644
index 0563919..0000000
--- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/entity/BrandStaffMidCampus.java
+++ /dev/null
@@ -1,46 +0,0 @@
-package com.cpop.jambox.business.entity;
-
-import com.mybatisflex.annotation.Table;
-import com.cpop.core.base.entity.BaseEntity;
-import com.cpop.core.base.entity.BaseInsertListener;
-import com.cpop.core.base.entity.BaseUpdateListener;
-import lombok.*;
-import lombok.experimental.Accessors;
-
-import java.io.Serializable;
-
-/**
- * 管理员-品牌-校区表 实体类。
- *
- * @author DB
- * @since 2023-09-13
- */
-@Data
-@EqualsAndHashCode(callSuper=false)
-@Builder
-@NoArgsConstructor
-@AllArgsConstructor
-@Accessors(chain = true)
-@Table(value = "cp_j_brand_staff_mid_campus", onInsert = BaseInsertListener.class, onUpdate = BaseUpdateListener.class, mapperGenerateEnable = false)
-public class BrandStaffMidCampus extends BaseEntity implements Serializable {
-
- /**
- * 品牌管理员id
- */
- private String brandStaffId;
-
- /**
- * 品牌id
- */
- private String brandId;
-
- /**
- * 校区id
- */
- private String campusId;
-
-
-
-
-
-}
diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/entity/Campus.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/entity/Campus.java
deleted file mode 100644
index e40a26f..0000000
--- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/entity/Campus.java
+++ /dev/null
@@ -1,86 +0,0 @@
-package com.cpop.jambox.business.entity;
-
-import com.mybatisflex.annotation.Column;
-import com.mybatisflex.annotation.Id;
-import com.mybatisflex.annotation.Table;
-import com.cpop.core.base.entity.BaseEntity;
-import com.cpop.core.base.entity.BaseInsertListener;
-import com.cpop.core.base.entity.BaseUpdateListener;
-import lombok.*;
-import lombok.experimental.Accessors;
-
-import java.io.Serializable;
-import java.time.LocalDateTime;
-
-/**
- * 校区表 实体类。
- *
- * @author DB
- * @since 2023-09-13
- */
-@Data
-@EqualsAndHashCode(callSuper=false)
-@Builder
-@NoArgsConstructor
-@AllArgsConstructor
-@Accessors(chain = true)
-@Table(value = "cp_j_campus", onInsert = BaseInsertListener.class, onUpdate = BaseUpdateListener.class, mapperGenerateEnable = false)
-public class Campus extends BaseEntity implements Serializable {
-
- /**
- * 主键
- */
- @Id
- private String id;
-
- /**
- * 云校区id
- */
- private String campusCloudId;
-
- /**
- * 品牌id
- */
- private String brandId;
-
- /**
- * 校区名
- */
- private String name;
-
- /**
- * 负责人
- */
- private String responsiblePerson;
-
- /**
- * 负责人手机号
- */
- private String responsiblePersonPhone;
-
- /**
- * 地址
- */
- private String address;
-
- /**
- * openId
- */
- private String openId;
-
- /**
- * 到期时间
- */
- private LocalDateTime expire;
-
-
-
-
-
- /**
- * 是否删除(0否1是)
- */
- @Column(isLogicDelete = true)
- private Boolean isDelete;
-
-}
diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/mapper/BrandStaffMapper.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/mapper/BrandStaffMapper.java
deleted file mode 100644
index 8683b64..0000000
--- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/mapper/BrandStaffMapper.java
+++ /dev/null
@@ -1,14 +0,0 @@
-package com.cpop.jambox.business.mapper;
-
-import com.mybatisflex.core.BaseMapper;
-import com.cpop.jambox.business.entity.BrandStaff;
-
-/**
- * 品牌管理员表 映射层。
- *
- * @author DB
- * @since 2023-09-13
- */
-public interface BrandStaffMapper extends BaseMapper {
-
-}
diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/mapper/BrandStaffMidCampusMapper.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/mapper/BrandStaffMidCampusMapper.java
deleted file mode 100644
index 8f1c35f..0000000
--- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/mapper/BrandStaffMidCampusMapper.java
+++ /dev/null
@@ -1,14 +0,0 @@
-package com.cpop.jambox.business.mapper;
-
-import com.mybatisflex.core.BaseMapper;
-import com.cpop.jambox.business.entity.BrandStaffMidCampus;
-
-/**
- * 管理员-品牌-校区表 映射层。
- *
- * @author DB
- * @since 2023-09-13
- */
-public interface BrandStaffMidCampusMapper extends BaseMapper {
-
-}
diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/mapper/CampusMapper.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/mapper/CampusMapper.java
deleted file mode 100644
index 970e1f3..0000000
--- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/mapper/CampusMapper.java
+++ /dev/null
@@ -1,14 +0,0 @@
-package com.cpop.jambox.business.mapper;
-
-import com.mybatisflex.core.BaseMapper;
-import com.cpop.jambox.business.entity.Campus;
-
-/**
- * 校区表 映射层。
- *
- * @author DB
- * @since 2023-09-13
- */
-public interface CampusMapper extends BaseMapper {
-
-}
diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/BrandStaffMidCampusService.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/BrandStaffMidCampusService.java
deleted file mode 100644
index 4d8d44c..0000000
--- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/BrandStaffMidCampusService.java
+++ /dev/null
@@ -1,14 +0,0 @@
-package com.cpop.jambox.business.service;
-
-import com.mybatisflex.core.service.IService;
-import com.cpop.jambox.business.entity.BrandStaffMidCampus;
-
-/**
- * 管理员-品牌-校区表 服务层。
- *
- * @author DB
- * @since 2023-09-13
- */
-public interface BrandStaffMidCampusService extends IService {
-
-}
diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/BrandStaffService.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/BrandStaffService.java
deleted file mode 100644
index bae2d43..0000000
--- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/BrandStaffService.java
+++ /dev/null
@@ -1,43 +0,0 @@
-package com.cpop.jambox.business.service;
-
-import com.mybatisflex.core.paginate.Page;
-import com.mybatisflex.core.service.IService;
-import com.cpop.jambox.business.bo.BrandStaffBo;
-import com.cpop.jambox.business.bo.BrandStaffPageBo;
-import com.cpop.jambox.business.entity.BrandStaff;
-import com.cpop.jambox.business.vo.BrandStaffPageVo;
-
-/**
- * 品牌管理员表 服务层。
- *
- * @author DB
- * @since 2023-09-13
- */
-public interface BrandStaffService extends IService {
-
- /**
- * @Description: 查询品牌管理员分页列表
- * @param bo 请求参数
- * @return: R>
- * @Author: DB
- * @Date: 2023/6/2 14:01
- **/
- Page getBrandStaffPage(BrandStaffPageBo bo);
-
- /**
- * @descriptions 新增品牌管理员
- * @author DB
- * @date 2023/09/14 16:54
- * @param bo 请求参数
- */
- void insertBrandStaff(BrandStaffBo bo);
-
- /**
- * @Description: 删除品牌管理员
- * @param id 主键
- * @return: R
- * @Author: DB
- * @Date: 2023/6/5 10:03
- **/
- void removeBrandStaffById(String id);
-}
diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/CampusService.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/CampusService.java
deleted file mode 100644
index 4582a70..0000000
--- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/CampusService.java
+++ /dev/null
@@ -1,34 +0,0 @@
-package com.cpop.jambox.business.service;
-
-import com.mybatisflex.core.paginate.Page;
-import com.mybatisflex.core.service.IService;
-import com.cpop.jambox.business.bo.CampusBo;
-import com.cpop.jambox.business.bo.CampusPageBo;
-import com.cpop.jambox.business.entity.Campus;
-import com.cpop.jambox.business.vo.CampusPageVo;
-
-/**
- * 校区表 服务层。
- *
- * @author DB
- * @since 2023-09-13
- */
-public interface CampusService extends IService {
-
- /**
- * @Description: 查询校区分页列表
- * @param bo 请求参数
- * @return R>
- * @Author Administrator
- * @Date: 2023/6/7 0007 10:18
- */
- Page getCampusPage(CampusPageBo bo);
-
- /**
- * @descriptions 修改校区
- * @author DB
- * @date 2023/09/14 11:40
- * @param bo 请求参数
- */
- void updateCampus(CampusBo bo);
-}
diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/CardTemplateService.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/CardTemplateService.java
index 3d5c76b..e3eb10f 100644
--- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/CardTemplateService.java
+++ b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/CardTemplateService.java
@@ -1,8 +1,6 @@
package com.cpop.jambox.business.service;
import com.mybatisflex.core.service.IService;
-import com.cpop.jambox.business.bo.CardTemplateListBo;
-import com.cpop.jambox.business.bo.CardTemplateUnionBo;
import com.cpop.jambox.business.entity.CardTemplate;
import com.cpop.jambox.business.vo.CardTemplateListVo;
@@ -16,21 +14,4 @@ import java.util.List;
*/
public interface CardTemplateService extends IService {
- /**
- * @descriptions 根据品牌或校区获取模板
- * @author DB
- * @date 2023/09/27 17:02
- * @param bo 请求参数
- * @return java.util.List
- */
- List getListByBrandOrCampus(CardTemplateListBo bo);
-
- /**
- * @descriptions 保存课卡模板
- * @author DB
- * @date 2023/09/27 18:00
- * @param bo 请求参数
- * @return: void
- */
- void saveUnionCardTemplate(CardTemplateUnionBo bo);
}
diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/impl/BrandStaffMidCampusServiceImpl.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/impl/BrandStaffMidCampusServiceImpl.java
deleted file mode 100644
index 76ae8c0..0000000
--- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/impl/BrandStaffMidCampusServiceImpl.java
+++ /dev/null
@@ -1,18 +0,0 @@
-package com.cpop.jambox.business.service.impl;
-
-import com.mybatisflex.spring.service.impl.ServiceImpl;
-import com.cpop.jambox.business.entity.BrandStaffMidCampus;
-import com.cpop.jambox.business.mapper.BrandStaffMidCampusMapper;
-import com.cpop.jambox.business.service.BrandStaffMidCampusService;
-import org.springframework.stereotype.Service;
-
-/**
- * 管理员-品牌-校区表 服务层实现。
- *
- * @author DB
- * @since 2023-09-13
- */
-@Service("brandStaffMidCampusService")
-public class BrandStaffMidCampusServiceImpl extends ServiceImpl implements BrandStaffMidCampusService {
-
-}
diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/impl/BrandStaffServiceImpl.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/impl/BrandStaffServiceImpl.java
deleted file mode 100644
index cb625c9..0000000
--- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/impl/BrandStaffServiceImpl.java
+++ /dev/null
@@ -1,142 +0,0 @@
-package com.cpop.jambox.business.service.impl;
-
-import com.mybatisflex.core.paginate.Page;
-import com.mybatisflex.core.query.QueryWrapper;
-import com.mybatisflex.spring.service.impl.ServiceImpl;
-import com.cpop.common.utils.bean.BeanUtils;
-import com.cpop.core.base.exception.ServiceException;
-import com.cpop.core.utils.SpringUtils;
-import com.cpop.jambox.business.bo.BrandStaffBo;
-import com.cpop.jambox.business.bo.BrandStaffPageBo;
-import com.cpop.jambox.business.entity.BrandStaff;
-import com.cpop.jambox.business.entity.BrandStaffMidCampus;
-import com.cpop.jambox.business.entity.Campus;
-import com.cpop.jambox.business.mapper.BrandStaffMapper;
-import com.cpop.jambox.business.service.BrandStaffMidCampusService;
-import com.cpop.jambox.business.service.BrandStaffService;
-import com.cpop.jambox.business.service.CampusService;
-import com.cpop.jambox.business.vo.BrandStaffPageVo;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Set;
-import java.util.stream.Collectors;
-
-import static com.cpop.jambox.business.entity.table.BrandStaffMidCampusTableDef.BRAND_STAFF_MID_CAMPUS;
-import static com.cpop.jambox.business.entity.table.CampusTableDef.CAMPUS;
-
-/**
- * 品牌管理员表 服务层实现。
- *
- * @author DB
- * @since 2023-09-13
- */
-@Service("brandStaffService")
-public class BrandStaffServiceImpl extends ServiceImpl implements BrandStaffService {
-
- /**
- * @Description: 查询品牌管理员分页列表
- * @param bo 请求参数
- * @return: R>
- * @Author: DB
- * @Date: 2023/6/2 14:01
- **/
- @Override
- public Page getBrandStaffPage(BrandStaffPageBo bo) {
- /*PageDomain pageDomain = SqlUtils.getInstance().getPageDomain();
- return this.mapper.paginateAs(pageDomain.getPageNum(),pageDomain.getPageSize(),
- QueryWrapper.create()
- .select(BRAND_STAFF.ID,BRAND_STAFF.NAME,BRAND_STAFF.PHONE_NUMBER,BRAND_STAFF.CREATE_TIME)
- .select(groupConcat(distinct(BRAND_STAFF_MID_CAMPUS.BRAND_ID)).as(BrandStaffPageVo::getBrandId), groupConcat(distinct(BRAND_STAFF_MID_CAMPUS.CAMPUS_ID)).as(BrandStaffPageVo::getCampusId))
- .select(groupConcat(distinct(BRAND.NAME)).as(BrandStaffPageVo::getBrandName))
- .select(groupConcat(distinct(CAMPUS.NAME)).as(BrandStaffPageVo::getCampusName))
- //管理员表
- .from(BRAND_STAFF)
- //中间表
- .leftJoin(BRAND_STAFF_MID_CAMPUS).on(BRAND_STAFF_MID_CAMPUS.BRAND_STAFF_ID.eq(BRAND_STAFF.ID))
- //品牌表
- .leftJoin(BRAND).on(BRAND.ID.eq(BRAND_STAFF_MID_CAMPUS.BRAND_ID))
- //校区表
- .leftJoin(CAMPUS).on(CAMPUS.ID.eq(BRAND_STAFF_MID_CAMPUS.CAMPUS_ID))
- .and(BRAND_STAFF.NAME.like(bo.getName()))
- .and(BRAND_STAFF.PHONE_NUMBER.eq(bo.getPhoneNumber()))
- .and(BRAND.NAME.like(bo.getBrandName()))
- .groupBy(BRAND_STAFF.ID),
- BrandStaffPageVo.class);*/
- return null;
- }
-
- /**
- * @descriptions 新增品牌管理员
- * @author DB
- * @date 2023/09/14 16:54
- * @param bo 请求参数
- */
- @Override
- @Transactional(rollbackFor = Exception.class)
- public void insertBrandStaff(BrandStaffBo bo) {
- BrandStaff brandStaff = BeanUtils.mapToClass(bo, BrandStaff.class);
- List list = new ArrayList<>();
- //是否有校区ids
- if (bo.getCampusIds().isEmpty()){
- //只有品牌
- if (bo.getBrandIds().isEmpty()) {
- throw new ServiceException("品牌与校区都不存在,添加失败");
- } else {
- //TODO:向云库添加管理员数据
- this.save(brandStaff);
- bo.getBrandIds().forEach(item -> {
- //中间表只有品牌信息
- BrandStaffMidCampus brandStaffMidCampus = new BrandStaffMidCampus();
- brandStaffMidCampus.setBrandStaffId(brandStaff.getId());
- brandStaffMidCampus.setBrandId(item);
- list.add(brandStaffMidCampus);
- });
- }
- } else {
- //先查询校区关联的品牌是否全包含在传入的品牌中
- List campusList = SpringUtils.getBean(CampusService.class).list(QueryWrapper.create().where(CAMPUS.ID.in(bo.getCampusIds())));
- Set campusBrandIds = campusList
- .stream().map(Campus::getBrandId).collect(Collectors.toSet());
- Set filterBrandIds = bo.getBrandIds().stream().filter(s -> !campusBrandIds.contains(s)).collect(Collectors.toSet());
- //存在只有品牌没有校区的数据
- if (!filterBrandIds.isEmpty()) {
- filterBrandIds.forEach(item -> {
- BrandStaffMidCampus brandStaffMidCampus = new BrandStaffMidCampus();
- brandStaffMidCampus.setBrandStaffId(brandStaff.getId());
- brandStaffMidCampus.setBrandId(item);
- list.add(brandStaffMidCampus);
- });
- }
- campusList.forEach(item -> {
- //中间表只有品牌信息
- BrandStaffMidCampus brandStaffMidCampus = new BrandStaffMidCampus();
- brandStaffMidCampus.setBrandStaffId(brandStaff.getId());
- brandStaffMidCampus.setBrandId(item.getBrandId());
- brandStaffMidCampus.setCampusId(item.getId());
- list.add(brandStaffMidCampus);
- });
- }
- //添加到中间表
- SpringUtils.getBean(BrandStaffMidCampusService.class).saveBatch(list);
- }
-
- /**
- * @Description: 删除品牌管理员
- * @param id 主键
- * @return: R
- * @Author: DB
- * @Date: 2023/6/5 10:03
- **/
- @Override
- @Transactional(rollbackFor = Exception.class)
- public void removeBrandStaffById(String id) {
- //删除中间表
- SpringUtils.getBean(BrandStaffMidCampusService.class).remove(QueryWrapper.create().where(BRAND_STAFF_MID_CAMPUS.BRAND_STAFF_ID.eq(id)));
- //删除数据
- this.removeById(id);
- //TODO:通知到云库
- }
-}
diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/impl/CampusServiceImpl.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/impl/CampusServiceImpl.java
deleted file mode 100644
index e5cdc11..0000000
--- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/impl/CampusServiceImpl.java
+++ /dev/null
@@ -1,54 +0,0 @@
-package com.cpop.jambox.business.service.impl;
-
-import com.mybatisflex.core.paginate.Page;
-import com.mybatisflex.spring.service.impl.ServiceImpl;
-import com.cpop.common.utils.bean.BeanUtils;
-import com.cpop.jambox.business.bo.CampusBo;
-import com.cpop.jambox.business.bo.CampusPageBo;
-import com.cpop.jambox.business.entity.Campus;
-import com.cpop.jambox.business.mapper.CampusMapper;
-import com.cpop.jambox.business.service.CampusService;
-import com.cpop.jambox.business.vo.CampusPageVo;
-import org.springframework.stereotype.Service;
-
-/**
- * 校区表 服务层实现。
- *
- * @author DB
- * @since 2023-09-13
- */
-@Service("campusService")
-public class CampusServiceImpl extends ServiceImpl implements CampusService {
-
- /**
- * @Description: 查询校区分页列表
- * @param bo 请求参数
- * @return R>
- * @Author Administrator
- * @Date: 2023/6/7 0007 10:18
- */
- @Override
- public Page getCampusPage(CampusPageBo bo) {
- /*PageDomain pageDomain = SqlUtils.getInstance().getPageDomain();
- return this.mapper.paginateAs(pageDomain.getPageNum(),pageDomain.getPageSize(),
- QueryWrapper.create()
- .select(CAMPUS.ALL_COLUMNS)
- .select(BRAND.NAME.as(CampusPageVo::getBrandName))
- .leftJoin(BRAND).on(BRAND.ID.eq(CAMPUS.BRAND_ID))
- .and(CAMPUS.NAME.like(bo.getName())),
- CampusPageVo.class);*/
- return null;
- }
-
- /**
- * @descriptions 修改校区
- * @author DB
- * @date 2023/09/14 11:40
- * @param bo 请求参数
- */
- @Override
- public void updateCampus(CampusBo bo) {
- this.updateById(BeanUtils.mapToClass(bo, Campus.class));
- //TODO:通知到云库
- }
-}
diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/impl/CardTemplateServiceImpl.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/impl/CardTemplateServiceImpl.java
index 72de680..1827780 100644
--- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/impl/CardTemplateServiceImpl.java
+++ b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/impl/CardTemplateServiceImpl.java
@@ -1,20 +1,9 @@
package com.cpop.jambox.business.service.impl;
-import cn.binarywang.wx.miniapp.api.WxMaService;
-import com.cpop.common.utils.bean.BeanUtils;
-import com.cpop.core.base.exception.ServiceException;
-import com.cpop.core.utils.SpringUtils;
-import com.cpop.jambox.business.bo.CardTemplateListBo;
-import com.cpop.jambox.business.bo.CardTemplateUnionBo;
import com.cpop.jambox.business.entity.CardTemplate;
import com.cpop.jambox.business.mapper.CardTemplateMapper;
import com.cpop.jambox.business.service.CardTemplateService;
-import com.cpop.jambox.business.vo.CardTemplateListVo;
-import com.cpop.sdk.framework.handler.qCloudCos.QCloudCosHandler;
-import com.mybatisflex.core.query.QueryWrapper;
import com.mybatisflex.spring.service.impl.ServiceImpl;
-import me.chanjar.weixin.common.error.WxErrorException;
-import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.io.File;
@@ -31,68 +20,4 @@ import static com.cpop.jambox.business.entity.table.CardTemplateTableDef.CARD_TE
@Service("cardTemplateService")
public class CardTemplateServiceImpl extends ServiceImpl implements CardTemplateService {
- @Autowired
- private WxMaService wxMaService;
-
- @Autowired
- private QCloudCosHandler qCloudCosHandler;
-
- /**
- * 小程序模板调整路径
- */
- private final String TEMPLATE_URL = "pages/pay/pay";
-
- /**
- * @descriptions 根据品牌或校区获取模板
- * @author DB
- * @date 2023/09/27 17:02
- * @param bo 请求参数
- * @return java.util.List
- */
- @Override
- public List getListByBrandOrCampus(CardTemplateListBo bo) {
- return this.listAs(QueryWrapper.create()
- .and(CARD_TEMPLATE.CLOUD_BRAND_ID.eq(bo.getCloudBrandId()))
- .and(CARD_TEMPLATE.CLOUD_CAMPUS_ID.eq(bo.getCloudCampusId()))
- .orderBy(CARD_TEMPLATE.CREATE_TIME.asc()),
- CardTemplateListVo.class);
- }
-
- /**
- * @descriptions 保存课卡模板
- * @author DB
- * @date 2023/09/27 18:00
- * @param bo 请求参数
- * @return: void
- */
- @Override
- public void saveUnionCardTemplate(CardTemplateUnionBo bo) {
- CardTemplate cardTemplate = BeanUtils.mapToClass(bo, CardTemplate.class);
- this.save(cardTemplate);
- //生成太阳码
- try {
- File file = wxMaService.getQrcodeService().createWxaCodeUnlimit(cardTemplate.getId(),
- TEMPLATE_URL, true, SpringUtils.getActiveProfile(), 300, true, null, true);
- String cdnUrl = qCloudCosHandler.upload(file);
- this.updateChain().set(CARD_TEMPLATE.QR_CODE, cdnUrl).where(CARD_TEMPLATE.ID.eq(cardTemplate.getId())).update();
- } catch (WxErrorException e) {
- throw new ServiceException(e.getMessage());
- }
- }
-
- /**
- * 获取小程序环境
- * @param env 当前环境
- * @return 小程序码环境
- */
- private String getQrCodeEnv(String env) {
- switch (env) {
- case "prod":
- return "release";
- case "dev":
- case "test":
- default:
- return "trial";
- }
- }
}
diff --git a/Cpop-Jambox/src/main/resources/mapper/BrandStaffMapper.xml b/Cpop-Jambox/src/main/resources/mapper/BrandStaffMapper.xml
deleted file mode 100644
index 2b68c95..0000000
--- a/Cpop-Jambox/src/main/resources/mapper/BrandStaffMapper.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
diff --git a/Cpop-Jambox/src/main/resources/mapper/BrandStaffMidCampusMapper.xml b/Cpop-Jambox/src/main/resources/mapper/BrandStaffMidCampusMapper.xml
deleted file mode 100644
index 26cbb7a..0000000
--- a/Cpop-Jambox/src/main/resources/mapper/BrandStaffMidCampusMapper.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
diff --git a/Cpop-Mall/Cpop-Mall-Web/src/main/resources/application-dev.yml b/Cpop-Mall/Cpop-Mall-Web/src/main/resources/application-dev.yml
index da63733..95ac6ca 100644
--- a/Cpop-Mall/Cpop-Mall-Web/src/main/resources/application-dev.yml
+++ b/Cpop-Mall/Cpop-Mall-Web/src/main/resources/application-dev.yml
@@ -95,4 +95,14 @@ knife4j:
group-name: System
api-rule: package
api-rule-resources:
- - com.cpop.system
\ No newline at end of file
+ - com.cpop.system
+
+logging:
+ level:
+ com.github.binarywang.wxpay: debug
+
+#微信支付
+wx:
+ pay:
+ #通知地址
+ notifyUrl: https://frp-oak.top:11899/Cpop-Mall/wxPay/callback/notify/order
\ No newline at end of file
diff --git a/Cpop-Mall/Cpop-Mall-Web/src/main/resources/application-prod.yml b/Cpop-Mall/Cpop-Mall-Web/src/main/resources/application-prod.yml
index 9258a57..5fe3a7e 100644
--- a/Cpop-Mall/Cpop-Mall-Web/src/main/resources/application-prod.yml
+++ b/Cpop-Mall/Cpop-Mall-Web/src/main/resources/application-prod.yml
@@ -50,6 +50,10 @@ server:
servlet:
context-path: /Cpop-Mall
+# springdoc-openapi项目配置
+knife4j:
+ enable: false
+
#Mybatis-Flex
mybatis-flex:
configuration:
@@ -62,4 +66,14 @@ mybatis-flex:
jambox:
url: jdbc:mysql://sh-cynosdbmysql-grp-fggo83js.sql.tencentcdb.com:20965/jambox_association?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: root
- password: Customer0401
\ No newline at end of file
+ password: Customer0401
+
+logging:
+ level:
+ com.github.binarywang.wxpay: error
+
+#微信支付
+wx:
+ pay:
+ #通知地址
+ notifyUrl:
\ No newline at end of file
diff --git a/Cpop-Mall/Cpop-Mall-Web/src/main/resources/application-test.yml b/Cpop-Mall/Cpop-Mall-Web/src/main/resources/application-test.yml
index 3a09102..2fdb75a 100644
--- a/Cpop-Mall/Cpop-Mall-Web/src/main/resources/application-test.yml
+++ b/Cpop-Mall/Cpop-Mall-Web/src/main/resources/application-test.yml
@@ -1,17 +1,18 @@
# 项目相关配置
cpop:
# 文件路径 示例( Windows配置W:/WorkSpace/java/uploadPath,Linux配置 /home/baseFramework/uploadPath)
- profile: /root/jambox-union/jambox-oam/uploadPath/upload
+ #profile: /root/jambox-union/jambox-oam/uploadPath/upload
+ profile: E:/Cpop/uploadPath
jwt:
#白名单
- whiteList: /login,/miniLogin,/getCaptcha,/profile/**,/doc.html,/webjars/**,/favicon.ico,/v2/api-docs/**,/swagger-resources,/wxOpen/receiveTicket,/wxOpen/*/callback,/wxOpen/bindOpenAccount/*,/wxCp/portal/*
+ whiteList: /login,/miniLogin,/wxPay/callback/notify/**,/profile/**,/doc.html,/webjars/**,/favicon.ico,/v2/api-docs/**,/swagger-resources,/wxOpen/receiveTicket,/wxOpen/*/callback,/wxOpen/bindOpenAccount/*,/wxCp/portal/*
#拦截
gateway:
rsa-keypair:
# 公钥文件
- publicKeyFile: D:\WorkSpace\Cpop\Cpop-Union\Cpop-Mall\Cpop-Mall-Web\src\main\resources\static\keyPair\publicKey
+ publicKeyFile: E:\Cpop\Cpop-Union\Cpop-Core\src\main\resources\static\keyPair\publicKey
# 公钥文件
- privateKeyFile: D:\WorkSpace\Cpop\Cpop-Union\Cpop-Mall\Cpop-Mall-Web\src\main\resources\static\keyPair\privateKey
+ privateKeyFile: E:\Cpop\Cpop-Union\Cpop-Core\src\main\resources\static\keyPair\privateKey
# DataSource Config
spring:
@@ -89,4 +90,14 @@ knife4j:
group-name: System
api-rule: package
api-rule-resources:
- - com.cpop.system
\ No newline at end of file
+ - com.cpop.system
+
+logging:
+ level:
+ com.github.binarywang.wxpay: debug
+
+#微信支付
+wx:
+ pay:
+ #通知地址
+ notifyUrl: https://frp-oak.top:11899/Cpop-Mall/wxPay/callback/notify/order
\ No newline at end of file
diff --git a/Cpop-Mall/Cpop-Mall-Web/src/main/resources/application.yml b/Cpop-Mall/Cpop-Mall-Web/src/main/resources/application.yml
index 4df2e6c..dc90df2 100644
--- a/Cpop-Mall/Cpop-Mall-Web/src/main/resources/application.yml
+++ b/Cpop-Mall/Cpop-Mall-Web/src/main/resources/application.yml
@@ -31,7 +31,7 @@ spring:
max-file-size: 1024MB
max-request-size: 300MB
profiles:
- active: test,mall,system,jambox,sdk
+ active: test,mall,system
datasource:
type: com.zaxxer.hikari.HikariDataSource
driver-class-name: com.mysql.cj.jdbc.Driver
@@ -130,7 +130,6 @@ logging:
wx:
#微信支付
pay:
- #服务商模式
#微信公众号或者小程序等的appid
appId: wx1eb0e5fb7dac3c05
#微信支付商户号
diff --git a/Cpop-Mall/pom.xml b/Cpop-Mall/pom.xml
index a79fb39..9b45910 100644
--- a/Cpop-Mall/pom.xml
+++ b/Cpop-Mall/pom.xml
@@ -27,6 +27,11 @@
com.cpop
Cpop-Jambox
+
+
+ com.github.binarywang
+ weixin-java-pay
+
diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/business/bo/OrderRefundPageBo.java b/Cpop-Mall/src/main/java/com/cpop/mall/business/bo/OrderRefundPageBo.java
new file mode 100644
index 0000000..028413c
--- /dev/null
+++ b/Cpop-Mall/src/main/java/com/cpop/mall/business/bo/OrderRefundPageBo.java
@@ -0,0 +1,43 @@
+package com.cpop.mall.business.bo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+
+/**
+ * @author DB
+ * @createTime 2023/10/27 17:33
+ * @description
+ */
+@Data
+@Accessors(chain = true)
+@ApiModel(value = "商城订单退款分页请求对象")
+public class OrderRefundPageBo implements Serializable {
+
+ /**
+ * 商品名
+ */
+ @ApiModelProperty("商品名")
+ private String productName;
+
+ /**
+ * 支付用户
+ */
+ @ApiModelProperty("支付用户")
+ private String payUserName;
+
+ /**
+ * 支付用户手机号
+ */
+ @ApiModelProperty("支付用户手机号")
+ private String payUserPhone;
+
+ /**
+ * 退款状态(0:申请中;1:通过;2:驳回)
+ */
+ @ApiModelProperty("退款状态(0:申请中;1:通过;2:驳回)")
+ private Integer refundStatus;
+}
diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/business/bo/PlaceOrderBo.java b/Cpop-Mall/src/main/java/com/cpop/mall/business/bo/PlaceOrderBo.java
index 2ca8e7c..2e84a82 100644
--- a/Cpop-Mall/src/main/java/com/cpop/mall/business/bo/PlaceOrderBo.java
+++ b/Cpop-Mall/src/main/java/com/cpop/mall/business/bo/PlaceOrderBo.java
@@ -53,7 +53,7 @@ public class PlaceOrderBo implements Serializable {
* 店铺(校区)id
*/
@NotBlank(message = "店铺(校区)id不能为空")
- @ApiModelProperty("店铺(校区)id")
+ @ApiModelProperty(value = "店铺(校区)id",required = true)
private String storeId;
/**
@@ -89,6 +89,13 @@ public class PlaceOrderBo implements Serializable {
@ApiModelProperty(value = "备注")
private String remarks;
+ /**
+ * 支付类型
+ */
+ @NotNull(message = "支付类型不能为空")
+ @ApiModelProperty(value = "支付方式(0:微信支付;1:积分支付)",required = true)
+ private Integer payType;
+
/**
* 订单详情
*/
diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/business/bo/ProductBo.java b/Cpop-Mall/src/main/java/com/cpop/mall/business/bo/ProductBo.java
index f4622a0..762de30 100644
--- a/Cpop-Mall/src/main/java/com/cpop/mall/business/bo/ProductBo.java
+++ b/Cpop-Mall/src/main/java/com/cpop/mall/business/bo/ProductBo.java
@@ -47,6 +47,12 @@ public class ProductBo implements Serializable {
@ApiModelProperty("品牌id")
private String brandId;
+ /**
+ * 支付方式(微信支付:0;积分支付:1)
+ */
+ @ApiModelProperty("支付方式(微信支付:0;积分支付:1)")
+ private Integer payType;
+
/**
* 商店(校区)集合
*/
diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/business/bo/ProductPageBo.java b/Cpop-Mall/src/main/java/com/cpop/mall/business/bo/ProductPageBo.java
index d80f952..1315cac 100644
--- a/Cpop-Mall/src/main/java/com/cpop/mall/business/bo/ProductPageBo.java
+++ b/Cpop-Mall/src/main/java/com/cpop/mall/business/bo/ProductPageBo.java
@@ -43,4 +43,16 @@ public class ProductPageBo implements Serializable {
@ApiModelProperty("价格排序(false:从低到高;true:从高到低)")
private Boolean priceOrder;
+ /**
+ * 支付方式(0:微信支付;1:积分支付)
+ */
+ @ApiModelProperty("支付方式(0:微信支付;1:积分支付)")
+ private Integer payType;
+
+ /**
+ * 产品id
+ */
+ @ApiModelProperty("产品id")
+ private String productId;
+
}
diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/business/controller/backstage/BackstageMallRoleController.java b/Cpop-Mall/src/main/java/com/cpop/mall/business/controller/backstage/BackstageMallRoleController.java
index f37b356..d2e9b8f 100644
--- a/Cpop-Mall/src/main/java/com/cpop/mall/business/controller/backstage/BackstageMallRoleController.java
+++ b/Cpop-Mall/src/main/java/com/cpop/mall/business/controller/backstage/BackstageMallRoleController.java
@@ -104,7 +104,7 @@ public class BackstageMallRoleController {
@PreAuthorize("@aps.hasPermission('system:role:remove')")
@ApiOperation("删除商城角色")
@DeleteMapping("/removeMallRole/{id}")
- public R removeMallRole(@PathVariable String id) {
+ public R removeMallRole(@PathVariable("id") String id) {
roleBrandService.removeMallRole(id);
return R.ok();
}
diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/business/controller/backstage/BackstageOrderRefundController.java b/Cpop-Mall/src/main/java/com/cpop/mall/business/controller/backstage/BackstageOrderRefundController.java
index f91d153..910f79b 100644
--- a/Cpop-Mall/src/main/java/com/cpop/mall/business/controller/backstage/BackstageOrderRefundController.java
+++ b/Cpop-Mall/src/main/java/com/cpop/mall/business/controller/backstage/BackstageOrderRefundController.java
@@ -1,7 +1,11 @@
package com.cpop.mall.business.controller.backstage;
import com.cpop.core.base.R;
+import com.cpop.mall.business.bo.OrderRefundPageBo;
import com.cpop.mall.business.bo.OrderRejectRefundBo;
+import com.cpop.mall.business.bo.ProductPageBo;
+import com.cpop.mall.business.vo.OrderRefundPageVo;
+import com.cpop.mall.business.vo.ProductPageVo;
import com.mybatisflex.core.paginate.Page;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.DeleteMapping;
@@ -35,6 +39,20 @@ public class BackstageOrderRefundController {
@Autowired
private OrderRefundService orderRefundService;
+ /**
+ * @descriptions 商城退款列表
+ * @author DB
+ * @date 2023/10/27 17:33
+ * @param bo 请求参数
+ * @return: com.cpop.core.base.R>
+ */
+ @GetMapping("/getOrderRefundPage")
+ @ApiOperation("分页查询商城-退款列表")
+ public R> getOrderRefundPage(@RequestBody @ApiParam("分页参数") OrderRefundPageBo bo) {
+ Page page = orderRefundService.getOrderRefundPage(bo);
+ return R.ok(page);
+ }
+
/**
* @descriptions 同意退款
* @author DB
@@ -44,7 +62,7 @@ public class BackstageOrderRefundController {
*/
@PutMapping("/agreeRefund/{id}")
@ApiOperation("同意退款")
- public R agreeRefund(@PathVariable String id) {
+ public R agreeRefund(@PathVariable("id") String id) {
orderRefundService.agreeRefund(id);
return R.ok();
}
diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/business/controller/backstage/BackstageProductController.java b/Cpop-Mall/src/main/java/com/cpop/mall/business/controller/backstage/BackstageProductController.java
index d5cd865..d4758c6 100644
--- a/Cpop-Mall/src/main/java/com/cpop/mall/business/controller/backstage/BackstageProductController.java
+++ b/Cpop-Mall/src/main/java/com/cpop/mall/business/controller/backstage/BackstageProductController.java
@@ -11,6 +11,7 @@ import com.cpop.mall.business.service.ProductSpecificationService;
import com.cpop.mall.business.vo.ProductPageVo;
import com.cpop.mall.business.vo.StoreListVo;
import com.mybatisflex.core.paginate.Page;
+import com.mybatisflex.core.query.If;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
@@ -24,6 +25,7 @@ import java.util.List;
import static com.cpop.mall.business.entity.table.ProductRecordTableDef.PRODUCT_RECORD;
import static com.cpop.mall.business.entity.table.ProductSpecificationTableDef.PRODUCT_SPECIFICATION;
+import static com.cpop.mall.business.entity.table.ProductTableDef.PRODUCT;
/**
* 商城-商品表 控制层。
@@ -116,7 +118,7 @@ public class BackstageProductController {
*/
@PutMapping("/resetProduct/{id}")
@ApiOperation("根据主键重置商城商品")
- public R update(@PathVariable String id) {
+ public R update(@PathVariable("id") String id) {
productService.resetProduct(id);
return R.ok();
}
@@ -144,7 +146,7 @@ public class BackstageProductController {
@DeleteMapping("/removeById/{id}")
@ApiOperation("根据主键商城-商品表")
@Transactional(rollbackFor = Exception.class)
- public R removeById(@PathVariable @ApiParam("商城-商品主键") Serializable id) {
+ public R removeById(@PathVariable("id") @ApiParam("商城-商品主键") Serializable id) {
productService.removeById(id);
//删规格
ProductSpecificationService productSpecificationService = SpringUtils.getBean(ProductSpecificationService.class);
@@ -155,6 +157,18 @@ public class BackstageProductController {
return R.ok();
}
-
+ /**
+ * @descriptions 商城商品上架
+ * @author DB
+ * @date 2023/10/23 12:15
+ * @param productId 商城-商品id
+ * @return: com.cpop.core.base.R
+ */
+ @PutMapping("/productUpOrDown")
+ @ApiOperation("商城商品上下架")
+ public R productUpOrDown(@RequestParam("productId") @ApiParam(value = "商城-商品Id",required = true) String productId) {
+ productService.updateChain().setRaw(PRODUCT.IS_UP, "if(is_up = 0, 1, 0)").where(PRODUCT.ID.eq(productId)).update();
+ return R.ok();
+ }
}
diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/business/controller/callback/WxPayCallbackController.java b/Cpop-Mall/src/main/java/com/cpop/mall/business/controller/callback/WxPayCallbackController.java
new file mode 100644
index 0000000..4730a60
--- /dev/null
+++ b/Cpop-Mall/src/main/java/com/cpop/mall/business/controller/callback/WxPayCallbackController.java
@@ -0,0 +1,55 @@
+package com.cpop.mall.business.controller.callback;
+
+import com.cpop.mall.business.service.OrderRefundService;
+import com.cpop.mall.business.service.OrderService;
+import com.github.binarywang.wxpay.bean.notify.WxPayNotifyResponse;
+import com.github.binarywang.wxpay.bean.notify.WxPayOrderNotifyResult;
+import com.github.binarywang.wxpay.service.WxPayService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * @author DB
+ * @createTime 2023/10/27 15:57
+ * @description
+ */
+@RestController
+@RequestMapping("/wxPay/callback")
+public class WxPayCallbackController {
+
+ @Autowired
+ private OrderRefundService orderRefundService;
+
+ @Autowired
+ private OrderService orderService;
+
+ /**
+ * @descriptions 微信支付订单通知
+ * @author DB
+ * @date 2023/10/27 16:04
+ * @param xmlData 数据
+ * @return: java.lang.String
+ */
+ @PostMapping("/notify/order")
+ public String parseOrderNotifyResult(@RequestBody String xmlData){
+ orderService.wxPayNotifyOrder(xmlData);
+ return WxPayNotifyResponse.success("成功");
+ }
+
+ /**
+ * @descriptions 退款回调通知处理
+ * @author DB
+ * @date 2023/10/27 18:21
+ * @param xmlData 数据
+ * @return: java.lang.String
+ */
+ @PostMapping("/notify/refund")
+ public String parseRefundNotifyResult(@RequestBody String xmlData){
+ orderRefundService.wxPayNotifyRefund(xmlData);
+ return WxPayNotifyResponse.success("成功");
+ }
+
+}
diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/business/controller/mini/MiniOrderController.java b/Cpop-Mall/src/main/java/com/cpop/mall/business/controller/mini/MiniOrderController.java
index 6892dbb..e35a8c1 100644
--- a/Cpop-Mall/src/main/java/com/cpop/mall/business/controller/mini/MiniOrderController.java
+++ b/Cpop-Mall/src/main/java/com/cpop/mall/business/controller/mini/MiniOrderController.java
@@ -8,7 +8,6 @@ import com.cpop.mall.business.entity.OrderEvaluate;
import com.cpop.mall.business.service.OrderEvaluateService;
import com.cpop.mall.business.service.OrderService;
import com.cpop.mall.business.vo.OrderPageVo;
-import com.cpop.mall.business.vo.ProductPageVo;
import com.mybatisflex.core.paginate.Page;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@@ -56,9 +55,8 @@ public class MiniOrderController {
*/
@PostMapping("/placeOrder")
@ApiOperation("商城-订单-下单")
- public R placeOrder(@RequestBody @Validated @ApiParam("商城-订单") PlaceOrderBo bo) {
- orderService.placeOrder(bo);
- return R.ok();
+ public R