Commit 33aab16f authored by zhangwanglin's avatar zhangwanglin

Merge branch 'dev_nursing_records_20230214' into dev_ch_master

parents 7209008c 51e4721e
......@@ -8,6 +8,7 @@ import com.hungraim.ltc.pojo.vo.account.*;
import com.hungraim.ltc.util.FileUtils;
import com.hungraim.ltc.util.Result;
import com.hungraim.ltc.util.ResultCode;
import com.hungraim.ltc.util.TokenParsingUtil;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
......@@ -129,7 +130,9 @@ public class AccountController {
* @return 返回
*/
@GetMapping("/getSrvTaskList")
public Result<Page<SrvTaskRespVO>> getSrvTaskList(SrvTaskReqVO srvTaskReqVO) {
public Result<Page<SrvTaskRespVO>> getSrvTaskList(@RequestHeader("Authorization") String token,SrvTaskReqVO srvTaskReqVO) {
long srvOrganId = TokenParsingUtil.TokenParsing(token, "srvOrganId");
srvTaskReqVO.setSrvOrganId(srvOrganId);
return Result.success(accountService.getSrvTaskList(srvTaskReqVO));
}
......@@ -141,9 +144,11 @@ public class AccountController {
* @return 返回
*/
@GetMapping("/searchSrvOrganAccountList")
public Result<Page<SrvOrganAccountListResp>> searchSrvOrganAccountList(SrvOrganListReq srvOrganListReq) {
public Result<Page<SrvOrganAccountListResp>> searchSrvOrganAccountList(@RequestHeader("Authorization") String token, SrvOrganListReq srvOrganListReq) {
List<String> list = Arrays.asList("1");
srvOrganListReq.setAccountsStatusList(list);
long srvOrganId = TokenParsingUtil.TokenParsing(token, "srvOrganId");
srvOrganListReq.setSrvOrganId(srvOrganId);
return Result.success(accountService.searchSrvOrganAccountList(srvOrganListReq));
}
......@@ -154,9 +159,11 @@ public class AccountController {
* @return 返回
*/
@GetMapping("/searchSrvOrganReviewList")
public Result<Page<SrvOrganAccountListResp>> searchSrvOrganReviewList(SrvOrganListReq srvOrganListReq) {
public Result<Page<SrvOrganAccountListResp>> searchSrvOrganReviewList(@RequestHeader("Authorization") String token, SrvOrganListReq srvOrganListReq) {
List<String> list = Arrays.asList("2", "3","4");
srvOrganListReq.setAccountsStatusList(list);
long srvOrganId = TokenParsingUtil.TokenParsing(token, "srvOrganId");
srvOrganListReq.setSrvOrganId(srvOrganId);
return Result.success(accountService.searchSrvOrganAccountList(srvOrganListReq));
}
......@@ -203,9 +210,11 @@ public class AccountController {
* @return
*/
@GetMapping("/queryAccountsDeclareList")
public Result<Page<ChDisabDetailAccountsResp>> queryAccountsDeclareList(Integer pageNum, Integer pageSize,SrvOrganListReq srvOrganListReq) {
public Result<Page<ChDisabDetailAccountsResp>> queryAccountsDeclareList(@RequestHeader("Authorization") String token,Integer pageNum, Integer pageSize,SrvOrganListReq srvOrganListReq) {
List<String> accountsStatusList = Arrays.asList("0", "1");
srvOrganListReq.setAccountsStatusList(accountsStatusList);
long srvOrganId = TokenParsingUtil.TokenParsing(token, "srvOrganId");
srvOrganListReq.setSrvOrganId(srvOrganId);
Page<ChDisabDetailAccountsResp> chAssessDetailAccounts = accountService.queryOrganAccountsDetail(pageNum,pageSize,srvOrganListReq);
return Result.success(chAssessDetailAccounts);
}
......@@ -216,9 +225,11 @@ public class AccountController {
* @return
*/
@GetMapping("/queryDelayAccountList")
public Result<Page<ChDisabDetailAccountsResp>> queryDelayAccountList(Integer pageNum, Integer pageSize,SrvOrganListReq srvOrganListReq) {
public Result<Page<ChDisabDetailAccountsResp>> queryDelayAccountList(@RequestHeader("Authorization") String token,Integer pageNum, Integer pageSize,SrvOrganListReq srvOrganListReq) {
List<String> list = Arrays.asList("1", "2");
srvOrganListReq.setAccountsStatusList(list);
long srvOrganId = TokenParsingUtil.TokenParsing(token, "srvOrganId");
srvOrganListReq.setSrvOrganId(srvOrganId);
Page<ChDisabDetailAccountsResp> chAssessDetailAccounts = accountService.queryOrganAccountsDetail(pageNum,pageSize,srvOrganListReq);
return Result.success(chAssessDetailAccounts);
}
......@@ -320,7 +331,9 @@ public class AccountController {
}
@GetMapping("/queryOverallCostList")
public Result<Page<OverallCostListRespVO>> queryOverallCostList(OverallCostReqVO req) {
public Result<Page<OverallCostListRespVO>> queryOverallCostList(@RequestHeader("Authorization") String token,OverallCostReqVO req) {
long srvOrganId = TokenParsingUtil.TokenParsing(token, "srvOrganId");
req.setSrvOrganId(srvOrganId);
Page<OverallCostListRespVO> overallCostRecords = accountService.queryFreeRdInfo(req);
return Result.success(overallCostRecords);
}
......
......@@ -17,12 +17,8 @@ import java.util.List;
@Repository
public interface ChDisabAccountsDetailMapper extends BaseMapper<ChDisabDetailAccounts> {
List<OrganAccountsVO> getOrganAccountsList(String taskDetailId);
List<AccountExportDetailListResp> searchSrvOrganAccountDetailExport(SrvOrganListReq req);
List<ChDisabDetailAccounts> queryAccountByCondition(@Param("taskDetailIds") List<String> taskDetailIds);
List<OrganAccountsVO> getOtherPlaceList(String programId);
......@@ -30,6 +26,8 @@ public interface ChDisabAccountsDetailMapper extends BaseMapper<ChDisabDetailAcc
Page<NursingRecordsRespVO> queryNursingRecords(Page page, NursingReqVO req);
Page<NursingRecordsRespVO> queryNursingRecordsGoDoor(Page page, NursingReqVO req);
OverallEduceDecreaseCostRespVO queryOverallCostRecords(OverallCostReqVO req);
......
......@@ -47,7 +47,6 @@ public interface AccountService extends IService<ChDisabAccounts> {
int updateChDisabAccounts(int id);
Result organAccountTaskExecute(List<AccountTaskExecuteReqVO> accountTaskExecuteReqVOS);
Result accountTaskExecute(List<AccountTaskExecuteReqVO> accountTaskExecuteReqVOS);
......
......@@ -17,7 +17,6 @@ import com.hungraim.ltc.pojo.entity.SysConfig.ChCfgCostStandard;
import com.hungraim.ltc.pojo.entity.SysConfig.ChFndAttach;
import com.hungraim.ltc.pojo.entity.account.*;
import com.hungraim.ltc.pojo.entity.serviceManage.ChSrvTaskDetail;
import com.hungraim.ltc.pojo.entity.serviceManage.ChSrvTaskFinishItem;
import com.hungraim.ltc.pojo.vo.account.*;
import com.hungraim.ltc.util.*;
import lombok.AllArgsConstructor;
......@@ -476,18 +475,14 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
@Override
public Page<NursingRecordsRespVO> queryNursingRecords(NursingReqVO nursingReqVO) {
String modeName = nursingReqVO.getModeName();
String modeId = "";
if("医疗".equals(modeName)){
modeId = "1";
}else if("养老".equals(modeName)) {
modeId = "2";
}else if ("上门".equals(modeName)){
modeId = "3";
}else if ("异地".equals(modeName)){
modeId = "4";
Page<NursingRecordsRespVO> nursingRecordsRespVOPage = null;
if("上门".equals(modeName)){
nursingRecordsRespVOPage = chDisabAccountsDetailMapper.queryNursingRecordsGoDoor(new Page<>(nursingReqVO.getPageNum(), nursingReqVO.getPageSize()), nursingReqVO);
}else {
nursingReqVO.setModeId("医疗".equals(modeName) ? "1" : "2");
nursingRecordsRespVOPage = chDisabAccountsDetailMapper.queryNursingRecords(new Page<>(nursingReqVO.getPageNum(), nursingReqVO.getPageSize()), nursingReqVO);
}
nursingReqVO.setModeId(modeId);
return chDisabAccountsDetailMapper.queryNursingRecords(new Page<>(nursingReqVO.getPageNum(), nursingReqVO.getPageSize()),nursingReqVO);
return nursingRecordsRespVOPage;
}
@Override
......@@ -528,7 +523,6 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
chDisabDetailAccounts.setDeductionAmount(deductionAmount.add(amountOfMoney));
deductionAmountTotal = deductionAmountTotal.add(amountOfMoney);
}
chDisabDetailAccounts.setRemarks(req.getRemarks());
int result = chDisabAccountsDetailMapper.updateById(chDisabDetailAccounts);
chDisabAccounts.setReissueAmountTotal(reissueAmountTotal);
chDisabAccounts.setDeductionAmountTotal(deductionAmountTotal);
......@@ -539,6 +533,7 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
chDisabFreeRdInfo.setAccountsDetailId(accountsDetailId);
chDisabFreeRdInfo.setAccountsId(accountsId);
chDisabFreeRdInfo.setCreationTime(new Date());
chDisabFreeRdInfo.setRemarks(req.getRemarks());
chDisabFreeRdInfoMapper.insert(chDisabFreeRdInfo);
return result;
}
......@@ -660,8 +655,6 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
String planId = accountsVO.getPlanId();
// 更新
chDisabAccountsDetailMapper.updateByPlanId(planId);
}else {
BigDecimal accountsAllCost = chDisabDetailAccountsDTO.getAccountsAllCost();
BigDecimal accountsOverallCost = chDisabDetailAccountsDTO.getAccountsOverallCost();
......@@ -675,119 +668,6 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
}
@Override
@Transactional(rollbackFor = Exception.class)
public Result organAccountTaskExecute(List<AccountTaskExecuteReqVO> accountTaskExecuteReqVOS) {
log.info("organAccountTaskExecute.accountTaskExecuteReqVOS:{}",accountTaskExecuteReqVOS);
if (CollectionUtil.isEmpty(accountTaskExecuteReqVOS)) {
return Result.failed("参数不能为空");
}
List<String> taskDetailIds = accountTaskExecuteReqVOS.stream().map(AccountTaskExecuteReqVO::getTaskDetailId).distinct().collect(Collectors.toList());
// 根据任务id查找结算详情,还没有对应的任务数据说明还未发生过结算,进行插入详情表和结算表
List<ChDisabDetailAccounts> chDisabDetailList = chDisabAccountsDetailMapper.queryAccountByCondition(taskDetailIds);
// 根据任务id分组,一个任务下会有多个项目,任务id相同
Map<String, List<AccountTaskExecuteReqVO>> accountTaskMap = accountTaskExecuteReqVOS.stream().collect(Collectors.groupingBy(AccountTaskExecuteReqVO::getTaskDetailId));
for(Map.Entry<String, List<AccountTaskExecuteReqVO>> entry:accountTaskMap.entrySet()) {
String taskDetailId = entry.getKey();
// 已完成的任务,一个任务下有服务完成就产生结算,多个服务完成算一条服务的结算(实际上结算详情有一条记录就产生结算费用)
List<ChSrvTaskFinishItem> chSrvTaskFinishItems = chSrvTaskFinishItemMapper.selectList(new LambdaQueryWrapper<ChSrvTaskFinishItem>()
.eq(ChSrvTaskFinishItem::getTaskDetailId, taskDetailId));
List<AccountTaskExecuteReqVO> accountTaskList = entry.getValue();
// 处理具体的服务项目
try {
for (AccountTaskExecuteReqVO accountTaskExecuteReqVO : accountTaskList) {
// 已完成的任务更新ch_srv_plan状态
String planId = accountTaskExecuteReqVO.getPlanId();
Integer integer = chSrvTaskDetailMapper.updateSrvPlanById(planId);
if(integer == 0){
log.info("更新任务计划表失败");
}
if (CollectionUtil.isNotEmpty(chSrvTaskFinishItems)) {
List<ChSrvTaskFinishItem> chSrvTaskFinishItemStream = chSrvTaskFinishItems.stream()
.filter(s -> s.getItemId().equals(Long.valueOf(accountTaskExecuteReqVO.getItemId()))).collect(Collectors.toList());
// 如果存在就不插入了
if (CollectionUtil.isNotEmpty(chSrvTaskFinishItemStream)) {
log.info("chSrvTaskFinishItemStream is totEmpty:{}",chSrvTaskFinishItemStream);
return Result.success();
}
}
ChSrvTaskFinishItem chSrvTaskFinishItem = new ChSrvTaskFinishItem();
chSrvTaskFinishItem.setTaskDetailId(Long.valueOf(accountTaskExecuteReqVO.getTaskDetailId()));
chSrvTaskFinishItem.setItemId(Long.valueOf(accountTaskExecuteReqVO.getItemId()));
chSrvTaskFinishItemMapper.insert(chSrvTaskFinishItem);
ChSrvTaskDetail ca = new ChSrvTaskDetail();
ca.setStatus((short) 4);
ca.setTaskDetailId(Long.valueOf(accountTaskExecuteReqVO.getTaskDetailId()));
chSrvTaskDetailMapper.updateById(ca);
}
accountSave(taskDetailId, chDisabDetailList);
} catch (Exception e) {
log.info("=====accountSave error:{}",e);
return Result.failed("服务异常");
}
}
return Result.success();
}
private void accountSave(String taskDetailId, List<ChDisabDetailAccounts> chDisabDetailList) {
if (CollectionUtil.isEmpty(chDisabDetailList)) {
List<OrganAccountsVO> accountsList = chDisabAccountsDetailMapper.getOrganAccountsList(taskDetailId);
for (OrganAccountsVO accountsVO : accountsList) {
ChDisabDetailAccounts chDisabDetailAccounts = new ChDisabDetailAccounts();
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(srvModeName)) {
limit = BigDecimal.valueOf(50);
// 医疗机构护理,原则上收治医疗护理需求为主的重度失能人员一级及以下医疗机构其限额为 80 元/人/天,由长期护理保险基金支付 70%,个人支付 30%;
} else if ("医疗".equals(srvModeName) && "1".equals(accountsVO.getLevelCode())) {
limit = BigDecimal.valueOf(80);
// 二级及以上医疗机构其限额为 100 元/人/天,由长期护理保险基金支付 70%,个人支付 30%;
} else if ("医疗".equals(srvModeName) && (!"1".equals(accountsVO.getLevelCode()))) {
limit = BigDecimal.valueOf(100);
} else {
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(accountsTime);
chDisabDetailAccounts.setAccountsStartTime(DateUtils.getFirstDayOfMonth(DateUtils.strToDate(accountsVO.getSrvDate())));
chDisabDetailAccounts.setAccountsEndTime(DateUtils.getlastDayOfMonth(DateUtils.strToDate(accountsVO.getSrvDate())));
// chDisabDetailAccounts.setTaskDetailId(accountsVO.getTaskDetailId());
chDisabDetailAccounts.setMedicalArea(accountsVO.getMedicalArea());
chDisabDetailAccounts.setDisabInfoId(disabInfoId);
chDisabDetailAccounts.setStatus((short)0);
chDisabDetailAccounts.setReissueAmount(BigDecimal.valueOf(0));
chDisabDetailAccounts.setDeductionAmount(BigDecimal.valueOf(0));
ChDisabAccounts chDisabAccounts = getChDisabAccounts(accountsVO, limit, overallCost, personalCost);
chDisabDetailAccounts.setAccountsId(chDisabAccounts.getAccountsId());
chDisabAccountsDetailMapper.insert(chDisabDetailAccounts);
}
}
}
private ChDisabAccounts getChDisabAccounts1(AccountTaskExecuteReqVO accountsVO) {
// 结算表 根据机构和结算时间 服务方式
ChDisabAccounts chDisabAccounts = disabAccountsMapper.queryAccountByCondition(DateUtils.dateToStrYm(DateUtils.strToDate(accountsVO.getSrvDate())), accountsVO.getSrvModeName(), accountsVO.getSrvOrganId(),null);
......@@ -810,30 +690,9 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
}
private ChDisabAccounts getChDisabAccounts(OrganAccountsVO accountsVO, BigDecimal limit, BigDecimal overallCost, BigDecimal personalCost) {
// 结算表 根据机构和结算时间 服务方式
ChDisabAccounts chDisabAccounts = disabAccountsMapper.queryAccountByCondition(DateUtils.dateToStrYm(DateUtils.strToDate(accountsVO.getSrvDate())), accountsVO.getSrvModeName(), accountsVO.getSrvOrganId(),null);
if(chDisabAccounts == null) {
chDisabAccounts = new ChDisabAccounts();
chDisabAccounts.setModeName(accountsVO.getSrvModeName());
chDisabAccounts.setAccountsTime(DateUtils.strToTime(accountsVO.getSrvDate()));
chDisabAccounts.setSrvOrganId(Long.valueOf(accountsVO.getSrvOrganId()));
chDisabAccounts.setCreationTime(new Date());
chDisabAccounts.setAccountsStatus((short) 0);
BigDecimal zero = BigDecimal.valueOf(0);
chDisabAccounts.setAllCost(zero);
chDisabAccounts.setOverallCost(zero);
chDisabAccounts.setPersonalCost(zero);
chDisabAccounts.setReissueAmountTotal(zero);
chDisabAccounts.setDeductionAmountTotal(zero);
disabAccountsMapper.insert(chDisabAccounts);
}
return chDisabAccounts;
}
@Override
public void otherPlaceHandler(String programId){
List<OrganAccountsVO> accountsList = chDisabAccountsDetailMapper.getOtherPlaceList(programId);
/* List<OrganAccountsVO> accountsList = chDisabAccountsDetailMapper.getOtherPlaceList(programId);
for (OrganAccountsVO accountsVO : accountsList) {
ChDisabDetailAccounts chDisabDetailAccounts = new ChDisabDetailAccounts();
chDisabDetailAccounts.setSrvOrganId(accountsVO.getSrvOrganId());
......@@ -854,10 +713,10 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
chDisabDetailAccounts.setTaskDetailId(accountsVO.getTaskDetailId());
chDisabDetailAccounts.setMedicalArea(accountsVO.getMedicalArea());
chDisabDetailAccounts.setDisabInfoId(accountsVO.getDisabInfoId());
ChDisabAccounts chDisabAccounts = getChDisabAccounts(accountsVO, limit, zero, zero);
ChDisabAccounts chDisabAccounts = getChDisabAccounts1(accountsVO);
chDisabDetailAccounts.setAccountsId(chDisabAccounts.getAccountsId());
chDisabAccountsDetailMapper.insert(chDisabDetailAccounts);
}
}*/
}
@Override
......@@ -934,10 +793,14 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
BigDecimal accountsAllCost = chDisabDetailAccountDTO.getAccountsAllCost();
BigDecimal accountsOverallCost = chDisabDetailAccountDTO.getAccountsOverallCost();
BigDecimal accountsPersonalCost = chDisabDetailAccountDTO.getAccountsPersonalCost();
BigDecimal deductionAmount = chDisabDetailAccountDTO.getDeductionAmount();
BigDecimal reissueAmount = chDisabDetailAccountDTO.getReissueAmount();
ChDisabAccounts chDisabAccountDTO = disabAccountsMapper.selectById(accountsId);
BigDecimal allCost = chDisabAccountDTO.getAllCost();
BigDecimal overallCost = chDisabAccountDTO.getOverallCost();
BigDecimal personalCost = chDisabAccountDTO.getPersonalCost();
BigDecimal deductionAmountTotal = chDisabAccountDTO.getDeductionAmountTotal();
BigDecimal reissueAmountTotal = chDisabAccountDTO.getReissueAmountTotal();
Short accountsStatus = chDisabAccountDTO.getAccountsStatus();
if (accountsStatus > 1) {
log.info("{},已完成审核",accountsDetailId);
......@@ -948,11 +811,15 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
allCost = allCost.subtract(accountsAllCost);
overallCost = overallCost.subtract(accountsOverallCost);
personalCost = personalCost.subtract(accountsPersonalCost);
BigDecimal deductionAmountTotalSub = deductionAmountTotal.subtract(deductionAmount);
BigDecimal reissueAmountTotalSub = reissueAmountTotal.subtract(reissueAmount);
ChDisabAccounts chDisabAccount = new ChDisabAccounts();
chDisabAccount.setAllCost(allCost);
chDisabAccount.setOverallCost(overallCost);
chDisabAccount.setPersonalCost(personalCost);
chDisabAccount.setAccountsId(accountsId);
chDisabAccount.setDeductionAmountTotal(deductionAmountTotalSub);
chDisabAccount.setReissueAmountTotal(reissueAmountTotalSub);
disabAccountsMapper.updateById(chDisabAccount);
// 恢复
}else if(status == 1){
......@@ -960,18 +827,23 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
//结算记录
Date accountsTime = chDisabDetailAccountDTO.getAccountsTime();
Boolean aBoolean = DateUtils.inCurrentMonth(accountsTime);
// 同一个月
if(aBoolean){
allCost = allCost.add(accountsAllCost);
overallCost = overallCost.add(accountsOverallCost);
personalCost = personalCost.add(accountsPersonalCost);
BigDecimal reissueAmountAdd = reissueAmountTotal.add(reissueAmount);
BigDecimal deductionAmountAdd = deductionAmountTotal.add(deductionAmount);
ChDisabAccounts chDisabAccount = new ChDisabAccounts();
chDisabAccount.setAllCost(allCost);
chDisabAccount.setOverallCost(overallCost);
chDisabAccount.setPersonalCost(personalCost);
chDisabAccount.setAccountsId(accountsId);
chDisabAccount.setReissueAmountTotal(reissueAmountAdd);
chDisabAccount.setDeductionAmountTotal(deductionAmountAdd);
disabAccountsMapper.updateById(chDisabAccount);
}else {
// 结算表加一个是否暂缓字段 1 暂缓
// 结算到其他月份 结算表加一个是否暂缓字段 2 暂缓
ChDisabAccounts chDisabAccounts = disabAccountsMapper.queryAccountByCondition(DateUtils.dateToStrYm(new Date()), chDisabDetailAccountDTO.getModeName(), chDisabDetailAccountDTO.getSrvOrganId(),2);
if (chDisabAccounts == null) {
chDisabAccounts = new ChDisabAccounts();
......@@ -995,6 +867,10 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
BigDecimal allCost1 = chDisabAccounts.getAllCost();
BigDecimal overallCost1 = chDisabAccounts.getOverallCost();
BigDecimal personalCost1 = chDisabAccounts.getPersonalCost();
BigDecimal deductionAmountTotal1 = chDisabAccounts.getDeductionAmountTotal();
BigDecimal reissueAmountTotal1 = chDisabAccounts.getReissueAmountTotal();
BigDecimal deduction = deductionAmountTotal1.add(deductionAmount);
BigDecimal reissue = reissueAmountTotal1.add(reissueAmount);
allCost1 = allCost1.add(accountsAllCost);
overallCost1 = overallCost1.add(accountsOverallCost);
personalCost1 = personalCost1.add(accountsPersonalCost);
......@@ -1003,6 +879,8 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
chDisabAccount.setOverallCost(overallCost1);
chDisabAccount.setPersonalCost(personalCost1);
chDisabAccount.setAccountsId(accountsId);
chDisabAccount.setReissueAmountTotal(reissue);
chDisabAccount.setDeductionAmountTotal(deduction);
disabAccountsMapper.updateById(chDisabAccount);
}
}
......
......@@ -31,10 +31,13 @@
<if test="req.accountsId != null and req.accountsId != ''">
and d.ACCOUNTS_ID = #{req.accountsId}
</if>
<if test="req.modeId != null and req.modeId != ''">
and DECODE(d.mode_name, '医疗','1','养老', '2','上门','3', '异地', '4') = #{req.modeId}
</if>
<if test="req.accountsStatus != null and req.accountsStatus != ''">
and d.status = #{req.accountsStatus}
</if>
<if test="req.srvOrganId != null and req.srvOrganId != ''">
<if test="req.srvOrganId != null and req.srvOrganId != '' and req.srvOrganId!=0">
and d.SRV_ORGAN_ID = #{req.srvOrganId}
</if>
......@@ -54,7 +57,7 @@
<select id="queryNursingRecords" resultType="com.hungraim.ltc.pojo.entity.account.NursingRecordsRespVO">
select organ.SRV_ORGAN_NAME srvOrganName,
to_char(plan.SRV_PLAN_TIME,'yyyy-MM-dd') srvPlanTime,
DECODE(plan.MODE_ID, '1','医疗','2', '养老','3','上门', '4', '异地') modeName,
DECODE(plan.MODE_ID, '1','医疗','2', '养老','3','上门') modeName,
to_char(plan.CREATION_TIME,'yyyy-MM-dd HH24:mi:ss') executionTime,
plan.item_name itemName
from CH_SRV_PLAN plan
......@@ -65,6 +68,24 @@
and plan.IS_STATUS ='4'
</select>
<select id="queryNursingRecordsGoDoor" resultType="com.hungraim.ltc.pojo.entity.account.NursingRecordsRespVO">
select
organ.SRV_ORGAN_NAME srvOrganName,
to_char(detail.SRV_DATE,'yyyy-MM-dd') srvPlanTime,
'上门' modeName,
to_char(item.FCD,'yyyy-MM-dd HH24:mi:ss') executionTime,
service.SERVICE_TYPE_DETAILED_NAME itemName
from CH_SRV_TASK_FINISH_ITEM item
left join CH_SRV_TASK_DETAIL detail on detail.TASK_DETAIL_ID = item.TASK_DETAIL_ID
left join CH_SRV_TASK task on task.SRV_TASK_ID = detail.SRV_TASK_ID
LEFT JOIN CH_SRV_ORGAN_EMP m ON m.EMP_ID = task.SRV_EMP_ID
LEFT JOIN CH_SRV_ORGAN organ ON organ.SRV_ORGAN_ID = m.SRV_ORGAN_ID
LEFT JOIN CH_SRV_ORGAN_PROJECT CSOP ON CSOP.PROJECT_ID = item.ITEM_ID
left join CH_SERVICE_TYPE_DETAILED service on service.SERVICE_TYPE_DETAILED_ID = CSOP.ITEM_NAME
where to_char(detail.SRV_DATE, 'yyyy-MM') = #{req.accountsTime} and task.DISAB_INFO_ID = #{req.disabInfoId} and organ.SRV_ORGAN_ID = #{req.srvOrganId}
</select>
......@@ -104,44 +125,7 @@
</where>
</select>
<select id="getOrganAccountsList" resultType="com.hungraim.ltc.pojo.vo.account.OrganAccountsVO">
select
detail.TASK_DETAIL_ID taskDetailId,
--失能人员姓名
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,
program.SRV_MODE_ID modeId,
--服务方式
DECODE(program.SRV_MODE_ID, '1','医疗','2', '养老','3','上门', '4', '异地') srvModeName,
--护理机构名称
organ.srv_organ_id srvOrganId,
--护理机构名称
organ.srv_organ_name srvOrganName,
--护理服务人员 Id
emp.EMP_ID empId,
--任务时间
detail.SRV_DATE srvDate,
-- 机构等级
organ.LEVEL_CODE levelCode
from ch_srv_task_detail detail--服务计划
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_APPLY apply on apply.apply_id = disable.apply_id
left join ch_srv_organ_emp emp on task.srv_emp_id = emp.emp_id--护理人员
left join ch_srv_program program on task.program_id = program.program_id--服务方案
left join ch_srv_organ organ on program.srv_organ_id = organ.srv_organ_id--服务机构
LEFT JOIN CH_SRV_TASK_FINISH_ITEM CSTFI ON detail.TASK_DETAIL_ID = CSTFI.TASK_DETAIL_ID
<where>
detail.STATUS = '4'
<if test="taskDetailId != null and taskDetailId != ''">
AND detail.TASK_DETAIL_ID = #{taskDetailId}
</if>
</where>
</select>
<select id="queryPlanInfoByDetailId" resultType="com.hungraim.ltc.pojo.vo.account.OrganAccountsVO">
select
......@@ -173,16 +157,7 @@
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 * from CH_DISAB_ACCOUNTS_DETAIL t where t.MODE_NAME in ('养老','医疗')
<if test="taskDetailIds != null and taskDetailIds.size() > 0">
AND t.TASK_DETAIL_ID IN
<foreach collection="taskDetailIds" separator="," open="(" close=")" item="taskDetailId">
#{taskDetailId}
</foreach>
</if>
</select>
<!--查询评估信息-->
<select id="getAssessAccountsList" resultType="com.hungraim.ltc.pojo.vo.account.AssessAccountsVO">
......
......@@ -59,7 +59,7 @@
#{organId}
</foreach>
</if>
<if test='req.srvOrganId != null'>
<if test="req.srvOrganId != null and req.srvOrganId != '' and req.srvOrganId!=0">
AND t2.SRV_ORGAN_ID = #{req.srvOrganId}
</if>
<if test="req.accountsTime != null and req.accountsTime != ''">
......
......@@ -14,6 +14,7 @@
organ.SRV_ORGAN_NAME srvOrganName,
rd.AMOUNT_OF_MONEY amountOfMoney,
rd.FREE_RD_ID freeRdId,
rd.REMARKS remarks,
d.ACCOUNTS_STATUS accountsStatus
from CH_DISAB_FREE_RD_INFO rd left join
CH_DISAB_ACCOUNTS_DETAIL detail on
......@@ -32,6 +33,9 @@
<if test="req.srvOrganName != null and req.srvOrganName != ''">
and organ.SRV_ORGAN_NAME = #{req.srvOrganName}
</if>
<if test="req.srvOrganId != null and req.srvOrganId != '' and req.srvOrganId!=0">
AND organ.SRV_ORGAN_ID = #{req.srvOrganId}
</if>
<if test="req.certiCode != null and req.certiCode != ''">
and info.certi_Code = #{req.certiCode}
</if>
......
......@@ -36,6 +36,9 @@
<if test="req.srvDate != null and req.srvDate != ''">
AND to_char(plan.SRV_PLAN_TIME,'yyyy-MM-dd') = #{req.srvDate}
</if>
<if test="req.srvOrganId != null and req.srvOrganId != '' and req.srvOrganId!=0">
AND organ.SRV_ORGAN_ID = #{req.srvOrganId}
</if>
</where>
</select>
......
......@@ -506,13 +506,15 @@ public class DisableController {
* @return 失能人员信息列表
*/
@RequestMapping("/disableInfoList")
public Result<Page<DisableInfoListVo>> disableInfoList(Integer pageNum, Integer pageSize, Long srvOrganId,String certiCode,String realName,String svrModelId) {
public Result<Page<DisableInfoListVo>> disableInfoList(@RequestHeader("Authorization") String token,Integer pageNum, Integer pageSize, Long srvOrganId,String certiCode,String realName,String svrModelId) {
if (pageNum == null || pageNum < 1 || srvOrganId == null || srvOrganId == 0) {
return Result.failed(ResultCode.REQUEST_PARAM_ERROR);
}
if (pageSize == null || pageSize < 1) {
pageSize = 10;
}
long srvOrganIdL = TokenParsingUtil.TokenParsing(token, "srvOrganId");
srvOrganId = new Long(srvOrganIdL);
Page<DisableInfoListVo> page = new Page<>(pageNum, pageSize);
page = disableService.getDisableInfoList(page, srvOrganId,certiCode,realName,svrModelId);
return Result.success(page);
......
......@@ -38,8 +38,10 @@
LEFT JOIN CH_CFG_SRV_DISABLE_LEVEL T6 ON T3.DISABLE_LEVEL_ID = T6.DISABLE_LEVEL_ID
LEFT JOIN CH_APR_TASK T4 ON T3.TASK_ID = T4.TASK_ID
LEFT JOIN CH_SRV_ORGAN T5 ON T1.SRV_ORGAN_ID = T5.SRV_ORGAN_ID
WHERE
T1.SRV_ORGAN_ID = #{srvOrganId}
<where>
<if test="srvOrganId != null and srvOrganId != '' and srvOrganId!=0">
and T1.SRV_ORGAN_ID = #{srvOrganId}
</if>
<if test="certiCode != null and certiCode != ''">
and T2.CERTI_CODE = #{certiCode}
</if>
......@@ -49,6 +51,7 @@
<if test="svrModelId != null and svrModelId != ''">
and T7.MODE_ID = #{svrModelId}
</if>
</where>
</select>
<update id="updateChSrvProgram">
......
......@@ -11,6 +11,7 @@
organ.organ_name assessOrganName,
to_char(d.ACCOUNTS_TIME,'yyyy-MM') accountsTime,
(select district_name from ch_fnd_district dis where apply.MEDICAL_AREA = dis.district_code) medicalArea,
(select type.APREMP_NAME from CH_CFG_APREMP_TYPE type where type.APREMP_TYPE_ID = emp.APREMP_TYPE_ID_S) aprempTypeS,
to_char(d.assess_time,'yyyy-MM-dd') assessTime,
emp.REAL_NAME empName
from CH_ASSESS_ACCOUNTS_DETAIL d
......@@ -23,12 +24,13 @@ from CH_ASSESS_ACCOUNTS_DETAIL d
<select id="assessAccountDetailExport" resultType="com.hungraim.ltc.pojo.vo.account.AssessAccountsExportResp">
SELECT
t2.REAL_NAME realName,
(select type.APREMP_NAME from CH_CFG_APREMP_TYPE type where type.APREMP_TYPE_ID = t4.APREMP_TYPE_ID_S) aprempTypeS,
t3.ORGAN_NAME organName,
to_char(t1.ACCOUNTS_TIME,'yyyy-MM') accountsTime,
t1.ASSESS_COST assessCost,
to_char(t1.assess_time,'yyyy-MM-dd') assessTime,
t4.REAL_NAME empName,
(select district_name from ch_fnd_district dis where t2.MEDICAL_AREA = dis.district_code) medicalArea,
(select district_name from ch_fnd_district dis where t2.MEDICAL_AREA = dis.district_code) medicalArea
FROM
CH_ASSESS_ACCOUNTS_DETAIL t1
left join CH_DISABLE_APPLY t2 on t1.APPLY_ID = t2.APPLY_ID
......@@ -36,7 +38,5 @@ FROM
left join CH_APR_EMP t4 on t4.EMP_ID = t1.EMP_ID
where t1.ASSESS_ACCOUNTS_ID = #{assessAccountsId}
</select>
</mapper>
......@@ -16,10 +16,11 @@ public class NursingReqVO extends BaseReq {
private String disabInfoId;
private String modeId;
private String modeName;
private String modeId;
private String srvOrganId;
......
......@@ -65,4 +65,6 @@ public class OverallCostListRespVO {
private String srvOrganName;
private String accountsStatus;
private String remarks;
}
......@@ -32,4 +32,6 @@ public class OverallCostReqVO extends BaseReq {
private Integer dealType;
private Long srvOrganId;
}
......@@ -37,6 +37,11 @@ public class ChAssessDetailAccountsResp implements Serializable {
*/
private String medicalArea;
/**
* 评定资质
*/
private String aprempTypeS;
private static final long serialVersionUID = 1L;
}
\ No newline at end of file
......@@ -24,6 +24,9 @@ public class AssessAccountsExportResp {
@Excel(name = "评定人员姓名",width = 20)
private String empName;
@Excel(name = "评定资质",width = 20)
private String aprempTypeS;
@Excel(name = "评估时间",width = 20)
private String assessTime;
......
......@@ -24,6 +24,8 @@ public class SrvOrganListReq extends BaseReq {
*/
private Long srvOrganId;
private String modeId;
/**
* 护理机构id
......
......@@ -18,4 +18,6 @@ public class SrvTaskReqVO extends BaseReq {
private String status;
private String srvOrganName;
private Long srvOrganId;
}
......@@ -18,7 +18,7 @@ public class SrvTaskScheduledServiceImpl {
@Autowired
private SrvTaskService srvTaskService;
@Scheduled(cron = "30 30 23 * * ?")
@Scheduled(cron = "30 20 11 * * ?")
public void timeAllocationSrvTask() {
log.info("timeAllocationSrvTask========start");
srvTaskService.timeAllocationSrvTask();
......
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