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
293f68ec
Commit
293f68ec
authored
Jul 20, 2022
by
zhangsen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
组态3小API 消防车辆和消防队伍 redis存入用户个人信息
parent
40e45b1f
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
157 additions
and
0 deletions
+157
-0
PersonIdentifyAspect.java
.../com/yeejoin/equipmanage/config/PersonIdentifyAspect.java
+68
-0
ConfigureController.java
...m/yeejoin/equipmanage/controller/ConfigureController.java
+17
-0
JcsFeign.java
...src/main/java/com/yeejoin/equipmanage/fegin/JcsFeign.java
+8
-0
FireFightingSystemMapper.java
.../yeejoin/equipmanage/mapper/FireFightingSystemMapper.java
+4
-0
FireFightingSystemMapper.xml
...ip/src/main/resources/mapper/FireFightingSystemMapper.xml
+60
-0
No files found.
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/config/PersonIdentifyAspect.java
0 → 100644
View file @
293f68ec
package
com
.
yeejoin
.
equipmanage
.
config
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisKey
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.equipmanage.fegin.JcsFeign
;
import
org.apache.commons.lang3.StringUtils
;
import
org.aspectj.lang.JoinPoint
;
import
org.aspectj.lang.annotation.Aspect
;
import
org.aspectj.lang.annotation.Before
;
import
org.aspectj.lang.annotation.Pointcut
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.core.annotation.Order
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.stereotype.Component
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
org.typroject.tyboot.core.foundation.utils.Bean
;
import
java.util.Map
;
/**
* @author DELL
*/
@Aspect
@Component
@ResponseBody
@Order
(
value
=
1
)
public
class
PersonIdentifyAspect
{
@Autowired
RedisUtils
redisUtils
;
@Autowired
private
JcsFeign
jcsFeignClient
;
@Pointcut
(
"execution(public * com.yeejoin.amos.*.business.controller..*(..))"
)
public
void
userDate
()
{
}
@Before
(
"userDate()"
)
public
void
personIdentity
(
JoinPoint
joinPoint
)
{
ReginParams
reginParam
=
JSON
.
parseObject
(
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
())).
toString
(),
ReginParams
.
class
);
if
(
reginParam
!=
null
)
{
if
(
reginParam
.
getPersonIdentity
()
==
null
)
{
String
userId
=
reginParam
.
getUserModel
().
getUserId
();
if
(
userId
!=
null
)
{
FeignClientResult
responseModel
=
jcsFeignClient
.
selectById
(
userId
);
if
(
ObjectUtils
.
isEmpty
(
responseModel
.
getResult
())
||
responseModel
.
getStatus
()
!=
HttpStatus
.
OK
.
value
())
{
throw
new
RuntimeException
(
responseModel
.
getDevMessage
());
}
ReginParams
.
PersonIdentity
personIdentity
=
(
ReginParams
.
PersonIdentity
)
Bean
.
mapToBean
((
Map
<
String
,
Object
>)
responseModel
.
getResult
(),
ReginParams
.
PersonIdentity
.
class
);
reginParam
.
setPersonIdentity
(
personIdentity
);
redisUtils
.
set
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
()),
JSONObject
.
toJSONString
(
reginParam
));
}
}
}
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/controller/ConfigureController.java
View file @
293f68ec
...
@@ -130,5 +130,22 @@ public class ConfigureController extends AbstractBaseController {
...
@@ -130,5 +130,22 @@ public class ConfigureController extends AbstractBaseController {
return
CommonResponseUtil
.
success
(
fireFightingSystemMapper
.
getEquipAlarmInfoNum
(
bizOrgCode
));
return
CommonResponseUtil
.
success
(
fireFightingSystemMapper
.
getEquipAlarmInfoNum
(
bizOrgCode
));
}
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"获取消防力量信息(队伍值班等)"
)
@GetMapping
(
"/getFireTeamInfo"
)
public
ResponseModel
getFireTeamInfo
()
{
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
bizOrgCode
=
!
ValidationUtil
.
isEmpty
(
reginParams
.
getPersonIdentity
())
&&
StringUtil
.
isNotEmpty
(
reginParams
.
getPersonIdentity
().
getBizOrgCode
())
?
reginParams
.
getPersonIdentity
().
getBizOrgCode
()
:
null
;
return
CommonResponseUtil
.
success
(
fireFightingSystemMapper
.
getFireTeamInfo
(
bizOrgCode
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"消防车辆信息"
)
@GetMapping
(
"/getFireCarInfo"
)
public
ResponseModel
getFireCarInfo
()
{
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
bizOrgCode
=
!
ValidationUtil
.
isEmpty
(
reginParams
.
getPersonIdentity
())
&&
StringUtil
.
isNotEmpty
(
reginParams
.
getPersonIdentity
().
getBizOrgCode
())
?
reginParams
.
getPersonIdentity
().
getBizOrgCode
()
:
null
;
return
CommonResponseUtil
.
success
(
fireFightingSystemMapper
.
getFireCarInfo
(
bizOrgCode
));
}
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/fegin/JcsFeign.java
View file @
293f68ec
...
@@ -182,4 +182,12 @@ public interface JcsFeign {
...
@@ -182,4 +182,12 @@ public interface JcsFeign {
@GetMapping
(
value
=
"/org-usr/listCompanyTree"
)
@GetMapping
(
value
=
"/org-usr/listCompanyTree"
)
FeignClientResult
<
List
<
OrgUsrDto
>>
getlistCompanyTree
(
@RequestParam
(
required
=
false
)
String
orgType
);
FeignClientResult
<
List
<
OrgUsrDto
>>
getlistCompanyTree
(
@RequestParam
(
required
=
false
)
String
orgType
);
/**
* 查询用户单位信息
* @param userId 用户id
* @return ResponseModel<ReginParams.PersonIdentity>
*/
@GetMapping
(
value
=
"/org-person/getUser/{id}"
)
FeignClientResult
selectById
(
@PathVariable
String
id
);
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/mapper/FireFightingSystemMapper.java
View file @
293f68ec
...
@@ -240,4 +240,8 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE
...
@@ -240,4 +240,8 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE
List
<
Map
<
String
,
Object
>>
getSystemAlarmInfo
(
@Param
(
"bizOrgCode"
)
String
bizOrgCode
);
List
<
Map
<
String
,
Object
>>
getSystemAlarmInfo
(
@Param
(
"bizOrgCode"
)
String
bizOrgCode
);
List
<
Map
<
String
,
Object
>>
getEquipAlarmInfoNum
(
@Param
(
"bizOrgCode"
)
String
bizOrgCode
);
List
<
Map
<
String
,
Object
>>
getEquipAlarmInfoNum
(
@Param
(
"bizOrgCode"
)
String
bizOrgCode
);
List
<
Map
<
String
,
Object
>>
getFireTeamInfo
(
@Param
(
"bizOrgCode"
)
String
bizOrgCode
);
List
<
Map
<
String
,
Object
>>
getFireCarInfo
(
@Param
(
"bizOrgCode"
)
String
bizOrgCode
);
}
}
amos-boot-system-equip/src/main/resources/mapper/FireFightingSystemMapper.xml
View file @
293f68ec
...
@@ -2418,4 +2418,64 @@
...
@@ -2418,4 +2418,64 @@
</where>
</where>
) AS unConfirmInfoNum
) AS unConfirmInfoNum
</select>
</select>
<select
id=
"getFireTeamInfo"
resultType=
"java.util.Map"
>
SELECT
ifnull( count( 0 ), 0 ) AS `total`,
ifnull( sum(( SELECT count( 0 ) FROM `d_duty_details` `duty` WHERE ( `duty`.`user_id` = `cou`.`sequence_nbr` ))), 0 ) AS `on_duty`,
'志愿消防队'
FROM
( SELECT * FROM `cb_org_usr` WHERE `cb_org_usr`.`is_firefighters` = 1 AND `cb_org_usr`.`type_code` = 117
<if
test=
"bizOrgCode!=null and bizOrgCode!=''"
>
AND biz_org_code = #{bizOrgCode,jdbcType=VARCHAR}
</if>
) `cou` UNION ALL
SELECT
ifnull( count( 0 ), 0 ) AS `total`,
ifnull( sum(( SELECT count( 0 ) FROM `d_duty_details` `duty` WHERE ( `duty`.`user_id` = `cou`.`sequence_nbr` ))), 0 ) AS `on_duty`,
'专职驻站消防队'
FROM
( SELECT * FROM `cb_org_usr` WHERE `cb_org_usr`.`is_firefighters` = 1 AND `cb_org_usr`.`type_code` = 116
<if
test=
"bizOrgCode!=null and bizOrgCode!=''"
>
AND biz_org_code = #{bizOrgCode,jdbcType=VARCHAR}
</if>
) `cou`
</select>
<select
id=
"getFireCarInfo"
resultType=
"java.util.Map"
>
SELECT
IFNULL( sum( a.carStartState ), 0 ) AS carStartNum,
IFNULL( sum( a.carCloseState ), 0 ) AS carCloseNum
FROM
(
SELECT
`wc`.`id` AS `id`,
`wc`.`name` AS `name`,
max(
CASE
WHEN ( `wcp`.`equipment_index_key` = 'FireCar_Start' AND `wcp`.`value` = 'true' ) THEN
1
WHEN ( `wcp`.`equipment_index_key` = 'FireCar_Start' AND `wcp`.`value` = 'false' ) THEN
0
END
) AS `carStartState`,
max(
CASE
WHEN ( `wcp`.`equipment_index_key` = 'FireCar_Start' AND `wcp`.`value` = 'true' ) THEN
0
WHEN ( `wcp`.`equipment_index_key` = 'FireCar_Start' AND `wcp`.`value` = 'false' ) THEN
1
END
) AS `carCloseState`
FROM
`wl_car` `wc`
LEFT JOIN `wl_car_property` `wcp` ON `wcp`.`car_id` = `wc`.`id`
<where>
1=1
<if
test=
"bizOrgCode!=null and bizOrgCode!=''"
>
AND wc.biz_org_code = #{bizOrgCode,jdbcType=VARCHAR}
</if>
</where>
) a
</select>
</mapper>
</mapper>
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