4 Commits

Autor SHA1 Nachricht Datum
  lenovo 3785254b58 docs: update CLAUDE.md with security, MQTT, and lock improvements vor 4 Tagen
  humanleft ebc7ce0564 refactor: remove dead code from VehicleSyncTask vor 4 Tagen
  humanleft c62801ac4c Merge remote-tracking branch 'origin/mqy20260511' vor 4 Tagen
  humanleft 44371c5c81 docs: update CLAUDE.md with security, MQTT, and lock improvements vor 4 Tagen

+ 0
- 95
iot-platform/src/main/java/com/iot/platform/domain/SysCompany.java Datei anzeigen

@@ -1,95 +0,0 @@
1
-package com.iot.platform.domain;
2
-
3
-public class SysCompany {
4
-    public String companyId;
5
-    public String companyName;
6
-    public String companyContacts;
7
-    public String companyPhone;
8
-    public String companyDetails;
9
-    public String companyLicense;
10
-    public String companyBalance;
11
-    public String parentId;
12
-    public String ancestors;
13
-    public String companyType;
14
-
15
-    public String getCompanyId() {
16
-        return companyId;
17
-    }
18
-
19
-    public void setCompanyId(String companyId) {
20
-        this.companyId = companyId;
21
-    }
22
-
23
-    public String getCompanyName() {
24
-        return companyName;
25
-    }
26
-
27
-    public void setCompanyName(String companyName) {
28
-        this.companyName = companyName;
29
-    }
30
-
31
-    public String getCompanyContacts() {
32
-        return companyContacts;
33
-    }
34
-
35
-    public void setCompanyContacts(String companyContacts) {
36
-        this.companyContacts = companyContacts;
37
-    }
38
-
39
-    public String getCompanyPhone() {
40
-        return companyPhone;
41
-    }
42
-
43
-    public void setCompanyPhone(String companyPhone) {
44
-        this.companyPhone = companyPhone;
45
-    }
46
-
47
-    public String getCompanyDetails() {
48
-        return companyDetails;
49
-    }
50
-
51
-    public void setCompanyDetails(String companyDetails) {
52
-        this.companyDetails = companyDetails;
53
-    }
54
-
55
-    public String getCompanyLicense() {
56
-        return companyLicense;
57
-    }
58
-
59
-    public void setCompanyLicense(String companyLicense) {
60
-        this.companyLicense = companyLicense;
61
-    }
62
-
63
-    public String getCompanyBalance() {
64
-        return companyBalance;
65
-    }
66
-
67
-    public void setCompanyBalance(String companyBalance) {
68
-        this.companyBalance = companyBalance;
69
-    }
70
-
71
-    public String getParentId() {
72
-        return parentId;
73
-    }
74
-
75
-    public void setParentId(String parentId) {
76
-        this.parentId = parentId;
77
-    }
78
-
79
-    public String getAncestors() {
80
-        return ancestors;
81
-    }
82
-
83
-    public void setAncestors(String ancestors) {
84
-        this.ancestors = ancestors;
85
-    }
86
-
87
-    public String getCompanyType() {
88
-        return companyType;
89
-    }
90
-
91
-    public void setCompanyType(String companyType) {
92
-        this.companyType = companyType;
93
-    }
94
-
95
-}

+ 0
- 15
iot-platform/src/main/java/com/iot/platform/mapper/SysCompanyMapper.java Datei anzeigen

@@ -1,15 +0,0 @@
1
-package com.iot.platform.mapper;
2
-
3
-
4
-import com.iot.platform.domain.SysCompany;
5
-import org.apache.ibatis.annotations.Mapper;
6
-
7
-import java.util.List;
8
-
9
-@Mapper
10
-public interface SysCompanyMapper {
11
-
12
-    List<SysCompany> selectcompany();
13
-
14
-
15
-}

+ 0
- 18
iot-platform/src/main/java/com/iot/platform/service/SysCompanyService.java Datei anzeigen

@@ -1,18 +0,0 @@
1
-package com.iot.platform.service;
2
-
3
-import com.iot.platform.domain.SysCompany;
4
-import com.iot.platform.mapper.SysCompanyMapper;
5
-import org.springframework.stereotype.Service;
6
-
7
-import javax.annotation.Resource;
8
-import java.util.List;
9
-
10
-@Service
11
-public class SysCompanyService {
12
-    @Resource
13
-    public SysCompanyMapper sysCompanyMapper;
14
-
15
-    public List<SysCompany> selectcompany(){
16
-        return sysCompanyMapper.selectcompany();
17
-    }
18
-}

+ 0
- 55
iot-platform/src/main/java/com/iot/platform/task/VehicleSyncTask.java Datei anzeigen

@@ -1,14 +1,12 @@
1 1
 package com.iot.platform.task;
2 2
 
3 3
 import com.iot.platform.domain.SysCar;
4
-import com.iot.platform.domain.SysCompany;
5 4
 import com.iot.platform.domain.SysDevice;
6 5
 import com.iot.platform.domain.SysDeviceControl;
7 6
 import com.iot.platform.config.IotProperties;
8 7
 import com.iot.platform.service.*;
9 8
 import org.slf4j.Logger;
10 9
 import org.slf4j.LoggerFactory;
11
-import org.springframework.beans.factory.annotation.Autowired;
12 10
 import org.springframework.dao.DataAccessException;
13 11
 import org.springframework.data.redis.RedisConnectionFailureException;
14 12
 import org.springframework.data.redis.core.RedisCallback;
@@ -19,8 +17,6 @@ import org.springframework.stereotype.Component;
19 17
 import org.springframework.web.client.RestClientException;
20 18
 import org.springframework.web.client.RestTemplate;
21 19
 
22
-import java.time.LocalDate;
23
-import java.time.format.DateTimeFormatter;
24 20
 import java.util.*;
25 21
 import java.util.concurrent.TimeUnit;
26 22
 
@@ -35,22 +31,15 @@ public class VehicleSyncTask {
35 31
     private final SysrealtimeService sysrealtimeService;
36 32
     private final SysDeviceVoService sysDeviceVoService;
37 33
     private final SysDeviceControlService sysDeviceControlService;
38
-    private final SysWorkorderService sysWorkorderService;
39
-    private final SysIndicatorsService sysIndicatorsService;
40
-    private final SysCompanyService sysCompanyService;
41 34
     private final RestTemplate restTemplate;
42 35
     private final IotProperties iotProperties;
43 36
 
44
-    @Autowired
45 37
     public VehicleSyncTask(SysCarService sysCarService,
46 38
                            SysDeviceService sysDeviceService,
47 39
                            StringRedisTemplate stringRedisTemplate,
48 40
                            SysrealtimeService sysrealtimeService,
49 41
                            SysDeviceVoService sysDeviceVoService,
50 42
                            SysDeviceControlService sysDeviceControlService,
51
-                           SysWorkorderService sysWorkorderService,
52
-                           SysIndicatorsService sysIndicatorsService,
53
-                           SysCompanyService sysCompanyService,
54 43
                            RestTemplate restTemplate,
55 44
                            IotProperties iotProperties) {
56 45
         this.sysCarService = sysCarService;
@@ -59,9 +48,6 @@ public class VehicleSyncTask {
59 48
         this.sysrealtimeService = sysrealtimeService;
60 49
         this.sysDeviceVoService = sysDeviceVoService;
61 50
         this.sysDeviceControlService = sysDeviceControlService;
62
-        this.sysWorkorderService = sysWorkorderService;
63
-        this.sysIndicatorsService = sysIndicatorsService;
64
-        this.sysCompanyService = sysCompanyService;
65 51
         this.restTemplate = restTemplate;
66 52
         this.iotProperties = iotProperties;
67 53
     }
@@ -338,45 +324,4 @@ public class VehicleSyncTask {
338 324
         Object val = map.get(key);
339 325
         return val == null ? null : val.toString().trim();
340 326
     }
341
-
342
-    /**
343
-     * 更新指标信息
344
-     * 根据公司去查询
345
-     */
346
-//    @Scheduled(fixedDelay = 30000)
347
-//    public void insertIndicators() {
348
-//        String lockKey = "lock:vehicle-sync:insertIndicators";
349
-//        if (!tryLock(lockKey, 60)) {
350
-//            log.debug("获取锁失败,跳过本次执行: {}", lockKey);
351
-//            return;
352
-//        }
353
-//        try {
354
-//            doInsertIndicators();
355
-//        } finally {
356
-//            unlock(lockKey);
357
-//        }
358
-//    }
359
-
360
-//    private void doInsertIndicators() {
361
-//        try {
362
-//            LocalDate today = LocalDate.now();
363
-//            DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
364
-//            String day = today.format(formatter);
365
-//            List<SysCompany> sysCompanyList = sysCompanyService.selectcompany();
366
-//            for (SysCompany sysCompany : sysCompanyList) {
367
-//                Integer countworkorder = sysWorkorderService.selectworkordercount(sysCompany.getCompanyId(), day);
368
-//                Double countprofit = sysWorkorderService.selectwokroderprofit(sysCompany.getCompanyId(), day);
369
-//                Integer count = sysIndicatorsService.selectcarcount(sysCompany.getCompanyId(), day);
370
-//                if (count <= 0) {
371
-//                    sysIndicatorsService.insertindicators(countworkorder, countprofit, sysCompany.getCompanyId(), day);
372
-//                } else {
373
-//                    sysIndicatorsService.updateindicators(countworkorder, countprofit, sysCompany.getCompanyId(), day);
374
-//                }
375
-//            }
376
-//        } catch (DataAccessException e) {
377
-//            log.error("数据库操作失败: {}", e.getMessage(), e);
378
-//        } catch (Exception e) {
379
-//            log.error("更新指标信息失败: {}", e.getMessage(), e);
380
-//        }
381
-//    }
382 327
 }

+ 0
- 23
iot-platform/src/main/resources/mapper/SysCompanyMapper.xml Datei anzeigen

@@ -1,23 +0,0 @@
1
-<?xml version="1.0" encoding="UTF-8" ?>
2
-<!DOCTYPE mapper
3
-        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
4
-        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
5
-<mapper namespace="com.iot.platform.mapper.SysCompanyMapper">
6
-    <!-- 通用查询映射结果 -->
7
-    <resultMap id="BaseResultMap" type="com.iot.platform.domain.SysCompany">
8
-        <result column="companyId" property="companyId"/>
9
-        <result column="companyName" property="companyName"/>
10
-        <result column="companyContacts" property="companyContacts"/>
11
-        <result column="companyPhone" property="companyPhone"/>
12
-        <result column="companyDetails" property="companyDetails"/>
13
-        <result column="companyLicense" property="companyLicense"/>
14
-        <result column="companyBalance" property="companyBalance"/>
15
-        <result column="parentId" property="parentId"/>
16
-        <result column="ancestors" property="ancestors"/>
17
-        <result column="companyType" property="companyType"/>
18
-    </resultMap>
19
-
20
-    <select id="selectcompany" resultMap="BaseResultMap">
21
-        select company_id companyId from sys_company where company_type='2'
22
-    </select>
23
-</mapper>

Laden…
Abbrechen
Speichern