|  |  |  | 
|---|
|  |  |  | import com.alibaba.fastjson.JSON; | 
|---|
|  |  |  | import com.alibaba.fastjson.JSONObject; | 
|---|
|  |  |  | import com.baomidou.mybatisplus.mapper.EntityWrapper; | 
|---|
|  |  |  | import com.baomidou.mybatisplus.mapper.Wrapper; | 
|---|
|  |  |  | import com.baomidou.mybatisplus.service.impl.ServiceImpl; | 
|---|
|  |  |  | import com.core.common.Cools; | 
|---|
|  |  |  | import com.core.exception.CoolException; | 
|---|
|  |  |  | 
|---|
|  |  |  | import com.zy.asrs.entity.param.AgvTaskParam; | 
|---|
|  |  |  | import com.zy.asrs.entity.param.AgvTaskkDescribeParam; | 
|---|
|  |  |  | import com.zy.asrs.mapper.AgvWrkMastMapper; | 
|---|
|  |  |  | import com.zy.asrs.service.AgvLocMastService; | 
|---|
|  |  |  | import com.zy.asrs.service.AgvWrkDetlService; | 
|---|
|  |  |  | import com.zy.asrs.service.AgvWrkMastService; | 
|---|
|  |  |  | import com.zy.asrs.service.ApiLogService; | 
|---|
|  |  |  | import com.zy.asrs.service.*; | 
|---|
|  |  |  | import com.zy.common.utils.HttpHandler; | 
|---|
|  |  |  | import lombok.extern.slf4j.Slf4j; | 
|---|
|  |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
|---|
|  |  |  | 
|---|
|  |  |  | AgvLocMastService agvLocMastService; | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | ApiLogService apiLogService; | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | AgvBasDevpService agvBasDevpService; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public void updateWrkStsByWrkNo(int wrkNo, long wrkSts) { | 
|---|
|  |  |  | AgvWrkMast agvWrkMast = this.selectById(wrkNo); | 
|---|
|  |  |  | 
|---|
|  |  |  | return doHttpRequest(containerArrivedParam,"容器达到通知",url, containerArrivedPath,null,"127.0.0.1"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | public List<AgvWrkMast> selectReadyAgvWrkMast() { | 
|---|
|  |  |  | List<String> stationCodes = agvBasDevpService.selectAllStationCode(); | 
|---|
|  |  |  | Wrapper<AgvWrkMast> wrapper = new EntityWrapper<AgvWrkMast>().eq("wrk_sts", 21L).like(false, "loc_no", "@"); | 
|---|
|  |  |  | wrapper.in("loc_no",stationCodes); | 
|---|
|  |  |  | return this.selectList(wrapper); | 
|---|
|  |  |  | //return this.baseMapper.selectReadyAgvWrkMast(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | public AgvWrkMast selectByContainerCode(String containerCode) { | 
|---|
|  |  |  | return this.selectOne(new EntityWrapper<AgvWrkMast>().eq("barcode",containerCode)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | private void getContainerMoveParam(List<AgvWrkMast> agvWrkMastList,List<Map<String,String>> positionCodeMapList){ | 
|---|
|  |  |  | //往容器入场参数中放入源站点位置 | 
|---|
|  |  |  | for(AgvWrkMast agvWrkMast : agvWrkMastList){ | 
|---|
|  |  |  | 
|---|
|  |  |  | agvTaskParam.setTaskPriority(agvWrkMast.getIoPri().intValue()); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //AgvTaskkDescribeParam | 
|---|
|  |  |  | agvTaskkDescribeParam.setFromLocationCode(agvWrkMast.getSourceLocNo()); | 
|---|
|  |  |  | agvTaskkDescribeParam.setToLocationCode(agvWrkMast.getLocNo()); | 
|---|
|  |  |  | if(agvWrkMast.getSourceLocNo().contains("CS") || agvWrkMast.getSourceLocNo().contains("SK")){ | 
|---|
|  |  |  | agvTaskkDescribeParam.setFromLocationCode(agvWrkMast.getSourceLocNo()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if(agvWrkMast.getLocNo().contains("SK")){ | 
|---|
|  |  |  | agvTaskkDescribeParam.setToLocationCode(agvWrkMast.getLocNo()); | 
|---|
|  |  |  | }else { | 
|---|
|  |  |  | agvTaskkDescribeParam.setToStationCode(agvWrkMast.getLocNo()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | agvTaskkDescribeParam.setContainerCode(agvWrkMast.getBarcode()); | 
|---|
|  |  |  | return agvTaskParam; | 
|---|
|  |  |  | }).collect(Collectors.toList()); | 
|---|