Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
yangxiujun
/
paidan_demo
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit fc30f692
authored
Oct 13, 2023
by
刘鑫
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/develop' into develop
2 parents
b5244bc8
c047e1a7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
8 deletions
project-order/src/main/java/com/dituhui/pea/order/service/impl/EngineerCalendarServiceImpl.java
project-order/src/main/java/com/dituhui/pea/order/service/impl/OrganizationServiceImpl.java
project-order/src/main/java/com/dituhui/pea/order/service/impl/EngineerCalendarServiceImpl.java
View file @
fc30f69
...
...
@@ -187,11 +187,14 @@ public class EngineerCalendarServiceImpl implements EngineerCalendarService {
LocalDate
beginDate
=
DateUtils
.
localDateFromStr
(
beginTime
);
LocalDate
endDate
=
DateUtils
.
localDateFromStr
(
repeatEndDate
);
LocalDate
current
=
beginDate
;
// 保留固定基准开始时间,后续日历根据此日期推算
final
String
finalBeginTime
=
beginTime
;
final
String
finalEndTime
=
endTime
;
while
(!
current
.
isAfter
(
endDate
))
{
// 开始时间,结束时间平移
int
days
=
Period
.
between
(
beginDate
,
current
).
getDays
(
);
beginTime
=
DateUtils
.
formatDateTime
(
DateUtils
.
localDateTimeFromStr
(
b
eginTime
).
plusDays
(
days
));
endTime
=
DateUtils
.
formatDateTime
(
DateUtils
.
localDateTimeFromStr
(
e
ndTime
).
plusDays
(
days
));
long
days
=
beginDate
.
until
(
current
,
ChronoUnit
.
DAYS
);
beginTime
=
DateUtils
.
formatDateTime
(
DateUtils
.
localDateTimeFromStr
(
finalB
eginTime
).
plusDays
(
days
));
endTime
=
DateUtils
.
formatDateTime
(
DateUtils
.
localDateTimeFromStr
(
finalE
ndTime
).
plusDays
(
days
));
addOneEngineerPlan
(
userId
,
engineerCode
,
type
,
beginTime
,
endTime
,
remark
);
current
=
getNextDate
(
current
,
repeatType
);
}
...
...
@@ -406,7 +409,7 @@ public class EngineerCalendarServiceImpl implements EngineerCalendarService {
return
mapping
.
get
(
type
);
}
private
String
newPlanId
(){
private
String
newPlanId
()
{
String
idStr
=
IdUtil
.
getSnowflake
().
nextIdStr
();
return
idStr
.
substring
(
idStr
.
length
()
-
10
);
}
...
...
project-order/src/main/java/com/dituhui/pea/order/service/impl/OrganizationServiceImpl.java
View file @
fc30f69
...
...
@@ -13,6 +13,7 @@ import com.google.common.collect.Lists;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
...
...
@@ -43,12 +44,26 @@ public class OrganizationServiceImpl implements OrganizationService {
@Override
public
Result
<?>
getOrganizationTree
(
String
levelType
,
String
levelValue
)
{
// 如果传递了精确的id,只返回对应的tree内容;如果没有传递,返回所有tree内容
List
<
OrganizationTreeDTO
.
Result
>
rs
=
new
ArrayList
<>();
if
(
StringUtils
.
isBlank
(
levelType
)
&&
StringUtils
.
isBlank
(
levelValue
))
{
rs
.
add
(
getOrganizationTreeByOrgId
(
levelType
,
levelValue
));
}
else
{
for
(
String
value
:
levelValue
.
split
(
","
))
{
rs
.
add
(
getOrganizationTreeByOrgId
(
levelType
,
value
));
}
}
return
Result
.
success
(
rs
);
}
public
OrganizationTreeDTO
.
Result
getOrganizationTreeByOrgId
(
String
levelType
,
String
levelValue
)
{
// 如果传递了精确的id,只返回对应的tree内容;如果没有传递,返回所有tree内容
OrganizationTreeDTO
.
Result
rs
=
new
OrganizationTreeDTO
.
Result
();
rs
.
setLevelType
(
levelType
).
setLevelValue
(
levelValue
);
if
(
"group"
.
equals
(
levelType
))
{
OrgGroupEntity
orgGroupEntity
=
orgGroupDao
.
getByGroupId
(
levelValue
);
if
(
orgGroupEntity
==
null
)
{
return
Result
.
failed
(
"groupId对应的信息不存在"
)
;
return
null
;
}
List
<?>
groups
=
new
ArrayList
<>(
Collections
.
singletonList
(
groupEntity2Dto
(
orgGroupEntity
)));
OrgBranchEntity
orgBranchEntity
=
orgBranchDao
.
getByBranchId
(
orgGroupEntity
.
getBranchId
());
...
...
@@ -59,7 +74,7 @@ public class OrganizationServiceImpl implements OrganizationService {
}
else
if
(
"branch"
.
equals
(
levelType
))
{
OrgBranchEntity
orgBranchEntity
=
orgBranchDao
.
getByBranchId
(
levelValue
);
if
(
orgBranchEntity
==
null
)
{
return
Result
.
failed
(
"分站信息不存在"
)
;
return
null
;
}
OrgClusterEntity
orgClusterEntity
=
orgClusterDao
.
getByClusterId
(
orgBranchEntity
.
getClusterId
());
List
<?>
groups
=
getChildByBranch
(
levelValue
);
...
...
@@ -69,7 +84,7 @@ public class OrganizationServiceImpl implements OrganizationService {
}
else
if
(
"cluster"
.
equals
(
levelType
))
{
OrgClusterEntity
orgClusterEntity
=
orgClusterDao
.
getByClusterId
(
levelValue
);
if
(
orgClusterEntity
==
null
)
{
return
Result
.
failed
(
"大区信息不存在"
)
;
return
null
;
}
List
<?>
branchs
=
getChildByCluster
(
levelValue
);
List
<?>
clusters
=
new
ArrayList
<>(
Collections
.
singletonList
(
clusterEntity2Dto
(
orgClusterEntity
).
setChildren
(
branchs
)));
...
...
@@ -77,7 +92,7 @@ public class OrganizationServiceImpl implements OrganizationService {
}
else
{
rs
.
setClusters
(
getTreeByRoot
());
}
return
Result
.
success
(
rs
)
;
return
rs
;
}
@Override
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment