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
1810b025
Commit
1810b025
authored
Oct 25, 2023
by
tianyiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
两个规定-通过组id查询组及组内人员信息接口优化
parent
1cfbe778
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
99 additions
and
56 deletions
+99
-56
TzsUserInfoMapper.java
...in/amos/boot/module/tcm/api/mapper/TzsUserInfoMapper.java
+4
-2
ITzsUserInfoService.java
...amos/boot/module/tcm/api/service/ITzsUserInfoService.java
+2
-0
TzsUserInfoMapper.xml
...e-tcm-api/src/main/resources/mapper/TzsUserInfoMapper.xml
+34
-13
TzsUserInfoController.java
...boot/module/tcm/biz/controller/TzsUserInfoController.java
+8
-0
TzsUserInfoServiceImpl.java
...t/module/tcm/biz/service/impl/TzsUserInfoServiceImpl.java
+51
-41
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/mapper/TzsUserInfoMapper.java
View file @
1810b025
...
@@ -25,7 +25,9 @@ public interface TzsUserInfoMapper extends BaseMapper<TzsUserInfo> {
...
@@ -25,7 +25,9 @@ public interface TzsUserInfoMapper extends BaseMapper<TzsUserInfo> {
@Param
(
"userSeq"
)
String
userSeq
,
@Param
(
"userSeq"
)
String
userSeq
,
@Param
(
"dto"
)
TzsEquipListDto
dto
);
@Param
(
"dto"
)
TzsEquipListDto
dto
);
GroupAndPersonInfoDto
getUnitInfoByUserId
(
String
userId
);
List
<
TzsUserInfo
>
getUnitPersonInfo
();
List
<
TzsUserInfo
>
getUnitPersonInfo
();
// List<String> selectUserIds();
List
<
GroupAndPersonInfoDto
>
getUnitInfoByUserIds
(
@Param
(
"userIds"
)
List
<
String
>
userIds
);
}
}
amos-boot-system-tzs/amos-boot-module-tcm/amos-boot-module-tcm-api/src/main/java/com/yeejoin/amos/boot/module/tcm/api/service/ITzsUserInfoService.java
View file @
1810b025
...
@@ -49,4 +49,6 @@ public interface ITzsUserInfoService extends IService<TzsUserInfo> {
...
@@ -49,4 +49,6 @@ public interface ITzsUserInfoService extends IService<TzsUserInfo> {
List
<
GroupAndPersonInfoDto
>
getGroupAndPersonInfo
(
Long
groupId
);
List
<
GroupAndPersonInfoDto
>
getGroupAndPersonInfo
(
Long
groupId
);
Boolean
createUnitPerson
();
Boolean
createUnitPerson
();
// void testGroup();
}
}
amos-boot-system-tzs/amos-boot-module-tcm/amos-boot-module-tcm-api/src/main/resources/mapper/TzsUserInfoMapper.xml
View file @
1810b025
...
@@ -153,19 +153,6 @@
...
@@ -153,19 +153,6 @@
</select>
</select>
<select
id=
"getUnitInfoByUserId"
resultType=
"com.yeejoin.amos.boot.module.tcm.api.dto.GroupAndPersonInfoDto"
>
SELECT
tui.unit_name,
tui.unit_code,
replace(tzei.unit_type,'#', ',') unitType,
tzei.equip_category
FROM
tzs_user_info tui
LEFT JOIN tz_base_enterprise_info tzei ON tui.unit_code = tzei.use_code
WHERE
amos_user_id = #{userId}
</select>
<select
id=
"getUnitPersonInfo"
resultType=
"com.yeejoin.amos.boot.module.tcm.api.entity.TzsUserInfo"
>
<select
id=
"getUnitPersonInfo"
resultType=
"com.yeejoin.amos.boot.module.tcm.api.entity.TzsUserInfo"
>
SELECT
SELECT
admin_name as name ,
admin_name as name ,
...
@@ -180,4 +167,37 @@
...
@@ -180,4 +167,37 @@
FROM
FROM
"tz_flc_reg_unit_info"
"tz_flc_reg_unit_info"
</select>
</select>
<!-- <select id="selectUserIds" resultType="java.lang.String">-->
<!-- SELECT-->
<!-- amos_user_id-->
<!-- FROM-->
<!-- tzs_user_info tui-->
<!-- LEFT JOIN tz_base_enterprise_info tzei ON tui.unit_code = tzei.use_code-->
<!-- WHERE tui.is_delete = 'f'-->
<!-- AND tui.amos_user_id is NOT null-->
<!-- AND tzei.unit_type IS NOT NULL-->
<!-- GROUP BY tui.amos_user_id-->
<!-- </select>-->
<select
id=
"getUnitInfoByUserIds"
resultType=
"com.yeejoin.amos.boot.module.tcm.api.dto.GroupAndPersonInfoDto"
>
SELECT
tui.amos_user_id userId,
tui.amos_user_name userName,
tui.unit_name,
tui.unit_code,
replace(tzei.unit_type,'#', ',') unitType,
tzei.equip_category
FROM
tzs_user_info tui
LEFT JOIN tz_base_enterprise_info tzei ON tui.unit_code = tzei.use_code
<where>
<if
test=
"userIds != null and userIds.size() > 0"
>
and amos_user_id in
<foreach
item=
"item"
collection=
"userIds"
separator=
","
open=
"("
close=
")"
index=
""
>
#{item}
</foreach>
</if>
</where>
</select>
</mapper>
</mapper>
\ No newline at end of file
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 @
1810b025
...
@@ -318,5 +318,13 @@ public class TzsUserInfoController extends BaseController {
...
@@ -318,5 +318,13 @@ public class TzsUserInfoController extends BaseController {
return
ResponseHelper
.
buildResponse
(
tzsUserInfoService
.
getGroupAndPersonInfo
(
groupId
));
return
ResponseHelper
.
buildResponse
(
tzsUserInfoService
.
getGroupAndPersonInfo
(
groupId
));
}
}
//
// @TycloudOperation(ApiLevel = UserType.AGENCY)
// @GetMapping(value = "/testGroup")
// @ApiOperation(httpMethod = "GET", value = "给组内添加人员", notes = "给组内添加人员")
// public ResponseModel<Object> testGroup() {
// tzsUserInfoService.testGroup();
// return ResponseHelper.buildResponse("ok");
// }
}
}
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 @
1810b025
...
@@ -33,6 +33,7 @@ import org.springframework.beans.factory.annotation.Autowired;
...
@@ -33,6 +33,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.StopWatch
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
...
@@ -444,56 +445,56 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI
...
@@ -444,56 +445,56 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI
for
(
CompanyModel
companyModel
:
companyModelList
)
{
for
(
CompanyModel
companyModel
:
companyModelList
)
{
companyMap
.
put
(
companyModel
.
getCompanyCode
(),
companyModel
.
getOrgCode
());
companyMap
.
put
(
companyModel
.
getCompanyCode
(),
companyModel
.
getOrgCode
());
}
}
StopWatch
stopWatch
=
new
StopWatch
();
stopWatch
.
start
();
List
<
String
>
UserIds
=
agencyUserModelList
.
stream
().
map
(
AgencyUserModel:
:
getUserId
).
collect
(
Collectors
.
toList
());
List
<
GroupAndPersonInfoDto
>
groupAndPersonInfoDtoList
=
tzsUserInfoMapper
.
getUnitInfoByUserIds
(
UserIds
);
DataDictionary
dataDictionary
=
iDataDictionaryService
.
getByExtend
(
groupId
.
toString
(),
QYRYGW
);
DataDictionary
dataDictionary
=
iDataDictionaryService
.
getByExtend
(
groupId
.
toString
(),
QYRYGW
);
if
(!
ObjectUtils
.
isEmpty
(
agencyUserModelList
)
&&
agencyUserModelList
.
size
()
>
0
)
{
for
(
GroupAndPersonInfoDto
groupAndPersonInfoDto
:
groupAndPersonInfoDtoList
)
{
for
(
AgencyUserModel
agencyUserModel
:
agencyUserModelList
)
{
if
(!
ObjectUtils
.
isEmpty
(
groupAndPersonInfoDto
))
{
GroupAndPersonInfoDto
groupAndPersonInfoDto
=
tzsUserInfoMapper
.
getUnitInfoByUserId
(
agencyUserModel
.
getUserId
());
groupAndPersonInfoDto
.
setGroupId
(
groupId
);
if
(!
ObjectUtils
.
isEmpty
(
groupAndPersonInfoDto
))
{
groupAndPersonInfoDto
.
setGroupName
(
ObjectUtils
.
isEmpty
(
dataDictionary
)
?
null
:
dataDictionary
.
getName
());
groupAndPersonInfoDto
.
setGroupId
(
groupId
);
String
unitOrgCode
=
String
.
valueOf
(
companyMap
.
get
(
groupAndPersonInfoDto
.
getUnitCode
()));
groupAndPersonInfoDto
.
setGroupName
(
ObjectUtils
.
isEmpty
(
dataDictionary
)
?
null
:
dataDictionary
.
getName
());
groupAndPersonInfoDto
.
setUnitOrgCode
(
"null"
.
equals
(
unitOrgCode
)?
null
:
unitOrgCode
);
String
unitOrgCode
=
String
.
valueOf
(
companyMap
.
get
(
groupAndPersonInfoDto
.
getUnitCode
()));
String
[]
UnitType
=
groupAndPersonInfoDto
.
getUnitType
().
split
(
","
);
groupAndPersonInfoDto
.
setUnitOrgCode
(
"null"
.
equals
(
unitOrgCode
)?
null
:
unitOrgCode
);
if
(
UnitType
.
length
>
0
)
{
groupAndPersonInfoDto
.
setUserId
(
agencyUserModel
.
getUserId
());
StringBuilder
unitTypeCode
=
new
StringBuilder
();
groupAndPersonInfoDto
.
setUserName
(
agencyUserModel
.
getRealName
());
for
(
String
s
:
UnitType
)
{
String
[]
UnitType
=
groupAndPersonInfoDto
.
getUnitType
().
split
(
","
);
unitTypeCode
.
append
(
UnitTypeEnum
.
getCode
.
get
(
s
)).
append
(
","
);
if
(
UnitType
.
length
>
0
)
{
StringBuilder
unitTypeCode
=
new
StringBuilder
();
for
(
String
s
:
UnitType
)
{
unitTypeCode
.
append
(
UnitTypeEnum
.
getCode
.
get
(
s
)).
append
(
","
);
}
groupAndPersonInfoDto
.
setUnitTypeCode
(
unitTypeCode
.
substring
(
0
,
unitTypeCode
.
length
()
-
1
));
}
else
{
groupAndPersonInfoDto
.
setUnitTypeCode
(
UnitTypeEnum
.
getCode
.
get
(
UnitType
));
}
}
groupAndPersonInfoDto
.
setUnitTypeCode
(
unitTypeCode
.
substring
(
0
,
unitTypeCode
.
length
()
-
1
));
}
else
{
groupAndPersonInfoDto
.
setUnitTypeCode
(
UnitTypeEnum
.
getCode
.
get
(
UnitType
));
}
if
(!
ObjectUtils
.
isEmpty
(
groupAndPersonInfoDto
.
getEquipCategory
()))
{
if
(!
ObjectUtils
.
isEmpty
(
groupAndPersonInfoDto
.
getEquipCategory
()))
{
String
EquipCategory
=
groupAndPersonInfoDto
.
getEquipCategory
()
String
EquipCategory
=
groupAndPersonInfoDto
.
getEquipCategory
()
.
replace
(
"["
,
""
)
.
replace
(
"["
,
""
)
.
replace
(
"]"
,
""
)
.
replace
(
"]"
,
""
)
.
replace
(
"\""
,
""
);
.
replace
(
"\""
,
""
);
List
<
String
>
equipCategoryList
=
Arrays
.
asList
(
EquipCategory
.
split
(
","
));
List
<
String
>
equipCategoryList
=
Arrays
.
asList
(
EquipCategory
.
split
(
","
));
if
(
equipCategoryList
.
size
()
>
0
)
{
if
(
equipCategoryList
.
size
()
>
0
)
{
StringBuilder
equipCategoryCode
=
new
StringBuilder
();
StringBuilder
equipCategoryCode
=
new
StringBuilder
();
StringBuilder
equipCategory
=
new
StringBuilder
();
StringBuilder
equipCategory
=
new
StringBuilder
();
for
(
String
s
:
equipCategoryList
)
{
for
(
String
s
:
equipCategoryList
)
{
equipCategoryCode
.
append
(
s
).
append
(
","
);
equipCategoryCode
.
append
(
s
).
append
(
","
);
equipCategory
.
append
(
EquipmentClassifityEnum
.
getName
.
get
(
s
)).
append
(
","
);
equipCategory
.
append
(
EquipmentClassifityEnum
.
getName
.
get
(
s
)).
append
(
","
);
}
groupAndPersonInfoDto
.
setEquipCategory
(
equipCategory
.
substring
(
0
,
equipCategory
.
length
()
-
1
));
groupAndPersonInfoDto
.
setEquipCategoryCode
(
equipCategoryCode
.
substring
(
0
,
equipCategoryCode
.
length
()
-
1
));
}
else
{
groupAndPersonInfoDto
.
setEquipCategory
(
EquipmentClassifityEnum
.
getName
.
get
(
equipCategoryList
.
get
(
0
)));
groupAndPersonInfoDto
.
setEquipCategoryCode
(
equipCategoryList
.
get
(
0
));
}
}
groupAndPersonInfoDto
.
setEquipCategory
(
equipCategory
.
substring
(
0
,
equipCategory
.
length
()
-
1
));
groupAndPersonInfoDto
.
setEquipCategoryCode
(
equipCategoryCode
.
substring
(
0
,
equipCategoryCode
.
length
()
-
1
));
}
else
{
}
else
{
groupAndPersonInfoDto
.
setEquipCategory
(
null
);
groupAndPersonInfoDto
.
setEquipCategory
(
EquipmentClassifityEnum
.
getName
.
get
(
equipCategoryList
.
get
(
0
))
);
groupAndPersonInfoDto
.
setEquipCategoryCode
(
null
);
groupAndPersonInfoDto
.
setEquipCategoryCode
(
equipCategoryList
.
get
(
0
)
);
}
}
result
.
add
(
groupAndPersonInfoDto
);
}
else
{
groupAndPersonInfoDto
.
setEquipCategory
(
null
);
groupAndPersonInfoDto
.
setEquipCategoryCode
(
null
);
}
}
result
.
add
(
groupAndPersonInfoDto
);
}
}
}
}
stopWatch
.
stop
();
System
.
out
.
printf
(
"组装数据耗时%f秒/n"
,
stopWatch
.
getTotalTimeSeconds
());
return
result
;
return
result
;
}
}
...
@@ -503,6 +504,15 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI
...
@@ -503,6 +504,15 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI
return
this
.
saveBatch
(
result
);
return
this
.
saveBatch
(
result
);
}
}
// @Override
// public void testGroup() {
// List<String> userIds = tzsUserInfoMapper.selectUserIds();
// String groupSeq = "1712372080231608322";
// Privilege.groupUserClient.create(Long.valueOf(groupSeq), userIds);
// }
@Override
@Override
public
List
<
Map
<
String
,
Object
>>
getUserType
(
String
unitType
)
{
public
List
<
Map
<
String
,
Object
>>
getUserType
(
String
unitType
)
{
if
(
unitType
.
equals
(
"pro"
))
{
if
(
unitType
.
equals
(
"pro"
))
{
...
...
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