自动化立体仓库 - WMS系统
zhangc
2025-02-13 b25fc15afed603c0c874e77d37bf93f08d5398c9
src/main/java/com/zy/asrs/controller/OrderLogController.java
@@ -44,12 +44,13 @@
    private LocDetlService locDetlService;
    @Autowired
    private MatService matService;
    @Autowired
    private OrderService orderService;
    @RequestMapping(value = "/orderLog/nav/list/auth")
    @ManagerAuth
    public R navList(@RequestParam(required = false) String orderNo) {
    public R navList(@RequestParam(required = false) String orderNo){
        EntityWrapper<OrderLog> wrapper = new EntityWrapper<>();
        if (!Cools.isEmpty(orderNo)) {
            wrapper.like("order_no", orderNo);
@@ -77,17 +78,15 @@
    @RequestMapping(value = "/orderLog/head/page/auth")
    @ManagerAuth
    public R head(@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) {
    public R head(@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<OrderLog> wrapper = new EntityWrapper<>();
        excludeTrash(param);
        convert(param, wrapper);
        if (!Cools.isEmpty(orderByField)) {
            wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));
        } else {
        if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));} else {
            wrapper.orderBy("settle").orderBy("create_time", false);
        }
        wrapper.eq("status", 1);
@@ -96,9 +95,12 @@
    @RequestMapping(value = "/orderLog/detl/all/auth")
    @ManagerAuth
    public R head(@RequestParam Long orderId) {
    public R head(@RequestParam Long orderId){
        return R.ok().add(orderDetlLogService.selectList(new EntityWrapper<OrderDetlLog>().eq("order_id", orderId)));
    }
    @PostMapping(value = "/orderLog/wrk/trace/auth")
@@ -180,24 +182,22 @@
    @RequestMapping(value = "/orderLog/list/auth")
    @ManagerAuth
    public R list(@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) {
    public R list(@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<OrderLog> wrapper = new EntityWrapper<>();
        excludeTrash(param);
        convert(param, wrapper);
        if (!Cools.isEmpty(orderByField)) {
            wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));
        }
        if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));}
        return R.ok(orderLogService.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()) {
    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());
            if (val.contains(RANGE_TIME_LINK)) {
            if (val.contains(RANGE_TIME_LINK)){
                String[] dates = val.split(RANGE_TIME_LINK);
                wrapper.ge(entry.getKey(), DateUtils.convert(dates[0]));
                wrapper.le(entry.getKey(), DateUtils.convert(dates[1]));
@@ -210,7 +210,7 @@
    @RequestMapping(value = "/orderLog/export/auth")
    @ManagerAuth
    public R export(@RequestBody JSONObject param) {
    public R export(@RequestBody JSONObject param){
        EntityWrapper<OrderLog> wrapper = new EntityWrapper<>();
        List<String> fields = JSONObject.parseArray(param.getJSONArray("fields").toJSONString(), String.class);
        Map<String, Object> map = excludeTrash(param.getJSONObject("order"));
@@ -226,7 +226,7 @@
        wrapper.like("id", condition);
        Page<OrderLog> page = orderLogService.selectPage(new Page<>(0, 10), wrapper);
        List<Map<String, Object>> result = new ArrayList<>();
        for (OrderLog order : page.getRecords()) {
        for (OrderLog order : page.getRecords()){
            Map<String, Object> map = new HashMap<>();
            map.put("id", order.getId());
            map.put("value", order.getOrderNo());
@@ -239,7 +239,7 @@
    @ManagerAuth
    public R query(@RequestBody JSONObject param) {
        Wrapper<OrderLog> wrapper = new EntityWrapper<OrderLog>().eq(humpToLine(String.valueOf(param.get("key"))), param.get("val"));
        if (null != orderLogService.selectOne(wrapper)) {
        if (null != orderLogService.selectOne(wrapper)){
            return R.parse(BaseRes.REPEAT).add(getComment(Order.class, String.valueOf(param.get("key"))));
        }
        return R.ok();