Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
张雷
/
skboot-zhongye
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
构建
提交
问题看板
文件
提交
网络
比较
分支
标签
6fd7ab95
由
张雷
编写于
2025-02-11 17:15:23 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
隐患风险功能流程修改、增加密码测试验证
1 个父辈
1a612ab8
隐藏空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
103 行增加
和
29 行删除
pom.xml
sk-module-biz/src/main/java/com/skua/modules/ajh/controller/AjhRectificationInfoController.java
sk-module-biz/src/main/java/com/skua/modules/ajh/mapper/xml/AjhWasteProduceMapper.xml
sk-module-biz/src/main/java/com/skua/modules/ajh/service/IAjhRectificationInfoService.java
sk-module-biz/src/main/java/com/skua/modules/ajh/service/impl/AjhRectificationInfoServiceImpl.java
sk-module-datafill/src/main/java/com/skua/modules/dataAnalysis/controller/WorkAnalysisController.java
sk-module-system/src/main/java/com/skua/modules/system/controller/LoginController.java
sk-module-system/src/main/java/com/skua/modules/system/entity/SysBaseConfig.java
pom.xml
查看文件 @
6fd7ab9
...
...
@@ -89,7 +89,7 @@
<artifactId>
artemis-http-client
</artifactId>
<version>
1.1.3
</version>
</dependency>
<dependency>
<groupId>
org.bytedeco
</groupId>
<artifactId>
javacv
</artifactId>
...
...
sk-module-biz/src/main/java/com/skua/modules/ajh/controller/AjhRectificationInfoController.java
查看文件 @
6fd7ab9
...
...
@@ -131,11 +131,24 @@ public class AjhRectificationInfoController {
@ApiOperation
(
value
=
"隐患检查-整改"
,
notes
=
"隐患检查-整改"
)
@PostMapping
(
value
=
"/mend"
)
public
Result
mend
(
@Valid
@RequestBody
AjhRectificationInfoMendDto
dto
)
{
Result
<
EmergencyRiskEvent
>
result
=
new
Result
<
EmergencyRiskEvent
>();
ajhRectificationInfoService
.
mend
(
dto
);
result
.
success
(
"处理成功!"
);
return
result
;
}
/**
* 整改完成
* @return
*/
@AutoLog
(
value
=
"隐患检查-整改完成"
)
@ApiOperation
(
value
=
"隐患检查-整改完成"
,
notes
=
"隐患检查-整改完成"
)
@PostMapping
(
value
=
"/complete-task-pass"
)
public
Result
pass
(
@Valid
@RequestBody
AjhRectificationInfo
dto
)
{
Result
<
AjhRectificationInfo
>
result
=
new
Result
<
AjhRectificationInfo
>();
boolean
ok
=
ajhRectificationInfoService
.
pass
(
dto
);
result
.
setSuccess
(
ok
);
result
.
success
(
"处理完成!"
);
return
result
;
}
...
...
sk-module-biz/src/main/java/com/skua/modules/ajh/mapper/xml/AjhWasteProduceMapper.xml
查看文件 @
6fd7ab9
...
...
@@ -11,7 +11,7 @@
p.waste_name,
LEFT ( p.pro_out_date, 7 ) AS report_month,
ROUND(ifnull(SUM( p.pro_come_count ),0) , 2) AS month_produce,
ROUND(ifnull(SUM(
p.pro
_out_count ),0) , 2) AS month_out,
ROUND(ifnull(SUM(
k.keep
_out_count ),0) , 2) AS month_out,
ROUND(ifnull(SUM( k.keep_in_count ),0) , 2) AS month_keep,
d.depart_name AS depart_name,
d.id as depart_id
...
...
@@ -44,8 +44,6 @@
p.waste_name
</select>
<select
id=
"queryPageListByYear"
resultType=
"com.skua.modules.ajh.entity.AjhWasteYearReport"
>
SELECT
p.id,
...
...
@@ -53,7 +51,7 @@
p.waste_name,
LEFT ( p.pro_out_date, 4 ) AS report_year,
ROUND(ifnull(SUM( p.pro_come_count ),0) , 2) AS year_produce,
ROUND(ifnull(SUM(
p.pro
_out_count ),0) , 2) AS year_out,
ROUND(ifnull(SUM(
k.keep
_out_count ),0) , 2) AS year_out,
ROUND(ifnull(SUM( k.keep_in_count ),0) , 2) AS year_keep,
d.depart_name AS depart_name,
d.id as depart_id
...
...
sk-module-biz/src/main/java/com/skua/modules/ajh/service/IAjhRectificationInfoService.java
查看文件 @
6fd7ab9
...
...
@@ -107,4 +107,6 @@ public interface IAjhRectificationInfoService extends IService<AjhRectificationI
* @Description: TODO(这里描述这个方法的需求变更情况)
*/
Map
<
String
,
Object
>
getStructNoHandleDetail
(
String
startTime
,
String
endTime
);
boolean
pass
(
AjhRectificationInfo
dto
);
}
...
...
sk-module-biz/src/main/java/com/skua/modules/ajh/service/impl/AjhRectificationInfoServiceImpl.java
查看文件 @
6fd7ab9
...
...
@@ -505,6 +505,15 @@ public class AjhRectificationInfoServiceImpl extends ServiceImpl<AjhRectificatio
return
map
;
}
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Override
public
boolean
pass
(
AjhRectificationInfo
updateParam
)
{
this
.
updateById
(
updateParam
);
//调用同意接口
boolean
flag
=
flowBusinessService
.
completeTask
(
ProcessConstant
.
PASS_KEY
,
updateParam
.
getFlow
());
return
flag
;
}
@Override
public
List
<
FlowProcessFormFieldInfoVO
>
buildCustomData
(
String
s
,
List
<
FlowProcessFormFieldInfoVO
>
list
)
{
for
(
FlowProcessFormFieldInfoVO
entity
:
list
)
{
...
...
sk-module-datafill/src/main/java/com/skua/modules/dataAnalysis/controller/WorkAnalysisController.java
查看文件 @
6fd7ab9
...
...
@@ -88,10 +88,10 @@ public class WorkAnalysisController {
@ApiOperation
(
value
=
"安全管理进度-数据列表"
,
notes
=
"安全管理进度-数据列表 timeType = 1 表示月份,timeType=2 表示年"
)
@GetMapping
(
"/analysisBySafeProgress"
)
public
List
<
SafeProgressVO
>
analysisBySafeProgress
(
@RequestParam
(
defaultValue
=
"1"
)
Integer
timeType
,
String
startTime
,
String
endTime
)
{
public
Result
<
List
<
SafeProgressVO
>>
analysisBySafeProgress
(
@RequestParam
(
defaultValue
=
"1"
)
Integer
timeType
,
String
startTime
,
String
endTime
)
{
Result
<
List
<
SafeProgressVO
>>
result
=
new
Result
<>();
JdbcTemplate
jdbcTemplate
=
(
JdbcTemplate
)
SpringContextUtils
.
getBean
(
"master"
);
String
departIds
=
null
;
String
sql
=
"select d.id 'depart_id' , d.depart_name , ifnull(aaa.count,0) 'meet_num', ifnull(bbb.count,0) 'meet_total', ifnull(ccc.count,0) 'exam_num', ifnull(ddd.count,0) 'exam_total',ifnull(eee.count, 0) 'frequency_num' , ifnull(fff.count , 0) 'frequency_total'"
;
sql
+=
" from sys_depart d "
;
sql
+=
getSafeProgressSql
(
departIds
,
startTime
,
endTime
);
...
...
@@ -102,12 +102,14 @@ public class WorkAnalysisController {
sql
+=
" order by (ifnull(aaa.count,0) + ifnull(bbb.count,0) + ifnull(ccc.count,0) + ifnull(ddd.count,0) + ifnull(fff.count,0) ) asc "
;
System
.
out
.
println
(
"sql = "
+
sql
);
List
<
SafeProgressVO
>
dataList
=
jdbcTemplate
.
query
(
sql
,
new
BeanPropertyRowMapper
<
SafeProgressVO
>(
SafeProgressVO
.
class
));
return
dataList
;
result
.
setResult
(
dataList
);
result
.
setSuccess
(
true
);
return
result
;
}
@ApiOperation
(
value
=
"安全管理进度统计-数量统计"
,
notes
=
"安全管理进度-数量统计 timeType = 1 表示月份,timeType=2 表示年"
)
@GetMapping
(
"/analysisTotalBySafeProgress"
)
public
SafeProgressVO
analysisTotalBySafeProgress
(
@RequestParam
(
defaultValue
=
"1"
)
Integer
timeType
,
String
startTime
,
String
endTime
)
{
public
Result
<
SafeProgressVO
>
analysisTotalBySafeProgress
(
@RequestParam
(
defaultValue
=
"1"
)
Integer
timeType
,
String
startTime
,
String
endTime
)
{
Result
<
SafeProgressVO
>
result
=
new
Result
<>();
String
departIds
=
null
;
//DAY(LAST_DAY('"+startTime+"'))
String
sql
=
"select count(d.id) 'departNum', ifnull(sum(aaa.count),0) 'meet_num' ,ifnull(sum(bbb.count),0) 'meet_total' ,ifnull(sum(ccc.count),0) 'exam_num' ,ifnull(sum(ddd.count),0) 'exam_total',ifnull(sum(eee.count),0) 'frequency_num' ,ifnull(sum(fff.count),0) 'frequency_total' "
;
sql
+=
" from sys_depart d "
;
...
...
@@ -120,9 +122,10 @@ public class WorkAnalysisController {
JdbcTemplate
jdbcTemplate
=
(
JdbcTemplate
)
SpringContextUtils
.
getBean
(
"master"
);
List
<
SafeProgressVO
>
dataList
=
jdbcTemplate
.
query
(
sql
,
new
BeanPropertyRowMapper
<
SafeProgressVO
>(
SafeProgressVO
.
class
));
if
(
dataList
!=
null
&&
!
dataList
.
isEmpty
()){
return
dataList
.
get
(
0
);
result
.
setResult
(
dataList
.
get
(
0
));
result
.
setSuccess
(
true
);
}
return
null
;
return
result
;
}
private
String
getSafeProgressSql
(
String
departIds
,
String
startTime
,
String
endTime
){
JdbcTemplate
jdbcTemplate
=
(
JdbcTemplate
)
SpringContextUtils
.
getBean
(
"master"
);
...
...
sk-module-system/src/main/java/com/skua/modules/system/controller/LoginController.java
查看文件 @
6fd7ab9
...
...
@@ -11,6 +11,8 @@ import java.util.Objects;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
cn.hutool.core.util.ObjectUtil
;
import
com.skua.core.context.SpringContextUtils
;
import
com.skua.core.util.encryption.MD5Util
;
import
com.skua.modules.common.vo.AliCode
;
import
com.skua.modules.system.vo.SsoLogin
;
...
...
@@ -82,43 +84,87 @@ public class LoginController {
SysUserDepartServiceImpl
sysUserDepartService
;
@Autowired
private
ISysBaseConfigService
sysBaseConfigService
;
private
final
String
ERRORLOGIN
=
"errorLogin"
;
private
static
Integer
ERROR_TOTAL
=
5
;
//允许错误次数
@RequestMapping
(
value
=
"/login"
,
method
=
RequestMethod
.
POST
)
//@ApiOperation("登录接口")
public
Result
<
JSONObject
>
login
(
@RequestBody
SysLoginModel
sysLoginModel
)
throws
Exception
{
public
Result
<
JSONObject
>
login
(
@RequestBody
SysLoginModel
sysLoginModel
)
{
Result
<
JSONObject
>
result
=
new
Result
<
JSONObject
>();
String
username
=
sysLoginModel
.
getUsername
();
String
password
=
sysLoginModel
.
getPassword
();
//update-begin--Author:scott Date:20190805 for:暂时注释掉密码加密逻辑,有点问题
//前端密码加密,后端进行密码解密
//password = AesEncryptUtil.desEncrypt(sysLoginModel.getPassword().replaceAll("%2B", "\\+")).trim();//密码解密
//update-begin--Author:scott Date:20190805 for:暂时注释掉密码加密逻辑,有点问题
//1. 校验用户是否有效
SysUser
sysUser
=
sysUserService
.
getUserByName
(
username
);
result
=
sysUserService
.
checkUserIsEffective
(
sysUser
);
if
(!
result
.
isSuccess
())
{
return
result
;
}
//2. 校验用户名或密码是否正确
String
userpassword
=
PasswordUtil
.
encrypt
(
username
,
password
,
sysUser
.
getSalt
());
String
syspassword
=
sysUser
.
getPassword
();
if
(!
syspassword
.
equals
(
userpassword
))
{
result
.
error500
(
"用户名或密码错误"
);
return
result
;
//是否启用密码错误次数验证
boolean
errorNumCheck
=
false
;
SysBaseConfig
sysBaseConfig
=
sysBaseConfigService
.
getOne
(
new
QueryWrapper
<>());
if
(
sysBaseConfig
!=
null
){
ERROR_TOTAL
=
sysBaseConfig
.
getPasswordErrorNum
();
if
(
"1"
.
equals
(
sysBaseConfig
.
getErrorNumVerification
())){
errorNumCheck
=
true
;
}
}
if
(
errorNumCheck
){
if
(!
syspassword
.
equals
(
userpassword
))
{
//登录失败处理
Integer
errorNum
=
failureHandling
(
sysUser
);
int
errNum2
=
ERROR_TOTAL
-
errorNum
;
result
.
error500
(
"用户名或密码错误,已连续失败"
+
errorNum
+
"次,剩余"
+
errNum2
+
"次将被冻结!"
);
return
result
;
}
else
{
resetErrorNum
(
username
);
}
}
else
{
if
(!
syspassword
.
equals
(
userpassword
))
{
result
.
error500
(
"用户名或密码错误!"
);
return
result
;
}
}
//用户登录信息
userInfo
(
sysUser
,
result
);
sysBaseAPI
.
addLog
(
"用户名: "
+
username
+
",登录成功!"
,
CommonConstant
.
LOG_TYPE_1
,
null
);
return
result
;
}
/**
* 密码错误数量统计
* @param user
* @return
*/
private
Integer
failureHandling
(
SysUser
user
){
String
username
=
user
.
getUsername
();
Integer
errNum
=
(
Integer
)
redisUtil
.
get
(
ERRORLOGIN
+
username
);
if
(
ObjectUtil
.
isEmpty
(
errNum
))
{
redisUtil
.
set
(
ERRORLOGIN
+
username
,
1
,
300
);
}
else
{
errNum
++;
if
(
errNum
>=
ERROR_TOTAL
){
redisUtil
.
del
(
ERRORLOGIN
+
username
);
user
.
setStatus
(
2
);
sysUserService
.
updateById
(
user
);
}
else
{
redisUtil
.
set
(
ERRORLOGIN
+
username
,
errNum
);
}
}
return
errNum
;
}
/**
* 重置用户连续登录失败次数
*/
private
void
resetErrorNum
(
String
username
){
redisUtil
.
set
(
ERRORLOGIN
+
username
,
0
);
}
@RequestMapping
(
value
=
"/appLogin"
,
method
=
RequestMethod
.
POST
)
//@ApiOperation("APP登录接口")
public
Result
<
SysAppUserInfo
>
appLogin
(
@RequestBody
SysLoginModel
sysLoginModel
)
throws
Exception
{
public
Result
<
SysAppUserInfo
>
appLogin
(
@RequestBody
SysLoginModel
sysLoginModel
)
{
Result
<
SysAppUserInfo
>
result
=
new
Result
<
SysAppUserInfo
>();
String
username
=
sysLoginModel
.
getUsername
();
String
password
=
sysLoginModel
.
getPassword
();
...
...
sk-module-system/src/main/java/com/skua/modules/system/entity/SysBaseConfig.java
查看文件 @
6fd7ab9
...
...
@@ -24,7 +24,7 @@ import org.jeecgframework.poi.excel.annotation.Excel;
@Accessors
(
chain
=
true
)
@ApiModel
(
value
=
"sys_base_config对象"
,
description
=
"基础信息配置"
)
public
class
SysBaseConfig
{
/**主键*/
@TableId
(
type
=
IdType
.
ID_WORKER_STR
)
@ApiModelProperty
(
value
=
"主键"
)
...
...
@@ -71,7 +71,10 @@ public class SysBaseConfig {
@Excel
(
name
=
"版权信息"
,
width
=
15
)
@ApiModelProperty
(
value
=
"版权信息"
)
private
java
.
lang
.
String
copyrightInformation
;
@ApiModelProperty
(
value
=
"数字孪生像素流地址"
)
private
java
.
lang
.
String
pixelStreamPath
;
@ApiModelProperty
(
value
=
"密码错误次数限制"
)
private
java
.
lang
.
Integer
passwordErrorNum
;
@ApiModelProperty
(
value
=
"密码错误次数校验"
)
private
java
.
lang
.
String
errorNumVerification
;
}
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论