采购入库代码补全
This commit is contained in:
@@ -20,12 +20,12 @@ import com.openhis.common.constant.CommonConstants;
|
|||||||
import com.openhis.common.constant.PromptMsgConstant;
|
import com.openhis.common.constant.PromptMsgConstant;
|
||||||
import com.openhis.common.enums.SupplyCategory;
|
import com.openhis.common.enums.SupplyCategory;
|
||||||
import com.openhis.common.enums.SupplyType;
|
import com.openhis.common.enums.SupplyType;
|
||||||
import com.openhis.common.utils.HisPageUtils;
|
|
||||||
import com.openhis.common.utils.HisQueryUtils;
|
import com.openhis.common.utils.HisQueryUtils;
|
||||||
import com.openhis.web.inventorymanage.appservice.IPurchaseInventoryAppService;
|
import com.openhis.web.inventorymanage.appservice.IPurchaseInventoryAppService;
|
||||||
import com.openhis.web.inventorymanage.dto.InventoryReceiptDto;
|
import com.openhis.web.inventorymanage.dto.InventoryReceiptDto;
|
||||||
import com.openhis.web.inventorymanage.dto.InventoryReceiptPageDto;
|
import com.openhis.web.inventorymanage.dto.InventoryReceiptPageDto;
|
||||||
import com.openhis.web.inventorymanage.dto.InventorySearchParam;
|
import com.openhis.web.inventorymanage.dto.InventorySearchParam;
|
||||||
|
import com.openhis.web.inventorymanage.mapper.PurchaseInventoryMapper;
|
||||||
import com.openhis.workflow.domain.SupplyRequest;
|
import com.openhis.workflow.domain.SupplyRequest;
|
||||||
import com.openhis.workflow.mapper.SupplyRequestMapper;
|
import com.openhis.workflow.mapper.SupplyRequestMapper;
|
||||||
import com.openhis.workflow.service.ISupplyRequestService;
|
import com.openhis.workflow.service.ISupplyRequestService;
|
||||||
@@ -42,6 +42,9 @@ public class PurchaseInventoryAppServiceImpl implements IPurchaseInventoryAppSer
|
|||||||
@Autowired
|
@Autowired
|
||||||
private SupplyRequestMapper supplyRequestMapper;
|
private SupplyRequestMapper supplyRequestMapper;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private PurchaseInventoryMapper purchaseInventoryMapper;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ISupplyRequestService supplyRequestService;
|
private ISupplyRequestService supplyRequestService;
|
||||||
|
|
||||||
@@ -59,7 +62,6 @@ public class PurchaseInventoryAppServiceImpl implements IPurchaseInventoryAppSer
|
|||||||
public R<?> getPage(InventorySearchParam inventorySearchParam, Integer pageNo, Integer pageSize, String searchKey,
|
public R<?> getPage(InventorySearchParam inventorySearchParam, Integer pageNo, Integer pageSize, String searchKey,
|
||||||
HttpServletRequest request) {
|
HttpServletRequest request) {
|
||||||
|
|
||||||
// 按照单据号groupBy
|
|
||||||
// 设置模糊查询的字段名
|
// 设置模糊查询的字段名
|
||||||
HashSet<String> searchFields = new HashSet<>();
|
HashSet<String> searchFields = new HashSet<>();
|
||||||
searchFields.add(CommonConstants.FieldName.BusNo);
|
searchFields.add(CommonConstants.FieldName.BusNo);
|
||||||
@@ -68,8 +70,8 @@ public class PurchaseInventoryAppServiceImpl implements IPurchaseInventoryAppSer
|
|||||||
QueryWrapper<SupplyRequest> queryWrapper =
|
QueryWrapper<SupplyRequest> queryWrapper =
|
||||||
HisQueryUtils.buildQueryWrapper(inventorySearchParam, searchKey, searchFields, request);
|
HisQueryUtils.buildQueryWrapper(inventorySearchParam, searchKey, searchFields, request);
|
||||||
// 查询入库单据分页列表
|
// 查询入库单据分页列表
|
||||||
Page<InventoryReceiptPageDto> inventoryReceiptPage =
|
Page<InventoryReceiptPageDto> inventoryReceiptPage = purchaseInventoryMapper.selectInventoryReceiptPage(
|
||||||
HisPageUtils.selectPage(supplyRequestMapper, queryWrapper, pageNo, pageSize, InventoryReceiptPageDto.class);
|
new Page<>(pageNo, pageSize), queryWrapper, SupplyType.PURCHASE_INVENTORY.getValue());
|
||||||
return R.ok(inventoryReceiptPage);
|
return R.ok(inventoryReceiptPage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ import com.openhis.web.inventorymanage.appservice.IReceiptApprovalAppService;
|
|||||||
import com.openhis.web.inventorymanage.assembler.InventoryManageAssembler;
|
import com.openhis.web.inventorymanage.assembler.InventoryManageAssembler;
|
||||||
import com.openhis.web.inventorymanage.dto.ItemChargeDetailDto;
|
import com.openhis.web.inventorymanage.dto.ItemChargeDetailDto;
|
||||||
import com.openhis.web.inventorymanage.dto.SupplyItemDetailDto;
|
import com.openhis.web.inventorymanage.dto.SupplyItemDetailDto;
|
||||||
import com.openhis.web.inventorymanage.mapper.InventoryManageMapper;
|
import com.openhis.web.inventorymanage.mapper.ReceiptApprovalMapper;
|
||||||
import com.openhis.workflow.domain.InventoryItem;
|
import com.openhis.workflow.domain.InventoryItem;
|
||||||
import com.openhis.workflow.domain.SupplyDelivery;
|
import com.openhis.workflow.domain.SupplyDelivery;
|
||||||
import com.openhis.workflow.domain.SupplyRequest;
|
import com.openhis.workflow.domain.SupplyRequest;
|
||||||
@@ -62,7 +62,7 @@ public class ReceiptApprovalAppServiceImpl implements IReceiptApprovalAppService
|
|||||||
@Autowired
|
@Autowired
|
||||||
private TokenService tokenService;
|
private TokenService tokenService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private InventoryManageMapper inventoryManageMapper;
|
private ReceiptApprovalMapper receiptApprovalMapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 校验单据是否正确
|
* 校验单据是否正确
|
||||||
@@ -97,9 +97,9 @@ public class ReceiptApprovalAppServiceImpl implements IReceiptApprovalAppService
|
|||||||
List<SupplyItemDetailDto> supplyItemDetailList;
|
List<SupplyItemDetailDto> supplyItemDetailList;
|
||||||
// 判断供应项是药品还是耗材
|
// 判断供应项是药品还是耗材
|
||||||
if (CommonConstants.TableName.MED_MEDICATION_DEFINITION.equals(itemTable)) {
|
if (CommonConstants.TableName.MED_MEDICATION_DEFINITION.equals(itemTable)) {
|
||||||
supplyItemDetailList = inventoryManageMapper.selectSupplyMedDetail(busNo, EventStatus.COMPLETED.getValue());
|
supplyItemDetailList = receiptApprovalMapper.selectSupplyMedDetail(busNo, EventStatus.COMPLETED.getValue());
|
||||||
} else if (CommonConstants.TableName.ADM_DEVICE.equals(itemTable)) {
|
} else if (CommonConstants.TableName.ADM_DEVICE.equals(itemTable)) {
|
||||||
supplyItemDetailList = inventoryManageMapper.selectSupplyDevDetail(busNo, EventStatus.COMPLETED.getValue());
|
supplyItemDetailList = receiptApprovalMapper.selectSupplyDevDetail(busNo, EventStatus.COMPLETED.getValue());
|
||||||
} else {
|
} else {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -116,7 +116,7 @@ public class ReceiptApprovalAppServiceImpl implements IReceiptApprovalAppService
|
|||||||
public List<ItemChargeDetailDto> getItemChargeDetail(List<Long> itemIdList) {
|
public List<ItemChargeDetailDto> getItemChargeDetail(List<Long> itemIdList) {
|
||||||
// todo:未来会移到charge相关的service中
|
// todo:未来会移到charge相关的service中
|
||||||
if (!itemIdList.isEmpty()) {
|
if (!itemIdList.isEmpty()) {
|
||||||
return inventoryManageMapper.selectChargeDetail(itemIdList);
|
return receiptApprovalMapper.selectChargeDetail(itemIdList);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -169,14 +169,12 @@ public class ReceiptApprovalAppServiceImpl implements IReceiptApprovalAppService
|
|||||||
if (!supplyItemDetailList.isEmpty()) {
|
if (!supplyItemDetailList.isEmpty()) {
|
||||||
// 将供应项目的详细信息装配为库存项目和采购账单
|
// 将供应项目的详细信息装配为库存项目和采购账单
|
||||||
Pair<List<ChargeItem>, List<InventoryItem>> listPair =
|
Pair<List<ChargeItem>, List<InventoryItem>> listPair =
|
||||||
InventoryManageAssembler.assembleChargeAndInventory(supplyItemDetailList, now);
|
InventoryManageAssembler.assembleChargeAndInventory(supplyItemDetailList, now, loginUser);
|
||||||
if (listPair != null) {
|
|
||||||
// 创建已结算的采购财务流水
|
// 创建已结算的采购财务流水
|
||||||
chargeItemService.createBilledPurchaseCharge(listPair.getLeft());
|
chargeItemService.createBilledPurchaseCharge(listPair.getLeft());
|
||||||
// 入库
|
// 入库
|
||||||
inventoryItemService.stockIn(listPair.getRight());
|
inventoryItemService.stockIn(listPair.getRight());
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00004, null));
|
return R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00004, null));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,12 +3,17 @@
|
|||||||
*/
|
*/
|
||||||
package com.openhis.web.inventorymanage.assembler;
|
package com.openhis.web.inventorymanage.assembler;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.apache.commons.lang3.tuple.Pair;
|
import org.apache.commons.lang3.tuple.Pair;
|
||||||
|
|
||||||
|
import com.core.common.core.domain.model.LoginUser;
|
||||||
import com.openhis.administration.domain.ChargeItem;
|
import com.openhis.administration.domain.ChargeItem;
|
||||||
|
import com.openhis.common.constant.CommonConstants;
|
||||||
|
import com.openhis.common.enums.ChargeItemContext;
|
||||||
|
import com.openhis.common.enums.ChargeItemStatus;
|
||||||
import com.openhis.web.inventorymanage.dto.SupplyItemDetailDto;
|
import com.openhis.web.inventorymanage.dto.SupplyItemDetailDto;
|
||||||
import com.openhis.workflow.domain.InventoryItem;
|
import com.openhis.workflow.domain.InventoryItem;
|
||||||
|
|
||||||
@@ -25,10 +30,92 @@ public class InventoryManageAssembler {
|
|||||||
*
|
*
|
||||||
* @param supplyItemDetailList 供应项目的详细信息
|
* @param supplyItemDetailList 供应项目的详细信息
|
||||||
* @param now 当前时间
|
* @param now 当前时间
|
||||||
|
* @param loginUser 登陆者信息
|
||||||
* @return 库存项目和采购账单
|
* @return 库存项目和采购账单
|
||||||
*/
|
*/
|
||||||
public static Pair<List<ChargeItem>, List<InventoryItem>>
|
public static Pair<List<ChargeItem>, List<InventoryItem>>
|
||||||
assembleChargeAndInventory(List<SupplyItemDetailDto> supplyItemDetailList, Date now) {
|
assembleChargeAndInventory(List<SupplyItemDetailDto> supplyItemDetailList, Date now, LoginUser loginUser) {
|
||||||
return null;
|
|
||||||
|
List<ChargeItem> chargeItemList = new ArrayList<>();
|
||||||
|
List<InventoryItem> inventoryItemList = new ArrayList<>();
|
||||||
|
for (SupplyItemDetailDto supplyItemDetailDto : supplyItemDetailList) {
|
||||||
|
|
||||||
|
ChargeItem chargeItem = new ChargeItem();
|
||||||
|
chargeItem
|
||||||
|
// 收费项所在表:供应物品所在表
|
||||||
|
.setProductTable(supplyItemDetailDto.getItemTable())
|
||||||
|
// 收费项id:供应物品id
|
||||||
|
.setProductId(supplyItemDetailDto.getItemId())
|
||||||
|
// 物品数量
|
||||||
|
.setQuantityValue(supplyItemDetailDto.getItemQuantity().longValue())
|
||||||
|
// 物品单位
|
||||||
|
.setQuantityUnit(supplyItemDetailDto.getItemUnit())
|
||||||
|
// 原价
|
||||||
|
.setBaseAmount(supplyItemDetailDto.getBaseAmount())
|
||||||
|
// 总价
|
||||||
|
.setTotalPrice(supplyItemDetailDto.getTotalPrice())
|
||||||
|
// 单价
|
||||||
|
.setUnitPrice(supplyItemDetailDto.getPrice())
|
||||||
|
// 价格定义id
|
||||||
|
.setDefinitionId(supplyItemDetailDto.getDefinitionId())
|
||||||
|
// 价格定义子表id
|
||||||
|
.setDefDetailId(supplyItemDetailDto.getDefDetailId())
|
||||||
|
// 执行人:审批人
|
||||||
|
.setPerformerId(supplyItemDetailDto.getApproverId())
|
||||||
|
// 执行科室:发放目的仓库
|
||||||
|
.setPerformingOrgId(supplyItemDetailDto.getPurposeLocationId())
|
||||||
|
// 收费来源id:供应服务id
|
||||||
|
.setServiceId(supplyItemDetailDto.getServiceId())
|
||||||
|
// 收费来源表:发放请求
|
||||||
|
.setServiceTable(CommonConstants.TableName.WOR_SUPPLY_REQUEST)
|
||||||
|
// 收费状态:已结算
|
||||||
|
.setStatusEnum(ChargeItemStatus.BILLED.getValue())
|
||||||
|
// 收费类型:采购
|
||||||
|
.setContextEnum(ChargeItemContext.PRESCRIPTION.getValue())
|
||||||
|
// 发生时间
|
||||||
|
.setOccurrenceTime(now)
|
||||||
|
// 开立人
|
||||||
|
.setEntererId(loginUser.getUserId())
|
||||||
|
// 开立时间
|
||||||
|
.setEnteredDate(now);
|
||||||
|
|
||||||
|
InventoryItem inventoryItem = new InventoryItem();
|
||||||
|
inventoryItem.setItemId(supplyItemDetailDto.getItemId())
|
||||||
|
// 入库项目所在表
|
||||||
|
.setItemTable(supplyItemDetailDto.getItemTable())
|
||||||
|
// 入库项目
|
||||||
|
.setItemId(supplyItemDetailDto.getItemId())
|
||||||
|
// 入库项目类型
|
||||||
|
.setCategoryEnum(Integer.valueOf(supplyItemDetailDto.getItemCategory()))
|
||||||
|
// 批号
|
||||||
|
.setLotNumber(supplyItemDetailDto.getLotNumber())
|
||||||
|
// 追溯码
|
||||||
|
.setTraceNo(supplyItemDetailDto.getTraceNo())
|
||||||
|
// 供应商
|
||||||
|
.setSupplierId(supplyItemDetailDto.getSupplierId())
|
||||||
|
// 仓库
|
||||||
|
.setLocationId(supplyItemDetailDto.getPurposeLocationId())
|
||||||
|
// 库位
|
||||||
|
.setLocationStoreId(supplyItemDetailDto.getPurposeLocationStoreId())
|
||||||
|
// 过期日期
|
||||||
|
.setExpirationDate(supplyItemDetailDto.getEndTime())
|
||||||
|
// 生产日期
|
||||||
|
.setProductionDate(supplyItemDetailDto.getStartTime())
|
||||||
|
// 项目名
|
||||||
|
.setName(supplyItemDetailDto.getName())
|
||||||
|
// 拼音码
|
||||||
|
.setPyStr(supplyItemDetailDto.getPyStr())
|
||||||
|
// 五笔码
|
||||||
|
.setWbStr(supplyItemDetailDto.getWbStr())
|
||||||
|
// 包装单位
|
||||||
|
.setBaseUnitCode(supplyItemDetailDto.getUnitCode())
|
||||||
|
// 最小单位
|
||||||
|
.setMinUnitCode(supplyItemDetailDto.getMinUnitCode());
|
||||||
|
|
||||||
|
chargeItemList.add(chargeItem);
|
||||||
|
inventoryItemList.add(inventoryItem);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Pair.of(chargeItemList, inventoryItemList);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,21 +34,12 @@ public class InventoryReceiptPageDto implements Serializable {
|
|||||||
/** 单据号 */
|
/** 单据号 */
|
||||||
private String busNo;
|
private String busNo;
|
||||||
|
|
||||||
/** 类型 */
|
|
||||||
private Integer typeEnum;
|
|
||||||
|
|
||||||
/** 状态 */
|
/** 状态 */
|
||||||
private Integer statusEnum;
|
private Integer statusEnum;
|
||||||
|
|
||||||
/** 分类 */
|
|
||||||
private Integer categoryEnum;
|
|
||||||
|
|
||||||
/** 供应商 */
|
/** 供应商 */
|
||||||
private Long supplierId;
|
private Long supplierId;
|
||||||
|
|
||||||
/** 源仓库 */
|
|
||||||
private Long sourceLocationId;
|
|
||||||
|
|
||||||
/** 目的仓库 */
|
/** 目的仓库 */
|
||||||
private Long purposeLocationId;
|
private Long purposeLocationId;
|
||||||
|
|
||||||
|
|||||||
@@ -7,6 +7,10 @@ import java.io.Serializable;
|
|||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||||
|
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||||
|
|
||||||
|
import liquibase.pro.packaged.S;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.experimental.Accessors;
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
@@ -22,6 +26,10 @@ public class SupplyItemDetailDto implements Serializable {
|
|||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** ID */
|
||||||
|
@JsonSerialize(using = ToStringSerializer.class)
|
||||||
|
private Long supplyId;
|
||||||
|
|
||||||
/** 项目 */
|
/** 项目 */
|
||||||
private String itemTable;
|
private String itemTable;
|
||||||
|
|
||||||
@@ -93,4 +101,7 @@ public class SupplyItemDetailDto implements Serializable {
|
|||||||
|
|
||||||
/** 定价子表主键 */
|
/** 定价子表主键 */
|
||||||
private Long defDetailId;
|
private Long defDetailId;
|
||||||
|
|
||||||
|
/** 项目类型 */
|
||||||
|
private String itemCategory;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,35 @@
|
|||||||
|
/*
|
||||||
|
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||||
|
*/
|
||||||
|
package com.openhis.web.inventorymanage.mapper;
|
||||||
|
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.openhis.web.inventorymanage.dto.InventoryReceiptPageDto;
|
||||||
|
import com.openhis.workflow.domain.SupplyRequest;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 采购入库查询用 mapper
|
||||||
|
*
|
||||||
|
* @author zwh
|
||||||
|
* @date 2025-03-10
|
||||||
|
*/
|
||||||
|
@Repository
|
||||||
|
public interface PurchaseInventoryMapper {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询入库单据分页列表
|
||||||
|
*
|
||||||
|
* @param page 分页
|
||||||
|
* @param queryWrapper 查询条件
|
||||||
|
* @param purchaseInventory 单据类型:采购入库
|
||||||
|
* @return 入库单据分页列表
|
||||||
|
*/
|
||||||
|
Page<InventoryReceiptPageDto> selectInventoryReceiptPage(@Param("page") Page<InventoryReceiptPageDto> page,
|
||||||
|
@Param(Constants.WRAPPER) QueryWrapper<SupplyRequest> queryWrapper,
|
||||||
|
@Param("purchaseInventory") Integer purchaseInventory);
|
||||||
|
}
|
||||||
@@ -14,13 +14,13 @@ import com.openhis.web.inventorymanage.dto.SupplyItemDetailDto;
|
|||||||
import com.openhis.workflow.domain.SupplyRequest;
|
import com.openhis.workflow.domain.SupplyRequest;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 库存管理查询用 mapper
|
* 单据审批查询用 mapper
|
||||||
*
|
*
|
||||||
* @author zwh
|
* @author zwh
|
||||||
* @date 2025-02-25
|
* @date 2025-02-25
|
||||||
*/
|
*/
|
||||||
@Repository
|
@Repository
|
||||||
public interface InventoryManageMapper extends BaseMapper<SupplyRequest> {
|
public interface ReceiptApprovalMapper extends BaseMapper<SupplyRequest> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取药品供应单据详细信息
|
* 获取药品供应单据详细信息
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!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.PurchaseInventoryMapper">
|
||||||
|
|
||||||
|
<select id="selectInventoryReceiptPage"
|
||||||
|
resultType="com.openhis.web.inventorymanage.dto.InventoryReceiptPageDto">
|
||||||
|
SELECT id,
|
||||||
|
bus_no,
|
||||||
|
status_enum,
|
||||||
|
supplier_id,
|
||||||
|
purpose_location_id,
|
||||||
|
approver_id,
|
||||||
|
approval_time,
|
||||||
|
applicant_id,
|
||||||
|
apply_time,
|
||||||
|
purpose_location_id
|
||||||
|
FROM wor_supply_request
|
||||||
|
WHERE type_enum = #{purchaseInventory}
|
||||||
|
GROUP BY id,
|
||||||
|
bus_no,
|
||||||
|
status_enum,
|
||||||
|
supplier_id,
|
||||||
|
purpose_location_id,
|
||||||
|
approver_id,
|
||||||
|
approval_time,
|
||||||
|
applicant_id,
|
||||||
|
apply_time,
|
||||||
|
purpose_location_id
|
||||||
|
ORDER BY bus_no desc
|
||||||
|
${ew.customSqlSegment}
|
||||||
|
</select>
|
||||||
|
</mapper>
|
||||||
@@ -1,9 +1,10 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" ?>
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
<!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">
|
<mapper namespace="com.openhis.web.inventorymanage.mapper.ReceiptApprovalMapper">
|
||||||
|
|
||||||
<select id="selectSupplyMedDetail" resultType="com.openhis.web.inventorymanage.dto.SupplyItemDetailDto">
|
<select id="selectSupplyMedDetail" resultType="com.openhis.web.inventorymanage.dto.SupplyItemDetailDto">
|
||||||
SELECT T1.item_table,
|
SELECT T1.id AS supply_id
|
||||||
|
T1.item_table,
|
||||||
T1.item_id,
|
T1.item_id,
|
||||||
T1.item_quantity,
|
T1.item_quantity,
|
||||||
T1.unit_code AS item_unit,
|
T1.unit_code AS item_unit,
|
||||||
@@ -26,9 +27,10 @@
|
|||||||
T2.wb_str,
|
T2.wb_str,
|
||||||
T2.unit_code,
|
T2.unit_code,
|
||||||
T2.min_unit_code,
|
T2.min_unit_code,
|
||||||
|
T2.category_code AS item_category,
|
||||||
T3.id AS definition_id,
|
T3.id AS definition_id,
|
||||||
T4.amount AS base_amount,
|
T4.amount AS base_amount,
|
||||||
T4.id AS applicability_id
|
T4.id AS def_detail_id
|
||||||
FROM wor_supply_request AS T1
|
FROM wor_supply_request AS T1
|
||||||
LEFT JOIN wor_supply_delivery AS T5
|
LEFT JOIN wor_supply_delivery AS T5
|
||||||
ON T1.id = T5.request_id
|
ON T1.id = T5.request_id
|
||||||
@@ -66,6 +66,11 @@ public class CommonConstants {
|
|||||||
* 活动定义
|
* 活动定义
|
||||||
*/
|
*/
|
||||||
String WOR_ACTIVITY_DEFINITION = "wor_activity_definition";
|
String WOR_ACTIVITY_DEFINITION = "wor_activity_definition";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发放请求
|
||||||
|
*/
|
||||||
|
String WOR_SUPPLY_REQUEST = "wor_supply_request";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -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-10
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@AllArgsConstructor
|
||||||
|
public enum ChargeItemContext {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 采购
|
||||||
|
*/
|
||||||
|
PURCHASE(1, "采购"),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 处方
|
||||||
|
*/
|
||||||
|
PRESCRIPTION(2, "处方");
|
||||||
|
|
||||||
|
private Integer value;
|
||||||
|
private String info;
|
||||||
|
|
||||||
|
public static ChargeItemContext getByValue(Integer value) {
|
||||||
|
if (value == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
for (ChargeItemContext val : values()) {
|
||||||
|
if (val.getValue().equals(value)) {
|
||||||
|
return val;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,28 +1,60 @@
|
|||||||
package com.openhis.common.enums;
|
package com.openhis.common.enums;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.EnumValue;
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public enum ChargeItemStatus implements HisEnumInterface {
|
public enum ChargeItemStatus implements HisEnumInterface {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 待收费
|
||||||
|
*/
|
||||||
PLANNED(1, "planned", "待收费"),
|
PLANNED(1, "planned", "待收费"),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 待结算
|
||||||
|
*/
|
||||||
BILLABLE(2, "billable", "待结算"),
|
BILLABLE(2, "billable", "待结算"),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 不可收费
|
||||||
|
*/
|
||||||
NOT_BILLABLE(3, "not-billable", "不可收费"),
|
NOT_BILLABLE(3, "not-billable", "不可收费"),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 终止
|
||||||
|
*/
|
||||||
ABORTED(4, "aborted", "终止"),
|
ABORTED(4, "aborted", "终止"),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 已结算
|
||||||
|
*/
|
||||||
BILLED(5, "billed ", "已结算"),
|
BILLED(5, "billed ", "已结算"),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 错误
|
||||||
|
*/
|
||||||
ERROR(6, "entered-in-error", "错误"),
|
ERROR(6, "entered-in-error", "错误"),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 未知
|
||||||
|
*/
|
||||||
UNKNOWN(7, "unknown", "未知");
|
UNKNOWN(7, "unknown", "未知");
|
||||||
|
|
||||||
@EnumValue
|
|
||||||
private final Integer value;
|
private final Integer value;
|
||||||
private final String code;
|
private final String code;
|
||||||
private final String info;
|
private final String info;
|
||||||
|
|
||||||
|
public static ChargeItemStatus getByValue(Integer value) {
|
||||||
|
if (value == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
for (ChargeItemStatus val : values()) {
|
||||||
|
if (val.getValue().equals(value)) {
|
||||||
|
return val;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,53 @@
|
|||||||
|
/*
|
||||||
|
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||||
|
*/
|
||||||
|
package com.openhis.common.enums;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目类型
|
||||||
|
*
|
||||||
|
* @author zwh
|
||||||
|
* @date 2025-03-10
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@AllArgsConstructor
|
||||||
|
public enum ItemCategory {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 中药
|
||||||
|
*/
|
||||||
|
CHINESE_MEDICINE(1, "中药"),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 西药
|
||||||
|
*/
|
||||||
|
WESTERN_MEDICINE(2, "西药"),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 中成药
|
||||||
|
*/
|
||||||
|
CHINESE_PATENT_MEDICINE(3, "中成药"),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 医疗耗材
|
||||||
|
*/
|
||||||
|
MEDICAL_CONSUMABLES(4, "医疗耗材");
|
||||||
|
|
||||||
|
private Integer value;
|
||||||
|
private String info;
|
||||||
|
|
||||||
|
public static ItemCategory getByValue(Integer value) {
|
||||||
|
if (value == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
for (ItemCategory val : values()) {
|
||||||
|
if (val.getValue().equals(value)) {
|
||||||
|
return val;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.annotation.TableId;
|
|||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import com.core.common.core.domain.HisBaseEntity;
|
import com.core.common.core.domain.HisBaseEntity;
|
||||||
|
|
||||||
|
import liquibase.pro.packaged.S;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
import lombok.experimental.Accessors;
|
import lombok.experimental.Accessors;
|
||||||
@@ -62,7 +63,7 @@ public class ChargeItem extends HisBaseEntity {
|
|||||||
private Long quantityValue;
|
private Long quantityValue;
|
||||||
|
|
||||||
/** 单位 */
|
/** 单位 */
|
||||||
private Long quantityUnit;
|
private String quantityUnit;
|
||||||
|
|
||||||
/** 单价 */
|
/** 单价 */
|
||||||
private BigDecimal unitPrice;
|
private BigDecimal unitPrice;
|
||||||
|
|||||||
@@ -21,8 +21,6 @@ import lombok.AllArgsConstructor;
|
|||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class ChargeItemServiceImpl extends ServiceImpl<ChargeItemMapper, ChargeItem> implements IChargeItemService {
|
public class ChargeItemServiceImpl extends ServiceImpl<ChargeItemMapper, ChargeItem> implements IChargeItemService {
|
||||||
|
|
||||||
private final ChargeItemMapper chargeItemMapper;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建已计费的采购账单
|
* 创建已计费的采购账单
|
||||||
*
|
*
|
||||||
@@ -30,7 +28,12 @@ public class ChargeItemServiceImpl extends ServiceImpl<ChargeItemMapper, ChargeI
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void createBilledPurchaseCharge(List<ChargeItem> chargeItemList) {
|
public void createBilledPurchaseCharge(List<ChargeItem> chargeItemList) {
|
||||||
|
for (ChargeItem chargeItem : chargeItemList) {
|
||||||
|
// 此判断是为了避免插入时主键重复
|
||||||
|
if (chargeItem.getId() == null) {
|
||||||
|
baseMapper.insert(chargeItem);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -6,8 +6,8 @@ import java.util.Date;
|
|||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
|
||||||
import com.core.common.core.domain.HisBaseEntity;
|
import com.core.common.core.domain.HisBaseEntity;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
import lombok.experimental.Accessors;
|
import lombok.experimental.Accessors;
|
||||||
@@ -67,12 +67,6 @@ public class InventoryItem extends HisBaseEntity {
|
|||||||
/** 当前库存数量(最小单位数量) */
|
/** 当前库存数量(最小单位数量) */
|
||||||
private BigDecimal minQuantity;
|
private BigDecimal minQuantity;
|
||||||
|
|
||||||
/** 最小库存警戒数量(常规单位) */
|
|
||||||
private BigDecimal itemMinQuantity;
|
|
||||||
|
|
||||||
/** 最大库存警戒数量(常规单位) */
|
|
||||||
private BigDecimal itemMaxQuantity;
|
|
||||||
|
|
||||||
/** 特征 */
|
/** 特征 */
|
||||||
private String characteristicJson;
|
private String characteristicJson;
|
||||||
|
|
||||||
@@ -88,10 +82,10 @@ public class InventoryItem extends HisBaseEntity {
|
|||||||
/** 有效期(月) */
|
/** 有效期(月) */
|
||||||
private Integer validityMon;
|
private Integer validityMon;
|
||||||
|
|
||||||
/** 仓库 */
|
/** 库位 */
|
||||||
private Long locationStoreId;
|
private Long locationStoreId;
|
||||||
|
|
||||||
/** 库位 */
|
/** 仓库 */
|
||||||
private Long locationId;
|
private Long locationId;
|
||||||
|
|
||||||
/** 追溯码 */
|
/** 追溯码 */
|
||||||
@@ -100,5 +94,4 @@ public class InventoryItem extends HisBaseEntity {
|
|||||||
/** 追溯码包装层级 */
|
/** 追溯码包装层级 */
|
||||||
private Integer packagingLevels;
|
private Integer packagingLevels;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -5,6 +5,7 @@ import java.util.List;
|
|||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.core.common.core.domain.R;
|
import com.core.common.core.domain.R;
|
||||||
|
import com.core.common.core.domain.model.LoginUser;
|
||||||
import com.openhis.workflow.domain.SupplyDelivery;
|
import com.openhis.workflow.domain.SupplyDelivery;
|
||||||
import com.openhis.workflow.domain.SupplyRequest;
|
import com.openhis.workflow.domain.SupplyRequest;
|
||||||
|
|
||||||
@@ -20,7 +21,7 @@ public interface ISupplyDeliveryService extends IService<SupplyDelivery> {
|
|||||||
* 根据单据,发放物品
|
* 根据单据,发放物品
|
||||||
*
|
*
|
||||||
* @param supplyRequestList 单据信息
|
* @param supplyRequestList 单据信息
|
||||||
* @param supplyRequestList 单据信息
|
* @param now 当前时间
|
||||||
*/
|
*/
|
||||||
List<SupplyDelivery> createCompletedSupplyDelivery(List<SupplyRequest> supplyRequestList, Date now);
|
List<SupplyDelivery> createCompletedSupplyDelivery(List<SupplyRequest> supplyRequestList, Date now);
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.openhis.workflow.service.impl;
|
package com.openhis.workflow.service.impl;
|
||||||
|
|
||||||
|
import com.openhis.administration.domain.ChargeItem;
|
||||||
import com.openhis.workflow.domain.SupplyRequest;
|
import com.openhis.workflow.domain.SupplyRequest;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
@@ -26,6 +27,11 @@ public class InventoryItemServiceImpl extends ServiceImpl<InventoryItemMapper, I
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void stockIn(List<InventoryItem> inventoryItemList) {
|
public void stockIn(List<InventoryItem> inventoryItemList) {
|
||||||
|
for (InventoryItem inventoryItem : inventoryItemList) {
|
||||||
|
// 此判断是为了避免插入时主键重复
|
||||||
|
if (inventoryItem.getId() == null) {
|
||||||
|
baseMapper.insert(inventoryItem);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user