| | |
| | | import com.core.common.Cools; |
| | | import com.core.common.DateUtils; |
| | | import com.core.common.R; |
| | | import com.zy.asrs.entity.DocType; |
| | | import com.zy.asrs.entity.Order; |
| | | import com.zy.asrs.entity.OrderDetl; |
| | | import com.zy.asrs.service.DocTypeService; |
| | | import com.zy.asrs.service.OrderDetlService; |
| | | import com.zy.asrs.service.OrderService; |
| | | import com.zy.common.web.BaseController; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | |
| | | @Autowired |
| | | private OrderDetlService orderDetlService; |
| | | |
| | | @Autowired |
| | | private DocTypeService docTypeService; |
| | | |
| | | @Autowired |
| | | private OrderService orderService; |
| | | |
| | | @RequestMapping(value = "/orderDetl/{id}/auth") |
| | | @ManagerAuth |
| | |
| | | return R.ok(orderDetlService.getPakoutPage(toPage(curr, limit, param, OrderDetl.class))); |
| | | } |
| | | |
| | | @RequestMapping(value = "/orderDetl/pakout/list/authV2") |
| | | @ManagerAuth |
| | | public R pakoutList2(@RequestParam(defaultValue = "1")Integer curr, |
| | | @RequestParam(defaultValue = "10")Integer limit, |
| | | @RequestParam(required = false)String orderByField, |
| | | @RequestParam(required = false)String orderByType, |
| | | @RequestParam Map<String, Object> param){ |
| | | EntityWrapper<OrderDetl> wrapper = new EntityWrapper<>(); |
| | | excludeTrash(param); |
| | | convert(param, wrapper); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));} else { |
| | | wrapper.orderBy("create_time", false); |
| | | } |
| | | List<DocType> pakins = docTypeService.selectList(new EntityWrapper<DocType>().eq("pakout", 1)); |
| | | List<Long> docIds = new ArrayList<>(); |
| | | for (DocType pakin : pakins) { |
| | | docIds.add(pakin.getDocId()); |
| | | } |
| | | EntityWrapper<Order> orderEntityWrapper = new EntityWrapper<>(); |
| | | List<Order> orders = orderService.selectList(orderEntityWrapper.in("doc_type",docIds)); |
| | | List<String> orderNos = new ArrayList<>(); |
| | | for (Order order : orders) { |
| | | orderNos.add(order.getOrderNo()); |
| | | } |
| | | wrapper.in("order_no",orderNos); |
| | | return R.ok(orderDetlService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | } |
| | | |
| | | private <T> void convert(Map<String, Object> map, EntityWrapper<T> wrapper){ |
| | | for (Map.Entry<String, Object> entry : map.entrySet()){ |
| | | String val = String.valueOf(entry.getValue()); |