ソースを参照

凌云集团更改公司

peiguo 5 年 前
コミット
3089837e65

+ 5 - 0
admin-ui/app/whepi/lingyun/lingyunUser.js

@@ -175,6 +175,11 @@ define(function (require) {
                     }
                   },
                   {
+                    text: '导出正常复工人员', iconCls: 'fa fa-cloud-upload', onClick: function () {
+                      window.open(api('/returnWork/exReturnWork'));
+                    }
+                  },
+                  {
                     text: '查看人员上报情况', iconCls: 'fa fa-search', onClick: function () {
                       var row = $grid1.rowData();
                       if ( row == null || row == undefined || row.userId == null || row.userId == "") {

+ 6 - 6
whepi-web/src/main/java/com/bofeng/controller/EpiAdminController.java

@@ -99,12 +99,12 @@ public class EpiAdminController {
         System.out.println("==============执行定时任务完毕================");
     }
 
-    @Scheduled(cron = "0 25 22 * * ?")
-    public void returnWorkTaskByFixedDelay() {
-        System.out.println("==============执行定时任务开始================");
-        scanService.returnWorkLY();
-        System.out.println("==============执行定时任务完毕================");
-    }
+//    @Scheduled(cron = "0 25 22 * * ?")
+//    public void returnWorkTaskByFixedDelay() {
+//        System.out.println("==============执行定时任务开始================");
+//        scanService.returnWorkLY();
+//        System.out.println("==============执行定时任务完毕================");
+//    }
 
     //    @Scheduled(cron = "0 0 0 * * ?") //每天0点执行一次
     public void scheduledReportByFixedDelay() {

+ 2 - 0
whepi-web/src/main/java/com/bofeng/dao/ReturnWorkLyMapper.java

@@ -15,5 +15,7 @@ public interface ReturnWorkLyMapper extends BaseMapper<ReturnWorkLy> {
 
     List<ReturnWorkLy> getAllUser(PageDb pageDb, Map<String, Object> queryParam);
 
+    List<ReturnWorkLy> exgetAllUser(Map<String, Object> queryParam);
+
     int deleteReturnWork();
 }

+ 16 - 1
whepi-web/src/main/java/com/bofeng/entity/ReturnWorkLy.java

@@ -1,5 +1,6 @@
 package com.bofeng.entity;
 
+import com.alibaba.excel.annotation.ExcelProperty;
 import com.baomidou.mybatisplus.annotations.TableField;
 import com.baomidou.mybatisplus.annotations.TableId;
 import com.baomidou.mybatisplus.annotations.TableName;
@@ -21,10 +22,24 @@ public class ReturnWorkLy {
     @TableId("rw_id")
     private Long rwId;
 
-    @ApiModelProperty("用户ID")
     @TableField("user_id")
     private Long userId;
 
     @TableField(exist = false)
     private DateTime timeCreate;
+
+    @TableField(exist = false)
+    private String uptownName;
+    @ExcelProperty(value = "部门", index = 0)
+    @TableField(exist = false)
+    private String unit;
+    @ExcelProperty(value = "名称", index = 1)
+    @TableField(exist = false)
+    private String linkman;
+    @ExcelProperty(value = "电话", index = 2)
+    @TableField(exist = false)
+    private String phone;
+    @ExcelProperty(value = "工号", index = 3)
+    @TableField(exist = false)
+    private String doorplate;
 }

+ 0 - 2
whepi-web/src/main/java/com/bofeng/service/ScanService.java

@@ -9,7 +9,6 @@ import org.gavaghan.geodesy.GeodeticCalculator;
 import org.gavaghan.geodesy.GlobalCoordinates;
 import org.joda.time.DateTime;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.scheduling.annotation.Async;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Propagation;
 import org.springframework.transaction.annotation.Transactional;
@@ -92,7 +91,6 @@ public class ScanService {
         return new GeodeticCalculator().calculateGeodeticCurve(Ellipsoid.Sphere, source, target).getEllipsoidalDistance();
     }
 
-    //    @Async
     @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
     public void returnWorkLY() {
         new Runnable() {

+ 17 - 2
whepi-web/src/main/java/com/bofeng/wx/controller/ScanAdminController.java

@@ -74,6 +74,8 @@ public class ScanAdminController {
     private MsReportService msReportService;
     @Autowired
     private ScanService scanService;
+    @Autowired
+    private ReturnWorkLyMapper returnWorkLyMapper;
 
     @ApiOperation("出入查询")
     @PostMapping("/whepi/sweepCode/selectCode")
@@ -427,10 +429,23 @@ public class ScanAdminController {
         return Model.newSuccess(pagination, uptownMapper.getUptowns(pagination, parser.getMap()));
     }
 
-    @ApiOperation("获取小区大门详细")
+    @ApiOperation("允许复工人员")
     @GetMapping("/whepi/returnWork/returnWork")
-    public void returnWork(HttpParameterParser parser) throws ParseException {
+    public void returnWork(HttpParameterParser parser) {
+        scanService.returnWorkLY();
+        Map<String, Object> map = new HashMap<>();
+        List<ReturnWorkLy> list = returnWorkLyMapper.exgetAllUser(map);
+    }
+
+    @ApiOperation("导出允许复工人员")
+    @SneakyThrows
+    @GetMapping("/whepi/returnWork/exReturnWork")
+    public void exReturnWork(HttpParameterParser parser,HttpServletResponse resp) {
         scanService.returnWorkLY();
+        Map<String, Object> map = new HashMap<>();
+        List<ReturnWorkLy> list = returnWorkLyMapper.exgetAllUser(map);
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        ExcelUtils.writeSheet(ReturnWorkLy.class, list).export(resp,"凌云集团正常复工员工" + sdf.format(new Date()));
     }
 
     // 获取code

+ 20 - 1
whepi-web/src/main/resources/mapper/ReturnWorkLyMapper.xml

@@ -18,7 +18,26 @@
                 and uu.unit_id = #{unitId}
             </if>
         </where>
-        order by u.user_id desc
+        order by uu.ridgepole,uu.unit,u.user_id desc
+    </select>
+
+    <select id="exgetAllUser" resultType="com.bofeng.entity.ReturnWorkLy">
+        select u.rw_id,u.user_id as userId,su.uptown_name as uptownName,CONCAT(uu.ridgepole,uu.unit) as unit,uh.linkman,uh.phone,suh.doorplate
+        from return_work_ly u
+        left join sys_user_role ur on ur.user_id = u.user_id and ur.role_id = 1
+        left join sys_uptown_home uh on uh.house_id = ur.property_id
+        left join sys_uptown_house suh on suh.house_id = ur.property_id
+        left join sys_uptown_unit uu on uu.unit_id = suh.unit_id
+        left join sys_uptown su on su.uptown_id = uu.uptown_id
+        <where>
+            <if test="queryProperties != null and queryProperties != ''">
+                (uh.phone = #{phone} or uh.linkman like concat('%',#{queryProperties},'%'))
+            </if>
+            <if test="unitId != null and unitId !=''">
+                and uu.unit_id = #{unitId}
+            </if>
+        </where>
+        order by uu.ridgepole,uu.unit,u.user_id desc
     </select>
 
     <delete id="deleteReturnWork">