diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/auth/LoginFilter.java b/src/main/java/com/chaozhanggui/system/cashierservice/auth/LoginFilter.java index 5c49993..cb6cfc2 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/auth/LoginFilter.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/auth/LoginFilter.java @@ -45,7 +45,6 @@ public class LoginFilter implements Filter { "cashierService/home",//首页 "cashierService/order/testMessage",//首页 "cashierService/common/**",//通用接口 - "cashierService/tbShopShare/**",//通用接口 "cashierService/distirict/**",//首页其它接口 // "cashierService/login/**",//登录部分接口不校验 diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbShopShareRecordMapper.java b/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbShopShareRecordMapper.java index a48eace..5ee94c6 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbShopShareRecordMapper.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbShopShareRecordMapper.java @@ -1,10 +1,12 @@ package com.chaozhanggui.system.cashierservice.dao; import com.chaozhanggui.system.cashierservice.entity.TbShopShareRecord; +import org.apache.ibatis.annotations.MapKey; import org.apache.ibatis.annotations.Param; import org.springframework.data.domain.Pageable; import java.util.List; +import java.util.Map; /** * (TbShopShareRecord)表数据库访问层 @@ -37,6 +39,10 @@ public interface TbShopShareRecordMapper { * @return 对象列表 */ List query(TbShopShareRecord tbShopShareRecord); + Map statisticsRecord(TbShopShareRecord tbShopShareRecord); + + List queryIsSuccess(TbShopShareRecord tbShopShareRecord); + List queryIsNoSuccess(TbShopShareRecord tbShopShareRecord); /** diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbShopShareRecord.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbShopShareRecord.java index 36b0a63..11238c4 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbShopShareRecord.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbShopShareRecord.java @@ -1,5 +1,8 @@ package com.chaozhanggui.system.cashierservice.entity; +import com.chaozhanggui.system.cashierservice.entity.dto.BasePageDto; +import lombok.Data; + import java.util.Date; import java.io.Serializable; @@ -9,7 +12,8 @@ import java.io.Serializable; * @author ww * @since 2024-11-07 15:50:04 */ -public class TbShopShareRecord implements Serializable { +@Data +public class TbShopShareRecord extends BasePageDto implements Serializable { private static final long serialVersionUID = -41620929736900271L; private Integer id; @@ -45,6 +49,7 @@ public class TbShopShareRecord implements Serializable { * 1 未领取 2 已领取 3 已使用 */ private Integer status; + private boolean isSuccess = true; /** * 生效时间/获得奖励的时间 */ @@ -53,104 +58,5 @@ public class TbShopShareRecord implements Serializable { private Date createTime; private Date updateTime; - - - public Integer getId() { - return id; - } - - public void setId(Integer id) { - this.id = id; - } - - public Integer getShareId() { - return shareId; - } - - public void setShareId(Integer shareId) { - this.shareId = shareId; - } - - public Integer getShopId() { - return shopId; - } - - public void setShopId(Integer shopId) { - this.shopId = shopId; - } - - public Integer getInvitedId() { - return invitedId; - } - - public void setInvitedId(Integer invitedId) { - this.invitedId = invitedId; - } - - public String getInvitedName() { - return invitedName; - } - - public void setInvitedName(String invitedName) { - this.invitedName = invitedName; - } - - public Integer getBeInvitedId() { - return beInvitedId; - } - - public void setBeInvitedId(Integer beInvitedId) { - this.beInvitedId = beInvitedId; - } - - - public String getBeInvitedName() { - return beInvitedName; - } - - public void setBeInvitedName(String beInvitedName) { - this.beInvitedName = beInvitedName; - } - - public String getMethod() { - return method; - } - - public void setMethod(String method) { - this.method = method; - } - - public Integer getStatus() { - return status; - } - - public void setStatus(Integer status) { - this.status = status; - } - - public Date getRewardTime() { - return rewardTime; - } - - public void setRewardTime(Date rewardTime) { - this.rewardTime = rewardTime; - } - - public Date getCreateTime() { - return createTime; - } - - public void setCreateTime(Date createTime) { - this.createTime = createTime; - } - - public Date getUpdateTime() { - return updateTime; - } - - public void setUpdateTime(Date updateTime) { - this.updateTime = updateTime; - } - } diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/dto/UserCouponDto.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/dto/UserCouponDto.java deleted file mode 100644 index b53d03f..0000000 --- a/src/main/java/com/chaozhanggui/system/cashierservice/entity/dto/UserCouponDto.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.chaozhanggui.system.cashierservice.entity.dto; - -import lombok.Data; - -@Data -public class UserCouponDto extends BasePageDto{ - private Integer userId; - private Integer status; - private Integer shopId; - -} diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/service/TbShopShareRecordService.java b/src/main/java/com/chaozhanggui/system/cashierservice/service/TbShopShareRecordService.java index c71057c..82e681e 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/service/TbShopShareRecordService.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/service/TbShopShareRecordService.java @@ -6,6 +6,7 @@ import org.springframework.data.domain.Page; import org.springframework.data.domain.PageRequest; import java.util.List; +import java.util.Map; /** * (TbShopShareRecord)表服务接口 @@ -29,7 +30,7 @@ public interface TbShopShareRecordService { * @param tbShopShareRecord 筛选条件 * @return 查询结果 */ - List query(TbShopShareRecord tbShopShareRecord); + Map query(TbShopShareRecord tbShopShareRecord); Result receive(TbShopShareRecord tbShopShareRecord); diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/service/impl/TbShopShareRecordServiceImpl.java b/src/main/java/com/chaozhanggui/system/cashierservice/service/impl/TbShopShareRecordServiceImpl.java index 35ff26a..50e5801 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/service/impl/TbShopShareRecordServiceImpl.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/service/impl/TbShopShareRecordServiceImpl.java @@ -7,7 +7,10 @@ import cn.hutool.core.util.RandomUtil; import com.chaozhanggui.system.cashierservice.dao.*; import com.chaozhanggui.system.cashierservice.entity.*; import com.chaozhanggui.system.cashierservice.service.TbShopShareRecordService; +import com.chaozhanggui.system.cashierservice.sign.CodeEnum; import com.chaozhanggui.system.cashierservice.sign.Result; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Primary; import org.springframework.stereotype.Service; @@ -17,9 +20,7 @@ import org.springframework.data.domain.PageRequest; import javax.annotation.Resource; import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; +import java.util.*; /** * (TbShopShareRecord)表服务实现类 @@ -63,12 +64,21 @@ public class TbShopShareRecordServiceImpl implements TbShopShareRecordService { * @return 查询结果 */ @Override - public List query(TbShopShareRecord tbShopShareRecord) { - List records = tbShopShareRecordMapper.query(tbShopShareRecord); + public Map query(TbShopShareRecord tbShopShareRecord) { + Map result = tbShopShareRecordMapper.statisticsRecord(tbShopShareRecord); + PageHelper.startPage(tbShopShareRecord.getPage(), tbShopShareRecord.getSize()); + + List records; + if(tbShopShareRecord.isSuccess()){ + records = tbShopShareRecordMapper.queryIsSuccess(tbShopShareRecord); + }else { + records = tbShopShareRecordMapper.queryIsNoSuccess(tbShopShareRecord); + } for (TbShopShareRecord shareRecord : records) { shareRecord.setBeInvitedName(userInfoMapper.selectNameByPrimaryKey(shareRecord.getBeInvitedId())); } - return records; + result.put("records",new PageInfo<>(records)); + return result; } @Override diff --git a/src/main/resources/mapper/TbShopShareRecordMapper.xml b/src/main/resources/mapper/TbShopShareRecordMapper.xml index 12d0744..2e7fdb8 100644 --- a/src/main/resources/mapper/TbShopShareRecordMapper.xml +++ b/src/main/resources/mapper/TbShopShareRecordMapper.xml @@ -92,6 +92,45 @@ + + + + + +