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 e95a4016
authored
Aug 01, 2023
by
丁伟峰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
工程师日程类型列表实现
1 parent
21be21c0
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
12 deletions
project-order/src/main/java/com/dituhui/pea/order/controller/EngineerController.java
project-order/src/main/java/com/dituhui/pea/order/service/impl/EngineerCalendarServiceImpl.java
project-order/src/main/java/com/dituhui/pea/order/controller/EngineerController.java
View file @
e95a401
...
...
@@ -151,15 +151,4 @@ public class EngineerController {
}
return
res
;
}
@GetMapping
(
"/engineer/calendar"
)
public
Result
<?>
getEngineerCalendar
(
@Validated
EngineerCalendarDTO
.
Request
reqDTO
)
{
Result
<?>
res
=
null
;
try
{
res
=
engineerCalendarService
.
getEngineersCalendar
(
reqDTO
);
}
catch
(
BusinessException
e
)
{
return
Result
.
failed
(
e
.
getMessage
());
}
return
res
;
}
}
project-order/src/main/java/com/dituhui/pea/order/service/impl/EngineerCalendarServiceImpl.java
View file @
e95a401
...
...
@@ -7,11 +7,16 @@ import com.dituhui.pea.order.common.EngineerUtils;
import
com.dituhui.pea.order.dao.CapacityEngineerCalendarDao
;
import
com.dituhui.pea.order.dao.OrgTeamDao
;
import
com.dituhui.pea.order.dao.OrgTeamEngineerDao
;
import
com.dituhui.pea.order.dao.PubParamsDao
;
import
com.dituhui.pea.order.dto.CalendarTypeDTO
;
import
com.dituhui.pea.order.dto.EngineerCalendarDTO
;
import
com.dituhui.pea.order.entity.CapacityEngineerCalendarEntity
;
import
com.dituhui.pea.order.entity.EngineerInfoEntity
;
import
com.dituhui.pea.order.entity.OrgTeamEntity
;
import
com.dituhui.pea.order.entity.PubParamsEntity
;
import
com.dituhui.pea.order.service.EngineerCalendarService
;
import
com.fasterxml.jackson.core.JsonProcessingException
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.Page
;
...
...
@@ -44,6 +49,8 @@ public class EngineerCalendarServiceImpl implements EngineerCalendarService {
@Autowired
private
OrgTeamDao
orgTeamDao
;
@Autowired
private
PubParamsDao
pubParamsDao
;
@Override
public
Result
<?>
getEngineersCalendar
(
EngineerCalendarDTO
.
Request
req
)
{
...
...
@@ -72,13 +79,32 @@ public class EngineerCalendarServiceImpl implements EngineerCalendarService {
return
Result
.
success
(
rs
);
}
@Override
public
Result
<?>
getCalendarTypeList
()
{
List
<
PubParamsEntity
>
entities
=
pubParamsDao
.
findByCatalogAndBiztype
(
"CalendarType"
,
"CalendarType"
);
try
{
List
<
CalendarTypeDTO
.
Type
>
types
=
entities
.
stream
().
map
(
e
->
{
try
{
return
new
ObjectMapper
().
readValue
(
e
.
getPvalue
(),
CalendarTypeDTO
.
Type
.
class
);
}
catch
(
JsonProcessingException
ex
)
{
throw
new
RuntimeException
(
ex
);
}
}).
collect
(
Collectors
.
toList
());
CalendarTypeDTO
.
Result
rs
=
new
CalendarTypeDTO
.
Result
();
rs
.
setTypes
(
types
);
return
Result
.
success
(
rs
);
}
catch
(
Exception
e
)
{
return
Result
.
failed
(
e
.
getMessage
());
}
}
private
List
<
EngineerCalendarDTO
.
Calendar
>
getOneEngineerCalendars
(
String
engineerCode
,
String
bdate
,
String
edate
)
{
// 返回某一个技术员,日期范围内的日历列表
List
<
EngineerCalendarDTO
.
Calendar
>
calendars
=
new
ArrayList
<>();
List
<
String
>
teamIds
=
orgTeamEngineerDao
.
getTeamIdsByEngineerCode
(
engineerCode
);
if
(
teamIds
==
null
||
teamIds
.
size
()
==
0
)
{
if
(
teamIds
==
null
||
teamIds
.
isEmpty
()
)
{
return
new
ArrayList
<>();
}
LocalDate
startDate
=
LocalDate
.
parse
(
bdate
);
...
...
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