Merge branch 'master' of https://codeup.aliyun.com/61c0318acd8b75daa5a125f7/medical/openhis
# Conflicts: # openhis-server/openhis-application/src/main/java/com/openhis/web/InventoryManage/controller/PurchaseInventoryController.java
This commit is contained in:
@@ -4,6 +4,9 @@ import org.springframework.context.MessageSource;
|
||||
import org.springframework.context.i18n.LocaleContextHolder;
|
||||
|
||||
import com.core.common.utils.spring.SpringUtils;
|
||||
import org.springframework.lang.Nullable;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
/**
|
||||
* 获取i18n资源文件
|
||||
@@ -22,4 +25,10 @@ public class MessageUtils {
|
||||
MessageSource messageSource = SpringUtils.getBean(MessageSource.class);
|
||||
return messageSource.getMessage(code, args, LocaleContextHolder.getLocale());
|
||||
}
|
||||
|
||||
public static String createMessage(String id, @Nullable Object[] params) {
|
||||
MessageSource messageSource = (MessageSource) SpringContextUtils.getApplicationContext().getBean(MessageSource.class);
|
||||
String messageConvert = messageSource.getMessage(id, params, Locale.getDefault());
|
||||
return messageConvert;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.core.common.utils;
|
||||
|
||||
|
||||
import org.springframework.beans.BeansException;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.ApplicationContextAware;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.context.request.RequestContextHolder;
|
||||
import org.springframework.web.context.request.ServletRequestAttributes;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
@Component
|
||||
public class SpringContextUtils implements ApplicationContextAware {
|
||||
|
||||
private static ApplicationContext applicationContext;
|
||||
|
||||
public SpringContextUtils() {
|
||||
}
|
||||
|
||||
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
|
||||
SpringContextUtils.applicationContext = applicationContext;
|
||||
}
|
||||
|
||||
public static ApplicationContext getApplicationContext() {
|
||||
return applicationContext;
|
||||
}
|
||||
|
||||
public static HttpServletRequest getHttpServletRequest() {
|
||||
return ((ServletRequestAttributes)RequestContextHolder.getRequestAttributes()).getRequest();
|
||||
}
|
||||
|
||||
public static HttpServletResponse getHttpServletResponse() {
|
||||
return ((ServletRequestAttributes)RequestContextHolder.getRequestAttributes()).getResponse();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.inventoryManage.assembler;
|
||||
package com.openhis.web.inventorymanage.assembler;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -11,7 +11,7 @@ import java.util.stream.Collectors;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.openhis.administration.domain.Patient;
|
||||
import com.openhis.medication.domain.Medication;
|
||||
import com.openhis.web.inventoryManage.dto.InventoryReceiptDto;
|
||||
import com.openhis.web.inventorymanage.dto.InventoryReceiptDto;
|
||||
import com.openhis.workflow.domain.SupplyRequest;
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.inventoryManage.controller;
|
||||
package com.openhis.web.inventorymanage.controller;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
@@ -12,15 +12,22 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.core.common.utils.MessageUtils;
|
||||
import com.core.common.utils.bean.BeanUtils;
|
||||
import com.openhis.administration.domain.ChargeItem;
|
||||
import com.openhis.administration.domain.Patient;
|
||||
import com.openhis.administration.service.IChargeItemService;
|
||||
import com.openhis.administration.service.IPatientService;
|
||||
import com.openhis.common.constant.PromptMsgConstant;
|
||||
import com.openhis.medication.domain.Medication;
|
||||
import com.openhis.medication.service.IMedicationService;
|
||||
import com.openhis.web.inventoryManage.assembler.PurchaseInventoryAssembler;
|
||||
import com.openhis.web.inventoryManage.dto.SupplySearchParam;
|
||||
import com.openhis.web.inventorymanage.assembler.PurchaseInventoryAssembler;
|
||||
import com.openhis.web.inventorymanage.dto.SupplyRequestDto;
|
||||
import com.openhis.web.inventorymanage.dto.SupplySaveRequestDto;
|
||||
import com.openhis.web.inventorymanage.dto.SupplySearchParam;
|
||||
import com.openhis.workflow.domain.SupplyRequest;
|
||||
import com.openhis.workflow.service.ISupplyRequestService;
|
||||
|
||||
@@ -42,23 +49,13 @@ public class PurchaseInventoryController {
|
||||
private IMedicationService medicationService;
|
||||
@Autowired
|
||||
private IPatientService patientService;
|
||||
@Autowired
|
||||
private IChargeItemService chargeItemService;
|
||||
|
||||
/**
|
||||
* 入库单据分页列表
|
||||
*
|
||||
* @param supplySearchParam 查询条件
|
||||
* @param pageNo 当前页码
|
||||
* @param pageSize 查询条数
|
||||
* @param request 请求数据
|
||||
* @return 入库单据分页列表
|
||||
*/
|
||||
@GetMapping(value = "/inventory-receipt-page")
|
||||
public Page<SupplyRequest> getPage(SupplySearchParam supplySearchParam,
|
||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest request) {
|
||||
// 查询supply_request相关信息并返回分页列表
|
||||
|
||||
return supplyRequestService.page(new Page<>(pageNo,pageSize));
|
||||
@GetMapping(value = "/test")
|
||||
public R<?> test() {
|
||||
// return R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002,new Object[] {"12345"})) ;
|
||||
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"12345"}));
|
||||
}
|
||||
|
||||
// 添加入库单据之前需要
|
||||
@@ -70,25 +67,79 @@ public class PurchaseInventoryController {
|
||||
/**
|
||||
* 添加入库单据(生成供应请求)
|
||||
*
|
||||
* @param supplyRequest 供应请求信息
|
||||
* @param supplyRequestDto 供应请求信息
|
||||
*/
|
||||
@PostMapping("/add-supply-request")
|
||||
public void addSupplyRequest(@Validated @RequestBody SupplyRequest supplyRequest) {
|
||||
@PostMapping("/add-inventory-receipt")
|
||||
public R<?> addSupplyRequest(@Validated @RequestBody SupplyRequestDto supplyRequestDto) {
|
||||
// 生成待发送的入库单据supply_request
|
||||
// 生成收费项目charge_item
|
||||
SupplyRequest supplyRequest = new SupplyRequest();
|
||||
BeanUtils.copyProperties(supplyRequestDto, supplyRequest);
|
||||
// 如果业务上不需要其它处理 直接调用service的保存方法
|
||||
boolean saveSupplyRequestSuccess = supplyRequestService.save(supplyRequest);
|
||||
|
||||
// 如果采购单价被修改了,需要根据批次号更新采购单价子表价格
|
||||
if (!saveSupplyRequestSuccess) {
|
||||
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00006, null));
|
||||
}
|
||||
// 生成收费项目charge_item
|
||||
ChargeItem chargeItem = new ChargeItem();
|
||||
// 如果字段很少建议手动set赋值
|
||||
chargeItem.setUnitPrice(supplyRequestDto.getUnitPrice());
|
||||
boolean saveChargeItemSuccess = chargeItemService.saveChargeItem(chargeItem);
|
||||
// 如果采购单价被修改了,需要根据批次号更新采购单价子表价格、
|
||||
|
||||
// if (saveChargeItemSuccess) {
|
||||
// return R.ok();
|
||||
// } else {
|
||||
// return R.fail();
|
||||
// }
|
||||
return saveChargeItemSuccess
|
||||
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"采购入库单据"}))
|
||||
: R.fail(PromptMsgConstant.Common.M00007, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑入库单据
|
||||
*
|
||||
* @param supplyRequest 供应请求信息
|
||||
* @param supplySaveRequestDto 供应请求信息
|
||||
*/
|
||||
@PutMapping("/edit-supply-request")
|
||||
public void editSupplyRequest(@Validated @RequestBody SupplyRequest supplyRequest) {
|
||||
@PutMapping("/edit-inventory-receipt")
|
||||
public R<?> editSupplyRequest(@Validated @RequestBody SupplySaveRequestDto supplySaveRequestDto) {
|
||||
// 更新supply_request信息
|
||||
SupplyRequest saveRequest = new SupplyRequest();
|
||||
BeanUtils.copyProperties(supplySaveRequestDto, saveRequest);
|
||||
if (!supplyRequestService.updateById(saveRequest)) {
|
||||
return R.fail();
|
||||
}
|
||||
// 更新收费项目charge_item
|
||||
ChargeItem chargeItem = new ChargeItem();
|
||||
BeanUtils.copyProperties(supplySaveRequestDto, chargeItem);
|
||||
chargeItem.setId(supplySaveRequestDto.getChargeItemId());
|
||||
return chargeItemService.updateChargeItem(chargeItem) ? R.ok() : R.fail();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除方法
|
||||
*
|
||||
* @param supplyRequestId 主表id
|
||||
*/
|
||||
@DeleteMapping("/delete-inventory-receipt")
|
||||
public R<?> deleteSupplyRequest(@RequestParam Long supplyRequestId) {
|
||||
// 全都是逻辑删除
|
||||
// 通过id将supply_request表的delFlag更新为1
|
||||
|
||||
|
||||
supplyRequestService.deletebyId(SupplyRequest::getId);
|
||||
boolean deleteSuccess = supplyRequestService.update(new LambdaUpdateWrapper<SupplyRequest>()
|
||||
.eq(SupplyRequest::getId, supplyRequestId).set(SupplyRequest::getDeleteFlag, 1));
|
||||
|
||||
if (!deleteSuccess) {
|
||||
return R.fail();
|
||||
}
|
||||
|
||||
boolean deleteChargeItemSuccess = chargeItemService.update(new LambdaUpdateWrapper<ChargeItem>()
|
||||
.eq(ChargeItem::getServiceId, supplyRequestId).set(ChargeItem::getDeleteFlag, 1));
|
||||
|
||||
return deleteChargeItemSuccess ? R.ok() : R.fail();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -117,7 +168,7 @@ public class PurchaseInventoryController {
|
||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest request) {
|
||||
|
||||
// 数据初始化
|
||||
// 查询条件初始化
|
||||
Medication medication = new Medication();
|
||||
BeanUtils.copyProperties(supplySearchParam, medication);
|
||||
|
||||
@@ -140,9 +191,8 @@ public class PurchaseInventoryController {
|
||||
supplyRequestPage.getRecords().stream().map(SupplyRequest::getPatientId).collect(Collectors.toList()));
|
||||
|
||||
// 装配并返回【入库单据分页列表DTO】分页
|
||||
return R.ok(
|
||||
PurchaseInventoryAssembler.assembleInventoryReceiptDto(supplyRequestPage, medicationList, patientList),
|
||||
"查询成功");
|
||||
return R
|
||||
.ok(PurchaseInventoryAssembler.assembleInventoryReceiptDto(supplyRequestPage, medicationList, patientList));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.inventoryManage.dto;
|
||||
package com.openhis.web.inventorymanage.dto;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
@@ -10,6 +10,7 @@ import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.openhis.administration.domain.Patient;
|
||||
import com.openhis.medication.domain.Medication;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.inventorymanage.dto;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* @author ZhangYC
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class SupplyRequestDto {
|
||||
|
||||
/** 项目 */
|
||||
private String itemTable;
|
||||
|
||||
/** 数量 */
|
||||
private Integer itemQuantity;
|
||||
|
||||
/** 物品编码 */
|
||||
private Long code;
|
||||
|
||||
/** 物品计量单位 */
|
||||
private String unitIdCode;
|
||||
|
||||
/** 物品数量 */
|
||||
private Integer unitQuantity;
|
||||
|
||||
/** 请求细节 */
|
||||
private String detailJson;
|
||||
|
||||
/** 期望时间 */
|
||||
private Date occurrenceTime;
|
||||
|
||||
/** 供应人 */
|
||||
private Long practitionerId;
|
||||
|
||||
/** 供应商 */
|
||||
private Long supplierId;
|
||||
|
||||
/** 单位 */
|
||||
private Long quantityUnit;
|
||||
|
||||
/** 单价 */
|
||||
private BigDecimal unitPrice;
|
||||
|
||||
/** 总价 */
|
||||
private BigDecimal totalPrice;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,193 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.inventorymanage.dto;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 更新dto
|
||||
*
|
||||
* @author zxy
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class SupplySaveRequestDto {
|
||||
/** ID */
|
||||
private Long id;
|
||||
|
||||
/** 类型 */
|
||||
private Integer typeEnum;
|
||||
|
||||
/** 状态 */
|
||||
private Integer statusEnum;
|
||||
|
||||
/** 意图 */
|
||||
private Integer intentEnum;
|
||||
|
||||
/** 分类 */
|
||||
private Integer categoryEnum;
|
||||
|
||||
/** 优先权 */
|
||||
private Integer priorityEnum;
|
||||
|
||||
/** 汇总编号 */
|
||||
private Long summaryId;
|
||||
|
||||
/** 交付 */
|
||||
private Long deliverId;
|
||||
|
||||
/** 患者id */
|
||||
private Long patientId;
|
||||
|
||||
/** 发放实体表名 */
|
||||
private String dispenseTable;
|
||||
|
||||
/** 发放id */
|
||||
private Long dispenseId;
|
||||
|
||||
/** 项目 */
|
||||
private String itemTable;
|
||||
|
||||
/** 数量 */
|
||||
private Integer itemQuantity;
|
||||
|
||||
/** 物品编码 */
|
||||
private Long code;
|
||||
|
||||
/** 物品计量单位 */
|
||||
private String unitIdCode;
|
||||
|
||||
/** 物品数量 */
|
||||
private Integer unitQuantity;
|
||||
|
||||
/** 请求细节 */
|
||||
private String detailJson;
|
||||
|
||||
/** 期望时间 */
|
||||
private Date occurrenceTime;
|
||||
|
||||
/** 供应人 */
|
||||
private Long practitionerId;
|
||||
|
||||
/** 供应商 */
|
||||
private Long supplierId;
|
||||
|
||||
/** 理由 */
|
||||
private String reason;
|
||||
|
||||
/** 源仓库类型 */
|
||||
private Integer sourceType;
|
||||
|
||||
/** 源仓库 */
|
||||
private Long sourceLocationId;
|
||||
|
||||
/** 源仓位 */
|
||||
private Long sourceLocationStoreId;
|
||||
|
||||
/** 目的类型 */
|
||||
private Integer purposeType;
|
||||
|
||||
/** 目的仓库 */
|
||||
private Long purposeLocationId;
|
||||
|
||||
/** 目的仓位 */
|
||||
private Long purposeLocationStoreId;
|
||||
|
||||
/** 审批人 */
|
||||
private Long approverId;
|
||||
|
||||
/** 审批时间 */
|
||||
private Date approvalTime;
|
||||
|
||||
/** 申请人 */
|
||||
private Long applicantId;
|
||||
|
||||
/** 申请时间 */
|
||||
private Date applyTime;
|
||||
|
||||
/** 删除状态 */
|
||||
private Integer deleteFlag;
|
||||
|
||||
// =======chargeItem实体============
|
||||
|
||||
/** ID */
|
||||
private Long chargeItemId;
|
||||
|
||||
/** 类别 */
|
||||
private Integer context;
|
||||
|
||||
/** 就诊ID */
|
||||
private Long encounterId;
|
||||
|
||||
/** 执行人Id */
|
||||
private Long performer;
|
||||
|
||||
/** 执行科室 */
|
||||
private Long performingOrgId;
|
||||
|
||||
/** 开立科室 */
|
||||
private Long requestingOrgId;
|
||||
|
||||
/** 成本科室 */
|
||||
private Long costOrgId;
|
||||
|
||||
/** 数量 */
|
||||
private Long quantityValue;
|
||||
|
||||
/** 单位 */
|
||||
private Long quantityUnit;
|
||||
|
||||
/** 单价 */
|
||||
private BigDecimal unitPrice;
|
||||
|
||||
/** 总价 */
|
||||
private BigDecimal totalPrice;
|
||||
|
||||
/** 费用定价ID */
|
||||
private Long definitionId;
|
||||
|
||||
/** applicability表主键 */
|
||||
private Long applicabilityId;
|
||||
|
||||
/** 原价 */
|
||||
private BigDecimal baseAmount;
|
||||
|
||||
/** 折后价格 */
|
||||
private BigDecimal discountAmount;
|
||||
|
||||
/** 附加价格 */
|
||||
private BigDecimal surchargeAmount;
|
||||
|
||||
/** 改价原因 */
|
||||
private String overrideReasonCode;
|
||||
|
||||
/** 改价原因文本 */
|
||||
private String overrideReasonText;
|
||||
|
||||
/** 开立人ID */
|
||||
private Long entererId;
|
||||
|
||||
/** 开立时间 */
|
||||
private Date enteredDate;
|
||||
|
||||
/** 医疗服务类型 */
|
||||
private String serviceTable;
|
||||
|
||||
/** 医疗服务ID */
|
||||
private Long serviceId;
|
||||
|
||||
/** 索赔结果 */
|
||||
private Integer claimStateEnum;
|
||||
|
||||
/** 关联账户ID */
|
||||
private Long accountId;
|
||||
|
||||
/** 机构 */
|
||||
private String orgCode;
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.inventoryManage.dto;
|
||||
package com.openhis.web.inventorymanage.dto;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
@@ -87,6 +87,10 @@ spring:
|
||||
max-active: 8
|
||||
# #连接池最大阻塞等待时间(使用负值表示没有限制)
|
||||
max-wait: -1ms
|
||||
# 文言
|
||||
messages:
|
||||
basename: i18n/general_message/messages
|
||||
encoding: utf-8
|
||||
|
||||
# token配置
|
||||
token:
|
||||
|
||||
@@ -31,3 +31,7 @@ no.update.permission=您没有修改数据的权限,请联系管理员添加
|
||||
no.delete.permission=您没有删除数据的权限,请联系管理员添加权限 [{0}]
|
||||
no.export.permission=您没有导出数据的权限,请联系管理员添加权限 [{0}]
|
||||
no.view.permission=您没有查看数据的权限,请联系管理员添加权限 [{0}]
|
||||
|
||||
|
||||
|
||||
apl.common.M00002={0}保存成功
|
||||
@@ -1,15 +0,0 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.common.constant;
|
||||
|
||||
/**
|
||||
* 共同文言
|
||||
*
|
||||
* @author zwh
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
public class MessageConstants {
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package com.openhis.common.constant;
|
||||
|
||||
/**
|
||||
* APL消息ID常量类
|
||||
*/
|
||||
public interface PromptMsgConstant {
|
||||
|
||||
/**
|
||||
* 共用
|
||||
*/
|
||||
interface Common {
|
||||
/**
|
||||
* {0}添加成功
|
||||
*/
|
||||
String M00001 = "apl.common.M00001";
|
||||
/**
|
||||
* {0}保存成功
|
||||
*/
|
||||
String M00002 = "apl.common.M00002";
|
||||
/**
|
||||
* {0}已经存在
|
||||
*/
|
||||
String M00003 = "apl.common.M00003";
|
||||
/**
|
||||
* {0}操作成功
|
||||
*/
|
||||
String M00004 = "apl.common.M00004";
|
||||
/**
|
||||
* {0}删除成功
|
||||
*/
|
||||
String M00005 = "apl.common.M00005";
|
||||
/**
|
||||
* 操作失败,该数据已被他人删除,请刷新后重试
|
||||
*/
|
||||
String M00006 = "apl.common.M00006";
|
||||
/**
|
||||
* 操作失败,该数据已被他人更改,请刷新后重试
|
||||
*/
|
||||
String M00007 = "apl.common.M00007";
|
||||
/**
|
||||
* 请勿重复提交
|
||||
*/
|
||||
String M00008 = "apl.common.M00008";
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -11,4 +11,18 @@ import com.openhis.administration.domain.ChargeItem;
|
||||
*/
|
||||
public interface IChargeItemService extends IService<ChargeItem> {
|
||||
|
||||
/**
|
||||
* 保存chargeItem相关信息
|
||||
*
|
||||
* @return 保存结果
|
||||
*/
|
||||
boolean saveChargeItem(ChargeItem chargeItem);
|
||||
|
||||
/**
|
||||
* 更新收费项目
|
||||
*
|
||||
* @param chargeItem 更新内容
|
||||
* @return 更新结果
|
||||
*/
|
||||
boolean updateChargeItem(ChargeItem chargeItem);
|
||||
}
|
||||
@@ -7,6 +7,8 @@ import com.openhis.administration.domain.ChargeItem;
|
||||
import com.openhis.administration.mapper.ChargeItemMapper;
|
||||
import com.openhis.administration.service.IChargeItemService;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
|
||||
/**
|
||||
* 费用项管理Service业务层处理
|
||||
*
|
||||
@@ -14,6 +16,43 @@ import com.openhis.administration.service.IChargeItemService;
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class ChargeItemServiceImpl extends ServiceImpl<ChargeItemMapper, ChargeItem> implements IChargeItemService {
|
||||
|
||||
private final ChargeItemMapper chargeItemMapper;
|
||||
|
||||
/**
|
||||
* 保存chargeItem相关信息
|
||||
*
|
||||
* @return 保存结果
|
||||
*/
|
||||
@Override
|
||||
public boolean saveChargeItem(ChargeItem chargeItem) {
|
||||
// 假设此处有业务相关处理
|
||||
if (chargeItem.getCode() == null) {
|
||||
return false;
|
||||
}
|
||||
return chargeItemMapper.insert(chargeItem) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新收费项目
|
||||
*
|
||||
* @param chargeItem 更新内容
|
||||
* @return 更新结果
|
||||
*/
|
||||
@Override
|
||||
public boolean updateChargeItem(ChargeItem chargeItem) {
|
||||
// 更新样例 一切以实际为主
|
||||
if (chargeItem.getId() != null) {
|
||||
// 获取更新前收费项目,避免更新导致数据库崩溃
|
||||
if (chargeItemMapper.selectById(chargeItem.getId()) == null) {
|
||||
return false;
|
||||
} else {
|
||||
return chargeItemMapper.updateById(chargeItem) > 0;
|
||||
}
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,12 +1,10 @@
|
||||
package com.openhis.medication.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.medication.domain.Medication;
|
||||
import com.openhis.workflow.domain.SupplyRequest;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.openhis.medication.domain.Medication;
|
||||
|
||||
/**
|
||||
* 药品基本信息管理Service接口
|
||||
*
|
||||
|
||||
@@ -19,4 +19,6 @@ public interface ISupplyRequestService extends IService<SupplyRequest> {
|
||||
* @return 供应申请列表
|
||||
*/
|
||||
Page<SupplyRequest> getPage(SupplyRequest supplyRequest, Integer pageNo, Integer pageSize);
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user