From 4576151cb8452ee6c1e2150c4dbc4ad5fa4d86bf Mon Sep 17 00:00:00 2001 From: 李旭东 <woaiguo66@sina.com> Date: 星期二, 17 十月 2023 16:59:49 +0800 Subject: [PATCH] Merge branch 'master' of http://111.30.93.211:10101/r/supipe --- hd/pipe/materialsManage/src/main/resources/application-dev.yml | 12 hd/pipe/materialsManage/src/main/resources/application-pro.yml | 10 hd/pipe/StaffManage/src/main/java/com/thhy/staff/utils/StringToJsonSerizlizerConfig.java | 16 hd/pipe/engineeringManage/src/main/resources/application-pro.yml | 8 hd/pipe/filectrl/src/main/resources/application-pro.yml | 6 hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/helmet/entity/dto/ReportNumDto.java | 13 hd/pipe/secure/src/main/resources/application-dev.yml | 12 hd/pipe/UserCore/src/main/resources/application-dev.yml | 12 hd/pipe/StaffManage/src/main/resources/application-dev.yml | 23 hd/pipe/screen/src/main/resources/application-dev.yml | 12 hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/helmet/entity/THelmetDevice.java | 42 + hd/pipe/gateway/src/main/resources/application-dev.yml | 9 hd/pipe/engineeringManage/src/main/resources/application-dev.yml | 8 hd/pipe/StaffManage/src/main/java/com/thhy/staff/config/FaceConfig.java | 21 hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/helmet/service/HelmetService.java | 43 + hd/pipe/mobile/src/main/resources/mapping/CheckDeviceMapper.xml | 9 hd/pipe/StaffManage/src/main/resources/mapping/FaceDeviceMapper.xml | 4 hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/helmet/scheduled/PictureScheduled.java | 241 +++++++ hd/pipe/materialsManage/src/main/resources/mapping/THelmetDeviceMapper.xml | 552 +++++++++++++++++ hd/pipe/screen/src/main/resources/application-pro.yml | 12 hd/pipe/gateway/src/main/resources/application-pro.yml | 7 hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/helmet/entity/THelmetTrajectory.java | 47 + hd/pipe/StaffManage/src/main/java/com/thhy/staff/modules/biz/platuser/service/impl/PlatUserServiceImpl.java | 136 +-- hd/pipe/StaffManage/src/main/java/com/thhy/staff/utils/MqUtils.java | 16 hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/helmet/entity/THelmetMotion.java | 63 + hd/pipe/mobile/src/main/resources/application-pro.yml | 10 hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/helmet/service/impl/HelmetServiceImpl.java | 135 ++++ hd/pipe/mobile/src/main/resources/application-dev.yml | 12 hd/pipe/secure/src/main/resources/application-pro.yml | 10 hd/pipe/ProjectManage/src/main/resources/application-pro.yml | 10 hd/pipe/StaffManage/src/main/java/com/thhy/staff/modules/biz/face/entity/MqContent.java | 29 hd/pipe/StaffManage/src/main/resources/application-pro.yml | 12 hd/pipe/ProjectManage/src/main/resources/application-dev.yml | 12 hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/helmet/controller/HelmetController.java | 75 ++ hd/pipe/filectrl/src/main/resources/application-dev.yml | 6 hd/pipe/mobile/src/main/java/com/thhy/mobile/modules/biz/checkdevice/entity/CheckDeviceListVo.java | 2 hd/pipe/StaffManage/src/main/java/com/thhy/staff/modules/biz/face/mapper/FaceDeviceMapper.java | 2 hd/pipe/UserCore/src/main/resources/application-pro.yml | 10 hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/helmet/entity/THelmetPicture.java | 58 + hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/helmet/mapper/HelmetMapper.java | 49 + web/src/views/LayoutIndex/components/LayoutAside.vue | 6 hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/helmet/entity/THelmetReport.java | 89 ++ 42 files changed, 1,685 insertions(+), 176 deletions(-) diff --git a/hd/pipe/ProjectManage/src/main/resources/application-dev.yml b/hd/pipe/ProjectManage/src/main/resources/application-dev.yml index 51ace43..29ee1c0 100644 --- a/hd/pipe/ProjectManage/src/main/resources/application-dev.yml +++ b/hd/pipe/ProjectManage/src/main/resources/application-dev.yml @@ -1,13 +1,11 @@ -server: - port: 8883 spring: config: activate: on-profile: dev import: - optional:nacos:${spring.application.name}-${spring.config.activate.on-profile}.${spring.cloud.nacos.config.file-extension} - - optional:nacos:supipe-common-${spring.config.activate.on-profile}.${spring.cloud.nacos.config.file-extension} - - optional:nacos:supipe-rocket-${spring.config.activate.on-profile}.${spring.cloud.nacos.config.file-extension} + - optional:nacos:pipe-common-${spring.config.activate.on-profile}.${spring.cloud.nacos.config.file-extension} + - optional:nacos:pipe-rocket-${spring.config.activate.on-profile}.${spring.cloud.nacos.config.file-extension} cloud: nacos: server-addr: 111.30.93.215:8848 @@ -15,6 +13,10 @@ heart-beat-interval: 3000 heart-beat-timeout: 15000 group: supipe + namespace: suzhou config: file-extension: yml - group: sunacos \ No newline at end of file + group: sunacos + namespace: suzhou +server: + port: ${${spring.application.name}port} \ No newline at end of file diff --git a/hd/pipe/ProjectManage/src/main/resources/application-pro.yml b/hd/pipe/ProjectManage/src/main/resources/application-pro.yml index f1dacbe..ebe85f8 100644 --- a/hd/pipe/ProjectManage/src/main/resources/application-pro.yml +++ b/hd/pipe/ProjectManage/src/main/resources/application-pro.yml @@ -4,8 +4,8 @@ on-profile: pro import: - optional:nacos:${spring.application.name}-${spring.config.activate.on-profile}.${spring.cloud.nacos.config.file-extension} - - optional:nacos:supipe-common-${spring.config.activate.on-profile}.${spring.cloud.nacos.config.file-extension} - - optional:nacos:supipe-rocket-${spring.config.activate.on-profile}.${spring.cloud.nacos.config.file-extension} + - optional:nacos:pipe-common-${spring.config.activate.on-profile}.${spring.cloud.nacos.config.file-extension} + - optional:nacos:pipe-rocket-${spring.config.activate.on-profile}.${spring.cloud.nacos.config.file-extension} cloud: nacos: server-addr: 111.30.93.215:8848 @@ -13,6 +13,10 @@ heart-beat-interval: 3000 heart-beat-timeout: 15000 group: supipe + namespace: suzhou config: file-extension: yml - group: sunacos \ No newline at end of file + group: sunacos + namespace: suzhou +server: + port: ${${spring.application.name}port} \ No newline at end of file diff --git a/hd/pipe/StaffManage/src/main/java/com/thhy/staff/config/FaceConfig.java b/hd/pipe/StaffManage/src/main/java/com/thhy/staff/config/FaceConfig.java new file mode 100644 index 0000000..296787c --- /dev/null +++ b/hd/pipe/StaffManage/src/main/java/com/thhy/staff/config/FaceConfig.java @@ -0,0 +1,21 @@ +package com.thhy.staff.config; + +import lombok.Data; +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.context.annotation.Configuration; + +import java.io.Serializable; + +@Data +@Configuration +@ConfigurationProperties(prefix = "face") +public class FaceConfig implements Serializable { + + private String urlPrefix; + + private String notify; + + private String singlePer; + + private String batchPer; +} diff --git a/hd/pipe/StaffManage/src/main/java/com/thhy/staff/modules/biz/face/entity/MqContent.java b/hd/pipe/StaffManage/src/main/java/com/thhy/staff/modules/biz/face/entity/MqContent.java new file mode 100644 index 0000000..062a5a9 --- /dev/null +++ b/hd/pipe/StaffManage/src/main/java/com/thhy/staff/modules/biz/face/entity/MqContent.java @@ -0,0 +1,29 @@ +package com.thhy.staff.modules.biz.face.entity; + +import com.alibaba.fastjson.JSONObject; +import com.alibaba.fastjson.annotation.JSONField; +import com.thhy.staff.utils.StringToJsonSerizlizerConfig; +import lombok.Data; + +import java.io.Serializable; + +@Data +public class MqContent implements Serializable { + + private String method; + + private String notify; + + @JSONField(serializeUsing = StringToJsonSerizlizerConfig.class) + private Object data; + + private Object params = new JSONObject(); + + public MqContent() { + } + + public MqContent(String method, String notify) { + this.method = method; + this.notify = notify; + } +} diff --git a/hd/pipe/StaffManage/src/main/java/com/thhy/staff/modules/biz/face/mapper/FaceDeviceMapper.java b/hd/pipe/StaffManage/src/main/java/com/thhy/staff/modules/biz/face/mapper/FaceDeviceMapper.java index 8892e93..6fd8949 100644 --- a/hd/pipe/StaffManage/src/main/java/com/thhy/staff/modules/biz/face/mapper/FaceDeviceMapper.java +++ b/hd/pipe/StaffManage/src/main/java/com/thhy/staff/modules/biz/face/mapper/FaceDeviceMapper.java @@ -21,6 +21,8 @@ List<FaceDevice> findList(FaceDevice facedevice); + List<String> queryDevSn(); + List<FaceDevice> findAll(); int countByDevSn(String devSn); diff --git a/hd/pipe/StaffManage/src/main/java/com/thhy/staff/modules/biz/platuser/service/impl/PlatUserServiceImpl.java b/hd/pipe/StaffManage/src/main/java/com/thhy/staff/modules/biz/platuser/service/impl/PlatUserServiceImpl.java index d5117c7..3b4b3c8 100644 --- a/hd/pipe/StaffManage/src/main/java/com/thhy/staff/modules/biz/platuser/service/impl/PlatUserServiceImpl.java +++ b/hd/pipe/StaffManage/src/main/java/com/thhy/staff/modules/biz/platuser/service/impl/PlatUserServiceImpl.java @@ -9,30 +9,27 @@ import com.thhy.general.exception.BasicException; import com.thhy.general.utils.ScreenMqUtils; import com.thhy.general.utils.UserInfoUtils; +import com.thhy.staff.config.EmqxConfig; +import com.thhy.staff.config.FaceConfig; import com.thhy.staff.modules.biz.applyhistory.entity.UserApplyHistory; import com.thhy.staff.modules.biz.applyhistory.mapper.UserApplyHistoryMapper; import com.thhy.staff.modules.biz.depart.entity.OtherUser; +import com.thhy.staff.modules.biz.face.entity.MqContent; +import com.thhy.staff.modules.biz.face.mapper.FaceDeviceMapper; import com.thhy.staff.modules.biz.group.entity.GroupUser; import com.thhy.staff.modules.biz.netty.NettyServerHandler; -import com.thhy.staff.modules.biz.platuser.controller.FaceServer; import com.thhy.staff.modules.biz.platuser.entity.*; import com.thhy.staff.modules.biz.platuser.mapper.PlatUserMapper; import com.thhy.staff.modules.biz.platuser.service.PlatUserService; -import com.thhy.staff.modules.biz.platuser.service.SysUserService; -import com.thhy.staff.modules.biz.position.mapper.PositionMapper; import com.thhy.staff.utils.ProcessFlag; import com.thhy.staff.utils.StaffNoUtils; import io.netty.channel.ChannelHandlerContext; +import org.checkerframework.checker.units.qual.A; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; - -import javax.servlet.http.HttpServletRequest; -import javax.websocket.Session; -import java.io.IOException; import java.io.Serializable; import java.math.BigDecimal; import java.math.RoundingMode; @@ -53,16 +50,19 @@ private PlatUserMapper platUserMapper; @Autowired - private SysUserService sysUserService; - - @Autowired private UserApplyHistoryMapper historyMapper; @Autowired - private PositionMapper positionMapper; + private ScreenMqUtils screenMqUtils; @Autowired - private ScreenMqUtils screenMqUtils; + private FaceDeviceMapper faceDeviceMapper; + + @Autowired + private EmqxConfig emqxConfig; + + @Autowired + private FaceConfig faceConfig; public PlatUser get(Serializable id){ return platUserMapper.queryById(id); @@ -387,6 +387,21 @@ platUserMapper.updateFace(faceDto); if(faceDto.getSyncToDevice()==1){ //下发 + List<String> sns = faceDeviceMapper.queryDevSn(); + + MqContent mqContent = new MqContent("sync_person", faceConfig.getUrlPrefix()+faceConfig.getNotify()); + + JSONObject jsonObject = new JSONObject(); + jsonObject.put("path",faceConfig.getUrlPrefix()+faceConfig.getSinglePer()); + JSONObject pathParamJson = new JSONObject(); + pathParamJson.put("dev_sno",""); + pathParamJson.put("limit",10); + pathParamJson.put("offset",0); + pathParamJson.put("total",1); + pathParamJson.put("person_list","[\""+faceDto.getUserId()+"\"]"); + pathParamJson.put("person_type","4"); + jsonObject.put("path_params",pathParamJson); + mqContent.setData(jsonObject); /*Map<String,Object> map = AcsMain.addFace(fd.getJobNum(),filePrefix+"/"+fd.getPhoto()); if(map.containsKey("code")){ if(Integer.parseInt(map.get("code").toString())!=0){ @@ -528,82 +543,6 @@ platUserMapper.insertDoorLis(doorLis); } - - public static void main(String[] args) { - String eventLog = "{\n" + - "\t\"ipAddress\":\t\"192.168.1.12\",\n" + - "\t\"ipv6Address\":\t\"240e:345:129e:cf00:e2ca:3cff:fef0:d933\",\n" + - "\t\"portNo\":\t443,\n" + - "\t\"protocol\":\t\"HTTPS\",\n" + - "\t\"macAddress\":\t\"e0:ca:3c:f0:d9:33\",\n" + - "\t\"channelID\":\t1,\n" + - "\t\"dateTime\":\t\"2023-09-05T15:44:04+08:00\",\n" + - "\t\"activePostCount\":\t1,\n" + - "\t\"eventType\":\t\"AccessControllerEvent\",\n" + - "\t\"eventState\":\t\"active\",\n" + - "\t\"eventDescription\":\t\"Access Controller Event\",\n" + - "\t\"AccessControllerEvent\":\t{\n" + - "\t\t\"deviceName\":\t\"Access Controller\",\n" + - "\t\t\"majorEventType\":\t5,\n" + - "\t\t\"subEventType\":\t76,\n" + - "\t\t\"cardReaderKind\":\t1,\n" + - "\t\t\"cardReaderNo\":\t1,\n" + - "\t\t\"verifyNo\":\t233,\n" + - "\t\t\"serialNo\":\t437,\n" + - "\t\t\"currentVerifyMode\":\t\"cardOrFace\",\n" + - "\t\t\"frontSerialNo\":\t436,\n" + - "\t\t\"attendanceStatus\":\t\"undefined\",\n" + - "\t\t\"statusValue\":\t0,\n" + - "\t\t\"mask\":\t\"no\",\n" + - "\t\t\"helmet\":\t\"unknown\",\n" + - "\t\t\"picturesNumber\":\t1,\n" + - "\t\t\"purePwdVerifyEnable\":\ttrue,\n" + - "\t\t\"FaceRect\":\t{\n" + - "\t\t\t\"height\":\t0.116000,\n" + - "\t\t\t\"width\":\t0.065000,\n" + - "\t\t\t\"x\":\t0.546000,\n" + - "\t\t\t\"y\":\t0.634000\n" + - "\t\t}\n" + - "\t}\n" + - "}"; - JSONObject jsonObject = JSONObject.parseObject(eventLog); - - if(!jsonObject.containsKey("eventType")){ - //platUserMapper.addDoorHis(eventLog); - return; - } - String eventType = jsonObject.getString("eventType"); - if(!"AccessControllerEvent".equals(eventType)){ - //platUserMapper.addDoorHis(eventLog); - return; - } - - JSONObject control = jsonObject.getJSONObject("AccessControllerEvent"); - - String majorEventType = control.getString("majorEventType"); - if(!"1".equals(majorEventType)&&!"5".equals(majorEventType)){ - //platUserMapper.addDoorHis(eventLog); - return; - } - - DoorLis doorLis = new DoorLis(); - //doorLis.setOriStr(eventLog); - doorLis.setIpAddress(jsonObject.getString("ipAddress")); - doorLis.setMacAddress(jsonObject.getString("macAddress")); - doorLis.setNoticeType(Integer.parseInt(majorEventType)); - if("5".equals(majorEventType)){ - String subEventType = control.getString("subEventType"); - if("75".equals(subEventType)){ - doorLis.setVerify(1); - doorLis.setName(control.getString("name")); - doorLis.setEmployeeNoString(control.getString("employeeNoString")); - }else if("76".equals(subEventType)){ - doorLis.setVerify(2); - } - } - - } - @Override public Map<String, Object> faceRecord(String token) { SysUserInfo userInfo = UserInfoUtils.getInstance().getUserInfo(token); @@ -671,4 +610,23 @@ } platUserMapper.insertDoorListener(doorLisPic); } + + public static void main(String[] args) { + MqContent mqContent = new MqContent("sync_person", "notify"); + String uu = "02d32ee86bec2b11e4b23eb6"; + JSONObject jsonObject = new JSONObject(); + jsonObject.put("path","/path"); + JSONObject pathParamJson = new JSONObject(); + + pathParamJson.put("dev_sno",""); + pathParamJson.put("limit",10); + pathParamJson.put("offset",0); + pathParamJson.put("total",1); + pathParamJson.put("person_list","[\""+uu+"\"]"); + pathParamJson.put("person_type","4"); + jsonObject.put("path_params",pathParamJson); + mqContent.setData(jsonObject); + + System.out.println(pathParamJson.toJSONString()); + } } diff --git a/hd/pipe/StaffManage/src/main/java/com/thhy/staff/utils/MqUtils.java b/hd/pipe/StaffManage/src/main/java/com/thhy/staff/utils/MqUtils.java index 31f6ae0..f975e44 100644 --- a/hd/pipe/StaffManage/src/main/java/com/thhy/staff/utils/MqUtils.java +++ b/hd/pipe/StaffManage/src/main/java/com/thhy/staff/utils/MqUtils.java @@ -8,13 +8,14 @@ import org.eclipse.paho.client.mqttv3.MqttMessage; import org.eclipse.paho.client.mqttv3.persist.MemoryPersistence; +import java.util.List; + public class MqUtils { - public static void createClient(EmqxConfig emqxConfig){ + public static void createClient(EmqxConfig emqxConfig, List<String> topics, String content){ String broker = "tcp://"+emqxConfig.getHost()+":"+emqxConfig.getPort(); String clientId = UUIDUtils.create(); MemoryPersistence persistence = new MemoryPersistence(); - try { MqttClient client = new MqttClient(broker, clientId, persistence); @@ -39,11 +40,12 @@ //client.subscribe(subTopic); // 消息发布所需参数 - /* MqttMessage message = new MqttMessage(content.getBytes()); - message.setQos(qos); - client.publish(pubTopic, message); - System.out.println("Message published");*/ - + MqttMessage message = new MqttMessage(content.getBytes()); + message.setQos(emqxConfig.getQos()); + for(String pubTopic : topics){ + client.publish(pubTopic, message); + } + System.out.println("Message published"); client.disconnect(); } catch (MqttException e) { throw new RuntimeException(e); diff --git a/hd/pipe/StaffManage/src/main/java/com/thhy/staff/utils/StringToJsonSerizlizerConfig.java b/hd/pipe/StaffManage/src/main/java/com/thhy/staff/utils/StringToJsonSerizlizerConfig.java new file mode 100644 index 0000000..70ebeb3 --- /dev/null +++ b/hd/pipe/StaffManage/src/main/java/com/thhy/staff/utils/StringToJsonSerizlizerConfig.java @@ -0,0 +1,16 @@ +package com.thhy.staff.utils; + +import com.alibaba.fastjson.JSONObject; +import com.alibaba.fastjson.serializer.JSONSerializer; +import com.alibaba.fastjson.serializer.ObjectSerializer; + +import java.io.IOException; +import java.lang.reflect.Type; + +public class StringToJsonSerizlizerConfig implements ObjectSerializer { + + @Override + public void write(JSONSerializer jsonSerializer, Object o, Object o1, Type type, int i) throws IOException { + jsonSerializer.write(JSONObject.parseObject(o.toString())); + } +} diff --git a/hd/pipe/StaffManage/src/main/resources/application-dev.yml b/hd/pipe/StaffManage/src/main/resources/application-dev.yml index c172a05..9b922ae 100644 --- a/hd/pipe/StaffManage/src/main/resources/application-dev.yml +++ b/hd/pipe/StaffManage/src/main/resources/application-dev.yml @@ -1,13 +1,11 @@ -server: - port: 8882 spring: config: activate: on-profile: dev import: - optional:nacos:${spring.application.name}-${spring.config.activate.on-profile}.${spring.cloud.nacos.config.file-extension} - - optional:nacos:supipe-common-${spring.config.activate.on-profile}.${spring.cloud.nacos.config.file-extension} - - optional:nacos:supipe-rocket-${spring.config.activate.on-profile}.${spring.cloud.nacos.config.file-extension} + - optional:nacos:pipe-common-${spring.config.activate.on-profile}.${spring.cloud.nacos.config.file-extension} + - optional:nacos:pipe-rocket-${spring.config.activate.on-profile}.${spring.cloud.nacos.config.file-extension} cloud: nacos: server-addr: 111.30.93.215:8848 @@ -15,19 +13,12 @@ heart-beat-interval: 3000 heart-beat-timeout: 15000 group: supipe + namespace: suzhou config: file-extension: yml group: sunacos -global: - filePrefix: https://pipe.thhy-tj.com/ -emqx: - host: 111.30.93.215 - port: 1883 - username: thhy - password: thhy123 - qos: 1 - topic: FF:AA:F4:12:67:05 - willTopic: FF:AA:F4:12:67:05-W - willContent: FF:AA:F4:12:67:05-offline + namespace: suzhou +server: + port: ${${spring.application.name}port} netty: - port: 10001 \ No newline at end of file + port: ${${spring.application.name}nettyport} diff --git a/hd/pipe/StaffManage/src/main/resources/application-pro.yml b/hd/pipe/StaffManage/src/main/resources/application-pro.yml index 180c871..2f83d6b 100644 --- a/hd/pipe/StaffManage/src/main/resources/application-pro.yml +++ b/hd/pipe/StaffManage/src/main/resources/application-pro.yml @@ -4,8 +4,8 @@ on-profile: pro import: - optional:nacos:${spring.application.name}-${spring.config.activate.on-profile}.${spring.cloud.nacos.config.file-extension} - - optional:nacos:supipe-common-${spring.config.activate.on-profile}.${spring.cloud.nacos.config.file-extension} - - optional:nacos:supipe-rocket-${spring.config.activate.on-profile}.${spring.cloud.nacos.config.file-extension} + - optional:nacos:pipe-common-${spring.config.activate.on-profile}.${spring.cloud.nacos.config.file-extension} + - optional:nacos:pipe-rocket-${spring.config.activate.on-profile}.${spring.cloud.nacos.config.file-extension} cloud: nacos: server-addr: 111.30.93.215:8848 @@ -13,8 +13,12 @@ heart-beat-interval: 3000 heart-beat-timeout: 15000 group: supipe + namespace: suzhou config: file-extension: yml group: sunacos -global: - filePrefix: https://pipe.thhy-tj.com/ \ No newline at end of file + namespace: suzhou +server: + port: ${${spring.application.name}port} +netty: + port: ${${spring.application.name}nettyport} \ No newline at end of file diff --git a/hd/pipe/StaffManage/src/main/resources/mapping/FaceDeviceMapper.xml b/hd/pipe/StaffManage/src/main/resources/mapping/FaceDeviceMapper.xml index f503fe0..7a2ce99 100644 --- a/hd/pipe/StaffManage/src/main/resources/mapping/FaceDeviceMapper.xml +++ b/hd/pipe/StaffManage/src/main/resources/mapping/FaceDeviceMapper.xml @@ -77,6 +77,10 @@ <include refid="condition_query" /> </select> + <select id="queryDevSn" resultType="string"> + select t.dev_sno as devSno from t_face_device t + </select> + <!--查询列表--> <select id="findAll" resultType="com.thhy.staff.modules.biz.face.entity.FaceDevice"> SELECT diff --git a/hd/pipe/UserCore/src/main/resources/application-dev.yml b/hd/pipe/UserCore/src/main/resources/application-dev.yml index ddac89d..22b8584 100644 --- a/hd/pipe/UserCore/src/main/resources/application-dev.yml +++ b/hd/pipe/UserCore/src/main/resources/application-dev.yml @@ -1,13 +1,11 @@ -server: - port: 8881 spring: config: activate: on-profile: dev import: - optional:nacos:${spring.application.name}-${spring.config.activate.on-profile}.${spring.cloud.nacos.config.file-extension} - - optional:nacos:supipe-common-${spring.config.activate.on-profile}.${spring.cloud.nacos.config.file-extension} - - optional:nacos:supipe-rocket-${spring.config.activate.on-profile}.${spring.cloud.nacos.config.file-extension} + - optional:nacos:pipe-common-${spring.config.activate.on-profile}.${spring.cloud.nacos.config.file-extension} + - optional:nacos:pipe-rocket-${spring.config.activate.on-profile}.${spring.cloud.nacos.config.file-extension} cloud: nacos: server-addr: 111.30.93.215:8848 @@ -15,9 +13,13 @@ heart-beat-interval: 3000 heart-beat-timeout: 15000 group: supipe + namespace: suzhou config: file-extension: yml group: sunacos + namespace: suzhou wemp: appId: wx993e9d4056f0f44e - secret: 87f19fa7f1e6898fb143396283e733b8 \ No newline at end of file + secret: 87f19fa7f1e6898fb143396283e733b8 +server: + port: ${${spring.application.name}port} \ No newline at end of file diff --git a/hd/pipe/UserCore/src/main/resources/application-pro.yml b/hd/pipe/UserCore/src/main/resources/application-pro.yml index a041661..4d18667 100644 --- a/hd/pipe/UserCore/src/main/resources/application-pro.yml +++ b/hd/pipe/UserCore/src/main/resources/application-pro.yml @@ -4,8 +4,8 @@ on-profile: pro import: - optional:nacos:${spring.application.name}-${spring.config.activate.on-profile}.${spring.cloud.nacos.config.file-extension} - - optional:nacos:supipe-common-${spring.config.activate.on-profile}.${spring.cloud.nacos.config.file-extension} - - optional:nacos:supipe-rocket-${spring.config.activate.on-profile}.${spring.cloud.nacos.config.file-extension} + - optional:nacos:pipe-common-${spring.config.activate.on-profile}.${spring.cloud.nacos.config.file-extension} + - optional:nacos:pipe-rocket-${spring.config.activate.on-profile}.${spring.cloud.nacos.config.file-extension} cloud: nacos: server-addr: 111.30.93.215:8848 @@ -13,9 +13,13 @@ heart-beat-interval: 3000 heart-beat-timeout: 15000 group: supipe + namespace: suzhou config: file-extension: yml group: sunacos + namespace: suzhou wemp: appId: wx993e9d4056f0f44e - secret: 87f19fa7f1e6898fb143396283e733b8 \ No newline at end of file + secret: 87f19fa7f1e6898fb143396283e733b8 +server: + port: ${${spring.application.name}port} \ No newline at end of file diff --git a/hd/pipe/engineeringManage/src/main/resources/application-dev.yml b/hd/pipe/engineeringManage/src/main/resources/application-dev.yml index 1a1133a..490ac3d 100644 --- a/hd/pipe/engineeringManage/src/main/resources/application-dev.yml +++ b/hd/pipe/engineeringManage/src/main/resources/application-dev.yml @@ -4,8 +4,8 @@ on-profile: dev import: - optional:nacos:${spring.application.name}-${spring.config.activate.on-profile}.${spring.cloud.nacos.config.file-extension} - - optional:nacos:supipe-common-${spring.config.activate.on-profile}.${spring.cloud.nacos.config.file-extension} - - optional:nacos:supipe-rocket-${spring.config.activate.on-profile}.${spring.cloud.nacos.config.file-extension} + - optional:nacos:pipe-common-${spring.config.activate.on-profile}.${spring.cloud.nacos.config.file-extension} + - optional:nacos:pipe-rocket-${spring.config.activate.on-profile}.${spring.cloud.nacos.config.file-extension} cloud: nacos: server-addr: 111.30.93.215:8848 @@ -13,6 +13,10 @@ heart-beat-interval: 3000 heart-beat-timeout: 15000 group: supipe + namespace: suzhou config: file-extension: yml group: sunacos + namespace: suzhou +server: + port: ${${spring.application.name}port} diff --git a/hd/pipe/engineeringManage/src/main/resources/application-pro.yml b/hd/pipe/engineeringManage/src/main/resources/application-pro.yml index 6646890..ebe85f8 100644 --- a/hd/pipe/engineeringManage/src/main/resources/application-pro.yml +++ b/hd/pipe/engineeringManage/src/main/resources/application-pro.yml @@ -4,8 +4,8 @@ on-profile: pro import: - optional:nacos:${spring.application.name}-${spring.config.activate.on-profile}.${spring.cloud.nacos.config.file-extension} - - optional:nacos:supipe-common-${spring.config.activate.on-profile}.${spring.cloud.nacos.config.file-extension} - - optional:nacos:supipe-rocket-${spring.config.activate.on-profile}.${spring.cloud.nacos.config.file-extension} + - optional:nacos:pipe-common-${spring.config.activate.on-profile}.${spring.cloud.nacos.config.file-extension} + - optional:nacos:pipe-rocket-${spring.config.activate.on-profile}.${spring.cloud.nacos.config.file-extension} cloud: nacos: server-addr: 111.30.93.215:8848 @@ -13,6 +13,10 @@ heart-beat-interval: 3000 heart-beat-timeout: 15000 group: supipe + namespace: suzhou config: file-extension: yml group: sunacos + namespace: suzhou +server: + port: ${${spring.application.name}port} \ No newline at end of file diff --git a/hd/pipe/filectrl/src/main/resources/application-dev.yml b/hd/pipe/filectrl/src/main/resources/application-dev.yml index e8dc5f2..11f610b 100644 --- a/hd/pipe/filectrl/src/main/resources/application-dev.yml +++ b/hd/pipe/filectrl/src/main/resources/application-dev.yml @@ -4,7 +4,7 @@ on-profile: dev import: - optional:nacos:${spring.application.name}-${spring.config.activate.on-profile}.${spring.cloud.nacos.config.file-extension} - - optional:nacos:supipe-common-${spring.config.activate.on-profile}.${spring.cloud.nacos.config.file-extension} + - optional:nacos:pipe-common-${spring.config.activate.on-profile}.${spring.cloud.nacos.config.file-extension} cloud: nacos: server-addr: 111.30.93.215:8848 @@ -12,6 +12,10 @@ heart-beat-interval: 3000 heart-beat-timeout: 15000 group: supipe + namespace: suzhou config: file-extension: yml group: sunacos + namespace: suzhou +server: + port: ${${spring.application.name}port} diff --git a/hd/pipe/filectrl/src/main/resources/application-pro.yml b/hd/pipe/filectrl/src/main/resources/application-pro.yml index 012db33..0ea273e 100644 --- a/hd/pipe/filectrl/src/main/resources/application-pro.yml +++ b/hd/pipe/filectrl/src/main/resources/application-pro.yml @@ -4,7 +4,7 @@ on-profile: pro import: - optional:nacos:${spring.application.name}-${spring.config.activate.on-profile}.${spring.cloud.nacos.config.file-extension} - - optional:nacos:supipe-common-${spring.config.activate.on-profile}.${spring.cloud.nacos.config.file-extension} + - optional:nacos:pipe-common-${spring.config.activate.on-profile}.${spring.cloud.nacos.config.file-extension} cloud: nacos: server-addr: 111.30.93.215:8848 @@ -12,6 +12,10 @@ heart-beat-interval: 3000 heart-beat-timeout: 15000 group: supipe + namespace: suzhou config: file-extension: yml group: sunacos + namespace: suzhou +server: + port: ${${spring.application.name}port} diff --git a/hd/pipe/gateway/src/main/resources/application-dev.yml b/hd/pipe/gateway/src/main/resources/application-dev.yml index e267699..dbed1af 100644 --- a/hd/pipe/gateway/src/main/resources/application-dev.yml +++ b/hd/pipe/gateway/src/main/resources/application-dev.yml @@ -1,5 +1,3 @@ -server: - port: 8880 spring: cloud: nacos: @@ -8,11 +6,16 @@ heart-beat-interval: 3000 heart-beat-timeout: 15000 group: supipe + namespace: suzhou config: file-extension: yml group: sunacos + namespace: suzhou config: activate: on-profile: dev import: - - optional:nacos:${spring.application.name}-${spring.config.activate.on-profile}.${spring.cloud.nacos.config.file-extension} \ No newline at end of file + - optional:nacos:${spring.application.name}-${spring.config.activate.on-profile}.${spring.cloud.nacos.config.file-extension} + - optional:nacos:pipe-common-${spring.config.activate.on-profile}.${spring.cloud.nacos.config.file-extension} +server: + port: ${${spring.application.name}port} \ No newline at end of file diff --git a/hd/pipe/gateway/src/main/resources/application-pro.yml b/hd/pipe/gateway/src/main/resources/application-pro.yml index bf4520a..2492ab1 100644 --- a/hd/pipe/gateway/src/main/resources/application-pro.yml +++ b/hd/pipe/gateway/src/main/resources/application-pro.yml @@ -6,11 +6,16 @@ heart-beat-interval: 3000 heart-beat-timeout: 15000 group: supipe + namespace: suzhou config: file-extension: yml group: sunacos + namespace: suzhou config: activate: on-profile: pro import: - - optional:nacos:${spring.application.name}-${spring.config.activate.on-profile}.${spring.cloud.nacos.config.file-extension} \ No newline at end of file + - optional:nacos:${spring.application.name}-${spring.config.activate.on-profile}.${spring.cloud.nacos.config.file-extension} + - optional:nacos:pipe-common-${spring.config.activate.on-profile}.${spring.cloud.nacos.config.file-extension} +server: + port: ${${spring.application.name}port} \ No newline at end of file diff --git a/hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/helmet/controller/HelmetController.java b/hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/helmet/controller/HelmetController.java new file mode 100644 index 0000000..28a3317 --- /dev/null +++ b/hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/helmet/controller/HelmetController.java @@ -0,0 +1,75 @@ +package com.thhy.materials.modules.biz.helmet.controller; + +import com.thhy.general.common.BasicResult; +import com.thhy.materials.modules.biz.helmet.service.HelmetService; +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 javax.annotation.Resource; +import java.util.Map; + +@RestController +@RequestMapping("/helmet") +public class HelmetController { + + + @Resource + private HelmetService helmetService; + + //安全帽设备 列表 + @PostMapping("/helmetList") + public BasicResult helmetList(@RequestBody Map<String,Object> values){ + return helmetService.helmetList(values); + } + //照片 列表 + @PostMapping("/helmetPictureList") + public BasicResult helmetPictureList(@RequestBody Map<String,Object> values){ + return helmetService.helmetPictureList(values); + } + + //轨迹统计 + @PostMapping("/helmetTrajectoryList") + public BasicResult helmetTrajectoryList(@RequestBody Map<String,Object> values){ + return helmetService.helmetTrajectoryList(values); + } + + //轨迹坐标 + @PostMapping("/helmetMotionList") + public BasicResult helmetMotionList(@RequestBody Map<String,Object> values){ + return helmetService.helmetMotionList(values); + } + + + + //接数据 + @PostMapping("/dataValueInsert") + public BasicResult dataValueInsert(@RequestBody Map<String,Object> values){ + return helmetService.dataValueInsert(values); + } + + /** + * 报警次数 + * @param values + * @return + */ + @PostMapping("/helmetReportTotal") + public BasicResult helmetReportTotal(@RequestBody Map<String,Object> values){ + return helmetService.helmetReportTotal(values); + + + + } + /** + * 报警用户详情 + * @param values + * @returna + */ + @PostMapping("/helmetReportUser") + public BasicResult helmetReportUser(@RequestBody Map<String,Object> values){ + return helmetService.helmetReportUser(values); + } + + +} diff --git a/hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/helmet/entity/THelmetDevice.java b/hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/helmet/entity/THelmetDevice.java new file mode 100644 index 0000000..30f9704 --- /dev/null +++ b/hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/helmet/entity/THelmetDevice.java @@ -0,0 +1,42 @@ +package com.thhy.materials.modules.biz.helmet.entity; + +import lombok.Data; +import lombok.Getter; +import lombok.Setter; +import lombok.ToString; + +import java.io.Serializable; + +@Data +@Getter +@Setter +@ToString +public class THelmetDevice implements Serializable { + /** + * 安全帽设备id + */ + private String helmetDeviceId; + + /** + * 设备编号 + */ + private String deviceNum; + + /** + * + */ + private Integer userId; + + /** + * + */ + private String userName; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table t_helmet_device + * + * @mbg.generated Tue Oct 10 10:55:08 CST 2023 + */ + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/helmet/entity/THelmetMotion.java b/hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/helmet/entity/THelmetMotion.java new file mode 100644 index 0000000..0ddea59 --- /dev/null +++ b/hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/helmet/entity/THelmetMotion.java @@ -0,0 +1,63 @@ +package com.thhy.materials.modules.biz.helmet.entity; + +import lombok.Data; +import lombok.Getter; +import lombok.Setter; +import lombok.ToString; + +import java.io.Serializable; + +@Data +@Getter +@Setter +@ToString +public class THelmetMotion implements Serializable { + /** + * + */ + private Integer motionId; + + /** + * 用户id + */ + private Integer userId; + + /** + * 纬度 + */ + private String xPoint; + + /** + * 经度 + */ + private String yPoint; + + /** + * 创建时间 + */ + private String times; + + /** + * 角度 + */ + private String cAngle; + + /** + * 速度 + */ + private String cSpeed; + + /** + * 纠偏 + */ + private String cTrust; + private String smTime; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table t_helmet_motion + * + * @mbg.generated Wed Oct 11 14:49:58 CST 2023 + */ + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/helmet/entity/THelmetPicture.java b/hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/helmet/entity/THelmetPicture.java new file mode 100644 index 0000000..173304b --- /dev/null +++ b/hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/helmet/entity/THelmetPicture.java @@ -0,0 +1,58 @@ +package com.thhy.materials.modules.biz.helmet.entity; + +import lombok.Data; +import lombok.Getter; +import lombok.Setter; +import lombok.ToString; + +import java.io.Serializable; + +@Data +@Getter +@Setter +@ToString +public class THelmetPicture implements Serializable { + /** + * + */ + private Integer helmetPictureId; + + /** + * 图片地址 + */ + private String imageUrl; + + /** + * 用户人 + */ + private Integer userId; + + /** + * 纬度 + */ + private String xPoint; + + /** + * 经度 + */ + private String yPoint; + + /** + * 创建时间 + */ + private String creTime; + private String smTime; + + /** + * 外部平台id + */ + private Integer iId; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table t_helmet_picture + * + * @mbg.generated Tue Oct 10 11:20:40 CST 2023 + */ + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/helmet/entity/THelmetReport.java b/hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/helmet/entity/THelmetReport.java new file mode 100644 index 0000000..5082b10 --- /dev/null +++ b/hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/helmet/entity/THelmetReport.java @@ -0,0 +1,89 @@ +package com.thhy.materials.modules.biz.helmet.entity; + + +import lombok.Data; +import lombok.Getter; +import lombok.Setter; +import lombok.ToString; + +import java.io.Serializable; + +@Data +@Getter +@Setter +@ToString +public class THelmetReport implements Serializable { + /** + * id + */ + private Integer reportId; + + /** + * 外部平台id + */ + private Integer sId; + + /** + * 用户id + */ + private Integer userId; + + /** + * 用户名 + */ + private String userName; + + /** + * 设备num + */ + private String deviceId; + + /** + * 纬度 + */ + private String xPoint; + + /** + * 经度 + */ + private String yPoint; + + /** + * 报警时间 + */ + private String cTime; + + /** + * 报警类型 + */ + private String sosType; + + /** + * 报警消息 + */ + private String msg; + + /** + * 图片路径 + */ + private String imgurl; + + /** + * 手机号码 + */ + private String mobile; + + + /** + * 报警时间 + */ + private String smTime; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table t_helmet_report + * + * @mbg.generated Tue Oct 10 15:27:36 CST 2023 + */ + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/helmet/entity/THelmetTrajectory.java b/hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/helmet/entity/THelmetTrajectory.java new file mode 100644 index 0000000..d665d2c --- /dev/null +++ b/hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/helmet/entity/THelmetTrajectory.java @@ -0,0 +1,47 @@ +package com.thhy.materials.modules.biz.helmet.entity; + +import lombok.Data; +import lombok.Getter; +import lombok.Setter; +import lombok.ToString; + +import java.io.Serializable; + +@Data +@Getter +@Setter +@ToString +public class THelmetTrajectory implements Serializable { + /** + * + */ + private Integer trajectoryId; + + /** + * 生成时间 + */ + private String ctime; + + /** + * 当天在线时间 + */ + private String ltime; + + /** + * 当天在线时长(秒) + */ + private String sec; + + /** + * 用户 + */ + private Integer userId; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table t_helmet_trajectory + * + * @mbg.generated Wed Oct 11 13:31:58 CST 2023 + */ + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/helmet/entity/dto/ReportNumDto.java b/hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/helmet/entity/dto/ReportNumDto.java new file mode 100644 index 0000000..ec414be --- /dev/null +++ b/hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/helmet/entity/dto/ReportNumDto.java @@ -0,0 +1,13 @@ +package com.thhy.materials.modules.biz.helmet.entity.dto; + +import lombok.Data; + +import java.io.Serializable; +@Data +public class ReportNumDto implements Serializable { + //时间 + private String smTime; + //报警数量 + private Integer num; + +} diff --git a/hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/helmet/mapper/HelmetMapper.java b/hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/helmet/mapper/HelmetMapper.java new file mode 100644 index 0000000..0fcdf46 --- /dev/null +++ b/hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/helmet/mapper/HelmetMapper.java @@ -0,0 +1,49 @@ +package com.thhy.materials.modules.biz.helmet.mapper; + +import com.thhy.materials.modules.biz.helmet.entity.*; +import com.thhy.materials.modules.biz.helmet.entity.dto.ReportNumDto; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; +import java.util.Map; + +@Mapper +public interface HelmetMapper { + + List<THelmetDevice> helmetServiceList(); + + Integer userIdIid(@Param("userId") Integer user_id); + + void helmetPictureInsert(THelmetPicture tHelmetPicture); + + Integer userIdReport(@Param("userId")Integer user_id); + + void helmetReportInsert(THelmetReport tHelmetReport); + + THelmetTrajectory trajectory(@Param("userId") Integer userId,@Param("ctime") String ctime); + + void helmetTrajectoryInsert(THelmetTrajectory helmetTrajectory); + + void helmetTrajectoryUpdate(THelmetTrajectory helmetTrajectory); + + String helmetMotion(Integer userId); + + void helmetMotionInsert(THelmetMotion tHelmetMotion); + + List<THelmetDevice> helmetList(Map<String, Object> values); + + List<THelmetPicture> helmetPictureList(Map<String, Object> values); + + List<THelmetTrajectory> helmetTrajectoryList(Map<String, Object> values); + + String helmetTrajectoryTime(Map<String, Object> values); + + List<THelmetMotion> helmetMotionList(Map<String, Object> values); + + void dataValueInsert(Map<String, Object> values); + + List<ReportNumDto> helmetReportTotal(Map<String, Object> values); + + List<THelmetReport> helmetReportUser(Map<String, Object> values); +} diff --git a/hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/helmet/scheduled/PictureScheduled.java b/hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/helmet/scheduled/PictureScheduled.java new file mode 100644 index 0000000..8b8a438 --- /dev/null +++ b/hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/helmet/scheduled/PictureScheduled.java @@ -0,0 +1,241 @@ +package com.thhy.materials.modules.biz.helmet.scheduled; + +import com.alibaba.fastjson.JSONObject; +import com.github.pagehelper.util.StringUtil; +import com.thhy.materials.modules.biz.helmet.entity.*; +import com.thhy.materials.modules.biz.helmet.service.HelmetService; +import org.springframework.http.HttpEntity; +import org.springframework.http.HttpHeaders; +import org.springframework.http.MediaType; +import org.springframework.scheduling.annotation.Scheduled; +import org.springframework.stereotype.Component; +import org.springframework.util.CollectionUtils; +import org.springframework.web.client.RestTemplate; + +import javax.annotation.Resource; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.*; +import java.util.logging.SimpleFormatter; +import java.util.stream.Collectors; + +@Component +public class PictureScheduled { + + + @Resource + private HelmetService helmetService; + //图片记录 + @Scheduled(fixedRate = 2000000) // 每隔3秒执行一次任务 + public void task() { + String token = token(); + List<THelmetDevice> helmetDevices = helmetService.helmetServiceList(); + System.out.println(helmetDevices); + + for (THelmetDevice device : helmetDevices){ + RestTemplate restTemplate = new RestTemplate(); + HttpHeaders headers = new HttpHeaders(); + headers.setContentType(MediaType.valueOf(MediaType.APPLICATION_FORM_URLENCODED_VALUE)); + HttpEntity<Map<String, Object>> mapHttpEntity = new HttpEntity<>(null, headers); + String s = restTemplate.postForObject("https://caps.runde.pro/api/index.php?ctl=report&act=get_user_image&user_id="+device.getUserId()+"&p=1"+"&token="+token, mapHttpEntity, String.class); + JSONObject jsonObject = JSONObject.parseObject(s); +// System.out.println("----------------------------------------------"); +// System.out.println("----------------------------------------------"); +// System.out.println("----------------------------------------------"); +// System.out.println("----------------------------------------------"); +// System.out.println("----------------------------------------------"); +// System.out.println(jsonObject); + if(jsonObject.get("status").toString().equals("true")){ + //图片值 + List<Map<String,Object>> data = (List<Map<String, Object>>) jsonObject.get("data"); +// System.out.println("----------map------------"); +// System.out.println(data); + + for (Integer i =data.size()-1;i!=0;i--){ + Integer iId = helmetService.userIdIid(Integer.valueOf(data.get(i).get("user_id").toString())); + if((iId!=null && Integer.valueOf(data.get(i).get("i_id").toString())>iId)||iId==null){ + THelmetPicture tHelmetPicture = new THelmetPicture(); + tHelmetPicture.setUserId(Integer.valueOf(data.get(i).get("user_id").toString())); + tHelmetPicture.setIId(Integer.valueOf(data.get(i).get("i_id").toString())); + tHelmetPicture.setCreTime(data.get(i).get("time").toString()); + tHelmetPicture.setXPoint(data.get(i).get("x_point").toString()); + tHelmetPicture.setYPoint(data.get(i).get("y_point").toString()); + tHelmetPicture.setImageUrl(data.get(i).get("image_url").toString()); + Date date = new Date(Long.valueOf(data.get(i).get("time").toString()+"000")); + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + tHelmetPicture.setSmTime(sdf.format(date)); + helmetService.helmetPictureInsert(tHelmetPicture); + } + } + } + } + } + + + //报警记录 + @Scheduled(fixedRate = 3000000) // 每隔3秒执行一次任务 + public void taskReport() { + String token = token(); + // System.out.println(token); + List<THelmetDevice> helmetDevices = helmetService.helmetServiceList(); + for (THelmetDevice device : helmetDevices){ + RestTemplate restTemplate = new RestTemplate(); + HttpHeaders headers = new HttpHeaders(); + headers.setContentType(MediaType.valueOf(MediaType.APPLICATION_FORM_URLENCODED_VALUE)); + HttpEntity<Map<String, Object>> mapHttpEntity = new HttpEntity<>(null, headers); + String s = restTemplate.postForObject("https://caps.runde.pro/api/index.php?ctl=task&act=get_sos_list&admin_id=8630&user_id="+device.getUserId()+"&p=1"+"&token="+token, mapHttpEntity, String.class); + JSONObject jsonObject = JSONObject.parseObject(s); +// System.out.println("-----------------------------------报警--------------------------"); +// System.out.println(jsonObject); + + List<Map<String,Object>> data = (List<Map<String, Object>>) jsonObject.get("data"); + if(data.size()>0){ + for(int i=data.size()-1;i>0;i--){ + Integer sId = helmetService.userIdReport(Integer.valueOf(data.get(i).get("user_id").toString())); + if((sId!=null && Integer.valueOf(data.get(i).get("s_id").toString())>sId)||sId==null){ + THelmetReport tHelmetReport = new THelmetReport(); + tHelmetReport.setSId(Integer.valueOf(data.get(i).get("s_id").toString())); + tHelmetReport.setUserId(Integer.valueOf(data.get(i).get("user_id").toString())); + tHelmetReport.setUserName(data.get(i).get("user_name").toString()); + tHelmetReport.setDeviceId(data.get(i).get("device_id").toString()); + tHelmetReport.setXPoint(data.get(i).get("x_point").toString()); + tHelmetReport.setYPoint(data.get(i).get("y_point").toString()); + tHelmetReport.setCTime(data.get(i).get("c_time").toString()); + tHelmetReport.setSosType(data.get(i).get("sos_type").toString()); + tHelmetReport.setMsg(data.get(i).get("msg").toString()); + //tHelmetReport.setImgurl(data.get(i).get("msg").toString()); + tHelmetReport.setMobile(data.get(i).get("mobile").toString()); + Date date = new Date(Long.valueOf(data.get(i).get("c_time").toString()+"000")); + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + tHelmetReport.setSmTime(sdf.format(date)); + helmetService.helmetReportInsert(tHelmetReport); + } + } + } + } + } + + //轨迹记录 + @Scheduled(fixedRate = 3000000) // 每隔3秒执行一次任务 + public void taskTrajectory() throws ParseException { + String token = token(); + //System.out.println(token); + List<THelmetDevice> helmetDevices = helmetService.helmetServiceList(); + + Date date = new Date(); + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd 00:00:00"); + SimpleDateFormat simpleDateFormat1 = new SimpleDateFormat("yyyy-MM-dd 23:59:59"); + String format = simpleDateFormat.format(date); + String format1 = simpleDateFormat1.format(date); + Date str = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(format); + Date end = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(format1); + long time = str.getTime(); + long time1 = end.getTime(); + System.out.println(); + String strTime = String.valueOf(time).substring(0, 10); + String endTime = String.valueOf(time1).substring(0, 10); + + for(THelmetDevice helmetDevice : helmetDevices){ + RestTemplate restTemplate = new RestTemplate(); + HttpHeaders headers = new HttpHeaders(); + headers.setContentType(MediaType.valueOf(MediaType.APPLICATION_FORM_URLENCODED_VALUE)); + HttpEntity<Map<String, Object>> mapHttpEntity = new HttpEntity<>(null, headers); + String s = restTemplate.postForObject("https://caps.runde.pro/api/index.php?ctl=device&act=get_devices_online_time_days&admin_id=8630&user_id="+helmetDevice.getUserId()+"&stime="+strTime+"&etime="+endTime+"&token="+token, mapHttpEntity, String.class); + JSONObject jsonObject = JSONObject.parseObject(s); + //Object data = jsonObject.get("data"); +// System.out.println("-----------轨迹回放--------------"); +// System.out.println("-----------轨迹回放--------------"); +// System.out.println("-----------轨迹回放--------------"); +// System.out.println("-----------轨迹回放--------------"); +// System.out.println("-----------轨迹回放--------------"); +// System.out.println(jsonObject); + Object date1 = jsonObject.get("data"); + JSONObject jsonObject1 = JSONObject.parseObject(date1.toString()); + List<Map<String,Object>> list = (List<Map<String, Object>>) jsonObject1.get("list"); + for (Map<String,Object> map : list){ + THelmetTrajectory helmetTrajectory = helmetService.trajectory(helmetDevice.getUserId(),map.get("ctime").toString()); + if(helmetTrajectory==null){ + THelmetTrajectory helmetTrajectory1 = new THelmetTrajectory(); + helmetTrajectory1.setCtime(map.get("ctime").toString()); + helmetTrajectory1.setUserId(helmetDevice.getUserId()); + helmetTrajectory1.setLtime(map.get("ltime").toString()); + helmetTrajectory1.setSec(map.get("sec").toString()); + helmetService.helmetTrajectoryInsert(helmetTrajectory1); + }else { + helmetTrajectory.setLtime(map.get("ltime").toString()); + helmetTrajectory.setSec(map.get("sec").toString()); + helmetService.helmetTrajectoryUpdate(helmetTrajectory); + } + } + + + RestTemplate restTemplate1 = new RestTemplate(); + HttpHeaders headers1 = new HttpHeaders(); + headers1.setContentType(MediaType.valueOf(MediaType.APPLICATION_FORM_URLENCODED_VALUE)); + HttpEntity<Map<String, Object>> mapHttpEntity1 = new HttpEntity<>(null, headers1); + String s1 = restTemplate1.postForObject("https://caps.runde.pro/api/index.php?ctl=location&act=get_user_path_web&admin_id=8630&user_id="+helmetDevice.getUserId()+"&stime="+strTime+"&etime="+endTime+"&token="+token, mapHttpEntity1, String.class); + JSONObject jsonObject11 = JSONObject.parseObject(s1); + System.out.println("--------------------------轨迹 坐标点----------------------"); + System.out.println("--------------------------轨迹 坐标点----------------------"); + System.out.println("--------------------------轨迹 坐标点----------------------"); + System.out.println("--------------------------轨迹 坐标点----------------------"); + System.out.println("--------------------------轨迹 坐标点----------------------"); + System.out.println("--------------------------轨迹 坐标点----------------------"); + System.out.println(jsonObject11); + if(jsonObject11.get("status").toString().equals("true")){ + List<Map<String,Object>> data = (List<Map<String, Object>>) jsonObject11.get("data"); + if(data.size()>0){ + for (Map<String,Object> map :data){ + String times = helmetService.helmetMotion(helmetDevice.getUserId()); + if(StringUtil.isEmpty(times) || (!StringUtil.isEmpty(times)&& Integer.valueOf(map.get(time).toString())>Integer.valueOf(times))){ + THelmetMotion tHelmetMotion = new THelmetMotion(); + tHelmetMotion.setUserId(helmetDevice.getUserId()); + tHelmetMotion.setXPoint(map.get("x_point").toString()); + tHelmetMotion.setYPoint(map.get("y_point").toString()); + tHelmetMotion.setTimes(map.get("time").toString()); + tHelmetMotion.setCAngle(map.get("c_angle").toString()); + tHelmetMotion.setCSpeed(map.get("c_speed").toString()); + tHelmetMotion.setCTrust(map.get("c_trust").toString()); + Date date2 = new Date(Long.valueOf(map.get("time").toString()+"000")); + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + tHelmetMotion.setSmTime(sdf.format(date2)); + helmetService.helmetMotionInsert(tHelmetMotion); + } + } + } + } + } + + } + + + + + + + + public String token(){ + //用户token + RestTemplate restTemplate = new RestTemplate(); + HttpHeaders headers = new HttpHeaders(); + headers.setContentType(MediaType.valueOf(MediaType.APPLICATION_FORM_URLENCODED_VALUE)); + HttpEntity<Map<String, Object>> mapHttpEntity = new HttpEntity<>(null, headers); + String s = restTemplate.postForObject("https://caps.runde.pro/api/index.php?ctl=tool&act=get_pkey&user_name=NJBBT8204&pwd=Bbt162534@", mapHttpEntity, String.class); + JSONObject jsonObject = JSONObject.parseObject(s); + Object data = jsonObject.get("data"); + + RestTemplate restTemplate1 = new RestTemplate(); + HttpHeaders headers1 = new HttpHeaders(); + headers1.setContentType(MediaType.valueOf(MediaType.APPLICATION_FORM_URLENCODED_VALUE)); + HttpEntity<Map<String, Object>> mapHttpEntity1 = new HttpEntity<>(null, headers1); + String s1 = restTemplate1.postForObject("https://caps.runde.pro/api/index.php?ctl=tool&act=get_token&user_name=NJBBT8204&pkey="+data.toString(), mapHttpEntity1, String.class); + JSONObject jsonObject1 = JSONObject.parseObject(s1); + Object data1 = jsonObject1.get("token"); + return data1.toString(); + } + + + + + +} diff --git a/hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/helmet/service/HelmetService.java b/hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/helmet/service/HelmetService.java new file mode 100644 index 0000000..30a5717 --- /dev/null +++ b/hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/helmet/service/HelmetService.java @@ -0,0 +1,43 @@ +package com.thhy.materials.modules.biz.helmet.service; + +import com.thhy.general.common.BasicResult; +import com.thhy.materials.modules.biz.helmet.entity.*; + +import java.util.List; +import java.util.Map; + +public interface HelmetService { + List<THelmetDevice> helmetServiceList(); + + Integer userIdIid(Integer user_id); + + void helmetPictureInsert(THelmetPicture tHelmetPicture); + + Integer userIdReport(Integer user_id); + + void helmetReportInsert(THelmetReport tHelmetReport); + + THelmetTrajectory trajectory(Integer userId, String ctime); + + void helmetTrajectoryInsert(THelmetTrajectory helmetTrajectory); + + void helmetTrajectoryUpdate(THelmetTrajectory helmetTrajectory); + + String helmetMotion(Integer userId); + + void helmetMotionInsert(THelmetMotion tHelmetMotion); + + BasicResult helmetList(Map<String, Object> values); + + BasicResult helmetPictureList(Map<String, Object> values); + + BasicResult helmetTrajectoryList(Map<String, Object> values); + + BasicResult helmetMotionList(Map<String, Object> values); + + BasicResult dataValueInsert(Map<String, Object> values); + + BasicResult helmetReportTotal(Map<String, Object> values); + + BasicResult helmetReportUser(Map<String, Object> values); +} diff --git a/hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/helmet/service/impl/HelmetServiceImpl.java b/hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/helmet/service/impl/HelmetServiceImpl.java new file mode 100644 index 0000000..4309279 --- /dev/null +++ b/hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/helmet/service/impl/HelmetServiceImpl.java @@ -0,0 +1,135 @@ +package com.thhy.materials.modules.biz.helmet.service.impl; + +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import com.thhy.general.common.BasicResult; +import com.thhy.materials.modules.biz.helmet.entity.*; +import com.thhy.materials.modules.biz.helmet.entity.dto.ReportNumDto; +import com.thhy.materials.modules.biz.helmet.mapper.HelmetMapper; +import com.thhy.materials.modules.biz.helmet.service.HelmetService; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@Service +public class HelmetServiceImpl implements HelmetService { + + @Resource + private HelmetMapper helmetMapper; + + + @Override + public List<THelmetDevice> helmetServiceList() { + List<THelmetDevice> helmetDevices = helmetMapper.helmetServiceList(); + return helmetDevices; + } + + @Override + public Integer userIdIid(Integer user_id) { + Integer helmetDevices = helmetMapper.userIdIid(user_id); + return helmetDevices; + } + + @Override + public void helmetPictureInsert(THelmetPicture tHelmetPicture) { + helmetMapper.helmetPictureInsert(tHelmetPicture); + } + + @Override + public Integer userIdReport(Integer user_id) { + Integer helmetDevices = helmetMapper.userIdReport(user_id); + return helmetDevices; + } + + @Override + public void helmetReportInsert(THelmetReport tHelmetReport) { + helmetMapper.helmetReportInsert(tHelmetReport); + } + + @Override + public THelmetTrajectory trajectory(Integer userId, String ctime) { + return helmetMapper.trajectory(userId,ctime); + } + + @Override + public void helmetTrajectoryInsert(THelmetTrajectory helmetTrajectory) { + helmetMapper.helmetTrajectoryInsert(helmetTrajectory); + } + + @Override + public void helmetTrajectoryUpdate(THelmetTrajectory helmetTrajectory) { + helmetMapper.helmetTrajectoryUpdate(helmetTrajectory); + } + + @Override + public String helmetMotion(Integer userId) { + return helmetMapper.helmetMotion(userId); + } + + @Override + public void helmetMotionInsert(THelmetMotion tHelmetMotion) { + helmetMapper.helmetMotionInsert(tHelmetMotion); + } + + @Override + public BasicResult helmetList(Map<String, Object> values) { + Integer pageNum = Integer.valueOf(values.get("pageNum").toString()); + Integer pageSize = Integer.valueOf(values.get("pageSize").toString()); + PageHelper.startPage(pageNum,pageSize); + List<THelmetDevice> helmetDevices = helmetMapper.helmetList(values); + PageInfo<THelmetDevice> tHelmetDevicePageInfo = new PageInfo<>(helmetDevices); + return BasicResult.success(tHelmetDevicePageInfo); + } + + @Override + public BasicResult helmetPictureList(Map<String, Object> values) { + Integer pageNum = Integer.valueOf(values.get("pageNum").toString()); + Integer pageSize = Integer.valueOf(values.get("pageSize").toString()); + PageHelper.startPage(pageNum,pageSize); + List<THelmetPicture> helmetPictures = helmetMapper.helmetPictureList(values); + PageInfo<THelmetPicture> helmetPicturePageInfo = new PageInfo<>(helmetPictures); + return BasicResult.success(helmetPicturePageInfo); + } + + @Override + public BasicResult helmetTrajectoryList(Map<String, Object> values) { + List<THelmetTrajectory> tHelmetTrajectory = helmetMapper.helmetTrajectoryList(values); + String total = helmetMapper.helmetTrajectoryTime(values); + HashMap<String, Object> hashMap = new HashMap<>(); + hashMap.put("tHelmetTrajectory",tHelmetTrajectory); + hashMap.put("total",total); + return BasicResult.success(hashMap); + } + + @Override + public BasicResult helmetMotionList(Map<String, Object> values) { + List<THelmetMotion> helmetMotions = helmetMapper.helmetMotionList(values); + return BasicResult.success(helmetMotions); + } + + @Override + public BasicResult dataValueInsert(Map<String, Object> values) { + + + helmetMapper.dataValueInsert(values); + return BasicResult.success(); + } + + @Override + public BasicResult helmetReportTotal(Map<String, Object> values) { + HashMap<String, Object> reportNum = new HashMap<>(); + List<ReportNumDto> reportNumDtos = helmetMapper.helmetReportTotal(values); + reportNum.put("reportNumDtos",reportNumDtos); + reportNum.put("day",reportNumDtos.size()); + return BasicResult.success(reportNum); + } + + @Override + public BasicResult helmetReportUser(Map<String, Object> values) { + List<THelmetReport> helmetReports = helmetMapper.helmetReportUser(values); + return BasicResult.success(helmetReports); + } +} diff --git a/hd/pipe/materialsManage/src/main/resources/application-dev.yml b/hd/pipe/materialsManage/src/main/resources/application-dev.yml index 7b7de76..29ee1c0 100644 --- a/hd/pipe/materialsManage/src/main/resources/application-dev.yml +++ b/hd/pipe/materialsManage/src/main/resources/application-dev.yml @@ -1,13 +1,11 @@ -server: - port: 8892 spring: config: activate: on-profile: dev import: - optional:nacos:${spring.application.name}-${spring.config.activate.on-profile}.${spring.cloud.nacos.config.file-extension} - - optional:nacos:supipe-common-${spring.config.activate.on-profile}.${spring.cloud.nacos.config.file-extension} - - optional:nacos:supipe-rocket-${spring.config.activate.on-profile}.${spring.cloud.nacos.config.file-extension} + - optional:nacos:pipe-common-${spring.config.activate.on-profile}.${spring.cloud.nacos.config.file-extension} + - optional:nacos:pipe-rocket-${spring.config.activate.on-profile}.${spring.cloud.nacos.config.file-extension} cloud: nacos: server-addr: 111.30.93.215:8848 @@ -15,6 +13,10 @@ heart-beat-interval: 3000 heart-beat-timeout: 15000 group: supipe + namespace: suzhou config: file-extension: yml - group: sunacos \ No newline at end of file + group: sunacos + namespace: suzhou +server: + port: ${${spring.application.name}port} \ No newline at end of file diff --git a/hd/pipe/materialsManage/src/main/resources/application-pro.yml b/hd/pipe/materialsManage/src/main/resources/application-pro.yml index f1dacbe..ebe85f8 100644 --- a/hd/pipe/materialsManage/src/main/resources/application-pro.yml +++ b/hd/pipe/materialsManage/src/main/resources/application-pro.yml @@ -4,8 +4,8 @@ on-profile: pro import: - optional:nacos:${spring.application.name}-${spring.config.activate.on-profile}.${spring.cloud.nacos.config.file-extension} - - optional:nacos:supipe-common-${spring.config.activate.on-profile}.${spring.cloud.nacos.config.file-extension} - - optional:nacos:supipe-rocket-${spring.config.activate.on-profile}.${spring.cloud.nacos.config.file-extension} + - optional:nacos:pipe-common-${spring.config.activate.on-profile}.${spring.cloud.nacos.config.file-extension} + - optional:nacos:pipe-rocket-${spring.config.activate.on-profile}.${spring.cloud.nacos.config.file-extension} cloud: nacos: server-addr: 111.30.93.215:8848 @@ -13,6 +13,10 @@ heart-beat-interval: 3000 heart-beat-timeout: 15000 group: supipe + namespace: suzhou config: file-extension: yml - group: sunacos \ No newline at end of file + group: sunacos + namespace: suzhou +server: + port: ${${spring.application.name}port} \ No newline at end of file diff --git a/hd/pipe/materialsManage/src/main/resources/mapping/THelmetDeviceMapper.xml b/hd/pipe/materialsManage/src/main/resources/mapping/THelmetDeviceMapper.xml new file mode 100644 index 0000000..c8897d0 --- /dev/null +++ b/hd/pipe/materialsManage/src/main/resources/mapping/THelmetDeviceMapper.xml @@ -0,0 +1,552 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> +<mapper namespace="com.thhy.materials.modules.biz.helmet.mapper.HelmetMapper"> + <resultMap id="BaseResultMap" type="com.thhy.materials.modules.biz.helmet.entity.THelmetDevice"> + <!-- + WARNING - @mbg.generated + This element is automatically generated by MyBatis Generator, do not modify. + This element was generated on Tue Oct 10 10:55:08 CST 2023. + --> + <id column="helmet_device_id" jdbcType="VARCHAR" property="helmetDeviceId" /> + <result column="device_num" jdbcType="VARCHAR" property="deviceNum" /> + <result column="user_id" jdbcType="INTEGER" property="userId" /> + <result column="user_name" jdbcType="VARCHAR" property="userName" /> + </resultMap> + + + <select id="helmetServiceList" resultType="com.thhy.materials.modules.biz.helmet.entity.THelmetDevice"> + select helmet_device_id as helmetDeviceId, + device_num as deviceNum, + user_id as userId, + user_name as userName + from t_helmet_device + </select> + <select id="userIdIid" parameterType="java.lang.Integer" resultType="java.lang.Integer"> + SELECT + i_id +FROM + t_helmet_picture +where user_id=#{userId} +ORDER BY + i_id DESC + LIMIT 0,1 + </select> + <select id="userIdReport" parameterType="java.lang.Integer" resultType="java.lang.Integer"> + SELECT + s_id +FROM + t_helmet_report +where user_id=#{userId} +ORDER BY + s_id DESC + LIMIT 0,1 + </select> + <insert id="helmetPictureInsert" parameterType="com.thhy.materials.modules.biz.helmet.entity.THelmetPicture"> + insert into t_helmet_picture + <trim prefix="(" suffix=")" suffixOverrides=","> + <if test="helmetPictureId != null"> + helmet_picture_id, + </if> + <if test="imageUrl != null"> + image_url, + </if> + <if test="userId != null"> + user_id, + </if> + <if test="xPoint != null"> + x_point, + </if> + <if test="yPoint != null"> + y_point, + </if> + <if test="creTime != null"> + cre_time, + </if> + <if test="iId != null"> + i_id, + </if> + <if test="smTime != null"> + sm_time, + </if> + </trim> + <trim prefix="values (" suffix=")" suffixOverrides=","> + <if test="helmetPictureId != null"> + #{helmetPictureId,jdbcType=INTEGER}, + </if> + <if test="imageUrl != null"> + #{imageUrl,jdbcType=VARCHAR}, + </if> + <if test="userId != null"> + #{userId,jdbcType=INTEGER}, + </if> + <if test="xPoint != null"> + #{xPoint,jdbcType=VARCHAR}, + </if> + <if test="yPoint != null"> + #{yPoint,jdbcType=VARCHAR}, + </if> + <if test="creTime != null"> + #{creTime,jdbcType=VARCHAR}, + </if> + <if test="iId != null"> + #{iId,jdbcType=INTEGER}, + </if> + <if test="smTime != null"> + #{smTime}, + </if> + </trim> + </insert> + <insert id="helmetReportInsert" > + insert into t_helmet_report + <trim prefix="(" suffix=")" suffixOverrides=","> + <if test="reportId != null"> + report_id, + </if> + <if test="sId != null"> + s_id, + </if> + <if test="userId != null"> + user_id, + </if> + <if test="userName != null"> + user_name, + </if> + <if test="deviceId != null"> + device_id, + </if> + <if test="xPoint != null"> + x_point, + </if> + <if test="yPoint != null"> + y_point, + </if> + <if test="cTime != null"> + c_time, + </if> + <if test="sosType != null"> + sos_type, + </if> + <if test="msg != null"> + msg, + </if> + <if test="imgurl != null"> + imgurl, + </if> + <if test="mobile != null"> + mobile, + </if> + <if test="smTime != null"> + sm_time, + </if> + </trim> + <trim prefix="values (" suffix=")" suffixOverrides=","> + <if test="reportId != null"> + #{reportId,jdbcType=INTEGER}, + </if> + <if test="sId != null"> + #{sId,jdbcType=INTEGER}, + </if> + <if test="userId != null"> + #{userId,jdbcType=INTEGER}, + </if> + <if test="userName != null"> + #{userName,jdbcType=VARCHAR}, + </if> + <if test="deviceId != null"> + #{deviceId,jdbcType=VARCHAR}, + </if> + <if test="xPoint != null"> + #{xPoint,jdbcType=VARCHAR}, + </if> + <if test="yPoint != null"> + #{yPoint,jdbcType=VARCHAR}, + </if> + <if test="cTime != null"> + #{cTime,jdbcType=VARCHAR}, + </if> + <if test="sosType != null"> + #{sosType,jdbcType=VARCHAR}, + </if> + <if test="msg != null"> + #{msg,jdbcType=VARCHAR}, + </if> + <if test="imgurl != null"> + #{imgurl,jdbcType=VARCHAR}, + </if> + <if test="mobile != null"> + #{mobile,jdbcType=VARCHAR}, + </if> + <if test="smTime != null"> + #{smTime,jdbcType=VARCHAR}, + </if> + </trim> + </insert> + <select id="trajectory" resultType="com.thhy.materials.modules.biz.helmet.entity.THelmetTrajectory"> + SELECT + trajectory_id AS trajectoryId, + ctime, + ltime, + sec, + user_id AS userId +FROM + t_helmet_trajectory +WHERE + ctime = #{ctime} and user_id=#{userId} + </select> + <insert id="helmetTrajectoryInsert" > + insert into t_helmet_trajectory + <trim prefix="(" suffix=")" suffixOverrides=","> + <if test="trajectoryId != null"> + trajectory_id, + </if> + <if test="ctime != null"> + ctime, + </if> + <if test="ltime != null"> + ltime, + </if> + <if test="sec != null"> + sec, + </if> + <if test="userId != null"> + user_id, + </if> + </trim> + <trim prefix="values (" suffix=")" suffixOverrides=","> + <if test="trajectoryId != null"> + #{trajectoryId,jdbcType=INTEGER}, + </if> + <if test="ctime != null"> + #{ctime,jdbcType=VARCHAR}, + </if> + <if test="ltime != null"> + #{ltime,jdbcType=VARCHAR}, + </if> + <if test="sec != null"> + #{sec,jdbcType=VARCHAR}, + </if> + <if test="userId != null"> + #{userId,jdbcType=INTEGER}, + </if> + </trim> + </insert> + + <update id="helmetTrajectoryUpdate"> + update t_helmet_trajectory + <set> + <if test="ctime != null"> + ctime = #{ctime,jdbcType=VARCHAR}, + </if> + <if test="ltime != null"> + ltime = #{ltime,jdbcType=VARCHAR}, + </if> + <if test="sec != null"> + sec = #{sec,jdbcType=VARCHAR}, + </if> + <if test="userId != null"> + user_id = #{userId,jdbcType=INTEGER}, + </if> + </set> + where trajectory_id = #{trajectoryId,jdbcType=INTEGER} + </update> + <select id="helmetMotion" parameterType="java.lang.Integer" resultType="java.lang.String"> + select times from t_helmet_motion where user_id=#{userId} order by times desc limit 0,1 + </select> + <insert id="helmetMotionInsert"> + insert into t_helmet_motion + <trim prefix="(" suffix=")" suffixOverrides=","> + <if test="motionId != null"> + motion_id, + </if> + <if test="userId != null"> + user_id, + </if> + <if test="xPoint != null"> + x_point, + </if> + <if test="yPoint != null"> + y_point, + </if> + <if test="times != null"> + times, + </if> + <if test="cAngle != null"> + c_angle, + </if> + <if test="cSpeed != null"> + c_speed, + </if> + <if test="cTrust != null"> + c_trust, + </if> + <if test="smTime != null"> + sm_time, + </if> + </trim> + <trim prefix="values (" suffix=")" suffixOverrides=","> + <if test="motionId != null"> + #{motionId,jdbcType=INTEGER}, + </if> + <if test="userId != null"> + #{userId,jdbcType=INTEGER}, + </if> + <if test="xPoint != null"> + #{xPoint,jdbcType=VARCHAR}, + </if> + <if test="yPoint != null"> + #{yPoint,jdbcType=VARCHAR}, + </if> + <if test="times != null"> + #{times,jdbcType=VARCHAR}, + </if> + <if test="cAngle != null"> + #{cAngle,jdbcType=VARCHAR}, + </if> + <if test="cSpeed != null"> + #{cSpeed,jdbcType=VARCHAR}, + </if> + <if test="cTrust != null"> + #{cTrust,jdbcType=VARCHAR}, + </if> + <if test="smTime != null"> + #{smTime,jdbcType=VARCHAR}, + </if> + </trim> + </insert> + + <select id="helmetList" resultType="com.thhy.materials.modules.biz.helmet.entity.THelmetDevice"> + select helmet_device_id as helmetDeviceId, + device_num as deviceNum, + user_id as userId, + user_name as userName + from t_helmet_device + where 1=1 + <if test="userName!=null and userName!='' "> + and user_name like concat('%',#{userName},'%') + </if> + <if test="deviceNum!=null and deviceNum!='' "> + and device_num like concat('%',#{deviceNum},'%') + </if> + </select> + + <select id="helmetPictureList" resultType="com.thhy.materials.modules.biz.helmet.entity.THelmetPicture"> + select + thp.image_url as imageUrl, + thp.user_id as userId, + thp.x_point as xPoint, + thp.y_point as yPoint, + thp.cre_time as creTime, + thp.i_id as iId, + thp.sm_time as smTime + from t_helmet_picture thp + where 1=1 + <if test="userId!=null and userId!='' "> + and thp.user_id=#{userId} + </if> + <if test="strTime!=null and strTime!='' and endTime!=null and endTime!='' "> + and thp.sm_time between #{strTime} and #{endTime} + </if> + order by thp.cre_time desc + </select> + + <select id="helmetTrajectoryList" resultType="com.thhy.materials.modules.biz.helmet.entity.THelmetTrajectory"> + select + trajectory_id as trajectoryId, + ctime, + ltime, + sec + from t_helmet_trajectory where 1=1 + <if test="userId!=null and userId!='' "> + and user_id=#{userId} + </if> + <if test="strTime!=null and strTime!='' and endTime!=null and endTime!='' "> + and ctime between #{strTime} and #{endTime} + </if> + </select> + + <select id="helmetTrajectoryTime" resultType="java.lang.String"> + SELECT + SUM( ltime ) +FROM + t_helmet_trajectory +WHERE + 1=1 + <if test="userId!=null and userId!='' "> + and user_id=#{userId} + </if> + <if test="strTime!=null and strTime!='' and endTime!=null and endTime!='' "> + and ctime between #{strTime} and #{endTime} + </if> +GROUP BY + user_id + </select> + + <select id="helmetMotionList" resultType="com.thhy.materials.modules.biz.helmet.entity.THelmetMotion"> + select + motion_id as motionId, + user_id as userId, + x_point as xPoint, + y_point as yPoint, + times, + c_angle as cAngle, + c_speed as cSpeed, + c_trust as cTrust, + sm_time as smTime + from t_helmet_motion + where + user_id=#{userId} + <if test="strTime!=null and strTime!='' and endTime!=null and endTime!='' "> + and sm_time between #{strTime} and #{endTime} + </if> + order by times asc + </select> + + <insert id="dataValueInsert" > + insert into t_data_value + <trim prefix="(" suffix=")" suffixOverrides=","> + <if test="dataId != null"> + data_id, + </if> + <if test="deviceId != null"> + device_id, + </if> + <if test="deviceName != null"> + device_name, + </if> + <if test="accountNumber != null"> + account_number, + </if> + <if test="uploadTime != null"> + upload_time, + </if> + <if test="pm25 != null"> + pm25, + </if> + <if test="pm10 != null"> + pm10, + </if> + <if test="tsp != null"> + tsp, + </if> + <if test="temperature != null"> + temperature, + </if> + <if test="humidity != null"> + humidity, + </if> + <if test="data6 != null"> + data6, + </if> + <if test="windSpeed != null"> + wind_speed, + </if> + <if test="windDirection != null"> + wind_direction, + </if> + <if test="tvoc != null"> + tvoc, + </if> + <if test="no2 != null"> + no2, + </if> + <if test="co != null"> + co, + </if> + <if test="so2 != null"> + so2, + </if> + <if test="o3 != null"> + o3, + </if> + <if test="noise != null"> + noise, + </if> + </trim> + <trim prefix="values (" suffix=")" suffixOverrides=","> + <if test="dataId != null"> + #{dataId,jdbcType=INTEGER}, + </if> + <if test="deviceId != null"> + #{deviceId,jdbcType=INTEGER}, + </if> + <if test="deviceName != null"> + #{deviceName,jdbcType=VARCHAR}, + </if> + <if test="accountNumber != null"> + #{accountNumber,jdbcType=VARCHAR}, + </if> + <if test="uploadTime != null"> + #{uploadTime,jdbcType=VARCHAR}, + </if> + <if test="pm25 != null"> + #{pm25,jdbcType=VARCHAR}, + </if> + <if test="pm10 != null"> + #{pm10,jdbcType=VARCHAR}, + </if> + <if test="tsp != null"> + #{tsp,jdbcType=VARCHAR}, + </if> + <if test="temperature != null"> + #{temperature,jdbcType=VARCHAR}, + </if> + <if test="humidity != null"> + #{humidity,jdbcType=VARCHAR}, + </if> + <if test="data6 != null"> + #{data6,jdbcType=VARCHAR}, + </if> + <if test="windSpeed != null"> + #{windSpeed,jdbcType=VARCHAR}, + </if> + <if test="windDirection != null"> + #{windDirection,jdbcType=VARCHAR}, + </if> + <if test="tvoc != null"> + #{tvoc,jdbcType=VARCHAR}, + </if> + <if test="no2 != null"> + #{no2,jdbcType=VARCHAR}, + </if> + <if test="co != null"> + #{co,jdbcType=VARCHAR}, + </if> + <if test="so2 != null"> + #{so2,jdbcType=VARCHAR}, + </if> + <if test="o3 != null"> + #{o3,jdbcType=VARCHAR}, + </if> + <if test="noise != null"> + #{noise,jdbcType=VARCHAR}, + </if> + </trim> + </insert> + + <select id="helmetReportTotal" resultType="com.thhy.materials.modules.biz.helmet.entity.dto.ReportNumDto"> + SELECT + COUNT(sm_time) AS num, + DATE(sm_time) as smTime + FROM + t_helmet_report + WHERE + user_id = #{userId} + <if test="strTime!=null and strTime!='' and endTime!=null and endTime!='' "> + and sm_time between #{strTime} and #{endTime} + </if> + GROUP BY + DATE( sm_time ) + </select> + + <select id="helmetReportUser" resultType="com.thhy.materials.modules.biz.helmet.entity.THelmetReport"> + select user_id as userId, + user_name as userName, + sos_type as sosType, + x_point as xPoint, + y_point as yPoint, + sm_time as smTime + from t_helmet_report where + user_id=#{userId} + order by sm_time desc + </select> +</mapper> \ No newline at end of file diff --git a/hd/pipe/mobile/src/main/java/com/thhy/mobile/modules/biz/checkdevice/entity/CheckDeviceListVo.java b/hd/pipe/mobile/src/main/java/com/thhy/mobile/modules/biz/checkdevice/entity/CheckDeviceListVo.java index 19b3efd..5b4f64a 100644 --- a/hd/pipe/mobile/src/main/java/com/thhy/mobile/modules/biz/checkdevice/entity/CheckDeviceListVo.java +++ b/hd/pipe/mobile/src/main/java/com/thhy/mobile/modules/biz/checkdevice/entity/CheckDeviceListVo.java @@ -42,6 +42,8 @@ private String checkType; + private String checkTypeName; + /** * 创建时间 */ diff --git a/hd/pipe/mobile/src/main/resources/application-dev.yml b/hd/pipe/mobile/src/main/resources/application-dev.yml index 821bb43..29ee1c0 100644 --- a/hd/pipe/mobile/src/main/resources/application-dev.yml +++ b/hd/pipe/mobile/src/main/resources/application-dev.yml @@ -1,13 +1,11 @@ -server: - port: 8884 spring: config: activate: on-profile: dev import: - optional:nacos:${spring.application.name}-${spring.config.activate.on-profile}.${spring.cloud.nacos.config.file-extension} - - optional:nacos:supipe-common-${spring.config.activate.on-profile}.${spring.cloud.nacos.config.file-extension} - - optional:nacos:supipe-rocket-${spring.config.activate.on-profile}.${spring.cloud.nacos.config.file-extension} + - optional:nacos:pipe-common-${spring.config.activate.on-profile}.${spring.cloud.nacos.config.file-extension} + - optional:nacos:pipe-rocket-${spring.config.activate.on-profile}.${spring.cloud.nacos.config.file-extension} cloud: nacos: server-addr: 111.30.93.215:8848 @@ -15,6 +13,10 @@ heart-beat-interval: 3000 heart-beat-timeout: 15000 group: supipe + namespace: suzhou config: file-extension: yml - group: sunacos \ No newline at end of file + group: sunacos + namespace: suzhou +server: + port: ${${spring.application.name}port} \ No newline at end of file diff --git a/hd/pipe/mobile/src/main/resources/application-pro.yml b/hd/pipe/mobile/src/main/resources/application-pro.yml index f1dacbe..ebe85f8 100644 --- a/hd/pipe/mobile/src/main/resources/application-pro.yml +++ b/hd/pipe/mobile/src/main/resources/application-pro.yml @@ -4,8 +4,8 @@ on-profile: pro import: - optional:nacos:${spring.application.name}-${spring.config.activate.on-profile}.${spring.cloud.nacos.config.file-extension} - - optional:nacos:supipe-common-${spring.config.activate.on-profile}.${spring.cloud.nacos.config.file-extension} - - optional:nacos:supipe-rocket-${spring.config.activate.on-profile}.${spring.cloud.nacos.config.file-extension} + - optional:nacos:pipe-common-${spring.config.activate.on-profile}.${spring.cloud.nacos.config.file-extension} + - optional:nacos:pipe-rocket-${spring.config.activate.on-profile}.${spring.cloud.nacos.config.file-extension} cloud: nacos: server-addr: 111.30.93.215:8848 @@ -13,6 +13,10 @@ heart-beat-interval: 3000 heart-beat-timeout: 15000 group: supipe + namespace: suzhou config: file-extension: yml - group: sunacos \ No newline at end of file + group: sunacos + namespace: suzhou +server: + port: ${${spring.application.name}port} \ No newline at end of file diff --git a/hd/pipe/mobile/src/main/resources/mapping/CheckDeviceMapper.xml b/hd/pipe/mobile/src/main/resources/mapping/CheckDeviceMapper.xml index 172cfdc..00f1422 100644 --- a/hd/pipe/mobile/src/main/resources/mapping/CheckDeviceMapper.xml +++ b/hd/pipe/mobile/src/main/resources/mapping/CheckDeviceMapper.xml @@ -88,6 +88,7 @@ t.check_type as checkType, t.create_time as createTime, t.device_id as deviceId, + sd1.dict_name as checkTypeName, bd.big_device_name as bigDeviceName, bd.big_device_model as bigDeviceModel, bd.big_number as bigNumber, @@ -98,17 +99,19 @@ from t_check_device t left join t_big_device bd on t.device_id = bd.big_device_id left join sys_dict sd on sd.dict_id = bd.big_type + left join sys_dict sd1 on sd1.dict_id = t.check_type left join sys_users su on su.user_id = t.admin_user <where> <trim suffixOverrides=" AND "> + t.is_use = 1 AND <if test="bigDeviceName !=null and bigDeviceName !=''"> - bd.big_device_name LIKE concat('%',#{bigDeviceName},'%') + bd.big_device_name LIKE concat('%',#{bigDeviceName},'%') AND </if> <if test="startTime !=null"> - t.check_time >= #{startTime} + t.check_time >= #{startTime} AND </if> <if test="endTime !=null"> - t.check_time <= #{endTime} + t.check_time <= #{endTime} AND </if> </trim> </where> diff --git a/hd/pipe/screen/src/main/resources/application-dev.yml b/hd/pipe/screen/src/main/resources/application-dev.yml index f5bd292..d272ba8 100644 --- a/hd/pipe/screen/src/main/resources/application-dev.yml +++ b/hd/pipe/screen/src/main/resources/application-dev.yml @@ -4,8 +4,8 @@ on-profile: dev import: - optional:nacos:${spring.application.name}-${spring.config.activate.on-profile}.${spring.cloud.nacos.config.file-extension} - - optional:nacos:supipe-common-${spring.config.activate.on-profile}.${spring.cloud.nacos.config.file-extension} - - optional:nacos:supipe-rocket-${spring.config.activate.on-profile}.${spring.cloud.nacos.config.file-extension} + - optional:nacos:pipe-common-${spring.config.activate.on-profile}.${spring.cloud.nacos.config.file-extension} + - optional:nacos:pipe-rocket-${spring.config.activate.on-profile}.${spring.cloud.nacos.config.file-extension} cloud: nacos: server-addr: 111.30.93.215:8848 @@ -13,6 +13,12 @@ heart-beat-interval: 3000 heart-beat-timeout: 15000 group: supipe + namespace: suzhou config: file-extension: yml - group: sunacos \ No newline at end of file + group: sunacos + namespace: suzhou +server: + port: ${${spring.application.name}port} +netty: + port: ${${spring.application.name}nettyport} \ No newline at end of file diff --git a/hd/pipe/screen/src/main/resources/application-pro.yml b/hd/pipe/screen/src/main/resources/application-pro.yml index f1dacbe..2f83d6b 100644 --- a/hd/pipe/screen/src/main/resources/application-pro.yml +++ b/hd/pipe/screen/src/main/resources/application-pro.yml @@ -4,8 +4,8 @@ on-profile: pro import: - optional:nacos:${spring.application.name}-${spring.config.activate.on-profile}.${spring.cloud.nacos.config.file-extension} - - optional:nacos:supipe-common-${spring.config.activate.on-profile}.${spring.cloud.nacos.config.file-extension} - - optional:nacos:supipe-rocket-${spring.config.activate.on-profile}.${spring.cloud.nacos.config.file-extension} + - optional:nacos:pipe-common-${spring.config.activate.on-profile}.${spring.cloud.nacos.config.file-extension} + - optional:nacos:pipe-rocket-${spring.config.activate.on-profile}.${spring.cloud.nacos.config.file-extension} cloud: nacos: server-addr: 111.30.93.215:8848 @@ -13,6 +13,12 @@ heart-beat-interval: 3000 heart-beat-timeout: 15000 group: supipe + namespace: suzhou config: file-extension: yml - group: sunacos \ No newline at end of file + group: sunacos + namespace: suzhou +server: + port: ${${spring.application.name}port} +netty: + port: ${${spring.application.name}nettyport} \ No newline at end of file diff --git a/hd/pipe/secure/src/main/resources/application-dev.yml b/hd/pipe/secure/src/main/resources/application-dev.yml index b8519ec..29ee1c0 100644 --- a/hd/pipe/secure/src/main/resources/application-dev.yml +++ b/hd/pipe/secure/src/main/resources/application-dev.yml @@ -1,13 +1,11 @@ -server: - port: 8886 spring: config: activate: on-profile: dev import: - optional:nacos:${spring.application.name}-${spring.config.activate.on-profile}.${spring.cloud.nacos.config.file-extension} - - optional:nacos:supipe-common-${spring.config.activate.on-profile}.${spring.cloud.nacos.config.file-extension} - - optional:nacos:supipe-rocket-${spring.config.activate.on-profile}.${spring.cloud.nacos.config.file-extension} + - optional:nacos:pipe-common-${spring.config.activate.on-profile}.${spring.cloud.nacos.config.file-extension} + - optional:nacos:pipe-rocket-${spring.config.activate.on-profile}.${spring.cloud.nacos.config.file-extension} cloud: nacos: server-addr: 111.30.93.215:8848 @@ -15,6 +13,10 @@ heart-beat-interval: 3000 heart-beat-timeout: 15000 group: supipe + namespace: suzhou config: file-extension: yml - group: sunacos \ No newline at end of file + group: sunacos + namespace: suzhou +server: + port: ${${spring.application.name}port} \ No newline at end of file diff --git a/hd/pipe/secure/src/main/resources/application-pro.yml b/hd/pipe/secure/src/main/resources/application-pro.yml index f1dacbe..ebe85f8 100644 --- a/hd/pipe/secure/src/main/resources/application-pro.yml +++ b/hd/pipe/secure/src/main/resources/application-pro.yml @@ -4,8 +4,8 @@ on-profile: pro import: - optional:nacos:${spring.application.name}-${spring.config.activate.on-profile}.${spring.cloud.nacos.config.file-extension} - - optional:nacos:supipe-common-${spring.config.activate.on-profile}.${spring.cloud.nacos.config.file-extension} - - optional:nacos:supipe-rocket-${spring.config.activate.on-profile}.${spring.cloud.nacos.config.file-extension} + - optional:nacos:pipe-common-${spring.config.activate.on-profile}.${spring.cloud.nacos.config.file-extension} + - optional:nacos:pipe-rocket-${spring.config.activate.on-profile}.${spring.cloud.nacos.config.file-extension} cloud: nacos: server-addr: 111.30.93.215:8848 @@ -13,6 +13,10 @@ heart-beat-interval: 3000 heart-beat-timeout: 15000 group: supipe + namespace: suzhou config: file-extension: yml - group: sunacos \ No newline at end of file + group: sunacos + namespace: suzhou +server: + port: ${${spring.application.name}port} \ No newline at end of file diff --git a/web/src/views/LayoutIndex/components/LayoutAside.vue b/web/src/views/LayoutIndex/components/LayoutAside.vue index 3ed7255..8d29a32 100644 --- a/web/src/views/LayoutIndex/components/LayoutAside.vue +++ b/web/src/views/LayoutIndex/components/LayoutAside.vue @@ -21,7 +21,7 @@ <template v-for="three in item.children"> <template v-if="three.children && three.children.length > 1"> - <el-submenu :key="three.name" :index="three.path"> + <el-submenu :key="three.name" :index="three.path" class="titles_two"> <template slot="title"> <span>{{three.meta.title}}</span> </template> @@ -117,6 +117,10 @@ } } +.titles_two{ + padding-left: 15px; +} + /deep/ .el-menu { border-right: 0; } -- Gitblit v1.9.3