自动化立体仓库 - WMS系统
1
zhang
昨天 51f6b1ae7c10506910a09c7926429e19949e8421
src/main/java/com/zy/asrs/controller/AgvWrkMastController.java
@@ -1,5 +1,6 @@
package com.zy.asrs.controller;
import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.enums.SqlLike;
@@ -14,7 +15,10 @@
import com.zy.asrs.entity.AgvWrkMast;
import com.zy.asrs.service.AgvWaitPakinService;
import com.zy.asrs.service.AgvWrkMastService;
import com.zy.asrs.task.core.WrkMastConfig;
import com.zy.common.web.BaseController;
import com.zy.system.entity.Config;
import com.zy.system.service.ConfigService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@@ -26,8 +30,13 @@
    @Autowired
    AgvWrkMastService agvWrkMastService;
    @Autowired
    AgvWaitPakinService agvWaitPakinService;
    @Autowired
    private ConfigService configService;
    @RequestMapping(value = "/wrkMast/{id}/auth")
    @ManagerAuth
@@ -59,6 +68,30 @@
        return R.ok(agvWrkMastPage);
    }
    @RequestMapping(value = "/wrkMast/list/error")
    @ManagerAuth
    public R listerror(@RequestParam(defaultValue = "1") Integer curr,
                  @RequestParam(defaultValue = "10") Integer limit,
                  @RequestParam(required = false) String orderByField,
                  @RequestParam(required = false) String orderByType,
                  @RequestParam(required = false) String condition,
                  @RequestParam Map<String, Object> param) {
        EntityWrapper<AgvWrkMast> wrapper = new EntityWrapper<>();
        Config config = configService.selectOne(new EntityWrapper<Config>().eq("code", "WRKMAST_WARN_CONFIG"));
        if (config != null && config.getValue() != null) {
            List<WrkMastConfig> wrkMastConfigs = JSONArray.parseArray(config.getValue(), WrkMastConfig.class);
            for (WrkMastConfig wrkMastConfig : wrkMastConfigs) {
                wrapper.eq("wrk_sts", wrkMastConfig.getSts()).le("modi_time", DateUtil.offsetHour(new Date(), -wrkMastConfig.getHours()));
                if (!wrkMastConfigs.get(wrkMastConfigs.size() - 1).equals(wrkMastConfig)) {
                    wrapper.orNew();
                }
            }
            Page<AgvWrkMast> agvWrkMastPage = agvWrkMastService.selectPage(new Page<>(curr, limit), wrapper);
            return R.ok(agvWrkMastPage);
        }
        return R.ok();
    }
    @RequestMapping(value = "/wrkMast/list/auth/dbList")
    @ManagerAuth
    public R dbList(@RequestParam(defaultValue = "1") Integer curr,