Merge branch 'master' of https://codeup.aliyun.com/61c0318acd8b75daa5a125f7/medical/openhis
This commit is contained in:
@@ -3,10 +3,13 @@
|
||||
*/
|
||||
package com.openhis.web.chargemanage.appservice;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.web.chargemanage.dto.EncounterPatientPageParam;
|
||||
|
||||
/**
|
||||
* 门诊退费 service
|
||||
*
|
||||
@@ -30,4 +33,17 @@ public interface IOutpatientRefundAppService {
|
||||
* @return 操作结果
|
||||
*/
|
||||
R<?> refundPayment(List<Long> paymentIdList);
|
||||
|
||||
/**
|
||||
* 查询结算过的就诊患者分页列表
|
||||
*
|
||||
* @param encounterPatientPageParam 查询条件
|
||||
* @param searchKey 模糊查询关键字
|
||||
* @param pageNo 当前页
|
||||
* @param pageSize 每页多少条
|
||||
* @param request 请求
|
||||
* @return 就诊患者分页列表
|
||||
*/
|
||||
R<?> getBilledEncounterPatientPage(EncounterPatientPageParam encounterPatientPageParam, String searchKey,
|
||||
Integer pageNo, Integer pageSize, HttpServletRequest request);
|
||||
}
|
||||
|
||||
@@ -3,20 +3,37 @@
|
||||
*/
|
||||
package com.openhis.web.chargemanage.appservice.impl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.core.common.utils.AgeCalculatorUtil;
|
||||
import com.core.common.utils.MessageUtils;
|
||||
import com.openhis.administration.service.IChargeItemService;
|
||||
import com.openhis.common.constant.CommonConstants;
|
||||
import com.openhis.common.enums.PaymentStatus;
|
||||
import com.openhis.common.constant.PromptMsgConstant;
|
||||
import com.openhis.common.enums.*;
|
||||
import com.openhis.common.utils.EnumUtils;
|
||||
import com.openhis.common.utils.HisQueryUtils;
|
||||
import com.openhis.financial.service.IPaymentReconciliationService;
|
||||
import com.openhis.medication.service.IMedicationDispenseService;
|
||||
import com.openhis.web.chargemanage.appservice.IOutpatientRefundAppService;
|
||||
import com.openhis.web.chargemanage.dto.EncounterPatientPageDto;
|
||||
import com.openhis.web.chargemanage.dto.EncounterPatientPageParam;
|
||||
import com.openhis.web.chargemanage.dto.EncounterPatientPaymentDto;
|
||||
import com.openhis.web.chargemanage.dto.RefundItemDto;
|
||||
import com.openhis.web.chargemanage.mapper.OutpatientRefundAppMapper;
|
||||
import com.openhis.workflow.service.IDeviceDispenseService;
|
||||
import com.openhis.workflow.service.IServiceRequestService;
|
||||
|
||||
/**
|
||||
* 门诊退费 impl
|
||||
@@ -33,6 +50,12 @@ public class OutpatientRefundAppServiceImpl implements IOutpatientRefundAppServi
|
||||
private IPaymentReconciliationService paymentReconciliationService;
|
||||
@Autowired
|
||||
private IChargeItemService chargeItemService;
|
||||
@Autowired
|
||||
private IMedicationDispenseService medicationDispenseService;
|
||||
@Autowired
|
||||
private IDeviceDispenseService deviceDispenseService;
|
||||
@Autowired
|
||||
private IServiceRequestService serviceRequestService;
|
||||
|
||||
/**
|
||||
* 根据就诊id查询患者的账单
|
||||
@@ -56,20 +79,97 @@ public class OutpatientRefundAppServiceImpl implements IOutpatientRefundAppServi
|
||||
*/
|
||||
@Override
|
||||
public R<?> refundPayment(List<Long> paymentIdList) {
|
||||
|
||||
// 医生同意退费
|
||||
// 查询所有的chargeid,对应生成一个负的chargeitem
|
||||
// 根据每个 chargeitem判断对应的服务,药品,耗材是否已发放执行
|
||||
// 若已发放/执行需要对应的发药人/执行人审批(药品耗材需要先退药)
|
||||
|
||||
// todo:医生同意退费(审批流)
|
||||
// 根据支付id获取对应收费项目的id列表
|
||||
List<Long> chargeItemIdList = paymentReconciliationService.getChargeItemIdListByPayment(paymentIdList);
|
||||
|
||||
//根据收费项目id列表查询退费项
|
||||
// 根据收费项目id列表查询退费项
|
||||
List<RefundItemDto> refundItemList = outpatientRefundAppMapper.selectRefundItem(chargeItemIdList,
|
||||
CommonConstants.TableName.MED_MEDICATION_REQUEST, CommonConstants.TableName.WOR_SERVICE_REQUEST,
|
||||
CommonConstants.TableName.WOR_DEVICE_REQUEST, CommonConstants.Common.THREE);
|
||||
|
||||
return null;
|
||||
List<Long> medDisIdList = new ArrayList<>();
|
||||
List<Long> devDisIdList = new ArrayList<>();
|
||||
List<Long> serReqIdList = new ArrayList<>();
|
||||
|
||||
for (RefundItemDto refundItem : refundItemList) {
|
||||
if (CommonConstants.TableName.MED_MEDICATION_REQUEST.equals(refundItem.getServiceTable())) {
|
||||
|
||||
// 药品需要先退药
|
||||
if (DispenseStatus.COMPLETED.getValue().equals(refundItem.getRefundStatus())
|
||||
|| DispenseStatus.PART_COMPLETED.getValue().equals(refundItem.getRefundStatus())) {
|
||||
return R
|
||||
.fail(MessageUtils.createMessage(PromptMsgConstant.ChargeRefund.M00001, new Object[] {"药品"}));
|
||||
} else {
|
||||
// todo:审批流药师同意退费
|
||||
medDisIdList.add(refundItem.getDispenseId());
|
||||
}
|
||||
} else if (CommonConstants.TableName.WOR_SERVICE_REQUEST.equals(refundItem.getServiceTable())) {
|
||||
// 诊疗项目需医技科室同意退费
|
||||
if (RequestStatus.COMPLETED.getValue().equals(refundItem.getRefundStatus())) {
|
||||
return R.fail(MessageUtils.createMessage(PromptMsgConstant.ChargeRefund.M00002, null));
|
||||
} else {
|
||||
// todo:审批流医技师同意退费
|
||||
serReqIdList.add(refundItem.getServiceId());
|
||||
}
|
||||
} else if (CommonConstants.TableName.WOR_DEVICE_REQUEST.equals(refundItem.getServiceTable())) {
|
||||
// 耗材需要先退药
|
||||
if (DispenseStatus.COMPLETED.getValue().equals(refundItem.getRefundStatus())
|
||||
|| DispenseStatus.PART_COMPLETED.getValue().equals(refundItem.getRefundStatus())) {
|
||||
return R
|
||||
.fail(MessageUtils.createMessage(PromptMsgConstant.ChargeRefund.M00001, new Object[] {"耗材"}));
|
||||
} else {
|
||||
devDisIdList.add(refundItem.getDispenseId());
|
||||
}
|
||||
}
|
||||
}
|
||||
// 更新收费状态:已退费
|
||||
chargeItemService.updateRefundChargeStatus(chargeItemIdList);
|
||||
// 更新未发放药品状态:停止发放,停止原因:退费
|
||||
medicationDispenseService.updateStopDispenseStatus(medDisIdList, NotPerformedReason.REFUND.getValue());
|
||||
// 更新未发放耗材状态:停止发放,停止原因:退费
|
||||
deviceDispenseService.updateStopDispenseStatus(devDisIdList, NotPerformedReason.REFUND.getValue());
|
||||
// 更新执行诊疗状态:停止
|
||||
serviceRequestService.updateStopRequestStatus(serReqIdList);
|
||||
// 返回退费成功信息
|
||||
return R.ok(MessageUtils.createMessage(PromptMsgConstant.Common.M00004, new Object[] {"处方退费"}));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询结算过的就诊患者分页列表
|
||||
*
|
||||
* @param encounterPatientPageParam 查询条件
|
||||
* @param searchKey 模糊查询关键字
|
||||
* @param pageNo 当前页
|
||||
* @param pageSize 每页多少条
|
||||
* @param request 请求
|
||||
* @return 就诊患者分页列表
|
||||
*/
|
||||
@Override
|
||||
public R<?> getBilledEncounterPatientPage(EncounterPatientPageParam encounterPatientPageParam, String searchKey,
|
||||
Integer pageNo, Integer pageSize, HttpServletRequest request) {
|
||||
// 构建查询条件
|
||||
QueryWrapper<EncounterPatientPageParam> queryWrapper = HisQueryUtils.buildQueryWrapper(
|
||||
encounterPatientPageParam, searchKey,
|
||||
new HashSet<>(Arrays.asList(CommonConstants.FieldName.PatientWbStr, CommonConstants.FieldName.PatientPyStr,
|
||||
CommonConstants.FieldName.PatientName, CommonConstants.FieldName.PatientBusNo,
|
||||
CommonConstants.FieldName.EncounterBusNo, CommonConstants.FieldName.idCard)),
|
||||
request);
|
||||
// 就诊患者分页列表
|
||||
Page<EncounterPatientPageDto> encounterPatientPage =
|
||||
outpatientRefundAppMapper.selectBilledEncounterPatientPage(new Page<>(pageNo, pageSize), queryWrapper,
|
||||
ChargeItemStatus.BILLED.getValue(), AccountType.MEDICAL_INSURANCE.getValue());
|
||||
|
||||
encounterPatientPage.getRecords().forEach(e -> {
|
||||
// 性别枚举
|
||||
e.setGenderEnum_enumText(EnumUtils.getInfoByValue(AdministrativeGender.class, e.getGenderEnum()));
|
||||
// 收费状态枚举
|
||||
e.setStatusEnum_enumText(EnumUtils.getInfoByValue(ChargeItemStatus.class, e.getStatusEnum()));
|
||||
// 计算年龄
|
||||
e.setAge(AgeCalculatorUtil.getAge(e.getBirthDate()));
|
||||
// 合同类型枚举
|
||||
e.setCategoryEnum_enumText(EnumUtils.getInfoByValue(ContractCategory.class, e.getCategoryEnum()));
|
||||
});
|
||||
return R.ok(encounterPatientPage);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,17 +3,20 @@
|
||||
*/
|
||||
package com.openhis.web.chargemanage.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.web.chargemanage.appservice.IOutpatientRefundAppService;
|
||||
import com.openhis.web.chargemanage.dto.EncounterPatientPageParam;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 门诊退费 controller
|
||||
*
|
||||
@@ -29,6 +32,25 @@ public class OutpatientRefundController {
|
||||
@Autowired
|
||||
private IOutpatientRefundAppService outpatientRefundAppService;
|
||||
|
||||
/**
|
||||
* 查询结算过的就诊患者分页列表
|
||||
*
|
||||
* @param encounterPatientPageParam 查询条件
|
||||
* @param searchKey 模糊查询关键字
|
||||
* @param pageNo 当前页
|
||||
* @param pageSize 每页多少条
|
||||
* @param request 请求
|
||||
* @return 就诊患者分页列表
|
||||
*/
|
||||
@GetMapping(value = "/encounter-patient-page")
|
||||
public R<?> getBilledEncounterPatientPage(EncounterPatientPageParam encounterPatientPageParam,
|
||||
@RequestParam(value = "searchKey", defaultValue = "") String searchKey,
|
||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest request) {
|
||||
return R.ok(outpatientRefundAppService.getBilledEncounterPatientPage(encounterPatientPageParam, searchKey,
|
||||
pageNo, pageSize, request));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据就诊id查询患者的账单
|
||||
*
|
||||
|
||||
@@ -8,6 +8,7 @@ import java.util.Date;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import com.openhis.common.annotation.Dict;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
@@ -72,7 +73,9 @@ public class EncounterPatientPageDto {
|
||||
/**
|
||||
* 账户类型编码
|
||||
*/
|
||||
@Dict(dictCode = "account_code")
|
||||
private String typeCode;
|
||||
private String typeCode_dictText;
|
||||
|
||||
/**
|
||||
* 账户余额
|
||||
@@ -92,4 +95,28 @@ public class EncounterPatientPageDto {
|
||||
/** 收费状态 */
|
||||
private Integer statusEnum;
|
||||
private String statusEnum_enumText;
|
||||
|
||||
/**
|
||||
* 医保总额
|
||||
*/
|
||||
private BigDecimal insurancePrice;
|
||||
|
||||
/**
|
||||
* 自费总额
|
||||
*/
|
||||
private BigDecimal selfPrice;
|
||||
|
||||
/**
|
||||
* 付款总额
|
||||
*/
|
||||
private BigDecimal totalAmount;
|
||||
|
||||
/** 合同类型 */
|
||||
private Integer categoryEnum;
|
||||
private String categoryEnum_enumText;
|
||||
|
||||
/**
|
||||
* 结算时间
|
||||
*/
|
||||
private Date billDate;
|
||||
}
|
||||
|
||||
@@ -53,13 +53,13 @@ public class EncounterPatientPageParam {
|
||||
*/
|
||||
private Date startTime;
|
||||
|
||||
/**
|
||||
* 收费时间
|
||||
*/
|
||||
private Date billTime;
|
||||
|
||||
/**
|
||||
* 收费状态
|
||||
*/
|
||||
private Integer statusEnum;
|
||||
|
||||
/**
|
||||
* 退款标识
|
||||
*/
|
||||
private Integer refundFlag;
|
||||
}
|
||||
|
||||
@@ -14,4 +14,35 @@ import lombok.experimental.Accessors;
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class RefundItemDto {}
|
||||
public class RefundItemDto {
|
||||
|
||||
/** 收费ID */
|
||||
private Long chargeId;
|
||||
|
||||
/** 医疗服务所在表 */
|
||||
private String serviceTable;
|
||||
|
||||
/** 医疗服务ID */
|
||||
private Long serviceId;
|
||||
|
||||
/** 请求编码 */
|
||||
private String busNo;
|
||||
|
||||
/** 请求数量 */
|
||||
private Integer quantity;
|
||||
|
||||
/** 请求单位编码 */
|
||||
private String unitCode;
|
||||
|
||||
/** 退款状态 */
|
||||
private Integer refundStatus;
|
||||
|
||||
/** 项目id */
|
||||
private Long itemId;
|
||||
|
||||
/** 发放id */
|
||||
private Long dispenseId;
|
||||
|
||||
/** 项目名 */
|
||||
private Long itemName;
|
||||
}
|
||||
|
||||
@@ -8,6 +8,11 @@ import java.util.List;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.openhis.web.chargemanage.dto.EncounterPatientPageDto;
|
||||
import com.openhis.web.chargemanage.dto.EncounterPatientPageParam;
|
||||
import com.openhis.web.chargemanage.dto.EncounterPatientPaymentDto;
|
||||
import com.openhis.web.chargemanage.dto.RefundItemDto;
|
||||
|
||||
@@ -47,4 +52,17 @@ public interface OutpatientRefundAppMapper {
|
||||
@Param("medMedicationRequest") String medMedicationRequest,
|
||||
@Param("worServiceRequest") String worServiceRequest, @Param("worDeviceRequest") String worDeviceRequest,
|
||||
@Param("three") Integer three);
|
||||
|
||||
/**
|
||||
* 查询已结算就诊患者分页列表
|
||||
*
|
||||
* @param page 分页
|
||||
* @param queryWrapper 查询条件
|
||||
* @param billed 收费状态:已结算
|
||||
* @param insurance 账户类型:医保
|
||||
* @return 已结算就诊患者分页列表
|
||||
*/
|
||||
Page<EncounterPatientPageDto> selectBilledEncounterPatientPage(@Param("page") Page<EncounterPatientPageDto> page,
|
||||
@Param(Constants.WRAPPER) QueryWrapper<EncounterPatientPageParam> queryWrapper, @Param("billed") Integer billed,
|
||||
@Param("insurance") Integer insurance);
|
||||
}
|
||||
|
||||
@@ -246,6 +246,7 @@ public class ReceiptApprovalAppServiceImpl implements IReceiptApprovalAppService
|
||||
List<ItemChargeDetailDto> chargeDetailList) {
|
||||
List<ChargeItemDefDetail> resultList = new ArrayList<>();
|
||||
|
||||
// todo:同一批次不能改价
|
||||
// 将各个项目的定价信息按项目id分组
|
||||
Map<Long, List<ItemChargeDetailDto>> chargeDetailGroup =
|
||||
chargeDetailList.stream().collect(Collectors.groupingBy(ItemChargeDetailDto::getInstanceId));
|
||||
@@ -307,7 +308,7 @@ public class ReceiptApprovalAppServiceImpl implements IReceiptApprovalAppService
|
||||
*/
|
||||
private ChargeItemDefDetail addChargeItemDefApp(String conditionValue, BigDecimal sellPrice, Long definitionId) {
|
||||
ChargeItemDefDetail chargeItemDefDetail = new ChargeItemDefDetail();
|
||||
// todo:命中条件或建成字典枚举,此处为批次号,单位
|
||||
// todo:命中条件或建成字典枚举,此处为批次号,单位,优先级加一
|
||||
chargeItemDefDetail
|
||||
// 命中值
|
||||
.setConditionValue(conditionValue)
|
||||
|
||||
@@ -31,9 +31,6 @@ no.update.permission=您没有修改数据的权限,请联系管理员添加
|
||||
no.delete.permission=您没有删除数据的权限,请联系管理员添加权限 [{0}]
|
||||
no.export.permission=您没有导出数据的权限,请联系管理员添加权限 [{0}]
|
||||
no.view.permission=您没有查看数据的权限,请联系管理员添加权限 [{0}]
|
||||
|
||||
|
||||
|
||||
apl.common.M00001={0}添加成功
|
||||
apl.common.M00002={0}保存成功
|
||||
apl.common.M00003={0}已经存在
|
||||
@@ -43,4 +40,5 @@ apl.common.M00006=操作失败,该数据已被他人删除,请刷新后重试
|
||||
apl.common.M00007=操作失败,该数据已被他人更改,请刷新后重试
|
||||
apl.common.M00008=请勿重复提交
|
||||
apl.common.M00009=查询成功
|
||||
apl.common.M00010=操作失败,请联系管理员
|
||||
apl.common.M00010=操作失败,请联系管理员
|
||||
apl.chargeRefund.M00001=该收费单相关{0}已经发出,请先退药后再进行退费
|
||||
@@ -4,22 +4,23 @@
|
||||
|
||||
<select id="selectEncounterPatientPage"
|
||||
resultType="com.openhis.web.chargemanage.dto.EncounterPatientPageDto">
|
||||
SELECT T3.encounter_id,
|
||||
T3.encounter_bus_no,
|
||||
T3.start_time,
|
||||
T3.patient_name,
|
||||
T3.patient_bus_no,
|
||||
T3.gender_enum,
|
||||
T3.birth_date,
|
||||
T3.id_card,
|
||||
T3.patient_py_str,
|
||||
T3.patient_wb_str,
|
||||
T3.status_enum
|
||||
SELECT T4.encounter_id,
|
||||
T4.encounter_bus_no,
|
||||
T4.start_time,
|
||||
T4.patient_name,
|
||||
T4.patient_bus_no,
|
||||
T4.gender_enum,
|
||||
T4.birth_date,
|
||||
T4.id_card,
|
||||
T4.patient_py_str,
|
||||
T4.patient_wb_str,
|
||||
T4.status_enum
|
||||
FROM (
|
||||
SELECT T1.id AS encounter_id,
|
||||
SELECT T1.id AS encounter_id,
|
||||
T1.bus_no AS encounter_bus_no,
|
||||
T1.start_time,
|
||||
T1.delete_flag,
|
||||
T1.tenant_id,
|
||||
T2."name" AS patient_name,
|
||||
T2.bus_no AS patient_bus_no,
|
||||
T2.gender_enum,
|
||||
@@ -34,8 +35,8 @@
|
||||
LEFT JOIN adm_charge_item AS T3
|
||||
ON T3.encounter_id = T1.id
|
||||
WHERE T1.delete_flag = '0'
|
||||
ORDER BY T1.encounter_bus_no DESC
|
||||
) AS T3
|
||||
ORDER BY T1.bus_no DESC
|
||||
) AS T4
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
|
||||
|
||||
@@ -24,46 +24,144 @@
|
||||
AND T1.delete_flag = '0'
|
||||
</select>
|
||||
<select id="selectRefundItem" resultType="com.openhis.web.chargemanage.dto.RefundItemDto">
|
||||
SELECT (T1.discount_amount + T2.surcharge_amount) AS pay_amount,
|
||||
SELECT T1.id AS charge_id,
|
||||
T1.service_table,
|
||||
T1.service_id,
|
||||
T2.bus_no,
|
||||
T2.prescription_no,
|
||||
T2.quantity,
|
||||
T2.medication_id AS item_id,
|
||||
T2.unit_code,
|
||||
T3.status_enum
|
||||
T3.status_enum AS refund_status,
|
||||
T3.id AS dispense_id,
|
||||
T7.name AS item_name
|
||||
FROM adm_charge_item AS T1
|
||||
LEFT JOIN med_medication_request AS T2
|
||||
ON T2.bus_no = SUBSTRING(T1.bus_no, #{three})
|
||||
LEFT JOIN med_medication_dispense AS T3
|
||||
ON T3.med_req_id = T2.id
|
||||
ON T3.med_req_id = T2.id
|
||||
LEFT JOIN med_medication_definition AS T7
|
||||
ON T1.product_id = T7.id
|
||||
WHERE T1.service_table = #{medMedicationRequest}
|
||||
AND T1.id IN
|
||||
<foreach collection="chargeItemIdList" item="chargeItemId" separator="," open="(" close=")">
|
||||
#{chargeItemId}
|
||||
</foreach>
|
||||
UNION
|
||||
SELECT T1.*,
|
||||
T2.name AS service_name
|
||||
UNION
|
||||
SELECT T1.id AS charge_id,
|
||||
T1.service_table,
|
||||
T1.service_id,
|
||||
T4.bus_no,
|
||||
T4.prescription_no,
|
||||
T4.quantity,
|
||||
T4.device_def_id AS item_id,
|
||||
T4.unit_code,
|
||||
T5.status_enum AS refund_status,
|
||||
T5.id AS dispense_id,
|
||||
T8.name AS item_name
|
||||
FROM adm_charge_item AS T1
|
||||
LEFT JOIN wor_device_request AS T4
|
||||
ON T4.bus_no = SUBSTRING(T1.bus_no, #{three})
|
||||
LEFT JOIN wor_device_dispense AS T5
|
||||
ON T5.device_req_id = T4.id
|
||||
LEFT JOIN adm_device_definition AS T8
|
||||
ON T1.product_id = T8.id
|
||||
WHERE T1.service_table = #{worDeviceRequest}
|
||||
AND T1.id IN
|
||||
<foreach collection="chargeItemIdList" item="chargeItemId" separator="," open="(" close=")">
|
||||
#{chargeItemId}
|
||||
</foreach>
|
||||
UNION
|
||||
SELECT T1.*,
|
||||
T2.name AS service_name
|
||||
SELECT T1.id AS charge_id,,
|
||||
T1.service_table,
|
||||
T1.service_id,
|
||||
T6.bus_no,
|
||||
T6.prescription_no,
|
||||
T6.quantity,
|
||||
T6.activity_id AS item_id,
|
||||
T6.unit_code,
|
||||
T6.status_enum AS refund_status,
|
||||
null AS dispense_id,
|
||||
T9.name AS item_name
|
||||
FROM adm_charge_item AS T1
|
||||
LEFT JOIN wor_service_request AS T6
|
||||
ON T6.bus_no = SUBSTRING(T1.bus_no, #{three})
|
||||
LEFT JOIN wor_activity_definition AS T9
|
||||
ON T1.product_id = T9.id
|
||||
WHERE T1.service_table = #{worServiceRequest}
|
||||
AND T1.id IN
|
||||
<foreach collection="chargeItemIdList" item="chargeItemId" separator="," open="(" close=")">
|
||||
#{chargeItemId}
|
||||
</foreach>
|
||||
</select>
|
||||
<select id="selectBilledEncounterPatientPage"
|
||||
resultType="com.openhis.web.chargemanage.dto.EncounterPatientPageDto">
|
||||
SELECT T8.encounter_id,
|
||||
T8.encounter_bus_no,
|
||||
T8.start_time,
|
||||
T8.patient_name,
|
||||
T8.patient_bus_no,
|
||||
T8.gender_enum,
|
||||
T8.birth_date,
|
||||
T8.id_card,
|
||||
T8.patient_py_str,
|
||||
T8.patient_wb_str,
|
||||
T8.type_code,
|
||||
T8.category_enum,
|
||||
T8.total_amount,
|
||||
T8.bill_date
|
||||
FROM (
|
||||
SELECT T1.id AS encounter_id,
|
||||
T1.bus_no AS encounter_bus_no,
|
||||
T1.start_time,
|
||||
T1.delete_flag,
|
||||
T1.tenant_id,
|
||||
T2."name" AS patient_name,
|
||||
T2.bus_no AS patient_bus_no,
|
||||
T2.gender_enum,
|
||||
T2.birth_date,
|
||||
T2.id_card,
|
||||
T2.py_str AS patient_py_str,
|
||||
T2.wb_str AS patient_wb_str,
|
||||
T4.type_code,
|
||||
T5.category_enum,
|
||||
SUM(T6.tendered_amount) AS total_amount,
|
||||
T6.bill_date,
|
||||
CASE WHEN T7.account_enum = #{insurance} THEN SUM(T7.amount) ELSE 0 END AS insurance_amount,
|
||||
CASE WHEN T7.account_enum != #{insurance} THEN SUM(T7.amount) ELSE 0 END AS self_amount
|
||||
FROM adm_encounter AS T1
|
||||
LEFT JOIN adm_patient AS T2
|
||||
ON T1.patient_id = T2.id
|
||||
LEFT JOIN adm_charge_item AS T3
|
||||
ON T3.encounter_id = T1.id
|
||||
LEFT JOIN adm_account AS T4
|
||||
ON T4.id = T3.account_id
|
||||
LEFT JOIN fin_contract AS T5
|
||||
ON T5.bus_no = T4.contract_no
|
||||
LEFT JOIN fin_payment_reconciliation AS T6
|
||||
ON T6.encouter_id = T1.id
|
||||
LEFT JOIN fin_payment_rec_detail AS T7
|
||||
ON T7.reconciliation_id = T6.id
|
||||
WHERE T3.status_enum = #{billed}
|
||||
AND T1.delete_flag = '0'
|
||||
GROUP BY T1.id,
|
||||
T1.bus_no,
|
||||
T1.start_time,
|
||||
T1.delete_flag,
|
||||
T1.tenant_id,
|
||||
T2."name",
|
||||
T2.bus_no,
|
||||
T2.gender_enum,
|
||||
T2.birth_date,
|
||||
T2.id_card,
|
||||
T2.py_str,
|
||||
T2.wb_str,
|
||||
T4.type_code,
|
||||
T5.category_enum,
|
||||
T6.bill_date,
|
||||
T7.account_enum
|
||||
ORDER BY T6.bill_date DESC
|
||||
) AS T8
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -70,4 +70,21 @@ public class PromptMsgConstant {
|
||||
String M00001 = "apl.inventory.M00001";
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 退费
|
||||
*/
|
||||
public interface ChargeRefund {
|
||||
|
||||
/**
|
||||
* 该收费单相关{0}已经发出,请先退药后再进行退费
|
||||
*/
|
||||
String M00001 = "apl.chargeRefund.M00001";
|
||||
|
||||
/**
|
||||
* 该收费单相关诊疗项目已经执行,请等待医技科室审批完成后再进行退费
|
||||
*/
|
||||
String M00002 = "apl.chargeRefund.M00002";
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ public enum AssignSeqEnum {
|
||||
/**
|
||||
* 处方号
|
||||
*/
|
||||
PRESCRIPTION_NO("4", "处方号", "P"),
|
||||
PRESCRIPTION_NO("4", "处方号", "PR"),
|
||||
|
||||
/**
|
||||
* 药品请求编码
|
||||
|
||||
@@ -37,10 +37,25 @@ public enum ChargeItemStatus implements HisEnumInterface {
|
||||
*/
|
||||
ERROR(6, "entered-in-error", "错误"),
|
||||
|
||||
/**
|
||||
* 退费中
|
||||
*/
|
||||
REFUNDING(7, "refunding", "退费中"),
|
||||
|
||||
/**
|
||||
* 全部退费
|
||||
*/
|
||||
REFUNDED(8, "refunded", "全部退费"),
|
||||
|
||||
/**
|
||||
* 部分退费
|
||||
*/
|
||||
PART_REFUND(9, "part-refund", "部分退费"),
|
||||
|
||||
/**
|
||||
* 未知
|
||||
*/
|
||||
UNKNOWN(7, "unknown", "未知");
|
||||
UNKNOWN(10, "unknown", "未知");
|
||||
|
||||
private final Integer value;
|
||||
private final String code;
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.common.enums;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.EnumValue;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 合同类型
|
||||
*
|
||||
* @author zwh
|
||||
* @date 2025-03-29
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum ContractCategory implements HisEnumInterface{
|
||||
|
||||
/**
|
||||
* 自费
|
||||
*/
|
||||
SELF_CHARGE(1, "1", "自费"),
|
||||
|
||||
/**
|
||||
* 公费
|
||||
*/
|
||||
PUBLIC_CHARGE(2, "2", "公费"),
|
||||
|
||||
/**
|
||||
* 省医保
|
||||
*/
|
||||
PROVINCIAL_INSURANCE(3, "3", "省医保"),
|
||||
|
||||
/**
|
||||
* 市医保
|
||||
*/
|
||||
MUNICIPAL_INSURANCE(4, "4", "市医保"),
|
||||
|
||||
/**
|
||||
* 职工医保
|
||||
*/
|
||||
WORKER_INSURANCE(5, "5", "职工医保");
|
||||
|
||||
@EnumValue
|
||||
private final Integer value;
|
||||
private final String code;
|
||||
private final String info;
|
||||
}
|
||||
@@ -46,7 +46,7 @@ public enum DispenseStatus implements HisEnumInterface {
|
||||
/**
|
||||
* 拒绝发药
|
||||
*/
|
||||
DECLINED(7, "DE", "拒绝发药 已退药"),
|
||||
DECLINED(7, "DE", "拒绝发药"),
|
||||
|
||||
/**
|
||||
* 已汇总
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.common.enums;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.EnumValue;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 未执行原因
|
||||
*
|
||||
* @author zwh
|
||||
* @date 2025-03-29
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum NotPerformedReason {
|
||||
|
||||
/**
|
||||
* 退费
|
||||
*/
|
||||
REFUND(1, "1", "退费"),
|
||||
|
||||
/**
|
||||
* 异常
|
||||
*/
|
||||
ERROR(9, "9", "异常");
|
||||
|
||||
@EnumValue
|
||||
private final Integer value;
|
||||
private final String code;
|
||||
private final String info;
|
||||
}
|
||||
@@ -36,9 +36,9 @@ public enum RequestStatus implements HisEnumInterface {
|
||||
ON_HOLD(4, "on_hold", "暂停"),
|
||||
|
||||
/**
|
||||
* 撤回
|
||||
* 取消
|
||||
*/
|
||||
CANCELLED(5, "cancelled", "撤回"),
|
||||
CANCELLED(5, "cancelled", "取消"),
|
||||
|
||||
/**
|
||||
* 停止
|
||||
|
||||
@@ -43,4 +43,11 @@ public interface IChargeItemService extends IService<ChargeItem> {
|
||||
* @return 收费信息
|
||||
*/
|
||||
List<ChargeItem> getChargeItemInfo(List<Long> chargeItemIdList);
|
||||
|
||||
/**
|
||||
* 更新收费状态:已退费
|
||||
*
|
||||
* @param chargeItemIdList 收费id列表
|
||||
*/
|
||||
void updateRefundChargeStatus(List<Long> chargeItemIdList);
|
||||
}
|
||||
@@ -9,6 +9,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.openhis.administration.domain.ChargeItem;
|
||||
import com.openhis.administration.mapper.ChargeItemMapper;
|
||||
import com.openhis.administration.service.IChargeItemService;
|
||||
import com.openhis.common.enums.ChargeItemStatus;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
|
||||
@@ -56,8 +57,8 @@ public class ChargeItemServiceImpl extends ServiceImpl<ChargeItemMapper, ChargeI
|
||||
*/
|
||||
@Override
|
||||
public boolean updateAccountType(Long encounterId, Long accountId) {
|
||||
int update = baseMapper.update(null, new LambdaUpdateWrapper<ChargeItem>()
|
||||
.eq(ChargeItem::getEncounterId, encounterId).set(ChargeItem::getAccountId, accountId));
|
||||
int update = baseMapper.update(new ChargeItem().setAccountId(accountId),
|
||||
new LambdaUpdateWrapper<ChargeItem>().eq(ChargeItem::getEncounterId, encounterId));
|
||||
return update > 0;
|
||||
}
|
||||
|
||||
@@ -71,4 +72,15 @@ public class ChargeItemServiceImpl extends ServiceImpl<ChargeItemMapper, ChargeI
|
||||
public List<ChargeItem> getChargeItemInfo(List<Long> chargeItemIdList) {
|
||||
return baseMapper.selectBatchIds(chargeItemIdList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新收费状态:已退费
|
||||
*
|
||||
* @param chargeItemIdList 收费id列表
|
||||
*/
|
||||
@Override
|
||||
public void updateRefundChargeStatus(List<Long> chargeItemIdList) {
|
||||
baseMapper.update(new ChargeItem().setStatusEnum(ChargeItemStatus.REFUNDED.getValue()),
|
||||
new LambdaUpdateWrapper<ChargeItem>().in(ChargeItem::getId, chargeItemIdList));
|
||||
}
|
||||
}
|
||||
@@ -30,8 +30,8 @@ public class OrganizationServiceImpl extends ServiceImpl<OrganizationMapper, Org
|
||||
*/
|
||||
@Override
|
||||
public boolean activeOrg(Long orgId) {
|
||||
int updateCount = baseMapper.update(null, new LambdaUpdateWrapper<Organization>().eq(Organization::getId, orgId)
|
||||
.set(Organization::getActiveFlag, AccountStatus.ACTIVE.getValue()));
|
||||
int updateCount = baseMapper.update(new Organization().setActiveFlag(AccountStatus.ACTIVE.getValue()),
|
||||
new LambdaUpdateWrapper<Organization>().eq(Organization::getId, orgId));
|
||||
return updateCount > 0;
|
||||
}
|
||||
|
||||
@@ -43,8 +43,8 @@ public class OrganizationServiceImpl extends ServiceImpl<OrganizationMapper, Org
|
||||
*/
|
||||
@Override
|
||||
public boolean inactiveOrg(Long orgId) {
|
||||
int updateCount = baseMapper.update(null, new LambdaUpdateWrapper<Organization>().eq(Organization::getId, orgId)
|
||||
.set(Organization::getActiveFlag, AccountStatus.INACTIVE.getValue()));
|
||||
int updateCount = baseMapper.update(new Organization().setActiveFlag(AccountStatus.INACTIVE.getValue()),
|
||||
new LambdaUpdateWrapper<Organization>().eq(Organization::getId, orgId));
|
||||
return updateCount > 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -6,8 +6,8 @@ import java.util.Date;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
import com.core.common.core.domain.HisBaseEntity;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
@@ -31,6 +31,9 @@ public class PaymentRecDetail extends HisBaseEntity {
|
||||
/** 先前支付明细id */
|
||||
private Long predecessorId;
|
||||
|
||||
/** 付款id */
|
||||
private Long reconciliationId;
|
||||
|
||||
/** 付款类型 */
|
||||
private Integer targetEnum;
|
||||
|
||||
@@ -73,5 +76,4 @@ public class PaymentRecDetail extends HisBaseEntity {
|
||||
/** 单笔交易结果 */
|
||||
private Integer resultEnum;
|
||||
|
||||
|
||||
}
|
||||
@@ -6,8 +6,8 @@ import java.util.Date;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
import com.core.common.core.domain.HisBaseEntity;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
@@ -88,5 +88,6 @@ public class PaymentReconciliation extends HisBaseEntity {
|
||||
/** 就诊ID */
|
||||
private Long encounterId;
|
||||
|
||||
|
||||
/** 结算时间 */
|
||||
private Date billDate;
|
||||
}
|
||||
@@ -20,4 +20,12 @@ public interface IMedicationDispenseService extends IService<MedicationDispense>
|
||||
* @param medicationRequestList 药品请求信息
|
||||
*/
|
||||
void addMedicationDispense(List<MedicationRequest> medicationRequestList);
|
||||
|
||||
/**
|
||||
* 更新未发放药品状态:停止发放
|
||||
*
|
||||
* @param medDisIdList 发放id列表
|
||||
* @param refund 停止原因:退费
|
||||
*/
|
||||
void updateStopDispenseStatus(List<Long> medDisIdList, Integer refund);
|
||||
}
|
||||
@@ -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.core.common.utils.DateUtils;
|
||||
import com.openhis.common.enums.DispenseStatus;
|
||||
@@ -74,4 +75,17 @@ public class MedicationDispenseServiceImpl extends ServiceImpl<MedicationDispens
|
||||
baseMapper.insert(medicationDispense);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新未发放药品状态:停止发放
|
||||
*
|
||||
* @param medDisIdList 发放id列表
|
||||
* @param refund 停止原因:退费
|
||||
*/
|
||||
@Override
|
||||
public void updateStopDispenseStatus(List<Long> medDisIdList, Integer refund) {
|
||||
baseMapper.update(
|
||||
new MedicationDispense().setStatusEnum(DispenseStatus.STOPPED.getValue()).setNotPerformedReasonEnum(refund),
|
||||
new LambdaUpdateWrapper<MedicationDispense>().in(MedicationDispense::getId, medDisIdList));
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.openhis.workflow.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.openhis.workflow.domain.DeviceDispense;
|
||||
|
||||
@@ -11,4 +13,11 @@ import com.openhis.workflow.domain.DeviceDispense;
|
||||
*/
|
||||
public interface IDeviceDispenseService extends IService<DeviceDispense> {
|
||||
|
||||
/**
|
||||
* 更新未发放耗材状态:停止发放
|
||||
*
|
||||
* @param devDisIdList 发放id列表
|
||||
* @param refund 停止原因:退费
|
||||
*/
|
||||
void updateStopDispenseStatus(List<Long> devDisIdList, Integer refund);
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.openhis.workflow.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.openhis.workflow.domain.ServiceRequest;
|
||||
|
||||
@@ -12,13 +13,18 @@ import com.openhis.workflow.domain.ServiceRequest;
|
||||
*/
|
||||
public interface IServiceRequestService extends IService<ServiceRequest> {
|
||||
|
||||
|
||||
/**
|
||||
* 查询服务申请管理中basedOnId相同的个数
|
||||
*
|
||||
* @param basedOnId 请求基于什么的ID
|
||||
* @return basedOnId相同的个数
|
||||
*/
|
||||
Long countServiceRequestByBasedOnId(Long basedOnId) ;
|
||||
Long countServiceRequestByBasedOnId(Long basedOnId);
|
||||
|
||||
/**
|
||||
* 更新执行诊疗状态:停止
|
||||
*
|
||||
* @param serReqIdList 服务请求id列表
|
||||
*/
|
||||
void updateStopRequestStatus(List<Long> serReqIdList);
|
||||
}
|
||||
@@ -1,8 +1,12 @@
|
||||
package com.openhis.workflow.service.impl;
|
||||
|
||||
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.common.enums.DispenseStatus;
|
||||
import com.openhis.workflow.domain.DeviceDispense;
|
||||
import com.openhis.workflow.mapper.DeviceDispenseMapper;
|
||||
import com.openhis.workflow.service.IDeviceDispenseService;
|
||||
@@ -14,6 +18,19 @@ import com.openhis.workflow.service.IDeviceDispenseService;
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
@Service
|
||||
public class DeviceDispenseServiceImpl extends ServiceImpl<DeviceDispenseMapper, DeviceDispense> implements IDeviceDispenseService {
|
||||
public class DeviceDispenseServiceImpl extends ServiceImpl<DeviceDispenseMapper, DeviceDispense>
|
||||
implements IDeviceDispenseService {
|
||||
|
||||
/**
|
||||
* 更新未发放耗材状态:停止发放
|
||||
*
|
||||
* @param devDisIdList 发放id列表
|
||||
* @param refund 停止原因:退费
|
||||
*/
|
||||
@Override
|
||||
public void updateStopDispenseStatus(List<Long> devDisIdList, Integer refund) {
|
||||
baseMapper.update(
|
||||
new DeviceDispense().setStatusEnum(DispenseStatus.STOPPED.getValue()).setNotPerformedReasonEnum(refund),
|
||||
new LambdaUpdateWrapper<DeviceDispense>().in(DeviceDispense::getId, devDisIdList));
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,13 @@
|
||||
package com.openhis.workflow.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.openhis.common.enums.RequestStatus;
|
||||
import com.openhis.workflow.domain.ServiceRequest;
|
||||
import com.openhis.workflow.mapper.ServiceRequestMapper;
|
||||
import com.openhis.workflow.service.IServiceRequestService;
|
||||
@@ -20,9 +22,6 @@ import com.openhis.workflow.service.IServiceRequestService;
|
||||
public class ServiceRequestServiceImpl extends ServiceImpl<ServiceRequestMapper, ServiceRequest>
|
||||
implements IServiceRequestService {
|
||||
|
||||
@Autowired
|
||||
private ServiceRequestMapper serviceRequestMapper;
|
||||
|
||||
/**
|
||||
* 查询服务申请管理中basedOnId相同的个数
|
||||
*
|
||||
@@ -33,6 +32,17 @@ public class ServiceRequestServiceImpl extends ServiceImpl<ServiceRequestMapper,
|
||||
public Long countServiceRequestByBasedOnId(Long basedOnId) {
|
||||
LambdaQueryWrapper<ServiceRequest> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(ServiceRequest::getBasedOnId, basedOnId);
|
||||
return serviceRequestMapper.selectCount(queryWrapper);
|
||||
return baseMapper.selectCount(queryWrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新执行诊疗状态:停止
|
||||
*
|
||||
* @param serReqIdList 服务请求id列表
|
||||
*/
|
||||
@Override
|
||||
public void updateStopRequestStatus(List<Long> serReqIdList) {
|
||||
baseMapper.update(new ServiceRequest().setStatusEnum(RequestStatus.STOPPED.getValue()),
|
||||
new LambdaUpdateWrapper<ServiceRequest>().in(ServiceRequest::getId, serReqIdList));
|
||||
}
|
||||
}
|
||||
@@ -53,10 +53,10 @@ public class SupplyRequestServiceImpl extends ServiceImpl<SupplyRequestMapper, S
|
||||
@Override
|
||||
public List<SupplyRequest> agreeRequest(String busNo, LoginUser loginUser, Date now) {
|
||||
// 更新单据状态
|
||||
baseMapper.update(null,
|
||||
new LambdaUpdateWrapper<SupplyRequest>().eq(SupplyRequest::getBusNo, busNo)
|
||||
.set(SupplyRequest::getApprovalTime, now).set(SupplyRequest::getApproverId, loginUser.getUserId())
|
||||
.set(SupplyRequest::getStatusEnum, SupplyStatus.AGREE.getValue()));
|
||||
baseMapper.update(
|
||||
new SupplyRequest().setApprovalTime(now).setApproverId(loginUser.getPractitionerId())
|
||||
.setStatusEnum(SupplyStatus.AGREE.getValue()),
|
||||
new LambdaUpdateWrapper<SupplyRequest>().eq(SupplyRequest::getBusNo, busNo));
|
||||
// 返回单据详情
|
||||
return this.getSupplyByBusNo(busNo);
|
||||
}
|
||||
@@ -69,10 +69,9 @@ public class SupplyRequestServiceImpl extends ServiceImpl<SupplyRequestMapper, S
|
||||
*/
|
||||
@Override
|
||||
public boolean submitApproval(String busNo) {
|
||||
int updateCount = baseMapper.update(null,
|
||||
new LambdaUpdateWrapper<SupplyRequest>().eq(SupplyRequest::getBusNo, busNo)
|
||||
.set(SupplyRequest::getStatusEnum, SupplyStatus.APPROVAL.getValue())
|
||||
.set(SupplyRequest::getApplyTime, DateUtils.getNowDate()));
|
||||
int updateCount = baseMapper.update(
|
||||
new SupplyRequest().setApplyTime(DateUtils.getNowDate()).setStatusEnum(SupplyStatus.APPROVAL.getValue()),
|
||||
new LambdaUpdateWrapper<SupplyRequest>().eq(SupplyRequest::getBusNo, busNo));
|
||||
return updateCount > 0;
|
||||
}
|
||||
|
||||
@@ -84,8 +83,8 @@ public class SupplyRequestServiceImpl extends ServiceImpl<SupplyRequestMapper, S
|
||||
*/
|
||||
@Override
|
||||
public boolean withdrawApproval(String busNo) {
|
||||
int updateCount = baseMapper.update(null, new LambdaUpdateWrapper<SupplyRequest>()
|
||||
.eq(SupplyRequest::getBusNo, busNo).set(SupplyRequest::getStatusEnum, SupplyStatus.WITHDRAW.getValue()));
|
||||
int updateCount = baseMapper.update(new SupplyRequest().setStatusEnum(SupplyStatus.WITHDRAW.getValue()),
|
||||
new LambdaUpdateWrapper<SupplyRequest>().eq(SupplyRequest::getBusNo, busNo));
|
||||
return updateCount > 0;
|
||||
}
|
||||
|
||||
@@ -99,10 +98,10 @@ public class SupplyRequestServiceImpl extends ServiceImpl<SupplyRequestMapper, S
|
||||
@Override
|
||||
public boolean rejectRequest(String busNo, LoginUser loginUser, Date now) {
|
||||
// 更新单据状态
|
||||
int updateCount = baseMapper.update(null,
|
||||
new LambdaUpdateWrapper<SupplyRequest>().eq(SupplyRequest::getBusNo, busNo)
|
||||
.set(SupplyRequest::getApprovalTime, now).set(SupplyRequest::getApproverId, loginUser.getUserId())
|
||||
.set(SupplyRequest::getStatusEnum, SupplyStatus.REJECT.getValue()));
|
||||
int updateCount = baseMapper.update(
|
||||
new SupplyRequest().setApprovalTime(now).setApproverId(loginUser.getPractitionerId())
|
||||
.setStatusEnum(SupplyStatus.REJECT.getValue()),
|
||||
new LambdaUpdateWrapper<SupplyRequest>().eq(SupplyRequest::getBusNo, busNo));
|
||||
return updateCount > 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user