采购入库
This commit is contained in:
@@ -0,0 +1,55 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.inventorymanage.appservice;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.administration.domain.ChargeItemDefApp;
|
||||
import com.openhis.web.inventorymanage.dto.ItemChargeDetailDto;
|
||||
import com.openhis.web.inventorymanage.dto.SupplyItemDetailDto;
|
||||
import com.openhis.workflow.domain.SupplyRequest;
|
||||
|
||||
/**
|
||||
* 采购入库 service
|
||||
*
|
||||
* @author zwh
|
||||
* @date 2025-03-05
|
||||
*/
|
||||
public interface IInventoryManageService {
|
||||
|
||||
/**
|
||||
* 校验单据是否正确
|
||||
*
|
||||
* @param supplyRequest 单据信息
|
||||
* @return 校验结果
|
||||
*/
|
||||
R<?> verifyInventoryReceipt(SupplyRequest supplyRequest);
|
||||
|
||||
/**
|
||||
* 根据单据号获取供应单据及供应项相关详细信息
|
||||
*
|
||||
* @param busNo 单据号
|
||||
* @param itemTable 供应项所在表名
|
||||
* @return 供应单据及供应项相关详细信息
|
||||
*/
|
||||
List<SupplyItemDetailDto> getSupplyItemDetail(String busNo, String itemTable);
|
||||
|
||||
/**
|
||||
* 获取物品的价格信息
|
||||
*
|
||||
* @param itemIdList 物品id
|
||||
* @return 价格信息
|
||||
*/
|
||||
List<ItemChargeDetailDto> getItemChargeDetail(List<Long> itemIdList);
|
||||
|
||||
/**
|
||||
* 入库项价格验证
|
||||
*
|
||||
* @param agreedList 供应单据
|
||||
* @param chargeDetailList 项目价格
|
||||
* @return 价格定义子表数据
|
||||
*/
|
||||
List<ChargeItemDefApp> verifyItemCharge(List<SupplyRequest> agreedList, List<ItemChargeDetailDto> chargeDetailList);
|
||||
}
|
||||
@@ -0,0 +1,151 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.inventorymanage.appservice.impl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.administration.domain.ChargeItemDefApp;
|
||||
import com.openhis.common.constant.CommonConstants;
|
||||
import com.openhis.common.enums.EventStatus;
|
||||
import com.openhis.web.inventorymanage.appservice.IInventoryManageService;
|
||||
import com.openhis.web.inventorymanage.dto.ItemChargeDetailDto;
|
||||
import com.openhis.web.inventorymanage.dto.SupplyItemDetailDto;
|
||||
import com.openhis.web.inventorymanage.mapper.InventoryManageMapper;
|
||||
import com.openhis.workflow.domain.SupplyRequest;
|
||||
|
||||
/**
|
||||
* 采购入库 impl
|
||||
*
|
||||
* @author zwh
|
||||
* @date 2025-03-05
|
||||
*/
|
||||
@Service
|
||||
public class InventoryManageServiceImpl implements IInventoryManageService {
|
||||
|
||||
@Autowired
|
||||
private InventoryManageMapper inventoryManageMapper;
|
||||
|
||||
/**
|
||||
* 校验单据是否正确
|
||||
*
|
||||
* @param supplyRequest 单据信息
|
||||
* @return 校验结果
|
||||
*/
|
||||
@Override
|
||||
public R<?> verifyInventoryReceipt(SupplyRequest supplyRequest) {
|
||||
|
||||
// // 判断同一物品的批次号是否重复
|
||||
// boolean result = supplyRequestMapper
|
||||
// .exists(new LambdaQueryWrapper<SupplyRequest>().eq(SupplyRequest::getItemId, supplyRequest.getItemId())
|
||||
// .eq(SupplyRequest::getLotNumber, supplyRequest.getLotNumber())
|
||||
// .ne(supplyRequest.getId() != null, SupplyRequest::getId, supplyRequest.getId()));
|
||||
// if (result) {
|
||||
// return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00003, new Object[] {"批次号"}));
|
||||
// }
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据单据号获取供应单据及供应项相关详细信息
|
||||
*
|
||||
* @param busNo 单据号
|
||||
* @param itemTable 供应项所在表名
|
||||
* @return 供应单据及供应项相关详细信息
|
||||
*/
|
||||
@Override
|
||||
public List<SupplyItemDetailDto> getSupplyItemDetail(String busNo, String itemTable) {
|
||||
|
||||
List<SupplyItemDetailDto> supplyItemDetailList;
|
||||
// 判断供应项是药品还是耗材
|
||||
if (CommonConstants.TableName.MED_MEDICATION_DEFINITION.equals(itemTable)) {
|
||||
supplyItemDetailList = inventoryManageMapper.selectSupplyMedDetail(busNo, EventStatus.COMPLETED.getValue());
|
||||
} else if (CommonConstants.TableName.ADM_DEVICE.equals(itemTable)) {
|
||||
supplyItemDetailList = inventoryManageMapper.selectSupplyDevDetail(busNo, EventStatus.COMPLETED.getValue());
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
return supplyItemDetailList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取物品的价格信息
|
||||
*
|
||||
* @param itemIdList 物品id
|
||||
* @return 价格信息
|
||||
*/
|
||||
@Override
|
||||
public List<ItemChargeDetailDto> getItemChargeDetail(List<Long> itemIdList) {
|
||||
// todo:未来会移到charge相关的service中
|
||||
if (!itemIdList.isEmpty()) {
|
||||
return inventoryManageMapper.selectChargeDetail(itemIdList);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 入库项价格验证
|
||||
*
|
||||
* @param agreedList 供应单据
|
||||
* @param chargeDetailList 项目价格
|
||||
* @return 价格定义子表数据
|
||||
*/
|
||||
@Override
|
||||
public List<ChargeItemDefApp> verifyItemCharge(List<SupplyRequest> agreedList,
|
||||
List<ItemChargeDetailDto> chargeDetailList) {
|
||||
|
||||
// todo:价格换算的事情后续补上
|
||||
List<ChargeItemDefApp> resultList = new ArrayList<>();
|
||||
// 创建以项目id为key的map用于匹配对应的供应项目
|
||||
Map<Long, ItemChargeDetailDto> chargeDetailMap =
|
||||
chargeDetailList.stream().collect(Collectors.toMap(ItemChargeDetailDto::getInstanceId, dto -> dto));
|
||||
|
||||
for (SupplyRequest supplyRequest : agreedList) {
|
||||
Long itemId = supplyRequest.getItemId();
|
||||
ItemChargeDetailDto chargeDetail = chargeDetailMap.get(itemId);
|
||||
|
||||
if (chargeDetail == null) {
|
||||
// 未找到匹配的价格项则跳过
|
||||
continue;
|
||||
}
|
||||
// 比较批号是否一致
|
||||
if (!chargeDetail.getConditionLotnumber().equals(supplyRequest.getLotNumber())) {
|
||||
// todo:此时之加入了一条单位价格,需不需要进行大单位小单位的换算,增加两条价格
|
||||
resultList.add(this.addChargeItemDefApp(supplyRequest, chargeDetail));
|
||||
} else {
|
||||
// 检查单位是否匹配
|
||||
if (chargeDetail.getConditionUnitCode().equals(supplyRequest.getUnitCode())) {
|
||||
// 比较价格是否一致
|
||||
if (chargeDetail.getUnitPrice().compareTo(supplyRequest.getPrice()) != 0) {
|
||||
// todo:此时需不需要增加两条价格,进行单位换算
|
||||
resultList.add(this.addChargeItemDefApp(supplyRequest, chargeDetail));
|
||||
}
|
||||
} else {
|
||||
// todo:如果以上换算加入了两条则不存在这种情况,否则需要添加一条批次号相同,单位不同的两条记录(理论上不存在)
|
||||
}
|
||||
}
|
||||
}
|
||||
return resultList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加项目定价子表信息
|
||||
*
|
||||
* @param supplyRequest 供应申请单
|
||||
* @param itemChargeDetail 项目价格信息
|
||||
* @return 项目定价子表
|
||||
*/
|
||||
private ChargeItemDefApp addChargeItemDefApp(SupplyRequest supplyRequest, ItemChargeDetailDto itemChargeDetail) {
|
||||
ChargeItemDefApp app = new ChargeItemDefApp();
|
||||
app.setAmount(supplyRequest.getPrice()).setConditionLotnumber(supplyRequest.getLotNumber())
|
||||
.setDefinitionId(itemChargeDetail.getDefinitionId()).setConditionUnitCode(supplyRequest.getUnitCode());
|
||||
return app;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.inventorymanage.assembler;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
|
||||
import com.openhis.administration.domain.ChargeItem;
|
||||
import com.openhis.web.inventorymanage.dto.SupplyItemDetailDto;
|
||||
import com.openhis.workflow.domain.InventoryItem;
|
||||
|
||||
/**
|
||||
* 入库管理dto转换器
|
||||
*
|
||||
* @author zwh
|
||||
* @date 2025-03-05
|
||||
*/
|
||||
public class InventoryManageAssembler {
|
||||
|
||||
/**
|
||||
* 将供应项目的详细信息装配为库存项目和采购账单
|
||||
*
|
||||
* @param supplyItemDetailList 供应项目的详细信息
|
||||
* @param now 当前时间
|
||||
* @return 库存项目和采购账单
|
||||
*/
|
||||
public static Pair<List<ChargeItem>, List<InventoryItem>>
|
||||
assembleChargeAndInventory(List<SupplyItemDetailDto> supplyItemDetailList, Date now) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -1,54 +0,0 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.inventorymanage.assembler;
|
||||
|
||||
/**
|
||||
* 采购入库相关dto转换器
|
||||
*
|
||||
* @author zwh
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
public class PurchaseInventoryAssembler {
|
||||
|
||||
/**
|
||||
* 装配【入库单据分页列表DTO】分页
|
||||
*
|
||||
* @param supplyRequestPage 【供应申请管理Entity实体】分页
|
||||
* @param medicationList 【药品基本信息管理Entity实体】列表
|
||||
* @param patientList【患者管理Entity实体】列表
|
||||
* @return 【入库单据分页列表DTO】分页
|
||||
*/
|
||||
// public static Page<InventoryReceiptDto> assembleInventoryReceiptDto(Page<SupplyRequest> supplyRequestPage,
|
||||
// List<Medication> medicationList, List<Patient> patientList) {
|
||||
//
|
||||
// // 将查询到的【药品基本信息管理】列表,作成以ID为Key的Map
|
||||
// Map<Long, Medication> medicationMap =
|
||||
// medicationList.stream().collect(Collectors.toMap(Medication::getId, Function.identity()));
|
||||
//
|
||||
// // 将查询到的【患者管理】列表,作成以ID为Key的Map
|
||||
// Map<Long, Patient> patientMap =
|
||||
// patientList.stream().collect(Collectors.toMap(Patient::getId, Function.identity()));
|
||||
//
|
||||
// // 定义【入库单据分页列表DTO】的分页,传入【页码】、【行数】、及上面分页的【总数】
|
||||
// Page<InventoryReceiptDto> returnPage =
|
||||
// new Page<>(supplyRequestPage.getCurrent(), supplyRequestPage.getSize(), supplyRequestPage.getTotal());
|
||||
//
|
||||
// // 将【供应申请管理】的分页转化为返回【入库单据分页列表DTO】的分页
|
||||
// returnPage.setRecords(supplyRequestPage.getRecords().stream().map(entity -> {
|
||||
// // 定义【入库单据分页列表DTO】
|
||||
// InventoryReceiptDto dto = new InventoryReceiptDto();
|
||||
// // 从主表COPY需要的字段
|
||||
// dto.setId(entity.getId());
|
||||
// dto.setCategoryEnum(1);
|
||||
// // 从【药品基本信息管理】Map取值,设置【药品基本信息管理】返回实体
|
||||
// dto.setMedication(medicationMap.getOrDefault(entity.getDispenseId(), null));
|
||||
// // 从【患者管理】Map取值,设置【患者管理】返回实体
|
||||
// dto.setPatient(patientMap.getOrDefault(entity.getPatientId(), null));
|
||||
// return dto;
|
||||
// }).collect(Collectors.toList()));
|
||||
//
|
||||
// // 返回【入库单据分页列表DTO】分页
|
||||
// return returnPage;
|
||||
// }
|
||||
}
|
||||
@@ -3,9 +3,7 @@
|
||||
*/
|
||||
package com.openhis.web.inventorymanage.controller;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
@@ -13,25 +11,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.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
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.DateUtils;
|
||||
import com.core.common.utils.MessageUtils;
|
||||
import com.core.common.utils.bean.BeanUtils;
|
||||
import com.openhis.administration.domain.ChargeItem;
|
||||
import com.openhis.administration.domain.Location;
|
||||
import com.openhis.administration.service.IChargeItemService;
|
||||
import com.openhis.administration.service.ILocationService;
|
||||
import com.openhis.administration.service.IPatientService;
|
||||
import com.openhis.administration.service.ISupplierService;
|
||||
import com.openhis.common.constant.CommonConstants;
|
||||
import com.openhis.common.constant.PromptMsgConstant;
|
||||
import com.openhis.common.enums.SupplyCategory;
|
||||
import com.openhis.common.enums.SupplyType;
|
||||
import com.openhis.common.utils.HisPageUtils;
|
||||
import com.openhis.common.utils.HisQueryUtils;
|
||||
import com.openhis.medication.service.IMedicationService;
|
||||
import com.openhis.web.inventorymanage.dto.*;
|
||||
import com.openhis.web.inventorymanage.appservice.IInventoryManageService;
|
||||
import com.openhis.web.inventorymanage.dto.InventoryReceiptDto;
|
||||
import com.openhis.web.inventorymanage.dto.InventoryReceiptPageDto;
|
||||
import com.openhis.web.inventorymanage.dto.InventorySearchParam;
|
||||
import com.openhis.workflow.domain.SupplyRequest;
|
||||
import com.openhis.workflow.mapper.SupplyRequestMapper;
|
||||
import com.openhis.workflow.service.ISupplyRequestService;
|
||||
@@ -45,37 +40,30 @@ import lombok.extern.slf4j.Slf4j;
|
||||
* @date 2025-02-18
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/inventory-manage-purchase")
|
||||
@RequestMapping("/inventory-manage/purchase")
|
||||
@Slf4j
|
||||
public class PurchaseInventoryController {
|
||||
|
||||
@Autowired
|
||||
private ISupplyRequestService supplyRequestService;
|
||||
@Autowired
|
||||
private IMedicationService medicationService;
|
||||
@Autowired
|
||||
private IPatientService patientService;
|
||||
@Autowired
|
||||
private IChargeItemService chargeItemService;
|
||||
@Autowired
|
||||
private ISupplierService supplierService;
|
||||
@Autowired
|
||||
private ILocationService locationService;
|
||||
private IInventoryManageService inventoryManageService;
|
||||
@Autowired
|
||||
private SupplyRequestMapper supplyRequestMapper;
|
||||
|
||||
@GetMapping(value = "/init")
|
||||
public R<?> init() {
|
||||
|
||||
InventoryReceiptInitDto initDto = new InventoryReceiptInitDto();
|
||||
// 设置供应商列表
|
||||
initDto.setSupplier(supplierService.list())
|
||||
// 设置药房列表
|
||||
.setLocation(locationService.list(new LambdaQueryWrapper<Location>().in(Location::getFormEnum, 1)))
|
||||
// 药品详细
|
||||
.setMedicationDetail(medicationService.getDetailList());
|
||||
return R.ok(initDto);
|
||||
}
|
||||
// @GetMapping(value = "/init")
|
||||
// public R<?> init() {
|
||||
// // 采番
|
||||
//
|
||||
// InventoryReceiptInitDto initDto = new InventoryReceiptInitDto();
|
||||
// // 设置供应商列表
|
||||
// initDto.setSupplier(supplierService.list())
|
||||
// // 设置药房列表
|
||||
// .setLocation(locationService.list(new LambdaQueryWrapper<Location>().in(Location::getFormEnum, 1)))
|
||||
// // 药品详细
|
||||
// .setMedicationDetail(medicationService.getDetailList());
|
||||
// return R.ok(initDto);
|
||||
// }
|
||||
|
||||
// 添加入库单据之前需要
|
||||
// 1.supplier供应商信息列表
|
||||
@@ -99,6 +87,7 @@ public class PurchaseInventoryController {
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
@RequestParam(name = "searchKey", required = false) String searchKey, HttpServletRequest request) {
|
||||
|
||||
// 按照单据号groupBy
|
||||
// 设置模糊查询的字段名
|
||||
HashSet<String> searchFields = new HashSet<>();
|
||||
searchFields.add(CommonConstants.FieldName.BusNo);
|
||||
@@ -107,95 +96,99 @@ public class PurchaseInventoryController {
|
||||
QueryWrapper<SupplyRequest> queryWrapper =
|
||||
HisQueryUtils.buildQueryWrapper(inventorySearchParam, searchKey, searchFields, request);
|
||||
// 查询入库单据分页列表
|
||||
Page<InventoryReceiptDto> inventoryReceiptPage =
|
||||
HisPageUtils.selectPage(supplyRequestMapper, queryWrapper, pageNo, pageSize, InventoryReceiptDto.class);
|
||||
Page<InventoryReceiptPageDto> inventoryReceiptPage =
|
||||
HisPageUtils.selectPage(supplyRequestMapper, queryWrapper, pageNo, pageSize, InventoryReceiptPageDto.class);
|
||||
|
||||
return R.ok(inventoryReceiptPage);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加入库单据(生成供应请求)
|
||||
* 入库单据详情
|
||||
*
|
||||
* @param inventoryDto 入库单据
|
||||
* @param busNo 单据号
|
||||
* @return 入库单据详情
|
||||
*/
|
||||
@PostMapping("/inventory-receipt")
|
||||
public R<?> addInventoryReceipt(@Validated @RequestBody InventoryDto inventoryDto) {
|
||||
// 生成待发送的入库单据
|
||||
SupplyRequest supplyRequest = new SupplyRequest();
|
||||
BeanUtils.copyProperties(inventoryDto, supplyRequest);
|
||||
// 如果业务上不需要其它处理 直接调用service的保存方法
|
||||
boolean saveSupplyRequestSuccess = supplyRequestService.save(supplyRequest);
|
||||
public R<?> getDetail(@RequestParam String busNo) {
|
||||
|
||||
if (!saveSupplyRequestSuccess) {
|
||||
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00006, null));
|
||||
}
|
||||
// 生成收费项目charge_item
|
||||
ChargeItem chargeItem = new ChargeItem();
|
||||
// 如果字段很少建议手动set赋值
|
||||
chargeItem.setUnitPrice(inventoryDto.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);
|
||||
//
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑入库单据
|
||||
* 添加/编辑入库单据
|
||||
*
|
||||
* @param saveInventoryReceiptDto 供应请求信息
|
||||
* @param inventoryReceiptDto 入库单据
|
||||
* @return 操作结果
|
||||
*/
|
||||
@PutMapping("/inventory-receipt")
|
||||
public R<?> editInventoryReceipt(@Validated @RequestBody SaveInventoryReceiptDto saveInventoryReceiptDto) {
|
||||
// 更新supply_request信息
|
||||
SupplyRequest saveRequest = new SupplyRequest();
|
||||
BeanUtils.copyProperties(saveInventoryReceiptDto, saveRequest);
|
||||
if (!supplyRequestService.updateById(saveRequest)) {
|
||||
return R.fail();
|
||||
@PostMapping("/inventory-receipt")
|
||||
public R<?> addOrEditInventoryReceipt(@Validated @RequestBody InventoryReceiptDto inventoryReceiptDto) {
|
||||
|
||||
// 初始化单据信息
|
||||
SupplyRequest supplyRequest = new SupplyRequest();
|
||||
BeanUtils.copyProperties(inventoryReceiptDto, supplyRequest);
|
||||
|
||||
// // 业务校验
|
||||
// R<?> result = purchaseInventoryService.verifyInventoryReceipt(supplyRequest);
|
||||
// // 校验失败返回提示信息
|
||||
// if (result.getCode() == HttpStatus.ERROR) {
|
||||
// return result;
|
||||
// }
|
||||
|
||||
if (inventoryReceiptDto.getId() != null) {
|
||||
// 更新单据信息
|
||||
supplyRequestService.updateById(supplyRequest);
|
||||
} else {
|
||||
// 生成待发送的入库单据
|
||||
supplyRequest
|
||||
// 单据分类:非库存供应
|
||||
.setCategoryEnum(SupplyCategory.NON_STOCK.getValue())
|
||||
// 单据类型:采购入库
|
||||
.setTypeEnum(SupplyType.PURCHASE_INVENTORY.getValue())
|
||||
// 申请时间
|
||||
.setApplyTime(DateUtils.getNowDate());
|
||||
supplyRequestService.save(supplyRequest);
|
||||
}
|
||||
// 更新收费项目charge_item
|
||||
ChargeItem chargeItem = new ChargeItem();
|
||||
BeanUtils.copyProperties(saveInventoryReceiptDto, chargeItem);
|
||||
chargeItem.setId(saveInventoryReceiptDto.getChargeItemId());
|
||||
return chargeItemService.updateChargeItem(chargeItem) ? R.ok() : R.fail();
|
||||
// 返回单据id
|
||||
return R.ok(supplyRequest.getId(), null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除方法
|
||||
*
|
||||
* @param supplyRequestId 主表id
|
||||
* @return 操作结果
|
||||
*/
|
||||
@DeleteMapping("/inventory-receipt")
|
||||
public R<?> deleteInventoryReceipt(@RequestParam Long supplyRequestId) {
|
||||
// 全都是逻辑删除
|
||||
|
||||
boolean deleteSuccess = supplyRequestService.removeById(supplyRequestId);
|
||||
|
||||
if (!deleteSuccess) {
|
||||
return R.fail();
|
||||
}
|
||||
|
||||
boolean deleteChargeItemSuccess = chargeItemService
|
||||
.remove(new LambdaUpdateWrapper<ChargeItem>().eq(ChargeItem::getServiceId, supplyRequestId));
|
||||
|
||||
return deleteChargeItemSuccess ? R.ok() : R.fail();
|
||||
// 删除单据
|
||||
boolean result = supplyRequestService.removeById(supplyRequestId);
|
||||
return result ? R.ok() : R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||
}
|
||||
|
||||
/**
|
||||
* 单据提交申请
|
||||
* 提交审批
|
||||
*
|
||||
* @param supplyRequest 供应请求信息
|
||||
* @param busNo 单据号
|
||||
*/
|
||||
@PutMapping("/submit-examine")
|
||||
public void submitExamine(SupplyRequest supplyRequest) {
|
||||
@PutMapping("/submit-approval")
|
||||
public R<?> submitApproval(@RequestParam String busNo) {
|
||||
// 单据提交审核
|
||||
boolean result = supplyRequestService.submitApproval(busNo);
|
||||
return result ? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00004, null))
|
||||
: R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||
}
|
||||
|
||||
// 更改供应请求单据状态
|
||||
// 生成供应分发supply_delivery
|
||||
/**
|
||||
* 撤回审批
|
||||
*
|
||||
* @param busNo 单据号
|
||||
* @return 操作结果
|
||||
*/
|
||||
@PutMapping("/withdraw-approval")
|
||||
public R<?> withdrawApproval(@RequestParam String busNo) {
|
||||
// 撤回审核
|
||||
boolean result = supplyRequestService.withdrawApproval(busNo);
|
||||
return result ? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00004, null))
|
||||
: R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,143 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.inventorymanage.controller;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.core.common.core.domain.model.LoginUser;
|
||||
import com.core.common.utils.DateUtils;
|
||||
import com.core.common.utils.MessageUtils;
|
||||
import com.core.framework.web.service.TokenService;
|
||||
import com.openhis.administration.domain.ChargeItem;
|
||||
import com.openhis.administration.domain.ChargeItemDefApp;
|
||||
import com.openhis.administration.service.IChargeItemDefAppService;
|
||||
import com.openhis.administration.service.IChargeItemService;
|
||||
import com.openhis.common.constant.PromptMsgConstant;
|
||||
import com.openhis.web.inventorymanage.appservice.IInventoryManageService;
|
||||
import com.openhis.web.inventorymanage.assembler.InventoryManageAssembler;
|
||||
import com.openhis.web.inventorymanage.dto.ItemChargeDetailDto;
|
||||
import com.openhis.web.inventorymanage.dto.SupplyItemDetailDto;
|
||||
import com.openhis.workflow.domain.InventoryItem;
|
||||
import com.openhis.workflow.domain.SupplyDelivery;
|
||||
import com.openhis.workflow.domain.SupplyRequest;
|
||||
import com.openhis.workflow.service.IInventoryItemService;
|
||||
import com.openhis.workflow.service.ISupplyDeliveryService;
|
||||
import com.openhis.workflow.service.ISupplyRequestService;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* 单据审批 controller
|
||||
*
|
||||
* @author zwh
|
||||
* @date 2025-03-04
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/inventory-manage/receipt")
|
||||
@Slf4j
|
||||
public class ReceiptApprovalController {
|
||||
|
||||
@Autowired
|
||||
private ISupplyRequestService supplyRequestService;
|
||||
@Autowired
|
||||
private ISupplyDeliveryService supplyDeliveryService;
|
||||
@Autowired
|
||||
private IChargeItemDefAppService chargeItemDefAppService;
|
||||
@Autowired
|
||||
private IInventoryItemService inventoryItemService;
|
||||
@Autowired
|
||||
private IChargeItemService chargeItemService;
|
||||
@Autowired
|
||||
private IInventoryManageService inventoryManageService;
|
||||
@Autowired
|
||||
private TokenService tokenService;
|
||||
|
||||
/**
|
||||
* 审批通过
|
||||
*
|
||||
* @param busNo 单据号
|
||||
* @return 操作结果
|
||||
*/
|
||||
@PostMapping("/approved")
|
||||
public R<?> approved(@RequestParam String busNo, HttpServletRequest request) {
|
||||
// 获取登录者的信息
|
||||
LoginUser loginUser = tokenService.getLoginUser(request);
|
||||
// 获取当前时间
|
||||
Date now = DateUtils.getNowDate();
|
||||
|
||||
// 审批单据并返回单据详情
|
||||
List<SupplyRequest> agreedList = supplyRequestService.agreeRequest(busNo, loginUser, now);
|
||||
if (agreedList.isEmpty()) {
|
||||
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||
}
|
||||
// 根据单据,发放物品
|
||||
List<SupplyDelivery> deliveredList = supplyDeliveryService.createCompletedSupplyDelivery(agreedList, now);
|
||||
if (deliveredList.isEmpty()) {
|
||||
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||
}
|
||||
|
||||
// 获取供应项目所在表
|
||||
String itemTable = supplyRequestService.getItemTable(agreedList);
|
||||
// 获取供应的物品
|
||||
List<Long> itemIdList = supplyRequestService.getItem(agreedList);
|
||||
// 获取项目价格相关信息
|
||||
List<ItemChargeDetailDto> chargeDetailList = inventoryManageService.getItemChargeDetail(itemIdList);
|
||||
List<ChargeItemDefApp> chargeItemDefAppList = new ArrayList<>();
|
||||
if (!chargeDetailList.isEmpty()) {
|
||||
// 入库项价格验证(验证项:单位价格,批次号)
|
||||
chargeItemDefAppList = inventoryManageService.verifyItemCharge(agreedList, chargeDetailList);
|
||||
}
|
||||
if (!chargeItemDefAppList.isEmpty()) {
|
||||
for (ChargeItemDefApp chargeItemDefApp : chargeItemDefAppList) {
|
||||
// 增加项目定价子表数据
|
||||
chargeItemDefAppService.addChargeItemDefApp(chargeItemDefApp);
|
||||
}
|
||||
}
|
||||
|
||||
// 查询供应项目的详细信息
|
||||
List<SupplyItemDetailDto> supplyItemDetailList = inventoryManageService.getSupplyItemDetail(busNo, itemTable);
|
||||
if (!supplyItemDetailList.isEmpty()) {
|
||||
// 将供应项目的详细信息装配为库存项目和采购账单
|
||||
Pair<List<ChargeItem>, List<InventoryItem>> listPair =
|
||||
InventoryManageAssembler.assembleChargeAndInventory(supplyItemDetailList, now);
|
||||
if (listPair != null) {
|
||||
// 创建已结算的采购财务流水
|
||||
chargeItemService.createBilledPurchaseCharge(listPair.getLeft());
|
||||
// 入库
|
||||
inventoryItemService.stockIn(listPair.getRight());
|
||||
}
|
||||
}
|
||||
return R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00004, null));
|
||||
}
|
||||
|
||||
/**
|
||||
* 审批驳回
|
||||
*
|
||||
* @param busNo 单据号
|
||||
* @return 操作结果
|
||||
*/
|
||||
@PostMapping("/reject")
|
||||
public R<?> reject(@RequestParam String busNo, HttpServletRequest request) {
|
||||
// 获取当前时间
|
||||
Date now = DateUtils.getNowDate();
|
||||
// 获取登录者的信息
|
||||
LoginUser loginUser = tokenService.getLoginUser(request);
|
||||
// 驳回单据
|
||||
boolean result = supplyRequestService.rejectRequest(busNo, loginUser, now);
|
||||
return result ? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00004, null))
|
||||
: R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||
}
|
||||
}
|
||||
@@ -1,62 +0,0 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.inventorymanage.dto;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 入库
|
||||
*
|
||||
* @author ZhangYC
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class InventoryDto {
|
||||
|
||||
/** 项目 */
|
||||
private String itemTable;
|
||||
|
||||
/** 数量 */
|
||||
private Integer itemQuantity;
|
||||
|
||||
/** 物品编码 */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
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;
|
||||
|
||||
}
|
||||
@@ -4,6 +4,7 @@
|
||||
package com.openhis.web.inventorymanage.dto;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
@@ -14,11 +15,14 @@ import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import javax.validation.constraints.Min;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* 入库单据分页列表 dto
|
||||
* 入库单据
|
||||
*
|
||||
* @author zwh
|
||||
* @date 2025-02-18
|
||||
* @author ZhangYC
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@@ -31,37 +35,85 @@ public class InventoryReceiptDto implements Serializable {
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
|
||||
/** 单据号 */
|
||||
private String busNo;
|
||||
/** 项目 */
|
||||
private String itemTable;
|
||||
|
||||
/** 类型 */
|
||||
private Integer typeEnum;
|
||||
/** 数量 */
|
||||
@NotNull
|
||||
@Min(1)
|
||||
private Integer itemQuantity;
|
||||
|
||||
/** 状态 */
|
||||
private Integer statusEnum;
|
||||
/** 物品编码 */
|
||||
@NotNull
|
||||
private Long itemId;
|
||||
|
||||
/** 分类 */
|
||||
private Integer categoryEnum;
|
||||
/** 物品计量单位 */
|
||||
@NotNull
|
||||
private String unitCode;
|
||||
|
||||
/** 请求细节 */
|
||||
private String detailJson;
|
||||
|
||||
/** 供应商 */
|
||||
@NotNull
|
||||
private Long supplierId;
|
||||
|
||||
/** 源仓库类型 */
|
||||
@NotNull
|
||||
private Integer sourceTypeEnum;
|
||||
|
||||
/** 源仓库 */
|
||||
@NotNull
|
||||
private Long sourceLocationId;
|
||||
|
||||
/** 源仓位 */
|
||||
@NotNull
|
||||
private Long sourceLocationStoreId;
|
||||
|
||||
/** 目的仓库类型 */
|
||||
@NotNull
|
||||
private Integer purposeTypeEnum;
|
||||
|
||||
/** 目的仓库 */
|
||||
@NotNull
|
||||
private Long purposeLocationId;
|
||||
|
||||
/** 审批人 */
|
||||
private Long approverId;
|
||||
|
||||
/** 审批时间 */
|
||||
private Date approvalTime;
|
||||
/** 目的仓位 */
|
||||
@NotNull
|
||||
private Long purposeLocationStoreId;
|
||||
|
||||
/** 申请人 */
|
||||
@NotNull
|
||||
private Long applicantId;
|
||||
|
||||
/** 申请时间 */
|
||||
private Date applyTime;
|
||||
|
||||
/** 产品批号 */
|
||||
@NotNull
|
||||
private String lotNumber;
|
||||
|
||||
/** 追溯码 */
|
||||
@NotNull
|
||||
private String traceNo;
|
||||
|
||||
/** 发票号 */
|
||||
private String invoiceNo;
|
||||
|
||||
/** 开始时间 */
|
||||
@NotNull
|
||||
private Date startTime;
|
||||
|
||||
/** 结束时间 */
|
||||
@NotNull
|
||||
private Date endTime;
|
||||
|
||||
/** 单价 */
|
||||
@NotNull
|
||||
private BigDecimal price;
|
||||
|
||||
/** 总价 */
|
||||
@NotNull
|
||||
private BigDecimal totalPrice;
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.inventorymanage.dto;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 入库单据分页列表 dto
|
||||
*
|
||||
* @author zwh
|
||||
* @date 2025-02-18
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class InventoryReceiptPageDto implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** ID */
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
|
||||
/** 单据号 */
|
||||
private String busNo;
|
||||
|
||||
/** 类型 */
|
||||
private Integer typeEnum;
|
||||
|
||||
/** 状态 */
|
||||
private Integer statusEnum;
|
||||
|
||||
/** 分类 */
|
||||
private Integer categoryEnum;
|
||||
|
||||
/** 供应商 */
|
||||
private Long supplierId;
|
||||
|
||||
/** 源仓库 */
|
||||
private Long sourceLocationId;
|
||||
|
||||
/** 目的仓库 */
|
||||
private Long purposeLocationId;
|
||||
|
||||
/** 审批人 */
|
||||
private Long approverId;
|
||||
|
||||
/** 审批时间 */
|
||||
private Date approvalTime;
|
||||
|
||||
/** 申请人 */
|
||||
private Long applicantId;
|
||||
|
||||
/** 申请时间 */
|
||||
private Date applyTime;
|
||||
|
||||
}
|
||||
@@ -6,6 +6,7 @@ package com.openhis.web.inventorymanage.dto;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import com.openhis.common.annotation.Dict;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.inventorymanage.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 项目价格详情
|
||||
*
|
||||
* @author zwh
|
||||
* @date 2025-03-07
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class ItemChargeDetailDto implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 费用定价主键ID */
|
||||
private Long definitionId;
|
||||
|
||||
/** 名称 */
|
||||
private String chargeName;
|
||||
|
||||
/** 批次号 */
|
||||
private String conditionLotnumber;
|
||||
|
||||
/** 条件类型 */
|
||||
private String conditionUnitCode;
|
||||
|
||||
/** 单位价格 */
|
||||
private BigDecimal unitPrice;
|
||||
|
||||
/** 关联项目 */
|
||||
private Long instanceId;
|
||||
|
||||
/** 基础价格 */
|
||||
private BigDecimal sellPrice;
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.inventorymanage.dto;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 单据详情
|
||||
*
|
||||
* @author zwh
|
||||
* @date 2025-03-04
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class ReceiptDetailDto implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
@@ -1,190 +0,0 @@
|
||||
/*
|
||||
* 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 SaveInventoryReceiptDto {
|
||||
/** 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;
|
||||
|
||||
// =======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;
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.inventorymanage.dto;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 供应单据及供应项相关详细信息 dto
|
||||
*
|
||||
* @author zwh
|
||||
* @date 2025-03-06
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class SupplyItemDetailDto implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 项目 */
|
||||
private String itemTable;
|
||||
|
||||
/** 物品编码 */
|
||||
private Long itemId;
|
||||
|
||||
/** 数量 */
|
||||
private BigDecimal itemQuantity;
|
||||
|
||||
/** 项目单位 */
|
||||
private String itemUnit;
|
||||
|
||||
/** 单价 */
|
||||
private BigDecimal price;
|
||||
|
||||
/** 总价 */
|
||||
private BigDecimal totalPrice;
|
||||
|
||||
/** 审批人 */
|
||||
private Long approverId;
|
||||
|
||||
/** 目的仓库 */
|
||||
private Long purposeLocationId;
|
||||
|
||||
/** 目的仓位 */
|
||||
private Long purposeLocationStoreId;
|
||||
|
||||
/** 供应商id */
|
||||
private Long supplierId;
|
||||
|
||||
/** 产品批号 */
|
||||
private String lotNumber;
|
||||
|
||||
/** 追溯码 */
|
||||
private String traceNo;
|
||||
|
||||
/** 单据号 */
|
||||
private String busNo;
|
||||
|
||||
/** 开始时间 */
|
||||
private Date startTime;
|
||||
|
||||
/** 结束时间 */
|
||||
private Date endTime;
|
||||
|
||||
/** 服务id */
|
||||
private Long serviceId;
|
||||
|
||||
/** 名称 */
|
||||
private String name;
|
||||
|
||||
/** 拼音码 */
|
||||
private String pyStr;
|
||||
|
||||
/** 五笔码 */
|
||||
private String wbStr;
|
||||
|
||||
/** 常规单位 */
|
||||
private String unitCode;
|
||||
|
||||
/** 最小单位 */
|
||||
private String minUnitCode;
|
||||
|
||||
/** 费用定价ID */
|
||||
private Long definitionId;
|
||||
|
||||
/** 原价 */
|
||||
private BigDecimal baseAmount;
|
||||
|
||||
/** 费用定价子表ID */
|
||||
private Long applicabilityId;
|
||||
}
|
||||
@@ -3,9 +3,14 @@
|
||||
*/
|
||||
package com.openhis.web.inventorymanage.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.openhis.web.inventorymanage.dto.ItemChargeDetailDto;
|
||||
import com.openhis.web.inventorymanage.dto.SupplyItemDetailDto;
|
||||
import com.openhis.workflow.domain.SupplyRequest;
|
||||
|
||||
/**
|
||||
@@ -15,4 +20,33 @@ import com.openhis.workflow.domain.SupplyRequest;
|
||||
* @date 2025-02-25
|
||||
*/
|
||||
@Repository
|
||||
public interface InventoryManageMapper extends BaseMapper<SupplyRequest> {}
|
||||
public interface InventoryManageMapper extends BaseMapper<SupplyRequest> {
|
||||
|
||||
/**
|
||||
* 获取药品供应单据详细信息
|
||||
*
|
||||
* @param busNo 单据号
|
||||
* @param completed 发放状态:已完成
|
||||
* @return 药品供应单据详细信息
|
||||
*/
|
||||
List<SupplyItemDetailDto> selectSupplyMedDetail(@Param("busNo") String busNo,
|
||||
@Param("completed") Integer completed);
|
||||
|
||||
/**
|
||||
* 获取耗材供应单据详细信息
|
||||
*
|
||||
* @param busNo 单据号
|
||||
* @param completed 发放状态:已完成
|
||||
* @return 耗材供应单据详细信息
|
||||
*/
|
||||
List<SupplyItemDetailDto> selectSupplyDevDetail(@Param("busNo") String busNo,
|
||||
@Param("completed") Integer completed);
|
||||
|
||||
/**
|
||||
* 根据物品id获取物品的价格信息
|
||||
*
|
||||
* @param itemIdList 物品id
|
||||
* @return 价格信息
|
||||
*/
|
||||
List<ItemChargeDetailDto> selectChargeDetail(@Param("itemIdList") List<Long> itemIdList);
|
||||
}
|
||||
|
||||
@@ -2,4 +2,99 @@
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.openhis.web.inventorymanage.mapper.InventoryManageMapper">
|
||||
|
||||
<select id="selectSupplyMedDetail" resultType="com.openhis.web.inventorymanage.dto.SupplyItemDetailDto">
|
||||
SELECT T1.item_table,
|
||||
T1.item_id,
|
||||
T1.item_quantity,
|
||||
T1.unit_code AS item_unit,
|
||||
T1.price,
|
||||
T1.total_price,
|
||||
T1.approver_id,
|
||||
T1.purpose_location_id,
|
||||
T1.purpose_location_store_id,
|
||||
T1.supplier_id,
|
||||
T1.lot_number,
|
||||
T1.trace_no,
|
||||
T1.bus_no,
|
||||
T1.start_time,
|
||||
T1.end_time,
|
||||
T1.id AS service_id,
|
||||
T2."name",
|
||||
T2.py_str,
|
||||
T2.wb_str,
|
||||
T2.unit_code,
|
||||
T2.min_unit_code,
|
||||
T3.id AS definition_id,
|
||||
T4.amount AS base_amount,
|
||||
T4.id AS applicability_id
|
||||
FROM wor_supply_request AS T1
|
||||
LEFT JOIN wor_supply_delivery AS T5
|
||||
ON T1.id = T5.request_id
|
||||
LEFT JOIN med_medication_definition AS T2
|
||||
ON T2.id = T1.item_id
|
||||
LEFT JOIN adm_charge_item_definition T3
|
||||
ON T2.id = T3.instance_id
|
||||
LEFT JOIN adm_charge_item_def_app T4
|
||||
ON T3.id = T4.definition_id
|
||||
AND T1.unit_code = T4.condition_unit_code
|
||||
WHERE T1.bus_no = #{busNo}
|
||||
AND T5.status_enum = #{completed}
|
||||
AND T1.delete_flag = 0
|
||||
</select>
|
||||
|
||||
<select id="selectSupplyDevDetail" resultType="com.openhis.web.inventorymanage.dto.SupplyItemDetailDto">
|
||||
SELECT T1.item_table,
|
||||
T1.item_id,
|
||||
T1.item_quantity,
|
||||
T1.unit_code AS item_unit,
|
||||
T1.price,
|
||||
T1.total_price,
|
||||
T1.approver_id,
|
||||
T1.purpose_location_id,
|
||||
T1.purpose_location_store_id,
|
||||
T1.supplier_id,
|
||||
T1.lot_number,
|
||||
T1.trace_no,
|
||||
T1.bus_no,
|
||||
T1.start_time,
|
||||
T1.end_time,
|
||||
T1.id AS service_id,
|
||||
T2."name",
|
||||
T2.py_str,
|
||||
T2.wb_str,
|
||||
T2.unit_code,
|
||||
T2.min_unit_code,
|
||||
T3.id AS definition_id,
|
||||
T4.amount AS base_amount,
|
||||
T4.id AS applicability_id
|
||||
FROM wor_supply_request AS T1
|
||||
LEFT JOIN wor_supply_delivery AS T5
|
||||
ON T1.id = T5.request_id
|
||||
LEFT JOIN med_medication_definition AS T2
|
||||
ON T2.id = T1.item_id
|
||||
LEFT JOIN adm_charge_item_definition T3
|
||||
ON T2.id = T3.instance_id
|
||||
LEFT JOIN adm_charge_item_def_app T4
|
||||
ON T3.id = T4.definition_id
|
||||
AND T1.unit_code = T4.condition_unit_code
|
||||
WHERE T1.bus_no = #{busNo}
|
||||
AND T5.status_enum = #{completed}
|
||||
AND T1.delete_flag = 0
|
||||
</select>
|
||||
<select id="selectChargeDetail" resultType="com.openhis.web.inventorymanage.dto.ItemChargeDetailDto">
|
||||
SELECT T1.id AS definition_id,
|
||||
T1.instance_id,
|
||||
T1.charge_name,
|
||||
T1.price AS sell_price,
|
||||
T2.condition_lotnumber,
|
||||
T2.condition_unit_code,
|
||||
T2.amount AS unit_price
|
||||
FROM adm_charge_item_definition AS T1
|
||||
LEFT JOIN adm_charge_item_def_app AS T2
|
||||
ON T1.id = T2.definition_id
|
||||
WHERE T1.instance_id IN
|
||||
<foreach collection="itemIdList" item="itemId" separator="," open="(" close=")">
|
||||
#{itemId}
|
||||
</foreach>
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -42,11 +42,21 @@ public class CommonConstants {
|
||||
*/
|
||||
String MED_MEDICATION_DEFINITION = "med_medication_definition";
|
||||
|
||||
/**
|
||||
* 药品信息
|
||||
*/
|
||||
String MED_MEDICATION = "med_medication";
|
||||
|
||||
/**
|
||||
* 器材定义
|
||||
*/
|
||||
String ADM_DEVICE_DEFINITION = "adm_device_definition";
|
||||
|
||||
/**
|
||||
* 器材信息
|
||||
*/
|
||||
String ADM_DEVICE = "adm_device";
|
||||
|
||||
/**
|
||||
* 活动定义
|
||||
*/
|
||||
|
||||
@@ -58,4 +58,16 @@ public class PromptMsgConstant {
|
||||
String M00010 = "apl.common.M00010";
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 库存
|
||||
*/
|
||||
public interface Inventory {
|
||||
|
||||
/**
|
||||
* {0}添加成功
|
||||
*/
|
||||
String M00001 = "apl.inventory.M00001";
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,24 +1,71 @@
|
||||
package com.openhis.common.enums;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.EnumValue;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 事件状态
|
||||
*
|
||||
* @author lyx
|
||||
* @date 2025-03-05
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum EventStatus {
|
||||
|
||||
PREPARATION(1, "PREP", "Preparation stage, gathering resources and planning."),
|
||||
IN_PROGRESS(2, "IP", "Task is currently being worked on."),
|
||||
NOT_DONE(3, "ND", "Task has not been completed."),
|
||||
ON_HOLD(4, "OH", "Task is temporarily paused."),
|
||||
STOPPED(5, "ST", "Task has been stopped."),
|
||||
COMPLETED(6, "CMP", "Task has been completed."),
|
||||
ENTERED_IN_ERROR(7, "EIE", "Task status was entered in error."),
|
||||
UNKNOWN(8, "UNK", "Task status is unknown.");
|
||||
/**
|
||||
* 草稿
|
||||
*/
|
||||
PREPARATION(1, "PREP", "草稿"),
|
||||
|
||||
@EnumValue
|
||||
private final Integer value;
|
||||
private final String code;
|
||||
private final String info;
|
||||
/**
|
||||
* 进行中
|
||||
*/
|
||||
IN_PROGRESS(2, "IP", "进行中"),
|
||||
|
||||
/**
|
||||
* 未完成
|
||||
*/
|
||||
NOT_DONE(3, "ND", "未完成"),
|
||||
|
||||
/**
|
||||
* 暂停
|
||||
*/
|
||||
ON_HOLD(4, "OH", "暂停"),
|
||||
|
||||
/**
|
||||
* 停止
|
||||
*/
|
||||
STOPPED(5, "ST", "停止"),
|
||||
|
||||
/**
|
||||
* 已完成
|
||||
*/
|
||||
COMPLETED(6, "CMP", "已完成"),
|
||||
|
||||
/**
|
||||
* 录入错误
|
||||
*/
|
||||
ENTERED_IN_ERROR(7, "EIE", "录入错误"),
|
||||
|
||||
/**
|
||||
* 未知
|
||||
*/
|
||||
UNKNOWN(8, "UNK", "未知");
|
||||
|
||||
private Integer value;
|
||||
private String code;
|
||||
private String info;
|
||||
|
||||
public static EventStatus getByValue(Integer value) {
|
||||
if (value == null) {
|
||||
return null;
|
||||
}
|
||||
for (EventStatus val : values()) {
|
||||
if (val.getValue().equals(value)) {
|
||||
return val;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.common.enums;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 单据类别
|
||||
*
|
||||
* @author zwh
|
||||
* @date 2025-03-05
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum SupplyCategory {
|
||||
|
||||
/**
|
||||
* 库存供应
|
||||
*/
|
||||
STOCK_SUPPLY(1, "库存供应"),
|
||||
|
||||
/**
|
||||
* 非库存供应
|
||||
*/
|
||||
NON_STOCK(2, "非库存供应");
|
||||
|
||||
private Integer value;
|
||||
private String info;
|
||||
|
||||
public static SupplyCategory getByValue(Integer value) {
|
||||
if (value == null) {
|
||||
return null;
|
||||
}
|
||||
for (SupplyCategory val : values()) {
|
||||
if (val.getValue().equals(value)) {
|
||||
return val;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.common.enums;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 单据状态
|
||||
*
|
||||
* @author zwh
|
||||
* @date 2025-03-05
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum SupplyStatus {
|
||||
|
||||
/**
|
||||
* 待审核
|
||||
*/
|
||||
PENDING_APPROVAL(1, "待审核"),
|
||||
|
||||
/**
|
||||
* 审核中
|
||||
*/
|
||||
APPROVAL(2, "审核中"),
|
||||
|
||||
/**
|
||||
* 同意
|
||||
*/
|
||||
AGREE(3, "同意"),
|
||||
|
||||
/**
|
||||
* 驳回
|
||||
*/
|
||||
REJECT(4, "驳回"),
|
||||
|
||||
/**
|
||||
* 已撤回
|
||||
*/
|
||||
WITHDRAW(9, "已撤回");
|
||||
|
||||
private Integer value;
|
||||
private String info;
|
||||
|
||||
public static SupplyStatus getByValue(Integer value) {
|
||||
if (value == null) {
|
||||
return null;
|
||||
}
|
||||
for (SupplyStatus val : values()) {
|
||||
if (val.getValue().equals(value)) {
|
||||
return val;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.common.enums;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 单据类型
|
||||
*
|
||||
* @author zwh
|
||||
* @date 2025-03-05
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum SupplyType {
|
||||
|
||||
/**
|
||||
* 采购入库
|
||||
*/
|
||||
PURCHASE_INVENTORY(1, "采购入库"),
|
||||
|
||||
/**
|
||||
* 商品调拨
|
||||
*/
|
||||
PRODUCT_ALLOCATION(2, "商品调拨"),
|
||||
|
||||
/**
|
||||
* 汇总发药
|
||||
*/
|
||||
DISPENSING_AGGREGATION(3, "汇总发药");
|
||||
|
||||
private Integer value;
|
||||
private String info;
|
||||
|
||||
public static SupplyType getByValue(Integer value) {
|
||||
if (value == null) {
|
||||
return null;
|
||||
}
|
||||
for (SupplyType val : values()) {
|
||||
if (val.getValue().equals(value)) {
|
||||
return val;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.common.enums;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 是否标识
|
||||
*
|
||||
* @author zwh
|
||||
* @date 2025-03-05
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum Whether {
|
||||
|
||||
/**
|
||||
* 否
|
||||
*/
|
||||
NO(0, "否"),
|
||||
|
||||
/**
|
||||
* 是
|
||||
*/
|
||||
YES(1, "是");
|
||||
|
||||
private Integer value;
|
||||
private String info;
|
||||
|
||||
public static Whether getByValue(Integer value) {
|
||||
if (value == null) {
|
||||
return null;
|
||||
}
|
||||
for (Whether val : values()) {
|
||||
if (val.getValue().equals(value)) {
|
||||
return val;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -74,7 +74,7 @@ public class ChargeItem extends HisBaseEntity {
|
||||
/** 费用定价ID */
|
||||
private Long definitionId;
|
||||
|
||||
/** applicability表主键 */
|
||||
/** 定价子表主键 */
|
||||
private Long applicabilityId;
|
||||
|
||||
/** 原价 */
|
||||
@@ -98,12 +98,18 @@ public class ChargeItem extends HisBaseEntity {
|
||||
/** 开立时间 */
|
||||
private Date enteredDate;
|
||||
|
||||
/** 医疗服务类型 */
|
||||
/** 医疗服务所在表 */
|
||||
private String serviceTable;
|
||||
|
||||
/** 医疗服务ID */
|
||||
private Long serviceId;
|
||||
|
||||
/** 产品所在表 */
|
||||
private String productTable;
|
||||
|
||||
/** 产品ID */
|
||||
private Long productId;
|
||||
|
||||
/** 索赔结果 */
|
||||
private Integer claimStateEnum;
|
||||
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
package com.openhis.administration.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
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 com.openhis.common.enums.ActPriority;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
@@ -55,5 +55,8 @@ public class ChargeItemDefApp extends HisBaseEntity {
|
||||
/** 价格 */
|
||||
private BigDecimal amount;
|
||||
|
||||
|
||||
public ChargeItemDefApp() {
|
||||
// 默认优先级:常规
|
||||
this.priority = ActPriority.ROUTINE.getValue();
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,11 @@
|
||||
package com.openhis.administration.service;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.openhis.administration.domain.ChargeItem;
|
||||
import com.openhis.workflow.domain.SupplyRequest;
|
||||
|
||||
/**
|
||||
* 费用项管理Service接口
|
||||
@@ -12,17 +16,9 @@ import com.openhis.administration.domain.ChargeItem;
|
||||
public interface IChargeItemService extends IService<ChargeItem> {
|
||||
|
||||
/**
|
||||
* 保存chargeItem相关信息
|
||||
* 创建已计费的采购账单
|
||||
*
|
||||
* @return 保存结果
|
||||
* @param chargeItemList 采购账单
|
||||
*/
|
||||
boolean saveChargeItem(ChargeItem chargeItem);
|
||||
|
||||
/**
|
||||
* 更新收费项目
|
||||
*
|
||||
* @param chargeItem 更新内容
|
||||
* @return 更新结果
|
||||
*/
|
||||
boolean updateChargeItem(ChargeItem chargeItem);
|
||||
void createBilledPurchaseCharge(List<ChargeItem> chargeItemList);
|
||||
}
|
||||
@@ -1,17 +1,16 @@
|
||||
package com.openhis.administration.service.impl;
|
||||
|
||||
import com.openhis.administration.domain.HealthcareService;
|
||||
import com.openhis.common.constant.CommonConstants;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.openhis.administration.domain.ChargeItemDefinition;
|
||||
import com.openhis.administration.domain.HealthcareService;
|
||||
import com.openhis.administration.mapper.ChargeItemDefinitionMapper;
|
||||
import com.openhis.administration.service.IChargeItemDefinitionService;
|
||||
import com.openhis.common.constant.CommonConstants;
|
||||
import com.openhis.common.enums.DelFlag;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* 费用定价管理Service业务层处理
|
||||
@@ -77,7 +76,6 @@ public class ChargeItemDefinitionServiceImpl extends ServiceImpl<ChargeItemDefin
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 通过服务管理新增费用定价
|
||||
*
|
||||
@@ -86,7 +84,8 @@ public class ChargeItemDefinitionServiceImpl extends ServiceImpl<ChargeItemDefin
|
||||
* @return 新增结果
|
||||
*/
|
||||
@Override
|
||||
public boolean addChargeItemDefinitionByHealthcareService(HealthcareService healthcareService, ChargeItemDefinition chargeItemDefinition) {
|
||||
public boolean addChargeItemDefinitionByHealthcareService(HealthcareService healthcareService,
|
||||
ChargeItemDefinition chargeItemDefinition) {
|
||||
// 服务管理主键id
|
||||
if (healthcareService.getId() != null) {
|
||||
chargeItemDefinition.setInstanceTable(CommonConstants.TableName.ADM_HEALTHCARE_SERVICE);
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.openhis.administration.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
@@ -22,37 +24,12 @@ public class ChargeItemServiceImpl extends ServiceImpl<ChargeItemMapper, ChargeI
|
||||
private final ChargeItemMapper chargeItemMapper;
|
||||
|
||||
/**
|
||||
* 保存chargeItem相关信息
|
||||
* 创建已计费的采购账单
|
||||
*
|
||||
* @return 保存结果
|
||||
* @param chargeItemList 采购账单
|
||||
*/
|
||||
@Override
|
||||
public boolean saveChargeItem(ChargeItem chargeItem) {
|
||||
// 假设此处有业务相关处理
|
||||
if (chargeItem.getBusNo() == null) {
|
||||
return false;
|
||||
}
|
||||
return chargeItemMapper.insert(chargeItem) > 0;
|
||||
}
|
||||
public void createBilledPurchaseCharge(List<ChargeItem> chargeItemList) {
|
||||
|
||||
/**
|
||||
* 更新收费项目
|
||||
*
|
||||
* @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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -31,8 +31,11 @@ public class InventoryItem extends HisBaseEntity {
|
||||
/** 物品类别 */
|
||||
private Integer categoryEnum;
|
||||
|
||||
/** 编码 */
|
||||
private String busNo;
|
||||
/** 项目 */
|
||||
private String itemTable;
|
||||
|
||||
/** 物品编码 */
|
||||
private Long itemId;
|
||||
|
||||
/** 名称 */
|
||||
private String name;
|
||||
|
||||
@@ -6,8 +6,10 @@ 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 com.openhis.common.enums.EventStatus;
|
||||
import com.openhis.common.enums.SupplyType;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
@@ -73,10 +75,10 @@ public class SupplyDelivery extends HisBaseEntity {
|
||||
/** 发放时间 */
|
||||
private Date occurrenceTime;
|
||||
|
||||
/** 发放开始时间 */
|
||||
/** 开始时间 */
|
||||
private Date occurrenceStartTime;
|
||||
|
||||
/** 发放结束时间 */
|
||||
/** 结束时间 */
|
||||
private Date occurrenceEndTime;
|
||||
|
||||
/** 发放周期时间 */
|
||||
@@ -86,7 +88,12 @@ public class SupplyDelivery extends HisBaseEntity {
|
||||
private Long receiverId;
|
||||
|
||||
/** 接收时间 */
|
||||
private Date receiveDateTime;
|
||||
|
||||
private Date receiveTime;
|
||||
|
||||
public SupplyDelivery() {
|
||||
// 默认发放状态:进行中
|
||||
this.statusEnum = EventStatus.IN_PROGRESS.getValue();
|
||||
// 默认发放类型:
|
||||
this.typeEnum = SupplyType.PRODUCT_ALLOCATION.getValue();
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,16 @@
|
||||
package com.openhis.workflow.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
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 com.openhis.common.enums.ActPriority;
|
||||
import com.openhis.common.enums.SupplyCategory;
|
||||
import com.openhis.common.enums.SupplyStatus;
|
||||
import com.openhis.common.enums.SupplyType;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
@@ -54,26 +59,17 @@ public class SupplyRequest extends HisBaseEntity {
|
||||
/** 患者id */
|
||||
private Long patientId;
|
||||
|
||||
/** 发放实体表名 */
|
||||
private String dispenseTable;
|
||||
|
||||
/** 发放id */
|
||||
private Long dispenseId;
|
||||
|
||||
/** 项目 */
|
||||
private String itemTable;
|
||||
|
||||
/** 数量 */
|
||||
private Integer itemQuantity;
|
||||
private BigDecimal itemQuantity;
|
||||
|
||||
/** 物品编码 */
|
||||
private Long itemId;
|
||||
|
||||
/** 物品计量单位 */
|
||||
private String unitIdCode;
|
||||
|
||||
/** 物品数量 */
|
||||
private Integer unitQuantity;
|
||||
private String unitCode;
|
||||
|
||||
/** 请求细节 */
|
||||
private String detailJson;
|
||||
@@ -120,4 +116,35 @@ public class SupplyRequest extends HisBaseEntity {
|
||||
/** 申请时间 */
|
||||
private Date applyTime;
|
||||
|
||||
/** 产品批号 */
|
||||
private String lotNumber;
|
||||
|
||||
/** 追溯码 */
|
||||
private String traceNo;
|
||||
|
||||
/** 发票号 */
|
||||
private String invoiceNo;
|
||||
|
||||
/** 开始时间 */
|
||||
private Date startTime;
|
||||
|
||||
/** 结束时间 */
|
||||
private Date endTime;
|
||||
|
||||
/** 单价 */
|
||||
private BigDecimal price;
|
||||
|
||||
/** 总价 */
|
||||
private BigDecimal totalPrice;
|
||||
|
||||
public SupplyRequest() {
|
||||
// 默认单据类型:商品调拨
|
||||
this.typeEnum = SupplyType.PRODUCT_ALLOCATION.getValue();
|
||||
// 默认单据状态:待审核
|
||||
this.statusEnum = SupplyStatus.PENDING_APPROVAL.getValue();
|
||||
// 默认单据分类:库存供应
|
||||
this.categoryEnum = SupplyCategory.STOCK_SUPPLY.getValue();
|
||||
// 默认优先级:常规
|
||||
this.priorityEnum = ActPriority.ROUTINE.getValue();
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,9 @@ package com.openhis.workflow.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.openhis.workflow.domain.InventoryItem;
|
||||
import com.openhis.workflow.domain.SupplyRequest;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 库存项目管理Service接口
|
||||
@@ -11,4 +14,10 @@ import com.openhis.workflow.domain.InventoryItem;
|
||||
*/
|
||||
public interface IInventoryItemService extends IService<InventoryItem> {
|
||||
|
||||
/**
|
||||
* 入库
|
||||
*
|
||||
* @param InventoryItemList 入库项目
|
||||
*/
|
||||
void stockIn(List<InventoryItem> InventoryItemList);
|
||||
}
|
||||
@@ -1,7 +1,12 @@
|
||||
package com.openhis.workflow.service;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.workflow.domain.SupplyDelivery;
|
||||
import com.openhis.workflow.domain.SupplyRequest;
|
||||
|
||||
/**
|
||||
* 供应发放管理Service接口
|
||||
@@ -11,4 +16,11 @@ import com.openhis.workflow.domain.SupplyDelivery;
|
||||
*/
|
||||
public interface ISupplyDeliveryService extends IService<SupplyDelivery> {
|
||||
|
||||
/**
|
||||
* 根据单据,发放物品
|
||||
*
|
||||
* @param supplyRequestList 单据信息
|
||||
* @param supplyRequestList 单据信息
|
||||
*/
|
||||
List<SupplyDelivery> createCompletedSupplyDelivery(List<SupplyRequest> supplyRequestList, Date now);
|
||||
}
|
||||
@@ -1,7 +1,10 @@
|
||||
package com.openhis.workflow.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.core.common.core.domain.model.LoginUser;
|
||||
import com.openhis.workflow.domain.SupplyRequest;
|
||||
|
||||
/**
|
||||
@@ -13,12 +16,61 @@ import com.openhis.workflow.domain.SupplyRequest;
|
||||
public interface ISupplyRequestService extends IService<SupplyRequest> {
|
||||
|
||||
/**
|
||||
* 查询供应申请分页列表
|
||||
* 通过单据号查询单据信息
|
||||
*
|
||||
* @param supplyRequest 查询条件
|
||||
* @return 供应申请列表
|
||||
* @param busNo 单据号
|
||||
* @return 单据信息
|
||||
*/
|
||||
Page<SupplyRequest> getPage(SupplyRequest supplyRequest, Integer pageNo, Integer pageSize);
|
||||
List<SupplyRequest> getSupplyByBusNo(String busNo);
|
||||
|
||||
/**
|
||||
* 同意申请
|
||||
*
|
||||
* @param busNo 单据号
|
||||
* @param loginUser 登录用户信息
|
||||
* @param now 当前时间
|
||||
* @return 单据详情
|
||||
*/
|
||||
List<SupplyRequest> agreeRequest(String busNo, LoginUser loginUser, Date now);
|
||||
|
||||
/**
|
||||
* 提交审批
|
||||
*
|
||||
* @param busNo 单据号
|
||||
* @return 操作结果
|
||||
*/
|
||||
boolean submitApproval(String busNo);
|
||||
|
||||
/**
|
||||
* 撤回
|
||||
*
|
||||
* @param busNo 单据号
|
||||
* @return 操作结果
|
||||
*/
|
||||
boolean withdrawApproval(String busNo);
|
||||
|
||||
/**
|
||||
* 驳回申请
|
||||
*
|
||||
* @param busNo 单据号
|
||||
* @param loginUser 登录用户信息
|
||||
* @param now 当前时间
|
||||
*/
|
||||
boolean rejectRequest(String busNo, LoginUser loginUser, Date now);
|
||||
|
||||
/**
|
||||
* 获取供应项目所在表
|
||||
*
|
||||
* @param agreedList 供应单据信息
|
||||
* @return 供应项目所在表
|
||||
*/
|
||||
String getItemTable(List<SupplyRequest> agreedList);
|
||||
|
||||
/**
|
||||
* 获取供应的物品
|
||||
*
|
||||
* @param agreedList 供应单据
|
||||
* @return 物品id
|
||||
*/
|
||||
List<Long> getItem(List<SupplyRequest> agreedList);
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.openhis.workflow.service.impl;
|
||||
|
||||
import com.openhis.workflow.domain.SupplyRequest;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
@@ -7,6 +8,8 @@ import com.openhis.workflow.domain.InventoryItem;
|
||||
import com.openhis.workflow.mapper.InventoryItemMapper;
|
||||
import com.openhis.workflow.service.IInventoryItemService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 库存项目管理Service业务层处理
|
||||
*
|
||||
@@ -16,4 +19,13 @@ import com.openhis.workflow.service.IInventoryItemService;
|
||||
@Service
|
||||
public class InventoryItemServiceImpl extends ServiceImpl<InventoryItemMapper, InventoryItem> implements IInventoryItemService {
|
||||
|
||||
/**
|
||||
* 入库
|
||||
*
|
||||
* @param inventoryItemList 入库项目
|
||||
*/
|
||||
@Override
|
||||
public void stockIn(List<InventoryItem> inventoryItemList) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,16 @@
|
||||
package com.openhis.workflow.service.impl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.openhis.common.enums.EventStatus;
|
||||
import com.openhis.common.enums.SupplyType;
|
||||
import com.openhis.workflow.domain.SupplyDelivery;
|
||||
import com.openhis.workflow.domain.SupplyRequest;
|
||||
import com.openhis.workflow.mapper.SupplyDeliveryMapper;
|
||||
import com.openhis.workflow.service.ISupplyDeliveryService;
|
||||
|
||||
@@ -14,6 +21,60 @@ import com.openhis.workflow.service.ISupplyDeliveryService;
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
@Service
|
||||
public class SupplyDeliveryServiceImpl extends ServiceImpl<SupplyDeliveryMapper, SupplyDelivery> implements ISupplyDeliveryService {
|
||||
public class SupplyDeliveryServiceImpl extends ServiceImpl<SupplyDeliveryMapper, SupplyDelivery>
|
||||
implements ISupplyDeliveryService {
|
||||
|
||||
/**
|
||||
* 根据单据,发放物品
|
||||
*
|
||||
* @param supplyRequestList 单据信息
|
||||
* @param now 当前时间
|
||||
* @return 发放详情
|
||||
*/
|
||||
@Override
|
||||
public List<SupplyDelivery> createCompletedSupplyDelivery(List<SupplyRequest> supplyRequestList, Date now) {
|
||||
|
||||
List<SupplyDelivery> deliveryList = new ArrayList<>();
|
||||
// 根据申请单据生成发放单据
|
||||
for (SupplyRequest supplyRequest : supplyRequestList) {
|
||||
SupplyDelivery supplyDelivery = new SupplyDelivery();
|
||||
supplyDelivery
|
||||
// 请求id
|
||||
.setRequestId(supplyRequest.getId())
|
||||
// 发放状态:已完成
|
||||
.setStatusEnum(EventStatus.COMPLETED.getValue())
|
||||
// 单据类型:采购入库
|
||||
.setTypeEnum(SupplyType.PURCHASE_INVENTORY.getValue())
|
||||
// 发放项目所在表
|
||||
.setItemTable(supplyRequest.getItemTable())
|
||||
// 发放物品id
|
||||
.setItemId(supplyRequest.getItemId())
|
||||
// 物品单位
|
||||
.setUnitIdCode(supplyRequest.getUnitCode())
|
||||
// 发放数量
|
||||
.setQuantity(supplyRequest.getItemQuantity())
|
||||
// 批次号
|
||||
.setLotNumber(supplyRequest.getLotNumber())
|
||||
// 追溯码
|
||||
.setTraceNo(supplyRequest.getTraceNo())
|
||||
// 供应商id
|
||||
.setSupplierId(supplyRequest.getSupplierId())
|
||||
// 审批人
|
||||
.setPractitionerId(supplyRequest.getApplicantId())
|
||||
// 发放时间
|
||||
.setOccurrenceTime(now)
|
||||
// 接收位置
|
||||
.setReceiverId(supplyRequest.getPurposeLocationId())
|
||||
// 接收时间
|
||||
.setReceiveTime(now)
|
||||
// 生产日期
|
||||
.setOccurrenceStartTime(supplyRequest.getStartTime())
|
||||
// 失效日期
|
||||
.setOccurrenceEndTime(supplyRequest.getEndTime());
|
||||
deliveryList.add(supplyDelivery);
|
||||
// 新增发放单据
|
||||
baseMapper.insert(supplyDelivery);
|
||||
}
|
||||
return deliveryList;
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,16 @@
|
||||
package com.openhis.workflow.service.impl;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.openhis.common.enums.DelFlag;
|
||||
import com.core.common.core.domain.model.LoginUser;
|
||||
import com.openhis.common.enums.SupplyStatus;
|
||||
import com.openhis.workflow.domain.SupplyRequest;
|
||||
import com.openhis.workflow.mapper.SupplyRequestMapper;
|
||||
import com.openhis.workflow.service.ISupplyRequestService;
|
||||
@@ -28,24 +33,98 @@ public class SupplyRequestServiceImpl extends ServiceImpl<SupplyRequestMapper, S
|
||||
private final SupplyRequestMapper supplyRequestMapper;
|
||||
|
||||
/**
|
||||
* 查询供应申请列表
|
||||
* 通过单据号查询单据信息
|
||||
*
|
||||
* @param supplyRequest 查询条件
|
||||
* @return 供应申请列表
|
||||
* @param busNo 单据号
|
||||
* @return 单据信息
|
||||
*/
|
||||
@Override
|
||||
public Page<SupplyRequest> getPage(SupplyRequest supplyRequest, Integer pageNo, Integer pageSize) {
|
||||
public List<SupplyRequest> getSupplyByBusNo(String busNo) {
|
||||
return supplyRequestMapper
|
||||
.selectList(new LambdaQueryWrapper<SupplyRequest>().eq(SupplyRequest::getBusNo, busNo));
|
||||
}
|
||||
|
||||
Page<SupplyRequest> supplyRequestList;
|
||||
// 判断入库数量
|
||||
if (supplyRequest.getItemQuantity() != 0) {
|
||||
// 查询供应申请信息列表
|
||||
supplyRequestList = supplyRequestMapper.selectPage(new Page<>(pageNo, pageSize),
|
||||
new LambdaQueryWrapper<SupplyRequest>().eq(SupplyRequest::getDeleteFlag, DelFlag.NO.getValue()));
|
||||
} else {
|
||||
return null;
|
||||
/**
|
||||
* 同意申请
|
||||
*
|
||||
* @param busNo 单据号
|
||||
* @param loginUser 登录用户信息
|
||||
* @param now 当前时间
|
||||
* @return 单据详情
|
||||
*/
|
||||
@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()));
|
||||
// 返回单据详情
|
||||
return this.getSupplyByBusNo(busNo);
|
||||
}
|
||||
// 返回入库信息列表
|
||||
return supplyRequestList;
|
||||
|
||||
/**
|
||||
* 提交审批
|
||||
*
|
||||
* @param busNo 单据号
|
||||
* @return 操作结果
|
||||
*/
|
||||
@Override
|
||||
public boolean submitApproval(String busNo) {
|
||||
int updateCount = baseMapper.update(null, new LambdaUpdateWrapper<SupplyRequest>()
|
||||
.eq(SupplyRequest::getBusNo, busNo).set(SupplyRequest::getStatusEnum, SupplyStatus.APPROVAL.getValue()));
|
||||
return updateCount > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 撤回
|
||||
*
|
||||
* @param busNo 单据号
|
||||
* @return 操作结果
|
||||
*/
|
||||
@Override
|
||||
public boolean withdrawApproval(String busNo) {
|
||||
int updateCount = baseMapper.update(null, new LambdaUpdateWrapper<SupplyRequest>()
|
||||
.eq(SupplyRequest::getBusNo, busNo).set(SupplyRequest::getStatusEnum, SupplyStatus.WITHDRAW.getValue()));
|
||||
return updateCount > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 驳回申请
|
||||
*
|
||||
* @param busNo 单据号
|
||||
* @param loginUser 登录用户信息
|
||||
* @param now 当前时间
|
||||
*/
|
||||
@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()));
|
||||
return updateCount > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取供应项目所在表
|
||||
*
|
||||
* @param agreedList 供应单据信息
|
||||
* @return 供应项目所在表
|
||||
*/
|
||||
@Override
|
||||
public String getItemTable(List<SupplyRequest> agreedList) {
|
||||
return agreedList.stream().map(SupplyRequest::getItemTable).findFirst().orElse(null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取供应的物品
|
||||
*
|
||||
* @param agreedList 供应单据
|
||||
* @return 物品id
|
||||
*/
|
||||
@Override
|
||||
public List<Long> getItem(List<SupplyRequest> agreedList) {
|
||||
return agreedList.stream().map(SupplyRequest::getItemId).collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user