20 changed files with 1787 additions and 0 deletions
@ -0,0 +1,69 @@
@@ -0,0 +1,69 @@
|
||||
package com.ecell.internationalize.system.constant; |
||||
|
||||
public enum DeviceModelEnum { |
||||
|
||||
LOCATION_FUN_ONE("1","基站"), LOCATION_FUN_TWO("2","基站+wiff"), LOCATION_FUN_THREE("3","基站+GPS"), LOCATION_FUN_FOUR("4","基站+wiff+GPS"), |
||||
DEVICE_TYPE_ZERO("0","默认"),DEVICE_TYPE_ONE("1","手表"),DEVICE_TYPE_TWO("2","学生卡"),DEVICE_TYPE_THREE("3","老人机"); |
||||
private String code; |
||||
private String type; |
||||
|
||||
|
||||
DeviceModelEnum(String code,String type){ |
||||
this.code =code; |
||||
this.type=type; |
||||
} |
||||
|
||||
public String getCode() { |
||||
return code; |
||||
} |
||||
|
||||
public void setCode(String code) { |
||||
this.code = code; |
||||
} |
||||
|
||||
public String getType() { |
||||
return type; |
||||
} |
||||
|
||||
public void setType(String type) { |
||||
this.type = type; |
||||
} |
||||
|
||||
public static String getDeviceType(int code){ |
||||
String ty=""; |
||||
switch (code) { |
||||
case 0: |
||||
return ty=DEVICE_TYPE_ZERO.type; |
||||
|
||||
case 1: |
||||
return ty=DEVICE_TYPE_ONE.type; |
||||
case 2: |
||||
return ty=DEVICE_TYPE_TWO.type; |
||||
case 3: |
||||
return ty=DEVICE_TYPE_THREE.type; |
||||
default:break; |
||||
} |
||||
return ty; |
||||
} |
||||
|
||||
public static String getLocationFunString(int code){ |
||||
String ty=""; |
||||
switch (code) { |
||||
case 1: |
||||
return ty=LOCATION_FUN_ONE.type; |
||||
|
||||
case 2: |
||||
return ty=LOCATION_FUN_TWO.type; |
||||
case 3: |
||||
return ty=LOCATION_FUN_THREE.type; |
||||
case 4: |
||||
return ty=LOCATION_FUN_FOUR.type; |
||||
default:break; |
||||
} |
||||
return ty; |
||||
} |
||||
|
||||
// public static void main(String[] args) {
|
||||
// System.out.println(DeviceModelEnum.getLocationFunString(4));
|
||||
// }
|
||||
} |
@ -0,0 +1,119 @@
@@ -0,0 +1,119 @@
|
||||
package com.ecell.internationalize.system.controller; |
||||
import com.ecell.internationalize.common.core.constant.UserConstants; |
||||
import com.ecell.internationalize.common.core.utils.locale.LocaleUtil; |
||||
import com.ecell.internationalize.common.core.utils.uuid.UUID; |
||||
import com.ecell.internationalize.common.core.web.domain.AjaxResult; |
||||
import com.ecell.internationalize.common.redis.service.RedisService; |
||||
import com.ecell.internationalize.common.security.annotation.RequiresPermissions; |
||||
import com.ecell.internationalize.common.system.constant.FieldConstant; |
||||
import com.ecell.internationalize.system.constant.DeviceModelConstants; |
||||
import com.ecell.internationalize.system.entity.DeviceModelInfo; |
||||
import com.ecell.internationalize.system.entity.dto.DeviceModelPageDTO; |
||||
import com.ecell.internationalize.system.service.DeviceModelInfoService; |
||||
import io.swagger.annotations.Api; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.validation.annotation.Validated; |
||||
import org.springframework.web.bind.annotation.*; |
||||
|
||||
|
||||
/** |
||||
* <p> |
||||
* 设备型号管理信息表 前端控制器 |
||||
* </p> |
||||
* |
||||
* @author ${author} |
||||
* @since 2022-07-09 |
||||
*/ |
||||
@Api(value="设备模型管理",tags={"设备模型管理接口"}) |
||||
@RestController |
||||
@RequestMapping("/device_model_info") |
||||
public class DeviceModelInfoController { |
||||
@Autowired |
||||
private DeviceModelInfoService deviceModelInfoService; |
||||
@Autowired |
||||
private RedisService redisService; |
||||
|
||||
|
||||
/** |
||||
* 新增设备类型 |
||||
*/ |
||||
@PostMapping("/add") |
||||
public AjaxResult add(@Validated @RequestBody DeviceModelInfo model) { |
||||
//设置ID
|
||||
model.setDeviceModelId(UUID.fastUUID().toString(true)); |
||||
if (UserConstants.NOT_UNIQUE.equals(deviceModelInfoService.checkModelNameUnique(model))) { |
||||
return AjaxResult.error("新增设备型号'" + model.getDeviceModelName() + "'失败,同一厂商下该名称已存在"); |
||||
} |
||||
//定位模式id,默认为1
|
||||
model.setPositioningModeId(DeviceModelConstants.ONE); |
||||
return deviceModelInfoService.save(model) ? AjaxResult.success(LocaleUtil.getMessage(FieldConstant.MESSAGES_SUCCESS)) : AjaxResult.error(LocaleUtil.getMessage(FieldConstant.MESSAGES_ERROR)); |
||||
} |
||||
|
||||
/** |
||||
* 分页查询 |
||||
* @param |
||||
* @param dto |
||||
* @return |
||||
*/ |
||||
@RequiresPermissions("system:equipmentmodel:list") |
||||
@GetMapping("device/page/list") |
||||
public AjaxResult queryAll(DeviceModelPageDTO dto) { |
||||
return AjaxResult.success(LocaleUtil.getMessage(FieldConstant.MESSAGES_SUCCESS), deviceModelInfoService.findListByPage(dto)); |
||||
} |
||||
|
||||
/** |
||||
* 更新设备型号信息 |
||||
* @param model |
||||
* @return |
||||
*/ |
||||
@PostMapping("/edit") |
||||
public AjaxResult edit(@RequestBody DeviceModelInfo model) { |
||||
return deviceModelInfoService.updateById(model) ? AjaxResult.success(LocaleUtil.getMessage(FieldConstant.MESSAGES_SUCCESS)) : AjaxResult.error(LocaleUtil.getMessage(FieldConstant.MESSAGES_ERROR)); |
||||
} |
||||
|
||||
/** |
||||
* 逻辑删除 |
||||
* @param |
||||
* @param id |
||||
* @return |
||||
*/ |
||||
@DeleteMapping("/del/{id}") |
||||
public AjaxResult remove(@PathVariable String id) { |
||||
|
||||
return deviceModelInfoService.deltaById(id) ? AjaxResult.success(LocaleUtil.getMessage(FieldConstant.MESSAGES_SUCCESS)) : AjaxResult.error(LocaleUtil.getMessage(FieldConstant.MESSAGES_ERROR)); |
||||
} |
||||
|
||||
/** |
||||
* 根据厂商id或代理商id查询设备型号名称跟ID |
||||
* @param id |
||||
* @return |
||||
*/ |
||||
@GetMapping("/query/firmId/{id}/{type}") |
||||
public AjaxResult queryModelNameByFirmId(@PathVariable String id,@PathVariable String type){ |
||||
return AjaxResult.success(LocaleUtil.getMessage(FieldConstant.MESSAGES_SUCCESS), deviceModelInfoService.queryModelNameByFirmId(id,type)) ; |
||||
} |
||||
|
||||
|
||||
/** |
||||
* 根据设备型号ID and 定位模式ID 更新设备型号表的定位模式ID |
||||
*/ |
||||
@GetMapping("device/byId/{mId}/{pId}") |
||||
public AjaxResult updatePositionIdByModelId(@PathVariable String mId, @PathVariable String pId){ |
||||
|
||||
return deviceModelInfoService.updatePositionIdByModelId(mId,pId) ? AjaxResult.success(LocaleUtil.getMessage(FieldConstant.MESSAGES_SUCCESS)) : AjaxResult.error(LocaleUtil.getMessage(FieldConstant.MESSAGES_ERROR)); |
||||
} |
||||
|
||||
/** |
||||
* 根据设备类型ID查询设备模型信息 |
||||
*/ |
||||
@GetMapping("device/edit/{id}") |
||||
public AjaxResult queryByModelId(@PathVariable String id){ |
||||
|
||||
|
||||
return AjaxResult.success(LocaleUtil.getMessage(FieldConstant.MESSAGES_SUCCESS), deviceModelInfoService.queryById(id)); |
||||
} |
||||
|
||||
|
||||
|
||||
} |
||||
|
@ -0,0 +1,43 @@
@@ -0,0 +1,43 @@
|
||||
package com.ecell.internationalize.system.controller; |
||||
import com.ecell.internationalize.common.core.utils.locale.LocaleUtil; |
||||
import com.ecell.internationalize.common.core.web.domain.AjaxResult; |
||||
import com.ecell.internationalize.common.system.constant.FieldConstant; |
||||
import com.ecell.internationalize.system.service.DevicePositionService; |
||||
import io.swagger.annotations.Api; |
||||
import io.swagger.annotations.ApiOperation; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.web.bind.annotation.PostMapping; |
||||
import org.springframework.web.bind.annotation.RequestBody; |
||||
import org.springframework.web.bind.annotation.RequestMapping; |
||||
import org.springframework.web.bind.annotation.RestController; |
||||
|
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* <p> |
||||
* 设备定位(签到) 前端控制器 |
||||
* </p> |
||||
* |
||||
* @author liy |
||||
* @since 2022-07-11 |
||||
*/ |
||||
@Api(value="设备定位(签到)",tags={"设备定位(签到)接口"}) |
||||
@RestController |
||||
@RequestMapping("/device_position") |
||||
public class DevicePositionController { |
||||
@Autowired |
||||
private DevicePositionService devicePositionService; |
||||
/** |
||||
* 设备签到条件分页查询 |
||||
* @Author liy |
||||
* @Date 2022/7/12 16:38 |
||||
* @param map 分页条件查询体 |
||||
* @Return AjaxResult |
||||
*/ |
||||
@ApiOperation("条件分页查询设备定位(签到)信息") |
||||
@PostMapping("position/list") |
||||
public AjaxResult queryAll(@RequestBody Map<String,Object> map){ |
||||
return AjaxResult.success(LocaleUtil.getMessage(FieldConstant.MESSAGES_SUCCESS),devicePositionService.findAllByPage(map)); |
||||
} |
||||
} |
||||
|
@ -0,0 +1,141 @@
@@ -0,0 +1,141 @@
|
||||
package com.ecell.internationalize.system.entity; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill; |
||||
import com.baomidou.mybatisplus.annotation.IdType; |
||||
import com.baomidou.mybatisplus.annotation.TableField; |
||||
import com.baomidou.mybatisplus.annotation.TableId; |
||||
import com.fasterxml.jackson.annotation.JsonFormat; |
||||
import io.swagger.annotations.ApiModel; |
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.Data; |
||||
import lombok.EqualsAndHashCode; |
||||
import lombok.experimental.Accessors; |
||||
|
||||
import java.io.Serializable; |
||||
import java.util.Date; |
||||
|
||||
/** |
||||
* <p> |
||||
* 设备型号管理信息表 |
||||
* </p> |
||||
* |
||||
* @author ${author} |
||||
* @since 2022-07-09 |
||||
*/ |
||||
@Data |
||||
@EqualsAndHashCode(callSuper = false) |
||||
@Accessors(chain = true) |
||||
@ApiModel(value="DeviceModelInfo对象", description="设备型号管理信息表") |
||||
public class DeviceModelInfo implements Serializable { |
||||
|
||||
private static final long serialVersionUID=1L; |
||||
|
||||
@ApiModelProperty(value = "设备型号id") |
||||
@TableId(value = "device_model_id",type = IdType.INPUT) |
||||
private String deviceModelId; |
||||
|
||||
@ApiModelProperty(value = "型号名称") |
||||
private String deviceModelName; |
||||
|
||||
@ApiModelProperty(value = "厂商id") |
||||
private String firmId; |
||||
|
||||
@ApiModelProperty(value = "代理厂商id") |
||||
private String agentId; |
||||
|
||||
@ApiModelProperty(value = "厂商名称") |
||||
private String firmName; |
||||
|
||||
@ApiModelProperty(value = "定位功能(1.基站,2.基站+wiff,3.基站+GPS,4.基站+wiff+GPS)") |
||||
private String locationFun; |
||||
|
||||
@ApiModelProperty(value = "视频类型名称(0.不支持,0.不支持,1.菊风,2.声网,3.佰锐,4.鹈鹕)") |
||||
private String videoModelName; |
||||
|
||||
@ApiModelProperty(value = "视频规则(0.是默认,其余就是视频类型的名称)") |
||||
private String videoRule; |
||||
|
||||
@ApiModelProperty(value = "视频类型id") |
||||
private String videoModelId; |
||||
|
||||
@ApiModelProperty(value = "设备类型(0.默认 1.手表,2.学生卡,3.老人机)") |
||||
private String deviceType; |
||||
|
||||
@ApiModelProperty(value = "公众号平台名称(0.不支持,其余就是公众号的名称)") |
||||
private String officialAccountName; |
||||
|
||||
@ApiModelProperty(value = "手表闹钟(0.不支持,1.支持)") |
||||
private String watchAlarmClock; |
||||
|
||||
@ApiModelProperty(value = "上课禁用(0.不支持,1.支持)") |
||||
private String classDisable; |
||||
|
||||
@ApiModelProperty(value = "SOS号码(0.不支持,1.支持)") |
||||
private String sosPhone; |
||||
|
||||
@ApiModelProperty(value = "电子围栏(0.不支持,1.支持)") |
||||
private String electronicFence; |
||||
|
||||
@ApiModelProperty(value = "记步功能(0.不支持,1.支持)") |
||||
private String stepRecorder; |
||||
|
||||
@ApiModelProperty(value = "微聊功能(0.不支持,1.支持)") |
||||
private String chatFun; |
||||
|
||||
@ApiModelProperty(value = "查找设备功能(0.不支持,1.支持)") |
||||
private String lookupFun; |
||||
|
||||
@ApiModelProperty(value = "手表WIFF(0.不支持,1.支持)") |
||||
private String watchWiff; |
||||
|
||||
@ApiModelProperty(value = "心率(0.不支持,1.支持)") |
||||
private String heartRate; |
||||
|
||||
@ApiModelProperty(value = "体温(0.不支持,1.支持)") |
||||
private String temperature; |
||||
|
||||
@ApiModelProperty(value = "血压(0.不支持,1.支持)") |
||||
private String bloodPressure; |
||||
|
||||
@ApiModelProperty(value = "血氧(0.不支持,1.支持") |
||||
private String bloodOxygen; |
||||
|
||||
@ApiModelProperty(value = "白名单(0.不支持,1.支持)") |
||||
private String whiteList; |
||||
|
||||
@ApiModelProperty(value = "拨号盘(0.不支持,1.支持)") |
||||
private String dial; |
||||
|
||||
@ApiModelProperty(value = "定时开关机(0.不支持,1.支持)") |
||||
private String timingSwitch; |
||||
|
||||
@ApiModelProperty(value = "电信版本号(0,否,1.是)") |
||||
private String telecomVersion; |
||||
|
||||
@ApiModelProperty(value = "(0.删除,1.不删除)") |
||||
private String delFlag; |
||||
|
||||
@ApiModelProperty(value = "创建人") |
||||
@TableField(value = "create_user",fill = FieldFill.INSERT) |
||||
private String createUser; |
||||
|
||||
@ApiModelProperty(value = "修改人") |
||||
@TableField(value = "update_user",fill = FieldFill.UPDATE) |
||||
private String updateUser; |
||||
|
||||
@ApiModelProperty(value = "创建时间") |
||||
@TableField(value = "create_time",fill = FieldFill.INSERT) |
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
||||
private Date createTime; |
||||
|
||||
@ApiModelProperty(value = "修改时间") |
||||
@TableField(value = "update_time",fill = FieldFill.UPDATE) |
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
||||
private Date updateTime; |
||||
|
||||
@ApiModelProperty(value = "定位模式ID") |
||||
private String positioningModeId; |
||||
|
||||
|
||||
|
||||
} |
@ -0,0 +1,84 @@
@@ -0,0 +1,84 @@
|
||||
package com.ecell.internationalize.system.entity; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill; |
||||
import com.baomidou.mybatisplus.annotation.TableField; |
||||
import com.baomidou.mybatisplus.annotation.TableId; |
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import com.fasterxml.jackson.annotation.JsonFormat; |
||||
import lombok.Data; |
||||
import lombok.EqualsAndHashCode; |
||||
import lombok.experimental.Accessors; |
||||
|
||||
import java.util.Date; |
||||
|
||||
/** |
||||
* <p> |
||||
* 设备步数 |
||||
* </p> |
||||
* |
||||
* @author liy |
||||
* @since 2022-07-11 |
||||
*/ |
||||
@Data |
||||
@EqualsAndHashCode(callSuper = false) |
||||
@Accessors(chain = true) |
||||
@TableName("device_step_daily") |
||||
public class DeviceStepDaily { |
||||
|
||||
private static final long serialVersionUID=1L; |
||||
|
||||
|
||||
/** |
||||
* 主键Id |
||||
*/ |
||||
@TableId("id") |
||||
private String id; |
||||
|
||||
/** |
||||
* 设备iMei |
||||
*/ |
||||
private String imei; |
||||
|
||||
/** |
||||
* 姓名 |
||||
*/ |
||||
@TableField(exist = false) |
||||
private String name; |
||||
|
||||
/** |
||||
* 腕表今日步数总数 |
||||
*/ |
||||
private Integer walksNum; |
||||
|
||||
/** |
||||
* 腕表今日行走总距离(单位:米) |
||||
*/ |
||||
private Double walksDistance; |
||||
|
||||
/** |
||||
* 腕表今日消耗卡路里(单位:小卡) |
||||
*/ |
||||
private Double walksCalorie; |
||||
|
||||
/** |
||||
* 创建人 |
||||
*/ |
||||
private String createUser; |
||||
/** |
||||
* 创建时间 |
||||
*/ |
||||
@TableField(value = "create_time",fill = FieldFill.INSERT) |
||||
@JsonFormat(pattern = "yyyy-MM-dd") |
||||
private Date createTime; |
||||
/** |
||||
* 修改人 |
||||
*/ |
||||
private String updateUser; |
||||
/** |
||||
* 修改时间 |
||||
*/ |
||||
@TableField(value = "update_time",fill = FieldFill.UPDATE) |
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
||||
private Date updateTime; |
||||
|
||||
} |
@ -0,0 +1,29 @@
@@ -0,0 +1,29 @@
|
||||
package com.ecell.internationalize.system.entity.dto; |
||||
|
||||
import io.swagger.annotations.ApiModel; |
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.AllArgsConstructor; |
||||
import lombok.Data; |
||||
import lombok.NoArgsConstructor; |
||||
|
||||
@ApiModel(value="DeviceModlDTO对象", description="查询设备型号条件对象") |
||||
@Data |
||||
@AllArgsConstructor |
||||
@NoArgsConstructor |
||||
public class DeviceModelPageDTO { |
||||
@ApiModelProperty("设备型号名称 ") |
||||
private String deviceModelName; |
||||
@ApiModelProperty("厂商ID") |
||||
private String firmId; |
||||
@ApiModelProperty("厂商类型") |
||||
private String firmFlag; |
||||
@ApiModelProperty(value = "厂商名称") |
||||
private String firmName; |
||||
|
||||
@ApiModelProperty(value = "每页展示的条数") |
||||
private Integer pageSize; |
||||
|
||||
@ApiModelProperty(value = "当前的页码") |
||||
private Integer current; |
||||
|
||||
} |
@ -0,0 +1,30 @@
@@ -0,0 +1,30 @@
|
||||
package com.ecell.internationalize.system.entity.dto; |
||||
|
||||
import io.swagger.annotations.ApiModel; |
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.AllArgsConstructor; |
||||
import lombok.Data; |
||||
import lombok.NoArgsConstructor; |
||||
|
||||
|
||||
@ApiModel(value="DevicePageDTO对象", description="设备分页查询对象") |
||||
@Data |
||||
@AllArgsConstructor |
||||
@NoArgsConstructor |
||||
public class DevicePageDTO { |
||||
|
||||
@ApiModelProperty(value = "录入批次") |
||||
private String inputBatch; |
||||
|
||||
@ApiModelProperty(value = "imei") |
||||
private String imei; |
||||
|
||||
@ApiModelProperty(value = "审核状态(0.是拒绝,1.是待审核,2.是通过,默认为1)") |
||||
private String status; |
||||
|
||||
@ApiModelProperty(value = "每页展示的条数") |
||||
private Integer pageSize; |
||||
|
||||
@ApiModelProperty(value = "当前的页码") |
||||
private Integer current; |
||||
} |
@ -0,0 +1,44 @@
@@ -0,0 +1,44 @@
|
||||
package com.ecell.internationalize.system.entity.vo; |
||||
|
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.AllArgsConstructor; |
||||
import lombok.Data; |
||||
import lombok.NoArgsConstructor; |
||||
|
||||
import java.util.Date; |
||||
|
||||
@Data |
||||
@AllArgsConstructor |
||||
@NoArgsConstructor |
||||
public class DeviceModelVO{ |
||||
/***/ |
||||
private String deviceModelId; |
||||
/** 厂商名称 */ |
||||
private String firmName; |
||||
/** 设备类型名称 */ |
||||
private String deviceModelName; |
||||
/** 功能模块代码 */ |
||||
private String funModel; |
||||
/** 功能模块说明 */ |
||||
private String funDescription; |
||||
/** 录入总数 */ |
||||
private int InputTotal; |
||||
/** 定位模式 */ |
||||
private String positionModel; |
||||
/** 设备类型 */ |
||||
private String deviceType; |
||||
/** 公众号平台名称 */ |
||||
private String officialAccountName; |
||||
@ApiModelProperty(value = "创建人") |
||||
private String createUser; |
||||
|
||||
@ApiModelProperty(value = "修改人") |
||||
private String updateUser; |
||||
|
||||
@ApiModelProperty(value = "创建时间") |
||||
private Date createTime; |
||||
|
||||
@ApiModelProperty(value = "修改时间") |
||||
private Date updateTime; |
||||
|
||||
} |
@ -0,0 +1,16 @@
@@ -0,0 +1,16 @@
|
||||
package com.ecell.internationalize.system.mapper; |
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import com.ecell.internationalize.system.entity.DeviceModelInfo; |
||||
|
||||
/** |
||||
* <p> |
||||
* 设备型号管理信息表 Mapper 接口 |
||||
* </p> |
||||
* |
||||
* @author ${author} |
||||
* @since 2022-07-09 |
||||
*/ |
||||
public interface DeviceModelInfoMapper extends BaseMapper<DeviceModelInfo> { |
||||
|
||||
} |
@ -0,0 +1,49 @@
@@ -0,0 +1,49 @@
|
||||
package com.ecell.internationalize.system.mapper; |
||||
|
||||
|
||||
import com.ecell.internationalize.system.entity.DeviceModel; |
||||
import org.apache.ibatis.annotations.Param; |
||||
|
||||
import java.util.List; |
||||
|
||||
|
||||
/** |
||||
* 设备型号信息 |
||||
*/ |
||||
@Deprecated |
||||
public interface DeviceModelMapper { |
||||
/** |
||||
* 新增设备型号 |
||||
* |
||||
* @param model |
||||
* @return |
||||
*/ |
||||
int insertDeviceModel(DeviceModel model); |
||||
|
||||
/** |
||||
* 校验同一厂商,设备类型名称是否唯一 |
||||
*/ |
||||
DeviceModel checkModelNameUnique(@Param("firmId") String firmId, @Param("modelName") String modelName); |
||||
|
||||
/** |
||||
* 根据条件分页查询设备型号 |
||||
* |
||||
* @param model |
||||
* @return |
||||
*/ |
||||
List<DeviceModel> selectModelLists(DeviceModel model); |
||||
|
||||
/** |
||||
* 更新设备型号管理信息 |
||||
* @param model |
||||
* @return |
||||
*/ |
||||
int updateDeviceModel(DeviceModel model); |
||||
|
||||
/** |
||||
* 删除设备型号 |
||||
* @param id |
||||
* @return |
||||
*/ |
||||
int deleteDeviceModelById(@Param("id")String id); |
||||
} |
@ -0,0 +1,28 @@
@@ -0,0 +1,28 @@
|
||||
package com.ecell.internationalize.system.mapper; |
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
||||
import com.ecell.internationalize.system.entity.DevicePosition; |
||||
import org.apache.ibatis.annotations.Param; |
||||
|
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* <p> |
||||
* 设备定位(签到) Mapper 接口 |
||||
* </p> |
||||
* |
||||
* @author liy |
||||
* @since 2022-07-11 |
||||
*/ |
||||
public interface DevicePositionMapper extends BaseMapper<DevicePosition> { |
||||
/** |
||||
* 步数签到分页查询 |
||||
* @Author liy |
||||
* @Date 2022/7/11 15:42 |
||||
* @param page 分页 |
||||
* @param map 查询条件 |
||||
* @return Page |
||||
*/ |
||||
Page<DevicePosition> getList(@Param("page") Page<DevicePosition> page, @Param("map") Map<String, Object> map); |
||||
} |
@ -0,0 +1,34 @@
@@ -0,0 +1,34 @@
|
||||
package com.ecell.internationalize.system.service; |
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import com.baomidou.mybatisplus.extension.service.IService; |
||||
import com.ecell.internationalize.system.entity.DeviceModelInfo; |
||||
import com.ecell.internationalize.system.entity.dto.DeviceModelPageDTO; |
||||
import com.ecell.internationalize.system.entity.vo.DeviceModelVO; |
||||
|
||||
import java.util.List; |
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* <p> |
||||
* 设备型号管理信息表 服务类 |
||||
* </p> |
||||
* |
||||
* @author ${author} |
||||
* @since 2022-07-09 |
||||
*/ |
||||
public interface DeviceModelInfoService extends IService<DeviceModelInfo> { |
||||
|
||||
String checkModelNameUnique(DeviceModelInfo model); |
||||
|
||||
IPage<DeviceModelVO> findListByPage(DeviceModelPageDTO dto); |
||||
|
||||
boolean deltaById(String id); |
||||
|
||||
List<Map<String,String>> queryModelNameByFirmId(String id,String type); |
||||
|
||||
boolean updatePositionIdByModelId(String mId, String pId); |
||||
|
||||
DeviceModelInfo queryById(String id); |
||||
|
||||
} |
@ -0,0 +1,37 @@
@@ -0,0 +1,37 @@
|
||||
package com.ecell.internationalize.system.service; |
||||
|
||||
|
||||
import com.ecell.internationalize.system.entity.DeviceModel; |
||||
import com.ecell.internationalize.system.entity.vo.DeviceModelVO; |
||||
|
||||
import java.util.List; |
||||
|
||||
@Deprecated |
||||
public interface DeviceModelService { |
||||
int insertDeviceModel(DeviceModel model); |
||||
/** |
||||
* 校验同一厂商,设备类型名称是否唯一 |
||||
*/ |
||||
String checkModelNameUnique(DeviceModel model); |
||||
|
||||
/** |
||||
* 根据条件分页查询设备型号 |
||||
* @param model |
||||
* @return |
||||
*/ |
||||
List<DeviceModelVO> selectModelList(DeviceModel model); |
||||
|
||||
/** |
||||
* 更新设备型号管理信息 |
||||
* @param model |
||||
* @return |
||||
*/ |
||||
int updateDeviceModel(DeviceModel model); |
||||
|
||||
/** |
||||
* 删除设备型号 |
||||
* @param id |
||||
* @return |
||||
*/ |
||||
int deleteDeviceModelById(String id); |
||||
} |
@ -0,0 +1,26 @@
@@ -0,0 +1,26 @@
|
||||
package com.ecell.internationalize.system.service; |
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import com.baomidou.mybatisplus.extension.service.IService; |
||||
import com.ecell.internationalize.system.entity.DevicePosition; |
||||
|
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* <p> |
||||
* 设备定位(签到) 服务类 |
||||
* </p> |
||||
* |
||||
* @author liy |
||||
* @since 2022-07-11 |
||||
*/ |
||||
public interface DevicePositionService extends IService<DevicePosition> { |
||||
/** |
||||
* 设备签到条件分页查询 |
||||
* @Author liy |
||||
* @Date 2022/7/12 16:42 |
||||
* @param map 分页查询体 |
||||
* @return IPage |
||||
*/ |
||||
IPage<DevicePosition> findAllByPage(Map<String, Object> map); |
||||
} |
@ -0,0 +1,460 @@
@@ -0,0 +1,460 @@
|
||||
package com.ecell.internationalize.system.service.impl; |
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||
import com.ecell.internationalize.common.core.exception.ServiceException; |
||||
import com.ecell.internationalize.common.core.utils.StringUtils; |
||||
import com.ecell.internationalize.common.security.utils.SecurityUtils; |
||||
import com.ecell.internationalize.common.system.entity.PositioningModelInfo; |
||||
import com.ecell.internationalize.system.constant.DeviceModelConstants; |
||||
import com.ecell.internationalize.system.constant.DeviceModelEnum; |
||||
import com.ecell.internationalize.system.entity.DeviceInfo; |
||||
import com.ecell.internationalize.system.entity.DeviceModelInfo; |
||||
import com.ecell.internationalize.system.entity.FirmManage; |
||||
import com.ecell.internationalize.system.entity.dto.DeviceModelPageDTO; |
||||
import com.ecell.internationalize.system.entity.vo.DeviceModelVO; |
||||
import com.ecell.internationalize.system.mapper.DeviceInfoMapper; |
||||
import com.ecell.internationalize.system.mapper.DeviceModelInfoMapper; |
||||
import com.ecell.internationalize.system.mapper.FirmManageMapper; |
||||
import com.ecell.internationalize.system.mapper.PositioningModelInfoMapper; |
||||
import com.ecell.internationalize.system.service.DeviceModelInfoService; |
||||
import com.ecell.internationalize.system.utils.DeviceModelInfoUtli; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.stereotype.Service; |
||||
import org.springframework.transaction.annotation.Transactional; |
||||
|
||||
import java.util.Collections; |
||||
import java.util.HashMap; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
import java.util.stream.Collectors; |
||||
|
||||
/** |
||||
* <p> |
||||
* 设备型号管理信息表 服务实现类 |
||||
* </p> |
||||
* |
||||
* @author ${author} |
||||
* @since 2022-07-09 |
||||
*/ |
||||
@Service |
||||
public class DeviceModelInfoServiceImpl extends ServiceImpl<DeviceModelInfoMapper, DeviceModelInfo> implements DeviceModelInfoService { |
||||
@Autowired |
||||
private DeviceModelInfoMapper mapper; |
||||
@Autowired |
||||
private FirmManageMapper firmManageMapper; |
||||
@Autowired |
||||
DeviceInfoMapper deviceInfoMapper; |
||||
@Autowired |
||||
PositioningModelInfoServiceImpl positioningModelInfoService; |
||||
@Autowired |
||||
PositioningModelInfoMapper positioningModelInfoMapper; |
||||
|
||||
/** |
||||
* 设备型号名称唯一验证 |
||||
* @param model |
||||
* @return |
||||
*/ |
||||
@Override |
||||
public String checkModelNameUnique(DeviceModelInfo model) { |
||||
QueryWrapper<DeviceModelInfo> wrapper =new QueryWrapper<>(); |
||||
wrapper.eq("device_model_name",model.getDeviceModelName()); |
||||
if (StringUtils.isNotNull(model) && StringUtils.isNotEmpty(model.getAgentId())){ |
||||
wrapper.eq("agent_id",model.getAgentId()); |
||||
} |
||||
|
||||
if (StringUtils.isNotNull(model) && StringUtils.isNotEmpty(model.getFirmId())){ |
||||
wrapper.eq("firm_id",model.getFirmId()); |
||||
} |
||||
wrapper.eq("del_flag", DeviceModelConstants.ONE); |
||||
//加上limit 不加如果有多条记录会抛异常
|
||||
wrapper.last("LIMIT 1"); |
||||
DeviceModelInfo modelInfo = mapper.selectOne(wrapper); |
||||
if (StringUtils.isNotNull(modelInfo) && ! (modelInfo .getDeviceModelId().equals(model.getDeviceModelId()))) |
||||
{ |
||||
return DeviceModelConstants.NOT_UNIQUE; |
||||
} |
||||
return DeviceModelConstants.UNIQUE; |
||||
} |
||||
|
||||
/** |
||||
* 分页查询 |
||||
* @param dto |
||||
* @return |
||||
*/ |
||||
@Override |
||||
public IPage<DeviceModelVO> findListByPage(DeviceModelPageDTO dto) { |
||||
QueryWrapper<DeviceModelInfo> wrapper =new QueryWrapper<>(); |
||||
Map<String,String> map = SecurityUtils.getFirmIdOrSecondFirmId(SecurityUtils.getUserLogin()); |
||||
if (StringUtils.isNotEmpty(map)){ |
||||
//是厂商
|
||||
if (StringUtils.isNotEmpty(map.get("firmFlag")) && DeviceModelConstants.ONE.equals(map.get("firmFlag"))){ |
||||
DeviceModelInfoUtli.dataPermissions(wrapper,"firm_id",map.get("firmId")); |
||||
}else { |
||||
//代理商
|
||||
DeviceModelInfoUtli.dataPermissions(wrapper,"agent_id",map.get("firmId")); |
||||
} |
||||
} |
||||
//不为空
|
||||
if (StringUtils.isNotEmpty(dto.getFirmName())){ |
||||
if (DeviceModelConstants.ONE.equals(dto.getFirmFlag())){ |
||||
//如果是管理员
|
||||
if (SecurityUtils.isAdminString(SecurityUtils.getUserId())){ |
||||
wrapper.eq("firm_id",dto.getFirmId()); |
||||
} |
||||
}else {//代理商
|
||||
//如果是管理员
|
||||
if (SecurityUtils.isAdminString(SecurityUtils.getUserId())){ |
||||
wrapper.eq("agent_id",dto.getFirmId()); |
||||
} |
||||
|
||||
} |
||||
|
||||
} |
||||
if (StringUtils.isNotEmpty(dto.getDeviceModelName())){ |
||||
wrapper.eq("device_model_name",dto.getDeviceModelName()); |
||||
} |
||||
wrapper.eq("del_flag",DeviceModelConstants.ONE); |
||||
wrapper.orderByDesc("create_time"); |
||||
Page<DeviceModelInfo> page =new Page<DeviceModelInfo>(dto.getCurrent(),dto.getPageSize()); |
||||
IPage<DeviceModelInfo> oldPage = mapper.selectPage(page, wrapper); |
||||
IPage<DeviceModelVO> newPage =new Page<>(); |
||||
|
||||
return this.transform(oldPage,newPage); |
||||
} |
||||
|
||||
/** |
||||
* 删除 |
||||
* @param id |
||||
* @return |
||||
*/ |
||||
@Override |
||||
public boolean deltaById(String id) { |
||||
DeviceModelInfo info =new DeviceModelInfo(); |
||||
info.setDeviceModelId(id); |
||||
info.setDelFlag(DeviceModelConstants.ZERO); |
||||
//根据ID去查询设备表中有没有未审批,跟审批通过的,有的话不能删除
|
||||
int i = this.bindingDeviceCount(id); |
||||
if (i>0){ |
||||
throw new ServiceException("此设备型号已经关联设备这些设备已经在审批中或已经审批通过不能删除"); |
||||
} |
||||
|
||||
return super.updateById(info); |
||||
} |
||||
|
||||
/** |
||||
* 根据厂商ID查询设备型号名称跟ID |
||||
* @param id |
||||
* @return |
||||
*/ |
||||
@Override |
||||
public List<Map<String, String>> queryModelNameByFirmId(String id ,String type) { |
||||
QueryWrapper wrapper =new QueryWrapper(); |
||||
if (StringUtils.isNotEmpty(id) && StringUtils.isNotEmpty(type)){ |
||||
if (DeviceModelConstants.ONE.equals(type)){ |
||||
//厂商
|
||||
wrapper.eq("firm_id",id); |
||||
}else { |
||||
//代理商
|
||||
wrapper.eq("agent_id",id); |
||||
} |
||||
}else { |
||||
throw new ServiceException("参数错误"); |
||||
} |
||||
|
||||
wrapper.eq("del_flag",DeviceModelConstants.ONE); |
||||
List<DeviceModelInfo> list = mapper.selectList(wrapper); |
||||
if (StringUtils.isNotEmpty(list) && list.size()>0){ |
||||
return convertClassToMap(list); |
||||
} |
||||
return Collections.emptyList(); |
||||
} |
||||
|
||||
/** |
||||
* 根据设备型号MID and 定位模式pID 更新设备型号表的定位模式ID |
||||
* @param mId |
||||
* @param pId |
||||
* @return |
||||
*/ |
||||
@Transactional(rollbackFor = Exception.class) |
||||
@Override |
||||
public boolean updatePositionIdByModelId(String mId, String pId) { |
||||
//先查询在更新
|
||||
DeviceModelInfo info = mapper.selectById(mId); |
||||
if (StringUtils.isNull(info)){ |
||||
throw new ServiceException("该设备型号ID有误"); |
||||
} |
||||
info.setPositioningModeId(pId); |
||||
//这里可能要去更新设备拥有者信息表的定位模型ID,先暂时不做
|
||||
deviceInfoMapper.updateDeviceOwnerInfo(pId,mId); |
||||
return super.updateById(info); |
||||
} |
||||
|
||||
/** |
||||
* 根据设备模型id查询设备模型信息 |
||||
* @param id |
||||
* @return |
||||
*/ |
||||
@Override |
||||
public DeviceModelInfo queryById(String id) { |
||||
|
||||
return mapper.selectById(id); |
||||
} |
||||
|
||||
|
||||
private List<Map<String,String>> convertClassToMap( List<DeviceModelInfo> list) { |
||||
List<Map<String,String>> collect = list.stream().map(this::convertStringToMap).collect(Collectors.toList()); |
||||
return collect; |
||||
} |
||||
|
||||
|
||||
private Map<String,String> convertStringToMap(DeviceModelInfo info){ |
||||
Map<String,String> map =new HashMap<>(5); |
||||
map.put("deviceModelId",info.getDeviceModelId()); |
||||
map.put("deviceModelName",info.getDeviceModelName()); |
||||
map.put("firmId",info.getFirmId()); |
||||
map.put("agentId",info.getAgentId()); |
||||
map.put("firmName",info.getFirmName()); |
||||
return map; |
||||
} |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public IPage<DeviceModelVO> transform( IPage<DeviceModelInfo> oldPage, IPage<DeviceModelVO> newPage){ |
||||
newPage.setPages(oldPage.getPages()); |
||||
newPage.setCurrent(oldPage.getCurrent()); |
||||
newPage.setSize(oldPage.getSize()); |
||||
newPage.setTotal(oldPage.getTotal()); |
||||
if (StringUtils.isNotNull(oldPage) && StringUtils.isNotEmpty(oldPage.getRecords()) && oldPage.getRecords().size() > 0) { |
||||
List<DeviceModelVO> collectVO = oldPage.getRecords().stream().map(this::getDeviceModelVO).collect(Collectors.toList()); |
||||
newPage.setRecords(collectVO); |
||||
|
||||
} else { |
||||
newPage.setRecords(Collections.emptyList()); |
||||
} |
||||
return newPage; |
||||
|
||||
} |
||||
|
||||
/** |
||||
* 类装换 |
||||
* @param info |
||||
* @return |
||||
*/ |
||||
public DeviceModelVO getDeviceModelVO(DeviceModelInfo info){ |
||||
DeviceModelVO vo = new DeviceModelVO(); |
||||
vo.setDeviceModelId(info.getDeviceModelId()); |
||||
vo.setDeviceModelName(info.getDeviceModelName()); |
||||
if (StringUtils.isNotEmpty(info.getAgentId())){//说明是代理商
|
||||
this.getFirmManage(vo,info.getAgentId()); |
||||
}else {//厂商
|
||||
this.getFirmManage(vo,info.getFirmId()); |
||||
} |
||||
|
||||
//TODO 不知道数据来源先坐为空处理
|
||||
vo.setFunModel(this.obtainFunModel(info)); |
||||
vo.setDeviceType(info.getDeviceType()); |
||||
vo.setOfficialAccountName(info.getOfficialAccountName()); |
||||
vo.setCreateTime(info.getCreateTime()); |
||||
vo.setCreateUser(info.getCreateUser()); |
||||
vo.setUpdateUser(info.getUpdateUser()); |
||||
//功能说明
|
||||
vo.setFunDescription(this.assembleFunDescription(info)); |
||||
vo.setInputTotal(getInputTotal(info.getDeviceModelId())); |
||||
vo.setPositionModel(this.getPositionModel(info.getPositioningModeId())); |
||||
return vo; |
||||
|
||||
} |
||||
|
||||
private void getFirmManage(DeviceModelVO vo,String id){ |
||||
FirmManage firmManage = firmManageMapper.selectById(id); |
||||
if(StringUtils.isNotNull(firmManage)){ |
||||
vo.setFirmName(firmManage.getFirmName()); |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* 组装功能模块代码 |
||||
* @return |
||||
*/ |
||||
//TODO 这里还没有写完,找不到规律
|
||||
private String obtainFunModel(DeviceModelInfo info){ |
||||
StringBuilder builder =new StringBuilder(); |
||||
//定位
|
||||
if (StringUtils.isNotEmpty(info.getLocationFun()) && info.getLocationFun().trim().length()==DeviceModelConstants.NUMBER_ONE){ |
||||
//定位功能
|
||||
String l = String.valueOf(Integer.parseInt(info.getLocationFun())-1); |
||||
builder.append("L").append((l)); |
||||
} |
||||
|
||||
//视频类型名称
|
||||
if (StringUtils.isNotEmpty(info.getVideoModelName()) && !DeviceModelConstants.ZERO.equals(info.getVideoModelName()) && info.getVideoModelName().trim().length()==DeviceModelConstants.NUMBER_ONE){ |
||||
String v =String.valueOf(Integer.parseInt(info.getVideoModelName())-1); |
||||
builder.append("V").append((v)); |
||||
} |
||||
|
||||
return builder.toString(); |
||||
} |
||||
|
||||
|
||||
/** |
||||
* 根据设备模型id查询设备总数(只查询审批通过,并且没有删除的设备总数) |
||||
* @param deviceModelId |
||||
* @return |
||||
*/ |
||||
private int getInputTotal(String deviceModelId){ |
||||
QueryWrapper<DeviceInfo> wrapper =new QueryWrapper(); |
||||
wrapper.eq("device_model_id",deviceModelId).eq("audit_status",DeviceModelConstants.TWO).eq("del_flag",DeviceModelConstants.ONE); |
||||
List<DeviceInfo> infos = deviceInfoMapper.selectList(wrapper); |
||||
if (StringUtils.isNotEmpty(infos) && infos.size()>0){ |
||||
return infos.size(); |
||||
} |
||||
return DeviceModelConstants.NUMBER_ZERO; |
||||
} |
||||
|
||||
/** |
||||
* 根据定位模型ID查询 定位模型信息 |
||||
* @param pid |
||||
* @return |
||||
*/ |
||||
private String getPositionModel(String pid){ |
||||
if (StringUtils.isNotEmpty(pid)){ |
||||
//根据id 查询定位模式信息
|
||||
PositioningModelInfo positioningModelInfo = positioningModelInfoMapper.selectById(pid); |
||||
return positioningModelInfoService.classToMap(positioningModelInfo).get("name"); |
||||
//为null就使用默认值 默认的数据的id为1
|
||||
}else { |
||||
PositioningModelInfo positioningModelInfo = positioningModelInfoMapper.selectById(DeviceModelConstants.ONE); |
||||
return positioningModelInfoService.classToMap(positioningModelInfo).get("name"); |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* 根据设备模型ID查询设备表中有没有待审批跟审批通过的 |
||||
* @param deviceModelId |
||||
* @return |
||||
*/ |
||||
private int bindingDeviceCount(String deviceModelId){ |
||||
QueryWrapper<DeviceInfo> wrapper =new QueryWrapper(); |
||||
wrapper.eq("device_model_id",deviceModelId); |
||||
wrapper.eq("del_flag",DeviceModelConstants.ONE); |
||||
wrapper.lambda().and(s->s.eq(DeviceInfo::getAuditStatus,DeviceModelConstants.ONE).or().eq(DeviceInfo::getAuditStatus,DeviceModelConstants.TWO)); |
||||
return deviceInfoMapper.selectCount(wrapper); |
||||
} |
||||
|
||||
|
||||
/** |
||||
* 组装功能说明 |
||||
* @param model |
||||
* @return |
||||
*/ |
||||
private String assembleFunDescription(DeviceModelInfo model){ |
||||
StringBuilder buffer =new StringBuilder(); |
||||
if (StringUtils.isNotEmpty(model.getLocationFun())){ |
||||
buffer.append(DeviceModelEnum.getLocationFunString(Integer.parseInt(model.getLocationFun()))).append(","); |
||||
} |
||||
//支持视频类型
|
||||
if (StringUtils.isNotEmpty(model.getVideoModelName()) && !DeviceModelConstants.ZERO.equals(model.getVideoModelName())){ |
||||
if (DeviceModelConstants.ONE.equals(model.getVideoModelName())){ |
||||
buffer.append(DeviceModelConstants.JU_FENG).append(DeviceModelConstants.VIDEO_CALL); |
||||
}else if(DeviceModelConstants.TWO.equals(model.getVideoModelName())){ |
||||
buffer.append(DeviceModelConstants.SHENG_WANG).append(DeviceModelConstants.VIDEO_CALL); |
||||
}else if(DeviceModelConstants.THREE.equals(model.getVideoModelName())){ |
||||
buffer.append(DeviceModelConstants.BAI_RUI).append(DeviceModelConstants.VIDEO_CALL); |
||||
}else if(DeviceModelConstants.FOUR.equals(model.getVideoModelName())){ |
||||
buffer.append(DeviceModelConstants.TI_HU).append(DeviceModelConstants.VIDEO_CALL); |
||||
} |
||||
//视频规则
|
||||
if (StringUtils.isNotEmpty(model.getVideoRule())){ |
||||
//如果视频规则为0那就是默认配置
|
||||
if (DeviceModelConstants.ZERO.equals(model.getVideoRule())){ |
||||
buffer.append(DeviceModelConstants.DEFAULT_CONFIG).append(","); |
||||
}else { |
||||
buffer.append(":").append(model.getVideoRule()).append(","); |
||||
} |
||||
} |
||||
} |
||||
//手表闹钟
|
||||
if (StringUtils.isNotEmpty(model.getWatchAlarmClock()) && DeviceModelConstants.ONE.equals(model.getWatchAlarmClock())){ |
||||
buffer.append(DeviceModelConstants.WATCH_ALARM_CLOCK).append(","); |
||||
} |
||||
//上课禁用
|
||||
if (StringUtils.isNotEmpty(model.getClassDisable()) && DeviceModelConstants.ONE.equals(model.getClassDisable())){ |
||||
buffer.append(DeviceModelConstants.CLASS_DISABLE).append(","); |
||||
} |
||||
//SOS号码
|
||||
if (StringUtils.isNotEmpty(model.getSosPhone()) && DeviceModelConstants.ONE.equals(model.getSosPhone())){ |
||||
buffer.append(DeviceModelConstants.SOS_PHONE).append(","); |
||||
} |
||||
//电子围栏 electronicFence
|
||||
if (StringUtils.isNotEmpty(model.getElectronicFence()) && DeviceModelConstants.ONE.equals(model.getElectronicFence())){ |
||||
buffer.append(DeviceModelConstants.ELECTRONIC_FENCE).append(","); |
||||
} |
||||
//计步功能 stepRecorder
|
||||
if (StringUtils.isNotEmpty(model.getStepRecorder()) && DeviceModelConstants.ONE.equals(model.getStepRecorder())){ |
||||
buffer.append(DeviceModelConstants.STEP_RECORDER).append(","); |
||||
} |
||||
//微聊功能 chatFun
|
||||
if (StringUtils.isNotEmpty(model.getChatFun()) && DeviceModelConstants.ONE.equals(model.getChatFun())){ |
||||
buffer.append(DeviceModelConstants.CHAT_FUN).append(","); |
||||
} |
||||
|
||||
//查找设备功能 lookupFun
|
||||
if (StringUtils.isNotEmpty(model.getLookupFun()) && DeviceModelConstants.ONE.equals(model.getLookupFun())){ |
||||
buffer.append(DeviceModelConstants.LOOKUP_FUN).append(","); |
||||
} |
||||
|
||||
//手表WIFF watchWiff
|
||||
if (StringUtils.isNotEmpty(model.getWatchWiff()) && DeviceModelConstants.ONE.equals(model.getWatchWiff())){ |
||||
buffer.append(DeviceModelConstants.WATCH_WIFF).append(","); |
||||
} |
||||
|
||||
// 心率 heartRate;
|
||||
if (StringUtils.isNotEmpty(model.getHeartRate()) && DeviceModelConstants.ONE.equals(model.getHeartRate())){ |
||||
buffer.append(DeviceModelConstants.HEART_RATE).append(","); |
||||
} |
||||
// 体温 temperature
|
||||
if (StringUtils.isNotEmpty(model.getTemperature()) && DeviceModelConstants.ONE.equals(model.getTemperature())){ |
||||
buffer.append(DeviceModelConstants.TEMPERATURE).append(","); |
||||
} |
||||
|
||||
//血压 bloodPressure
|
||||
if (StringUtils.isNotEmpty(model.getBloodPressure()) && DeviceModelConstants.ONE.equals(model.getBloodPressure())){ |
||||
buffer.append(DeviceModelConstants.BLOOD_PRESSURE).append(","); |
||||
} |
||||
|
||||
//血氧 bloodOxygen
|
||||
if (StringUtils.isNotEmpty(model.getBloodOxygen()) && DeviceModelConstants.ONE.equals(model.getBloodOxygen())){ |
||||
buffer.append(DeviceModelConstants.BLOOD_OXYGEN).append(","); |
||||
} |
||||
|
||||
//白名单 whiteList
|
||||
if (StringUtils.isNotEmpty(model.getWhiteList()) && DeviceModelConstants.ONE.equals(model.getWhiteList())){ |
||||
buffer.append(DeviceModelConstants.WHITE_LIST).append(","); |
||||
} |
||||
|
||||
//拨号盘 dial
|
||||
if (StringUtils.isNotEmpty(model.getDial()) && DeviceModelConstants.ONE.equals(model.getDial())){ |
||||
buffer.append(DeviceModelConstants.DIAL).append(","); |
||||
} |
||||
|
||||
//定时开关机 timingSwitch
|
||||
if (StringUtils.isNotEmpty(model.getTimingSwitch()) && DeviceModelConstants.ONE.equals(model.getTimingSwitch())){ |
||||
buffer.append(DeviceModelConstants.TIMING_SWITCH).append(","); |
||||
} |
||||
|
||||
//电信 telecomVersion
|
||||
if (StringUtils.isNotEmpty(model.getTelecomVersion()) && DeviceModelConstants.ONE.equals(model.getTelecomVersion())){ |
||||
buffer.append(DeviceModelConstants.TELECOM).append(","); |
||||
} |
||||
String s = buffer.toString(); |
||||
if(StringUtils.isNotEmpty(s) && s.length()>=2){ |
||||
s.substring(0,s.length()-2); |
||||
} |
||||
return s; |
||||
} |
||||
} |
@ -0,0 +1,200 @@
@@ -0,0 +1,200 @@
|
||||
package com.ecell.internationalize.system.service.impl; |
||||
import com.ecell.internationalize.common.core.constant.UserConstants; |
||||
import com.ecell.internationalize.common.core.utils.StringUtils; |
||||
import com.ecell.internationalize.common.core.utils.uuid.UUID; |
||||
import com.ecell.internationalize.system.constant.DeviceModelConstants; |
||||
import com.ecell.internationalize.system.constant.DeviceModelEnum; |
||||
import com.ecell.internationalize.system.entity.DeviceModel; |
||||
import com.ecell.internationalize.system.entity.vo.DeviceModelVO; |
||||
import com.ecell.internationalize.system.mapper.DeviceModelMapper; |
||||
import com.ecell.internationalize.system.service.DeviceModelService; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import java.util.ArrayList; |
||||
import java.util.List; |
||||
import java.util.stream.Collectors; |
||||
|
||||
|
||||
/** |
||||
* 设备型号信息 |
||||
*/ |
||||
@Service |
||||
@Deprecated |
||||
public class DeviceModelServiceImpl implements DeviceModelService { |
||||
@Autowired |
||||
private DeviceModelMapper mapper; |
||||
|
||||
@Override |
||||
public int insertDeviceModel(DeviceModel model) { |
||||
|
||||
model.setDeviceModelId(UUID.fastUUID().toString(true)); |
||||
return mapper.insertDeviceModel(model); |
||||
} |
||||
|
||||
/** |
||||
* 校验同一厂商,设备类型名称是否唯一 |
||||
*/ |
||||
@Override |
||||
public String checkModelNameUnique(DeviceModel model) { |
||||
DeviceModel deviceModel = mapper.checkModelNameUnique(model.getFirmId(), model.getDeviceModelName()); |
||||
if (StringUtils.isNotNull(deviceModel) && !deviceModel.getFirmId().equals(model.getFirmId())) |
||||
{ |
||||
return UserConstants.NOT_UNIQUE; |
||||
} |
||||
return UserConstants.UNIQUE; |
||||
} |
||||
|
||||
/** |
||||
* 根据条件分页查询设备型号 |
||||
* @param model |
||||
* @return |
||||
*/ |
||||
@Override |
||||
public List<DeviceModelVO> selectModelList(DeviceModel model) { |
||||
List<DeviceModelVO> modelVOS =new ArrayList<>(); |
||||
List<DeviceModel> deviceModels = mapper.selectModelLists(model); |
||||
if (StringUtils.isNotEmpty(deviceModels)){ |
||||
modelVOS=transform(deviceModels); |
||||
} |
||||
return modelVOS; |
||||
} |
||||
/** |
||||
* 更新设备型号管理信息 |
||||
* @param model |
||||
* @return |
||||
*/ |
||||
@Override |
||||
public int updateDeviceModel(DeviceModel model) { |
||||
return mapper.updateDeviceModel(model); |
||||
} |
||||
/** |
||||
* 删除设备型号 |
||||
* @param id |
||||
* @return |
||||
*/ |
||||
@Override |
||||
public int deleteDeviceModelById(String id) { |
||||
return mapper.deleteDeviceModelById(id); |
||||
} |
||||
|
||||
private List<DeviceModelVO> transform(List<DeviceModel> models){ |
||||
List<DeviceModelVO> collect = models.stream().map(s -> { |
||||
DeviceModelVO vo = new DeviceModelVO(); |
||||
vo.setDeviceModelName(s.getDeviceModelName()); |
||||
|
||||
vo.setFirmName(s.getFirmName()); |
||||
|
||||
vo.setFunModel(""); |
||||
vo.setDeviceType(s.getDeviceType()); |
||||
vo.setOfficialAccountName(s.getOfficialAccountName()); |
||||
vo.setCreateTime(s.getCreateTime()); |
||||
// vo.setCreateBy(s.getCreateBy());
|
||||
//功能说明
|
||||
vo.setFunDescription(assembleFunDescription(s)); |
||||
|
||||
vo.setInputTotal(0); |
||||
|
||||
vo.setPositionModel(""); |
||||
return vo; |
||||
|
||||
}).collect(Collectors.toList()); |
||||
return collect ; |
||||
} |
||||
|
||||
//组装功能说明
|
||||
private String assembleFunDescription(DeviceModel model){ |
||||
StringBuffer buffer =new StringBuffer(); |
||||
if (StringUtils.isNotEmpty(model.getLocationFun())){ |
||||
buffer.append(DeviceModelEnum.getLocationFunString(Integer.parseInt(model.getLocationFun()))).append(","); |
||||
} |
||||
//支持视频类型
|
||||
if (StringUtils.isNotEmpty(model.getVideoModelName()) && !DeviceModelConstants.ZERO.equals(model.getDeviceModelName())){ |
||||
buffer.append(model.getDeviceModelName()).append(DeviceModelConstants.VIDEO_CALL); |
||||
//视频规则
|
||||
if (StringUtils.isNotEmpty(model.getVideoRule())){ |
||||
//如果视频规则为0那就是默认配置
|
||||
if (DeviceModelConstants.ZERO.equals(model.getVideoRule())){ |
||||
buffer.append(DeviceModelConstants.DEFAULT_CONFIG).append(","); |
||||
}else { |
||||
buffer.append(":").append(model.getVideoRule()).append(","); |
||||
} |
||||
} |
||||
} |
||||
//手表闹钟
|
||||
if (StringUtils.isNotEmpty(model.getWatchAlarmClock()) && DeviceModelConstants.ONE.equals(model.getWatchAlarmClock())){ |
||||
buffer.append(DeviceModelConstants.WATCH_ALARM_CLOCK).append(","); |
||||
} |
||||
//上课禁用
|
||||
if (StringUtils.isNotEmpty(model.getClassDisable()) && DeviceModelConstants.ONE.equals(model.getClassDisable())){ |
||||
buffer.append(DeviceModelConstants.CLASS_DISABLE).append(","); |
||||
} |
||||
//SOS号码
|
||||
if (StringUtils.isNotEmpty(model.getSosPhone()) && DeviceModelConstants.ONE.equals(model.getSosPhone())){ |
||||
buffer.append(DeviceModelConstants.SOS_PHONE).append(","); |
||||
} |
||||
//电子围栏 electronicFence
|
||||
if (StringUtils.isNotEmpty(model.getElectronicFence()) && DeviceModelConstants.ONE.equals(model.getElectronicFence())){ |
||||
buffer.append(DeviceModelConstants.ELECTRONIC_FENCE).append(","); |
||||
} |
||||
//计步功能 stepRecorder
|
||||
if (StringUtils.isNotEmpty(model.getStepRecorder()) && DeviceModelConstants.ONE.equals(model.getStepRecorder())){ |
||||
buffer.append(DeviceModelConstants.STEP_RECORDER).append(","); |
||||
} |
||||
//微聊功能 chatFun
|
||||
if (StringUtils.isNotEmpty(model.getChatFun()) && DeviceModelConstants.ONE.equals(model.getChatFun())){ |
||||
buffer.append(DeviceModelConstants.CHAT_FUN).append(","); |
||||
} |
||||
|
||||
//查找设备功能 lookupFun
|
||||
if (StringUtils.isNotEmpty(model.getLookupFun()) && DeviceModelConstants.ONE.equals(model.getLookupFun())){ |
||||
buffer.append(DeviceModelConstants.LOOKUP_FUN).append(","); |
||||
} |
||||
|
||||
//手表WIFF watchWiff
|
||||
if (StringUtils.isNotEmpty(model.getWatchWiff()) && DeviceModelConstants.ONE.equals(model.getWatchWiff())){ |
||||
buffer.append(DeviceModelConstants.WATCH_WIFF).append(","); |
||||
} |
||||
|
||||
// 心率 heartRate;
|
||||
if (StringUtils.isNotEmpty(model.getHeartRate()) && DeviceModelConstants.ONE.equals(model.getHeartRate())){ |
||||
buffer.append(DeviceModelConstants.HEART_RATE).append(","); |
||||
} |
||||
// 体温 temperature
|
||||
if (StringUtils.isNotEmpty(model.getTemperature()) && DeviceModelConstants.ONE.equals(model.getTemperature())){ |
||||
buffer.append(DeviceModelConstants.TEMPERATURE).append(","); |
||||
} |
||||
|
||||
//血压 bloodPressure
|
||||
if (StringUtils.isNotEmpty(model.getBloodPressure()) && DeviceModelConstants.ONE.equals(model.getBloodPressure())){ |
||||
buffer.append(DeviceModelConstants.BLOOD_PRESSURE).append(","); |
||||
} |
||||
|
||||
//血氧 bloodOxygen
|
||||
if (StringUtils.isNotEmpty(model.getBloodOxygen()) && DeviceModelConstants.ONE.equals(model.getBloodOxygen())){ |
||||
buffer.append(DeviceModelConstants.BLOOD_OXYGEN).append(","); |
||||
} |
||||
|
||||
//白名单 whiteList
|
||||
if (StringUtils.isNotEmpty(model.getWhiteList()) && DeviceModelConstants.ONE.equals(model.getWhiteList())){ |
||||
buffer.append(DeviceModelConstants.WHITE_LIST).append(","); |
||||
} |
||||
|
||||
//拨号盘 dial
|
||||
if (StringUtils.isNotEmpty(model.getDial()) && DeviceModelConstants.ONE.equals(model.getDial())){ |
||||
buffer.append(DeviceModelConstants.DIAL).append(","); |
||||
} |
||||
|
||||
//定时开关机 timingSwitch
|
||||
if (StringUtils.isNotEmpty(model.getTimingSwitch()) && DeviceModelConstants.ONE.equals(model.getTimingSwitch())){ |
||||
buffer.append(DeviceModelConstants.TIMING_SWITCH).append(","); |
||||
} |
||||
|
||||
//电信 telecomVersion
|
||||
if (StringUtils.isNotEmpty(model.getTelecomVersion()) && DeviceModelConstants.ONE.equals(model.getTelecomVersion())){ |
||||
buffer.append(DeviceModelConstants.TELECOM).append(","); |
||||
} |
||||
return buffer.toString(); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,39 @@
@@ -0,0 +1,39 @@
|
||||
package com.ecell.internationalize.system.service.impl; |
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||
import com.ecell.internationalize.common.system.constant.FieldConstant; |
||||
import com.ecell.internationalize.system.entity.DevicePosition; |
||||
import com.ecell.internationalize.system.mapper.DevicePositionMapper; |
||||
import com.ecell.internationalize.system.service.DevicePositionService; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* <p> |
||||
* 设备定位(签到) 服务实现类 |
||||
* </p> |
||||
* |
||||
* @author liy |
||||
* @since 2022-07-11 |
||||
*/ |
||||
@Service |
||||
public class DevicePositionServiceImpl extends ServiceImpl<DevicePositionMapper, DevicePosition> implements DevicePositionService { |
||||
@Autowired |
||||
private DevicePositionMapper devicePositionMapper; |
||||
/** |
||||
* 设备签到条件分页查询 |
||||
* @Author liy |
||||
* @Date 2022/7/12 16:42 |
||||
* @param map 分页查询体 |
||||
* @return IPage |
||||
*/ |
||||
@Override |
||||
public IPage<DevicePosition> findAllByPage(Map<String, Object> map) { |
||||
Page<DevicePosition> page=new Page<>(Integer.parseInt(map.get(FieldConstant.CURRENT).toString()),Integer.parseInt(map.get(FieldConstant.SIZE).toString())); |
||||
return devicePositionMapper.getList(page,map); |
||||
} |
||||
} |
@ -0,0 +1,139 @@
@@ -0,0 +1,139 @@
|
||||
package com.ecell.internationalize.system.utils; |
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper; |
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
import com.ecell.internationalize.common.core.utils.StringUtils; |
||||
import com.ecell.internationalize.common.security.utils.SecurityUtils; |
||||
import com.ecell.internationalize.system.constant.DeviceModelConstants; |
||||
import com.ecell.internationalize.system.constant.DeviceModelEnum; |
||||
import com.ecell.internationalize.system.entity.DeviceModelInfo; |
||||
|
||||
public class DeviceModelInfoUtli { |
||||
|
||||
/** |
||||
* 组装功能说明 |
||||
* @param model |
||||
* @return |
||||
*/ |
||||
public static String assembleFunDescription(DeviceModelInfo model){ |
||||
StringBuilder buffer =new StringBuilder(); |
||||
if (StringUtils.isNotEmpty(model.getLocationFun())){ |
||||
buffer.append(DeviceModelEnum.getLocationFunString(Integer.parseInt(model.getLocationFun()))).append(","); |
||||
} |
||||
//支持视频类型
|
||||
if (StringUtils.isNotEmpty(model.getVideoModelName()) && !DeviceModelConstants.ZERO.equals(model.getVideoModelName())){ |
||||
if (DeviceModelConstants.ONE.equals(model.getVideoModelName())){ |
||||
buffer.append(DeviceModelConstants.JU_FENG).append(DeviceModelConstants.VIDEO_CALL); |
||||
}else if(DeviceModelConstants.TWO.equals(model.getVideoModelName())){ |
||||
buffer.append(DeviceModelConstants.SHENG_WANG).append(DeviceModelConstants.VIDEO_CALL); |
||||
}else if(DeviceModelConstants.THREE.equals(model.getVideoModelName())){ |
||||
buffer.append(DeviceModelConstants.BAI_RUI).append(DeviceModelConstants.VIDEO_CALL); |
||||
}else if(DeviceModelConstants.FOUR.equals(model.getVideoModelName())){ |
||||
buffer.append(DeviceModelConstants.TI_HU).append(DeviceModelConstants.VIDEO_CALL); |
||||
} |
||||
//视频规则
|
||||
if (StringUtils.isNotEmpty(model.getVideoRule())){ |
||||
//如果视频规则为0那就是默认配置
|
||||
if (DeviceModelConstants.ZERO.equals(model.getVideoRule())){ |
||||
buffer.append(DeviceModelConstants.DEFAULT_CONFIG).append(","); |
||||
}else { |
||||
buffer.append(":").append(model.getVideoRule()).append(","); |
||||
} |
||||
} |
||||
} |
||||
//手表闹钟
|
||||
if (StringUtils.isNotEmpty(model.getWatchAlarmClock()) && DeviceModelConstants.ONE.equals(model.getWatchAlarmClock())){ |
||||
buffer.append(DeviceModelConstants.WATCH_ALARM_CLOCK).append(","); |
||||
} |
||||
//上课禁用
|
||||
if (StringUtils.isNotEmpty(model.getClassDisable()) && DeviceModelConstants.ONE.equals(model.getClassDisable())){ |
||||
buffer.append(DeviceModelConstants.CLASS_DISABLE).append(","); |
||||
} |
||||
//SOS号码
|
||||
if (StringUtils.isNotEmpty(model.getSosPhone()) && DeviceModelConstants.ONE.equals(model.getSosPhone())){ |
||||
buffer.append(DeviceModelConstants.SOS_PHONE).append(","); |
||||
} |
||||
//电子围栏 electronicFence
|
||||
if (StringUtils.isNotEmpty(model.getElectronicFence()) && DeviceModelConstants.ONE.equals(model.getElectronicFence())){ |
||||
buffer.append(DeviceModelConstants.ELECTRONIC_FENCE).append(","); |
||||
} |
||||
//计步功能 stepRecorder
|
||||
if (StringUtils.isNotEmpty(model.getStepRecorder()) && DeviceModelConstants.ONE.equals(model.getStepRecorder())){ |
||||
buffer.append(DeviceModelConstants.STEP_RECORDER).append(","); |
||||
} |
||||
//微聊功能 chatFun
|
||||
if (StringUtils.isNotEmpty(model.getChatFun()) && DeviceModelConstants.ONE.equals(model.getChatFun())){ |
||||
buffer.append(DeviceModelConstants.CHAT_FUN).append(","); |
||||
} |
||||
|
||||
//查找设备功能 lookupFun
|
||||
if (StringUtils.isNotEmpty(model.getLookupFun()) && DeviceModelConstants.ONE.equals(model.getLookupFun())){ |
||||
buffer.append(DeviceModelConstants.LOOKUP_FUN).append(","); |
||||
} |
||||
|
||||
//手表WIFF watchWiff
|
||||
if (StringUtils.isNotEmpty(model.getWatchWiff()) && DeviceModelConstants.ONE.equals(model.getWatchWiff())){ |
||||
buffer.append(DeviceModelConstants.WATCH_WIFF).append(","); |
||||
} |
||||
|
||||
// 心率 heartRate;
|
||||
if (StringUtils.isNotEmpty(model.getHeartRate()) && DeviceModelConstants.ONE.equals(model.getHeartRate())){ |
||||
buffer.append(DeviceModelConstants.HEART_RATE).append(","); |
||||
} |
||||
// 体温 temperature
|
||||
if (StringUtils.isNotEmpty(model.getTemperature()) && DeviceModelConstants.ONE.equals(model.getTemperature())){ |
||||
buffer.append(DeviceModelConstants.TEMPERATURE).append(","); |
||||
} |
||||
|
||||
//血压 bloodPressure
|
||||
if (StringUtils.isNotEmpty(model.getBloodPressure()) && DeviceModelConstants.ONE.equals(model.getBloodPressure())){ |
||||
buffer.append(DeviceModelConstants.BLOOD_PRESSURE).append(","); |
||||
} |
||||
|
||||
//血氧 bloodOxygen
|
||||
if (StringUtils.isNotEmpty(model.getBloodOxygen()) && DeviceModelConstants.ONE.equals(model.getBloodOxygen())){ |
||||
buffer.append(DeviceModelConstants.BLOOD_OXYGEN).append(","); |
||||
} |
||||
|
||||
//白名单 whiteList
|
||||
if (StringUtils.isNotEmpty(model.getWhiteList()) && DeviceModelConstants.ONE.equals(model.getWhiteList())){ |
||||
buffer.append(DeviceModelConstants.WHITE_LIST).append(","); |
||||
} |
||||
|
||||
//拨号盘 dial
|
||||
if (StringUtils.isNotEmpty(model.getDial()) && DeviceModelConstants.ONE.equals(model.getDial())){ |
||||
buffer.append(DeviceModelConstants.DIAL).append(","); |
||||
} |
||||
|
||||
//定时开关机 timingSwitch
|
||||
if (StringUtils.isNotEmpty(model.getTimingSwitch()) && DeviceModelConstants.ONE.equals(model.getTimingSwitch())){ |
||||
buffer.append(DeviceModelConstants.TIMING_SWITCH).append(","); |
||||
} |
||||
|
||||
//电信 telecomVersion
|
||||
if (StringUtils.isNotEmpty(model.getTelecomVersion()) && DeviceModelConstants.ONE.equals(model.getTelecomVersion())){ |
||||
buffer.append(DeviceModelConstants.TELECOM).append(","); |
||||
} |
||||
String s = buffer.toString(); |
||||
if(StringUtils.isNotEmpty(s) && s.length()>=2){ |
||||
s.substring(0,s.length()-2); |
||||
} |
||||
return s; |
||||
} |
||||
|
||||
/** |
||||
* 数据权限 |
||||
* @param wrapper |
||||
* @param column---》数据库所对于的类名称 |
||||
* @param value---》参数 |
||||
*/ |
||||
public static void dataPermissions(Wrapper wrapper, String column, Object value){ |
||||
if (wrapper instanceof QueryWrapper ){ |
||||
//不是管理员
|
||||
if (!SecurityUtils.isAdminString(SecurityUtils.getUserId())){ |
||||
((QueryWrapper<?>) wrapper).eq(column,value); |
||||
} |
||||
} |
||||
|
||||
} |
||||
} |
@ -0,0 +1,168 @@
@@ -0,0 +1,168 @@
|
||||
<?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.ecell.internationalize.system.mapper.DeviceModelMapper"> |
||||
|
||||
<resultMap type="com.ecell.internationalize.system.entity.DeviceModel" id="DeviceModelResult"> |
||||
<id property="deviceModelId" column="device_model_id"/> |
||||
<result property="deviceModelName" column="device_model_name"/> |
||||
<result property="firmId" column="firm_id"/> |
||||
<result property="firmName" column="firm_name"/> |
||||
<result property="locationFun" column="location_fun"/> |
||||
<result property="videoModelName" column="video_model_name"/> |
||||
<result property="videoRule" column="video_rule"/> |
||||
<result property="videoModelId" column="video_model_id"/> |
||||
<result property="deviceType" column="device_type"/> |
||||
<result property="officialAccountName" column="official_account_name"/> |
||||
<result property="watchAlarmClock" column="watch_alarm_clock"/> |
||||
<result property="classDisable" column="class_disable"/> |
||||
<result property="sosPhone" column="sos_phone"/> |
||||
<result property="electronicFence" column="electronic_fence"/> |
||||
<result property="stepRecorder" column="step_recorder"/> |
||||
<result property="chatFun" column="chat_fun"/> |
||||
<result property="lookupFun" column="lookup_fun"/> |
||||
<result property="watchWiff" column="watch_wiff"/> |
||||
<result property="heartRate" column="heart_rate"/> |
||||
<result property="temperature" column="temperature"/> |
||||
<result property="bloodPressure" column="blood_pressure"/> |
||||
<result property="bloodOxygen" column="blood_oxygen"/> |
||||
<result property="whiteList" column="white_list"/> |
||||
<result property="dial" column="dial"/> |
||||
<result property="timingSwitch" column="timing_switch"/> |
||||
<result property="telecomVersion" column="telecom_version"/> |
||||
<result property="createBy" column="create_user"/> |
||||
<result property="createTime" column="create_time"/> |
||||
<result property="updateBy" column="update_user"/> |
||||
<result property="updateTime" column="update_time"/> |
||||
</resultMap> |
||||
|
||||
<sql id="selectDeviceModel"> |
||||
select d.device_model_id, d.device_model_name, d.firm_id, d.firm_name, d.video_model_name, d.video_model_id, d.device_type,d.create_time |
||||
from device_model_info d |
||||
</sql> |
||||
|
||||
<insert id="insertDeviceModel" parameterType="com.ecell.internationalize.system.entity.DeviceModel"> |
||||
insert into device_model_info( |
||||
<if test="deviceModelId != null and deviceModelId != ''">device_model_id,</if> |
||||
<if test="deviceModelName != null and deviceModelName != ''">device_model_name,</if> |
||||
<if test="firmId != null and firmId != ''">firm_id,</if> |
||||
<if test="firmName != null and firmName != ''">firm_name,</if> |
||||
<if test="locationFun != null and locationFun != ''" >location_fun,</if> |
||||
<if test="videoModelName != null and videoModelName != ''">video_model_name,</if> |
||||
<if test="videoRule != null and videoRule != ''">video_rule,</if> |
||||
<if test="videoModelId != null and videoModelId != ''">video_model_id,</if> |
||||
<if test="deviceType != null and deviceType != ''">device_type,</if> |
||||
<if test="officialAccountName != null and officialAccountName != ''">official_account_name,</if> |
||||
<if test="watchAlarmClock != null and watchAlarmClock != ''">watch_alarm_clock,</if> |
||||
<if test="classDisable != null and classDisable != ''">class_disable,</if> |
||||
<if test="sosPhone != null and sosPhone != ''">sos_phone,</if> |
||||
<if test="electronicFence != null and electronicFence != ''">electronic_fence,</if> |
||||
<if test="stepRecorder != null and stepRecorder != ''">step_recorder,</if> |
||||
<if test="chatFun != null and chatFun != ''">chat_fun,</if> |
||||
<if test="lookupFun != null and lookupFun != ''">lookup_fun,</if> |
||||
<if test="watchWiff != null and watchWiff != ''">watch_wiff,</if> |
||||
<if test="heartRate != null and heartRate != ''">heart_rate,</if> |
||||
<if test="temperature != null and temperature != ''">temperature,</if> |
||||
<if test="bloodPressure != null and bloodPressure != ''">blood_pressure,</if> |
||||
<if test="bloodOxygen != null and bloodOxygen != ''">blood_oxygen,</if> |
||||
<if test="whiteList != null and whiteList != ''">white_list,</if> |
||||
<if test="dial != null and dial != ''">dial,</if> |
||||
<if test="timingSwitch != null and timingSwitch != ''">timing_switch,</if> |
||||
<if test="telecomVersion != null and telecomVersion != ''">telecom_version,</if> |
||||
<if test="createBy != null and createBy != ''">create_user,</if> |
||||
create_time |
||||
)values( |
||||
<if test="deviceModelId != null and deviceModelId != ''">#{deviceModelId},</if> |
||||
<if test="deviceModelName != null and deviceModelName != ''">#{deviceModelName},</if> |
||||
<if test="firmId != null and firmId != ''">#{firmId},</if> |
||||
<if test="firmName != null and firmName != ''">#{firmName},</if> |
||||
<if test="locationFun != null and locationFun != ''" >#{locationFun},</if> |
||||
<if test="videoModelName != null and videoModelName != ''">#{videoModelName},</if> |
||||
<if test="videoRule != null and videoRule != ''">#{videoRule},</if> |
||||
<if test="videoModelId != null and videoModelId != ''">#{videoModelId},</if> |
||||
<if test="deviceType != null and deviceType != ''">#{deviceType},</if> |
||||
<if test="officialAccountName != null and officialAccountName != ''">#{officialAccountName},</if> |
||||
<if test="watchAlarmClock != null and watchAlarmClock != ''">#{watchAlarmClock},</if> |
||||
<if test="classDisable != null and classDisable != ''">#{classDisable},</if> |
||||
<if test="sosPhone != null and sosPhone != ''">#{sosPhone},</if> |
||||
<if test="electronicFence != null and electronicFence != ''">#{electronicFence},</if> |
||||
<if test="stepRecorder != null and stepRecorder != ''">#{stepRecorder},</if> |
||||
<if test="chatFun != null and chatFun != ''">#{chatFun},</if> |
||||
<if test="lookupFun != null and lookupFun != ''">#{lookupFun},</if> |
||||
<if test="watchWiff != null and watchWiff != ''">#{watchWiff},</if> |
||||
<if test="heartRate != null and heartRate != ''">#{heartRate},</if> |
||||
<if test="temperature != null and temperature != ''">#{temperature},</if> |
||||
<if test="bloodPressure != null and bloodPressure != ''">#{bloodPressure},</if> |
||||
<if test="bloodOxygen != null and bloodOxygen != ''">#{bloodOxygen},</if> |
||||
<if test="whiteList != null and whiteList != ''">#{whiteList},</if> |
||||
<if test="dial != null and dial != ''">#{dial},</if> |
||||
<if test="timingSwitch != null and timingSwitch != ''">#{timingSwitch},</if> |
||||
<if test="telecomVersion != null and telecomVersion != ''">#{telecomVersion},</if> |
||||
<if test="createBy != null and createBy != ''">#{createBy},</if> |
||||
sysdate() |
||||
) |
||||
</insert> |
||||
|
||||
<select id="checkModelNameUnique" resultMap="DeviceModelResult"> |
||||
<include refid="selectDeviceModel"></include> |
||||
where firm_id =#{firmId} and firm_name = #{modelName} limit 1 |
||||
|
||||
</select> |
||||
|
||||
|
||||
<select id="selectModelLists" parameterType="com.ecell.internationalize.system.entity.DeviceModel" resultMap="DeviceModelResult"> |
||||
select * from device_model_info |
||||
where del_flag='1' |
||||
<if test="firmName != null and firmName != ''"> |
||||
and firm_name=#{firmName} |
||||
</if> |
||||
<if test="deviceModelName != null and deviceModelName != ''"> |
||||
and device_model_name=#{deviceModelName} |
||||
</if> |
||||
|
||||
|
||||
</select> |
||||
|
||||
<update id="updateDeviceModel" parameterType="com.ecell.internationalize.system.entity.DeviceModel"> |
||||
update device_model_info |
||||
<set> |
||||
<if test="deviceModelName != null and deviceModelName != ''">device_model_name=#{deviceModelName},</if> |
||||
<if test="firmId != null and firmId != ''">firm_id=#{firmId},</if> |
||||
<if test="firmName != null and firmName != ''">firm_name=#{firmName},</if> |
||||
<if test="locationFun != null and locationFun != ''" >location_fun=#{locationFun},</if> |
||||
<if test="videoRule != null and videoRule != ''">video_rule=#{videoRule},</if> |
||||
<if test="videoModelId != null and videoModelId != ''">video_model_id=#{videoModelId},</if> |
||||
<if test="deviceType != null and deviceType != ''">device_type=#{deviceType},</if> |
||||
<if test="officialAccountName != null and officialAccountName != ''">official_account_name=#{officialAccountName},</if> |
||||
<if test="watchAlarmClock != null and watchAlarmClock != ''">watch_alarm_clock=#{watchAlarmClock},</if> |
||||
<if test="classDisable != null and classDisable != ''">class_disable=#{classDisable},</if> |
||||
<if test="sosPhone != null and sosPhone != ''">sos_phone=#{sosPhone},</if> |
||||
<if test="electronicFence != null and electronicFence != ''">electronic_fence=#{electronicFence},</if> |
||||
<if test="stepRecorder != null and stepRecorder != ''">step_recorder=#{stepRecorder},</if> |
||||
<if test="chatFun != null and chatFun != ''">chat_fun=#{chatFun},</if> |
||||
<if test="lookupFun != null and lookupFun != ''">lookup_fun=#{lookupFun},</if> |
||||
<if test="watchWiff != null and watchWiff != ''">watch_wiff=#{watchWiff},</if> |
||||
<if test="heartRate != null and heartRate != ''">heart_rate=#{heartRate},</if> |
||||
<if test="temperature != null and temperature != ''">temperature=#{temperature},</if> |
||||
<if test="bloodPressure != null and bloodPressure != ''">blood_pressure=#{bloodPressure},</if> |
||||
<if test="bloodOxygen != null and bloodOxygen != ''">blood_oxygen=#{bloodOxygen},</if> |
||||
<if test="whiteList != null and whiteList != ''">white_list=#{whiteList},</if> |
||||
<if test="dial != null and dial != ''">dial=#{dial},</if> |
||||
<if test="timingSwitch != null and timingSwitch != ''">timing_switch=#{timingSwitch},</if> |
||||
<if test="telecomVersion != null and telecomVersion != ''">telecom_version=#{telecomVersion},</if> |
||||
<if test="updateBy != null and updateBy != ''">update_user=#{updateBy},</if> |
||||
update_time = sysdate() |
||||
</set> |
||||
where device_model_id =#{deviceModelId} |
||||
</update> |
||||
|
||||
<delete id="deleteDeviceModelById" parameterType="java.lang.String"> |
||||
update device_model_info set del_flag ='0' where device_model_id =#{id} |
||||
</delete> |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</mapper> |
@ -0,0 +1,32 @@
@@ -0,0 +1,32 @@
|
||||
<?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.ecell.internationalize.system.mapper.DevicePositionMapper"> |
||||
|
||||
<!-- 通用查询映射结果 --> |
||||
<resultMap id="BaseResultMap" type="com.ecell.internationalize.system.entity.DevicePosition"> |
||||
<id column="id" property="id" /> |
||||
<result column="i_mei" property="mei" /> |
||||
<result column="longitude" property="longitude" /> |
||||
<result column="latitude" property="latitude" /> |
||||
<result column="position_type" property="positionType" /> |
||||
<result column="address" property="address" /> |
||||
<result column="create_user" property="createUser" /> |
||||
<result column="create_time" property="createTime" /> |
||||
<result column="update_user" property="updateUser" /> |
||||
<result column="update_time" property="updateTime" /> |
||||
</resultMap> |
||||
<select id="getList" resultMap="BaseResultMap"> |
||||
select A.id,A.i_mei,A.longitude,A.latitude,A.position_type,A.address,A.create_user,A.create_time,A.update_user,A.update_time from |
||||
device_position A |
||||
where 1=1 |
||||
<if test="map.iMei!=null and map.iMei!=''"> |
||||
and A.i_mei=#{map.iMei} |
||||
</if> |
||||
<if test="map.startTime!=null"> |
||||
<![CDATA[and DATE_FORMAT(A.create_time,'%Y-%m-%d')>=DATE_FORMAT(#{map.startTime},'%Y-%m-%d')]]> |
||||
</if> |
||||
<if test="map.endTime!=null"> |
||||
<![CDATA[and DATE_FORMAT(A.create_time,'%Y-%m-%d')<=DATE_FORMAT(#{map.endTime},'%Y-%m-%d')]]> |
||||
</if> |
||||
</select> |
||||
</mapper> |
Loading…
Reference in new issue