| | |
| | | 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.baomidou.mybatisplus.mapper.Wrapper; |
| | |
| | | import com.core.common.*; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.entity.*; |
| | | import com.zy.asrs.entity.param.InFormIdParam; |
| | | import com.zy.asrs.entity.param.OrderDomainParam; |
| | | import com.zy.asrs.service.*; |
| | | import com.zy.asrs.task.core.ReturnT; |
| | | import com.zy.common.model.DetlDto; |
| | | import com.zy.common.utils.HttpHandler; |
| | | import com.zy.common.web.BaseController; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.LocalDateTime; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.*; |
| | | |
| | | @Slf4j |
| | | @RestController |
| | | public class OrderController extends BaseController { |
| | | |
| | |
| | | private WaitPakinService waitPakinService; |
| | | @Autowired |
| | | private LocDetlService locDetlService; |
| | | @Value("${erp.address.URL}") |
| | | //端口 |
| | | private String URL; |
| | | |
| | | @Value("${erp.address.inaddress}") |
| | | //单据,商品档案地址 |
| | | private String inaddress; |
| | | |
| | | @Autowired |
| | | private ApiLogService apiLogService; |
| | | |
| | | @Autowired |
| | | private MatService matService; |
| | | |
| | | @Autowired |
| | | private TagService tagService; |
| | | |
| | | |
| | | @RequestMapping(value = "/order/nav/list/auth") |
| | | @ManagerAuth |
| | |
| | | } |
| | | return R.ok().add(orders); |
| | | } |
| | | @RequestMapping(value = "/order/nav/list/auth/xs") |
| | | @ManagerAuth |
| | | public R navListxs(@RequestParam(required = false) String orderNo){ |
| | | EntityWrapper<Order> wrapper = new EntityWrapper<>(); |
| | | if (!Cools.isEmpty(orderNo)) { |
| | | wrapper.like("order_no", orderNo); |
| | | } |
| | | wrapper.le("settle", 2).eq("status", 1); |
| | | wrapper.orderBy("create_time", false); |
| | | wrapper.eq("doc_type", 81); |
| | | List<Order> orders = orderService.selectList(wrapper); |
| | | // 保留出库单 |
| | | if (!Cools.isEmpty(orders)) { |
| | | Iterator<Order> iterator = orders.iterator(); |
| | | while (iterator.hasNext()) { |
| | | Order order = iterator.next(); |
| | | if (order.getDocType() != null) { |
| | | DocType docType = docTypeService.selectById(order.getDocType()); |
| | | if (docType != null) { |
| | | if (docType.getPakout() == 0) { |
| | | iterator.remove(); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return R.ok().add(orders); |
| | | } |
| | | |
| | | @RequestMapping(value = "/order/nav/list/auth/notxs") |
| | | @ManagerAuth |
| | | public R navListnotxs(@RequestParam(required = false) String orderNo){ |
| | | EntityWrapper<Order> wrapper = new EntityWrapper<>(); |
| | | if (!Cools.isEmpty(orderNo)) { |
| | | wrapper.like("order_no", orderNo); |
| | | } |
| | | wrapper.le("settle", 2).eq("status", 1); |
| | | wrapper.orderBy("create_time", false); |
| | | List<Order> orders = orderService.selectList(wrapper); |
| | | // 保留出库单 |
| | | if (!Cools.isEmpty(orders)) { |
| | | Iterator<Order> iterator = orders.iterator(); |
| | | while (iterator.hasNext()) { |
| | | Order order = iterator.next(); |
| | | if (order.getDocType() != null) { |
| | | DocType docType = docTypeService.selectById(order.getDocType()); |
| | | if (docType != null) { |
| | | if (docType.getPakout() == 0 || order.getDocType() == 81) { |
| | | iterator.remove(); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return R.ok().add(orders); |
| | | } |
| | | |
| | | @RequestMapping(value = "/order/head/page/auth") |
| | | @ManagerAuth |
| | |
| | | wrapper.orderBy("settle").orderBy("create_time", false); |
| | | } |
| | | wrapper.eq("status", 1); |
| | | if(param.get("doc_type") != null){ |
| | | wrapper.eq("doc_type", param.get("doc_type")); |
| | | } |
| | | return R.ok(orderService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | } |
| | | |
| | |
| | | } |
| | | return R.ok("订单添加成功"); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |