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
88df379b
Commit
88df379b
authored
May 26, 2021
by
蔡镇泽
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加服务方案及服务计划附件上传查询
parent
5b04e95a
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
153 additions
and
17 deletions
+153
-17
TaskServiceImpl.java
...n/java/com/hungraim/ltc/service/impl/TaskServiceImpl.java
+2
-4
ProgramDetailVo.java
.../com/hungraim/ltc/pojo/vo/governance/ProgramDetailVo.java
+5
-0
SrvTaskInfoVO.java
...va/com/hungraim/ltc/pojo/vo/governance/SrvTaskInfoVO.java
+11
-0
pom.xml
governance/pom.xml
+12
-0
SrvProgramController.java
...graim/ltc/governance/controller/SrvProgramController.java
+15
-0
SrvTaskController.java
...hungraim/ltc/governance/controller/SrvTaskController.java
+1
-1
SrvProgramService.java
...om/hungraim/ltc/governance/service/SrvProgramService.java
+11
-0
SrvProgramServiceImpl.java
...im/ltc/governance/service/impl/SrvProgramServiceImpl.java
+44
-1
SrvTaskServiceImpl.java
...graim/ltc/governance/service/impl/SrvTaskServiceImpl.java
+49
-11
bootstrap.yml
governance/src/main/resources/bootstrap.yml
+3
-0
No files found.
assessment/assessment-service/src/main/java/com/hungraim/ltc/service/impl/TaskServiceImpl.java
View file @
88df379b
...
...
@@ -194,9 +194,7 @@ public class TaskServiceImpl implements TaskService {
chAprReport
.
setEvaluateTime
(
evaluateDate
);
aprReportMapper
.
updateById
(
chAprReport
);
//附件上传
if
(
fileDataList
!=
null
&&
fileDataList
.
size
()
>
0
)
{
this
.
updateAttachs
(
fileDataList
,
chAprReport
.
getReportId
().
longValue
());
}
//修改鉴定报告人员(有就update,没有就insert)
List
<
ChAprPersonInfo
>
personInfos
=
personInfoMapper
.
selectList
(
new
QueryWrapper
<
ChAprPersonInfo
>().
eq
(
"report_id"
,
reportId
).
orderByDesc
(
"info_id"
));
if
(
person1
!=
null
)
{
...
...
@@ -445,8 +443,8 @@ public class TaskServiceImpl implements TaskService {
public
Result
<
List
<
AttachVo
>>
reportFileList
(
Long
reportId
)
{
Result
<
List
<
AttachVo
>>
listResult
=
null
;
try
{
//
新增
返回对应的附件列表
listResult
=
attachFeignService
.
selectAttachs
(
reportId
,
(
short
)
1
);
// 返回对应的附件列表
listResult
=
attachFeignService
.
selectAttachs
(
reportId
,
AttachType
.
TASK
.
getUploadType
()
);
if
(!
listResult
.
getCode
().
equals
(
ResultCode
.
SUCCESS
.
getCode
()))
{
log
.
info
(
"请求获取附件列表错误:错误码{},错误信息:{}"
,
listResult
.
getCode
(),
listResult
.
getMsg
());
}
...
...
common/common-core/src/main/java/com/hungraim/ltc/pojo/vo/governance/ProgramDetailVo.java
View file @
88df379b
package
com
.
hungraim
.
ltc
.
pojo
.
vo
.
governance
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.hungraim.ltc.pojo.entity.SysConfig.ChFndAttach
;
import
lombok.Data
;
import
org.springframework.format.annotation.DateTimeFormat
;
...
...
@@ -141,5 +142,9 @@ public class ProgramDetailVo {
*/
private
List
<
ProgramSetAndProjectVo
>
programSetAndProjectVos
;
/**
* 服务方案附件
*/
private
List
<
ChFndAttach
>
fileDataList
;
}
common/common-core/src/main/java/com/hungraim/ltc/pojo/vo/governance/SrvTaskInfoVO.java
View file @
88df379b
package
com
.
hungraim
.
ltc
.
pojo
.
vo
.
governance
;
import
com.hungraim.ltc.pojo.entity.SysConfig.ChFndAttach
;
import
com.hungraim.ltc.pojo.vo.system.AttachVo
;
import
com.hungraim.ltc.util.Result
;
import
lombok.Data
;
import
java.io.Serializable
;
...
...
@@ -48,4 +51,12 @@ public class SrvTaskInfoVO implements Serializable {
* 服务计划状态
*/
private
String
taskStatus
;
/**
* 服务计划附件VO
*/
private
Result
<
List
<
AttachVo
>>
listResult
;
/**
* 服务计划附件
*/
private
List
<
ChFndAttach
>
listAttach
;
}
governance/pom.xml
View file @
88df379b
...
...
@@ -28,6 +28,18 @@
<version>
2.2.5.RELEASE
</version>
</dependency>
<!--feign服务调用-->
<dependency>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-starter-openfeign
</artifactId>
</dependency>
<!--系统服务api-->
<dependency>
<groupId>
com.hungraim.ltc
</groupId>
<artifactId>
system-api
</artifactId>
<version>
0.0.1
</version>
</dependency>
<!--基础包-->
<dependency>
...
...
governance/src/main/java/com/hungraim/ltc/governance/controller/SrvProgramController.java
View file @
88df379b
...
...
@@ -8,6 +8,7 @@ import com.hungraim.ltc.pojo.vo.governance.ProgramDetailVo;
import
com.hungraim.ltc.pojo.vo.governance.ProgramListVo
;
import
com.hungraim.ltc.pojo.vo.governance.ProgramSetAndProjectVo
;
import
com.hungraim.ltc.pojo.vo.governance.SvrSendListVo
;
import
com.hungraim.ltc.pojo.vo.system.AttachVo
;
import
com.hungraim.ltc.util.Result
;
import
com.hungraim.ltc.util.ResultCode
;
import
lombok.extern.slf4j.Slf4j
;
...
...
@@ -81,6 +82,20 @@ public class SrvProgramController {
}
/**
* 查询服务计划附件列表
*
* @param programId 服务计划id
*/
@RequestMapping
(
"/programFileList"
)
public
Result
<
List
<
AttachVo
>>
reportFileList
(
Long
programId
)
{
Result
<
List
<
AttachVo
>>
listResult
=
srvProgramService
.
programFileList
(
programId
);
if
(!
listResult
.
getCode
().
equals
(
ResultCode
.
SUCCESS
.
getCode
()))
{
return
Result
.
failed
(
"请求获取附件列表错误:错误码{"
+
listResult
.
getCode
()
+
"},错误信息:{"
+
listResult
.
getMsg
()
+
"}"
);
}
return
listResult
;
}
/**
* 查看服务方案详情
*
* @param programId 方案id
...
...
governance/src/main/java/com/hungraim/ltc/governance/controller/SrvTaskController.java
View file @
88df379b
...
...
@@ -91,7 +91,7 @@ public class SrvTaskController {
}
/**
* 查询服务计划制定详情列表
* 查询服务计划制定详情
及附件
列表
*
* @param programId 服务方案id
*/
...
...
governance/src/main/java/com/hungraim/ltc/governance/service/SrvProgramService.java
View file @
88df379b
...
...
@@ -5,6 +5,8 @@ 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
com.hungraim.ltc.pojo.vo.system.AttachVo
;
import
com.hungraim.ltc.util.Result
;
import
java.util.List
;
...
...
@@ -61,6 +63,7 @@ public interface SrvProgramService {
/**
* 添加或者修改服务方案
*
* @param programDetailVo 包装对象
*/
void
addProgramAndProgramSetList
(
ProgramDetailVo
programDetailVo
);
...
...
@@ -72,4 +75,12 @@ public interface SrvProgramService {
* @param endReason 终止原因
*/
void
endProgram
(
Long
programId
,
String
endReason
);
/**
* 查询服务计划附件列表
*
* @param programId 服务计划id
*/
Result
<
List
<
AttachVo
>>
programFileList
(
Long
programId
);
}
governance/src/main/java/com/hungraim/ltc/governance/service/impl/SrvProgramServiceImpl.java
View file @
88df379b
...
...
@@ -2,16 +2,24 @@ package com.hungraim.ltc.governance.service.impl;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.hungraim.ltc.api.AttachFeignService
;
import
com.hungraim.ltc.governance.dao.ChSrvProgramMapper
;
import
com.hungraim.ltc.governance.dao.ChSrvProgramSetMapper
;
import
com.hungraim.ltc.governance.dao.ChSrvSendMapper
;
import
com.hungraim.ltc.governance.service.SrvProgramService
;
import
com.hungraim.ltc.pojo.entity.SysConfig.ChFndAttach
;
import
com.hungraim.ltc.pojo.entity.serviceManage.ChSrvProgram
;
import
com.hungraim.ltc.pojo.entity.serviceManage.ChSrvProgramSet
;
import
com.hungraim.ltc.pojo.vo.governance.ProgramDetailVo
;
import
com.hungraim.ltc.pojo.vo.governance.ProgramListVo
;
import
com.hungraim.ltc.pojo.vo.governance.ProgramSetAndProjectVo
;
import
com.hungraim.ltc.pojo.vo.governance.SvrSendListVo
;
import
com.hungraim.ltc.pojo.vo.system.AttachUpdateVo
;
import
com.hungraim.ltc.pojo.vo.system.AttachVo
;
import
com.hungraim.ltc.util.AttachType
;
import
com.hungraim.ltc.util.Result
;
import
com.hungraim.ltc.util.ResultCode
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
...
...
@@ -21,6 +29,7 @@ import java.util.List;
@Service
@Slf4j
public
class
SrvProgramServiceImpl
implements
SrvProgramService
{
@Autowired
...
...
@@ -32,6 +41,9 @@ public class SrvProgramServiceImpl implements SrvProgramService {
@Autowired
private
ChSrvProgramSetMapper
chSrvProgramSetMapper
;
@Autowired
private
AttachFeignService
attachFeignService
;
@Override
public
Page
<
SvrSendListVo
>
getProgramList
(
Page
<
SvrSendListVo
>
page
,
Long
srvOrganId
,
String
realName
,
String
realTel
,
String
programStatus
)
{
return
chSrvSendMapper
.
selectSrvSendList
(
page
,
srvOrganId
,
realName
,
realTel
,
programStatus
);
...
...
@@ -77,6 +89,7 @@ public class SrvProgramServiceImpl implements SrvProgramService {
chSrvProgram
.
setProgStatus
(
0
);
chSrvProgram
.
setEffTime
(
date
);
chSrvProgramMapper
.
insert
(
chSrvProgram
);
programId
=
chSrvProgram
.
getProgramId
();
// 2.使用服务方案记录的id来添加服务方案项目记录
Long
newProgramId
=
chSrvProgram
.
getProgramId
();
List
<
ProgramSetAndProjectVo
>
programSetAndProjectVos
=
programDetailVo
.
getProgramSetAndProjectVos
();
...
...
@@ -115,7 +128,8 @@ public class SrvProgramServiceImpl implements SrvProgramService {
}
}
}
//修改附件
this
.
updateAttachs
(
programDetailVo
.
getFileDataList
(),
programId
);
}
@Override
...
...
@@ -127,6 +141,22 @@ public class SrvProgramServiceImpl implements SrvProgramService {
chSrvProgramMapper
.
updateById
(
chSrvProgram
);
}
@Override
public
Result
<
List
<
AttachVo
>>
programFileList
(
Long
programId
)
{
Result
<
List
<
AttachVo
>>
listResult
=
null
;
try
{
// 返回对应的附件列表
listResult
=
attachFeignService
.
selectAttachs
(
programId
,
AttachType
.
PROGRAM
.
getUploadType
());
if
(!
listResult
.
getCode
().
equals
(
ResultCode
.
SUCCESS
.
getCode
()))
{
log
.
info
(
"请求获取附件列表错误:错误码{},错误信息:{}"
,
listResult
.
getCode
(),
listResult
.
getMsg
());
}
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
());
e
.
printStackTrace
();
}
return
listResult
;
}
private
void
addProgramSet
(
ProgramDetailVo
programDetailVo
,
Date
date
,
Long
newProgramId
,
ProgramSetAndProjectVo
programSetAndProjectVo
)
{
ChSrvProgramSet
chSrvProgramSet
=
new
ChSrvProgramSet
();
chSrvProgramSet
.
setItemId
(
programSetAndProjectVo
.
getProjectId
());
...
...
@@ -142,4 +172,17 @@ public class SrvProgramServiceImpl implements SrvProgramService {
chSrvProgramSet
.
setRemark
(
programSetAndProjectVo
.
getRemark
());
chSrvProgramSetMapper
.
insert
(
chSrvProgramSet
);
}
/**
* 调用feign api来修改附件数据
*/
private
void
updateAttachs
(
List
<
ChFndAttach
>
fileDataList
,
Long
ctrlId
)
{
// 新增附件修改逻辑
AttachUpdateVo
attachUpdateVo
=
new
AttachUpdateVo
();
attachUpdateVo
.
setCtrlId
(
ctrlId
);
attachUpdateVo
.
setAttachType
(
AttachType
.
PROGRAM
.
getUploadType
());
attachUpdateVo
.
setChFndAttachs
(
fileDataList
);
attachFeignService
.
updateAttachs
(
attachUpdateVo
);
}
}
governance/src/main/java/com/hungraim/ltc/governance/service/impl/SrvTaskServiceImpl.java
View file @
88df379b
...
...
@@ -3,14 +3,22 @@ package com.hungraim.ltc.governance.service.impl;
import
cn.hutool.core.util.StrUtil
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.hungraim.ltc.api.AttachFeignService
;
import
com.hungraim.ltc.governance.dao.ChSrvTaskDetailMapper
;
import
com.hungraim.ltc.governance.dao.SrvTaskMapper
;
import
com.hungraim.ltc.governance.service.SrvTaskService
;
import
com.hungraim.ltc.pojo.entity.SysConfig.ChFndAttach
;
import
com.hungraim.ltc.pojo.entity.serviceManage.ChSrvTask
;
import
com.hungraim.ltc.pojo.entity.serviceManage.ChSrvTaskDetail
;
import
com.hungraim.ltc.pojo.vo.governance.*
;
import
com.hungraim.ltc.pojo.vo.system.AttachUpdateVo
;
import
com.hungraim.ltc.pojo.vo.system.AttachVo
;
import
com.hungraim.ltc.util.AttachType
;
import
com.hungraim.ltc.util.DateUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
com.hungraim.ltc.util.Result
;
import
com.hungraim.ltc.util.ResultCode
;
import
lombok.AllArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
...
...
@@ -22,11 +30,12 @@ import java.util.List;
* 服务计划ServiceImpl
*/
@Service
@Slf4j
@AllArgsConstructor
public
class
SrvTaskServiceImpl
implements
SrvTaskService
{
@Autowired
private
SrvTaskMapper
srvTaskMapper
;
@Autowired
private
ChSrvTaskDetailMapper
chSrvTaskDetailMapper
;
private
final
SrvTaskMapper
srvTaskMapper
;
private
final
ChSrvTaskDetailMapper
chSrvTaskDetailMapper
;
private
final
AttachFeignService
attachFeignService
;
/**
* 服务计划制定列表
...
...
@@ -67,6 +76,21 @@ public class SrvTaskServiceImpl implements SrvTaskService {
@Override
public
List
<
SrvTaskInfoVO
>
getSrvTaskInfoList
(
String
programId
)
{
List
<
SrvTaskInfoVO
>
srvTaskInfoList
=
srvTaskMapper
.
getSrvTaskInfoList
(
programId
);
//查询服务计划附件
try
{
for
(
SrvTaskInfoVO
vo
:
srvTaskInfoList
)
{
// 返回对应的附件列表
Result
<
List
<
AttachVo
>>
listResult
=
attachFeignService
.
selectAttachs
(
Long
.
parseLong
(
programId
),
AttachType
.
AUDIT
.
getUploadType
());
if
(!
listResult
.
getCode
().
equals
(
ResultCode
.
SUCCESS
.
getCode
()))
{
log
.
info
(
"请求获取附件列表错误:错误码{},错误信息:{}"
,
listResult
.
getCode
(),
listResult
.
getMsg
());
}
else
{
vo
.
setListResult
(
listResult
);
}
}
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
());
e
.
printStackTrace
();
}
//具体服务日期
for
(
SrvTaskInfoVO
vo
:
srvTaskInfoList
)
{
List
<
ChSrvTaskDetail
>
taskDetails
=
chSrvTaskDetailMapper
.
selectList
(
new
QueryWrapper
<
ChSrvTaskDetail
>().
eq
(
"srv_task_id"
,
vo
.
getSrvTaskId
()));
...
...
@@ -81,6 +105,18 @@ public class SrvTaskServiceImpl implements SrvTaskService {
return
srvTaskInfoList
;
}
/**
* 调用feign api来修改附件数据
*/
private
void
updateAttachs
(
List
<
ChFndAttach
>
fileDataList
,
Long
ctrlId
)
{
// 新增附件修改逻辑
AttachUpdateVo
attachUpdateVo
=
new
AttachUpdateVo
();
attachUpdateVo
.
setCtrlId
(
ctrlId
);
attachUpdateVo
.
setAttachType
(
AttachType
.
AUDIT
.
getUploadType
());
attachUpdateVo
.
setChFndAttachs
(
fileDataList
);
attachFeignService
.
updateAttachs
(
attachUpdateVo
);
}
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Override
public
void
addOrUpdateSrvTask
(
SrvTaskInfoListVO
param
)
{
...
...
@@ -99,22 +135,24 @@ public class SrvTaskServiceImpl implements SrvTaskService {
chSrvTask
.
setSrvEmpId
(
Long
.
parseLong
(
srvTaskInfoVO
.
getSrvEmpId
()));
//服务人员id
chSrvTask
.
setStatus
((
short
)
1
);
//状态 未分配:0;已分配:1;已终止2
srvTaskMapper
.
insert
(
chSrvTask
);
//添加服务计划详情
Long
newSrvTaskId
=
chSrvTask
.
getSrvTaskId
();
insertTaskDetail
(
newSrvTaskId
,
taskDetails
);
this
.
insertTaskDetail
(
newSrvTaskId
,
taskDetails
);
//修改附件
this
.
updateAttachs
(
srvTaskInfoVO
.
getListAttach
(),
Long
.
parseLong
(
srvTaskId
));
}
else
{
// 修改服务计划
ChSrvTask
chSrvTask
=
new
ChSrvTask
();
chSrvTask
.
setSrvTaskId
(
Long
.
parseLong
(
srvTaskId
));
chSrvTask
.
setStatus
(
Short
.
parseShort
(
srvTaskInfoVO
.
getTaskStatus
()));
srvTaskMapper
.
updateById
(
chSrvTask
);
chSrvTaskDetailMapper
.
delete
(
new
QueryWrapper
<
ChSrvTaskDetail
>().
eq
(
"srv_task_id"
,
Long
.
parseLong
(
srvTaskId
)));
//删除原来的计划详情
insertTaskDetail
(
Long
.
parseLong
(
srvTaskId
),
taskDetails
);
this
.
insertTaskDetail
(
Long
.
parseLong
(
srvTaskId
),
taskDetails
);
//修改附件
this
.
updateAttachs
(
srvTaskInfoVO
.
getListAttach
(),
Long
.
parseLong
(
srvTaskId
));
}
}
}
/**
* 插入服务计划详情数据
*
* @param srvTaskId 服务计划id
* @param taskDetails 服务时间集合,时间格式yyyy-MM-dd
*/
...
...
governance/src/main/resources/bootstrap.yml
View file @
88df379b
spring
:
main
:
#允许存在多个Feign调用相同Service的接口
allow-bean-definition-overriding
:
true
devtools
:
restart
:
enabled
:
true
...
...
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