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
572b0d5b
Commit
572b0d5b
authored
Jul 13, 2021
by
taabe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改配置文件;添加根据指定时间查询警情列表接口
parent
5d52e8dc
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
155 additions
and
50 deletions
+155
-50
application.properties
...boot-jcs-system/src/main/resources/application.properties
+1
-1
DutyInfoEnum.java
.../yeejoin/amos/boot/module/jcs/api/enums/DutyInfoEnum.java
+21
-0
AlertFormValueMapper.java
...amos/boot/module/jcs/api/mapper/AlertFormValueMapper.java
+13
-0
AlertFormValueMapper.xml
...cs-api/src/main/resources/mapper/AlertFormValueMapper.xml
+18
-0
AlertCalledController.java
...boot/module/jcs/biz/controller/AlertCalledController.java
+16
-0
AlertCalledServiceImpl.java
...t/module/jcs/biz/service/impl/AlertCalledServiceImpl.java
+59
-42
AlertFormValueServiceImpl.java
...odule/jcs/biz/service/impl/AlertFormValueServiceImpl.java
+26
-6
AlertSubmittedServiceImpl.java
...odule/jcs/biz/service/impl/AlertSubmittedServiceImpl.java
+1
-1
No files found.
amos-boot-jcs-system/src/main/resources/application.properties
View file @
572b0d5b
spring.application.name
=
JCS
_FPY
spring.application.name
=
JCS
server.servlet.context-path
=
/jcs
server.servlet.context-path
=
/jcs
server.port
=
11100
server.port
=
11100
spring.profiles.active
=
dev
spring.profiles.active
=
dev
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-jcs-api/src/main/java/com/yeejoin/amos/boot/module/jcs/api/enums/DutyInfoEnum.java
0 → 100644
View file @
572b0d5b
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jcs
.
api
.
enums
;
import
lombok.AllArgsConstructor
;
import
lombok.Getter
;
/**
* 值班情况枚举
*
* @author DELL
*/
@Getter
@AllArgsConstructor
public
enum
DutyInfoEnum
{
// 接警情况
接警情况
(
"JJQK"
,
"接警情况"
),
// 出动状态
力量出动
(
"LLCD"
,
"出动状态"
);
private
String
key
;
private
String
name
;
}
amos-boot-module/amos-boot-module-api/amos-boot-module-jcs-api/src/main/java/com/yeejoin/amos/boot/module/jcs/api/mapper/AlertFormValueMapper.java
View file @
572b0d5b
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jcs
.
api
.
mapper
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jcs
.
api
.
mapper
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.AlertFormValueDto
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.AlertFormValueDto
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.AlertFormValue
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.AlertFormValue
;
import
org.apache.ibatis.annotations.Param
;
/**
/**
* Mapper 接口
* Mapper 接口
...
@@ -16,4 +18,15 @@ public interface AlertFormValueMapper extends BaseMapper<AlertFormValue> {
...
@@ -16,4 +18,15 @@ public interface AlertFormValueMapper extends BaseMapper<AlertFormValue> {
public
List
<
AlertFormValueDto
>
selectListByCalledId
(
Long
id
);
public
List
<
AlertFormValueDto
>
selectListByCalledId
(
Long
id
);
/**
* 列转行查询
*
* @param fieldCodes 列
* @param groupCode 分组code
* @return List<Map>
*/
List
<
Map
<
String
,
Object
>>
listAll
(
@Param
(
"fieldCodes"
)
List
<
String
>
fieldCodes
,
@Param
(
"groupCode"
)
String
groupCode
);
}
}
amos-boot-module/amos-boot-module-api/amos-boot-module-jcs-api/src/main/resources/mapper/AlertFormValueMapper.xml
View file @
572b0d5b
...
@@ -22,4 +22,22 @@
...
@@ -22,4 +22,22 @@
LEFT JOIN jc_alert_form f ON f.sequence_nbr = v.alert_form_id
LEFT JOIN jc_alert_form f ON f.sequence_nbr = v.alert_form_id
WHERE v.alert_called_id=#{id}
WHERE v.alert_called_id=#{id}
</select>
</select>
<select
id=
"listAll"
resultType=
"java.util.Map"
>
select
d.*
from
(
select
i.alert_called_id instanceId,
i.alert_type_code groupCode,
<foreach
collection=
"fieldCodes"
item=
"item"
index=
"key"
separator=
","
>
MAX(CASE WHEN i.FIELD_CODE = #{item} THEN i.FIELD_VALUE END) as ${item}
</foreach>
from
jc_alert_form_value i
where i.alert_type_code = #{groupCode}
GROUP by
i.alert_called_id)d
order by instanceId
</select>
</mapper>
</mapper>
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/controller/AlertCalledController.java
View file @
572b0d5b
...
@@ -4,6 +4,7 @@ import java.lang.reflect.Field;
...
@@ -4,6 +4,7 @@ import java.lang.reflect.Field;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
import
java.util.stream.Stream
;
import
java.util.stream.Stream
;
...
@@ -21,6 +22,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
...
@@ -21,6 +22,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.foundation.utils.CommonUtil
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
...
@@ -292,4 +294,17 @@ public class AlertCalledController extends BaseController {
...
@@ -292,4 +294,17 @@ public class AlertCalledController extends BaseController {
});
});
return
queryWrapper
;
return
queryWrapper
;
}
}
/**
* 查询指定日期内警情列表
*
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/dateRange/list"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"查询指定日期内警情列表"
,
notes
=
"查询指定日期内警情列表"
)
public
ResponseModel
<
List
<
Map
<
String
,
Object
>>>
listByDateRange
(
@RequestParam
(
"beginDate"
)
String
beginDate
,
@RequestParam
(
"endDate"
)
String
endDate
)
{
return
ResponseHelper
.
buildResponse
(
iAlertCalledService
.
listByDateRange
(
beginDate
,
endDate
));
}
}
}
\ No newline at end of file
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/service/impl/AlertCalledServiceImpl.java
View file @
572b0d5b
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jcs
.
biz
.
service
.
impl
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jcs
.
biz
.
service
.
impl
;
import
java.util.Date
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
java.util.List
;
import
javax.annotation.Resource
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisKey
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisKey
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
...
@@ -20,6 +11,16 @@ import com.yeejoin.amos.boot.module.jcs.api.entity.AlertFormValue;
...
@@ -20,6 +11,16 @@ import com.yeejoin.amos.boot.module.jcs.api.entity.AlertFormValue;
import
com.yeejoin.amos.boot.module.jcs.api.enums.AlertStageEnums
;
import
com.yeejoin.amos.boot.module.jcs.api.enums.AlertStageEnums
;
import
com.yeejoin.amos.boot.module.jcs.api.mapper.AlertCalledMapper
;
import
com.yeejoin.amos.boot.module.jcs.api.mapper.AlertCalledMapper
;
import
com.yeejoin.amos.boot.module.jcs.api.service.IAlertCalledService
;
import
com.yeejoin.amos.boot.module.jcs.api.service.IAlertCalledService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
javax.annotation.Resource
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
/**
/**
* 警情接警记录 服务实现类
* 警情接警记录 服务实现类
...
@@ -43,13 +44,16 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
...
@@ -43,13 +44,16 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
@Autowired
@Autowired
RuleAlertCalledService
ruleAlertCalledService
;
RuleAlertCalledService
ruleAlertCalledService
;
public
static
String
GROUP_CODE
=
"229"
;
/**
/**
*
*
* <pre>
* <pre>
* 保存警情信息
* 保存警情信息
* </pre>
* </pre>
*
*
* @param alertCalled
V
o
* @param alertCalled
ObjsDt
o
* @return
* @return
*/
*/
@Transactional
@Transactional
...
@@ -118,46 +122,59 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
...
@@ -118,46 +122,59 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
throw
new
RuntimeException
(
"报送失败,系统异常!"
);
throw
new
RuntimeException
(
"报送失败,系统异常!"
);
}
}
}
}
/*
/**
* 根据id 修改警情
* 根据id 修改警情
* type:警情相关 操作类型 0警情续报 1非警情确认 2 警情结案
* type:警情相关 操作类型 0警情续报 1非警情确认 2 警情结案
* */
*
*/
@Override
@Override
@Transactional
@Transactional
(
rollbackFor
=
RuntimeException
.
class
)
public
boolean
updateAlertCalled
(
Long
id
,
String
code
)
{
public
boolean
updateAlertCalled
(
Long
id
,
String
code
)
{
// TODO Auto-generated method stub
// TODO Auto-generated method stub
try
{
try
{
switch
(
code
)
{
switch
(
code
)
{
case
"314"
:
case
"314"
:
alertCalledMapper
.
update
(
null
,
new
UpdateWrapper
<
AlertCalled
>().
eq
(
"sequence_nbr"
,
id
)
alertCalledMapper
.
update
(
null
,
new
UpdateWrapper
<
AlertCalled
>().
eq
(
"sequence_nbr"
,
id
)
.
set
(
"alert_status"
,
1
).
set
(
"alert_stage"
,
AlertStageEnums
.
ZBQJ
.
getValue
()).
set
(
"alarm_type"
,
AlertStageEnums
.
FJQ
.
getValue
()).
set
(
"alarm_type_code"
,
AlertStageEnums
.
FJQ
.
getCode
())
);
.
set
(
"alert_status"
,
1
).
set
(
"alert_stage"
,
AlertStageEnums
.
ZBQJ
.
getValue
()).
set
(
"alarm_type"
,
AlertStageEnums
.
FJQ
.
getValue
()).
set
(
"alarm_type_code"
,
AlertStageEnums
.
FJQ
.
getCode
()));
break
;
break
;
case
"315"
:
case
"315"
:
alertCalledMapper
.
update
(
null
,
new
UpdateWrapper
<
AlertCalled
>().
eq
(
"sequence_nbr"
,
id
)
alertCalledMapper
.
update
(
null
,
new
UpdateWrapper
<
AlertCalled
>().
eq
(
"sequence_nbr"
,
id
)
.
set
(
"alert_status"
,
1
).
set
(
"alert_stage"
,
AlertStageEnums
.
CZJS
.
getValue
())
);
.
set
(
"alert_status"
,
1
).
set
(
"alert_stage"
,
AlertStageEnums
.
CZJS
.
getValue
()));
break
;
break
;
default
:
default
:
alertCalledMapper
.
update
(
null
,
new
UpdateWrapper
<
AlertCalled
>().
eq
(
"sequence_nbr"
,
id
)
alertCalledMapper
.
update
(
null
,
new
UpdateWrapper
<
AlertCalled
>().
eq
(
"sequence_nbr"
,
id
)
.
set
(
"alert_stage"
,
AlertStageEnums
.
CZGZ
.
getValue
()));
.
set
(
"alert_stage"
,
AlertStageEnums
.
CZGZ
.
getValue
()));
break
;
break
;
}
}
AlertCalled
alertCalled
=
this
.
getById
(
id
);
AlertCalled
alertCalled
=
this
.
getById
(
id
);
//删除缓存
//删除缓存
redisUtils
.
del
(
RedisKey
.
ALERTCALLED_ID
+
id
);
redisUtils
.
del
(
RedisKey
.
ALERTCALLED_ID
+
id
);
/**
/**
* 同步更新存ES
* 同步更新存ES
*/
*/
eSAlertCalledService
.
saveAlertCalledToES
(
alertCalled
);
eSAlertCalledService
.
saveAlertCalledToES
(
alertCalled
);
return
true
;
return
true
;
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
throw
new
RuntimeException
(
"系统异常!"
);
throw
new
RuntimeException
(
"系统异常!"
);
}
}
}
}
/**
* 根据时间区间查询警情列表信息
*
* @param beginDate 开始时间
* @param endDate 结束时间
*/
public
List
<
Map
<
String
,
Object
>>
listByDateRange
(
String
beginDate
,
String
endDate
)
{
List
<
AlertCalled
>
alertCalledDtoList
=
this
.
list
(
new
LambdaQueryWrapper
<
AlertCalled
>().
between
(
AlertCalled:
:
getCallTime
,
beginDate
,
endDate
));
Map
<
String
,
List
<
AlertCalled
>>
alertCalledMap
=
alertCalledDtoList
.
stream
().
collect
(
Collectors
.
groupingBy
(
AlertCalled:
:
getAlertTypeCode
));
List
<
Map
<
String
,
Object
>>
formValueList
=
iAlertFormValueService
.
listAll
(
GROUP_CODE
);
return
null
;
}
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/service/impl/AlertFormValueServiceImpl.java
View file @
572b0d5b
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jcs
.
biz
.
service
.
impl
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jcs
.
biz
.
service
.
impl
;
import
java.util.List
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.google.common.collect.Lists
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.AlertFormValueDto
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.AlertFormValueDto
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.AlertForm
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.AlertFormValue
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.AlertFormValue
;
import
com.yeejoin.amos.boot.module.jcs.api.mapper.AlertFormValueMapper
;
import
com.yeejoin.amos.boot.module.jcs.api.mapper.AlertFormValueMapper
;
import
com.yeejoin.amos.boot.module.jcs.api.service.IAlertFormValueService
;
import
com.yeejoin.amos.boot.module.jcs.api.service.IAlertFormValueService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.typroject.tyboot.core.foundation.utils.Bean
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
java.util.Collections
;
import
java.util.List
;
import
java.util.Map
;
/**
/**
...
@@ -23,6 +28,9 @@ public class AlertFormValueServiceImpl extends BaseService<AlertFormValueDto,Al
...
@@ -23,6 +28,9 @@ public class AlertFormValueServiceImpl extends BaseService<AlertFormValueDto,Al
@Autowired
@Autowired
private
AlertFormValueMapper
alertFormValueMapper
;
private
AlertFormValueMapper
alertFormValueMapper
;
@Autowired
private
AlertFormServiceImpl
alertFormService
;
public
List
<
AlertFormValueDto
>
queryByCalledId
(
Long
alertCalledId
)
{
public
List
<
AlertFormValueDto
>
queryByCalledId
(
Long
alertCalledId
)
{
return
this
.
queryForList
(
null
,
false
,
alertCalledId
);
return
this
.
queryForList
(
null
,
false
,
alertCalledId
);
...
@@ -32,4 +40,16 @@ public class AlertFormValueServiceImpl extends BaseService<AlertFormValueDto,Al
...
@@ -32,4 +40,16 @@ public class AlertFormValueServiceImpl extends BaseService<AlertFormValueDto,Al
return
alertFormValueMapper
.
selectListByCalledId
(
id
);
return
alertFormValueMapper
.
selectListByCalledId
(
id
);
}
}
/**
* 根据动态表单分组类型查询改分组下所有数据实例
*
* @param groupCode
* @return List<Map <String, Object>>
*/
public
List
<
Map
<
String
,
Object
>>
listAll
(
String
groupCode
)
{
List
<
AlertForm
>
columns
=
alertFormService
.
list
(
new
LambdaQueryWrapper
<
AlertForm
>().
eq
(
AlertForm:
:
getAlertTypeCode
,
groupCode
));
List
<
String
>
fieldCodes
=
Lists
.
transform
(
columns
,
AlertForm:
:
getFieldCode
);
return
this
.
baseMapper
.
listAll
(
fieldCodes
,
groupCode
);
}
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/service/impl/AlertSubmittedServiceImpl.java
View file @
572b0d5b
...
@@ -392,7 +392,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
...
@@ -392,7 +392,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
"JQBSLX"
));
"JQBSLX"
));
for
(
DataDictionary
dataDictionary
:
dataDictionaries
)
{
for
(
DataDictionary
dataDictionary
:
dataDictionaries
)
{
Template
template
=
templateService
.
getOne
(
new
QueryWrapper
<
Template
>().
eq
(
"type_code"
,
Template
template
=
templateService
.
getOne
(
new
QueryWrapper
<
Template
>().
eq
(
"type_code"
,
dataDictionary
.
getCode
()));
dataDictionary
.
getCode
())
.
eq
(
"format"
,
true
)
);
List
<
PowerTransferCompanyDto
>
lastPowerTransferCompany
;
List
<
PowerTransferCompanyDto
>
lastPowerTransferCompany
;
if
(
"警情续报"
.
equals
(
template
.
getType
())
&&
(
lastPowerTransferCompany
=
if
(
"警情续报"
.
equals
(
template
.
getType
())
&&
(
lastPowerTransferCompany
=
powerTransferService
.
getLastPowerTransferCompany
(
alertCalledId
)).
size
()
>
0
)
{
powerTransferService
.
getLastPowerTransferCompany
(
alertCalledId
)).
size
()
>
0
)
{
...
...
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