Commit 3a80948f authored by zhangwanglin's avatar zhangwanglin

退回

parent 9ea85fa8
......@@ -387,8 +387,8 @@ public class AccountController {
}
@RequestMapping("/accountReturn")
public Result accountReturn(ChSrvPlan chSrvPlan) {
Result result = accountService.accountReturn(chSrvPlan);
public Result accountReturn(SrvTaskRespVO srvTaskRespVO) {
Result result = accountService.accountReturn(srvTaskRespVO);
return result;
}
......
......@@ -70,5 +70,5 @@ public interface AccountService extends IService<ChDisabAccounts> {
void placeOtherTaskQuery();
//退回
Result accountReturn(ChSrvPlan chSrvPlan);
Result accountReturn(SrvTaskRespVO srvTaskRespVO);
}
......@@ -992,13 +992,18 @@ 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();
public Result accountReturn(SrvTaskRespVO srvTaskRespVO){
Long taskDetailId = srvTaskRespVO.getTaskDetailId();
String disabInfoId = srvTaskRespVO.getDisabInfoId();
String srvModeName = srvTaskRespVO.getSrvModeName();
String srvPlanTime = srvTaskRespVO.getSrvDate();
Date date = DateUtils.strToDate(srvPlanTime);
String srvOrganId = srvTaskRespVO.getSrvOrganId();
ChDisabDetailAccounts chDisabDetailAccounts = chDisabAccountsDetailMapper.queryDisabDetailAccounts(String.valueOf(srvOrganId), DateUtils.dateToStrYm(date), disabInfoId, srvModeName);
Short status = chDisabDetailAccounts.getStatus();
if(status != 0){
return Result.failed("此任务已提交申报,不可再操作,请联系管理员");
}
LambdaQueryWrapper<ChSrvPlan> queryWrapper= new LambdaQueryWrapper<>();
queryWrapper.eq(ChSrvPlan::getTaskDetailId,taskDetailId);
queryWrapper.eq(ChSrvPlan::getIsStatus, (short) 4);
......@@ -1006,21 +1011,39 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
int size = srvPlanList.size();
// 大于1说明还有已完成的任务,不退回,只更新状态 等于1结算退回费用
try {
if(size > 1){
ChSrvPlan chSrvPlan = new ChSrvPlan();
chSrvPlan.setIsStatus(0L);
chSrvPlan.setPlanID(srvTaskRespVO.getPlanId());
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);
if(size == 1){
BigDecimal accountsAllCost = chDisabDetailAccounts.getAccountsAllCost();
BigDecimal accountsOverallCost = chDisabDetailAccounts.getAccountsOverallCost();
BigDecimal accountsPersonalCost = chDisabDetailAccounts.getAccountsPersonalCost();
BigDecimal allCost = new BigDecimal(0);
BigDecimal overCost= new BigDecimal(0);
BigDecimal personCost = new BigDecimal(0);
if ("养老".equals(srvModeName)) {
allCost = BigDecimal.valueOf(50);
overCost = BigDecimal.valueOf(35);
personCost = BigDecimal.valueOf(15);
// 医疗机构护理,原则上收治医疗护理需求为主的重度失能人员一级及以下医疗机构其限额为 80 元/人/天,由长期护理保险基金支付 70%,个人支付 30%;
} else if ("医疗".equals(srvModeName) && "1".equals(srvTaskRespVO.getLevelCode())) {
allCost = BigDecimal.valueOf(80);
overCost = BigDecimal.valueOf(56);
personCost = BigDecimal.valueOf(24);
// 二级及以上医疗机构其限额为 100 元/人/天,由长期护理保险基金支付 70%,个人支付 30%;
} else if ("医疗".equals(srvModeName) && (!"1".equals(srvTaskRespVO.getLevelCode()))) {
allCost = BigDecimal.valueOf(100);
overCost = BigDecimal.valueOf(70);
personCost = BigDecimal.valueOf(30);
}
BigDecimal allCostSubtract = accountsAllCost.subtract(allCost);
BigDecimal overCostSubtract = accountsOverallCost.subtract(overCost);
BigDecimal personCostSubtract = accountsPersonalCost.subtract(personCost);
chDisabDetailAccounts.setAccountsAllCost(allCostSubtract);
chDisabDetailAccounts.setAccountsOverallCost(overCostSubtract);
chDisabDetailAccounts.setAccountsPersonalCost(personCostSubtract);
chDisabAccountsDetailMapper.updateById(chDisabDetailAccounts);
}
} catch (Exception e) {
log.error("==============accountReturn error:{}",e);
......
......@@ -73,6 +73,7 @@
where plan.DISAB_INFO_ID = #{req.disabInfoId}
and plan.SRV_ORGAN_ID = #{req.srvOrganId}
and plan.MODE_ID = #{req.modeId}
and to_char(plan.SRV_PLAN_TIME,'yyyy-MM') = #{req.accountsTime}
and plan.IS_STATUS ='4'
order by plan.SRV_PLAN_TIME desc
</select>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment