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
1ce21c8e
Commit
1ce21c8e
authored
Jan 17, 2022
by
tianbo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
隐患bug修改
parent
dbb5b528
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
38 additions
and
27 deletions
+38
-27
DateUtils.java
...ava/com/yeejoin/amos/boot/biz/common/utils/DateUtils.java
+10
-0
LatentDangerDto.java
...oin/amos/latentdanger/business/param/LatentDangerDto.java
+1
-1
LatentDangerServiceImpl.java
...danger/business/service/impl/LatentDangerServiceImpl.java
+8
-16
RuleDangerService.java
...latentdanger/business/service/impl/RuleDangerService.java
+4
-0
RulePlanService.java
...os/supervision/business/service/impl/RulePlanService.java
+6
-9
LatentDangerMapper.xml
...anger/src/main/resources/db/mapper/LatentDangerMapper.xml
+9
-1
No files found.
amos-boot-biz-common/src/main/java/com/yeejoin/amos/boot/biz/common/utils/DateUtils.java
View file @
1ce21c8e
...
...
@@ -845,4 +845,14 @@ public class DateUtils {
time
=
String
.
format
(
time
,
h
,
m
,
s
);
return
time
;
}
public
static
Date
getTargetEndTime
(
Date
target
)
{
Calendar
calendar
=
Calendar
.
getInstance
();
calendar
.
setTime
(
target
);
calendar
.
set
(
Calendar
.
HOUR_OF_DAY
,
23
);
calendar
.
set
(
Calendar
.
MINUTE
,
59
);
calendar
.
set
(
Calendar
.
SECOND
,
59
);
Date
end
=
calendar
.
getTime
();
return
end
;
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-latentdanger-biz/src/main/java/com/yeejoin/amos/latentdanger/business/param/LatentDangerDto.java
View file @
1ce21c8e
...
...
@@ -37,7 +37,7 @@ public class LatentDangerDto {
/**
* 创建隐患的业务id(p_check_input)
*/
private
Long
bizId
=
0L
;
private
Long
bizId
;
/**
* 建筑id
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-latentdanger-biz/src/main/java/com/yeejoin/amos/latentdanger/business/service/impl/LatentDangerServiceImpl.java
View file @
1ce21c8e
...
...
@@ -15,6 +15,7 @@ import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import
com.yeejoin.amos.boot.biz.common.bo.RoleBo
;
import
com.yeejoin.amos.boot.biz.common.enums.RuleTypeEnum
;
import
com.yeejoin.amos.boot.biz.common.service.impl.WorkflowExcuteServiceImpl
;
import
com.yeejoin.amos.boot.biz.common.utils.DateUtils
;
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.workflow.feign.WorkflowFeignService
;
...
...
@@ -242,7 +243,7 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD
if
(
ValidationUtil
.
isEmpty
(
dangerTypeEnum
))
{
throw
new
Exception
(
"检查类型参数有误"
);
}
Date
endTime
=
this
.
G
etTargetEndTime
(
param
.
getReformLimitDate
());
Date
endTime
=
DateUtils
.
g
etTargetEndTime
(
param
.
getReformLimitDate
());
param
.
setReformLimitDate
(
endTime
);
// 保存隐患
LatentDanger
latentDanger
=
saveLatentDanger
(
param
,
userId
,
departmentId
,
businessKey
,
orgCode
,
...
...
@@ -318,16 +319,6 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD
// riskFactorMapper.updateControlStatus(riskFactorBo);
// }
public
static
Date
GetTargetEndTime
(
Date
target
)
{
Calendar
calendar
=
Calendar
.
getInstance
();
calendar
.
setTime
(
target
);
calendar
.
set
(
Calendar
.
HOUR_OF_DAY
,
23
);
calendar
.
set
(
Calendar
.
MINUTE
,
59
);
calendar
.
set
(
Calendar
.
SECOND
,
59
);
Date
end
=
calendar
.
getTime
();
return
end
;
}
// TODO 使用远程调用替换
private
void
updateCheckInputDangerState
(
Long
id
,
int
code
)
{
latentDangerMapper
.
updateCheckInputDangerState
(
id
,
code
);
...
...
@@ -2206,10 +2197,7 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD
throw
new
Exception
(
"隐患不存"
);
}
latentDangerDto
.
setDangerPosition
(
null
);
//以下方法存在bug会将数值类型的默认值0拷贝到对象上造成数据覆盖
//Bean.copyExistPropertis(latentDangerDto, latentDanger);
latentDanger
.
setId
(
latentDangerDto
.
getId
());
latentDanger
.
setFlowJson
(
latentDangerDto
.
getFlowJson
());
Bean
.
copyExistPropertis
(
latentDangerDto
,
latentDanger
);
if
(!
ValidationUtil
.
isEmpty
(
latentDangerDto
.
getPhotoUrl
()))
{
latentDanger
.
setPhotoUrls
(
Joiner
.
on
(
","
).
join
(
latentDangerDto
.
getPhotoUrl
()));
...
...
@@ -2235,9 +2223,13 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD
if
(!
executeSubmitDto
.
getIsOk
())
{
throw
new
Exception
(
executeSubmitDto
.
getMsg
());
}
sendSubmitMessage
(
executeType
,
latentDanger
,
executeSubmitDto
);
return
executeSubmitDto
;
}
public
void
sendSubmitMessage
(
Integer
executeType
,
LatentDanger
latentDanger
,
DangerExecuteSubmitDto
executeSubmitDto
)
throws
Exception
{
List
<
String
>
userIds
=
workflowExecuteService
.
getUserIdsByWorkflow
(
latentDanger
.
getInstanceId
(),
executeSubmitDto
.
getCheckLeaderId
());
ruleDangerService
.
addDangerSubmitRule
(
latentDanger
,
userIds
,
RuleTypeEnum
.
隐患审核
.
getCode
(),
ExecuteTypeEnum
.
getNameByCode
(
executeType
));
return
executeSubmitDto
;
}
@Override
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-latentdanger-biz/src/main/java/com/yeejoin/amos/latentdanger/business/service/impl/RuleDangerService.java
View file @
1ce21c8e
...
...
@@ -17,6 +17,7 @@ import com.yeejoin.amos.latentdanger.common.enums.LatentDangerState;
import
com.yeejoin.amos.latentdanger.dao.entity.LatentDanger
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.stereotype.Service
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
...
...
@@ -87,6 +88,9 @@ public class RuleDangerService {
latentDangerRo
.
setIsSendWeb
(
true
);
latentDangerRo
.
setRecivers
(
userIds
);
latentDangerRo
.
setTerminal
(
RuleConstant
.
APP_WEB
);
if
(
ValidationUtil
.
isEmpty
(
userIds
))
{
return
false
;
}
//触发规则
ruleTrigger
.
publish
(
latentDangerRo
,
packageId
,
new
String
[
0
]);
return
true
;
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-supervision-biz/src/main/java/com/yeejoin/amos/supervision/business/service/impl/RulePlanService.java
View file @
1ce21c8e
...
...
@@ -58,7 +58,6 @@ public class RulePlanService {
@Autowired
private
PointServiceImpl
pointService
;
@Async
public
Boolean
addPlanRule
(
Plan
plan
,
List
<
String
>
userIds
,
RuleTypeEnum
ruleType
,
Long
pointId
)
throws
Exception
{
PlanRo
planRo
=
buildPlanRo
(
plan
,
userIds
,
ruleType
,
pointId
);
//触发规则
...
...
@@ -66,7 +65,6 @@ public class RulePlanService {
return
true
;
}
@Async
public
Boolean
addPlanAuditRule
(
Plan
plan
,
List
<
String
>
userIds
,
RuleTypeEnum
ruleType
,
String
excuteStateName
)
throws
Exception
{
PlanRo
planRo
=
buildPlanRo
(
plan
,
userIds
,
ruleType
,
null
);
planRo
.
setExcuteStateName
(
excuteStateName
);
...
...
@@ -77,12 +75,12 @@ public class RulePlanService {
private
PlanRo
buildPlanRo
(
Plan
plan
,
List
<
String
>
userIds
,
RuleTypeEnum
ruleType
,
Long
pointId
)
{
// 设置token
if
(
ValidationUtil
.
isEmpty
(
RequestContext
.
getToken
()))
{
Toke
tokenObj
=
remoteSecurityService
.
getServerToken
();
RequestContext
.
setProduct
(
tokenObj
.
getProduct
());
RequestContext
.
setAppKey
(
tokenObj
.
getAppKey
());
RequestContext
.
setToken
(
tokenObj
.
getToke
());
}
//
if (ValidationUtil.isEmpty(RequestContext.getToken())) {
//
Toke tokenObj = remoteSecurityService.getServerToken();
//
RequestContext.setProduct(tokenObj.getProduct());
//
RequestContext.setAppKey(tokenObj.getAppKey());
//
RequestContext.setToken(tokenObj.getToke());
//
}
PlanRo
planRo
=
new
PlanRo
();
BeanUtils
.
copyProperties
(
plan
,
planRo
);
...
...
@@ -116,7 +114,6 @@ public class RulePlanService {
userIds
=
(
List
<
String
>)
jcsFeignClient
.
getAmosIdListByUserIds
(
leadPeopleIds
).
getResult
();
// pointId是被检查单位id
if
(!
ValidationUtil
.
isEmpty
(
pointId
))
{
List
<
String
>
userIdList
=
Lists
.
newArrayList
();
Point
point
=
pointService
.
queryPointById
(
pointId
);
List
<
OrgUsrFormDto
>
personList
=
jcsFeignClient
.
getPersonListByCompanyId
(
point
.
getOriginalId
()).
getResult
();
...
...
amos-boot-system-latentdanger/src/main/resources/db/mapper/LatentDangerMapper.xml
View file @
1ce21c8e
...
...
@@ -959,7 +959,15 @@
pld.business_key = #{businessKey}
</select>
<select
id=
"selectPageByParam"
resultType=
"com.yeejoin.amos.latentdanger.dao.entity.LatentDanger"
>
select * from p_latent_danger a
select
*,
CASE
WHEN a.reform_limit_date
<![CDATA[ < ]]>
NOW() THEN
1
ELSE
0
END as overtimeState
from p_latent_danger a
<where>
deleted = 0
<foreach
collection=
"paramMap"
index=
"key"
item=
"value"
>
...
...
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