自动化立体仓库 - WMS系统
lsh
12 小时以前 f543f2b2df318ce42111fbe9727a1fb7c7a588d6
src/main/java/com/zy/asrs/service/impl/OpenServiceImpl.java
@@ -9,6 +9,7 @@
import com.zy.asrs.entity.param.*;
import com.zy.asrs.entity.result.OpenOrderCompeteResult;
import com.zy.asrs.entity.result.StockVo;
import com.zy.asrs.mapper.ReportQueryMapper;
import com.zy.asrs.mapper.TagMapper;
import com.zy.asrs.service.*;
import com.zy.asrs.utils.MatUtils;
@@ -20,6 +21,7 @@
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@@ -49,6 +51,10 @@
    private TagService tagService;
    @Autowired
    private TagMapper tagMapper;
    @Autowired
    private LocMastServiceImpl locMastService;
    @Autowired
    private ReportQueryMapper reportQueryMapper;
    @Override
    @Transactional
@@ -564,7 +570,7 @@
                } else {
                    tagId = tagService.getTop().getId();
                }
                mat.sync(param);
                mat.sync(matParam);
//            mat.setMatnr(param.getMatnr());
//            mat.setMaktx(param.getMaktx());
//            mat.setSpecs(param.getSpecs());
@@ -580,7 +586,7 @@
                    log.info("同步新物料[商品编号:{}]", mat.getMatnr());
                }
            } else {
                mat.sync(param);
                mat.sync(matParam);
                if (!matService.update(mat, new EntityWrapper<Mat>().eq("matnr",matParam.getMatnr()))) {
                    throw new CoolException("更新已存在商品信息失败,请联系管理员");
                }
@@ -589,4 +595,30 @@
    }
    @Override
    @Transactional
    public ViewStockUseBeanDigitalTwin digitalTwinOverview() {
        ViewStockUseBeanDigitalTwin viewStockUseBeanDigitalTwin = new ViewStockUseBeanDigitalTwin();
        int selectCountLocDetl = locDetlService.selectCount(new EntityWrapper<LocDetl>());
        viewStockUseBeanDigitalTwin.setRemainingStock(Integer.toUnsignedLong(selectCountLocDetl));
        int selectCountLocMast = locMastService.selectCount(new EntityWrapper<LocMast>());
        viewStockUseBeanDigitalTwin.setTotalLoc(Integer.toUnsignedLong(selectCountLocMast));
        int selectCountLocMastNEO = locMastService.selectCount(new EntityWrapper<LocMast>().ne("loc_sts","O").ne("loc_sts","X"));
        viewStockUseBeanDigitalTwin.setUseLoc(Integer.toUnsignedLong(selectCountLocMastNEO));
        int selectCountLocMastO = locMastService.selectCount(new EntityWrapper<LocMast>().eq("loc_sts","O"));
        viewStockUseBeanDigitalTwin.setIdleLoc(Integer.toUnsignedLong(selectCountLocMastO));
        List<ViewInOutBean> list = reportQueryMapper.getViewInOutAll(new ViewInOutBean());
        Date date = new Date();
        String format = new SimpleDateFormat("yyyy-MM-dd").format(date);
        viewStockUseBeanDigitalTwin.setNowData(format);
        for (ViewInOutBean view : list) {
            if (view.getYmd().equals(format)) {
                viewStockUseBeanDigitalTwin.setTodayOutbound(view.getRet_qty());
                viewStockUseBeanDigitalTwin.setTodayWarehousing(view.getSto_qty());
                break;
            }
        }
        return viewStockUseBeanDigitalTwin;
    }
}