Commit 22ef61f1 authored by 蔡镇泽's avatar 蔡镇泽

费用结算

parent 71430389
......@@ -4,9 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hungraim.ltc.account.service.AccountService;
import com.hungraim.ltc.pojo.entity.account.ChDisabAccounts;
import com.hungraim.ltc.pojo.vo.account.AccountOperVo;
import com.hungraim.ltc.pojo.vo.account.SrvOrganListReq;
import com.hungraim.ltc.pojo.vo.account.SrvOrganListResp;
import com.hungraim.ltc.pojo.vo.account.*;
import com.hungraim.ltc.util.Result;
import com.hungraim.ltc.util.ResultCode;
import lombok.AllArgsConstructor;
......@@ -78,4 +76,23 @@ public class AccountController {
}
return Result.success(accountService.getSrvOrganDetail(accountsId));
}
/**
* 费用结算
*
* @return 返回机构结当月算详情
*/
@GetMapping("/expenseSettlement")
public Result<List<ExpenseSettlementVo>> expenseSettlement(ExpenseSettlementReq req) {
if (null == req.getSrvOrganId() || null == req.getAccountsTime()) {
return Result.failed(ResultCode.REQUEST_PARAM_ERROR);
}
if (req.getPageNum() == null) {
req.setPageNum(1);
}
if (req.getPageSize() == null) {
req.setPageSize(10);
}
return Result.success(accountService.expenseSettlement(req));
}
}
package com.hungraim.ltc.account.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hungraim.ltc.pojo.entity.serviceManage.ChSrvProgram;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;
@Mapper
@Repository
public interface ChSrvProgramMapper extends BaseMapper<ChSrvProgram> {
}
\ No newline at end of file
package com.hungraim.ltc.account.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hungraim.ltc.pojo.entity.serviceManage.ChSrvProgramSet;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;
@Mapper
@Repository
public interface ChSrvProgramSetMapper extends BaseMapper<ChSrvProgramSet> {
}
\ No newline at end of file
package com.hungraim.ltc.account.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hungraim.ltc.pojo.entity.serviceManage.ChSrvTaskDetail;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;
@Mapper
@Repository
public interface ChSrvTaskDetailMapper extends BaseMapper<ChSrvTaskDetail> {
}
\ No newline at end of file
package com.hungraim.ltc.account.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hungraim.ltc.pojo.entity.serviceManage.ChSrvTaskFinishItem;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;
@Mapper
@Repository
public interface ChSrvTaskFinishItemMapper extends BaseMapper<ChSrvTaskFinishItem> {
@Select("<script>" +
"SELECT " +
" count(*) " +//护理机构id
"FROM " +
" ch_srv_task_detail t1 " +
" LEFT JOIN CH_SRV_TASK_FINISH_ITEM t2 ON t1.task_detail_id = t2.task_detail_id " +
"<where> " +
" t1.srv_organ_id = #{srvTaskId} AND t2.task_finish_item_id not null" +
"</where></script>")
int selectDetailsFinishCount(Integer srvTaskId);
}
\ No newline at end of file
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.serviceManage.ChSrvTask;
import com.hungraim.ltc.pojo.vo.account.ExpenseSettlementInfoBo;
import com.hungraim.ltc.pojo.vo.account.ExpenseSettlementReq;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;
@Mapper
@Repository
public interface SrvTaskMapper extends BaseMapper<ChSrvTask> {
@Select("<script>" +
"SELECT " +
" t1.srv_task_id, " +//服务任务id
" t4.program_id, " +//服务方案id
" t3.real_name, " +//失能人员姓名
" t3.certi_code, " +//失能人员身份证号
" t4.srv_mode_id, " +//服务方式id
" t5.srv_mode_name, " +//服务方式名称
" t2.srv_start_time, " +//服务开始时间
" t2.srv_end_time, " +//服务结束时间
" t4.srv_organ_id " +//护理机构id
" t6.disable_level_id " +//失能等级id
" t7.item_id " +//服务项目id
" t7.item_times " +//服务频次
" t7.planning_frequency " +//计划频次
" t8.srv_level_id " +//服务等级id
"FROM " +
" ch_srv_task t1 " +
" LEFT JOIN ch_srv_task_detail t2 ON t1.srv_task_id = t2.srv_task_id " +
" LEFT JOIN ch_disable_info t3 ON t1.disab_info_id = t3.disab_info_id " +
" LEFT JOIN ch_srv_program t4 ON t1.program_id = t4.program_id" +
" LEFT JOIN ch_fnd_srv_mode t5 ON t4.srv_mode_id = t4.srv_mode_id" +
" LEFT JOIN ch_apr_report t6 ON t5.task_id = t1.srv_task_id" +
" LEFT JOIN ch_srv_program_set t7 ON t7.set_id = t4.program_id and t7.is_conf = 1" +
" LEFT JOIN ch_cfg_srv_item t8 ON t8.item_id = t7.item_id" +
"<where> " +
" t4.srv_organ_id = #{req.srvOrganId} AND t4.PROG_STATUS = '1' AND t2.srv_start_time &lt;= #{req.accountsTime} AND t2.srv_end_time &gt;= #{req.accountsTime}" +
"</where></script>")
Page<ExpenseSettlementInfoBo> getExpenseSettlementInfo(Page<ExpenseSettlementInfoBo> page, ExpenseSettlementReq req);
}
......@@ -3,9 +3,9 @@ package com.hungraim.ltc.account.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.hungraim.ltc.pojo.entity.account.ChDisabAccounts;
import com.hungraim.ltc.pojo.vo.account.AccountOperVo;
import com.hungraim.ltc.pojo.vo.account.SrvOrganListReq;
import com.hungraim.ltc.pojo.vo.account.SrvOrganListResp;
import com.hungraim.ltc.pojo.vo.account.*;
import java.util.List;
public interface AccountService extends IService<ChDisabAccounts> {
......@@ -17,4 +17,6 @@ public interface AccountService extends IService<ChDisabAccounts> {
Page<SrvOrganListResp> searchSrvOrganList(SrvOrganListReq srvOrganListReq);
AccountOperVo getSrvOrganDetail(Long accountsId);
List<ExpenseSettlementVo> expenseSettlement(ExpenseSettlementReq req);
}
package com.hungraim.ltc.pojo.vo.account;
import lombok.Data;
import java.util.Date;
/**
*
*/
@Data
public class ExpenseSettlementInfoBo {
/**
* 服务任务id
*/
private Integer srvTaskId;
/**
* 服务方案id
*/
private Integer programId;
/**
* 失能人员姓名
*/
private String realName;
/**
* 失能人员身份证号
*/
private Long certiCode;
/**
* 服务方式id
*/
private String srvModeId;
/**
* 服务方式名称
*/
private String srvModeName;
/**
* 服务开始时间
*/
private Date srvStartTime;
/**
* 服务结束时间
*/
private Date srvEndTime;
/**
* 失能等级id
*/
private String disableLevelId;
/**
* 服务项目id
*/
private String itemId;
/**
* 服务频次
*/
private Integer itemTimes;
/**
* 计划频次
*/
private Integer planningFrequency;
/**
* 服务等级id
*/
private String srvLevelId;
}
package com.hungraim.ltc.pojo.vo.account;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.hungraim.ltc.pojo.vo.BaseReq;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
@Data
public class ExpenseSettlementReq extends BaseReq {
/**
* 护理机构id
*/
private Long srvOrganId;
/**
* 结算月份
*/
@DateTimeFormat(pattern = "yyyy-MM")
@JsonFormat(pattern = "yyyy-MM", timezone = "GMT+8")
private Date accountsTime;
}
package com.hungraim.ltc.pojo.vo.account;
import lombok.Data;
@Data
public class ExpenseSettlementTotalVo {
/**
* 基护费用
*/
private Double foundationProtectionCost;
/**
* 基护应拨费用
*/
private Double expensesPayableFoundationProtection;
/**
* 照护费用
*/
private Double careCosts;
/**
* 照护违规扣除//TODO
*/
private String careCompletionRate;
/**
* 照护应拨费用
*/
private Double carePayable;
/**
* 应拨付总金额
*/
private Double totalAmountDue;
}
package com.hungraim.ltc.pojo.vo.account;
import lombok.Data;
import java.util.Date;
@Data
public class ExpenseSettlementVo {
/**
* 失能人员姓名
*/
private String realName;
/**
* 失能人员身份证号
*/
private Long certiCode;
/**
* 护理等级
*/
private Long nursingGrade;
/**
* 服务方式名称
*/
private String srvModeName;
/**
* 服务开始时间
*/
private Date srvStartTime;
/**
* 服务结束时间
*/
private Date srvEndTime;
/**
* 有效结算日
*/
private Integer effectiveSettlementDate;
/**
* 基护费用标准
*/
private String costStandardOfFoundationProtection;
/**
* 基护费用
*/
private Double foundationProtectionCost;
/**
* 基护完成率
*/
private String completionRateFoundationProtection;
/**
* 巡护基护完成考核
*/
private String patrolAndBasicProtectionCompletedAssessment;
/**
* 基护应拨费用
*/
private Double expensesPayableFoundationProtection;
/**
* 照护费用标准
*/
private String standardCareCost;
/**
* 照护费用
*/
private Double careCosts;
/**
* 照护完成率
*/
private String careCompletionRate;
/**
* 巡护照护完成考核
*/
private String patrolCareCompletionAssessment;
/**
* 照护应拨费用
*/
private Double carePayable;
/**
* 应拨付总金额
*/
private Double totalAmountDue;
/**
* 合计
*/
private String total;
}
package com.hungraim.ltc.util;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;
/**
* 服务等级枚举类
*/
@AllArgsConstructor
@NoArgsConstructor
public enum CfgSrvLevel {
ONE("1", "一级"),
TWO("2", "二级"),
THREE("3", "三级");
private String code;
private String msg;
public String getCode() {
return code;
}
public String getMsg() {
return msg;
}
}
package com.hungraim.ltc.util;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;
/**
* 失能等级枚举类
*/
@AllArgsConstructor
@NoArgsConstructor
public enum DisableLevel {
ONE("1", "一级"),
TWO("2", "二级"),
THREE("3", "三级");
private String code;
private String msg;
public String getCode() {
return code;
}
public String getMsg() {
return msg;
}
}
package com.hungraim.ltc.util;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;
/**
* 服务方式枚举类
*/
@AllArgsConstructor
@NoArgsConstructor
public enum FndSrvMode {
PATROL("1", "巡护"),
HOME_CARE("2", "家护"),
HOSPITAL_NURSING("3", "院护");
private String code;
private String msg;
public String getCode() {
return code;
}
public String getMsg() {
return msg;
}
}
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