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
4cfe91ee
Commit
4cfe91ee
authored
Nov 10, 2023
by
litengwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug修改
parent
c4f913a7
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
57 additions
and
43 deletions
+57
-43
PlanController.java
...ejoin/amos/patrol/business/controller/PlanController.java
+21
-19
PlanServiceImpl.java
...in/amos/patrol/business/service/impl/PlanServiceImpl.java
+3
-3
PlanTaskServiceImpl.java
...mos/patrol/business/service/impl/PlanTaskServiceImpl.java
+4
-3
JobService.java
.../main/java/com/yeejoin/amos/patrol/quartz/JobService.java
+24
-0
dbTemplate_plan_task.xml
...biz/src/main/resources/db/mapper/dbTemplate_plan_task.xml
+5
-18
No files found.
amos-boot-system-tzs/amos-boot-module-tzspatrol/amos-boot-module-tzspatrol-biz/src/main/java/com/yeejoin/amos/patrol/business/controller/PlanController.java
View file @
4cfe91ee
...
@@ -24,6 +24,7 @@ import org.springframework.beans.factory.annotation.Autowired;
...
@@ -24,6 +24,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.Page
;
import
org.springframework.util.StringUtils
;
import
org.springframework.util.StringUtils
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
...
@@ -146,6 +147,7 @@ public class PlanController extends AbstractBaseController {
...
@@ -146,6 +147,7 @@ public class PlanController extends AbstractBaseController {
@RequestMapping
(
value
=
"/addPlan"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"/addPlan"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
POST
)
public
CommonResponse
checkPlanAdd
(
@ApiParam
(
value
=
"巡检计划"
,
required
=
true
)
@RequestBody
Plan
param
)
{
public
CommonResponse
checkPlanAdd
(
@ApiParam
(
value
=
"巡检计划"
,
required
=
true
)
@RequestBody
Plan
param
)
{
try
{
try
{
String
userId
=
RequestContext
.
getExeUserId
();
if
(
param
.
getDayRate
()
==
1
)
{
if
(
param
.
getDayRate
()
==
1
)
{
long
dayBeginTime
=
param
.
getDayBegin
().
getTime
();
long
dayBeginTime
=
param
.
getDayBegin
().
getTime
();
long
dayEndTime
=
param
.
getDayEnd
().
getTime
();
long
dayEndTime
=
param
.
getDayEnd
().
getTime
();
...
@@ -159,25 +161,25 @@ public class PlanController extends AbstractBaseController {
...
@@ -159,25 +161,25 @@ public class PlanController extends AbstractBaseController {
HashMap
<
String
,
Object
>
map
=
new
HashMap
<>();
HashMap
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"org_code"
,
loginOrgCode
);
map
.
put
(
"org_code"
,
loginOrgCode
);
List
<
String
>
userGroupIds
=
Objects
.
nonNull
(
param
.
getUserGroupId
())
?
Arrays
.
asList
(
param
.
getUserGroupId
().
split
(
","
))
:
Collections
.
emptyList
();
//
List<String> userGroupIds = Objects.nonNull(param.getUserGroupId()) ? Arrays.asList(param.getUserGroupId().split(",")) : Collections.emptyList();
StringBuilder
userIdSB
=
new
StringBuilder
(),
userDeptSB
=
new
StringBuilder
(),
userNameSB
=
new
StringBuilder
();
//
StringBuilder userIdSB = new StringBuilder(), userDeptSB = new StringBuilder(), userNameSB = new StringBuilder();
ResponseModel
<
List
<
UserDetailsDto
>>
response
;
//
ResponseModel<List<UserDetailsDto>> response;
for
(
String
userGroupId
:
userGroupIds
)
{
//
for (String userGroupId : userGroupIds) {
response
=
tzsFeign
.
getGroupAndPersonInfo
(
Long
.
valueOf
(
userGroupId
));
//
response = tzsFeign.getGroupAndPersonInfo(Long.valueOf(userGroupId));
if
(
response
.
getStatus
()
==
200
)
{
//
if (response.getStatus() == 200) {
List
<
UserDetailsDto
>
resultList
=
response
.
getResult
();
//
List<UserDetailsDto> resultList = response.getResult();
for
(
UserDetailsDto
udd
:
resultList
)
{
//
for (UserDetailsDto udd : resultList) {
userIdSB
.
append
(
","
).
append
(
udd
.
getUserId
());
//
userIdSB.append(",").append(udd.getUserId());
userDeptSB
.
append
(
","
).
append
(
udd
.
getUserId
()).
append
(
"@"
).
append
(
udd
.
getUnitOrgCode
()).
append
(
"@"
).
append
(
udd
.
getUnitName
());
//
userDeptSB.append(",").append(udd.getUserId()).append("@").append(udd.getUnitOrgCode()).append("@").append(udd.getUnitName());
userNameSB
.
append
(
","
).
append
(
udd
.
getUserName
());
//
userNameSB.append(",").append(udd.getUserName());
}
//
}
}
//
}
}
//
}
String
userId
=
StringUtils
.
hasText
(
userIdSB
)
?
userIdSB
.
substring
(
1
)
:
""
;
//
String userId = StringUtils.hasText(userIdSB) ? userIdSB.substring(1) : "";
String
userDept
=
StringUtils
.
hasText
(
userDeptSB
)
?
userDeptSB
.
substring
(
1
)
:
""
;
//
String userDept = StringUtils.hasText(userDeptSB) ? userDeptSB.substring(1) : "";
String
userName
=
StringUtils
.
hasText
(
userNameSB
)
?
userNameSB
.
substring
(
1
)
:
""
;
//
String userName = StringUtils.hasText(userNameSB) ? userNameSB.substring(1) : "";
param
.
setUserId
(
userId
);
//
param.setUserId(userId);
param
.
setUserDept
(
userDept
);
//
param.setUserDept(userDept);
param
.
setBizOrgCode
(
loginOrgCode
);
param
.
setBizOrgCode
(
loginOrgCode
);
param
.
setBizOrgName
(
getCompanyName
(
reginParams
));
param
.
setBizOrgName
(
getCompanyName
(
reginParams
));
...
...
amos-boot-system-tzs/amos-boot-module-tzspatrol/amos-boot-module-tzspatrol-biz/src/main/java/com/yeejoin/amos/patrol/business/service/impl/PlanServiceImpl.java
View file @
4cfe91ee
...
@@ -53,9 +53,9 @@ public class PlanServiceImpl implements IPlanService {
...
@@ -53,9 +53,9 @@ public class PlanServiceImpl implements IPlanService {
String
org_code
=
map
.
get
(
"org_code"
)
==
null
?
""
:
map
.
get
(
"org_code"
).
toString
();
String
org_code
=
map
.
get
(
"org_code"
)
==
null
?
""
:
map
.
get
(
"org_code"
).
toString
();
String
user_id
=
map
.
get
(
"user_id"
)==
null
?
""
:
map
.
get
(
"user_id"
).
toString
();
String
user_id
=
map
.
get
(
"user_id"
)==
null
?
""
:
map
.
get
(
"user_id"
).
toString
();
if
(
StringUtil
.
isNotEmpty
(
map
.
get
(
"dept_id"
))){
//
if(StringUtil.isNotEmpty(map.get("dept_id"))){
param
.
setDeptId
(
map
.
get
(
"dept_id"
).
toString
());
//
param.setDeptId(map.get("dept_id").toString());
}
//
}
param
.
setOrgCode
(
org_code
);
param
.
setOrgCode
(
org_code
);
param
.
setStatus
(
Byte
.
parseByte
(
XJConstant
.
PLAN_STATUS_START
));
param
.
setStatus
(
Byte
.
parseByte
(
XJConstant
.
PLAN_STATUS_START
));
param
.
setNextGenDate
(
DateUtil
.
getIntervalDate
(
new
Date
(),
0
));
param
.
setNextGenDate
(
DateUtil
.
getIntervalDate
(
new
Date
(),
0
));
...
...
amos-boot-system-tzs/amos-boot-module-tzspatrol/amos-boot-module-tzspatrol-biz/src/main/java/com/yeejoin/amos/patrol/business/service/impl/PlanTaskServiceImpl.java
View file @
4cfe91ee
...
@@ -717,8 +717,7 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
...
@@ -717,8 +717,7 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
paramMap
.
put
(
"id"
,
plan
.
getId
());
paramMap
.
put
(
"id"
,
plan
.
getId
());
paramMap
.
put
(
"next_gen_date"
,
DateUtil
.
formatDatrToStr
(
now
,
"yyyy-MM-dd"
));
paramMap
.
put
(
"next_gen_date"
,
DateUtil
.
formatDatrToStr
(
now
,
"yyyy-MM-dd"
));
planMapper
.
updPlanStatusOrGenDate
(
paramMap
);
// 更新下次任务生成日期
planMapper
.
updPlanStatusOrGenDate
(
paramMap
);
// 更新下次任务生成日期
}
}
else
{
// Toke toke = remoteSecurityService.getServerToken();
Map
<
String
,
String
>
deptMap
=
new
HashMap
<>();
Map
<
String
,
String
>
deptMap
=
new
HashMap
<>();
try
{
try
{
String
isFixDate
=
plan
.
getIsFixedDate
();
// 是否固定日期
String
isFixDate
=
plan
.
getIsFixedDate
();
// 是否固定日期
...
@@ -866,7 +865,7 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
...
@@ -866,7 +865,7 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
e
.
printStackTrace
();
e
.
printStackTrace
();
log
.
error
(
e
.
getMessage
());
log
.
error
(
e
.
getMessage
());
throw
new
RuntimeException
(
e
.
getMessage
());
throw
new
RuntimeException
(
e
.
getMessage
());
}
}
}
}
}
...
@@ -1168,6 +1167,8 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
...
@@ -1168,6 +1167,8 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
List
<
PlanTaskDetail
>
planTaskDetails
=
iPlanTaskDetailDao
.
findAllByTaskNoAndStatus
(
planTask
.
getId
(),
PlanTaskDetailStatusEnum
.
NOTSTARTED
.
getValue
());
List
<
PlanTaskDetail
>
planTaskDetails
=
iPlanTaskDetailDao
.
findAllByTaskNoAndStatus
(
planTask
.
getId
(),
PlanTaskDetailStatusEnum
.
NOTSTARTED
.
getValue
());
if
(!
planTaskDetails
.
isEmpty
())
{
if
(!
planTaskDetails
.
isEmpty
())
{
planTaskDetails
.
stream
().
forEach
(
action
->
{
planTaskDetails
.
stream
().
forEach
(
action
->
{
action
.
setStatus
(
PlanTaskDetailStatusEnum
.
QUALIFIED
.
getValue
());
iPlanTaskDetailDao
.
saveAndFlush
(
action
);
planTaskDetailMapper
.
finishTaskDetail
(
action
.
getId
(),
action
.
getPointId
(),
planTaskDetailMapper
.
finishTaskDetail
(
action
.
getId
(),
action
.
getPointId
(),
action
.
getPlanTask
().
getId
(),
userId
);
action
.
getPlanTask
().
getId
(),
userId
);
});
});
...
...
amos-boot-system-tzs/amos-boot-module-tzspatrol/amos-boot-module-tzspatrol-biz/src/main/java/com/yeejoin/amos/patrol/quartz/JobService.java
View file @
4cfe91ee
package
com
.
yeejoin
.
amos
.
patrol
.
quartz
;
package
com
.
yeejoin
.
amos
.
patrol
.
quartz
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.serializer.SerializerFeature
;
import
com.alibaba.fastjson.serializer.SerializerFeature
;
import
com.yeejoin.amos.component.feign.config.InnerInvokException
;
import
com.yeejoin.amos.component.feign.config.InnerInvokException
;
...
@@ -18,6 +19,7 @@ import com.yeejoin.amos.patrol.business.dao.mapper.PlanTaskMapper;
...
@@ -18,6 +19,7 @@ import com.yeejoin.amos.patrol.business.dao.mapper.PlanTaskMapper;
import
com.yeejoin.amos.patrol.business.dao.repository.*
;
import
com.yeejoin.amos.patrol.business.dao.repository.*
;
import
com.yeejoin.amos.patrol.business.entity.mybatis.PlanTaskPointInputItemBo
;
import
com.yeejoin.amos.patrol.business.entity.mybatis.PlanTaskPointInputItemBo
;
import
com.yeejoin.amos.patrol.business.feign.JcsFeignClient
;
import
com.yeejoin.amos.patrol.business.feign.JcsFeignClient
;
import
com.yeejoin.amos.patrol.business.param.CheckInputParam
;
import
com.yeejoin.amos.patrol.business.param.MsgConfigParam
;
import
com.yeejoin.amos.patrol.business.param.MsgConfigParam
;
import
com.yeejoin.amos.patrol.business.service.intfc.IMessageService
;
import
com.yeejoin.amos.patrol.business.service.intfc.IMessageService
;
import
com.yeejoin.amos.patrol.business.service.intfc.IPatrolDataSyncService
;
import
com.yeejoin.amos.patrol.business.service.intfc.IPatrolDataSyncService
;
...
@@ -104,6 +106,9 @@ public class JobService implements IJobService {
...
@@ -104,6 +106,9 @@ public class JobService implements IJobService {
@Autowired
@Autowired
private
WebMqttComponent
webMqttComponent
;
private
WebMqttComponent
webMqttComponent
;
@Autowired
IInputItemDao
inputItemDao
;
@Autowired
@Autowired
JcsFeignClient
jcsFeignClient
;
JcsFeignClient
jcsFeignClient
;
...
@@ -417,7 +422,11 @@ public class JobService implements IJobService {
...
@@ -417,7 +422,11 @@ public class JobService implements IJobService {
check
=
checkMap
.
get
(
arg
.
getPointId
());
check
=
checkMap
.
get
(
arg
.
getPointId
());
}
}
if
(
arg
.
getInputItemId
()
!=
null
)
{
if
(
arg
.
getInputItemId
()
!=
null
)
{
InputItem
inputItem
=
inputItemDao
.
findById
(
arg
.
getInputItemId
()).
get
();
CheckInput
checkInput
=
new
CheckInput
();
CheckInput
checkInput
=
new
CheckInput
();
checkInput
=
paraseSelect
(
checkInput
,
inputItem
.
getDataJson
(),
inputItem
.
getIsScore
());
checkInput
.
setCheckId
(
check
.
getId
());
checkInput
.
setCheckId
(
check
.
getId
());
checkInput
.
setInputId
(
arg
.
getInputItemId
());
checkInput
.
setInputId
(
arg
.
getInputItemId
());
checkInput
.
setIsOk
(
CheckStatusEnum
.
QUALIFIED
.
getCode
());
checkInput
.
setIsOk
(
CheckStatusEnum
.
QUALIFIED
.
getCode
());
...
@@ -436,6 +445,21 @@ public class JobService implements IJobService {
...
@@ -436,6 +445,21 @@ public class JobService implements IJobService {
}
}
private
CheckInput
paraseSelect
(
CheckInput
checkInput
,
String
json
,
String
isScore
)
{
JSONArray
jsonArray
=
JSONArray
.
parseArray
(
json
);
if
(!
ObjectUtils
.
isEmpty
(
jsonArray
))
{
for
(
int
i
=
0
;
i
<
jsonArray
.
size
();
i
++)
{
JSONObject
jsonObject
=
jsonArray
.
getJSONObject
(
i
);
String
validateName
=
jsonObject
.
getString
(
"name"
);
String
validateIsOk
=
jsonObject
.
getString
(
"isOk"
);
if
(
validateIsOk
.
equals
(
"是"
))
{
checkInput
.
setInputValue
(
validateName
);
}
}
}
return
checkInput
;
}
private
void
removeJob
(
String
jobName
)
{
private
void
removeJob
(
String
jobName
)
{
log
.
debug
(
"removeJob==jobName=="
+
jobName
);
log
.
debug
(
"removeJob==jobName=="
+
jobName
);
QuartzManager
.
removeJob
(
jobName
);
QuartzManager
.
removeJob
(
jobName
);
...
...
amos-boot-system-tzs/amos-boot-module-tzspatrol/amos-boot-module-tzspatrol-biz/src/main/resources/db/mapper/dbTemplate_plan_task.xml
View file @
4cfe91ee
...
@@ -413,26 +413,13 @@
...
@@ -413,26 +413,13 @@
<select
id=
"getPlanTaskPoints"
resultType=
"Map"
>
<select
id=
"getPlanTaskPoints"
resultType=
"Map"
>
SELECT
SELECT
p.name,
p.id pointId,
p.point_no pointNO,
p.offline,
ptd.status,
ptd.status,
ptd.is_finish finish,
P.NAME,
p.is_fixed isFixed,
P.ID pointId
pt.route_id routeId,
c.id checkId,
prp.order_no orderNo
FROM
FROM
p_plan_task_detail ptd
( SELECT * FROM p_plan_task_detail ptd WHERE ptd.task_no = #{planTaskId} ) ptd
LEFT JOIN p_plan_task pt ON pt.id = ptd.task_no
LEFT JOIN (SELECT * from p_point where is_delete = 0) P ON P.ID = ptd.point_id
LEFT JOIN p_point p ON p.id = ptd.point_id
LEFT JOIN p_check c ON c.plan_task_detail_id = ptd.id
LEFT JOIN p_route_point prp ON prp.point_id = ptd.point_id AND prp.route_id = pt.route_id
WHERE
p.is_delete = 0
<if
test=
"planTaskId != null and planTaskId > 0 "
>
and pt.id = #{planTaskId}
</if>
ORDER BY orderNo
</select>
</select>
<select
id=
"getCurrentPlanTaskCount"
resultType=
"int"
parameterType=
"long"
>
<select
id=
"getCurrentPlanTaskCount"
resultType=
"int"
parameterType=
"long"
>
...
...
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