Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
zhengyuan-danger-chemistry-manage
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
耿迪迪
zhengyuan-danger-chemistry-manage
Commits
2f37381e
Commit
2f37381e
authored
Oct 19, 2022
by
zhangjianqian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
app nfc 刷卡
parent
ffdcccad
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
608 additions
and
0 deletions
+608
-0
TNfcRecordController.java
...om/zehong/web/controller/system/TNfcRecordController.java
+116
-0
TNfcRecord.java
...em/src/main/java/com/zehong/system/domain/TNfcRecord.java
+173
-0
TNfcRecordMapper.java
.../main/java/com/zehong/system/mapper/TNfcRecordMapper.java
+61
-0
ITNfcRecordService.java
...in/java/com/zehong/system/service/ITNfcRecordService.java
+61
-0
TNfcRecordServiceImpl.java
...com/zehong/system/service/impl/TNfcRecordServiceImpl.java
+106
-0
TNfcRecordMapper.xml
...tem/src/main/resources/mapper/system/TNfcRecordMapper.xml
+91
-0
No files found.
danger-manage-admin/src/main/java/com/zehong/web/controller/system/TNfcRecordController.java
0 → 100644
View file @
2f37381e
package
com
.
zehong
.
web
.
controller
.
system
;
import
java.util.List
;
import
com.zehong.common.core.domain.entity.SysUser
;
import
com.zehong.common.core.domain.model.LoginUser
;
import
com.zehong.common.utils.ServletUtils
;
import
com.zehong.framework.web.service.TokenService
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.PutMapping
;
import
org.springframework.web.bind.annotation.DeleteMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.zehong.common.annotation.Log
;
import
com.zehong.common.core.controller.BaseController
;
import
com.zehong.common.core.domain.AjaxResult
;
import
com.zehong.common.enums.BusinessType
;
import
com.zehong.system.domain.TNfcRecord
;
import
com.zehong.system.service.ITNfcRecordService
;
import
com.zehong.common.utils.poi.ExcelUtil
;
import
com.zehong.common.core.page.TableDataInfo
;
/**
* nfc巡检记录idController
*
* @author zehong
* @date 2022-10-18
*/
@RestController
@RequestMapping
(
"/system/record"
)
public
class
TNfcRecordController
extends
BaseController
{
@Autowired
private
ITNfcRecordService
tNfcRecordService
;
@Autowired
private
TokenService
tokenService
;
/**
* 查询nfc巡检记录id列表
*/
//@PreAuthorize("@ss.hasPermi('system:record:list')")
@GetMapping
(
"/list"
)
public
TableDataInfo
list
(
TNfcRecord
tNfcRecord
)
{
startPage
();
LoginUser
loginUser
=
tokenService
.
getLoginUser
(
ServletUtils
.
getRequest
());
SysUser
user
=
loginUser
.
getUser
();
tNfcRecord
.
setCreateUser
(
user
.
getUserId
());
List
<
TNfcRecord
>
list
=
tNfcRecordService
.
selectTNfcRecordList
(
tNfcRecord
);
return
getDataTable
(
list
);
}
/**
* 导出nfc巡检记录id列表
*/
//@PreAuthorize("@ss.hasPermi('system:record:export')")
@Log
(
title
=
"nfc巡检记录id"
,
businessType
=
BusinessType
.
EXPORT
)
@GetMapping
(
"/export"
)
public
AjaxResult
export
(
TNfcRecord
tNfcRecord
)
{
List
<
TNfcRecord
>
list
=
tNfcRecordService
.
selectTNfcRecordList
(
tNfcRecord
);
ExcelUtil
<
TNfcRecord
>
util
=
new
ExcelUtil
<
TNfcRecord
>(
TNfcRecord
.
class
);
return
util
.
exportExcel
(
list
,
"nfc巡检记录id数据"
);
}
/**
* 获取nfc巡检记录id详细信息
*/
//@PreAuthorize("@ss.hasPermi('system:record:query')")
@GetMapping
(
value
=
"/{recordId}"
)
public
AjaxResult
getInfo
(
@PathVariable
(
"recordId"
)
Long
recordId
)
{
return
AjaxResult
.
success
(
tNfcRecordService
.
selectTNfcRecordById
(
recordId
));
}
/**
* 新增nfc巡检记录id
*/
//@PreAuthorize("@ss.hasPermi('system:record:add')")
@Log
(
title
=
"nfc巡检记录"
,
businessType
=
BusinessType
.
INSERT
)
@PostMapping
public
AjaxResult
add
(
@RequestBody
TNfcRecord
tNfcRecord
)
{
LoginUser
loginUser
=
tokenService
.
getLoginUser
(
ServletUtils
.
getRequest
());
SysUser
user
=
loginUser
.
getUser
();
tNfcRecord
.
setCreateUser
(
user
.
getUserId
());
return
toAjax
(
tNfcRecordService
.
insertTNfcRecord
(
tNfcRecord
));
}
/**
* 修改nfc巡检记录id
*/
//@PreAuthorize("@ss.hasPermi('system:record:edit')")
@Log
(
title
=
"nfc巡检记录id"
,
businessType
=
BusinessType
.
UPDATE
)
@PutMapping
public
AjaxResult
edit
(
@RequestBody
TNfcRecord
tNfcRecord
)
{
return
toAjax
(
tNfcRecordService
.
updateTNfcRecord
(
tNfcRecord
));
}
/**
* 删除nfc巡检记录id
*/
//@PreAuthorize("@ss.hasPermi('system:record:remove')")
@Log
(
title
=
"nfc巡检记录id"
,
businessType
=
BusinessType
.
DELETE
)
@DeleteMapping
(
"/{recordIds}"
)
public
AjaxResult
remove
(
@PathVariable
Long
[]
recordIds
)
{
return
toAjax
(
tNfcRecordService
.
deleteTNfcRecordByIds
(
recordIds
));
}
}
danger-manage-system/src/main/java/com/zehong/system/domain/TNfcRecord.java
0 → 100644
View file @
2f37381e
package
com
.
zehong
.
system
.
domain
;
import
org.apache.commons.lang3.builder.ToStringBuilder
;
import
org.apache.commons.lang3.builder.ToStringStyle
;
import
com.zehong.common.annotation.Excel
;
import
com.zehong.common.core.domain.BaseEntity
;
/**
* nfc巡检记录id对象 t_nfc_record
*
* @author zehong
* @date 2022-10-18
*/
public
class
TNfcRecord
extends
BaseEntity
{
private
static
final
long
serialVersionUID
=
1L
;
/** 巡检记录 */
private
Long
recordId
;
/** nfc_id */
@Excel
(
name
=
"nfc_id"
)
private
Long
nfcId
;
/** 是否正常 0否 1是 */
@Excel
(
name
=
"是否正常 0否 1是"
)
private
Integer
isNormal
;
/** 图片地址 */
@Excel
(
name
=
"图片地址"
)
private
String
picture
;
/** 备注 */
@Excel
(
name
=
"备注"
)
private
String
remarks
;
/** 上报人 */
@Excel
(
name
=
"上报人"
)
private
Long
createUser
;
private
String
userName
;
@Excel
(
name
=
"巡检地点"
)
private
String
patrolAddress
;
/** 巡检内容 */
@Excel
(
name
=
"巡检内容"
)
private
String
patrolComent
;
/** 巡检频次 */
@Excel
(
name
=
"巡检频次"
)
private
String
patrolFrequency
;
private
String
startTime
;
private
String
endTime
;
public
String
getUserName
()
{
return
userName
;
}
public
void
setUserName
(
String
userName
)
{
this
.
userName
=
userName
;
}
public
String
getStartTime
()
{
return
startTime
;
}
public
void
setStartTime
(
String
startTime
)
{
this
.
startTime
=
startTime
;
}
public
String
getEndTime
()
{
return
endTime
;
}
public
void
setEndTime
(
String
endTime
)
{
this
.
endTime
=
endTime
;
}
public
String
getPatrolAddress
()
{
return
patrolAddress
;
}
public
void
setPatrolAddress
(
String
patrolAddress
)
{
this
.
patrolAddress
=
patrolAddress
;
}
public
String
getPatrolComent
()
{
return
patrolComent
;
}
public
void
setPatrolComent
(
String
patrolComent
)
{
this
.
patrolComent
=
patrolComent
;
}
public
String
getPatrolFrequency
()
{
return
patrolFrequency
;
}
public
void
setPatrolFrequency
(
String
patrolFrequency
)
{
this
.
patrolFrequency
=
patrolFrequency
;
}
public
void
setRecordId
(
Long
recordId
)
{
this
.
recordId
=
recordId
;
}
public
Long
getRecordId
()
{
return
recordId
;
}
public
void
setNfcId
(
Long
nfcId
)
{
this
.
nfcId
=
nfcId
;
}
public
Long
getNfcId
()
{
return
nfcId
;
}
public
void
setIsNormal
(
Integer
isNormal
)
{
this
.
isNormal
=
isNormal
;
}
public
Integer
getIsNormal
()
{
return
isNormal
;
}
public
void
setPicture
(
String
picture
)
{
this
.
picture
=
picture
;
}
public
String
getPicture
()
{
return
picture
;
}
public
void
setRemarks
(
String
remarks
)
{
this
.
remarks
=
remarks
;
}
public
String
getRemarks
()
{
return
remarks
;
}
public
void
setCreateUser
(
Long
createUser
)
{
this
.
createUser
=
createUser
;
}
public
Long
getCreateUser
()
{
return
createUser
;
}
@Override
public
String
toString
()
{
return
new
ToStringBuilder
(
this
,
ToStringStyle
.
MULTI_LINE_STYLE
)
.
append
(
"recordId"
,
getRecordId
())
.
append
(
"nfcId"
,
getNfcId
())
.
append
(
"isNormal"
,
getIsNormal
())
.
append
(
"picture"
,
getPicture
())
.
append
(
"remarks"
,
getRemarks
())
.
append
(
"createTime"
,
getCreateTime
())
.
append
(
"createUser"
,
getCreateUser
())
.
toString
();
}
}
danger-manage-system/src/main/java/com/zehong/system/mapper/TNfcRecordMapper.java
0 → 100644
View file @
2f37381e
package
com
.
zehong
.
system
.
mapper
;
import
java.util.List
;
import
com.zehong.system.domain.TNfcRecord
;
/**
* nfc巡检记录idMapper接口
*
* @author zehong
* @date 2022-10-18
*/
public
interface
TNfcRecordMapper
{
/**
* 查询nfc巡检记录id
*
* @param recordId nfc巡检记录idID
* @return nfc巡检记录id
*/
public
TNfcRecord
selectTNfcRecordById
(
Long
recordId
);
/**
* 查询nfc巡检记录id列表
*
* @param tNfcRecord nfc巡检记录id
* @return nfc巡检记录id集合
*/
public
List
<
TNfcRecord
>
selectTNfcRecordList
(
TNfcRecord
tNfcRecord
);
/**
* 新增nfc巡检记录id
*
* @param tNfcRecord nfc巡检记录id
* @return 结果
*/
public
int
insertTNfcRecord
(
TNfcRecord
tNfcRecord
);
/**
* 修改nfc巡检记录id
*
* @param tNfcRecord nfc巡检记录id
* @return 结果
*/
public
int
updateTNfcRecord
(
TNfcRecord
tNfcRecord
);
/**
* 删除nfc巡检记录id
*
* @param recordId nfc巡检记录idID
* @return 结果
*/
public
int
deleteTNfcRecordById
(
Long
recordId
);
/**
* 批量删除nfc巡检记录id
*
* @param recordIds 需要删除的数据ID
* @return 结果
*/
public
int
deleteTNfcRecordByIds
(
Long
[]
recordIds
);
}
danger-manage-system/src/main/java/com/zehong/system/service/ITNfcRecordService.java
0 → 100644
View file @
2f37381e
package
com
.
zehong
.
system
.
service
;
import
java.util.List
;
import
com.zehong.system.domain.TNfcRecord
;
/**
* nfc巡检记录idService接口
*
* @author zehong
* @date 2022-10-18
*/
public
interface
ITNfcRecordService
{
/**
* 查询nfc巡检记录id
*
* @param recordId nfc巡检记录idID
* @return nfc巡检记录id
*/
public
TNfcRecord
selectTNfcRecordById
(
Long
recordId
);
/**
* 查询nfc巡检记录id列表
*
* @param tNfcRecord nfc巡检记录id
* @return nfc巡检记录id集合
*/
public
List
<
TNfcRecord
>
selectTNfcRecordList
(
TNfcRecord
tNfcRecord
);
/**
* 新增nfc巡检记录id
*
* @param tNfcRecord nfc巡检记录id
* @return 结果
*/
public
int
insertTNfcRecord
(
TNfcRecord
tNfcRecord
);
/**
* 修改nfc巡检记录id
*
* @param tNfcRecord nfc巡检记录id
* @return 结果
*/
public
int
updateTNfcRecord
(
TNfcRecord
tNfcRecord
);
/**
* 批量删除nfc巡检记录id
*
* @param recordIds 需要删除的nfc巡检记录idID
* @return 结果
*/
public
int
deleteTNfcRecordByIds
(
Long
[]
recordIds
);
/**
* 删除nfc巡检记录id信息
*
* @param recordId nfc巡检记录idID
* @return 结果
*/
public
int
deleteTNfcRecordById
(
Long
recordId
);
}
danger-manage-system/src/main/java/com/zehong/system/service/impl/TNfcRecordServiceImpl.java
0 → 100644
View file @
2f37381e
package
com
.
zehong
.
system
.
service
.
impl
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.List
;
import
com.zehong.common.utils.DateUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.format.annotation.DateTimeFormat
;
import
org.springframework.stereotype.Service
;
import
com.zehong.system.mapper.TNfcRecordMapper
;
import
com.zehong.system.domain.TNfcRecord
;
import
com.zehong.system.service.ITNfcRecordService
;
/**
* nfc巡检记录idService业务层处理
*
* @author zehong
* @date 2022-10-18
*/
@Service
public
class
TNfcRecordServiceImpl
implements
ITNfcRecordService
{
@Autowired
private
TNfcRecordMapper
tNfcRecordMapper
;
/**
* 查询nfc巡检记录id
*
* @param recordId nfc巡检记录idID
* @return nfc巡检记录id
*/
@Override
public
TNfcRecord
selectTNfcRecordById
(
Long
recordId
)
{
return
tNfcRecordMapper
.
selectTNfcRecordById
(
recordId
);
}
/**
* 查询nfc巡检记录id列表
*
* @param tNfcRecord nfc巡检记录id
* @return nfc巡检记录id
*/
@Override
public
List
<
TNfcRecord
>
selectTNfcRecordList
(
TNfcRecord
tNfcRecord
)
{
if
(
tNfcRecord
.
getStartTime
()==
null
||
tNfcRecord
.
getStartTime
()==
""
){
Date
d
=
new
Date
(
new
Date
().
getTime
()-
86400000
);
SimpleDateFormat
format
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH;mm:ss"
);
tNfcRecord
.
setStartTime
(
format
.
format
(
d
));
}
if
(
tNfcRecord
.
getEndTime
()!=
null
&&
tNfcRecord
.
getEndTime
()!=
""
){
tNfcRecord
.
setEndTime
(
tNfcRecord
.
getEndTime
()+
" 23:59:59"
);
}
return
tNfcRecordMapper
.
selectTNfcRecordList
(
tNfcRecord
);
}
/**
* 新增nfc巡检记录id
*
* @param tNfcRecord nfc巡检记录id
* @return 结果
*/
@Override
public
int
insertTNfcRecord
(
TNfcRecord
tNfcRecord
)
{
tNfcRecord
.
setCreateTime
(
DateUtils
.
getNowDate
());
return
tNfcRecordMapper
.
insertTNfcRecord
(
tNfcRecord
);
}
/**
* 修改nfc巡检记录id
*
* @param tNfcRecord nfc巡检记录id
* @return 结果
*/
@Override
public
int
updateTNfcRecord
(
TNfcRecord
tNfcRecord
)
{
return
tNfcRecordMapper
.
updateTNfcRecord
(
tNfcRecord
);
}
/**
* 批量删除nfc巡检记录id
*
* @param recordIds 需要删除的nfc巡检记录idID
* @return 结果
*/
@Override
public
int
deleteTNfcRecordByIds
(
Long
[]
recordIds
)
{
return
tNfcRecordMapper
.
deleteTNfcRecordByIds
(
recordIds
);
}
/**
* 删除nfc巡检记录id信息
*
* @param recordId nfc巡检记录idID
* @return 结果
*/
@Override
public
int
deleteTNfcRecordById
(
Long
recordId
)
{
return
tNfcRecordMapper
.
deleteTNfcRecordById
(
recordId
);
}
}
danger-manage-system/src/main/resources/mapper/system/TNfcRecordMapper.xml
0 → 100644
View file @
2f37381e
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.zehong.system.mapper.TNfcRecordMapper"
>
<resultMap
type=
"TNfcRecord"
id=
"TNfcRecordResult"
>
<result
property=
"recordId"
column=
"record_id"
/>
<result
property=
"nfcId"
column=
"nfc_id"
/>
<result
property=
"isNormal"
column=
"is_normal"
/>
<result
property=
"picture"
column=
"picture"
/>
<result
property=
"remarks"
column=
"remarks"
/>
<result
property=
"createTime"
column=
"create_time"
/>
<result
property=
"createUser"
column=
"create_user"
/>
<result
property=
"userName"
column=
"userName"
/>
<result
property=
"patrolAddress"
column=
"patrol_address"
/>
<result
property=
"patrolComent"
column=
"patrol_coment"
/>
<result
property=
"patrolFrequency"
column=
"patrol_frequency"
/>
</resultMap>
<sql
id=
"selectTNfcRecordVo"
>
select record_id, nfc_id, is_normal, picture, remarks, create_time, create_user from t_nfc_record
</sql>
<select
id=
"selectTNfcRecordList"
parameterType=
"TNfcRecord"
resultMap=
"TNfcRecordResult"
>
SELECT nr.record_id, nr.nfc_id, nr.is_normal, nr.picture, nr.remarks, nr.create_time, nr.create_user,
u.`user_name` AS userName,
ns.`patrol_address` ,ns.`patrol_coment`,ns.`patrol_frequency`
FROM t_nfc_record nr LEFT JOIN t_nfc_setting ns ON ns.`nfc_id` = nr.`nfc_id`
LEFT JOIN sys_user u ON u.user_id = nr.create_user
<where>
<if
test=
"nfcId != null "
>
and nr.nfc_id = #{nfcId}
</if>
<if
test=
"isNormal != null "
>
and nr.is_normal = #{isNormal}
</if>
<if
test=
"picture != null and picture != ''"
>
and nr.picture = #{picture}
</if>
<if
test=
"remarks != null and remarks != ''"
>
and nr.remarks = #{remarks}
</if>
<if
test=
"createUser != null and createUser != ''"
>
and nr.create_user = #{createUser}
</if>
<if
test=
"startTime != null and startTime != ''"
>
and nr.create_time
>
#{startTime}
</if>
<if
test=
"endTime != null and endTime != ''"
>
and nr.create_time
<
#{endTime}
</if>
</where>
order By nr.create_time desc
</select>
<select
id=
"selectTNfcRecordById"
parameterType=
"Long"
resultMap=
"TNfcRecordResult"
>
<include
refid=
"selectTNfcRecordVo"
/>
where record_id = #{recordId}
</select>
<insert
id=
"insertTNfcRecord"
parameterType=
"TNfcRecord"
useGeneratedKeys=
"true"
keyProperty=
"recordId"
>
insert into t_nfc_record
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"nfcId != null"
>
nfc_id,
</if>
<if
test=
"isNormal != null"
>
is_normal,
</if>
<if
test=
"picture != null"
>
picture,
</if>
<if
test=
"remarks != null"
>
remarks,
</if>
<if
test=
"createTime != null"
>
create_time,
</if>
<if
test=
"createUser != null"
>
create_user,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"nfcId != null"
>
#{nfcId},
</if>
<if
test=
"isNormal != null"
>
#{isNormal},
</if>
<if
test=
"picture != null"
>
#{picture},
</if>
<if
test=
"remarks != null"
>
#{remarks},
</if>
<if
test=
"createTime != null"
>
#{createTime},
</if>
<if
test=
"createUser != null"
>
#{createUser},
</if>
</trim>
</insert>
<update
id=
"updateTNfcRecord"
parameterType=
"TNfcRecord"
>
update t_nfc_record
<trim
prefix=
"SET"
suffixOverrides=
","
>
<if
test=
"nfcId != null"
>
nfc_id = #{nfcId},
</if>
<if
test=
"isNormal != null"
>
is_normal = #{isNormal},
</if>
<if
test=
"picture != null"
>
picture = #{picture},
</if>
<if
test=
"remarks != null"
>
remarks = #{remarks},
</if>
<if
test=
"createTime != null"
>
create_time = #{createTime},
</if>
<if
test=
"createUser != null"
>
create_user = #{createUser},
</if>
</trim>
where record_id = #{recordId}
</update>
<delete
id=
"deleteTNfcRecordById"
parameterType=
"Long"
>
delete from t_nfc_record where record_id = #{recordId}
</delete>
<delete
id=
"deleteTNfcRecordByIds"
parameterType=
"String"
>
delete from t_nfc_record where record_id in
<foreach
item=
"recordId"
collection=
"array"
open=
"("
separator=
","
close=
")"
>
#{recordId}
</foreach>
</delete>
</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