Commit bf2e73c7 authored by zhangwanglin's avatar zhangwanglin

控制多个护理人员产生结算

parent ffc2c106
......@@ -3,10 +3,7 @@ package com.hungraim.ltc.account.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hungraim.ltc.pojo.entity.account.*;
import com.hungraim.ltc.pojo.vo.account.AccountExportDetailListResp;
import com.hungraim.ltc.pojo.vo.account.AccountTaskExecuteReqVO;
import com.hungraim.ltc.pojo.vo.account.OrganAccountsVO;
import com.hungraim.ltc.pojo.vo.account.SrvOrganListReq;
import com.hungraim.ltc.pojo.vo.account.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
......@@ -44,5 +41,9 @@ public interface ChDisabAccountsDetailMapper extends BaseMapper<ChDisabDetailAcc
int selectByCondition(AccountTaskExecuteReqVO accountTaskExecuteReqVO);
TaskDetailDisableVO queryTaskDisId(String taskDetailId);
int queryTaskDetailDisable(TaskDetailDisableVO taskDetailDisableVO);
}
\ No newline at end of file
......@@ -616,9 +616,13 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
return;
}else {
// 不同的护理人员同一天对同一个失能人员服务项目只计一条费用
int count = chDisabAccountsDetailMapper.queryPlanByTaskDetailId(taskDetailId);
if(count>0){
return;
TaskDetailDisableVO taskDetailDisableVO = chDisabAccountsDetailMapper.queryTaskDisId(taskDetailId);
if (Objects.nonNull(taskDetailDisableVO)) {
int count = chDisabAccountsDetailMapper.queryTaskDetailDisable(taskDetailDisableVO);
if(count>0){
log.info("该失能人员当天已经有护理人员护理过,不在产生费用");
return;
}
}
}
ChSrvTaskDetail ca = new ChSrvTaskDetail();
......
......@@ -170,10 +170,23 @@ and organ.SRV_ORGAN_ID = #{req.srvOrganId} order by detail.SRV_DATE desc
</select>
<select id="queryPlanByTaskDetailId" resultType="java.lang.Integer">
select count(1) from CH_SRV_PLAN p where p.DISAB_INFO_ID
in (select DISAB_INFO_ID from CH_SRV_PLAN where TASK_DETAIL_ID = #{taskDetailId}) and p.IS_STATUS = '4'
select count(1) from CH_SRV_PLAN p left join CH_SRV_TASK_DETAIL d on p.TASK_DETAIL_ID = d.TASK_DETAIL_ID
where p.DISAB_INFO_ID in (select DISAB_INFO_ID from CH_SRV_PLAN where TASK_DETAIL_ID = #{taskDetailId}) and d.STATUS = '4'
</select>
<select id="queryTaskDisId" resultType="com.hungraim.ltc.pojo.vo.account.TaskDetailDisableVO">
select task.DISAB_INFO_ID disabInfoId,to_char(detail.SRV_DATE,'yyyy-MM-dd') srvDate,
detail.TASK_DETAIL_ID taskDetailId from CH_SRV_TASK_DETAIL detail
left join CH_SRV_TASK task on detail.SRV_TASK_ID = task.SRV_TASK_ID
where detail.TASK_DETAIL_ID = #{taskDetailId} and ROWNUM = 1
</select>
<select id="queryTaskDetailDisable" parameterType="com.hungraim.ltc.pojo.vo.account.TaskDetailDisableVO" resultType="java.lang.Integer">
select count(1) from CH_SRV_TASK_DETAIL detail
left join CH_SRV_TASK task on detail.SRV_TASK_ID = task.SRV_TASK_ID
where task.DISAB_INFO_ID = #{disabInfoId} and detail.STATUS = 4 and
to_char(detail.SRV_DATE,'yyyy-MM-dd') = #{srvDate} and detail.TASK_DETAIL_ID <![CDATA[ <>]]> #{taskDetailId}
</select>
<!--查询评估信息-->
......
package com.hungraim.ltc.pojo.vo.account;
import lombok.Data;
/**
* @author zwl
* @ClassName TaskDetailDisableVO
* @description
* @date 2023/3/30 23:03
**/
@Data
public class TaskDetailDisableVO {
private String disabInfoId;
private String srvDate;
private String taskDetailId;
}
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