Yansen 1 年間 前
コミット
d1df8b2b37

+ 1
- 1
pom.xml ファイルの表示

@@ -10,7 +10,7 @@
10 10
 	</parent>
11 11
 	<groupId>com.yunzhi</groupId>
12 12
 	<artifactId>nanyang</artifactId>
13
-	<version>0.0.8</version>
13
+	<version>0.0.10</version>
14 14
 	<name>main-service</name>
15 15
 	<description>Demo project for Spring Boot</description>
16 16
 

+ 2
- 0
src/main/java/com/yunzhi/nanyang/controller/MobileController.java ファイルの表示

@@ -79,9 +79,11 @@ public class MobileController extends BaseController {
79 79
         }
80 80
 
81 81
         StpUtil.login(taPerson.getPersonId(), clientId);
82
+        LocalDateTime timeout = LocalDateTime.now().plusSeconds(StpUtil.getTokenTimeout());
82 83
         Map<String, Object> res = new HashMap<>();
83 84
         res.put("person", taPerson);
84 85
         res.put("token", StpUtil.getTokenValue());
86
+        res.put("tokenTimeout", DateUtils.toString(timeout, "yyyy-MM-dd HH:mm:ss"));
85 87
 
86 88
         return ResponseBean.success(res);
87 89
     }

+ 34
- 3
src/main/java/com/yunzhi/nanyang/controller/TaDeviceJobController.java ファイルの表示

@@ -91,14 +91,30 @@ public class TaDeviceJobController extends BaseController {
91 91
                                @ApiParam("农机ID") @RequestParam(value = "machineryId", required = false) String machineryId,
92 92
                                @ApiParam("人员ID") @RequestParam(value = "userId", required = false) String userId,
93 93
                                @ApiParam("人员手机") @RequestParam(value = "phone", required = false) String phone,
94
+                               @ApiParam("乡镇") @RequestParam(value = "town", required = false) String town,
94 95
                                @ApiParam("设备分类") @RequestParam(value = "deviceKind", required = false) String deviceKind,
95 96
                                @ApiParam("设备编号") @RequestParam(value = "deviceNo", required = false) String deviceNo,
96 97
                                @ApiParam(value = "开始时间", example = "2022-10-01") @RequestParam(value = "startDate") String startDate,
97 98
                                @ApiParam(value = "结束时间", example = "2022-10-31") @RequestParam(value = "endDate") String endDate) throws Exception {
98 99
 
99 100
         IPage<TaDeviceJob> pg = new Page<>(pageNum, pageSize);
100
-        IPage<TaDeviceJob> list = taDeviceJobService.statisOrgBy(pg, orgId, orgName, deviceKind, deviceNo, startDate, endDate, machineryName, userName, phone, machineryId, userId);
101
-        Double totalArea = taDeviceJobService.statisTotalArea(orgId, orgName, deviceKind, deviceNo, startDate, endDate, machineryName, userName, phone, machineryId, userId);
101
+
102
+        Map<String, Object> params = new HashMap<>();
103
+        params.put("orgId", orgId);
104
+        params.put("orgName", orgName);
105
+        params.put("deviceKind", deviceKind);
106
+        params.put("deviceNo", deviceNo);
107
+        params.put("startDate", startDate);
108
+        params.put("endDate", endDate);
109
+        params.put("machineryName", machineryName);
110
+        params.put("userName", userName);
111
+        params.put("phone", phone);
112
+        params.put("machineryId", machineryId);
113
+        params.put("userId", userId);
114
+        params.put("town", town);
115
+
116
+        IPage<TaDeviceJob> list = taDeviceJobService.statisOrgBy(pg, params);
117
+        Double totalArea = taDeviceJobService.statisTotalArea(params);
102 118
         return ResponseBean.success(new HashMap<String, Object>(){{
103 119
             put("list", list);
104 120
             put("totalArea", totalArea);
@@ -125,6 +141,7 @@ public class TaDeviceJobController extends BaseController {
125 141
                                @ApiParam("农机ID") @RequestParam(value = "machineryId", required = false) String machineryId,
126 142
                                @ApiParam("人员ID") @RequestParam(value = "userId", required = false) String userId,
127 143
                                @ApiParam("人员手机") @RequestParam(value = "phone", required = false) String phone,
144
+                               @ApiParam("乡镇") @RequestParam(value = "town", required = false) String town,
128 145
                                @ApiParam("设备分类") @RequestParam(value = "deviceKind", required = false) String deviceKind,
129 146
                                @ApiParam("设备编号") @RequestParam(value = "deviceNo", required = false) String deviceNo,
130 147
 //                               @ApiParam("位置") @RequestParam(value = "address", required = false) String address,
@@ -132,7 +149,21 @@ public class TaDeviceJobController extends BaseController {
132 149
                                @ApiParam(value = "结束时间", example = "2022-10-31") @RequestParam(value = "endDate") String endDate,
133 150
                                HttpServletResponse response) throws Exception {
134 151
 
135
-        List<TaDeviceJob> list = taDeviceJobService.listOrgBy(orgId, orgName, deviceKind, deviceNo, startDate, endDate, machineryName, userName, phone, machineryId, userId);
152
+        Map<String, Object> params = new HashMap<>();
153
+        params.put("orgId", orgId);
154
+        params.put("orgName", orgName);
155
+        params.put("deviceKind", deviceKind);
156
+        params.put("deviceNo", deviceNo);
157
+        params.put("startDate", startDate);
158
+        params.put("endDate", endDate);
159
+        params.put("machineryName", machineryName);
160
+        params.put("userName", userName);
161
+        params.put("phone", phone);
162
+        params.put("machineryId", machineryId);
163
+        params.put("userId", userId);
164
+        params.put("town", town);
165
+
166
+        List<TaDeviceJob> list = taDeviceJobService.listOrgBy(params);
136 167
 
137 168
         Double total = 0.0;
138 169
         if (list != null || list.size() > 0) {

+ 3
- 0
src/main/java/com/yunzhi/nanyang/entity/SysUser.java ファイルの表示

@@ -41,6 +41,9 @@ public class SysUser implements Serializable {
41 41
     @ApiModelProperty(value = "性别")
42 42
     private Integer sex;
43 43
 
44
+    @ApiModelProperty(value = "身份证")
45
+    private String idCard;
46
+
44 47
     @ApiModelProperty(value = "头像")
45 48
     private String avatar;
46 49
 

+ 5
- 0
src/main/java/com/yunzhi/nanyang/entity/TaDeviceJob.java ファイルの表示

@@ -97,6 +97,11 @@ public class TaDeviceJob implements Serializable, Cloneable {
97 97
      */
98 98
     @ApiModelProperty(name = "gps定位", notes = "")
99 99
     private String location;
100
+
101
+    @ApiModelProperty(name = "所属乡镇", notes = "")
102
+    @TableField(exist = false)
103
+    private String town;
104
+
100 105
     /**
101 106
      * 作业位置
102 107
      */

+ 5
- 33
src/main/java/com/yunzhi/nanyang/mapper/TaDeviceJobMapper.java ファイルの表示

@@ -8,6 +8,7 @@ import org.apache.ibatis.annotations.Param;
8 8
 import com.yunzhi.nanyang.entity.TaDeviceJob;
9 9
 
10 10
 import java.util.List;
11
+import java.util.Map;
11 12
 
12 13
 /**
13 14
  * 设备作业表;(ta_device_job)表数据库访问层
@@ -18,41 +19,11 @@ import java.util.List;
18 19
 public interface TaDeviceJobMapper  extends BaseMapper<TaDeviceJob>{
19 20
 
20 21
      IPage<TaDeviceJob> statisOrgBy(IPage<TaDeviceJob> pg,
21
-                                    @Param("orgId") String orgId,
22
-                                    @Param("orgName") String orgName,
23
-                                    @Param("deviceKind") String deviceKind,
24
-                                    @Param("deviceNo") String deviceNo,
25
-                                    @Param("startDate") String startDate,
26
-                                    @Param("endDate") String endDate,
27
-                                    @Param("machineryName") String machineryName,
28
-                                    @Param("userName") String userName,
29
-                                    @Param("phone") String phone,
30
-                                    @Param("machineryId") String machineryId,
31
-                                    @Param("userId") String userId);
22
+                                    @Param("params") Map<String, Object> params);
32 23
 
33
-     Double statisTotalArea(@Param("orgId") String orgId,
34
-                            @Param("orgName") String orgName,
35
-                            @Param("deviceKind") String deviceKind,
36
-                            @Param("deviceNo") String deviceNo,
37
-                            @Param("startDate") String startDate,
38
-                            @Param("endDate") String endDate,
39
-                            @Param("machineryName") String machineryName,
40
-                            @Param("userName") String userName,
41
-                            @Param("phone") String phone,
42
-                            @Param("machineryId") String machineryId,
43
-                            @Param("userId") String userId);
24
+     Double statisTotalArea(@Param("params") Map<String, Object> params);
44 25
 
45
-     List<TaDeviceJob> listOrgBy(@Param("orgId") String orgId,
46
-                                 @Param("orgName") String orgName,
47
-                                 @Param("deviceKind") String deviceKind,
48
-                                 @Param("deviceNo") String deviceNo,
49
-                                 @Param("startDate") String startDate,
50
-                                 @Param("endDate") String endDate,
51
-                                 @Param("machineryName") String machineryName,
52
-                                 @Param("userName") String userName,
53
-                                 @Param("phone") String phone,
54
-                                 @Param("machineryId") String machineryId,
55
-                                 @Param("userId") String userId);
26
+     List<TaDeviceJob> listOrgBy(@Param("params") Map<String, Object> params);
56 27
 
57 28
     IPage<TaDeviceJob> getPageBy(IPage<TaDeviceJob> pg,
58 29
                                  @Param("deviceKind") String deviceKind,
@@ -63,4 +34,5 @@ public interface TaDeviceJobMapper  extends BaseMapper<TaDeviceJob>{
63 34
     List<TaMachinery> getMachineryListByUser(@Param("userId") String userId);
64 35
 
65 36
     Double sumArea();
37
+
66 38
 }

+ 4
- 3
src/main/java/com/yunzhi/nanyang/service/TaDeviceJobService.java ファイルの表示

@@ -5,6 +5,7 @@ import com.yunzhi.nanyang.entity.TaDeviceJob;
5 5
 import com.yunzhi.nanyang.entity.TaMachinery;
6 6
 
7 7
 import java.util.List;
8
+import java.util.Map;
8 9
 
9 10
 /**
10 11
  * 设备作业表;(ta_device_job)表服务接口
@@ -14,11 +15,11 @@ import java.util.List;
14 15
  */
15 16
 public interface TaDeviceJobService extends IBaseService<TaDeviceJob> {
16 17
 
17
-    IPage<TaDeviceJob> statisOrgBy(IPage<TaDeviceJob> pg, String orgId, String orgName, String deviceKind, String deviceNo, String startDate, String endDate, String machineryName, String userName, String phone, String machineryId, String userId);
18
+    IPage<TaDeviceJob> statisOrgBy(IPage<TaDeviceJob> pg, Map<String, Object> params);
18 19
 
19
-    Double statisTotalArea(String orgId, String orgName, String deviceKind, String deviceNo, String startDate, String endDate, String machineryName, String userName, String phone, String machineryId, String userId);
20
+    Double statisTotalArea(Map<String, Object> params);
20 21
 
21
-    List<TaDeviceJob> listOrgBy(String orgId, String orgName, String deviceKind, String deviceNo, String startDate, String endDate, String machineryName, String userName, String phone, String machineryId, String userId);
22
+    List<TaDeviceJob> listOrgBy(Map<String, Object> params);
22 23
 
23 24
     IPage<TaDeviceJob> getPageBy(IPage<TaDeviceJob> pg, String deviceKind, String deviceNo, String startDate, String endDate);
24 25
 

+ 7
- 6
src/main/java/com/yunzhi/nanyang/service/impl/TaDeviceJobServiceImpl.java ファイルの表示

@@ -8,6 +8,7 @@ import com.yunzhi.nanyang.mapper.TaDeviceJobMapper;
8 8
 import com.yunzhi.nanyang.service.TaDeviceJobService;
9 9
 
10 10
 import java.util.List;
11
+import java.util.Map;
11 12
 
12 13
 /**
13 14
  * 设备作业表;(ta_device_job)表服务实现类
@@ -19,18 +20,18 @@ import java.util.List;
19 20
 public class TaDeviceJobServiceImpl extends BaseServiceImpl<TaDeviceJobMapper, TaDeviceJob> implements TaDeviceJobService {
20 21
 
21 22
     @Override
22
-    public IPage<TaDeviceJob> statisOrgBy(IPage<TaDeviceJob> pg, String orgId, String orgName, String deviceKind, String deviceNo, String startDate, String endDate, String machineryName, String userName, String phone, String machineryId, String userId) {
23
-        return baseMapper.statisOrgBy(pg, orgId, orgName, deviceKind, deviceNo, startDate, endDate, machineryName, userName, phone, machineryId, userId);
23
+    public IPage<TaDeviceJob> statisOrgBy(IPage<TaDeviceJob> pg, Map<String, Object> params) {
24
+        return baseMapper.statisOrgBy(pg, params);
24 25
     }
25 26
 
26 27
     @Override
27
-    public Double statisTotalArea(String orgId, String orgName, String deviceKind, String deviceNo, String startDate, String endDate, String machineryName, String userName, String phone, String machineryId, String userId) {
28
-        return baseMapper.statisTotalArea(orgId, orgName, deviceKind, deviceNo, startDate, endDate, machineryName, userName, phone, machineryId, userId);
28
+    public Double statisTotalArea(Map<String, Object> params) {
29
+        return baseMapper.statisTotalArea(params);
29 30
     }
30 31
 
31 32
     @Override
32
-    public List<TaDeviceJob> listOrgBy(String orgId, String orgName, String deviceKind, String deviceNo, String startDate, String endDate, String machineryName, String userName, String phone, String machineryId, String userId) {
33
-        return baseMapper.listOrgBy(orgId, orgName, deviceKind, deviceNo, startDate, endDate, machineryName, userName, phone, machineryId, userId);
33
+    public List<TaDeviceJob> listOrgBy(Map<String, Object> params) {
34
+        return baseMapper.listOrgBy(params);
34 35
     }
35 36
 
36 37
     @Override

バイナリ
src/main/resources/job.xlsx ファイルの表示


+ 26
- 20
src/main/resources/mapper/TaDeviceJobMapper.xml ファイルの表示

@@ -7,39 +7,43 @@
7 7
         FROM
8 8
             ta_device_job t
9 9
             INNER JOIN ta_machinery s ON t.machinery_id = s.machinery_id
10
+            LEFT JOIN ta_location loc ON t.location = loc.location
10 11
 --             INNER JOIN ta_org m ON s.org_id = m.org_id
11 12
 --             LEFT JOIN sys_user n ON t.user_id = n.user_id
12 13
         WHERE
13 14
             1 = 1
14
-        <if test="deviceKind != null and deviceKind != ''">
15
-            AND t.device_kind = #{deviceKind}
15
+        <if test="params.deviceKind != null and params.deviceKind != ''">
16
+            AND t.device_kind = #{params.deviceKind}
16 17
         </if>
17
-        <if test="deviceNo != null and deviceNo != ''">
18
-            AND t.device_no = #{deviceNo}
18
+        <if test="params.deviceNo != null and params.deviceNo != ''">
19
+            AND t.device_no = #{params.deviceNo}
19 20
         </if>
20
-        <if test="orgId != null and orgId != ''">
21
-            AND t.org_id = #{orgId}
21
+        <if test="params.orgId != null and params.orgId != ''">
22
+            AND t.org_id = #{params.orgId}
22 23
         </if>
23
-        <if test="orgName != null and orgName != ''">
24
-            AND t.org_name LIKE CONCAT( '%', #{orgName}, '%' )
24
+        <if test="params.orgName != null and params.orgName != ''">
25
+            AND t.org_name LIKE CONCAT( '%', #{params.orgName}, '%' )
25 26
         </if>
26
-        <if test="machineryId != null and machineryId != ''">
27
-            AND s.machinery_id = #{machineryId}
27
+        <if test="params.machineryId != null and params.machineryId != ''">
28
+            AND s.machinery_id = #{params.machineryId}
28 29
         </if>
29
-        <if test="userId != null and userId != ''">
30
-            AND t.user_id = #{userId}
30
+        <if test="params.userId != null and params.userId != ''">
31
+            AND t.user_id = #{params.userId}
31 32
         </if>
32
-        <if test="machineryName != null and machineryName != ''">
33
-            AND s.`name` LIKE CONCAT( '%', #{machineryName}, '%' )
33
+        <if test="params.machineryName != null and params.machineryName != ''">
34
+            AND s.`name` LIKE CONCAT( '%', #{params.machineryName}, '%' )
34 35
         </if>
35
-        <if test="userName != null and userName != ''">
36
-            AND t.user_name LIKE CONCAT( '%', #{userName}, '%' )
36
+        <if test="params.userName != null and params.userName != ''">
37
+            AND t.user_name LIKE CONCAT( '%', #{params.userName}, '%' )
37 38
         </if>
38
-        <if test="phone != null and phone != ''">
39
-            AND t.phone LIKE CONCAT( '%', #{phone}, '%' )
39
+        <if test="params.phone != null and params.phone != ''">
40
+            AND t.phone LIKE CONCAT( '%', #{params.phone}, '%' )
40 41
         </if>
41
-        <if test="startDate != null and startDate != ''">
42
-            AND t.job_date BETWEEN #{startDate} AND #{endDate}
42
+        <if test="params.town != null and params.town != ''">
43
+            AND loc.town LIKE CONCAT( '%', #{params.town}, '%' )
44
+        </if>
45
+        <if test="params.startDate != null and params.startDate != ''">
46
+            AND t.job_date BETWEEN #{params.startDate} AND #{params.endDate}
43 47
         </if>
44 48
         AND s.`status` &gt; -1
45 49
         ORDER BY
@@ -48,6 +52,7 @@
48 52
 
49 53
     <select id="statisOrgBy" resultType="com.yunzhi.nanyang.entity.TaDeviceJob">
50 54
         SELECT
55
+            loc.town,
51 56
             s.`name` AS machinery_name,
52 57
             t.*
53 58
         <include refid="statisOrg"></include>
@@ -58,6 +63,7 @@
58 63
     </select>
59 64
     <select id="listOrgBy" resultType="com.yunzhi.nanyang.entity.TaDeviceJob">
60 65
         SELECT
66
+            loc.town,
61 67
             s.`name` AS machinery_name,
62 68
             t.*
63 69
         <include refid="statisOrg"></include>

+ 3
- 0
src/main/resources/mapper/TaMachineryMapper.xml ファイルの表示

@@ -12,6 +12,7 @@
12 12
                 FROM ta_machinery t
13 13
                 WHERE
14 14
                       t.`status` &gt; -1
15
+                  AND IFNULL(t.thumb, '') != ''
15 16
                 <if test="orgId != null and orgId != ''">
16 17
                     AND t.org_id = #{orgId}
17 18
                 </if>
@@ -47,6 +48,7 @@
47 48
             INNER JOIN td_machinery_type n ON n.type_id = t.type_id
48 49
         WHERE
49 50
             t.`status` &gt; -1
51
+            AND IFNULL(t.thumb, '') != ''
50 52
             AND t.machinery_id &lt;= s.machinery_id
51 53
         <if test="typeId != null and typeId != ''">
52 54
             AND t.type_id = #{typeId}
@@ -80,6 +82,7 @@
80 82
         </if>
81 83
         WHERE
82 84
             t.`status` &gt; -1
85
+          AND IFNULL(t.thumb, '') != ''
83 86
         <if test="name != null and name != ''">
84 87
             AND t.`name` LIKE CONCAT('%', #{name}, '%')
85 88
         </if>

+ 17
- 10
src/main/resources/mapper/TdDeviceMapper.xml ファイルの表示

@@ -86,7 +86,7 @@
86 86
                     a.`name`
87 87
             ) m
88 88
         ORDER BY
89
-            m.`value` DESC;
89
+            m.`value` DESC
90 90
     </select>
91 91
     <select id="statisNumByOrgJob" resultType="com.yunzhi.nanyang.vo.ChartParam">
92 92
         SELECT
@@ -136,15 +136,22 @@
136 136
     </select>
137 137
     <select id="statisAreaByTown" resultType="com.yunzhi.nanyang.vo.ChartParam">
138 138
         SELECT
139
-            s.town as `name`,
140
-            sum( t.job_area ) AS `value`
139
+            *
141 140
         FROM
142
-            ta_device_job t
143
-                LEFT JOIN ta_location s ON t.location = s.location
144
-        WHERE
145
-            t.device_kind = #{deviceKind}
146
-          AND t.job_date &gt;= #{jobDate}
147
-        GROUP BY
148
-            s.town
141
+            (
142
+                SELECT
143
+                    s.town as `name`,
144
+                    sum( t.job_area ) AS `value`
145
+                FROM
146
+                    ta_device_job t
147
+                        LEFT JOIN ta_location s ON t.location = s.location
148
+                WHERE
149
+                    t.device_kind = #{deviceKind}
150
+                  AND t.job_date &gt;= #{jobDate}
151
+                GROUP BY
152
+                    s.town
153
+                ) m
154
+        ORDER BY
155
+            m.`value` DESC
149 156
     </select>
150 157
 </mapper>