Browse Source

凌云集团更改公司

peiguo 5 years ago
parent
commit
5a4cd931a2

+ 14 - 32
admin-ui/app/whepi/scan/specialPersonnelLYSix.js

@@ -112,36 +112,6 @@ define(function (require) {
                                             );
                                         }
                                     },
-                                    // {
-                                    //     text: '保存', iconCls: 'fa fa-pencil-square-o', onClick: function () {
-                                    //         var row = $grid1.rowData();
-                                    //         if (!row) {
-                                    //             $.yvan.msg('请选择一条要保存的数据');
-                                    //             return;
-                                    //         }
-                                    //         var startDateStr = row.startDateStr;
-                                    //         var endDateStr = row.endDateStr;
-                                    //         if (startDateStr > endDateStr) {
-                                    //             $.yvan.msg('开始时间必须小于等于结束时间');
-                                    //             return;
-                                    //         }
-                                    //         $.yvan.ajax({
-                                    //             url: api('/OutUser/updateOutUser'),
-                                    //             data: {
-                                    //                 tuId: row.tuId,
-                                    //                 startDate: row.startDateStr,
-                                    //                 endDate: row.endDateStr
-                                    //             },
-                                    //             method: 'post',
-                                    //             async: false,
-                                    //             success: function (data) {
-                                    //                 $.yvan.msg("操作成功");
-                                    //                 $grid1.reload();
-                                    //                 queryGrid1();
-                                    //             }
-                                    //         });
-                                    //     }
-                                    // },
                                     {
                                         text: '删除', iconCls: 'fa fa fa-pencil-square-o fa-lg', onClick: function () {
                                             var row = $grid1.checkedData();
@@ -168,10 +138,22 @@ define(function (require) {
                                                 }
                                             });
                                         }
-                                    }
+                                    },
+                                    {
+                                        text: '导出系统六类人员', iconCls: 'fa fa-cloud-upload', onClick: function () {
+                                            var queryForm = $form.formGet();
+                                            $.yvan.download({
+                                                method: 'post',
+                                                url: api('/sweepCode/getByReportSuspected'),
+                                                fileName: '系统六类人员-' + $.yvan.getMoment().format('YYYY-MM-DD HH:mm:ss') + '.xlsx'
+
+                                            });
+                                        }
+                                    },
                                 ]
                             },
-                            multiselect: true, /// 表格多选
+                            multiselect: true, /// 表格
+                            // 多选
                             idField: 'tuId',
                             editable: true,
                             editOnSelected: true,

+ 172 - 0
whepi-ui/templates/user/location.ftl

@@ -0,0 +1,172 @@
+<#assign title="${tittle!''}证"/>
+<#include "/home/frag.head.ftl" />
+
+<div class="weui-tab">
+    <div class="weui-tab__bd">
+        <div class="weui-tab__bd-item weui-tab__bd-item--active">
+            <div class="page__bd">
+                <header class="user-header">
+                    <br/>
+                    <br/>
+                    <br/>
+                    <br/>
+                    <br/>
+                    <br/>
+                    <br/>
+                    <br/>
+                </header>
+                <br/>
+                <div class="weui-form__opr-area">
+                    <a class="weui-btn weui-btn_primary" href="javascript:;" onclick="map();" id="map">定位</a>
+                </div>
+            </div>
+        </div>
+    </div>
+</div>
+</div>
+</body>
+<#include "/home/frag.foot.ftl" />
+<script>
+    $(document).ready(function () {
+        var latitude = "";
+        var longitude = "";
+        $.ajax({
+            url: '/wx/jsApiConfig',
+            type: "get",
+            data: {
+                "url": location.href.split('#')[0]
+            },
+            success: function (data) {
+                // alert(JSON.stringify(data.data))
+                wx.config({
+                    debug: false,
+                    appId: data.data.appId,
+                    timestamp: data.data.timestamp,
+                    nonceStr: data.data.nonceStr,
+                    signature: data.data.signature,
+                    jsApiList: [
+                        // 所有要调用的 API 都要加到这个列表中
+                        'getLocation'
+                    ]
+                });
+                wx.ready(function () {
+                    wx.checkJsApi({
+                        jsApiList: [
+                            'getLocation'
+                        ],
+
+                        success: function (res) {
+                            // alert(JSON.stringify(res))
+                            // alert(JSON.stringify(res));
+                            // alert(JSON.stringify(res.checkResult.getLocation));
+                            if (res.checkResult.getLocation == false) {
+                                alert('你的微信版本太低,不支持微信JS接口,请升级到最新的微信版本!');
+                                return;
+                            }
+                        }
+                    });
+                    wx.error(function(res){
+                        alert("接口调取失败")
+                    });
+                });
+            },
+        });
+        wx.getLocation({
+            type: 'wgs84',
+            success: function (res) {
+                // alert(JSON.stringify(res));
+
+                var geocoder = new qq.maps.Geocoder({
+                    complete: function (result) {
+                        if ('当阳市' === result.detail.addressComponents.district) {
+                            autoLocal='当阳市';
+                        } else {
+                            autoLocal = result.detail.addressComponents.city;
+                        }
+                        autoAddr = result.detail.address;
+                        // alert(result.detail.address)
+                        console.log(result);
+                    }
+                })
+                var coord = new qq.maps.LatLng(res.latitude, res.longitude)
+                latitude = res.latitude;
+                longitude = res.longitude;
+                geocoder.getAddress(coord)
+            },
+            cancel: function (res) {
+                alert('用户拒绝授权获取地理位置');
+            }
+        });
+        window.location.href = ${url} + latitude + "%2C" + longitude + ${moreUrl};
+    })
+    function map() {
+        $.ajax({
+            url: '/wx/jsApiConfig',
+            type: "get",
+            data: {
+                "url": location.href.split('#')[0]
+            },
+            success: function (data) {
+                // alert(JSON.stringify(data.data))
+                wx.config({
+                    debug: false,
+                    appId: data.data.appId,
+                    timestamp: data.data.timestamp,
+                    nonceStr: data.data.nonceStr,
+                    signature: data.data.signature,
+                    jsApiList: [
+                        // 所有要调用的 API 都要加到这个列表中
+                        'getLocation'
+                    ]
+                });
+                wx.ready(function () {
+                    wx.checkJsApi({
+                        jsApiList: [
+                            'getLocation'
+                        ],
+
+                        success: function (res) {
+                            // alert(JSON.stringify(res))
+                            // alert(JSON.stringify(res));
+                            // alert(JSON.stringify(res.checkResult.getLocation));
+                            if (res.checkResult.getLocation == false) {
+                                alert('你的微信版本太低,不支持微信JS接口,请升级到最新的微信版本!');
+                                return;
+                            }
+                        }
+                    });
+                    wx.error(function(res){
+                        alert("接口调取失败")
+                    });
+                });
+            },
+        });
+        wx.getLocation({
+            type: 'wgs84',
+            success: function (res) {
+                // alert(JSON.stringify(res));
+
+                var geocoder = new qq.maps.Geocoder({
+                    complete: function (result) {
+                        if ('当阳市' === result.detail.addressComponents.district) {
+                            autoLocal='当阳市';
+                        } else {
+                            autoLocal = result.detail.addressComponents.city;
+                        }
+                        autoAddr = result.detail.address;
+                        // alert(result.detail.address)
+                        console.log(result);
+                    }
+                })
+                var coord = new qq.maps.LatLng(res.latitude, res.longitude)
+                geocoder.getAddress(coord)
+                alert(coord);
+                // window.location.href = "/user/home.html?userId=" + userId + "&userType=1";
+
+            },
+            cancel: function (res) {
+                alert('用户拒绝授权获取地理位置');
+            }
+        });
+    }
+</script>

+ 1 - 8
whepi-web/src/main/java/com/bofeng/dao/MsReportMapper.java

@@ -212,14 +212,7 @@ public interface MsReportMapper extends BaseMapper<MsReport> {
     MsReport msAddr(@Param("userId") Long userId);
 
     //导出Ly异常
-    @Select("select u.uptown_name,uu.unit as orgName,uh.linkman as userName,uh.phone,ur.user_id\n" +
-            "from sys_user_role ur\n" +
-            "INNER JOIN sys_uptown_home uh on uh.house_id = ur.property_id\n" +
-            "INNER JOIN sys_uptown_house uh1 on uh1.house_id = ur.property_id\n" +
-            "INNER JOIN sys_uptown_unit uu on uu.unit_id = uh1.unit_id\n" +
-            "INNER JOIN sys_uptown u on u.uptown_id = uu.uptown_id\n" +
-            "where ur.role_id = 1 and u.uptown_name = '金湖家园'\n" +
-            "GROUP BY u.uptown_name,uu.unit,uh.linkman,uh.phone,ur.user_id")
+    @Select("select u.uptown_name,CONCAT(uu.ridgepole,uu.unit) as orgName,uh.linkman as userName,uh.phone,ur.user_id,uh1.doorplate from sys_user_role ur INNER JOIN sys_uptown_home uh on uh.house_id = ur.property_id INNER JOIN sys_uptown_house uh1 on uh1.house_id = ur.property_id INNER JOIN sys_uptown_unit uu on uu.unit_id = uh1.unit_id INNER JOIN sys_uptown u on u.uptown_id = uu.uptown_id where ur.role_id = 1 and u.uptown_id = 1238790987234 ORDER BY uh.linkman,uh1.doorplate")
     List<MsReport> selectByReportSuspected();
 
     //确诊、疑似、有接触史

+ 78 - 0
whepi-web/src/main/java/com/bofeng/entity/MsReport.java

@@ -1,6 +1,7 @@
 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;
@@ -88,12 +89,19 @@ public class MsReport {
     private String todayMsg;
 
     //导出ly异常
+    @ExcelProperty(value = "部门", index = 0)
     @ApiModelProperty("部门")
     @TableField(exist = false)
     private String orgName;
+    @ExcelProperty(value = "姓名", index = 1)
     @ApiModelProperty("姓名")
     @TableField(exist = false)
     private String userName;
+    @ExcelProperty(value = "工号", index = 2)
+    @ApiModelProperty("工号")
+    @TableField(exist = false)
+    private String doorplate;
+    @ExcelProperty(value = "电话", index = 3)
     @ApiModelProperty("电话")
     @TableField(exist = false)
     private String phone;
@@ -103,19 +111,89 @@ public class MsReport {
     @ApiModelProperty("是否有过确诊:0无,1有")
     @TableField(exist = false)
     private Integer isSure;
+    @ExcelProperty(value = "是否有过确诊", index = 4)
+    private String isSureMsg;
+
+    public String getIsSureMsg() {
+        if (isSure == 0) {
+            isSureMsg = "无";
+        } else if (isSure == 1) {
+            isSureMsg = "有";
+        } else{
+            isSureMsg = "";
+        }
+        return isSureMsg;
+    }
+
     @ApiModelProperty("是否有过疑似:0无,1有")
     @TableField(exist = false)
     private Integer isSuspected;
+    @ExcelProperty(value = "是否有过疑似", index = 5)
+    private String isSuspectedMsg;
+
+    public String getIsSuspectedMsg() {
+        if (isSuspected == 0) {
+            isSuspectedMsg = "无";
+        } else if (isSuspected == 1) {
+            isSuspectedMsg = "有";
+        } else{
+            isSuspectedMsg = "";
+        }
+        return isSuspectedMsg;
+    }
+
+    @ExcelProperty(value = "是否有过病史", index = 8)
     @ApiModelProperty("是否有过病史:病史+时间")
     @TableField(exist = false)
     private String isSymptom;
     @ApiModelProperty("是否有过接触:0无,1有")
     @TableField(exist = false)
     private Integer isContact;
+    @ExcelProperty(value = "是否有过接触", index = 6)
+    private String isContactMsg;
+
+    public String getIsContactMsg() {
+        if (isContact == 0) {
+            isContactMsg = "无";
+        } else if (isContact == 1) {
+            isContactMsg = "有";
+        } else{
+            isContactMsg = "";
+        }
+        return isContactMsg;
+    }
+
     @ApiModelProperty("家人是否有过确诊:0无,1有")
     @TableField(exist = false)
     private Integer isFamliyContact;
+    @ExcelProperty(value = "家人是否有过确诊", index = 7)
+    private String isFamliyContactMsg;
+
+    public String getIsFamliyContactMsg() {
+        if (isFamliyContact == 0) {
+            isFamliyContactMsg = "无";
+        } else if (isFamliyContact == 1) {
+            isFamliyContactMsg = "有";
+        } else{
+            isFamliyContactMsg = "";
+        }
+        return isFamliyContactMsg;
+    }
+
     @ApiModelProperty("异地返回是否超过14天:0无,1有")
     @TableField(exist = false)
     private Integer isWork;
+    @ExcelProperty(value = "异地返回是否超过14天", index = 9)
+    private String isWorkMsg;
+
+    public String getIsWorkMsg() {
+        if (isWork == 0) {
+            isWorkMsg = "无";
+        } else if (isWork == 1) {
+            isWorkMsg = "有";
+        } else{
+            isWorkMsg = "";
+        }
+        return isWorkMsg;
+    }
 }

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

@@ -6,6 +6,7 @@ import com.bofeng.JwtHelper;
 import com.bofeng.dao.*;
 import com.bofeng.entity.*;
 import com.bofeng.excel.ExcelUtils;
+import com.bofeng.service.MsReportService;
 import com.bofeng.service.ScanAdminService;
 import com.bofeng.service.SweepCodeService;
 import com.bofeng.unit.QRCode;
@@ -68,6 +69,8 @@ public class ScanAdminController {
     private SysUptownUnitMapper sysUptownUnitMapper;
     @Autowired
     private RbMapper rbMapper;
+    @Autowired
+    private MsReportService msReportService;
 
     @ApiOperation("出入查询")
     @PostMapping("/whepi/sweepCode/selectCode")
@@ -199,6 +202,14 @@ public class ScanAdminController {
         ExcelUtils.writeSheet(OutScanEstate.class, outScanEstates).export(resp,"问询管理");
     }
 
+    @ApiOperation("导出凌云异常情况")
+    @PostMapping("/whepi/sweepCode/getByReportSuspected")
+    @SneakyThrows
+    public void getByReportSuspected(HttpParameterParser parser,HttpServletResponse resp) {
+        List<MsReport> list = msReportService.getByReportSuspected();
+        ExcelUtils.writeSheet(MsReport.class, list).export(resp,"系统六类人员");
+    }
+
     @ApiOperation("特殊人员查询")
     @PostMapping("/whepi/OutUser/selectAllOutUser")
     public Model<List<OutUser>> selectAllOutUser(PageDb pageDb,HttpParameterParser parser) {

+ 23 - 7
whepi-web/src/main/java/com/bofeng/wx/controller/ScanController.java

@@ -28,6 +28,7 @@ import javax.servlet.ServletOutputStream;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
+import java.io.UnsupportedEncodingException;
 import java.net.URLEncoder;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
@@ -81,11 +82,12 @@ public class ScanController {
     @ApiOperation("进出扫码页面")
     @GetMapping("/user/scan.html")
     public ModelAndView scan(HttpServletRequest request, ModelMap model, @RequestParam(value = "doorId", required = false, defaultValue = "0") Long doorId,
-                             @RequestParam(value = "inType", required = false, defaultValue = "0") Integer inType) throws ParseException {
+                             @RequestParam(value = "inType", required = false, defaultValue = "0") Integer inType,
+                             @RequestParam(value = "coord", required = false, defaultValue = "") String coord) throws ParseException, UnsupportedEncodingException {
         UserOpen userOpen = homeService.getUserOpenByCode(request.getParameter("code"));
         List<UserRole> list = userRoleMapper.getUserRoleByUserId(userOpen.getUserId());
-//        List<UserRole> list = userRoleMapper.getUserRoleByUserId(1234L);
-//        UserOpen userOpen = userOpenMapper.selectByUserId(1234L);
+//        List<UserRole> list = userRoleMapper.getUserRoleByUserId(1228565481837944834L);
+//        UserOpen userOpen = userOpenMapper.selectByUserId(1228565481837944834L);
         model.put("user", userOpen);
         model.put("user_id", "\"" + userOpen.getUserId() + "\"");
         if (list.size() == 0) {
@@ -145,6 +147,12 @@ public class ScanController {
                     }
                 }
                 if (ly) {
+//                    if ("".equals(coord)) {//%2C
+//                        String url = oauth2+appId +"&redirect_uri="+URLEncoder.encode(domain()+"user/scan.html?doorId="+doorId+"&inType="+inType + "&coord=","utf-8");
+//                        model.put("url", url);
+//                        model.put("moreUrl", moreUrl);
+//                        return new ModelAndView("/user/location.ftl", model);
+//                    }
                     OutUser outUser1 = outUserMapper.getOutUserByPhone(4, uptownHomes.get(0).getLinkman(), Long.parseLong(uptownHomes.get(0).getPhone()));
                     if (outUser1 != null) {
                         model.put("collor", "red");
@@ -159,7 +167,7 @@ public class ScanController {
                         model.put("collor", "green");
                         model.put("collor2", "green");
                         model.put("into", "允许通行");
-                        model.put("errorMsg", "特殊人员允许通行,请保证生产同时注意自身安全。");
+                        model.put("errorMsg", "声明:复工许可证是根据员工自主填写健康日报,结合凌云集团复工条件自动产生。原则上代表员工可复工,在厂门口扫描二维码生成绿色复工通行证,并接受规定检查后,方可入厂。");
                         scanService.saveOutScan(userOpen.getUserId(), inType, uptownDoor.getUptownId(), uptownDoor.getDoorId(), 1, "");
                         return new ModelAndView("/user/scan.ftl", model);
                     }
@@ -228,7 +236,7 @@ public class ScanController {
                         model.put("collor", "green");
                         model.put("collor2", "green");
                         model.put("into", "允许通行");
-                        model.put("errorMsg", "特殊人员允许通行,请保证生产同时注意自身安全。");
+                        model.put("errorMsg", "声明:复工许可证是根据员工自主填写健康日报,结合凌云集团复工条件自动产生。原则上代表员工可复工,在厂门口扫描二维码生成绿色复工通行证,并接受规定检查后,方可入厂。");
                         scanService.saveOutScan(userOpen.getUserId(), inType, uptownDoor.getUptownId(), uptownDoor.getDoorId(), 1, "");
                         return new ModelAndView("/user/scanHC.ftl", model);
                     }
@@ -531,7 +539,7 @@ public class ScanController {
                 model.put("collor", "green");
                 model.put("collor2", "green");
                 model.put("into", "允许复工");
-                model.put("errorMsg", "特殊人员允许复工,请保证生产同时注意自身安全。");
+                model.put("errorMsg", "声明:复工许可证是根据员工自主填写健康日报,结合凌云集团复工条件自动产生。原则上代表员工可复工,在厂门口扫描二维码生成绿色复工通行证,并接受规定检查后,方可入厂。");
                 return new ModelAndView("/user/returnWork.ftl", model);
             }
             MsReport msReport = msReportMapper.queryMsReportIsXG(userId);
@@ -597,7 +605,7 @@ public class ScanController {
                 model.put("collor", "green");
                 model.put("collor2", "green");
                 model.put("into", "允许复工");
-                model.put("errorMsg", "特殊人员允许复工,请保证生产同时注意自身安全。");
+                model.put("errorMsg", "声明:复工许可证是根据员工自主填写健康日报,结合凌云集团复工条件自动产生。原则上代表员工可复工,在厂门口扫描二维码生成绿色复工通行证,并接受规定检查后,方可入厂。");
                 return new ModelAndView("/user/returnWorkHC.ftl", model);
             }
             MsReport msReport = msReportMapper.queryMsReportIsXG(userId);
@@ -704,6 +712,14 @@ public class ScanController {
         return sdf.format(new Date(time1.getTime() + 1000L * 3600 * 24 * 15));
     }
 
+    public String domain() {
+        if (domain.substring(domain.length()-1).equals("/")) {
+            return domain;
+        } else {
+            return domain + "/";
+        }
+    }
+
 //    /**
 //     * 生成进出门二维码
 //     * @param doorId 小区大门ID