| | |
| | | |
| | | 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; |
| | |
| | | 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; |
| | |
| | | .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 数字孪生 |
| | | |