[fix]修改整体框架
This commit is contained in:
parent
daf3886672
commit
00104f0580
37
pom.xml
37
pom.xml
@ -375,6 +375,43 @@
|
||||
<artifactId>ruoyi-workflow</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.dromara</groupId>
|
||||
<artifactId>ruoyi-content</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.dromara</groupId>
|
||||
<artifactId>ruoyi-order</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.dromara</groupId>
|
||||
<artifactId>ruoyi-member</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.dromara</groupId>
|
||||
<artifactId>ruoyi-pay</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.dromara</groupId>
|
||||
<artifactId>ruoyi-aftersale</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>org.dromara</groupId>
|
||||
<artifactId>ruoyi-common-mongo</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
@ -34,6 +34,7 @@
|
||||
<module>ruoyi-common-tenant</module>
|
||||
<module>ruoyi-common-websocket</module>
|
||||
<module>ruoyi-common-sse</module>
|
||||
<module>ruoyi-common-mongo</module>
|
||||
</modules>
|
||||
|
||||
<artifactId>ruoyi-common</artifactId>
|
||||
|
@ -106,10 +106,7 @@
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>jackson-annotations</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.dromara</groupId>
|
||||
<artifactId>ruoyi-common-excel</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>io.jsonwebtoken</groupId>
|
||||
@ -128,15 +125,28 @@
|
||||
<version>0.11.2</version>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.dromara</groupId>
|
||||
<artifactId>ruoyi-system</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.github.wechatpay-apiv3</groupId>
|
||||
<artifactId>wechatpay-java</artifactId>
|
||||
<version>0.2.9</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-crypto</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.poi</groupId>
|
||||
<artifactId>poi</artifactId>
|
||||
<version>5.4.0</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>mybatis-plus-core</artifactId>
|
||||
<version>3.5.11</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
|
@ -0,0 +1,18 @@
|
||||
package org.dromara.common.core.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import org.apache.poi.ss.formula.functions.T;
|
||||
|
||||
import java.sql.Wrapper;
|
||||
|
||||
public class BaseBO {
|
||||
|
||||
/**
|
||||
* bo转换成queryWrapper
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public QueryWrapper toWrapper() {
|
||||
return null;
|
||||
}
|
||||
}
|
@ -4,7 +4,6 @@ import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.dromara.common.core.domain.dto.PostDTO;
|
||||
import org.dromara.common.core.domain.dto.RoleDTO;
|
||||
import org.dromara.system.domain.SysUser;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
@ -133,10 +132,6 @@ public class LoginUser implements Serializable {
|
||||
*/
|
||||
private String deviceType;
|
||||
|
||||
/**
|
||||
* 用户信息
|
||||
*/
|
||||
private SysUser user;
|
||||
|
||||
/**
|
||||
* 获取登录id
|
||||
@ -151,9 +146,6 @@ public class LoginUser implements Serializable {
|
||||
return userType + ":" + userId;
|
||||
}
|
||||
|
||||
public SysUser getUser()
|
||||
{
|
||||
return user;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -1,176 +0,0 @@
|
||||
package org.dromara.common.core.entity;
|
||||
|
||||
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import org.dromara.common.core.domain.BaseEntity;
|
||||
import org.dromara.common.core.domain.event.UserConstants;
|
||||
import org.dromara.common.excel.annotation.Excel;
|
||||
|
||||
/**
|
||||
* 字典数据表 sys_dict_data
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public class SysDictData extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 字典编码 */
|
||||
@Excel(name = "字典编码", cellType = Excel.ColumnType.NUMERIC)
|
||||
private Long dictCode;
|
||||
|
||||
/** 字典排序 */
|
||||
@Excel(name = "字典排序", cellType = Excel.ColumnType.NUMERIC)
|
||||
private Long dictSort;
|
||||
|
||||
/** 字典标签 */
|
||||
@Excel(name = "字典标签")
|
||||
private String dictLabel;
|
||||
|
||||
/** 字典键值 */
|
||||
@Excel(name = "字典键值")
|
||||
private String dictValue;
|
||||
|
||||
/** 字典类型 */
|
||||
@Excel(name = "字典类型")
|
||||
private String dictType;
|
||||
|
||||
/** 样式属性(其他样式扩展) */
|
||||
private String cssClass;
|
||||
|
||||
/** 表格字典样式 */
|
||||
private String listClass;
|
||||
|
||||
/** 是否默认(Y是 N否) */
|
||||
@Excel(name = "是否默认", readConverterExp = "Y=是,N=否")
|
||||
private String isDefault;
|
||||
|
||||
/** 状态(0正常 1停用) */
|
||||
@Excel(name = "状态", readConverterExp = "0=正常,1=停用")
|
||||
private String status;
|
||||
|
||||
public Long getDictCode()
|
||||
{
|
||||
return dictCode;
|
||||
}
|
||||
|
||||
public void setDictCode(Long dictCode)
|
||||
{
|
||||
this.dictCode = dictCode;
|
||||
}
|
||||
|
||||
public Long getDictSort()
|
||||
{
|
||||
return dictSort;
|
||||
}
|
||||
|
||||
public void setDictSort(Long dictSort)
|
||||
{
|
||||
this.dictSort = dictSort;
|
||||
}
|
||||
|
||||
@NotBlank(message = "字典标签不能为空")
|
||||
@Size(min = 0, max = 100, message = "字典标签长度不能超过100个字符")
|
||||
public String getDictLabel()
|
||||
{
|
||||
return dictLabel;
|
||||
}
|
||||
|
||||
public void setDictLabel(String dictLabel)
|
||||
{
|
||||
this.dictLabel = dictLabel;
|
||||
}
|
||||
|
||||
@NotBlank(message = "字典键值不能为空")
|
||||
@Size(min = 0, max = 100, message = "字典键值长度不能超过100个字符")
|
||||
public String getDictValue()
|
||||
{
|
||||
return dictValue;
|
||||
}
|
||||
|
||||
public void setDictValue(String dictValue)
|
||||
{
|
||||
this.dictValue = dictValue;
|
||||
}
|
||||
|
||||
@NotBlank(message = "字典类型不能为空")
|
||||
@Size(min = 0, max = 100, message = "字典类型长度不能超过100个字符")
|
||||
public String getDictType()
|
||||
{
|
||||
return dictType;
|
||||
}
|
||||
|
||||
public void setDictType(String dictType)
|
||||
{
|
||||
this.dictType = dictType;
|
||||
}
|
||||
|
||||
@Size(min = 0, max = 100, message = "样式属性长度不能超过100个字符")
|
||||
public String getCssClass()
|
||||
{
|
||||
return cssClass;
|
||||
}
|
||||
|
||||
public void setCssClass(String cssClass)
|
||||
{
|
||||
this.cssClass = cssClass;
|
||||
}
|
||||
|
||||
public String getListClass()
|
||||
{
|
||||
return listClass;
|
||||
}
|
||||
|
||||
public void setListClass(String listClass)
|
||||
{
|
||||
this.listClass = listClass;
|
||||
}
|
||||
|
||||
public boolean getDefault()
|
||||
{
|
||||
return UserConstants.YES.equals(this.isDefault) ? true : false;
|
||||
}
|
||||
|
||||
public String getIsDefault()
|
||||
{
|
||||
return isDefault;
|
||||
}
|
||||
|
||||
public void setIsDefault(String isDefault)
|
||||
{
|
||||
this.isDefault = isDefault;
|
||||
}
|
||||
|
||||
public String getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("dictCode", getDictCode())
|
||||
.append("dictSort", getDictSort())
|
||||
.append("dictLabel", getDictLabel())
|
||||
.append("dictValue", getDictValue())
|
||||
.append("dictType", getDictType())
|
||||
.append("cssClass", getCssClass())
|
||||
.append("listClass", getListClass())
|
||||
.append("isDefault", getIsDefault())
|
||||
.append("status", getStatus())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("remark", getRemark())
|
||||
.toString();
|
||||
}
|
||||
}
|
@ -1,343 +0,0 @@
|
||||
package org.dromara.common.core.entity;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
import jakarta.validation.constraints.Email;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import org.dromara.common.core.domain.BaseEntity;
|
||||
import org.dromara.common.excel.annotation.Excel;
|
||||
import org.dromara.common.excel.annotation.Excels;
|
||||
import org.dromara.system.domain.SysDept;
|
||||
import org.dromara.system.domain.SysRole;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 用户对象 sys_user
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public class SysUser extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 用户ID */
|
||||
@Excel(name = "用户序号", cellType = Excel.ColumnType.NUMERIC, prompt = "用户编号")
|
||||
private Long userId;
|
||||
|
||||
/** 部门ID */
|
||||
@Excel(name = "部门编号", type = Excel.Type.IMPORT)
|
||||
private Long deptId;
|
||||
|
||||
/** 用户账号 */
|
||||
@Excel(name = "登录名称")
|
||||
private String userName;
|
||||
|
||||
/** 用户昵称 */
|
||||
@Excel(name = "用户名称")
|
||||
private String nickName;
|
||||
|
||||
/** 用户邮箱 */
|
||||
@Excel(name = "用户邮箱")
|
||||
private String email;
|
||||
|
||||
/** 手机号码 */
|
||||
@Excel(name = "手机号码")
|
||||
private String phonenumber;
|
||||
|
||||
/** 用户性别 */
|
||||
@Excel(name = "用户性别", readConverterExp = "0=男,1=女,2=未知")
|
||||
private String sex;
|
||||
|
||||
/** 用户头像 */
|
||||
private String avatar;
|
||||
|
||||
/** 密码 */
|
||||
private String password;
|
||||
|
||||
/** 盐加密 */
|
||||
private String salt;
|
||||
|
||||
/** 帐号状态(0正常 1停用) */
|
||||
@Excel(name = "帐号状态", readConverterExp = "0=正常,1=停用")
|
||||
private String status;
|
||||
|
||||
/** 删除标志(0代表存在 2代表删除) */
|
||||
private String delFlag;
|
||||
|
||||
/** 最后登录IP */
|
||||
@Excel(name = "最后登录IP", type = Excel.Type.EXPORT)
|
||||
private String loginIp;
|
||||
|
||||
/** 最后登录时间 */
|
||||
@Excel(name = "最后登录时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss", type = Excel.Type.EXPORT)
|
||||
private Date loginDate;
|
||||
|
||||
/** 部门对象 */
|
||||
@Excels({
|
||||
@Excel(name = "部门名称", targetAttr = "deptName", type = Excel.Type.EXPORT),
|
||||
@Excel(name = "部门负责人", targetAttr = "leader", type = Excel.Type.EXPORT)
|
||||
})
|
||||
private SysDept dept;
|
||||
|
||||
/** 角色对象 */
|
||||
private List<SysRole> roles;
|
||||
|
||||
/** 角色组 */
|
||||
private Long[] roleIds;
|
||||
|
||||
/** 岗位组 */
|
||||
private Long[] postIds;
|
||||
|
||||
/** 角色ID */
|
||||
private Long roleId;
|
||||
|
||||
public SysUser()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public SysUser(Long userId)
|
||||
{
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public Long getUserId()
|
||||
{
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setUserId(Long userId)
|
||||
{
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public boolean isAdmin()
|
||||
{
|
||||
return isAdmin(this.userId);
|
||||
}
|
||||
|
||||
public static boolean isAdmin(Long userId)
|
||||
{
|
||||
return userId != null && 1L == userId;
|
||||
}
|
||||
|
||||
public Long getDeptId()
|
||||
{
|
||||
return deptId;
|
||||
}
|
||||
|
||||
public void setDeptId(Long deptId)
|
||||
{
|
||||
this.deptId = deptId;
|
||||
}
|
||||
|
||||
@Size(min = 0, max = 30, message = "用户昵称长度不能超过30个字符")
|
||||
public String getNickName()
|
||||
{
|
||||
return nickName;
|
||||
}
|
||||
|
||||
public void setNickName(String nickName)
|
||||
{
|
||||
this.nickName = nickName;
|
||||
}
|
||||
|
||||
@NotBlank(message = "用户账号不能为空")
|
||||
@Size(min = 0, max = 30, message = "用户账号长度不能超过30个字符")
|
||||
public String getUserName()
|
||||
{
|
||||
return userName;
|
||||
}
|
||||
|
||||
public void setUserName(String userName)
|
||||
{
|
||||
this.userName = userName;
|
||||
}
|
||||
|
||||
@Email(message = "邮箱格式不正确")
|
||||
@Size(min = 0, max = 50, message = "邮箱长度不能超过50个字符")
|
||||
public String getEmail()
|
||||
{
|
||||
return email;
|
||||
}
|
||||
|
||||
public void setEmail(String email)
|
||||
{
|
||||
this.email = email;
|
||||
}
|
||||
|
||||
@Size(min = 0, max = 11, message = "手机号码长度不能超过11个字符")
|
||||
public String getPhonenumber()
|
||||
{
|
||||
return phonenumber;
|
||||
}
|
||||
|
||||
public void setPhonenumber(String phonenumber)
|
||||
{
|
||||
this.phonenumber = phonenumber;
|
||||
}
|
||||
|
||||
public String getSex()
|
||||
{
|
||||
return sex;
|
||||
}
|
||||
|
||||
public void setSex(String sex)
|
||||
{
|
||||
this.sex = sex;
|
||||
}
|
||||
|
||||
public String getAvatar()
|
||||
{
|
||||
return avatar;
|
||||
}
|
||||
|
||||
public void setAvatar(String avatar)
|
||||
{
|
||||
this.avatar = avatar;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
@JsonProperty
|
||||
public String getPassword()
|
||||
{
|
||||
return password;
|
||||
}
|
||||
|
||||
public void setPassword(String password)
|
||||
{
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
public String getSalt()
|
||||
{
|
||||
return salt;
|
||||
}
|
||||
|
||||
public void setSalt(String salt)
|
||||
{
|
||||
this.salt = salt;
|
||||
}
|
||||
|
||||
public String getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getDelFlag()
|
||||
{
|
||||
return delFlag;
|
||||
}
|
||||
|
||||
public void setDelFlag(String delFlag)
|
||||
{
|
||||
this.delFlag = delFlag;
|
||||
}
|
||||
|
||||
public String getLoginIp()
|
||||
{
|
||||
return loginIp;
|
||||
}
|
||||
|
||||
public void setLoginIp(String loginIp)
|
||||
{
|
||||
this.loginIp = loginIp;
|
||||
}
|
||||
|
||||
public Date getLoginDate()
|
||||
{
|
||||
return loginDate;
|
||||
}
|
||||
|
||||
public void setLoginDate(Date loginDate)
|
||||
{
|
||||
this.loginDate = loginDate;
|
||||
}
|
||||
|
||||
public SysDept getDept()
|
||||
{
|
||||
return dept;
|
||||
}
|
||||
|
||||
public void setDept(SysDept dept)
|
||||
{
|
||||
this.dept = dept;
|
||||
}
|
||||
|
||||
public List<SysRole> getRoles()
|
||||
{
|
||||
return roles;
|
||||
}
|
||||
|
||||
public void setRoles(List<SysRole> roles)
|
||||
{
|
||||
this.roles = roles;
|
||||
}
|
||||
|
||||
public Long[] getRoleIds()
|
||||
{
|
||||
return roleIds;
|
||||
}
|
||||
|
||||
public void setRoleIds(Long[] roleIds)
|
||||
{
|
||||
this.roleIds = roleIds;
|
||||
}
|
||||
|
||||
public Long[] getPostIds()
|
||||
{
|
||||
return postIds;
|
||||
}
|
||||
|
||||
public void setPostIds(Long[] postIds)
|
||||
{
|
||||
this.postIds = postIds;
|
||||
}
|
||||
|
||||
public Long getRoleId()
|
||||
{
|
||||
return roleId;
|
||||
}
|
||||
|
||||
public void setRoleId(Long roleId)
|
||||
{
|
||||
this.roleId = roleId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("userId", getUserId())
|
||||
.append("deptId", getDeptId())
|
||||
.append("userName", getUserName())
|
||||
.append("nickName", getNickName())
|
||||
.append("email", getEmail())
|
||||
.append("phonenumber", getPhonenumber())
|
||||
.append("sex", getSex())
|
||||
.append("avatar", getAvatar())
|
||||
.append("password", getPassword())
|
||||
.append("salt", getSalt())
|
||||
.append("status", getStatus())
|
||||
.append("delFlag", getDelFlag())
|
||||
.append("loginIp", getLoginIp())
|
||||
.append("loginDate", getLoginDate())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("remark", getRemark())
|
||||
.append("dept", getDept())
|
||||
.toString();
|
||||
}
|
||||
}
|
@ -4,6 +4,7 @@ import cn.hutool.core.util.CharsetUtil;
|
||||
import cn.hutool.crypto.SecureUtil;
|
||||
import cn.hutool.crypto.symmetric.AES;
|
||||
|
||||
|
||||
/**
|
||||
* aes加密工具
|
||||
*/
|
||||
|
@ -1,184 +1,287 @@
|
||||
package org.dromara.common.core.utils;
|
||||
|
||||
import org.apache.commons.lang3.time.DateFormatUtils;
|
||||
import org.dromara.common.core.enums.FormatsType;
|
||||
import org.dromara.common.core.exception.ServiceException;
|
||||
|
||||
import java.lang.management.ManagementFactory;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalTime;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
import java.util.Arrays;
|
||||
import java.time.*;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* 时间工具类
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public class DateUtils extends org.apache.commons.lang3.time.DateUtils
|
||||
{
|
||||
public static String YYYY = "yyyy";
|
||||
public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
|
||||
private static final String[] PARSE_PATTERNS = {
|
||||
"yyyy-MM-dd", "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd HH:mm", "yyyy-MM",
|
||||
"yyyy/MM/dd", "yyyy/MM/dd HH:mm:ss", "yyyy/MM/dd HH:mm", "yyyy/MM",
|
||||
"yyyy.MM.dd", "yyyy.MM.dd HH:mm:ss", "yyyy.MM.dd HH:mm", "yyyy.MM"};
|
||||
|
||||
public static String YYYY_MM = "yyyy-MM";
|
||||
|
||||
public static String YYYY_MM_DD = "yyyy-MM-dd";
|
||||
|
||||
public static String YYYYMMDDHHMMSS = "yyyyMMddHHmmss";
|
||||
|
||||
public static String YYYY_MM_DD_HH_MM_SS = "yyyy-MM-dd HH:mm:ss";
|
||||
|
||||
private static String[] parsePatterns = {
|
||||
"yyyy-MM-dd", "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd HH:mm", "yyyy-MM",
|
||||
"yyyy/MM/dd", "yyyy/MM/dd HH:mm:ss", "yyyy/MM/dd HH:mm", "yyyy/MM",
|
||||
"yyyy.MM.dd", "yyyy.MM.dd HH:mm:ss", "yyyy.MM.dd HH:mm", "yyyy.MM"};
|
||||
@Deprecated
|
||||
private DateUtils() {
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前Date型日期
|
||||
* 获取当前日期和时间
|
||||
*
|
||||
* @return Date() 当前日期
|
||||
* @return 当前日期和时间的 Date 对象表示
|
||||
*/
|
||||
public static Date getNowDate()
|
||||
{
|
||||
public static Date getNowDate() {
|
||||
return new Date();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前日期, 默认格式为yyyy-MM-dd
|
||||
* 获取当前日期的字符串表示,格式为YYYY-MM-DD
|
||||
*
|
||||
* @return String
|
||||
* @return 当前日期的字符串表示
|
||||
*/
|
||||
public static String getDate()
|
||||
{
|
||||
return dateTimeNow(YYYY_MM_DD);
|
||||
public static String getDate() {
|
||||
return dateTimeNow(FormatsType.YYYY_MM_DD);
|
||||
}
|
||||
|
||||
public static final String getTime()
|
||||
{
|
||||
return dateTimeNow(YYYY_MM_DD_HH_MM_SS);
|
||||
/**
|
||||
* 获取当前日期的字符串表示,格式为yyyyMMdd
|
||||
*
|
||||
* @return 当前日期的字符串表示
|
||||
*/
|
||||
public static String getCurrentDate() {
|
||||
return DateFormatUtils.format(new Date(), FormatsType.YYYYMMDD.getTimeFormat());
|
||||
}
|
||||
|
||||
public static final String dateTimeNow()
|
||||
{
|
||||
return dateTimeNow(YYYYMMDDHHMMSS);
|
||||
/**
|
||||
* 获取当前日期的路径格式字符串,格式为"yyyy/MM/dd"
|
||||
*
|
||||
* @return 当前日期的路径格式字符串
|
||||
*/
|
||||
public static String datePath() {
|
||||
Date now = new Date();
|
||||
return DateFormatUtils.format(now, FormatsType.YYYY_MM_DD_SLASH.getTimeFormat());
|
||||
}
|
||||
|
||||
public static final String dateTimeNow(final String format)
|
||||
{
|
||||
/**
|
||||
* 获取当前时间的字符串表示,格式为YYYY-MM-DD HH:MM:SS
|
||||
*
|
||||
* @return 当前时间的字符串表示
|
||||
*/
|
||||
public static String getTime() {
|
||||
return dateTimeNow(FormatsType.YYYY_MM_DD_HH_MM_SS);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前时间的字符串表示,格式为 "HH:MM:SS"
|
||||
*
|
||||
* @return 当前时间的字符串表示,格式为 "HH:MM:SS"
|
||||
*/
|
||||
public static String getTimeWithHourMinuteSecond() {
|
||||
return dateTimeNow(FormatsType.HH_MM_SS);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前日期和时间的字符串表示,格式为YYYYMMDDHHMMSS
|
||||
*
|
||||
* @return 当前日期和时间的字符串表示
|
||||
*/
|
||||
public static String dateTimeNow() {
|
||||
return dateTimeNow(FormatsType.YYYYMMDDHHMMSS);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前日期和时间的指定格式的字符串表示
|
||||
*
|
||||
* @param format 日期时间格式,例如"YYYY-MM-DD HH:MM:SS"
|
||||
* @return 当前日期和时间的字符串表示
|
||||
*/
|
||||
public static String dateTimeNow(final FormatsType format) {
|
||||
return parseDateToStr(format, new Date());
|
||||
}
|
||||
|
||||
public static final String dateTime(final Date date)
|
||||
{
|
||||
return parseDateToStr(YYYY_MM_DD, date);
|
||||
/**
|
||||
* 将指定日期格式化为 YYYY-MM-DD 格式的字符串
|
||||
*
|
||||
* @param date 要格式化的日期对象
|
||||
* @return 格式化后的日期字符串
|
||||
*/
|
||||
public static String formatDate(final Date date) {
|
||||
return parseDateToStr(FormatsType.YYYY_MM_DD, date);
|
||||
}
|
||||
|
||||
public static final String parseDateToStr(final String format, final Date date)
|
||||
{
|
||||
return new SimpleDateFormat(format).format(date);
|
||||
/**
|
||||
* 将指定日期格式化为 YYYY-MM-DD HH:MM:SS 格式的字符串
|
||||
*
|
||||
* @param date 要格式化的日期对象
|
||||
* @return 格式化后的日期时间字符串
|
||||
*/
|
||||
public static String formatDateTime(final Date date) {
|
||||
return parseDateToStr(FormatsType.YYYY_MM_DD_HH_MM_SS, date);
|
||||
}
|
||||
|
||||
public static final Date dateTime(final String format, final String ts)
|
||||
{
|
||||
try
|
||||
{
|
||||
return new SimpleDateFormat(format).parse(ts);
|
||||
}
|
||||
catch (ParseException e)
|
||||
{
|
||||
/**
|
||||
* 将指定日期按照指定格式进行格式化
|
||||
*
|
||||
* @param format 要使用的日期时间格式,例如"YYYY-MM-DD HH:MM:SS"
|
||||
* @param date 要格式化的日期对象
|
||||
* @return 格式化后的日期时间字符串
|
||||
*/
|
||||
public static String parseDateToStr(final FormatsType format, final Date date) {
|
||||
return new SimpleDateFormat(format.getTimeFormat()).format(date);
|
||||
}
|
||||
|
||||
/**
|
||||
* 将指定格式的日期时间字符串转换为 Date 对象
|
||||
*
|
||||
* @param format 要解析的日期时间格式,例如"YYYY-MM-DD HH:MM:SS"
|
||||
* @param ts 要解析的日期时间字符串
|
||||
* @return 解析后的 Date 对象
|
||||
* @throws RuntimeException 如果解析过程中发生异常
|
||||
*/
|
||||
public static Date parseDateTime(final FormatsType format, final String ts) {
|
||||
try {
|
||||
return new SimpleDateFormat(format.getTimeFormat()).parse(ts);
|
||||
} catch (ParseException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 日期路径 即年/月/日 如2018/08/08
|
||||
* 将对象转换为日期对象
|
||||
*
|
||||
* @param str 要转换的对象,通常是字符串
|
||||
* @return 转换后的日期对象,如果转换失败或输入为null,则返回null
|
||||
*/
|
||||
public static final String datePath()
|
||||
{
|
||||
Date now = new Date();
|
||||
return DateFormatUtils.format(now, "yyyy/MM/dd");
|
||||
}
|
||||
|
||||
/**
|
||||
* 日期路径 即年/月/日 如20180808
|
||||
*/
|
||||
public static final String dateTime()
|
||||
{
|
||||
Date now = new Date();
|
||||
return DateFormatUtils.format(now, "yyyyMMdd");
|
||||
}
|
||||
|
||||
/**
|
||||
* 日期型字符串转化为日期 格式
|
||||
*/
|
||||
public static Date parseDate(Object str)
|
||||
{
|
||||
if (str == null)
|
||||
{
|
||||
public static Date parseDate(Object str) {
|
||||
if (str == null) {
|
||||
return null;
|
||||
}
|
||||
try
|
||||
{
|
||||
return parseDate(str.toString(), parsePatterns);
|
||||
}
|
||||
catch (ParseException e)
|
||||
{
|
||||
try {
|
||||
return parseDate(str.toString(), PARSE_PATTERNS);
|
||||
} catch (ParseException e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取服务器启动时间
|
||||
*
|
||||
* @return 服务器启动时间的 Date 对象表示
|
||||
*/
|
||||
public static Date getServerStartDate()
|
||||
{
|
||||
public static Date getServerStartDate() {
|
||||
long time = ManagementFactory.getRuntimeMXBean().getStartTime();
|
||||
return new Date(time);
|
||||
}
|
||||
|
||||
/**
|
||||
* 计算两个时间差
|
||||
* 计算两个日期之间的天数差(以毫秒为单位)
|
||||
*
|
||||
* @param date1 第一个日期
|
||||
* @param date2 第二个日期
|
||||
* @return 两个日期之间的天数差的绝对值
|
||||
*/
|
||||
public static String getDatePoor(Date endDate, Date nowDate)
|
||||
{
|
||||
long nd = 1000 * 24 * 60 * 60;
|
||||
long nh = 1000 * 60 * 60;
|
||||
long nm = 1000 * 60;
|
||||
// long ns = 1000;
|
||||
// 获得两个时间的毫秒时间差异
|
||||
long diff = endDate.getTime() - nowDate.getTime();
|
||||
// 计算差多少天
|
||||
long day = diff / nd;
|
||||
// 计算差多少小时
|
||||
long hour = diff % nd / nh;
|
||||
// 计算差多少分钟
|
||||
long min = diff % nd % nh / nm;
|
||||
// 计算差多少秒//输出结果
|
||||
// long sec = diff % nd % nh % nm / ns;
|
||||
return day + "天" + hour + "小时" + min + "分钟";
|
||||
public static int differentDaysByMillisecond(Date date1, Date date2) {
|
||||
return Math.abs((int) ((date2.getTime() - date1.getTime()) / (1000 * 3600 * 24)));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取2个时间间隔天数
|
||||
* @param beginTime
|
||||
* @param endTime
|
||||
* @return
|
||||
* 计算两个日期之间的时间差,并以天、小时和分钟的格式返回
|
||||
*
|
||||
* @param endDate 结束日期
|
||||
* @param nowDate 当前日期
|
||||
* @return 表示时间差的字符串,格式为"天 小时 分钟"
|
||||
*/
|
||||
public static Long betweenDay(LocalDateTime beginTime, LocalDateTime endTime){
|
||||
return ChronoUnit.DAYS.between(beginTime.toLocalDate().atStartOfDay(),endTime.toLocalDate().atStartOfDay());
|
||||
public static String getDatePoor(Date endDate, Date nowDate) {
|
||||
long diffInMillis = endDate.getTime() - nowDate.getTime();
|
||||
long day = TimeUnit.MILLISECONDS.toDays(diffInMillis);
|
||||
long hour = TimeUnit.MILLISECONDS.toHours(diffInMillis) % 24;
|
||||
long min = TimeUnit.MILLISECONDS.toMinutes(diffInMillis) % 60;
|
||||
return String.format("%d天 %d小时 %d分钟", day, hour, min);
|
||||
}
|
||||
|
||||
public static List<LocalDateTime> getTimeDiff(int days){
|
||||
// 获取当前日期
|
||||
LocalDate current = LocalDate.now();
|
||||
|
||||
// 获取第一天
|
||||
LocalDate firstDayOfLastMonth = current.minusMonths(days).withDayOfMonth(1);
|
||||
// 获取上个月最后一天
|
||||
LocalDate lastDayOfLastMonth = firstDayOfLastMonth.plusMonths(1).withDayOfMonth(1).minusDays(1);
|
||||
|
||||
return Arrays.asList(LocalDateTime.of(firstDayOfLastMonth, LocalTime.MIN),LocalDateTime.of(lastDayOfLastMonth, LocalTime.MAX));
|
||||
/**
|
||||
* 计算两个时间点的差值(天、小时、分钟、秒),当值为0时不显示该单位
|
||||
*
|
||||
* @param endDate 结束时间
|
||||
* @param nowDate 当前时间
|
||||
* @return 时间差字符串,格式为 "x天 x小时 x分钟 x秒",若为 0 则不显示
|
||||
*/
|
||||
public static String getTimeDifference(Date endDate, Date nowDate) {
|
||||
long diffInMillis = endDate.getTime() - nowDate.getTime();
|
||||
long day = TimeUnit.MILLISECONDS.toDays(diffInMillis);
|
||||
long hour = TimeUnit.MILLISECONDS.toHours(diffInMillis) % 24;
|
||||
long min = TimeUnit.MILLISECONDS.toMinutes(diffInMillis) % 60;
|
||||
long sec = TimeUnit.MILLISECONDS.toSeconds(diffInMillis) % 60;
|
||||
// 构建时间差字符串,条件是值不为0才显示
|
||||
StringBuilder result = new StringBuilder();
|
||||
if (day > 0) {
|
||||
result.append(String.format("%d天 ", day));
|
||||
}
|
||||
if (hour > 0) {
|
||||
result.append(String.format("%d小时 ", hour));
|
||||
}
|
||||
if (min > 0) {
|
||||
result.append(String.format("%d分钟 ", min));
|
||||
}
|
||||
if (sec > 0) {
|
||||
result.append(String.format("%d秒", sec));
|
||||
}
|
||||
return result.length() > 0 ? result.toString().trim() : "0秒";
|
||||
}
|
||||
|
||||
/**
|
||||
* 将 LocalDateTime 对象转换为 Date 对象
|
||||
*
|
||||
* @param temporalAccessor 要转换的 LocalDateTime 对象
|
||||
* @return 转换后的 Date 对象
|
||||
*/
|
||||
public static Date toDate(LocalDateTime temporalAccessor) {
|
||||
ZonedDateTime zdt = temporalAccessor.atZone(ZoneId.systemDefault());
|
||||
return Date.from(zdt.toInstant());
|
||||
}
|
||||
|
||||
/**
|
||||
* 将 LocalDate 对象转换为 Date 对象
|
||||
*
|
||||
* @param temporalAccessor 要转换的 LocalDate 对象
|
||||
* @return 转换后的 Date 对象
|
||||
*/
|
||||
public static Date toDate(LocalDate temporalAccessor) {
|
||||
LocalDateTime localDateTime = LocalDateTime.of(temporalAccessor, LocalTime.of(0, 0, 0));
|
||||
ZonedDateTime zdt = localDateTime.atZone(ZoneId.systemDefault());
|
||||
return Date.from(zdt.toInstant());
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验日期范围
|
||||
*
|
||||
* @param startDate 开始日期
|
||||
* @param endDate 结束日期
|
||||
* @param maxValue 最大时间跨度的限制值
|
||||
* @param unit 时间跨度的单位,可选择 "DAYS"、"HOURS" 或 "MINUTES"
|
||||
*/
|
||||
public static void validateDateRange(Date startDate, Date endDate, int maxValue, TimeUnit unit) {
|
||||
// 校验结束日期不能早于开始日期
|
||||
if (endDate.before(startDate)) {
|
||||
throw new ServiceException("结束日期不能早于开始日期");
|
||||
}
|
||||
|
||||
// 计算时间跨度
|
||||
long diffInMillis = endDate.getTime() - startDate.getTime();
|
||||
|
||||
// 根据单位转换时间跨度
|
||||
long diff = switch (unit) {
|
||||
case DAYS -> TimeUnit.MILLISECONDS.toDays(diffInMillis);
|
||||
case HOURS -> TimeUnit.MILLISECONDS.toHours(diffInMillis);
|
||||
case MINUTES -> TimeUnit.MILLISECONDS.toMinutes(diffInMillis);
|
||||
default -> throw new IllegalArgumentException("不支持的时间单位");
|
||||
};
|
||||
|
||||
// 校验时间跨度不超过最大限制
|
||||
if (diff > maxValue) {
|
||||
throw new ServiceException("最大时间跨度为 " + maxValue + " " + unit.toString().toLowerCase());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,184 +0,0 @@
|
||||
package org.dromara.common.core.utils;
|
||||
|
||||
import com.ruoyi.common.constant.Constants;
|
||||
import com.ruoyi.common.core.domain.entity.SysDictData;
|
||||
import com.ruoyi.common.core.redis.RedisCache;
|
||||
import com.ruoyi.common.utils.spring.SpringUtils;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 字典工具类
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public class DictUtils
|
||||
{
|
||||
/**
|
||||
* 分隔符
|
||||
*/
|
||||
public static final String SEPARATOR = ",";
|
||||
|
||||
/**
|
||||
* 设置字典缓存
|
||||
*
|
||||
* @param key 参数键
|
||||
* @param dictDatas 字典数据列表
|
||||
*/
|
||||
public static void setDictCache(String key, List<SysDictData> dictDatas)
|
||||
{
|
||||
SpringUtils.getBean(RedisCache.class).setCacheObject(getCacheKey(key), dictDatas);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取字典缓存
|
||||
*
|
||||
* @param key 参数键
|
||||
* @return dictDatas 字典数据列表
|
||||
*/
|
||||
public static List<SysDictData> getDictCache(String key)
|
||||
{
|
||||
Object cacheObj = SpringUtils.getBean(RedisCache.class).getCacheObject(getCacheKey(key));
|
||||
if (StringUtils.isNotNull(cacheObj))
|
||||
{
|
||||
List<SysDictData> dictDatas = StringUtils.cast(cacheObj);
|
||||
return dictDatas;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据字典类型和字典值获取字典标签
|
||||
*
|
||||
* @param dictType 字典类型
|
||||
* @param dictValue 字典值
|
||||
* @return 字典标签
|
||||
*/
|
||||
public static String getDictLabel(String dictType, String dictValue)
|
||||
{
|
||||
return getDictLabel(dictType, dictValue, SEPARATOR);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据字典类型和字典标签获取字典值
|
||||
*
|
||||
* @param dictType 字典类型
|
||||
* @param dictLabel 字典标签
|
||||
* @return 字典值
|
||||
*/
|
||||
public static String getDictValue(String dictType, String dictLabel)
|
||||
{
|
||||
return getDictValue(dictType, dictLabel, SEPARATOR);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据字典类型和字典值获取字典标签
|
||||
*
|
||||
* @param dictType 字典类型
|
||||
* @param dictValue 字典值
|
||||
* @param separator 分隔符
|
||||
* @return 字典标签
|
||||
*/
|
||||
public static String getDictLabel(String dictType, String dictValue, String separator)
|
||||
{
|
||||
StringBuilder propertyString = new StringBuilder();
|
||||
List<SysDictData> datas = getDictCache(dictType);
|
||||
|
||||
if (StringUtils.containsAny(separator, dictValue) && StringUtils.isNotEmpty(datas))
|
||||
{
|
||||
for (SysDictData dict : datas)
|
||||
{
|
||||
for (String value : dictValue.split(separator))
|
||||
{
|
||||
if (value.equals(dict.getDictValue()))
|
||||
{
|
||||
propertyString.append(dict.getDictLabel() + separator);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (SysDictData dict : datas)
|
||||
{
|
||||
if (dictValue.equals(dict.getDictValue()))
|
||||
{
|
||||
return dict.getDictLabel();
|
||||
}
|
||||
}
|
||||
}
|
||||
return StringUtils.stripEnd(propertyString.toString(), separator);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据字典类型和字典标签获取字典值
|
||||
*
|
||||
* @param dictType 字典类型
|
||||
* @param dictLabel 字典标签
|
||||
* @param separator 分隔符
|
||||
* @return 字典值
|
||||
*/
|
||||
public static String getDictValue(String dictType, String dictLabel, String separator)
|
||||
{
|
||||
StringBuilder propertyString = new StringBuilder();
|
||||
List<SysDictData> datas = getDictCache(dictType);
|
||||
|
||||
if (StringUtils.containsAny(separator, dictLabel) && StringUtils.isNotEmpty(datas))
|
||||
{
|
||||
for (SysDictData dict : datas)
|
||||
{
|
||||
for (String label : dictLabel.split(separator))
|
||||
{
|
||||
if (label.equals(dict.getDictLabel()))
|
||||
{
|
||||
propertyString.append(dict.getDictValue() + separator);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (SysDictData dict : datas)
|
||||
{
|
||||
if (dictLabel.equals(dict.getDictLabel()))
|
||||
{
|
||||
return dict.getDictValue();
|
||||
}
|
||||
}
|
||||
}
|
||||
return StringUtils.stripEnd(propertyString.toString(), separator);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除指定字典缓存
|
||||
*
|
||||
* @param key 字典键
|
||||
*/
|
||||
public static void removeDictCache(String key)
|
||||
{
|
||||
SpringUtils.getBean(RedisCache.class).deleteObject(getCacheKey(key));
|
||||
}
|
||||
|
||||
/**
|
||||
* 清空字典缓存
|
||||
*/
|
||||
public static void clearDictCache()
|
||||
{
|
||||
Collection<String> keys = SpringUtils.getBean(RedisCache.class).keys(Constants.SYS_DICT_KEY + "*");
|
||||
SpringUtils.getBean(RedisCache.class).deleteObject(keys);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置cache key
|
||||
*
|
||||
* @param configKey 参数键
|
||||
* @return 缓存键key
|
||||
*/
|
||||
public static String getCacheKey(String configKey)
|
||||
{
|
||||
return Constants.SYS_DICT_KEY + configKey;
|
||||
}
|
||||
}
|
@ -59,7 +59,6 @@ public class ImageUtils
|
||||
/**
|
||||
* 读取文件为字节数据
|
||||
*
|
||||
* @param key 地址
|
||||
* @return 字节数据
|
||||
*/
|
||||
public static byte[] readFile(String url)
|
||||
|
@ -26,8 +26,8 @@ import org.apache.poi.xssf.streaming.SXSSFWorkbook;
|
||||
import org.apache.poi.xssf.usermodel.XSSFClientAnchor;
|
||||
import org.apache.poi.xssf.usermodel.XSSFDataValidation;
|
||||
import org.dromara.common.core.config.RuoYiConfig;
|
||||
import org.dromara.common.core.enums.FormatsType;
|
||||
import org.dromara.common.core.utils.DateUtils;
|
||||
import org.dromara.common.core.utils.DictUtils;
|
||||
import org.dromara.common.core.utils.ImageUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.core.utils.file.FileTypeUtils;
|
||||
@ -852,7 +852,7 @@ public class ExcelUtil<T> {
|
||||
String dictType = attr.dictType();
|
||||
if (StringUtils.isNotEmpty(dateFormat) && StringUtils.isNotNull(value))
|
||||
{
|
||||
cell.setCellValue(DateUtils.parseDateToStr(dateFormat, (Date) value));
|
||||
cell.setCellValue(DateUtils.parseDateToStr(FormatsType.valueOf(dateFormat), (Date) value));
|
||||
}
|
||||
else if (StringUtils.isNotEmpty(readConverterExp) && StringUtils.isNotNull(value))
|
||||
{
|
||||
@ -1003,7 +1003,8 @@ public class ExcelUtil<T> {
|
||||
*/
|
||||
public static String convertDictByExp(String dictValue, String dictType, String separator)
|
||||
{
|
||||
return DictUtils.getDictLabel(dictType, dictValue, separator);
|
||||
// return DictUtils.getDictLabel(dictType, dictValue, separator);
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
34
ruoyi-common/ruoyi-common-mongo/pom.xml
Normal file
34
ruoyi-common/ruoyi-common-mongo/pom.xml
Normal file
@ -0,0 +1,34 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<parent>
|
||||
<groupId>org.dromara</groupId>
|
||||
<artifactId>ruoyi-common</artifactId>
|
||||
<version>${revision}</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>ruoyi-common-mongo</artifactId>
|
||||
|
||||
<description>
|
||||
ruoyi-common-mongo
|
||||
</description>
|
||||
|
||||
<dependencies>
|
||||
<!-- RuoYi Common Core-->
|
||||
<dependency>
|
||||
<groupId>org.dromara</groupId>
|
||||
<artifactId>ruoyi-common-core</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.dromara</groupId>
|
||||
<artifactId>ruoyi-common-log</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-data-mongodb</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
</dependencies>
|
||||
</project>
|
@ -0,0 +1,9 @@
|
||||
<archetype>
|
||||
<id>ruoyi-common-mongo</id>
|
||||
<sources>
|
||||
<source>src/main/java/App.java</source>
|
||||
</sources>
|
||||
<testSources>
|
||||
<source>src/test/java/AppTest.java</source>
|
||||
</testSources>
|
||||
</archetype>
|
@ -0,0 +1,15 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>$org.dromara</groupId>
|
||||
<artifactId>$ruoyi-common-mongo</artifactId>
|
||||
<version>$5.3.1</version>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>3.8.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
@ -0,0 +1,13 @@
|
||||
package $org.dromara;
|
||||
|
||||
/**
|
||||
* Hello world!
|
||||
*
|
||||
*/
|
||||
public class App
|
||||
{
|
||||
public static void main( String[] args )
|
||||
{
|
||||
System.out.println( "Hello World!" );
|
||||
}
|
||||
}
|
@ -0,0 +1,38 @@
|
||||
package $org.dromara;
|
||||
|
||||
import junit.framework.Test;
|
||||
import junit.framework.TestCase;
|
||||
import junit.framework.TestSuite;
|
||||
|
||||
/**
|
||||
* Unit test for simple App.
|
||||
*/
|
||||
public class AppTest
|
||||
extends TestCase
|
||||
{
|
||||
/**
|
||||
* Create the test case
|
||||
*
|
||||
* @param testName name of the test case
|
||||
*/
|
||||
public AppTest( String testName )
|
||||
{
|
||||
super( testName );
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the suite of tests being tested
|
||||
*/
|
||||
public static Test suite()
|
||||
{
|
||||
return new TestSuite( AppTest.class );
|
||||
}
|
||||
|
||||
/**
|
||||
* Rigourous Test :-)
|
||||
*/
|
||||
public void testApp()
|
||||
{
|
||||
assertTrue( true );
|
||||
}
|
||||
}
|
@ -8,6 +8,7 @@ import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
@ -46,7 +47,7 @@ public class BaseEntity implements Serializable {
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private Date createTime;
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新者
|
||||
@ -58,7 +59,7 @@ public class BaseEntity implements Serializable {
|
||||
* 更新时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private Date updateTime;
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 请求参数
|
||||
|
@ -11,6 +11,7 @@ import org.dromara.common.core.utils.ObjectUtils;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import org.dromara.common.satoken.utils.LoginHelper;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
@ -32,7 +33,7 @@ public class InjectionMetaObjectHandler implements MetaObjectHandler {
|
||||
try {
|
||||
if (ObjectUtil.isNotNull(metaObject) && metaObject.getOriginalObject() instanceof BaseEntity baseEntity) {
|
||||
// 获取当前时间作为创建时间和更新时间,如果创建时间不为空,则使用创建时间,否则使用当前时间
|
||||
Date current = ObjectUtils.notNull(baseEntity.getCreateTime(), new Date());
|
||||
LocalDateTime current = ObjectUtils.notNull(baseEntity.getCreateTime(), LocalDateTime.now());
|
||||
baseEntity.setCreateTime(current);
|
||||
baseEntity.setUpdateTime(current);
|
||||
|
||||
@ -67,8 +68,7 @@ public class InjectionMetaObjectHandler implements MetaObjectHandler {
|
||||
try {
|
||||
if (ObjectUtil.isNotNull(metaObject) && metaObject.getOriginalObject() instanceof BaseEntity baseEntity) {
|
||||
// 获取当前时间作为更新时间,无论原始对象中的更新时间是否为空都填充
|
||||
Date current = new Date();
|
||||
baseEntity.setUpdateTime(current);
|
||||
baseEntity.setUpdateTime(LocalDateTime.now());
|
||||
|
||||
// 获取当前登录用户的ID,并填充更新人信息
|
||||
Long userId = LoginHelper.getUserId();
|
||||
|
@ -3,6 +3,7 @@ package org.dromara.common.oss.core;
|
||||
import cn.hutool.core.io.IoUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import org.dromara.common.core.constant.Constants;
|
||||
import org.dromara.common.core.utils.DateUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.core.utils.file.FileUtils;
|
||||
import org.dromara.common.oss.constant.OssConstant;
|
||||
|
@ -57,6 +57,16 @@
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-crypto</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>mybatis-plus-core</artifactId>
|
||||
<version>3.5.11</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.dromara</groupId>
|
||||
<artifactId>ruoyi-common-mybatis</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
|
@ -0,0 +1,43 @@
|
||||
package org.dromara.common.web.core;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.metadata.TableInfo;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface BaseConverter<V,B,T> {
|
||||
/**
|
||||
* dto转vo
|
||||
* @param t
|
||||
* @return
|
||||
*/
|
||||
V convertToVO(T t);
|
||||
|
||||
/**
|
||||
* dto列表转vo
|
||||
* @param tList
|
||||
* @return
|
||||
*/
|
||||
List<V> convertToVO(List<T> tList);
|
||||
/**
|
||||
* dto分页转vo
|
||||
* @param tPage
|
||||
* @return
|
||||
*/
|
||||
TableDataInfo<V> convertToVO(IPage<T> tPage);
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* dto转po
|
||||
* @param d
|
||||
* @return
|
||||
*/
|
||||
T convertToPo(B d);
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
@ -101,5 +101,19 @@
|
||||
<groupId>org.dromara</groupId>
|
||||
<artifactId>ruoyi-system</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.xiaoymin</groupId>
|
||||
<artifactId>knife4j-spring-boot-starter</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.xiaoymin</groupId>
|
||||
<artifactId>knife4j-springdoc-ui</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.dromara</groupId>
|
||||
<artifactId>ruoyi-member</artifactId>
|
||||
<version>5.3.1</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
@ -0,0 +1,66 @@
|
||||
package com.wzj.soopin.manager.member.controller;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.wzj.soopin.member.convert.FeedbackConvert;
|
||||
import com.wzj.soopin.member.domain.po.Feedback;
|
||||
import com.wzj.soopin.member.domain.bo.FeedbackBO;
|
||||
import com.wzj.soopin.member.domain.vo.FeedbackVO;
|
||||
import com.wzj.soopin.member.service.IFeedbackService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.PageImpl;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 意见反馈Controller
|
||||
*
|
||||
* @author zcc
|
||||
* @date 2024-02-26
|
||||
*/
|
||||
@Api(description ="意见反馈接口列表")
|
||||
@RestController
|
||||
@RequestMapping("/ums/feedback")
|
||||
public class FeedbackController extends BaseController {
|
||||
@Autowired
|
||||
private IFeedbackService service;
|
||||
@Autowired
|
||||
private FeedbackConvert convert;
|
||||
|
||||
// @ApiOperation("查询意见反馈列表")
|
||||
// @PostMapping("/list")
|
||||
// public ResponseEntity<IPage<FeedbackVO>> list(@RequestBody FeedbackBO query, IPage page) {
|
||||
// service.page(page,query.toWrapper());
|
||||
// return ResponseEntity.ok(new PageImpl<>(list, page, ((com.github.pagehelper.Page)list).getTotal()));
|
||||
// }
|
||||
|
||||
|
||||
// @ApiOperation("修改意见反馈备注信息")
|
||||
// @Log(title = "意见反馈", businessType = BusinessType.UPDATE)
|
||||
// @PostMapping("/mark/update")
|
||||
// public ResponseEntity<Integer> editMark(@RequestBody Feedback feedback) {
|
||||
// return ResponseEntity.ok(service.updateMark(feedback));
|
||||
// }
|
||||
|
||||
// @ApiOperation(("修改状态"))
|
||||
// @Log(title = "意见反馈", businessType = BusinessType.UPDATE)
|
||||
// @PostMapping("/handle/status/change")
|
||||
// public ResponseEntity<Integer> changeStatus(@RequestBody Feedback dto){
|
||||
// return ResponseEntity.ok(service.changeStatus(dto));
|
||||
// }
|
||||
|
||||
|
||||
@ApiOperation("删除意见反馈")
|
||||
@Log(title = "意见反馈", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{id}")
|
||||
public ResponseEntity<Object> remove(@PathVariable Long id) {
|
||||
return ResponseEntity.ok(service.removeById(id));
|
||||
}
|
||||
}
|
@ -0,0 +1,78 @@
|
||||
package com.wzj.soopin.manager.member.controller;
|
||||
|
||||
import com.wzj.soopin.member.convert.MemberAccountConvert;
|
||||
import com.wzj.soopin.member.domain.po.MemberAccount;
|
||||
import com.wzj.soopin.member.domain.bo.MemberAccountQuery;
|
||||
import com.wzj.soopin.member.domain.vo.MemberAccountVO;
|
||||
import com.wzj.soopin.member.service.IMemberAccountService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.PageImpl;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
/**
|
||||
* 会员账户表Controller
|
||||
*
|
||||
* @author zcc
|
||||
* @date 2024-03-01
|
||||
*/
|
||||
@Api(description ="会员账户表接口列表")
|
||||
@RestController
|
||||
@RequestMapping("/ums/memberAccount")
|
||||
public class MemberAccountController {
|
||||
@Autowired
|
||||
private IMemberAccountService service;
|
||||
@Autowired
|
||||
private MemberAccountConvert convert;
|
||||
|
||||
// @ApiOperation("查询会员账户表列表")
|
||||
// @PostMapping("/list")
|
||||
// public ResponseEntity<Page<MemberAccount>> list(@RequestBody MemberAccountQuery query, Pageable page) {
|
||||
// List<MemberAccount> list = service.selectList(query, page);
|
||||
// return ResponseEntity.ok(new PageImpl<>(list, page, ((com.github.pagehelper.Page)list).getTotal()));
|
||||
// }
|
||||
|
||||
// @ApiOperation("导出会员账户表列表")
|
||||
// @Log(title = "会员账户表", businessType = BusinessType.EXPORT)
|
||||
// @GetMapping("/export")
|
||||
// public ResponseEntity<String> export(MemberAccountBO query) {
|
||||
// List<MemberAccount> list = service.selectList(query);
|
||||
// ExcelUtil<MemberAccountVO> util = new ExcelUtil<>(MemberAccountVO.class);
|
||||
// return ResponseEntity.ok(util.writeExcel(convert.dos2vos(list), "会员账户表数据"));
|
||||
// }
|
||||
|
||||
@ApiOperation("获取会员账户表详细信息")
|
||||
@GetMapping(value = "/{memberId}")
|
||||
public ResponseEntity<MemberAccount> getInfo(@PathVariable("memberId") Long memberId) {
|
||||
return ResponseEntity.ok(service.getById(memberId));
|
||||
}
|
||||
|
||||
@ApiOperation("新增会员账户表")
|
||||
@Log(title = "会员账户表", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public ResponseEntity<Object> add(@RequestBody MemberAccount memberAccount) {
|
||||
return ResponseEntity.ok(service.save(memberAccount));
|
||||
}
|
||||
|
||||
@ApiOperation("修改会员账户表")
|
||||
@Log(title = "会员账户表", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public ResponseEntity<Object> edit(@RequestBody MemberAccount memberAccount) {
|
||||
return ResponseEntity.ok(service.updateById(memberAccount));
|
||||
}
|
||||
|
||||
@ApiOperation("删除会员账户表")
|
||||
|
||||
@Log(title = "会员账户表", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{memberId}")
|
||||
public ResponseEntity<Object> remove(@PathVariable Long memberId) {
|
||||
return ResponseEntity.ok(service.removeById(memberId));
|
||||
}
|
||||
}
|
@ -0,0 +1,83 @@
|
||||
package com.wzj.soopin.manager.member.controller;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.wzj.soopin.member.convert.MemberAddressConvert;
|
||||
import com.wzj.soopin.member.domain.po.MemberAddress;
|
||||
import com.wzj.soopin.member.domain.bo.MemberAddressBO;
|
||||
import com.wzj.soopin.member.domain.vo.MemberAddressVO;
|
||||
import com.wzj.soopin.member.service.IMemberAddressService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.PageImpl;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 会员收货地址Controller
|
||||
*
|
||||
* @author zcc
|
||||
* @date 2022-11-28
|
||||
*/
|
||||
@Api(description ="会员收货地址接口列表")
|
||||
@RestController
|
||||
@RequestMapping("/ums/memberAddress")
|
||||
public class MemberAddressController {
|
||||
@Autowired
|
||||
private IMemberAddressService service;
|
||||
@Autowired
|
||||
private MemberAddressConvert convert;
|
||||
|
||||
@ApiOperation("查询会员收货地址列表")
|
||||
@PostMapping("/list")
|
||||
public R list(@RequestBody MemberAddressBO query, IPage page) {
|
||||
IPage<MemberAddress> list = service.page(page,query.toWrapper());
|
||||
return R.ok(convert.convertToVO(list));
|
||||
}
|
||||
|
||||
@ApiOperation("导出会员收货地址列表")
|
||||
@Log(title = "会员收货地址", businessType = BusinessType.EXPORT)
|
||||
@GetMapping("/export")
|
||||
public ResponseEntity<String> export(MemberAddressBO query) {
|
||||
// List<MemberAddressV> list = service.selectList(query, null);
|
||||
// ExcelUtil<MemberAddressVO> util = new ExcelUtil<>(MemberAddressVO.class);
|
||||
// return ResponseEntity.ok(util.writeExcel(convert.dos2vos(list), "会员收货地址数据"));
|
||||
return null;
|
||||
}
|
||||
|
||||
@ApiOperation("获取会员收货地址详细信息")
|
||||
@GetMapping(value = "/{id}")
|
||||
public ResponseEntity<MemberAddress> getInfo(@PathVariable("id") Long id) {
|
||||
return ResponseEntity.ok(service.getById(id));
|
||||
}
|
||||
|
||||
@ApiOperation("新增会员收货地址")
|
||||
@Log(title = "会员收货地址", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public ResponseEntity<Object> add(@RequestBody MemberAddress memberAddress) {
|
||||
return ResponseEntity.ok(service.save(memberAddress));
|
||||
}
|
||||
|
||||
@ApiOperation("修改会员收货地址")
|
||||
@Log(title = "会员收货地址", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public ResponseEntity edit(@RequestBody MemberAddress memberAddress) {
|
||||
service.updateById(memberAddress);
|
||||
return ResponseEntity.ok(null);
|
||||
}
|
||||
|
||||
@ApiOperation("删除会员收货地址")
|
||||
@Log(title = "会员收货地址", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{id}")
|
||||
public ResponseEntity<Object> remove(@PathVariable Long id) {
|
||||
return ResponseEntity.ok(service.removeById(id));
|
||||
}
|
||||
}
|
@ -0,0 +1,85 @@
|
||||
package com.wzj.soopin.manager.member.controller;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.wzj.soopin.member.convert.MemberCartConvert;
|
||||
import com.wzj.soopin.member.domain.po.MemberCart;
|
||||
import com.wzj.soopin.member.domain.bo.MemberCartBO;
|
||||
import com.wzj.soopin.member.service.IMemberCartService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* 购物车Controller
|
||||
*
|
||||
* @author zcc
|
||||
* @date 2022-11-29
|
||||
*/
|
||||
@Api(description ="购物车接口列表")
|
||||
@RestController
|
||||
@RequestMapping("/ums/memberCart")
|
||||
public class MemberCartController extends BaseController {
|
||||
@Autowired
|
||||
private IMemberCartService service;
|
||||
@Autowired
|
||||
private MemberCartConvert convert;
|
||||
|
||||
@ApiOperation("查询购物车列表")
|
||||
@PostMapping("/list")
|
||||
public ResponseEntity<Object> list(@RequestBody MemberCartBO query, Pageable page) {
|
||||
IPage<MemberCart> poPage=new Page<MemberCart>();
|
||||
poPage.setSize(page.getPageSize());
|
||||
poPage.setCurrent(page.getPageNumber());
|
||||
IPage<MemberCart> userPage=service.page(poPage,new QueryWrapper<MemberCart>());
|
||||
return ResponseEntity.ok(convert.convertToVO(poPage));
|
||||
}
|
||||
|
||||
@ApiOperation("导出购物车列表")
|
||||
@Log(title = "购物车", businessType = BusinessType.EXPORT)
|
||||
@GetMapping("/export")
|
||||
public ResponseEntity<String> export(MemberCartBO query) {
|
||||
// List<MemberCart> list = service.selectList(query, null);
|
||||
// ExcelUtil<MemberCartVO> util = new ExcelUtil<>(MemberCartVO.class);
|
||||
// return ResponseEntity.ok(util.writeExcel(convert.dos2vos(list), "购物车数据"));
|
||||
return null;
|
||||
}
|
||||
|
||||
@ApiOperation("获取购物车详细信息")
|
||||
@GetMapping(value = "/{id}")
|
||||
public ResponseEntity<MemberCart> getInfo(@PathVariable("id") Long id) {
|
||||
return ResponseEntity.ok(service.getById(id));
|
||||
}
|
||||
|
||||
// @ApiOperation("新增购物车")
|
||||
// @Log(title = "购物车", businessType = BusinessType.INSERT)
|
||||
// @PostMapping
|
||||
// public ResponseEntity<Integer> add(@RequestBody MemberCart memberCart) {
|
||||
// return ResponseEntity.ok(service.insert(memberCart));
|
||||
// }
|
||||
|
||||
// @ApiOperation("修改购物车")
|
||||
// @PreAuthorize("@ss.hasPermi('ums:memberCart:edit')")
|
||||
// @Log(title = "购物车", businessType = BusinessType.UPDATE)
|
||||
// @PutMapping
|
||||
// public ResponseEntity<Integer> edit(@RequestBody MemberCart memberCart) {
|
||||
// return ResponseEntity.ok(service.update(memberCart));
|
||||
// }
|
||||
|
||||
// @ApiOperation("删除购物车")
|
||||
// @PreAuthorize("@ss.hasPermi('ums:memberCart:remove')")
|
||||
// @Log(title = "购物车", businessType = BusinessType.DELETE)
|
||||
// @DeleteMapping("/{id}")
|
||||
// public ResponseEntity<Integer> remove(@PathVariable Long id) {
|
||||
// return ResponseEntity.ok(service.deleteById(id));
|
||||
// }
|
||||
}
|
@ -0,0 +1,112 @@
|
||||
package com.wzj.soopin.manager.member.controller;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.wzj.soopin.member.convert.MemberConvert;
|
||||
import com.wzj.soopin.member.domain.bo.MemberBO;
|
||||
import com.wzj.soopin.member.domain.form.ChangeMemberStatusForm;
|
||||
import com.wzj.soopin.member.domain.po.Member;
|
||||
import com.wzj.soopin.member.domain.vo.MemberVO;
|
||||
import com.wzj.soopin.member.service.IMemberService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.excel.utils.ExcelUtil;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.PageImpl;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
/**
|
||||
* 会员信息Controller
|
||||
*
|
||||
* @author zcc
|
||||
* @date 2022-11-28
|
||||
*/
|
||||
@Api(description ="会员信息接口列表")
|
||||
@RestController
|
||||
public class MemberController extends BaseController {
|
||||
@Autowired
|
||||
private IMemberService service;
|
||||
@Autowired
|
||||
private MemberConvert convert;
|
||||
|
||||
// @RequestMapping(path ={"/ums/member/wechat/code","/h5/member/wechat/code","/no-auth/wechat/code"},method=RequestMethod.GET)
|
||||
// public R getWechatCode(@RequestParam(required = false) String scene) {
|
||||
// return R.ok(wechatAuthService.getQRCode(scene));
|
||||
// }
|
||||
|
||||
@ApiOperation("查询会员信息列表")
|
||||
@PreAuthorize("@ss.hasPermi('ums:member:list')")
|
||||
@PostMapping("/ums/member/list")
|
||||
public TableDataInfo<MemberVO> list(@RequestBody MemberBO bo, IPage<Member> page) {
|
||||
IPage<Member> memberPage = service.page(page,bo.toWapper());
|
||||
return convert.convertToVO(memberPage);
|
||||
}
|
||||
|
||||
@ApiOperation("导出会员信息列表")
|
||||
@PreAuthorize("@ss.hasPermi('ums:member:export')")
|
||||
@Log(title = "会员信息", businessType = BusinessType.EXPORT)
|
||||
@GetMapping("/ums/member/export")
|
||||
public ResponseEntity<String> export(MemberBO query) {
|
||||
List<Member> list = service.list(query.toWapper());
|
||||
ExcelUtil<MemberVO> util = new ExcelUtil<>(MemberVO.class);
|
||||
return ResponseEntity.ok(util.writeExcel(convert.convertToVO(list), "会员信息数据"));
|
||||
}
|
||||
|
||||
@ApiOperation("获取会员信息详细信息")
|
||||
@PreAuthorize("@ss.hasPermi('ums:member:query')")
|
||||
@GetMapping(value = "/ums/member/{id}")
|
||||
public ResponseEntity<Member> getInfo(@PathVariable("id") Long id) {
|
||||
return ResponseEntity.ok(service.getById(id));
|
||||
}
|
||||
|
||||
@ApiOperation("新增会员信息")
|
||||
@PreAuthorize("@ss.hasPermi('ums:member:add')")
|
||||
@Log(title = "会员信息", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/ums/member")
|
||||
public R add(@RequestBody MemberBO member) {
|
||||
return R.ok(service.save(convert.convertToPo(member)));
|
||||
}
|
||||
|
||||
@ApiOperation("修改会员信息")
|
||||
@PreAuthorize("@ss.hasPermi('ums:member:edit')")
|
||||
@Log(title = "会员信息", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/ums/member")
|
||||
public R edit(@RequestBody MemberBO member) {
|
||||
return R.ok(service.updateById(convert.convertToPo(member)));
|
||||
}
|
||||
|
||||
@ApiOperation("修改会员备注信息")
|
||||
@PreAuthorize("@ss.hasPermi('ums:member:edit')")
|
||||
@Log(title = "会员备注信息", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/ums/member/mark/update")
|
||||
public ResponseEntity<Integer> editMark(@RequestBody Member member) {
|
||||
return ResponseEntity.ok(service.updateMark(member));
|
||||
}
|
||||
|
||||
@ApiOperation("删除会员信息")
|
||||
@PreAuthorize("@ss.hasPermi('ums:member:remove')")
|
||||
@Log(title = "会员信息", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/ums/member/{id}")
|
||||
public R remove(@PathVariable Long id) {
|
||||
return R.ok(service.removeById(id));
|
||||
}
|
||||
|
||||
@ApiOperation(("修改会员账户状态"))
|
||||
@Log(title = "会员信息", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/ums/member/status/change")
|
||||
public ResponseEntity<Integer> changeStatus(@RequestBody ChangeMemberStatusForm form){
|
||||
return ResponseEntity.ok(service.changeStatus(form));
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -129,6 +129,10 @@
|
||||
<groupId>org.dromara</groupId>
|
||||
<artifactId>ruoyi-common-sse</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.dromara</groupId>
|
||||
<artifactId>ruoyi-common-mongo</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.pagehelper</groupId>
|
||||
<artifactId>pagehelper</artifactId>
|
||||
|
@ -8,7 +8,7 @@ import org.springframework.stereotype.Repository;
|
||||
import java.util.List;
|
||||
|
||||
@Repository
|
||||
public interface MessageRepository extends MongoRepository<MessageMO, String> {
|
||||
public interface MessageRepository {
|
||||
|
||||
// 通过实现Repository,自定义条件查询
|
||||
List<MessageMO> findAllByToUserIdEqualsOrderByCreateTimeDesc(String toUserId,
|
||||
|
@ -1,7 +1,7 @@
|
||||
package com.wzj.soopin.content.service;
|
||||
|
||||
|
||||
import com.wzj.soopin.content.utils.PagedGridResult;
|
||||
import com.wzj.soopin.content.domain.vo.FansVO;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
|
||||
public interface FansService {
|
||||
|
||||
@ -23,14 +23,14 @@ public interface FansService {
|
||||
/**
|
||||
* 查询我关注的博主列表
|
||||
*/
|
||||
public PagedGridResult queryMyFollows(String myId,
|
||||
Integer page,
|
||||
Integer pageSize);
|
||||
public TableDataInfo<FansVO> queryMyFollows(String myId,
|
||||
Integer page,
|
||||
Integer pageSize);
|
||||
|
||||
/**
|
||||
* 查询我的粉丝列表
|
||||
*/
|
||||
public PagedGridResult queryMyFans(String myId,
|
||||
Integer page,
|
||||
Integer pageSize);
|
||||
public TableDataInfo<FansVO> queryMyFans(String myId,
|
||||
Integer page,
|
||||
Integer pageSize);
|
||||
}
|
||||
|
@ -45,6 +45,8 @@ import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.StringWriter;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.ZoneId;
|
||||
import java.util.*;
|
||||
import java.util.zip.ZipEntry;
|
||||
import java.util.zip.ZipOutputStream;
|
||||
@ -163,8 +165,9 @@ public class GenTableServiceImpl implements IGenTableService {
|
||||
gen.setTableName(x.getName());
|
||||
gen.setTableComment(x.getComment());
|
||||
// postgresql的表元数据没有创建时间这个东西(好奇葩) 只能new Date代替
|
||||
gen.setCreateTime(ObjectUtil.defaultIfNull(x.getCreateTime(), new Date()));
|
||||
gen.setUpdateTime(x.getUpdateTime());
|
||||
ZoneId zoneId= ZoneId.systemDefault();
|
||||
gen.setCreateTime(x.getCreateTime()==null?LocalDateTime.now():LocalDateTime.ofInstant(x.getCreateTime().toInstant(), zoneId));
|
||||
gen.setUpdateTime(x.getUpdateTime()==null?LocalDateTime.now():LocalDateTime.ofInstant(x.getUpdateTime().toInstant(), zoneId));
|
||||
return gen;
|
||||
}).sorted(Comparator.comparing(GenTable::getCreateTime).reversed())
|
||||
.toList();
|
||||
@ -205,8 +208,9 @@ public class GenTableServiceImpl implements IGenTableService {
|
||||
gen.setDataName(dataName);
|
||||
gen.setTableName(x.getName());
|
||||
gen.setTableComment(x.getComment());
|
||||
gen.setCreateTime(x.getCreateTime());
|
||||
gen.setUpdateTime(x.getUpdateTime());
|
||||
ZoneId zoneId= ZoneId.systemDefault();
|
||||
gen.setCreateTime(x.getCreateTime().toInstant().atZone(zoneId).toLocalDateTime());
|
||||
gen.setUpdateTime(x.getUpdateTime().toInstant().atZone(zoneId).toLocalDateTime());
|
||||
return gen;
|
||||
}).toList();
|
||||
}
|
||||
|
@ -3,6 +3,7 @@ package org.dromara.generator.util;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.lang.Dict;
|
||||
import org.dromara.common.core.utils.DateUtils;
|
||||
import org.dromara.generator.constant.GenConstants;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.json.utils.JsonUtils;
|
||||
|
@ -107,5 +107,6 @@
|
||||
<artifactId>knife4j-springdoc-ui</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
</dependencies>
|
||||
</project>
|
||||
|
@ -1,68 +0,0 @@
|
||||
package com.wzj.soopin.member.controller;
|
||||
|
||||
import com.cyl.manager.ums.convert.FeedbackConvert;
|
||||
import com.cyl.manager.ums.domain.entity.Feedback;
|
||||
import com.cyl.manager.ums.domain.query.FeedbackQuery;
|
||||
import com.cyl.manager.ums.service.FeedbackService;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.PageImpl;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 意见反馈Controller
|
||||
*
|
||||
* @author zcc
|
||||
* @date 2024-02-26
|
||||
*/
|
||||
@Api(description ="意见反馈接口列表")
|
||||
@RestController
|
||||
@RequestMapping("/ums/feedback")
|
||||
public class FeedbackController extends BaseController {
|
||||
@Autowired
|
||||
private FeedbackService service;
|
||||
@Autowired
|
||||
private FeedbackConvert convert;
|
||||
|
||||
@ApiOperation("查询意见反馈列表")
|
||||
@PreAuthorize("@ss.hasPermi('ums:feedback:list')")
|
||||
@PostMapping("/list")
|
||||
public ResponseEntity<Page<Feedback>> list(@RequestBody FeedbackQuery query, Pageable page) {
|
||||
List<Feedback> list = service.selectList(query, page);
|
||||
return ResponseEntity.ok(new PageImpl<>(list, page, ((com.github.pagehelper.Page)list).getTotal()));
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("修改意见反馈备注信息")
|
||||
@Log(title = "意见反馈", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/mark/update")
|
||||
public ResponseEntity<Integer> editMark(@RequestBody Feedback feedback) {
|
||||
return ResponseEntity.ok(service.updateMark(feedback));
|
||||
}
|
||||
|
||||
@ApiOperation(("修改状态"))
|
||||
@Log(title = "意见反馈", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/handle/status/change")
|
||||
public ResponseEntity<Integer> changeStatus(@RequestBody Feedback dto){
|
||||
return ResponseEntity.ok(service.changeStatus(dto));
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("删除意见反馈")
|
||||
@PreAuthorize("@ss.hasPermi('ums:feedback:remove')")
|
||||
@Log(title = "意见反馈", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{id}")
|
||||
public ResponseEntity<Integer> remove(@PathVariable Long id) {
|
||||
return ResponseEntity.ok(service.deleteById(id));
|
||||
}
|
||||
}
|
@ -1,86 +0,0 @@
|
||||
package com.wzj.soopin.member.controller;
|
||||
|
||||
import com.cyl.manager.ums.convert.MemberAccountConvert;
|
||||
import com.cyl.manager.ums.domain.entity.MemberAccount;
|
||||
import com.cyl.manager.ums.domain.query.MemberAccountQuery;
|
||||
import com.cyl.manager.ums.domain.vo.MemberAccountVO;
|
||||
import com.cyl.manager.ums.service.MemberAccountService;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.PageImpl;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
/**
|
||||
* 会员账户表Controller
|
||||
*
|
||||
* @author zcc
|
||||
* @date 2024-03-01
|
||||
*/
|
||||
@Api(description ="会员账户表接口列表")
|
||||
@RestController
|
||||
@RequestMapping("/ums/memberAccount")
|
||||
public class MemberAccountController extends BaseController {
|
||||
@Autowired
|
||||
private MemberAccountService service;
|
||||
@Autowired
|
||||
private MemberAccountConvert convert;
|
||||
|
||||
@ApiOperation("查询会员账户表列表")
|
||||
@PreAuthorize("@ss.hasPermi('ums:memberAccount:list')")
|
||||
@PostMapping("/list")
|
||||
public ResponseEntity<Page<MemberAccount>> list(@RequestBody MemberAccountQuery query, Pageable page) {
|
||||
List<MemberAccount> list = service.selectList(query, page);
|
||||
return ResponseEntity.ok(new PageImpl<>(list, page, ((com.github.pagehelper.Page)list).getTotal()));
|
||||
}
|
||||
|
||||
@ApiOperation("导出会员账户表列表")
|
||||
@PreAuthorize("@ss.hasPermi('ums:memberAccount:export')")
|
||||
@Log(title = "会员账户表", businessType = BusinessType.EXPORT)
|
||||
@GetMapping("/export")
|
||||
public ResponseEntity<String> export(MemberAccountQuery query) {
|
||||
List<MemberAccount> list = service.selectList(query, null);
|
||||
ExcelUtil<MemberAccountVO> util = new ExcelUtil<>(MemberAccountVO.class);
|
||||
return ResponseEntity.ok(util.writeExcel(convert.dos2vos(list), "会员账户表数据"));
|
||||
}
|
||||
|
||||
@ApiOperation("获取会员账户表详细信息")
|
||||
@PreAuthorize("@ss.hasPermi('ums:memberAccount:query')")
|
||||
@GetMapping(value = "/{memberId}")
|
||||
public ResponseEntity<MemberAccount> getInfo(@PathVariable("memberId") Long memberId) {
|
||||
return ResponseEntity.ok(service.selectByMemberId(memberId));
|
||||
}
|
||||
|
||||
@ApiOperation("新增会员账户表")
|
||||
@PreAuthorize("@ss.hasPermi('ums:memberAccount:add')")
|
||||
@Log(title = "会员账户表", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public ResponseEntity<Integer> add(@RequestBody MemberAccount memberAccount) {
|
||||
return ResponseEntity.ok(service.insert(memberAccount));
|
||||
}
|
||||
|
||||
@ApiOperation("修改会员账户表")
|
||||
@PreAuthorize("@ss.hasPermi('ums:memberAccount:edit')")
|
||||
@Log(title = "会员账户表", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public ResponseEntity<Integer> edit(@RequestBody MemberAccount memberAccount) {
|
||||
return ResponseEntity.ok(service.update(memberAccount));
|
||||
}
|
||||
|
||||
@ApiOperation("删除会员账户表")
|
||||
@PreAuthorize("@ss.hasPermi('ums:memberAccount:remove')")
|
||||
@Log(title = "会员账户表", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{memberId}")
|
||||
public ResponseEntity<Integer> remove(@PathVariable Long memberId) {
|
||||
return ResponseEntity.ok(service.deleteByMemberId(memberId));
|
||||
}
|
||||
}
|
@ -1,88 +0,0 @@
|
||||
package com.wzj.soopin.member.controller;
|
||||
|
||||
import com.cyl.manager.ums.convert.MemberAddressConvert;
|
||||
import com.cyl.manager.ums.domain.entity.MemberAddress;
|
||||
import com.cyl.manager.ums.domain.query.MemberAddressQuery;
|
||||
import com.cyl.manager.ums.domain.vo.MemberAddressVO;
|
||||
import com.cyl.manager.ums.service.MemberAddressService;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.PageImpl;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 会员收货地址Controller
|
||||
*
|
||||
* @author zcc
|
||||
* @date 2022-11-28
|
||||
*/
|
||||
@Api(description ="会员收货地址接口列表")
|
||||
@RestController
|
||||
@RequestMapping("/ums/memberAddress")
|
||||
public class MemberAddressController extends BaseController {
|
||||
@Autowired
|
||||
private MemberAddressService service;
|
||||
@Autowired
|
||||
private MemberAddressConvert convert;
|
||||
|
||||
@ApiOperation("查询会员收货地址列表")
|
||||
@PreAuthorize("@ss.hasPermi('ums:memberAddress:list')")
|
||||
@PostMapping("/list")
|
||||
public ResponseEntity<Page<MemberAddressVO>> list(@RequestBody MemberAddressQuery query, Pageable page) {
|
||||
List<MemberAddress> list = service.selectList(query, page);
|
||||
List<MemberAddressVO> resList = convert.dos2vos(list);
|
||||
return ResponseEntity.ok(new PageImpl<>(resList, page, ((com.github.pagehelper.Page)list).getTotal()));
|
||||
}
|
||||
|
||||
@ApiOperation("导出会员收货地址列表")
|
||||
@PreAuthorize("@ss.hasPermi('ums:memberAddress:export')")
|
||||
@Log(title = "会员收货地址", businessType = BusinessType.EXPORT)
|
||||
@GetMapping("/export")
|
||||
public ResponseEntity<String> export(MemberAddressQuery query) {
|
||||
// List<MemberAddressV> list = service.selectList(query, null);
|
||||
// ExcelUtil<MemberAddressVO> util = new ExcelUtil<>(MemberAddressVO.class);
|
||||
// return ResponseEntity.ok(util.writeExcel(convert.dos2vos(list), "会员收货地址数据"));
|
||||
return null;
|
||||
}
|
||||
|
||||
@ApiOperation("获取会员收货地址详细信息")
|
||||
@PreAuthorize("@ss.hasPermi('ums:memberAddress:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public ResponseEntity<MemberAddress> getInfo(@PathVariable("id") Long id) {
|
||||
return ResponseEntity.ok(service.selectById(id));
|
||||
}
|
||||
|
||||
@ApiOperation("新增会员收货地址")
|
||||
@PreAuthorize("@ss.hasPermi('ums:memberAddress:add')")
|
||||
@Log(title = "会员收货地址", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public ResponseEntity<Integer> add(@RequestBody MemberAddress memberAddress) {
|
||||
return ResponseEntity.ok(service.insert(memberAddress));
|
||||
}
|
||||
|
||||
@ApiOperation("修改会员收货地址")
|
||||
@PreAuthorize("@ss.hasPermi('ums:memberAddress:edit')")
|
||||
@Log(title = "会员收货地址", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public ResponseEntity<Integer> edit(@RequestBody MemberAddress memberAddress) {
|
||||
return ResponseEntity.ok(service.update(memberAddress));
|
||||
}
|
||||
|
||||
@ApiOperation("删除会员收货地址")
|
||||
@PreAuthorize("@ss.hasPermi('ums:memberAddress:remove')")
|
||||
@Log(title = "会员收货地址", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{id}")
|
||||
public ResponseEntity<Integer> remove(@PathVariable Long id) {
|
||||
return ResponseEntity.ok(service.deleteById(id));
|
||||
}
|
||||
}
|
@ -1,83 +0,0 @@
|
||||
package com.wzj.soopin.member.controller;
|
||||
|
||||
import com.cyl.manager.ums.convert.MemberCartConvert;
|
||||
import com.cyl.manager.ums.domain.entity.MemberCart;
|
||||
import com.cyl.manager.ums.domain.query.MemberCartQuery;
|
||||
import com.cyl.manager.ums.domain.vo.MemberCartVO;
|
||||
import com.cyl.manager.ums.service.MemberCartService;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.PageImpl;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* 购物车Controller
|
||||
*
|
||||
* @author zcc
|
||||
* @date 2022-11-29
|
||||
*/
|
||||
@Api(description ="购物车接口列表")
|
||||
@RestController
|
||||
@RequestMapping("/ums/memberCart")
|
||||
public class MemberCartController extends BaseController {
|
||||
@Autowired
|
||||
private MemberCartService service;
|
||||
@Autowired
|
||||
private MemberCartConvert convert;
|
||||
|
||||
@ApiOperation("查询购物车列表")
|
||||
@PreAuthorize("@ss.hasPermi('ums:memberCart:list')")
|
||||
@PostMapping("/list")
|
||||
public ResponseEntity<PageImpl<MemberCartVO>> list(@RequestBody MemberCartQuery query, Pageable page) {
|
||||
return ResponseEntity.ok(service.selectList(query, page));
|
||||
}
|
||||
|
||||
@ApiOperation("导出购物车列表")
|
||||
@PreAuthorize("@ss.hasPermi('ums:memberCart:export')")
|
||||
@Log(title = "购物车", businessType = BusinessType.EXPORT)
|
||||
@GetMapping("/export")
|
||||
public ResponseEntity<String> export(MemberCartQuery query) {
|
||||
// List<MemberCart> list = service.selectList(query, null);
|
||||
// ExcelUtil<MemberCartVO> util = new ExcelUtil<>(MemberCartVO.class);
|
||||
// return ResponseEntity.ok(util.writeExcel(convert.dos2vos(list), "购物车数据"));
|
||||
return null;
|
||||
}
|
||||
|
||||
@ApiOperation("获取购物车详细信息")
|
||||
@PreAuthorize("@ss.hasPermi('ums:memberCart:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public ResponseEntity<MemberCart> getInfo(@PathVariable("id") Long id) {
|
||||
return ResponseEntity.ok(service.selectById(id));
|
||||
}
|
||||
|
||||
@ApiOperation("新增购物车")
|
||||
@PreAuthorize("@ss.hasPermi('ums:memberCart:add')")
|
||||
@Log(title = "购物车", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public ResponseEntity<Integer> add(@RequestBody MemberCart memberCart) {
|
||||
return ResponseEntity.ok(service.insert(memberCart));
|
||||
}
|
||||
|
||||
@ApiOperation("修改购物车")
|
||||
@PreAuthorize("@ss.hasPermi('ums:memberCart:edit')")
|
||||
@Log(title = "购物车", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public ResponseEntity<Integer> edit(@RequestBody MemberCart memberCart) {
|
||||
return ResponseEntity.ok(service.update(memberCart));
|
||||
}
|
||||
|
||||
@ApiOperation("删除购物车")
|
||||
@PreAuthorize("@ss.hasPermi('ums:memberCart:remove')")
|
||||
@Log(title = "购物车", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{id}")
|
||||
public ResponseEntity<Integer> remove(@PathVariable Long id) {
|
||||
return ResponseEntity.ok(service.deleteById(id));
|
||||
}
|
||||
}
|
@ -1,122 +0,0 @@
|
||||
package com.wzj.soopin.member.controller;
|
||||
|
||||
import com.cyl.manager.ums.convert.MemberConvert;
|
||||
import com.cyl.manager.ums.domain.entity.Member;
|
||||
import com.cyl.manager.ums.domain.form.ChangeMemberStatusForm;
|
||||
import com.cyl.manager.ums.domain.query.MemberQuery;
|
||||
import com.cyl.manager.ums.domain.vo.MemberDataStatisticsVO;
|
||||
import com.cyl.manager.ums.domain.vo.MemberVO;
|
||||
import com.cyl.manager.ums.service.MemberService;
|
||||
import com.cyl.wechat.WechatAuthService;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.PageImpl;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
|
||||
import java.util.List;
|
||||
/**
|
||||
* 会员信息Controller
|
||||
*
|
||||
* @author zcc
|
||||
* @date 2022-11-28
|
||||
*/
|
||||
@Api(description ="会员信息接口列表")
|
||||
@RestController
|
||||
public class MemberController extends BaseController {
|
||||
@Autowired
|
||||
private MemberService service;
|
||||
@Autowired
|
||||
private MemberConvert convert;
|
||||
@Autowired
|
||||
private WechatAuthService wechatAuthService;
|
||||
|
||||
@RequestMapping(path ={"/ums/member/wechat/code","/h5/member/wechat/code","/no-auth/wechat/code"},method=RequestMethod.GET)
|
||||
public AjaxResult getWechatCode(@RequestParam(required = false) String scene) {
|
||||
return AjaxResult.successData(wechatAuthService.getQRCode(scene));
|
||||
}
|
||||
|
||||
@ApiOperation("查询会员信息列表")
|
||||
@PreAuthorize("@ss.hasPermi('ums:member:list')")
|
||||
@PostMapping("/ums/member/list")
|
||||
public ResponseEntity<Page<Member>> list(@RequestBody MemberQuery query, Pageable page) {
|
||||
List<Member> list = service.selectList(query, page);
|
||||
return ResponseEntity.ok(new PageImpl<>(list, page, ((com.github.pagehelper.Page)list).getTotal()));
|
||||
}
|
||||
|
||||
@ApiOperation("导出会员信息列表")
|
||||
@PreAuthorize("@ss.hasPermi('ums:member:export')")
|
||||
@Log(title = "会员信息", businessType = BusinessType.EXPORT)
|
||||
@GetMapping("/ums/member/export")
|
||||
public ResponseEntity<String> export(MemberQuery query) {
|
||||
List<Member> list = service.selectList(query, null);
|
||||
ExcelUtil<MemberVO> util = new ExcelUtil<>(MemberVO.class);
|
||||
return ResponseEntity.ok(util.writeExcel(convert.dos2vos(list), "会员信息数据"));
|
||||
}
|
||||
|
||||
@ApiOperation("获取会员信息详细信息")
|
||||
@PreAuthorize("@ss.hasPermi('ums:member:query')")
|
||||
@GetMapping(value = "/ums/member/{id}")
|
||||
public ResponseEntity<Member> getInfo(@PathVariable("id") Long id) {
|
||||
return ResponseEntity.ok(service.selectById(id));
|
||||
}
|
||||
|
||||
@ApiOperation("新增会员信息")
|
||||
@PreAuthorize("@ss.hasPermi('ums:member:add')")
|
||||
@Log(title = "会员信息", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/ums/member")
|
||||
public ResponseEntity<Integer> add(@RequestBody Member member) {
|
||||
return ResponseEntity.ok(service.insert(member));
|
||||
}
|
||||
|
||||
@ApiOperation("修改会员信息")
|
||||
@PreAuthorize("@ss.hasPermi('ums:member:edit')")
|
||||
@Log(title = "会员信息", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/ums/member")
|
||||
public ResponseEntity<Integer> edit(@RequestBody Member member) {
|
||||
return ResponseEntity.ok(service.update(member));
|
||||
}
|
||||
|
||||
@ApiOperation("修改会员备注信息")
|
||||
@PreAuthorize("@ss.hasPermi('ums:member:edit')")
|
||||
@Log(title = "会员备注信息", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/ums/member/mark/update")
|
||||
public ResponseEntity<Integer> editMark(@RequestBody Member member) {
|
||||
return ResponseEntity.ok(service.updateMark(member));
|
||||
}
|
||||
|
||||
@ApiOperation("删除会员信息")
|
||||
@PreAuthorize("@ss.hasPermi('ums:member:remove')")
|
||||
@Log(title = "会员信息", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/ums/member/{id}")
|
||||
public ResponseEntity<Integer> remove(@PathVariable Long id) {
|
||||
return ResponseEntity.ok(service.deleteById(id));
|
||||
}
|
||||
|
||||
@ApiOperation(("修改会员账户状态"))
|
||||
@Log(title = "会员信息", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/ums/member/status/change")
|
||||
public ResponseEntity<Integer> changeStatus(@RequestBody ChangeMemberStatusForm form){
|
||||
return ResponseEntity.ok(service.changeStatus(form));
|
||||
}
|
||||
|
||||
@ApiOperation("会员手机号解密")
|
||||
@GetMapping("/ums/member/phone/decrypt/{phoneEncrypted}")
|
||||
public ResponseEntity<String> getPhoneDecrypted(@PathVariable String phoneEncrypted){
|
||||
return ResponseEntity.ok(service.getPhoneDecrypted(phoneEncrypted));
|
||||
}
|
||||
|
||||
@ApiOperation("查看会员统计数据")
|
||||
@GetMapping("/ums/member/view/statistics/{memberId}")
|
||||
public ResponseEntity<MemberDataStatisticsVO> viewStatistics(@PathVariable Long memberId){
|
||||
return ResponseEntity.ok(service.viewStatistics(memberId));
|
||||
}
|
||||
}
|
@ -1,81 +0,0 @@
|
||||
package com.wzj.soopin.member.controller;
|
||||
|
||||
import com.cyl.manager.ums.convert.MemberLogininforConvert;
|
||||
import com.cyl.manager.ums.domain.entity.MemberLogininfor;
|
||||
import com.cyl.manager.ums.domain.query.MemberLogininforQuery;
|
||||
import com.cyl.manager.ums.domain.vo.MemberLogininforVO;
|
||||
import com.cyl.manager.ums.service.MemberLogininforService;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.framework.web.service.TokenService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.PageImpl;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 会员登录记录Controller
|
||||
*
|
||||
* @author zcc
|
||||
* @date 2023-07-26
|
||||
*/
|
||||
@Api(description ="会员登录记录接口列表")
|
||||
@RestController
|
||||
@RequestMapping("/ums/memberLogininfor")
|
||||
public class MemberLogininforController extends BaseController {
|
||||
@Autowired
|
||||
private MemberLogininforService service;
|
||||
@Autowired
|
||||
private MemberLogininforConvert convert;
|
||||
@Autowired
|
||||
private TokenService tokenService;
|
||||
|
||||
@ApiOperation("查询会员登录记录列表")
|
||||
@PreAuthorize("@ss.hasPermi('ums:memberLogininfor:list')")
|
||||
@PostMapping("/list")
|
||||
public ResponseEntity<Page<MemberLogininfor>> list(@RequestBody MemberLogininforQuery query, Pageable page) {
|
||||
List<MemberLogininfor> list = service.selectList(query, page);
|
||||
return ResponseEntity.ok(new PageImpl<>(list, page, ((com.github.pagehelper.Page)list).getTotal()));
|
||||
}
|
||||
|
||||
@ApiOperation("导出会员登录记录列表")
|
||||
@PreAuthorize("@ss.hasPermi('ums:memberLogininfor:export')")
|
||||
@Log(title = "会员登录记录", businessType = BusinessType.EXPORT)
|
||||
@GetMapping("/export")
|
||||
public ResponseEntity<String> export(MemberLogininforQuery query) {
|
||||
List<MemberLogininfor> list = service.selectList(query, null);
|
||||
ExcelUtil<MemberLogininforVO> util = new ExcelUtil<>(MemberLogininforVO.class);
|
||||
return ResponseEntity.ok(util.writeExcel(convert.dos2vos(list), "会员登录记录数据"));
|
||||
}
|
||||
|
||||
@ApiOperation("获取会员登录记录详细信息")
|
||||
@PreAuthorize("@ss.hasPermi('ums:memberLogininfor:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public ResponseEntity<MemberLogininfor> getInfo(@PathVariable("id") Long id) {
|
||||
return ResponseEntity.ok(service.selectById(id));
|
||||
}
|
||||
|
||||
@ApiOperation("修改会员登录记录")
|
||||
@PreAuthorize("@ss.hasPermi('ums:memberLogininfor:edit')")
|
||||
@Log(title = "会员登录记录", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public ResponseEntity<Integer> edit(@RequestBody MemberLogininfor memberLogininfor) {
|
||||
return ResponseEntity.ok(service.update(memberLogininfor));
|
||||
}
|
||||
|
||||
@ApiOperation("删除会员登录记录")
|
||||
@PreAuthorize("@ss.hasPermi('ums:memberLogininfor:remove')")
|
||||
@Log(title = "会员登录记录", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{id}")
|
||||
public ResponseEntity<Integer> remove(@PathVariable Long id) {
|
||||
return ResponseEntity.ok(service.deleteById(id));
|
||||
}
|
||||
}
|
@ -1,86 +0,0 @@
|
||||
package com.wzj.soopin.member.controller;
|
||||
|
||||
import com.cyl.manager.ums.convert.MemberWechatConvert;
|
||||
import com.cyl.manager.ums.domain.entity.MemberWechat;
|
||||
import com.cyl.manager.ums.domain.query.MemberWechatQuery;
|
||||
import com.cyl.manager.ums.domain.vo.MemberWechatVO;
|
||||
import com.cyl.manager.ums.service.MemberWechatService;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.PageImpl;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
/**
|
||||
* 用户微信信息Controller
|
||||
*
|
||||
* @author zcc
|
||||
* @date 2022-11-28
|
||||
*/
|
||||
@Api(description ="用户微信信息接口列表")
|
||||
@RestController
|
||||
@RequestMapping("/ums/memberWechat")
|
||||
public class MemberWechatController extends BaseController {
|
||||
@Autowired
|
||||
private MemberWechatService service;
|
||||
@Autowired
|
||||
private MemberWechatConvert convert;
|
||||
|
||||
@ApiOperation("查询用户微信信息列表")
|
||||
@PreAuthorize("@ss.hasPermi('ums:memberWechat:list')")
|
||||
@PostMapping("/list")
|
||||
public ResponseEntity<Page<MemberWechat>> list(@RequestBody MemberWechatQuery query, Pageable page) {
|
||||
List<MemberWechat> list = service.selectList(query, page);
|
||||
return ResponseEntity.ok(new PageImpl<>(list, page, ((com.github.pagehelper.Page)list).getTotal()));
|
||||
}
|
||||
|
||||
@ApiOperation("导出用户微信信息列表")
|
||||
@PreAuthorize("@ss.hasPermi('ums:memberWechat:export')")
|
||||
@Log(title = "用户微信信息", businessType = BusinessType.EXPORT)
|
||||
@GetMapping("/export")
|
||||
public ResponseEntity<String> export(MemberWechatQuery query) {
|
||||
List<MemberWechat> list = service.selectList(query, null);
|
||||
ExcelUtil<MemberWechatVO> util = new ExcelUtil<>(MemberWechatVO.class);
|
||||
return ResponseEntity.ok(util.writeExcel(convert.dos2vos(list), "用户微信信息数据"));
|
||||
}
|
||||
|
||||
@ApiOperation("获取用户微信信息详细信息")
|
||||
@PreAuthorize("@ss.hasPermi('ums:memberWechat:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public ResponseEntity<MemberWechat> getInfo(@PathVariable("id") Long id) {
|
||||
return ResponseEntity.ok(service.selectById(id));
|
||||
}
|
||||
|
||||
@ApiOperation("新增用户微信信息")
|
||||
@PreAuthorize("@ss.hasPermi('ums:memberWechat:add')")
|
||||
@Log(title = "用户微信信息", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public ResponseEntity<Integer> add(@RequestBody MemberWechat memberWechat) {
|
||||
return ResponseEntity.ok(service.insert(memberWechat));
|
||||
}
|
||||
|
||||
@ApiOperation("修改用户微信信息")
|
||||
@PreAuthorize("@ss.hasPermi('ums:memberWechat:edit')")
|
||||
@Log(title = "用户微信信息", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public ResponseEntity<Integer> edit(@RequestBody MemberWechat memberWechat) {
|
||||
return ResponseEntity.ok(service.update(memberWechat));
|
||||
}
|
||||
|
||||
@ApiOperation("删除用户微信信息")
|
||||
@PreAuthorize("@ss.hasPermi('ums:memberWechat:remove')")
|
||||
@Log(title = "用户微信信息", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{id}")
|
||||
public ResponseEntity<Integer> remove(@PathVariable Long id) {
|
||||
return ResponseEntity.ok(service.deleteById(id));
|
||||
}
|
||||
}
|
@ -1,37 +0,0 @@
|
||||
package com.wzj.soopin.member.controller;
|
||||
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.redis.RedisService;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
public class PlatformVerifyController {
|
||||
|
||||
@Autowired
|
||||
private RedisService redisService;
|
||||
|
||||
/**
|
||||
* h5 生成验证码
|
||||
* @param code
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/h5/verified/code/generate")
|
||||
public AjaxResult createCode(String code){
|
||||
redisService.setVerifyCode(code);
|
||||
return AjaxResult.success(true);
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/no-auth/verified/code")
|
||||
public AjaxResult verifyCode(String code){
|
||||
String verifyCode = redisService.getVerifyCode(code);
|
||||
if (StringUtils.isEmpty(verifyCode)) {
|
||||
return AjaxResult.success(false);
|
||||
}
|
||||
redisService.deleteVerifyCode(code);
|
||||
return AjaxResult.success(true);
|
||||
}
|
||||
}
|
@ -1,7 +1,10 @@
|
||||
package com.wzj.soopin.member.convert;
|
||||
|
||||
import com.cyl.manager.ums.domain.entity.Feedback;
|
||||
import com.cyl.manager.ums.domain.vo.FeedbackVO;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.wzj.soopin.member.domain.bo.FeedbackBO;
|
||||
import com.wzj.soopin.member.domain.po.Feedback;
|
||||
import com.wzj.soopin.member.domain.vo.FeedbackVO;
|
||||
import org.dromara.common.web.core.BaseConverter;
|
||||
import org.mapstruct.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
@ -11,7 +14,6 @@ import java.util.List;
|
||||
* @author zcc
|
||||
*/
|
||||
@Mapper(componentModel = "spring")
|
||||
public interface FeedbackConvert {
|
||||
public interface FeedbackConvert extends BaseConverter<FeedbackVO, FeedbackBO, Feedback> {
|
||||
|
||||
List<FeedbackVO> dos2vos(List<Feedback> list);
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
package com.wzj.soopin.member.convert;
|
||||
|
||||
import com.cyl.manager.ums.domain.entity.MemberAccount;
|
||||
import com.cyl.manager.ums.domain.vo.MemberAccountVO;
|
||||
import com.wzj.soopin.member.domain.po.MemberAccount;
|
||||
import com.wzj.soopin.member.domain.vo.MemberAccountVO;
|
||||
import org.mapstruct.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -1,7 +1,9 @@
|
||||
package com.wzj.soopin.member.convert;
|
||||
|
||||
import com.cyl.manager.ums.domain.entity.MemberAddress;
|
||||
import com.cyl.manager.ums.domain.vo.MemberAddressVO;
|
||||
import com.wzj.soopin.member.domain.bo.MemberAddressBO;
|
||||
import com.wzj.soopin.member.domain.po.MemberAddress;
|
||||
import com.wzj.soopin.member.domain.vo.MemberAddressVO;
|
||||
import org.dromara.common.web.core.BaseConverter;
|
||||
import org.mapstruct.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
@ -11,7 +13,6 @@ import java.util.List;
|
||||
* @author zcc
|
||||
*/
|
||||
@Mapper(componentModel = "spring")
|
||||
public interface MemberAddressConvert {
|
||||
public interface MemberAddressConvert extends BaseConverter<MemberAddressVO, MemberAddressBO,MemberAddress> {
|
||||
|
||||
List<MemberAddressVO> dos2vos(List<MemberAddress> list);
|
||||
}
|
||||
|
@ -1,13 +1,10 @@
|
||||
package com.wzj.soopin.member.convert;
|
||||
|
||||
import com.cyl.manager.pms.domain.entity.Product;
|
||||
import com.cyl.manager.pms.domain.entity.Sku;
|
||||
import com.cyl.manager.ums.domain.entity.MemberCart;
|
||||
import com.cyl.manager.ums.domain.vo.MemberCartVO;
|
||||
import org.mapstruct.BeanMapping;
|
||||
import com.wzj.soopin.member.domain.bo.MemberCartBO;
|
||||
import com.wzj.soopin.member.domain.po.MemberCart;
|
||||
import com.wzj.soopin.member.domain.vo.MemberCartVO;
|
||||
import org.dromara.common.web.core.BaseConverter;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.Mapping;
|
||||
import org.mapstruct.MappingTarget;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@ -17,15 +14,15 @@ import java.util.List;
|
||||
* @author zcc
|
||||
*/
|
||||
@Mapper(componentModel = "spring")
|
||||
public interface MemberCartConvert {
|
||||
public interface MemberCartConvert extends BaseConverter<MemberCartVO, MemberCartBO,MemberCart> {
|
||||
|
||||
List<MemberCartVO> dos2vos(List<MemberCart> list);
|
||||
|
||||
@Mapping(target = "id", ignore = true)
|
||||
@Mapping(target = "skuId", source = "id")
|
||||
MemberCart sku2Cart(Sku sku);
|
||||
|
||||
@BeanMapping(ignoreByDefault = true)
|
||||
@Mapping(source = "name", target = "productName")
|
||||
void injectProduct(@MappingTarget MemberCart memberCart, Product p);
|
||||
// @Mapping(target = "id", ignore = true)
|
||||
// @Mapping(target = "skuId", source = "id")
|
||||
// MemberCart sku2Cart(Sku sku);
|
||||
//
|
||||
// @BeanMapping(ignoreByDefault = true)
|
||||
// @Mapping(source = "name", target = "productName")
|
||||
// void injectProduct(@MappingTarget MemberCart memberCart, Product p);
|
||||
}
|
||||
|
@ -1,7 +1,9 @@
|
||||
package com.wzj.soopin.member.convert;
|
||||
|
||||
import com.cyl.manager.ums.domain.entity.Member;
|
||||
import com.cyl.manager.ums.domain.vo.MemberVO;
|
||||
import com.wzj.soopin.member.domain.bo.MemberBO;
|
||||
import com.wzj.soopin.member.domain.po.Member;
|
||||
import com.wzj.soopin.member.domain.vo.MemberVO;
|
||||
import org.dromara.common.web.core.BaseConverter;
|
||||
import org.mapstruct.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
@ -11,7 +13,6 @@ import java.util.List;
|
||||
* @author zcc
|
||||
*/
|
||||
@Mapper(componentModel = "spring")
|
||||
public interface MemberConvert {
|
||||
public interface MemberConvert extends BaseConverter<MemberVO, MemberBO,Member> {
|
||||
|
||||
List<MemberVO> dos2vos(List<Member> list);
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
package com.wzj.soopin.member.convert;
|
||||
|
||||
import com.cyl.manager.ums.domain.entity.MemberLogininfor;
|
||||
import com.cyl.manager.ums.domain.vo.MemberLogininforVO;
|
||||
import com.wzj.soopin.member.domain.po.MemberLogininfor;
|
||||
import com.wzj.soopin.member.domain.vo.MemberLogininforVO;
|
||||
import org.mapstruct.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -1,8 +1,7 @@
|
||||
package com.wzj.soopin.member.convert;
|
||||
|
||||
import com.cyl.external.resp.AccessTokenResp;
|
||||
import com.cyl.manager.ums.domain.entity.MemberWechat;
|
||||
import com.cyl.manager.ums.domain.vo.MemberWechatVO;
|
||||
import com.wzj.soopin.member.domain.po.MemberWechat;
|
||||
import com.wzj.soopin.member.domain.vo.MemberWechatVO;
|
||||
import org.mapstruct.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
@ -16,5 +15,5 @@ public interface MemberWechatConvert {
|
||||
|
||||
List<MemberWechatVO> dos2vos(List<MemberWechat> list);
|
||||
|
||||
MemberWechat info2do(AccessTokenResp info);
|
||||
// MemberWechat info2do(AccessTokenResp info);
|
||||
}
|
||||
|
@ -1,8 +1,10 @@
|
||||
package com.wzj.soopin.member.domain.query;
|
||||
package com.wzj.soopin.member.domain.bo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.apache.poi.ss.formula.functions.T;
|
||||
import org.dromara.common.core.domain.BaseBO;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@ -13,7 +15,7 @@ import java.time.LocalDateTime;
|
||||
*/
|
||||
@ApiModel(description="意见反馈 查询 对象")
|
||||
@Data
|
||||
public class FeedbackQuery {
|
||||
public class FeedbackBO extends BaseBO {
|
||||
@ApiModelProperty("类型 精确匹配")
|
||||
private String type;
|
||||
|
||||
@ -36,4 +38,5 @@ public class FeedbackQuery {
|
||||
|
||||
private String endTime;
|
||||
|
||||
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
package com.wzj.soopin.member.domain.query;
|
||||
package com.wzj.soopin.member.domain.bo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
@ -1,8 +1,11 @@
|
||||
package com.wzj.soopin.member.domain.query;
|
||||
package com.wzj.soopin.member.domain.bo;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.fasterxml.jackson.databind.ser.Serializers;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.dromara.common.core.domain.BaseBO;
|
||||
|
||||
/**
|
||||
* 会员收货地址 查询 对象
|
||||
@ -11,7 +14,7 @@ import lombok.Data;
|
||||
*/
|
||||
@ApiModel(description="会员收货地址 查询 对象")
|
||||
@Data
|
||||
public class MemberAddressQuery {
|
||||
public class MemberAddressBO extends BaseBO {
|
||||
@ApiModelProperty("MEMBER_ID 精确匹配")
|
||||
private Long memberId;
|
||||
|
||||
@ -42,4 +45,8 @@ public class MemberAddressQuery {
|
||||
@ApiModelProperty("是否默认 精确匹配")
|
||||
private Integer isDefault;
|
||||
|
||||
@Override
|
||||
public QueryWrapper toWrapper() {
|
||||
return super.toWrapper();
|
||||
}
|
||||
}
|
@ -1,8 +1,12 @@
|
||||
package com.wzj.soopin.member.domain.query;
|
||||
package com.wzj.soopin.member.domain.bo;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.wzj.soopin.member.domain.po.Member;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.dromara.common.core.domain.BaseBO;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
@ -15,7 +19,7 @@ import java.time.LocalDateTime;
|
||||
*/
|
||||
@ApiModel(description="会员信息 查询 对象")
|
||||
@Data
|
||||
public class MemberQuery {
|
||||
public class MemberBO extends BaseBO {
|
||||
@ApiModelProperty("昵称 精确匹配")
|
||||
private String nickname;
|
||||
|
||||
@ -67,4 +71,34 @@ public class MemberQuery {
|
||||
private String beginTime;
|
||||
|
||||
private String endTime;
|
||||
|
||||
public QueryWrapper<Member> toWapper(){
|
||||
QueryWrapper<Member> qw = new QueryWrapper<>();
|
||||
qw.lambda().like(!getNickname().isEmpty(),Member::getNickname, this.getNickname());
|
||||
|
||||
String phone = this.getPhone();
|
||||
if (!StringUtils.isEmpty(phone)) {
|
||||
// qw.eq("phone_encrypted", AesCryptoUtils.encrypt(aesKey, phone));
|
||||
}
|
||||
if (!StringUtils.isEmpty(this.getBeginTime()) && !StringUtils.isEmpty(this.getEndTime())){
|
||||
qw.ge("create_time", this.getBeginTime());
|
||||
qw.lt("create_time", this.getEndTime());
|
||||
}
|
||||
if (this.getHasMark() != null) {
|
||||
switch (this.getHasMark()) {
|
||||
case 0:
|
||||
qw.isNull("mark").or().eq("mark","");
|
||||
break;
|
||||
case 1:
|
||||
qw.isNotNull("mark").ne("mark","");
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (this.getStatus() != null){
|
||||
qw.eq("status", this.getStatus());
|
||||
}
|
||||
return qw;
|
||||
}
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
package com.wzj.soopin.member.domain.query;
|
||||
package com.wzj.soopin.member.domain.bo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
@ -11,7 +11,7 @@ import lombok.Data;
|
||||
*/
|
||||
@ApiModel(description="购物车 查询 对象")
|
||||
@Data
|
||||
public class MemberCartQuery {
|
||||
public class MemberCartBO {
|
||||
@ApiModelProperty("0->失效;1->有效 精确匹配")
|
||||
private Integer status;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.wzj.soopin.member.domain.query;
|
||||
package com.wzj.soopin.member.domain.bo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
@ -1,4 +1,4 @@
|
||||
package com.wzj.soopin.member.domain.query;
|
||||
package com.wzj.soopin.member.domain.bo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
@ -1,19 +0,0 @@
|
||||
package com.wzj.soopin.member.domain.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 【请填写功能名称】 DTO 对象
|
||||
*
|
||||
* @author sjm
|
||||
*/
|
||||
@Data
|
||||
public class AddressDTO {
|
||||
private Long id;
|
||||
private Long pid;
|
||||
private String name;
|
||||
private String level;
|
||||
private List<AddressDTO> children;
|
||||
}
|
@ -2,14 +2,12 @@ package com.wzj.soopin.member.domain.form;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
@Data
|
||||
public class AddMemberCartForm {
|
||||
/**
|
||||
* 规格id
|
||||
*/
|
||||
@NotNull(message = "规格必填!")
|
||||
private Long skuId;
|
||||
/**
|
||||
* 数量
|
||||
|
@ -1,10 +1,10 @@
|
||||
package com.wzj.soopin.member.domain.form;
|
||||
|
||||
import jakarta.validation.constraints.Max;
|
||||
import jakarta.validation.constraints.Min;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.Max;
|
||||
import javax.validation.constraints.Min;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
@Data
|
||||
public class UpdateMemberCartForm {
|
||||
|
@ -3,10 +3,10 @@ package com.wzj.soopin.member.domain.po;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.dromara.common.excel.annotation.Excel;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
@ -1,11 +1,12 @@
|
||||
package com.wzj.soopin.member.domain.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseAudit;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.dromara.common.excel.annotation.Excel;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 会员收货地址对象 ums_member_address
|
||||
*
|
||||
@ -14,7 +15,7 @@ import lombok.Data;
|
||||
@ApiModel(description="会员收货地址对象")
|
||||
@Data
|
||||
@TableName("ums_member_address")
|
||||
public class MemberAddress extends BaseAudit {
|
||||
public class MemberAddress extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("ID")
|
||||
|
@ -1,11 +1,12 @@
|
||||
package com.wzj.soopin.member.domain.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseAudit;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.dromara.common.excel.annotation.Excel;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 购物车对象 ums_member_cart
|
||||
*
|
||||
@ -14,7 +15,7 @@ import lombok.Data;
|
||||
@ApiModel(description="购物车对象")
|
||||
@Data
|
||||
@TableName("ums_member_cart")
|
||||
public class MemberCart extends BaseAudit {
|
||||
public class MemberCart extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("购物车表ID")
|
||||
|
@ -1,10 +1,10 @@
|
||||
package com.wzj.soopin.member.domain.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.dromara.common.excel.annotation.Excel;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
/**
|
||||
|
@ -1,11 +1,11 @@
|
||||
package com.wzj.soopin.member.domain.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseAudit;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.dromara.common.excel.annotation.Excel;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
/**
|
||||
@ -16,7 +16,7 @@ import java.time.LocalDateTime;
|
||||
@ApiModel(description="用户微信信息对象")
|
||||
@Data
|
||||
@TableName("ums_member_wechat")
|
||||
public class MemberWechat extends BaseAudit {
|
||||
public class MemberWechat extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("ID")
|
||||
|
@ -1,8 +1,8 @@
|
||||
package com.wzj.soopin.member.domain.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import lombok.Data;
|
||||
import org.dromara.common.excel.annotation.Excel;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
/**
|
||||
|
@ -1,7 +1,7 @@
|
||||
package com.wzj.soopin.member.domain.vo;
|
||||
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import lombok.Data;
|
||||
import org.dromara.common.excel.annotation.Excel;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
@ -1,15 +1,16 @@
|
||||
package com.wzj.soopin.member.domain.vo;
|
||||
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseAudit;
|
||||
import lombok.Data;
|
||||
import org.dromara.common.excel.annotation.Excel;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 会员收货地址 数据视图对象
|
||||
*
|
||||
* @author zcc
|
||||
*/
|
||||
@Data
|
||||
public class MemberAddressVO extends BaseAudit {
|
||||
public class MemberAddressVO extends BaseEntity {
|
||||
/** ID */
|
||||
private Long id;
|
||||
/** MEMBER_ID */
|
||||
|
@ -1,8 +1,7 @@
|
||||
package com.wzj.soopin.member.domain.vo;
|
||||
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseAudit;
|
||||
import lombok.Data;
|
||||
import org.dromara.common.excel.annotation.Excel;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
@ -13,7 +12,7 @@ import java.time.LocalDateTime;
|
||||
* @author zcc
|
||||
*/
|
||||
@Data
|
||||
public class MemberCartVO extends BaseAudit {
|
||||
public class MemberCartVO {
|
||||
/** 购物车表ID */
|
||||
private Long id;
|
||||
/** 0->失效;1->有效 */
|
||||
|
@ -1,8 +1,8 @@
|
||||
package com.wzj.soopin.member.domain.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import lombok.Data;
|
||||
import org.dromara.common.excel.annotation.Excel;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
/**
|
||||
|
@ -1,9 +1,8 @@
|
||||
package com.wzj.soopin.member.domain.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseAudit;
|
||||
import lombok.Data;
|
||||
import org.dromara.common.excel.annotation.Excel;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
@ -14,7 +13,7 @@ import java.time.LocalDateTime;
|
||||
* @author zcc
|
||||
*/
|
||||
@Data
|
||||
public class MemberVO extends BaseAudit {
|
||||
public class MemberVO {
|
||||
/** ID */
|
||||
private Long id;
|
||||
/** 昵称 */
|
||||
|
@ -1,9 +1,8 @@
|
||||
package com.wzj.soopin.member.domain.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseAudit;
|
||||
import lombok.Data;
|
||||
import org.dromara.common.excel.annotation.Excel;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
/**
|
||||
@ -12,7 +11,7 @@ import java.time.LocalDateTime;
|
||||
* @author zcc
|
||||
*/
|
||||
@Data
|
||||
public class MemberWechatVO extends BaseAudit {
|
||||
public class MemberWechatVO {
|
||||
/** ID */
|
||||
private Long id;
|
||||
/** MEMBER_ID */
|
||||
|
@ -1,7 +1,7 @@
|
||||
package com.wzj.soopin.member.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.cyl.manager.ums.domain.entity.Address;
|
||||
import com.wzj.soopin.member.domain.po.Address;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
package com.wzj.soopin.member.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.cyl.manager.ums.domain.entity.Feedback;
|
||||
import com.wzj.soopin.member.domain.po.Feedback;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
package com.wzj.soopin.member.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.cyl.manager.ums.domain.entity.MemberAccount;
|
||||
import com.wzj.soopin.member.domain.po.MemberAccount;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
@ -1,7 +1,7 @@
|
||||
package com.wzj.soopin.member.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.cyl.manager.ums.domain.entity.MemberAddress;
|
||||
import com.wzj.soopin.member.domain.po.MemberAddress;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -1,9 +1,9 @@
|
||||
package com.wzj.soopin.member.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.cyl.manager.ums.domain.entity.MemberCart;
|
||||
import com.cyl.manager.ums.domain.query.MemberCartQuery;
|
||||
import com.cyl.manager.ums.domain.vo.MemberCartVO;
|
||||
import com.wzj.soopin.member.domain.po.MemberCart;
|
||||
import com.wzj.soopin.member.domain.bo.MemberCartBO;
|
||||
import com.wzj.soopin.member.domain.vo.MemberCartVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
@ -26,7 +26,7 @@ public interface MemberCartMapper extends BaseMapper<MemberCart> {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
List<MemberCartVO> selectByPage(MemberCartQuery query);
|
||||
List<MemberCartVO> selectByPage(MemberCartBO query);
|
||||
|
||||
int statAddCount(@Param("startTime") LocalDateTime startTime, @Param("endTime") LocalDateTime endTime);
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
package com.wzj.soopin.member.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.cyl.manager.ums.domain.entity.MemberLogininfor;
|
||||
import com.wzj.soopin.member.domain.po.MemberLogininfor;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
@ -0,0 +1,7 @@
|
||||
package com.wzj.soopin.member.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.wzj.soopin.member.domain.po.Feedback;
|
||||
|
||||
public interface IFeedbackService extends IService<Feedback> {
|
||||
}
|
@ -0,0 +1,7 @@
|
||||
package com.wzj.soopin.member.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.wzj.soopin.member.domain.po.MemberAccount;
|
||||
|
||||
public interface IMemberAccountService extends IService<MemberAccount> {
|
||||
}
|
@ -0,0 +1,7 @@
|
||||
package com.wzj.soopin.member.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.wzj.soopin.member.domain.po.MemberAddress;
|
||||
|
||||
public interface IMemberAddressService extends IService<MemberAddress> {
|
||||
}
|
@ -0,0 +1,7 @@
|
||||
package com.wzj.soopin.member.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.wzj.soopin.member.domain.po.MemberCart;
|
||||
|
||||
public interface IMemberCartService extends IService<MemberCart> {
|
||||
}
|
@ -0,0 +1,4 @@
|
||||
package com.wzj.soopin.member.service;
|
||||
|
||||
public interface IMemberLoginRecordService {
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
package com.wzj.soopin.member.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.wzj.soopin.member.domain.form.ChangeMemberStatusForm;
|
||||
import com.wzj.soopin.member.domain.po.Member;
|
||||
|
||||
public interface IMemberService extends IService<Member> {
|
||||
Integer changeStatus(ChangeMemberStatusForm dto);
|
||||
|
||||
int updateMark(Member member);
|
||||
}
|
@ -0,0 +1,7 @@
|
||||
package com.wzj.soopin.member.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.wzj.soopin.member.domain.po.MemberWechat;
|
||||
|
||||
public interface IMemberWechatServicce extends IService<MemberWechat> {
|
||||
}
|
@ -1,249 +0,0 @@
|
||||
package com.wzj.soopin.member.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.wzj.soopin.member.mapper.MemberMapper;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.PageImpl;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 用户领券记录Service业务层处理
|
||||
*
|
||||
* @author zcc
|
||||
*/
|
||||
@Service
|
||||
public class MemberCouponService {
|
||||
@Autowired
|
||||
private MemberCouponMapper memberCouponMapper;
|
||||
@Autowired
|
||||
private MemberMapper memberMapper;
|
||||
|
||||
/**
|
||||
* 查询用户领券记录
|
||||
*
|
||||
* @param id 用户领券记录主键
|
||||
* @return 用户领券记录
|
||||
*/
|
||||
public MemberCoupon selectById(Long id) {
|
||||
return memberCouponMapper.selectById(id);
|
||||
}
|
||||
|
||||
public MemberCoupon selectValidCoupon(Long id) {
|
||||
MemberCoupon coupon = memberCouponMapper.selectById(id);
|
||||
if (coupon == null) {
|
||||
return null;
|
||||
}
|
||||
if (Objects.equals(coupon.getUseStatus(), 1)) {
|
||||
throw new RuntimeException("优惠券已使用");
|
||||
}
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
if (coupon.getBeginTime().isAfter(now)) {
|
||||
throw new RuntimeException("优惠券未到开始使用日期");
|
||||
}
|
||||
if (coupon.getEndTime().isBefore(now)) {
|
||||
throw new RuntimeException("优惠券已过期");
|
||||
}
|
||||
return coupon;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询用户领券记录列表
|
||||
*
|
||||
* @param query 查询条件
|
||||
* @param page 分页条件
|
||||
* @return 用户领券记录
|
||||
*/
|
||||
public Page<MemberCouponVO> selectList(MemberCouponQuery query, Pageable page) {
|
||||
|
||||
PageHelper.startPage(page.getPageNumber() + 1, page.getPageSize());
|
||||
QueryWrapper<MemberCoupon> qw = new QueryWrapper<>();
|
||||
Long couponActivityId = query.getCouponActivityId();
|
||||
if (couponActivityId != null) {
|
||||
qw.eq("coupon_activity_id", couponActivityId);
|
||||
}
|
||||
Long memberId = query.getMemberId();
|
||||
if (memberId != null) {
|
||||
qw.eq("member_id", memberId);
|
||||
}
|
||||
Integer useStatus = query.getUseStatus();
|
||||
if (useStatus != null) {
|
||||
qw.eq("use_status", useStatus);
|
||||
}
|
||||
List<MemberCoupon> list = memberCouponMapper.selectList(qw);
|
||||
|
||||
long total = ((com.github.pagehelper.Page) list).getTotal();
|
||||
if (total < 1) {
|
||||
return new PageImpl<>(Collections.emptyList(), page, total);
|
||||
}
|
||||
List<MemberCouponVO> resList = new ArrayList<>();
|
||||
Set<Long> memberIds = list.stream().map(it -> it.getMemberId()).collect(Collectors.toSet());
|
||||
Map<Long, Member> memberMap = memberMapper.selectList(new QueryWrapper<Member>().in("id", memberIds))
|
||||
.stream().collect(Collectors.toMap(it -> it.getId(), it -> it));
|
||||
for (MemberCoupon it : list) {
|
||||
MemberCouponVO vo = new MemberCouponVO();
|
||||
BeanUtils.copyProperties(it, vo);
|
||||
Member member = memberMap.get(it.getMemberId());
|
||||
if (member != null) {
|
||||
vo.setNickname(member.getNickname());
|
||||
vo.setPhone(member.getPhoneHidden());
|
||||
vo.setAvatar(member.getAvatar());
|
||||
}
|
||||
resList.add(vo);
|
||||
}
|
||||
|
||||
return new PageImpl<>(resList, page, total);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增用户领券记录
|
||||
*
|
||||
* @param memberCoupon 用户领券记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int insert(MemberCoupon memberCoupon) {
|
||||
memberCoupon.setCreateTime(LocalDateTime.now());
|
||||
return memberCouponMapper.insert(memberCoupon);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户领券记录
|
||||
*
|
||||
* @param memberCoupon 用户领券记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int update(MemberCoupon memberCoupon) {
|
||||
return memberCouponMapper.updateById(memberCoupon);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除用户领券记录信息
|
||||
*
|
||||
* @param id 用户领券记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteById(Long id) {
|
||||
return memberCouponMapper.deleteById(id);
|
||||
}
|
||||
|
||||
public Page<MemberCoupon> selectListByH5(MemberCouponQuery query, Pageable page) {
|
||||
PageHelper.startPage(page.getPageNumber() + 1, page.getPageSize());
|
||||
QueryWrapper<MemberCoupon> qw = new QueryWrapper<>();
|
||||
qw.eq("member_id", SecurityUtil.getLocalMember().getId());
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
if (query.getType() != null) {
|
||||
switch (query.getType()) {
|
||||
case 1:
|
||||
//已领取
|
||||
qw.eq("use_status", 0)
|
||||
.ge("end_time", now)
|
||||
.le("begin_time", now);
|
||||
break;
|
||||
case 2:
|
||||
//已使用
|
||||
qw.eq("use_status", 1);
|
||||
break;
|
||||
case 3:
|
||||
//已过期
|
||||
qw.eq("use_status", 0);
|
||||
qw.and(it -> it.le("end_time", now).or().ge("begin_time", now));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
List<MemberCoupon> list = memberCouponMapper.selectList(qw);
|
||||
return new PageImpl<>(list, page, ((com.github.pagehelper.Page) list).getTotal());
|
||||
}
|
||||
|
||||
public List<MemberCoupon> getCanUseList(Collection<Product> products) {
|
||||
//先获取我的未过期的优惠券
|
||||
QueryWrapper<MemberCoupon> queryWrapper = new QueryWrapper<>();
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
queryWrapper.eq("member_id", SecurityUtil.getLocalMember().getId())
|
||||
.eq("use_status", 0)
|
||||
.ge("end_time", now)
|
||||
.le("begin_time", now);
|
||||
List<MemberCoupon> list = memberCouponMapper.selectList(queryWrapper);
|
||||
if (CollectionUtils.isEmpty(list)) {
|
||||
return list;
|
||||
}
|
||||
List<MemberCoupon> matchList = new ArrayList<>();
|
||||
list.forEach(item -> {
|
||||
if (judgeCouponCanUse(item, products)) {
|
||||
matchList.add(item);
|
||||
}
|
||||
});
|
||||
return matchList;
|
||||
}
|
||||
|
||||
public Boolean judgeCouponCanUse(MemberCoupon item, Collection<Product> products) {
|
||||
//判断是否满足菜品
|
||||
if (!Objects.equals(1, item.getUseScope())) {
|
||||
List<Long> couponProducts = Arrays.stream(item.getProductIds().split(",")).map(it -> Long.parseLong(it)).collect(Collectors.toList());
|
||||
if (Objects.equals(2, item.getUseScope()) && products.stream().noneMatch(it -> couponProducts.contains(it.getId()))) {
|
||||
//指定商品
|
||||
return false;
|
||||
}
|
||||
if (Objects.equals(3, item.getUseScope()) && products.stream().anyMatch(it -> couponProducts.contains(it.getId()))) {
|
||||
//指定商品不包括
|
||||
return false;
|
||||
}
|
||||
}
|
||||
//计算金额是否满足
|
||||
if (item.getMinAmount() == null || item.getMinAmount().equals(BigDecimal.ZERO)) {
|
||||
//无门槛
|
||||
return true;
|
||||
}
|
||||
if (item.getMinAmount().compareTo(calcMinAmount(products, item)) <= 0) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private BigDecimal calcMinAmount(Collection<Product> products, MemberCoupon coupon) {
|
||||
List<Long> ids;
|
||||
if (!Objects.equals(1, coupon.getUseScope())) {
|
||||
ids = Arrays.stream(coupon.getProductIds().split(",")).map(it -> Long.parseLong(it)).collect(Collectors.toList());
|
||||
} else {
|
||||
ids = new ArrayList<>();
|
||||
}
|
||||
switch (coupon.getUseScope()) {
|
||||
case 1:
|
||||
return products.stream().map(Product::getPrice).reduce(BigDecimal::add).get();
|
||||
case 2:
|
||||
return products.stream().filter(it -> ids.contains(it.getId())).map(Product::getPrice).reduce(BigDecimal::add).get();
|
||||
case 3:
|
||||
return products.stream().filter(it -> !ids.contains(it.getId())).map(Product::getPrice).reduce(BigDecimal::add).get();
|
||||
default:
|
||||
return BigDecimal.ZERO;
|
||||
}
|
||||
}
|
||||
|
||||
public void updateCouponStatus(Long memberCouponId, Long orderId) {
|
||||
UpdateWrapper<MemberCoupon> updateWrapper = new UpdateWrapper<>();
|
||||
updateWrapper.eq("id", memberCouponId)
|
||||
.set("use_status", 1)
|
||||
.set("use_time", LocalDateTime.now())
|
||||
.set("order_id", orderId);
|
||||
memberCouponMapper.update(null, updateWrapper);
|
||||
}
|
||||
|
||||
public void backCoupon(List<Long> couponIdList) {
|
||||
UpdateWrapper<MemberCoupon> updateWrapper = new UpdateWrapper<>();
|
||||
updateWrapper.in("id", couponIdList)
|
||||
.set("use_status", 0)
|
||||
.set("use_time", null)
|
||||
.set("order_id", null);
|
||||
memberCouponMapper.update(null, updateWrapper);
|
||||
}
|
||||
}
|
@ -1,160 +0,0 @@
|
||||
package com.wzj.soopin.member.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.cyl.manager.oms.mapper.AftersaleMapper;
|
||||
import com.cyl.manager.oms.mapper.OrderMapper;
|
||||
import com.cyl.manager.ums.domain.entity.Member;
|
||||
import com.cyl.manager.ums.domain.entity.MemberCart;
|
||||
import com.cyl.manager.ums.domain.form.ChangeMemberStatusForm;
|
||||
import com.cyl.manager.ums.domain.query.MemberQuery;
|
||||
import com.cyl.manager.ums.domain.vo.MemberDataStatisticsVO;
|
||||
import com.cyl.manager.ums.mapper.MemberCartMapper;
|
||||
import com.cyl.manager.ums.mapper.MemberMapper;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.ruoyi.common.utils.AesCryptoUtils;
|
||||
import com.ruoyi.common.utils.SortUtil;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 会员信息Service业务层处理
|
||||
*
|
||||
*
|
||||
* @author zcc
|
||||
*/
|
||||
@Service
|
||||
public class MemberService {
|
||||
@Autowired
|
||||
private MemberMapper memberMapper;
|
||||
@Value("${aes.key}")
|
||||
private String aesKey;
|
||||
|
||||
@Autowired
|
||||
private MemberCartMapper memberCartMapper;
|
||||
|
||||
@Autowired
|
||||
private OrderMapper orderMapper;
|
||||
|
||||
@Autowired
|
||||
private AftersaleMapper aftersaleMapper;
|
||||
|
||||
/**
|
||||
* 查询会员信息
|
||||
*
|
||||
* @param id 会员信息主键
|
||||
* @return 会员信息
|
||||
*/
|
||||
public Member selectById(Long id) {
|
||||
return memberMapper.selectById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询会员信息列表
|
||||
*
|
||||
* @param query 查询条件
|
||||
* @param page 分页条件
|
||||
* @return 会员信息
|
||||
*/
|
||||
public List<Member> selectList(MemberQuery query, Pageable page) {
|
||||
if (page != null) {
|
||||
PageHelper.startPage(page.getPageNumber() + 1, page.getPageSize(), SortUtil.sort2string(page.getSort(),"id desc"));
|
||||
}
|
||||
QueryWrapper<Member> qw = new QueryWrapper<>();
|
||||
String nicknameLike = query.getNickname();
|
||||
if (!StringUtils.isEmpty(nicknameLike)) {
|
||||
qw.like("nickname", nicknameLike);
|
||||
}
|
||||
String phone = query.getPhone();
|
||||
if (!StringUtils.isEmpty(phone)) {
|
||||
qw.eq("phone_encrypted", AesCryptoUtils.encrypt(aesKey, phone));
|
||||
}
|
||||
if (!StringUtils.isEmpty(query.getBeginTime()) && !StringUtils.isEmpty(query.getEndTime())){
|
||||
qw.ge("create_time", query.getBeginTime());
|
||||
qw.lt("create_time", query.getEndTime());
|
||||
}
|
||||
if (query.getHasMark() != null) {
|
||||
switch (query.getHasMark()) {
|
||||
case 0:
|
||||
qw.isNull("mark").or().eq("mark","");
|
||||
break;
|
||||
case 1:
|
||||
qw.isNotNull("mark").ne("mark","");
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (query.getStatus() != null){
|
||||
qw.eq("status", query.getStatus());
|
||||
}
|
||||
return memberMapper.selectList(qw);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增会员信息
|
||||
*
|
||||
* @param member 会员信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insert(Member member) {
|
||||
member.setCreateTime(LocalDateTime.now());
|
||||
return memberMapper.insert(member);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改会员信息
|
||||
*
|
||||
* @param member 会员信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int update(Member member) {
|
||||
return memberMapper.updateById(member);
|
||||
}
|
||||
|
||||
public int updateMark(Member member) {
|
||||
UpdateWrapper<Member> updateWrapper = new UpdateWrapper<>();
|
||||
updateWrapper.set("mark",member.getMark())
|
||||
.set("update_time",LocalDateTime.now())
|
||||
.eq("id",member.getId());
|
||||
return memberMapper.update(null,updateWrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除会员信息信息
|
||||
*
|
||||
* @param id 会员信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteById(Long id) {
|
||||
return memberMapper.deleteById(id);
|
||||
}
|
||||
|
||||
public Integer changeStatus(ChangeMemberStatusForm dto) {
|
||||
UpdateWrapper<Member> wrapper = new UpdateWrapper<>();
|
||||
wrapper.eq("id", dto.getMemberId());
|
||||
wrapper.set("status", dto.getStatus());
|
||||
return memberMapper.update(null, wrapper);
|
||||
}
|
||||
|
||||
public String getPhoneDecrypted(String phoneEncrypted) {
|
||||
return AesCryptoUtils.decrypt(aesKey, phoneEncrypted);
|
||||
}
|
||||
|
||||
public MemberDataStatisticsVO viewStatistics(Long memberId) {
|
||||
LambdaQueryWrapper<MemberCart> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(MemberCart::getMemberId, memberId);
|
||||
int cartCount = memberCartMapper.selectCount(wrapper);
|
||||
MemberDataStatisticsVO vo = orderMapper.statOrderCountAndAmount(memberId);
|
||||
vo.setCartCount(cartCount);
|
||||
vo.setAftersaleCount(aftersaleMapper.countByMemberId(memberId));
|
||||
return vo;
|
||||
}
|
||||
}
|
@ -1,248 +0,0 @@
|
||||
package com.wzj.soopin.member.service;
|
||||
|
||||
import cn.hutool.core.util.RandomUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.cyl.external.WechatUtil;
|
||||
import com.cyl.external.resp.AccessTokenResp;
|
||||
import com.cyl.external.resp.UserInfoResp;
|
||||
import com.cyl.h5.domain.form.WechatLoginForm;
|
||||
import com.cyl.h5.service.H5MemberService;
|
||||
import com.cyl.manager.ums.convert.MemberWechatConvert;
|
||||
import com.cyl.manager.ums.domain.entity.Member;
|
||||
import com.cyl.manager.ums.domain.entity.MemberWechat;
|
||||
import com.cyl.manager.ums.domain.query.MemberWechatQuery;
|
||||
import com.cyl.manager.ums.mapper.MemberWechatMapper;
|
||||
import com.cyl.wechat.WechatPayData;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||
import com.ruoyi.common.core.domain.model.ExtraUserBody;
|
||||
import com.ruoyi.framework.web.service.SysLoginService;
|
||||
import com.ruoyi.system.mapper.SysUserMapper;
|
||||
import com.ruoyi.system.service.ISysUserService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 用户微信信息Service业务层处理
|
||||
*
|
||||
*
|
||||
* @author zcc
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class MemberWechatService {
|
||||
@Autowired
|
||||
private MemberWechatMapper memberWechatMapper;
|
||||
@Autowired
|
||||
private MemberWechatConvert memberWechatConvert;
|
||||
@Autowired
|
||||
private SysUserMapper sysUserMapper;
|
||||
@Autowired
|
||||
private ISysUserService userService;
|
||||
@Autowired
|
||||
private SysLoginService loginService;
|
||||
@Autowired
|
||||
private RestTemplate restTemplate;
|
||||
@Autowired
|
||||
private H5MemberService memberService;
|
||||
private static String LOGIN_URL = "https://api.weixin.qq.com/sns/jscode2session?appid=#{APPID}&secret=#{SECRET}&js_code=#{JSCODE}&grant_type=authorization_code";
|
||||
|
||||
|
||||
/**
|
||||
* 查询用户微信信息
|
||||
*
|
||||
* @param id 用户微信信息主键
|
||||
* @return 用户微信信息
|
||||
*/
|
||||
public MemberWechat selectById(Long id) {
|
||||
return memberWechatMapper.selectById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询用户微信信息列表
|
||||
*
|
||||
* @param query 查询条件
|
||||
* @param page 分页条件
|
||||
* @return 用户微信信息
|
||||
*/
|
||||
public List<MemberWechat> selectList(MemberWechatQuery query, Pageable page) {
|
||||
if (page != null) {
|
||||
PageHelper.startPage(page.getPageNumber() + 1, page.getPageSize());
|
||||
}
|
||||
QueryWrapper<MemberWechat> qw = new QueryWrapper<>();
|
||||
Long memberId = query.getMemberId();
|
||||
if (memberId != null) {
|
||||
qw.eq("member_id", memberId);
|
||||
}
|
||||
String unionid = query.getUnionid();
|
||||
if (!StringUtils.isEmpty(unionid)) {
|
||||
qw.eq("unionid", unionid);
|
||||
}
|
||||
String openid = query.getOpenid();
|
||||
if (!StringUtils.isEmpty(openid)) {
|
||||
qw.eq("openid", openid);
|
||||
}
|
||||
String routineOpenid = query.getRoutineOpenid();
|
||||
if (!StringUtils.isEmpty(routineOpenid)) {
|
||||
qw.eq("routine_openid", routineOpenid);
|
||||
}
|
||||
Integer groupid = query.getGroupid();
|
||||
if (groupid != null) {
|
||||
qw.eq("groupid", groupid);
|
||||
}
|
||||
String tagidList = query.getTagidList();
|
||||
if (!StringUtils.isEmpty(tagidList)) {
|
||||
qw.eq("tagid_list", tagidList);
|
||||
}
|
||||
Integer subscribe = query.getSubscribe();
|
||||
if (subscribe != null) {
|
||||
qw.eq("subscribe", subscribe);
|
||||
}
|
||||
Integer subscribeTime = query.getSubscribeTime();
|
||||
if (subscribeTime != null) {
|
||||
qw.eq("subscribe_time", subscribeTime);
|
||||
}
|
||||
String sessionKey = query.getSessionKey();
|
||||
if (!StringUtils.isEmpty(sessionKey)) {
|
||||
qw.eq("session_key", sessionKey);
|
||||
}
|
||||
String accessToken = query.getAccessToken();
|
||||
if (!StringUtils.isEmpty(accessToken)) {
|
||||
qw.eq("access_token", accessToken);
|
||||
}
|
||||
Integer expiresIn = query.getExpiresIn();
|
||||
if (expiresIn != null) {
|
||||
qw.eq("expires_in", expiresIn);
|
||||
}
|
||||
String refreshToken = query.getRefreshToken();
|
||||
if (!StringUtils.isEmpty(refreshToken)) {
|
||||
qw.eq("refresh_token", refreshToken);
|
||||
}
|
||||
LocalDateTime expireTime = query.getExpireTime();
|
||||
if (expireTime != null) {
|
||||
qw.eq("expire_time", expireTime);
|
||||
}
|
||||
return memberWechatMapper.selectList(qw);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增用户微信信息
|
||||
*
|
||||
* @param memberWechat 用户微信信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insert(MemberWechat memberWechat) {
|
||||
memberWechat.setCreateTime(LocalDateTime.now());
|
||||
return memberWechatMapper.insert(memberWechat);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户微信信息
|
||||
*
|
||||
* @param memberWechat 用户微信信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int update(MemberWechat memberWechat) {
|
||||
return memberWechatMapper.updateById(memberWechat);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除用户微信信息信息
|
||||
*
|
||||
* @param id 用户微信信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteById(Long id) {
|
||||
return memberWechatMapper.deleteById(id);
|
||||
}
|
||||
|
||||
public String login(WechatLoginForm form) {
|
||||
// 1. code -> token
|
||||
AccessTokenResp tokenResp = WechatUtil.getAccessToken(form.getCode());
|
||||
// 2. token -> user_info
|
||||
UserInfoResp info = null;
|
||||
try {
|
||||
info = WechatUtil.getUserInfo(tokenResp.getAccessToken(), tokenResp.getOpenid());
|
||||
} catch (Exception e) {
|
||||
log.error("form: {}", form.getCode(), e);
|
||||
}
|
||||
// 3. 查找用户是否存在, 若没有则创建
|
||||
LambdaQueryWrapper<MemberWechat> qw = new LambdaQueryWrapper<>();
|
||||
qw.eq(MemberWechat::getOpenid, tokenResp.getOpenid());
|
||||
MemberWechat m = memberWechatMapper.selectOne(qw);
|
||||
SysUser u;
|
||||
if (m != null) {
|
||||
SysUser update = new SysUser();
|
||||
if (info != null) {
|
||||
if (StrUtil.isNotEmpty(info.getNickname())) {
|
||||
update.setNickName(info.getNickname());
|
||||
}
|
||||
if (info.getSex() != null) {
|
||||
update.setSex(info.getSex() + "");
|
||||
}
|
||||
if (StrUtil.isNotEmpty(info.getHeadimgurl())) {
|
||||
update.setAvatar(info.getHeadimgurl());
|
||||
}
|
||||
update.setUserId(m.getMemberId());
|
||||
sysUserMapper.updateUser(update);
|
||||
}
|
||||
u = sysUserMapper.selectUserById(m.getMemberId());
|
||||
} else {
|
||||
ExtraUserBody body = ExtraUserBody.builder()
|
||||
.nickname(info == null ? "" : info.getNickname())
|
||||
.avatar(info == null ? "" : info.getHeadimgurl())
|
||||
.login(RandomUtil.randomNumbers(9))
|
||||
.sex(info == null ? null : info.getSex())
|
||||
.build();
|
||||
u = loginService.initVipUser(body);
|
||||
MemberWechat w = memberWechatConvert.info2do(tokenResp);
|
||||
w.setMemberId(u.getUserId());
|
||||
w.setExpireTime(LocalDateTime.now().plus(tokenResp.getExpiresIn(), ChronoUnit.SECONDS));
|
||||
memberWechatMapper.insert(w);
|
||||
}
|
||||
// 4. 生成token
|
||||
return loginService.createToken(u);
|
||||
}
|
||||
|
||||
public JSONObject getSessionId(String code) {
|
||||
String url = LOGIN_URL.replace("#{APPID}", WechatPayData.miniProgramAppId)
|
||||
.replace("#{SECRET}", WechatPayData.miniProgramSecret)
|
||||
.replace("#{JSCODE}", code);
|
||||
log.info("获取openid,url:{}", url);
|
||||
try {
|
||||
ResponseEntity<String> res = restTemplate.getForEntity(url, String.class);
|
||||
String body = res.getBody();
|
||||
if (com.ruoyi.common.utils.StringUtils.isEmpty(body)) {
|
||||
throw new Exception("获取openid出错");
|
||||
}
|
||||
return JSONObject.parseObject(body);
|
||||
} catch (Exception e) {
|
||||
log.error("获取openid报错", e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public String getToken(String openId) {
|
||||
//判断openid是否存在
|
||||
QueryWrapper<MemberWechat> qw = new QueryWrapper<>();
|
||||
qw.eq("routine_openid", openId);
|
||||
MemberWechat memberWechat = memberWechatMapper.selectOne(qw);
|
||||
if (memberWechat == null) {
|
||||
return null;
|
||||
}
|
||||
Member member = memberService.selectById(memberWechat.getMemberId());
|
||||
return memberService.getLoginResponse(member.getId()).getToken();
|
||||
}
|
||||
}
|
@ -1,19 +1,17 @@
|
||||
package com.wzj.soopin.member.service;
|
||||
package com.wzj.soopin.member.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.cyl.h5.config.SecurityUtil;
|
||||
import com.cyl.manager.ums.domain.entity.Feedback;
|
||||
import com.cyl.manager.ums.domain.query.FeedbackQuery;
|
||||
import com.cyl.manager.ums.mapper.FeedbackMapper;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.wzj.soopin.member.domain.po.Feedback;
|
||||
import com.wzj.soopin.member.domain.bo.FeedbackBO;
|
||||
import com.wzj.soopin.member.mapper.FeedbackMapper;
|
||||
import com.wzj.soopin.member.service.IFeedbackService;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 意见反馈Service业务层处理
|
||||
@ -22,19 +20,9 @@ import java.util.List;
|
||||
* @author zcc
|
||||
*/
|
||||
@Service
|
||||
public class FeedbackService {
|
||||
@Autowired
|
||||
private FeedbackMapper feedbackMapper;
|
||||
public class FeedbackServiceImpl extends ServiceImpl<FeedbackMapper, Feedback> implements IFeedbackService {
|
||||
|
||||
|
||||
/**
|
||||
* 查询意见反馈
|
||||
*
|
||||
* @param id 意见反馈主键
|
||||
* @return 意见反馈
|
||||
*/
|
||||
public Feedback selectById(Long id) {
|
||||
return feedbackMapper.selectById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询意见反馈列表
|
||||
@ -43,10 +31,8 @@ public class FeedbackService {
|
||||
* @param page 分页条件
|
||||
* @return 意见反馈
|
||||
*/
|
||||
public List<Feedback> selectList(FeedbackQuery query, Pageable page) {
|
||||
if (page != null) {
|
||||
PageHelper.startPage(page.getPageNumber() + 1, page.getPageSize());
|
||||
}
|
||||
public IPage<Feedback> selectList(FeedbackBO query, IPage page) {
|
||||
|
||||
QueryWrapper<Feedback> qw = new QueryWrapper<>();
|
||||
String type = query.getType();
|
||||
if (!StringUtils.isEmpty(type)) {
|
||||
@ -77,47 +63,16 @@ public class FeedbackService {
|
||||
qw.lt("create_time", query.getEndTime());
|
||||
}
|
||||
qw.orderByDesc("id");
|
||||
return feedbackMapper.selectList(qw);
|
||||
return baseMapper.selectPage(page,qw);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增意见反馈
|
||||
*
|
||||
* @param feedback 意见反馈
|
||||
* @return 结果
|
||||
*/
|
||||
public int insert(Feedback feedback) {
|
||||
feedback.setCreateTime(LocalDateTime.now());
|
||||
feedback.setCreateBy(SecurityUtil.getLocalMember().getId());
|
||||
feedback.setHandleStatus(0);
|
||||
return feedbackMapper.insert(feedback);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改意见反馈
|
||||
*
|
||||
* @param feedback 意见反馈
|
||||
* @return 结果
|
||||
*/
|
||||
public int update(Feedback feedback) {
|
||||
return feedbackMapper.updateById(feedback);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除意见反馈信息
|
||||
*
|
||||
* @param id 意见反馈主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteById(Long id) {
|
||||
return feedbackMapper.deleteById(id);
|
||||
}
|
||||
|
||||
public Integer updateMark(Feedback feedback) {
|
||||
UpdateWrapper<Feedback> updateWrapper = new UpdateWrapper<>();
|
||||
updateWrapper.set("remark",feedback.getRemark())
|
||||
.eq("id",feedback.getId());
|
||||
return feedbackMapper.update(null,updateWrapper);
|
||||
return baseMapper.update(null,updateWrapper);
|
||||
}
|
||||
|
||||
public Integer changeStatus(Feedback dto) {
|
||||
@ -125,6 +80,6 @@ public class FeedbackService {
|
||||
wrapper.eq("id", dto.getId());
|
||||
wrapper.set("handle_status", dto.getHandleStatus())
|
||||
.set("handle_time",LocalDateTime.now());
|
||||
return feedbackMapper.update(null, wrapper);
|
||||
return baseMapper.update(null, wrapper);
|
||||
}
|
||||
}
|
@ -1,17 +1,15 @@
|
||||
package com.wzj.soopin.member.service;
|
||||
package com.wzj.soopin.member.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.cyl.manager.ums.domain.entity.MemberAccount;
|
||||
import com.cyl.manager.ums.domain.query.MemberAccountQuery;
|
||||
import com.cyl.manager.ums.mapper.MemberAccountMapper;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.wzj.soopin.member.domain.po.MemberAccount;
|
||||
import com.wzj.soopin.member.domain.bo.MemberAccountQuery;
|
||||
import com.wzj.soopin.member.mapper.MemberAccountMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 会员账户表Service业务层处理
|
||||
@ -20,7 +18,7 @@ import java.util.List;
|
||||
* @author zcc
|
||||
*/
|
||||
@Service
|
||||
public class MemberAccountService {
|
||||
public class MemberAccountServiceImpl {
|
||||
@Autowired
|
||||
private MemberAccountMapper memberAccountMapper;
|
||||
|
||||
@ -41,10 +39,8 @@ public class MemberAccountService {
|
||||
* @param page 分页条件
|
||||
* @return 会员账户表
|
||||
*/
|
||||
public List<MemberAccount> selectList(MemberAccountQuery query, Pageable page) {
|
||||
if (page != null) {
|
||||
PageHelper.startPage(page.getPageNumber() + 1, page.getPageSize());
|
||||
}
|
||||
public IPage<MemberAccount> selectList(MemberAccountQuery query, IPage page) {
|
||||
|
||||
QueryWrapper<MemberAccount> qw = new QueryWrapper<>();
|
||||
BigDecimal integralBalance = query.getIntegralBalance();
|
||||
if (integralBalance != null) {
|
||||
@ -54,7 +50,7 @@ public class MemberAccountService {
|
||||
if (totalIntegralBalance != null) {
|
||||
qw.eq("total_integral_balance", totalIntegralBalance);
|
||||
}
|
||||
return memberAccountMapper.selectList(qw);
|
||||
return memberAccountMapper.selectPage(page,qw);
|
||||
}
|
||||
|
||||
/**
|
@ -1,18 +1,16 @@
|
||||
package com.wzj.soopin.member.service;
|
||||
package com.wzj.soopin.member.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.cyl.manager.ums.convert.MemberAddressConvert;
|
||||
import com.cyl.manager.ums.domain.entity.MemberAddress;
|
||||
import com.cyl.manager.ums.domain.query.MemberAddressQuery;
|
||||
import com.cyl.manager.ums.mapper.MemberAddressMapper;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.ruoyi.common.utils.AesCryptoUtils;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.wzj.soopin.member.convert.MemberAddressConvert;
|
||||
import com.wzj.soopin.member.domain.po.MemberAddress;
|
||||
import com.wzj.soopin.member.domain.bo.MemberAddressBO;
|
||||
import com.wzj.soopin.member.mapper.MemberAddressMapper;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.dromara.common.core.utils.SecurityUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
@ -24,7 +22,7 @@ import java.util.List;
|
||||
* @author zcc
|
||||
*/
|
||||
@Service
|
||||
public class MemberAddressService {
|
||||
public class MemberAddressServiceImpl {
|
||||
@Autowired
|
||||
private MemberAddressMapper memberAddressMapper;
|
||||
@Autowired
|
||||
@ -49,19 +47,17 @@ public class MemberAddressService {
|
||||
* @param page 分页条件
|
||||
* @return 会员收货地址
|
||||
*/
|
||||
public List<MemberAddress> selectList(MemberAddressQuery query, Pageable page) {
|
||||
if (page != null) {
|
||||
PageHelper.startPage(page.getPageNumber() + 1, page.getPageSize());
|
||||
}
|
||||
public IPage<MemberAddress> selectList(MemberAddressBO query, IPage page) {
|
||||
|
||||
QueryWrapper<MemberAddress> qw = new QueryWrapper<>();
|
||||
String nameLike = query.getNameLike();
|
||||
if (!StringUtils.isEmpty(nameLike)) {
|
||||
qw.like("name", nameLike);
|
||||
}
|
||||
String phone = query.getPhone();
|
||||
if (!StringUtils.isEmpty(phone)) {
|
||||
qw.eq("phone_encrypted", AesCryptoUtils.encrypt(aesKey, phone));
|
||||
}
|
||||
// if (!StringUtils.isEmpty(phone)) {
|
||||
// qw.eq("phone_encrypted", AesCryptoUtils.encrypt(aesKey, phone));
|
||||
// }
|
||||
String postCode = query.getPostCode();
|
||||
if (!StringUtils.isEmpty(postCode)) {
|
||||
qw.eq("post_code", postCode);
|
||||
@ -82,7 +78,7 @@ public class MemberAddressService {
|
||||
if (!StringUtils.isEmpty(detailAddress)) {
|
||||
qw.like("detail_address", detailAddress);
|
||||
}
|
||||
return memberAddressMapper.selectList(qw);
|
||||
return memberAddressMapper.selectPage(page,qw);
|
||||
}
|
||||
|
||||
/**
|
@ -1,40 +1,24 @@
|
||||
package com.wzj.soopin.member.service;
|
||||
package com.wzj.soopin.member.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.cyl.h5.config.SecurityUtil;
|
||||
import com.cyl.manager.pms.domain.entity.Sku;
|
||||
import com.cyl.manager.pms.mapper.ProductMapper;
|
||||
import com.cyl.manager.pms.mapper.SkuMapper;
|
||||
import com.cyl.manager.ums.convert.MemberCartConvert;
|
||||
import com.cyl.manager.ums.domain.entity.Member;
|
||||
import com.cyl.manager.ums.domain.entity.MemberCart;
|
||||
import com.cyl.manager.ums.domain.form.UpdateMemberCartForm;
|
||||
import com.cyl.manager.ums.domain.query.MemberCartQuery;
|
||||
import com.cyl.manager.ums.domain.vo.MemberCartVO;
|
||||
import com.cyl.manager.ums.mapper.MemberCartMapper;
|
||||
import com.cyl.manager.ums.mapper.MemberMapper;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.ruoyi.common.constant.Constants;
|
||||
import com.ruoyi.common.exception.base.BaseException;
|
||||
import com.ruoyi.common.utils.AesCryptoUtils;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
import com.ruoyi.common.utils.SortUtil;
|
||||
import com.ruoyi.framework.config.LocalDataUtil;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.wzj.soopin.member.convert.MemberCartConvert;
|
||||
import com.wzj.soopin.member.domain.form.UpdateMemberCartForm;
|
||||
import com.wzj.soopin.member.domain.po.MemberCart;
|
||||
import com.wzj.soopin.member.domain.bo.MemberCartBO;
|
||||
import com.wzj.soopin.member.domain.vo.MemberCartVO;
|
||||
import com.wzj.soopin.member.mapper.MemberCartMapper;
|
||||
import com.wzj.soopin.member.mapper.MemberMapper;
|
||||
import org.dromara.common.core.exception.base.BaseException;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.data.domain.PageImpl;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@ -43,15 +27,15 @@ import java.util.stream.Collectors;
|
||||
* @author zcc
|
||||
*/
|
||||
@Service
|
||||
public class MemberCartService {
|
||||
public class MemberCartServiceImpl {
|
||||
@Autowired
|
||||
private MemberCartMapper memberCartMapper;
|
||||
@Autowired
|
||||
private SkuMapper skuMapper;
|
||||
// @Autowired
|
||||
// private SkuMapper skuMapper;
|
||||
@Autowired
|
||||
private MemberMapper memberMapper;
|
||||
@Autowired
|
||||
private ProductMapper productMapper;
|
||||
// @Autowired
|
||||
// private ProductMapper productMapper;
|
||||
@Autowired
|
||||
private MemberCartConvert memberCartConvert;
|
||||
@Value("${aes.key}")
|
||||
@ -74,34 +58,34 @@ public class MemberCartService {
|
||||
* @param page 分页条件
|
||||
* @return 购物车
|
||||
*/
|
||||
public PageImpl<MemberCartVO> selectList(MemberCartQuery query, Pageable page) {
|
||||
if (page != null) {
|
||||
PageHelper.startPage(page.getPageNumber() + 1, page.getPageSize(), SortUtil.sort2string(page.getSort(),"id desc"));
|
||||
}
|
||||
if (!StrUtil.isEmpty(query.getPhone())){
|
||||
query.setPhone(AesCryptoUtils.encrypt(aesKey, query.getPhone()));
|
||||
}
|
||||
public IPage<MemberCartVO> selectList(MemberCartBO query, IPage page) {
|
||||
|
||||
// if (!StrUtil.isEmpty(query.getPhone())){
|
||||
// query.setPhone(AesCryptoUtils.encrypt(aesKey, query.getPhone()));
|
||||
// }
|
||||
List<MemberCartVO> memberCartList = memberCartMapper.selectByPage(query);
|
||||
long total = ((com.github.pagehelper.Page)memberCartList).getTotal();
|
||||
if (CollectionUtil.isEmpty(memberCartList)){
|
||||
return new PageImpl<>(Collections.EMPTY_LIST, page, total);
|
||||
}
|
||||
// long total = ((com.github.pagehelper.Page)memberCartList).getTotal();
|
||||
// if (CollectionUtil.isEmpty(memberCartList)){
|
||||
// return new PageImpl<>(Collections.EMPTY_LIST, page, total);
|
||||
// }
|
||||
//查sku
|
||||
List<Long> skuIdList = memberCartList.stream().map(MemberCartVO::getSkuId).collect(Collectors.toList());
|
||||
QueryWrapper<Sku> skuQw = new QueryWrapper<>();
|
||||
skuQw.in("id", skuIdList);
|
||||
Map<Long, Sku> skuMap = skuMapper.selectList(skuQw).stream().collect(Collectors.toMap(Sku::getId, it -> it));
|
||||
memberCartList.forEach(item -> {
|
||||
if (!skuMap.containsKey(item.getSkuId())){
|
||||
item.setStatus(0);
|
||||
item.setSkuIfExist(0);
|
||||
}else {
|
||||
Sku sku = skuMap.get(item.getSkuId());
|
||||
item.setPrice(sku.getPrice());
|
||||
item.setSkuIfExist(1);
|
||||
}
|
||||
});
|
||||
return new PageImpl<>(memberCartList, page, total);
|
||||
// List<Long> skuIdList = memberCartList.stream().map(MemberCartVO::getSkuId).collect(Collectors.toList());
|
||||
// QueryWrapper<Sku> skuQw = new QueryWrapper<>();
|
||||
// skuQw.in("id", skuIdList);
|
||||
// Map<Long, Sku> skuMap = skuMapper.selectList(skuQw).stream().collect(Collectors.toMap(Sku::getId, it -> it));
|
||||
// memberCartList.forEach(item -> {
|
||||
// if (!skuMap.containsKey(item.getSkuId())){
|
||||
// item.setStatus(0);
|
||||
// item.setSkuIfExist(0);
|
||||
// }else {
|
||||
// Sku sku = skuMap.get(item.getSkuId());
|
||||
// item.setPrice(sku.getPrice());
|
||||
// item.setSkuIfExist(1);
|
||||
// }
|
||||
// });
|
||||
// return new PageImpl<>(memberCartList, page, total);
|
||||
return null;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@ -111,18 +95,18 @@ public class MemberCartService {
|
||||
* @return 结果
|
||||
*/
|
||||
public int insert(MemberCart memberCart) {
|
||||
Member member = (Member) LocalDataUtil.getVar(Constants.MEMBER_INFO);
|
||||
memberCart.setMemberId(member.getId());
|
||||
// Member member = (Member) LocalDataUtil.getVar(Constants.MEMBER_INFO);
|
||||
// memberCart.setMemberId(member.getId());
|
||||
//判断cart是否存在
|
||||
QueryWrapper<MemberCart> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("member_id",member.getId());
|
||||
// queryWrapper.eq("member_id",member.getId());
|
||||
queryWrapper.eq("sku_id",memberCart.getSkuId());
|
||||
queryWrapper.eq("product_id",memberCart.getProductId());
|
||||
List<MemberCart> memberCarts = memberCartMapper.selectList(queryWrapper);
|
||||
if (CollectionUtils.isEmpty(memberCarts)) {
|
||||
memberCart.setStatus(1);
|
||||
memberCart.setCreateTime(LocalDateTime.now());
|
||||
memberCart.setCreateBy(member.getId());
|
||||
// memberCart.setCreateBy(member.getId());
|
||||
return memberCartMapper.insert(memberCart);
|
||||
}
|
||||
MemberCart dbCart = memberCarts.get(0);
|
||||
@ -144,20 +128,20 @@ public class MemberCartService {
|
||||
}
|
||||
cart.setQuantity(memberCart.getQuantity());
|
||||
cart.setUpdateTime(LocalDateTime.now());
|
||||
cart.setUpdateBy(SecurityUtil.getLocalMember().getId());
|
||||
// cart.setUpdateBy(SecurityUtil.getLocalMember().getId());
|
||||
return memberCartMapper.updateById(cart);
|
||||
}
|
||||
public int update(UpdateMemberCartForm form) {
|
||||
if (form.getNum() == null || form.getId() == null) {
|
||||
throw new BaseException("参数错误");
|
||||
}
|
||||
Long userId = SecurityUtils.getUserId();
|
||||
// Long userId = SecurityUtils.getUserId();
|
||||
LambdaQueryWrapper<MemberCart> qw = new LambdaQueryWrapper<>();
|
||||
qw.eq(MemberCart::getMemberId, userId);
|
||||
// qw.eq(MemberCart::getMemberId, userId);
|
||||
qw.eq(MemberCart::getId, form.getId());
|
||||
if (form.getNum() <= 0) {
|
||||
return memberCartMapper.delete(qw);
|
||||
}
|
||||
// if (form.getNum() <= 0) {
|
||||
// return memberCartMapper.delete(qw);
|
||||
// }
|
||||
MemberCart e = new MemberCart();
|
||||
e.setQuantity(form.getNum());
|
||||
return memberCartMapper.update(e, qw);
|
||||
@ -185,9 +169,9 @@ public class MemberCartService {
|
||||
}
|
||||
|
||||
public Integer mineCartNum() {
|
||||
Long userId = SecurityUtils.getUserId();
|
||||
// Long userId = SecurityUtils.getUserId();
|
||||
QueryWrapper<MemberCart> qw = new QueryWrapper<>();
|
||||
qw.eq("member_id", userId);
|
||||
// qw.eq("member_id", userId);
|
||||
qw.eq("status", 1);
|
||||
qw.select("count(quantity) quantity");
|
||||
MemberCart c = memberCartMapper.selectOne(qw);
|
@ -1,14 +1,14 @@
|
||||
package com.wzj.soopin.member.service;
|
||||
package com.wzj.soopin.member.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.cyl.manager.ums.domain.entity.Member;
|
||||
import com.cyl.manager.ums.domain.entity.MemberLogininfor;
|
||||
import com.cyl.manager.ums.domain.query.MemberLogininforQuery;
|
||||
import com.cyl.manager.ums.mapper.MemberLogininforMapper;
|
||||
import com.cyl.manager.ums.mapper.MemberMapper;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.ruoyi.common.utils.AesCryptoUtils;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.wzj.soopin.member.domain.po.Member;
|
||||
import com.wzj.soopin.member.domain.po.MemberLogininfor;
|
||||
import com.wzj.soopin.member.domain.bo.MemberLogininforQuery;
|
||||
import com.wzj.soopin.member.mapper.MemberLogininforMapper;
|
||||
import com.wzj.soopin.member.mapper.MemberMapper;
|
||||
import com.wzj.soopin.member.service.IMemberLoginRecordService;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
@ -24,9 +24,7 @@ import java.util.List;
|
||||
* @author zcc
|
||||
*/
|
||||
@Service
|
||||
public class MemberLogininforService {
|
||||
@Autowired
|
||||
private MemberLogininforMapper memberLogininforMapper;
|
||||
public class MemberLoginRecordServiceImpl extends ServiceImpl<MemberLogininforMapper, MemberLogininfor> implements IMemberLoginRecordService {
|
||||
|
||||
@Autowired
|
||||
private MemberMapper memberMapper;
|
||||
@ -34,15 +32,7 @@ public class MemberLogininforService {
|
||||
@Value("${aes.key}")
|
||||
private String aesKey;
|
||||
|
||||
/**
|
||||
* 查询会员登录记录
|
||||
*
|
||||
* @param id 会员登录记录主键
|
||||
* @return 会员登录记录
|
||||
*/
|
||||
public MemberLogininfor selectById(Long id) {
|
||||
return memberLogininforMapper.selectById(id);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询会员登录记录列表
|
||||
@ -56,7 +46,7 @@ public class MemberLogininforService {
|
||||
String phone = query.getPhone();
|
||||
if (!StringUtils.isEmpty(phone)) {
|
||||
LambdaQueryWrapper<Member> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(Member::getPhoneEncrypted, AesCryptoUtils.encrypt(aesKey, phone));
|
||||
// wrapper.eq(Member::getPhoneEncrypted, AesCryptoUtils.encrypt(aesKey, phone));
|
||||
Member member = memberMapper.selectOne(wrapper);
|
||||
if (member != null){
|
||||
qw.eq("phone", member.getPhoneEncrypted());
|
||||
@ -64,9 +54,9 @@ public class MemberLogininforService {
|
||||
qw.eq("phone", "-1");
|
||||
}
|
||||
}
|
||||
if (page != null) {
|
||||
PageHelper.startPage(page.getPageNumber() + 1, page.getPageSize());
|
||||
}
|
||||
// if (page != null) {
|
||||
// PageHelper.startPage(page.getPageNumber() + 1, page.getPageSize());
|
||||
// }
|
||||
String ipaddr = query.getIpaddr();
|
||||
if (!StringUtils.isEmpty(ipaddr)) {
|
||||
qw.eq("ipaddr", ipaddr);
|
||||
@ -88,26 +78,8 @@ public class MemberLogininforService {
|
||||
qw.lt("login_time", query.getEndTime());
|
||||
}
|
||||
qw.orderByDesc("login_time");
|
||||
return memberLogininforMapper.selectList(qw);
|
||||
return baseMapper.selectList(qw);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改会员登录记录
|
||||
*
|
||||
* @param memberLogininfor 会员登录记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int update(MemberLogininfor memberLogininfor) {
|
||||
return memberLogininforMapper.updateById(memberLogininfor);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除会员登录记录信息
|
||||
*
|
||||
* @param id 会员登录记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteById(Long id) {
|
||||
return memberLogininforMapper.deleteById(id);
|
||||
}
|
||||
}
|
@ -0,0 +1,72 @@
|
||||
package com.wzj.soopin.member.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.wzj.soopin.member.domain.form.ChangeMemberStatusForm;
|
||||
import com.wzj.soopin.member.domain.po.Member;
|
||||
import com.wzj.soopin.member.domain.bo.MemberBO;
|
||||
import com.wzj.soopin.member.mapper.MemberCartMapper;
|
||||
import com.wzj.soopin.member.mapper.MemberMapper;
|
||||
import com.wzj.soopin.member.service.IMemberService;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 会员信息Service业务层处理
|
||||
*
|
||||
*
|
||||
* @author zcc
|
||||
*/
|
||||
@Service
|
||||
public class MemberServiceImpl extends ServiceImpl<MemberMapper,Member> implements IMemberService {
|
||||
@Autowired
|
||||
private MemberMapper memberMapper;
|
||||
@Value("${aes.key}")
|
||||
private String aesKey;
|
||||
|
||||
@Autowired
|
||||
private MemberCartMapper memberCartMapper;
|
||||
|
||||
// @Autowired
|
||||
// private OrderMapper orderMapper;
|
||||
//
|
||||
// @Autowired
|
||||
// private AftersaleMapper aftersaleMapper;
|
||||
|
||||
|
||||
|
||||
|
||||
public int updateMark(Member member) {
|
||||
UpdateWrapper<Member> updateWrapper = new UpdateWrapper<>();
|
||||
updateWrapper.set("mark",member.getMark())
|
||||
.set("update_time",LocalDateTime.now())
|
||||
.eq("id",member.getId());
|
||||
return memberMapper.update(null,updateWrapper);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public Integer changeStatus(ChangeMemberStatusForm dto) {
|
||||
UpdateWrapper<Member> wrapper = new UpdateWrapper<>();
|
||||
wrapper.eq("id", dto.getMemberId());
|
||||
wrapper.set("status", dto.getStatus());
|
||||
return memberMapper.update(null, wrapper);
|
||||
}
|
||||
|
||||
|
||||
// public MemberDataStatisticsVO viewStatistics(Long memberId) {
|
||||
// LambdaQueryWrapper<MemberCart> wrapper = new LambdaQueryWrapper<>();
|
||||
// wrapper.eq(MemberCart::getMemberId, memberId);
|
||||
// long cartCount = memberCartMapper.selectCount(wrapper);
|
||||
// MemberDataStatisticsVO vo = orderMapper.statOrderCountAndAmount(memberId);
|
||||
// vo.setCartCount(Long.bitCount(cartCount));
|
||||
// vo.setAftersaleCount(aftersaleMapper.countByMemberId(memberId));
|
||||
// return vo;
|
||||
// }
|
||||
}
|
@ -98,7 +98,7 @@ public class AftersaleController extends BaseController {
|
||||
String redisValue = user.getUserId() + "_" + System.currentTimeMillis();
|
||||
try {
|
||||
redisService.lock(redisKey, redisValue, 60);
|
||||
service.dealWith(request, user.getUserId(), user.getUser().getNickName());
|
||||
service.dealWith(request, user.getUserId(), user.getNickname());
|
||||
return ResponseEntity.ok(true);
|
||||
} catch (Exception e) {
|
||||
log.error("售后订单操作发生异常", e);
|
||||
|
@ -16,7 +16,6 @@ import com.wzj.soopin.member.domain.po.Member;
|
||||
import com.wzj.soopin.member.domain.po.MemberWechat;
|
||||
import com.wzj.soopin.member.mapper.MemberMapper;
|
||||
import com.wzj.soopin.member.mapper.MemberWechatMapper;
|
||||
import com.wzj.soopin.member.service.MemberCouponService;
|
||||
import com.wzj.soopin.order.convert.OrderOperateHistoryConvert;
|
||||
import com.wzj.soopin.order.domain.entity.*;
|
||||
import com.wzj.soopin.order.domain.form.DealWithAftersaleForm;
|
||||
@ -65,8 +64,8 @@ public class AftersaleService {
|
||||
private OrderOperateHistoryConvert historyConvert;
|
||||
@Autowired
|
||||
private SkuMapper skuMapper;
|
||||
@Autowired
|
||||
private MemberCouponService memberCouponService;
|
||||
// @Autowired
|
||||
// private MemberCouponService memberCouponService;
|
||||
@Autowired
|
||||
private WechatPaymentHistoryMapper wechatPaymentHistoryMapper;
|
||||
@Autowired
|
||||
@ -441,9 +440,9 @@ public class AftersaleService {
|
||||
OrderItem orderItem = orderItemMapper.selectOne(new QueryWrapper<OrderItem>().eq("order_id", order.getId()));
|
||||
skuMapper.updateStockById(orderItem.getSkuId(), LocalDateTime.now(), -1 * orderItem.getQuantity());
|
||||
//退还优惠券
|
||||
if (order.getMemberCouponId() != null) {
|
||||
memberCouponService.backCoupon(Arrays.asList(order.getMemberCouponId()));
|
||||
}
|
||||
// if (order.getMemberCouponId() != null) {
|
||||
// memberCouponService.backCoupon(Arrays.asList(order.getMemberCouponId()));
|
||||
// }
|
||||
} else {
|
||||
//更改订单表
|
||||
UpdateWrapper<Order> orderUpdateWrapper = new UpdateWrapper<>();
|
||||
|
@ -28,6 +28,7 @@ import org.dromara.system.domain.vo.SysPostVo;
|
||||
import org.dromara.system.domain.vo.SysRoleVo;
|
||||
import org.dromara.system.domain.vo.SysUserExportVo;
|
||||
import org.dromara.system.domain.vo.SysUserVo;
|
||||
import org.dromara.system.mapper.*;
|
||||
import org.dromara.system.service.ISysUserService;
|
||||
import org.springframework.cache.annotation.CacheEvict;
|
||||
import org.springframework.cache.annotation.Cacheable;
|
||||
|
@ -1,6 +1,7 @@
|
||||
package org.dromara.workflow.domain.vo;
|
||||
|
||||
import lombok.Data;
|
||||
import org.dromara.common.core.utils.DateUtils;
|
||||
import org.dromara.common.translation.annotation.Translation;
|
||||
import org.dromara.common.translation.constant.TransConstant;
|
||||
import org.dromara.warm.flow.core.enums.CooperateType;
|
||||
|
@ -14,6 +14,7 @@ import org.dromara.common.core.exception.ServiceException;
|
||||
import org.dromara.common.core.service.DeptService;
|
||||
import org.dromara.common.core.service.TaskAssigneeService;
|
||||
import org.dromara.common.core.service.UserService;
|
||||
import org.dromara.common.core.utils.DateUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.warm.flow.ui.dto.HandlerFunDto;
|
||||
import org.dromara.warm.flow.ui.dto.HandlerQuery;
|
||||
|
Loading…
x
Reference in New Issue
Block a user