解决合并冲突
This commit is contained in:
@@ -3,14 +3,14 @@
|
||||
*/
|
||||
package com.openhis.web.chargemanage.appservice;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.web.chargemanage.dto.EncounterPatientPageParam;
|
||||
import com.openhis.web.chargemanage.dto.EncounterPatientPrescriptionDto;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 门诊收费 service
|
||||
*
|
||||
@@ -62,4 +62,20 @@ public interface IOutpatientChargeAppService {
|
||||
* @return 初始化信息
|
||||
*/
|
||||
R<?> outpatientChargeInit();
|
||||
|
||||
/**
|
||||
* 学生医保转自费
|
||||
*
|
||||
* @param encounterId 就诊id
|
||||
* @return 结果
|
||||
*/
|
||||
R<?> changeToStudentSelfPay(Long encounterId);
|
||||
|
||||
/**
|
||||
* 学生自费转学生医保
|
||||
*
|
||||
* @param encounterId 就诊id
|
||||
* @return 结果
|
||||
*/
|
||||
R<?> changeToStudentYbPay(Long encounterId);
|
||||
}
|
||||
|
||||
@@ -87,7 +87,7 @@ public class InpatientChargeAppServiceImpl implements IInpatientChargeAppService
|
||||
encounterPatientPageParam, searchKey,
|
||||
new HashSet<>(Arrays.asList(CommonConstants.FieldName.PatientWbStr, CommonConstants.FieldName.PatientPyStr,
|
||||
CommonConstants.FieldName.PatientName, CommonConstants.FieldName.PatientBusNo,
|
||||
CommonConstants.FieldName.EncounterBusNo, CommonConstants.FieldName.idCard)),
|
||||
CommonConstants.FieldName.EncounterBusNo, CommonConstants.FieldName.IdCard)),
|
||||
request);
|
||||
// 就诊患者分页列表
|
||||
Page<EncounterPatientPageDto> encounterPatientPage = inpatientChargeAppMapper
|
||||
|
||||
@@ -88,7 +88,7 @@ public class OutpatientChargeAppServiceImpl implements IOutpatientChargeAppServi
|
||||
encounterPatientPageParam, searchKey,
|
||||
new HashSet<>(Arrays.asList(CommonConstants.FieldName.PatientWbStr, CommonConstants.FieldName.PatientPyStr,
|
||||
CommonConstants.FieldName.PatientName, CommonConstants.FieldName.PatientBusNo,
|
||||
CommonConstants.FieldName.EncounterBusNo, CommonConstants.FieldName.idCard)),
|
||||
CommonConstants.FieldName.EncounterBusNo, CommonConstants.FieldName.IdCard)),
|
||||
request);
|
||||
// 就诊患者分页列表
|
||||
Page<EncounterPatientPageDto> encounterPatientPage = outpatientChargeAppMapper
|
||||
@@ -126,6 +126,7 @@ public class OutpatientChargeAppServiceImpl implements IOutpatientChargeAppServi
|
||||
});
|
||||
return prescriptionDtoList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 医保转自费
|
||||
*
|
||||
@@ -167,4 +168,46 @@ public class OutpatientChargeAppServiceImpl implements IOutpatientChargeAppServi
|
||||
}
|
||||
return R.ok(MessageUtils.createMessage(PromptMsgConstant.Common.M00004, null));
|
||||
}
|
||||
|
||||
/**
|
||||
* 学生医保转学生自费
|
||||
*
|
||||
* @param encounterId 就诊id
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public R<?> changeToStudentSelfPay(Long encounterId) {
|
||||
// 获取就诊患者的学生自费账户id
|
||||
Long accountId = accountService.getStudentSelfAccount(encounterId);
|
||||
if (accountId == null) {
|
||||
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Payment.M00008, new Object[] {"医保账户"}));
|
||||
}
|
||||
// 自费转医保
|
||||
boolean result = chargeItemService.updateAccountType(encounterId, accountId);
|
||||
if (!result) {
|
||||
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Payment.M00009, null));
|
||||
}
|
||||
return R.ok(MessageUtils.createMessage(PromptMsgConstant.Common.M00004, null));
|
||||
}
|
||||
|
||||
/**
|
||||
* 学生自费转学生医保
|
||||
*
|
||||
* @param encounterId 就诊id
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public R<?> changeToStudentYbPay(Long encounterId) {
|
||||
// 获取就诊患者的学生医保账户id
|
||||
Long accountId = accountService.getStudentYbAccount(encounterId);
|
||||
if (accountId == null) {
|
||||
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Payment.M00008, new Object[] {"医保账户"}));
|
||||
}
|
||||
// 自费转医保
|
||||
boolean result = chargeItemService.updateAccountType(encounterId, accountId);
|
||||
if (!result) {
|
||||
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Payment.M00009, null));
|
||||
}
|
||||
return R.ok(MessageUtils.createMessage(PromptMsgConstant.Common.M00004, null));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,15 +4,12 @@
|
||||
package com.openhis.web.chargemanage.appservice.impl;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
@@ -55,23 +52,23 @@ import com.openhis.workflow.service.IServiceRequestService;
|
||||
@Service
|
||||
public class OutpatientRefundAppServiceImpl implements IOutpatientRefundAppService {
|
||||
|
||||
@Autowired
|
||||
@Resource
|
||||
private OutpatientRefundAppMapper outpatientRefundAppMapper;
|
||||
@Autowired
|
||||
@Resource
|
||||
private IPaymentReconciliationService paymentReconciliationService;
|
||||
@Autowired
|
||||
@Resource
|
||||
private IChargeItemService chargeItemService;
|
||||
@Autowired
|
||||
@Resource
|
||||
private IMedicationDispenseService medicationDispenseService;
|
||||
@Autowired
|
||||
@Resource
|
||||
private IDeviceDispenseService deviceDispenseService;
|
||||
@Autowired
|
||||
@Resource
|
||||
private IServiceRequestService serviceRequestService;
|
||||
@Autowired
|
||||
@Resource
|
||||
private IMedicationRequestService medicationRequestService;
|
||||
@Autowired
|
||||
@Resource
|
||||
private IDeviceRequestService deviceRequestService;
|
||||
@Autowired
|
||||
@Resource
|
||||
private AssignSeqUtil assignSeqUtil;
|
||||
|
||||
/**
|
||||
@@ -110,8 +107,8 @@ public class OutpatientRefundAppServiceImpl implements IOutpatientRefundAppServi
|
||||
PaymentStatus.REFUND_PART.getValue(), PaymentStatus.REFUND_ALL.getValue());
|
||||
|
||||
// 获取付款id集合
|
||||
List<Long> paymentIdList =
|
||||
encounterPatientPaymentList.stream().map(EncounterPatientPaymentDto::getId).collect(Collectors.toList());
|
||||
List<Long> paymentIdList = encounterPatientPaymentList.stream().map(EncounterPatientPaymentDto::getPaymentId)
|
||||
.collect(Collectors.toList());
|
||||
if (paymentIdList.isEmpty()) {
|
||||
return R.ok(null);
|
||||
}
|
||||
@@ -131,7 +128,7 @@ public class OutpatientRefundAppServiceImpl implements IOutpatientRefundAppServi
|
||||
e.setServiceStatus_enumText(EnumUtils.getInfoByValue(RequestStatus.class, e.getServiceStatus()));
|
||||
|
||||
});
|
||||
|
||||
refundItemList.sort(Comparator.comparing(RefundItemDto::getPaymentId));
|
||||
return R.ok(refundItemList);
|
||||
}
|
||||
|
||||
@@ -162,22 +159,22 @@ public class OutpatientRefundAppServiceImpl implements IOutpatientRefundAppServi
|
||||
CommonConstants.TableName.MED_MEDICATION_REQUEST, CommonConstants.TableName.WOR_SERVICE_REQUEST,
|
||||
CommonConstants.TableName.WOR_DEVICE_REQUEST, CommonConstants.Common.THREE);
|
||||
|
||||
for (RefundItemDto creatdDto : creatChargeItemList) {
|
||||
for (RefundItemDto createDto : creatChargeItemList) {
|
||||
|
||||
// 未退费用项,生成新的请求,发放,费用项
|
||||
if (CommonConstants.TableName.MED_MEDICATION_REQUEST.equals(creatdDto.getServiceTable())) {
|
||||
if (CommonConstants.TableName.MED_MEDICATION_REQUEST.equals(createDto.getServiceTable())) {
|
||||
// 药品请求查询
|
||||
MedicationRequest medicationRequest = medicationRequestService.getById(creatdDto.getRequestId());
|
||||
MedicationRequest medicationRequest = medicationRequestService.getById(createDto.getRequestId());
|
||||
// 生成新的药品请求
|
||||
medicationRequest.setId(null); // 药品请求id
|
||||
medicationRequest
|
||||
.setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.MEDICATION_RES_NO.getPrefix(), 4)); // 药品请求编码
|
||||
medicationRequest.setPrescriptionNo(String.valueOf("C" + creatdDto.getPrescriptionNo())); // 处方号
|
||||
medicationRequest.setPrescriptionNo(String.valueOf("C" + createDto.getPrescriptionNo())); // 处方号
|
||||
medicationRequestService.save(medicationRequest);
|
||||
|
||||
// 药品发放查询
|
||||
MedicationDispense medicationDispense =
|
||||
medicationDispenseService.getById(creatdDto.getDispenseId());
|
||||
medicationDispenseService.getById(createDto.getDispenseId());
|
||||
// 生成新的药品发放
|
||||
medicationDispense.setId(null); // 药品发放id
|
||||
medicationDispense
|
||||
@@ -186,26 +183,26 @@ public class OutpatientRefundAppServiceImpl implements IOutpatientRefundAppServi
|
||||
medicationDispenseService.save(medicationDispense);
|
||||
|
||||
// 费用项查询
|
||||
ChargeItem chargeItem = chargeItemService.getById(creatdDto.getChargeItemId());
|
||||
ChargeItem chargeItem = chargeItemService.getById(createDto.getChargeItemId());
|
||||
// 生成新的费用项
|
||||
chargeItem.setRefundId(chargeItem.getId());// 退费id
|
||||
chargeItem.setId(null); // 费用项id
|
||||
chargeItem.setBusNo(AssignSeqEnum.CHARGE_ITEM_NO.getPrefix().concat(medicationRequest.getBusNo())); // 编码
|
||||
chargeItem.setPrescriptionNo(String.valueOf("C" + creatdDto.getPrescriptionNo())); // 处方号
|
||||
chargeItem.setPrescriptionNo(String.valueOf("C" + createDto.getPrescriptionNo())); // 处方号
|
||||
chargeItem.setServiceId(medicationRequest.getId()); // 医疗服务ID
|
||||
chargeItem.setStatusEnum(ChargeItemStatus.PLANNED.getValue());// 收费单状态:待收费
|
||||
chargeItemService.save(chargeItem);
|
||||
|
||||
} else if (CommonConstants.TableName.WOR_SERVICE_REQUEST.equals(creatdDto.getServiceTable())) {
|
||||
} else if (CommonConstants.TableName.WOR_SERVICE_REQUEST.equals(createDto.getServiceTable())) {
|
||||
// 服务请求查询
|
||||
ServiceRequest serviceRequest = serviceRequestService.getById(creatdDto.getRequestId());
|
||||
ServiceRequest serviceRequest = serviceRequestService.getById(createDto.getRequestId());
|
||||
// 生成新的服务请求
|
||||
serviceRequest.setId(null); // 服务请求id
|
||||
serviceRequest.setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.SERVICE_RES_NO.getPrefix(), 4)); // 服务请求编码
|
||||
serviceRequestService.save(serviceRequest);
|
||||
|
||||
// 费用项查询
|
||||
ChargeItem chargeItem = chargeItemService.getById(creatdDto.getChargeItemId());
|
||||
ChargeItem chargeItem = chargeItemService.getById(createDto.getChargeItemId());
|
||||
// 生成新的费用项
|
||||
chargeItem.setRefundId(chargeItem.getId());// 退费id
|
||||
chargeItem.setId(null); // 费用项id
|
||||
@@ -214,16 +211,16 @@ public class OutpatientRefundAppServiceImpl implements IOutpatientRefundAppServi
|
||||
chargeItem.setStatusEnum(ChargeItemStatus.PLANNED.getValue());// 收费单状态:待收费
|
||||
chargeItemService.save(chargeItem);
|
||||
|
||||
} else if (CommonConstants.TableName.WOR_DEVICE_REQUEST.equals(creatdDto.getServiceTable())) {
|
||||
} else if (CommonConstants.TableName.WOR_DEVICE_REQUEST.equals(createDto.getServiceTable())) {
|
||||
// 耗材请求查询
|
||||
DeviceRequest deviceRequest = deviceRequestService.getById(creatdDto.getRequestId());
|
||||
DeviceRequest deviceRequest = deviceRequestService.getById(createDto.getRequestId());
|
||||
// 生成新的耗材请求
|
||||
deviceRequest.setId(null); // 耗材请求id
|
||||
deviceRequest.setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.DEVICE_RES_NO.getPrefix(), 4)); // 耗材请求编码
|
||||
deviceRequestService.save(deviceRequest);
|
||||
|
||||
// 耗材发放查询
|
||||
DeviceDispense deviceDispense = deviceDispenseService.getById(creatdDto.getDispenseId());
|
||||
DeviceDispense deviceDispense = deviceDispenseService.getById(createDto.getDispenseId());
|
||||
// 生成新的耗材发放
|
||||
deviceDispense.setId(null); // 耗材id
|
||||
deviceDispense.setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.DEVICE_DIS_NO.getPrefix(), 4)); // 器材发放id
|
||||
@@ -231,7 +228,7 @@ public class OutpatientRefundAppServiceImpl implements IOutpatientRefundAppServi
|
||||
deviceDispenseService.save(deviceDispense);
|
||||
|
||||
// 费用项查询
|
||||
ChargeItem chargeItem = chargeItemService.getById(creatdDto.getChargeItemId());
|
||||
ChargeItem chargeItem = chargeItemService.getById(createDto.getChargeItemId());
|
||||
// 生成新的费用项
|
||||
chargeItem.setRefundId(chargeItem.getId());// 退费id
|
||||
chargeItem.setId(null); // 费用项id
|
||||
@@ -372,7 +369,7 @@ public class OutpatientRefundAppServiceImpl implements IOutpatientRefundAppServi
|
||||
encounterPatientPageParam, searchKey,
|
||||
new HashSet<>(Arrays.asList(CommonConstants.FieldName.PatientWbStr, CommonConstants.FieldName.PatientPyStr,
|
||||
CommonConstants.FieldName.PatientName, CommonConstants.FieldName.PatientBusNo,
|
||||
CommonConstants.FieldName.EncounterBusNo, CommonConstants.FieldName.idCard)),
|
||||
CommonConstants.FieldName.EncounterBusNo, CommonConstants.FieldName.IdCard)),
|
||||
request);
|
||||
// 就诊患者分页列表
|
||||
Page<EncounterPatientPageDto> encounterPatientPage = outpatientRefundAppMapper.selectBilledEncounterPatientPage(
|
||||
|
||||
@@ -296,8 +296,9 @@ public class OutpatientRegistrationAppServiceImpl implements IOutpatientRegistra
|
||||
}
|
||||
|
||||
IPage<CurrentDayEncounterDto> currentDayEncounter = outpatientRegistrationAppMapper.getCurrentDayEncounter(
|
||||
new Page<>(pageNo, pageSize), EncounterClass.AMB.getValue(), ParticipantType.ADMITTER.getCode(),
|
||||
queryWrapper, ChargeItemContext.REGISTER.getValue(), PaymentStatus.SUCCESS.getValue());
|
||||
new Page<>(pageNo, pageSize), EncounterClass.AMB.getValue(), EncounterStatus.IN_PROGRESS.getValue(),
|
||||
ParticipantType.ADMITTER.getCode(), ParticipantType.REGISTRATION_DOCTOR.getCode(), queryWrapper,
|
||||
ChargeItemContext.REGISTER.getValue(), PaymentStatus.SUCCESS.getValue());
|
||||
currentDayEncounter.getRecords().forEach(e -> {
|
||||
// 性别
|
||||
e.setGenderEnum_enumText(EnumUtils.getInfoByValue(AdministrativeGender.class, e.getGenderEnum()));
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
*/
|
||||
package com.openhis.web.chargemanage.controller;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -27,7 +28,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
@AllArgsConstructor
|
||||
public class OutpatientChargeController {
|
||||
|
||||
@Autowired
|
||||
@Resource
|
||||
private IOutpatientChargeAppService outpatientChargeAppService;
|
||||
|
||||
/**
|
||||
@@ -91,4 +92,26 @@ public class OutpatientChargeController {
|
||||
public R<?> changeToMedicalInsurance(@RequestParam Long encounterId) {
|
||||
return outpatientChargeAppService.changeToMedicalInsurance(encounterId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 医保转自费
|
||||
*
|
||||
* @param encounterId 就诊id
|
||||
* @return 操作结果
|
||||
*/
|
||||
@PutMapping("/student-self-pay")
|
||||
public R<?> changeToStudentSelfPay(@RequestParam Long encounterId) {
|
||||
return outpatientChargeAppService.changeToStudentSelfPay(encounterId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 自费转医保
|
||||
*
|
||||
* @param encounterId 就诊id
|
||||
* @return 操作结果
|
||||
*/
|
||||
@PutMapping("/student-yb-pay")
|
||||
public R<?> changeToStudentYbPay(@RequestParam Long encounterId) {
|
||||
return outpatientChargeAppService.changeToStudentYbPay(encounterId);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ package com.openhis.web.chargemanage.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -30,7 +31,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
@AllArgsConstructor
|
||||
public class OutpatientRefundController {
|
||||
|
||||
@Autowired
|
||||
@Resource
|
||||
private IOutpatientRefundAppService outpatientRefundAppService;
|
||||
|
||||
/**
|
||||
|
||||
@@ -130,6 +130,10 @@ public class CurrentDayEncounterDto {
|
||||
* 生日
|
||||
*/
|
||||
private Date birthDate;
|
||||
/**
|
||||
* 电话
|
||||
*/
|
||||
private String phone;
|
||||
|
||||
/**
|
||||
* 退号日期/时间
|
||||
|
||||
@@ -5,7 +5,6 @@ package com.openhis.web.chargemanage.dto;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
@@ -29,7 +28,7 @@ public class EncounterPatientPaymentDto {
|
||||
/** ID */
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
private Long paymentId;
|
||||
|
||||
/** 就诊ID */
|
||||
private Long encounterId;
|
||||
|
||||
@@ -92,7 +92,17 @@ public class EncounterPatientPrescriptionDto {
|
||||
@Dict(dictCode = "med_type")
|
||||
private String medTypeCode;
|
||||
private String medTypeCode_dictText;
|
||||
|
||||
/** 用法 */
|
||||
@Dict(dictCode = "method_code")
|
||||
private String methodCode;
|
||||
private String methodCode_dictText;
|
||||
private String dose;
|
||||
@Dict(dictCode = "unit_code")
|
||||
private String doseUnitCode;
|
||||
/** 单次剂量单位 */
|
||||
private String doseUnitCode_dictText;
|
||||
/** 频次 */
|
||||
private String rateCode;
|
||||
/** 合同编码 */
|
||||
private String contractNo;
|
||||
|
||||
@@ -109,4 +119,8 @@ public class EncounterPatientPrescriptionDto {
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long serviceId;
|
||||
|
||||
/** 付款id */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long paymentId;
|
||||
|
||||
}
|
||||
|
||||
@@ -36,14 +36,17 @@ public interface OutpatientRegistrationAppMapper {
|
||||
*
|
||||
* @param page 分页参数
|
||||
* @param classEnum 就诊类型
|
||||
* @param participantType 参与者类型
|
||||
* @param statusEnum 门诊就诊状态 | 在诊
|
||||
* @param participantType1 参与者类型 | 接诊医生
|
||||
* @param participantType2 参与者类型 | 挂号医生
|
||||
* @param queryWrapper 查询条件
|
||||
* @param register 收费项目类型:挂号
|
||||
* @param paymentStatus 支付状态:成功
|
||||
* @return 当日就诊数据
|
||||
*/
|
||||
IPage<CurrentDayEncounterDto> getCurrentDayEncounter(@Param("page") Page<CurrentDayEncounterDto> page,
|
||||
@Param("classEnum") Integer classEnum, @Param("participantType") String participantType,
|
||||
@Param("classEnum") Integer classEnum, @Param("statusEnum") Integer statusEnum,
|
||||
@Param("participantType1") String participantType1, @Param("participantType2") String participantType2,
|
||||
@Param(Constants.WRAPPER) QueryWrapper<CurrentDayEncounterDto> queryWrapper,
|
||||
@Param("register") Integer register, @Param("paymentStatus") Integer paymentStatus);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user