Commit c09eff5e authored by zhangwanglin's avatar zhangwanglin

结算

parent 5b82c8d8
...@@ -109,7 +109,7 @@ public class AccountController { ...@@ -109,7 +109,7 @@ public class AccountController {
@PostMapping("/organAccountTaskExecute") @PostMapping("/organAccountTaskExecute")
public Result organAccountTaskExecute(AccountTaskReqVO accountTaskReqVO){ public Result organAccountTaskExecute(AccountTaskReqVO accountTaskReqVO){
List<AccountTaskExecuteReqVO> accountTaskExecuteReqVOS = accountTaskReqVO.getAccountTaskList(); List<AccountTaskExecuteReqVO> accountTaskExecuteReqVOS = accountTaskReqVO.getAccountTaskList();
Result result = accountService.organAccountTaskExecute(accountTaskExecuteReqVOS); Result result = accountService.accountTaskExecute(accountTaskExecuteReqVOS);
return result; return result;
} }
...@@ -257,12 +257,18 @@ public class AccountController { ...@@ -257,12 +257,18 @@ public class AccountController {
/** /**
* 查询护理记录 * 查询护理记录
* *
* @param taskDetailId 结算详情id * @param nursingReqVO
* @return * @return
*/ */
@GetMapping("/queryNursingRecords") @GetMapping("/queryNursingRecords")
public Result<Page<NursingRecordsRespVO>> queryNursingRecords(Integer pageNum, Integer pageSize, String taskDetailId) { public Result<Page<NursingRecordsRespVO>> queryNursingRecords(NursingReqVO nursingReqVO) {
Page<NursingRecordsRespVO> nursingRecordsRespVOList = accountService.queryNursingRecords(pageNum,pageSize,taskDetailId); if (StringUtils.isBlank(nursingReqVO.getModeName())
||StringUtils.isBlank(nursingReqVO.getAccountsTime())
||StringUtils.isBlank(nursingReqVO.getDisabInfoId())
||StringUtils.isBlank(nursingReqVO.getSrvOrganId())) {
return Result.failed(ResultCode.REQUEST_PARAM_ERROR);
}
Page<NursingRecordsRespVO> nursingRecordsRespVOList = accountService.queryNursingRecords(nursingReqVO);
return Result.success(nursingRecordsRespVOList); return Result.success(nursingRecordsRespVOList);
} }
......
...@@ -4,9 +4,9 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; ...@@ -4,9 +4,9 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hungraim.ltc.pojo.entity.account.*; import com.hungraim.ltc.pojo.entity.account.*;
import com.hungraim.ltc.pojo.vo.account.AccountExportDetailListResp; 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.OrganAccountsVO;
import com.hungraim.ltc.pojo.vo.account.SrvOrganListReq; import com.hungraim.ltc.pojo.vo.account.SrvOrganListReq;
import com.hungraim.ltc.util.DateUtils;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
...@@ -28,7 +28,7 @@ public interface ChDisabAccountsDetailMapper extends BaseMapper<ChDisabDetailAcc ...@@ -28,7 +28,7 @@ public interface ChDisabAccountsDetailMapper extends BaseMapper<ChDisabDetailAcc
Page<ChDisabDetailAccountsResp> queryOrganAccountsDetail(Page page,SrvOrganListReq req); Page<ChDisabDetailAccountsResp> queryOrganAccountsDetail(Page page,SrvOrganListReq req);
Page<NursingRecordsRespVO> queryNursingRecords(Page page, String taskDetailId); Page<NursingRecordsRespVO> queryNursingRecords(Page page, NursingReqVO req);
OverallEduceDecreaseCostRespVO queryOverallCostRecords(OverallCostReqVO req); OverallEduceDecreaseCostRespVO queryOverallCostRecords(OverallCostReqVO req);
...@@ -39,6 +39,11 @@ public interface ChDisabAccountsDetailMapper extends BaseMapper<ChDisabDetailAcc ...@@ -39,6 +39,11 @@ public interface ChDisabAccountsDetailMapper extends BaseMapper<ChDisabDetailAcc
ChDisabDetailAccounts queryDisabDetailAccounts(String srvOrganId, String accountsTime,String disabInfoId,String srvModeName); ChDisabDetailAccounts queryDisabDetailAccounts(String srvOrganId, String accountsTime,String disabInfoId,String srvModeName);
List<OrganAccountsVO> queryPlanInfoByDetailId(String taskDetailId);
int updateByPlanId(String planId);
int selectByCondition(AccountTaskExecuteReqVO accountTaskExecuteReqVO);
} }
\ No newline at end of file
...@@ -35,7 +35,7 @@ public interface AccountService extends IService<ChDisabAccounts> { ...@@ -35,7 +35,7 @@ public interface AccountService extends IService<ChDisabAccounts> {
Page<NursingRecordsRespVO> queryNursingRecords(Integer pageNum, Integer pageSize, String taskDetailId); Page<NursingRecordsRespVO> queryNursingRecords(NursingReqVO nursingReqVO);
OverallEduceDecreaseCostRespVO queryOverallCostRecords(OverallCostReqVO req); OverallEduceDecreaseCostRespVO queryOverallCostRecords(OverallCostReqVO req);
...@@ -49,6 +49,8 @@ public interface AccountService extends IService<ChDisabAccounts> { ...@@ -49,6 +49,8 @@ public interface AccountService extends IService<ChDisabAccounts> {
Result organAccountTaskExecute(List<AccountTaskExecuteReqVO> accountTaskExecuteReqVOS); Result organAccountTaskExecute(List<AccountTaskExecuteReqVO> accountTaskExecuteReqVOS);
Result accountTaskExecute(List<AccountTaskExecuteReqVO> accountTaskExecuteReqVOS);
void otherPlaceHandler(String programId); void otherPlaceHandler(String programId);
int deleteAccountsDetail(Long accountsDetailId,Long freeRdId); int deleteAccountsDetail(Long accountsDetailId,Long freeRdId);
......
...@@ -14,7 +14,9 @@ ...@@ -14,7 +14,9 @@
d.TASK_DETAIL_ID taskDetailId, d.TASK_DETAIL_ID taskDetailId,
(select district_name from ch_fnd_district dis where apply.MEDICAL_AREA = dis.district_code) medicalArea, (select district_name from ch_fnd_district dis where apply.MEDICAL_AREA = dis.district_code) medicalArea,
o.SRV_ORGAN_NAME srvOrganName, o.SRV_ORGAN_NAME srvOrganName,
o.SRV_ORGAN_ID srvOrganId,
info.REAL_NAME realName, info.REAL_NAME realName,
info.DISAB_INFO_ID disabInfoId,
d.DEDUCTION_AMOUNT deductionAmount, d.DEDUCTION_AMOUNT deductionAmount,
d.REISSUE_AMOUNT reissueAmount, d.REISSUE_AMOUNT reissueAmount,
d.ACCOUNTS_DETAIL_ID accountsDetailId, d.ACCOUNTS_DETAIL_ID accountsDetailId,
...@@ -51,12 +53,16 @@ ...@@ -51,12 +53,16 @@
<select id="queryNursingRecords" resultType="com.hungraim.ltc.pojo.entity.account.NursingRecordsRespVO"> <select id="queryNursingRecords" resultType="com.hungraim.ltc.pojo.entity.account.NursingRecordsRespVO">
select organ.SRV_ORGAN_NAME srvOrganName, select organ.SRV_ORGAN_NAME srvOrganName,
DECODE(plan.MODE_ID, '1','医疗','2', '养老','3','上门', '4', '异地') modeName, to_char(plan.SRV_PLAN_TIME,'yyyy-MM-dd') srvPlanTime,
DECODE(plan.MODE_ID, '1','医疗','2', '养老','3','上门', '4', '异地') modeName,
to_char(plan.CREATION_TIME,'yyyy-MM-dd HH24:mi:ss') executionTime, to_char(plan.CREATION_TIME,'yyyy-MM-dd HH24:mi:ss') executionTime,
plan.item_name itemName plan.item_name itemName
from CH_SRV_PLAN plan from CH_SRV_PLAN plan
left join CH_SRV_ORGAN organ on organ.SRV_ORGAN_ID = plan.SRV_ORGAN_ID left join CH_SRV_ORGAN organ on organ.SRV_ORGAN_ID = plan.SRV_ORGAN_ID
where plan.TASK_DETAIL_ID = #{taskDetailId} and plan.IS_STATUS ='4' where plan.DISAB_INFO_ID = #{req.disabInfoId}
and plan.SRV_ORGAN_ID = #{req.srvOrganId}
and plan.MODE_ID = #{req.modeId}
and plan.IS_STATUS ='4'
</select> </select>
...@@ -86,7 +92,7 @@ ...@@ -86,7 +92,7 @@
and info.REAL_NAME = #{realName} and info.REAL_NAME = #{realName}
</if> </if>
<if test="accountsTime != null and accountsTime != ''"> <if test="accountsTime != null and accountsTime != ''">
and to_char(detail.accounts_time,'yyyy-MM-dd') = #{accountsTime} and to_char(detail.accounts_time,'yyyy-MM') = #{accountsTime}
</if> </if>
<if test="srvOrganName != null and srvOrganName != ''"> <if test="srvOrganName != null and srvOrganName != ''">
and organ.SRV_ORGAN_NAME = #{srvOrganName} and organ.SRV_ORGAN_NAME = #{srvOrganName}
...@@ -137,6 +143,35 @@ ...@@ -137,6 +143,35 @@
</where> </where>
</select> </select>
<select id="queryPlanInfoByDetailId" resultType="com.hungraim.ltc.pojo.vo.account.OrganAccountsVO">
select
plan.TASK_DETAIL_ID taskDetailId,
plan.PLAN_ID planId,
--失能人员姓名
disable.real_name realName,
disable.DISAB_INFO_ID disabInfoId,
--身份证号
disable.CERTI_CODE certiCode,
--所在省市
(select district_name from ch_fnd_district dis where apply.MEDICAL_AREA = dis.district_code) medicalArea,
--服务方式
DECODE(plan.MODE_ID, '1','医疗','2', '养老','3','上门', '4', '异地') srvModeName,
--护理机构名称
plan.srv_organ_id srvOrganId,
--护理机构名称
organ.srv_organ_name srvOrganName,
--护理服务人员 Id
plan.EMP_ID empId,
--任务时间
plan.SRV_PLAN_TIME srvDate,
-- 机构等级
organ.LEVEL_CODE levelCode
from CH_SRV_PLAN plan
left join ch_srv_organ organ on plan.srv_organ_id = organ.srv_organ_id
left join ch_disable_info disable on plan.disab_info_id = disable.disab_info_id--失能人员
left join CH_DISABLE_APPLY apply on apply.apply_id = disable.apply_id
where plan.IS_STATUS = '4' and plan.IS_BILL = 1 and plan.TASK_DETAIL_ID = #{taskDetailId}
</select>
<select id="queryAccountByCondition" resultType="com.hungraim.ltc.pojo.entity.account.ChDisabDetailAccounts"> <select id="queryAccountByCondition" resultType="com.hungraim.ltc.pojo.entity.account.ChDisabDetailAccounts">
select * from CH_DISAB_ACCOUNTS_DETAIL t where t.MODE_NAME in ('养老','医疗') select * from CH_DISAB_ACCOUNTS_DETAIL t where t.MODE_NAME in ('养老','医疗')
...@@ -281,6 +316,16 @@ ...@@ -281,6 +316,16 @@
and d.MODE_NAME = #{srvModeName} and d.MODE_NAME = #{srvModeName}
</select> </select>
<update id="updateByPlanId">
update CH_SRV_PLAN set IS_BILL =1 where PLAN_ID = #{planId}
</update>
<select id="selectByCondition" parameterType="com.hungraim.ltc.pojo.vo.account.AccountTaskExecuteReqVO" resultType="java.lang.Integer">
select count(1) from CH_DISAB_ACCOUNTS_DETAIL detail where detail.STATUS = 1 and
detail.SRV_ORGAN_ID = #{srvOrganId} and detail.MODE_NAME=#{srvModeName} and detail.DISAB_INFO_ID = #{disabInfoId}
and to_char(detail.ACCOUNTS_TIME,'yyyy-MM')=#{srvDateYm}
</select>
</mapper> </mapper>
...@@ -9,12 +9,18 @@ ...@@ -9,12 +9,18 @@
plan.TASK_DETAIL_ID taskDetailId, plan.TASK_DETAIL_ID taskDetailId,
plan.ITEM_NAME itemName, plan.ITEM_NAME itemName,
emp.emp_name empName, emp.emp_name empName,
emp.emp_id empId,
info.DISAB_INFO_ID disabInfoId,
organ.SRV_ORGAN_NAME srvOrganName, organ.SRV_ORGAN_NAME srvOrganName,
organ.SRV_ORGAN_ID srvOrganId,
DECODE(plan.MODE_ID, '1','医疗','2', '养老','3','上门', '4', '异地') srvModeName, DECODE(plan.MODE_ID, '1','医疗','2', '养老','3','上门', '4', '异地') srvModeName,
to_char(plan.SRV_PLAN_TIME,'yyyy-MM-dd') srvDate, to_char(plan.SRV_PLAN_TIME,'yyyy-MM-dd') srvDate,
plan.IS_STATUS status plan.IS_STATUS status,
(select district_name from ch_fnd_district dis where apply.MEDICAL_AREA = dis.district_code) medicalArea,
organ.LEVEL_CODE levelCode
from ch_srv_plan plan from ch_srv_plan plan
left join ch_disable_info info on plan.DISAB_INFO_ID = info.DISAB_INFO_ID left join ch_disable_info info on plan.DISAB_INFO_ID = info.DISAB_INFO_ID
left join CH_DISABLE_APPLY apply on apply.APPLY_ID = info.APPLY_ID
left join ch_srv_organ_emp emp on plan.emp_id = emp.emp_id left join ch_srv_organ_emp emp on plan.emp_id = emp.emp_id
left join CH_SRV_ORGAN organ on organ.SRV_ORGAN_ID = plan.SRV_ORGAN_ID left join CH_SRV_ORGAN organ on organ.SRV_ORGAN_ID = plan.SRV_ORGAN_ID
<where> <where>
......
...@@ -19,7 +19,6 @@ public class ChDisabDetailAccountsResp implements Serializable { ...@@ -19,7 +19,6 @@ public class ChDisabDetailAccountsResp implements Serializable {
/** /**
* 结算月份 * 结算月份
*/ */
private String accountsTime; private String accountsTime;
/** /**
...@@ -50,6 +49,7 @@ public class ChDisabDetailAccountsResp implements Serializable { ...@@ -50,6 +49,7 @@ public class ChDisabDetailAccountsResp implements Serializable {
private String srvOrganName; private String srvOrganName;
private String srvOrganId;
private String realName; private String realName;
...@@ -61,6 +61,8 @@ public class ChDisabDetailAccountsResp implements Serializable { ...@@ -61,6 +61,8 @@ public class ChDisabDetailAccountsResp implements Serializable {
private String accountsDetailId; private String accountsDetailId;
private String disabInfoId;
private Integer status; private Integer status;
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
......
...@@ -23,6 +23,10 @@ public class NursingRecordsRespVO { ...@@ -23,6 +23,10 @@ public class NursingRecordsRespVO {
/** /**
*执行日期 *执行日期
**/ **/
private String srvPlanTime;
/**
*执行日期
**/
private String executionTime; private String executionTime;
/** /**
*任务名称 *任务名称
......
package com.hungraim.ltc.pojo.entity.account;
import com.hungraim.ltc.pojo.vo.BaseReq;
import lombok.Data;
/**
* @author zwl
* @ClassName NursingReqVO
* @description
* @date 2023/3/6 18:00
**/
@Data
public class NursingReqVO extends BaseReq {
private String accountsTime;
private String disabInfoId;
private String modeId;
private String modeName;
private String srvOrganId;
}
...@@ -12,6 +12,17 @@ public class AccountTaskExecuteReqVO { ...@@ -12,6 +12,17 @@ public class AccountTaskExecuteReqVO {
private String itemId; private String itemId;
private String srvOrganId;
private String srvDate; private String srvDate;
private String disabInfoId;
private String srvModeName;
private String levelCode;
private Long empId;
private String medicalArea;
private String srvDateYm;
} }
...@@ -86,4 +86,6 @@ public class OrganAccountsVO { ...@@ -86,4 +86,6 @@ public class OrganAccountsVO {
private String itemName; private String itemName;
private String planId;
} }
...@@ -21,6 +21,8 @@ public class SrvTaskRespVO { ...@@ -21,6 +21,8 @@ public class SrvTaskRespVO {
// 护理人员 // 护理人员
private String empName; private String empName;
private String empId;
// 任务时间 // 任务时间
private String srvDate; private String srvDate;
...@@ -34,4 +36,12 @@ public class SrvTaskRespVO { ...@@ -34,4 +36,12 @@ public class SrvTaskRespVO {
private String srvModeName; private String srvModeName;
private String srvOrganId;
private String disabInfoId;
private String levelCode;
private String medicalArea;
} }
...@@ -12,4 +12,5 @@ public class AllocationSrvTaskVO { ...@@ -12,4 +12,5 @@ public class AllocationSrvTaskVO {
private String exitTime; private String exitTime;
private String srvDate; private String srvDate;
private Long srvTaskId; private Long srvTaskId;
private String programId;
} }
...@@ -189,7 +189,22 @@ public class DateUtils { ...@@ -189,7 +189,22 @@ public class DateUtils {
return null; return null;
} }
} }
/**
* 将短时间格式字符串转换为时间 yyyy-MM-dd HH:mm:ss
*
* @param strDate
* @return
*/
public static Date strToDateMd(String strDate) {
try {
SimpleDateFormat formatter = new SimpleDateFormat(DATE_PATTERN_yyyy_MM_dd);
ParsePosition pos = new ParsePosition(0);
Date strtodate = formatter.parse(strDate, pos);
return strtodate;
} catch (Throwable e) {
return null;
}
}
/** /**
* 字符串时间戳转日期 * 字符串时间戳转日期
* *
......
...@@ -11,6 +11,6 @@ import java.util.List; ...@@ -11,6 +11,6 @@ import java.util.List;
@Repository @Repository
@Mapper @Mapper
public interface ChSrvPlanMapper extends BaseMapper<ChSrvPlan> { public interface ChSrvPlanMapper extends BaseMapper<ChSrvPlan> {
List<ChSrvPlan> queryPlan(String programId); List<ChSrvPlan> queryPlan(String programId,String srvPlanTime);
} }
...@@ -18,7 +18,7 @@ public class SrvTaskScheduledServiceImpl { ...@@ -18,7 +18,7 @@ public class SrvTaskScheduledServiceImpl {
@Autowired @Autowired
private SrvTaskService srvTaskService; private SrvTaskService srvTaskService;
@Scheduled(cron = "30 30 23 * * ?") @Scheduled(cron = "30 05 19 * * ?")
public void timeAllocationSrvTask() { public void timeAllocationSrvTask() {
log.info("timeAllocationSrvTask========start"); log.info("timeAllocationSrvTask========start");
srvTaskService.timeAllocationSrvTask(); srvTaskService.timeAllocationSrvTask();
......
...@@ -146,7 +146,7 @@ public class SrvTaskServiceImpl implements SrvTaskService { ...@@ -146,7 +146,7 @@ public class SrvTaskServiceImpl implements SrvTaskService {
//添加服务计划详情 //添加服务计划详情
Long newSrvTaskId = chSrvTask.getSrvTaskId(); Long newSrvTaskId = chSrvTask.getSrvTaskId();
this.insertTaskDetail(newSrvTaskId, taskDetails); this.insertTaskDetail(newSrvTaskId, taskDetails);
saveSrvPlan(programId); saveSrvPlan(programId,null);
//添加附件 //添加附件
// this.updateAttachs(srvTaskInfoVO.getListAttach(), chSrvTask.getSrvTaskId()); // this.updateAttachs(srvTaskInfoVO.getListAttach(), chSrvTask.getSrvTaskId());
} else { } else {
...@@ -169,9 +169,10 @@ public class SrvTaskServiceImpl implements SrvTaskService { ...@@ -169,9 +169,10 @@ public class SrvTaskServiceImpl implements SrvTaskService {
} }
public void saveSrvPlan(String programId){ public void saveSrvPlan(String programId,String srvPlanTime){
List<ChSrvPlan> chSrvPlans = chSrvPlanMapper.queryPlan(programId); List<ChSrvPlan> chSrvPlans = chSrvPlanMapper.queryPlan(programId,srvPlanTime);
for (ChSrvPlan chSrvPlan : chSrvPlans) { for (ChSrvPlan chSrvPlan : chSrvPlans) {
chSrvPlan.setCreationTime(new Date());
chSrvPlanMapper.insert(chSrvPlan); chSrvPlanMapper.insert(chSrvPlan);
} }
} }
...@@ -223,6 +224,10 @@ public class SrvTaskServiceImpl implements SrvTaskService { ...@@ -223,6 +224,10 @@ public class SrvTaskServiceImpl implements SrvTaskService {
chSrvTaskDetail.setSrvDate(DateUtils.strToDate(nextDay));//服务开始时间 chSrvTaskDetail.setSrvDate(DateUtils.strToDate(nextDay));//服务开始时间
chSrvTaskDetail.setStatus((short) 0);//状态 未执行:0;执行中:1;已执行:2;已失效:3已完成4 chSrvTaskDetail.setStatus((short) 0);//状态 未执行:0;执行中:1;已执行:2;已失效:3已完成4
chSrvTaskDetailMapper.insert(chSrvTaskDetail); chSrvTaskDetailMapper.insert(chSrvTaskDetail);
// ch_srv_plan
String programId = chSrvTask.getProgramId();
saveSrvPlan(programId,nextDay);
} }
} }
} }
...@@ -28,6 +28,9 @@ ...@@ -28,6 +28,9 @@
LEFT JOIN CH_SERVICE_TYPE_detailed d on d.service_type_detailed_id = CSOP.item_name LEFT JOIN CH_SERVICE_TYPE_detailed d on d.service_type_detailed_id = CSOP.item_name
<where> <where>
disable.SRV_MODE_ID in ('1','2') and program.program_id =#{programId} disable.SRV_MODE_ID in ('1','2') and program.program_id =#{programId}
<if test="srvPlanTime != null">
and to_char(detail.SRV_DATE,'yyyy-MM-dd') = #{srvPlanTime}
</if>
</where> </where>
order by detail.SRV_DATE desc order by detail.SRV_DATE desc
</select> </select>
......
...@@ -216,7 +216,7 @@ ...@@ -216,7 +216,7 @@
</where> </where>
</select> </select>
<select id="getAllocationSrvTask" resultType="com.hungraim.ltc.pojo.vo.governance.AllocationSrvTaskVO"> <select id="getAllocationSrvTask" resultType="com.hungraim.ltc.pojo.vo.governance.AllocationSrvTaskVO">
select t.SRV_TASK_ID,t.SRV_DATE,info.EXIT_TIME,info.EXIT_FLAG,info.EXIT_REASON_ID from CH_SRV_TASK t select t.SRV_TASK_ID,t.SRV_DATE,info.EXIT_TIME,info.EXIT_FLAG,info.EXIT_REASON_ID,t.program_id programId from CH_SRV_TASK t
left join CH_DISABLE_INFO info on t.DISAB_INFO_ID = info.DISAB_INFO_ID left join CH_DISABLE_INFO info on t.DISAB_INFO_ID = info.DISAB_INFO_ID
left join ch_apr_task aprtask on info.last_task_id = aprtask.task_id--评定任务 left join ch_apr_task aprtask on info.last_task_id = aprtask.task_id--评定任务
left join ch_apr_report report on aprtask.task_id = report.task_id--评定报告 left join ch_apr_report report on aprtask.task_id = report.task_id--评定报告
......
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