From 0632b96f5195473eb2bbfee5b32630d84b66cc18 Mon Sep 17 00:00:00 2001 From: hurui <177768073@qq.com> Date: Thu, 3 Aug 2023 16:47:13 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cweb/controller/BsDeviceController.java | 6 ++++ .../service/impl/BsDeviceServiceImpl.java | 36 +++++++++++-------- 2 files changed, 27 insertions(+), 15 deletions(-) diff --git a/cweb/src/main/java/com/cweb/controller/BsDeviceController.java b/cweb/src/main/java/com/cweb/controller/BsDeviceController.java index fa4b751..13a8783 100644 --- a/cweb/src/main/java/com/cweb/controller/BsDeviceController.java +++ b/cweb/src/main/java/com/cweb/controller/BsDeviceController.java @@ -177,6 +177,7 @@ public class BsDeviceController { @RequestParam(name = "agentName", required = false) String agentName, @RequestParam(name = "salesmanName", required = false) String salesmanName, @RequestParam(name = "merName", required = false) String merName, + @RequestParam(name = "storeId", required = false) String storeId, @RequestParam(name = "storeName", required = false) String storeName, @RequestParam(name = "deviceType", required = false) Integer deviceType, @RequestParam(name = "deviceNo", required = false) String deviceNo, @@ -202,6 +203,7 @@ public class BsDeviceController { param.put("salesmanName", salesmanName); param.put("merName", merName); param.put("storeName", storeName); + param.put("storeId", storeId); } else if (userModel.getSecUser().getObjectType().equals(SecUserTypeEnum.type1.getNumber())) { param.put("companyId", userModel.getBsCompany().getId()); @@ -209,21 +211,25 @@ public class BsDeviceController { param.put("salesmanName", salesmanName); param.put("merName", merName); param.put("storeName", storeName); + param.put("storeId", storeId); } else if (userModel.getSecUser().getObjectType().equals(SecUserTypeEnum.type2.getNumber())) { param.put("agentId", userModel.getAgent().getId()); param.put("salesmanName", salesmanName); param.put("merName", merName); param.put("storeName", storeName); + param.put("storeId", storeId); } else if (userModel.getSecUser().getObjectType().equals(SecUserTypeEnum.type3.getNumber())) { param.put("salesmanId", userModel.getSalesman().getId()); param.put("merName", merName); param.put("storeName", storeName); + param.put("storeId", storeId); } else if (userModel.getSecUser().getObjectType().equals(SecUserTypeEnum.type4.getNumber())) { param.put("merId", userModel.getMer().getId()); param.put("storeName", storeName); + param.put("storeId", storeId); } else if (userModel.getSecUser().getObjectType().equals(SecUserTypeEnum.type5.getNumber())) { param.put("storeId", userModel.getStore().getId()); diff --git a/service/src/main/java/com/hfkj/service/impl/BsDeviceServiceImpl.java b/service/src/main/java/com/hfkj/service/impl/BsDeviceServiceImpl.java index 534d4c8..ee0488d 100644 --- a/service/src/main/java/com/hfkj/service/impl/BsDeviceServiceImpl.java +++ b/service/src/main/java/com/hfkj/service/impl/BsDeviceServiceImpl.java @@ -229,6 +229,14 @@ public class BsDeviceServiceImpl implements BsDeviceService { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "无法解绑,未绑定门店"); } + // 设备操作日志 + deviceOperateLogService.insertLog(device.getId(), + DeviceOpTypeEnum.type9, + "设备解绑", + device.getOpUserId(), + device.getOpUserName(), + device.getSalesmanId()); + device.setSalesmanId(null); device.setSalesmanName(null); device.setMerId(null); @@ -237,13 +245,6 @@ public class BsDeviceServiceImpl implements BsDeviceService { device.setStoreName(null); editDevice(device); - // 设备操作日志 - deviceOperateLogService.insertLog(device.getId(), - DeviceOpTypeEnum.type9, - "设备解绑", - device.getOpUserId(), - device.getOpUserName(), - device.getSalesmanId()); } @Override @@ -265,7 +266,7 @@ public class BsDeviceServiceImpl implements BsDeviceService { if (store == null) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到门店信息"); } - if (!store.getStatus().equals(StoreStatusEnum.status1.getNumber())) { + if (!store.getStatus().equals(StoreStatusEnum.status2.getNumber())) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "门店状态异常"); } @@ -282,6 +283,8 @@ public class BsDeviceServiceImpl implements BsDeviceService { device.setMerName(mer.getMerName()); device.setStoreId(storeId); device.setStoreName(store.getName()); + device.setBindStatus(true); + device.setBindTime(new Date()); editDevice(device); // 设备操作日志 @@ -310,13 +313,6 @@ public class BsDeviceServiceImpl implements BsDeviceService { if (device.getStoreId() == null) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "无法解绑,未绑定门店"); } - - device.setMerId(null); - device.setMerName(null); - device.setStoreId(null); - device.setStoreName(null); - editDevice(device); - // 设备操作日志 deviceOperateLogService.insertLog(device.getId(), DeviceOpTypeEnum.type11, @@ -324,6 +320,16 @@ public class BsDeviceServiceImpl implements BsDeviceService { device.getOpUserId(), device.getOpUserName(), device.getStoreId()); + + device.setMerId(null); + device.setMerName(null); + device.setStoreId(null); + device.setStoreName(null); + device.setBindStatus(false); + device.setBindTime(null); + editDevice(device); + + } @Override