Commit 91d1b532 authored by zhangwanglin's avatar zhangwanglin

结算功能代码

parent 7531e8ab
...@@ -395,6 +395,20 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis ...@@ -395,6 +395,20 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
return cale.getTime(); return cale.getTime();
} }
private Date getFirstDayOfMonth(Date date) {
Calendar cale = Calendar.getInstance();
cale.setTime(date);
cale = Calendar.getInstance();
cale.add(Calendar.MONTH, -1);
cale.set(Calendar.DAY_OF_MONTH, 1);
return cale.getTime();
}
//求年月日中的日 //求年月日中的日
private int getDay(Date date) { private int getDay(Date date) {
Calendar cale = Calendar.getInstance(); Calendar cale = Calendar.getInstance();
...@@ -487,7 +501,7 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis ...@@ -487,7 +501,7 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
String srvModeName = organAccountList.get(0).getSrvModeName(); String srvModeName = organAccountList.get(0).getSrvModeName();
if(!"医疗".equals(srvModeName)) { if(!"医疗".equals(srvModeName)) {
Long accountsId = saveOrganAccount(organId, organAccountList, allCost, overallCost, personalCost); Long accountsId = saveOrganAccount(organId, organAccountList, allCost, overallCost, personalCost);
saveorganAccountDetail(organAccountList, limit, overallCost, personalCost,accountsId); saveorganAccountDetail(organAccountList, limit, overallCostPercent, personalCostPercent,accountsId);
} }
return organAccountsVO; return organAccountsVO;
...@@ -496,13 +510,13 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis ...@@ -496,13 +510,13 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
/** /**
* @param limit 限额 * @param limit 限额
* @param overallCost 统筹支付 * @param overallPercent 统筹支付百分比
* @param personalCost 个人支付 * @param personalPercent 个人支付百分比
* @param accountsId 机构结算id * @param accountsId 机构结算id
* @return void * @return void
* @desc 保存机构结算明细 * @desc 保存机构结算明细
**/ **/
public void saveorganAccountDetail(List<OrganAccountsVO> organAccountList ,BigDecimal limit, BigDecimal overallCost,BigDecimal personalCost,Long accountsId){ public void saveorganAccountDetail(List<OrganAccountsVO> organAccountList ,BigDecimal limit, BigDecimal overallPercent,BigDecimal personalPercent,Long accountsId){
if(CollectionUtil.isEmpty(organAccountList)){ if(CollectionUtil.isEmpty(organAccountList)){
return; return;
} }
...@@ -510,13 +524,15 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis ...@@ -510,13 +524,15 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
ChDisabDetailAccounts chDisabDetailAccounts = new ChDisabDetailAccounts(); ChDisabDetailAccounts chDisabDetailAccounts = new ChDisabDetailAccounts();
chDisabDetailAccounts.setSrvOrganId(accountsVO.getSrvOrganId()); chDisabDetailAccounts.setSrvOrganId(accountsVO.getSrvOrganId());
chDisabDetailAccounts.setAccountsAllCost(limit); chDisabDetailAccounts.setAccountsAllCost(limit);
chDisabDetailAccounts.setAccountsOverallCost(limit.multiply(overallCost)); chDisabDetailAccounts.setAccountsOverallCost(limit.multiply(overallPercent));
chDisabDetailAccounts.setAccountsPersonalCost(limit.multiply(personalCost)); chDisabDetailAccounts.setAccountsPersonalCost(limit.multiply(personalPercent));
chDisabDetailAccounts.setModeName(accountsVO.getSrvModeName()); chDisabDetailAccounts.setModeName(accountsVO.getSrvModeName());
chDisabDetailAccounts.setCreationTime(new Date()); chDisabDetailAccounts.setCreationTime(new Date());
chDisabDetailAccounts.setAccountsTime(DateUtils.getlastMonth(lastMonth)); chDisabDetailAccounts.setAccountsTime(DateUtils.getlastMonth(lastMonth));
chDisabDetailAccounts.setAccountsEndTime(DateUtils.strToTime(accountsVO.getSrvDate())); chDisabDetailAccounts.setAccountsStartTime(DateUtils.strToTime(accountsVO.getSrvStartTime()));
chDisabDetailAccounts.setAccountsEndTime(DateUtils.strToTime(accountsVO.getSrvEndTime()));
chDisabDetailAccounts.setAccountsId(accountsId); chDisabDetailAccounts.setAccountsId(accountsId);
chDisabDetailAccounts.setMedicalArea(accountsVO.getMedicalArea());
chDisabDetailAccounts.setDisabInfoId(accountsVO.getDisabInfoId()); chDisabDetailAccounts.setDisabInfoId(accountsVO.getDisabInfoId());
chDisabAccountsDetailMapper.insert(chDisabDetailAccounts); chDisabAccountsDetailMapper.insert(chDisabDetailAccounts);
} }
...@@ -540,12 +556,12 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis ...@@ -540,12 +556,12 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
chDisabAccounts.setOverallCost(overallCost.setScale(2, BigDecimal.ROUND_HALF_UP).toString()); chDisabAccounts.setOverallCost(overallCost.setScale(2, BigDecimal.ROUND_HALF_UP).toString());
chDisabAccounts.setPersonalCost(personalCost.setScale(2, BigDecimal.ROUND_HALF_UP).toString()); chDisabAccounts.setPersonalCost(personalCost.setScale(2, BigDecimal.ROUND_HALF_UP).toString());
Date date = DateUtils.getlastMonth(lastMonth); Date date = DateUtils.getlastMonth(lastMonth);
chDisabAccounts.setAccountsTime(DateUtils.getlastMonth(lastMonth)); chDisabAccounts.setAccountsTime(date);
chDisabAccounts.setAccountsStatus((short) 1); chDisabAccounts.setAccountsStatus((short) 1);
chDisabAccounts.setCreationTime(new Date()); chDisabAccounts.setCreationTime(new Date());
chDisabAccounts.setSrvOrganId(Long.valueOf(organId)); chDisabAccounts.setSrvOrganId(Long.valueOf(organId));
chDisabAccounts.setModeName(organAccountList.get(0).getSrvModeName()); chDisabAccounts.setModeName(organAccountList.get(0).getSrvModeName());
// chDisabAccounts.setSvrStartTime(); chDisabAccounts.setSvrStartTime(getFirstDayOfMonth(date));
chDisabAccounts.setSvrEndTime(getLastDayOfMonth(date)); chDisabAccounts.setSvrEndTime(getLastDayOfMonth(date));
disabAccountsMapper.insert(chDisabAccounts); disabAccountsMapper.insert(chDisabAccounts);
Long accountsId = chDisabAccounts.getAccountsId(); Long accountsId = chDisabAccounts.getAccountsId();
...@@ -590,11 +606,10 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis ...@@ -590,11 +606,10 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
Date date = DateUtils.getlastMonth(lastMonth); Date date = DateUtils.getlastMonth(lastMonth);
chAssessAccounts.setAccountsTime(DateUtils.getlastMonth(lastMonth)); chAssessAccounts.setAccountsTime(DateUtils.getlastMonth(lastMonth));
chAssessAccounts.setAprOrganId(Long.valueOf(accountList.get(0).getAprOrganId())); chAssessAccounts.setAprOrganId(Long.valueOf(accountList.get(0).getAprOrganId()));
chAssessAccounts.setAssessStartTime(getFirstDayOfMonth(date));
chAssessAccounts.setAssessEndTime(getLastDayOfMonth(date)); chAssessAccounts.setAssessEndTime(getLastDayOfMonth(date));
chAssessAccounts.setChooseSettle((short) 1); chAssessAccounts.setChooseSettle((short) 1);
chAssessAccounts.setDistrictProvincial(accountList.get(0).getDistrictProvincial()); chAssessAccounts.setCreationTime(new Date());
chAssessAccounts.setDistrictCity(accountList.get(0).getDistrictCity());
chAssessAccounts.setDistrictArea(accountList.get(0).getDistrictArea());
chAssessAccountsMapper.insert(chAssessAccounts); chAssessAccountsMapper.insert(chAssessAccounts);
Long assessAccountsId = chAssessAccounts.getAssessAccountsId(); Long assessAccountsId = chAssessAccounts.getAssessAccountsId();
for (AssessAccountsVO assessAccountsVO : accountList) { for (AssessAccountsVO assessAccountsVO : accountList) {
...@@ -604,6 +619,8 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis ...@@ -604,6 +619,8 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
chAssessDetailAccounts.setCreationTime(new Date()); chAssessDetailAccounts.setCreationTime(new Date());
chAssessDetailAccounts.setDisabInfoId(assessAccountsVO.getDisabInfoId()); chAssessDetailAccounts.setDisabInfoId(assessAccountsVO.getDisabInfoId());
chAssessDetailAccounts.setAssessAllCost(allCost); chAssessDetailAccounts.setAssessAllCost(allCost);
chAssessDetailAccounts.setAccountsStartTime(assessAccountsVO.getAcceptTime());
chAssessDetailAccounts.setAccountsEndTime(assessAccountsVO.getFinishTime());
chAssessDetailAccounts.setAccountsTime(DateUtils.getlastMonth(lastMonth)); chAssessDetailAccounts.setAccountsTime(DateUtils.getlastMonth(lastMonth));
chAssessAccountsDetailMapper.insert(chAssessDetailAccounts); chAssessAccountsDetailMapper.insert(chAssessDetailAccounts);
} }
......
...@@ -10,19 +10,8 @@ ...@@ -10,19 +10,8 @@
DISTINCT task.task_id taskId, DISTINCT task.task_id taskId,
fndOrgan.ORGAN_NAME organName, fndOrgan.ORGAN_NAME organName,
task.ORGAN_ID aprOrganId, task.ORGAN_ID aprOrganId,
(select DISTRICT_NAME from CH_FND_DISTRICT dis where task.DISTRICT_PROVINCIAL = dis.DISTRICT_CODE) districtProvincial,
(select DISTRICT_NAME from CH_FND_DISTRICT dis where task.DISTRICT_CITY = dis.DISTRICT_CODE) districtCity,
(select DISTRICT_NAME from CH_FND_DISTRICT dis where task.DISTRICT_AREA = dis.DISTRICT_CODE) districtArea,
disable.DISAB_INFO_ID disabInfoId, disable.DISAB_INFO_ID disabInfoId,
disable.real_name realName, task.ACCEPT_TIME acceptTime,
disable.certi_code certiCode,
disable.BIRTHDAY birthday,
disable.tel tel,
disable.gender gender,
(SELECT dis.DISTRICT_NAME FROM CH_FND_DISTRICT dis WHERE disable.DISTRICT_PROVINCIAL = dis.DISTRICT_CODE) disDistrictProvincial,
(SELECT dis.DISTRICT_NAME FROM CH_FND_DISTRICT dis WHERE disable.district_city = dis.DISTRICT_CODE) disDistrictCity,
(SELECT dis.DISTRICT_NAME FROM CH_FND_DISTRICT dis WHERE disable.district_area = dis.DISTRICT_CODE) disDistrictArea,
disable.end_time endTime,
task.finish_time finishTime, task.finish_time finishTime,
emp.APREMP_TYPE_NAME_F aprempTypeName emp.APREMP_TYPE_NAME_F aprempTypeName
from CH_APR_TASK task from CH_APR_TASK task
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<mapper namespace="com.hungraim.ltc.account.dao.ChOrganAccountsMapper"> <mapper namespace="com.hungraim.ltc.account.dao.ChOrganAccountsMapper">
<!--查询机构失能人员信息--> <!--查询机构失能人员信息 -->
<select id="getOrganAccountsList" resultType="com.hungraim.ltc.pojo.vo.account.OrganAccountsVO"> <select id="getOrganAccountsList" resultType="com.hungraim.ltc.pojo.vo.account.OrganAccountsVO">
select select
--失能人员姓名 --失能人员姓名
...@@ -12,9 +12,7 @@ ...@@ -12,9 +12,7 @@
--身份证号 --身份证号
disable.CERTI_CODE certiCode, disable.CERTI_CODE certiCode,
--所在省市 --所在省市
disable.district_provincial districtProvincial, apply.MEDICAL_AREA medicalArea,
disable.district_city districtCity,
disable.DISTRICT_AREA districtArea,
mode1.MODE_ID modeId, mode1.MODE_ID modeId,
--服务方式 --服务方式
mode1.mode_name srvModeName, mode1.mode_name srvModeName,
...@@ -26,6 +24,8 @@ ...@@ -26,6 +24,8 @@
emp.emp_name empName, emp.emp_name empName,
--任务时间 --任务时间
detail.SRV_DATE srvDate, detail.SRV_DATE srvDate,
detail.SRV_START_TIME srvStartTime,
detail.SRV_END_TIME srvEndTime,
--机构等级 --机构等级
organ.LEVEL_CODE levelCode, organ.LEVEL_CODE levelCode,
--失能等级 --失能等级
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
from ch_srv_task_detail detail--服务计划 from ch_srv_task_detail detail--服务计划
left join ch_srv_task task on task.srv_task_id = detail.srv_task_id--服务计划详情 left join ch_srv_task task on task.srv_task_id = detail.srv_task_id--服务计划详情
left join ch_disable_info disable on task.disab_info_id = disable.disab_info_id--失能人员 left join ch_disable_info disable on task.disab_info_id = disable.disab_info_id--失能人员
left join CH_DEV.CH_DISABLE_APPLY apply on apply.apply_id = disable.apply_id
left join ch_apr_task aprtask on disable.last_task_id = aprtask.task_id--评定任务 left join ch_apr_task aprtask on disable.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--评定报告
left join ch_srv_program program on task.program_id = program.program_id--服务方案 left join ch_srv_program program on task.program_id = program.program_id--服务方案
......
...@@ -119,7 +119,8 @@ ...@@ -119,7 +119,8 @@
a.APPLY_STATUS applyStatus, a.APPLY_STATUS applyStatus,
a.CHECK_REMARK checkRemark, a.CHECK_REMARK checkRemark,
a.REASONS_REVIEW reasonsReview, a.REASONS_REVIEW reasonsReview,
a.REASONS_REMARK reasonsRemark a.REASONS_REMARK reasonsRemark,
a.MEDICAL_AREA medicalArea
from CH_DISABLE_APPLY a from CH_DISABLE_APPLY a
LEFT JOIN CH_SRV_ORGAN o ON a.SRV_ORGAN_ID = o.SRV_ORGAN_ID LEFT JOIN CH_SRV_ORGAN o ON a.SRV_ORGAN_ID = o.SRV_ORGAN_ID
where a.APPLY_ID = #{applyId} where a.APPLY_ID = #{applyId}
......
...@@ -66,18 +66,7 @@ public class ChAssessAccounts implements Serializable { ...@@ -66,18 +66,7 @@ public class ChAssessAccounts implements Serializable {
*/ */
private String checkRemark; private String checkRemark;
/**
* 省
*/
private String districtProvincial;
/**
* 市
*/
private String districtCity;
/**
* 区
*/
private String districtArea;
/** /**
......
...@@ -61,11 +61,11 @@ public class ChAssessDetailAccounts implements Serializable { ...@@ -61,11 +61,11 @@ public class ChAssessDetailAccounts implements Serializable {
/** /**
* 费用开始日期 * 费用开始日期
*/ */
private Date accountsStartTime; private String accountsStartTime;
/** /**
* 费用结束日期 * 费用结束日期
*/ */
private Date accountsEndTime; private String accountsEndTime;
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
......
...@@ -75,6 +75,8 @@ public class ChDisabDetailAccounts implements Serializable { ...@@ -75,6 +75,8 @@ public class ChDisabDetailAccounts implements Serializable {
*/ */
private Date accountsEndTime; private Date accountsEndTime;
private String medicalArea;
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
} }
\ No newline at end of file
...@@ -9,9 +9,8 @@ import lombok.Data; ...@@ -9,9 +9,8 @@ import lombok.Data;
public class AssessAccountsVO { public class AssessAccountsVO {
private String organName; private String organName;
private String aprOrganId; private String aprOrganId;
private String districtProvincial;
private String districtCity;
private String districtArea;
private String aprempTypeName; private String aprempTypeName;
private String disabInfoId; private String disabInfoId;
private String acceptTime;
private String finishTime;
} }
...@@ -39,12 +39,11 @@ public class OrganAccountsVO { ...@@ -39,12 +39,11 @@ public class OrganAccountsVO {
* 护理机构名称 * 护理机构名称
*/ */
private String srvOrganName; private String srvOrganName;
/** /**
* 所在省市 * 医保统筹区
*/ */
private String districtProvincial; private String medicalArea;
private String districtCity;
private String districtArea;
/** /**
* 护理服务人员 * 护理服务人员
*/ */
...@@ -53,6 +52,16 @@ public class OrganAccountsVO { ...@@ -53,6 +52,16 @@ public class OrganAccountsVO {
* 任务时间 * 任务时间
*/ */
private String srvDate; private String srvDate;
/**
* 任务开始时间
*/
private String srvStartTime;
/**
* 任务结束时间
*/
private String srvEndTime;
/** /**
* 机构等级 * 机构等级
*/ */
......
...@@ -110,6 +110,8 @@ public class DisableExamineInfoVO { ...@@ -110,6 +110,8 @@ public class DisableExamineInfoVO {
private String reasonsReview; private String reasonsReview;
// 复评备注 // 复评备注
private String reasonsRemark; private String reasonsRemark;
// 医保统筹区
private String medicalArea;
private List<ChFndAttach> fileDataList; private List<ChFndAttach> fileDataList;
} }
...@@ -33,7 +33,7 @@ public class DateUtils { ...@@ -33,7 +33,7 @@ public class DateUtils {
*/ */
public static final String DATE_PATTERN_yyyy_MM_dd = "yyyy-MM-dd"; public static final String DATE_PATTERN_yyyy_MM_dd = "yyyy-MM-dd";
public static final String DATE_PATTERN_yyyy_MM = "yyyy-MM"; public static final String DATE_PATTERN_yyyy_MM = "yyyy-MM-dd";
/** /**
* MM-dd 12月25日 * MM-dd 12月25日
...@@ -864,7 +864,7 @@ public class DateUtils { ...@@ -864,7 +864,7 @@ public class DateUtils {
* @return * @return
*/ */
public static String getlastMonth(){ public static String getlastMonth(){
SimpleDateFormat ym=new SimpleDateFormat(DATE_PATTERN_yyyy_MM); SimpleDateFormat ym=new SimpleDateFormat(DATE_PATTERN_yyyy_MM_dd);
Calendar calendar = Calendar.getInstance(); Calendar calendar = Calendar.getInstance();
calendar.add(Calendar.MONTH,-1); calendar.add(Calendar.MONTH,-1);
String lastMonth =ym.format(calendar.getTime()); String lastMonth =ym.format(calendar.getTime());
...@@ -876,7 +876,7 @@ public class DateUtils { ...@@ -876,7 +876,7 @@ public class DateUtils {
* @return * @return
*/ */
public static Date getlastMonth(String str){ public static Date getlastMonth(String str){
DateFormat fmt =new SimpleDateFormat(DATE_PATTERN_yyyy_MM); DateFormat fmt =new SimpleDateFormat(DATE_PATTERN_yyyy_MM_dd);
Date date = null; Date date = null;
try { try {
date = fmt.parse(str); date = fmt.parse(str);
......
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