chen.lin
1 天以前 b1123ede8199b691d6d684af6b3b58b223b6bdae
rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/AsnOrderServiceImpl.java
@@ -143,6 +143,10 @@
     * @param loginUserId
     * @return
     */
    /** 入库单业务类型:拣料入库、盘点入库等不可修改明细,此处为字典 value,按实际配置补充 */
    private static final Set<String> ASN_WKTYPE_NO_EDIT = Collections.unmodifiableSet(new HashSet<>(
            Arrays.asList("53", "57"))); // 53=拣料再入库 57=盘点再入库(与 TaskType 一致,若字典不同请改为实际 value)
    @Override
    @Transactional(rollbackFor = Exception.class)
    public R updateOrderItem(AsnOrderAndItemsParams params, Long loginUserId) throws Exception {
@@ -153,11 +157,23 @@
        if (Objects.isNull(orders.getId())) {
            throw new CoolException("数据错误:单据ID不能为空!!");
        }
        if (!this.updateById(orders)) {
            throw new CoolException("主单修改失败!!");
        WkOrder currentOrder = this.getById(orders.getId());
        if (Objects.isNull(currentOrder)) {
            throw new CoolException("单据不存在!!");
        }
        // 仅未执行状态可修改
        if (!Objects.equals(currentOrder.getExceStatus(), AsnExceStatus.ASN_EXCE_STATUS_UN_EXCE.val)) {
            throw new CoolException("当前单据状态不允许修改,仅未执行状态可修改");
        }
        // 拣料入库、盘点入库类型不可修改
        if (StringUtils.isNotBlank(currentOrder.getWkType()) && ASN_WKTYPE_NO_EDIT.contains(currentOrder.getWkType())) {
            throw new CoolException("拣料入库、盘点入库类型的单据不能修改");
        }
        if (Objects.isNull(params.getItems()) || params.getItems().isEmpty()) {
            return R.ok("明细参数不能为空!!");
            throw new CoolException("明细参数不能为空!!");
        }
        if (!this.updateById(orders)) {
            throw new CoolException("主单修改失败!!");
        }
        svaeOrUpdateOrderItem(params, loginUserId);