采购入库
This commit is contained in:
@@ -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);
|
||||
}
|
||||
@@ -46,7 +46,7 @@ public class ChargeItemDefAppServiceImpl extends ServiceImpl<ChargeItemDefAppMap
|
||||
*/
|
||||
@Override
|
||||
public boolean addChargeItemDefApp(ChargeItemDefApp chargeItemDefApp) {
|
||||
//此判断是为了避免插入时主键重复
|
||||
// 此判断是为了避免插入时主键重复
|
||||
if (chargeItemDefApp.getId() != null) {
|
||||
return false;
|
||||
} else {
|
||||
|
||||
@@ -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业务层处理
|
||||
@@ -21,24 +20,24 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
*/
|
||||
@Service
|
||||
public class ChargeItemDefinitionServiceImpl extends ServiceImpl<ChargeItemDefinitionMapper, ChargeItemDefinition>
|
||||
implements IChargeItemDefinitionService {
|
||||
implements IChargeItemDefinitionService {
|
||||
|
||||
/**
|
||||
* 获取分页列表
|
||||
*
|
||||
* @param chargeItemDefinition 查询条件
|
||||
* @param pageNo 页码
|
||||
* @param pageSize 页面大小
|
||||
* @param pageNo 页码
|
||||
* @param pageSize 页面大小
|
||||
* @return 分页列表
|
||||
*/
|
||||
@Override
|
||||
public Page<ChargeItemDefinition> getPage(ChargeItemDefinition chargeItemDefinition, Integer pageNo,
|
||||
Integer pageSize) {
|
||||
Integer pageSize) {
|
||||
|
||||
LambdaQueryWrapper<ChargeItemDefinition> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(ChargeItemDefinition::getDeleteFlag, DelFlag.NO.getValue());
|
||||
|
||||
//拼接查询条件
|
||||
// 拼接查询条件
|
||||
if (chargeItemDefinition.getStatusEnum() != null) {
|
||||
queryWrapper.eq(ChargeItemDefinition::getStatusEnum, chargeItemDefinition.getStatusEnum());
|
||||
}
|
||||
@@ -54,7 +53,7 @@ public class ChargeItemDefinitionServiceImpl extends ServiceImpl<ChargeItemDefin
|
||||
*/
|
||||
@Override
|
||||
public boolean addChargeItemDefinition(ChargeItemDefinition chargeItemDefinition) {
|
||||
//此判断是为了避免插入时主键重复
|
||||
// 此判断是为了避免插入时主键重复
|
||||
if (chargeItemDefinition.getId() != null) {
|
||||
return false;
|
||||
} else {
|
||||
@@ -77,16 +76,16 @@ public class ChargeItemDefinitionServiceImpl extends ServiceImpl<ChargeItemDefin
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 通过服务管理新增费用定价
|
||||
*
|
||||
* @param healthcareService 服务管理
|
||||
* @param healthcareService 服务管理
|
||||
* @param chargeItemDefinition 费用定价
|
||||
* @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 保存结果
|
||||
*/
|
||||
@Override
|
||||
public boolean saveChargeItem(ChargeItem chargeItem) {
|
||||
// 假设此处有业务相关处理
|
||||
if (chargeItem.getBusNo() == null) {
|
||||
return false;
|
||||
}
|
||||
return chargeItemMapper.insert(chargeItem) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新收费项目
|
||||
* 创建已计费的采购账单
|
||||
*
|
||||
* @param chargeItem 更新内容
|
||||
* @return 更新结果
|
||||
* @param chargeItemList 采购账单
|
||||
*/
|
||||
@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;
|
||||
}
|
||||
public void createBilledPurchaseCharge(List<ChargeItem> chargeItemList) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
// 返回入库信息列表
|
||||
return supplyRequestList;
|
||||
/**
|
||||
* 同意申请
|
||||
*
|
||||
* @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);
|
||||
}
|
||||
|
||||
/**
|
||||
* 提交审批
|
||||
*
|
||||
* @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