| | |
| | | import com.core.common.DateUtils; |
| | | import com.core.common.R; |
| | | import com.core.exception.CoolException; |
| | | import com.sun.org.apache.xpath.internal.operations.Or; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | import zy.cloud.wms.common.utils.QrCode; |
| | | import zy.cloud.wms.common.web.BaseController; |
| | | import zy.cloud.wms.manager.entity.Order; |
| | | import zy.cloud.wms.manager.entity.OrderDetl; |
| | | import zy.cloud.wms.manager.service.OrderDetlService; |
| | | import zy.cloud.wms.manager.service.OrderService; |
| | | |
| | | import javax.imageio.ImageIO; |
| | |
| | | |
| | | @Autowired |
| | | private OrderService orderService; |
| | | @Autowired |
| | | private OrderDetlService orderDetlService; |
| | | |
| | | @RequestMapping(value = "/order/{id}/auth") |
| | | @ManagerAuth |
| | |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/order/delete/auth") |
| | | @ManagerAuth |
| | | public R delete(@RequestParam String param){ |
| | | List<Order> list = JSONArray.parseArray(param, Order.class); |
| | | if (Cools.isEmpty(list)){ |
| | | return R.error(); |
| | | } |
| | | for (Order entity : list){ |
| | | orderService.delete(new EntityWrapper<>(entity)); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/orders/delete/auth") |
| | | @ManagerAuth |
| | | @Transactional |
| | |
| | | return R.error(); |
| | | } |
| | | for (Long id : ids){ |
| | | Order order = orderService.selectById(id); |
| | | if (order == null) { |
| | | continue; |
| | | } |
| | | orderDetlService.delete(new EntityWrapper<OrderDetl>().eq("order_id", order.getId())); |
| | | if (!orderService.deleteById(id)) { |
| | | throw new CoolException("服务器错误,请联系管理员"); |
| | | } |