Commit 5e6b7aad authored by zhangwanglin's avatar zhangwanglin

Merge branch 'dev-20230612-print' into uat_ch_master

# Conflicts: # governance/src/main/java/com/hungraim/ltc/governance/controller/BuildBedController.java # governance/src/main/java/com/hungraim/ltc/governance/service/impl/BuildBedServiceImpl.java
parents 8eae9dec 5f93835f
......@@ -249,6 +249,11 @@ public class AccountController {
return Result.success(chAssessDetailAccounts);
}
/**
* 基金申报导出
* @param
......
......@@ -6,8 +6,11 @@ import com.hungraim.ltc.pojo.entity.account.ChDisabFreeRdInfo;
import com.hungraim.ltc.pojo.entity.account.OverallCostListRespVO;
import com.hungraim.ltc.pojo.entity.account.OverallCostReqVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* @author zwl
* @ClassName ChDisabFreeRdInfoMapper
......@@ -19,5 +22,7 @@ import org.springframework.stereotype.Repository;
public interface ChDisabFreeRdInfoMapper extends BaseMapper<ChDisabFreeRdInfo> {
Page<OverallCostListRespVO> queryFreeRdInfo(Page page, OverallCostReqVO req);
List<String> selectByAccountsId(@Param("accountsId")Long accountsId,@Param("dealType") int dealType);
}
......@@ -136,7 +136,30 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
@Override
public Page<SrvOrganAccountListResp> searchSrvOrganAccountList(SrvOrganListReq srvOrganListReq) {
List<Long> organIds = baseAccountService.getOrganIds(srvOrganListReq.getOrganId(), srvOrganListReq.getIsInvolveChild());
return disabAccountsMapper.searchSrvOrganAccountList(new Page<>(srvOrganListReq.getPageNum(), srvOrganListReq.getPageSize()), organIds, srvOrganListReq);
Page<SrvOrganAccountListResp> srvOrganAccountListRespPage = disabAccountsMapper.searchSrvOrganAccountList(new Page<>(srvOrganListReq.getPageNum(), srvOrganListReq.getPageSize()), organIds, srvOrganListReq);
List<SrvOrganAccountListResp> records = srvOrganAccountListRespPage.getRecords();
for (SrvOrganAccountListResp record : records) {
Short accountsStatus = record.getAccountsStatus();
if(accountsStatus == 4){
Long accountsId = record.getAccountsId();
// 1 补发 2 扣减
List<String> list = chDisabFreeRdInfoMapper.selectByAccountsId(accountsId, 1);
// 补发
record.setReissueReason(list);
List<String> list1 = chDisabFreeRdInfoMapper.selectByAccountsId(accountsId, 2);
// 扣减
record.setDeductionReason(list1);
Date accountsTime = record.getAccountsTime();
String accountsTimeStr = DateUtils.dateToStr(accountsTime);
Date firstDayOfMonth = DateUtils.getFirstDayOfMonth(DateUtils.strToDate(accountsTimeStr));
record.setSvrStartTime(DateUtils.dateToStr(firstDayOfMonth));
Date date = DateUtils.getlastDayOfMonth(DateUtils.strToDate(accountsTimeStr));
record.setSvrEndTime(DateUtils.dateToStr(date));
}
}
return srvOrganAccountListRespPage;
}
......@@ -501,7 +524,44 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
@Override
public Page<ChDisabDetailAccountsResp> queryOrganAccountsDetail(Integer pageNum, Integer pageSize,SrvOrganListReq srvOrganListReq) {
return chDisabAccountsDetailMapper.queryOrganAccountsDetail(new Page<>(pageNum, pageSize),srvOrganListReq);
Page<ChDisabDetailAccountsResp> chDisabDetailAccountsRespPage = chDisabAccountsDetailMapper.queryOrganAccountsDetail(new Page<>(pageNum, pageSize), srvOrganListReq);
List<ChDisabDetailAccountsResp> records = chDisabDetailAccountsRespPage.getRecords();
for (ChDisabDetailAccountsResp record : records) {
Integer status = record.getStatus();
if(status == 1){
BigDecimal reportableAmount = new BigDecimal(0);
BigDecimal institutionsDeserve = new BigDecimal(0);
BigDecimal personalDeserve = new BigDecimal(0);
String accountsStartTime = record.getAccountsStartTime();
Date date = DateUtils.strToDate(accountsStartTime);
int daysOfMonth = DateUtils.getDaysOfMonth(date);
String modeName = record.getModeName();
if ("上门".equals(modeName)) {
reportableAmount = new BigDecimal(1200);
institutionsDeserve = new BigDecimal(960);
personalDeserve = new BigDecimal(240);
} else if ("养老".equals(modeName)) {
reportableAmount = new BigDecimal(50).multiply(new BigDecimal(daysOfMonth));
institutionsDeserve = reportableAmount.multiply(new BigDecimal("0.7"));
personalDeserve = reportableAmount.multiply(new BigDecimal("0.3"));
} else if ("医疗".equals(modeName) && "1".equals(record.getLevelCode())) {
reportableAmount = new BigDecimal(80).multiply(new BigDecimal(daysOfMonth));
institutionsDeserve = reportableAmount.multiply(new BigDecimal("0.7"));
personalDeserve = reportableAmount.multiply(new BigDecimal("0.3"));
// 二级及以上医疗机构其限额为 100 元/人/天,由长期护理保险基金支付 70%,个人支付 30%;
} else if ("医疗".equals(modeName) && (!"1".equals(record.getLevelCode()))) {
reportableAmount = new BigDecimal(100).multiply(new BigDecimal(daysOfMonth));
institutionsDeserve = reportableAmount.multiply(new BigDecimal("0.7"));
personalDeserve = reportableAmount.multiply(new BigDecimal("0.3"));
}
record.setReportableAmount(reportableAmount.toString());
record.setInstitutionsDeserve(institutionsDeserve.toString());
record.setPersonalDeserve(personalDeserve.toString());
}
}
return chDisabDetailAccountsRespPage;
}
......
......@@ -15,12 +15,14 @@
o.SRV_ORGAN_NAME srvOrganName,
o.SRV_ORGAN_ID srvOrganId,
info.REAL_NAME realName,
info.CERTI_CODE certiCode,
info.DISAB_INFO_ID disabInfoId,
d.DEDUCTION_AMOUNT deductionAmount,
d.REISSUE_AMOUNT reissueAmount,
d.ACCOUNTS_DETAIL_ID accountsDetailId,
d.STATUS,
d.ACCOUNTS_ID accountsId
d.ACCOUNTS_ID accountsId,
o.LEVEL_CODE levelCode
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
......
......@@ -47,7 +47,8 @@
to_char(t1.SVR_END_TIME,'yyyy-MM-dd') svrEndTime,
t1.TOTAL_ALLOCATED_EXPENSES totalAllocatedExpenses,
t1.REISSUE_AMOUNT_TOTAL reissueAmountTotal,
t1.DEDUCTION_AMOUNT_TOTAL deductionAmountTotal
t1.DEDUCTION_AMOUNT_TOTAL deductionAmountTotal,
(select count(1) from CH_DISAB_ACCOUNTS_DETAIL d where d.ACCOUNTS_ID =t1.ACCOUNTS_ID and d.STATUS = 1) personDay
FROM
CH_DISAB_ACCOUNTS t1
LEFT JOIN CH_SRV_ORGAN t2 ON t1.SRV_ORGAN_ID = t2.SRV_ORGAN_ID
......
......@@ -48,5 +48,14 @@
<select id="selectByAccountsId" resultType="java.lang.String">
select f.real_name||':'||i.REMARKS from CH_DISAB_FREE_RD_INFO i left join CH_DISAB_ACCOUNTS_DETAIL d on
i.ACCOUNTS_DETAIL_ID = d.ACCOUNTS_DETAIL_ID left join CH_DISABLE_INFO f
on d.DISAB_INFO_ID = f.DISAB_INFO_ID
where i.ACCOUNTS_ID = #{accountsId} and
i.DEAL_TYPE = #{dealType}
</select>
</mapper>
\ No newline at end of file
......@@ -53,6 +53,8 @@ public class ChDisabDetailAccountsResp implements Serializable {
private String realName;
private String certiCode;
private String taskDetailId;
private String deductionAmount;
......@@ -67,5 +69,18 @@ public class ChDisabDetailAccountsResp implements Serializable {
private Integer status;
// 可报金额
private String reportableAmount;
// 机构应得
private String institutionsDeserve;
// 个人应得
private String personalDeserve;
private String levelCode;
private static final long serialVersionUID = 1L;
}
\ No newline at end of file
......@@ -7,6 +7,7 @@ import org.springframework.format.annotation.DateTimeFormat;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
@Data
public class SrvOrganAccountListResp {
......@@ -97,5 +98,20 @@ public class SrvOrganAccountListResp {
*/
private String reviewRemark;
/**
*人次/人天
*/
private String personDay;
/**
*扣费原因
*/
private List<String> deductionReason;
/**
*补费原因
*/
private List<String> reissueReason;
}
......@@ -964,6 +964,14 @@ public class DateUtils {
return day.equals(nowDay);
}
public static int getDaysOfMonth(Date date) {
Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
return calendar.getActualMaximum(Calendar.DAY_OF_MONTH);
}
public static void main(String[] args) {
System.out.println(getDaysOfMonth(new Date()));
}
}
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