diff --git a/src/main/java/com/zhgd/netty/tcp/handler/TcpNettyHandler.java b/src/main/java/com/zhgd/netty/tcp/handler/TcpNettyHandler.java index 0f3df029e..3883ee2ef 100644 --- a/src/main/java/com/zhgd/netty/tcp/handler/TcpNettyHandler.java +++ b/src/main/java/com/zhgd/netty/tcp/handler/TcpNettyHandler.java @@ -50,6 +50,7 @@ public class TcpNettyHandler extends SimpleChannelInboundHandler { String str = getString(bytes); str = str.trim(); log.info("tcp接收数据 >>> {} ", str); +// ctx.writeAndFlush(Unpooled.copiedBuffer("response message", CharsetUtil.UTF_8)); if (StringUtils.startsWith(str, HighFormworkSupport.TCP_DATA_PREFIX) && StringUtils.endsWith(str, HighFormworkSupport.TCP_DATA_END)) { log.info("高支模接收数据 >>> {} ", str); //接收高支模数据保存到mysql中 @@ -117,6 +118,7 @@ public class TcpNettyHandler extends SimpleChannelInboundHandler { poisonousGasDevCurrentDataService.addDataFromTcp(hexString.trim()); } } + } private byte[] readBytes(Object msg) { @@ -164,6 +166,7 @@ public class TcpNettyHandler extends SimpleChannelInboundHandler { public void channelReadComplete(ChannelHandlerContext ctx) { //刷新缓冲区,把消息发出去 ctx.flush(); + } @Override @@ -175,5 +178,6 @@ public class TcpNettyHandler extends SimpleChannelInboundHandler { @Override public void channelActive(ChannelHandlerContext ctx) throws Exception { log.info("channelActive:connect success!"); + ctx.writeAndFlush("欢迎连接 Netty 服务端!\n"); } } diff --git a/src/main/java/com/zhgd/netty/tcp/server/TcpNettyServer.java b/src/main/java/com/zhgd/netty/tcp/server/TcpNettyServer.java index d7bb05724..d6b0bab1b 100644 --- a/src/main/java/com/zhgd/netty/tcp/server/TcpNettyServer.java +++ b/src/main/java/com/zhgd/netty/tcp/server/TcpNettyServer.java @@ -17,6 +17,8 @@ import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; import javax.annotation.PostConstruct; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; /** * @author chenws @@ -46,8 +48,8 @@ public class TcpNettyServer { protected void initChannel(SocketChannel socketChannel) throws Exception { //添加自定义处理器 socketChannel.pipeline() - //.addLast(new StringEncoder(StandardCharsets.UTF_8)) - //.addLast(new StringDecoder(Charset.forName("GBK"))) +// .addLast(new StringEncoder(StandardCharsets.UTF_8)) +// .addLast(new StringDecoder(Charset.forName("GBK"))) .addLast(tcpNettyHandler); } }); diff --git a/src/main/java/com/zhgd/xmgl/call/IccVideoCall.java b/src/main/java/com/zhgd/xmgl/call/IccVideoCall.java index 8f5f44180..a9ed2ce92 100644 --- a/src/main/java/com/zhgd/xmgl/call/IccVideoCall.java +++ b/src/main/java/com/zhgd/xmgl/call/IccVideoCall.java @@ -11,7 +11,9 @@ import com.dahuatech.hutool.http.Method; import com.dahuatech.hutool.json.JSONUtil; import com.dahuatech.icc.admin.enums.PlayBackFormatEnum; import com.dahuatech.icc.admin.enums.StreamTypeEnum; +import com.dahuatech.icc.config.OauthConfigUtil; import com.dahuatech.icc.exception.ClientException; +import com.dahuatech.icc.model.event.eventSubcribe.SubscribeRequest; import com.dahuatech.icc.model.video.ptzControl.OperateCameraRequest; import com.dahuatech.icc.model.video.ptzControl.OperateCameraRequest.Data; import com.dahuatech.icc.model.video.ptzControl.OperateCameraResponse; @@ -27,6 +29,7 @@ import com.dahuatech.icc.multiinone.admin.domain.RecordInfo; import com.dahuatech.icc.multiinone.admin.vo.*; import com.dahuatech.icc.oauth.http.IccClient; import com.dahuatech.icc.oauth.http.IccTokenResponse; +import com.dahuatech.icc.oauth.model.v202010.GeneralResponse; import com.dahuatech.icc.oauth.model.v202010.OauthConfigUserPwdInfo; import com.dahuatech.icc.oauth.utils.HttpUtils; import com.zhgd.jeecg.common.execption.OpenAlertException; @@ -47,22 +50,24 @@ import model.v202207.talk.StopTalkResponse; import org.apache.commons.collections.MapUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.config.ConfigurableBeanFactory; import org.springframework.context.annotation.Lazy; import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Component; import java.io.File; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Optional; +import java.util.*; import java.util.stream.Collectors; @Slf4j @Component @Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE) public class IccVideoCall implements VideoItemManufacturer { + + @Value("${serverUrl}") + private String serverUrl; + private ProjectVideoConfig config; @Lazy @Autowired @@ -321,6 +326,63 @@ public class IccVideoCall implements VideoItemManufacturer { return p; } + @Override + public void setIccSubscriptionByEvent(Map map) { + SubscribeRequest subscribeRequest = new SubscribeRequest(); + SubscribeRequest.Param param = new SubscribeRequest.Param(); + + SubscribeRequest.Param.Subsystem subsystem = new SubscribeRequest.Param.Subsystem(); + subsystem.setName(MapUtils.getString(map, "name")); + subsystem.setMagic(MapUtils.getString(map, "magic")); + param.setSubsystem(subsystem); + + List monitors = new ArrayList(); + SubscribeRequest.Param.Monitor monitor = new SubscribeRequest.Param.Monitor(); + //回调地址的接口代码可参考SubscribeCallBackController类中的receiveMsg方法 + monitor.setMonitor(serverUrl + "/xmgl/callBack/icc/subscribeCall"); + + Listevents = new ArrayList<>(); + SubscribeRequest.Param.Monitor.Event event = new SubscribeRequest.Param.Monitor.Event(); + //订阅报警事件,填alarm + event.setCategory("alarm"); + List authorities = new ArrayList(); + SubscribeRequest.Param.Monitor.Event.Authority authority=new SubscribeRequest.Param.Monitor.Event.Authority(); + + //若订阅指定报警类型可参考下列代码进行修改,若订阅所有报警类型,则把下列types相关代码删除即可 + String types1 = MapUtils.getString(map, "types"); + List types= new ArrayList<>(Arrays.asList(types1.split(","))); + authority.setTypes(types); + + //若订阅指定组织可参考下列代码进行修改,若订阅所有组织,则将下列orgs相关代码删除 +// Listorgs = new ArrayList<>(); +// orgs.add("001001"); +// orgs.add("001002"); +// authority.setOrgs(orgs); + + //若订阅指定设备和通道可参考下列代码进行修改,若订阅所有设备和通道,则将下列nodeCodes相关代码删除 +// ListnodeCodes=new ArrayList(); +// nodeCodes.add("1002511$7$0$0"); +// nodeCodes.add("1002509$7$0$0"); +// authority.setNodeCodes(nodeCodes); + + authorities.add(authority); + event.setAuthorities(authorities); + events.add(event); + monitor.setEvents(events); + monitors.add(monitor); + param.setMonitors(monitors); + subscribeRequest.setParam(param); + log.info("SubscribeDemo,subscribeAlarmEvent,request:{}", JSONUtil.toJsonStr(subscribeRequest)); + + OauthConfigUserPwdInfo config = OauthConfigUtil.getOauthConfig(); + try { + GeneralResponse response = HttpUtils.executeJson("/evo-apigw/evo-event/1.0.0/subscribe/mqinfo", subscribeRequest,null, Method.POST, config,GeneralResponse.class); + log.info("SubscribeDemo,subscribeAlarmEvent,response:{}", response.getResult()); + } catch (ClientException e) { + log.error(e.getErrMsg(), e); + } + } + /** * 对抓拍请求参数进行封装 * diff --git a/src/main/java/com/zhgd/xmgl/call/JcCall.java b/src/main/java/com/zhgd/xmgl/call/JcCall.java index a644d7fa3..d737869ba 100644 --- a/src/main/java/com/zhgd/xmgl/call/JcCall.java +++ b/src/main/java/com/zhgd/xmgl/call/JcCall.java @@ -8,6 +8,8 @@ import cn.hutool.core.util.StrUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.google.common.collect.Lists; import com.zhgd.jeecg.common.mybatis.EntityMap; +import com.zhgd.xmgl.call.util.jc.AESUtil; +import com.zhgd.xmgl.call.util.jc.JcHttpUtil; import com.zhgd.xmgl.modules.electrical.entity.ElectricalData; import com.zhgd.xmgl.modules.electrical.entity.ElectricalDev; import com.zhgd.xmgl.modules.environment.entity.DustNoiseData; @@ -21,8 +23,6 @@ import com.zhgd.xmgl.modules.worker.service.IWorkerCertificateService; import com.zhgd.xmgl.modules.worker.service.IWorkerTypeService; import com.zhgd.xmgl.modules.worker.service.impl.EnterpriseInfoServiceImpl; import com.zhgd.xmgl.util.*; -import com.zhgd.xmgl.call.util.jc.AESUtil; -import com.zhgd.xmgl.call.util.jc.JcHttpUtil; import lombok.extern.slf4j.Slf4j; import net.javacrumbs.shedlock.core.SchedulerLock; import org.apache.commons.lang3.StringUtils; @@ -105,7 +105,7 @@ public class JcCall { form.setPhone(AESUtil.Encrypt(workerInfo.getPhoneNumber(), AESUtil.SECRET)); } if (StrUtil.isNotBlank(workerInfo.getIdCardUpPhotoUrl())) { - form.setHeadImg(PathUtil.getServerUrl() + "/image/" + workerInfo.getIdCardUpPhotoUrl()); + form.setHeadImg(JcHttpUtil.replaceUrlToHttps(FileUtils.getOnlineUrl(workerInfo.getIdCardUpPhotoUrl()))); } form.setNation(workerInfo.getNation()); form.setIdcardType(1); @@ -139,7 +139,7 @@ public class JcCall { JcHttpUtil.UserSyncRequest.CertificateInfo certificateInfo = new JcHttpUtil.UserSyncRequest.CertificateInfo(); if (StrUtil.isNotBlank(o.get("photoUrl"))) { try { - certificateInfo.setCertificate(FileUtils.getOnlineUrl(o.get("photoUrl"))); + certificateInfo.setCertificate(JcHttpUtil.replaceUrlToHttps(FileUtils.getOnlineUrl(o.get("photoUrl")))); } catch (Exception e) { e.printStackTrace(); } @@ -243,7 +243,7 @@ public class JcCall { form.setDeviceName(ufaceDev.getDevName()); } form.setDirection(Objects.equals(workerAttendance.getPassType(), 2) ? 0 : 1); - form.setPhotoUrl(FileUtils.getOnlineUrl(workerAttendance.getImageUrl())); + form.setPhotoUrl(JcHttpUtil.replaceUrlToHttps(FileUtils.getOnlineUrl(workerAttendance.getImageUrl()))); form.setShowTime(workerAttendance.getCreateTime()); form.setIdcardNo(AESUtil.Encrypt(workerInfo.getIdCard(), AESUtil.SECRET)); form.setCreateDate(DateUtil.now()); diff --git a/src/main/java/com/zhgd/xmgl/call/api/VideoItemManufacturer.java b/src/main/java/com/zhgd/xmgl/call/api/VideoItemManufacturer.java index c9e851ed6..55b703111 100644 --- a/src/main/java/com/zhgd/xmgl/call/api/VideoItemManufacturer.java +++ b/src/main/java/com/zhgd/xmgl/call/api/VideoItemManufacturer.java @@ -78,4 +78,6 @@ public interface VideoItemManufacturer { * @param map */ IPage manualHistoryCapture(Map map); + + void setIccSubscriptionByEvent(Map map); } diff --git a/src/main/java/com/zhgd/xmgl/call/util/jc/JcHttpUtil.java b/src/main/java/com/zhgd/xmgl/call/util/jc/JcHttpUtil.java index 795fac701..651a2e655 100644 --- a/src/main/java/com/zhgd/xmgl/call/util/jc/JcHttpUtil.java +++ b/src/main/java/com/zhgd/xmgl/call/util/jc/JcHttpUtil.java @@ -1,11 +1,13 @@ package com.zhgd.xmgl.call.util.jc; +import cn.hutool.core.util.StrUtil; import cn.hutool.http.HttpRequest; import com.gexin.fastjson.JSON; import com.zhgd.xmgl.util.EnvironmentUtil; import lombok.Data; import lombok.Getter; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Lazy; @@ -34,6 +36,7 @@ public class JcHttpUtil { */ public static String jcAllPush; public static EnvironmentUtil environmentUtil; + private static String jcHttpsUrl; public static String getJcProjectId() { return jcProjectId; @@ -191,6 +194,28 @@ public class JcHttpUtil { log.info("机场项目推送考勤记录,rs:{}", result); } + public static String getJcHttpsUrl() { + return jcHttpsUrl; + } + + @Value("${jcHttpsUrl:https://jc.zhgdyun.com:12112}") + public void setJcHttpsUrl(String jcHttpsUrl) { + JcHttpUtil.jcHttpsUrl = jcHttpsUrl; + } + + /** + * 替换成https + * + * @param onlineUrl + * @return + */ + public static String replaceUrlToHttps(String onlineUrl) { + if (StrUtil.isBlank(onlineUrl)) { + return null; + } + return StringUtils.replace(onlineUrl, "http://101.43.164.214:11111", getJcHttpsUrl()); + } + @Data public static class DustDataSyncRequest { private String projectId; @@ -638,7 +663,6 @@ public class JcHttpUtil { } } - /** * 配电数据同步接口请求参数 */ diff --git a/src/main/java/com/zhgd/xmgl/modules/basicdata/controller/AppComponentAuthController.java b/src/main/java/com/zhgd/xmgl/modules/basicdata/controller/AppComponentAuthController.java new file mode 100644 index 000000000..cdbe404d9 --- /dev/null +++ b/src/main/java/com/zhgd/xmgl/modules/basicdata/controller/AppComponentAuthController.java @@ -0,0 +1,181 @@ +package com.zhgd.xmgl.modules.basicdata.controller; + +import com.zhgd.annotation.OperLog; +import com.zhgd.xmgl.modules.basicdata.entity.dto.AppComponentAuthDto; +import com.zhgd.xmgl.modules.basicdata.entity.vo.AppComponentAuthVo; +import com.zhgd.xmgl.util.PageUtil; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiImplicitParams; +import io.swagger.annotations.ApiOperation; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLDecoder; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import com.zhgd.jeecg.common.api.vo.Result; +import com.zhgd.jeecg.common.system.query.QueryGenerator; +import com.zhgd.jeecg.common.util.oConvertUtils; +import com.zhgd.xmgl.modules.basicdata.entity.AppComponentAuth; +import com.zhgd.xmgl.modules.basicdata.service.IAppComponentAuthService; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections.MapUtils; +import org.jeecgframework.poi.excel.ExcelImportUtil; +import org.jeecgframework.poi.excel.def.NormalExcelConstants; +import org.jeecgframework.poi.excel.entity.ExportParams; +import org.jeecgframework.poi.excel.entity.ImportParams; +import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; +import org.springframework.web.multipart.MultipartHttpServletRequest; +import org.springframework.web.servlet.ModelAndView; +import com.alibaba.fastjson.JSON; +import springfox.documentation.annotations.ApiIgnore; + + +/** + * @Title: Controller + * @Description: APP组件授权信息 + * @author: pengj + * @date: 2025-11-04 + * @version: V1.0 + */ +@RestController +@RequestMapping("/xmgl/appComponentAuth") +@Slf4j +@Api(tags = "APP组件授权信息管理") +public class AppComponentAuthController { + @Autowired + private IAppComponentAuthService appComponentAuthService; + + /** + * 分页列表查询 + * + * @return + */ + @OperLog(operModul = "APP组件授权信息管理", operType = "分页查询", operDesc = "分页列表查询APP组件授权信息信息") + @ApiOperation(value = " 分页列表查询APP组件授权信息信息", notes = "分页列表查询APP组件授权信息信息", httpMethod = "POST") + @ApiImplicitParams({ + @ApiImplicitParam(name = "pageNo", value = "第几页", paramType = "body", required = true, dataType = "Integer"), + @ApiImplicitParam(name = "pageSize", value = "每页显示条数", paramType = "body", required = true, dataType = "Integer"), + }) + @PostMapping(value = "/page") + public Result> queryPageList(@ApiIgnore @RequestBody Map map) { + QueryWrapper queryWrapper = QueryGenerator.initPageQueryWrapper(AppComponentAuth.class, map); + Page page = PageUtil.getPage(map); + IPage pageList = appComponentAuthService.page(page, queryWrapper); + return Result.success(pageList); + } + + /** + * 列表查询 + * + * @return + */ + @OperLog(operModul = "APP组件授权信息管理", operType = "列表查询", operDesc = "列表查询APP组件授权信息信息") + @ApiOperation(value = " 列表查询APP组件授权信息信息", notes = "列表查询APP组件授权信息信息", httpMethod = "POST") + @ApiImplicitParams({ + @ApiImplicitParam(name = "type", value = "类型(1:企业;2:项目)", paramType = "body", required = true, dataType = "Integer"), + @ApiImplicitParam(name = "authType", value = "授权类型(1:企业;2:项目)", paramType = "body", required = true, dataType = "Integer"), + @ApiImplicitParam(name = "sn", value = "企业/项目SN", paramType = "body", required = true, dataType = "Integer"), + }) + @PostMapping(value = "/list") + public Result> queryList(@ApiIgnore @RequestBody Map map) { + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(AppComponentAuth.class, map, "a."); + List list = appComponentAuthService.getList(queryWrapper); + return Result.success(list); + } + + + /** + * 添加 + * + * @param appComponentAuth + * @return + */ + @OperLog(operModul = "APP组件授权信息管理", operType = "新增", operDesc = "添加修改APP组件授权信息信息") + @ApiOperation(value = " 添加修改APP组件授权信息信息", notes = "添加修改APP组件授权信息信息", httpMethod = "POST") + @PostMapping(value = "/add") + public Result add(@RequestBody AppComponentAuthVo appComponentAuth) { + appComponentAuthService.saveInfo(appComponentAuth); + return Result.success("添加成功!"); + } + + /** + * 通过id删除 + * + * @return + */ + @OperLog(operModul = "APP组件授权信息管理", operType = "删除", operDesc = "删除APP组件授权信息信息") + @ApiOperation(value = "删除APP组件授权信息信息", notes = "删除APP组件授权信息信息", httpMethod = "POST") + @ApiImplicitParam(name = "id", value = "APP组件授权信息ID", paramType = "body", required = true, dataType = "Integer") + @PostMapping(value = "/delete") + public Result delete(@ApiIgnore @RequestBody AppComponentAuth appComponentAuth) { + Result result = new Result(); + AppComponentAuth appComponentAuthEntity = appComponentAuthService.getById(appComponentAuth.getId()); + if (appComponentAuthEntity == null) { + result.error500("未找到对应实体"); + } else { + boolean ok = appComponentAuthService.removeById(appComponentAuth.getId()); + if (ok) { + result.success("删除成功!"); + } else { + result.success("操作失败!"); + } + } + return result; + } + + /** + * 批量删除 + * + * @return + */ + @OperLog(operModul = "APP组件授权信息管理", operType = "批量删除", operDesc = "批量删除APP组件授权信息信息") + @ApiOperation(value = "批量删除APP组件授权信息信息", notes = "批量删除APP组件授权信息信息", httpMethod = "POST") + @ApiImplicitParam(name = "ids", value = "APP组件授权信息ID字符串", paramType = "body", required = true, dataType = "String") + @PostMapping(value = "/deleteBatch") + public Result deleteBatch(@ApiIgnore @RequestBody Map map) { + Result result = new Result(); + String ids = MapUtils.getString(map, "ids"); + if (ids == null || "".equals(ids.trim())) { + result.error500("参数不识别!"); + } else { + this.appComponentAuthService.removeByIds(Arrays.asList(ids.split(","))); + result.success("删除成功!"); + } + return result; + } + + /** + * 通过id查询 + * + * @return + */ + @OperLog(operModul = "APP组件授权信息管理", operType = "查询", operDesc = "通过id查询APP组件授权信息信息") + @ApiOperation(value = "通过id查询APP组件授权信息信息", notes = "通过id查询APP组件授权信息信息", httpMethod = "POST") + @ApiImplicitParam(name = "id", value = "APP组件授权信息ID", paramType = "body", required = true, dataType = "Integer") + @PostMapping(value = "/queryById") + public Result queryById(@ApiIgnore @RequestBody AppComponentAuth appComponentAuthVo) { + Result result = new Result(); + AppComponentAuth appComponentAuth = appComponentAuthService.getById(appComponentAuthVo.getId()); + if (appComponentAuth == null) { + result.error500("未找到对应实体"); + } else { + result.setResult(appComponentAuth); + result.setSuccess(true); + } + return result; + } +} diff --git a/src/main/java/com/zhgd/xmgl/modules/basicdata/controller/AppComponentController.java b/src/main/java/com/zhgd/xmgl/modules/basicdata/controller/AppComponentController.java new file mode 100644 index 000000000..40c42e9ac --- /dev/null +++ b/src/main/java/com/zhgd/xmgl/modules/basicdata/controller/AppComponentController.java @@ -0,0 +1,202 @@ +package com.zhgd.xmgl.modules.basicdata.controller; + +import com.zhgd.annotation.OperLog; +import com.zhgd.xmgl.util.PageUtil; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiImplicitParams; +import io.swagger.annotations.ApiOperation; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLDecoder; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import com.zhgd.jeecg.common.api.vo.Result; +import com.zhgd.jeecg.common.system.query.QueryGenerator; +import com.zhgd.jeecg.common.util.oConvertUtils; +import com.zhgd.xmgl.modules.basicdata.entity.AppComponent; +import com.zhgd.xmgl.modules.basicdata.service.IAppComponentService; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections.MapUtils; +import org.jeecgframework.poi.excel.ExcelImportUtil; +import org.jeecgframework.poi.excel.def.NormalExcelConstants; +import org.jeecgframework.poi.excel.entity.ExportParams; +import org.jeecgframework.poi.excel.entity.ImportParams; +import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; +import org.springframework.web.multipart.MultipartHttpServletRequest; +import org.springframework.web.servlet.ModelAndView; +import com.alibaba.fastjson.JSON; +import springfox.documentation.annotations.ApiIgnore; + + +/** + * @Title: Controller + * @Description: APP组件库 + * @author: pengj + * @date: 2025-11-04 + * @version: V1.0 + */ +@RestController +@RequestMapping("/xmgl/appComponent") +@Slf4j +@Api(tags = "APP组件库管理") +public class AppComponentController { + @Autowired + private IAppComponentService appComponentService; + + /** + * 分页列表查询 + * + * @return + */ + @OperLog(operModul = "APP组件库管理", operType = "分页查询", operDesc = "分页列表查询APP组件库信息") + @ApiOperation(value = " 分页列表查询APP组件库信息", notes = "分页列表查询APP组件库信息", httpMethod = "POST") + @ApiImplicitParams({ + @ApiImplicitParam(name = "pageNo", value = "第几页", paramType = "body", required = true, dataType = "Integer"), + @ApiImplicitParam(name = "pageSize", value = "每页显示条数", paramType = "body", required = true, dataType = "Integer"), + }) + @PostMapping(value = "/page") + public Result> queryPageList(@ApiIgnore @RequestBody Map map) { + QueryWrapper queryWrapper = QueryGenerator.initPageQueryWrapper(AppComponent.class, map); + Page page = PageUtil.getPage(map); + IPage pageList = appComponentService.page(page, queryWrapper); + return Result.success(pageList); + } + + /** + * 列表查询 + * + * @param appComponent + * @return + */ + @OperLog(operModul = "APP组件库管理", operType = "列表查询", operDesc = "列表查询APP组件库信息") + @ApiOperation(value = " 列表查询APP组件库信息", notes = "列表查询APP组件库信息", httpMethod = "POST") + @PostMapping(value = "/list") + public Result> queryList(@RequestBody AppComponent appComponent) { + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(appComponent); + List list = appComponentService.list(queryWrapper); + return Result.success(list); + } + + + /** + * 添加 + * + * @param appComponent + * @return + */ + @OperLog(operModul = "APP组件库管理", operType = "新增", operDesc = "添加APP组件库信息") + @ApiOperation(value = " 添加APP组件库信息", notes = "添加APP组件库信息", httpMethod = "POST") + @PostMapping(value = "/add") + public Result add(@RequestBody AppComponent appComponent) { + Result result = new Result(); + appComponentService.save(appComponent); + return Result.success("添加成功!"); + } + + /** + * 编辑 + * + * @param appComponent + * @return + */ + @OperLog(operModul = "APP组件库管理", operType = "修改", operDesc = "编辑APP组件库信息") + @ApiOperation(value = "编辑APP组件库信息", notes = "编辑APP组件库信息", httpMethod = "POST") + @PostMapping(value = "/edit") + public Result edit(@RequestBody AppComponent appComponent) { + Result result = new Result(); + AppComponent appComponentEntity = appComponentService.getById(appComponent.getId()); + if (appComponentEntity == null) { + result.error500("未找到对应实体"); + } else { + boolean ok = appComponentService.updateById(appComponent); + if (ok) { + result.success("修改成功!"); + } else { + result.success("操作失败!"); + } + } + + return result; + } + + /** + * 通过id删除 + * + * @return + */ + @OperLog(operModul = "APP组件库管理", operType = "删除", operDesc = "删除APP组件库信息") + @ApiOperation(value = "删除APP组件库信息", notes = "删除APP组件库信息", httpMethod = "POST") + @ApiImplicitParam(name = "id", value = "APP组件库ID", paramType = "body", required = true, dataType = "Integer") + @PostMapping(value = "/delete") + public Result delete(@ApiIgnore @RequestBody AppComponent appComponent) { + Result result = new Result(); + AppComponent appComponentEntity = appComponentService.getById(appComponent.getId()); + if (appComponentEntity == null) { + result.error500("未找到对应实体"); + } else { + boolean ok = appComponentService.removeById(appComponent.getId()); + if (ok) { + result.success("删除成功!"); + } else { + result.success("操作失败!"); + } + } + return result; + } + + /** + * 批量删除 + * + * @return + */ + @OperLog(operModul = "APP组件库管理", operType = "批量删除", operDesc = "批量删除APP组件库信息") + @ApiOperation(value = "批量删除APP组件库信息", notes = "批量删除APP组件库信息", httpMethod = "POST") + @ApiImplicitParam(name = "ids", value = "APP组件库ID字符串", paramType = "body", required = true, dataType = "String") + @PostMapping(value = "/deleteBatch") + public Result deleteBatch(@ApiIgnore @RequestBody Map map) { + Result result = new Result(); + String ids = MapUtils.getString(map, "ids"); + if (ids == null || "".equals(ids.trim())) { + result.error500("参数不识别!"); + } else { + this.appComponentService.removeByIds(Arrays.asList(ids.split(","))); + result.success("删除成功!"); + } + return result; + } + + /** + * 通过id查询 + * + * @return + */ + @OperLog(operModul = "APP组件库管理", operType = "查询", operDesc = "通过id查询APP组件库信息") + @ApiOperation(value = "通过id查询APP组件库信息", notes = "通过id查询APP组件库信息", httpMethod = "POST") + @ApiImplicitParam(name = "id", value = "APP组件库ID", paramType = "body", required = true, dataType = "Integer") + @PostMapping(value = "/queryById") + public Result queryById(@ApiIgnore @RequestBody AppComponent appComponentVo) { + Result result = new Result(); + AppComponent appComponent = appComponentService.getById(appComponentVo.getId()); + if (appComponent == null) { + result.error500("未找到对应实体"); + } else { + result.setResult(appComponent); + result.setSuccess(true); + } + return result; + } +} diff --git a/src/main/java/com/zhgd/xmgl/modules/basicdata/controller/AppComponentUserController.java b/src/main/java/com/zhgd/xmgl/modules/basicdata/controller/AppComponentUserController.java new file mode 100644 index 000000000..c8118d115 --- /dev/null +++ b/src/main/java/com/zhgd/xmgl/modules/basicdata/controller/AppComponentUserController.java @@ -0,0 +1,114 @@ +package com.zhgd.xmgl.modules.basicdata.controller; + +import com.zhgd.annotation.OperLog; +import com.zhgd.xmgl.modules.basicdata.entity.AppComponentAuth; +import com.zhgd.xmgl.modules.basicdata.entity.dto.AppComponentAuthDto; +import com.zhgd.xmgl.modules.basicdata.entity.vo.AppComponentAuthVo; +import com.zhgd.xmgl.util.PageUtil; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiImplicitParams; +import io.swagger.annotations.ApiOperation; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLDecoder; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import com.zhgd.jeecg.common.api.vo.Result; +import com.zhgd.jeecg.common.system.query.QueryGenerator; +import com.zhgd.jeecg.common.util.oConvertUtils; +import com.zhgd.xmgl.modules.basicdata.entity.AppComponentUser; +import com.zhgd.xmgl.modules.basicdata.service.IAppComponentUserService; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections.MapUtils; +import org.jeecgframework.poi.excel.ExcelImportUtil; +import org.jeecgframework.poi.excel.def.NormalExcelConstants; +import org.jeecgframework.poi.excel.entity.ExportParams; +import org.jeecgframework.poi.excel.entity.ImportParams; +import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; +import org.springframework.web.multipart.MultipartHttpServletRequest; +import org.springframework.web.servlet.ModelAndView; +import com.alibaba.fastjson.JSON; +import springfox.documentation.annotations.ApiIgnore; + + +/** + * @Title: Controller + * @Description: 用户自定义组件授权 + * @author: pengj + * @date: 2025-11-04 + * @version: V1.0 + */ +@RestController +@RequestMapping("/xmgl/appComponentUser") +@Slf4j +@Api(tags = "用户自定义组件授权管理") +public class AppComponentUserController { + @Autowired + private IAppComponentUserService appComponentUserService; + + /** + * 列表查询 + * + * @param appComponentUser + * @return + */ + @OperLog(operModul = "用户自定义组件授权管理", operType = "列表查询", operDesc = "获取当前用户的组件列表") + @ApiOperation(value = "获取当前用户的组件列表", notes = "获取当前用户的组件列表", httpMethod = "POST") + @PostMapping(value = "/getMyComponentList") + public Result> getMyComponentList(@RequestBody AppComponentUser appComponentUser) { + return Result.success(appComponentUserService.getMyComponentList(appComponentUser)); + } + + + /** + * 通过id删除 + * @return + */ + @OperLog(operModul = "用户自定义组件授权管理", operType = "删除", operDesc = "删除用户自定义组件授权信息") + @ApiOperation(value = "删除用户自定义组件授权信息", notes = "删除用户自定义组件授权信息" , httpMethod="POST") + @ApiImplicitParam(name = "id", value = "用户自定义组件授权ID", paramType = "body", required = true, dataType = "Integer") + @PostMapping(value = "/delete") + public Result delete(@ApiIgnore @RequestBody AppComponentUser appComponentUser) { + Result result = new Result(); + AppComponentUser appComponentUserEntity = appComponentUserService.getById(appComponentUser.getId()); + if(appComponentUserEntity == null) { + result.error500("未找到对应实体"); + }else { + boolean ok = appComponentUserService.removeById(appComponentUser.getId()); + if(ok) { + result.success("删除成功!"); + } else { + result.success("操作失败!"); + } + } + return result; + } + + /** + * 添加 + * + * @param appComponentUser + * @return + */ + @OperLog(operModul = "用户自定义组件授权管理", operType = "新增", operDesc = "添加用户自定义组件授权信息") + @ApiOperation(value = " 添加用户自定义组件授权信息", notes = "添加用户自定义组件授权信息", httpMethod = "POST") + @PostMapping(value = "/add") + public Result add(@RequestBody AppComponentUser appComponentUser) { + appComponentUserService.saveInfo(appComponentUser); + return Result.success("添加成功!"); + } +} diff --git a/src/main/java/com/zhgd/xmgl/modules/basicdata/controller/AppModuleUserController.java b/src/main/java/com/zhgd/xmgl/modules/basicdata/controller/AppModuleUserController.java new file mode 100644 index 000000000..fc9fab2d3 --- /dev/null +++ b/src/main/java/com/zhgd/xmgl/modules/basicdata/controller/AppModuleUserController.java @@ -0,0 +1,92 @@ +package com.zhgd.xmgl.modules.basicdata.controller; + +import com.zhgd.annotation.OperLog; +import com.zhgd.xmgl.modules.basicdata.entity.BaseModule; +import com.zhgd.xmgl.util.PageUtil; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiImplicitParams; +import io.swagger.annotations.ApiOperation; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLDecoder; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import com.zhgd.jeecg.common.api.vo.Result; +import com.zhgd.jeecg.common.system.query.QueryGenerator; +import com.zhgd.jeecg.common.util.oConvertUtils; +import com.zhgd.xmgl.modules.basicdata.entity.AppModuleUser; +import com.zhgd.xmgl.modules.basicdata.service.IAppModuleUserService; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections.MapUtils; +import org.jeecgframework.poi.excel.ExcelImportUtil; +import org.jeecgframework.poi.excel.def.NormalExcelConstants; +import org.jeecgframework.poi.excel.entity.ExportParams; +import org.jeecgframework.poi.excel.entity.ImportParams; +import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; +import org.springframework.web.multipart.MultipartHttpServletRequest; +import org.springframework.web.servlet.ModelAndView; +import com.alibaba.fastjson.JSON; +import springfox.documentation.annotations.ApiIgnore; + + +/** + * @Title: Controller + * @Description: APP常用应用 + * @author: pengj + * @date: 2025-11-05 + * @version: V1.0 + */ +@RestController +@RequestMapping("/xmgl/appModuleUser") +@Slf4j +@Api(tags = "APP常用应用管理") +public class AppModuleUserController { + @Autowired + private IAppModuleUserService appModuleUserService; + + + /** + * 列表查询 + * + * @return + */ + @OperLog(operModul = "APP常用应用管理", operType = "列表查询", operDesc = "获取当前账号的APP常用应用信息") + @ApiOperation(value = " 获取当前账号的APP常用应用信息", notes = "获取当前账号的APP常用应用信息", httpMethod = "POST") + @GetMapping(value = "/list") + public Result> queryList() { + return Result.success(appModuleUserService.queryList()); + } + + + /** + * 编辑 + * @param + * @return + */ + @OperLog(operModul = "权限管理",operType = "编辑用户查看的模块",operDesc = "编辑用户查看的模块") + @ApiOperation(value = "编辑模块-用户关联信息", notes = "编辑模块-用户关联信息" , httpMethod="POST") + @ApiImplicitParams({ + @ApiImplicitParam(name = "userId", value = "人员账号Id", paramType = "body", required = true, dataType = "String"), + @ApiImplicitParam(name = "moduleIdStr", value = "模块ID,多个时逗号分割", paramType = "body", required = true, dataType = "String"), + }) + @PostMapping(value = "/edit") + public Result edit(@RequestBody Map map) { + appModuleUserService.editBaseModuleUser(map); + return Result.ok(); + } + +} diff --git a/src/main/java/com/zhgd/xmgl/modules/basicdata/controller/CompanyController.java b/src/main/java/com/zhgd/xmgl/modules/basicdata/controller/CompanyController.java index 272632827..96697ff4c 100644 --- a/src/main/java/com/zhgd/xmgl/modules/basicdata/controller/CompanyController.java +++ b/src/main/java/com/zhgd/xmgl/modules/basicdata/controller/CompanyController.java @@ -8,6 +8,7 @@ import com.zhgd.jeecg.common.api.vo.Result; import com.zhgd.jeecg.common.mybatis.EntityMap; import com.zhgd.xmgl.modules.basicdata.entity.Company; import com.zhgd.xmgl.modules.basicdata.entity.SystemUser; +import com.zhgd.xmgl.modules.basicdata.entity.vo.CompanyProjectTreeVo; import com.zhgd.xmgl.modules.basicdata.entity.vo.GetOrgSnListVo; import com.zhgd.xmgl.modules.basicdata.service.ICompanyService; import com.zhgd.xmgl.modules.basicdata.service.ISystemUserService; @@ -20,10 +21,7 @@ import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections.MapUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import springfox.documentation.annotations.ApiIgnore; import java.util.HashMap; @@ -183,6 +181,13 @@ public class CompanyController { } + @ApiOperation(value = "获取企业项目树", notes = "获取企业项目树") + @GetMapping("/getCompanyProjectTree") + public Result> getCompanyProjectTree() { + return Result.success(companyService.getCompanyProjectTree()); + } + + /** * 接口新版废弃 * @@ -236,6 +241,7 @@ public class CompanyController { @ApiImplicitParam(name = "standardType", value = "是否查询标养室,0否,1是", paramType = "body", required = true, dataType = "String"), @ApiImplicitParam(name = "projectType", value = "是否展示,0否,1是", paramType = "body", required = true, dataType = "String"), @ApiImplicitParam(name = "showVideoNum", value = "是否展示(在线)监控数量,0否,1是", paramType = "body", required = false, dataType = "String"), + @ApiImplicitParam(name = "bulidStatus", value = "项目状态", paramType = "body", required = true, dataType = "String"), }) @PostMapping("/getComapnyStatisticsList") @PreAuthorize("@perm.hasSnAccess(#map['sn'])") @@ -243,6 +249,20 @@ public class CompanyController { return Result.success(companyService.getCompanyStatisticsList(map)); } + @ApiOperation(value = "APP统计企业下项目各项目统计", notes = "APP统计企业下项目各项目统计") + @ApiImplicitParams({ + @ApiImplicitParam(name = "sn", value = "公司sn", paramType = "body", required = true, dataType = "String"), + @ApiImplicitParam(name = "videoType", value = "查询类型,0无视频,1有视频", paramType = "body", required = true, dataType = "String"), + @ApiImplicitParam(name = "standardType", value = "是否查询标养室,0否,1是", paramType = "body", required = true, dataType = "String"), + @ApiImplicitParam(name = "projectType", value = "是否展示,0否,1是", paramType = "body", required = true, dataType = "String"), + @ApiImplicitParam(name = "bulidStatus", value = "项目状态", paramType = "body", required = true, dataType = "String"), + }) + @PostMapping("/getAppComapnyStatisticsList") + @PreAuthorize("@perm.hasSnAccess(#map['sn'])") + public Result> getAppComapnyStatisticsList(@RequestBody Map map) { + return Result.success(companyService.getAppCompanyStatisticsList(map)); + } + @ApiOperation(value = "供应商选择审批组织(所有企业)", notes = "供应商选择审批组织(所有企业)") @PostMapping("/getComapnyStatisticsListBySupplier") public Result> getComapnyStatisticsListBySupplier(@RequestBody Map map) { diff --git a/src/main/java/com/zhgd/xmgl/modules/basicdata/controller/ExternalCallBackController.java b/src/main/java/com/zhgd/xmgl/modules/basicdata/controller/ExternalCallBackController.java index 302fefdbc..de695e640 100644 --- a/src/main/java/com/zhgd/xmgl/modules/basicdata/controller/ExternalCallBackController.java +++ b/src/main/java/com/zhgd/xmgl/modules/basicdata/controller/ExternalCallBackController.java @@ -3,12 +3,17 @@ package com.zhgd.xmgl.modules.basicdata.controller; import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.collection.CollUtil; import cn.hutool.core.convert.Convert; +import cn.xuyanwu.spring.file.storage.FileInfo; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.dahuatech.hutool.json.JSONObject; import com.dahuatech.icc.model.event.eventSubcribe.ReceiveMsgVO; import com.dahuatech.icc.oauth.model.v202010.GeneralResponse; import com.gexin.fastjson.JSON; import com.gexin.fastjson.TypeReference; +import com.zhgd.jeecg.common.execption.OpenAlertException; +import com.zhgd.xmgl.async.AsyncAiAnalyse; import com.zhgd.xmgl.async.AsyncProjectWork; import com.zhgd.xmgl.call.IccCarCall; import com.zhgd.xmgl.call.IccWorkerCall; @@ -17,12 +22,20 @@ import com.zhgd.xmgl.call.api.WorkerManufacturer; import com.zhgd.xmgl.call.factory.CarManufacturerFactory; import com.zhgd.xmgl.call.factory.WorkerManufacturerFactory; import com.zhgd.xmgl.call.util.IccHttpUtil; +import com.zhgd.xmgl.constant.Cts; import com.zhgd.xmgl.modules.car.entity.CarCamera; import com.zhgd.xmgl.modules.car.entity.CarInfo; import com.zhgd.xmgl.modules.car.entity.CarPassRecord; import com.zhgd.xmgl.modules.car.service.ICarCameraService; import com.zhgd.xmgl.modules.car.service.impl.CarInfoServiceImpl; import com.zhgd.xmgl.modules.car.service.impl.CarPassRecordServiceImpl; +import com.zhgd.xmgl.modules.project.entity.ProjectUfaceConfig; +import com.zhgd.xmgl.modules.project.mapper.ProjectUfaceConfigMapper; +import com.zhgd.xmgl.modules.video.entity.AiAnalyseHardWareAlarmRecord; +import com.zhgd.xmgl.modules.video.entity.AiAnalyseHardWareRecord; +import com.zhgd.xmgl.modules.video.entity.VideoItem; +import com.zhgd.xmgl.modules.video.mapper.AiAnalyseHardWareAlarmRecordMapper; +import com.zhgd.xmgl.modules.video.mapper.AiAnalyseHardWareRecordMapper; import com.zhgd.xmgl.modules.worker.entity.UfaceDev; import com.zhgd.xmgl.modules.worker.entity.WorkerInfo; import com.zhgd.xmgl.modules.worker.service.IUfaceDevService; @@ -32,9 +45,13 @@ import com.zhgd.xmgl.modules.worker.service.impl.WorkerAttendanceServiceImpl; import com.zhgd.xmgl.modules.xz.entity.XzHikvisionSync; import com.zhgd.xmgl.modules.xz.service.impl.XzHikvisionSyncServiceImpl; import com.zhgd.xmgl.util.AsyncTaskUtil; +import com.zhgd.xmgl.util.MapUtil; +import com.zhgd.xmgl.util.MessageUtil; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections.MapUtils; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.context.annotation.Lazy; @@ -93,6 +110,21 @@ public class ExternalCallBackController { @Autowired @Lazy private IWorkerAttendanceService workerAttendanceService; + @Lazy + @Resource + private AiAnalyseHardWareAlarmRecordMapper aiAnalyseHardWareAlarmRecordMapper; + + @Lazy + @Resource + private AiAnalyseHardWareRecordMapper aiAnalyseHardWareRecordMapper; + + @Lazy + @Autowired + private AsyncAiAnalyse asyncAiAnalyse; + + @Lazy + @Autowired + private ProjectUfaceConfigMapper projectUfaceConfigMapper; @ApiOperation(value = "icc订阅回调接口", notes = "icc订阅回调接口", httpMethod = "POST") @PostMapping(value = "/icc/subscribeCall") @@ -124,6 +156,14 @@ public class ExternalCallBackController { log.info("实时刷卡记录推送事件:{}", param); saveWorkerAttendance(alarmRecordEventExt); } + } else { + JSONObject info = receiveMsgVO.getInfo(); + List alarms = new ArrayList<>(); + if (alarms.contains(MapUtils.getString(info, "alarmType"))) { + //AI算法推送事件 + log.info("AI算法推送事件:{}", param); + saveAIRecord(info); + } } } JSONObject jsonObjectRt = new JSONObject(); @@ -132,6 +172,41 @@ public class ExternalCallBackController { return jsonObjectRt; } + /** + * 保存icc门禁记录 + * + * @param obj + */ + private void saveAIRecord(JSONObject obj) { + log.info("调用AiAnalyseHardWareAlarmRecordServiceImpl#saveAiAnalyseHardWareAlarmRecord方法,参数为:{}", obj); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(AiAnalyseHardWareRecord::getHardwareId, MapUtils.getString(obj, "deviceCode")); + AiAnalyseHardWareRecord aiAnalyseHardWareRecord = aiAnalyseHardWareRecordMapper.selectOne(queryWrapper); + if (aiAnalyseHardWareRecord == null) { + throw new OpenAlertException(MessageUtil.get("EquipmentNumIncorrectErr")); + } + AiAnalyseHardWareAlarmRecord aiAnalyseHardWareAlarmRecord = new AiAnalyseHardWareAlarmRecord(); + aiAnalyseHardWareAlarmRecord.setCreateTime(MapUtils.getString(obj, "alarmDate")); + aiAnalyseHardWareAlarmRecord.setAlarmType(MapUtils.getInteger(obj, "alarmType")); + aiAnalyseHardWareAlarmRecord.setHardwareId(aiAnalyseHardWareRecord.getHardwareId()); + aiAnalyseHardWareAlarmRecord.setHardwareName(aiAnalyseHardWareRecord.getHardwareName()); + aiAnalyseHardWareAlarmRecord.setLocation(MapUtils.getString(obj, "deviceName")); + MapUtils.getString(obj, "deviceName"); + aiAnalyseHardWareAlarmRecord.setProjectSn(aiAnalyseHardWareRecord.getProjectSn()); + aiAnalyseHardWareAlarmRecord.setStatus(1); + try { + ProjectUfaceConfig projectUfaceConfig = projectUfaceConfigMapper.selectOne(Wrappers.lambdaQuery() + .eq(ProjectUfaceConfig::getProjectSn, aiAnalyseHardWareRecord.getProjectSn())); + File file = IccHttpUtil.downloadOssFile(MapUtils.getString(obj, "alarmPicture"), projectUfaceConfig); + aiAnalyseHardWareAlarmRecord.setImageUrl(Optional.ofNullable(file).map(File::getName).orElse(null)); + } catch (Exception e) { + log.error("icc回调AI预警下载图片失败", e); + } + aiAnalyseHardWareAlarmRecordMapper.insert(aiAnalyseHardWareAlarmRecord); + //将数据通过MQTT转发到前台 + asyncAiAnalyse.sendAiAnalyse(aiAnalyseHardWareAlarmRecord, Cts.PROJECT_LEVEL); + } + /** * 保存icc门禁记录 * diff --git a/src/main/java/com/zhgd/xmgl/modules/basicdata/controller/SystemUserController.java b/src/main/java/com/zhgd/xmgl/modules/basicdata/controller/SystemUserController.java index 9671aa4d1..5c0ff3e17 100644 --- a/src/main/java/com/zhgd/xmgl/modules/basicdata/controller/SystemUserController.java +++ b/src/main/java/com/zhgd/xmgl/modules/basicdata/controller/SystemUserController.java @@ -190,6 +190,15 @@ public class SystemUserController { return Result.success(systemUserService.getProjectChildernSystemUserList(map)); } + @ApiOperation(value = "查找账号列表,根据sn", notes = "查找账号列表,根据sn", httpMethod = "POST") + @ApiImplicitParams({ + @ApiImplicitParam(name = "sn", required = true, value = "sn", paramType = "body"), + }) + @PostMapping(value = "/getSystemUserList") + public Result> getSystemUserList(@RequestBody Map map) { + return Result.success(systemUserService.getSystemUserList(map)); + } + @OperLog(operModul = "账号管理", operType = "分页查找项目子账号列表", operDesc = "分页查找项目子账号列表") @ApiOperation(value = "分页查找项目子账号列表", notes = "分页查找项目子账号列表", httpMethod = "POST") @ApiImplicitParams({ diff --git a/src/main/java/com/zhgd/xmgl/modules/basicdata/entity/AppComponent.java b/src/main/java/com/zhgd/xmgl/modules/basicdata/entity/AppComponent.java new file mode 100644 index 000000000..0ef6d2879 --- /dev/null +++ b/src/main/java/com/zhgd/xmgl/modules/basicdata/entity/AppComponent.java @@ -0,0 +1,74 @@ +package com.zhgd.xmgl.modules.basicdata.entity; + +import java.io.Serializable; +import java.util.Date; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.springframework.format.annotation.DateTimeFormat; +import org.jeecgframework.poi.excel.annotation.Excel; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +/** + * @Description: APP组件库 + * @author: pengj + * @date: 2025-11-04 + * @version: V1.0 + */ +@Data +@TableName("app_component") +@ApiModel(value = "AppComponent实体类", description = "AppComponent") +public class AppComponent implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * APP组件授权ID + */ + @TableId(type = IdType.ASSIGN_ID) + @ApiModelProperty(value = "APP组件ID") + private Long id; + /** + * 组件名称 + */ + @Excel(name = "组件名称", width = 15) + @ApiModelProperty(value = "组件名称") + private String name; + /** + * 组件标识 + */ + @Excel(name = "组件标识", width = 15) + @ApiModelProperty(value = "组件标识") + private String code; + /** + * 描述 + */ + @Excel(name = "描述", width = 15) + @ApiModelProperty(value = "描述") + private String remark; + /** + * 组件类型(1:企业;2:项目) + */ + @Excel(name = "组件类型(1:企业;2:项目)", width = 15) + @ApiModelProperty(value = "组件类型(1:企业;2:项目)") + private String type; + /** + * 创建时间 + */ + @Excel(name = "创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "创建时间") + private Date createTime; + /** + * 更新时间 + */ + @Excel(name = "更新时间", width = 20, format = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "更新时间") + private Date updateTime; +} diff --git a/src/main/java/com/zhgd/xmgl/modules/basicdata/entity/AppComponentAuth.java b/src/main/java/com/zhgd/xmgl/modules/basicdata/entity/AppComponentAuth.java new file mode 100644 index 000000000..73dd3b8f1 --- /dev/null +++ b/src/main/java/com/zhgd/xmgl/modules/basicdata/entity/AppComponentAuth.java @@ -0,0 +1,86 @@ +package com.zhgd.xmgl.modules.basicdata.entity; + +import java.io.Serializable; +import java.util.Date; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.springframework.format.annotation.DateTimeFormat; +import org.jeecgframework.poi.excel.annotation.Excel; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +/** + * @Description: APP组件授权信息 + * @author: pengj + * @date: 2025-11-04 + * @version: V1.0 + */ +@Data +@TableName("app_component_auth") +@ApiModel(value = "AppComponentAuth实体类", description = "AppComponentAuth") +public class AppComponentAuth implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * APP组件ID + */ + @TableId(type = IdType.ASSIGN_ID) + @ApiModelProperty(value = "APP组件授权ID") + private Long id; + /** + * 组件自定义名称 + */ + @Excel(name = "组件自定义名称", width = 15) + @ApiModelProperty(value = "组件自定义名称") + private String customizeName; + /** + * 组件ID + */ + @Excel(name = "组件ID", width = 15) + @ApiModelProperty(value = "组件ID") + private Long componentId; + /** + * 排序 + */ + @Excel(name = "排序", width = 15) + @ApiModelProperty(value = "排序") + private Integer sort; + /** + * 企业/项目SN + */ + @Excel(name = "企业/项目SN", width = 15) + @ApiModelProperty(value = "企业/项目SN") + private String sn; + /** + * 类型(1:企业;2:项目) + */ + @Excel(name = "类型(1:企业;2:项目)", width = 15) + @ApiModelProperty(value = "类型(1:企业;2:项目)") + private Integer type; + /** + * 授权类型(1:企业;2:项目) + */ + @Excel(name = "授权类型(1:企业;2:项目)", width = 15) + @ApiModelProperty(value = "授权类型(1:企业;2:项目)") + private Integer authType; + /** + * 创建时间 + */ + @Excel(name = "创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "创建时间") + private Date createTime; + /** + * 更新时间 + */ + @Excel(name = "更新时间", width = 20, format = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "更新时间") + private Date updateTime; +} diff --git a/src/main/java/com/zhgd/xmgl/modules/basicdata/entity/AppComponentUser.java b/src/main/java/com/zhgd/xmgl/modules/basicdata/entity/AppComponentUser.java new file mode 100644 index 000000000..6d64d8749 --- /dev/null +++ b/src/main/java/com/zhgd/xmgl/modules/basicdata/entity/AppComponentUser.java @@ -0,0 +1,60 @@ +package com.zhgd.xmgl.modules.basicdata.entity; + +import java.io.Serializable; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import org.jeecgframework.poi.excel.annotation.Excel; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +/** + * @Description: 用户自定义组件授权 + * @author: pengj + * @date: 2025-11-04 + * @version: V1.0 + */ +@Data +@TableName("app_component_user") +@ApiModel(value = "appComponentUser实体类", description = "appComponentUser") +public class AppComponentUser implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 用户APP组件授权ID + */ + @TableId(type = IdType.ASSIGN_ID) + @ApiModelProperty(value = "用户APP组件授权ID") + private Long id; + /** + * 用户ID + */ + @Excel(name = "用户ID", width = 15) + @ApiModelProperty(value = "用户ID") + private Long userId; + /** + * 企业/项目SN + */ + @Excel(name = "企业/项目SN", width = 15) + @ApiModelProperty(value = "企业/项目SN") + private String sn; + /** + * 授权类型(1:企业;2:项目) + */ + @Excel(name = "授权类型(1:企业;2:项目)", width = 15) + @ApiModelProperty(value = "授权类型(1:企业;2:项目)") + private Integer type; + /** + * 组件ID(多个逗号隔开) + */ + @Excel(name = "组件ID(多个逗号隔开)", width = 15) + @ApiModelProperty(value = "组件ID(多个逗号隔开)") + private String componentId; + + @TableField(exist = false) + @ApiModelProperty(value = "当无个人组件时是否返回默认全部") + private Integer defaultFlag; +} diff --git a/src/main/java/com/zhgd/xmgl/modules/basicdata/entity/AppModuleUser.java b/src/main/java/com/zhgd/xmgl/modules/basicdata/entity/AppModuleUser.java new file mode 100644 index 000000000..06cd6291e --- /dev/null +++ b/src/main/java/com/zhgd/xmgl/modules/basicdata/entity/AppModuleUser.java @@ -0,0 +1,46 @@ +package com.zhgd.xmgl.modules.basicdata.entity; + +import java.io.Serializable; +import java.util.Date; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.springframework.format.annotation.DateTimeFormat; +import org.jeecgframework.poi.excel.annotation.Excel; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +/** + * @Description: APP常用应用 + * @author: pengj + * @date: 2025-11-05 + * @version: V1.0 + */ +@Data +@TableName("app_module_user") +@ApiModel(value = "AppModuleUser实体类", description = "AppModuleUser") +public class AppModuleUser implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * id + */ + @TableId(type = IdType.ASSIGN_ID) + @ApiModelProperty(value = "id") + private Long id; + /** + * 人员ID + */ + @Excel(name = "人员ID", width = 15) + @ApiModelProperty(value = "人员ID") + private Long userId; + /** + * 模块ID + */ + @Excel(name = "模块ID", width = 15) + @ApiModelProperty(value = "模块ID") + private Long moduleId; +} diff --git a/src/main/java/com/zhgd/xmgl/modules/basicdata/entity/BaseModule.java b/src/main/java/com/zhgd/xmgl/modules/basicdata/entity/BaseModule.java index 367150fad..63c34fb4d 100644 --- a/src/main/java/com/zhgd/xmgl/modules/basicdata/entity/BaseModule.java +++ b/src/main/java/com/zhgd/xmgl/modules/basicdata/entity/BaseModule.java @@ -95,6 +95,9 @@ public class BaseModule implements Serializable { @ApiModelProperty(value = "排序下标") private java.lang.String sortIndex; + @ApiModelProperty(value = "APP的logo路径") + private java.lang.String appLogo; + @TableField(exist = false) @ApiModelProperty(value = "模块所属菜单") private List menuList; diff --git a/src/main/java/com/zhgd/xmgl/modules/basicdata/entity/dto/AppComponentAuthDto.java b/src/main/java/com/zhgd/xmgl/modules/basicdata/entity/dto/AppComponentAuthDto.java new file mode 100644 index 000000000..9ea433606 --- /dev/null +++ b/src/main/java/com/zhgd/xmgl/modules/basicdata/entity/dto/AppComponentAuthDto.java @@ -0,0 +1,22 @@ +package com.zhgd.xmgl.modules.basicdata.entity.dto; + +import com.zhgd.xmgl.modules.basicdata.entity.AppComponentAuth; +import com.zhgd.xmgl.modules.basicdata.entity.vo.AppComponentAuthVo; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.jeecgframework.poi.excel.annotation.Excel; + +import java.util.List; + +@Data +public class AppComponentAuthDto extends AppComponentAuth { + + @ApiModelProperty(value = "组件名称") + private String name; + + @ApiModelProperty(value = "组件标识") + private String code; + + @ApiModelProperty(value = "描述") + private String remark; +} diff --git a/src/main/java/com/zhgd/xmgl/modules/basicdata/entity/vo/AppComponentAuthVo.java b/src/main/java/com/zhgd/xmgl/modules/basicdata/entity/vo/AppComponentAuthVo.java new file mode 100644 index 000000000..41985f40d --- /dev/null +++ b/src/main/java/com/zhgd/xmgl/modules/basicdata/entity/vo/AppComponentAuthVo.java @@ -0,0 +1,25 @@ +package com.zhgd.xmgl.modules.basicdata.entity.vo; + +import com.zhgd.xmgl.modules.basicdata.entity.AppComponent; +import com.zhgd.xmgl.modules.basicdata.entity.AppComponentAuth; +import com.zhgd.xmgl.modules.basicdata.entity.dto.ScreenAuthDto; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.List; + +@Data +public class AppComponentAuthVo { + + @ApiModelProperty(value = "类型(1:企业;2:项目)") + private Integer type; + + @ApiModelProperty(value = "授权类型(1:企业;2:项目)") + private Integer authType; + + @ApiModelProperty(value = "对应唯一标识SN") + private String uniqueFlag; + + @ApiModelProperty(value = "组件信息") + List componentAuth; +} diff --git a/src/main/java/com/zhgd/xmgl/modules/basicdata/entity/vo/CompanyProjectTreeVo.java b/src/main/java/com/zhgd/xmgl/modules/basicdata/entity/vo/CompanyProjectTreeVo.java new file mode 100644 index 000000000..ed1e393cc --- /dev/null +++ b/src/main/java/com/zhgd/xmgl/modules/basicdata/entity/vo/CompanyProjectTreeVo.java @@ -0,0 +1,31 @@ +package com.zhgd.xmgl.modules.basicdata.entity.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.List; + +@Data +public class CompanyProjectTreeVo { + + @ApiModelProperty(value = "主键ID") + private Long id; + + @ApiModelProperty(value = "父ID") + private Long parentId; + + @ApiModelProperty(value = "唯一标识") + private String sn; + + @ApiModelProperty(value = "1总部,2区域,3城市,4项目部, 5项目") + private Integer type; + + @ApiModelProperty(value = "名称") + private String name; + + @ApiModelProperty(value = "顶级SN") + private String headquartersSn; + + @ApiModelProperty(value = "子级") + private List childrenList; +} diff --git a/src/main/java/com/zhgd/xmgl/modules/basicdata/mapper/AppComponentAuthMapper.java b/src/main/java/com/zhgd/xmgl/modules/basicdata/mapper/AppComponentAuthMapper.java new file mode 100644 index 000000000..746561f3c --- /dev/null +++ b/src/main/java/com/zhgd/xmgl/modules/basicdata/mapper/AppComponentAuthMapper.java @@ -0,0 +1,23 @@ +package com.zhgd.xmgl.modules.basicdata.mapper; + +import java.util.List; + +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.toolkit.Constants; +import com.zhgd.xmgl.modules.basicdata.entity.dto.AppComponentAuthDto; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import com.zhgd.xmgl.modules.basicdata.entity.AppComponentAuth; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + * @Description: APP组件授权信息 + * @author: pengj + * @date: 2025-11-04 + * @version: V1.0 + */ +@Mapper +public interface AppComponentAuthMapper extends BaseMapper { + + List getList(@Param(Constants.WRAPPER) Wrapper wrapper); +} diff --git a/src/main/java/com/zhgd/xmgl/modules/basicdata/mapper/AppComponentMapper.java b/src/main/java/com/zhgd/xmgl/modules/basicdata/mapper/AppComponentMapper.java new file mode 100644 index 000000000..f6606c791 --- /dev/null +++ b/src/main/java/com/zhgd/xmgl/modules/basicdata/mapper/AppComponentMapper.java @@ -0,0 +1,19 @@ +package com.zhgd.xmgl.modules.basicdata.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import com.zhgd.xmgl.modules.basicdata.entity.AppComponent; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + * @Description: APP组件库 + * @author: pengj + * @date: 2025-11-04 + * @version: V1.0 + */ +@Mapper +public interface AppComponentMapper extends BaseMapper { + +} diff --git a/src/main/java/com/zhgd/xmgl/modules/basicdata/mapper/AppComponentUserMapper.java b/src/main/java/com/zhgd/xmgl/modules/basicdata/mapper/AppComponentUserMapper.java new file mode 100644 index 000000000..49ddac741 --- /dev/null +++ b/src/main/java/com/zhgd/xmgl/modules/basicdata/mapper/AppComponentUserMapper.java @@ -0,0 +1,16 @@ +package com.zhgd.xmgl.modules.basicdata.mapper; + +import org.apache.ibatis.annotations.Mapper; +import com.zhgd.xmgl.modules.basicdata.entity.AppComponentUser; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + * @Description: 用户自定义组件授权 + * @author: pengj + * @date: 2025-11-04 + * @version: V1.0 + */ +@Mapper +public interface AppComponentUserMapper extends BaseMapper { + +} diff --git a/src/main/java/com/zhgd/xmgl/modules/basicdata/mapper/AppModuleUserMapper.java b/src/main/java/com/zhgd/xmgl/modules/basicdata/mapper/AppModuleUserMapper.java new file mode 100644 index 000000000..42a258350 --- /dev/null +++ b/src/main/java/com/zhgd/xmgl/modules/basicdata/mapper/AppModuleUserMapper.java @@ -0,0 +1,19 @@ +package com.zhgd.xmgl.modules.basicdata.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import com.zhgd.xmgl.modules.basicdata.entity.AppModuleUser; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + * @Description: APP常用应用 + * @author: pengj + * @date: 2025-11-05 + * @version: V1.0 + */ +@Mapper +public interface AppModuleUserMapper extends BaseMapper { + +} diff --git a/src/main/java/com/zhgd/xmgl/modules/basicdata/mapper/CompanyMapper.java b/src/main/java/com/zhgd/xmgl/modules/basicdata/mapper/CompanyMapper.java index 898038ce4..18c8f48b2 100644 --- a/src/main/java/com/zhgd/xmgl/modules/basicdata/mapper/CompanyMapper.java +++ b/src/main/java/com/zhgd/xmgl/modules/basicdata/mapper/CompanyMapper.java @@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.wflow.bean.vo.OrgTreeVo; import com.zhgd.jeecg.common.mybatis.EntityMap; import com.zhgd.xmgl.modules.basicdata.entity.Company; +import com.zhgd.xmgl.modules.basicdata.entity.SystemUser; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Select; @@ -30,6 +31,9 @@ public interface CompanyMapper extends BaseMapper { */ List selectCompanyPage(Page page, @Param("param") Map map); + + List getSystemUserList(Map map); + /** * 分层获取一级二级企业列表 * diff --git a/src/main/java/com/zhgd/xmgl/modules/basicdata/mapper/xml/AppComponentAuthMapper.xml b/src/main/java/com/zhgd/xmgl/modules/basicdata/mapper/xml/AppComponentAuthMapper.xml new file mode 100644 index 000000000..c1cd9e8dd --- /dev/null +++ b/src/main/java/com/zhgd/xmgl/modules/basicdata/mapper/xml/AppComponentAuthMapper.xml @@ -0,0 +1,10 @@ + + + + + + \ No newline at end of file diff --git a/src/main/java/com/zhgd/xmgl/modules/basicdata/mapper/xml/AppComponentMapper.xml b/src/main/java/com/zhgd/xmgl/modules/basicdata/mapper/xml/AppComponentMapper.xml new file mode 100644 index 000000000..dd348d153 --- /dev/null +++ b/src/main/java/com/zhgd/xmgl/modules/basicdata/mapper/xml/AppComponentMapper.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/src/main/java/com/zhgd/xmgl/modules/basicdata/mapper/xml/AppComponentUserMapper.xml b/src/main/java/com/zhgd/xmgl/modules/basicdata/mapper/xml/AppComponentUserMapper.xml new file mode 100644 index 000000000..0363e9529 --- /dev/null +++ b/src/main/java/com/zhgd/xmgl/modules/basicdata/mapper/xml/AppComponentUserMapper.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/src/main/java/com/zhgd/xmgl/modules/basicdata/mapper/xml/AppModuleUserMapper.xml b/src/main/java/com/zhgd/xmgl/modules/basicdata/mapper/xml/AppModuleUserMapper.xml new file mode 100644 index 000000000..5533bf9d7 --- /dev/null +++ b/src/main/java/com/zhgd/xmgl/modules/basicdata/mapper/xml/AppModuleUserMapper.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/src/main/java/com/zhgd/xmgl/modules/basicdata/mapper/xml/CompanyMapper.xml b/src/main/java/com/zhgd/xmgl/modules/basicdata/mapper/xml/CompanyMapper.xml index cb79daa69..d7194c808 100644 --- a/src/main/java/com/zhgd/xmgl/modules/basicdata/mapper/xml/CompanyMapper.xml +++ b/src/main/java/com/zhgd/xmgl/modules/basicdata/mapper/xml/CompanyMapper.xml @@ -49,6 +49,44 @@ AND a.headquarters_sn = #{headquartersSn} + + - select * from (select et.*, s.name as subjectName, u.real_name createByName, cc.course_name courseName, pp.name paperName from exam_train et + select * from (select et.*, s.name as subjectName, u.real_name createByName, cc.course_name courseName, cc.cover_img coverImg, pp.name paperName from exam_train et left join exam_subject s on et.subject_id = s.id left join exam_course cc on et.course_id = cc.id left join exam_paper pp on et.exam_paper_id = pp.id diff --git a/src/main/java/com/zhgd/xmgl/modules/mechanicalequipmentposition/controller/MechanicalEquipmentPositionDataController.java b/src/main/java/com/zhgd/xmgl/modules/mechanicalequipmentposition/controller/MechanicalEquipmentPositionDataController.java index 13732e9a8..34384a936 100644 --- a/src/main/java/com/zhgd/xmgl/modules/mechanicalequipmentposition/controller/MechanicalEquipmentPositionDataController.java +++ b/src/main/java/com/zhgd/xmgl/modules/mechanicalequipmentposition/controller/MechanicalEquipmentPositionDataController.java @@ -23,6 +23,7 @@ import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections.MapUtils; import org.simpleframework.xml.core.Validate; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Lazy; import org.springframework.web.bind.annotation.*; import springfox.documentation.annotations.ApiIgnore; @@ -48,6 +49,8 @@ public class MechanicalEquipmentPositionDataController { @Lazy @Autowired private IMockMechanicalEquipmentPositionDataConfigService mockMechanicalEquipmentPositionDataConfigService; + @Value("${shantuiAesSecret:}") + private String shantuiAesSecret; /** * 分页列表查询 @@ -239,4 +242,5 @@ public class MechanicalEquipmentPositionDataController { return Result.ok(); } + } diff --git a/src/main/java/com/zhgd/xmgl/modules/mechanicalequipmentposition/controller/ShantuiController.java b/src/main/java/com/zhgd/xmgl/modules/mechanicalequipmentposition/controller/ShantuiController.java new file mode 100644 index 000000000..e7b8e9320 --- /dev/null +++ b/src/main/java/com/zhgd/xmgl/modules/mechanicalequipmentposition/controller/ShantuiController.java @@ -0,0 +1,60 @@ +package com.zhgd.xmgl.modules.mechanicalequipmentposition.controller; + +import cn.hutool.core.convert.Convert; +import cn.hutool.core.date.DateUtil; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.zhgd.xmgl.modules.mechanicalequipmentposition.entity.MechanicalEquipmentPositionData; +import com.zhgd.xmgl.modules.mechanicalequipmentposition.entity.dto.ShantuiMechanicalEquipmentMsg; +import com.zhgd.xmgl.modules.mechanicalequipmentposition.service.IMechanicalEquipmentPositionDataService; +import com.zhgd.xmgl.util.shantui.AESUtil; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections.MapUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import springfox.documentation.annotations.ApiIgnore; + +import java.util.HashMap; +import java.util.Objects; + +@RestController +@RequestMapping("/") +@Slf4j +@Api(tags = "山推相关Api") +public class ShantuiController { + @Autowired + private IMechanicalEquipmentPositionDataService mechanicalEquipmentPositionDataService; + @Value("${shantuiAesSecret:}") + private String shantuiAesSecret; + + @ApiOperation(value = "山推添加机械设备定位-实时和报警数据信息", notes = "山推添加机械设备定位-实时和报警数据信息", httpMethod = "POST") + @PostMapping(value = "/notice/push") + public String addDataBySt(@ApiIgnore @RequestBody HashMap param) { + log.debug("山推添加机械设备定位-实时和报警数据信息:{}", JSON.toJSONString(param)); + try { + String cipher = MapUtils.getString(param, "cipher"); + String decrypt = AESUtil.decrypt(cipher, shantuiAesSecret); + ShantuiMechanicalEquipmentMsg equipmentMsg = JSONObject.parseObject(decrypt, ShantuiMechanicalEquipmentMsg.class); + ShantuiMechanicalEquipmentMsg.StaticAttr staticAttr = equipmentMsg.getStaticAttr(); + MechanicalEquipmentPositionData positionData = new MechanicalEquipmentPositionData(); + positionData.setDevSn(staticAttr.getDeviceCode()); + ShantuiMechanicalEquipmentMsg.DynamicAttr dynamicAttr = equipmentMsg.getDynamicAttr(); + positionData.setLatitude(Convert.toDouble(dynamicAttr.getLatitude())); + positionData.setLongitude(Convert.toDouble(dynamicAttr.getLongitude())); + positionData.setUploadTime(DateUtil.parse(equipmentMsg.getTimedetail(), "yyyyMMddHHmmssSSS")); + positionData.setSpeed(Convert.toDouble(dynamicAttr.getGps_speed())); + positionData.setWorkStatus(Objects.equals(dynamicAttr.getAcc_flag(), "0") ? 2 : 1); + positionData.setMileage(Convert.toDouble(dynamicAttr.getTotal_miles())); + mechanicalEquipmentPositionDataService.add(positionData); + } catch (Exception e) { + return "{\"code\":1, \"msg\":\"" + e.getMessage() + "\"}"; + } + return "{\"code\":0, \"msg\":\"success\"}"; + } +} diff --git a/src/main/java/com/zhgd/xmgl/modules/mechanicalequipmentposition/entity/dto/ShantuiMechanicalEquipmentMsg.java b/src/main/java/com/zhgd/xmgl/modules/mechanicalequipmentposition/entity/dto/ShantuiMechanicalEquipmentMsg.java new file mode 100644 index 000000000..9a16ec72e --- /dev/null +++ b/src/main/java/com/zhgd/xmgl/modules/mechanicalequipmentposition/entity/dto/ShantuiMechanicalEquipmentMsg.java @@ -0,0 +1,79 @@ +package com.zhgd.xmgl.modules.mechanicalequipmentposition.entity.dto; + +import lombok.Data; +import java.util.List; + +@Data +public class ShantuiMechanicalEquipmentMsg { + private String tid; + private String protocolCode; + private String cmdCode; + private String commSign; + private String transactionID; + private String version; + private String timedetail; + private Integer did; + + private StaticAttr staticAttr; + private DynamicAttr dynamicAttr; + + @Data + public static class StaticAttr { + private String deviceType; + private String terminalNo; + private String productId; + private String commSign; + private String deviceCode; + private String deviceName; + private String tid; + private String iccid; + private String createTime; + private String deviceSeries; + private String deviceModel; + private String id; + private String simNo; + private String dataSource; + private String did; + } + + @Data + public static class DynamicAttr { + private String timedetail; + private String serial_no; + private String subversion; + private String hardware_version; + private String out_sensor_oil_height_real; + private String out_sensor_oil_height; + private String gps_valid_flag; + private String gps_lat_flag; + private String gps_long_flag; + private String gps_connect_flag; + private String longitude; + private String latitude; + private String acc_flag; + private String out_voltage; + private String inner_voltage; + private String gps_speed; + private String gps_direction; + private String gps_height_mm; + private String today_hours; + private String total_hours; + private String today_miles; + private String total_miles; + private String engine_working_hours; + private String today_fuel_consume; + private String wake_up_flag; + private String row_vibrate_data; + private String column_vibrate_data; + private String rtk_positioning_mode; + private String g_sensor_temperature; + private String acceleration_x; + private String acceleration_y; + private String acceleration_z; + private String fuel_select_canid_count; + private List fuel_select_canid_list; + private String hour_select_canid_count; + private List hour_select_canid_list; + private String firmware_version_full; + } +} diff --git a/src/main/java/com/zhgd/xmgl/modules/project/controller/ProjectController.java b/src/main/java/com/zhgd/xmgl/modules/project/controller/ProjectController.java index b60274bf7..aa6891a7d 100644 --- a/src/main/java/com/zhgd/xmgl/modules/project/controller/ProjectController.java +++ b/src/main/java/com/zhgd/xmgl/modules/project/controller/ProjectController.java @@ -491,4 +491,12 @@ public class ProjectController { public Result> selectTreeProjectVideoList(@RequestBody HashMap map) { return Result.success(projectService.selectTreeProjectVideoList(map)); } + @OperLog(operModul = "项目管理", operType = "查询", operDesc = "查询企业下所有项目的类型统计") + @ApiOperation(value = "查询企业下所有项目的类型统计", notes = "查询企业下所有项目的类型统计") + @ApiImplicitParam(name = "companySn", value = "企业SN", paramType = "query", required = true, dataType = "String") + @PostMapping("/getListGroupType") + public Result>> getListGroupType(@RequestBody Map map) { + return Result.success(projectService.getListGroupType(map)); + } + } diff --git a/src/main/java/com/zhgd/xmgl/modules/project/mapper/xml/ProjectMapper.xml b/src/main/java/com/zhgd/xmgl/modules/project/mapper/xml/ProjectMapper.xml index 9a74e8508..f3d079786 100644 --- a/src/main/java/com/zhgd/xmgl/modules/project/mapper/xml/ProjectMapper.xml +++ b/src/main/java/com/zhgd/xmgl/modules/project/mapper/xml/ProjectMapper.xml @@ -241,6 +241,9 @@ and a.project_name like concat('%', #{projectName}, '%') + + and a.bulid_status = #{bulidStatus} + + + + INSERT IGNORE INTO ${tableName} + ( + <#list originalColumns as column> + ${column.fieldDbName?lower_case}<#if column_has_next>, + + ) + VALUES + + ( + <#list originalColumns as column> + ${r"#{item."}${column.fieldName}${r"}"}<#if column_has_next>, + + ) + + + diff --git a/src/test/java/com/zhgd/xmgl/call/util/jc/JcHttpUtilTest.java b/src/test/java/com/zhgd/xmgl/call/util/jc/JcHttpUtilTest.java new file mode 100644 index 000000000..d8f0bc063 --- /dev/null +++ b/src/test/java/com/zhgd/xmgl/call/util/jc/JcHttpUtilTest.java @@ -0,0 +1,26 @@ +package com.zhgd.xmgl.call.util.jc; + +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.MockedStatic; +import org.mockito.junit.jupiter.MockitoExtension; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.mockStatic; + +@ExtendWith(MockitoExtension.class) +class JcHttpUtilTest { + + @Test + void replaceUrlToHttps() { + try (MockedStatic mockedStatic = mockStatic(JcHttpUtil.class);) { + mockedStatic.when(() -> JcHttpUtil.getJcHttpsUrl()).thenReturn("https://jc.zhgdyun.com:12112"); + mockedStatic.when(() -> JcHttpUtil.replaceUrlToHttps(any())).thenCallRealMethod(); + String expectedUrl = "https://jc.zhgdyun.com:12112/image/693b60ba45fca3742d953f19.jpg"; + String actualUrl = JcHttpUtil.replaceUrlToHttps("http://101.43.164.214:11111/image/693b60ba45fca3742d953f19.jpg"); + // 验证结果 + assertEquals(expectedUrl, actualUrl); + } + } +}