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
9ea85fa8
Commit
9ea85fa8
authored
Apr 10, 2023
by
zhangwanglin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
退回
parent
62802335
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
189 additions
and
10 deletions
+189
-10
AccountController.java
...om/hungraim/ltc/account/controller/AccountController.java
+10
-0
ChSrvPlanMapper.java
...in/java/com/hungraim/ltc/account/dao/ChSrvPlanMapper.java
+16
-0
AccountService.java
...java/com/hungraim/ltc/account/service/AccountService.java
+4
-0
AccountServiceImpl.java
...hungraim/ltc/account/service/impl/AccountServiceImpl.java
+43
-0
ChSrvTaskDetailMapper.java
...main/java/com/hungraim/ltc/dao/ChSrvTaskDetailMapper.java
+11
-0
SrvOrganEmpServiceImpl.java
...com/hungraim/ltc/service/impl/SrvOrganEmpServiceImpl.java
+89
-10
ChSrvTaskDetailMapper.xml
...rvice/src/main/resources/mapper/ChSrvTaskDetailMapper.xml
+16
-0
No files found.
account/account-service/src/main/java/com/hungraim/ltc/account/controller/AccountController.java
View file @
9ea85fa8
...
...
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.hungraim.ltc.account.service.AccountService
;
import
com.hungraim.ltc.pojo.entity.account.*
;
import
com.hungraim.ltc.pojo.entity.governance.ChSrvPlan
;
import
com.hungraim.ltc.pojo.vo.account.*
;
import
com.hungraim.ltc.pojo.vo.disable.PlaceOtherVO
;
import
com.hungraim.ltc.util.FileUtils
;
...
...
@@ -385,6 +386,15 @@ public class AccountController {
}
@RequestMapping
(
"/accountReturn"
)
public
Result
accountReturn
(
ChSrvPlan
chSrvPlan
)
{
Result
result
=
accountService
.
accountReturn
(
chSrvPlan
);
return
result
;
}
}
...
...
account/account-service/src/main/java/com/hungraim/ltc/account/dao/ChSrvPlanMapper.java
0 → 100644
View file @
9ea85fa8
package
com
.
hungraim
.
ltc
.
account
.
dao
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.hungraim.ltc.pojo.entity.governance.ChSrvPlan
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.springframework.stereotype.Repository
;
import
java.util.List
;
@Repository
@Mapper
public
interface
ChSrvPlanMapper
extends
BaseMapper
<
ChSrvPlan
>
{
}
account/account-service/src/main/java/com/hungraim/ltc/account/service/AccountService.java
View file @
9ea85fa8
...
...
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.api.R;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.hungraim.ltc.pojo.entity.account.*
;
import
com.hungraim.ltc.pojo.entity.governance.ChSrvPlan
;
import
com.hungraim.ltc.pojo.vo.account.*
;
import
com.hungraim.ltc.pojo.vo.disable.PlaceOtherVO
;
...
...
@@ -67,4 +68,7 @@ public interface AccountService extends IService<ChDisabAccounts> {
Page
<
PlaceOtherVO
>
placeOtherQuery
(
Page
page
,
String
name
,
String
certiCode
);
void
placeOtherTaskQuery
();
//退回
Result
accountReturn
(
ChSrvPlan
chSrvPlan
);
}
account/account-service/src/main/java/com/hungraim/ltc/account/service/impl/AccountServiceImpl.java
View file @
9ea85fa8
...
...
@@ -6,6 +6,7 @@ import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.collection.CollectionUtil
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.hungraim.ltc.account.dao.*
;
...
...
@@ -16,6 +17,7 @@ import com.hungraim.ltc.pojo.entity.SysConfig.ChCfgCareService;
import
com.hungraim.ltc.pojo.entity.SysConfig.ChCfgCostStandard
;
import
com.hungraim.ltc.pojo.entity.SysConfig.ChFndAttach
;
import
com.hungraim.ltc.pojo.entity.account.*
;
import
com.hungraim.ltc.pojo.entity.governance.ChSrvPlan
;
import
com.hungraim.ltc.pojo.entity.serviceManage.ChSrvTaskDetail
;
import
com.hungraim.ltc.pojo.entity.serviceManage.ChSrvTaskFinishItem
;
import
com.hungraim.ltc.pojo.vo.account.*
;
...
...
@@ -25,6 +27,7 @@ import lombok.AllArgsConstructor;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.poi.ss.usermodel.Workbook
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
...
...
@@ -52,6 +55,7 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
private
final
ChCfgCostStandardMapper
chCfgCostStandardMapper
;
private
final
ChDisabAccountsDetailMapper
chDisabAccountsDetailMapper
;
private
final
ChDisabFreeRdInfoMapper
chDisabFreeRdInfoMapper
;
private
final
ChSrvPlanMapper
chSrvPlanMapper
;
...
...
@@ -986,4 +990,43 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
}
}
//退回
@Override
public
Result
accountReturn
(
ChSrvPlan
chSrvPlan
){
Long
taskDetailId
=
chSrvPlan
.
getTaskDetailId
();
Long
disabInfoId
=
chSrvPlan
.
getDisabInfoId
();
Long
modeId
=
chSrvPlan
.
getModeId
();
Date
srvPlanTime
=
chSrvPlan
.
getSrvPlanTime
();
String
srvPlanTimeStr
=
DateUtils
.
dateToStrYm
(
srvPlanTime
);
Long
srvOrganId
=
chSrvPlan
.
getSrvOrganId
();
LambdaQueryWrapper
<
ChSrvPlan
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
queryWrapper
.
eq
(
ChSrvPlan:
:
getTaskDetailId
,
taskDetailId
);
queryWrapper
.
eq
(
ChSrvPlan:
:
getIsStatus
,
(
short
)
4
);
List
<
ChSrvPlan
>
srvPlanList
=
chSrvPlanMapper
.
selectList
(
queryWrapper
);
int
size
=
srvPlanList
.
size
();
// 大于1说明还有已完成的任务,不退回,只更新状态 等于1结算退回费用
try
{
if
(
size
>
1
){
chSrvPlan
.
setIsStatus
(
0L
);
chSrvPlanMapper
.
updateById
(
chSrvPlan
);
}
else
{
String
srvModeName
=
null
;
if
(
modeId
==
1
){
srvModeName
=
"医疗"
;
}
else
if
(
modeId
==
2
){
srvModeName
=
"养老"
;
}
else
if
(
modeId
==
3
){
srvModeName
=
"上门"
;
}
chDisabAccountsDetailMapper
.
queryDisabDetailAccounts
(
String
.
valueOf
(
srvOrganId
),
srvPlanTimeStr
,
String
.
valueOf
(
disabInfoId
),
srvModeName
);
}
}
catch
(
Exception
e
)
{
log
.
error
(
"==============accountReturn error:{}"
,
e
);
return
Result
.
failed
(
"服务器异常"
);
}
return
Result
.
success
();
}
}
apply/apply-service/src/main/java/com/hungraim/ltc/dao/ChSrvTaskDetailMapper.java
View file @
9ea85fa8
package
com
.
hungraim
.
ltc
.
dao
;
import
com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.hungraim.ltc.pojo.entity.account.ChDisabDetailAccounts
;
import
com.hungraim.ltc.pojo.entity.serviceManage.ChSrvTaskDetail
;
import
com.hungraim.ltc.pojo.vo.disable.ChSrvTaskDetail2Vo
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.springframework.stereotype.Repository
;
import
java.math.BigDecimal
;
/**
* @author mq
...
...
@@ -22,6 +26,13 @@ public interface ChSrvTaskDetailMapper extends BaseMapper<ChSrvTaskDetail> {
*/
Page
<
ChSrvTaskDetail2Vo
>
chSrvTaskDetailQuery
(
Page
<
ChSrvTaskDetail2Vo
>
page
,
Long
empId
);
String
selectBySrvTaskId
(
String
srvTaskId
);
int
updateByTaskDetailId
(
String
taskDetailId
);
ChDisabDetailAccounts
selectAccountsDetail
(
String
disabInfoId
,
String
srvDateStr
);
void
updateChDisabDetailAccounts
(
Long
accountsId
,
BigDecimal
accountsAllCostsub
,
BigDecimal
accountsOverallCostsub
,
BigDecimal
accountsPersonalCostsub
);
}
apply/apply-service/src/main/java/com/hungraim/ltc/service/impl/SrvOrganEmpServiceImpl.java
View file @
9ea85fa8
...
...
@@ -3,22 +3,26 @@ package com.hungraim.ltc.service.impl;
import
cn.afterturn.easypoi.excel.ExcelExportUtil
;
import
cn.afterturn.easypoi.excel.entity.ExportParams
;
import
cn.afterturn.easypoi.excel.entity.enmus.ExcelType
;
import
com.baomidou.mybatisplus.core.metadata.OrderItem
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.hungraim.ltc.api.AttachFeignService
;
import
com.hungraim.ltc.dao.*
;
import
com.hungraim.ltc.pojo.entity.SysConfig.ChFndAttach
;
import
com.hungraim.ltc.pojo.entity.account.ChDisabDetailAccounts
;
import
com.hungraim.ltc.pojo.entity.disable.ChCfgSrvEmpType
;
import
com.hungraim.ltc.pojo.entity.disable.ChSrvOrgan
;
import
com.hungraim.ltc.pojo.entity.riskLevel.ChSrvempRiskLevel
;
import
com.hungraim.ltc.pojo.entity.serviceManage.ChSrvOrganEmp
;
import
com.hungraim.ltc.pojo.entity.serviceManage.ChSrvTaskDetail
;
import
com.hungraim.ltc.pojo.entity.serviceManage.ChSrvTaskDetailDelete
;
import
com.hungraim.ltc.pojo.vo.disable.*
;
import
com.hungraim.ltc.pojo.vo.disable.ChSrvTaskDetail2Vo
;
import
com.hungraim.ltc.pojo.vo.disable.SrvOrganEmpExportVo
;
import
com.hungraim.ltc.pojo.vo.disable.SrvOrganEmpListVo
;
import
com.hungraim.ltc.pojo.vo.disable.SrvOrganEmpVo
;
import
com.hungraim.ltc.pojo.vo.system.AttachUpdateVo
;
import
com.hungraim.ltc.service.OrganService
;
import
com.hungraim.ltc.service.SrvOrganEmpService
;
import
com.hungraim.ltc.util.AttachType
;
import
com.hungraim.ltc.util.DateUtils
;
import
com.hungraim.ltc.util.Result
;
import
com.hungraim.ltc.util.ResultCode
;
import
lombok.AllArgsConstructor
;
...
...
@@ -28,8 +32,9 @@ import org.springframework.beans.BeanUtils;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.util.StringUtils
;
import
java.math.BigDecimal
;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.List
;
...
...
@@ -174,16 +179,90 @@ public class SrvOrganEmpServiceImpl implements SrvOrganEmpService {
chSrvTaskDetailDelete
.
setDeleteDate
(
new
Date
());
chSrvTaskDetailDelete
.
setDeleteName
(
userName
);
chSrvTaskDetailDeleteMapper
.
insert
(
chSrvTaskDetailDelete
);
if
(
4
==
chSrvTaskDetail
.
getStatus
())
{
// 开始时间
Date
srvStartTime
=
chSrvTaskDetail
.
getSrvStartTime
();
String
srvStartTimeStr
=
DateUtils
.
dateToStr
(
srvStartTime
);
// 结束时间
Date
srvEndTime
=
chSrvTaskDetail
.
getSrvEndTime
();
String
srvEndTimeStr
=
DateUtils
.
dateToStr
(
srvEndTime
);
Long
min
=
dateDiff
(
srvStartTimeStr
,
srvEndTimeStr
,
"yyyy-MM-dd HH:mm:ss"
,
"min"
);
if
(
min
>=
90
){
Date
srvDate
=
chSrvTaskDetail
.
getSrvDate
();
String
srvDateStr
=
DateUtils
.
dateToStrYm
(
srvDate
);
Long
srvTaskId
=
chSrvTaskDetail
.
getSrvTaskId
();
String
disabInfoId
=
chSrvTaskDetailMapper
.
selectBySrvTaskId
(
String
.
valueOf
(
srvTaskId
));
ChDisabDetailAccounts
chDisabDetailAccounts
=
chSrvTaskDetailMapper
.
selectAccountsDetail
(
disabInfoId
,
srvDateStr
);
Short
status
=
chDisabDetailAccounts
.
getStatus
();
if
(
status
==
1
){
// 已申报不能进行删除
return
-
1
;
}
BigDecimal
accountsAllCost
=
chDisabDetailAccounts
.
getAccountsAllCost
();
BigDecimal
accountsPersonalCost
=
chDisabDetailAccounts
.
getAccountsPersonalCost
();
BigDecimal
accountsOverallCost
=
chDisabDetailAccounts
.
getAccountsOverallCost
();
BigDecimal
accountsAllCostsub
=
accountsAllCost
.
subtract
(
new
BigDecimal
(
75
));
BigDecimal
accountsOverallCostsub
=
accountsOverallCost
.
subtract
(
new
BigDecimal
(
60
));
BigDecimal
accountsPersonalCostsub
=
accountsPersonalCost
.
subtract
(
new
BigDecimal
(
15
));
Long
accountsId
=
chDisabDetailAccounts
.
getAccountsId
();
chSrvTaskDetailMapper
.
updateChDisabDetailAccounts
(
accountsId
,
accountsAllCostsub
,
accountsOverallCostsub
,
accountsPersonalCostsub
);
}
}
return
chSrvTaskDetailMapper
.
updateByTaskDetailId
(
String
.
valueOf
(
chSrvTaskDetail
.
getTaskDetailId
()));
}
chSrvTaskDetail
.
setSrvStartTime
(
null
);
chSrvTaskDetail
.
setSrvEndTime
(
null
);
chSrvTaskDetail
.
setSrvStartPic
(
null
);
chSrvTaskDetail
.
setSrvEndPic
(
null
);
chSrvTaskDetail
.
setSrvStartPic2
(
null
);
chSrvTaskDetail
.
setStatus
((
short
)
0
);
return
chSrvTaskDetailMapper
.
updateById
(
chSrvTaskDetail
);
/**
* 计算2个时间相差的天数、小时、分钟、秒
* @param startTime 开始时间
* @param endTime 截止时间
* @param format 时间格式 yyyy-MM-dd HH:mm:ss
* @param str 返回的数据为:day-天、hour-小时、min-分钟、second-秒
* @return
*/
public
static
Long
dateDiff
(
String
startTime
,
String
endTime
,
String
format
,
String
str
)
{
// 按照传入的格式生成一个simpledateformate对象
SimpleDateFormat
sd
=
new
SimpleDateFormat
(
format
);
long
nd
=
1000
*
24
*
60
*
60
;
// 一天的毫秒数
long
nh
=
1000
*
60
*
60
;
// 一小时的毫秒数
long
nm
=
1000
*
60
;
// 一分钟的毫秒数
long
ns
=
1000
;
// 一秒钟的毫秒数
long
diff
;
long
day
=
0
;
long
hour
=
0
;
long
min
=
0
;
long
second
=
0
;
// 获得两个时间的毫秒时间差异
try
{
diff
=
sd
.
parse
(
endTime
).
getTime
()
-
sd
.
parse
(
startTime
).
getTime
();
// 计算差多少天
day
=
diff
/
nd
;
// 计算差多少小时
hour
=
diff
/
nh
;
// 计算差多少分钟
min
=
diff
/
nm
;
// 计算差多少秒
second
=
diff
/
ns
;
// 输出结果
System
.
out
.
println
(
"时间相差:"
+
day
+
"天"
+
(
hour
-
day
*
24
)
+
"小时"
+
(
min
-
day
*
24
*
60
)
+
"分钟"
+
second
+
"秒。"
);
/*System.out.println("hour=" + hour + ",min=" + min);*/
}
catch
(
ParseException
e
)
{
// TODO Auto-generated catch block
e
.
printStackTrace
();
}
if
(
str
.
equalsIgnoreCase
(
"day"
))
{
return
day
;
}
else
if
(
str
.
equalsIgnoreCase
(
"hour"
))
{
return
hour
;
}
else
if
(
str
.
equalsIgnoreCase
(
"min"
))
{
return
min
;
}
else
{
return
second
;
}
}
}
apply/apply-service/src/main/resources/mapper/ChSrvTaskDetailMapper.xml
View file @
9ea85fa8
...
...
@@ -77,4 +77,19 @@
WHERE m.EMP_ID = #{empId}
order by t.STATUS desc
</select>
<update
id=
"updateByTaskDetailId"
>
UPDATE CH_SRV_TASK_DETAIL SET SRV_START_TIME=null,SRV_END_TIME=null,SRV_START_PIC=null,SRV_END_PIC=null,
SRV_START_PIC2=null,STATUS=0
WHERE TASK_DETAIL_ID = #{taskDetailId}
</update>
<update
id =
"updateChDisabDetailAccounts"
>
UPDATE CH_DISAB_ACCOUNTS_DETAIL d SET d.ACCOUNTS_ALL_COST = #{accountsAllCostsub}, d.ACCOUNTS_OVERALL_COST = #{accountsOverallCostsub},
d.ACCOUNTS_PERSONAL_COST = #{accountsPersonalCostsub}
WHERE d.ACCOUNTS_ID = #{accountsId}
</update>
</mapper>
\ No newline at end of file
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