```
refactor(invoice): 移除发票服务中的权限过滤功能 移除发票服务接口中的分页查询权限过滤方法,简化发票新增逻辑, 移除异常抛出改为返回null,更新分页查询方法实现 - 移除 IInvoiceService 中的 selectInvoicePage 方法 - 移除 InvoiceServiceImpl 中的权限过滤逻辑 - 移除发票新增时的异常抛出,改为返回null - 移除多余的import和注释 - 简化发票编码存在性检查逻辑 refactor(outpatient): 修复门诊记录服务中的方法注解 为门诊记录服务中的 getDoctorNames 方法添加 @Override 注解, 移除多余的空行 - 在 OutpatientRecordServiceImpl 中添加 @Override 注解 - 移除 PatientManageMapper 导入前的多余空行 ```
This commit is contained in:
@@ -21,7 +21,6 @@ import com.openhis.common.utils.HisQueryUtils;
|
|||||||
import com.openhis.web.patientmanage.appservice.IOutpatientRecordService;
|
import com.openhis.web.patientmanage.appservice.IOutpatientRecordService;
|
||||||
import com.openhis.web.patientmanage.dto.OutpatientRecordDto;
|
import com.openhis.web.patientmanage.dto.OutpatientRecordDto;
|
||||||
import com.openhis.web.patientmanage.dto.OutpatientRecordSearchParam;
|
import com.openhis.web.patientmanage.dto.OutpatientRecordSearchParam;
|
||||||
|
|
||||||
import com.openhis.web.patientmanage.mapper.PatientManageMapper;
|
import com.openhis.web.patientmanage.mapper.PatientManageMapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -74,6 +73,7 @@ public class OutpatientRecordServiceImpl implements IOutpatientRecordService {
|
|||||||
*
|
*
|
||||||
* @return 医生名字列表
|
* @return 医生名字列表
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public R<?> getDoctorNames() {
|
public R<?> getDoctorNames() {
|
||||||
return R.ok(patientManageMapper.getDoctorNames());
|
return R.ok(patientManageMapper.getDoctorNames());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,14 +29,4 @@ public interface IInvoiceService extends IService<Invoice> {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
Invoice getByPaymentId(Long id);
|
Invoice getByPaymentId(Long id);
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页查询发票列表(带用户角色权限过滤)
|
|
||||||
*
|
|
||||||
* @param page 分页参数
|
|
||||||
* @param isAdmin 是否为管理员
|
|
||||||
* @param userId 用户ID
|
|
||||||
* @return 分页结果
|
|
||||||
*/
|
|
||||||
IPage<Invoice> selectInvoicePage(Page<Invoice> page, boolean isAdmin, Long userId);
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,17 +1,18 @@
|
|||||||
package com.openhis.administration.service.impl;
|
package com.openhis.administration.service.impl;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.core.common.enums.DelFlag;
|
import com.core.common.enums.DelFlag;
|
||||||
import com.core.common.exception.ServiceException;
|
import com.core.common.utils.SecurityUtils;
|
||||||
import com.openhis.administration.domain.Invoice;
|
import com.openhis.administration.domain.Invoice;
|
||||||
|
import com.openhis.administration.domain.Supplier;
|
||||||
import com.openhis.administration.mapper.InvoiceMapper;
|
import com.openhis.administration.mapper.InvoiceMapper;
|
||||||
import com.openhis.administration.service.IInvoiceService;
|
import com.openhis.administration.service.IInvoiceService;
|
||||||
|
import com.openhis.common.enums.SupplyStatus;
|
||||||
|
import com.openhis.workflow.domain.SupplyRequest;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -28,22 +29,20 @@ public class InvoiceServiceImpl extends ServiceImpl<InvoiceMapper, Invoice> impl
|
|||||||
* 新增发票
|
* 新增发票
|
||||||
*
|
*
|
||||||
* @param invoice 发票实体
|
* @param invoice 发票实体
|
||||||
* @return 发票ID
|
* @return
|
||||||
* @throws ServiceException 当发票已存在或插入失败时抛出异常
|
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
|
||||||
public Long addInvoice(Invoice invoice) {
|
public Long addInvoice(Invoice invoice) {
|
||||||
// 根据编码判断发票是否存在 - 使用count查询优化性能
|
// 根据编码判断发票是否存在
|
||||||
long count = baseMapper.selectCount(new LambdaQueryWrapper<Invoice>().eq(Invoice::getBusNo, invoice.getBusNo()));
|
List<Invoice> invoices
|
||||||
if (count > 0) {
|
= baseMapper.selectList(new LambdaQueryWrapper<Invoice>().eq(Invoice::getBusNo, invoice.getBusNo()));
|
||||||
throw new ServiceException("发票编码已存在: " + invoice.getBusNo());
|
if (invoices.size() > 0) {
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 新增发票
|
// 新增发票
|
||||||
int insert = baseMapper.insert(invoice);
|
int insert = baseMapper.insert(invoice);
|
||||||
if (insert != 1) {
|
if (insert != 1) {
|
||||||
throw new ServiceException("发票新增失败,请检查输入数据");
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return invoice.getId();
|
return invoice.getId();
|
||||||
@@ -55,16 +54,14 @@ public class InvoiceServiceImpl extends ServiceImpl<InvoiceMapper, Invoice> impl
|
|||||||
.eq(Invoice::getDeleteFlag, DelFlag.NO.getCode()));
|
.eq(Invoice::getDeleteFlag, DelFlag.NO.getCode()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询发票列表
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public IPage<Invoice> selectInvoicePage(Page<Invoice> page, boolean isAdmin, Long userId) {
|
public Page<Invoice> selectInvoicePage(Page<Invoice> page, boolean isAdmin, Long userId) {
|
||||||
LambdaQueryWrapper<Invoice> queryWrapper = new LambdaQueryWrapper<Invoice>()
|
LambdaQueryWrapper<Invoice> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
.eq(Invoice::getDeleteFlag, DelFlag.NO.getCode());
|
// 可以根据需要添加查询条件,目前按创建时间倒序排列
|
||||||
|
queryWrapper.orderByDesc(Invoice::getCreateDate);
|
||||||
// 非管理员用户只能查看自己创建的发票
|
|
||||||
if (!isAdmin) {
|
|
||||||
queryWrapper.eq(Invoice::getInvoicingStaffId, userId);
|
|
||||||
}
|
|
||||||
|
|
||||||
return baseMapper.selectPage(page, queryWrapper);
|
return baseMapper.selectPage(page, queryWrapper);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user