Browse Source

凌云集团更改公司

peiguo 5 years ago
parent
commit
5f261d8c94

+ 11 - 0
admin-ui/app/whepi/clock/clock.js

@@ -229,6 +229,17 @@ define(function (require) {
               exportExcel();
             }
           },
+          {
+            text: '分单位统计考勤', iconCls: 'fa fa-cloud-upload', onClick: function () {
+              var queryForm = $form.formGet();
+              $.yvan.download({
+                method: 'post',
+                url: api('/clock/exClockCount?queryProperties=' + queryForm.queryProperties + '&phone=' + queryForm.phone + '&unitId=' + queryForm.unitId + '&departmentId=' + queryForm.departmentId + '&dateSta=' + queryForm.dateSta + '&dateEnd=' + queryForm.dateEnd),
+                fileName: '分单位统计考勤-' + $.yvan.getMoment().format('YYYY-MM-DD HH:mm:ss') + '.xlsx'
+
+              });
+            }
+          },
         ]
       };
 

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

@@ -1,5 +1,6 @@
 package com.bofeng.dao;
 
+import com.bofeng.entity.Clock;
 import com.bofeng.entity.OutScanClock;
 import com.bofeng.entity.SysUptownHouse;
 import com.bofeng.entity.SysUptownHouseLY;
@@ -25,4 +26,5 @@ public interface SweepCodeMapper {
 
     List<OutScanClock> selectClockLY(PageDb pageDb, Map<String, Object> queryParam);
     List<OutScanClock> exSelectClockLY(Map<String, Object> queryParam);
+    List<Clock> exClockCount(Map<String, Object> queryParam);
 }

+ 19 - 0
whepi-web/src/main/java/com/bofeng/entity/Clock.java

@@ -0,0 +1,19 @@
+package com.bofeng.entity;
+
+import com.alibaba.excel.annotation.ExcelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+@Getter
+@Setter
+public class Clock {
+
+    @ExcelProperty(value = "部门", index = 0)
+    private String unit;
+
+    @ExcelProperty(value = "二级部门", index = 1)
+    private String departmentName;
+
+    @ExcelProperty(value = "签到人数", index = 2)
+    private String clockCount;
+}

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

@@ -319,6 +319,10 @@ public class SweepCodeService {
         return list;
     }
 
+    public List<Clock> exClockCount(Map<String, Object> queryParam) {
+        return sweepCodeMapper.exClockCount(queryParam);
+    }
+
     public List<OutScanEstate> selectXunJian(PageDb pageDb, Map<String, Object> queryParam) {
         List<OutScanEstate> outScanEstates = outScanEstateMapper.selectXunJian(pageDb,queryParam);
         return outScanEstates;

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

@@ -533,6 +533,14 @@ public class ScanAdminController {
         ExcelUtils.writeSheet(OutScanClock.class, list).export(resp,"出入管理");
     }
 
+    @ApiOperation("凌云分单位统计考勤")
+    @PostMapping("/whepi/clock/exClockCount")
+    @SneakyThrows
+    public void exClockCount(HttpParameterParser parser,HttpServletResponse resp) {
+        List<Clock> list = sweepCodeService.exClockCount(parser.getMap());
+        ExcelUtils.writeSheet(Clock.class, list).export(resp,"分单位统计考勤");
+    }
+
 
     // 获取code
     private static final String oauth2 = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=";

+ 43 - 0
whepi-web/src/main/resources/mapper/SweepCodeMapper.xml

@@ -432,4 +432,47 @@
         ORDER BY dateStr DESC
     </select>
 
+    <select id="exClockCount" resultType="com.bofeng.entity.Clock">
+        select * from (
+            SELECT
+            CONCAT( d.ridgepole, d.unit ) AS unit,
+            de.department_name AS departmentName,
+            count(de.department_name) as clockCount
+            FROM out_scan c
+            inner join (select user_id,min(date) as dateStr
+            from out_scan
+            where uptown_id = 1238790987234 and go_status = 1 and in_type = 1
+            <if test="dateSta != null and dateSta !=''">
+                and date >= #{dateSta}
+            </if>
+            <if test="dateEnd != null and dateEnd !=''">
+                and date &lt; #{dateEnd}
+            </if>
+            group by user_id)aa on aa.user_id = c.user_id and aa.dateStr = c.date and c.go_status = 1 and c.in_type = 1
+            INNER JOIN sys_user_role t ON c.user_id = t.user_id AND role_id = 1
+            INNER JOIN sys_uptown_house e ON e.house_id = t.property_id
+            INNER JOIN sys_uptown_unit d ON d.unit_id = e.unit_id
+            INNER JOIN sys_uptown_home g ON g.house_id = t.property_id
+            LEFT JOIN sys_department de ON de.department_id = e.department_id
+            inner join sys_uptown_door b on c.door_id = b.door_id
+            <where>
+                <if test="queryProperties != null and queryProperties != ''">
+                    and b.door_name like concat('%',#{queryProperties},'%')
+                </if>
+                <if test="phone != null and phone != ''">
+                    and (g.linkman like concat('%',#{phone},'%')
+                    or g.phone = #{phone} )
+                </if>
+                <if test="unitId != null and unitId != ''">
+                    and d.unit_id = #{unitId}
+                </if>
+                <if test="departmentId != null and departmentId != ''">
+                    and de.department_id = #{departmentId}
+                </if>
+            </where>
+            group by de.department_name, d.ridgepole, d.unit,de.department_name
+            order by unit,de.department_name
+        ) bb where bb.departmentName is not null
+    </select>
+
 </mapper>