自动化立体仓库 - WMS系统
zyx
2024-03-04 e0004817f2edb903fd9707b194ba8db2429e33ae
src/main/java/com/zy/asrs/service/impl/PlaServiceImpl.java
@@ -2,6 +2,7 @@
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.core.common.Cools;
import com.core.exception.CoolException;
@@ -124,7 +125,8 @@
            pla.setStatus(GlobleParameter.PLA_STATUS_1);
            this.updateById(pla);
            SaasUtils.insertLog(0,pla.getLocNo(),pla.getBrand(),plaQty.getOrderWeight(),user.getUsername(),null,pla.getBatch(),pla.getPackageNo());
            SaasUtils.insertLog(0,pla.getLocNo(),pla.getBrand(),plaQty.getOrderWeight(),user.getUsername(),
                    null,pla.getBatch(),pla.getPackageNo(),pla.getOwner(),pla.getWorkshop());
        });
    }
@@ -147,4 +149,28 @@
    public List<Pla> selectToHistory() {
        return this.selectList(new EntityWrapper<Pla>().eq("status",GlobleParameter.PLA_STATUS_4));
    }
    @Override
    public Page<Pla> getStockStatisAll(Page<Pla> page) {
        List<Pla> plaList;
        if(Cools.isEmpty(page.getCondition().get("brand"))){
            plaList=baseMapper.getStockStatisAll();
        }else {
            plaList = baseMapper.getStockStatisAllByBrand(page.getCondition().get("brand").toString());
        }
        double weightSum = plaList.stream().mapToDouble(Pla::getWeight).sum();
        // 最后一条记录仅供合计重量信息展示
        Pla pla = new Pla();
        pla.setBrand("合计");
        pla.setMatnr("");
        pla.setWeight(weightSum);
        plaList.add(pla);
        page.setRecords(plaList);
        page.setTotal(0);
        return page;
    }
}