Bläddra i källkod

后台增加上报出行轨迹明细

peiguo 4 år sedan
förälder
incheckning
44e2bf4bbe

+ 30 - 5
admin-ui/app/whepi/lingyun/dialogDetail.js

@@ -26,9 +26,34 @@ define(function (require) {
             $grid = $(this);
             queryGrid1();
           },
+          toolbar: {
+            xtype: 'toolbar',
+            title: '历史上报',
+            items: [
+              {
+                text: '出行轨迹', iconCls: 'fa fa-search', onClick: function () {
+                  var row = $grid.rowData();
+                  if ( row == null || row == undefined || row.userId == null || row.userId == "") {
+                    $.yvan.msg('请选择数据');
+                    return
+                  }
+                  const reportDate = $.fn.fmatter.tsymd(row.reportDate);
+                  $.yvan.showDialog(this,
+                      require('/app/whepi/lingyun/dialogDetailLog.js')({
+                        userId: row.userId,
+                        linkman: context.linkman,
+                        reportDate: reportDate,
+                        confirm: function () {
+                        }
+                      })
+                  );
+                }
+              },
+            ]
+          },
           xtype: 'grid',
-          idField: "userId",
-          pagination: false,
+          idField: "reportDate",
+          pagination: true,
           columns: [[
             {field: 'reportDate', title: '上报时间', align: 'left', formatter: 'tsymd'},
             {field: 'userId', title: '用户ID', hidden: true},
@@ -112,11 +137,11 @@ define(function (require) {
       buttons: [
         {
           text: "关闭", iconCls: "fa fa-times", onClick: function () {
-            $dlg.dialog('close');
+            // $dlg.dialog('close');
+            $dlg.window('close');
           }
         }
       ]
-    }
-      ;
+    };
   };
 });

+ 50 - 0
admin-ui/app/whepi/lingyun/dialogDetailLog.js

@@ -0,0 +1,50 @@
+define(function (require) {
+  return function (context) {
+    var $dlgLog, $gridLog;
+
+    function queryGrid1() {
+      $gridLog.reload({
+        mtype: 'GET',
+        url: api('/sweepCode/selectLogAddrHistory'),
+        queryParams: {userId: context.userId, reportDate: context.reportDate}
+      }, true);
+    }
+
+    return {
+      xtype: 'dialog',
+      dialogId: 'dialogDetailLog',
+      title: '出行轨迹' + context.linkman + "-" + context.reportDate,
+      width: '45%',
+      height: '50%',
+      onOpen: function () {
+        $dlgLog = $(this);
+      },
+      center: {
+        items: {
+          onRender: function () {
+            $gridLog = $(this);
+            queryGrid1();
+          },
+          xtype: 'grid',
+          idField: "userId",
+          pagination: true,
+          columns: [[
+            // {field: 'reportDate', title: '上报时间', align: 'left', formatter: 'tsymd'},
+            {field: 'userId', title: '用户ID', hidden: true},
+            {field: 'city', title: '上报城市', maxWidth: 100, align: 'left',},
+            {field: 'addr', title: '详细地址', align: 'left',},
+            {field: 'timeCreate', title: '上报时间', align: 'left', formatter: 'tsymds'},
+          ]],
+        }
+      },
+      buttons: [
+        {
+          text: "关闭", iconCls: "fa fa-times", onClick: function () {
+            $dlgLog.dialog('close');
+            // $dlgLog.window('close');
+          }
+        }
+      ]
+    };
+  };
+});

+ 1 - 1
admin-ui/app/whepi/lingyun/lingyunUser.js

@@ -333,7 +333,7 @@ define(function (require) {
               },
               multiselect: true, /// 表格多选
               idField: 'userId',
-              editable: true,
+              // editable: true,
               editOnSelected: true,
               autoSizeColumns: true,
               columns:

+ 5 - 0
whepi-web/src/main/java/com/bofeng/dao/MsReportLogMapper.java

@@ -2,6 +2,7 @@ package com.bofeng.dao;
 
 import com.baomidou.mybatisplus.mapper.BaseMapper;
 import com.bofeng.entity.MsReportLog;
+import com.yvan.PageDb;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Select;
@@ -20,4 +21,8 @@ public interface MsReportLogMapper extends BaseMapper<MsReportLog> {
     // 历史的打卡轨迹
     @Select("select user_id,report_date,city from ms_report_log where user_id = #{userId} and report_date = #{time} group by user_id,report_date,city")
     List<MsReportLog> logAddrHistory(@Param("userId") Long userId, @Param("time") String time);
+
+    // 当天打卡轨迹
+    @Select("select user_id,report_date,city,addr,time_create timeCreate from ms_report_log where user_id = #{userId} and report_date = #{reportDate}")
+    List<MsReportLog> selectLogAddrHistory(PageDb pageDb, @Param("userId") Long userId, @Param("reportDate") String reportDate);
 }

+ 4 - 0
whepi-web/src/main/java/com/bofeng/service/SweepCodeService.java

@@ -491,4 +491,8 @@ public class SweepCodeService {
             return null;
         }
     }
+
+    public List<MsReportLog> selectLogAddrHistory(PageDb pageDb, Long userId, String reportDate) {
+        return msReportLogMapper.selectLogAddrHistory(pageDb, userId, reportDate);
+    }
 }

+ 7 - 0
whepi-web/src/main/java/com/bofeng/wx/controller/ScanAdminController.java

@@ -115,6 +115,13 @@ public class ScanAdminController {
         return Model.newSuccess(pageDb,sysUptownHouses);
     }
 
+    @ApiOperation("上报出行轨迹明细")
+    @GetMapping("/whepi/sweepCode/selectLogAddrHistory")
+    public Model<List<MsReportLog>> selectLogAddrHistory(PageDb pageDb,@Pd(name = "userId") Long userId,@Pd(name = "reportDate") String reportDate) {
+        List<MsReportLog> list = sweepCodeService.selectLogAddrHistory(pageDb,userId, reportDate);
+        return Model.newSuccess(pageDb,list);
+    }
+
     @ApiOperation("凌云用户管理导出")
     @GetMapping("/whepi/sweepCode/exSelectLingyunUser")
     @SneakyThrows