Bladeren bron

xielianghe

lange 5 jaren geleden
bovenliggende
commit
b3536247f4

+ 105 - 0
admin-ui/app/whepi/lingyun/dialogLiaodan.js

@@ -0,0 +1,105 @@
+define(function (require) {
+  return function (context) {
+
+    var $dlg, $form;
+
+    var widgets = {
+      // 人员搜索
+      selectHrUserWidget: {
+        url: '/app/sys/widget/selectHrUser.js',
+        bind: {
+          userId: 'userId',
+          userName: 'name'
+        }
+      },
+      // 机构搜索
+      selectOrgWidget: {
+        url: '/app/hr/widget/selectOrg.js',
+        bind: {
+          deptId: 'orgId',
+          orgName: 'orgName'
+        }
+      }
+    };
+
+    return {
+      xtype: 'dialog',
+      dialogId: 'dialogAccount',
+      title: '用户名信息',
+      width: 650,
+      height: 350,
+      onOpen: function () {
+        loadingMask: false,
+          $dlg = $(this);
+        if (context.isEdit) {
+          $.yvan.ajax({
+            type: 'GET',
+            url: api('/sys/account/getById'),
+            data: {
+              accId: context.accId
+            },
+            success: function (data) {
+              $dlg.find('form');
+              $form.formSet(data.data);
+            }
+          });
+        }
+      },
+      center: {
+        items: {
+          xtype: 'formgroup',
+          subLabelWidth: '100',
+          subControlWidth: '200',
+          onRender: function () {
+            $form = $(this);
+          },
+          items: [[
+            {name: 'accId', xtype: 'hidden'},
+            {label: '登录用户名', name: 'account', required: true, ff: 500},
+            {
+              label: '类型',
+              name: 'accType',
+              xtype: 'yvselect',
+              required: true,
+              data: [
+                {id: '', text: '全部'},
+                {id: '0', text: '未上报'},
+                {id: '1', text: '已上报'},
+              ],
+            },
+          ]]
+        }
+      },
+      buttons: [
+        {
+          text: "提交", iconCls: "fa fa-save", onClick: function () {
+            var userId = $form.formGet().userId;
+            var deptId = $form.formGet().deptId;
+            if (('' == userId || null == userId || undefined == userId) && ('' == deptId || null == deptId || undefined == deptId)) {
+              $.yvan.msg('帐号必须关联一个人员或者部门');
+              return;
+            }
+            $.yvan.postForm($form, {
+              url: (context.isEdit ? api('/sys/account/update') : api('/sys/account/insert')),
+              success: function () {
+                $.yvan.msg('操作成功');
+                if (context.isEdit) {
+                  $dlg.window('close');
+                }
+                if ($.type(context.confirm) === 'function') {
+                  context.confirm();
+                }
+              },
+              error: function (data) {
+              }
+            });
+          }
+        }, {
+          text: "关闭", iconCls: "fa fa-times", onClick: function () {
+            $dlg.dialog('close');
+          }
+        }
+      ]
+    };
+  };
+});

+ 153 - 0
admin-ui/app/whepi/lingyun/liaodan.js

@@ -0,0 +1,153 @@
+define(function (require) {
+  return function (context) {
+
+    var $grid, $form;
+
+    // 输入搜索文本后点击回车按钮查询列表
+    function enterQueryGrid1(e) {
+      if (e.keyCode === 13) {
+        var tmp = $(this).val();
+        $form.formSet({queryProperties: tmp});
+        queryGrid1();
+      }
+    }
+
+    // 查询列表
+    function queryGrid1() {
+      var queryUrl = '/home/queryRibaoTest';// 自行替换此参数
+      $grid.jqGrid("clearGridData");
+      var queryForm = $form.formGet();
+      $grid.reload({
+        mtype: 'get',
+        url: api(queryUrl),
+        queryParams: queryForm
+      });
+    }
+
+    // 搜索按钮
+    var queryToolbarTitle = '个人管理';
+    var queryToolbar = {
+      xtype: 'toolbar', title: queryToolbarTitle, 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 queryFormPrompt = '检索条件';
+    var queryForm = {
+      onRender: function () {
+        $form = $(this);
+      },
+      xtype: 'form',
+      items: [
+        [
+          {
+            xtype: 'yvselect',
+            label: '上报状态',
+            name: 'reportStatus',
+            labelWidth: 'auto',
+            width: 200,
+            data: [
+              {id: '', text: '全部'},
+              {id: '0', text: '未上报'},
+              {id: '1', text: '已上报'},
+            ],
+            onChange: function (data) {
+              queryGrid1();
+            },
+          },
+      ]
+      ]
+    };
+
+    // 列表增删改查按钮
+    var gridToolbarTitle = '上报列表';
+    var gridToolbar = {
+      xtype: 'toolbar', title: gridToolbarTitle,
+      items: [
+        {
+          text: '编辑上报信息', iconCls: 'fa fa-pencil-square-o', onClick: function () {
+            var row = $grid.rowData();
+            if (!row) {
+              $.yvan.msg('请先选择一行数据');
+              return;
+            }
+            var dlg = require('/app/whepi/lingyun/dialogLiaodan.js')({// 自行替换此参数
+              isEdit: true,
+              reportId: row.reportId,// 自行替换此参数
+              confirm: function () {
+                queryGrid1();
+              }
+            });
+            $.yvan.showDialog(this, dlg);
+          }
+        }
+      ]
+    }
+
+    return {
+      center: {
+        border: false,
+        items: {
+          onRender: function () {
+            $grid = $(this);
+            queryGrid1();
+          },
+          xtype: 'grid',
+          idField: "reportId",
+          pagination: false,
+          toolbar: {
+            xtype: 'div',
+            items: [
+              queryToolbar,
+              queryForm,
+              gridToolbar
+            ]
+          },
+          columns: [[
+            {title: '账号ID', field: 'reportId', hidden: true},
+            {title: '上报日期', field: 'reportDate'},
+            {
+              title: '上报状态', field: 'reportStatus', formatter: function (value) {
+                if (value == 0)
+                  return "未上报";
+                else
+                  return "<span style='color:green'>已上报</span>";
+              }
+            },
+            {
+              title: '异常状态', field: 'msStatus', formatter: function (value) {
+                if (value == 1)
+                  return "<span style='color:green'>正常</span>";
+                if (value == 2)
+                  return "<span style='color:red'>异常</span>";
+              }
+            },
+            {title: '居家人数', field: 'safetyNum'},
+            {title: '确诊人数', field: 'sureNum'},
+            {title: '疑似人数', field: 'suspectedNum'},
+            {title: '正常人数', field: 'normalNum'},
+            {title: '隔离人数', field: 'singleNum'},
+            {title: '新增人', field: 'userCreateName'},
+            {title: '新增时间', field: 'timeCreate', formatter: 'ts'},
+            {title: '更新人', field: 'userUpdateName'},
+            {title: '更新时间', field: 'timeUpdate', formatter: 'ts'}
+          ]]
+        }
+      }
+    };
+  };
+});

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

@@ -66,6 +66,13 @@
       "iconCls": "icon-blank fa fa-align-justify",
       "state": "close",
       "children": []
+    }, {
+      "id": "ENT10012",
+      "text": "廖丹测试",
+      "href": "/app/whepi/lingyun/liaodan.js",
+      "iconCls": "icon-blank fa fa-align-justify",
+      "state": "close",
+      "children": []
     }
   ]
 }

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

@@ -11,6 +11,7 @@ import org.apache.ibatis.annotations.Select;
 import org.springframework.stereotype.Repository;
 
 import java.util.List;
+import java.util.Map;
 
 /**
  * @Author: xielianghe
@@ -22,6 +23,7 @@ public interface MsReportMapper extends BaseMapper<MsReport> {
 
     List<MsReport> selectByReportDate(@Param("reportDate") String reportDate, @Param("userCreate") Long userCreate);
     List<MsReport> selectByReportDateStatus(@Param("reportDate") String reportDate, @Param("userCreate") Long userCreate);
+    List<MsReport> selectByReportDateTest(Map<String, Object> queryParam);
 
     @Select("select * from ms_report where report_date<curdate()  and user_create=#{userCreate} ORDER BY report_date desc LIMIT 1")
     List<MsReport> getNowByYesterdayDate(@Param("userCreate") Long userCreate);

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

@@ -76,4 +76,8 @@ public class MsReport {
     private Integer todayLocal = 0;
     @TableField(exist = false)
     private String todayLocalOther = "";
+    @TableField(exist = false)
+    private String userCreateName = "";
+    @TableField(exist = false)
+    private String userUpdateName = "";
 }

+ 4 - 0
whepi-web/src/main/java/com/bofeng/entity/MsSuspected.java

@@ -9,6 +9,7 @@ import lombok.Setter;
 import org.joda.time.DateTime;
 
 import java.math.BigDecimal;
+import java.util.Date;
 
 /**
  * @Author: xielianghe
@@ -185,4 +186,7 @@ public class MsSuspected {
 
     @TableField(exist = false)
     private String tripDet ;
+
+    @TableField(exist = false)
+    private Date reportDate ;
 }

+ 7 - 0
whepi-web/src/main/java/com/bofeng/service/MsReportService.java

@@ -16,6 +16,7 @@ import java.text.SimpleDateFormat;
 import java.util.Calendar;
 import java.util.Date;
 import java.util.List;
+import java.util.Map;
 
 /**
  * @Author: xielianghe
@@ -543,4 +544,10 @@ public class MsReportService {
     }
 
 
+    //后台专用
+    public List<MsReport> getByReportReportDateTest(Long userCreate, Map<String, Object> queryParam) {
+        Map<String, Object> mm = queryParam;
+        queryParam.put("userCreate", userCreate);
+        return msReportMapper.selectByReportDateTest(queryParam);
+    }
 }

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

@@ -9,6 +9,7 @@ import com.yvan.Model;
 import com.yvan.ModelOps;
 import com.yvan.mvc.Pd;
 import com.yvan.platform.Conv;
+import com.yvan.springmvc.HttpParameterParser;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PostMapping;
@@ -177,4 +178,11 @@ public class MsReportController {
         return msSuspectedService.getScore(suspectedId, userName, medical, temperature, cough, muscle, dyspnea, fatigue, diarrhea, userCreate);
     }
 
+
+    //后台专用
+    @GetMapping("/whepi/home/queryRibaoTest")
+    public Model<List<MsReport>> queryRibaoTest( HttpParameterParser parser) {
+        Long userCreate = 1231543603566841858L;
+        return Model.newSuccess(msReportService.getByReportReportDateTest(userCreate, parser.getMap()));
+    }
 }

+ 13 - 0
whepi-web/src/main/resources/mapper/MsReport.xml

@@ -9,4 +9,17 @@
         select * from ms_report where report_date = #{reportDate} and  user_create = #{userCreate} and report_status=1
         order by report_date desc
     </select>
+    <select id="selectByReportDateTest" resultType="com.bofeng.entity.MsReport">
+        select a.*,b.nick_name as userCreateName,c.nick_name as userUpdateName
+        from ms_report a
+        left join sys_user_open b on a.user_create=b.user_id
+        left join sys_user_open c on a.user_update=c.user_id
+        <where>
+            a.user_create = #{userCreate}
+            <if test="reportStatus!=null and reportStatus!=''">
+                and a.report_status =#{reportStatus}
+            </if>
+        </where>
+        order by a.report_date desc
+    </select>
 </mapper>