wifi等
This commit is contained in:
parent
624bd27796
commit
a3624ee0db
|
@ -5,23 +5,24 @@ import com.ruoyi.common.annotation.Log;
|
|||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.domain.ValidGroup;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.ss.equipment.domain.EquipmentVO;
|
||||
import com.ruoyi.ss.equipment.service.IEquipmentService;
|
||||
import com.ruoyi.ss.feeRule.service.IFeeRuleValidator;
|
||||
import com.ruoyi.ss.room.domain.BandRuleDTO;
|
||||
import com.ruoyi.ss.room.domain.Room;
|
||||
import com.ruoyi.ss.room.domain.RoomDTO;
|
||||
import com.ruoyi.ss.room.domain.RoomVO;
|
||||
import com.ruoyi.ss.room.domain.*;
|
||||
import com.ruoyi.ss.room.service.IRoomAssembler;
|
||||
import com.ruoyi.ss.room.service.IRoomService;
|
||||
import com.ruoyi.ss.room.service.IRoomValidator;
|
||||
import com.ruoyi.ss.room.service.RoomConverter;
|
||||
import io.swagger.annotations.Api;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 房间Controller
|
||||
* @author qzz
|
||||
|
@ -197,4 +198,24 @@ public class AppRoomController extends BaseController {
|
|||
return toAjax(roomService.unBandRule(ruleId,roomId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 配置房间wifi
|
||||
*/
|
||||
@PutMapping("/setWifi")
|
||||
public AjaxResult setWifi(@RequestBody SetWifiDTO dto) {
|
||||
logger.info("配置房间wifi:【{}】", JSON.toJSONString(dto));
|
||||
return toAjax(roomService.setWifi(dto));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查商户下所有房间和设施列表
|
||||
*/
|
||||
@GetMapping("/getWifiList")
|
||||
public AjaxResult getWifiList()
|
||||
{
|
||||
logger.info("查询商户下所有房间和设施列表");
|
||||
List<WifiObjVO> list = roomService.selectWifiObjList();
|
||||
return success(list);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -26,6 +26,7 @@ import javax.annotation.Resource;
|
|||
import java.util.List;
|
||||
|
||||
import static com.ruoyi.common.constant.ServiceConstants.USER_TYPE_CLEANER;
|
||||
import static com.ruoyi.common.constant.ServiceConstants.USER_TYPE_PARTNER;
|
||||
|
||||
/**
|
||||
* 用户Controller
|
||||
|
@ -49,7 +50,7 @@ public class AppUserController extends BaseController {
|
|||
@GetMapping("/list")
|
||||
public AjaxResult list(UserQuery eUser)
|
||||
{
|
||||
eUser.setUserType(USER_TYPE_CLEANER);
|
||||
// eUser.setUserType(USER_TYPE_CLEANER);
|
||||
List<UserVO> list = userService.selectUserList(eUser);
|
||||
assembleStoreName(list);
|
||||
return success(list);
|
||||
|
@ -72,7 +73,7 @@ public class AppUserController extends BaseController {
|
|||
*/
|
||||
@Log(title = "用户管理", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/addCleaner")
|
||||
public AjaxResult add(@Validated @RequestBody User user)
|
||||
public AjaxResult add(@Validated(ValidGroup.CreateCleaner.class) @RequestBody User user)
|
||||
{
|
||||
user.setUserName(user.getPhonenumber());
|
||||
if (!userService.checkUserNameUnique(user))
|
||||
|
@ -91,11 +92,36 @@ public class AppUserController extends BaseController {
|
|||
return toAjax(userService.insertUser(user));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增合伙人
|
||||
*/
|
||||
@Log(title = "用户管理", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/addPartner")
|
||||
public AjaxResult addPartner(@Validated(ValidGroup.CreatePartner.class) @RequestBody User user)
|
||||
{
|
||||
user.setUserName(user.getPhonenumber());
|
||||
if (!userService.checkUserNameUnique(user))
|
||||
{
|
||||
return error("新增用户'" + user.getUserName() + "'失败,登录账号已存在");
|
||||
}
|
||||
else if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(user))
|
||||
{
|
||||
return error("新增用户'" + user.getUserName() + "'失败,手机号码已存在");
|
||||
}
|
||||
StoreVO storeVO = storeService.selectEStoreByStoreId(user.getStoreId());
|
||||
ServiceUtil.assertion(storeVO == null, "店铺不存在");
|
||||
user.setCreateBy(getUsername());
|
||||
user.setUserType(USER_TYPE_PARTNER);
|
||||
user.setMerchantId(storeVO.getMerchantId());
|
||||
return toAjax(userService.insertUser(user));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 修改保洁员
|
||||
*/
|
||||
@Log(title = "修改保洁员", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/editCleaner")
|
||||
@PutMapping("/editUser")
|
||||
public AjaxResult edit(@RequestBody @Validated(ValidGroup.Update.class) User user)
|
||||
{
|
||||
logger.info("修改用户:【{}】", JSON.toJSONString(user));
|
||||
|
@ -132,9 +158,9 @@ public class AppUserController extends BaseController {
|
|||
if(userVO == null){
|
||||
return error(StrUtil.format("用户【{}】不存在",userId));
|
||||
}
|
||||
if(!USER_TYPE_CLEANER.equals(userVO.getUserType())){
|
||||
return error(StrUtil.format("用户【{}】非保洁员,不能删除",userId));
|
||||
}
|
||||
// if(!USER_TYPE_CLEANER.equals(userVO.getUserType())){
|
||||
// return error(StrUtil.format("用户【{}】非保洁员,不能删除",userId));
|
||||
// }
|
||||
}
|
||||
return toAjax(userService.deleteUserByIds(userIds));
|
||||
}
|
||||
|
|
|
@ -0,0 +1,83 @@
|
|||
package com.ruoyi.web.controller.app;
|
||||
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.domain.ValidGroup;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.ss.wifi.domain.Wifi;
|
||||
import com.ruoyi.ss.wifi.domain.WifiQuery;
|
||||
import com.ruoyi.ss.wifi.domain.WifiVO;
|
||||
import com.ruoyi.ss.wifi.service.IWifiService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* wifiController
|
||||
*
|
||||
* @author qzz
|
||||
* @date 2025-01-06
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/app/wifi")
|
||||
public class AppWifiController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IWifiService wifiService;
|
||||
|
||||
/**
|
||||
* 查询wifi列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(WifiQuery query)
|
||||
{
|
||||
startPage();
|
||||
startOrderBy();
|
||||
query.setMerchantId(getUserId());
|
||||
List<WifiVO> list = wifiService.selectWifiList(query);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取wifi详细信息
|
||||
*/
|
||||
@GetMapping(value = "/{wifiId}")
|
||||
public AjaxResult getInfo(@PathVariable("wifiId") Long wifiId)
|
||||
{
|
||||
return success(wifiService.selectWifiByWifiId(wifiId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增wifi
|
||||
*/
|
||||
@Log(title = "wifi", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody @Validated(ValidGroup.Create.class)Wifi wifi)
|
||||
{
|
||||
return toAjax(wifiService.insertWifi(wifi));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改wifi
|
||||
*/
|
||||
@Log(title = "wifi", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody Wifi wifi)
|
||||
{
|
||||
return toAjax(wifiService.updateWifi(wifi));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除wifi
|
||||
*/
|
||||
@Log(title = "wifi", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{wifiIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] wifiIds)
|
||||
{
|
||||
return toAjax(wifiService.deleteWifiByWifiIds(wifiIds));
|
||||
}
|
||||
}
|
|
@ -58,6 +58,8 @@ public class DeviceController extends BaseController
|
|||
startPage();
|
||||
List<DeviceVO> list = deviceService.selectSmDeviceList(smDevice);
|
||||
// deviceAssembler.assembleRealServiceRate(list);
|
||||
deviceAssembler.assemblePlacementStatus(list, smDevice.getPlacementStatus());
|
||||
deviceAssembler.assembleEquipment(list);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,119 @@
|
|||
package com.ruoyi.web.controller.system;
|
||||
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.ss.equipment.domain.Equipment;
|
||||
import com.ruoyi.ss.equipment.domain.EquipmentQuery;
|
||||
import com.ruoyi.ss.equipment.domain.EquipmentVO;
|
||||
import com.ruoyi.ss.equipment.service.IEquipmentAssembler;
|
||||
import com.ruoyi.ss.equipment.service.IEquipmentService;
|
||||
import com.ruoyi.ss.room.domain.RoomQuery;
|
||||
import com.ruoyi.ss.room.domain.RoomVO;
|
||||
import com.ruoyi.ss.room.service.IRoomService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
import static com.ruoyi.common.constant.ServiceConstants.ROOM_TYPE2_HALL;
|
||||
|
||||
/**
|
||||
* 大厅设施Controller
|
||||
*
|
||||
* @author qzz
|
||||
* @date 2024-12-21
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/hallEqu")
|
||||
public class HallEquController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IEquipmentService equipmentService;
|
||||
|
||||
@Autowired
|
||||
private IRoomService roomService;
|
||||
|
||||
@Autowired
|
||||
private IEquipmentAssembler equipmentAssembler;
|
||||
|
||||
/**
|
||||
* 查询设施列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:equipment:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(EquipmentQuery query)
|
||||
{
|
||||
startPage();
|
||||
startOrderBy();
|
||||
RoomQuery query1 = new RoomQuery();
|
||||
query1.setType2(ROOM_TYPE2_HALL);
|
||||
List<Long> roomIds = roomService.selectRoomIdsList(query1);
|
||||
query.setRoomIds(roomIds);
|
||||
List<EquipmentVO> list = equipmentService.selectEquipmentList(query);
|
||||
equipmentAssembler.assembleDeviceInfo(list);
|
||||
equipmentAssembler.assembleRuleInfo(list);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出设施列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:equipment:export')")
|
||||
@Log(title = "设施", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, EquipmentQuery query)
|
||||
{
|
||||
List<EquipmentVO> list = equipmentService.selectEquipmentList(query);
|
||||
ExcelUtil<EquipmentVO> util = new ExcelUtil<EquipmentVO>(EquipmentVO.class);
|
||||
util.exportExcel(response, list, "设施数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取设施详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:equipment:query')")
|
||||
@GetMapping(value = "/{equipmentId}")
|
||||
public AjaxResult getInfo(@PathVariable("equipmentId") Long equipmentId)
|
||||
{
|
||||
return success(equipmentService.selectEquipmentByEquipmentId(equipmentId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增设施
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:equipment:add')")
|
||||
@Log(title = "设施", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody Equipment equipment)
|
||||
{
|
||||
return toAjax(equipmentService.insertEquipment(equipment));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改设施
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:equipment:edit')")
|
||||
@Log(title = "设施", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody Equipment equipment)
|
||||
{
|
||||
return toAjax(equipmentService.updateEquipment(equipment));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除设施
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:equipment:remove')")
|
||||
@Log(title = "设施", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{equipmentIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] equipmentIds)
|
||||
{
|
||||
return toAjax(equipmentService.deleteEquipmentByEquipmentIds(equipmentIds));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,108 @@
|
|||
package com.ruoyi.web.controller.system;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.ruoyi.ss.wifi.domain.Wifi;
|
||||
import com.ruoyi.ss.wifi.domain.WifiQuery;
|
||||
import com.ruoyi.ss.wifi.domain.WifiVO;
|
||||
import com.ruoyi.ss.wifi.service.IWifiService;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* wifiController
|
||||
*
|
||||
* @author qzz
|
||||
* @date 2025-01-06
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/wifi")
|
||||
public class WifiController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IWifiService wifiService;
|
||||
|
||||
/**
|
||||
* 查询wifi列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:wifi:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(WifiQuery query)
|
||||
{
|
||||
startPage();
|
||||
startOrderBy();
|
||||
List<WifiVO> list = wifiService.selectWifiList(query);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出wifi列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:wifi:export')")
|
||||
@Log(title = "wifi", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, WifiQuery query)
|
||||
{
|
||||
List<WifiVO> list = wifiService.selectWifiList(query);
|
||||
ExcelUtil<WifiVO> util = new ExcelUtil<WifiVO>(WifiVO.class);
|
||||
util.exportExcel(response, list, "wifi数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取wifi详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:wifi:query')")
|
||||
@GetMapping(value = "/{wifiId}")
|
||||
public AjaxResult getInfo(@PathVariable("wifiId") Long wifiId)
|
||||
{
|
||||
return success(wifiService.selectWifiByWifiId(wifiId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增wifi
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:wifi:add')")
|
||||
@Log(title = "wifi", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody Wifi wifi)
|
||||
{
|
||||
return toAjax(wifiService.insertWifi(wifi));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改wifi
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:wifi:edit')")
|
||||
@Log(title = "wifi", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody Wifi wifi)
|
||||
{
|
||||
return toAjax(wifiService.updateWifi(wifi));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除wifi
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:wifi:remove')")
|
||||
@Log(title = "wifi", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{wifiIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] wifiIds)
|
||||
{
|
||||
return toAjax(wifiService.deleteWifiByWifiIds(wifiIds));
|
||||
}
|
||||
}
|
|
@ -736,6 +736,11 @@ public class ServiceConstants {
|
|||
*/
|
||||
public static final String USER_TYPE_CLEANER = "04";
|
||||
|
||||
/**
|
||||
* 05 - 合伙人
|
||||
*/
|
||||
public static final String USER_TYPE_PARTNER = "05";
|
||||
|
||||
/**
|
||||
* 09 - 超级管理员
|
||||
*/
|
||||
|
|
|
@ -24,5 +24,9 @@ public interface ValidGroup {
|
|||
// 退款
|
||||
interface Refund extends Default{}
|
||||
|
||||
// 新增保洁
|
||||
interface CreateCleaner extends Default {}
|
||||
|
||||
// 新增合伙人
|
||||
interface CreatePartner extends Default {}
|
||||
}
|
||||
|
|
|
@ -32,4 +32,8 @@ public class BasicConfigDTO {
|
|||
@NotNull(message = "违约金不能为空")
|
||||
private BigDecimal penalty;
|
||||
|
||||
@ApiModelProperty(value = "提前开始使用时间")
|
||||
@NotNull(message = "提前开始使用时间")
|
||||
private int beforeTime;
|
||||
|
||||
}
|
||||
|
|
|
@ -41,6 +41,7 @@ public class User extends BaseEntity
|
|||
|
||||
/** 真实姓名 */
|
||||
@Excel(name = "真实姓名")
|
||||
@NotBlank(message = "真实姓名不能为空", groups = {ValidGroup.CreateCleaner.class, ValidGroup.CreatePartner.class})
|
||||
private String realName;
|
||||
|
||||
/** 身份证号 */
|
||||
|
@ -57,6 +58,7 @@ public class User extends BaseEntity
|
|||
|
||||
/** 手机号码 */
|
||||
@Excel(name = "手机号码")
|
||||
@NotBlank(message = "手机号码不能为空", groups = {ValidGroup.CreateCleaner.class, ValidGroup.CreatePartner.class})
|
||||
private String phonenumber;
|
||||
|
||||
/** 出生年月 */
|
||||
|
@ -115,6 +117,7 @@ public class User extends BaseEntity
|
|||
public Long payChannel;
|
||||
|
||||
/** 分账比例 */
|
||||
@NotNull(message = "分账比例不能为空", groups = {ValidGroup.CreatePartner.class})
|
||||
private BigDecimal dividendProportion;
|
||||
|
||||
/** 商户id */
|
||||
|
@ -130,7 +133,7 @@ public class User extends BaseEntity
|
|||
private Long roleId;
|
||||
|
||||
/** 店铺ID */
|
||||
@NotNull(message = "店铺ID不能为空")
|
||||
@NotNull(message = "店铺ID不能为空", groups = {ValidGroup.CreateCleaner.class, ValidGroup.CreatePartner.class})
|
||||
private Long storeId;
|
||||
|
||||
/** 服务费比例 */
|
||||
|
@ -149,6 +152,9 @@ public class User extends BaseEntity
|
|||
@ApiModelProperty(value = "违约金比例")
|
||||
private BigDecimal penalty;
|
||||
|
||||
@ApiModelProperty(value = "提前开始使用时间")
|
||||
private int beforeTime;
|
||||
|
||||
public User() {
|
||||
}
|
||||
|
||||
|
|
|
@ -8,12 +8,15 @@ import com.fasterxml.jackson.annotation.JsonView;
|
|||
//import com.ruoyi.ss.device.domain.DeviceView;
|
||||
//import com.ruoyi.ss.suit.domain.SuitVO;
|
||||
import com.ruoyi.common.core.domain.JsonViewProfile;
|
||||
import com.ruoyi.common.core.domain.ValidGroup;
|
||||
import com.ruoyi.ss.device.domain.Device;
|
||||
import com.ruoyi.ss.device.domain.DeviceView;
|
||||
import com.ruoyi.ss.equipment.domain.EquipmentVO;
|
||||
import com.ruoyi.system.iot.interfaces.IotDevice;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalTime;
|
||||
import java.util.List;
|
||||
|
@ -110,6 +113,9 @@ public class DeviceVO extends Device implements IotDevice {
|
|||
@ApiModelProperty("设备投放状态")
|
||||
private String placementStatus;
|
||||
|
||||
@ApiModelProperty("设施对象")
|
||||
private EquipmentVO equ;
|
||||
|
||||
@Override
|
||||
public String iotMac1() {
|
||||
return getMac();
|
||||
|
|
|
@ -62,4 +62,9 @@ public interface DeviceAssembler {
|
|||
default void assembleAllowSwitch(DeviceVO device, Long userId) {
|
||||
assembleAllowSwitch(Collections.singletonList(device), userId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 拼接设施信息
|
||||
*/
|
||||
void assembleEquipment(List<DeviceVO> list);
|
||||
}
|
||||
|
|
|
@ -22,6 +22,7 @@ import com.ruoyi.common.utils.collection.CollectionUtils;
|
|||
import com.ruoyi.ss.device.domain.vo.DeviceVO;
|
||||
import com.ruoyi.ss.device.service.DeviceAssembler;
|
||||
import com.ruoyi.ss.device.service.DeviceValidator;
|
||||
import com.ruoyi.ss.equipment.domain.EquipmentVO;
|
||||
import com.ruoyi.ss.equipment.service.IEquipmentService;
|
||||
import com.ruoyi.ss.room.service.IRoomService;
|
||||
import com.ruoyi.ss.store.service.IStoreService;
|
||||
|
@ -178,8 +179,6 @@ public class DeviceAssemblerImpl implements DeviceAssembler {
|
|||
for (DeviceVO device : list){
|
||||
List<Long> roomIds = equipmentService.selectRoomIdByDeviceId(device.getDeviceId());
|
||||
device.setPlacementStatus(roomIds.isEmpty() ? DEVICE_STATUS_PLACEMENT_NOT_PLACED : DEVICE_PLACEMENT_STATUS_PLACED);
|
||||
// Long storeId = equipmentService.selectStoreIdByDeviceId(device.getDeviceId());
|
||||
// device.setPlacementStatus(storeId == null ? DEVICE_STATUS_PLACEMENT_NOT_PLACED : DEVICE_PLACEMENT_STATUS_PLACED);
|
||||
}
|
||||
// list通过placementStatus过滤
|
||||
if (StringUtils.isNotEmpty(placementStatus)) {
|
||||
|
@ -255,4 +254,18 @@ public class DeviceAssemblerImpl implements DeviceAssembler {
|
|||
// device.setAllowSwitch(false);
|
||||
// }
|
||||
}
|
||||
|
||||
/**
|
||||
* 拼接设施对象
|
||||
*/
|
||||
@Override
|
||||
public void assembleEquipment(List<DeviceVO> list) {
|
||||
if (CollectionUtils.isEmptyElement(list)) {
|
||||
return;
|
||||
}
|
||||
for (DeviceVO device : list){
|
||||
EquipmentVO equipmentVO = equipmentService.selectByDeviceId(device.getDeviceId());
|
||||
device.setEqu(equipmentVO);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -79,5 +79,13 @@ public class Equipment extends BaseEntity{
|
|||
// @Size(min = 1, message = "至少需要一个标签", groups = {ValidGroup.Create.class})
|
||||
private List<String> tags;
|
||||
|
||||
@Excel(name = "商户id")
|
||||
@ApiModelProperty("商户id")
|
||||
private Long merchantId;
|
||||
|
||||
@Excel(name = "状态")
|
||||
@ApiModelProperty("状态:0-正常;1-下架")
|
||||
private String status;
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -2,7 +2,12 @@ package com.ruoyi.ss.equipment.domain;
|
|||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class EquipmentQuery extends Equipment{
|
||||
|
||||
/** 房间ids*/
|
||||
private List<Long> roomIds;
|
||||
|
||||
}
|
||||
|
|
|
@ -5,6 +5,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<mapper namespace="com.ruoyi.ss.equipment.mapper.EquipmentMapper">
|
||||
|
||||
<resultMap type="EquipmentVO" id="EquipmentResult" autoMapping="true" >
|
||||
<result property="tags" column="tags" typeHandler="com.ruoyi.system.mapper.typehandler.StringSplitListTypeHandler"/>
|
||||
<result property="ruleIds" column="rule_ids" typeHandler="com.ruoyi.system.mapper.typehandler.LongSplitListTypeHandler"/>
|
||||
</resultMap>
|
||||
|
||||
|
@ -23,6 +24,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
type,
|
||||
device_id,
|
||||
rule_ids,
|
||||
status,
|
||||
unlock_mode,
|
||||
unlock_condition,
|
||||
unlock_time
|
||||
|
@ -34,20 +36,30 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="query.storeId != null and query.storeId != ''"> and store_id = #{query.storeId}</if>
|
||||
<if test="query.picture != null and query.picture != ''"> and picture = #{query.picture}</if>
|
||||
<if test="query.tags != null and query.tags != ''"> and tags = #{query.tags}</if>
|
||||
<if test="query.status != null and query.status != ''"> and query. = #{query.status}</if>
|
||||
<if test="query.roomId != null "> and room_id = #{query.roomId}</if>
|
||||
<if test="query.deviceId != null and query.deviceId != ''"> and device_id = #{query.deviceId}</if>
|
||||
<if test="query.deleted != null "> and deleted = #{query.deleted}</if>
|
||||
<if test="query.type != null and query.type != ''"> and type = #{query.type}</if>
|
||||
<if test="query.merchantId != null and query.merchantId != ''"> and merchant_id = #{query.merchantId}</if>
|
||||
<if test="query.deleted == null">and deleted = false</if>
|
||||
<if test="query.deleted != null">and deleted = #{query.deleted}</if>
|
||||
<if test="query.roomIds != null and query.roomIds.size() > 0">
|
||||
and room_id in
|
||||
<foreach collection="query.roomIds" open="(" close=")" separator="," item="item">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
</sql>
|
||||
|
||||
<select id="selectEquipmentList" parameterType="EquipmentQuery" resultMap="EquipmentResult">
|
||||
<include refid="selectEquipmentVo"/>
|
||||
where deleted = 0
|
||||
<include refid="searchCondition"/>
|
||||
<where>
|
||||
<include refid="searchCondition"/>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectRoomIdByDeviceId" resultType="java.lang.Long">
|
||||
select room_id from ss_equipment where find_in_set(#{deviceId}, device_id);
|
||||
select equipment_id from ss_equipment where find_in_set(#{deviceId}, device_id);
|
||||
</select>
|
||||
|
||||
<select id="selectEquipmentListByRoomId" parameterType="Long" resultMap="EquipmentResult">
|
||||
|
@ -128,6 +140,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="type != null">type,</if>
|
||||
<if test="deviceId != null">device_id,</if>
|
||||
<if test="ruleIds != null">rule_ids,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="unlockMode != null">unlock_mode,</if>
|
||||
<if test="unlockCondition != null">unlock_condition,</if>
|
||||
<if test="unlockTime != null">unlock_time,</if>
|
||||
|
@ -146,6 +159,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="type != null">#{type},</if>
|
||||
<if test="deviceId != null">#{deviceId},</if>
|
||||
<if test="ruleIds != null">#{ruleIds,typeHandler=com.ruoyi.system.mapper.typehandler.LongSplitListTypeHandler},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="unlockMode != null">#{unlockMode},</if>
|
||||
<if test="unlockCondition != null">#{unlockCondition},</if>
|
||||
<if test="unlockTime != null">#{unlockTime},</if>
|
||||
|
@ -185,6 +199,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="data.type != null">type = #{data.type},</if>
|
||||
<if test="data.deviceId != null">device_id = #{data.deviceId},</if>
|
||||
<if test="data.ruleIds != null">rule_ids = #{data.ruleIds,typeHandler=com.ruoyi.system.mapper.typehandler.LongSplitListTypeHandler},</if>
|
||||
<if test="data.status != null">status = #{data.status},</if>
|
||||
<if test="data.unlockMode != null">unlock_mode = #{data.unlockMode},</if>
|
||||
<if test="data.unlockCondition != null">unlock_condition = #{data.unlockCondition},</if>
|
||||
<if test="data.unlockTime != null">unlock_time = #{data.unlockTime},</if>
|
||||
|
|
|
@ -15,6 +15,8 @@ import org.springframework.stereotype.Service;
|
|||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import static com.ruoyi.common.utils.SecurityUtils.getUserId;
|
||||
|
||||
/**
|
||||
* 设施Service业务层处理
|
||||
*
|
||||
|
@ -79,6 +81,7 @@ public class EquipmentServiceImpl implements IEquipmentService
|
|||
if(ObjectUtil.isNotNull(roomVO)){
|
||||
equipment.setStoreId(roomVO.getStoreId());
|
||||
equipment.setStoreName(roomVO.getStoreName());
|
||||
equipment.setMerchantId(getUserId());
|
||||
}
|
||||
return equipmentMapper.insertEquipment(equipment);
|
||||
}
|
||||
|
|
|
@ -527,8 +527,8 @@ public class OrderServiceImpl implements IOrderService
|
|||
order.setStoreId(orderBO.getStore().getStoreId());
|
||||
order.setStoreName(orderBO.getStore().getName());
|
||||
order.setCityId(orderBO.getStore().getCityId());
|
||||
order.setWifi(orderBO.getStore().getWifi());
|
||||
order.setWifiPassword(orderBO.getStore().getWifiPassword());
|
||||
order.setWifi(orderBO.getRoom().getWifi());
|
||||
order.setWifiPassword(orderBO.getRoom().getWifiPassword());
|
||||
order.setLng(orderBO.getStore().getLng());
|
||||
order.setLat(orderBO.getStore().getLat());
|
||||
order.setManagerPhone(orderBO.getStore().getManagerPhone());
|
||||
|
|
|
@ -81,5 +81,13 @@ public class Room extends BaseEntity{
|
|||
@ApiModelProperty("应用到房间的套餐ids")
|
||||
private List<Long> ruleIds;
|
||||
|
||||
@Excel(name = "wifi账号")
|
||||
@ApiModelProperty("wifi账号")
|
||||
private String wifi;
|
||||
|
||||
@Excel(name = "wifi密码")
|
||||
@ApiModelProperty("wifi密码")
|
||||
private String wifiPassword;
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
package com.ruoyi.ss.room.domain;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
@Data
|
||||
public class SetWifiDTO {
|
||||
|
||||
@ApiModelProperty("wifiId")
|
||||
@NotBlank(message = "wifiId不允许为空")
|
||||
private Long wifiId;
|
||||
|
||||
@ApiModelProperty("房间id")
|
||||
@NotNull(message = "房间id不允许为空")
|
||||
private Long roomId;
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
package com.ruoyi.ss.room.domain;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class WifiObjVO {
|
||||
|
||||
/** 房间或设施名称*/
|
||||
@ApiModelProperty("房间或设施名称")
|
||||
private String name;
|
||||
|
||||
/** 房间或设施id*/
|
||||
@ApiModelProperty("房间或设施id")
|
||||
private Long ObjId;
|
||||
|
||||
@ApiModelProperty("wifi名称")
|
||||
private String wifiName;
|
||||
|
||||
|
||||
}
|
|
@ -32,6 +32,14 @@ public interface RoomMapper
|
|||
*/
|
||||
public List<RoomVO> selectERoomList(@Param("query") RoomQuery query);
|
||||
|
||||
/**
|
||||
* 查询房间ids
|
||||
*
|
||||
* @param query 条件
|
||||
* @return 房间集合
|
||||
*/
|
||||
List<Long> selectRoomIdsList(@Param("query") RoomQuery query);
|
||||
|
||||
/**
|
||||
* 新增房间
|
||||
*
|
||||
|
|
|
@ -23,7 +23,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
status,
|
||||
merchant_id,
|
||||
deleted,
|
||||
rule_ids
|
||||
rule_ids,
|
||||
wifi,
|
||||
password
|
||||
from ss_room
|
||||
</sql>
|
||||
|
||||
|
@ -37,12 +39,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="query.tags != null and query.tags != ''"> and tags = #{query.tags}</if>
|
||||
<if test="query.specification != null and query.specification != ''"> and specification = #{query.specification}</if>
|
||||
<if test="query.status != null and query.status != ''"> and status = #{query.status}</if>
|
||||
<if test="query.merchantId != null and query.merchantId != ''"> and merchant_id = #{query.merchantId}</if>
|
||||
<if test="query.deleted == null">and deleted = false</if>
|
||||
<if test="query.deleted != null">and deleted = #{query.deleted}</if>
|
||||
</sql>
|
||||
|
||||
<select id="selectERoomList" parameterType="RoomQuery" resultMap="ERoomResult">
|
||||
<include refid="selectERoomVo"/>
|
||||
where deleted = 0
|
||||
<include refid="searchCondition"/>
|
||||
<where>
|
||||
<include refid="searchCondition"/>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectRoomIdsList" resultType="java.lang.Long">
|
||||
select
|
||||
room_id from ss_room
|
||||
<where>
|
||||
<include refid="searchCondition"/>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectERoomByRoomId" parameterType="Long" resultMap="ERoomResult">
|
||||
|
@ -105,6 +119,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="merchantId != null">merchant_id,</if>
|
||||
<if test="deleted != null">deleted,</if>
|
||||
<if test="ruleIds != null">rule_ids,</if>
|
||||
<if test="wifi != null">wifi,</if>
|
||||
<if test="wifiPassword != null">password,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="roomId != null">#{roomId},</if>
|
||||
|
@ -120,6 +136,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="merchantId != null">#{merchantId},</if>
|
||||
<if test="deleted != null">#{deleted},</if>
|
||||
<if test="ruleIds != null">#{ruleIds,typeHandler=com.ruoyi.system.mapper.typehandler.LongSplitListTypeHandler},</if>
|
||||
<if test="wifi != null">#{wifi},</if>
|
||||
<if test="wifiPassword != null">#{wifiPassword},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
|
@ -144,6 +162,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="data.merchantId != null">merchant_id = #{data.merchantId},</if>
|
||||
<if test="data.deleted != null">deleted = #{data.deleted},</if>
|
||||
<if test="data.ruleIds != null">rule_ids = #{data.ruleIds,typeHandler=com.ruoyi.system.mapper.typehandler.LongSplitListTypeHandler},</if>
|
||||
<if test="data.wifi != null">wifi = #{data.wifi},</if>
|
||||
<if test="data.wifiPassword != null">password = #{data.wifiPassword},</if>
|
||||
</sql>
|
||||
|
||||
<update id="deleteERoomByRoomId" parameterType="Long">
|
||||
|
|
|
@ -37,6 +37,14 @@ public interface IRoomService
|
|||
*/
|
||||
public List<RoomVO> selectERoomList(RoomQuery eRoom);
|
||||
|
||||
/**
|
||||
* 查询房间ids
|
||||
*
|
||||
* @param query 条件
|
||||
* @return 房间集合
|
||||
*/
|
||||
List<Long> selectRoomIdsList(RoomQuery query);
|
||||
|
||||
/**
|
||||
* 根据店铺id查询房间列表
|
||||
*
|
||||
|
@ -152,4 +160,15 @@ public interface IRoomService
|
|||
*/
|
||||
List<String> selectIsExistRule(Long ruleId);
|
||||
|
||||
/**
|
||||
* 配置房间wifi
|
||||
*/
|
||||
int setWifi(SetWifiDTO dto);
|
||||
|
||||
/**
|
||||
* 获取wifi对象列表
|
||||
*/
|
||||
List<WifiObjVO> selectWifiObjList();
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -160,7 +160,7 @@ public class RoomAssemblerImpl implements IRoomAssembler {
|
|||
}
|
||||
List<RoomVO> updatedRooms = new ArrayList<>(hallRooms);
|
||||
// 去掉大厅 if (ServiceConstants.ROOM_TYPE2_HALL.equals(room.getType2()))就是dating
|
||||
rooms.removeIf(room -> ServiceConstants.ROOM_TYPE2_HALL.equals(room.getType2()));
|
||||
rooms.removeIf(room -> ServiceConstants.ROOM_TYPE2_HALL.equals(room.getType2()) || ServiceConstants.ROOM_TYPE2_BATHROOM.equals(room.getType2()));
|
||||
updatedRooms.addAll(rooms);
|
||||
return updatedRooms;
|
||||
}
|
||||
|
|
|
@ -6,17 +6,22 @@ import com.ruoyi.common.constant.ServiceConstants;
|
|||
import com.ruoyi.common.exception.ServiceException;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.common.utils.ServiceUtil;
|
||||
import com.ruoyi.common.utils.collection.CollectionUtils;
|
||||
import com.ruoyi.ss.device.domain.vo.DeviceVO;
|
||||
import com.ruoyi.ss.device.service.DeviceService;
|
||||
import com.ruoyi.ss.equipment.domain.Equipment;
|
||||
import com.ruoyi.ss.equipment.domain.EquipmentQuery;
|
||||
import com.ruoyi.ss.equipment.domain.EquipmentVO;
|
||||
import com.ruoyi.ss.equipment.service.IEquipmentService;
|
||||
import com.ruoyi.ss.feeRule.service.IFeeRuleService;
|
||||
import com.ruoyi.ss.room.domain.*;
|
||||
import com.ruoyi.ss.room.mapper.RoomMapper;
|
||||
import com.ruoyi.ss.room.service.IRoomAssembler;
|
||||
import com.ruoyi.ss.room.service.IRoomService;
|
||||
import com.ruoyi.ss.store.domain.StoreVO;
|
||||
import com.ruoyi.ss.store.service.IStoreService;
|
||||
import com.ruoyi.ss.wifi.domain.WifiVO;
|
||||
import com.ruoyi.ss.wifi.service.IWifiService;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
@ -27,6 +32,7 @@ import java.util.Collections;
|
|||
import java.util.List;
|
||||
|
||||
import static com.ruoyi.common.constant.ServiceConstants.*;
|
||||
import static com.ruoyi.common.utils.SecurityUtils.getUserId;
|
||||
|
||||
/**
|
||||
* 房间Service业务层处理
|
||||
|
@ -55,6 +61,12 @@ public class RoomServiceImpl implements IRoomService
|
|||
@Autowired
|
||||
private IFeeRuleService feeRuleService;
|
||||
|
||||
@Autowired
|
||||
private IWifiService wifiService;
|
||||
|
||||
@Autowired
|
||||
private IRoomAssembler roomAssembler;
|
||||
|
||||
|
||||
/**
|
||||
* 查询房间
|
||||
|
@ -92,6 +104,17 @@ public class RoomServiceImpl implements IRoomService
|
|||
return roomMapper.selectERoomList(eRoom);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询房间ids
|
||||
*
|
||||
* @param query 条件
|
||||
* @return 房间集合
|
||||
*/
|
||||
@Override
|
||||
public List<Long> selectRoomIdsList(RoomQuery query) {
|
||||
return roomMapper.selectRoomIdsList(query);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据店铺id查询房间列表
|
||||
*
|
||||
|
@ -342,4 +365,40 @@ public class RoomServiceImpl implements IRoomService
|
|||
return roomMapper.selectIsExistRule(ruleId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 配置房间wifi
|
||||
*/
|
||||
@Override
|
||||
public int setWifi(SetWifiDTO dto) {
|
||||
WifiVO wifiVO = wifiService.selectWifiByWifiId(dto.getWifiId());
|
||||
ServiceUtil.assertion(wifiVO == null, "wifi不存在");
|
||||
Room room = new Room();
|
||||
room.setWifi(wifiVO.getWifi());
|
||||
room.setWifiPassword(wifiVO.getPassword());
|
||||
room.setRoomId(dto.getRoomId());
|
||||
return roomMapper.updateERoom(room);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取wifi对象列表
|
||||
*/
|
||||
@Override
|
||||
public List<WifiObjVO> selectWifiObjList() {
|
||||
RoomQuery query = new RoomQuery();
|
||||
query.setMerchantId(getUserId());
|
||||
List<RoomVO> roomVOS = roomMapper.selectERoomList(query);
|
||||
List<RoomVO> room = roomAssembler.assembleHallEquipmentList(roomVOS);
|
||||
// 排除掉所有的卫生间,type2为3的是卫生间
|
||||
ArrayList<WifiObjVO> wifiObjVOS = new ArrayList<>();
|
||||
//把room转成wifiObjVOS,roomName对应name字段,roomId对应ObjId字段
|
||||
room.forEach(r -> {
|
||||
WifiObjVO wifiObjVO = new WifiObjVO();
|
||||
wifiObjVO.setName(r.getRoomName());
|
||||
wifiObjVO.setWifiName(r.getWifi());
|
||||
wifiObjVO.setObjId(r.getRoomId());
|
||||
wifiObjVOS.add(wifiObjVO);
|
||||
});
|
||||
return wifiObjVOS;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -146,14 +146,6 @@ public class Store extends BaseEntity{
|
|||
@ApiModelProperty("房间类型标签")
|
||||
private List<String> typeTags;
|
||||
|
||||
@Excel(name = "wifi账号")
|
||||
@ApiModelProperty("wifi账号")
|
||||
private String wifi;
|
||||
|
||||
@Excel(name = "wifi密码")
|
||||
@ApiModelProperty("wifi密码")
|
||||
private String wifiPassword;
|
||||
|
||||
@Excel(name = "起订时间")
|
||||
@ApiModelProperty("起订时间")
|
||||
private String minimumTime;
|
||||
|
|
|
@ -10,16 +10,21 @@ import javax.validation.constraints.NotNull;
|
|||
@Data
|
||||
public class StoreDTO {
|
||||
|
||||
// @ApiModelProperty("大门sn)")
|
||||
@ApiModelProperty("大门sn)")
|
||||
// @NotBlank(message = "大门sn不允许为空", groups = {ValidGroup.BandGate.class})
|
||||
// private String sn;
|
||||
private String sn;
|
||||
|
||||
@ApiModelProperty("大门deviceId)")
|
||||
@NotNull(message = "大门deviceId不允许为空", groups = {ValidGroup.BandGate.class})
|
||||
// @NotNull(message = "大门deviceId不允许为空", groups = {ValidGroup.BandGate.class})
|
||||
private Long deviceId;
|
||||
|
||||
@ApiModelProperty("店铺id")
|
||||
@NotNull(message = "店铺id不允许为空", groups = {ValidGroup.BandGate.class})
|
||||
private Long storeId;
|
||||
// @ApiModelProperty("店铺id")
|
||||
// @NotNull(message = "店铺id不允许为空", groups = {ValidGroup.BandGate.class})
|
||||
// private Long storeId;
|
||||
|
||||
/** 设施id */
|
||||
@ApiModelProperty("设施id")
|
||||
@NotNull(message = "设施id不能为空", groups = {ValidGroup.BandGate.class})
|
||||
private Long equipmentId;
|
||||
|
||||
}
|
||||
|
|
|
@ -6,6 +6,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
|
||||
<resultMap type="StoreVO" id="EStoreResult" autoMapping="true">
|
||||
<result property="tags" column="tags" typeHandler="com.ruoyi.system.mapper.typehandler.StringSplitListTypeHandler"/>
|
||||
<result property="typeTags" column="type_tags" typeHandler="com.ruoyi.system.mapper.typehandler.StringSplitListTypeHandler"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectEStoreVo">
|
||||
|
@ -38,8 +39,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
s.manager_name,
|
||||
s.manager_phone,
|
||||
s.tags,
|
||||
s.wifi,
|
||||
s.wifi_password,
|
||||
s.type_tags,
|
||||
s.minimum_time,
|
||||
s.unlock_mode,
|
||||
s.unlock_condition,
|
||||
|
@ -137,8 +137,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="managerName != null">manager_name,</if>
|
||||
<if test="cityId != null">city_id,</if>
|
||||
<if test="tags != null">tags,</if>
|
||||
<if test="wifi != null">wifi,</if>
|
||||
<if test="wifiPassword != null">wifi_password,</if>
|
||||
<if test="typeTags != null">type_tags,</if>
|
||||
<if test="minimumTime != null">minimum_time,</if>
|
||||
<if test="unlockMode != null">unlock_mode,</if>
|
||||
<if test="unlockCondition != null">unlock_condition,</if>
|
||||
|
@ -172,8 +171,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="managerName != null">#{managerName},</if>
|
||||
<if test="cityId != null">#{cityId},</if>
|
||||
<if test="tags != null">#{tags,typeHandler=com.ruoyi.system.mapper.typehandler.StringSplitListTypeHandler},</if>
|
||||
<if test="wifi != null">#{wifi},</if>
|
||||
<if test="wifiPassword != null">#{wifiPassword},</if>
|
||||
<if test="typeTags != null">#{typeTags,typeHandler=com.ruoyi.system.mapper.typehandler.StringSplitListTypeHandler},</if>
|
||||
<if test="minimumTime != null">#{minimumTime},</if>
|
||||
<if test="unlockMode != null">#{unlockMode},</if>
|
||||
<if test="unlockCondition != null">#{unlockCondition},</if>
|
||||
|
@ -217,8 +215,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="data.managerName != null">manager_name = #{data.managerName},</if>
|
||||
<if test="data.cityId != null">city_id = #{data.cityId},</if>
|
||||
<if test="data.tags != null">tags = #{data.tags,typeHandler=com.ruoyi.system.mapper.typehandler.StringSplitListTypeHandler},</if>
|
||||
<if test="data.wifi != null">wifi = #{data.wifi},</if>
|
||||
<if test="data.wifiPassword != null">wifi_password = #{data.wifiPassword},</if>
|
||||
<if test="data.typeTags != null">type_tags = #{data.typeTags,typeHandler=com.ruoyi.system.mapper.typehandler.StringSplitListTypeHandler},</if>
|
||||
<if test="data.minimumTime != null">minimum_time = #{data.minimumTime},</if>
|
||||
<if test="data.unlockMode != null">unlock_mode = #{data.unlockMode},</if>
|
||||
<if test="data.unlockCondition != null">unlock_condition = #{data.unlockCondition},</if>
|
||||
|
|
|
@ -4,6 +4,7 @@ import com.ruoyi.common.exception.ServiceException;
|
|||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
import com.ruoyi.common.utils.ServiceUtil;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.common.utils.map.GeoUtils;
|
||||
import com.ruoyi.ss.carousel.service.CarouselService;
|
||||
import com.ruoyi.ss.city.domain.City;
|
||||
|
@ -36,6 +37,7 @@ import java.util.List;
|
|||
import java.util.Objects;
|
||||
|
||||
import static com.ruoyi.common.constant.ServiceConstants.*;
|
||||
import static com.ruoyi.common.utils.SecurityUtils.getUserId;
|
||||
|
||||
/**
|
||||
* 店铺Service业务层处理
|
||||
|
@ -130,7 +132,7 @@ public class StoreServiceImpl implements IStoreService
|
|||
public int insertEStore(Store eStore)
|
||||
{
|
||||
eStore.setCreateTime(DateUtils.getNowDate());
|
||||
eStore.setMerchantId(SecurityUtils.getUserId());
|
||||
eStore.setMerchantId(getUserId());
|
||||
setCityId(eStore);
|
||||
Boolean execute = transactionTemplate.execute(e -> {
|
||||
int i = storeMapper.insertEStore(eStore);
|
||||
|
@ -304,16 +306,21 @@ public class StoreServiceImpl implements IStoreService
|
|||
@Override
|
||||
public int bandGate(StoreDTO dto) {
|
||||
// 根据sn查询设备
|
||||
DeviceVO deviceVO = smDeviceService.selectById(dto.getDeviceId());
|
||||
// 如果deviceId不存在,则用sn查询设备
|
||||
ServiceUtil.assertion(StringUtils.isBlank(dto.getSn()) && dto.getDeviceId() == null, "设备sn或设备id不能同时为空");
|
||||
DeviceVO deviceVO = null;
|
||||
if (dto.getDeviceId() == null) {
|
||||
deviceVO = smDeviceService.selectBySn(dto.getSn());
|
||||
}else{
|
||||
deviceVO = smDeviceService.selectById(dto.getDeviceId());
|
||||
}
|
||||
ServiceUtil.assertion(deviceVO == null, "设备不存在");
|
||||
StoreVO storeVO = storeMapper.selectEStoreByStoreId(dto.getStoreId());
|
||||
ServiceUtil.assertion(storeVO == null, "店铺不存在");
|
||||
ServiceUtil.assertion(equipmentService.uniqueGate(dto.getStoreId()), "该店铺已经绑定了大门");
|
||||
ServiceUtil.assertion(!deviceVO.getUserId().equals(getUserId()), "不是您的设备请勿操作!");
|
||||
|
||||
EquipmentVO equipmentVO = equipmentService.selectGate(dto.getStoreId());
|
||||
EquipmentVO equipmentVO = equipmentService.selectEquipmentByEquipmentId(dto.getEquipmentId());
|
||||
ServiceUtil.assertion(equipmentVO == null, "该店铺未查询到大门设施");
|
||||
Equipment equipment = new Equipment();
|
||||
equipment.setDeviceId(dto.getDeviceId());
|
||||
equipment.setDeviceId(deviceVO.getDeviceId());
|
||||
equipment.setEquipmentId(equipmentVO.getEquipmentId());
|
||||
int i = equipmentService.updateEquipment(equipment);
|
||||
ServiceUtil.assertion(i == 0, "绑定大门失败");
|
||||
|
|
|
@ -19,7 +19,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
|
||||
<sql id="selectUserVo">
|
||||
select u.user_id, u.user_name, u.real_name, u.id_card, u.nick_name, u.email, u.avatar,u.user_type,u.pay_channel,u.merchant_id,dividend_proportion,
|
||||
u.phonenumber, u.password, u.sex, u.status,u.service_fee_proportion,u.clean_duration, u.clean_notice,u.ago_cancel,u.penalty,
|
||||
u.phonenumber, u.password, u.sex, u.status,u.service_fee_proportion,u.clean_duration, u.clean_notice,u.ago_cancel,u.penalty, u.before_time,
|
||||
u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark,u.wxopenid,u.is_authentication,store_id,
|
||||
r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status,u.balance
|
||||
from ss_user u
|
||||
|
@ -29,7 +29,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
|
||||
<sql id="selectUserVo2">
|
||||
select u.user_id, u.user_name, u.real_name, u.id_card, u.nick_name, u.email, u.avatar,u.user_type,u.pay_channel,u.merchant_id,dividend_proportion,
|
||||
u.phonenumber, u.password, u.sex, u.status, u.service_fee_proportion,u.clean_duration, u.clean_notice,u.ago_cancel,u.penalty,
|
||||
u.phonenumber, u.password, u.sex, u.status, u.service_fee_proportion,u.clean_duration, u.clean_notice,u.ago_cancel,u.penalty, u.before_time,
|
||||
u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark,u.wxopenid,u.is_authentication,store_id,
|
||||
u.balance
|
||||
from ss_user u
|
||||
|
@ -133,7 +133,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
|
||||
<select id="selectAppUserById" parameterType="Long" resultMap="EUserResult">
|
||||
select u.user_id, u.user_name, u.real_name, u.id_card, u.nick_name, u.email, u.avatar,u.service_fee_proportion,u.clean_duration, u.clean_notice,u.ago_cancel,u.penalty,
|
||||
u.phonenumber, u.password, u.sex, u.status,u.user_type,u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time,u.balance,
|
||||
u.phonenumber, u.password, u.sex, u.status,u.user_type,u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time,u.balance,u.before_time,
|
||||
u.remark,u.wxopenid,u.is_authentication,u.pay_channel,ub.balance
|
||||
from ss_user u
|
||||
left join ss_user_balance ub on ub.user_id = u.user_id
|
||||
|
@ -145,7 +145,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
|
||||
<select id="myAccountInfoByUserId" parameterType="Long" resultMap="EUserResult">
|
||||
select u.user_id, u.user_name, u.real_name, u.id_card, u.nick_name, u.email, u.avatar,
|
||||
u.phonenumber, u.password, u.sex, u.status,u.user_type,u.service_fee_proportion,u.clean_duration, u.clean_notice,u.ago_cancel,u.penalty,
|
||||
u.phonenumber, u.password, u.sex, u.status,u.user_type,u.service_fee_proportion,u.clean_duration, u.clean_notice,u.ago_cancel,u.penalty,u.before_time,
|
||||
u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark,u.wxopenid,u.is_authentication,u.pay_channel,
|
||||
ub.balance
|
||||
from ss_user u
|
||||
|
@ -326,6 +326,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="cleanNotice != null">clean_notice = #{cleanNotice},</if>
|
||||
<if test="agoCancel != null">ago_cancel = #{agoCancel},</if>
|
||||
<if test="penalty != null">penalty = #{penalty},</if>
|
||||
<if test="beforeTime != null">before_time = #{beforeTime},</if>
|
||||
<if test="storeId != null">store_id = #{storeId},</if>
|
||||
update_time = sysdate()
|
||||
</set>
|
||||
|
|
|
@ -265,6 +265,7 @@ public class UserServiceImpl implements IUserService {
|
|||
user.setCleanNotice(dto.getCleanNotice());
|
||||
user.setAgoCancel(dto.getAgoCancel());
|
||||
user.setPenalty(dto.getPenalty());
|
||||
user.setBeforeTime(dto.getBeforeTime());
|
||||
return userMapper.updateUser(user);
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,44 @@
|
|||
package com.ruoyi.ss.wifi.domain;
|
||||
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import com.ruoyi.common.core.domain.ValidGroup;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* wifi对象 ss_wifi
|
||||
*
|
||||
* @author qzz
|
||||
* @date 2025-01-06
|
||||
*/
|
||||
@Data
|
||||
public class Wifi extends BaseEntity{
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@NotNull(message = "Id不能为空", groups = {ValidGroup.Update.class})
|
||||
private Long wifiId;
|
||||
|
||||
@Excel(name = "wifi")
|
||||
@ApiModelProperty("wifi")
|
||||
@NotBlank(message = "wifi名不能为空", groups = {ValidGroup.Create.class})
|
||||
private String wifi;
|
||||
|
||||
@Excel(name = "密码")
|
||||
@ApiModelProperty("密码")
|
||||
@NotBlank(message = "密码不能为空", groups = {ValidGroup.Create.class})
|
||||
private String password;
|
||||
|
||||
@Excel(name = "店铺id")
|
||||
@ApiModelProperty("店铺id")
|
||||
private Long storeId;
|
||||
|
||||
@Excel(name = "商户id")
|
||||
@ApiModelProperty("商户id")
|
||||
private Long merchantId;
|
||||
|
||||
}
|
|
@ -0,0 +1,4 @@
|
|||
package com.ruoyi.ss.wifi.domain;
|
||||
|
||||
public class WifiQuery extends Wifi{
|
||||
}
|
|
@ -0,0 +1,4 @@
|
|||
package com.ruoyi.ss.wifi.domain;
|
||||
|
||||
public class WifiVO extends Wifi{
|
||||
}
|
|
@ -0,0 +1,65 @@
|
|||
package com.ruoyi.ss.wifi.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ruoyi.ss.wifi.domain.Wifi;
|
||||
import com.ruoyi.ss.wifi.domain.WifiVO;
|
||||
import com.ruoyi.ss.wifi.domain.WifiQuery;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* wifiMapper接口
|
||||
*
|
||||
* @author qzz
|
||||
* @date 2025-01-06
|
||||
*/
|
||||
public interface WifiMapper
|
||||
{
|
||||
/**
|
||||
* 查询wifi
|
||||
*
|
||||
* @param wifiId wifi主键
|
||||
* @return wifi
|
||||
*/
|
||||
public WifiVO selectWifiByWifiId(Long wifiId);
|
||||
|
||||
/**
|
||||
* 查询wifi列表
|
||||
*
|
||||
* @param query wifi
|
||||
* @return wifi集合
|
||||
*/
|
||||
public List<WifiVO> selectWifiList(@Param("query") WifiQuery query);
|
||||
|
||||
/**
|
||||
* 新增wifi
|
||||
*
|
||||
* @param wifi wifi
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertWifi(Wifi wifi);
|
||||
|
||||
/**
|
||||
* 修改wifi
|
||||
*
|
||||
* @param wifi wifi
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateWifi(@Param("data") Wifi wifi);
|
||||
|
||||
/**
|
||||
* 删除wifi
|
||||
*
|
||||
* @param wifiId wifi主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWifiByWifiId(Long wifiId);
|
||||
|
||||
/**
|
||||
* 批量删除wifi
|
||||
*
|
||||
* @param wifiIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWifiByWifiIds(Long[] wifiIds);
|
||||
}
|
|
@ -0,0 +1,89 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.ss.wifi.mapper.WifiMapper">
|
||||
|
||||
<resultMap type="WifiVO" id="WifiResult" autoMapping="true" />
|
||||
|
||||
<sql id="selectWifiVo">
|
||||
select
|
||||
wifi_id,
|
||||
wifi,
|
||||
password,
|
||||
store_id,
|
||||
merchant_id,
|
||||
create_by,
|
||||
create_time
|
||||
from ss_wifi
|
||||
</sql>
|
||||
|
||||
<sql id="searchCondition">
|
||||
<if test="query.wifi != null and query.wifi != ''"> and wifi = #{query.wifi}</if>
|
||||
<if test="query.password != null and query.password != ''"> and password = #{query.password}</if>
|
||||
<if test="query.storeId != null "> and store_id = #{query.storeId}</if>
|
||||
<if test="query.merchantId != null "> and merchant_id = #{query.merchantId}</if>
|
||||
</sql>
|
||||
|
||||
<select id="selectWifiList" parameterType="WifiQuery" resultMap="WifiResult">
|
||||
<include refid="selectWifiVo"/>
|
||||
<where>
|
||||
<include refid="searchCondition"/>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectWifiByWifiId" parameterType="Long" resultMap="WifiResult">
|
||||
<include refid="selectWifiVo"/>
|
||||
where wifi_id = #{wifiId}
|
||||
</select>
|
||||
|
||||
<insert id="insertWifi" parameterType="Wifi">
|
||||
insert into ss_wifi
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="wifiId != null">wifi_id,</if>
|
||||
<if test="wifi != null">wifi,</if>
|
||||
<if test="password != null">password,</if>
|
||||
<if test="storeId != null">store_id,</if>
|
||||
<if test="merchantId != null">merchant_id,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="wifiId != null">#{wifiId},</if>
|
||||
<if test="wifi != null">#{wifi},</if>
|
||||
<if test="password != null">#{password},</if>
|
||||
<if test="storeId != null">#{storeId},</if>
|
||||
<if test="merchantId != null">#{merchantId},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateWifi" parameterType="Wifi">
|
||||
update ss_wifi
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<include refid="updateColumns"/>
|
||||
</trim>
|
||||
where wifi_id = #{data.wifiId}
|
||||
</update>
|
||||
|
||||
<sql id="updateColumns">
|
||||
<if test="data.wifi != null">wifi = #{data.wifi},</if>
|
||||
<if test="data.password != null">password = #{data.password},</if>
|
||||
<if test="data.storeId != null">store_id = #{data.storeId},</if>
|
||||
<if test="data.merchantId != null">merchant_id = #{data.merchantId},</if>
|
||||
<if test="data.createBy != null">create_by = #{data.createBy},</if>
|
||||
<if test="data.createTime != null">create_time = #{data.createTime},</if>
|
||||
</sql>
|
||||
|
||||
<delete id="deleteWifiByWifiId" parameterType="Long">
|
||||
delete from ss_wifi where wifi_id = #{wifiId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteWifiByWifiIds" parameterType="String">
|
||||
delete from ss_wifi where wifi_id in
|
||||
<foreach item="wifiId" collection="array" open="(" separator="," close=")">
|
||||
#{wifiId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
|
@ -0,0 +1,64 @@
|
|||
package com.ruoyi.ss.wifi.service;
|
||||
|
||||
import com.ruoyi.ss.wifi.domain.Wifi;
|
||||
import com.ruoyi.ss.wifi.domain.WifiQuery;
|
||||
import com.ruoyi.ss.wifi.domain.WifiVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* wifiService接口
|
||||
*
|
||||
* @author qzz
|
||||
* @date 2025-01-06
|
||||
*/
|
||||
public interface IWifiService
|
||||
{
|
||||
/**
|
||||
* 查询wifi
|
||||
*
|
||||
* @param wifiId wifi主键
|
||||
* @return wifi
|
||||
*/
|
||||
public WifiVO selectWifiByWifiId(Long wifiId);
|
||||
|
||||
/**
|
||||
* 查询wifi列表
|
||||
*
|
||||
* @param wifi wifi
|
||||
* @return wifi集合
|
||||
*/
|
||||
public List<WifiVO> selectWifiList(WifiQuery wifi);
|
||||
|
||||
/**
|
||||
* 新增wifi
|
||||
*
|
||||
* @param wifi wifi
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertWifi(Wifi wifi);
|
||||
|
||||
/**
|
||||
* 修改wifi
|
||||
*
|
||||
* @param wifi wifi
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateWifi(Wifi wifi);
|
||||
|
||||
/**
|
||||
* 批量删除wifi
|
||||
*
|
||||
* @param wifiIds 需要删除的wifi主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWifiByWifiIds(Long[] wifiIds);
|
||||
|
||||
/**
|
||||
* 删除wifi信息
|
||||
*
|
||||
* @param wifiId wifi主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWifiByWifiId(Long wifiId);
|
||||
}
|
|
@ -0,0 +1,103 @@
|
|||
package com.ruoyi.ss.wifi.service.impl;
|
||||
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.ss.wifi.domain.Wifi;
|
||||
import com.ruoyi.ss.wifi.domain.WifiQuery;
|
||||
import com.ruoyi.ss.wifi.domain.WifiVO;
|
||||
import com.ruoyi.ss.wifi.mapper.WifiMapper;
|
||||
import com.ruoyi.ss.wifi.service.IWifiService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static com.ruoyi.common.utils.SecurityUtils.getUserId;
|
||||
import static com.ruoyi.common.utils.SecurityUtils.getUsername;
|
||||
|
||||
/**
|
||||
* wifiService业务层处理
|
||||
*
|
||||
* @author qzz
|
||||
* @date 2025-01-06
|
||||
*/
|
||||
@Service
|
||||
public class WifiServiceImpl implements IWifiService
|
||||
{
|
||||
@Autowired
|
||||
private WifiMapper wifiMapper;
|
||||
|
||||
/**
|
||||
* 查询wifi
|
||||
*
|
||||
* @param wifiId wifi主键
|
||||
* @return wifi
|
||||
*/
|
||||
@Override
|
||||
public WifiVO selectWifiByWifiId(Long wifiId)
|
||||
{
|
||||
return wifiMapper.selectWifiByWifiId(wifiId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询wifi列表
|
||||
*
|
||||
* @param wifi wifi
|
||||
* @return wifi
|
||||
*/
|
||||
@Override
|
||||
public List<WifiVO> selectWifiList(WifiQuery wifi)
|
||||
{
|
||||
return wifiMapper.selectWifiList(wifi);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增wifi
|
||||
*
|
||||
* @param wifi wifi
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertWifi(Wifi wifi)
|
||||
{
|
||||
wifi.setMerchantId(getUserId());
|
||||
wifi.setCreateBy(getUsername());
|
||||
wifi.setCreateTime(DateUtils.getNowDate());
|
||||
return wifiMapper.insertWifi(wifi);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改wifi
|
||||
*
|
||||
* @param wifi wifi
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateWifi(Wifi wifi)
|
||||
{
|
||||
return wifiMapper.updateWifi(wifi);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除wifi
|
||||
*
|
||||
* @param wifiIds 需要删除的wifi主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteWifiByWifiIds(Long[] wifiIds)
|
||||
{
|
||||
return wifiMapper.deleteWifiByWifiIds(wifiIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除wifi信息
|
||||
*
|
||||
* @param wifiId wifi主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteWifiByWifiId(Long wifiId)
|
||||
{
|
||||
return wifiMapper.deleteWifiByWifiId(wifiId);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user