| | |
| | | import com.core.common.DateUtils; |
| | | import com.core.common.R; |
| | | import com.zy.asrs.entity.OrderDetl; |
| | | import com.zy.asrs.mapper.OrderDetlMapper; |
| | | 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.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | |
| | | |
| | | @Autowired |
| | | private OrderDetlService orderDetlService; |
| | | |
| | | @Resource |
| | | private OrderDetlMapper orderDetlMapper; |
| | | |
| | | @RequestMapping(value = "/orderDetl/search/pda/auth") |
| | | @ManagerAuth |
| | | public R pdaOrderDetlSearch(@RequestParam(required = false)String condition,@RequestParam(required = false) String order){ |
| | | EntityWrapper<OrderDetl> wrapper = new EntityWrapper<>(); |
| | | if (!Cools.isEmpty(condition)) { |
| | | // wrapper.like("matnr", condition).or().like("maktx", condition); |
| | | |
| | | wrapper.like("matnr", condition); |
| | | } |
| | | wrapper.eq("order_no", order); |
| | | wrapper.orderBy("create_time", false); |
| | | List<OrderDetl> mats = orderDetlService.selectList(wrapper); |
| | | return R.ok().add(mats); |
| | | } |
| | | |
| | | @PostMapping("/orderDetl/list/pda/auth") |
| | | public R getPdaOrderDetl(@RequestBody Map<String,Object> map) { |
| | | EntityWrapper<OrderDetl> wrapper = new EntityWrapper<>(); |
| | | wrapper.eq("order_no", map.get("orderNo")); |
| | | return R.ok(orderDetlService.selectList(wrapper)); |
| | | } |
| | | |
| | | @RequestMapping(value = "/orderDetl/{id}/auth") |
| | | @ManagerAuth |
| | |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));} else { |
| | | wrapper.orderBy("create_time", false); |
| | | } |
| | | wrapper.eq("status", 0); |
| | | return R.ok(orderDetlService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | wrapper.eq("status", 1); |
| | | Page<OrderDetl> orderDetlPage = orderDetlService.selectPage(new Page<>(curr, limit), wrapper); |
| | | return R.ok(orderDetlPage); |
| | | } |
| | | |
| | | @RequestMapping(value = "/orderDetl/pakout/list/auth") |
| | | @ManagerAuth |
| | | public R pakoutList(@RequestParam(defaultValue = "1")Integer curr, |
| | | @RequestParam(defaultValue = "10")Integer limit, |
| | | @RequestParam Map<String, Object> param){ |
| | | return R.ok(orderDetlService.getPakoutPage(toPage(curr, limit, param, OrderDetl.class))); |
| | | } |
| | | |
| | | private <T> void convert(Map<String, Object> map, EntityWrapper<T> wrapper){ |
| | |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/orderDetl/getPrintDetl/{id}") |
| | | @ManagerAuth |
| | | public R getPrintDetl(@PathVariable("id") Integer id) { |
| | | if (Cools.isEmpty(id)) { |
| | | return R.parse("id为空"); |
| | | } |
| | | return R.ok(orderDetlService.selectById(id)); |
| | | } |
| | | |
| | | } |