From e42aff436a134c38ddacd4d8bee1154c78f23dc2 Mon Sep 17 00:00:00 2001 From: Zhuangxingyu Date: Thu, 20 Feb 2025 17:57:52 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=A0=B7=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PurchaseInventoryController.java | 14 +- .../dto/SupplySaveRequestDto.java | 193 ++++++++++++++++++ .../service/IChargeItemService.java | 9 +- .../service/impl/ChargeItemServiceImpl.java | 21 ++ 4 files changed, 234 insertions(+), 3 deletions(-) create mode 100644 openhis-server/openhis-application/src/main/java/com/openhis/web/InventoryManage/dto/SupplySaveRequestDto.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/InventoryManage/controller/PurchaseInventoryController.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/InventoryManage/controller/PurchaseInventoryController.java index f871bb9e..ac99d23e 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/InventoryManage/controller/PurchaseInventoryController.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/InventoryManage/controller/PurchaseInventoryController.java @@ -5,6 +5,7 @@ package com.openhis.web.InventoryManage.controller; import javax.servlet.http.HttpServletRequest; +import com.openhis.web.InventoryManage.dto.SupplySaveRequestDto; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -95,12 +96,21 @@ public class PurchaseInventoryController { /** * 编辑入库单据 * - * @param supplyRequest 供应请求信息 + * @param supplySaveRequestDto 供应请求信息 */ @PutMapping("/edit-supply-request") - public void editSupplyRequest(@Validated @RequestBody SupplyRequest supplyRequest) { + 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(); } /** diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/InventoryManage/dto/SupplySaveRequestDto.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/InventoryManage/dto/SupplySaveRequestDto.java new file mode 100644 index 00000000..dc606fac --- /dev/null +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/InventoryManage/dto/SupplySaveRequestDto.java @@ -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; +} diff --git a/openhis-server/openhis-domain/src/main/java/com/openhis/administration/service/IChargeItemService.java b/openhis-server/openhis-domain/src/main/java/com/openhis/administration/service/IChargeItemService.java index da035ff1..0625b832 100644 --- a/openhis-server/openhis-domain/src/main/java/com/openhis/administration/service/IChargeItemService.java +++ b/openhis-server/openhis-domain/src/main/java/com/openhis/administration/service/IChargeItemService.java @@ -1,7 +1,6 @@ package com.openhis.administration.service; import com.baomidou.mybatisplus.extension.service.IService; -import com.core.common.core.domain.R; import com.openhis.administration.domain.ChargeItem; /** @@ -14,8 +13,16 @@ public interface IChargeItemService extends IService { /** * 保存chargeItem相关信息 + * * @return 保存结果 */ boolean saveChargeItem(ChargeItem chargeItem); + /** + * 更新收费项目 + * + * @param chargeItem 更新内容 + * @return 更新结果 + */ + boolean updateChargeItem(ChargeItem chargeItem); } \ No newline at end of file diff --git a/openhis-server/openhis-domain/src/main/java/com/openhis/administration/service/impl/ChargeItemServiceImpl.java b/openhis-server/openhis-domain/src/main/java/com/openhis/administration/service/impl/ChargeItemServiceImpl.java index e8b5dbe3..79518c8c 100644 --- a/openhis-server/openhis-domain/src/main/java/com/openhis/administration/service/impl/ChargeItemServiceImpl.java +++ b/openhis-server/openhis-domain/src/main/java/com/openhis/administration/service/impl/ChargeItemServiceImpl.java @@ -36,4 +36,25 @@ public class ChargeItemServiceImpl extends ServiceImpl 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; + } + } } \ No newline at end of file