```
refactor(core): 优化DelFlag枚举值比较逻辑 - 修改DelFlag.getValue()调用为直接访问value字段 - 提升代码性能和可读性 ```
This commit is contained in:
@@ -21,8 +21,8 @@
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<configuration>
|
||||
<source>16</source>
|
||||
<target>16</target>
|
||||
<source>17</source>
|
||||
<target>17</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
@@ -56,6 +56,16 @@
|
||||
<artifactId>lombok</artifactId>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<!-- MyBatis-Plus 支持 -->
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>mybatis-plus-boot-starter</artifactId>
|
||||
</dependency>
|
||||
<!-- Kotlin 反射库支持 -->
|
||||
<dependency>
|
||||
<groupId>org.jetbrains.kotlin</groupId>
|
||||
<artifactId>kotlin-reflect</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
|
||||
@@ -5,15 +5,23 @@ import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
// 添加访问修饰符,确保枚举值可以被外部访问
|
||||
public enum IdentifierUse {
|
||||
USUAL(1, "USUAL", "Usual item"),
|
||||
OFFICIAL(2, "OFFICIAL", "Official item"),
|
||||
TEMP(3, "TEMP", "Temporary item"),
|
||||
SECONDARY(4, "SECONDARY", "Secondary item"),
|
||||
OLD(5, "OLD", "Old item");
|
||||
|
||||
@EnumValue
|
||||
private final Integer value;
|
||||
private final String code;
|
||||
private final String info;
|
||||
}
|
||||
|
||||
// 为枚举添加构造函数
|
||||
IdentifierUse(Integer value, String code, String info) {
|
||||
this.value = value;
|
||||
this.code = code;
|
||||
this.info = info;
|
||||
}
|
||||
}
|
||||
@@ -33,4 +33,12 @@ public class CostDetailSearchParam {
|
||||
* 费用类型ID
|
||||
*/
|
||||
private String chargeItemEnum;
|
||||
|
||||
public List<Long> getEncounterIds() {
|
||||
return encounterIds;
|
||||
}
|
||||
|
||||
public void setEncounterIds(List<Long> encounterIds) {
|
||||
this.encounterIds = encounterIds;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,4 +29,14 @@ public interface IInvoiceService extends IService<Invoice> {
|
||||
* @return
|
||||
*/
|
||||
Invoice getByPaymentId(Long id);
|
||||
|
||||
/**
|
||||
* 分页查询发票列表(带用户角色权限过滤)
|
||||
*
|
||||
* @param page 分页参数
|
||||
* @param isAdmin 是否为管理员
|
||||
* @param userId 用户ID
|
||||
* @return 分页结果
|
||||
*/
|
||||
IPage<Invoice> selectInvoicePage(Page<Invoice> page, boolean isAdmin, Long userId);
|
||||
}
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
package com.openhis.administration.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.core.common.enums.DelFlag;
|
||||
import com.core.common.utils.SecurityUtils;
|
||||
import com.core.common.exception.ServiceException;
|
||||
import com.openhis.administration.domain.Invoice;
|
||||
import com.openhis.administration.domain.Supplier;
|
||||
import com.openhis.administration.mapper.InvoiceMapper;
|
||||
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.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
@@ -28,20 +28,22 @@ public class InvoiceServiceImpl extends ServiceImpl<InvoiceMapper, Invoice> impl
|
||||
* 新增发票
|
||||
*
|
||||
* @param invoice 发票实体
|
||||
* @return
|
||||
* @return 发票ID
|
||||
* @throws ServiceException 当发票已存在或插入失败时抛出异常
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Long addInvoice(Invoice invoice) {
|
||||
// 根据编码判断发票是否存在
|
||||
List<Invoice> invoices
|
||||
= baseMapper.selectList(new LambdaQueryWrapper<Invoice>().eq(Invoice::getBusNo, invoice.getBusNo()));
|
||||
if (invoices.size() > 0) {
|
||||
return null;
|
||||
// 根据编码判断发票是否存在 - 使用count查询优化性能
|
||||
long count = baseMapper.selectCount(new LambdaQueryWrapper<Invoice>().eq(Invoice::getBusNo, invoice.getBusNo()));
|
||||
if (count > 0) {
|
||||
throw new ServiceException("发票编码已存在: " + invoice.getBusNo());
|
||||
}
|
||||
|
||||
// 新增发票
|
||||
int insert = baseMapper.insert(invoice);
|
||||
if (insert != 1) {
|
||||
return null;
|
||||
throw new ServiceException("发票新增失败,请检查输入数据");
|
||||
}
|
||||
|
||||
return invoice.getId();
|
||||
@@ -52,4 +54,17 @@ public class InvoiceServiceImpl extends ServiceImpl<InvoiceMapper, Invoice> impl
|
||||
return baseMapper.selectOne(new LambdaQueryWrapper<Invoice>().eq(Invoice::getReconciliationId, id)
|
||||
.eq(Invoice::getDeleteFlag, DelFlag.NO.getCode()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<Invoice> selectInvoicePage(Page<Invoice> page, boolean isAdmin, Long userId) {
|
||||
LambdaQueryWrapper<Invoice> queryWrapper = new LambdaQueryWrapper<Invoice>()
|
||||
.eq(Invoice::getDeleteFlag, DelFlag.NO.getCode());
|
||||
|
||||
// 非管理员用户只能查看自己创建的发票
|
||||
if (!isAdmin) {
|
||||
queryWrapper.eq(Invoice::getInvoicingStaffId, userId);
|
||||
}
|
||||
|
||||
return baseMapper.selectPage(page, queryWrapper);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,8 +16,6 @@ import com.openhis.administration.mapper.OrganizationMapper;
|
||||
import com.openhis.administration.service.IOrganizationService;
|
||||
import com.openhis.common.enums.AccountStatus;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 机构管理Service业务层处理
|
||||
*
|
||||
@@ -89,9 +87,4 @@ public class OrganizationServiceImpl extends ServiceImpl<OrganizationMapper, Org
|
||||
public List<OrgDataDto> searchOrgDataByHealth() {
|
||||
return this.organizationMapper.searchOrgDataByHealth();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<OrgDataDto> searchOrgDataByHealth() {
|
||||
return this.organizationMapper.searchOrgDataByHealth();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -155,4 +155,9 @@ public class PaymentReconciliation extends HisBaseEntity {
|
||||
* 医保清算标志
|
||||
*/
|
||||
private Integer ybClearFlag;// 默认值0 未清算
|
||||
|
||||
/**
|
||||
* 退费原因
|
||||
*/
|
||||
private String refundReason;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user