Commit 5b7282cf authored by zhangwanglin's avatar zhangwanglin

Merge branch 'dev_nursing_records_20230214' into dev_ch_master

parents b7e78d91 10c07a40
......@@ -6,7 +6,6 @@ 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.*;
......@@ -27,7 +26,6 @@ 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;
......@@ -992,6 +990,7 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
//退回
@Override
@Transactional(rollbackFor = Exception.class)
public Result accountReturn(SrvTaskRespVO srvTaskRespVO){
Long taskDetailId = srvTaskRespVO.getTaskDetailId();
String disabInfoId = srvTaskRespVO.getDisabInfoId();
......@@ -999,11 +998,17 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
String srvPlanTime = srvTaskRespVO.getSrvDate();
Date date = DateUtils.strToDate(srvPlanTime);
String srvOrganId = srvTaskRespVO.getSrvOrganId();
Long itemId = srvTaskRespVO.getItemId();
ChDisabDetailAccounts chDisabDetailAccounts = chDisabAccountsDetailMapper.queryDisabDetailAccounts(String.valueOf(srvOrganId), DateUtils.dateToStrYm(date), disabInfoId, srvModeName);
Short status = chDisabDetailAccounts.getStatus();
if(status != 0){
return Result.failed("此任务已提交申报,不可再操作,请联系管理员");
}
// 删除 chSrvTaskFinishItemStream
LambdaQueryWrapper<ChSrvTaskFinishItem> chSrvTaskFinishItem = new LambdaQueryWrapper<ChSrvTaskFinishItem>()
.eq(ChSrvTaskFinishItem::getTaskDetailId, taskDetailId)
.eq(ChSrvTaskFinishItem::getItemId, itemId);
int delete = chSrvTaskFinishItemMapper.delete(chSrvTaskFinishItem);
LambdaQueryWrapper<ChSrvPlan> queryWrapper= new LambdaQueryWrapper<>();
queryWrapper.eq(ChSrvPlan::getTaskDetailId,taskDetailId);
queryWrapper.eq(ChSrvPlan::getIsStatus, (short) 4);
......@@ -1015,8 +1020,15 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
chSrvPlan.setIsStatus(0L);
chSrvPlan.setPlanID(srvTaskRespVO.getPlanId());
chSrvPlanMapper.updateById(chSrvPlan);
ChSrvTaskDetail ca = new ChSrvTaskDetail();
ca.setStatus((short) 0);
ca.setTaskDetailId(Long.valueOf(taskDetailId));
chSrvTaskDetailMapper.updateById(ca);
if(size == 1){
BigDecimal accountsAllCost = chDisabDetailAccounts.getAccountsAllCost();
if (accountsAllCost.compareTo(BigDecimal.ZERO) == 0) {
return Result.success("当前费用为0,不再进行费用退回");
}
BigDecimal accountsOverallCost = chDisabDetailAccounts.getAccountsOverallCost();
BigDecimal accountsPersonalCost = chDisabDetailAccounts.getAccountsPersonalCost();
BigDecimal allCost = new BigDecimal(0);
......@@ -1044,6 +1056,7 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
chDisabDetailAccounts.setAccountsOverallCost(overCostSubtract);
chDisabDetailAccounts.setAccountsPersonalCost(personCostSubtract);
chDisabAccountsDetailMapper.updateById(chDisabDetailAccounts);
}
} catch (Exception e) {
log.error("==============accountReturn error:{}",e);
......
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