Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
midjourney-proxy
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
徐少华
midjourney-proxy
Commits
691d7cb1
Commit
691d7cb1
authored
Nov 26, 2019
by
阮思源
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'fix-zdw-10016730' into 'master'
fix-1016730: 打卡优惠券成员id为空 See merge request rays/pcloud-book!239
parents
14d9faea
6b7d255d
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
74 additions
and
2 deletions
+74
-2
LunarCalendarUtils.java
.../java/com/pcloud/book/util/common/LunarCalendarUtils.java
+2
-1
WeixinClockBiz.java
.../java/com/pcloud/book/weixinclock/biz/WeixinClockBiz.java
+5
-0
WeixinClockBizImpl.java
.../pcloud/book/weixinclock/biz/impl/WeixinClockBizImpl.java
+19
-0
WeixinClockUserCouponDao.java
...pcloud/book/weixinclock/dao/WeixinClockUserCouponDao.java
+15
-0
WeixinClockUserCouponDaoImpl.java
...ok/weixinclock/dao/impl/WeixinClockUserCouponDaoImpl.java
+14
-0
WeixinClockFacadeImpl.java
...d/book/weixinclock/facade/impl/WeixinClockFacadeImpl.java
+6
-0
WeixinClockMember.Mapper.xml
...resources/mapper/weixinclock/WeixinClockMember.Mapper.xml
+2
-1
WeixinClockUserCoupon.Mapper.xml
...urces/mapper/weixinclock/WeixinClockUserCoupon.Mapper.xml
+11
-0
No files found.
pcloud-service-book/src/main/java/com/pcloud/book/util/common/LunarCalendarUtils.java
View file @
691d7cb1
...
...
@@ -403,7 +403,8 @@ public class LunarCalendarUtils {
int
ganYear
=
y
%
10
>
3
?
(
y
%
10
-
3
)
:
(
y
%
10
-
3
+
10
);
int
gan
=
(
ganYear
*
2
+
m
)
%
10
;
gan
=
gan
==
0
?
10
:
gan
;
return
GAN
[
gan
-
1
]
+
ZHI
[
m
%
12
+
1
]
+
"月"
;
int
zhi
=
(
m
+
1
)%
12
;
return
GAN
[
gan
-
1
]
+
ZHI
[
zhi
]
+
"月"
;
}
/**
...
...
pcloud-service-book/src/main/java/com/pcloud/book/weixinclock/biz/WeixinClockBiz.java
View file @
691d7cb1
...
...
@@ -117,4 +117,9 @@ public interface WeixinClockBiz {
* @return
*/
GetClockCouponResponseVO
getClockCoupon
(
String
wxGroupId
,
Long
wechatUserId
);
/**
* 处理微信用户为空的用户优惠券
*/
void
solveUserCoupon
();
}
pcloud-service-book/src/main/java/com/pcloud/book/weixinclock/biz/impl/WeixinClockBizImpl.java
View file @
691d7cb1
...
...
@@ -786,6 +786,7 @@ public class WeixinClockBizImpl implements WeixinClockBiz {
amqpTemplate
.
convertAndSend
(
MQTopicProducer
.
EXCHAGE
,
MQTopicProducer
.
GIVE_GIFT
,
promotionOrderDto
);
weixinClockPrizeRecordDao
.
deleteByWxUserId
(
wechatGroupUser
.
getWxUserId
());
weixinClockMemberDao
.
updatMemberWechatUserId
(
wechatGroupUser
.
getWxUserId
(),
wechatGroupUser
.
getWechatUserId
());
weixinClockUserCouponDao
.
updateWechatUserId
(
wechatGroupUser
.
getWxUserId
(),
wechatGroupUser
.
getWechatUserId
());
}
@Override
...
...
@@ -841,4 +842,22 @@ public class WeixinClockBizImpl implements WeixinClockBiz {
return
vo
;
}
@Override
public
void
solveUserCoupon
(){
List
<
WeixinClockUserCoupon
>
userCoupons
=
weixinClockUserCouponDao
.
getNoWechatUserId
();
if
(
ListUtils
.
isEmpty
(
userCoupons
)){
return
;
}
for
(
WeixinClockUserCoupon
userCoupon
:
userCoupons
){
if
(
null
==
userCoupon
||
null
==
userCoupon
.
getWxUserId
()
||
null
==
userCoupon
.
getWxGroupId
()){
continue
;
}
WeixinClockMember
clockMember
=
weixinClockMemberDao
.
getByWxUserId
(
userCoupon
.
getWxGroupId
(),
userCoupon
.
getWxUserId
());
if
(
null
==
clockMember
||
null
==
clockMember
.
getWechatUserId
()){
continue
;
}
weixinClockUserCouponDao
.
updateWechatUserId
(
userCoupon
.
getWxUserId
(),
clockMember
.
getWechatUserId
());
}
}
}
pcloud-service-book/src/main/java/com/pcloud/book/weixinclock/dao/WeixinClockUserCouponDao.java
View file @
691d7cb1
...
...
@@ -3,6 +3,8 @@ package com.pcloud.book.weixinclock.dao;
import
com.pcloud.book.weixinclock.entity.WeixinClockUserCoupon
;
import
com.pcloud.common.core.dao.BaseDao
;
import
java.util.List
;
/**
* @Describe: 微信群打卡用户优惠dao
* @Author: zhangdongwei
...
...
@@ -16,4 +18,17 @@ public interface WeixinClockUserCouponDao extends BaseDao<WeixinClockUserCoupon>
* @return
*/
WeixinClockUserCoupon
getByGroupAndUser
(
String
wxGroupId
,
Long
wechatUserId
);
/**
* 修改微信用户id
* @param wxUserId
* @param wechatUserId
*/
void
updateWechatUserId
(
String
wxUserId
,
Long
wechatUserId
);
/**
* 获取没有wechatUserId的用户优惠券
* @return
*/
List
<
WeixinClockUserCoupon
>
getNoWechatUserId
();
}
pcloud-service-book/src/main/java/com/pcloud/book/weixinclock/dao/impl/WeixinClockUserCouponDaoImpl.java
View file @
691d7cb1
...
...
@@ -7,6 +7,7 @@ import com.pcloud.common.core.dao.BaseDaoImpl;
import
org.springframework.stereotype.Repository
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
/**
...
...
@@ -23,4 +24,17 @@ public class WeixinClockUserCouponDaoImpl extends BaseDaoImpl<WeixinClockUserCou
map
.
put
(
"wechatUserId"
,
wechatUserId
);
return
super
.
sqlSessionTemplate
.
selectOne
(
getStatement
(
"getByGroupAndUser"
),
map
);
}
@Override
public
void
updateWechatUserId
(
String
wxUserId
,
Long
wechatUserId
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"wxUserId"
,
wxUserId
);
map
.
put
(
"wechatUserId"
,
wechatUserId
);
super
.
sqlSessionTemplate
.
update
(
getStatement
(
"updateWechatUserId"
),
map
);
}
@Override
public
List
<
WeixinClockUserCoupon
>
getNoWechatUserId
()
{
return
super
.
sqlSessionTemplate
.
selectList
(
getStatement
(
"getNoWechatUserId"
));
}
}
pcloud-service-book/src/main/java/com/pcloud/book/weixinclock/facade/impl/WeixinClockFacadeImpl.java
View file @
691d7cb1
...
...
@@ -240,4 +240,10 @@ public class WeixinClockFacadeImpl implements WeixinClockFacade {
return
new
ResponseDto
<>(
weixinClockBiz
.
getClockCoupon
(
wxGroupId
,
wechatUserId
));
}
@RequestMapping
(
value
=
"solveUserCoupon"
,
method
=
RequestMethod
.
GET
)
public
ResponseDto
<?>
solveUserCoupon
(){
weixinClockBiz
.
solveUserCoupon
();
return
new
ResponseDto
<>();
}
}
pcloud-service-book/src/main/resources/mapper/weixinclock/WeixinClockMember.Mapper.xml
View file @
691d7cb1
...
...
@@ -6,6 +6,7 @@
<id
column=
"weixin_clock_member_id"
property=
"weixinClockMemberId"
jdbcType=
"BIGINT"
/>
<result
column=
"weixin_clock_id"
property=
"weixinClockId"
jdbcType=
"BIGINT"
/>
<result
column=
"wx_user_id"
property=
"wxUserId"
jdbcType=
"VARCHAR"
/>
<result
column=
"wechat_user_id"
property=
"wechatUserId"
jdbcType=
"BIGINT"
/>
<result
column=
"book_group_classify_id"
property=
"bookGroupClassifyId"
jdbcType=
"BIGINT"
/>
<result
column=
"wx_group_id"
property=
"wxGroupId"
jdbcType=
"VARCHAR"
/>
<result
column=
"nickname"
property=
"nickname"
jdbcType=
"VARCHAR"
/>
...
...
@@ -48,7 +49,7 @@
<select
id=
"getByWxUserId"
parameterType=
"map"
resultMap=
"BaseResultMap"
>
select
weixin_clock_member_id, weixin_clock_id, wx_user_id, book_group_classify_id, wx_group_id, nickname, head_pic, all_clock_day, score, create_time
weixin_clock_member_id, weixin_clock_id, wx_user_id, book_group_classify_id, wx_group_id, nickname, head_pic, all_clock_day, score, create_time
, wechat_user_id
from
weixin_clock_member
where
...
...
pcloud-service-book/src/main/resources/mapper/weixinclock/WeixinClockUserCoupon.Mapper.xml
View file @
691d7cb1
...
...
@@ -51,4 +51,14 @@
where wx_group_id = #{wxGroupId}
and wechat_user_id = #{wechatUserId}
</select>
<update
id=
"updateWechatUserId"
parameterType=
"map"
>
update weixin_clock_user_coupon set wechat_user_id = #{wechatUserId}
where wx_user_id = #{wxUserId} and wechat_user_id is null
</update>
<select
id=
"getNoWechatUserId"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from weixin_clock_user_coupon where wechat_user_id is null
</select>
</mapper>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment