Merge branch 'develop' of https://gitea.gentronhealth.com/py/his into develop

This commit is contained in:
2026-02-03 14:00:59 +08:00
22 changed files with 1746 additions and 28 deletions

View File

@@ -0,0 +1,46 @@
package com.core.web.controller.common;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
/**
* 前端路由 fallback 控制器
* 处理 Vue Router History 模式下的路由
*
* @author
*/
@Controller
public class FrontRouterController {
/**
* 处理前端路由,将所有前端路由请求转发到 index.html
*/
@RequestMapping(value = {
"/ybmanagement/**",
"/system/**",
"/monitor/**",
"/tool/**",
"/doctorstation/**",
"/features/**",
"/todo/**",
"/appoinmentmanage/**",
"/clinicmanagement/**",
"/medicationmanagement/**",
"/yb/**",
"/patient/**",
"/charge/**",
"/nurse/**",
"/pharmacy/**",
"/report/**",
"/document/**",
"/triage/**",
"/check/**",
"/lab/**",
"/financial/**",
"/crosssystem/**",
"/workflow/**"
})
public String index() {
return "forward:/index.html";
}
}

View File

@@ -0,0 +1,34 @@
package com.core.common.core.domain;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.List;
/**
* 分页结果类
*
* @author
* @date 2026-02-02
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class PageResult<T> implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 数据列表
*/
private List<T> rows;
/**
* 总数
*/
private long total;
}

View File

@@ -10,16 +10,21 @@ import com.core.common.utils.MessageUtils;
import com.core.common.utils.SecurityUtils;
import com.core.common.utils.StringUtils;
import com.core.common.utils.bean.BeanUtils;
import com.core.common.core.domain.entity.SysRole;
import com.core.common.core.domain.model.LoginUser;
import com.openhis.administration.domain.*;
import com.openhis.administration.mapper.PatientMapper;
import com.openhis.administration.service.*;
import com.openhis.common.constant.CommonConstants;
import com.openhis.common.constant.PromptMsgConstant;
import com.openhis.common.enums.*;
import com.openhis.common.enums.ybenums.YbPayment;
import com.openhis.common.utils.EnumUtils;
import com.openhis.common.utils.HisPageUtils;
import com.openhis.common.utils.HisQueryUtils;
import com.openhis.financial.domain.PaymentReconciliation;
import com.openhis.financial.domain.RefundLog;
import com.openhis.financial.service.IRefundLogService;
import com.openhis.web.basicservice.dto.HealthcareServiceDto;
import com.openhis.web.basicservice.mapper.HealthcareServiceBizMapper;
import com.openhis.web.chargemanage.appservice.IOutpatientRegistrationAppService;
@@ -40,10 +45,14 @@ import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.*;
import java.util.stream.Collectors;
import lombok.extern.slf4j.Slf4j;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
/**
* 门诊挂号 应用实现类
@@ -85,6 +94,9 @@ public class OutpatientRegistrationAppServiceImpl implements IOutpatientRegistra
@Resource
TriageCandidateExclusionService triageCandidateExclusionService;
@Resource
IRefundLogService iRefundLogService;
/**
* 门诊挂号 - 查询患者信息
*
@@ -260,7 +272,7 @@ public class OutpatientRegistrationAppServiceImpl implements IOutpatientRegistra
R<?> result = iPaymentRecService.cancelRegPayment(cancelPaymentDto);
PaymentReconciliation paymentRecon = null;
if (PaymentReconciliation.class.isAssignableFrom(result.getData().getClass())) {
if (result.getData() != null && PaymentReconciliation.class.isAssignableFrom(result.getData().getClass())) {
paymentRecon = (PaymentReconciliation)result.getData();
}
if (paymentRecon != null) {
@@ -275,6 +287,9 @@ public class OutpatientRegistrationAppServiceImpl implements IOutpatientRegistra
}
}
// 记录退号日志
recordRefundLog(cancelRegPaymentDto, byId, result, paymentRecon);
// 2025/05/05 该处保存费用项后,会通过统一收费处理进行收费
return R.ok(paymentRecon, MessageUtils.createMessage(PromptMsgConstant.Common.M00004, new Object[] {"退号"}));
}
@@ -394,4 +409,124 @@ public class OutpatientRegistrationAppServiceImpl implements IOutpatientRegistra
return R.ok(null, "补打挂号成功");
}
/**
* 记录退号日志
*
* @param cancelRegPaymentDto 退号请求对象
* @param encounter 就诊信息
* @param result 退号结果
* @param paymentRecon 支付对账信息
*/
@Transactional(propagation = Propagation.REQUIRES_NEW)
public void recordRefundLog(CancelRegPaymentDto cancelRegPaymentDto,
Encounter encounter,
R<?> result,
PaymentReconciliation paymentRecon) {
RefundLog refundLog = new RefundLog();
try {
// 1. 订单ID唯一
String orderId = String.valueOf(cancelRegPaymentDto.getEncounterId());
refundLog.setOrderId(orderId);
// 已存在则不重复插入(防止唯一约束异常)
long exist = iRefundLogService.lambdaQuery()
.eq(RefundLog::getOrderId, orderId)
.count();
if (exist > 0) {
log.warn("退号日志已存在orderId={}", orderId);
return;
}
// 2. 患者信息
if (encounter != null) {
refundLog.setPatientId(String.valueOf(encounter.getPatientId()));
Patient patient = patientMapper.selectById(encounter.getPatientId());
refundLog.setPatientName(patient != null ? patient.getName() : "未知");
} else {
refundLog.setPatientId("0");
refundLog.setPatientName("未知");
}
// 3. 金额
// 优先使用paymentRecon中的displayAmount如果没有则尝试使用cancelRegPaymentDto中的displayAmount
BigDecimal refundAmount = BigDecimal.ZERO;
if (paymentRecon != null) {
// 使用退号后生成的paymentRecon的实际金额这个金额应该是负数
refundAmount = paymentRecon.getDisplayAmount() != null
? paymentRecon.getDisplayAmount().abs() // 取绝对值,因为退费金额通常显示为正数
: BigDecimal.ZERO;
} else if (cancelRegPaymentDto.getDisplayAmount() != null) {
refundAmount = cancelRegPaymentDto.getDisplayAmount();
}
refundLog.setRefundAmount(refundAmount);
// 4. 原因 & 类型
refundLog.setRefundReason(
StringUtils.isNotEmpty(cancelRegPaymentDto.getReason())
? cancelRegPaymentDto.getReason()
: "诊前退号-已缴费签到未就诊"
);
refundLog.setRefundType("FULL");
// 5. 退款方式
String refundMethod = "UNKNOWN";
if (cancelRegPaymentDto.getPaymentDetails() != null
&& !cancelRegPaymentDto.getPaymentDetails().isEmpty()) {
Integer payEnum = cancelRegPaymentDto.getPaymentDetails().get(0).getPayEnum();
if (payEnum != null) {
YbPayment ybPayment = YbPayment.getByValue(payEnum);
refundMethod = (ybPayment != null ? ybPayment.getInfo() : payEnum.toString());
}
}
refundLog.setRefundMethod(refundMethod);
// 6. 原交易号
refundLog.setOriginalTradeNo(
paymentRecon != null ? paymentRecon.getPaymentNo() : null
);
// 7. 时间
refundLog.setRefundTime(LocalDateTime.now());
// 8. 操作人
LoginUser loginUser = SecurityUtils.getLoginUser();
if (loginUser != null) {
refundLog.setOpUserId(String.valueOf(loginUser.getUserId()));
refundLog.setOpUserName(loginUser.getUsername());
List<SysRole> roles = loginUser.getRoleList();
refundLog.setOpRole(
roles != null && !roles.isEmpty() ? roles.get(0).getRoleName() : "SYSTEM"
);
} else {
refundLog.setOpUserId("0");
refundLog.setOpUserName("SYSTEM");
refundLog.setOpRole("SYSTEM");
}
// 9. 状态
if (result != null && result.getCode() == 200) {
refundLog.setState(1);
} else {
refundLog.setState(0);
refundLog.setFailReason(result != null ? result.getMsg() : "未知错误");
}
// 10. 创建时间
refundLog.setCreatedAt(LocalDateTime.now());
refundLog.setUpdatedAt(LocalDateTime.now());
// 11. 保存
boolean saved = iRefundLogService.save(refundLog);
if (!saved) {
throw new RuntimeException("退号日志保存失败");
}
log.info("退号日志入库成功, orderId={}", orderId);
} catch (Exception e) {
log.error("退号日志入库失败,数据={}", refundLog, e);
throw e; // 让事务感知(你也可以只记录不抛)
}
}
}

View File

@@ -59,4 +59,14 @@ public class HomeStatisticsDto {
* 待审核数量
*/
private Integer pendingApprovals;
/**
* 我的患者数量(医生专属)
*/
private Integer myPatients;
/**
* 待写病历数量
*/
private Integer pendingEmr;
}

View File

@@ -136,6 +136,7 @@ public class PatientInformationServiceImpl implements IPatientInformationService
// 获取登录者信息
LoginUser loginUser = SecurityUtils.getLoginUser();
Long userId = loginUser.getUserId();
Integer tenantId = loginUser.getTenantId().intValue();
// 先构建基础查询条件
QueryWrapper<PatientBaseInfoDto> queryWrapper = HisQueryUtils.buildQueryWrapper(
@@ -159,8 +160,9 @@ public class PatientInformationServiceImpl implements IPatientInformationService
if (practitioner != null) {
// 查询该医生作为接诊医生ADMITTER, code="1"和挂号医生REGISTRATION_DOCTOR, code="12"的所有就诊记录的患者ID
List<Long> doctorPatientIds = patientManageMapper.getPatientIdsByPractitionerId(
practitioner.getId(),
Arrays.asList(ParticipantType.ADMITTER.getCode(), ParticipantType.REGISTRATION_DOCTOR.getCode()));
practitioner.getId(),
Arrays.asList(ParticipantType.ADMITTER.getCode(), ParticipantType.REGISTRATION_DOCTOR.getCode()),
tenantId);
if (doctorPatientIds != null && !doctorPatientIds.isEmpty()) {
// 添加患者ID过滤条件 - 注意:这里使用列名而不是表别名

View File

@@ -64,8 +64,10 @@ public interface PatientManageMapper extends BaseMapper<Patient> {
*
* @param practitionerId 医生ID
* @param typeCodes 参与者类型代码列表
* @param tenantId 租户ID
* @return 患者ID列表
*/
List<Long> getPatientIdsByPractitionerId(@Param("practitionerId") Long practitionerId,
@Param("typeCodes") List<String> typeCodes);
List<Long> getPatientIdsByPractitionerId(@Param("practitionerId") Long practitionerId,
@Param("typeCodes") List<String> typeCodes,
@Param("tenantId") Integer tenantId);
}

View File

@@ -66,23 +66,34 @@ public class HomeStatisticsServiceImpl implements IHomeStatisticsService {
Practitioner practitioner = practitionerList != null && !practitionerList.isEmpty() ? practitionerList.get(0) : null;
int totalPatients = 0;
int myPatients = 0;
// 如果当前用户是医生,查询该医生接诊和被挂号的所有患者
if (practitioner != null) {
// 获取当前登录用户的租户ID
Integer tenantId = SecurityUtils.getLoginUser().getTenantId().intValue();
// 查询该医生作为接诊医生ADMITTER, code="1"和挂号医生REGISTRATION_DOCTOR, code="12"的所有就诊记录的患者ID
List<Long> doctorPatientIds = patientManageMapper.getPatientIdsByPractitionerId(
practitioner.getId(),
Arrays.asList(ParticipantType.ADMITTER.getCode(), ParticipantType.REGISTRATION_DOCTOR.getCode()));
totalPatients = doctorPatientIds != null ? doctorPatientIds.size() : 0;
practitioner.getId(),
Arrays.asList(ParticipantType.ADMITTER.getCode(), ParticipantType.REGISTRATION_DOCTOR.getCode()),
tenantId);
myPatients = doctorPatientIds != null ? doctorPatientIds.size() : 0;
// 对于医生,"我的患者"数量即为该医生负责的患者数量
statistics.setMyPatients(myPatients);
} else {
// 如果不是医生,查询所有患者(与患者管理页面逻辑保持一致)
LambdaQueryWrapper<Patient> patientQuery = new LambdaQueryWrapper<>();
patientQuery.eq(Patient::getDeleteFlag, "0");
List<Patient> patientList = patientService.list(patientQuery);
totalPatients = patientList != null ? patientList.size() : 0;
// 如果不是医生,"我的患者"数量为0
statistics.setMyPatients(0);
}
// 查询所有患者作为总患者数
LambdaQueryWrapper<Patient> patientQuery = new LambdaQueryWrapper<>();
patientQuery.eq(Patient::getDeleteFlag, "0");
List<Patient> patientList = patientService.list(patientQuery);
totalPatients = patientList != null ? patientList.size() : 0;
statistics.setTotalPatients(totalPatients);
// 查询昨日在院患者数量(暂时简化处理)

View File

@@ -3,6 +3,8 @@ package com.openhis.web.system.controller;
import com.core.common.core.domain.R;
import com.core.common.utils.SecurityUtils;
import com.openhis.web.doctorstation.appservice.IDoctorStationEmrAppService;
import com.openhis.web.dto.HomeStatisticsDto;
import com.openhis.web.service.IHomeStatisticsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
@@ -20,19 +22,21 @@ import org.springframework.web.bind.annotation.RestController;
public class HomeController {
private final IDoctorStationEmrAppService doctorStationEmrAppService;
private final IHomeStatisticsService homeStatisticsService;
@ApiOperation("获取首页统计数据")
@GetMapping("/statistics")
public R<?> getStatistics() {
// 这里可以返回各种统计数据
// 为了简化,我们只返回待写病历数量
// 获取基础统计数据
HomeStatisticsDto statisticsDto = homeStatisticsService.getHomeStatistics();
// 获取待写病历数量
Long userId = SecurityUtils.getLoginUser().getUserId();
R<?> pendingEmrCount = doctorStationEmrAppService.getPendingEmrCount(userId);
// 构建返回数据
java.util.Map<String, Object> data = new java.util.HashMap<>();
data.put("pendingEmr", pendingEmrCount.getData());
return R.ok(data);
// 将待写病历数量添加到统计数据
statisticsDto.setPendingEmr((Integer) pendingEmrCount.getData());
return R.ok(statisticsDto);
}
}

View File

@@ -136,13 +136,13 @@
<select id="getPatientIdsByPractitionerId" resultType="java.lang.Long">
SELECT DISTINCT enc.patient_id
FROM adm_encounter_participant AS ep
LEFT JOIN adm_encounter AS enc ON ep.encounter_id = enc.ID AND enc.delete_flag = '0'
INNER JOIN adm_encounter AS enc ON ep.encounter_id = enc.ID AND enc.delete_flag = '0'
INNER JOIN adm_patient AS pt ON enc.patient_id = pt.id AND pt.delete_flag = '0'
WHERE ep.delete_flag = '0'
AND ep.practitioner_id = #{practitionerId}
AND ep.tenant_id = 1
AND enc.tenant_id = 1
AND pt.tenant_id = 1
AND ep.tenant_id = #{tenantId}
AND enc.tenant_id = #{tenantId}
AND pt.tenant_id = #{tenantId}
<if test="typeCodes != null and !typeCodes.isEmpty()">
AND ep.type_code IN
<foreach collection="typeCodes" item="typeCode" open="(" separator="," close=")">

View File

@@ -0,0 +1,127 @@
package com.openhis.financial.domain;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import lombok.Data;
/**
* 退号日志表
*/
@TableName(value = "refund_log")
@Data
public class RefundLog implements Serializable {
/**
* 主键ID
*/
@TableId(value = "id", type = IdType.AUTO)
private Long id;
/**
* 订单ID
*/
@TableField(value = "order_id")
private String orderId;
/**
* 患者ID
*/
@TableField(value = "patient_id")
private String patientId;
/**
* 患者姓名
*/
@TableField(value = "patient_name")
private String patientName;
/**
* 退款金额
*/
@TableField(value = "refund_amount")
private BigDecimal refundAmount;
/**
* 退款原因
*/
@TableField(value = "refund_reason")
private String refundReason;
/**
* 退款类型(FULL-全额退号PART-部分退号)
*/
@TableField(value = "refund_type")
private String refundType;
/**
* 退款方式
*/
@TableField(value = "refund_method")
private String refundMethod;
/**
* 原交易流水号
*/
@TableField(value = "original_trade_no")
private String originalTradeNo;
/**
* 退款交易流水号
*/
@TableField(value = "refund_trade_no")
private String refundTradeNo;
/**
* 退款时间
*/
@TableField(value = "refund_time")
private LocalDateTime refundTime;
/**
* 操作用户ID
*/
@TableField(value = "op_user_id")
private String opUserId;
/**
* 操作用户名
*/
@TableField(value = "op_user_name")
private String opUserName;
/**
* 操作角色
*/
@TableField(value = "op_role")
private String opRole;
/**
* 状态(0-失败1-成功2-处理中)
*/
@TableField(value = "state")
private Integer state;
/**
* 失败原因
*/
@TableField(value = "fail_reason")
private String failReason;
/**
* 创建时间
*/
@TableField(value = "created_at")
private LocalDateTime createdAt;
/**
* 更新时间
*/
@TableField(value = "updated_at")
private LocalDateTime updatedAt;
private static final long serialVersionUID = 1L;
}

View File

@@ -0,0 +1,10 @@
package com.openhis.financial.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.openhis.financial.domain.RefundLog;
/**
* 退号日志 Mapper接口
*/
public interface RefundLogMapper extends BaseMapper<RefundLog> {
}

View File

@@ -0,0 +1,10 @@
package com.openhis.financial.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.openhis.financial.domain.RefundLog;
/**
* 退号日志 Service接口
*/
public interface IRefundLogService extends IService<RefundLog> {
}

View File

@@ -0,0 +1,14 @@
package com.openhis.financial.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.openhis.financial.domain.RefundLog;
import com.openhis.financial.mapper.RefundLogMapper;
import com.openhis.financial.service.IRefundLogService;
import org.springframework.stereotype.Service;
/**
* 退号日志 Service实现类
*/
@Service
public class RefundLogServiceImpl extends ServiceImpl<RefundLogMapper, RefundLog> implements IRefundLogService {
}

View File

@@ -0,0 +1,118 @@
package com.openhis.yb.domain;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.core.common.core.domain.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import java.math.BigDecimal;
import java.util.Date;
/**
* 日结医保结算实体类
*
* @author
* @date 2026-02-02
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = true)
@TableName("yb_day_end_settlement")
public class DayEndMedicalInsuranceSettlement extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 主键ID
*/
@TableId(value = "id", type = IdType.AUTO)
private Long id;
/**
* 结算单号
*/
@TableField("settlement_no")
private String settlementNo;
/**
* 结算日期
*/
@TableField("settlement_date")
@JsonFormat(pattern = "yyyy-MM-dd")
private Date settlementDate;
/**
* 结算类型 (daily, weekly, monthly)
*/
@TableField("settlement_type")
private String settlementType;
/**
* 医保类型 (城镇职工, 城乡居民等)
*/
@TableField("insurance_type")
private String insuranceType;
/**
* 总人次
*/
@TableField("total_visits")
private Integer totalVisits;
/**
* 总金额
*/
@TableField("total_amount")
private BigDecimal totalAmount;
/**
* 医保统筹支付金额
*/
@TableField("insurance_pay_amount")
private BigDecimal insurancePayAmount;
/**
* 个人账户支付金额
*/
@TableField("account_pay_amount")
private BigDecimal accountPayAmount;
/**
* 个人自付金额
*/
@TableField("personal_pay_amount")
private BigDecimal personalPayAmount;
/**
* 医保基金支付总额
*/
@TableField("fund_pay_sum_amount")
private BigDecimal fundPaySumAmount;
/**
* 状态 (0正常 1停用)
*/
@TableField("status")
private String status;
/**
* 操作员
*/
@TableField("operator")
private String operator;
/**
* 备注
*/
@TableField("remark")
private String remark;
}

View File

@@ -0,0 +1,18 @@
package com.openhis.yb.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.openhis.yb.domain.DayEndMedicalInsuranceSettlement;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;
/**
* 日结医保结算Mapper接口
*
* @author
* @date 2026-02-02
*/
@Mapper
@Repository
public interface DayEndMedicalInsuranceSettlementMapper extends BaseMapper<DayEndMedicalInsuranceSettlement> {
}

View File

@@ -0,0 +1,74 @@
package com.openhis.yb.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.openhis.yb.domain.DayEndMedicalInsuranceSettlement;
import com.core.common.core.domain.PageResult;
import java.util.List;
/**
* 日结医保结算Service接口
*
* @author
* @date 2026-02-02
*/
public interface IDayEndMedicalInsuranceSettlementService extends IService<DayEndMedicalInsuranceSettlement> {
/**
* 查询日结医保结算
*
* @param id 日结医保结算ID
* @return 日结医保结算
*/
DayEndMedicalInsuranceSettlement selectDayEndMedicalInsuranceSettlementById(Long id);
/**
* 查询日结医保结算列表
*
* @param dayEndMedicalInsuranceSettlement 日结医保结算
* @return 日结医保结算集合
*/
List<DayEndMedicalInsuranceSettlement> selectDayEndMedicalInsuranceSettlementList(DayEndMedicalInsuranceSettlement dayEndMedicalInsuranceSettlement);
/**
* 新增日结医保结算
*
* @param dayEndMedicalInsuranceSettlement 日结医保结算
* @return 结果
*/
int insertDayEndMedicalInsuranceSettlement(DayEndMedicalInsuranceSettlement dayEndMedicalInsuranceSettlement);
/**
* 修改日结医保结算
*
* @param dayEndMedicalInsuranceSettlement 日结医保结算
* @return 结果
*/
int updateDayEndMedicalInsuranceSettlement(DayEndMedicalInsuranceSettlement dayEndMedicalInsuranceSettlement);
/**
* 批量删除日结医保结算
*
* @param ids 需要删除的日结医保结算ID
* @return 结果
*/
int deleteDayEndMedicalInsuranceSettlementByIds(Long[] ids);
/**
* 删除日结医保结算信息
*
* @param id 日结医保结算ID
* @return 结果
*/
int deleteDayEndMedicalInsuranceSettlementById(Long id);
/**
* 分页查询日结医保结算列表
*
* @param dayEndMedicalInsuranceSettlement 日结医保结算
* @param pageNum 页码
* @param pageSize 页面大小
* @return 分页结果
*/
PageResult<DayEndMedicalInsuranceSettlement> selectDayEndMedicalInsuranceSettlementPage(DayEndMedicalInsuranceSettlement dayEndMedicalInsuranceSettlement, int pageNum, int pageSize);
}

View File

@@ -0,0 +1,128 @@
package com.openhis.yb.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.core.common.core.domain.PageResult;
import com.openhis.yb.domain.DayEndMedicalInsuranceSettlement;
import com.openhis.yb.mapper.DayEndMedicalInsuranceSettlementMapper;
import com.openhis.yb.service.IDayEndMedicalInsuranceSettlementService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Arrays;
import java.util.List;
/**
* 日结医保结算Service业务层处理
*
* @author
* @date 2026-02-02
*/
@Service
public class DayEndMedicalInsuranceSettlementServiceImpl extends ServiceImpl<DayEndMedicalInsuranceSettlementMapper, DayEndMedicalInsuranceSettlement> implements IDayEndMedicalInsuranceSettlementService {
@Autowired
private DayEndMedicalInsuranceSettlementMapper dayEndMedicalInsuranceSettlementMapper;
/**
* 查询日结医保结算
*
* @param id 日结医保结算ID
* @return 日结医保结算
*/
@Override
public DayEndMedicalInsuranceSettlement selectDayEndMedicalInsuranceSettlementById(Long id) {
return dayEndMedicalInsuranceSettlementMapper.selectById(id);
}
/**
* 查询日结医保结算列表
*
* @param dayEndMedicalInsuranceSettlement 日结医保结算
* @return 日结医保结算
*/
@Override
public List<DayEndMedicalInsuranceSettlement> selectDayEndMedicalInsuranceSettlementList(DayEndMedicalInsuranceSettlement dayEndMedicalInsuranceSettlement) {
LambdaQueryWrapper<DayEndMedicalInsuranceSettlement> lqw = Wrappers.lambdaQuery();
lqw.like(dayEndMedicalInsuranceSettlement.getSettlementNo() != null, DayEndMedicalInsuranceSettlement::getSettlementNo, dayEndMedicalInsuranceSettlement.getSettlementNo());
lqw.eq(dayEndMedicalInsuranceSettlement.getSettlementDate() != null, DayEndMedicalInsuranceSettlement::getSettlementDate, dayEndMedicalInsuranceSettlement.getSettlementDate());
lqw.eq(dayEndMedicalInsuranceSettlement.getSettlementType() != null, DayEndMedicalInsuranceSettlement::getSettlementType, dayEndMedicalInsuranceSettlement.getSettlementType());
lqw.eq(dayEndMedicalInsuranceSettlement.getInsuranceType() != null, DayEndMedicalInsuranceSettlement::getInsuranceType, dayEndMedicalInsuranceSettlement.getInsuranceType());
lqw.eq(dayEndMedicalInsuranceSettlement.getStatus() != null, DayEndMedicalInsuranceSettlement::getStatus, dayEndMedicalInsuranceSettlement.getStatus());
lqw.orderByDesc(DayEndMedicalInsuranceSettlement::getCreateTime);
return dayEndMedicalInsuranceSettlementMapper.selectList(lqw);
}
/**
* 新增日结医保结算
*
* @param dayEndMedicalInsuranceSettlement 日结医保结算
* @return 结果
*/
@Override
public int insertDayEndMedicalInsuranceSettlement(DayEndMedicalInsuranceSettlement dayEndMedicalInsuranceSettlement) {
return dayEndMedicalInsuranceSettlementMapper.insert(dayEndMedicalInsuranceSettlement);
}
/**
* 修改日结医保结算
*
* @param dayEndMedicalInsuranceSettlement 日结医保结算
* @return 结果
*/
@Override
public int updateDayEndMedicalInsuranceSettlement(DayEndMedicalInsuranceSettlement dayEndMedicalInsuranceSettlement) {
return dayEndMedicalInsuranceSettlementMapper.updateById(dayEndMedicalInsuranceSettlement);
}
/**
* 批量删除日结医保结算
*
* @param ids 需要删除的日结医保结算ID
* @return 结果
*/
@Override
public int deleteDayEndMedicalInsuranceSettlementByIds(Long[] ids) {
return dayEndMedicalInsuranceSettlementMapper.deleteBatchIds(Arrays.asList(ids));
}
/**
* 删除日结医保结算信息
*
* @param id 日结医保结算ID
* @return 结果
*/
@Override
public int deleteDayEndMedicalInsuranceSettlementById(Long id) {
return dayEndMedicalInsuranceSettlementMapper.deleteById(id);
}
/**
* 分页查询日结医保结算列表
*
* @param dayEndMedicalInsuranceSettlement 日结医保结算
* @param pageNum 页码
* @param pageSize 页面大小
* @return 分页结果
*/
@Override
public PageResult<DayEndMedicalInsuranceSettlement> selectDayEndMedicalInsuranceSettlementPage(DayEndMedicalInsuranceSettlement dayEndMedicalInsuranceSettlement, int pageNum, int pageSize) {
LambdaQueryWrapper<DayEndMedicalInsuranceSettlement> lqw = Wrappers.lambdaQuery();
lqw.like(dayEndMedicalInsuranceSettlement.getSettlementNo() != null, DayEndMedicalInsuranceSettlement::getSettlementNo, dayEndMedicalInsuranceSettlement.getSettlementNo());
lqw.eq(dayEndMedicalInsuranceSettlement.getSettlementDate() != null, DayEndMedicalInsuranceSettlement::getSettlementDate, dayEndMedicalInsuranceSettlement.getSettlementDate());
lqw.eq(dayEndMedicalInsuranceSettlement.getSettlementType() != null, DayEndMedicalInsuranceSettlement::getSettlementType, dayEndMedicalInsuranceSettlement.getSettlementType());
lqw.eq(dayEndMedicalInsuranceSettlement.getInsuranceType() != null, DayEndMedicalInsuranceSettlement::getInsuranceType, dayEndMedicalInsuranceSettlement.getInsuranceType());
lqw.eq(dayEndMedicalInsuranceSettlement.getStatus() != null, DayEndMedicalInsuranceSettlement::getStatus, dayEndMedicalInsuranceSettlement.getStatus());
lqw.orderByDesc(DayEndMedicalInsuranceSettlement::getCreateTime);
Page<DayEndMedicalInsuranceSettlement> page = new Page<>(pageNum, pageSize);
Page<DayEndMedicalInsuranceSettlement> result = dayEndMedicalInsuranceSettlementMapper.selectPage(page, lqw);
return PageResult.<DayEndMedicalInsuranceSettlement>builder()
.rows(result.getRecords())
.total(result.getTotal())
.build();
}
}