Commit 43dda4ef authored by zhangwanglin's avatar zhangwanglin

基金申报驳回

parent 840dc716
......@@ -18,6 +18,7 @@ import org.apache.poi.ss.usermodel.Workbook;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.math.BigDecimal;
import java.text.ParseException;
import java.util.ArrayList;
import java.util.Arrays;
......@@ -396,7 +397,23 @@ public class AccountController {
}
/**
*驳回基金申报
**/
@RequestMapping("/accountReportReject")
public Result accountReportReject(ReportRejectReqVO reportRejectReqVO) {
log.info("=======accountReportReject:{}",reportRejectReqVO);
if (null == reportRejectReqVO.getAccountsDetailId()&&StringUtils.isEmpty(reportRejectReqVO.getRemarks())) {
return Result.failed(ResultCode.REQUEST_PARAM_ERROR);
}
if(reportRejectReqVO.getDeductionAmount().compareTo(BigDecimal.ZERO) != 0
||reportRejectReqVO.getReissueAmount().compareTo(BigDecimal.ZERO) != 0){
return Result.failed("该失能人员存在费用扣减,请先移步统筹费用扣减进行清除!");
}
Result result = accountService.accountReportReject(reportRejectReqVO);
return result;
}
......
......@@ -16,6 +16,8 @@ import java.util.List;
public interface AccountService extends IService<ChDisabAccounts> {
Result accountReportReject(ReportRejectReqVO reportRejectReqVO);
/**
* 添加或修改结算记录
*/
......
......@@ -62,7 +62,33 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
private final ChSrvTaskFinishItemMapper chSrvTaskFinishItemMapper;;
@Override
@Transactional(rollbackFor = Exception.class)
public Result accountReportReject(ReportRejectReqVO reportRejectReqVO) {
ChDisabDetailAccounts chDisabDetailAccounts = new ChDisabDetailAccounts();
chDisabDetailAccounts.setLcd(new Date());
chDisabDetailAccounts.setAccountsDetailId(reportRejectReqVO.getAccountsDetailId());
chDisabDetailAccounts.setStatus((short)0);
chDisabDetailAccounts.setDealType(0);
int result = chDisabAccountsDetailMapper.updateById(chDisabDetailAccounts);
if (result > 0) {
ChDisabAccounts chDisabAccountDTO = disabAccountsMapper.selectById(reportRejectReqVO.getAccountsId());
BigDecimal allCost = chDisabAccountDTO.getAllCost();
BigDecimal overallCost = chDisabAccountDTO.getOverallCost();
BigDecimal personalCost = chDisabAccountDTO.getPersonalCost();
BigDecimal allCostSubtract = allCost.subtract(reportRejectReqVO.getAccountsAllCost());
BigDecimal overallCostSubtract = overallCost.subtract(reportRejectReqVO.getAccountsOverallCost());
BigDecimal personalCostSubtract = personalCost.subtract(reportRejectReqVO.getAccountsPersonalCost());
chDisabAccountDTO.setAllCost(allCostSubtract);
chDisabAccountDTO.setOverallCost(overallCostSubtract);
chDisabAccountDTO.setPersonalCost(personalCostSubtract);
chDisabAccountDTO.setLcd(new Date());
disabAccountsMapper.updateById(chDisabAccountDTO);
return Result.success();
} else {
return Result.failed("驳回失败");
}
}
@Override
@Transactional(rollbackFor = Exception.class)
......@@ -633,7 +659,6 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
for (AccountTaskExecuteReqVO accountTaskExecuteReqVO : accountTaskList) {
// 已申报的任务不允许再执行任务
String srvDateYm = DateUtils.dateToStrYm(DateUtils.strToDate(accountTaskExecuteReqVO.getSrvDate()));
accountTaskExecuteReqVO.setSrvDateYm(srvDateYm);
int count = chDisabAccountsDetailMapper.selectByCondition(accountTaskExecuteReqVO);
......@@ -675,6 +700,7 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
// 已完成任务 已结算
List<OrganAccountsVO> accountsList = chDisabAccountsDetailMapper.queryPlanInfoByDetailId(taskDetailId);
if (CollectionUtil.isNotEmpty(accountsList)) {
log.info("该失能人员当天已有执行记录,不在产生费用,taskDetailId:{}",taskDetailId);
return;
}else {
// 不同的护理人员同一天对同一个失能人员服务项目只计一条费用
......@@ -682,13 +708,14 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
if (Objects.nonNull(taskDetailDisableVO)) {
int count = chDisabAccountsDetailMapper.queryTaskDetailDisable(taskDetailDisableVO);
if(count>0){
log.info("该失能人员当天已经有护理人员护理过,不在产生费用");
log.info("该失能人员当天已经有护理人员护理过,不在产生费用,taskDetailId:{}",taskDetailId);
return;
}
}
}
ChSrvTaskDetail ca = new ChSrvTaskDetail();
ca.setStatus((short) 4);
ca.setLcd(new Date());
ca.setTaskDetailId(Long.valueOf(taskDetailId));
chSrvTaskDetailMapper.updateById(ca);
AccountTaskExecuteReqVO accountsVO = accountTaskList.get(0);
......@@ -1068,6 +1095,7 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
Date date = DateUtils.strToDate(srvPlanTime);
String srvOrganId = srvTaskRespVO.getSrvOrganId();
Long itemId = srvTaskRespVO.getItemId();
log.info("AccountServiceImpl====accountReturn===taskDetailId:{},disabInfoId:{},srvPlanTime:{},itemId:{}",taskDetailId,disabInfoId,srvPlanTime,itemId);
ChDisabDetailAccounts chDisabDetailAccounts = chDisabAccountsDetailMapper.queryDisabDetailAccounts(String.valueOf(srvOrganId), DateUtils.dateToStrYm(date), disabInfoId, srvModeName);
Short status = chDisabDetailAccounts.getStatus();
if(status != 0){
......@@ -1083,16 +1111,15 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
queryWrapper.eq(ChSrvPlan::getIsStatus, (short) 4);
List<ChSrvPlan> srvPlanList = chSrvPlanMapper.selectList(queryWrapper);
int size = srvPlanList.size();
log.info("accountReturn===paln===size:{}",size);
// 大于1说明还有已完成的任务,不退回,只更新状态 等于1结算退回费用
try {
ChSrvPlan chSrvPlan = new ChSrvPlan();
chSrvPlan.setIsStatus(0L);
chSrvPlan.setIsBill(0L);
chSrvPlan.setLcd(new Date());
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) {
......@@ -1130,6 +1157,10 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
chDisabDetailAccounts.setAccountsPersonalCost(personCostSubtract);
chDisabDetailAccounts.setLcd(new Date());
chDisabAccountsDetailMapper.updateById(chDisabDetailAccounts);
ChSrvTaskDetail ca = new ChSrvTaskDetail();
ca.setStatus((short) 0);
ca.setTaskDetailId(Long.valueOf(taskDetailId));
chSrvTaskDetailMapper.updateById(ca);
}
} catch (Exception e) {
......
......@@ -19,7 +19,8 @@
d.DEDUCTION_AMOUNT deductionAmount,
d.REISSUE_AMOUNT reissueAmount,
d.ACCOUNTS_DETAIL_ID accountsDetailId,
d.STATUS
d.STATUS,
d.ACCOUNTS_ID accountsId
from CH_DISAB_ACCOUNTS_DETAIL d
left join CH_DISABLE_INFO info on d.DISAB_INFO_ID = info.DISAB_INFO_ID
left join CH_DISABLE_APPLY apply on info.APPLY_ID=apply.APPLY_ID
......@@ -56,6 +57,7 @@
</if>
</where>
order by info.DISAB_INFO_ID
</select>
<select id="queryNursingRecords" resultType="com.hungraim.ltc.pojo.entity.account.NursingRecordsRespVO">
......
......@@ -9,6 +9,7 @@
T2.REAL_NAME realName,
max(T2.gender) gender,
DECODE(max(T2.SRV_MODE_ID), '1','医疗','2', '养老','3','上门', '4', '异地') svrModelName,
max(T2.SRV_MODE_ID) svrModelId,
to_char(max(e.EXIT_TIME),'yyyy-MM-dd') exitTime,
max(T2.CERTI_CODE) CERTI_CODE,
max(e.EXIT_REASON_ID) exitReasonId,
......
......@@ -63,6 +63,8 @@ public class ChDisabDetailAccountsResp implements Serializable {
private String disabInfoId;
private String accountsId;
private Integer status;
private static final long serialVersionUID = 1L;
......
......@@ -24,5 +24,7 @@ public class ChSrvPlan {
private Date creationTime;
private Date srvPlanTime;
private Long isStatus;
private Long isBill;
private Date lcd;
}
package com.hungraim.ltc.pojo.vo.account;
import lombok.Data;
import java.math.BigDecimal;
/**
* @author zwl
* @ClassName ReportRejectReqVO
* @description
* @date 2023/6/1 16:35
**/
@Data
public class ReportRejectReqVO {
private Long accountsDetailId;
private Long accountsId;
/**
* 应拨总费用
*/
private BigDecimal accountsAllCost;
private BigDecimal accountsOverallCost;
private BigDecimal accountsPersonalCost;
private BigDecimal deductionAmount;
private BigDecimal reissueAmount;
private String remarks;
}
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