门诊收费部分代码上传
This commit is contained in:
@@ -8,7 +8,6 @@ import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.core.common.core.domain.HisBaseEntity;
|
||||
|
||||
import liquibase.pro.packaged.S;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
@@ -35,6 +34,9 @@ public class ChargeItem extends HisBaseEntity {
|
||||
/** 层级 */
|
||||
private String busNo;
|
||||
|
||||
/** 处方号 */
|
||||
private String prescriptionNo;
|
||||
|
||||
/** 患者ID */
|
||||
private Long patientId;
|
||||
|
||||
@@ -122,4 +124,7 @@ public class ChargeItem extends HisBaseEntity {
|
||||
/** 机构 */
|
||||
private Integer orgId;
|
||||
|
||||
/** 退费ID */
|
||||
private Long refundId;
|
||||
|
||||
}
|
||||
|
||||
@@ -18,4 +18,19 @@ public interface IAccountService extends IService<Account> {
|
||||
*/
|
||||
Long saveAccountByRegister(Account account);
|
||||
|
||||
/**
|
||||
* 获取就诊患者的自费账户id
|
||||
*
|
||||
* @param encounterId 就诊id
|
||||
* @return 账户id
|
||||
*/
|
||||
Long getSelfPayAccount(Long encounterId);
|
||||
|
||||
/**
|
||||
* 获取就诊患者的医保账户id
|
||||
*
|
||||
* @param encounterId 就诊id
|
||||
* @return 账户id
|
||||
*/
|
||||
Long getMedicalInsuranceAccount(Long encounterId);
|
||||
}
|
||||
@@ -26,4 +26,13 @@ public interface IChargeItemService extends IService<ChargeItem> {
|
||||
* @param chargeItem 费用项
|
||||
*/
|
||||
void saveChargeItemByRegister(ChargeItem chargeItem);
|
||||
|
||||
/**
|
||||
* 更改就诊患者账户类型
|
||||
*
|
||||
* @param encounterId 就诊患者
|
||||
* @param accountId 账户id
|
||||
* @return 更新结果
|
||||
*/
|
||||
boolean updateAccountType(Long encounterId, Long accountId);
|
||||
}
|
||||
@@ -2,10 +2,12 @@ package com.openhis.administration.service.impl;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.openhis.administration.domain.Account;
|
||||
import com.openhis.administration.mapper.AccountMapper;
|
||||
import com.openhis.administration.service.IAccountService;
|
||||
import com.openhis.common.enums.AccountType;
|
||||
|
||||
/**
|
||||
* 就诊账户管理Service业务层处理
|
||||
@@ -27,4 +29,37 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
|
||||
return account.getId();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取就诊患者的自费账户id
|
||||
*
|
||||
* @param encounterId 就诊id
|
||||
* @return 账户id
|
||||
*/
|
||||
@Override
|
||||
public Long getSelfPayAccount(Long encounterId) {
|
||||
Account account = baseMapper.selectOne(new LambdaQueryWrapper<Account>().select(Account::getId)
|
||||
.eq(Account::getEncounterId, encounterId).eq(Account::getTypeCode, AccountType.SELF_PAY.getCode()));
|
||||
if (account != null) {
|
||||
return account.getId();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取就诊患者的医保账户id
|
||||
*
|
||||
* @param encounterId 就诊id
|
||||
* @return 账户id
|
||||
*/
|
||||
@Override
|
||||
public Long getMedicalInsuranceAccount(Long encounterId) {
|
||||
Account account = baseMapper
|
||||
.selectOne(new LambdaQueryWrapper<Account>().select(Account::getId).eq(Account::getEncounterId, encounterId)
|
||||
.eq(Account::getTypeCode, AccountType.MEDICAL_INSURANCE.getCode()));
|
||||
if (account != null) {
|
||||
return account.getId();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -4,6 +4,7 @@ import java.util.List;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.openhis.administration.domain.ChargeItem;
|
||||
import com.openhis.administration.mapper.ChargeItemMapper;
|
||||
@@ -45,4 +46,18 @@ public class ChargeItemServiceImpl extends ServiceImpl<ChargeItemMapper, ChargeI
|
||||
public void saveChargeItemByRegister(ChargeItem chargeItem) {
|
||||
baseMapper.insert(chargeItem);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更改就诊患者账户类型
|
||||
*
|
||||
* @param encounterId 就诊患者
|
||||
* @param accountId 账户id
|
||||
* @return 更新结果
|
||||
*/
|
||||
@Override
|
||||
public boolean updateAccountType(Long encounterId, Long accountId) {
|
||||
int update = baseMapper.update(null, new LambdaUpdateWrapper<ChargeItem>()
|
||||
.eq(ChargeItem::getEncounterId, encounterId).set(ChargeItem::getAccountId, accountId));
|
||||
return update > 0;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user