Merge branch 'master' of http://111.30.93.211:10101/r/supipe
| | |
| | | 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 |
| | |
| | | heart-beat-interval: 3000 |
| | | heart-beat-timeout: 15000 |
| | | group: supipe |
| | | namespace: suzhou |
| | | config: |
| | | file-extension: yml |
| | | group: sunacos |
| | | group: sunacos |
| | | namespace: suzhou |
| | | server: |
| | | port: ${${spring.application.name}port} |
| | |
| | | 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 |
| | |
| | | heart-beat-interval: 3000 |
| | | heart-beat-timeout: 15000 |
| | | group: supipe |
| | | namespace: suzhou |
| | | config: |
| | | file-extension: yml |
| | | group: sunacos |
| | | group: sunacos |
| | | namespace: suzhou |
| | | server: |
| | | port: ${${spring.application.name}port} |
对比新文件 |
| | |
| | | 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; |
| | | } |
对比新文件 |
| | |
| | | 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; |
| | | } |
| | | } |
| | |
| | | |
| | | List<FaceDevice> findList(FaceDevice facedevice); |
| | | |
| | | List<String> queryDevSn(); |
| | | |
| | | List<FaceDevice> findAll(); |
| | | |
| | | int countByDevSn(String devSn); |
| | |
| | | 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; |
| | |
| | | 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); |
| | |
| | | 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){ |
| | |
| | | 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); |
| | |
| | | } |
| | | 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()); |
| | | } |
| | | } |
| | |
| | | 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); |
| | | |
| | |
| | | //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); |
对比新文件 |
| | |
| | | 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())); |
| | | } |
| | | } |
| | |
| | | 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 |
| | |
| | | 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 |
| | | port: ${${spring.application.name}nettyport} |
| | |
| | | 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 |
| | |
| | | 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/ |
| | | namespace: suzhou |
| | | server: |
| | | port: ${${spring.application.name}port} |
| | | netty: |
| | | port: ${${spring.application.name}nettyport} |
| | |
| | | <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 |
| | |
| | | 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 |
| | |
| | | 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 |
| | | secret: 87f19fa7f1e6898fb143396283e733b8 |
| | | server: |
| | | port: ${${spring.application.name}port} |
| | |
| | | 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 |
| | |
| | | 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 |
| | | secret: 87f19fa7f1e6898fb143396283e733b8 |
| | | server: |
| | | port: ${${spring.application.name}port} |
| | |
| | | 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 |
| | |
| | | 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} |
| | |
| | | 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 |
| | |
| | | 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} |
| | |
| | | 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 |
| | |
| | | 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} |
| | |
| | | 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 |
| | |
| | | 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} |
| | |
| | | server: |
| | | port: 8880 |
| | | spring: |
| | | cloud: |
| | | nacos: |
| | |
| | | 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} |
| | | - 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} |
| | |
| | | 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} |
| | | - 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} |
对比新文件 |
| | |
| | | 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); |
| | | } |
| | | |
| | | |
| | | } |
对比新文件 |
| | |
| | | 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; |
| | | } |
对比新文件 |
| | |
| | | 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; |
| | | } |
对比新文件 |
| | |
| | | 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; |
| | | } |
对比新文件 |
| | |
| | | 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; |
| | | } |
对比新文件 |
| | |
| | | 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; |
| | | } |
对比新文件 |
| | |
| | | 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; |
| | | |
| | | } |
对比新文件 |
| | |
| | | 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); |
| | | } |
对比新文件 |
| | |
| | | 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(); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
对比新文件 |
| | |
| | | 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); |
| | | } |
对比新文件 |
| | |
| | | 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); |
| | | } |
| | | } |
| | |
| | | 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 |
| | |
| | | heart-beat-interval: 3000 |
| | | heart-beat-timeout: 15000 |
| | | group: supipe |
| | | namespace: suzhou |
| | | config: |
| | | file-extension: yml |
| | | group: sunacos |
| | | group: sunacos |
| | | namespace: suzhou |
| | | server: |
| | | port: ${${spring.application.name}port} |
| | |
| | | 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 |
| | |
| | | heart-beat-interval: 3000 |
| | | heart-beat-timeout: 15000 |
| | | group: supipe |
| | | namespace: suzhou |
| | | config: |
| | | file-extension: yml |
| | | group: sunacos |
| | | group: sunacos |
| | | namespace: suzhou |
| | | server: |
| | | port: ${${spring.application.name}port} |
对比新文件 |
| | |
| | | <?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> |
| | |
| | | |
| | | private String checkType; |
| | | |
| | | private String checkTypeName; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | |
| | | 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 |
| | |
| | | heart-beat-interval: 3000 |
| | | heart-beat-timeout: 15000 |
| | | group: supipe |
| | | namespace: suzhou |
| | | config: |
| | | file-extension: yml |
| | | group: sunacos |
| | | group: sunacos |
| | | namespace: suzhou |
| | | server: |
| | | port: ${${spring.application.name}port} |
| | |
| | | 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 |
| | |
| | | heart-beat-interval: 3000 |
| | | heart-beat-timeout: 15000 |
| | | group: supipe |
| | | namespace: suzhou |
| | | config: |
| | | file-extension: yml |
| | | group: sunacos |
| | | group: sunacos |
| | | namespace: suzhou |
| | | server: |
| | | port: ${${spring.application.name}port} |
| | |
| | | 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, |
| | |
| | | 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> |
| | |
| | | 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 |
| | |
| | | heart-beat-interval: 3000 |
| | | heart-beat-timeout: 15000 |
| | | group: supipe |
| | | namespace: suzhou |
| | | config: |
| | | file-extension: yml |
| | | group: sunacos |
| | | group: sunacos |
| | | namespace: suzhou |
| | | server: |
| | | port: ${${spring.application.name}port} |
| | | netty: |
| | | port: ${${spring.application.name}nettyport} |
| | |
| | | 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 |
| | |
| | | heart-beat-interval: 3000 |
| | | heart-beat-timeout: 15000 |
| | | group: supipe |
| | | namespace: suzhou |
| | | config: |
| | | file-extension: yml |
| | | group: sunacos |
| | | group: sunacos |
| | | namespace: suzhou |
| | | server: |
| | | port: ${${spring.application.name}port} |
| | | netty: |
| | | port: ${${spring.application.name}nettyport} |
| | |
| | | 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 |
| | |
| | | heart-beat-interval: 3000 |
| | | heart-beat-timeout: 15000 |
| | | group: supipe |
| | | namespace: suzhou |
| | | config: |
| | | file-extension: yml |
| | | group: sunacos |
| | | group: sunacos |
| | | namespace: suzhou |
| | | server: |
| | | port: ${${spring.application.name}port} |
| | |
| | | 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 |
| | |
| | | heart-beat-interval: 3000 |
| | | heart-beat-timeout: 15000 |
| | | group: supipe |
| | | namespace: suzhou |
| | | config: |
| | | file-extension: yml |
| | | group: sunacos |
| | | group: sunacos |
| | | namespace: suzhou |
| | | server: |
| | | port: ${${spring.application.name}port} |
| | |
| | | |
| | | <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> |
| | |
| | | } |
| | | } |
| | | |
| | | .titles_two{ |
| | | padding-left: 15px; |
| | | } |
| | | |
| | | /deep/ .el-menu { |
| | | border-right: 0; |
| | | } |