Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
V
volunteer_service
Project
Project
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
licc
volunteer_service
Commits
07129a4a
Commit
07129a4a
authored
May 13, 2021
by
cy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
充值卡重复提示
parent
2db4c24f
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
88 additions
and
35 deletions
+88
-35
CardMapper.java
...-mapper/src/main/java/cn/wisenergy/mapper/CardMapper.java
+6
-0
BannerMapper.xml
wisenergy-mapper/src/main/resources/mapper/BannerMapper.xml
+1
-0
CardMapper.xml
wisenergy-mapper/src/main/resources/mapper/CardMapper.xml
+10
-0
RefillCardMapper.xml
...rgy-mapper/src/main/resources/mapper/RefillCardMapper.xml
+37
-12
ScoreInfoMapper.xml
...ergy-mapper/src/main/resources/mapper/ScoreInfoMapper.xml
+8
-4
RefillCardServiceImpl.java
.../cn/wisenergy/service/app/impl/RefillCardServiceImpl.java
+18
-5
Common.java
...ice/src/main/java/cn/wisenergy/service/common/Common.java
+6
-6
RefillCardManager.java
...n/java/cn/wisenergy/service/common/RefillCardManager.java
+0
-1
WxCommon.java
...ce/src/main/java/cn/wisenergy/service/wxpay/WxCommon.java
+2
-2
RefillCardController.java
...energy/web/admin/controller/app/RefillCardController.java
+0
-5
No files found.
wisenergy-mapper/src/main/java/cn/wisenergy/mapper/CardMapper.java
View file @
07129a4a
...
...
@@ -48,6 +48,12 @@ public interface CardMapper extends BaseMapper<CardInfo> {
*/
List
<
CardInfo
>
getListByCardNo
(
@Param
(
"cardNo"
)
String
cardNo
);
/**
* 获取所以卡片信息
* @return CardInfo
*/
List
<
String
>
getAllCarInfo
();
}
wisenergy-mapper/src/main/resources/mapper/BannerMapper.xml
View file @
07129a4a
...
...
@@ -89,6 +89,7 @@
<where>
<if
test=
"status != null"
>
and status =#{status}
</if>
<if
test=
"type != null"
>
and type =#{type}
</if>
<if
test=
"title != null and title != ''"
>
and title like #{title}
</if>
</where>
order by create_time desc
limit #{pageNo},#{pageSize}
...
...
wisenergy-mapper/src/main/resources/mapper/CardMapper.xml
View file @
07129a4a
...
...
@@ -116,4 +116,14 @@
</where>
</select>
<select
id=
"getAllCarInfo"
resultType=
"java.lang.String"
>
select
card_number
from
<include
refid=
"table"
/>
<where>
is_delete=0
</where>
</select>
</mapper>
wisenergy-mapper/src/main/resources/mapper/RefillCardMapper.xml
View file @
07129a4a
...
...
@@ -44,9 +44,9 @@
<sql
id=
"criteria"
>
<if
test=
"userName != null"
>
and card_number = #{cardNumber}
</if>
<if
test=
"password != null"
>
and batch_number =#{batchNumber}
</if>
<if
test=
"password != null"
>
and batch_number =#{batchNumber}
</if>
<if
test=
"phone != null"
>
and is_make_card =#{isMakeCard}
</if>
<if
test=
"headImage != null"
>
and is_activite =#{isMakeCard}
</if>
<if
test=
"headImage != null"
>
and is_activite =#{isMakeCard}
</if>
<if
test=
"examType != null"
>
and is_delete = #{isDelete}
</if>
<if
test=
"createTime != null"
>
and create_time
>
= #{createTime}
</if>
<if
test=
"updateTime != null"
>
and #{updateTime}
>
= update_time
</if>
...
...
@@ -73,24 +73,41 @@
</where>
</update>
<select
id=
"getList"
resultMap=
"refillCardMap"
parameterType=
"
map
"
>
<select
id=
"getList"
resultMap=
"refillCardMap"
parameterType=
"
cn.wisenergy.model.vo.RefillCardVo
"
>
select
<include
refid=
"cols_all"
/>
from
<include
refid=
"table"
/>
<where>
is_delete=0
<if
test=
"startTime != null"
>
and create_time
between #{startTime}
</if>
<if
test=
"endTime != null "
>
and #{endTime}
</if>
order by create_time desc
limit #{pageNo},#{pageSize}
</where>
</select>
<select
id=
"getUserNumbers"
resultType=
"java.lang.Integer"
>
<select
id=
"getUserNumbers"
resultType=
"java.lang.Integer"
parameterType=
"cn.wisenergy.model.vo.RefillCardVo"
>
SELECT COUNT(id)
FROM
<include
refid=
"table"
/>
where is_delete=0
<where>
is_delete=0
<if
test=
"startTime != null"
>
and create_time
between #{startTime}
</if>
<if
test=
"endTime != null "
>
and #{endTime}
</if>
</where>
</select>
<select
id=
"getById"
resultMap=
"refillCardMap"
>
...
...
@@ -109,6 +126,14 @@
where batch_number=#{batchNumber}
</select>
<select
id=
"getByCardNo"
resultMap=
"refillCardMap"
parameterType=
"string"
>
select
<include
refid=
"cols_all"
/>
from
<include
refid=
"table"
/>
where card_no=#{cardNo}
</select>
<update
id=
"setIsMakeCard"
>
UPDATE
<include
refid=
"table"
/>
...
...
wisenergy-mapper/src/main/resources/mapper/ScoreInfoMapper.xml
View file @
07129a4a
...
...
@@ -18,6 +18,7 @@
<result
column=
"politics_grade"
property=
"politicsGrade"
/>
<result
column=
"create_time"
property=
"createTime"
/>
<result
column=
"update_time"
property=
"updateTime"
/>
<result
column=
"ranking"
property=
"ranking"
/>
</resultMap>
<sql
id=
"table"
>
...
...
@@ -31,12 +32,12 @@
<sql
id=
"cols_exclude_id"
>
user_id,culture_grade, major_grade,language_grade,math_grade,english_grade, physics_grade,chemistry_grade,
biology_grade,history_grade,geography_grade,politics_grade, create_time,update_time
biology_grade,history_grade,geography_grade,politics_grade, create_time,update_time
,ranking
</sql>
<sql
id=
"vals"
>
#{userId},#{cultureGrade},#{majorGrade},#{languageGrade},#{mathGrade},#{englishGrade},#{physicsGrade},
#{chemistryGrade},#{biologyGrade}, #{historyGrade},#{geographyGrade},#{politicsGrade},now(),now()
#{chemistryGrade},#{biologyGrade}, #{historyGrade},#{geographyGrade},#{politicsGrade},now(),now()
,#{ranking}
</sql>
<sql
id=
"updateCondition"
>
...
...
@@ -52,7 +53,8 @@
<if
test=
"historyGrade != null"
>
history_grade = #{historyGrade},
</if>
<if
test=
"geographyGrade != null"
>
geography_grade = #{geographyGrade},
</if>
<if
test=
"politicsGrade != null"
>
politics_grade = #{politicsGrade},
</if>
update_time =now()
update_time =now(),
<if
test=
"ranking != null"
>
ranking = #{ranking}
</if>
</sql>
<sql
id=
"updateCondition2"
>
...
...
@@ -68,7 +70,8 @@
history_grade = #{historyGrade},
geography_grade = #{geographyGrade},
politics_grade = #{politicsGrade},
update_time =now()
update_time =now(),
ranking = #{ranking}
</sql>
<sql
id=
"criteria"
>
...
...
@@ -87,6 +90,7 @@
<if
test=
"politicsGrade != null"
>
and politics_grade = #{politicsGrade}
</if>
<if
test=
"createTime != null"
>
and create_time
>
= #{createTime}
</if>
<if
test=
"updateTime != null"
>
and #{updateTime}
>
= update_time
</if>
<if
test=
"ranking != null"
>
and #{ranking}
>
= ranking
</if>
</sql>
<insert
id=
"add"
parameterType=
"cn.wisenergy.model.app.ScoreInfo"
keyProperty=
"id"
useGeneratedKeys=
"true"
>
...
...
wisenergy-service/src/main/java/cn/wisenergy/service/app/impl/RefillCardServiceImpl.java
View file @
07129a4a
...
...
@@ -53,6 +53,18 @@ public class RefillCardServiceImpl implements RefillCardService {
if
(
byCardNo
.
size
()
>
0
)
{
return
R
.
error
(
"该初始卡号已经存在,请重新添加"
);
}
List
<
String
>
allCarInfo
=
cardMapper
.
getAllCarInfo
();
BigInteger
finalCardNumber
=
refillCard
.
getCardNo
();
BigInteger
num
=
new
BigInteger
(
"1"
);
for
(
int
i
=
0
;
i
<
refillCard
.
getCardNumber
()
-
1
;
i
++)
{
finalCardNumber
=
finalCardNumber
.
add
(
num
);
BigInteger
finalCardNumber1
=
finalCardNumber
;
boolean
present
=
allCarInfo
.
stream
().
filter
(
m
->
m
.
equals
(
finalCardNumber1
.
toString
())).
findAny
().
isPresent
();
if
(
present
)
{
return
R
.
error
(
"该数量区间内存在相同卡号,请重新添加"
);
}
}
//设置初始状态
String
time
=
DateUtil
.
getTime
(
new
Date
(),
"yyyy.MM.dd.HH.mm.sss"
);
refillCard
.
setBatchNumber
(
time
);
...
...
@@ -112,13 +124,13 @@ public class RefillCardServiceImpl implements RefillCardService {
List
<
CardInfo
>
listByCardNo
=
cardMapper
.
getList
(
card
.
getBatchNumber
());
listByCardNo
.
sort
(
Comparator
.
comparing
(
CardInfo:
:
getCardNumber
));
if
(
listByCardNo
.
size
()
>
1
)
{
CardInfo
minCard
=
listByCardNo
.
get
(
0
);
CardInfo
maxCard
=
listByCardNo
.
get
(
listByCardNo
.
size
()
-
1
);
CardInfo
minCard
=
listByCardNo
.
get
(
0
);
CardInfo
maxCard
=
listByCardNo
.
get
(
listByCardNo
.
size
()
-
1
);
card
.
setCardNoInfo
(
minCard
.
getCardNumber
()
+
"~"
+
maxCard
.
getCardNumber
());
}
else
if
(
listByCardNo
.
size
()==
1
)
{
CardInfo
minCard
=
listByCardNo
.
get
(
0
);
}
else
if
(
listByCardNo
.
size
()
==
1
)
{
CardInfo
minCard
=
listByCardNo
.
get
(
0
);
card
.
setCardNoInfo
(
minCard
.
getCardNumber
());
}
else
{
}
else
{
BigInteger
bigInteger
=
BigInteger
.
valueOf
(
card
.
getCardNumber
()
-
1
);
BigInteger
cardNo
=
card
.
getCardNo
();
if
(
card
.
getCardNumber
()
-
1
==
0
)
{
...
...
@@ -145,6 +157,7 @@ public class RefillCardServiceImpl implements RefillCardService {
return
R
.
error
(
"该充值卡不存在"
);
}
BigInteger
cardNumber
=
new
BigInteger
(
byId
.
getCardNo
()
+
""
);
/* String cardNo=byId.getCardNo()+"";
cardNo=cardNo.substring(0,6)+"%";
List<CardInfo> card = cardMapper.getListByCardNo(cardNo);
...
...
wisenergy-service/src/main/java/cn/wisenergy/service/common/Common.java
View file @
07129a4a
...
...
@@ -39,24 +39,24 @@ public class Common {
* 支付宝--回调地址
*/
//测试
//
public static final String NOTIFY_URL = "http://111.203.232.171:8997/pay/aliPayCallBack.do";
public
static
final
String
NOTIFY_URL
=
"http://111.203.232.171:8997/pay/aliPayCallBack.do"
;
//线上
public
static
final
String
NOTIFY_URL
=
"https://jygkzy.com/api/pay/aliPayCallBack.do"
;
//
public static final String NOTIFY_URL = "https://jygkzy.com/api/pay/aliPayCallBack.do";
/***
* 支付宝--pc端支付成功跳转地址
*/
//测试
//
public static final String RETURN_URL_PC = "http://111.203.232.171:8999/#/wallet";
public
static
final
String
RETURN_URL_PC
=
"http://111.203.232.171:8999/#/wallet"
;
//线上
public
static
final
String
RETURN_URL_PC
=
"https://jygkzy.com/#/wallet"
;
//
public static final String RETURN_URL_PC = "https://jygkzy.com/#/wallet";
/***
* 支付宝--手机网页支付成功跳转地址
*/
//测试
//
public static final String RETURN_URL_WAP = "http://111.203.232.171:8999/#/history";
public
static
final
String
RETURN_URL_WAP
=
"http://111.203.232.171:8999/#/history"
;
//线上
public
static
final
String
RETURN_URL_WAP
=
"https://jygkzy.com/#/history"
;
//
public static final String RETURN_URL_WAP = "https://jygkzy.com/#/history";
/**
...
...
wisenergy-service/src/main/java/cn/wisenergy/service/common/RefillCardManager.java
View file @
07129a4a
...
...
@@ -47,7 +47,6 @@ public class RefillCardManager {
cardInfo
.
setSecretKey
(
SecretkeyUtil
.
getSecretkey
());
cardInfo
.
setCardNumber
(
String
.
valueOf
(
cardNumber
));
cardInfos
.
add
(
cardInfo
);
for
(
int
i
=
0
;
i
<
byId
.
getCardNumber
()
-
1
;
i
++)
{
CardInfo
card
=
new
CardInfo
();
cardNumber
=
cardNumber
.
add
(
num
);
...
...
wisenergy-service/src/main/java/cn/wisenergy/service/wxpay/WxCommon.java
View file @
07129a4a
...
...
@@ -9,9 +9,9 @@ package cn.wisenergy.service.wxpay;
public
class
WxCommon
{
//测试
//
public static final String NOTIFY_URL = "http://111.203.232.171:8997/pay/wxPayCallBack.do";
public
static
final
String
NOTIFY_URL
=
"http://111.203.232.171:8997/pay/wxPayCallBack.do"
;
//线上
public
static
final
String
NOTIFY_URL
=
"https://jygkzy.com/api/pay/wxPayCallBack.do"
;
//
public static final String NOTIFY_URL = "https://jygkzy.com/api/pay/wxPayCallBack.do";
...
...
wisenergy-web-admin/src/main/java/cn/wisenergy/web/admin/controller/app/RefillCardController.java
View file @
07129a4a
...
...
@@ -77,9 +77,4 @@ public class RefillCardController {
return
refillCardService
.
createExcel
(
batchNumber
,
response
);
}
public
static
void
main
(
String
[]
args
)
{
int
num
=
123
;
DecimalFormat
df
=
new
DecimalFormat
(
"0000000000"
);
System
.
out
.
println
(
df
.
format
(
num
));
}
}
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