自动化立体仓库 - WMS系统
zyx
2024-01-08 71d838e032d13a46a07917f5606862496220ea74
src/main/java/com/zy/asrs/service/impl/PlaServiceImpl.java
@@ -10,6 +10,8 @@
import com.zy.asrs.mapper.PlaMapper;
import com.zy.asrs.service.PlaQtyService;
import com.zy.asrs.service.PlaService;
import com.zy.asrs.utils.Utils;
import com.zy.system.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -84,4 +86,32 @@
        }
    }
    //退回
    public void returned(List<PlaQty> plaQties, User user) {
        plaQties.forEach(plaQty -> {
            PlaQty plaQtyOut = plaQtyService.selectById(plaQty.getId());
            plaQtyOut.setReturned(1);
            plaQtyService.updateById(plaQtyOut);
            PlaQty plaQtyReturned = new PlaQty();
            plaQtyReturned.setBatch(plaQtyOut.getBatch());
            plaQtyReturned.setPackageNo(plaQtyOut.getPackageNo());
            plaQtyReturned.setCreateTime(new Date());
            plaQtyReturned.setLocNo(plaQtyOut.getLocNo());
            plaQtyReturned.setOrderNo(plaQtyOut.getOrderNo());
            plaQtyReturned.setPakoutTime(Utils.getDateStr(new Date()));
            plaQtyReturned.setOrderWeight(0 - plaQtyOut.getOrderWeight());
            plaQtyReturned.setHandlerBy(user.getUsername());
            plaQtyReturned.setCustomer(plaQtyOut.getCustomer());
            plaQtyReturned.setMemo(plaQty.getMemo());
            plaQtyService.insert(plaQtyReturned);
            Pla pla = this.selectByBatchAndPackageNo(plaQty.getBatch(), plaQty.getPackageNo());
            pla.setStatus("待入库");
            this.updateById(pla);
        });
    }
}