yuliang 5 年之前
父节点
当前提交
e549381099

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

@@ -87,6 +87,15 @@ define(function (require) {
               queryGrid1();
               queryGrid1();
             },
             },
           },
           },
+          {
+            name: 'date',
+            label: '导出时间',
+            prompt: '导出时间',
+            xtype: 'datebox',
+            labelWidth: 'auto',
+            width: 250,
+            required: true
+          },
         ]]
         ]]
       };
       };
 
 
@@ -148,7 +157,12 @@ define(function (require) {
                     text: '导出人员报表', iconCls: 'fa fa-cloud-upload', onClick: function () {
                     text: '导出人员报表', iconCls: 'fa fa-cloud-upload', onClick: function () {
                       var queryProperties = $form.formGet().queryProperties;
                       var queryProperties = $form.formGet().queryProperties;
                       var unitId = $form.formGet().unitId;
                       var unitId = $form.formGet().unitId;
-                      window.open(api('/sweepCode/exSelectLingyunUser?queryProperties='+queryProperties+"&unitId="+unitId));
+                      var date = $form.formGet().date;
+                      if ( date == null || date == "") {
+                        $.yvan.msg('请选择导出时间');
+                        return
+                      }
+                      window.open(api('/sweepCode/exSelectLingyunUser?queryProperties='+queryProperties+"&unitId="+unitId + "&date="+date));
                     }
                     }
                   },
                   },
                 ]
                 ]

+ 15 - 1
admin-ui/app/whepi/lingyun/lingyunUser2.js

@@ -69,6 +69,15 @@ define(function (require) {
             labelWidth: 'auto',
             labelWidth: 'auto',
             events: {keydown: enterQueryGrid1}, width: 350
             events: {keydown: enterQueryGrid1}, width: 350
           },
           },
+          {
+            name: 'date',
+            label: '导出时间',
+            prompt: '导出时间',
+            xtype: 'datebox',
+            labelWidth: 'auto',
+            width: 250,
+            required: true
+          },
         ]]
         ]]
       };
       };
 
 
@@ -129,7 +138,12 @@ define(function (require) {
                   {
                   {
                     text: '导出人员报表', iconCls: 'fa fa-cloud-upload', onClick: function () {
                     text: '导出人员报表', iconCls: 'fa fa-cloud-upload', onClick: function () {
                       var queryProperties = $form.formGet().queryProperties;
                       var queryProperties = $form.formGet().queryProperties;
-                      window.open(api('/sweepCode/exSelectLingyunUser?queryProperties='+queryProperties+"&unitId=0"));
+                      var date = $form.formGet().date;
+                      if ( date == null || date == "") {
+                        $.yvan.msg('请选择导出时间');
+                        return
+                      }
+                      window.open(api('/sweepCode/exSelectLingyunUser?queryProperties='+queryProperties+"&unitId=0&date="+date));
                     }
                     }
                   },
                   },
                 ]
                 ]

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

@@ -74,10 +74,6 @@ public class SweepCodeService {
     }
     }
 
 
     public List<ExcelRiBaoLYBM4> exSelectLingyunUser(Map<String, Object> queryParam) {
     public List<ExcelRiBaoLYBM4> exSelectLingyunUser(Map<String, Object> queryParam) {
-        Long userId = JwtHelper.getUserId();
-        if (userId > 7000 && userId < 8000) {
-            queryParam.put("unitId", userId);
-        }
         queryParam.put("uptownId", 1238790987234L);
         queryParam.put("uptownId", 1238790987234L);
         List<ExcelRiBaoLYBM4> sysUptownHouses = rbMapper.exSelectLingyunUser(queryParam);
         List<ExcelRiBaoLYBM4> sysUptownHouses = rbMapper.exSelectLingyunUser(queryParam);
 
 

+ 18 - 3
whepi-web/src/main/java/com/bofeng/wx/controller/ScanAdminController.java

@@ -19,6 +19,7 @@ import com.yvan.Model;
 import com.yvan.PageDb;
 import com.yvan.PageDb;
 import com.yvan.mvc.JsonBody;
 import com.yvan.mvc.JsonBody;
 import com.yvan.mvc.Pd;
 import com.yvan.mvc.Pd;
+import com.yvan.platform.Conv;
 import com.yvan.springmvc.HttpParameterParser;
 import com.yvan.springmvc.HttpParameterParser;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiOperation;
@@ -64,6 +65,8 @@ public class ScanAdminController {
     @Autowired
     @Autowired
     private UptownUnitMapper uptownUnitMapper;
     private UptownUnitMapper uptownUnitMapper;
     @Autowired
     @Autowired
+    private SysUptownUnitMapper sysUptownUnitMapper;
+    @Autowired
     private RbMapper rbMapper;
     private RbMapper rbMapper;
 
 
     @ApiOperation("出入查询")
     @ApiOperation("出入查询")
@@ -85,14 +88,26 @@ public class ScanAdminController {
     @ApiOperation("凌云用户管理导出")
     @ApiOperation("凌云用户管理导出")
     @GetMapping("/whepi/sweepCode/exSelectLingyunUser")
     @GetMapping("/whepi/sweepCode/exSelectLingyunUser")
     @SneakyThrows
     @SneakyThrows
-    public void exSelectLingyunUser(HttpParameterParser parser,HttpServletResponse resp,@Pd(name = "queryProperties", required = false, defaultValue = "") String queryProperties,
-                                    @Pd(name = "unitId", required = false, defaultValue = "0") Long unitId) {
+    public void exSelectLingyunUser(HttpParameterParser parser,HttpServletResponse resp,
+                                    @Pd(name = "queryProperties", required = false, defaultValue = "") String queryProperties,
+                                    @Pd(name = "unitId", required = false, defaultValue = "0") Long unitId,
+                                    @Pd(name = "date") String date) {
         SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
         SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
         Map<String, Object> map = new HashMap<>();
         Map<String, Object> map = new HashMap<>();
         map.put("queryProperties", queryProperties);
         map.put("queryProperties", queryProperties);
+        Long userId = JwtHelper.getUserId();
+        if (userId > 7000 && userId < 8000) {
+            unitId = userId;
+        }
         map.put("unitId", unitId);
         map.put("unitId", unitId);
+        map.put("date", date);
+        String unitName = "";
+        List<UptownUnit> uptownUnits = sysUptownUnitMapper.selectByUnitId(unitId);
+        if (uptownUnits!=null && uptownUnits.size()>0) {
+            unitName = uptownUnits.get(0).getRidgepole()+uptownUnits.get(0).getUnit();
+        }
         List<ExcelRiBaoLYBM4> list = sweepCodeService.exSelectLingyunUser(map);
         List<ExcelRiBaoLYBM4> list = sweepCodeService.exSelectLingyunUser(map);
-        ExcelUtils.writeSheet(ExcelRiBaoLYBM4.class, list).export(resp, "上报信息-" + sdf.format(new Date()));
+        ExcelUtils.writeSheet(ExcelRiBaoLYBM4.class, list).export(resp, unitName + "上报信息-" + date);
     }
     }
 
 
     @ApiOperation("导出")
     @ApiOperation("导出")

+ 12 - 1
whepi-web/src/main/java/com/bofeng/wx/controller/YeWeiHuiController.java

@@ -2,6 +2,7 @@ package com.bofeng.wx.controller;
 
 
 import com.bofeng.JwtHelper;
 import com.bofeng.JwtHelper;
 import com.bofeng.dao.RbMapper;
 import com.bofeng.dao.RbMapper;
+import com.bofeng.dao.SysUptownUnitMapper;
 import com.bofeng.dao.UptownMapper;
 import com.bofeng.dao.UptownMapper;
 import com.bofeng.entity.*;
 import com.bofeng.entity.*;
 import com.bofeng.excel.ExcelUtils;
 import com.bofeng.excel.ExcelUtils;
@@ -56,6 +57,9 @@ public class YeWeiHuiController {
   @Autowired
   @Autowired
   private JmTuangouMemberService jmTuangouMemberService;
   private JmTuangouMemberService jmTuangouMemberService;
 
 
+  @Autowired
+  private SysUptownUnitMapper sysUptownUnitMapper;
+
   @GetMapping("/yeweihui/home.html")
   @GetMapping("/yeweihui/home.html")
   public ModelAndView yeweihui(ModelMap model, @RequestParam(value = "userId") Long userId, @RequestParam(value = "show", required = false, defaultValue = "-") String show) {
   public ModelAndView yeweihui(ModelMap model, @RequestParam(value = "userId") Long userId, @RequestParam(value = "show", required = false, defaultValue = "-") String show) {
 
 
@@ -260,9 +264,16 @@ public class YeWeiHuiController {
 
 
     Uptown uptown = uptownMapper.selectById("1238790987234");
     Uptown uptown = uptownMapper.selectById("1238790987234");
     Long upId = uptown.getUptownId();
     Long upId = uptown.getUptownId();
-    String fileName = uptown.getUptownName();
+    String fileName;
+    List<UptownUnit> uptownUnits = sysUptownUnitMapper.selectByUnitId(unitId);
+    if (uptownUnits!=null && uptownUnits.size()>0) {
+      fileName = uptownUnits.get(0).getRidgepole()+uptownUnits.get(0).getUnit();
+    } else {
+      fileName = uptown.getUptownName();
+    }
     fileName += "上报信息-";
     fileName += "上报信息-";
     fileName += date;
     fileName += date;
+
     List<ExcelRiBaoLY> list = rbService.selectExcelRiBaoLY(upId, date, unitId);
     List<ExcelRiBaoLY> list = rbService.selectExcelRiBaoLY(upId, date, unitId);
     ExcelUtils.writeSheet(ExcelRiBaoLY.class, list).export(resp, fileName);
     ExcelUtils.writeSheet(ExcelRiBaoLY.class, list).export(resp, fileName);
 
 

+ 14 - 2
whepi-web/src/main/resources/mapper/RbMapper.xml

@@ -30,7 +30,7 @@
         from sys_uptown_house suh
         from sys_uptown_house suh
         inner join sys_uptown_home suho on suho.house_id=suh.house_id
         inner join sys_uptown_home suho on suho.house_id=suh.house_id
         INNER JOIN sys_uptown_unit suu ON suu.unit_id = suh.unit_id and suu.uptown_id=#{uptownId}
         INNER JOIN sys_uptown_unit suu ON suu.unit_id = suh.unit_id and suu.uptown_id=#{uptownId}
-        left join ms_report msr on msr.house_id = suh.house_id and msr.report_date = curdate()
+        left join ms_report msr on msr.house_id = suh.house_id
         left join ms_suspected mss on mss.report_id=msr.report_id
         left join ms_suspected mss on mss.report_id=msr.report_id
         left join ms_trip tr on mss.suspected_id=trip_id
         left join ms_trip tr on mss.suspected_id=trip_id
         INNER JOIN sys_user_role ur on ur.property_id = suho.house_id and ur.role_id = 1
         INNER JOIN sys_user_role ur on ur.property_id = suho.house_id and ur.role_id = 1
@@ -42,6 +42,12 @@
                 and (suho.linkman like concat('%',#{queryProperties},'%')
                 and (suho.linkman like concat('%',#{queryProperties},'%')
                 or suho.phone like concat('%',#{queryProperties},'%'))
                 or suho.phone like concat('%',#{queryProperties},'%'))
             </if>
             </if>
+            <if test="date!=null and date!=''">
+                and msr.report_date = #{date}
+            </if>
+            <if test="date==null or date==''">
+                and msr.report_date = curdate()
+            </if>
         </where>
         </where>
         order by suu.unit_id asc,suho.linkman
         order by suu.unit_id asc,suho.linkman
     </select>
     </select>
@@ -55,7 +61,7 @@
         from sys_uptown_house suh
         from sys_uptown_house suh
         inner join sys_uptown_home suho on suho.house_id=suh.house_id
         inner join sys_uptown_home suho on suho.house_id=suh.house_id
         INNER JOIN sys_uptown_unit suu ON suu.unit_id = suh.unit_id and suu.uptown_id=#{uptownId}
         INNER JOIN sys_uptown_unit suu ON suu.unit_id = suh.unit_id and suu.uptown_id=#{uptownId}
-        left join ms_report msr on msr.house_id = suh.house_id and msr.report_date = curdate()
+        left join ms_report msr on msr.house_id = suh.house_id
         left join ms_suspected mss on mss.report_id=msr.report_id
         left join ms_suspected mss on mss.report_id=msr.report_id
         left join ms_trip tr on mss.suspected_id=trip_id
         left join ms_trip tr on mss.suspected_id=trip_id
         INNER JOIN sys_user_role ur on ur.property_id = suho.house_id and ur.role_id = 1
         INNER JOIN sys_user_role ur on ur.property_id = suho.house_id and ur.role_id = 1
@@ -67,6 +73,12 @@
                 and (suho.linkman like concat('%',#{queryProperties},'%')
                 and (suho.linkman like concat('%',#{queryProperties},'%')
                 or suho.phone like concat('%',#{queryProperties},'%'))
                 or suho.phone like concat('%',#{queryProperties},'%'))
             </if>
             </if>
+            <if test="date!=null and date!=''">
+                and msr.report_date = #{date}
+            </if>
+            <if test="date==null or date==''">
+                and msr.report_date = curdate()
+            </if>
         </where>
         </where>
         order by suu.unit_id asc,suho.linkman
         order by suu.unit_id asc,suho.linkman
     </select>
     </select>