提交代码

yy_dev
胡锐 1 year ago
parent 4a5fbf4bb8
commit 0632b96f51
  1. 6
      cweb/src/main/java/com/cweb/controller/BsDeviceController.java
  2. 36
      service/src/main/java/com/hfkj/service/impl/BsDeviceServiceImpl.java

@ -177,6 +177,7 @@ public class BsDeviceController {
@RequestParam(name = "agentName", required = false) String agentName, @RequestParam(name = "agentName", required = false) String agentName,
@RequestParam(name = "salesmanName", required = false) String salesmanName, @RequestParam(name = "salesmanName", required = false) String salesmanName,
@RequestParam(name = "merName", required = false) String merName, @RequestParam(name = "merName", required = false) String merName,
@RequestParam(name = "storeId", required = false) String storeId,
@RequestParam(name = "storeName", required = false) String storeName, @RequestParam(name = "storeName", required = false) String storeName,
@RequestParam(name = "deviceType", required = false) Integer deviceType, @RequestParam(name = "deviceType", required = false) Integer deviceType,
@RequestParam(name = "deviceNo", required = false) String deviceNo, @RequestParam(name = "deviceNo", required = false) String deviceNo,
@ -202,6 +203,7 @@ public class BsDeviceController {
param.put("salesmanName", salesmanName); param.put("salesmanName", salesmanName);
param.put("merName", merName); param.put("merName", merName);
param.put("storeName", storeName); param.put("storeName", storeName);
param.put("storeId", storeId);
} else if (userModel.getSecUser().getObjectType().equals(SecUserTypeEnum.type1.getNumber())) { } else if (userModel.getSecUser().getObjectType().equals(SecUserTypeEnum.type1.getNumber())) {
param.put("companyId", userModel.getBsCompany().getId()); param.put("companyId", userModel.getBsCompany().getId());
@ -209,21 +211,25 @@ public class BsDeviceController {
param.put("salesmanName", salesmanName); param.put("salesmanName", salesmanName);
param.put("merName", merName); param.put("merName", merName);
param.put("storeName", storeName); param.put("storeName", storeName);
param.put("storeId", storeId);
} else if (userModel.getSecUser().getObjectType().equals(SecUserTypeEnum.type2.getNumber())) { } else if (userModel.getSecUser().getObjectType().equals(SecUserTypeEnum.type2.getNumber())) {
param.put("agentId", userModel.getAgent().getId()); param.put("agentId", userModel.getAgent().getId());
param.put("salesmanName", salesmanName); param.put("salesmanName", salesmanName);
param.put("merName", merName); param.put("merName", merName);
param.put("storeName", storeName); param.put("storeName", storeName);
param.put("storeId", storeId);
} else if (userModel.getSecUser().getObjectType().equals(SecUserTypeEnum.type3.getNumber())) { } else if (userModel.getSecUser().getObjectType().equals(SecUserTypeEnum.type3.getNumber())) {
param.put("salesmanId", userModel.getSalesman().getId()); param.put("salesmanId", userModel.getSalesman().getId());
param.put("merName", merName); param.put("merName", merName);
param.put("storeName", storeName); param.put("storeName", storeName);
param.put("storeId", storeId);
} else if (userModel.getSecUser().getObjectType().equals(SecUserTypeEnum.type4.getNumber())) { } else if (userModel.getSecUser().getObjectType().equals(SecUserTypeEnum.type4.getNumber())) {
param.put("merId", userModel.getMer().getId()); param.put("merId", userModel.getMer().getId());
param.put("storeName", storeName); param.put("storeName", storeName);
param.put("storeId", storeId);
} else if (userModel.getSecUser().getObjectType().equals(SecUserTypeEnum.type5.getNumber())) { } else if (userModel.getSecUser().getObjectType().equals(SecUserTypeEnum.type5.getNumber())) {
param.put("storeId", userModel.getStore().getId()); param.put("storeId", userModel.getStore().getId());

@ -229,6 +229,14 @@ public class BsDeviceServiceImpl implements BsDeviceService {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "无法解绑,未绑定门店"); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "无法解绑,未绑定门店");
} }
// 设备操作日志
deviceOperateLogService.insertLog(device.getId(),
DeviceOpTypeEnum.type9,
"设备解绑",
device.getOpUserId(),
device.getOpUserName(),
device.getSalesmanId());
device.setSalesmanId(null); device.setSalesmanId(null);
device.setSalesmanName(null); device.setSalesmanName(null);
device.setMerId(null); device.setMerId(null);
@ -237,13 +245,6 @@ public class BsDeviceServiceImpl implements BsDeviceService {
device.setStoreName(null); device.setStoreName(null);
editDevice(device); editDevice(device);
// 设备操作日志
deviceOperateLogService.insertLog(device.getId(),
DeviceOpTypeEnum.type9,
"设备解绑",
device.getOpUserId(),
device.getOpUserName(),
device.getSalesmanId());
} }
@Override @Override
@ -265,7 +266,7 @@ public class BsDeviceServiceImpl implements BsDeviceService {
if (store == null) { if (store == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到门店信息"); 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, "门店状态异常"); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "门店状态异常");
} }
@ -282,6 +283,8 @@ public class BsDeviceServiceImpl implements BsDeviceService {
device.setMerName(mer.getMerName()); device.setMerName(mer.getMerName());
device.setStoreId(storeId); device.setStoreId(storeId);
device.setStoreName(store.getName()); device.setStoreName(store.getName());
device.setBindStatus(true);
device.setBindTime(new Date());
editDevice(device); editDevice(device);
// 设备操作日志 // 设备操作日志
@ -310,13 +313,6 @@ public class BsDeviceServiceImpl implements BsDeviceService {
if (device.getStoreId() == null) { if (device.getStoreId() == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "无法解绑,未绑定门店"); 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(), deviceOperateLogService.insertLog(device.getId(),
DeviceOpTypeEnum.type11, DeviceOpTypeEnum.type11,
@ -324,6 +320,16 @@ public class BsDeviceServiceImpl implements BsDeviceService {
device.getOpUserId(), device.getOpUserId(),
device.getOpUserName(), device.getOpUserName(),
device.getStoreId()); device.getStoreId());
device.setMerId(null);
device.setMerName(null);
device.setStoreId(null);
device.setStoreName(null);
device.setBindStatus(false);
device.setBindTime(null);
editDevice(device);
} }
@Override @Override

Loading…
Cancel
Save