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
e2d0faf0
Commit
e2d0faf0
authored
Aug 06, 2021
by
chenhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交修改BUG代码 by 陈浩
parent
5ff596b7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
252 additions
and
130 deletions
+252
-130
LinkageUnitDto.java
...ejoin/amos/boot/module/common/api/dto/LinkageUnitDto.java
+8
-1
LinkageUnitMapper.java
...amos/boot/module/common/api/mapper/LinkageUnitMapper.java
+25
-5
ILinkageUnitService.java
...s/boot/module/common/api/service/ILinkageUnitService.java
+40
-31
LinkageUnitMapper.xml
...ommon-api/src/main/resources/mapper/LinkageUnitMapper.xml
+133
-57
LinkageUnitController.java
...t/module/common/biz/controller/LinkageUnitController.java
+37
-27
LinkageUnitServiceImpl.java
...odule/common/biz/service/impl/LinkageUnitServiceImpl.java
+0
-0
RemoteWorkFlowService.java
...join/amos/patrol/common/remote/RemoteWorkFlowService.java
+9
-9
No files found.
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/dto/LinkageUnitDto.java
View file @
e2d0faf0
...
...
@@ -10,6 +10,8 @@ import lombok.EqualsAndHashCode;
import
java.util.Date
;
import
java.util.List
;
import
org.omg.CORBA.PRIVATE_MEMBER
;
/**
* 联动单位
*
...
...
@@ -98,5 +100,10 @@ public class LinkageUnitDto extends BaseDto {
@ApiModelProperty
(
value
=
"联动单位图片"
)
private
List
<
SourceFile
>
image
;
@ApiModelProperty
(
value
=
"车辆数量"
)
private
String
vehicleNumber
;
@ApiModelProperty
(
value
=
"特岗人数"
)
private
String
personNumber
;
}
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/mapper/LinkageUnitMapper.java
View file @
e2d0faf0
package
com
.
yeejoin
.
amos
.
boot
.
module
.
common
.
api
.
mapper
;
import
java.util.List
;
import
java.util.Map
;
import
org.apache.ibatis.annotations.Param
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.yeejoin.amos.boot.module.common.api.dto.CompanyDto
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.module.common.api.dto.LinkageUnitDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.LinkageUnitZhDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.RequestData
;
import
com.yeejoin.amos.boot.module.common.api.entity.LinkageUnit
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
import
java.util.Map
;
/**
* 联动单位 Mapper 接口
...
...
@@ -43,4 +45,22 @@ public interface LinkageUnitMapper extends BaseMapper<LinkageUnit> {
List
<
LinkageUnitZhDto
>
listLinkageUnitZhDto
(
@Param
(
"pageNum"
)
int
pageNum
,
@Param
(
"pageSize"
)
int
pageSize
,
@Param
(
"par"
)
RequestData
par
);
Integer
listLinkageUnitZhDtoCount
(
@Param
(
"par"
)
RequestData
par
);
/**
* 查询当前存在的联动单位及统计
* @param isDelete
* @param emergencyLinkageUnitCode
* @return
*/
List
<
Map
<
String
,
Object
>>
getEmergencyLinkageUnitCodeGroupByAndCount
();
/**
* 查询包含特岗人数及的具体信息
* @return
*/
Page
<
List
<
LinkageUnitDto
>>
getEmergencyLinkageUnitList
(
IPage
<
LinkageUnitDto
>
page
,
String
unitName
,
String
linkageUnitTypeCode
,
String
emergencyLinkageUnitCode
);
}
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/service/ILinkageUnitService.java
View file @
e2d0faf0
package
com
.
yeejoin
.
amos
.
boot
.
module
.
common
.
api
.
service
;
import
java.util.List
;
import
org.typroject.tyboot.core.rdbms.annotation.Condition
;
import
org.typroject.tyboot.core.rdbms.annotation.Operator
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.biz.common.utils.Menu
;
import
com.yeejoin.amos.boot.module.common.api.dto.LinkageUnitDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.LinkageUnitZhDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.RequestData
;
import
org.typroject.tyboot.core.rdbms.annotation.Condition
;
import
org.typroject.tyboot.core.rdbms.annotation.Operator
;
import
java.util.List
;
import
com.yeejoin.amos.boot.module.common.api.entity.LinkageUnit
;
/**
* 联动单位接口类
*
* @author system_generator
* @date 2021-07-16
*/
* 联动单位接口类
*
* @author system_generator
* @date 2021-07-16
*/
public
interface
ILinkageUnitService
{
List
<
LinkageUnitZhDto
>
listLinkageUnitZhDto
(
Integer
pageNum
,
Integer
pageSize
,
RequestData
par
);
Integer
listLinkageUnitZhDtoCount
(
RequestData
par
);
LinkageUnitDto
queryOne
(
Long
sequenceNbr
);
/**
* 联动单位分页查询
*
* @param page
* @param isDelete
* @param unitName 单位名称
* @param linkageUnitType 联动单位类型
* @param emergencyLinkageUnitCode 紧急联动单位类型code
* @return
*/
Page
<
LinkageUnitDto
>
queryForLinkageUnitPage
(
Page
<
LinkageUnitDto
>
page
,
@Condition
(
Operator
.
eq
)
Boolean
isDelete
,
@Condition
(
Operator
.
like
)
String
unitName
,
@Condition
(
Operator
.
eq
)
String
linkageUnitType
,
@Condition
(
Operator
.
eq
)
String
emergencyLinkageUnitCode
);
List
<
LinkageUnitZhDto
>
listLinkageUnitZhDto
(
Integer
pageNum
,
Integer
pageSize
,
RequestData
par
);
Integer
listLinkageUnitZhDtoCount
(
RequestData
par
);
LinkageUnitDto
queryOne
(
Long
sequenceNbr
);
/**
* 联动单位分页查询
*
* @param page
* @param isDelete
* @param unitName 单位名称
* @param linkageUnitType 联动单位类型
* @param emergencyLinkageUnitCode 紧急联动单位类型code
* @return
*/
Page
<
LinkageUnitDto
>
queryForLinkageUnitPage
(
IPage
<
LinkageUnitDto
>
page
,
@Condition
(
Operator
.
eq
)
Boolean
isDelete
,
@Condition
(
Operator
.
like
)
String
unitName
,
@Condition
(
Operator
.
eq
)
String
linkageUnitTypeCode
,
@Condition
(
Operator
.
eq
)
String
emergencyLinkageUnitCode
,
String
inAgreement
);
/**
* 获取当前存在的联动单位的类型组code
* @return
*/
public
List
<
Menu
>
getEmergencyLinkageUnitCodeGroupBy
(
String
type
,
String
rootName
)
;
}
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/resources/mapper/LinkageUnitMapper.xml
View file @
e2d0faf0
<?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.common.api.mapper.LinkageUnitMapper"
>
<select
id=
"selectOne"
resultType=
"com.yeejoin.amos.boot.module.common.api.dto.LinkageUnitDto"
>
select
d.*,
lu.*
from
(
select
i.INSTANCE_ID instanceId,
i.GROUP_CODE groupCode,
<foreach
collection=
"fieldCodes"
item=
"value"
index=
"key"
separator=
","
>
MAX(CASE WHEN i.FIELD_CODE = #{key} THEN i.FIELD_VALUE END) as ${key}
</foreach>
from
cb_dynamic_form_instance i
where i.GROUP_CODE = #{groupCode}
and is_delete = #{isDelete}
GROUP by
i.INSTANCE_ID ) d,
cb_linkage_unit lu
where
d.instanceId = lu.instance_id
and lu.sequence_nbr = #{sequenceNbr}
and is_delete = #{isDelete}
</select>
<select
id=
"listLinkageUnitZhDto"
resultType=
"com.yeejoin.amos.boot.module.common.api.dto.LinkageUnitZhDto"
>
select
a.sequence_nbr sequenceNbr,
a.unit_name unitName,
a.address,
a.latitude,
a.longitude,
Round(st_distance(point(a.longitude,a.latitude),point(#{par.longitude},#{par.latitude}))*111195,1) AS distance
FROM cb_linkage_unit a
where a.longitude is not null and a.latitude is not null
<if
test=
'par.distance!=null'
>
and Round(st_distance(point(a.longitude,a.latitude),point(#{par.longitude},#{par.latitude}))*111195,1)
<
=
#{par.distance}
</if>
ORDER BY distance limit #{pageNum},#{pageSize}
</select>
<select
id=
"listLinkageUnitZhDtoCount"
resultType=
"Integer"
>
select
COUNT(a.sequence_nbr) num
FROM cb_linkage_unit a
where a.longitude is not null and a.latitude is not null
<if
test=
'par.distance!=null'
>
and Round(st_distance(point(a.longitude,a.latitude),point(#{par.longitude},#{par.latitude}))*111195,1)
<
=
#{par.distance}
</if>
</select>
<mapper
namespace=
"com.yeejoin.amos.boot.module.common.api.mapper.LinkageUnitMapper"
>
<select
id=
"selectOne"
resultType=
"com.yeejoin.amos.boot.module.common.api.dto.LinkageUnitDto"
>
select
d.*,
lu.*
from
(
select
i.INSTANCE_ID instanceId,
i.GROUP_CODE
groupCode,
<foreach
collection=
"fieldCodes"
item=
"value"
index=
"key"
separator=
","
>
MAX(CASE WHEN i.FIELD_CODE = #{key} THEN i.FIELD_VALUE END)
as ${key}
</foreach>
from
cb_dynamic_form_instance i
where i.GROUP_CODE = #{groupCode}
and
is_delete = #{isDelete}
GROUP by
i.INSTANCE_ID ) d,
cb_linkage_unit lu
where
d.instanceId = lu.instance_id
and lu.sequence_nbr = #{sequenceNbr}
and is_delete = #{isDelete}
</select>
<select
id=
"listLinkageUnitZhDto"
resultType=
"com.yeejoin.amos.boot.module.common.api.dto.LinkageUnitZhDto"
>
select
a.sequence_nbr sequenceNbr,
a.unit_name unitName,
a.address,
a.latitude,
a.longitude,
Round(st_distance(point(a.longitude,a.latitude),point(#{par.longitude},#{par.latitude}))*111195,1)
AS distance
FROM cb_linkage_unit a
where a.longitude is not null and
a.latitude is not null
<if
test=
'par.distance!=null'
>
and
Round(st_distance(point(a.longitude,a.latitude),point(#{par.longitude},#{par.latitude}))*111195,1)
<
=
#{par.distance}
</if>
ORDER BY distance limit #{pageNum},#{pageSize}
</select>
<select
id=
"listLinkageUnitZhDtoCount"
resultType=
"Integer"
>
select
COUNT(a.sequence_nbr) num
FROM cb_linkage_unit a
where a.longitude
is not null and a.latitude is not null
<if
test=
'par.distance!=null'
>
and
Round(st_distance(point(a.longitude,a.latitude),point(#{par.longitude},#{par.latitude}))*111195,1)
<
=
#{par.distance}
</if>
</select>
<select
id=
"getEmergencyLinkageUnitCodeGroupByAndCount"
resultType=
"java.util.Map"
>
SELECT
emergency_linkage_unit_code as
emergencyLinkageUnitCode,
COUNT(unit_code) AS count
FROM
cb_linkage_unit
WHERE
is_delete = 0
GROUP BY
emergency_linkage_unit_code
</select>
<select
id=
"getEmergencyLinkageUnitList"
resultType=
"java.util.Map"
>
SELECT
clu.sequence_nbr as sequenceNbr,
clu.unit_name as unitName,
clu.unit_code AS unitCode,
clu.parent_id AS parentId,
clu.linkage_unit_type AS linkageUnitType,
clu.linkage_unit_type_code AS linkageUnitTypeCode,
clu.administrative_divisions AS administrativeDivisions,
clu.administrative_divisions_code AS administrativeDivisionsCode,
clu.address AS address,
clu.longitude AS longitude,
clu.latitude AS latitude,
clu.agreement_start_date AS agreementStartDate,
clu.agreement_end_date AS agreementEndDate,
clu.emergency_linkage_unit AS emergencyLinkageUnit,
clu.emergency_linkage_unit_code AS emergencyLinkageUnitCode,
clu.contact_user AS contactUser,
clu.contact_phone AS contactPhone,
clu.instance_id AS instanceId,
clu.org_code AS orgCode,
clu.rec_user_name AS recUserName,
clu.rec_user_id AS recUserId,
clu.rec_date AS recDate,
clu.is_delete AS isDelete,
cre.vehicle_number AS vehicleNumber,
csps.person_number AS personNumber
FROM
cb_linkage_unit clu
LEFT JOIN cb_rescue_equipment cre ON clu.sequence_nbr = cre.company_id
LEFT JOIN cb_special_position_staff csps ON clu.sequence_nbr =
csps.company_id
WHERE clu.is_delete=0
<if
test=
"unitName != null and unitName != ''"
>
AND clu.unit_name LIKE concat(#{unitName}, '%')
</if>
<if
test=
"linkageUnitTypeCode != null and linkageUnitTypeCode != ''"
>
AND clu.linkage_unit_type_code =#{linkageUnitTypeCode}
</if>
<if
test=
"emergencyLinkageUnitCode != null and emergencyLinkageUnitCode != ''"
>
AND clu.emergency_linkage_unit_code =#{emergencyLinkageUnitCode}
</if>
</select>
</mapper>
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/controller/LinkageUnitController.java
View file @
e2d0faf0
package
com
.
yeejoin
.
amos
.
boot
.
module
.
common
.
biz
.
controller
;
import
com.yeejoin.amos.boot.biz.common.utils.DateUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.Api
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.stream.Collectors
;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.LinkageUnitServiceImpl
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.DeleteMapping
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.PutMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
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.enumeration.UserType
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.module.common.api.dto.LinkageUnitDto
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
com.yeejoin.amos.boot.module.common.api.entity.LinkageUnit
;
import
com.yeejoin.amos.boot.module.common.api.service.ILinkageUnitService
;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.LinkageUnitServiceImpl
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
/**
...
...
@@ -37,6 +41,9 @@ public class LinkageUnitController extends BaseController {
@Autowired
LinkageUnitServiceImpl
linkageUnitServiceImpl
;
@Autowired
ILinkageUnitService
linkageUnitService
;
/**
* 新增联动单位
...
...
@@ -116,20 +123,12 @@ public class LinkageUnitController extends BaseController {
@GetMapping
(
value
=
"/page"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"联动单位分页查询"
,
notes
=
"联动单位分页查询"
)
public
ResponseModel
<
Page
<
LinkageUnitDto
>>
queryForPage
(
@RequestParam
(
value
=
"current"
)
int
current
,
@RequestParam
(
value
=
"size"
)
int
size
,
String
unitName
,
String
linkageUnitType
,
String
inAgreement
,
String
emergencyLinkageUnitCode
)
{
Page
<
LinkageUnitDto
>
page
=
new
Page
<
LinkageUnitDto
>();
(
value
=
"size"
)
int
size
,
String
unitName
,
String
linkageUnitType
Code
,
String
inAgreement
,
String
emergencyLinkageUnitCode
)
{
Page
<
LinkageUnitDto
>
page
=
new
Page
<
LinkageUnitDto
>();
page
.
setCurrent
(
current
);
page
.
setSize
(
size
);
Page
<
LinkageUnitDto
>
linkageUnitDtoPage
=
linkageUnitServiceImpl
.
queryForLinkageUnitPage
(
page
,
false
,
unitName
,
linkageUnitType
,
emergencyLinkageUnitCode
);
Date
now
=
new
Date
();
List
<
LinkageUnitDto
>
linkageUnitDtoList
=
linkageUnitDtoPage
.
getRecords
().
stream
().
map
(
item
->
{
boolean
isInAgreement
=
DateUtils
.
belongCalendar
(
now
,
item
.
getAgreementStartDate
(),
item
.
getAgreementEndDate
());
item
.
setInAgreement
(
isInAgreement
?
"是"
:
"否"
);
return
item
;
}).
filter
(
item
->
StringUtils
.
isEmpty
(
inAgreement
)
||
inAgreement
.
equals
(
item
.
getInAgreement
())).
collect
(
Collectors
.
toList
());
linkageUnitDtoPage
.
setRecords
(
linkageUnitDtoList
);
Page
<
LinkageUnitDto
>
linkageUnitDtoPage
=
linkageUnitServiceImpl
.
queryForLinkageUnitPage
(
page
,
false
,
unitName
,
linkageUnitTypeCode
,
emergencyLinkageUnitCode
,
inAgreement
);
return
ResponseHelper
.
buildResponse
(
linkageUnitDtoPage
);
}
...
...
@@ -144,4 +143,15 @@ public class LinkageUnitController extends BaseController {
public
ResponseModel
<
List
<
LinkageUnitDto
>>
selectForList
()
{
return
ResponseHelper
.
buildResponse
(
linkageUnitServiceImpl
.
queryForLinkageUnitList
(
false
));
}
/**
* 列表全部数据查询
*
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"联动单位列表树及统计"
,
notes
=
"联动单位列表树及统计"
)
@GetMapping
(
value
=
"/getLinkageUnitTree"
)
public
ResponseModel
<
Object
>
getLinkageUnitTree
(
@RequestParam
String
type
,
@RequestParam
String
rootName
)
{
return
ResponseHelper
.
buildResponse
(
linkageUnitService
.
getEmergencyLinkageUnitCodeGroupBy
(
type
,
rootName
));
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/service/impl/LinkageUnitServiceImpl.java
View file @
e2d0faf0
This diff is collapsed.
Click to expand it.
amos-boot-module/amos-boot-module-biz/amos-boot-module-patrol-biz/src/main/java/com/yeejoin/amos/patrol/common/remote/RemoteWorkFlowService.java
View file @
e2d0faf0
package
com
.
yeejoin
.
amos
.
patrol
.
common
.
remote
;
import
java.util.Map
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.StringUtils
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.google.common.collect.Maps
;
import
com.yeejoin.amos.patrol.business.constants.XJConstant
;
import
com.yeejoin.amos.patrol.business.param.LatentDangerListParam
;
import
com.yeejoin.amos.patrol.business.util.HttpUtil
;
import
com.yeejoin.amos.patrol.common.enums.WorkFlowUriEnum
;
import
com.yeejoin.amos.patrol.common.enums.YesOrNoEnum
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.StringUtils
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
java.util.Map
;
@Service
(
"remoteWorkFlowService"
)
public
class
RemoteWorkFlowService
{
...
...
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