Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
A
Aidea
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
sa_aidea
Aidea
Commits
21b4e363
Commit
21b4e363
authored
Feb 18, 2021
by
fanjr
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pda接口修改
parent
972331cd
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
71 additions
and
1 deletion
+71
-1
PdaCouponrecordServiceImpl.java
...couponrecord/service/impl/PdaCouponrecordServiceImpl.java
+12
-0
Md5Utils.java
.../src/main/java/com/cftech/couponrecord/util/Md5Utils.java
+58
-0
PdaCouponrecordController.java
...om/cftech/couponrecord/web/PdaCouponrecordController.java
+1
-1
No files found.
aidea-modules/couponrecord-module/src/main/java/com/cftech/couponrecord/service/impl/PdaCouponrecordServiceImpl.java
View file @
21b4e363
...
...
@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject;
import
com.cftech.couponrecord.dao.CouponrecordMapper
;
import
com.cftech.couponrecord.model.Couponrecord
;
import
com.cftech.couponrecord.service.PdaCouponrecordService
;
import
com.cftech.couponrecord.util.Md5Utils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.stereotype.Service
;
...
...
@@ -28,6 +29,17 @@ public class PdaCouponrecordServiceImpl implements PdaCouponrecordService {
couponrecordMapper
.
insertPdaLog
(
map
);
String
facilityNo
=
obj
.
get
(
"facilityNo"
)+
""
;
String
number
=
obj
.
get
(
"number"
)+
""
;
String
token
=
obj
.
get
(
"token"
)+
""
;
if
(!
token
.
equals
(
"268710d79f63bcdebdf3f745f84d146f"
)){
rtnJson
.
put
(
"code"
,
500
);
rtnJson
.
put
(
"msg"
,
"接口调用失败!"
);
map
=
new
HashMap
<
String
,
Object
>();
map
.
put
(
"id"
,
logId
);
map
.
put
(
"resultJson"
,
rtnJson
.
toString
());
map
.
put
(
"status"
,
1
);
couponrecordMapper
.
updatePdaLog
(
map
);
return
rtnJson
;
}
try
{
//是否已核销
Couponrecord
info
=
couponrecordMapper
.
isWriteOff
(
number
);
...
...
aidea-modules/couponrecord-module/src/main/java/com/cftech/couponrecord/util/Md5Utils.java
0 → 100644
View file @
21b4e363
package
com
.
cftech
.
couponrecord
.
util
;
import
java.security.MessageDigest
;
/**
* Created by 16444 on 2020/11/30.
*/
public
class
Md5Utils
{
private
final
static
String
[]
hexDigits
=
{
"0"
,
"1"
,
"2"
,
"3"
,
"4"
,
"5"
,
"6"
,
"7"
,
"8"
,
"9"
,
"a"
,
"b"
,
"c"
,
"d"
,
"e"
,
"f"
};
/**
* 转换字节数组为16进制字串
* @param b 字节数组
* @return 16进制字串
*/
public
static
String
byteArrayToHexString
(
byte
[]
b
)
{
StringBuilder
resultSb
=
new
StringBuilder
();
for
(
byte
aB
:
b
)
{
resultSb
.
append
(
byteToHexString
(
aB
));
}
return
resultSb
.
toString
();
}
/**
* 转换byte到16进制
* @param b 要转换的byte
* @return 16进制格式
*/
private
static
String
byteToHexString
(
byte
b
)
{
int
n
=
b
;
if
(
n
<
0
)
{
n
=
256
+
n
;
}
int
d1
=
n
/
16
;
int
d2
=
n
%
16
;
return
hexDigits
[
d1
]
+
hexDigits
[
d2
];
}
/**
* MD5编码
* @param origin 原始字符串
* @return 经过MD5加密之后的结果
*/
public
static
String
MD5Encode
(
String
origin
)
{
String
resultString
=
null
;
try
{
resultString
=
origin
;
MessageDigest
md
=
MessageDigest
.
getInstance
(
"MD5"
);
md
.
update
(
resultString
.
getBytes
(
"UTF-8"
));
resultString
=
byteArrayToHexString
(
md
.
digest
());
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
return
resultString
;
}
}
aidea-modules/couponrecord-module/src/main/java/com/cftech/couponrecord/web/PdaCouponrecordController.java
View file @
21b4e363
...
...
@@ -20,7 +20,7 @@ import java.util.Map;
* Fanjr
*/
@RestController
@RequestMapping
(
"/
pda/writeOff
/coupon"
)
@RequestMapping
(
"/
mobile/pda
/coupon"
)
public
class
PdaCouponrecordController
{
@Autowired
...
...
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