瀏覽代碼

Merge remote-tracking branch 'origin/master'

Longlin 5 年之前
父節點
當前提交
a6a8bc0fd8

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

@@ -0,0 +1,121 @@
+define(function (require) {
+        return function (context) {
+
+            var $grid1, $form;
+
+            // 输入搜索文本后点击回车按钮查询列表
+            function enterQueryGrid1(e) {
+                if (e.keyCode === 13) {
+                    var tmp = $(this).val();
+                    $form.formSet({queryProperties: tmp});
+                    queryGrid1();
+                }
+            }
+
+            // 检索条件查询
+            function queryGrid1() {
+                var queryForm = $form.formGet();
+                $grid1.reload({
+                    mtype: 'POST',
+                    url: api('/sweepCode/selectLingyunUser'),
+                    queryParams: queryForm
+                }, true);
+            }
+
+            var queryToolbar = {
+                xtype: 'toolbar',
+                title: '用户管理',
+                items: [
+                    {
+                        text: '查询', iconCls: 'fa fa-search', onClick: function () {
+                            queryGrid1();
+                        }
+                    }, {
+                        text: '重置', iconCls: 'fa fa-refresh', onClick: function () {
+                            $form.formClear();
+                            queryGrid1();
+                        }
+                    }, {
+                        text: '关闭', iconCls: 'fa fa-times-circle', onClick: function () {
+                            App.closeMe(this);
+                        }
+                    }
+                ]
+            };
+
+            var queryForm = {
+                onRender: function () {
+                    $form = $(this);
+                },
+                xtype: 'form',
+                items: [[
+                    {
+                        xtype: 'textbox',
+                        label: '检索条件',
+                        name: 'queryProperties',
+                        prompt: "小区名称/用户名称/电话号码",
+                        labelWidth: 'auto',
+                        events: {keydown: enterQueryGrid1}, width: 350
+                    },
+                ]]
+            };
+
+            return {
+                north: {
+                    height: 88,
+                    /* split: true,
+                     border: false,*///底框是否可变动
+                    items: [
+                        queryToolbar,
+                        queryForm
+                    ]
+                },
+                center: {
+                    height: '60%',
+                    split: true,
+                    items:
+                        {
+                            onRender: function () {
+                                $grid1 = $(this);
+                                queryGrid1()
+                            },
+                            xtype: 'grid',
+                            toolbar: {
+                                xtype: 'toolbar',
+                                title: '用户列表',
+                                items: [
+                                    {
+                                        text: '生成健康及旅居申请表', iconCls: 'fa fa-plus-circle fa-lg', onClick: function () {
+
+                                        }
+                                    },
+                                    {
+                                        text: '生成隔离人员解除隔离审批表', iconCls: 'fa fa-plus-circle fa-lg', onClick: function () {
+
+                                        }
+                                    }
+
+                                ]
+                            },
+                            multiselect: true, /// 表格多选
+                            idField: 'userId',
+                            editable: true,
+                            editOnSelected: true,
+                            autoSizeColumns: true,
+                            columns:
+                                [
+                                    [
+                                        {field: 'userId', title: '用户ID', hidden: true},
+                                        {field: 'linkman', title: '用户名', maxWidth: 200, align: 'left',},
+                                        {field: 'uptownName', title: '小区名称', maxWidth: 200, align: 'left',},
+                                        {field: 'phone', title: '电话', maxWidth: 200, align: 'left',},
+                                        {field: 'dept', title: '部门', maxWidth: 200, align: 'left',},
+
+                                    ]
+                                ]
+                        }
+                }
+            };
+        };
+    }
+);

+ 8 - 0
admin-ui/app/whepi/mock/menu.json

@@ -48,6 +48,14 @@
           "iconCls": "icon-blank fa fa-align-justify",
           "state": "close",
           "children": []
+        },
+        {
+          "id": "ENT100025",
+          "text": "用户管理",
+          "href": "/app/whepi/lingyun/lingyunUser.js",
+          "iconCls": "icon-blank fa fa-align-justify",
+          "state": "close",
+          "children": []
         }
       ]
     },

+ 30 - 24
whepi-ui/templates/home/ribao.js

@@ -449,7 +449,7 @@ function insertlingyun() {
   var cfd = $("#js_input_cfd").attr("data-values") == undefined ? 0 : $("#js_input_cfd").attr("data-values");
   var mdd = $("#js_input_mdd").attr("data-values") == undefined ? 0 : $("#js_input_mdd").attr("data-values");
   var jrszq = $('#js_input_jrszq').val();
-    var mddq = $('#js_input_mddq').val();
+  var mddq = $('#js_input_mddq').val();
   if (mdd != jrszd) {
     $.alert("目的地与今晚住地不一致");
     return;
@@ -458,17 +458,17 @@ function insertlingyun() {
     $.alert("目的地与今晚住地不一致");
     return;
   }
-    var cxfsq = $('#js_input_cxfsq').val();
-    var cfdq = $('#js_input_cfdq').val();
+  var cxfsq = $('#js_input_cxfsq').val();
+  var cfdq = $('#js_input_cfdq').val();
 
-    for (var i = 0; i < listcx.length; i++){
-      if(listcx[i].tripTypeDesp == cxfsq && listcx[i].tripType == cxfs && listcx[i].startLocal == cfd && listcx[i].startLocalOther == cfdq && listcx[i].endLocal == mdd && listcx[i].endLocalOther == mddq){
+  for (var i = 0; i < listcx.length; i++) {
+    if (listcx[i].tripTypeDesp == cxfsq && listcx[i].tripType == cxfs && listcx[i].startLocal == cfd && listcx[i].startLocalOther == cfdq && listcx[i].endLocal == mdd && listcx[i].endLocalOther == mddq) {
 
-              $.alert("此行程已添加");
-              return;
+      $.alert("此行程已添加");
+      return;
 
-      }
     }
+  }
 
   if (cxfs != 4 && cxfs != 0) {
     var val = $('#js_input_cxfsq').val();
@@ -610,7 +610,7 @@ function splice(obj) {
   tab()
 }
 
-//近日报告
+//首次近日报告
 function ribaoInitialization(reportId) {
   if (reportId == null)
     reportId = 0;
@@ -623,12 +623,18 @@ function ribaoInitialization(reportId) {
     },
     type: 'GET',
     success: function (data) {
-      console.log(data);
-      if (data.data.length > 0) {
-        hasData = true;
-        data.data.forEach(function (v) {
-          ribao_cell(v);
-        });
+      if (data.data == undefined || data.data=="") {
+        $('#rb_family').empty();
+        document.getElementById("btn_shangbao").style['background-color'] = "#D9D9D9";
+        canSahngbao = false;
+      }
+      else {
+        if (data.data.length > 0) {
+          hasData = true;
+          data.data.forEach(function (v) {
+            ribao_cell(v);
+          });
+        }
       }
     },
     error: function () {
@@ -646,10 +652,10 @@ function ribao_refrash() {
     },
     type: 'GET',
     success: function (data) {
-      // alert(data.data);
-      console.log(data);
-      if (data.data == undefined) {
+      if (data.data == undefined || data.data=="") {
         $('#rb_family').empty();
+        document.getElementById("btn_shangbao").style['background-color'] = "#D9D9D9";
+        canSahngbao = false;
       }
       else {
         $('#rb_family').empty();
@@ -1043,9 +1049,9 @@ function ribaoCommit() {
 
   var medical = $("input[name='radio']:checked").val();
   console.log(medical)
-  if(medical ==undefined){
-      $.alert("请选择新冠肺炎");
-      return;
+  if (medical == undefined) {
+    $.alert("请选择新冠肺炎");
+    return;
   }
 
 
@@ -1096,7 +1102,7 @@ function ribaoCommit() {
   //如果是凌云
 
   var uptownId = $("#uptownId").val();
-  if (uptownId == xiaoquId  || uptownId == ceshixiaoquId) {
+  if (uptownId == xiaoquId || uptownId == ceshixiaoquId) {
     //lingyun
     var gzzd = $("#js_input_gzzd").attr("data-values") == undefined ? 0 : $("#js_input_gzzd").attr("data-values");
     var qtdd = $("#js_input_qtdd").val();
@@ -1432,7 +1438,7 @@ function addReport() {
     },
     success: function (data) {
       $.toast(data.msg);
-      if (data.msg == "操作成功"){
+      if (data.msg == "操作成功") {
         canSahngbao = false;
         document.getElementById("btn_shangbao").style['background-color'] = "#D9D9D9";
       }
@@ -1455,7 +1461,7 @@ $("#my-input-ribao").calendar({
       },
       type: 'GET',
       success: function (data) {
-        if (data.data == undefined) {
+        if (data.data == undefined || data.data=="") {
           $('#ribao_famliy').empty();
         }
         else {

+ 18 - 0
whepi-web/src/main/java/com/bofeng/dao/MsReportMapper.java

@@ -100,4 +100,22 @@ public interface MsReportMapper extends BaseMapper<MsReport> {
     @Select("select b.medical from ms_report a LEFT JOIN ms_suspected b on a.report_id=b.report_id where a.report_status=1 and a.user_create=#{userId} ORDER BY report_date desc LIMIT 1")
     Integer queryLateStatus(@Param("userId") Long userId);
 
+    /**
+     * 最近去工作驻地的时间
+     * @param userId
+     * @return
+     */
+    @Select("select DATE_FORMAT(a.report_date,'%Y-%m-%d') from ms_report a LEFT JOIN ms_suspected b on a.report_id=b.report_id left join ms_trip c on b.suspected_id=c.trip_id where " +
+            "(c.work_local =c.today_local or c.work_local_other =c.today_local_other) and c.is_trip=1 and a.report_status=1 and a.user_create=#{userId} ORDER BY a.report_date desc LIMIT 1")
+    String returnWork(@Param("userId") Long userId);
+
+    /**
+     * 最近去工作驻地的时间
+     * @param userId
+     * @return
+     */
+    @Select("select a.* from ms_report a LEFT JOIN ms_suspected b on a.report_id=b.report_id left join ms_trip c on b.suspected_id=c.trip_id where (c.work_local " +
+            "!=c.today_local or c.work_local_other !=c.today_local_other) and c.is_trip=1 and a.report_status=1 and a.user_create=#{userId} and a.report_date>#{reportDate} ORDER BY a.report_date desc LIMIT 15")
+    List<MsReport> returnWorkTime(@Param("reportDate") String reportDate, @Param("userId") Long userId);
+
 }

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

@@ -12,5 +12,6 @@ import java.util.Map;
 @Repository
 public interface SweepCodeMapper {
     List<SysUptownHouse> selectCode(PageDb pageDb, Map<String, Object> queryParam);
+    List<SysUptownHouse> selectLingyunUser(PageDb pageDb, Map<String, Object> queryParam);
     List<SysUptownHouse> export(Map<String, Object> queryParam);
 }

+ 6 - 0
whepi-web/src/main/java/com/bofeng/entity/SysUptownHouse.java

@@ -97,6 +97,12 @@ public class SysUptownHouse implements Serializable {
     @TableField(exist = false)
     private String jcStatus;
 
+    @TableField(exist = false)
+    private String dept;
+
+    @TableField(exist = false)
+    private Long userId;
+
 
 
 }

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

@@ -29,6 +29,12 @@ public class SweepCodeService {
     }
 
 
+    public List<SysUptownHouse> selectLingyunUser(PageDb pageDb, Map<String, Object> queryParam) {
+        List<SysUptownHouse> sysUptownHouses = sweepCodeMapper.selectLingyunUser(pageDb,queryParam);
+        return sysUptownHouses;
+    }
+
+
     public List<SysUptownHouse> export(Map<String, Object> queryParam) {
         List<SysUptownHouse> sysUptownHouses = sweepCodeMapper.export(queryParam);
         if(sysUptownHouses.size() != 0){

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

@@ -67,6 +67,14 @@ public class ScanAdminController {
         return Model.newSuccess(pageDb,sysUptownHouses);
     }
 
+    @ApiOperation("凌云用户管理")
+    @PostMapping("/whepi/sweepCode/selectLingyunUser")
+    public Model<List<SysUptownHouse>> selectLingyunUser(PageDb pageDb,HttpParameterParser parser) {
+//        HttpServletResponse response,HttpServletRequest request
+        List<SysUptownHouse> sysUptownHouses = sweepCodeService.selectLingyunUser(pageDb,parser.getMap());
+        return Model.newSuccess(pageDb,sysUptownHouses);
+    }
+
     @ApiOperation("导出")
     @PostMapping("/whepi/sweepCode/export")
     @SneakyThrows

+ 36 - 4
whepi-web/src/main/java/com/bofeng/wx/controller/ScanController.java

@@ -146,6 +146,17 @@ public class ScanController {
                             return new ModelAndView("/user/scan.ftl", model);
                         }
                     }
+                    String returnWork = msReportMapper.returnWork(userOpen.getUserId());
+                    if (returnWork != null) {
+                        List<MsReport> msReports2 = msReportMapper.returnWorkTime(returnWork, userOpen.getUserId());
+                        if (msReports2.size() < 15) {
+                            model.put("collor", "red");
+                            model.put("into", "不许进入");
+                            model.put("errorMsg", "您返回工作驻地后未满14日,不许进入。"+day15(msReports2)+"起方可进入!");
+                            scanService.saveOutScan(userOpen.getUserId(), inType, uptownDoor.getUptownId(), uptownDoor.getDoorId(), -1, model.get("errorMsg").toString());
+                            return new ModelAndView("/user/scan.ftl", model);
+                        }
+                    }
                     List<MsReport> msReports = msReportMapper.selectMsReportLate(userOpen.getUserId());
                     if (msReports.size() == 0) {
                         model.put("collor", "red");
@@ -393,10 +404,10 @@ public class ScanController {
     @ApiOperation("复工查询")
     @GetMapping("/user/returnWork.html")
     public ModelAndView returnWork(HttpServletRequest request, ModelMap model) throws ParseException {
-        UserOpen userOpen = homeService.getUserOpen();
-        List<UserRole> list = userRoleMapper.getUserRoleByUserId(userOpen.getUserId());
-//        List<UserRole> list = userRoleMapper.getUserRoleByUserId(1234L);
-//        UserOpen userOpen = userOpenMapper.selectByUserId(1234L);
+//        UserOpen userOpen = homeService.getUserOpen();
+//        List<UserRole> list = userRoleMapper.getUserRoleByUserId(userOpen.getUserId());
+        List<UserRole> list = userRoleMapper.getUserRoleByUserId(1234L);
+        UserOpen userOpen = userOpenMapper.selectByUserId(1234L);
         model.put("user", userOpen);
         model.put("user_id", "\"" + userOpen.getUserId() + "\"");
         if (list.size() == 0) {
@@ -421,6 +432,16 @@ public class ScanController {
                         return new ModelAndView("/user/returnWork.ftl", model);
                     }
                 }
+                String returnWork = msReportMapper.returnWork(userOpen.getUserId());
+                if (returnWork != null) {
+                    List<MsReport> msReports2 = msReportMapper.returnWorkTime(returnWork, userOpen.getUserId());
+                    if (msReports2.size() < 15) {
+                        model.put("collor", "red");
+                        model.put("into", "不许进入");
+                        model.put("errorMsg", "您返回工作驻地后未满14日,不许进入。"+day15(msReports2)+"起方可进入!");
+                        return new ModelAndView("/user/returnWork.ftl", model);
+                    }
+                }
                 List<MsReport> msReports = msReportMapper.selectMsReportLate(userOpen.getUserId());
                 if (msReports.size() == 0) {
                     model.put("collor", "red");
@@ -498,6 +519,17 @@ public class ScanController {
         return time.substring(0, time.length() - 1);
     }
 
+    public String day15(List<MsReport> list) {
+        SimpleDateFormat sdf = new SimpleDateFormat("MM月dd日");
+        Date time1 = null;
+        if(list.size() == 0) {
+            time1 = new Date();
+        } else {
+            time1 = list.get(0).getReportDate();
+        }
+        return sdf.format(new Date(time1.getTime() + 1000L*3600*24*14));
+    }
+
 //    /**
 //     * 生成进出门二维码
 //     * @param doorId 小区大门ID

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

@@ -38,6 +38,26 @@
         </where>
      order by c.time_update desc
     </select>
+    <select id="selectLingyunUser" resultType="com.bofeng.entity.SysUptownHouse">
+     select
+     b.user_id,
+     a.linkman,
+     a.phone,
+     e.uptown_name,
+     concat(d.ridgepole,d.unit) as dept
+     from sys_uptown_home a
+     inner join sys_user_role b on a.house_id = b.property_id and b.role_id =1
+     inner join sys_uptown_house c on c.house_id = b.property_id
+     inner join sys_uptown_unit d on c.unit_id = d.unit_id
+     inner join sys_uptown e on e.uptown_id = d.uptown_id and e.uptown_id = 1238790987234
+        <where>
+         <if test="queryProperties != null and queryProperties != ''">
+          e.uptown_name like concat('%',#{queryProperties},'%')
+          or a.linkman like concat('%',#{queryProperties},'%')
+          or a.phone like concat('%',#{queryProperties},'%')
+         </if>
+        </where>
+    </select>
     <select id="export" resultType="com.bofeng.entity.SysUptownHouse">
      select DISTINCT
      a.uptown_name,