Merge branch '2.2.0-release'
Showing
156 changed files
with
1357 additions
and
768 deletions
... | @@ -15,22 +15,16 @@ | ... | @@ -15,22 +15,16 @@ |
15 | <maven.compiler.source>8</maven.compiler.source> | 15 | <maven.compiler.source>8</maven.compiler.source> |
16 | <maven.compiler.target>8</maven.compiler.target> | 16 | <maven.compiler.target>8</maven.compiler.target> |
17 | <jjwt.version>0.9.1</jjwt.version> | 17 | <jjwt.version>0.9.1</jjwt.version> |
18 | <cronos.version>1.1.0</cronos.version> | 18 | <cronos.version>1.2.0</cronos.version> |
19 | </properties> | 19 | </properties> |
20 | 20 | ||
21 | 21 | ||
22 | <dependencies> | 22 | <dependencies> |
23 | 23 | ||
24 | <!--<dependency> | ||
25 | <groupId>com.topdraw</groupId> | ||
26 | <artifactId>cronos-system</artifactId> | ||
27 | <version>${cronos.version}</version> | ||
28 | </dependency>--> | ||
29 | |||
30 | <dependency> | 24 | <dependency> |
31 | <groupId>com.topdraw</groupId> | 25 | <groupId>com.topdraw</groupId> |
32 | <artifactId>code-generator</artifactId> | 26 | <artifactId>core-service</artifactId> |
33 | <version>3.1.0</version> | 27 | <version>1.0.0</version> |
34 | </dependency> | 28 | </dependency> |
35 | 29 | ||
36 | <dependency> | 30 | <dependency> | ... | ... |
1 | package com.topdraw; | 1 | package com.topdraw; |
2 | 2 | ||
3 | 3 | ||
4 | import com.topdraw.utils.SpringContextHolder; | 4 | import com.topdraw.base.modules.utils.SpringContextHolder; |
5 | import org.springframework.boot.SpringApplication; | 5 | import org.springframework.boot.SpringApplication; |
6 | import org.springframework.boot.autoconfigure.SpringBootApplication; | 6 | import org.springframework.boot.autoconfigure.SpringBootApplication; |
7 | import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration; | 7 | import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration; | ... | ... |
... | @@ -49,11 +49,13 @@ public interface RedisKeyConstants { | ... | @@ -49,11 +49,13 @@ public interface RedisKeyConstants { |
49 | // 历史完成的任务数量 | 49 | // 历史完成的任务数量 |
50 | String cacheTotalFinishTaskCount = "uce::totalCount::memberId"; | 50 | String cacheTotalFinishTaskCount = "uce::totalCount::memberId"; |
51 | 51 | ||
52 | 52 | // app账号信息 | |
53 | String cacheAppById = "uce:appInfo:id"; | ||
53 | 54 | ||
54 | String CACHE_PLATFROMACCOUNT_PLAYDURATION = "uce::eventPlay::playduration"; | 55 | String CACHE_PLATFROMACCOUNT_PLAYDURATION = "uce::eventPlay::playduration"; |
55 | 56 | ||
56 | 57 | ||
57 | String CACHE_TODAY_FINISH_COUNT = "todayFinishCount"; | 58 | String CACHE_TODAY_FINISH_COUNT = "todayFinishCount"; |
58 | String CACHE_TOTAL_FINISH_COUNT = "totalFinishCount"; | 59 | String CACHE_TOTAL_FINISH_COUNT = "totalFinishCount"; |
60 | |||
59 | } | 61 | } | ... | ... |
member-service-impl/src/main/java/com/topdraw/business/module/contact/domain/MemberContacts.java
0 → 100644
1 | package com.topdraw.business.module.contact.domain; | ||
2 | |||
3 | import com.topdraw.business.module.common.validated.CreateGroup; | ||
4 | import lombok.Data; | ||
5 | import lombok.experimental.Accessors; | ||
6 | import cn.hutool.core.bean.BeanUtil; | ||
7 | import cn.hutool.core.bean.copier.CopyOptions; | ||
8 | import javax.persistence.*; | ||
9 | import javax.validation.constraints.NotEmpty; | ||
10 | import javax.validation.constraints.NotNull; | ||
11 | |||
12 | import org.springframework.data.annotation.CreatedDate; | ||
13 | import org.springframework.data.annotation.LastModifiedDate; | ||
14 | import org.springframework.data.jpa.domain.support.AuditingEntityListener; | ||
15 | import java.sql.Timestamp; | ||
16 | |||
17 | import java.io.Serializable; | ||
18 | |||
19 | /** | ||
20 | * @author XiangHan | ||
21 | * @date 2022-09-01 | ||
22 | */ | ||
23 | @Entity | ||
24 | @Data | ||
25 | @EntityListeners(AuditingEntityListener.class) | ||
26 | @Accessors(chain = true) | ||
27 | @Table(name="uc_member_contacts") | ||
28 | public class MemberContacts implements Serializable { | ||
29 | |||
30 | // 主键 | ||
31 | @Id | ||
32 | @GeneratedValue(strategy = GenerationType.IDENTITY) | ||
33 | @Column(name = "id") | ||
34 | private Long id; | ||
35 | |||
36 | // 会员id | ||
37 | @Column(name = "member_id", nullable = false) | ||
38 | @NotNull(groups = CreateGroup.class, message = "会员id不的为空") | ||
39 | private Long memberId; | ||
40 | |||
41 | // 用户id | ||
42 | @Column(name = "user_id") | ||
43 | private Long userId; | ||
44 | |||
45 | // 实体id | ||
46 | @Column(name = "entity_id") | ||
47 | private Long entityId; | ||
48 | |||
49 | // 实体类型 1:订单;2:商品;3:活动;99:其他 | ||
50 | @Column(name = "entity_type") | ||
51 | private Long entityType; | ||
52 | |||
53 | // 实体code | ||
54 | @Column(name = "entity_code") | ||
55 | private String entityCode; | ||
56 | |||
57 | // 设备类型 1:大屏;2:微信;3:app;99:其他 | ||
58 | @Column(name = "device_type") | ||
59 | @NotNull(groups = CreateGroup.class, message = "设备类型不的为空") | ||
60 | private Long deviceType; | ||
61 | |||
62 | // 姓名 | ||
63 | @Column(name = "realname") | ||
64 | @NotNull(groups = CreateGroup.class, message = "姓名不的为空") | ||
65 | @NotEmpty(groups = CreateGroup.class, message = "姓名不的为空") | ||
66 | private String realname; | ||
67 | |||
68 | // 生日 | ||
69 | @Column(name = "birthday") | ||
70 | private String birthday; | ||
71 | |||
72 | // 手机号 | ||
73 | @Column(name = "phone") | ||
74 | @NotNull(groups = CreateGroup.class, message = "手机号不的为空") | ||
75 | private String phone; | ||
76 | |||
77 | // 创建时间 | ||
78 | @CreatedDate | ||
79 | @Column(name = "create_time") | ||
80 | private Timestamp createTime; | ||
81 | |||
82 | // 更新时间 | ||
83 | @LastModifiedDate | ||
84 | @Column(name = "update_time") | ||
85 | private Timestamp updateTime; | ||
86 | |||
87 | public void copy(MemberContacts source){ | ||
88 | BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true)); | ||
89 | } | ||
90 | } |
1 | package com.topdraw.business.module.contact.repository; | ||
2 | |||
3 | import com.topdraw.business.module.contact.domain.MemberContacts; | ||
4 | import org.springframework.data.jpa.repository.JpaRepository; | ||
5 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; | ||
6 | |||
7 | import java.util.Optional; | ||
8 | |||
9 | /** | ||
10 | * @author XiangHan | ||
11 | * @date 2022-09-01 | ||
12 | */ | ||
13 | public interface MemberContactsRepository extends JpaRepository<MemberContacts, Long>, JpaSpecificationExecutor<MemberContacts> { | ||
14 | |||
15 | } |
1 | package com.topdraw.business.module.contact.rest; | ||
2 | |||
3 | import com.topdraw.common.ResultInfo; | ||
4 | import com.topdraw.business.module.contact.domain.MemberContacts; | ||
5 | import com.topdraw.business.module.contact.service.MemberContactsService; | ||
6 | import org.springframework.beans.factory.annotation.Autowired; | ||
7 | import org.springframework.validation.annotation.Validated; | ||
8 | import org.springframework.web.bind.annotation.*; | ||
9 | import io.swagger.annotations.*; | ||
10 | |||
11 | /** | ||
12 | * @author XiangHan | ||
13 | * @date 2022-09-01 | ||
14 | */ | ||
15 | @Api(tags = "MemberContacts管理") | ||
16 | @RestController | ||
17 | @RequestMapping("/api/MemberContacts") | ||
18 | public class MemberContactsController { | ||
19 | |||
20 | @Autowired | ||
21 | private MemberContactsService MemberContactsService; | ||
22 | |||
23 | @PostMapping | ||
24 | @ApiOperation("新增MemberContacts") | ||
25 | public ResultInfo create(@Validated @RequestBody MemberContacts resources) { | ||
26 | MemberContactsService.create(resources); | ||
27 | return ResultInfo.success(); | ||
28 | } | ||
29 | |||
30 | } |
1 | package com.topdraw.business.module.contact.service; | ||
2 | |||
3 | import com.topdraw.business.module.contact.domain.MemberContacts; | ||
4 | import com.topdraw.business.module.contact.service.dto.MemberContactsDTO; | ||
5 | |||
6 | /** | ||
7 | * @author XiangHan | ||
8 | * @date 2022-09-01 | ||
9 | */ | ||
10 | public interface MemberContactsService { | ||
11 | |||
12 | /** | ||
13 | * 根据ID查询 | ||
14 | * @param id ID | ||
15 | * @return MemberContactsDTO | ||
16 | */ | ||
17 | MemberContactsDTO findById(Long id); | ||
18 | |||
19 | MemberContacts create(MemberContacts resources); | ||
20 | |||
21 | } |
1 | package com.topdraw.business.module.contact.service.dto; | ||
2 | |||
3 | import lombok.Data; | ||
4 | import java.sql.Timestamp; | ||
5 | import java.io.Serializable; | ||
6 | |||
7 | |||
8 | /** | ||
9 | * @author XiangHan | ||
10 | * @date 2022-09-01 | ||
11 | */ | ||
12 | @Data | ||
13 | public class MemberContactsDTO implements Serializable { | ||
14 | |||
15 | // 主键 | ||
16 | private Long id; | ||
17 | |||
18 | // 会员id | ||
19 | private Long memberId; | ||
20 | |||
21 | // 用户id | ||
22 | private Long userId; | ||
23 | |||
24 | // 实体id | ||
25 | private Long entityId; | ||
26 | |||
27 | // 实体类型 1:订单;2:商品;3:活动;99:其他 | ||
28 | private Long entityType; | ||
29 | |||
30 | // 实体code | ||
31 | private String entityCode; | ||
32 | |||
33 | // 设备类型 1:大屏;2:微信;3:app;99:其他 | ||
34 | private Long deviceType; | ||
35 | |||
36 | // 姓名 | ||
37 | private String realname; | ||
38 | |||
39 | // 生日 | ||
40 | private String birthday; | ||
41 | |||
42 | // 手机号 | ||
43 | private String phone; | ||
44 | |||
45 | // 创建时间 | ||
46 | private Timestamp createTime; | ||
47 | |||
48 | // 更新时间 | ||
49 | private Timestamp updateTime; | ||
50 | } |
1 | package com.topdraw.business.module.contact.service.impl; | ||
2 | |||
3 | import com.topdraw.base.modules.utils.ValidationUtil; | ||
4 | import com.topdraw.business.module.contact.domain.MemberContacts; | ||
5 | import com.topdraw.business.module.contact.repository.MemberContactsRepository; | ||
6 | import com.topdraw.business.module.contact.service.MemberContactsService; | ||
7 | import com.topdraw.business.module.contact.service.dto.MemberContactsDTO; | ||
8 | import com.topdraw.business.module.contact.service.mapper.MemberContactsMapper; | ||
9 | import org.springframework.beans.factory.annotation.Autowired; | ||
10 | import org.springframework.stereotype.Service; | ||
11 | import org.springframework.transaction.annotation.Propagation; | ||
12 | import org.springframework.transaction.annotation.Transactional; | ||
13 | |||
14 | /** | ||
15 | * @author XiangHan | ||
16 | * @date 2022-09-01 | ||
17 | */ | ||
18 | @Service | ||
19 | @Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class) | ||
20 | public class MemberContactsServiceImpl implements MemberContactsService { | ||
21 | |||
22 | @Autowired | ||
23 | private MemberContactsRepository MemberContactsRepository; | ||
24 | |||
25 | @Autowired | ||
26 | private MemberContactsMapper MemberContactsMapper; | ||
27 | |||
28 | @Override | ||
29 | public MemberContactsDTO findById(Long id) { | ||
30 | MemberContacts MemberContacts = MemberContactsRepository.findById(id).orElseGet(MemberContacts::new); | ||
31 | ValidationUtil.isNull(MemberContacts.getId(),"MemberContacts","id",id); | ||
32 | return MemberContactsMapper.toDto(MemberContacts); | ||
33 | } | ||
34 | |||
35 | @Override | ||
36 | @Transactional(rollbackFor = Exception.class) | ||
37 | public MemberContacts create(MemberContacts resources) { | ||
38 | return MemberContactsRepository.save(resources); | ||
39 | } | ||
40 | |||
41 | } |
1 | package com.topdraw.business.module.contact.service.mapper; | ||
2 | |||
3 | import com.topdraw.base.modules.base.BaseMapper; | ||
4 | import com.topdraw.business.module.contact.domain.MemberContacts; | ||
5 | import com.topdraw.business.module.contact.service.dto.MemberContactsDTO; | ||
6 | import org.mapstruct.Mapper; | ||
7 | import org.mapstruct.ReportingPolicy; | ||
8 | |||
9 | /** | ||
10 | * @author XiangHan | ||
11 | * @date 2022-09-01 | ||
12 | */ | ||
13 | @Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE) | ||
14 | public interface MemberContactsMapper extends BaseMapper<MemberContactsDTO, MemberContacts> { | ||
15 | |||
16 | } |
1 | package com.topdraw.business.module.contact.vis.rest; | 1 | package com.topdraw.business.module.contact.vis.rest; |
2 | 2 | ||
3 | import com.topdraw.annotation.AnonymousAccess; | 3 | import com.topdraw.base.modules.annotation.AnonymousAccess; |
4 | import com.topdraw.base.modules.common.ResultInfo; | ||
5 | import com.topdraw.base.modules.exception.BadRequestException; | ||
4 | import com.topdraw.business.module.contact.vis.service.dto.ActivityAddressDTO; | 6 | import com.topdraw.business.module.contact.vis.service.dto.ActivityAddressDTO; |
5 | import com.topdraw.common.ResultInfo; | ||
6 | import com.topdraw.business.module.contact.vis.domain.ActivityAddress; | 7 | import com.topdraw.business.module.contact.vis.domain.ActivityAddress; |
7 | import com.topdraw.business.module.contact.vis.service.ActivityAddressService; | 8 | import com.topdraw.business.module.contact.vis.service.ActivityAddressService; |
8 | import com.topdraw.exception.BadRequestException; | ||
9 | import lombok.extern.slf4j.Slf4j; | 9 | import lombok.extern.slf4j.Slf4j; |
10 | import org.apache.commons.lang3.StringUtils; | 10 | import org.apache.commons.lang3.StringUtils; |
11 | import org.springframework.beans.factory.annotation.Autowired; | 11 | import org.springframework.beans.factory.annotation.Autowired; |
12 | import org.springframework.util.Assert; | ||
13 | import org.springframework.validation.annotation.Validated; | 12 | import org.springframework.validation.annotation.Validated; |
14 | import org.springframework.web.bind.annotation.*; | 13 | import org.springframework.web.bind.annotation.*; |
15 | import io.swagger.annotations.*; | 14 | import io.swagger.annotations.*; | ... | ... |
1 | package com.topdraw.business.module.contact.vis.service.impl; | 1 | package com.topdraw.business.module.contact.vis.service.impl; |
2 | 2 | ||
3 | import com.topdraw.base.modules.utils.ValidationUtil; | ||
3 | import com.topdraw.business.module.contact.vis.domain.ActivityAddress; | 4 | import com.topdraw.business.module.contact.vis.domain.ActivityAddress; |
4 | import com.topdraw.util.TimestampUtil; | 5 | import com.topdraw.util.TimestampUtil; |
5 | import com.topdraw.utils.ValidationUtil; | ||
6 | import com.topdraw.business.module.contact.vis.repository.ActivityAddressRepository; | 6 | import com.topdraw.business.module.contact.vis.repository.ActivityAddressRepository; |
7 | import com.topdraw.business.module.contact.vis.service.ActivityAddressService; | 7 | import com.topdraw.business.module.contact.vis.service.ActivityAddressService; |
8 | import com.topdraw.business.module.contact.vis.service.dto.ActivityAddressDTO; | 8 | import com.topdraw.business.module.contact.vis.service.dto.ActivityAddressDTO; |
9 | import com.topdraw.business.module.contact.vis.service.mapper.ActivityAddressMapper; | 9 | import com.topdraw.business.module.contact.vis.service.mapper.ActivityAddressMapper; |
10 | import org.springframework.beans.factory.annotation.Autowired; | 10 | import org.springframework.beans.factory.annotation.Autowired; |
11 | import org.springframework.cache.annotation.CachePut; | ||
12 | import org.springframework.cache.annotation.Cacheable; | ||
13 | import org.springframework.stereotype.Service; | 11 | import org.springframework.stereotype.Service; |
14 | import org.springframework.transaction.annotation.Propagation; | 12 | import org.springframework.transaction.annotation.Propagation; |
15 | import org.springframework.transaction.annotation.Transactional; | 13 | import org.springframework.transaction.annotation.Transactional; | ... | ... |
1 | package com.topdraw.business.module.contact.vis.service.mapper; | 1 | package com.topdraw.business.module.contact.vis.service.mapper; |
2 | 2 | ||
3 | import com.topdraw.base.BaseMapper; | 3 | import com.topdraw.base.modules.base.BaseMapper; |
4 | import com.topdraw.business.module.contact.vis.domain.ActivityAddress; | 4 | import com.topdraw.business.module.contact.vis.domain.ActivityAddress; |
5 | import com.topdraw.business.module.contact.vis.service.dto.ActivityAddressDTO; | 5 | import com.topdraw.business.module.contact.vis.service.dto.ActivityAddressDTO; |
6 | import org.mapstruct.Mapper; | 6 | import org.mapstruct.Mapper; | ... | ... |
1 | package com.topdraw.business.module.coupon.history.service.impl; | 1 | package com.topdraw.business.module.coupon.history.service.impl; |
2 | 2 | ||
3 | import com.topdraw.base.modules.utils.ValidationUtil; | ||
3 | import com.topdraw.business.module.coupon.history.domain.CouponHistory; | 4 | import com.topdraw.business.module.coupon.history.domain.CouponHistory; |
4 | import com.topdraw.business.module.coupon.history.domain.CouponHistoryBuilder; | 5 | import com.topdraw.business.module.coupon.history.domain.CouponHistoryBuilder; |
5 | import com.topdraw.util.LocalDateTimeUtil; | 6 | import com.topdraw.util.LocalDateTimeUtil; |
6 | import com.topdraw.utils.ValidationUtil; | ||
7 | import com.topdraw.business.module.coupon.history.repository.CouponHistoryRepository; | 7 | import com.topdraw.business.module.coupon.history.repository.CouponHistoryRepository; |
8 | import com.topdraw.business.module.coupon.history.service.CouponHistoryService; | 8 | import com.topdraw.business.module.coupon.history.service.CouponHistoryService; |
9 | import com.topdraw.business.module.coupon.history.service.dto.CouponHistoryDTO; | 9 | import com.topdraw.business.module.coupon.history.service.dto.CouponHistoryDTO; |
... | @@ -13,11 +13,7 @@ import org.springframework.stereotype.Service; | ... | @@ -13,11 +13,7 @@ import org.springframework.stereotype.Service; |
13 | import org.springframework.transaction.annotation.Propagation; | 13 | import org.springframework.transaction.annotation.Propagation; |
14 | import org.springframework.transaction.annotation.Transactional; | 14 | import org.springframework.transaction.annotation.Transactional; |
15 | 15 | ||
16 | import java.sql.Date; | ||
17 | import java.time.LocalDate; | ||
18 | import java.time.LocalDateTime; | 16 | import java.time.LocalDateTime; |
19 | import java.time.ZoneId; | ||
20 | import java.time.ZonedDateTime; | ||
21 | 17 | ||
22 | /** | 18 | /** |
23 | * @author XiangHan | 19 | * @author XiangHan | ... | ... |
1 | package com.topdraw.business.module.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.modules.base.BaseMapper; |
4 | import com.topdraw.business.module.coupon.history.domain.CouponHistory; | 4 | import com.topdraw.business.module.coupon.history.domain.CouponHistory; |
5 | import com.topdraw.business.module.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,13 +7,13 @@ import com.topdraw.business.module.coupon.repository.CouponRepository; | ... | @@ -7,13 +7,13 @@ import com.topdraw.business.module.coupon.repository.CouponRepository; |
7 | import com.topdraw.business.module.coupon.service.CouponService; | 7 | import com.topdraw.business.module.coupon.service.CouponService; |
8 | import com.topdraw.business.module.coupon.service.dto.CouponDTO; | 8 | import com.topdraw.business.module.coupon.service.dto.CouponDTO; |
9 | import com.topdraw.business.module.coupon.service.mapper.CouponMapper; | 9 | import com.topdraw.business.module.coupon.service.mapper.CouponMapper; |
10 | import org.apache.commons.lang3.StringUtils; | ||
10 | import org.springframework.beans.factory.annotation.Autowired; | 11 | import org.springframework.beans.factory.annotation.Autowired; |
11 | import org.springframework.cache.annotation.Cacheable; | 12 | import org.springframework.cache.annotation.Cacheable; |
12 | import org.springframework.stereotype.Service; | 13 | import org.springframework.stereotype.Service; |
13 | import org.springframework.transaction.annotation.Propagation; | 14 | import org.springframework.transaction.annotation.Propagation; |
14 | import org.springframework.transaction.annotation.Transactional; | 15 | import org.springframework.transaction.annotation.Transactional; |
15 | import org.springframework.util.Assert; | 16 | import org.springframework.util.Assert; |
16 | import com.topdraw.utils.StringUtils; | ||
17 | 17 | ||
18 | 18 | ||
19 | /** | 19 | /** | ... | ... |
1 | package com.topdraw.business.module.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.modules.base.BaseMapper; |
4 | import com.topdraw.business.module.coupon.domain.Coupon; | 4 | import com.topdraw.business.module.coupon.domain.Coupon; |
5 | import com.topdraw.business.module.coupon.service.dto.CouponDTO; | 5 | import com.topdraw.business.module.coupon.service.dto.CouponDTO; |
6 | import org.mapstruct.Mapper; | 6 | import org.mapstruct.Mapper; | ... | ... |
1 | package com.topdraw.business.module.exp.detail.service.impl; | 1 | package com.topdraw.business.module.exp.detail.service.impl; |
2 | 2 | ||
3 | import com.topdraw.base.modules.utils.RedisUtils; | ||
4 | import com.topdraw.base.modules.utils.ValidationUtil; | ||
3 | import com.topdraw.business.module.exp.detail.domain.ExpDetail; | 5 | import com.topdraw.business.module.exp.detail.domain.ExpDetail; |
4 | import com.topdraw.business.module.exp.detail.domain.ExpDetailBuilder; | 6 | import com.topdraw.business.module.exp.detail.domain.ExpDetailBuilder; |
5 | import com.topdraw.utils.RedisUtils; | ||
6 | import com.topdraw.utils.ValidationUtil; | ||
7 | import com.topdraw.business.module.exp.detail.repository.ExpDetailRepository; | 7 | import com.topdraw.business.module.exp.detail.repository.ExpDetailRepository; |
8 | import com.topdraw.business.module.exp.detail.service.ExpDetailService; | 8 | import com.topdraw.business.module.exp.detail.service.ExpDetailService; |
9 | import com.topdraw.business.module.exp.detail.service.dto.ExpDetailDTO; | 9 | import com.topdraw.business.module.exp.detail.service.dto.ExpDetailDTO; |
10 | import com.topdraw.business.module.exp.detail.service.mapper.ExpDetailMapper; | 10 | import com.topdraw.business.module.exp.detail.service.mapper.ExpDetailMapper; |
11 | import org.apache.commons.lang3.StringUtils; | ||
11 | import org.springframework.beans.factory.annotation.Autowired; | 12 | import org.springframework.beans.factory.annotation.Autowired; |
12 | import org.springframework.stereotype.Service; | 13 | import org.springframework.stereotype.Service; |
13 | import org.springframework.transaction.annotation.Propagation; | 14 | import org.springframework.transaction.annotation.Propagation; |
14 | import org.springframework.transaction.annotation.Transactional; | 15 | import org.springframework.transaction.annotation.Transactional; |
15 | import org.springframework.dao.EmptyResultDataAccessException; | 16 | import org.springframework.dao.EmptyResultDataAccessException; |
16 | import org.springframework.util.Assert; | 17 | import org.springframework.util.Assert; |
17 | import com.topdraw.utils.StringUtils; | ||
18 | 18 | ||
19 | 19 | ||
20 | /** | 20 | /** | ... | ... |
1 | package com.topdraw.business.module.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.modules.base.BaseMapper; |
4 | import com.topdraw.business.module.exp.detail.domain.ExpDetail; | 4 | import com.topdraw.business.module.exp.detail.domain.ExpDetail; |
5 | import com.topdraw.business.module.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; | ... | ... |
1 | package com.topdraw.business.module.exp.history.service.impl; | 1 | package com.topdraw.business.module.exp.history.service.impl; |
2 | 2 | ||
3 | import com.topdraw.base.modules.utils.ValidationUtil; | ||
3 | import com.topdraw.business.module.exp.history.domain.ExpHistory; | 4 | import com.topdraw.business.module.exp.history.domain.ExpHistory; |
4 | import com.topdraw.utils.ValidationUtil; | ||
5 | import com.topdraw.business.module.exp.history.repository.ExpHistoryRepository; | 5 | import com.topdraw.business.module.exp.history.repository.ExpHistoryRepository; |
6 | import com.topdraw.business.module.exp.history.service.ExpHistoryService; | 6 | import com.topdraw.business.module.exp.history.service.ExpHistoryService; |
7 | import com.topdraw.business.module.exp.history.service.dto.ExpHistoryDTO; | 7 | import com.topdraw.business.module.exp.history.service.dto.ExpHistoryDTO; |
8 | import com.topdraw.business.module.exp.history.service.mapper.ExpHistoryMapper; | 8 | import com.topdraw.business.module.exp.history.service.mapper.ExpHistoryMapper; |
9 | import org.apache.commons.lang3.StringUtils; | ||
9 | import org.springframework.beans.factory.annotation.Autowired; | 10 | import org.springframework.beans.factory.annotation.Autowired; |
10 | import org.springframework.stereotype.Service; | 11 | import org.springframework.stereotype.Service; |
11 | import org.springframework.transaction.annotation.Propagation; | 12 | import org.springframework.transaction.annotation.Propagation; |
12 | import org.springframework.transaction.annotation.Transactional; | 13 | import org.springframework.transaction.annotation.Transactional; |
13 | import com.topdraw.utils.StringUtils; | ||
14 | 14 | ||
15 | 15 | ||
16 | /** | 16 | /** | ... | ... |
1 | package com.topdraw.business.module.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.modules.base.BaseMapper; |
4 | import com.topdraw.business.module.exp.history.domain.ExpHistory; | 4 | import com.topdraw.business.module.exp.history.domain.ExpHistory; |
5 | import com.topdraw.business.module.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; | ... | ... |
1 | package com.topdraw.business.module.member.address.rest; | 1 | package com.topdraw.business.module.member.address.rest; |
2 | 2 | ||
3 | import com.topdraw.annotation.AnonymousAccess; | 3 | import com.topdraw.base.modules.annotation.AnonymousAccess; |
4 | import com.topdraw.base.modules.common.ResultInfo; | ||
4 | import com.topdraw.business.module.common.validated.CreateGroup; | 5 | import com.topdraw.business.module.common.validated.CreateGroup; |
5 | import com.topdraw.business.module.common.validated.UpdateGroup; | 6 | import com.topdraw.business.module.common.validated.UpdateGroup; |
6 | import com.topdraw.business.module.member.address.service.dto.BasicMemberAddressDTO; | 7 | import com.topdraw.business.module.member.address.service.dto.BasicMemberAddressDTO; |
7 | import com.topdraw.business.module.member.address.service.dto.MemberAddressDTO; | ||
8 | import com.topdraw.business.process.service.member.MemberAddressOperationService; | 8 | import com.topdraw.business.process.service.member.MemberAddressOperationService; |
9 | import com.topdraw.common.ResultInfo; | ||
10 | import com.topdraw.business.module.member.address.domain.MemberAddress; | 9 | import com.topdraw.business.module.member.address.domain.MemberAddress; |
11 | import lombok.extern.slf4j.Slf4j; | 10 | import lombok.extern.slf4j.Slf4j; |
12 | import org.springframework.beans.factory.annotation.Autowired; | 11 | import org.springframework.beans.factory.annotation.Autowired; | ... | ... |
1 | package com.topdraw.business.module.member.address.service.impl; | 1 | package com.topdraw.business.module.member.address.service.impl; |
2 | 2 | ||
3 | import com.topdraw.base.modules.utils.RedisUtils; | ||
4 | import com.topdraw.base.modules.utils.ValidationUtil; | ||
3 | import com.topdraw.business.module.member.address.domain.MemberAddress; | 5 | import com.topdraw.business.module.member.address.domain.MemberAddress; |
4 | import com.topdraw.business.module.member.address.domain.MemberAddressBuilder; | 6 | import com.topdraw.business.module.member.address.domain.MemberAddressBuilder; |
5 | import com.topdraw.business.module.member.service.MemberService; | 7 | import com.topdraw.business.module.member.service.MemberService; |
6 | import com.topdraw.business.module.member.service.dto.MemberDTO; | 8 | import com.topdraw.business.module.member.service.dto.MemberDTO; |
7 | import com.topdraw.utils.RedisUtils; | ||
8 | import com.topdraw.utils.ValidationUtil; | ||
9 | import com.topdraw.business.module.member.address.repository.MemberAddressRepository; | 9 | import com.topdraw.business.module.member.address.repository.MemberAddressRepository; |
10 | import com.topdraw.business.module.member.address.service.MemberAddressService; | 10 | import com.topdraw.business.module.member.address.service.MemberAddressService; |
11 | import com.topdraw.business.module.member.address.service.dto.MemberAddressDTO; | 11 | import com.topdraw.business.module.member.address.service.dto.MemberAddressDTO; | ... | ... |
1 | package com.topdraw.business.module.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.modules.base.BaseMapper; |
4 | import com.topdraw.business.module.member.address.domain.MemberAddress; | 4 | import com.topdraw.business.module.member.address.domain.MemberAddress; |
5 | import com.topdraw.business.module.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; | ... | ... |
1 | package com.topdraw.business.module.member.group.service.impl; | 1 | package com.topdraw.business.module.member.group.service.impl; |
2 | 2 | ||
3 | import com.topdraw.base.modules.utils.ValidationUtil; | ||
3 | import com.topdraw.business.module.member.group.domain.Group; | 4 | import com.topdraw.business.module.member.group.domain.Group; |
4 | import com.topdraw.business.module.member.group.repository.GroupRepository; | 5 | import com.topdraw.business.module.member.group.repository.GroupRepository; |
5 | import com.topdraw.business.module.member.group.service.GroupService; | 6 | import com.topdraw.business.module.member.group.service.GroupService; |
6 | import com.topdraw.business.module.member.group.service.dto.GroupDTO; | 7 | import com.topdraw.business.module.member.group.service.dto.GroupDTO; |
7 | import com.topdraw.business.module.member.group.service.mapper.GroupMapper; | 8 | import com.topdraw.business.module.member.group.service.mapper.GroupMapper; |
8 | import com.topdraw.utils.*; | 9 | import org.apache.commons.lang3.StringUtils; |
9 | import org.springframework.beans.factory.annotation.Autowired; | 10 | import org.springframework.beans.factory.annotation.Autowired; |
10 | import org.springframework.stereotype.Service; | 11 | import org.springframework.stereotype.Service; |
11 | import org.springframework.transaction.annotation.Propagation; | 12 | import org.springframework.transaction.annotation.Propagation; | ... | ... |
1 | package com.topdraw.business.module.member.group.service.impl; | 1 | package com.topdraw.business.module.member.group.service.impl; |
2 | 2 | ||
3 | import com.topdraw.base.modules.utils.ValidationUtil; | ||
3 | import com.topdraw.business.module.member.group.domain.MemberGroup; | 4 | import com.topdraw.business.module.member.group.domain.MemberGroup; |
4 | import com.topdraw.utils.ValidationUtil; | ||
5 | import com.topdraw.business.module.member.group.repository.MemberGroupRepository; | 5 | import com.topdraw.business.module.member.group.repository.MemberGroupRepository; |
6 | import com.topdraw.business.module.member.group.service.MemberGroupService; | 6 | import com.topdraw.business.module.member.group.service.MemberGroupService; |
7 | import com.topdraw.business.module.member.group.service.dto.MemberGroupDTO; | 7 | import com.topdraw.business.module.member.group.service.dto.MemberGroupDTO; | ... | ... |
1 | package com.topdraw.business.module.member.group.service.mapper; | 1 | package com.topdraw.business.module.member.group.service.mapper; |
2 | 2 | ||
3 | import com.topdraw.base.BaseMapper; | 3 | import com.topdraw.base.modules.base.BaseMapper; |
4 | import com.topdraw.business.module.member.group.domain.Group; | 4 | import com.topdraw.business.module.member.group.domain.Group; |
5 | import com.topdraw.business.module.member.group.service.dto.GroupDTO; | 5 | import com.topdraw.business.module.member.group.service.dto.GroupDTO; |
6 | import org.mapstruct.Mapper; | 6 | import org.mapstruct.Mapper; | ... | ... |
1 | package com.topdraw.business.module.member.group.service.mapper; | 1 | package com.topdraw.business.module.member.group.service.mapper; |
2 | 2 | ||
3 | import com.topdraw.base.BaseMapper; | 3 | import com.topdraw.base.modules.base.BaseMapper; |
4 | import com.topdraw.business.module.member.group.domain.MemberGroup; | 4 | import com.topdraw.business.module.member.group.domain.MemberGroup; |
5 | import com.topdraw.business.module.member.group.service.dto.MemberGroupDTO; | 5 | import com.topdraw.business.module.member.group.service.dto.MemberGroupDTO; |
6 | import org.mapstruct.Mapper; | 6 | import org.mapstruct.Mapper; | ... | ... |
1 | package com.topdraw.business.module.member.level.service.impl; | 1 | package com.topdraw.business.module.member.level.service.impl; |
2 | 2 | ||
3 | import com.topdraw.base.modules.utils.ValidationUtil; | ||
3 | import com.topdraw.business.module.member.level.domain.MemberLevel; | 4 | import com.topdraw.business.module.member.level.domain.MemberLevel; |
4 | import com.topdraw.business.RedisKeyConstants; | 5 | import com.topdraw.business.RedisKeyConstants; |
5 | import com.topdraw.utils.ValidationUtil; | ||
6 | import com.topdraw.business.module.member.level.repository.MemberLevelRepository; | 6 | import com.topdraw.business.module.member.level.repository.MemberLevelRepository; |
7 | import com.topdraw.business.module.member.level.service.MemberLevelService; | 7 | import com.topdraw.business.module.member.level.service.MemberLevelService; |
8 | import com.topdraw.business.module.member.level.service.dto.MemberLevelDTO; | 8 | import com.topdraw.business.module.member.level.service.dto.MemberLevelDTO; |
9 | import com.topdraw.business.module.member.level.service.mapper.MemberLevelMapper; | 9 | import com.topdraw.business.module.member.level.service.mapper.MemberLevelMapper; |
10 | import org.apache.commons.lang3.StringUtils; | ||
10 | import org.springframework.beans.factory.annotation.Autowired; | 11 | import org.springframework.beans.factory.annotation.Autowired; |
11 | import org.springframework.cache.annotation.Cacheable; | 12 | import org.springframework.cache.annotation.Cacheable; |
12 | import org.springframework.stereotype.Service; | 13 | import org.springframework.stereotype.Service; |
13 | import org.springframework.transaction.annotation.Propagation; | 14 | import org.springframework.transaction.annotation.Propagation; |
14 | import org.springframework.transaction.annotation.Transactional; | 15 | import org.springframework.transaction.annotation.Transactional; |
15 | import com.topdraw.utils.StringUtils; | ||
16 | 16 | ||
17 | /** | 17 | /** |
18 | * @author XiangHan | 18 | * @author XiangHan | ... | ... |
1 | package com.topdraw.business.module.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.modules.base.BaseMapper; |
4 | import com.topdraw.business.module.member.level.domain.MemberLevel; | 4 | import com.topdraw.business.module.member.level.domain.MemberLevel; |
5 | import com.topdraw.business.module.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; | ... | ... |
1 | package com.topdraw.business.module.member.profile.rest; | 1 | package com.topdraw.business.module.member.profile.rest; |
2 | 2 | ||
3 | import com.topdraw.annotation.AnonymousAccess; | 3 | import com.topdraw.base.modules.annotation.AnonymousAccess; |
4 | import com.topdraw.base.modules.common.ResultInfo; | ||
4 | import com.topdraw.business.module.common.validated.CreateGroup; | 5 | import com.topdraw.business.module.common.validated.CreateGroup; |
5 | import com.topdraw.business.module.common.validated.UpdateGroup; | 6 | import com.topdraw.business.module.common.validated.UpdateGroup; |
6 | import com.topdraw.business.module.member.profile.service.dto.MemberProfileDTO; | 7 | import com.topdraw.business.module.member.profile.service.dto.MemberProfileDTO; |
7 | import com.topdraw.business.process.service.member.MemberProfileOperationService; | 8 | import com.topdraw.business.process.service.member.MemberProfileOperationService; |
8 | import com.topdraw.common.ResultInfo; | ||
9 | import com.topdraw.business.module.member.profile.domain.MemberProfile; | 9 | import com.topdraw.business.module.member.profile.domain.MemberProfile; |
10 | import lombok.extern.slf4j.Slf4j; | 10 | import lombok.extern.slf4j.Slf4j; |
11 | import org.springframework.beans.factory.annotation.Autowired; | 11 | import org.springframework.beans.factory.annotation.Autowired; | ... | ... |
1 | package com.topdraw.business.module.member.profile.service.impl; | 1 | package com.topdraw.business.module.member.profile.service.impl; |
2 | 2 | ||
3 | import com.topdraw.base.modules.utils.RedisUtils; | ||
4 | import com.topdraw.base.modules.utils.ValidationUtil; | ||
3 | import com.topdraw.business.module.member.domain.Member; | 5 | import com.topdraw.business.module.member.domain.Member; |
4 | import com.topdraw.business.module.member.profile.domain.MemberProfile; | 6 | import com.topdraw.business.module.member.profile.domain.MemberProfile; |
5 | import com.topdraw.business.module.member.profile.domain.MemberProfileBuilder; | 7 | import com.topdraw.business.module.member.profile.domain.MemberProfileBuilder; |
6 | import com.topdraw.business.module.member.service.MemberService; | 8 | import com.topdraw.business.module.member.service.MemberService; |
7 | import com.topdraw.business.module.member.service.dto.MemberDTO; | 9 | import com.topdraw.business.module.member.service.dto.MemberDTO; |
8 | import com.topdraw.util.Base64Util; | ||
9 | import com.topdraw.util.RegexUtil; | 10 | import com.topdraw.util.RegexUtil; |
10 | import com.topdraw.utils.RedisUtils; | ||
11 | import com.topdraw.utils.ValidationUtil; | ||
12 | import com.topdraw.business.module.member.profile.repository.MemberProfileRepository; | 11 | import com.topdraw.business.module.member.profile.repository.MemberProfileRepository; |
13 | import com.topdraw.business.module.member.profile.service.MemberProfileService; | 12 | import com.topdraw.business.module.member.profile.service.MemberProfileService; |
14 | import com.topdraw.business.module.member.profile.service.dto.MemberProfileDTO; | 13 | import com.topdraw.business.module.member.profile.service.dto.MemberProfileDTO; | ... | ... |
1 | package com.topdraw.business.module.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.modules.base.BaseMapper; |
4 | import com.topdraw.business.module.member.profile.domain.MemberProfile; | 4 | import com.topdraw.business.module.member.profile.domain.MemberProfile; |
5 | import com.topdraw.business.module.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; | ... | ... |
1 | package com.topdraw.business.module.member.relatedinfo.rest; | 1 | package com.topdraw.business.module.member.relatedinfo.rest; |
2 | 2 | ||
3 | import com.topdraw.annotation.AnonymousAccess; | 3 | import com.topdraw.base.modules.annotation.AnonymousAccess; |
4 | import com.topdraw.base.modules.common.ResultInfo; | ||
4 | import com.topdraw.business.module.common.validated.CreateGroup; | 5 | import com.topdraw.business.module.common.validated.CreateGroup; |
5 | import com.topdraw.business.module.common.validated.UpdateGroup; | 6 | import com.topdraw.business.module.common.validated.UpdateGroup; |
6 | import com.topdraw.business.module.member.relatedinfo.service.dto.BasicMemberRelatedInfoDTO; | 7 | import com.topdraw.business.module.member.relatedinfo.service.dto.BasicMemberRelatedInfoDTO; |
7 | import com.topdraw.business.process.service.member.MemberRelatedInfoOperationService; | 8 | import com.topdraw.business.process.service.member.MemberRelatedInfoOperationService; |
8 | import com.topdraw.common.ResultInfo; | ||
9 | import com.topdraw.business.module.member.relatedinfo.domain.MemberRelatedInfo; | 9 | import com.topdraw.business.module.member.relatedinfo.domain.MemberRelatedInfo; |
10 | import lombok.extern.slf4j.Slf4j; | 10 | import lombok.extern.slf4j.Slf4j; |
11 | import org.springframework.beans.factory.annotation.Autowired; | 11 | import org.springframework.beans.factory.annotation.Autowired; | ... | ... |
1 | package com.topdraw.business.module.member.relatedinfo.service.impl; | 1 | package com.topdraw.business.module.member.relatedinfo.service.impl; |
2 | 2 | ||
3 | import com.topdraw.base.modules.exception.BadRequestException; | ||
4 | import com.topdraw.base.modules.utils.RedisUtils; | ||
5 | import com.topdraw.base.modules.utils.ValidationUtil; | ||
3 | import com.topdraw.business.module.member.domain.Member; | 6 | import com.topdraw.business.module.member.domain.Member; |
4 | import com.topdraw.business.module.member.relatedinfo.domain.MemberRelatedInfo; | 7 | import com.topdraw.business.module.member.relatedinfo.domain.MemberRelatedInfo; |
5 | import com.topdraw.business.module.member.relatedinfo.domain.MemberRelatedInfoBuilder; | 8 | import com.topdraw.business.module.member.relatedinfo.domain.MemberRelatedInfoBuilder; |
6 | import com.topdraw.business.module.member.service.MemberService; | 9 | import com.topdraw.business.module.member.service.MemberService; |
7 | import com.topdraw.business.module.member.service.dto.MemberDTO; | 10 | import com.topdraw.business.module.member.service.dto.MemberDTO; |
8 | import com.topdraw.exception.BadRequestException; | ||
9 | import com.topdraw.exception.GlobeExceptionMsg; | 11 | import com.topdraw.exception.GlobeExceptionMsg; |
10 | import com.topdraw.util.Base64Util; | 12 | import com.topdraw.util.Base64Util; |
11 | import com.topdraw.utils.RedisUtils; | ||
12 | import com.topdraw.utils.ValidationUtil; | ||
13 | import com.topdraw.business.module.member.relatedinfo.repository.MemberRelatedInfoRepository; | 13 | import com.topdraw.business.module.member.relatedinfo.repository.MemberRelatedInfoRepository; |
14 | import com.topdraw.business.module.member.relatedinfo.service.MemberRelatedInfoService; | 14 | import com.topdraw.business.module.member.relatedinfo.service.MemberRelatedInfoService; |
15 | import com.topdraw.business.module.member.relatedinfo.service.dto.MemberRelatedInfoDTO; | 15 | import com.topdraw.business.module.member.relatedinfo.service.dto.MemberRelatedInfoDTO; | ... | ... |
1 | package com.topdraw.business.module.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.modules.base.BaseMapper; |
4 | import com.topdraw.business.module.member.relatedinfo.domain.MemberRelatedInfo; | 4 | import com.topdraw.business.module.member.relatedinfo.domain.MemberRelatedInfo; |
5 | import com.topdraw.business.module.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; | ... | ... |
1 | package com.topdraw.business.module.member.rest; | 1 | package com.topdraw.business.module.member.rest; |
2 | 2 | ||
3 | import com.topdraw.annotation.AnonymousAccess; | 3 | import com.topdraw.base.modules.annotation.AnonymousAccess; |
4 | import com.topdraw.base.modules.common.ResultInfo; | ||
4 | import com.topdraw.business.module.common.validated.CreateGroup; | 5 | import com.topdraw.business.module.common.validated.CreateGroup; |
5 | import com.topdraw.business.module.common.validated.UpdateGroup; | 6 | import com.topdraw.business.module.common.validated.UpdateGroup; |
6 | import com.topdraw.business.module.member.domain.Member; | 7 | import com.topdraw.business.module.member.domain.Member; |
... | @@ -8,7 +9,6 @@ import com.topdraw.business.module.member.service.dto.MemberDTO; | ... | @@ -8,7 +9,6 @@ import com.topdraw.business.module.member.service.dto.MemberDTO; |
8 | import com.topdraw.business.module.user.iptv.domain.UserTv; | 9 | import com.topdraw.business.module.user.iptv.domain.UserTv; |
9 | import com.topdraw.business.process.service.member.MemberOperationService; | 10 | import com.topdraw.business.process.service.member.MemberOperationService; |
10 | import com.topdraw.business.process.service.UserOperationService; | 11 | import com.topdraw.business.process.service.UserOperationService; |
11 | import com.topdraw.common.ResultInfo; | ||
12 | import io.swagger.annotations.Api; | 12 | import io.swagger.annotations.Api; |
13 | import io.swagger.annotations.ApiOperation; | 13 | import io.swagger.annotations.ApiOperation; |
14 | import lombok.extern.slf4j.Slf4j; | 14 | import lombok.extern.slf4j.Slf4j; |
... | @@ -19,7 +19,6 @@ import org.springframework.validation.annotation.Validated; | ... | @@ -19,7 +19,6 @@ import org.springframework.validation.annotation.Validated; |
19 | import org.springframework.web.bind.annotation.*; | 19 | import org.springframework.web.bind.annotation.*; |
20 | 20 | ||
21 | import java.util.List; | 21 | import java.util.List; |
22 | import java.util.Objects; | ||
23 | 22 | ||
24 | /** | 23 | /** |
25 | * @author XiangHan | 24 | * @author XiangHan | ... | ... |
... | @@ -2,6 +2,8 @@ package com.topdraw.business.module.member.service.impl; | ... | @@ -2,6 +2,8 @@ package com.topdraw.business.module.member.service.impl; |
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.base.modules.exception.BadRequestException; | ||
6 | import com.topdraw.base.modules.utils.RedisUtils; | ||
5 | import com.topdraw.business.module.member.domain.Member; | 7 | import com.topdraw.business.module.member.domain.Member; |
6 | import com.topdraw.business.module.member.domain.MemberBuilder; | 8 | import com.topdraw.business.module.member.domain.MemberBuilder; |
7 | import com.topdraw.business.module.member.domain.MemberSimple; | 9 | import com.topdraw.business.module.member.domain.MemberSimple; |
... | @@ -16,9 +18,7 @@ import com.topdraw.business.module.member.service.dto.MemberSimpleDTO; | ... | @@ -16,9 +18,7 @@ import com.topdraw.business.module.member.service.dto.MemberSimpleDTO; |
16 | import com.topdraw.business.module.member.service.mapper.MemberMapper; | 18 | import com.topdraw.business.module.member.service.mapper.MemberMapper; |
17 | import com.topdraw.business.module.member.service.mapper.MemberSimpleMapper; | 19 | import com.topdraw.business.module.member.service.mapper.MemberSimpleMapper; |
18 | import com.topdraw.business.RedisKeyConstants; | 20 | import com.topdraw.business.RedisKeyConstants; |
19 | import com.topdraw.exception.BadRequestException; | ||
20 | import com.topdraw.exception.GlobeExceptionMsg; | 21 | import com.topdraw.exception.GlobeExceptionMsg; |
21 | import com.topdraw.utils.RedisUtils; | ||
22 | import lombok.extern.slf4j.Slf4j; | 22 | import lombok.extern.slf4j.Slf4j; |
23 | import org.apache.commons.lang3.StringUtils; | 23 | import org.apache.commons.lang3.StringUtils; |
24 | import org.springframework.beans.BeanUtils; | 24 | import org.springframework.beans.BeanUtils; | ... | ... |
1 | package com.topdraw.business.module.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.modules.base.BaseMapper; |
4 | import com.topdraw.business.module.member.domain.Member; | 4 | import com.topdraw.business.module.member.domain.Member; |
5 | import com.topdraw.business.module.member.service.dto.MemberDTO; | 5 | import com.topdraw.business.module.member.service.dto.MemberDTO; |
6 | import org.mapstruct.Mapper; | 6 | import org.mapstruct.Mapper; | ... | ... |
1 | package com.topdraw.business.module.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.modules.base.BaseMapper; |
4 | import com.topdraw.business.module.member.domain.MemberSimple; | 4 | import com.topdraw.business.module.member.domain.MemberSimple; |
5 | import com.topdraw.business.module.member.service.dto.MemberSimpleDTO; | 5 | import com.topdraw.business.module.member.service.dto.MemberSimpleDTO; |
6 | import org.mapstruct.Mapper; | 6 | import org.mapstruct.Mapper; | ... | ... |
1 | package com.topdraw.business.module.member.viphistory.service.impl; | 1 | package com.topdraw.business.module.member.viphistory.service.impl; |
2 | 2 | ||
3 | 3 | ||
4 | import com.topdraw.aspect.AsyncMqSend; | 4 | import com.topdraw.base.modules.utils.ValidationUtil; |
5 | import com.topdraw.business.module.member.domain.Member; | 5 | import com.topdraw.business.module.member.domain.Member; |
6 | import com.topdraw.business.module.member.service.MemberService; | 6 | import com.topdraw.business.module.member.service.MemberService; |
7 | import com.topdraw.business.module.member.service.dto.MemberDTO; | 7 | import com.topdraw.business.module.member.service.dto.MemberDTO; |
... | @@ -12,7 +12,6 @@ import com.topdraw.business.module.member.viphistory.service.MemberVipHistorySer | ... | @@ -12,7 +12,6 @@ import com.topdraw.business.module.member.viphistory.service.MemberVipHistorySer |
12 | import com.topdraw.business.module.member.viphistory.service.dto.MemberVipHistoryDTO; | 12 | import com.topdraw.business.module.member.viphistory.service.dto.MemberVipHistoryDTO; |
13 | import com.topdraw.business.module.member.viphistory.service.mapper.MemberVipHistoryMapper; | 13 | import com.topdraw.business.module.member.viphistory.service.mapper.MemberVipHistoryMapper; |
14 | import com.topdraw.util.TimestampUtil; | 14 | import com.topdraw.util.TimestampUtil; |
15 | import com.topdraw.utils.ValidationUtil; | ||
16 | import lombok.extern.slf4j.Slf4j; | 15 | import lombok.extern.slf4j.Slf4j; |
17 | import org.springframework.beans.factory.annotation.Autowired; | 16 | import org.springframework.beans.factory.annotation.Autowired; |
18 | import org.springframework.dao.EmptyResultDataAccessException; | 17 | import org.springframework.dao.EmptyResultDataAccessException; |
... | @@ -90,8 +89,7 @@ public class MemberVipHistoryServiceImpl implements MemberVipHistoryService { | ... | @@ -90,8 +89,7 @@ public class MemberVipHistoryServiceImpl implements MemberVipHistoryService { |
90 | @Override | 89 | @Override |
91 | public MemberVipHistory findByTime(Long memberId, Timestamp nowTime) { | 90 | public MemberVipHistory findByTime(Long memberId, Timestamp nowTime) { |
92 | LocalDateTime localDateTime = TimestampUtil.timestamp2LocalDateTime(nowTime); | 91 | LocalDateTime localDateTime = TimestampUtil.timestamp2LocalDateTime(nowTime); |
93 | MemberVipHistory memberVipHistory = this.memberVipHistoryRepository.findByTime(memberId, localDateTime).orElseGet(MemberVipHistory::new); | 92 | return this.memberVipHistoryRepository.findByTime(memberId, localDateTime).orElseGet(MemberVipHistory::new); |
94 | return memberVipHistory; | ||
95 | } | 93 | } |
96 | 94 | ||
97 | private MemberDTO checkMember(MemberVipHistory resources){ | 95 | private MemberDTO checkMember(MemberVipHistory resources){ | ... | ... |
1 | package com.topdraw.business.module.member.viphistory.service.mapper; | 1 | package com.topdraw.business.module.member.viphistory.service.mapper; |
2 | 2 | ||
3 | import com.topdraw.base.BaseMapper; | 3 | import com.topdraw.base.modules.base.BaseMapper; |
4 | import com.topdraw.business.module.member.viphistory.domain.MemberVipHistory; | 4 | import com.topdraw.business.module.member.viphistory.domain.MemberVipHistory; |
5 | import com.topdraw.business.module.member.viphistory.service.dto.MemberVipHistoryDTO; | 5 | import com.topdraw.business.module.member.viphistory.service.dto.MemberVipHistoryDTO; |
6 | import org.mapstruct.Mapper; | 6 | import org.mapstruct.Mapper; | ... | ... |
1 | package com.topdraw.business.module.points.available.service.dto; | 1 | package com.topdraw.business.module.points.available.service.dto; |
2 | 2 | ||
3 | import com.topdraw.base.modules.annotation.Query; | ||
3 | import lombok.Data; | 4 | import lombok.Data; |
4 | import com.topdraw.annotation.Query; | ||
5 | 5 | ||
6 | import java.sql.Timestamp; | 6 | import java.sql.Timestamp; |
7 | 7 | ... | ... |
1 | package com.topdraw.business.module.points.available.service.impl; | 1 | package com.topdraw.business.module.points.available.service.impl; |
2 | 2 | ||
3 | import com.topdraw.base.modules.utils.RedisUtils; | ||
4 | import com.topdraw.base.modules.utils.ValidationUtil; | ||
3 | import com.topdraw.business.module.points.available.domain.PointsAvailable; | 5 | import com.topdraw.business.module.points.available.domain.PointsAvailable; |
4 | import com.topdraw.utils.RedisUtils; | ||
5 | import com.topdraw.utils.ValidationUtil; | ||
6 | import com.topdraw.business.module.points.available.repository.PointsAvailableRepository; | 6 | import com.topdraw.business.module.points.available.repository.PointsAvailableRepository; |
7 | import com.topdraw.business.module.points.available.service.PointsAvailableService; | 7 | import com.topdraw.business.module.points.available.service.PointsAvailableService; |
8 | import com.topdraw.business.module.points.available.service.dto.PointsAvailableDTO; | 8 | import com.topdraw.business.module.points.available.service.dto.PointsAvailableDTO; |
9 | import com.topdraw.business.module.points.available.service.mapper.PointsAvailableMapper; | 9 | import com.topdraw.business.module.points.available.service.mapper.PointsAvailableMapper; |
10 | import org.apache.commons.lang3.StringUtils; | ||
10 | import org.springframework.beans.factory.annotation.Autowired; | 11 | import org.springframework.beans.factory.annotation.Autowired; |
11 | import org.springframework.stereotype.Service; | 12 | import org.springframework.stereotype.Service; |
12 | import org.springframework.transaction.annotation.Propagation; | 13 | import org.springframework.transaction.annotation.Propagation; |
13 | import org.springframework.transaction.annotation.Transactional; | 14 | import org.springframework.transaction.annotation.Transactional; |
14 | import org.springframework.dao.EmptyResultDataAccessException; | 15 | import org.springframework.dao.EmptyResultDataAccessException; |
15 | import org.springframework.util.Assert; | 16 | import org.springframework.util.Assert; |
16 | import com.topdraw.utils.StringUtils; | ||
17 | 17 | ||
18 | import java.sql.Timestamp; | 18 | import java.sql.Timestamp; |
19 | import java.time.LocalDateTime; | ||
20 | import java.util.*; | 19 | import java.util.*; |
21 | 20 | ||
22 | /** | 21 | /** | ... | ... |
1 | package com.topdraw.business.module.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.modules.base.BaseMapper; |
4 | import com.topdraw.business.module.points.available.domain.PointsAvailable; | 4 | import com.topdraw.business.module.points.available.domain.PointsAvailable; |
5 | import com.topdraw.business.module.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; | ... | ... |
1 | package com.topdraw.business.module.points.detail.detailhistory.service.impl; | 1 | package com.topdraw.business.module.points.detail.detailhistory.service.impl; |
2 | 2 | ||
3 | import com.topdraw.base.modules.utils.ValidationUtil; | ||
3 | import com.topdraw.business.module.points.detail.detailhistory.domain.PointsDetailHistory; | 4 | import com.topdraw.business.module.points.detail.detailhistory.domain.PointsDetailHistory; |
4 | import com.topdraw.utils.ValidationUtil; | ||
5 | import com.topdraw.business.module.points.detail.detailhistory.repository.PointsDetailHistoryRepository; | 5 | import com.topdraw.business.module.points.detail.detailhistory.repository.PointsDetailHistoryRepository; |
6 | import com.topdraw.business.module.points.detail.detailhistory.service.PointsDetailHistoryService; | 6 | import com.topdraw.business.module.points.detail.detailhistory.service.PointsDetailHistoryService; |
7 | import com.topdraw.business.module.points.detail.detailhistory.service.dto.PointsDetailHistoryDTO; | 7 | import com.topdraw.business.module.points.detail.detailhistory.service.dto.PointsDetailHistoryDTO; |
8 | import com.topdraw.business.module.points.detail.detailhistory.service.mapper.PointsDetailHistoryMapper; | 8 | import com.topdraw.business.module.points.detail.detailhistory.service.mapper.PointsDetailHistoryMapper; |
9 | import org.apache.commons.lang3.StringUtils; | ||
9 | import org.springframework.beans.factory.annotation.Autowired; | 10 | import org.springframework.beans.factory.annotation.Autowired; |
10 | import org.springframework.stereotype.Service; | 11 | import org.springframework.stereotype.Service; |
11 | import org.springframework.transaction.annotation.Propagation; | 12 | import org.springframework.transaction.annotation.Propagation; |
12 | import org.springframework.transaction.annotation.Transactional; | 13 | import org.springframework.transaction.annotation.Transactional; |
13 | import org.springframework.dao.EmptyResultDataAccessException; | 14 | import org.springframework.dao.EmptyResultDataAccessException; |
14 | import org.springframework.util.Assert; | 15 | import org.springframework.util.Assert; |
15 | import com.topdraw.utils.StringUtils; | ||
16 | 16 | ||
17 | /** | 17 | /** |
18 | * @author XiangHan | 18 | * @author XiangHan | ... | ... |
1 | package com.topdraw.business.module.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.modules.base.BaseMapper; |
4 | import com.topdraw.business.module.points.detail.detailhistory.domain.PointsDetailHistory; | 4 | import com.topdraw.business.module.points.detail.detailhistory.domain.PointsDetailHistory; |
5 | import com.topdraw.business.module.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; | ... | ... |
1 | package com.topdraw.business.module.points.detail.service.impl; | 1 | package com.topdraw.business.module.points.detail.service.impl; |
2 | 2 | ||
3 | import com.topdraw.base.modules.utils.ValidationUtil; | ||
3 | import com.topdraw.business.module.points.detail.domain.PointsDetail; | 4 | import com.topdraw.business.module.points.detail.domain.PointsDetail; |
4 | import com.topdraw.utils.ValidationUtil; | ||
5 | import com.topdraw.business.module.points.detail.repository.PointsDetailRepository; | 5 | import com.topdraw.business.module.points.detail.repository.PointsDetailRepository; |
6 | import com.topdraw.business.module.points.detail.service.PointsDetailService; | 6 | import com.topdraw.business.module.points.detail.service.PointsDetailService; |
7 | import com.topdraw.business.module.points.detail.service.dto.PointsDetailDTO; | 7 | import com.topdraw.business.module.points.detail.service.dto.PointsDetailDTO; |
8 | import com.topdraw.business.module.points.detail.service.mapper.PointsDetailMapper; | 8 | import com.topdraw.business.module.points.detail.service.mapper.PointsDetailMapper; |
9 | import org.apache.commons.lang3.StringUtils; | ||
9 | import org.springframework.beans.factory.annotation.Autowired; | 10 | import org.springframework.beans.factory.annotation.Autowired; |
10 | import org.springframework.stereotype.Service; | 11 | import org.springframework.stereotype.Service; |
11 | import org.springframework.transaction.annotation.Propagation; | 12 | import org.springframework.transaction.annotation.Propagation; |
12 | import org.springframework.transaction.annotation.Transactional; | 13 | import org.springframework.transaction.annotation.Transactional; |
13 | import org.springframework.dao.EmptyResultDataAccessException; | 14 | import org.springframework.dao.EmptyResultDataAccessException; |
14 | import org.springframework.util.Assert; | 15 | import org.springframework.util.Assert; |
15 | import com.topdraw.utils.StringUtils; | ||
16 | 16 | ||
17 | import java.util.List; | 17 | import java.util.List; |
18 | import java.util.Objects; | 18 | import java.util.Objects; | ... | ... |
1 | package com.topdraw.business.module.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.modules.base.BaseMapper; |
4 | import com.topdraw.business.module.points.detail.domain.PointsDetail; | 4 | import com.topdraw.business.module.points.detail.domain.PointsDetail; |
5 | import com.topdraw.business.module.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; | ... | ... |
1 | package com.topdraw.business.module.points.service.impl; | 1 | package com.topdraw.business.module.points.service.impl; |
2 | 2 | ||
3 | import com.topdraw.base.modules.utils.RedisUtils; | ||
4 | import com.topdraw.base.modules.utils.ValidationUtil; | ||
3 | import com.topdraw.business.module.points.domain.Points; | 5 | import com.topdraw.business.module.points.domain.Points; |
4 | import com.topdraw.utils.RedisUtils; | ||
5 | import com.topdraw.utils.ValidationUtil; | ||
6 | import com.topdraw.business.module.points.repository.PointsRepository; | 6 | import com.topdraw.business.module.points.repository.PointsRepository; |
7 | import com.topdraw.business.module.points.service.PointsService; | 7 | import com.topdraw.business.module.points.service.PointsService; |
8 | import com.topdraw.business.module.points.service.dto.PointsDTO; | 8 | import com.topdraw.business.module.points.service.dto.PointsDTO; | ... | ... |
1 | package com.topdraw.business.module.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.modules.base.BaseMapper; |
4 | import com.topdraw.business.module.points.domain.Points; | 4 | import com.topdraw.business.module.points.domain.Points; |
5 | import com.topdraw.business.module.points.service.dto.PointsDTO; | 5 | import com.topdraw.business.module.points.service.dto.PointsDTO; |
6 | import org.mapstruct.Mapper; | 6 | import org.mapstruct.Mapper; | ... | ... |
1 | package com.topdraw.business.module.rights.history.service.dto; | 1 | package com.topdraw.business.module.rights.history.service.dto; |
2 | 2 | ||
3 | import com.topdraw.annotation.Query; | 3 | import com.topdraw.base.modules.annotation.Query; |
4 | import lombok.Data; | 4 | import lombok.Data; |
5 | 5 | ||
6 | import java.sql.Timestamp; | 6 | import java.sql.Timestamp; | ... | ... |
1 | package com.topdraw.business.module.rights.history.service.impl; | 1 | package com.topdraw.business.module.rights.history.service.impl; |
2 | 2 | ||
3 | import com.topdraw.base.modules.utils.ValidationUtil; | ||
3 | import com.topdraw.business.module.member.service.MemberService; | 4 | import com.topdraw.business.module.member.service.MemberService; |
4 | import com.topdraw.business.module.member.service.dto.MemberDTO; | 5 | import com.topdraw.business.module.member.service.dto.MemberDTO; |
5 | import com.topdraw.business.module.rights.history.domain.RightsHistory; | 6 | import com.topdraw.business.module.rights.history.domain.RightsHistory; |
6 | import com.topdraw.utils.ValidationUtil; | ||
7 | import com.topdraw.business.module.rights.history.repository.RightsHistoryRepository; | 7 | import com.topdraw.business.module.rights.history.repository.RightsHistoryRepository; |
8 | import com.topdraw.business.module.rights.history.service.RightsHistoryService; | 8 | import com.topdraw.business.module.rights.history.service.RightsHistoryService; |
9 | import com.topdraw.business.module.rights.history.service.dto.RightsHistoryDTO; | 9 | import com.topdraw.business.module.rights.history.service.dto.RightsHistoryDTO; |
10 | import com.topdraw.business.module.rights.history.service.dto.RightsHistoryQueryCriteria; | ||
11 | import com.topdraw.business.module.rights.history.service.mapper.RightsHistoryMapper; | 10 | import com.topdraw.business.module.rights.history.service.mapper.RightsHistoryMapper; |
12 | import org.springframework.beans.factory.annotation.Autowired; | 11 | import org.springframework.beans.factory.annotation.Autowired; |
13 | import org.springframework.stereotype.Service; | 12 | import org.springframework.stereotype.Service; |
... | @@ -37,8 +36,7 @@ public class RightsHistoryServiceImpl implements RightsHistoryService { | ... | @@ -37,8 +36,7 @@ public class RightsHistoryServiceImpl implements RightsHistoryService { |
37 | @Override | 36 | @Override |
38 | public List<RightsHistoryDTO> findByMemberIdOrMemberCode(Long memberId, String memberCode) { | 37 | public List<RightsHistoryDTO> findByMemberIdOrMemberCode(Long memberId, String memberCode) { |
39 | MemberDTO memberDTO = this.memberService.checkMember(memberId, memberCode); | 38 | MemberDTO memberDTO = this.memberService.checkMember(memberId, memberCode); |
40 | List<RightsHistoryDTO> rightsHistoryDTOList = this.rightsHistoryRepository.findByMemberId(memberDTO.getId()); | 39 | return this.rightsHistoryRepository.findByMemberId(memberDTO.getId()); |
41 | return rightsHistoryDTOList; | ||
42 | } | 40 | } |
43 | 41 | ||
44 | @Override | 42 | @Override | ... | ... |
1 | package com.topdraw.business.module.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.modules.base.BaseMapper; |
4 | import com.topdraw.business.module.rights.history.domain.RightsHistory; | 4 | import com.topdraw.business.module.rights.history.domain.RightsHistory; |
5 | import com.topdraw.business.module.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; | ... | ... |
1 | package com.topdraw.business.module.rights.permanentrights.service.impl; | 1 | package com.topdraw.business.module.rights.permanentrights.service.impl; |
2 | 2 | ||
3 | import com.topdraw.base.modules.utils.ValidationUtil; | ||
3 | import com.topdraw.business.module.rights.permanentrights.domain.PermanentRights; | 4 | import com.topdraw.business.module.rights.permanentrights.domain.PermanentRights; |
4 | import com.topdraw.utils.ValidationUtil; | ||
5 | import com.topdraw.business.module.rights.permanentrights.repository.PermanentRightsRepository; | 5 | import com.topdraw.business.module.rights.permanentrights.repository.PermanentRightsRepository; |
6 | import com.topdraw.business.module.rights.permanentrights.service.PermanentRightsService; | 6 | import com.topdraw.business.module.rights.permanentrights.service.PermanentRightsService; |
7 | import com.topdraw.business.module.rights.permanentrights.service.dto.PermanentRightsDTO; | 7 | import com.topdraw.business.module.rights.permanentrights.service.dto.PermanentRightsDTO; |
8 | import com.topdraw.business.module.rights.permanentrights.service.mapper.PermanentRightsMapper; | 8 | import com.topdraw.business.module.rights.permanentrights.service.mapper.PermanentRightsMapper; |
9 | import org.apache.commons.lang3.StringUtils; | ||
9 | import org.springframework.beans.factory.annotation.Autowired; | 10 | import org.springframework.beans.factory.annotation.Autowired; |
10 | import org.springframework.stereotype.Service; | 11 | import org.springframework.stereotype.Service; |
11 | import org.springframework.transaction.annotation.Propagation; | 12 | import org.springframework.transaction.annotation.Propagation; |
12 | import org.springframework.transaction.annotation.Transactional; | 13 | import org.springframework.transaction.annotation.Transactional; |
13 | import com.topdraw.utils.StringUtils; | ||
14 | 14 | ||
15 | /** | 15 | /** |
16 | * @author XiangHan | 16 | * @author XiangHan | ... | ... |
1 | package com.topdraw.business.module.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.modules.base.BaseMapper; |
4 | import com.topdraw.business.module.rights.permanentrights.domain.PermanentRights; | 4 | import com.topdraw.business.module.rights.permanentrights.domain.PermanentRights; |
5 | import com.topdraw.business.module.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; | ... | ... |
... | @@ -2,11 +2,11 @@ package com.topdraw.business.module.rights.service.impl; | ... | @@ -2,11 +2,11 @@ package com.topdraw.business.module.rights.service.impl; |
2 | 2 | ||
3 | import com.topdraw.business.module.rights.domain.Rights; | 3 | import com.topdraw.business.module.rights.domain.Rights; |
4 | import com.topdraw.business.RedisKeyConstants; | 4 | import com.topdraw.business.RedisKeyConstants; |
5 | import com.topdraw.utils.*; | ||
6 | import com.topdraw.business.module.rights.repository.RightsRepository; | 5 | import com.topdraw.business.module.rights.repository.RightsRepository; |
7 | import com.topdraw.business.module.rights.service.RightsService; | 6 | import com.topdraw.business.module.rights.service.RightsService; |
8 | import com.topdraw.business.module.rights.service.dto.RightsDTO; | 7 | import com.topdraw.business.module.rights.service.dto.RightsDTO; |
9 | import com.topdraw.business.module.rights.service.mapper.RightsMapper; | 8 | import com.topdraw.business.module.rights.service.mapper.RightsMapper; |
9 | import org.apache.commons.lang3.StringUtils; | ||
10 | import org.springframework.beans.factory.annotation.Autowired; | 10 | import org.springframework.beans.factory.annotation.Autowired; |
11 | import org.springframework.cache.annotation.Cacheable; | 11 | import org.springframework.cache.annotation.Cacheable; |
12 | import org.springframework.stereotype.Service; | 12 | import org.springframework.stereotype.Service; | ... | ... |
1 | package com.topdraw.business.module.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.modules.base.BaseMapper; |
4 | import com.topdraw.business.module.rights.domain.Rights; | 4 | import com.topdraw.business.module.rights.domain.Rights; |
5 | import com.topdraw.business.module.rights.service.dto.RightsDTO; | 5 | import com.topdraw.business.module.rights.service.dto.RightsDTO; |
6 | import org.mapstruct.Mapper; | 6 | import org.mapstruct.Mapper; | ... | ... |
1 | package com.topdraw.business.module.task.attribute.service.impl; | 1 | package com.topdraw.business.module.task.attribute.service.impl; |
2 | 2 | ||
3 | import com.alibaba.fastjson.JSON; | 3 | import com.alibaba.fastjson.JSON; |
4 | import com.topdraw.base.modules.utils.ValidationUtil; | ||
4 | import com.topdraw.business.module.task.attribute.domain.TaskAttr; | 5 | import com.topdraw.business.module.task.attribute.domain.TaskAttr; |
5 | import com.topdraw.utils.ValidationUtil; | ||
6 | import com.topdraw.business.module.task.attribute.repository.TaskAttrRepository; | 6 | import com.topdraw.business.module.task.attribute.repository.TaskAttrRepository; |
7 | import com.topdraw.business.module.task.attribute.service.TaskAttrService; | 7 | import com.topdraw.business.module.task.attribute.service.TaskAttrService; |
8 | import com.topdraw.business.module.task.attribute.service.dto.TaskAttrDTO; | 8 | import com.topdraw.business.module.task.attribute.service.dto.TaskAttrDTO; | ... | ... |
1 | package com.topdraw.business.module.task.attribute.service.mapper; | 1 | package com.topdraw.business.module.task.attribute.service.mapper; |
2 | 2 | ||
3 | import com.topdraw.base.BaseMapper; | 3 | import com.topdraw.base.modules.base.BaseMapper; |
4 | import com.topdraw.business.module.task.attribute.domain.TaskAttr; | 4 | import com.topdraw.business.module.task.attribute.domain.TaskAttr; |
5 | import com.topdraw.business.module.task.attribute.service.dto.TaskAttrDTO; | 5 | import com.topdraw.business.module.task.attribute.service.dto.TaskAttrDTO; |
6 | import org.mapstruct.Mapper; | 6 | import org.mapstruct.Mapper; | ... | ... |
... | @@ -38,6 +38,10 @@ public class Task implements Serializable { | ... | @@ -38,6 +38,10 @@ public class Task implements Serializable { |
38 | @NotNull(message = "taskTemplateId is null", groups = {CreateGroup.class}) | 38 | @NotNull(message = "taskTemplateId is null", groups = {CreateGroup.class}) |
39 | private Long taskTemplateId; | 39 | private Long taskTemplateId; |
40 | 40 | ||
41 | /** 关联实体id */ | ||
42 | @Column(name = "entity_id", nullable = false) | ||
43 | private String entityId; | ||
44 | |||
41 | @Transient | 45 | @Transient |
42 | private String taskTemplateCode; | 46 | private String taskTemplateCode; |
43 | 47 | ... | ... |
... | @@ -27,6 +27,7 @@ public class TaskBuilder { | ... | @@ -27,6 +27,7 @@ public class TaskBuilder { |
27 | task_.setTaskTemplateCode(task.getTaskTemplateCode()); | 27 | task_.setTaskTemplateCode(task.getTaskTemplateCode()); |
28 | 28 | ||
29 | task_.setName(task.getName()); | 29 | task_.setName(task.getName()); |
30 | task_.setEntityId(task.getEntityId()); | ||
30 | task_.setCode(StringUtils.isEmpty(task.getCode()) ? IdWorker.generatorCode("task_") : task.getCode()); | 31 | task_.setCode(StringUtils.isEmpty(task.getCode()) ? IdWorker.generatorCode("task_") : task.getCode()); |
31 | task_.setStatus(Objects.isNull(task.getStatus()) ? 1 : task.getStatus()); | 32 | task_.setStatus(Objects.isNull(task.getStatus()) ? 1 : task.getStatus()); |
32 | task_.setSequence(task.getSequence()); | 33 | task_.setSequence(task.getSequence()); | ... | ... |
1 | package com.topdraw.business.module.task.progress.service.impl; | 1 | package com.topdraw.business.module.task.progress.service.impl; |
2 | 2 | ||
3 | import com.topdraw.base.modules.utils.RedisUtils; | ||
3 | import com.topdraw.business.module.task.progress.domain.TrTaskProgress; | 4 | import com.topdraw.business.module.task.progress.domain.TrTaskProgress; |
4 | import com.topdraw.business.RedisKeyConstants; | 5 | import com.topdraw.business.RedisKeyConstants; |
5 | import com.topdraw.utils.RedisUtils; | ||
6 | import com.topdraw.business.module.task.progress.repository.TrTaskProgressRepository; | 6 | import com.topdraw.business.module.task.progress.repository.TrTaskProgressRepository; |
7 | import com.topdraw.business.module.task.progress.service.TrTaskProgressService; | 7 | import com.topdraw.business.module.task.progress.service.TrTaskProgressService; |
8 | import com.topdraw.business.module.task.progress.service.dto.TrTaskProgressDTO; | 8 | import com.topdraw.business.module.task.progress.service.dto.TrTaskProgressDTO; |
... | @@ -44,14 +44,12 @@ public class TrTaskProgressServiceImpl implements TrTaskProgressService { | ... | @@ -44,14 +44,12 @@ public class TrTaskProgressServiceImpl implements TrTaskProgressService { |
44 | 44 | ||
45 | @Override | 45 | @Override |
46 | @Transactional(rollbackFor = Exception.class) | 46 | @Transactional(rollbackFor = Exception.class) |
47 | // @CachePut(cacheNames = RedisKeyConstants.cacheTaskProcessByMemberId, key = "#resources.memberId+':'+#resources.taskId+':'+#date", unless = "#result == null ") | ||
48 | public TrTaskProgress create(TrTaskProgress resources, String date) { | 47 | public TrTaskProgress create(TrTaskProgress resources, String date) { |
49 | return this.trTaskProgressRepository.save(resources); | 48 | return this.trTaskProgressRepository.save(resources); |
50 | } | 49 | } |
51 | 50 | ||
52 | @Override | 51 | @Override |
53 | @Transactional(rollbackFor = Exception.class) | 52 | @Transactional(rollbackFor = Exception.class) |
54 | // @CachePut(cacheNames = RedisKeyConstants.cacheTaskProcessByMemberId, key = "#resources.memberId+':'+#resources.taskId+':'+#date", unless = "#result == null ") | ||
55 | public TrTaskProgress update(TrTaskProgress resources, String date) { | 53 | public TrTaskProgress update(TrTaskProgress resources, String date) { |
56 | return this.trTaskProgressRepository.save(resources); | 54 | return this.trTaskProgressRepository.save(resources); |
57 | } | 55 | } |
... | @@ -94,7 +92,7 @@ public class TrTaskProgressServiceImpl implements TrTaskProgressService { | ... | @@ -94,7 +92,7 @@ public class TrTaskProgressServiceImpl implements TrTaskProgressService { |
94 | } | 92 | } |
95 | if (finishTasks.size() > 0) { | 93 | if (finishTasks.size() > 0) { |
96 | // 总记录一直存储 | 94 | // 总记录一直存储 |
97 | this.redisUtils.hmset(RedisKeyConstants.cacheTotalFinishTaskCount + "::" + memberId, finishTasks); | 95 | this.redisUtils.hmsetForObject(RedisKeyConstants.cacheTotalFinishTaskCount + "::" + memberId, finishTasks); |
98 | } | 96 | } |
99 | 97 | ||
100 | return finishTasks; | 98 | return finishTasks; |
... | @@ -124,7 +122,7 @@ public class TrTaskProgressServiceImpl implements TrTaskProgressService { | ... | @@ -124,7 +122,7 @@ public class TrTaskProgressServiceImpl implements TrTaskProgressService { |
124 | 122 | ||
125 | if (finishTasks.size() > 0) { | 123 | if (finishTasks.size() > 0) { |
126 | // 单天的记录只存储一天 | 124 | // 单天的记录只存储一天 |
127 | this.redisUtils.hmset(RedisKeyConstants.cacheTodayFinishTaskCount + "::" + memberId + ":" + LocalDate.now(), finishTasks, 24*60*60); | 125 | this.redisUtils.hmsetForObject(RedisKeyConstants.cacheTodayFinishTaskCount + "::" + memberId + ":" + LocalDate.now(), finishTasks, 24*60*60); |
128 | } | 126 | } |
129 | 127 | ||
130 | return finishTasks; | 128 | return finishTasks; | ... | ... |
1 | package com.topdraw.business.module.task.progress.service.mapper; | 1 | package com.topdraw.business.module.task.progress.service.mapper; |
2 | 2 | ||
3 | import com.topdraw.base.BaseMapper; | 3 | import com.topdraw.base.modules.base.BaseMapper; |
4 | import com.topdraw.business.module.task.progress.domain.TrTaskProgress; | 4 | import com.topdraw.business.module.task.progress.domain.TrTaskProgress; |
5 | import com.topdraw.business.module.task.progress.service.dto.TrTaskProgressDTO; | 5 | import com.topdraw.business.module.task.progress.service.dto.TrTaskProgressDTO; |
6 | import org.mapstruct.Mapper; | 6 | import org.mapstruct.Mapper; | ... | ... |
... | @@ -29,5 +29,11 @@ public interface TaskRepository extends JpaRepository<Task, Long>, JpaSpecificat | ... | @@ -29,5 +29,11 @@ public interface TaskRepository extends JpaRepository<Task, Long>, JpaSpecificat |
29 | @Query(value = "SELECT ta.* FROM tr_task ta LEFT JOIN tr_task_template tm ON ta.task_template_id = tm.id " + | 29 | @Query(value = "SELECT ta.* FROM tr_task ta LEFT JOIN tr_task_template tm ON ta.task_template_id = tm.id " + |
30 | " WHERE ta.`status` = 1 AND ta.valid_time <= now() and ta.expire_time >= now() AND ta.delete_mark = 0 AND " + | 30 | " WHERE ta.`status` = 1 AND ta.valid_time <= now() and ta.expire_time >= now() AND ta.delete_mark = 0 AND " + |
31 | " tm.type = ?1 AND ta.`member_level` <= ?2 and ta.`member_vip` <= ?3", nativeQuery = true) | 31 | " tm.type = ?1 AND ta.`member_level` <= ?2 and ta.`member_vip` <= ?3", nativeQuery = true) |
32 | List<Map<String,Object>> findByEventAndLevelAndVip(Integer event, Integer level, Integer vip); | 32 | List<Map<String,Object>> findByTypeAndLevelAndVip(Integer type, Integer level, Integer vip); |
33 | |||
34 | |||
35 | @Query(value = "SELECT ta.* FROM tr_task ta LEFT JOIN tr_task_template tm ON ta.task_template_id = tm.id " + | ||
36 | " WHERE ta.`status` = 1 AND ta.valid_time <= now() and ta.expire_time >= now() AND ta.delete_mark = 0 AND " + | ||
37 | " tm.event = ?1 AND ta.`member_level` <= ?2 and ta.`member_vip` <= ?3", nativeQuery = true) | ||
38 | List<Map<String,Object>> findByEventAndLevelAndVip(String event, Integer level, Integer vip); | ||
33 | } | 39 | } | ... | ... |
... | @@ -64,6 +64,6 @@ public interface TaskService { | ... | @@ -64,6 +64,6 @@ public interface TaskService { |
64 | * @param event | 64 | * @param event |
65 | * @return | 65 | * @return |
66 | */ | 66 | */ |
67 | List<Task> findByEventAndMemberLevelAndVip(Integer event, Integer level, Integer vip); | 67 | List<Task> findByEventAndMemberLevelAndVip(String event, Integer level, Integer vip); |
68 | 68 | ||
69 | } | 69 | } | ... | ... |
... | @@ -20,6 +20,9 @@ public class TaskDTO implements Serializable { | ... | @@ -20,6 +20,9 @@ public class TaskDTO implements Serializable { |
20 | /** 任务模板id */ | 20 | /** 任务模板id */ |
21 | private Long taskTemplateId; | 21 | private Long taskTemplateId; |
22 | 22 | ||
23 | /** 关联实体id */ | ||
24 | private String entityId; | ||
25 | |||
23 | /** 删除标识 0:正常;1:已删除;*/ | 26 | /** 删除标识 0:正常;1:已删除;*/ |
24 | private Integer deleteMark; | 27 | private Integer deleteMark; |
25 | 28 | ... | ... |
member-service-impl/src/main/java/com/topdraw/business/module/task/service/impl/TaskServiceImpl.java
... | @@ -3,6 +3,7 @@ package com.topdraw.business.module.task.service.impl; | ... | @@ -3,6 +3,7 @@ package com.topdraw.business.module.task.service.impl; |
3 | import com.alibaba.fastjson.JSON; | 3 | import com.alibaba.fastjson.JSON; |
4 | import com.alibaba.fastjson.JSONArray; | 4 | import com.alibaba.fastjson.JSONArray; |
5 | import com.alibaba.fastjson.JSONObject; | 5 | import com.alibaba.fastjson.JSONObject; |
6 | import com.topdraw.base.modules.utils.RedisUtils; | ||
6 | import com.topdraw.business.module.task.attribute.service.TaskAttrService; | 7 | import com.topdraw.business.module.task.attribute.service.TaskAttrService; |
7 | import com.topdraw.business.module.task.attribute.service.dto.TaskAttrDTO; | 8 | import com.topdraw.business.module.task.attribute.service.dto.TaskAttrDTO; |
8 | import com.topdraw.business.module.task.domain.Task; | 9 | import com.topdraw.business.module.task.domain.Task; |
... | @@ -11,7 +12,6 @@ import com.topdraw.business.module.task.service.TaskService; | ... | @@ -11,7 +12,6 @@ import com.topdraw.business.module.task.service.TaskService; |
11 | import com.topdraw.business.module.task.service.dto.TaskDTO; | 12 | import com.topdraw.business.module.task.service.dto.TaskDTO; |
12 | import com.topdraw.business.module.task.service.mapper.TaskMapper; | 13 | import com.topdraw.business.module.task.service.mapper.TaskMapper; |
13 | import com.topdraw.business.RedisKeyConstants; | 14 | import com.topdraw.business.RedisKeyConstants; |
14 | import com.topdraw.utils.RedisUtils; | ||
15 | import lombok.extern.slf4j.Slf4j; | 15 | import lombok.extern.slf4j.Slf4j; |
16 | import org.springframework.beans.factory.annotation.Autowired; | 16 | import org.springframework.beans.factory.annotation.Autowired; |
17 | import org.springframework.stereotype.Service; | 17 | import org.springframework.stereotype.Service; |
... | @@ -19,10 +19,7 @@ import org.springframework.transaction.annotation.Propagation; | ... | @@ -19,10 +19,7 @@ import org.springframework.transaction.annotation.Propagation; |
19 | import org.springframework.transaction.annotation.Transactional; | 19 | import org.springframework.transaction.annotation.Transactional; |
20 | import org.springframework.util.CollectionUtils; | 20 | import org.springframework.util.CollectionUtils; |
21 | 21 | ||
22 | import java.util.ArrayList; | 22 | import java.util.*; |
23 | import java.util.List; | ||
24 | import java.util.Map; | ||
25 | import java.util.Objects; | ||
26 | import java.util.stream.Collectors; | 23 | import java.util.stream.Collectors; |
27 | 24 | ||
28 | /** | 25 | /** |
... | @@ -69,8 +66,14 @@ public class TaskServiceImpl implements TaskService { | ... | @@ -69,8 +66,14 @@ public class TaskServiceImpl implements TaskService { |
69 | 66 | ||
70 | @Override | 67 | @Override |
71 | public TaskDTO update(Task task) { | 68 | public TaskDTO update(Task task) { |
72 | Task save = this.taskRepository.save(task); | 69 | Optional<Task> taskOptional = this.taskRepository.findById(task.getId()); |
73 | return this.taskMapper.toDto(save); | 70 | if (taskOptional.isPresent()) { |
71 | Task task1 = taskOptional.get(); | ||
72 | task1.copy(task); | ||
73 | Task result = this.taskRepository.save(task1); | ||
74 | return this.taskMapper.toDto(result); | ||
75 | } | ||
76 | return this.taskMapper.toDto(task); | ||
74 | } | 77 | } |
75 | 78 | ||
76 | @Override | 79 | @Override |
... | @@ -86,7 +89,7 @@ public class TaskServiceImpl implements TaskService { | ... | @@ -86,7 +89,7 @@ public class TaskServiceImpl implements TaskService { |
86 | 89 | ||
87 | @Override | 90 | @Override |
88 | @Transactional(readOnly = true) | 91 | @Transactional(readOnly = true) |
89 | public List<Task> findByEventAndMemberLevelAndVip(Integer event, Integer level, Integer vip) { | 92 | public List<Task> findByEventAndMemberLevelAndVip(String event, Integer level, Integer vip) { |
90 | try { | 93 | try { |
91 | boolean b = this.redisUtils.hasKey(RedisKeyConstants.cacheTaskByEventAndMemberLevelAndVip + "::" + event + ":" + level + ":" + vip); | 94 | boolean b = this.redisUtils.hasKey(RedisKeyConstants.cacheTaskByEventAndMemberLevelAndVip + "::" + event + ":" + level + ":" + vip); |
92 | 95 | ||
... | @@ -102,32 +105,11 @@ public class TaskServiceImpl implements TaskService { | ... | @@ -102,32 +105,11 @@ public class TaskServiceImpl implements TaskService { |
102 | return tasks; | 105 | return tasks; |
103 | } | 106 | } |
104 | 107 | ||
105 | List<TaskAttrDTO> taskAttrDTOS = this.taskAttrService.findTasksByTaskIds(maps.stream().map(t -> t.get("id")).collect(Collectors.toSet())); | ||
106 | |||
107 | if (!CollectionUtils.isEmpty(taskAttrDTOS)) { | ||
108 | |||
109 | for (Map<String, Object> map : maps) { | ||
110 | Task task = JSONObject.parseObject(JSON.toJSONString(map), Task.class); | ||
111 | |||
112 | List<String> taskAttrs = taskAttrDTOS.stream().filter(taskAttrDTO -> taskAttrDTO.getTaskId().equals(task.getId())). | ||
113 | map(TaskAttrDTO::getAttrStr).collect(Collectors.toList()); | ||
114 | log.info("任务属性值, dealTask# taskAttrs ==>> {}", taskAttrs); | ||
115 | if (!CollectionUtils.isEmpty(taskAttrs)) { | ||
116 | task.setAttr(String.join(",", taskAttrs)); | ||
117 | } | ||
118 | |||
119 | tasks.add(task); | ||
120 | } | ||
121 | |||
122 | } else { | ||
123 | |||
124 | for (Map<String, Object> map : maps) { | 108 | for (Map<String, Object> map : maps) { |
125 | Task task = JSONObject.parseObject(JSON.toJSONString(map), Task.class); | 109 | Task task = JSONObject.parseObject(JSON.toJSONString(map), Task.class); |
126 | tasks.add(task); | 110 | tasks.add(task); |
127 | } | 111 | } |
128 | 112 | ||
129 | } | ||
130 | |||
131 | if (!CollectionUtils.isEmpty(tasks)) { | 113 | if (!CollectionUtils.isEmpty(tasks)) { |
132 | this.redisUtils.lSet(RedisKeyConstants.cacheTaskByEventAndMemberLevelAndVip + "::" + event + ":" + level + ":" + vip, tasks, 45 * 60); | 114 | this.redisUtils.lSet(RedisKeyConstants.cacheTaskByEventAndMemberLevelAndVip + "::" + event + ":" + level + ":" + vip, tasks, 45 * 60); |
133 | } | 115 | } | ... | ... |
1 | package com.topdraw.business.module.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.modules.base.BaseMapper; |
4 | import com.topdraw.business.module.task.domain.Task; | 4 | import com.topdraw.business.module.task.domain.Task; |
5 | import com.topdraw.business.module.task.service.dto.TaskDTO; | 5 | import com.topdraw.business.module.task.service.dto.TaskDTO; |
6 | import org.mapstruct.Mapper; | 6 | import org.mapstruct.Mapper; | ... | ... |
... | @@ -12,7 +12,7 @@ package com.topdraw.business.module.task.template.constant; | ... | @@ -12,7 +12,7 @@ package com.topdraw.business.module.task.template.constant; |
12 | public interface TaskEventType { | 12 | public interface TaskEventType { |
13 | //类型 1:登录;2:观影;3:参加活动;4:订购;5:优享会员;6:签到;7:完成设置; | 13 | //类型 1:登录;2:观影;3:参加活动;4:订购;5:优享会员;6:签到;7:完成设置; |
14 | // 8:播放记录;10:跨屏绑定;11:积分转移;30:积分兑换商品;98:系统操作;99:其他 | 14 | // 8:播放记录;10:跨屏绑定;11:积分转移;30:积分兑换商品;98:系统操作;99:其他 |
15 | int LOGIN = 1; | 15 | /*int LOGIN = 1; |
16 | int VIEW = 2; | 16 | int VIEW = 2; |
17 | int ACTIVITY = 3; | 17 | int ACTIVITY = 3; |
18 | int ORDER = 4; | 18 | int ORDER = 4; |
... | @@ -22,8 +22,40 @@ public interface TaskEventType { | ... | @@ -22,8 +22,40 @@ public interface TaskEventType { |
22 | int PLAY = 8; | 22 | int PLAY = 8; |
23 | int BINDING = 10; | 23 | int BINDING = 10; |
24 | int POINTS_TRANS = 11; | 24 | int POINTS_TRANS = 11; |
25 | int POINTS_EXCHANGE_GOODS = 30; | 25 | int POINTS_EXCHANGE_GOODS = 14; |
26 | int SYSTEM_OPERATE = 98; | 26 | int SYSTEM_OPERATE = 98; |
27 | int OHHER = 99; | 27 | int OHHER = 99;*/ |
28 | 28 | ||
29 | // 登录 | ||
30 | String LOGIN = "login"; | ||
31 | // 观影 | ||
32 | String VIEWING = "viewing"; | ||
33 | // 参加活动 | ||
34 | String JOINACTIVITIES = "join_activity"; | ||
35 | // 购物 | ||
36 | String ORDER = "order"; | ||
37 | // 签到 | ||
38 | String SIGN = "sign"; | ||
39 | // 完善用户信息 | ||
40 | String COMPLETEMEMBERINFO = "complete_member_info"; | ||
41 | // 首次积分转移 | ||
42 | String FIRSTPOINTSTRANS = "first_points_transfer"; | ||
43 | // 微信分享 | ||
44 | String WECHATSHARE = "wechat_share"; | ||
45 | // 微信关注 | ||
46 | String SUBSCRIBE = "subscribe"; | ||
47 | // 成长报告 | ||
48 | String GROWTHREPORT = "growth_report"; | ||
49 | // 播放时长 | ||
50 | String PLAY = "play"; | ||
51 | // 大小屏绑定 | ||
52 | String BINDING = "binding"; | ||
53 | // 首次积分兑换 | ||
54 | String FIRSTPOINTSEXCHANGE = "first_point_exchange"; | ||
55 | // 添加收藏 | ||
56 | String ADDCOLLECTION = "add_collection"; | ||
57 | // 删除收藏 | ||
58 | String DELETECOLLECTION = "delete_collection"; | ||
59 | // 删除全部收藏 | ||
60 | String DELETEALLCOLLECTION = "deleteAll_collection"; | ||
29 | } | 61 | } | ... | ... |
1 | package com.topdraw.business.module.task.template.service.impl; | 1 | package com.topdraw.business.module.task.template.service.impl; |
2 | 2 | ||
3 | import com.topdraw.base.modules.utils.ValidationUtil; | ||
3 | import com.topdraw.business.module.task.template.domain.TaskTemplate; | 4 | import com.topdraw.business.module.task.template.domain.TaskTemplate; |
4 | import com.topdraw.business.module.task.template.domain.TaskTemplateBuilder; | 5 | import com.topdraw.business.module.task.template.domain.TaskTemplateBuilder; |
5 | import com.topdraw.utils.ValidationUtil; | ||
6 | import com.topdraw.business.module.task.template.repository.TaskTemplateRepository; | 6 | import com.topdraw.business.module.task.template.repository.TaskTemplateRepository; |
7 | import com.topdraw.business.module.task.template.service.TaskTemplateService; | 7 | import com.topdraw.business.module.task.template.service.TaskTemplateService; |
8 | import com.topdraw.business.module.task.template.service.dto.TaskTemplateDTO; | 8 | import com.topdraw.business.module.task.template.service.dto.TaskTemplateDTO; |
9 | import com.topdraw.business.module.task.template.service.mapper.TaskTemplateMapper; | 9 | import com.topdraw.business.module.task.template.service.mapper.TaskTemplateMapper; |
10 | import org.apache.commons.lang3.StringUtils; | ||
10 | import org.springframework.beans.factory.annotation.Autowired; | 11 | import org.springframework.beans.factory.annotation.Autowired; |
11 | import org.springframework.stereotype.Service; | 12 | import org.springframework.stereotype.Service; |
12 | import org.springframework.transaction.annotation.Propagation; | 13 | import org.springframework.transaction.annotation.Propagation; |
13 | import org.springframework.transaction.annotation.Transactional; | 14 | import org.springframework.transaction.annotation.Transactional; |
14 | import org.springframework.dao.EmptyResultDataAccessException; | 15 | import org.springframework.dao.EmptyResultDataAccessException; |
15 | import org.springframework.util.Assert; | 16 | import org.springframework.util.Assert; |
16 | import com.topdraw.utils.StringUtils; | ||
17 | 17 | ||
18 | import java.util.List; | 18 | import java.util.List; |
19 | import java.util.Objects; | 19 | import java.util.Objects; |
... | @@ -85,8 +85,7 @@ public class TaskTemplateServiceImpl implements TaskTemplateService { | ... | @@ -85,8 +85,7 @@ public class TaskTemplateServiceImpl implements TaskTemplateService { |
85 | 85 | ||
86 | @Override | 86 | @Override |
87 | public Long countByCodeAndType(TaskTemplate taskTemplate) { | 87 | public Long countByCodeAndType(TaskTemplate taskTemplate) { |
88 | Long count = this.taskTemplateRepository.countByCodeAndType(taskTemplate.getCode(), taskTemplate.getType()); | 88 | return this.taskTemplateRepository.countByCodeAndType(taskTemplate.getCode(), taskTemplate.getType()); |
89 | return count; | ||
90 | } | 89 | } |
91 | 90 | ||
92 | } | 91 | } | ... | ... |
1 | package com.topdraw.business.module.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.modules.base.BaseMapper; |
4 | import com.topdraw.business.module.task.template.domain.TaskTemplate; | 4 | import com.topdraw.business.module.task.template.domain.TaskTemplate; |
5 | import com.topdraw.business.module.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; | ... | ... |
... | @@ -22,7 +22,11 @@ public class UserAppBuilder { | ... | @@ -22,7 +22,11 @@ public class UserAppBuilder { |
22 | public static UserApp build(Long memberId, UserApp resource){ | 22 | public static UserApp build(Long memberId, UserApp resource){ |
23 | 23 | ||
24 | UserApp userApp = new UserApp(); | 24 | UserApp userApp = new UserApp(); |
25 | if (Objects.nonNull(resource.getId())) { | ||
26 | userApp.setId(resource.getId()); | ||
27 | } else { | ||
25 | userApp.setId(null); | 28 | userApp.setId(null); |
29 | } | ||
26 | userApp.setMemberId(memberId); | 30 | userApp.setMemberId(memberId); |
27 | userApp.setUsername(resource.getUsername()); | 31 | userApp.setUsername(resource.getUsername()); |
28 | userApp.setTags(resource.getTags()); | 32 | userApp.setTags(resource.getTags()); | ... | ... |
... | @@ -61,4 +61,7 @@ public interface UserAppRepository extends JpaRepository<UserApp, Long>, JpaSpec | ... | @@ -61,4 +61,7 @@ public interface UserAppRepository extends JpaRepository<UserApp, Long>, JpaSpec |
61 | " :#{#resources.gender}, NULL, now(), NULL, :#{#resources.tags}, " + | 61 | " :#{#resources.gender}, NULL, now(), NULL, :#{#resources.tags}, " + |
62 | " :#{#resources.description}, :#{#resources.createTime}, now());", nativeQuery = true) | 62 | " :#{#resources.description}, :#{#resources.createTime}, now());", nativeQuery = true) |
63 | void saveByIdManual(@Param("resources") UserAppIdManual userAppIdManual); | 63 | void saveByIdManual(@Param("resources") UserAppIdManual userAppIdManual); |
64 | |||
65 | Optional<UserApp> findByMemberId(Long memberId); | ||
66 | |||
64 | } | 67 | } | ... | ... |
1 | package com.topdraw.business.module.user.app.rest; | 1 | package com.topdraw.business.module.user.app.rest; |
2 | 2 | ||
3 | import com.topdraw.annotation.AnonymousAccess; | 3 | import com.topdraw.base.modules.annotation.AnonymousAccess; |
4 | import com.topdraw.base.modules.common.ResultInfo; | ||
4 | import com.topdraw.business.module.user.app.domain.UserApp; | 5 | import com.topdraw.business.module.user.app.domain.UserApp; |
5 | import com.topdraw.business.module.user.app.domain.UserAppBind; | 6 | import com.topdraw.business.module.user.app.domain.UserAppBind; |
6 | import com.topdraw.business.module.user.app.service.UserAppBindService; | 7 | import com.topdraw.business.module.user.app.service.UserAppBindService; |
... | @@ -10,8 +11,6 @@ import com.topdraw.business.module.vis.hainan.apple.domain.VisUserApple; | ... | @@ -10,8 +11,6 @@ import com.topdraw.business.module.vis.hainan.apple.domain.VisUserApple; |
10 | import com.topdraw.business.module.vis.hainan.qq.domain.VisUserQq; | 11 | import com.topdraw.business.module.vis.hainan.qq.domain.VisUserQq; |
11 | import com.topdraw.business.module.vis.hainan.weibo.domain.VisUserWeibo; | 12 | import com.topdraw.business.module.vis.hainan.weibo.domain.VisUserWeibo; |
12 | import com.topdraw.business.module.vis.hainan.weixin.domain.VisUserWeixin; | 13 | import com.topdraw.business.module.vis.hainan.weixin.domain.VisUserWeixin; |
13 | import com.topdraw.common.ResultInfo; | ||
14 | import com.topdraw.annotation.Log; | ||
15 | import com.topdraw.business.module.user.app.service.UserAppService; | 14 | import com.topdraw.business.module.user.app.service.UserAppService; |
16 | import lombok.extern.slf4j.Slf4j; | 15 | import lombok.extern.slf4j.Slf4j; |
17 | import org.apache.commons.lang3.StringUtils; | 16 | import org.apache.commons.lang3.StringUtils; |
... | @@ -37,7 +36,6 @@ public class UserAppController { | ... | @@ -37,7 +36,6 @@ public class UserAppController { |
37 | @Autowired | 36 | @Autowired |
38 | private UserAppBindService userAppBindService; | 37 | private UserAppBindService userAppBindService; |
39 | 38 | ||
40 | @Log | ||
41 | @PostMapping(value = "/saveAppAndBindApple4Vis") | 39 | @PostMapping(value = "/saveAppAndBindApple4Vis") |
42 | @ApiOperation("兼容海南app苹果数据") | 40 | @ApiOperation("兼容海南app苹果数据") |
43 | @AnonymousAccess | 41 | @AnonymousAccess |
... | @@ -53,7 +51,6 @@ public class UserAppController { | ... | @@ -53,7 +51,6 @@ public class UserAppController { |
53 | return this.userAppService.saveAppAndBindApple4Vis(resources); | 51 | return this.userAppService.saveAppAndBindApple4Vis(resources); |
54 | } | 52 | } |
55 | 53 | ||
56 | @Log | ||
57 | @PostMapping(value = "/saveAppAndBindWeibo4Vis") | 54 | @PostMapping(value = "/saveAppAndBindWeibo4Vis") |
58 | @ApiOperation("兼容海南app原微博数据") | 55 | @ApiOperation("兼容海南app原微博数据") |
59 | @AnonymousAccess | 56 | @AnonymousAccess |
... | @@ -69,7 +66,6 @@ public class UserAppController { | ... | @@ -69,7 +66,6 @@ public class UserAppController { |
69 | return this.userAppService.saveAppAndBindWeibo4Vis(resources); | 66 | return this.userAppService.saveAppAndBindWeibo4Vis(resources); |
70 | } | 67 | } |
71 | 68 | ||
72 | @Log | ||
73 | @PostMapping(value = "/saveAppAndBindQq4Vis") | 69 | @PostMapping(value = "/saveAppAndBindQq4Vis") |
74 | @ApiOperation("兼容海南app原QQ数据") | 70 | @ApiOperation("兼容海南app原QQ数据") |
75 | @AnonymousAccess | 71 | @AnonymousAccess |
... | @@ -85,7 +81,6 @@ public class UserAppController { | ... | @@ -85,7 +81,6 @@ public class UserAppController { |
85 | 81 | ||
86 | } | 82 | } |
87 | 83 | ||
88 | @Log | ||
89 | @PostMapping(value = "/saveAppAndBindWeixin4Vis") | 84 | @PostMapping(value = "/saveAppAndBindWeixin4Vis") |
90 | @ApiOperation("兼容海南app原微信数据") | 85 | @ApiOperation("兼容海南app原微信数据") |
91 | @AnonymousAccess | 86 | @AnonymousAccess |
... | @@ -108,7 +103,6 @@ public class UserAppController { | ... | @@ -108,7 +103,6 @@ public class UserAppController { |
108 | } | 103 | } |
109 | 104 | ||
110 | 105 | ||
111 | @Log | ||
112 | @PostMapping(value = "/updateAppLastActiveTimeAndNicknameAndHeadImgById") | 106 | @PostMapping(value = "/updateAppLastActiveTimeAndNicknameAndHeadImgById") |
113 | @ApiOperation("修改app账号最后登录时间、昵称和头像和用户名") | 107 | @ApiOperation("修改app账号最后登录时间、昵称和头像和用户名") |
114 | @AnonymousAccess | 108 | @AnonymousAccess |
... | @@ -127,11 +121,9 @@ public class UserAppController { | ... | @@ -127,11 +121,9 @@ public class UserAppController { |
127 | return ResultInfo.failure("修改app账号最后登录时间、昵称和头像和用户名失败,参数错误,app账号不得为空"); | 121 | return ResultInfo.failure("修改app账号最后登录时间、昵称和头像和用户名失败,参数错误,app账号不得为空"); |
128 | } | 122 | } |
129 | 123 | ||
130 | boolean result = this.userAppService.updateAppLastActiveTimeAndNicknameAndHeadImgById(resources); | 124 | return ResultInfo.success(this.userAppService.updateAppLastActiveTimeAndNicknameAndHeadImgById(resources)); |
131 | return ResultInfo.success(result); | ||
132 | } | 125 | } |
133 | 126 | ||
134 | @Log | ||
135 | @PostMapping(value = "/updateAppLastActiveTimeAndNicknameAndHeadImg") | 127 | @PostMapping(value = "/updateAppLastActiveTimeAndNicknameAndHeadImg") |
136 | @ApiOperation("修改app账号最后登录时间、昵称和头像") | 128 | @ApiOperation("修改app账号最后登录时间、昵称和头像") |
137 | @AnonymousAccess | 129 | @AnonymousAccess |
... | @@ -143,11 +135,9 @@ public class UserAppController { | ... | @@ -143,11 +135,9 @@ public class UserAppController { |
143 | return ResultInfo.failure("修改app账号密码失败,参数错误,app账号不得为空"); | 135 | return ResultInfo.failure("修改app账号密码失败,参数错误,app账号不得为空"); |
144 | } | 136 | } |
145 | 137 | ||
146 | boolean result = this.userAppService.updateAppLastActiveTimeAndNicknameAndHeadImg(resources); | 138 | return ResultInfo.success(this.userAppService.updateAppLastActiveTimeAndNicknameAndHeadImg(resources)); |
147 | return ResultInfo.success(result); | ||
148 | } | 139 | } |
149 | 140 | ||
150 | @Log | ||
151 | @PostMapping(value = "/updateAppPasswordByUsername") | 141 | @PostMapping(value = "/updateAppPasswordByUsername") |
152 | @ApiOperation("修改app账号密码") | 142 | @ApiOperation("修改app账号密码") |
153 | @AnonymousAccess | 143 | @AnonymousAccess |
... | @@ -171,11 +161,9 @@ public class UserAppController { | ... | @@ -171,11 +161,9 @@ public class UserAppController { |
171 | // return ResultInfo.failure("密码必须包含大小写字母和数字的组合,不能使用特殊字符,长度在 8-25 之间"); | 161 | // return ResultInfo.failure("密码必须包含大小写字母和数字的组合,不能使用特殊字符,长度在 8-25 之间"); |
172 | // } | 162 | // } |
173 | 163 | ||
174 | boolean result = this.userAppService.updatePasswordByUsername(resources); | 164 | return ResultInfo.success(this.userAppService.updatePasswordByUsername(resources)); |
175 | return ResultInfo.success(result); | ||
176 | } | 165 | } |
177 | 166 | ||
178 | @Log | ||
179 | @PostMapping(value = "/updateLastActiveTime") | 167 | @PostMapping(value = "/updateLastActiveTime") |
180 | @ApiOperation("修改app账号最新登录时间") | 168 | @ApiOperation("修改app账号最新登录时间") |
181 | @AnonymousAccess | 169 | @AnonymousAccess |
... | @@ -186,11 +174,9 @@ public class UserAppController { | ... | @@ -186,11 +174,9 @@ public class UserAppController { |
186 | log.error("修改app账号最新登录时间失败,参数错误,app账号不得为空,[updateLastActiveTime#{}]", resources); | 174 | log.error("修改app账号最新登录时间失败,参数错误,app账号不得为空,[updateLastActiveTime#{}]", resources); |
187 | return ResultInfo.failure("修改app账号最新登录时间失败,参数错误,app账号不得为空"); | 175 | return ResultInfo.failure("修改app账号最新登录时间失败,参数错误,app账号不得为空"); |
188 | } | 176 | } |
189 | boolean result = this.userAppService.updateLastActiveTime(resources); | 177 | return ResultInfo.success(this.userAppService.updateLastActiveTime(resources)); |
190 | return ResultInfo.success(result); | ||
191 | } | 178 | } |
192 | 179 | ||
193 | @Log | ||
194 | @PostMapping(value = "/saveThirdAccount") | 180 | @PostMapping(value = "/saveThirdAccount") |
195 | @ApiOperation("保存第三方账号") | 181 | @ApiOperation("保存第三方账号") |
196 | @AnonymousAccess | 182 | @AnonymousAccess |
... | @@ -208,11 +194,9 @@ public class UserAppController { | ... | @@ -208,11 +194,9 @@ public class UserAppController { |
208 | resources.setUserAppId(id); | 194 | resources.setUserAppId(id); |
209 | } | 195 | } |
210 | 196 | ||
211 | UserAppBindDTO userAppBindDTO = this.userAppBindService.create(resources); | 197 | return this.userAppBindService.create(resources); |
212 | return ResultInfo.success(userAppBindDTO); | ||
213 | } | 198 | } |
214 | 199 | ||
215 | @Log | ||
216 | @PostMapping(value = "/updateValidStatusAndUserAppIdAndNickname") | 200 | @PostMapping(value = "/updateValidStatusAndUserAppIdAndNickname") |
217 | @ApiOperation("修改第三方账号绑定状态、绑定的app账号以及第三方账号昵称") | 201 | @ApiOperation("修改第三方账号绑定状态、绑定的app账号以及第三方账号昵称") |
218 | @AnonymousAccess | 202 | @AnonymousAccess |
... | @@ -240,11 +224,9 @@ public class UserAppController { | ... | @@ -240,11 +224,9 @@ public class UserAppController { |
240 | return ResultInfo.failure("修改第三方账号, 参数错误, app账号不得为空"); | 224 | return ResultInfo.failure("修改第三方账号, 参数错误, app账号不得为空"); |
241 | } | 225 | } |
242 | 226 | ||
243 | boolean result = this.userAppBindService.updateValidStatusAndUserAppIdAndNickname(resources); | 227 | return ResultInfo.success(this.userAppBindService.updateValidStatusAndUserAppIdAndNickname(resources)); |
244 | return ResultInfo.success(result); | ||
245 | } | 228 | } |
246 | 229 | ||
247 | @Log | ||
248 | @PostMapping(value = "/updateThirdAccountNickname") | 230 | @PostMapping(value = "/updateThirdAccountNickname") |
249 | @ApiOperation("修改第三方账号昵称") | 231 | @ApiOperation("修改第三方账号昵称") |
250 | @AnonymousAccess | 232 | @AnonymousAccess |
... | @@ -263,7 +245,6 @@ public class UserAppController { | ... | @@ -263,7 +245,6 @@ public class UserAppController { |
263 | return ResultInfo.failure("修改第三方账号昵称, 参数错误, 昵称不得为空"); | 245 | return ResultInfo.failure("修改第三方账号昵称, 参数错误, 昵称不得为空"); |
264 | } | 246 | } |
265 | 247 | ||
266 | boolean result = this.userAppBindService.updateThirdAccountNickname(resources); | 248 | return ResultInfo.success(this.userAppBindService.updateThirdAccountNickname(resources)); |
267 | return ResultInfo.success(result); | ||
268 | } | 249 | } |
269 | } | 250 | } | ... | ... |
1 | package com.topdraw.business.module.user.app.service; | 1 | package com.topdraw.business.module.user.app.service; |
2 | 2 | ||
3 | import com.topdraw.base.modules.common.ResultInfo; | ||
3 | import com.topdraw.business.module.user.app.domain.UserAppBind; | 4 | import com.topdraw.business.module.user.app.domain.UserAppBind; |
4 | import com.topdraw.business.module.user.app.service.dto.UserAppBindDTO; | 5 | import com.topdraw.business.module.user.app.service.dto.UserAppBindDTO; |
5 | 6 | ||
... | @@ -22,7 +23,7 @@ public interface UserAppBindService { | ... | @@ -22,7 +23,7 @@ public interface UserAppBindService { |
22 | * | 23 | * |
23 | * @param resources | 24 | * @param resources |
24 | */ | 25 | */ |
25 | UserAppBindDTO create(UserAppBind resources); | 26 | ResultInfo create(UserAppBind resources); |
26 | 27 | ||
27 | /** | 28 | /** |
28 | * | 29 | * | ... | ... |
1 | package com.topdraw.business.module.user.app.service; | 1 | package com.topdraw.business.module.user.app.service; |
2 | 2 | ||
3 | import com.topdraw.base.modules.common.ResultInfo; | ||
3 | import com.topdraw.business.module.user.app.domain.UserApp; | 4 | import com.topdraw.business.module.user.app.domain.UserApp; |
4 | import com.topdraw.business.module.user.app.domain.UserAppBind; | 5 | import com.topdraw.business.module.user.app.domain.UserAppBind; |
5 | import com.topdraw.business.module.user.app.service.dto.UserAppDTO; | 6 | import com.topdraw.business.module.user.app.service.dto.UserAppDTO; |
... | @@ -8,7 +9,6 @@ import com.topdraw.business.module.vis.hainan.apple.domain.VisUserApple; | ... | @@ -8,7 +9,6 @@ import com.topdraw.business.module.vis.hainan.apple.domain.VisUserApple; |
8 | import com.topdraw.business.module.vis.hainan.qq.domain.VisUserQq; | 9 | import com.topdraw.business.module.vis.hainan.qq.domain.VisUserQq; |
9 | import com.topdraw.business.module.vis.hainan.weibo.domain.VisUserWeibo; | 10 | import com.topdraw.business.module.vis.hainan.weibo.domain.VisUserWeibo; |
10 | import com.topdraw.business.module.vis.hainan.weixin.domain.VisUserWeixin; | 11 | import com.topdraw.business.module.vis.hainan.weixin.domain.VisUserWeixin; |
11 | import com.topdraw.common.ResultInfo; | ||
12 | 12 | ||
13 | /** | 13 | /** |
14 | * @author XiangHan | 14 | * @author XiangHan |
... | @@ -92,4 +92,8 @@ public interface UserAppService { | ... | @@ -92,4 +92,8 @@ public interface UserAppService { |
92 | ResultInfo saveAppAndBindWeixin4Vis(VisUserWeixin resources); | 92 | ResultInfo saveAppAndBindWeixin4Vis(VisUserWeixin resources); |
93 | 93 | ||
94 | ResultInfo saveAppAndBindQq4Vis(VisUserQq resources); | 94 | ResultInfo saveAppAndBindQq4Vis(VisUserQq resources); |
95 | |||
96 | UserAppDTO findByMemberId(Long memberId); | ||
97 | |||
98 | UserAppDTO createByManual(UserApp userApp); | ||
95 | } | 99 | } | ... | ... |
1 | package com.topdraw.business.module.user.app.service.impl; | 1 | package com.topdraw.business.module.user.app.service.impl; |
2 | 2 | ||
3 | import com.topdraw.base.modules.common.ResultInfo; | ||
4 | import com.topdraw.base.modules.utils.ValidationUtil; | ||
3 | import com.topdraw.business.module.user.app.domain.UserAppBind; | 5 | import com.topdraw.business.module.user.app.domain.UserAppBind; |
4 | import com.topdraw.utils.ValidationUtil; | ||
5 | import com.topdraw.business.module.user.app.repository.UserAppBindRepository; | 6 | import com.topdraw.business.module.user.app.repository.UserAppBindRepository; |
6 | import com.topdraw.business.module.user.app.service.UserAppBindService; | 7 | import com.topdraw.business.module.user.app.service.UserAppBindService; |
7 | import com.topdraw.business.module.user.app.service.dto.UserAppBindDTO; | 8 | import com.topdraw.business.module.user.app.service.dto.UserAppBindDTO; |
8 | import com.topdraw.business.module.user.app.service.mapper.UserAppBindMapper; | 9 | import com.topdraw.business.module.user.app.service.mapper.UserAppBindMapper; |
10 | import lombok.extern.slf4j.Slf4j; | ||
9 | import org.springframework.beans.factory.annotation.Autowired; | 11 | import org.springframework.beans.factory.annotation.Autowired; |
10 | import org.springframework.stereotype.Service; | 12 | import org.springframework.stereotype.Service; |
11 | import org.springframework.transaction.annotation.Propagation; | 13 | import org.springframework.transaction.annotation.Propagation; |
... | @@ -14,6 +16,7 @@ import org.springframework.dao.EmptyResultDataAccessException; | ... | @@ -14,6 +16,7 @@ import org.springframework.dao.EmptyResultDataAccessException; |
14 | import org.springframework.util.Assert; | 16 | import org.springframework.util.Assert; |
15 | 17 | ||
16 | import java.util.List; | 18 | import java.util.List; |
19 | import java.util.Objects; | ||
17 | 20 | ||
18 | /** | 21 | /** |
19 | * @author XiangHan | 22 | * @author XiangHan |
... | @@ -21,6 +24,7 @@ import java.util.List; | ... | @@ -21,6 +24,7 @@ import java.util.List; |
21 | */ | 24 | */ |
22 | @Service | 25 | @Service |
23 | @Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class) | 26 | @Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class) |
27 | @Slf4j | ||
24 | public class UserAppBindServiceImpl implements UserAppBindService { | 28 | public class UserAppBindServiceImpl implements UserAppBindService { |
25 | 29 | ||
26 | @Autowired | 30 | @Autowired |
... | @@ -38,9 +42,15 @@ public class UserAppBindServiceImpl implements UserAppBindService { | ... | @@ -38,9 +42,15 @@ public class UserAppBindServiceImpl implements UserAppBindService { |
38 | 42 | ||
39 | @Override | 43 | @Override |
40 | @Transactional(rollbackFor = Exception.class) | 44 | @Transactional(rollbackFor = Exception.class) |
41 | public UserAppBindDTO create(UserAppBind resources) { | 45 | public ResultInfo create(UserAppBind resources) { |
46 | UserAppBindDTO userAppBindDTO = | ||
47 | this.findFirstByAccountAndAccountType(resources.getAccount(), resources.getAccountType()); | ||
48 | if (Objects.nonNull(userAppBindDTO.getId())) { | ||
49 | log.warn("保存第三方账号失败, saveThirdAccount# messgage ==>> 第三方账号已存在 | appBind ==>> {}", resources); | ||
50 | return ResultInfo.failure("保存第三方账号失败, 第三方账号已存在"); | ||
51 | } | ||
42 | UserAppBind userAppBind = this.userAppBindRepository.save(resources); | 52 | UserAppBind userAppBind = this.userAppBindRepository.save(resources); |
43 | return this.userAppBindMapper.toDto(userAppBind); | 53 | return ResultInfo.success(this.userAppBindMapper.toDto(userAppBind)); |
44 | } | 54 | } |
45 | 55 | ||
46 | @Override | 56 | @Override | ... | ... |
1 | package com.topdraw.business.module.user.app.service.impl; | 1 | package com.topdraw.business.module.user.app.service.impl; |
2 | 2 | ||
3 | import com.topdraw.aspect.AsyncMqSend; | 3 | import com.topdraw.aspect.AsyncMqSend; |
4 | import com.topdraw.base.modules.common.ResultInfo; | ||
5 | import com.topdraw.base.modules.utils.ValidationUtil; | ||
4 | import com.topdraw.business.module.member.domain.Member; | 6 | import com.topdraw.business.module.member.domain.Member; |
5 | import com.topdraw.business.module.member.domain.MemberBuilder; | 7 | import com.topdraw.business.module.member.domain.MemberBuilder; |
6 | import com.topdraw.business.module.member.domain.MemberTypeConstant; | 8 | import com.topdraw.business.module.member.domain.MemberTypeConstant; |
... | @@ -22,16 +24,14 @@ import com.topdraw.business.module.vis.hainan.apple.service.VisUserAppleService; | ... | @@ -22,16 +24,14 @@ import com.topdraw.business.module.vis.hainan.apple.service.VisUserAppleService; |
22 | import com.topdraw.business.module.vis.hainan.qq.domain.VisUserQq; | 24 | import com.topdraw.business.module.vis.hainan.qq.domain.VisUserQq; |
23 | import com.topdraw.business.module.vis.hainan.weibo.domain.VisUserWeibo; | 25 | import com.topdraw.business.module.vis.hainan.weibo.domain.VisUserWeibo; |
24 | import com.topdraw.business.module.vis.hainan.weixin.domain.VisUserWeixin; | 26 | import com.topdraw.business.module.vis.hainan.weixin.domain.VisUserWeixin; |
25 | import com.topdraw.common.ResultInfo; | ||
26 | import com.topdraw.util.Base64Util; | 27 | import com.topdraw.util.Base64Util; |
27 | import com.topdraw.util.TimestampUtil; | 28 | import com.topdraw.util.TimestampUtil; |
28 | import com.topdraw.utils.StringUtils; | ||
29 | import com.topdraw.utils.ValidationUtil; | ||
30 | import com.topdraw.business.module.user.app.repository.UserAppRepository; | 29 | import com.topdraw.business.module.user.app.repository.UserAppRepository; |
31 | import com.topdraw.business.module.user.app.service.UserAppService; | 30 | import com.topdraw.business.module.user.app.service.UserAppService; |
32 | import com.topdraw.business.module.user.app.service.dto.UserAppDTO; | 31 | import com.topdraw.business.module.user.app.service.dto.UserAppDTO; |
33 | import com.topdraw.business.module.user.app.service.mapper.UserAppMapper; | 32 | import com.topdraw.business.module.user.app.service.mapper.UserAppMapper; |
34 | import lombok.extern.slf4j.Slf4j; | 33 | import lombok.extern.slf4j.Slf4j; |
34 | import org.apache.commons.lang3.StringUtils; | ||
35 | import org.springframework.aop.framework.AopContext; | 35 | import org.springframework.aop.framework.AopContext; |
36 | import org.springframework.beans.BeanUtils; | 36 | import org.springframework.beans.BeanUtils; |
37 | import org.springframework.beans.factory.annotation.Autowired; | 37 | import org.springframework.beans.factory.annotation.Autowired; |
... | @@ -549,6 +549,21 @@ public class UserAppServiceImpl implements UserAppService { | ... | @@ -549,6 +549,21 @@ public class UserAppServiceImpl implements UserAppService { |
549 | return ResultInfo.failure(null); | 549 | return ResultInfo.failure(null); |
550 | } | 550 | } |
551 | 551 | ||
552 | @Override | ||
553 | @Transactional(readOnly = true) | ||
554 | public UserAppDTO findByMemberId(Long memberId) { | ||
555 | UserApp userApp = this.userAppRepository.findByMemberId(memberId).orElseGet(UserApp::new); | ||
556 | return this.userAppMapper.toDto(userApp); | ||
557 | } | ||
558 | |||
559 | @Override | ||
560 | @Transactional(rollbackFor = Exception.class) | ||
561 | public UserAppDTO createByManual(UserApp userApp) { | ||
562 | UserAppIdManual userAppIdManual = new UserAppIdManual(); | ||
563 | BeanUtils.copyProperties(userApp, userAppIdManual); | ||
564 | this.userAppRepository.saveByIdManual(userAppIdManual); | ||
565 | return this.userAppMapper.toDto(userApp); | ||
566 | } | ||
552 | 567 | ||
553 | 568 | ||
554 | @Override | 569 | @Override | ... | ... |
1 | package com.topdraw.business.module.user.app.service.mapper; | 1 | package com.topdraw.business.module.user.app.service.mapper; |
2 | 2 | ||
3 | import com.topdraw.base.BaseMapper; | 3 | import com.topdraw.base.modules.base.BaseMapper; |
4 | import com.topdraw.business.module.user.app.domain.UserAppBind; | 4 | import com.topdraw.business.module.user.app.domain.UserAppBind; |
5 | import com.topdraw.business.module.user.app.service.dto.UserAppBindDTO; | 5 | import com.topdraw.business.module.user.app.service.dto.UserAppBindDTO; |
6 | import org.mapstruct.Mapper; | 6 | import org.mapstruct.Mapper; | ... | ... |
1 | package com.topdraw.business.module.user.app.service.mapper; | 1 | package com.topdraw.business.module.user.app.service.mapper; |
2 | 2 | ||
3 | import com.topdraw.base.BaseMapper; | 3 | import com.topdraw.base.modules.base.BaseMapper; |
4 | import com.topdraw.business.module.user.app.domain.UserApp; | 4 | import com.topdraw.business.module.user.app.domain.UserApp; |
5 | import com.topdraw.business.module.user.app.service.dto.UserAppDTO; | 5 | import com.topdraw.business.module.user.app.service.dto.UserAppDTO; |
6 | import org.mapstruct.Mapper; | 6 | import org.mapstruct.Mapper; | ... | ... |
1 | package com.topdraw.business.module.user.app.service.mapper; | 1 | package com.topdraw.business.module.user.app.service.mapper; |
2 | 2 | ||
3 | import com.topdraw.base.BaseMapper; | 3 | import com.topdraw.base.modules.base.BaseMapper; |
4 | import com.topdraw.business.module.user.app.domain.UserApp; | ||
5 | import com.topdraw.business.module.user.app.domain.UserAppSimple; | 4 | import com.topdraw.business.module.user.app.domain.UserAppSimple; |
6 | import com.topdraw.business.module.user.app.service.dto.UserAppDTO; | ||
7 | import com.topdraw.business.module.user.app.service.dto.UserAppSimpleDTO; | 5 | import com.topdraw.business.module.user.app.service.dto.UserAppSimpleDTO; |
8 | import org.mapstruct.Mapper; | 6 | import org.mapstruct.Mapper; |
9 | import org.mapstruct.ReportingPolicy; | 7 | import org.mapstruct.ReportingPolicy; | ... | ... |
1 | package com.topdraw.business.module.user.iptv.domain; | 1 | package com.topdraw.business.module.user.iptv.domain; |
2 | 2 | ||
3 | import com.topdraw.business.module.member.domain.Member; | ||
4 | import com.topdraw.exception.BadRequestException; | ||
5 | import com.topdraw.exception.GlobeExceptionMsg; | 3 | import com.topdraw.exception.GlobeExceptionMsg; |
6 | import com.topdraw.util.TimestampUtil; | 4 | import com.topdraw.util.TimestampUtil; |
7 | import org.apache.commons.lang3.StringUtils; | 5 | import org.apache.commons.lang3.StringUtils; | ... | ... |
1 | package com.topdraw.business.module.user.iptv.growreport.rest; | 1 | package com.topdraw.business.module.user.iptv.growreport.rest; |
2 | 2 | ||
3 | import com.topdraw.common.ResultInfo; | 3 | import com.topdraw.common.ResultInfo; |
4 | import com.topdraw.annotation.Log; | ||
5 | import com.topdraw.business.module.user.iptv.growreport.domain.GrowthReport; | 4 | import com.topdraw.business.module.user.iptv.growreport.domain.GrowthReport; |
6 | import com.topdraw.business.module.user.iptv.growreport.service.GrowthReportService; | 5 | import com.topdraw.business.module.user.iptv.growreport.service.GrowthReportService; |
7 | import org.springframework.beans.factory.annotation.Autowired; | 6 | import org.springframework.beans.factory.annotation.Autowired; |
8 | import org.springframework.data.domain.Pageable; | ||
9 | import org.springframework.validation.annotation.Validated; | 7 | import org.springframework.validation.annotation.Validated; |
10 | import org.springframework.web.bind.annotation.*; | 8 | import org.springframework.web.bind.annotation.*; |
11 | import io.swagger.annotations.*; | 9 | import io.swagger.annotations.*; |
... | @@ -22,7 +20,6 @@ public class GrowthReportController { | ... | @@ -22,7 +20,6 @@ public class GrowthReportController { |
22 | @Autowired | 20 | @Autowired |
23 | private GrowthReportService GrowthReportService; | 21 | private GrowthReportService GrowthReportService; |
24 | 22 | ||
25 | @Log | ||
26 | @PostMapping | 23 | @PostMapping |
27 | @ApiOperation("新增GrowthReport") | 24 | @ApiOperation("新增GrowthReport") |
28 | public ResultInfo create(@Validated @RequestBody GrowthReport resources) { | 25 | public ResultInfo create(@Validated @RequestBody GrowthReport resources) { |
... | @@ -30,7 +27,6 @@ public class GrowthReportController { | ... | @@ -30,7 +27,6 @@ public class GrowthReportController { |
30 | return ResultInfo.success(); | 27 | return ResultInfo.success(); |
31 | } | 28 | } |
32 | 29 | ||
33 | @Log | ||
34 | @PutMapping | 30 | @PutMapping |
35 | @ApiOperation("修改GrowthReport") | 31 | @ApiOperation("修改GrowthReport") |
36 | public ResultInfo update(@Validated @RequestBody GrowthReport resources) { | 32 | public ResultInfo update(@Validated @RequestBody GrowthReport resources) { |
... | @@ -39,7 +35,6 @@ public class GrowthReportController { | ... | @@ -39,7 +35,6 @@ public class GrowthReportController { |
39 | } | 35 | } |
40 | 36 | ||
41 | 37 | ||
42 | @Log | ||
43 | @DeleteMapping(value = "/{id}") | 38 | @DeleteMapping(value = "/{id}") |
44 | @ApiOperation("删除GrowthReport") | 39 | @ApiOperation("删除GrowthReport") |
45 | public ResultInfo delete(@PathVariable Long id) { | 40 | public ResultInfo delete(@PathVariable Long id) { | ... | ... |
1 | package com.topdraw.business.module.user.iptv.growreport.service.impl; | 1 | package com.topdraw.business.module.user.iptv.growreport.service.impl; |
2 | 2 | ||
3 | import com.topdraw.base.modules.utils.ValidationUtil; | ||
3 | import com.topdraw.business.module.user.iptv.growreport.domain.GrowthReport; | 4 | import com.topdraw.business.module.user.iptv.growreport.domain.GrowthReport; |
4 | import com.topdraw.utils.ValidationUtil; | ||
5 | import com.topdraw.business.module.user.iptv.growreport.repository.GrowthReportRepository; | 5 | import com.topdraw.business.module.user.iptv.growreport.repository.GrowthReportRepository; |
6 | import com.topdraw.business.module.user.iptv.growreport.service.GrowthReportService; | 6 | import com.topdraw.business.module.user.iptv.growreport.service.GrowthReportService; |
7 | import com.topdraw.business.module.user.iptv.growreport.service.dto.GrowthReportDTO; | 7 | import com.topdraw.business.module.user.iptv.growreport.service.dto.GrowthReportDTO; |
... | @@ -13,14 +13,8 @@ import org.springframework.transaction.annotation.Transactional; | ... | @@ -13,14 +13,8 @@ import org.springframework.transaction.annotation.Transactional; |
13 | import org.springframework.dao.EmptyResultDataAccessException; | 13 | import org.springframework.dao.EmptyResultDataAccessException; |
14 | import cn.hutool.core.lang.Snowflake; | 14 | import cn.hutool.core.lang.Snowflake; |
15 | import cn.hutool.core.util.IdUtil; | 15 | import cn.hutool.core.util.IdUtil; |
16 | import org.springframework.data.domain.Page; | ||
17 | import org.springframework.data.domain.Pageable; | ||
18 | import org.springframework.util.Assert; | 16 | import org.springframework.util.Assert; |
19 | import com.topdraw.utils.PageUtil; | ||
20 | import com.topdraw.utils.QueryHelp; | ||
21 | 17 | ||
22 | import java.util.List; | ||
23 | import java.util.Map; | ||
24 | 18 | ||
25 | /** | 19 | /** |
26 | * @author XiangHan | 20 | * @author XiangHan | ... | ... |
1 | package com.topdraw.business.module.user.iptv.growreport.service.mapper; | 1 | package com.topdraw.business.module.user.iptv.growreport.service.mapper; |
2 | 2 | ||
3 | import com.topdraw.base.BaseMapper; | 3 | import com.topdraw.base.modules.base.BaseMapper; |
4 | import com.topdraw.business.module.user.iptv.growreport.domain.GrowthReport; | 4 | import com.topdraw.business.module.user.iptv.growreport.domain.GrowthReport; |
5 | import com.topdraw.business.module.user.iptv.growreport.service.dto.GrowthReportDTO; | 5 | import com.topdraw.business.module.user.iptv.growreport.service.dto.GrowthReportDTO; |
6 | import org.mapstruct.Mapper; | 6 | import org.mapstruct.Mapper; | ... | ... |
1 | package com.topdraw.business.module.user.iptv.rest; | 1 | package com.topdraw.business.module.user.iptv.rest; |
2 | 2 | ||
3 | import com.topdraw.annotation.AnonymousAccess; | 3 | import com.topdraw.base.modules.annotation.AnonymousAccess; |
4 | import com.topdraw.base.modules.common.ResultInfo; | ||
5 | import com.topdraw.base.modules.exception.BadRequestException; | ||
4 | import com.topdraw.business.module.user.iptv.domain.UserTv; | 6 | import com.topdraw.business.module.user.iptv.domain.UserTv; |
5 | import com.topdraw.business.module.user.iptv.service.UserTvService; | 7 | import com.topdraw.business.module.user.iptv.service.UserTvService; |
6 | import com.topdraw.business.module.user.iptv.service.dto.UserTvDTO; | 8 | import com.topdraw.business.module.user.iptv.service.dto.UserTvDTO; |
7 | import com.topdraw.common.ResultInfo; | ||
8 | import com.topdraw.exception.BadRequestException; | ||
9 | import com.topdraw.exception.GlobeExceptionMsg; | 9 | import com.topdraw.exception.GlobeExceptionMsg; |
10 | import io.swagger.annotations.Api; | 10 | import io.swagger.annotations.Api; |
11 | import io.swagger.annotations.ApiOperation; | 11 | import io.swagger.annotations.ApiOperation; | ... | ... |
... | @@ -3,6 +3,9 @@ package com.topdraw.business.module.user.iptv.service.impl; | ... | @@ -3,6 +3,9 @@ package com.topdraw.business.module.user.iptv.service.impl; |
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.aspect.AsyncMqSend; | 5 | import com.topdraw.aspect.AsyncMqSend; |
6 | import com.topdraw.base.modules.exception.EntityNotFoundException; | ||
7 | import com.topdraw.base.modules.utils.RedisUtils; | ||
8 | import com.topdraw.base.modules.utils.ValidationUtil; | ||
6 | import com.topdraw.business.module.member.service.MemberService; | 9 | import com.topdraw.business.module.member.service.MemberService; |
7 | import com.topdraw.business.module.member.service.dto.MemberDTO; | 10 | import com.topdraw.business.module.member.service.dto.MemberDTO; |
8 | import com.topdraw.business.module.user.iptv.domain.UserTv; | 11 | import com.topdraw.business.module.user.iptv.domain.UserTv; |
... | @@ -11,10 +14,7 @@ import com.topdraw.business.module.user.iptv.repository.UserTvSimpleRepository; | ... | @@ -11,10 +14,7 @@ import com.topdraw.business.module.user.iptv.repository.UserTvSimpleRepository; |
11 | import com.topdraw.business.module.user.iptv.service.dto.UserTvSimpleDTO; | 14 | import com.topdraw.business.module.user.iptv.service.dto.UserTvSimpleDTO; |
12 | import com.topdraw.business.module.user.iptv.service.mapper.UserTvSimpleMapper; | 15 | import com.topdraw.business.module.user.iptv.service.mapper.UserTvSimpleMapper; |
13 | import com.topdraw.business.RedisKeyConstants; | 16 | import com.topdraw.business.RedisKeyConstants; |
14 | import com.topdraw.exception.EntityNotFoundException; | ||
15 | import com.topdraw.exception.GlobeExceptionMsg; | 17 | import com.topdraw.exception.GlobeExceptionMsg; |
16 | import com.topdraw.utils.RedisUtils; | ||
17 | import com.topdraw.utils.ValidationUtil; | ||
18 | import com.topdraw.business.module.user.iptv.repository.UserTvRepository; | 18 | import com.topdraw.business.module.user.iptv.repository.UserTvRepository; |
19 | import com.topdraw.business.module.user.iptv.service.UserTvService; | 19 | import com.topdraw.business.module.user.iptv.service.UserTvService; |
20 | import com.topdraw.business.module.user.iptv.service.dto.UserTvDTO; | 20 | import com.topdraw.business.module.user.iptv.service.dto.UserTvDTO; | ... | ... |
1 | package com.topdraw.business.module.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.modules.base.BaseMapper; |
4 | import com.topdraw.business.module.user.iptv.domain.UserTv; | 4 | import com.topdraw.business.module.user.iptv.domain.UserTv; |
5 | import com.topdraw.business.module.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; | ... | ... |
1 | package com.topdraw.business.module.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.modules.base.BaseMapper; |
4 | import com.topdraw.business.module.user.iptv.domain.UserTv; | ||
5 | import com.topdraw.business.module.user.iptv.domain.UserTvSimple; | 4 | import com.topdraw.business.module.user.iptv.domain.UserTvSimple; |
6 | import com.topdraw.business.module.user.iptv.service.dto.UserTvSimpleDTO; | 5 | import com.topdraw.business.module.user.iptv.service.dto.UserTvSimpleDTO; |
7 | import org.mapstruct.Mapper; | 6 | import org.mapstruct.Mapper; | ... | ... |
1 | package com.topdraw.business.module.user.weixin.collection.service.impl; | 1 | package com.topdraw.business.module.user.weixin.collection.service.impl; |
2 | 2 | ||
3 | import com.topdraw.base.modules.utils.ValidationUtil; | ||
3 | import com.topdraw.business.module.user.weixin.collection.domain.UserCollectionDetail; | 4 | 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.repository.UserCollectionDetailRepository; |
5 | import com.topdraw.business.module.user.weixin.collection.service.UserCollectionDetailService; | 6 | 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.UserCollectionDetailDTO; |
7 | import com.topdraw.business.module.user.weixin.collection.service.mapper.UserCollectionDetailMapper; | 8 | import com.topdraw.business.module.user.weixin.collection.service.mapper.UserCollectionDetailMapper; |
8 | import com.topdraw.utils.*; | ||
9 | import org.springframework.beans.factory.annotation.Autowired; | 9 | import org.springframework.beans.factory.annotation.Autowired; |
10 | import org.springframework.dao.EmptyResultDataAccessException; | 10 | import org.springframework.dao.EmptyResultDataAccessException; |
11 | import org.springframework.stereotype.Service; | 11 | import org.springframework.stereotype.Service; | ... | ... |
1 | package com.topdraw.business.module.user.weixin.collection.service.impl; | 1 | package com.topdraw.business.module.user.weixin.collection.service.impl; |
2 | 2 | ||
3 | import com.topdraw.base.modules.utils.FileUtil; | ||
4 | import com.topdraw.base.modules.utils.ValidationUtil; | ||
3 | import com.topdraw.business.module.user.weixin.collection.domain.UserCollection; | 5 | import com.topdraw.business.module.user.weixin.collection.domain.UserCollection; |
4 | import com.topdraw.business.module.user.weixin.collection.repository.UserCollectionRepository; | 6 | import com.topdraw.business.module.user.weixin.collection.repository.UserCollectionRepository; |
5 | import com.topdraw.business.module.user.weixin.collection.service.UserCollectionService; | 7 | import com.topdraw.business.module.user.weixin.collection.service.UserCollectionService; |
6 | import com.topdraw.business.module.user.weixin.collection.service.dto.UserCollectionDTO; | 8 | import com.topdraw.business.module.user.weixin.collection.service.dto.UserCollectionDTO; |
7 | import com.topdraw.business.module.user.weixin.collection.service.mapper.UserCollectionMapper; | 9 | import com.topdraw.business.module.user.weixin.collection.service.mapper.UserCollectionMapper; |
8 | import com.topdraw.utils.FileUtil; | ||
9 | import com.topdraw.utils.ValidationUtil; | ||
10 | import org.springframework.beans.factory.annotation.Autowired; | 10 | import org.springframework.beans.factory.annotation.Autowired; |
11 | import org.springframework.dao.EmptyResultDataAccessException; | 11 | import org.springframework.dao.EmptyResultDataAccessException; |
12 | import org.springframework.stereotype.Service; | 12 | import org.springframework.stereotype.Service; | ... | ... |
1 | package com.topdraw.business.module.user.weixin.collection.service.mapper; | 1 | package com.topdraw.business.module.user.weixin.collection.service.mapper; |
2 | 2 | ||
3 | import com.topdraw.base.BaseMapper; | 3 | import com.topdraw.base.modules.base.BaseMapper; |
4 | import com.topdraw.business.module.user.weixin.collection.domain.UserCollectionDetail; | 4 | import com.topdraw.business.module.user.weixin.collection.domain.UserCollectionDetail; |
5 | import com.topdraw.business.module.user.weixin.collection.service.dto.UserCollectionDetailDTO; | 5 | import com.topdraw.business.module.user.weixin.collection.service.dto.UserCollectionDetailDTO; |
6 | import org.mapstruct.Mapper; | 6 | import org.mapstruct.Mapper; | ... | ... |
1 | package com.topdraw.business.module.user.weixin.collection.service.mapper; | 1 | package com.topdraw.business.module.user.weixin.collection.service.mapper; |
2 | 2 | ||
3 | import com.topdraw.base.BaseMapper; | 3 | import com.topdraw.base.modules.base.BaseMapper; |
4 | import com.topdraw.business.module.user.weixin.collection.domain.UserCollection; | 4 | import com.topdraw.business.module.user.weixin.collection.domain.UserCollection; |
5 | import com.topdraw.business.module.user.weixin.collection.service.dto.UserCollectionDTO; | 5 | import com.topdraw.business.module.user.weixin.collection.service.dto.UserCollectionDTO; |
6 | import org.mapstruct.Mapper; | 6 | import org.mapstruct.Mapper; | ... | ... |
1 | package com.topdraw.business.module.user.weixin.domain; | 1 | package com.topdraw.business.module.user.weixin.domain; |
2 | 2 | ||
3 | import com.topdraw.base.modules.exception.BadRequestException; | ||
3 | import com.topdraw.business.module.member.domain.Member; | 4 | import com.topdraw.business.module.member.domain.Member; |
4 | import com.topdraw.exception.BadRequestException; | ||
5 | import com.topdraw.exception.GlobeExceptionMsg; | 5 | import com.topdraw.exception.GlobeExceptionMsg; |
6 | import com.topdraw.util.TimestampUtil; | ||
7 | import org.apache.commons.lang3.StringUtils; | 6 | import org.apache.commons.lang3.StringUtils; |
8 | 7 | ||
9 | import java.sql.Timestamp; | 8 | import java.sql.Timestamp; | ... | ... |
1 | package com.topdraw.business.module.user.weixin.rest; | 1 | package com.topdraw.business.module.user.weixin.rest; |
2 | 2 | ||
3 | import com.topdraw.annotation.AnonymousAccess; | 3 | import com.topdraw.base.modules.annotation.AnonymousAccess; |
4 | import com.topdraw.common.ResultInfo; | 4 | import com.topdraw.base.modules.common.ResultInfo; |
5 | import com.topdraw.business.module.user.weixin.domain.UserWeixin; | 5 | import com.topdraw.business.module.user.weixin.domain.UserWeixin; |
6 | import com.topdraw.business.module.user.weixin.service.UserWeixinService; | 6 | import com.topdraw.business.module.user.weixin.service.UserWeixinService; |
7 | import org.springframework.beans.factory.annotation.Autowired; | 7 | import org.springframework.beans.factory.annotation.Autowired; | ... | ... |
1 | package com.topdraw.business.module.user.weixin.service.impl; | 1 | package com.topdraw.business.module.user.weixin.service.impl; |
2 | 2 | ||
3 | import com.topdraw.base.modules.utils.ValidationUtil; | ||
3 | import com.topdraw.business.module.user.weixin.domain.UserWeixin; | 4 | import com.topdraw.business.module.user.weixin.domain.UserWeixin; |
4 | import com.topdraw.business.module.user.weixin.domain.UserWeixinBuilder; | 5 | import com.topdraw.business.module.user.weixin.domain.UserWeixinBuilder; |
5 | import com.topdraw.utils.ValidationUtil; | ||
6 | import com.topdraw.business.module.user.weixin.repository.UserWeixinRepository; | 6 | import com.topdraw.business.module.user.weixin.repository.UserWeixinRepository; |
7 | import com.topdraw.business.module.user.weixin.service.UserWeixinService; | 7 | import com.topdraw.business.module.user.weixin.service.UserWeixinService; |
8 | import com.topdraw.business.module.user.weixin.service.dto.UserWeixinDTO; | 8 | import com.topdraw.business.module.user.weixin.service.dto.UserWeixinDTO; | ... | ... |
1 | package com.topdraw.business.module.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.modules.base.BaseMapper; |
4 | import com.topdraw.business.module.user.weixin.domain.UserWeixin; | 4 | import com.topdraw.business.module.user.weixin.domain.UserWeixin; |
5 | import com.topdraw.business.module.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; | ... | ... |
1 | package com.topdraw.business.module.user.weixin.subscribe.service.mapper; | 1 | package com.topdraw.business.module.user.weixin.subscribe.service.mapper; |
2 | 2 | ||
3 | import com.topdraw.base.BaseMapper; | 3 | import com.topdraw.base.modules.base.BaseMapper; |
4 | import com.topdraw.business.module.user.weixin.subscribe.domain.WechatSubscribeRecord; | 4 | import com.topdraw.business.module.user.weixin.subscribe.domain.WechatSubscribeRecord; |
5 | import com.topdraw.business.module.user.weixin.subscribe.service.dto.WechatSubscribeRecordDTO; | 5 | import com.topdraw.business.module.user.weixin.subscribe.service.dto.WechatSubscribeRecordDTO; |
6 | import org.mapstruct.Mapper; | 6 | import org.mapstruct.Mapper; | ... | ... |
... | @@ -2,7 +2,6 @@ package com.topdraw.business.module.user.weixin.wechatshare.rest; | ... | @@ -2,7 +2,6 @@ package com.topdraw.business.module.user.weixin.wechatshare.rest; |
2 | 2 | ||
3 | import com.alibaba.fastjson.JSONObject; | 3 | import com.alibaba.fastjson.JSONObject; |
4 | import com.topdraw.common.ResultInfo; | 4 | import com.topdraw.common.ResultInfo; |
5 | import com.topdraw.annotation.Log; | ||
6 | import com.topdraw.business.module.user.weixin.wechatshare.domain.WechatShareRecord; | 5 | import com.topdraw.business.module.user.weixin.wechatshare.domain.WechatShareRecord; |
7 | import com.topdraw.business.module.user.weixin.wechatshare.service.WechatShareRecordService; | 6 | import com.topdraw.business.module.user.weixin.wechatshare.service.WechatShareRecordService; |
8 | import lombok.extern.slf4j.Slf4j; | 7 | import lombok.extern.slf4j.Slf4j; |
... | @@ -24,7 +23,6 @@ public class WechatShareRecordController { | ... | @@ -24,7 +23,6 @@ public class WechatShareRecordController { |
24 | @Autowired | 23 | @Autowired |
25 | private WechatShareRecordService wechatShareRecordService; | 24 | private WechatShareRecordService wechatShareRecordService; |
26 | 25 | ||
27 | @Log | ||
28 | @PostMapping(value = "/create") | 26 | @PostMapping(value = "/create") |
29 | @ApiOperation("新增WechatShareRecord") | 27 | @ApiOperation("新增WechatShareRecord") |
30 | public ResultInfo create(@Validated @RequestBody WechatShareRecord resources) { | 28 | public ResultInfo create(@Validated @RequestBody WechatShareRecord resources) { |
... | @@ -32,7 +30,6 @@ public class WechatShareRecordController { | ... | @@ -32,7 +30,6 @@ public class WechatShareRecordController { |
32 | return ResultInfo.success(); | 30 | return ResultInfo.success(); |
33 | } | 31 | } |
34 | 32 | ||
35 | @Log | ||
36 | @PostMapping(value = "/update") | 33 | @PostMapping(value = "/update") |
37 | @ApiOperation("修改WechatShareRecord") | 34 | @ApiOperation("修改WechatShareRecord") |
38 | public ResultInfo update(@Validated @RequestBody WechatShareRecord resources) { | 35 | public ResultInfo update(@Validated @RequestBody WechatShareRecord resources) { |
... | @@ -40,7 +37,6 @@ public class WechatShareRecordController { | ... | @@ -40,7 +37,6 @@ public class WechatShareRecordController { |
40 | return ResultInfo.success(); | 37 | return ResultInfo.success(); |
41 | } | 38 | } |
42 | 39 | ||
43 | @Log | ||
44 | @PostMapping(value = "/createOrUpdate") | 40 | @PostMapping(value = "/createOrUpdate") |
45 | @ApiOperation("修改WechatShareRecord") | 41 | @ApiOperation("修改WechatShareRecord") |
46 | public ResultInfo createOrUpdate(@Validated @RequestBody String content) { | 42 | public ResultInfo createOrUpdate(@Validated @RequestBody String content) { | ... | ... |
1 | package com.topdraw.business.module.user.weixin.wechatshare.service.impl; | 1 | package com.topdraw.business.module.user.weixin.wechatshare.service.impl; |
2 | 2 | ||
3 | import com.topdraw.base.modules.utils.ValidationUtil; | ||
3 | import com.topdraw.business.module.user.weixin.wechatshare.domain.WechatShareRecord; | 4 | import com.topdraw.business.module.user.weixin.wechatshare.domain.WechatShareRecord; |
4 | import com.topdraw.util.IdWorker; | 5 | import com.topdraw.util.IdWorker; |
5 | import com.topdraw.utils.ValidationUtil; | ||
6 | import com.topdraw.business.module.user.weixin.wechatshare.repository.WechatShareRecordRepository; | 6 | import com.topdraw.business.module.user.weixin.wechatshare.repository.WechatShareRecordRepository; |
7 | import com.topdraw.business.module.user.weixin.wechatshare.service.WechatShareRecordService; | 7 | import com.topdraw.business.module.user.weixin.wechatshare.service.WechatShareRecordService; |
8 | import com.topdraw.business.module.user.weixin.wechatshare.service.dto.WechatShareRecordDTO; | 8 | import com.topdraw.business.module.user.weixin.wechatshare.service.dto.WechatShareRecordDTO; |
9 | import com.topdraw.business.module.user.weixin.wechatshare.service.mapper.WechatShareRecordMapper; | 9 | import com.topdraw.business.module.user.weixin.wechatshare.service.mapper.WechatShareRecordMapper; |
10 | import org.apache.commons.lang3.StringUtils; | ||
10 | import org.springframework.beans.factory.annotation.Autowired; | 11 | import org.springframework.beans.factory.annotation.Autowired; |
11 | import org.springframework.stereotype.Service; | 12 | import org.springframework.stereotype.Service; |
12 | import org.springframework.transaction.annotation.Propagation; | 13 | import org.springframework.transaction.annotation.Propagation; |
13 | import org.springframework.transaction.annotation.Transactional; | 14 | import org.springframework.transaction.annotation.Transactional; |
14 | import com.topdraw.utils.StringUtils; | ||
15 | 15 | ||
16 | import java.util.*; | 16 | import java.util.*; |
17 | 17 | ... | ... |
1 | package com.topdraw.business.module.user.weixin.wechatshare.service.mapper; | 1 | package com.topdraw.business.module.user.weixin.wechatshare.service.mapper; |
2 | 2 | ||
3 | import com.topdraw.base.BaseMapper; | 3 | import com.topdraw.base.modules.base.BaseMapper; |
4 | import com.topdraw.business.module.user.weixin.wechatshare.domain.WechatShareRecord; | 4 | import com.topdraw.business.module.user.weixin.wechatshare.domain.WechatShareRecord; |
5 | import com.topdraw.business.module.user.weixin.wechatshare.service.dto.WechatShareRecordDTO; | 5 | import com.topdraw.business.module.user.weixin.wechatshare.service.dto.WechatShareRecordDTO; |
6 | import org.mapstruct.Mapper; | 6 | import org.mapstruct.Mapper; | ... | ... |
1 | package com.topdraw.business.module.vis.hainan.app.service.impl; | 1 | package com.topdraw.business.module.vis.hainan.app.service.impl; |
2 | 2 | ||
3 | import com.topdraw.base.modules.utils.ValidationUtil; | ||
3 | import com.topdraw.business.module.vis.hainan.app.domain.VisUser; | 4 | import com.topdraw.business.module.vis.hainan.app.domain.VisUser; |
4 | import com.topdraw.business.module.vis.hainan.app.repository.VisUserRepository; | 5 | import com.topdraw.business.module.vis.hainan.app.repository.VisUserRepository; |
5 | import com.topdraw.business.module.vis.hainan.app.service.VisUserService; | 6 | import com.topdraw.business.module.vis.hainan.app.service.VisUserService; |
6 | import com.topdraw.business.module.vis.hainan.app.service.dto.VisUserDTO; | 7 | import com.topdraw.business.module.vis.hainan.app.service.dto.VisUserDTO; |
7 | import com.topdraw.business.module.vis.hainan.app.service.mapper.VisUserMapper; | 8 | import com.topdraw.business.module.vis.hainan.app.service.mapper.VisUserMapper; |
8 | import com.topdraw.utils.ValidationUtil; | ||
9 | import org.springframework.beans.factory.annotation.Autowired; | 9 | import org.springframework.beans.factory.annotation.Autowired; |
10 | import org.springframework.stereotype.Service; | 10 | import org.springframework.stereotype.Service; |
11 | import org.springframework.transaction.annotation.Propagation; | 11 | import org.springframework.transaction.annotation.Propagation; | ... | ... |
1 | package com.topdraw.business.module.vis.hainan.app.service.mapper; | 1 | package com.topdraw.business.module.vis.hainan.app.service.mapper; |
2 | 2 | ||
3 | import com.topdraw.base.BaseMapper; | 3 | import com.topdraw.base.modules.base.BaseMapper; |
4 | import com.topdraw.business.module.vis.hainan.app.domain.VisUser; | 4 | import com.topdraw.business.module.vis.hainan.app.domain.VisUser; |
5 | import com.topdraw.business.module.vis.hainan.app.service.dto.VisUserDTO; | 5 | import com.topdraw.business.module.vis.hainan.app.service.dto.VisUserDTO; |
6 | import org.mapstruct.Mapper; | 6 | import org.mapstruct.Mapper; | ... | ... |
1 | package com.topdraw.business.module.vis.hainan.apple.service.impl; | 1 | package com.topdraw.business.module.vis.hainan.apple.service.impl; |
2 | 2 | ||
3 | import com.topdraw.base.modules.utils.ValidationUtil; | ||
3 | import com.topdraw.business.module.vis.hainan.apple.domain.VisUserApple; | 4 | import com.topdraw.business.module.vis.hainan.apple.domain.VisUserApple; |
4 | import com.topdraw.business.module.vis.hainan.apple.repository.VisUserAppleRepository; | 5 | import com.topdraw.business.module.vis.hainan.apple.repository.VisUserAppleRepository; |
5 | import com.topdraw.business.module.vis.hainan.apple.service.VisUserAppleService; | 6 | import com.topdraw.business.module.vis.hainan.apple.service.VisUserAppleService; |
6 | import com.topdraw.business.module.vis.hainan.apple.service.dto.VisUserAppleDTO; | 7 | import com.topdraw.business.module.vis.hainan.apple.service.dto.VisUserAppleDTO; |
7 | import com.topdraw.business.module.vis.hainan.apple.service.mapper.VisUserAppleMapper; | 8 | import com.topdraw.business.module.vis.hainan.apple.service.mapper.VisUserAppleMapper; |
8 | import com.topdraw.utils.ValidationUtil; | ||
9 | import org.springframework.beans.factory.annotation.Autowired; | 9 | import org.springframework.beans.factory.annotation.Autowired; |
10 | import org.springframework.stereotype.Service; | 10 | import org.springframework.stereotype.Service; |
11 | import org.springframework.transaction.annotation.Propagation; | 11 | import org.springframework.transaction.annotation.Propagation; | ... | ... |
1 | package com.topdraw.business.module.vis.hainan.apple.service.mapper; | 1 | package com.topdraw.business.module.vis.hainan.apple.service.mapper; |
2 | 2 | ||
3 | import com.topdraw.base.BaseMapper; | 3 | import com.topdraw.base.modules.base.BaseMapper; |
4 | import com.topdraw.business.module.vis.hainan.apple.domain.VisUserApple; | 4 | import com.topdraw.business.module.vis.hainan.apple.domain.VisUserApple; |
5 | import com.topdraw.business.module.vis.hainan.apple.service.dto.VisUserAppleDTO; | 5 | import com.topdraw.business.module.vis.hainan.apple.service.dto.VisUserAppleDTO; |
6 | import org.mapstruct.Mapper; | 6 | import org.mapstruct.Mapper; | ... | ... |
1 | package com.topdraw.business.module.vis.hainan.qq.service.impl; | 1 | package com.topdraw.business.module.vis.hainan.qq.service.impl; |
2 | 2 | ||
3 | import com.topdraw.base.modules.utils.ValidationUtil; | ||
3 | import com.topdraw.business.module.vis.hainan.qq.domain.VisUserQq; | 4 | import com.topdraw.business.module.vis.hainan.qq.domain.VisUserQq; |
4 | import com.topdraw.business.module.vis.hainan.qq.repository.VisUserQqRepository; | 5 | import com.topdraw.business.module.vis.hainan.qq.repository.VisUserQqRepository; |
5 | import com.topdraw.business.module.vis.hainan.qq.service.VisUserQqService; | 6 | import com.topdraw.business.module.vis.hainan.qq.service.VisUserQqService; |
6 | import com.topdraw.business.module.vis.hainan.qq.service.dto.VisUserQqDTO; | 7 | import com.topdraw.business.module.vis.hainan.qq.service.dto.VisUserQqDTO; |
7 | import com.topdraw.business.module.vis.hainan.qq.service.mapper.VisUserQqMapper; | 8 | import com.topdraw.business.module.vis.hainan.qq.service.mapper.VisUserQqMapper; |
8 | import com.topdraw.utils.ValidationUtil; | ||
9 | import org.springframework.beans.factory.annotation.Autowired; | 9 | import org.springframework.beans.factory.annotation.Autowired; |
10 | import org.springframework.stereotype.Service; | 10 | import org.springframework.stereotype.Service; |
11 | import org.springframework.transaction.annotation.Propagation; | 11 | import org.springframework.transaction.annotation.Propagation; | ... | ... |
1 | package com.topdraw.business.module.vis.hainan.qq.service.mapper; | 1 | package com.topdraw.business.module.vis.hainan.qq.service.mapper; |
2 | 2 | ||
3 | import com.topdraw.base.BaseMapper; | 3 | import com.topdraw.base.modules.base.BaseMapper; |
4 | import com.topdraw.business.module.vis.hainan.qq.domain.VisUserQq; | 4 | import com.topdraw.business.module.vis.hainan.qq.domain.VisUserQq; |
5 | import com.topdraw.business.module.vis.hainan.qq.service.dto.VisUserQqDTO; | 5 | import com.topdraw.business.module.vis.hainan.qq.service.dto.VisUserQqDTO; |
6 | import org.mapstruct.Mapper; | 6 | import org.mapstruct.Mapper; | ... | ... |
1 | package com.topdraw.business.module.vis.hainan.weibo.service.impl; | 1 | package com.topdraw.business.module.vis.hainan.weibo.service.impl; |
2 | 2 | ||
3 | import com.topdraw.base.modules.utils.ValidationUtil; | ||
3 | import com.topdraw.business.module.vis.hainan.weibo.domain.VisUserWeibo; | 4 | import com.topdraw.business.module.vis.hainan.weibo.domain.VisUserWeibo; |
4 | import com.topdraw.business.module.vis.hainan.weibo.repository.VisUserWeiboRepository; | 5 | import com.topdraw.business.module.vis.hainan.weibo.repository.VisUserWeiboRepository; |
5 | import com.topdraw.business.module.vis.hainan.weibo.service.VisUserWeiboService; | 6 | import com.topdraw.business.module.vis.hainan.weibo.service.VisUserWeiboService; |
6 | import com.topdraw.business.module.vis.hainan.weibo.service.dto.VisUserWeiboDTO; | 7 | import com.topdraw.business.module.vis.hainan.weibo.service.dto.VisUserWeiboDTO; |
7 | import com.topdraw.business.module.vis.hainan.weibo.service.mapper.VisUserWeiboMapper; | 8 | import com.topdraw.business.module.vis.hainan.weibo.service.mapper.VisUserWeiboMapper; |
8 | import com.topdraw.utils.ValidationUtil; | ||
9 | import org.springframework.beans.factory.annotation.Autowired; | 9 | import org.springframework.beans.factory.annotation.Autowired; |
10 | import org.springframework.stereotype.Service; | 10 | import org.springframework.stereotype.Service; |
11 | import org.springframework.transaction.annotation.Propagation; | 11 | import org.springframework.transaction.annotation.Propagation; | ... | ... |
1 | package com.topdraw.business.module.vis.hainan.weibo.service.mapper; | 1 | package com.topdraw.business.module.vis.hainan.weibo.service.mapper; |
2 | 2 | ||
3 | import com.topdraw.base.BaseMapper; | 3 | import com.topdraw.base.modules.base.BaseMapper; |
4 | import com.topdraw.business.module.vis.hainan.weibo.domain.VisUserWeibo; | 4 | import com.topdraw.business.module.vis.hainan.weibo.domain.VisUserWeibo; |
5 | import com.topdraw.business.module.vis.hainan.weibo.service.dto.VisUserWeiboDTO; | 5 | import com.topdraw.business.module.vis.hainan.weibo.service.dto.VisUserWeiboDTO; |
6 | import org.mapstruct.Mapper; | 6 | import org.mapstruct.Mapper; | ... | ... |
1 | package com.topdraw.business.module.vis.hainan.weixin.service.impl; | 1 | package com.topdraw.business.module.vis.hainan.weixin.service.impl; |
2 | 2 | ||
3 | import com.topdraw.base.modules.utils.ValidationUtil; | ||
3 | import com.topdraw.business.module.vis.hainan.weixin.domain.VisUserWeixin; | 4 | import com.topdraw.business.module.vis.hainan.weixin.domain.VisUserWeixin; |
4 | import com.topdraw.business.module.vis.hainan.weixin.repository.VisUserWeixinRepository; | 5 | import com.topdraw.business.module.vis.hainan.weixin.repository.VisUserWeixinRepository; |
5 | import com.topdraw.business.module.vis.hainan.weixin.service.VisUserWeixinService; | 6 | import com.topdraw.business.module.vis.hainan.weixin.service.VisUserWeixinService; |
6 | import com.topdraw.business.module.vis.hainan.weixin.service.dto.VisUserWeixinDTO; | 7 | import com.topdraw.business.module.vis.hainan.weixin.service.dto.VisUserWeixinDTO; |
7 | import com.topdraw.business.module.vis.hainan.weixin.service.mapper.VisUserWeixinMapper; | 8 | import com.topdraw.business.module.vis.hainan.weixin.service.mapper.VisUserWeixinMapper; |
8 | import com.topdraw.utils.ValidationUtil; | ||
9 | import org.springframework.beans.factory.annotation.Autowired; | 9 | import org.springframework.beans.factory.annotation.Autowired; |
10 | import org.springframework.stereotype.Service; | 10 | import org.springframework.stereotype.Service; |
11 | import org.springframework.transaction.annotation.Propagation; | 11 | import org.springframework.transaction.annotation.Propagation; | ... | ... |
1 | package com.topdraw.business.module.vis.hainan.weixin.service.mapper; | 1 | package com.topdraw.business.module.vis.hainan.weixin.service.mapper; |
2 | 2 | ||
3 | import com.topdraw.base.BaseMapper; | 3 | import com.topdraw.base.modules.base.BaseMapper; |
4 | import com.topdraw.business.module.vis.hainan.weixin.domain.VisUserWeixin; | 4 | import com.topdraw.business.module.vis.hainan.weixin.domain.VisUserWeixin; |
5 | import com.topdraw.business.module.vis.hainan.weixin.service.dto.VisUserWeixinDTO; | 5 | import com.topdraw.business.module.vis.hainan.weixin.service.dto.VisUserWeixinDTO; |
6 | import org.mapstruct.Mapper; | 6 | import org.mapstruct.Mapper; | ... | ... |
... | @@ -2,7 +2,7 @@ package com.topdraw.business.process.domian.weixin; | ... | @@ -2,7 +2,7 @@ package com.topdraw.business.process.domian.weixin; |
2 | 2 | ||
3 | 3 | ||
4 | import com.alibaba.fastjson.annotation.JSONField; | 4 | import com.alibaba.fastjson.annotation.JSONField; |
5 | import com.topdraw.annotation.Query; | 5 | import com.topdraw.base.modules.annotation.Query; |
6 | import lombok.Data; | 6 | import lombok.Data; |
7 | 7 | ||
8 | import java.sql.Timestamp; | 8 | import java.sql.Timestamp; | ... | ... |
1 | package com.topdraw.business.process.rest; | 1 | package com.topdraw.business.process.rest; |
2 | 2 | ||
3 | import com.topdraw.base.modules.common.ResultInfo; | ||
3 | import com.topdraw.business.process.domian.TempCoupon; | 4 | import com.topdraw.business.process.domian.TempCoupon; |
4 | import com.topdraw.business.process.service.CouponOperationService; | 5 | import com.topdraw.business.process.service.CouponOperationService; |
5 | import com.topdraw.common.ResultInfo; | ||
6 | import io.swagger.annotations.Api; | 6 | import io.swagger.annotations.Api; |
7 | import io.swagger.annotations.ApiOperation; | 7 | import io.swagger.annotations.ApiOperation; |
8 | import org.springframework.beans.factory.annotation.Autowired; | 8 | import org.springframework.beans.factory.annotation.Autowired; | ... | ... |
1 | package com.topdraw.business.process.rest; | 1 | package com.topdraw.business.process.rest; |
2 | 2 | ||
3 | import com.topdraw.base.modules.common.ResultInfo; | ||
3 | import com.topdraw.business.process.domian.TempExp; | 4 | import com.topdraw.business.process.domian.TempExp; |
4 | import com.topdraw.business.process.service.ExpOperationService; | 5 | import com.topdraw.business.process.service.ExpOperationService; |
5 | import com.topdraw.common.ResultInfo; | ||
6 | import io.swagger.annotations.Api; | 6 | import io.swagger.annotations.Api; |
7 | import io.swagger.annotations.ApiOperation; | 7 | import io.swagger.annotations.ApiOperation; |
8 | import lombok.extern.slf4j.Slf4j; | 8 | import lombok.extern.slf4j.Slf4j; |
... | @@ -13,9 +13,7 @@ import org.springframework.web.bind.annotation.RequestBody; | ... | @@ -13,9 +13,7 @@ import org.springframework.web.bind.annotation.RequestBody; |
13 | import org.springframework.web.bind.annotation.RequestMapping; | 13 | import org.springframework.web.bind.annotation.RequestMapping; |
14 | import org.springframework.web.bind.annotation.RestController; | 14 | import org.springframework.web.bind.annotation.RestController; |
15 | 15 | ||
16 | import java.util.Arrays; | ||
17 | import java.util.Collections; | 16 | import java.util.Collections; |
18 | import java.util.List; | ||
19 | import java.util.Objects; | 17 | import java.util.Objects; |
20 | 18 | ||
21 | /** | 19 | /** | ... | ... |
1 | package com.topdraw.business.process.rest; | 1 | package com.topdraw.business.process.rest; |
2 | 2 | ||
3 | import com.topdraw.annotation.AnonymousAccess; | 3 | import com.topdraw.base.modules.annotation.AnonymousAccess; |
4 | import com.topdraw.base.modules.common.IResultInfo; | ||
5 | import com.topdraw.base.modules.common.ResultInfo; | ||
6 | import com.topdraw.business.module.common.validated.CreateGroup; | ||
4 | import com.topdraw.business.module.common.validated.UpdateGroup; | 7 | import com.topdraw.business.module.common.validated.UpdateGroup; |
8 | import com.topdraw.business.module.contact.domain.MemberContacts; | ||
9 | import com.topdraw.business.module.contact.service.MemberContactsService; | ||
5 | import com.topdraw.business.module.member.address.domain.MemberAddress; | 10 | import com.topdraw.business.module.member.address.domain.MemberAddress; |
6 | import com.topdraw.business.module.member.address.service.dto.MemberAddressDTO; | 11 | import com.topdraw.business.module.member.address.service.dto.MemberAddressDTO; |
7 | import com.topdraw.business.module.member.profile.service.dto.MemberProfileDTO; | 12 | import com.topdraw.business.module.member.profile.service.dto.MemberProfileDTO; |
8 | import com.topdraw.business.module.member.service.dto.MemberDTO; | 13 | import com.topdraw.business.module.member.service.dto.MemberDTO; |
9 | import com.topdraw.business.process.domian.member.MemberOperationBean; | 14 | import com.topdraw.business.process.domian.member.MemberOperationBean; |
10 | import com.topdraw.business.process.service.member.MemberOperationService; | 15 | import com.topdraw.business.process.service.member.MemberOperationService; |
11 | import com.topdraw.common.IResultInfo; | 16 | import com.topdraw.util.RegexUtil; |
12 | import com.topdraw.common.ResultInfo; | ||
13 | import io.swagger.annotations.Api; | 17 | import io.swagger.annotations.Api; |
14 | import io.swagger.annotations.ApiOperation; | 18 | import io.swagger.annotations.ApiOperation; |
15 | import lombok.extern.slf4j.Slf4j; | 19 | import lombok.extern.slf4j.Slf4j; |
... | @@ -87,6 +91,19 @@ public class MemberOperationController { | ... | @@ -87,6 +91,19 @@ public class MemberOperationController { |
87 | MemberProfileDTO memberProfileDTO = this.memberOperationService.getMemberProfileAndCheckVip(memberId, appId); | 91 | MemberProfileDTO memberProfileDTO = this.memberOperationService.getMemberProfileAndCheckVip(memberId, appId); |
88 | return ResultInfo.success(memberProfileDTO); | 92 | return ResultInfo.success(memberProfileDTO); |
89 | } | 93 | } |
94 | |||
95 | @PostMapping("/createMemberContacts") | ||
96 | @ApiOperation("新增会员联络信息") | ||
97 | @AnonymousAccess | ||
98 | public ResultInfo createMemberContacts(@Validated(value = {CreateGroup.class}) @RequestBody MemberContacts resources) { | ||
99 | log.info("新增会员联络信息,参数 createMemberContacts# ==>> {}", resources); | ||
100 | |||
101 | if (!RegexUtil.mobileRegex(resources.getPhone())) { | ||
102 | return ResultInfo.failure("手机号格式不正确,请确认"); | ||
103 | } | ||
104 | |||
105 | return this.memberOperationService.createMemberContacts(resources); | ||
106 | } | ||
90 | } | 107 | } |
91 | 108 | ||
92 | 109 | ... | ... |
1 | package com.topdraw.business.process.rest; | 1 | package com.topdraw.business.process.rest; |
2 | 2 | ||
3 | import com.topdraw.annotation.AnonymousAccess; | 3 | import com.topdraw.base.modules.annotation.AnonymousAccess; |
4 | import com.topdraw.base.modules.common.ResultInfo; | ||
5 | import com.topdraw.base.modules.exception.BadRequestException; | ||
4 | import com.topdraw.business.module.member.service.MemberService; | 6 | import com.topdraw.business.module.member.service.MemberService; |
5 | import com.topdraw.business.module.member.service.dto.MemberDTO; | 7 | import com.topdraw.business.module.member.service.dto.MemberDTO; |
6 | import com.topdraw.business.module.user.iptv.service.UserTvService; | 8 | import com.topdraw.business.module.user.iptv.service.UserTvService; |
... | @@ -11,9 +13,7 @@ import com.topdraw.business.process.domian.TempCustomPointBean; | ... | @@ -11,9 +13,7 @@ import com.topdraw.business.process.domian.TempCustomPointBean; |
11 | import com.topdraw.business.process.domian.TempPoints; | 13 | import com.topdraw.business.process.domian.TempPoints; |
12 | import com.topdraw.business.process.service.dto.CustomPointsResult; | 14 | import com.topdraw.business.process.service.dto.CustomPointsResult; |
13 | import com.topdraw.business.process.service.PointsOperationService; | 15 | import com.topdraw.business.process.service.PointsOperationService; |
14 | import com.topdraw.common.ResultInfo; | ||
15 | import com.topdraw.business.LocalConstants; | 16 | import com.topdraw.business.LocalConstants; |
16 | import com.topdraw.exception.BadRequestException; | ||
17 | import com.topdraw.exception.GlobeExceptionMsg; | 17 | import com.topdraw.exception.GlobeExceptionMsg; |
18 | import io.swagger.annotations.Api; | 18 | import io.swagger.annotations.Api; |
19 | import io.swagger.annotations.ApiOperation; | 19 | import io.swagger.annotations.ApiOperation; |
... | @@ -78,6 +78,7 @@ public class PointsOperationController { | ... | @@ -78,6 +78,7 @@ public class PointsOperationController { |
78 | if (Objects.nonNull(memberDTO.getId())) { | 78 | if (Objects.nonNull(memberDTO.getId())) { |
79 | tempPoints.setMemberId(memberDTO.getId()); | 79 | tempPoints.setMemberId(memberDTO.getId()); |
80 | tempPoints.setMemberCode(memberDTO.getCode()); | 80 | tempPoints.setMemberCode(memberDTO.getCode()); |
81 | tempPoints.setPointsType(0); | ||
81 | this.pointsOperationService.grantPointsByManualByTempPoints(tempPoints); | 82 | this.pointsOperationService.grantPointsByManualByTempPoints(tempPoints); |
82 | } | 83 | } |
83 | 84 | ... | ... |
1 | package com.topdraw.business.process.rest; | 1 | package com.topdraw.business.process.rest; |
2 | 2 | ||
3 | import com.topdraw.base.modules.common.ResultInfo; | ||
3 | import com.topdraw.business.module.rights.history.domain.RightsHistory; | 4 | import com.topdraw.business.module.rights.history.domain.RightsHistory; |
4 | import com.topdraw.business.process.service.RightsOperationService; | 5 | import com.topdraw.business.process.service.RightsOperationService; |
5 | import com.topdraw.common.ResultInfo; | ||
6 | import org.springframework.beans.factory.annotation.Autowired; | 6 | import org.springframework.beans.factory.annotation.Autowired; |
7 | import org.springframework.validation.annotation.Validated; | 7 | import org.springframework.validation.annotation.Validated; |
8 | import org.springframework.web.bind.annotation.*; | 8 | import org.springframework.web.bind.annotation.*; | ... | ... |
1 | package com.topdraw.business.process.rest; | 1 | package com.topdraw.business.process.rest; |
2 | 2 | ||
3 | import com.topdraw.annotation.AnonymousAccess; | 3 | import com.topdraw.base.modules.annotation.AnonymousAccess; |
4 | import com.topdraw.base.modules.common.IResultInfo; | ||
5 | import com.topdraw.base.modules.common.ResultInfo; | ||
6 | import com.topdraw.base.modules.exception.BadRequestException; | ||
4 | import com.topdraw.business.module.common.validated.CreateGroup; | 7 | import com.topdraw.business.module.common.validated.CreateGroup; |
5 | import com.topdraw.business.module.task.domain.Task; | 8 | import com.topdraw.business.module.task.domain.Task; |
6 | import com.topdraw.business.module.task.service.dto.TaskDTO; | 9 | import com.topdraw.business.module.task.service.dto.TaskDTO; |
7 | import com.topdraw.business.process.domian.TempIptvUser; | 10 | import com.topdraw.business.process.domian.TempIptvUser; |
8 | import com.topdraw.business.process.service.TaskOperationService; | 11 | import com.topdraw.business.process.service.TaskOperationService; |
9 | import com.topdraw.business.process.service.dto.TaskOperationQueryCriteria; | 12 | import com.topdraw.business.process.service.dto.TaskOperationQueryCriteria; |
10 | import com.topdraw.common.IResultInfo; | ||
11 | import com.topdraw.common.ResultInfo; | ||
12 | import io.swagger.annotations.Api; | 13 | import io.swagger.annotations.Api; |
13 | import io.swagger.annotations.ApiOperation; | 14 | import io.swagger.annotations.ApiOperation; |
14 | import lombok.extern.slf4j.Slf4j; | 15 | import lombok.extern.slf4j.Slf4j; |
15 | import org.springframework.beans.BeanUtils; | ||
16 | import org.springframework.beans.factory.annotation.Autowired; | 16 | import org.springframework.beans.factory.annotation.Autowired; |
17 | import org.springframework.validation.annotation.Validated; | 17 | import org.springframework.validation.annotation.Validated; |
18 | import org.springframework.web.bind.annotation.*; | 18 | import org.springframework.web.bind.annotation.*; |
... | @@ -70,18 +70,14 @@ public class TaskOperationController { | ... | @@ -70,18 +70,14 @@ public class TaskOperationController { |
70 | @PostMapping(value = "/updateTask") | 70 | @PostMapping(value = "/updateTask") |
71 | @ApiOperation("修改任务") | 71 | @ApiOperation("修改任务") |
72 | @AnonymousAccess | 72 | @AnonymousAccess |
73 | public void updateTask(@RequestBody @Validated Task content) { | 73 | public ResultInfo updateTask(@RequestBody @Validated Task content) { |
74 | log.info("taskOperation ==>> updateTask ==>> param ==>> {}", content); | 74 | log.info("修改任务,参数 updateTask# ==>> {}", content); |
75 | Long id = content.getId(); | 75 | Long id = content.getId(); |
76 | TaskDTO taskDTO = this.taskOperationService.findById(id); | 76 | if (Objects.isNull(id)) { |
77 | if (Objects.nonNull(taskDTO.getId())) { | 77 | throw new BadRequestException("修改任务失败,id不得为空"); |
78 | content.setCode(taskDTO.getCode()); | ||
79 | Task task = new Task(); | ||
80 | BeanUtils.copyProperties(taskDTO, task); | ||
81 | task.copy(content); | ||
82 | // 修改任务 | ||
83 | this.taskOperationService.updateTask(task); | ||
84 | } | 78 | } |
79 | // 修改任务 | ||
80 | return this.taskOperationService.updateTask(content); | ||
85 | } | 81 | } |
86 | 82 | ||
87 | /** | 83 | /** | ... | ... |
1 | package com.topdraw.business.process.rest; | 1 | package com.topdraw.business.process.rest; |
2 | 2 | ||
3 | import com.topdraw.annotation.AnonymousAccess; | 3 | import com.topdraw.base.modules.annotation.AnonymousAccess; |
4 | import com.topdraw.business.module.task.template.domain.TaskTemplate; | 4 | import com.topdraw.business.module.task.template.domain.TaskTemplate; |
5 | import com.topdraw.business.module.task.template.service.dto.TaskTemplateDTO; | ||
6 | import com.topdraw.business.process.service.TaskTemplateOperationService; | 5 | import com.topdraw.business.process.service.TaskTemplateOperationService; |
7 | import io.swagger.annotations.Api; | 6 | import io.swagger.annotations.Api; |
8 | import io.swagger.annotations.ApiOperation; | 7 | import io.swagger.annotations.ApiOperation; | ... | ... |
... | @@ -4,8 +4,10 @@ import cn.hutool.core.util.ObjectUtil; | ... | @@ -4,8 +4,10 @@ import cn.hutool.core.util.ObjectUtil; |
4 | 4 | ||
5 | import com.alibaba.fastjson.JSON; | 5 | import com.alibaba.fastjson.JSON; |
6 | import com.alibaba.fastjson.JSONObject; | 6 | import com.alibaba.fastjson.JSONObject; |
7 | import com.topdraw.annotation.AnonymousAccess; | 7 | import com.topdraw.base.modules.annotation.AnonymousAccess; |
8 | import com.topdraw.annotation.Log; | 8 | import com.topdraw.base.modules.common.ResultInfo; |
9 | import com.topdraw.base.modules.exception.BadRequestException; | ||
10 | import com.topdraw.base.modules.utils.RedisUtils; | ||
9 | import com.topdraw.business.module.common.validated.CreateGroup; | 11 | import com.topdraw.business.module.common.validated.CreateGroup; |
10 | import com.topdraw.business.module.common.validated.UpdateGroup; | 12 | import com.topdraw.business.module.common.validated.UpdateGroup; |
11 | import com.topdraw.business.module.member.service.MemberService; | 13 | import com.topdraw.business.module.member.service.MemberService; |
... | @@ -17,7 +19,6 @@ import com.topdraw.business.module.user.app.service.dto.UserAppSimpleDTO; | ... | @@ -17,7 +19,6 @@ import com.topdraw.business.module.user.app.service.dto.UserAppSimpleDTO; |
17 | import com.topdraw.business.module.user.iptv.domain.UserTv; | 19 | import com.topdraw.business.module.user.iptv.domain.UserTv; |
18 | import com.topdraw.business.module.user.iptv.growreport.domain.GrowthReport; | 20 | import com.topdraw.business.module.user.iptv.growreport.domain.GrowthReport; |
19 | import com.topdraw.business.module.user.iptv.growreport.service.dto.GrowthReportRequest; | 21 | import com.topdraw.business.module.user.iptv.growreport.service.dto.GrowthReportRequest; |
20 | import com.topdraw.business.module.user.iptv.service.UserTvService; | ||
21 | import com.topdraw.business.module.user.iptv.service.dto.UserTvDTO; | 22 | import com.topdraw.business.module.user.iptv.service.dto.UserTvDTO; |
22 | import com.topdraw.business.module.user.weixin.domain.UserWeixin; | 23 | import com.topdraw.business.module.user.weixin.domain.UserWeixin; |
23 | import com.topdraw.business.module.user.weixin.service.dto.UserWeixinDTO; | 24 | import com.topdraw.business.module.user.weixin.service.dto.UserWeixinDTO; |
... | @@ -25,20 +26,15 @@ import com.topdraw.business.process.domian.member.MemberOperationBean; | ... | @@ -25,20 +26,15 @@ import com.topdraw.business.process.domian.member.MemberOperationBean; |
25 | import com.topdraw.business.process.domian.weixin.*; | 26 | import com.topdraw.business.process.domian.weixin.*; |
26 | import com.topdraw.business.process.service.UserOperationService; | 27 | import com.topdraw.business.process.service.UserOperationService; |
27 | import com.topdraw.business.process.service.member.MemberOperationService; | 28 | import com.topdraw.business.process.service.member.MemberOperationService; |
28 | import com.topdraw.common.ResultInfo; | 29 | import com.topdraw.util.*; |
29 | import com.topdraw.util.RedisKeyUtil; | ||
30 | import com.topdraw.config.WechatConfig; | 30 | import com.topdraw.config.WechatConfig; |
31 | import com.topdraw.exception.BadRequestException; | ||
32 | import com.topdraw.exception.EntityNotFoundException; | ||
33 | import com.topdraw.exception.GlobeExceptionMsg; | 31 | import com.topdraw.exception.GlobeExceptionMsg; |
34 | import com.topdraw.resttemplate.RestTemplateClient; | 32 | import com.topdraw.resttemplate.RestTemplateClient; |
35 | import com.topdraw.util.Base64Util; | ||
36 | import com.topdraw.util.JSONUtil; | ||
37 | import com.topdraw.utils.RedisUtils; | ||
38 | import com.topdraw.weixin.service.WeChatConstants; | 33 | import com.topdraw.weixin.service.WeChatConstants; |
39 | import io.swagger.annotations.Api; | 34 | import io.swagger.annotations.Api; |
40 | import io.swagger.annotations.ApiOperation; | 35 | import io.swagger.annotations.ApiOperation; |
41 | import lombok.extern.slf4j.Slf4j; | 36 | import lombok.extern.slf4j.Slf4j; |
37 | import org.apache.commons.lang.math.RandomUtils; | ||
42 | import org.apache.commons.lang3.StringUtils; | 38 | import org.apache.commons.lang3.StringUtils; |
43 | import org.springframework.beans.factory.annotation.Autowired; | 39 | import org.springframework.beans.factory.annotation.Autowired; |
44 | import org.springframework.util.Assert; | 40 | import org.springframework.util.Assert; |
... | @@ -48,9 +44,9 @@ import org.springframework.validation.annotation.Validated; | ... | @@ -48,9 +44,9 @@ import org.springframework.validation.annotation.Validated; |
48 | import org.springframework.web.bind.annotation.*; | 44 | import org.springframework.web.bind.annotation.*; |
49 | 45 | ||
50 | import javax.naming.ConfigurationException; | 46 | import javax.naming.ConfigurationException; |
51 | import java.io.IOException; | ||
52 | import java.net.URLDecoder; | 47 | import java.net.URLDecoder; |
53 | import java.sql.Timestamp; | 48 | import java.sql.Timestamp; |
49 | import java.time.LocalDate; | ||
54 | import java.util.*; | 50 | import java.util.*; |
55 | 51 | ||
56 | @Api("账号处理") | 52 | @Api("账号处理") |
... | @@ -66,8 +62,6 @@ public class UserOperationController { | ... | @@ -66,8 +62,6 @@ public class UserOperationController { |
66 | private UserOperationService userOperationService; | 62 | private UserOperationService userOperationService; |
67 | @Autowired | 63 | @Autowired |
68 | private MemberOperationService memberOperationService; | 64 | private MemberOperationService memberOperationService; |
69 | @Autowired | ||
70 | private UserTvService userTvService; | ||
71 | 65 | ||
72 | @Autowired | 66 | @Autowired |
73 | private RedisUtils redisUtils; | 67 | private RedisUtils redisUtils; |
... | @@ -78,6 +72,7 @@ public class UserOperationController { | ... | @@ -78,6 +72,7 @@ public class UserOperationController { |
78 | private static final String UNSUBSCRIBE = "unsubscribe"; | 72 | private static final String UNSUBSCRIBE = "unsubscribe"; |
79 | private static final Integer SUBSCRIBE_STATUS = 1; | 73 | private static final Integer SUBSCRIBE_STATUS = 1; |
80 | 74 | ||
75 | private String secretKey = "f8681b9ce7c8fb6b"; | ||
81 | 76 | ||
82 | 77 | ||
83 | /******************************************************* APP ************************************/ | 78 | /******************************************************* APP ************************************/ |
... | @@ -87,17 +82,18 @@ public class UserOperationController { | ... | @@ -87,17 +82,18 @@ public class UserOperationController { |
87 | * @param userApp app账号 | 82 | * @param userApp app账号 |
88 | * @return ResultInfo | 83 | * @return ResultInfo |
89 | */ | 84 | */ |
90 | @Log | ||
91 | @PostMapping(value = "/appSignOut") | 85 | @PostMapping(value = "/appSignOut") |
92 | @ApiOperation("app账号退出登录") | 86 | @ApiOperation("app账号退出登录") |
93 | @AnonymousAccess | 87 | @AnonymousAccess |
94 | public ResultInfo appSignOut(@Validated @RequestBody UserApp userApp) { | 88 | public ResultInfo appSignOut(@Validated @RequestBody UserApp userApp) { |
95 | log.info("app账号退出登录,参数 ==>> [appSignOut#{}]", userApp.getId()); | 89 | log.info("app账号退出登录,参数 appSignOut# userApp ==>> {} ", userApp); |
96 | if (Objects.isNull(userApp.getId())) { | 90 | if (Objects.isNull(userApp.getId())) { |
97 | log.error("app账号退出登录失败,参数错误,id不得为空,[appSignOut#]"); | 91 | log.error("app账号退出登录失败,参数错误,appSignOut# message ==>> id不得为空"); |
98 | return ResultInfo.failure("app账号退出登录失败,参数错误,id不得为空"); | 92 | return ResultInfo.failure("app账号退出登录失败,参数错误,id不得为空"); |
99 | } | 93 | } |
100 | 94 | ||
95 | // TODO 2.2.0 版本之前无具体业务,后续等业务方确定具体业务后在进行拓展 | ||
96 | |||
101 | return ResultInfo.success(true); | 97 | return ResultInfo.success(true); |
102 | } | 98 | } |
103 | 99 | ||
... | @@ -106,29 +102,25 @@ public class UserOperationController { | ... | @@ -106,29 +102,25 @@ public class UserOperationController { |
106 | * @param userApp app账号 | 102 | * @param userApp app账号 |
107 | * @return ResultInfo | 103 | * @return ResultInfo |
108 | */ | 104 | */ |
109 | @Log | ||
110 | @PostMapping(value = "/appCancellation") | 105 | @PostMapping(value = "/appCancellation") |
111 | @ApiOperation("注销app账号") | 106 | @ApiOperation("注销app账号") |
112 | @AnonymousAccess | 107 | @AnonymousAccess |
113 | public ResultInfo appCancellation(@Validated @RequestBody UserApp userApp) { | 108 | public ResultInfo appCancellation(@Validated @RequestBody UserApp userApp) { |
114 | log.info("注销app账号,参数 ==>> [appCancellation#{}]", userApp.getId()); | 109 | log.info("注销app账号,参数 appCancellation# resources ==>> {}", userApp); |
115 | 110 | ||
116 | if (Objects.isNull(userApp.getId())) { | 111 | if (Objects.isNull(userApp.getId())) { |
117 | log.error("注销app账号失败,参数错误,id不得为空,[appCancellation#]"); | 112 | log.error("注销app账号异常,appCancellation# message ==>> app账号id不的为空"); |
118 | return ResultInfo.failure(""); | 113 | return ResultInfo.failure("app账号id不的为空"); |
119 | } | 114 | } |
120 | 115 | ||
121 | boolean result = this.userOperationService.appCancellation(userApp); | 116 | return ResultInfo.success(this.userOperationService.appCancellation(userApp)); |
122 | |||
123 | return ResultInfo.success(result); | ||
124 | } | 117 | } |
125 | 118 | ||
126 | @Log | ||
127 | @PostMapping(value = "/updateAppInfo") | 119 | @PostMapping(value = "/updateAppInfo") |
128 | @ApiOperation("修改app账号信息") | 120 | @ApiOperation("修改app账号信息") |
129 | @AnonymousAccess | 121 | @AnonymousAccess |
130 | public ResultInfo updateAppInfo(@Validated @RequestBody UserApp resources) { | 122 | public ResultInfo updateAppInfo(@Validated @RequestBody UserApp resources) { |
131 | log.info("修改app账号信息,参数 ==>> [updateAppInfo#{}]", resources); | 123 | log.info("修改app账号信息,参数 updateAppInfo# resources ==>> {}", resources); |
132 | Long id = resources.getId(); | 124 | Long id = resources.getId(); |
133 | if (Objects.isNull(id)) { | 125 | if (Objects.isNull(id)) { |
134 | log.error("修改app账号密码,参数错误,id不得为空,[updateAppInfo#{}]", resources); | 126 | log.error("修改app账号密码,参数错误,id不得为空,[updateAppInfo#{}]", resources); |
... | @@ -147,59 +139,73 @@ public class UserOperationController { | ... | @@ -147,59 +139,73 @@ public class UserOperationController { |
147 | return ResultInfo.success(result); | 139 | return ResultInfo.success(result); |
148 | } | 140 | } |
149 | 141 | ||
150 | |||
151 | @Log | ||
152 | @PostMapping(value = "/appRegister") | 142 | @PostMapping(value = "/appRegister") |
153 | @ApiOperation("app注册") | 143 | @ApiOperation("app注册") |
154 | @AnonymousAccess | 144 | @AnonymousAccess |
155 | public ResultInfo appRegister(@Validated @RequestBody UserApp resources) { | 145 | public ResultInfo appRegister(@Validated @RequestBody UserApp resources) { |
156 | log.info("app注册 ==>> param ==>> [appRegister#{}]", resources); | 146 | log.info("app注册, 参数 appRegister# resouces ==>> {}", resources); |
157 | 147 | ||
158 | String username = resources.getUsername(); | 148 | String username = resources.getUsername(); |
159 | if (StringUtils.isBlank(username)) { | 149 | if (StringUtils.isBlank(username)) { |
160 | log.error("app注册,参数错误,账号不得为空 "); | 150 | log.error("app注册,参数错误,appRegister# message ==>> 账号不得为空 "); |
161 | return ResultInfo.failure("app注册,参数错误,账号不得为空"); | 151 | return ResultInfo.failure("app注册,参数错误,账号不得为空"); |
162 | } | 152 | } |
163 | 153 | ||
164 | Integer type = resources.getType(); | 154 | Integer type = resources.getType(); |
165 | if (Objects.isNull(type)) { | 155 | if (Objects.isNull(type)) { |
166 | log.error("app注册,参数错误,账号类型不得为空 "); | 156 | log.error("app注册,参数错误,appRegister# message ==>> 账号类型不得为空 "); |
167 | return ResultInfo.failure("app注册,参数错误,账号类型不得为空"); | 157 | return ResultInfo.failure("app注册失败,账号类型不得为空"); |
168 | } | 158 | } |
169 | 159 | ||
170 | String account = resources.getAccount(); | 160 | String account = resources.getAccount(); |
171 | if (StringUtils.isNotBlank(account)) { | 161 | if (StringUtils.isNotBlank(account)) { |
172 | if (Objects.isNull(resources.getAccountType())) { | 162 | if (Objects.isNull(resources.getAccountType())) { |
173 | log.error("app注册,参数错误,第三方账号类型不得为空"); | 163 | log.error("app注册,参数错误,appRegister# message ==>> 第三方账号类型不得为空"); |
174 | return ResultInfo.failure("app注册,参数错误,第三方账号类型不得为空"); | 164 | return ResultInfo.failure("app注册失败,第三方账号类型不得为空"); |
175 | } | 165 | } |
176 | } | 166 | } |
177 | 167 | ||
178 | if (StringUtils.isBlank(resources.getNickname())) { | 168 | if (StringUtils.isBlank(resources.getNickname())) { |
169 | // 昵称不存在时,默认使用手机号作为昵称 | ||
179 | resources.setNickname(Base64Utils.encodeToString(username.getBytes())); | 170 | resources.setNickname(Base64Utils.encodeToString(username.getBytes())); |
180 | } | 171 | } |
181 | 172 | ||
182 | UserAppDTO userAppDTO = this.userOperationService.appRegister(resources); | 173 | if (Objects.isNull(resources.getId())) { |
183 | return ResultInfo.success(userAppDTO); | 174 | if (StringUtils.isNotBlank(resources.getPassword())) { |
175 | String clientPassword = AESUtil.decrypt(resources.getPassword(), secretKey); | ||
176 | if (clientPassword == null || clientPassword.length() <= 16) { | ||
177 | log.error("app注册异常,appRegister# message ==>> 密码格式不正确 | clientPassword ==>> {}", clientPassword); | ||
178 | return ResultInfo.failure("密码必须包含大小写字母和数字的组合,不能使用特殊字符,长度在 8-25 之间"); | ||
179 | } | ||
180 | String resultClientPassword = clientPassword.substring(16); | ||
181 | |||
182 | if (!RegexUtil.appPasswordRegex(resultClientPassword)) { | ||
183 | log.error("app注册异常,appRegister# message ==>> 密码格式不正确 | password ==>> {}", resultClientPassword); | ||
184 | return ResultInfo.failure("密码必须包含大小写字母和数字的组合,不能使用特殊字符,长度在 8-25 之间"); | ||
185 | } | ||
186 | resources.setPassword(AESUtil.decodePassword(resources.getPassword())); | ||
187 | } | ||
188 | } | ||
189 | |||
190 | return ResultInfo.success(this.userOperationService.appRegister(resources)); | ||
184 | } | 191 | } |
185 | 192 | ||
186 | @Log | ||
187 | @PostMapping(value = "/appBindThirdAccount") | 193 | @PostMapping(value = "/appBindThirdAccount") |
188 | @ApiOperation("app账号绑定第三方账号") | 194 | @ApiOperation("app账号绑定第三方账号") |
189 | @AnonymousAccess | 195 | @AnonymousAccess |
190 | public ResultInfo appBindThirdAccount(@Validated @RequestBody UserAppBind resources) { | 196 | public ResultInfo appBindThirdAccount(@Validated @RequestBody UserAppBind resources) { |
191 | log.info("app账号绑定第三方账号,参数 ==>> [appBindThirdAccount#{}]", resources); | 197 | log.info("app账号绑定第三方账号,参数 appBindThirdAccount# message ==>> {}", resources); |
192 | 198 | ||
193 | String username = resources.getUsername(); | 199 | String username = resources.getUsername(); |
194 | if (StringUtils.isBlank(username)) { | 200 | if (StringUtils.isBlank(username)) { |
195 | log.error("app账号绑定第三方账号,参数错误,账号不得为空 "); | 201 | log.error("app账号绑定第三方账号,参数错误,appBindThirdAccount# message ==>> 账号不得为空 "); |
196 | return ResultInfo.failure("app账号绑定第三方账号,参数错误,账号不得为空"); | 202 | return ResultInfo.failure("app账号绑定第三方账号,参数错误,账号不得为空"); |
197 | } | 203 | } |
198 | 204 | ||
199 | String account = resources.getAccount(); | 205 | String account = resources.getAccount(); |
200 | if (StringUtils.isNotBlank(account)) { | 206 | if (StringUtils.isNotBlank(account)) { |
201 | if (Objects.isNull(resources.getAccountType())) { | 207 | if (Objects.isNull(resources.getAccountType())) { |
202 | log.error("app账号绑定第三方账号,参数错误,第三方账号不得为空"); | 208 | log.error("app账号绑定第三方账号,参数错误,appBindThirdAccount# message ==>> 第三方账号不得为空"); |
203 | return ResultInfo.failure("app账号绑定第三方账号,参数错误,第三方账号不得为空"); | 209 | return ResultInfo.failure("app账号绑定第三方账号,参数错误,第三方账号不得为空"); |
204 | } | 210 | } |
205 | } | 211 | } |
... | @@ -207,19 +213,18 @@ public class UserOperationController { | ... | @@ -207,19 +213,18 @@ public class UserOperationController { |
207 | // 第三方账号类型 3:微信;4:QQ;5:微博;6:苹果账号 | 213 | // 第三方账号类型 3:微信;4:QQ;5:微博;6:苹果账号 |
208 | Integer accountType = resources.getAccountType(); | 214 | Integer accountType = resources.getAccountType(); |
209 | if (Objects.isNull(accountType)) { | 215 | if (Objects.isNull(accountType)) { |
210 | log.error("app账号绑定第三方账号,参数错误,第三方账号类型不得为空"); | 216 | log.error("app账号绑定第三方账号,参数错误,appBindThirdAccount# message ==>> 第三方账号类型不得为空"); |
211 | return ResultInfo.failure("app账号绑定第三方账号,参数错误,第三方账号类型不得为空"); | 217 | return ResultInfo.failure("app账号绑定第三方账号,参数错误,第三方账号类型不得为空"); |
212 | } | 218 | } |
213 | 219 | ||
214 | return this.userOperationService.appBindThirdAccount(resources); | 220 | return this.userOperationService.appBindThirdAccount(resources); |
215 | } | 221 | } |
216 | 222 | ||
217 | @Log | ||
218 | @PostMapping(value = "/cancelUserAppBind") | 223 | @PostMapping(value = "/cancelUserAppBind") |
219 | @ApiOperation("取消关联第三方账号") | 224 | @ApiOperation("取消关联第三方账号") |
220 | @AnonymousAccess | 225 | @AnonymousAccess |
221 | public ResultInfo cancelUserAppBind(@Validated @RequestBody UserAppBind resources) { | 226 | public ResultInfo cancelUserAppBind(@Validated @RequestBody UserAppBind resources) { |
222 | log.info("取消关联第三方账号, 参数 ==>> [cancelUserAppBind#{}]", resources); | 227 | log.info("取消关联第三方账号, 参数 cancelUserAppBind# resource ==>> {}", resources); |
223 | 228 | ||
224 | String account = resources.getAccount(); | 229 | String account = resources.getAccount(); |
225 | if (StringUtils.isBlank(account)) { | 230 | if (StringUtils.isBlank(account)) { |
... | @@ -242,20 +247,14 @@ public class UserOperationController { | ... | @@ -242,20 +247,14 @@ public class UserOperationController { |
242 | @ApiOperation("app绑定大屏") | 247 | @ApiOperation("app绑定大屏") |
243 | @AnonymousAccess | 248 | @AnonymousAccess |
244 | public ResultInfo appBind(@Validated(value = {BindGroup.class}) @RequestBody BindBean resources) { | 249 | public ResultInfo appBind(@Validated(value = {BindGroup.class}) @RequestBody BindBean resources) { |
245 | log.info("UserOperationController ==> appletBind ==>> param ==> [{}]",resources); | 250 | log.info("app绑定大屏, 参数 appBind# resources ==> {}",resources); |
246 | 251 | ||
247 | Long memberId = resources.getMemberId(); | 252 | Long memberId = resources.getMemberId(); |
248 | if (Objects.isNull(memberId)) { | 253 | if (Objects.isNull(memberId)) { |
249 | return ResultInfo.failure("参数错误,memberId 不存在"); | 254 | return ResultInfo.failure("参数错误, memberId不得为空"); |
250 | } | 255 | } |
251 | 256 | ||
252 | String platformAccount = resources.getPlatformAccount(); | 257 | return this.userOperationService.appBind(resources); |
253 | if (StringUtils.isBlank(platformAccount)) { | ||
254 | return ResultInfo.failure("参数错误,大屏账号不存在"); | ||
255 | } | ||
256 | |||
257 | boolean result = this.userOperationService.appBind(resources); | ||
258 | return ResultInfo.success(result); | ||
259 | } | 258 | } |
260 | 259 | ||
261 | @PostMapping("/appUnbind") | 260 | @PostMapping("/appUnbind") |
... | @@ -276,7 +275,6 @@ public class UserOperationController { | ... | @@ -276,7 +275,6 @@ public class UserOperationController { |
276 | 275 | ||
277 | /******************************************************* weixin ************************************/ | 276 | /******************************************************* weixin ************************************/ |
278 | 277 | ||
279 | @Log | ||
280 | @PostMapping(value = "/saveGrowthReport") | 278 | @PostMapping(value = "/saveGrowthReport") |
281 | @ApiOperation("同步大屏成长报告") | 279 | @ApiOperation("同步大屏成长报告") |
282 | @AnonymousAccess | 280 | @AnonymousAccess |
... | @@ -302,11 +300,11 @@ public class UserOperationController { | ... | @@ -302,11 +300,11 @@ public class UserOperationController { |
302 | } | 300 | } |
303 | 301 | ||
304 | @PutMapping(value = "/updateWeixin") | 302 | @PutMapping(value = "/updateWeixin") |
305 | @ApiOperation("修改UserWeixin") | 303 | @ApiOperation("修改微信信息") |
306 | @AnonymousAccess | 304 | @AnonymousAccess |
307 | public ResultInfo updateWeixin(@Validated @RequestBody UserWeixin resources) { | 305 | public ResultInfo updateWeixin(@Validated @RequestBody UserWeixin resources) { |
308 | userOperationService.updateWeixin(resources); | 306 | log.info("修改微信信息, 参数 updateWeixin# resources ==>> {}", resources); |
309 | return ResultInfo.success(); | 307 | return ResultInfo.success(this.userOperationService.updateWeixin(resources)); |
310 | } | 308 | } |
311 | 309 | ||
312 | @RequestMapping(value = "/updateVipByUserId") | 310 | @RequestMapping(value = "/updateVipByUserId") |
... | @@ -314,23 +312,30 @@ public class UserOperationController { | ... | @@ -314,23 +312,30 @@ public class UserOperationController { |
314 | @AnonymousAccess | 312 | @AnonymousAccess |
315 | public ResultInfo updateVipByUserId(@Validated(value = {UpdateGroup.class}) @RequestBody | 313 | public ResultInfo updateVipByUserId(@Validated(value = {UpdateGroup.class}) @RequestBody |
316 | UserOperationBean resources) { | 314 | UserOperationBean resources) { |
317 | log.info("userOperation ==>> updateVipByUserId ==>> param ==>> [{}]",resources); | 315 | log.info("通过账号id修改vip, 参数 updateVipByUserId# resources ==>> {}",resources); |
318 | 316 | ||
319 | Integer vip = resources.getVip(); | 317 | Integer vip = resources.getVip(); |
320 | if (Objects.isNull(vip) || vip < 1) { | 318 | if (Objects.isNull(vip) || vip < 1) { |
321 | return ResultInfo.failure("手动修改vip异常,参数错误,vip为空或者小于1"); | 319 | return ResultInfo.failure("手动修改vip异常,参数错误,vip为空或者小于1"); |
322 | } | 320 | } |
321 | |||
323 | Timestamp vipExpireTime = resources.getVipExpireTime(); | 322 | Timestamp vipExpireTime = resources.getVipExpireTime(); |
324 | // 微信账号id | 323 | // 微信账号id |
325 | Long userId = resources.getUserId(); | 324 | Long userId = resources.getUserId(); |
326 | if (Objects.isNull(userId)) { | 325 | if (Objects.isNull(userId)) { |
327 | return ResultInfo.failure("手动修改vip异常,参数错误,小屏账号id为空"); | 326 | log.error("通过账号id修改vip异常,updateVipByUserId# message ==>> 小屏账号id不的为空"); |
327 | return ResultInfo.failure("小屏账号id不的为空"); | ||
328 | } | 328 | } |
329 | UserWeixinDTO userWeixinDTO = this.userOperationService.findById(userId); | 329 | UserWeixinDTO userWeixinDTO = this.userOperationService.findById(userId); |
330 | 330 | ||
331 | Long memberId = userWeixinDTO.getMemberId(); | 331 | Long memberId = userWeixinDTO.getMemberId(); |
332 | MemberDTO memberDTO = this.memberService.findById(memberId); | 332 | MemberDTO memberDTO = this.memberService.findById(memberId); |
333 | 333 | ||
334 | if (Objects.isNull(memberDTO.getId())) { | ||
335 | log.error("通过账号id修改vip异常,updateVipByUserId# message ==>> 会员信息不存在"); | ||
336 | return ResultInfo.failure("会员信息不存在"); | ||
337 | } | ||
338 | |||
334 | MemberOperationBean memberOperationBean = new MemberOperationBean(); | 339 | MemberOperationBean memberOperationBean = new MemberOperationBean(); |
335 | memberOperationBean.setMemberCode(memberDTO.getCode()); | 340 | memberOperationBean.setMemberCode(memberDTO.getCode()); |
336 | if (vip < memberDTO.getVip()) { | 341 | if (vip < memberDTO.getVip()) { |
... | @@ -340,68 +345,58 @@ public class UserOperationController { | ... | @@ -340,68 +345,58 @@ public class UserOperationController { |
340 | } | 345 | } |
341 | memberOperationBean.setVip(vip); | 346 | memberOperationBean.setVip(vip); |
342 | 347 | ||
343 | MemberDTO memberDTO1 = this.memberOperationService.doUpdateVipByMemberCode(memberOperationBean); | 348 | return ResultInfo.success(this.memberOperationService.doUpdateVipByMemberCode(memberOperationBean)); |
344 | |||
345 | return ResultInfo.success(memberDTO1); | ||
346 | } | 349 | } |
347 | 350 | ||
348 | @PostMapping(value = "/createWeixinUserAndCreateMember") | 351 | @PostMapping(value = "/createWeixinUserAndCreateMember") |
349 | @ApiOperation("新增小屏账户同时创建会员信息") | 352 | @ApiOperation("新增小屏账户同时创建会员信息") |
350 | @AnonymousAccess | 353 | @AnonymousAccess |
351 | public ResultInfo createWeixinUserAndMember(@Validated(value = {CreateGroup.class}) @RequestBody UserWeixin resources) { | 354 | public ResultInfo createWeixinUserAndMember(@Validated(value = {CreateGroup.class}) @RequestBody UserWeixin resources) { |
352 | log.info("UserOperationController ==> createWeixinUserAndMember ==> param ==> [{}]",resources); | 355 | log.info("新增小屏账户同时创建会员信息, 参数 createWeixinUserAndMember# resources ==>> {}",resources); |
353 | 356 | return this.userOperationService.createWeixinUserAndMember(resources); | |
354 | UserWeixinDTO result = this.userOperationService.createWeixinUserAndMember(resources); | ||
355 | return ResultInfo.success(result); | ||
356 | } | 357 | } |
357 | 358 | ||
358 | @PostMapping("/serviceLogin") | 359 | @PostMapping("/serviceLogin") |
359 | @ApiOperation("微信服务号(H5)登录") | 360 | @ApiOperation("微信服务号(H5)登录") |
360 | @AnonymousAccess | 361 | @AnonymousAccess |
361 | public ResultInfo serviceLogin(@Validated(value = {CreateGroup.class}) @RequestBody UserWeixin resources) { | 362 | public ResultInfo serviceLogin(@Validated(value = {CreateGroup.class}) @RequestBody UserWeixin resources) { |
362 | log.info("UserOperationController ==> serviceLogin ==>> param ==> [{}]",resources); | 363 | log.info("微信服务号(H5)登录, 参数 serviceLogin# resources ==>> {}",resources); |
363 | 364 | return ResultInfo.success(this.userOperationService.serviceLogin(resources)); | |
364 | UserWeixinDTO result = this.userOperationService.serviceLogin(resources); | ||
365 | return ResultInfo.success(result); | ||
366 | } | 365 | } |
367 | 366 | ||
368 | @PostMapping("/appletLogin") | 367 | @PostMapping("/appletLogin") |
369 | @ApiOperation("微信小程序登录") | 368 | @ApiOperation("微信小程序登录") |
370 | @AnonymousAccess | 369 | @AnonymousAccess |
371 | public ResultInfo appletLogin(@Validated(value = {CreateGroup.class}) @RequestBody UserWeixin resources) { | 370 | public ResultInfo appletLogin(@Validated(value = {CreateGroup.class}) @RequestBody UserWeixin resources) { |
372 | log.info("UserOperationController ==> appletLogin ==>> param ==> [{}]",resources); | 371 | log.info("微信小程序登录, 参数 appletLogin# resource ==>> {}", resources); |
373 | 372 | return ResultInfo.success(this.userOperationService.appletLogin(resources)); | |
374 | UserWeixinDTO result = this.userOperationService.appletLogin(resources); | ||
375 | return ResultInfo.success(result); | ||
376 | } | 373 | } |
377 | 374 | ||
378 | @PostMapping("/subscribe") | 375 | @PostMapping("/subscribe") |
379 | @ApiOperation("微信公众号关注") | 376 | @ApiOperation("微信公众号关注") |
380 | @AnonymousAccess | 377 | @AnonymousAccess |
381 | public ResultInfo subscribe(@Validated @RequestBody SubscribeBeanEvent data) throws Exception { | 378 | public ResultInfo subscribe(@Validated @RequestBody SubscribeBeanEvent resource) throws Exception { |
382 | log.info("UserOperationController ==> subscribe ==>> param ==> [{}]",data); | 379 | log.info("微信公众号关注, 参数 subscribe# resource ==> {}", resource); |
383 | 380 | ||
384 | SubscribeBean subscribeBean = JSONUtil.parseMsg2Object(data.getContent(), SubscribeBean.class); | 381 | SubscribeBean subscribeBean = JSONUtil.parseMsg2Object(resource.getContent(), SubscribeBean.class); |
385 | // 解析参数 | 382 | // 解析参数 |
386 | this.parseSubscribe(subscribeBean); | 383 | this.parseSubscribe(subscribeBean); |
387 | boolean subscribe = this.userOperationService.subscribe(subscribeBean); | 384 | |
388 | if (subscribe) { | 385 | if (this.userOperationService.subscribe(subscribeBean)) { |
389 | return ResultInfo.success("关注成功"); | 386 | return ResultInfo.success("关注成功"); |
390 | } else { | ||
391 | return ResultInfo.failure("关注失败"); | ||
392 | } | 387 | } |
388 | |||
389 | return ResultInfo.failure("关注失败"); | ||
390 | |||
393 | } | 391 | } |
394 | 392 | ||
395 | /** | 393 | /** |
396 | * | 394 | * |
397 | * @param subscribeBean | ||
398 | * @throws IOException | ||
399 | */ | 395 | */ |
400 | private void parseSubscribe(SubscribeBean subscribeBean) throws Exception { | 396 | private void parseSubscribe(SubscribeBean subscribeBean) throws Exception { |
401 | 397 | ||
402 | // appId | 398 | // appId |
403 | String appId = subscribeBean.getAppid(); | 399 | String appId = subscribeBean.getAppid(); |
404 | // Assert.notNull(appId, GlobeExceptionMsg.APP_ID_IS_NULL); | ||
405 | // openId | 400 | // openId |
406 | String openId = subscribeBean.getOpenid(); | 401 | String openId = subscribeBean.getOpenid(); |
407 | Assert.notNull(openId, GlobeExceptionMsg.OPEN_ID_IS_NULL); | 402 | Assert.notNull(openId, GlobeExceptionMsg.OPEN_ID_IS_NULL); |
... | @@ -415,15 +410,15 @@ public class UserOperationController { | ... | @@ -415,15 +410,15 @@ public class UserOperationController { |
415 | // 程序类型 | 410 | // 程序类型 |
416 | String appType = wxInfoMap.get("appType"); | 411 | String appType = wxInfoMap.get("appType"); |
417 | // 非订阅号,暂不处理。返回暂不支持 | 412 | // 非订阅号,暂不处理。返回暂不支持 |
418 | if (ObjectUtil.notEqual(appType, WeChatConstants.WX_SUBSCRIPTION)) | 413 | if (ObjectUtil.notEqual(appType, WeChatConstants.WX_SUBSCRIPTION)) { |
419 | throw new BadRequestException("非订阅号"); | 414 | throw new BadRequestException("非订阅号"); |
415 | } | ||
420 | 416 | ||
421 | 417 | ||
422 | // 大屏账户信息 | 418 | // 大屏账户信息 |
423 | JSONObject redisInfo = null; | 419 | JSONObject redisInfo = null; |
424 | // 缓存的大屏信息,使用unionid即可 | 420 | // 缓存的大屏信息,使用unionid即可 |
425 | String content = (String) this.redisUtils.get(RedisKeyUtil.genSeSuSubscribeKey(unionId)); | 421 | String content = (String) this.redisUtils.get(RedisKeyUtil.genSeSuSubscribeKey(unionId)); |
426 | log.info("获取redis中存储的数据,[subscribe#{}]", content); | ||
427 | if (StringUtils.isNotBlank(content)) { | 422 | if (StringUtils.isNotBlank(content)) { |
428 | // 大屏信息 | 423 | // 大屏信息 |
429 | redisInfo = JSONObject.parseObject(content); | 424 | redisInfo = JSONObject.parseObject(content); |
... | @@ -433,19 +428,20 @@ public class UserOperationController { | ... | @@ -433,19 +428,20 @@ public class UserOperationController { |
433 | if (Objects.nonNull(redisInfo)) { | 428 | if (Objects.nonNull(redisInfo)) { |
434 | 429 | ||
435 | subscribeBean.setIptvUserInfo(redisInfo); | 430 | subscribeBean.setIptvUserInfo(redisInfo); |
436 | // 关注来源信息 | ||
437 | log.info("关注来源信息,[subscribe#{}]", redisInfo); | ||
438 | subscribeBean.setSourceInfo(redisInfo); | 431 | subscribeBean.setSourceInfo(redisInfo); |
439 | 432 | ||
440 | String nickname = redisInfo.get("nickname").toString(); | 433 | String nickname = redisInfo.get("nickname").toString(); |
441 | if (StringUtils.isNotBlank(nickname)) { | 434 | if (StringUtils.isNotBlank(nickname)) { |
442 | String nicknameDecode = URLDecoder.decode(nickname, "UTF-8"); | 435 | boolean isBase64 = Base64Util.isBase64(nickname); |
443 | String nicknameEncode = Base64Util.encode(nicknameDecode); | 436 | if (isBase64) { |
444 | subscribeBean.setNickname(nicknameEncode); | 437 | subscribeBean.setNickname(nickname); |
438 | } else { | ||
439 | log.warn("关注时前端昵称为进行base64加密,subscribe# message =>> 采用默认昵称 | nickname ==>> {}", nickname); | ||
440 | subscribeBean.setNickname(Base64Util.encode("创造团用户")); | ||
441 | } | ||
445 | } | 442 | } |
446 | 443 | ||
447 | String headimgurl = redisInfo.get("headimgurl").toString(); | 444 | String headimgurl = redisInfo.get("headimgurl").toString(); |
448 | log.info("parseSubscribe ==>> headimgurl ==>> {}", headimgurl); | ||
449 | if (StringUtils.isNotBlank(headimgurl)) { | 445 | if (StringUtils.isNotBlank(headimgurl)) { |
450 | String headimgurlDecode = URLDecoder.decode(headimgurl, "UTF-8"); | 446 | String headimgurlDecode = URLDecoder.decode(headimgurl, "UTF-8"); |
451 | if (StringUtils.isNotBlank(headimgurlDecode)) { | 447 | if (StringUtils.isNotBlank(headimgurlDecode)) { |
... | @@ -474,11 +470,10 @@ public class UserOperationController { | ... | @@ -474,11 +470,10 @@ public class UserOperationController { |
474 | /** | 470 | /** |
475 | * 获取配置的微信应用列表 | 471 | * 获取配置的微信应用列表 |
476 | * @param appid 应用Id | 472 | * @param appid 应用Id |
477 | * @return | ||
478 | * @throws ConfigurationException | 473 | * @throws ConfigurationException |
479 | */ | 474 | */ |
480 | private Map<String, String> getWeixinInfoByAppid(String appid) throws ConfigurationException { | 475 | private Map<String, String> getWeixinInfoByAppid(String appid) throws ConfigurationException { |
481 | if (com.topdraw.utils.StringUtils.isBlank(appid)) { | 476 | if (StringUtils.isBlank(appid)) { |
482 | throw new RuntimeException("wxAppid can not be null"); | 477 | throw new RuntimeException("wxAppid can not be null"); |
483 | } | 478 | } |
484 | List<Map<String, String>> list = weixinInfoConfig.getWechatAppList(); | 479 | List<Map<String, String>> list = weixinInfoConfig.getWechatAppList(); |
... | @@ -492,10 +487,10 @@ public class UserOperationController { | ... | @@ -492,10 +487,10 @@ public class UserOperationController { |
492 | @PostMapping("/unsubscribe") | 487 | @PostMapping("/unsubscribe") |
493 | @ApiOperation("微信公众号取关") | 488 | @ApiOperation("微信公众号取关") |
494 | @AnonymousAccess | 489 | @AnonymousAccess |
495 | public ResultInfo unsubscribe(@Validated @RequestBody SubscribeBeanEvent data) { | 490 | public ResultInfo unsubscribe(@Validated @RequestBody SubscribeBeanEvent resource) { |
496 | log.info("UserOperationController ==> unsubscribe ==>> param ==> [{}]",data); | 491 | log.info("微信公众号取关, 参数 unsubscribe# resource ==> {}", resource); |
497 | 492 | ||
498 | SubscribeBean subscribeBean = JSONUtil.parseMsg2Object(data.getContent(), SubscribeBean.class); | 493 | SubscribeBean subscribeBean = JSONUtil.parseMsg2Object(resource.getContent(), SubscribeBean.class); |
499 | 494 | ||
500 | String appId = subscribeBean.getAppid(); | 495 | String appId = subscribeBean.getAppid(); |
501 | Assert.notNull(appId, GlobeExceptionMsg.APP_ID_IS_NULL); | 496 | Assert.notNull(appId, GlobeExceptionMsg.APP_ID_IS_NULL); |
... | @@ -506,40 +501,40 @@ public class UserOperationController { | ... | @@ -506,40 +501,40 @@ public class UserOperationController { |
506 | subscribeBean.setAppid(appId); | 501 | subscribeBean.setAppid(appId); |
507 | subscribeBean.setOpenid(openId); | 502 | subscribeBean.setOpenid(openId); |
508 | 503 | ||
509 | boolean result = this.userOperationService.unsubscribe(subscribeBean); | 504 | return ResultInfo.success(this.userOperationService.unsubscribe(subscribeBean)); |
510 | return ResultInfo.success(result); | ||
511 | } | 505 | } |
512 | 506 | ||
513 | @PostMapping("/minaBind") | 507 | @PostMapping("/minaBind") |
514 | @ApiOperation("微信小程序绑定大屏") | 508 | @ApiOperation("微信小程序绑定大屏") |
515 | @AnonymousAccess | 509 | @AnonymousAccess |
516 | public ResultInfo minaBind(@Validated(value = {BindGroup.class}) @RequestBody BindBean resources) { | 510 | public ResultInfo minaBind(@Validated(value = {BindGroup.class}) @RequestBody BindBean resources) { |
517 | log.info("UserOperationController ==> appletBind ==>> param ==> [{}]",resources); | 511 | log.info("微信小程序绑定大屏, 参数 minaBind# resources ==>> {}", resources); |
518 | 512 | ||
519 | Long memberId = resources.getMemberId(); | 513 | Long memberId = resources.getMemberId(); |
520 | if (Objects.isNull(memberId)) { | 514 | if (Objects.isNull(memberId)) { |
521 | return ResultInfo.failure("参数错误,memberId 不存在"); | 515 | log.error("微信小程序绑定大屏异常,参数错误,minaBind# message ==>> memberId不的为空"); |
516 | return ResultInfo.failure("参数错误,会员id不的为空"); | ||
522 | } | 517 | } |
523 | 518 | ||
524 | String platformAccount = resources.getPlatformAccount(); | 519 | String platformAccount = resources.getPlatformAccount(); |
525 | if (StringUtils.isBlank(platformAccount)) { | 520 | if (StringUtils.isBlank(platformAccount)) { |
526 | return ResultInfo.failure("参数错误,大屏账号不存在"); | 521 | log.error("微信小程序绑定大屏异常,参数错误,minaBind# message ==>> 大屏账号不的为空"); |
522 | return ResultInfo.failure("参数错误,大屏账号不的为空"); | ||
527 | } | 523 | } |
528 | 524 | ||
529 | boolean result = this.userOperationService.minaBind(resources); | 525 | return ResultInfo.success(this.userOperationService.minaBind(resources)); |
530 | return ResultInfo.success(result); | ||
531 | } | 526 | } |
532 | 527 | ||
533 | @PostMapping("/minaUnbind") | 528 | @PostMapping("/minaUnbind") |
534 | @ApiOperation("小屏解绑") | 529 | @ApiOperation("小屏解绑") |
535 | @AnonymousAccess | 530 | @AnonymousAccess |
536 | public ResultInfo minaUnbind(@Validated(value = {UnbindGroup.class}) @RequestBody WeixinUnBindBean weixinUnBindBean) { | 531 | public ResultInfo minaUnbind(@Validated(value = {UnbindGroup.class}) @RequestBody WeixinUnBindBean weixinUnBindBean) { |
537 | log.info("小屏解绑,参数 ==> [minaUnbind#{}]", weixinUnBindBean); | 532 | log.info("小屏解绑,参数 minaUnbind# resource ==>> {}", weixinUnBindBean); |
538 | 533 | ||
539 | Long memberId = weixinUnBindBean.getMemberId(); | 534 | Long memberId = weixinUnBindBean.getMemberId(); |
540 | if (Objects.isNull(memberId)) { | 535 | if (Objects.isNull(memberId)) { |
541 | log.error("小屏解绑失败,参数错误,memberId不存在"); | 536 | log.error("小屏解绑失败,参数错误,minaUnbind# message ==>> memberId不存在"); |
542 | return ResultInfo.failure("参数错误,无会员id"); | 537 | return ResultInfo.failure("参数错误,会员id不的为空"); |
543 | } | 538 | } |
544 | 539 | ||
545 | return this.userOperationService.minaUnbind(weixinUnBindBean); | 540 | return this.userOperationService.minaUnbind(weixinUnBindBean); |
... | @@ -550,29 +545,25 @@ public class UserOperationController { | ... | @@ -550,29 +545,25 @@ public class UserOperationController { |
550 | * 1.未关注、未绑定 | 545 | * 1.未关注、未绑定 |
551 | * 2.已绑定、未关注 | 546 | * 2.已绑定、未关注 |
552 | * 3.已关注、未绑定 | 547 | * 3.已关注、未绑定 |
553 | * @param data | ||
554 | * @return | ||
555 | */ | 548 | */ |
556 | @PostMapping(value = "/memberPreprocess") | 549 | @PostMapping(value = "/memberPreprocess") |
557 | @ApiOperation("暂存大小屏信息并检查关注与绑定状态") | 550 | @ApiOperation("暂存大小屏信息并检查关注与绑定状态") |
558 | @AnonymousAccess | 551 | @AnonymousAccess |
559 | public ResultInfo memberPreprocess(@RequestBody String data) { | 552 | public ResultInfo memberPreprocess(@RequestBody String data) { |
553 | log.info("暂存大小屏信息并检查关注与绑定状态,参数 memberPreprocess# resource ==>> {}", data); | ||
560 | 554 | ||
561 | log.info("UserOperationController ==> saveUserInfo ==>> param ==>> [{}]",data); | ||
562 | if (StringUtils.isBlank(data)) { | 555 | if (StringUtils.isBlank(data)) { |
563 | log.error("预存大小屏账号信息失败,无参数"); | 556 | log.error("预存大小屏账号信息异常,memberPreprocess# message ==>> 无参数"); |
564 | return ResultInfo.failure("参数错误"); | 557 | return ResultInfo.failure("参数错误,无参数"); |
565 | } | 558 | } |
566 | 559 | ||
567 | JSONObject json = JSONObject.parseObject(data); | 560 | JSONObject json = JSONObject.parseObject(data); |
568 | |||
569 | String unionid = json.getString("unionid"); | 561 | String unionid = json.getString("unionid"); |
570 | if (StringUtils.isBlank(unionid)) { | 562 | if (StringUtils.isBlank(unionid)) { |
571 | log.error("预存大小屏账号信息失败,参数错误,unionid不存在"); | 563 | log.error("预存大小屏账号信息异常,memberPreprocess# message ==>> unionid不的为空"); |
572 | return ResultInfo.failure("参数错误,unionid不存在"); | 564 | return ResultInfo.failure("参数错误,unionid不的为空"); |
573 | } | 565 | } |
574 | 566 | ||
575 | |||
576 | List<Object> resultList = new ArrayList<>(); | 567 | List<Object> resultList = new ArrayList<>(); |
577 | // 大屏侧通过返回值来展示对应的小程序页面 | 568 | // 大屏侧通过返回值来展示对应的小程序页面 |
578 | String result = SUBSCRIBE; | 569 | String result = SUBSCRIBE; |
... | @@ -587,7 +578,6 @@ public class UserOperationController { | ... | @@ -587,7 +578,6 @@ public class UserOperationController { |
587 | result = UNSUBSCRIBE; | 578 | result = UNSUBSCRIBE; |
588 | resultList.add(result); | 579 | resultList.add(result); |
589 | resultList.add(platformAccount1); | 580 | resultList.add(platformAccount1); |
590 | log.info("saveUserInfo ==>> result ==>> [{}]",resultList); | ||
591 | return ResultInfo.success(resultList); | 581 | return ResultInfo.success(resultList); |
592 | 582 | ||
593 | } else { | 583 | } else { |
... | @@ -612,8 +602,8 @@ public class UserOperationController { | ... | @@ -612,8 +602,8 @@ public class UserOperationController { |
612 | } else { | 602 | } else { |
613 | 603 | ||
614 | // 数据异常,没有会员 | 604 | // 数据异常,没有会员 |
615 | log.info("userWeixinDTO ==>> [{}]",userWeixinDTO); | 605 | log.error("预存大小屏账号信息异常,memberPreprocess# message ==>> 会员不存在"); |
616 | throw new EntityNotFoundException(MemberDTO.class,"code","member is null !!"); | 606 | return ResultInfo.failure("会员不存在"); |
617 | 607 | ||
618 | } | 608 | } |
619 | 609 | ||
... | @@ -627,23 +617,21 @@ public class UserOperationController { | ... | @@ -627,23 +617,21 @@ public class UserOperationController { |
627 | String content = (String) this.redisUtils.get(RedisKeyUtil.genSeSuSubscribeKey(unionid)); | 617 | String content = (String) this.redisUtils.get(RedisKeyUtil.genSeSuSubscribeKey(unionid)); |
628 | JSONObject iptvUserInfo = JSONObject.parseObject(content); | 618 | JSONObject iptvUserInfo = JSONObject.parseObject(content); |
629 | // redis中的大小屏信息 | 619 | // redis中的大小屏信息 |
630 | log.info("saveUserInfo ==> redis content iptvUserInfo ==> [{}]",iptvUserInfo); | 620 | log.info("预存大小屏账号信息,保存在redis中的信息,memberPreprocess# message ==> {}", iptvUserInfo); |
631 | 621 | ||
632 | // 大屏账户 | 622 | // 大屏账户 |
633 | String platformAccount = iptvUserInfo.getString("platformAccount"); | 623 | String platformAccount = iptvUserInfo.getString("platformAccount"); |
634 | 624 | ||
635 | if (StringUtils.isBlank(platformAccount)) { | 625 | if (StringUtils.isBlank(platformAccount)) { |
636 | log.warn("绑定失败,platformAccount is null "); | 626 | log.error("预存大小屏账号信息警告,memberPreprocess# message ==> 大屏账号不存在 "); |
637 | return ResultInfo.failure("绑定失败"); | 627 | return ResultInfo.failure("绑定失败"); |
638 | } | 628 | } |
639 | 629 | ||
640 | 630 | // 保存昵称和头像,头像需要进行本地化 | |
641 | try { | 631 | try { |
642 | String headimgurl = iptvUserInfo.get("headimgurl").toString(); | 632 | String headimgurl = iptvUserInfo.get("headimgurl").toString(); |
643 | |||
644 | log.info("headimgurl ==>> {}", headimgurl); | ||
645 | |||
646 | String nickname = iptvUserInfo.get("nickname").toString(); | 633 | String nickname = iptvUserInfo.get("nickname").toString(); |
634 | |||
647 | if (StringUtils.isNotBlank(nickname)) { | 635 | if (StringUtils.isNotBlank(nickname)) { |
648 | String nicknameDecode = URLDecoder.decode(nickname, "UTF-8"); | 636 | String nicknameDecode = URLDecoder.decode(nickname, "UTF-8"); |
649 | String nicknameEncode = Base64Util.encode(nicknameDecode); | 637 | String nicknameEncode = Base64Util.encode(nicknameDecode); |
... | @@ -651,14 +639,11 @@ public class UserOperationController { | ... | @@ -651,14 +639,11 @@ public class UserOperationController { |
651 | } | 639 | } |
652 | 640 | ||
653 | if (StringUtils.isNotBlank(headimgurl)) { | 641 | if (StringUtils.isNotBlank(headimgurl)) { |
654 | |||
655 | if(headimgurl.contains("https")||headimgurl.contains("http")) { | 642 | if(headimgurl.contains("https")||headimgurl.contains("http")) { |
656 | String headimgurlDecode = URLDecoder.decode(headimgurl, "UTF-8"); | 643 | String headimgurlDecode = URLDecoder.decode(headimgurl, "UTF-8"); |
657 | // String imageEncode = Base64Util.encode(headimgurlDecode); | ||
658 | String image = RestTemplateClient.netImage(headimgurlDecode); | 644 | String image = RestTemplateClient.netImage(headimgurlDecode); |
659 | memberDTO.setAvatarUrl(StringUtils.isNotBlank(image) ? image:headimgurlDecode); | 645 | memberDTO.setAvatarUrl(StringUtils.isNotBlank(image) ? image:headimgurlDecode); |
660 | } | 646 | } |
661 | |||
662 | } | 647 | } |
663 | 648 | ||
664 | } catch (Exception e) { | 649 | } catch (Exception e) { |
... | @@ -680,12 +665,7 @@ public class UserOperationController { | ... | @@ -680,12 +665,7 @@ public class UserOperationController { |
680 | 665 | ||
681 | resultList.add(result); | 666 | resultList.add(result); |
682 | resultList.add(platformAccount1); | 667 | resultList.add(platformAccount1); |
683 | 668 | return ResultInfo.success(resultList); | |
684 | // return ["subscribe","platform_account"] | ||
685 | ResultInfo<Object> success = ResultInfo.success(resultList); | ||
686 | |||
687 | log.info("saveUserInfo ==> ResultInfo ==> [{}]",success); | ||
688 | return success; | ||
689 | } | 669 | } |
690 | 670 | ||
691 | private String downloadWeixinImge(String headimgurl){ | 671 | private String downloadWeixinImge(String headimgurl){ |
... | @@ -708,118 +688,105 @@ public class UserOperationController { | ... | @@ -708,118 +688,105 @@ public class UserOperationController { |
708 | @ApiOperation("修改大屏账号") | 688 | @ApiOperation("修改大屏账号") |
709 | @AnonymousAccess | 689 | @AnonymousAccess |
710 | public ResultInfo updateUserTv(@Validated(value = {UpdateGroup.class}) @RequestBody UserTv resources) { | 690 | public ResultInfo updateUserTv(@Validated(value = {UpdateGroup.class}) @RequestBody UserTv resources) { |
711 | log.info("UserOperationController ==> updateUserTv ==>> param ==> [{}]",resources); | 691 | log.info("修改大屏账号,参数 updateUserTv# resources ==>> {}",resources); |
712 | 692 | return ResultInfo.success(this.userOperationService.updateUserTv(resources)); | |
713 | UserTvDTO result = this.userOperationService.updateUserTv(resources); | ||
714 | return ResultInfo.success(result); | ||
715 | } | 693 | } |
716 | 694 | ||
717 | @PostMapping(value = "/createTvUserAndMember") | 695 | @PostMapping(value = "/createTvUserAndMember") |
718 | @ApiOperation("保存大屏账户同时创建会员信息") | 696 | @ApiOperation("保存大屏账户同时创建会员信息") |
719 | @AnonymousAccess | 697 | @AnonymousAccess |
720 | public ResultInfo createTvUserAndMember(@Validated(value = {CreateGroup.class}) @RequestBody UserTv resources) { | 698 | public ResultInfo createTvUserAndMember(@Validated(value = {CreateGroup.class}) @RequestBody UserTv resources) { |
721 | log.info("UserOperationController ==> createTvUserAndMember ==>> param ==> [{}]",resources); | 699 | log.info("保存大屏账户同时创建会员信息, 参数 createTvUserAndMember# resources ==> {}",resources); |
722 | String platformAccount = resources.getPlatformAccount(); | 700 | String platformAccount = resources.getPlatformAccount(); |
723 | if (StringUtils.isBlank(platformAccount)) { | 701 | if (StringUtils.isBlank(platformAccount)) { |
724 | log.error("保存大屏账户同时创建会员信息异常,参数错误,大屏账号不存在"); | 702 | log.error("保存大屏账户同时创建会员信息异常,createTvUserAndMember# message ==>> 大屏账号不存在"); |
725 | return ResultInfo.failure("参数错误,大屏账号不存在"); | 703 | return ResultInfo.failure("参数错误,大屏账号不存在"); |
726 | } | 704 | } |
727 | UserTvDTO result = this.userOperationService.createTvUserAndMember(resources); | 705 | return this.userOperationService.createTvUserAndMember(resources); |
728 | return ResultInfo.success(result); | ||
729 | } | 706 | } |
730 | 707 | ||
731 | @RequestMapping(value = "/tvUnbind") | 708 | @RequestMapping(value = "/tvUnbind") |
732 | @ApiOperation("大屏解绑") | 709 | @ApiOperation("大屏解绑") |
733 | @AnonymousAccess | 710 | @AnonymousAccess |
734 | public ResultInfo tvUnbind(@Validated(value = {UpdateGroup.class}) @RequestBody TvUnBindBean resources) { | 711 | public ResultInfo tvUnbind(@Validated(value = {UpdateGroup.class}) @RequestBody TvUnBindBean resources) { |
735 | log.info("UserOperationController ==> unbind ==>> param ==> [{}]",resources); | 712 | log.info("大屏解绑, 参数 tvUnbind# resources ==> {}", resources); |
736 | 713 | ||
737 | String memberCode = resources.getMemberCode(); | 714 | String memberCode = resources.getMemberCode(); |
738 | log.info("大屏解绑,前端参数,需要解绑的会员code,memberCode ==>> {}", memberCode); | ||
739 | if (StringUtils.isBlank(memberCode)) { | 715 | if (StringUtils.isBlank(memberCode)) { |
740 | throw new BadRequestException(GlobeExceptionMsg.MEMBER_CODE_IS_NULL); | 716 | log.error("大屏解绑异常,tvUnbind# message ==>> 会员code不的为空"); |
717 | return ResultInfo.failure("会员code不的为空"); | ||
741 | } | 718 | } |
742 | 719 | ||
743 | String platformAccount = resources.getPlatformAccount(); | 720 | String platformAccount = resources.getPlatformAccount(); |
744 | log.info("大屏解绑,前端参数,大屏账号,platformAccount ==>> {}", platformAccount); | ||
745 | if (StringUtils.isBlank(platformAccount)) { | 721 | if (StringUtils.isBlank(platformAccount)) { |
746 | throw new BadRequestException(GlobeExceptionMsg.IPTV_PLATFORM_ACCOUNT_IS_NULL); | 722 | log.error("大屏解绑异常,tvUnbind# message ==>> 大屏账号不得为空"); |
723 | return ResultInfo.failure("大屏账号不的为空"); | ||
747 | } | 724 | } |
748 | 725 | ||
749 | boolean b = this.userOperationService.tvUnbind(resources); | 726 | if (this.userOperationService.tvUnbind(resources)) { |
750 | if (b) { | ||
751 | return ResultInfo.success("解绑成功"); | 727 | return ResultInfo.success("解绑成功"); |
752 | } else return ResultInfo.failure("解绑失败"); | 728 | } |
729 | |||
730 | return ResultInfo.failure("解绑失败"); | ||
753 | } | 731 | } |
754 | 732 | ||
755 | @RequestMapping(value = "/changeMainAccount") | 733 | @RequestMapping(value = "/changeMainAccount") |
756 | @ApiOperation("大屏更换主账号") | 734 | @ApiOperation("大屏更换主账号") |
757 | @AnonymousAccess | 735 | @AnonymousAccess |
758 | public ResultInfo changeMainAccount(@Validated(value = {UpdateGroup.class}) @RequestBody BindBean resources) { | 736 | public ResultInfo changeMainAccount(@Validated(value = {UpdateGroup.class}) @RequestBody BindBean resources) { |
759 | log.info("大屏更换主账号,参数 [changeMainAccount# ==> {}]",resources); | 737 | log.info("大屏更换主账号,参数 changeMainAccount# resources ==>> {}", resources); |
760 | 738 | ||
761 | // Long memberId = resources.getMemberId(); | ||
762 | String memberCode = resources.getMemberCode(); | 739 | String memberCode = resources.getMemberCode(); |
763 | /* if (StringUtils.isBlank(memberCode) && Objects.nonNull(memberId)) { | 740 | if (StringUtils.isBlank(memberCode)) { |
764 | memberCode = this.memberService.findCodeById(memberId); | 741 | log.error("大屏更换主账号异常,changeMainAccount# message ==>> 会员code不的为空"); |
765 | } else if (StringUtils.isNotBlank(memberCode) && Objects.isNull(memberId)) { | 742 | return ResultInfo.failure("会员code不的为空"); |
766 | MemberDTO memberDTO = this.memberService.findByCode(memberCode); | 743 | } |
767 | memberCode = memberDTO.getCode(); | ||
768 | }*/ | ||
769 | |||
770 | if (StringUtils.isBlank(memberCode)) | ||
771 | return ResultInfo.failure("会员code不得为空"); | ||
772 | 744 | ||
773 | MemberDTO memberDTO = this.memberService.findByCode(memberCode); | 745 | MemberDTO memberDTO = this.memberService.findByCode(memberCode); |
774 | if (Objects.isNull(memberDTO.getId())) { | 746 | if (Objects.isNull(memberDTO.getId())) { |
775 | log.error("大屏更换主账号失败,会员信息不存在, changeMainAccount# ==> {}", memberCode); | 747 | log.error("大屏更换主账号异常,changeMainAccount# message ==>> 会员信息不存在 | memberCode ==>> {}", memberCode); |
776 | return ResultInfo.failure("会员信息不存在"); | 748 | return ResultInfo.failure("会员信息不存在"); |
777 | } | 749 | } |
778 | 750 | ||
779 | String platformAccount = resources.getPlatformAccount(); | 751 | String platformAccount = resources.getPlatformAccount(); |
780 | if (StringUtils.isBlank(platformAccount)) | 752 | if (StringUtils.isBlank(platformAccount)) { |
781 | throw new BadRequestException(GlobeExceptionMsg.IPTV_PLATFORM_ACCOUNT_IS_NULL); | 753 | log.error("大屏更换主账号异常,changeMainAccount# message ==>> 大屏账号不存在 | platformAccount ==>> {}", memberCode); |
754 | return ResultInfo.failure("大屏账号不存在"); | ||
755 | } | ||
782 | 756 | ||
783 | UserTv userTv = new UserTv(); | 757 | UserTv userTv = new UserTv(); |
784 | userTv.setMemberCode(memberCode); | 758 | userTv.setMemberCode(memberCode); |
785 | userTv.setPlatformAccount(platformAccount); | 759 | userTv.setPlatformAccount(platformAccount); |
786 | boolean b = this.userOperationService.changeMainAccount(userTv); | 760 | return ResultInfo.success(this.userOperationService.changeMainAccount(userTv)); |
787 | |||
788 | return ResultInfo.success(b); | ||
789 | } | 761 | } |
790 | 762 | ||
791 | @PostMapping(value = "/deleteAllCollection") | 763 | @PostMapping(value = "/deleteAllCollection") |
792 | @ApiOperation("删除全部收藏") | 764 | @ApiOperation("删除全部收藏") |
793 | @AnonymousAccess | 765 | @AnonymousAccess |
794 | public ResultInfo deleteAllCollection(@RequestBody String content) { | 766 | public ResultInfo deleteAllCollection(@RequestBody String content) { |
795 | log.info("UserOperationController ==> deleteAllCollection ==> param ==> [{}]",content); | 767 | log.info("删除全部收藏,参数 deleteAllCollection# resources ==> {}", content); |
796 | 768 | return ResultInfo.success(this.userOperationService.deleteAllCollection(content)); | |
797 | boolean result = this.userOperationService.deleteAllCollection(content); | ||
798 | return ResultInfo.success(result); | ||
799 | } | 769 | } |
800 | 770 | ||
801 | @PostMapping(value = "/deleteCollection") | 771 | @PostMapping(value = "/deleteCollection") |
802 | @ApiOperation("删除收藏") | 772 | @ApiOperation("删除收藏") |
803 | @AnonymousAccess | 773 | @AnonymousAccess |
804 | public ResultInfo deleteCollection(@RequestBody String content) { | 774 | public ResultInfo deleteCollection(@RequestBody String content) { |
805 | log.info("UserOperationController ==> deleteCollection ==> param ==> [{}]",content); | 775 | log.info("删除收藏,参数 deleteCollection# resources ==> {}", content); |
806 | 776 | return ResultInfo.success(this.userOperationService.deleteCollection(content)); | |
807 | boolean result = this.userOperationService.deleteCollection(content); | ||
808 | return ResultInfo.success(result); | ||
809 | } | 777 | } |
810 | 778 | ||
811 | @PostMapping(value = "/addCollection") | 779 | @PostMapping(value = "/addCollection") |
812 | @ApiOperation("添加收藏") | 780 | @ApiOperation("添加收藏") |
813 | @AnonymousAccess | 781 | @AnonymousAccess |
814 | public ResultInfo addCollection(@RequestBody String content) { | 782 | public ResultInfo addCollection(@RequestBody String content) { |
815 | log.info("UserOperationController ==> addCollection ==>> param ==> [{}]",content); | 783 | log.info("添加收藏,参数 addCollection# ==>> {}", content); |
816 | if (StringUtils.isNotBlank(content)) { | 784 | if (StringUtils.isNotBlank(content)) { |
817 | boolean result = this.userOperationService.addCollection(content); | 785 | return ResultInfo.success(this.userOperationService.addCollection(content)); |
818 | return ResultInfo.success(result); | ||
819 | } | ||
820 | return ResultInfo.success(); | ||
821 | } | 786 | } |
822 | 787 | ||
788 | return ResultInfo.failure("无参数"); | ||
789 | } | ||
823 | 790 | ||
824 | } | 791 | } |
825 | 792 | ... | ... |
1 | package com.topdraw.business.process.service; | 1 | package com.topdraw.business.process.service; |
2 | 2 | ||
3 | import com.topdraw.base.modules.common.ResultInfo; | ||
3 | import com.topdraw.business.module.task.domain.Task; | 4 | import com.topdraw.business.module.task.domain.Task; |
4 | import com.topdraw.business.module.task.service.dto.TaskDTO; | 5 | import com.topdraw.business.module.task.service.dto.TaskDTO; |
5 | import com.topdraw.common.ResultInfo; | ||
6 | 6 | ||
7 | /** | 7 | /** |
8 | * @description 权益操作接口 | 8 | * @description 权益操作接口 |
... | @@ -42,7 +42,7 @@ public interface TaskOperationService { | ... | @@ -42,7 +42,7 @@ public interface TaskOperationService { |
42 | * | 42 | * |
43 | * @param task | 43 | * @param task |
44 | */ | 44 | */ |
45 | TaskDTO updateTask(Task task); | 45 | ResultInfo updateTask(Task task); |
46 | 46 | ||
47 | /** | 47 | /** |
48 | * | 48 | * | ... | ... |
1 | package com.topdraw.business.process.service; | 1 | package com.topdraw.business.process.service; |
2 | 2 | ||
3 | import com.topdraw.base.modules.common.ResultInfo; | ||
3 | import com.topdraw.business.module.member.service.dto.MemberDTO; | 4 | import com.topdraw.business.module.member.service.dto.MemberDTO; |
4 | import com.topdraw.business.module.user.app.domain.UserApp; | 5 | import com.topdraw.business.module.user.app.domain.UserApp; |
5 | import com.topdraw.business.module.user.app.domain.UserAppBind; | 6 | import com.topdraw.business.module.user.app.domain.UserAppBind; |
... | @@ -14,7 +15,6 @@ import com.topdraw.business.process.domian.weixin.BindBean; | ... | @@ -14,7 +15,6 @@ import com.topdraw.business.process.domian.weixin.BindBean; |
14 | import com.topdraw.business.process.domian.weixin.SubscribeBean; | 15 | import com.topdraw.business.process.domian.weixin.SubscribeBean; |
15 | import com.topdraw.business.process.domian.weixin.TvUnBindBean; | 16 | import com.topdraw.business.process.domian.weixin.TvUnBindBean; |
16 | import com.topdraw.business.process.domian.weixin.WeixinUnBindBean; | 17 | import com.topdraw.business.process.domian.weixin.WeixinUnBindBean; |
17 | import com.topdraw.common.ResultInfo; | ||
18 | 18 | ||
19 | 19 | ||
20 | public interface UserOperationService { | 20 | public interface UserOperationService { |
... | @@ -24,21 +24,21 @@ public interface UserOperationService { | ... | @@ -24,21 +24,21 @@ public interface UserOperationService { |
24 | * @param resources | 24 | * @param resources |
25 | * @return | 25 | * @return |
26 | */ | 26 | */ |
27 | UserTvDTO createTvUserAndMember(UserTv resources); | 27 | ResultInfo createTvUserAndMember(UserTv resources); |
28 | 28 | ||
29 | /** | 29 | /** |
30 | * 保存小屏账户并创建会员 | 30 | * 保存小屏账户并创建会员 |
31 | * @param resources | 31 | * @param resources |
32 | * @return | 32 | * @return |
33 | */ | 33 | */ |
34 | UserWeixinDTO createWeixinUserAndMember(UserWeixin resources); | 34 | ResultInfo createWeixinUserAndMember(UserWeixin resources); |
35 | 35 | ||
36 | /** | 36 | /** |
37 | * 保存小屏账户并创建会员 | 37 | * 保存小屏账户并创建会员 |
38 | * @param resources | 38 | * @param resources |
39 | * @return | 39 | * @return |
40 | */ | 40 | */ |
41 | UserWeixinDTO createWeixinUserAndMember(UserWeixin resources, Integer vip); | 41 | ResultInfo createWeixinUserAndMember(UserWeixin resources, Integer vip); |
42 | 42 | ||
43 | /** | 43 | /** |
44 | * 服务号(H5)登录 | 44 | * 服务号(H5)登录 |
... | @@ -124,7 +124,7 @@ public interface UserOperationService { | ... | @@ -124,7 +124,7 @@ public interface UserOperationService { |
124 | * @param resources | 124 | * @param resources |
125 | * @return | 125 | * @return |
126 | */ | 126 | */ |
127 | boolean appBind(BindBean resources); | 127 | ResultInfo appBind(BindBean resources); |
128 | 128 | ||
129 | /** | 129 | /** |
130 | * | 130 | * |
... | @@ -205,18 +205,15 @@ public interface UserOperationService { | ... | @@ -205,18 +205,15 @@ public interface UserOperationService { |
205 | 205 | ||
206 | /** | 206 | /** |
207 | * | 207 | * |
208 | * @param resources | 208 | * @param growthReport |
209 | * @return | 209 | * @return |
210 | */ | 210 | */ |
211 | boolean updatePasswordById(UserApp resources); | 211 | ResultInfo saveGrowthReport(GrowthReport growthReport); |
212 | 212 | ||
213 | /** | 213 | /** |
214 | * | 214 | * |
215 | * @param growthReport | 215 | * @param userApp |
216 | * @return | 216 | * @return |
217 | */ | 217 | */ |
218 | ResultInfo saveGrowthReport(GrowthReport growthReport); | ||
219 | |||
220 | |||
221 | boolean appCancellation(UserApp userApp); | 218 | boolean appCancellation(UserApp userApp); |
222 | } | 219 | } | ... | ... |
1 | package com.topdraw.business.process.service.impl; | 1 | package com.topdraw.business.process.service.impl; |
2 | 2 | ||
3 | import com.topdraw.aspect.AsyncMqSend; | 3 | import com.topdraw.aspect.AsyncMqSend; |
4 | import com.topdraw.base.modules.utils.RedisUtils; | ||
4 | import com.topdraw.business.module.coupon.history.domain.CouponHistory; | 5 | import com.topdraw.business.module.coupon.history.domain.CouponHistory; |
5 | import com.topdraw.business.module.coupon.history.service.CouponHistoryService; | 6 | import com.topdraw.business.module.coupon.history.service.CouponHistoryService; |
6 | import com.topdraw.business.module.coupon.service.CouponService; | 7 | import com.topdraw.business.module.coupon.service.CouponService; |
... | @@ -13,7 +14,6 @@ import com.topdraw.business.process.domian.TempCoupon; | ... | @@ -13,7 +14,6 @@ import com.topdraw.business.process.domian.TempCoupon; |
13 | import com.topdraw.business.process.service.RightsOperationService; | 14 | import com.topdraw.business.process.service.RightsOperationService; |
14 | import com.topdraw.business.RedisKeyConstants; | 15 | import com.topdraw.business.RedisKeyConstants; |
15 | import com.topdraw.util.TimestampUtil; | 16 | import com.topdraw.util.TimestampUtil; |
16 | import com.topdraw.utils.RedisUtils; | ||
17 | import lombok.extern.slf4j.Slf4j; | 17 | import lombok.extern.slf4j.Slf4j; |
18 | import org.springframework.aop.framework.AopContext; | 18 | import org.springframework.aop.framework.AopContext; |
19 | import org.springframework.beans.BeanUtils; | 19 | import org.springframework.beans.BeanUtils; | ... | ... |
1 | package com.topdraw.business.process.service.impl; | 1 | package com.topdraw.business.process.service.impl; |
2 | 2 | ||
3 | import com.topdraw.aspect.AsyncMqSend; | 3 | import com.topdraw.aspect.AsyncMqSend; |
4 | import com.topdraw.base.modules.utils.RedisUtils; | ||
4 | import com.topdraw.business.module.exp.detail.domain.ExpDetail; | 5 | import com.topdraw.business.module.exp.detail.domain.ExpDetail; |
5 | import com.topdraw.business.module.exp.detail.service.ExpDetailService; | 6 | import com.topdraw.business.module.exp.detail.service.ExpDetailService; |
6 | import com.topdraw.business.module.member.domain.Member; | 7 | import com.topdraw.business.module.member.domain.Member; |
... | @@ -13,9 +14,8 @@ import com.topdraw.business.process.service.member.MemberOperationService; | ... | @@ -13,9 +14,8 @@ import com.topdraw.business.process.service.member.MemberOperationService; |
13 | import com.topdraw.business.process.domian.TempExp; | 14 | import com.topdraw.business.process.domian.TempExp; |
14 | import com.topdraw.business.RedisKeyConstants; | 15 | import com.topdraw.business.RedisKeyConstants; |
15 | import com.topdraw.util.TimestampUtil; | 16 | import com.topdraw.util.TimestampUtil; |
16 | import com.topdraw.utils.RedisUtils; | ||
17 | import com.topdraw.utils.StringUtils; | ||
18 | import lombok.extern.slf4j.Slf4j; | 17 | import lombok.extern.slf4j.Slf4j; |
18 | import org.apache.commons.lang3.StringUtils; | ||
19 | import org.springframework.aop.framework.AopContext; | 19 | import org.springframework.aop.framework.AopContext; |
20 | import org.springframework.beans.BeanUtils; | 20 | import org.springframework.beans.BeanUtils; |
21 | import org.springframework.beans.factory.annotation.Autowired; | 21 | import org.springframework.beans.factory.annotation.Autowired; |
... | @@ -111,7 +111,8 @@ public class ExpOperationServiceImpl implements ExpOperationService { | ... | @@ -111,7 +111,8 @@ public class ExpOperationServiceImpl implements ExpOperationService { |
111 | MemberLevelDTO memberLevelDTO = this.memberLevelService.findByLevel(memberLevel + 1); | 111 | MemberLevelDTO memberLevelDTO = this.memberLevelService.findByLevel(memberLevel + 1); |
112 | // 4.成长值比较,判断是否升级 | 112 | // 4.成长值比较,判断是否升级 |
113 | Integer level = this.compareExp(totalExp, memberLevelDTO, memberLevel); | 113 | Integer level = this.compareExp(totalExp, memberLevelDTO, memberLevel); |
114 | 114 | if (level > memberLevel) { | |
115 | log.info("会员等级提升,更新会员等级 refreshMemberExpAndLevel#"); | ||
115 | // 5.更新用户信息 | 116 | // 5.更新用户信息 |
116 | Member member = new Member(); | 117 | Member member = new Member(); |
117 | member.setId(memberId); | 118 | member.setId(memberId); |
... | @@ -123,7 +124,6 @@ public class ExpOperationServiceImpl implements ExpOperationService { | ... | @@ -123,7 +124,6 @@ public class ExpOperationServiceImpl implements ExpOperationService { |
123 | 124 | ||
124 | ((ExpOperationServiceImpl) AopContext.currentProxy()).asyncMemberExpAndLevel(member); | 125 | ((ExpOperationServiceImpl) AopContext.currentProxy()).asyncMemberExpAndLevel(member); |
125 | 126 | ||
126 | if (level > memberLevel) { | ||
127 | MemberSimpleDTO memberSimpleDTO = this.memberService.findSimpleById(memberId); | 127 | MemberSimpleDTO memberSimpleDTO = this.memberService.findSimpleById(memberId); |
128 | if (Objects.nonNull(memberLevelDTO.getId())) { | 128 | if (Objects.nonNull(memberLevelDTO.getId())) { |
129 | memberSimpleDTO.setLevel(level); | 129 | memberSimpleDTO.setLevel(level); |
... | @@ -132,14 +132,13 @@ public class ExpOperationServiceImpl implements ExpOperationService { | ... | @@ -132,14 +132,13 @@ public class ExpOperationServiceImpl implements ExpOperationService { |
132 | 132 | ||
133 | } | 133 | } |
134 | } | 134 | } |
135 | |||
136 | } | 135 | } |
137 | 136 | ||
138 | private Integer compareExp(long newExp, MemberLevelDTO memberLevelDTO, Integer oldMemberLevel) { | 137 | private Integer compareExp(long totalExp, MemberLevelDTO memberLevelDTO, Integer oldMemberLevel) { |
139 | if (Objects.nonNull(memberLevelDTO.getId())) { | ||
140 | Long nextLevelExp = memberLevelDTO.getExpValue(); | 138 | Long nextLevelExp = memberLevelDTO.getExpValue(); |
141 | if (Objects.nonNull(nextLevelExp) && nextLevelExp > 0) | 139 | log.info("当前会员经验值 ==>> {} || 下一级会员经验值 ==>> {}", totalExp, nextLevelExp); |
142 | if(newExp - nextLevelExp >= 0){ | 140 | if (Objects.nonNull(nextLevelExp) && nextLevelExp > 0) { |
141 | if (totalExp - nextLevelExp >= 0) { | ||
143 | return memberLevelDTO.getLevel(); | 142 | return memberLevelDTO.getLevel(); |
144 | } | 143 | } |
145 | } | 144 | } | ... | ... |
... | @@ -2,6 +2,7 @@ package com.topdraw.business.process.service.impl; | ... | @@ -2,6 +2,7 @@ package com.topdraw.business.process.service.impl; |
2 | 2 | ||
3 | 3 | ||
4 | import com.topdraw.aspect.AsyncMqSend; | 4 | import com.topdraw.aspect.AsyncMqSend; |
5 | import com.topdraw.base.modules.utils.RedisUtils; | ||
5 | import com.topdraw.business.module.member.domain.Member; | 6 | import com.topdraw.business.module.member.domain.Member; |
6 | import com.topdraw.business.module.member.service.MemberService; | 7 | import com.topdraw.business.module.member.service.MemberService; |
7 | import com.topdraw.business.module.member.service.dto.MemberDTO; | 8 | import com.topdraw.business.module.member.service.dto.MemberDTO; |
... | @@ -18,9 +19,8 @@ import com.topdraw.business.RedisKeyConstants; | ... | @@ -18,9 +19,8 @@ import com.topdraw.business.RedisKeyConstants; |
18 | import com.topdraw.util.DateUtil; | 19 | import com.topdraw.util.DateUtil; |
19 | import com.topdraw.util.IdWorker; | 20 | import com.topdraw.util.IdWorker; |
20 | import com.topdraw.util.TimestampUtil; | 21 | import com.topdraw.util.TimestampUtil; |
21 | import com.topdraw.utils.RedisUtils; | ||
22 | import com.topdraw.utils.StringUtils; | ||
23 | import lombok.extern.slf4j.Slf4j; | 22 | import lombok.extern.slf4j.Slf4j; |
23 | import org.apache.commons.lang3.StringUtils; | ||
24 | import org.springframework.aop.framework.AopContext; | 24 | import org.springframework.aop.framework.AopContext; |
25 | import org.springframework.beans.BeanUtils; | 25 | import org.springframework.beans.BeanUtils; |
26 | import org.springframework.beans.factory.annotation.Autowired; | 26 | import org.springframework.beans.factory.annotation.Autowired; |
... | @@ -204,7 +204,7 @@ public class PointsOperationServiceImpl implements PointsOperationService { | ... | @@ -204,7 +204,7 @@ public class PointsOperationServiceImpl implements PointsOperationService { |
204 | BeanUtils.copyProperties(pointsAvailableDTO, _tempPoints); | 204 | BeanUtils.copyProperties(pointsAvailableDTO, _tempPoints); |
205 | BeanUtils.copyProperties(tempPoints, _tempPoints); | 205 | BeanUtils.copyProperties(tempPoints, _tempPoints); |
206 | _tempPoints.setPoints(-(Math.abs(points))); | 206 | _tempPoints.setPoints(-(Math.abs(points))); |
207 | Long totalPoints = currentPoints + tempPoints.getPoints(); | 207 | Long totalPoints = currentPoints - points; |
208 | 208 | ||
209 | this.doInsertTrPointsDetail(memberId, memberCode, _tempPoints, currentPoints, totalPoints); | 209 | this.doInsertTrPointsDetail(memberId, memberCode, _tempPoints, currentPoints, totalPoints); |
210 | } | 210 | } | ... | ... |
1 | package com.topdraw.business.process.service.impl; | 1 | package com.topdraw.business.process.service.impl; |
2 | 2 | ||
3 | import com.alibaba.fastjson.JSON; | 3 | import com.alibaba.fastjson.JSON; |
4 | import com.alibaba.fastjson.JSONArray; | ||
5 | import com.alibaba.fastjson.JSONObject; | 4 | import com.alibaba.fastjson.JSONObject; |
6 | import com.topdraw.aspect.AsyncMqSend; | 5 | import com.topdraw.aspect.AsyncMqSend; |
6 | import com.topdraw.base.modules.common.ResultInfo; | ||
7 | import com.topdraw.base.modules.utils.RedisUtils; | ||
7 | import com.topdraw.business.module.coupon.service.CouponService; | 8 | import com.topdraw.business.module.coupon.service.CouponService; |
8 | import com.topdraw.business.module.coupon.service.dto.CouponDTO; | 9 | import com.topdraw.business.module.coupon.service.dto.CouponDTO; |
9 | import com.topdraw.business.module.member.service.dto.MemberSimpleDTO; | 10 | import com.topdraw.business.module.member.service.dto.MemberSimpleDTO; |
10 | import com.topdraw.business.module.rights.service.RightsService; | 11 | import com.topdraw.business.module.rights.service.RightsService; |
11 | import com.topdraw.business.module.rights.service.dto.RightsDTO; | 12 | import com.topdraw.business.module.rights.service.dto.RightsDTO; |
12 | import com.topdraw.business.module.task.attribute.domain.TaskAttr; | ||
13 | import com.topdraw.business.module.task.attribute.service.TaskAttrService; | 13 | import com.topdraw.business.module.task.attribute.service.TaskAttrService; |
14 | import com.topdraw.business.module.task.attribute.service.dto.TaskAttrDTO; | 14 | import com.topdraw.business.module.task.attribute.service.dto.TaskAttrDTO; |
15 | import com.topdraw.business.module.task.domain.TaskBuilder; | 15 | import com.topdraw.business.module.task.domain.TaskBuilder; |
... | @@ -32,25 +32,22 @@ import com.topdraw.business.module.task.service.TaskService; | ... | @@ -32,25 +32,22 @@ import com.topdraw.business.module.task.service.TaskService; |
32 | import com.topdraw.business.module.task.template.service.TaskTemplateService; | 32 | import com.topdraw.business.module.task.template.service.TaskTemplateService; |
33 | import com.topdraw.business.process.domian.*; | 33 | import com.topdraw.business.process.domian.*; |
34 | import com.topdraw.business.process.service.UserOperationService; | 34 | import com.topdraw.business.process.service.UserOperationService; |
35 | import com.topdraw.common.ResultInfo; | ||
36 | import com.topdraw.business.LocalConstants; | 35 | import com.topdraw.business.LocalConstants; |
37 | import com.topdraw.business.module.rights.constant.RightTypeConstants; | 36 | import com.topdraw.business.module.rights.constant.RightTypeConstants; |
38 | import com.topdraw.business.module.task.template.constant.TaskEventType; | 37 | import com.topdraw.business.module.task.template.constant.TaskEventType; |
39 | import com.topdraw.business.RedisKeyConstants; | 38 | import com.topdraw.business.RedisKeyConstants; |
40 | import com.topdraw.mq.module.mq.DataSyncMsg; | 39 | import com.topdraw.mq.module.mq.DataSyncMsg; |
41 | import com.topdraw.util.*; | 40 | import com.topdraw.util.*; |
42 | import com.topdraw.utils.RedisUtils; | ||
43 | import lombok.extern.slf4j.Slf4j; | 41 | import lombok.extern.slf4j.Slf4j; |
44 | import org.apache.commons.lang3.StringUtils; | 42 | import org.apache.commons.lang3.StringUtils; |
45 | import org.springframework.aop.framework.AopContext; | 43 | import org.springframework.aop.framework.AopContext; |
46 | import org.springframework.beans.BeanUtils; | 44 | import org.springframework.beans.BeanUtils; |
47 | import org.springframework.beans.factory.annotation.Autowired; | 45 | import org.springframework.beans.factory.annotation.Autowired; |
48 | import org.springframework.beans.factory.annotation.Value; | 46 | import org.springframework.beans.factory.annotation.Value; |
49 | import org.springframework.cache.annotation.CacheEvict; | ||
50 | import org.springframework.data.redis.core.RedisTemplate; | ||
51 | import org.springframework.data.redis.core.StringRedisTemplate; | 47 | import org.springframework.data.redis.core.StringRedisTemplate; |
52 | import org.springframework.data.redis.core.ValueOperations; | 48 | import org.springframework.data.redis.core.ValueOperations; |
53 | import org.springframework.stereotype.Service; | 49 | import org.springframework.stereotype.Service; |
50 | import org.springframework.transaction.annotation.Transactional; | ||
54 | import org.springframework.util.CollectionUtils; | 51 | import org.springframework.util.CollectionUtils; |
55 | 52 | ||
56 | import java.sql.Timestamp; | 53 | import java.sql.Timestamp; |
... | @@ -100,68 +97,70 @@ public class TaskOperationServiceImpl implements TaskOperationService { | ... | @@ -100,68 +97,70 @@ public class TaskOperationServiceImpl implements TaskOperationService { |
100 | private static final Integer POINTS_MIN = 1; | 97 | private static final Integer POINTS_MIN = 1; |
101 | 98 | ||
102 | @Override | 99 | @Override |
103 | // @CacheEvict(cacheNames = RedisKeyConstants.cacheTaskByEvent, key = "#task.event") | 100 | @Transactional(rollbackFor = Exception.class) |
104 | public TaskDTO createTask(Task task) { | 101 | public TaskDTO createTask(Task content) { |
105 | Long taskTemplateId = task.getTaskTemplateId(); | 102 | Long taskTemplateId = content.getTaskTemplateId(); |
106 | TaskTemplateDTO taskTemplateDTO = this.taskTemplateService.findById(taskTemplateId); | 103 | TaskTemplateDTO taskTemplateDTO = this.taskTemplateService.findById(taskTemplateId); |
107 | 104 | ||
108 | task.setTaskTemplateCode(taskTemplateDTO.getCode()); | 105 | content.setTaskTemplateCode(taskTemplateDTO.getCode()); |
109 | Task task_ = TaskBuilder.build(task); | 106 | Task task = TaskBuilder.build(content); |
110 | TaskDTO taskDTO = this.taskService.create(task_); | 107 | TaskDTO taskDTO = this.taskService.create(task); |
111 | 108 | ||
112 | ((TaskOperationServiceImpl) AopContext.currentProxy()).asyncCreateTask(task_); | 109 | ((TaskOperationServiceImpl) AopContext.currentProxy()).asyncCreateTask(task); |
113 | 110 | ||
114 | return taskDTO; | 111 | return taskDTO; |
115 | } | 112 | } |
116 | 113 | ||
117 | @Override | 114 | @Override |
118 | // @CacheEvict(cacheNames = RedisKeyConstants.cacheTaskByEventAndMemberLevelAndVip, key = "#task.event") | 115 | @Transactional(rollbackFor = Exception.class) |
119 | public TaskDTO updateTask(Task task) { | 116 | public ResultInfo updateTask(Task content) { |
120 | Long taskTemplateId = task.getTaskTemplateId(); | 117 | |
118 | Long taskTemplateId = content.getTaskTemplateId(); | ||
119 | if (Objects.nonNull(taskTemplateId)) { | ||
121 | TaskTemplateDTO taskTemplateDTO = this.taskTemplateService.findById(taskTemplateId); | 120 | TaskTemplateDTO taskTemplateDTO = this.taskTemplateService.findById(taskTemplateId); |
122 | task.setTaskTemplateCode(taskTemplateDTO.getCode()); | 121 | content.setTaskTemplateCode(taskTemplateDTO.getCode()); |
123 | TaskDTO update = this.taskService.update(task); | ||
124 | if (Objects.nonNull(update.getId())) { | ||
125 | this.updateTaskAttr(task); | ||
126 | } | 122 | } |
127 | 123 | ||
128 | ((TaskOperationServiceImpl) AopContext.currentProxy()).asyncUpdateTask(task); | 124 | TaskDTO taskDTO = this.taskService.update(content); |
125 | ((TaskOperationServiceImpl) AopContext.currentProxy()).asyncUpdateTask(content); | ||
129 | 126 | ||
130 | return update; | 127 | Set<Object> tasks = this.redisUtils.keys(RedisKeyConstants.cacheTaskByEventAndMemberLevelAndVip+"*"); |
128 | if (!CollectionUtils.isEmpty(tasks)) { | ||
129 | for (Object key : tasks) { | ||
130 | this.redisUtils.del(key.toString()); | ||
131 | } | 131 | } |
132 | |||
133 | /** | ||
134 | * | ||
135 | * @param task 任务 | ||
136 | */ | ||
137 | private void updateTaskAttr(Task task) { | ||
138 | TaskAttrDTO taskAttrDTO = this.taskAttrService.findByTaskId(task.getId()); | ||
139 | if (Objects.nonNull(taskAttrDTO.getId())) { | ||
140 | TaskAttr taskAttr = new TaskAttr(); | ||
141 | BeanUtils.copyProperties(taskAttrDTO, taskAttr); | ||
142 | taskAttr.setAttrStr(task.getAttr()); | ||
143 | this.taskAttrService.update(taskAttr); | ||
144 | } | 132 | } |
133 | |||
134 | return ResultInfo.success(taskDTO); | ||
145 | } | 135 | } |
146 | 136 | ||
137 | |||
147 | @Override | 138 | @Override |
148 | // @CacheEvict(cacheNames = RedisKeyConstants.cacheTaskByEvent, key = "#task.event") | 139 | @Transactional(rollbackFor = Exception.class) |
149 | public Integer deleteTask(Task task) { | 140 | public Integer deleteTask(Task content) { |
150 | Long id = task.getId(); | 141 | Long id = content.getId(); |
151 | TaskDTO taskDTO = this.findById(id); | 142 | TaskDTO taskDTO = this.findById(id); |
152 | if (Objects.nonNull(taskDTO.getId())) { | 143 | if (Objects.nonNull(taskDTO.getId())) { |
153 | task.setId(taskDTO.getId()); | 144 | content.setId(taskDTO.getId()); |
154 | Integer delete = this.taskService.delete(task); | 145 | Integer count = this.taskService.delete(content); |
155 | task.setCode(taskDTO.getCode()); | 146 | content.setCode(taskDTO.getCode()); |
156 | ((TaskOperationServiceImpl) AopContext.currentProxy()).asyncDeleteTask(task); | 147 | ((TaskOperationServiceImpl) AopContext.currentProxy()).asyncDeleteTask(content); |
148 | |||
149 | Set<Object> tasks = this.redisUtils.keys(RedisKeyConstants.cacheTaskByEventAndMemberLevelAndVip+"*"); | ||
150 | if (!CollectionUtils.isEmpty(tasks)) { | ||
151 | for (Object key : tasks) { | ||
152 | this.redisUtils.del(key.toString()); | ||
153 | } | ||
154 | } | ||
157 | 155 | ||
158 | return delete; | 156 | return count; |
159 | } | 157 | } |
160 | 158 | ||
161 | return 0; | 159 | return 0; |
162 | } | 160 | } |
163 | 161 | ||
164 | @Override | 162 | @Override |
163 | @Transactional(rollbackFor = Exception.class) | ||
165 | public Integer deleteTask(Long id) { | 164 | public Integer deleteTask(Long id) { |
166 | TaskDTO taskDTO = this.findById(id); | 165 | TaskDTO taskDTO = this.findById(id); |
167 | if (Objects.nonNull(taskDTO.getId())) { | 166 | if (Objects.nonNull(taskDTO.getId())) { |
... | @@ -175,6 +174,7 @@ public class TaskOperationServiceImpl implements TaskOperationService { | ... | @@ -175,6 +174,7 @@ public class TaskOperationServiceImpl implements TaskOperationService { |
175 | } | 174 | } |
176 | 175 | ||
177 | @Override | 176 | @Override |
177 | @Transactional(readOnly = true) | ||
178 | public TaskDTO findById(Long id) { | 178 | public TaskDTO findById(Long id) { |
179 | TaskDTO taskDTO = this.taskService.findById(id); | 179 | TaskDTO taskDTO = this.taskService.findById(id); |
180 | Long id1 = taskDTO.getId(); | 180 | Long id1 = taskDTO.getId(); |
... | @@ -187,6 +187,7 @@ public class TaskOperationServiceImpl implements TaskOperationService { | ... | @@ -187,6 +187,7 @@ public class TaskOperationServiceImpl implements TaskOperationService { |
187 | } | 187 | } |
188 | 188 | ||
189 | @Override | 189 | @Override |
190 | @Transactional(readOnly = true) | ||
190 | public TaskDTO findByCode(String code) { | 191 | public TaskDTO findByCode(String code) { |
191 | return this.taskService.findByCode(code); | 192 | return this.taskService.findByCode(code); |
192 | } | 193 | } |
... | @@ -263,7 +264,7 @@ public class TaskOperationServiceImpl implements TaskOperationService { | ... | @@ -263,7 +264,7 @@ public class TaskOperationServiceImpl implements TaskOperationService { |
263 | } | 264 | } |
264 | 265 | ||
265 | // 检索满足条件的任务 1.先检查redis中是否存在符合条件的任务 2.从redis中获取当前会员未完成的任务 | 266 | // 检索满足条件的任务 1.先检查redis中是否存在符合条件的任务 2.从redis中获取当前会员未完成的任务 |
266 | List<Task> tasks = this.findValidTasksAndRefreshTaskProcess(memberDTO, dataSyncMsg.getEvent(), msgData); | 267 | List<Task> tasks = this.findValidTasksAndRefreshTaskProcess(memberDTO, dataSyncMsg.getEvt(), msgData); |
267 | log.info("当前用户可执行的任务详情, dealTask# tasks ==>> [{}]", tasks); | 268 | log.info("当前用户可执行的任务详情, dealTask# tasks ==>> [{}]", tasks); |
268 | if (CollectionUtils.isEmpty(tasks)) { | 269 | if (CollectionUtils.isEmpty(tasks)) { |
269 | // 类型 1:登录;2:观影;3:参加活动;4:订购;5:优享会员;6:签到;7:完成设置;8:播放记录; | 270 | // 类型 1:登录;2:观影;3:参加活动;4:订购;5:优享会员;6:签到;7:完成设置;8:播放记录; |
... | @@ -314,7 +315,7 @@ public class TaskOperationServiceImpl implements TaskOperationService { | ... | @@ -314,7 +315,7 @@ public class TaskOperationServiceImpl implements TaskOperationService { |
314 | Map<Object, Object> finishTasks = new HashMap<>(); | 315 | Map<Object, Object> finishTasks = new HashMap<>(); |
315 | finishTasks.put(task.getId(), 1); | 316 | finishTasks.put(task.getId(), 1); |
316 | // 单天的记录只存储一天 | 317 | // 单天的记录只存储一天 |
317 | this.redisUtils.hmset(RedisKeyConstants.cacheTodayFinishTaskCount + "::" + memberId + ":" + LocalDate.now(), finishTasks, 24*60*60); | 318 | this.redisUtils.hmsetForObject(RedisKeyConstants.cacheTodayFinishTaskCount + "::" + memberId + ":" + LocalDate.now(), finishTasks, 24*60*60); |
318 | } else { | 319 | } else { |
319 | this.redisUtils.hincr(RedisKeyConstants.cacheTodayFinishTaskCount+"::"+memberId+":"+LocalDate.now(), task.getId().toString(), 1); | 320 | this.redisUtils.hincr(RedisKeyConstants.cacheTodayFinishTaskCount+"::"+memberId+":"+LocalDate.now(), task.getId().toString(), 1); |
320 | } | 321 | } |
... | @@ -332,13 +333,13 @@ public class TaskOperationServiceImpl implements TaskOperationService { | ... | @@ -332,13 +333,13 @@ public class TaskOperationServiceImpl implements TaskOperationService { |
332 | * @param event 任务模板类型 | 333 | * @param event 任务模板类型 |
333 | * @return | 334 | * @return |
334 | */ | 335 | */ |
335 | private List<Task> findValidTasksAndRefreshTaskProcess(MemberSimpleDTO memberDTO, Integer event, JSONObject msgData) { | 336 | private List<Task> findValidTasksAndRefreshTaskProcess(MemberSimpleDTO memberDTO, String event, JSONObject msgData) { |
336 | 337 | ||
337 | // 任务是否存在 | 338 | // 任务是否存在 |
338 | List<Task> tasks = this.taskService.findByEventAndMemberLevelAndVip(event, memberDTO.getLevel(), memberDTO.getVip()); | 339 | List<Task> tasks = this.taskService.findByEventAndMemberLevelAndVip(event, memberDTO.getLevel(), memberDTO.getVip()); |
339 | log.info("查询任务列表, dealTask# tasks ==>> [{}]",tasks); | 340 | log.info("查询任务列表, dealTask# tasks ==>> [{}]",tasks); |
340 | if (Objects.isNull(tasks) || CollectionUtils.isEmpty(tasks)) { | 341 | if (Objects.isNull(tasks) || CollectionUtils.isEmpty(tasks)) { |
341 | return Collections.singletonList(null); | 342 | return null; |
342 | } | 343 | } |
343 | 344 | ||
344 | // 获取当前会员所有任务的完成进度 | 345 | // 获取当前会员所有任务的完成进度 |
... | @@ -406,13 +407,13 @@ public class TaskOperationServiceImpl implements TaskOperationService { | ... | @@ -406,13 +407,13 @@ public class TaskOperationServiceImpl implements TaskOperationService { |
406 | } | 407 | } |
407 | break; | 408 | break; |
408 | // 观影 | 409 | // 观影 |
409 | case TaskEventType.VIEW: | 410 | case TaskEventType.VIEWING: |
410 | if (this.doViewEvent(msgData, task, memberDTO)) { | 411 | if (this.doViewEvent(msgData, task, memberDTO)) { |
411 | tasksResult.add(task); | 412 | tasksResult.add(task); |
412 | } | 413 | } |
413 | break; | 414 | break; |
414 | // 参加活动 | 415 | // 参加活动 |
415 | case TaskEventType.ACTIVITY: | 416 | case TaskEventType.JOINACTIVITIES: |
416 | if (this.doActivityEvent(msgData, task, memberDTO)) { | 417 | if (this.doActivityEvent(msgData, task, memberDTO)) { |
417 | tasksResult.add(task); | 418 | tasksResult.add(task); |
418 | } | 419 | } |
... | @@ -423,9 +424,6 @@ public class TaskOperationServiceImpl implements TaskOperationService { | ... | @@ -423,9 +424,6 @@ public class TaskOperationServiceImpl implements TaskOperationService { |
423 | tasksResult.add(task); | 424 | tasksResult.add(task); |
424 | } | 425 | } |
425 | break; | 426 | break; |
426 | // 优享会员 | ||
427 | case TaskEventType.MEMBER_PRIORITY: | ||
428 | break; | ||
429 | // 签到 | 427 | // 签到 |
430 | case TaskEventType.SIGN: | 428 | case TaskEventType.SIGN: |
431 | if (this.doSignEvent(msgData, task, memberDTO)) { | 429 | if (this.doSignEvent(msgData, task, memberDTO)) { |
... | @@ -433,7 +431,7 @@ public class TaskOperationServiceImpl implements TaskOperationService { | ... | @@ -433,7 +431,7 @@ public class TaskOperationServiceImpl implements TaskOperationService { |
433 | } | 431 | } |
434 | break; | 432 | break; |
435 | // 完善个人资料 | 433 | // 完善个人资料 |
436 | case TaskEventType.COMPLETE_INFO: | 434 | case TaskEventType.COMPLETEMEMBERINFO: |
437 | if (this.doCompleteMemberInfoEvent(msgData, task, memberDTO)) { | 435 | if (this.doCompleteMemberInfoEvent(msgData, task, memberDTO)) { |
438 | tasksResult.add(task); | 436 | tasksResult.add(task); |
439 | } | 437 | } |
... | @@ -453,21 +451,18 @@ public class TaskOperationServiceImpl implements TaskOperationService { | ... | @@ -453,21 +451,18 @@ public class TaskOperationServiceImpl implements TaskOperationService { |
453 | } | 451 | } |
454 | break; | 452 | break; |
455 | // 积分转移 | 453 | // 积分转移 |
456 | case TaskEventType.POINTS_TRANS: | 454 | case TaskEventType.FIRSTPOINTSTRANS: |
457 | if (this.doPointsTransEvent(msgData, task, memberDTO)) { | 455 | if (this.doPointsTransEvent(msgData, task, memberDTO)) { |
458 | tasksResult.add(task); | 456 | tasksResult.add(task); |
459 | } | 457 | } |
460 | break; | 458 | break; |
461 | // 积分兑换商品 | 459 | // 积分兑换商品 |
462 | case TaskEventType.POINTS_EXCHANGE_GOODS: | 460 | case TaskEventType.FIRSTPOINTSEXCHANGE: |
463 | // 完成设置次数 | 461 | // 完成设置次数 |
464 | if (this.doPointsExchangeGoodsEvent(msgData, task, memberDTO)) { | 462 | if (this.doPointsExchangeGoodsEvent(msgData, task, memberDTO)) { |
465 | tasksResult.add(task); | 463 | tasksResult.add(task); |
466 | } | 464 | } |
467 | break; | 465 | break; |
468 | // 其他 | ||
469 | case TaskEventType.SYSTEM_OPERATE: | ||
470 | break; | ||
471 | default: | 466 | default: |
472 | log.info("没有找到对应的任务"); | 467 | log.info("没有找到对应的任务"); |
473 | break; | 468 | break; |
... | @@ -546,8 +541,8 @@ public class TaskOperationServiceImpl implements TaskOperationService { | ... | @@ -546,8 +541,8 @@ public class TaskOperationServiceImpl implements TaskOperationService { |
546 | 541 | ||
547 | private boolean doActivityEvent(JSONObject msgData, Task task, MemberSimpleDTO memberDTO) { | 542 | private boolean doActivityEvent(JSONObject msgData, Task task, MemberSimpleDTO memberDTO) { |
548 | Integer actionAmount = task.getActionAmount(); | 543 | Integer actionAmount = task.getActionAmount(); |
549 | String attrStr = task.getAttr(); | 544 | String entityId = task.getEntityId(); |
550 | if (StringUtils.isBlank(attrStr)) { | 545 | if (StringUtils.isBlank(entityId)) { |
551 | int joinCount = 1;//msgData.getInteger("joinCount"); | 546 | int joinCount = 1;//msgData.getInteger("joinCount"); |
552 | if (joinCount >= actionAmount) { | 547 | if (joinCount >= actionAmount) { |
553 | this.saveOrUpdateTaskProcess(null, memberDTO.getId(), task, joinCount, TASK_FINISH_STATUS); | 548 | this.saveOrUpdateTaskProcess(null, memberDTO.getId(), task, joinCount, TASK_FINISH_STATUS); |
... | @@ -556,7 +551,7 @@ public class TaskOperationServiceImpl implements TaskOperationService { | ... | @@ -556,7 +551,7 @@ public class TaskOperationServiceImpl implements TaskOperationService { |
556 | } | 551 | } |
557 | 552 | ||
558 | Integer marketingActivityId = msgData.getInteger("marketingActivityId"); | 553 | Integer marketingActivityId = msgData.getInteger("marketingActivityId"); |
559 | if (new ArrayList<>(Arrays.asList(attrStr.split(","))).contains(Integer.toString(marketingActivityId))) { | 554 | if (new ArrayList<>(Arrays.asList(entityId.split(","))).contains(Integer.toString(marketingActivityId))) { |
560 | int joinCount = 1;//msgData.getInteger("joinCount"); | 555 | int joinCount = 1;//msgData.getInteger("joinCount"); |
561 | if (joinCount >= actionAmount) { | 556 | if (joinCount >= actionAmount) { |
562 | this.saveOrUpdateTaskProcess(null, memberDTO.getId(), task, joinCount, TASK_FINISH_STATUS); | 557 | this.saveOrUpdateTaskProcess(null, memberDTO.getId(), task, joinCount, TASK_FINISH_STATUS); |
... | @@ -564,7 +559,7 @@ public class TaskOperationServiceImpl implements TaskOperationService { | ... | @@ -564,7 +559,7 @@ public class TaskOperationServiceImpl implements TaskOperationService { |
564 | } | 559 | } |
565 | } | 560 | } |
566 | 561 | ||
567 | log.warn("未找到对应的活动,参数 marketingActivityId ==>> {} || 任务属性 ==>> {}", marketingActivityId, attrStr); | 562 | log.warn("未找到对应的活动,参数 marketingActivityId ==>> {} || 营销活动id ==>> [{}]", marketingActivityId, entityId); |
568 | return false; | 563 | return false; |
569 | } | 564 | } |
570 | 565 | ||
... | @@ -895,6 +890,10 @@ public class TaskOperationServiceImpl implements TaskOperationService { | ... | @@ -895,6 +890,10 @@ public class TaskOperationServiceImpl implements TaskOperationService { |
895 | Timestamp expireTime = task.getExpireTime(); | 890 | Timestamp expireTime = task.getExpireTime(); |
896 | // 积分类型(0:定值、1:随机) | 891 | // 积分类型(0:定值、1:随机) |
897 | Integer pointsType = task.getPointsType(); | 892 | Integer pointsType = task.getPointsType(); |
893 | if (Objects.isNull(pointsType)) { | ||
894 | log.error("当前任务的积分类型不存在,请检查数据 task ==>> {}", task); | ||
895 | return; | ||
896 | } | ||
898 | // 随机积分的最大值 | 897 | // 随机积分的最大值 |
899 | Integer rewardMaxPoints = task.getRewardMaxPoints(); | 898 | Integer rewardMaxPoints = task.getRewardMaxPoints(); |
900 | if (Objects.nonNull(rewardPoints) && rewardPoints > 0) { | 899 | if (Objects.nonNull(rewardPoints) && rewardPoints > 0) { | ... | ... |
... | @@ -6,7 +6,6 @@ import com.topdraw.business.module.task.template.domain.TaskTemplateBuilder; | ... | @@ -6,7 +6,6 @@ import com.topdraw.business.module.task.template.domain.TaskTemplateBuilder; |
6 | import com.topdraw.business.module.task.template.service.TaskTemplateService; | 6 | import com.topdraw.business.module.task.template.service.TaskTemplateService; |
7 | import com.topdraw.business.module.task.template.service.dto.TaskTemplateDTO; | 7 | import com.topdraw.business.module.task.template.service.dto.TaskTemplateDTO; |
8 | import com.topdraw.business.process.service.TaskTemplateOperationService; | 8 | import com.topdraw.business.process.service.TaskTemplateOperationService; |
9 | import com.topdraw.utils.StringUtils; | ||
10 | import lombok.extern.slf4j.Slf4j; | 9 | import lombok.extern.slf4j.Slf4j; |
11 | import org.springframework.aop.framework.AopContext; | 10 | import org.springframework.aop.framework.AopContext; |
12 | import org.springframework.beans.BeanUtils; | 11 | import org.springframework.beans.BeanUtils; | ... | ... |
... | @@ -6,6 +6,11 @@ import cn.hutool.core.util.StrUtil; | ... | @@ -6,6 +6,11 @@ import cn.hutool.core.util.StrUtil; |
6 | import com.alibaba.fastjson.JSON; | 6 | import com.alibaba.fastjson.JSON; |
7 | import com.alibaba.fastjson.JSONObject; | 7 | import com.alibaba.fastjson.JSONObject; |
8 | import com.topdraw.aspect.AsyncMqSend; | 8 | import com.topdraw.aspect.AsyncMqSend; |
9 | import com.topdraw.base.modules.common.ResultInfo; | ||
10 | import com.topdraw.base.modules.exception.BadRequestException; | ||
11 | import com.topdraw.base.modules.exception.EntityNotFoundException; | ||
12 | import com.topdraw.base.modules.utils.QueryHelp; | ||
13 | import com.topdraw.base.modules.utils.RedisUtils; | ||
9 | import com.topdraw.business.module.member.domain.Member; | 14 | import com.topdraw.business.module.member.domain.Member; |
10 | import com.topdraw.business.module.member.domain.MemberBuilder; | 15 | import com.topdraw.business.module.member.domain.MemberBuilder; |
11 | import com.topdraw.business.module.member.domain.MemberTypeConstant; | 16 | import com.topdraw.business.module.member.domain.MemberTypeConstant; |
... | @@ -48,15 +53,10 @@ import com.topdraw.business.process.service.dto.MemberAndWeixinUserDTO; | ... | @@ -48,15 +53,10 @@ import com.topdraw.business.process.service.dto.MemberAndWeixinUserDTO; |
48 | import com.topdraw.business.process.service.mapper.CollectionMq2DetailMapper; | 53 | import com.topdraw.business.process.service.mapper.CollectionMq2DetailMapper; |
49 | import com.topdraw.business.LocalConstants; | 54 | import com.topdraw.business.LocalConstants; |
50 | import com.topdraw.business.RedisKeyConstants; | 55 | import com.topdraw.business.RedisKeyConstants; |
51 | import com.topdraw.common.ResultInfo; | ||
52 | import com.topdraw.util.RedisKeyUtil; | 56 | import com.topdraw.util.RedisKeyUtil; |
53 | import com.topdraw.exception.BadRequestException; | ||
54 | import com.topdraw.exception.EntityNotFoundException; | ||
55 | import com.topdraw.exception.GlobeExceptionMsg; | 57 | import com.topdraw.exception.GlobeExceptionMsg; |
56 | import com.topdraw.resttemplate.RestTemplateClient; | 58 | import com.topdraw.resttemplate.RestTemplateClient; |
57 | import com.topdraw.util.TimestampUtil; | 59 | import com.topdraw.util.TimestampUtil; |
58 | import com.topdraw.utils.QueryHelp; | ||
59 | import com.topdraw.utils.RedisUtils; | ||
60 | import lombok.extern.slf4j.Slf4j; | 60 | import lombok.extern.slf4j.Slf4j; |
61 | import org.apache.commons.lang3.StringUtils; | 61 | import org.apache.commons.lang3.StringUtils; |
62 | import org.springframework.aop.framework.AopContext; | 62 | import org.springframework.aop.framework.AopContext; |
... | @@ -128,19 +128,24 @@ public class UserOperationServiceImpl implements UserOperationService { | ... | @@ -128,19 +128,24 @@ public class UserOperationServiceImpl implements UserOperationService { |
128 | @Transactional(rollbackFor = Exception.class) | 128 | @Transactional(rollbackFor = Exception.class) |
129 | public UserAppDTO appRegister(UserApp resources) { | 129 | public UserAppDTO appRegister(UserApp resources) { |
130 | 130 | ||
131 | // 只查询有效或者禁止状态的 | ||
131 | UserAppDTO userAppDTO = this.userAppService.findByUsername(resources.getUsername()); | 132 | UserAppDTO userAppDTO = this.userAppService.findByUsername(resources.getUsername()); |
132 | if (Objects.isNull(userAppDTO.getId())) { | ||
133 | |||
134 | // 先创建会员 | ||
135 | Member member = MemberBuilder.build(MemberTypeConstant.app, resources.getHeadimgurl(), resources.getNickname(), 0); | ||
136 | MemberDTO memberDTO = this.memberService.create(member); | ||
137 | 133 | ||
134 | // 无app账号 | ||
135 | if (Objects.isNull(userAppDTO.getId())) { | ||
136 | // 先创建会员,缓存至redis | ||
137 | MemberDTO memberDTO = this.createMember(MemberBuilder.build(MemberTypeConstant.app, resources.getHeadimgurl(), resources.getNickname(), 0)); | ||
138 | if (Objects.nonNull(memberDTO.getId())) { | 138 | if (Objects.nonNull(memberDTO.getId())) { |
139 | 139 | UserApp userApp = UserAppBuilder.build(memberDTO.getId(), resources); | |
140 | // 保存app账号 | 140 | // 保存app账号 |
141 | UserAppDTO _userAppDTO = this.userAppService.create(UserAppBuilder.build(memberDTO.getId(), resources)); | 141 | UserAppDTO _userAppDTO = null; |
142 | if (Objects.isNull(userApp.getId())) { | ||
143 | _userAppDTO = this.userAppService.create(userApp); | ||
144 | } else { | ||
145 | _userAppDTO = this.userAppService.createByManual(userApp); | ||
146 | } | ||
142 | 147 | ||
143 | if (Objects.nonNull(_userAppDTO.getId()) && StringUtils.isNotBlank(resources.getAccount())) { | 148 | if (Objects.nonNull(_userAppDTO.getId()) && Objects.nonNull(_userAppDTO.getId()) && StringUtils.isNotBlank(resources.getAccount())) { |
144 | UserAppBindDTO userAppBindDTO = this.userAppBindService.findFirstByAccount(resources.getAccount()); | 149 | UserAppBindDTO userAppBindDTO = this.userAppBindService.findFirstByAccount(resources.getAccount()); |
145 | if (Objects.isNull(userAppBindDTO.getId())) { | 150 | if (Objects.isNull(userAppBindDTO.getId())) { |
146 | // 保存绑定关系 | 151 | // 保存绑定关系 |
... | @@ -152,18 +157,27 @@ public class UserOperationServiceImpl implements UserOperationService { | ... | @@ -152,18 +157,27 @@ public class UserOperationServiceImpl implements UserOperationService { |
152 | } | 157 | } |
153 | } | 158 | } |
154 | 159 | ||
155 | 160 | // 同步至大屏侧 | |
156 | AppRegisterDTO appRegisterDTO = new AppRegisterDTO(); | 161 | AppRegisterDTO appRegisterDTO = new AppRegisterDTO(); |
157 | appRegisterDTO.setMemberDTO(memberDTO); | 162 | appRegisterDTO.setMemberDTO(memberDTO); |
158 | appRegisterDTO.setUserAppDTO(_userAppDTO); | 163 | appRegisterDTO.setUserAppDTO(_userAppDTO); |
159 | ((UserOperationServiceImpl)AopContext.currentProxy()).asyncAppRegister(appRegisterDTO); | 164 | ((UserOperationServiceImpl)AopContext.currentProxy()).asyncAppRegister(appRegisterDTO); |
160 | 165 | ||
161 | return _userAppDTO; | 166 | try { |
162 | 167 | Map<Object, Object> appCache = new HashMap<>(); | |
168 | appCache.put("id", _userAppDTO.getId()); | ||
169 | appCache.put("memberId", _userAppDTO.getMemberId()); | ||
170 | boolean appCacheResult = this.redisUtils.set(RedisKeyConstants.cacheAppById + ":" + _userAppDTO.getId(), appCache); | ||
171 | log.info("app注册时,缓存app账号信息,appRegister# appCacheResult ==>> "+ appCacheResult); | ||
172 | } catch (Exception e) { | ||
173 | log.error("app注册时,缓存app账号信息异常,appRegister# message ==>> {}", e.getMessage()); | ||
163 | } | 174 | } |
164 | 175 | ||
176 | return _userAppDTO; | ||
177 | } | ||
165 | } | 178 | } |
166 | 179 | ||
180 | // app账号存在的话直接返回 | ||
167 | return userAppDTO; | 181 | return userAppDTO; |
168 | } | 182 | } |
169 | 183 | ||
... | @@ -176,16 +190,18 @@ public class UserOperationServiceImpl implements UserOperationService { | ... | @@ -176,16 +190,18 @@ public class UserOperationServiceImpl implements UserOperationService { |
176 | if (Objects.nonNull(userAppBindDTO.getUserAppId())) { | 190 | if (Objects.nonNull(userAppBindDTO.getUserAppId())) { |
177 | UserAppDTO userAppDTO = this.userAppService.findById(userAppBindDTO.getUserAppId()); | 191 | UserAppDTO userAppDTO = this.userAppService.findById(userAppBindDTO.getUserAppId()); |
178 | if (Objects.isNull(userAppDTO.getId())) { | 192 | if (Objects.isNull(userAppDTO.getId())) { |
193 | log.error("解绑第三方账号失败异常,cancelUserAppBind# message ==>> app账号不存在"); | ||
179 | return ResultInfo.failure("app账号不存在"); | 194 | return ResultInfo.failure("app账号不存在"); |
180 | } | 195 | } |
181 | } | 196 | } |
182 | boolean b = this.userAppBindService.cancelUserAppBind(account, accountType); | 197 | |
183 | if (b) { | 198 | if (this.userAppBindService.cancelUserAppBind(account, accountType)) { |
184 | return ResultInfo.success(true); | 199 | return ResultInfo.success(true); |
185 | } | 200 | } |
186 | } | 201 | } |
187 | 202 | ||
188 | return ResultInfo.failure("取消绑定失败"); | 203 | log.error("解绑第三方账号失败异常,cancelUserAppBind# message ==>> 无第三方账号"); |
204 | return ResultInfo.failure("解绑第三方账号失败,无第三方账号"); | ||
189 | } | 205 | } |
190 | 206 | ||
191 | 207 | ||
... | @@ -197,7 +213,7 @@ public class UserOperationServiceImpl implements UserOperationService { | ... | @@ -197,7 +213,7 @@ public class UserOperationServiceImpl implements UserOperationService { |
197 | String nickname = resources.getNickname(); | 213 | String nickname = resources.getNickname(); |
198 | 214 | ||
199 | UserAppDTO userAppDTO = this.userAppService.findByUsername(username); | 215 | UserAppDTO userAppDTO = this.userAppService.findByUsername(username); |
200 | log.info("通过app账号查询app信息是否存在,[appBindThirdAccount#{}]", userAppDTO); | 216 | log.info("查询app信息,appBindThirdAccount# userAppDTO ==>> {}", userAppDTO); |
201 | if (Objects.isNull(userAppDTO.getId())) { | 217 | if (Objects.isNull(userAppDTO.getId())) { |
202 | return ResultInfo.failure("app账号不存在"); | 218 | return ResultInfo.failure("app账号不存在"); |
203 | } | 219 | } |
... | @@ -236,7 +252,7 @@ public class UserOperationServiceImpl implements UserOperationService { | ... | @@ -236,7 +252,7 @@ public class UserOperationServiceImpl implements UserOperationService { |
236 | } | 252 | } |
237 | } | 253 | } |
238 | userApp.setNickname(nickname); | 254 | userApp.setNickname(nickname); |
239 | log.info("同步app账号的昵称、头像,[appBindThirdAccount#{}]", userAppDTO); | 255 | log.info("修改数据库,修改app账号的昵称、头像,appBindThirdAccount# userApp ==>> {}", userApp); |
240 | boolean result = this.userAppService.updateAppLastActiveTimeAndNicknameAndHeadImg(userApp); | 256 | boolean result = this.userAppService.updateAppLastActiveTimeAndNicknameAndHeadImg(userApp); |
241 | if (result) { | 257 | if (result) { |
242 | UserAppDTO userAppDTO1 = new UserAppDTO(); | 258 | UserAppDTO userAppDTO1 = new UserAppDTO(); |
... | @@ -247,6 +263,7 @@ public class UserOperationServiceImpl implements UserOperationService { | ... | @@ -247,6 +263,7 @@ public class UserOperationServiceImpl implements UserOperationService { |
247 | 263 | ||
248 | if (Objects.nonNull(userAppBindDTO.getId())) { | 264 | if (Objects.nonNull(userAppBindDTO.getId())) { |
249 | resources.setUserAppId(userAppDTO.getId()); | 265 | resources.setUserAppId(userAppDTO.getId()); |
266 | log.info("修改数据库,修改绑定关系的昵称、头像,updateValidStatusAndUserAppIdAndNickname# resources ==>> {}", resources); | ||
250 | boolean result = this.userAppBindService.updateValidStatusAndUserAppIdAndNickname(resources); | 267 | boolean result = this.userAppBindService.updateValidStatusAndUserAppIdAndNickname(resources); |
251 | if (result) { | 268 | if (result) { |
252 | UserAppDTO userAppDTO1 = new UserAppDTO(); | 269 | UserAppDTO userAppDTO1 = new UserAppDTO(); |
... | @@ -259,7 +276,7 @@ public class UserOperationServiceImpl implements UserOperationService { | ... | @@ -259,7 +276,7 @@ public class UserOperationServiceImpl implements UserOperationService { |
259 | } else { | 276 | } else { |
260 | resources.setUserAppId(userAppDTO.getId()); | 277 | resources.setUserAppId(userAppDTO.getId()); |
261 | resources.setStatus(1); | 278 | resources.setStatus(1); |
262 | log.info("第三方账号不存在,新增关联关系[appBindThirdAccount#{}]", resources); | 279 | log.info("保存关联关系,updateValidStatusAndUserAppIdAndNickname# resources ==>> {}", resources); |
263 | this.userAppBindService.create(resources); | 280 | this.userAppBindService.create(resources); |
264 | 281 | ||
265 | UserAppDTO userAppDTO1 = new UserAppDTO(); | 282 | UserAppDTO userAppDTO1 = new UserAppDTO(); |
... | @@ -273,7 +290,7 @@ public class UserOperationServiceImpl implements UserOperationService { | ... | @@ -273,7 +290,7 @@ public class UserOperationServiceImpl implements UserOperationService { |
273 | 290 | ||
274 | @Override | 291 | @Override |
275 | public UserAppSimpleDTO updateAppInfo(UserApp resources) { | 292 | public UserAppSimpleDTO updateAppInfo(UserApp resources) { |
276 | 293 | log.info("修改app信息,updateValidStatusAndUserAppIdAndNickname# resources ==>> {}", resources); | |
277 | UserAppSimpleDTO userAppSimpleDTO = this.userAppService.updateAppInfo(resources); | 294 | UserAppSimpleDTO userAppSimpleDTO = this.userAppService.updateAppInfo(resources); |
278 | if (Objects.nonNull(userAppSimpleDTO.getId())) { | 295 | if (Objects.nonNull(userAppSimpleDTO.getId())) { |
279 | UserAppDTO userAppDTO = new UserAppDTO(); | 296 | UserAppDTO userAppDTO = new UserAppDTO(); |
... | @@ -281,25 +298,9 @@ public class UserOperationServiceImpl implements UserOperationService { | ... | @@ -281,25 +298,9 @@ public class UserOperationServiceImpl implements UserOperationService { |
281 | userAppDTO.setUsername(userAppSimpleDTO.getUsername()); | 298 | userAppDTO.setUsername(userAppSimpleDTO.getUsername()); |
282 | ((UserOperationServiceImpl)AopContext.currentProxy()).asyncUpdateAppInfo(userAppDTO); | 299 | ((UserOperationServiceImpl)AopContext.currentProxy()).asyncUpdateAppInfo(userAppDTO); |
283 | } | 300 | } |
284 | return userAppSimpleDTO; | ||
285 | } | ||
286 | |||
287 | |||
288 | |||
289 | @Override | ||
290 | public boolean updatePasswordById(UserApp resources) { | ||
291 | UserAppDTO userAppDTO = this.userAppService.findById(resources.getId()); | ||
292 | if (Objects.nonNull(userAppDTO.getId())) { | ||
293 | if (this.userAppService.updatePasswordById(resources)) { | ||
294 | ((UserOperationServiceImpl)AopContext.currentProxy()).asyncUpdatePasswordByUsername(userAppDTO); | ||
295 | return true; | ||
296 | } | ||
297 | 301 | ||
302 | return userAppSimpleDTO; | ||
298 | } | 303 | } |
299 | return false; | ||
300 | } | ||
301 | |||
302 | |||
303 | 304 | ||
304 | @Override | 305 | @Override |
305 | @Transactional(rollbackFor = Exception.class) | 306 | @Transactional(rollbackFor = Exception.class) |
... | @@ -308,7 +309,7 @@ public class UserOperationServiceImpl implements UserOperationService { | ... | @@ -308,7 +309,7 @@ public class UserOperationServiceImpl implements UserOperationService { |
308 | 309 | ||
309 | UserTvDTO userTvDTO = this.userTvService.findByPlatformAccount(platformAccount); | 310 | UserTvDTO userTvDTO = this.userTvService.findByPlatformAccount(platformAccount); |
310 | if (Objects.isNull(userTvDTO.getId())) { | 311 | if (Objects.isNull(userTvDTO.getId())) { |
311 | log.error("保存成长报告失败,大屏信息不存在[saveGrowthReport#]"); | 312 | log.error("保存成长报告异常,saveGrowthReport# message ==>> 大屏信息不存在 | platformAccount ==>> {}", platformAccount); |
312 | return ResultInfo.failure("保存成长报告失败,大屏信息不存在"); | 313 | return ResultInfo.failure("保存成长报告失败,大屏信息不存在"); |
313 | } | 314 | } |
314 | 315 | ||
... | @@ -322,10 +323,10 @@ public class UserOperationServiceImpl implements UserOperationService { | ... | @@ -322,10 +323,10 @@ public class UserOperationServiceImpl implements UserOperationService { |
322 | growthReport.setMemberId(memberId); | 323 | growthReport.setMemberId(memberId); |
323 | growthReport.setStartDate(weekFirstDay); | 324 | growthReport.setStartDate(weekFirstDay); |
324 | growthReport.setEndDate(weekLastDay); | 325 | growthReport.setEndDate(weekLastDay); |
325 | log.info("保存成长报告,参数[saveGrowthReport#{}]", growthReport); | 326 | log.info("保存成长报告,saveGrowthReport# message ==>> {}", growthReport); |
326 | this.growthReportService.create(growthReport); | 327 | this.growthReportService.create(growthReport); |
327 | } else { | 328 | } else { |
328 | log.info("修改成长报告,参数[saveGrowthReport#{}]", growthReport); | 329 | log.info("修改成长报告,saveGrowthReport# message ==>> {}", growthReport); |
329 | this.growthReportService.updateGrowthReportData(growthReportDTO.getId(), growthReport.getData()); | 330 | this.growthReportService.updateGrowthReportData(growthReportDTO.getId(), growthReport.getData()); |
330 | } | 331 | } |
331 | 332 | ||
... | @@ -338,12 +339,11 @@ public class UserOperationServiceImpl implements UserOperationService { | ... | @@ -338,12 +339,11 @@ public class UserOperationServiceImpl implements UserOperationService { |
338 | public boolean appCancellation(UserApp userApp) { | 339 | public boolean appCancellation(UserApp userApp) { |
339 | UserAppDTO userAppDTO = this.userAppService.findById(userApp.getId()); | 340 | UserAppDTO userAppDTO = this.userAppService.findById(userApp.getId()); |
340 | if (Objects.nonNull(userAppDTO.getId())){ | 341 | if (Objects.nonNull(userAppDTO.getId())){ |
341 | boolean b = this.userAppService.appCancellation(userApp.getId()); | 342 | if (this.userAppService.appCancellation(userApp.getId())) { |
342 | if (b) { | ||
343 | List<UserAppBindDTO> userAppBindDTOS = this.userAppBindService.findByUserAppId(userAppDTO.getId()); | 343 | List<UserAppBindDTO> userAppBindDTOS = this.userAppBindService.findByUserAppId(userAppDTO.getId()); |
344 | if (!CollectionUtils.isEmpty(userAppBindDTOS)) { | 344 | if (!CollectionUtils.isEmpty(userAppBindDTOS)) { |
345 | List<Long> ids = userAppBindDTOS.stream().map(UserAppBindDTO::getId).collect(Collectors.toList()); | 345 | List<Long> ids = userAppBindDTOS.stream().map(UserAppBindDTO::getId).collect(Collectors.toList()); |
346 | this.userAppBindService.appCancellation(ids); | 346 | return this.userAppBindService.appCancellation(ids); |
347 | } | 347 | } |
348 | 348 | ||
349 | ((UserOperationServiceImpl)AopContext.currentProxy()).asyncAppCancellation(userAppDTO); | 349 | ((UserOperationServiceImpl)AopContext.currentProxy()).asyncAppCancellation(userAppDTO); |
... | @@ -351,7 +351,7 @@ public class UserOperationServiceImpl implements UserOperationService { | ... | @@ -351,7 +351,7 @@ public class UserOperationServiceImpl implements UserOperationService { |
351 | 351 | ||
352 | } | 352 | } |
353 | 353 | ||
354 | return true; | 354 | return false; |
355 | } | 355 | } |
356 | 356 | ||
357 | /** | 357 | /** |
... | @@ -362,39 +362,29 @@ public class UserOperationServiceImpl implements UserOperationService { | ... | @@ -362,39 +362,29 @@ public class UserOperationServiceImpl implements UserOperationService { |
362 | */ | 362 | */ |
363 | @Override | 363 | @Override |
364 | @Transactional(rollbackFor = Exception.class) | 364 | @Transactional(rollbackFor = Exception.class) |
365 | public UserTvDTO createTvUserAndMember(UserTv resources) { | 365 | public ResultInfo createTvUserAndMember(UserTv resources) { |
366 | 366 | ||
367 | // 大屏账户 | 367 | // 大屏账户 |
368 | String platformAccount = resources.getPlatformAccount(); | 368 | String platformAccount = resources.getPlatformAccount(); |
369 | 369 | ||
370 | UserTvDTO userTvDTO = this.userTvService.findByPlatformAccount(platformAccount); | 370 | UserTvDTO userTvDTO = this.userTvService.findByPlatformAccount(platformAccount); |
371 | |||
372 | // 无账号 | 371 | // 无账号 |
373 | if (Objects.isNull(userTvDTO.getId())) { | 372 | if (Objects.isNull(userTvDTO.getId())) { |
374 | |||
375 | // 会员昵称默认采用大屏账号,昵称通过base64加密与小屏保持一致 | 373 | // 会员昵称默认采用大屏账号,昵称通过base64加密与小屏保持一致 |
376 | String platformAccountEncode = Base64Utils.encodeToString(platformAccount.getBytes()); | 374 | String platformAccountEncode = Base64Utils.encodeToString(platformAccount.getBytes()); |
377 | |||
378 | // x_member | 375 | // x_member |
379 | Member member = | 376 | MemberDTO memberDTO = this.createMember(MemberBuilder.build(LocalConstants.MEMBER_PLATFORM_TYPE_VIS, |
380 | MemberBuilder.build(LocalConstants.MEMBER_PLATFORM_TYPE_VIS, | 377 | null, platformAccountEncode, 0)); |
381 | null, platformAccountEncode, 0); | ||
382 | MemberDTO memberDTO = this.createMember(member); | ||
383 | |||
384 | if (Objects.nonNull(memberDTO)) { | 378 | if (Objects.nonNull(memberDTO)) { |
385 | |||
386 | UserTv userTv = UserTvBuilder.build(memberDTO.getId(), memberDTO.getCode(), resources); | 379 | UserTv userTv = UserTvBuilder.build(memberDTO.getId(), memberDTO.getCode(), resources); |
387 | // 创建大屏账户 | 380 | // 创建大屏账户 |
388 | UserTvDTO _tvUserDTO = this.createTvUser(userTv, memberDTO.getId(), memberDTO.getCode()); | 381 | UserTvDTO _tvUserDTO = this.createTvUser(userTv, memberDTO.getId(), memberDTO.getCode()); |
389 | |||
390 | ((UserOperationServiceImpl)AopContext.currentProxy()).asyncMemberAndUserTv4Iptv(new MemberAndUserTvDTO(memberDTO, _tvUserDTO)); | 382 | ((UserOperationServiceImpl)AopContext.currentProxy()).asyncMemberAndUserTv4Iptv(new MemberAndUserTvDTO(memberDTO, _tvUserDTO)); |
391 | 383 | return ResultInfo.success(_tvUserDTO); | |
392 | return _tvUserDTO; | ||
393 | |||
394 | } | 384 | } |
395 | 385 | ||
396 | log.error("保存大屏账号信息异常,无法创建大屏账号对应的会员,platoformAccount ==> {}", platformAccount); | 386 | log.error("保存大屏账号信息异常,createTvUserAndMember# message ==> 会员创建失败"); |
397 | throw new EntityNotFoundException(MemberDTO.class, "code", GlobeExceptionMsg.MEMBER_ID_IS_NULL); | 387 | return ResultInfo.failure(GlobeExceptionMsg.MEMBER_ID_IS_NULL); |
398 | 388 | ||
399 | // 有账号 | 389 | // 有账号 |
400 | } else { | 390 | } else { |
... | @@ -402,14 +392,12 @@ public class UserOperationServiceImpl implements UserOperationService { | ... | @@ -402,14 +392,12 @@ public class UserOperationServiceImpl implements UserOperationService { |
402 | Long memberId = userTvDTO.getMemberId(); | 392 | Long memberId = userTvDTO.getMemberId(); |
403 | // 有会员 | 393 | // 有会员 |
404 | if (Objects.nonNull(memberId)) { | 394 | if (Objects.nonNull(memberId)) { |
405 | return userTvDTO; | 395 | return ResultInfo.success(userTvDTO); |
406 | } | 396 | } |
407 | 397 | ||
408 | // 无会员 | 398 | // 无会员 |
409 | Member member = | 399 | MemberDTO memberDTO = this.createMember(MemberBuilder.build(LocalConstants.MEMBER_PLATFORM_TYPE_VIS, |
410 | MemberBuilder.build(LocalConstants.MEMBER_PLATFORM_TYPE_VIS, | 400 | null, platformAccount, 0)); |
411 | null, platformAccount, 0); | ||
412 | MemberDTO memberDTO = this.createMember(member); | ||
413 | 401 | ||
414 | if (Objects.nonNull(memberDTO)) { | 402 | if (Objects.nonNull(memberDTO)) { |
415 | 403 | ||
... | @@ -421,12 +409,12 @@ public class UserOperationServiceImpl implements UserOperationService { | ... | @@ -421,12 +409,12 @@ public class UserOperationServiceImpl implements UserOperationService { |
421 | UserTvDTO _userTvDTO = this.userTvService.update(userTv); | 409 | UserTvDTO _userTvDTO = this.userTvService.update(userTv); |
422 | ((UserOperationServiceImpl)AopContext.currentProxy()).asyncMemberAndUserTv4Iptv(new MemberAndUserTvDTO(memberDTO, _userTvDTO)); | 410 | ((UserOperationServiceImpl)AopContext.currentProxy()).asyncMemberAndUserTv4Iptv(new MemberAndUserTvDTO(memberDTO, _userTvDTO)); |
423 | 411 | ||
424 | return _userTvDTO; | 412 | return ResultInfo.success(_userTvDTO); |
425 | } | 413 | } |
426 | 414 | ||
427 | } | 415 | } |
428 | 416 | ||
429 | throw new BadRequestException(GlobeExceptionMsg.ENTITY_ALREADY_EXISTS); | 417 | return ResultInfo.failure(GlobeExceptionMsg.ENTITY_ALREADY_EXISTS); |
430 | 418 | ||
431 | } | 419 | } |
432 | 420 | ||
... | @@ -437,12 +425,17 @@ public class UserOperationServiceImpl implements UserOperationService { | ... | @@ -437,12 +425,17 @@ public class UserOperationServiceImpl implements UserOperationService { |
437 | */ | 425 | */ |
438 | @Override | 426 | @Override |
439 | @Transactional(rollbackFor = Exception.class) | 427 | @Transactional(rollbackFor = Exception.class) |
440 | public UserWeixinDTO createWeixinUserAndMember(UserWeixin resources) { | 428 | public ResultInfo createWeixinUserAndMember(UserWeixin resources) { |
441 | return this.createWeixinUserAndMember(resources, 0); | 429 | return this.createWeixinUserAndMember(resources, 0); |
442 | } | 430 | } |
443 | 431 | ||
444 | @Override | 432 | @Override |
445 | public UserWeixinDTO createWeixinUserAndMember(UserWeixin resources, Integer vip) { | 433 | public ResultInfo createWeixinUserAndMember(UserWeixin resources, Integer vip) { |
434 | UserWeixinDTO userWeixinDTO = this.createWeixinAndMember(resources, vip); | ||
435 | return ResultInfo.success(userWeixinDTO); | ||
436 | } | ||
437 | |||
438 | private UserWeixinDTO createWeixinAndMember(UserWeixin resources, Integer vip){ | ||
446 | String appId = resources.getAppid(); | 439 | String appId = resources.getAppid(); |
447 | String openId = resources.getOpenid(); | 440 | String openId = resources.getOpenid(); |
448 | String unionId = resources.getUnionid(); | 441 | String unionId = resources.getUnionid(); |
... | @@ -453,8 +446,8 @@ public class UserOperationServiceImpl implements UserOperationService { | ... | @@ -453,8 +446,8 @@ public class UserOperationServiceImpl implements UserOperationService { |
453 | // 小屏账号 | 446 | // 小屏账号 |
454 | UserWeixinDTO userWeixinDTO = this.findFirstByAppIdAndOpenId(appId, openId); | 447 | UserWeixinDTO userWeixinDTO = this.findFirstByAppIdAndOpenId(appId, openId); |
455 | if (Objects.nonNull(userWeixinDTO.getId()) && Objects.nonNull(userWeixinDTO.getMemberId())) { | 448 | if (Objects.nonNull(userWeixinDTO.getId()) && Objects.nonNull(userWeixinDTO.getMemberId())) { |
456 | log.error("createWeixinUserAndMember ==>> result ==>> [{}]", userWeixinDTO); | 449 | log.warn("创建微信账号时异常,createWeixinUserAndMember# message ==>> 微信账号已存在 | userWeixinDTO ==>> {}", userWeixinDTO); |
457 | throw new BadRequestException(GlobeExceptionMsg.OPERATION_FORBID + "==>> " + GlobeExceptionMsg.ENTITY_ALREADY_EXISTS); | 450 | return userWeixinDTO; |
458 | } | 451 | } |
459 | 452 | ||
460 | // 账号存在但无会员 | 453 | // 账号存在但无会员 |
... | @@ -480,10 +473,8 @@ public class UserOperationServiceImpl implements UserOperationService { | ... | @@ -480,10 +473,8 @@ public class UserOperationServiceImpl implements UserOperationService { |
480 | } else { | 473 | } else { |
481 | 474 | ||
482 | // 有其他账号但都无会员,新建会员并将此账号绑定新建的这个会员 | 475 | // 有其他账号但都无会员,新建会员并将此账号绑定新建的这个会员 |
483 | Member member = MemberBuilder.build(LocalConstants.MEMBER_PLATFORM_TYPE_WEIXIN, | 476 | MemberDTO memberDTO = this.createMember( MemberBuilder.build(LocalConstants.MEMBER_PLATFORM_TYPE_WEIXIN, |
484 | headimgurl, nickname, vip, sex); | 477 | headimgurl, nickname, vip, sex)); |
485 | |||
486 | MemberDTO memberDTO = this.createMember(member); | ||
487 | 478 | ||
488 | if (Objects.nonNull(memberDTO)) { | 479 | if (Objects.nonNull(memberDTO)) { |
489 | userWeixinDTO.setMemberId(memberDTO.getId()); | 480 | userWeixinDTO.setMemberId(memberDTO.getId()); |
... | @@ -497,16 +488,15 @@ public class UserOperationServiceImpl implements UserOperationService { | ... | @@ -497,16 +488,15 @@ public class UserOperationServiceImpl implements UserOperationService { |
497 | 488 | ||
498 | } | 489 | } |
499 | 490 | ||
491 | throw new RuntimeException("系统错误,保存微信账号失败,创建会员信息失败"); | ||
492 | |||
500 | } | 493 | } |
501 | 494 | ||
502 | } else { | 495 | } else { |
503 | 496 | ||
504 | // 该账号存在但无其他账号,新建会员 | 497 | // 该账号存在但无其他账号,新建会员 |
505 | Member member = | 498 | MemberDTO memberDTO = this.createMember(MemberBuilder.build(LocalConstants.MEMBER_PLATFORM_TYPE_WEIXIN, |
506 | MemberBuilder.build(LocalConstants.MEMBER_PLATFORM_TYPE_WEIXIN, | 499 | headimgurl, nickname, vip, sex)); |
507 | headimgurl, nickname, vip, sex); | ||
508 | |||
509 | MemberDTO memberDTO = this.createMember(member); | ||
510 | 500 | ||
511 | if (Objects.nonNull(memberDTO)) { | 501 | if (Objects.nonNull(memberDTO)) { |
512 | userWeixinDTO.setMemberId(memberDTO.getId()); | 502 | userWeixinDTO.setMemberId(memberDTO.getId()); |
... | @@ -520,6 +510,8 @@ public class UserOperationServiceImpl implements UserOperationService { | ... | @@ -520,6 +510,8 @@ public class UserOperationServiceImpl implements UserOperationService { |
520 | 510 | ||
521 | } | 511 | } |
522 | 512 | ||
513 | throw new RuntimeException("系统错误,保存微信账号失败,创建会员信息失败"); | ||
514 | |||
523 | } | 515 | } |
524 | 516 | ||
525 | } | 517 | } |
... | @@ -572,15 +564,11 @@ public class UserOperationServiceImpl implements UserOperationService { | ... | @@ -572,15 +564,11 @@ public class UserOperationServiceImpl implements UserOperationService { |
572 | } else { | 564 | } else { |
573 | 565 | ||
574 | // 新建会员 | 566 | // 新建会员 |
575 | Member _member = | 567 | MemberDTO memberDTO = this.createMember(MemberBuilder.build(LocalConstants.MEMBER_PLATFORM_TYPE_WEIXIN, |
576 | MemberBuilder.build(LocalConstants.MEMBER_PLATFORM_TYPE_WEIXIN, | 568 | headimgurl, nickname, vip, sex)); |
577 | headimgurl, nickname, vip, sex); | ||
578 | |||
579 | MemberDTO memberDTO = this.createMember(_member); | ||
580 | 569 | ||
581 | if (Objects.nonNull(memberDTO)) { | 570 | if (Objects.nonNull(memberDTO)) { |
582 | UserWeixin userWeixin = UserWeixinBuilder.build(memberDTO.getId(), resources); | 571 | UserWeixinDTO _userWeixinDTO1 = this.createWeixinUser(UserWeixinBuilder.build(memberDTO.getId(), resources), memberDTO.getId(), memberDTO.getCode()); |
583 | UserWeixinDTO _userWeixinDTO1 = this.createWeixinUser(userWeixin, memberDTO.getId(), memberDTO.getCode()); | ||
584 | 572 | ||
585 | // 同步至iptv | 573 | // 同步至iptv |
586 | ((UserOperationServiceImpl)AopContext.currentProxy()). | 574 | ((UserOperationServiceImpl)AopContext.currentProxy()). |
... | @@ -589,7 +577,7 @@ public class UserOperationServiceImpl implements UserOperationService { | ... | @@ -589,7 +577,7 @@ public class UserOperationServiceImpl implements UserOperationService { |
589 | return _userWeixinDTO1; | 577 | return _userWeixinDTO1; |
590 | } | 578 | } |
591 | 579 | ||
592 | throw new EntityNotFoundException(MemberDTO.class, "code", GlobeExceptionMsg.MEMBER_CODE_IS_NULL); | 580 | throw new RuntimeException("系统错误,保存微信账号失败,创建会员信息失败"); |
593 | 581 | ||
594 | } | 582 | } |
595 | 583 | ||
... | @@ -607,7 +595,7 @@ public class UserOperationServiceImpl implements UserOperationService { | ... | @@ -607,7 +595,7 @@ public class UserOperationServiceImpl implements UserOperationService { |
607 | public UserWeixinDTO serviceLogin(UserWeixin resources) { | 595 | public UserWeixinDTO serviceLogin(UserWeixin resources) { |
608 | 596 | ||
609 | // 创建小屏账户同时创建会员 | 597 | // 创建小屏账户同时创建会员 |
610 | UserWeixinDTO userWeixinDTO = this.createWeixinUserAndMember(resources); | 598 | UserWeixinDTO userWeixinDTO = this.createWeixinAndMember(resources, 0); |
611 | 599 | ||
612 | // 为了保证返回的同一用户 | 600 | // 为了保证返回的同一用户 |
613 | return this.getFirstId(userWeixinDTO); | 601 | return this.getFirstId(userWeixinDTO); |
... | @@ -623,8 +611,7 @@ public class UserOperationServiceImpl implements UserOperationService { | ... | @@ -623,8 +611,7 @@ public class UserOperationServiceImpl implements UserOperationService { |
623 | public UserWeixinDTO appletLogin(UserWeixin resources) { | 611 | public UserWeixinDTO appletLogin(UserWeixin resources) { |
624 | 612 | ||
625 | // 创建小屏账户同时创建会员 | 613 | // 创建小屏账户同时创建会员 |
626 | UserWeixinDTO userWeixinDTO = this.createWeixinUserAndMember(resources); | 614 | UserWeixinDTO userWeixinDTO = this.createWeixinAndMember(resources, 0); |
627 | |||
628 | // 为了保证返回的同一用户 | 615 | // 为了保证返回的同一用户 |
629 | return this.getFirstId(userWeixinDTO); | 616 | return this.getFirstId(userWeixinDTO); |
630 | } | 617 | } |
... | @@ -663,7 +650,7 @@ public class UserOperationServiceImpl implements UserOperationService { | ... | @@ -663,7 +650,7 @@ public class UserOperationServiceImpl implements UserOperationService { |
663 | userWeixin.setHeadimgurl(headImgUrl); | 650 | userWeixin.setHeadimgurl(headImgUrl); |
664 | 651 | ||
665 | // 创建小屏账户同时创建会员 | 652 | // 创建小屏账户同时创建会员 |
666 | userWeixinDTO = this.createWeixinUserAndMember(userWeixin, 1); | 653 | userWeixinDTO = this.createWeixinAndMember(userWeixin, 1); |
667 | Long memberId = userWeixinDTO.getMemberId(); | 654 | Long memberId = userWeixinDTO.getMemberId(); |
668 | memberDTO = this.memberService.findById(memberId); | 655 | memberDTO = this.memberService.findById(memberId); |
669 | 656 | ||
... | @@ -673,6 +660,7 @@ public class UserOperationServiceImpl implements UserOperationService { | ... | @@ -673,6 +660,7 @@ public class UserOperationServiceImpl implements UserOperationService { |
673 | UserWeixin userWeixin = new UserWeixin(); | 660 | UserWeixin userWeixin = new UserWeixin(); |
674 | userWeixin.setId(userWeixinDTO.getId()); | 661 | userWeixin.setId(userWeixinDTO.getId()); |
675 | userWeixin.setStatus(SUBSCRIBE_STATUS); | 662 | userWeixin.setStatus(SUBSCRIBE_STATUS); |
663 | log.info("修改微信信息status状态应改为1, subscribe# userWeixin ==>> {}" , userWeixin); | ||
676 | userWeixinDTO = this.userWeixinService.doUpdateWeixinStatus(userWeixin); | 664 | userWeixinDTO = this.userWeixinService.doUpdateWeixinStatus(userWeixin); |
677 | // 小屏会员 | 665 | // 小屏会员 |
678 | memberDTO = this.memberService.findById(userWeixinDTO.getMemberId()); | 666 | memberDTO = this.memberService.findById(userWeixinDTO.getMemberId()); |
... | @@ -692,14 +680,14 @@ public class UserOperationServiceImpl implements UserOperationService { | ... | @@ -692,14 +680,14 @@ public class UserOperationServiceImpl implements UserOperationService { |
692 | } | 680 | } |
693 | } | 681 | } |
694 | // 修改会员信息 | 682 | // 修改会员信息 |
683 | log.info("修改会员信息vip以及vip过期时间, subscribe# member ==>> {}" , member); | ||
695 | memberDTO = this.memberService.doUpdateMemberVipAndVipExpireTime(member); | 684 | memberDTO = this.memberService.doUpdateMemberVipAndVipExpireTime(member); |
696 | log.info("发送关注消息至大屏侧,发送的账号信息 ==>> {} || 会员信息 ==>> {}", userWeixinDTO , memberDTO); | ||
697 | // 同步大屏侧 | 685 | // 同步大屏侧 |
698 | ((UserOperationServiceImpl)AopContext.currentProxy()).asyncSubscribe(new MemberAndWeixinUserDTO(memberDTO, userWeixinDTO)); | 686 | ((UserOperationServiceImpl)AopContext.currentProxy()).asyncSubscribe(new MemberAndWeixinUserDTO(memberDTO, userWeixinDTO)); |
699 | 687 | ||
700 | // 大屏信息 | 688 | // 大屏信息 |
701 | JSONObject visUserInfo = resources.getIptvUserInfo(); | 689 | JSONObject visUserInfo = resources.getIptvUserInfo(); |
702 | log.info("存储的大小屏账号信息 iptvUserInfo ==>> {}" , visUserInfo); | 690 | log.info("关注时大屏信息, subscribe# visUserInfo ==>> {}" , visUserInfo); |
703 | if (Objects.nonNull(visUserInfo)) { | 691 | if (Objects.nonNull(visUserInfo)) { |
704 | // 大屏账户 | 692 | // 大屏账户 |
705 | String platformAccount = visUserInfo.getString("platformAccount"); | 693 | String platformAccount = visUserInfo.getString("platformAccount"); |
... | @@ -713,20 +701,19 @@ public class UserOperationServiceImpl implements UserOperationService { | ... | @@ -713,20 +701,19 @@ public class UserOperationServiceImpl implements UserOperationService { |
713 | } | 701 | } |
714 | 702 | ||
715 | if (StringUtils.isBlank(platformAccount)) { | 703 | if (StringUtils.isBlank(platformAccount)) { |
716 | log.error("关注后绑定失败,platformAccount is null "); | 704 | log.error("关注后绑定异常,subscribe# message ==>> 无大屏账号"); |
717 | return false; | 705 | return false; |
718 | } | 706 | } |
719 | } | 707 | } |
720 | 708 | ||
721 | log.info("存储的大屏账号信息 platformAccount ==>> {}" , platformAccount); | ||
722 | // 绑定 | 709 | // 绑定 |
710 | log.info("关注后绑定,绑定信息 subscribe# memberDTO ==>> {} | platformAccount ==>> {}", memberDTO, platformAccount); | ||
723 | this.bind(memberDTO, platformAccount); | 711 | this.bind(memberDTO, platformAccount); |
724 | log.info("绑定结束"); | ||
725 | } | 712 | } |
726 | 713 | ||
727 | // 保存关注记录 | 714 | // 保存关注记录 |
728 | JSONObject sourceInfo = resources.getSourceInfo(); | 715 | JSONObject sourceInfo = resources.getSourceInfo(); |
729 | log.info("保存关注记录,数据 [subscribe#{}]", sourceInfo); | 716 | log.info("保存关注记录,subscribe# sourceInfo ==>> {}", sourceInfo); |
730 | this.saveWechatSubscribeRecord(memberDTO, sourceInfo, 1); | 717 | this.saveWechatSubscribeRecord(memberDTO, sourceInfo, 1); |
731 | 718 | ||
732 | return true; | 719 | return true; |
... | @@ -801,12 +788,12 @@ public class UserOperationServiceImpl implements UserOperationService { | ... | @@ -801,12 +788,12 @@ public class UserOperationServiceImpl implements UserOperationService { |
801 | UserWeixinDTO userWeixinDTO = this.userWeixinService.findFirstByAppIdAndOpenId(appId, openId); | 788 | UserWeixinDTO userWeixinDTO = this.userWeixinService.findFirstByAppIdAndOpenId(appId, openId); |
802 | 789 | ||
803 | if (Objects.isNull(userWeixinDTO.getId())) { | 790 | if (Objects.isNull(userWeixinDTO.getId())) { |
804 | log.error("取关失败,通过appid ==>> {} 和 openId ==>> {} 无法查询到指定的微信账号", appId, openId); | 791 | log.error("取关失败,unsubscribe# message ==>> 通过appid ==>> {} 和 openId ==>> {} 无法查询到指定的微信账号", appId, openId); |
805 | return false; | 792 | return false; |
806 | } | 793 | } |
807 | 794 | ||
808 | if (Objects.isNull(userWeixinDTO.getMemberId())) { | 795 | if (Objects.isNull(userWeixinDTO.getMemberId())) { |
809 | log.error("取关失败,该微信账号无会员id ==>> {}", userWeixinDTO); | 796 | log.error("取关失败,unsubscribe# message ==>> 该微信账号无会员 userWeixinDTO ==>> {}", userWeixinDTO); |
810 | return false; | 797 | return false; |
811 | } | 798 | } |
812 | 799 | ||
... | @@ -863,8 +850,6 @@ public class UserOperationServiceImpl implements UserOperationService { | ... | @@ -863,8 +850,6 @@ public class UserOperationServiceImpl implements UserOperationService { |
863 | @Override | 850 | @Override |
864 | public UserWeixinDTO saveUserInfo(String data) { | 851 | public UserWeixinDTO saveUserInfo(String data) { |
865 | 852 | ||
866 | log.info("result ====>> [{}]",data); | ||
867 | |||
868 | JSONObject json = JSONObject.parseObject(data); | 853 | JSONObject json = JSONObject.parseObject(data); |
869 | String unionId = json.getString("unionid"); | 854 | String unionId = json.getString("unionid"); |
870 | // 订阅号appid | 855 | // 订阅号appid |
... | @@ -893,7 +878,6 @@ public class UserOperationServiceImpl implements UserOperationService { | ... | @@ -893,7 +878,6 @@ public class UserOperationServiceImpl implements UserOperationService { |
893 | this.redisUtils.set(RedisKeyUtil.genSeSuSubscribeKey(unionId), data, 300); | 878 | this.redisUtils.set(RedisKeyUtil.genSeSuSubscribeKey(unionId), data, 300); |
894 | Object o = this.redisUtils.get(RedisKeyUtil.genSeSuSubscribeKey(unionId)); | 879 | Object o = this.redisUtils.get(RedisKeyUtil.genSeSuSubscribeKey(unionId)); |
895 | String contentJsonStr = JSON.toJSONString(o); | 880 | String contentJsonStr = JSON.toJSONString(o); |
896 | log.info("H5 save in redis contentJsonStr ====>> [{}]",contentJsonStr); | ||
897 | 881 | ||
898 | // 若未传dyAppId。不走下面的流程 | 882 | // 若未传dyAppId。不走下面的流程 |
899 | if (StrUtil.isNotBlank(appId)) { | 883 | if (StrUtil.isNotBlank(appId)) { |
... | @@ -921,8 +905,9 @@ public class UserOperationServiceImpl implements UserOperationService { | ... | @@ -921,8 +905,9 @@ public class UserOperationServiceImpl implements UserOperationService { |
921 | String platformAccount = resources.getPlatformAccount(); | 905 | String platformAccount = resources.getPlatformAccount(); |
922 | UserTvDTO userTvDTO = this.userTvService.findByPlatformAccount(platformAccount); | 906 | UserTvDTO userTvDTO = this.userTvService.findByPlatformAccount(platformAccount); |
923 | if (Objects.nonNull(userTvDTO)) { | 907 | if (Objects.nonNull(userTvDTO)) { |
924 | if (StringUtils.isNotBlank(userTvDTO.getPriorityMemberCode()) && userTvDTO.getPriorityMemberCode().equalsIgnoreCase(memberCode)) | 908 | if (StringUtils.isNotBlank(userTvDTO.getPriorityMemberCode()) && userTvDTO.getPriorityMemberCode().equalsIgnoreCase(memberCode)) { |
925 | throw new BadRequestException("会员已是主账户"); | 909 | throw new BadRequestException("会员已是主账户"); |
910 | } | ||
926 | } else { | 911 | } else { |
927 | throw new EntityNotFoundException(UserTvDTO.class , "platformAccount" , GlobeExceptionMsg.IPTV_IS_NULL); | 912 | throw new EntityNotFoundException(UserTvDTO.class , "platformAccount" , GlobeExceptionMsg.IPTV_IS_NULL); |
928 | } | 913 | } |
... | @@ -937,6 +922,13 @@ public class UserOperationServiceImpl implements UserOperationService { | ... | @@ -937,6 +922,13 @@ public class UserOperationServiceImpl implements UserOperationService { |
937 | // 同步至iptv | 922 | // 同步至iptv |
938 | ((UserOperationServiceImpl)AopContext.currentProxy()).asyncUserTvChangeMainAccount(userTvDTO); | 923 | ((UserOperationServiceImpl)AopContext.currentProxy()).asyncUserTvChangeMainAccount(userTvDTO); |
939 | 924 | ||
925 | |||
926 | UserTvSimpleDTO userTvSimpleDTO = this.userTvService.findSimpleByPlatformAccount(platformAccount); | ||
927 | if (Objects.nonNull(userTvSimpleDTO.getPlatformAccount())) { | ||
928 | userTvSimpleDTO.setPriorityMemberCode(memberCode); | ||
929 | JSONObject hashMap = JSONObject.parseObject(JSON.toJSONString(userTvSimpleDTO), JSONObject.class); | ||
930 | this.redisUtils.set(RedisKeyConstants.cacheVisUserByPlatformAccount + "::" + platformAccount, hashMap); | ||
931 | } | ||
940 | return true; | 932 | return true; |
941 | } | 933 | } |
942 | 934 | ||
... | @@ -954,16 +946,16 @@ public class UserOperationServiceImpl implements UserOperationService { | ... | @@ -954,16 +946,16 @@ public class UserOperationServiceImpl implements UserOperationService { |
954 | String memberCode = resources.getMemberCode(); | 946 | String memberCode = resources.getMemberCode(); |
955 | 947 | ||
956 | UserTvDTO userTvDTO = this.userTvService.findByPlatformAccount(platformAccount); | 948 | UserTvDTO userTvDTO = this.userTvService.findByPlatformAccount(platformAccount); |
957 | log.info("大屏解绑,通过大屏账号查询大屏账号信息,结果 userTvDTO ==>> {}", userTvDTO); | 949 | log.info("大屏解绑,通过大屏账号查询大屏账号信息,结果 tvUnbind# userTvDTO ==>> {}", userTvDTO); |
958 | if (Objects.isNull(userTvDTO.getId())) { | 950 | if (Objects.isNull(userTvDTO.getId())) { |
959 | log.error("大屏解绑失败,无对应的大屏账号信息, platformAccount ==>> {}", platformAccount); | 951 | log.error("大屏解绑异常,tvUnbind# message ==>>无对应的大屏账号信息 | platformAccount ==>> {}", platformAccount); |
960 | return false; | 952 | throw new EntityNotFoundException(UserTvDTO.class , "platformAccount" , GlobeExceptionMsg.IPTV_IS_NULL); |
961 | } | 953 | } |
962 | 954 | ||
963 | MemberDTO memberDTO = this.memberService.findByCode(memberCode); | 955 | MemberDTO memberDTO = this.memberService.findByCode(memberCode); |
964 | log.info("大屏解绑,通过会员code查询会员信息,结果memberDTO==>>{}", memberDTO); | 956 | log.info("大屏解绑,通过会员code查询会员信息,tvUnbind# memberDTO ==>> {}", memberDTO); |
965 | if (Objects.isNull(memberDTO.getId())) { | 957 | if (Objects.isNull(memberDTO.getId())) { |
966 | log.error("大屏解绑失败,无对应的会员信息, memberCode ==>> {}", memberCode); | 958 | log.error("大屏解绑异常,tvUnbind# message ==>> 无对应的会员信息"); |
967 | return false; | 959 | return false; |
968 | } | 960 | } |
969 | 961 | ||
... | @@ -974,9 +966,8 @@ public class UserOperationServiceImpl implements UserOperationService { | ... | @@ -974,9 +966,8 @@ public class UserOperationServiceImpl implements UserOperationService { |
974 | member.setBindIptvTime(null); | 966 | member.setBindIptvTime(null); |
975 | member.setUserIptvId(null); | 967 | member.setUserIptvId(null); |
976 | member.setBindIptvPlatformType(null); | 968 | member.setBindIptvPlatformType(null); |
977 | log.info("置空会员绑定的大屏信息, member ==>> {}", member); | 969 | log.info("置空会员绑定的大屏信息, 参数 tvUnbind# member ==>> {}", member); |
978 | memberDTO = this.memberService.doUpdateMemberUserIptvIdAndBindIptvPlatformAndBindIptvTime(member); | 970 | memberDTO = this.memberService.doUpdateMemberUserIptvIdAndBindIptvPlatformAndBindIptvTime(member); |
979 | log.info("会员信息置空大屏的结果,memberDTO ==>> {}", memberDTO); | ||
980 | memberDTO.setPlatformAccount(platformAccount); | 971 | memberDTO.setPlatformAccount(platformAccount); |
981 | 972 | ||
982 | if (StringUtils.isBlank(bindMemberCode)) { | 973 | if (StringUtils.isBlank(bindMemberCode)) { |
... | @@ -988,10 +979,14 @@ public class UserOperationServiceImpl implements UserOperationService { | ... | @@ -988,10 +979,14 @@ public class UserOperationServiceImpl implements UserOperationService { |
988 | UserTvDTO _userTvDTO = new UserTvDTO(); | 979 | UserTvDTO _userTvDTO = new UserTvDTO(); |
989 | _userTvDTO.setPlatformAccount(platformAccount); | 980 | _userTvDTO.setPlatformAccount(platformAccount); |
990 | _userTvDTO.setPriorityMemberCode(null); | 981 | _userTvDTO.setPriorityMemberCode(null); |
991 | log.info("大屏账号置空主会员的结果,userTvDTO ==>> {}", _userTvDTO); | ||
992 | ((UserOperationServiceImpl)AopContext.currentProxy()).asyncUnbind(new MemberAndUserTvDTO(memberDTO, _userTvDTO)); | 982 | ((UserOperationServiceImpl)AopContext.currentProxy()).asyncUnbind(new MemberAndUserTvDTO(memberDTO, _userTvDTO)); |
993 | 983 | ||
994 | this.updateUserTvSimplePriorityMemberCodeRedis(platformAccount, ""); | 984 | UserTvSimpleDTO userTvSimpleDTO = this.userTvService.findSimpleByPlatformAccount(platformAccount); |
985 | if (Objects.nonNull(userTvSimpleDTO.getPlatformAccount())) { | ||
986 | userTvSimpleDTO.setPriorityMemberCode(""); | ||
987 | JSONObject hashMap = JSONObject.parseObject(JSON.toJSONString(userTvSimpleDTO), JSONObject.class); | ||
988 | this.redisUtils.set(RedisKeyConstants.cacheVisUserByPlatformAccount + "::" + platformAccount, hashMap); | ||
989 | } | ||
995 | 990 | ||
996 | } else { | 991 | } else { |
997 | 992 | ||
... | @@ -1004,9 +999,14 @@ public class UserOperationServiceImpl implements UserOperationService { | ... | @@ -1004,9 +999,14 @@ public class UserOperationServiceImpl implements UserOperationService { |
1004 | UserTvDTO _userTvDTO = new UserTvDTO(); | 999 | UserTvDTO _userTvDTO = new UserTvDTO(); |
1005 | _userTvDTO.setPlatformAccount(platformAccount); | 1000 | _userTvDTO.setPlatformAccount(platformAccount); |
1006 | _userTvDTO.setPriorityMemberCode(bindMemberCode); | 1001 | _userTvDTO.setPriorityMemberCode(bindMemberCode); |
1007 | log.info("大屏账号置空主会员的结果,userTvDTO ==>> {}", userTvDTO); | ||
1008 | ((UserOperationServiceImpl)AopContext.currentProxy()).asyncUnbind(new MemberAndUserTvDTO(memberDTO, _userTvDTO)); | 1002 | ((UserOperationServiceImpl)AopContext.currentProxy()).asyncUnbind(new MemberAndUserTvDTO(memberDTO, _userTvDTO)); |
1009 | this.updateUserTvSimplePriorityMemberCodeRedis(platformAccount, bindMemberCode); | 1003 | |
1004 | UserTvSimpleDTO userTvSimpleDTO = this.userTvService.findSimpleByPlatformAccount(platformAccount); | ||
1005 | if (Objects.nonNull(userTvSimpleDTO.getPlatformAccount())) { | ||
1006 | userTvSimpleDTO.setPriorityMemberCode(bindMemberCode); | ||
1007 | JSONObject hashMap = JSONObject.parseObject(JSON.toJSONString(userTvSimpleDTO), JSONObject.class); | ||
1008 | this.redisUtils.set(RedisKeyConstants.cacheVisUserByPlatformAccount + "::" + platformAccount, hashMap); | ||
1009 | } | ||
1010 | } | 1010 | } |
1011 | 1011 | ||
1012 | return true; | 1012 | return true; |
... | @@ -1159,9 +1159,7 @@ public class UserOperationServiceImpl implements UserOperationService { | ... | @@ -1159,9 +1159,7 @@ public class UserOperationServiceImpl implements UserOperationService { |
1159 | } | 1159 | } |
1160 | 1160 | ||
1161 | for (UserCollectionMq collectionMq : value) { | 1161 | for (UserCollectionMq collectionMq : value) { |
1162 | |||
1163 | UserCollectionDetail userCollectionDetail = collectionMq2DetailMapper.toEntity(collectionMq); | 1162 | UserCollectionDetail userCollectionDetail = collectionMq2DetailMapper.toEntity(collectionMq); |
1164 | |||
1165 | List<UserCollectionDetail> userCollectionDetailOptional = userCollectionDetailRepository | 1163 | List<UserCollectionDetail> userCollectionDetailOptional = userCollectionDetailRepository |
1166 | .findByDetailIdAndDetailTypeAndUserCollectionId(userCollectionDetail.getDetailId(), | 1164 | .findByDetailIdAndDetailTypeAndUserCollectionId(userCollectionDetail.getDetailId(), |
1167 | userCollectionDetail.getDetailType(), userCollection.getId()); | 1165 | userCollectionDetail.getDetailType(), userCollection.getId()); |
... | @@ -1206,39 +1204,38 @@ public class UserOperationServiceImpl implements UserOperationService { | ... | @@ -1206,39 +1204,38 @@ public class UserOperationServiceImpl implements UserOperationService { |
1206 | public boolean minaBind(BindBean resources) { | 1204 | public boolean minaBind(BindBean resources) { |
1207 | 1205 | ||
1208 | Long memberId = resources.getMemberId(); | 1206 | Long memberId = resources.getMemberId(); |
1209 | |||
1210 | String platformAccount = resources.getPlatformAccount(); | 1207 | String platformAccount = resources.getPlatformAccount(); |
1211 | 1208 | ||
1212 | // 大屏账户 | 1209 | // 大屏账户 |
1213 | UserTvDTO userTvDTO = this.userTvService.findByPlatformAccount(platformAccount); | 1210 | UserTvDTO userTvDTO = this.userTvService.findByPlatformAccount(platformAccount); |
1214 | log.info("查询大屏账号信息, userTvDTO ==>> {}", userTvDTO); | 1211 | log.info("小程序绑定,查询大屏账号信息 minaBind# userTvDTO ==>> {}", userTvDTO); |
1215 | // 账户是否存在 | 1212 | // 账户是否存在 |
1216 | if (Objects.isNull(userTvDTO.getId())) { | 1213 | if (Objects.isNull(userTvDTO.getId())) { |
1217 | log.error("大屏账号信息不存在,platformAccount ==> {}",platformAccount); | 1214 | log.error("小程序绑定异常,minaBind# message ==>> 大屏账号信息不存在"); |
1218 | return false; | 1215 | return false; |
1219 | } | 1216 | } |
1220 | 1217 | ||
1221 | // 微信账户 | 1218 | // 微信账户 |
1222 | if (Objects.nonNull(memberId)) { | 1219 | if (Objects.nonNull(memberId)) { |
1223 | UserWeixinDTO userWeixinDTO = this.userWeixinService.findFirstByMemberId(memberId); | 1220 | UserWeixinDTO userWeixinDTO = this.userWeixinService.findFirstByMemberId(memberId); |
1224 | log.info("检查小屏账号是否存在, userWeixinDTO ==>> {}", userWeixinDTO); | 1221 | log.info("检查小屏账号,minaBind# userWeixinDTO ==>> {}", userWeixinDTO); |
1225 | // 账户是否存在 | 1222 | // 账户是否存在 |
1226 | if (Objects.isNull(userWeixinDTO.getId())) { | 1223 | if (Objects.isNull(userWeixinDTO.getId())) { |
1227 | log.error("通过会员id无法找到对应的微信账号,memberId ==> {}", memberId); | 1224 | log.error("小程序绑定大屏异常,minaBind# message ==> 微信账号不存在 | memberId ==>> {}", memberId); |
1228 | return false; | 1225 | return false; |
1229 | } | 1226 | } |
1230 | } | 1227 | } |
1231 | 1228 | ||
1232 | MemberDTO memberDTO = this.memberService.findById(memberId); | 1229 | MemberDTO memberDTO = this.memberService.findById(memberId); |
1233 | log.info("检查会员是否存在, memberDTO ==>> {}", memberDTO); | 1230 | log.info("查询会员信息,minaBind# memberDTO ==>> {}", memberDTO); |
1234 | if (Objects.nonNull(memberDTO.getId())) { | 1231 | if (Objects.nonNull(memberDTO.getId())) { |
1235 | Long userIptvId = memberDTO.getUserIptvId(); | 1232 | Long userIptvId = memberDTO.getUserIptvId(); |
1236 | if (Objects.nonNull(userIptvId)) { | 1233 | if (Objects.nonNull(userIptvId)) { |
1237 | log.error("该会员已绑定,大屏id ==> {}", userIptvId); | 1234 | log.error("小程序绑定大屏异常,minaBind# message ==> 当前账号信息绑定了其他大屏 | 绑定的大屏id ==>> {}", userIptvId); |
1238 | throw new BadRequestException(GlobeExceptionMsg.ALREADY_BIND); | 1235 | throw new BadRequestException(GlobeExceptionMsg.ALREADY_BIND); |
1239 | } | 1236 | } |
1240 | } else { | 1237 | } else { |
1241 | log.error("会员信息不存在,请检查数据, memberId ==>> {}", memberId); | 1238 | log.error("小程序绑定大屏异常,minaBind# message ==> 会员信息不存在 | memberId ==>> {}", memberId); |
1242 | return false; | 1239 | return false; |
1243 | } | 1240 | } |
1244 | 1241 | ||
... | @@ -1247,14 +1244,13 @@ public class UserOperationServiceImpl implements UserOperationService { | ... | @@ -1247,14 +1244,13 @@ public class UserOperationServiceImpl implements UserOperationService { |
1247 | 1244 | ||
1248 | if (StringUtils.isBlank(priorityMemberCode)) { | 1245 | if (StringUtils.isBlank(priorityMemberCode)) { |
1249 | priorityMemberCode = memberDTO.getCode(); | 1246 | priorityMemberCode = memberDTO.getCode(); |
1250 | log.info("大屏账号为绑定主账号,开始设置主会员 priorityMemberCode ==>> {}", priorityMemberCode); | ||
1251 | UserTv userTv = new UserTv(); | 1247 | UserTv userTv = new UserTv(); |
1252 | userTv.setId(userTvDTO.getId()); | 1248 | userTv.setId(userTvDTO.getId()); |
1253 | userTv.setPriorityMemberCode(priorityMemberCode); | 1249 | userTv.setPriorityMemberCode(priorityMemberCode); |
1254 | // 更新大屏账户 | 1250 | // 更新大屏账户 |
1251 | log.info("设置主会员,minaBind# userTv ==>> {}", userTv); | ||
1255 | this.userTvService.doUpdatePriorityMemberCode(userTv); | 1252 | this.userTvService.doUpdatePriorityMemberCode(userTv); |
1256 | 1253 | ||
1257 | |||
1258 | userTvDTO.setPriorityMemberCode(memberDTO.getCode()); | 1254 | userTvDTO.setPriorityMemberCode(memberDTO.getCode()); |
1259 | } | 1255 | } |
1260 | 1256 | ||
... | @@ -1279,24 +1275,119 @@ public class UserOperationServiceImpl implements UserOperationService { | ... | @@ -1279,24 +1275,119 @@ public class UserOperationServiceImpl implements UserOperationService { |
1279 | member.setUserIptvId(userTvDTO.getId()); | 1275 | member.setUserIptvId(userTvDTO.getId()); |
1280 | member.setBindIptvTime(TimestampUtil.now()); | 1276 | member.setBindIptvTime(TimestampUtil.now()); |
1281 | member.setBindIptvPlatformType(bindIptvPlatformType); | 1277 | member.setBindIptvPlatformType(bindIptvPlatformType); |
1282 | log.info("修改小屏会员对应的绑定关系,member ==>> {}", member); | 1278 | |
1279 | log.info("修改小屏会员对应的绑定关系,minaBind# member ==>> {}", member); | ||
1283 | // 修改会员信息 | 1280 | // 修改会员信息 |
1284 | this.memberService.doUpdateMemberUserIptvIdAndBindIptvPlatformAndBindIptvTime(member); | 1281 | this.memberService.doUpdateMemberUserIptvIdAndBindIptvPlatformAndBindIptvTime(member); |
1285 | 1282 | ||
1286 | memberDTO.setPlatformAccount(platformAccount); | 1283 | memberDTO.setPlatformAccount(platformAccount); |
1287 | log.info("发送绑定消息至大屏,memberDTO ==>> {} || userTvDTO ==>> {}", memberDTO, userTvDTO); | 1284 | log.info("发送绑定消息至大屏,minaBind# memberDTO ==>> {} || userTvDTO ==>> {}", memberDTO, userTvDTO); |
1288 | // 同步至iptv | 1285 | // 同步至iptv |
1289 | ((UserOperationServiceImpl)AopContext.currentProxy()) | 1286 | ((UserOperationServiceImpl)AopContext.currentProxy()) |
1290 | .asyncMinaBind(new MemberAndUserTvDTO(memberDTO, userTvDTO)); | 1287 | .asyncMinaBind(new MemberAndUserTvDTO(memberDTO, userTvDTO)); |
1291 | 1288 | ||
1292 | this.updateUserTvSimplePriorityMemberCodeRedis(platformAccount, memberDTO.getCode()); | 1289 | UserTvSimpleDTO userTvSimpleDTO = this.userTvService.findSimpleByPlatformAccount(platformAccount); |
1290 | if (Objects.nonNull(userTvSimpleDTO.getPlatformAccount()) && StringUtils.isBlank(userTvSimpleDTO.getPriorityMemberCode())) { | ||
1291 | userTvSimpleDTO.setPriorityMemberCode(priorityMemberCode); | ||
1292 | JSONObject hashMap = JSONObject.parseObject(JSON.toJSONString(userTvSimpleDTO), JSONObject.class); | ||
1293 | this.redisUtils.set(RedisKeyConstants.cacheVisUserByPlatformAccount + "::" + platformAccount, hashMap); | ||
1294 | } | ||
1293 | 1295 | ||
1294 | return true; | 1296 | return true; |
1295 | } | 1297 | } |
1296 | 1298 | ||
1297 | @Override | 1299 | @Override |
1298 | public boolean appBind(BindBean resources) { | 1300 | public ResultInfo appBind(BindBean resources) { |
1299 | return this.minaBind(resources); | 1301 | Long memberId = resources.getMemberId(); |
1302 | String platformAccount = resources.getPlatformAccount(); | ||
1303 | |||
1304 | // 大屏账户 | ||
1305 | UserTvDTO userTvDTO = this.userTvService.findByPlatformAccount(platformAccount); | ||
1306 | log.info("查询大屏账号信息, appBind# userTvDTO ==>> {}", userTvDTO); | ||
1307 | // 账户是否存在 | ||
1308 | if (Objects.isNull(userTvDTO.getId())) { | ||
1309 | log.error("大屏账号信息不存在, appBind# platformAccount ==> {}",platformAccount); | ||
1310 | return ResultInfo.failure("大屏账号信息不存在, 请检查数据"); | ||
1311 | } | ||
1312 | |||
1313 | // app账户 | ||
1314 | if (Objects.nonNull(memberId)) { | ||
1315 | UserAppDTO userAppDTO = this.userAppService.findByMemberId(memberId); | ||
1316 | log.info("检查app账号是否存在, appBind# userAppDTO ==>> {}", userAppDTO); | ||
1317 | // 账户是否存在 | ||
1318 | if (Objects.isNull(userAppDTO.getId())) { | ||
1319 | log.error("通过会员id无法找到对应的app账号, appBind# memberId ==> {}", memberId); | ||
1320 | return ResultInfo.failure("app账号不存在,请检查数据"); | ||
1321 | } | ||
1322 | } | ||
1323 | |||
1324 | MemberDTO memberDTO = this.memberService.findById(memberId); | ||
1325 | log.info("检查会员是否存在, appBind# memberDTO ==>> {}", memberDTO); | ||
1326 | if (Objects.nonNull(memberDTO.getId())) { | ||
1327 | Long userIptvId = memberDTO.getUserIptvId(); | ||
1328 | if (Objects.nonNull(userIptvId)) { | ||
1329 | log.error("该会员已绑定,appBind# 会员id ==> {} | 绑定的大屏账号id ==>> {}", memberDTO.getId(), userIptvId); | ||
1330 | return ResultInfo.failure(GlobeExceptionMsg.ALREADY_BIND); | ||
1331 | } | ||
1332 | } else { | ||
1333 | log.error("会员信息不存在,请检查数据, appBind# memberId ==>> {}", memberId); | ||
1334 | return ResultInfo.failure("会员信息不存在,请检查数据"); | ||
1335 | } | ||
1336 | |||
1337 | // 主账户 | ||
1338 | String priorityMemberCode = userTvDTO.getPriorityMemberCode(); | ||
1339 | |||
1340 | if (StringUtils.isBlank(priorityMemberCode)) { | ||
1341 | priorityMemberCode = memberDTO.getCode(); | ||
1342 | UserTv userTv = new UserTv(); | ||
1343 | userTv.setId(userTvDTO.getId()); | ||
1344 | userTv.setPriorityMemberCode(priorityMemberCode); | ||
1345 | |||
1346 | log.info("设置主会员,appBind# userTv ==>> {}", userTv); | ||
1347 | this.userTvService.doUpdatePriorityMemberCode(userTv); | ||
1348 | |||
1349 | userTvDTO.setPriorityMemberCode(memberDTO.getCode()); | ||
1350 | } | ||
1351 | |||
1352 | Member member = new Member(); | ||
1353 | member.setId(memberDTO.getId()); | ||
1354 | member.setCode(memberDTO.getCode()); | ||
1355 | String platform = userTvDTO.getPlatform(); | ||
1356 | // 绑定IPTV平台 0:未知;1:电信;2:移动;3:联通 | ||
1357 | Integer bindIptvPlatformType = 0; | ||
1358 | // 联通 | ||
1359 | if (UserConstant.platform_lt.contains(platform)) { | ||
1360 | bindIptvPlatformType = PLATFORM_LIST[3]; | ||
1361 | } | ||
1362 | // 移动 | ||
1363 | if (UserConstant.platform_yd.contains(platform)) { | ||
1364 | bindIptvPlatformType = PLATFORM_LIST[2]; | ||
1365 | } | ||
1366 | // 电信 | ||
1367 | if (UserConstant.platform_dx.contains(platform)) { | ||
1368 | bindIptvPlatformType = PLATFORM_LIST[1]; | ||
1369 | } | ||
1370 | member.setUserIptvId(userTvDTO.getId()); | ||
1371 | member.setBindIptvTime(TimestampUtil.now()); | ||
1372 | member.setBindIptvPlatformType(bindIptvPlatformType); | ||
1373 | log.info("修改小屏会员对应的绑定关系,appBind# member ==>> {}", member); | ||
1374 | // 修改会员信息 | ||
1375 | this.memberService.doUpdateMemberUserIptvIdAndBindIptvPlatformAndBindIptvTime(member); | ||
1376 | |||
1377 | memberDTO.setPlatformAccount(platformAccount); | ||
1378 | log.info("发送绑定消息至大屏,appBind# memberDTO ==>> {} || userTvDTO ==>> {}", memberDTO, userTvDTO); | ||
1379 | // 同步至iptv | ||
1380 | ((UserOperationServiceImpl)AopContext.currentProxy()) | ||
1381 | .asyncMinaBind(new MemberAndUserTvDTO(memberDTO, userTvDTO)); | ||
1382 | |||
1383 | UserTvSimpleDTO userTvSimpleDTO = this.userTvService.findSimpleByPlatformAccount(platformAccount); | ||
1384 | if (Objects.nonNull(userTvSimpleDTO.getPlatformAccount()) && StringUtils.isBlank(userTvSimpleDTO.getPriorityMemberCode())) { | ||
1385 | userTvSimpleDTO.setPriorityMemberCode(priorityMemberCode); | ||
1386 | JSONObject hashMap = JSONObject.parseObject(JSON.toJSONString(userTvSimpleDTO), JSONObject.class); | ||
1387 | this.redisUtils.set(RedisKeyConstants.cacheVisUserByPlatformAccount + "::" + platformAccount, hashMap); | ||
1388 | } | ||
1389 | |||
1390 | return ResultInfo.success(true); | ||
1300 | } | 1391 | } |
1301 | 1392 | ||
1302 | /** | 1393 | /** |
... | @@ -1307,16 +1398,15 @@ public class UserOperationServiceImpl implements UserOperationService { | ... | @@ -1307,16 +1398,15 @@ public class UserOperationServiceImpl implements UserOperationService { |
1307 | */ | 1398 | */ |
1308 | @Override | 1399 | @Override |
1309 | public UserTvDTO bind(MemberDTO resource, String platformAccount) { | 1400 | public UserTvDTO bind(MemberDTO resource, String platformAccount) { |
1310 | log.info("bind start"); | ||
1311 | MemberDTO memberDTO = this.memberService.findByCode(resource.getCode()); | 1401 | MemberDTO memberDTO = this.memberService.findByCode(resource.getCode()); |
1312 | log.info("查询会员信息 ==>> {}", memberDTO); | 1402 | log.info("查询会员信息,bind# memberDTO ==>> {}", memberDTO); |
1313 | if (Objects.nonNull(memberDTO.getUserIptvId())) { | 1403 | if (Objects.nonNull(memberDTO.getUserIptvId())) { |
1314 | return this.userTvService.findById(memberDTO.getUserIptvId()); | 1404 | return this.userTvService.findById(memberDTO.getUserIptvId()); |
1315 | } | 1405 | } |
1316 | 1406 | ||
1317 | // 大屏账户 | 1407 | // 大屏账户 |
1318 | UserTvDTO userTvDTO = this.userTvService.findByPlatformAccount(platformAccount); | 1408 | UserTvDTO userTvDTO = this.userTvService.findByPlatformAccount(platformAccount); |
1319 | log.info("查询大屏账号信息 ==>> {}", userTvDTO); | 1409 | log.info("查询大屏账号信息,bind# userTvDTO ==>> {}", userTvDTO); |
1320 | if (Objects.isNull(userTvDTO)) { | 1410 | if (Objects.isNull(userTvDTO)) { |
1321 | throw new BadRequestException(GlobeExceptionMsg.IPTV_IS_NULL); | 1411 | throw new BadRequestException(GlobeExceptionMsg.IPTV_IS_NULL); |
1322 | } | 1412 | } |
... | @@ -1328,6 +1418,7 @@ public class UserOperationServiceImpl implements UserOperationService { | ... | @@ -1328,6 +1418,7 @@ public class UserOperationServiceImpl implements UserOperationService { |
1328 | userTv.setId(userTvDTO.getId()); | 1418 | userTv.setId(userTvDTO.getId()); |
1329 | userTv.setPriorityMemberCode(memberDTO.getCode()); | 1419 | userTv.setPriorityMemberCode(memberDTO.getCode()); |
1330 | 1420 | ||
1421 | log.info("修改大屏对应的主会员,bind# userTv ==>> {}", userTv); | ||
1331 | this.userTvService.doUpdatePriorityMemberCode(userTv); | 1422 | this.userTvService.doUpdatePriorityMemberCode(userTv); |
1332 | 1423 | ||
1333 | userTvDTO.setPriorityMemberCode(memberDTO.getCode()); | 1424 | userTvDTO.setPriorityMemberCode(memberDTO.getCode()); |
... | @@ -1350,34 +1441,30 @@ public class UserOperationServiceImpl implements UserOperationService { | ... | @@ -1350,34 +1441,30 @@ public class UserOperationServiceImpl implements UserOperationService { |
1350 | if (UserConstant.platform_dx.contains(platform)) { | 1441 | if (UserConstant.platform_dx.contains(platform)) { |
1351 | bindIptvPlatformType = PLATFORM_LIST[1]; | 1442 | bindIptvPlatformType = PLATFORM_LIST[1]; |
1352 | } | 1443 | } |
1444 | member.setId(memberDTO.getId()); | ||
1353 | member.setUserIptvId(userTvDTO.getId()); | 1445 | member.setUserIptvId(userTvDTO.getId()); |
1354 | member.setBindIptvTime(TimestampUtil.now()); | 1446 | member.setBindIptvTime(TimestampUtil.now()); |
1355 | member.setBindIptvPlatformType(bindIptvPlatformType); | 1447 | member.setBindIptvPlatformType(bindIptvPlatformType); |
1356 | member.setPlatformAccount(platformAccount); | 1448 | member.setPlatformAccount(platformAccount); |
1357 | 1449 | ||
1358 | // 修改会员 | 1450 | // 修改会员 |
1451 | log.info("修改会员对应的绑定关系,bind# member ==>> {}", member); | ||
1359 | this.memberService.doUpdateMemberUserIptvIdAndBindIptvPlatformAndBindIptvTime(member); | 1452 | this.memberService.doUpdateMemberUserIptvIdAndBindIptvPlatformAndBindIptvTime(member); |
1360 | 1453 | ||
1361 | memberDTO.setPlatformAccount(platformAccount); | 1454 | memberDTO.setPlatformAccount(platformAccount); |
1362 | 1455 | ||
1363 | log.info("发送绑定消息至大屏侧, 会员信息 ==>> {} || 账号信息 ==>> {}", memberDTO , userTvDTO); | 1456 | log.info("发送绑定消息至大屏侧, bind# memberDTO ==>> {} || userTvDTO ==>> {}", memberDTO , userTvDTO); |
1364 | // 同步至大屏侧 | 1457 | // 同步至大屏侧 |
1365 | ((UserOperationServiceImpl)AopContext.currentProxy()).asyncMinaBind(new MemberAndUserTvDTO(memberDTO, userTvDTO)); | 1458 | ((UserOperationServiceImpl)AopContext.currentProxy()).asyncMinaBind(new MemberAndUserTvDTO(memberDTO, userTvDTO)); |
1366 | 1459 | ||
1367 | this.updateUserTvSimplePriorityMemberCodeRedis(platformAccount, memberDTO.getCode()); | ||
1368 | |||
1369 | return userTvDTO; | ||
1370 | } | ||
1371 | |||
1372 | |||
1373 | private void updateUserTvSimplePriorityMemberCodeRedis(String platformAccount, String priorityMemberCode){ | ||
1374 | // 修改缓存中MemberSimple的大屏主账号信息,因为执行任务之前会去检查主会员d | ||
1375 | UserTvSimpleDTO userTvSimpleDTO = this.userTvService.findSimpleByPlatformAccount(platformAccount); | 1460 | UserTvSimpleDTO userTvSimpleDTO = this.userTvService.findSimpleByPlatformAccount(platformAccount); |
1376 | if (Objects.nonNull(userTvSimpleDTO)) { | 1461 | if (Objects.nonNull(userTvSimpleDTO.getPlatformAccount()) && StringUtils.isBlank(userTvSimpleDTO.getPriorityMemberCode())) { |
1377 | userTvSimpleDTO.setPriorityMemberCode(priorityMemberCode); | 1462 | userTvSimpleDTO.setPriorityMemberCode(priorityMemberCode); |
1378 | JSONObject hashMap = JSONObject.parseObject(JSON.toJSONString(userTvSimpleDTO), JSONObject.class); | 1463 | JSONObject hashMap = JSONObject.parseObject(JSON.toJSONString(userTvSimpleDTO), JSONObject.class); |
1379 | this.redisUtils.set(RedisKeyConstants.cacheVisUserByPlatformAccount + "::" + platformAccount, hashMap); | 1464 | this.redisUtils.set(RedisKeyConstants.cacheVisUserByPlatformAccount + "::" + platformAccount, hashMap); |
1380 | } | 1465 | } |
1466 | |||
1467 | return userTvDTO; | ||
1381 | } | 1468 | } |
1382 | 1469 | ||
1383 | /** | 1470 | /** |
... | @@ -1399,7 +1486,6 @@ public class UserOperationServiceImpl implements UserOperationService { | ... | @@ -1399,7 +1486,6 @@ public class UserOperationServiceImpl implements UserOperationService { |
1399 | return this.memberService.findById(memberId); | 1486 | return this.memberService.findById(memberId); |
1400 | } | 1487 | } |
1401 | 1488 | ||
1402 | |||
1403 | /** | 1489 | /** |
1404 | * | 1490 | * |
1405 | * @param unionId 身份标识 | 1491 | * @param unionId 身份标识 |
... | @@ -1472,12 +1558,16 @@ public class UserOperationServiceImpl implements UserOperationService { | ... | @@ -1472,12 +1558,16 @@ public class UserOperationServiceImpl implements UserOperationService { |
1472 | * @param member 会员信息 | 1558 | * @param member 会员信息 |
1473 | * @return MemberDTO | 1559 | * @return MemberDTO |
1474 | */ | 1560 | */ |
1475 | public MemberDTO createMember(Member member){ | 1561 | public MemberDTO createMember(Member member) { |
1476 | MemberDTO memberDTO = this.memberService.create(member); | 1562 | MemberDTO memberDTO = this.memberService.create(member); |
1477 | if (Objects.nonNull(memberDTO.getId())) { | 1563 | if (Objects.nonNull(memberDTO.getId())) { |
1478 | MemberSimpleDTO memberSimpleDTO = new MemberSimpleDTO(); | 1564 | MemberSimpleDTO memberSimpleDTO = new MemberSimpleDTO(); |
1479 | BeanUtils.copyProperties(memberDTO, memberSimpleDTO); | 1565 | BeanUtils.copyProperties(memberDTO, memberSimpleDTO); |
1480 | this.redisUtils.set(RedisKeyConstants.cacheMemberSimpleById+"::"+memberDTO.getId(), memberSimpleDTO); | 1566 | try { |
1567 | this.redisUtils.set(RedisKeyConstants.cacheMemberSimpleById + "::" + memberDTO.getId(), memberSimpleDTO); | ||
1568 | } catch (Exception e) { | ||
1569 | log.error("创建会员时,缓存会员信息异常, createMember# message ==>> {}", e.getMessage()); | ||
1570 | } | ||
1481 | } | 1571 | } |
1482 | return memberDTO; | 1572 | return memberDTO; |
1483 | } | 1573 | } |
... | @@ -1488,11 +1578,19 @@ public class UserOperationServiceImpl implements UserOperationService { | ... | @@ -1488,11 +1578,19 @@ public class UserOperationServiceImpl implements UserOperationService { |
1488 | * @param memberId 会员id | 1578 | * @param memberId 会员id |
1489 | * @return UserTvDTO | 1579 | * @return UserTvDTO |
1490 | */ | 1580 | */ |
1491 | private UserTvDTO createTvUser(UserTv resources, Long memberId, String memberCode){ | 1581 | private UserTvDTO createTvUser(UserTv resources, Long memberId, String memberCode) { |
1492 | |||
1493 | resources.setMemberId(memberId); | 1582 | resources.setMemberId(memberId); |
1494 | resources.setMemberCode(memberCode); | 1583 | resources.setMemberCode(memberCode); |
1495 | return this.userTvService.create(resources); | 1584 | UserTvDTO userTvDTO = this.userTvService.create(resources); |
1585 | if (Objects.nonNull(userTvDTO.getId())) { | ||
1586 | Map<String, Object> map = new HashMap<>(); | ||
1587 | map.put("visUserId", resources.getVisUserId()); | ||
1588 | map.put("platformAccount", resources.getPlatformAccount()); | ||
1589 | map.put("id", resources.getId()); | ||
1590 | boolean redisResult = this.redisUtils.set("uus::visUser::" + userTvDTO.getPlatformAccount(), map); | ||
1591 | log.info("保存大屏账号redis结果 createTvUser# redisResult ==>> {}", redisResult); | ||
1592 | } | ||
1593 | return userTvDTO; | ||
1496 | } | 1594 | } |
1497 | 1595 | ||
1498 | /** | 1596 | /** |
... | @@ -1540,19 +1638,19 @@ public class UserOperationServiceImpl implements UserOperationService { | ... | @@ -1540,19 +1638,19 @@ public class UserOperationServiceImpl implements UserOperationService { |
1540 | 1638 | ||
1541 | MemberDTO memberDTO = this.memberService.findById(memberId); | 1639 | MemberDTO memberDTO = this.memberService.findById(memberId); |
1542 | if (Objects.isNull(memberDTO.getId())) { | 1640 | if (Objects.isNull(memberDTO.getId())) { |
1543 | log.error("小屏解绑失败,会员信息不存在, minaUnbind# ==>> {}", memberId); | 1641 | log.error("小屏解绑异常,minaUnbind# message ==>> 当前会员信息不存在 | memberId ==>> {}", memberId); |
1544 | return ResultInfo.failure("小屏解绑失败,当前会员信息不存在"); | 1642 | return ResultInfo.failure("小屏解绑失败,当前会员信息不存在"); |
1545 | } | 1643 | } |
1546 | 1644 | ||
1547 | if (Objects.isNull(memberDTO.getUserIptvId())) { | 1645 | if (Objects.isNull(memberDTO.getUserIptvId())) { |
1548 | log.error("小屏解绑失败,无绑定的大屏, memberId ==>> {}", memberId); | 1646 | log.error("小屏解绑异常,minaUnbind# message ==>> 无绑定的大屏 | memberId ==>> {}", memberId); |
1549 | return ResultInfo.failure("小屏解绑失败,无绑定的大屏"); | 1647 | return ResultInfo.failure("小屏解绑失败,无绑定的大屏"); |
1550 | } | 1648 | } |
1551 | 1649 | ||
1552 | UserTvDTO userTvDTO = this.userTvService.findById(memberDTO.getUserIptvId()); | 1650 | UserTvDTO userTvDTO = this.userTvService.findById(memberDTO.getUserIptvId()); |
1553 | if (Objects.isNull(userTvDTO.getPlatformAccount())) { | 1651 | if (Objects.isNull(userTvDTO.getPlatformAccount())) { |
1554 | log.info("小屏解绑失败,绑定的大屏账号不存在 minaUnbind# ==>> userIptvId ==>> {}", memberDTO.getUserIptvId()); | 1652 | log.info("小屏解绑异常,minaUnbind# message ==>> 当前会员绑定的大屏账号不存在 | memberId ==>> {}", memberDTO.getId()); |
1555 | return ResultInfo.failure("小屏解绑失败,大屏信息不存在请联系客服"); | 1653 | return ResultInfo.failure("小屏解绑失败,大屏信息不存在"); |
1556 | } | 1654 | } |
1557 | 1655 | ||
1558 | // 解绑(置空大屏信息) | 1656 | // 解绑(置空大屏信息) |
... | @@ -1562,19 +1660,17 @@ public class UserOperationServiceImpl implements UserOperationService { | ... | @@ -1562,19 +1660,17 @@ public class UserOperationServiceImpl implements UserOperationService { |
1562 | member.setBindIptvTime(null); | 1660 | member.setBindIptvTime(null); |
1563 | member.setUserIptvId(null); | 1661 | member.setUserIptvId(null); |
1564 | member.setBindIptvPlatformType(null); | 1662 | member.setBindIptvPlatformType(null); |
1565 | log.info("置空会员绑定的大屏信息, member ==>> {}", member); | 1663 | log.info("置空会员绑定的大屏信息,minaUnbind# member ==>> {}", member); |
1566 | this.memberService.doUpdateMemberUserIptvIdAndBindIptvPlatformAndBindIptvTime(member); | 1664 | this.memberService.doUpdateMemberUserIptvIdAndBindIptvPlatformAndBindIptvTime(member); |
1567 | log.info("会员信息置空大屏的结果,memberDTO ==>> {}", memberDTO); | ||
1568 | 1665 | ||
1569 | // 有其他绑定的小程序会员,排除自己 | 1666 | // 有其他绑定的小程序会员,排除自己 |
1570 | List<MemberDTO> memberDTOS = this.memberService.findByUserIptvId(userTvDTO.getId()); | 1667 | List<MemberDTO> memberDTOS = this.memberService.findByUserIptvId(userTvDTO.getId()); |
1571 | log.info("后台指定一个默认主会员,通过大屏id查询到的绑定的小屏会员memberDTOList ==>> {}", memberDTOS); | 1668 | log.info("通过大屏id查询到的绑定的小屏会员,minaUnbind# memberDTOList ==>> {}", memberDTOS); |
1572 | if (!CollectionUtils.isEmpty(memberDTOS)) { | 1669 | if (!CollectionUtils.isEmpty(memberDTOS)) { |
1573 | String oldMemberCode = memberDTO.getCode(); | 1670 | String oldMemberCode = memberDTO.getCode(); |
1574 | List<MemberDTO> collect = | 1671 | List<MemberDTO> collect = |
1575 | memberDTOS.stream().filter(memberDTO_ -> | 1672 | memberDTOS.stream().filter(memberDTO_ -> |
1576 | !memberDTO_.getCode().equalsIgnoreCase(oldMemberCode)).collect(Collectors.toList()); | 1673 | !memberDTO_.getCode().equalsIgnoreCase(oldMemberCode)).collect(Collectors.toList()); |
1577 | log.info("过滤掉当前会员 ==>> {}", collect); | ||
1578 | 1674 | ||
1579 | if (!CollectionUtils.isEmpty(collect)) { | 1675 | if (!CollectionUtils.isEmpty(collect)) { |
1580 | 1676 | ||
... | @@ -1585,31 +1681,45 @@ public class UserOperationServiceImpl implements UserOperationService { | ... | @@ -1585,31 +1681,45 @@ public class UserOperationServiceImpl implements UserOperationService { |
1585 | userTv.setId(userTvDTO.getId()); | 1681 | userTv.setId(userTvDTO.getId()); |
1586 | userTv.setPlatform(userTvDTO.getPlatformAccount()); | 1682 | userTv.setPlatform(userTvDTO.getPlatformAccount()); |
1587 | userTv.setPriorityMemberCode(collect.get(0).getCode()); | 1683 | userTv.setPriorityMemberCode(collect.get(0).getCode()); |
1684 | |||
1685 | log.info("设置主会员,minaUnbind# userTv ==>> {}", userTv); | ||
1588 | this.userTvService.doUpdatePriorityMemberCode(userTv); | 1686 | this.userTvService.doUpdatePriorityMemberCode(userTv); |
1589 | 1687 | ||
1590 | UserTvDTO _userTvDTO = new UserTvDTO(); | 1688 | UserTvDTO _userTvDTO = new UserTvDTO(); |
1591 | _userTvDTO.setPlatformAccount(userTvDTO.getPlatformAccount()); | 1689 | _userTvDTO.setPlatformAccount(userTvDTO.getPlatformAccount()); |
1592 | _userTvDTO.setPriorityMemberCode(userTv.getPriorityMemberCode()); | 1690 | _userTvDTO.setPriorityMemberCode(userTv.getPriorityMemberCode()); |
1593 | log.info("同步绑定信息至大屏侧, 参数 ==>> {}", new MemberAndUserTvDTO(memberDTO, _userTvDTO)); | 1691 | log.info("同步信息至大屏侧,minaUnbind# MemberAndUserTvDTO ==>> {} ", new MemberAndUserTvDTO(memberDTO, _userTvDTO)); |
1594 | ((UserOperationServiceImpl)AopContext.currentProxy()).asyncUnbind(new MemberAndUserTvDTO(memberDTO, _userTvDTO)); | 1692 | ((UserOperationServiceImpl)AopContext.currentProxy()).asyncUnbind(new MemberAndUserTvDTO(memberDTO, _userTvDTO)); |
1595 | 1693 | ||
1596 | this.updateUserTvSimplePriorityMemberCodeRedis(userTvDTO.getPlatformAccount(), userTv.getPriorityMemberCode()); | 1694 | UserTvSimpleDTO userTvSimpleDTO = this.userTvService.findSimpleByPlatformAccount(userTvDTO.getPlatformAccount()); |
1695 | if (Objects.nonNull(userTvSimpleDTO.getPlatformAccount())) { | ||
1696 | userTvSimpleDTO.setPriorityMemberCode(userTv.getPriorityMemberCode()); | ||
1697 | JSONObject hashMap = JSONObject.parseObject(JSON.toJSONString(userTvSimpleDTO), JSONObject.class); | ||
1698 | this.redisUtils.set(RedisKeyConstants.cacheVisUserByPlatformAccount + "::" + userTvDTO.getPlatformAccount(), hashMap); | ||
1699 | } | ||
1597 | } | 1700 | } |
1598 | 1701 | ||
1599 | } else { | 1702 | } else { |
1600 | log.info("无其他绑定的小屏会员信息 "); | 1703 | |
1601 | // 绑定新的主账号 | 1704 | // 绑定新的主账号 |
1602 | UserTv userTv = new UserTv(); | 1705 | UserTv userTv = new UserTv(); |
1603 | userTv.setId(userTvDTO.getId()); | 1706 | userTv.setId(userTvDTO.getId()); |
1604 | userTv.setPriorityMemberCode(null); | 1707 | userTv.setPriorityMemberCode(null); |
1708 | log.info("无其他绑定的小屏会员信息,置空主会员 minaUnbind# userTv ==>> {}", userTv); | ||
1605 | this.userTvService.doUpdatePriorityMemberCode(userTv); | 1709 | this.userTvService.doUpdatePriorityMemberCode(userTv); |
1606 | 1710 | ||
1607 | UserTvDTO _userTvDTO = new UserTvDTO(); | 1711 | UserTvDTO _userTvDTO = new UserTvDTO(); |
1608 | _userTvDTO.setPlatformAccount(userTvDTO.getPlatformAccount()); | 1712 | _userTvDTO.setPlatformAccount(userTvDTO.getPlatformAccount()); |
1609 | _userTvDTO.setPriorityMemberCode(null); | 1713 | _userTvDTO.setPriorityMemberCode(null); |
1610 | log.info("同步绑定信息至大屏侧, 参数 ==>> {}", new MemberAndUserTvDTO(memberDTO, _userTvDTO)); | 1714 | log.info("同步信息至大屏侧,minaUnbind# MemberAndUserTvDTO ==>> {}", new MemberAndUserTvDTO(memberDTO, _userTvDTO)); |
1611 | ((UserOperationServiceImpl)AopContext.currentProxy()).asyncUnbind(new MemberAndUserTvDTO(memberDTO, _userTvDTO)); | 1715 | ((UserOperationServiceImpl)AopContext.currentProxy()).asyncUnbind(new MemberAndUserTvDTO(memberDTO, _userTvDTO)); |
1612 | this.updateUserTvSimplePriorityMemberCodeRedis(userTvDTO.getPlatformAccount(), ""); | 1716 | |
1717 | UserTvSimpleDTO userTvSimpleDTO = this.userTvService.findSimpleByPlatformAccount(userTvDTO.getPlatformAccount()); | ||
1718 | if (Objects.nonNull(userTvSimpleDTO.getPlatformAccount())) { | ||
1719 | userTvSimpleDTO.setPriorityMemberCode(""); | ||
1720 | JSONObject hashMap = JSONObject.parseObject(JSON.toJSONString(userTvSimpleDTO), JSONObject.class); | ||
1721 | this.redisUtils.set(RedisKeyConstants.cacheVisUserByPlatformAccount + "::" + userTvDTO.getPlatformAccount(), hashMap); | ||
1722 | } | ||
1613 | } | 1723 | } |
1614 | 1724 | ||
1615 | return ResultInfo.success("解绑成功"); | 1725 | return ResultInfo.success("解绑成功"); |
... | @@ -1656,10 +1766,6 @@ public class UserOperationServiceImpl implements UserOperationService { | ... | @@ -1656,10 +1766,6 @@ public class UserOperationServiceImpl implements UserOperationService { |
1656 | @AsyncMqSend | 1766 | @AsyncMqSend |
1657 | public void asyncUpdateAppLastActiveTimeAndNicknameAndHeadImg(UserAppDTO userAppDTO) { } | 1767 | public void asyncUpdateAppLastActiveTimeAndNicknameAndHeadImg(UserAppDTO userAppDTO) { } |
1658 | @AsyncMqSend | 1768 | @AsyncMqSend |
1659 | public void asyncCancelUserAppBind(UserAppBindDTO userAppBindDTO) {} | ||
1660 | @AsyncMqSend | ||
1661 | public void asyncUpdatePasswordByUsername(UserAppDTO userAppDTO) {} | ||
1662 | @AsyncMqSend | ||
1663 | public void asyncUpdateAppInfo(UserAppDTO userAppDTO) {} | 1769 | public void asyncUpdateAppInfo(UserAppDTO userAppDTO) {} |
1664 | @AsyncMqSend | 1770 | @AsyncMqSend |
1665 | public void asyncAppCancellation(UserAppDTO userAppDTO) {} | 1771 | public void asyncAppCancellation(UserAppDTO userAppDTO) {} | ... | ... |
1 | package com.topdraw.business.process.service.impl.member; | 1 | package com.topdraw.business.process.service.impl.member; |
2 | 2 | ||
3 | import com.topdraw.aspect.AsyncMqSend; | 3 | import com.topdraw.aspect.AsyncMqSend; |
4 | import com.topdraw.base.modules.exception.BadRequestException; | ||
4 | import com.topdraw.business.module.member.address.domain.MemberAddress; | 5 | import com.topdraw.business.module.member.address.domain.MemberAddress; |
5 | import com.topdraw.business.module.member.address.service.MemberAddressService; | 6 | import com.topdraw.business.module.member.address.service.MemberAddressService; |
6 | import com.topdraw.business.module.member.address.service.dto.BasicMemberAddressDTO; | 7 | import com.topdraw.business.module.member.address.service.dto.BasicMemberAddressDTO; |
... | @@ -8,7 +9,6 @@ import com.topdraw.business.module.member.address.service.dto.MemberAddressDTO; | ... | @@ -8,7 +9,6 @@ import com.topdraw.business.module.member.address.service.dto.MemberAddressDTO; |
8 | import com.topdraw.business.module.member.service.MemberService; | 9 | import com.topdraw.business.module.member.service.MemberService; |
9 | import com.topdraw.business.module.member.service.dto.MemberDTO; | 10 | import com.topdraw.business.module.member.service.dto.MemberDTO; |
10 | import com.topdraw.business.process.service.member.MemberAddressOperationService; | 11 | import com.topdraw.business.process.service.member.MemberAddressOperationService; |
11 | import com.topdraw.exception.BadRequestException; | ||
12 | import com.topdraw.exception.GlobeExceptionMsg; | 12 | import com.topdraw.exception.GlobeExceptionMsg; |
13 | import lombok.extern.slf4j.Slf4j; | 13 | import lombok.extern.slf4j.Slf4j; |
14 | import org.springframework.aop.framework.AopContext; | 14 | import org.springframework.aop.framework.AopContext; | ... | ... |
... | @@ -2,6 +2,9 @@ package com.topdraw.business.process.service.impl.member; | ... | @@ -2,6 +2,9 @@ package com.topdraw.business.process.service.impl.member; |
2 | 2 | ||
3 | import cn.hutool.core.util.ObjectUtil; | 3 | import cn.hutool.core.util.ObjectUtil; |
4 | import com.topdraw.aspect.AsyncMqSend; | 4 | import com.topdraw.aspect.AsyncMqSend; |
5 | import com.topdraw.base.modules.common.ResultInfo; | ||
6 | import com.topdraw.business.module.contact.domain.MemberContacts; | ||
7 | import com.topdraw.business.module.contact.service.MemberContactsService; | ||
5 | import com.topdraw.business.module.member.address.service.MemberAddressService; | 8 | import com.topdraw.business.module.member.address.service.MemberAddressService; |
6 | import com.topdraw.business.module.member.address.service.dto.MemberAddressDTO; | 9 | import com.topdraw.business.module.member.address.service.dto.MemberAddressDTO; |
7 | import com.topdraw.business.module.member.domain.Member; | 10 | import com.topdraw.business.module.member.domain.Member; |
... | @@ -25,6 +28,7 @@ import org.springframework.beans.factory.annotation.Autowired; | ... | @@ -25,6 +28,7 @@ import org.springframework.beans.factory.annotation.Autowired; |
25 | import org.springframework.cache.annotation.CacheConfig; | 28 | import org.springframework.cache.annotation.CacheConfig; |
26 | import org.springframework.stereotype.Service; | 29 | import org.springframework.stereotype.Service; |
27 | 30 | ||
31 | import javax.validation.constraints.NotNull; | ||
28 | import java.sql.Timestamp; | 32 | import java.sql.Timestamp; |
29 | import java.util.List; | 33 | import java.util.List; |
30 | import java.util.Objects; | 34 | import java.util.Objects; |
... | @@ -42,23 +46,14 @@ public class MemberOperationServiceImpl implements MemberOperationService { | ... | @@ -42,23 +46,14 @@ public class MemberOperationServiceImpl implements MemberOperationService { |
42 | @Autowired | 46 | @Autowired |
43 | private MemberProfileService memberProfileService; | 47 | private MemberProfileService memberProfileService; |
44 | @Autowired | 48 | @Autowired |
45 | private MemberVipHistoryService memberVipHistoryService; | ||
46 | @Autowired | ||
47 | private MemberAddressService memberAddressService; | 49 | private MemberAddressService memberAddressService; |
50 | @Autowired | ||
51 | private MemberContactsService memberContactsService; | ||
52 | @Autowired | ||
53 | private MemberVipHistoryService memberVipHistoryService; | ||
48 | 54 | ||
49 | @AsyncMqSend | ||
50 | public void asyncUpdateMemberVipAndVipExpireTime(MemberDTO memberDTO) {} | ||
51 | @AsyncMqSend | ||
52 | public void asyncCreateMemberVipHistory(MemberVipHistoryDTO memberVipHistoryDTO) {} | ||
53 | @AsyncMqSend | ||
54 | public void asyncDoUpdateGroupsBatch(List<Member> resources) {} | ||
55 | 55 | ||
56 | 56 | ||
57 | @AsyncMqSend | ||
58 | @Override | ||
59 | public MemberDTO update(Member resources) { | ||
60 | return this.memberService.update(resources); | ||
61 | } | ||
62 | 57 | ||
63 | @Override | 58 | @Override |
64 | public MemberDTO findByCode(String code) { | 59 | public MemberDTO findByCode(String code) { |
... | @@ -169,6 +164,11 @@ public class MemberOperationServiceImpl implements MemberOperationService { | ... | @@ -169,6 +164,11 @@ public class MemberOperationServiceImpl implements MemberOperationService { |
169 | return null; | 164 | return null; |
170 | } | 165 | } |
171 | 166 | ||
167 | @Override | ||
168 | public ResultInfo createMemberContacts(MemberContacts resources) { | ||
169 | return ResultInfo.success(this.memberContactsService.create(resources)); | ||
170 | } | ||
171 | |||
172 | 172 | ||
173 | @Override | 173 | @Override |
174 | public MemberProfileDTO getMemberProfileAndCheckVip(Long memberId, String appId) { | 174 | public MemberProfileDTO getMemberProfileAndCheckVip(Long memberId, String appId) { |
... | @@ -285,4 +285,18 @@ public class MemberOperationServiceImpl implements MemberOperationService { | ... | @@ -285,4 +285,18 @@ public class MemberOperationServiceImpl implements MemberOperationService { |
285 | private MemberProfileDTO findMemberProfileByMemberId(Long memberId) { | 285 | private MemberProfileDTO findMemberProfileByMemberId(Long memberId) { |
286 | return this.memberProfileService.findByMemberId(memberId); | 286 | return this.memberProfileService.findByMemberId(memberId); |
287 | } | 287 | } |
288 | |||
289 | |||
290 | |||
291 | @AsyncMqSend | ||
292 | public void asyncUpdateMemberVipAndVipExpireTime(MemberDTO memberDTO) {} | ||
293 | @AsyncMqSend | ||
294 | public void asyncCreateMemberVipHistory(MemberVipHistoryDTO memberVipHistoryDTO) {} | ||
295 | @AsyncMqSend | ||
296 | public void asyncDoUpdateGroupsBatch(List<Member> resources) {} | ||
297 | @AsyncMqSend | ||
298 | @Override | ||
299 | public MemberDTO update(Member resources) { | ||
300 | return this.memberService.update(resources); | ||
301 | } | ||
288 | } | 302 | } | ... | ... |
1 | package com.topdraw.business.process.service.impl.member; | 1 | package com.topdraw.business.process.service.impl.member; |
2 | 2 | ||
3 | import com.topdraw.aspect.AsyncMqSend; | 3 | import com.topdraw.aspect.AsyncMqSend; |
4 | import com.topdraw.base.modules.exception.EntityExistException; | ||
5 | import com.topdraw.base.modules.exception.EntityNotFoundException; | ||
4 | import com.topdraw.business.module.member.domain.Member; | 6 | import com.topdraw.business.module.member.domain.Member; |
5 | import com.topdraw.business.module.member.profile.domain.MemberProfile; | 7 | import com.topdraw.business.module.member.profile.domain.MemberProfile; |
6 | import com.topdraw.business.module.member.profile.service.MemberProfileService; | 8 | import com.topdraw.business.module.member.profile.service.MemberProfileService; |
... | @@ -9,8 +11,6 @@ import com.topdraw.business.module.member.service.MemberService; | ... | @@ -9,8 +11,6 @@ import com.topdraw.business.module.member.service.MemberService; |
9 | import com.topdraw.business.module.member.service.dto.MemberDTO; | 11 | import com.topdraw.business.module.member.service.dto.MemberDTO; |
10 | import com.topdraw.business.process.service.dto.MemberProfileAndMemberDTO; | 12 | import com.topdraw.business.process.service.dto.MemberProfileAndMemberDTO; |
11 | import com.topdraw.business.process.service.member.MemberProfileOperationService; | 13 | import com.topdraw.business.process.service.member.MemberProfileOperationService; |
12 | import com.topdraw.exception.EntityExistException; | ||
13 | import com.topdraw.exception.EntityNotFoundException; | ||
14 | import org.springframework.aop.framework.AopContext; | 14 | import org.springframework.aop.framework.AopContext; |
15 | import org.springframework.beans.BeanUtils; | 15 | import org.springframework.beans.BeanUtils; |
16 | import org.springframework.beans.factory.annotation.Autowired; | 16 | import org.springframework.beans.factory.annotation.Autowired; | ... | ... |
1 | package com.topdraw.business.process.service.mapper; | 1 | package com.topdraw.business.process.service.mapper; |
2 | 2 | ||
3 | import com.topdraw.base.BaseMapper; | 3 | import com.topdraw.base.modules.base.BaseMapper; |
4 | import com.topdraw.business.module.user.weixin.collection.domain.UserCollectionDetail; | 4 | import com.topdraw.business.module.user.weixin.collection.domain.UserCollectionDetail; |
5 | import com.topdraw.business.process.domian.weixin.UserCollectionMq; | 5 | import com.topdraw.business.process.domian.weixin.UserCollectionMq; |
6 | import org.mapstruct.Mapper; | 6 | import org.mapstruct.Mapper; | ... | ... |
1 | package com.topdraw.business.process.service.member; | 1 | package com.topdraw.business.process.service.member; |
2 | 2 | ||
3 | import com.topdraw.base.modules.common.ResultInfo; | ||
4 | import com.topdraw.business.module.contact.domain.MemberContacts; | ||
3 | import com.topdraw.business.module.member.address.service.dto.MemberAddressDTO; | 5 | import com.topdraw.business.module.member.address.service.dto.MemberAddressDTO; |
4 | import com.topdraw.business.module.member.domain.Member; | 6 | import com.topdraw.business.module.member.domain.Member; |
5 | import com.topdraw.business.module.member.profile.service.dto.MemberProfileDTO; | 7 | import com.topdraw.business.module.member.profile.service.dto.MemberProfileDTO; |
6 | import com.topdraw.business.module.member.service.dto.MemberDTO; | 8 | import com.topdraw.business.module.member.service.dto.MemberDTO; |
7 | import com.topdraw.business.module.member.viphistory.domain.MemberVipHistory; | ||
8 | import com.topdraw.business.process.domian.member.MemberOperationBean; | 9 | import com.topdraw.business.process.domian.member.MemberOperationBean; |
9 | import com.topdraw.business.process.domian.weixin.BuyVipBean; | ||
10 | 10 | ||
11 | import java.util.List; | 11 | import java.util.List; |
12 | 12 | ||
... | @@ -76,8 +76,24 @@ public interface MemberOperationService { | ... | @@ -76,8 +76,24 @@ public interface MemberOperationService { |
76 | */ | 76 | */ |
77 | MemberDTO doUpdateVipByMemberCode(MemberOperationBean resources); | 77 | MemberDTO doUpdateVipByMemberCode(MemberOperationBean resources); |
78 | 78 | ||
79 | 79 | /** | |
80 | * | ||
81 | * @param resources | ||
82 | * @return | ||
83 | */ | ||
80 | Integer doUpdateGroupsBatch(List<Member> resources); | 84 | Integer doUpdateGroupsBatch(List<Member> resources); |
81 | 85 | ||
86 | /** | ||
87 | * | ||
88 | * @param memberId | ||
89 | * @return | ||
90 | */ | ||
82 | MemberAddressDTO updateDefaultMemberAddressById(Long memberId); | 91 | MemberAddressDTO updateDefaultMemberAddressById(Long memberId); |
92 | |||
93 | /** | ||
94 | * | ||
95 | * @param resources | ||
96 | * @return | ||
97 | */ | ||
98 | ResultInfo createMemberContacts(MemberContacts resources); | ||
83 | } | 99 | } | ... | ... |
1 | package com.topdraw.common; | ||
2 | |||
3 | import java.io.Serializable; | ||
4 | import java.util.List; | ||
5 | |||
6 | /** | ||
7 | * @author lvjian | ||
8 | * @Title: | ||
9 | * @Package | ||
10 | * @Description: | ||
11 | * @date 2021/1/7 17:26 | ||
12 | */ | ||
13 | public interface IResultInfo<T> extends Serializable { | ||
14 | long getBusinessCode(); | ||
15 | |||
16 | List<T> getResultSet(); | ||
17 | |||
18 | String getDescription(); | ||
19 | |||
20 | long getCount(); | ||
21 | } |
1 | package com.topdraw.common; | ||
2 | |||
3 | /** | ||
4 | * 枚举了一些常用API返回码 | ||
5 | * Created by cy on 2021/01/08. | ||
6 | */ | ||
7 | public enum ResultCode implements IResultCode { | ||
8 | SUCCESS(200, "操作成功"), | ||
9 | FAILED(500, "操作失败"), | ||
10 | VALIDATE_FAILED(400, "参数检验失败"), | ||
11 | UNAUTHORIZED(401, "未登录或token已经过期"), | ||
12 | FORBIDDEN(403, "无权限"), | ||
13 | METHOD_NOT_ALLOWED(405, "方法不允许"); | ||
14 | private long code; | ||
15 | private String description; | ||
16 | |||
17 | ResultCode(long code, String description) { | ||
18 | this.code = code; | ||
19 | this.description = description; | ||
20 | } | ||
21 | |||
22 | public long getCode() { | ||
23 | return code; | ||
24 | } | ||
25 | |||
26 | public String getDescription() { | ||
27 | return description; | ||
28 | } | ||
29 | } | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
1 | package com.topdraw.common; | ||
2 | |||
3 | import com.alibaba.fastjson.JSON; | ||
4 | import com.fasterxml.jackson.annotation.JsonFormat; | ||
5 | import lombok.Getter; | ||
6 | |||
7 | import java.time.LocalDateTime; | ||
8 | import java.util.ArrayList; | ||
9 | import java.util.List; | ||
10 | import java.util.Map; | ||
11 | |||
12 | /** | ||
13 | * 通用返回对象 | ||
14 | * Created by cy on 2021/01/08. | ||
15 | */ | ||
16 | @Getter | ||
17 | public class ResultInfo<T> implements IResultInfo<T> { | ||
18 | private static final long serialVersionUID = -7313465544799377989L; | ||
19 | private long businessCode; | ||
20 | private List<T> resultSet; | ||
21 | private String description; | ||
22 | private long count; | ||
23 | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") | ||
24 | private LocalDateTime currentTime; | ||
25 | |||
26 | public ResultInfo(long businessCode, List<T> resultSet, String description) { | ||
27 | this.businessCode = businessCode; | ||
28 | this.resultSet = resultSet; | ||
29 | this.description = description; | ||
30 | this.count = resultSet.size(); | ||
31 | currentTime = LocalDateTime.now(); | ||
32 | } | ||
33 | |||
34 | public ResultInfo(long businessCode, Map<String, Object> page, String description) { | ||
35 | this.businessCode = businessCode; | ||
36 | this.resultSet = (List<T>) page.get("content"); | ||
37 | this.count = (Long) page.get("totalElements"); | ||
38 | this.description = description; | ||
39 | currentTime = LocalDateTime.now(); | ||
40 | } | ||
41 | |||
42 | /** | ||
43 | * 成功返回不分页结果集 | ||
44 | * @param resultSet | ||
45 | * @param <T> | ||
46 | * @return | ||
47 | */ | ||
48 | public static <T> ResultInfo<T> success(List<T> resultSet) { | ||
49 | return new ResultInfo<T>(ResultCode.SUCCESS.getCode(), resultSet, ""); | ||
50 | } | ||
51 | |||
52 | /** | ||
53 | * 成功返回单一实体结果集 | ||
54 | * @param result | ||
55 | * @param <T> | ||
56 | * @return | ||
57 | */ | ||
58 | public static <T> ResultInfo<T> success(T result) { | ||
59 | List<T> list = new ArrayList<>(); | ||
60 | list.add(result); | ||
61 | return new ResultInfo<T>(ResultCode.SUCCESS.getCode(), list, ""); | ||
62 | } | ||
63 | |||
64 | public static <T> ResultInfo<T> success() { | ||
65 | return new ResultInfo<>(ResultCode.SUCCESS.getCode(), new ArrayList<>(), ""); | ||
66 | } | ||
67 | /** | ||
68 | * 成功返回分页结果集 | ||
69 | * @param page | ||
70 | * @param <T> | ||
71 | * @return | ||
72 | */ | ||
73 | public static <T> ResultInfo<T> successPage(Map<String, Object> page) { | ||
74 | return new ResultInfo<T>(ResultCode.SUCCESS.getCode(), page, ""); | ||
75 | } | ||
76 | |||
77 | /** | ||
78 | * 成功返回带描述的不分页结果集 | ||
79 | * @param resultSet | ||
80 | * @param description | ||
81 | * @param <T> | ||
82 | * @return | ||
83 | */ | ||
84 | public static <T> ResultInfo<T> success(List<T> resultSet, String description) { | ||
85 | return new ResultInfo<T>(ResultCode.SUCCESS.getCode(), resultSet, description); | ||
86 | } | ||
87 | |||
88 | /** | ||
89 | * 带描述的服务端处理失败返回 | ||
90 | * @param description | ||
91 | * @param <T> | ||
92 | * @return | ||
93 | */ | ||
94 | public static <T> ResultInfo<T> failed(String description) { | ||
95 | return new ResultInfo<T>(ResultCode.FAILED.getCode(), new ArrayList<>(), description); | ||
96 | } | ||
97 | |||
98 | /** | ||
99 | * 带描述的服务端处理失败返回 | ||
100 | * @param description | ||
101 | * @param <T> | ||
102 | * @return | ||
103 | */ | ||
104 | public static <T> ResultInfo<T> failure(String description) { | ||
105 | return new ResultInfo<T>(ResultCode.FAILED.getCode(), new ArrayList<>(), description); | ||
106 | } | ||
107 | |||
108 | /** | ||
109 | * 未登录或token过期的失败返回 | ||
110 | * @param <T> | ||
111 | * @return | ||
112 | */ | ||
113 | public static <T> ResultInfo<T> unauthorized() { | ||
114 | return new ResultInfo<T>(ResultCode.UNAUTHORIZED.getCode(), new ArrayList<>(), ResultCode.UNAUTHORIZED.getDescription()); | ||
115 | } | ||
116 | |||
117 | /** | ||
118 | * 未授权的失败返回 | ||
119 | * @param description | ||
120 | * @param <T> | ||
121 | * @return | ||
122 | */ | ||
123 | public static <T> ResultInfo<T> forbidden(String description) { | ||
124 | return new ResultInfo<T>(ResultCode.FORBIDDEN.getCode(), new ArrayList<>(), description); | ||
125 | } | ||
126 | |||
127 | /** | ||
128 | * 参数验证失败的返回 | ||
129 | * @param <T> | ||
130 | * @return | ||
131 | */ | ||
132 | public static <T> ResultInfo<T> validateFailed() { | ||
133 | return new ResultInfo<T>(ResultCode.VALIDATE_FAILED.getCode(), new ArrayList<>(), ResultCode.VALIDATE_FAILED.getDescription()); | ||
134 | } | ||
135 | |||
136 | /** | ||
137 | * 带描述的参数验证失败返回 | ||
138 | * @param description | ||
139 | * @param <T> | ||
140 | * @return | ||
141 | */ | ||
142 | public static <T> ResultInfo<T> validateFailed(String description) { | ||
143 | return new ResultInfo<T>(ResultCode.VALIDATE_FAILED.getCode(), new ArrayList<>(), description); | ||
144 | } | ||
145 | |||
146 | /** | ||
147 | * 请求方法错误的返回 | ||
148 | * @param description | ||
149 | * @param <T> | ||
150 | * @return | ||
151 | */ | ||
152 | public static <T> ResultInfo<T> methodNotAllowed(String description) { | ||
153 | return new ResultInfo<T>(ResultCode.METHOD_NOT_ALLOWED.getCode(), new ArrayList<>(), description); | ||
154 | } | ||
155 | |||
156 | |||
157 | |||
158 | @Override | ||
159 | public String toString() { | ||
160 | return JSON.toJSONString(this); | ||
161 | } | ||
162 | } |
1 | package com.topdraw.util; | 1 | package com.topdraw.util; |
2 | 2 | ||
3 | import com.alibaba.fastjson.JSONObject; | 3 | import com.alibaba.fastjson.JSONObject; |
4 | import com.topdraw.utils.StringUtils; | 4 | import com.topdraw.base.modules.utils.MD5Util; |
5 | import lombok.extern.slf4j.Slf4j; | 5 | import lombok.extern.slf4j.Slf4j; |
6 | import org.bouncycastle.jce.provider.BouncyCastleProvider; | 6 | import org.bouncycastle.jce.provider.BouncyCastleProvider; |
7 | 7 | ||
... | @@ -18,6 +18,16 @@ import java.util.Arrays; | ... | @@ -18,6 +18,16 @@ import java.util.Arrays; |
18 | @Slf4j | 18 | @Slf4j |
19 | public class AESUtil { | 19 | public class AESUtil { |
20 | 20 | ||
21 | public static String decodePassword(String password) { | ||
22 | String decrypt = AESUtil.decrypt(password, "f8681b9ce7c8fb6b"); | ||
23 | |||
24 | String substring = decrypt.substring(16); | ||
25 | |||
26 | String s = MD5Util.encodePassword(substring); | ||
27 | log.info("加密前的密码:==>> {} || 解密后的密码:==>> {} | md5之后的密码: ==>> {}", decrypt, substring, s); | ||
28 | return s; | ||
29 | } | ||
30 | |||
21 | public static String encrypt(String data, String key) { | 31 | public static String encrypt(String data, String key) { |
22 | String strResult = null; | 32 | String strResult = null; |
23 | try { | 33 | try { | ... | ... |
1 | package com.topdraw.weixin.rest; | 1 | package com.topdraw.weixin.rest; |
2 | 2 | ||
3 | import com.topdraw.annotation.AnonymousAccess; | 3 | import com.topdraw.base.modules.annotation.AnonymousAccess; |
4 | import com.topdraw.common.ResultInfo; | 4 | import com.topdraw.base.modules.common.ResultInfo; |
5 | import com.topdraw.weixin.service.UserWeixinWeixinMessageTemplateService; | 5 | import com.topdraw.weixin.service.UserWeixinWeixinMessageTemplateService; |
6 | import com.topdraw.weixin.service.dto.UpdateUserWeixinWeixinMessageTemplateQueryCriteria; | 6 | import com.topdraw.weixin.service.dto.UpdateUserWeixinWeixinMessageTemplateQueryCriteria; |
7 | import io.swagger.annotations.Api; | 7 | import io.swagger.annotations.Api; | ... | ... |
1 | package com.topdraw.weixin.service.impl; | 1 | package com.topdraw.weixin.service.impl; |
2 | 2 | ||
3 | 3 | ||
4 | import com.topdraw.utils.QueryHelp; | 4 | import com.topdraw.base.modules.utils.QueryHelp; |
5 | import com.topdraw.weixin.domain.UserWeixinWeixinMessageTemplate; | 5 | import com.topdraw.weixin.domain.UserWeixinWeixinMessageTemplate; |
6 | import com.topdraw.weixin.domain.WeixinMessageTemplate; | 6 | import com.topdraw.weixin.domain.WeixinMessageTemplate; |
7 | import com.topdraw.weixin.repository.UserWeixinWeixinMessageTemplateRepository; | 7 | import com.topdraw.weixin.repository.UserWeixinWeixinMessageTemplateRepository; | ... | ... |
1 | package com.topdraw.weixin.service.mapper; | 1 | package com.topdraw.weixin.service.mapper; |
2 | 2 | ||
3 | import com.topdraw.base.BaseMapper; | 3 | import com.topdraw.base.modules.base.BaseMapper; |
4 | import com.topdraw.weixin.domain.UserWeixinWeixinMessageTemplate; | 4 | import com.topdraw.weixin.domain.UserWeixinWeixinMessageTemplate; |
5 | import com.topdraw.weixin.service.dto.UserWeixinWeixinMessageTemplateDTO; | 5 | import com.topdraw.weixin.service.dto.UserWeixinWeixinMessageTemplateDTO; |
6 | import org.mapstruct.Mapper; | 6 | import org.mapstruct.Mapper; | ... | ... |
member-service-impl/src/main/java/com/topdraw/weixin/service/mapper/WeixinMessageTemplateMapper.java
1 | package com.topdraw.weixin.service.mapper; | 1 | package com.topdraw.weixin.service.mapper; |
2 | 2 | ||
3 | import com.topdraw.base.BaseMapper; | 3 | import com.topdraw.base.modules.base.BaseMapper; |
4 | import com.topdraw.weixin.domain.WeixinMessageTemplate; | 4 | import com.topdraw.weixin.domain.WeixinMessageTemplate; |
5 | import com.topdraw.weixin.service.dto.WeixinMessageTemplateDTO; | 5 | import com.topdraw.weixin.service.dto.WeixinMessageTemplateDTO; |
6 | import org.mapstruct.Mapper; | 6 | import org.mapstruct.Mapper; | ... | ... |
1 | package com.topdraw.code; | 1 | package com.topdraw.code; |
2 | 2 | ||
3 | import com.topdraw.BaseTest; | 3 | import com.topdraw.BaseTest; |
4 | import com.topdraw.domain.GenConfig; | ||
5 | import com.topdraw.domain.vo.ColumnInfo; | ||
6 | import com.topdraw.MemberServiceApplication; | 4 | import com.topdraw.MemberServiceApplication; |
7 | import com.topdraw.service.GeneratorService; | 5 | import com.topdraw.generator.modules.domain.GenConfig; |
6 | import com.topdraw.generator.modules.domain.vo.ColumnInfo; | ||
7 | import com.topdraw.generator.modules.service.GeneratorService; | ||
8 | import lombok.var; | 8 | import lombok.var; |
9 | import org.junit.Test; | 9 | import org.junit.Test; |
10 | import org.junit.runner.RunWith; | 10 | import org.junit.runner.RunWith; |
... | @@ -39,14 +39,14 @@ public class GeneratorCode extends BaseTest { | ... | @@ -39,14 +39,14 @@ public class GeneratorCode extends BaseTest { |
39 | @Rollback(value = false) | 39 | @Rollback(value = false) |
40 | @Transactional(rollbackFor = Exception.class) | 40 | @Transactional(rollbackFor = Exception.class) |
41 | public void generator() { | 41 | public void generator() { |
42 | var dbName = "uc_growth_report"; | 42 | var dbName = "uc_member_contacts"; |
43 | // 表名称,支持多表 | 43 | // 表名称,支持多表 |
44 | var tableNames = Arrays.asList(dbName); | 44 | var tableNames = Arrays.asList(dbName); |
45 | String[] s = dbName.split("_"); | 45 | String[] s = dbName.split("_"); |
46 | 46 | ||
47 | var pre = s[0]; | 47 | var pre = s[0]; |
48 | var target1 = s[s.length-1]; | 48 | var target1 = s[s.length-1]; |
49 | var preRoute = "com.topdraw.business.module.user.iptv.growreport"; | 49 | var preRoute = "com.topdraw.business.module.contact"; |
50 | StringBuilder builder = new StringBuilder(preRoute); | 50 | StringBuilder builder = new StringBuilder(preRoute); |
51 | // builder.append("wechatshare"); | 51 | // builder.append("wechatshare"); |
52 | // builder.append(target); | 52 | // builder.append(target); | ... | ... |
... | @@ -3,7 +3,6 @@ package com.topdraw.test.business.basicdata.member; | ... | @@ -3,7 +3,6 @@ package com.topdraw.test.business.basicdata.member; |
3 | import com.topdraw.business.module.member.rest.MemberController; | 3 | import com.topdraw.business.module.member.rest.MemberController; |
4 | import com.topdraw.business.module.member.service.MemberService; | 4 | import com.topdraw.business.module.member.service.MemberService; |
5 | import com.topdraw.BaseTest; | 5 | import com.topdraw.BaseTest; |
6 | import com.topdraw.common.ResultInfo; | ||
7 | import org.junit.Test; | 6 | import org.junit.Test; |
8 | import org.springframework.beans.factory.annotation.Autowired; | 7 | import org.springframework.beans.factory.annotation.Autowired; |
9 | 8 | ... | ... |
1 | package com.topdraw.test.business.basicdata.member.rest; | 1 | package com.topdraw.test.business.basicdata.member.rest; |
2 | 2 | ||
3 | import com.alibaba.fastjson.JSON; | 3 | import com.alibaba.fastjson.JSON; |
4 | import com.topdraw.base.modules.common.ResultInfo; | ||
4 | import com.topdraw.business.module.member.address.domain.MemberAddress; | 5 | import com.topdraw.business.module.member.address.domain.MemberAddress; |
5 | import com.topdraw.business.module.member.address.rest.MemberAddressController; | 6 | import com.topdraw.business.module.member.address.rest.MemberAddressController; |
6 | import com.topdraw.common.ResultInfo; | ||
7 | import com.topdraw.BaseTest; | 7 | import com.topdraw.BaseTest; |
8 | import org.junit.Test; | 8 | import org.junit.Test; |
9 | import org.springframework.beans.factory.annotation.Autowired; | 9 | import org.springframework.beans.factory.annotation.Autowired; | ... | ... |
1 | package com.topdraw.test.business.basicdata.member.rest; | 1 | package com.topdraw.test.business.basicdata.member.rest; |
2 | 2 | ||
3 | import com.alibaba.fastjson.JSON; | 3 | import com.alibaba.fastjson.JSON; |
4 | import com.topdraw.base.modules.common.ResultInfo; | ||
4 | import com.topdraw.business.module.member.domain.Member; | 5 | import com.topdraw.business.module.member.domain.Member; |
5 | import com.topdraw.business.module.member.rest.MemberController; | 6 | import com.topdraw.business.module.member.rest.MemberController; |
6 | import com.topdraw.common.ResultInfo; | ||
7 | import com.topdraw.BaseTest; | 7 | import com.topdraw.BaseTest; |
8 | import com.topdraw.util.IdWorker; | 8 | import com.topdraw.util.IdWorker; |
9 | import com.topdraw.util.TimestampUtil; | ||
10 | import org.junit.Test; | 9 | import org.junit.Test; |
11 | import org.springframework.beans.factory.annotation.Autowired; | 10 | import org.springframework.beans.factory.annotation.Autowired; |
12 | 11 | ||
13 | import java.time.LocalDateTime; | ||
14 | 12 | ||
15 | public class MemberControllerTest extends BaseTest { | 13 | public class MemberControllerTest extends BaseTest { |
16 | 14 | ... | ... |
1 | package com.topdraw.test.business.basicdata.member.rest; | 1 | package com.topdraw.test.business.basicdata.member.rest; |
2 | 2 | ||
3 | import com.alibaba.fastjson.JSON; | 3 | import com.alibaba.fastjson.JSON; |
4 | import com.topdraw.base.modules.common.ResultInfo; | ||
4 | import com.topdraw.business.module.member.relatedinfo.domain.MemberRelatedInfo; | 5 | import com.topdraw.business.module.member.relatedinfo.domain.MemberRelatedInfo; |
5 | import com.topdraw.business.module.member.relatedinfo.rest.MemberRelatedInfoController; | 6 | import com.topdraw.business.module.member.relatedinfo.rest.MemberRelatedInfoController; |
6 | import com.topdraw.common.ResultInfo; | ||
7 | import com.topdraw.BaseTest; | 7 | import com.topdraw.BaseTest; |
8 | import org.junit.Test; | 8 | import org.junit.Test; |
9 | import org.springframework.beans.factory.annotation.Autowired; | 9 | import org.springframework.beans.factory.annotation.Autowired; |
10 | 10 | ||
11 | import java.time.LocalDate; | ||
12 | |||
13 | //public class MemberControllerTest { | 11 | //public class MemberControllerTest { |
14 | public class MemberRelatedInfoControllerTest extends BaseTest { | 12 | public class MemberRelatedInfoControllerTest extends BaseTest { |
15 | 13 | ... | ... |
1 | package com.topdraw.test.business.process.rest; | 1 | package com.topdraw.test.business.process.rest; |
2 | 2 | ||
3 | import com.alibaba.fastjson.JSON; | ||
4 | import com.alibaba.fastjson.JSONObject; | 3 | import com.alibaba.fastjson.JSONObject; |
5 | import com.topdraw.BaseTest; | 4 | import com.topdraw.BaseTest; |
6 | import com.topdraw.business.process.domian.TempCoupon; | ||
7 | import com.topdraw.business.process.rest.CouponOperationController; | 5 | import com.topdraw.business.process.rest.CouponOperationController; |
8 | import com.topdraw.common.ResultInfo; | ||
9 | import org.junit.Test; | 6 | import org.junit.Test; |
10 | import org.springframework.beans.factory.annotation.Autowired; | 7 | import org.springframework.beans.factory.annotation.Autowired; |
11 | 8 | ||
12 | import java.sql.Timestamp; | ||
13 | import java.time.LocalDateTime; | ||
14 | import java.util.ArrayList; | ||
15 | import java.util.List; | ||
16 | import java.util.Map; | 9 | import java.util.Map; |
17 | 10 | ||
18 | public class CouponOperationControllerTest extends BaseTest { | 11 | public class CouponOperationControllerTest extends BaseTest { | ... | ... |
... | @@ -2,20 +2,13 @@ package com.topdraw.test.business.process.rest; | ... | @@ -2,20 +2,13 @@ package com.topdraw.test.business.process.rest; |
2 | 2 | ||
3 | import com.alibaba.fastjson.JSON; | 3 | import com.alibaba.fastjson.JSON; |
4 | import com.topdraw.BaseTest; | 4 | import com.topdraw.BaseTest; |
5 | import com.topdraw.business.process.domian.TempCoupon; | 5 | import com.topdraw.base.modules.common.ResultInfo; |
6 | import com.topdraw.business.process.domian.TempExp; | 6 | import com.topdraw.business.process.domian.TempExp; |
7 | import com.topdraw.business.process.rest.CouponOperationController; | ||
8 | import com.topdraw.business.process.rest.ExpOperationController; | 7 | import com.topdraw.business.process.rest.ExpOperationController; |
9 | import com.topdraw.common.ResultInfo; | ||
10 | import com.topdraw.util.TimestampUtil; | 8 | import com.topdraw.util.TimestampUtil; |
11 | import org.junit.Test; | 9 | import org.junit.Test; |
12 | import org.springframework.beans.factory.annotation.Autowired; | 10 | import org.springframework.beans.factory.annotation.Autowired; |
13 | 11 | ||
14 | import java.sql.Timestamp; | ||
15 | import java.time.LocalDateTime; | ||
16 | import java.util.ArrayList; | ||
17 | import java.util.List; | ||
18 | |||
19 | public class ExpOperationControllerTest extends BaseTest { | 12 | public class ExpOperationControllerTest extends BaseTest { |
20 | 13 | ||
21 | @Autowired | 14 | @Autowired | ... | ... |
... | @@ -2,9 +2,9 @@ package com.topdraw.test.business.process.rest; | ... | @@ -2,9 +2,9 @@ package com.topdraw.test.business.process.rest; |
2 | 2 | ||
3 | import com.alibaba.fastjson.JSON; | 3 | import com.alibaba.fastjson.JSON; |
4 | import com.topdraw.BaseTest; | 4 | import com.topdraw.BaseTest; |
5 | import com.topdraw.base.modules.common.ResultInfo; | ||
5 | import com.topdraw.business.process.domian.TempPoints; | 6 | import com.topdraw.business.process.domian.TempPoints; |
6 | import com.topdraw.business.process.rest.PointsOperationController; | 7 | import com.topdraw.business.process.rest.PointsOperationController; |
7 | import com.topdraw.common.ResultInfo; | ||
8 | import com.topdraw.util.TimestampUtil; | 8 | import com.topdraw.util.TimestampUtil; |
9 | import org.junit.Test; | 9 | import org.junit.Test; |
10 | import org.springframework.beans.factory.annotation.Autowired; | 10 | import org.springframework.beans.factory.annotation.Autowired; | ... | ... |
... | @@ -2,9 +2,9 @@ package com.topdraw.test.business.process.rest; | ... | @@ -2,9 +2,9 @@ package com.topdraw.test.business.process.rest; |
2 | 2 | ||
3 | 3 | ||
4 | import com.topdraw.BaseTest; | 4 | import com.topdraw.BaseTest; |
5 | import com.topdraw.base.modules.common.ResultInfo; | ||
5 | import com.topdraw.business.module.rights.history.domain.RightsHistory; | 6 | import com.topdraw.business.module.rights.history.domain.RightsHistory; |
6 | import com.topdraw.business.process.rest.RightsOperationController; | 7 | import com.topdraw.business.process.rest.RightsOperationController; |
7 | import com.topdraw.common.ResultInfo; | ||
8 | import com.topdraw.util.TimestampUtil; | 8 | import com.topdraw.util.TimestampUtil; |
9 | import org.junit.Test; | 9 | import org.junit.Test; |
10 | import org.springframework.beans.factory.annotation.Autowired; | 10 | import org.springframework.beans.factory.annotation.Autowired; | ... | ... |
1 | package com.topdraw.test.business.process.rest; | 1 | package com.topdraw.test.business.process.rest; |
2 | 2 | ||
3 | import com.alibaba.fastjson.JSON; | ||
4 | import com.alibaba.fastjson.JSONObject; | 3 | import com.alibaba.fastjson.JSONObject; |
5 | import com.topdraw.BaseTest; | 4 | import com.topdraw.BaseTest; |
5 | import com.topdraw.base.modules.common.ResultInfo; | ||
6 | import com.topdraw.business.module.user.app.domain.UserApp; | 6 | import com.topdraw.business.module.user.app.domain.UserApp; |
7 | import com.topdraw.business.module.user.iptv.domain.UserTv; | 7 | import com.topdraw.business.module.user.iptv.domain.UserTv; |
8 | import com.topdraw.business.module.user.weixin.domain.UserWeixin; | 8 | import com.topdraw.business.module.user.weixin.domain.UserWeixin; |
9 | import com.topdraw.business.process.domian.weixin.BindBean; | 9 | import com.topdraw.business.process.domian.weixin.BindBean; |
10 | import com.topdraw.business.process.domian.weixin.SubscribeBean; | ||
11 | import com.topdraw.business.process.domian.weixin.TvUnBindBean; | 10 | import com.topdraw.business.process.domian.weixin.TvUnBindBean; |
12 | import com.topdraw.business.process.domian.weixin.WeixinUnBindBean; | 11 | import com.topdraw.business.process.domian.weixin.WeixinUnBindBean; |
13 | import com.topdraw.business.process.rest.UserOperationController; | 12 | import com.topdraw.business.process.rest.UserOperationController; |
14 | import com.topdraw.common.ResultInfo; | ||
15 | import org.junit.Test; | 13 | import org.junit.Test; |
16 | import org.springframework.beans.factory.annotation.Autowired; | 14 | import org.springframework.beans.factory.annotation.Autowired; |
17 | import org.springframework.util.Base64Utils; | ||
18 | 15 | ||
19 | import java.sql.Timestamp; | 16 | import java.sql.Timestamp; |
20 | import java.util.HashMap; | ||
21 | 17 | ||
22 | public class UserOperationControllerTest extends BaseTest { | 18 | public class UserOperationControllerTest extends BaseTest { |
23 | 19 | ... | ... |
-
Please register or sign in to post a comment