Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gk
Project
Project
Details
Activity
Releases
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
micro_app
gk
Commits
ce47d72c
Commit
ce47d72c
authored
Oct 16, 2025
by
Administrator
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
班车模块增加接口
parent
32c634a1
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
149 additions
and
10 deletions
+149
-10
BusMapper.java
.../com/dlbridge/jadp/plugins/cmpt/dao/mapper/BusMapper.java
+4
-2
BusMapper.xml
...a/com/dlbridge/jadp/plugins/cmpt/dao/mapper/BusMapper.xml
+44
-1
BusVerifyStatistics.java
...e/jadp/plugins/cmpt/dao/model/vo/BusVerifyStatistics.java
+19
-0
BusTicketVerification.java
...dlbridge/jadp/plugins/cmpt/dto/BusTicketVerification.java
+6
-0
BusVerificationRecord.java
...dlbridge/jadp/plugins/cmpt/dto/BusVerificationRecord.java
+4
-0
BusService.java
...va/com/dlbridge/jadp/plugins/cmpt/service/BusService.java
+34
-5
BusController.java
...ava/com/dlbridge/jadp/plugins/cmpt/web/BusController.java
+38
-2
No files found.
src/main/java/com/dlbridge/jadp/plugins/cmpt/dao/mapper/BusMapper.java
View file @
ce47d72c
...
@@ -25,11 +25,11 @@ public interface BusMapper {
...
@@ -25,11 +25,11 @@ public interface BusMapper {
/**
/**
* 核销信息查询
* 核销信息查询
* @param
idNumber 证件
号
* @param
ticketNo 票
号
* @param scheduleId 班次ID
* @param scheduleId 班次ID
* @return
* @return
*/
*/
BusTicketVerification
selectTicketForVerification
(
@Param
(
"cmptId"
)
Integer
cmptId
,
@Param
(
"
idNumber"
)
String
idNumber
,
BusTicketVerification
selectTicketForVerification
(
@Param
(
"cmptId"
)
Integer
cmptId
,
@Param
(
"
ticketNo"
)
String
ticketNo
,
@Param
(
"scheduleId"
)
Integer
scheduleId
);
@Param
(
"scheduleId"
)
Integer
scheduleId
);
/**
/**
...
@@ -63,4 +63,6 @@ public interface BusMapper {
...
@@ -63,4 +63,6 @@ public interface BusMapper {
List
<
BusStation
>
selectStationsByScheduleId
(
@Param
(
"scheduleId"
)
Integer
scheduleId
);
List
<
BusStation
>
selectStationsByScheduleId
(
@Param
(
"scheduleId"
)
Integer
scheduleId
);
List
<
BusStation
>
selectStationsByCmptId
(
@Param
(
"cmptId"
)
Integer
cmptId
);
List
<
BusStation
>
selectStationsByCmptId
(
@Param
(
"cmptId"
)
Integer
cmptId
);
List
<
BusVerificationRecord
>
selectVerificationRecord
(
@Param
(
"cmptId"
)
Integer
cmptId
,
@Param
(
"verifierId"
)
String
verifierId
,
@Param
(
"ticketNo"
)
String
ticketNo
);
}
}
src/main/java/com/dlbridge/jadp/plugins/cmpt/dao/mapper/BusMapper.xml
View file @
ce47d72c
...
@@ -20,6 +20,12 @@
...
@@ -20,6 +20,12 @@
<!-- 关联字段 -->
<!-- 关联字段 -->
<result
column=
"schedule_name"
property=
"scheduleName"
/>
<result
column=
"schedule_name"
property=
"scheduleName"
/>
<result
column=
"license_plate"
property=
"licensePlate"
/>
<result
column=
"license_plate"
property=
"licensePlate"
/>
<result
column=
"driver_name"
property=
"driverName"
/>
<result
column=
"driver_phone"
property=
"driverPhone"
/>
<result
column=
"volunteer_name"
property=
"volunteerName"
/>
<result
column=
"volunteer_phone"
property=
"volunteerPhone"
/>
<result
column=
"remark1"
property=
"remark1"
/>
<result
column=
"remark2"
property=
"remark2"
/>
<result
column=
"departure_time_from"
property=
"departureTimeFrom"
/>
<result
column=
"departure_time_from"
property=
"departureTimeFrom"
/>
<result
column=
"departure_time_to"
property=
"departureTimeTo"
/>
<result
column=
"departure_time_to"
property=
"departureTimeTo"
/>
<result
column=
"allow_multiple_verification"
property=
"allowMultipleVerification"
/>
<result
column=
"allow_multiple_verification"
property=
"allowMultipleVerification"
/>
...
@@ -29,6 +35,8 @@
...
@@ -29,6 +35,8 @@
SELECT tv.*,
SELECT tv.*,
bs.schedule_name,
bs.schedule_name,
bs.license_plate,
bs.license_plate,
bs.driver_phone,
bs.remark1,
bs.departure_time_from,
bs.departure_time_from,
bs.departure_time_to
bs.departure_time_to
FROM gksite.bus_ticket_verification tv
FROM gksite.bus_ticket_verification tv
...
@@ -44,6 +52,12 @@
...
@@ -44,6 +52,12 @@
SELECT tv.*,
SELECT tv.*,
bs.schedule_name,
bs.schedule_name,
bs.license_plate,
bs.license_plate,
bs.driver_name,
bs.driver_phone,
bs.volunteer_name,
bs.volunteer_phone,
bs.remark1,
bs.remark2,
bs.departure_time_from,
bs.departure_time_from,
bs.departure_time_to
bs.departure_time_to
FROM gksite.bus_ticket_verification tv
FROM gksite.bus_ticket_verification tv
...
@@ -63,7 +77,7 @@
...
@@ -63,7 +77,7 @@
FROM gksite.bus_ticket_verification tv
FROM gksite.bus_ticket_verification tv
LEFT JOIN gksite.bus_schedule bs ON tv.schedule_id = bs.id
LEFT JOIN gksite.bus_schedule bs ON tv.schedule_id = bs.id
WHERE tv.cmpt_id = #{cmptId}
WHERE tv.cmpt_id = #{cmptId}
AND tv.
id_number = #{idNumber
}
AND tv.
ticket_no = #{ticketNo
}
AND tv.schedule_id = #{scheduleId}
AND tv.schedule_id = #{scheduleId}
AND tv.del_flag = 0
AND tv.del_flag = 0
</select>
</select>
...
@@ -145,6 +159,8 @@
...
@@ -145,6 +159,8 @@
<result
column=
"station_name"
property=
"stationName"
/>
<result
column=
"station_name"
property=
"stationName"
/>
<result
column=
"station_description"
property=
"stationDescription"
/>
<result
column=
"station_description"
property=
"stationDescription"
/>
<result
column=
"station_coordinates"
property=
"stationCoordinates"
/>
<result
column=
"station_coordinates"
property=
"stationCoordinates"
/>
<result
column=
"longitude"
property=
"longitude"
/>
<result
column=
"latitude"
property=
"latitude"
/>
<result
column=
"station_address"
property=
"stationAddress"
/>
<result
column=
"station_address"
property=
"stationAddress"
/>
<result
column=
"station_order"
property=
"stationOrder"
/>
<result
column=
"station_order"
property=
"stationOrder"
/>
<result
column=
"status"
property=
"status"
/>
<result
column=
"status"
property=
"status"
/>
...
@@ -165,5 +181,32 @@
...
@@ -165,5 +181,32 @@
FROM gksite.bus_station bs
FROM gksite.bus_station bs
WHERE bs.del_flag = 0
WHERE bs.del_flag = 0
AND bs.cmpt_id = #{cmptId}
AND bs.cmpt_id = #{cmptId}
ORDER BY bs.station_order ASC
</select>
<select
id=
"selectVerificationRecord"
resultType=
"com.dlbridge.jadp.plugins.cmpt.dto.BusVerificationRecord"
>
SELECT
bvr.id,
bvr.schedule_id scheduleId,
bvr.verifier_id verifierId,
bvr.verification_time verificationTime,
bvr.ticket_id ticketId,
btv.cmpt_id cmptId,
btv.ticket_no ticketNo,
btv.passenger_name passengerName,
bs.schedule_name scheduleName,
bs.license_plate licensePlate
FROM gksite.bus_verification_record bvr
INNER JOIN gksite.bus_ticket_verification btv ON btv.id = bvr.ticket_id
INNER JOIN gksite.bus_schedule bs ON bs.id = bvr.schedule_id
WHERE 1 = 1
AND bvr.cmpt_id = #{cmptId}
<if
test=
"verifierId != null and verifierId != ''"
>
AND bvr.verifier_id = #{verifierId}
</if>
<if
test=
"ticketNo != null and ticketNo != '' "
>
AND bvr.ticket_no = #{ticketNo}
</if>
</select>
</select>
</mapper>
</mapper>
\ No newline at end of file
src/main/java/com/dlbridge/jadp/plugins/cmpt/dao/model/vo/BusVerifyStatistics.java
0 → 100644
View file @
ce47d72c
package
com
.
dlbridge
.
jadp
.
plugins
.
cmpt
.
dao
.
model
.
vo
;
import
lombok.Data
;
/**
* 班车模块:核销统计
*/
@Data
public
class
BusVerifyStatistics
{
private
String
scheduleName
;
private
Integer
verifyCount
;
public
BusVerifyStatistics
()
{}
public
BusVerifyStatistics
(
String
scheduleName
,
Integer
verifyCount
)
{
this
.
scheduleName
=
scheduleName
;
this
.
verifyCount
=
verifyCount
;
}
}
src/main/java/com/dlbridge/jadp/plugins/cmpt/dto/BusTicketVerification.java
View file @
ce47d72c
...
@@ -33,6 +33,12 @@ public class BusTicketVerification {
...
@@ -33,6 +33,12 @@ public class BusTicketVerification {
// 关联字段
// 关联字段
private
String
scheduleName
;
private
String
scheduleName
;
private
String
licensePlate
;
private
String
licensePlate
;
private
String
driverName
;
private
String
driverPhone
;
private
String
volunteerName
;
private
String
volunteerPhone
;
private
String
remark1
;
private
String
remark2
;
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
LocalDateTime
departureTimeFrom
;
private
LocalDateTime
departureTimeFrom
;
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
...
...
src/main/java/com/dlbridge/jadp/plugins/cmpt/dto/BusVerificationRecord.java
View file @
ce47d72c
...
@@ -20,4 +20,8 @@ public class BusVerificationRecord {
...
@@ -20,4 +20,8 @@ public class BusVerificationRecord {
private
LocalDateTime
verificationTime
;
private
LocalDateTime
verificationTime
;
private
String
verifierId
;
private
String
verifierId
;
private
String
deviceId
;
private
String
deviceId
;
// 关联字段
private
String
scheduleName
;
private
String
licensePlate
;
private
String
passengerName
;
}
}
src/main/java/com/dlbridge/jadp/plugins/cmpt/service/BusService.java
View file @
ce47d72c
...
@@ -2,6 +2,7 @@ package com.dlbridge.jadp.plugins.cmpt.service;
...
@@ -2,6 +2,7 @@ package com.dlbridge.jadp.plugins.cmpt.service;
import
com.dlbridge.jadp.plugins.cmpt.dao.mapper.BusMapper
;
import
com.dlbridge.jadp.plugins.cmpt.dao.mapper.BusMapper
;
import
com.dlbridge.jadp.plugins.cmpt.dao.model.param.BusParam
;
import
com.dlbridge.jadp.plugins.cmpt.dao.model.param.BusParam
;
import
com.dlbridge.jadp.plugins.cmpt.dao.model.vo.BusVerifyStatistics
;
import
com.dlbridge.jadp.plugins.cmpt.dto.BusSchedule
;
import
com.dlbridge.jadp.plugins.cmpt.dto.BusSchedule
;
import
com.dlbridge.jadp.plugins.cmpt.dto.BusStation
;
import
com.dlbridge.jadp.plugins.cmpt.dto.BusStation
;
import
com.dlbridge.jadp.plugins.cmpt.dto.BusTicketVerification
;
import
com.dlbridge.jadp.plugins.cmpt.dto.BusTicketVerification
;
...
@@ -11,6 +12,7 @@ import com.google.zxing.client.j2se.MatrixToImageWriter;
...
@@ -11,6 +12,7 @@ import com.google.zxing.client.j2se.MatrixToImageWriter;
import
com.google.zxing.common.BitMatrix
;
import
com.google.zxing.common.BitMatrix
;
import
com.google.zxing.qrcode.QRCodeWriter
;
import
com.google.zxing.qrcode.QRCodeWriter
;
import
com.neusoft.www.utils.web.Result
;
import
com.neusoft.www.utils.web.Result
;
import
feign.Param
;
import
lombok.extern.log4j.Log4j2
;
import
lombok.extern.log4j.Log4j2
;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.commons.lang.StringUtils
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
...
@@ -69,10 +71,10 @@ public class BusService {
...
@@ -69,10 +71,10 @@ public class BusService {
// 生成二维码内容:票号+时间戳
// 生成二维码内容:票号+时间戳
long
timestamp
=
System
.
currentTimeMillis
();
long
timestamp
=
System
.
currentTimeMillis
();
String
qrContent
=
String
.
format
(
"
idNumber=%s×tamp=%d"
,
ticket
.
getIdNumber
(),
timestamp
);
String
qrContent
=
String
.
format
(
"
ticketNo=%s×tamp=%d"
,
ticket
.
getTicketNo
(),
timestamp
);
QRCodeWriter
qrCodeWriter
=
new
QRCodeWriter
();
QRCodeWriter
qrCodeWriter
=
new
QRCodeWriter
();
BitMatrix
bitMatrix
=
qrCodeWriter
.
encode
(
qrContent
,
BarcodeFormat
.
QR_CODE
,
2
00
,
20
0
);
BitMatrix
bitMatrix
=
qrCodeWriter
.
encode
(
qrContent
,
BarcodeFormat
.
QR_CODE
,
2
50
,
25
0
);
ByteArrayOutputStream
outputStream
=
new
ByteArrayOutputStream
();
ByteArrayOutputStream
outputStream
=
new
ByteArrayOutputStream
();
MatrixToImageWriter
.
writeToStream
(
bitMatrix
,
"PNG"
,
outputStream
);
MatrixToImageWriter
.
writeToStream
(
bitMatrix
,
"PNG"
,
outputStream
);
...
@@ -91,7 +93,7 @@ public class BusService {
...
@@ -91,7 +93,7 @@ public class BusService {
*/
*/
@Transactional
@Transactional
public
Result
verifyTicket
(
BusParam
param
)
{
public
Result
verifyTicket
(
BusParam
param
)
{
if
(
param
.
getCmptId
()
==
null
||
param
.
getScheduleId
()
==
null
||
StringUtils
.
isBlank
(
param
.
get
IdNumber
())
||
param
.
getQrTimestamp
()
==
null
)
{
if
(
param
.
getCmptId
()
==
null
||
param
.
getScheduleId
()
==
null
||
StringUtils
.
isBlank
(
param
.
get
TicketNo
())
||
param
.
getQrTimestamp
()
==
null
)
{
return
Result
.
fail
().
setMsg
(
"主要参数不能为空"
);
return
Result
.
fail
().
setMsg
(
"主要参数不能为空"
);
}
}
...
@@ -102,7 +104,7 @@ public class BusService {
...
@@ -102,7 +104,7 @@ public class BusService {
}
}
// 查询票务信息
// 查询票务信息
BusTicketVerification
ticket
=
busMapper
.
selectTicketForVerification
(
param
.
getCmptId
(),
param
.
get
IdNumber
(),
param
.
getScheduleId
());
BusTicketVerification
ticket
=
busMapper
.
selectTicketForVerification
(
param
.
getCmptId
(),
param
.
get
TicketNo
(),
param
.
getScheduleId
());
if
(
ticket
==
null
)
{
if
(
ticket
==
null
)
{
return
Result
.
fail
().
setMsg
(
"未找到有效的车票信息"
);
return
Result
.
fail
().
setMsg
(
"未找到有效的车票信息"
);
}
}
...
@@ -150,7 +152,7 @@ public class BusService {
...
@@ -150,7 +152,7 @@ public class BusService {
/**
/**
* 查询班次站点列表
* 查询班次
途经
站点列表
* @param scheduleId 班次ID
* @param scheduleId 班次ID
* @return
* @return
*/
*/
...
@@ -158,4 +160,31 @@ public class BusService {
...
@@ -158,4 +160,31 @@ public class BusService {
return
busMapper
.
selectStationsByScheduleId
(
scheduleId
);
return
busMapper
.
selectStationsByScheduleId
(
scheduleId
);
}
}
/**
* 查询赛事班车站点列表
* @param cmptId
* @return
*/
public
List
<
BusStation
>
selectStationsByCmptId
(
Integer
cmptId
)
{
return
busMapper
.
selectStationsByCmptId
(
cmptId
);
}
public
List
<
BusVerificationRecord
>
selectVerificationRecord
(
Integer
cmptId
,
String
verifierId
,
String
ticketNo
)
{
return
busMapper
.
selectVerificationRecord
(
cmptId
,
verifierId
,
ticketNo
);
}
public
List
<
BusVerifyStatistics
>
busVerifyStatistics
(
Integer
cmptId
)
{
List
<
BusVerificationRecord
>
records
=
busMapper
.
selectVerificationRecord
(
cmptId
,
null
,
null
);
Map
<
String
,
Long
>
scheduleCountMap
=
records
.
stream
()
.
collect
(
Collectors
.
groupingBy
(
BusVerificationRecord:
:
getScheduleName
,
Collectors
.
counting
()
));
// 转换为BusVerifyStatistics列表
return
scheduleCountMap
.
entrySet
().
stream
()
.
map
(
entry
->
new
BusVerifyStatistics
(
entry
.
getKey
(),
entry
.
getValue
().
intValue
()))
.
collect
(
Collectors
.
toList
());
}
}
}
src/main/java/com/dlbridge/jadp/plugins/cmpt/web/BusController.java
View file @
ce47d72c
package
com
.
dlbridge
.
jadp
.
plugins
.
cmpt
.
web
;
package
com
.
dlbridge
.
jadp
.
plugins
.
cmpt
.
web
;
import
com.dlbridge.jadp.plugins.cmpt.dao.model.param.BusParam
;
import
com.dlbridge.jadp.plugins.cmpt.dao.model.param.BusParam
;
import
com.dlbridge.jadp.plugins.cmpt.dao.model.vo.BusVerifyStatistics
;
import
com.dlbridge.jadp.plugins.cmpt.dto.BusSchedule
;
import
com.dlbridge.jadp.plugins.cmpt.dto.BusSchedule
;
import
com.dlbridge.jadp.plugins.cmpt.dto.BusStation
;
import
com.dlbridge.jadp.plugins.cmpt.dto.BusStation
;
import
com.dlbridge.jadp.plugins.cmpt.dto.BusTicketVerification
;
import
com.dlbridge.jadp.plugins.cmpt.dto.BusTicketVerification
;
import
com.dlbridge.jadp.plugins.cmpt.dto.BusVerificationRecord
;
import
com.dlbridge.jadp.plugins.cmpt.service.BusService
;
import
com.dlbridge.jadp.plugins.cmpt.service.BusService
;
import
com.neusoft.www.utils.web.Result
;
import
com.neusoft.www.utils.web.Result
;
import
org.springframework.http.HttpHeaders
;
import
org.springframework.http.HttpHeaders
;
...
@@ -84,14 +86,48 @@ public class BusController {
...
@@ -84,14 +86,48 @@ public class BusController {
}
}
/**
/**
* 查询班
车
站点列表
* 查询班
次途经
站点列表
* @return
* @return
*/
*/
@ResponseBody
@ResponseBody
@RequestMapping
(
value
=
"/stations"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"/s
chedule-s
tations"
,
method
=
RequestMethod
.
POST
)
public
Result
selectStationsByScheduleId
(
@RequestBody
BusParam
param
)
{
public
Result
selectStationsByScheduleId
(
@RequestBody
BusParam
param
)
{
List
<
BusStation
>
stations
=
busService
.
selectStationsByScheduleId
(
param
.
getScheduleId
());
List
<
BusStation
>
stations
=
busService
.
selectStationsByScheduleId
(
param
.
getScheduleId
());
return
Result
.
success
().
setContent
(
stations
);
return
Result
.
success
().
setContent
(
stations
);
}
}
/**
* 查询赛事班车站点列表
* @return
*/
@ResponseBody
@RequestMapping
(
value
=
"/cmpt-stations"
,
method
=
RequestMethod
.
POST
)
public
Result
selectStationsByCmptId
(
@RequestBody
BusParam
param
)
{
List
<
BusStation
>
stations
=
busService
.
selectStationsByCmptId
(
param
.
getCmptId
());
return
Result
.
success
().
setContent
(
stations
);
}
/**
* 查询核销记录接口
* @return
*/
@ResponseBody
@RequestMapping
(
value
=
"/verification-record"
,
method
=
RequestMethod
.
POST
)
public
Result
selectVerificationRecord
(
@RequestBody
BusParam
param
)
{
List
<
BusVerificationRecord
>
records
=
busService
.
selectVerificationRecord
(
param
.
getCmptId
(),
param
.
getVerifierId
(),
param
.
getTicketNo
());
return
Result
.
success
().
setContent
(
records
);
}
/**
* 赛事核销统计
* @param cmptId 赛事ID
* @return
*/
@ResponseBody
@RequestMapping
(
value
=
"/verify-statistics/{cmptId}"
,
method
=
RequestMethod
.
GET
)
public
Result
busVerifyStatistics
(
@PathVariable
(
"cmptId"
)
Integer
cmptId
)
{
List
<
BusVerifyStatistics
>
statistics
=
busService
.
busVerifyStatistics
(
cmptId
);
return
Result
.
success
().
setContent
(
statistics
);
}
}
}
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