Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kaoshi-java
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
单欣鑫
kaoshi-java
Commits
b5fd79ac
Commit
b5fd79ac
authored
Sep 04, 2025
by
刘帅
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.bug修复
parent
bb77f5d4
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
181 additions
and
21 deletions
+181
-21
ApiMemberUserController.java
...a/com/ruoyi/hezhi/api/kaoshi/ApiMemberUserController.java
+1
-0
ApiRegionController.java
.../java/com/ruoyi/hezhi/api/kaoshi/ApiRegionController.java
+41
-0
TbRegionController.java
...n/java/com/ruoyi/hezhi/controller/TbRegionController.java
+10
-0
TbRegionMapper.java
.../src/main/java/com/ruoyi/hezhi/mapper/TbRegionMapper.java
+14
-0
ITbRegionService.java
...c/main/java/com/ruoyi/hezhi/service/ITbRegionService.java
+8
-0
TbExamRegistrationServiceImpl.java
...oyi/hezhi/service/impl/TbExamRegistrationServiceImpl.java
+15
-3
TbExamServiceImpl.java
.../java/com/ruoyi/hezhi/service/impl/TbExamServiceImpl.java
+1
-0
TbRegionServiceImpl.java
...ava/com/ruoyi/hezhi/service/impl/TbRegionServiceImpl.java
+26
-0
TbExamRegistrationMapper.xml
.../main/resources/mapper/hezhi/TbExamRegistrationMapper.xml
+23
-15
TbRegionMapper.xml
...system/src/main/resources/mapper/hezhi/TbRegionMapper.xml
+36
-0
examBatch.vue
ruoyi-ui/src/views/hezhi/exam/examBatch.vue
+6
-3
No files found.
ruoyi-admin/src/main/java/com/ruoyi/hezhi/api/kaoshi/ApiMemberUserController.java
View file @
b5fd79ac
...
...
@@ -385,6 +385,7 @@ public class ApiMemberUserController extends BaseController {
if
(
params
.
containsKey
(
"memberUserId"
)
&&
StringUtils
.
isNotBlank
(
params
.
get
(
"memberUserId"
).
toString
()))
{
HashMap
<
String
,
Object
>
hashMap
=
new
HashMap
<>();
hashMap
.
put
(
"isExam"
,
params
.
get
(
"isExam"
).
toString
());
hashMap
.
put
(
"memberUserId"
,
params
.
get
(
"memberUserId"
).
toString
());
hashMap
.
put
(
"examStatus"
,
1
);
...
...
ruoyi-admin/src/main/java/com/ruoyi/hezhi/api/kaoshi/ApiRegionController.java
0 → 100644
View file @
b5fd79ac
package
com
.
ruoyi
.
hezhi
.
api
.
kaoshi
;
import
com.ruoyi.common.annotation.Log
;
import
com.ruoyi.common.core.controller.BaseController
;
import
com.ruoyi.common.core.domain.AjaxResult
;
import
com.ruoyi.common.enums.BusinessType
;
import
com.ruoyi.common.utils.poi.ExcelUtil
;
import
com.ruoyi.hezhi.domain.TbRegion
;
import
com.ruoyi.hezhi.service.ITbRegionService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.web.bind.annotation.*
;
import
javax.servlet.http.HttpServletResponse
;
import
java.util.HashMap
;
import
java.util.List
;
/**
* 行政区域Controller
*
* @author ruoyi
* @date 2024-10-21
*/
@RestController
@RequestMapping
(
"/api/pc/region"
)
public
class
ApiRegionController
extends
BaseController
{
@Autowired
private
ITbRegionService
tbRegionService
;
/**
* 查询行政区域列表
*/
@GetMapping
(
"/treeList"
)
public
AjaxResult
treeList
(
TbRegion
tbRegion
)
{
List
<
TbRegion
>
list
=
tbRegionService
.
selectTbRegionTreeList
(
tbRegion
);
return
success
(
list
);
}
}
ruoyi-admin/src/main/java/com/ruoyi/hezhi/controller/TbRegionController.java
View file @
b5fd79ac
...
...
@@ -39,6 +39,16 @@ public class TbRegionController extends BaseController
return
success
(
list
);
}
/**
* 查询行政区域列表
*/
@GetMapping
(
"/treeList"
)
public
AjaxResult
treeList
(
TbRegion
tbRegion
)
{
List
<
TbRegion
>
list
=
tbRegionService
.
selectTbRegionTreeList
(
tbRegion
);
return
success
(
list
);
}
/**
* 导出行政区域列表
*/
...
...
ruoyi-system/src/main/java/com/ruoyi/hezhi/mapper/TbRegionMapper.java
View file @
b5fd79ac
...
...
@@ -38,6 +38,20 @@ public interface TbRegionMapper
*/
public
List
<
TbRegion
>
selectTbRegionList
(
TbRegion
tbRegion
);
/**
* 查询所有省份及其下级(使用JOIN)
*
* @param tbRegion 行政区域
* @return 行政区域集合
*/
public
List
<
TbRegion
>
findAllRegions
(
TbRegion
tbRegion
);
// 根据类型查询区域
List
<
TbRegion
>
findByType
(
@Param
(
"type"
)
Integer
type
);
// 根据父ID查询子区域
List
<
TbRegion
>
findByPid
(
@Param
(
"pid"
)
Long
pid
);
/**
* 新增行政区域
*
...
...
ruoyi-system/src/main/java/com/ruoyi/hezhi/service/ITbRegionService.java
View file @
b5fd79ac
...
...
@@ -29,6 +29,14 @@ public interface ITbRegionService
*/
public
List
<
TbRegion
>
selectTbRegionList
(
TbRegion
tbRegion
);
/**
* 查询行政区域列表
*
* @param tbRegion 行政区域
* @return 行政区域集合
*/
public
List
<
TbRegion
>
selectTbRegionTreeList
(
TbRegion
tbRegion
);
/**
* 新增行政区域
*
...
...
ruoyi-system/src/main/java/com/ruoyi/hezhi/service/impl/TbExamRegistrationServiceImpl.java
View file @
b5fd79ac
...
...
@@ -454,9 +454,21 @@ public class TbExamRegistrationServiceImpl implements ITbExamRegistrationService
registration
.
setGraduationSchool
(
examRegistrationDTO
.
getGraduationSchool
());
registration
.
setEntranceYear
(
examRegistrationDTO
.
getEntranceYear
());
registration
.
setContactInformation
(
examRegistrationDTO
.
getContactInformation
());
registration
.
setProvinceId
(
examRegistrationDTO
.
getProvinceId
());
registration
.
setCityId
(
examRegistrationDTO
.
getCityId
());
registration
.
setAreaId
(
examRegistrationDTO
.
getAreaId
());
if
(
null
!=
examRegistrationDTO
.
getProvinceId
())
{
registration
.
setProvinceId
(
examRegistrationDTO
.
getProvinceId
());
TbRegion
region
=
tbRegionMapper
.
selectTbRegionById
(
registration
.
getProvinceId
());
registration
.
setProvinceName
(
null
!=
region
?
region
.
getName
():
null
);
}
if
(
null
!=
examRegistrationDTO
.
getCityId
())
{
registration
.
setCityId
(
examRegistrationDTO
.
getCityId
());
TbRegion
region
=
tbRegionMapper
.
selectTbRegionById
(
registration
.
getCityId
());
registration
.
setCityName
(
null
!=
region
?
region
.
getName
():
null
);
}
if
(
null
!=
examRegistrationDTO
.
getAreaId
())
{
registration
.
setAreaId
(
examRegistrationDTO
.
getAreaId
());
TbRegion
region
=
tbRegionMapper
.
selectTbRegionById
(
registration
.
getAreaId
());
registration
.
setAreaName
(
null
!=
region
?
region
.
getName
():
null
);
}
registration
.
setAddress
(
examRegistrationDTO
.
getAddress
());
registration
.
setZipCode
(
examRegistrationDTO
.
getZipCode
());
registration
.
setContactPhone
(
examRegistrationDTO
.
getContactPhone
());
...
...
ruoyi-system/src/main/java/com/ruoyi/hezhi/service/impl/TbExamServiceImpl.java
View file @
b5fd79ac
...
...
@@ -192,6 +192,7 @@ public class TbExamServiceImpl implements ITbExamService
* @param tbExam 考试
* @return 结果
*/
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Override
public
int
updateTbExam
(
TbExam
tbExam
)
{
...
...
ruoyi-system/src/main/java/com/ruoyi/hezhi/service/impl/TbRegionServiceImpl.java
View file @
b5fd79ac
...
...
@@ -47,6 +47,32 @@ public class TbRegionServiceImpl implements ITbRegionService
return
tbRegionMapper
.
selectTbRegionList
(
tbRegion
);
}
/**
* 查询行政区域列表
*
* @param tbRegion 行政区域
* @return 行政区域集合
*/
@Override
public
List
<
TbRegion
>
selectTbRegionTreeList
(
TbRegion
tbRegion
)
{
// 1. 查询所有省份
List
<
TbRegion
>
provinces
=
tbRegionMapper
.
findByType
(
1
);
// 2. 为每个省份查询城市
for
(
TbRegion
province
:
provinces
)
{
List
<
TbRegion
>
cities
=
tbRegionMapper
.
findByPid
(
province
.
getId
());
// 3. 为每个城市查询区县
for
(
TbRegion
city
:
cities
)
{
List
<
TbRegion
>
districts
=
tbRegionMapper
.
findByPid
(
city
.
getId
());
city
.
setChildren
(
districts
);
}
province
.
setChildren
(
cities
);
}
return
provinces
;
}
/**
* 新增行政区域
*
...
...
ruoyi-system/src/main/resources/mapper/hezhi/TbExamRegistrationMapper.xml
View file @
b5fd79ac
...
...
@@ -889,7 +889,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
ter.pay_type AS payType,
CONVERT(IFNULL(te.name, ''), CHAR) AS examName,
tmo.pay_price AS payPrice,
CONVERT(IFNULL(te
r.registration
_batch, ''), CHAR) AS registrationBatch,
CONVERT(IFNULL(te
b.exam
_batch, ''), CHAR) AS registrationBatch,
CONVERT(IFNULL(DATE_FORMAT(teb.exam_start_time,'%Y-%m-%d %H:%i:%s'), ''), CHAR) AS examStartTime,
CONVERT(IFNULL(DATE_FORMAT(teb.exam_end_time,'%Y-%m-%d %H:%i:%s'), ''), CHAR) AS examEndTime,
...
...
@@ -919,18 +919,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
WHERE tsc.member_user_id = ter.member_user_id
AND tsc.course_id = ter.course_id) AS total
from tb_exam_registration ter
INNER JOIN (
SELECT exam_id, MAX(create_time) as create_time
FROM tb_exam_registration
WHERE STATUS = 0 AND del_flag = 0
<if
test=
"memberUserId != null and memberUserId != ''"
>
and member_user_id = #{memberUserId}
</if>
<if
test=
"isPay != null and isPay != ''"
>
and is_pay = #{isPay}
</if>
GROUP BY exam_id
) AS ter2 ON ter.create_time = ter2.create_time and ter.exam_id = ter2.exam_id
<if
test=
"isExam != 1"
>
INNER JOIN (
SELECT exam_id, MAX(create_time) as create_time
FROM tb_exam_registration
WHERE STATUS = 0 AND del_flag = 0
<if
test=
"memberUserId != null and memberUserId != ''"
>
and member_user_id = #{memberUserId}
</if>
<if
test=
"isPay != null and isPay != ''"
>
and is_pay = #{isPay}
</if>
GROUP BY exam_id
) AS ter2 ON ter.create_time = ter2.create_time and ter.exam_id = ter2.exam_id
</if>
left join tb_course tc on tc.course_id = ter.course_id
left join tb_member_order tmo on tmo.data_id = ter.exam_registration_id
left join tb_exam te on ter.exam_id = te.exam_id
...
...
@@ -973,8 +975,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and ter.is_pay = #{isPay}
</if>
</where>
GROUP BY
ter.exam_id
<choose>
<when
test=
"isExam != 1"
>
GROUP BY ter.exam_id
</when>
<otherwise>
GROUP BY ter.exam_registration_id
</otherwise>
</choose>
order by ter.create_time desc
</select>
...
...
ruoyi-system/src/main/resources/mapper/hezhi/TbRegionMapper.xml
View file @
b5fd79ac
...
...
@@ -173,4 +173,40 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select
id=
"selectIdByName3"
resultType=
"java.lang.Long"
>
select id from tb_region where name = #{name} and type = 3 and pid = #{pid}
</select>
<select
id=
"findAllRegions"
resultType=
"com.ruoyi.hezhi.domain.TbRegion"
>
SELECT
p.id as province_id, p.name as province_name,
c.id as city_id, c.name as city_name,
d.id as district_id, d.name as district_name
FROM tb_region p
LEFT JOIN tb_region c ON p.id = c.pid AND c.type = 1 AND c.del_flag = 0
LEFT JOIN tb_region d ON c.id = d.pid AND d.type = 2 AND d.del_flag = 0
WHERE p.type = 0 AND p.del_flag = 0
ORDER BY p.code, c.code, d.code
</select>
<select
id=
"findByType"
resultType=
"com.ruoyi.hezhi.domain.TbRegion"
>
SELECT
id, pid, shortname, name, merger_name as mergerName,
type, pinyin, phone_code as phoneCode, code, first,
lng, lat, create_time as createTime, create_by as createBy,
update_time as updateTime, update_by as updateBy,
delete_time as deleteTime, delete_by as deleteBy, del_flag as delFlag
FROM tb_region
WHERE type = #{type} AND del_flag = 0
ORDER BY code
</select>
<select
id=
"findByPid"
resultType=
"com.ruoyi.hezhi.domain.TbRegion"
>
SELECT
id, pid, shortname, name, merger_name as mergerName,
type, pinyin, phone_code as phoneCode, code, first,
lng, lat, create_time as createTime, create_by as createBy,
update_time as updateTime, update_by as updateBy,
delete_time as deleteTime, delete_by as deleteBy, del_flag as delFlag
FROM tb_region
WHERE pid = #{pid} AND del_flag = 0
ORDER BY code
</select>
</mapper>
ruoyi-ui/src/views/hezhi/exam/examBatch.vue
View file @
b5fd79ac
...
...
@@ -60,7 +60,7 @@
<el-dialog
:title=
"title"
:visible.sync=
"open"
width=
"500px"
append-to-body
>
<el-form
ref=
"form"
:model=
"form"
:rules=
"rules"
label-width=
"110px"
>
<el-form-item
label=
"考试批次"
prop=
"examBatch"
>
<el-input
v-model=
"form.examBatch"
placeholder=
"请输入考试批次"
/>
<el-input
v-model=
"form.examBatch"
placeholder=
"请输入考试批次"
style=
"width: 100%"
/>
</el-form-item>
<!-- <el-form-item label="报名开始时间" prop="signStartTime">-->
<!-- <el-date-picker-->
...
...
@@ -83,7 +83,9 @@
v-model=
"form.examStartTime"
value-format=
"yyyy-MM-dd HH:mm:ss"
type=
"datetime"
placeholder=
"选择考试开始时间"
>
placeholder=
"选择考试开始时间"
style=
"width: 100%"
>
</el-date-picker>
</el-form-item>
<el-form-item
label=
"考试结束时间"
prop=
"examEndTime"
>
...
...
@@ -91,7 +93,8 @@
v-model=
"form.examEndTime"
value-format=
"yyyy-MM-dd HH:mm:ss"
type=
"datetime"
placeholder=
"选择考试结束时间"
>
placeholder=
"选择考试结束时间"
style=
"width: 100%"
>
</el-date-picker>
</el-form-item>
</el-form>
...
...
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