Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
dd_school
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wangqi
dd_school
Commits
77d756c5
Commit
77d756c5
authored
Sep 14, 2023
by
zhaopanyu
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of 49.232.152.146:xhxy/smart_school
parents
510b4e04
c7c0fb0e
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
140 additions
and
4 deletions
+140
-4
smart-campus/src/main/java/yangtz/cs/liu/campus/controller/schoolSecurity/SchoolVehicleInOutController.java
+40
-1
smart-campus/src/main/java/yangtz/cs/liu/campus/mapper/schoolSecurity/SchoolVehicleInOutMapper.java
+9
-0
smart-campus/src/main/java/yangtz/cs/liu/campus/service/impl/schoolInstrument/SchoolInstrumentServiceImpl.java
+21
-2
smart-campus/src/main/java/yangtz/cs/liu/campus/service/impl/schoolSecurity/SchoolVehicleInOutServiceImpl.java
+49
-0
smart-campus/src/main/java/yangtz/cs/liu/campus/service/schoolSecurity/ISchoolVehicleInOutService.java
+15
-0
smart-campus/src/main/resources/mapper/schoolSecurity/SchoolVehicleInOutMapper.xml
+6
-1
No files found.
smart-campus/src/main/java/yangtz/cs/liu/campus/controller/schoolSecurity/SchoolVehicleInOutController.java
View file @
77d756c5
...
...
@@ -3,18 +3,25 @@ package yangtz.cs.liu.campus.controller.schoolSecurity;
import
com.ruoyi.common.annotation.Log
;
import
com.ruoyi.common.core.controller.BaseController
;
import
com.ruoyi.common.core.domain.AjaxResult
;
import
com.ruoyi.common.core.domain.entity.SysUser
;
import
com.ruoyi.common.core.page.TableDataInfo
;
import
com.ruoyi.common.enums.BusinessType
;
import
com.ruoyi.common.utils.SecurityUtils
;
import
com.ruoyi.common.utils.poi.ExcelUtil
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
yangtz.cs.liu.campus.domain.schoolSecurity.SchoolVehicleInOut
;
import
yangtz.cs.liu.campus.service.schoolSecurity.ISchoolVehicleInOutService
;
import
yangtz.cs.liu.campus.service.teacher.ISchoolTeacherLeaveService
;
import
yangtz.cs.liu.campus.service.teacher.ISchoolTeacherService
;
import
yangtz.cs.liu.campus.vo.schoolSecurity.SchoolVehicleInOutVo
;
import
yangtz.cs.liu.campus.vo.teacher.SchoolTeacherVO
;
import
javax.servlet.http.HttpServletResponse
;
import
java.util.List
;
import
static
yangtz
.
cs
.
liu
.
campus
.
constant
.
GradeConstant
.
SCHOOLLEADER
;
/**
* 车辆出入登记Controller
*
...
...
@@ -28,6 +35,10 @@ public class SchoolVehicleInOutController extends BaseController
@Autowired
private
ISchoolVehicleInOutService
schoolVehicleInOutService
;
@Autowired
private
ISchoolTeacherLeaveService
schoolTeacherLeaveService
;
@Autowired
private
ISchoolTeacherService
schoolTeacherService
;
/**
* 查询车辆出入登记列表
...
...
@@ -68,7 +79,7 @@ public class SchoolVehicleInOutController extends BaseController
@PostMapping
public
AjaxResult
add
(
@RequestBody
SchoolVehicleInOutVo
schoolVehicleInOutVo
)
{
return
toAjax
(
schoolVehicleInOutService
.
insertSchoolVehicleInOut
(
schoolVehicleInOutVo
));
return
toAjax
(
schoolVehicleInOutService
.
insertSchoolVehicleInOut
Vo
(
schoolVehicleInOutVo
));
}
/**
...
...
@@ -90,4 +101,32 @@ public class SchoolVehicleInOutController extends BaseController
{
return
toAjax
(
schoolVehicleInOutService
.
deleteSchoolVehicleInOutByIds
(
ids
));
}
/**
* 获取当前登录人车辆登记信息
*/
@GetMapping
(
"/getUserVehicle"
)
public
AjaxResult
getUserVehicle
(){
SysUser
user
=
SecurityUtils
.
getLoginUser
().
getUser
();
return
AjaxResult
.
success
(
schoolVehicleInOutService
.
getUserVehicle
(
user
.
getUserId
()));
}
/**
* 获取级部/处室领导
*/
@GetMapping
(
"/getGradeOrDeptLeader/{applyOrgid}"
)
public
TableDataInfo
getGradeOrDeptLeader
(
@PathVariable
Long
applyOrgid
,
SchoolTeacherVO
teacherVO
){
//判断用户是职工还是教工,来确定传过来的id是级部id还是部门id
String
employeeType
=
getLoginUser
().
getUser
().
getEmployeeType
();
return
getDataTable
(
schoolTeacherLeaveService
.
getLeader
(
applyOrgid
,
employeeType
,
teacherVO
));
}
/**
* 获取分管领导
* */
@GetMapping
(
"/getSchoolLeader"
)
public
TableDataInfo
getSchoolLeader
(
SchoolTeacherVO
teacher
)
{
return
getDataTable
(
schoolTeacherService
.
getSectionLeader
(
null
,
SCHOOLLEADER
,
teacher
));
}
}
smart-campus/src/main/java/yangtz/cs/liu/campus/mapper/schoolSecurity/SchoolVehicleInOutMapper.java
View file @
77d756c5
package
yangtz
.
cs
.
liu
.
campus
.
mapper
.
schoolSecurity
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
org.apache.ibatis.annotations.Param
;
import
yangtz.cs.liu.campus.domain.schoolSecurity.SchoolVehicleInOut
;
import
yangtz.cs.liu.campus.vo.schoolSecurity.SchoolVehicleInOutVo
;
import
java.util.List
;
import
java.util.Map
;
/**
* 车辆出入登记Mapper接口
...
...
@@ -62,4 +64,11 @@ public interface SchoolVehicleInOutMapper extends BaseMapper<SchoolVehicleInOut>
* @return 结果
*/
public
int
deleteSchoolVehicleInOutByIds
(
Long
[]
ids
);
/**
* 获取当前登录人车辆登记信息
* @param userId
* @return
*/
List
<
Map
<
String
,
String
>>
getUserVehicle
(
@Param
(
"userId"
)
Long
userId
);
}
smart-campus/src/main/java/yangtz/cs/liu/campus/service/impl/schoolInstrument/SchoolInstrumentServiceImpl.java
View file @
77d756c5
...
...
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import
com.ruoyi.common.core.domain.entity.SysUser
;
import
com.ruoyi.common.utils.DateUtils
;
import
com.ruoyi.common.utils.SecurityUtils
;
import
com.ruoyi.common.utils.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
yangtz.cs.liu.campus.domain.schoolInstrument.SchoolInstrument
;
...
...
@@ -11,6 +12,7 @@ import yangtz.cs.liu.campus.mapper.schoolInstrument.SchoolInstrumentMapper;
import
yangtz.cs.liu.campus.service.schoolInstrument.ISchoolInstrumentService
;
import
yangtz.cs.liu.campus.vo.schoolInstrument.SchoolInstrumentVo
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
...
...
@@ -103,11 +105,28 @@ public class SchoolInstrumentServiceImpl extends ServiceImpl<SchoolInstrumentMap
return
schoolInstrumentMapper
.
deleteSchoolInstrumentById
(
id
);
}
/**
* 教师借用明细列表
* @param schoolInstrumentVo
* @return
*/
@Override
public
List
<
SchoolInstrument
>
selectInstrumentList
(
SchoolInstrumentVo
schoolInstrumentVo
)
{
if
(
schoolInstrumentVo
.
getIds
().
size
()
<=
0
){
if
(
StringUtils
.
isNull
(
schoolInstrumentVo
.
getIds
())
||
schoolInstrumentVo
.
getIds
().
size
()
<=
0
){
schoolInstrumentVo
.
setIds
(
null
);
}
return
schoolInstrumentMapper
.
selectInstrumentList
(
schoolInstrumentVo
);
List
<
SchoolInstrument
>
list
=
new
ArrayList
<>();
List
<
SchoolInstrument
>
schoolInstruments
=
schoolInstrumentMapper
.
selectInstrumentList
(
schoolInstrumentVo
);
for
(
SchoolInstrument
schoolInstrument
:
schoolInstruments
)
{
if
(
schoolInstrument
.
getInstrumentNum
()==
0
){
list
.
add
(
schoolInstrument
);
}
}
if
(
list
.
size
()
>
0
){
for
(
SchoolInstrument
schoolInstrument
:
list
)
{
schoolInstruments
.
remove
(
schoolInstrument
);
}
}
return
schoolInstruments
;
}
}
smart-campus/src/main/java/yangtz/cs/liu/campus/service/impl/schoolSecurity/SchoolVehicleInOutServiceImpl.java
View file @
77d756c5
package
yangtz
.
cs
.
liu
.
campus
.
service
.
impl
.
schoolSecurity
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.ruoyi.common.core.domain.entity.SysUser
;
import
com.ruoyi.common.exception.ServiceException
;
import
com.ruoyi.common.utils.DateUtils
;
import
com.ruoyi.common.utils.SecurityUtils
;
import
com.ruoyi.common.utils.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
yangtz.cs.liu.campus.domain.schoolSecurity.SchoolVehicleInOut
;
import
yangtz.cs.liu.campus.domain.schoolSecurity.SchoolVehicleRegistration
;
import
yangtz.cs.liu.campus.mapper.schoolSecurity.SchoolVehicleInOutMapper
;
import
yangtz.cs.liu.campus.mapper.schoolSecurity.SchoolVehicleRegistrationMapper
;
import
yangtz.cs.liu.campus.service.schoolSecurity.ISchoolVehicleInOutService
;
import
yangtz.cs.liu.campus.vo.schoolSecurity.SchoolVehicleInOutVo
;
import
java.util.List
;
import
java.util.Map
;
/**
* 车辆出入登记Service业务层处理
...
...
@@ -23,6 +31,8 @@ public class SchoolVehicleInOutServiceImpl extends ServiceImpl<SchoolVehicleInOu
@Autowired
private
SchoolVehicleInOutMapper
schoolVehicleInOutMapper
;
@Autowired
private
SchoolVehicleRegistrationMapper
schoolVehicleRegistrationMapper
;
/**
* 查询车辆出入登记
...
...
@@ -97,4 +107,43 @@ public class SchoolVehicleInOutServiceImpl extends ServiceImpl<SchoolVehicleInOu
{
return
schoolVehicleInOutMapper
.
deleteSchoolVehicleInOutById
(
id
);
}
/**
* 获取当前登录人车辆登记信息
* @param userId
* @return
*/
@Override
public
List
<
Map
<
String
,
String
>>
getUserVehicle
(
Long
userId
)
{
return
schoolVehicleInOutMapper
.
getUserVehicle
(
userId
);
}
/**
* 新增车辆出入登记信息
* @param schoolVehicleInOutVo
* @return
*/
@Override
public
int
insertSchoolVehicleInOutVo
(
SchoolVehicleInOutVo
schoolVehicleInOutVo
)
{
SysUser
user
=
SecurityUtils
.
getLoginUser
().
getUser
();
//判断是否选择级部/处室主任和分管领导
if
(
StringUtils
.
isNull
(
schoolVehicleInOutVo
.
getHandUserId1
())){
throw
new
ServiceException
(
"请选择级部/处室主任"
);
}
if
(
StringUtils
.
isNull
(
schoolVehicleInOutVo
.
getHandUserId2
())){
throw
new
ServiceException
(
"请选择分管领导"
);
}
//判断已登记车牌号是否保留
if
(
StringUtils
.
isNotEmpty
(
schoolVehicleInOutVo
.
getOldLicenseNumber
())){
if
(
schoolVehicleInOutVo
.
getIsRetain
().
equals
(
"0"
)){
//不保留,删除已登记车牌号
LambdaQueryWrapper
<
SchoolVehicleRegistration
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
eq
(
SchoolVehicleRegistration:
:
getUserId
,
user
.
getUserId
())
.
eq
(
SchoolVehicleRegistration:
:
getLicenseNumber
,
schoolVehicleInOutVo
.
getOldLicenseNumber
());
schoolVehicleRegistrationMapper
.
delete
(
wrapper
);
}
}
schoolVehicleInOutVo
.
setCreateBy
(
user
.
getUserName
());
return
schoolVehicleInOutMapper
.
insertSchoolVehicleInOut
(
schoolVehicleInOutVo
);
}
}
smart-campus/src/main/java/yangtz/cs/liu/campus/service/schoolSecurity/ISchoolVehicleInOutService.java
View file @
77d756c5
...
...
@@ -5,6 +5,7 @@ import yangtz.cs.liu.campus.domain.schoolSecurity.SchoolVehicleInOut;
import
yangtz.cs.liu.campus.vo.schoolSecurity.SchoolVehicleInOutVo
;
import
java.util.List
;
import
java.util.Map
;
/**
* 车辆出入登记Service接口
...
...
@@ -62,4 +63,18 @@ public interface ISchoolVehicleInOutService extends IService<SchoolVehicleInOut>
* @return 结果
*/
public
int
deleteSchoolVehicleInOutById
(
Long
id
);
/**
* 获取当前登录人车辆登记信息
* @param userId
* @return
*/
public
List
<
Map
<
String
,
String
>>
getUserVehicle
(
Long
userId
);
/**
* 新增车辆出入登记信息
* @param schoolVehicleInOutVo
* @return
*/
int
insertSchoolVehicleInOutVo
(
SchoolVehicleInOutVo
schoolVehicleInOutVo
);
}
smart-campus/src/main/resources/mapper/schoolSecurity/SchoolVehicleInOutMapper.xml
View file @
77d756c5
...
...
@@ -4,7 +4,7 @@
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"yangtz.cs.liu.campus.mapper.schoolSecurity.SchoolVehicleInOutMapper"
>
<resultMap
type=
"SchoolVehicleInOutV
p
"
id=
"SchoolVehicleInOutVoResult"
>
<resultMap
type=
"SchoolVehicleInOutV
o
"
id=
"SchoolVehicleInOutVoResult"
>
<result
property=
"id"
column=
"id"
/>
<result
property=
"instanceId"
column=
"instance_id"
/>
<result
property=
"userId"
column=
"user_id"
/>
...
...
@@ -203,4 +203,8 @@
#{id}
</foreach>
</update>
<select
id=
"getUserVehicle"
resultType=
"Map"
>
SELECT license_number as licenseNumber FROM school_vehicle_registration WHERE del_flag = '0' and user_id = #{userId}
</select>
</mapper>
\ No newline at end of file
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