fix(ui): 修复多个功能模块的验证和数据处理问题
- 在医生工作站退费功能中添加患者选择验证 - 统一药品管理中的仓库类型选择逻辑,移除重复代码 - 修复统计管理页面清空按钮的数据重置问题 - 修正西药管理页面处方打印按钮的功能绑定 - 完善库存报表查询的SQL过滤条件实现 - 更新多个控制器接口参数类型以支持业务流程 - 优化退费列表对话框的数据加载和错误处理
This commit is contained in:
@@ -66,7 +66,10 @@ public class OutpatientRefundController {
|
||||
* @return 患者账单列表
|
||||
*/
|
||||
@GetMapping(value = "/patient-payment")
|
||||
public R<?> getEncounterPatientPayment(@RequestParam Long encounterId) {
|
||||
public R<?> getEncounterPatientPayment(@RequestParam(required = false) Long encounterId) {
|
||||
if (encounterId == null) {
|
||||
return R.fail(null, "请先选择患者后再进行退费操作");
|
||||
}
|
||||
return outpatientRefundAppService.getEncounterPatientPayment(encounterId);
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ package com.openhis.web.inventorymanage.controller;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.web.inventorymanage.appservice.ILossReportFormAppService;
|
||||
import com.openhis.web.inventorymanage.dto.BusNoRequest;
|
||||
import com.openhis.web.inventorymanage.dto.LossReportFormDto;
|
||||
import com.openhis.web.inventorymanage.dto.LossReportSearchParam;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -104,23 +105,23 @@ public class LossReportFormController {
|
||||
/**
|
||||
* 提交审批
|
||||
*
|
||||
* @param busNo 单据号
|
||||
* @param request 单据号请求
|
||||
* @return 操作结果
|
||||
*/
|
||||
@PutMapping("/submit-approval")
|
||||
public R<?> submitApproval(@RequestBody String busNo) {
|
||||
return lossReportFormAppService.submitApproval(busNo);
|
||||
public R<?> submitApproval(@RequestBody BusNoRequest request) {
|
||||
return lossReportFormAppService.submitApproval(request.getBusNo());
|
||||
}
|
||||
|
||||
/**
|
||||
* 撤回审批
|
||||
*
|
||||
* @param busNo 单据号
|
||||
* @param request 单据号请求
|
||||
* @return 操作结果
|
||||
*/
|
||||
@PutMapping("/withdraw-approval")
|
||||
public R<?> withdrawApproval(@RequestBody String busNo) {
|
||||
return lossReportFormAppService.withdrawApproval(busNo);
|
||||
public R<?> withdrawApproval(@RequestBody BusNoRequest request) {
|
||||
return lossReportFormAppService.withdrawApproval(request.getBusNo());
|
||||
}
|
||||
|
||||
// /**
|
||||
|
||||
@@ -5,6 +5,7 @@ package com.openhis.web.inventorymanage.controller;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.web.inventorymanage.appservice.IProductStocktakingAppService;
|
||||
import com.openhis.web.inventorymanage.dto.BusNoRequest;
|
||||
import com.openhis.web.inventorymanage.dto.ProductStocktakingDto;
|
||||
import com.openhis.web.inventorymanage.dto.ProductStocktakingSearchParam;
|
||||
import com.openhis.web.inventorymanage.dto.StocktakingBatchSearchParam;
|
||||
@@ -140,23 +141,23 @@ public class ProductStocktakingController {
|
||||
/**
|
||||
* 提交审批
|
||||
*
|
||||
* @param busNo 单据号
|
||||
* @param request 单据号请求
|
||||
* @return 操作结果
|
||||
*/
|
||||
@PutMapping("/submit-approval")
|
||||
public R<?> submitApproval(@RequestBody String busNo) {
|
||||
return productStocktakingAppService.submitApproval(busNo);
|
||||
public R<?> submitApproval(@RequestBody BusNoRequest request) {
|
||||
return productStocktakingAppService.submitApproval(request.getBusNo());
|
||||
}
|
||||
|
||||
/**
|
||||
* 撤回审批
|
||||
*
|
||||
* @param busNo 单据号
|
||||
* @param request 单据号请求
|
||||
* @return 操作结果
|
||||
*/
|
||||
@PutMapping("/withdraw-approval")
|
||||
public R<?> withdrawApproval(@RequestBody String busNo) {
|
||||
return productStocktakingAppService.withdrawApproval(busNo);
|
||||
public R<?> withdrawApproval(@RequestBody BusNoRequest request) {
|
||||
return productStocktakingAppService.withdrawApproval(request.getBusNo());
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -5,6 +5,7 @@ package com.openhis.web.inventorymanage.controller;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.web.inventorymanage.appservice.IProductTransferAppService;
|
||||
import com.openhis.web.inventorymanage.dto.BusNoRequest;
|
||||
import com.openhis.web.inventorymanage.dto.BatchTransferSearchParam;
|
||||
import com.openhis.web.inventorymanage.dto.ProductTransferDto;
|
||||
import com.openhis.web.inventorymanage.dto.SupplySearchParam;
|
||||
@@ -151,23 +152,23 @@ public class ProductTransferController {
|
||||
/**
|
||||
* 提交审批
|
||||
*
|
||||
* @param busNo 单据号
|
||||
* @param request 单据号请求
|
||||
* @return 操作结果
|
||||
*/
|
||||
@PutMapping("/submit-approval")
|
||||
public R<?> submitApproval(@RequestBody String busNo) {
|
||||
return productTransferAppService.submitApproval(busNo);
|
||||
public R<?> submitApproval(@RequestBody BusNoRequest request) {
|
||||
return productTransferAppService.submitApproval(request.getBusNo());
|
||||
}
|
||||
|
||||
/**
|
||||
* 撤回审批
|
||||
*
|
||||
* @param busNo 单据号
|
||||
* @param request 单据号请求
|
||||
* @return 操作结果
|
||||
*/
|
||||
@PutMapping("/withdraw-approval")
|
||||
public R<?> withdrawApproval(@RequestBody String busNo) {
|
||||
return productTransferAppService.withdrawApproval(busNo);
|
||||
public R<?> withdrawApproval(@RequestBody BusNoRequest request) {
|
||||
return productTransferAppService.withdrawApproval(request.getBusNo());
|
||||
}
|
||||
|
||||
// /**
|
||||
|
||||
@@ -5,6 +5,7 @@ package com.openhis.web.inventorymanage.controller;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.web.inventorymanage.appservice.IPurchaseInventoryAppService;
|
||||
import com.openhis.web.inventorymanage.dto.BusNoRequest;
|
||||
import com.openhis.web.inventorymanage.dto.InventorySearchParam;
|
||||
import com.openhis.web.inventorymanage.dto.PurchaseInventoryDto;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -104,23 +105,23 @@ public class PurchaseInventoryController {
|
||||
/**
|
||||
* 提交审批
|
||||
*
|
||||
* @param busNo 单据号
|
||||
* @param request 单据号请求
|
||||
* @return 操作结果
|
||||
*/
|
||||
@PutMapping("/submit-approval")
|
||||
public R<?> submitApproval(@RequestBody String busNo) {
|
||||
return purchaseInventoryAppService.submitApproval(busNo);
|
||||
public R<?> submitApproval(@RequestBody BusNoRequest request) {
|
||||
return purchaseInventoryAppService.submitApproval(request.getBusNo());
|
||||
}
|
||||
|
||||
/**
|
||||
* 撤回审批
|
||||
*
|
||||
* @param busNo 单据号
|
||||
* @param request 单据号请求
|
||||
* @return 操作结果
|
||||
*/
|
||||
@PutMapping("/withdraw-approval")
|
||||
public R<?> withdrawApproval(@RequestBody String busNo) {
|
||||
return purchaseInventoryAppService.withdrawApproval(busNo);
|
||||
public R<?> withdrawApproval(@RequestBody BusNoRequest request) {
|
||||
return purchaseInventoryAppService.withdrawApproval(request.getBusNo());
|
||||
}
|
||||
// /**
|
||||
// * 采购入库单据详情
|
||||
|
||||
@@ -5,6 +5,7 @@ package com.openhis.web.inventorymanage.controller;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.web.inventorymanage.appservice.IPurchaseReturnAppService;
|
||||
import com.openhis.web.inventorymanage.dto.BusNoRequest;
|
||||
import com.openhis.web.inventorymanage.dto.PurchaseReturnDetailDto;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -96,23 +97,23 @@ public class PurchaseReturnController {
|
||||
/**
|
||||
* 提交审批
|
||||
*
|
||||
* @param busNo 单据号
|
||||
* @param request 单据号请求
|
||||
* @return 操作结果
|
||||
*/
|
||||
@PutMapping("/return-submit-approval")
|
||||
public R<?> submitApproval(@RequestBody String busNo) {
|
||||
return purchaseReturnAppService.submitApproval(busNo);
|
||||
public R<?> submitApproval(@RequestBody BusNoRequest request) {
|
||||
return purchaseReturnAppService.submitApproval(request.getBusNo());
|
||||
}
|
||||
|
||||
/**
|
||||
* 撤回审批
|
||||
*
|
||||
* @param busNo 单据号
|
||||
* @param request 单据号请求
|
||||
* @return 操作结果
|
||||
*/
|
||||
@PutMapping("/return-withdraw-approval")
|
||||
public R<?> withdrawApproval(@RequestBody String busNo) {
|
||||
return purchaseReturnAppService.withdrawApproval(busNo);
|
||||
public R<?> withdrawApproval(@RequestBody BusNoRequest request) {
|
||||
return purchaseReturnAppService.withdrawApproval(request.getBusNo());
|
||||
}
|
||||
|
||||
// /**
|
||||
|
||||
@@ -5,6 +5,7 @@ package com.openhis.web.inventorymanage.controller;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.web.inventorymanage.appservice.IRequisitionIssueAppService;
|
||||
import com.openhis.web.inventorymanage.dto.BusNoRequest;
|
||||
import com.openhis.web.inventorymanage.dto.IssueDto;
|
||||
import com.openhis.web.inventorymanage.dto.IssueSearchParam;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -104,23 +105,23 @@ public class RequisitionIssueController {
|
||||
/**
|
||||
* 提交审批
|
||||
*
|
||||
* @param busNo 单据号
|
||||
* @param request 单据号请求
|
||||
* @return 操作结果
|
||||
*/
|
||||
@PutMapping("/submit-approval")
|
||||
public R<?> submitApproval(@RequestBody String busNo) {
|
||||
return requisitionIssueAppService.submitApproval(busNo);
|
||||
public R<?> submitApproval(@RequestBody BusNoRequest request) {
|
||||
return requisitionIssueAppService.submitApproval(request.getBusNo());
|
||||
}
|
||||
|
||||
/**
|
||||
* 撤回审批
|
||||
*
|
||||
* @param busNo 单据号
|
||||
* @param request 单据号请求
|
||||
* @return 操作结果
|
||||
*/
|
||||
@PutMapping("/withdraw-approval")
|
||||
public R<?> withdrawApproval(@RequestBody String busNo) {
|
||||
return requisitionIssueAppService.withdrawApproval(busNo);
|
||||
public R<?> withdrawApproval(@RequestBody BusNoRequest request) {
|
||||
return requisitionIssueAppService.withdrawApproval(request.getBusNo());
|
||||
}
|
||||
|
||||
// /**
|
||||
|
||||
@@ -5,6 +5,7 @@ package com.openhis.web.inventorymanage.controller;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.web.inventorymanage.appservice.IReturnIssueAppService;
|
||||
import com.openhis.web.inventorymanage.dto.BusNoRequest;
|
||||
import com.openhis.web.inventorymanage.dto.IssueDto;
|
||||
import com.openhis.web.inventorymanage.dto.IssueSearchParam;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -104,23 +105,23 @@ public class ReturnIssueController {
|
||||
/**
|
||||
* 提交审批
|
||||
*
|
||||
* @param busNo 单据号
|
||||
* @param request 单据号请求
|
||||
* @return 操作结果
|
||||
*/
|
||||
@PutMapping("/submit-approval")
|
||||
public R<?> submitApproval(@RequestBody String busNo) {
|
||||
return returnIssueAppService.submitApproval(busNo);
|
||||
public R<?> submitApproval(@RequestBody BusNoRequest request) {
|
||||
return returnIssueAppService.submitApproval(request.getBusNo());
|
||||
}
|
||||
|
||||
/**
|
||||
* 撤回审批
|
||||
*
|
||||
* @param busNo 单据号
|
||||
* @param request 单据号请求
|
||||
* @return 操作结果
|
||||
*/
|
||||
@PutMapping("/withdraw-approval")
|
||||
public R<?> withdrawApproval(@RequestBody String busNo) {
|
||||
return returnIssueAppService.withdrawApproval(busNo);
|
||||
public R<?> withdrawApproval(@RequestBody BusNoRequest request) {
|
||||
return returnIssueAppService.withdrawApproval(request.getBusNo());
|
||||
}
|
||||
|
||||
// /**
|
||||
|
||||
@@ -4,130 +4,152 @@
|
||||
|
||||
<select id="selectProductReportPage"
|
||||
resultType="com.openhis.web.reportmanage.dto.InventoryProductReportPageDto">
|
||||
SELECT T8.id, --ID
|
||||
T8.bus_no, --药品编码
|
||||
T8.name, --药品名称
|
||||
T8.lot_number, --批次号
|
||||
T8.manufacturer_text, --厂家
|
||||
T8.item_table, --药品类型
|
||||
T8.item_quantity, --库存数量
|
||||
T8.unit_code, --计量单位
|
||||
T8.min_package_quantity, --小包装库存数
|
||||
T8.min_package_unit, --小包装单位
|
||||
T8.price, --进价
|
||||
T8.sale_price, --售价
|
||||
T8.price * T8.part_percent AS part_price, --拆零进价
|
||||
T8.sale_price * T8.part_percent AS part_sale_price, --拆零售价
|
||||
T8.price * T8.item_quantity AS total_price, --进价金额(总价)
|
||||
T8.sale_price * T8.item_quantity AS total_sale_price, --售价金额(总价)
|
||||
T8.purpose_type_enum, --仓库类型
|
||||
T8.location_name, --仓库名称
|
||||
T8.location_store_name, --货位名称
|
||||
T8.expiration_date, --有效期
|
||||
T8.yb_no, --医保编码
|
||||
T8.tenant_id -- 租户ID
|
||||
FROM (SELECT T1.id, --ID
|
||||
T2.bus_no, --药品编码
|
||||
T2.name, --药品名称
|
||||
T1.lot_number, --批次号
|
||||
T2.manufacturer_text, --厂家
|
||||
T2.category_code AS item_table, --药品类型
|
||||
T1.quantity AS item_quantity, --库存数量
|
||||
T2.unit_code, --计量单位
|
||||
T1.quantity AS min_package_quantity, --小包装库存数
|
||||
T2.min_unit_code AS min_package_unit, --小包装单位
|
||||
CASE
|
||||
WHEN T4.condition_code = #{lotNumber}
|
||||
AND T4.condition_value = T1.lot_number
|
||||
THEN T4.amount
|
||||
ELSE T3.price END AS sale_price, --售价
|
||||
T2.part_percent, --拆零比
|
||||
T6.form_enum AS purpose_type_enum, --仓库类型
|
||||
T6.name AS location_name, --仓库名称
|
||||
T7.name AS location_store_name, --货位名称
|
||||
T1.expiration_date, --有效期
|
||||
T2.yb_no, --医保编码
|
||||
T1.tenant_id -- 租户ID
|
||||
FROM wor_inventory_item AS T1
|
||||
INNER JOIN med_medication_definition AS T2
|
||||
ON T2.id = T1.item_id
|
||||
AND T2.delete_flag = '0'
|
||||
INNER JOIN adm_charge_item_definition AS T3
|
||||
ON T3.instance_id = T2.id
|
||||
AND T3.delete_flag = '0'
|
||||
LEFT JOIN adm_charge_item_def_detail AS T4
|
||||
ON T4.definition_id = T3.id
|
||||
AND T4.delete_flag = '0'
|
||||
LEFT JOIN adm_location T6
|
||||
ON T1.location_id = T6.id
|
||||
AND T6.delete_flag = '0'
|
||||
LEFT JOIN adm_location T7
|
||||
ON T1.location_store_id = T7.id
|
||||
AND T7.delete_flag = '0'
|
||||
WHERE T1.delete_flag = '0') AS T8
|
||||
UNION
|
||||
SELECT T10.id, --ID
|
||||
T10.bus_no, --器材编码
|
||||
T10.name, --器材名称
|
||||
T10.lot_number, --批次号
|
||||
T10.manufacturer_text, --厂家
|
||||
T10.item_table, --器材类型
|
||||
T10.item_quantity, --库存数量
|
||||
T10.unit_code, --计量单位
|
||||
T10.min_package_quantity, --小包装库存数
|
||||
T10.min_package_unit, --小包装单位
|
||||
T10.price, --进价
|
||||
T10.sale_price, --售价
|
||||
T10.price * T10.part_percent AS part_price, --拆零进价
|
||||
T10.sale_price * T10.part_percent AS part_sale_price, --拆零售价
|
||||
T10.price * T10.item_quantity AS total_price, --进价金额(总价)
|
||||
T10.sale_price * T10.item_quantity AS total_sale_price, --售价金额(总价)
|
||||
T10.purpose_type_enum, --仓库类型
|
||||
T10.location_name, --仓库名称
|
||||
T10.location_store_name, --货位名称
|
||||
T10.expiration_date, --有效期
|
||||
T10.yb_no, --医保编码
|
||||
T10.tenant_id -- 租户ID
|
||||
FROM (SELECT T1.id, --ID
|
||||
T9.bus_no, --药品编码
|
||||
T9.name, --药品名称
|
||||
T1.lot_number, --批次号
|
||||
T9.manufacturer_text, --厂家
|
||||
T9.category_code AS item_table, --药品类型
|
||||
T1.quantity AS item_quantity, --库存数量
|
||||
T9.unit_code, --计量单位
|
||||
T1.quantity AS min_package_quantity, --小包装库存数
|
||||
T9.min_unit_code AS min_package_unit, --小包装单位
|
||||
T1.price, --进价
|
||||
CASE
|
||||
WHEN T4.condition_code = #{lotNumber}
|
||||
AND T4.condition_value = T1.lot_number
|
||||
THEN T4.amount
|
||||
ELSE T3.price END AS sale_price, --售价
|
||||
T9.part_percent, --拆零比
|
||||
T6.form_enum AS purpose_type_enum, --仓库类型
|
||||
T6.name AS location_name, --仓库名称
|
||||
T7.name AS location_store_name, --货位名称
|
||||
T1.expiration_date, --有效期
|
||||
T9.yb_no, --医保编码
|
||||
T1.tenant_id -- 租户ID
|
||||
FROM wor_inventory_item AS T1
|
||||
INNER JOIN adm_device_definition AS T9
|
||||
ON T9.id = T1.item_id
|
||||
AND T9.delete_flag = '0'
|
||||
INNER JOIN adm_charge_item_definition AS T3
|
||||
ON T3.instance_id = T9.id
|
||||
AND T3.delete_flag = '0'
|
||||
LEFT JOIN adm_charge_item_def_detail AS T4
|
||||
ON T4.definition_id = T3.id
|
||||
AND T4.delete_flag = '0'
|
||||
LEFT JOIN adm_location T6
|
||||
ON T1.location_id = T6.id
|
||||
AND T6.delete_flag = '0'
|
||||
LEFT JOIN adm_location T7
|
||||
ON T1.location_store_id = T7.id
|
||||
AND T7.delete_flag = '0'
|
||||
WHERE T1.delete_flag = '0') AS T10
|
||||
${ew.customSqlSegment}
|
||||
SELECT * FROM (
|
||||
SELECT T8.id, --ID
|
||||
T8.bus_no, --药品编码
|
||||
T8.name, --药品名称
|
||||
T8.lot_number, --批次号
|
||||
T8.manufacturer_text, --厂家
|
||||
T8.item_table, --药品类型
|
||||
T8.item_quantity, --库存数量
|
||||
T8.unit_code, --计量单位
|
||||
T8.min_package_quantity, --小包装库存数
|
||||
T8.min_package_unit, --小包装单位
|
||||
T8.price, --进价
|
||||
T8.sale_price, --售价
|
||||
T8.price * T8.part_percent AS part_price, --拆零进价
|
||||
T8.sale_price * T8.part_percent AS part_sale_price, --拆零售价
|
||||
T8.price * T8.item_quantity AS total_price, --进价金额(总价)
|
||||
T8.sale_price * T8.item_quantity AS total_sale_price, --售价金额(总价)
|
||||
T8.purpose_type_enum, --仓库类型
|
||||
T8.location_name, --仓库名称
|
||||
T8.location_store_name, --货位名称
|
||||
T8.expiration_date, --有效期
|
||||
T8.yb_no, --医保编码
|
||||
T8.tenant_id -- 租户ID
|
||||
FROM (SELECT T1.id, --ID
|
||||
T2.bus_no, --药品编码
|
||||
T2.name, --药品名称
|
||||
T1.lot_number, --批次号
|
||||
T2.manufacturer_text, --厂家
|
||||
T2.category_code AS item_table, --药品类型
|
||||
T1.quantity AS item_quantity, --库存数量
|
||||
T2.unit_code, --计量单位
|
||||
T1.quantity AS min_package_quantity, --小包装库存数
|
||||
T2.min_unit_code AS min_package_unit, --小包装单位
|
||||
CASE
|
||||
WHEN T4.condition_code = #{lotNumber}
|
||||
AND T4.condition_value = T1.lot_number
|
||||
THEN T4.amount
|
||||
ELSE T3.price END AS sale_price, --售价
|
||||
T2.part_percent, --拆零比
|
||||
T6.form_enum AS purpose_type_enum, --仓库类型
|
||||
T6.name AS location_name, --仓库名称
|
||||
T7.name AS location_store_name, --货位名称
|
||||
T1.expiration_date, --有效期
|
||||
T2.yb_no, --医保编码
|
||||
T1.tenant_id -- 租户ID
|
||||
FROM wor_inventory_item AS T1
|
||||
INNER JOIN med_medication_definition AS T2
|
||||
ON T2.id = T1.item_id
|
||||
AND T2.delete_flag = '0'
|
||||
INNER JOIN adm_charge_item_definition AS T3
|
||||
ON T3.instance_id = T2.id
|
||||
AND T3.delete_flag = '0'
|
||||
LEFT JOIN adm_charge_item_def_detail AS T4
|
||||
ON T4.definition_id = T3.id
|
||||
AND T4.delete_flag = '0'
|
||||
LEFT JOIN adm_location T6
|
||||
ON T1.location_id = T6.id
|
||||
AND T6.delete_flag = '0'
|
||||
LEFT JOIN adm_location T7
|
||||
ON T1.location_store_id = T7.id
|
||||
AND T7.delete_flag = '0'
|
||||
WHERE T1.delete_flag = '0') AS T8
|
||||
UNION
|
||||
SELECT T10.id, --ID
|
||||
T10.bus_no, --器材编码
|
||||
T10.name, --器材名称
|
||||
T10.lot_number, --批次号
|
||||
T10.manufacturer_text, --厂家
|
||||
T10.item_table, --器材类型
|
||||
T10.item_quantity, --库存数量
|
||||
T10.unit_code, --计量单位
|
||||
T10.min_package_quantity, --小包装库存数
|
||||
T10.min_package_unit, --小包装单位
|
||||
T10.price, --进价
|
||||
T10.sale_price, --售价
|
||||
T10.price * T10.part_percent AS part_price, --拆零进价
|
||||
T10.sale_price * T10.part_percent AS part_sale_price, --拆零售价
|
||||
T10.price * T10.item_quantity AS total_price, --进价金额(总价)
|
||||
T10.sale_price * T10.item_quantity AS total_sale_price, --售价金额(总价)
|
||||
T10.purpose_type_enum, --仓库类型
|
||||
T10.location_name, --仓库名称
|
||||
T10.location_store_name, --货位名称
|
||||
T10.expiration_date, --有效期
|
||||
T10.yb_no, --医保编码
|
||||
T10.tenant_id -- 租户ID
|
||||
FROM (SELECT T1.id, --ID
|
||||
T9.bus_no, --药品编码
|
||||
T9.name, --药品名称
|
||||
T1.lot_number, --批次号
|
||||
T9.manufacturer_text, --厂家
|
||||
T9.category_code AS item_table, --药品类型
|
||||
T1.quantity AS item_quantity, --库存数量
|
||||
T9.unit_code, --计量单位
|
||||
T1.quantity AS min_package_quantity, --小包装库存数
|
||||
T9.min_unit_code AS min_package_unit, --小包装单位
|
||||
T1.price, --进价
|
||||
CASE
|
||||
WHEN T4.condition_code = #{lotNumber}
|
||||
AND T4.condition_value = T1.lot_number
|
||||
THEN T4.amount
|
||||
ELSE T3.price END AS sale_price, --售价
|
||||
T9.part_percent, --拆零比
|
||||
T6.form_enum AS purpose_type_enum, --仓库类型
|
||||
T6.name AS location_name, --仓库名称
|
||||
T7.name AS location_store_name, --货位名称
|
||||
T1.expiration_date, --有效期
|
||||
T9.yb_no, --医保编码
|
||||
T1.tenant_id -- 租户ID
|
||||
FROM wor_inventory_item AS T1
|
||||
INNER JOIN adm_device_definition AS T9
|
||||
ON T9.id = T1.item_id
|
||||
AND T9.delete_flag = '0'
|
||||
INNER JOIN adm_charge_item_definition AS T3
|
||||
ON T3.instance_id = T9.id
|
||||
AND T3.delete_flag = '0'
|
||||
LEFT JOIN adm_charge_item_def_detail AS T4
|
||||
ON T4.definition_id = T3.id
|
||||
AND T4.delete_flag = '0'
|
||||
LEFT JOIN adm_location T6
|
||||
ON T1.location_id = T6.id
|
||||
AND T6.delete_flag = '0'
|
||||
LEFT JOIN adm_location T7
|
||||
ON T1.location_store_id = T7.id
|
||||
AND T7.delete_flag = '0'
|
||||
WHERE T1.delete_flag = '0') AS T10
|
||||
) AS combined_result
|
||||
<where>
|
||||
<if test="inventoryScope != null">
|
||||
<choose>
|
||||
<when test="inventoryScope == 2">
|
||||
item_quantity = 0
|
||||
</when>
|
||||
<when test="inventoryScope == 3">
|
||||
item_quantity > 0
|
||||
</when>
|
||||
<when test="inventoryScope == 4">
|
||||
item_quantity <= 20
|
||||
</when>
|
||||
<when test="inventoryScope == 5">
|
||||
item_quantity <= 50
|
||||
</when>
|
||||
</choose>
|
||||
</if>
|
||||
<if test="ew != null and ew.sqlSegment != null and ew.sqlSegment != ''">
|
||||
AND ${ew.sqlSegment}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user