Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
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
项目统一框架
amos-boot-biz
Commits
90957818
Commit
90957818
authored
Aug 30, 2024
by
suhuiguang
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop_tzs_register' of…
Merge branch 'develop_tzs_register' of
http://36.40.66.175:5000/moa/amos-boot-biz
into develop_tzs_register
parents
f3a74eb2
5e4a0513
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
82 additions
and
8 deletions
+82
-8
TzsUserInfoDto.java
.../yeejoin/amos/boot/module/tcm/api/dto/TzsUserInfoDto.java
+6
-0
TzsUserInfoMapper.xml
...e-tcm-api/src/main/resources/mapper/TzsUserInfoMapper.xml
+3
-0
TzsUserInfoController.java
...boot/module/tcm/biz/controller/TzsUserInfoController.java
+9
-0
TzsUserInfoServiceImpl.java
...t/module/tcm/biz/service/impl/TzsUserInfoServiceImpl.java
+37
-0
TzsUserPermissionServiceImpl.java
...le/tcm/biz/service/impl/TzsUserPermissionServiceImpl.java
+27
-8
No files found.
amos-boot-system-tzs/amos-boot-module-tcm/amos-boot-module-tcm-api/src/main/java/com/yeejoin/amos/boot/module/tcm/api/dto/TzsUserInfoDto.java
View file @
90957818
...
...
@@ -110,4 +110,10 @@ public class TzsUserInfoDto extends BaseDto {
@ApiModelProperty
(
value
=
"职称"
)
private
String
jobTitle
;
@ApiModelProperty
(
value
=
"菜单类型,具体见TzsUserInfoServiceImpl中的menuMap"
)
private
String
menuType
;
@ApiModelProperty
(
value
=
"菜单类型下的所有人员类型"
)
private
String
menuTypeUnderPost
;
}
amos-boot-system-tzs/amos-boot-module-tcm/amos-boot-module-tcm-api/src/main/resources/mapper/TzsUserInfoMapper.xml
View file @
90957818
...
...
@@ -47,6 +47,9 @@
<if
test=
"dto.amosUserName != '' and dto.amosUserName != null"
>
and amos_user_name like concat('%',#{dto.amosUserName},'%')
</if>
<if
test=
"dto.menuTypeUnderPost != '' and dto.menuTypeUnderPost != null"
>
and post::jsonb
<![CDATA[@>]]>
#{dto.menuTypeUnderPost}::jsonb
</if>
<if
test=
"dto.postName != '' and dto.postName != null"
>
and post like concat('%',#{dto.postName},'%')
</if>
...
...
amos-boot-system-tzs/amos-boot-module-tcm/amos-boot-module-tcm-biz/src/main/java/com/yeejoin/amos/boot/module/tcm/biz/controller/TzsUserInfoController.java
View file @
90957818
...
...
@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import
com.yeejoin.amos.boot.biz.common.bo.CompanyBo
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.biz.common.entity.DataDictionary
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisKey
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.amos.boot.module.common.api.dto.UserPermissionDto
;
...
...
@@ -311,4 +312,12 @@ public class TzsUserInfoController extends BaseController {
List
<
UserPermissionDto
>
userPermissionDtos
=
tzsUserInfoServiceImpl
.
getUserPermissionByCompanySeq
(
comSeq
);
return
ResponseHelper
.
buildResponse
(
userPermissionDtos
);
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"人员管理-人员类型-查询指定菜单下的人员类型"
,
notes
=
"人员管理-人员类型-查询指定菜单下的人员类型"
)
@GetMapping
(
value
=
"/userTypeUnderMenu"
)
public
ResponseModel
<
List
<
DataDictionary
>>
userTypeUnderMenu
(
@RequestParam
(
"menuType"
)
String
menuType
)
{
List
<
DataDictionary
>
dataDictionaries
=
tzsUserInfoServiceImpl
.
userTypeUnderMenu
(
menuType
);
return
ResponseHelper
.
buildResponse
(
dataDictionaries
);
}
}
amos-boot-system-tzs/amos-boot-module-tcm/amos-boot-module-tcm-biz/src/main/java/com/yeejoin/amos/boot/module/tcm/biz/service/impl/TzsUserInfoServiceImpl.java
View file @
90957818
...
...
@@ -95,8 +95,36 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI
statusColorMap
.
put
(
"正常"
,
"#18B100"
);
}
private
static
Map
<
String
,
List
<
String
>>
menuMap
=
new
HashMap
<>();
static
{
// 业务办理人员管理
menuMap
.
put
(
"ywblry"
,
Collections
.
singletonList
(
"6616"
));
// 主要负责人管理
menuMap
.
put
(
"zyfzr"
,
Collections
.
singletonList
(
"6548"
));
// 作业人员管理
menuMap
.
put
(
"zyry"
,
Collections
.
singletonList
(
"6552"
));
// 检测人员管理
menuMap
.
put
(
"jcry"
,
Collections
.
singletonList
(
"66152"
));
// 安全总监管理
menuMap
.
put
(
"aqzj"
,
Collections
.
singletonList
(
"6547"
));
// 质量保证体系人员管理
menuMap
.
put
(
"zlbztxry"
,
Arrays
.
asList
(
"6551"
,
"6550"
));
// 质量安全员管理
menuMap
.
put
(
"zlaqy"
,
Collections
.
singletonList
(
"6551"
));
// 质量安全总监管理
menuMap
.
put
(
"zlaqzj"
,
Collections
.
singletonList
(
"6550"
));
// 安全员管理
menuMap
.
put
(
"aqy"
,
Collections
.
singletonList
(
"6549"
));
// 检验人员管理
menuMap
.
put
(
"jyry"
,
Collections
.
singletonList
(
"66151"
));
// 其他人员管理
menuMap
.
put
(
"qtry"
,
Arrays
.
asList
(
"6546"
,
"6617"
,
"6553"
));
}
@Override
public
Page
<
TzsUserInfoDto
>
page
(
TzsUserInfoDto
dto
,
Page
<
TzsUserInfoDto
>
page
)
{
dto
.
setMenuTypeUnderPost
(
JSON
.
toJSONString
(
menuMap
.
get
(
dto
.
getMenuType
())));
Page
<
TzsUserInfoDto
>
tzsUserInfoDtoPage
=
tzsUserInfoMapper
.
selectPageMessage
(
page
,
dto
);
tzsUserInfoDtoPage
.
getRecords
().
forEach
(
item
->
{
if
(!
ObjectUtils
.
isEmpty
(
item
.
getProfile
()))
{
...
...
@@ -844,4 +872,13 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI
this
.
updateWithModel
(
tzsUserInfoDto
);
return
tzsUserInfoDto
;
}
public
List
<
DataDictionary
>
userTypeUnderMenu
(
String
menu
)
{
List
<
String
>
userTypeCode
=
menuMap
.
getOrDefault
(
menu
,
new
ArrayList
<>());
if
(
userTypeCode
.
isEmpty
())
{
return
Collections
.
emptyList
();
}
return
iDataDictionaryService
.
getBaseMapper
().
selectBatchIds
(
userTypeCode
);
}
}
amos-boot-system-tzs/amos-boot-module-tcm/amos-boot-module-tcm-biz/src/main/java/com/yeejoin/amos/boot/module/tcm/biz/service/impl/TzsUserPermissionServiceImpl.java
View file @
90957818
...
...
@@ -14,8 +14,10 @@ import com.yeejoin.amos.boot.module.tcm.api.mapper.TzsUserPermissionMapper;
import
com.yeejoin.amos.boot.module.tcm.api.service.ITzsUserPermissionService
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.util.ObjectUtils
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
import
java.time.LocalDate
;
import
java.time.LocalDateTime
;
...
...
@@ -24,7 +26,6 @@ import java.time.format.DateTimeFormatter;
import
java.time.format.DateTimeFormatterBuilder
;
import
java.time.temporal.ChronoField
;
import
java.util.*
;
import
java.util.stream.Collectors
;
/**
* 用户资质信息表服务实现类
...
...
@@ -50,7 +51,7 @@ public class TzsUserPermissionServiceImpl extends BaseService<TzsUserPermissionD
/**
* 需要转换的附件字段 jsonString化字段
*/
private
final
String
[]
ATTACHMENTS
=
{
"certAttachment"
,
"
otherItem"
,
"itemCode"
,
"permissionItem"
};
private
final
String
[]
ATTACHMENTS
=
{
"certAttachment"
,
"
itemCode"
,
"permissionItem"
};
/**
* 分页查询
...
...
@@ -99,7 +100,26 @@ public class TzsUserPermissionServiceImpl extends BaseService<TzsUserPermissionD
// permissionData6552 作业人员资质
JSONArray
permissionData6552
=
userInfoDto
.
getPermissionData6552
();
if
(!
ValidationUtil
.
isEmpty
(
permissionData6552
))
{
permissionData6552
.
forEach
(
x
->
tzsUserPermissions
.
add
(
buildPermission
(
ZYRY_TYPE
,
(
JSONObject
)
x
,
userInfoDto
)));
permissionData6552
.
forEach
(
item
->
{
JSONObject
itempermissionData6552
=
(
JSONObject
)
item
;
// 前端无法处理后端手动判断
// 作业项目中含有【金属焊接操作】,则【金属焊接操作-项目代号】必填
// 作业项目中含有【非金属焊接操作】,则【非金属焊接操作-项目代号】必填
// 作业项目中含有【其他】,则【其他作业项目是必填的】必填
String
jobItem
=
String
.
valueOf
(
itempermissionData6552
.
get
(
"jobItem"
));
String
otherItem
=
String
.
valueOf
(
itempermissionData6552
.
get
(
"otherItem"
));
JSONObject
itemCode
=
JSON
.
parseObject
(
String
.
valueOf
(
itempermissionData6552
.
get
(
"itemCode"
)));
if
(
jobItem
.
contains
(
"金属焊接操作"
)
&&
ObjectUtils
.
isEmpty
(
itemCode
.
get
(
"JSHJCZItemCode"
)))
{
throw
new
BadRequest
(
"金属焊接操作-项目代号是必填的"
);
}
if
(
jobItem
.
contains
(
"非金属焊接操作"
)
&&
ObjectUtils
.
isEmpty
(
itemCode
.
get
(
"FJSHJCZItemCode"
)))
{
throw
new
BadRequest
(
"非金属焊接操作-项目代号是必填的"
);
}
if
(
jobItem
.
contains
(
"其他"
)
&&
ObjectUtils
.
isEmpty
(
otherItem
))
{
throw
new
BadRequest
(
"其他作业项目是必填的"
);
}
tzsUserPermissions
.
add
(
buildPermission
(
ZYRY_TYPE
,
itempermissionData6552
,
userInfoDto
));
});
}
this
.
saveBatch
(
tzsUserPermissions
);
}
...
...
@@ -147,7 +167,7 @@ public class TzsUserPermissionServiceImpl extends BaseService<TzsUserPermissionD
permission
.
setCertAttachment
(
JSONArray
.
toJSONString
(
permissionData
.
get
(
"certAttachment"
)));
permission
.
setCertType
(
ZYRY_TYPE
.
equals
(
type
)
?
String
.
valueOf
(
permissionData
.
get
(
"certType"
))
:
null
);
permission
.
setJobItem
(
ZYRY_TYPE
.
equals
(
type
)
?
String
.
valueOf
(
permissionData
.
get
(
"jobItem"
))
:
null
);
permission
.
setOtherItem
(
ZYRY_TYPE
.
equals
(
type
)
?
JSONArray
.
toJSONString
(
permissionData
.
get
(
"otherItem"
)
)
:
null
);
permission
.
setOtherItem
(
ZYRY_TYPE
.
equals
(
type
)
?
(
String
)
permissionData
.
get
(
"otherItem"
)
:
null
);
permission
.
setItemCode
(
ZYRY_TYPE
.
equals
(
type
)
?
JSONArray
.
toJSONString
(
permissionData
.
get
(
"itemCode"
))
:
null
);
return
permission
;
}
...
...
@@ -204,10 +224,8 @@ public class TzsUserPermissionServiceImpl extends BaseService<TzsUserPermissionD
}
// 作业项目【jobItem】 字段特殊处理
JSONArray
jobItem
=
JSON
.
parseArray
(
String
.
valueOf
(
json
.
get
(
"jobItem"
)));
json
.
put
(
"jobItem"
,
jobItem
);
if
(!(
jobItem
==
null
||
jobItem
.
isEmpty
()))
{
json
.
put
(
"doNotDelJobItem"
,
jobItem
.
stream
().
map
(
Object:
:
toString
).
collect
(
Collectors
.
joining
(
","
)));
}
json
.
put
(
"jobItem"
,
jobItem
);
return
json
;
}
}
\ 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