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
e29ba84c
Commit
e29ba84c
authored
Feb 08, 2021
by
fanjr
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pda接口
parent
211f8b6f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
104 additions
and
27 deletions
+104
-27
CouponrecordService.java
.../com/cftech/couponrecord/service/CouponrecordService.java
+1
-8
PdaCouponrecordService.java
...m/cftech/couponrecord/service/PdaCouponrecordService.java
+15
-0
CouponrecordServiceImpl.java
...ch/couponrecord/service/impl/CouponrecordServiceImpl.java
+1
-18
PdaCouponrecordServiceImpl.java
...couponrecord/service/impl/PdaCouponrecordServiceImpl.java
+87
-1
No files found.
aidea-modules/couponrecord-module/src/main/java/com/cftech/couponrecord/service/CouponrecordService.java
View file @
e29ba84c
...
@@ -35,14 +35,7 @@ public interface CouponrecordService extends GenericService<Couponrecord> {
...
@@ -35,14 +35,7 @@ public interface CouponrecordService extends GenericService<Couponrecord> {
**/
**/
public
JSONObject
checkCouponDetails
(
CouponrecordVo
vo
);
public
JSONObject
checkCouponDetails
(
CouponrecordVo
vo
);
/**
* @Author Fanjr
* @Description 检测详情
* @Date 2021年1月29日
* @Param
* @return
**/
JSONObject
checkCouponById
(
CouponrecordVo
vo
);
/** 发放检测券
/** 发放检测券
* @param couponId
* @param couponId
...
...
aidea-modules/couponrecord-module/src/main/java/com/cftech/couponrecord/service/PdaCouponrecordService.java
View file @
e29ba84c
package
com
.
cftech
.
couponrecord
.
service
;
package
com
.
cftech
.
couponrecord
.
service
;
import
com.alibaba.fastjson.JSONObject
;
import
com.cftech.couponrecord.model.CouponrecordVo
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
java.util.Map
;
public
interface
PdaCouponrecordService
{
public
interface
PdaCouponrecordService
{
/**
* @Author Fanjr
* @Description 检测券列表
* @Date 2021年1月29日
* @Param
* @return
**/
public
JSONObject
writeOff
(
JSONObject
obj
);
}
}
aidea-modules/couponrecord-module/src/main/java/com/cftech/couponrecord/service/impl/CouponrecordServiceImpl.java
View file @
e29ba84c
...
@@ -244,24 +244,7 @@ public class CouponrecordServiceImpl extends GenericServiceImpl<Couponrecord> im
...
@@ -244,24 +244,7 @@ public class CouponrecordServiceImpl extends GenericServiceImpl<Couponrecord> im
return
rtnJson
;
return
rtnJson
;
}
}
public
JSONObject
checkCouponById
(
CouponrecordVo
vo
){
JSONObject
rtnJson
=
new
JSONObject
();
try
{
Map
<
String
,
Object
>
info
=
couponrecordMapper
.
checkCouponById
(
vo
.
getNumber
());
if
(
info
!=
null
)
{
rtnJson
.
put
(
"errorCode"
,
0
);
rtnJson
.
put
(
"data"
,
info
);
}
else
{
rtnJson
.
put
(
"errorCode"
,
1
);
rtnJson
.
put
(
"errorMsg"
,
"暂无数据"
);
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
rtnJson
.
put
(
"errorCode"
,
1
);
rtnJson
.
put
(
"errorMsg"
,
"检测结果详情"
+
e
.
getMessage
());
}
return
rtnJson
;
}
/**
/**
* 获取卡券最大失效时间。重新计算
* 获取卡券最大失效时间。重新计算
*/
*/
...
...
aidea-modules/couponrecord-module/src/main/java/com/cftech/couponrecord/service/impl/PdaCouponrecordServiceImpl.java
View file @
e29ba84c
package
com
.
cftech
.
couponrecord
.
service
.
impl
;
package
com
.
cftech
.
couponrecord
.
service
.
impl
;
public
class
PdaCouponrecordServiceImpl
{
import
com.alibaba.fastjson.JSONObject
;
import
com.cftech.couponrecord.dao.CouponrecordMapper
;
import
com.cftech.couponrecord.model.Couponrecord
;
import
com.cftech.couponrecord.service.PdaCouponrecordService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.stereotype.Service
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.Map
;
import
java.util.UUID
;
@Service
(
"pdaCouponrecordService"
)
public
class
PdaCouponrecordServiceImpl
implements
PdaCouponrecordService
{
@Autowired
@Qualifier
(
"couponrecordMapper"
)
private
CouponrecordMapper
couponrecordMapper
;
public
JSONObject
writeOff
(
JSONObject
obj
){
JSONObject
rtnJson
=
new
JSONObject
();
String
logId
=
UUID
.
randomUUID
().
toString
();
Map
<
String
,
Object
>
map
=
new
HashMap
<
String
,
Object
>();
map
.
put
(
"id"
,
logId
);
map
.
put
(
"content"
,
obj
.
toString
());
couponrecordMapper
.
insertPdaLog
(
map
);
String
facilityNo
=
obj
.
get
(
"facilityNo"
)+
""
;
String
number
=
obj
.
get
(
"number"
)+
""
;
try
{
//是否已核销
Couponrecord
info
=
couponrecordMapper
.
isWriteOff
(
number
);
if
(
info
!=
null
){
if
(
info
.
getStatus
().
equals
(
1
)){
info
.
setStatus
(
"2"
);
info
.
setVerifDate
(
new
Date
());
// info.setFacilityNo(facilityNo);
couponrecordMapper
.
update
(
info
);
rtnJson
.
put
(
"code"
,
200
);
rtnJson
.
put
(
"msg"
,
"验证成功!"
);
map
=
new
HashMap
<
String
,
Object
>();
map
.
put
(
"id"
,
logId
);
map
.
put
(
"resultJson"
,
rtnJson
.
toString
());
map
.
put
(
"status"
,
2
);
}
else
if
(
info
.
getStatus
().
equals
(
0
)){
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
);
}
else
if
(
info
.
getStatus
().
equals
(
2
)){
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
);
}
else
{
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
);
}
else
{
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
);
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
rtnJson
.
put
(
"code"
,
500
);
rtnJson
.
put
(
"msg"
,
"系统错误:"
+
e
.
getMessage
());
map
=
new
HashMap
<
String
,
Object
>();
map
.
put
(
"id"
,
logId
);
map
.
put
(
"resultJson"
,
rtnJson
.
toString
());
map
.
put
(
"status"
,
1
);
couponrecordMapper
.
updatePdaLog
(
map
);
}
return
rtnJson
;
}
}
}
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