Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Q
qk_backend
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
quanku
qk_backend
Commits
f35e3c30
Commit
f35e3c30
authored
Nov 21, 2024
by
shiyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
fca9bf73
Changes
16
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
1039 additions
and
318 deletions
+1039
-318
ch-admin-api/src/main/java/com/wwdz/ch/admin/impl/SysExchangeApplyOrderServiceImpl.java
.../wwdz/ch/admin/impl/SysExchangeApplyOrderServiceImpl.java
+0
-2
ch-core/src/main/java/com/wwdz/ch/core/consts/SigninEnum.java
...ore/src/main/java/com/wwdz/ch/core/consts/SigninEnum.java
+34
-0
ch-core/src/main/java/com/wwdz/ch/core/util/DateTimeUtil.java
...ore/src/main/java/com/wwdz/ch/core/util/DateTimeUtil.java
+41
-5
ch-dao/src/main/java/com/wwdz/ch/db/dao/UserSigninDao.java
ch-dao/src/main/java/com/wwdz/ch/db/dao/UserSigninDao.java
+9
-9
ch-dao/src/main/java/com/wwdz/ch/db/domain/UserSignIn.java
ch-dao/src/main/java/com/wwdz/ch/db/domain/UserSignIn.java
+24
-24
ch-dao/src/main/java/com/wwdz/ch/db/domain/UserSignInExample.java
...rc/main/java/com/wwdz/ch/db/domain/UserSignInExample.java
+159
-159
ch-dao/src/main/java/com/wwdz/ch/db/dto/request/UserSignInRequestDto.java
...java/com/wwdz/ch/db/dto/request/UserSignInRequestDto.java
+6
-2
ch-dao/src/main/java/com/wwdz/ch/db/impl/UserSigninDaoImpl.java
.../src/main/java/com/wwdz/ch/db/impl/UserSigninDaoImpl.java
+36
-40
ch-dao/src/main/java/com/wwdz/ch/db/mapper/UserSignInMapper.java
...src/main/java/com/wwdz/ch/db/mapper/UserSignInMapper.java
+69
-0
ch-dao/src/main/resources/com/wwdz/ch/db/mapper/UserSigninMapper.xml
...main/resources/com/wwdz/ch/db/mapper/UserSigninMapper.xml
+584
-42
ch-dao/src/main/resources/generatorConfig_new.xml
ch-dao/src/main/resources/generatorConfig_new.xml
+1
-1
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/UserSigninServiceImpl.java
.../main/java/com/wwdz/ch/wx/impl/UserSigninServiceImpl.java
+58
-17
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/distribution/SupplierItemServiceImpl.java
...wwdz/ch/wx/impl/distribution/SupplierItemServiceImpl.java
+0
-5
ch-wx-api/src/main/java/com/wwdz/ch/wx/service/UserSigninService.java
...c/main/java/com/wwdz/ch/wx/service/UserSigninService.java
+11
-5
ch-wx-api/src/main/java/com/wwdz/ch/wx/web/UserSigninController.java
...rc/main/java/com/wwdz/ch/wx/web/UserSigninController.java
+4
-4
ch-wx-api/src/test/java/com/wwdz/ch/wx/api/WxPayServiceTest.java
...pi/src/test/java/com/wwdz/ch/wx/api/WxPayServiceTest.java
+3
-3
No files found.
ch-admin-api/src/main/java/com/wwdz/ch/admin/impl/SysExchangeApplyOrderServiceImpl.java
View file @
f35e3c30
...
@@ -99,7 +99,6 @@ public class SysExchangeApplyOrderServiceImpl implements SysExchangeApplyOrderSe
...
@@ -99,7 +99,6 @@ public class SysExchangeApplyOrderServiceImpl implements SysExchangeApplyOrderSe
//订单更新为待发货
//订单更新为待发货
distributionOrderDao
.
updateState
(
targetUserOrderId
,
DistributionEnum
.
DistributionOrderStateEnum
.
PRE_SEND
.
getCode
());
distributionOrderDao
.
updateState
(
targetUserOrderId
,
DistributionEnum
.
DistributionOrderStateEnum
.
PRE_SEND
.
getCode
());
distributionOrderDao
.
updateState
(
userOrderId
,
DistributionEnum
.
DistributionOrderStateEnum
.
PRE_SEND
.
getCode
());
distributionOrderDao
.
updateState
(
userOrderId
,
DistributionEnum
.
DistributionOrderStateEnum
.
PRE_SEND
.
getCode
());
//发短信通知申请单双方,平台的鉴定结果
//发短信通知申请单双方,平台的鉴定结果
try
{
try
{
//通知提交方
//通知提交方
...
@@ -114,7 +113,6 @@ public class SysExchangeApplyOrderServiceImpl implements SysExchangeApplyOrderSe
...
@@ -114,7 +113,6 @@ public class SysExchangeApplyOrderServiceImpl implements SysExchangeApplyOrderSe
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
logger
.
info
(
">>>>>>>>> 交换申请单号:{}, 通过, 发送平台检查结果通知短信失败 <<<<<<<<<"
,
exchangeApplyOrder
.
getExchangeApplyOrderId
());
logger
.
info
(
">>>>>>>>> 交换申请单号:{}, 通过, 发送平台检查结果通知短信失败 <<<<<<<<<"
,
exchangeApplyOrder
.
getExchangeApplyOrderId
());
}
}
}
else
{
}
else
{
//平台审核不通过
//平台审核不通过
exchangeApplyOrderDao
.
updateState
(
orderId
,
dto
.
getState
());
exchangeApplyOrderDao
.
updateState
(
orderId
,
dto
.
getState
());
...
...
ch-core/src/main/java/com/wwdz/ch/core/consts/SigninEnum.java
View file @
f35e3c30
...
@@ -38,4 +38,38 @@ public class SigninEnum {
...
@@ -38,4 +38,38 @@ public class SigninEnum {
return
name
;
return
name
;
}
}
}
}
public
enum
DateStateEnum
{
PASS
(
0
,
"过去"
),
CURRENT
(
1
,
"当前"
),
FUTURE
(
2
,
"将来"
),
;
private
Integer
code
;
private
String
name
;
DateStateEnum
(
Integer
code
,
String
name
)
{
this
.
code
=
code
;
this
.
name
=
name
;
}
public
static
String
getNameByCode
(
int
code
)
{
for
(
SigninEnum
.
DateStateEnum
dateStateEnum
:
SigninEnum
.
DateStateEnum
.
values
())
{
if
(
code
==
dateStateEnum
.
getCode
())
{
return
dateStateEnum
.
getName
();
}
}
return
null
;
}
public
Integer
getCode
()
{
return
code
;
}
public
String
getName
()
{
return
name
;
}
}
}
}
ch-core/src/main/java/com/wwdz/ch/core/util/DateTimeUtil.java
View file @
f35e3c30
...
@@ -73,6 +73,9 @@ public class DateTimeUtil {
...
@@ -73,6 +73,9 @@ public class DateTimeUtil {
return
null
;
return
null
;
}
}
/**
/**
* 获取yyyy-MM格式月份的首末时间
* 获取yyyy-MM格式月份的首末时间
* @param yearMonth
* @param yearMonth
...
@@ -92,6 +95,19 @@ public class DateTimeUtil {
...
@@ -92,6 +95,19 @@ public class DateTimeUtil {
}
}
/**
* 获取时间中的日期为几号
* @param dateString
* @return
*/
public
static
int
getDayFromDateString
(
String
dateString
)
{
DateTimeFormatter
formatter
=
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd"
);
LocalDate
date
=
LocalDate
.
parse
(
dateString
,
formatter
);
return
date
.
getDayOfMonth
();
}
/**
/**
...
@@ -123,11 +139,6 @@ public class DateTimeUtil {
...
@@ -123,11 +139,6 @@ public class DateTimeUtil {
public
static
void
main
(
String
[]
args
)
{
List
<
String
>
datesList
=
getMonthDates
(
"2024-08"
);
System
.
out
.
println
(
datesList
);
}
public
static
List
<
String
>
getMonthDates
(
String
yearMonth
)
{
public
static
List
<
String
>
getMonthDates
(
String
yearMonth
)
{
List
<
String
>
dates
=
new
ArrayList
<>();
List
<
String
>
dates
=
new
ArrayList
<>();
DateTimeFormatter
formatter
=
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd"
);
DateTimeFormatter
formatter
=
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd"
);
...
@@ -142,4 +153,29 @@ public class DateTimeUtil {
...
@@ -142,4 +153,29 @@ public class DateTimeUtil {
}
}
return
dates
;
return
dates
;
}
}
public
static
int
getFirstDayOfMonth
(
int
year
,
int
month
)
{
if
(
month
<
1
||
month
>
12
)
{
throw
new
IllegalArgumentException
(
"月份无效,请输入1到12之间的数字。"
);
}
LocalDate
firstDayOfMonth
=
LocalDate
.
of
(
year
,
month
,
1
);
return
firstDayOfMonth
.
getDayOfWeek
().
getValue
();
}
public
static
void
main
(
String
[]
args
)
{
List
<
String
>
datesList
=
getMonthDates
(
"2024-08"
);
System
.
out
.
println
(
datesList
);
int
year
=
2024
;
// 示例年份
int
month
=
10
;
// 示例月份
// 调用方法并输出结果
int
dayOfWeekInt
=
getFirstDayOfMonth
(
year
,
month
);
System
.
out
.
println
(
year
+
"年 "
+
month
+
"月的一号是: "
+
dayOfWeekInt
);
System
.
out
.
println
(
"号"
+
getDayFromDateString
(
"2024-08-09"
));
LocalDate
today
=
LocalDate
.
now
();
System
.
out
.
println
(
today
.
getYear
()+
"-"
+
today
.
getMonthValue
());
}
}
}
ch-dao/src/main/java/com/wwdz/ch/db/dao/UserSigninDao.java
View file @
f35e3c30
package
com.wwdz.ch.db.dao
;
package
com.wwdz.ch.db.dao
;
import
com.wwdz.ch.db.domain.UserSign
i
n
;
import
com.wwdz.ch.db.domain.UserSign
I
n
;
import
com.wwdz.ch.db.dto.request.UserSign
i
nRequestDto
;
import
com.wwdz.ch.db.dto.request.UserSign
I
nRequestDto
;
import
java.util.List
;
import
java.util.List
;
public
interface
UserSigninDao
{
public
interface
UserSigninDao
{
boolean
insert
(
UserSign
i
n
userSignin
);
boolean
insert
(
UserSign
I
n
userSignin
);
UserSign
i
n
findLastedRecord
(
long
userId
);
UserSign
I
n
findLastedRecord
(
long
userId
);
List
<
UserSign
in
>
findList
(
UserSigni
nRequestDto
dto
);
List
<
UserSign
In
>
findList
(
UserSignI
nRequestDto
dto
);
/**
/**
* 查询昨天的签到记录
* 查询昨天的签到记录
* @param userId
* @param userId
* @return
* @return
*/
*/
UserSign
i
n
findYesterdayRecord
(
long
userId
);
UserSign
I
n
findYesterdayRecord
(
long
userId
);
/**
/**
* 判断某一日期是否签到过
* 判断某一日期是否签到过
...
@@ -29,9 +29,9 @@ public interface UserSigninDao {
...
@@ -29,9 +29,9 @@ public interface UserSigninDao {
boolean
isExisted
(
long
userId
,
String
date
);
boolean
isExisted
(
long
userId
,
String
date
);
UserSign
i
n
findRecord
(
long
userId
,
String
date
);
UserSign
I
n
findRecord
(
long
userId
,
String
date
);
boolean
update
(
UserSign
i
n
userSignin
);
boolean
update
(
UserSign
I
n
userSignin
);
boolean
updateByPrimaryKey
(
UserSign
i
n
userSignin
);
boolean
updateByPrimaryKey
(
UserSign
I
n
userSignin
);
}
}
ch-dao/src/main/java/com/wwdz/ch/db/domain/UserSign
i
n.java
→
ch-dao/src/main/java/com/wwdz/ch/db/domain/UserSign
I
n.java
View file @
f35e3c30
...
@@ -10,10 +10,10 @@ import lombok.Data;
...
@@ -10,10 +10,10 @@ import lombok.Data;
/**
/**
* @author shiyu
* @author shiyu
* @date 2024/11/
15
* @date 2024/11/
21
*/
*/
@Data
@Data
public
class
UserSign
i
n
implements
Entity
{
public
class
UserSign
I
n
implements
Entity
{
/**
/**
* id
* id
*/
*/
...
@@ -37,7 +37,7 @@ public class UserSignin implements Entity {
...
@@ -37,7 +37,7 @@ public class UserSignin implements Entity {
/**
/**
* 签到日期
* 签到日期
*/
*/
private
String
sign
i
nDate
;
private
String
sign
I
nDate
;
/**
/**
* 连续天数
* 连续天数
...
@@ -71,7 +71,7 @@ public class UserSignin implements Entity {
...
@@ -71,7 +71,7 @@ public class UserSignin implements Entity {
sb
.
append
(
", userId="
).
append
(
userId
);
sb
.
append
(
", userId="
).
append
(
userId
);
sb
.
append
(
", createTime="
).
append
(
createTime
);
sb
.
append
(
", createTime="
).
append
(
createTime
);
sb
.
append
(
", updateTime="
).
append
(
updateTime
);
sb
.
append
(
", updateTime="
).
append
(
updateTime
);
sb
.
append
(
", sign
inDate="
).
append
(
signi
nDate
);
sb
.
append
(
", sign
InDate="
).
append
(
signI
nDate
);
sb
.
append
(
", consecutiveDays="
).
append
(
consecutiveDays
);
sb
.
append
(
", consecutiveDays="
).
append
(
consecutiveDays
);
sb
.
append
(
", isReward="
).
append
(
isReward
);
sb
.
append
(
", isReward="
).
append
(
isReward
);
sb
.
append
(
", rewardLevel="
).
append
(
rewardLevel
);
sb
.
append
(
", rewardLevel="
).
append
(
rewardLevel
);
...
@@ -92,12 +92,12 @@ public class UserSignin implements Entity {
...
@@ -92,12 +92,12 @@ public class UserSignin implements Entity {
if
(
getClass
()
!=
that
.
getClass
())
{
if
(
getClass
()
!=
that
.
getClass
())
{
return
false
;
return
false
;
}
}
UserSign
in
other
=
(
UserSigni
n
)
that
;
UserSign
In
other
=
(
UserSignI
n
)
that
;
return
(
this
.
getId
()
==
null
?
other
.
getId
()
==
null
:
this
.
getId
().
equals
(
other
.
getId
()))
return
(
this
.
getId
()
==
null
?
other
.
getId
()
==
null
:
this
.
getId
().
equals
(
other
.
getId
()))
&&
(
this
.
getUserId
()
==
null
?
other
.
getUserId
()
==
null
:
this
.
getUserId
().
equals
(
other
.
getUserId
()))
&&
(
this
.
getUserId
()
==
null
?
other
.
getUserId
()
==
null
:
this
.
getUserId
().
equals
(
other
.
getUserId
()))
&&
(
this
.
getCreateTime
()
==
null
?
other
.
getCreateTime
()
==
null
:
this
.
getCreateTime
().
equals
(
other
.
getCreateTime
()))
&&
(
this
.
getCreateTime
()
==
null
?
other
.
getCreateTime
()
==
null
:
this
.
getCreateTime
().
equals
(
other
.
getCreateTime
()))
&&
(
this
.
getUpdateTime
()
==
null
?
other
.
getUpdateTime
()
==
null
:
this
.
getUpdateTime
().
equals
(
other
.
getUpdateTime
()))
&&
(
this
.
getUpdateTime
()
==
null
?
other
.
getUpdateTime
()
==
null
:
this
.
getUpdateTime
().
equals
(
other
.
getUpdateTime
()))
&&
(
this
.
getSign
inDate
()
==
null
?
other
.
getSigninDate
()
==
null
:
this
.
getSigninDate
().
equals
(
other
.
getSigni
nDate
()))
&&
(
this
.
getSign
InDate
()
==
null
?
other
.
getSignInDate
()
==
null
:
this
.
getSignInDate
().
equals
(
other
.
getSignI
nDate
()))
&&
(
this
.
getConsecutiveDays
()
==
null
?
other
.
getConsecutiveDays
()
==
null
:
this
.
getConsecutiveDays
().
equals
(
other
.
getConsecutiveDays
()))
&&
(
this
.
getConsecutiveDays
()
==
null
?
other
.
getConsecutiveDays
()
==
null
:
this
.
getConsecutiveDays
().
equals
(
other
.
getConsecutiveDays
()))
&&
(
this
.
getIsReward
()
==
null
?
other
.
getIsReward
()
==
null
:
this
.
getIsReward
().
equals
(
other
.
getIsReward
()))
&&
(
this
.
getIsReward
()
==
null
?
other
.
getIsReward
()
==
null
:
this
.
getIsReward
().
equals
(
other
.
getIsReward
()))
&&
(
this
.
getRewardLevel
()
==
null
?
other
.
getRewardLevel
()
==
null
:
this
.
getRewardLevel
().
equals
(
other
.
getRewardLevel
()))
&&
(
this
.
getRewardLevel
()
==
null
?
other
.
getRewardLevel
()
==
null
:
this
.
getRewardLevel
().
equals
(
other
.
getRewardLevel
()))
...
@@ -112,7 +112,7 @@ public class UserSignin implements Entity {
...
@@ -112,7 +112,7 @@ public class UserSignin implements Entity {
result
=
prime
*
result
+
((
getUserId
()
==
null
)
?
0
:
getUserId
().
hashCode
());
result
=
prime
*
result
+
((
getUserId
()
==
null
)
?
0
:
getUserId
().
hashCode
());
result
=
prime
*
result
+
((
getCreateTime
()
==
null
)
?
0
:
getCreateTime
().
hashCode
());
result
=
prime
*
result
+
((
getCreateTime
()
==
null
)
?
0
:
getCreateTime
().
hashCode
());
result
=
prime
*
result
+
((
getUpdateTime
()
==
null
)
?
0
:
getUpdateTime
().
hashCode
());
result
=
prime
*
result
+
((
getUpdateTime
()
==
null
)
?
0
:
getUpdateTime
().
hashCode
());
result
=
prime
*
result
+
((
getSign
inDate
()
==
null
)
?
0
:
getSigni
nDate
().
hashCode
());
result
=
prime
*
result
+
((
getSign
InDate
()
==
null
)
?
0
:
getSignI
nDate
().
hashCode
());
result
=
prime
*
result
+
((
getConsecutiveDays
()
==
null
)
?
0
:
getConsecutiveDays
().
hashCode
());
result
=
prime
*
result
+
((
getConsecutiveDays
()
==
null
)
?
0
:
getConsecutiveDays
().
hashCode
());
result
=
prime
*
result
+
((
getIsReward
()
==
null
)
?
0
:
getIsReward
().
hashCode
());
result
=
prime
*
result
+
((
getIsReward
()
==
null
)
?
0
:
getIsReward
().
hashCode
());
result
=
prime
*
result
+
((
getRewardLevel
()
==
null
)
?
0
:
getRewardLevel
().
hashCode
());
result
=
prime
*
result
+
((
getRewardLevel
()
==
null
)
?
0
:
getRewardLevel
().
hashCode
());
...
@@ -122,7 +122,7 @@ public class UserSignin implements Entity {
...
@@ -122,7 +122,7 @@ public class UserSignin implements Entity {
/**
/**
* This enum was generated by MyBatis Generator.
* This enum was generated by MyBatis Generator.
* This enum corresponds to the database table user_signin
* This enum corresponds to the database table user_sign
_
in
*
*
* @mbg.generated
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
* @project https://github.com/itfsw/mybatis-generator-plugin
...
@@ -132,7 +132,7 @@ public class UserSignin implements Entity {
...
@@ -132,7 +132,7 @@ public class UserSignin implements Entity {
userId
(
"user_id"
,
"userId"
,
"BIGINT"
,
false
),
userId
(
"user_id"
,
"userId"
,
"BIGINT"
,
false
),
createTime
(
"create_time"
,
"createTime"
,
"TIMESTAMP"
,
false
),
createTime
(
"create_time"
,
"createTime"
,
"TIMESTAMP"
,
false
),
updateTime
(
"update_time"
,
"updateTime"
,
"TIMESTAMP"
,
false
),
updateTime
(
"update_time"
,
"updateTime"
,
"TIMESTAMP"
,
false
),
sign
inDate
(
"signin_date"
,
"signi
nDate"
,
"VARCHAR"
,
false
),
sign
InDate
(
"sign_in_date"
,
"signI
nDate"
,
"VARCHAR"
,
false
),
consecutiveDays
(
"consecutive_days"
,
"consecutiveDays"
,
"INTEGER"
,
false
),
consecutiveDays
(
"consecutive_days"
,
"consecutiveDays"
,
"INTEGER"
,
false
),
isReward
(
"is_reward"
,
"isReward"
,
"BIT"
,
false
),
isReward
(
"is_reward"
,
"isReward"
,
"BIT"
,
false
),
rewardLevel
(
"reward_level"
,
"rewardLevel"
,
"INTEGER"
,
false
),
rewardLevel
(
"reward_level"
,
"rewardLevel"
,
"INTEGER"
,
false
),
...
@@ -140,7 +140,7 @@ public class UserSignin implements Entity {
...
@@ -140,7 +140,7 @@ public class UserSignin implements Entity {
/**
/**
* This field was generated by MyBatis Generator.
* This field was generated by MyBatis Generator.
* This field corresponds to the database table user_signin
* This field corresponds to the database table user_sign
_
in
*
*
* @mbg.generated
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
* @project https://github.com/itfsw/mybatis-generator-plugin
...
@@ -149,7 +149,7 @@ public class UserSignin implements Entity {
...
@@ -149,7 +149,7 @@ public class UserSignin implements Entity {
/**
/**
* This field was generated by MyBatis Generator.
* This field was generated by MyBatis Generator.
* This field corresponds to the database table user_signin
* This field corresponds to the database table user_sign
_
in
*
*
* @mbg.generated
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
* @project https://github.com/itfsw/mybatis-generator-plugin
...
@@ -158,7 +158,7 @@ public class UserSignin implements Entity {
...
@@ -158,7 +158,7 @@ public class UserSignin implements Entity {
/**
/**
* This field was generated by MyBatis Generator.
* This field was generated by MyBatis Generator.
* This field corresponds to the database table user_signin
* This field corresponds to the database table user_sign
_
in
*
*
* @mbg.generated
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
* @project https://github.com/itfsw/mybatis-generator-plugin
...
@@ -167,7 +167,7 @@ public class UserSignin implements Entity {
...
@@ -167,7 +167,7 @@ public class UserSignin implements Entity {
/**
/**
* This field was generated by MyBatis Generator.
* This field was generated by MyBatis Generator.
* This field corresponds to the database table user_signin
* This field corresponds to the database table user_sign
_
in
*
*
* @mbg.generated
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
* @project https://github.com/itfsw/mybatis-generator-plugin
...
@@ -176,7 +176,7 @@ public class UserSignin implements Entity {
...
@@ -176,7 +176,7 @@ public class UserSignin implements Entity {
/**
/**
* This field was generated by MyBatis Generator.
* This field was generated by MyBatis Generator.
* This field corresponds to the database table user_signin
* This field corresponds to the database table user_sign
_
in
*
*
* @mbg.generated
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
* @project https://github.com/itfsw/mybatis-generator-plugin
...
@@ -185,7 +185,7 @@ public class UserSignin implements Entity {
...
@@ -185,7 +185,7 @@ public class UserSignin implements Entity {
/**
/**
* This field was generated by MyBatis Generator.
* This field was generated by MyBatis Generator.
* This field corresponds to the database table user_signin
* This field corresponds to the database table user_sign
_
in
*
*
* @mbg.generated
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
* @project https://github.com/itfsw/mybatis-generator-plugin
...
@@ -194,7 +194,7 @@ public class UserSignin implements Entity {
...
@@ -194,7 +194,7 @@ public class UserSignin implements Entity {
/**
/**
* This method was generated by MyBatis Generator.
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_signin
* This method corresponds to the database table user_sign
_
in
*
*
* @mbg.generated
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
* @project https://github.com/itfsw/mybatis-generator-plugin
...
@@ -205,7 +205,7 @@ public class UserSignin implements Entity {
...
@@ -205,7 +205,7 @@ public class UserSignin implements Entity {
/**
/**
* This method was generated by MyBatis Generator.
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_signin
* This method corresponds to the database table user_sign
_
in
*
*
* @mbg.generated
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
* @project https://github.com/itfsw/mybatis-generator-plugin
...
@@ -216,7 +216,7 @@ public class UserSignin implements Entity {
...
@@ -216,7 +216,7 @@ public class UserSignin implements Entity {
/**
/**
* This method was generated by MyBatis Generator.
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_signin
* This method corresponds to the database table user_sign
_
in
*
*
* @mbg.generated
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
* @project https://github.com/itfsw/mybatis-generator-plugin
...
@@ -227,7 +227,7 @@ public class UserSignin implements Entity {
...
@@ -227,7 +227,7 @@ public class UserSignin implements Entity {
/**
/**
* This method was generated by MyBatis Generator.
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_signin
* This method corresponds to the database table user_sign
_
in
*
*
* @mbg.generated
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
* @project https://github.com/itfsw/mybatis-generator-plugin
...
@@ -238,7 +238,7 @@ public class UserSignin implements Entity {
...
@@ -238,7 +238,7 @@ public class UserSignin implements Entity {
/**
/**
* This method was generated by MyBatis Generator.
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_signin
* This method corresponds to the database table user_sign
_
in
*
*
* @mbg.generated
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
* @project https://github.com/itfsw/mybatis-generator-plugin
...
@@ -252,7 +252,7 @@ public class UserSignin implements Entity {
...
@@ -252,7 +252,7 @@ public class UserSignin implements Entity {
/**
/**
* This method was generated by MyBatis Generator.
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_signin
* This method corresponds to the database table user_sign
_
in
*
*
* @mbg.generated
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
* @project https://github.com/itfsw/mybatis-generator-plugin
...
@@ -263,7 +263,7 @@ public class UserSignin implements Entity {
...
@@ -263,7 +263,7 @@ public class UserSignin implements Entity {
/**
/**
* This method was generated by MyBatis Generator.
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_signin
* This method corresponds to the database table user_sign
_
in
*
*
* @mbg.generated
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
* @project https://github.com/itfsw/mybatis-generator-plugin
...
@@ -274,7 +274,7 @@ public class UserSignin implements Entity {
...
@@ -274,7 +274,7 @@ public class UserSignin implements Entity {
/**
/**
* This method was generated by MyBatis Generator.
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_signin
* This method corresponds to the database table user_sign
_
in
*
*
* @mbg.generated
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
* @project https://github.com/itfsw/mybatis-generator-plugin
...
@@ -289,7 +289,7 @@ public class UserSignin implements Entity {
...
@@ -289,7 +289,7 @@ public class UserSignin implements Entity {
/**
/**
* This method was generated by MyBatis Generator.
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_signin
* This method corresponds to the database table user_sign
_
in
*
*
* @mbg.generated
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
* @project https://github.com/itfsw/mybatis-generator-plugin
...
...
ch-dao/src/main/java/com/wwdz/ch/db/domain/UserSign
i
nExample.java
→
ch-dao/src/main/java/com/wwdz/ch/db/domain/UserSign
I
nExample.java
View file @
f35e3c30
This diff is collapsed.
Click to expand it.
ch-dao/src/main/java/com/wwdz/ch/db/dto/request/UserSign
i
nRequestDto.java
→
ch-dao/src/main/java/com/wwdz/ch/db/dto/request/UserSign
I
nRequestDto.java
View file @
f35e3c30
...
@@ -5,7 +5,11 @@ import lombok.Data;
...
@@ -5,7 +5,11 @@ import lombok.Data;
import
java.util.Date
;
import
java.util.Date
;
@Data
@Data
public
class
UserSigninRequestDto
extends
BaseRequestDto
implements
Entity
{
public
class
UserSignInRequestDto
extends
BaseRequestDto
implements
Entity
{
private
String
year
;
private
String
month
;
/**
/**
* id
* id
...
@@ -41,7 +45,7 @@ public class UserSigninRequestDto extends BaseRequestDto implements Entity {
...
@@ -41,7 +45,7 @@ public class UserSigninRequestDto extends BaseRequestDto implements Entity {
/**
/**
* 签到日期
* 签到日期
*/
*/
private
String
sign
i
nDate
;
private
String
sign
I
nDate
;
/**
/**
* 连续天数
* 连续天数
...
...
ch-dao/src/main/java/com/wwdz/ch/db/impl/UserSigninDaoImpl.java
View file @
f35e3c30
package
com.wwdz.ch.db.impl
;
package
com.wwdz.ch.db.impl
;
import
com.wwdz.ch.db.dao.UserSigninDao
;
import
com.wwdz.ch.db.dao.UserSigninDao
;
import
com.wwdz.ch.db.domain.UserSign
i
n
;
import
com.wwdz.ch.db.domain.UserSign
I
n
;
import
com.wwdz.ch.db.domain.UserSign
i
nExample
;
import
com.wwdz.ch.db.domain.UserSign
I
nExample
;
import
com.wwdz.ch.db.dto.request.UserSign
i
nRequestDto
;
import
com.wwdz.ch.db.dto.request.UserSign
I
nRequestDto
;
import
com.wwdz.ch.db.mapper.UserSign
i
nMapper
;
import
com.wwdz.ch.db.mapper.UserSign
I
nMapper
;
import
com.xxdxxs.db.component.JdbcHelper
;
import
com.xxdxxs.db.component.JdbcHelper
;
import
com.xxdxxs.utils.DateUtils
;
import
com.xxdxxs.utils.DateUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Repository
;
import
org.springframework.stereotype.Repository
;
import
java.time.LocalDate
;
import
java.time.LocalDate
;
import
java.time.LocalDateTime
;
import
java.time.LocalTime
;
import
java.time.format.DateTimeFormatter
;
import
java.util.List
;
import
java.util.List
;
@Repository
@Repository
public
class
UserSigninDaoImpl
implements
UserSigninDao
{
public
class
UserSigninDaoImpl
implements
UserSigninDao
{
@Autowired
@Autowired
UserSign
inMapper
userSigni
nMapper
;
UserSign
InMapper
userSignI
nMapper
;
@Override
@Override
public
boolean
insert
(
UserSign
i
n
userSignin
)
{
public
boolean
insert
(
UserSign
I
n
userSignin
)
{
return
userSign
i
nMapper
.
insert
(
userSignin
)
>
0
;
return
userSign
I
nMapper
.
insert
(
userSignin
)
>
0
;
}
}
@Override
@Override
public
UserSign
i
n
findLastedRecord
(
long
userId
)
{
public
UserSign
I
n
findLastedRecord
(
long
userId
)
{
UserSign
inExample
example
=
new
UserSigni
nExample
();
UserSign
InExample
example
=
new
UserSignI
nExample
();
UserSign
i
nExample
.
Criteria
criteria
=
example
.
createCriteria
();
UserSign
I
nExample
.
Criteria
criteria
=
example
.
createCriteria
();
criteria
.
andUserIdEqualTo
(
userId
);
criteria
.
andUserIdEqualTo
(
userId
);
example
.
setOrderByClause
(
"create_time desc"
);
example
.
setOrderByClause
(
"create_time desc"
);
return
userSign
i
nMapper
.
selectOneByExample
(
example
);
return
userSign
I
nMapper
.
selectOneByExample
(
example
);
}
}
@Override
@Override
public
List
<
UserSign
in
>
findList
(
UserSigni
nRequestDto
dto
)
{
public
List
<
UserSign
In
>
findList
(
UserSignI
nRequestDto
dto
)
{
UserSign
inExample
example
=
new
UserSigni
nExample
();
UserSign
InExample
example
=
new
UserSignI
nExample
();
UserSign
i
nExample
.
Criteria
criteria
=
example
.
createCriteria
();
UserSign
I
nExample
.
Criteria
criteria
=
example
.
createCriteria
();
criteria
.
andUserIdEqualTo
(
dto
.
getUserId
());
criteria
.
andUserIdEqualTo
(
dto
.
getUserId
());
JdbcHelper
.
ifPresent
(
dto
.
getStartQueryTime
(),
criteria
::
andCreateTimeGreaterThanOrEqualTo
);
JdbcHelper
.
ifPresent
(
dto
.
getStartQueryTime
(),
criteria
::
andCreateTimeGreaterThanOrEqualTo
);
JdbcHelper
.
ifPresent
(
dto
.
getEndQueryTime
(),
criteria
::
andCreateTimeLessThanOrEqualTo
);
JdbcHelper
.
ifPresent
(
dto
.
getEndQueryTime
(),
criteria
::
andCreateTimeLessThanOrEqualTo
);
example
.
setOrderByClause
(
"create_time desc"
);
example
.
setOrderByClause
(
"create_time desc"
);
return
userSign
i
nMapper
.
selectByExample
(
example
);
return
userSign
I
nMapper
.
selectByExample
(
example
);
}
}
@Override
@Override
public
UserSign
i
n
findYesterdayRecord
(
long
userId
)
{
public
UserSign
I
n
findYesterdayRecord
(
long
userId
)
{
LocalDate
yesterday
=
LocalDate
.
now
().
minusDays
(
1
);
LocalDate
yesterday
=
LocalDate
.
now
().
minusDays
(
1
);
String
yesterdayString
=
DateUtils
.
DATE
.
format
(
yesterday
);
String
yesterdayString
=
DateUtils
.
DATE
.
format
(
yesterday
);
UserSign
inExample
example
=
new
UserSigni
nExample
();
UserSign
InExample
example
=
new
UserSignI
nExample
();
UserSign
i
nExample
.
Criteria
criteria
=
example
.
createCriteria
();
UserSign
I
nExample
.
Criteria
criteria
=
example
.
createCriteria
();
criteria
.
andUserIdEqualTo
(
userId
);
criteria
.
andUserIdEqualTo
(
userId
);
criteria
.
andSign
i
nDateEqualTo
(
yesterdayString
);
criteria
.
andSign
I
nDateEqualTo
(
yesterdayString
);
return
userSign
i
nMapper
.
selectOneByExample
(
example
);
return
userSign
I
nMapper
.
selectOneByExample
(
example
);
}
}
@Override
@Override
public
boolean
isExisted
(
long
userId
,
String
date
)
{
public
boolean
isExisted
(
long
userId
,
String
date
)
{
UserSign
inExample
example
=
new
UserSigni
nExample
();
UserSign
InExample
example
=
new
UserSignI
nExample
();
UserSign
i
nExample
.
Criteria
criteria
=
example
.
createCriteria
();
UserSign
I
nExample
.
Criteria
criteria
=
example
.
createCriteria
();
criteria
.
andUserIdEqualTo
(
userId
);
criteria
.
andUserIdEqualTo
(
userId
);
criteria
.
andSign
i
nDateEqualTo
(
date
);
criteria
.
andSign
I
nDateEqualTo
(
date
);
return
userSign
i
nMapper
.
countByExample
(
example
)
>
0
;
return
userSign
I
nMapper
.
countByExample
(
example
)
>
0
;
}
}
@Override
@Override
public
UserSign
i
n
findRecord
(
long
userId
,
String
date
)
{
public
UserSign
I
n
findRecord
(
long
userId
,
String
date
)
{
UserSign
inExample
example
=
new
UserSigni
nExample
();
UserSign
InExample
example
=
new
UserSignI
nExample
();
UserSign
i
nExample
.
Criteria
criteria
=
example
.
createCriteria
();
UserSign
I
nExample
.
Criteria
criteria
=
example
.
createCriteria
();
criteria
.
andUserIdEqualTo
(
userId
);
criteria
.
andUserIdEqualTo
(
userId
);
criteria
.
andSign
i
nDateEqualTo
(
date
);
criteria
.
andSign
I
nDateEqualTo
(
date
);
return
userSign
i
nMapper
.
selectOneByExample
(
example
);
return
userSign
I
nMapper
.
selectOneByExample
(
example
);
}
}
@Override
@Override
public
boolean
update
(
UserSign
i
n
userSignin
)
{
public
boolean
update
(
UserSign
I
n
userSignin
)
{
UserSign
inExample
example
=
new
UserSigni
nExample
();
UserSign
InExample
example
=
new
UserSignI
nExample
();
UserSign
i
nExample
.
Criteria
criteria
=
example
.
createCriteria
();
UserSign
I
nExample
.
Criteria
criteria
=
example
.
createCriteria
();
criteria
.
andUserIdEqualTo
(
userSignin
.
getUserId
());
criteria
.
andUserIdEqualTo
(
userSignin
.
getUserId
());
criteria
.
andSign
inDateEqualTo
(
userSignin
.
getSigni
nDate
());
criteria
.
andSign
InDateEqualTo
(
userSignin
.
getSignI
nDate
());
return
userSign
i
nMapper
.
updateByExampleSelective
(
userSignin
,
example
)
>
0
;
return
userSign
I
nMapper
.
updateByExampleSelective
(
userSignin
,
example
)
>
0
;
}
}
@Override
@Override
public
boolean
updateByPrimaryKey
(
UserSign
i
n
userSignin
)
{
public
boolean
updateByPrimaryKey
(
UserSign
I
n
userSignin
)
{
return
userSign
i
nMapper
.
updateByPrimaryKeySelective
(
userSignin
)
>
0
;
return
userSign
I
nMapper
.
updateByPrimaryKeySelective
(
userSignin
)
>
0
;
}
}
}
}
ch-dao/src/main/java/com/wwdz/ch/db/mapper/UserSign
i
nMapper.java
→
ch-dao/src/main/java/com/wwdz/ch/db/mapper/UserSign
I
nMapper.java
View file @
f35e3c30
package
com.wwdz.ch.db.mapper
;
package
com.wwdz.ch.db.mapper
;
import
com.wwdz.ch.db.domain.UserSign
i
n
;
import
com.wwdz.ch.db.domain.UserSign
I
n
;
import
com.wwdz.ch.db.domain.UserSign
i
nExample
;
import
com.wwdz.ch.db.domain.UserSign
I
nExample
;
import
java.util.List
;
import
java.util.List
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Param
;
@Mapper
@Mapper
public
interface
UserSign
i
nMapper
{
public
interface
UserSign
I
nMapper
{
long
countByExample
(
UserSign
i
nExample
example
);
long
countByExample
(
UserSign
I
nExample
example
);
int
deleteByExample
(
UserSign
i
nExample
example
);
int
deleteByExample
(
UserSign
I
nExample
example
);
int
deleteByPrimaryKey
(
Long
id
);
int
deleteByPrimaryKey
(
Long
id
);
int
insert
(
UserSign
i
n
record
);
int
insert
(
UserSign
I
n
record
);
int
insertSelective
(
UserSign
i
n
record
);
int
insertSelective
(
UserSign
I
n
record
);
/**
/**
* This method was generated by MyBatis Generator.
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_signin
* This method corresponds to the database table user_sign
_
in
*
*
* @mbg.generated
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
*/
UserSign
in
selectOneByExample
(
UserSigni
nExample
example
);
UserSign
In
selectOneByExample
(
UserSignI
nExample
example
);
/**
/**
* This method was generated by MyBatis Generator.
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_signin
* This method corresponds to the database table user_sign
_
in
*
*
* @mbg.generated
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
*/
UserSign
in
selectOneByExampleSelective
(
@Param
(
"example"
)
UserSigninExample
example
,
@Param
(
"selective"
)
UserSigni
n
.
Column
...
selective
);
UserSign
In
selectOneByExampleSelective
(
@Param
(
"example"
)
UserSignInExample
example
,
@Param
(
"selective"
)
UserSignI
n
.
Column
...
selective
);
/**
/**
* This method was generated by MyBatis Generator.
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_signin
* This method corresponds to the database table user_sign
_
in
*
*
* @mbg.generated
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
*/
List
<
UserSign
in
>
selectByExampleSelective
(
@Param
(
"example"
)
UserSigninExample
example
,
@Param
(
"selective"
)
UserSigni
n
.
Column
...
selective
);
List
<
UserSign
In
>
selectByExampleSelective
(
@Param
(
"example"
)
UserSignInExample
example
,
@Param
(
"selective"
)
UserSignI
n
.
Column
...
selective
);
List
<
UserSign
in
>
selectByExample
(
UserSigni
nExample
example
);
List
<
UserSign
In
>
selectByExample
(
UserSignI
nExample
example
);
/**
/**
* This method was generated by MyBatis Generator.
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_signin
* This method corresponds to the database table user_sign
_
in
*
*
* @mbg.generated
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
*/
UserSign
in
selectByPrimaryKeySelective
(
@Param
(
"id"
)
Long
id
,
@Param
(
"selective"
)
UserSigni
n
.
Column
...
selective
);
UserSign
In
selectByPrimaryKeySelective
(
@Param
(
"id"
)
Long
id
,
@Param
(
"selective"
)
UserSignI
n
.
Column
...
selective
);
UserSign
i
n
selectByPrimaryKey
(
Long
id
);
UserSign
I
n
selectByPrimaryKey
(
Long
id
);
int
updateByExampleSelective
(
@Param
(
"record"
)
UserSign
in
record
,
@Param
(
"example"
)
UserSigni
nExample
example
);
int
updateByExampleSelective
(
@Param
(
"record"
)
UserSign
In
record
,
@Param
(
"example"
)
UserSignI
nExample
example
);
int
updateByExample
(
@Param
(
"record"
)
UserSign
in
record
,
@Param
(
"example"
)
UserSigni
nExample
example
);
int
updateByExample
(
@Param
(
"record"
)
UserSign
In
record
,
@Param
(
"example"
)
UserSignI
nExample
example
);
int
updateByPrimaryKeySelective
(
UserSign
i
n
record
);
int
updateByPrimaryKeySelective
(
UserSign
I
n
record
);
int
updateByPrimaryKey
(
UserSign
i
n
record
);
int
updateByPrimaryKey
(
UserSign
I
n
record
);
}
}
\ No newline at end of file
ch-dao/src/main/resources/com/wwdz/ch/db/mapper/UserSigninMapper.xml
View file @
f35e3c30
This diff is collapsed.
Click to expand it.
ch-dao/src/main/resources/generatorConfig_new.xml
View file @
f35e3c30
...
@@ -72,7 +72,7 @@
...
@@ -72,7 +72,7 @@
<javaClientGenerator
type=
"XMLMAPPER"
targetPackage=
"com.wwdz.ch.db.mapper"
<javaClientGenerator
type=
"XMLMAPPER"
targetPackage=
"com.wwdz.ch.db.mapper"
targetProject=
"ch-dao/src/main/java"
/>
targetProject=
"ch-dao/src/main/java"
/>
<table
tableName=
"user_signin"
enableCountByExample=
"true"
enableUpdateByExample=
"true"
enableDeleteByExample=
"true"
enableSelectByExample=
"true"
selectByExampleQueryId=
"true"
>
<table
tableName=
"user_sign
_
in"
enableCountByExample=
"true"
enableUpdateByExample=
"true"
enableDeleteByExample=
"true"
enableSelectByExample=
"true"
selectByExampleQueryId=
"true"
>
<generatedKey
column=
"id"
sqlStatement=
"Mysql"
identity=
"true"
/>
<generatedKey
column=
"id"
sqlStatement=
"Mysql"
identity=
"true"
/>
</table>
</table>
...
...
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/UserSigninServiceImpl.java
View file @
f35e3c30
...
@@ -3,16 +3,18 @@ package com.wwdz.ch.wx.impl;
...
@@ -3,16 +3,18 @@ package com.wwdz.ch.wx.impl;
import
com.wwdz.ch.core.consts.CommConsts
;
import
com.wwdz.ch.core.consts.CommConsts
;
import
com.wwdz.ch.core.consts.DistributionEnum
;
import
com.wwdz.ch.core.consts.DistributionEnum
;
import
com.wwdz.ch.core.consts.SigninEnum
;
import
com.wwdz.ch.core.consts.SigninEnum
;
import
com.wwdz.ch.core.entity.SignDateRecord
;
import
com.wwdz.ch.core.type.Result
;
import
com.wwdz.ch.core.type.Result
;
import
com.wwdz.ch.core.util.DateTimeUtil
;
import
com.wwdz.ch.core.util.DateTimeUtil
;
import
com.wwdz.ch.core.util.IdUtils
;
import
com.wwdz.ch.core.util.IdUtils
;
import
com.wwdz.ch.db.dao.UserSigninDao
;
import
com.wwdz.ch.db.dao.UserSigninDao
;
import
com.wwdz.ch.db.dao.distribution.DistributionOrderDao
;
import
com.wwdz.ch.db.dao.distribution.DistributionOrderDao
;
import
com.wwdz.ch.db.domain.UserSign
i
n
;
import
com.wwdz.ch.db.domain.UserSign
I
n
;
import
com.wwdz.ch.db.domain.distribution.DistributionOrder
;
import
com.wwdz.ch.db.domain.distribution.DistributionOrder
;
import
com.wwdz.ch.db.dto.request.UserSign
i
nRequestDto
;
import
com.wwdz.ch.db.dto.request.UserSign
I
nRequestDto
;
import
com.wwdz.ch.wx.service.UserSigninService
;
import
com.wwdz.ch.wx.service.UserSigninService
;
import
com.xxdxxs.utils.DateUtils
;
import
com.xxdxxs.utils.DateUtils
;
import
com.xxdxxs.utils.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -20,8 +22,10 @@ import org.springframework.stereotype.Service;
...
@@ -20,8 +22,10 @@ import org.springframework.stereotype.Service;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.interceptor.TransactionAspectSupport
;
import
org.springframework.transaction.interceptor.TransactionAspectSupport
;
import
java.time.LocalDate
;
import
java.time.LocalDate
;
import
java.time.format.DateTimeFormatter
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
import
java.util.stream.Collectors
;
@Service
@Service
public
class
UserSigninServiceImpl
implements
UserSigninService
{
public
class
UserSigninServiceImpl
implements
UserSigninService
{
...
@@ -35,7 +39,7 @@ public class UserSigninServiceImpl implements UserSigninService {
...
@@ -35,7 +39,7 @@ public class UserSigninServiceImpl implements UserSigninService {
DistributionOrderDao
distributionOrderDao
;
DistributionOrderDao
distributionOrderDao
;
@Override
@Override
public
Result
signin
(
UserSign
i
nRequestDto
dto
)
{
public
Result
signin
(
UserSign
I
nRequestDto
dto
)
{
try
{
try
{
long
userId
=
dto
.
getUserId
();
long
userId
=
dto
.
getUserId
();
//检查是否已签到过
//检查是否已签到过
...
@@ -44,11 +48,11 @@ public class UserSigninServiceImpl implements UserSigninService {
...
@@ -44,11 +48,11 @@ public class UserSigninServiceImpl implements UserSigninService {
return
Result
.
failed
(
"您今天已签到过"
);
return
Result
.
failed
(
"您今天已签到过"
);
}
}
//今天尚未签到,则进行记录,先查询昨天的打卡记录,有则再连续打卡天数上+1,没有则算签到第一天
//今天尚未签到,则进行记录,先查询昨天的打卡记录,有则再连续打卡天数上+1,没有则算签到第一天
UserSign
i
n
yesterdaySignin
=
userSigninDao
.
findYesterdayRecord
(
userId
);
UserSign
I
n
yesterdaySignin
=
userSigninDao
.
findYesterdayRecord
(
userId
);
if
(
yesterdaySignin
==
null
)
{
if
(
yesterdaySignin
==
null
)
{
UserSign
in
userSignin
=
new
UserSigni
n
();
UserSign
In
userSignin
=
new
UserSignI
n
();
userSignin
.
setUserId
(
userId
);
userSignin
.
setUserId
(
userId
);
userSignin
.
setSign
i
nDate
(
todayStr
);
userSignin
.
setSign
I
nDate
(
todayStr
);
userSignin
.
setCreateTime
(
new
Date
());
userSignin
.
setCreateTime
(
new
Date
());
userSignin
.
setUpdateTime
(
new
Date
());
userSignin
.
setUpdateTime
(
new
Date
());
userSignin
.
setConsecutiveDays
(
1
);
userSignin
.
setConsecutiveDays
(
1
);
...
@@ -57,9 +61,9 @@ public class UserSigninServiceImpl implements UserSigninService {
...
@@ -57,9 +61,9 @@ public class UserSigninServiceImpl implements UserSigninService {
userSignin
.
setRewardLevel
(
SigninEnum
.
LevelEnum
.
ZERO
.
getCode
());
userSignin
.
setRewardLevel
(
SigninEnum
.
LevelEnum
.
ZERO
.
getCode
());
userSigninDao
.
insert
(
userSignin
);
userSigninDao
.
insert
(
userSignin
);
}
else
{
}
else
{
UserSign
in
userSignin
=
new
UserSigni
n
();
UserSign
In
userSignin
=
new
UserSignI
n
();
userSignin
.
setUserId
(
userId
);
userSignin
.
setUserId
(
userId
);
userSignin
.
setSign
i
nDate
(
todayStr
);
userSignin
.
setSign
I
nDate
(
todayStr
);
userSignin
.
setCreateTime
(
new
Date
());
userSignin
.
setCreateTime
(
new
Date
());
userSignin
.
setUpdateTime
(
new
Date
());
userSignin
.
setUpdateTime
(
new
Date
());
//连续签到天数
//连续签到天数
...
@@ -92,17 +96,17 @@ public class UserSigninServiceImpl implements UserSigninService {
...
@@ -92,17 +96,17 @@ public class UserSigninServiceImpl implements UserSigninService {
@Transactional
@Transactional
@Override
@Override
public
Result
getReward
(
UserSign
i
nRequestDto
dto
)
{
public
Result
getReward
(
UserSign
I
nRequestDto
dto
)
{
try
{
try
{
//查询签到记录
//查询签到记录
UserSign
in
userSignin
=
userSigninDao
.
findRecord
(
dto
.
getUserId
(),
dto
.
getSigni
nDate
());
UserSign
In
userSignin
=
userSigninDao
.
findRecord
(
dto
.
getUserId
(),
dto
.
getSignI
nDate
());
if
(!
userSignin
.
getIsReward
())
{
if
(!
userSignin
.
getIsReward
())
{
return
Result
.
failed
(
"尚未完成连续签到的天数"
);
return
Result
.
failed
(
"尚未完成连续签到的天数"
);
}
}
if
(
userSignin
.
getIsGet
())
{
if
(
userSignin
.
getIsGet
())
{
return
Result
.
failed
(
"该奖励已领取"
);
return
Result
.
failed
(
"该奖励已领取"
);
}
}
UserSign
in
updateDto
=
new
UserSigni
n
();
UserSign
In
updateDto
=
new
UserSignI
n
();
updateDto
.
setId
(
userSignin
.
getId
());
updateDto
.
setId
(
userSignin
.
getId
());
updateDto
.
setIsGet
(
true
);
updateDto
.
setIsGet
(
true
);
updateDto
.
setUpdateTime
(
new
Date
());
updateDto
.
setUpdateTime
(
new
Date
());
...
@@ -137,20 +141,45 @@ public class UserSigninServiceImpl implements UserSigninService {
...
@@ -137,20 +141,45 @@ public class UserSigninServiceImpl implements UserSigninService {
@Override
@Override
public
Result
findList
(
UserSign
i
nRequestDto
dto
)
{
public
Result
findList
(
UserSign
I
nRequestDto
dto
)
{
try
{
try
{
//当前是几号
LocalDate
today
=
LocalDate
.
now
();
DateTimeFormatter
formatter
=
DateTimeFormatter
.
ofPattern
(
"yyyyMMdd"
);
String
formattedDate
=
today
.
format
(
formatter
);
//格式如20241101的日期,int类型用户比较
int
currentDay
=
Integer
.
parseInt
(
formattedDate
);
//当前的年和月
int
year
=
today
.
getYear
();
int
month
=
today
.
getMonthValue
();
if
(
StringUtils
.
isEmpty
(
dto
.
getYear
())
||
StringUtils
.
isEmpty
(
dto
.
getMonth
()))
{
dto
.
setYearMonth
(
year
+
"-"
+
month
);
}
else
{
dto
.
setYearMonth
(
dto
.
getYear
()
+
"-"
+
dto
.
getMonth
());
}
//该月份所有的日期
//该月份所有的日期
List
<
String
>
dateList
=
DateTimeUtil
.
getMonthDates
(
dto
.
getYearMonth
());
List
<
String
>
dateList
=
DateTimeUtil
.
getMonthDates
(
dto
.
getYearMonth
());
Date
startTime
=
DateTimeUtil
.
getDateWithMinTime
(
dateList
.
get
(
0
));
Date
startTime
=
DateTimeUtil
.
getDateWithMinTime
(
dateList
.
get
(
0
));
Date
endTime
=
DateTimeUtil
.
getDateWithMaxTime
(
dateList
.
get
((
dateList
.
size
()
-
1
)));
Date
endTime
=
DateTimeUtil
.
getDateWithMaxTime
(
dateList
.
get
((
dateList
.
size
()
-
1
)));
dto
.
setStartQueryTime
(
startTime
);
dto
.
setStartQueryTime
(
startTime
);
dto
.
setEndQueryTime
(
endTime
);
dto
.
setEndQueryTime
(
endTime
);
List
<
UserSignin
>
userSigninList
=
userSigninDao
.
findList
(
dto
);
List
<
UserSignIn
>
userSignInList
=
userSigninDao
.
findList
(
dto
);
/* for (String dateStr : dateList) {
List
<
String
>
signDateList
=
userSignInList
.
stream
().
map
(
UserSignIn:
:
getSignInDate
).
collect
(
Collectors
.
toList
());
if () {
for
(
String
dateStr
:
dateList
)
{
SignDateRecord
signDateRecord
=
new
SignDateRecord
();
int
day
=
Integer
.
parseInt
(
dateStr
.
replace
(
"-"
,
""
));
if
(
day
<
currentDay
)
{
signDateRecord
.
setDateState
(
SigninEnum
.
DateStateEnum
.
PASS
.
getCode
());
}
else
if
(
day
==
currentDay
)
{
signDateRecord
.
setDateState
(
SigninEnum
.
DateStateEnum
.
CURRENT
.
getCode
());
}
else
{
signDateRecord
.
setDateState
(
SigninEnum
.
DateStateEnum
.
FUTURE
.
getCode
());
}
//签到记录里包含该日期则表示已签到
if
(
signDateList
.
contains
(
dateStr
))
{
signDateRecord
.
setIsSignIn
(
true
);
}
}
}
*/
}
return
Result
.
success
();
return
Result
.
success
();
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
...
@@ -159,6 +188,18 @@ public class UserSigninServiceImpl implements UserSigninService {
...
@@ -159,6 +188,18 @@ public class UserSigninServiceImpl implements UserSigninService {
return
Result
.
failed
();
return
Result
.
failed
();
}
}
@Override
public
Result
getShareInfo
(
UserSignInRequestDto
dto
)
{
try
{
}
catch
(
Exception
e
)
{
logger
.
error
(
"获取分享信息失败 error : {}"
,
e
);
}
return
Result
.
failed
();
}
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
List
<
String
>
dateList
=
DateTimeUtil
.
getMonthDates
(
"2024-11"
);
List
<
String
>
dateList
=
DateTimeUtil
.
getMonthDates
(
"2024-11"
);
Date
startTime
=
DateTimeUtil
.
getDateWithMinTime
(
dateList
.
get
(
0
));
Date
startTime
=
DateTimeUtil
.
getDateWithMinTime
(
dateList
.
get
(
0
));
...
...
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/distribution/SupplierItemServiceImpl.java
View file @
f35e3c30
package
com.wwdz.ch.wx.impl.distribution
;
package
com.wwdz.ch.wx.impl.distribution
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.date.DateUtil
;
import
com.alibaba.dubbo.config.annotation.Reference
;
import
com.alibaba.dubbo.config.annotation.Reference
;
import
com.github.pagehelper.PageInfo
;
import
com.github.pagehelper.PageInfo
;
...
@@ -22,7 +21,6 @@ import com.wwdz.ch.core.entity.SupplierItemVo;
...
@@ -22,7 +21,6 @@ import com.wwdz.ch.core.entity.SupplierItemVo;
import
com.wwdz.ch.wx.aspect.AddBrowseLog
;
import
com.wwdz.ch.wx.aspect.AddBrowseLog
;
import
com.wwdz.ch.wx.constant.CollectionBookConstants
;
import
com.wwdz.ch.wx.constant.CollectionBookConstants
;
import
com.wwdz.ch.wx.entity.GroupPurchaseInfo
;
import
com.wwdz.ch.wx.entity.GroupPurchaseInfo
;
import
com.wwdz.ch.wx.entity.request.ItemTagOperateRequestDto
;
import
com.wwdz.ch.wx.entity.vo.distribution.AuctionDetailVo
;
import
com.wwdz.ch.wx.entity.vo.distribution.AuctionDetailVo
;
import
com.wwdz.ch.wx.entity.vo.distribution.AuctionRecordRowVo
;
import
com.wwdz.ch.wx.entity.vo.distribution.AuctionRecordRowVo
;
import
com.wwdz.ch.wx.service.FollowFansRecordService
;
import
com.wwdz.ch.wx.service.FollowFansRecordService
;
...
@@ -30,9 +28,6 @@ import com.wwdz.ch.wx.service.distribution.CollectionItemsRelationService;
...
@@ -30,9 +28,6 @@ import com.wwdz.ch.wx.service.distribution.CollectionItemsRelationService;
import
com.wwdz.ch.wx.service.distribution.DistributionOrderService
;
import
com.wwdz.ch.wx.service.distribution.DistributionOrderService
;
import
com.wwdz.ch.wx.service.distribution.GroupPurchaseService
;
import
com.wwdz.ch.wx.service.distribution.GroupPurchaseService
;
import
com.wwdz.ch.wx.service.distribution.SupplierItemService
;
import
com.wwdz.ch.wx.service.distribution.SupplierItemService
;
import
com.wwdz.mall.common.vo.response.CloudServerResponse
;
import
com.wwdz.shop.api.DTO.ShopDTO
;
import
com.wwdz.shop.api.query.ShopQueryOption
;
import
com.wwdz.shop.api.service.ShopReadService
;
import
com.wwdz.shop.api.service.ShopReadService
;
import
com.xxdxxs.utils.*
;
import
com.xxdxxs.utils.*
;
import
org.redisson.api.RLock
;
import
org.redisson.api.RLock
;
...
...
ch-wx-api/src/main/java/com/wwdz/ch/wx/service/UserSigninService.java
View file @
f35e3c30
package
com.wwdz.ch.wx.service
;
package
com.wwdz.ch.wx.service
;
import
com.wwdz.ch.core.type.Result
;
import
com.wwdz.ch.core.type.Result
;
import
com.wwdz.ch.db.dto.request.UserSign
i
nRequestDto
;
import
com.wwdz.ch.db.dto.request.UserSign
I
nRequestDto
;
public
interface
UserSigninService
{
public
interface
UserSigninService
{
...
@@ -10,20 +10,26 @@ public interface UserSigninService {
...
@@ -10,20 +10,26 @@ public interface UserSigninService {
* @param dto
* @param dto
* @return
* @return
*/
*/
Result
signin
(
UserSign
i
nRequestDto
dto
);
Result
signin
(
UserSign
I
nRequestDto
dto
);
/**
/**
* 领取奖励
* 领取奖励
* @param dto
* @param dto
* @return
* @return
*/
*/
Result
getReward
(
UserSigninRequestDto
dto
);
Result
getReward
(
UserSignInRequestDto
dto
);
/**
/**
* 查询签到记录
* 查询签到记录
* @param dto
* @param dto
* @return
* @return
*/
*/
Result
findList
(
UserSigninRequestDto
dto
);
Result
findList
(
UserSignInRequestDto
dto
);
/**
* 获取分享信息
* @param dto
* @return
*/
Result
getShareInfo
(
UserSignInRequestDto
dto
);
}
}
ch-wx-api/src/main/java/com/wwdz/ch/wx/web/UserSigninController.java
View file @
f35e3c30
...
@@ -3,7 +3,7 @@ package com.wwdz.ch.wx.web;
...
@@ -3,7 +3,7 @@ package com.wwdz.ch.wx.web;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.wwdz.ch.core.consts.ResultCode
;
import
com.wwdz.ch.core.consts.ResultCode
;
import
com.wwdz.ch.core.type.Result
;
import
com.wwdz.ch.core.type.Result
;
import
com.wwdz.ch.db.dto.request.UserSign
i
nRequestDto
;
import
com.wwdz.ch.db.dto.request.UserSign
I
nRequestDto
;
import
com.wwdz.ch.wx.service.UserSigninService
;
import
com.wwdz.ch.wx.service.UserSigninService
;
import
com.xxdxxs.service.FormHandler
;
import
com.xxdxxs.service.FormHandler
;
import
com.xxdxxs.validation.Validator
;
import
com.xxdxxs.validation.Validator
;
...
@@ -27,7 +27,7 @@ public class UserSigninController {
...
@@ -27,7 +27,7 @@ public class UserSigninController {
@ApiOperation
(
value
=
"用户签到"
)
@ApiOperation
(
value
=
"用户签到"
)
@PostMapping
(
"/checkAbleToOpenShop"
)
@PostMapping
(
"/checkAbleToOpenShop"
)
public
Result
checkAbleToOpenShop
(
@RequestBody
UserSign
i
nRequestDto
dto
)
{
public
Result
checkAbleToOpenShop
(
@RequestBody
UserSign
I
nRequestDto
dto
)
{
logger
.
info
(
"【请求开始】用户签到,请求参数:{}"
,
JSON
.
toJSONString
(
dto
));
logger
.
info
(
"【请求开始】用户签到,请求参数:{}"
,
JSON
.
toJSONString
(
dto
));
Validator
validator
=
new
Validator
(
FormHandler
.
ofEntity
(
dto
));
Validator
validator
=
new
Validator
(
FormHandler
.
ofEntity
(
dto
));
validator
.
set
(
"userId"
,
"用户id"
).
must
().
number
()
validator
.
set
(
"userId"
,
"用户id"
).
must
().
number
()
...
@@ -41,7 +41,7 @@ public class UserSigninController {
...
@@ -41,7 +41,7 @@ public class UserSigninController {
@ApiOperation
(
value
=
"领取奖励"
)
@ApiOperation
(
value
=
"领取奖励"
)
@PostMapping
(
"/getReward"
)
@PostMapping
(
"/getReward"
)
public
Result
getReward
(
@RequestBody
UserSign
i
nRequestDto
dto
)
{
public
Result
getReward
(
@RequestBody
UserSign
I
nRequestDto
dto
)
{
logger
.
info
(
"【请求开始】领取奖励,请求参数:{}"
,
JSON
.
toJSONString
(
dto
));
logger
.
info
(
"【请求开始】领取奖励,请求参数:{}"
,
JSON
.
toJSONString
(
dto
));
Validator
validator
=
new
Validator
(
FormHandler
.
ofEntity
(
dto
));
Validator
validator
=
new
Validator
(
FormHandler
.
ofEntity
(
dto
));
validator
.
set
(
"userId"
,
"用户id"
).
must
().
number
()
validator
.
set
(
"userId"
,
"用户id"
).
must
().
number
()
...
@@ -57,7 +57,7 @@ public class UserSigninController {
...
@@ -57,7 +57,7 @@ public class UserSigninController {
@ApiOperation
(
value
=
"查询签到记录"
)
@ApiOperation
(
value
=
"查询签到记录"
)
@PostMapping
(
"/findList"
)
@PostMapping
(
"/findList"
)
public
Result
findList
(
@RequestBody
UserSign
i
nRequestDto
dto
)
{
public
Result
findList
(
@RequestBody
UserSign
I
nRequestDto
dto
)
{
logger
.
info
(
"【请求开始】查询签到记录,请求参数:{}"
,
JSON
.
toJSONString
(
dto
));
logger
.
info
(
"【请求开始】查询签到记录,请求参数:{}"
,
JSON
.
toJSONString
(
dto
));
Validator
validator
=
new
Validator
(
FormHandler
.
ofEntity
(
dto
));
Validator
validator
=
new
Validator
(
FormHandler
.
ofEntity
(
dto
));
validator
.
set
(
"userId"
,
"用户id"
).
must
().
number
()
validator
.
set
(
"userId"
,
"用户id"
).
must
().
number
()
...
...
ch-wx-api/src/test/java/com/wwdz/ch/wx/api/WxPayServiceTest.java
View file @
f35e3c30
...
@@ -89,12 +89,12 @@ public class WxPayServiceTest {
...
@@ -89,12 +89,12 @@ public class WxPayServiceTest {
@Test
@Test
public
void
refund
()
{
public
void
refund
()
{
List
<
String
>
list
=
Arrays
.
asList
(
"DA2411
061130292824378"
,
"DA2411050940309904308"
,
"DA2411040955234251934
"
);
List
<
String
>
list
=
Arrays
.
asList
(
"DA2411
192041343155076
"
);
list
.
forEach
(
orderId
->{
list
.
forEach
(
orderId
->{
DistributionOrderRequestDto
dto
=
new
DistributionOrderRequestDto
();
DistributionOrderRequestDto
dto
=
new
DistributionOrderRequestDto
();
dto
.
setDistributionOrderId
(
orderId
);
dto
.
setDistributionOrderId
(
orderId
);
dto
.
setAmount
(
"
1
"
);
dto
.
setAmount
(
"
24.9
"
);
dto
.
setRefundPrice
(
"
1
"
);
dto
.
setRefundPrice
(
"
24.9
"
);
Result
result
=
wxPayServiceApi
.
refund
(
dto
);
Result
result
=
wxPayServiceApi
.
refund
(
dto
);
logger
.
info
(
"申请微信支付退款:{}"
,
result
);
logger
.
info
(
"申请微信支付退款:{}"
,
result
);
});
});
...
...
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