| | |
| | | package com.zy.asrs.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.core.common.Cools; |
| | | import com.zy.asrs.entity.AgvBasDevp; |
| | | import com.zy.asrs.entity.AgvWaitPakin; |
| | | import com.zy.asrs.entity.AgvWrkMast; |
| | | import com.zy.asrs.mapper.AgvBasDevpMapper; |
| | | import com.zy.asrs.service.AgvBasDevpService; |
| | | import com.zy.asrs.service.AgvWaitPakinService; |
| | | import com.zy.asrs.service.AgvWrkDetlService; |
| | | import com.zy.asrs.service.AgvWrkMastService; |
| | | import com.zy.common.model.AgvBasDevpDto; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @Service |
| | | @Transactional |
| | |
| | | |
| | | @Autowired |
| | | AgvBasDevpMapper agvBasDevpMapper; |
| | | @Autowired |
| | | AgvWrkMastService agvWrkMastService; |
| | | @Autowired |
| | | AgvWrkDetlService agvWrkDetlService; |
| | | @Autowired |
| | | AgvWaitPakinService agvWaitPakinService; |
| | | |
| | | public void clearBasDevp(){ |
| | | agvBasDevpMapper.deleteAll(); |
| | |
| | | this.updateById(agvBasDevp); |
| | | } |
| | | |
| | | public Map<String, Object> getAgvBasDevpDtoByStationCode(String stationCode) { |
| | | |
| | | List<Map<String, Object>> body = new ArrayList<>(); |
| | | for(int i=3; i>=1; i--){ |
| | | List<AgvBasDevp> agvBasDevpList = this.selectList(new EntityWrapper<AgvBasDevp>() |
| | | .eq("station_code", stationCode) |
| | | .like("dev_no","0"+ i +"@")); |
| | | |
| | | Map<String, Object> map = new HashMap<>(); |
| | | |
| | | List<AgvBasDevpDto> agvBasDevpDtoList = agvBasDevpList.stream().map(agvBasDevp -> { |
| | | AgvBasDevpDto agvBasDevpDto = new AgvBasDevpDto(); |
| | | BeanUtils.copyProperties(agvBasDevp, agvBasDevpDto); |
| | | |
| | | if (Cools.isEmpty(agvBasDevpDto.getBarcode())) { |
| | | return agvBasDevpDto; |
| | | } |
| | | |
| | | AgvWaitPakin agvWaitPakin = agvWaitPakinService.selectOne(new EntityWrapper<AgvWaitPakin>() |
| | | .eq("zpallet", agvBasDevpDto.getBarcode())); |
| | | |
| | | agvBasDevpDto.setAgvWaitPakin(agvWaitPakin); |
| | | |
| | | AgvWrkMast agvWrkMast = agvWrkMastService.selectOne(new EntityWrapper<AgvWrkMast>() |
| | | .eq("barcode", agvBasDevpDto.getBarcode())); |
| | | |
| | | agvBasDevpDto.setAgvWrkMast(agvWrkMast); |
| | | |
| | | return agvBasDevpDto; |
| | | |
| | | }).collect(Collectors.toList()); |
| | | |
| | | map.put("loc",agvBasDevpDtoList); |
| | | body.add(map); |
| | | } |
| | | |
| | | Map<String, Object> result = new HashMap<>(); |
| | | result.put("body", body); |
| | | |
| | | return result; |
| | | } |
| | | |
| | | } |