Commit f8f1a058 authored by maqing's avatar maqing

Merge branch 'master' into dev_20230205_mq

parents f8beffc9 ceb180b5
......@@ -5,12 +5,13 @@ VOLUME /tmp
#容器使用端口
EXPOSE 8000
#添加jar包入容器
ADD ./apply/apply-service/target/apply-service-0.0.1.jar /apply.jar
ADD ./assessment/assessment-service/target/assessment-service-0.0.1.jar /assessment.jar
ADD ./auth-service/target/auth-0.0.1.jar /auth.jar
ADD ./gateway-service/target/gateway-0.0.1.jar /gateway.jar
ADD ./governance/target/governance-0.0.1.jar /governance.jar
ADD ./system/system-admin-service/target/system-admin-0.0.1.jar /system-admin.jar
ADD ./jar/apply-service-0.0.1.jar /apply.jar
ADD ./jar/assessment-service-0.0.1.jar /assessment.jar
ADD ./jar/auth-0.0.1.jar /auth.jar
ADD ./jar/gateway-0.0.1.jar /gateway.jar
ADD ./jar/governance-0.0.1.jar /governance.jar
ADD ./jar/system-admin-0.0.1.jar /system-admin.jar
ADD ./jar/account-service-0.0.1.jar /account.jar
ADD start.sh /start.sh
RUN chmod +x /start.sh
......
#指定依赖的镜像
FROM java:8
#springboot
VOLUME /tmp
#容器使用端口
EXPOSE 8000
#添加jar包入容器
ADD ./apply/apply-service/target/apply-service-0.0.1.jar /apply.jar
ADD ./assessment/assessment-service/target/assessment-service-0.0.1.jar /assessment.jar
ADD ./auth-service/target/auth-0.0.1.jar /auth.jar
ADD ./gateway-service/target/gateway-0.0.1.jar /gateway.jar
ADD ./governance/target/governance-0.0.1.jar /governance.jar
ADD ./system/system-admin-service/target/system-admin-0.0.1.jar /system-admin.jar
ADD ./account/account-service/target/account-service-0.0.1.jar /account.jar
ADD start.sh /start.sh
RUN chmod +x /start.sh
ENTRYPOINT ["sh","-c","./start.sh"]
package com.hungraim.ltc.api;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
@FeignClient("LTC-ACCOUNT-SERVICE")
public interface AccountFeignService {
@GetMapping("/api.account/account/getOtherPlace")
void getOtherPlace(@RequestParam("programId") String programId);
}
......@@ -3,9 +3,8 @@ package com.hungraim.ltc.account.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hungraim.ltc.account.service.AccountService;
import com.hungraim.ltc.pojo.entity.account.ChAssessDetailAccounts;
import com.hungraim.ltc.pojo.entity.account.ChDisabAccounts;
import com.hungraim.ltc.pojo.entity.account.ChDisabDetailAccounts;
import com.hungraim.ltc.pojo.entity.account.ChDisabDetailAccountsResp;
import com.hungraim.ltc.pojo.vo.account.*;
import com.hungraim.ltc.util.FileUtils;
import com.hungraim.ltc.util.Result;
......@@ -14,10 +13,7 @@ import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.apache.poi.ss.usermodel.Workbook;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.text.ParseException;
......@@ -42,9 +38,9 @@ public class AccountController {
*/
@PostMapping("/addOrUpdateAccount")
public Result addOrUpdateAccount(AccountOperVo accountOperVo) {
if (null == accountOperVo.getSrvOrganId() || null == accountOperVo.getAccountsTime() || StringUtils.isBlank(accountOperVo.getTotalExpensesPayable()) || null == accountOperVo.getAccountsStatus()) {
/* if (null == accountOperVo.getSrvOrganId() || null == accountOperVo.getAccountsTime() || StringUtils.isBlank(accountOperVo.getTotalExpensesPayable()) || null == accountOperVo.getAccountsStatus()) {
return Result.failed(ResultCode.REQUEST_PARAM_ERROR);
}
}*/
Long accountsId = accountOperVo.getAccountsId();
Date accountsTime = accountOperVo.getAccountsTime();
Long srvOrganId = accountOperVo.getSrvOrganId();
......@@ -102,18 +98,37 @@ public class AccountController {
return Result.success(accountService.expenseSettlement(req));
}
// todo 后续改成每月定时
@GetMapping("/organAccount")
public void organAccount(){
accountService.organAccount();
@RequestMapping("/organAccountTaskExecute")
public Result organAccountTaskExecute(AccountTaskReqVO accountTaskReqVO){
List<AccountTaskExecuteReqVO> accountTaskExecuteReqVOS = accountTaskReqVO.getAccountTaskList();
accountService.organAccountTaskExecute(accountTaskExecuteReqVOS);
return Result.success();
}
// todo 后续改成每月定时
@GetMapping("/assessAccount")
public void getAssessAccount(){
accountService.getAssessAccount();
@GetMapping("/getOtherPlace")
public Result otherPlaceHandler(String programId){
accountService.otherPlaceHandler(programId);
return Result.success();
}
/**
* 任务列表
*
* @param srvTaskReqVO 请求参数对象
* @return 返回
*/
@GetMapping("/getSrvTaskList")
public Result<Page<SrvTaskRespVO>> getSrvTaskList(SrvTaskReqVO srvTaskReqVO) {
return Result.success(accountService.getSrvTaskList(srvTaskReqVO));
}
/**
* 查询机构结算列表
*
......@@ -139,54 +154,28 @@ public class AccountController {
}
/**
* 查询评估结算列表
*
* @param srvOrganListReq 请求参数对象
* @return 返回
*/
@GetMapping("/searchAssessAccountsList")
public Result<Page<AssessAccountsListResp>> searchAssessAccountsList(SrvOrganListReq srvOrganListReq) {
return Result.success(accountService.searchAssessAccountsList(srvOrganListReq));
}
/**
* 评估结算导出明细
*
*/
@GetMapping("/assessAccountExport")
public void assessAccountExport(String assessAccountsId,HttpServletResponse response){
Workbook workbook = accountService.assessAccountExport(assessAccountsId);
// 命名表格
String fileName = "assessAccount.xlsx";
FileUtils.exportResponse(workbook,fileName,response);
}
/**
* 评估人员结算列表明细
*
* @param id 结算id
* @return 返回雷彪
*/
@GetMapping("/QueryDisabOrganAccountsDetail")
public Result<List<ChAssessDetailAccounts>> QueryDisabOrganAccountsDetail(int id) {
List<ChAssessDetailAccounts> chAssessDetailAccounts = accountService.queryDisabOrganAccountsDetail(id);
return Result.success(chAssessDetailAccounts);
}
/**
* 查询机构结算信息列表明细
*
* @param id 结算id
* @return 返回雷彪
* @return
*/
@GetMapping("/QuerySearchAssessAccounts")
public Result<List<ChDisabDetailAccounts>> QuerySearchAssessAccounts(int id) {
List<ChDisabDetailAccounts> chAssessDetailAccounts = accountService.querySearchAssessAccounts(id);
@GetMapping("/queryOrganAccountsDetail")
public Result<List<ChDisabDetailAccountsResp>> queryOrganAccountsDetail(String id) {
List<ChDisabDetailAccountsResp> chAssessDetailAccounts = accountService.queryOrganAccountsDetail(id);
return Result.success(chAssessDetailAccounts);
}
/**
* 机构结算管理提交复核
*
......@@ -204,22 +193,7 @@ public class AccountController {
}
/**
* 评估人员结算提交复核
*
* @param id 结算id
* @return 返回雷彪
*/
@PostMapping("/updateChAssessAccounts")
public Result updateChAssessAccounts(int id) {
int bl = accountService.updateChAssessAccounts(id);
if(bl>0){
return Result.success();
}else{
return Result.failed();
}
}
}
......@@ -4,10 +4,9 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hungraim.ltc.pojo.entity.account.ChDisabAccounts;
import com.hungraim.ltc.pojo.entity.account.ChDisabDetailAccounts;
import com.hungraim.ltc.pojo.vo.account.AccountOperVo;
import com.hungraim.ltc.pojo.vo.account.SrvOrganListReq;
import com.hungraim.ltc.pojo.vo.account.SrvOrganListResp;
import com.hungraim.ltc.pojo.vo.account.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;
......@@ -17,5 +16,19 @@ import java.util.List;
@Repository
public interface ChDisabAccountsDetailMapper extends BaseMapper<ChDisabDetailAccounts> {
List<OrganAccountsVO> getOrganAccountsList(String taskDetailId);
Page<SrvOrganAccountListResp> searchSrvOrganAccountList(Page page, List<Long> organIds, SrvOrganListReq req);
List<AccountExportDetailListResp> searchSrvOrganAccountDetailExport(String accountsId);
List<ChDisabDetailAccounts> queryAccountByCondition(@Param("taskDetailIds") List<String> taskDetailIds);
List<OrganAccountsVO> getOtherPlaceList(String programId);
}
\ No newline at end of file
......@@ -49,4 +49,8 @@ public interface ChDisabAccountsMapper extends BaseMapper<ChDisabAccounts> {
"WHERE " +
" t1.ACCOUNTS_ID = #{accountsId}")
AccountOperVo getDetailById(Long accountsId);
ChDisabAccounts queryAccountByCondition(String accountsTime, String modeName, String srvOrganId);
}
\ No newline at end of file
......@@ -2,13 +2,17 @@ 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);
}
package com.hungraim.ltc.account.dao;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hungraim.ltc.pojo.vo.account.*;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;
import java.util.List;
@Repository
@Mapper
public interface ChOrganAccountsMapper {
List<OrganAccountsVO> getOrganAccountsList(String lastMonth);
Page<SrvOrganAccountListResp> searchSrvOrganAccountList(Page page, List<Long> organIds, SrvOrganListReq req);
List<AccountExportDetailListResp> searchSrvOrganAccountDetailExport(String accountsId);
}
package com.hungraim.ltc.account.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hungraim.ltc.pojo.entity.serviceManage.ChSrvTaskDetail;
import com.hungraim.ltc.pojo.vo.account.SrvTaskReqVO;
import com.hungraim.ltc.pojo.vo.account.SrvTaskRespVO;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;
import org.springframework.web.bind.annotation.PathVariable;
import java.util.List;
@Mapper
@Repository
public interface ChSrvTaskDetailMapper extends BaseMapper<ChSrvTaskDetail> {
Page<SrvTaskRespVO> getSrvTaskList(Page page,SrvTaskReqVO req);
Integer updateSrvPlanById(String palnId);
}
\ No newline at end of file
......@@ -2,10 +2,9 @@ package com.hungraim.ltc.account.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.hungraim.ltc.pojo.entity.account.ChAssessDetailAccounts;
import com.hungraim.ltc.pojo.entity.account.ChDisabAccounts;
import com.hungraim.ltc.pojo.entity.account.ChDisabDetailAccounts;
import com.hungraim.ltc.pojo.entity.account.*;
import com.hungraim.ltc.pojo.vo.account.*;
import org.apache.poi.ss.usermodel.Workbook;
import java.text.ParseException;
......@@ -22,30 +21,22 @@ public interface AccountService extends IService<ChDisabAccounts> {
Page<SrvOrganAccountListResp> searchSrvOrganAccountList(SrvOrganListReq srvOrganListReq);
Page<SrvTaskRespVO> getSrvTaskList(SrvTaskReqVO srvTaskReqVO);
AccountOperVo getSrvOrganDetail(Long accountsId);
ExpenseVo expenseSettlement(ExpenseSettlementReq req) throws ParseException;
void organAccount();
void getAssessAccount();
Workbook srvOrganAccountExport(String accountsId);
Page<AssessAccountsListResp> searchAssessAccountsList(SrvOrganListReq srvOrganListReq);
Workbook assessAccountExport(String assessAccountsId);
/**
* 列表明细
* @param id
* @return
*/
List<ChAssessDetailAccounts> queryDisabOrganAccountsDetail(int id);
List<ChDisabDetailAccounts> querySearchAssessAccounts(int id);
List<ChDisabDetailAccountsResp> queryOrganAccountsDetail(String id);
int updateChDisabAccounts(int id);
int updateChAssessAccounts(int id);
void organAccountTaskExecute(List<AccountTaskExecuteReqVO> accountTaskExecuteReqVOS);
void otherPlaceHandler(String programId);
}
......@@ -6,7 +6,6 @@ import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollectionUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hungraim.ltc.account.dao.*;
......@@ -16,11 +15,11 @@ import com.hungraim.ltc.api.AttachFeignService;
import com.hungraim.ltc.pojo.entity.SysConfig.ChCfgCareService;
import com.hungraim.ltc.pojo.entity.SysConfig.ChCfgCostStandard;
import com.hungraim.ltc.pojo.entity.SysConfig.ChFndAttach;
import com.hungraim.ltc.pojo.entity.account.ChAssessAccounts;
import com.hungraim.ltc.pojo.entity.account.ChAssessDetailAccounts;
import com.hungraim.ltc.pojo.entity.account.ChDisabAccounts;
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.ChSrvTaskFinishItem;
import com.hungraim.ltc.pojo.vo.account.*;
import com.hungraim.ltc.util.*;
import lombok.AllArgsConstructor;
......@@ -52,14 +51,19 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
private final ChSrvProgramSetMapper programSetMapper;
private final ChCfgCareServiceMapper chCfgCareServiceMapper;
private final ChCfgCostStandardMapper chCfgCostStandardMapper;
private final ChOrganAccountsMapper chOrganAccountsMapper;
private final ChAssessAccountsMapper chAssessAccountsMapper;
private final ChDisabAccountsDetailMapper chDisabAccountsDetailMapper;
private final ChAssessAccountsDetailMapper chAssessAccountsDetailMapper;
/*
private final ChAssessDetailAccountsMapper chAssessDetailAccountsMapper;
*/
private final ChDisabDetailAccountsMapper chDisabDetailAccountsMapper;
private final ChSrvTaskDetailMapper chSrvTaskDetailMapper;
private final ChSrvTaskFinishItemMapper chSrvTaskFinishItemMapper;;
@Override
@Transactional(rollbackFor = Exception.class)
......@@ -81,9 +85,12 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
@Override
public Page<SrvOrganAccountListResp> searchSrvOrganAccountList(SrvOrganListReq srvOrganListReq) {
List<Long> organIds = baseAccountService.getOrganIds(srvOrganListReq.getOrganId(), srvOrganListReq.getIsInvolveChild());
return chOrganAccountsMapper.searchSrvOrganAccountList(new Page<>(srvOrganListReq.getPageNum(), srvOrganListReq.getPageSize()), organIds, srvOrganListReq);
return chDisabAccountsDetailMapper.searchSrvOrganAccountList(new Page<>(srvOrganListReq.getPageNum(), srvOrganListReq.getPageSize()), organIds, srvOrganListReq);
}
@Override
public AccountOperVo getSrvOrganDetail(Long accountsId) {
AccountOperVo accountOperVo = disabAccountsMapper.getDetailById(accountsId);
......@@ -400,225 +407,40 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
return cale.getTime();
}
//求年月日中的日
private int getDay(Date date) {
private Date getFirstDayOfMonth(Date date) {
Calendar cale = Calendar.getInstance();
cale.setTime(date);
return cale.get(Calendar.DAY_OF_MONTH);
}
private static String lastMonth = DateUtils.getlastMonth();
@Override
public void organAccount() {
List<OrganAccountsVO> accountsList = chOrganAccountsMapper.getOrganAccountsList(lastMonth);
// 根据护理机构分组
Map<String, List<OrganAccountsVO>> organAccountMap = accountsList.stream().collect(Collectors.groupingBy(OrganAccountsVO::getSrvOrganId));
for(Map.Entry<String, List<OrganAccountsVO>> entry:organAccountMap.entrySet()){
String organId = entry.getKey();
List<OrganAccountsVO> organAccountsList = entry.getValue();
if (CollectionUtil.isNotEmpty(organAccountsList)) {
List<OrganAccountsVO> growOldOrganAccountList = organAccountsList.stream().filter(s -> "养老".equals(s.getSrvModeName())).collect(Collectors.toList());
// 养老机构护理,其限额为 50 元/人/天 由长期护理保险基金支付 70% 个人支付 30%
computeCostAndSave(organId,growOldOrganAccountList, 50, 0.7, 0.3);
List<OrganAccountsVO> visitingOrganAccountList = organAccountsList.stream().filter(s -> "上门".equals(s.getSrvModeName())).collect(Collectors.toList());
// 机构上门护理,其限额为 40 元/人/天 由长期护理保险基金支付 80% 个人支付 20% (两天上门一次,一个月最多16次,一次75)
computeCostAndSave(organId,visitingOrganAccountList, 75, 0.8, 0.2);
// 医疗机构护理,原则上收治医疗护理需求为主的重度失能人员一级及以下医疗机构其限额为 80 元/人/天,由长期护理保险基金支付 70%,个人支付 30%;
List<OrganAccountsVO> oneLevelList = organAccountsList.stream()
.filter(s -> "医疗".equals(s.getSrvModeName()) && "1".equals(s.getLevelCode()) && s.getDisableLevelName().contains("重度"))
.collect(Collectors.toList());
OrganAccountsVO organAccountsVO1 = computeCostAndSave(organId,oneLevelList, 80, 0.7, 0.3);
// 二级及以上医疗机构其限额为 100 元/人/天,由长期护理保险基金支付 70%,个人支付 30%;
List<OrganAccountsVO> aboveLevel2List = organAccountsList.stream()
.filter(s -> "医疗".equals(s.getSrvModeName()) && (!"1".equals(s.getLevelCode())) && s.getDisableLevelName().contains("重度"))
.collect(Collectors.toList());
OrganAccountsVO organAccountsVO2 = computeCostAndSave(organId,aboveLevel2List, 100, 0.7, 0.3);
BigDecimal allCost = organAccountsVO1.getAllCost().add(organAccountsVO2.getAllCost());
BigDecimal overallCost = organAccountsVO1.getOverallCost().add(organAccountsVO2.getOverallCost());
BigDecimal personalCost = organAccountsVO1.getPersonalCost().add(organAccountsVO2.getPersonalCost());
Long accountsId = saveOrganAccount(organId, aboveLevel2List, allCost, overallCost, personalCost);
saveorganAccountDetail(oneLevelList, BigDecimal.valueOf(80), organAccountsVO1.getOverallCost(), organAccountsVO1.getPersonalCost(),accountsId);
saveorganAccountDetail(aboveLevel2List, BigDecimal.valueOf(100), organAccountsVO2.getOverallCost(), organAccountsVO2.getPersonalCost(),accountsId);
List<OrganAccountsVO> otherPlaceList = organAccountsList.stream()
.filter(s -> "异地".equals(s.getSrvModeName()) && (!"1".equals(s.getLevelCode())) && s.getDisableLevelName().contains("重度"))
.collect(Collectors.toList());
// 异地 按照 20 元/人/天的标准给予小额补助,实行按月支付
computeCostAndSave(organId,otherPlaceList, 20, 1, 0);
cale = Calendar.getInstance();
cale.add(Calendar.MONTH, -1);
cale.set(Calendar.DAY_OF_MONTH, 1);
return cale.getTime();
}
}
}
/**
* @param organAccountList 数据
* @param limitCost 限额费用
* @param overallPercent 统筹比例
* @param personalPercent 个人支付比例
* @return OrganAccountsVO
* @desc 根据限额比例计算统筹费用和个人支付并保存信息
**/
public OrganAccountsVO computeCostAndSave(String organId,List<OrganAccountsVO> organAccountList, double limitCost, double overallPercent, double personalPercent) {
OrganAccountsVO organAccountsVO = new OrganAccountsVO();
if (CollectionUtil.isEmpty(organAccountList)) {
BigDecimal zero = BigDecimal.valueOf(0);
organAccountsVO.setAllCost(zero);
organAccountsVO.setOverallCost(zero);
organAccountsVO.setPersonalCost(zero);
return organAccountsVO;
}
int size = organAccountList.size();
BigDecimal count = BigDecimal.valueOf(size);
BigDecimal limit = BigDecimal.valueOf(limitCost);
BigDecimal overallCostPercent = BigDecimal.valueOf(overallPercent);
BigDecimal personalCostPercent = BigDecimal.valueOf(personalPercent);
BigDecimal allCost = count.multiply(limit);
BigDecimal overallCost = allCost.multiply(overallCostPercent);
BigDecimal personalCost = allCost.multiply(personalCostPercent);
organAccountsVO.setAllCost(allCost);
organAccountsVO.setOverallCost(overallCost);
organAccountsVO.setPersonalCost(personalCost);
String srvModeName = organAccountList.get(0).getSrvModeName();
if(!"医疗".equals(srvModeName)) {
Long accountsId = saveOrganAccount(organId, organAccountList, allCost, overallCost, personalCost);
saveorganAccountDetail(organAccountList, limit, overallCost, personalCost,accountsId);
}
return organAccountsVO;
//求年月日中的日
private int getDay(Date date) {
Calendar cale = Calendar.getInstance();
cale.setTime(date);
return cale.get(Calendar.DAY_OF_MONTH);
}
/**
* @param limit 限额
* @param overallCost 统筹支付
* @param personalCost 个人支付
* @param accountsId 机构结算id
* @return void
* @desc 保存机构结算明细
**/
public void saveorganAccountDetail(List<OrganAccountsVO> organAccountList ,BigDecimal limit, BigDecimal overallCost,BigDecimal personalCost,Long accountsId){
if(CollectionUtil.isEmpty(organAccountList)){
return;
}
for (OrganAccountsVO accountsVO : organAccountList) {
ChDisabDetailAccounts chDisabDetailAccounts = new ChDisabDetailAccounts();
chDisabDetailAccounts.setSrvOrganId(accountsVO.getSrvOrganId());
chDisabDetailAccounts.setAccountsAllCost(limit);
chDisabDetailAccounts.setAccountsOverallCost(limit.multiply(overallCost));
chDisabDetailAccounts.setAccountsPersonalCost(limit.multiply(personalCost));
chDisabDetailAccounts.setModeName(accountsVO.getSrvModeName());
chDisabDetailAccounts.setCreationTime(new Date());
chDisabDetailAccounts.setAccountsTime(DateUtils.getlastMonth(lastMonth));
chDisabDetailAccounts.setAccountsEndTime(DateUtils.strToTime(accountsVO.getSrvDate()));
chDisabDetailAccounts.setAccountsId(accountsId);
chDisabDetailAccounts.setDisabInfoId(accountsVO.getDisabInfoId());
chDisabAccountsDetailMapper.insert(chDisabDetailAccounts);
}
}
/**
*@desc 保存机构结算信息
*@param organId
* @param organAccountList
* @param allCost
* @param overallCost
* @param personalCost
*@return void
**/
private Long saveOrganAccount(String organId, List<OrganAccountsVO> organAccountList, BigDecimal allCost, BigDecimal overallCost, BigDecimal personalCost) {
if(CollectionUtil.isEmpty(organAccountList)){
return null;
}
ChDisabAccounts chDisabAccounts = new ChDisabAccounts();
chDisabAccounts.setAllCost(allCost.setScale(2, BigDecimal.ROUND_HALF_UP).toString());
chDisabAccounts.setOverallCost(overallCost.setScale(2, BigDecimal.ROUND_HALF_UP).toString());
chDisabAccounts.setPersonalCost(personalCost.setScale(2, BigDecimal.ROUND_HALF_UP).toString());
Date date = DateUtils.getlastMonth(lastMonth);
chDisabAccounts.setAccountsTime(DateUtils.getlastMonth(lastMonth));
chDisabAccounts.setAccountsStatus((short) 1);
chDisabAccounts.setCreationTime(new Date());
chDisabAccounts.setSrvOrganId(Long.valueOf(organId));
chDisabAccounts.setModeName(organAccountList.get(0).getSrvModeName());
// chDisabAccounts.setSvrStartTime();
chDisabAccounts.setSvrEndTime(getLastDayOfMonth(date));
disabAccountsMapper.insert(chDisabAccounts);
Long accountsId = chDisabAccounts.getAccountsId();
return accountsId;
}
@Override
public void getAssessAccount() {
String lastMonth = DateUtils.getlastMonth();
List<AssessAccountsVO> assessList = chAssessAccountsMapper.getAssessAccountsList();
Map<String, List<AssessAccountsVO>> assessAccountMap = assessList.stream().collect(Collectors.groupingBy(AssessAccountsVO::getAprOrganId));
for (List<AssessAccountsVO> assessAccountsList : assessAccountMap.values()) {
List<AssessAccountsVO> accountEmpList = assessAccountsList.stream().filter(s -> "评定员".equals(s.getAprempTypeName())).collect(Collectors.toList());
List<AssessAccountsVO> accountExpertList = assessAccountsList.stream().filter(s -> "评估专家".equals(s.getAprempTypeName())).collect(Collectors.toList());
// 评估员上门评估,每人次 100 元
saveAssessAccounts(lastMonth, accountEmpList,BigDecimal.valueOf(100));
// 评估专家上门评估,每人次 150 元
saveAssessAccounts(lastMonth, accountExpertList,BigDecimal.valueOf(150));
}
}
/**
* @desc 保存评估结算信息
* @param lastMonth
* @param accountList
* @param limit
*@return void
**/
private void saveAssessAccounts(String lastMonth, List<AssessAccountsVO> accountList, BigDecimal limit) {
if (CollectionUtil.isEmpty(accountList)) {
return;
}
BigDecimal accountCost = BigDecimal.valueOf(accountList.size()).multiply(limit);
ChAssessAccounts chAssessAccounts = new ChAssessAccounts();
chAssessAccounts.setAccountsStatus((short) 1);
String allCost = accountCost.setScale(2, BigDecimal.ROUND_HALF_UP).toString();
chAssessAccounts.setAssessAllCost(accountCost.setScale(2, BigDecimal.ROUND_HALF_UP).toString());
Date date = DateUtils.getlastMonth(lastMonth);
chAssessAccounts.setAccountsTime(DateUtils.getlastMonth(lastMonth));
chAssessAccounts.setAprOrganId(Long.valueOf(accountList.get(0).getAprOrganId()));
chAssessAccounts.setAssessEndTime(getLastDayOfMonth(date));
chAssessAccounts.setChooseSettle((short) 1);
chAssessAccounts.setDistrictProvincial(accountList.get(0).getDistrictProvincial());
chAssessAccounts.setDistrictCity(accountList.get(0).getDistrictCity());
chAssessAccounts.setDistrictArea(accountList.get(0).getDistrictArea());
chAssessAccountsMapper.insert(chAssessAccounts);
Long assessAccountsId = chAssessAccounts.getAssessAccountsId();
for (AssessAccountsVO assessAccountsVO : accountList) {
ChAssessDetailAccounts chAssessDetailAccounts = new ChAssessDetailAccounts();
chAssessDetailAccounts.setAssessAccountsId(assessAccountsId);
chAssessDetailAccounts.setSrvOrganId(assessAccountsVO.getAprOrganId());
chAssessDetailAccounts.setCreationTime(new Date());
chAssessDetailAccounts.setDisabInfoId(assessAccountsVO.getDisabInfoId());
chAssessDetailAccounts.setAssessAllCost(allCost);
chAssessDetailAccounts.setAccountsTime(DateUtils.getlastMonth(lastMonth));
chAssessAccountsDetailMapper.insert(chAssessDetailAccounts);
}
}
@Override
public Workbook srvOrganAccountExport(String accountsId) {
List<AccountExportDetailListResp> srvOrganAccountExportList = chOrganAccountsMapper.searchSrvOrganAccountDetailExport(accountsId);
List<AccountExportDetailListResp> srvOrganAccountExportList = chDisabAccountsDetailMapper.searchSrvOrganAccountDetailExport(accountsId);
ExportParams exportParams = new ExportParams();
exportParams.setType(ExcelType.XSSF); //对应xlsx
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, AccountExportDetailListResp.class, srvOrganAccountExportList);
......@@ -627,26 +449,8 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
@Override
public Workbook assessAccountExport(String assessAccountsId) {
List<AssessAccountsExportResp> assessAccountExportList = chAssessAccountsMapper.assessAccountDetailExport(assessAccountsId);
ExportParams exportParams = new ExportParams();
exportParams.setType(ExcelType.XSSF); //对应xlsx
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, AssessAccountsExportResp.class, assessAccountExportList);
return workbook;
}
@Override
public List<ChAssessDetailAccounts> queryDisabOrganAccountsDetail(int id) {
QueryWrapper<ChAssessDetailAccounts> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("ASSESS_ACCOUNTS_ID",id);
return chAssessDetailAccountsMapper.selectList(queryWrapper);
}
@Override
public List<ChDisabDetailAccounts> querySearchAssessAccounts(int id) {
QueryWrapper<ChDisabDetailAccounts> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("ACCOUNTS_ID",id);
return chDisabDetailAccountsMapper.selectList(queryWrapper);
public List<ChDisabDetailAccountsResp> queryOrganAccountsDetail(String id) {
return chDisabDetailAccountsMapper.queryOrganAccountsDetail(id);
}
@Override
......@@ -660,21 +464,156 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
}
@Override
@Transactional(rollbackFor=Exception.class)
public int updateChAssessAccounts(int id) {
ChAssessAccounts ca = new ChAssessAccounts();
ca.setAssessAccountsId(Long.valueOf(id));
ca.setAccountsStatus((short) 2);
return chAssessAccountsMapper.updateById(ca);
public Page<SrvTaskRespVO> getSrvTaskList(SrvTaskReqVO srvTaskReqVO){
Page<SrvTaskRespVO> srvTaskList = taskDetailMapper.getSrvTaskList(new Page<>(srvTaskReqVO.getPageNum(), srvTaskReqVO.getPageSize()), srvTaskReqVO);
return srvTaskList;
}
@Override
public Page<AssessAccountsListResp> searchAssessAccountsList(SrvOrganListReq srvOrganListReq) {
List<Long> organIds = baseAccountService.getOrganIds(srvOrganListReq.getOrganId(), srvOrganListReq.getIsInvolveChild());
return chAssessAccountsMapper.searchAssessAccountList(new Page<>(srvOrganListReq.getPageNum(), srvOrganListReq.getPageSize()), organIds, srvOrganListReq);
public void organAccountTaskExecute(List<AccountTaskExecuteReqVO> accountTaskExecuteReqVOS) {
if (CollectionUtil.isEmpty(accountTaskExecuteReqVOS)) {
return;
}
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();
// 处理具体的服务项目
for (AccountTaskExecuteReqVO accountTaskExecuteReqVO : accountTaskList) {
// 已完成的任务更新ch_srv_plan状态
String planId = accountTaskExecuteReqVO.getPlanId();
Integer integer = chSrvTaskDetailMapper.updateSrvPlanById(planId);
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)) {
return;
}
}
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);
}
}
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();
chDisabDetailAccounts.setSrvOrganId(accountsVO.getSrvOrganId());
//要判断是养老还是医疗,因为费用不一样
BigDecimal limit = BigDecimal.valueOf(0);
BigDecimal overallPercent = BigDecimal.valueOf(0.7);
BigDecimal personalPercent = BigDecimal.valueOf(0.3);
// 养老机构护理,其限额为 50 元/人/天 由长期护理保险基金支付 70% 个人支付 30%
if ("养老".equals(accountsVO.getSrvModeName())) {
limit = BigDecimal.valueOf(50);
// 医疗机构护理,原则上收治医疗护理需求为主的重度失能人员一级及以下医疗机构其限额为 80 元/人/天,由长期护理保险基金支付 70%,个人支付 30%;
// && accountsVO.getDisableLevelName().contains("重度")
} else if ("医疗".equals(accountsVO.getSrvModeName()) && "1".equals(accountsVO.getLevelCode())) {
limit = BigDecimal.valueOf(80);
// 二级及以上医疗机构其限额为 100 元/人/天,由长期护理保险基金支付 70%,个人支付 30%;
} else if ("医疗".equals(accountsVO.getSrvModeName()) && (!"1".equals(accountsVO.getLevelCode()))) {
limit = BigDecimal.valueOf(100);
} else {
return;
}
chDisabDetailAccounts.setAccountsAllCost(limit);
BigDecimal overallCost = limit.multiply(overallPercent);
chDisabDetailAccounts.setAccountsOverallCost(overallCost);
BigDecimal personalCost = limit.multiply(personalPercent);
chDisabDetailAccounts.setAccountsPersonalCost(personalCost);
chDisabDetailAccounts.setModeName(accountsVO.getSrvModeName());
chDisabDetailAccounts.setCreationTime(new Date());
// 结算时间为任务时间
chDisabDetailAccounts.setAccountsTime(DateUtils.strToTime(accountsVO.getSrvDate()));
//chDisabDetailAccounts.setAccountsStartTime(DateUtils.strToTime(accountsVO.getSrvStartTime()));
//chDisabDetailAccounts.setAccountsEndTime(DateUtils.strToTime(accountsVO.getSrvEndTime()));
chDisabDetailAccounts.setTaskDetailId(accountsVO.getTaskDetailId());
chDisabDetailAccounts.setMedicalArea(accountsVO.getMedicalArea());
chDisabDetailAccounts.setItemIds(accountsVO.getItemId());
chDisabDetailAccounts.setDisabInfoId(accountsVO.getDisabInfoId());
ChDisabAccounts chDisabAccounts = getChDisabAccounts(accountsVO, limit, overallCost, personalCost);
chDisabDetailAccounts.setAccountsId(chDisabAccounts.getAccountsId());
chDisabAccountsDetailMapper.insert(chDisabDetailAccounts);
}
}
}
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());
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) 1);
chDisabAccounts.setAllCost(String.valueOf(limit));
chDisabAccounts.setOverallCost(String.valueOf(overallCost));
chDisabAccounts.setPersonalCost(String.valueOf(personalCost));
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;
}
@Override
public void otherPlaceHandler(String programId){
List<OrganAccountsVO> accountsList = chDisabAccountsDetailMapper.getOtherPlaceList(programId);
for (OrganAccountsVO accountsVO : accountsList) {
ChDisabDetailAccounts chDisabDetailAccounts = new ChDisabDetailAccounts();
chDisabDetailAccounts.setSrvOrganId(accountsVO.getSrvOrganId());
// 要判断是养老还是医疗,因为费用不一样
BigDecimal limit = BigDecimal.valueOf(20);
BigDecimal zero = BigDecimal.valueOf(0);
chDisabDetailAccounts.setAccountsAllCost(limit);
chDisabDetailAccounts.setAccountsPersonalCost(zero);
chDisabDetailAccounts.setAccountsOverallCost(zero);
chDisabDetailAccounts.setModeName(accountsVO.getSrvModeName());
chDisabDetailAccounts.setCreationTime(new Date());
chDisabDetailAccounts.setAccountsTime(DateUtils.strToDate(accountsVO.getSrvDate()));
chDisabDetailAccounts.setAccountsStartTime(DateUtils.strToTime(accountsVO.getSrvStartTime()));
chDisabDetailAccounts.setAccountsEndTime(DateUtils.strToTime(accountsVO.getSrvEndTime()));
chDisabDetailAccounts.setTaskDetailId(accountsVO.getTaskDetailId());
chDisabDetailAccounts.setMedicalArea(accountsVO.getMedicalArea());
chDisabDetailAccounts.setItemIds(accountsVO.getItemId());
chDisabDetailAccounts.setDisabInfoId(accountsVO.getDisabInfoId());
ChDisabAccounts chDisabAccounts = getChDisabAccounts(accountsVO, limit, zero, zero);
chDisabDetailAccounts.setAccountsId(chDisabAccounts.getAccountsId());
chDisabAccountsDetailMapper.insert(chDisabDetailAccounts);
}
}
}
<?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.ChOrganAccountsMapper">
<mapper namespace="com.hungraim.ltc.account.dao.ChDisabAccountsDetailMapper">
<!--查询机构失能人员信息-->
<select id="getOrganAccountsList" resultType="com.hungraim.ltc.pojo.vo.account.OrganAccountsVO">
select
--失能人员姓名
disable.real_name realName,
disable.DISAB_INFO_ID disabInfoId,
--身份证号
disable.CERTI_CODE certiCode,
--所在省市
disable.district_provincial districtProvincial,
disable.district_city districtCity,
disable.DISTRICT_AREA districtArea,
mode1.MODE_ID modeId,
--服务方式
mode1.mode_name srvModeName,
--护理机构名称
organ.srv_organ_id srvOrganId,
--护理机构名称
organ.srv_organ_name srvOrganName,
--护理服务人员
emp.emp_name empName,
--任务时间
detail.SRV_DATE srvDate,
--机构等级
organ.LEVEL_CODE levelCode,
--失能等级
level1.DISABLE_LEVEL_NAME disableLevelName
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_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_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_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_cfg_srv_disable_level level1 on report.disable_level_id = level1.disable_level_id
where detail.STATUS=4 and organ.LEVEL_CODE is not null
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,
--护理服务人员
emp.emp_name empName,
--任务时间
detail.SRV_DATE srvDate,
-- 机构等级
organ.LEVEL_CODE levelCode,
CSTFI.ITEM_ID itemId
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_DEV.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="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>
......@@ -88,7 +97,10 @@
t1.OVERALL_COST,
t1.PERSONAL_COST,
t1.SVR_START_TIME,
t1.SVR_END_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
FROM
CH_DISAB_ACCOUNTS t1
LEFT JOIN CH_SRV_ORGAN t2 ON t1.SRV_ORGAN_ID = t2.SRV_ORGAN_ID
......@@ -127,5 +139,47 @@
</select>
<select id="getOtherPlaceList" 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,
mode1.MODE_ID modeId,
--服务方式
mode1.mode_name srvModeName,
--护理机构名称
organ.srv_organ_id srvOrganId,
--护理机构名称
organ.srv_organ_name srvOrganName,
--护理服务人员
emp.emp_name empName,
--任务时间
detail.SRV_DATE srvDate,
detail.SRV_START_TIME srvStartTime,
detail.SRV_END_TIME srvEndTime,
-- 机构等级
organ.LEVEL_CODE levelCode,
-- 失能等级
level1.DISABLE_LEVEL_NAME disableLevelName
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_DEV.CH_DISABLE_APPLY apply on apply.apply_id = disable.apply_id
left join ch_apr_task aprtask on disable.last_task_id = aprtask.task_id--评定任务
left join ch_apr_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_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_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
where mode1.MODE_ID = '4' and level1.DISABLE_LEVEL_NAME like '重度%' and program.program_id = #{programId}
</select>
</mapper>
......@@ -15,4 +15,17 @@
ACCOUNTS_ID, SRV_ORGAN_ID, TOTAL_ALLOCATED_EXPENSES, CREATION_TIME, ACCOUNTS_TIME,
TOTAL_EXPENSES_PAYABLE, CHOOSE_SETTLE, ACCOUNTS_STATUS
</sql>
<select id="queryAccountByCondition" resultType="com.hungraim.ltc.pojo.entity.account.ChDisabAccounts">
select * from CH_DISAB_ACCOUNTS t where t.MODE_NAME = #{modeName}
and to_char(t.ACCOUNTS_TIME,'yyyy-MM') = #{accountsTime}
and t.SRV_ORGAN_ID = #{srvOrganId}
</select>
</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
<?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.ChSrvTaskDetailMapper">
<select id="getSrvTaskList" resultType="com.hungraim.ltc.pojo.vo.account.SrvTaskRespVO">
select info.REAL_NAME realName,
plan.PLAN_ID planId,
plan.ITEM_ID itemId,
plan.TASK_DETAIL_ID taskDetailId,
plan.ITEM_NAME itemName,
emp.emp_name empName,
organ.SRV_ORGAN_NAME srvOrganName,
DECODE(plan.MODE_ID, '1','医疗','2', '养老','3','上门', '4', '异地') srvModeName,
to_char(plan.SRV_PLAN_TIME,'yyyy-MM-dd') srvDate,
plan.IS_STATUS status
from ch_srv_plan plan
left join ch_disable_info info on plan.DISAB_INFO_ID = info.DISAB_INFO_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
<where>
<if test="req.status != null">
and plan.IS_STATUS = #{req.status}
</if>
<if test="req.realName != null">
AND info.real_name LIKE CONCAT('%',CONCAT(#{req.realName},'%'))
</if>
<if test="req.srvOrganName != null">
AND organ.SRV_ORGAN_NAME LIKE CONCAT('%',CONCAT(#{req.srvOrganName},'%'))
</if>
</where>
</select>
<update id="updateSrvPlanById">
update CH_SRV_PLAN plan set plan.is_status= '4' where plan.plan_id = #{planId}
</update>
</mapper>
......@@ -310,9 +310,12 @@ public class DisableController {
if (chDisableApply.getSrvModeId() == null) {
return Result.failed("申请服务方式不能为空!");
}
if (StringUtils.isBlank(chDisableApply.getDiseaseDesc())) {
return Result.failed("疾病描述及诊断不能为空!");
if (chDisableApply.getDiseTypeF() == null) {
return Result.failed("诊断疾病不能为空!");
}
/* if (StringUtils.isBlank(chDisableApply.getDiseaseDesc())) {
return Result.failed("疾病描述及诊断不能为空!");
}*/
if (chDisableApply.getMedicalType() == null) {
return Result.failed("医保类型不能为空!");
}
......@@ -365,9 +368,13 @@ public class DisableController {
if (chDisableApply.getSrvModeId() == null) {
return Result.failed("申请服务方式不能为空!");
}
if (StringUtils.isBlank(chDisableApply.getDiseaseDesc())) {
return Result.failed("疾病描述及诊断不能为空!");
if (chDisableApply.getDiseTypeF() == null) {
return Result.failed("诊断疾病不能为空!");
}
/* if (StringUtils.isBlank(chDisableApply.getDiseaseDesc())) {
return Result.failed("疾病描述及诊断不能为空!");
}*/
if (chDisableApply.getMedicalType() == null) {
return Result.failed("医保类型不能为空!");
}
......
......@@ -120,9 +120,8 @@
a.CHECK_REMARK checkRemark,
a.REASONS_REVIEW reasonsReview,
a.REASONS_REMARK reasonsRemark,
a.MEDICAL_PROVINCIAL medicalProvincial,
a.MEDICAL_CITY medicalCity,
a.MEDICAL_AREA medicalArea
a.MEDICAL_AREA medicalArea,
a.BANK_CARD_NO bankCardNo
from CH_DISABLE_APPLY a
LEFT JOIN CH_SRV_ORGAN o ON a.SRV_ORGAN_ID = o.SRV_ORGAN_ID
where a.APPLY_ID = #{applyId}
......
......@@ -8,6 +8,7 @@ import com.hungraim.ltc.pojo.entity.SysConfig.ChFndAttach;
import com.hungraim.ltc.pojo.entity.assessment.*;
import com.hungraim.ltc.pojo.entity.disable.ChCfgSrvDisableLevel;
import com.hungraim.ltc.pojo.vo.ReportUpdateVO;
import com.hungraim.ltc.pojo.vo.account.AssessAccountsListResp;
import com.hungraim.ltc.pojo.vo.assessment.*;
import com.hungraim.ltc.service.TaskService;
import com.hungraim.ltc.service.TppesApiException;
......@@ -22,7 +23,6 @@ import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.net.URLEncoder;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
......@@ -185,6 +185,8 @@ public class TaskController {
//失败
return Result.failed(objectResult.getMsg());
}
// 评估结算
taskService.assessAccount(reportDetailVo);
return Result.success();
}
......@@ -681,4 +683,57 @@ public class TaskController {
String fileName = "aprEmp.xlsx";
FileUtils.exportResponse(workbook,fileName,response);
}
/**
* 查询评估结算列表
*
* @param srvOrganListReq 请求参数对象
* @return 返回
*/
@GetMapping("/searchAssessAccountsList")
public Result<Page<AssessAccountsListResp>> searchAssessAccountsList(SrvOrganListReq srvOrganListReq) {
return Result.success(taskService.searchAssessAccountsList(srvOrganListReq));
}
/**
* 评估结算导出明细
*
*/
@GetMapping("/assessAccountExport")
public void assessAccountExport(String assessAccountsId,HttpServletResponse response){
Workbook workbook = taskService.assessAccountExport(assessAccountsId);
// 命名表格
String fileName = "assessAccount.xlsx";
FileUtils.exportResponse(workbook,fileName,response);
}
/**
* 评估人员结算列表明细
*
* @param assessAccountsId 评估结算id
* @return 返回
*/
@GetMapping("/queryAssessAccountsDetail")
public Result<List<ChAssessDetailAccountsResp>> queryAssessAccountsDetail(String assessAccountsId) {
List<ChAssessDetailAccountsResp> chAssessDetailAccounts = taskService.queryAssessAccountsDetail(assessAccountsId);
return Result.success(chAssessDetailAccounts);
}
/**
* 评估人员结算提交复核
*
* @param id 结算id
* @return
*/
@PostMapping("/updateChAssessAccounts")
public Result updateChAssessAccounts(int id) {
int bl = taskService.updateChAssessAccounts(id);
if(bl>0){
return Result.success();
}else{
return Result.failed();
}
}
}
package com.hungraim.ltc.account.dao;
package com.hungraim.ltc.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hungraim.ltc.pojo.entity.account.ChAssessDetailAccounts;
import com.hungraim.ltc.pojo.entity.assessment.ChAssessDetailAccounts;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;
......
package com.hungraim.ltc.account.dao;
package com.hungraim.ltc.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hungraim.ltc.pojo.entity.account.ChAssessAccounts;
import com.hungraim.ltc.pojo.entity.assessment.ChAssessAccounts;
import com.hungraim.ltc.pojo.vo.account.AssessAccountsExportResp;
import com.hungraim.ltc.pojo.vo.account.AssessAccountsListResp;
import com.hungraim.ltc.pojo.vo.account.AssessAccountsVO;
import com.hungraim.ltc.pojo.vo.account.SrvOrganListReq;
import com.hungraim.ltc.pojo.vo.assessment.AssessIdAndCostVO;
import com.hungraim.ltc.pojo.vo.assessment.SrvOrganListReq;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;
......@@ -16,9 +16,9 @@ import java.util.List;
@Repository
public interface ChAssessAccountsMapper extends BaseMapper<ChAssessAccounts> {
List<AssessAccountsVO> getAssessAccountsList();
AssessIdAndCostVO queryAssessByOrganIdAndTime(String aprOrganId, String accountsTime, String modeId);
Page<AssessAccountsListResp> searchAssessAccountList(Page page, List<Long> organIds, SrvOrganListReq req);
List<AssessAccountsExportResp> assessAccountDetailExport(String assessAccountsId);
}
\ No newline at end of file
package com.hungraim.ltc.account.dao;
package com.hungraim.ltc.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hungraim.ltc.pojo.entity.account.ChAssessDetailAccounts;
import com.hungraim.ltc.pojo.entity.assessment.ChAssessDetailAccounts;
import com.hungraim.ltc.pojo.entity.assessment.ChAssessDetailAccountsResp;
import com.hungraim.ltc.pojo.vo.account.AssessAccountsExportResp;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* @author mq
*/
@Mapper
@Repository
public interface ChAssessDetailAccountsMapper extends BaseMapper<ChAssessDetailAccounts> {
public interface ChAssessDetailAccountsMapper extends BaseMapper<ChAssessDetailAccounts> {
List<ChAssessDetailAccountsResp> queryAssessAccountsDetail(String assessAccountsId);
List<AssessAccountsExportResp> assessAccountDetailExport(String assessAccountsId);
}
......@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hungraim.ltc.pojo.entity.SysConfig.ChFndAttach;
import com.hungraim.ltc.pojo.entity.assessment.*;
import com.hungraim.ltc.pojo.entity.disable.ChCfgSrvDisableLevel;
import com.hungraim.ltc.pojo.vo.account.AssessAccountsListResp;
import com.hungraim.ltc.pojo.vo.assessment.*;
import com.hungraim.ltc.util.Result;
import org.apache.poi.ss.usermodel.Workbook;
......@@ -87,4 +88,19 @@ public interface TaskService {
Map taskReportFractionDtlQueryList();
Workbook aprEmpExport(String provincial, String city, String area, String organName, String name, String tel, String groupLeader);
void assessAccount(ReportDetailVO reportDetailVo);
Page<AssessAccountsListResp> searchAssessAccountsList(SrvOrganListReq srvOrganListReq);
Workbook assessAccountExport(String assessAccountsId);
/**
* 列表明细
* @param assessAccountsId
* @return
*/
List<ChAssessDetailAccountsResp> queryAssessAccountsDetail(String assessAccountsId);
int updateChAssessAccounts(int id);
}
......@@ -9,23 +9,21 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.hungraim.ltc.api.AttachFeignService;
import com.hungraim.ltc.dao.*;
import com.hungraim.ltc.pojo.entity.SysConfig.ChFndAttach;
import com.hungraim.ltc.pojo.entity.assessment.*;
import com.hungraim.ltc.pojo.entity.disable.ChCfgSrvDisableLevel;
import com.hungraim.ltc.pojo.entity.disable.ChDisableInfo;
import com.hungraim.ltc.pojo.entity.serviceManage.ChSrvTaskDetail;
import com.hungraim.ltc.pojo.vo.account.AssessAccountsExportResp;
import com.hungraim.ltc.pojo.vo.account.AssessAccountsListResp;
import com.hungraim.ltc.pojo.vo.assessment.*;
import com.hungraim.ltc.pojo.vo.disable.SrvOrganEmpExportVo;
import com.hungraim.ltc.pojo.vo.system.AttachUpdateVo;
import com.hungraim.ltc.service.ChAprReportFractionService;
import com.hungraim.ltc.service.TaskService;
import com.hungraim.ltc.service.TppesApiException;
import com.hungraim.ltc.util.AttachType;
import com.hungraim.ltc.util.Result;
import com.hungraim.ltc.util.ResultCode;
import com.hungraim.ltc.util.SerialNumberUtils;
import com.hungraim.ltc.util.*;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
......@@ -34,9 +32,8 @@ import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.awt.*;
import java.math.BigDecimal;
import java.util.*;
import java.util.List;
import java.util.stream.Collectors;
/**
......@@ -64,6 +61,14 @@ public class TaskServiceImpl implements TaskService {
private final ChTaskReportFractionDtlMapper chTaskReportFractionDtlMapper;
private final ChAssessAccountsDetailMapper chAssessAccountsDetailMapper;
private final ChAssessAccountsMapper chAssessAccountsMapper;
private final ChAssessDetailAccountsMapper chAssessDetailAccountsMapper;
/**
* 评定任务分配列表
*
......@@ -200,6 +205,87 @@ public class TaskServiceImpl implements TaskService {
}
@Override
public void assessAccount(ReportDetailVO reportDetailVo){
Integer disableLevelId = reportDetailVo.getDisableLevelId();
if(disableLevelId==1||disableLevelId ==2 ){
return;
}
Integer person1 = reportDetailVo.getPerson1();
Integer person2 = reportDetailVo.getPerson2();
String evaluateTime = reportDetailVo.getEvaluateTime();
Date evaluateDate = DateUtils.strToDate(evaluateTime);
List<ChDisableInfo> chDisableInfos = disableInfoMapper.selectList(new LambdaQueryWrapper<ChDisableInfo>().eq(ChDisableInfo::getApplyId, reportDetailVo.getApplyId()));
Integer srvModeId = chDisableInfos.get(0).getSrvModeId();
// 根据评定机构id和评估结算时间查找表里有没有数据,有数据直接累加费用
// 评定人员结算表插入
if (person1 != null) {
ChAssessDetailAccounts chAssessDetailAccounts = new ChAssessDetailAccounts();
chAssessDetailAccounts.setEmpId(String.valueOf(person1));
ChAprEmp chAprEmp = aprEmpMapper.selectById(person1);
Integer aprOrganId = chAprEmp.getAprOrganId();
chAssessDetailAccounts.setAprOrganId(String.valueOf(aprOrganId));
chAssessDetailAccounts.setApplyId(reportDetailVo.getApplyId());
chAssessDetailAccounts.setCreationTime(new Date());
chAssessDetailAccounts.setAccountsTime(evaluateDate);
chAssessDetailAccounts.setAssessTime(evaluateDate);
Integer aprempTypeIdS = chAprEmp.getAprempTypeIdS();
// 1 评估员上门评估,每人次 100 元
// 5 评估专家上门评估,每人次 150 元
String assessCost = aprempTypeIdS==1? "100":"150";
chAssessDetailAccounts.setAssessCost(assessCost);
Long assessAccountsId = saveAssess(aprOrganId, assessCost,srvModeId,evaluateDate);
chAssessDetailAccounts.setAssessAccountsId(assessAccountsId);
chAssessAccountsDetailMapper.insert(chAssessDetailAccounts);
}
if (person2 != null) {
ChAssessDetailAccounts chAssessDetailAccounts = new ChAssessDetailAccounts();
chAssessDetailAccounts.setEmpId(String.valueOf(person2));
ChAprEmp chAprEmp = aprEmpMapper.selectById(person2);
Integer aprOrganId = chAprEmp.getAprOrganId();
chAssessDetailAccounts.setAprOrganId(String.valueOf(aprOrganId));
chAssessDetailAccounts.setApplyId(reportDetailVo.getApplyId());
chAssessDetailAccounts.setCreationTime(new Date());
chAssessDetailAccounts.setAccountsTime(evaluateDate);
chAssessDetailAccounts.setAssessTime(evaluateDate);
Integer aprempTypeIdS = chAprEmp.getAprempTypeIdS();
// 1 评估员上门评估,每人次 100 元
// 5 评估专家上门评估,每人次 150 元
String assessCost = aprempTypeIdS==1? "100":"150";
chAssessDetailAccounts.setAssessCost(assessCost);
Long assessAccountsId = saveAssess(aprOrganId, assessCost,srvModeId,evaluateDate);
chAssessDetailAccounts.setAssessAccountsId(assessAccountsId);
chAssessAccountsDetailMapper.insert(chAssessDetailAccounts);
}
}
private Long saveAssess(Integer aprOrganId, String assessCost,Integer modeId,Date evaluateDate) {
Long assessAccountsId;
AssessIdAndCostVO assessIdAndCostVO = chAssessAccountsMapper.queryAssessByOrganIdAndTime(String.valueOf(aprOrganId), DateUtils.dateToStrYm(evaluateDate),String.valueOf(modeId));
if (assessIdAndCostVO == null) {
ChAssessAccounts chAssessAccounts = new ChAssessAccounts();
chAssessAccounts.setAccountsTime(evaluateDate);
chAssessAccounts.setAprOrganId(Long.valueOf(aprOrganId));
chAssessAccounts.setCreationTime(new Date());
chAssessAccounts.setAccountsStatus((short)1);
chAssessAccounts.setModeId(modeId);
chAssessAccounts.setAssessAllCost(new BigDecimal(assessCost));
chAssessAccountsMapper.insert(chAssessAccounts);
assessAccountsId = chAssessAccounts.getAssessAccountsId();
}else{
assessAccountsId = assessIdAndCostVO.getAssessAccountsId();
BigDecimal assessAllCost = assessIdAndCostVO.getAssessAllCost();
ChAssessAccounts chAssessAccounts = new ChAssessAccounts();
chAssessAccounts.setAssessAccountsId(assessAccountsId);
chAssessAccounts.setAssessAllCost(assessAllCost.add(new BigDecimal(assessCost)));
chAssessAccountsMapper.updateById(chAssessAccounts);
}
return assessAccountsId;
}
@Override
public TaskReportVO getReportById(String reportId) {
TaskReportVO reportById = taskMapper.getReportById(reportId);
List<ChAprReportFraction> chAprReportFractions = chAprReportFractionMapper.selectList(new LambdaQueryWrapper<ChAprReportFraction>().eq(ChAprReportFraction::getReportId, reportId));
......@@ -736,4 +822,38 @@ public class TaskServiceImpl implements TaskService {
return workbook;
}
@Override
public Workbook assessAccountExport(String assessAccountsId) {
List<AssessAccountsExportResp> assessAccountExportList = chAssessDetailAccountsMapper.assessAccountDetailExport(assessAccountsId);
ExportParams exportParams = new ExportParams();
exportParams.setType(ExcelType.XSSF); //对应xlsx
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, AssessAccountsExportResp.class, assessAccountExportList);
return workbook;
}
@Override
public List<ChAssessDetailAccountsResp> queryAssessAccountsDetail(String assessAccountsId) {
return chAssessDetailAccountsMapper.queryAssessAccountsDetail(assessAccountsId);
}
@Override
@Transactional(rollbackFor=Exception.class)
public int updateChAssessAccounts(int id) {
ChAssessAccounts ca = new ChAssessAccounts();
ca.setAssessAccountsId(Long.valueOf(id));
ca.setAccountsStatus((short) 2);
return chAssessAccountsMapper.updateById(ca);
}
@Override
public Page<AssessAccountsListResp> searchAssessAccountsList(SrvOrganListReq srvOrganListReq) {
// List<Long> organIds = baseAccountService.getOrganIds(srvOrganListReq.getOrganId(), srvOrganListReq.getIsInvolveChild());
return chAssessAccountsMapper.searchAssessAccountList(new Page<>(srvOrganListReq.getPageNum(), srvOrganListReq.getPageSize()), null, srvOrganListReq);
}
}
<?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.ChAssessAccountsMapper">
<!--查询评估信息-->
<select id="getAssessAccountsList" resultType="com.hungraim.ltc.pojo.vo.account.AssessAccountsVO">
select
DISTINCT task.task_id taskId,
fndOrgan.ORGAN_NAME organName,
task.ORGAN_ID aprOrganId,
(select DISTRICT_NAME from CH_FND_DISTRICT dis where task.DISTRICT_PROVINCIAL = dis.DISTRICT_CODE) districtProvincial,
(select DISTRICT_NAME from CH_FND_DISTRICT dis where task.DISTRICT_CITY = dis.DISTRICT_CODE) districtCity,
(select DISTRICT_NAME from CH_FND_DISTRICT dis where task.DISTRICT_AREA = dis.DISTRICT_CODE) districtArea,
disable.DISAB_INFO_ID disabInfoId,
disable.real_name realName,
disable.certi_code certiCode,
disable.BIRTHDAY birthday,
disable.tel tel,
disable.gender gender,
(SELECT dis.DISTRICT_NAME FROM CH_FND_DISTRICT dis WHERE disable.DISTRICT_PROVINCIAL = dis.DISTRICT_CODE) disDistrictProvincial,
(SELECT dis.DISTRICT_NAME FROM CH_FND_DISTRICT dis WHERE disable.district_city = dis.DISTRICT_CODE) disDistrictCity,
(SELECT dis.DISTRICT_NAME FROM CH_FND_DISTRICT dis WHERE disable.district_area = dis.DISTRICT_CODE) disDistrictArea,
disable.end_time endTime,
task.finish_time finishTime,
emp.APREMP_TYPE_NAME_F aprempTypeName
from CH_APR_TASK task
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_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_FND_ORGAN fndOrgan on task.ORGAN_ID = fndOrgan.ORGAN_ID
where task.task_status = 2 and emp.APREMP_TYPE_NAME_F is not null
<mapper namespace="com.hungraim.ltc.dao.ChAssessAccountsMapper">
<select id="queryAssessByOrganIdAndTime" resultType="com.hungraim.ltc.pojo.vo.assessment.AssessIdAndCostVO">
select a.ASSESS_ACCOUNTS_ID assessAccountsId,a.ASSESS_ALL_COST assessAllCost from
CH_ASSESS_ACCOUNTS a where a.APR_ORGAN_ID = #{aprOrganId}
and to_char(a.ACCOUNTS_TIME,'yyyy-MM') = #{accountsTime}
and a.MODE_ID = #{modeId}
</select>
<select id="searchAssessAccountList" resultType="com.hungraim.ltc.pojo.vo.account.AssessAccountsListResp">
SELECT
t1.ASSESS_ACCOUNTS_ID,
t3.ORGAN_ID,
t3.ORGAN_NAME,
t2.SRV_ORGAN_ID,
t2.SRV_ORGAN_NAME,
t2.ORGAN_ID,
t1.MODE_ID,
mode1.mode_name modeName,
t2.ORGAN_NAME,
t1.ACCOUNTS_TIME,
t1.ACCOUNTS_STATUS,
t1.ASSESS_ALL_COST,
t1.ASSESS_START_TIME,
t1.ASSESS_END_TIME
t1.ASSESS_ALL_COST
FROM
CH_ASSESS_ACCOUNTS t1
LEFT JOIN CH_SRV_ORGAN t2 ON t1.APR_ORGAN_ID = t2.SRV_ORGAN_ID
LEFT JOIN CH_APR_ORGAN t2 ON t1.APR_ORGAN_ID = t2.APR_ORGAN_ID
LEFT JOIN CH_FND_ORGAN t3 ON t2.ORGAN_ID = t3.ORGAN_ID
left join ch_cfg_srv_mode mode1 on t1.mode_id = mode1.mode_id
<where>
<if test='organIds != null and organIds.size()>0'>
t3.ORGAN_ID IN
<foreach collection="organIds" open="(" close=")" item="organId" separator=",">
#{organId}
</foreach>
<if test="req.accountsTime != null and req.accountsTime != ''">
AND to_char(t1.ACCOUNTS_TIME,'yyyy-MM') = #{req.accountsTime}
</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 test="req.organName != null and req.organName != ''">
AND t2.ORGAN_NAME LIKE CONCAT('%',CONCAT(#{req.organName},'%'))
</if>
</where>
</select>
......@@ -102,19 +68,14 @@
</where>
</select>
<select id="assessAccountDetailExport" resultType="com.hungraim.ltc.pojo.vo.account.AssessAccountsExportResp">
SELECT
t3.SRV_ORGAN_NAME,
to_char(t1.ACCOUNTS_TIME,'yyyy-MM') accountsTime,
t1.ASSESS_ALL_COST assessCost,
to_char(t1.ASSESS_START_TIME,'yyyy-MM-dd') assessStartTime,
to_char(t1.ASSESS_END_TIME,'yyyy-MM-dd') assessEndTime
FROM
CH_ASSESS_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.ASSESS_ACCOUNTS_ID = #{assessAccountsId}
<select id="getAssessAccountsList" resultType="com.hungraim.ltc.pojo.vo.account.AssessAccountsVO">
select * from CH_ASSESS_ACCOUNTS t1 where
</select>
</mapper>
<?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.dao.ChAssessDetailAccountsMapper">
<select id="queryAssessAccountsDetail"
resultType="com.hungraim.ltc.pojo.entity.assessment.ChAssessDetailAccountsResp">
select
apply.REAL_NAME realName,
d.ASSESS_COST assessAllCost,
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,
to_char(d.assess_time,'yyyy-MM-dd') assessTime,
emp.REAL_NAME empName
from CH_ASSESS_ACCOUNTS_DETAIL d
left join CH_DISABLE_APPLY apply on d.APPLY_ID=apply.APPLY_ID
left join CH_APR_ORGAN organ on organ.APR_ORGAN_ID = d.APR_ORGAN_ID
left join CH_APR_EMP emp on emp.EMP_ID = d.EMP_ID
where d.ASSESS_ACCOUNTS_ID = #{assessAccountsId}
</select>
<select id="assessAccountDetailExport" resultType="com.hungraim.ltc.pojo.vo.account.AssessAccountsExportResp">
SELECT
t2.REAL_NAME realName,
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,
FROM
CH_ASSESS_ACCOUNTS_DETAIL t1
left join CH_DISABLE_APPLY t2 on t1.APPLY_ID = t2.APPLY_ID
LEFT JOIN CH_APR_ORGAN t3 ON t1.APR_ORGAN_ID = t3.APR_ORGAN_ID
left join CH_APR_EMP t4 on t4.EMP_ID = t1.EMP_ID
where t1.ASSESS_ACCOUNTS_ID = #{assessAccountsId}
</select>
</mapper>
......@@ -16,6 +16,4 @@ public class AuthApplication {
public static void main(String[] args) {
SpringApplication.run(AuthApplication.class, args);
}
}
......@@ -69,6 +69,12 @@ public class ChDisabDetailAccounts implements Serializable {
*/
private Date accountsEndTime;
private String taskDetailId;
private String medicalArea;
private String itemIds;
private static final long serialVersionUID = 1L;
}
\ No newline at end of file
package com.hungraim.ltc.pojo.entity.account;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.KeySequence;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
@Data
public class ChDisabDetailAccountsResp implements Serializable {
/**
* 结算月份
*/
private String accountsTime;
/**
* 应拨总费用
*/
private String accountsAllCost;
private String accountsOverallCost;
private String accountsPersonalCost;
/**
* 服务方式
*/
private String modeName;
/**
* 费用开始日期
*/
private String accountsStartTime;
/**
* 费用结束日期
*/
private String accountsEndTime;
private String medicalArea;
private String srvOrganName;
private String realName;
private static final long serialVersionUID = 1L;
}
\ No newline at end of file
package com.hungraim.ltc.pojo.entity.account;
package com.hungraim.ltc.pojo.entity.assessment;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.KeySequence;
......@@ -9,6 +9,7 @@ import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
......@@ -26,7 +27,7 @@ public class ChAssessAccounts implements Serializable {
private Long assessAccountsId;
/**
* 机构id
* 评定机构id
*/
private Long aprOrganId;
......@@ -46,10 +47,6 @@ public class ChAssessAccounts implements Serializable {
private Date accountsTime;
/**
* 是否结算(0未结算,1已结算)
*/
private Short chooseSettle;
/**
* 状态(0-待提交;1-待审核;2-已审核;3-已失效;)
......@@ -66,35 +63,14 @@ public class ChAssessAccounts implements Serializable {
*/
private String checkRemark;
/**
* 省
*/
private String districtProvincial;
/**
* 市
*/
private String districtCity;
/**
* 区
*/
private String districtArea;
/**
* 费用开始日期
*/
private Date assessStartTime;
/**
* 费用结束日期
*/
private Date assessEndTime;
/**
* 总费用合计
*/
private String assessAllCost;
private BigDecimal assessAllCost;
private Integer modeId;
private static final long serialVersionUID = 1L;
......
package com.hungraim.ltc.pojo.entity.account;
package com.hungraim.ltc.pojo.entity.assessment;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.KeySequence;
......@@ -9,7 +9,6 @@ import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
......@@ -26,13 +25,18 @@ public class ChAssessDetailAccounts implements Serializable {
private Long assessAccountsDetailId;
private Long assessAccountsId;
private String disabInfoId;
private String applyId;
private String empId;
/**
* 护理机构id
* 评定机构id
*/
private String srvOrganId;
private String aprOrganId;
/**
* 创建时间
......@@ -44,28 +48,11 @@ public class ChAssessDetailAccounts implements Serializable {
/**
* 结算月份
*/
@DateTimeFormat(pattern = "yyyy-MM")
@JsonFormat(pattern = "yyyy-MM",timezone = "GMT+8")
private Date accountsTime;
private Date assessTime;
private String assessAllCost;
private String assessOverallCost;
private String assessPersonalCost;
/**
* 费用开始日期
*/
private Date assessStartTime;
/**
* 费用结束日期
*/
private Date assessEndTime;
private String assessCost;
private static final long serialVersionUID = 1L;
......
package com.hungraim.ltc.pojo.entity.assessment;
import lombok.Data;
import java.io.Serializable;
@Data
public class ChAssessDetailAccountsResp implements Serializable {
private String realName;
private String empName;
/**
* 结算月份
*/
private String accountsTime;
/**
* 评估时间
*/
private String assessTime;
/**
* 评估总费用
*/
private String assessAllCost;
/**
* 评估机构名称
*/
private String assessOrganName;
/**
* 统筹区
*/
private String medicalArea;
private static final long serialVersionUID = 1L;
}
\ No newline at end of file
......@@ -610,12 +610,12 @@ public class ChDisableApply extends PageInfo implements Serializable {
/**
*医保统筹区省
*/
private String medicalProvincial;
// private String medicalProvincial;
/**
*医保统筹区市
*/
private String medicalCity;
//private String medicalCity;
/**
*医保统筹区区
......
package com.hungraim.ltc.pojo.entity.governance;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.KeySequence;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.util.Date;
@Data
@TableName("CH_SRV_PLAN")
@KeySequence("SEQ_CH_SRV_PLAN")
public class ChSrvPlan {
@TableId(value = "plan_ID", type = IdType.INPUT)
private Long planID;
private Long srvOrganId;
private Long disabInfoId;
private Long modeId;
private Long empId;
private Long taskDetailId;
private Long itemId;
private String itemName;
private Date creationTime;
private Date srvPlanTime;
private Long isStatus;
}
package com.hungraim.ltc.pojo.vo.account;
import lombok.Data;
@Data
public class AccountTaskExecuteReqVO {
private String planId;
private String taskDetailId;
private String itemId;
private String srvDate;
}
package com.hungraim.ltc.pojo.vo.account;
import lombok.Data;
import java.util.List;
@Data
public class AccountTaskReqVO {
private List<AccountTaskExecuteReqVO> accountTaskList;
}
......@@ -11,24 +11,22 @@ import java.util.Date;
public class AssessAccountsExportResp {
@Excel(name = "统筹区",width = 20)
private String medicalArea;
@Excel(name = "适用机构名称",width = 20)
private String organName;
@Excel(name = "失能人员姓名",width = 20)
private String realName;
@Excel(name = "评估机构名称",width = 20)
private String organName;
/**
* 护理机构名称
*/
@Excel(name = "护理机构名称",width = 20)
private String srvOrganName;
@Excel(name = "评定人员姓名",width = 20)
private String empName;
/**
* 结算月份
*/
@Excel(name = "结算月份",width = 20)
private String accountsTime;
@Excel(name = "评估时间",width = 20)
private String assessTime;
/**
......@@ -38,19 +36,4 @@ public class AssessAccountsExportResp {
private String assessCost;
/**
* 费用开始时间
*/
@Excel(name = "费用开始时间",width = 20)
private String assessStartTime;
/**
* 费用结束时间
*/
@Excel(name = "费用结束时间",width = 20)
private String assessEndTime;
}
......@@ -15,26 +15,19 @@ public class AssessAccountsListResp {
private Long assessAccountsId;
/**
* 适用机构id
* 评估机构id
*/
private Long organId;
/**
* 适用机构名称
* 评估机构名称
*/
private String organName;
/**
* 护理机构id
*/
private String srvOrganId;
private String disabInfoId;
private String modeName;
/**
* 护理机构名称
*/
private String srvOrganName;
private String modeId;
/**
* 结算月份
......@@ -48,24 +41,11 @@ public class AssessAccountsListResp {
*/
private Short accountsStatus;
/**
* 总费用
*/
private String assessCost;
/**
* 费用开始时间
*/
private String assessStartTime;
private String assessAllCost;
/**
* 费用结束时间
*/
private String assessEndTime;
private String aprempTypeName;
// private String aprempTypeName;
......
......@@ -9,9 +9,8 @@ import lombok.Data;
public class AssessAccountsVO {
private String organName;
private String aprOrganId;
private String districtProvincial;
private String districtCity;
private String districtArea;
private String aprempTypeName;
private String disabInfoId;
private String acceptTime;
private String finishTime;
}
......@@ -10,6 +10,10 @@ import java.math.BigDecimal;
@Data
public class OrganAccountsVO {
private String taskDetailId;
private String itemId;
private String disabInfoId;
/**
* 失能人员姓名
......@@ -39,12 +43,11 @@ public class OrganAccountsVO {
* 护理机构名称
*/
private String srvOrganName;
/**
* 所在省市
* 医保统筹区
*/
private String districtProvincial;
private String districtCity;
private String districtArea;
private String medicalArea;
/**
* 护理服务人员
*/
......@@ -53,6 +56,16 @@ public class OrganAccountsVO {
* 任务时间
*/
private String srvDate;
/**
* 任务开始时间
*/
private String srvStartTime;
/**
* 任务结束时间
*/
private String srvEndTime;
/**
* 机构等级
*/
......@@ -74,4 +87,6 @@ public class OrganAccountsVO {
*/
private BigDecimal personalCost;
private String itemName;
}
......@@ -15,6 +15,9 @@ public class SrvOrganAccountListResp {
*/
private Long accountsId;
private String modeName;
/**
* 适用机构id
*/
......@@ -73,5 +76,10 @@ public class SrvOrganAccountListResp {
*/
private String svrEndTime;
/**
* 实拨总费用
*/
private String totalAllocatedExpenses;
}
......@@ -26,6 +26,12 @@ public class SrvOrganListReq extends BaseReq {
*/
private Long srvOrganId;
/**
* 护理机构id
*/
private String srvOrganName;
/**
* 结算月份
*/
......
package com.hungraim.ltc.pojo.vo.account;
import com.hungraim.ltc.pojo.vo.BaseReq;
import lombok.Data;
/**
* @author zwl
**/
@Data
public class SrvTaskReqVO extends BaseReq {
//失能人员姓名
private String realName;
// 任务时间
private String srvDate;
private String status;
private String srvOrganName;
}
package com.hungraim.ltc.pojo.vo.account;
import lombok.Data;
/**
* @author zwl
**/
@Data
public class SrvTaskRespVO {
private Long planId;
// 任务id
private Long taskDetailId;
// 失能人员姓名
private String realName;
// 护理机构
private String srvOrganName;
// 护理人员
private String empName;
// 任务时间
private String srvDate;
// 任务名称
private String itemName;
// 任务名称
private Long itemId;
private Long status;
private String srvModeName;
}
package com.hungraim.ltc.pojo.vo.assessment;
import lombok.Data;
import java.math.BigDecimal;
@Data
public class AssessIdAndCostVO {
private Long assessAccountsId;
private BigDecimal assessAllCost;
}
......@@ -15,6 +15,7 @@ public class ReportDetailVO {
Integer person3;
String evaluateTime;
Integer disableLevelId;
String applyId;
String polNo;
String remark;
List<ChFndAttach> fileDataList;
......
package com.hungraim.ltc.pojo.vo.assessment;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.hungraim.ltc.pojo.vo.BaseReq;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
@Data
public class SrvOrganListReq extends BaseReq {
/**
* 适用机构id
*/
private Long organId;
private String organName;
/**
* 是否包含下级机构
*/
// private Boolean isInvolveChild;
/**
* 护理机构id
*/
// private Long srvOrganId;
/**
* 结算月份
*/
@JsonFormat(pattern = "yyyy-MM", timezone = "GMT+8")
private String accountsTime;
}
......@@ -34,12 +34,12 @@ public class DisableExamineInfoVO {
/**
*医保统筹区省
*/
private String medicalProvincial;
// private String medicalProvincial;
/**
*医保统筹区市
*/
private String medicalCity;
// private String medicalCity;
/**
*医保统筹区区
......@@ -125,5 +125,7 @@ public class DisableExamineInfoVO {
// 复评备注
private String reasonsRemark;
private String bankCardNo;
private List<ChFndAttach> fileDataList;
}
......@@ -229,6 +229,22 @@ public class DateUtils {
}
/**
* 将短时间格式时间转换为字符串 yyyy-MM
*
* @param dateDate
* @param
* @return
*/
public static String dateToStrYm(Date dateDate) {
if (dateDate == null) {
return "";
}
SimpleDateFormat formatter = new SimpleDateFormat(DATE_PATTERN_yyyy_MM);
String dateString = formatter.format(dateDate);
return dateString;
}
/**
* 将短时间格式时间转换为字符串 yyyyMMdd
*
* @param dateDate
......@@ -864,7 +880,7 @@ public class DateUtils {
* @return
*/
public static String getlastMonth(){
SimpleDateFormat ym=new SimpleDateFormat(DATE_PATTERN_yyyy_MM);
SimpleDateFormat ym=new SimpleDateFormat(DATE_PATTERN_yyyy_MM_dd);
Calendar calendar = Calendar.getInstance();
calendar.add(Calendar.MONTH,-1);
String lastMonth =ym.format(calendar.getTime());
......@@ -876,7 +892,7 @@ public class DateUtils {
* @return
*/
public static Date getlastMonth(String str){
DateFormat fmt =new SimpleDateFormat(DATE_PATTERN_yyyy_MM);
DateFormat fmt =new SimpleDateFormat(DATE_PATTERN_yyyy_MM_dd);
Date date = null;
try {
date = fmt.parse(str);
......
......@@ -31,6 +31,8 @@ public enum ResultCode implements IResultCode, Serializable {
TOKEN_INVALID_OR_EXPIRED("A0230", "token无效或已过期"),
// 请求参数错误,参数校验不通过
REQUEST_PARAM_ERROR("Q0001", "请求参数错误"),
//文件类型不匹配
FILE_TYPE_ERROR("F0001", "文件类型不支持"),
// 请求参数错误,参数校验不通过
SRV_ORGAN_NOT_QUERY("S0001", "未查询到数据"),
/**
......
......@@ -96,6 +96,18 @@
<artifactId>apply-api</artifactId>
<version>0.0.1</version>
</dependency>
<dependency>
<groupId>com.hungraim.ltc</groupId>
<artifactId>account-api</artifactId>
<version>0.0.1</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.hungraim.ltc</groupId>
<artifactId>account-api</artifactId>
<version>0.0.1</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>
......
......@@ -2,6 +2,8 @@ package com.hungraim.ltc.governance.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hungraim.ltc.governance.service.SrvTaskService;
import com.hungraim.ltc.pojo.vo.account.SrvTaskReqVO;
import com.hungraim.ltc.pojo.vo.account.SrvTaskRespVO;
import com.hungraim.ltc.pojo.vo.governance.*;
import com.hungraim.ltc.util.Result;
import com.hungraim.ltc.util.ResultCode;
......@@ -9,10 +11,7 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import java.util.Date;
import java.util.List;
......@@ -135,7 +134,14 @@ public class SrvTaskController {
e.printStackTrace();
return Result.failed(e.getMessage());
}
srvTaskService.otherPlaceHandler(param.getProgramId());
return Result.success();
}
@GetMapping("otherPlaceHandler")
public void otherPlaceHandler(String programId){
srvTaskService.otherPlaceHandler(programId);
}
}
package com.hungraim.ltc.governance.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hungraim.ltc.pojo.entity.governance.ChSrvPlan;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;
import java.util.List;
@Repository
@Mapper
public interface ChSrvPlanMapper extends BaseMapper<ChSrvPlan> {
List<ChSrvPlan> queryPlan(String programId);
}
package com.hungraim.ltc.governance.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hungraim.ltc.pojo.vo.account.SrvTaskReqVO;
import com.hungraim.ltc.pojo.vo.account.SrvTaskRespVO;
import com.hungraim.ltc.pojo.vo.governance.*;
import org.springframework.stereotype.Service;
......@@ -18,6 +20,9 @@ public interface SrvTaskService {
List<SrvTaskInfoVO> getSrvTaskInfoList(String programId);
// mode_id 4
void otherPlaceHandler(String programId);
Page<OrganEmpVO> getSrvOrganEmpList(Page<OrganEmpVO> page, String organId, String name, String certiType, String certifNum);
Page<SrvTaskDetailVO> getSrvTaskDetailList(Page<SrvTaskDetailVO> page, Integer organId, String disableName, String disableTel, String empName, String certifNum, Date startTime, Date endTime, String status, String modeId);
......@@ -26,4 +31,5 @@ public interface SrvTaskService {
* 新增或者修改服务计划
*/
void addOrUpdateSrvTask(SrvTaskInfoListVO param);
}
......@@ -3,19 +3,20 @@ package com.hungraim.ltc.governance.service.impl;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hungraim.ltc.api.AccountFeignService;
import com.hungraim.ltc.api.AttachFeignService;
import com.hungraim.ltc.governance.dao.ChSrvPlanMapper;
import com.hungraim.ltc.governance.dao.ChSrvTaskDetailMapper;
import com.hungraim.ltc.governance.dao.SrvTaskMapper;
import com.hungraim.ltc.governance.service.SrvTaskService;
import com.hungraim.ltc.pojo.entity.SysConfig.ChFndAttach;
import com.hungraim.ltc.pojo.entity.governance.ChSrvPlan;
import com.hungraim.ltc.pojo.entity.serviceManage.ChSrvTask;
import com.hungraim.ltc.pojo.entity.serviceManage.ChSrvTaskDetail;
import com.hungraim.ltc.pojo.vo.governance.*;
import com.hungraim.ltc.pojo.vo.system.AttachUpdateVo;
import com.hungraim.ltc.util.AttachType;
import com.hungraim.ltc.util.DateUtils;
import com.hungraim.ltc.util.Result;
import com.hungraim.ltc.util.ResultCode;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
......@@ -35,6 +36,10 @@ public class SrvTaskServiceImpl implements SrvTaskService {
private final SrvTaskMapper srvTaskMapper;
private final ChSrvTaskDetailMapper chSrvTaskDetailMapper;
private final AttachFeignService attachFeignService;
private final ChSrvPlanMapper chSrvPlanMapper;
private final AccountFeignService accountFeignService;
/**
* 服务计划制定列表
......@@ -137,6 +142,7 @@ public class SrvTaskServiceImpl implements SrvTaskService {
//添加服务计划详情
Long newSrvTaskId = chSrvTask.getSrvTaskId();
this.insertTaskDetail(newSrvTaskId, taskDetails);
saveSrvPlan(programId);
//添加附件
// this.updateAttachs(srvTaskInfoVO.getListAttach(), chSrvTask.getSrvTaskId());
} else {
......@@ -149,6 +155,20 @@ public class SrvTaskServiceImpl implements SrvTaskService {
}
}
public void saveSrvPlan(String programId){
List<ChSrvPlan> chSrvPlans = chSrvPlanMapper.queryPlan(programId);
for (ChSrvPlan chSrvPlan : chSrvPlans) {
chSrvPlanMapper.insert(chSrvPlan);
}
}
// mode_id 4
@Override
public void otherPlaceHandler(String programId){
accountFeignService.getOtherPlace(programId);
}
/**
* 插入服务计划详情数据
*
......
......@@ -47,7 +47,8 @@
SELECT
PROJECT_ID,
SRV_ORGAN_ID,
ITEM_NAME,
-- ITEM_NAME,
d.service_type_detailed_name ITEM_NAME,
CATEGORY_TYPE,
CH_SRV_ORGAN_PROJECT.ITEM_TIMES,
ITEM_TIMES_TYPE,
......@@ -64,7 +65,8 @@
<if test="programId != null">
LEFT JOIN CH_SRV_PROGRAM_SET ON ITEM_ID = PROJECT_ID AND PROGRAM_ID = #{programId}
</if>
WHERE SRV_ORGAN_ID = #{srvOrganId} AND STATUS = 0
left join CH_SERVICE_TYPE_detailed d on d.service_type_detailed_id = CH_SRV_ORGAN_PROJECT.item_name
WHERE SRV_ORGAN_ID = #{srvOrganId} and STATUS = 0
</select>
<select id="organProjectList" resultType="com.hungraim.ltc.pojo.vo.governance.OrganProjectVO">
......
<?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.governance.dao.ChSrvPlanMapper">
<select id="queryPlan" resultType="com.hungraim.ltc.pojo.entity.governance.ChSrvPlan">
select
disable.DISAB_INFO_ID disabInfoId,
disable.SRV_MODE_ID modeId,
--护理机构名称
organ.srv_organ_id srvOrganId,
emp.emp_id empId,
--任务时间
detail.SRV_DATE srvPlanTime,
detail.TASK_DETAIL_ID taskDetailId,
d.SERVICE_TYPE_DETAILED_NAME itemName,
CSTFI.ITEM_ID itemId,
'0' isStatus
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_DEV.CH_DISABLE_APPLY apply on apply.apply_id = disable.apply_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_emp emp on task.srv_emp_id = emp.emp_id--护理人员
left join CH_SRV_PROGRAM_SET CSTFI on CSTFI.PROGRAM_ID = task.program_id
LEFT JOIN CH_SRV_ORGAN_PROJECT CSOP ON CSOP.PROJECT_ID = CSTFI.ITEM_ID
LEFT JOIN CH_SERVICE_TYPE_detailed d on d.service_type_detailed_id = CSOP.item_name
<where>
disable.SRV_MODE_ID in ('1','2') and program.program_id =#{programId}
</where>
order by detail.SRV_DATE desc
</select>
</mapper>
......@@ -42,8 +42,9 @@
LEFT JOIN ch_srv_send s ON s.disab_info_id = i.disab_info_id
LEFT JOIN ch_fnd_organ o ON i.organ_id = o.organ_id
LEFT JOIN CH_APR_TASK t ON i.disab_info_id = t.DISABLE_INFO_ID
left join ch_apr_report report on t.task_id = report.task_id
<where>
t.TASK_STATUS = 3
t.TASK_STATUS = 3 and report.DISABLE_LEVEL_ID in ('3','4','5')
<if test="chSrvOrgan.organId != null and chSrvOrgan.organId != ''">
AND o.organ_id = #{chSrvOrgan.organId}
</if>
......
......@@ -5,6 +5,7 @@ git pull
mvn install
docker stop ltc-poc
docker rm ltc-poc
docker rmi ltc:latest
docker build -t ltc .
docker run -d --name ltc-poc -p 9999:8001 -m 2G ltc
docker run -d -v /projects/logs/:/logs/ --name ltc-poc -p 9999:8001 -m 6G ltc
#!/bin/bash
mkdir logs
nohup java -Xms50m -Xmx200m -jar /auth.jar >./logs/auth.log &
nohup java -Xms50m -Xmx200m -jar /system-admin.jar >./logs/admin.log &
nohup java -Xms50m -Xmx200m -jar /gateway.jar >./logs/gateway.log &
nohup java -Xms50m -Xmx200m -jar /apply.jar >./logs/apply.log &
nohup java -Xms50m -Xmx200m -jar /governance.jar >./logs/govwenanc.log &
nohup java -Xms50m -Xmx200m -jar /assessment.jar >./logs/assessment.log &
nohup java -Xms50m -Xmx512m -jar /auth.jar >./logs/auth.log &
nohup java -Xms50m -Xmx512m -jar /system-admin.jar >./logs/admin.log &
nohup java -Xms50m -Xmx512m -jar /gateway.jar >./logs/gateway.log &
nohup java -Xms50m -Xmx512m -jar /apply.jar >./logs/apply.log &
nohup java -Xms50m -Xmx512m -jar /governance.jar >./logs/govwenanc.log &
nohup java -Xms50m -Xmx512m -jar /assessment.jar >./logs/assessment.log &
nohup java -Xms50m -Xmx512m -jar /account.jar >./logs/account.log &
while [[ true ]]; do
sleep 1
done
......@@ -4,11 +4,14 @@ import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
import java.util.List;
@Component
@Data
@ConfigurationProperties(prefix = "file.upload")
public class FileUploadConfig {
private String path;
private List<String> type;
}
......@@ -38,7 +38,16 @@ public class FileUploadController {
if (null == uploadType || null == file) {
return Result.failed(ResultCode.REQUEST_PARAM_ERROR);
}
//过滤上传资料类型
String originalFilename = file.getOriginalFilename();
//文件类型
String fileType = originalFilename.substring(file.getOriginalFilename().lastIndexOf("."));
List<String> fileTypes = fileUploadConfig.getType();
log.info("支持图片类型:" + fileTypes+",上传的图片类型:"+fileType);
if(!fileTypes.stream().anyMatch(e->e.equalsIgnoreCase(fileType))){
log.info("上传文件错误");
return Result.failed(ResultCode.FILE_TYPE_ERROR);
}
String realPath = FileUtils.uploadFile(file, fileUploadConfig.getPath());
log.info("文件上传成功:{}", realPath);
Long attachId = attachService.saveFileInfo(originalFilename, realPath, uploadType);
......
......@@ -34,4 +34,21 @@ mybatis-plus:
file:
upload:
path: E:/workspace/upload
\ No newline at end of file
path: E:/workspace/upload
type:
- .png
- .gif
- .jpg
- .jpeg
- .bmp
- .zip
- .rar
- .7z
- .gz
- .doc
- .docx
- .xls
- .xlsx
- .pdf
- .txt
- .csv
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