自动化立体仓库 - WMS系统
#
LSH
2023-12-27 9b14697f5146ade2e81db8269824f79c9bc6ac62
src/main/java/com/zy/asrs/service/impl/ManLocDetlServiceImpl.java
@@ -12,6 +12,7 @@
import com.zy.asrs.service.MatService;
import com.zy.asrs.service.NodeService;
import com.zy.asrs.utils.SaasUtils;
import com.zy.system.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -142,11 +143,12 @@
    @Transactional
    @Override
    public void adjustLocDetl(LocDetlAdjustParam param, Long userId) {
    public void adjustLocDetl(LocDetlAdjustParam param, Long userId, User user) {
        Date now = new Date();
        this.baseMapper.delete(new EntityWrapper<ManLocDetl>()
                .eq("loc_no", param.getLocNo()));
        for (LocDetlAdjustParam.LocDetlAdjust locDetlAdjust : param.getList()) {
            ManLocDetl manLocDetl = this.baseMapper.selectItem(param.getLocNo(), locDetlAdjust.getMatnr(), locDetlAdjust.getBatch());
            this.baseMapper.delete(new EntityWrapper<ManLocDetl>()
                    .eq("loc_no", param.getLocNo()).eq("matnr",locDetlAdjust.getMatnr()));
            Mat mat = matService.selectOne(new EntityWrapper<Mat>()
                    .eq("matnr", locDetlAdjust.getMatnr()));
            if (mat == null) {
@@ -158,21 +160,10 @@
                throw new CoolException("无法找到需要调整的库位,请联系管理员");
            }
            ManLocDetl manLocDetl = new ManLocDetl();
            manLocDetl.setLocNo(param.getLocNo());
            manLocDetl.setNodeId(node.getId());
            manLocDetl.setZpallet(mat.getBarcode());
            manLocDetl.setAnfme(locDetlAdjust.getCount());
            manLocDetl.setMatnr(mat.getMatnr());
            manLocDetl.setMaktx(mat.getMaktx());
            manLocDetl.setName(mat.getName());
            manLocDetl.setSpecs(mat.getSpecs());
            manLocDetl.setModel(mat.getModel());
            manLocDetl.setBatch(locDetlAdjust.getBatch());
            manLocDetl.setUnit(mat.getUnit());
            manLocDetl.setBarcode(mat.getBarcode());
            manLocDetl.setPrice(mat.getPrice());
            SaasUtils.insertLog(3,manLocDetl.getLocNo(), manLocDetl.getMatnr(),manLocDetl.getAnfme());
            manLocDetl.setUpdateBy(userId);
            manLocDetl.setModiTime(now);
            SaasUtils.insertLog(3,manLocDetl.getLocNo(), manLocDetl.getMatnr(),manLocDetl.getAnfme(),user.getUsername());
            this.baseMapper.insert(manLocDetl);
        }
    }