|  |  | 
 |  |  | package com.ruoyi.web.controller.common; | 
 |  |  |  | 
 |  |  | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | 
 |  |  | import com.ruoyi.common.annotation.DataDictClass; | 
 |  |  | import com.ruoyi.common.annotation.Log; | 
 |  |  | import com.ruoyi.common.annotation.RepeatSubmit; | 
 |  |  | import com.ruoyi.common.core.domain.AjaxResult; | 
 |  |  | 
 |  |  |     @ApiOperation("基础信息") | 
 |  |  |     @Log(type = LogType.EQUIPMENT_LOG, operation = EquipmentLog.LOAD) | 
 |  |  |     @GetMapping | 
 |  |  |     public AjaxResult externalAdd() { | 
 |  |  |     public AjaxResult externaList() { | 
 |  |  |  | 
 |  |  |         // 智控设备类型 | 
 |  |  |         List<SysDictData> dict1 = dictDataService.list(new QueryWrapper<SysDictData>().lambda().eq(SysDictData::getDictType, "DICT101")); | 
 |  |  | 
 |  |  |         List<SysDictData> dict2 = dictDataService.list(new QueryWrapper<SysDictData>().lambda().eq(SysDictData::getDictType, "DICT102")); | 
 |  |  |         // 串口通信波特率 | 
 |  |  |         List<SysDictData> dict3 = dictDataService.list(new QueryWrapper<SysDictData>().lambda().eq(SysDictData::getDictType, "DICT103")); | 
 |  |  |         // 在用状态 | 
 |  |  |         List<SysDictData> dict4 = dictDataService.list(new QueryWrapper<SysDictData>().lambda().eq(SysDictData::getDictType, "DICT104")); | 
 |  |  |         // 办学层次 | 
 |  |  |         List<SysDictData> dict5 = dictDataService.list(new QueryWrapper<SysDictData>().lambda().eq(SysDictData::getDictType, "DICT105")); | 
 |  |  |         // 学科范围 | 
 |  |  |         List<SysDictData> dict6 = dictDataService.list(new QueryWrapper<SysDictData>().lambda().eq(SysDictData::getDictType, "DICT106")); | 
 |  |  |         // 采集周期 | 
 |  |  |         List<SysDictData> dict7 = dictDataService.list(new QueryWrapper<SysDictData>().lambda().eq(SysDictData::getDictType, "DICT107")); | 
 |  |  |         // 外设单元 | 
 |  |  | 
 |  |  |         map.put("DICT101", dict1); | 
 |  |  |         map.put("DICT102", dict2); | 
 |  |  |         map.put("DICT103", dict3); | 
 |  |  |         map.put("DICT104", dict4); | 
 |  |  |         map.put("DICT105", dict5); | 
 |  |  |         map.put("DICT106", dict6); | 
 |  |  |         map.put("DICT107", dict7); | 
 |  |  |         map.put("peripheralUnit", peripheralUnit); | 
 |  |  |         map.put("batch", batch); | 
 |  |  | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 新增智控设备 | 
 |  |  |      * 设备校验 | 
 |  |  |      */ | 
 |  |  |     @ApiOperation("新增智控设备") | 
 |  |  |     @Log(type = LogType.EQUIPMENT_LOG, operation = EquipmentLog.WRITE) | 
 |  |  |     @ApiOperation("设备校验") | 
 |  |  |     @Log(type = LogType.EQUIPMENT_LOG, operation = EquipmentLog.CHECK) | 
 |  |  |     @RepeatSubmit() | 
 |  |  |     @PostMapping("/equipment") | 
 |  |  |     @DataDictClass | 
 |  |  |     public AjaxResult equipmentAdd(@Validated(AddGroup.class) @RequestBody DevEquipmentBo bo) { | 
 |  |  |         return AjaxResult.success(iDevEquipmentService.externalAdd(bo)); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 编辑智控设备 | 
 |  |  |      * 设备写入参数 | 
 |  |  |      */ | 
 |  |  |     @ApiOperation("新增智控设备(外部调用-去掉权限)") | 
 |  |  |     @ApiOperation("设备写入参数") | 
 |  |  |     @RepeatSubmit() | 
 |  |  |     @Log(type = LogType.EQUIPMENT_LOG, operation = EquipmentLog.SUBMIT_COMMENT) | 
 |  |  |     @PutMapping("/equipment") | 
 |  |  |     @Log(type = LogType.EQUIPMENT_LOG, operation = EquipmentLog.WRITE) | 
 |  |  |     @PostMapping("/edit") | 
 |  |  |     public AjaxResult equipmentEdit(@Validated(AddGroup.class) @RequestBody DevEquipmentBo bo) { | 
 |  |  |         return AjaxResult.success(iDevEquipmentService.equipmentEdit(bo)); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 提交备注 | 
 |  |  |      */ | 
 |  |  |     @ApiOperation("提交备注") | 
 |  |  |     @RepeatSubmit() | 
 |  |  |     @Log(type = LogType.EQUIPMENT_LOG, operation = EquipmentLog.SUBMIT_COMMENT) | 
 |  |  |     @PostMapping("/submitComment") | 
 |  |  |     public AjaxResult submitComment(@Validated(AddGroup.class) @RequestBody DevEquipmentBo bo) { | 
 |  |  |         iDevEquipmentService.submitComment(bo); | 
 |  |  |         return AjaxResult.success(); | 
 |  |  |     } | 
 |  |  | } | 
 
 |  |  | 
 |  |  |         return AjaxResult.success(iDevEquipmentService.queryById(id)); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  | //    /** | 
 |  |  | //     * 新增智控设备 | 
 |  |  | //     */ | 
 |  |  | //    @ApiOperation("新增智控设备") | 
 |  |  | //    @PreAuthorize("@ss.hasPermi('oa:equipment:add')") | 
 |  |  | //    @Log(title = "智控设备", businessType = BusinessType.INSERT) | 
 |  |  | //    @RepeatSubmit() | 
 |  |  | //    @PostMapping() | 
 |  |  | //    public AjaxResult<Void> add(@Validated(AddGroup.class) @RequestBody DevEquipmentBo bo) { | 
 |  |  | //        return toAjax(iDevEquipmentService.insertByBo(bo) ? 1 : 0); | 
 |  |  | //    } | 
 |  |  |     /** | 
 |  |  |      * 新增智控设备 | 
 |  |  |      */ | 
 |  |  |     @ApiOperation("新增智控设备") | 
 |  |  |     @PreAuthorize("@ss.hasPermi('oa:equipment:add')") | 
 |  |  |     @Log(title = "智控设备", businessType = BusinessType.INSERT) | 
 |  |  |     @RepeatSubmit() | 
 |  |  |     @PostMapping() | 
 |  |  |     public AjaxResult<Void> add(@Validated(AddGroup.class) @RequestBody DevEquipmentBo bo) { | 
 |  |  |         return toAjax(iDevEquipmentService.insertByBo(bo) ? 1 : 0); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |  | 
 |  |  |     /** | 
 
 |  |  | 
 |  |  | import java.util.Arrays; | 
 |  |  | import java.util.concurrent.TimeUnit; | 
 |  |  |  | 
 |  |  | import com.ruoyi.common.annotation.DataDictClass; | 
 |  |  | import lombok.RequiredArgsConstructor; | 
 |  |  | import javax.servlet.http.HttpServletResponse; | 
 |  |  | import javax.validation.constraints.*; | 
 |  |  | 
 |  |  |     @ApiOperation("查询设备联机日志列表") | 
 |  |  |     @PreAuthorize("@ss.hasPermi('oa:equipmentLog:list')") | 
 |  |  |     @GetMapping("/list") | 
 |  |  |     @DataDictClass | 
 |  |  |     public TableDataInfo<DevEquipmentLogVo> list(@Validated(QueryGroup.class) DevEquipmentLogBo bo) { | 
 |  |  |         return iDevEquipmentLogService.queryPageList(bo); | 
 |  |  |     } | 
 
| New file | 
 |  |  | 
 |  |  | package com.ruoyi.web.controller.oa; | 
 |  |  |  | 
 |  |  | import java.util.List; | 
 |  |  | import java.util.Arrays; | 
 |  |  | import java.util.concurrent.TimeUnit; | 
 |  |  |  | 
 |  |  | import com.ruoyi.common.annotation.DataDictClass; | 
 |  |  | import lombok.RequiredArgsConstructor; | 
 |  |  | import javax.servlet.http.HttpServletResponse; | 
 |  |  | import javax.validation.constraints.*; | 
 |  |  | import org.springframework.security.access.prepost.PreAuthorize; | 
 |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
 |  |  | import org.springframework.web.bind.annotation.*; | 
 |  |  | import org.springframework.validation.annotation.Validated; | 
 |  |  | import com.ruoyi.common.annotation.RepeatSubmit; | 
 |  |  | 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.validate.AddGroup; | 
 |  |  | import com.ruoyi.common.core.validate.EditGroup; | 
 |  |  | import com.ruoyi.common.core.validate.QueryGroup; | 
 |  |  | import com.ruoyi.common.enums.BusinessType; | 
 |  |  | import com.ruoyi.common.utils.poi.ExcelUtil; | 
 |  |  | import com.ruoyi.oa.domain.vo.DevManufacturerVo; | 
 |  |  | import com.ruoyi.oa.domain.bo.DevManufacturerBo; | 
 |  |  | import com.ruoyi.oa.service.IDevManufacturerService; | 
 |  |  | import com.ruoyi.common.core.page.TableDataInfo; | 
 |  |  | import io.swagger.annotations.Api; | 
 |  |  | import io.swagger.annotations.ApiParam; | 
 |  |  | import io.swagger.annotations.ApiOperation; | 
 |  |  |  | 
 |  |  | /** | 
 |  |  |  * 厂商Controller | 
 |  |  |  * | 
 |  |  |  * @author ruoyi | 
 |  |  |  * @date 2021-12-14 | 
 |  |  |  */ | 
 |  |  | @Validated | 
 |  |  | @Api(value = "厂商控制器", tags = {"厂商管理"}) | 
 |  |  | @RequiredArgsConstructor(onConstructor_ = @Autowired) | 
 |  |  | @RestController | 
 |  |  | @RequestMapping("/oa/manufacturer") | 
 |  |  | public class DevManufacturerController extends BaseController { | 
 |  |  |  | 
 |  |  |     private final IDevManufacturerService iDevManufacturerService; | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 查询厂商列表 | 
 |  |  |      */ | 
 |  |  |     @ApiOperation("查询厂商列表") | 
 |  |  |     @PreAuthorize("@ss.hasPermi('oa:manufacturer:list')") | 
 |  |  |     @GetMapping("/list") | 
 |  |  |     public TableDataInfo<DevManufacturerVo> list(@Validated(QueryGroup.class) DevManufacturerBo bo) { | 
 |  |  |         return iDevManufacturerService.queryPageList(bo); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 厂商下拉列表 | 
 |  |  |      */ | 
 |  |  |     @ApiOperation("查询厂商列表") | 
 |  |  |     @GetMapping("/findList") | 
 |  |  |     public AjaxResult findList() { | 
 |  |  |         return AjaxResult.success(iDevManufacturerService.list()); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 导出厂商列表 | 
 |  |  |      */ | 
 |  |  |     @ApiOperation("导出厂商列表") | 
 |  |  |     @PreAuthorize("@ss.hasPermi('oa:manufacturer:export')") | 
 |  |  |     @Log(title = "厂商", businessType = BusinessType.EXPORT) | 
 |  |  |     @GetMapping("/export") | 
 |  |  |     public void export(@Validated DevManufacturerBo bo, HttpServletResponse response) { | 
 |  |  |         List<DevManufacturerVo> list = iDevManufacturerService.queryList(bo); | 
 |  |  |         ExcelUtil.exportExcel(list, "厂商", DevManufacturerVo.class, response); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 获取厂商详细信息 | 
 |  |  |      */ | 
 |  |  |     @ApiOperation("获取厂商详细信息") | 
 |  |  |     @PreAuthorize("@ss.hasPermi('oa:manufacturer:query')") | 
 |  |  |     @GetMapping("/{id}") | 
 |  |  |     public AjaxResult<DevManufacturerVo> getInfo(@ApiParam("主键") | 
 |  |  |                                                   @NotNull(message = "主键不能为空") | 
 |  |  |                                                   @PathVariable("id") Long id) { | 
 |  |  |         return AjaxResult.success(iDevManufacturerService.queryById(id)); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 新增厂商 | 
 |  |  |      */ | 
 |  |  |     @ApiOperation("新增厂商") | 
 |  |  |     @PreAuthorize("@ss.hasPermi('oa:manufacturer:add')") | 
 |  |  |     @Log(title = "厂商", businessType = BusinessType.INSERT) | 
 |  |  |     @RepeatSubmit() | 
 |  |  |     @PostMapping() | 
 |  |  |     public AjaxResult<Void> add(@Validated(AddGroup.class) @RequestBody DevManufacturerBo bo) { | 
 |  |  |         return toAjax(iDevManufacturerService.insertByBo(bo) ? 1 : 0); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 修改厂商 | 
 |  |  |      */ | 
 |  |  |     @ApiOperation("修改厂商") | 
 |  |  |     @PreAuthorize("@ss.hasPermi('oa:manufacturer:edit')") | 
 |  |  |     @Log(title = "厂商", businessType = BusinessType.UPDATE) | 
 |  |  |     @RepeatSubmit() | 
 |  |  |     @PutMapping() | 
 |  |  |     public AjaxResult<Void> edit(@Validated(EditGroup.class) @RequestBody DevManufacturerBo bo) { | 
 |  |  |         return toAjax(iDevManufacturerService.updateByBo(bo) ? 1 : 0); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 删除厂商 | 
 |  |  |      */ | 
 |  |  |     @ApiOperation("删除厂商") | 
 |  |  |     @PreAuthorize("@ss.hasPermi('oa:manufacturer:remove')") | 
 |  |  |     @Log(title = "厂商" , businessType = BusinessType.DELETE) | 
 |  |  |     @DeleteMapping("/{ids}") | 
 |  |  |     public AjaxResult<Void> remove(@ApiParam("主键串") | 
 |  |  |                                        @NotEmpty(message = "主键不能为空") | 
 |  |  |                                        @PathVariable Long[] ids) { | 
 |  |  |         return toAjax(iDevManufacturerService.deleteWithValidByIds(Arrays.asList(ids), true) ? 1 : 0); | 
 |  |  |     } | 
 |  |  | } | 
 
 |  |  | 
 |  |  | import java.util.Arrays; | 
 |  |  | import java.util.concurrent.TimeUnit; | 
 |  |  |  | 
 |  |  | import com.ruoyi.common.annotation.DataDictClass; | 
 |  |  | import lombok.RequiredArgsConstructor; | 
 |  |  | import javax.servlet.http.HttpServletResponse; | 
 |  |  | import javax.validation.constraints.*; | 
 |  |  | 
 |  |  |      * 查询外设单元列表 | 
 |  |  |      */ | 
 |  |  |     @ApiOperation("查询外设单元列表") | 
 |  |  |     @DataDictClass | 
 |  |  |     @PreAuthorize("@ss.hasPermi('oa:peripheralUnit:list')") | 
 |  |  |     @GetMapping("/list") | 
 |  |  |     public TableDataInfo<DevPeripheralUnitVo> list(@Validated(QueryGroup.class) DevPeripheralUnitBo bo) { | 
 
 |  |  | 
 |  |  |   servlet: | 
 |  |  |     multipart: | 
 |  |  |       # 单个文件大小 | 
 |  |  |       max-file-size: 10MB | 
 |  |  |       max-file-size: 50MB | 
 |  |  |       # 设置总上传的文件大小 | 
 |  |  |       max-request-size: 20MB | 
 |  |  |       max-request-size: 50MB | 
 |  |  |   # 服务模块 | 
 |  |  |   devtools: | 
 |  |  |     restart: | 
 
 |  |  | 
 |  |  |     @ApiModelProperty(value = "唯一标识") | 
 |  |  |     private String uuid = ""; | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 登录端(SYS:pc系统,DEVICE:设备端) | 
 |  |  |      */ | 
 |  |  |     @ApiModelProperty(value = "登录端(SYS:pc系统,DEVICE:设备端)") | 
 |  |  |     private String flag = "SYS"; | 
 |  |  |  | 
 |  |  | } | 
 
 |  |  | 
 |  |  |     RESET, | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 推出 | 
 |  |  |      * 退出 | 
 |  |  |      */ | 
 |  |  |     SIGN_OUT | 
 |  |  | } | 
 
 |  |  | 
 |  |  | package com.ruoyi.oa.domain; | 
 |  |  |  | 
 |  |  | import com.baomidou.mybatisplus.annotation.*; | 
 |  |  | import com.ruoyi.common.annotation.Dict; | 
 |  |  | import lombok.Data; | 
 |  |  | import lombok.NoArgsConstructor; | 
 |  |  | import lombok.experimental.Accessors; | 
 |  |  | 
 |  |  |     /** | 
 |  |  |      * 学校id | 
 |  |  |      */ | 
 |  |  |     @Dict(dictTable = "bs_school", dicCode = "id", dicText = "code") | 
 |  |  |     private Long schoolId; | 
 |  |  |     /** | 
 |  |  |      * 主机ID | 
 
 |  |  | 
 |  |  |      */ | 
 |  |  |     @TableId(value = "id") | 
 |  |  |     private Long id; | 
 |  |  |     /** | 
 |  |  |      * 硬件设备序列码 | 
 |  |  |      */ | 
 |  |  |     private String sequenceCode; | 
 |  |  |  | 
 |  |  |     private Date createTime; | 
 |  |  |  | 
 |  |  | } | 
 
| New file | 
 |  |  | 
 |  |  | package com.ruoyi.oa.domain; | 
 |  |  |  | 
 |  |  | import com.baomidou.mybatisplus.annotation.*; | 
 |  |  | import lombok.Data; | 
 |  |  | import lombok.NoArgsConstructor; | 
 |  |  | import lombok.experimental.Accessors; | 
 |  |  | import java.io.Serializable; | 
 |  |  | import java.util.Date; | 
 |  |  | import java.math.BigDecimal; | 
 |  |  |  | 
 |  |  | import com.ruoyi.common.core.domain.BaseEntity; | 
 |  |  |  | 
 |  |  | /** | 
 |  |  |  * 厂商对象 dev_manufacturer | 
 |  |  |  * | 
 |  |  |  * @author ruoyi | 
 |  |  |  * @date 2021-12-14 | 
 |  |  |  */ | 
 |  |  | @Data | 
 |  |  | @Accessors(chain = true) | 
 |  |  | @TableName("dev_manufacturer") | 
 |  |  | public class DevManufacturer extends BaseEntity { | 
 |  |  |  | 
 |  |  |     private static final long serialVersionUID=1L; | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 厂商主键 | 
 |  |  |      */ | 
 |  |  |     @TableId(value = "id") | 
 |  |  |     private Long id; | 
 |  |  |     /** | 
 |  |  |      * 厂商名称 | 
 |  |  |      */ | 
 |  |  |     private String name; | 
 |  |  |     /** | 
 |  |  |      * 厂商代码 | 
 |  |  |      */ | 
 |  |  |     private String code; | 
 |  |  |     /** | 
 |  |  |      * 联系方式 | 
 |  |  |      */ | 
 |  |  |     private String phone; | 
 |  |  |     /** | 
 |  |  |      * 邮箱 | 
 |  |  |      */ | 
 |  |  |     private String mailbox; | 
 |  |  |     /** | 
 |  |  |      * 联系地址 | 
 |  |  |      */ | 
 |  |  |     private String contactAddress; | 
 |  |  |     /** | 
 |  |  |      *  | 
 |  |  |      */ | 
 |  |  |     @Version | 
 |  |  |     private Integer version; | 
 |  |  |  | 
 |  |  | } | 
 
 |  |  | 
 |  |  | package com.ruoyi.oa.domain; | 
 |  |  |  | 
 |  |  | import com.baomidou.mybatisplus.annotation.*; | 
 |  |  | import com.ruoyi.common.annotation.Dict; | 
 |  |  | import lombok.Data; | 
 |  |  | import lombok.NoArgsConstructor; | 
 |  |  | import lombok.experimental.Accessors; | 
 |  |  | 
 |  |  |     /** | 
 |  |  |      * 生产厂商 | 
 |  |  |      */ | 
 |  |  |     @Dict(dictTable = "dev_manufacturer", dicCode = "id", dicText = "name") | 
 |  |  |     private String manufacturer; | 
 |  |  |     /** | 
 |  |  |      * 厂商代码 | 
 |  |  |      */ | 
 |  |  |     @Dict(dictTable = "dev_manufacturer", dicCode = "id", dicText = "code") | 
 |  |  |     private String vendorCode; | 
 |  |  |     /** | 
 |  |  |      * 波特率 | 
 
 |  |  | 
 |  |  |      * 序列号 | 
 |  |  |      */ | 
 |  |  |     @ApiModelProperty(value = "序列号", required = true) | 
 |  |  |     @NotNull(message = "序列号不能为空", groups = { AddGroup.class, EditGroup.class }) | 
 |  |  |     private Long serialNumber; | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 设备类型 | 
 |  |  |      */ | 
 |  |  |     @ApiModelProperty(value = "设备类型", required = true) | 
 |  |  |     @NotNull(message = "设备类型不能为空", groups = { AddGroup.class, EditGroup.class }) | 
 |  |  |     private String type; | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 序列码 | 
 |  |  |      */ | 
 |  |  |     @ApiModelProperty(value = "序列码", required = true) | 
 |  |  |     @NotNull(message = "序列码不能为空", groups = { AddGroup.class, EditGroup.class }) | 
 |  |  |     private String sequenceCode; | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 版本 | 
 |  |  |      */ | 
 |  |  |     @ApiModelProperty(value = "版本", required = true) | 
 |  |  |     @NotNull(message = "版本不能为空", groups = { AddGroup.class, EditGroup.class }) | 
 |  |  |     private String edition; | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 学校id | 
 |  |  |      */ | 
 |  |  |     @ApiModelProperty(value = "学校id", required = true) | 
 |  |  |     @NotNull(message = "学校id不能为空", groups = { AddGroup.class, EditGroup.class }) | 
 |  |  |     private Long schoolId; | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 主机ID | 
 |  |  |      */ | 
 |  |  |     @ApiModelProperty(value = "主机ID", required = true) | 
 |  |  |     @NotNull(message = "主机ID不能为空", groups = { AddGroup.class, EditGroup.class }) | 
 |  |  |     private String hostId; | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * β网络ID | 
 |  |  |      */ | 
 |  |  |     @ApiModelProperty(value = "β网络ID", required = true) | 
 |  |  |     @NotNull(message = "β网络ID不能为空", groups = { AddGroup.class, EditGroup.class }) | 
 |  |  |     private String networkId; | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * β工作频段 | 
 |  |  |      */ | 
 |  |  |     @ApiModelProperty(value = "β工作频段", required = true) | 
 |  |  |     @NotNull(message = "β工作频段不能为空", groups = { AddGroup.class, EditGroup.class }) | 
 |  |  |     private String frequencyBand; | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 生产批次 | 
 |  |  |      */ | 
 |  |  |     @ApiModelProperty(value = "生产批次", required = true) | 
 |  |  |     @NotNull(message = "生产批次不能为空", groups = { AddGroup.class, EditGroup.class }) | 
 |  |  |     private Long batchId; | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 在用状态 | 
 |  |  |      */ | 
 |  |  |     @ApiModelProperty(value = "在用状态", required = true) | 
 |  |  |     @NotNull(message = "在用状态不能为空", groups = { AddGroup.class, EditGroup.class }) | 
 |  |  |     private String useStatus; | 
 |  |  |  | 
 |  |  |     /** | 
 
| New file | 
 |  |  | 
 |  |  | package com.ruoyi.oa.domain.bo; | 
 |  |  |  | 
 |  |  | import com.ruoyi.common.core.validate.AddGroup; | 
 |  |  | import com.ruoyi.common.core.validate.EditGroup; | 
 |  |  | import io.swagger.annotations.ApiModel; | 
 |  |  | import io.swagger.annotations.ApiModelProperty; | 
 |  |  | import lombok.Data; | 
 |  |  | import lombok.EqualsAndHashCode; | 
 |  |  | import javax.validation.constraints.*; | 
 |  |  |  | 
 |  |  | import java.util.Date; | 
 |  |  |  | 
 |  |  | import com.ruoyi.common.core.domain.BaseEntity; | 
 |  |  |  | 
 |  |  | /** | 
 |  |  |  * 厂商业务对象 dev_manufacturer | 
 |  |  |  * | 
 |  |  |  * @author ruoyi | 
 |  |  |  * @date 2021-12-14 | 
 |  |  |  */ | 
 |  |  |  | 
 |  |  | @Data | 
 |  |  | @EqualsAndHashCode(callSuper = true) | 
 |  |  | @ApiModel("厂商业务对象") | 
 |  |  | public class DevManufacturerBo extends BaseEntity { | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 厂商主键 | 
 |  |  |      */ | 
 |  |  |     @ApiModelProperty(value = "厂商主键", required = true) | 
 |  |  |     @NotNull(message = "厂商主键不能为空", groups = { EditGroup.class }) | 
 |  |  |     private Long id; | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 厂商名称 | 
 |  |  |      */ | 
 |  |  |     @ApiModelProperty(value = "厂商名称", required = true) | 
 |  |  |     @NotBlank(message = "厂商名称不能为空", groups = { AddGroup.class, EditGroup.class }) | 
 |  |  |     private String name; | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 厂商代码 | 
 |  |  |      */ | 
 |  |  |     @ApiModelProperty(value = "厂商代码", required = true) | 
 |  |  |     @NotBlank(message = "厂商代码不能为空", groups = { AddGroup.class, EditGroup.class }) | 
 |  |  |     private String code; | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 联系方式 | 
 |  |  |      */ | 
 |  |  |     @ApiModelProperty(value = "联系方式", required = true) | 
 |  |  |     @NotBlank(message = "联系方式不能为空", groups = { AddGroup.class, EditGroup.class }) | 
 |  |  |     private String phone; | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 邮箱 | 
 |  |  |      */ | 
 |  |  |     @ApiModelProperty(value = "邮箱") | 
 |  |  |     private String mailbox; | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 联系地址 | 
 |  |  |      */ | 
 |  |  |     @ApiModelProperty(value = "联系地址") | 
 |  |  |     private String contactAddress; | 
 |  |  |  | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 分页大小 | 
 |  |  |      */ | 
 |  |  |     @ApiModelProperty("分页大小") | 
 |  |  |     private Integer pageSize; | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 当前页数 | 
 |  |  |      */ | 
 |  |  |     @ApiModelProperty("当前页数") | 
 |  |  |     private Integer pageNum; | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 排序列 | 
 |  |  |      */ | 
 |  |  |     @ApiModelProperty("排序列") | 
 |  |  |     private String orderByColumn; | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 排序的方向desc或者asc | 
 |  |  |      */ | 
 |  |  |     @ApiModelProperty(value = "排序的方向", example = "asc,desc") | 
 |  |  |     private String isAsc; | 
 |  |  |  | 
 |  |  | } | 
 
 |  |  | 
 |  |  |      * 厂商代码 | 
 |  |  |      */ | 
 |  |  |     @ApiModelProperty(value = "厂商代码", required = true) | 
 |  |  |     @NotBlank(message = "厂商代码不能为空", groups = { AddGroup.class, EditGroup.class }) | 
 |  |  |     private String vendorCode; | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  | 
 |  |  |      * 附件 | 
 |  |  |      */ | 
 |  |  |     @ApiModelProperty(value = "附件", required = true) | 
 |  |  |     @NotBlank(message = "附件不能为空", groups = { AddGroup.class, EditGroup.class }) | 
 |  |  |     private String filePath; | 
 |  |  |  | 
 |  |  |  | 
 
 |  |  | 
 |  |  | import com.fasterxml.jackson.annotation.JsonFormat; | 
 |  |  | import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; | 
 |  |  | import com.alibaba.excel.annotation.ExcelProperty; | 
 |  |  | import com.ruoyi.common.annotation.Dict; | 
 |  |  | import com.ruoyi.common.annotation.ExcelDictFormat; | 
 |  |  | import com.ruoyi.common.convert.ExcelDictConvert; | 
 |  |  | import io.swagger.annotations.ApiModel; | 
 |  |  | 
 |  |  |     private static final long serialVersionUID = 1L; | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      *  | 
 |  |  |      * | 
 |  |  |      */ | 
 |  |  |     @ExcelProperty(value = "") | 
 |  |  |     @ApiModelProperty("") | 
 |  |  | 
 |  |  |      */ | 
 |  |  |     @ExcelProperty(value = "操作行为") | 
 |  |  |     @ApiModelProperty("操作行为") | 
 |  |  |     @Dict(dicCode = "DICT108") | 
 |  |  |     private String operation; | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  | 
 |  |  |     private String loginLocation; | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      *  | 
 |  |  |      * | 
 |  |  |      */ | 
 |  |  |     @ExcelProperty(value = "") | 
 |  |  |     @ApiModelProperty("") | 
 
| New file | 
 |  |  | 
 |  |  | package com.ruoyi.oa.domain.vo; | 
 |  |  |  | 
 |  |  | import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; | 
 |  |  | import com.alibaba.excel.annotation.ExcelProperty; | 
 |  |  | import com.ruoyi.common.annotation.ExcelDictFormat; | 
 |  |  | import com.ruoyi.common.convert.ExcelDictConvert; | 
 |  |  | import io.swagger.annotations.ApiModel; | 
 |  |  | import io.swagger.annotations.ApiModelProperty; | 
 |  |  | import lombok.Data; | 
 |  |  | import java.util.Date; | 
 |  |  |  | 
 |  |  |  | 
 |  |  |  | 
 |  |  | /** | 
 |  |  |  * 厂商视图对象 dev_manufacturer | 
 |  |  |  * | 
 |  |  |  * @author ruoyi | 
 |  |  |  * @date 2021-12-14 | 
 |  |  |  */ | 
 |  |  | @Data | 
 |  |  | @ApiModel("厂商视图对象") | 
 |  |  | @ExcelIgnoreUnannotated | 
 |  |  | public class DevManufacturerVo { | 
 |  |  |  | 
 |  |  |     private static final long serialVersionUID = 1L; | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 厂商主键 | 
 |  |  |      */ | 
 |  |  |     @ExcelProperty(value = "厂商主键") | 
 |  |  |     @ApiModelProperty("厂商主键") | 
 |  |  |     private Long id; | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 厂商名称 | 
 |  |  |      */ | 
 |  |  |     @ExcelProperty(value = "厂商名称") | 
 |  |  |     @ApiModelProperty("厂商名称") | 
 |  |  |     private String name; | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 厂商代码 | 
 |  |  |      */ | 
 |  |  |     @ExcelProperty(value = "厂商代码") | 
 |  |  |     @ApiModelProperty("厂商代码") | 
 |  |  |     private String code; | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 联系方式 | 
 |  |  |      */ | 
 |  |  |     @ExcelProperty(value = "联系方式") | 
 |  |  |     @ApiModelProperty("联系方式") | 
 |  |  |     private String phone; | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 邮箱 | 
 |  |  |      */ | 
 |  |  |     @ExcelProperty(value = "邮箱") | 
 |  |  |     @ApiModelProperty("邮箱") | 
 |  |  |     private String mailbox; | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 联系地址 | 
 |  |  |      */ | 
 |  |  |     @ExcelProperty(value = "联系地址") | 
 |  |  |     @ApiModelProperty("联系地址") | 
 |  |  |     private String contactAddress; | 
 |  |  |  | 
 |  |  |  | 
 |  |  | } | 
 
 |  |  | 
 |  |  |  | 
 |  |  | import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; | 
 |  |  | import com.alibaba.excel.annotation.ExcelProperty; | 
 |  |  | import com.ruoyi.common.annotation.Dict; | 
 |  |  | import com.ruoyi.common.annotation.ExcelDictFormat; | 
 |  |  | import com.ruoyi.common.convert.ExcelDictConvert; | 
 |  |  | import io.swagger.annotations.ApiModel; | 
 |  |  | 
 |  |  |      */ | 
 |  |  |     @ExcelProperty(value = "生产厂商") | 
 |  |  |     @ApiModelProperty("生产厂商") | 
 |  |  |     @Dict(dictTable = "dev_manufacturer", dicCode = "id", dicText = "name") | 
 |  |  |     private String manufacturer; | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  | 
 |  |  |      */ | 
 |  |  |     @ExcelProperty(value = "厂商代码") | 
 |  |  |     @ApiModelProperty("厂商代码") | 
 |  |  |     @Dict(dictTable = "dev_manufacturer", dicCode = "id", dicText = "code") | 
 |  |  |     private String vendorCode; | 
 |  |  |  | 
 |  |  |     /** | 
 
| New file | 
 |  |  | 
 |  |  | package com.ruoyi.oa.mapper; | 
 |  |  |  | 
 |  |  | import com.ruoyi.oa.domain.DevManufacturer; | 
 |  |  | import com.ruoyi.common.core.mybatisplus.core.BaseMapperPlus; | 
 |  |  |  | 
 |  |  | /** | 
 |  |  |  * 厂商Mapper接口 | 
 |  |  |  * | 
 |  |  |  * @author ruoyi | 
 |  |  |  * @date 2021-12-14 | 
 |  |  |  */ | 
 |  |  | public interface DevManufacturerMapper extends BaseMapperPlus<DevManufacturer> { | 
 |  |  |  | 
 |  |  | } | 
 
 |  |  | 
 |  |  |     DevEquipment externalAdd(DevEquipmentBo bo); | 
 |  |  |  | 
 |  |  |     DevEquipment equipmentEdit(DevEquipmentBo bo); | 
 |  |  |  | 
 |  |  |     void submitComment(DevEquipmentBo bo); | 
 |  |  | } | 
 
| New file | 
 |  |  | 
 |  |  | package com.ruoyi.oa.service; | 
 |  |  |  | 
 |  |  | import com.ruoyi.oa.domain.DevManufacturer; | 
 |  |  | import com.ruoyi.oa.domain.vo.DevManufacturerVo; | 
 |  |  | import com.ruoyi.oa.domain.bo.DevManufacturerBo; | 
 |  |  | import com.ruoyi.common.core.mybatisplus.core.IServicePlus; | 
 |  |  | import com.ruoyi.common.core.page.TableDataInfo; | 
 |  |  |  | 
 |  |  | import java.util.Collection; | 
 |  |  | import java.util.List; | 
 |  |  |  | 
 |  |  | /** | 
 |  |  |  * 厂商Service接口 | 
 |  |  |  * | 
 |  |  |  * @author ruoyi | 
 |  |  |  * @date 2021-12-14 | 
 |  |  |  */ | 
 |  |  | public interface IDevManufacturerService extends IServicePlus<DevManufacturer, DevManufacturerVo> { | 
 |  |  |     /** | 
 |  |  |      * 查询单个 | 
 |  |  |      * @return | 
 |  |  |      */ | 
 |  |  |     DevManufacturerVo queryById(Long id); | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 查询列表 | 
 |  |  |      */ | 
 |  |  |     TableDataInfo<DevManufacturerVo> queryPageList(DevManufacturerBo bo); | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 查询列表 | 
 |  |  |      */ | 
 |  |  |     List<DevManufacturerVo> queryList(DevManufacturerBo bo); | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 根据新增业务对象插入厂商 | 
 |  |  |      * @param bo 厂商新增业务对象 | 
 |  |  |      * @return | 
 |  |  |      */ | 
 |  |  |     Boolean insertByBo(DevManufacturerBo bo); | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 根据编辑业务对象修改厂商 | 
 |  |  |      * @param bo 厂商编辑业务对象 | 
 |  |  |      * @return | 
 |  |  |      */ | 
 |  |  |     Boolean updateByBo(DevManufacturerBo bo); | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 校验并删除数据 | 
 |  |  |      * @param ids 主键集合 | 
 |  |  |      * @param isValid 是否校验,true-删除前校验,false-不校验 | 
 |  |  |      * @return | 
 |  |  |      */ | 
 |  |  |     Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid); | 
 |  |  | } | 
 
 |  |  | 
 |  |  |         LambdaQueryWrapper<DevEquipmentLog> lqw = Wrappers.lambdaQuery(); | 
 |  |  |         lqw.eq(StringUtils.isNotBlank(bo.getOperation()), DevEquipmentLog::getOperation, bo.getOperation()); | 
 |  |  |         lqw.like(StringUtils.isNotBlank(bo.getUserName()), DevEquipmentLog::getUserName, bo.getUserName()); | 
 |  |  |         lqw.like(StringUtils.isNotBlank(bo.getNickName()), DevEquipmentLog::getNickName, bo.getNickName()); | 
 |  |  |         lqw.eq(StringUtils.isNotBlank(bo.getIp()), DevEquipmentLog::getIp, bo.getIp()); | 
 |  |  |         lqw.eq(StringUtils.isNotBlank(bo.getLoginLocation()), DevEquipmentLog::getLoginLocation, bo.getLoginLocation()); | 
 |  |  |         lqw.like(StringUtils.isNotBlank(bo.getIp()), DevEquipmentLog::getIp, bo.getIp()); | 
 |  |  |         lqw.like(StringUtils.isNotBlank(bo.getLoginLocation()), DevEquipmentLog::getLoginLocation, bo.getLoginLocation()); | 
 |  |  |         lqw.eq(StringUtils.isNotBlank(bo.getStatus()), DevEquipmentLog::getStatus, bo.getStatus()); | 
 |  |  |         lqw.eq(bo.getLoginTime() != null, DevEquipmentLog::getLoginTime, bo.getLoginTime()); | 
 |  |  |         lqw.orderByDesc(DevEquipmentLog::getLoginTime); | 
 |  |  |         return lqw; | 
 |  |  |     } | 
 |  |  |  | 
 
 |  |  | 
 |  |  | import cn.hutool.http.HttpStatus; | 
 |  |  | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | 
 |  |  | import com.ruoyi.common.exception.ServiceException; | 
 |  |  | import com.ruoyi.common.utils.DateUtils; | 
 |  |  | import com.ruoyi.common.utils.StringUtils; | 
 |  |  | import com.ruoyi.common.utils.PageUtils; | 
 |  |  | import com.ruoyi.common.core.page.PagePlus; | 
 |  |  | 
 |  |  |         DevEquipment po = baseMapper.selectOne(new QueryWrapper<DevEquipment>().lambda() | 
 |  |  |             .eq(DevEquipment::getSequenceCode, bo.getSequenceCode())); | 
 |  |  |         // 设备存在,直接返回设备信息 | 
 |  |  |         if (StringUtils.isEmpty(po)) { | 
 |  |  |         if (StringUtils.isNotEmpty(po)) { | 
 |  |  |             return po; | 
 |  |  |         } | 
 |  |  |         // 设备不存在则新建 | 
 |  |  |         else { | 
 |  |  |             // 先根据序列码生成序列号 | 
 |  |  |             DevEquipmentCode c = new DevEquipmentCode(); | 
 |  |  |             c.setSequenceCode(bo.getSequenceCode()); | 
 |  |  |             c.setCreateTime(DateUtils.getNowDate()); | 
 |  |  |             devEquipmentCodeMapper.insert(c); | 
 |  |  |             // 添加设备 | 
 |  |  |             DevEquipment add = BeanUtil.toBean(bo, DevEquipment.class); | 
 |  |  | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     @Override | 
 |  |  |     @Transactional(rollbackFor = Exception.class) | 
 |  |  |     public DevEquipment equipmentEdit(DevEquipmentBo bo) { | 
 |  |  |         DevEquipment po = baseMapper.selectById(bo.getId()); | 
 |  |  |         if (po == null) { | 
 |  |  |             throw new ServiceException("没有设备信息", HttpStatus.HTTP_PARTIAL); | 
 |  |  |         } | 
 |  |  |         if (null != bo.getSchoolId()) { | 
 |  |  |             po.setSchoolId(bo.getSchoolId()); | 
 |  |  |         } | 
 |  |  |         if (StringUtils.isEmpty(bo.getHostId())) { | 
 |  |  |         if (StringUtils.isNotBlank(bo.getHostId())) { | 
 |  |  |             po.setHostId(bo.getHostId()); | 
 |  |  |         } | 
 |  |  |         if (StringUtils.isEmpty(bo.getNetworkId())) { | 
 |  |  |             po.setNetworkId(bo.getNetworkId()); | 
 |  |  |         } | 
 |  |  |         if (StringUtils.isEmpty(bo.getFrequencyBand())) { | 
 |  |  |             po.setFrequencyBand(bo.getFrequencyBand()); | 
 |  |  | //        if (StringUtils.isEmpty(bo.getNetworkId())) { | 
 |  |  | //            po.setNetworkId(bo.getNetworkId()); | 
 |  |  | //        } | 
 |  |  | //        if (StringUtils.isEmpty(bo.getFrequencyBand())) { | 
 |  |  | //            po.setFrequencyBand(bo.getFrequencyBand()); | 
 |  |  | //        } | 
 |  |  | //        if (null != bo.getBatchId()) { | 
 |  |  | //            po.setBatchId(bo.getBatchId()); | 
 |  |  | //        } | 
 |  |  | //        if (StringUtils.isEmpty(bo.getRemarks())) { | 
 |  |  | //            po.setRemarks(bo.getRemarks()); | 
 |  |  | //        } | 
 |  |  |         baseMapper.updateById(po); | 
 |  |  |         return po; | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     @Override | 
 |  |  |     @Transactional(rollbackFor = Exception.class) | 
 |  |  |     public void submitComment(DevEquipmentBo bo) { | 
 |  |  |         DevEquipment po = baseMapper.selectById(bo.getId()); | 
 |  |  |         if (po == null) { | 
 |  |  |             throw new ServiceException("没有设备信息", HttpStatus.HTTP_PARTIAL); | 
 |  |  |         } | 
 |  |  |         if (null != bo.getBatchId()) { | 
 |  |  |             po.setBatchId(bo.getBatchId()); | 
 |  |  |         } | 
 |  |  |         if (StringUtils.isEmpty(bo.getRemarks())) { | 
 |  |  |         if (StringUtils.isNotBlank(bo.getRemarks())) { | 
 |  |  |             po.setRemarks(bo.getRemarks()); | 
 |  |  |         } | 
 |  |  |         baseMapper.updateById(po); | 
 |  |  |         return po; | 
 |  |  |     } | 
 |  |  | } | 
 
| New file | 
 |  |  | 
 |  |  | package com.ruoyi.oa.service.impl; | 
 |  |  |  | 
 |  |  | import cn.hutool.core.bean.BeanUtil; | 
 |  |  | import cn.hutool.http.HttpStatus; | 
 |  |  | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | 
 |  |  | import com.ruoyi.common.exception.ServiceException; | 
 |  |  | import com.ruoyi.common.utils.StringUtils; | 
 |  |  | import com.ruoyi.common.utils.PageUtils; | 
 |  |  | import com.ruoyi.common.core.page.PagePlus; | 
 |  |  | import com.ruoyi.common.core.page.TableDataInfo; | 
 |  |  | import org.springframework.stereotype.Service; | 
 |  |  | import com.ruoyi.common.core.mybatisplus.core.ServicePlusImpl; | 
 |  |  | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | 
 |  |  | import com.baomidou.mybatisplus.core.toolkit.Wrappers; | 
 |  |  | import com.ruoyi.oa.domain.bo.DevManufacturerBo; | 
 |  |  | import com.ruoyi.oa.domain.vo.DevManufacturerVo; | 
 |  |  | import com.ruoyi.oa.domain.DevManufacturer; | 
 |  |  | import com.ruoyi.oa.mapper.DevManufacturerMapper; | 
 |  |  | import com.ruoyi.oa.service.IDevManufacturerService; | 
 |  |  |  | 
 |  |  | import java.util.List; | 
 |  |  | import java.util.Map; | 
 |  |  | import java.util.Collection; | 
 |  |  |  | 
 |  |  | /** | 
 |  |  |  * 厂商Service业务层处理 | 
 |  |  |  * | 
 |  |  |  * @author ruoyi | 
 |  |  |  * @date 2021-12-14 | 
 |  |  |  */ | 
 |  |  | @Service | 
 |  |  | public class DevManufacturerServiceImpl extends ServicePlusImpl<DevManufacturerMapper, DevManufacturer, DevManufacturerVo> implements IDevManufacturerService { | 
 |  |  |  | 
 |  |  |     @Override | 
 |  |  |     public DevManufacturerVo queryById(Long id) { | 
 |  |  |         return getVoById(id); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     @Override | 
 |  |  |     public TableDataInfo<DevManufacturerVo> queryPageList(DevManufacturerBo bo) { | 
 |  |  |         PagePlus<DevManufacturer, DevManufacturerVo> result = pageVo(PageUtils.buildPagePlus(), buildQueryWrapper(bo)); | 
 |  |  |         return PageUtils.buildDataInfo(result); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     @Override | 
 |  |  |     public List<DevManufacturerVo> queryList(DevManufacturerBo bo) { | 
 |  |  |         return listVo(buildQueryWrapper(bo)); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     private LambdaQueryWrapper<DevManufacturer> buildQueryWrapper(DevManufacturerBo bo) { | 
 |  |  |         Map<String, Object> params = bo.getParams(); | 
 |  |  |         LambdaQueryWrapper<DevManufacturer> lqw = Wrappers.lambdaQuery(); | 
 |  |  |         lqw.like(StringUtils.isNotBlank(bo.getName()), DevManufacturer::getName, bo.getName()); | 
 |  |  |         lqw.like(StringUtils.isNotBlank(bo.getCode()), DevManufacturer::getCode, bo.getCode()); | 
 |  |  |         lqw.like(StringUtils.isNotBlank(bo.getPhone()), DevManufacturer::getPhone, bo.getPhone()); | 
 |  |  |         lqw.like(StringUtils.isNotBlank(bo.getMailbox()), DevManufacturer::getMailbox, bo.getMailbox()); | 
 |  |  |         lqw.like(StringUtils.isNotBlank(bo.getContactAddress()), DevManufacturer::getContactAddress, bo.getContactAddress()); | 
 |  |  |         return lqw; | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     @Override | 
 |  |  |     public Boolean insertByBo(DevManufacturerBo bo) { | 
 |  |  |         List<DevManufacturer> list = baseMapper.selectList(new QueryWrapper<DevManufacturer>().lambda() | 
 |  |  |             .eq(DevManufacturer::getCode, bo.getCode())); | 
 |  |  |         if (list.size() > 0) { | 
 |  |  |             throw new ServiceException("厂商代码重复", HttpStatus.HTTP_PARTIAL); | 
 |  |  |         } | 
 |  |  |         DevManufacturer add = BeanUtil.toBean(bo, DevManufacturer.class); | 
 |  |  |         validEntityBeforeSave(add); | 
 |  |  |         boolean flag = save(add); | 
 |  |  |         if (flag) { | 
 |  |  |             bo.setId(add.getId()); | 
 |  |  |         } | 
 |  |  |         return flag; | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     @Override | 
 |  |  |     public Boolean updateByBo(DevManufacturerBo bo) { | 
 |  |  |         List<DevManufacturer> list = baseMapper.selectList(new QueryWrapper<DevManufacturer>().lambda() | 
 |  |  |             .eq(DevManufacturer::getCode, bo.getCode()).ne(DevManufacturer::getId, bo.getId())); | 
 |  |  |         if (list.size() > 0) { | 
 |  |  |             throw new ServiceException("厂商代码重复", HttpStatus.HTTP_PARTIAL); | 
 |  |  |         } | 
 |  |  |         DevManufacturer update = BeanUtil.toBean(bo, DevManufacturer.class); | 
 |  |  |         validEntityBeforeSave(update); | 
 |  |  |         return updateById(update); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 保存前的数据校验 | 
 |  |  |      * | 
 |  |  |      * @param entity 实体类数据 | 
 |  |  |      */ | 
 |  |  |     private void validEntityBeforeSave(DevManufacturer entity) { | 
 |  |  |         //TODO 做一些数据校验,如唯一约束 | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     @Override | 
 |  |  |     public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) { | 
 |  |  |         if (isValid) { | 
 |  |  |             //TODO 做一些业务上的校验,判断是否需要校验 | 
 |  |  |         } | 
 |  |  |         return removeByIds(ids); | 
 |  |  |     } | 
 |  |  | } | 
 
 |  |  | 
 |  |  |             throw new ServiceException("厂商代码重复", HttpStatus.HTTP_PARTIAL); | 
 |  |  |         } | 
 |  |  |         DevPeripheralUnit add = BeanUtil.toBean(bo, DevPeripheralUnit.class); | 
 |  |  |         add.setVendorCode(add.getManufacturer()); | 
 |  |  |         validEntityBeforeSave(add); | 
 |  |  |         boolean flag = save(add); | 
 |  |  |         if (flag) { | 
 |  |  | 
 |  |  |     @Override | 
 |  |  |     public Boolean updateByBo(DevPeripheralUnitBo bo) { | 
 |  |  |         DevPeripheralUnit update = BeanUtil.toBean(bo, DevPeripheralUnit.class); | 
 |  |  |         update.setVendorCode(update.getManufacturer()); | 
 |  |  |         validEntityBeforeSave(update); | 
 |  |  |         return updateById(update); | 
 |  |  |     } | 
 
| New file | 
 |  |  | 
 |  |  | <?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.oa.mapper.DevManufacturerMapper"> | 
 |  |  |  | 
 |  |  |     <resultMap type="com.ruoyi.oa.domain.DevManufacturer" id="DevManufacturerResult"> | 
 |  |  |         <result property="id" column="id"/> | 
 |  |  |         <result property="name" column="name"/> | 
 |  |  |         <result property="code" column="code"/> | 
 |  |  |         <result property="phone" column="phone"/> | 
 |  |  |         <result property="mailbox" column="mailbox"/> | 
 |  |  |         <result property="contactAddress" column="contact_address"/> | 
 |  |  |         <result property="createBy" column="create_by"/> | 
 |  |  |         <result property="updateBy" column="update_by"/> | 
 |  |  |         <result property="createTime" column="create_time"/> | 
 |  |  |         <result property="updateTime" column="update_time"/> | 
 |  |  |         <result property="version" column="version"/> | 
 |  |  |     </resultMap> | 
 |  |  |  | 
 |  |  |  | 
 |  |  | </mapper> | 
 
 |  |  | 
 |  |  | import com.ruoyi.common.exception.user.CaptchaException; | 
 |  |  | import com.ruoyi.common.exception.user.CaptchaExpireException; | 
 |  |  | import com.ruoyi.common.exception.user.UserPasswordNotMatchException; | 
 |  |  | import com.ruoyi.common.utils.DateUtils; | 
 |  |  | import com.ruoyi.common.utils.MessageUtils; | 
 |  |  | import com.ruoyi.common.utils.RedisUtils; | 
 |  |  | import com.ruoyi.common.utils.ServletUtils; | 
 |  |  | import com.ruoyi.common.utils.*; | 
 |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
 |  |  | import org.springframework.security.authentication.AuthenticationManager; | 
 |  |  | import org.springframework.security.authentication.BadCredentialsException; | 
 |  |  | 
 |  |  |      */ | 
 |  |  |     public String login(String username, String password, String code, String uuid) { | 
 |  |  |         HttpServletRequest request = ServletUtils.getRequest(); | 
 |  |  |         // 用户类型(DEVICE:设备端,空:pc系统) | 
 |  |  |         String userType = request.getHeader("User-Type"); | 
 |  |  |         boolean captchaOnOff = configService.selectCaptchaOnOff(); | 
 |  |  |         // 验证码开关 | 
 |  |  |         if (captchaOnOff) { | 
 |  |  |         if (StringUtils.isEmpty(userType) && captchaOnOff) { | 
 |  |  |             validateCaptcha(username, code, uuid, request); | 
 |  |  |         } | 
 |  |  |         // 用户验证 | 
 
 |  |  | 
 |  |  |      * @return | 
 |  |  |      */ | 
 |  |  |     @Override | 
 |  |  |     @Cacheable(value = CacheConstant.SYS_DICT_CACHE, key = "#code+':'+#key") | 
 |  |  | //    @Cacheable(value = CacheConstant.SYS_DICT_CACHE, key = "#code+':'+#key") | 
 |  |  |     public String queryDictTextByKey(String code, String key) { | 
 |  |  |         System.out.println("无缓存dictText的时候调用这里!"); | 
 |  |  |         return baseMapper.queryDictTextByKey(code, key); | 
 |  |  | 
 |  |  |      * @return | 
 |  |  |      */ | 
 |  |  |     @Override | 
 |  |  |     @Cacheable(value = CacheConstant.SYS_DICT_TABLE_CACHE) | 
 |  |  | //    @Cacheable(value = CacheConstant.SYS_DICT_TABLE_CACHE) | 
 |  |  |     public String queryTableDictTextByKey(String table, String text, String code, String key) { | 
 |  |  |         System.out.println("无缓存dictTable的时候调用这里!"); | 
 |  |  |         return baseMapper.queryTableDictTextByKey(table, text, code, key); | 
 
 |  |  | 
 |  |  | import cn.hutool.http.useragent.UserAgentUtil; | 
 |  |  | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | 
 |  |  | import com.ruoyi.common.constant.Constants; | 
 |  |  | import com.ruoyi.common.core.domain.dto.EquipmentLogDTO; | 
 |  |  | import com.ruoyi.common.core.mybatisplus.core.ServicePlusImpl; | 
 |  |  | import com.ruoyi.common.core.page.TableDataInfo; | 
 |  |  | import com.ruoyi.common.core.service.EquipmentService; | 
 |  |  | import com.ruoyi.common.core.service.LogininforService; | 
 |  |  | import com.ruoyi.common.enums.BusinessStatus; | 
 |  |  | import com.ruoyi.common.enums.EquipmentLog; | 
 |  |  | import com.ruoyi.common.utils.DateUtils; | 
 |  |  | import com.ruoyi.common.utils.PageUtils; | 
 |  |  | import com.ruoyi.common.utils.ServletUtils; | 
 |  |  | import com.ruoyi.common.utils.StringUtils; | 
 |  |  | import com.ruoyi.common.utils.ip.AddressUtils; | 
 |  |  | import com.ruoyi.common.utils.spring.SpringUtils; | 
 |  |  | import com.ruoyi.system.domain.SysLogininfor; | 
 |  |  | import com.ruoyi.system.mapper.SysLogininforMapper; | 
 |  |  | import com.ruoyi.system.service.ISysLogininforService; | 
 |  |  | 
 |  |  |         s.append(getBlock(message)); | 
 |  |  |         // 打印信息到日志 | 
 |  |  |         log.info(s.toString(), args); | 
 |  |  |         // 获取客户端操作系统 | 
 |  |  |         String os = userAgent.getOs().getName(); | 
 |  |  |         // 获取客户端浏览器 | 
 |  |  |         String browser = userAgent.getBrowser().getName(); | 
 |  |  |         // 封装对象 | 
 |  |  |         SysLogininfor logininfor = new SysLogininfor(); | 
 |  |  |         logininfor.setUserName(username); | 
 |  |  |         logininfor.setIpaddr(ip); | 
 |  |  |         logininfor.setLoginLocation(address); | 
 |  |  |         logininfor.setBrowser(browser); | 
 |  |  |         logininfor.setOs(os); | 
 |  |  |         logininfor.setMsg(message); | 
 |  |  |         // 日志状态 | 
 |  |  |         if (StringUtils.equalsAny(status, Constants.LOGIN_SUCCESS, Constants.LOGOUT, Constants.REGISTER)) { | 
 |  |  |             logininfor.setStatus(Constants.SUCCESS); | 
 |  |  |         } else if (Constants.LOGIN_FAIL.equals(status)) { | 
 |  |  |             logininfor.setStatus(Constants.FAIL); | 
 |  |  |         // 用户类型(DEVICE:设备端,空:pc系统) | 
 |  |  |         String userType = request.getHeader("User-Type"); | 
 |  |  |         // pc系统 | 
 |  |  |         if (StringUtils.isEmpty(userType)) { | 
 |  |  |             // 获取客户端操作系统 | 
 |  |  |             String os = userAgent.getOs().getName(); | 
 |  |  |             // 获取客户端浏览器 | 
 |  |  |             String browser = userAgent.getBrowser().getName(); | 
 |  |  |             // 封装对象 | 
 |  |  |             SysLogininfor logininfor = new SysLogininfor(); | 
 |  |  |             logininfor.setUserName(username); | 
 |  |  |             logininfor.setIpaddr(ip); | 
 |  |  |             logininfor.setLoginLocation(address); | 
 |  |  |             logininfor.setBrowser(browser); | 
 |  |  |             logininfor.setOs(os); | 
 |  |  |             logininfor.setMsg(message); | 
 |  |  |             // 日志状态 | 
 |  |  |             if (StringUtils.equalsAny(status, Constants.LOGIN_SUCCESS, Constants.LOGOUT, Constants.REGISTER)) { | 
 |  |  |                 logininfor.setStatus(Constants.SUCCESS); | 
 |  |  |             } else if (Constants.LOGIN_FAIL.equals(status)) { | 
 |  |  |                 logininfor.setStatus(Constants.FAIL); | 
 |  |  |             } | 
 |  |  |             // 插入数据 | 
 |  |  |             insertLogininfor(logininfor); | 
 |  |  |         } | 
 |  |  |         // 插入数据 | 
 |  |  |         insertLogininfor(logininfor); | 
 |  |  |         // 设备端 | 
 |  |  |         if ("DEVICE".equals(userType)) { | 
 |  |  |             EquipmentLogDTO dto = new EquipmentLogDTO(); | 
 |  |  |             dto.setLoginLocation(address); | 
 |  |  |             dto.setUserName(username); | 
 |  |  |             dto.setIp(ip); | 
 |  |  |             dto.setLoginTime(DateUtils.getNowDate()); | 
 |  |  |             dto.setOperation(EquipmentLog.LOGIN.ordinal()); | 
 |  |  |             // 日志状态 | 
 |  |  |             if (StringUtils.equalsAny(status, Constants.LOGIN_SUCCESS, Constants.LOGOUT, Constants.REGISTER)) { | 
 |  |  |                 dto.setStatus(BusinessStatus.SUCCESS.ordinal()); | 
 |  |  |             } else if (Constants.LOGIN_FAIL.equals(status)) { | 
 |  |  |                 dto.setStatus(BusinessStatus.FAIL.ordinal()); | 
 |  |  |             } | 
 |  |  |             SpringUtils.getBean(EquipmentService.class).recordOper(dto); | 
 |  |  |         } | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     private String getBlock(Object msg) { | 
 
 |  |  | 
 |  |  |      */ | 
 |  |  |     @Override | 
 |  |  |     public void setUserAgent(LoginUser loginUser) { | 
 |  |  |         UserAgent userAgent = UserAgentUtil.parse(ServletUtils.getRequest().getHeader("User-Agent")); | 
 |  |  |         String ip = ServletUtils.getClientIP(); | 
 |  |  |         loginUser.setIpaddr(ip); | 
 |  |  |         loginUser.setLoginLocation(AddressUtils.getRealAddressByIP(ip)); | 
 |  |  |         loginUser.setBrowser(userAgent.getBrowser().getName()); | 
 |  |  |         loginUser.setOs(userAgent.getOs().getName()); | 
 |  |  |         HttpServletRequest request = ServletUtils.getRequest(); | 
 |  |  |         // 用户类型(DEVICE:设备端,空:pc系统) | 
 |  |  |         String userType = request.getHeader("User-Type"); | 
 |  |  |         if (StringUtils.isEmpty(userType)) { | 
 |  |  |             UserAgent userAgent = UserAgentUtil.parse(ServletUtils.getRequest().getHeader("User-Agent")); | 
 |  |  |             String ip = ServletUtils.getClientIP(); | 
 |  |  |             loginUser.setIpaddr(ip); | 
 |  |  |             loginUser.setLoginLocation(AddressUtils.getRealAddressByIP(ip)); | 
 |  |  |             loginUser.setBrowser(userAgent.getBrowser().getName()); | 
 |  |  |             loginUser.setOs(userAgent.getOs().getName()); | 
 |  |  |         } | 
 |  |  |         if ("DEVICE".equals(userType)) { | 
 |  |  |             String ip = ServletUtils.getClientIP(); | 
 |  |  |             loginUser.setIpaddr(ip); | 
 |  |  |             loginUser.setLoginLocation(AddressUtils.getRealAddressByIP(ip)); | 
 |  |  |         } | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     /** |