自动化立体仓库 - WMS系统
pang.jiabao
2026-01-26 eed51ce47f20afb0661acc42baa680fcb6351a39
src/main/java/com/zy/asrs/service/impl/DigitalTwinServiceImpl.java
@@ -2,6 +2,7 @@
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.core.common.Cools;
import com.core.common.R;
import com.zy.asrs.entity.BasCrnp;
import com.zy.asrs.entity.LocCount;
import com.zy.asrs.entity.LocDetl;
@@ -11,6 +12,7 @@
import com.zy.asrs.mapper.LocCountMapper;
import com.zy.asrs.service.BasCrnpService;
import com.zy.asrs.service.DigitalTwinService;
import com.zy.asrs.service.LocDetlService;
import com.zy.asrs.service.LocMastService;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
@@ -282,6 +284,36 @@
                .horizontalSpeed(Integer.valueOf( Cools.isEmpty(crnp.getCtlRest()) ? "0" : crnp.getCtlRest())).voltage(220).status(crnp.getCrnErr() == 0 ? 1 : 3).operateMethod(crnp.getCrnSts() == 3 ? 1 : 3).build();
    }
    @Resource
    private LocDetlService locDetlService;
    @Override
    public R getAllLocations() {
        List<AllLocationsVo> allLocationsVos = new ArrayList<>();
        List<LocMast> locMastList = locMastService.selectList(new EntityWrapper<>());
        locMastList.forEach(locMast -> {
            AllLocationsVo allLocationsVo = new AllLocationsVo();
            allLocationsVo.setLocNo(locMast.getLocNo());
            String locSts = locMast.getLocSts();
            allLocationsVo.setLocSts(locSts);
            // 有库存
            if (locSts.equals("F") || locSts.equals("P") || locSts.equals("Q") || locSts.equals("R")) {
                List<LocDetl> locDetls = locDetlService.selectList(new EntityWrapper<LocDetl>().eq("loc_no", locMast.getLocNo()));
                if (!locDetls.isEmpty()) {
                    List<AllLocationsVo.LocDetl> locDetlList = locDetls.stream().map(locDetl -> {
                                AllLocationsVo.LocDetl locDetl1 = new AllLocationsVo.LocDetl();
                                BeanUtils.copyProperties(locDetl, locDetl1);
                                return locDetl1;
                            }
                    ).collect(Collectors.toList());
                    allLocationsVo.setLocDetls(locDetlList);
                }
            }
            allLocationsVos.add(allLocationsVo);
        });
        return R.ok(allLocationsVos);
    }
    // region 数字孪生