#
luxiaotao1123
2021-03-31 c8f89c1e9353d6e530b8b7fe93c15686251b7d65
src/main/java/zy/cloud/wms/manager/service/impl/WorkServiceImpl.java
@@ -1,18 +1,17 @@
package zy.cloud.wms.manager.service.impl;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.core.common.Cools;
import com.core.common.DateUtils;
import com.core.common.R;
import com.core.common.SnowflakeIdWorker;
import com.core.common.*;
import com.core.exception.CoolException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import zy.cloud.wms.common.config.CodeCoolException;
import zy.cloud.wms.common.model.BillDto;
import zy.cloud.wms.common.model.OrderStoDto;
import zy.cloud.wms.common.service.MainService;
import zy.cloud.wms.common.service.asrs.AsrsService;
import zy.cloud.wms.common.service.asrs.entity.Result1;
import zy.cloud.wms.common.service.erp.ErpService;
import zy.cloud.wms.common.utils.VersionUtils;
import zy.cloud.wms.manager.entity.*;
@@ -370,6 +369,7 @@
                    dto.getCount(),    // 商品数量
                    dto.getCount(),    // 总数量
                    Cools.isEmpty(mat.getName())?0.0D:Double.parseDouble(mat.getName()),    // 商品单价
                    null,       // 商品明细行号
                    null,    // 商品备注[空]
                    1,    // 状态
                    now,    // 添加时间
@@ -419,6 +419,28 @@
    }
    @Override
    public R asrsStockTransfer(AsrsTransferParam param, Long userId) {
        if (Cools.isEmpty(param.getNode_id(), param.getMatnr(), param.getSafe_qua(), param.getAmount())) {
            return R.error("数量错误");
        }
        List<StockTransferParam> params = new ArrayList<>();
        StockTransferParam transferParam = new StockTransferParam();
        transferParam.setMatnr(param.getMatnr());
        transferParam.setAnfme(Arith.subtract(2, param.getSafe_qua(), param.getAmount()));
        transferParam.setAllotNo(param.getNode_id()+ "_" +param.getMatnr());
        params.add(transferParam);
        Result1 result = asrsService.stockTransfer(params);
        if (result.getCode() == 500) {
            if (Cools.isEmpty(result.getData())) {
                throw new CoolException(result.getMsg());
            } else {
                throw new CodeCoolException("20001-" + result.getData());
            }
        }
        return R.ok("补仓成功,等待立库调拨");
    }
    @Override
    public R stockCheck(StoCheckParam param, Long userId) {
        if (Cools.isEmpty(param.getLocNo())) {
            return R.error("请选择货位");