2026-06-25 16:53:21 +08:00
|
|
|
|
package com.klp.erp.service;
|
|
|
|
|
|
|
|
|
|
|
|
import com.klp.common.core.domain.PageQuery;
|
|
|
|
|
|
import com.klp.common.core.page.TableDataInfo;
|
|
|
|
|
|
import com.klp.erp.domain.bo.ErpPurchasePlanAuditBo;
|
|
|
|
|
|
import com.klp.erp.domain.bo.ErpPurchasePlanBo;
|
|
|
|
|
|
import com.klp.erp.domain.vo.ErpContractOptionVo;
|
|
|
|
|
|
import com.klp.erp.domain.vo.ErpPurchasePlanAuditLogVo;
|
2026-06-27 10:40:54 +08:00
|
|
|
|
import com.klp.erp.domain.vo.ErpPurchasePlanDeliveryBatchVo;
|
2026-06-25 16:53:21 +08:00
|
|
|
|
import com.klp.erp.domain.vo.ErpPurchasePlanDeliveryVo;
|
|
|
|
|
|
import com.klp.erp.domain.vo.ErpPurchasePlanItemVo;
|
|
|
|
|
|
import com.klp.erp.domain.vo.ErpPurchasePlanVo;
|
|
|
|
|
|
|
|
|
|
|
|
import java.io.InputStream;
|
|
|
|
|
|
import java.util.Collection;
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 采购计划Service接口
|
|
|
|
|
|
*
|
|
|
|
|
|
* @author klp
|
|
|
|
|
|
* @date 2026-06-22
|
|
|
|
|
|
*/
|
|
|
|
|
|
public interface IErpPurchasePlanService {
|
|
|
|
|
|
|
|
|
|
|
|
/** 查询采购计划详情(含明细、关联合同、进度) */
|
|
|
|
|
|
ErpPurchasePlanVo queryById(Long planId);
|
|
|
|
|
|
|
|
|
|
|
|
/** 按销售合同ID批量取明细(来自 crm_order_item),用于「选合同自动带出明细」 */
|
|
|
|
|
|
List<ErpPurchasePlanItemVo> queryItemsByOrders(List<Long> orderIds);
|
|
|
|
|
|
|
|
|
|
|
|
/** 合同列表分页(含每个合同已有的采购计划数),用于采购计划页左侧 */
|
|
|
|
|
|
TableDataInfo<ErpContractOptionVo> queryContractPage(String keyword, PageQuery pageQuery);
|
|
|
|
|
|
|
|
|
|
|
|
/** 某合同下的所有采购计划 */
|
|
|
|
|
|
List<ErpPurchasePlanVo> queryPlansByContract(Long orderId);
|
|
|
|
|
|
|
|
|
|
|
|
/** 分页查询采购计划 */
|
|
|
|
|
|
TableDataInfo<ErpPurchasePlanVo> queryPageList(ErpPurchasePlanBo bo, PageQuery pageQuery);
|
|
|
|
|
|
|
|
|
|
|
|
/** 查询采购计划列表 */
|
|
|
|
|
|
List<ErpPurchasePlanVo> queryList(ErpPurchasePlanBo bo);
|
|
|
|
|
|
|
|
|
|
|
|
/** 新增采购计划(含明细、合同挂接) */
|
|
|
|
|
|
Boolean insertByBo(ErpPurchasePlanBo bo);
|
|
|
|
|
|
|
|
|
|
|
|
/** 修改采购计划(含明细、合同挂接) */
|
|
|
|
|
|
Boolean updateByBo(ErpPurchasePlanBo bo);
|
|
|
|
|
|
|
|
|
|
|
|
/** 校验并批量删除采购计划 */
|
|
|
|
|
|
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
|
|
|
|
|
|
|
|
|
|
|
/** 审核(通过/驳回 + 申请意见),每次审核留痕 */
|
|
|
|
|
|
Boolean audit(ErpPurchasePlanAuditBo bo, String operator);
|
|
|
|
|
|
|
|
|
|
|
|
/** 送审 / 重新送审:待送审(3) 或 已驳回(2) → 待审核(0),之后才进入审核页 */
|
|
|
|
|
|
Boolean submitForAudit(Long planId);
|
|
|
|
|
|
|
|
|
|
|
|
/** 某计划的审核历史 */
|
|
|
|
|
|
List<ErpPurchasePlanAuditLogVo> queryAuditLogs(Long planId);
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 导入到货 Excel:校验列/数值、kg→t 单位纠正,写入并刷新进度归档。
|
|
|
|
|
|
* 返回 {count: 入库条数, message: 回执文案, kgConverted: 是否做了单位换算}
|
|
|
|
|
|
*/
|
2026-06-27 10:40:54 +08:00
|
|
|
|
Map<String, Object> importDelivery(Long planId, InputStream inputStream, String fileName, String operator);
|
2026-06-25 16:53:21 +08:00
|
|
|
|
|
2026-06-27 10:40:54 +08:00
|
|
|
|
/** 查询某计划的到货明细(matched 标记是否与明细卷号匹配) */
|
2026-06-25 16:53:21 +08:00
|
|
|
|
List<ErpPurchasePlanDeliveryVo> queryDeliveryList(Long planId);
|
|
|
|
|
|
|
2026-06-27 10:40:54 +08:00
|
|
|
|
/** 某计划下指定批次的到货明细 */
|
|
|
|
|
|
List<ErpPurchasePlanDeliveryVo> queryDeliveryListByBatch(Long batchId);
|
|
|
|
|
|
|
|
|
|
|
|
/** 某计划的到货上传批次(最新在前) */
|
|
|
|
|
|
List<ErpPurchasePlanDeliveryBatchVo> queryDeliveryBatches(Long planId);
|
|
|
|
|
|
|
|
|
|
|
|
/** 到货记录页左侧:审核通过的计划分页(含合同号、明细数、进度) */
|
|
|
|
|
|
TableDataInfo<ErpPurchasePlanVo> queryDeliveryPlanPage(String keyword, PageQuery pageQuery);
|
|
|
|
|
|
|
2026-06-25 16:53:21 +08:00
|
|
|
|
/** 删除到货明细,并刷新进度 */
|
|
|
|
|
|
Boolean deleteDelivery(Long deliveryId);
|
|
|
|
|
|
|
|
|
|
|
|
/** 刷新到货进度:arrivedWeight = Σ单卷重量;满 100% 自动归档 */
|
|
|
|
|
|
void refreshProgress(Long planId);
|
|
|
|
|
|
|
|
|
|
|
|
/** 总体到货进度统计(已完成 N / 共 M) */
|
|
|
|
|
|
Map<String, Object> statistics(ErpPurchasePlanBo bo);
|
|
|
|
|
|
}
|