Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
ydsj_tp
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
jiangyun
ydsj_tp
Commits
0e20ae80
Commit
0e20ae80
authored
Oct 18, 2024
by
wangqi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
投选日期,及主键修改
parent
c5c4bfcb
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
10 deletions
+21
-10
ruoyi-admin/src/main/java/com/ruoyi/system/mapper/TpInfoMapper.java
+3
-1
ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/TpInfoServiceImpl.java
+16
-7
ruoyi-admin/src/main/resources/mapper/system/TpInfoMapper.xml
+2
-2
No files found.
ruoyi-admin/src/main/java/com/ruoyi/system/mapper/TpInfoMapper.java
View file @
0e20ae80
package
com
.
ruoyi
.
system
.
mapper
;
import
java.util.List
;
import
java.util.Map
;
import
com.ruoyi.system.domain.TpInfo
;
import
com.ruoyi.system.domain.TpInfoCb
;
...
...
@@ -85,7 +87,7 @@ public interface TpInfoMapper
*/
public
int
deleteTpInfoCbByZbid
(
Long
id
);
TpInfo
selectTpInfoByIp
(
String
i
p
);
TpInfo
selectTpInfoByIp
(
Map
ma
p
);
List
<
TpInfo
>
selectTpInfoListjg
(
TpInfo
tpInfo
);
...
...
ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/TpInfoServiceImpl.java
View file @
0e20ae80
...
...
@@ -2,8 +2,7 @@ package com.ruoyi.system.service.impl;
import
java.net.Inet4Address
;
import
java.net.UnknownHostException
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.*
;
import
com.ruoyi.common.core.domain.AjaxResult
;
import
com.ruoyi.common.utils.DateUtils
;
...
...
@@ -12,7 +11,6 @@ import com.ruoyi.system.domain.TpDept;
import
com.ruoyi.system.mapper.TpDeptMapper
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.ArrayList
;
import
com.ruoyi.common.utils.StringUtils
;
import
org.springframework.transaction.annotation.Transactional
;
import
com.ruoyi.system.domain.TpInfoCb
;
...
...
@@ -69,7 +67,7 @@ public class TpInfoServiceImpl implements ITpInfoService
@Override
public
AjaxResult
insertTpInfo
(
TpInfo
tpInfo
)
throws
UnknownHostException
{
Date
nowDate
=
DateUtils
.
getNowDate
();
Date
date
=
DateUtils
.
dateTime
(
"yyyy-MM-dd"
,
"2024-10-2
0
"
);
Date
date
=
DateUtils
.
dateTime
(
"yyyy-MM-dd"
,
"2024-10-2
2
"
);
if
(
nowDate
.
after
(
date
)){
return
AjaxResult
.
error
(
"已过投票日期,不允许投票!"
);
...
...
@@ -77,10 +75,21 @@ public class TpInfoServiceImpl implements ITpInfoService
String
ipdz
=
Inet4Address
.
getLocalHost
().
getHostAddress
();
// String ip = IpUtils.getIpAddr();
String
ip
=
tpInfo
.
getIpdz
();
tpInfo
.
setIpdz
(
ip
);
String
adzh
=
tpInfo
.
getIpdz
();
// ad
String
tyzh
=
tpInfo
.
getYl1
();
// 统一
if
(
null
==
tyzh
||
""
.
equals
(
tyzh
)){
return
AjaxResult
.
error
(
"请重新登录"
);
}
if
(
null
==
adzh
||
""
.
equals
(
adzh
)){
adzh
=
tyzh
;
}
tpInfo
.
setIpdz
(
tyzh
);
//后续都存id
//根据ip查询
TpInfo
tpInfo1
=
tpInfoMapper
.
selectTpInfoByIp
(
ip
);
Map
map
=
new
HashMap
();
map
.
put
(
"adzh"
,
adzh
);
map
.
put
(
"tyzh"
,
tyzh
);
TpInfo
tpInfo1
=
tpInfoMapper
.
selectTpInfoByIp
(
map
);
if
(
tpInfo1
!=
null
){
return
AjaxResult
.
error
(
"已投票,请勿重复投票"
);
}
...
...
ruoyi-admin/src/main/resources/mapper/system/TpInfoMapper.xml
View file @
0e20ae80
...
...
@@ -63,10 +63,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
from tp_info_cb
where zbid = #{zbid}
</select>
<select
id=
"selectTpInfoByIp"
resultMap=
"TpInfoResult"
>
<select
id=
"selectTpInfoByIp"
resultMap=
"TpInfoResult"
parameterType=
"java.util.Map"
>
select id, name, sfzh, ipdz, create_by, create_time, update_by, update_time, remark, yl1, yl2, yl3, yl4, yl5
from tp_info
where
ipdz = #{ip}
where
(ipdz =#{adzh} or ipdz = #{tyzh} )
</select>
<select
id=
"selectTpInfoListjg"
resultMap=
"TpInfoResult"
>
select a.name,a.ipdz,a.create_time,GROUP_CONCAT(b.dwmc) dwmc from tp_info a left join tp_info_cb b on a.id=b.zbid
...
...
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