From 363f04637441f0be360acd8654278e34b9d0bf54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=AE=87=E8=88=AA?= <653809315@qq.com> Date: Wed, 17 Jan 2024 12:56:46 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=BC=E5=85=A5=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../monitor/SysDiscernController.java | 2 + .../system/NormalIdentifierController.java | 44 +++ .../system/RadarStatusController.java | 26 +- .../system/SysIdentifierController.java | 43 +++ .../controller/system/SysLogoController.java | 49 +++ .../system/SysPoliceController.java | 4 +- .../system/SysProfileController.java | 9 +- .../system/SysProfileEditController.java | 177 +++++++++++ .../controller/system/SysRadarController.java | 48 ++- .../web/core/config/RadarStatusWebSocket.java | 7 +- .../src/main/resources/application-druid.yml | 4 +- ruoyi-admin/src/main/resources/logback.xml | 2 +- .../main/resources/static/img/radarGreen.png | Bin 0 -> 6230 bytes .../main/resources/static/img/radarRed.jpg | Bin 0 -> 2329 bytes .../main/resources/static/img/radarYellow.jpg | Bin 0 -> 2367 bytes .../src/main/resources/templates/index.html | 145 +-------- .../templates/monitor/life/life.html | 22 +- .../templates/system/identifier/add.html | 6 +- .../templates/system/identifier/edit.html | 8 +- .../system/identifier/identifier.html | 12 +- .../resources/templates/system/logo/logo.html | 35 ++ .../system/normalIdentifier/add.html | 12 +- .../system/normalIdentifier/edit.html | 14 +- .../normalIdentifier/normalIdentifier.html | 68 +--- .../templates/system/police/add.html | 32 +- .../templates/system/police/edit.html | 2 +- .../templates/system/police/police.html | 6 +- .../resources/templates/system/radar/add.html | 97 +++++- .../templates/system/radar/edit.html | 31 +- .../templates/system/radar/radar.html | 24 +- .../system/radarStatus/radarStatus.html | 15 +- .../templates/system/user/profile/avatar.html | 2 +- .../system/user/profile/profile.html | 121 ++----- .../system/user/profile/profileEdit.html | 298 ++++++++++++++++++ .../core/domain/entity/IdentifierExcel.java | 93 ++++++ .../core/domain/entity/NormalExcel.java | 117 +++++++ .../common/core/domain/entity/RadarExcel.java | 142 +++++++++ .../common/core/domain/entity/SysRadar.java | 22 ++ .../system/mapper/SysIdentifierMapper.java | 2 + .../ruoyi/system/mapper/SysRadarMapper.java | 1 + .../system/service/ISysIdentifierService.java | 10 +- .../system/service/ISysRadarService.java | 5 + .../impl/SysIdentifierServiceImpl.java | 138 +++++++- .../service/impl/SysRadarServiceImpl.java | 73 +++++ .../mapper/system/PrimaryRadarDataMapper.xml | 35 -- .../mapper/system/SysIdentifierMapper.xml | 4 + .../mapper/system/SysRadarMapper.xml | 20 +- 47 files changed, 1583 insertions(+), 444 deletions(-) create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysLogoController.java create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysProfileEditController.java create mode 100644 ruoyi-admin/src/main/resources/static/img/radarGreen.png create mode 100644 ruoyi-admin/src/main/resources/static/img/radarRed.jpg create mode 100644 ruoyi-admin/src/main/resources/static/img/radarYellow.jpg create mode 100644 ruoyi-admin/src/main/resources/templates/system/logo/logo.html create mode 100644 ruoyi-admin/src/main/resources/templates/system/user/profile/profileEdit.html create mode 100644 ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/IdentifierExcel.java create mode 100644 ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/NormalExcel.java create mode 100644 ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/RadarExcel.java diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysDiscernController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysDiscernController.java index e3a02e6..7b0f065 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysDiscernController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysDiscernController.java @@ -66,6 +66,8 @@ public class SysDiscernController extends BaseController { primaryRadarData1.setType("车架"); } else if (primaryRadarData1.getLadleNumber().contains("铁")) { primaryRadarData1.setType("铁包"); + }else { + primaryRadarData1.setType(null); } } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/NormalIdentifierController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/NormalIdentifierController.java index 62baad9..d1cb98c 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/NormalIdentifierController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/NormalIdentifierController.java @@ -16,6 +16,7 @@ import com.ruoyi.framework.shiro.util.AuthorizationUtils; import com.ruoyi.system.service.*; import org.apache.commons.lang3.ArrayUtils; import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.ModelMap; @@ -100,4 +101,47 @@ public class NormalIdentifierController extends BaseController identifier.setUpdateBy(getLoginName()); return toAjax(identifierService.updateNormalIdentifier(identifier)); } + + @PostMapping("/remove") + @ResponseBody + public AjaxResult remove(String ids) + { + + return toAjax(identifierService.deleteRadarByIds(ids)); + } + + + @PostMapping("/export") + @ResponseBody + public AjaxResult export(SysIdentifier sysIdentifier) + { + List list = identifierService.selectNormalIdentifierList(sysIdentifier);; + List collect = list.stream().map(identifier -> { + NormalExcel normalExcel = new NormalExcel(); + BeanUtils.copyProperties(identifier, normalExcel); + return normalExcel; + } + ).collect(Collectors.toList()); + ExcelUtil util = new ExcelUtil(NormalExcel.class); + return util.exportExcel(collect, "常温标识器配置"); + } + + + @GetMapping("/importTemplate") + @ResponseBody + public AjaxResult importTemplate() + { + ExcelUtil util = new ExcelUtil(NormalExcel.class); + return util.importTemplateExcel("常温标识器配置"); + } + + @PostMapping("/importData") + @ResponseBody + public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception + { + ExcelUtil util = new ExcelUtil(NormalExcel.class); + List normalList = util.importExcel(file.getInputStream()); + String message = identifierService.importNormalData(normalList, updateSupport); + return AjaxResult.success(message); + } } \ No newline at end of file diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/RadarStatusController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/RadarStatusController.java index 8d2082d..7c6773a 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/RadarStatusController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/RadarStatusController.java @@ -28,6 +28,7 @@ import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; +import java.net.Inet4Address; import java.util.*; import java.util.concurrent.CompletableFuture; @@ -80,6 +81,7 @@ public class RadarStatusController public void run() { try { for (SysRadar radar : radarList) { +// ModbusResponse modbusResponse = new ModbusResponse(); ModbusMaster master = ModbusUtils.getSlave(radar.getRadarIp(), 23); System.out.println(radar.getRadarIp()); ModbusResponse modbusResponse = ModbusUtils.holdingRegister(); @@ -87,14 +89,19 @@ public class RadarStatusController System.out.println(modbusResponse); String tag = modbusResponse.getTagId(); PrimaryRadarData primaryRadarData = new PrimaryRadarData(); - if (!"0".equals(modbusResponse.getTagId())) { - SysIdentifier sysIdentifier = identifierService.selectIdentifierByTag(tag); - primaryRadarData.setLadleNumber(sysIdentifier.getLadleNumber()); - } + SysIdentifier sysIdentifier = new SysIdentifier(); BeanUtils.copyProperties(modbusResponse,primaryRadarData); - primaryRadarData.setRadarLocation(radar.getRadarLocation()); - primaryRadarData.setRadarIp(radar.getRadarIp()); - + if (!"0".equals(modbusResponse.getTagId())) { + sysIdentifier = identifierService.selectIdentifierByTag(tag); + primaryRadarData.setLadleNumber(sysIdentifier.getLadleNumber()); + primaryRadarData.setRadarLocation(radar.getRadarLocation()); + primaryRadarData.setRadarIp(radar.getRadarIp()); + }else { + primaryRadarData.setLadleNumber(null); + primaryRadarData.setRadarLocation(null); + primaryRadarData.setRadarIp(radar.getRadarIp()); + } + String ip = Inet4Address.getLocalHost().getHostAddress(); if (modbusResponse.getValue4()!=null && !"0".equals(modbusResponse.getValue4())) { primaryRadarDataService.insertPrimaryRadarData(primaryRadarData); } @@ -105,11 +112,10 @@ public class RadarStatusController System.err.println("从串口读取失败:" + "连接超时"); } e.printStackTrace(); - connectionStatus.connected= false; } } }; - timer.scheduleAtFixedRate(task, 1, 100); + timer.scheduleAtFixedRate(task, 1, 1000); return responses; }); @@ -128,6 +134,8 @@ public class RadarStatusController } rspData.setRows(radarList.subList(pageNum, pageSize)); rspData.setTotal(radarList.size()); + +// RadarStatusWebSocket.sendToAll(rspData); return rspData; } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysIdentifierController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysIdentifierController.java index a2e4112..56e4389 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysIdentifierController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysIdentifierController.java @@ -16,6 +16,7 @@ import com.ruoyi.framework.shiro.util.AuthorizationUtils; import com.ruoyi.system.service.*; import org.apache.commons.lang3.ArrayUtils; import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.ModelMap; @@ -100,4 +101,46 @@ public class SysIdentifierController extends BaseController identifier.setUpdateBy(getLoginName()); return toAjax(iSysIdentifierService.updateUser(identifier)); } + + @PostMapping("/remove") + @ResponseBody + public AjaxResult remove(String ids) + { + + return toAjax(iSysIdentifierService.deleteRadarByIds(ids)); + } + + @PostMapping("/export") + @ResponseBody + public AjaxResult export(SysIdentifier sysIdentifier) + { + List list = iSysIdentifierService.selectIdentifierList(sysIdentifier);; + List collect = list.stream().map(identifier -> { + IdentifierExcel normalExcel = new IdentifierExcel(); + BeanUtils.copyProperties(identifier, normalExcel); + return normalExcel; + } + ).collect(Collectors.toList()); + ExcelUtil util = new ExcelUtil(IdentifierExcel.class); + return util.exportExcel(collect, "高温标识器配置"); + } + + + @GetMapping("/importTemplate") + @ResponseBody + public AjaxResult importTemplate() + { + ExcelUtil util = new ExcelUtil(IdentifierExcel.class); + return util.importTemplateExcel("常温标识器配置"); + } + + @PostMapping("/importData") + @ResponseBody + public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception + { + ExcelUtil util = new ExcelUtil(IdentifierExcel.class); + List identifierList = util.importExcel(file.getInputStream()); + String message = iSysIdentifierService.importData(identifierList, updateSupport); + return AjaxResult.success(message); + } } \ No newline at end of file diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysLogoController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysLogoController.java new file mode 100644 index 0000000..b6675dc --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysLogoController.java @@ -0,0 +1,49 @@ +package com.ruoyi.web.controller.system; + +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.domain.entity.SysRadar; +import com.ruoyi.common.core.domain.entity.SysUser; +import com.ruoyi.common.core.page.TableDataInfo; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.system.service.ISysRadarService; +import com.ruoyi.system.service.ISysUserService; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.ModelMap; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * 雷达配置 + * + * @author ruoyi + */ +@Controller +@RequestMapping("/system/logo") +public class SysLogoController extends BaseController +{ + private String prefix = "system/logo"; + + + @Autowired + private ISysUserService userService; + @GetMapping() + public String user() + { + return prefix + "/logo"; + } + + @PostMapping("/list") + @ResponseBody + public TableDataInfo list(SysUser user) + { + startPage(); + List list = userService.selectUserList(user); + return getDataTable(list); + } +} \ No newline at end of file diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysPoliceController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysPoliceController.java index d25a137..5e4dead 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysPoliceController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysPoliceController.java @@ -73,10 +73,10 @@ public class SysPoliceController extends BaseController */ @PostMapping("/add") @ResponseBody - public AjaxResult addSave(@Validated SysPolice sysPolice) + public AjaxResult addSave(@Validated SysRadar sysPolice) { sysPolice.setCreateBy(getLoginName()); - return toAjax(sysPoliceService.insertSysPolice(sysPolice)); + return toAjax(radarService.insertRadar(sysPolice)); } /** diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysProfileController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysProfileController.java index e95868a..4d4a882 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysProfileController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysProfileController.java @@ -130,17 +130,10 @@ public class SysProfileController extends BaseController { SysUser currentUser = getSysUser(); currentUser.setUserName(user.getUserName()); + currentUser.setLoginName(user.getLoginName()); currentUser.setEmail(user.getEmail()); currentUser.setPhonenumber(user.getPhonenumber()); currentUser.setSex(user.getSex()); - if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(currentUser)) - { - return error("修改用户'" + currentUser.getLoginName() + "'失败,手机号码已存在"); - } - else if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(currentUser)) - { - return error("修改用户'" + currentUser.getLoginName() + "'失败,邮箱账号已存在"); - } if (userService.updateUserInfo(currentUser) > 0) { setSysUser(userService.selectUserById(currentUser.getUserId())); diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysProfileEditController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysProfileEditController.java new file mode 100644 index 0000000..3482405 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysProfileEditController.java @@ -0,0 +1,177 @@ +package com.ruoyi.web.controller.system; + +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.config.RuoYiConfig; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.domain.entity.SysUser; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.common.utils.DateUtils; +import com.ruoyi.common.utils.ShiroUtils; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.common.utils.file.FileUploadUtils; +import com.ruoyi.common.utils.file.MimeTypeUtils; +import com.ruoyi.framework.shiro.service.SysPasswordService; +import com.ruoyi.system.service.ISysUserService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.ModelMap; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +/** + * 个人信息 业务处理 + * + * @author ruoyi + */ +@Controller +@RequestMapping("/system/user/profileEdit") +public class SysProfileEditController extends BaseController +{ + private static final Logger log = LoggerFactory.getLogger(SysProfileEditController.class); + + private String prefix = "system/user/profileEdit"; + + @Autowired + private ISysUserService userService; + + @Autowired + private SysPasswordService passwordService; + + /** + * 个人信息 + */ + @GetMapping() + public String profile(ModelMap mmap) + { + SysUser user = getSysUser(); + mmap.put("user", user); + mmap.put("roleGroup", userService.selectUserRoleGroup(user.getUserId())); + mmap.put("postGroup", userService.selectUserPostGroup(user.getUserId())); + return prefix + "/profileEdit"; + } + + @GetMapping("/checkPassword") + @ResponseBody + public boolean checkPassword(String password) + { + SysUser user = getSysUser(); + return passwordService.matches(user, password); + } + + @GetMapping("/resetPwd") + public String resetPwd(ModelMap mmap) + { + SysUser user = getSysUser(); + mmap.put("user", userService.selectUserById(user.getUserId())); + return prefix + "/resetPwd"; + } + + @Log(title = "重置密码", businessType = BusinessType.UPDATE) + @PostMapping("/resetPwd") + @ResponseBody + public AjaxResult resetPwd(String oldPassword, String newPassword) + { + SysUser user = getSysUser(); + if (!passwordService.matches(user, oldPassword)) + { + return error("修改密码失败,旧密码错误"); + } + if (passwordService.matches(user, newPassword)) + { + return error("新密码不能与旧密码相同"); + } + user.setSalt(ShiroUtils.randomSalt()); + user.setPassword(passwordService.encryptPassword(user.getLoginName(), newPassword, user.getSalt())); + user.setPwdUpdateDate(DateUtils.getNowDate()); + if (userService.resetUserPwd(user) > 0) + { + setSysUser(userService.selectUserById(user.getUserId())); + return success(); + } + return error("修改密码异常,请联系管理员"); + } + + /** + * 修改用户 + */ + @GetMapping("/edit") + public String edit(ModelMap mmap) + { + SysUser user = getSysUser(); + mmap.put("user", userService.selectUserById(user.getUserId())); + return prefix + "/edit"; + } + + /** + * 修改头像 + */ + @GetMapping("/avatar") + public String avatar(ModelMap mmap) + { + SysUser user = getSysUser(); + mmap.put("user", userService.selectUserById(user.getUserId())); + return prefix + "/avatar"; + } + + /** + * 修改用户 + */ + @Log(title = "个人信息", businessType = BusinessType.UPDATE) + @PostMapping("/update") + @ResponseBody + public AjaxResult update(SysUser user) + { + SysUser currentUser = getSysUser(); + currentUser.setUserName(user.getUserName()); + currentUser.setEmail(user.getEmail()); + currentUser.setPhonenumber(user.getPhonenumber()); + currentUser.setSex(user.getSex()); + if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(currentUser)) + { + return error("修改用户'" + currentUser.getLoginName() + "'失败,手机号码已存在"); + } + else if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(currentUser)) + { + return error("修改用户'" + currentUser.getLoginName() + "'失败,邮箱账号已存在"); + } + if (userService.updateUserInfo(currentUser) > 0) + { + setSysUser(userService.selectUserById(currentUser.getUserId())); + return success(); + } + return error(); + } + + /** + * 保存头像 + */ + @Log(title = "个人信息", businessType = BusinessType.UPDATE) + @PostMapping("/updateAvatar") + @ResponseBody + public AjaxResult updateAvatar(@RequestParam("avatarfile") MultipartFile file) + { + SysUser currentUser = getSysUser(); + try + { + if (!file.isEmpty()) + { + String avatar = FileUploadUtils.upload(RuoYiConfig.getAvatarPath(), file, MimeTypeUtils.IMAGE_EXTENSION); + currentUser.setAvatar(avatar); + if (userService.updateUserInfo(currentUser) > 0) + { + setSysUser(userService.selectUserById(currentUser.getUserId())); + return success(); + } + } + return error(); + } + catch (Exception e) + { + log.error("修改头像失败!", e); + return error(e.getMessage()); + } + } +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRadarController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRadarController.java index 2a40d07..c964bb9 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRadarController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRadarController.java @@ -4,10 +4,7 @@ import com.ruoyi.common.annotation.Log; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.domain.Ztree; -import com.ruoyi.common.core.domain.entity.SysDept; -import com.ruoyi.common.core.domain.entity.SysRadar; -import com.ruoyi.common.core.domain.entity.SysRole; -import com.ruoyi.common.core.domain.entity.SysUser; +import com.ruoyi.common.core.domain.entity.*; import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.core.text.Convert; import com.ruoyi.common.enums.BusinessType; @@ -19,6 +16,7 @@ import com.ruoyi.framework.shiro.util.AuthorizationUtils; import com.ruoyi.system.service.*; import org.apache.commons.lang3.ArrayUtils; import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.ModelMap; @@ -105,4 +103,46 @@ public class SysRadarController extends BaseController return toAjax(radarService.updateUser(radar)); } + @PostMapping("/remove") + @ResponseBody + public AjaxResult remove(String ids) + { + + return toAjax(radarService.deleteRadarByIds(ids)); + } + + + @PostMapping("/export") + @ResponseBody + public AjaxResult export(SysRadar sysRadar) + { + List list = radarService.selectRadarList(sysRadar);; + List collect = list.stream().map(identifier -> { + RadarExcel normalExcel = new RadarExcel(); + BeanUtils.copyProperties(identifier, normalExcel); + return normalExcel; + } + ).collect(Collectors.toList()); + ExcelUtil util = new ExcelUtil(RadarExcel.class); + return util.exportExcel(collect, "雷达配置"); + } + + + @GetMapping("/importTemplate") + @ResponseBody + public AjaxResult importTemplate() + { + ExcelUtil util = new ExcelUtil(RadarExcel.class); + return util.importTemplateExcel("雷达配置"); + } + + @PostMapping("/importData") + @ResponseBody + public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception + { + ExcelUtil util = new ExcelUtil(RadarExcel.class); + List radarList = util.importExcel(file.getInputStream()); + String message = radarService.importData(radarList, updateSupport); + return AjaxResult.success(message); + } } \ No newline at end of file diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/core/config/RadarStatusWebSocket.java b/ruoyi-admin/src/main/java/com/ruoyi/web/core/config/RadarStatusWebSocket.java index 0041805..2d86b85 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/core/config/RadarStatusWebSocket.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/core/config/RadarStatusWebSocket.java @@ -1,12 +1,15 @@ package com.ruoyi.web.core.config; +import com.ruoyi.common.core.domain.entity.DataResponse; import com.ruoyi.common.core.domain.entity.PrimaryRadarData; +import com.ruoyi.common.core.page.TableDataInfo; import org.springframework.stereotype.Component; import javax.websocket.*; import javax.websocket.server.ServerEndpoint; import java.io.IOException; import java.util.HashSet; +import java.util.List; import java.util.Set; @ServerEndpoint(value="/websocket",configurator = WebSocketConfig.class) @@ -35,10 +38,10 @@ public class RadarStatusWebSocket { } } - public static void sendToAll(PrimaryRadarData primaryRadarData) { + public static void sendToAll(TableDataInfo dataResponse) { for (Session session : sessions) { try { - session.getBasicRemote().sendObject(primaryRadarData); + session.getBasicRemote().sendObject(dataResponse); } catch (IOException | EncodeException e) { e.printStackTrace(); } diff --git a/ruoyi-admin/src/main/resources/application-druid.yml b/ruoyi-admin/src/main/resources/application-druid.yml index 2d13b8d..6d3a469 100644 --- a/ruoyi-admin/src/main/resources/application-druid.yml +++ b/ruoyi-admin/src/main/resources/application-druid.yml @@ -6,9 +6,9 @@ spring: druid: # 主库数据源 master: - url: jdbc:mysql://39.104.15.118:3306/ry?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 + url: jdbc:mysql://localhost:3306/ry?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 username: root - password: Orderfood@2022 + password: 12345678 # 从库数据源 slave: # 从数据源开关/默认关闭 diff --git a/ruoyi-admin/src/main/resources/logback.xml b/ruoyi-admin/src/main/resources/logback.xml index 9792fc6..ebca736 100644 --- a/ruoyi-admin/src/main/resources/logback.xml +++ b/ruoyi-admin/src/main/resources/logback.xml @@ -1,7 +1,7 @@ - + diff --git a/ruoyi-admin/src/main/resources/static/img/radarGreen.png b/ruoyi-admin/src/main/resources/static/img/radarGreen.png new file mode 100644 index 0000000000000000000000000000000000000000..e565fdee56c7ec5984a0c18feaeb1d34d0d7e359 GIT binary patch literal 6230 zcmZvA1z1#F*Y=rV=$fHZhfumhngNEAl+d9|x*N%%q@-1(WF%BVI;94r6e$q_5fCH= zq@?Q~pZEEn_xb<}(ni@z0oW$Y~OhkaY zt|yz*000@nSw%%(Q$+=?@8jv<>}C%D8VOJC5uyy=(>*uKNJ|4lplMXW)JPYAhpis? zlw{4p2~tiFff{YD6-K$zlTM8q!+I&=S!?RJ4?9r$cfRySSv<%Dzx~BGpSztadv&q; zF=9AR)_0o~VCX+FaK2WCkLW1Yr@Kzq!<3!V$1aa=WDTwd;fqW zl2_7gOp^DayY-1=!mfF|88C|3JE`Rd*0SIuyj1s<$b%_+1gT!2z(6#9O+@%*5L?eW zbViApr-vjgppR0K0uR&>-pEVErLLkKH`M~a#b)3x)+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b%=1at7h7rbJ2#U zIK$|!Dnxj1CJSD7Y#)3^rGKv6dmV=D^2+=^d20B2Z}yt{Jr$i>#FiCS#jRg0D3&un zbD@DSwfoxI0O+Qrx$YZ10Cf6j;Mp?(tlid}XIcP&e>0|wh=3r^g1n_06hOG+#%^Z| zCKBFV^l=FT6OB3|`+6Wy>&4#X&!-S5W+eVm0x=xhlQdX*KnzC|z!<5igMi^O{PR}F S5iQ(16QHT8i>y?(j`}}_(-B<& literal 0 HcmV?d00001 diff --git a/ruoyi-admin/src/main/resources/static/img/radarRed.jpg b/ruoyi-admin/src/main/resources/static/img/radarRed.jpg new file mode 100644 index 0000000000000000000000000000000000000000..51d232db4c595fc6313ba46daecfd036b16c23cb GIT binary patch literal 2329 zcmZ{mdpy&N8^^!jZDz)pS#F6hN7#`{DVJiGL#|DYC?%qcQO-H(oFg)0O3fuEt6WZV z$>mgTt#otCG9q+V3B_^<9kmr>&BoF1kKgZ~^ZVm@p4aR1yq?$dyq=0RScTb|(kM7kw-ai^Y3l(}$B=8r;XOP>wt7 z3wA=^-p0REZg@Ujkc-2KO}!Bvz6}QZjz@0&VO5VAYp)r1cVpt`P%@p^7Qn4 z`MhJ<^ua{CW-6`M&o$7=tZL1`F<@#Rc@TvpJhr$BAi&MEorUS-nW;z&LQJA zZUEHWF5CNRGLZD=6Ib+k89~=l`-*p-e8#fwrg8T;+od8Vui&9QHGO$Oh{;iEF3Z2q zvUX`J;bF%m818_e2q^k;An}3TL_B_1jlQ%Ve#33pk0Qtc3D2D?5a*4Q8C4AeE(kyT z15D7l5YRYpy!ZWGi@p9A{7_h1`J$nXy?fm{@@E(yvvk1fQbZCp28XvJ74kZNw#pZx zY#&}^CBQRq_(V^`O5};uYcTW5aPh2b(xd%Z!4Ca*N@IdH2)WdH*VgpL}8anm^_(zS&!_o85z;2p4 zv090r3l6Ica}Vyq+E4}ttPI#VQsF{+g{z6&-JmV3G7Dvn>yH-?J=^fu|K22ib}wFW z^7Q8`X*uHB$%RmLw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00001 diff --git a/ruoyi-admin/src/main/resources/static/img/radarYellow.jpg b/ruoyi-admin/src/main/resources/static/img/radarYellow.jpg new file mode 100644 index 0000000000000000000000000000000000000000..5055931a364be2b5d7734fb339b41d02e626de33 GIT binary patch literal 2367 zcmaJ@SyvvXMQRQ|O#XrALRs7AZJD8OJRBTi@FXtd%sK0aCjm~BHS z?@+@l-AsuWAIjnn5itRmVITM=?DaQN|d&e4aQ8+|jJLb?2b z%wLVL15ulvm(C$u9^%4g>7et>BT^DtIfM%slcnac>vyWFgNbQ7Rigon)#c!6TnaS& z{X5l28qO;jQ&xbCt4>wy2}-Dp^Ma`OxG_ONQ{t0UQj9!O)m$_|UfK|4$jq4s15#&I z!vN<*)?gY|qC+SsI{DgatyGL{HUow44bZ@t6bExEycL1!yhFhO607v-%ok zdzTwohIoBpqno}~wribI-3eNa=#086{8C9p0X70GVraMDaetEe8l27Zm9Ph|#>}m=*=%g*>Jy~B5h4FJapV{; zMYzg2yvNe; zEvmV-;pw=Vg~kcfx|@J*O5~2e?=F4tzH(S>nmUBf#2VlK7c<7xc5q!+ug-|(Fh6@Z z1(O^$vwJn{w_0_dTm36+N=6l;{GG&iP;-~n`*hK)NUgOU;*R>-)R?60|9i-?AGTLg z@sd%N?jOBcw2Sjx~6iCDS&ODgZp|SJ^nO3^Y^Zno4X!RFzbzyGf_E7{I&uJZ|--#k6mUruO!uDaOXCc92MuTDI+e{~qmD`Gc3941Y{9 zn6d|dSKhx8N{Jv@*GO~MW*>8H(xz#W81*uODX+Hpb5IZELm{fCc z3ysUMNo6ge)Mk9=!{Ct-{@->R8_r`{ztWhyx&+81${yN1O|PGyuI^@8>7KN=3#vFd z%l~u0oILJM)rhb8#BTkidn;ovpqf+>5!FtWh2y4i>70Ee3lqy-cA)q32E33vP(5`J zQ*ayNG}{MujHC@}g$Ftg=^th2wZ{xP*tTn%gUMH~>k4kOR%@2zp%>+sVgiqt(aXDr zRNtC23Ej8AEt`@9ZnHXq%1_xMdpnPN$2C1s@>0~M(ahb(<)h8@0_D-sXs4Q?izAH% zw|8FC`YP^9sC;H)(P49EVr{bPQ-Ig|AiJW#qf&j+p> zE_-soHdjuL70ezG-d*g2%9=!;zABNnUk1X4e>nZD0|tR*1%^kv?zn_M4b7R}Y#9+B zVz$??I3opRfTEu+^_3;%W!hca1Hvs* zE!(EPFlf#k-T|>0duw(#52OnYn3#7VETGn<;YL>ihL*lT@}bL;vmb zssWvEW*@2dBbYo>*M>b+!!U!BX8~8Y5J-+A%B-+BDPP`ZQy(obcUU0I>jnb??EMCb zfyt`!Sl*gOYTki%y`7-A0@_EY0fd!nf_rlP0L3Yze8W=f@j$vu(d%Mre@n$BGAqG7 z7?fC}l9LUx={*rXnC-0OOA6e(G-Cgg7Hc@Fzn@BkkJ!2$ZtqMNe+xJAMno;#YGFB~ z6%in?u9@XUaG+jxM-+xgqqQ**z!voxt2MPMicRzSnm`NBUL@;!Jz zSgE4E;^C^w7^9ufbK|KI5^fYqcw##OtqyA*{Xd8BAMYeu{hdVS>yZIU;V04<)KW#m zdPRP+XEwwF4bpzFlk>dtl;&_B7Gtv2HE6fc*pN`q1?WO$Yp}|9CwKC(b)=#C7-{+G#l4RNdbN06B|1` z&MA0JX{4QdfQQ6zJ*85GBVzSC0b4cfZ5U;AB{LMF9Lp4`-~SHT1pOCML}0P3?~pMU zPzbtNCOi&`0YlOFiz}u*nj2M%6G5qJm1pu55LkTunkQrGmI;oVWt6fNuZx2 @@ -196,38 +91,6 @@ diff --git a/ruoyi-admin/src/main/resources/templates/monitor/life/life.html b/ruoyi-admin/src/main/resources/templates/monitor/life/life.html index 73c9d2c..67eda0b 100644 --- a/ruoyi-admin/src/main/resources/templates/monitor/life/life.html +++ b/ruoyi-admin/src/main/resources/templates/monitor/life/life.html @@ -42,22 +42,6 @@ - - - - - - - - - - - - - - - -
@@ -91,10 +75,14 @@ title: '序号' }, { - field: 'updateTime', + field: 'createTime', title: '时间', sortable: true }, + { + field: 'tagId', + title: '标识器ID', + }, { field: 'value4', title: '信号值', diff --git a/ruoyi-admin/src/main/resources/templates/system/identifier/add.html b/ruoyi-admin/src/main/resources/templates/system/identifier/add.html index 0723195..9c764ab 100644 --- a/ruoyi-admin/src/main/resources/templates/system/identifier/add.html +++ b/ruoyi-admin/src/main/resources/templates/system/identifier/add.html @@ -12,7 +12,7 @@
- +
@@ -22,7 +22,7 @@
- +
@@ -68,7 +68,7 @@ $.operate.saveTab(prefix + "/add", data); } //关闭弹窗 - closeItem(); + // closeItem(); //刷新父页面 parent.location.reload(); } diff --git a/ruoyi-admin/src/main/resources/templates/system/identifier/edit.html b/ruoyi-admin/src/main/resources/templates/system/identifier/edit.html index f41955c..9b3085d 100644 --- a/ruoyi-admin/src/main/resources/templates/system/identifier/edit.html +++ b/ruoyi-admin/src/main/resources/templates/system/identifier/edit.html @@ -13,7 +13,7 @@
- +
@@ -23,7 +23,7 @@
- +
@@ -33,7 +33,7 @@
- +
@@ -61,7 +61,7 @@ var data = $("#form-user-edit").serializeArray(); $.operate.saveTab(prefix + "/edit", data); } - closeItem(); + // closeItem(); //刷新父页面 parent.location.reload(); } diff --git a/ruoyi-admin/src/main/resources/templates/system/identifier/identifier.html b/ruoyi-admin/src/main/resources/templates/system/identifier/identifier.html index 618d555..0bdc91d 100644 --- a/ruoyi-admin/src/main/resources/templates/system/identifier/identifier.html +++ b/ruoyi-admin/src/main/resources/templates/system/identifier/identifier.html @@ -53,6 +53,12 @@ 新增 + + 导入 + + + 导出 +
@@ -101,7 +107,7 @@ importTemplateUrl: prefix + "/importTemplate", sortName: "createTime", sortOrder: "desc", - modalName: "雷达", + modalName: "高温标识器配置", columns: [{ checkbox: true }, @@ -129,7 +135,7 @@ if (row.userId != 1) { var actions = []; actions.push('编辑 '); - // actions.push('删除 '); + actions.push('删除 '); // var more = []; // more.push("重置密码 "); // more.push("分配角色"); @@ -235,7 +241,7 @@
- 是否更新已经存在的用户数据 + 是否更新已经存在的数据   下载模板
diff --git a/ruoyi-admin/src/main/resources/templates/system/logo/logo.html b/ruoyi-admin/src/main/resources/templates/system/logo/logo.html new file mode 100644 index 0000000..9af9ff2 --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/system/logo/logo.html @@ -0,0 +1,35 @@ + + + + + + + + +
+ +
+ + + diff --git a/ruoyi-admin/src/main/resources/templates/system/normalIdentifier/add.html b/ruoyi-admin/src/main/resources/templates/system/normalIdentifier/add.html index d712887..82a82a0 100644 --- a/ruoyi-admin/src/main/resources/templates/system/normalIdentifier/add.html +++ b/ruoyi-admin/src/main/resources/templates/system/normalIdentifier/add.html @@ -12,7 +12,7 @@
- +
@@ -22,7 +22,7 @@
- +
@@ -32,7 +32,7 @@
- +
@@ -42,7 +42,7 @@
- +
@@ -52,7 +52,7 @@
- +
@@ -88,7 +88,7 @@ $.operate.saveTab(prefix + "/add", data); } //关闭弹窗 - closeItem(); + // closeItem(); //刷新父页面 parent.location.reload(); } diff --git a/ruoyi-admin/src/main/resources/templates/system/normalIdentifier/edit.html b/ruoyi-admin/src/main/resources/templates/system/normalIdentifier/edit.html index e93220a..b545f74 100644 --- a/ruoyi-admin/src/main/resources/templates/system/normalIdentifier/edit.html +++ b/ruoyi-admin/src/main/resources/templates/system/normalIdentifier/edit.html @@ -13,7 +13,7 @@
- +
@@ -23,7 +23,7 @@
- +
@@ -33,7 +33,7 @@
- +
@@ -43,7 +43,7 @@
- +
@@ -53,7 +53,7 @@
- +
@@ -77,8 +77,8 @@ var data = $("#form-user-edit").serializeArray(); $.operate.saveTab(prefix + "/edit", data); } - closeItem(); - //刷新父页面 + // closeItem(); + // 刷新父页面 parent.location.reload(); } diff --git a/ruoyi-admin/src/main/resources/templates/system/normalIdentifier/normalIdentifier.html b/ruoyi-admin/src/main/resources/templates/system/normalIdentifier/normalIdentifier.html index b3a8120..9d4ed7c 100644 --- a/ruoyi-admin/src/main/resources/templates/system/normalIdentifier/normalIdentifier.html +++ b/ruoyi-admin/src/main/resources/templates/system/normalIdentifier/normalIdentifier.html @@ -31,6 +31,12 @@ 新增 + + 导入 + + + 导出 +
@@ -78,7 +84,7 @@ importTemplateUrl: prefix + "/importTemplate", sortName: "createTime", sortOrder: "desc", - modalName: "用户", + modalName: "常温标识器配置", columns: [{ checkbox: true }, @@ -114,6 +120,7 @@ if (row.userId != 1) { var actions = []; actions.push('编辑 '); + actions.push('删除 '); return actions.join(''); } else { return ""; @@ -124,22 +131,6 @@ $.table.init(options); } - function queryDeptTree() - { - var url = ctx + "system/user/deptTreeData"; - var options = { - url: url, - expandLevel: 2, - onClick : zOnClick - }; - $.tree.init(options); - - function zOnClick(event, treeId, treeNode) { - $("#deptId").val(treeNode.id); - $("#parentId").val(treeNode.pId); - $.table.search(); - } - } $('#btnExpand').click(function() { $._tree.expandAll(true); @@ -157,34 +148,6 @@ queryDeptTree(); }); - /* 自定义重置-表单重置/隐藏框/树节点选择色/搜索 */ - function resetPre() { - resetDate(); - $("#user-form")[0].reset(); - $("#deptId").val(""); - $("#parentId").val(""); - $(".curSelectedNode").removeClass("curSelectedNode"); - $.table.search(); - } - - /* 用户管理-部门 */ - function dept() { - var url = ctx + "system/dept"; - $.modal.openTab("部门管理", url); - } - - /* 用户管理-重置密码 */ - function resetPwd(userId) { - var url = prefix + '/resetPwd/' + userId; - $.modal.open("重置密码", url, '800', '300'); - } - - /* 用户管理-分配角色 */ - function authRole(userId) { - var url = prefix + '/authRole/' + userId; - $.modal.openTab("用户分配角色", url); - } - /* 用户状态显示 */ function statusTools(row) { if (row.status == 1) { @@ -194,19 +157,6 @@ } } - /* 用户管理-停用 */ - function disable(userId) { - $.modal.confirm("确认要停用用户吗?", function() { - $.operate.post(prefix + "/changeStatus", { "userId": userId, "status": 1 }); - }) - } - - /* 用户管理启用 */ - function enable(userId) { - $.modal.confirm("确认要启用用户吗?", function() { - $.operate.post(prefix + "/changeStatus", { "userId": userId, "status": 0 }); - }) - } @@ -215,7 +165,7 @@
- 是否更新已经存在的用户数据 + 是否更新已经存在的数据   下载模板
diff --git a/ruoyi-admin/src/main/resources/templates/system/police/add.html b/ruoyi-admin/src/main/resources/templates/system/police/add.html index 41f97f2..91b5752 100644 --- a/ruoyi-admin/src/main/resources/templates/system/police/add.html +++ b/ruoyi-admin/src/main/resources/templates/system/police/add.html @@ -12,7 +12,7 @@
- +
@@ -20,9 +20,9 @@
- +
- +
@@ -30,9 +30,29 @@
- +
- + +
+
+
+
+
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+
@@ -68,7 +88,7 @@ $.operate.saveTab(prefix + "/add", data); } //关闭弹窗 - closeItem(); + // closeItem(); //刷新父页面 parent.location.reload(); } diff --git a/ruoyi-admin/src/main/resources/templates/system/police/edit.html b/ruoyi-admin/src/main/resources/templates/system/police/edit.html index f0f475d..566aea7 100644 --- a/ruoyi-admin/src/main/resources/templates/system/police/edit.html +++ b/ruoyi-admin/src/main/resources/templates/system/police/edit.html @@ -77,7 +77,7 @@ var data = $("#form-user-edit").serializeArray(); $.operate.saveTab(prefix + "/edit", data); } - closeItem(); + // closeItem(); //刷新父页面 parent.location.reload(); } diff --git a/ruoyi-admin/src/main/resources/templates/system/police/police.html b/ruoyi-admin/src/main/resources/templates/system/police/police.html index 499d546..ac845b2 100644 --- a/ruoyi-admin/src/main/resources/templates/system/police/police.html +++ b/ruoyi-admin/src/main/resources/templates/system/police/police.html @@ -11,9 +11,9 @@
- - 新增 - + + + diff --git a/ruoyi-admin/src/main/resources/templates/system/radar/add.html b/ruoyi-admin/src/main/resources/templates/system/radar/add.html index 6c1f30f..7b4d322 100644 --- a/ruoyi-admin/src/main/resources/templates/system/radar/add.html +++ b/ruoyi-admin/src/main/resources/templates/system/radar/add.html @@ -12,7 +12,7 @@
- +
@@ -22,7 +22,7 @@
- +
@@ -32,7 +32,7 @@
- +
@@ -42,7 +42,35 @@
- + +
+
+
+
+
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+ + + +
@@ -59,7 +87,10 @@ \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/system/radar/edit.html b/ruoyi-admin/src/main/resources/templates/system/radar/edit.html index 4700d66..53ba84b 100644 --- a/ruoyi-admin/src/main/resources/templates/system/radar/edit.html +++ b/ruoyi-admin/src/main/resources/templates/system/radar/edit.html @@ -13,7 +13,7 @@
- +
@@ -23,7 +23,7 @@
- +
@@ -33,7 +33,7 @@
- +
@@ -43,12 +43,31 @@
- + +
+
+ + +
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+
- @@ -72,7 +91,7 @@ var data = $("#form-user-edit").serializeArray(); $.operate.saveTab(prefix + "/edit", data); } - closeItem(); + // closeItem(); //刷新父页面 parent.location.reload(); } diff --git a/ruoyi-admin/src/main/resources/templates/system/radar/radar.html b/ruoyi-admin/src/main/resources/templates/system/radar/radar.html index ededa84..d0b5db9 100644 --- a/ruoyi-admin/src/main/resources/templates/system/radar/radar.html +++ b/ruoyi-admin/src/main/resources/templates/system/radar/radar.html @@ -71,12 +71,12 @@ - - - - - - + + 导入 + + + 导出 +
@@ -146,6 +146,14 @@ field: 'stationCode', title: '工位代号' }, + { + field: 'radarId', + title: '雷达ID' + }, + { + field: 'radarNum', + title: '雷达天线号' + }, { field: 'sort', title: '工序', @@ -157,7 +165,7 @@ if (row.userId != 1) { var actions = []; actions.push('编辑 '); - // actions.push('删除 '); + actions.push('删除 '); // var more = []; // more.push("重置密码 "); // more.push("分配角色"); @@ -263,7 +271,7 @@
- 是否更新已经存在的用户数据 + 是否更新已经存在的数据   下载模板
diff --git a/ruoyi-admin/src/main/resources/templates/system/radarStatus/radarStatus.html b/ruoyi-admin/src/main/resources/templates/system/radarStatus/radarStatus.html index 72a7e2d..b55c676 100644 --- a/ruoyi-admin/src/main/resources/templates/system/radarStatus/radarStatus.html +++ b/ruoyi-admin/src/main/resources/templates/system/radarStatus/radarStatus.html @@ -79,7 +79,7 @@ $.table.init(options); }); - var socket = new WebSocket("ws://192.168.120.15/websocket"); + var socket = new WebSocket("ws://localhost/websocket"); socket.onopen = function(event) { console.log("WebSocket连接已打开"); @@ -99,18 +99,19 @@ var view = '' $.each(data, function (i, row) { view += template - .replace('%IMAGE%', getImageUrl(row.radarIp)) + .replace('%IMAGE%', getImageUrl(row.status)) .replace('%radarIp%', row.radarIp) .replace('%radarLocation%', row.radarLocation) }) return `
${view}
` } - function getImageUrl(radarIp) { - if (radarIp === '192.168.0.7') { - return "https://xjl559.oss-cn-shanghai.aliyuncs.com/2023/12/11/%E6%88%AA%E5%B1%8F2024-01-08%2013.57.36.png"; - } else if (radarIp === '192.168.0.8') { - return "https://xjl559.oss-cn-shanghai.aliyuncs.com/2023/12/11/%E6%88%AA%E5%B1%8F2024-01-08%2013.57.36.png"; + function getImageUrl(status) { + if (status === 1) { + + return "http://localhost/img/radarGreen.png"; + } else if (status === 0) { + return "http://localhost/img/radarRed.jpg"; } } diff --git a/ruoyi-admin/src/main/resources/templates/system/user/profile/avatar.html b/ruoyi-admin/src/main/resources/templates/system/user/profile/avatar.html index e473ff1..38dfa8a 100644 --- a/ruoyi-admin/src/main/resources/templates/system/user/profile/avatar.html +++ b/ruoyi-admin/src/main/resources/templates/system/user/profile/avatar.html @@ -134,7 +134,7 @@
- +
diff --git a/ruoyi-admin/src/main/resources/templates/system/user/profile/profile.html b/ruoyi-admin/src/main/resources/templates/system/user/profile/profile.html index 35c0cb8..850537b 100644 --- a/ruoyi-admin/src/main/resources/templates/system/user/profile/profile.html +++ b/ruoyi-admin/src/main/resources/templates/system/user/profile/profile.html @@ -12,34 +12,18 @@
-
个人资料
+
工厂资料
  • - 登录名称: + 工厂名称:

    [[${user.loginName}]]

  • -
  • - 手机号码: -

    [[${user.phonenumber}]]

    -
  • -
  • - 所属部门: -

    [[${user.dept?.deptName}]] / [[${#strings.defaultString(postGroup,'无岗位')}]]

    -
  • -
  • - 邮箱地址: -

    [[${#strings.abbreviate(user.email, 16)}]]

    -
  • -
  • - 创建时间: -

    [[${#dates.format(user.createTime, 'yyyy-MM-dd')}]]

    -
@@ -54,7 +38,6 @@ @@ -161,7 +106,7 @@ //不固定 maxmin: true, shade: 0.3, - title: "修改头像", + title: "修改图标", content: url, btn: ['确定', '关闭'], // 弹层外区域关闭 diff --git a/ruoyi-admin/src/main/resources/templates/system/user/profile/profileEdit.html b/ruoyi-admin/src/main/resources/templates/system/user/profile/profileEdit.html new file mode 100644 index 0000000..e32d5be --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/system/user/profile/profileEdit.html @@ -0,0 +1,298 @@ + + + + + + + + + +
+
+
+
+
+
个人资料
+
+
+
+ +

修改头像

+
+
    +
  • + 登录名称: +

    [[${user.loginName}]]

    +
  • +
  • + 手机号码: +

    [[${user.phonenumber}]]

    +
  • +
  • + 所属部门: +

    [[${user.dept?.deptName}]] / [[${#strings.defaultString(postGroup,'无岗位')}]]

    +
  • +
  • + 邮箱地址: +

    [[${#strings.abbreviate(user.email, 16)}]]

    +
  • +
  • + 创建时间: +

    [[${#dates.format(user.createTime, 'yyyy-MM-dd')}]]

    +
  • +
+
+
+
+ +
+
+
+
基本资料
+
+
+ +
+
+
+
+
+ + + + + diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/IdentifierExcel.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/IdentifierExcel.java new file mode 100644 index 0000000..9c59486 --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/IdentifierExcel.java @@ -0,0 +1,93 @@ +package com.ruoyi.common.core.domain.entity; + +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.annotation.Excel.ColumnType; +import com.ruoyi.common.core.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +/** + * 高温标识器配置对象 sys_identifier + * + * @author ruoyi + */ +public class IdentifierExcel extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 用户ID */ + @Excel(name = "高温标识器序号", cellType = ColumnType.NUMERIC, prompt = "序号") + private Long id; + + @Excel(name = "高温标识器ID1") + private String identifierId; + + @Excel(name = "高温标识器ID2") + private String identifierTwo; + + @Excel(name = "铁包号") + private String ladleNumber; + + /** 删除标志(0代表存在 2代表删除) */ + private String delFlag; + + public IdentifierExcel() { + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getIdentifierId() { + return identifierId; + } + + public void setIdentifierId(String identifierId) { + this.identifierId = identifierId; + } + + public String getIdentifierTwo() { + return identifierTwo; + } + + public void setIdentifierTwo(String identifierTwo) { + this.identifierTwo = identifierTwo; + } + + + public String getLadleNumber() { + return ladleNumber; + } + + public void setLadleNumber(String ladleNumber) { + this.ladleNumber = ladleNumber; + } + + public String getDelFlag() { + return delFlag; + } + + public void setDelFlag(String delFlag) { + this.delFlag = delFlag; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("identifierId", getIdentifierId()) + .append("identifierTwo", getIdentifierTwo()) + .append("ladleNumber", getLadleNumber()) + .append("delFlag", getDelFlag()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("remark", getRemark()) + .toString(); + } +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/NormalExcel.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/NormalExcel.java new file mode 100644 index 0000000..0b1eae3 --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/NormalExcel.java @@ -0,0 +1,117 @@ +package com.ruoyi.common.core.domain.entity; + +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.annotation.Excel.ColumnType; +import com.ruoyi.common.core.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +/** + * 高温标识器配置对象 sys_identifier + * + * @author ruoyi + */ +public class NormalExcel extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 用户ID */ + @Excel(name = "常温标识器序号", cellType = ColumnType.NUMERIC, prompt = "序号") + private Long id; + + @Excel(name = "常温标识器ID1") + private String identifierId; + + @Excel(name = "常温标识器ID2") + private String identifierTwo; + + @Excel(name = "常温标识器ID3") + private String identifierThree; + + @Excel(name = "常温标识器ID4") + private String identifierFour; + + @Excel(name = "铁包号") + private String ladleNumber; + + /** 删除标志(0代表存在 2代表删除) */ + private String delFlag; + + public NormalExcel() { + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getIdentifierId() { + return identifierId; + } + + public void setIdentifierId(String identifierId) { + this.identifierId = identifierId; + } + + public String getIdentifierTwo() { + return identifierTwo; + } + + public void setIdentifierTwo(String identifierTwo) { + this.identifierTwo = identifierTwo; + } + + public String getIdentifierThree() { + return identifierThree; + } + + public void setIdentifierThree(String identifierThree) { + this.identifierThree = identifierThree; + } + + public String getIdentifierFour() { + return identifierFour; + } + + public void setIdentifierFour(String identifierFour) { + this.identifierFour = identifierFour; + } + + + public String getLadleNumber() { + return ladleNumber; + } + + public void setLadleNumber(String ladleNumber) { + this.ladleNumber = ladleNumber; + } + + public String getDelFlag() { + return delFlag; + } + + public void setDelFlag(String delFlag) { + this.delFlag = delFlag; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("identifierId", getIdentifierId()) + .append("identifierTwo", getIdentifierTwo()) + .append("ladleNumber", getLadleNumber()) + .append("identifierThree", getIdentifierThree()) + .append("identifierFour",getIdentifierFour()) + .append("delFlag", getDelFlag()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("remark", getRemark()) + .toString(); + } +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/RadarExcel.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/RadarExcel.java new file mode 100644 index 0000000..b1d9a4f --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/RadarExcel.java @@ -0,0 +1,142 @@ +package com.ruoyi.common.core.domain.entity; + +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.annotation.Excel.ColumnType; +import com.ruoyi.common.core.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +/** + * 雷达配置对象 sys_radar + * + * @author ruoyi + */ +public class RadarExcel extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 用户ID */ + @Excel(name = "雷达序号", cellType = ColumnType.NUMERIC, prompt = "雷达编号") + private Long id; + + @Excel(name = "雷达IP") + private String radarIp; + + @Excel(name = "雷达位置/工位") + private String radarLocation; + + @Excel(name = "工位代号") + private Integer stationCode; + + @Excel(name = "工序") + private Integer sort; + + private Integer status; + + @Excel(name = "雷达ID") + private Integer radarId; + + @Excel(name = "雷达天线号") + private String radarNum; + + /** 删除标志(0代表存在 2代表删除) */ + private String delFlag; + + public RadarExcel() { + } + + public String getDelFlag() { + return delFlag; + } + + public void setDelFlag(String delFlag) { + this.delFlag = delFlag; + } + + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getRadarIp() { + return radarIp; + } + + public void setRadarIp(String radarIp) { + this.radarIp = radarIp; + } + + public String getRadarLocation() { + return radarLocation; + } + + public void setRadarLocation(String radarLocation) { + this.radarLocation = radarLocation; + } + + public Integer getStationCode() { + return stationCode; + } + + public void setStationCode(Integer stationCode) { + this.stationCode = stationCode; + } + + public Integer getSort() { + return sort; + } + + public void setSort(Integer sort) { + this.sort = sort; + } + + + + public Integer getStatus() { + return status; + } + + public void setStatus(Integer status) { + this.status = status; + } + + public Integer getRadarId() { + return radarId; + } + + public void setRadarId(Integer radarId) { + this.radarId = radarId; + } + + public String getRadarNum() { + return radarNum; + } + + public void setRadarNum(String radarNum) { + this.radarNum = radarNum; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("radarIp", getRadarIp()) + .append("radarLocation", getRadarLocation()) + .append("stationCode", getStationCode()) + .append("sort", getSort()) + .append("status", getStatus()) + .append("radarId", getRadarId()) + .append("radarNum", getRadarNum()) + .append("delFlag", getDelFlag()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("remark", getRemark()) + .toString(); + } +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysRadar.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysRadar.java index f0358fe..c064eb1 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysRadar.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysRadar.java @@ -44,6 +44,10 @@ public class SysRadar extends BaseEntity private Integer status; + private Integer radarId; + + private String radarNum; + /** 删除标志(0代表存在 2代表删除) */ private String delFlag; @@ -140,6 +144,22 @@ public class SysRadar extends BaseEntity this.status = status; } + public Integer getRadarId() { + return radarId; + } + + public void setRadarId(Integer radarId) { + this.radarId = radarId; + } + + public String getRadarNum() { + return radarNum; + } + + public void setRadarNum(String radarNum) { + this.radarNum = radarNum; + } + @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) @@ -153,6 +173,8 @@ public class SysRadar extends BaseEntity .append("alarmValue3", getAlarmValue3()) .append("alarmValue4", getAlarmValue4()) .append("status", getStatus()) + .append("radarId", getRadarId()) + .append("radarNum", getRadarNum()) .append("delFlag", getDelFlag()) .append("createBy", getCreateBy()) .append("createTime", getCreateTime()) diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysIdentifierMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysIdentifierMapper.java index d7e29d9..e27d182 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysIdentifierMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysIdentifierMapper.java @@ -34,4 +34,6 @@ public interface SysIdentifierMapper List selectAllIdentifierList(); SysIdentifier selectIdentifierByTag(String tag); + + int deleteRadarByIds(String ids); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysRadarMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysRadarMapper.java index 77927df..30fe1a4 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysRadarMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysRadarMapper.java @@ -41,4 +41,5 @@ public interface SysRadarMapper public int updateRadarValue(SysRadar radar); public int updateStatus(SysRadar radar); + int deleteRadarByIds(String ids); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysIdentifierService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysIdentifierService.java index 8c95d4e..d146c00 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysIdentifierService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysIdentifierService.java @@ -1,8 +1,6 @@ package com.ruoyi.system.service; -import com.ruoyi.common.core.domain.entity.SysIdentifier; -import com.ruoyi.common.core.domain.entity.SysRadar; -import com.ruoyi.common.core.domain.entity.SysUser; +import com.ruoyi.common.core.domain.entity.*; import com.ruoyi.system.domain.SysUserRole; import java.util.List; @@ -31,4 +29,10 @@ public interface ISysIdentifierService int updateNormalIdentifier(SysIdentifier identifier); SysIdentifier selectIdentifierByTag(String tag); + + int deleteRadarByIds(String ids); + + String importNormalData(List normalList, boolean isUpdateSupport); + + String importData(List identifierList, boolean isUpdateSupport); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysRadarService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysRadarService.java index bfc0827..60c4fcb 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysRadarService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysRadarService.java @@ -1,5 +1,6 @@ package com.ruoyi.system.service; +import com.ruoyi.common.core.domain.entity.RadarExcel; import com.ruoyi.common.core.domain.entity.SysRadar; import com.ruoyi.common.core.domain.entity.SysUser; import com.ruoyi.system.domain.SysUserRole; @@ -32,4 +33,8 @@ public interface ISysRadarService public int updateRadarValue(SysRadar radar); int changeStatus(SysRadar radar); + + int deleteRadarByIds(String ids); + + String importData(List radarList, boolean isUpdateSupport); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysIdentifierServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysIdentifierServiceImpl.java index 2bf1310..6509b35 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysIdentifierServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysIdentifierServiceImpl.java @@ -1,14 +1,12 @@ package com.ruoyi.system.service.impl; import com.ruoyi.common.constant.UserConstants; -import com.ruoyi.common.core.domain.entity.SysIdentifier; -import com.ruoyi.common.core.domain.entity.SysRadar; -import com.ruoyi.common.core.domain.entity.SysRole; -import com.ruoyi.common.core.domain.entity.SysUser; +import com.ruoyi.common.core.domain.entity.*; import com.ruoyi.common.core.text.Convert; import com.ruoyi.common.exception.ServiceException; import com.ruoyi.common.utils.ShiroUtils; import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.common.utils.bean.BeanUtils; import com.ruoyi.common.utils.bean.BeanValidators; import com.ruoyi.common.utils.security.Md5Utils; import com.ruoyi.system.domain.SysPost; @@ -96,6 +94,138 @@ public class SysIdentifierServiceImpl implements ISysIdentifierService return identifierMapper.selectIdentifierByTag(tag); } + @Override + public int deleteRadarByIds(String ids) { + + return identifierMapper.deleteRadarByIds(ids); + } + + @Override + public String importNormalData(List normalList, boolean isUpdateSupport) { + if (StringUtils.isNull(normalList) || normalList.size() == 0) + { + throw new ServiceException("导入数据不能为空!"); + } + int successNum = 0; + int failureNum = 0; + StringBuilder successMsg = new StringBuilder(); + StringBuilder failureMsg = new StringBuilder(); + List sysIdentifiers = normalList.stream().map(normalExcel -> { + SysIdentifier sysIdentifier = new SysIdentifier(); + BeanUtils.copyProperties(normalExcel, sysIdentifier); + sysIdentifier.setId(normalExcel.getId()); + return sysIdentifier; + }).collect(Collectors.toList()); + for (SysIdentifier sysIdentifier : sysIdentifiers) + { + try + { + // 验证是否存在 + SysIdentifier u = identifierMapper.selectNormalIdentifierById(sysIdentifier.getId()); + if (StringUtils.isNull(u)) + { + BeanValidators.validateWithException(validator, sysIdentifier); + identifierMapper.insertNormalIdentifier(sysIdentifier); + successNum++; + successMsg.append("
" + successNum + "、高温标识器 " + sysIdentifier.getId() + " 导入成功"); + } + else if (isUpdateSupport) + { + BeanValidators.validateWithException(validator, sysIdentifier); + sysIdentifier.setId(u.getId()); + identifierMapper.updateNormalIdentifier(sysIdentifier); + successNum++; + successMsg.append("
" + successNum + "、高温标识器 " + sysIdentifier.getId() + " 更新成功"); + } + else + { + failureNum++; + failureMsg.append("
" + failureNum + "、高温标识器 " + sysIdentifier.getId() + " 已存在"); + } + } + catch (Exception e) + { + failureNum++; + String msg = "
" + failureNum + "、高温标识器 " + sysIdentifier.getId() + " 导入失败:"; + failureMsg.append(msg + e.getMessage()); + log.error(msg, e); + } + } + if (failureNum > 0) + { + failureMsg.insert(0, "很抱歉,导入失败!共 " + failureNum + " 条数据格式不正确,错误如下:"); + throw new ServiceException(failureMsg.toString()); + } + else + { + successMsg.insert(0, "恭喜您,数据已全部导入成功!共 " + successNum + " 条,数据如下:"); + } + return successMsg.toString(); + } + + @Override + public String importData(List identifierList, boolean isUpdateSupport) { + if (StringUtils.isNull(identifierList) || identifierList.size() == 0) + { + throw new ServiceException("导入数据不能为空!"); + } + int successNum = 0; + int failureNum = 0; + StringBuilder successMsg = new StringBuilder(); + StringBuilder failureMsg = new StringBuilder(); + List sysIdentifiers = identifierList.stream().map(identifierExcel -> { + SysIdentifier sysIdentifier = new SysIdentifier(); + BeanUtils.copyProperties(identifierExcel, sysIdentifier); + sysIdentifier.setId(identifierExcel.getId()); + return sysIdentifier; + }).collect(Collectors.toList()); + for (SysIdentifier sysIdentifier : sysIdentifiers) + { + try + { + // 验证是否存在 + SysIdentifier u = identifierMapper.selectIdentifierById(sysIdentifier.getId()); + if (StringUtils.isNull(u)) + { + BeanValidators.validateWithException(validator, sysIdentifier); + identifierMapper.insertIdentifier(sysIdentifier); + successNum++; + successMsg.append("
" + successNum + "、高温标识器 " + sysIdentifier.getId() + " 导入成功"); + } + else if (isUpdateSupport) + { + BeanValidators.validateWithException(validator, sysIdentifier); + sysIdentifier.setId(u.getId()); + identifierMapper.updateIdentifier(sysIdentifier); + successNum++; + successMsg.append("
" + successNum + "、高温标识器 " + sysIdentifier.getId() + " 更新成功"); + } + else + { + failureNum++; + failureMsg.append("
" + failureNum + "、高温标识器 " + sysIdentifier.getId() + " 已存在"); + } + } + catch (Exception e) + { + failureNum++; + String msg = "
" + failureNum + "、高温标识器 " + sysIdentifier.getId() + " 导入失败:"; + failureMsg.append(msg + e.getMessage()); + log.error(msg, e); + } + } + if (failureNum > 0) + { + failureMsg.insert(0, "很抱歉,导入失败!共 " + failureNum + " 条数据格式不正确,错误如下:"); + throw new ServiceException(failureMsg.toString()); + } + else + { + successMsg.insert(0, "恭喜您,数据已全部导入成功!共 " + successNum + " 条,数据如下:"); + } + return successMsg.toString(); + } + @Override public SysIdentifier selectIdentifierById(Long id) { diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysRadarServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysRadarServiceImpl.java index d1e0514..81ea4f8 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysRadarServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysRadarServiceImpl.java @@ -2,6 +2,7 @@ package com.ruoyi.system.service.impl; import com.ruoyi.common.annotation.DataScope; import com.ruoyi.common.constant.UserConstants; +import com.ruoyi.common.core.domain.entity.RadarExcel; import com.ruoyi.common.core.domain.entity.SysRadar; import com.ruoyi.common.core.domain.entity.SysRole; import com.ruoyi.common.core.domain.entity.SysUser; @@ -9,6 +10,7 @@ import com.ruoyi.common.core.text.Convert; import com.ruoyi.common.exception.ServiceException; import com.ruoyi.common.utils.ShiroUtils; import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.common.utils.bean.BeanUtils; import com.ruoyi.common.utils.bean.BeanValidators; import com.ruoyi.common.utils.security.Md5Utils; import com.ruoyi.common.utils.spring.SpringUtils; @@ -101,6 +103,77 @@ public class SysRadarServiceImpl implements ISysRadarService return radarMapper.updateStatus(radar); } + @Override + public int deleteRadarByIds(String ids) { + + return radarMapper.deleteRadarByIds(ids); + } + + @Override + public String importData(List radarList, boolean isUpdateSupport) { + + if (StringUtils.isNull(radarList) || radarList.size() == 0) + { + throw new ServiceException("导入数据不能为空!"); + } + int successNum = 0; + int failureNum = 0; + StringBuilder successMsg = new StringBuilder(); + StringBuilder failureMsg = new StringBuilder(); + String password = configService.selectConfigByKey("sys.user.initPassword"); + List sysRadarList = radarList.stream().map(radarExcel -> { + SysRadar sysRadar = new SysRadar(); + BeanUtils.copyProperties(radarExcel, sysRadar); + return sysRadar; + }).collect(Collectors.toList()); + for (SysRadar radar : sysRadarList) + { + try + { + // 验证是否存在这个用户 + SysRadar u = radarMapper.selectRadarById(radar.getId()); + if (StringUtils.isNull(u)) + { + BeanValidators.validateWithException(validator, radar); + radarMapper.insertRadar(radar); + successNum++; + successMsg.append("
" + successNum + "、雷达 " + radar.getRadarIp() + " 导入成功"); + } + else if (isUpdateSupport) + { + BeanValidators.validateWithException(validator, radar); + radar.setId(u.getId()); + radarMapper.updateRadar(radar); + successNum++; + successMsg.append("
" + successNum + "、雷达 " + radar.getRadarIp() + " 更新成功"); + } + else + { + failureNum++; + failureMsg.append("
" + failureNum + "、雷达 " + radar.getRadarIp() + " 已存在"); + } + } + catch (Exception e) + { + failureNum++; + String msg = "
" + failureNum + "、雷达 " + radar.getRadarIp() + " 导入失败:"; + failureMsg.append(msg + e.getMessage()); + log.error(msg, e); + } + } + if (failureNum > 0) + { + failureMsg.insert(0, "很抱歉,导入失败!共 " + failureNum + " 条数据格式不正确,错误如下:"); + throw new ServiceException(failureMsg.toString()); + } + else + { + successMsg.insert(0, "恭喜您,数据已全部导入成功!共 " + successNum + " 条,数据如下:"); + } + return successMsg.toString(); + } + + } diff --git a/ruoyi-system/src/main/resources/mapper/system/PrimaryRadarDataMapper.xml b/ruoyi-system/src/main/resources/mapper/system/PrimaryRadarDataMapper.xml index 478b7e9..48cb888 100644 --- a/ruoyi-system/src/main/resources/mapper/system/PrimaryRadarDataMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/PrimaryRadarDataMapper.xml @@ -110,40 +110,5 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/mapper/system/SysIdentifierMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysIdentifierMapper.xml index f882bba..398eba2 100644 --- a/ruoyi-system/src/main/resources/mapper/system/SysIdentifierMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/SysIdentifierMapper.xml @@ -141,4 +141,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" from sys_identifier i where i.identifier_id = #{tag} or identifier_two = #{tag} or identifier_three = #{tag} or identifier_four = #{tag} + + + delete from sys_identifier where id in (#{ids}) + \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/mapper/system/SysRadarMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysRadarMapper.xml index 3f1036d..737fb0e 100644 --- a/ruoyi-system/src/main/resources/mapper/system/SysRadarMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/SysRadarMapper.xml @@ -15,6 +15,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + @@ -25,7 +27,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - select r.id,r.radar_ip,r.radar_location,r.station_code,r.alarm_value1,r.alarm_value2,r.alarm_value3,r.alarm_value4,r.status,r.sort,r.create_by,r.create_time,r.update_by,r.update_time,r.remark from sys_radar r + select r.id,r.radar_ip,r.radar_location,r.station_code,r.alarm_value1,r.alarm_value2,r.alarm_value3,r.alarm_value4,r.radar_id,r.radar_num,r.status,r.sort,r.create_by,r.create_time,r.update_by,r.update_time,r.remark from sys_radar r where r.id = #{id} @@ -81,6 +87,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" radar_location = #{radarLocation}, station_code = #{stationCode}, sort = #{sort}, + radar_id = #{radarId}, + radar_num = #{radarNum}, update_by = #{updateBy}, remark = #{remark}, update_time = sysdate() @@ -108,4 +116,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where id = #{id} + + + delete from sys_radar where id in (#{ids}) + + + + + \ No newline at end of file