Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
H
hzsomms
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
ZTGK
hzsomms
Commits
305ac4e7
Commit
305ac4e7
authored
Jul 05, 2024
by
hkl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:1.新需求提交
parent
4c309cd1
Changes
19
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
631 additions
and
254 deletions
+631
-254
CommonConstant.java
...c/main/java/org/jeecg/common/constant/CommonConstant.java
+266
-183
Swagger2Config.java
...e-core/src/main/java/org/jeecg/config/Swagger2Config.java
+2
-0
AnalysisAlgorithm.java
...es/dynamicStaticAnalysis/algorithm/AnalysisAlgorithm.java
+5
-4
IamServiceImpl.java
...va/org/jeecg/modules/iam/service/impl/IamServiceImpl.java
+12
-2
WorkBatchController.java
...dules/maintenanceWork/controller/WorkBatchController.java
+15
-0
WorkBatchMapper.java
...jeecg/modules/maintenanceWork/mapper/WorkBatchMapper.java
+3
-0
WorkBatchMapper.xml
...cg/modules/maintenanceWork/mapper/xml/WorkBatchMapper.xml
+15
-0
IWorkBatchService.java
...cg/modules/maintenanceWork/service/IWorkBatchService.java
+3
-0
WorkBatchServiceImpl.java
...es/maintenanceWork/service/impl/WorkBatchServiceImpl.java
+6
-0
WorkBatchUserVO.java
...org/jeecg/modules/maintenanceWork/vo/WorkBatchUserVO.java
+21
-0
CommonController.java
...org/jeecg/modules/system/controller/CommonController.java
+1
-1
LoginController.java
.../org/jeecg/modules/system/controller/LoginController.java
+9
-0
SysUserController.java
...rg/jeecg/modules/system/controller/SysUserController.java
+246
-50
SysUser.java
...rc/main/java/org/jeecg/modules/system/entity/SysUser.java
+2
-2
application-dev.yml
jeecg-module-system/src/main/resources/application-dev.yml
+13
-6
application-prod.yml
jeecg-module-system/src/main/resources/application-prod.yml
+6
-5
application.yml
jeecg-module-system/src/main/resources/application.yml
+1
-1
用户列表.xlsx
...odule-system/src/main/resources/templates/excel/用户列表.xlsx
+0
-0
pom.xml
pom.xml
+5
-0
No files found.
jeecg-boot-base-core/src/main/java/org/jeecg/common/constant/CommonConstant.java
View file @
305ac4e7
...
...
@@ -6,133 +6,155 @@ package org.jeecg.common.constant;
*/
public
interface
CommonConstant
{
/**
* 正常状态
*/
Integer
STATUS_NORMAL
=
0
;
/**
* 禁用状态
*/
Integer
STATUS_DISABLE
=
-
1
;
/**
* 删除标志
*/
Integer
DEL_FLAG_1
=
1
;
/**
* 未删除
*/
Integer
DEL_FLAG_0
=
0
;
/**
* 系统日志类型: 登录
*/
int
LOG_TYPE_1
=
1
;
/**
* 系统日志类型: 操作
*/
int
LOG_TYPE_2
=
2
;
/**
* 操作日志类型: 查询
*/
int
OPERATE_TYPE_1
=
1
;
/**
* 操作日志类型: 添加
*/
int
OPERATE_TYPE_2
=
2
;
/**
* 操作日志类型: 更新
*/
int
OPERATE_TYPE_3
=
3
;
/**
* 操作日志类型: 删除
*/
int
OPERATE_TYPE_4
=
4
;
/**
* 操作日志类型: 倒入
*/
int
OPERATE_TYPE_5
=
5
;
/**
* 操作日志类型: 导出
*/
int
OPERATE_TYPE_6
=
6
;
/** {@code 500 Server Error} (HTTP/1.0 - RFC 1945) */
/**
* 正常状态
*/
Integer
STATUS_NORMAL
=
0
;
/**
* 禁用状态
*/
Integer
STATUS_DISABLE
=
-
1
;
/**
* 删除标志
*/
Integer
DEL_FLAG_1
=
1
;
/**
* 未删除
*/
Integer
DEL_FLAG_0
=
0
;
/**
* 系统日志类型: 登录
*/
int
LOG_TYPE_1
=
1
;
/**
* 系统日志类型: 操作
*/
int
LOG_TYPE_2
=
2
;
/**
* 操作日志类型: 查询
*/
int
OPERATE_TYPE_1
=
1
;
/**
* 操作日志类型: 添加
*/
int
OPERATE_TYPE_2
=
2
;
/**
* 操作日志类型: 更新
*/
int
OPERATE_TYPE_3
=
3
;
/**
* 操作日志类型: 删除
*/
int
OPERATE_TYPE_4
=
4
;
/**
* 操作日志类型: 倒入
*/
int
OPERATE_TYPE_5
=
5
;
/**
* 操作日志类型: 导出
*/
int
OPERATE_TYPE_6
=
6
;
/**
* {@code 500 Server Error} (HTTP/1.0 - RFC 1945)
*/
Integer
SC_INTERNAL_SERVER_ERROR_500
=
500
;
/** {@code 200 OK} (HTTP/1.0 - RFC 1945) */
/**
* {@code 200 OK} (HTTP/1.0 - RFC 1945)
*/
Integer
SC_OK_200
=
200
;
/**访问权限认证未通过 510*/
Integer
SC_JEECG_NO_AUTHZ
=
510
;
/** 登录用户Shiro权限缓存KEY前缀 */
public
static
String
PREFIX_USER_SHIRO_CACHE
=
"shiro:cache:org.jeecg.config.shiro.ShiroRealm.authorizationCache:"
;
/** 登录用户Token令牌缓存KEY前缀 */
String
PREFIX_USER_TOKEN
=
"prefix_user_token:"
;
/**
* 访问权限认证未通过 510
*/
Integer
SC_JEECG_NO_AUTHZ
=
510
;
/**
* 登录用户Shiro权限缓存KEY前缀
*/
public
static
String
PREFIX_USER_SHIRO_CACHE
=
"shiro:cache:org.jeecg.config.shiro.ShiroRealm.authorizationCache:"
;
/**
* 登录用户Token令牌缓存KEY前缀
*/
String
PREFIX_USER_TOKEN
=
"prefix_user_token:"
;
// /** Token缓存时间:3600秒即一小时 */
// int TOKEN_EXPIRE_TIME = 3600;
/** 登录二维码 */
String
LOGIN_QRCODE_PRE
=
"QRCODELOGIN:"
;
String
LOGIN_QRCODE
=
"LQ:"
;
/** 登录二维码token */
String
LOGIN_QRCODE_TOKEN
=
"LQT:"
;
/**
* 0:一级菜单
*/
Integer
MENU_TYPE_0
=
0
;
/**
* 1:子菜单
*/
Integer
MENU_TYPE_1
=
1
;
/**
* 2:按钮权限
*/
Integer
MENU_TYPE_2
=
2
;
/**通告对象类型(USER:指定用户,ALL:全体用户)*/
String
MSG_TYPE_UESR
=
"USER"
;
String
MSG_TYPE_ALL
=
"ALL"
;
/**发布状态(0未发布,1已发布,2已撤销)*/
String
NO_SEND
=
"0"
;
String
HAS_SEND
=
"1"
;
String
HAS_CANCLE
=
"2"
;
/**阅读状态(0未读,1已读)*/
String
HAS_READ_FLAG
=
"1"
;
String
NO_READ_FLAG
=
"0"
;
/**优先级(L低,M中,H高)*/
String
PRIORITY_L
=
"L"
;
String
PRIORITY_M
=
"M"
;
String
PRIORITY_H
=
"H"
;
/**
* 登录二维码
*/
String
LOGIN_QRCODE_PRE
=
"QRCODELOGIN:"
;
String
LOGIN_QRCODE
=
"LQ:"
;
/**
* 登录二维码token
*/
String
LOGIN_QRCODE_TOKEN
=
"LQT:"
;
/**
* 0:一级菜单
*/
Integer
MENU_TYPE_0
=
0
;
/**
* 1:子菜单
*/
Integer
MENU_TYPE_1
=
1
;
/**
* 2:按钮权限
*/
Integer
MENU_TYPE_2
=
2
;
/**
* 通告对象类型(USER:指定用户,ALL:全体用户)
*/
String
MSG_TYPE_UESR
=
"USER"
;
String
MSG_TYPE_ALL
=
"ALL"
;
/**
* 发布状态(0未发布,1已发布,2已撤销)
*/
String
NO_SEND
=
"0"
;
String
HAS_SEND
=
"1"
;
String
HAS_CANCLE
=
"2"
;
/**
* 阅读状态(0未读,1已读)
*/
String
HAS_READ_FLAG
=
"1"
;
String
NO_READ_FLAG
=
"0"
;
/**
* 优先级(L低,M中,H高)
*/
String
PRIORITY_L
=
"L"
;
String
PRIORITY_M
=
"M"
;
String
PRIORITY_H
=
"H"
;
/**
* 短信模板方式 0 .登录模板、1.注册模板、2.忘记密码模板
*/
String
SMS_TPL_TYPE_0
=
"0"
;
String
SMS_TPL_TYPE_1
=
"1"
;
String
SMS_TPL_TYPE_2
=
"2"
;
String
SMS_TPL_TYPE_0
=
"0"
;
String
SMS_TPL_TYPE_1
=
"1"
;
String
SMS_TPL_TYPE_2
=
"2"
;
/**
* 状态(0无效1有效)
*/
String
STATUS_0
=
"0"
;
String
STATUS_1
=
"1"
;
/**
* 同步工作流引擎1同步0不同步
*/
...
...
@@ -144,7 +166,7 @@ public interface CommonConstant {
*/
String
MSG_CATEGORY_1
=
"1"
;
String
MSG_CATEGORY_2
=
"2"
;
/**
* 是否配置菜单的数据权限 1是0否
*/
...
...
@@ -157,8 +179,15 @@ public interface CommonConstant {
Integer
USER_UNFREEZE
=
1
;
Integer
USER_FREEZE
=
2
;
Integer
USER_QUIT
=
3
;
/**字典翻译文本后缀*/
/**
* 默认密码
*/
String
DEFAULT_PASSWORD
=
"Gw@123456+"
;
/**
* 字典翻译文本后缀
*/
String
DICT_TEXT_SUFFIX
=
"_dictText"
;
/**
...
...
@@ -234,26 +263,46 @@ public interface CommonConstant {
Integer
USER_IDENTITY_1
=
1
;
Integer
USER_IDENTITY_2
=
2
;
/** sys_user 表 username 唯一键索引 */
/**
* sys_user 表 username 唯一键索引
*/
String
SQL_INDEX_UNIQ_SYS_USER_USERNAME
=
"uniq_sys_user_username"
;
/** sys_user 表 work_no 唯一键索引 */
/**
* sys_user 表 work_no 唯一键索引
*/
String
SQL_INDEX_UNIQ_SYS_USER_WORK_NO
=
"uniq_sys_user_work_no"
;
/** sys_user 表 phone 唯一键索引 */
/**
* sys_user 表 phone 唯一键索引
*/
String
SQL_INDEX_UNIQ_SYS_USER_PHONE
=
"uniq_sys_user_phone"
;
/** 达梦数据库升提示。违反表[SYS_USER]唯一性约束 */
/**
* 达梦数据库升提示。违反表[SYS_USER]唯一性约束
*/
String
SQL_INDEX_UNIQ_SYS_USER
=
"唯一性约束"
;
/** sys_user 表 email 唯一键索引 */
/**
* sys_user 表 email 唯一键索引
*/
String
SQL_INDEX_UNIQ_SYS_USER_EMAIL
=
"uniq_sys_user_email"
;
/** sys_quartz_job 表 job_class_name 唯一键索引 */
/**
* sys_quartz_job 表 job_class_name 唯一键索引
*/
String
SQL_INDEX_UNIQ_JOB_CLASS_NAME
=
"uniq_job_class_name"
;
/** sys_position 表 code 唯一键索引 */
/**
* sys_position 表 code 唯一键索引
*/
String
SQL_INDEX_UNIQ_CODE
=
"uniq_code"
;
/** sys_role 表 code 唯一键索引 */
/**
* sys_role 表 code 唯一键索引
*/
String
SQL_INDEX_UNIQ_SYS_ROLE_CODE
=
"uniq_sys_role_role_code"
;
/** sys_depart 表 code 唯一键索引 */
/**
* sys_depart 表 code 唯一键索引
*/
String
SQL_INDEX_UNIQ_DEPART_ORG_CODE
=
"uniq_depart_org_code"
;
/** sys_category 表 code 唯一键索引 */
/**
* sys_category 表 code 唯一键索引
*/
String
SQL_INDEX_UNIQ_CATEGORY_CODE
=
"idx_sc_code"
;
/**
* 在线聊天 是否为默认分组
...
...
@@ -293,7 +342,7 @@ public interface CommonConstant {
* 公文文档上传自定义路径
*/
String
UPLOAD_CUSTOM_PATH_OFFICIAL
=
"officialdoc"
;
/**
/**
* 公文文档下载自定义路径
*/
String
DOWNLOAD_CUSTOM_PATH_OFFICIAL
=
"officaldown"
;
...
...
@@ -301,8 +350,8 @@ public interface CommonConstant {
/**
* WPS存储值类别(1 code文号 2 text(WPS模板还是公文发文模板))
*/
String
WPS_TYPE_1
=
"1"
;
String
WPS_TYPE_2
=
"2"
;
String
WPS_TYPE_1
=
"1"
;
String
WPS_TYPE_2
=
"2"
;
/**===============================================================================================*/
...
...
@@ -313,9 +362,13 @@ public interface CommonConstant {
String
X_ACCESS_TOKEN
=
"X-Access-Token"
;
String
X_SIGN
=
"X-Sign"
;
String
X_TIMESTAMP
=
"X-TIMESTAMP"
;
/** 租户请求头 更名为:X-Tenant-Id */
/**
* 租户请求头 更名为:X-Tenant-Id
*/
String
TENANT_ID
=
"X-Tenant-Id"
;
/**===============================================================================================*/
/**
* ===============================================================================================
*/
String
TOKEN_IS_INVALID_MSG
=
"Token失效,请重新登录!"
;
String
X_FORWARDED_SCHEME
=
"X-Forwarded-Scheme"
;
...
...
@@ -340,39 +393,63 @@ public interface CommonConstant {
*/
String
THIRD_SYNC_TO_LOCAL
=
"SYNC_TO_LOCAL"
;
/** 系统通告消息状态:0=未发布 */
/**
* 系统通告消息状态:0=未发布
*/
String
ANNOUNCEMENT_SEND_STATUS_0
=
"0"
;
/** 系统通告消息状态:1=已发布 */
/**
* 系统通告消息状态:1=已发布
*/
String
ANNOUNCEMENT_SEND_STATUS_1
=
"1"
;
/** 系统通告消息状态:2=已撤销 */
/**
* 系统通告消息状态:2=已撤销
*/
String
ANNOUNCEMENT_SEND_STATUS_2
=
"2"
;
/**ONLINE 报表权限用 从request中获取地址栏后的参数*/
String
ONL_REP_URL_PARAM_STR
=
"onlRepUrlParamStr"
;
/**
* ONLINE 报表权限用 从request中获取地址栏后的参数
*/
String
ONL_REP_URL_PARAM_STR
=
"onlRepUrlParamStr"
;
/**POST请求*/
/**
* POST请求
*/
String
HTTP_POST
=
"POST"
;
/**PUT请求*/
/**
* PUT请求
*/
String
HTTP_PUT
=
"PUT"
;
/**PATCH请求*/
/**
* PATCH请求
*/
String
HTTP_PATCH
=
"PATCH"
;
/**未知的*/
/**
* 未知的
*/
String
UNKNOWN
=
"unknown"
;
/**字符串http*/
/**
* 字符串http
*/
String
STR_HTTP
=
"http"
;
/**String 类型的空值*/
/**
* String 类型的空值
*/
String
STRING_NULL
=
"null"
;
/**前端vue3版本Header参数名*/
String
VERSION
=
"X-Version"
;
/**
* 前端vue3版本Header参数名
*/
String
VERSION
=
"X-Version"
;
/**存储在线程变量里的动态表名*/
String
DYNAMIC_TABLE_NAME
=
"DYNAMIC_TABLE_NAME"
;
/**
* 存储在线程变量里的动态表名
*/
String
DYNAMIC_TABLE_NAME
=
"DYNAMIC_TABLE_NAME"
;
/**
* http:// http协议
*/
...
...
@@ -382,10 +459,14 @@ public interface CommonConstant {
* https:// https协议
*/
String
HTTPS_PROTOCOL
=
"https://"
;
/** 部门表唯一key,id */
/**
* 部门表唯一key,id
*/
String
DEPART_KEY_ID
=
"id"
;
/** 部门表唯一key,orgCode */
/**
* 部门表唯一key,orgCode
*/
String
DEPART_KEY_ORG_CODE
=
"orgCode"
;
/**
...
...
@@ -418,7 +499,9 @@ public interface CommonConstant {
*/
String
DATA_LOG_TYPE_JSON
=
"json"
;
/** 消息模板:markdown */
/**
* 消息模板:markdown
*/
String
MSG_TEMPLATE_TYPE_MD
=
"5"
;
/**
...
...
@@ -456,38 +539,38 @@ public interface CommonConstant {
*/
Integer
BPM_USER_EVENT_ADD
=
1
;
/**
* 离职事件
*/
/**
* 离职事件
*/
Integer
BPM_USER_EVENT_LEVEL
=
2
;
/**
* 用户租户状态(正常/已通过审核的)
*/
String
USER_TENANT_NORMAL
=
"1"
;
/**
* 用户租户状态(离职)
*/
String
USER_TENANT_QUIT
=
"2"
;
/**
* 用户租户状态(审核中)
*/
String
USER_TENANT_UNDER_REVIEW
=
"3"
;
/**
* 用户租户状态(拒绝)
*/
String
USER_TENANT_REFUSE
=
"4"
;
/**
* 不是叶子节点
*/
Integer
NOT_LEAF
=
0
;
/**
* 是叶子节点
*/
Integer
IS_LEAF
=
1
;
/**
* 用户租户状态(正常/已通过审核的)
*/
String
USER_TENANT_NORMAL
=
"1"
;
/**
* 用户租户状态(离职)
*/
String
USER_TENANT_QUIT
=
"2"
;
/**
* 用户租户状态(审核中)
*/
String
USER_TENANT_UNDER_REVIEW
=
"3"
;
/**
* 用户租户状态(拒绝)
*/
String
USER_TENANT_REFUSE
=
"4"
;
/**
* 不是叶子节点
*/
Integer
NOT_LEAF
=
0
;
/**
* 是叶子节点
*/
Integer
IS_LEAF
=
1
;
}
jeecg-boot-base-core/src/main/java/org/jeecg/config/Swagger2Config.java
View file @
305ac4e7
...
...
@@ -9,6 +9,7 @@ import org.springframework.beans.factory.config.BeanPostProcessor;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Import
;
import
org.springframework.context.annotation.Profile
;
import
org.springframework.util.ReflectionUtils
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry
;
...
...
@@ -40,6 +41,7 @@ import java.util.stream.Collectors;
@EnableSwagger2
//开启 Swagger2
@EnableKnife4j
//开启 knife4j,可以不写
@Import
(
BeanValidatorPluginsConfiguration
.
class
)
@Profile
(
"!prod"
)
public
class
Swagger2Config
implements
WebMvcConfigurer
{
/**
...
...
jeecg-module-system/src/main/java/org/jeecg/modules/dynamicStaticAnalysis/algorithm/AnalysisAlgorithm.java
View file @
305ac4e7
...
...
@@ -583,7 +583,7 @@ public class AnalysisAlgorithm {
}
// 2.循环遍历单元设备
中心里程落在检查项目【开始-结束】这个区间视为这个区间的单元设备
// 2.循环遍历单元设备
测点里程落在单元【开始-结束】这个区间视为这个区间的单元设备检查数据
List
<
MovementAdditiveInfoUnitDeviceMap
>
additiveInfoUnitMaps
=
new
ArrayList
<>();
int
analysisType
=
analysisBatch
.
getAnalysisType
();
for
(
Map
<
String
,
Object
>
unitDevice
:
unitDeviceList
)
{
...
...
@@ -1379,9 +1379,10 @@ public class AnalysisAlgorithm {
/**
* 创建轨检车测点得分
*/
private
AnalysisBatchUnitDevicePointScore
createRailVehicleCheckTransfinitePointScore
(
AnalysisBatch
analysisBatch
,
List
<
MovementOverReport
>
currentUnitDeviceOverReportList
,
String
overrunType
,
BigDecimal
weightValue
)
{
private
AnalysisBatchUnitDevicePointScore
createRailVehicleCheckTransfinitePointScore
(
AnalysisBatch
analysisBatch
,
List
<
MovementOverReport
>
currentUnitDeviceOverReportList
,
String
overrunType
,
BigDecimal
weightValue
)
{
if
(
ObjectUtil
.
isEmpty
(
currentUnitDeviceOverReportList
))
{
return
null
;
}
...
...
jeecg-module-system/src/main/java/org/jeecg/modules/iam/service/impl/IamServiceImpl.java
View file @
305ac4e7
...
...
@@ -4,7 +4,9 @@ import org.jeecg.common.constant.CommonConstant;
import
org.jeecg.common.exception.JeecgBootException
;
import
org.jeecg.common.system.util.JwtUtil
;
import
org.jeecg.common.system.vo.LoginUser
;
import
org.jeecg.common.util.PasswordUtil
;
import
org.jeecg.common.util.RedisUtil
;
import
org.jeecg.common.util.oConvertUtils
;
import
org.jeecg.modules.base.service.BaseCommonService
;
import
org.jeecg.modules.iam.dto.IamResponseDTO
;
import
org.jeecg.modules.iam.req.IamReq
;
...
...
@@ -25,6 +27,8 @@ import org.springframework.stereotype.Service;
import
javax.annotation.Resource
;
import
java.util.List
;
import
static
org
.
jeecg
.
common
.
constant
.
CommonConstant
.
DEFAULT_PASSWORD
;
@Service
public
class
IamServiceImpl
implements
IamService
{
...
...
@@ -76,9 +80,14 @@ public class IamServiceImpl implements IamService {
currentUser
=
new
SysUser
();
currentUser
.
setUsername
(
loginInfo
.
getUserCode
());
currentUser
.
setRealname
(
loginInfo
.
getUserName
());
currentUser
.
setPassword
(
"123456"
);
currentUser
.
setWorkNo
(
loginInfo
.
getUserCode
());
currentUser
.
setDelFlag
(
0
);
String
salt
=
oConvertUtils
.
randomGen
(
8
);
currentUser
.
setSalt
(
salt
);
//加盐
String
passwordEncode
=
PasswordUtil
.
encrypt
(
loginInfo
.
getUserCode
(),
DEFAULT_PASSWORD
,
salt
);
currentUser
.
setPassword
(
passwordEncode
);
// 默认密码
currentUser
.
setUserIdentity
(
1
);
// 正式员工身份
currentUser
.
setWorkNo
(
loginInfo
.
getUserCode
());
currentUser
.
setDelFlag
(
CommonConstant
.
DEL_FLAG_0
);
currentUser
.
setLoginTenantId
(
0
);
currentUser
.
setStatus
(
CommonConstant
.
USER_UNFREEZE
);
sysUserService
.
save
(
currentUser
);
...
...
@@ -94,6 +103,7 @@ public class IamServiceImpl implements IamService {
SysUserRole
sysUserRole
=
new
SysUserRole
();
sysUserRole
.
setRoleId
(
role
.
getId
());
sysUserRole
.
setUserId
(
currentUser
.
getId
());
sysUserRole
.
setTenantId
(
0
);
sysUserRoleService
.
save
(
sysUserRole
);
}
...
...
jeecg-module-system/src/main/java/org/jeecg/modules/maintenanceWork/controller/WorkBatchController.java
View file @
305ac4e7
...
...
@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiParam
;
import
org.jeecg.common.api.vo.Result
;
import
org.jeecg.common.aspect.annotation.AutoLog
;
import
org.jeecg.common.exception.JeecgBootException
;
...
...
@@ -15,6 +16,7 @@ import org.jeecg.modules.maintenanceWork.entity.WorkBatch;
import
org.jeecg.modules.maintenanceWork.entity.WorkBatchDetail
;
import
org.jeecg.modules.maintenanceWork.service.IWorkBatchService
;
import
org.jeecg.modules.maintenanceWork.vo.WorkBatchDetailModifyVO
;
import
org.jeecg.modules.maintenanceWork.vo.WorkBatchUserVO
;
import
org.jeecg.modules.maintenanceWork.vo.WorkBatchVO
;
import
org.jeecg.modules.maintenanceWork.service.IWorkBatchDetailService
;
import
org.jeecg.modules.maintenanceWork.service.IWorkBatchDetailModifyService
;
...
...
@@ -57,6 +59,18 @@ public class WorkBatchController extends JeecgController<WorkBatch, IWorkBatchSe
return
Result
.
OK
(
pageData
);
}
@AutoLog
(
value
=
"维修作业管理-作业计划批次管理-获取派工用户"
)
@ApiOperation
(
value
=
"维修作业管理-作业计划批次管理-获取派工用户"
,
notes
=
"维修作业管理-作业计划批次管理-获取派工用户"
)
@GetMapping
(
value
=
"/listUser"
)
@ApiParam
(
name
=
"query"
,
value
=
"查询名称/账号"
,
required
=
true
)
public
Result
<
List
<
WorkBatchUserVO
>>
listUser
(
String
query
)
{
List
<
WorkBatchUserVO
>
userList
=
this
.
service
.
listUser
(
query
);
return
Result
.
OK
(
userList
);
}
@AutoLog
(
value
=
"维修作业管理-作业计划批次管理-维修作业管理页面新增"
)
@ApiOperation
(
value
=
"维修作业管理-作业计划批次管理-维修作业管理页面新增"
,
notes
=
"维修作业管理-作业计划批次管理-维修作业管理页面新增"
)
@PostMapping
(
value
=
"/saveRecord"
)
...
...
@@ -76,6 +90,7 @@ public class WorkBatchController extends JeecgController<WorkBatch, IWorkBatchSe
return
Result
.
OK
(
"操作成功"
);
}
@AutoLog
(
value
=
"维修作业管理-作业计划批次管理-超限页面新增"
)
@ApiOperation
(
value
=
"维修作业管理-作业计划批次管理-超限页面新增"
,
notes
=
"维修作业管理-作业计划批次管理-超限页面新增"
)
@PostMapping
(
value
=
"/transfiniteSaveRecord"
)
...
...
jeecg-module-system/src/main/java/org/jeecg/modules/maintenanceWork/mapper/WorkBatchMapper.java
View file @
305ac4e7
...
...
@@ -6,6 +6,7 @@ import org.jeecg.modules.maintenanceWork.dto.UnitDeviceDTO;
import
org.jeecg.modules.maintenanceWork.dto.WorkBatchDTO
;
import
org.jeecg.modules.maintenanceWork.entity.WorkBatch
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
org.jeecg.modules.maintenanceWork.vo.WorkBatchUserVO
;
import
org.jeecg.modules.maintenanceWork.vo.WorkBatchVO
;
import
org.jeecg.modules.unitDevice.dto.CaseReportCheckDataDTO
;
import
org.jeecg.modules.unitDevice.dto.CaseReportWorkBatchDTO
;
...
...
@@ -32,4 +33,6 @@ public interface WorkBatchMapper extends BaseMapper<WorkBatch> {
Page
<
CaseReportWorkBatchVO
>
caseReportWorkBatch
(
Page
<
CaseReportWorkBatchVO
>
pageData
,
CaseReportWorkBatchDTO
dto
);
List
<
ToDoDetailVO
>
getTodoList
(
String
currentUserId
);
List
<
WorkBatchUserVO
>
listUser
(
String
query
);
}
jeecg-module-system/src/main/java/org/jeecg/modules/maintenanceWork/mapper/xml/WorkBatchMapper.xml
View file @
305ac4e7
...
...
@@ -167,4 +167,19 @@
AND t1.create_by = #{currentUserId}
</if>
</select>
<select
id=
"listUser"
resultType=
"org.jeecg.modules.maintenanceWork.vo.WorkBatchUserVO"
>
SELECT
t1.id user_id,
t1.username,
t1.realname,
t1.user_identity,
t3.role_name
FROM
sys_user t1
INNER JOIN sys_user_role t2 ON t2.user_id = t1.id
INNER JOIN sys_role t3 ON t3.id = t2.role_id
WHERE
t1.del_flag = 0
AND (t1.username LIKE concat('%',#{query},'%') OR t1.realname LIKE concat('%',#{query},'%'))
</select>
</mapper>
jeecg-module-system/src/main/java/org/jeecg/modules/maintenanceWork/service/IWorkBatchService.java
View file @
305ac4e7
...
...
@@ -5,6 +5,7 @@ import org.jeecg.modules.homePage.vo.ToDoDetailVO;
import
org.jeecg.modules.maintenanceWork.dto.*
;
import
org.jeecg.modules.maintenanceWork.entity.WorkBatch
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
org.jeecg.modules.maintenanceWork.vo.WorkBatchUserVO
;
import
org.jeecg.modules.maintenanceWork.vo.WorkBatchVO
;
import
org.jeecg.modules.unitDevice.dto.CaseReportCheckDataDTO
;
import
org.jeecg.modules.unitDevice.dto.CaseReportWorkBatchDTO
;
...
...
@@ -41,4 +42,6 @@ public interface IWorkBatchService extends IService<WorkBatch> {
Page
<
CaseReportWorkBatchVO
>
caseReportWorkBatch
(
Page
<
CaseReportWorkBatchVO
>
pageData
,
CaseReportWorkBatchDTO
dto
);
List
<
ToDoDetailVO
>
getTodoList
(
String
currentUserId
);
List
<
WorkBatchUserVO
>
listUser
(
String
query
);
}
jeecg-module-system/src/main/java/org/jeecg/modules/maintenanceWork/service/impl/WorkBatchServiceImpl.java
View file @
305ac4e7
...
...
@@ -27,6 +27,7 @@ import org.jeecg.modules.maintenanceWork.mapper.WorkBatchDetailModifyMapper;
import
org.jeecg.modules.maintenanceWork.mapper.WorkBatchMapper
;
import
org.jeecg.modules.maintenanceWork.service.IWorkBatchService
;
import
org.jeecg.modules.maintenanceWork.vo.WorkBatchDetailVO
;
import
org.jeecg.modules.maintenanceWork.vo.WorkBatchUserVO
;
import
org.jeecg.modules.maintenanceWork.vo.WorkBatchVO
;
import
org.jeecg.modules.unitDevice.dto.CaseReportWorkBatchDTO
;
import
org.jeecg.modules.unitDevice.vo.CaseReportWorkBatchVO
;
...
...
@@ -294,5 +295,10 @@ public class WorkBatchServiceImpl extends ServiceImpl<WorkBatchMapper, WorkBatch
return
this
.
baseMapper
.
getTodoList
(
currentUserId
);
}
@Override
public
List
<
WorkBatchUserVO
>
listUser
(
String
query
)
{
return
this
.
baseMapper
.
listUser
(
query
);
}
}
jeecg-module-system/src/main/java/org/jeecg/modules/maintenanceWork/vo/WorkBatchUserVO.java
0 → 100644
View file @
305ac4e7
package
org
.
jeecg
.
modules
.
maintenanceWork
.
vo
;
import
io.swagger.annotations.ApiModel
;
import
lombok.Data
;
/**
* <p>
* 维修作业管理-作业计划批次管理表
* </p>
*
* @author hkl
* @since 2023-08-09
*/
@Data
@ApiModel
(
value
=
"WorkBatchUserVO对象"
,
description
=
"维修作业管理-派工用户"
)
public
class
WorkBatchUserVO
{
private
static
final
long
serialVersionUID
=
1L
;
private
String
id
;
}
jeecg-module-system/src/main/java/org/jeecg/modules/system/controller/CommonController.java
View file @
305ac4e7
...
...
@@ -261,7 +261,7 @@ public class CommonController {
response
.
addHeader
(
"Cache-Control"
,
"no-cache"
);
inputStream
=
classPathResource
.
getInputStream
();
outputStream
=
response
.
getOutputStream
();
byte
[]
buf
=
new
byte
[
4096
];
byte
[]
buf
=
new
byte
[
1024
];
int
len
;
while
((
len
=
inputStream
.
read
(
buf
))
>
0
)
{
outputStream
.
write
(
buf
,
0
,
len
);
...
...
jeecg-module-system/src/main/java/org/jeecg/modules/system/controller/LoginController.java
View file @
305ac4e7
...
...
@@ -121,6 +121,14 @@ public class LoginController {
return
result
;
}
//1.5 正式员工只能走AO
Integer
userIdentity
=
sysUser
.
getUserIdentity
();
if
(
1
==
userIdentity
)
{
result
.
error500
(
"正式员工请从OA登录"
);
return
result
;
}
//2. 校验用户名或密码是否正确
String
userpassword
=
PasswordUtil
.
encrypt
(
username
,
password
,
sysUser
.
getSalt
());
String
syspassword
=
sysUser
.
getPassword
();
...
...
@@ -132,6 +140,7 @@ public class LoginController {
return
result
;
}
//用户登录信息
userInfo
(
sysUser
,
result
);
//update-begin--Author:liusq Date:20210126 for:登录成功,删除redis中的验证码
...
...
jeecg-module-system/src/main/java/org/jeecg/modules/system/controller/SysUserController.java
View file @
305ac4e7
package
org
.
jeecg
.
modules
.
system
.
controller
;
import
cn.hutool.core.convert.Convert
;
import
cn.hutool.core.util.ObjectUtil
;
import
cn.hutool.core.util.RandomUtil
;
import
cn.hutool.poi.excel.ExcelUtil
;
import
cn.hutool.poi.excel.sax.handler.RowHandler
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
...
...
@@ -10,25 +13,30 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.toolkit.IdWorker
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.shiro.SecurityUtils
;
import
org.apache.shiro.authz.annotation.RequiresRoles
;
import
org.jeecg.common.api.vo.Result
;
import
org.jeecg.common.aspect.annotation.AutoLog
;
import
org.jeecg.common.aspect.annotation.PermissionData
;
import
org.jeecg.common.config.TenantContext
;
import
org.jeecg.common.constant.CommonConstant
;
import
org.jeecg.common.constant.SymbolConstant
;
import
org.jeecg.config.mybatisPlus.MybatisPlusSaasConfig
;
import
org.jeecg.modules.base.service.BaseCommonService
;
import
org.jeecg.common.exception.JeecgBootException
;
import
org.jeecg.common.system.query.QueryGenerator
;
import
org.jeecg.common.system.util.JwtUtil
;
import
org.jeecg.common.system.vo.LoginUser
;
import
org.jeecg.common.util.*
;
import
org.jeecg.config.mybatisPlus.MybatisPlusSaasConfig
;
import
org.jeecg.modules.base.service.BaseCommonService
;
import
org.jeecg.modules.system.entity.*
;
import
org.jeecg.modules.system.model.DepartIdModel
;
import
org.jeecg.modules.system.model.SysUserSysDepartModel
;
...
...
@@ -49,12 +57,16 @@ import org.springframework.web.multipart.MultipartFile;
import
org.springframework.web.multipart.MultipartHttpServletRequest
;
import
org.springframework.web.servlet.ModelAndView
;
import
javax.annotation.Resource
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.util.*
;
import
java.util.stream.Collectors
;
import
static
org
.
jeecg
.
common
.
constant
.
CommonConstant
.
DEFAULT_PASSWORD
;
/**
* <p>
* 用户表 前端控制器
...
...
@@ -187,33 +199,33 @@ public class SysUserController {
SysUser
user
=
JSON
.
parseObject
(
jsonObject
.
toJSONString
(),
SysUser
.
class
);
LambdaQueryWrapper
<
SysUser
>
lambdaQuery
=
Wrappers
.
lambdaQuery
();
lambdaQuery
.
eq
(
SysUser:
:
getUsername
,
user
.
getUsername
());
lambdaQuery
.
eq
(
SysUser:
:
getDelFlag
,
0
);
lambdaQuery
.
eq
(
SysUser:
:
getDelFlag
,
0
);
List
<
SysUser
>
list
=
sysUserService
.
list
(
lambdaQuery
);
if
(
list
!=
null
&&
list
.
size
()
>
0
)
{
return
Result
.
error
(
"登录账号已存在"
);
}
LambdaQueryWrapper
<
SysUser
>
workNoQuery
=
Wrappers
.
lambdaQuery
();
workNoQuery
.
eq
(
SysUser:
:
getWorkNo
,
user
.
getWorkNo
());
workNoQuery
.
eq
(
SysUser:
:
getDelFlag
,
0
);
List
<
SysUser
>
workNoList
=
sysUserService
.
list
(
workNoQuery
);
if
(
workNoList
!=
null
&&
workNoList
.
size
()
>
0
)
{
return
Result
.
error
(
"工号已存在"
);
}
LambdaQueryWrapper
<
SysUser
>
phoneQuery
=
Wrappers
.
lambdaQuery
();
phoneQuery
.
eq
(
SysUser:
:
getPhone
,
user
.
getPhone
());
phoneQuery
.
eq
(
SysUser:
:
getDelFlag
,
0
);
List
<
SysUser
>
phoneList
=
sysUserService
.
list
(
phoneQuery
);
if
(
phoneList
!=
null
&&
phoneList
.
size
()
>
0
)
{
return
Result
.
error
(
"手机号码已存在"
);
}
LambdaQueryWrapper
<
SysUser
>
emailQuery
=
Wrappers
.
lambdaQuery
();
emailQuery
.
eq
(
SysUser:
:
getEmail
,
user
.
getEmail
());
emailQuery
.
eq
(
SysUser:
:
getDelFlag
,
0
);
List
<
SysUser
>
emailList
=
sysUserService
.
list
(
emailQuery
);
if
(
emailList
!=
null
&&
emailList
.
size
()
>
0
)
{
return
Result
.
error
(
"邮箱已存在"
);
}
//
LambdaQueryWrapper<SysUser> workNoQuery = Wrappers.lambdaQuery();
//
workNoQuery.eq(SysUser::getWorkNo, user.getWorkNo());
// workNoQuery.eq(SysUser::getDelFlag,
0);
//
List<SysUser> workNoList = sysUserService.list(workNoQuery);
//
if (workNoList != null && workNoList.size() > 0) {
//
return Result.error("工号已存在");
//
}
//
LambdaQueryWrapper<SysUser> phoneQuery = Wrappers.lambdaQuery();
//
phoneQuery.eq(SysUser::getPhone, user.getPhone());
// phoneQuery.eq(SysUser::getDelFlag,
0);
//
List<SysUser> phoneList = sysUserService.list(phoneQuery);
//
if (phoneList != null && phoneList.size() > 0) {
//
return Result.error("手机号码已存在");
//
}
//
LambdaQueryWrapper<SysUser> emailQuery = Wrappers.lambdaQuery();
//
emailQuery.eq(SysUser::getEmail, user.getEmail());
// emailQuery.eq(SysUser::getDelFlag,
0);
//
List<SysUser> emailList = sysUserService.list(emailQuery);
//
if (emailList != null && emailList.size() > 0) {
//
return Result.error("邮箱已存在");
//
}
user
.
setCreateTime
(
new
Date
());
//设置创建时间
String
salt
=
oConvertUtils
.
randomGen
(
8
);
user
.
setSalt
(
salt
);
...
...
@@ -226,6 +238,7 @@ public class SysUserController {
// 保存用户走一个service 保证事务
//获取租户ids
String
relTenantIds
=
jsonObject
.
getString
(
"relTenantIds"
);
relTenantIds
=
"0"
;
sysUserService
.
saveUser
(
user
,
selectedRoles
,
selectedDeparts
,
relTenantIds
);
baseCommonService
.
addLog
(
"添加用户,username: "
+
user
.
getUsername
(),
CommonConstant
.
LOG_TYPE_2
,
2
);
result
.
success
(
"添加成功!"
);
...
...
@@ -250,37 +263,37 @@ public class SysUserController {
SysUser
user
=
JSON
.
parseObject
(
jsonObject
.
toJSONString
(),
SysUser
.
class
);
LambdaQueryWrapper
<
SysUser
>
lambdaQuery
=
Wrappers
.
lambdaQuery
();
lambdaQuery
.
eq
(
SysUser:
:
getUsername
,
user
.
getUsername
());
lambdaQuery
.
eq
(
SysUser:
:
getDelFlag
,
0
);
lambdaQuery
.
ne
(
SysUser:
:
getId
,
user
.
getId
());
lambdaQuery
.
eq
(
SysUser:
:
getDelFlag
,
0
);
lambdaQuery
.
ne
(
SysUser:
:
getId
,
user
.
getId
());
List
<
SysUser
>
list
=
sysUserService
.
list
(
lambdaQuery
);
if
(
list
!=
null
&&
list
.
size
()
>
0
)
{
return
Result
.
error
(
"登录账号已存在"
);
}
LambdaQueryWrapper
<
SysUser
>
workNoQuery
=
Wrappers
.
lambdaQuery
();
workNoQuery
.
eq
(
SysUser:
:
getWorkNo
,
user
.
getWorkNo
());
workNoQuery
.
eq
(
SysUser:
:
getDelFlag
,
0
);
workNoQuery
.
ne
(
SysUser:
:
getId
,
user
.
getId
());
List
<
SysUser
>
workNoList
=
sysUserService
.
list
(
workNoQuery
);
if
(
workNoList
!=
null
&&
workNoList
.
size
()
>
0
)
{
return
Result
.
error
(
"工号已存在"
);
}
LambdaQueryWrapper
<
SysUser
>
phoneQuery
=
Wrappers
.
lambdaQuery
();
phoneQuery
.
eq
(
SysUser:
:
getPhone
,
user
.
getPhone
());
phoneQuery
.
eq
(
SysUser:
:
getDelFlag
,
0
);
phoneQuery
.
ne
(
SysUser:
:
getId
,
user
.
getId
());
List
<
SysUser
>
phoneList
=
sysUserService
.
list
(
phoneQuery
);
if
(
phoneList
!=
null
&&
phoneList
.
size
()
>
0
)
{
return
Result
.
error
(
"手机号码已存在"
);
}
LambdaQueryWrapper
<
SysUser
>
emailQuery
=
Wrappers
.
lambdaQuery
();
emailQuery
.
eq
(
SysUser:
:
getEmail
,
user
.
getEmail
());
emailQuery
.
eq
(
SysUser:
:
getDelFlag
,
0
);
emailQuery
.
ne
(
SysUser:
:
getId
,
user
.
getId
());
List
<
SysUser
>
emailList
=
sysUserService
.
list
(
emailQuery
);
if
(
emailList
!=
null
&&
emailList
.
size
()
>
0
)
{
return
Result
.
error
(
"邮箱已存在"
);
}
//
LambdaQueryWrapper<SysUser> workNoQuery = Wrappers.lambdaQuery();
//
workNoQuery.eq(SysUser::getWorkNo, user.getWorkNo());
// workNoQuery.eq(SysUser::getDelFlag,
0);
// workNoQuery.ne(SysUser::getId,
user.getId());
//
List<SysUser> workNoList = sysUserService.list(workNoQuery);
//
if (workNoList != null && workNoList.size() > 0) {
//
return Result.error("工号已存在");
//
}
//
LambdaQueryWrapper<SysUser> phoneQuery = Wrappers.lambdaQuery();
//
phoneQuery.eq(SysUser::getPhone, user.getPhone());
// phoneQuery.eq(SysUser::getDelFlag,
0);
// phoneQuery.ne(SysUser::getId,
user.getId());
//
List<SysUser> phoneList = sysUserService.list(phoneQuery);
//
if (phoneList != null && phoneList.size() > 0) {
//
return Result.error("手机号码已存在");
//
}
//
LambdaQueryWrapper<SysUser> emailQuery = Wrappers.lambdaQuery();
//
emailQuery.eq(SysUser::getEmail, user.getEmail());
// emailQuery.eq(SysUser::getDelFlag,
0);
// emailQuery.ne(SysUser::getId,
user.getId());
//
List<SysUser> emailList = sysUserService.list(emailQuery);
//
if (emailList != null && emailList.size() > 0) {
//
return Result.error("邮箱已存在");
//
}
user
.
setUpdateTime
(
new
Date
());
//String passwordEncode = PasswordUtil.encrypt(user.getUsername(), user.getPassword(), sysUser.getSalt());
user
.
setPassword
(
sysUser
.
getPassword
());
...
...
@@ -295,6 +308,7 @@ public class SysUserController {
// 修改用户走一个service 保证事务
//获取租户ids
String
relTenantIds
=
jsonObject
.
getString
(
"relTenantIds"
);
relTenantIds
=
"0"
;
sysUserService
.
editUser
(
user
,
roles
,
departs
,
relTenantIds
);
result
.
success
(
"修改成功!"
);
}
...
...
@@ -579,6 +593,188 @@ public class SysUserController {
return
mv
;
}
@Resource
private
ISysRoleService
sysRoleService
;
@PostMapping
(
value
=
"/importUser"
)
@AutoLog
(
value
=
"导入用户"
)
@ApiOperation
(
value
=
"用户管理-导入用户"
,
notes
=
"用户管理-导入用户"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"file"
,
value
=
"文件"
),
})
public
Result
<
String
>
importUser
(
MultipartFile
file
)
{
List
<
SysRole
>
roleList
=
sysRoleService
.
list
();
try
(
InputStream
inputStream
=
file
.
getInputStream
())
{
// 1.excel导入List<List<Object>> 中
CurrentRowHandler
currentRowHandler
=
new
CurrentRowHandler
(
roleList
);
ExcelUtil
.
readBySax
(
inputStream
,
0
,
currentRowHandler
);
// 2.判断是否处理成功
if
(!
currentRowHandler
.
disposeMark
)
{
throw
new
JeecgBootException
(
currentRowHandler
.
msg
.
toString
());
}
// 3.直接保存
sysUserService
.
saveBatch
(
currentRowHandler
.
sysUserList
);
sysUserRoleService
.
saveBatch
(
currentRowHandler
.
sysUserRoleList
);
}
catch
(
IOException
e
)
{
throw
new
JeecgBootException
(
e
);
}
return
Result
.
ok
(
"操作成功"
);
}
/**
* 当前行处理器
*/
private
static
class
CurrentRowHandler
implements
RowHandler
{
/**
* 处理结果
* ture:处理成功
* false: 处理失败
*/
public
boolean
disposeMark
;
public
StringBuffer
msg
;
/**
* 角色code映射
*/
private
Map
<
String
,
String
>
roleMap
;
/**
* 用户列表
*/
public
List
<
SysUser
>
sysUserList
;
/**
* 用户角色id
*/
public
List
<
SysUserRole
>
sysUserRoleList
;
public
CurrentRowHandler
(
List
<
SysRole
>
roles
)
{
this
.
disposeMark
=
true
;
this
.
msg
=
new
StringBuffer
();
// 将角色映射表
this
.
roleMap
=
new
HashMap
<>();
for
(
SysRole
role
:
roles
)
{
roleMap
.
put
(
role
.
getRoleName
(),
role
.
getId
());
}
}
@Override
public
void
handle
(
int
sheetIndex
,
long
rowIndex
,
List
<
Object
>
rowList
)
{
// 跳过第一行
if
(
rowIndex
==
0
)
{
return
;
}
// 名称=真实姓名
String
realName
=
Convert
.
toStr
(
rowList
.
get
(
0
));
if
(
ObjectUtil
.
isEmpty
(
realName
))
{
this
.
disposeMark
=
false
;
msg
.
append
(
"第【"
+
rowIndex
+
1
+
"】行名称不能为空"
);
}
// 工号 = 用户账号
String
username
=
Convert
.
toStr
(
rowList
.
get
(
1
));
if
(
ObjectUtil
.
isEmpty
(
username
))
{
this
.
disposeMark
=
false
;
msg
.
append
(
"第【"
+
rowIndex
+
1
+
"】行工号不能为空"
);
}
// 身份 中文
String
userIdentityStr
=
Convert
.
toStr
(
rowList
.
get
(
2
));
Integer
userIdentity
=
1
;
if
(
ObjectUtil
.
isEmpty
(
userIdentityStr
))
{
this
.
disposeMark
=
false
;
msg
.
append
(
"第【"
+
rowIndex
+
1
+
"】行身份不能为空"
);
}
else
if
(
"正式"
.
equals
(
userIdentityStr
))
{
userIdentity
=
1
;
}
else
if
(
"委外"
.
equals
(
userIdentityStr
))
{
userIdentity
=
2
;
}
else
{
msg
.
append
(
"第【"
+
rowIndex
+
1
+
"】行身份识别失败"
);
}
// 角色名称
String
roleName
=
Convert
.
toStr
(
rowList
.
get
(
3
));
String
roleId
=
""
;
if
(
ObjectUtil
.
isEmpty
(
roleName
))
{
this
.
disposeMark
=
false
;
msg
.
append
(
"第【"
+
rowIndex
+
1
+
"】行角色不能为空"
);
}
else
if
(
roleMap
.
containsKey
(
roleName
))
{
roleId
=
roleMap
.
get
(
roleName
);
}
else
{
msg
.
append
(
"第【"
+
rowIndex
+
1
+
"】行角色识别失败"
);
}
// 添加换行符号
msg
.
append
(
"\n\r"
);
// 构建用户
SysUser
currentUser
=
new
SysUser
();
currentUser
.
setId
(
IdWorker
.
getIdStr
());
currentUser
.
setUsername
(
username
);
currentUser
.
setRealname
(
roleName
);
currentUser
.
setUserIdentity
(
userIdentity
);
// 正式员工身份
currentUser
.
setWorkNo
(
username
);
currentUser
.
setDelFlag
(
0
);
currentUser
.
setLoginTenantId
(
0
);
currentUser
.
setStatus
(
CommonConstant
.
USER_UNFREEZE
);
String
salt
=
oConvertUtils
.
randomGen
(
8
);
currentUser
.
setSalt
(
salt
);
//加盐
String
passwordEncode
=
PasswordUtil
.
encrypt
(
username
,
DEFAULT_PASSWORD
,
salt
);
currentUser
.
setPassword
(
passwordEncode
);
// 默认密码
sysUserList
.
add
(
currentUser
);
// 构建用户和角色关联
SysUserRole
currentUserRole
=
new
SysUserRole
();
currentUserRole
.
setId
(
IdWorker
.
getIdStr
());
currentUserRole
.
setUserId
(
currentUser
.
getId
());
currentUserRole
.
setRoleId
(
roleId
);
sysUserRoleList
.
add
(
currentUserRole
);
}
// @Override
// public void handle(int sheetIndex, int rowIndex, List<Object> rowList) {
// // 跳过第一行
// if (rowIndex == 0) {
// return;
// }
//
// // 创建第一个JSON对象
// ObjectMapper mapper = new ObjectMapper();
// ObjectNode jsonObject = mapper.createObjectNode();
//
// // 水头
// Double h = Convert.toDouble(rowList.get(0));
// jsonObject.put("H", h);
// // 流量
// Double q = Convert.toDouble(rowList.get(1));
// jsonObject.put("Q", q);
// // 出力
// Double n = Convert.toDouble(rowList.get(2));
// jsonObject.put("N", n);
//
//
// this.dataSource.add(jsonObject);
// }
}
/**
* 通过excel导入数据
*
...
...
jeecg-module-system/src/main/java/org/jeecg/modules/system/entity/SysUser.java
View file @
305ac4e7
...
...
@@ -167,9 +167,9 @@ public class SysUser implements Serializable {
private
Integer
activitiSync
;
/**
* 身份
(0 普通成员 1 上级)
* 身份
1-正式 2-委外
*/
@Excel
(
name
=
"
(1普通成员 2上级)
"
,
width
=
15
)
@Excel
(
name
=
"
1-正式 2-委外
"
,
width
=
15
)
private
Integer
userIdentity
;
/**
...
...
jeecg-module-system/src/main/resources/application-dev.yml
View file @
305ac4e7
server
:
port
:
8081
port
:
17002
tomcat
:
max-swallow-size
:
-1
error
:
...
...
@@ -99,7 +99,7 @@ spring:
datasource
:
druid
:
stat-view-servlet
:
enabled
:
tru
e
enabled
:
fals
e
loginUsername
:
admin
loginPassword
:
123456
allow
:
...
...
@@ -131,13 +131,13 @@ spring:
connectionProperties
:
druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000
datasource
:
master
:
url
:
jdbc:mysql://47.94.207.62:3306/hzgw_
test
?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&zeroDateTimeBehavior=convertToNull
url
:
jdbc:mysql://47.94.207.62:3306/hzgw_
prod
?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&zeroDateTimeBehavior=convertToNull
username
:
root
password
:
superAdmin&321
driver-class-name
:
com.mysql.cj.jdbc.Driver
#redis 配置
redis
:
database
:
0
database
:
9
host
:
47.94.207.62
lettuce
:
pool
:
...
...
@@ -161,7 +161,7 @@ mybatis-plus:
table-underline
:
true
configuration
:
# 这个配置会将执行的sql打印出来,在开发或测试的时候可以用
log-impl
:
org.apache.ibatis.logging.stdout.StdOutImpl
#
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
# 返回类型为Map,显示null对应的字段
call-setters-on-nulls
:
true
# 驼峰
...
...
@@ -187,7 +187,6 @@ jeecg:
upload
:
F:\\upFiles
#webapp文件路径
webapp
:
F:\\upFiles
#文件访问域名
shiro
:
excludeUrls
:
/test/jeecgDemo/demo3,/test/jeecgDemo/redisDemo/**,/category/**,/visual/**,/map/**,/jmreport/bigscreen2/**
#阿里云oss存储和大鱼短信秘钥配置
...
...
@@ -296,3 +295,11 @@ third-app:
# appSecret
client-secret
:
??
agent-id
:
??
# 统一身份证
iam
:
postUserInfoUrl
:
http://47.110.134.43:15105/common-uuv/login/user/temp-code
# 获取用户信息成功状态码
getUserInfoSucceed
:
ok
defaultRoleCode
:
gcs
jeecg-module-system/src/main/resources/application-prod.yml
View file @
305ac4e7
...
...
@@ -99,9 +99,9 @@ spring:
datasource
:
druid
:
stat-view-servlet
:
enabled
:
tru
e
loginUsername
:
admin
loginPassword
:
123456
enabled
:
fals
e
loginUsername
:
lkjxlkjslkfjl1dsaf
loginPassword
:
alqw1w55+1234jkdf1234
allow
:
web-stat-filter
:
enabled
:
true
...
...
@@ -182,9 +182,9 @@ jeecg:
app
:
http://localhost:8051
path
:
#文件上传根目录 设置
upload
:
/opt/
ztgk/prod
/file
upload
:
/opt/
etc
/file
#webapp文件路径
webapp
:
/opt/
ztgk/prod
/file
webapp
:
/opt/
etc
/file
shiro
:
excludeUrls
:
/test/jeecgDemo/demo3,/test/jeecgDemo/redisDemo/**,/category/**,/visual/**,/map/**,/jmreport/bigscreen2/**
#阿里云oss存储和大鱼短信秘钥配置
...
...
@@ -241,6 +241,7 @@ jeecg:
logging
:
level
:
org.jeecg.modules.system.mapper
:
info
register-shutdown-hook
:
#cas单点登录
cas
:
prefixUrl
:
http://cas.example.org:8443/cas
...
...
jeecg-module-system/src/main/resources/application.yml
View file @
305ac4e7
...
...
@@ -2,4 +2,4 @@ spring:
application
:
name
:
hzgw
profiles
:
active
:
@
package.environment@
active
:
dev
jeecg-module-system/src/main/resources/templates/excel/用户列表.xlsx
0 → 100644
View file @
305ac4e7
File added
pom.xml
View file @
305ac4e7
...
...
@@ -206,6 +206,11 @@
<artifactId>
okhttp
</artifactId>
<version>
4.4.1
</version>
</dependency>
<dependency>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-resources-plugin
</artifactId>
<version>
3.1.0
</version>
</dependency>
<!--minio-->
<dependency>
<groupId>
io.minio
</groupId>
...
...
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