Commit 3a80948f authored by zhangwanglin's avatar zhangwanglin

退回

parent 9ea85fa8
...@@ -387,8 +387,8 @@ public class AccountController { ...@@ -387,8 +387,8 @@ public class AccountController {
} }
@RequestMapping("/accountReturn") @RequestMapping("/accountReturn")
public Result accountReturn(ChSrvPlan chSrvPlan) { public Result accountReturn(SrvTaskRespVO srvTaskRespVO) {
Result result = accountService.accountReturn(chSrvPlan); Result result = accountService.accountReturn(srvTaskRespVO);
return result; return result;
} }
......
...@@ -70,5 +70,5 @@ public interface AccountService extends IService<ChDisabAccounts> { ...@@ -70,5 +70,5 @@ public interface AccountService extends IService<ChDisabAccounts> {
void placeOtherTaskQuery(); void placeOtherTaskQuery();
//退回 //退回
Result accountReturn(ChSrvPlan chSrvPlan); Result accountReturn(SrvTaskRespVO srvTaskRespVO);
} }
...@@ -992,13 +992,18 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis ...@@ -992,13 +992,18 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
//退回 //退回
@Override @Override
public Result accountReturn(ChSrvPlan chSrvPlan){ public Result accountReturn(SrvTaskRespVO srvTaskRespVO){
Long taskDetailId = chSrvPlan.getTaskDetailId(); Long taskDetailId = srvTaskRespVO.getTaskDetailId();
Long disabInfoId = chSrvPlan.getDisabInfoId(); String disabInfoId = srvTaskRespVO.getDisabInfoId();
Long modeId = chSrvPlan.getModeId(); String srvModeName = srvTaskRespVO.getSrvModeName();
Date srvPlanTime = chSrvPlan.getSrvPlanTime(); String srvPlanTime = srvTaskRespVO.getSrvDate();
String srvPlanTimeStr = DateUtils.dateToStrYm(srvPlanTime); Date date = DateUtils.strToDate(srvPlanTime);
Long srvOrganId = chSrvPlan.getSrvOrganId(); 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<>(); LambdaQueryWrapper<ChSrvPlan> queryWrapper= new LambdaQueryWrapper<>();
queryWrapper.eq(ChSrvPlan::getTaskDetailId,taskDetailId); queryWrapper.eq(ChSrvPlan::getTaskDetailId,taskDetailId);
queryWrapper.eq(ChSrvPlan::getIsStatus, (short) 4); queryWrapper.eq(ChSrvPlan::getIsStatus, (short) 4);
...@@ -1006,21 +1011,39 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis ...@@ -1006,21 +1011,39 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
int size = srvPlanList.size(); int size = srvPlanList.size();
// 大于1说明还有已完成的任务,不退回,只更新状态 等于1结算退回费用 // 大于1说明还有已完成的任务,不退回,只更新状态 等于1结算退回费用
try { try {
if(size > 1){ ChSrvPlan chSrvPlan = new ChSrvPlan();
chSrvPlan.setIsStatus(0L); chSrvPlan.setIsStatus(0L);
chSrvPlanMapper.updateById(chSrvPlan); chSrvPlan.setPlanID(srvTaskRespVO.getPlanId());
chSrvPlanMapper.updateById(chSrvPlan);
}else { if(size == 1){
String srvModeName = null; BigDecimal accountsAllCost = chDisabDetailAccounts.getAccountsAllCost();
if(modeId==1){ BigDecimal accountsOverallCost = chDisabDetailAccounts.getAccountsOverallCost();
srvModeName = "医疗"; BigDecimal accountsPersonalCost = chDisabDetailAccounts.getAccountsPersonalCost();
}else if(modeId==2){ BigDecimal allCost = new BigDecimal(0);
srvModeName = "养老"; BigDecimal overCost= new BigDecimal(0);
}else if(modeId==3){ BigDecimal personCost = new BigDecimal(0);
srvModeName = "上门"; 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);
} }
chDisabAccountsDetailMapper.queryDisabDetailAccounts(String.valueOf(srvOrganId),srvPlanTimeStr,String.valueOf(disabInfoId),srvModeName); 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) { } catch (Exception e) {
log.error("==============accountReturn error:{}",e); log.error("==============accountReturn error:{}",e);
......
...@@ -73,6 +73,7 @@ ...@@ -73,6 +73,7 @@
where plan.DISAB_INFO_ID = #{req.disabInfoId} where plan.DISAB_INFO_ID = #{req.disabInfoId}
and plan.SRV_ORGAN_ID = #{req.srvOrganId} and plan.SRV_ORGAN_ID = #{req.srvOrganId}
and plan.MODE_ID = #{req.modeId} and plan.MODE_ID = #{req.modeId}
and to_char(plan.SRV_PLAN_TIME,'yyyy-MM') = #{req.accountsTime}
and plan.IS_STATUS ='4' and plan.IS_STATUS ='4'
order by plan.SRV_PLAN_TIME desc order by plan.SRV_PLAN_TIME desc
</select> </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