Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
long-tern-care-service
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
hubin
long-tern-care-service
Commits
69f4afe1
Commit
69f4afe1
authored
May 07, 2021
by
蔡镇泽
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增修改服务计划
parent
2d922617
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
54 additions
and
41 deletions
+54
-41
SrvTaskController.java
...hungraim/ltc/governance/controller/SrvTaskController.java
+29
-22
SrvTaskService.java
...a/com/hungraim/ltc/governance/service/SrvTaskService.java
+2
-2
SrvTaskServiceImpl.java
...graim/ltc/governance/service/impl/SrvTaskServiceImpl.java
+23
-17
No files found.
governance/src/main/java/com/hungraim/ltc/governance/controller/SrvTaskController.java
View file @
69f4afe1
...
...
@@ -14,6 +14,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
/**
...
...
@@ -90,27 +92,29 @@ public class SrvTaskController {
/**
* 新增服务计划
*
* @param programId 服务方案id
* @param srvEmpId 护理人员id
* @param startTime 服务计划开始时间 yyyy-MM-dd
* @param endTime 服务计划结束时间 yyyy-MM-dd
* @param programId 服务方案id
* @param srvEmpId 护理人员id
* @param taskDetails 具体护理日期 yyyy-MM-dd(逗号分隔)
*/
@RequestMapping
(
"/addSrvTask"
)
public
Result
<
Object
>
addSrvTask
(
Long
programId
,
Long
srvEmpId
,
String
startTime
,
String
endTime
)
{
public
Result
<
Object
>
addSrvTask
(
Long
programId
,
Long
srvEmpId
,
String
taskDetails
)
{
if
(
programId
==
null
)
{
return
Result
.
failed
(
"服务方案id不能为空!"
);
}
if
(
srvEmpId
==
null
)
{
return
Result
.
failed
(
"护理人员id不能为空!"
);
}
if
(
StringUtils
.
isBlank
(
startTime
))
{
return
Result
.
failed
(
"服务计划开始时间不能为空!"
);
}
if
(
StringUtils
.
isBlank
(
endTime
))
{
return
Result
.
failed
(
"服务计划结束时间不能为空!"
);
if
(
StringUtils
.
isBlank
(
taskDetails
))
{
return
Result
.
failed
(
"具体护理日期不能为空!"
);
}
try
{
srvTaskService
.
addSrvTask
(
programId
,
srvEmpId
,
DateUtils
.
strToDate
(
startTime
),
DateUtils
.
strToDate
(
endTime
));
String
[]
details
=
taskDetails
.
split
(
","
);
List
<
Date
>
dates
=
new
ArrayList
<>();
for
(
String
detail
:
details
)
{
Date
date
=
DateUtils
.
strToDate
(
detail
);
dates
.
add
(
date
);
}
srvTaskService
.
addSrvTask
(
programId
,
srvEmpId
,
dates
);
}
catch
(
RuntimeException
e
)
{
//添加失败
return
Result
.
failed
(
e
.
getMessage
());
...
...
@@ -122,27 +126,30 @@ public class SrvTaskController {
/**
* 修改服务计划
*
* @param taskId 服务计划id
* @param srvEmpId 护理人员id
* @param startTime 服务计划开始时间 yyyy-MM-dd
* @param endTime 服务计划结束时间 yyyy-MM-dd
* @param taskId 服务计划id
* @param srvEmpId 护理人员id
* @param taskDetails 具体护理日期 yyyy-MM-dd(逗号分隔)
*/
@RequestMapping
(
"/updateSrvTask"
)
public
Result
<
Object
>
updateSrvTask
(
String
taskId
,
Long
srvEmpId
,
String
startTime
,
String
endTime
)
{
public
Result
<
Object
>
updateSrvTask
(
String
taskId
,
Long
srvEmpId
,
String
taskDetails
)
{
if
(
taskId
==
null
)
{
return
Result
.
failed
(
"taskId不能为空!"
);
}
if
(
srvEmpId
==
null
)
{
return
Result
.
failed
(
"护理人员id不能为空!"
);
}
if
(
StringUtils
.
isBlank
(
startTime
))
{
return
Result
.
failed
(
"服务计划开始时间不能为空!"
);
}
if
(
StringUtils
.
isBlank
(
endTime
))
{
return
Result
.
failed
(
"服务计划结束时间不能为空!"
);
if
(
StringUtils
.
isBlank
(
taskDetails
))
{
return
Result
.
failed
(
"具体护理日期不能为空!"
);
}
try
{
srvTaskService
.
updateSrvTask
(
taskId
,
srvEmpId
,
DateUtils
.
strToDate
(
startTime
),
DateUtils
.
strToDate
(
endTime
));
String
[]
details
=
taskDetails
.
split
(
","
);
List
<
Date
>
dates
=
new
ArrayList
<>();
for
(
String
detail
:
details
)
{
Date
date
=
DateUtils
.
strToDate
(
detail
);
dates
.
add
(
date
);
}
srvTaskService
.
updateSrvTask
(
taskId
,
srvEmpId
,
dates
);
}
catch
(
RuntimeException
e
)
{
//修改失败
return
Result
.
failed
(
e
.
getMessage
());
...
...
governance/src/main/java/com/hungraim/ltc/governance/service/SrvTaskService.java
View file @
69f4afe1
...
...
@@ -22,9 +22,9 @@ public interface SrvTaskService {
List
<
SrvTaskInfoVO
>
getSrvTaskInfoList
(
String
programId
);
void
addSrvTask
(
Long
programId
,
Long
srvEmpId
,
Date
startTime
,
Date
endTime
);
void
addSrvTask
(
Long
programId
,
Long
srvEmpId
,
List
<
Date
>
dates
);
void
updateSrvTask
(
String
taskId
,
Long
srvEmpId
,
Date
startTime
,
Date
endTime
);
void
updateSrvTask
(
String
taskId
,
Long
srvEmpId
,
List
<
Date
>
dates
);
Page
<
OrganEmpVO
>
getSrvOrganEmpList
(
Page
<
OrganEmpVO
>
page
,
String
organId
,
String
name
,
String
certiType
,
String
certifNum
);
...
...
governance/src/main/java/com/hungraim/ltc/governance/service/impl/SrvTaskServiceImpl.java
View file @
69f4afe1
...
...
@@ -72,7 +72,7 @@ public class SrvTaskServiceImpl implements SrvTaskService {
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Override
public
void
addSrvTask
(
Long
programId
,
Long
srvEmpId
,
Date
startTime
,
Date
endTime
)
{
public
void
addSrvTask
(
Long
programId
,
Long
srvEmpId
,
List
<
Date
>
dates
)
{
try
{
//添加服务计划
ChSrvTask
chSrvTask
=
new
ChSrvTask
();
...
...
@@ -85,14 +85,15 @@ public class SrvTaskServiceImpl implements SrvTaskService {
throw
new
RuntimeException
(
"添加服务计划失败!"
);
}
//添加服务计划详情
ChSrvTaskDetail
chSrvTaskDetail
=
new
ChSrvTaskDetail
();
chSrvTaskDetail
.
setSrvTaskId
(
chSrvTask
.
getSrvTaskId
());
chSrvTaskDetail
.
setSrvStartTime
(
startTime
);
//服务开始时间
chSrvTaskDetail
.
setEndTime
(
endTime
);
//服务结束时间
chSrvTaskDetail
.
setStatus
((
short
)
0
);
//状态 未执行:0;执行中:1;已执行:2;已失效:3已完成4
int
insert1
=
chSrvTaskDetailMapper
.
insert
(
chSrvTaskDetail
);
if
(
insert1
<=
0
)
{
throw
new
RuntimeException
(
"添加服务计划详情失败!"
);
for
(
Date
date
:
dates
)
{
ChSrvTaskDetail
chSrvTaskDetail
=
new
ChSrvTaskDetail
();
chSrvTaskDetail
.
setSrvTaskId
(
chSrvTask
.
getSrvTaskId
());
//taskId
chSrvTaskDetail
.
setSrvDate
(
date
);
//服务开始时间
chSrvTaskDetail
.
setStatus
((
short
)
0
);
//状态 未执行:0;执行中:1;已执行:2;已失效:3已完成4
int
insert1
=
chSrvTaskDetailMapper
.
insert
(
chSrvTaskDetail
);
if
(
insert1
<=
0
)
{
throw
new
RuntimeException
(
"添加服务计划详情失败!"
);
}
}
}
catch
(
Exception
e
)
{
throw
new
RuntimeException
(
"系统繁忙,请稍后再试!"
);
...
...
@@ -101,7 +102,7 @@ public class SrvTaskServiceImpl implements SrvTaskService {
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Override
public
void
updateSrvTask
(
String
taskId
,
Long
srvEmpId
,
Date
startTime
,
Date
endTime
)
{
public
void
updateSrvTask
(
String
taskId
,
Long
srvEmpId
,
List
<
Date
>
dates
)
{
//修改服务计划服务人员
ChSrvTask
chSrvTask
=
srvTaskMapper
.
selectById
(
taskId
);
if
(
chSrvTask
==
null
)
{
...
...
@@ -112,13 +113,18 @@ public class SrvTaskServiceImpl implements SrvTaskService {
if
(
i
<=
0
)
{
throw
new
RuntimeException
(
"修改服务计划服务人员失败!"
);
}
//修改服务计划详情计划起止日期
ChSrvTaskDetail
chSrvTaskDetail
=
chSrvTaskDetailMapper
.
selectOne
(
new
QueryWrapper
<
ChSrvTaskDetail
>().
eq
(
"srv_task_id"
,
chSrvTask
.
getSrvTaskId
()));
chSrvTaskDetail
.
setSrvStartTime
(
startTime
);
chSrvTaskDetail
.
setEndTime
(
endTime
);
int
i1
=
chSrvTaskDetailMapper
.
updateById
(
chSrvTaskDetail
);
if
(
i1
<=
0
)
{
throw
new
RuntimeException
(
"修改服务计划详情计划起止日期失败!"
);
//修改服务计划详情计划详情
chSrvTaskDetailMapper
.
delete
(
new
QueryWrapper
<
ChSrvTaskDetail
>().
eq
(
"srv_task_id"
,
taskId
));
//删除原来的计划详情
for
(
Date
date
:
dates
)
{
//新增计划详情
ChSrvTaskDetail
chSrvTaskDetail
=
new
ChSrvTaskDetail
();
chSrvTaskDetail
.
setSrvTaskId
(
chSrvTask
.
getSrvTaskId
());
//taskId
chSrvTaskDetail
.
setSrvDate
(
date
);
//服务开始时间
chSrvTaskDetail
.
setStatus
((
short
)
0
);
//状态 未执行:0;执行中:1;已执行:2;已失效:3已完成4
int
insert1
=
chSrvTaskDetailMapper
.
insert
(
chSrvTaskDetail
);
if
(
insert1
<=
0
)
{
throw
new
RuntimeException
(
"添加服务计划详情失败!"
);
}
}
}
...
...
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