Commit 7392734e authored by 董天德's avatar 董天德

Merge remote-tracking branch 'origin/dev_nursing_records_20230214' into dev_ch_master

# Conflicts: # account/account-service/src/main/resources/mapper/ChDisabAccountsDetailMapper.xml
parents c80f0408 a559fd3b
...@@ -3,8 +3,7 @@ package com.hungraim.ltc.account.controller; ...@@ -3,8 +3,7 @@ package com.hungraim.ltc.account.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hungraim.ltc.account.service.AccountService; import com.hungraim.ltc.account.service.AccountService;
import com.hungraim.ltc.pojo.entity.account.ChDisabAccounts; import com.hungraim.ltc.pojo.entity.account.*;
import com.hungraim.ltc.pojo.entity.account.ChDisabDetailAccountsResp;
import com.hungraim.ltc.pojo.vo.account.*; import com.hungraim.ltc.pojo.vo.account.*;
import com.hungraim.ltc.util.FileUtils; import com.hungraim.ltc.util.FileUtils;
import com.hungraim.ltc.util.Result; import com.hungraim.ltc.util.Result;
...@@ -100,8 +99,12 @@ public class AccountController { ...@@ -100,8 +99,12 @@ public class AccountController {
/**
@RequestMapping("/organAccountTaskExecute") * 任务执行
*
* @return
*/
@PostMapping("/organAccountTaskExecute")
public Result organAccountTaskExecute(AccountTaskReqVO accountTaskReqVO){ public Result organAccountTaskExecute(AccountTaskReqVO accountTaskReqVO){
List<AccountTaskExecuteReqVO> accountTaskExecuteReqVOS = accountTaskReqVO.getAccountTaskList(); List<AccountTaskExecuteReqVO> accountTaskExecuteReqVOS = accountTaskReqVO.getAccountTaskList();
accountService.organAccountTaskExecute(accountTaskExecuteReqVOS); accountService.organAccountTaskExecute(accountTaskExecuteReqVOS);
...@@ -164,17 +167,136 @@ public class AccountController { ...@@ -164,17 +167,136 @@ public class AccountController {
/** /**
* 查询机构结算信息列表明细 * 查询机构结算信息列表明细
* *
* @param id 结算id * @param accountsId 结算id
* @return * @return
*/ */
@GetMapping("/queryOrganAccountsDetail") @GetMapping("/queryOrganAccountsDetail")
public Result<List<ChDisabDetailAccountsResp>> queryOrganAccountsDetail(String id) { public Result<Page<ChDisabDetailAccountsResp>> queryOrganAccountsDetail(Integer pageNum, Integer pageSize, String accountsId) {
List<ChDisabDetailAccountsResp> chAssessDetailAccounts = accountService.queryOrganAccountsDetail(id); if (StringUtils.isBlank(accountsId)) {
return Result.failed(ResultCode.REQUEST_PARAM_ERROR);
}
Page<ChDisabDetailAccountsResp> chAssessDetailAccounts = accountService.queryOrganAccountsDetail(pageNum,pageSize,accountsId,null);
return Result.success(chAssessDetailAccounts);
}
/**
* 基金申报列表查询
* @param
* @return
*/
@GetMapping("/queryAccountsDeclareList")
public Result<Page<ChDisabDetailAccountsResp>> queryAccountsDeclareList(Integer pageNum, Integer pageSize) {
Page<ChDisabDetailAccountsResp> chAssessDetailAccounts = accountService.queryOrganAccountsDetail(pageNum,pageSize,null,0);
return Result.success(chAssessDetailAccounts);
}
/**
* 暂缓列表查询
* @param
* @return
*/
@GetMapping("/queryDelayAccountList")
public Result<Page<ChDisabDetailAccountsResp>> queryDelayAccountList(Integer pageNum, Integer pageSize) {
Page<ChDisabDetailAccountsResp> chAssessDetailAccounts = accountService.queryOrganAccountsDetail(pageNum,pageSize,null,2);
return Result.success(chAssessDetailAccounts); return Result.success(chAssessDetailAccounts);
} }
/**
* 暂缓
* @param status 1 恢复 2 暂缓
* @return
*/
@PostMapping("/delayAccountCommit")
public Result<Page<ChDisabDetailAccountsResp>> delayAccountCommit(Long accountsDetailId, Short status) {
int result = accountService.delayAccountCommit(accountsDetailId, status);
if (result > 0) {
return Result.success();
} else {
return Result.failed();
}
}
/**
* 基金申报提交
* @param
* @return
*/
@PostMapping("/accountsFreeCommit")
public Result accountsFreeCommit(Long accountsDetailId) {
int result = accountService.accountsFreeCommit(accountsDetailId);
if (result > 0) {
return Result.success();
} else {
return Result.failed();
}
}
/**
* 查询护理记录
*
* @param taskDetailId 结算详情id
* @return
*/
@GetMapping("/queryNursingRecords")
public Result<Page<NursingRecordsRespVO>> queryNursingRecords(Integer pageNum, Integer pageSize, String taskDetailId) {
Page<NursingRecordsRespVO> nursingRecordsRespVOList = accountService.queryNursingRecords(pageNum,pageSize,taskDetailId);
return Result.success(nursingRecordsRespVOList);
}
@GetMapping("/queryOverallCostRecords")
public Result<OverallEduceDecreaseCostRespVO> queryOverallCostRecords(OverallCostReqVO req) {
String certiCode = req.getCertiCode();
if (StringUtils.isBlank(certiCode)) {
return Result.failed("查询条件证件号不能为空");
}
OverallEduceDecreaseCostRespVO overallCostRecords = accountService.queryOverallCostRecords(req);
return Result.success(overallCostRecords);
}
/**
* 费用扣减提交
*
* @param req
* @return
*/
@PostMapping("/overallCostSubmit")
public Result overallCostSubmit(OverallCostSubmitReqVO req) {
int result = accountService.overallCostSubmit(req);
if(result > 0){
return Result.success();
}else{
return Result.failed();
}
}
/**
* 删除护理机构
*
* @param accountsDetailId 结算详情id
*/
@DeleteMapping("/deleteAccountsDetail")
public Result deleteAccountsDetail(Long accountsDetailId) {
if (null == accountsDetailId) {
return Result.failed(ResultCode.REQUEST_PARAM_ERROR);
}
int result = accountService.deleteAccountsDetail(accountsDetailId);
if(result > 0){
return Result.success();
}else{
return Result.failed();
}
}
@GetMapping("/queryOverallCostList")
public Result<Page<OverallCostListRespVO>> queryOverallCostList(OverallCostReqVO req) {
Page<OverallCostListRespVO> overallCostRecords = accountService.queryOverallCostList(req);
return Result.success(overallCostRecords);
}
/** /**
* 机构结算管理提交复核 * 机构结算管理提交复核
......
...@@ -2,12 +2,11 @@ package com.hungraim.ltc.account.dao; ...@@ -2,12 +2,11 @@ package com.hungraim.ltc.account.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hungraim.ltc.pojo.entity.account.ChDisabAccounts; import com.hungraim.ltc.pojo.entity.account.*;
import com.hungraim.ltc.pojo.entity.account.ChDisabDetailAccounts; import com.hungraim.ltc.pojo.vo.account.AccountExportDetailListResp;
import com.hungraim.ltc.pojo.vo.account.*; import com.hungraim.ltc.pojo.vo.account.OrganAccountsVO;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import java.util.List; import java.util.List;
...@@ -19,15 +18,22 @@ public interface ChDisabAccountsDetailMapper extends BaseMapper<ChDisabDetailAcc ...@@ -19,15 +18,22 @@ public interface ChDisabAccountsDetailMapper extends BaseMapper<ChDisabDetailAcc
List<OrganAccountsVO> getOrganAccountsList(String taskDetailId); List<OrganAccountsVO> getOrganAccountsList(String taskDetailId);
Page<SrvOrganAccountListResp> searchSrvOrganAccountList(Page page, List<Long> organIds, SrvOrganListReq req);
List<AccountExportDetailListResp> searchSrvOrganAccountDetailExport(String accountsId); List<AccountExportDetailListResp> searchSrvOrganAccountDetailExport(String accountsId);
List<ChDisabDetailAccounts> queryAccountByCondition(@Param("taskDetailIds") List<String> taskDetailIds); List<ChDisabDetailAccounts> queryAccountByCondition(@Param("taskDetailIds") List<String> taskDetailIds);
List<OrganAccountsVO> getOtherPlaceList(String programId); List<OrganAccountsVO> getOtherPlaceList(String programId);
Page<ChDisabDetailAccountsResp> queryOrganAccountsDetail(Page page,String accountsId,Integer status);
Page<NursingRecordsRespVO> queryNursingRecords(Page page, String taskDetailId);
OverallEduceDecreaseCostRespVO queryOverallCostRecords(OverallCostReqVO req);
Page<OverallCostListRespVO> queryOverallCostList(Page page, OverallCostReqVO req);
int updateByAccountsId(String accountsId);
......
...@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; ...@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hungraim.ltc.pojo.entity.account.ChDisabAccounts; import com.hungraim.ltc.pojo.entity.account.ChDisabAccounts;
import com.hungraim.ltc.pojo.vo.account.AccountOperVo; import com.hungraim.ltc.pojo.vo.account.AccountOperVo;
import com.hungraim.ltc.pojo.vo.account.SrvOrganAccountListResp;
import com.hungraim.ltc.pojo.vo.account.SrvOrganListReq; import com.hungraim.ltc.pojo.vo.account.SrvOrganListReq;
import com.hungraim.ltc.pojo.vo.account.SrvOrganListResp; import com.hungraim.ltc.pojo.vo.account.SrvOrganListResp;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
...@@ -52,5 +53,10 @@ public interface ChDisabAccountsMapper extends BaseMapper<ChDisabAccounts> { ...@@ -52,5 +53,10 @@ public interface ChDisabAccountsMapper extends BaseMapper<ChDisabAccounts> {
ChDisabAccounts queryAccountByCondition(String accountsTime, String modeName, String srvOrganId); ChDisabAccounts queryAccountByCondition(String accountsTime, String modeName, String srvOrganId,Integer isDelay);
Page<SrvOrganAccountListResp> searchSrvOrganAccountList(Page page, List<Long> organIds, SrvOrganListReq req);
} }
\ 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.account.ChDisabDetailAccounts;
import com.hungraim.ltc.pojo.entity.account.ChDisabDetailAccountsResp;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* @author mq
*/
@Mapper
@Repository
public interface ChDisabDetailAccountsMapper extends BaseMapper<ChDisabDetailAccounts> {
List<ChDisabDetailAccountsResp> queryOrganAccountsDetail(String accountsId);
}
...@@ -31,7 +31,16 @@ public interface AccountService extends IService<ChDisabAccounts> { ...@@ -31,7 +31,16 @@ public interface AccountService extends IService<ChDisabAccounts> {
List<ChDisabDetailAccountsResp> queryOrganAccountsDetail(String id); Page<ChDisabDetailAccountsResp> queryOrganAccountsDetail(Integer pageNum, Integer pageSize,String accountsId,Integer status);
Page<NursingRecordsRespVO> queryNursingRecords(Integer pageNum, Integer pageSize, String taskDetailId);
OverallEduceDecreaseCostRespVO queryOverallCostRecords(OverallCostReqVO req);
Page<OverallCostListRespVO> queryOverallCostList(OverallCostReqVO req);
int overallCostSubmit(OverallCostSubmitReqVO req);
int updateChDisabAccounts(int id); int updateChDisabAccounts(int id);
...@@ -39,4 +48,10 @@ public interface AccountService extends IService<ChDisabAccounts> { ...@@ -39,4 +48,10 @@ public interface AccountService extends IService<ChDisabAccounts> {
void organAccountTaskExecute(List<AccountTaskExecuteReqVO> accountTaskExecuteReqVOS); void organAccountTaskExecute(List<AccountTaskExecuteReqVO> accountTaskExecuteReqVOS);
void otherPlaceHandler(String programId); void otherPlaceHandler(String programId);
int deleteAccountsDetail(Long accountsDetailId);
int accountsFreeCommit(Long accountsDetailId);
int delayAccountCommit(Long accountsDetailId,Short status);
} }
...@@ -15,9 +15,7 @@ import com.hungraim.ltc.api.AttachFeignService; ...@@ -15,9 +15,7 @@ import com.hungraim.ltc.api.AttachFeignService;
import com.hungraim.ltc.pojo.entity.SysConfig.ChCfgCareService; import com.hungraim.ltc.pojo.entity.SysConfig.ChCfgCareService;
import com.hungraim.ltc.pojo.entity.SysConfig.ChCfgCostStandard; import com.hungraim.ltc.pojo.entity.SysConfig.ChCfgCostStandard;
import com.hungraim.ltc.pojo.entity.SysConfig.ChFndAttach; import com.hungraim.ltc.pojo.entity.SysConfig.ChFndAttach;
import com.hungraim.ltc.pojo.entity.account.ChDisabAccounts; import com.hungraim.ltc.pojo.entity.account.*;
import com.hungraim.ltc.pojo.entity.account.ChDisabDetailAccounts;
import com.hungraim.ltc.pojo.entity.account.ChDisabDetailAccountsResp;
import com.hungraim.ltc.pojo.entity.serviceManage.ChSrvTaskDetail; import com.hungraim.ltc.pojo.entity.serviceManage.ChSrvTaskDetail;
import com.hungraim.ltc.pojo.entity.serviceManage.ChSrvTaskFinishItem; import com.hungraim.ltc.pojo.entity.serviceManage.ChSrvTaskFinishItem;
import com.hungraim.ltc.pojo.vo.account.*; import com.hungraim.ltc.pojo.vo.account.*;
...@@ -53,12 +51,8 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis ...@@ -53,12 +51,8 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
private final ChCfgCostStandardMapper chCfgCostStandardMapper; private final ChCfgCostStandardMapper chCfgCostStandardMapper;
private final ChDisabAccountsDetailMapper chDisabAccountsDetailMapper; private final ChDisabAccountsDetailMapper chDisabAccountsDetailMapper;
/*
private final ChAssessDetailAccountsMapper chAssessDetailAccountsMapper;
*/
private final ChDisabDetailAccountsMapper chDisabDetailAccountsMapper;
private final ChSrvTaskDetailMapper chSrvTaskDetailMapper; private final ChSrvTaskDetailMapper chSrvTaskDetailMapper;
private final ChSrvTaskFinishItemMapper chSrvTaskFinishItemMapper;; private final ChSrvTaskFinishItemMapper chSrvTaskFinishItemMapper;;
...@@ -72,6 +66,19 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis ...@@ -72,6 +66,19 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
BeanUtils.copyProperties(accountOperVo, chDisabAccounts); BeanUtils.copyProperties(accountOperVo, chDisabAccounts);
chDisabAccounts.setChooseSettle((short) 0); // 是否结算(0未结算,1已结算) chDisabAccounts.setChooseSettle((short) 0); // 是否结算(0未结算,1已结算)
this.saveOrUpdate(chDisabAccounts); this.saveOrUpdate(chDisabAccounts);
Short accountsStatus = accountOperVo.getAccountsStatus();
String accountsId = String.valueOf(accountOperVo.getAccountsId());
if(accountsStatus == 2) {
chDisabAccountsDetailMapper.updateByAccountsId(accountsId);
}
if(accountsStatus == 3) {
ChDisabAccounts chDisabAccountDTO = disabAccountsMapper.selectById(accountOperVo.getAccountsId());
BigDecimal reissueAmountTotal = chDisabAccountDTO.getReissueAmountTotal();
BigDecimal deductionAmountTotal = chDisabAccountDTO.getDeductionAmountTotal();
BigDecimal totalAllocatedExpenses = chDisabAccountDTO.getAllCost().add(reissueAmountTotal).subtract(deductionAmountTotal);
chDisabAccountDTO.setTotalAllocatedExpenses(totalAllocatedExpenses);
disabAccountsMapper.updateById(chDisabAccountDTO);
}
accountOperVo.setAccountsId(chDisabAccounts.getAccountsId()); accountOperVo.setAccountsId(chDisabAccounts.getAccountsId());
baseAccountService.updateAttachs(chDisabAccounts.getAccountsId(), accountOperVo.getFileDataList(), AttachType.SRV_ORGAN_ACCOUNT); baseAccountService.updateAttachs(chDisabAccounts.getAccountsId(), accountOperVo.getFileDataList(), AttachType.SRV_ORGAN_ACCOUNT);
} }
...@@ -85,7 +92,7 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis ...@@ -85,7 +92,7 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
@Override @Override
public Page<SrvOrganAccountListResp> searchSrvOrganAccountList(SrvOrganListReq srvOrganListReq) { public Page<SrvOrganAccountListResp> searchSrvOrganAccountList(SrvOrganListReq srvOrganListReq) {
List<Long> organIds = baseAccountService.getOrganIds(srvOrganListReq.getOrganId(), srvOrganListReq.getIsInvolveChild()); List<Long> organIds = baseAccountService.getOrganIds(srvOrganListReq.getOrganId(), srvOrganListReq.getIsInvolveChild());
return chDisabAccountsDetailMapper.searchSrvOrganAccountList(new Page<>(srvOrganListReq.getPageNum(), srvOrganListReq.getPageSize()), organIds, srvOrganListReq); return disabAccountsMapper.searchSrvOrganAccountList(new Page<>(srvOrganListReq.getPageNum(), srvOrganListReq.getPageSize()), organIds, srvOrganListReq);
} }
...@@ -400,24 +407,14 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis ...@@ -400,24 +407,14 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
//求当月最后一天 //求当月最后一天
private Date getLastDayOfMonth(Date date) { private Date getLastDayOfMonth(Date date) {
Calendar cale = Calendar.getInstance(); Calendar cale = Calendar.getInstance();
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
cale.setTime(date); cale.setTime(date);
cale.add(Calendar.MONTH, 1); cale.add(Calendar.MONTH, 1);
cale.set(Calendar.DAY_OF_MONTH, 0); cale.set(Calendar.DAY_OF_MONTH, 0);
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) {
...@@ -449,8 +446,65 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis ...@@ -449,8 +446,65 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
@Override @Override
public List<ChDisabDetailAccountsResp> queryOrganAccountsDetail(String id) { public Page<ChDisabDetailAccountsResp> queryOrganAccountsDetail(Integer pageNum, Integer pageSize,String accountsId,Integer status) {
return chDisabDetailAccountsMapper.queryOrganAccountsDetail(id); return chDisabAccountsDetailMapper.queryOrganAccountsDetail(new Page<>(pageNum, pageSize),accountsId,status);
}
@Override
public Page<NursingRecordsRespVO> queryNursingRecords(Integer pageNum, Integer pageSize, String taskDetailId) {
return chDisabAccountsDetailMapper.queryNursingRecords(new Page<>(pageNum, pageSize),taskDetailId);
}
@Override
public OverallEduceDecreaseCostRespVO queryOverallCostRecords(OverallCostReqVO req) {
return chDisabAccountsDetailMapper.queryOverallCostRecords(req);
}
@Override
public Page<OverallCostListRespVO> queryOverallCostList(OverallCostReqVO req) {
req.setDealType((null ==req.getDealType()||0==req.getDealType())? null : req.getDealType());
Page<OverallCostListRespVO> overallCostListRespVOPage = chDisabAccountsDetailMapper.queryOverallCostList(new Page<>(req.getPageNum(), req.getPageSize()), req);
List<OverallCostListRespVO> records = overallCostListRespVOPage.getRecords();
for (OverallCostListRespVO record : records) {
int dealType = record.getDealType();
if (dealType == 1) {
record.setAmountOfMoney(record.getReissueAmount());
}else if(dealType == 2) {
record.setAmountOfMoney(record.getDeductionAmount());
}
}
return overallCostListRespVOPage;
}
@Override
public int overallCostSubmit(OverallCostSubmitReqVO req){
ChDisabDetailAccounts chDisabDetailAccounts = new ChDisabDetailAccounts();
int dealType = req.getDealType();
chDisabDetailAccounts.setAccountsDetailId(req.getAccountsDetailId());
Long accountsId = req.getAccountsId();
ChDisabAccounts chDisabAccounts = disabAccountsMapper.selectById(accountsId);
BigDecimal deductionAmountTotal = chDisabAccounts.getDeductionAmountTotal();
BigDecimal reissueAmountTotal = chDisabAccounts.getReissueAmountTotal();
chDisabDetailAccounts.setDealType(dealType);
String amountOfMoneyStr = req.getAmountOfMoney();
BigDecimal amountOfMoney = new BigDecimal(amountOfMoneyStr);
if(dealType == 1){
// 补发
chDisabDetailAccounts.setReissueAmount(amountOfMoney);
reissueAmountTotal = reissueAmountTotal.add(amountOfMoney);
}else if(dealType == 2){
// 扣减
chDisabDetailAccounts.setDeductionAmount(amountOfMoney);
deductionAmountTotal = deductionAmountTotal.add(amountOfMoney);
}
chDisabDetailAccounts.setRemarks(req.getRemarks());
int result = chDisabAccountsDetailMapper.updateById(chDisabDetailAccounts);
chDisabAccounts.setReissueAmountTotal(reissueAmountTotal);
chDisabAccounts.setDeductionAmountTotal(deductionAmountTotal);
disabAccountsMapper.updateById(chDisabAccounts);
return result;
} }
@Override @Override
...@@ -473,11 +527,11 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis ...@@ -473,11 +527,11 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
} }
@Override @Override
@Transactional(rollbackFor = Exception.class)
public void organAccountTaskExecute(List<AccountTaskExecuteReqVO> accountTaskExecuteReqVOS) { public void organAccountTaskExecute(List<AccountTaskExecuteReqVO> accountTaskExecuteReqVOS) {
if (CollectionUtil.isEmpty(accountTaskExecuteReqVOS)) { if (CollectionUtil.isEmpty(accountTaskExecuteReqVOS)) {
return; return;
} }
List<String> taskDetailIds = accountTaskExecuteReqVOS.stream().map(AccountTaskExecuteReqVO::getTaskDetailId).distinct().collect(Collectors.toList()); List<String> taskDetailIds = accountTaskExecuteReqVOS.stream().map(AccountTaskExecuteReqVO::getTaskDetailId).distinct().collect(Collectors.toList());
// 根据任务id查找结算详情,还没有对应的任务数据说明还未发生过结算,进行插入详情表和结算表 // 根据任务id查找结算详情,还没有对应的任务数据说明还未发生过结算,进行插入详情表和结算表
List<ChDisabDetailAccounts> chDisabDetailList = chDisabAccountsDetailMapper.queryAccountByCondition(taskDetailIds); List<ChDisabDetailAccounts> chDisabDetailList = chDisabAccountsDetailMapper.queryAccountByCondition(taskDetailIds);
...@@ -544,15 +598,18 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis ...@@ -544,15 +598,18 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
BigDecimal personalCost = limit.multiply(personalPercent); BigDecimal personalCost = limit.multiply(personalPercent);
chDisabDetailAccounts.setAccountsPersonalCost(personalCost); chDisabDetailAccounts.setAccountsPersonalCost(personalCost);
chDisabDetailAccounts.setModeName(accountsVO.getSrvModeName()); chDisabDetailAccounts.setModeName(accountsVO.getSrvModeName());
chDisabDetailAccounts.setEmpId(accountsVO.getEmpId());
chDisabDetailAccounts.setCreationTime(new Date()); chDisabDetailAccounts.setCreationTime(new Date());
// 结算时间为任务时间 // 结算时间为任务时间
chDisabDetailAccounts.setAccountsTime(DateUtils.strToTime(accountsVO.getSrvDate())); chDisabDetailAccounts.setAccountsTime(DateUtils.strToDate(accountsVO.getSrvDate()));
//chDisabDetailAccounts.setAccountsStartTime(DateUtils.strToTime(accountsVO.getSrvStartTime())); chDisabDetailAccounts.setAccountsStartTime(DateUtils.getFirstDayOfMonth(DateUtils.strToDate(accountsVO.getSrvDate())));
//chDisabDetailAccounts.setAccountsEndTime(DateUtils.strToTime(accountsVO.getSrvEndTime())); chDisabDetailAccounts.setAccountsEndTime(DateUtils.getlastDayOfMonth(DateUtils.strToDate(accountsVO.getSrvDate())));
chDisabDetailAccounts.setTaskDetailId(accountsVO.getTaskDetailId()); chDisabDetailAccounts.setTaskDetailId(accountsVO.getTaskDetailId());
chDisabDetailAccounts.setMedicalArea(accountsVO.getMedicalArea()); chDisabDetailAccounts.setMedicalArea(accountsVO.getMedicalArea());
chDisabDetailAccounts.setItemIds(accountsVO.getItemId());
chDisabDetailAccounts.setDisabInfoId(accountsVO.getDisabInfoId()); chDisabDetailAccounts.setDisabInfoId(accountsVO.getDisabInfoId());
chDisabDetailAccounts.setStatus((short)0);
chDisabDetailAccounts.setReissueAmount(BigDecimal.valueOf(0));
chDisabDetailAccounts.setDeductionAmount(BigDecimal.valueOf(0));
ChDisabAccounts chDisabAccounts = getChDisabAccounts(accountsVO, limit, overallCost, personalCost); ChDisabAccounts chDisabAccounts = getChDisabAccounts(accountsVO, limit, overallCost, personalCost);
chDisabDetailAccounts.setAccountsId(chDisabAccounts.getAccountsId()); chDisabDetailAccounts.setAccountsId(chDisabAccounts.getAccountsId());
chDisabAccountsDetailMapper.insert(chDisabDetailAccounts); chDisabAccountsDetailMapper.insert(chDisabDetailAccounts);
...@@ -562,29 +619,21 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis ...@@ -562,29 +619,21 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
private ChDisabAccounts getChDisabAccounts(OrganAccountsVO accountsVO, BigDecimal limit, BigDecimal overallCost, BigDecimal personalCost) { 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()); ChDisabAccounts chDisabAccounts = disabAccountsMapper.queryAccountByCondition(DateUtils.dateToStrYm(DateUtils.strToDate(accountsVO.getSrvDate())), accountsVO.getSrvModeName(), accountsVO.getSrvOrganId(),null);
if(chDisabAccounts == null) { if(chDisabAccounts == null) {
chDisabAccounts = new ChDisabAccounts(); chDisabAccounts = new ChDisabAccounts();
chDisabAccounts.setModeName(accountsVO.getSrvModeName()); chDisabAccounts.setModeName(accountsVO.getSrvModeName());
chDisabAccounts.setAccountsTime(DateUtils.strToTime(accountsVO.getSrvDate())); chDisabAccounts.setAccountsTime(DateUtils.strToTime(accountsVO.getSrvDate()));
chDisabAccounts.setSrvOrganId(Long.valueOf(accountsVO.getSrvOrganId())); chDisabAccounts.setSrvOrganId(Long.valueOf(accountsVO.getSrvOrganId()));
chDisabAccounts.setCreationTime(new Date()); chDisabAccounts.setCreationTime(new Date());
chDisabAccounts.setAccountsStatus((short) 1); chDisabAccounts.setAccountsStatus((short) 0);
chDisabAccounts.setAllCost(String.valueOf(limit)); BigDecimal zero = BigDecimal.valueOf(0);
chDisabAccounts.setOverallCost(String.valueOf(overallCost)); chDisabAccounts.setAllCost(zero);
chDisabAccounts.setPersonalCost(String.valueOf(personalCost)); chDisabAccounts.setOverallCost(zero);
chDisabAccounts.setPersonalCost(zero);
chDisabAccounts.setReissueAmountTotal(zero);
chDisabAccounts.setDeductionAmountTotal(zero);
disabAccountsMapper.insert(chDisabAccounts); disabAccountsMapper.insert(chDisabAccounts);
}else {
String allCostStr = chDisabAccounts.getAllCost();
String overallCostStr = chDisabAccounts.getOverallCost();
String personalCostStr = chDisabAccounts.getPersonalCost();
BigDecimal allCostBig = new BigDecimal(allCostStr).add(limit);
BigDecimal overallCostBig = new BigDecimal(overallCostStr).add(overallCost);
BigDecimal personalCostBig = new BigDecimal(personalCostStr).add(personalCost);
chDisabAccounts.setAllCost(allCostBig.toString());
chDisabAccounts.setOverallCost(String.valueOf(overallCostBig));
chDisabAccounts.setPersonalCost(String.valueOf(personalCostBig));
disabAccountsMapper.updateById(chDisabAccounts);
} }
return chDisabAccounts; return chDisabAccounts;
} }
...@@ -595,20 +644,22 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis ...@@ -595,20 +644,22 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
for (OrganAccountsVO accountsVO : accountsList) { for (OrganAccountsVO accountsVO : accountsList) {
ChDisabDetailAccounts chDisabDetailAccounts = new ChDisabDetailAccounts(); ChDisabDetailAccounts chDisabDetailAccounts = new ChDisabDetailAccounts();
chDisabDetailAccounts.setSrvOrganId(accountsVO.getSrvOrganId()); chDisabDetailAccounts.setSrvOrganId(accountsVO.getSrvOrganId());
// 要判断是养老还是医疗,因为费用不一样 // 异地
BigDecimal limit = BigDecimal.valueOf(20); BigDecimal limit = BigDecimal.valueOf(20);
BigDecimal zero = BigDecimal.valueOf(0); BigDecimal zero = BigDecimal.valueOf(0);
chDisabDetailAccounts.setAccountsAllCost(limit); chDisabDetailAccounts.setAccountsAllCost(limit);
chDisabDetailAccounts.setAccountsPersonalCost(zero); chDisabDetailAccounts.setAccountsPersonalCost(zero);
chDisabDetailAccounts.setAccountsOverallCost(zero); chDisabDetailAccounts.setAccountsOverallCost(zero);
chDisabDetailAccounts.setReissueAmount(zero);
chDisabDetailAccounts.setDeductionAmount(zero);
chDisabDetailAccounts.setStatus((short)0);
chDisabDetailAccounts.setModeName(accountsVO.getSrvModeName()); chDisabDetailAccounts.setModeName(accountsVO.getSrvModeName());
chDisabDetailAccounts.setCreationTime(new Date()); chDisabDetailAccounts.setCreationTime(new Date());
chDisabDetailAccounts.setAccountsTime(DateUtils.strToDate(accountsVO.getSrvDate())); chDisabDetailAccounts.setAccountsTime(DateUtils.strToDate(accountsVO.getSrvDate()));
chDisabDetailAccounts.setAccountsStartTime(DateUtils.strToTime(accountsVO.getSrvStartTime())); chDisabDetailAccounts.setAccountsStartTime(DateUtils.getFirstDayOfMonth(DateUtils.strToDate(accountsVO.getSrvDate())));
chDisabDetailAccounts.setAccountsEndTime(DateUtils.strToTime(accountsVO.getSrvEndTime())); chDisabDetailAccounts.setAccountsEndTime(DateUtils.getlastDayOfMonth(DateUtils.strToDate(accountsVO.getSrvDate())));
chDisabDetailAccounts.setTaskDetailId(accountsVO.getTaskDetailId()); chDisabDetailAccounts.setTaskDetailId(accountsVO.getTaskDetailId());
chDisabDetailAccounts.setMedicalArea(accountsVO.getMedicalArea()); chDisabDetailAccounts.setMedicalArea(accountsVO.getMedicalArea());
chDisabDetailAccounts.setItemIds(accountsVO.getItemId());
chDisabDetailAccounts.setDisabInfoId(accountsVO.getDisabInfoId()); chDisabDetailAccounts.setDisabInfoId(accountsVO.getDisabInfoId());
ChDisabAccounts chDisabAccounts = getChDisabAccounts(accountsVO, limit, zero, zero); ChDisabAccounts chDisabAccounts = getChDisabAccounts(accountsVO, limit, zero, zero);
chDisabDetailAccounts.setAccountsId(chDisabAccounts.getAccountsId()); chDisabDetailAccounts.setAccountsId(chDisabAccounts.getAccountsId());
...@@ -616,4 +667,128 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis ...@@ -616,4 +667,128 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
} }
} }
@Override
@Transactional(rollbackFor = Exception.class)
public int deleteAccountsDetail(Long accountsDetailId){
ChDisabDetailAccounts chDisabDetailAccounts = new ChDisabDetailAccounts();
chDisabDetailAccounts.setDeductionAmount(BigDecimal.valueOf(0));
chDisabDetailAccounts.setReissueAmount(BigDecimal.valueOf(0));
chDisabDetailAccounts.setDealType(0);
chDisabDetailAccounts.setAccountsDetailId(accountsDetailId);
int result = chDisabAccountsDetailMapper.updateById(chDisabDetailAccounts);
return result;
}
@Override
@Transactional(rollbackFor = Exception.class)
public int accountsFreeCommit(Long accountsDetailId){
ChDisabDetailAccounts chDisabDetailAccountsDTO = chDisabAccountsDetailMapper.selectById(accountsDetailId);
BigDecimal allCost = chDisabDetailAccountsDTO.getAccountsAllCost();
BigDecimal overallCost = chDisabDetailAccountsDTO.getAccountsOverallCost();
BigDecimal personalCost = chDisabDetailAccountsDTO.getAccountsPersonalCost();
Long accountsId = chDisabDetailAccountsDTO.getAccountsId();
ChDisabAccounts chDisabAccountDTO = disabAccountsMapper.selectById(accountsId);
if(chDisabAccountDTO !=null){
BigDecimal accountAllCost = chDisabAccountDTO.getAllCost();
BigDecimal accountOverallCost = chDisabAccountDTO.getOverallCost();
BigDecimal accountPersonalCost = chDisabAccountDTO.getPersonalCost();
chDisabAccountDTO.setAllCost(accountAllCost.add(allCost));
chDisabAccountDTO.setOverallCost(accountOverallCost.add(overallCost));
chDisabAccountDTO.setPersonalCost(accountPersonalCost.add(personalCost));
chDisabAccountDTO.setAccountsStatus((short)1);
disabAccountsMapper.updateById(chDisabAccountDTO);
}
ChDisabDetailAccounts chDisabDetailAccounts = new ChDisabDetailAccounts();
chDisabDetailAccounts.setAccountsDetailId(accountsDetailId);
chDisabDetailAccounts.setStatus(((short)1));
int result = chDisabAccountsDetailMapper.updateById(chDisabDetailAccounts);
return result;
}
@Override
public int delayAccountCommit(Long accountsDetailId,Short status){
// 暂缓需要将当月的钱减掉
ChDisabDetailAccounts chDisabDetailAccountDTO = chDisabAccountsDetailMapper.selectById(accountsDetailId);
Long accountsId = chDisabDetailAccountDTO.getAccountsId();
BigDecimal accountsAllCost = chDisabDetailAccountDTO.getAccountsAllCost();
BigDecimal accountsOverallCost = chDisabDetailAccountDTO.getAccountsOverallCost();
BigDecimal accountsPersonalCost = chDisabDetailAccountDTO.getAccountsPersonalCost();
ChDisabAccounts chDisabAccountDTO = disabAccountsMapper.selectById(accountsId);
BigDecimal allCost = chDisabAccountDTO.getAllCost();
BigDecimal overallCost = chDisabAccountDTO.getOverallCost();
BigDecimal personalCost = chDisabAccountDTO.getPersonalCost();
// 暂缓
if(status == 2){
allCost = allCost.subtract(accountsAllCost);
overallCost = overallCost.subtract(accountsOverallCost);
personalCost = personalCost.subtract(accountsPersonalCost);
ChDisabAccounts chDisabAccount = new ChDisabAccounts();
chDisabAccount.setAllCost(allCost);
chDisabAccount.setOverallCost(overallCost);
chDisabAccount.setPersonalCost(personalCost);
chDisabAccount.setAccountsId(accountsId);
disabAccountsMapper.updateById(chDisabAccount);
// 恢复
}else if(status == 1){
// 判断恢复时间是否和之前结算时间在同一个月,如果在同一个月把金额加回来,如果不在同一个月,改变结算月份,恢复的时候重新插入一条
//结算记录
Date accountsTime = chDisabDetailAccountDTO.getAccountsTime();
Boolean aBoolean = DateUtils.inCurrentMonth(accountsTime);
if(aBoolean){
allCost = allCost.add(accountsAllCost);
overallCost = overallCost.add(accountsOverallCost);
personalCost = personalCost.add(accountsPersonalCost);
ChDisabAccounts chDisabAccount = new ChDisabAccounts();
chDisabAccount.setAllCost(allCost);
chDisabAccount.setOverallCost(overallCost);
chDisabAccount.setPersonalCost(personalCost);
chDisabAccount.setAccountsId(accountsId);
disabAccountsMapper.updateById(chDisabAccount);
}else {
// 结算表加一个是否暂缓字段 1 暂缓
ChDisabAccounts chDisabAccounts = disabAccountsMapper.queryAccountByCondition(DateUtils.dateToStrYm(new Date()), chDisabDetailAccountDTO.getModeName(), chDisabDetailAccountDTO.getSrvOrganId(),2);
if (chDisabAccounts == null) {
chDisabAccounts = new ChDisabAccounts();
chDisabAccounts.setIsDelay((short)2);
chDisabAccounts.setAccountsStatus((short)1);
chDisabAccounts.setSrvOrganId(Long.valueOf(chDisabDetailAccountDTO.getSrvOrganId()));
chDisabAccounts.setCreationTime(new Date());
chDisabAccounts.setAccountsTime(new Date());
chDisabAccounts.setModeName(chDisabDetailAccountDTO.getModeName());
chDisabAccounts.setDeductionAmountTotal(chDisabDetailAccountDTO.getDeductionAmount());
chDisabAccounts.setReissueAmountTotal(chDisabDetailAccountDTO.getReissueAmount());
chDisabAccounts.setAllCost(chDisabDetailAccountDTO.getAccountsAllCost());
chDisabAccounts.setOverallCost(chDisabDetailAccountDTO.getAccountsOverallCost());
chDisabAccounts.setPersonalCost(chDisabDetailAccountDTO.getAccountsPersonalCost());
chDisabAccounts.setSvrStartTime(chDisabDetailAccountDTO.getAccountsStartTime());
chDisabAccounts.setSvrEndTime(chDisabDetailAccountDTO.getAccountsEndTime());
chDisabAccounts.setTotalAllocatedExpenses(BigDecimal.valueOf(0));
disabAccountsMapper.insert(chDisabAccounts);
accountsId = chDisabAccounts.getAccountsId();
}else {
BigDecimal allCost1 = chDisabAccounts.getAllCost();
BigDecimal overallCost1 = chDisabAccounts.getOverallCost();
BigDecimal personalCost1 = chDisabAccounts.getPersonalCost();
allCost1 = allCost1.add(accountsAllCost);
overallCost1 = overallCost1.add(accountsOverallCost);
personalCost1 = personalCost1.add(accountsPersonalCost);
ChDisabAccounts chDisabAccount = new ChDisabAccounts();
chDisabAccount.setAllCost(allCost1);
chDisabAccount.setOverallCost(overallCost1);
chDisabAccount.setPersonalCost(personalCost1);
chDisabAccount.setAccountsId(accountsId);
disabAccountsMapper.updateById(chDisabAccount);
}
}
}
ChDisabDetailAccounts chDisabDetailAccounts = new ChDisabDetailAccounts();
chDisabDetailAccounts.setAccountsDetailId(accountsDetailId);
chDisabDetailAccounts.setStatus(status);
chDisabDetailAccounts.setAccountsId(accountsId);
int result = chDisabAccountsDetailMapper.updateById(chDisabDetailAccounts);
return result;
}
} }
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
left join ch_srv_organ organ on program.srv_organ_id = organ.srv_organ_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 LEFT JOIN CH_SRV_TASK_FINISH_ITEM CSTFI ON detail.TASK_DETAIL_ID = CSTFI.TASK_DETAIL_ID
<where> <where>
detail.STATUS = '4' detail.STATUS = '4'
<if test="taskDetailId != null and taskDetailId != ''"> <if test="taskDetailId != null and taskDetailId != ''">
AND detail.TASK_DETAIL_ID = #{taskDetailId} AND detail.TASK_DETAIL_ID = #{taskDetailId}
</if> </if>
...@@ -56,31 +56,31 @@ ...@@ -56,31 +56,31 @@
<!--查询评估信息--> <!--查询评估信息-->
<select id="getAssessAccountsList" resultType="com.hungraim.ltc.pojo.vo.account.AssessAccountsVO"> <select id="getAssessAccountsList" resultType="com.hungraim.ltc.pojo.vo.account.AssessAccountsVO">
select select
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_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_CITY = dis.DISTRICT_CODE) districtCity,
(select DISTRICT_NAME from CH_FND_DISTRICT dis where task.DISTRICT_AREA = dis.DISTRICT_CODE) districtArea, (select DISTRICT_NAME from CH_FND_DISTRICT dis where task.DISTRICT_AREA = dis.DISTRICT_CODE) districtArea,
disable.real_name realName, disable.real_name realName,
disable.certi_code certiCode, disable.certi_code certiCode,
disable.BIRTHDAY birthday, disable.BIRTHDAY birthday,
disable.tel tel, disable.tel tel,
disable.gender gender, 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_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_city = dis.DISTRICT_CODE) disDistrictCity,
(SELECT dis.DISTRICT_NAME FROM CH_FND_DISTRICT dis WHERE disable.district_area = dis.DISTRICT_CODE) disDistrictArea, (SELECT dis.DISTRICT_NAME FROM CH_FND_DISTRICT dis WHERE disable.district_area = dis.DISTRICT_CODE) disDistrictArea,
disable.end_time endTime, 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
left join ch_apr_organ aprOrgan on task.apr_organ_id = aprOrgan.apr_organ_id left join ch_apr_organ aprOrgan on task.apr_organ_id = aprOrgan.apr_organ_id
left join ch_disable_info disable on task.disable_info_id = disable.disab_info_id left join ch_disable_info disable on task.disable_info_id = disable.disab_info_id
left join ch_apr_emp emp on task.apr_emp_id = emp.emp_id and emp.IS_LOCK = 0 left join ch_apr_emp emp on task.apr_emp_id = emp.emp_id and emp.IS_LOCK = 0
left join ch_apr_report report on report.TASK_ID = task.TASK_ID left join ch_apr_report report on report.TASK_ID = task.TASK_ID
left join CH_FND_ORGAN fndOrgan on task.ORGAN_ID = fndOrgan.ORGAN_ID left join CH_FND_ORGAN fndOrgan on task.ORGAN_ID = fndOrgan.ORGAN_ID
where task.task_status = 2 and emp.APREMP_TYPE_NAME_F is not null where task.task_status = 2 and emp.APREMP_TYPE_NAME_F is not null
</select> </select>
...@@ -124,62 +124,62 @@ ...@@ -124,62 +124,62 @@
<select id="searchSrvOrganAccountDetailExport" resultType="com.hungraim.ltc.pojo.vo.account.AccountExportDetailListResp"> <select id="searchSrvOrganAccountDetailExport" resultType="com.hungraim.ltc.pojo.vo.account.AccountExportDetailListResp">
select select
t3.SRV_ORGAN_NAME srvOrganName, t3.SRV_ORGAN_NAME srvOrganName,
to_char(t1.ACCOUNTS_TIME,'yyyy-MM') accountsTime, to_char(t1.ACCOUNTS_TIME,'yyyy-MM') accountsTime,
t1.ACCOUNTS_ALL_COST accountsAllCost, t1.ACCOUNTS_ALL_COST accountsAllCost,
t1.ACCOUNTS_OVERALL_COST accountsOverallCost, t1.ACCOUNTS_OVERALL_COST accountsOverallCost,
t1.ACCOUNTS_PERSONAL_COST accountsPersonalCost, t1.ACCOUNTS_PERSONAL_COST accountsPersonalCost,
to_char(t1.ACCOUNTS_START_TIME,'yyyy-MM-dd') accountsStartTime, to_char(t1.ACCOUNTS_START_TIME,'yyyy-MM-dd') accountsStartTime,
to_char(t1.ACCOUNTS_END_TIME,'yyyy-MM-dd') accountsEndTime to_char(t1.ACCOUNTS_END_TIME,'yyyy-MM-dd') accountsEndTime
from CH_DISAB_ACCOUNTS_DETAIL t1 from CH_DISAB_ACCOUNTS_DETAIL t1
left join ch_disable_info t2 on t1.disab_info_id = t2.disab_info_id 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 LEFT JOIN CH_SRV_ORGAN t3 ON t1.SRV_ORGAN_ID = t3.SRV_ORGAN_ID
where t1.ACCOUNTS_ID = #{accountsId} where t1.ACCOUNTS_ID = #{accountsId}
</select> </select>
<select id="getOtherPlaceList" resultType="com.hungraim.ltc.pojo.vo.account.OrganAccountsVO"> <select id="getOtherPlaceList" resultType="com.hungraim.ltc.pojo.vo.account.OrganAccountsVO">
select select
detail.TASK_DETAIL_ID taskDetailId, detail.TASK_DETAIL_ID taskDetailId,
--失能人员姓名 --失能人员姓名
disable.real_name realName, disable.real_name realName,
disable.DISAB_INFO_ID disabInfoId, disable.DISAB_INFO_ID disabInfoId,
--身份证号 --身份证号
disable.CERTI_CODE certiCode, disable.CERTI_CODE certiCode,
--所在省市 --所在省市
(select district_name from ch_fnd_district dis where apply.MEDICAL_AREA = dis.district_code) medicalArea, (select district_name from ch_fnd_district dis where apply.MEDICAL_AREA = dis.district_code) medicalArea,
mode1.MODE_ID modeId, mode1.MODE_ID modeId,
--服务方式 --服务方式
mode1.mode_name srvModeName, mode1.mode_name srvModeName,
--护理机构名称 --护理机构名称
organ.srv_organ_id srvOrganId, organ.srv_organ_id srvOrganId,
--护理机构名称 --护理机构名称
organ.srv_organ_name srvOrganName, organ.srv_organ_name srvOrganName,
--护理服务人员 --护理服务人员
emp.emp_name empName, emp.emp_name empName,
--任务时间 --任务时间
detail.SRV_DATE srvDate, detail.SRV_DATE srvDate,
detail.SRV_START_TIME srvStartTime, detail.SRV_START_TIME srvStartTime,
detail.SRV_END_TIME srvEndTime, detail.SRV_END_TIME srvEndTime,
-- 机构等级 -- 机构等级
organ.LEVEL_CODE levelCode, organ.LEVEL_CODE levelCode,
-- 失能等级 -- 失能等级
level1.DISABLE_LEVEL_NAME disableLevelName level1.DISABLE_LEVEL_NAME disableLevelName
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_DISABLE_APPLY apply on apply.apply_id = disable.apply_id left join 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--服务方案
left join ch_srv_organ organ on program.srv_organ_id = organ.srv_organ_id--服务机构 left join ch_srv_organ organ on program.srv_organ_id = organ.srv_organ_id--服务机构
left join ch_cfg_srv_mode mode1 on program.srv_mode_id = mode1.mode_id--服务方式 left join ch_cfg_srv_mode mode1 on program.srv_mode_id = mode1.mode_id--服务方式
left join ch_srv_organ_emp emp on task.srv_emp_id = emp.emp_id--护理人员 left join ch_srv_organ_emp emp on task.srv_emp_id = emp.emp_id--护理人员
-- 失能等级 -- 失能等级
left join ch_cfg_srv_disable_level level1 on report.disable_level_id = level1.disable_level_id left join ch_cfg_srv_disable_level level1 on report.disable_level_id = level1.disable_level_id
where mode1.MODE_ID = '4' and level1.DISABLE_LEVEL_NAME like '重度%' and program.program_id = #{programId} where mode1.MODE_ID = '4' and level1.DISABLE_LEVEL_NAME like '重度%' and program.program_id = #{programId}
</select> </select>
</mapper> </mapper>
...@@ -17,15 +17,59 @@ ...@@ -17,15 +17,59 @@
</sql> </sql>
<select id="queryAccountByCondition" resultType="com.hungraim.ltc.pojo.entity.account.ChDisabAccounts"> <select id="queryAccountByCondition" resultType="com.hungraim.ltc.pojo.entity.account.ChDisabAccounts">
select * from CH_DISAB_ACCOUNTS t where t.MODE_NAME = #{modeName} select * from CH_DISAB_ACCOUNTS t where t.MODE_NAME = #{modeName}
and to_char(t.ACCOUNTS_TIME,'yyyy-MM') = #{accountsTime} and to_char(t.ACCOUNTS_TIME,'yyyy-MM') = #{accountsTime}
and t.SRV_ORGAN_ID = #{srvOrganId} and t.SRV_ORGAN_ID = #{srvOrganId}
<if test="isDelay !=null">
and t.IS_DELAY = 2
</if>
</select> </select>
<select id="searchSrvOrganAccountList" resultType="com.hungraim.ltc.pojo.vo.account.SrvOrganAccountListResp">
SELECT
t1.ACCOUNTS_ID,
t3.ORGAN_ID,
t3.ORGAN_NAME,
t2.SRV_ORGAN_ID,
t2.SRV_ORGAN_NAME,
t1.ACCOUNTS_TIME,
t1.ACCOUNTS_STATUS,
t1.ALL_COST,
t1.OVERALL_COST,
t1.PERSONAL_COST,
t1.SVR_START_TIME,
t1.MODE_NAME,
to_char(t1.SVR_START_TIME,'yyyy-MM-dd') svrStartTime,
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
FROM
CH_DISAB_ACCOUNTS t1
LEFT JOIN CH_SRV_ORGAN t2 ON t1.SRV_ORGAN_ID = t2.SRV_ORGAN_ID
LEFT JOIN CH_FND_ORGAN t3 ON t2.ORGAN_ID = t3.ORGAN_ID
<where>
t1.ACCOUNTS_STATUS !=0
<if test='organIds != null and organIds.size()>0'>
AND t3.ORGAN_ID IN
<foreach collection="organIds" open="(" close=")" item="organId" separator=",">
#{organId}
</foreach>
</if>
<if test='req.srvOrganId != null'>
AND t2.SRV_ORGAN_ID = #{req.srvOrganId}
</if>
<if test='req.accountsTime != null'>
AND t1.ACCOUNTS_TIME = #{req.accountsTime}
</if>
<if test="req.accountsStatus != null and req.accountsStatus != ''">
and t1.ACCOUNTS_STATUS = #{req.accountsStatus}
</if>
</where>
</select>
</mapper> </mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hungraim.ltc.account.dao.ChDisabDetailAccountsMapper">
<select id="queryOrganAccountsDetail" resultType="com.hungraim.ltc.pojo.entity.account.ChDisabDetailAccountsResp">
select
d.MODE_NAME modeName,
to_char(d.ACCOUNTS_START_TIME,'yyyy-MM-dd HH24:mi:ss') accountsStartTime,
to_char(d.ACCOUNTS_END_TIME,'yyyy-MM-dd HH24:mi:ss') accountsEndTime,
to_char(d.ACCOUNTS_TIME,'yyyy-MM') accountsTime,
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
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
where d.ACCOUNTS_ID = #{accountsId}
</select>
</mapper>
\ No newline at end of file
...@@ -18,13 +18,13 @@ ...@@ -18,13 +18,13 @@
left join ch_srv_organ_emp emp on plan.emp_id = emp.emp_id left join ch_srv_organ_emp emp on plan.emp_id = emp.emp_id
left join CH_SRV_ORGAN organ on organ.SRV_ORGAN_ID = plan.SRV_ORGAN_ID left join CH_SRV_ORGAN organ on organ.SRV_ORGAN_ID = plan.SRV_ORGAN_ID
<where> <where>
<if test="req.status != null"> <if test="req.status != null and req.status != ''">
and plan.IS_STATUS = #{req.status} and plan.IS_STATUS = #{req.status}
</if> </if>
<if test="req.realName != null"> <if test="req.realName != null and req.realName != ''">
AND info.real_name LIKE CONCAT('%',CONCAT(#{req.realName},'%')) AND info.real_name LIKE CONCAT('%',CONCAT(#{req.realName},'%'))
</if> </if>
<if test="req.srvOrganName != null"> <if test="req.srvOrganName != null and req.srvOrganName != ''">
AND organ.SRV_ORGAN_NAME LIKE CONCAT('%',CONCAT(#{req.srvOrganName},'%')) AND organ.SRV_ORGAN_NAME LIKE CONCAT('%',CONCAT(#{req.srvOrganName},'%'))
</if> </if>
</where> </where>
......
...@@ -9,6 +9,7 @@ import lombok.Data; ...@@ -9,6 +9,7 @@ import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable; import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
/** /**
...@@ -33,7 +34,7 @@ public class ChDisabAccounts implements Serializable { ...@@ -33,7 +34,7 @@ public class ChDisabAccounts implements Serializable {
/** /**
* 实拨总费用 * 实拨总费用
*/ */
private String totalAllocatedExpenses; private BigDecimal totalAllocatedExpenses;
/** /**
* 创建时间 * 创建时间
...@@ -52,7 +53,7 @@ public class ChDisabAccounts implements Serializable { ...@@ -52,7 +53,7 @@ public class ChDisabAccounts implements Serializable {
/** /**
* 应拨总费用 * 应拨总费用
*/ */
private String totalExpensesPayable; private BigDecimal totalExpensesPayable;
/** /**
* 是否结算(0未结算,1已结算) * 是否结算(0未结算,1已结算)
...@@ -60,7 +61,7 @@ public class ChDisabAccounts implements Serializable { ...@@ -60,7 +61,7 @@ public class ChDisabAccounts implements Serializable {
private Short chooseSettle; private Short chooseSettle;
/** /**
* 状态(0-待提交;1-待审核;2-已审核;3-已失效; * 状态(1 待审核 2 已审核 3 已结算
*/ */
private Short accountsStatus; private Short accountsStatus;
...@@ -90,17 +91,33 @@ public class ChDisabAccounts implements Serializable { ...@@ -90,17 +91,33 @@ public class ChDisabAccounts implements Serializable {
/** /**
* 总费用合计 * 总费用合计
*/ */
private String allCost; private BigDecimal allCost;
/** /**
* 统筹支出 * 统筹支出
*/ */
private String overallCost; private BigDecimal overallCost;
/** /**
* 个人支出 * 个人支出
*/ */
private String personalCost; private BigDecimal personalCost;
/**
*扣减金额合计
*/
private BigDecimal deductionAmountTotal;
/**
*补发金额
*/
private BigDecimal reissueAmountTotal;
/**
* 是否暂缓 2 暂缓
*/
private Short isDelay;
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
} }
\ No newline at end of file
...@@ -52,9 +52,16 @@ public class ChDisabDetailAccounts implements Serializable { ...@@ -52,9 +52,16 @@ public class ChDisabDetailAccounts implements Serializable {
*/ */
private BigDecimal accountsAllCost; private BigDecimal accountsAllCost;
/**
* 统筹费用
*/
private BigDecimal accountsOverallCost; private BigDecimal accountsOverallCost;
/**
* 个人支付
*/
private BigDecimal accountsPersonalCost; private BigDecimal accountsPersonalCost;
/** /**
* 服务方式 * 服务方式
*/ */
...@@ -64,16 +71,50 @@ public class ChDisabDetailAccounts implements Serializable { ...@@ -64,16 +71,50 @@ public class ChDisabDetailAccounts implements Serializable {
* 费用开始日期 * 费用开始日期
*/ */
private Date accountsStartTime; private Date accountsStartTime;
/** /**
* 费用结束日期 * 费用结束日期
*/ */
private Date accountsEndTime; private Date accountsEndTime;
/**
* 任务详情id
*/
private String taskDetailId; private String taskDetailId;
/**
* 护理人员id
*/
private Long empId;
/**
* 统筹区
*/
private String medicalArea; private String medicalArea;
private String itemIds; /**
*交易类型 1、补发 2、扣减
*/
private int dealType;
/**
*扣减金额
*/
private BigDecimal deductionAmount;
/**
*补发金额
*/
private BigDecimal reissueAmount;
/**
* 备注
*/
private String remarks;
/**
* 状态(1 恢复状态 2 暂缓状态 3)
*/
private Short status;
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
......
...@@ -35,6 +35,8 @@ public class ChDisabDetailAccountsResp implements Serializable { ...@@ -35,6 +35,8 @@ public class ChDisabDetailAccountsResp implements Serializable {
*/ */
private String modeName; private String modeName;
private String empName;
/** /**
* 费用开始日期 * 费用开始日期
*/ */
...@@ -51,5 +53,15 @@ public class ChDisabDetailAccountsResp implements Serializable { ...@@ -51,5 +53,15 @@ public class ChDisabDetailAccountsResp implements Serializable {
private String realName; private String realName;
private String taskDetailId;
private String deductionAmount;
private String reissueAmount;
private String accountsDetailId;
private Integer status;
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
} }
\ No newline at end of file
package com.hungraim.ltc.pojo.entity.account;
import lombok.Data;
/**
* @author zwl
* @ClassName NursingRecordsRespVO
* @description
* @date 2023/2/14 10:10
**/
@Data
public class NursingRecordsRespVO {
/**
* 护理机构
**/
private String srvOrganName;
/**
* 服务方式
**/
private String modeName;
/**
*执行日期
**/
private String executionTime;
/**
*任务名称
**/
private String itemName;
}
package com.hungraim.ltc.pojo.entity.account;
import lombok.Data;
/**
* @author zwl
* @ClassName OverallCostListRespVO
* @description
* @date 2023/2/14 21:10
**/
@Data
public class OverallCostListRespVO {
/**
*失能人员姓名
*/
private String realName;
/**
*身份证号
*/
private String certiCode;
/**
*医保统筹区
*/
private String medicalArea;
/**
* 费用开始时间
*/
private String svrStartTime;
/**
* 费用结束时间
*/
private String svrEndTime;
/**
*交易类型 1、补发 2、扣减
*/
private int dealType;
/**
*扣减金额
*/
private String deductionAmount;
/**
*补发金额
*/
private String reissueAmount;
private String amountOfMoney;
private String accountsDetailId;
private String accountsOverallCost;
private String srvOrganName;
}
package com.hungraim.ltc.pojo.entity.account;
import com.hungraim.ltc.pojo.vo.BaseReq;
import lombok.Data;
/**
* @author zwl
* @ClassName OverallCostReqVO
* @description
* @date 2023/2/14 15:11
**/
@Data
public class OverallCostReqVO extends BaseReq {
/**
*失能人员姓名
*/
private String realName;
/**
*身份证号
*/
private String certiCode;
/**
* 护理机构名称
*/
private String srvOrganName;
private String accountsTime;
private Integer dealType;
}
package com.hungraim.ltc.pojo.entity.account;
import lombok.Data;
/**
* @author zwl
* @ClassName OverallCostSubmitReqVO
* @description
* @date 2023/2/14 16:56
**/
@Data
public class OverallCostSubmitReqVO {
/**
* 结算详情Id
*/
private Long accountsDetailId;
private Long accountsId;
/**
* 交易类型 1、补发 2、扣减
*/
private int dealType;
/**
* 金额
*/
private String amountOfMoney;
/**
* 备注
*/
private String remarks;
}
package com.hungraim.ltc.pojo.entity.account;
import lombok.Data;
/**
* @author zwl
* @ClassName OverallEduceDecreaseCostRespVO
* @description
* @date 2023/2/14 15:11
**/
@Data
public class OverallEduceDecreaseCostRespVO {
/**
*失能人员姓名
*/
private String realName;
/**
*身份证号
*/
private String certiCode;
/**
*医保统筹区
*/
private String medicalArea;
/**
* 费用开始时间
*/
private String svrStartTime;
/**
* 费用结束时间
*/
private String svrEndTime;
/**
*交易类型 1、补发 2、扣减
*/
private int dealType;
/**
*扣减金额
*/
private String deductionAmount;
/**
*补发金额
*/
private String reissueAmount;
private String accountsDetailId;
private String accountsOverallCost;
private String srvOrganName;
private Long accountsId;
}
...@@ -49,9 +49,9 @@ public class OrganAccountsVO { ...@@ -49,9 +49,9 @@ public class OrganAccountsVO {
*/ */
private String medicalArea; private String medicalArea;
/** /**
* 护理服务人员 * 护理服务人员Id
*/ */
private String empName; private Long empId;
/** /**
* 任务时间 * 任务时间
*/ */
...@@ -70,10 +70,7 @@ public class OrganAccountsVO { ...@@ -70,10 +70,7 @@ public class OrganAccountsVO {
* 机构等级 * 机构等级
*/ */
private String levelCode; private String levelCode;
/**
* 失能等级
*/
private String disableLevelName;
/** /**
* 总费用 * 总费用
*/ */
......
...@@ -5,6 +5,7 @@ import lombok.Data; ...@@ -5,6 +5,7 @@ import lombok.Data;
import org.checkerframework.checker.units.qual.C; import org.checkerframework.checker.units.qual.C;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
@Data @Data
...@@ -81,5 +82,15 @@ public class SrvOrganAccountListResp { ...@@ -81,5 +82,15 @@ public class SrvOrganAccountListResp {
*/ */
private String totalAllocatedExpenses; private String totalAllocatedExpenses;
/**
*扣减金额总合计
*/
private String deductionAmountTotal;
/**
*补发总金额
*/
private String reissueAmountTotal;
} }
...@@ -39,4 +39,6 @@ public class SrvOrganListReq extends BaseReq { ...@@ -39,4 +39,6 @@ public class SrvOrganListReq extends BaseReq {
@JsonFormat(pattern = "yyyy-MM", timezone = "GMT+8") @JsonFormat(pattern = "yyyy-MM", timezone = "GMT+8")
private Date accountsTime; private Date accountsTime;
private String accountsStatus;
} }
...@@ -3,7 +3,6 @@ package com.hungraim.ltc.util; ...@@ -3,7 +3,6 @@ package com.hungraim.ltc.util;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import java.text.DateFormat;
import java.text.ParseException; import java.text.ParseException;
import java.text.ParsePosition; import java.text.ParsePosition;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
...@@ -879,27 +878,42 @@ public class DateUtils { ...@@ -879,27 +878,42 @@ public class DateUtils {
* *
* @return * @return
*/ */
public static String getlastMonth(){ public static Date getlastDayOfMonth(Date date){
SimpleDateFormat ym=new SimpleDateFormat(DATE_PATTERN_yyyy_MM_dd); Calendar cale = Calendar.getInstance();
Calendar calendar = Calendar.getInstance(); cale.setTime(date);
calendar.add(Calendar.MONTH,-1); cale.add(Calendar.MONTH, 1);
String lastMonth =ym.format(calendar.getTime()); cale.set(Calendar.DAY_OF_MONTH, 0);
return lastMonth; return cale.getTime();
} }
/** /**
* 获取当前月份的上个月 * 获取月份的第一天
* *
* @return * @return
*/ */
public static Date getlastMonth(String str){ public static Date getFirstDayOfMonth(Date date) {
DateFormat fmt =new SimpleDateFormat(DATE_PATTERN_yyyy_MM_dd); Calendar cale = Calendar.getInstance();
Date date = null; cale.setTime(date);
try { cale.add(Calendar.MONTH, 0);
date = fmt.parse(str); cale.set(Calendar.DAY_OF_MONTH, 1);
} catch (ParseException e) { return cale.getTime();
e.printStackTrace();
}
public static Boolean inCurrentMonth(Date date) {
Calendar cal1 = Calendar.getInstance();
Calendar cal2 = Calendar.getInstance();
//set the given date in date of the instance and current date in the other
cal1.setTime(date);
cal2.setTime(new Date());
//now compare the dates using methods on Calendar
if (cal1.get(Calendar.YEAR) == cal2.get(Calendar.YEAR)) {
if (cal1.get(Calendar.MONTH) == cal2.get(Calendar.MONTH)) {
return true;
}
} }
return date; return false;
} }
} }
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