更新样例
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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,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> {
|
||||
|
||||
/**
|
||||
* 保存chargeItem相关信息
|
||||
*
|
||||
* @return 保存结果
|
||||
*/
|
||||
boolean saveChargeItem(ChargeItem chargeItem);
|
||||
|
||||
/**
|
||||
* 更新收费项目
|
||||
*
|
||||
* @param chargeItem 更新内容
|
||||
* @return 更新结果
|
||||
*/
|
||||
boolean updateChargeItem(ChargeItem chargeItem);
|
||||
}
|
||||
@@ -36,4 +36,25 @@ public class ChargeItemServiceImpl extends ServiceImpl<ChargeItemMapper, ChargeI
|
||||
}
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user