Commit 9b736296 authored by zhangwanglin's avatar zhangwanglin

结算功能代码

parent b0b035ae
......@@ -5,16 +5,19 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hungraim.ltc.account.service.AccountService;
import com.hungraim.ltc.pojo.entity.account.ChDisabAccounts;
import com.hungraim.ltc.pojo.vo.account.*;
import com.hungraim.ltc.util.FileUtils;
import com.hungraim.ltc.util.Result;
import com.hungraim.ltc.util.ResultCode;
import 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 javax.servlet.http.HttpServletResponse;
import java.text.ParseException;
import java.util.Date;
import java.util.List;
......@@ -81,7 +84,7 @@ public class AccountController {
/**
* 费用结算
*
* @return 返回机构结当月算详情
* @return 返回机构结当月算详情
*/
@GetMapping("/expenseSettlement")
public Result<ExpenseVo> expenseSettlement(ExpenseSettlementReq req) throws ParseException {
......@@ -96,4 +99,64 @@ public class AccountController {
}
return Result.success(accountService.expenseSettlement(req));
}
}
// todo 后续改成每月定时
@GetMapping("/organAccount")
public void organAccount(){
accountService.organAccount();
}
// todo 后续改成每月定时
@GetMapping("/assessAccount")
public void getAssessAccount(){
accountService.getAssessAccount();
}
/**
* 查询机构结算列表
*
* @param srvOrganListReq 请求参数对象
* @return 返回
*/
@GetMapping("/searchSrvOrganAccountList")
public Result<Page<SrvOrganAccountListResp>> searchSrvOrganAccountList(SrvOrganListReq srvOrganListReq) {
return Result.success(accountService.searchSrvOrganAccountList(srvOrganListReq));
}
/**
* 机构结算明细导出
*
*/
@GetMapping("/srvOrganAccountExport")
public void srvOrganAccountExport(String accountsId,HttpServletResponse response){
Workbook workbook = accountService.srvOrganAccountExport(accountsId);
// 命名表格
String fileName = "srvOrganAccount.xlsx";
FileUtils.exportResponse(workbook,fileName,response);
}
/**
* 查询评估结算列表
*
* @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);
}}
package com.hungraim.ltc.account.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hungraim.ltc.pojo.entity.account.ChAssessDetailAccounts;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;
@Mapper
@Repository
public interface ChAssessAccountsDetailMapper extends BaseMapper<ChAssessDetailAccounts> {
}
\ No newline at end of file
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.account.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 org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;
import java.util.List;
@Mapper
@Repository
public interface ChAssessAccountsMapper extends BaseMapper<ChAssessAccounts> {
List<AssessAccountsVO> getAssessAccountsList();
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;
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 org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;
import java.util.List;
@Mapper
@Repository
public interface ChDisabAccountsDetailMapper extends BaseMapper<ChDisabDetailAccounts> {
}
\ No newline at end of file
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);
}
......@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.hungraim.ltc.pojo.entity.account.ChDisabAccounts;
import com.hungraim.ltc.pojo.vo.account.*;
import org.apache.poi.ss.usermodel.Workbook;
import java.text.ParseException;
......@@ -16,7 +17,19 @@ public interface AccountService extends IService<ChDisabAccounts> {
Page<SrvOrganListResp> searchSrvOrganList(SrvOrganListReq srvOrganListReq);
Page<SrvOrganAccountListResp> searchSrvOrganAccountList(SrvOrganListReq srvOrganListReq);
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);
}
package com.hungraim.ltc.account.service.impl;
import cn.afterturn.easypoi.excel.ExcelExportUtil;
import cn.afterturn.easypoi.excel.entity.ExportParams;
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.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
......@@ -11,12 +15,16 @@ 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.serviceManage.ChSrvTaskDetail;
import com.hungraim.ltc.pojo.vo.account.*;
import com.hungraim.ltc.util.*;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.ss.usermodel.Workbook;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
......@@ -25,10 +33,8 @@ import java.math.BigDecimal;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import java.util.*;
import java.util.stream.Collectors;
@Service
@AllArgsConstructor
......@@ -45,6 +51,10 @@ 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;
@Override
@Transactional(rollbackFor = Exception.class)
......@@ -64,6 +74,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);
}
@Override
public AccountOperVo getSrvOrganDetail(Long accountsId) {
AccountOperVo accountOperVo = disabAccountsMapper.getDetailById(accountsId);
try {
......@@ -370,7 +386,7 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
}
//求当月最后一天
private Date getLastDayOfMonth(Date date) {
private Date getLastDayOfMonth(Date date) {
Calendar cale = Calendar.getInstance();
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
cale.setTime(date);
......@@ -386,4 +402,240 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
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);
}
}
}
/**
* @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;
}
/**
* @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);
ExportParams exportParams = new ExportParams();
exportParams.setType(ExcelType.XSSF); //对应xlsx
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, AccountExportDetailListResp.class, srvOrganAccountExportList);
return workbook;
}
@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 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);
}
}
<?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
</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,
t1.ACCOUNTS_TIME,
t1.ACCOUNTS_STATUS,
t1.ASSESS_ALL_COST,
t1.ASSESS_START_TIME,
t1.ASSESS_END_TIME
FROM
CH_ASSESS_ACCOUNTS t1
LEFT JOIN CH_SRV_ORGAN t2 ON t1.APR_ORGAN_ID = t2.SRV_ORGAN_ID
LEFT JOIN CH_FND_ORGAN t3 ON t2.ORGAN_ID = t3.ORGAN_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>
<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>
</where>
</select>
<select id="searchAssessAccountExportList" resultType="com.hungraim.ltc.pojo.vo.account.AssessAccountsExportResp">
SELECT
t1.ASSESS_ACCOUNTS_ID,
t3.ORGAN_ID,
t3.ORGAN_NAME,
t2.SRV_ORGAN_ID,
t2.SRV_ORGAN_NAME,
to_char(t1.ACCOUNTS_TIME,'yyyy-MM') accountsTime,
DECODE(t1.ACCOUNTS_STATUS, '0','待提交','1', '待审核','2', '已审核','3', '已失效') accountsStatus,
t1.ASSESS_ALL_COST,
to_char(t1.ASSESS_START_TIME,'yyyy-MM-dd') assessStartTime,
to_char(t1.ASSESS_END_TIME,'yyyy-MM-dd') assessEndTime
FROM
CH_ASSESS_ACCOUNTS t1
LEFT JOIN CH_SRV_ORGAN t2 ON t1.APR_ORGAN_ID = t2.SRV_ORGAN_ID
LEFT JOIN CH_FND_ORGAN t3 ON t2.ORGAN_ID = t3.ORGAN_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>
<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>
</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>
</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.account.dao.ChOrganAccountsMapper">
<!--查询机构失能人员信息-->
<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>
<!--查询评估信息-->
<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.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
</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.SVR_END_TIME
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>
<if test='organIds != null and organIds.size()>0'>
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>
</where>
</select>
<select id="searchSrvOrganAccountDetailExport" resultType="com.hungraim.ltc.pojo.vo.account.AccountExportDetailListResp">
select
t3.SRV_ORGAN_NAME srvOrganName,
to_char(t1.ACCOUNTS_TIME,'yyyy-MM') accountsTime,
t1.ACCOUNTS_ALL_COST accountsAllCost,
t1.ACCOUNTS_OVERALL_COST accountsOverallCost,
t1.ACCOUNTS_PERSONAL_COST accountsPersonalCost,
to_char(t1.ACCOUNTS_START_TIME,'yyyy-MM-dd') accountsStartTime,
to_char(t1.ACCOUNTS_END_TIME,'yyyy-MM-dd') accountsEndTime
from CH_DISAB_ACCOUNTS_DETAIL t1
left join ch_disable_info t2 on t1.disab_info_id = t2.disab_info_id
LEFT JOIN CH_SRV_ORGAN t3 ON t1.SRV_ORGAN_ID = t3.SRV_ORGAN_ID
where t1.ACCOUNTS_ID = #{accountsId}
</select>
</mapper>
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.util.Date;
/**
* CH_DISAB_ACCOUNTS
* @author zwl
*/
@Data
@TableName("CH_ASSESS_ACCOUNTS")
@KeySequence("SEQ_CH_ASSESS_ACCOUNTS")
public class ChAssessAccounts implements Serializable {
/**
* 评估结算id
*/
@TableId(value = "ASSESS_ACCOUNTS_ID", type = IdType.INPUT)
private Long assessAccountsId;
/**
* 机构id
*/
private Long aprOrganId;
/**
* 创建时间
*/
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
private Date creationTime;
/**
* 结算月份
*/
@DateTimeFormat(pattern = "yyyy-MM")
@JsonFormat(pattern = "yyyy-MM",timezone = "GMT+8")
private Date accountsTime;
/**
* 是否结算(0未结算,1已结算)
*/
private Short chooseSettle;
/**
* 状态(0-待提交;1-待审核;2-已审核;3-已失效;)
*/
private Short accountsStatus;
/**
* 审核人姓名
*/
private String checkName;
/**
* 审核备注
*/
private String checkRemark;
/**
* 省
*/
private String districtProvincial;
/**
* 市
*/
private String districtCity;
/**
* 区
*/
private String districtArea;
/**
* 费用开始日期
*/
private Date assessStartTime;
/**
* 费用结束日期
*/
private Date assessEndTime;
/**
* 总费用合计
*/
private String assessAllCost;
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;
/**
* CH_DISAB_ACCOUNTS_DETAIL
*/
@Data
@TableName("CH_ASSESS_ACCOUNTS_DETAIL")
@KeySequence("SEQ_CH_ASSESS_ACCOUNTS_DETAIL")
public class ChAssessDetailAccounts implements Serializable {
/**
* 结算id
*/
@TableId(value = "ASSESS_ACCOUNTS_DETAIL_ID", type = IdType.INPUT)
private Long assessAccountsDetailId;
private Long assessAccountsId;
private String disabInfoId;
/**
* 护理机构id
*/
private String srvOrganId;
/**
* 创建时间
*/
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
private Date creationTime;
/**
* 结算月份
*/
@DateTimeFormat(pattern = "yyyy-MM")
@JsonFormat(pattern = "yyyy-MM",timezone = "GMT+8")
private Date accountsTime;
private String assessAllCost;
private String assessOverallCost;
private String assessPersonalCost;
/**
* 费用开始日期
*/
private Date accountsStartTime;
/**
* 费用结束日期
*/
private Date accountsEndTime;
private static final long serialVersionUID = 1L;
}
\ No newline at end of file
......@@ -74,5 +74,33 @@ public class ChDisabAccounts implements Serializable {
*/
private String checkRemark;
/**
* 服务方式
*/
private String modeName;
/**
* 费用开始日期
*/
private Date svrStartTime;
/**
* 费用结束日期
*/
private Date svrEndTime;
/**
* 总费用合计
*/
private String allCost;
/**
* 统筹支出
*/
private String overallCost;
/**
* 个人支出
*/
private String personalCost;
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;
/**
* CH_DISAB_ACCOUNTS_DETAIL
*/
@Data
@TableName("CH_DISAB_ACCOUNTS_DETAIL")
@KeySequence("SEQ_CH_DISAB_DETAIL_ACCOUNTS")
public class ChDisabDetailAccounts implements Serializable {
/**
* 结算id
*/
@TableId(value = "ACCOUNTS_DETAIL_ID", type = IdType.INPUT)
private Long accountsDetailId;
private Long accountsId;
private String disabInfoId;
/**
* 护理机构id
*/
private String srvOrganId;
/**
* 创建时间
*/
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
private Date creationTime;
/**
* 结算月份
*/
@DateTimeFormat(pattern = "yyyy-MM")
@JsonFormat(pattern = "yyyy-MM",timezone = "GMT+8")
private Date accountsTime;
/**
* 应拨总费用
*/
private BigDecimal accountsAllCost;
private BigDecimal accountsOverallCost;
private BigDecimal accountsPersonalCost;
/**
* 服务方式
*/
private String modeName;
/**
* 费用开始日期
*/
private Date accountsStartTime;
/**
* 费用结束日期
*/
private Date accountsEndTime;
private static final long serialVersionUID = 1L;
}
\ No newline at end of file
package com.hungraim.ltc.pojo.vo.account;
import cn.afterturn.easypoi.excel.annotation.Excel;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
@Data
public class AccountExportDetailListResp {
/**
* 适用机构名称
*/
@Excel(name = "适用机构名称",width = 20)
private String organName;
/**
* 护理机构名称
*/
@Excel(name = "护理机构名称",width = 20)
private String srvOrganName;
/**
* 结算月份
*/
@Excel(name = "结算月份",width = 20)
private String accountsTime;
/**
* 费用开始时间
*/
@Excel(name = "费用开始时间",width = 20)
private String accountsStartTime;
/**
* 费用结束时间
*/
@Excel(name = "费用结束时间",width = 20)
private String accountsEndTime;
/**
* 总费用
*/
@Excel(name = "总费用")
private String accountsAllCost;
/**
* 统筹费用
*/
@Excel(name = "统筹支出")
private String accountsOverallCost;
/**
* 个人支付
*/
@Excel(name = "个人支付")
private String accountsPersonalCost;
}
package com.hungraim.ltc.pojo.vo.account;
import cn.afterturn.easypoi.excel.annotation.Excel;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
@Data
public class AssessAccountsExportResp {
@Excel(name = "适用机构名称",width = 20)
private String organName;
/**
* 护理机构名称
*/
@Excel(name = "护理机构名称",width = 20)
private String srvOrganName;
/**
* 结算月份
*/
@Excel(name = "结算月份",width = 20)
private String accountsTime;
/**
* 总费用
*/
@Excel(name = "总费用")
private String assessCost;
/**
* 费用开始时间
*/
@Excel(name = "费用开始时间",width = 20)
private String assessStartTime;
/**
* 费用结束时间
*/
@Excel(name = "费用结束时间",width = 20)
private String assessEndTime;
}
package com.hungraim.ltc.pojo.vo.account;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
@Data
public class AssessAccountsListResp {
/**
* 结算id
*/
private Long assessAccountsId;
/**
* 适用机构id
*/
private Long organId;
/**
* 适用机构名称
*/
private String organName;
/**
* 护理机构id
*/
private String srvOrganId;
private String disabInfoId;
/**
* 护理机构名称
*/
private String srvOrganName;
/**
* 结算月份
*/
@DateTimeFormat(pattern = "yyyy-MM")
@JsonFormat(pattern = "yyyy-MM",timezone = "GMT+8")
private Date accountsTime;
/**
* 状态(0-待提交;1-待审核;2-已审核;3-已失效;)
*/
private Short accountsStatus;
/**
* 总费用
*/
private String assessCost;
/**
* 费用开始时间
*/
private String assessStartTime;
/**
* 费用结束时间
*/
private String assessEndTime;
private String aprempTypeName;
}
package com.hungraim.ltc.pojo.vo.account;
import lombok.Data;
/**
* 评估结算VO
*/
@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;
}
package com.hungraim.ltc.pojo.vo.account;
import lombok.Data;
import java.math.BigDecimal;
/**
* 机构结算VO
*/
@Data
public class OrganAccountsVO {
private String disabInfoId;
/**
* 失能人员姓名
*/
private String realName;
/**
* 身份证号
*/
private String certiCode;
/**
* 服务方式id
*/
private String modeId;
/**
* 服务方式
*/
private String srvModeName;
/**
* 护理机构id
*/
private String srvOrganId;
/**
* 护理机构名称
*/
private String srvOrganName;
/**
* 所在省市
*/
private String districtProvincial;
private String districtCity;
private String districtArea;
/**
* 护理服务人员
*/
private String empName;
/**
* 任务时间
*/
private String srvDate;
/**
* 机构等级
*/
private String levelCode;
/**
* 失能等级
*/
private String disableLevelName;
/**
* 总费用
*/
private BigDecimal allCost;
/**
* 统筹支出
*/
private BigDecimal overallCost;
/**
* 个人支出
*/
private BigDecimal personalCost;
}
package com.hungraim.ltc.pojo.vo.account;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.checkerframework.checker.units.qual.C;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
@Data
public class SrvOrganAccountListResp {
/**
* 结算id
*/
private Long accountsId;
/**
* 适用机构id
*/
private Long organId;
/**
* 适用机构名称
*/
private String organName;
/**
* 护理机构id
*/
private Long srvOrganId;
/**
* 护理机构名称
*/
private String srvOrganName;
/**
* 结算月份
*/
@DateTimeFormat(pattern = "yyyy-MM")
@JsonFormat(pattern = "yyyy-MM",timezone = "GMT+8")
private Date accountsTime;
/**
* 状态(0-待提交;1-待审核;2-已审核;3-已失效;)
*/
private Short accountsStatus;
/**
* 总费用
*/
private String allCost;
/**
* 统筹费用
*/
private String overallCost;
/**
* 个人支付
*/
private String personalCost;
/**
* 费用开始时间
*/
private String svrStartTime;
/**
* 费用结束时间
*/
private String svrEndTime;
}
......@@ -3,6 +3,7 @@ package com.hungraim.ltc.util;
import cn.hutool.core.util.StrUtil;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.ParsePosition;
import java.text.SimpleDateFormat;
......@@ -32,6 +33,8 @@ public class DateUtils {
*/
public static final String DATE_PATTERN_yyyy_MM_dd = "yyyy-MM-dd";
public static final String DATE_PATTERN_yyyy_MM = "yyyy-MM";
/**
* MM-dd 12月25日
*/
......@@ -854,4 +857,33 @@ public class DateUtils {
}
return flag;
}
/**
* 获取当前月份的上个月
*
* @return
*/
public static String getlastMonth(){
SimpleDateFormat ym=new SimpleDateFormat(DATE_PATTERN_yyyy_MM);
Calendar calendar = Calendar.getInstance();
calendar.add(Calendar.MONTH,-1);
String lastMonth =ym.format(calendar.getTime());
return lastMonth;
}
/**
* 获取当前月份的上个月
*
* @return
*/
public static Date getlastMonth(String str){
DateFormat fmt =new SimpleDateFormat(DATE_PATTERN_yyyy_MM);
Date date = null;
try {
date = fmt.parse(str);
} catch (ParseException e) {
e.printStackTrace();
}
return date;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment