|  |  | 
 |  |  | import com.core.common.Cools; | 
 |  |  | import com.core.common.DateUtils; | 
 |  |  | import com.core.common.R; | 
 |  |  | import com.core.exception.CoolException; | 
 |  |  | import com.zy.asrs.entity.AgvBasDevp; | 
 |  |  | import com.zy.asrs.entity.AgvWaitPakin; | 
 |  |  | import com.zy.asrs.entity.OrderDetl; | 
 |  |  | 
 |  |  | import com.zy.asrs.service.OrderDetlService; | 
 |  |  | import com.zy.common.web.BaseController; | 
 |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
 |  |  | import org.springframework.transaction.annotation.Transactional; | 
 |  |  | import org.springframework.web.bind.annotation.*; | 
 |  |  |  | 
 |  |  | import java.util.ArrayList; | 
 |  |  | 
 |  |  |  | 
 |  |  |     @RequestMapping(value = "/waitPakin/delete/auth") | 
 |  |  |     @ManagerAuth | 
 |  |  |     @Transactional | 
 |  |  |     public R delete(@RequestParam String param){ | 
 |  |  |         List<AgvWaitPakin> list = JSONArray.parseArray(param, AgvWaitPakin.class); | 
 |  |  |         if (Cools.isEmpty(list)){ | 
 |  |  | 
 |  |  |         } | 
 |  |  |         for (AgvWaitPakin entity : list){ | 
 |  |  |             AgvBasDevp agvBasDevp = agvBasDevpService.selectOne(new EntityWrapper<AgvBasDevp>().eq("barcode", entity.getSuppCode())); | 
 |  |  |             if(Cools.isEmpty(agvBasDevp)){ | 
 |  |  |                 agvWaitPakinService.delete(new EntityWrapper<>(entity)); | 
 |  |  |             }else { | 
 |  |  |                 return R.error("料箱码为" + entity.getSuppCode() + "已绑定站点,请先从AGV站点管理解绑该料箱"); | 
 |  |  |  | 
 |  |  |             if(!Cools.isEmpty(agvBasDevp)){ | 
 |  |  |                 if(!Cools.eq("F",agvBasDevp.getLocSts())){ | 
 |  |  |                     throw new CoolException("该入库通知档已经在作业中,无法删除"); | 
 |  |  |                 } | 
 |  |  |                 //解绑站点 | 
 |  |  |                 agvBasDevp.setLocSts("O"); | 
 |  |  |                 agvBasDevp.setBarcode(""); | 
 |  |  |                 agvBasDevp.setLocType2(null); | 
 |  |  |                 agvBasDevpService.update(agvBasDevp,new EntityWrapper<AgvBasDevp>().eq("dev_no",agvBasDevp.getDevNo())); | 
 |  |  |             } | 
 |  |  |             agvWaitPakinService.delete(new EntityWrapper<>(entity)); | 
 |  |  |  | 
 |  |  |             //订单回滚 | 
 |  |  |             if(!Cools.isEmpty(entity.getOrderNo())){ | 
 |  |  |                 String orderNo = entity.getOrderNo(); |