From 76c87767530e7e5c9711fcdad14cdb55e7866cc4 Mon Sep 17 00:00:00 2001 From: Junjie <xjj@123> Date: 星期五, 19 四月 2024 10:20:22 +0800 Subject: [PATCH] # --- zy-asrs-wms/src/main/java/com/zy/asrs/wms/controller/StaDescController.java | 27 ++++++++++++++++++++------- 1 files changed, 20 insertions(+), 7 deletions(-) diff --git a/zy-asrs-wms/src/main/java/com/zy/asrs/wms/controller/StaDescController.java b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/controller/StaDescController.java index 80076b9..aa079a0 100644 --- a/zy-asrs-wms/src/main/java/com/zy/asrs/wms/controller/StaDescController.java +++ b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/controller/StaDescController.java @@ -1,11 +1,10 @@ package com.zy.asrs.wms.controller; import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.zy.asrs.common.wms.entity.StaDesc; -import com.zy.asrs.common.wms.service.StaDescService; +import com.zy.asrs.common.domain.entity.StaDesc; +import com.zy.asrs.common.sys.service.StaDescService; import com.zy.asrs.framework.annotations.ManagerAuth; import com.zy.asrs.framework.common.Cools; import com.zy.asrs.framework.common.R; @@ -37,6 +36,7 @@ @RequestParam(required = false) String timeRange, @RequestParam Map<String, Object> param) { LambdaQueryWrapper<StaDesc> wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(StaDesc::getHostId, getHostId()); if (!Cools.isEmpty(condition)) { wrapper.like(StaDesc::getTypeId, condition); } @@ -45,6 +45,12 @@ wrapper.ge(StaDesc::getAppeTime, DateUtils.convert(range[0])); wrapper.le(StaDesc::getAppeTime, DateUtils.convert(range[1])); } + if (!Cools.isEmpty(param.get("device_no"))) { + wrapper.eq(StaDesc::getDeviceNo, param.get("device_no")); + } + if (!Cools.isEmpty(param.get("device_stn"))) { + wrapper.eq(StaDesc::getDeviceStn, param.get("device_stn")); + } return R.ok(staDescService.page(new Page<>(curr, limit), wrapper)); } @@ -52,6 +58,7 @@ @RequestMapping(value = "/staDesc/add/auth") @ManagerAuth public R add(StaDesc staDesc) { + staDesc.setHostId(getHostId()); staDescService.save(staDesc); return R.ok(); } @@ -67,10 +74,14 @@ } @RequestMapping(value = "/staDesc/delete/auth") - @ManagerAuth - public R delete(@RequestParam(value="ids[]") Long[] ids){ - for (Long id : ids){ - staDescService.removeById(id); + @ManagerAuth(memo = "绔欑偣璺緞鍒犻櫎") + public R delete(@RequestParam String param){ + List<StaDesc> list = JSONArray.parseArray(param, StaDesc.class); + if (Cools.isEmpty(list)){ + return R.error(); + } + for (StaDesc entity : list){ + staDescService.remove(new LambdaQueryWrapper<>(entity)); } return R.ok(); } @@ -79,6 +90,7 @@ @ManagerAuth public R query(String condition) { LambdaQueryWrapper<StaDesc> wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(StaDesc::getHostId, getHostId()); wrapper.like(StaDesc::getTypeId, condition); Page<StaDesc> page = staDescService.page(new Page<>(0, 10), wrapper); List<Map<String, Object>> result = new ArrayList<>(); @@ -96,6 +108,7 @@ public R getDataKV(@RequestParam(required = false) String condition) { List<KeyValueVo> vos = new ArrayList<>(); LambdaQueryWrapper<StaDesc> wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(StaDesc::getHostId, getHostId()); if (!Cools.isEmpty(condition)) { wrapper.like(StaDesc::getTypeId, condition); } -- Gitblit v1.9.1