Junjie
2024-09-13 a1a7c03eae40f4b0344fce652e1a240cf5283624
zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/service/impl/WorkServiceImpl.java
@@ -8,6 +8,7 @@
import com.zy.asrs.wms.asrs.entity.param.GeneratePakInParam;
import com.zy.asrs.wms.asrs.service.*;
import com.zy.asrs.wms.utils.LocUtils;
import com.zy.asrs.wms.utils.OrderUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -57,6 +58,8 @@
    private LocTypeService locTypeService;
    @Autowired
    private MatService matService;
    @Autowired
    private OrderUtils orderUtils;
    @Override
    public String generateTaskNo(Long taskType) {
@@ -496,19 +499,7 @@
            //回滚订单
            for (TaskDetl taskDetl : taskDetls) {
                if (taskDetl.getDetlId() != null) {
                    OrderDetl orderDetl = orderDetlService.getById(taskDetl.getDetlId());
                    if(orderDetl == null){
                        throw new CoolException("订单明细不存在");
                    }
                    //回滚工作数量
                    orderDetl.setWorkQty(orderDetl.getWorkQty() - taskDetl.getAnfme());
                    orderDetl.setUpdateTime(new Date());
                    boolean orderDetlUpdate = orderDetlService.updateById(orderDetl);
                    if(!orderDetlUpdate){
                        throw new CoolException("工作数量回滚失败");
                    }
                    orderUtils.updateWorkQty(taskDetl.getDetlId(), taskDetl.getAnfme(), false);
                }
                //入库回滚组托通知档
@@ -586,7 +577,7 @@
        }
        //获取源库位高度
        LocTypeBind locTypeBind = locTypeBindService.getOne(new LambdaQueryWrapper<LocTypeBind>().eq(LocTypeBind::getLocId, originLoc.getId()));
        LocTypeBind locTypeBind = locTypeBindService.getOne(new LambdaQueryWrapper<LocTypeBind>().eq(LocTypeBind::getLocId, originLoc.getId()).in(LocTypeBind::getTypeId, LocBindType.HEIGHT.list()));
        if(locTypeBind == null){
            throw new CoolException("库位类型不存在");
        }