| | |
| | | package com.zy.asrs.controller; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.core.annotations.AppAuth; |
| | | import com.core.common.Cools; |
| | | import com.core.common.R; |
| | | import com.zy.asrs.entity.AgvWaitPakin; |
| | | import com.zy.asrs.entity.AgvWrkDetl; |
| | | import com.zy.asrs.entity.AgvWrkMast; |
| | | import com.zy.asrs.entity.ApiLog; |
| | | import com.zy.asrs.entity.param.AgvTaskCallBackParam; |
| | | import com.zy.asrs.service.*; |
| | | import com.zy.common.web.BaseController; |
| | | import lombok.Setter; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | import javax.annotation.PostConstruct; |
| | | import java.lang.reflect.InvocationTargetException; |
| | | import java.lang.reflect.Method; |
| | | import java.util.Date; |
| | | import java.util.EnumSet; |
| | | |
| | | /** |
| | | * 上报事件类型(eventType): |
| | | * task:上报任务状态。 |
| | | * task_allocated: 上报任务分配给机器人。 |
| | | * tote_load:上报取箱状态。 |
| | | * tote_unload:上报放箱状态。 |
| | | * robot_reach:机器人到达工作站。 |
| | | * weight:称重事件回调。 |
| | | * rfid:RFID识别事件回调。 |
| | | * |
| | | * 任务状态(status): |
| | | * success:成功。 |
| | | * fail:失败。 |
| | | * cancel:取消。 |
| | | * suspend:挂起。 |
| | | */ |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/agv") |
| | | public class AgvOpenController extends BaseController { |
| | | |
| | | @Autowired |
| | | AgvWrkMastService agvWrkMastService; |
| | | @Autowired |
| | | ApiLogService apiLogService; |
| | | |
| | | @PostMapping("/task/event/status") |
| | | @AppAuth(memo = "ESS任务回调") |
| | | public R taskEventStaus(@RequestBody AgvTaskCallBackParam param){ |
| | | |
| | | int wrkMastCount = agvWrkMastService.selectCount(new EntityWrapper<AgvWrkMast>().eq("wrk_no", param.getTaskCode())); |
| | | if(wrkMastCount < 1){ |
| | | //保存每次调用该接口的参数,作为历史可查询 |
| | | //saveApiLog(param); |
| | | |
| | | AgvWrkMast agvWrkMast = agvWrkMastService.selectOne(new EntityWrapper<AgvWrkMast>().eq("wrk_no", param.getTaskCode())); |
| | | if(Cools.isEmpty(agvWrkMast)){ |
| | | return R.error("任务编号错误"); |
| | | } |
| | | |
| | | if(!checkParam(param,agvWrkMast)){ |
| | | return R.error("任务参数与工作档参数不符合"); |
| | | } |
| | | |
| | | AgvTask agvTask = AgvTask.valueOf(param.getEventType()); |
| | |
| | | } catch (NoSuchMethodException e) { |
| | | return R.error("任务状态status参数有误"); |
| | | } catch (InvocationTargetException e) { |
| | | e.printStackTrace(); |
| | | log.error(e.getMessage()); |
| | | return R.error(); |
| | | } catch (IllegalAccessException e) { |
| | | e.printStackTrace(); |
| | | log.error(e.getMessage()); |
| | | return R.error(); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | private boolean checkParam(AgvTaskCallBackParam param, AgvWrkMast agvWrkMast){ |
| | | if(!agvWrkMast.getLocNo().equals(param.getLocationCode())){ |
| | | return false; |
| | | } |
| | | if(!agvWrkMast.getSourceLocNo().equals(param.getStationCode())){ |
| | | return false; |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | private void saveApiLog(AgvTaskCallBackParam param){ |
| | | ApiLog apiLog = new ApiLog(); |
| | | apiLog.setNamespace("ESS任务回调"); |
| | | apiLog.setUrl("/agv/task/event/status"); |
| | | apiLog.setRequest(JSONObject.toJSONString(param)); |
| | | apiLog.setCreateTime(new Date()); |
| | | apiLogService.insert(apiLog); |
| | | } |
| | | |
| | | } |
| | |
| | | task{ |
| | | @Transactional |
| | | public void success(AgvTaskCallBackParam param) { |
| | | |
| | | //修改AGV工作档的工作状态为205.工作完成 |
| | | agvWrkMastService.updateWrkStsByWrkNo(Integer.valueOf(param.getTaskCode()),205); |
| | | |
| | | /* |
| | | int wrkNo = Integer.valueOf(param.getTaskCode()); |
| | | String barcode = agvWrkMastService.selectById(wrkNo).getBarcode(); |
| | | //生成AGV工作历史档 |
| | |
| | | agvWaitPakinLogService.save(barcode); |
| | | //删除入库通知档 |
| | | agvWaitPakinService.delete(new EntityWrapper<AgvWaitPakin>().eq("zpallet",barcode)); |
| | | */ |
| | | |
| | | } |
| | | |
| | |
| | | public void success(AgvTaskCallBackParam param) { |
| | | //修改源站点状态为O.空,以及解绑托盘条码 |
| | | agvBasDevpService.updateLocStsAndBarcodeByDevNo(param.getStationCode(),"O",""); |
| | | //修改AGV工作档的工作状态为2(设备上走) |
| | | agvWrkMastService.updateWrkStsByWrkNo(Integer.valueOf(param.getTaskCode()),2); |
| | | //修改AGV工作档的工作状态为203.RCS放货中 |
| | | agvWrkMastService.updateWrkStsByWrkNo(Integer.valueOf(param.getTaskCode()),203); |
| | | //修改AGV入库通知档状态 |
| | | agvWaitPakinService.updateIoStatus(Integer.valueOf(param.getTaskCode()),"Y"); |
| | | //agvWaitPakinService.updateIoStatus(Integer.valueOf(param.getTaskCode()),"Y"); |
| | | |
| | | } |
| | | |
| | |
| | | int wrkNo = Integer.valueOf(param.getTaskCode()); |
| | | String barcode = agvWrkMastService.selectById(wrkNo).getBarcode(); |
| | | //修改目标库位状态为F.在库 |
| | | agvLocMastService.updateLocStsByLocNo(param.getLocationCode(),"F"); |
| | | //agvLocMastService.updateLocStsByLocNo(param.getLocationCode(),"F"); |
| | | //更新目标库位明细 |
| | | agvLocDetlService.addLocDetlInfo(param.getLocationCode(),wrkNo); |
| | | //修改工作档状态为14(入库完成) |
| | | agvWrkMastService.updateWrkStsByWrkNo(wrkNo,14); |
| | | //agvLocDetlService.addLocDetlInfo(param.getLocationCode(),wrkNo); |
| | | //修改工作档状态为204.放货完成 |
| | | agvWrkMastService.updateWrkStsByWrkNo(wrkNo,204); |
| | | } |
| | | |
| | | public void fail(AgvTaskCallBackParam param) { |
| | |
| | | package com.zy.asrs.controller; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | |
| | | import com.core.common.DateUtils; |
| | | import com.core.common.R; |
| | | import com.zy.asrs.entity.AgvWrkMast; |
| | | import com.zy.asrs.entity.param.AgvTaskCreateParam; |
| | | import com.zy.asrs.entity.param.AgvTaskParam; |
| | | import com.zy.asrs.entity.param.AgvTaskkDescribeParam; |
| | | import com.zy.asrs.service.AgvWaitPakinService; |
| | | import com.zy.asrs.service.AgvWrkMastService; |
| | | import com.zy.common.utils.HttpHandler; |
| | | import com.zy.common.web.BaseController; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.io.IOException; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @RestController |
| | | @RequestMapping("/agv") |
| | |
| | | |
| | | @Autowired |
| | | AgvWrkMastService agvWrkMastService; |
| | | @Autowired |
| | | AgvWaitPakinService agvWaitPakinService; |
| | | |
| | | @RequestMapping(value = "/wrkMast/{id}/auth") |
| | | @ManagerAuth |
| | |
| | | if (Cools.isEmpty(agvWrkMastList)){ |
| | | return R.error(); |
| | | } |
| | | Map<String, List<Map<String, String>>> containerMoveParam = agvWrkMastService.startWrk(agvWrkMastList); |
| | | |
| | | AgvTaskCreateParam agvTaskCreateParam = new AgvTaskCreateParam(); |
| | | agvTaskCreateParam.setTaskType("putaway"); |
| | | |
| | | List<AgvTaskParam> agvTaskParamList = agvWrkMastList.stream().map(agvWrkMast -> { |
| | | AgvTaskParam agvTaskParam = new AgvTaskParam(); |
| | | AgvTaskkDescribeParam agvTaskkDescribeParam = new AgvTaskkDescribeParam(); |
| | | agvTaskParam.setTaskDescribe(agvTaskkDescribeParam); |
| | | //AgvTaskParam |
| | | agvTaskParam.setTaskCode(agvWrkMast.getWrkNo().toString()); |
| | | agvTaskParam.setTaskPriority(agvWrkMast.getIoPri().intValue()); |
| | | //AgvTaskkDescribeParam |
| | | agvTaskkDescribeParam.setFromLocationCode(agvWrkMast.getSourceLocNo()); |
| | | agvTaskkDescribeParam.setToLocationCode(agvWrkMast.getLocNo()); |
| | | agvTaskkDescribeParam.setContainerCode(agvWrkMast.getBarcode()); |
| | | return agvTaskParam; |
| | | }).collect(Collectors.toList()); |
| | | |
| | | agvTaskCreateParam.setTasks(agvTaskParamList); |
| | | |
| | | String response = new HttpHandler.Builder() |
| | | .setUri("localhost:8080") |
| | | .setPath("test/task/create") |
| | | .setJson(JSONObject.toJSONString(agvTaskCreateParam)) |
| | | .build() |
| | | .doPost(); |
| | | |
| | | JSONObject jsonObject = JSON.parseObject(response); |
| | | int code = (int) jsonObject.get("code"); |
| | | |
| | | System.out.println(response); |
| | | int code = agvWrkMastService.containerMove(containerMoveParam); |
| | | |
| | | if(code == 0){ |
| | | agvWrkMastList.forEach(agvWrkMast -> { |
| | | //202.RCS取货中 |
| | | agvWrkMast.setWrkSts((long)202); |
| | | //修改AGV入库通知档状态入出状态为Y |
| | | agvWaitPakinService.updateIoStatus(agvWrkMast.getWrkNo(),"Y"); |
| | | }); |
| | | agvWrkMastService.updateBatchById(agvWrkMastList); |
| | | |
| | | return R.ok("任务启动成功"); |
| | | } |
| | | |
| | | return R.error("任务启动失败"); |
| | | |
| | | return R.ok(); |
| | | } |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.zy.asrs.entity.AgvWrkMast; |
| | | |
| | | import java.io.IOException; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | public interface AgvWrkMastService extends IService<AgvWrkMast> { |
| | | |
| | | public void updateWrkStsByWrkNo(int wrkNo, long wrkSts); |
| | | |
| | | public Map<String,List<Map<String,String>>> startWrk(List<AgvWrkMast> agvWrkMastList) throws IOException; |
| | | |
| | | public int containerMove(Map<String, List<Map<String, String>>> containerMoveParam) throws IOException; |
| | | } |
| | |
| | | AgvLocDetl agvLocDetl = new AgvLocDetl(); |
| | | BeanUtils.copyProperties(agvWrkDetl, agvLocDetl); |
| | | agvLocDetl.setLocNo(locNo); |
| | | this.insert(agvLocDetl); |
| | | return agvLocDetl; |
| | | }).collect(Collectors.toList()); |
| | | |
| | | this.insertBatch(agvLocDetlList); |
| | | |
| | | } |
| | | } |
| | |
| | | throw new CoolException(detlDto.getMatnr() + "商品档案不存在"); |
| | | } |
| | | AgvWaitPakin waitPakin = new AgvWaitPakin(); |
| | | waitPakin.setBatch(detlDto.getBatch());//批号 |
| | | |
| | | waitPakin.sync(mat); |
| | | waitPakin.setBatch(detlDto.getBatch()); |
| | | waitPakin.setZpallet(param.getBarcode()); // 托盘码 |
| | | waitPakin.setIoStatus("N"); // 入出状态 |
| | | waitPakin.setAnfme(detlDto.getAnfme()); // 数量 |
| | |
| | | |
| | | public List<AgvBasDevp> getAgvBasDevpByFloor(int floor) { |
| | | EntityWrapper<AgvBasDevp> wrapper = new EntityWrapper<>(); |
| | | wrapper.eq("floor",floor).eq("cache_shelves","Y").eq("sts_loc","F"); |
| | | wrapper.eq("floor",floor).eq("cache_shelves","Y").eq("loc_sts","F"); |
| | | return agvBasDevpService.selectList(wrapper); |
| | | } |
| | | |
| | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.core.common.Cools; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.entity.*; |
| | | import com.zy.asrs.entity.AgvBasDevp; |
| | | import com.zy.asrs.entity.AgvLocMast; |
| | | import com.zy.asrs.entity.AgvWaitPakin; |
| | | import com.zy.asrs.entity.AgvWrkMast; |
| | | import com.zy.asrs.service.*; |
| | | import com.zy.common.model.DetlDto; |
| | | import com.zy.common.model.StartupDto; |
| | |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.*; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * Created by vincent on 2020/6/11 |
| | |
| | | updateAgvBasDevp(agvBasDevp); |
| | | //更新目标库位状态 |
| | | updateAgvLocMast(agvLocMast); |
| | | |
| | | }); |
| | | |
| | | return null; |
| | |
| | | int workNo = agvCommonService.getWorkNo(0); |
| | | wrkMast.setWrkNo(workNo); |
| | | wrkMast.setIoTime(new Date()); |
| | | wrkMast.setWrkSts(1L); // 工作状态:生成入库ID |
| | | wrkMast.setWrkSts(201L); // 工作状态:201.生成入库任务ID |
| | | wrkMast.setIoType(1); // 入出库状态:1.入库 |
| | | //生成优先级 |
| | | wrkMast.setIoPri(300.0); |
| | |
| | | } |
| | | return wrkMast; |
| | | |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | Set<AgvBasDevp> set = new HashSet<>(); |
| | | set.add(null); |
| | | set.add(null); |
| | | System.out.println(set.size()); |
| | | } |
| | | } |
| | |
| | | package com.zy.asrs.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.entity.AgvWrkMast; |
| | | import com.zy.asrs.entity.param.AgvTaskCreateParam; |
| | | 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.AgvWrkMastService; |
| | | import com.zy.common.utils.HttpHandler; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.io.IOException; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @Service |
| | | public class AgvWrkMastServiceImp extends ServiceImpl<AgvWrkMastMapper, AgvWrkMast> implements AgvWrkMastService { |
| | |
| | | agvWrkMast.setWrkSts(wrkSts); |
| | | this.updateById(agvWrkMast); |
| | | } |
| | | |
| | | public Map<String,List<Map<String,String>>> startWrk(List<AgvWrkMast> agvWrkMastList) throws IOException { |
| | | |
| | | AgvTaskCreateParam agvTaskCreateParam = new AgvTaskCreateParam(); |
| | | agvTaskCreateParam.setTaskType("putaway"); |
| | | |
| | | //调用容器入场时所需要参数 |
| | | Map<String,List<Map<String,String>>> containerMoveParam = new HashMap<>(); |
| | | List<Map<String,String>> positionCodeMapList = new ArrayList<>(); |
| | | containerMoveParam.put("containerMoveIns",positionCodeMapList); |
| | | |
| | | List<AgvTaskParam> agvTaskParamList = agvWrkMastList.stream().map(agvWrkMast -> { |
| | | AgvTaskParam agvTaskParam = new AgvTaskParam(); |
| | | AgvTaskkDescribeParam agvTaskkDescribeParam = new AgvTaskkDescribeParam(); |
| | | agvTaskParam.setTaskDescribe(agvTaskkDescribeParam); |
| | | //AgvTaskParam |
| | | agvTaskParam.setTaskCode(agvWrkMast.getWrkNo().toString()); |
| | | agvTaskParam.setTaskPriority(agvWrkMast.getIoPri().intValue()); |
| | | |
| | | //往容器入场参数中放入源站点位置 |
| | | Map<String,String> positionCodeMap = new HashMap<>(); |
| | | positionCodeMap.put("positionCode",agvWrkMast.getSourceLocNo()); |
| | | positionCodeMapList.add(positionCodeMap); |
| | | |
| | | //AgvTaskkDescribeParam |
| | | agvTaskkDescribeParam.setFromLocationCode(agvWrkMast.getSourceLocNo()); |
| | | agvTaskkDescribeParam.setToLocationCode(agvWrkMast.getLocNo()); |
| | | agvTaskkDescribeParam.setContainerCode(agvWrkMast.getBarcode()); |
| | | return agvTaskParam; |
| | | }).collect(Collectors.toList()); |
| | | |
| | | agvTaskCreateParam.setTasks(agvTaskParamList); |
| | | |
| | | String response = new HttpHandler.Builder() |
| | | .setUri("localhost:8080") |
| | | .setPath("test/task/create") |
| | | .setJson(JSONObject.toJSONString(agvTaskCreateParam)) |
| | | .build() |
| | | .doPost(); |
| | | |
| | | JSONObject jsonObject = JSON.parseObject(response); |
| | | //save log api |
| | | int code = (int) jsonObject.get("code"); |
| | | if(code != 0){ |
| | | throw new CoolException("调用AGV接口失败"); |
| | | } |
| | | |
| | | return containerMoveParam; |
| | | } |
| | | |
| | | public int containerMove(Map<String, List<Map<String, String>>> containerMoveParam) throws IOException { |
| | | String response = new HttpHandler.Builder() |
| | | .setUri("localhost:8080") |
| | | .setPath("test/container/moveIn") |
| | | .setJson(JSONObject.toJSONString(containerMoveParam)) |
| | | .build() |
| | | .doPost(); |
| | | |
| | | JSONObject jsonObject = JSON.parseObject(response); |
| | | return (int) jsonObject.get("code"); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.asrs.task; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.core.common.Cools; |
| | | import com.zy.asrs.entity.AgvWrkMast; |
| | | import com.zy.asrs.service.AgvWrkMastService; |
| | | import com.zy.asrs.task.core.ReturnT; |
| | | import com.zy.asrs.task.handler.AgvWrkMastHandler; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.io.IOException; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 定时处理AGV工作档中工作状态为205.工作完成的数据 |
| | | */ |
| | | @Slf4j |
| | | @Component |
| | | public class AgvWrkMastScheduler { |
| | | |
| | | @Autowired |
| | | AgvWrkMastHandler agvWrkMastHandler; |
| | | @Autowired |
| | | AgvWrkMastService agvWrkMastService; |
| | | |
| | | @Scheduled(cron = "0/5 * * * * ? ") |
| | | public void excutePutwayWrk(){ |
| | | List<AgvWrkMast> agvWrkMastList = agvWrkMastService.selectList(new EntityWrapper<AgvWrkMast>() |
| | | .eq("wrk_sts", 205) |
| | | .eq("io_type",1)); |
| | | if(!Cools.isEmpty(agvWrkMastList)){ |
| | | agvWrkMastList.stream().forEach(agvWrkMast -> { |
| | | ReturnT<String> returnT = agvWrkMastHandler.completedPutWayWrk(agvWrkMast); |
| | | }); |
| | | } |
| | | } |
| | | |
| | | @Scheduled(cron = "0/5 * * * * ? ") |
| | | public void startPutwayWrk(){ |
| | | List<AgvWrkMast> agvWrkMastList = agvWrkMastService.selectList(new EntityWrapper<AgvWrkMast>() |
| | | .eq("wrk_sts", 201) |
| | | .eq("io_type",1) |
| | | .last("limit 0,50")); |
| | | if(!Cools.isEmpty(agvWrkMastList)){ |
| | | try { |
| | | ReturnT<String> returnT = agvWrkMastHandler.startPutWayWrk(agvWrkMastList); |
| | | } catch (IOException e) { |
| | | log.error(e.getMessage()); |
| | | } |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.zy.asrs.task.handler; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.zy.asrs.entity.AgvWaitPakin; |
| | | import com.zy.asrs.entity.AgvWrkDetl; |
| | | import com.zy.asrs.entity.AgvWrkMast; |
| | | import com.zy.asrs.service.*; |
| | | import com.zy.asrs.task.AbstractHandler; |
| | | import com.zy.asrs.task.core.ReturnT; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.io.IOException; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Service |
| | | public class AgvWrkMastHandler extends AbstractHandler<String> { |
| | | |
| | | @Autowired |
| | | AgvWrkMastService agvWrkMastService; |
| | | @Autowired |
| | | AgvLocMastService agvLocMastService; |
| | | @Autowired |
| | | AgvLocDetlService agvLocDetlService; |
| | | @Autowired |
| | | AgvWrkMastLogService agvWrkMastLogService; |
| | | @Autowired |
| | | AgvWrkDetlService agvWrkDetlService; |
| | | @Autowired |
| | | AgvWrkDetlLogService agvWrkDetlLogService; |
| | | @Autowired |
| | | AgvWaitPakinService agvWaitPakinService; |
| | | @Autowired |
| | | AgvWaitPakinLogService agvWaitPakinLogService; |
| | | |
| | | @Transactional |
| | | public ReturnT<String> completedPutWayWrk(AgvWrkMast agvWrkMast) { |
| | | int wrkNo = agvWrkMast.getWrkNo(); |
| | | String barcode = agvWrkMast.getBarcode(); |
| | | |
| | | //修改工作档状态为206.库存更新完成 |
| | | agvWrkMast.setWrkSts(206L); |
| | | agvWrkMastService.updateById(agvWrkMast); |
| | | //修改目标库位状态为F.在库 |
| | | agvLocMastService.updateLocStsByLocNo(agvWrkMast.getLocNo(),"F"); |
| | | //更新目标库位明细 |
| | | agvLocDetlService.addLocDetlInfo(agvWrkMast.getLocNo(),wrkNo); |
| | | //生成AGV工作历史档 |
| | | agvWrkMastLogService.save(wrkNo); |
| | | //生成AGV工作明细历史档 |
| | | agvWrkDetlLogService.save(wrkNo); |
| | | //生成入库通知历史档 |
| | | agvWaitPakinLogService.save(barcode); |
| | | //删除AGV工作档 |
| | | agvWrkMastService.deleteById(wrkNo); |
| | | //删除AGV工作明细档 |
| | | agvWrkDetlService.delete(new EntityWrapper<AgvWrkDetl>().eq("wrk_no",wrkNo)); |
| | | //删除入库通知档 |
| | | agvWaitPakinService.delete(new EntityWrapper<AgvWaitPakin>().eq("zpallet",barcode)); |
| | | |
| | | return SUCCESS; |
| | | } |
| | | |
| | | @Transactional |
| | | public ReturnT<String> startPutWayWrk(List<AgvWrkMast> agvWrkMastList) throws IOException { |
| | | Map<String, List<Map<String, String>>> containerMoveParam = agvWrkMastService.startWrk(agvWrkMastList); |
| | | |
| | | int code = agvWrkMastService.containerMove(containerMoveParam); |
| | | |
| | | if(code == 0){ |
| | | agvWrkMastList.forEach(agvWrkMast -> { |
| | | //202.RCS取货中 |
| | | agvWrkMast.setWrkSts((long)202); |
| | | //修改AGV入库通知档状态入出状态为Y |
| | | agvWaitPakinService.updateIoStatus(agvWrkMast.getWrkNo(),"Y"); |
| | | }); |
| | | agvWrkMastService.updateBatchById(agvWrkMastList); |
| | | |
| | | return SUCCESS; |
| | | } |
| | | |
| | | return FAIL; |
| | | } |
| | | } |
| | |
| | | $.ajax({ |
| | | url: baseUrl+"/agv/locMast/init/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: JSON.stringify(param), |
| | | data: JSON.stringify("param"), |
| | | dataType:'json', |
| | | contentType:'application/json;charset=UTF-8', |
| | | method: 'POST', |
| | |
| | | if (data.length === 0){ |
| | | layer.msg('请选择数据'); |
| | | } else { |
| | | layer.confirm('确定删除'+(data.length===1?'此':data.length)+'条数据吗', function(){ |
| | | layer.confirm('确定启动'+(data.length===1?'此':data.length)+'条数据吗', function(){ |
| | | $.ajax({ |
| | | url: baseUrl+"/agv/wrkMast/startWrk/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | |
| | | ,{field: 'wrkSts$', align: 'center',title: '工作状态', width:160} |
| | | ,{field: 'ioType$', align: 'center',title: '入出库类型', width:160} |
| | | ,{field: 'ioPri', align: 'center',title: '优先级'} |
| | | ,{field: 'crnNo$', align: 'center',title: '堆垛机号'} |
| | | ,{field: 'sourceStaNo$', align: 'center',title: '源站'} |
| | | ,{field: 'staNo$', align: 'center',title: '目标站'} |
| | | ,{field: 'sourceLocNo$', align: 'center',title: '源库位'} |
| | | ,{field: 'locNo$', align: 'center',title: '目标库位'} |
| | | //,{field: 'crnNo$', align: 'center',title: '堆垛机号'} |
| | | //,{field: 'sourceStaNo$', align: 'center',title: '源站'} |
| | | //,{field: 'staNo$', align: 'center',title: '目标站'} |
| | | ,{field: 'sourceLocNo', align: 'center',title: '源库位'} |
| | | ,{field: 'locNo', align: 'center',title: '目标库位'} |
| | | // ,{field: 'picking', align: 'center',title: '拣料', templet:function(row){ |
| | | // var html = "<input value='picking' type='checkbox' lay-skin='primary' lay-filter='tableCheckbox' table-index='"+row.LAY_TABLE_INDEX+"'"; |
| | | // if(row.picking === 'Y'){html += " checked ";} |
| | |
| | | /*************************************************************************************************************/ |
| | | |
| | | function arrRemove(arr, key, val) { |
| | | for(var i=arr.length-1; i>=0; i--){ |
| | | for(var i=arr.length-1; i>=1; i--){ |
| | | if(arr[i][key] === val){ |
| | | arr.splice(i,1); |
| | | } |
| | |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label" style="padding: 8px 15px 8px 15px">物料号:</label> |
| | | <div class="layui-input-inline"> |
| | | <input name="matnr" class="layui-input" placeholder="输入商品编号"/> |
| | | <input name="matnr" class="layui-input" placeholder="输入物料号"/> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label" style="padding: 8px 15px 8px 15px">物料号:</label> |
| | | <label class="layui-form-label" style="padding: 8px 15px 8px 15px">物料名称:</label> |
| | | <div class="layui-input-inline"> |
| | | <input name="maktx" class="layui-input" placeholder="输入商品名称"/> |
| | | <input name="maktx" class="layui-input" placeholder="输入物料名称"/> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | |
| | | text-overflow:ellipsis; |
| | | -webkit-line-clamp: 3; |
| | | -webkit-box-orient: vertical; |
| | | word-break: break-all; |
| | | ">{{this.specs}}</td> |
| | | </tr> |
| | | </table> |