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
dde5c814
Commit
dde5c814
authored
Apr 29, 2021
by
zhangch
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
服务方案新增修改接口调整,服务方案终止接口
parent
10ec04ee
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
62 additions
and
7 deletions
+62
-7
ProgramDetailVo.java
.../com/hungraim/ltc/pojo/vo/governance/ProgramDetailVo.java
+5
-0
SrvProgramController.java
...graim/ltc/governance/controller/SrvProgramController.java
+26
-3
SrvProgramService.java
...om/hungraim/ltc/governance/service/SrvProgramService.java
+16
-1
SrvProgramServiceImpl.java
...im/ltc/governance/service/impl/SrvProgramServiceImpl.java
+15
-3
No files found.
common/common-core/src/main/java/com/hungraim/ltc/pojo/vo/governance/ProgramDetailVo.java
View file @
dde5c814
package
com
.
hungraim
.
ltc
.
pojo
.
vo
.
governance
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
lombok.Data
;
import
org.springframework.format.annotation.DateTimeFormat
;
...
...
@@ -60,6 +61,7 @@ public class ProgramDetailVo {
/**
* 失能人员生日
*/
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
,
timezone
=
"GMT+8"
)
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd"
)
private
Date
birthday
;
...
...
@@ -101,6 +103,7 @@ public class ProgramDetailVo {
/**
* 评定完成日期
*/
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
,
timezone
=
"GMT+8"
)
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd"
)
private
Date
assessDate
;
...
...
@@ -117,12 +120,14 @@ public class ProgramDetailVo {
/**
* 方案生效时间
*/
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
,
timezone
=
"GMT+8"
)
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd"
)
private
Date
programDate
;
/**
* 方案结束时间
*/
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
,
timezone
=
"GMT+8"
)
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd"
)
private
Date
programEndDate
;
...
...
governance/src/main/java/com/hungraim/ltc/governance/controller/SrvProgramController.java
View file @
dde5c814
...
...
@@ -3,6 +3,7 @@ package com.hungraim.ltc.governance.controller;
import
cn.hutool.json.JSONUtil
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.hungraim.ltc.governance.service.SrvProgramService
;
import
com.hungraim.ltc.pojo.entity.serviceManage.ChSrvProgram
;
import
com.hungraim.ltc.pojo.vo.governance.ProgramDetailVo
;
import
com.hungraim.ltc.pojo.vo.governance.ProgramListVo
;
import
com.hungraim.ltc.pojo.vo.governance.ProgramSetAndProjectVo
;
...
...
@@ -110,6 +111,12 @@ public class SrvProgramController {
return
Result
.
success
(
programDetail
);
}
/**
* 添加服务方案接口
*
* @param programDetailVo 添加服务方案包装对象
* @return 返回结果
*/
@PostMapping
(
"/programAndProgramSetList"
)
public
Result
programAndProgramSetList
(
ProgramDetailVo
programDetailVo
)
{
log
.
info
(
JSONUtil
.
toJsonStr
(
programDetailVo
));
...
...
@@ -128,12 +135,28 @@ public class SrvProgramController {
}
else
{
return
Result
.
failed
(
ResultCode
.
REQUEST_PARAM_ERROR
);
}
Integer
count
=
srvProgramService
.
getProgramSetCountByProgStatus
(
programDetailVo
.
getDisabInfoId
(),
programDetailVo
.
getSrvOrganId
(),
"2"
);
if
(
count
>
0
)
{
return
Result
.
failed
(
ResultCode
.
REQUEST_PROGRAM_ADD_ERROR
);
// 添加的话,需要校验其它服务方案是否已终止
if
(
programDetailVo
.
getProgramId
()
==
null
)
{
List
<
ChSrvProgram
>
srvPrograms
=
srvProgramService
.
getProgramSetCountByProgStatus
(
programDetailVo
.
getDisabInfoId
(),
programDetailVo
.
getSrvOrganId
(),
"2"
);
if
(
srvPrograms
.
size
()
>
0
)
{
return
Result
.
failed
(
ResultCode
.
REQUEST_PROGRAM_ADD_ERROR
);
}
}
// 进行添加或者修改操作
srvProgramService
.
addProgramAndProgramSetList
(
programDetailVo
);
return
Result
.
success
();
}
/**
* 终止服务方案
*
* @param programId 服务方案id
* @param endReason 终止原因
* @return 返回请求结果
*/
@PutMapping
(
"/endProgram"
)
public
Result
endProgram
(
Long
programId
,
String
endReason
)
{
srvProgramService
.
endProgram
(
programId
,
endReason
);
return
Result
.
success
();
}
}
governance/src/main/java/com/hungraim/ltc/governance/service/SrvProgramService.java
View file @
dde5c814
package
com
.
hungraim
.
ltc
.
governance
.
service
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.hungraim.ltc.pojo.entity.serviceManage.ChSrvProgram
;
import
com.hungraim.ltc.pojo.vo.governance.ProgramDetailVo
;
import
com.hungraim.ltc.pojo.vo.governance.ProgramListVo
;
import
com.hungraim.ltc.pojo.vo.governance.SvrSendListVo
;
import
java.util.List
;
public
interface
SrvProgramService
{
/**
...
...
@@ -37,7 +40,7 @@ public interface SrvProgramService {
* @param programStatus 服务方案状态 0:未生效、1:已生效、2:已终止
* @return 返回条数
*/
Integer
getProgramSetCountByProgStatus
(
Long
disabInfoId
,
Long
srvOrganId
,
String
programStatus
);
List
<
ChSrvProgram
>
getProgramSetCountByProgStatus
(
Long
disabInfoId
,
Long
srvOrganId
,
String
programStatus
);
/**
* 查看服务方案详情
...
...
@@ -56,5 +59,17 @@ public interface SrvProgramService {
*/
ProgramDetailVo
getProgramDetailWithAdd
(
Long
disabInfoId
,
Long
srvOrganId
);
/**
* 添加或者修改服务方案
* @param programDetailVo 包装对象
*/
void
addProgramAndProgramSetList
(
ProgramDetailVo
programDetailVo
);
/**
* 终止服务方案
*
* @param programId 服务方案id
* @param endReason 终止原因
*/
void
endProgram
(
Long
programId
,
String
endReason
);
}
governance/src/main/java/com/hungraim/ltc/governance/service/impl/SrvProgramServiceImpl.java
View file @
dde5c814
...
...
@@ -14,6 +14,7 @@ import com.hungraim.ltc.governance.dao.ChSrvSendMapper;
import
com.hungraim.ltc.governance.service.SrvProgramService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.Date
;
import
java.util.List
;
...
...
@@ -42,11 +43,11 @@ public class SrvProgramServiceImpl implements SrvProgramService {
}
@Override
public
Integer
getProgramSetCountByProgStatus
(
Long
disabInfoId
,
Long
srvOrganId
,
String
programStatus
)
{
public
List
<
ChSrvProgram
>
getProgramSetCountByProgStatus
(
Long
disabInfoId
,
Long
srvOrganId
,
String
programStatus
)
{
QueryWrapper
<
ChSrvProgram
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
"DISAB_INFO_ID"
,
disabInfoId
).
eq
(
"SRV_ORGAN_ID"
,
srvOrganId
).
ne
(
"PROG_STATUS"
,
programStatus
);
Integer
count
=
chSrvProgramMapper
.
selectCoun
t
(
queryWrapper
);
return
c
ount
;
List
<
ChSrvProgram
>
chSrvPrograms
=
chSrvProgramMapper
.
selectLis
t
(
queryWrapper
);
return
c
hSrvPrograms
;
}
@Override
...
...
@@ -59,6 +60,7 @@ public class SrvProgramServiceImpl implements SrvProgramService {
return
chSrvProgramMapper
.
getProgramDetailWithAdd
(
disabInfoId
,
srvOrganId
);
}
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Override
public
void
addProgramAndProgramSetList
(
ProgramDetailVo
programDetailVo
)
{
Date
date
=
new
Date
();
...
...
@@ -94,6 +96,7 @@ public class SrvProgramServiceImpl implements SrvProgramService {
if
(
programSetAndProjectVo
.
getSetId
()
!=
null
)
{
if
(
isConf
.
intValue
()
==
0
)
{
// 没有配置这条服务方案,直接删除对应的记录
chSrvProgramSetMapper
.
deleteById
(
programSetAndProjectVo
.
getSetId
());
}
// 修改原有的服务方案项目
ChSrvProgramSet
chSrvProgramSet
=
new
ChSrvProgramSet
();
...
...
@@ -115,6 +118,15 @@ public class SrvProgramServiceImpl implements SrvProgramService {
}
@Override
public
void
endProgram
(
Long
programId
,
String
endReason
)
{
ChSrvProgram
chSrvProgram
=
new
ChSrvProgram
();
chSrvProgram
.
setProgramId
(
programId
);
chSrvProgram
.
setEndReason
(
endReason
);
chSrvProgram
.
setProgStatus
(
2
);
chSrvProgramMapper
.
updateById
(
chSrvProgram
);
}
private
void
addProgramSet
(
ProgramDetailVo
programDetailVo
,
Date
date
,
Long
newProgramId
,
ProgramSetAndProjectVo
programSetAndProjectVo
)
{
ChSrvProgramSet
chSrvProgramSet
=
new
ChSrvProgramSet
();
chSrvProgramSet
.
setItemId
(
programSetAndProjectVo
.
getProjectId
());
...
...
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