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
410cc538
Commit
410cc538
authored
Dec 14, 2022
by
lisong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加组织机构统计接口
parent
06f3d3aa
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
180 additions
and
0 deletions
+180
-0
OrganizationMapper.java
...n/amos/boot/module/jcs/api/mapper/OrganizationMapper.java
+16
-0
OrganizationService.java
...amos/boot/module/jcs/api/service/OrganizationService.java
+12
-0
OrganizationMapper.xml
...-jcs-api/src/main/resources/mapper/OrganizationMapper.xml
+70
-0
OrganizationController.java
...oot/module/jcs/biz/controller/OrganizationController.java
+60
-0
OrganizationImpl.java
...os/boot/module/jcs/biz/service/impl/OrganizationImpl.java
+22
-0
No files found.
amos-boot-module/amos-boot-module-api/amos-boot-module-jcs-api/src/main/java/com/yeejoin/amos/boot/module/jcs/api/mapper/OrganizationMapper.java
0 → 100644
View file @
410cc538
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jcs
.
api
.
mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.module.common.api.entity.Firefighters
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.Organization
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.Map
;
public
interface
OrganizationMapper
extends
BaseMapper
<
Organization
>
{
Page
<
Map
<
String
,
Object
>>
getOrganizationInfo
(
Page
<
Map
<
String
,
Object
>>
page
,
@Param
(
"bizOrgCode"
)
String
bizOrgCode
);
}
amos-boot-module/amos-boot-module-api/amos-boot-module-jcs-api/src/main/java/com/yeejoin/amos/boot/module/jcs/api/service/OrganizationService.java
0 → 100644
View file @
410cc538
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jcs
.
api
.
service
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
java.util.Map
;
public
interface
OrganizationService
{
Page
<
Map
<
String
,
Object
>>
getOrganizationInfo
(
Page
<
Map
<
String
,
Object
>>
page
,
String
bizOrgCode
);
}
amos-boot-module/amos-boot-module-api/amos-boot-module-jcs-api/src/main/resources/mapper/OrganizationMapper.xml
0 → 100644
View file @
410cc538
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.yeejoin.amos.boot.module.jcs.api.mapper.OrganizationMapper"
>
<select
id=
"getOrganizationInfo"
resultType=
"java.util.Map"
>
SELECT
(
SELECT
Ifnull (GROUP_CONCAT( cou.biz_org_name ),'') AS
value
FROM
(
SELECT
cdfi.field_value AS userId
FROM
cb_dynamic_form_instance cdfi
WHERE
cdfi.instance_id IN (
SELECT
cdps.instance_id
FROM
cb_duty_person_shift cdps
LEFT JOIN cb_dynamic_form_instance cdfi ON cdps.instance_id = cdfi.instance_id
WHERE
cdfi.field_code = 'postType'
AND field_value = '1665'
AND cdps.duty_date = ( SELECT DATE_FORMAT(NOW(),"%Y-%m-%d"))
)
AND cdfi.field_code = 'userId'
) temp
LEFT JOIN cb_org_usr cou ON cou.sequence_nbr = temp.userId
) AS
value
,
'当值值长' AS name UNION
(
SELECT
(
SELECT
count( 1 ) AS num
FROM
cb_org_usr cou
LEFT JOIN cb_dynamic_form_instance cdfi ON cou.sequence_nbr = cdfi.instance_id
WHERE
cou.biz_org_type = 'PERSON'
AND cdfi.field_code = 'peopleType'
AND field_value = '1601'
AND cou.is_delete = 0
AND cou.biz_org_code LIKE CONCAT( #{bizOrgCode}, '%' )
) AS `value`,
'驻站消防员' AS name
) UNION
(
SELECT
( SELECT COUNT( 1 ) FROM cb_organization_user cou WHERE cou.emergency_team_id = co.sequence_nbr ) AS
value
,
co.emergency_team_name AS name
FROM
cb_organization co
ORDER BY
co.sort
LIMIT 4
)
</select>
</mapper>
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/controller/OrganizationController.java
0 → 100644
View file @
410cc538
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jcs
.
biz
.
controller
;
import
com.alibaba.fastjson.JSON
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
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.utils.RedisKey
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.amos.boot.module.common.api.core.framework.PersonIdentify
;
import
com.yeejoin.amos.boot.module.jcs.api.service.OrganizationService
;
import
com.yeejoin.amos.boot.module.common.biz.utils.CommonResponseUtil
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
java.util.Map
;
@RestController
@Api
(
tags
=
"组织机构"
)
@RequestMapping
(
value
=
"/organization"
)
public
class
OrganizationController
extends
BaseController
{
@Autowired
private
RedisUtils
redisUtils
;
@Autowired
private
OrganizationService
organizationService
;
@PersonIdentify
@GetMapping
(
value
=
"/getOrganizationInfo"
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"四横八纵"
,
notes
=
"四横八棕-组织机构"
)
public
ResponseModel
getOrganizationInfo
(
@RequestParam
(
value
=
"pageNumber"
)
int
pageNumber
,
@RequestParam
(
value
=
"pageSize"
)
int
pageSize
)
{
ReginParams
reginParam
=
JSON
.
parseObject
(
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
())).
toString
(),
ReginParams
.
class
);
String
bizOrgCode
=
null
;
if
(
null
!=
reginParam
)
{
bizOrgCode
=
reginParam
.
getPersonIdentity
().
getBizOrgCode
();
if
(
StringUtils
.
isEmpty
(
bizOrgCode
))
{
return
CommonResponseUtil
.
success
(
null
);
}
}
else
{
return
CommonResponseUtil
.
success
(
null
);
}
Page
<
Map
<
String
,
Object
>>
mapPage
=
new
Page
<>(
pageNumber
,
pageSize
);
return
CommonResponseUtil
.
success
(
organizationService
.
getOrganizationInfo
(
mapPage
,
bizOrgCode
));
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/service/impl/OrganizationImpl.java
0 → 100644
View file @
410cc538
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jcs
.
biz
.
service
.
impl
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.module.jcs.api.mapper.OrganizationMapper
;
import
com.yeejoin.amos.boot.module.jcs.api.service.OrganizationService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.Map
;
@Service
public
class
OrganizationImpl
implements
OrganizationService
{
@Autowired
private
OrganizationMapper
organizationMapper
;
@Override
public
Page
<
Map
<
String
,
Object
>>
getOrganizationInfo
(
Page
<
Map
<
String
,
Object
>>
page
,
String
bizOrgCode
)
{
return
organizationMapper
.
getOrganizationInfo
(
page
,
bizOrgCode
);
}
}
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