1.update
Showing
241 changed files
with
4047 additions
and
670 deletions
| ... | @@ -33,8 +33,8 @@ | ... | @@ -33,8 +33,8 @@ |
| 33 | <!--代码生成器--> | 33 | <!--代码生成器--> |
| 34 | <dependency> | 34 | <dependency> |
| 35 | <groupId>com.topdraw</groupId> | 35 | <groupId>com.topdraw</groupId> |
| 36 | <artifactId>code-generator</artifactId> | 36 | <artifactId>cronos-system</artifactId> |
| 37 | <version>3.1.0</version> | 37 | <version>1.1.0</version> |
| 38 | </dependency> | 38 | </dependency> |
| 39 | 39 | ||
| 40 | <!-- Spring boot 热部署 : 此热部署会遇到 java.lang.ClassCastException 异常 --> | 40 | <!-- Spring boot 热部署 : 此热部署会遇到 java.lang.ClassCastException 异常 --> | ... | ... |
| 1 | package com.topdraw.business.module.common.domain; | ||
| 2 | |||
| 3 | import lombok.Data; | ||
| 4 | import lombok.experimental.Accessors; | ||
| 5 | |||
| 6 | import javax.persistence.Transient; | ||
| 7 | |||
| 8 | /** | ||
| 9 | * @author : | ||
| 10 | * @description: | ||
| 11 | * @function : | ||
| 12 | * @date :Created in 2022/2/10 10:12 | ||
| 13 | * @version: : | ||
| 14 | * @modified By: | ||
| 15 | * @since : modified in 2022/2/10 10:12 | ||
| 16 | */ | ||
| 17 | @Data | ||
| 18 | @Accessors(chain = true) | ||
| 19 | public class DefaultAsyncMqModule { | ||
| 20 | |||
| 21 | @Transient | ||
| 22 | private String memberCode; | ||
| 23 | |||
| 24 | } |
| 1 | package com.topdraw.business.basicdata.coupon.history.domain; | 1 | package com.topdraw.business.module.coupon.history.domain; |
| 2 | 2 | ||
| 3 | import cn.hutool.core.bean.BeanUtil; | 3 | import cn.hutool.core.bean.BeanUtil; |
| 4 | import cn.hutool.core.bean.copier.CopyOptions; | 4 | import cn.hutool.core.bean.copier.CopyOptions; |
| ... | @@ -11,6 +11,7 @@ import org.springframework.data.jpa.domain.support.AuditingEntityListener; | ... | @@ -11,6 +11,7 @@ import org.springframework.data.jpa.domain.support.AuditingEntityListener; |
| 11 | import javax.persistence.*; | 11 | import javax.persistence.*; |
| 12 | import java.io.Serializable; | 12 | import java.io.Serializable; |
| 13 | import java.sql.Timestamp; | 13 | import java.sql.Timestamp; |
| 14 | import java.time.LocalDateTime; | ||
| 14 | 15 | ||
| 15 | /** | 16 | /** |
| 16 | * @author XiangHan | 17 | * @author XiangHan |
| ... | @@ -47,11 +48,11 @@ public class CouponHistory implements Serializable { | ... | @@ -47,11 +48,11 @@ public class CouponHistory implements Serializable { |
| 47 | 48 | ||
| 48 | // 领取时间 | 49 | // 领取时间 |
| 49 | @Column(name = "receive_time") | 50 | @Column(name = "receive_time") |
| 50 | private Timestamp receiveTime; | 51 | private LocalDateTime receiveTime; |
| 51 | 52 | ||
| 52 | // 失效时间 | 53 | // 失效时间 |
| 53 | @Column(name = "expire_time") | 54 | @Column(name = "expire_time") |
| 54 | private Timestamp expireTime; | 55 | private LocalDateTime expireTime; |
| 55 | 56 | ||
| 56 | // 使用状态 0:未使用;1:已使用;-1:已过期 | 57 | // 使用状态 0:未使用;1:已使用;-1:已过期 |
| 57 | @Column(name = "use_status") | 58 | @Column(name = "use_status") |
| ... | @@ -59,7 +60,7 @@ public class CouponHistory implements Serializable { | ... | @@ -59,7 +60,7 @@ public class CouponHistory implements Serializable { |
| 59 | 60 | ||
| 60 | // 使用时间 | 61 | // 使用时间 |
| 61 | @Column(name = "use_time") | 62 | @Column(name = "use_time") |
| 62 | private Timestamp useTime; | 63 | private LocalDateTime useTime; |
| 63 | 64 | ||
| 64 | // 订单详情id | 65 | // 订单详情id |
| 65 | @Column(name = "order_detail_id") | 66 | @Column(name = "order_detail_id") |
| ... | @@ -68,12 +69,12 @@ public class CouponHistory implements Serializable { | ... | @@ -68,12 +69,12 @@ public class CouponHistory implements Serializable { |
| 68 | // 创建时间 | 69 | // 创建时间 |
| 69 | @CreatedDate | 70 | @CreatedDate |
| 70 | @Column(name = "create_time") | 71 | @Column(name = "create_time") |
| 71 | private Timestamp createTime; | 72 | private LocalDateTime createTime; |
| 72 | 73 | ||
| 73 | // 更新时间 | 74 | // 更新时间 |
| 74 | @LastModifiedDate | 75 | @LastModifiedDate |
| 75 | @Column(name = "update_time") | 76 | @Column(name = "update_time") |
| 76 | private Timestamp updateTime; | 77 | private LocalDateTime updateTime; |
| 77 | 78 | ||
| 78 | public void copy(CouponHistory source){ | 79 | public void copy(CouponHistory source){ |
| 79 | BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true)); | 80 | BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true)); | ... | ... |
| 1 | package com.topdraw.business.basicdata.coupon.history.repository; | 1 | package com.topdraw.business.module.coupon.history.repository; |
| 2 | 2 | ||
| 3 | import com.topdraw.business.basicdata.coupon.history.domain.CouponHistory; | 3 | import com.topdraw.business.module.coupon.history.domain.CouponHistory; |
| 4 | import org.springframework.data.jpa.repository.JpaRepository; | 4 | import org.springframework.data.jpa.repository.JpaRepository; |
| 5 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; | 5 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; |
| 6 | 6 | ||
| 7 | import java.sql.Timestamp; | 7 | import java.sql.Timestamp; |
| 8 | import java.time.LocalDateTime; | ||
| 8 | 9 | ||
| 9 | /** | 10 | /** |
| 10 | * @author XiangHan | 11 | * @author XiangHan |
| ... | @@ -14,7 +15,7 @@ public interface CouponHistoryRepository extends JpaRepository<CouponHistory, Lo | ... | @@ -14,7 +15,7 @@ public interface CouponHistoryRepository extends JpaRepository<CouponHistory, Lo |
| 14 | 15 | ||
| 15 | Long countByUserId(Long userId); | 16 | Long countByUserId(Long userId); |
| 16 | 17 | ||
| 17 | Long countByUserIdAndExpireTimeBefore(Long userId, Timestamp now); | 18 | Long countByUserIdAndExpireTimeBefore(Long userId, LocalDateTime now); |
| 18 | 19 | ||
| 19 | Long countByUserIdAndExpireTimeBetween(Long userId, Timestamp now, Timestamp expireTime); | 20 | Long countByUserIdAndExpireTimeBetween(Long userId, LocalDateTime now, LocalDateTime expireTime); |
| 20 | } | 21 | } | ... | ... |
| 1 | package com.topdraw.business.basicdata.coupon.history.rest; | 1 | package com.topdraw.business.module.coupon.history.rest; |
| 2 | 2 | ||
| 3 | import com.topdraw.annotation.Log; | 3 | import com.topdraw.business.module.coupon.history.domain.CouponHistory; |
| 4 | import com.topdraw.business.basicdata.coupon.history.domain.CouponHistory; | 4 | import com.topdraw.business.module.coupon.history.service.CouponHistoryService; |
| 5 | import com.topdraw.business.basicdata.coupon.history.service.CouponHistoryService; | 5 | import com.topdraw.business.module.coupon.history.service.dto.CouponHistoryQueryCriteria; |
| 6 | import com.topdraw.business.basicdata.coupon.history.service.dto.CouponHistoryQueryCriteria; | ||
| 7 | import com.topdraw.common.ResultInfo; | 6 | import com.topdraw.common.ResultInfo; |
| 8 | import io.swagger.annotations.Api; | 7 | import io.swagger.annotations.Api; |
| 9 | import io.swagger.annotations.ApiOperation; | 8 | import io.swagger.annotations.ApiOperation; |
| ... | @@ -36,7 +35,6 @@ public class CouponHistoryController { | ... | @@ -36,7 +35,6 @@ public class CouponHistoryController { |
| 36 | return ResultInfo.success(CouponHistoryService.queryAll(criteria)); | 35 | return ResultInfo.success(CouponHistoryService.queryAll(criteria)); |
| 37 | } | 36 | } |
| 38 | 37 | ||
| 39 | @Log | ||
| 40 | @PostMapping | 38 | @PostMapping |
| 41 | @ApiOperation("新增CouponHistory") | 39 | @ApiOperation("新增CouponHistory") |
| 42 | public ResultInfo create(@Validated @RequestBody CouponHistory resources) { | 40 | public ResultInfo create(@Validated @RequestBody CouponHistory resources) { |
| ... | @@ -44,7 +42,6 @@ public class CouponHistoryController { | ... | @@ -44,7 +42,6 @@ public class CouponHistoryController { |
| 44 | return ResultInfo.success(); | 42 | return ResultInfo.success(); |
| 45 | } | 43 | } |
| 46 | 44 | ||
| 47 | @Log | ||
| 48 | @PutMapping | 45 | @PutMapping |
| 49 | @ApiOperation("修改CouponHistory") | 46 | @ApiOperation("修改CouponHistory") |
| 50 | public ResultInfo update(@Validated @RequestBody CouponHistory resources) { | 47 | public ResultInfo update(@Validated @RequestBody CouponHistory resources) { |
| ... | @@ -53,7 +50,6 @@ public class CouponHistoryController { | ... | @@ -53,7 +50,6 @@ public class CouponHistoryController { |
| 53 | } | 50 | } |
| 54 | 51 | ||
| 55 | 52 | ||
| 56 | @Log | ||
| 57 | @DeleteMapping(value = "/{id}") | 53 | @DeleteMapping(value = "/{id}") |
| 58 | @ApiOperation("删除CouponHistory") | 54 | @ApiOperation("删除CouponHistory") |
| 59 | public ResultInfo delete(@PathVariable Long id) { | 55 | public ResultInfo delete(@PathVariable Long id) { | ... | ... |
| 1 | package com.topdraw.business.basicdata.coupon.history.service; | 1 | package com.topdraw.business.module.coupon.history.service; |
| 2 | 2 | ||
| 3 | import com.topdraw.business.basicdata.coupon.history.domain.CouponHistory; | 3 | import com.topdraw.business.module.coupon.history.domain.CouponHistory; |
| 4 | import com.topdraw.business.basicdata.coupon.history.service.dto.CouponHistoryDTO; | 4 | import com.topdraw.business.module.coupon.history.service.dto.CouponHistoryDTO; |
| 5 | import com.topdraw.business.basicdata.coupon.history.service.dto.CouponHistoryQueryCriteria; | 5 | import com.topdraw.business.module.coupon.history.service.dto.CouponHistoryQueryCriteria; |
| 6 | import org.springframework.data.domain.Pageable; | 6 | import org.springframework.data.domain.Pageable; |
| 7 | 7 | ||
| 8 | import java.sql.Timestamp; | 8 | import java.sql.Timestamp; |
| 9 | import java.time.LocalDateTime; | ||
| 9 | import java.util.List; | 10 | import java.util.List; |
| 10 | import java.util.Map; | 11 | import java.util.Map; |
| 11 | 12 | ||
| ... | @@ -45,7 +46,7 @@ public interface CouponHistoryService { | ... | @@ -45,7 +46,7 @@ public interface CouponHistoryService { |
| 45 | 46 | ||
| 46 | Long countByUserId(Long userId); | 47 | Long countByUserId(Long userId); |
| 47 | 48 | ||
| 48 | Long countByUserIdAndExpireTimeBefore(Long userId, Timestamp now); | 49 | Long countByUserIdAndExpireTimeBefore(Long userId, LocalDateTime now); |
| 49 | 50 | ||
| 50 | Long countByUserIdAndExpireTimeBetween(Long userId, Timestamp now, Timestamp expireTime); | 51 | Long countByUserIdAndExpireTimeBetween(Long userId, LocalDateTime now, LocalDateTime expireTime); |
| 51 | } | 52 | } | ... | ... |
| 1 | package com.topdraw.business.basicdata.coupon.history.service.dto; | 1 | package com.topdraw.business.module.coupon.history.service.dto; |
| 2 | 2 | ||
| 3 | import lombok.Data; | 3 | import lombok.Data; |
| 4 | 4 | ||
| 5 | import java.io.Serializable; | 5 | import java.io.Serializable; |
| 6 | import java.sql.Timestamp; | 6 | import java.sql.Timestamp; |
| 7 | import java.time.LocalDateTime; | ||
| 7 | 8 | ||
| 8 | 9 | ||
| 9 | /** | 10 | /** |
| ... | @@ -29,23 +30,23 @@ public class CouponHistoryDTO implements Serializable { | ... | @@ -29,23 +30,23 @@ public class CouponHistoryDTO implements Serializable { |
| 29 | private String userNickname; | 30 | private String userNickname; |
| 30 | 31 | ||
| 31 | // 领取时间 | 32 | // 领取时间 |
| 32 | private Timestamp receiveTime; | 33 | private LocalDateTime receiveTime; |
| 33 | 34 | ||
| 34 | // 失效时间 | 35 | // 失效时间 |
| 35 | private Timestamp expireTime; | 36 | private LocalDateTime expireTime; |
| 36 | 37 | ||
| 37 | // 使用状态 0:未使用;1:已使用;-1:已过期 | 38 | // 使用状态 0:未使用;1:已使用;-1:已过期 |
| 38 | private Integer useStatus; | 39 | private Integer useStatus; |
| 39 | 40 | ||
| 40 | // 使用时间 | 41 | // 使用时间 |
| 41 | private Timestamp useTime; | 42 | private LocalDateTime useTime; |
| 42 | 43 | ||
| 43 | // 订单详情id | 44 | // 订单详情id |
| 44 | private Long orderDetailId; | 45 | private Long orderDetailId; |
| 45 | 46 | ||
| 46 | // 创建时间 | 47 | // 创建时间 |
| 47 | private Timestamp createTime; | 48 | private LocalDateTime createTime; |
| 48 | 49 | ||
| 49 | // 更新时间 | 50 | // 更新时间 |
| 50 | private Timestamp updateTime; | 51 | private LocalDateTime updateTime; |
| 51 | } | 52 | } | ... | ... |
| 1 | package com.topdraw.business.basicdata.coupon.history.service.impl; | 1 | package com.topdraw.business.module.coupon.history.service.impl; |
| 2 | 2 | ||
| 3 | import com.topdraw.business.basicdata.coupon.history.domain.CouponHistory; | 3 | import com.topdraw.business.module.coupon.history.domain.CouponHistory; |
| 4 | import com.topdraw.business.basicdata.coupon.history.repository.CouponHistoryRepository; | 4 | import com.topdraw.business.module.coupon.history.repository.CouponHistoryRepository; |
| 5 | import com.topdraw.business.basicdata.coupon.history.service.CouponHistoryService; | 5 | import com.topdraw.business.module.coupon.history.service.CouponHistoryService; |
| 6 | import com.topdraw.business.basicdata.coupon.history.service.dto.CouponHistoryDTO; | 6 | import com.topdraw.business.module.coupon.history.service.dto.CouponHistoryDTO; |
| 7 | import com.topdraw.business.basicdata.coupon.history.service.dto.CouponHistoryQueryCriteria; | 7 | import com.topdraw.business.module.coupon.history.service.dto.CouponHistoryQueryCriteria; |
| 8 | import com.topdraw.business.basicdata.coupon.history.service.mapper.CouponHistoryMapper; | 8 | import com.topdraw.business.module.coupon.history.service.mapper.CouponHistoryMapper; |
| 9 | import com.topdraw.utils.PageUtil; | 9 | import com.topdraw.utils.PageUtil; |
| 10 | import com.topdraw.utils.QueryHelp; | 10 | import com.topdraw.utils.QueryHelp; |
| 11 | import com.topdraw.utils.ValidationUtil; | 11 | import com.topdraw.utils.ValidationUtil; |
| ... | @@ -19,6 +19,7 @@ import org.springframework.transaction.annotation.Transactional; | ... | @@ -19,6 +19,7 @@ import org.springframework.transaction.annotation.Transactional; |
| 19 | import org.springframework.util.Assert; | 19 | import org.springframework.util.Assert; |
| 20 | 20 | ||
| 21 | import java.sql.Timestamp; | 21 | import java.sql.Timestamp; |
| 22 | import java.time.LocalDateTime; | ||
| 22 | import java.util.List; | 23 | import java.util.List; |
| 23 | import java.util.Map; | 24 | import java.util.Map; |
| 24 | 25 | ||
| ... | @@ -84,12 +85,12 @@ public class CouponHistoryServiceImpl implements CouponHistoryService { | ... | @@ -84,12 +85,12 @@ public class CouponHistoryServiceImpl implements CouponHistoryService { |
| 84 | } | 85 | } |
| 85 | 86 | ||
| 86 | @Override | 87 | @Override |
| 87 | public Long countByUserIdAndExpireTimeBefore(Long userId, Timestamp now) { | 88 | public Long countByUserIdAndExpireTimeBefore(Long userId, LocalDateTime now) { |
| 88 | return this.CouponHistoryRepository.countByUserIdAndExpireTimeBefore(userId,now); | 89 | return this.CouponHistoryRepository.countByUserIdAndExpireTimeBefore(userId,now); |
| 89 | } | 90 | } |
| 90 | 91 | ||
| 91 | @Override | 92 | @Override |
| 92 | public Long countByUserIdAndExpireTimeBetween(Long userId, Timestamp now, Timestamp expireTime) { | 93 | public Long countByUserIdAndExpireTimeBetween(Long userId, LocalDateTime now, LocalDateTime expireTime) { |
| 93 | return this.CouponHistoryRepository.countByUserIdAndExpireTimeBetween(userId,now,expireTime); | 94 | return this.CouponHistoryRepository.countByUserIdAndExpireTimeBetween(userId,now,expireTime); |
| 94 | } | 95 | } |
| 95 | 96 | ... | ... |
| 1 | package com.topdraw.business.basicdata.coupon.history.service.mapper; | 1 | package com.topdraw.business.module.coupon.history.service.mapper; |
| 2 | 2 | ||
| 3 | import com.topdraw.base.BaseMapper; | 3 | import com.topdraw.base.BaseMapper; |
| 4 | import com.topdraw.business.basicdata.coupon.history.domain.CouponHistory; | 4 | import com.topdraw.business.module.coupon.history.domain.CouponHistory; |
| 5 | import com.topdraw.business.basicdata.coupon.history.service.dto.CouponHistoryDTO; | 5 | import com.topdraw.business.module.coupon.history.service.dto.CouponHistoryDTO; |
| 6 | import org.mapstruct.Mapper; | 6 | import org.mapstruct.Mapper; |
| 7 | import org.mapstruct.ReportingPolicy; | 7 | import org.mapstruct.ReportingPolicy; |
| 8 | 8 | ... | ... |
| 1 | package com.topdraw.business.basicdata.coupon.repository; | 1 | package com.topdraw.business.module.coupon.repository; |
| 2 | 2 | ||
| 3 | import com.topdraw.business.basicdata.coupon.domain.Coupon; | 3 | import com.topdraw.business.module.coupon.domain.Coupon; |
| 4 | import org.springframework.data.jpa.repository.JpaRepository; | 4 | import org.springframework.data.jpa.repository.JpaRepository; |
| 5 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; | 5 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; |
| 6 | 6 | ... | ... |
| 1 | package com.topdraw.business.basicdata.coupon.rest; | 1 | package com.topdraw.business.module.coupon.rest; |
| 2 | 2 | ||
| 3 | import com.topdraw.annotation.Log; | 3 | import com.topdraw.business.module.coupon.domain.Coupon; |
| 4 | import com.topdraw.business.basicdata.coupon.domain.Coupon; | 4 | import com.topdraw.business.module.coupon.service.CouponService; |
| 5 | import com.topdraw.business.basicdata.coupon.service.CouponService; | 5 | import com.topdraw.business.module.coupon.service.dto.CouponQueryCriteria; |
| 6 | import com.topdraw.business.basicdata.coupon.service.dto.CouponQueryCriteria; | ||
| 7 | import com.topdraw.common.ResultInfo; | 6 | import com.topdraw.common.ResultInfo; |
| 8 | import io.swagger.annotations.Api; | 7 | import io.swagger.annotations.Api; |
| 9 | import io.swagger.annotations.ApiOperation; | 8 | import io.swagger.annotations.ApiOperation; |
| ... | @@ -36,7 +35,6 @@ public class CouponController { | ... | @@ -36,7 +35,6 @@ public class CouponController { |
| 36 | return ResultInfo.success(CouponService.queryAll(criteria)); | 35 | return ResultInfo.success(CouponService.queryAll(criteria)); |
| 37 | } | 36 | } |
| 38 | 37 | ||
| 39 | @Log | ||
| 40 | @PostMapping | 38 | @PostMapping |
| 41 | @ApiOperation("新增Coupon") | 39 | @ApiOperation("新增Coupon") |
| 42 | public ResultInfo create(@Validated @RequestBody Coupon resources) { | 40 | public ResultInfo create(@Validated @RequestBody Coupon resources) { |
| ... | @@ -44,7 +42,6 @@ public class CouponController { | ... | @@ -44,7 +42,6 @@ public class CouponController { |
| 44 | return ResultInfo.success(); | 42 | return ResultInfo.success(); |
| 45 | } | 43 | } |
| 46 | 44 | ||
| 47 | @Log | ||
| 48 | @PutMapping | 45 | @PutMapping |
| 49 | @ApiOperation("修改Coupon") | 46 | @ApiOperation("修改Coupon") |
| 50 | public ResultInfo update(@Validated @RequestBody Coupon resources) { | 47 | public ResultInfo update(@Validated @RequestBody Coupon resources) { |
| ... | @@ -52,8 +49,6 @@ public class CouponController { | ... | @@ -52,8 +49,6 @@ public class CouponController { |
| 52 | return ResultInfo.success(); | 49 | return ResultInfo.success(); |
| 53 | } | 50 | } |
| 54 | 51 | ||
| 55 | |||
| 56 | @Log | ||
| 57 | @DeleteMapping(value = "/{id}") | 52 | @DeleteMapping(value = "/{id}") |
| 58 | @ApiOperation("删除Coupon") | 53 | @ApiOperation("删除Coupon") |
| 59 | public ResultInfo delete(@PathVariable Long id) { | 54 | public ResultInfo delete(@PathVariable Long id) { | ... | ... |
| 1 | package com.topdraw.business.basicdata.coupon.service; | 1 | package com.topdraw.business.module.coupon.service; |
| 2 | 2 | ||
| 3 | import com.topdraw.business.basicdata.coupon.domain.Coupon; | 3 | import com.topdraw.business.module.coupon.domain.Coupon; |
| 4 | import com.topdraw.business.basicdata.coupon.service.dto.CouponDTO; | 4 | import com.topdraw.business.module.coupon.service.dto.CouponDTO; |
| 5 | import com.topdraw.business.basicdata.coupon.service.dto.CouponQueryCriteria; | 5 | import com.topdraw.business.module.coupon.service.dto.CouponQueryCriteria; |
| 6 | import org.springframework.data.domain.Pageable; | 6 | import org.springframework.data.domain.Pageable; |
| 7 | 7 | ||
| 8 | import java.util.List; | 8 | import java.util.List; | ... | ... |
| 1 | package com.topdraw.business.basicdata.coupon.service.impl; | 1 | package com.topdraw.business.module.coupon.service.impl; |
| 2 | 2 | ||
| 3 | import com.topdraw.business.basicdata.coupon.domain.Coupon; | 3 | import com.topdraw.business.module.coupon.domain.Coupon; |
| 4 | import com.topdraw.business.basicdata.coupon.repository.CouponRepository; | 4 | import com.topdraw.business.module.coupon.repository.CouponRepository; |
| 5 | import com.topdraw.business.basicdata.coupon.service.CouponService; | 5 | import com.topdraw.business.module.coupon.service.CouponService; |
| 6 | import com.topdraw.business.basicdata.coupon.service.dto.CouponDTO; | 6 | import com.topdraw.business.module.coupon.service.dto.CouponDTO; |
| 7 | import com.topdraw.business.basicdata.coupon.service.dto.CouponQueryCriteria; | 7 | import com.topdraw.business.module.coupon.service.dto.CouponQueryCriteria; |
| 8 | import com.topdraw.business.basicdata.coupon.service.mapper.CouponMapper; | 8 | import com.topdraw.business.module.coupon.service.mapper.CouponMapper; |
| 9 | import com.topdraw.utils.PageUtil; | 9 | import com.topdraw.utils.PageUtil; |
| 10 | import com.topdraw.utils.QueryHelp; | 10 | import com.topdraw.utils.QueryHelp; |
| 11 | import com.topdraw.utils.StringUtils; | 11 | import com.topdraw.utils.StringUtils; | ... | ... |
| 1 | package com.topdraw.business.basicdata.coupon.service.mapper; | 1 | package com.topdraw.business.module.coupon.service.mapper; |
| 2 | 2 | ||
| 3 | import com.topdraw.base.BaseMapper; | 3 | import com.topdraw.base.BaseMapper; |
| 4 | import com.topdraw.business.basicdata.coupon.domain.Coupon; | 4 | import com.topdraw.business.module.coupon.domain.Coupon; |
| 5 | import com.topdraw.business.basicdata.coupon.service.dto.CouponDTO; | 5 | import com.topdraw.business.module.coupon.service.dto.CouponDTO; |
| 6 | import org.mapstruct.Mapper; | 6 | import org.mapstruct.Mapper; |
| 7 | import org.mapstruct.ReportingPolicy; | 7 | import org.mapstruct.ReportingPolicy; |
| 8 | 8 | ... | ... |
| 1 | package com.topdraw.business.basicdata.exp.detail.domain; | 1 | package com.topdraw.business.module.exp.detail.domain; |
| 2 | 2 | ||
| 3 | import cn.hutool.core.bean.BeanUtil; | 3 | import cn.hutool.core.bean.BeanUtil; |
| 4 | import cn.hutool.core.bean.copier.CopyOptions; | 4 | import cn.hutool.core.bean.copier.CopyOptions; | ... | ... |
| 1 | package com.topdraw.business.basicdata.exp.detail.repository; | 1 | package com.topdraw.business.module.exp.detail.repository; |
| 2 | 2 | ||
| 3 | import com.topdraw.business.basicdata.exp.detail.domain.ExpDetail; | 3 | import com.topdraw.business.module.exp.detail.domain.ExpDetail; |
| 4 | import org.springframework.data.jpa.repository.JpaRepository; | 4 | import org.springframework.data.jpa.repository.JpaRepository; |
| 5 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; | 5 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; |
| 6 | 6 | ... | ... |
| 1 | package com.topdraw.business.basicdata.exp.detail.rest; | 1 | package com.topdraw.business.module.exp.detail.rest; |
| 2 | 2 | ||
| 3 | import com.topdraw.annotation.Log; | 3 | import com.topdraw.business.module.exp.detail.domain.ExpDetail; |
| 4 | import com.topdraw.business.basicdata.exp.detail.domain.ExpDetail; | 4 | import com.topdraw.business.module.exp.detail.service.ExpDetailService; |
| 5 | import com.topdraw.business.basicdata.exp.detail.service.ExpDetailService; | 5 | import com.topdraw.business.module.exp.detail.service.dto.ExpDetailQueryCriteria; |
| 6 | import com.topdraw.business.basicdata.exp.detail.service.dto.ExpDetailQueryCriteria; | ||
| 7 | import com.topdraw.common.ResultInfo; | 6 | import com.topdraw.common.ResultInfo; |
| 8 | import io.swagger.annotations.Api; | 7 | import io.swagger.annotations.Api; |
| 9 | import io.swagger.annotations.ApiOperation; | 8 | import io.swagger.annotations.ApiOperation; |
| ... | @@ -36,7 +35,6 @@ public class ExpDetailController { | ... | @@ -36,7 +35,6 @@ public class ExpDetailController { |
| 36 | return ResultInfo.success(ExpDetailService.queryAll(criteria)); | 35 | return ResultInfo.success(ExpDetailService.queryAll(criteria)); |
| 37 | } | 36 | } |
| 38 | 37 | ||
| 39 | @Log | ||
| 40 | @PostMapping | 38 | @PostMapping |
| 41 | @ApiOperation("新增ExpDetail") | 39 | @ApiOperation("新增ExpDetail") |
| 42 | public ResultInfo create(@Validated @RequestBody ExpDetail resources) { | 40 | public ResultInfo create(@Validated @RequestBody ExpDetail resources) { |
| ... | @@ -44,7 +42,6 @@ public class ExpDetailController { | ... | @@ -44,7 +42,6 @@ public class ExpDetailController { |
| 44 | return ResultInfo.success(); | 42 | return ResultInfo.success(); |
| 45 | } | 43 | } |
| 46 | 44 | ||
| 47 | @Log | ||
| 48 | @PutMapping | 45 | @PutMapping |
| 49 | @ApiOperation("修改ExpDetail") | 46 | @ApiOperation("修改ExpDetail") |
| 50 | public ResultInfo update(@Validated @RequestBody ExpDetail resources) { | 47 | public ResultInfo update(@Validated @RequestBody ExpDetail resources) { |
| ... | @@ -52,8 +49,6 @@ public class ExpDetailController { | ... | @@ -52,8 +49,6 @@ public class ExpDetailController { |
| 52 | return ResultInfo.success(); | 49 | return ResultInfo.success(); |
| 53 | } | 50 | } |
| 54 | 51 | ||
| 55 | |||
| 56 | @Log | ||
| 57 | @DeleteMapping(value = "/{id}") | 52 | @DeleteMapping(value = "/{id}") |
| 58 | @ApiOperation("删除ExpDetail") | 53 | @ApiOperation("删除ExpDetail") |
| 59 | public ResultInfo delete(@PathVariable Long id) { | 54 | public ResultInfo delete(@PathVariable Long id) { | ... | ... |
| 1 | package com.topdraw.business.basicdata.exp.detail.service; | 1 | package com.topdraw.business.module.exp.detail.service; |
| 2 | 2 | ||
| 3 | import com.topdraw.business.basicdata.exp.detail.domain.ExpDetail; | 3 | import com.topdraw.business.module.exp.detail.domain.ExpDetail; |
| 4 | import com.topdraw.business.basicdata.exp.detail.service.dto.ExpDetailDTO; | 4 | import com.topdraw.business.module.exp.detail.service.dto.ExpDetailDTO; |
| 5 | import com.topdraw.business.basicdata.exp.detail.service.dto.ExpDetailQueryCriteria; | 5 | import com.topdraw.business.module.exp.detail.service.dto.ExpDetailQueryCriteria; |
| 6 | import org.springframework.data.domain.Pageable; | 6 | import org.springframework.data.domain.Pageable; |
| 7 | 7 | ||
| 8 | import java.util.List; | 8 | import java.util.List; | ... | ... |
| 1 | package com.topdraw.business.basicdata.exp.detail.service.impl; | 1 | package com.topdraw.business.module.exp.detail.service.impl; |
| 2 | 2 | ||
| 3 | import com.topdraw.business.basicdata.exp.detail.domain.ExpDetail; | 3 | import com.topdraw.business.module.exp.detail.domain.ExpDetail; |
| 4 | import com.topdraw.business.basicdata.exp.detail.repository.ExpDetailRepository; | 4 | import com.topdraw.business.module.exp.detail.repository.ExpDetailRepository; |
| 5 | import com.topdraw.business.basicdata.exp.detail.service.ExpDetailService; | 5 | import com.topdraw.business.module.exp.detail.service.ExpDetailService; |
| 6 | import com.topdraw.business.basicdata.exp.detail.service.dto.ExpDetailDTO; | 6 | import com.topdraw.business.module.exp.detail.service.dto.ExpDetailDTO; |
| 7 | import com.topdraw.business.basicdata.exp.detail.service.dto.ExpDetailQueryCriteria; | 7 | import com.topdraw.business.module.exp.detail.service.dto.ExpDetailQueryCriteria; |
| 8 | import com.topdraw.business.basicdata.exp.detail.service.mapper.ExpDetailMapper; | 8 | import com.topdraw.business.module.exp.detail.service.mapper.ExpDetailMapper; |
| 9 | import com.topdraw.utils.PageUtil; | 9 | import com.topdraw.utils.PageUtil; |
| 10 | import com.topdraw.utils.QueryHelp; | 10 | import com.topdraw.utils.QueryHelp; |
| 11 | import com.topdraw.utils.StringUtils; | 11 | import com.topdraw.utils.StringUtils; | ... | ... |
| 1 | package com.topdraw.business.basicdata.exp.detail.service.mapper; | 1 | package com.topdraw.business.module.exp.detail.service.mapper; |
| 2 | 2 | ||
| 3 | import com.topdraw.base.BaseMapper; | 3 | import com.topdraw.base.BaseMapper; |
| 4 | import com.topdraw.business.basicdata.exp.detail.domain.ExpDetail; | 4 | import com.topdraw.business.module.exp.detail.domain.ExpDetail; |
| 5 | import com.topdraw.business.basicdata.exp.detail.service.dto.ExpDetailDTO; | 5 | import com.topdraw.business.module.exp.detail.service.dto.ExpDetailDTO; |
| 6 | import org.mapstruct.Mapper; | 6 | import org.mapstruct.Mapper; |
| 7 | import org.mapstruct.ReportingPolicy; | 7 | import org.mapstruct.ReportingPolicy; |
| 8 | 8 | ... | ... |
| 1 | package com.topdraw.business.basicdata.exp.history.domain; | 1 | package com.topdraw.business.module.exp.history.domain; |
| 2 | 2 | ||
| 3 | import cn.hutool.core.bean.BeanUtil; | 3 | import cn.hutool.core.bean.BeanUtil; |
| 4 | import cn.hutool.core.bean.copier.CopyOptions; | 4 | import cn.hutool.core.bean.copier.CopyOptions; | ... | ... |
| 1 | package com.topdraw.business.basicdata.exp.history.repository; | 1 | package com.topdraw.business.module.exp.history.repository; |
| 2 | 2 | ||
| 3 | import com.topdraw.business.basicdata.exp.history.domain.ExpHistory; | 3 | import com.topdraw.business.module.exp.history.domain.ExpHistory; |
| 4 | import org.springframework.data.jpa.repository.JpaRepository; | 4 | import org.springframework.data.jpa.repository.JpaRepository; |
| 5 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; | 5 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; |
| 6 | 6 | ... | ... |
| 1 | package com.topdraw.business.basicdata.exp.history.rest; | 1 | package com.topdraw.business.module.exp.history.rest; |
| 2 | 2 | ||
| 3 | import com.topdraw.annotation.Log; | 3 | import com.topdraw.business.module.exp.history.domain.ExpHistory; |
| 4 | import com.topdraw.business.basicdata.exp.history.domain.ExpHistory; | 4 | import com.topdraw.business.module.exp.history.service.ExpHistoryService; |
| 5 | import com.topdraw.business.basicdata.exp.history.service.ExpHistoryService; | 5 | import com.topdraw.business.module.exp.history.service.dto.ExpHistoryQueryCriteria; |
| 6 | import com.topdraw.business.basicdata.exp.history.service.dto.ExpHistoryQueryCriteria; | ||
| 7 | import com.topdraw.common.ResultInfo; | 6 | import com.topdraw.common.ResultInfo; |
| 8 | import io.swagger.annotations.Api; | 7 | import io.swagger.annotations.Api; |
| 9 | import io.swagger.annotations.ApiOperation; | 8 | import io.swagger.annotations.ApiOperation; |
| ... | @@ -36,7 +35,6 @@ public class ExpHistoryController { | ... | @@ -36,7 +35,6 @@ public class ExpHistoryController { |
| 36 | return ResultInfo.success(ExpHistoryService.queryAll(criteria)); | 35 | return ResultInfo.success(ExpHistoryService.queryAll(criteria)); |
| 37 | } | 36 | } |
| 38 | 37 | ||
| 39 | @Log | ||
| 40 | @PostMapping | 38 | @PostMapping |
| 41 | @ApiOperation("新增ExpHistory") | 39 | @ApiOperation("新增ExpHistory") |
| 42 | public ResultInfo create(@Validated @RequestBody ExpHistory resources) { | 40 | public ResultInfo create(@Validated @RequestBody ExpHistory resources) { |
| ... | @@ -44,7 +42,6 @@ public class ExpHistoryController { | ... | @@ -44,7 +42,6 @@ public class ExpHistoryController { |
| 44 | return ResultInfo.success(); | 42 | return ResultInfo.success(); |
| 45 | } | 43 | } |
| 46 | 44 | ||
| 47 | @Log | ||
| 48 | @PutMapping | 45 | @PutMapping |
| 49 | @ApiOperation("修改ExpHistory") | 46 | @ApiOperation("修改ExpHistory") |
| 50 | public ResultInfo update(@Validated @RequestBody ExpHistory resources) { | 47 | public ResultInfo update(@Validated @RequestBody ExpHistory resources) { |
| ... | @@ -52,8 +49,6 @@ public class ExpHistoryController { | ... | @@ -52,8 +49,6 @@ public class ExpHistoryController { |
| 52 | return ResultInfo.success(); | 49 | return ResultInfo.success(); |
| 53 | } | 50 | } |
| 54 | 51 | ||
| 55 | |||
| 56 | @Log | ||
| 57 | @DeleteMapping(value = "/{id}") | 52 | @DeleteMapping(value = "/{id}") |
| 58 | @ApiOperation("删除ExpHistory") | 53 | @ApiOperation("删除ExpHistory") |
| 59 | public ResultInfo delete(@PathVariable Long id) { | 54 | public ResultInfo delete(@PathVariable Long id) { | ... | ... |
| 1 | package com.topdraw.business.basicdata.exp.history.service; | 1 | package com.topdraw.business.module.exp.history.service; |
| 2 | 2 | ||
| 3 | import com.topdraw.business.basicdata.exp.history.domain.ExpHistory; | 3 | import com.topdraw.business.module.exp.history.domain.ExpHistory; |
| 4 | import com.topdraw.business.basicdata.exp.history.service.dto.ExpHistoryDTO; | 4 | import com.topdraw.business.module.exp.history.service.dto.ExpHistoryDTO; |
| 5 | import com.topdraw.business.basicdata.exp.history.service.dto.ExpHistoryQueryCriteria; | 5 | import com.topdraw.business.module.exp.history.service.dto.ExpHistoryQueryCriteria; |
| 6 | import org.springframework.data.domain.Pageable; | 6 | import org.springframework.data.domain.Pageable; |
| 7 | 7 | ||
| 8 | import java.util.List; | 8 | import java.util.List; | ... | ... |
| 1 | package com.topdraw.business.basicdata.exp.history.service.impl; | 1 | package com.topdraw.business.module.exp.history.service.impl; |
| 2 | 2 | ||
| 3 | import com.topdraw.business.basicdata.exp.history.domain.ExpHistory; | 3 | import com.topdraw.business.module.exp.history.domain.ExpHistory; |
| 4 | import com.topdraw.business.basicdata.exp.history.repository.ExpHistoryRepository; | 4 | import com.topdraw.business.module.exp.history.repository.ExpHistoryRepository; |
| 5 | import com.topdraw.business.basicdata.exp.history.service.ExpHistoryService; | 5 | import com.topdraw.business.module.exp.history.service.ExpHistoryService; |
| 6 | import com.topdraw.business.basicdata.exp.history.service.dto.ExpHistoryDTO; | 6 | import com.topdraw.business.module.exp.history.service.dto.ExpHistoryDTO; |
| 7 | import com.topdraw.business.basicdata.exp.history.service.dto.ExpHistoryQueryCriteria; | 7 | import com.topdraw.business.module.exp.history.service.dto.ExpHistoryQueryCriteria; |
| 8 | import com.topdraw.business.basicdata.exp.history.service.mapper.ExpHistoryMapper; | 8 | import com.topdraw.business.module.exp.history.service.mapper.ExpHistoryMapper; |
| 9 | import com.topdraw.utils.PageUtil; | 9 | import com.topdraw.utils.PageUtil; |
| 10 | import com.topdraw.utils.QueryHelp; | 10 | import com.topdraw.utils.QueryHelp; |
| 11 | import com.topdraw.utils.StringUtils; | 11 | import com.topdraw.utils.StringUtils; | ... | ... |
| 1 | package com.topdraw.business.basicdata.exp.history.service.mapper; | 1 | package com.topdraw.business.module.exp.history.service.mapper; |
| 2 | 2 | ||
| 3 | import com.topdraw.base.BaseMapper; | 3 | import com.topdraw.base.BaseMapper; |
| 4 | import com.topdraw.business.basicdata.exp.history.domain.ExpHistory; | 4 | import com.topdraw.business.module.exp.history.domain.ExpHistory; |
| 5 | import com.topdraw.business.basicdata.exp.history.service.dto.ExpHistoryDTO; | 5 | import com.topdraw.business.module.exp.history.service.dto.ExpHistoryDTO; |
| 6 | import org.mapstruct.Mapper; | 6 | import org.mapstruct.Mapper; |
| 7 | import org.mapstruct.ReportingPolicy; | 7 | import org.mapstruct.ReportingPolicy; |
| 8 | 8 | ... | ... |
| 1 | package com.topdraw.business.basicdata.member.address.domain; | 1 | package com.topdraw.business.module.member.address.domain; |
| 2 | 2 | ||
| 3 | import cn.hutool.core.bean.BeanUtil; | 3 | import cn.hutool.core.bean.BeanUtil; |
| 4 | import cn.hutool.core.bean.copier.CopyOptions; | 4 | import cn.hutool.core.bean.copier.CopyOptions; | ... | ... |
| 1 | package com.topdraw.business.basicdata.member.address.repository; | 1 | package com.topdraw.business.module.member.address.repository; |
| 2 | 2 | ||
| 3 | import com.topdraw.business.basicdata.member.address.domain.MemberAddress; | 3 | import com.topdraw.business.module.member.address.domain.MemberAddress; |
| 4 | import org.springframework.data.jpa.repository.JpaRepository; | 4 | import org.springframework.data.jpa.repository.JpaRepository; |
| 5 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; | 5 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; |
| 6 | 6 | ... | ... |
| 1 | package com.topdraw.business.basicdata.member.address.rest; | 1 | package com.topdraw.business.module.member.address.rest; |
| 2 | 2 | ||
| 3 | import com.topdraw.annotation.Log; | 3 | import com.topdraw.business.module.member.address.domain.MemberAddress; |
| 4 | import com.topdraw.business.basicdata.member.address.domain.MemberAddress; | 4 | import com.topdraw.business.module.member.address.service.MemberAddressService; |
| 5 | import com.topdraw.business.basicdata.member.address.service.MemberAddressService; | 5 | import com.topdraw.business.module.member.address.service.dto.MemberAddressQueryCriteria; |
| 6 | import com.topdraw.business.basicdata.member.address.service.dto.MemberAddressQueryCriteria; | ||
| 7 | import com.topdraw.common.ResultInfo; | 6 | import com.topdraw.common.ResultInfo; |
| 8 | import io.swagger.annotations.Api; | 7 | import io.swagger.annotations.Api; |
| 9 | import io.swagger.annotations.ApiOperation; | 8 | import io.swagger.annotations.ApiOperation; |
| ... | @@ -36,7 +35,6 @@ public class MemberAddressController { | ... | @@ -36,7 +35,6 @@ public class MemberAddressController { |
| 36 | return ResultInfo.success(MemberAddressService.findById(id)); | 35 | return ResultInfo.success(MemberAddressService.findById(id)); |
| 37 | } | 36 | } |
| 38 | 37 | ||
| 39 | @Log | ||
| 40 | @PostMapping(value = "/create") | 38 | @PostMapping(value = "/create") |
| 41 | @ApiOperation("新增MemberAddress") | 39 | @ApiOperation("新增MemberAddress") |
| 42 | public ResultInfo create(@Validated @RequestBody MemberAddress resources) { | 40 | public ResultInfo create(@Validated @RequestBody MemberAddress resources) { |
| ... | @@ -44,7 +42,6 @@ public class MemberAddressController { | ... | @@ -44,7 +42,6 @@ public class MemberAddressController { |
| 44 | return ResultInfo.success(); | 42 | return ResultInfo.success(); |
| 45 | } | 43 | } |
| 46 | 44 | ||
| 47 | @Log | ||
| 48 | @PutMapping(value = "/update") | 45 | @PutMapping(value = "/update") |
| 49 | @ApiOperation("修改MemberAddress") | 46 | @ApiOperation("修改MemberAddress") |
| 50 | public ResultInfo update(@Validated @RequestBody MemberAddress resources) { | 47 | public ResultInfo update(@Validated @RequestBody MemberAddress resources) { |
| ... | @@ -52,7 +49,6 @@ public class MemberAddressController { | ... | @@ -52,7 +49,6 @@ public class MemberAddressController { |
| 52 | return ResultInfo.success(); | 49 | return ResultInfo.success(); |
| 53 | } | 50 | } |
| 54 | 51 | ||
| 55 | @Log | ||
| 56 | @DeleteMapping(value = "/delete/{id}") | 52 | @DeleteMapping(value = "/delete/{id}") |
| 57 | @ApiOperation("删除MemberAddress") | 53 | @ApiOperation("删除MemberAddress") |
| 58 | public ResultInfo delete(@PathVariable Long id) { | 54 | public ResultInfo delete(@PathVariable Long id) { | ... | ... |
| 1 | package com.topdraw.business.basicdata.member.address.service; | 1 | package com.topdraw.business.module.member.address.service; |
| 2 | 2 | ||
| 3 | import com.topdraw.business.basicdata.member.address.domain.MemberAddress; | 3 | import com.topdraw.business.module.member.address.domain.MemberAddress; |
| 4 | import com.topdraw.business.basicdata.member.address.service.dto.MemberAddressDTO; | 4 | import com.topdraw.business.module.member.address.service.dto.MemberAddressDTO; |
| 5 | import com.topdraw.business.basicdata.member.address.service.dto.MemberAddressQueryCriteria; | 5 | import com.topdraw.business.module.member.address.service.dto.MemberAddressQueryCriteria; |
| 6 | import org.springframework.data.domain.Pageable; | 6 | import org.springframework.data.domain.Pageable; |
| 7 | 7 | ||
| 8 | import java.util.List; | 8 | import java.util.List; | ... | ... |
| 1 | package com.topdraw.business.basicdata.member.address.service.impl; | 1 | package com.topdraw.business.module.member.address.service.impl; |
| 2 | 2 | ||
| 3 | import com.topdraw.business.basicdata.member.address.domain.MemberAddress; | 3 | import com.topdraw.business.module.member.address.domain.MemberAddress; |
| 4 | import com.topdraw.business.basicdata.member.address.repository.MemberAddressRepository; | 4 | import com.topdraw.business.module.member.address.repository.MemberAddressRepository; |
| 5 | import com.topdraw.business.basicdata.member.address.service.MemberAddressService; | 5 | import com.topdraw.business.module.member.address.service.MemberAddressService; |
| 6 | import com.topdraw.business.basicdata.member.address.service.dto.MemberAddressDTO; | 6 | import com.topdraw.business.module.member.address.service.dto.MemberAddressDTO; |
| 7 | import com.topdraw.business.basicdata.member.address.service.dto.MemberAddressQueryCriteria; | 7 | import com.topdraw.business.module.member.address.service.dto.MemberAddressQueryCriteria; |
| 8 | import com.topdraw.business.basicdata.member.address.service.mapper.MemberAddressMapper; | 8 | import com.topdraw.business.module.member.address.service.mapper.MemberAddressMapper; |
| 9 | import com.topdraw.business.basicdata.member.service.MemberService; | 9 | import com.topdraw.business.module.member.service.MemberService; |
| 10 | import com.topdraw.business.basicdata.member.service.dto.MemberDTO; | 10 | import com.topdraw.business.module.member.service.dto.MemberDTO; |
| 11 | import com.topdraw.utils.PageUtil; | 11 | import com.topdraw.utils.PageUtil; |
| 12 | import com.topdraw.utils.QueryHelp; | 12 | import com.topdraw.utils.QueryHelp; |
| 13 | import com.topdraw.utils.ValidationUtil; | 13 | import com.topdraw.utils.ValidationUtil; |
| ... | @@ -63,6 +63,9 @@ public class MemberAddressServiceImpl implements MemberAddressService { | ... | @@ -63,6 +63,9 @@ public class MemberAddressServiceImpl implements MemberAddressService { |
| 63 | @Transactional(rollbackFor = Exception.class) | 63 | @Transactional(rollbackFor = Exception.class) |
| 64 | public void create(MemberAddress resources) { | 64 | public void create(MemberAddress resources) { |
| 65 | String memberCode = resources.getMemberCode(); | 65 | String memberCode = resources.getMemberCode(); |
| 66 | MemberDTO memberDTO = this.memberService.getByCode(memberCode); | ||
| 67 | Long id = memberDTO.getId(); | ||
| 68 | resources.setMemberId(id); | ||
| 66 | MemberAddressRepository.save(resources); | 69 | MemberAddressRepository.save(resources); |
| 67 | } | 70 | } |
| 68 | 71 | ... | ... |
| 1 | package com.topdraw.business.basicdata.member.address.service.mapper; | 1 | package com.topdraw.business.module.member.address.service.mapper; |
| 2 | 2 | ||
| 3 | import com.topdraw.base.BaseMapper; | 3 | import com.topdraw.base.BaseMapper; |
| 4 | import com.topdraw.business.basicdata.member.address.domain.MemberAddress; | 4 | import com.topdraw.business.module.member.address.domain.MemberAddress; |
| 5 | import com.topdraw.business.basicdata.member.address.service.dto.MemberAddressDTO; | 5 | import com.topdraw.business.module.member.address.service.dto.MemberAddressDTO; |
| 6 | import org.mapstruct.Mapper; | 6 | import org.mapstruct.Mapper; |
| 7 | import org.mapstruct.ReportingPolicy; | 7 | import org.mapstruct.ReportingPolicy; |
| 8 | 8 | ... | ... |
| 1 | package com.topdraw.business.basicdata.member.domain; | 1 | package com.topdraw.business.module.member.domain; |
| 2 | 2 | ||
| 3 | import cn.hutool.core.bean.BeanUtil; | 3 | import cn.hutool.core.bean.BeanUtil; |
| 4 | import cn.hutool.core.bean.copier.CopyOptions; | 4 | import cn.hutool.core.bean.copier.CopyOptions; |
| ... | @@ -116,17 +116,17 @@ public class Member implements Serializable { | ... | @@ -116,17 +116,17 @@ public class Member implements Serializable { |
| 116 | 116 | ||
| 117 | // iptv账号绑定时间 | 117 | // iptv账号绑定时间 |
| 118 | @Column(name = "bind_iptv_time") | 118 | @Column(name = "bind_iptv_time") |
| 119 | private Timestamp bindIptvTime; | 119 | private LocalDateTime bindIptvTime; |
| 120 | 120 | ||
| 121 | // 创建时间 | 121 | // 创建时间 |
| 122 | @CreatedDate | 122 | @CreatedDate |
| 123 | @Column(name = "create_time") | 123 | @Column(name = "create_time") |
| 124 | private Timestamp createTime; | 124 | private LocalDateTime createTime; |
| 125 | 125 | ||
| 126 | // 更新时间 | 126 | // 更新时间 |
| 127 | @LastModifiedDate | 127 | @LastModifiedDate |
| 128 | @Column(name = "update_time") | 128 | @Column(name = "update_time") |
| 129 | private Timestamp updateTime; | 129 | private LocalDateTime updateTime; |
| 130 | 130 | ||
| 131 | // 是否在黑名单 1:是;0否 | 131 | // 是否在黑名单 1:是;0否 |
| 132 | @Column(name = "black_status") | 132 | @Column(name = "black_status") | ... | ... |
| 1 | package com.topdraw.business.basicdata.member.level.domain; | 1 | package com.topdraw.business.module.member.level.domain; |
| 2 | 2 | ||
| 3 | import cn.hutool.core.bean.BeanUtil; | 3 | import cn.hutool.core.bean.BeanUtil; |
| 4 | import cn.hutool.core.bean.copier.CopyOptions; | 4 | import cn.hutool.core.bean.copier.CopyOptions; | ... | ... |
| 1 | package com.topdraw.business.basicdata.member.level.repository; | 1 | package com.topdraw.business.module.member.level.repository; |
| 2 | 2 | ||
| 3 | import com.topdraw.business.basicdata.member.level.domain.MemberLevel; | 3 | import com.topdraw.business.module.member.level.domain.MemberLevel; |
| 4 | import org.springframework.data.jpa.repository.JpaRepository; | 4 | import org.springframework.data.jpa.repository.JpaRepository; |
| 5 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; | 5 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; |
| 6 | 6 | ... | ... |
| 1 | package com.topdraw.business.basicdata.member.level.rest; | 1 | package com.topdraw.business.module.member.level.rest; |
| 2 | 2 | ||
| 3 | import com.topdraw.annotation.Log; | 3 | import com.topdraw.business.module.member.level.domain.MemberLevel; |
| 4 | import com.topdraw.business.basicdata.member.level.domain.MemberLevel; | 4 | import com.topdraw.business.module.member.level.service.MemberLevelService; |
| 5 | import com.topdraw.business.basicdata.member.level.service.MemberLevelService; | 5 | import com.topdraw.business.module.member.level.service.dto.MemberLevelQueryCriteria; |
| 6 | import com.topdraw.business.basicdata.member.level.service.dto.MemberLevelQueryCriteria; | ||
| 7 | import com.topdraw.common.ResultInfo; | 6 | import com.topdraw.common.ResultInfo; |
| 8 | import io.swagger.annotations.Api; | 7 | import io.swagger.annotations.Api; |
| 9 | import io.swagger.annotations.ApiOperation; | 8 | import io.swagger.annotations.ApiOperation; |
| ... | @@ -36,7 +35,6 @@ public class MemberLevelController { | ... | @@ -36,7 +35,6 @@ public class MemberLevelController { |
| 36 | return ResultInfo.success(MemberLevelService.queryAll(criteria)); | 35 | return ResultInfo.success(MemberLevelService.queryAll(criteria)); |
| 37 | } | 36 | } |
| 38 | 37 | ||
| 39 | @Log | ||
| 40 | @PostMapping | 38 | @PostMapping |
| 41 | @ApiOperation("新增MemberLevel") | 39 | @ApiOperation("新增MemberLevel") |
| 42 | public ResultInfo create(@Validated @RequestBody MemberLevel resources) { | 40 | public ResultInfo create(@Validated @RequestBody MemberLevel resources) { |
| ... | @@ -44,7 +42,6 @@ public class MemberLevelController { | ... | @@ -44,7 +42,6 @@ public class MemberLevelController { |
| 44 | return ResultInfo.success(); | 42 | return ResultInfo.success(); |
| 45 | } | 43 | } |
| 46 | 44 | ||
| 47 | @Log | ||
| 48 | @PutMapping | 45 | @PutMapping |
| 49 | @ApiOperation("修改MemberLevel") | 46 | @ApiOperation("修改MemberLevel") |
| 50 | public ResultInfo update(@Validated @RequestBody MemberLevel resources) { | 47 | public ResultInfo update(@Validated @RequestBody MemberLevel resources) { |
| ... | @@ -52,8 +49,6 @@ public class MemberLevelController { | ... | @@ -52,8 +49,6 @@ public class MemberLevelController { |
| 52 | return ResultInfo.success(); | 49 | return ResultInfo.success(); |
| 53 | } | 50 | } |
| 54 | 51 | ||
| 55 | |||
| 56 | @Log | ||
| 57 | @DeleteMapping(value = "/{id}") | 52 | @DeleteMapping(value = "/{id}") |
| 58 | @ApiOperation("删除MemberLevel") | 53 | @ApiOperation("删除MemberLevel") |
| 59 | public ResultInfo delete(@PathVariable Long id) { | 54 | public ResultInfo delete(@PathVariable Long id) { | ... | ... |
| 1 | package com.topdraw.business.basicdata.member.level.service; | 1 | package com.topdraw.business.module.member.level.service; |
| 2 | 2 | ||
| 3 | import com.topdraw.business.basicdata.member.level.domain.MemberLevel; | 3 | import com.topdraw.business.module.member.level.domain.MemberLevel; |
| 4 | import com.topdraw.business.basicdata.member.level.service.dto.MemberLevelDTO; | 4 | import com.topdraw.business.module.member.level.service.dto.MemberLevelDTO; |
| 5 | import com.topdraw.business.basicdata.member.level.service.dto.MemberLevelQueryCriteria; | 5 | import com.topdraw.business.module.member.level.service.dto.MemberLevelQueryCriteria; |
| 6 | import org.springframework.data.domain.Pageable; | 6 | import org.springframework.data.domain.Pageable; |
| 7 | 7 | ||
| 8 | import java.util.List; | 8 | import java.util.List; | ... | ... |
| 1 | package com.topdraw.business.basicdata.member.level.service.impl; | 1 | package com.topdraw.business.module.member.level.service.impl; |
| 2 | 2 | ||
| 3 | import com.topdraw.business.basicdata.member.level.domain.MemberLevel; | 3 | import com.topdraw.business.module.member.level.domain.MemberLevel; |
| 4 | import com.topdraw.business.basicdata.member.level.repository.MemberLevelRepository; | 4 | import com.topdraw.business.module.member.level.repository.MemberLevelRepository; |
| 5 | import com.topdraw.business.basicdata.member.level.service.MemberLevelService; | 5 | import com.topdraw.business.module.member.level.service.MemberLevelService; |
| 6 | import com.topdraw.business.basicdata.member.level.service.dto.MemberLevelDTO; | 6 | import com.topdraw.business.module.member.level.service.dto.MemberLevelDTO; |
| 7 | import com.topdraw.business.basicdata.member.level.service.dto.MemberLevelQueryCriteria; | 7 | import com.topdraw.business.module.member.level.service.dto.MemberLevelQueryCriteria; |
| 8 | import com.topdraw.business.basicdata.member.level.service.mapper.MemberLevelMapper; | 8 | import com.topdraw.business.module.member.level.service.mapper.MemberLevelMapper; |
| 9 | import com.topdraw.utils.PageUtil; | 9 | import com.topdraw.utils.PageUtil; |
| 10 | import com.topdraw.utils.QueryHelp; | 10 | import com.topdraw.utils.QueryHelp; |
| 11 | import com.topdraw.utils.StringUtils; | 11 | import com.topdraw.utils.StringUtils; | ... | ... |
| 1 | package com.topdraw.business.basicdata.member.level.service.mapper; | 1 | package com.topdraw.business.module.member.level.service.mapper; |
| 2 | 2 | ||
| 3 | import com.topdraw.base.BaseMapper; | 3 | import com.topdraw.base.BaseMapper; |
| 4 | import com.topdraw.business.basicdata.member.level.domain.MemberLevel; | 4 | import com.topdraw.business.module.member.level.domain.MemberLevel; |
| 5 | import com.topdraw.business.basicdata.member.level.service.dto.MemberLevelDTO; | 5 | import com.topdraw.business.module.member.level.service.dto.MemberLevelDTO; |
| 6 | import org.mapstruct.Mapper; | 6 | import org.mapstruct.Mapper; |
| 7 | import org.mapstruct.ReportingPolicy; | 7 | import org.mapstruct.ReportingPolicy; |
| 8 | 8 | ... | ... |
| 1 | package com.topdraw.business.basicdata.member.profile.domain; | 1 | package com.topdraw.business.module.member.profile.domain; |
| 2 | 2 | ||
| 3 | import cn.hutool.core.bean.BeanUtil; | 3 | import cn.hutool.core.bean.BeanUtil; |
| 4 | import cn.hutool.core.bean.copier.CopyOptions; | 4 | import cn.hutool.core.bean.copier.CopyOptions; | ... | ... |
| 1 | package com.topdraw.business.basicdata.member.profile.repository; | 1 | package com.topdraw.business.module.member.profile.repository; |
| 2 | 2 | ||
| 3 | import com.topdraw.business.basicdata.member.profile.domain.MemberProfile; | 3 | import com.topdraw.business.module.member.profile.domain.MemberProfile; |
| 4 | import org.springframework.data.jpa.repository.JpaRepository; | 4 | import org.springframework.data.jpa.repository.JpaRepository; |
| 5 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; | 5 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; |
| 6 | 6 | ||
| 7 | import java.util.Optional; | ||
| 8 | |||
| 7 | /** | 9 | /** |
| 8 | * @author XiangHan | 10 | * @author XiangHan |
| 9 | * @date 2021-10-22 | 11 | * @date 2021-10-22 | ... | ... |
| 1 | package com.topdraw.business.basicdata.member.profile.rest; | 1 | package com.topdraw.business.module.member.profile.rest; |
| 2 | 2 | ||
| 3 | import com.topdraw.annotation.Log; | 3 | import com.topdraw.business.module.member.profile.domain.MemberProfile; |
| 4 | import com.topdraw.business.basicdata.member.profile.domain.MemberProfile; | 4 | import com.topdraw.business.module.member.profile.service.MemberProfileService; |
| 5 | import com.topdraw.business.basicdata.member.profile.service.MemberProfileService; | 5 | import com.topdraw.business.module.member.profile.service.dto.MemberProfileQueryCriteria; |
| 6 | import com.topdraw.business.basicdata.member.profile.service.dto.MemberProfileQueryCriteria; | ||
| 7 | import com.topdraw.common.ResultInfo; | 6 | import com.topdraw.common.ResultInfo; |
| 8 | import io.swagger.annotations.Api; | 7 | import io.swagger.annotations.Api; |
| 9 | import io.swagger.annotations.ApiOperation; | 8 | import io.swagger.annotations.ApiOperation; |
| ... | @@ -36,7 +35,6 @@ public class MemberProfileController { | ... | @@ -36,7 +35,6 @@ public class MemberProfileController { |
| 36 | return ResultInfo.success(MemberProfileService.queryAll(criteria)); | 35 | return ResultInfo.success(MemberProfileService.queryAll(criteria)); |
| 37 | } | 36 | } |
| 38 | 37 | ||
| 39 | @Log | ||
| 40 | @PostMapping | 38 | @PostMapping |
| 41 | @ApiOperation("新增MemberProfile") | 39 | @ApiOperation("新增MemberProfile") |
| 42 | public ResultInfo create(@Validated @RequestBody MemberProfile resources) { | 40 | public ResultInfo create(@Validated @RequestBody MemberProfile resources) { |
| ... | @@ -44,7 +42,6 @@ public class MemberProfileController { | ... | @@ -44,7 +42,6 @@ public class MemberProfileController { |
| 44 | return ResultInfo.success(); | 42 | return ResultInfo.success(); |
| 45 | } | 43 | } |
| 46 | 44 | ||
| 47 | @Log | ||
| 48 | @PutMapping | 45 | @PutMapping |
| 49 | @ApiOperation("修改MemberProfile") | 46 | @ApiOperation("修改MemberProfile") |
| 50 | public ResultInfo update(@Validated @RequestBody MemberProfile resources) { | 47 | public ResultInfo update(@Validated @RequestBody MemberProfile resources) { |
| ... | @@ -52,8 +49,6 @@ public class MemberProfileController { | ... | @@ -52,8 +49,6 @@ public class MemberProfileController { |
| 52 | return ResultInfo.success(); | 49 | return ResultInfo.success(); |
| 53 | } | 50 | } |
| 54 | 51 | ||
| 55 | |||
| 56 | @Log | ||
| 57 | @DeleteMapping(value = "/{id}") | 52 | @DeleteMapping(value = "/{id}") |
| 58 | @ApiOperation("删除MemberProfile") | 53 | @ApiOperation("删除MemberProfile") |
| 59 | public ResultInfo delete(@PathVariable Long id) { | 54 | public ResultInfo delete(@PathVariable Long id) { | ... | ... |
| 1 | package com.topdraw.business.basicdata.member.profile.service; | 1 | package com.topdraw.business.module.member.profile.service; |
| 2 | 2 | ||
| 3 | import com.topdraw.business.basicdata.member.profile.domain.MemberProfile; | 3 | import com.topdraw.business.module.member.profile.domain.MemberProfile; |
| 4 | import com.topdraw.business.basicdata.member.profile.service.dto.MemberProfileDTO; | 4 | import com.topdraw.business.module.member.profile.service.dto.MemberProfileDTO; |
| 5 | import com.topdraw.business.basicdata.member.profile.service.dto.MemberProfileQueryCriteria; | 5 | import com.topdraw.business.module.member.profile.service.dto.MemberProfileQueryCriteria; |
| 6 | import org.springframework.data.domain.Pageable; | 6 | import org.springframework.data.domain.Pageable; |
| 7 | 7 | ||
| 8 | import java.util.List; | 8 | import java.util.List; |
| ... | @@ -36,7 +36,7 @@ public interface MemberProfileService { | ... | @@ -36,7 +36,7 @@ public interface MemberProfileService { |
| 36 | */ | 36 | */ |
| 37 | MemberProfileDTO findById(Long id); | 37 | MemberProfileDTO findById(Long id); |
| 38 | 38 | ||
| 39 | void create(MemberProfile resources); | 39 | MemberProfile create(MemberProfile resources); |
| 40 | 40 | ||
| 41 | void update(MemberProfile resources); | 41 | void update(MemberProfile resources); |
| 42 | 42 | ... | ... |
| 1 | package com.topdraw.business.basicdata.member.profile.service.dto; | 1 | package com.topdraw.business.module.member.profile.service.dto; |
| 2 | 2 | ||
| 3 | import lombok.Data; | 3 | import lombok.Data; |
| 4 | 4 | ||
| 5 | import javax.persistence.Column; | ||
| 6 | import java.io.Serializable; | 5 | import java.io.Serializable; |
| 7 | import java.sql.Timestamp; | 6 | import java.sql.Timestamp; |
| 8 | 7 | ... | ... |
| 1 | package com.topdraw.business.basicdata.member.profile.service.impl; | 1 | package com.topdraw.business.module.member.profile.service.impl; |
| 2 | 2 | ||
| 3 | import com.topdraw.business.basicdata.member.profile.domain.MemberProfile; | 3 | import com.topdraw.business.module.member.profile.domain.MemberProfile; |
| 4 | import com.topdraw.business.basicdata.member.profile.repository.MemberProfileRepository; | 4 | import com.topdraw.business.module.member.profile.repository.MemberProfileRepository; |
| 5 | import com.topdraw.business.basicdata.member.profile.service.MemberProfileService; | 5 | import com.topdraw.business.module.member.profile.service.MemberProfileService; |
| 6 | import com.topdraw.business.basicdata.member.profile.service.dto.MemberProfileDTO; | 6 | import com.topdraw.business.module.member.profile.service.dto.MemberProfileDTO; |
| 7 | import com.topdraw.business.basicdata.member.profile.service.dto.MemberProfileQueryCriteria; | 7 | import com.topdraw.business.module.member.profile.service.dto.MemberProfileQueryCriteria; |
| 8 | import com.topdraw.business.basicdata.member.profile.service.mapper.MemberProfileMapper; | 8 | import com.topdraw.business.module.member.profile.service.mapper.MemberProfileMapper; |
| 9 | import com.topdraw.business.basicdata.member.service.MemberService; | 9 | import com.topdraw.business.module.member.service.MemberService; |
| 10 | import com.topdraw.business.basicdata.member.service.dto.MemberDTO; | 10 | import com.topdraw.business.module.member.service.dto.MemberDTO; |
| 11 | import com.topdraw.utils.PageUtil; | 11 | import com.topdraw.utils.PageUtil; |
| 12 | import com.topdraw.utils.QueryHelp; | 12 | import com.topdraw.utils.QueryHelp; |
| 13 | import com.topdraw.utils.StringUtils; | 13 | import com.topdraw.utils.StringUtils; |
| ... | @@ -61,7 +61,7 @@ public class MemberProfileServiceImpl implements MemberProfileService { | ... | @@ -61,7 +61,7 @@ public class MemberProfileServiceImpl implements MemberProfileService { |
| 61 | 61 | ||
| 62 | @Override | 62 | @Override |
| 63 | @Transactional(rollbackFor = Exception.class) | 63 | @Transactional(rollbackFor = Exception.class) |
| 64 | public void create(MemberProfile resources) { | 64 | public MemberProfile create(MemberProfile resources) { |
| 65 | String memberCode = resources.getMemberCode(); | 65 | String memberCode = resources.getMemberCode(); |
| 66 | MemberDTO memberDTO = this.memberService.getByCode(memberCode); | 66 | MemberDTO memberDTO = this.memberService.getByCode(memberCode); |
| 67 | if (Objects.nonNull(memberDTO)) { | 67 | if (Objects.nonNull(memberDTO)) { |
| ... | @@ -73,6 +73,8 @@ public class MemberProfileServiceImpl implements MemberProfileService { | ... | @@ -73,6 +73,8 @@ public class MemberProfileServiceImpl implements MemberProfileService { |
| 73 | MemberProfileRepository.save(resources); | 73 | MemberProfileRepository.save(resources); |
| 74 | } | 74 | } |
| 75 | } | 75 | } |
| 76 | |||
| 77 | return resources; | ||
| 76 | } | 78 | } |
| 77 | 79 | ||
| 78 | @Override | 80 | @Override | ... | ... |
| 1 | package com.topdraw.business.basicdata.member.profile.service.mapper; | 1 | package com.topdraw.business.module.member.profile.service.mapper; |
| 2 | 2 | ||
| 3 | import com.topdraw.base.BaseMapper; | 3 | import com.topdraw.base.BaseMapper; |
| 4 | import com.topdraw.business.basicdata.member.profile.domain.MemberProfile; | 4 | import com.topdraw.business.module.member.profile.domain.MemberProfile; |
| 5 | import com.topdraw.business.basicdata.member.profile.service.dto.MemberProfileDTO; | 5 | import com.topdraw.business.module.member.profile.service.dto.MemberProfileDTO; |
| 6 | import org.mapstruct.Mapper; | 6 | import org.mapstruct.Mapper; |
| 7 | import org.mapstruct.ReportingPolicy; | 7 | import org.mapstruct.ReportingPolicy; |
| 8 | 8 | ... | ... |
| 1 | package com.topdraw.business.basicdata.member.relatedinfo.domain; | 1 | package com.topdraw.business.module.member.relatedinfo.domain; |
| 2 | 2 | ||
| 3 | import cn.hutool.core.bean.BeanUtil; | 3 | import cn.hutool.core.bean.BeanUtil; |
| 4 | import cn.hutool.core.bean.copier.CopyOptions; | 4 | import cn.hutool.core.bean.copier.CopyOptions; | ... | ... |
| 1 | package com.topdraw.business.basicdata.member.relatedinfo.repository; | 1 | package com.topdraw.business.module.member.relatedinfo.repository; |
| 2 | 2 | ||
| 3 | import com.topdraw.business.basicdata.member.relatedinfo.domain.MemberRelatedInfo; | 3 | import com.topdraw.business.module.member.relatedinfo.domain.MemberRelatedInfo; |
| 4 | import com.topdraw.business.basicdata.member.relatedinfo.service.dto.MemberRelatedInfoDTO; | ||
| 5 | import org.springframework.data.jpa.repository.JpaRepository; | 4 | import org.springframework.data.jpa.repository.JpaRepository; |
| 6 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; | 5 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; |
| 7 | 6 | ||
| 8 | import java.util.List; | 7 | import java.util.List; |
| 9 | import java.util.Optional; | ||
| 10 | 8 | ||
| 11 | /** | 9 | /** |
| 12 | * @author XiangHan | 10 | * @author XiangHan | ... | ... |
| 1 | package com.topdraw.business.basicdata.member.relatedinfo.rest; | 1 | package com.topdraw.business.module.member.relatedinfo.rest; |
| 2 | 2 | ||
| 3 | import com.topdraw.annotation.Log; | 3 | import com.topdraw.business.module.member.relatedinfo.domain.MemberRelatedInfo; |
| 4 | import com.topdraw.business.basicdata.member.relatedinfo.domain.MemberRelatedInfo; | 4 | import com.topdraw.business.module.member.relatedinfo.service.MemberRelatedInfoService; |
| 5 | import com.topdraw.business.basicdata.member.relatedinfo.service.MemberRelatedInfoService; | 5 | import com.topdraw.business.module.member.relatedinfo.service.dto.MemberRelatedInfoQueryCriteria; |
| 6 | import com.topdraw.business.basicdata.member.relatedinfo.service.dto.MemberRelatedInfoQueryCriteria; | ||
| 7 | import com.topdraw.common.ResultInfo; | 6 | import com.topdraw.common.ResultInfo; |
| 8 | import io.swagger.annotations.Api; | 7 | import io.swagger.annotations.Api; |
| 9 | import io.swagger.annotations.ApiOperation; | 8 | import io.swagger.annotations.ApiOperation; |
| ... | @@ -30,7 +29,6 @@ public class MemberRelatedInfoController { | ... | @@ -30,7 +29,6 @@ public class MemberRelatedInfoController { |
| 30 | return ResultInfo.successPage(MemberRelatedInfoService.queryAll(criteria,pageable)); | 29 | return ResultInfo.successPage(MemberRelatedInfoService.queryAll(criteria,pageable)); |
| 31 | } | 30 | } |
| 32 | 31 | ||
| 33 | @Log | ||
| 34 | @PostMapping(value = "/create") | 32 | @PostMapping(value = "/create") |
| 35 | @ApiOperation("新增MemberRelatedInfo") | 33 | @ApiOperation("新增MemberRelatedInfo") |
| 36 | public ResultInfo create(@Validated @RequestBody MemberRelatedInfo resources) { | 34 | public ResultInfo create(@Validated @RequestBody MemberRelatedInfo resources) { |
| ... | @@ -38,7 +36,6 @@ public class MemberRelatedInfoController { | ... | @@ -38,7 +36,6 @@ public class MemberRelatedInfoController { |
| 38 | return ResultInfo.success(); | 36 | return ResultInfo.success(); |
| 39 | } | 37 | } |
| 40 | 38 | ||
| 41 | @Log | ||
| 42 | @PutMapping(value = "/update") | 39 | @PutMapping(value = "/update") |
| 43 | @ApiOperation("修改MemberRelatedInfo") | 40 | @ApiOperation("修改MemberRelatedInfo") |
| 44 | public ResultInfo update(@Validated @RequestBody MemberRelatedInfo resources) { | 41 | public ResultInfo update(@Validated @RequestBody MemberRelatedInfo resources) { |
| ... | @@ -52,7 +49,6 @@ public class MemberRelatedInfoController { | ... | @@ -52,7 +49,6 @@ public class MemberRelatedInfoController { |
| 52 | return ResultInfo.success(MemberRelatedInfoService.findById(id)); | 49 | return ResultInfo.success(MemberRelatedInfoService.findById(id)); |
| 53 | } | 50 | } |
| 54 | 51 | ||
| 55 | @Log | ||
| 56 | @DeleteMapping(value = "/delete//{id}") | 52 | @DeleteMapping(value = "/delete//{id}") |
| 57 | @ApiOperation("删除MemberRelatedInfo") | 53 | @ApiOperation("删除MemberRelatedInfo") |
| 58 | public ResultInfo delete(@PathVariable Long id) { | 54 | public ResultInfo delete(@PathVariable Long id) { | ... | ... |
| 1 | package com.topdraw.business.basicdata.member.relatedinfo.service; | 1 | package com.topdraw.business.module.member.relatedinfo.service; |
| 2 | 2 | ||
| 3 | import com.topdraw.business.basicdata.member.relatedinfo.domain.MemberRelatedInfo; | 3 | import com.topdraw.business.module.member.relatedinfo.domain.MemberRelatedInfo; |
| 4 | import com.topdraw.business.basicdata.member.relatedinfo.service.dto.MemberRelatedInfoDTO; | 4 | import com.topdraw.business.module.member.relatedinfo.service.dto.MemberRelatedInfoDTO; |
| 5 | import com.topdraw.business.basicdata.member.relatedinfo.service.dto.MemberRelatedInfoQueryCriteria; | 5 | import com.topdraw.business.module.member.relatedinfo.service.dto.MemberRelatedInfoQueryCriteria; |
| 6 | import org.springframework.data.domain.Pageable; | 6 | import org.springframework.data.domain.Pageable; |
| 7 | 7 | ||
| 8 | import java.util.List; | 8 | import java.util.List; | ... | ... |
| 1 | package com.topdraw.business.basicdata.member.relatedinfo.service.impl; | 1 | package com.topdraw.business.module.member.relatedinfo.service.impl; |
| 2 | 2 | ||
| 3 | import com.topdraw.business.basicdata.member.relatedinfo.domain.MemberRelatedInfo; | 3 | import com.topdraw.business.module.member.relatedinfo.domain.MemberRelatedInfo; |
| 4 | import com.topdraw.business.basicdata.member.relatedinfo.repository.MemberRelatedInfoRepository; | 4 | import com.topdraw.business.module.member.relatedinfo.repository.MemberRelatedInfoRepository; |
| 5 | import com.topdraw.business.basicdata.member.relatedinfo.service.MemberRelatedInfoService; | 5 | import com.topdraw.business.module.member.relatedinfo.service.MemberRelatedInfoService; |
| 6 | import com.topdraw.business.basicdata.member.relatedinfo.service.dto.MemberRelatedInfoDTO; | 6 | import com.topdraw.business.module.member.relatedinfo.service.dto.MemberRelatedInfoDTO; |
| 7 | import com.topdraw.business.basicdata.member.relatedinfo.service.dto.MemberRelatedInfoQueryCriteria; | 7 | import com.topdraw.business.module.member.relatedinfo.service.dto.MemberRelatedInfoQueryCriteria; |
| 8 | import com.topdraw.business.basicdata.member.relatedinfo.service.mapper.MemberRelatedInfoMapper; | 8 | import com.topdraw.business.module.member.relatedinfo.service.mapper.MemberRelatedInfoMapper; |
| 9 | import com.topdraw.business.basicdata.member.service.MemberService; | 9 | import com.topdraw.business.module.member.service.MemberService; |
| 10 | import com.topdraw.business.basicdata.member.service.dto.MemberDTO; | 10 | import com.topdraw.business.module.member.service.dto.MemberDTO; |
| 11 | import com.topdraw.utils.PageUtil; | 11 | import com.topdraw.utils.PageUtil; |
| 12 | import com.topdraw.utils.QueryHelp; | 12 | import com.topdraw.utils.QueryHelp; |
| 13 | import com.topdraw.utils.ValidationUtil; | 13 | import com.topdraw.utils.ValidationUtil; |
| ... | @@ -24,7 +24,6 @@ import org.springframework.util.CollectionUtils; | ... | @@ -24,7 +24,6 @@ import org.springframework.util.CollectionUtils; |
| 24 | import java.util.List; | 24 | import java.util.List; |
| 25 | import java.util.Map; | 25 | import java.util.Map; |
| 26 | import java.util.Objects; | 26 | import java.util.Objects; |
| 27 | import java.util.Optional; | ||
| 28 | 27 | ||
| 29 | /** | 28 | /** |
| 30 | * @author XiangHan | 29 | * @author XiangHan | ... | ... |
| 1 | package com.topdraw.business.basicdata.member.relatedinfo.service.mapper; | 1 | package com.topdraw.business.module.member.relatedinfo.service.mapper; |
| 2 | 2 | ||
| 3 | import com.topdraw.base.BaseMapper; | 3 | import com.topdraw.base.BaseMapper; |
| 4 | import com.topdraw.business.basicdata.member.relatedinfo.domain.MemberRelatedInfo; | 4 | import com.topdraw.business.module.member.relatedinfo.domain.MemberRelatedInfo; |
| 5 | import com.topdraw.business.basicdata.member.relatedinfo.service.dto.MemberRelatedInfoDTO; | 5 | import com.topdraw.business.module.member.relatedinfo.service.dto.MemberRelatedInfoDTO; |
| 6 | import org.mapstruct.Mapper; | 6 | import org.mapstruct.Mapper; |
| 7 | import org.mapstruct.ReportingPolicy; | 7 | import org.mapstruct.ReportingPolicy; |
| 8 | 8 | ... | ... |
| 1 | package com.topdraw.business.basicdata.member.repository; | 1 | package com.topdraw.business.module.member.repository; |
| 2 | 2 | ||
| 3 | import com.topdraw.business.basicdata.member.domain.Member; | 3 | import com.topdraw.business.module.member.domain.Member; |
| 4 | import org.springframework.data.jpa.repository.JpaRepository; | 4 | import org.springframework.data.jpa.repository.JpaRepository; |
| 5 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; | 5 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; |
| 6 | import org.springframework.data.jpa.repository.Modifying; | 6 | import org.springframework.data.jpa.repository.Modifying; | ... | ... |
| 1 | package com.topdraw.business.basicdata.member.rest; | 1 | package com.topdraw.business.module.member.rest; |
| 2 | 2 | ||
| 3 | import com.topdraw.annotation.Log; | 3 | import com.topdraw.business.module.member.domain.Member; |
| 4 | import com.topdraw.business.basicdata.member.domain.Member; | 4 | import com.topdraw.business.module.member.service.MemberService; |
| 5 | import com.topdraw.business.basicdata.member.service.MemberService; | 5 | import com.topdraw.business.module.member.service.dto.MemberQueryCriteria; |
| 6 | import com.topdraw.business.basicdata.member.service.dto.MemberQueryCriteria; | ||
| 7 | import com.topdraw.common.ResultInfo; | 6 | import com.topdraw.common.ResultInfo; |
| 8 | import io.swagger.annotations.Api; | 7 | import io.swagger.annotations.Api; |
| 9 | import io.swagger.annotations.ApiOperation; | 8 | import io.swagger.annotations.ApiOperation; |
| ... | @@ -36,7 +35,6 @@ public class MemberController { | ... | @@ -36,7 +35,6 @@ public class MemberController { |
| 36 | return ResultInfo.success(memberService.findById(id)); | 35 | return ResultInfo.success(memberService.findById(id)); |
| 37 | } | 36 | } |
| 38 | 37 | ||
| 39 | @Log | ||
| 40 | @PostMapping(value = "/create") | 38 | @PostMapping(value = "/create") |
| 41 | @ApiOperation("新增Member") | 39 | @ApiOperation("新增Member") |
| 42 | public ResultInfo create(@Validated @RequestBody Member resources) { | 40 | public ResultInfo create(@Validated @RequestBody Member resources) { |
| ... | @@ -44,7 +42,6 @@ public class MemberController { | ... | @@ -44,7 +42,6 @@ public class MemberController { |
| 44 | return ResultInfo.success(); | 42 | return ResultInfo.success(); |
| 45 | } | 43 | } |
| 46 | 44 | ||
| 47 | @Log | ||
| 48 | @PutMapping(value = "/update") | 45 | @PutMapping(value = "/update") |
| 49 | @ApiOperation("修改Member") | 46 | @ApiOperation("修改Member") |
| 50 | public ResultInfo update(@Validated @RequestBody Member resources) { | 47 | public ResultInfo update(@Validated @RequestBody Member resources) { | ... | ... |
| 1 | package com.topdraw.business.basicdata.member.service; | 1 | package com.topdraw.business.module.member.service; |
| 2 | 2 | ||
| 3 | import com.topdraw.business.basicdata.member.domain.Member; | 3 | import com.topdraw.business.module.member.domain.Member; |
| 4 | import com.topdraw.business.basicdata.member.service.dto.MemberDTO; | 4 | import com.topdraw.business.module.member.service.dto.MemberDTO; |
| 5 | import com.topdraw.business.basicdata.member.service.dto.MemberQueryCriteria; | 5 | import com.topdraw.business.module.member.service.dto.MemberQueryCriteria; |
| 6 | import com.topdraw.business.basicdata.user.iptv.domain.UserTv; | 6 | import com.topdraw.business.module.user.iptv.domain.UserTv; |
| 7 | import org.springframework.data.domain.Pageable; | 7 | import org.springframework.data.domain.Pageable; |
| 8 | import org.springframework.transaction.annotation.Transactional; | ||
| 8 | 9 | ||
| 9 | import java.util.List; | 10 | import java.util.List; |
| 10 | import java.util.Map; | 11 | import java.util.Map; |
| ... | @@ -39,6 +40,8 @@ public interface MemberService { | ... | @@ -39,6 +40,8 @@ public interface MemberService { |
| 39 | 40 | ||
| 40 | Long create(Member resources); | 41 | Long create(Member resources); |
| 41 | 42 | ||
| 43 | void unbind(Member resources); | ||
| 44 | |||
| 42 | void update(Member resources); | 45 | void update(Member resources); |
| 43 | 46 | ||
| 44 | void delete(Long id); | 47 | void delete(Long id); |
| ... | @@ -53,4 +56,6 @@ public interface MemberService { | ... | @@ -53,4 +56,6 @@ public interface MemberService { |
| 53 | boolean createMemberByUserTv(UserTv resources); | 56 | boolean createMemberByUserTv(UserTv resources); |
| 54 | 57 | ||
| 55 | void doUpdateMemberPoints(Member member); | 58 | void doUpdateMemberPoints(Member member); |
| 59 | |||
| 60 | Member createAndReturnMember(Member resources); | ||
| 56 | } | 61 | } | ... | ... |
| 1 | package com.topdraw.business.basicdata.member.service.dto; | 1 | package com.topdraw.business.module.member.service.dto; |
| 2 | 2 | ||
| 3 | import lombok.Data; | 3 | import lombok.Data; |
| 4 | 4 | ||
| ... | @@ -78,13 +78,13 @@ public class MemberDTO implements Serializable { | ... | @@ -78,13 +78,13 @@ public class MemberDTO implements Serializable { |
| 78 | private Integer bindIptvPlatformType; | 78 | private Integer bindIptvPlatformType; |
| 79 | 79 | ||
| 80 | // iptv账号绑定时间 | 80 | // iptv账号绑定时间 |
| 81 | private Timestamp bindIptvTime; | 81 | private LocalDateTime bindIptvTime; |
| 82 | 82 | ||
| 83 | // 创建时间 | 83 | // 创建时间 |
| 84 | private Timestamp createTime; | 84 | private LocalDateTime createTime; |
| 85 | 85 | ||
| 86 | // 更新时间 | 86 | // 更新时间 |
| 87 | private Timestamp updateTime; | 87 | private LocalDateTime updateTime; |
| 88 | 88 | ||
| 89 | // 是否在黑名单 1:是;0否 | 89 | // 是否在黑名单 1:是;0否 |
| 90 | // private Integer blackStatus; | 90 | // private Integer blackStatus; | ... | ... |
| 1 | package com.topdraw.business.basicdata.member.service.impl; | 1 | package com.topdraw.business.module.member.service.impl; |
| 2 | 2 | ||
| 3 | import com.topdraw.business.basicdata.member.domain.Member; | 3 | import com.topdraw.business.module.member.domain.Member; |
| 4 | import com.topdraw.business.basicdata.member.repository.MemberRepository; | 4 | import com.topdraw.business.module.member.repository.MemberRepository; |
| 5 | import com.topdraw.business.basicdata.member.service.MemberService; | 5 | import com.topdraw.business.module.member.service.MemberService; |
| 6 | import com.topdraw.business.basicdata.member.service.dto.MemberDTO; | 6 | import com.topdraw.business.module.member.service.dto.MemberDTO; |
| 7 | import com.topdraw.business.basicdata.member.service.dto.MemberQueryCriteria; | 7 | import com.topdraw.business.module.member.service.dto.MemberQueryCriteria; |
| 8 | import com.topdraw.business.basicdata.member.service.mapper.MemberMapper; | 8 | import com.topdraw.business.module.member.service.mapper.MemberMapper; |
| 9 | import com.topdraw.business.basicdata.user.iptv.domain.UserTv; | 9 | import com.topdraw.business.module.user.iptv.domain.UserTv; |
| 10 | import com.topdraw.business.basicdata.user.iptv.service.UserTvService; | 10 | import com.topdraw.business.module.user.iptv.service.dto.UserTvDTO; |
| 11 | import com.topdraw.business.basicdata.user.iptv.service.dto.UserTvDTO; | ||
| 12 | import com.topdraw.config.LocalConstants; | 11 | import com.topdraw.config.LocalConstants; |
| 13 | import com.topdraw.util.IdWorker; | 12 | import com.topdraw.util.IdWorker; |
| 14 | import com.topdraw.util.RedissonUtil; | 13 | import com.topdraw.util.RedissonUtil; |
| ... | @@ -22,6 +21,7 @@ import org.redisson.api.RLock; | ... | @@ -22,6 +21,7 @@ import org.redisson.api.RLock; |
| 22 | import org.redisson.api.RedissonClient; | 21 | import org.redisson.api.RedissonClient; |
| 23 | import org.springframework.beans.BeanUtils; | 22 | import org.springframework.beans.BeanUtils; |
| 24 | import org.springframework.beans.factory.annotation.Autowired; | 23 | import org.springframework.beans.factory.annotation.Autowired; |
| 24 | import org.springframework.context.annotation.Bean; | ||
| 25 | import org.springframework.dao.EmptyResultDataAccessException; | 25 | import org.springframework.dao.EmptyResultDataAccessException; |
| 26 | import org.springframework.data.domain.Page; | 26 | import org.springframework.data.domain.Page; |
| 27 | import org.springframework.data.domain.Pageable; | 27 | import org.springframework.data.domain.Pageable; |
| ... | @@ -30,6 +30,7 @@ import org.springframework.transaction.annotation.Propagation; | ... | @@ -30,6 +30,7 @@ import org.springframework.transaction.annotation.Propagation; |
| 30 | import org.springframework.transaction.annotation.Transactional; | 30 | import org.springframework.transaction.annotation.Transactional; |
| 31 | import org.springframework.util.Assert; | 31 | import org.springframework.util.Assert; |
| 32 | 32 | ||
| 33 | import java.time.LocalDateTime; | ||
| 33 | import java.util.List; | 34 | import java.util.List; |
| 34 | import java.util.Map; | 35 | import java.util.Map; |
| 35 | import java.util.Objects; | 36 | import java.util.Objects; |
| ... | @@ -50,7 +51,7 @@ public class MemberServiceImpl implements MemberService { | ... | @@ -50,7 +51,7 @@ public class MemberServiceImpl implements MemberService { |
| 50 | private MemberMapper memberMapper; | 51 | private MemberMapper memberMapper; |
| 51 | 52 | ||
| 52 | @Autowired | 53 | @Autowired |
| 53 | private com.topdraw.business.basicdata.user.iptv.service.UserTvService UserTvService; | 54 | private com.topdraw.business.module.user.iptv.service.UserTvService UserTvService; |
| 54 | 55 | ||
| 55 | @Autowired | 56 | @Autowired |
| 56 | private RedissonClient redissonClient; | 57 | private RedissonClient redissonClient; |
| ... | @@ -105,14 +106,31 @@ public class MemberServiceImpl implements MemberService { | ... | @@ -105,14 +106,31 @@ public class MemberServiceImpl implements MemberService { |
| 105 | return member; | 106 | return member; |
| 106 | } | 107 | } |
| 107 | 108 | ||
| 109 | @Override | ||
| 110 | @Transactional(rollbackFor = Exception.class) | ||
| 111 | public void unbind(Member resources) { | ||
| 112 | try { | ||
| 113 | String code = resources.getCode(); | ||
| 114 | MemberDTO memberDTO = this.getByCode(code); | ||
| 115 | // Member member = memberRepository.findById(resources.getId()).orElseGet(Member::new); | ||
| 116 | ValidationUtil.isNull(memberDTO.getId(), "Member", "id", resources.getId()); | ||
| 117 | Member member = new Member(); | ||
| 118 | BeanUtils.copyProperties(memberDTO,member); | ||
| 108 | 119 | ||
| 120 | member.setUserIptvId(null); | ||
| 121 | member.setBindIptvTime(null); | ||
| 122 | member.setBindIptvPlatformType(null); | ||
| 123 | this.save(member); | ||
| 124 | } catch (Exception e) { | ||
| 125 | e.printStackTrace(); | ||
| 126 | throw e; | ||
| 127 | } | ||
| 128 | } | ||
| 109 | 129 | ||
| 110 | @Override | 130 | @Override |
| 111 | @Transactional(rollbackFor = Exception.class) | 131 | @Transactional(rollbackFor = Exception.class) |
| 112 | public void update(Member resources) { | 132 | public void update(Member resources) { |
| 113 | RLock rLock = this.redissonClient.getLock("Member::update::code" + resources.getCode()); | ||
| 114 | try { | 133 | try { |
| 115 | RedissonUtil.lock(rLock); | ||
| 116 | Member member = memberRepository.findByCode(resources.getCode()).orElseGet(Member::new); | 134 | Member member = memberRepository.findByCode(resources.getCode()).orElseGet(Member::new); |
| 117 | ValidationUtil.isNull( member.getId(),"Member","id",member.getId()); | 135 | ValidationUtil.isNull( member.getId(),"Member","id",member.getId()); |
| 118 | if (Objects.nonNull(member)) { | 136 | if (Objects.nonNull(member)) { |
| ... | @@ -121,21 +139,24 @@ public class MemberServiceImpl implements MemberService { | ... | @@ -121,21 +139,24 @@ public class MemberServiceImpl implements MemberService { |
| 121 | 139 | ||
| 122 | String platformAccount = resources.getPlatformAccount(); | 140 | String platformAccount = resources.getPlatformAccount(); |
| 123 | if (StringUtils.isNotEmpty(platformAccount)) { | 141 | if (StringUtils.isNotEmpty(platformAccount)) { |
| 142 | resources.setUserIptvId(null); | ||
| 143 | |||
| 124 | UserTvDTO userTvDTO = this.UserTvService.findByPlatformAccount(platformAccount); | 144 | UserTvDTO userTvDTO = this.UserTvService.findByPlatformAccount(platformAccount); |
| 125 | if (Objects.nonNull(userTvDTO)) { | 145 | if (Objects.nonNull(userTvDTO)) { |
| 126 | Long userIptvId = userTvDTO.getId(); | 146 | Long userIptvId = userTvDTO.getId(); |
| 127 | resources.setUserIptvId(userIptvId); | 147 | resources.setUserIptvId(userIptvId); |
| 148 | resources.setBindIptvPlatformType(1); | ||
| 149 | resources.setBindIptvTime(LocalDateTime.now()); | ||
| 128 | } | 150 | } |
| 129 | } | 151 | } |
| 130 | } | 152 | } |
| 131 | 153 | ||
| 132 | member.copy(resources); | 154 | member.copy(resources); |
| 155 | log.info("memberService ==>> update ==>> [{}]",member); | ||
| 133 | memberRepository.save(member); | 156 | memberRepository.save(member); |
| 134 | } catch (Exception e) { | 157 | } catch (Exception e) { |
| 135 | e.printStackTrace(); | 158 | e.printStackTrace(); |
| 136 | throw e; | 159 | throw e; |
| 137 | } finally { | ||
| 138 | RedissonUtil.unlock(rLock); | ||
| 139 | } | 160 | } |
| 140 | } | 161 | } |
| 141 | 162 | ||
| ... | @@ -186,7 +207,7 @@ public class MemberServiceImpl implements MemberService { | ... | @@ -186,7 +207,7 @@ public class MemberServiceImpl implements MemberService { |
| 186 | if (Objects.nonNull(userIptvId)) { | 207 | if (Objects.nonNull(userIptvId)) { |
| 187 | member.setId(memberId); | 208 | member.setId(memberId); |
| 188 | member.setUserIptvId(userIptvId); | 209 | member.setUserIptvId(userIptvId); |
| 189 | member.setBindIptvTime(TimestampUtil.now()); | 210 | member.setBindIptvTime(LocalDateTime.now()); |
| 190 | this.bindIptvId(member); | 211 | this.bindIptvId(member); |
| 191 | } | 212 | } |
| 192 | } | 213 | } |
| ... | @@ -216,10 +237,17 @@ public class MemberServiceImpl implements MemberService { | ... | @@ -216,10 +237,17 @@ public class MemberServiceImpl implements MemberService { |
| 216 | } | 237 | } |
| 217 | } | 238 | } |
| 218 | 239 | ||
| 219 | private void save(Member member){ | 240 | @Override |
| 241 | @Transactional(rollbackFor = Exception.class) | ||
| 242 | public Member createAndReturnMember(Member resources) { | ||
| 243 | Member member = this.checkMemberData(resources); | ||
| 220 | memberRepository.save(member); | 244 | memberRepository.save(member); |
| 245 | return resources; | ||
| 221 | } | 246 | } |
| 222 | 247 | ||
| 248 | private void save(Member member){ | ||
| 249 | memberRepository.save(member); | ||
| 250 | } | ||
| 223 | 251 | ||
| 224 | public void bindIptvId(Member resources) { | 252 | public void bindIptvId(Member resources) { |
| 225 | RLock rLock = this.redissonClient.getLock("Member::update::code::" + resources.getCode()); | 253 | RLock rLock = this.redissonClient.getLock("Member::update::code::" + resources.getCode()); | ... | ... |
| 1 | package com.topdraw.business.basicdata.member.service.mapper; | 1 | package com.topdraw.business.module.member.service.mapper; |
| 2 | 2 | ||
| 3 | import com.topdraw.base.BaseMapper; | 3 | import com.topdraw.base.BaseMapper; |
| 4 | import com.topdraw.business.basicdata.member.domain.Member; | 4 | import com.topdraw.business.module.member.domain.Member; |
| 5 | import com.topdraw.business.basicdata.member.service.dto.MemberDTO; | 5 | import com.topdraw.business.module.member.service.dto.MemberDTO; |
| 6 | import org.mapstruct.Mapper; | 6 | import org.mapstruct.Mapper; |
| 7 | import org.mapstruct.ReportingPolicy; | 7 | import org.mapstruct.ReportingPolicy; |
| 8 | 8 | ... | ... |
| 1 | package com.topdraw.business.module.member.viphistory.domain; | ||
| 2 | |||
| 3 | import cn.hutool.core.bean.BeanUtil; | ||
| 4 | import cn.hutool.core.bean.copier.CopyOptions; | ||
| 5 | import lombok.Data; | ||
| 6 | import lombok.experimental.Accessors; | ||
| 7 | import org.springframework.data.annotation.CreatedDate; | ||
| 8 | import org.springframework.data.annotation.LastModifiedDate; | ||
| 9 | import org.springframework.data.jpa.domain.support.AuditingEntityListener; | ||
| 10 | |||
| 11 | import javax.persistence.*; | ||
| 12 | import java.io.Serializable; | ||
| 13 | import java.sql.Timestamp; | ||
| 14 | import java.time.LocalDateTime; | ||
| 15 | |||
| 16 | /** | ||
| 17 | * @author luerlong | ||
| 18 | * @date 2021-12-10 | ||
| 19 | */ | ||
| 20 | @Entity | ||
| 21 | @Data | ||
| 22 | @EntityListeners(AuditingEntityListener.class) | ||
| 23 | @Accessors(chain = true) | ||
| 24 | @Table(name="uc_member_vip_history") | ||
| 25 | public class MemberVipHistory implements Serializable { | ||
| 26 | |||
| 27 | // 主键 | ||
| 28 | @Id | ||
| 29 | @GeneratedValue(strategy = GenerationType.IDENTITY) | ||
| 30 | @Column(name = "id") | ||
| 31 | private Long id; | ||
| 32 | |||
| 33 | // 会员id | ||
| 34 | @Column(name = "member_id") | ||
| 35 | private Long memberId; | ||
| 36 | |||
| 37 | // 会员vip等级 | ||
| 38 | @Column(name = "vip") | ||
| 39 | private Integer vip; | ||
| 40 | |||
| 41 | // 修改之前vip等级 | ||
| 42 | @Column(name = "before_vip") | ||
| 43 | private Integer beforeVip; | ||
| 44 | |||
| 45 | // vip失效时间 | ||
| 46 | @Column(name = "vip_expire_time") | ||
| 47 | private LocalDateTime vipExpireTime; | ||
| 48 | |||
| 49 | // 状态 1正常 0已过期 | ||
| 50 | @Column(name = "status") | ||
| 51 | private Integer status; | ||
| 52 | |||
| 53 | // 创建时间 | ||
| 54 | @CreatedDate | ||
| 55 | @Column(name = "create_time") | ||
| 56 | private Timestamp createTime; | ||
| 57 | |||
| 58 | // 修改时间 | ||
| 59 | @LastModifiedDate | ||
| 60 | @Column(name = "update_time") | ||
| 61 | private Timestamp updateTime; | ||
| 62 | |||
| 63 | public void copy(MemberVipHistory source){ | ||
| 64 | BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true)); | ||
| 65 | } | ||
| 66 | } |
| 1 | package com.topdraw.business.module.member.viphistory.repository; | ||
| 2 | |||
| 3 | import com.topdraw.business.module.member.viphistory.domain.MemberVipHistory; | ||
| 4 | import org.springframework.data.jpa.repository.JpaRepository; | ||
| 5 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; | ||
| 6 | import org.springframework.data.jpa.repository.Query; | ||
| 7 | |||
| 8 | import java.time.LocalDateTime; | ||
| 9 | import java.util.Optional; | ||
| 10 | |||
| 11 | /** | ||
| 12 | * @author luerlong | ||
| 13 | * @date 2021-12-10 | ||
| 14 | */ | ||
| 15 | public interface MemberVipHistoryRepository extends JpaRepository<MemberVipHistory, Long>, JpaSpecificationExecutor<MemberVipHistory> { | ||
| 16 | |||
| 17 | @Query(value = "SELECT * FROM uc_member_vip_history " + | ||
| 18 | " WHERE vip_expire_time >= ?2 AND member_id = ?1 order by create_time desc limit 1 ", nativeQuery = true) | ||
| 19 | Optional<MemberVipHistory> findByTime(Long memberId, LocalDateTime nowTime); | ||
| 20 | } |
src/main/java/com/topdraw/business/module/member/viphistory/rest/MemberVipHistoryController.java
0 → 100644
| 1 | package com.topdraw.business.module.member.viphistory.rest; | ||
| 2 | |||
| 3 | import com.topdraw.business.module.member.viphistory.domain.MemberVipHistory; | ||
| 4 | import com.topdraw.business.module.member.viphistory.service.MemberVipHistoryService; | ||
| 5 | import com.topdraw.business.module.member.viphistory.service.dto.MemberVipHistoryQueryCriteria; | ||
| 6 | import com.topdraw.common.ResultInfo; | ||
| 7 | import io.swagger.annotations.Api; | ||
| 8 | import io.swagger.annotations.ApiOperation; | ||
| 9 | import org.springframework.beans.factory.annotation.Autowired; | ||
| 10 | import org.springframework.data.domain.Pageable; | ||
| 11 | import org.springframework.validation.annotation.Validated; | ||
| 12 | import org.springframework.web.bind.annotation.*; | ||
| 13 | |||
| 14 | /** | ||
| 15 | * @author luerlong | ||
| 16 | * @date 2021-12-10 | ||
| 17 | */ | ||
| 18 | @Api(tags = "MemberVipHistory管理") | ||
| 19 | @RestController | ||
| 20 | @RequestMapping("/api/memberVipHistory") | ||
| 21 | public class MemberVipHistoryController { | ||
| 22 | |||
| 23 | @Autowired | ||
| 24 | private MemberVipHistoryService memberVipHistoryService; | ||
| 25 | |||
| 26 | @GetMapping | ||
| 27 | @ApiOperation("查询MemberVipHistory") | ||
| 28 | public ResultInfo getMemberVipHistorys(MemberVipHistoryQueryCriteria criteria, Pageable pageable) { | ||
| 29 | return ResultInfo.successPage(memberVipHistoryService.queryAll(criteria,pageable)); | ||
| 30 | } | ||
| 31 | |||
| 32 | @GetMapping(value = "/all") | ||
| 33 | @ApiOperation("查询所有MemberVipHistory") | ||
| 34 | public ResultInfo getMemberVipHistorys(MemberVipHistoryQueryCriteria criteria) { | ||
| 35 | return ResultInfo.success(memberVipHistoryService.queryAll(criteria)); | ||
| 36 | } | ||
| 37 | |||
| 38 | @PostMapping | ||
| 39 | @ApiOperation("新增MemberVipHistory") | ||
| 40 | public ResultInfo create(@Validated @RequestBody MemberVipHistory resources) { | ||
| 41 | memberVipHistoryService.create(resources); | ||
| 42 | return ResultInfo.success(); | ||
| 43 | } | ||
| 44 | |||
| 45 | @PutMapping | ||
| 46 | @ApiOperation("修改MemberVipHistory") | ||
| 47 | public ResultInfo update(@Validated @RequestBody MemberVipHistory resources) { | ||
| 48 | memberVipHistoryService.update(resources); | ||
| 49 | return ResultInfo.success(); | ||
| 50 | } | ||
| 51 | |||
| 52 | @DeleteMapping(value = "/{id}") | ||
| 53 | @ApiOperation("删除MemberVipHistory") | ||
| 54 | public ResultInfo delete(@PathVariable Long id) { | ||
| 55 | memberVipHistoryService.delete(id); | ||
| 56 | return ResultInfo.success(); | ||
| 57 | } | ||
| 58 | |||
| 59 | } |
src/main/java/com/topdraw/business/module/member/viphistory/service/MemberVipHistoryService.java
0 → 100644
| 1 | package com.topdraw.business.module.member.viphistory.service; | ||
| 2 | |||
| 3 | import com.topdraw.business.module.member.viphistory.domain.MemberVipHistory; | ||
| 4 | import com.topdraw.business.module.member.viphistory.service.dto.MemberVipHistoryDTO; | ||
| 5 | import com.topdraw.business.module.member.viphistory.service.dto.MemberVipHistoryQueryCriteria; | ||
| 6 | import org.springframework.data.domain.Pageable; | ||
| 7 | |||
| 8 | import java.time.LocalDateTime; | ||
| 9 | import java.util.List; | ||
| 10 | import java.util.Map; | ||
| 11 | |||
| 12 | /** | ||
| 13 | * @author luerlong | ||
| 14 | * @date 2021-12-10 | ||
| 15 | */ | ||
| 16 | public interface MemberVipHistoryService { | ||
| 17 | |||
| 18 | /** | ||
| 19 | * 查询数据分页 | ||
| 20 | * @param criteria 条件参数 | ||
| 21 | * @param pageable 分页参数 | ||
| 22 | * @return Map<String,Object> | ||
| 23 | */ | ||
| 24 | Map<String,Object> queryAll(MemberVipHistoryQueryCriteria criteria, Pageable pageable); | ||
| 25 | |||
| 26 | /** | ||
| 27 | * 查询所有数据不分页 | ||
| 28 | * @param criteria 条件参数 | ||
| 29 | * @return List<MemberVipHistoryDTO> | ||
| 30 | */ | ||
| 31 | List<MemberVipHistoryDTO> queryAll(MemberVipHistoryQueryCriteria criteria); | ||
| 32 | |||
| 33 | /** | ||
| 34 | * 根据ID查询 | ||
| 35 | * @param id ID | ||
| 36 | * @return MemberVipHistoryDTO | ||
| 37 | */ | ||
| 38 | MemberVipHistoryDTO findById(Long id); | ||
| 39 | |||
| 40 | void create(MemberVipHistory resources); | ||
| 41 | |||
| 42 | void update(MemberVipHistory resources); | ||
| 43 | |||
| 44 | void delete(Long id); | ||
| 45 | |||
| 46 | MemberVipHistory findByTime(Long id, LocalDateTime nowTime); | ||
| 47 | } |
src/main/java/com/topdraw/business/module/member/viphistory/service/dto/MemberVipHistoryDTO.java
0 → 100644
| 1 | package com.topdraw.business.module.member.viphistory.service.dto; | ||
| 2 | |||
| 3 | import lombok.Data; | ||
| 4 | |||
| 5 | import java.io.Serializable; | ||
| 6 | import java.sql.Timestamp; | ||
| 7 | import java.time.LocalDateTime; | ||
| 8 | |||
| 9 | |||
| 10 | /** | ||
| 11 | * @author luerlong | ||
| 12 | * @date 2021-12-10 | ||
| 13 | */ | ||
| 14 | @Data | ||
| 15 | public class MemberVipHistoryDTO implements Serializable { | ||
| 16 | |||
| 17 | // 主键 | ||
| 18 | private Long id; | ||
| 19 | |||
| 20 | // 会员id | ||
| 21 | private Long memberId; | ||
| 22 | |||
| 23 | // 会员vip等级 | ||
| 24 | private Integer vip; | ||
| 25 | |||
| 26 | // 修改之前vip等级 | ||
| 27 | private Integer beforeVip; | ||
| 28 | |||
| 29 | // vip失效时间 | ||
| 30 | private LocalDateTime vipExpireTime; | ||
| 31 | |||
| 32 | // 状态 1正常 0已过期 | ||
| 33 | private Integer status; | ||
| 34 | |||
| 35 | // 创建时间 | ||
| 36 | private Timestamp createTime; | ||
| 37 | |||
| 38 | // 修改时间 | ||
| 39 | private Timestamp updateTime; | ||
| 40 | } |
| 1 | package com.topdraw.business.module.member.viphistory.service.impl; | ||
| 2 | |||
| 3 | |||
| 4 | import com.topdraw.business.module.member.viphistory.domain.MemberVipHistory; | ||
| 5 | import com.topdraw.business.module.member.viphistory.repository.MemberVipHistoryRepository; | ||
| 6 | import com.topdraw.business.module.member.viphistory.service.MemberVipHistoryService; | ||
| 7 | import com.topdraw.business.module.member.viphistory.service.dto.MemberVipHistoryDTO; | ||
| 8 | import com.topdraw.business.module.member.viphistory.service.dto.MemberVipHistoryQueryCriteria; | ||
| 9 | import com.topdraw.business.module.member.viphistory.service.mapper.MemberVipHistoryMapper; | ||
| 10 | import com.topdraw.utils.PageUtil; | ||
| 11 | import com.topdraw.utils.QueryHelp; | ||
| 12 | import com.topdraw.utils.ValidationUtil; | ||
| 13 | import org.springframework.beans.factory.annotation.Autowired; | ||
| 14 | import org.springframework.dao.EmptyResultDataAccessException; | ||
| 15 | import org.springframework.data.domain.Page; | ||
| 16 | import org.springframework.data.domain.Pageable; | ||
| 17 | import org.springframework.stereotype.Service; | ||
| 18 | import org.springframework.transaction.annotation.Propagation; | ||
| 19 | import org.springframework.transaction.annotation.Transactional; | ||
| 20 | import org.springframework.util.Assert; | ||
| 21 | |||
| 22 | import java.time.LocalDateTime; | ||
| 23 | import java.util.List; | ||
| 24 | import java.util.Map; | ||
| 25 | |||
| 26 | /** | ||
| 27 | * @author luerlong | ||
| 28 | * @date 2021-12-10 | ||
| 29 | */ | ||
| 30 | @Service | ||
| 31 | @Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class) | ||
| 32 | public class MemberVipHistoryServiceImpl implements MemberVipHistoryService { | ||
| 33 | |||
| 34 | @Autowired | ||
| 35 | private MemberVipHistoryRepository memberVipHistoryRepository; | ||
| 36 | |||
| 37 | @Autowired | ||
| 38 | private MemberVipHistoryMapper memberVipHistoryMapper; | ||
| 39 | |||
| 40 | @Override | ||
| 41 | public Map<String, Object> queryAll(MemberVipHistoryQueryCriteria criteria, Pageable pageable) { | ||
| 42 | Page<MemberVipHistory> page = memberVipHistoryRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable); | ||
| 43 | return PageUtil.toPage(page.map(memberVipHistoryMapper::toDto)); | ||
| 44 | } | ||
| 45 | |||
| 46 | @Override | ||
| 47 | public List<MemberVipHistoryDTO> queryAll(MemberVipHistoryQueryCriteria criteria) { | ||
| 48 | return memberVipHistoryMapper.toDto(memberVipHistoryRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder))); | ||
| 49 | } | ||
| 50 | |||
| 51 | @Override | ||
| 52 | public MemberVipHistoryDTO findById(Long id) { | ||
| 53 | MemberVipHistory memberVipHistory = memberVipHistoryRepository.findById(id).orElseGet(MemberVipHistory::new); | ||
| 54 | ValidationUtil.isNull(memberVipHistory.getId(),"MemberVipHistory","id",id); | ||
| 55 | return memberVipHistoryMapper.toDto(memberVipHistory); | ||
| 56 | } | ||
| 57 | |||
| 58 | @Override | ||
| 59 | @Transactional(rollbackFor = Exception.class) | ||
| 60 | public void create(MemberVipHistory resources) { | ||
| 61 | memberVipHistoryRepository.save(resources); | ||
| 62 | } | ||
| 63 | |||
| 64 | @Override | ||
| 65 | @Transactional(rollbackFor = Exception.class) | ||
| 66 | public void update(MemberVipHistory resources) { | ||
| 67 | MemberVipHistory memberVipHistory = memberVipHistoryRepository.findById(resources.getId()).orElseGet(MemberVipHistory::new); | ||
| 68 | ValidationUtil.isNull( memberVipHistory.getId(),"MemberVipHistory","id",resources.getId()); | ||
| 69 | memberVipHistory.copy(resources); | ||
| 70 | memberVipHistoryRepository.save(memberVipHistory); | ||
| 71 | } | ||
| 72 | |||
| 73 | @Override | ||
| 74 | @Transactional(rollbackFor = Exception.class) | ||
| 75 | public void delete(Long id) { | ||
| 76 | Assert.notNull(id, "The given id must not be null!"); | ||
| 77 | MemberVipHistory memberVipHistory = memberVipHistoryRepository.findById(id).orElseThrow( | ||
| 78 | () -> new EmptyResultDataAccessException(String.format("No %s entity " + "with id %s " + "exists!", MemberVipHistory.class, id), 1)); | ||
| 79 | memberVipHistoryRepository.delete(memberVipHistory); | ||
| 80 | } | ||
| 81 | |||
| 82 | @Override | ||
| 83 | public MemberVipHistory findByTime(Long memberId, LocalDateTime nowTime) { | ||
| 84 | MemberVipHistory memberVipHistory = this.memberVipHistoryRepository.findByTime(memberId, nowTime).orElseGet(MemberVipHistory::new); | ||
| 85 | return memberVipHistory; | ||
| 86 | } | ||
| 87 | |||
| 88 | |||
| 89 | } |
| 1 | package com.topdraw.business.module.member.viphistory.service.mapper; | ||
| 2 | |||
| 3 | import com.topdraw.base.BaseMapper; | ||
| 4 | import com.topdraw.business.module.member.viphistory.domain.MemberVipHistory; | ||
| 5 | import com.topdraw.business.module.member.viphistory.service.dto.MemberVipHistoryDTO; | ||
| 6 | import org.mapstruct.Mapper; | ||
| 7 | import org.mapstruct.ReportingPolicy; | ||
| 8 | |||
| 9 | /** | ||
| 10 | * @author luerlong | ||
| 11 | * @date 2021-12-10 | ||
| 12 | */ | ||
| 13 | @Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE) | ||
| 14 | public interface MemberVipHistoryMapper extends BaseMapper<MemberVipHistoryDTO, MemberVipHistory> { | ||
| 15 | |||
| 16 | } |
| 1 | package com.topdraw.business.basicdata.points.available.domain; | 1 | package com.topdraw.business.module.points.available.domain; |
| 2 | 2 | ||
| 3 | import cn.hutool.core.bean.BeanUtil; | 3 | import cn.hutool.core.bean.BeanUtil; |
| 4 | import cn.hutool.core.bean.copier.CopyOptions; | 4 | import cn.hutool.core.bean.copier.CopyOptions; | ... | ... |
| 1 | package com.topdraw.business.basicdata.points.available.repository; | 1 | package com.topdraw.business.module.points.available.repository; |
| 2 | 2 | ||
| 3 | import com.topdraw.business.basicdata.points.available.domain.PointsAvailable; | 3 | import com.topdraw.business.module.points.available.domain.PointsAvailable; |
| 4 | import com.topdraw.business.basicdata.points.available.service.dto.PointsAvailableDTO; | 4 | import com.topdraw.business.module.points.available.service.dto.PointsAvailableDTO; |
| 5 | import com.topdraw.business.basicdata.points.available.service.dto.PointsAvailableQueryCriteria; | 5 | import com.topdraw.business.module.points.available.service.dto.PointsAvailableQueryCriteria; |
| 6 | import org.springframework.data.jpa.repository.JpaRepository; | 6 | import org.springframework.data.jpa.repository.JpaRepository; |
| 7 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; | 7 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; |
| 8 | import org.springframework.data.jpa.repository.Modifying; | 8 | import org.springframework.data.jpa.repository.Modifying; | ... | ... |
| 1 | package com.topdraw.business.basicdata.points.available.service; | 1 | package com.topdraw.business.module.points.available.service; |
| 2 | 2 | ||
| 3 | import com.topdraw.business.basicdata.points.available.domain.PointsAvailable; | 3 | import com.topdraw.business.module.points.available.domain.PointsAvailable; |
| 4 | import com.topdraw.business.basicdata.points.available.service.dto.PointsAvailableDTO; | 4 | import com.topdraw.business.module.points.available.service.dto.PointsAvailableDTO; |
| 5 | import com.topdraw.business.basicdata.points.available.service.dto.PointsAvailableQueryCriteria; | 5 | import com.topdraw.business.module.points.available.service.dto.PointsAvailableQueryCriteria; |
| 6 | import org.springframework.data.domain.Pageable; | 6 | import org.springframework.data.domain.Pageable; |
| 7 | 7 | ||
| 8 | import java.time.LocalDateTime; | 8 | import java.time.LocalDateTime; | ... | ... |
| 1 | package com.topdraw.business.basicdata.points.available.service.impl; | 1 | package com.topdraw.business.module.points.available.service.impl; |
| 2 | 2 | ||
| 3 | import com.topdraw.business.basicdata.member.service.MemberService; | 3 | import com.topdraw.business.module.member.service.MemberService; |
| 4 | import com.topdraw.business.basicdata.member.service.dto.MemberDTO; | 4 | import com.topdraw.business.module.member.service.dto.MemberDTO; |
| 5 | import com.topdraw.business.basicdata.points.available.domain.PointsAvailable; | 5 | import com.topdraw.business.module.points.available.domain.PointsAvailable; |
| 6 | import com.topdraw.business.basicdata.points.available.repository.PointsAvailableRepository; | 6 | import com.topdraw.business.module.points.available.repository.PointsAvailableRepository; |
| 7 | import com.topdraw.business.basicdata.points.available.service.PointsAvailableService; | 7 | import com.topdraw.business.module.points.available.service.PointsAvailableService; |
| 8 | import com.topdraw.business.basicdata.points.available.service.dto.PointsAvailableDTO; | 8 | import com.topdraw.business.module.points.available.service.dto.PointsAvailableDTO; |
| 9 | import com.topdraw.business.basicdata.points.available.service.dto.PointsAvailableQueryCriteria; | 9 | import com.topdraw.business.module.points.available.service.dto.PointsAvailableQueryCriteria; |
| 10 | import com.topdraw.business.basicdata.points.available.service.mapper.PointsAvailableMapper; | 10 | import com.topdraw.business.module.points.available.service.mapper.PointsAvailableMapper; |
| 11 | import com.topdraw.util.RedissonUtil; | 11 | import com.topdraw.util.RedissonUtil; |
| 12 | import com.topdraw.utils.PageUtil; | 12 | import com.topdraw.utils.PageUtil; |
| 13 | import com.topdraw.utils.QueryHelp; | 13 | import com.topdraw.utils.QueryHelp; | ... | ... |
| 1 | package com.topdraw.business.basicdata.points.available.service.mapper; | 1 | package com.topdraw.business.module.points.available.service.mapper; |
| 2 | 2 | ||
| 3 | import com.topdraw.base.BaseMapper; | 3 | import com.topdraw.base.BaseMapper; |
| 4 | import com.topdraw.business.basicdata.points.available.domain.PointsAvailable; | 4 | import com.topdraw.business.module.points.available.domain.PointsAvailable; |
| 5 | import com.topdraw.business.basicdata.points.available.service.dto.PointsAvailableDTO; | 5 | import com.topdraw.business.module.points.available.service.dto.PointsAvailableDTO; |
| 6 | import org.mapstruct.Mapper; | 6 | import org.mapstruct.Mapper; |
| 7 | import org.mapstruct.ReportingPolicy; | 7 | import org.mapstruct.ReportingPolicy; |
| 8 | 8 | ... | ... |
| 1 | package com.topdraw.business.basicdata.points.detail.detailhistory.domain; | 1 | package com.topdraw.business.module.points.detail.detailhistory.domain; |
| 2 | 2 | ||
| 3 | import cn.hutool.core.bean.BeanUtil; | 3 | import cn.hutool.core.bean.BeanUtil; |
| 4 | import cn.hutool.core.bean.copier.CopyOptions; | 4 | import cn.hutool.core.bean.copier.CopyOptions; | ... | ... |
| 1 | package com.topdraw.business.basicdata.points.detail.detailhistory.repository; | 1 | package com.topdraw.business.module.points.detail.detailhistory.repository; |
| 2 | 2 | ||
| 3 | import com.topdraw.business.basicdata.points.detail.detailhistory.domain.PointsDetailHistory; | 3 | import com.topdraw.business.module.points.detail.detailhistory.domain.PointsDetailHistory; |
| 4 | import org.springframework.data.jpa.repository.JpaRepository; | 4 | import org.springframework.data.jpa.repository.JpaRepository; |
| 5 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; | 5 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; |
| 6 | 6 | ... | ... |
| 1 | package com.topdraw.business.basicdata.points.detail.detailhistory.service; | 1 | package com.topdraw.business.module.points.detail.detailhistory.service; |
| 2 | 2 | ||
| 3 | import com.topdraw.business.basicdata.points.detail.detailhistory.domain.PointsDetailHistory; | 3 | import com.topdraw.business.module.points.detail.detailhistory.domain.PointsDetailHistory; |
| 4 | import com.topdraw.business.basicdata.points.detail.detailhistory.service.dto.PointsDetailHistoryDTO; | 4 | import com.topdraw.business.module.points.detail.detailhistory.service.dto.PointsDetailHistoryDTO; |
| 5 | import com.topdraw.business.basicdata.points.detail.detailhistory.service.dto.PointsDetailHistoryQueryCriteria; | 5 | import com.topdraw.business.module.points.detail.detailhistory.service.dto.PointsDetailHistoryQueryCriteria; |
| 6 | import org.springframework.data.domain.Pageable; | 6 | import org.springframework.data.domain.Pageable; |
| 7 | 7 | ||
| 8 | import java.util.List; | 8 | import java.util.List; | ... | ... |
| 1 | package com.topdraw.business.basicdata.points.detail.detailhistory.service.impl; | 1 | package com.topdraw.business.module.points.detail.detailhistory.service.impl; |
| 2 | 2 | ||
| 3 | import com.topdraw.business.basicdata.points.detail.detailhistory.domain.PointsDetailHistory; | 3 | import com.topdraw.business.module.points.detail.detailhistory.domain.PointsDetailHistory; |
| 4 | import com.topdraw.business.basicdata.points.detail.detailhistory.repository.PointsDetailHistoryRepository; | 4 | import com.topdraw.business.module.points.detail.detailhistory.repository.PointsDetailHistoryRepository; |
| 5 | import com.topdraw.business.basicdata.points.detail.detailhistory.service.PointsDetailHistoryService; | 5 | import com.topdraw.business.module.points.detail.detailhistory.service.PointsDetailHistoryService; |
| 6 | import com.topdraw.business.basicdata.points.detail.detailhistory.service.dto.PointsDetailHistoryDTO; | 6 | import com.topdraw.business.module.points.detail.detailhistory.service.dto.PointsDetailHistoryDTO; |
| 7 | import com.topdraw.business.basicdata.points.detail.detailhistory.service.dto.PointsDetailHistoryQueryCriteria; | 7 | import com.topdraw.business.module.points.detail.detailhistory.service.dto.PointsDetailHistoryQueryCriteria; |
| 8 | import com.topdraw.business.basicdata.points.detail.detailhistory.service.mapper.PointsDetailHistoryMapper; | 8 | import com.topdraw.business.module.points.detail.detailhistory.service.mapper.PointsDetailHistoryMapper; |
| 9 | import com.topdraw.utils.PageUtil; | 9 | import com.topdraw.utils.PageUtil; |
| 10 | import com.topdraw.utils.QueryHelp; | 10 | import com.topdraw.utils.QueryHelp; |
| 11 | import com.topdraw.utils.StringUtils; | 11 | import com.topdraw.utils.StringUtils; | ... | ... |
| 1 | package com.topdraw.business.basicdata.points.detail.detailhistory.service.mapper; | 1 | package com.topdraw.business.module.points.detail.detailhistory.service.mapper; |
| 2 | 2 | ||
| 3 | import com.topdraw.base.BaseMapper; | 3 | import com.topdraw.base.BaseMapper; |
| 4 | import com.topdraw.business.basicdata.points.detail.detailhistory.domain.PointsDetailHistory; | 4 | import com.topdraw.business.module.points.detail.detailhistory.domain.PointsDetailHistory; |
| 5 | import com.topdraw.business.basicdata.points.detail.detailhistory.service.dto.PointsDetailHistoryDTO; | 5 | import com.topdraw.business.module.points.detail.detailhistory.service.dto.PointsDetailHistoryDTO; |
| 6 | import org.mapstruct.Mapper; | 6 | import org.mapstruct.Mapper; |
| 7 | import org.mapstruct.ReportingPolicy; | 7 | import org.mapstruct.ReportingPolicy; |
| 8 | 8 | ... | ... |
| 1 | package com.topdraw.business.basicdata.points.detail.domain; | 1 | package com.topdraw.business.module.points.detail.domain; |
| 2 | 2 | ||
| 3 | import cn.hutool.core.bean.BeanUtil; | 3 | import cn.hutool.core.bean.BeanUtil; |
| 4 | import cn.hutool.core.bean.copier.CopyOptions; | 4 | import cn.hutool.core.bean.copier.CopyOptions; | ... | ... |
| 1 | package com.topdraw.business.basicdata.points.detail.repository; | 1 | package com.topdraw.business.module.points.detail.repository; |
| 2 | 2 | ||
| 3 | import com.topdraw.business.basicdata.points.detail.domain.PointsDetail; | 3 | import com.topdraw.business.module.points.detail.domain.PointsDetail; |
| 4 | import org.springframework.data.jpa.repository.JpaRepository; | 4 | import org.springframework.data.jpa.repository.JpaRepository; |
| 5 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; | 5 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; |
| 6 | 6 | ... | ... |
| 1 | package com.topdraw.business.basicdata.points.detail.service; | 1 | package com.topdraw.business.module.points.detail.service; |
| 2 | 2 | ||
| 3 | import com.topdraw.business.basicdata.points.detail.domain.PointsDetail; | 3 | import com.topdraw.business.module.points.detail.domain.PointsDetail; |
| 4 | import com.topdraw.business.basicdata.points.detail.service.dto.PointsDetailDTO; | 4 | import com.topdraw.business.module.points.detail.service.dto.PointsDetailDTO; |
| 5 | import com.topdraw.business.basicdata.points.detail.service.dto.PointsDetailQueryCriteria; | 5 | import com.topdraw.business.module.points.detail.service.dto.PointsDetailQueryCriteria; |
| 6 | import org.springframework.data.domain.Pageable; | 6 | import org.springframework.data.domain.Pageable; |
| 7 | 7 | ||
| 8 | import java.util.List; | 8 | import java.util.List; | ... | ... |
| 1 | package com.topdraw.business.basicdata.points.detail.service.impl; | 1 | package com.topdraw.business.module.points.detail.service.impl; |
| 2 | 2 | ||
| 3 | import com.topdraw.business.basicdata.member.service.MemberService; | 3 | import com.topdraw.business.module.member.service.MemberService; |
| 4 | import com.topdraw.business.basicdata.member.service.dto.MemberDTO; | 4 | import com.topdraw.business.module.member.service.dto.MemberDTO; |
| 5 | import com.topdraw.business.basicdata.points.detail.domain.PointsDetail; | 5 | import com.topdraw.business.module.points.detail.domain.PointsDetail; |
| 6 | import com.topdraw.business.basicdata.points.detail.repository.PointsDetailRepository; | 6 | import com.topdraw.business.module.points.detail.repository.PointsDetailRepository; |
| 7 | import com.topdraw.business.basicdata.points.detail.service.PointsDetailService; | 7 | import com.topdraw.business.module.points.detail.service.PointsDetailService; |
| 8 | import com.topdraw.business.basicdata.points.detail.service.dto.PointsDetailDTO; | 8 | import com.topdraw.business.module.points.detail.service.dto.PointsDetailDTO; |
| 9 | import com.topdraw.business.basicdata.points.detail.service.dto.PointsDetailQueryCriteria; | 9 | import com.topdraw.business.module.points.detail.service.dto.PointsDetailQueryCriteria; |
| 10 | import com.topdraw.business.basicdata.points.detail.service.mapper.PointsDetailMapper; | 10 | import com.topdraw.business.module.points.detail.service.mapper.PointsDetailMapper; |
| 11 | import com.topdraw.utils.PageUtil; | 11 | import com.topdraw.utils.PageUtil; |
| 12 | import com.topdraw.utils.QueryHelp; | 12 | import com.topdraw.utils.QueryHelp; |
| 13 | import com.topdraw.utils.StringUtils; | 13 | import com.topdraw.utils.StringUtils; | ... | ... |
| 1 | package com.topdraw.business.basicdata.points.detail.service.mapper; | 1 | package com.topdraw.business.module.points.detail.service.mapper; |
| 2 | 2 | ||
| 3 | import com.topdraw.base.BaseMapper; | 3 | import com.topdraw.base.BaseMapper; |
| 4 | import com.topdraw.business.basicdata.points.detail.domain.PointsDetail; | 4 | import com.topdraw.business.module.points.detail.domain.PointsDetail; |
| 5 | import com.topdraw.business.basicdata.points.detail.service.dto.PointsDetailDTO; | 5 | import com.topdraw.business.module.points.detail.service.dto.PointsDetailDTO; |
| 6 | import org.mapstruct.Mapper; | 6 | import org.mapstruct.Mapper; |
| 7 | import org.mapstruct.ReportingPolicy; | 7 | import org.mapstruct.ReportingPolicy; |
| 8 | 8 | ... | ... |
| 1 | package com.topdraw.business.basicdata.points.repository; | 1 | package com.topdraw.business.module.points.repository; |
| 2 | 2 | ||
| 3 | import com.topdraw.business.basicdata.points.domain.Points; | 3 | import com.topdraw.business.module.points.domain.Points; |
| 4 | import org.springframework.data.jpa.repository.JpaRepository; | 4 | import org.springframework.data.jpa.repository.JpaRepository; |
| 5 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; | 5 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; |
| 6 | 6 | ... | ... |
| 1 | package com.topdraw.business.basicdata.points.service; | 1 | package com.topdraw.business.module.points.service; |
| 2 | 2 | ||
| 3 | import com.topdraw.business.basicdata.points.domain.Points; | 3 | import com.topdraw.business.module.points.domain.Points; |
| 4 | import com.topdraw.business.basicdata.points.service.dto.PointsDTO; | 4 | import com.topdraw.business.module.points.service.dto.PointsDTO; |
| 5 | import com.topdraw.business.basicdata.points.service.dto.PointsQueryCriteria; | 5 | import com.topdraw.business.module.points.service.dto.PointsQueryCriteria; |
| 6 | import org.springframework.data.domain.Pageable; | 6 | import org.springframework.data.domain.Pageable; |
| 7 | 7 | ||
| 8 | import java.util.List; | 8 | import java.util.List; | ... | ... |
| 1 | package com.topdraw.business.basicdata.points.service.dto; | 1 | package com.topdraw.business.module.points.service.dto; |
| 2 | 2 | ||
| 3 | import com.fasterxml.jackson.databind.annotation.JsonSerialize; | 3 | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| 4 | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; | 4 | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; | ... | ... |
| 1 | package com.topdraw.business.basicdata.points.service.impl; | 1 | package com.topdraw.business.module.points.service.impl; |
| 2 | 2 | ||
| 3 | import cn.hutool.core.lang.Snowflake; | 3 | import cn.hutool.core.lang.Snowflake; |
| 4 | import cn.hutool.core.util.IdUtil; | 4 | import cn.hutool.core.util.IdUtil; |
| 5 | import com.topdraw.business.basicdata.points.domain.Points; | 5 | import com.topdraw.business.module.points.domain.Points; |
| 6 | import com.topdraw.business.basicdata.points.repository.PointsRepository; | 6 | import com.topdraw.business.module.points.repository.PointsRepository; |
| 7 | import com.topdraw.business.basicdata.points.service.PointsService; | 7 | import com.topdraw.business.module.points.service.PointsService; |
| 8 | import com.topdraw.business.basicdata.points.service.dto.PointsDTO; | 8 | import com.topdraw.business.module.points.service.dto.PointsDTO; |
| 9 | import com.topdraw.business.basicdata.points.service.dto.PointsQueryCriteria; | 9 | import com.topdraw.business.module.points.service.dto.PointsQueryCriteria; |
| 10 | import com.topdraw.business.basicdata.points.service.mapper.PointsMapper; | 10 | import com.topdraw.business.module.points.service.mapper.PointsMapper; |
| 11 | import com.topdraw.util.RedissonUtil; | 11 | import com.topdraw.util.RedissonUtil; |
| 12 | import com.topdraw.utils.PageUtil; | 12 | import com.topdraw.utils.PageUtil; |
| 13 | import com.topdraw.utils.QueryHelp; | 13 | import com.topdraw.utils.QueryHelp; | ... | ... |
| 1 | package com.topdraw.business.basicdata.points.service.mapper; | 1 | package com.topdraw.business.module.points.service.mapper; |
| 2 | 2 | ||
| 3 | import com.topdraw.base.BaseMapper; | 3 | import com.topdraw.base.BaseMapper; |
| 4 | import com.topdraw.business.basicdata.points.domain.Points; | 4 | import com.topdraw.business.module.points.domain.Points; |
| 5 | import com.topdraw.business.basicdata.points.service.dto.PointsDTO; | 5 | import com.topdraw.business.module.points.service.dto.PointsDTO; |
| 6 | import org.mapstruct.Mapper; | 6 | import org.mapstruct.Mapper; |
| 7 | import org.mapstruct.ReportingPolicy; | 7 | import org.mapstruct.ReportingPolicy; |
| 8 | 8 | ... | ... |
| 1 | package com.topdraw.business.basicdata.points.standingbook.domain; | 1 | package com.topdraw.business.module.points.standingbook.domain; |
| 2 | 2 | ||
| 3 | import cn.hutool.core.bean.BeanUtil; | 3 | import cn.hutool.core.bean.BeanUtil; |
| 4 | import cn.hutool.core.bean.copier.CopyOptions; | 4 | import cn.hutool.core.bean.copier.CopyOptions; | ... | ... |
| 1 | package com.topdraw.business.basicdata.points.standingbook.repository; | 1 | package com.topdraw.business.module.points.standingbook.repository; |
| 2 | 2 | ||
| 3 | import com.topdraw.business.basicdata.points.standingbook.domain.PointsStandingBook; | 3 | import com.topdraw.business.module.points.standingbook.domain.PointsStandingBook; |
| 4 | import org.springframework.data.jpa.repository.JpaRepository; | 4 | import org.springframework.data.jpa.repository.JpaRepository; |
| 5 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; | 5 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; |
| 6 | 6 | ... | ... |
| 1 | package com.topdraw.business.basicdata.points.standingbook.rest; | 1 | package com.topdraw.business.module.points.standingbook.rest; |
| 2 | 2 | ||
| 3 | import com.topdraw.annotation.Log; | 3 | import com.topdraw.business.module.points.standingbook.domain.PointsStandingBook; |
| 4 | import com.topdraw.business.basicdata.points.standingbook.domain.PointsStandingBook; | 4 | import com.topdraw.business.module.points.standingbook.service.PointsStandingBookService; |
| 5 | import com.topdraw.business.basicdata.points.standingbook.service.PointsStandingBookService; | 5 | import com.topdraw.business.module.points.standingbook.service.dto.PointsStandingBookQueryCriteria; |
| 6 | import com.topdraw.business.basicdata.points.standingbook.service.dto.PointsStandingBookQueryCriteria; | ||
| 7 | import com.topdraw.common.ResultInfo; | 6 | import com.topdraw.common.ResultInfo; |
| 8 | import io.swagger.annotations.Api; | 7 | import io.swagger.annotations.Api; |
| 9 | import io.swagger.annotations.ApiOperation; | 8 | import io.swagger.annotations.ApiOperation; |
| ... | @@ -36,7 +35,6 @@ public class PointsStandingBookController { | ... | @@ -36,7 +35,6 @@ public class PointsStandingBookController { |
| 36 | return ResultInfo.success(PointsStandingBookService.queryAll(criteria)); | 35 | return ResultInfo.success(PointsStandingBookService.queryAll(criteria)); |
| 37 | } | 36 | } |
| 38 | 37 | ||
| 39 | @Log | ||
| 40 | @PostMapping | 38 | @PostMapping |
| 41 | @ApiOperation("新增PointsStandingBook") | 39 | @ApiOperation("新增PointsStandingBook") |
| 42 | public ResultInfo create(@Validated @RequestBody PointsStandingBook resources) { | 40 | public ResultInfo create(@Validated @RequestBody PointsStandingBook resources) { |
| ... | @@ -44,7 +42,6 @@ public class PointsStandingBookController { | ... | @@ -44,7 +42,6 @@ public class PointsStandingBookController { |
| 44 | return ResultInfo.success(); | 42 | return ResultInfo.success(); |
| 45 | } | 43 | } |
| 46 | 44 | ||
| 47 | @Log | ||
| 48 | @PutMapping | 45 | @PutMapping |
| 49 | @ApiOperation("修改PointsStandingBook") | 46 | @ApiOperation("修改PointsStandingBook") |
| 50 | public ResultInfo update(@Validated @RequestBody PointsStandingBook resources) { | 47 | public ResultInfo update(@Validated @RequestBody PointsStandingBook resources) { |
| ... | @@ -52,8 +49,6 @@ public class PointsStandingBookController { | ... | @@ -52,8 +49,6 @@ public class PointsStandingBookController { |
| 52 | return ResultInfo.success(); | 49 | return ResultInfo.success(); |
| 53 | } | 50 | } |
| 54 | 51 | ||
| 55 | |||
| 56 | @Log | ||
| 57 | @DeleteMapping(value = "/{id}") | 52 | @DeleteMapping(value = "/{id}") |
| 58 | @ApiOperation("删除PointsStandingBook") | 53 | @ApiOperation("删除PointsStandingBook") |
| 59 | public ResultInfo delete(@PathVariable Long id) { | 54 | public ResultInfo delete(@PathVariable Long id) { | ... | ... |
| 1 | package com.topdraw.business.basicdata.points.standingbook.service; | 1 | package com.topdraw.business.module.points.standingbook.service; |
| 2 | 2 | ||
| 3 | import com.topdraw.business.basicdata.points.standingbook.domain.PointsStandingBook; | 3 | import com.topdraw.business.module.points.standingbook.domain.PointsStandingBook; |
| 4 | import com.topdraw.business.basicdata.points.standingbook.service.dto.PointsStandingBookDTO; | 4 | import com.topdraw.business.module.points.standingbook.service.dto.PointsStandingBookDTO; |
| 5 | import com.topdraw.business.basicdata.points.standingbook.service.dto.PointsStandingBookQueryCriteria; | 5 | import com.topdraw.business.module.points.standingbook.service.dto.PointsStandingBookQueryCriteria; |
| 6 | import org.springframework.data.domain.Pageable; | 6 | import org.springframework.data.domain.Pageable; |
| 7 | 7 | ||
| 8 | import java.util.List; | 8 | import java.util.List; | ... | ... |
| 1 | package com.topdraw.business.basicdata.points.standingbook.service.impl; | 1 | package com.topdraw.business.module.points.standingbook.service.impl; |
| 2 | 2 | ||
| 3 | import com.topdraw.business.basicdata.points.standingbook.domain.PointsStandingBook; | 3 | import com.topdraw.business.module.points.standingbook.domain.PointsStandingBook; |
| 4 | import com.topdraw.business.basicdata.points.standingbook.repository.PointsStandingBookRepository; | 4 | import com.topdraw.business.module.points.standingbook.repository.PointsStandingBookRepository; |
| 5 | import com.topdraw.business.basicdata.points.standingbook.service.PointsStandingBookService; | 5 | import com.topdraw.business.module.points.standingbook.service.PointsStandingBookService; |
| 6 | import com.topdraw.business.basicdata.points.standingbook.service.dto.PointsStandingBookDTO; | 6 | import com.topdraw.business.module.points.standingbook.service.dto.PointsStandingBookDTO; |
| 7 | import com.topdraw.business.basicdata.points.standingbook.service.dto.PointsStandingBookQueryCriteria; | 7 | import com.topdraw.business.module.points.standingbook.service.dto.PointsStandingBookQueryCriteria; |
| 8 | import com.topdraw.business.basicdata.points.standingbook.service.mapper.PointsStandingBookMapper; | 8 | import com.topdraw.business.module.points.standingbook.service.mapper.PointsStandingBookMapper; |
| 9 | import com.topdraw.utils.PageUtil; | 9 | import com.topdraw.utils.PageUtil; |
| 10 | import com.topdraw.utils.QueryHelp; | 10 | import com.topdraw.utils.QueryHelp; |
| 11 | import com.topdraw.utils.ValidationUtil; | 11 | import com.topdraw.utils.ValidationUtil; | ... | ... |
| 1 | package com.topdraw.business.basicdata.points.standingbook.service.mapper; | 1 | package com.topdraw.business.module.points.standingbook.service.mapper; |
| 2 | 2 | ||
| 3 | import com.topdraw.base.BaseMapper; | 3 | import com.topdraw.base.BaseMapper; |
| 4 | import com.topdraw.business.basicdata.points.standingbook.domain.PointsStandingBook; | 4 | import com.topdraw.business.module.points.standingbook.domain.PointsStandingBook; |
| 5 | import com.topdraw.business.basicdata.points.standingbook.service.dto.PointsStandingBookDTO; | 5 | import com.topdraw.business.module.points.standingbook.service.dto.PointsStandingBookDTO; |
| 6 | import org.mapstruct.Mapper; | 6 | import org.mapstruct.Mapper; |
| 7 | import org.mapstruct.ReportingPolicy; | 7 | import org.mapstruct.ReportingPolicy; |
| 8 | 8 | ... | ... |
| 1 | package com.topdraw.business.basicdata.rights.history.domain; | 1 | package com.topdraw.business.module.rights.history.domain; |
| 2 | 2 | ||
| 3 | import cn.hutool.core.bean.BeanUtil; | 3 | import cn.hutool.core.bean.BeanUtil; |
| 4 | import cn.hutool.core.bean.copier.CopyOptions; | 4 | import cn.hutool.core.bean.copier.CopyOptions; |
| 5 | import com.topdraw.business.module.common.domain.DefaultAsyncMqModule; | ||
| 5 | import lombok.Data; | 6 | import lombok.Data; |
| 6 | import lombok.experimental.Accessors; | 7 | import lombok.experimental.Accessors; |
| 7 | import org.springframework.data.annotation.CreatedDate; | 8 | import org.springframework.data.annotation.CreatedDate; |
| ... | @@ -11,6 +12,7 @@ import org.springframework.data.jpa.domain.support.AuditingEntityListener; | ... | @@ -11,6 +12,7 @@ import org.springframework.data.jpa.domain.support.AuditingEntityListener; |
| 11 | import javax.persistence.*; | 12 | import javax.persistence.*; |
| 12 | import java.io.Serializable; | 13 | import java.io.Serializable; |
| 13 | import java.sql.Timestamp; | 14 | import java.sql.Timestamp; |
| 15 | import java.time.LocalDateTime; | ||
| 14 | 16 | ||
| 15 | /** | 17 | /** |
| 16 | * @author XiangHan | 18 | * @author XiangHan |
| ... | @@ -21,7 +23,7 @@ import java.sql.Timestamp; | ... | @@ -21,7 +23,7 @@ import java.sql.Timestamp; |
| 21 | @EntityListeners(AuditingEntityListener.class) | 23 | @EntityListeners(AuditingEntityListener.class) |
| 22 | @Accessors(chain = true) | 24 | @Accessors(chain = true) |
| 23 | @Table(name="tr_rights_histroy") | 25 | @Table(name="tr_rights_histroy") |
| 24 | public class RightsHistory implements Serializable { | 26 | public class RightsHistory extends DefaultAsyncMqModule implements Serializable { |
| 25 | 27 | ||
| 26 | // 主键id | 28 | // 主键id |
| 27 | @Id | 29 | @Id |
| ... | @@ -50,19 +52,19 @@ public class RightsHistory implements Serializable { | ... | @@ -50,19 +52,19 @@ public class RightsHistory implements Serializable { |
| 50 | 52 | ||
| 51 | // 发放时间 | 53 | // 发放时间 |
| 52 | @Column(name = "send_time") | 54 | @Column(name = "send_time") |
| 53 | private Timestamp sendTime; | 55 | private LocalDateTime sendTime; |
| 54 | 56 | ||
| 55 | // 失效时间 | 57 | // 失效时间 |
| 56 | @Column(name = "expire_time") | 58 | @Column(name = "expire_time") |
| 57 | private Timestamp expireTime; | 59 | private LocalDateTime expireTime; |
| 58 | 60 | ||
| 59 | @CreatedDate | 61 | @CreatedDate |
| 60 | @Column(name = "create_time") | 62 | @Column(name = "create_time") |
| 61 | private Timestamp createTime; | 63 | private LocalDateTime createTime; |
| 62 | 64 | ||
| 63 | @LastModifiedDate | 65 | @LastModifiedDate |
| 64 | @Column(name = "update_time") | 66 | @Column(name = "update_time") |
| 65 | private Timestamp updateTime; | 67 | private LocalDateTime updateTime; |
| 66 | 68 | ||
| 67 | public void copy(RightsHistory source){ | 69 | public void copy(RightsHistory source){ |
| 68 | BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true)); | 70 | BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true)); | ... | ... |
| 1 | package com.topdraw.business.basicdata.rights.history.repository; | 1 | package com.topdraw.business.module.rights.history.repository; |
| 2 | 2 | ||
| 3 | import com.topdraw.business.basicdata.rights.history.domain.RightsHistory; | 3 | import com.topdraw.business.module.rights.history.domain.RightsHistory; |
| 4 | import org.springframework.data.jpa.repository.JpaRepository; | 4 | import org.springframework.data.jpa.repository.JpaRepository; |
| 5 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; | 5 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; |
| 6 | 6 | ... | ... |
| 1 | package com.topdraw.business.basicdata.rights.history.rest; | 1 | package com.topdraw.business.module.rights.history.rest; |
| 2 | 2 | ||
| 3 | import com.topdraw.business.basicdata.rights.history.service.RightsHistoryService; | 3 | import com.topdraw.business.module.rights.history.service.RightsHistoryService; |
| 4 | import com.topdraw.business.basicdata.rights.history.service.dto.RightsHistoryQueryCriteria; | 4 | import com.topdraw.business.module.rights.history.service.dto.RightsHistoryQueryCriteria; |
| 5 | import com.topdraw.common.ResultInfo; | 5 | import com.topdraw.common.ResultInfo; |
| 6 | import com.topdraw.util.TimestampUtil; | 6 | import com.topdraw.util.TimestampUtil; |
| 7 | import io.swagger.annotations.Api; | 7 | import io.swagger.annotations.Api; | ... | ... |
| 1 | package com.topdraw.business.basicdata.rights.history.service; | 1 | package com.topdraw.business.module.rights.history.service; |
| 2 | 2 | ||
| 3 | import com.topdraw.business.basicdata.rights.history.domain.RightsHistory; | 3 | import com.topdraw.business.module.rights.history.domain.RightsHistory; |
| 4 | import com.topdraw.business.basicdata.rights.history.service.dto.RightsHistoryDTO; | 4 | import com.topdraw.business.module.rights.history.service.dto.RightsHistoryDTO; |
| 5 | import com.topdraw.business.basicdata.rights.history.service.dto.RightsHistoryQueryCriteria; | 5 | import com.topdraw.business.module.rights.history.service.dto.RightsHistoryQueryCriteria; |
| 6 | import org.springframework.data.domain.Pageable; | 6 | import org.springframework.data.domain.Pageable; |
| 7 | 7 | ||
| 8 | import java.util.List; | 8 | import java.util.List; | ... | ... |
| 1 | package com.topdraw.business.basicdata.rights.history.service.dto; | 1 | package com.topdraw.business.module.rights.history.service.dto; |
| 2 | 2 | ||
| 3 | import lombok.Data; | 3 | import lombok.Data; |
| 4 | 4 | ||
| 5 | import java.io.Serializable; | 5 | import java.io.Serializable; |
| 6 | import java.sql.Timestamp; | 6 | import java.sql.Timestamp; |
| 7 | import java.time.LocalDateTime; | ||
| 7 | 8 | ||
| 8 | 9 | ||
| 9 | /** | 10 | /** |
| ... | @@ -29,12 +30,12 @@ public class RightsHistoryDTO implements Serializable { | ... | @@ -29,12 +30,12 @@ public class RightsHistoryDTO implements Serializable { |
| 29 | private String operatorName; | 30 | private String operatorName; |
| 30 | 31 | ||
| 31 | // 发放时间 | 32 | // 发放时间 |
| 32 | private Timestamp sendTime; | 33 | private LocalDateTime sendTime; |
| 33 | 34 | ||
| 34 | // 失效时间 | 35 | // 失效时间 |
| 35 | private Timestamp expireTime; | 36 | private LocalDateTime expireTime; |
| 36 | 37 | ||
| 37 | private Timestamp createTime; | 38 | private LocalDateTime createTime; |
| 38 | 39 | ||
| 39 | private Timestamp updateTime; | 40 | private LocalDateTime updateTime; |
| 40 | } | 41 | } | ... | ... |
| 1 | package com.topdraw.business.basicdata.rights.history.service.impl; | 1 | package com.topdraw.business.module.rights.history.service.impl; |
| 2 | 2 | ||
| 3 | import com.topdraw.business.basicdata.rights.history.domain.RightsHistory; | 3 | import com.topdraw.business.module.member.service.MemberService; |
| 4 | import com.topdraw.business.basicdata.rights.history.repository.RightsHistoryRepository; | 4 | import com.topdraw.business.module.member.service.dto.MemberDTO; |
| 5 | import com.topdraw.business.basicdata.rights.history.service.RightsHistoryService; | 5 | import com.topdraw.business.module.rights.history.domain.RightsHistory; |
| 6 | import com.topdraw.business.basicdata.rights.history.service.dto.RightsHistoryDTO; | 6 | import com.topdraw.business.module.rights.history.repository.RightsHistoryRepository; |
| 7 | import com.topdraw.business.basicdata.rights.history.service.dto.RightsHistoryQueryCriteria; | 7 | import com.topdraw.business.module.rights.history.service.RightsHistoryService; |
| 8 | import com.topdraw.business.basicdata.rights.history.service.mapper.RightsHistoryMapper; | 8 | import com.topdraw.business.module.rights.history.service.dto.RightsHistoryDTO; |
| 9 | import com.topdraw.business.module.rights.history.service.dto.RightsHistoryQueryCriteria; | ||
| 10 | import com.topdraw.business.module.rights.history.service.mapper.RightsHistoryMapper; | ||
| 9 | import com.topdraw.utils.PageUtil; | 11 | import com.topdraw.utils.PageUtil; |
| 10 | import com.topdraw.utils.QueryHelp; | 12 | import com.topdraw.utils.QueryHelp; |
| 11 | import com.topdraw.utils.ValidationUtil; | 13 | import com.topdraw.utils.ValidationUtil; |
| 14 | import org.apache.commons.lang3.StringUtils; | ||
| 12 | import org.springframework.beans.factory.annotation.Autowired; | 15 | import org.springframework.beans.factory.annotation.Autowired; |
| 13 | import org.springframework.dao.EmptyResultDataAccessException; | 16 | import org.springframework.dao.EmptyResultDataAccessException; |
| 14 | import org.springframework.data.domain.Page; | 17 | import org.springframework.data.domain.Page; |
| ... | @@ -33,6 +36,9 @@ public class RightsHistoryServiceImpl implements RightsHistoryService { | ... | @@ -33,6 +36,9 @@ public class RightsHistoryServiceImpl implements RightsHistoryService { |
| 33 | private RightsHistoryRepository RightsHistoryRepository; | 36 | private RightsHistoryRepository RightsHistoryRepository; |
| 34 | 37 | ||
| 35 | @Autowired | 38 | @Autowired |
| 39 | private MemberService memberService; | ||
| 40 | |||
| 41 | @Autowired | ||
| 36 | private RightsHistoryMapper RightsHistoryMapper; | 42 | private RightsHistoryMapper RightsHistoryMapper; |
| 37 | 43 | ||
| 38 | @Override | 44 | @Override |
| ... | @@ -56,6 +62,12 @@ public class RightsHistoryServiceImpl implements RightsHistoryService { | ... | @@ -56,6 +62,12 @@ public class RightsHistoryServiceImpl implements RightsHistoryService { |
| 56 | @Override | 62 | @Override |
| 57 | @Transactional(rollbackFor = Exception.class) | 63 | @Transactional(rollbackFor = Exception.class) |
| 58 | public void create(RightsHistory resources) { | 64 | public void create(RightsHistory resources) { |
| 65 | String memberCode = resources.getMemberCode(); | ||
| 66 | if (StringUtils.isNotBlank(memberCode)) { | ||
| 67 | MemberDTO memberDTO = this.memberService.getByCode(memberCode); | ||
| 68 | Long id = memberDTO.getId(); | ||
| 69 | resources.setMemberId(id); | ||
| 70 | } | ||
| 59 | RightsHistoryRepository.save(resources); | 71 | RightsHistoryRepository.save(resources); |
| 60 | } | 72 | } |
| 61 | 73 | ... | ... |
| 1 | package com.topdraw.business.basicdata.rights.history.service.mapper; | 1 | package com.topdraw.business.module.rights.history.service.mapper; |
| 2 | 2 | ||
| 3 | import com.topdraw.base.BaseMapper; | 3 | import com.topdraw.base.BaseMapper; |
| 4 | import com.topdraw.business.basicdata.rights.history.domain.RightsHistory; | 4 | import com.topdraw.business.module.rights.history.domain.RightsHistory; |
| 5 | import com.topdraw.business.basicdata.rights.history.service.dto.RightsHistoryDTO; | 5 | import com.topdraw.business.module.rights.history.service.dto.RightsHistoryDTO; |
| 6 | import org.mapstruct.Mapper; | 6 | import org.mapstruct.Mapper; |
| 7 | import org.mapstruct.ReportingPolicy; | 7 | import org.mapstruct.ReportingPolicy; |
| 8 | 8 | ... | ... |
| 1 | package com.topdraw.business.basicdata.rights.permanentrights.domain; | 1 | package com.topdraw.business.module.rights.permanentrights.domain; |
| 2 | 2 | ||
| 3 | import cn.hutool.core.bean.BeanUtil; | 3 | import cn.hutool.core.bean.BeanUtil; |
| 4 | import cn.hutool.core.bean.copier.CopyOptions; | 4 | import cn.hutool.core.bean.copier.CopyOptions; | ... | ... |
| 1 | package com.topdraw.business.basicdata.rights.permanentrights.repository; | 1 | package com.topdraw.business.module.rights.permanentrights.repository; |
| 2 | 2 | ||
| 3 | import com.topdraw.business.basicdata.rights.permanentrights.domain.PermanentRights; | 3 | import com.topdraw.business.module.rights.permanentrights.domain.PermanentRights; |
| 4 | import org.springframework.data.jpa.repository.JpaRepository; | 4 | import org.springframework.data.jpa.repository.JpaRepository; |
| 5 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; | 5 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; |
| 6 | 6 | ... | ... |
| 1 | package com.topdraw.business.basicdata.rights.permanentrights.rest; | 1 | package com.topdraw.business.module.rights.permanentrights.rest; |
| 2 | 2 | ||
| 3 | import com.topdraw.annotation.Log; | 3 | import com.topdraw.business.module.rights.permanentrights.domain.PermanentRights; |
| 4 | import com.topdraw.business.basicdata.rights.permanentrights.domain.PermanentRights; | 4 | import com.topdraw.business.module.rights.permanentrights.service.PermanentRightsService; |
| 5 | import com.topdraw.business.basicdata.rights.permanentrights.service.PermanentRightsService; | 5 | import com.topdraw.business.module.rights.permanentrights.service.dto.PermanentRightsQueryCriteria; |
| 6 | import com.topdraw.business.basicdata.rights.permanentrights.service.dto.PermanentRightsQueryCriteria; | ||
| 7 | import com.topdraw.common.ResultInfo; | 6 | import com.topdraw.common.ResultInfo; |
| 8 | import io.swagger.annotations.Api; | 7 | import io.swagger.annotations.Api; |
| 9 | import io.swagger.annotations.ApiOperation; | 8 | import io.swagger.annotations.ApiOperation; |
| ... | @@ -36,7 +35,6 @@ public class PermanentRightsController { | ... | @@ -36,7 +35,6 @@ public class PermanentRightsController { |
| 36 | return ResultInfo.success(PermanentRightsService.findById(id)); | 35 | return ResultInfo.success(PermanentRightsService.findById(id)); |
| 37 | } | 36 | } |
| 38 | 37 | ||
| 39 | @Log | ||
| 40 | @PostMapping(value = "/create") | 38 | @PostMapping(value = "/create") |
| 41 | @ApiOperation("新增PermanentRights") | 39 | @ApiOperation("新增PermanentRights") |
| 42 | public ResultInfo create(@Validated @RequestBody PermanentRights resources) { | 40 | public ResultInfo create(@Validated @RequestBody PermanentRights resources) { |
| ... | @@ -44,7 +42,6 @@ public class PermanentRightsController { | ... | @@ -44,7 +42,6 @@ public class PermanentRightsController { |
| 44 | return ResultInfo.success(); | 42 | return ResultInfo.success(); |
| 45 | } | 43 | } |
| 46 | 44 | ||
| 47 | @Log | ||
| 48 | @PutMapping(value = "/update") | 45 | @PutMapping(value = "/update") |
| 49 | @ApiOperation("修改PermanentRights") | 46 | @ApiOperation("修改PermanentRights") |
| 50 | public ResultInfo update(@Validated @RequestBody PermanentRights resources) { | 47 | public ResultInfo update(@Validated @RequestBody PermanentRights resources) { |
| ... | @@ -52,7 +49,6 @@ public class PermanentRightsController { | ... | @@ -52,7 +49,6 @@ public class PermanentRightsController { |
| 52 | return ResultInfo.success(); | 49 | return ResultInfo.success(); |
| 53 | } | 50 | } |
| 54 | 51 | ||
| 55 | @Log | ||
| 56 | @DeleteMapping(value = "/delete/{id}") | 52 | @DeleteMapping(value = "/delete/{id}") |
| 57 | @ApiOperation("删除PermanentRights") | 53 | @ApiOperation("删除PermanentRights") |
| 58 | public ResultInfo delete(@PathVariable Long id) { | 54 | public ResultInfo delete(@PathVariable Long id) { | ... | ... |
| 1 | package com.topdraw.business.basicdata.rights.permanentrights.service; | 1 | package com.topdraw.business.module.rights.permanentrights.service; |
| 2 | 2 | ||
| 3 | import com.topdraw.business.basicdata.rights.permanentrights.domain.PermanentRights; | 3 | import com.topdraw.business.module.rights.permanentrights.domain.PermanentRights; |
| 4 | import com.topdraw.business.basicdata.rights.permanentrights.service.dto.PermanentRightsDTO; | 4 | import com.topdraw.business.module.rights.permanentrights.service.dto.PermanentRightsDTO; |
| 5 | import com.topdraw.business.basicdata.rights.permanentrights.service.dto.PermanentRightsQueryCriteria; | 5 | import com.topdraw.business.module.rights.permanentrights.service.dto.PermanentRightsQueryCriteria; |
| 6 | import org.springframework.data.domain.Pageable; | 6 | import org.springframework.data.domain.Pageable; |
| 7 | 7 | ||
| 8 | import java.util.List; | 8 | import java.util.List; | ... | ... |
| 1 | package com.topdraw.business.basicdata.rights.permanentrights.service.impl; | 1 | package com.topdraw.business.module.rights.permanentrights.service.impl; |
| 2 | 2 | ||
| 3 | import com.topdraw.business.basicdata.rights.permanentrights.domain.PermanentRights; | 3 | import com.topdraw.business.module.rights.permanentrights.domain.PermanentRights; |
| 4 | import com.topdraw.business.basicdata.rights.permanentrights.repository.PermanentRightsRepository; | 4 | import com.topdraw.business.module.rights.permanentrights.repository.PermanentRightsRepository; |
| 5 | import com.topdraw.business.basicdata.rights.permanentrights.service.PermanentRightsService; | 5 | import com.topdraw.business.module.rights.permanentrights.service.PermanentRightsService; |
| 6 | import com.topdraw.business.basicdata.rights.permanentrights.service.dto.PermanentRightsDTO; | 6 | import com.topdraw.business.module.rights.permanentrights.service.dto.PermanentRightsDTO; |
| 7 | import com.topdraw.business.basicdata.rights.permanentrights.service.dto.PermanentRightsQueryCriteria; | 7 | import com.topdraw.business.module.rights.permanentrights.service.dto.PermanentRightsQueryCriteria; |
| 8 | import com.topdraw.business.basicdata.rights.permanentrights.service.mapper.PermanentRightsMapper; | 8 | import com.topdraw.business.module.rights.permanentrights.service.mapper.PermanentRightsMapper; |
| 9 | import com.topdraw.utils.PageUtil; | 9 | import com.topdraw.utils.PageUtil; |
| 10 | import com.topdraw.utils.QueryHelp; | 10 | import com.topdraw.utils.QueryHelp; |
| 11 | import com.topdraw.utils.StringUtils; | 11 | import com.topdraw.utils.StringUtils; | ... | ... |
| 1 | package com.topdraw.business.basicdata.rights.permanentrights.service.mapper; | 1 | package com.topdraw.business.module.rights.permanentrights.service.mapper; |
| 2 | 2 | ||
| 3 | import com.topdraw.base.BaseMapper; | 3 | import com.topdraw.base.BaseMapper; |
| 4 | import com.topdraw.business.basicdata.rights.permanentrights.domain.PermanentRights; | 4 | import com.topdraw.business.module.rights.permanentrights.domain.PermanentRights; |
| 5 | import com.topdraw.business.basicdata.rights.permanentrights.service.dto.PermanentRightsDTO; | 5 | import com.topdraw.business.module.rights.permanentrights.service.dto.PermanentRightsDTO; |
| 6 | import org.mapstruct.Mapper; | 6 | import org.mapstruct.Mapper; |
| 7 | import org.mapstruct.ReportingPolicy; | 7 | import org.mapstruct.ReportingPolicy; |
| 8 | 8 | ... | ... |
| 1 | package com.topdraw.business.basicdata.rights.repository; | 1 | package com.topdraw.business.module.rights.repository; |
| 2 | 2 | ||
| 3 | import com.topdraw.business.basicdata.rights.domain.Rights; | 3 | import com.topdraw.business.module.rights.domain.Rights; |
| 4 | import org.springframework.data.jpa.repository.JpaRepository; | 4 | import org.springframework.data.jpa.repository.JpaRepository; |
| 5 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; | 5 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; |
| 6 | import org.springframework.data.jpa.repository.Query; | 6 | import org.springframework.data.jpa.repository.Query; | ... | ... |
| 1 | package com.topdraw.business.basicdata.rights.rest; | 1 | package com.topdraw.business.module.rights.rest; |
| 2 | 2 | ||
| 3 | import com.topdraw.business.basicdata.rights.service.RightsService; | 3 | import com.topdraw.business.module.rights.service.RightsService; |
| 4 | import com.topdraw.common.ResultInfo; | 4 | import com.topdraw.common.ResultInfo; |
| 5 | import io.swagger.annotations.Api; | 5 | import io.swagger.annotations.Api; |
| 6 | import io.swagger.annotations.ApiOperation; | 6 | import io.swagger.annotations.ApiOperation; | ... | ... |
| 1 | package com.topdraw.business.basicdata.rights.service; | 1 | package com.topdraw.business.module.rights.service; |
| 2 | 2 | ||
| 3 | import com.topdraw.business.basicdata.rights.domain.Rights; | 3 | import com.topdraw.business.module.rights.domain.Rights; |
| 4 | import com.topdraw.business.basicdata.rights.service.dto.RightsDTO; | 4 | import com.topdraw.business.module.rights.service.dto.RightsDTO; |
| 5 | import com.topdraw.business.basicdata.rights.service.dto.RightsQueryCriteria; | 5 | import com.topdraw.business.module.rights.service.dto.RightsQueryCriteria; |
| 6 | import org.springframework.data.domain.Pageable; | 6 | import org.springframework.data.domain.Pageable; |
| 7 | 7 | ||
| 8 | import java.util.List; | 8 | import java.util.List; | ... | ... |
| 1 | package com.topdraw.business.basicdata.rights.service.impl; | 1 | package com.topdraw.business.module.rights.service.impl; |
| 2 | 2 | ||
| 3 | import com.topdraw.business.basicdata.rights.domain.Rights; | 3 | import com.topdraw.business.module.rights.domain.Rights; |
| 4 | import com.topdraw.business.basicdata.rights.repository.RightsRepository; | 4 | import com.topdraw.business.module.rights.repository.RightsRepository; |
| 5 | import com.topdraw.business.basicdata.rights.service.RightsService; | 5 | import com.topdraw.business.module.rights.service.RightsService; |
| 6 | import com.topdraw.business.basicdata.rights.service.dto.RightsDTO; | 6 | import com.topdraw.business.module.rights.service.dto.RightsDTO; |
| 7 | import com.topdraw.business.basicdata.rights.service.dto.RightsQueryCriteria; | 7 | import com.topdraw.business.module.rights.service.dto.RightsQueryCriteria; |
| 8 | import com.topdraw.business.basicdata.rights.service.mapper.RightsMapper; | 8 | import com.topdraw.business.module.rights.service.mapper.RightsMapper; |
| 9 | import com.topdraw.utils.PageUtil; | 9 | import com.topdraw.utils.PageUtil; |
| 10 | import com.topdraw.utils.QueryHelp; | 10 | import com.topdraw.utils.QueryHelp; |
| 11 | import com.topdraw.utils.StringUtils; | 11 | import com.topdraw.utils.StringUtils; | ... | ... |
| 1 | package com.topdraw.business.basicdata.rights.service.mapper; | 1 | package com.topdraw.business.module.rights.service.mapper; |
| 2 | 2 | ||
| 3 | import com.topdraw.base.BaseMapper; | 3 | import com.topdraw.base.BaseMapper; |
| 4 | import com.topdraw.business.basicdata.rights.domain.Rights; | 4 | import com.topdraw.business.module.rights.domain.Rights; |
| 5 | import com.topdraw.business.basicdata.rights.service.dto.RightsDTO; | 5 | import com.topdraw.business.module.rights.service.dto.RightsDTO; |
| 6 | import org.mapstruct.Mapper; | 6 | import org.mapstruct.Mapper; |
| 7 | import org.mapstruct.ReportingPolicy; | 7 | import org.mapstruct.ReportingPolicy; |
| 8 | 8 | ... | ... |
| 1 | package com.topdraw.business.basicdata.task.repository; | 1 | package com.topdraw.business.module.task.repository; |
| 2 | 2 | ||
| 3 | import com.topdraw.business.basicdata.task.domain.Task; | 3 | import com.topdraw.business.module.task.domain.Task; |
| 4 | import org.springframework.data.jpa.repository.JpaRepository; | 4 | import org.springframework.data.jpa.repository.JpaRepository; |
| 5 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; | 5 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; |
| 6 | 6 | ... | ... |
| 1 | package com.topdraw.business.basicdata.task.rest; | 1 | package com.topdraw.business.module.task.rest; |
| 2 | 2 | ||
| 3 | import com.topdraw.annotation.Log; | 3 | |
| 4 | import com.topdraw.business.basicdata.task.domain.Task; | 4 | import com.topdraw.aop.log.Log; |
| 5 | import com.topdraw.business.basicdata.task.service.TaskService; | 5 | import com.topdraw.business.module.task.domain.Task; |
| 6 | import com.topdraw.business.basicdata.task.service.dto.TaskQueryCriteria; | 6 | import com.topdraw.business.module.task.service.TaskService; |
| 7 | import com.topdraw.business.module.task.service.dto.TaskQueryCriteria; | ||
| 7 | import com.topdraw.common.ResultInfo; | 8 | import com.topdraw.common.ResultInfo; |
| 8 | import io.swagger.annotations.Api; | 9 | import io.swagger.annotations.Api; |
| 9 | import io.swagger.annotations.ApiOperation; | 10 | import io.swagger.annotations.ApiOperation; | ... | ... |
| 1 | package com.topdraw.business.basicdata.task.service; | 1 | package com.topdraw.business.module.task.service; |
| 2 | 2 | ||
| 3 | import com.topdraw.business.basicdata.task.domain.Task; | 3 | import com.topdraw.business.module.task.domain.Task; |
| 4 | import com.topdraw.business.basicdata.task.service.dto.TaskDTO; | 4 | import com.topdraw.business.module.task.service.dto.TaskDTO; |
| 5 | import com.topdraw.business.basicdata.task.service.dto.TaskQueryCriteria; | 5 | import com.topdraw.business.module.task.service.dto.TaskQueryCriteria; |
| 6 | import org.springframework.data.domain.Pageable; | 6 | import org.springframework.data.domain.Pageable; |
| 7 | 7 | ||
| 8 | import java.util.List; | 8 | import java.util.List; | ... | ... |
| 1 | package com.topdraw.business.basicdata.task.service.impl; | 1 | package com.topdraw.business.module.task.service.impl; |
| 2 | 2 | ||
| 3 | import com.topdraw.business.basicdata.task.domain.Task; | 3 | import com.topdraw.business.module.task.domain.Task; |
| 4 | import com.topdraw.business.basicdata.task.repository.TaskRepository; | 4 | import com.topdraw.business.module.task.repository.TaskRepository; |
| 5 | import com.topdraw.business.basicdata.task.service.TaskService; | 5 | import com.topdraw.business.module.task.service.TaskService; |
| 6 | import com.topdraw.business.basicdata.task.service.dto.TaskDTO; | 6 | import com.topdraw.business.module.task.service.dto.TaskDTO; |
| 7 | import com.topdraw.business.basicdata.task.service.dto.TaskQueryCriteria; | 7 | import com.topdraw.business.module.task.service.dto.TaskQueryCriteria; |
| 8 | import com.topdraw.business.basicdata.task.service.mapper.TaskMapper; | 8 | import com.topdraw.business.module.task.service.mapper.TaskMapper; |
| 9 | import com.topdraw.utils.PageUtil; | 9 | import com.topdraw.utils.PageUtil; |
| 10 | import com.topdraw.utils.QueryHelp; | 10 | import com.topdraw.utils.QueryHelp; |
| 11 | import com.topdraw.utils.ValidationUtil; | 11 | import com.topdraw.utils.ValidationUtil; | ... | ... |
| 1 | package com.topdraw.business.basicdata.task.service.mapper; | 1 | package com.topdraw.business.module.task.service.mapper; |
| 2 | 2 | ||
| 3 | import com.topdraw.base.BaseMapper; | 3 | import com.topdraw.base.BaseMapper; |
| 4 | import com.topdraw.business.basicdata.task.domain.Task; | 4 | import com.topdraw.business.module.task.domain.Task; |
| 5 | import com.topdraw.business.basicdata.task.service.dto.TaskDTO; | 5 | import com.topdraw.business.module.task.service.dto.TaskDTO; |
| 6 | import org.mapstruct.Mapper; | 6 | import org.mapstruct.Mapper; |
| 7 | import org.mapstruct.ReportingPolicy; | 7 | import org.mapstruct.ReportingPolicy; |
| 8 | 8 | ... | ... |
| 1 | package com.topdraw.business.basicdata.task.template.domain; | 1 | package com.topdraw.business.module.task.template.domain; |
| 2 | 2 | ||
| 3 | import cn.hutool.core.bean.BeanUtil; | 3 | import cn.hutool.core.bean.BeanUtil; |
| 4 | import cn.hutool.core.bean.copier.CopyOptions; | 4 | import cn.hutool.core.bean.copier.CopyOptions; | ... | ... |
| 1 | package com.topdraw.business.basicdata.task.template.repository; | 1 | package com.topdraw.business.module.task.template.repository; |
| 2 | 2 | ||
| 3 | import com.topdraw.business.basicdata.task.template.domain.TaskTemplate; | 3 | import com.topdraw.business.module.task.template.domain.TaskTemplate; |
| 4 | import org.springframework.data.jpa.repository.JpaRepository; | 4 | import org.springframework.data.jpa.repository.JpaRepository; |
| 5 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; | 5 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; |
| 6 | 6 | ... | ... |
| 1 | package com.topdraw.business.basicdata.task.template.rest; | 1 | package com.topdraw.business.module.task.template.rest; |
| 2 | 2 | ||
| 3 | import com.topdraw.annotation.Log; | 3 | import com.topdraw.business.module.task.template.domain.TaskTemplate; |
| 4 | import com.topdraw.business.basicdata.task.template.domain.TaskTemplate; | 4 | import com.topdraw.business.module.task.template.service.TaskTemplateService; |
| 5 | import com.topdraw.business.basicdata.task.template.service.TaskTemplateService; | 5 | import com.topdraw.business.module.task.template.service.dto.TaskTemplateQueryCriteria; |
| 6 | import com.topdraw.business.basicdata.task.template.service.dto.TaskTemplateQueryCriteria; | ||
| 7 | import com.topdraw.common.ResultInfo; | 6 | import com.topdraw.common.ResultInfo; |
| 8 | import io.swagger.annotations.Api; | 7 | import io.swagger.annotations.Api; |
| 9 | import io.swagger.annotations.ApiOperation; | 8 | import io.swagger.annotations.ApiOperation; |
| ... | @@ -36,7 +35,6 @@ public class TaskTemplateController { | ... | @@ -36,7 +35,6 @@ public class TaskTemplateController { |
| 36 | return ResultInfo.success(TaskTemplateService.queryAll(criteria)); | 35 | return ResultInfo.success(TaskTemplateService.queryAll(criteria)); |
| 37 | } | 36 | } |
| 38 | 37 | ||
| 39 | @Log | ||
| 40 | @PostMapping | 38 | @PostMapping |
| 41 | @ApiOperation("新增TaskTemplate") | 39 | @ApiOperation("新增TaskTemplate") |
| 42 | public ResultInfo create(@Validated @RequestBody TaskTemplate resources) { | 40 | public ResultInfo create(@Validated @RequestBody TaskTemplate resources) { |
| ... | @@ -44,7 +42,6 @@ public class TaskTemplateController { | ... | @@ -44,7 +42,6 @@ public class TaskTemplateController { |
| 44 | return ResultInfo.success(); | 42 | return ResultInfo.success(); |
| 45 | } | 43 | } |
| 46 | 44 | ||
| 47 | @Log | ||
| 48 | @PutMapping | 45 | @PutMapping |
| 49 | @ApiOperation("修改TaskTemplate") | 46 | @ApiOperation("修改TaskTemplate") |
| 50 | public ResultInfo update(@Validated @RequestBody TaskTemplate resources) { | 47 | public ResultInfo update(@Validated @RequestBody TaskTemplate resources) { |
| ... | @@ -52,8 +49,6 @@ public class TaskTemplateController { | ... | @@ -52,8 +49,6 @@ public class TaskTemplateController { |
| 52 | return ResultInfo.success(); | 49 | return ResultInfo.success(); |
| 53 | } | 50 | } |
| 54 | 51 | ||
| 55 | |||
| 56 | @Log | ||
| 57 | @DeleteMapping(value = "/{id}") | 52 | @DeleteMapping(value = "/{id}") |
| 58 | @ApiOperation("删除TaskTemplate") | 53 | @ApiOperation("删除TaskTemplate") |
| 59 | public ResultInfo delete(@PathVariable Long id) { | 54 | public ResultInfo delete(@PathVariable Long id) { | ... | ... |
| 1 | package com.topdraw.business.basicdata.task.template.service; | 1 | package com.topdraw.business.module.task.template.service; |
| 2 | 2 | ||
| 3 | import com.topdraw.business.basicdata.task.template.domain.TaskTemplate; | 3 | import com.topdraw.business.module.task.template.domain.TaskTemplate; |
| 4 | import com.topdraw.business.basicdata.task.template.service.dto.TaskTemplateDTO; | 4 | import com.topdraw.business.module.task.template.service.dto.TaskTemplateDTO; |
| 5 | import com.topdraw.business.basicdata.task.template.service.dto.TaskTemplateQueryCriteria; | 5 | import com.topdraw.business.module.task.template.service.dto.TaskTemplateQueryCriteria; |
| 6 | import org.springframework.data.domain.Pageable; | 6 | import org.springframework.data.domain.Pageable; |
| 7 | 7 | ||
| 8 | import java.util.List; | 8 | import java.util.List; | ... | ... |
| 1 | package com.topdraw.business.basicdata.task.template.service.impl; | 1 | package com.topdraw.business.module.task.template.service.impl; |
| 2 | 2 | ||
| 3 | import com.topdraw.business.basicdata.task.template.domain.TaskTemplate; | 3 | import com.topdraw.business.module.task.template.domain.TaskTemplate; |
| 4 | import com.topdraw.business.basicdata.task.template.repository.TaskTemplateRepository; | 4 | import com.topdraw.business.module.task.template.repository.TaskTemplateRepository; |
| 5 | import com.topdraw.business.basicdata.task.template.service.TaskTemplateService; | 5 | import com.topdraw.business.module.task.template.service.TaskTemplateService; |
| 6 | import com.topdraw.business.basicdata.task.template.service.dto.TaskTemplateDTO; | 6 | import com.topdraw.business.module.task.template.service.dto.TaskTemplateDTO; |
| 7 | import com.topdraw.business.basicdata.task.template.service.dto.TaskTemplateQueryCriteria; | 7 | import com.topdraw.business.module.task.template.service.dto.TaskTemplateQueryCriteria; |
| 8 | import com.topdraw.business.basicdata.task.template.service.mapper.TaskTemplateMapper; | 8 | import com.topdraw.business.module.task.template.service.mapper.TaskTemplateMapper; |
| 9 | import com.topdraw.utils.PageUtil; | 9 | import com.topdraw.utils.PageUtil; |
| 10 | import com.topdraw.utils.QueryHelp; | 10 | import com.topdraw.utils.QueryHelp; |
| 11 | import com.topdraw.utils.StringUtils; | 11 | import com.topdraw.utils.StringUtils; | ... | ... |
| 1 | package com.topdraw.business.basicdata.task.template.service.mapper; | 1 | package com.topdraw.business.module.task.template.service.mapper; |
| 2 | 2 | ||
| 3 | import com.topdraw.base.BaseMapper; | 3 | import com.topdraw.base.BaseMapper; |
| 4 | import com.topdraw.business.basicdata.task.template.domain.TaskTemplate; | 4 | import com.topdraw.business.module.task.template.domain.TaskTemplate; |
| 5 | import com.topdraw.business.basicdata.task.template.service.dto.TaskTemplateDTO; | 5 | import com.topdraw.business.module.task.template.service.dto.TaskTemplateDTO; |
| 6 | import org.mapstruct.Mapper; | 6 | import org.mapstruct.Mapper; |
| 7 | import org.mapstruct.ReportingPolicy; | 7 | import org.mapstruct.ReportingPolicy; |
| 8 | 8 | ... | ... |
| 1 | package com.topdraw.business.module.user.iptv.domain; | ||
| 2 | |||
| 3 | import java.util.Arrays; | ||
| 4 | import java.util.List; | ||
| 5 | |||
| 6 | public interface UserConstant { | ||
| 7 | |||
| 8 | // 电信 | ||
| 9 | List<String> platform_lt = Arrays.asList("SC.CTCC","SC.CTC","CTC.ChongQing","ChongQing.CTC","CQ.CTC","CQ.CTCC"); | ||
| 10 | // 移动 | ||
| 11 | List<String> platform_yd = Arrays.asList("SC.CMCC","CMCC.SC","ChongQing.CMCC","CMCC.ChongQing"); | ||
| 12 | // 联通 | ||
| 13 | List<String> platform_dx = Arrays.asList("SC.CUCC",""); | ||
| 14 | |||
| 15 | } |
| 1 | package com.topdraw.business.basicdata.user.iptv.domain; | 1 | package com.topdraw.business.module.user.iptv.domain; |
| 2 | 2 | ||
| 3 | import cn.hutool.core.bean.BeanUtil; | 3 | import cn.hutool.core.bean.BeanUtil; |
| 4 | import cn.hutool.core.bean.copier.CopyOptions; | 4 | import cn.hutool.core.bean.copier.CopyOptions; |
| ... | @@ -11,6 +11,7 @@ import org.springframework.data.jpa.domain.support.AuditingEntityListener; | ... | @@ -11,6 +11,7 @@ import org.springframework.data.jpa.domain.support.AuditingEntityListener; |
| 11 | import javax.persistence.*; | 11 | import javax.persistence.*; |
| 12 | import java.io.Serializable; | 12 | import java.io.Serializable; |
| 13 | import java.sql.Timestamp; | 13 | import java.sql.Timestamp; |
| 14 | import java.time.LocalDateTime; | ||
| 14 | 15 | ||
| 15 | /** | 16 | /** |
| 16 | * @author XiangHan | 17 | * @author XiangHan |
| ... | @@ -23,6 +24,10 @@ import java.sql.Timestamp; | ... | @@ -23,6 +24,10 @@ import java.sql.Timestamp; |
| 23 | @Table(name="uc_user_tv") | 24 | @Table(name="uc_user_tv") |
| 24 | public class UserTv implements Serializable { | 25 | public class UserTv implements Serializable { |
| 25 | 26 | ||
| 27 | /** 绑定的小屏账户会员编码 */ | ||
| 28 | @Column(name = "priority_member_code") | ||
| 29 | private String priorityMemberCode; | ||
| 30 | |||
| 26 | @Transient | 31 | @Transient |
| 27 | private String memberCode; | 32 | private String memberCode; |
| 28 | 33 | ||
| ... | @@ -74,7 +79,7 @@ public class UserTv implements Serializable { | ... | @@ -74,7 +79,7 @@ public class UserTv implements Serializable { |
| 74 | 79 | ||
| 75 | // 活跃时间 | 80 | // 活跃时间 |
| 76 | @Column(name = "`active_time`") | 81 | @Column(name = "`active_time`") |
| 77 | private Timestamp activeTime; | 82 | private LocalDateTime activeTime; |
| 78 | 83 | ||
| 79 | // 分组 分组ID用逗号分隔 | 84 | // 分组 分组ID用逗号分隔 |
| 80 | @Column(name = "`groups`") | 85 | @Column(name = "`groups`") |
| ... | @@ -103,7 +108,7 @@ public class UserTv implements Serializable { | ... | @@ -103,7 +108,7 @@ public class UserTv implements Serializable { |
| 103 | // 创建时间 | 108 | // 创建时间 |
| 104 | @CreatedDate | 109 | @CreatedDate |
| 105 | @Column(name = "`create_time`") | 110 | @Column(name = "`create_time`") |
| 106 | private Timestamp createTime; | 111 | private LocalDateTime createTime; |
| 107 | 112 | ||
| 108 | // 更新者 | 113 | // 更新者 |
| 109 | @Column(name = "`update_by`") | 114 | @Column(name = "`update_by`") |
| ... | @@ -112,7 +117,7 @@ public class UserTv implements Serializable { | ... | @@ -112,7 +117,7 @@ public class UserTv implements Serializable { |
| 112 | // 更新时间 | 117 | // 更新时间 |
| 113 | @LastModifiedDate | 118 | @LastModifiedDate |
| 114 | @Column(name = "`update_time`") | 119 | @Column(name = "`update_time`") |
| 115 | private Timestamp updateTime; | 120 | private LocalDateTime updateTime; |
| 116 | 121 | ||
| 117 | // 会员id | 122 | // 会员id |
| 118 | @Column(name = "`member_id`") | 123 | @Column(name = "`member_id`") | ... | ... |
| 1 | package com.topdraw.business.basicdata.user.iptv.repository; | 1 | package com.topdraw.business.module.user.iptv.repository; |
| 2 | 2 | ||
| 3 | import com.topdraw.business.basicdata.user.iptv.domain.UserTv; | 3 | import com.topdraw.business.module.user.iptv.domain.UserTv; |
| 4 | import org.springframework.data.jpa.repository.JpaRepository; | 4 | import org.springframework.data.jpa.repository.JpaRepository; |
| 5 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; | 5 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; |
| 6 | 6 | ... | ... |
| 1 | package com.topdraw.business.basicdata.user.iptv.rest; | 1 | package com.topdraw.business.module.user.iptv.rest; |
| 2 | 2 | ||
| 3 | import com.topdraw.annotation.Log; | 3 | import com.topdraw.business.module.user.iptv.domain.UserTv; |
| 4 | import com.topdraw.business.basicdata.user.iptv.domain.UserTv; | 4 | import com.topdraw.business.module.user.iptv.service.UserTvService; |
| 5 | import com.topdraw.business.basicdata.user.iptv.service.UserTvService; | 5 | import com.topdraw.business.module.user.iptv.service.dto.UserTvQueryCriteria; |
| 6 | import com.topdraw.business.basicdata.user.iptv.service.dto.UserTvQueryCriteria; | ||
| 7 | import com.topdraw.common.ResultInfo; | 6 | import com.topdraw.common.ResultInfo; |
| 8 | import io.swagger.annotations.Api; | 7 | import io.swagger.annotations.Api; |
| 9 | import io.swagger.annotations.ApiOperation; | 8 | import io.swagger.annotations.ApiOperation; |
| ... | @@ -36,7 +35,6 @@ public class UserTvController { | ... | @@ -36,7 +35,6 @@ public class UserTvController { |
| 36 | return ResultInfo.success(UserTvService.queryAll(criteria)); | 35 | return ResultInfo.success(UserTvService.queryAll(criteria)); |
| 37 | } | 36 | } |
| 38 | 37 | ||
| 39 | @Log | ||
| 40 | @PostMapping | 38 | @PostMapping |
| 41 | @ApiOperation("新增UserTv") | 39 | @ApiOperation("新增UserTv") |
| 42 | public ResultInfo create(@Validated @RequestBody UserTv resources) { | 40 | public ResultInfo create(@Validated @RequestBody UserTv resources) { |
| ... | @@ -44,7 +42,6 @@ public class UserTvController { | ... | @@ -44,7 +42,6 @@ public class UserTvController { |
| 44 | return ResultInfo.success(); | 42 | return ResultInfo.success(); |
| 45 | } | 43 | } |
| 46 | 44 | ||
| 47 | @Log | ||
| 48 | @PutMapping | 45 | @PutMapping |
| 49 | @ApiOperation("修改UserTv") | 46 | @ApiOperation("修改UserTv") |
| 50 | public ResultInfo update(@Validated @RequestBody UserTv resources) { | 47 | public ResultInfo update(@Validated @RequestBody UserTv resources) { |
| ... | @@ -52,7 +49,6 @@ public class UserTvController { | ... | @@ -52,7 +49,6 @@ public class UserTvController { |
| 52 | return ResultInfo.success(); | 49 | return ResultInfo.success(); |
| 53 | } | 50 | } |
| 54 | 51 | ||
| 55 | @Log | ||
| 56 | @DeleteMapping(value = "/{id}") | 52 | @DeleteMapping(value = "/{id}") |
| 57 | @ApiOperation("删除UserTv") | 53 | @ApiOperation("删除UserTv") |
| 58 | public ResultInfo delete(@PathVariable Long id) { | 54 | public ResultInfo delete(@PathVariable Long id) { | ... | ... |
| 1 | package com.topdraw.business.basicdata.user.iptv.service; | 1 | package com.topdraw.business.module.user.iptv.service; |
| 2 | 2 | ||
| 3 | import com.topdraw.business.basicdata.user.iptv.domain.UserTv; | 3 | import com.topdraw.business.module.user.iptv.domain.UserTv; |
| 4 | import com.topdraw.business.basicdata.user.iptv.service.dto.UserTvDTO; | 4 | import com.topdraw.business.module.user.iptv.service.dto.UserTvDTO; |
| 5 | import com.topdraw.business.basicdata.user.iptv.service.dto.UserTvQueryCriteria; | 5 | import com.topdraw.business.module.user.iptv.service.dto.UserTvQueryCriteria; |
| 6 | import org.springframework.data.domain.Pageable; | 6 | import org.springframework.data.domain.Pageable; |
| 7 | import org.springframework.transaction.annotation.Transactional; | ||
| 7 | 8 | ||
| 8 | import java.util.List; | 9 | import java.util.List; |
| 9 | import java.util.Map; | 10 | import java.util.Map; |
| ... | @@ -40,6 +41,9 @@ public interface UserTvService { | ... | @@ -40,6 +41,9 @@ public interface UserTvService { |
| 40 | 41 | ||
| 41 | void update(UserTv resources); | 42 | void update(UserTv resources); |
| 42 | 43 | ||
| 44 | @Transactional(rollbackFor = Exception.class) | ||
| 45 | void unbindPriorityMemberCode(UserTv resources); | ||
| 46 | |||
| 43 | void delete(Long id); | 47 | void delete(Long id); |
| 44 | 48 | ||
| 45 | UserTvDTO findByPlatformAccount(String platformAccount); | 49 | UserTvDTO findByPlatformAccount(String platformAccount); | ... | ... |
| 1 | package com.topdraw.business.basicdata.user.iptv.service.dto; | 1 | package com.topdraw.business.module.user.iptv.service.dto; |
| 2 | 2 | ||
| 3 | import lombok.Data; | 3 | import lombok.Data; |
| 4 | 4 | ||
| 5 | import java.io.Serializable; | 5 | import java.io.Serializable; |
| 6 | import java.sql.Timestamp; | 6 | import java.sql.Timestamp; |
| 7 | import java.time.LocalDateTime; | ||
| 7 | 8 | ||
| 8 | 9 | ||
| 9 | /** | 10 | /** |
| ... | @@ -47,7 +48,7 @@ public class UserTvDTO implements Serializable { | ... | @@ -47,7 +48,7 @@ public class UserTvDTO implements Serializable { |
| 47 | private Integer continueDays; | 48 | private Integer continueDays; |
| 48 | 49 | ||
| 49 | // 活跃时间 | 50 | // 活跃时间 |
| 50 | private Timestamp activeTime; | 51 | private LocalDateTime activeTime; |
| 51 | 52 | ||
| 52 | // 分组 分组ID用逗号分隔 | 53 | // 分组 分组ID用逗号分隔 |
| 53 | private String groups; | 54 | private String groups; |
| ... | @@ -68,13 +69,13 @@ public class UserTvDTO implements Serializable { | ... | @@ -68,13 +69,13 @@ public class UserTvDTO implements Serializable { |
| 68 | private String createBy; | 69 | private String createBy; |
| 69 | 70 | ||
| 70 | // 创建时间 | 71 | // 创建时间 |
| 71 | private Timestamp createTime; | 72 | private LocalDateTime createTime; |
| 72 | 73 | ||
| 73 | // 更新者 | 74 | // 更新者 |
| 74 | private String updateBy; | 75 | private String updateBy; |
| 75 | 76 | ||
| 76 | // 更新时间 | 77 | // 更新时间 |
| 77 | private Timestamp updateTime; | 78 | private LocalDateTime updateTime; |
| 78 | 79 | ||
| 79 | // 会员id | 80 | // 会员id |
| 80 | private Long memberId; | 81 | private Long memberId; | ... | ... |
| 1 | package com.topdraw.business.basicdata.user.iptv.service.impl; | 1 | package com.topdraw.business.module.user.iptv.service.impl; |
| 2 | 2 | ||
| 3 | import com.topdraw.business.basicdata.member.service.MemberService; | 3 | import com.topdraw.business.module.member.service.MemberService; |
| 4 | import com.topdraw.business.basicdata.member.service.dto.MemberDTO; | 4 | import com.topdraw.business.module.member.service.dto.MemberDTO; |
| 5 | import com.topdraw.business.basicdata.user.iptv.domain.UserTv; | 5 | import com.topdraw.business.module.user.iptv.domain.UserTv; |
| 6 | import com.topdraw.business.basicdata.user.iptv.repository.UserTvRepository; | 6 | import com.topdraw.business.module.user.iptv.repository.UserTvRepository; |
| 7 | import com.topdraw.business.basicdata.user.iptv.service.UserTvService; | 7 | import com.topdraw.business.module.user.iptv.service.UserTvService; |
| 8 | import com.topdraw.business.basicdata.user.iptv.service.dto.UserTvDTO; | 8 | import com.topdraw.business.module.user.iptv.service.dto.UserTvDTO; |
| 9 | import com.topdraw.business.basicdata.user.iptv.service.dto.UserTvQueryCriteria; | 9 | import com.topdraw.business.module.user.iptv.service.dto.UserTvQueryCriteria; |
| 10 | import com.topdraw.business.basicdata.user.iptv.service.mapper.UserTvMapper; | 10 | import com.topdraw.business.module.user.iptv.service.mapper.UserTvMapper; |
| 11 | import com.topdraw.utils.PageUtil; | 11 | import com.topdraw.utils.PageUtil; |
| 12 | import com.topdraw.utils.QueryHelp; | 12 | import com.topdraw.utils.QueryHelp; |
| 13 | import com.topdraw.utils.ValidationUtil; | 13 | import com.topdraw.utils.ValidationUtil; |
| 14 | import org.springframework.beans.BeanUtils; | ||
| 14 | import org.springframework.beans.factory.annotation.Autowired; | 15 | import org.springframework.beans.factory.annotation.Autowired; |
| 15 | import org.springframework.dao.EmptyResultDataAccessException; | 16 | import org.springframework.dao.EmptyResultDataAccessException; |
| 16 | import org.springframework.data.domain.Page; | 17 | import org.springframework.data.domain.Page; |
| ... | @@ -20,6 +21,7 @@ import org.springframework.transaction.annotation.Propagation; | ... | @@ -20,6 +21,7 @@ import org.springframework.transaction.annotation.Propagation; |
| 20 | import org.springframework.transaction.annotation.Transactional; | 21 | import org.springframework.transaction.annotation.Transactional; |
| 21 | import org.springframework.util.Assert; | 22 | import org.springframework.util.Assert; |
| 22 | 23 | ||
| 24 | import java.time.LocalDateTime; | ||
| 23 | import java.util.List; | 25 | import java.util.List; |
| 24 | import java.util.Map; | 26 | import java.util.Map; |
| 25 | import java.util.Objects; | 27 | import java.util.Objects; |
| ... | @@ -75,10 +77,33 @@ public class UserTvServiceImpl implements UserTvService { | ... | @@ -75,10 +77,33 @@ public class UserTvServiceImpl implements UserTvService { |
| 75 | @Override | 77 | @Override |
| 76 | @Transactional(rollbackFor = Exception.class) | 78 | @Transactional(rollbackFor = Exception.class) |
| 77 | public void update(UserTv resources) { | 79 | public void update(UserTv resources) { |
| 78 | UserTv UserTv = UserTvRepository.findById(resources.getId()).orElseGet(UserTv::new); | 80 | |
| 79 | ValidationUtil.isNull( UserTv.getId(),"UserTv","id",resources.getId()); | 81 | String platformAccount = resources.getPlatformAccount(); |
| 80 | UserTv.copy(resources); | 82 | UserTvDTO userTvDTO = this.findByPlatformAccount(platformAccount); |
| 81 | UserTvRepository.save(UserTv); | 83 | ValidationUtil.isNull(userTvDTO.getId(),"UserTv","id",resources.getId()); |
| 84 | |||
| 85 | UserTv userTv = new UserTv(); | ||
| 86 | BeanUtils.copyProperties(resources,userTv); | ||
| 87 | |||
| 88 | userTv.setId(userTvDTO.getId()); | ||
| 89 | userTv.setMemberId(userTvDTO.getMemberId()); | ||
| 90 | userTv.setUpdateTime(LocalDateTime.now()); | ||
| 91 | UserTvRepository.save(userTv); | ||
| 92 | } | ||
| 93 | |||
| 94 | |||
| 95 | @Override | ||
| 96 | @Transactional(rollbackFor = Exception.class) | ||
| 97 | public void unbindPriorityMemberCode(UserTv resources) { | ||
| 98 | String platformAccount = resources.getPlatformAccount(); | ||
| 99 | UserTvDTO userTvDTO = this.findByPlatformAccount(platformAccount); | ||
| 100 | // UserTv UserTv = UserTvRepository.findById(resources.getId()).orElseGet(UserTv::new); | ||
| 101 | ValidationUtil.isNull( userTvDTO.getId(),"UserTv","id",resources.getId()); | ||
| 102 | //UserTv.copy(resources); | ||
| 103 | UserTv userTv = new UserTv(); | ||
| 104 | BeanUtils.copyProperties(userTvDTO,userTv); | ||
| 105 | userTv.setPriorityMemberCode(null); | ||
| 106 | UserTvRepository.save(userTv); | ||
| 82 | } | 107 | } |
| 83 | 108 | ||
| 84 | @Override | 109 | @Override | ... | ... |
| 1 | package com.topdraw.business.basicdata.user.iptv.service.mapper; | 1 | package com.topdraw.business.module.user.iptv.service.mapper; |
| 2 | 2 | ||
| 3 | import com.topdraw.base.BaseMapper; | 3 | import com.topdraw.base.BaseMapper; |
| 4 | import com.topdraw.business.basicdata.user.iptv.domain.UserTv; | 4 | import com.topdraw.business.module.user.iptv.domain.UserTv; |
| 5 | import com.topdraw.business.basicdata.user.iptv.service.dto.UserTvDTO; | 5 | import com.topdraw.business.module.user.iptv.service.dto.UserTvDTO; |
| 6 | import org.mapstruct.Mapper; | 6 | import org.mapstruct.Mapper; |
| 7 | import org.mapstruct.ReportingPolicy; | 7 | import org.mapstruct.ReportingPolicy; |
| 8 | 8 | ... | ... |
src/main/java/com/topdraw/business/module/user/weixin/collection/domain/UserCollection.java
0 → 100644
| 1 | package com.topdraw.business.module.user.weixin.collection.domain; | ||
| 2 | |||
| 3 | import cn.hutool.core.bean.BeanUtil; | ||
| 4 | import cn.hutool.core.bean.copier.CopyOptions; | ||
| 5 | import lombok.Data; | ||
| 6 | import lombok.experimental.Accessors; | ||
| 7 | import org.springframework.data.annotation.CreatedDate; | ||
| 8 | import org.springframework.data.annotation.LastModifiedDate; | ||
| 9 | import org.springframework.data.jpa.domain.support.AuditingEntityListener; | ||
| 10 | |||
| 11 | import javax.persistence.*; | ||
| 12 | import java.io.Serializable; | ||
| 13 | import java.sql.Timestamp; | ||
| 14 | |||
| 15 | /** | ||
| 16 | * @author pengmengqing | ||
| 17 | * @date 2021-04-02 | ||
| 18 | */ | ||
| 19 | @Entity | ||
| 20 | @Data | ||
| 21 | @EntityListeners(AuditingEntityListener.class) | ||
| 22 | @Accessors(chain = true) | ||
| 23 | @Table(name="uc_user_collection") | ||
| 24 | public class UserCollection implements Serializable { | ||
| 25 | |||
| 26 | // ID | ||
| 27 | @Id | ||
| 28 | @GeneratedValue(strategy = GenerationType.IDENTITY) | ||
| 29 | @Column(name = "id") | ||
| 30 | private Long id; | ||
| 31 | |||
| 32 | // 应用ID | ||
| 33 | @Column(name = "app_id") | ||
| 34 | private Long appId; | ||
| 35 | |||
| 36 | // 用户ID | ||
| 37 | @Column(name = "user_id") | ||
| 38 | private Long userId; | ||
| 39 | |||
| 40 | // 收藏夹类型:1-收藏 2-播放记录 3-播放列表 4-评分 5-点赞/关注/订阅 | ||
| 41 | @Column(name = "type") | ||
| 42 | private Integer type; | ||
| 43 | |||
| 44 | // 收藏夹名称 | ||
| 45 | @Column(name = "name") | ||
| 46 | private String name; | ||
| 47 | |||
| 48 | // 数量 | ||
| 49 | @Column(name = "count") | ||
| 50 | private Integer count; | ||
| 51 | |||
| 52 | // 创建时间 | ||
| 53 | @CreatedDate | ||
| 54 | @Column(name = "create_time") | ||
| 55 | private Timestamp createTime; | ||
| 56 | |||
| 57 | // 更新时间 | ||
| 58 | @LastModifiedDate | ||
| 59 | @Column(name = "update_time") | ||
| 60 | private Timestamp updateTime; | ||
| 61 | |||
| 62 | public void copy(UserCollection source){ | ||
| 63 | BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true)); | ||
| 64 | } | ||
| 65 | } |
src/main/java/com/topdraw/business/module/user/weixin/collection/domain/UserCollectionDetail.java
0 → 100644
| 1 | package com.topdraw.business.module.user.weixin.collection.domain; | ||
| 2 | |||
| 3 | import cn.hutool.core.bean.BeanUtil; | ||
| 4 | import cn.hutool.core.bean.copier.CopyOptions; | ||
| 5 | import lombok.Data; | ||
| 6 | import lombok.experimental.Accessors; | ||
| 7 | import org.springframework.data.jpa.domain.support.AuditingEntityListener; | ||
| 8 | |||
| 9 | import javax.persistence.*; | ||
| 10 | import java.io.Serializable; | ||
| 11 | import java.sql.Timestamp; | ||
| 12 | |||
| 13 | /** | ||
| 14 | * @author pengmengqing | ||
| 15 | * @date 2021-04-02 | ||
| 16 | */ | ||
| 17 | @Entity | ||
| 18 | @Data | ||
| 19 | @EntityListeners(AuditingEntityListener.class) | ||
| 20 | @Accessors(chain = true) | ||
| 21 | @Table(name="uc_user_collection_detail") | ||
| 22 | public class UserCollectionDetail implements Serializable { | ||
| 23 | |||
| 24 | @ManyToOne(fetch = FetchType.EAGER) | ||
| 25 | @JoinColumn(name = "user_collection_id", insertable = false, updatable = false) | ||
| 26 | private UserCollection userCollection; | ||
| 27 | |||
| 28 | // ID | ||
| 29 | @Id | ||
| 30 | @GeneratedValue(strategy = GenerationType.IDENTITY) | ||
| 31 | @Column(name = "id") | ||
| 32 | private Long id; | ||
| 33 | |||
| 34 | // 收藏夹ID | ||
| 35 | @Column(name = "user_collection_id") | ||
| 36 | private Long userCollectionId; | ||
| 37 | |||
| 38 | // 自定义收藏内容的类型CODE,默认:DEFAULT | ||
| 39 | @Column(name = "detail_folder_code") | ||
| 40 | private String detailFolderCode; | ||
| 41 | |||
| 42 | // 收藏内容的类型:MEDIA|EPISODE|CATEGORY|SUBJECT|ARTICLE|ARTIST|SCHOOL | ||
| 43 | @Column(name = "detail_type") | ||
| 44 | private String detailType; | ||
| 45 | |||
| 46 | // 收藏内容的ID | ||
| 47 | @Column(name = "detail_id") | ||
| 48 | private Long detailId; | ||
| 49 | |||
| 50 | // 收藏内容的CODE | ||
| 51 | @Column(name = "detail_code") | ||
| 52 | private String detailCode; | ||
| 53 | |||
| 54 | // 收藏内容的剧集ID | ||
| 55 | @Column(name = "detail_episode_id") | ||
| 56 | private Long detailEpisodeId; | ||
| 57 | |||
| 58 | // 收藏内容的剧集CODE | ||
| 59 | @Column(name = "detail_episode_code") | ||
| 60 | private String detailEpisodeCode; | ||
| 61 | |||
| 62 | // 收藏内容的名称 | ||
| 63 | @Column(name = "detail_name") | ||
| 64 | private String detailName; | ||
| 65 | |||
| 66 | // 收藏内容的标记 | ||
| 67 | @Column(name = "detail_mark") | ||
| 68 | private Integer detailMark; | ||
| 69 | |||
| 70 | // 收藏内容的图片 | ||
| 71 | @Column(name = "detail_img") | ||
| 72 | private String detailImg; | ||
| 73 | |||
| 74 | // 收藏内容的剧集序号 | ||
| 75 | @Column(name = "detail_index") | ||
| 76 | private Integer detailIndex; | ||
| 77 | |||
| 78 | // 收藏内容的剧集总数 | ||
| 79 | @Column(name = "detail_total_index") | ||
| 80 | private Integer detailTotalIndex; | ||
| 81 | |||
| 82 | // 收藏内容的播放时间 | ||
| 83 | @Column(name = "detail_play_time") | ||
| 84 | private Integer detailPlayTime; | ||
| 85 | |||
| 86 | // 收藏内容的总时间 | ||
| 87 | @Column(name = "detail_total_time") | ||
| 88 | private Integer detailTotalTime; | ||
| 89 | |||
| 90 | // 收藏内容在同一folder中的顺序 | ||
| 91 | @Column(name = "detail_sequence") | ||
| 92 | private Integer detailSequence; | ||
| 93 | |||
| 94 | // 收藏内容的评分 | ||
| 95 | @Column(name = "detail_score") | ||
| 96 | private Float detailScore; | ||
| 97 | |||
| 98 | // 收藏内容(根据文件夹和类型的不同)的点赞/关注/订阅 | ||
| 99 | @Column(name = "detail_like") | ||
| 100 | private Integer detailLike; | ||
| 101 | |||
| 102 | // 收藏内容的扩展数据 | ||
| 103 | @Column(name = "detail_ext_data") | ||
| 104 | private String detailExtData; | ||
| 105 | |||
| 106 | // 创建时间 | ||
| 107 | @Column(name = "create_time") | ||
| 108 | private Timestamp createTime; | ||
| 109 | |||
| 110 | // 更新时间 | ||
| 111 | @Column(name = "update_time") | ||
| 112 | private Timestamp updateTime; | ||
| 113 | |||
| 114 | public void copy(UserCollectionDetail source){ | ||
| 115 | BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true)); | ||
| 116 | } | ||
| 117 | } |
| 1 | package com.topdraw.business.module.user.weixin.collection.repository; | ||
| 2 | |||
| 3 | import com.topdraw.business.module.user.weixin.collection.domain.UserCollectionDetail; | ||
| 4 | import org.springframework.data.jpa.repository.JpaRepository; | ||
| 5 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; | ||
| 6 | import org.springframework.data.jpa.repository.Modifying; | ||
| 7 | |||
| 8 | import java.util.Optional; | ||
| 9 | |||
| 10 | /** | ||
| 11 | * @author pengmengqing | ||
| 12 | * @date 2021-04-02 | ||
| 13 | */ | ||
| 14 | public interface UserCollectionDetailRepository extends JpaRepository<UserCollectionDetail, Long>, JpaSpecificationExecutor<UserCollectionDetail> { | ||
| 15 | |||
| 16 | @Modifying | ||
| 17 | void deleteAllByUserCollectionId(Long userCollectionId); | ||
| 18 | |||
| 19 | Optional<UserCollectionDetail> findByDetailIdAndDetailTypeAndUserCollectionId(Long detailId, String detailType, Long userCollectionId); | ||
| 20 | } |
| 1 | package com.topdraw.business.module.user.weixin.collection.repository; | ||
| 2 | |||
| 3 | |||
| 4 | import com.topdraw.business.module.user.weixin.collection.domain.UserCollection; | ||
| 5 | import org.springframework.data.jpa.repository.JpaRepository; | ||
| 6 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; | ||
| 7 | |||
| 8 | import java.util.List; | ||
| 9 | import java.util.Optional; | ||
| 10 | |||
| 11 | /** | ||
| 12 | * @author pengmengqing | ||
| 13 | * @date 2021-04-02 | ||
| 14 | */ | ||
| 15 | public interface UserCollectionRepository extends JpaRepository<UserCollection, Long>, JpaSpecificationExecutor<UserCollection> { | ||
| 16 | |||
| 17 | Optional<UserCollection> findFirstByUserIdAndTypeAndName(Long userId, Integer type, String name); | ||
| 18 | |||
| 19 | List<UserCollection> findByUserIdAndType(Long userId, Integer type); | ||
| 20 | |||
| 21 | } |
| 1 | package com.topdraw.business.module.user.weixin.collection.service; | ||
| 2 | |||
| 3 | import com.topdraw.business.module.user.weixin.collection.domain.UserCollectionDetail; | ||
| 4 | import com.topdraw.business.module.user.weixin.collection.service.dto.UserCollectionDetailDTO; | ||
| 5 | import com.topdraw.business.module.user.weixin.collection.service.dto.UserCollectionDetailQueryCriteria; | ||
| 6 | import org.springframework.data.domain.Pageable; | ||
| 7 | |||
| 8 | import java.util.List; | ||
| 9 | import java.util.Map; | ||
| 10 | |||
| 11 | /** | ||
| 12 | * @author pengmengqing | ||
| 13 | * @date 2021-04-02 | ||
| 14 | */ | ||
| 15 | public interface UserCollectionDetailService { | ||
| 16 | |||
| 17 | /** | ||
| 18 | * 查询数据分页 | ||
| 19 | * @param criteria 条件参数 | ||
| 20 | * @param pageable 分页参数 | ||
| 21 | * @return Map<String,Object> | ||
| 22 | */ | ||
| 23 | Map<String,Object> queryAll(UserCollectionDetailQueryCriteria criteria, Pageable pageable); | ||
| 24 | |||
| 25 | /** | ||
| 26 | * 根据ID查询 | ||
| 27 | * @param id ID | ||
| 28 | * @return UserCollectionDetailDTO | ||
| 29 | */ | ||
| 30 | UserCollectionDetailDTO findById(Long id); | ||
| 31 | |||
| 32 | UserCollectionDetailDTO create(UserCollectionDetail resources); | ||
| 33 | |||
| 34 | void update(UserCollectionDetail resources); | ||
| 35 | |||
| 36 | void delete(Long id); | ||
| 37 | |||
| 38 | void deleteAllByUserCollectionId(Long id); | ||
| 39 | |||
| 40 | void deleteAll(List<UserCollectionDetail> userCollectionDetailOptional); | ||
| 41 | } |
src/main/java/com/topdraw/business/module/user/weixin/collection/service/UserCollectionService.java
0 → 100644
| 1 | package com.topdraw.business.module.user.weixin.collection.service; | ||
| 2 | |||
| 3 | import com.topdraw.business.module.user.weixin.collection.domain.UserCollection; | ||
| 4 | import com.topdraw.business.module.user.weixin.collection.service.dto.UserCollectionDTO; | ||
| 5 | import com.topdraw.business.module.user.weixin.collection.service.dto.UserCollectionQueryCriteria; | ||
| 6 | import org.springframework.data.domain.Pageable; | ||
| 7 | |||
| 8 | import javax.servlet.http.HttpServletResponse; | ||
| 9 | import java.io.IOException; | ||
| 10 | import java.util.List; | ||
| 11 | import java.util.Map; | ||
| 12 | import java.util.Optional; | ||
| 13 | |||
| 14 | /** | ||
| 15 | * @author pengmengqing | ||
| 16 | * @date 2021-04-02 | ||
| 17 | */ | ||
| 18 | public interface UserCollectionService { | ||
| 19 | |||
| 20 | /** | ||
| 21 | * 查询数据分页 | ||
| 22 | * @param criteria 条件参数 | ||
| 23 | * @param pageable 分页参数 | ||
| 24 | * @return Map<String,Object> | ||
| 25 | */ | ||
| 26 | Map<String,Object> queryAll(UserCollectionQueryCriteria criteria, Pageable pageable); | ||
| 27 | |||
| 28 | /** | ||
| 29 | * 查询所有数据不分页 | ||
| 30 | * @param criteria 条件参数 | ||
| 31 | * @return List<UserCollectionDTO> | ||
| 32 | */ | ||
| 33 | List<UserCollectionDTO> queryAll(UserCollectionQueryCriteria criteria); | ||
| 34 | |||
| 35 | /** | ||
| 36 | * 根据ID查询 | ||
| 37 | * @param id ID | ||
| 38 | * @return UserCollectionDTO | ||
| 39 | */ | ||
| 40 | UserCollectionDTO findById(Long id); | ||
| 41 | |||
| 42 | UserCollectionDTO create(UserCollection resources); | ||
| 43 | |||
| 44 | void update(UserCollection resources); | ||
| 45 | |||
| 46 | void delete(Long id); | ||
| 47 | |||
| 48 | void download(List<UserCollectionDTO> all, HttpServletResponse response) throws IOException; | ||
| 49 | |||
| 50 | List<UserCollection> findByUserIdAndType(Long id, Integer type); | ||
| 51 | |||
| 52 | Optional<UserCollection> findFirstByUserIdAndTypeAndName(Long id, Integer type, String name); | ||
| 53 | |||
| 54 | UserCollection save(UserCollection userCollection); | ||
| 55 | } |
src/main/java/com/topdraw/business/module/user/weixin/collection/service/dto/UserCollectionDTO.java
0 → 100644
| 1 | package com.topdraw.business.module.user.weixin.collection.service.dto; | ||
| 2 | |||
| 3 | import lombok.Data; | ||
| 4 | |||
| 5 | import java.io.Serializable; | ||
| 6 | import java.sql.Timestamp; | ||
| 7 | |||
| 8 | |||
| 9 | /** | ||
| 10 | * @author pengmengqing | ||
| 11 | * @date 2021-04-02 | ||
| 12 | */ | ||
| 13 | @Data | ||
| 14 | public class UserCollectionDTO implements Serializable { | ||
| 15 | |||
| 16 | // ID | ||
| 17 | private Long id; | ||
| 18 | |||
| 19 | // 应用ID | ||
| 20 | private Long appId; | ||
| 21 | |||
| 22 | // 用户ID | ||
| 23 | private Long userId; | ||
| 24 | |||
| 25 | // 收藏夹类型:1-收藏 2-播放记录 3-播放列表 4-评分 5-点赞/关注/订阅 | ||
| 26 | private Integer type; | ||
| 27 | |||
| 28 | // 收藏夹名称 | ||
| 29 | private String name; | ||
| 30 | |||
| 31 | // 数量 | ||
| 32 | private Integer count; | ||
| 33 | |||
| 34 | // 创建时间 | ||
| 35 | private Timestamp createTime; | ||
| 36 | |||
| 37 | // 更新时间 | ||
| 38 | private Timestamp updateTime; | ||
| 39 | } |
| 1 | package com.topdraw.business.module.user.weixin.collection.service.dto; | ||
| 2 | |||
| 3 | import com.fasterxml.jackson.annotation.JsonFormat; | ||
| 4 | import lombok.Data; | ||
| 5 | |||
| 6 | import java.io.Serializable; | ||
| 7 | import java.sql.Timestamp; | ||
| 8 | |||
| 9 | |||
| 10 | /** | ||
| 11 | * @author pengmengqing | ||
| 12 | * @date 2021-04-02 | ||
| 13 | */ | ||
| 14 | @Data | ||
| 15 | public class UserCollectionDetailDTO implements Serializable { | ||
| 16 | |||
| 17 | // ID | ||
| 18 | private Long id; | ||
| 19 | |||
| 20 | // 收藏夹ID | ||
| 21 | private Long userCollectionId; | ||
| 22 | |||
| 23 | // 自定义收藏内容的类型CODE,默认:DEFAULT | ||
| 24 | private String detailFolderCode; | ||
| 25 | |||
| 26 | // 收藏内容的类型:MEDIA|EPISODE|CATEGORY|SUBJECT|ARTICLE|ARTIST|SCHOOL | ||
| 27 | private String detailType; | ||
| 28 | |||
| 29 | // 收藏内容的ID | ||
| 30 | private Long detailId; | ||
| 31 | |||
| 32 | // 收藏内容的CODE | ||
| 33 | private String detailCode; | ||
| 34 | |||
| 35 | // 收藏内容的剧集ID | ||
| 36 | private Long detailEpisodeId; | ||
| 37 | |||
| 38 | // 收藏内容的剧集CODE | ||
| 39 | private String detailEpisodeCode; | ||
| 40 | |||
| 41 | // 收藏内容的名称 | ||
| 42 | private String detailName; | ||
| 43 | |||
| 44 | // 收藏内容的标记 | ||
| 45 | private Integer detailMark; | ||
| 46 | |||
| 47 | // 收藏内容的图片 | ||
| 48 | private String detailImg; | ||
| 49 | |||
| 50 | // 收藏内容的剧集序号 | ||
| 51 | private Integer detailIndex; | ||
| 52 | |||
| 53 | // 收藏内容的剧集总数 | ||
| 54 | private Integer detailTotalIndex; | ||
| 55 | |||
| 56 | // 收藏内容的播放时间 | ||
| 57 | private Integer detailPlayTime; | ||
| 58 | |||
| 59 | // 收藏内容的总时间 | ||
| 60 | private Integer detailTotalTime; | ||
| 61 | |||
| 62 | // 收藏内容在同一folder中的顺序 | ||
| 63 | private Integer detailSequence; | ||
| 64 | |||
| 65 | // 收藏内容的评分 | ||
| 66 | private Float detailScore; | ||
| 67 | |||
| 68 | // 收藏内容(根据文件夹和类型的不同)的点赞/关注/订阅 | ||
| 69 | private Integer detailLike; | ||
| 70 | |||
| 71 | // 收藏内容的扩展数据 | ||
| 72 | private String detailExtData; | ||
| 73 | |||
| 74 | // 创建时间 | ||
| 75 | @JsonFormat( | ||
| 76 | pattern = "MM月dd日 HH:mm", | ||
| 77 | timezone = "GMT+8" | ||
| 78 | ) | ||
| 79 | private Timestamp createTime; | ||
| 80 | |||
| 81 | // 更新时间 | ||
| 82 | @JsonFormat( | ||
| 83 | pattern = "MM月dd日 HH:mm", | ||
| 84 | timezone = "GMT+8" | ||
| 85 | ) | ||
| 86 | private Timestamp updateTime; | ||
| 87 | } |
| 1 | package com.topdraw.business.module.user.weixin.collection.service.dto; | ||
| 2 | |||
| 3 | import com.topdraw.annotation.Query; | ||
| 4 | import lombok.Data; | ||
| 5 | |||
| 6 | import javax.persistence.criteria.JoinType; | ||
| 7 | |||
| 8 | /** | ||
| 9 | * @author pengmengqing | ||
| 10 | * @date 2021-04-02 | ||
| 11 | */ | ||
| 12 | @Data | ||
| 13 | public class UserCollectionDetailQueryCriteria{ | ||
| 14 | |||
| 15 | private Long userWeixinId; | ||
| 16 | |||
| 17 | |||
| 18 | @Query(joinType = JoinType.INNER, joinName = "userCollection") | ||
| 19 | private Long userId; | ||
| 20 | |||
| 21 | @Query(joinType = JoinType.INNER, joinName = "userCollection") | ||
| 22 | private Integer type; | ||
| 23 | |||
| 24 | private String detailType; | ||
| 25 | |||
| 26 | private String detailFolderCode = "DEFAULT"; | ||
| 27 | |||
| 28 | private Long detailId; | ||
| 29 | } |
| 1 | package com.topdraw.business.module.user.weixin.collection.service.impl; | ||
| 2 | |||
| 3 | import com.topdraw.business.module.user.weixin.collection.domain.UserCollectionDetail; | ||
| 4 | import com.topdraw.business.module.user.weixin.collection.repository.UserCollectionDetailRepository; | ||
| 5 | import com.topdraw.business.module.user.weixin.collection.service.UserCollectionDetailService; | ||
| 6 | import com.topdraw.business.module.user.weixin.collection.service.dto.UserCollectionDetailDTO; | ||
| 7 | import com.topdraw.business.module.user.weixin.collection.service.dto.UserCollectionDetailQueryCriteria; | ||
| 8 | import com.topdraw.business.module.user.weixin.collection.service.mapper.UserCollectionDetailMapper; | ||
| 9 | import com.topdraw.utils.PageUtil; | ||
| 10 | import com.topdraw.utils.QueryHelp; | ||
| 11 | import com.topdraw.utils.ValidationUtil; | ||
| 12 | import org.springframework.beans.factory.annotation.Autowired; | ||
| 13 | import org.springframework.dao.EmptyResultDataAccessException; | ||
| 14 | import org.springframework.data.domain.Page; | ||
| 15 | import org.springframework.data.domain.Pageable; | ||
| 16 | import org.springframework.stereotype.Service; | ||
| 17 | import org.springframework.transaction.annotation.Propagation; | ||
| 18 | import org.springframework.transaction.annotation.Transactional; | ||
| 19 | import org.springframework.util.Assert; | ||
| 20 | |||
| 21 | import java.util.List; | ||
| 22 | import java.util.Map; | ||
| 23 | |||
| 24 | /** | ||
| 25 | * @author pengmengqing | ||
| 26 | * @date 2021-04-02 | ||
| 27 | */ | ||
| 28 | @Service | ||
| 29 | @Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class) | ||
| 30 | public class UserCollectionDetailServiceImpl implements UserCollectionDetailService { | ||
| 31 | |||
| 32 | @Autowired | ||
| 33 | private UserCollectionDetailRepository userCollectionDetailRepository; | ||
| 34 | |||
| 35 | @Autowired | ||
| 36 | private UserCollectionDetailMapper userCollectionDetailMapper; | ||
| 37 | |||
| 38 | @Override | ||
| 39 | public Map<String, Object> queryAll(UserCollectionDetailQueryCriteria criteria, Pageable pageable) { | ||
| 40 | Page<UserCollectionDetail> page = userCollectionDetailRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable); | ||
| 41 | return PageUtil.toPage(page.map(userCollectionDetailMapper::toDto)); | ||
| 42 | } | ||
| 43 | |||
| 44 | @Override | ||
| 45 | public UserCollectionDetailDTO findById(Long id) { | ||
| 46 | UserCollectionDetail userCollectionDetail = userCollectionDetailRepository.findById(id).orElseGet(UserCollectionDetail::new); | ||
| 47 | ValidationUtil.isNull(userCollectionDetail.getId(),"UserCollectionDetail","id",id); | ||
| 48 | return userCollectionDetailMapper.toDto(userCollectionDetail); | ||
| 49 | } | ||
| 50 | |||
| 51 | @Override | ||
| 52 | @Transactional(rollbackFor = Exception.class) | ||
| 53 | public UserCollectionDetailDTO create(UserCollectionDetail resources) { | ||
| 54 | return userCollectionDetailMapper.toDto(userCollectionDetailRepository.save(resources)); | ||
| 55 | } | ||
| 56 | |||
| 57 | @Override | ||
| 58 | @Transactional(rollbackFor = Exception.class) | ||
| 59 | public void update(UserCollectionDetail resources) { | ||
| 60 | UserCollectionDetail userCollectionDetail = userCollectionDetailRepository.findById(resources.getId()).orElseGet(UserCollectionDetail::new); | ||
| 61 | ValidationUtil.isNull( userCollectionDetail.getId(),"UserCollectionDetail","id",resources.getId()); | ||
| 62 | userCollectionDetail.copy(resources); | ||
| 63 | userCollectionDetailRepository.save(userCollectionDetail); | ||
| 64 | } | ||
| 65 | |||
| 66 | @Override | ||
| 67 | @Transactional(rollbackFor = Exception.class) | ||
| 68 | public void delete(Long id) { | ||
| 69 | Assert.notNull(id, "The given id must not be null!"); | ||
| 70 | UserCollectionDetail userCollectionDetail = userCollectionDetailRepository.findById(id).orElseThrow( | ||
| 71 | () -> new EmptyResultDataAccessException(String.format("No %s entity " + "with id %s " + "exists!", UserCollectionDetail.class, id), 1)); | ||
| 72 | userCollectionDetailRepository.delete(userCollectionDetail); | ||
| 73 | } | ||
| 74 | |||
| 75 | @Override | ||
| 76 | @Transactional(rollbackFor = Exception.class) | ||
| 77 | public void deleteAllByUserCollectionId(Long id) { | ||
| 78 | this.userCollectionDetailRepository.deleteAllByUserCollectionId(id); | ||
| 79 | } | ||
| 80 | |||
| 81 | @Override | ||
| 82 | @Transactional(rollbackFor = Exception.class) | ||
| 83 | public void deleteAll(List<UserCollectionDetail> userCollectionDetailOptional) { | ||
| 84 | this.userCollectionDetailRepository.deleteAll(userCollectionDetailOptional); | ||
| 85 | } | ||
| 86 | |||
| 87 | } |
| 1 | package com.topdraw.business.module.user.weixin.collection.service.impl; | ||
| 2 | |||
| 3 | import com.topdraw.business.module.user.weixin.collection.domain.UserCollection; | ||
| 4 | import com.topdraw.business.module.user.weixin.collection.repository.UserCollectionRepository; | ||
| 5 | import com.topdraw.business.module.user.weixin.collection.service.UserCollectionService; | ||
| 6 | import com.topdraw.business.module.user.weixin.collection.service.dto.UserCollectionDTO; | ||
| 7 | import com.topdraw.business.module.user.weixin.collection.service.dto.UserCollectionQueryCriteria; | ||
| 8 | import com.topdraw.business.module.user.weixin.collection.service.mapper.UserCollectionMapper; | ||
| 9 | import com.topdraw.utils.FileUtil; | ||
| 10 | import com.topdraw.utils.PageUtil; | ||
| 11 | import com.topdraw.utils.QueryHelp; | ||
| 12 | import com.topdraw.utils.ValidationUtil; | ||
| 13 | import org.springframework.beans.factory.annotation.Autowired; | ||
| 14 | import org.springframework.dao.EmptyResultDataAccessException; | ||
| 15 | import org.springframework.data.domain.Page; | ||
| 16 | import org.springframework.data.domain.Pageable; | ||
| 17 | import org.springframework.stereotype.Service; | ||
| 18 | import org.springframework.transaction.annotation.Propagation; | ||
| 19 | import org.springframework.transaction.annotation.Transactional; | ||
| 20 | import org.springframework.util.Assert; | ||
| 21 | |||
| 22 | import javax.servlet.http.HttpServletResponse; | ||
| 23 | import java.io.IOException; | ||
| 24 | import java.util.*; | ||
| 25 | |||
| 26 | /** | ||
| 27 | * @author pengmengqing | ||
| 28 | * @date 2021-04-02 | ||
| 29 | */ | ||
| 30 | @Service | ||
| 31 | @Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class) | ||
| 32 | public class UserCollectionServiceImpl implements UserCollectionService { | ||
| 33 | |||
| 34 | @Autowired | ||
| 35 | private UserCollectionRepository userCollectionRepository; | ||
| 36 | |||
| 37 | @Autowired | ||
| 38 | private UserCollectionMapper userCollectionMapper; | ||
| 39 | |||
| 40 | |||
| 41 | |||
| 42 | @Override | ||
| 43 | public Map<String, Object> queryAll(UserCollectionQueryCriteria criteria, Pageable pageable) { | ||
| 44 | Page<UserCollection> page = userCollectionRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable); | ||
| 45 | return PageUtil.toPage(page.map(userCollectionMapper::toDto)); | ||
| 46 | } | ||
| 47 | |||
| 48 | @Override | ||
| 49 | public List<UserCollectionDTO> queryAll(UserCollectionQueryCriteria criteria) { | ||
| 50 | return userCollectionMapper.toDto(userCollectionRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder))); | ||
| 51 | } | ||
| 52 | |||
| 53 | @Override | ||
| 54 | public UserCollectionDTO findById(Long id) { | ||
| 55 | UserCollection userCollection = userCollectionRepository.findById(id).orElseGet(UserCollection::new); | ||
| 56 | ValidationUtil.isNull(userCollection.getId(),"UserCollection","id",id); | ||
| 57 | return userCollectionMapper.toDto(userCollection); | ||
| 58 | } | ||
| 59 | |||
| 60 | @Override | ||
| 61 | @Transactional(rollbackFor = Exception.class) | ||
| 62 | public UserCollectionDTO create(UserCollection resources) { | ||
| 63 | return userCollectionMapper.toDto(userCollectionRepository.save(resources)); | ||
| 64 | } | ||
| 65 | |||
| 66 | @Override | ||
| 67 | @Transactional(rollbackFor = Exception.class) | ||
| 68 | public void update(UserCollection resources) { | ||
| 69 | UserCollection userCollection = userCollectionRepository.findById(resources.getId()).orElseGet(UserCollection::new); | ||
| 70 | ValidationUtil.isNull( userCollection.getId(),"UserCollection","id",resources.getId()); | ||
| 71 | userCollection.copy(resources); | ||
| 72 | userCollectionRepository.save(userCollection); | ||
| 73 | } | ||
| 74 | |||
| 75 | @Override | ||
| 76 | @Transactional(rollbackFor = Exception.class) | ||
| 77 | public void delete(Long id) { | ||
| 78 | Assert.notNull(id, "The given id must not be null!"); | ||
| 79 | UserCollection userCollection = userCollectionRepository.findById(id).orElseThrow( | ||
| 80 | () -> new EmptyResultDataAccessException(String.format("No %s entity " + "with id %s " + "exists!", UserCollection.class, id), 1)); | ||
| 81 | userCollectionRepository.delete(userCollection); | ||
| 82 | } | ||
| 83 | |||
| 84 | |||
| 85 | @Override | ||
| 86 | public void download(List<UserCollectionDTO> all, HttpServletResponse response) throws IOException { | ||
| 87 | List<Map<String, Object>> list = new ArrayList<>(); | ||
| 88 | for (UserCollectionDTO userCollection : all) { | ||
| 89 | Map<String, Object> map = new LinkedHashMap<>(); | ||
| 90 | map.put("应用ID", userCollection.getAppId()); | ||
| 91 | // map.put("用户ID", userCollection.getSubscriberId()); | ||
| 92 | // map.put("platformAccount", userCollection.getPlatformAccount()); | ||
| 93 | map.put("收藏夹类型:1-收藏 2-播放记录 3-播放列表 4-评分 5-点赞/关注/订阅", userCollection.getType()); | ||
| 94 | map.put("收藏夹名称", userCollection.getName()); | ||
| 95 | map.put("数量", userCollection.getCount()); | ||
| 96 | map.put("创建时间", userCollection.getCreateTime()); | ||
| 97 | map.put("更新时间", userCollection.getUpdateTime()); | ||
| 98 | list.add(map); | ||
| 99 | } | ||
| 100 | FileUtil.downloadExcel(list, response); | ||
| 101 | } | ||
| 102 | |||
| 103 | @Override | ||
| 104 | public List<UserCollection> findByUserIdAndType(Long id, Integer type) { | ||
| 105 | return this.userCollectionRepository.findByUserIdAndType(id,type); | ||
| 106 | } | ||
| 107 | |||
| 108 | @Override | ||
| 109 | public Optional<UserCollection> findFirstByUserIdAndTypeAndName(Long id, Integer type, String name) { | ||
| 110 | return Optional.empty(); | ||
| 111 | } | ||
| 112 | |||
| 113 | @Override | ||
| 114 | public UserCollection save(UserCollection userCollection) { | ||
| 115 | this.userCollectionRepository.save(userCollection); | ||
| 116 | return userCollection; | ||
| 117 | } | ||
| 118 | |||
| 119 | |||
| 120 | } |
| 1 | package com.topdraw.business.module.user.weixin.collection.service.mapper; | ||
| 2 | |||
| 3 | import com.topdraw.base.BaseMapper; | ||
| 4 | import com.topdraw.business.module.user.weixin.collection.domain.UserCollectionDetail; | ||
| 5 | import com.topdraw.business.module.user.weixin.collection.service.dto.UserCollectionDetailDTO; | ||
| 6 | import org.mapstruct.Mapper; | ||
| 7 | import org.mapstruct.ReportingPolicy; | ||
| 8 | |||
| 9 | /** | ||
| 10 | * @author pengmengqing | ||
| 11 | * @date 2021-04-02 | ||
| 12 | */ | ||
| 13 | @Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE) | ||
| 14 | public interface UserCollectionDetailMapper extends BaseMapper<UserCollectionDetailDTO, UserCollectionDetail> { | ||
| 15 | |||
| 16 | } |
| 1 | package com.topdraw.business.module.user.weixin.collection.service.mapper; | ||
| 2 | |||
| 3 | import com.topdraw.base.BaseMapper; | ||
| 4 | import com.topdraw.business.module.user.weixin.collection.domain.UserCollection; | ||
| 5 | import com.topdraw.business.module.user.weixin.collection.service.dto.UserCollectionDTO; | ||
| 6 | import org.mapstruct.Mapper; | ||
| 7 | import org.mapstruct.ReportingPolicy; | ||
| 8 | |||
| 9 | /** | ||
| 10 | * @author pengmengqing | ||
| 11 | * @date 2021-04-02 | ||
| 12 | */ | ||
| 13 | @Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE) | ||
| 14 | public interface UserCollectionMapper extends BaseMapper<UserCollectionDTO, UserCollection> { | ||
| 15 | |||
| 16 | } |
| 1 | package com.topdraw.business.basicdata.user.weixin.domain; | 1 | package com.topdraw.business.module.user.weixin.domain; |
| 2 | 2 | ||
| 3 | import cn.hutool.core.bean.BeanUtil; | 3 | import cn.hutool.core.bean.BeanUtil; |
| 4 | import cn.hutool.core.bean.copier.CopyOptions; | 4 | import cn.hutool.core.bean.copier.CopyOptions; |
| 5 | import com.topdraw.business.module.common.domain.DefaultAsyncMqModule; | ||
| 5 | import lombok.Data; | 6 | import lombok.Data; |
| 6 | import lombok.experimental.Accessors; | 7 | import lombok.experimental.Accessors; |
| 7 | import org.springframework.data.annotation.CreatedDate; | 8 | import org.springframework.data.annotation.CreatedDate; |
| ... | @@ -11,6 +12,7 @@ import org.springframework.data.jpa.domain.support.AuditingEntityListener; | ... | @@ -11,6 +12,7 @@ import org.springframework.data.jpa.domain.support.AuditingEntityListener; |
| 11 | import javax.persistence.*; | 12 | import javax.persistence.*; |
| 12 | import java.io.Serializable; | 13 | import java.io.Serializable; |
| 13 | import java.sql.Timestamp; | 14 | import java.sql.Timestamp; |
| 15 | import java.time.LocalDateTime; | ||
| 14 | 16 | ||
| 15 | /** | 17 | /** |
| 16 | * @author XiangHan | 18 | * @author XiangHan |
| ... | @@ -21,7 +23,7 @@ import java.sql.Timestamp; | ... | @@ -21,7 +23,7 @@ import java.sql.Timestamp; |
| 21 | @EntityListeners(AuditingEntityListener.class) | 23 | @EntityListeners(AuditingEntityListener.class) |
| 22 | @Accessors(chain = true) | 24 | @Accessors(chain = true) |
| 23 | @Table(name="uc_user_weixin") | 25 | @Table(name="uc_user_weixin") |
| 24 | public class UserWeixin implements Serializable { | 26 | public class UserWeixin extends DefaultAsyncMqModule implements Serializable { |
| 25 | 27 | ||
| 26 | // ID | 28 | // ID |
| 27 | @Id | 29 | @Id |
| ... | @@ -79,7 +81,7 @@ public class UserWeixin implements Serializable { | ... | @@ -79,7 +81,7 @@ public class UserWeixin implements Serializable { |
| 79 | 81 | ||
| 80 | // 超时时间 | 82 | // 超时时间 |
| 81 | @Column(name = "expires_time") | 83 | @Column(name = "expires_time") |
| 82 | private Timestamp expiresTime; | 84 | private LocalDateTime expiresTime; |
| 83 | 85 | ||
| 84 | // 描述 | 86 | // 描述 |
| 85 | @Column(name = "description") | 87 | @Column(name = "description") |
| ... | @@ -92,7 +94,7 @@ public class UserWeixin implements Serializable { | ... | @@ -92,7 +94,7 @@ public class UserWeixin implements Serializable { |
| 92 | // 创建时间 | 94 | // 创建时间 |
| 93 | @CreatedDate | 95 | @CreatedDate |
| 94 | @Column(name = "create_time") | 96 | @Column(name = "create_time") |
| 95 | private Timestamp createTime; | 97 | private LocalDateTime createTime; |
| 96 | 98 | ||
| 97 | // 更新者 | 99 | // 更新者 |
| 98 | @Column(name = "update_by") | 100 | @Column(name = "update_by") |
| ... | @@ -101,7 +103,7 @@ public class UserWeixin implements Serializable { | ... | @@ -101,7 +103,7 @@ public class UserWeixin implements Serializable { |
| 101 | // 更新时间 | 103 | // 更新时间 |
| 102 | @LastModifiedDate | 104 | @LastModifiedDate |
| 103 | @Column(name = "update_time") | 105 | @Column(name = "update_time") |
| 104 | private Timestamp updateTime; | 106 | private LocalDateTime updateTime; |
| 105 | 107 | ||
| 106 | // 来源类型 | 108 | // 来源类型 |
| 107 | @Column(name = "source_type") | 109 | @Column(name = "source_type") |
| ... | @@ -129,7 +131,7 @@ public class UserWeixin implements Serializable { | ... | @@ -129,7 +131,7 @@ public class UserWeixin implements Serializable { |
| 129 | 131 | ||
| 130 | // 授权时间 | 132 | // 授权时间 |
| 131 | @Column(name = "auth_time") | 133 | @Column(name = "auth_time") |
| 132 | private Timestamp authTime; | 134 | private LocalDateTime authTime; |
| 133 | 135 | ||
| 134 | @Column(name = "sex") | 136 | @Column(name = "sex") |
| 135 | private Integer sex; | 137 | private Integer sex; | ... | ... |
| 1 | package com.topdraw.business.basicdata.user.weixin.repository; | 1 | package com.topdraw.business.module.user.weixin.repository; |
| 2 | 2 | ||
| 3 | import com.topdraw.business.basicdata.user.weixin.domain.UserWeixin; | 3 | import com.topdraw.business.module.user.weixin.domain.UserWeixin; |
| 4 | import org.springframework.data.jpa.repository.JpaRepository; | 4 | import org.springframework.data.jpa.repository.JpaRepository; |
| 5 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; | 5 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; |
| 6 | import org.springframework.data.jpa.repository.Modifying; | ||
| 7 | import org.springframework.data.jpa.repository.Query; | ||
| 8 | import org.springframework.data.repository.query.Param; | ||
| 9 | |||
| 10 | import javax.transaction.Transactional; | ||
| 11 | import java.util.Optional; | ||
| 6 | 12 | ||
| 7 | /** | 13 | /** |
| 8 | * @author XiangHan | 14 | * @author XiangHan |
| ... | @@ -10,4 +16,10 @@ import org.springframework.data.jpa.repository.JpaSpecificationExecutor; | ... | @@ -10,4 +16,10 @@ import org.springframework.data.jpa.repository.JpaSpecificationExecutor; |
| 10 | */ | 16 | */ |
| 11 | public interface UserWeixinRepository extends JpaRepository<UserWeixin, Long>, JpaSpecificationExecutor<UserWeixin> { | 17 | public interface UserWeixinRepository extends JpaRepository<UserWeixin, Long>, JpaSpecificationExecutor<UserWeixin> { |
| 12 | 18 | ||
| 19 | Optional<UserWeixin> findFirstByAppidAndOpenid(String appId, String openId); | ||
| 20 | |||
| 21 | @Modifying | ||
| 22 | @Transactional | ||
| 23 | @Query(value = "update uc_user_weixin set update_time = :#{#resources.updateTime} where appid = :#{#resources.appid} and openid = :#{#resources.openid}" , nativeQuery = true) | ||
| 24 | void updateTime(@Param("resources") UserWeixin resources); | ||
| 13 | } | 25 | } | ... | ... |
| 1 | package com.topdraw.business.basicdata.user.weixin.rest; | 1 | package com.topdraw.business.module.user.weixin.rest; |
| 2 | 2 | ||
| 3 | import com.topdraw.annotation.Log; | 3 | import com.topdraw.business.module.user.weixin.domain.UserWeixin; |
| 4 | import com.topdraw.business.basicdata.user.weixin.domain.UserWeixin; | 4 | import com.topdraw.business.module.user.weixin.service.UserWeixinService; |
| 5 | import com.topdraw.business.basicdata.user.weixin.service.UserWeixinService; | 5 | import com.topdraw.business.module.user.weixin.service.dto.UserWeixinQueryCriteria; |
| 6 | import com.topdraw.business.basicdata.user.weixin.service.dto.UserWeixinQueryCriteria; | ||
| 7 | import com.topdraw.common.ResultInfo; | 6 | import com.topdraw.common.ResultInfo; |
| 8 | import io.swagger.annotations.Api; | 7 | import io.swagger.annotations.Api; |
| 9 | import io.swagger.annotations.ApiOperation; | 8 | import io.swagger.annotations.ApiOperation; |
| ... | @@ -36,7 +35,6 @@ public class UserWeixinController { | ... | @@ -36,7 +35,6 @@ public class UserWeixinController { |
| 36 | return ResultInfo.success(UserWeixinService.queryAll(criteria)); | 35 | return ResultInfo.success(UserWeixinService.queryAll(criteria)); |
| 37 | } | 36 | } |
| 38 | 37 | ||
| 39 | @Log | ||
| 40 | @PostMapping | 38 | @PostMapping |
| 41 | @ApiOperation("新增UserWeixin") | 39 | @ApiOperation("新增UserWeixin") |
| 42 | public ResultInfo create(@Validated @RequestBody UserWeixin resources) { | 40 | public ResultInfo create(@Validated @RequestBody UserWeixin resources) { |
| ... | @@ -44,7 +42,6 @@ public class UserWeixinController { | ... | @@ -44,7 +42,6 @@ public class UserWeixinController { |
| 44 | return ResultInfo.success(); | 42 | return ResultInfo.success(); |
| 45 | } | 43 | } |
| 46 | 44 | ||
| 47 | @Log | ||
| 48 | @PutMapping | 45 | @PutMapping |
| 49 | @ApiOperation("修改UserWeixin") | 46 | @ApiOperation("修改UserWeixin") |
| 50 | public ResultInfo update(@Validated @RequestBody UserWeixin resources) { | 47 | public ResultInfo update(@Validated @RequestBody UserWeixin resources) { |
| ... | @@ -52,8 +49,6 @@ public class UserWeixinController { | ... | @@ -52,8 +49,6 @@ public class UserWeixinController { |
| 52 | return ResultInfo.success(); | 49 | return ResultInfo.success(); |
| 53 | } | 50 | } |
| 54 | 51 | ||
| 55 | |||
| 56 | @Log | ||
| 57 | @DeleteMapping(value = "/{id}") | 52 | @DeleteMapping(value = "/{id}") |
| 58 | @ApiOperation("删除UserWeixin") | 53 | @ApiOperation("删除UserWeixin") |
| 59 | public ResultInfo delete(@PathVariable Long id) { | 54 | public ResultInfo delete(@PathVariable Long id) { | ... | ... |
| 1 | package com.topdraw.business.basicdata.user.weixin.service; | 1 | package com.topdraw.business.module.user.weixin.service; |
| 2 | 2 | ||
| 3 | import com.topdraw.business.basicdata.user.weixin.domain.UserWeixin; | 3 | import com.topdraw.business.module.user.weixin.domain.UserWeixin; |
| 4 | import com.topdraw.business.basicdata.user.weixin.service.dto.UserWeixinDTO; | 4 | import com.topdraw.business.module.user.weixin.service.dto.UserWeixinDTO; |
| 5 | import com.topdraw.business.basicdata.user.weixin.service.dto.UserWeixinQueryCriteria; | 5 | import com.topdraw.business.module.user.weixin.service.dto.UserWeixinQueryCriteria; |
| 6 | import org.springframework.data.domain.Pageable; | 6 | import org.springframework.data.domain.Pageable; |
| 7 | 7 | ||
| 8 | import java.util.List; | 8 | import java.util.List; |
| ... | @@ -36,10 +36,14 @@ public interface UserWeixinService { | ... | @@ -36,10 +36,14 @@ public interface UserWeixinService { |
| 36 | */ | 36 | */ |
| 37 | UserWeixinDTO findById(Long id); | 37 | UserWeixinDTO findById(Long id); |
| 38 | 38 | ||
| 39 | void updateTime(UserWeixin resources); | ||
| 40 | |||
| 39 | void create(UserWeixin resources); | 41 | void create(UserWeixin resources); |
| 40 | 42 | ||
| 41 | void update(UserWeixin resources); | 43 | void update(UserWeixin resources); |
| 42 | 44 | ||
| 43 | void delete(Long id); | 45 | void delete(Long id); |
| 44 | 46 | ||
| 47 | UserWeixinDTO findFirstByAppIdAndOpenId(String appId, String openId); | ||
| 48 | |||
| 45 | } | 49 | } | ... | ... |
| 1 | package com.topdraw.business.basicdata.user.weixin.service.dto; | 1 | package com.topdraw.business.module.user.weixin.service.dto; |
| 2 | 2 | ||
| 3 | import lombok.Data; | 3 | import lombok.Data; |
| 4 | 4 | ||
| 5 | import java.io.Serializable; | 5 | import java.io.Serializable; |
| 6 | import java.sql.Timestamp; | 6 | import java.sql.Timestamp; |
| 7 | import java.time.LocalDateTime; | ||
| 7 | 8 | ||
| 8 | 9 | ||
| 9 | /** | 10 | /** |
| ... | @@ -53,7 +54,7 @@ public class UserWeixinDTO implements Serializable { | ... | @@ -53,7 +54,7 @@ public class UserWeixinDTO implements Serializable { |
| 53 | private Integer expiresIn; | 54 | private Integer expiresIn; |
| 54 | 55 | ||
| 55 | // 超时时间 | 56 | // 超时时间 |
| 56 | private Timestamp expiresTime; | 57 | private LocalDateTime expiresTime; |
| 57 | 58 | ||
| 58 | // 描述 | 59 | // 描述 |
| 59 | private String description; | 60 | private String description; |
| ... | @@ -62,13 +63,13 @@ public class UserWeixinDTO implements Serializable { | ... | @@ -62,13 +63,13 @@ public class UserWeixinDTO implements Serializable { |
| 62 | private String createBy; | 63 | private String createBy; |
| 63 | 64 | ||
| 64 | // 创建时间 | 65 | // 创建时间 |
| 65 | private Timestamp createTime; | 66 | private LocalDateTime createTime; |
| 66 | 67 | ||
| 67 | // 更新者 | 68 | // 更新者 |
| 68 | private String updateBy; | 69 | private String updateBy; |
| 69 | 70 | ||
| 70 | // 更新时间 | 71 | // 更新时间 |
| 71 | private Timestamp updateTime; | 72 | private LocalDateTime updateTime; |
| 72 | 73 | ||
| 73 | // 来源类型 | 74 | // 来源类型 |
| 74 | private String sourceType; | 75 | private String sourceType; |
| ... | @@ -89,7 +90,7 @@ public class UserWeixinDTO implements Serializable { | ... | @@ -89,7 +90,7 @@ public class UserWeixinDTO implements Serializable { |
| 89 | private String sourceEntity; | 90 | private String sourceEntity; |
| 90 | 91 | ||
| 91 | // 授权时间 | 92 | // 授权时间 |
| 92 | private Timestamp authTime; | 93 | private LocalDateTime authTime; |
| 93 | 94 | ||
| 94 | private Integer sex; | 95 | private Integer sex; |
| 95 | 96 | ... | ... |
| 1 | package com.topdraw.business.basicdata.user.weixin.service.impl; | 1 | package com.topdraw.business.module.user.weixin.service.impl; |
| 2 | 2 | ||
| 3 | import com.topdraw.business.basicdata.user.weixin.domain.UserWeixin; | 3 | import com.topdraw.business.module.member.service.MemberService; |
| 4 | import com.topdraw.business.basicdata.user.weixin.repository.UserWeixinRepository; | 4 | import com.topdraw.business.module.member.service.dto.MemberDTO; |
| 5 | import com.topdraw.business.basicdata.user.weixin.service.UserWeixinService; | 5 | import com.topdraw.business.module.user.weixin.domain.UserWeixin; |
| 6 | import com.topdraw.business.basicdata.user.weixin.service.dto.UserWeixinDTO; | 6 | import com.topdraw.business.module.user.weixin.repository.UserWeixinRepository; |
| 7 | import com.topdraw.business.basicdata.user.weixin.service.dto.UserWeixinQueryCriteria; | 7 | import com.topdraw.business.module.user.weixin.service.UserWeixinService; |
| 8 | import com.topdraw.business.basicdata.user.weixin.service.mapper.UserWeixinMapper; | 8 | import com.topdraw.business.module.user.weixin.service.dto.UserWeixinDTO; |
| 9 | import com.topdraw.business.module.user.weixin.service.dto.UserWeixinQueryCriteria; | ||
| 10 | import com.topdraw.business.module.user.weixin.service.mapper.UserWeixinMapper; | ||
| 11 | import com.topdraw.util.TimestampUtil; | ||
| 9 | import com.topdraw.utils.PageUtil; | 12 | import com.topdraw.utils.PageUtil; |
| 10 | import com.topdraw.utils.QueryHelp; | 13 | import com.topdraw.utils.QueryHelp; |
| 11 | import com.topdraw.utils.ValidationUtil; | 14 | import com.topdraw.utils.ValidationUtil; |
| 15 | import jdk.vm.ci.meta.Local; | ||
| 16 | import lombok.extern.slf4j.Slf4j; | ||
| 17 | import org.springframework.beans.BeanUtils; | ||
| 12 | import org.springframework.beans.factory.annotation.Autowired; | 18 | import org.springframework.beans.factory.annotation.Autowired; |
| 13 | import org.springframework.dao.EmptyResultDataAccessException; | 19 | import org.springframework.dao.EmptyResultDataAccessException; |
| 14 | import org.springframework.data.domain.Page; | 20 | import org.springframework.data.domain.Page; |
| ... | @@ -18,6 +24,9 @@ import org.springframework.transaction.annotation.Propagation; | ... | @@ -18,6 +24,9 @@ import org.springframework.transaction.annotation.Propagation; |
| 18 | import org.springframework.transaction.annotation.Transactional; | 24 | import org.springframework.transaction.annotation.Transactional; |
| 19 | import org.springframework.util.Assert; | 25 | import org.springframework.util.Assert; |
| 20 | 26 | ||
| 27 | import java.sql.Time; | ||
| 28 | import java.sql.Timestamp; | ||
| 29 | import java.time.LocalDateTime; | ||
| 21 | import java.util.List; | 30 | import java.util.List; |
| 22 | import java.util.Map; | 31 | import java.util.Map; |
| 23 | 32 | ||
| ... | @@ -27,6 +36,7 @@ import java.util.Map; | ... | @@ -27,6 +36,7 @@ import java.util.Map; |
| 27 | */ | 36 | */ |
| 28 | @Service | 37 | @Service |
| 29 | @Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class) | 38 | @Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class) |
| 39 | @Slf4j | ||
| 30 | public class UserWeixinServiceImpl implements UserWeixinService { | 40 | public class UserWeixinServiceImpl implements UserWeixinService { |
| 31 | 41 | ||
| 32 | @Autowired | 42 | @Autowired |
| ... | @@ -34,6 +44,8 @@ public class UserWeixinServiceImpl implements UserWeixinService { | ... | @@ -34,6 +44,8 @@ public class UserWeixinServiceImpl implements UserWeixinService { |
| 34 | 44 | ||
| 35 | @Autowired | 45 | @Autowired |
| 36 | private UserWeixinMapper UserWeixinMapper; | 46 | private UserWeixinMapper UserWeixinMapper; |
| 47 | @Autowired | ||
| 48 | private MemberService memberService; | ||
| 37 | 49 | ||
| 38 | @Override | 50 | @Override |
| 39 | public Map<String, Object> queryAll(UserWeixinQueryCriteria criteria, Pageable pageable) { | 51 | public Map<String, Object> queryAll(UserWeixinQueryCriteria criteria, Pageable pageable) { |
| ... | @@ -55,17 +67,40 @@ public class UserWeixinServiceImpl implements UserWeixinService { | ... | @@ -55,17 +67,40 @@ public class UserWeixinServiceImpl implements UserWeixinService { |
| 55 | 67 | ||
| 56 | @Override | 68 | @Override |
| 57 | @Transactional(rollbackFor = Exception.class) | 69 | @Transactional(rollbackFor = Exception.class) |
| 70 | public void updateTime(UserWeixin resources) { | ||
| 71 | log.info("updateTime ==>> resources ==>> [{}]",resources); | ||
| 72 | String appid = resources.getAppid(); | ||
| 73 | String openid = resources.getOpenid(); | ||
| 74 | UserWeixin userWeixin = UserWeixinRepository.findFirstByAppidAndOpenid(appid,openid).orElseGet(UserWeixin::new); | ||
| 75 | ValidationUtil.isNull( userWeixin.getId(),"UserWeixin","id",resources.getId()); | ||
| 76 | userWeixin.setUpdateTime(LocalDateTime.now()); | ||
| 77 | log.info("userWeixin ==>> userWeixin ==>> [{}]",userWeixin); | ||
| 78 | UserWeixinRepository.updateTime(userWeixin); | ||
| 79 | } | ||
| 80 | |||
| 81 | @Override | ||
| 82 | @Transactional(rollbackFor = Exception.class) | ||
| 58 | public void create(UserWeixin resources) { | 83 | public void create(UserWeixin resources) { |
| 84 | resources.setMemberId(null); | ||
| 85 | String memberCode = resources.getMemberCode(); | ||
| 86 | MemberDTO memberDTO = this.memberService.getByCode(memberCode); | ||
| 87 | resources.setMemberId(memberDTO.getId()); | ||
| 59 | UserWeixinRepository.save(resources); | 88 | UserWeixinRepository.save(resources); |
| 60 | } | 89 | } |
| 61 | 90 | ||
| 62 | @Override | 91 | @Override |
| 63 | @Transactional(rollbackFor = Exception.class) | 92 | @Transactional(rollbackFor = Exception.class) |
| 64 | public void update(UserWeixin resources) { | 93 | public void update(UserWeixin resources) { |
| 65 | UserWeixin UserWeixin = UserWeixinRepository.findById(resources.getId()).orElseGet(UserWeixin::new); | 94 | log.info("update ==>> resources ==>> [{}]",resources); |
| 66 | ValidationUtil.isNull( UserWeixin.getId(),"UserWeixin","id",resources.getId()); | 95 | String appid = resources.getAppid(); |
| 67 | UserWeixin.copy(resources); | 96 | String openid = resources.getOpenid(); |
| 68 | UserWeixinRepository.save(UserWeixin); | 97 | UserWeixin userWeixin = UserWeixinRepository.findFirstByAppidAndOpenid(appid,openid).orElseGet(UserWeixin::new); |
| 98 | ValidationUtil.isNull( userWeixin.getId(),"UserWeixin","id",resources.getId()); | ||
| 99 | resources.setId(userWeixin.getId()); | ||
| 100 | resources.setMemberId(userWeixin.getMemberId()); | ||
| 101 | BeanUtils.copyProperties(resources,userWeixin); | ||
| 102 | log.info("update ==>>userWeixin ==>> resources ==>> [{}]",resources); | ||
| 103 | UserWeixinRepository.save(resources); | ||
| 69 | } | 104 | } |
| 70 | 105 | ||
| 71 | @Override | 106 | @Override |
| ... | @@ -77,5 +112,11 @@ public class UserWeixinServiceImpl implements UserWeixinService { | ... | @@ -77,5 +112,11 @@ public class UserWeixinServiceImpl implements UserWeixinService { |
| 77 | UserWeixinRepository.delete(UserWeixin); | 112 | UserWeixinRepository.delete(UserWeixin); |
| 78 | } | 113 | } |
| 79 | 114 | ||
| 115 | @Override | ||
| 116 | public UserWeixinDTO findFirstByAppIdAndOpenId(String appId, String openId) { | ||
| 117 | UserWeixin userWeixin = this.UserWeixinRepository.findFirstByAppidAndOpenid(appId,openId).orElseGet(UserWeixin::new); | ||
| 118 | return UserWeixinMapper.toDto(userWeixin); | ||
| 119 | } | ||
| 120 | |||
| 80 | 121 | ||
| 81 | } | 122 | } | ... | ... |
| 1 | package com.topdraw.business.basicdata.user.weixin.service.mapper; | 1 | package com.topdraw.business.module.user.weixin.service.mapper; |
| 2 | 2 | ||
| 3 | import com.topdraw.base.BaseMapper; | 3 | import com.topdraw.base.BaseMapper; |
| 4 | import com.topdraw.business.basicdata.user.weixin.domain.UserWeixin; | 4 | import com.topdraw.business.module.user.weixin.domain.UserWeixin; |
| 5 | import com.topdraw.business.basicdata.user.weixin.service.dto.UserWeixinDTO; | 5 | import com.topdraw.business.module.user.weixin.service.dto.UserWeixinDTO; |
| 6 | import org.mapstruct.Mapper; | 6 | import org.mapstruct.Mapper; |
| 7 | import org.mapstruct.ReportingPolicy; | 7 | import org.mapstruct.ReportingPolicy; |
| 8 | 8 | ... | ... |
| 1 | package com.topdraw.business.process.domian.weixin; | ||
| 2 | |||
| 3 | import com.fasterxml.jackson.annotation.JsonFormat; | ||
| 4 | import lombok.Data; | ||
| 5 | |||
| 6 | import java.time.LocalDateTime; | ||
| 7 | |||
| 8 | /** | ||
| 9 | * 微信账户信息 | ||
| 10 | * @author XiangHan | ||
| 11 | * @date 2021-01-18 | ||
| 12 | */ | ||
| 13 | @Data | ||
| 14 | public class BuyVipBean extends WeiXinUserBean { | ||
| 15 | |||
| 16 | private Integer vip; | ||
| 17 | |||
| 18 | @JsonFormat(shape = JsonFormat.Shape.STRING,pattern = "yyyy-MM-dd HH:mm:ss") | ||
| 19 | private LocalDateTime vipExpireTime; | ||
| 20 | |||
| 21 | |||
| 22 | } |
src/main/java/com/topdraw/business/process/domian/weixin/DefaultWeiXinBeanDefinition.java
0 → 100644
| 1 | package com.topdraw.business.process.domian.weixin; | ||
| 2 | |||
| 3 | import cn.hutool.core.date.DateUtil; | ||
| 4 | import cn.hutool.http.HttpUtil; | ||
| 5 | import com.alibaba.fastjson.JSONObject; | ||
| 6 | import com.topdraw.exception.BadRequestException; | ||
| 7 | import com.topdraw.utils.StringUtils; | ||
| 8 | import lombok.Data; | ||
| 9 | import org.springframework.beans.factory.annotation.Value; | ||
| 10 | import org.springframework.stereotype.Component; | ||
| 11 | |||
| 12 | import java.io.File; | ||
| 13 | import java.nio.charset.StandardCharsets; | ||
| 14 | import java.util.Base64; | ||
| 15 | import java.util.Date; | ||
| 16 | import java.util.UUID; | ||
| 17 | |||
| 18 | @Data | ||
| 19 | @Component | ||
| 20 | public class DefaultWeiXinBeanDefinition implements WeiXinBeanDefinition { | ||
| 21 | |||
| 22 | // | ||
| 23 | private String appid; | ||
| 24 | |||
| 25 | private String openId; | ||
| 26 | |||
| 27 | private String code; | ||
| 28 | |||
| 29 | private String token; | ||
| 30 | |||
| 31 | private String secret; | ||
| 32 | |||
| 33 | private String unionId; | ||
| 34 | |||
| 35 | private String nickname; | ||
| 36 | |||
| 37 | private String headImgUrl; | ||
| 38 | |||
| 39 | private JSONObject userInfo; | ||
| 40 | |||
| 41 | private String phoneNumber; | ||
| 42 | |||
| 43 | @Value("${file.upload:upload}") | ||
| 44 | private String filePath; | ||
| 45 | |||
| 46 | public DefaultWeiXinBeanDefinition() { | ||
| 47 | } | ||
| 48 | |||
| 49 | public DefaultWeiXinBeanDefinition(String appId, String code, String unionId, String openId, JSONObject userInfoWxJo, String phone) { | ||
| 50 | |||
| 51 | this.userInfo = userInfoWxJo; | ||
| 52 | if (userInfo != null) { | ||
| 53 | |||
| 54 | if (StringUtils.isNotBlank(userInfoWxJo.getString("unionId"))) { | ||
| 55 | unionId = userInfoWxJo.getString("unionId"); | ||
| 56 | } | ||
| 57 | |||
| 58 | if (StringUtils.isNotBlank(userInfoWxJo.getString("openId"))) { | ||
| 59 | openId = userInfoWxJo.getString("openId"); | ||
| 60 | } | ||
| 61 | |||
| 62 | headImgUrl = userInfoWxJo.getString("avatarUrl"); | ||
| 63 | |||
| 64 | if (StringUtils.isNotBlank(userInfoWxJo.getString("nickName"))) { | ||
| 65 | nickname = Base64.getEncoder().encodeToString(userInfoWxJo.getString("nickName").getBytes(StandardCharsets.UTF_8)); | ||
| 66 | } | ||
| 67 | |||
| 68 | String phoneNumber = userInfoWxJo.getString("phoneNumber"); | ||
| 69 | if (StringUtils.isBlank(phoneNumber)) { | ||
| 70 | throw new BadRequestException("phoneNumber is null..."); | ||
| 71 | } | ||
| 72 | |||
| 73 | this.phoneNumber = phoneNumber; | ||
| 74 | |||
| 75 | if (StringUtils.isNotBlank(headImgUrl)) { | ||
| 76 | |||
| 77 | new Thread(() -> { | ||
| 78 | String s = UUID.randomUUID().toString(); | ||
| 79 | File file = new File(System.getProperty("user.dir") + "/" + filePath + "/icon/" + DateUtil.format(new Date(), "yyyy-MM-dd")); | ||
| 80 | if (!file.exists()) { | ||
| 81 | file.mkdirs(); | ||
| 82 | } | ||
| 83 | |||
| 84 | HttpUtil.downloadFile(headImgUrl, new File(System.getProperty("user.dir") + "/" + filePath + "/icon/" + DateUtil.format(new Date(), "yyyy-MM-dd") + "/" + s + ".jpg")); | ||
| 85 | |||
| 86 | headImgUrl = filePath + "/icon/" + DateUtil.format(new Date(), "yyyy-MM-dd") + "/" + s + ".jpg"; | ||
| 87 | }).start(); | ||
| 88 | |||
| 89 | } | ||
| 90 | |||
| 91 | } | ||
| 92 | |||
| 93 | this.unionId = unionId; | ||
| 94 | this.phoneNumber = phone; | ||
| 95 | this.openId = openId; | ||
| 96 | this.appid = appId; | ||
| 97 | this.code = code; | ||
| 98 | } | ||
| 99 | |||
| 100 | @Override | ||
| 101 | public String getAppId() { | ||
| 102 | return this.appid; | ||
| 103 | } | ||
| 104 | |||
| 105 | @Override | ||
| 106 | public String getCode() { | ||
| 107 | return this.code; | ||
| 108 | } | ||
| 109 | |||
| 110 | @Override | ||
| 111 | public String getToken() { | ||
| 112 | return this.token; | ||
| 113 | } | ||
| 114 | |||
| 115 | @Override | ||
| 116 | public String getSecret() { | ||
| 117 | return this.secret; | ||
| 118 | } | ||
| 119 | |||
| 120 | @Override | ||
| 121 | public String getOpenId() { | ||
| 122 | return this.openId; | ||
| 123 | } | ||
| 124 | |||
| 125 | @Override | ||
| 126 | public String getUnionId() { | ||
| 127 | return this.unionId; | ||
| 128 | } | ||
| 129 | |||
| 130 | @Override | ||
| 131 | public String getNickname() { | ||
| 132 | return this.nickname; | ||
| 133 | } | ||
| 134 | |||
| 135 | @Override | ||
| 136 | public String getHeadImgUrl() { | ||
| 137 | return this.headImgUrl; | ||
| 138 | } | ||
| 139 | |||
| 140 | @Override | ||
| 141 | public JSONObject getUserInfo() { | ||
| 142 | return this.userInfo; | ||
| 143 | } | ||
| 144 | } |
| 1 | package com.topdraw.business.process.domian.weixin; | ||
| 2 | |||
| 3 | |||
| 4 | import com.alibaba.fastjson.JSONObject; | ||
| 5 | import lombok.Data; | ||
| 6 | |||
| 7 | @Data | ||
| 8 | public class SubscribeBean extends WeiXinUserBean { | ||
| 9 | |||
| 10 | private JSONObject userInfoJson; | ||
| 11 | |||
| 12 | private JSONObject iptvUserInfo; | ||
| 13 | |||
| 14 | private String msgType; | ||
| 15 | |||
| 16 | private String event; | ||
| 17 | |||
| 18 | |||
| 19 | /** */ | ||
| 20 | private String openId; | ||
| 21 | |||
| 22 | /** */ | ||
| 23 | private String appId; | ||
| 24 | |||
| 25 | /** */ | ||
| 26 | private String eventKey; | ||
| 27 | |||
| 28 | private String unionid; | ||
| 29 | private String nickname; | ||
| 30 | private String headimgurl; | ||
| 31 | |||
| 32 | } |
| 1 | package com.topdraw.business.process.domian.weixin; | ||
| 2 | |||
| 3 | import lombok.AllArgsConstructor; | ||
| 4 | import lombok.Data; | ||
| 5 | import lombok.NoArgsConstructor; | ||
| 6 | |||
| 7 | import javax.validation.constraints.NotNull; | ||
| 8 | |||
| 9 | @Data | ||
| 10 | @AllArgsConstructor | ||
| 11 | @NoArgsConstructor | ||
| 12 | public class SubscribeBeanEvent { | ||
| 13 | |||
| 14 | @NotNull(message = "【content】 not be null !!!") | ||
| 15 | private String content; | ||
| 16 | |||
| 17 | } |
| 1 | package com.topdraw.business.process.domian.weixin; | ||
| 2 | |||
| 3 | |||
| 4 | import com.alibaba.fastjson.annotation.JSONField; | ||
| 5 | import com.topdraw.annotation.Query; | ||
| 6 | import lombok.Data; | ||
| 7 | |||
| 8 | import java.sql.Timestamp; | ||
| 9 | |||
| 10 | @Data | ||
| 11 | public class UserCollectionMq { | ||
| 12 | |||
| 13 | // 应用ID | ||
| 14 | @JSONField(name = "app_id") | ||
| 15 | private Long appId; | ||
| 16 | |||
| 17 | @JSONField(name = "userId") | ||
| 18 | private Long userId; | ||
| 19 | |||
| 20 | // 收藏夹类型:1-收藏 2-播放记录 3-播放列表 4-评分 5-点赞/关注/订阅 | ||
| 21 | private Integer type; | ||
| 22 | |||
| 23 | // 收藏夹名称 | ||
| 24 | private String name; | ||
| 25 | |||
| 26 | // 数量 | ||
| 27 | private Integer count; | ||
| 28 | |||
| 29 | private String images; | ||
| 30 | |||
| 31 | // 收藏夹ID | ||
| 32 | @JSONField(name = "user_collection_id") | ||
| 33 | @Query | ||
| 34 | private Long userCollectionId; | ||
| 35 | |||
| 36 | // 自定义收藏内容的类型CODE,默认:DEFAULT | ||
| 37 | @JSONField(name = "detail_folder_code") | ||
| 38 | @Query | ||
| 39 | private String detailFolderCode; | ||
| 40 | |||
| 41 | // 收藏内容的类型:MEDIA|EPISODE|CATEGORY|SUBJECT|ARTICLE|ARTIST|SCHOOL | ||
| 42 | @JSONField(name = "detail_type") | ||
| 43 | @Query | ||
| 44 | private String detailType; | ||
| 45 | |||
| 46 | // 收藏内容的ID | ||
| 47 | @JSONField(name = "detail_id") | ||
| 48 | @Query | ||
| 49 | private Long detailId; | ||
| 50 | |||
| 51 | // 收藏内容的CODE | ||
| 52 | @JSONField(name = "detail_code") | ||
| 53 | @Query | ||
| 54 | private String detailCode; | ||
| 55 | |||
| 56 | // 收藏内容的剧集ID | ||
| 57 | @JSONField(name = "detail_episode_id") | ||
| 58 | @Query | ||
| 59 | private Long detailEpisodeId; | ||
| 60 | |||
| 61 | // 收藏内容的剧集CODE | ||
| 62 | @JSONField(name = "detail_episode_code") | ||
| 63 | @Query | ||
| 64 | private String detailEpisodeCode; | ||
| 65 | |||
| 66 | // 收藏内容的名称 | ||
| 67 | @JSONField(name = "detail_name") | ||
| 68 | @Query | ||
| 69 | private String detailName; | ||
| 70 | |||
| 71 | // 收藏内容的标记 | ||
| 72 | @JSONField(name = "detail_mark") | ||
| 73 | @Query | ||
| 74 | private Integer detailMark; | ||
| 75 | |||
| 76 | // 收藏内容的图片 | ||
| 77 | @JSONField(name = "detail_img") | ||
| 78 | private String detailImg; | ||
| 79 | |||
| 80 | // 收藏内容的剧集序号 | ||
| 81 | @JSONField(name = "detail_index") | ||
| 82 | @Query | ||
| 83 | private Integer detailIndex; | ||
| 84 | |||
| 85 | // 收藏内容的剧集总数 | ||
| 86 | @JSONField(name = "detail_total_index") | ||
| 87 | @Query | ||
| 88 | private Integer detailTotalIndex; | ||
| 89 | |||
| 90 | // 收藏内容的播放时间 | ||
| 91 | @JSONField(name = "detail_play_time") | ||
| 92 | @Query | ||
| 93 | private Integer detailPlayTime; | ||
| 94 | |||
| 95 | // 收藏内容的总时间 | ||
| 96 | @JSONField(name = "detail_total_time") | ||
| 97 | @Query | ||
| 98 | private Integer detailTotalTime; | ||
| 99 | |||
| 100 | // 收藏内容在同一folder中的顺序 | ||
| 101 | @JSONField(name = "detail_sequence") | ||
| 102 | @Query | ||
| 103 | private Integer detailSequence; | ||
| 104 | |||
| 105 | // 收藏内容的评分 | ||
| 106 | @JSONField(name = "detail_score") | ||
| 107 | @Query | ||
| 108 | private Float detailScore; | ||
| 109 | |||
| 110 | // 收藏内容(根据文件夹和类型的不同)的点赞/关注/订阅 | ||
| 111 | @JSONField(name = "detail_like") | ||
| 112 | @Query | ||
| 113 | private Integer detailLike; | ||
| 114 | |||
| 115 | // 收藏内容的扩展数据 | ||
| 116 | @JSONField(name = "detail_ext_data") | ||
| 117 | @Query | ||
| 118 | private String detailExtData; | ||
| 119 | |||
| 120 | // 创建时间 | ||
| 121 | @JSONField(name = "create_time") | ||
| 122 | @Query | ||
| 123 | private Timestamp createTime; | ||
| 124 | |||
| 125 | // 更新时间 | ||
| 126 | @JSONField(name = "update_time") | ||
| 127 | private Timestamp updateTime; | ||
| 128 | } |
| 1 | package com.topdraw.business.process.domian.weixin; | ||
| 2 | |||
| 3 | import com.alibaba.fastjson.JSONObject; | ||
| 4 | |||
| 5 | public interface WeiXinBeanDefinition { | ||
| 6 | |||
| 7 | String getAppId(); | ||
| 8 | |||
| 9 | String getCode(); | ||
| 10 | |||
| 11 | String getToken(); | ||
| 12 | |||
| 13 | String getSecret(); | ||
| 14 | |||
| 15 | String getOpenId(); | ||
| 16 | |||
| 17 | String getUnionId(); | ||
| 18 | |||
| 19 | String getNickname(); | ||
| 20 | |||
| 21 | String getHeadImgUrl(); | ||
| 22 | |||
| 23 | JSONObject getUserInfo(); | ||
| 24 | } |
| 1 | package com.topdraw.business.process.domian.weixin; | ||
| 2 | |||
| 3 | |||
| 4 | import lombok.Data; | ||
| 5 | |||
| 6 | /** | ||
| 7 | * 微信账户信息 | ||
| 8 | * @author XiangHan | ||
| 9 | * @date 2021-01-18 | ||
| 10 | */ | ||
| 11 | @Data | ||
| 12 | public class WeiXinUserBean { | ||
| 13 | |||
| 14 | private Long id; | ||
| 15 | |||
| 16 | private String unionid; | ||
| 17 | |||
| 18 | /** */ | ||
| 19 | private String openid; | ||
| 20 | |||
| 21 | /** */ | ||
| 22 | private String appid; | ||
| 23 | |||
| 24 | /** 加密后的appId,参数 */ | ||
| 25 | private String wxAppid; | ||
| 26 | |||
| 27 | /** 加密后的code,参数 */ | ||
| 28 | private String wxCode; | ||
| 29 | |||
| 30 | /** */ | ||
| 31 | private String userInfo; | ||
| 32 | |||
| 33 | /** 会员id */ | ||
| 34 | private Long memberId; | ||
| 35 | |||
| 36 | /** 加密信息 */ | ||
| 37 | private String encryptedData; | ||
| 38 | |||
| 39 | /** 解析用户电话号码时使用,参数 */ | ||
| 40 | private String iv; | ||
| 41 | |||
| 42 | /** 资源id */ | ||
| 43 | private String sourceId; | ||
| 44 | |||
| 45 | /** 资源类型 */ | ||
| 46 | private String sourceType; | ||
| 47 | |||
| 48 | /** 资源描述,用来表示从哪个地方链接进来的 */ | ||
| 49 | private String sourceDesc; | ||
| 50 | |||
| 51 | /** 资源实例 */ | ||
| 52 | private String sourceEntity; | ||
| 53 | |||
| 54 | /** 推荐者id */ | ||
| 55 | private Long sourceUser; | ||
| 56 | |||
| 57 | private String nikename; | ||
| 58 | |||
| 59 | private String headimgurl; | ||
| 60 | } |
| 1 | package com.topdraw.business.process.service; | ||
| 2 | |||
| 3 | import com.topdraw.business.process.domian.TempCoupon; | ||
| 4 | |||
| 5 | import java.util.List; | ||
| 6 | |||
| 7 | /** | ||
| 8 | * @description 权益操作接口 | ||
| 9 | * @author XiangHan | ||
| 10 | * @date 2021.10.22 | ||
| 11 | */ | ||
| 12 | |||
| 13 | public interface CouponOperationService { | ||
| 14 | |||
| 15 | /** | ||
| 16 | * 基于已完成的任务发放优惠券 | ||
| 17 | * @param tempCouponList | ||
| 18 | */ | ||
| 19 | void grantCouponThroughTempCoupon(List<TempCoupon> tempCouponList); | ||
| 20 | |||
| 21 | /** | ||
| 22 | * 系统手动发放优惠券 | ||
| 23 | * @param tempCouponList | ||
| 24 | */ | ||
| 25 | void grantCouponByManual(List<TempCoupon> tempCouponList); | ||
| 26 | } |
| 1 | package com.topdraw.business.process.service; | ||
| 2 | |||
| 3 | import com.topdraw.business.process.domian.TempExp; | ||
| 4 | |||
| 5 | import java.util.List; | ||
| 6 | |||
| 7 | /** | ||
| 8 | * @description 权益操作接口 | ||
| 9 | * @author XiangHan | ||
| 10 | * @date 2021.10.22 | ||
| 11 | */ | ||
| 12 | public interface ExpOperationService { | ||
| 13 | |||
| 14 | /** | ||
| 15 | * 任务完成后自动发放成长值 | ||
| 16 | * @param tempExpList | ||
| 17 | */ | ||
| 18 | void grantPointsThroughTempExp(List<TempExp> tempExpList); | ||
| 19 | |||
| 20 | /** | ||
| 21 | * 系统手动发放优惠券 | ||
| 22 | * @param memberId | ||
| 23 | * @param userId | ||
| 24 | * @param tempExpList | ||
| 25 | */ | ||
| 26 | void grantExpByManual(Long memberId, Long userId, List<TempExp> tempExpList); | ||
| 27 | |||
| 28 | void grantExpByManual(List<TempExp> tempExpList); | ||
| 29 | |||
| 30 | } |
| 1 | package com.topdraw.business.process.service; | 1 | package com.topdraw.business.process.service; |
| 2 | 2 | ||
| 3 | import com.topdraw.business.basicdata.member.domain.Member; | 3 | import com.topdraw.business.module.member.domain.Member; |
| 4 | import com.topdraw.business.basicdata.member.service.dto.MemberDTO; | 4 | import com.topdraw.business.module.member.service.dto.MemberDTO; |
| 5 | 5 | ||
| 6 | public interface MemberOperationService { | 6 | public interface MemberOperationService { |
| 7 | 7 | ... | ... |
| 1 | package com.topdraw.business.process.service; | ||
| 2 | |||
| 3 | import com.topdraw.business.module.rights.history.domain.RightsHistory; | ||
| 4 | import com.topdraw.business.process.domian.RightType; | ||
| 5 | |||
| 6 | import java.util.List; | ||
| 7 | import java.util.Map; | ||
| 8 | |||
| 9 | /** | ||
| 10 | * @description 权益操作接口 | ||
| 11 | * @author XiangHan | ||
| 12 | * @date 2021.10.22 | ||
| 13 | */ | ||
| 14 | public interface RightsOperationService { | ||
| 15 | |||
| 16 | /** | ||
| 17 | * 系统手动发放权益 | ||
| 18 | * @param rightsHistories | ||
| 19 | */ | ||
| 20 | void grantRightsByManual(List<RightsHistory> rightsHistories); | ||
| 21 | |||
| 22 | /** | ||
| 23 | * 任务完成自动发放权益 | ||
| 24 | * @param tempRightsMap | ||
| 25 | */ | ||
| 26 | void grantRights(Map<RightType, Object> tempRightsMap); | ||
| 27 | } |
| 1 | package com.topdraw.business.process.service.domian; | ||
| 2 | |||
| 3 | import com.topdraw.business.process.domian.TempRights; | ||
| 4 | import lombok.AllArgsConstructor; | ||
| 5 | import lombok.Data; | ||
| 6 | import lombok.NoArgsConstructor; | ||
| 7 | |||
| 8 | import javax.persistence.Transient; | ||
| 9 | import java.sql.Timestamp; | ||
| 10 | |||
| 11 | /** | ||
| 12 | * 权益-非持久化数据 | ||
| 13 | */ | ||
| 14 | @Data | ||
| 15 | @AllArgsConstructor | ||
| 16 | @NoArgsConstructor | ||
| 17 | public class TempCoupon extends TempRights { | ||
| 18 | |||
| 19 | @Transient | ||
| 20 | protected String code; | ||
| 21 | |||
| 22 | @Transient | ||
| 23 | protected Integer useStatus; | ||
| 24 | |||
| 25 | @Transient | ||
| 26 | protected Timestamp useTime; | ||
| 27 | |||
| 28 | /**领取时间*/ | ||
| 29 | @Transient | ||
| 30 | protected Timestamp receiveTime; | ||
| 31 | |||
| 32 | @Transient | ||
| 33 | protected String userNickname; | ||
| 34 | |||
| 35 | } |
| 1 | package com.topdraw.business.process.service.domian; | ||
| 2 | |||
| 3 | import com.topdraw.business.process.domian.TempIptvUser; | ||
| 4 | import lombok.AllArgsConstructor; | ||
| 5 | import lombok.Data; | ||
| 6 | import lombok.NoArgsConstructor; | ||
| 7 | |||
| 8 | import javax.persistence.Transient; | ||
| 9 | import javax.validation.constraints.NotNull; | ||
| 10 | |||
| 11 | @Data | ||
| 12 | @AllArgsConstructor | ||
| 13 | @NoArgsConstructor | ||
| 14 | public class TempCustomPointBean extends TempIptvUser { | ||
| 15 | |||
| 16 | /** 设备类型 1:大屏;2:小屏(微信)3.小屏(xx) */ | ||
| 17 | @Transient | ||
| 18 | @NotNull(message = "设备类型不得为空") | ||
| 19 | protected Integer deviceType; | ||
| 20 | |||
| 21 | /** 订单id */ | ||
| 22 | @Transient | ||
| 23 | protected Long orderId; | ||
| 24 | |||
| 25 | /** 节目id(针对观影操作) */ | ||
| 26 | @Transient | ||
| 27 | protected Long mediaId; | ||
| 28 | |||
| 29 | /** 活动id(针对参与活动) */ | ||
| 30 | @Transient | ||
| 31 | protected Long activityId; | ||
| 32 | |||
| 33 | /** 商品id */ | ||
| 34 | @Transient | ||
| 35 | protected Long itemId; | ||
| 36 | |||
| 37 | /** 行为事件类型 1:登录;2:观影;3:参与活动;4:订购;10:跨屏绑定;11:积分转移;98:系统操作;99:其他 */ | ||
| 38 | @Transient | ||
| 39 | protected Integer evtType; | ||
| 40 | |||
| 41 | } |
| 1 | package com.topdraw.business.process.service.domian; | ||
| 2 | |||
| 3 | import com.topdraw.business.process.domian.TempRights; | ||
| 4 | import lombok.AllArgsConstructor; | ||
| 5 | import lombok.Data; | ||
| 6 | import lombok.NoArgsConstructor; | ||
| 7 | |||
| 8 | import javax.persistence.Transient; | ||
| 9 | |||
| 10 | /** | ||
| 11 | * 权益-非持久化数据 | ||
| 12 | */ | ||
| 13 | @Data | ||
| 14 | @AllArgsConstructor | ||
| 15 | @NoArgsConstructor | ||
| 16 | public class TempExp extends TempRights { | ||
| 17 | |||
| 18 | // 获得成长值 | ||
| 19 | @Transient | ||
| 20 | protected Long rewardExp; | ||
| 21 | |||
| 22 | |||
| 23 | } |
| 1 | package com.topdraw.business.process.service.domian; | ||
| 2 | |||
| 3 | import lombok.AllArgsConstructor; | ||
| 4 | import lombok.Data; | ||
| 5 | import lombok.NoArgsConstructor; | ||
| 6 | |||
| 7 | import javax.persistence.Transient; | ||
| 8 | import java.sql.Timestamp; | ||
| 9 | |||
| 10 | @Data | ||
| 11 | @AllArgsConstructor | ||
| 12 | @NoArgsConstructor | ||
| 13 | public class TempIptvUser { | ||
| 14 | |||
| 15 | private String unionid; | ||
| 16 | |||
| 17 | // 账户 | ||
| 18 | @Transient | ||
| 19 | private String platformAccount; | ||
| 20 | |||
| 21 | // 分数 | ||
| 22 | @Transient | ||
| 23 | private Long points; | ||
| 24 | |||
| 25 | |||
| 26 | // ID | ||
| 27 | private Long id; | ||
| 28 | |||
| 29 | // 人ID | ||
| 30 | private Long personId; | ||
| 31 | |||
| 32 | // 运营商平台 | ||
| 33 | private String platform; | ||
| 34 | |||
| 35 | // 手机号 | ||
| 36 | private String cellphone; | ||
| 37 | |||
| 38 | // 用户名 | ||
| 39 | private String username; | ||
| 40 | |||
| 41 | // 密码 MD5 | ||
| 42 | private String password; | ||
| 43 | |||
| 44 | // 昵称 Base64 | ||
| 45 | private String nickname; | ||
| 46 | |||
| 47 | // 头像 | ||
| 48 | private String image; | ||
| 49 | |||
| 50 | // 登录天数(总天数) | ||
| 51 | private Integer loginDays; | ||
| 52 | |||
| 53 | // 连续登录天数 | ||
| 54 | private Integer continueDays; | ||
| 55 | |||
| 56 | // 活跃时间 | ||
| 57 | private Timestamp activeTime; | ||
| 58 | |||
| 59 | // 分组 分组ID用逗号分隔 | ||
| 60 | private String groups; | ||
| 61 | |||
| 62 | // 标签 标签用逗号分隔 | ||
| 63 | private String tags; | ||
| 64 | |||
| 65 | // 登录类型 1-运营商隐式登录 2-手机验证登录 3-微信登录 4-QQ登录 5-微博登录 6-苹果登录 | ||
| 66 | private Integer loginType; | ||
| 67 | |||
| 68 | // 状态 0-下线 1-上线 | ||
| 69 | private Integer status; | ||
| 70 | |||
| 71 | // 描述 | ||
| 72 | private String description; | ||
| 73 | |||
| 74 | // 创建者 | ||
| 75 | private String createBy; | ||
| 76 | |||
| 77 | // 创建时间 | ||
| 78 | private Timestamp createTime; | ||
| 79 | |||
| 80 | // 更新者 | ||
| 81 | private String updateBy; | ||
| 82 | |||
| 83 | // 更新时间 | ||
| 84 | private Timestamp updateTime; | ||
| 85 | |||
| 86 | // 会员id | ||
| 87 | private Long memberId; | ||
| 88 | |||
| 89 | private String memberCode; | ||
| 90 | |||
| 91 | |||
| 92 | } |
| 1 | package com.topdraw.business.process.service.domian; | ||
| 2 | |||
| 3 | import com.topdraw.business.process.domian.TempRights; | ||
| 4 | import lombok.AllArgsConstructor; | ||
| 5 | import lombok.Data; | ||
| 6 | import lombok.NoArgsConstructor; | ||
| 7 | import lombok.ToString; | ||
| 8 | |||
| 9 | import javax.persistence.Transient; | ||
| 10 | import javax.validation.constraints.NotNull; | ||
| 11 | |||
| 12 | /** | ||
| 13 | * 权益-非持久化数据 | ||
| 14 | */ | ||
| 15 | @Data | ||
| 16 | @AllArgsConstructor | ||
| 17 | @NoArgsConstructor | ||
| 18 | @ToString | ||
| 19 | public class TempPoints extends TempRights { | ||
| 20 | |||
| 21 | // 获得积分 | ||
| 22 | @Transient | ||
| 23 | @NotNull(message = "【points】积分数值不得为空!!") | ||
| 24 | protected Long points; | ||
| 25 | |||
| 26 | // 积分类型 0:通用 | ||
| 27 | @Transient | ||
| 28 | protected Integer pointsType; | ||
| 29 | |||
| 30 | @Transient | ||
| 31 | protected Long rewardPointsExpireTime; | ||
| 32 | |||
| 33 | } |
| 1 | package com.topdraw.business.process.service.domian; | ||
| 2 | |||
| 3 | import lombok.AllArgsConstructor; | ||
| 4 | import lombok.Data; | ||
| 5 | import lombok.NoArgsConstructor; | ||
| 6 | |||
| 7 | import javax.persistence.Transient; | ||
| 8 | import javax.validation.constraints.NotNull; | ||
| 9 | import java.time.LocalDateTime; | ||
| 10 | |||
| 11 | /** | ||
| 12 | * 权益-非持久化数据 | ||
| 13 | */ | ||
| 14 | @Data | ||
| 15 | @AllArgsConstructor | ||
| 16 | @NoArgsConstructor | ||
| 17 | public class TempRights { | ||
| 18 | |||
| 19 | /** 主键 */ | ||
| 20 | @Transient | ||
| 21 | protected Long id; | ||
| 22 | |||
| 23 | /** 编号 */ | ||
| 24 | @Transient | ||
| 25 | protected String code; | ||
| 26 | |||
| 27 | /** 权益名称 */ | ||
| 28 | @Transient | ||
| 29 | protected String name; | ||
| 30 | |||
| 31 | /** 会员ID */ | ||
| 32 | @Transient | ||
| 33 | protected Long memberId; | ||
| 34 | |||
| 35 | /** 会员编号 */ | ||
| 36 | @Transient | ||
| 37 | protected String memberCode; | ||
| 38 | |||
| 39 | /** 账号id */ | ||
| 40 | @Transient | ||
| 41 | protected Long userId; | ||
| 42 | |||
| 43 | /** 发放策略 */ | ||
| 44 | @Transient | ||
| 45 | protected Integer rightsSendStrategy; | ||
| 46 | |||
| 47 | /** 账号id */ | ||
| 48 | @Transient | ||
| 49 | protected Long accountId; | ||
| 50 | |||
| 51 | /** 过期时间 */ | ||
| 52 | @Transient | ||
| 53 | protected LocalDateTime expireTime; | ||
| 54 | |||
| 55 | |||
| 56 | /** 设备类型 1:大屏;2:小屏(微信)3.小屏(xx) */ | ||
| 57 | @Transient | ||
| 58 | @NotNull(message = "设备类型不得为空") | ||
| 59 | protected Integer deviceType; | ||
| 60 | |||
| 61 | /** 应用code(表示当前用户对应应用的标识) */ | ||
| 62 | @Transient | ||
| 63 | protected String appCode; | ||
| 64 | |||
| 65 | /** 订单id */ | ||
| 66 | @Transient | ||
| 67 | protected Long orderId; | ||
| 68 | |||
| 69 | /** 节目id(针对观影操作) */ | ||
| 70 | @Transient | ||
| 71 | protected Long mediaId; | ||
| 72 | |||
| 73 | /** 活动id(针对参与活动) */ | ||
| 74 | @Transient | ||
| 75 | protected Long activityId; | ||
| 76 | |||
| 77 | /** 商品id */ | ||
| 78 | @Transient | ||
| 79 | protected Long itemId; | ||
| 80 | |||
| 81 | /** 积分变化描述,用于管理侧显示 */ | ||
| 82 | @Transient | ||
| 83 | protected String description; | ||
| 84 | |||
| 85 | /** 行为事件类型 1:登录;2:观影;3:参与活动;4:订购;10:跨屏绑定;11:积分转移;98:系统操作;99:其他 */ | ||
| 86 | @Transient | ||
| 87 | protected Integer evtType; | ||
| 88 | |||
| 89 | /** 数量 */ | ||
| 90 | @Transient | ||
| 91 | protected Integer rightsAmount; | ||
| 92 | |||
| 93 | } |
| 1 | package com.topdraw.business.process.service.domian.result; | ||
| 2 | |||
| 3 | |||
| 4 | import lombok.AllArgsConstructor; | ||
| 5 | import lombok.Data; | ||
| 6 | import lombok.NoArgsConstructor; | ||
| 7 | |||
| 8 | @Data | ||
| 9 | @AllArgsConstructor | ||
| 10 | @NoArgsConstructor | ||
| 11 | public class CustomPointsResult { | ||
| 12 | private boolean result; | ||
| 13 | private Long point; | ||
| 14 | } |
| 1 | package com.topdraw.business.process.service.domian.weixin; | ||
| 2 | |||
| 3 | import com.fasterxml.jackson.annotation.JsonFormat; | ||
| 4 | import lombok.Data; | ||
| 5 | |||
| 6 | import java.time.LocalDateTime; | ||
| 7 | |||
| 8 | /** | ||
| 9 | * 微信账户信息 | ||
| 10 | * @author XiangHan | ||
| 11 | * @date 2021-01-18 | ||
| 12 | */ | ||
| 13 | @Data | ||
| 14 | public class BuyVipBean extends WeiXinUserBean { | ||
| 15 | |||
| 16 | private Integer vip; | ||
| 17 | |||
| 18 | @JsonFormat(shape = JsonFormat.Shape.STRING,pattern = "yyyy-MM-dd HH:mm:ss") | ||
| 19 | private LocalDateTime vipExpireTime; | ||
| 20 | |||
| 21 | |||
| 22 | } |
| 1 | package com.topdraw.business.process.service.domian.weixin; | ||
| 2 | |||
| 3 | |||
| 4 | import com.alibaba.fastjson.JSONObject; | ||
| 5 | import lombok.Data; | ||
| 6 | |||
| 7 | @Data | ||
| 8 | public class SubscribeBean extends WeiXinUserBean { | ||
| 9 | |||
| 10 | private JSONObject userInfoJson; | ||
| 11 | |||
| 12 | private JSONObject iptvUserInfo; | ||
| 13 | |||
| 14 | private String msgType; | ||
| 15 | |||
| 16 | private String event; | ||
| 17 | |||
| 18 | |||
| 19 | /** */ | ||
| 20 | private String openId; | ||
| 21 | |||
| 22 | /** */ | ||
| 23 | private String appId; | ||
| 24 | |||
| 25 | /** */ | ||
| 26 | private String eventKey; | ||
| 27 | |||
| 28 | private String unionid; | ||
| 29 | private String nickname; | ||
| 30 | private String headimgurl; | ||
| 31 | |||
| 32 | } |
| 1 | package com.topdraw.business.process.service.domian.weixin; | ||
| 2 | |||
| 3 | import lombok.AllArgsConstructor; | ||
| 4 | import lombok.Data; | ||
| 5 | import lombok.NoArgsConstructor; | ||
| 6 | |||
| 7 | import javax.validation.constraints.NotNull; | ||
| 8 | |||
| 9 | @Data | ||
| 10 | @AllArgsConstructor | ||
| 11 | @NoArgsConstructor | ||
| 12 | public class SubscribeBeanEvent { | ||
| 13 | |||
| 14 | @NotNull(message = "【content】 not be null !!!") | ||
| 15 | private String content; | ||
| 16 | |||
| 17 | } |
| 1 | package com.topdraw.business.process.service.domian.weixin; | ||
| 2 | |||
| 3 | |||
| 4 | import com.alibaba.fastjson.annotation.JSONField; | ||
| 5 | import com.topdraw.annotation.Query; | ||
| 6 | import lombok.Data; | ||
| 7 | |||
| 8 | import java.sql.Timestamp; | ||
| 9 | |||
| 10 | @Data | ||
| 11 | public class UserCollectionMq { | ||
| 12 | |||
| 13 | // 应用ID | ||
| 14 | @JSONField(name = "app_id") | ||
| 15 | private Long appId; | ||
| 16 | |||
| 17 | @JSONField(name = "userId") | ||
| 18 | private Long userId; | ||
| 19 | |||
| 20 | // 收藏夹类型:1-收藏 2-播放记录 3-播放列表 4-评分 5-点赞/关注/订阅 | ||
| 21 | private Integer type; | ||
| 22 | |||
| 23 | // 收藏夹名称 | ||
| 24 | private String name; | ||
| 25 | |||
| 26 | // 数量 | ||
| 27 | private Integer count; | ||
| 28 | |||
| 29 | private String images; | ||
| 30 | |||
| 31 | // 收藏夹ID | ||
| 32 | @JSONField(name = "user_collection_id") | ||
| 33 | @Query | ||
| 34 | private Long userCollectionId; | ||
| 35 | |||
| 36 | // 自定义收藏内容的类型CODE,默认:DEFAULT | ||
| 37 | @JSONField(name = "detail_folder_code") | ||
| 38 | @Query | ||
| 39 | private String detailFolderCode; | ||
| 40 | |||
| 41 | // 收藏内容的类型:MEDIA|EPISODE|CATEGORY|SUBJECT|ARTICLE|ARTIST|SCHOOL | ||
| 42 | @JSONField(name = "detail_type") | ||
| 43 | @Query | ||
| 44 | private String detailType; | ||
| 45 | |||
| 46 | // 收藏内容的ID | ||
| 47 | @JSONField(name = "detail_id") | ||
| 48 | @Query | ||
| 49 | private Long detailId; | ||
| 50 | |||
| 51 | // 收藏内容的CODE | ||
| 52 | @JSONField(name = "detail_code") | ||
| 53 | @Query | ||
| 54 | private String detailCode; | ||
| 55 | |||
| 56 | // 收藏内容的剧集ID | ||
| 57 | @JSONField(name = "detail_episode_id") | ||
| 58 | @Query | ||
| 59 | private Long detailEpisodeId; | ||
| 60 | |||
| 61 | // 收藏内容的剧集CODE | ||
| 62 | @JSONField(name = "detail_episode_code") | ||
| 63 | @Query | ||
| 64 | private String detailEpisodeCode; | ||
| 65 | |||
| 66 | // 收藏内容的名称 | ||
| 67 | @JSONField(name = "detail_name") | ||
| 68 | @Query | ||
| 69 | private String detailName; | ||
| 70 | |||
| 71 | // 收藏内容的标记 | ||
| 72 | @JSONField(name = "detail_mark") | ||
| 73 | @Query | ||
| 74 | private Integer detailMark; | ||
| 75 | |||
| 76 | // 收藏内容的图片 | ||
| 77 | @JSONField(name = "detail_img") | ||
| 78 | private String detailImg; | ||
| 79 | |||
| 80 | // 收藏内容的剧集序号 | ||
| 81 | @JSONField(name = "detail_index") | ||
| 82 | @Query | ||
| 83 | private Integer detailIndex; | ||
| 84 | |||
| 85 | // 收藏内容的剧集总数 | ||
| 86 | @JSONField(name = "detail_total_index") | ||
| 87 | @Query | ||
| 88 | private Integer detailTotalIndex; | ||
| 89 | |||
| 90 | // 收藏内容的播放时间 | ||
| 91 | @JSONField(name = "detail_play_time") | ||
| 92 | @Query | ||
| 93 | private Integer detailPlayTime; | ||
| 94 | |||
| 95 | // 收藏内容的总时间 | ||
| 96 | @JSONField(name = "detail_total_time") | ||
| 97 | @Query | ||
| 98 | private Integer detailTotalTime; | ||
| 99 | |||
| 100 | // 收藏内容在同一folder中的顺序 | ||
| 101 | @JSONField(name = "detail_sequence") | ||
| 102 | @Query | ||
| 103 | private Integer detailSequence; | ||
| 104 | |||
| 105 | // 收藏内容的评分 | ||
| 106 | @JSONField(name = "detail_score") | ||
| 107 | @Query | ||
| 108 | private Float detailScore; | ||
| 109 | |||
| 110 | // 收藏内容(根据文件夹和类型的不同)的点赞/关注/订阅 | ||
| 111 | @JSONField(name = "detail_like") | ||
| 112 | @Query | ||
| 113 | private Integer detailLike; | ||
| 114 | |||
| 115 | // 收藏内容的扩展数据 | ||
| 116 | @JSONField(name = "detail_ext_data") | ||
| 117 | @Query | ||
| 118 | private String detailExtData; | ||
| 119 | |||
| 120 | // 创建时间 | ||
| 121 | @JSONField(name = "create_time") | ||
| 122 | @Query | ||
| 123 | private Timestamp createTime; | ||
| 124 | |||
| 125 | // 更新时间 | ||
| 126 | @JSONField(name = "update_time") | ||
| 127 | private Timestamp updateTime; | ||
| 128 | } |
| 1 | package com.topdraw.business.process.service.domian.weixin; | ||
| 2 | |||
| 3 | |||
| 4 | import lombok.Data; | ||
| 5 | |||
| 6 | /** | ||
| 7 | * 微信账户信息 | ||
| 8 | * @author XiangHan | ||
| 9 | * @date 2021-01-18 | ||
| 10 | */ | ||
| 11 | @Data | ||
| 12 | public class WeiXinUserBean { | ||
| 13 | |||
| 14 | private Long id; | ||
| 15 | |||
| 16 | private String unionid; | ||
| 17 | |||
| 18 | /** */ | ||
| 19 | private String openid; | ||
| 20 | |||
| 21 | /** */ | ||
| 22 | private String appid; | ||
| 23 | |||
| 24 | /** 加密后的appId,参数 */ | ||
| 25 | private String wxAppid; | ||
| 26 | |||
| 27 | /** 加密后的code,参数 */ | ||
| 28 | private String wxCode; | ||
| 29 | |||
| 30 | /** */ | ||
| 31 | private String userInfo; | ||
| 32 | |||
| 33 | /** 会员id */ | ||
| 34 | private Long memberId; | ||
| 35 | |||
| 36 | /** 加密信息 */ | ||
| 37 | private String encryptedData; | ||
| 38 | |||
| 39 | /** 解析用户电话号码时使用,参数 */ | ||
| 40 | private String iv; | ||
| 41 | |||
| 42 | /** 资源id */ | ||
| 43 | private String sourceId; | ||
| 44 | |||
| 45 | /** 资源类型 */ | ||
| 46 | private String sourceType; | ||
| 47 | |||
| 48 | /** 资源描述,用来表示从哪个地方链接进来的 */ | ||
| 49 | private String sourceDesc; | ||
| 50 | |||
| 51 | /** 资源实例 */ | ||
| 52 | private String sourceEntity; | ||
| 53 | |||
| 54 | /** 推荐者id */ | ||
| 55 | private Long sourceUser; | ||
| 56 | |||
| 57 | private String nikename; | ||
| 58 | |||
| 59 | private String headimgurl; | ||
| 60 | } |
| 1 | package com.topdraw.business.process.service.impl; | ||
| 2 | |||
| 3 | import com.topdraw.business.module.member.service.dto.MemberDTO; | ||
| 4 | import com.topdraw.business.module.task.domain.Task; | ||
| 5 | |||
| 6 | import java.util.List; | ||
| 7 | |||
| 8 | @FunctionalInterface | ||
| 9 | public interface CompareTaskCondition { | ||
| 10 | |||
| 11 | boolean compareCondition(MemberDTO memberDTO, List<Task> taskList); | ||
| 12 | |||
| 13 | } |
| 1 | package com.topdraw.business.process.service.impl; | ||
| 2 | |||
| 3 | import com.topdraw.business.module.coupon.history.domain.CouponHistory; | ||
| 4 | import com.topdraw.business.module.coupon.history.service.CouponHistoryService; | ||
| 5 | import com.topdraw.business.module.coupon.service.CouponService; | ||
| 6 | import com.topdraw.business.module.member.domain.Member; | ||
| 7 | import com.topdraw.business.module.member.service.MemberService; | ||
| 8 | import com.topdraw.business.module.member.service.dto.MemberDTO; | ||
| 9 | import com.topdraw.business.process.domian.TempCoupon; | ||
| 10 | import com.topdraw.business.process.service.CouponOperationService; | ||
| 11 | import com.topdraw.business.process.service.MemberOperationService; | ||
| 12 | import com.topdraw.business.process.service.RightsOperationService; | ||
| 13 | import com.topdraw.util.RedissonUtil; | ||
| 14 | import org.redisson.api.RLock; | ||
| 15 | import org.redisson.api.RedissonClient; | ||
| 16 | import org.slf4j.Logger; | ||
| 17 | import org.slf4j.LoggerFactory; | ||
| 18 | import org.springframework.beans.BeanUtils; | ||
| 19 | import org.springframework.beans.factory.annotation.Autowired; | ||
| 20 | import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; | ||
| 21 | import org.springframework.stereotype.Service; | ||
| 22 | |||
| 23 | import java.time.LocalDateTime; | ||
| 24 | import java.util.List; | ||
| 25 | import java.util.Objects; | ||
| 26 | |||
| 27 | |||
| 28 | @Service | ||
| 29 | public class CouponOperationServiceImpl implements CouponOperationService { | ||
| 30 | |||
| 31 | private static final Logger LOG = LoggerFactory.getLogger(CouponOperationServiceImpl.class); | ||
| 32 | |||
| 33 | @Autowired | ||
| 34 | CouponService couponService; | ||
| 35 | @Autowired | ||
| 36 | CouponHistoryService couponHistoryService; | ||
| 37 | @Autowired | ||
| 38 | MemberOperationService memberOperationService; | ||
| 39 | @Autowired | ||
| 40 | RightsOperationService rightsOperationService; | ||
| 41 | @Autowired | ||
| 42 | MemberService memberService; | ||
| 43 | @Autowired | ||
| 44 | RedissonClient redissonClient; | ||
| 45 | @Autowired | ||
| 46 | ThreadPoolTaskExecutor threadPoolTaskExecutor; | ||
| 47 | |||
| 48 | // 过期阀值(默认一个月) | ||
| 49 | private static final Integer EXPIRE_FACTOR_DAY = 30; | ||
| 50 | |||
| 51 | @Override | ||
| 52 | public void grantCouponThroughTempCoupon(List<TempCoupon> tempCouponList) { | ||
| 53 | // 优惠券领取、使用历史记录表 | ||
| 54 | for (TempCoupon tempCoupon : tempCouponList) { | ||
| 55 | this.refresh(tempCoupon); | ||
| 56 | } | ||
| 57 | } | ||
| 58 | |||
| 59 | /** | ||
| 60 | * 手动发放优惠券 | ||
| 61 | * @param tempCouponList | ||
| 62 | */ | ||
| 63 | @Override | ||
| 64 | public void grantCouponByManual(List<TempCoupon> tempCouponList) { | ||
| 65 | // 优惠券领取、使用历史记录表 | ||
| 66 | for (TempCoupon tempCoupon : tempCouponList) { | ||
| 67 | this.refresh(tempCoupon); | ||
| 68 | } | ||
| 69 | } | ||
| 70 | |||
| 71 | |||
| 72 | /** | ||
| 73 | * 优惠券领取历史记录表 | ||
| 74 | * | ||
| 75 | * @param tempCoupon 领取的优惠券 | ||
| 76 | */ | ||
| 77 | private void refresh(TempCoupon tempCoupon) { | ||
| 78 | // 1.更新会员优惠券数量 | ||
| 79 | this.refreshMemberCoupon(tempCoupon); | ||
| 80 | // 2.保存优惠券领取、使用历史记录表 | ||
| 81 | this.doInsertCouponHistory(tempCoupon); | ||
| 82 | } | ||
| 83 | |||
| 84 | |||
| 85 | /** | ||
| 86 | * 更新会员优惠券信息 | ||
| 87 | * @param tempCoupon 账号id | ||
| 88 | */ | ||
| 89 | private void refreshMemberCoupon(TempCoupon tempCoupon) { | ||
| 90 | // Long userId = tempCoupon.getUserId(); | ||
| 91 | Long memberId = tempCoupon.getMemberId(); | ||
| 92 | Integer rightsAmount = tempCoupon.getRightsAmount(); | ||
| 93 | RLock rLock = this.redissonClient.getLock("refreshMemberCoupon:" + memberId.toString()); | ||
| 94 | try { | ||
| 95 | RedissonUtil.lock(rLock); | ||
| 96 | // 1.历史总优惠券数量 | ||
| 97 | Long historyCouponCount = this.getTotalHistoryCoupon(memberId); | ||
| 98 | // 1.当前总优惠券数量 | ||
| 99 | Long totalCouponCount = this.getTotalCoupon(historyCouponCount,rightsAmount); | ||
| 100 | // 2.获取已过期的优惠券数量 | ||
| 101 | Long expireCouponCount = this.getTotalExpireCoupon(memberId); | ||
| 102 | // 3.即将过期的优惠券数量 | ||
| 103 | Long expireSoonCouponCount = this.getTotalExpireSoonCoupon(memberId,EXPIRE_FACTOR_DAY); | ||
| 104 | // 4.当前优惠券数量 = 总优惠券-已过期的优惠券 | ||
| 105 | Long currentCoupon = this.getCurrentCoupon(totalCouponCount,expireCouponCount); | ||
| 106 | // 5.更新用户信息(优惠券数量、即将过期的优惠券数量) | ||
| 107 | this.doUpdateMemberInfo(memberId,currentCoupon,expireSoonCouponCount); | ||
| 108 | } catch (Exception e) { | ||
| 109 | e.printStackTrace(); | ||
| 110 | throw e; | ||
| 111 | } finally { | ||
| 112 | RedissonUtil.unlock(rLock); | ||
| 113 | } | ||
| 114 | } | ||
| 115 | |||
| 116 | private Long getTotalCoupon(Long historyCouponCount, Integer rightsAmount) { | ||
| 117 | return (Objects.nonNull(historyCouponCount) ? historyCouponCount: 0L) + (Objects.nonNull(rightsAmount) ? rightsAmount: 0L); | ||
| 118 | } | ||
| 119 | |||
| 120 | |||
| 121 | /** | ||
| 122 | * 更新当前用户优惠券信息 | ||
| 123 | * @param memberId | ||
| 124 | * @param currentCoupon | ||
| 125 | * @param expireSoonCouponCount | ||
| 126 | */ | ||
| 127 | private void doUpdateMemberInfo(Long memberId, Long currentCoupon, Long expireSoonCouponCount) { | ||
| 128 | MemberDTO memberDTO = this.findMemberByMemberId(memberId); | ||
| 129 | |||
| 130 | Member member = new Member(); | ||
| 131 | BeanUtils.copyProperties(memberDTO,member); | ||
| 132 | |||
| 133 | member.setCouponAmount(currentCoupon); | ||
| 134 | member.setDueCouponAmount(expireSoonCouponCount); | ||
| 135 | member.setUpdateTime(LocalDateTime.now()); | ||
| 136 | this.memberOperationService.doUpdateMemberInfo(member); | ||
| 137 | } | ||
| 138 | |||
| 139 | private MemberDTO findMemberByMemberId(Long memberId) { | ||
| 140 | MemberDTO memberDTO = this.memberService.findById(memberId); | ||
| 141 | return memberDTO; | ||
| 142 | } | ||
| 143 | |||
| 144 | |||
| 145 | |||
| 146 | /** | ||
| 147 | * 当前优惠券数量 = 总优惠券-已过期的优惠券 | ||
| 148 | * @param totalCouponCount 总数 | ||
| 149 | * @param expireCouponCount 已过期总数 | ||
| 150 | * @return | ||
| 151 | */ | ||
| 152 | private Long getCurrentCoupon(Long totalCouponCount, Long expireCouponCount) { | ||
| 153 | return (Objects.nonNull(totalCouponCount)?totalCouponCount:0L)-(Objects.nonNull(expireCouponCount)?expireCouponCount:0L); | ||
| 154 | } | ||
| 155 | |||
| 156 | |||
| 157 | /** | ||
| 158 | * 即将过期的优惠券数量 | ||
| 159 | * @param expireFactor | ||
| 160 | * @return | ||
| 161 | */ | ||
| 162 | private Long getTotalExpireSoonCoupon(Long userId, Integer expireFactor) { | ||
| 163 | LocalDateTime expireTime = LocalDateTime.now().plusDays(expireFactor); | ||
| 164 | return this.couponHistoryService.countByUserIdAndExpireTimeBetween(userId,LocalDateTime.now(),expireTime); | ||
| 165 | } | ||
| 166 | |||
| 167 | |||
| 168 | /** | ||
| 169 | * 获取已过期的优惠券数量 | ||
| 170 | * @param userId | ||
| 171 | * @return | ||
| 172 | */ | ||
| 173 | private Long getTotalExpireCoupon(Long userId) { | ||
| 174 | return this.couponHistoryService.countByUserIdAndExpireTimeBefore(userId,LocalDateTime.now()); | ||
| 175 | } | ||
| 176 | |||
| 177 | |||
| 178 | /** | ||
| 179 | * 获取用户领取的总优惠券 | ||
| 180 | * @param userId | ||
| 181 | * @return | ||
| 182 | */ | ||
| 183 | private Long getTotalHistoryCoupon(Long userId) { | ||
| 184 | return this.couponHistoryService.countByUserId(userId); | ||
| 185 | } | ||
| 186 | |||
| 187 | |||
| 188 | /** | ||
| 189 | * 优惠券领取、使用历史记录表 | ||
| 190 | * @param tempCoupon 优惠券 | ||
| 191 | */ | ||
| 192 | private void doInsertCouponHistory(TempCoupon tempCoupon) { | ||
| 193 | CouponHistory couponHistory = new CouponHistory(); | ||
| 194 | BeanUtils.copyProperties(tempCoupon,couponHistory); | ||
| 195 | couponHistory.setId(null); | ||
| 196 | couponHistory.setCouponId(tempCoupon.getId()); | ||
| 197 | couponHistory.setUserId(tempCoupon.getMemberId()); | ||
| 198 | couponHistory.setCouponCode(tempCoupon.getCode()); | ||
| 199 | couponHistory.setUserNickname(tempCoupon.getUserNickname()); | ||
| 200 | couponHistory.setOrderDetailId(tempCoupon.getOrderId()); | ||
| 201 | couponHistory.setReceiveTime(LocalDateTime.now()); | ||
| 202 | couponHistory.setUseStatus(Objects.nonNull(couponHistory.getUseStatus()) ? couponHistory.getUseStatus():0); | ||
| 203 | this.couponHistoryService.create(couponHistory); | ||
| 204 | } | ||
| 205 | |||
| 206 | |||
| 207 | } |
| 1 | package com.topdraw.business.process.service.impl; | ||
| 2 | |||
| 3 | import com.topdraw.business.module.exp.detail.domain.ExpDetail; | ||
| 4 | import com.topdraw.business.module.exp.detail.service.ExpDetailService; | ||
| 5 | import com.topdraw.business.module.member.domain.Member; | ||
| 6 | import com.topdraw.business.module.member.level.service.MemberLevelService; | ||
| 7 | import com.topdraw.business.module.member.level.service.dto.MemberLevelDTO; | ||
| 8 | import com.topdraw.business.module.member.service.MemberService; | ||
| 9 | import com.topdraw.business.module.member.service.dto.MemberDTO; | ||
| 10 | import com.topdraw.business.process.domian.TempExp; | ||
| 11 | import com.topdraw.business.process.service.ExpOperationService; | ||
| 12 | import com.topdraw.business.process.service.MemberOperationService; | ||
| 13 | import com.topdraw.util.IdWorker; | ||
| 14 | import com.topdraw.util.RedissonUtil; | ||
| 15 | import com.topdraw.utils.StringUtils; | ||
| 16 | import org.redisson.api.RLock; | ||
| 17 | import org.redisson.api.RedissonClient; | ||
| 18 | import org.slf4j.Logger; | ||
| 19 | import org.slf4j.LoggerFactory; | ||
| 20 | import org.springframework.beans.BeanUtils; | ||
| 21 | import org.springframework.beans.factory.annotation.Autowired; | ||
| 22 | import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; | ||
| 23 | import org.springframework.stereotype.Service; | ||
| 24 | import org.springframework.util.CollectionUtils; | ||
| 25 | |||
| 26 | import java.time.LocalDateTime; | ||
| 27 | import java.util.List; | ||
| 28 | import java.util.Objects; | ||
| 29 | |||
| 30 | /** | ||
| 31 | * | ||
| 32 | */ | ||
| 33 | @Service | ||
| 34 | public class ExpOperationServiceImpl implements ExpOperationService { | ||
| 35 | |||
| 36 | private static final Logger LOG = LoggerFactory.getLogger(ExpOperationServiceImpl.class); | ||
| 37 | |||
| 38 | @Autowired | ||
| 39 | ExpDetailService expDetailService; | ||
| 40 | @Autowired | ||
| 41 | MemberOperationService memberOperationService; | ||
| 42 | @Autowired | ||
| 43 | MemberLevelService memberLevelService; | ||
| 44 | @Autowired | ||
| 45 | MemberService memberService; | ||
| 46 | @Autowired | ||
| 47 | RedissonClient redissonClient; | ||
| 48 | @Autowired | ||
| 49 | ThreadPoolTaskExecutor threadPoolTaskExecutor; | ||
| 50 | |||
| 51 | @Override | ||
| 52 | public void grantPointsThroughTempExp(List<TempExp> tempExpList) { | ||
| 53 | |||
| 54 | for (TempExp tempExp : tempExpList) { | ||
| 55 | this.refresh(tempExp); | ||
| 56 | } | ||
| 57 | |||
| 58 | } | ||
| 59 | |||
| 60 | @Override | ||
| 61 | public void grantExpByManual(Long memberId, Long userId, List<TempExp> tempExpList) { | ||
| 62 | for (TempExp tempExp : tempExpList) { | ||
| 63 | this.refresh(tempExp); | ||
| 64 | } | ||
| 65 | } | ||
| 66 | |||
| 67 | @Override | ||
| 68 | public void grantExpByManual(List<TempExp> tempExpList) { | ||
| 69 | for (TempExp tempExp : tempExpList) { | ||
| 70 | this.refresh(tempExp); | ||
| 71 | } | ||
| 72 | } | ||
| 73 | |||
| 74 | |||
| 75 | /** | ||
| 76 | * | ||
| 77 | * @param tempExp | ||
| 78 | */ | ||
| 79 | private void refresh(TempExp tempExp) { | ||
| 80 | String memberCode = tempExp.getMemberCode(); | ||
| 81 | MemberDTO memberDTO = this.memberService.getByCode(memberCode); | ||
| 82 | Long id = memberDTO.getId(); | ||
| 83 | tempExp.setId(id); | ||
| 84 | RLock lock = this.redissonClient.getLock("uc-refresh-exp:" + tempExp.getMemberId()); | ||
| 85 | try { | ||
| 86 | RedissonUtil.lock(lock); | ||
| 87 | // 原始积分 | ||
| 88 | long originExp = this.getExpByMemberId(tempExp); | ||
| 89 | // 总积分 | ||
| 90 | long totalExp = this.calculateTotalExp(originExp, tempExp); | ||
| 91 | // 1.添加成长值记录 | ||
| 92 | // this.threadPoolTaskExecutor.execute(() -> this.doInsertExpDetail(tempExp, originExp, totalExp)); | ||
| 93 | // 2.更新成长值与等级 | ||
| 94 | this.refreshMemberExpAndLevel(tempExp,totalExp); | ||
| 95 | |||
| 96 | this.doInsertExpDetail(tempExp, originExp, totalExp); | ||
| 97 | |||
| 98 | } catch (Exception e) { | ||
| 99 | e.printStackTrace(); | ||
| 100 | throw e; | ||
| 101 | } finally { | ||
| 102 | RedissonUtil.unlock(lock); | ||
| 103 | } | ||
| 104 | } | ||
| 105 | |||
| 106 | private long calculateTotalExp(long originalExp, TempExp tempExp) { | ||
| 107 | Long rewardExp = tempExp.getRewardExp(); | ||
| 108 | return rewardExp + originalExp; | ||
| 109 | } | ||
| 110 | |||
| 111 | private long getExpByMemberId(TempExp tempExp) { | ||
| 112 | Long memberId = tempExp.getMemberId(); | ||
| 113 | MemberDTO memberDTO = this.memberOperationService.findById(memberId); | ||
| 114 | if (Objects.nonNull(memberDTO)) { | ||
| 115 | Long exp = memberDTO.getExp(); | ||
| 116 | return Objects.isNull(exp) ? 0L : exp; | ||
| 117 | } | ||
| 118 | return 0L; | ||
| 119 | } | ||
| 120 | |||
| 121 | |||
| 122 | /** | ||
| 123 | * 更新成长值与等级 | ||
| 124 | * | ||
| 125 | * @param tempExp 成长值列表 | ||
| 126 | */ | ||
| 127 | private void refreshMemberExpAndLevel(TempExp tempExp, long totalExp) { | ||
| 128 | |||
| 129 | Long memberId = tempExp.getMemberId(); | ||
| 130 | // 1.获取当前成长值 | ||
| 131 | MemberDTO memberDTO = this.getMemberInfoByMemberId(memberId); | ||
| 132 | // 2.获取下一级需要的成长值 | ||
| 133 | MemberLevelDTO memberLevelDTO = this.getNextLevelExp(memberDTO.getLevel() + 1, 1); | ||
| 134 | // 4.成长值比较,判断是否升级 | ||
| 135 | Integer level = this.compareExp(totalExp, memberLevelDTO,memberDTO); | ||
| 136 | // 5.更新用户信息 | ||
| 137 | this.updateMemberInfo(level, totalExp, memberId); | ||
| 138 | } | ||
| 139 | |||
| 140 | /** | ||
| 141 | * | ||
| 142 | * @param level | ||
| 143 | * @param totalExp 总积分 | ||
| 144 | * @param memberId 会员id | ||
| 145 | */ | ||
| 146 | private void updateMemberInfo(Integer level,Long totalExp,Long memberId) { | ||
| 147 | MemberDTO memberDTO = this.findMemberByMemberId(memberId); | ||
| 148 | |||
| 149 | Member member = new Member(); | ||
| 150 | BeanUtils.copyProperties(memberDTO,member); | ||
| 151 | |||
| 152 | member.setExp(totalExp); | ||
| 153 | member.setLevel(level); | ||
| 154 | member.setUpdateTime(LocalDateTime.now()); | ||
| 155 | this.memberOperationService.doUpdateMemberInfo(member); | ||
| 156 | } | ||
| 157 | |||
| 158 | private MemberDTO findMemberByMemberId(Long memberId) { | ||
| 159 | MemberDTO memberDTO = this.memberService.findById(memberId); | ||
| 160 | return memberDTO; | ||
| 161 | } | ||
| 162 | |||
| 163 | private Integer compareExp(long newExp, MemberLevelDTO memberLevelDTO, MemberDTO memberDTO) { | ||
| 164 | if (Objects.nonNull(memberLevelDTO)) { | ||
| 165 | Long nextLevelExp = memberLevelDTO.getExpValue(); | ||
| 166 | if (Objects.nonNull(nextLevelExp) && nextLevelExp > 0) | ||
| 167 | if(newExp - nextLevelExp >= 0){ | ||
| 168 | return memberLevelDTO.getLevel(); | ||
| 169 | } | ||
| 170 | } | ||
| 171 | return memberDTO.getLevel(); | ||
| 172 | } | ||
| 173 | |||
| 174 | private MemberLevelDTO getNextLevelExp(Integer i, Integer status) { | ||
| 175 | List<MemberLevelDTO> memberLevelDTOList = this.memberLevelService.findLevelAndStatus(i,status); | ||
| 176 | if (!CollectionUtils.isEmpty(memberLevelDTOList)) { | ||
| 177 | return memberLevelDTOList.get(0); | ||
| 178 | } | ||
| 179 | return null; | ||
| 180 | } | ||
| 181 | |||
| 182 | |||
| 183 | /** | ||
| 184 | * 获取当前会员的成长值 | ||
| 185 | * @param memberId 会员id | ||
| 186 | * @return Long 当前会员成长值 | ||
| 187 | */ | ||
| 188 | private MemberDTO getMemberInfoByMemberId(Long memberId) { | ||
| 189 | MemberDTO memberDTO = this.memberOperationService.findById(memberId); | ||
| 190 | return memberDTO; | ||
| 191 | } | ||
| 192 | |||
| 193 | /** | ||
| 194 | * 添加成长值记录 | ||
| 195 | * | ||
| 196 | * @param tempExp 成长值列表 | ||
| 197 | */ | ||
| 198 | private void doInsertExpDetail(TempExp tempExp, long originalExp, long totalExp) { | ||
| 199 | // 获得的积分 | ||
| 200 | Long rewardExp = tempExp.getRewardExp(); | ||
| 201 | |||
| 202 | ExpDetail expDetail = new ExpDetail(); | ||
| 203 | BeanUtils.copyProperties(tempExp,expDetail); | ||
| 204 | |||
| 205 | expDetail.setCode(String.valueOf(IdWorker.generator())); | ||
| 206 | // 原始积分 | ||
| 207 | expDetail.setOriginalExp(originalExp); | ||
| 208 | // 总积分 | ||
| 209 | expDetail.setResultExp(totalExp); | ||
| 210 | // 获得的积分 | ||
| 211 | expDetail.setExp(rewardExp); | ||
| 212 | if (StringUtils.isEmpty(expDetail.getDescription())) { | ||
| 213 | expDetail.setDescription("#"); | ||
| 214 | } | ||
| 215 | this.expDetailService.create(expDetail); | ||
| 216 | } | ||
| 217 | |||
| 218 | } |
| 1 | package com.topdraw.business.process.service.impl; | 1 | package com.topdraw.business.process.service.impl; |
| 2 | 2 | ||
| 3 | import com.topdraw.business.basicdata.member.domain.Member; | 3 | import com.topdraw.business.module.member.domain.Member; |
| 4 | import com.topdraw.business.basicdata.member.service.MemberService; | 4 | import com.topdraw.business.module.member.service.MemberService; |
| 5 | import com.topdraw.business.basicdata.member.service.dto.MemberDTO; | 5 | import com.topdraw.business.module.member.service.dto.MemberDTO; |
| 6 | import com.topdraw.business.process.service.MemberOperationService; | 6 | import com.topdraw.business.process.service.MemberOperationService; |
| 7 | import org.springframework.beans.factory.annotation.Autowired; | 7 | import org.springframework.beans.factory.annotation.Autowired; |
| 8 | import org.springframework.stereotype.Service; | 8 | import org.springframework.stereotype.Service; | ... | ... |
| 1 | package com.topdraw.business.process.service.impl; | 1 | package com.topdraw.business.process.service.impl; |
| 2 | 2 | ||
| 3 | 3 | ||
| 4 | import com.topdraw.business.basicdata.member.domain.Member; | 4 | import com.topdraw.business.module.member.domain.Member; |
| 5 | import com.topdraw.business.basicdata.member.service.MemberService; | 5 | import com.topdraw.business.module.member.service.MemberService; |
| 6 | import com.topdraw.business.basicdata.member.service.dto.MemberDTO; | 6 | import com.topdraw.business.module.member.service.dto.MemberDTO; |
| 7 | import com.topdraw.business.basicdata.points.available.domain.PointsAvailable; | 7 | import com.topdraw.business.module.points.available.domain.PointsAvailable; |
| 8 | import com.topdraw.business.basicdata.points.available.service.PointsAvailableService; | 8 | import com.topdraw.business.module.points.available.service.PointsAvailableService; |
| 9 | import com.topdraw.business.basicdata.points.available.service.dto.PointsAvailableDTO; | 9 | import com.topdraw.business.module.points.available.service.dto.PointsAvailableDTO; |
| 10 | import com.topdraw.business.basicdata.points.detail.detailhistory.service.PointsDetailHistoryService; | 10 | import com.topdraw.business.module.points.detail.detailhistory.service.PointsDetailHistoryService; |
| 11 | import com.topdraw.business.basicdata.points.detail.domain.PointsDetail; | 11 | import com.topdraw.business.module.points.detail.domain.PointsDetail; |
| 12 | import com.topdraw.business.basicdata.points.detail.service.PointsDetailService; | 12 | import com.topdraw.business.module.points.detail.service.PointsDetailService; |
| 13 | import com.topdraw.business.basicdata.points.service.PointsService; | 13 | import com.topdraw.business.module.points.service.PointsService; |
| 14 | import com.topdraw.business.process.domian.TempPoints; | 14 | import com.topdraw.business.process.domian.TempPoints; |
| 15 | import com.topdraw.business.process.service.MemberOperationService; | 15 | import com.topdraw.business.process.service.MemberOperationService; |
| 16 | import com.topdraw.business.process.service.PointsOperationService; | 16 | import com.topdraw.business.process.service.PointsOperationService; |
| ... | @@ -503,7 +503,7 @@ public class PointsOperationServiceImpl implements PointsOperationService { | ... | @@ -503,7 +503,7 @@ public class PointsOperationServiceImpl implements PointsOperationService { |
| 503 | member.setId(memberId); | 503 | member.setId(memberId); |
| 504 | member.setPoints(Objects.nonNull(currentPoints)?currentPoints:0); | 504 | member.setPoints(Objects.nonNull(currentPoints)?currentPoints:0); |
| 505 | member.setDuePoints(duePoints); | 505 | member.setDuePoints(duePoints); |
| 506 | member.setUpdateTime(Timestamp.valueOf(LocalDateTime.now())); | 506 | member.setUpdateTime(LocalDateTime.now()); |
| 507 | member.setCode(tempPoints.getMemberCode()); | 507 | member.setCode(tempPoints.getMemberCode()); |
| 508 | try { | 508 | try { |
| 509 | this.memberOperationService.doUpdateMemberPoints(member); | 509 | this.memberOperationService.doUpdateMemberPoints(member); | ... | ... |
| 1 | package com.topdraw.business.process.service.impl; | ||
| 2 | |||
| 3 | import cn.hutool.core.date.LocalDateTimeUtil; | ||
| 4 | import com.topdraw.business.module.coupon.service.CouponService; | ||
| 5 | import com.topdraw.business.module.coupon.service.dto.CouponDTO; | ||
| 6 | import com.topdraw.business.module.rights.history.domain.RightsHistory; | ||
| 7 | import com.topdraw.business.module.rights.history.service.RightsHistoryService; | ||
| 8 | import com.topdraw.business.module.rights.service.RightsService; | ||
| 9 | import com.topdraw.business.module.rights.service.dto.RightsDTO; | ||
| 10 | import com.topdraw.business.process.domian.*; | ||
| 11 | import com.topdraw.business.process.service.CouponOperationService; | ||
| 12 | import com.topdraw.business.process.service.ExpOperationService; | ||
| 13 | import com.topdraw.business.process.service.PointsOperationService; | ||
| 14 | import com.topdraw.business.process.service.RightsOperationService; | ||
| 15 | import com.topdraw.util.TimestampUtil; | ||
| 16 | import lombok.extern.slf4j.Slf4j; | ||
| 17 | import org.slf4j.Logger; | ||
| 18 | import org.slf4j.LoggerFactory; | ||
| 19 | import org.springframework.beans.factory.annotation.Autowired; | ||
| 20 | import org.springframework.stereotype.Service; | ||
| 21 | import org.springframework.util.CollectionUtils; | ||
| 22 | import org.springframework.util.StringUtils; | ||
| 23 | |||
| 24 | import java.time.LocalDateTime; | ||
| 25 | import java.util.*; | ||
| 26 | import java.util.concurrent.ExecutorService; | ||
| 27 | import java.util.concurrent.Executors; | ||
| 28 | |||
| 29 | /** | ||
| 30 | * 权益处理 | ||
| 31 | * | ||
| 32 | * @author XiangHan | ||
| 33 | * @date 2021.10.23 | ||
| 34 | */ | ||
| 35 | @Service | ||
| 36 | @Slf4j | ||
| 37 | public class RightsOperationServiceImpl implements RightsOperationService { | ||
| 38 | |||
| 39 | private static final Logger LOG = LoggerFactory.getLogger(RightsOperationServiceImpl.class); | ||
| 40 | |||
| 41 | @Autowired | ||
| 42 | RightsHistoryService rightsHistoryService; | ||
| 43 | @Autowired | ||
| 44 | CouponOperationService couponOperationService; | ||
| 45 | @Autowired | ||
| 46 | RightsService rightsService; | ||
| 47 | @Autowired | ||
| 48 | ExpOperationService expOperationService; | ||
| 49 | @Autowired | ||
| 50 | PointsOperationService pointsOperationService; | ||
| 51 | @Autowired | ||
| 52 | CouponService couponService; | ||
| 53 | |||
| 54 | // @Autowired | ||
| 55 | // ThreadPoolTaskExecutor threadPoolTaskExecutor; | ||
| 56 | |||
| 57 | private ExecutorService threadPoolTaskExecutor = Executors.newFixedThreadPool(10); | ||
| 58 | |||
| 59 | /** | ||
| 60 | * 系统手动发放 | ||
| 61 | * 实现步骤: | ||
| 62 | * 1.当前权益只有实体券 | ||
| 63 | * @param rightsList | ||
| 64 | */ | ||
| 65 | @Override | ||
| 66 | public void grantRightsByManual(List<RightsHistory> rightsList) { | ||
| 67 | // 1.权益区分 | ||
| 68 | Map<RightType,Object> tempRightsMap = this.distinguishRight(rightsList); | ||
| 69 | // 2.权益下发 | ||
| 70 | this.refresh(tempRightsMap); | ||
| 71 | // 3.保存权益历史 | ||
| 72 | this.doInsertTrRightHistory(rightsList); | ||
| 73 | } | ||
| 74 | |||
| 75 | /** | ||
| 76 | * 权益发放 | ||
| 77 | * @param tempRightsMap 权益类型 | ||
| 78 | */ | ||
| 79 | @Override | ||
| 80 | public void grantRights(Map<RightType, Object> tempRightsMap) { | ||
| 81 | |||
| 82 | // this.threadPoolTaskExecutor.execute(()-> { | ||
| 83 | // 2.创建权益历史对象 | ||
| 84 | List<RightsHistory> rightsList = this.getRightHistory(tempRightsMap); | ||
| 85 | // 3.保存权益历史 | ||
| 86 | this.doInsertTrRightHistory(rightsList); | ||
| 87 | // }); | ||
| 88 | |||
| 89 | // 1.权益下发 | ||
| 90 | this.refresh(tempRightsMap); | ||
| 91 | } | ||
| 92 | |||
| 93 | /** | ||
| 94 | * | ||
| 95 | * @param tempRightsMap | ||
| 96 | * @return | ||
| 97 | */ | ||
| 98 | private List<RightsHistory> getRightHistory(Map<RightType, Object> tempRightsMap) { | ||
| 99 | List<TempRights> values = (List<TempRights>)tempRightsMap.get(RightType.RIGHTS); | ||
| 100 | List<RightsHistory> rightsHistoryList = new ArrayList<>(); | ||
| 101 | |||
| 102 | values.forEach(value -> { | ||
| 103 | RightsHistory rightsHistory = new RightsHistory(); | ||
| 104 | rightsHistory.setSendTime(LocalDateTime.now()); | ||
| 105 | rightsHistory.setRightsId(value.getId()); | ||
| 106 | rightsHistory.setMemberId(value.getMemberId()); | ||
| 107 | rightsHistory.setExpireTime(value.getExpireTime()); | ||
| 108 | String memberCode = value.getMemberCode(); | ||
| 109 | rightsHistory.setMemberCode(memberCode); | ||
| 110 | rightsHistoryList.add(rightsHistory); | ||
| 111 | }); | ||
| 112 | |||
| 113 | return rightsHistoryList; | ||
| 114 | } | ||
| 115 | |||
| 116 | /** | ||
| 117 | * 成长值发放,基于已获得的权益 | ||
| 118 | * @param tempExpList 权益列表 | ||
| 119 | */ | ||
| 120 | private void grantExp(List<TempExp> tempExpList) { | ||
| 121 | if (!CollectionUtils.isEmpty(tempExpList)) | ||
| 122 | this.expOperationService.grantPointsThroughTempExp(tempExpList); | ||
| 123 | } | ||
| 124 | |||
| 125 | /** | ||
| 126 | * 发放积分,基于已获得的权益 | ||
| 127 | * | ||
| 128 | * @param tempPointsList 权益列表 | ||
| 129 | */ | ||
| 130 | private void grantPoint(List<TempPoints> tempPointsList) { | ||
| 131 | if (!CollectionUtils.isEmpty(tempPointsList)) | ||
| 132 | this.pointsOperationService.grantPointsThroughTempRightsList(tempPointsList); | ||
| 133 | } | ||
| 134 | |||
| 135 | /** | ||
| 136 | * 发放优惠券,基于已获得的权益 | ||
| 137 | * | ||
| 138 | * @param tempCouponList 优惠券 | ||
| 139 | */ | ||
| 140 | private void grantCoupon(List<TempCoupon> tempCouponList) { | ||
| 141 | // 发放优惠券 | ||
| 142 | if (!CollectionUtils.isEmpty(tempCouponList)) | ||
| 143 | this.couponOperationService.grantCouponThroughTempCoupon(tempCouponList); | ||
| 144 | } | ||
| 145 | |||
| 146 | /** | ||
| 147 | * 权益发放 | ||
| 148 | * @param tempRightsMap | ||
| 149 | */ | ||
| 150 | private void refresh(Map<RightType, Object> tempRightsMap) { | ||
| 151 | /*FutureTask<Map<Long,Long>> futureTask1 = new FutureTask(()->{ | ||
| 152 | log.info(Thread.currentThread().getName() + "=========>> start"); | ||
| 153 | // 积分 | ||
| 154 | this.grantPoint((List<TempPoints>) tempRightsMap.get(RightType.POINTS)); | ||
| 155 | log.info(Thread.currentThread().getName() + "=========>>grantPoint end"); | ||
| 156 | // 成长值 | ||
| 157 | // this.grantExp((List<TempExp>) tempRightsMap.get(RightType.EXP)); | ||
| 158 | // 优惠券 | ||
| 159 | // this.grantCoupon((List<TempCoupon>) tempRightsMap.get(RightType.COUPON)); | ||
| 160 | return null; | ||
| 161 | }); | ||
| 162 | FutureTask<Map<Long,Long>> futureTask2 = new FutureTask(()->{ | ||
| 163 | // 积分 | ||
| 164 | // this.grantPoint((List<TempPoints>) tempRightsMap.get(RightType.POINTS)); | ||
| 165 | // 成长值 | ||
| 166 | this.grantExp((List<TempExp>) tempRightsMap.get(RightType.EXP)); | ||
| 167 | // 优惠券 | ||
| 168 | // this.grantCoupon((List<TempCoupon>) tempRightsMap.get(RightType.COUPON)); | ||
| 169 | return null; | ||
| 170 | }); | ||
| 171 | FutureTask<Map<Long,Long>> futureTask3 = new FutureTask(()->{ | ||
| 172 | // 积分 | ||
| 173 | // this.grantPoint((List<TempPoints>) tempRightsMap.get(RightType.POINTS)); | ||
| 174 | // 成长值 | ||
| 175 | // this.grantExp((List<TempExp>) tempRightsMap.get(RightType.EXP)); | ||
| 176 | // 优惠券 | ||
| 177 | this.grantCoupon((List<TempCoupon>) tempRightsMap.get(RightType.COUPON)); | ||
| 178 | return null; | ||
| 179 | }); | ||
| 180 | this.threadPoolTaskExecutor.execute(futureTask1); | ||
| 181 | this.threadPoolTaskExecutor.execute(futureTask2); | ||
| 182 | this.threadPoolTaskExecutor.execute(futureTask3);*/ | ||
| 183 | /*this.threadPoolTaskExecutor.execute(() -> { | ||
| 184 | // 积分 | ||
| 185 | this.grantPoint((List<TempPoints>) tempRightsMap.get(RightType.POINTS)); | ||
| 186 | // 成长值 | ||
| 187 | this.grantExp((List<TempExp>) tempRightsMap.get(RightType.EXP)); | ||
| 188 | // 优惠券 | ||
| 189 | this.grantCoupon((List<TempCoupon>) tempRightsMap.get(RightType.COUPON)); | ||
| 190 | });*/ | ||
| 191 | |||
| 192 | |||
| 193 | /*this.threadPoolTaskExecutor.execute(() -> { | ||
| 194 | log.info(Thread.currentThread().getName() + "=========>> start"); | ||
| 195 | // 积分 | ||
| 196 | this.grantPoint((List<TempPoints>) tempRightsMap.get(RightType.POINTS)); | ||
| 197 | log.info(Thread.currentThread().getName() + "=========>> end"); | ||
| 198 | });*/ | ||
| 199 | |||
| 200 | List<TempPoints> tempPointsList = (List<TempPoints>) tempRightsMap.get(RightType.POINTS); | ||
| 201 | if (!CollectionUtils.isEmpty(tempPointsList)) { | ||
| 202 | // 积分 | ||
| 203 | this.grantPoint(tempPointsList); | ||
| 204 | } | ||
| 205 | |||
| 206 | List<TempExp> tempExpList = (List<TempExp>) tempRightsMap.get(RightType.EXP); | ||
| 207 | if (!CollectionUtils.isEmpty(tempExpList)) { | ||
| 208 | // 成长值 | ||
| 209 | this.grantExp(tempExpList); | ||
| 210 | } | ||
| 211 | |||
| 212 | List<TempCoupon> tempCouponList = (List<TempCoupon>) tempRightsMap.get(RightType.COUPON); | ||
| 213 | if (!CollectionUtils.isEmpty(tempCouponList)) { | ||
| 214 | // 优惠券 | ||
| 215 | this.grantCoupon(tempCouponList); | ||
| 216 | } | ||
| 217 | |||
| 218 | } | ||
| 219 | |||
| 220 | /** | ||
| 221 | * 区分权益 | ||
| 222 | * @param rightsList | ||
| 223 | * @return | ||
| 224 | */ | ||
| 225 | private Map<RightType, Object> distinguishRight(List<RightsHistory> rightsList) { | ||
| 226 | |||
| 227 | Map<RightType,Object> map = new HashMap<>(); | ||
| 228 | |||
| 229 | // 优惠券 | ||
| 230 | List<TempCoupon> tempCouponList = new ArrayList<>(); | ||
| 231 | |||
| 232 | for (RightsHistory right : rightsList) { | ||
| 233 | Long rightId = right.getRightsId(); | ||
| 234 | Long memberId = right.getMemberId(); | ||
| 235 | Long userId = right.getUserId(); | ||
| 236 | // 权益类型 | ||
| 237 | RightsDTO rightsDTO = this.getRights(rightId); | ||
| 238 | // 权益的实体类型 1:积分;2成长值;3优惠券 | ||
| 239 | String type = rightsDTO.getEntityType(); | ||
| 240 | Long expireTime = rightsDTO.getExpireTime(); | ||
| 241 | |||
| 242 | switch (type) { | ||
| 243 | // 优惠券 | ||
| 244 | case "1": | ||
| 245 | Long entityId = rightsDTO.getEntityId(); | ||
| 246 | CouponDTO couponDTO = this.findCouponById(entityId); | ||
| 247 | if (Objects.nonNull(couponDTO)) { | ||
| 248 | TempCoupon tempCoupon = new TempCoupon(); | ||
| 249 | tempCoupon.setId(couponDTO.getId()); | ||
| 250 | tempCoupon.setMemberId(memberId); | ||
| 251 | tempCoupon.setUserId(userId); | ||
| 252 | tempCoupon.setRightsAmount(1); | ||
| 253 | tempCoupon.setRightsSendStrategy(0); | ||
| 254 | tempCoupon.setCode(couponDTO.getCode()); | ||
| 255 | if (Objects.nonNull(expireTime)) | ||
| 256 | tempCoupon.setExpireTime(LocalDateTimeUtil.of(expireTime)); | ||
| 257 | tempCouponList.add(tempCoupon); | ||
| 258 | } | ||
| 259 | break; | ||
| 260 | // 观影券 | ||
| 261 | case "2": | ||
| 262 | break; | ||
| 263 | // 活动参与机会 | ||
| 264 | case "3": | ||
| 265 | break; | ||
| 266 | |||
| 267 | default: | ||
| 268 | break; | ||
| 269 | } | ||
| 270 | } | ||
| 271 | |||
| 272 | // 优惠券 | ||
| 273 | if (!CollectionUtils.isEmpty(tempCouponList)) | ||
| 274 | map.put(RightType.COUPON,tempCouponList); | ||
| 275 | return map; | ||
| 276 | } | ||
| 277 | |||
| 278 | /** | ||
| 279 | * 获取优惠券信息 | ||
| 280 | * @param id | ||
| 281 | * @return | ||
| 282 | */ | ||
| 283 | private CouponDTO findCouponById(Long id) { | ||
| 284 | CouponDTO couponDTO = this.couponService.findById(id); | ||
| 285 | return couponDTO; | ||
| 286 | } | ||
| 287 | |||
| 288 | /** | ||
| 289 | * 权益详情 | ||
| 290 | * @param rightsId | ||
| 291 | * @return | ||
| 292 | */ | ||
| 293 | private RightsDTO getRights(Long rightsId) { | ||
| 294 | RightsDTO rightsDTO = this.rightsService.findById(rightsId); | ||
| 295 | return rightsDTO; | ||
| 296 | } | ||
| 297 | |||
| 298 | |||
| 299 | /** | ||
| 300 | * 添加权益领取记录 | ||
| 301 | * @param rightsHistories | ||
| 302 | */ | ||
| 303 | private void doInsertTrRightHistory(List<RightsHistory> rightsHistories) { | ||
| 304 | if (!CollectionUtils.isEmpty(rightsHistories)) { | ||
| 305 | |||
| 306 | for (RightsHistory rightsHistory : rightsHistories) { | ||
| 307 | Long operatorId = rightsHistory.getOperatorId(); | ||
| 308 | String operatorName = rightsHistory.getOperatorName(); | ||
| 309 | rightsHistory.setSendTime(LocalDateTime.now()); | ||
| 310 | rightsHistory.setOperatorId(Objects.nonNull(operatorId)?operatorId:0); | ||
| 311 | rightsHistory.setOperatorName(!StringUtils.isEmpty(operatorName)?operatorName:"系统发放"); | ||
| 312 | this.rightsHistoryService.create(rightsHistory); | ||
| 313 | } | ||
| 314 | |||
| 315 | } | ||
| 316 | |||
| 317 | } | ||
| 318 | |||
| 319 | } |
| 1 | package com.topdraw.business.process.service.mapper; | ||
| 2 | |||
| 3 | import com.topdraw.base.BaseMapper; | ||
| 4 | import com.topdraw.business.module.user.weixin.collection.domain.UserCollectionDetail; | ||
| 5 | import com.topdraw.business.process.domian.weixin.UserCollectionMq; | ||
| 6 | import org.mapstruct.Mapper; | ||
| 7 | import org.mapstruct.Mapping; | ||
| 8 | import org.mapstruct.Mappings; | ||
| 9 | import org.mapstruct.ReportingPolicy; | ||
| 10 | |||
| 11 | @Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE) | ||
| 12 | public interface CollectionMq2DetailMapper extends BaseMapper<UserCollectionMq, UserCollectionDetail> { | ||
| 13 | @Override | ||
| 14 | @Mappings({ | ||
| 15 | @Mapping(target = "detailImg", source = "images") | ||
| 16 | }) | ||
| 17 | UserCollectionDetail toEntity(UserCollectionMq dto); | ||
| 18 | } |
| 1 | package com.topdraw.mq.consumer; | 1 | package com.topdraw.mq.consumer; |
| 2 | 2 | ||
| 3 | import com.topdraw.config.RabbitMqConfig; | ||
| 4 | import com.topdraw.mq.domain.DataSyncMsg; | ||
| 5 | import com.topdraw.mq.domain.TableOperationMsg; | ||
| 6 | import com.topdraw.resttemplate.RestTemplateClient; | ||
| 7 | import com.topdraw.util.JSONUtil; | ||
| 3 | import lombok.extern.slf4j.Slf4j; | 8 | import lombok.extern.slf4j.Slf4j; |
| 4 | import org.slf4j.Logger; | 9 | import org.slf4j.Logger; |
| 5 | import org.slf4j.LoggerFactory; | 10 | import org.slf4j.LoggerFactory; |
| 11 | import org.springframework.amqp.core.ExchangeTypes; | ||
| 12 | import org.springframework.amqp.rabbit.annotation.*; | ||
| 6 | import org.springframework.beans.factory.annotation.Autowired; | 13 | import org.springframework.beans.factory.annotation.Autowired; |
| 7 | import org.springframework.stereotype.Component; | 14 | import org.springframework.stereotype.Component; |
| 15 | import org.springframework.util.Assert; | ||
| 8 | 16 | ||
| 9 | @Component | 17 | @Component |
| 10 | @Slf4j | 18 | @Slf4j |
| ... | @@ -15,5 +23,37 @@ public class UcEngineEventConsumer { | ... | @@ -15,5 +23,37 @@ public class UcEngineEventConsumer { |
| 15 | @Autowired | 23 | @Autowired |
| 16 | AutoRoute autoUser; | 24 | AutoRoute autoUser; |
| 17 | 25 | ||
| 26 | @Autowired | ||
| 27 | RestTemplateClient restTemplateClient; | ||
| 28 | |||
| 29 | /** | ||
| 30 | * 事件 | ||
| 31 | * @param content | ||
| 32 | * @description 基础数据同步 | ||
| 33 | * @author Hongyan Wang | ||
| 34 | * @date 2021/9/7 11:26 上午 | ||
| 35 | */ | ||
| 36 | @RabbitHandler | ||
| 37 | @RabbitListener(bindings = { | ||
| 38 | @QueueBinding(value = @Queue(value = RabbitMqConfig.UC_ROUTE_KEY_DIRECT_EVENT_BBB), | ||
| 39 | exchange = @Exchange(value = ExchangeTypes.DIRECT)) | ||
| 40 | }, containerFactory = "serviceRabbitListenerContainerFactory") | ||
| 41 | public void ucEventConsumer(String content) { | ||
| 42 | log.info(" receive dataSync msg , content is : {} ", content); | ||
| 43 | TableOperationMsg tableOperationMsg = this.parseContent(content); | ||
| 44 | autoUser.route(tableOperationMsg); | ||
| 45 | log.info("ucEventConsumer ====>>>> end"); | ||
| 46 | } | ||
| 47 | |||
| 48 | /** | ||
| 49 | * 数据解析 | ||
| 50 | * @param content | ||
| 51 | * @return | ||
| 52 | */ | ||
| 53 | private TableOperationMsg parseContent(String content) { | ||
| 54 | TableOperationMsg tableOperationMsg = JSONUtil.parseMsg2Object(content,TableOperationMsg.class); | ||
| 55 | Assert.notNull(tableOperationMsg,"ERROR -->> operationConsumer -->> parseContent -->> 【dataSyncMsg】 not be null !!"); | ||
| 56 | return tableOperationMsg; | ||
| 57 | } | ||
| 18 | 58 | ||
| 19 | } | 59 | } | ... | ... |
| ... | @@ -32,7 +32,7 @@ public class UcGatewayEventConsumer { | ... | @@ -32,7 +32,7 @@ public class UcGatewayEventConsumer { |
| 32 | @RabbitListener(bindings = { | 32 | @RabbitListener(bindings = { |
| 33 | @QueueBinding(value = @Queue(value = RabbitMqConfig.UC_ROUTE_KEY_DIRECT_EVENT_AAA), | 33 | @QueueBinding(value = @Queue(value = RabbitMqConfig.UC_ROUTE_KEY_DIRECT_EVENT_AAA), |
| 34 | exchange = @Exchange(value = ExchangeTypes.DIRECT)) | 34 | exchange = @Exchange(value = ExchangeTypes.DIRECT)) |
| 35 | }, containerFactory = "serviceRabbitListenerContainerFactory") | 35 | }, containerFactory = "managementRabbitListenerContainerFactory") |
| 36 | public void ucEventConsumer(String content) { | 36 | public void ucEventConsumer(String content) { |
| 37 | log.info(" receive dataSync msg , content is : {} ", content); | 37 | log.info(" receive dataSync msg , content is : {} ", content); |
| 38 | DataSyncMsg dataSyncMsg = this.parseContent(content); | 38 | DataSyncMsg dataSyncMsg = this.parseContent(content); | ... | ... |
| ... | @@ -201,15 +201,21 @@ public class WeiXinEventConsumer { | ... | @@ -201,15 +201,21 @@ public class WeiXinEventConsumer { |
| 201 | JSONObject map = jsonObject.getJSONObject("appIdMap"); | 201 | JSONObject map = jsonObject.getJSONObject("appIdMap"); |
| 202 | JSONObject wechatMsg = jsonObject.getJSONObject("allFieldsMap"); | 202 | JSONObject wechatMsg = jsonObject.getJSONObject("allFieldsMap"); |
| 203 | String appid = map.getString("mpId"); | 203 | String appid = map.getString("mpId"); |
| 204 | String unionid = map.getString("unionid"); | ||
| 204 | // Map<String, String> wxInfoMap = WeixinUtil.getWeixinInfoByAppid(appid); | 205 | // Map<String, String> wxInfoMap = WeixinUtil.getWeixinInfoByAppid(appid); |
| 205 | 206 | ||
| 206 | String openid = wechatMsg.getString("FromUserName"); | 207 | String openid = wechatMsg.getString("FromUserName"); |
| 207 | String msgType = wechatMsg.getString("MsgType"); | 208 | String msgType = wechatMsg.getString("MsgType"); |
| 208 | if ("event".equals(msgType)) { | 209 | if ("event".equals(msgType)) { |
| 209 | String event = wechatMsg.getString("Event"); | 210 | String event = wechatMsg.getString("Event"); |
| 211 | log.info("event ===>> [{}]",event); | ||
| 210 | String eventKey = wechatMsg.getString("EventKey"); | 212 | String eventKey = wechatMsg.getString("EventKey"); |
| 211 | 213 | ||
| 212 | SubscribeBean subscribeBean = new SubscribeBean(openid,appid,eventKey); | 214 | SubscribeBean subscribeBean = new SubscribeBean(); |
| 215 | subscribeBean.setAppId(appid); | ||
| 216 | subscribeBean.setOpenId(openid); | ||
| 217 | subscribeBean.setUnionid(unionid); | ||
| 218 | subscribeBean.setEventKey(eventKey); | ||
| 213 | 219 | ||
| 214 | if (event.equals("subscribe")) | 220 | if (event.equals("subscribe")) |
| 215 | this.restTemplateClient.subscribe(subscribeBean); | 221 | this.restTemplateClient.subscribe(subscribeBean); | ... | ... |
| ... | @@ -46,6 +46,7 @@ public class DataSyncMsg implements Serializable { | ... | @@ -46,6 +46,7 @@ public class DataSyncMsg implements Serializable { |
| 46 | private Integer deviceType; //设备类型 1:大屏;2:小屏(微信)3.小屏(xx) | 46 | private Integer deviceType; //设备类型 1:大屏;2:小屏(微信)3.小屏(xx) |
| 47 | @NotNull | 47 | @NotNull |
| 48 | private String appCode; //用户对应的应用code | 48 | private String appCode; //用户对应的应用code |
| 49 | private String memberCode; | ||
| 49 | private Long accountId; // 账号id | 50 | private Long accountId; // 账号id |
| 50 | private Long orderId; | 51 | private Long orderId; |
| 51 | private Long activityId; | 52 | private Long activityId; | ... | ... |
| ... | @@ -15,7 +15,11 @@ public class SubscribeBean { | ... | @@ -15,7 +15,11 @@ public class SubscribeBean { |
| 15 | /** */ | 15 | /** */ |
| 16 | private String appId; | 16 | private String appId; |
| 17 | 17 | ||
| 18 | private String unionid; | ||
| 19 | |||
| 18 | /** */ | 20 | /** */ |
| 19 | private String eventKey; | 21 | private String eventKey; |
| 20 | 22 | ||
| 23 | |||
| 24 | |||
| 21 | } | 25 | } | ... | ... |
| ... | @@ -2,9 +2,7 @@ package com.topdraw.resttemplate; | ... | @@ -2,9 +2,7 @@ package com.topdraw.resttemplate; |
| 2 | 2 | ||
| 3 | import com.alibaba.fastjson.JSON; | 3 | import com.alibaba.fastjson.JSON; |
| 4 | import com.alibaba.fastjson.JSONObject; | 4 | import com.alibaba.fastjson.JSONObject; |
| 5 | import com.topdraw.business.basicdata.member.address.domain.MemberAddress; | 5 | import com.topdraw.business.module.member.address.domain.MemberAddress; |
| 6 | import com.topdraw.business.basicdata.member.domain.Member; | ||
| 7 | import com.topdraw.business.basicdata.member.relatedinfo.domain.MemberRelatedInfo; | ||
| 8 | import com.topdraw.mq.domain.DataSyncMsg; | 6 | import com.topdraw.mq.domain.DataSyncMsg; |
| 9 | import com.topdraw.mq.domain.SubscribeBean; | 7 | import com.topdraw.mq.domain.SubscribeBean; |
| 10 | import lombok.extern.slf4j.Slf4j; | 8 | import lombok.extern.slf4j.Slf4j; |
| ... | @@ -17,7 +15,6 @@ import org.springframework.web.client.RestTemplate; | ... | @@ -17,7 +15,6 @@ import org.springframework.web.client.RestTemplate; |
| 17 | 15 | ||
| 18 | import javax.annotation.PostConstruct; | 16 | import javax.annotation.PostConstruct; |
| 19 | import java.util.HashMap; | 17 | import java.util.HashMap; |
| 20 | import java.util.Map; | ||
| 21 | 18 | ||
| 22 | @Slf4j | 19 | @Slf4j |
| 23 | @Component | 20 | @Component |
| ... | @@ -111,8 +108,9 @@ public class RestTemplateClient { | ... | @@ -111,8 +108,9 @@ public class RestTemplateClient { |
| 111 | String url = BASE_URL + "/ucEngine/api/userOperation/subscribe"; | 108 | String url = BASE_URL + "/ucEngine/api/userOperation/subscribe"; |
| 112 | String content = JSON.toJSONString(subscribeBean); | 109 | String content = JSON.toJSONString(subscribeBean); |
| 113 | 110 | ||
| 114 | HashMap<Object, Object> objectObjectHashMap = new HashMap<>(); | 111 | HashMap<String, String> objectObjectHashMap = new HashMap<>(); |
| 115 | objectObjectHashMap.put("content", content); | 112 | objectObjectHashMap.put("content", content); |
| 113 | log.info("objectObjectHashMap ===>> [{}]",objectObjectHashMap); | ||
| 116 | restTemplate.postForEntity(url, objectObjectHashMap, String.class); | 114 | restTemplate.postForEntity(url, objectObjectHashMap, String.class); |
| 117 | /*ResponseEntity<String> responseEntity = restTemplate.postForEntity(url, subscribeBean, String.class); | 115 | /*ResponseEntity<String> responseEntity = restTemplate.postForEntity(url, subscribeBean, String.class); |
| 118 | String entityBody = ""; | 116 | String entityBody = ""; | ... | ... |
| 1 | package com.topdraw.util; | ||
| 2 | |||
| 3 | public class WeChatConstants { | ||
| 4 | |||
| 5 | public static String HTTPS_AUTHORIZE_WITH_SNSAPI_USERINFO = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=APPID&redirect_uri=REDIRECT_URI&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect"; | ||
| 6 | |||
| 7 | public static final String HTTPS_TOKEN = "https://api.weixin.qq.com/cgi-bin/token"; | ||
| 8 | |||
| 9 | public static final String HTTPS_TICKET_GETTICKET = "https://api.weixin.qq.com/cgi-bin/ticket/getticket"; | ||
| 10 | |||
| 11 | public static final String HTTPS_SNS_OAUTH2_ACCESS_TOKEN = "https://api.weixin.qq.com/sns/oauth2/access_token"; | ||
| 12 | |||
| 13 | public static final String HTTPS_SNS_USERINFO = "https://api.weixin.qq.com/sns/userinfo"; | ||
| 14 | |||
| 15 | public static final String CODE2SESSION = "https://api.weixin.qq.com/sns/jscode2session?appid=APPID&secret=SECRET&js_code=JSCODE&grant_type=authorization_code"; | ||
| 16 | |||
| 17 | /** | ||
| 18 | * 把媒体文件上传到微信服务器。目前仅支持图片。用于发送客服消息或被动回复用户消息。 | ||
| 19 | */ | ||
| 20 | public static String UPLOAD_URL = "https://api.weixin.qq.com/cgi-bin/media/upload?access_token={0}&type=image"; | ||
| 21 | |||
| 22 | /** | ||
| 23 | * 获取客服消息内的临时素材。即下载临时的多媒体文件。 | ||
| 24 | */ | ||
| 25 | public static String GET_MEDIA = "https://api.weixin.qq.com/cgi-bin/media/get?access_token={0}&media_id={1}"; | ||
| 26 | |||
| 27 | /** | ||
| 28 | * 用于向微信服务端申请二维码的url | ||
| 29 | */ | ||
| 30 | public static String URL_QR_CODE = "https://api.weixin.qq.com/wxa/getwxacodeunlimit?access_token={0}"; | ||
| 31 | |||
| 32 | /** | ||
| 33 | * 用于聊天时向用户发送消息的url | ||
| 34 | */ | ||
| 35 | public static String CUSTOM_SEND_URL = "https://api.weixin.qq.com/cgi-bin/message/custom/send?access_token={0}"; | ||
| 36 | |||
| 37 | /** | ||
| 38 | * 发送小程序订阅消息 | ||
| 39 | */ | ||
| 40 | public static final String SUBSCRIBE_SEND_URL = "https://api.weixin.qq.com/cgi-bin/message/subscribe/send?access_token={0}"; | ||
| 41 | |||
| 42 | /** | ||
| 43 | * 生成带参数二维码 | ||
| 44 | */ | ||
| 45 | public static final String QR_CODE_URL = "https://api.weixin.qq.com/cgi-bin/qrcode/create?access_token={0}"; | ||
| 46 | |||
| 47 | /** | ||
| 48 | * 获取用户基本信息 | ||
| 49 | */ | ||
| 50 | public static final String GET_USER_INFO = "https://api.weixin.qq.com/cgi-bin/user/info?access_token={0}&openid={1}&lang=zh_CN"; | ||
| 51 | |||
| 52 | |||
| 53 | // 批量获取关注者列表 | ||
| 54 | public static final String GET_USER_LIST = "https://api.weixin.qq.com/cgi-bin/user/get?access_token={0}&next_openid={1}"; | ||
| 55 | |||
| 56 | /** | ||
| 57 | * 成功 | ||
| 58 | */ | ||
| 59 | public static String SUCCESS = "SUCCESS"; | ||
| 60 | |||
| 61 | /** | ||
| 62 | * 微信系统错误 | ||
| 63 | */ | ||
| 64 | public static String SYSTEMERROR = "SYSTEMERROR"; | ||
| 65 | |||
| 66 | /** | ||
| 67 | * 失败 (注意:微信有的接口返回的失败用FAIL字符串表示,有的接口用FAILED表示) | ||
| 68 | */ | ||
| 69 | public static String FAIL = "FAIL"; | ||
| 70 | |||
| 71 | /** | ||
| 72 | * 微信企业付款到个人失败 (注意:微信有的接口返回的失败用FAIL字符串表示,有的接口用FAILED表示) | ||
| 73 | */ | ||
| 74 | public static String FAILED = "FAILED"; | ||
| 75 | |||
| 76 | public static String ACCESS_TOKEN = "access_token"; | ||
| 77 | |||
| 78 | public static String ERR_CODE = "errcode"; | ||
| 79 | |||
| 80 | /** | ||
| 81 | * 微信请求时,返回ACCESS_TOKEN错误码 | ||
| 82 | */ | ||
| 83 | public static final String ACCESS_TOKEN_INVALID_CODE = "40001"; | ||
| 84 | |||
| 85 | |||
| 86 | /** | ||
| 87 | * 文本消息 | ||
| 88 | */ | ||
| 89 | public static String MSG_TYPE_TEXT = "text"; | ||
| 90 | |||
| 91 | public static String MSG_TYPE_MINIPROGRAMPAGE = "miniprogrampage"; | ||
| 92 | |||
| 93 | public static String MSG_TYPE_LINK = "link"; | ||
| 94 | |||
| 95 | public static String MSG_TYPE_IMAGE = "image"; | ||
| 96 | |||
| 97 | /** | ||
| 98 | * 事件消息 | ||
| 99 | */ | ||
| 100 | public static String MSG_TYPE_EVENT = "event"; | ||
| 101 | |||
| 102 | |||
| 103 | /** | ||
| 104 | * 二维码类型,临时的整型参数值 | ||
| 105 | */ | ||
| 106 | public static String QR_SCENE = "QR_SCENE"; | ||
| 107 | |||
| 108 | /** | ||
| 109 | * 二维码类型,临时的字符串参数值 | ||
| 110 | */ | ||
| 111 | public static String QR_STR_SCENE = "QR_STR_SCENE"; | ||
| 112 | |||
| 113 | /** | ||
| 114 | * 二维码类型,永久的整型参数值 | ||
| 115 | */ | ||
| 116 | public static String QR_LIMIT_SCENE = "QR_LIMIT_SCENE"; | ||
| 117 | |||
| 118 | /** | ||
| 119 | * 二维码类型,永久的字符串参数值 | ||
| 120 | */ | ||
| 121 | public static String QR_LIMIT_STR_SCENE = "QR_LIMIT_STR_SCENE"; | ||
| 122 | |||
| 123 | |||
| 124 | /******** 事件推送事件类型BEGIN********/ | ||
| 125 | |||
| 126 | /** | ||
| 127 | * 取消订阅 | ||
| 128 | */ | ||
| 129 | public static final String EVENT_UNSUBSCRIBE = "unsubscribe"; | ||
| 130 | |||
| 131 | |||
| 132 | /** | ||
| 133 | * 订阅 | ||
| 134 | */ | ||
| 135 | public static final String EVENT_SUBSCRIBE = "subscribe"; | ||
| 136 | |||
| 137 | /** | ||
| 138 | * 扫描带参数二维码事件,用户已关注时的事件推送 | ||
| 139 | */ | ||
| 140 | public static final String EVENT_SCAN = "SCAN"; | ||
| 141 | |||
| 142 | /** | ||
| 143 | * 上报地理位置事件 | ||
| 144 | */ | ||
| 145 | public static final String EVENT_LOCATION = "LOCATION"; | ||
| 146 | |||
| 147 | /** | ||
| 148 | * 自定义菜单事件 | ||
| 149 | */ | ||
| 150 | public static final String EVENT_CLICK = "CLICK"; | ||
| 151 | |||
| 152 | /******** 事件推送事件类型END********/ | ||
| 153 | |||
| 154 | |||
| 155 | /** | ||
| 156 | * 微信ACCESS_TOKEN缓存KEY | ||
| 157 | */ | ||
| 158 | public static final String TOKEN_KEY = "GLOBAL_WX_ACCESS_TOKEN_"; | ||
| 159 | |||
| 160 | |||
| 161 | /** | ||
| 162 | * 微信临时素材缓存KEY | ||
| 163 | */ | ||
| 164 | public static final String WEIXIN_MEDIA_KEY = "WEIXIN_MEDIA_KEY_"; | ||
| 165 | |||
| 166 | // 微信应用类型 小程序 服务号 订阅号 | ||
| 167 | // 小程序 | ||
| 168 | public static final String WX_APPLET = "applet"; | ||
| 169 | // 服务号 | ||
| 170 | public static final String WX_SERVICE = "service"; | ||
| 171 | // 订阅号 | ||
| 172 | public static final String WX_SUBSCRIPTION = "subscription"; | ||
| 173 | |||
| 174 | |||
| 175 | } |
| ... | @@ -2,11 +2,11 @@ spring: | ... | @@ -2,11 +2,11 @@ spring: |
| 2 | # 数据源 | 2 | # 数据源 |
| 3 | datasource: | 3 | datasource: |
| 4 | # 数据源地址 | 4 | # 数据源地址 |
| 5 | url: jdbc:log4jdbc:mysql://122.112.214.149:3306/tj_user?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false | 5 | url: jdbc:log4jdbc:mysql://139.196.192.242:3306/tj_user_0819?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false |
| 6 | # 用户名 | 6 | # 用户名 |
| 7 | username: root | 7 | username: root |
| 8 | # 密码 | 8 | # 密码 |
| 9 | password: root | 9 | password: Tjlh@2017 |
| 10 | # 驱动程序 | 10 | # 驱动程序 |
| 11 | driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy | 11 | driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy |
| 12 | # Druid | 12 | # Druid |
| ... | @@ -68,15 +68,12 @@ spring: | ... | @@ -68,15 +68,12 @@ spring: |
| 68 | 68 | ||
| 69 | # redis | 69 | # redis |
| 70 | redis: | 70 | redis: |
| 71 | # 数据库索引 | 71 | #数据库索引 |
| 72 | database: 0 | 72 | database: 0 |
| 73 | # ip | ||
| 74 | host: 122.112.214.149 | 73 | host: 122.112.214.149 |
| 75 | # 密码是 | ||
| 76 | password: redis123 | ||
| 77 | # 端口 | ||
| 78 | port: 6379 | 74 | port: 6379 |
| 79 | # 连接超时时间 | 75 | password: redis123 |
| 76 | #连接超时时间 | ||
| 80 | timeout: 5000 | 77 | timeout: 5000 |
| 81 | 78 | ||
| 82 | # rabbitmq | 79 | # rabbitmq |
| ... | @@ -108,16 +105,22 @@ swagger: | ... | @@ -108,16 +105,22 @@ swagger: |
| 108 | mutil-mq: | 105 | mutil-mq: |
| 109 | # 服务侧 | 106 | # 服务侧 |
| 110 | service: | 107 | service: |
| 111 | # ip | 108 | # # ip |
| 112 | host: 139.196.192.242 | 109 | # host: 139.196.192.242 |
| 113 | # 端口 | 110 | # # 端口 |
| 114 | port: 5672 | 111 | # port: 5672 |
| 115 | # 用户名 | 112 | # # 用户名 |
| 116 | username: member_center | 113 | # username: member_center |
| 117 | # 密码 | 114 | # # 密码 |
| 118 | password: Tjlh@2021 | 115 | # password: Tjlh@2021 |
| 119 | # 虚拟空间 | 116 | # # 虚拟空间 |
| 120 | virtual-host: /member_center | 117 | # virtual-host: /member_center |
| 118 | host: 122.112.214.149 # rabbitmq的连接地址 | ||
| 119 | port: 5672 # rabbitmq的连接端口号 | ||
| 120 | virtual-host: member_center # rabbitmq的虚拟hosthhh | ||
| 121 | username: guest # rabbitmq的用户名 | ||
| 122 | password: guest # rabbitmq的密码 | ||
| 123 | publisher-confirms: true #如果对异步消息需要回调必须设置为true | ||
| 121 | 124 | ||
| 122 | # 管理侧 | 125 | # 管理侧 |
| 123 | management: | 126 | management: |
| ... | @@ -140,7 +143,7 @@ mutil-mq: | ... | @@ -140,7 +143,7 @@ mutil-mq: |
| 140 | # 密码 | 143 | # 密码 |
| 141 | password: Topdraw1qaz | 144 | password: Topdraw1qaz |
| 142 | # 虚拟空间 | 145 | # 虚拟空间 |
| 143 | virtual-host: /member_center | 146 | virtual-host: member_center |
| 144 | 147 | ||
| 145 | #登录图形验证码有效时间/分钟 | 148 | #登录图形验证码有效时间/分钟 |
| 146 | loginCode: | 149 | loginCode: | ... | ... |
-
Please register or sign in to post a comment