| | |
| | | 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.R; |
| | | import com.zy.asrs.entity.AgvBasDevp; |
| | | import com.zy.asrs.entity.AgvWaitPakin; |
| | | import com.zy.asrs.entity.OrderDetl; |
| | | import com.zy.asrs.entity.WaitPakin; |
| | | import com.zy.asrs.service.AgvBasDevpService; |
| | | import com.zy.asrs.service.AgvWaitPakinService; |
| | | import com.zy.asrs.service.OrderDetlService; |
| | | import com.zy.common.web.BaseController; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | private AgvWaitPakinService agvWaitPakinService; |
| | | @Autowired |
| | | private AgvBasDevpService agvBasDevpService; |
| | | @Autowired |
| | | private OrderDetlService orderDetlService; |
| | | |
| | | @RequestMapping(value = "/waitPakin/{id}/auth") |
| | | @ManagerAuth |
| | |
| | | }else { |
| | | return R.error("料箱码为" + entity.getSuppCode() + "已绑定站点,请先从AGV站点管理解绑该料箱"); |
| | | } |
| | | //订单回滚 |
| | | if(!Cools.isEmpty(entity.getOrderNo())){ |
| | | String orderNo = entity.getOrderNo(); |
| | | if(orderNo.contains("{")){ |
| | | JSONArray orderArray = JSON.parseArray(orderNo); |
| | | for (Object o : orderArray){ |
| | | JSONObject jsonobject = (JSONObject) o; |
| | | OrderDetl orderDetl = orderDetlService.selectByOrderNoAndMatnr(jsonobject.get("orderNo").toString(),entity.getMatnr(),entity.getThreeCode(),entity.getDeadTime()); |
| | | orderDetl.setQty(orderDetl.getQty() - entity.getAnfme()); |
| | | orderDetlService.updateById(orderDetl); |
| | | } |
| | | |
| | | }else { |
| | | OrderDetl orderDetl = orderDetlService.selectByOrderNoAndMatnr(entity.getOrderNo(),entity.getMatnr(),entity.getThreeCode(),entity.getDeadTime()); |
| | | orderDetl.setQty(orderDetl.getQty() - entity.getAnfme()); |
| | | orderDetlService.updateById(orderDetl); |
| | | } |
| | | } |
| | | |
| | | } |
| | | return R.ok(); |