Junjie
1 天以前 a4f07b2a0ddb6c210e05afbbb491feeb466203e7
src/main/java/com/zy/asrs/controller/BasStationDeviceController.java
@@ -1,6 +1,6 @@
package com.zy.asrs.controller;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.zy.asrs.entity.BasCrnp;
import com.zy.asrs.entity.BasDevp;
import com.zy.asrs.entity.BasDualCrnp;
@@ -42,7 +42,7 @@
    @RequestMapping("/list/auth")
    @ManagerAuth
    public R list() {
        return R.ok(basStationDeviceService.selectList(new EntityWrapper<>()));
        return R.ok(basStationDeviceService.list(new QueryWrapper<>()));
    }
    @RequestMapping("/save/auth")
@@ -55,9 +55,9 @@
        
        // However, to be safer, we should probably only delete for the stations involved or delete all if it's a full save.
        // Let's assume the UI sends the full current state of configuration.
        basStationDeviceService.delete(new EntityWrapper<>());
        basStationDeviceService.remove(new QueryWrapper<>());
        if (list != null && !list.isEmpty()) {
            basStationDeviceService.insertBatch(list);
            basStationDeviceService.saveBatch(list);
        }
        return R.ok();
    }
@@ -68,20 +68,20 @@
        Map<String, Object> data = new HashMap<>();
        
        List<Integer> stationList = new ArrayList<>();
        List<BasDevp> devps = basDevpService.selectList(new EntityWrapper<BasDevp>().eq("status", 1));
        List<BasDevp> devps = basDevpService.list(new QueryWrapper<BasDevp>().eq("status", 1));
        for (BasDevp devp : devps) {
            for (StationObjModel stationObjModel : devp.getBarcodeStationList$()) {
                stationList.add(stationObjModel.getStationId());
            }
        }
        List<BasStation> stations = basStationService.selectList(new EntityWrapper<BasStation>().in("station_id", stationList));
        List<BasStation> stations = basStationService.list(new QueryWrapper<BasStation>().in("station_id", stationList));
        data.put("stations", stations);
        
        // Get Devices (Crn and DualCrn)
        List<Map<String, Object>> devices = new ArrayList<>();
        
        List<BasCrnp> crns = basCrnpService.selectList(new EntityWrapper<BasCrnp>().eq("status", 1));
        List<BasCrnp> crns = basCrnpService.list(new QueryWrapper<BasCrnp>().eq("status", 1));
        for (BasCrnp crn : crns) {
            Map<String, Object> d = new HashMap<>();
            d.put("deviceNo", crn.getCrnNo());
@@ -90,7 +90,7 @@
            devices.add(d);
        }
        
        List<BasDualCrnp> dualCrns = basDualCrnpService.selectList(new EntityWrapper<BasDualCrnp>().eq("status", 1));
        List<BasDualCrnp> dualCrns = basDualCrnpService.list(new QueryWrapper<BasDualCrnp>().eq("status", 1));
        for (BasDualCrnp dualCrn : dualCrns) {
            Map<String, Object> d = new HashMap<>();
            d.put("deviceNo", dualCrn.getCrnNo());
@@ -102,7 +102,7 @@
        data.put("devices", devices);
        
        // Get existing relations
        List<BasStationDevice> relations = basStationDeviceService.selectList(new EntityWrapper<>());
        List<BasStationDevice> relations = basStationDeviceService.list(new QueryWrapper<>());
        data.put("relations", relations);
        
        return R.ok(data);