Commit af19ea1a authored by zhangwanglin's avatar zhangwanglin

Merge branch 'dev_nursing_records_20230214' into dev_ch_master

parents 1cb178e0 e389e4f8
......@@ -165,8 +165,8 @@ public class AccountController {
*
*/
@GetMapping("/srvOrganAccountExport")
public void srvOrganAccountExport(String accountsId,HttpServletResponse response){
Workbook workbook = accountService.srvOrganAccountExport(accountsId);
public void srvOrganAccountExport(SrvOrganListReq req,HttpServletResponse response){
Workbook workbook = accountService.srvOrganAccountExport(req);
// 命名表格
String fileName = "srvOrganAccount.xlsx";
FileUtils.exportResponse(workbook,fileName,response);
......
......@@ -6,6 +6,7 @@ import com.hungraim.ltc.pojo.entity.account.*;
import com.hungraim.ltc.pojo.vo.account.AccountExportDetailListResp;
import com.hungraim.ltc.pojo.vo.account.OrganAccountsVO;
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.Param;
import org.springframework.stereotype.Repository;
......@@ -19,7 +20,7 @@ public interface ChDisabAccountsDetailMapper extends BaseMapper<ChDisabDetailAcc
List<OrganAccountsVO> getOrganAccountsList(String taskDetailId);
List<AccountExportDetailListResp> searchSrvOrganAccountDetailExport(String accountsId);
List<AccountExportDetailListResp> searchSrvOrganAccountDetailExport(SrvOrganListReq req);
List<ChDisabDetailAccounts> queryAccountByCondition(@Param("taskDetailIds") List<String> taskDetailIds);
......@@ -35,6 +36,8 @@ public interface ChDisabAccountsDetailMapper extends BaseMapper<ChDisabDetailAcc
int updateByAccountsId(String accountsId,Integer accountsStatus);
ChDisabDetailAccounts queryDisabDetailAccounts(String srvOrganId, String accountsTime,String disabInfoId,String srvModeName);
......
......@@ -29,7 +29,7 @@ public interface AccountService extends IService<ChDisabAccounts> {
ExpenseVo expenseSettlement(ExpenseSettlementReq req) throws ParseException;
Workbook srvOrganAccountExport(String accountsId);
Workbook srvOrganAccountExport(SrvOrganListReq req);
......
......@@ -456,8 +456,8 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
@Override
public Workbook srvOrganAccountExport(String accountsId) {
List<AccountExportDetailListResp> srvOrganAccountExportList = chDisabAccountsDetailMapper.searchSrvOrganAccountDetailExport(accountsId);
public Workbook srvOrganAccountExport(SrvOrganListReq req) {
List<AccountExportDetailListResp> srvOrganAccountExportList = chDisabAccountsDetailMapper.searchSrvOrganAccountDetailExport(req);
ExportParams exportParams = new ExportParams();
exportParams.setType(ExcelType.XSSF); //对应xlsx
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, AccountExportDetailListResp.class, srvOrganAccountExportList);
......@@ -610,39 +610,45 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
List<OrganAccountsVO> accountsList = chDisabAccountsDetailMapper.getOrganAccountsList(taskDetailId);
for (OrganAccountsVO accountsVO : accountsList) {
ChDisabDetailAccounts chDisabDetailAccounts = new ChDisabDetailAccounts();
chDisabDetailAccounts.setSrvOrganId(accountsVO.getSrvOrganId());
String srvOrganId = accountsVO.getSrvOrganId();
// 结算时间为任务时间
Date accountsTime = DateUtils.strToDate(accountsVO.getSrvDate());
String disabInfoId = accountsVO.getDisabInfoId();
//要判断是养老还是医疗,因为费用不一样
BigDecimal limit = BigDecimal.valueOf(0);
BigDecimal overallPercent = BigDecimal.valueOf(0.7);
BigDecimal personalPercent = BigDecimal.valueOf(0.3);
String srvModeName = accountsVO.getSrvModeName();
// 养老机构护理,其限额为 50 元/人/天 由长期护理保险基金支付 70% 个人支付 30%
if ("养老".equals(accountsVO.getSrvModeName())) {
if ("养老".equals(srvModeName)) {
limit = BigDecimal.valueOf(50);
// 医疗机构护理,原则上收治医疗护理需求为主的重度失能人员一级及以下医疗机构其限额为 80 元/人/天,由长期护理保险基金支付 70%,个人支付 30%;
// && accountsVO.getDisableLevelName().contains("重度")
} else if ("医疗".equals(accountsVO.getSrvModeName()) && "1".equals(accountsVO.getLevelCode())) {
} else if ("医疗".equals(srvModeName) && "1".equals(accountsVO.getLevelCode())) {
limit = BigDecimal.valueOf(80);
// 二级及以上医疗机构其限额为 100 元/人/天,由长期护理保险基金支付 70%,个人支付 30%;
} else if ("医疗".equals(accountsVO.getSrvModeName()) && (!"1".equals(accountsVO.getLevelCode()))) {
} else if ("医疗".equals(srvModeName) && (!"1".equals(accountsVO.getLevelCode()))) {
limit = BigDecimal.valueOf(100);
} else {
return;
break;
}
// 根据护理机构、结算月份、失能人员id和服务方式查询表里是否有值
// ChDisabDetailAccounts chDisabDetailAccountsDTO = chDisabAccountsDetailMapper.queryDisabDetailAccounts(srvOrganId, DateUtils.dateToStrYm(accountsTime), disabInfoId, srvModeName);
chDisabDetailAccounts.setAccountsAllCost(limit);
BigDecimal overallCost = limit.multiply(overallPercent);
chDisabDetailAccounts.setAccountsOverallCost(overallCost);
BigDecimal personalCost = limit.multiply(personalPercent);
chDisabDetailAccounts.setAccountsPersonalCost(personalCost);
chDisabDetailAccounts.setModeName(accountsVO.getSrvModeName());
chDisabDetailAccounts.setSrvOrganId(srvOrganId);
chDisabDetailAccounts.setEmpId(accountsVO.getEmpId());
chDisabDetailAccounts.setCreationTime(new Date());
// 结算时间为任务时间
chDisabDetailAccounts.setAccountsTime(DateUtils.strToDate(accountsVO.getSrvDate()));
chDisabDetailAccounts.setAccountsTime(accountsTime);
chDisabDetailAccounts.setAccountsStartTime(DateUtils.getFirstDayOfMonth(DateUtils.strToDate(accountsVO.getSrvDate())));
chDisabDetailAccounts.setAccountsEndTime(DateUtils.getlastDayOfMonth(DateUtils.strToDate(accountsVO.getSrvDate())));
chDisabDetailAccounts.setTaskDetailId(accountsVO.getTaskDetailId());
// chDisabDetailAccounts.setTaskDetailId(accountsVO.getTaskDetailId());
chDisabDetailAccounts.setMedicalArea(accountsVO.getMedicalArea());
chDisabDetailAccounts.setDisabInfoId(accountsVO.getDisabInfoId());
chDisabDetailAccounts.setDisabInfoId(disabInfoId);
chDisabDetailAccounts.setStatus((short)0);
chDisabDetailAccounts.setReissueAmount(BigDecimal.valueOf(0));
chDisabDetailAccounts.setDeductionAmount(BigDecimal.valueOf(0));
......@@ -783,7 +789,8 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
BigDecimal overallCost = chDisabAccountDTO.getOverallCost();
BigDecimal personalCost = chDisabAccountDTO.getPersonalCost();
Short accountsStatus = chDisabAccountDTO.getAccountsStatus();
if (accountsStatus > 2) {
if (accountsStatus > 1) {
log.info("{},已完成审核",accountsDetailId);
return -1;
}
// 暂缓
......
......@@ -184,19 +184,43 @@
<select id="searchSrvOrganAccountDetailExport" resultType="com.hungraim.ltc.pojo.vo.account.AccountExportDetailListResp">
select
t3.SRV_ORGAN_NAME srvOrganName,
to_char(t1.ACCOUNTS_TIME,'yyyy-MM') accountsTime,
t1.ACCOUNTS_ALL_COST accountsAllCost,
t1.ACCOUNTS_OVERALL_COST accountsOverallCost,
t1.ACCOUNTS_PERSONAL_COST accountsPersonalCost,
to_char(t1.ACCOUNTS_START_TIME,'yyyy-MM-dd') accountsStartTime,
to_char(t1.ACCOUNTS_END_TIME,'yyyy-MM-dd') accountsEndTime
from CH_DISAB_ACCOUNTS_DETAIL t1
left join ch_disable_info t2 on t1.disab_info_id = t2.disab_info_id
LEFT JOIN CH_SRV_ORGAN t3 ON t1.SRV_ORGAN_ID = t3.SRV_ORGAN_ID
where t1.ACCOUNTS_ID = #{accountsId}
t3.ORGAN_NAME organName,
d.MODE_NAME modeName,
to_char(d.ACCOUNTS_START_TIME,'yyyy-MM-dd') accountsStartTime,
to_char(d.ACCOUNTS_END_TIME,'yyyy-MM-dd') accountsEndTime,
to_char(d.ACCOUNTS_TIME,'yyyy-MM') accountsTime,
emp.EMP_NAME empName,
d.ACCOUNTS_ALL_COST accountsAllCost,
d.ACCOUNTS_OVERALL_COST accountsOverallCost,
d.ACCOUNTS_PERSONAL_COST accountsPersonalCost,
(select district_name from ch_fnd_district dis where apply.MEDICAL_AREA = dis.district_code) medicalArea,
o.SRV_ORGAN_NAME srvOrganName,
info.REAL_NAME realName,
d.DEDUCTION_AMOUNT deductionAmount,
d.REISSUE_AMOUNT reissueAmount,
d.ACCOUNTS_DETAIL_ID accountsDetailId,
d.STATUS
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
left join CH_SRV_ORGAN o on d.SRV_ORGAN_ID = o.SRV_ORGAN_ID
LEFT JOIN CH_FND_ORGAN t3 ON o.ORGAN_ID = t3.ORGAN_ID
left join ch_srv_organ_emp emp on d.emp_id = emp.emp_id
<where>
1=1
<if test="accountsId != null and accountsId != ''">
and d.ACCOUNTS_ID = #{accountsId}
</if>
<if test="accountsStatus != null and accountsStatus != ''">
and d.status = #{accountsStatus}
</if>
<if test="srvOrganId != null and srvOrganId != ''">
and d.SRV_ORGAN_ID = #{srvOrganId}
</if>
<if test="accountsTime != null and accountsTime != ''">
AND to_char(d.ACCOUNTS_TIME,'yyyy-MM') = #{accountsTime}
</if>
</where>
</select>
<select id="getOtherPlaceList" resultType="com.hungraim.ltc.pojo.vo.account.OrganAccountsVO">
......@@ -250,6 +274,13 @@
where d.ACCOUNTS_ID = #{accountsId}
</update>
<select id="queryDisabDetailAccounts" resultType="com.hungraim.ltc.pojo.entity.account.ChDisabDetailAccounts">
select * from CH_DISAB_ACCOUNTS_DETAIL d where d.SRV_ORGAN_ID =#{srvOrganId}
and to_char(d.ACCOUNTS_TIME,'yyyy-MM') = #{accountsTime}
and d.DISAB_INFO_ID =#{disabInfoId}
and d.MODE_NAME = #{srvModeName}
</select>
</mapper>
......@@ -148,6 +148,9 @@ public class SrvOrganEmpServiceImpl implements SrvOrganEmpService {
for (SrvOrganEmpExportVo record : srvOrganEmpExportList) {
StringBuilder stringBuilder = new StringBuilder();
if(record == null){
break;
}
if(StringUtils.isEmpty(record.getProvincial())){
stringBuilder.append("--");
}else if( record.getProvincial().equals(record.getCity())){
......
......@@ -168,6 +168,7 @@
info.CERTI_CODE certiCode,
report.pol_no polNo,
report.remark remark,
report.EVALUATE_TYPE evaluateType,
info.birthday birthday,
(SELECT DISE_TYPE_CODE FROM CH_FND_DISEASE_TYPE WHERE info.DISE_TYPE_F = DISE_TYPE_ID) diseTypeF,
(SELECT DISE_TYPE_CODE FROM CH_FND_DISEASE_TYPE WHERE info.DISE_TYPE_S = DISE_TYPE_ID) diseTypeS,
......@@ -238,6 +239,8 @@
emp.AGE age,
emp.certi_code certiCode,
emp.tel tel,
(select type.APREMP_NAME from CH_CFG_APREMP_TYPE type where type.APREMP_TYPE_ID = emp.APREMP_TYPE_ID_F) aprempTypeF,
(select type.APREMP_NAME from CH_CFG_APREMP_TYPE type where type.APREMP_TYPE_ID = emp.APREMP_TYPE_ID_S) aprempTypeS,
emp.Group_leader groupLeader
FROM ch_apr_emp emp
LEFT JOIN ch_apr_organ organ ON emp.apr_organ_id = organ.apr_organ_id
......@@ -470,6 +473,7 @@
(SELECT dis.DISTRICT_NAME FROM CH_FND_DISTRICT dis WHERE organ.DISTRICT_CITY = dis.DISTRICT_CODE) districtCity,
(SELECT dis.DISTRICT_NAME FROM CH_FND_DISTRICT dis WHERE organ.DISTRICT_AREA = dis.DISTRICT_CODE) districtArea,
organ.organ_name organName,
o.organ_name fndOrganName,
organ.UNIFIED_SOCIAL_CREDIT_CODE unifiedSocialCreditCode,
emp.real_name realName,
DECODE(emp.gender, 'M','男','F', '女','N', '不确定') gender,
......@@ -480,6 +484,7 @@
FROM ch_apr_emp emp
LEFT JOIN ch_apr_organ organ ON emp.apr_organ_id = organ.apr_organ_id
LEFT JOIN ch_srv_organ srvOrgan ON organ.organ_id = srvOrgan.srv_organ_id
LEFT JOIN ch_fnd_organ o ON o.organ_id = srvOrgan.organ_id
<where>
<if test="provincial != null and provincial != ''">
and (SELECT dis.DISTRICT_NAME FROM CH_FND_DISTRICT dis WHERE organ.DISTRICT_PROVINCIAL = dis.DISTRICT_CODE) = #{provincial}
......
......@@ -52,5 +52,14 @@ public class ChAprEmp {
private java.util.Date effTime;
private Integer aprOrganId;
private Integer lcu;
private String accName;
private String bankAccName;
private String bankNo;
private String bankAccCode;
private String bankDistrictProvincial;
private String bankDistrictCity;
private String bankDistrictWebsite;
private String remark;
}
......@@ -16,14 +16,17 @@ public class AccountExportDetailListResp {
@Excel(name = "适用机构名称",width = 20)
private String organName;
/**
* 护理机构名称
*/
@Excel(name = "护理机构名称",width = 20)
private String srvOrganName;
@Excel(name = "失能人员",width = 20)
private String realName;
@Excel(name = "护理人员",width = 20)
private String empName;
/**
* 结算月份
*/
......@@ -42,8 +45,6 @@ public class AccountExportDetailListResp {
@Excel(name = "费用结束时间",width = 20)
private String accountsEndTime;
/**
* 总费用
*/
......@@ -62,6 +63,14 @@ public class AccountExportDetailListResp {
@Excel(name = "个人支付")
private String accountsPersonalCost;
@Excel(name = "已补费用")
private String reissueAmount;
@Excel(name = "已扣费用")
private String deductionAmount;
......
......@@ -15,7 +15,7 @@ import lombok.Data;
@Data
public class AprEmpExportVO {
@Excel(name = "适用机构",width = 20)
private String srvOrganName;
private String fndOrganName;
@Excel(name = "所在省市",width = 20)
private String districtProvincial;
......
......@@ -33,4 +33,10 @@ public class AprEmpVO {
private String tel;
//是否组长0组长,1非组长
private String groupLeader;
private String aprempTypeF;
private String aprempTypeS;
}
......@@ -42,8 +42,8 @@ public class DisableExportVO implements Serializable {
@Excel(name = "申请时间" ,width = 20)
private String effTime;
@Excel(name = "申请来源")
private String dataFrom;
/* @Excel(name = "申请来源")
private String dataFrom;*/
private String provincial;
......
......@@ -91,4 +91,7 @@ public class SrvTaskDetailVO {
* 任务状态
*/
private String status;
private String disableLevelName;
}
......@@ -4,6 +4,7 @@ import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.transaction.annotation.EnableTransactionManagement;
/**
......@@ -13,6 +14,7 @@ import org.springframework.transaction.annotation.EnableTransactionManagement;
@EnableDiscoveryClient
@EnableFeignClients
@EnableTransactionManagement
@EnableScheduling
public class GovernanceApplication {
public static void main(String[] args) {
SpringApplication.run(GovernanceApplication.class, args);
......
......@@ -104,6 +104,7 @@
emp.emp_name empName,
--任务时间
detail.SRV_DATE srvDate,
level1.DISABLE_LEVEL_NAME disableLevelName,
--任务状态
detail.status status
from ch_srv_task_detail detail--服务计划
......@@ -146,6 +147,7 @@
and mode1.mode_id = #{modeId}
</if>
</where>
order by detail.SRV_DATE desc
</select>
<!--查询服务计划信息-->
......
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