Bläddra i källkod

Merge branch 'dev' of http://192.168.1.220:10080/Amoy/patient-co-management into dev

huangwenjie 7 år sedan
förälder
incheckning
1903eaeedc
34 ändrade filer med 1120 tillägg och 53 borttagningar
  1. 90 0
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/controller/manager/healthbank/TaskController.java
  2. 90 0
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/controller/manager/healthbank/TaskRuleController.java
  3. 1 1
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/manager/healthbank/ActivityService.java
  4. 70 0
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/manager/healthbank/TaskRuleService.java
  5. 70 0
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/manager/healthbank/TaskService.java
  6. 3 3
      patient-co-manage/wlyy-manage/src/main/resources/application.yml
  7. 1 1
      patient-co-manage/wlyy-manage/src/main/webapp/WEB-INF/views/healthbank/activity_list_js.jsp
  8. 54 0
      patient-co-manage/wlyy-manage/src/main/webapp/WEB-INF/views/healthbank/task_list.jsp
  9. 236 0
      patient-co-manage/wlyy-manage/src/main/webapp/WEB-INF/views/healthbank/task_list_js.jsp
  10. 95 0
      patient-co-manage/wlyy-manage/src/main/webapp/WEB-INF/views/healthbank/task_modify.jsp
  11. 197 0
      patient-co-manage/wlyy-manage/src/main/webapp/WEB-INF/views/healthbank/task_modify_js.jsp
  12. 3 0
      patient-co-manage/wlyy-manage/src/main/webapp/WEB-INF/views/main.jsp
  13. 1 0
      patient-co-manage/wlyy-manage/src/main/webapp/static/js/menu.js
  14. 1 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/message/MessageDao.java
  15. 9 2
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/device/DeviceDetailService.java
  16. 2 2
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/health/PatientHealthGuidanceService.java
  17. 29 3
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/health/PatientHealthIndexService.java
  18. 40 10
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/health/bank/CreditLogService.java
  19. 26 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/health/bank/TaskService.java
  20. 1 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/message/MessageService.java
  21. 6 5
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/specialist/SpecialistService.java
  22. 2 2
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/template/DoctorTeamGuidanceService.java
  23. 7 4
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/weixin/applets/AppletsService.java
  24. 22 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/WeixinBaseController.java
  25. 22 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/account/WechatController.java
  26. 4 7
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/device/DoctorDeviceController.java
  27. 1 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/health/bank/ActivityController.java
  28. 1 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/patient/PatientInfoController.java
  29. 3 2
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/specialist/SpecialistController.java
  30. 4 2
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/template/DoctorTeamGuidanceController.java
  31. 3 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/health/bank/CreditsLogController.java
  32. 0 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/health/bank/TaskController.java
  33. 25 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/health/bank/AccountController.java
  34. 1 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/wechat/util/WeiXinOpenIdUtils.java

+ 90 - 0
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/controller/manager/healthbank/TaskController.java

@ -0,0 +1,90 @@
package com.yihu.wlyy.controller.manager.healthbank;
import com.yihu.wlyy.controller.BaseController;
import com.yihu.wlyy.service.manager.healthbank.TaskService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
/**
 * Created by humingfen on 2018/6/21.
 * 健康任务管理
 */
@Controller
@RequestMapping("admin/task")
public class TaskController extends BaseController {
    @Autowired
    private TaskService taskService;
    @RequestMapping(value = "initial", method = RequestMethod.GET)
    public String initListPage(){
        return "healthbank/task_list";
    }
    @RequestMapping(value = "infoInit")
    public String initInfoPage(@RequestParam(value = "id") String id, String type){
        request.setAttribute("id",id);
        request.setAttribute("type",type);
        return "healthbank/task_modify";
    }
    @RequestMapping(value = "init")
    public String init(String type){
        request.setAttribute("type",type);
        return "healthbank/task_modify";
    }
    @RequestMapping(value ="list",method = RequestMethod.POST)
    @ResponseBody
    public String searchList(
            @RequestParam(name = "task") String task,
            @RequestParam(value = "page",required = false) Integer page,
            @RequestParam(value = "rows",required = false) Integer pageSize){
        try{
            return write(200,"操作成功","detailModelList",taskService.searchList(task, page, pageSize).get("detailModelList"));
//            return write(200,"操作成功");
        }catch (Exception ex){
            error(ex);
            return error(-1,"操作失败!");
        }
    }
    @RequestMapping(value = "findById")
    @ResponseBody
    public String findById(@RequestParam(value = "id") String id){
        try {
            String task = "{\"id\":\""+ id + "\"}";
            return  write(200,"操作成功","data",taskService.searchList(task, 1, 1));
        }catch (Exception ex){
            error(ex);
            return error(-1,"操作失败!");
        }
    }
    @RequestMapping(value = "update")
    @ResponseBody
    public String update(String jsonData) {
        try {
            taskService.update(jsonData);
            return write(200, "操作成功" );
        }catch (Exception ex){
            error(ex);
            return error(-1,"操作失败!");
        }
    }
    @RequestMapping(value = "create")
    @ResponseBody
    public String create(String jsonData) {
        try {
            taskService.create(jsonData);
            return write(200, "操作成功" );
        }catch (Exception ex){
            error(ex);
            return error(-1,"操作失败!");
        }
    }
}

+ 90 - 0
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/controller/manager/healthbank/TaskRuleController.java

@ -0,0 +1,90 @@
package com.yihu.wlyy.controller.manager.healthbank;
import com.yihu.wlyy.controller.BaseController;
import com.yihu.wlyy.service.manager.healthbank.TaskRuleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
/**
 * Created by humingfen on 2018/6/22.
 * 健康任务规则管理
 */
@Controller
@RequestMapping("admin/taskRule")
public class TaskRuleController extends BaseController {
    @Autowired
    private TaskRuleService taskRuleService;
    @RequestMapping(value = "initial", method = RequestMethod.GET)
    public String initListPage(){
        return "healthbank/taskRule_list";
    }
    @RequestMapping(value = "infoInit")
    public String initInfoPage(@RequestParam(value = "id") String id, String type){
        request.setAttribute("id",id);
        request.setAttribute("type",type);
        return "healthbank/taskRule_modify";
    }
    @RequestMapping(value = "init")
    public String init(String type){
        request.setAttribute("type",type);
        return "healthbank/taskRule_modify";
    }
    @RequestMapping(value ="list",method = RequestMethod.POST)
    @ResponseBody
    public String searchList(
            @RequestParam(name = "taskRule") String taskRule,
            @RequestParam(value = "page",required = false) Integer page,
            @RequestParam(value = "rows",required = false) Integer pageSize){
        try{
            return write(200,"操作成功","detailModelList",taskRuleService.searchList(taskRule, page, pageSize).get("detailModelList"));
//            return write(200,"操作成功");
        }catch (Exception ex){
            error(ex);
            return error(-1,"操作失败!");
        }
    }
    @RequestMapping(value = "findById")
    @ResponseBody
    public String findById(@RequestParam(value = "id") String id){
        try {
            String taskRule = "{\"id\":\""+ id + "\"}";
            return  write(200,"操作成功","data",taskRuleService.searchList(taskRule, 1, 1));
        }catch (Exception ex){
            error(ex);
            return error(-1,"操作失败!");
        }
    }
    @RequestMapping(value = "update")
    @ResponseBody
    public String update(String jsonData) {
        try {
            taskRuleService.update(jsonData);
            return write(200, "操作成功" );
        }catch (Exception ex){
            error(ex);
            return error(-1,"操作失败!");
        }
    }
    @RequestMapping(value = "create")
    @ResponseBody
    public String create(String jsonData) {
        try {
            taskRuleService.create(jsonData);
            return write(200, "操作成功" );
        }catch (Exception ex){
            error(ex);
            return error(-1,"操作失败!");
        }
    }
}

+ 1 - 1
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/manager/healthbank/ActivityService.java

@ -15,7 +15,7 @@ import java.util.Map;
 */
 */
@Service
@Service
public class ActivityService {
public class ActivityService {
    @Value("${healthbank.activity}")
    @Value("${healthbank.url}")
    private String baseUrl;
    private String baseUrl;
    @Autowired
    @Autowired
    private HttpClientUtil httpClientUtil;
    private HttpClientUtil httpClientUtil;

+ 70 - 0
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/manager/healthbank/TaskRuleService.java

@ -0,0 +1,70 @@
package com.yihu.wlyy.service.manager.healthbank;
import com.alibaba.fastjson.JSONObject;
import com.yihu.wlyy.util.HttpClientUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.Map;
/**
 * Created by humingfen on 2018/6/22.
 * wlyy_health_bank_task_rule数据库
 */
@Service
public class TaskRuleService {
    @Value("${healthbank.url}")
    private String baseUrl;
    @Autowired
    private HttpClientUtil httpClientUtil;
    /**
     * 查看活动列表
     * @param taskRule
     * @param page
     * @param pageSize
     * @return
     */
    public JSONObject searchList(String taskRule, Integer page, Integer pageSize) {
        String url = baseUrl + "findTaskRule";
        String response = "";
        Map<String,String> params = new HashMap<>();
        params.put("taskRule",taskRule);
        params.put("page",page.toString());
        params.put("size",pageSize.toString());
        try {
            response = httpClientUtil.httpPost(url,params);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return JSONObject.parseObject(response);
    }
    public JSONObject update(String jsonData) {
        String url = baseUrl + "updateTaskRule";
        String response = "";
        Map<String,String> params = new HashMap<>();
        params.put("taskRule",jsonData);
        try {
            response = httpClientUtil.httpPost(url,params);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return JSONObject.parseObject(response);
    }
    public JSONObject create(String jsonData) {
        String url = baseUrl + "createTaskRule";
        String response = "";
        Map<String,String> params = new HashMap<>();
        params.put("taskRule",jsonData);
        try {
            response = httpClientUtil.httpPost(url,params);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return JSONObject.parseObject(response);
    }
}

+ 70 - 0
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/manager/healthbank/TaskService.java

@ -0,0 +1,70 @@
package com.yihu.wlyy.service.manager.healthbank;
import com.alibaba.fastjson.JSONObject;
import com.yihu.wlyy.util.HttpClientUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.Map;
/**
 * Created by humingfen on 2018/6/21.
 * wlyy_health_bank_task数据库
 */
@Service
public class TaskService {
    @Value("${healthbank.url}")
    private String baseUrl;
    @Autowired
    private HttpClientUtil httpClientUtil;
    /**
     * 查看活动列表
     * @param task
     * @param page
     * @param pageSize
     * @return
     */
    public JSONObject searchList(String task, Integer page, Integer pageSize) {
        String url = baseUrl + "findTask";
        String response = "";
        Map<String,String> params = new HashMap<>();
        params.put("task",task);
        params.put("page",page.toString());
        params.put("size",pageSize.toString());
        try {
            response = httpClientUtil.httpPost(url,params);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return JSONObject.parseObject(response);
    }
    public JSONObject update(String jsonData) {
        String url = baseUrl + "updateTask";
        String response = "";
        Map<String,String> params = new HashMap<>();
        params.put("task",jsonData);
        try {
            response = httpClientUtil.httpPost(url,params);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return JSONObject.parseObject(response);
    }
    public JSONObject create(String jsonData) {
        String url = baseUrl + "createTask";
        String response = "";
        Map<String,String> params = new HashMap<>();
        params.put("task",jsonData);
        try {
            response = httpClientUtil.httpPost(url,params);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return JSONObject.parseObject(response);
    }
}

+ 3 - 3
patient-co-manage/wlyy-manage/src/main/resources/application.yml

@ -102,7 +102,7 @@ reservation:
  zyurl: http://59.61.92.90:8072/wlyy_service
  zyurl: http://59.61.92.90:8072/wlyy_service
#健康活动url
#健康活动url
healthbank:
healthbank:
  activity: http://localhost:10051/svr-health-bank/
  url: http://localhost:10051/svr-health-bank/
wechat:
wechat:
  appId: wxd03f859efdf0873d
  appId: wxd03f859efdf0873d
@ -210,7 +210,7 @@ reservation:
  zyurl: http://59.61.92.90:8072/wlyy_service
  zyurl: http://59.61.92.90:8072/wlyy_service
#健康活动url
#健康活动url
healthbank:
healthbank:
  activity: http://localhost:10051/svr-health-bank/
  url: http://localhost:10051/svr-health-bank/
wechat:
wechat:
  appId: wx1f129f7b51701428
  appId: wx1f129f7b51701428
  appSecret: 988f005d8309ed1795939e0f042431fb
  appSecret: 988f005d8309ed1795939e0f042431fb
@ -317,7 +317,7 @@ reservation:
  zyurl: http://59.61.92.90:8072/wlyy_service
  zyurl: http://59.61.92.90:8072/wlyy_service
#健康活动url
#健康活动url
healthbank:
healthbank:
  activity: http://localhost:10051/svr-health-bank/
  url: http://localhost:10051/svr-health-bank/
wechat:
wechat:
  appId: wxad04e9c4c5255acf
  appId: wxad04e9c4c5255acf
  appSecret: ae77c48ccf1af5d07069f5153d1ac8d3
  appSecret: ae77c48ccf1af5d07069f5153d1ac8d3

+ 1 - 1
patient-co-manage/wlyy-manage/src/main/webapp/WEB-INF/views/healthbank/activity_list_js.jsp

@ -30,7 +30,7 @@
                $searchBtn: $('#btn_search'),
                $searchBtn: $('#btn_search'),
                $addBtn: $('#btn_add'),
                $addBtn: $('#btn_add'),
                $title: $("#inp_title"),//设备厂商名称
                $title: $("#inp_title"),//活动名称
                $type: $("#inp_type"),
                $type: $("#inp_type"),
                $location: $("#inp_location"),
                $location: $("#inp_location"),
                $startTime: $("#inp_start_time"),
                $startTime: $("#inp_start_time"),

+ 54 - 0
patient-co-manage/wlyy-manage/src/main/webapp/WEB-INF/views/healthbank/task_list.jsp

@ -0,0 +1,54 @@
<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2018/6/21 0019
  Time: 上午 11:29
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html; charset=UTF-8" language="java" pageEncoding="UTF-8" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <%@ include file="../head/page_head.jsp" %>
    <title>健康任务管理</title>
</head>
<body>
<div id="div_wrapper">
    <!-- 检索条件 -->
    <div class="m-task-area f-h50 f-dn f-pr m-form-inline" data-role-form style='display: block;'>
        <div class="m-form-group f-mt10">
            <div class="m-form-control f-ml15">
                <input type="text" id="inp_title" placeholder="请输入任务标题" class="f-ml10" data-attr-scan="title"/>
            </div>
            <div class="m-form-control f-ml15">
                <input type="text" id="inp_type" placeholder="请输入任务类型" class="f-ml10" data-attr-scan="type"/>
            </div>
            <div class="m-form-control f-ml15">
                <input type="text" id="inp_period" placeholder="请输入周期性" class="f-ml10" data-attr-scan="period"/>
            </div>
            <div class="m-form-control f-ml15">
                <input type="text" id="inp_status" placeholder="请输入是否有效" class="f-ml10" data-attr-scan="status"/>
            </div>
            <sec:authorize url="/admin/task/list">
                <div id="btn_search" class="l-button u-btn u-btn-primary u-btn-small f-ib f-vam  f-ml10" >
                    <span>查询</span>
                </div>
            </sec:authorize>
            <sec:authorize url="/admin/task/create">
                <div id="btn_add" class="l-button u-btn u-btn-primary u-btn-small f-ib f-vam  f-ml10" >
                    <span>新增</span>
                </div>
            </sec:authorize>
        </div>
    </div>
    <!-- 列表 -->
    <div id="div_task_list">
    </div>
</div>
</body>
<%@ include file="../head/page_foot.jsp" %>
<%@ include file="task_list_js.jsp" %>
</html>

+ 236 - 0
patient-co-manage/wlyy-manage/src/main/webapp/WEB-INF/views/healthbank/task_list_js.jsp

@ -0,0 +1,236 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="utf-8" %>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<script>
    (function ($, win) {
        $(function () {
            /* ************************** 变量定义 ******************************** */
            // 通用工具类库
            var Util = $.Util;
            var task = null;
            var master = null;
            var isFirstPage = false;
            /* *************************** 函数定义 ******************************* */
            function pageInit() {
                task.init();
                master.init();
            }
            function reloadGrid(params) {
                if (isFirstPage) {
                    this.grid.options.newPage = 1;
                }
                this.grid.setOptions({parms: params});
                this.grid.loadData(true);
            }
            /* *************************** 模块初始化 ***************************** */
            task = {
                $element: $('.m-task-area'),
                $searchBtn: $('#btn_search'),
                $addBtn: $('#btn_add'),
                $title: $("#inp_title"),//任务标题
                $type: $("#inp_type"),//任务类型
                $period: $("#inp_period"),//周期
                $status: $("#inp_status"),//状态
                init: function () {
                    this.$element.show();
                    this.$element.attrScan();
                    window.form = this.$element;
                    this.$title.ligerTextBox({width: 200});
                    this.typeBox = this.$type.ligerComboBox({
                        width: 200,
                        data: [
                            {text: '普通任务', id: 'NORMAL_TASK'},
                            {text: '活动任务', id: 'ACTIVITY_TASK'},
                            {text: '规则任务', id: 'RULE_TASK'},
                        ]
                    });
                    this.periodBox =this.$period.ligerComboBox({
                        width: 200,
                        data: [
                            {text: '一次性', id: '1'},
                            {text: '每天', id: '0'},
                        ]
                    });
                    this.statusBox = this.$status.ligerComboBox({
                        width: 200,
                        data: [
                            {text: '有效', id: '1'},
                            {text: '失效', id: '0'},
                        ]
                    });
                    this.bindEvents();
                },
                bindEvents: function () {
                    var self = this;
                    self.$searchBtn.click(function () {
                        master.grid.options.newPage = 1;
                        master.reloadGrid();
                    });
                    self.$addBtn.click(function () {
                        $.publish("task:info:create", [0]);
                    });
                }
            };
            master = {
                taskInfoDialog: null,
                grid: null,
                init: function () {
                    this.grid = $("#div_task_list").ligerGrid($.LigerGridEx.config({
                        url: ctx + '/admin/task/list',
                        parms: {"task": JSON.stringify(task.$element.Fields.getValues())},
                        ajaxHeader: ajaxHeaderName,
                        ajaxHeaderValue: ajaxHeaderValue,
                        columns: [
                            {display: 'id', name: 'id', hide: true},
                            {display: '任务标题', name: 'title', width: '10%', align: "left"},
                            {display: '任务说明', name: 'content', width: '10%', align: "left"},
                            {display: '任务编码', name: 'taskCode', width: '10%', align: "left"},
                            {
                                display: '任务类型', name: 'type', width: '10%', align: "left",
                                render: function (row) {
                                    if (row.type == "NORMAL_TASK") {
                                        return "普通任务"
                                    }
                                    if (row.type == "ACTIVITY_TASK") {
                                        return "活动任务"
                                    }
                                    if (row.type == "RULE_TASK") {
                                        return "规则任务"
                                    }
                                }
                            },
                            // {display: '业务Id', name: 'startTime', width: '10%', align: "left"},
                            {
                                display: '周期', name: 'period', width: '10%', align: "left",
                                render: function (row) {
                                    if (row.period == 1) {
                                        return "一次性"
                                    }
                                    if (row.period == 0) {
                                        return "每天"
                                    }
                                }
                            },
                            {display: '开始时间', name: 'startTime', width: '10%', align: "left"},
                            {display: '结束时间', name: 'endTime', width: '10%', align: "left"},
                            {
                                display: '状态', name: 'status', width: '10%', align: "left",
                                render: function (row) {
                                    if (row.status == 1) {
                                        return "有效"
                                    }
                                    if (row.status == 0) {
                                        return "失效"
                                    }
                                }
                            },
                            {
                                display: '操作', name: 'operator', width: '10%', align: "center", isSort: false,
                                render: function (row) {
                                    var html = '';
                                    html += '<a  style="margin-left:10px;"href="javascript:void(0)" onclick="javascript:' + Util.format("$.publish('{0}',['{1}'])", "task:info:view", row.id) + '">查看</a>';
                                    <sec:authorize url="/admin/task/update">
                                    html += '<a  style="margin-left:10px;"href="javascript:void(0)" onclick="javascript:' + Util.format("$.publish('{0}',['{1}'])", "task:info:edit", row.id) + '">编辑</a>';
                                    </sec:authorize>
                                    <%--<sec:authorize url="/admin/task/delete">
                                    html += '<a  style="margin-left:10px;"href="javascript:void(0)" onclick="javascript:' + Util.format("$.publish('{0}',['{1}'])", "task:info:del", row.id) + '">删除</a>';
                                    </sec:authorize>--%>
                                    return html;
                                }
                            }
                        ],
                    }));
                    // 自适应宽度
                    this.grid.adjustToWidth();
                    this.bindEvents();
                },
                reloadGrid: function (msg) {
                    task.$element.attrScan();
                    var values = task.$element.Fields.getValues();
                    values.type = task.typeBox.getValue();
                    values.period = task.periodBox.getValue();
                    values.status = task.statusBox.getValue();
                    reloadGrid.call(this,{"task":JSON.stringify(values)});
                },
                delRecord: function (id, code) {
                    var self = this;
                    $.ajax({
                        url: ctx + "/admin/task/delete",
                        data: {"id": id},
                        method: "post",
                        dataType: "json",
                        success: function (result) {
                            if (result.status == '200') {
                                window.reloadMasterGrid(result.msg);
                            } else {
                                $.Notice.error(result.msg);
                            }
                        },
                        error: function (data) {
                            $.Notice.error("系统异常,请联系管理员!");
                        }
                    })
                },
                bindEvents: function () {
                    var self = this;
                    $.subscribe('task:info:view', function (event, id) {
                        var title = '查看信息';
                        self.deviceInfoDialog = $.ligerDialog.open({
                            height: 600,
                            width: 560,
                            urlParms: {"id": id, "type": "view"},
                            title: title,
                            url: ctx + '/admin/task/infoInit'
                        })
                    });
                    $.subscribe('task:info:edit', function (event, id) {
                        var title = '编辑信息';
                        self.taskInfoDialog = $.ligerDialog.open({
                            height: 600,
                            width: 560,
                            urlParms: {"id": id, "type": "edit"},
                            title: title,
                            url: ctx + '/admin/task/infoInit'
                        })
                    });
                    $.subscribe('task:info:create', function (event) {
                        var title = '新增活动';
                        self.taskInfoDialog = $.ligerDialog.open({
                            height: 600,
                            width: 560,
                            urlParms: {"type": "create"},
                            title: title,
                            url: ctx + '/admin/task/init'
                        })
                    });
                    $.subscribe('task:info:del', function (event, id, code) {
                        $.ligerDialog.confirm('确认删除该行信息?<br>如果是请点击确认按钮,否则请点击取消。', function (yes) {
                            if (yes) {
                                self.delRecord(id, code);
                            }
                        });
                    })
                }
            };
            /* ************************* Dialog页面回调接口 ************************** */
            win.reloadMasterGrid = function (msg) {
                if (isNoEmpty(msg)) {
                    $.Notice.success(msg);
                }
                master.reloadGrid(msg);
            };
            win.closetaskInfoDialog = function () {
                master.taskInfoDialog.close();
            };
            /* *************************** 页面初始化 **************************** */
            pageInit();
        });
    })(jQuery, window);
</script>

+ 95 - 0
patient-co-manage/wlyy-manage/src/main/webapp/WEB-INF/views/healthbank/task_modify.jsp

@ -0,0 +1,95 @@
<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2018/6/21
  Time: 10:29
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html; charset=UTF-8" language="java" pageEncoding="UTF-8" %>
<html>
<head>
    <%@ include file="../head/page_head.jsp"%>
    <title>任务详情</title>
    <style type="text/css">
        .m-form-group label.label_title{width: 100px}
    </style>
</head>
<body>
<div id="div_task_info_form" data-role-form class="m-form-inline f-mt20 f-ml30" data-role-form>
    <input type="hidden" id="inp_id" value='${id}' data-attr-scan="id"/>
    <input type="hidden" id="type" value='${type}'/>
    <div class="m-form-group">
        <label class="label_title" style="width:120px">任务标题</label>
        <div class="l-text-wrapper m-form-control essential">
            <input type="text"  id="inp_title" class="required useTitle f-w240 validate-special-char"  required-title="任务标题不能为空"  data-attr-scan="title"/>
        </div>
    </div>
    <div class="m-form-group">
        <label class="label_title" style="width:120px">任务说明</label>
        <div class="l-text-wrapper m-form-control essential">
            <input type="text"  id="inp_content" class="required useTitle ajax f-w240 validate-special-char"  required-title="任务说明不能为空"  data-attr-scan="content"/>
        </div>
    </div>
    <div class="m-form-group">
        <label class="label_title" style="width:120px">任务编码</label>
        <div class="l-text-wrapper m-form-control essential">
            <input type="text"  id="inp_taskCode" class="required useTitle ajax f-w240 validate-special-char"  required-title="任务编码不能为空" data-attr-scan="taskCode"/>
        </div>
    </div>
    <div class="m-form-group">
        <label class="label_title" style="width:120px">任务类型</label>
        <div class="l-text-wrapper m-form-control essential">
            <input type="text"  id="inp_type" class="required useTitle ajax f-w240 validate-special-char" required-title="任务类型不能为空" data-attr-scan="type"/>
        </div>
    </div>
    <div class="m-form-group">
        <label class="label_title" style="width:120px">活动类型</label>
        <div class="l-text-wrapper m-form-control essential">
            <input type="text"  id="inp_transactionId" class="required useTitle ajax f-w240 validate-special-char" required-title="活动类型不能为空" data-attr-scan="transactionId"/>
        </div>
    </div>
    <div class="m-form-group">
        <label class="label_title" style="width:120px">积分规则</label>
        <div class="l-text-wrapper m-form-control essential">
            <input type="text"  id="inp_ruleCode" class="required useTitle ajax f-w240 validate-special-char" required-title="积分规则不能为空" data-attr-scan="ruleCode"/>
        </div>
    </div>
    <div class="m-form-group">
        <label class="label_title" style="width:120px">开始时间</label>
        <div class="l-text-wrapper m-form-control essential">
            <input type="text"  id="inp_startTime"  class="required useTitle f-w240 validate-special-char" required-title="开始时间不能为空" data-attr-scan="startTime"/>
        </div>
    </div>
    <div class="m-form-group">
        <label class="label_title" style="width:120px">结束时间</label>
        <div class="l-text-wrapper m-form-control essential">
            <input type="text"  id="inp_endTime" class="required useTitle f-w240 validate-special-char"  required-title="结束时间不能为空" data-attr-scan="endTime"/>
        </div>
    </div>
    <div class="m-form-group">
        <label class="label_title" style="width:120px">周期</label>
        <div class="l-text-wrapper m-form-control">
            <input type="text"  id="inp_period" class="f-w240 validate-special-char"   data-attr-scan="period"/>
        </div>
    </div>
    <div class="m-form-group">
        <label class="label_title" style="width:120px">状态</label>
        <div class="l-text-wrapper m-form-control">
            <input type="text"  id="inp_status" class="f-w240 validate-special-char" data-attr-scan="status"/>
        </div>
    </div>
    <div class="m-form-group f-pa" id="btn_save_close" style="right: 10px;bottom: 0;">
        <div class="m-form-control">
            <input type="button" value="保存" id="btn_save" class="l-button u-btn u-btn-primary u-btn-large f-ib f-vam" />
            <div id="btn_cancel" class="l-button u-btn u-btn-cancel u-btn-large f-ib f-vam" >
                <span>关闭</span>
            </div>
        </div>
    </div>
</div>
</body>
<%@ include file="../head/page_foot.jsp"%>
<%@ include file="task_modify_js.jsp" %>
<%--<script src="${ctx}/static/js/device/device_modify.js"></script>--%>
</html>

+ 197 - 0
patient-co-manage/wlyy-manage/src/main/webapp/WEB-INF/views/healthbank/task_modify_js.jsp

@ -0,0 +1,197 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="utf-8" %>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<script>
    (function ($, win) {
        $(function () {
            var Util = $.Util;
            var type = $('#type').val();
            var id = $('#inp_id').val();
            var taskInfo = "";
            var jValidation = $.jValidation;
            function pageInit() {
                taskInfo.init();
                if(type != "create") {
                    taskInfo.initForm();
                }
                taskInfo.bindEvents();
            }
            taskInfo = {
                //变量
                $form: $("#div_task_info_form"),
                $transactionId: $("#inp_transactionId"),
                $ruleCode: $("#inp_ruleCode"),
                init: function () {
                    _this = this;
                    this.$form.attrScan();
                    $("#inp_title").ligerTextBox({width: 240})//任务标题
                    $("#inp_content").ligerTextBox({width: 240})//任务说明
                    $("#inp_taskCode").ligerTextBox({width: 240})//任务编码
                    _this.typeBox = $("#inp_type").ligerComboBox({
                        width: 240,
                        data: [
                            {text: '普通任务', id: 'NORMAL_TASK'},
                            {text: '活动任务', id: 'ACTIVITY_TASK'},
                            {text: '规则任务', id: 'RULE_TASK'},
                        ]
                    });//任务类型
                    _this.periodBox = $("#inp_period").ligerComboBox({
                        width: 240,
                        data: [
                            {text: '一次性', id: '1'},
                            {text: '每天', id: '0'},
                        ]
                    })//周期
                    $("#inp_startTime").ligerDateEditor({
                        format: "yyyy-MM-dd hh:mm:ss",
                        showTime: true,
                        width: 240,
                        labelAlign: 'center',
                        cancelable: true
                    });//开始时间
                    $("#inp_endTime").ligerDateEditor({
                        format: "yyyy-MM-dd hh:mm:ss",
                        showTime: true,
                        width: 240,
                        labelAlign: 'center',
                        cancelable: true
                    });//结束时间
                    _this.statusBox = $("#inp_status").ligerComboBox({
                        width: 240,
                        data: [
                            {text: '有效', id: '1'},
                            {text: '失效', id: '0'},
                        ]
                    })//状态
                    //活动下拉框
                    _this.transactionBox = _this.$transactionId.ligerComboBox({
                        url: ctx + "/admin/activity/list",
                        parms: {"activity":"{}","page":1,"rows":10},
                        dataParmName: "detailModelList",
                        textField: "title",
                        valueField: "id",
                        isMultiSelect: false,
                        ajaxBeforeSend: function (xhr) {
                            if (ajaxHeaderName) {
                                xhr.setRequestHeader(ajaxHeaderName, ajaxHeaderValue);
                            }
                        },
                    });
                    //积分规则下拉框
                    _this.ruleBox = _this.$ruleCode.ligerComboBox({
                        url: ctx + "/admin/taskRule/list",
                        parms: {"taskRule":"{}","page":1,"rows":10},
                        dataParmName: "detailModelList",
                        textField: "name",
                        valueField: "id",
                        isMultiSelect: false,
                        ajaxBeforeSend: function (xhr) {
                            if (ajaxHeaderName) {
                                xhr.setRequestHeader(ajaxHeaderName, ajaxHeaderValue);
                            }
                        },
                    });
                },
                initForm: function () {
                    _this = this;
                    //修改、查看
                    $.ajax({
                        url: ctx + "/admin/task/findById",
                        method: "post",
                        dataType: "json",
                        async: false,
                        data: {id: id},
                        success: function (result) {
                            if (result.status == '200') {
                                var data = result.data.detailModelList[0];
                                _this.$form.Fields.fillValues({
                                    title: data.title,
                                    content: data.content,
                                    taskCode: data.taskCode,
                                    startTime: data.startTime,
                                    endTime: data.endTime,
                                });
                                //填值
                                _this.typeBox.selectValue(data.type);
                                _this.periodBox.selectValue(data.period);
                                _this.statusBox.selectValue(data.status);
                                _this.transactionBox.selectValue(data.transactionId);
                                _this.ruleBox.selectValue(data.ruleCode);
                            } else {
                                $.Notice.error(result.msg);
                            }
                        },
                        error: function (data) {
                            $.Notice.error("系统异常,请联系管理员!");
                        }
                    });
                    if (type == "view") {
                        _this.$form.addClass("m-form-readonly"); //表单只读
                        $(".essential").addClass("XXXtest");
                        $(".essential").removeClass("essential");
                        $("#btn_save_close").css("display", "none");
                    } else {
                        this.$form.removeClass("m-form-readonly");
                        $("#btn_save_close").css("display", "block");
                        $(".XXXtest").addClass("essential");
                    }
                    this.$form.show();
                },
                //绑定事件
                bindEvents: function () {
                    var validator = new jValidation.Validation(this.$form, {
                        immediate: true, onSubmit: false,
                        onElementValidateForAjax: function (elm) {
                        }
                    });
                    var self = this;
                    $("#btn_save").click(function () {
                        var values = self.$form.Fields.getValues();
                        values.type = self.typeBox.getValue();
                        values.status = self.statusBox.getValue();
                        values.period = self.periodBox.getValue();
                        values.transactionId = self.transactionBox.getValue();
                        values.ruleCode = self.ruleBox.getValue();
                        if (!validator.validate()) {
                            return;
                        }
                        update(values);
                    });
                    function update(values) {
                        var dataModel = $.DataModel.init();
                        var url = "update";
                        if (type == "create") {
                            url = "create";
                        }
                        dataModel.updateRemote(ctx + "/admin/task/" + url, {
                            data: {jsonData: JSON.stringify(values)},
                            success: function (data) {
                                if (data.status == 200) {
                                    parent.window.reloadMasterGrid(data.msg);
                                    parent.window.closetaskInfoDialog();
                                } else {
                                    $.Notice.error(data.msg);
                                }
                            }
                        });
                    }
                    $("#btn_cancel").click(function () {
                        parent.window.closetaskInfoDialog();
                    });
                },
            }
            pageInit();
        });
    })(jQuery, window)
</script>

+ 3 - 0
patient-co-manage/wlyy-manage/src/main/webapp/WEB-INF/views/main.jsp

@ -131,6 +131,9 @@
							<sec:authorize url="/admin/activity/initial">
							<sec:authorize url="/admin/activity/initial">
								<li><a href="javascript:locationMenu('activity');">活动管理</a></li>
								<li><a href="javascript:locationMenu('activity');">活动管理</a></li>
							</sec:authorize>
							</sec:authorize>
                            <sec:authorize url="/admin/task/initial">
                                <li><a href="javascript:locationMenu('task');">任务管理</a></li>
                            </sec:authorize>
							<sec:authorize url="/admin/healthBank/center">
							<sec:authorize url="/admin/healthBank/center">
						</ul>
						</ul>
					</div>
					</div>

+ 1 - 0
patient-co-manage/wlyy-manage/src/main/webapp/static/js/menu.js

@ -24,6 +24,7 @@ var menu = {
    //健康银行管理
    //健康银行管理
    "activity": "/admin/activity/initial",//健康活动管理页面
    "activity": "/admin/activity/initial",//健康活动管理页面
    "task": "/admin/task/initial",//健康任务管理页面
    //数据统计
    //数据统计
    "static": "/admin/static/center",//数据统计
    "static": "/admin/static/center",//数据统计

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/message/MessageDao.java

@ -49,7 +49,7 @@ public interface MessageDao extends PagingAndSortingRepository<Message, Long>, J
    @Query(" from Message a where a.read = 1 and over ='1' and a.sender = ?1 and a.receiver=?2 ")
    @Query(" from Message a where a.read = 1 and over ='1' and a.sender = ?1 and a.receiver=?2 ")
    List<Message> findByPatientRenew(String patient, String doctor);
    List<Message> findByPatientRenew(String patient, String doctor);
    @Query("select a from Message a where a.receiver = ?1 and a.sender=?2 and a.tzType=?3 order by a.createTime desc")
    @Query("select a from Message a where a.receiver = ?1 and a.sender=?2 and a.tzType=?3 and a.del=1 and a.over=1 order by a.createTime desc")
    List<Message> getHealthIndexMessageByPatient(String doctor, String patient, String type, Pageable pageRequest);
    List<Message> getHealthIndexMessageByPatient(String doctor, String patient, String type, Pageable pageRequest);
    //查询医生下的签约居民未读体征异常消息
    //查询医生下的签约居民未读体征异常消息

+ 9 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/device/DeviceDetailService.java

@ -59,6 +59,7 @@ public class DeviceDetailService extends BaseService {
	@Transactional
	@Transactional
	public void updateAfterBinding(PatientDevice patientDevice, Date grantTime,boolean isFirst)throws Exception{
	public void updateAfterBinding(PatientDevice patientDevice, Date grantTime,boolean isFirst)throws Exception{
		DeviceDetail deviceDetail = deviceDetailDao.findBySn(patientDevice.getDeviceSn());
		DeviceDetail deviceDetail = deviceDetailDao.findBySn(patientDevice.getDeviceSn());
		int bind = deviceDetail.getIsBinding();
		SignFamily signFamily = signFamilyDao.findByIdcard(patientDevice.getUserIdcard());
		SignFamily signFamily = signFamilyDao.findByIdcard(patientDevice.getUserIdcard());
		/*List<SignFamily> signFamilyList = signFamilyDao.findSSandJTByIdcard(patientDevice.getUserIdcard());*/
		/*List<SignFamily> signFamilyList = signFamilyDao.findSSandJTByIdcard(patientDevice.getUserIdcard());*/
		long adminTeam=0L;
		long adminTeam=0L;
@ -95,8 +96,14 @@ public class DeviceDetailService extends BaseService {
		}else {
		}else {
			List<PatientDevice> patientDeviceList = patientDeviceDao.findByDeviceSn(patientDevice.getDeviceSn());
			List<PatientDevice> patientDeviceList = patientDeviceDao.findByDeviceSn(patientDevice.getDeviceSn());
			int patientDeviceSize = patientDeviceList.size();
			int patientDeviceSize = patientDeviceList.size();
			String updateSql ="update device.wlyy_devices dd set dd.is_grant=1,dd.grant_admin_team=?,dd.grant_org_code=?,dd.binding_count=?,dd.is_binding=? where dd.device_code=?";
			jdbcTemplate.update(updateSql,new Object[]{String.valueOf(adminTeam),hospital,isFirstBind,patientDeviceSize,patientDevice.getDeviceSn()});
			String updateSql = "";
			if (bind == 0){
				updateSql ="update device.wlyy_devices dd set dd.is_grant=1,dd.grant_admin_team=?,dd.grant_org_code=?,dd.binding_count=?,dd.is_binding=? where dd.device_code=?";
				jdbcTemplate.update(updateSql,new Object[]{String.valueOf(adminTeam),hospital,isFirstBind,patientDeviceSize,patientDevice.getDeviceSn()});
			}else if (bind>0){
				updateSql ="update device.wlyy_devices dd set dd.is_grant=1,dd.binding_count=?,dd.is_binding=? where dd.device_code=?";
				jdbcTemplate.update(updateSql,new Object[]{isFirstBind,patientDeviceSize,patientDevice.getDeviceSn()});
			}
			//deviceDetailDao.updateAfterBinding(String.valueOf(adminTeam),hospital,isFirstBind,patientDevice.getDeviceSn(),patientDeviceSize);
			//deviceDetailDao.updateAfterBinding(String.valueOf(adminTeam),hospital,isFirstBind,patientDevice.getDeviceSn(),patientDeviceSize);
		}
		}
	}
	}

+ 2 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/health/PatientHealthGuidanceService.java

@ -174,11 +174,11 @@ public class PatientHealthGuidanceService extends BaseService {
				}
				}
			}
			}
		}
		}
		if(StringUtils.isNotEmpty(tzCode)){
		if(StringUtils.isNotEmpty(tzCode)&&!"undefined".equals(tzCode)){
			String sql = " select * from device.wlyy_patient_health_index where id in ("+tzCode+")";
			String sql = " select * from device.wlyy_patient_health_index where id in ("+tzCode+")";
			List<Map<String, Object>> list = jdbcTemplate.queryForList(sql);
			List<Map<String, Object>> list = jdbcTemplate.queryForList(sql);
			Date currentTime = new Date();
			Date currentTime = new Date();
			long h24 = 60*60*24;
			long h24 = 60*60*60*24;
			for(Map<String, Object> one :list){
			for(Map<String, Object> one :list){
				if(one.get("manage_result")!=null&&((Integer)one.get("manage_result")==1||(Integer)one.get("manage_result")==2))continue;
				if(one.get("manage_result")!=null&&((Integer)one.get("manage_result")==1||(Integer)one.get("manage_result")==2))continue;
				String tempSql="";
				String tempSql="";

+ 29 - 3
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/health/PatientHealthIndexService.java

@ -284,6 +284,17 @@ public class PatientHealthIndexService extends BaseService {
        }
        }
        return true;
        return true;
    }
    }
    /**
     * 判断当前指标偏高或偏低
     */
    private int checkHealthIndexDetail(Double current, Double max, Double min) {
        if (current > max ) {
            return 1;
        }else if(current < min || current < 0){
            return 2;
        }
        return 0;
    }
    /**
    /**
     * 推送信息
     * 推送信息
@ -540,13 +551,23 @@ public class PatientHealthIndexService extends BaseService {
            // 餐后
            // 餐后
            if (index % 2 == 0) {
            if (index % 2 == 0) {
                if (!checkHealthIndex(NumberUtils.toDouble(value1), maxValueAfter, minValueAfter)) {
                if (!checkHealthIndex(NumberUtils.toDouble(value1), maxValueAfter, minValueAfter)) {
                    msgContent += patient.getName() + "血糖异常(" + value1 + "mmol/L)";
//                    msgContent += patient.getName() + "血糖异常(" + value1 + "mmol/L)";
                    if(checkHealthIndexDetail(NumberUtils.toDouble(value1), maxValueAfter ,minValueAfter)==1){
                        msgContent = "<a>"+patient.getName()+"</a><span style=\"color: #FF4C4C;\">血糖偏高</span>";
                    }else if(checkHealthIndexDetail(NumberUtils.toDouble(value1), maxValueAfter ,minValueAfter)==2){
                        msgContent = "<a>"+patient.getName()+"</a><span style=\"color: #FF4C4C;\">血糖偏低</span>";
                    }
                    //体征异常,更新体征数据状态
                    //体征异常,更新体征数据状态
                    updateStatus(data);
                    updateStatus(data);
                }
                }
            } else { //餐前
            } else { //餐前
                if (!checkHealthIndex(NumberUtils.toDouble(value1), maxValueBefore, minValueBefore)) {
                if (!checkHealthIndex(NumberUtils.toDouble(value1), maxValueBefore, minValueBefore)) {
                    msgContent += patient.getName() + "血糖异常(" + value1 + "mmol/L)";
//                    msgContent += patient.getName() + "血糖异常(" + value1 + "mmol/L)";
                    if(checkHealthIndexDetail(NumberUtils.toDouble(value1), maxValueAfter ,minValueAfter)==1){
                        msgContent = "<a>"+patient.getName()+"</a><span style=\"color: #FF4C4C;\">血糖偏高</span>";
                    }else if(checkHealthIndexDetail(NumberUtils.toDouble(value1), maxValueAfter ,minValueAfter)==2){
                        msgContent = "<a>"+patient.getName()+"</a><span style=\"color: #FF4C4C;\">血糖偏低</span>";
                    }
                    updateStatus(data);
                    updateStatus(data);
                }
                }
            }
            }
@ -577,7 +598,12 @@ public class PatientHealthIndexService extends BaseService {
            }
            }
            // 收缩压/舒张压校验
            // 收缩压/舒张压校验
            if (!checkHealthIndex(NumberUtils.toDouble(value1), maxValueSSY, minValueSSY) || !checkHealthIndex(NumberUtils.toDouble(value2), maxValueSZY, minValueSZY)) {
            if (!checkHealthIndex(NumberUtils.toDouble(value1), maxValueSSY, minValueSSY) || !checkHealthIndex(NumberUtils.toDouble(value2), maxValueSZY, minValueSZY)) {
                msgContent = patient.getName() + "血压异常(舒张压 " + value2 + "mmHg、收缩压 " + value1 + "mmHg)";
//                msgContent = patient.getName() + "血压异常(舒张压 " + value2 + "mmHg、收缩压 " + value1 + "mmHg)";
                if(checkHealthIndexDetail(NumberUtils.toDouble(value1), maxValueSSY, minValueSSY)==1||checkHealthIndexDetail(NumberUtils.toDouble(value2), maxValueSZY, minValueSZY)==1){
                    msgContent = "<a>"+patient.getName()+"</a><span style=\"color: #FF4C4C;\">血压偏高</span>";
                }else if(checkHealthIndexDetail(NumberUtils.toDouble(value1), maxValueSSY, minValueSSY)==2||checkHealthIndexDetail(NumberUtils.toDouble(value2), maxValueSZY, minValueSZY)==2){
                    msgContent = "<a>"+patient.getName()+"</a><span style=\"color: #FF4C4C;\">血压偏低</span>";
                }
                updateStatus(data);
                updateStatus(data);
            }
            }
        }
        }

+ 40 - 10
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/health/bank/CreditLogService.java

@ -4,10 +4,12 @@ package com.yihu.wlyy.service.app.health.bank;/**
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.JSONObject;
import com.yihu.wlyy.entity.device.PatientDevice;
import com.yihu.wlyy.entity.patient.Patient;
import com.yihu.wlyy.entity.patient.Patient;
import com.yihu.wlyy.entity.patient.SignFamily;
import com.yihu.wlyy.entity.patient.SignFamily;
import com.yihu.wlyy.repository.dict.SystemDictDao;
import com.yihu.wlyy.repository.dict.SystemDictDao;
import com.yihu.wlyy.repository.patient.PatientDao;
import com.yihu.wlyy.repository.patient.PatientDao;
import com.yihu.wlyy.repository.patient.PatientDeviceDao;
import com.yihu.wlyy.repository.patient.SignFamilyDao;
import com.yihu.wlyy.repository.patient.SignFamilyDao;
import com.yihu.wlyy.service.app.device.PatientDeviceService;
import com.yihu.wlyy.service.app.device.PatientDeviceService;
import com.yihu.wlyy.util.HttpClientUtil;
import com.yihu.wlyy.util.HttpClientUtil;
@ -52,6 +54,8 @@ public class CreditLogService {
    @Autowired
    @Autowired
    private SystemDictDao systemDictDao;
    private SystemDictDao systemDictDao;
    @Autowired
    private PatientDeviceDao patientDeviceDao;
    @Autowired
    @Autowired
    private SignFamilyDao signFamilyDao;
    private SignFamilyDao signFamilyDao;
@ -87,7 +91,7 @@ public class CreditLogService {
        if (name == null || name == ""){
        if (name == null || name == ""){
            sql  = "SELECT * FROM wlyy_sign_family WHERE status = 1 AND ( doctor = '" +doctorId + "' OR doctor_health = '" + doctorId +"')";
            sql  = "SELECT * FROM wlyy_sign_family WHERE status = 1 AND ( doctor = '" +doctorId + "' OR doctor_health = '" + doctorId +"')";
        } else if (name != null) {
        } else if (name != null) {
            sql  = "SELECT * FROM wlyy_sign_family WHERE status = 1 AND ( doctor = '" +doctorId + "' OR doctor_health = '" + doctorId +"') AND name = '"+name+"'";
            sql  = "SELECT * FROM wlyy_sign_family WHERE status = 1 AND ( doctor = '" +doctorId + "' OR doctor_health = '" + doctorId +"') AND name LIKE '%"+name+"%'";
        }
        }
        List<SignFamily> signFamilyList = jdbcTemplate.query(sql,new BeanPropertyRowMapper(SignFamily.class));
        List<SignFamily> signFamilyList = jdbcTemplate.query(sql,new BeanPropertyRowMapper(SignFamily.class));
        List<String>  patientIds = new ArrayList<>();
        List<String>  patientIds = new ArrayList<>();
@ -255,7 +259,7 @@ public class CreditLogService {
     * @return
     * @return
     */
     */
    public JSONObject selectByAccount(JSONObject object,Integer page,Integer size){
    public JSONObject selectByAccount(JSONObject object,Integer page,Integer size){
        String signSql = "SELECT * FROM wlyy_sign_family WHERE status = 1 AND patient = '"+object.getString("patientId") +"'";
        String signSql = "SELECT * FROM wlyy_sign_family WHERE status = 1 AND patient = '"+object.getString("patientId") +"' AND status = 1";
        List<SignFamily> signFamilyList1 = jdbcTemplate.query(signSql,new BeanPropertyRowMapper(SignFamily.class));
        List<SignFamily> signFamilyList1 = jdbcTemplate.query(signSql,new BeanPropertyRowMapper(SignFamily.class));
        String sql = "SELECT * FROM wlyy_sign_family WHERE status = 1 AND ( doctor = '" +signFamilyList1.get(0).getDoctor() + "' OR doctor_health = '" + signFamilyList1.get(0).getDoctor() +"')";
        String sql = "SELECT * FROM wlyy_sign_family WHERE status = 1 AND ( doctor = '" +signFamilyList1.get(0).getDoctor() + "' OR doctor_health = '" + signFamilyList1.get(0).getDoctor() +"')";
        List<SignFamily> signFamilyList = jdbcTemplate.query(sql,new BeanPropertyRowMapper(SignFamily.class));
        List<SignFamily> signFamilyList = jdbcTemplate.query(sql,new BeanPropertyRowMapper(SignFamily.class));
@ -299,11 +303,12 @@ public class CreditLogService {
     * @param size
     * @param size
     * @return
     * @return
     */
     */
    public JSONObject selectByActivityRanking1(String activityId,Integer page,Integer size){
    public JSONObject selectByActivityRanking1(String activityId,String patientId,Integer page,Integer size){
        String response = null;
        String response = null;
        String url =getBaseUrl() + "selectByActivityRanking1";
        String url =getBaseUrl() + "selectByActivityRanking1";
        Map<String,String> params = new HashMap<>();
        Map<String,String> params = new HashMap<>();
        params.put("activityId",activityId);
        params.put("activityId",activityId);
        params.put("patientId",patientId);
        params.put("page",page.toString());
        params.put("page",page.toString());
        params.put("size",size.toString());
        params.put("size",size.toString());
        JSONObject object1 = null;
        JSONObject object1 = null;
@ -313,8 +318,8 @@ public class CreditLogService {
            JSONArray array = object1.getJSONArray("detailModelList");
            JSONArray array = object1.getJSONArray("detailModelList");
            for (int i = 0;array != null && i<array.size();i++){
            for (int i = 0;array != null && i<array.size();i++){
                JSONObject object2 = array.getJSONObject(i);
                JSONObject object2 = array.getJSONObject(i);
                String patientId = object2.getString("patientId");
                Patient patient = patientDao.findByCode(patientId);
                String patientId1 = object2.getString("patientId");
                Patient patient = patientDao.findByCode(patientId1);
                object2.put("patient",patient);
                object2.put("patient",patient);
            }
            }
        }catch (Exception e){
        }catch (Exception e){
@ -403,14 +408,14 @@ public class CreditLogService {
        if (name == null || name ==""){
        if (name == null || name ==""){
            sql  = "SELECT * FROM wlyy_sign_family WHERE status = 1 AND ( doctor = '" +doctorId + "' OR doctor_health = '" + doctorId +"')";
            sql  = "SELECT * FROM wlyy_sign_family WHERE status = 1 AND ( doctor = '" +doctorId + "' OR doctor_health = '" + doctorId +"')";
        } else if (name != null) {
        } else if (name != null) {
            sql  = "SELECT * FROM wlyy_sign_family WHERE status = 1 AND ( doctor = '" +doctorId + "' OR doctor_health = '" + doctorId +"') AND name = '"+name+"'";
            sql  = "SELECT * FROM wlyy_sign_family WHERE status = 1 AND ( doctor = '" +doctorId + "' OR doctor_health = '" + doctorId +"') AND name LIKE '%"+name+"%'";
        }
        }
        List<SignFamily> signFamilyList = jdbcTemplate.query(sql,new BeanPropertyRowMapper(SignFamily.class));
        List<SignFamily> signFamilyList = jdbcTemplate.query(sql,new BeanPropertyRowMapper(SignFamily.class));
        List<String>  patientOpenIds = new ArrayList<>();
        List<String>  patientOpenIds = new ArrayList<>();
        if (signFamilyList != null && signFamilyList.size() != 0){
        if (signFamilyList != null && signFamilyList.size() != 0){
            for (SignFamily signFamily:signFamilyList){
            for (SignFamily signFamily:signFamilyList){
                patientOpenIds.add(signFamily.getOpenid());
                patientOpenIds.add(signFamily.getPatient());
            }
            }
        }
        }
        JSONObject object = new JSONObject();
        JSONObject object = new JSONObject();
@ -458,13 +463,38 @@ public class CreditLogService {
                patientIds.add(signFamily.getPatient());
                patientIds.add(signFamily.getPatient());
            }
            }
        }
        }
        int deviceType = object.getInteger("deviceType");//设备类型 1血糖仪,2血压仪
        int bindStatus = object.getInteger("bindStatus");//绑定状态  0:绑定,1:未绑定
        List<String> ids = new ArrayList<>();
        for (int i=0;i<patientIds.size();i++){
            if (bindStatus == 0){
                String sql1 = "select * from wlyy_patient_device where user = '"+patientIds.get(i)+"' AND category_code = "+deviceType+" AND del = " + bindStatus;
                List<PatientDevice> patientDevices = jdbcTemplate.query(sql1,new BeanPropertyRowMapper(PatientDevice.class));
                if (patientDevices != null && patientDevices.size() != 0){
                    ids.add(patientDevices.get(0).getUser());
                }
            }else if (bindStatus == 1){
                String sql1 = "select * from wlyy_patient_device where user = '"+patientIds.get(i)+"' AND category_code = "+deviceType+" AND del = " + bindStatus;
                List<PatientDevice> patientDevices = jdbcTemplate.query(sql1,new BeanPropertyRowMapper(PatientDevice.class));
                if (patientDevices == null || patientDevices.size() ==0){
                    ids.add(patientIds.get(i));
                }
            }
        }
        JSONArray patientList = new JSONArray();
        for (int i =0 ;i<ids.size();i++){
            Patient patient = patientDao.findByCode(ids.get(i));
            JSONObject jsonObject = (JSONObject) JSONObject.toJSON(patient);
            patientList.add(jsonObject);
        }
        JSONObject object1 = new JSONObject();
        JSONObject object1 = new JSONObject();
        JSONArray array = object.getJSONArray("deviceTypes");
        object1.put("patientIds",patientIds.toArray());
        object1.put("patients",patientList);
        object1.put("bindStatus",object.getInteger("bindStatus"));
        object1.put("bindStatus",object.getInteger("bindStatus"));
        object1.put("deviceTypes",array);
        object1.put("deviceType",deviceType);
        object1.put("ruleId",object.get("ruleId"));
        object1.put("page",page);
        object1.put("page",page);
        object1.put("size",size);
        object1.put("size",size);
        String response = null;
        String response = null;
        String url =getBaseUrl() + "findAccounByCondition";
        String url =getBaseUrl() + "findAccounByCondition";
        JSONObject object2 = null;
        JSONObject object2 = null;

+ 26 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/health/bank/TaskService.java

@ -125,7 +125,7 @@ public class TaskService {
    public JSONObject attendTask(JSONObject object) throws Exception {
    public JSONObject attendTask(JSONObject object) throws Exception {
        String response = null;
        String response = null;
        Patient patient = patientDao.findByCode(object.getString("patientId"));
        Patient patient = patientDao.findByCode(object.getString("patientId"));
        String unionId = "1";
        String unionId = object.getString("unionId");
        Patient patient1 = patientDao.findByUnionid(unionId);
        Patient patient1 = patientDao.findByUnionid(unionId);
        if (patient1 != null){
        if (patient1 != null){
            throw new Exception("该居民已报过名!");
            throw new Exception("该居民已报过名!");
@ -134,6 +134,7 @@ public class TaskService {
        patientDao.save(patient);
        patientDao.save(patient);
        object.put("unionId",unionId);
        object.put("unionId",unionId);
        object.put("patientIdcard",patient.getIdcard());
        object.put("patientIdcard",patient.getIdcard());
        object.put("patientOpenid",patient.getOpenid());
        String url =getBaseUrl() + "attendTask";
        String url =getBaseUrl() + "attendTask";
        Map<String,String> params = new HashMap<>();
        Map<String,String> params = new HashMap<>();
        params.put("taskPatientDetail",object.toJSONString());
        params.put("taskPatientDetail",object.toJSONString());
@ -177,4 +178,28 @@ public class TaskService {
        }
        }
        return object;
        return object;
    }
    }
    /**
     * 创建记录
     *
     * @param object{"patientId":"","taskCode":"","originalStatus","currentStatus":""}
     * @return
     * @throws Exception
     */
    public JSONObject createActiveRecord(JSONObject object) throws Exception {
        String response = null;
        Patient patient = patientDao.findByCode(object.getString("patientId"));
        object.put("unionId",patient.getUnionid());
        object.put("patientIdcard",patient.getIdcard());
        object.put("patientOpenid",patient.getOpenid());
        String url =getBaseUrl() + "createActiveRecord";
        try {
            response = httpClientUtil.iotPostBody(url,object.toString());
        }catch (Exception e){
            e.printStackTrace();
            logger.error(e.getMessage());
        }
        return JSONObject.parseObject(response);
    }
}
}

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/message/MessageService.java

@ -365,7 +365,7 @@ public class MessageService extends BaseService {
     */
     */
    public Map<String,List<Map<String, Object>>> getHealthIndexMessage(String doctor) throws Exception {
    public Map<String,List<Map<String, Object>>> getHealthIndexMessage(String doctor) throws Exception {
        String sql = "select a.sender,a.tz_type,count(1) count,max(date_format(a.create_time,'%Y-%m-%d %H:%i:%s')) last_time,a.has_read from wlyy_Message a where a.receiver='" + doctor + "' and a.type='2' group by a.sender,a.tz_type,a.has_read order by last_time desc";
        String sql = "select a.sender,a.tz_type,count(1) count,max(date_format(a.create_time,'%Y-%m-%d %H:%i:%s')) last_time,a.has_read from wlyy_Message a where a.receiver='" + doctor + "' and a.type='2' and a.over='1' group by a.sender,a.tz_type,a.has_read order by last_time desc";
        List<Map<String, Object>> list = jdbcTemplate.queryForList(sql);
        List<Map<String, Object>> list = jdbcTemplate.queryForList(sql);
        Map<String,Map<String, Object>> map = new HashMap<>();
        Map<String,Map<String, Object>> map = new HashMap<>();

+ 6 - 5
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/specialist/SpecialistService.java

@ -93,14 +93,15 @@ public class SpecialistService extends BaseService {
        List<Map<String,Object>> list = findHealthAssistant(doctor);
        List<Map<String,Object>> list = findHealthAssistant(doctor);
        if(list!=null&&list.size()>0){
        if(list!=null&&list.size()>0){
            for(Map<String,Object> map:list){
            for(Map<String,Object> map:list){
                map.put("count",getAssistantPatientCount(map.get("code").toString()));
                map.put("count",getAssistantPatientCount(doctor,map.get("code").toString()));
            }
            }
        }
        }
        return list;
        return list;
    }
    }
    public Long getAssistantPatientCount(String doctor)throws Exception{
    public Long getAssistantPatientCount(String doctor,String assistant)throws Exception{
        Map<String,Object> param = new HashedMap();
        Map<String,Object> param = new HashedMap();
        param.put("doctor",doctor);
        param.put("doctor",doctor);
        param.put("assistant",assistant);
        HttpResponse response = HttpUtils.doGet(specialistUrl+"svr-specialist/getAssistantPatientCount",param);
        HttpResponse response = HttpUtils.doGet(specialistUrl+"svr-specialist/getAssistantPatientCount",param);
        JSONObject  rs = new JSONObject(response.getContent());
        JSONObject  rs = new JSONObject(response.getContent());
        if("succes".equals(rs.getString("message"))){
        if("succes".equals(rs.getString("message"))){
@ -200,8 +201,9 @@ public class SpecialistService extends BaseService {
        return null;
        return null;
    }
    }
    public JSONArray findPatientRelatioByAssistant(String assistant,Integer page,Integer size)throws Exception{
    public JSONArray findPatientRelatioByAssistant(String doctor,String assistant,Integer page,Integer size)throws Exception{
        Map<String,Object> param = new HashedMap();
        Map<String,Object> param = new HashedMap();
        param.put("doctor",doctor);
        param.put("assistant",assistant);
        param.put("assistant",assistant);
        param.put("page",page);
        param.put("page",page);
        param.put("size",size);
        param.put("size",size);
@ -295,8 +297,7 @@ public class SpecialistService extends BaseService {
                "   wlyy_doctor dd " +
                "   wlyy_doctor dd " +
                "  WHERE " +
                "  WHERE " +
                "   dd. CODE = '"+doctor+"' " +
                "   dd. CODE = '"+doctor+"' " +
                " ) " +
                " AND d.`level` = 4 ";
                " ) " ;
        if(StringUtils.isNotBlank(name)){
        if(StringUtils.isNotBlank(name)){
            sql = sql +" AND d.`name` LIKE '%"+name+"%'";
            sql = sql +" AND d.`name` LIKE '%"+name+"%'";
        }
        }

+ 2 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/template/DoctorTeamGuidanceService.java

@ -470,7 +470,7 @@ public class DoctorTeamGuidanceService extends BaseService {
     * @param images
     * @param images
     * @throws Exception
     * @throws Exception
     */
     */
    public void sendTeamGuidance(String accessToken, String dc, String patient, String content, String guidanceCode, String images, int teamId) throws Exception {
    public void sendTeamGuidance(String accessToken, String dc, String patient, String content, String guidanceCode, String images, int teamId,String tzCode) throws Exception {
        String image = "";
        String image = "";
        if (StringUtils.isNotEmpty(images)) {
        if (StringUtils.isNotEmpty(images)) {
            image = validateImages(images);
            image = validateImages(images);
@ -484,7 +484,7 @@ public class DoctorTeamGuidanceService extends BaseService {
        guidance.setImages(image);
        guidance.setImages(image);
        // 保存
        // 保存
        if (patientHealthGuidanceService.add(guidance, accessToken,null) != null) {
        if (patientHealthGuidanceService.add(guidance, accessToken,tzCode) != null) {
            String sendImgs = "";
            String sendImgs = "";
            if (StringUtils.isNotBlank(image)) {
            if (StringUtils.isNotBlank(image)) {
                sendImgs = image;
                sendImgs = image;

+ 7 - 4
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/weixin/applets/AppletsService.java

@ -52,6 +52,7 @@ public class AppletsService extends BaseService {
        Map<String, Object> res = new HashedMap();
        Map<String, Object> res = new HashedMap();
        res.put("openid", rs.getString("openid"));
        res.put("openid", rs.getString("openid"));
        res.put("sessionKey", rs.getString("session_key"));
        res.put("sessionKey", rs.getString("session_key"));
        res.put("unionid", rs.getString("unionid"));
        return res;
        return res;
    }
    }
@ -131,16 +132,18 @@ public class AppletsService extends BaseService {
            patientAimSports.setPatientcode(patient);
            patientAimSports.setPatientcode(patient);
            patientAimSportsDao.save(patientAimSports);
            patientAimSportsDao.save(patientAimSports);
        }
        }
        return true;
        return true;
    }
    }
    public Map<String,Object> getPatientByUid(String unionid){
    public Map<String,Object> getPatientByUid(String unionid){
        Patient patient = patientDao.findByUnionid(unionid);
        Patient patient = patientDao.findByUnionid(unionid);
        Map<String,Object> map = new HashedMap();
        Map<String,Object> map = new HashedMap();
        map.put("patient",patient.getCode());
        map.put("patientName",patient.getName());
        map.put("photo",patient.getPhoto());
        if(patient!=null){
            map.put("patient",patient.getCode());
            map.put("patientName",patient.getName());
            map.put("photo",patient.getPhoto());
        }
        return map;
        return map;
    }
    }

+ 22 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/WeixinBaseController.java

@ -71,6 +71,28 @@ public class WeixinBaseController extends BaseController {
		return null;
		return null;
	}
	}
	/**
	 * 通过openid获取Unionid
	 * @return
	 */
	public String getUnionidByOpenid(String openid) {
		try {
			String token_url = "https://api.weixin.qq.com/cgi-bin/user/info";
			String params = "access_token=" + getAccessToken() + "&openid=" +openid+ "&lang=zh_CN";
			String result = HttpUtil.sendGet(token_url, params);
			System.out.println("getUnionidByOpenid:"+result);
			JSONObject json = new JSONObject(result);
			if (json.has("unionid")) {
				return json.get("unionid").toString();
			} else {
				return null;
			}
		} catch (Exception e) {
			error(e);
		}
		return null;
	}
	/**
	/**
	 * 通过code获取判断openid
	 * 通过code获取判断openid
	 * 
	 * 

+ 22 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/account/WechatController.java

@ -682,5 +682,27 @@ public class WechatController extends WeixinBaseController {
        }
        }
    }
    }
    /**
     * 获取微信unionid
     *
     * @param openid
     * @return
     */
    @RequestMapping(value = "getUnionidByOpenid", method = {RequestMethod.POST, RequestMethod.GET})
    @ResponseBody
    public String getUnionidByOpenid(String openid) {
        try {
            String unionid = super.getUnionidByOpenid(openid);
            if (!StringUtils.isEmpty(unionid)) {
                return write(200, "获取unionid成功!", "unionid", unionid);
            } else {
                return error(-1, "获取unionid失败!");
            }
        } catch (Exception e) {
            error(e);
            return error(-1, "获取unionid失败!");
        }
    }
}
}

+ 4 - 7
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/device/DoctorDeviceController.java

@ -459,18 +459,15 @@ public class DoctorDeviceController extends BaseController {
	@RequestMapping(value = "/getDevicesList",method = RequestMethod.GET)
	@RequestMapping(value = "/getDevicesList",method = RequestMethod.GET)
	@ResponseBody
	@ResponseBody
	@ApiOperation(value = "医生端-设备管理中设备列表",notes = "设备列表")
	@ApiOperation(value = "医生端-设备管理中设备列表",notes = "设备列表")
	public String getDevicesList(@ApiParam(value = "未测量天数(1今日为测量 2七天未测量 3本月未测量 4超过一个月未测量)", name = "noGaugeDay") @RequestParam(value = "noGaugeDay",required = true)String noGaugeDay,
								 @ApiParam(value = "是否绑定(1绑定 2解绑)", name = "isBinding") @RequestParam(value = "isBinding",required = true)String isBinding,
								 @ApiParam(value = "设备类型(1血糖仪 2血压计)", name = "categoryCode") @RequestParam(value = "categoryCode",required = true)String categoryCode,
								 @ApiParam(value = "今日是否发送消息(1未发送 2已发送)", name = "isSend") @RequestParam(value = "isSend",required = true)String isSend,
	public String getDevicesList(@ApiParam(value = "未测量天数(1今日为测量 2七天未测量 3本月未测量 4超过一个月未测量)", name = "noGaugeDay") @RequestParam(value = "noGaugeDay",required = false)String noGaugeDay,
								 @ApiParam(value = "是否绑定(1绑定 2解绑)", name = "isBinding") @RequestParam(value = "isBinding",required = false)String isBinding,
								 @ApiParam(value = "设备类型(1血糖仪 2血压计)", name = "categoryCode") @RequestParam(value = "categoryCode",required = false)String categoryCode,
								 @ApiParam(value = "今日是否发送消息(1未发送 2已发送)", name = "isSend") @RequestParam(value = "isSend",required = false)String isSend,
								 @ApiParam(name="page",value="第几页",defaultValue = "1") @RequestParam(value="page",required = true) String page,
								 @ApiParam(name="page",value="第几页",defaultValue = "1") @RequestParam(value="page",required = true) String page,
								 @ApiParam(name="pageSize",value="",defaultValue = "10") @RequestParam(value="pageSize",required = true) String pageSize) {
								 @ApiParam(name="pageSize",value="",defaultValue = "10") @RequestParam(value="pageSize",required = true) String pageSize) {
		if (StringUtils.isBlank(pageSize)) {
		if (StringUtils.isBlank(pageSize)) {
			pageSize = "10";
			pageSize = "10";
		}
		}
		if (page.equals("0")) {
			page = "1";
		}
		try {
		try {
			return  write(200,"查找成功!","data",patientDeviceLogService.getDevicesList(getUID(),noGaugeDay,isBinding,categoryCode,isSend,Integer.valueOf(page),Integer.valueOf(pageSize)));
			return  write(200,"查找成功!","data",patientDeviceLogService.getDevicesList(getUID(),noGaugeDay,isBinding,categoryCode,isSend,Integer.valueOf(page),Integer.valueOf(pageSize)));
		} catch (Exception e) {
		} catch (Exception e) {

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/health/bank/ActivityController.java

@ -226,7 +226,7 @@ public class ActivityController extends BaseController {
     * @return
     * @return
     */
     */
    @RequestMapping(value = "/findAccount",method = RequestMethod.POST)
    @RequestMapping(value = "/findAccount",method = RequestMethod.POST)
    @ApiOperation("银行账户信息")
    @ApiOperation("用户账户信息")
    public String selectByAccount(@ApiParam(name = "account",value = "任务JSON")
    public String selectByAccount(@ApiParam(name = "account",value = "任务JSON")
                                  @RequestParam(name = "account") String account,
                                  @RequestParam(name = "account") String account,
                                  @ApiParam(name = "page", value = "第几页,从1开始")
                                  @ApiParam(name = "page", value = "第几页,从1开始")

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/patient/PatientInfoController.java

@ -523,7 +523,7 @@ public class PatientInfoController extends BaseController {
     * @param deviceSn
     * @param deviceSn
     * @param page
     * @param page
     * @param pageSize
     * @param pageSize
     * @return
     * @return ..
     */
     */
    /*@RequestMapping(value = "/getPatientSignByNameOrIdCard",method = RequestMethod.GET)
    /*@RequestMapping(value = "/getPatientSignByNameOrIdCard",method = RequestMethod.GET)
    @ResponseBody
    @ResponseBody

+ 3 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/specialist/SpecialistController.java

@ -110,11 +110,12 @@ public class SpecialistController extends BaseController {
    @RequestMapping(value = "findPatientRelatioByAssistant", method = RequestMethod.GET)
    @RequestMapping(value = "findPatientRelatioByAssistant", method = RequestMethod.GET)
    @ApiOperation("获取计管师下未分配标签居民")
    @ApiOperation("获取计管师下未分配标签居民")
    public String findPatientRelatioByAssistant(@ApiParam(name = "assistant", value = "计管师") @RequestParam(required = true) String assistant,
    public String findPatientRelatioByAssistant(@ApiParam(name = "doctor", value = "医生") @RequestParam(required = true)String doctor,
                                                @ApiParam(name = "assistant", value = "计管师") @RequestParam(required = true) String assistant,
                                                @ApiParam(name = "page", value = "第几页,1开始") @RequestParam(required = true) Integer page,
                                                @ApiParam(name = "page", value = "第几页,1开始") @RequestParam(required = true) Integer page,
                                                @ApiParam(name = "size", value = "每页大小") @RequestParam(required = true) Integer size) throws Exception {
                                                @ApiParam(name = "size", value = "每页大小") @RequestParam(required = true) Integer size) throws Exception {
        try {
        try {
            return write(200, "获取成功", "data", specialistService.findPatientRelatioByAssistant(assistant, page, size));
            return write(200, "获取成功", "data", specialistService.findPatientRelatioByAssistant(doctor,assistant, page, size));
        } catch (Exception e) {
        } catch (Exception e) {
            error(e);
            error(e);
            return error(-1, "请求失败");
            return error(-1, "请求失败");

+ 4 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/template/DoctorTeamGuidanceController.java

@ -258,7 +258,9 @@ public class DoctorTeamGuidanceController extends WeixinBaseController {
            @ApiParam(value = "团队模板code")
            @ApiParam(value = "团队模板code")
            @RequestParam String guidanceCode,
            @RequestParam String guidanceCode,
            @ApiParam(value = "团队模板图片")
            @ApiParam(value = "团队模板图片")
            @RequestParam(required = false) String images) {
            @RequestParam(required = false) String images,
            @ApiParam(value = "异常指标数据的ids,多条用逗号分割")
            @RequestParam(required = false) String tzCode) {
        try {
        try {
            String accessToken = getAccessToken();
            String accessToken = getAccessToken();
            String doctor = getUID();
            String doctor = getUID();
@ -266,7 +268,7 @@ public class DoctorTeamGuidanceController extends WeixinBaseController {
            for (Object team : teams) {
            for (Object team : teams) {
                JSONObject teamJson = new JSONObject(team.toString());
                JSONObject teamJson = new JSONObject(team.toString());
                int teamCode = teamJson.getInt("teamId");
                int teamCode = teamJson.getInt("teamId");
                doctorTeamGuidanceService.sendTeamGuidance(accessToken, doctor, patient, content, guidanceCode, images,teamCode);
                doctorTeamGuidanceService.sendTeamGuidance(accessToken, doctor, patient, content, guidanceCode, images,teamCode,tzCode);
            }
            }
            return write(200, "发送成功!");
            return write(200, "发送成功!");
        } catch (Exception e) {
        } catch (Exception e) {

+ 3 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/health/bank/CreditsLogController.java

@ -235,13 +235,15 @@ public class CreditsLogController extends BaseController {
    @ApiOperation("获取活动所有排名")
    @ApiOperation("获取活动所有排名")
    public String selectByActivityRanking1(@ApiParam(name = "activityId",value = "活动id")
    public String selectByActivityRanking1(@ApiParam(name = "activityId",value = "活动id")
                                  @RequestParam(name = "activityId") String activityId,
                                  @RequestParam(name = "activityId") String activityId,
                                   @ApiParam(name = "patientId",value = "居民id")
                                   @RequestParam(value = "patientId",required = true)String patientId,
                                  @ApiParam(name = "page", value = "第几页,从1开始")
                                  @ApiParam(name = "page", value = "第几页,从1开始")
                                  @RequestParam(value = "page", defaultValue = "1",required = false)Integer page,
                                  @RequestParam(value = "page", defaultValue = "1",required = false)Integer page,
                                  @ApiParam(name = "size",defaultValue = "10",value = ",每页分页大小")
                                  @ApiParam(name = "size",defaultValue = "10",value = ",每页分页大小")
                                  @RequestParam(value = "size", required = false)Integer size){
                                  @RequestParam(value = "size", required = false)Integer size){
        try {
        try {
            return write(200,"查询成功","data",service.selectByActivityRanking1(activityId,page,size));
            return write(200,"查询成功","data",service.selectByActivityRanking1(activityId,patientId,page,size));
        }catch (Exception e){
        }catch (Exception e){
            error(e);
            error(e);
            return error(-1,e.getMessage());
            return error(-1,e.getMessage());

+ 0 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/health/bank/TaskController.java

@ -95,7 +95,6 @@ public class TaskController extends BaseController{
                             @RequestParam(name = "taskPatientDetail")String taskPatientDetail){
                             @RequestParam(name = "taskPatientDetail")String taskPatientDetail){
        try {
        try {
            JSONObject object = JSONObject.parseObject(taskPatientDetail);
            JSONObject object = JSONObject.parseObject(taskPatientDetail);
            object.put("patientOpenid",getOpenid());
            return write(200,"报名成功","data",service.attendTask(object));
            return write(200,"报名成功","data",service.attendTask(object));
        }catch (Exception e){
        }catch (Exception e){
            error(e);
            error(e);

+ 25 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/health/bank/AccountController.java

@ -5,6 +5,7 @@ package com.yihu.wlyy.web.third.health.bank;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.JSONObject;
import com.yihu.wlyy.service.app.health.bank.CreditLogService;
import com.yihu.wlyy.service.app.health.bank.CreditLogService;
import com.yihu.wlyy.service.app.health.bank.TaskService;
import com.yihu.wlyy.web.BaseController;
import com.yihu.wlyy.web.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiOperation;
@ -31,6 +32,8 @@ public class AccountController extends BaseController {
    @Autowired
    @Autowired
    private CreditLogService service;
    private CreditLogService service;
    @Autowired
    private TaskService taskService;
@ -66,13 +69,15 @@ public class AccountController extends BaseController {
    @ApiOperation("获取活动所有排名")
    @ApiOperation("获取活动所有排名")
    public String selectByActivityRanking1(@ApiParam(name = "activityId",value = "活动id")
    public String selectByActivityRanking1(@ApiParam(name = "activityId",value = "活动id")
                                  @RequestParam(name = "activityId") String activityId,
                                  @RequestParam(name = "activityId") String activityId,
                                   @ApiParam(name = "patientId",value = "居民id")
                                   @RequestParam(value = "patientId",required = true)String patientId,
                                  @ApiParam(name = "page", value = "第几页,从1开始")
                                  @ApiParam(name = "page", value = "第几页,从1开始")
                                  @RequestParam(value = "page", defaultValue = "1",required = false)Integer page,
                                  @RequestParam(value = "page", defaultValue = "1",required = false)Integer page,
                                  @ApiParam(name = "size",defaultValue = "10",value = ",每页分页大小")
                                  @ApiParam(name = "size",defaultValue = "10",value = ",每页分页大小")
                                  @RequestParam(value = "size", required = false)Integer size){
                                  @RequestParam(value = "size", required = false)Integer size){
        try {
        try {
            return write(200,"查询成功","data",service.selectByActivityRanking1(activityId,page,size));
            return write(200,"查询成功","data",service.selectByActivityRanking1(activityId,patientId,page,size));
        }catch (Exception e){
        }catch (Exception e){
            error(e);
            error(e);
            return error(-1,e.getMessage());
            return error(-1,e.getMessage());
@ -100,4 +105,23 @@ public class AccountController extends BaseController {
    }
    }
    /**
     *  添加历史记录
     *
     * @param activeRecord {"patientId":"","taskCode":"","originalStatus","currentStatus":""}
     * @return
     */
    @RequestMapping(value = "/createActiveRecord",method = RequestMethod.POST)
    @ApiOperation("添加记录")
    public String createActiveRecord(@ApiParam(name = "activeRecord",value = "对象JSON")
                                   @RequestParam(name = "activeRecord") String activeRecord){
        try {
            JSONObject object = JSONObject.parseObject(activeRecord);
            JSONObject result = taskService.createActiveRecord(object);
            return write(200,"获取成功","data",result);
        }catch (Exception e){
            error(e);
            return error(-1,e.getMessage());
        }
    }
}
}

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/wechat/util/WeiXinOpenIdUtils.java

@ -116,7 +116,7 @@ public class WeiXinOpenIdUtils {
                String memberCode = (String) member.get("family_member");
                String memberCode = (String) member.get("family_member");
                if (StringUtils.isNotBlank(memberCode)) {
                if (StringUtils.isNotBlank(memberCode)) {
                    Patient p = patientDao.findByCode(memberCode);
                    Patient p = patientDao.findByCode(memberCode);
                    if (StringUtils.isNotBlank(p.getOpenid())&&!p.getOpenid().equals(openid)) {
                    if (p!=null&&StringUtils.isNotBlank(p.getOpenid())&&!p.getOpenid().equals(openid)) {
                        if(!map.containsKey(p.getOpenid())){
                        if(!map.containsKey(p.getOpenid())){
                            map.put(p.getOpenid(),p.getOpenid());
                            map.put(p.getOpenid(),p.getOpenid());
                            JSONObject json = new JSONObject();
                            JSONObject json = new JSONObject();