Commit c34ffeb8 authored by 蔡镇泽's avatar 蔡镇泽

费用结算

parent 25b0382b
......@@ -43,7 +43,7 @@ public interface SrvTaskMapper extends BaseMapper<ChSrvTask> {
" LEFT JOIN ch_cfg_srv_item t8 ON t8.item_id = t7.item_id" +
" LEFT JOIN ch_srv_organ t9 ON t9.srv_organ_id = t4.srv_organ_id" +
"<where> " +
" t4.srv_organ_id = #{req.srvOrganId} AND (t2.srv_start_time &lt;= to_date(#{req.accountsTime},'yyyy-MM') or t2.srv_end_time &gt;= to_date(#{req.accountsTime},'yyyy-MM'))" +
" t4.srv_organ_id = #{req.srvOrganId} AND ((t2.srv_start_time &gt;= to_date(#{req.accountsTime}, 'yyyy-MM') and t2.srv_start_time &lt;= to_date(#{req.accountsLastDayTime}, 'yyyy-MM-dd')) or (t2.srv_end_time &gt;= to_date(#{req.accountsTime}, 'yyyy-MM') and t2.srv_end_time &lt;= to_date(#{req.accountsLastDayTime}, 'yyyy-MM-dd')))" +
"</where></script>")
Page<ExpenseSettlementInfoBo> getExpenseSettlementInfo(Page<ExpenseSettlementInfoBo> page, ExpenseSettlementReq req);
......
......@@ -83,6 +83,12 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
@Override
public ExpenseVo expenseSettlement(ExpenseSettlementReq req) throws ParseException {
Page<ExpenseSettlementInfoBo> page = new Page<>(req.getPageNum(), req.getPageSize());
//计算当前月最后一天
DateFormat df = new SimpleDateFormat("yyyy-MM");
Date parse = df.parse(req.getAccountsTime());
Date lastDayOfMonth = getLastDayOfMonth(parse);
DateFormat df2 = new SimpleDateFormat("yyyy-MM-dd");
req.setAccountsLastDayTime(df2.format(lastDayOfMonth));
Page<ExpenseSettlementInfoBo> expenseSettlementInfo = srvTaskMapper.getExpenseSettlementInfo(page, req);
List<ExpenseSettlementVo> vos = new ArrayList<>();
if (expenseSettlementInfo != null && expenseSettlementInfo.getRecords() != null) {
......@@ -92,8 +98,6 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
//护理等级
vo.setNursingGrade(CfgSrvLevel.getMsg(bo.getSrvLevelId()));
//服务开始时间
DateFormat df = new SimpleDateFormat("yyyy-MM");
Date parse = df.parse(req.getAccountsTime());
if (bo.getSrvStartTime() != null) {
if (bo.getSrvStartTime().getTime() > parse.getTime()) {
vo.setSrvStartTime(bo.getSrvStartTime());
......@@ -103,7 +107,6 @@ public class AccountServiceImpl extends ServiceImpl<ChDisabAccountsMapper, ChDis
}
//服务结束时间
if (bo.getSrvEndTime() != null) {
Date lastDayOfMonth = getLastDayOfMonth(parse);
if (bo.getSrvEndTime().getTime() > lastDayOfMonth.getTime()) {
vo.setSrvEndTime(lastDayOfMonth);
} else {
......
......@@ -16,4 +16,9 @@ public class ExpenseSettlementReq extends BaseReq {
*/
private String accountsTime;
/**
* 结算月份最后一天
*/
private String accountsLastDayTime;
}
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