Просмотр исходного кода

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

trick9191 7 лет назад
Родитель
Сommit
98a13e829c
26 измененных файлов с 1751 добавлено и 164 удалено
  1. 9 0
      common/common-entity/src/main/java/com/yihu/wlyy/entity/login/LoginLog.java
  2. 11 4
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/controller/manager/datastatic/PrescriptionStaticController.java
  3. 246 0
      patient-co-manage/wlyy-manage/src/main/webapp/WEB-INF/views/prescription/prescription_info.jsp
  4. 163 0
      patient-co-manage/wlyy-manage/src/main/webapp/WEB-INF/views/prescription/prescription_info_js.jsp
  5. 27 8
      patient-co-manage/wlyy-manage/src/main/webapp/WEB-INF/views/prescription/prescription_list_js.jsp
  6. 221 0
      patient-co-manage/wlyy-manage/src/main/webapp/WEB-INF/views/prescription/prescription_order.jsp
  7. 163 0
      patient-co-manage/wlyy-manage/src/main/webapp/WEB-INF/views/prescription/prescription_order_js.jsp
  8. 18 10
      patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/service/app/charge/OnePayService.java
  9. 105 1
      patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/service/app/prenatalInspector/PrenatalInspectorPreCardService.java
  10. 308 0
      patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/service/third/jw/JwMaternalChildService.java
  11. 17 0
      patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/util/DateUtil.java
  12. 1 1
      patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/web/quota/JobController.java
  13. 108 2
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prenatalInspector/PrenatalInspectorPreCardService.java
  14. 1 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prescription/PrescriptionService.java
  15. 139 51
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/statistics/StatisticsService.java
  16. 106 58
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/statisticsES/StatisticsESService.java
  17. 24 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/team/AdminTeamService.java
  18. 16 10
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/common/QrcodeService.java
  19. 1 4
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/weixin/wxpay/service/OnePayService.java
  20. 1 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/account/LoginController.java
  21. 46 6
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/jimeiJkEdu/DoctorJMJkEduArticleController.java
  22. 1 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/prenatalInspector/PrenatalController.java
  23. 11 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/team/AdminTeamController.java
  24. 2 2
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/statistic/EsStatisticsController.java
  25. 5 2
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/jkEduArticle/ThirdJkEduArticleController.java
  26. 1 3
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/ylzpay/ThirdQrcodeController.java

+ 9 - 0
common/common-entity/src/main/java/com/yihu/wlyy/entity/login/LoginLog.java

@ -18,6 +18,7 @@ public class LoginLog  extends IdEntity {
    private String userType;//1 患者 2医生
    private Long tokenId;//登录的tokenid
    private String type;//登录成功1 成功 2失败
    private Integer platform;//1患者端,2医生端app,3微信公众号wechat,4 IM医生端pc, PC端取药系统,5医生助手公众号
    private Date createTime;//创建时间
    private String errorMessage;//错误信息
    private String phone;//电话号码
@ -94,4 +95,12 @@ public class LoginLog  extends IdEntity {
    public void setAppVersion(String appVersion) {
        this.appVersion = appVersion;
    }
    public Integer getPlatform() {
        return platform;
    }
    public void setPlatform(Integer platform) {
        this.platform = platform;
    }
}

+ 11 - 4
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/controller/manager/datastatic/PrescriptionStaticController.java

@ -7,10 +7,7 @@ import jxl.Workbook;
import jxl.write.*;
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;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
@ -35,6 +32,16 @@ public class PrescriptionStaticController extends BaseController {
		return "prescription/prescription_list";
	}
	
	@RequestMapping(value = "infoInit/{code}",method = RequestMethod.GET)
	public String infoInit(@PathVariable(value = "code") String code){
		return "prescription/prescription_info";
	}
	
	@RequestMapping(value = "orderInit/{code}",method = RequestMethod.GET)
	public String orderInit(@PathVariable(value = "code") String code){
		return "prescription/prescription_order";
	}
	
	@RequestMapping(value = "list")
	@ResponseBody
	public String searchPatientList(

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

@ -0,0 +1,246 @@
<%@ page contentType="text/html; charset=UTF-8" language="java" pageEncoding="UTF-8" %>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <%@ include file="../head/page_head.jsp"%>
    <title>续方详情</title>
</head>
<style>
    .m-form-group label.label_title {
        width: 100px
    }
    .fd-label{
        font-size: 12px;
        font-weight: bold!important;
    }
    .fd-input{
        width: 150px;
        border: none;
        font-size: 12px;
        height: 30px;
        margin-bottom: 5px;
    }
    .fd-padl{
        margin-left: 24px;
    }
    .fd-autoh{
        height: auto;
    }
    .fd-pd{
        padding: 35px 35px 10px 35px;
    }
    .fd-group{
        display: -webkit-box;
        display: -moz-box;
        display: -ms-flexbox;
        display: flex;
    }
    .fd-img img{
        width: 100px;
        height: 100px;
        margin-right: 20px;
    }
    .fd-img img:last-child{
        margin-right: 0px;
    }
    .fd-file{
        font-size: 12px;
        font-weight: bold;
        padding-left: 35px;
        padding-right: 10px;
        display: -webkit-box;
        -webkit-box-align: center;
        display: -moz-box;
        -moz-box-align: center;
        display: -ms-flexbox;
        -ms-flex-align: center;
        display: flex;
        align-items: center;
    }
    .no-img{
        display: -webkit-box;
        -webkit-box-align: center;
        display: -moz-box;
        -moz-box-align: center;
        display: -ms-flexbox;
        -ms-flex-align: center;
        display: flex;
        align-items: center;
    }
    .fd-bttn{
        width: 100px;
        height: 35px;
        display: block;
        margin:40px auto 0px;
        background-color: #b9c8d2;
        color: #fff;
        line-height: 35px;
        text-align: center;
    }
    .ad-padd{
        height: 280px;
        width: 100%;
        padding: 10px;
        border: solid 1px #dcdcdc;
        border-radius: 2px;
        font-size: 12px;
    }
    .ad-padd::-webkit-input-placeholder{
        color:#ccc;
    }
    .ad-padd::-moz-placeholder{
        color:#ccc;
    }
    .ad-padd:-moz-placeholder{
        color:#ccc;
    }
    .ad-padd:-ms-input-placeholder{
        color:#ccc;
    }
    .ad-result{
        margin: 20px 35px 0px 35px;
        border-top: solid 1px #ccc;
        padding-top:10px ;
    }
    .ad-label{
        text-align: left!important;
        padding-left: 0px!important;
        font-weight: bold!important;
    }
    .ad-pd{
        padding-top: 35px;
    }
</style>
<body>
<div id="div_roles_info_form" class="m-form-inline f-mt20" data-role-form>
    <div id="detail">
        <div style="margin-left:10px;">
            <label class="label_title fd-label">原处方记录</label>
        </div>
        <div class="m-form-group" style="border-top: solid 1px #ccc;">
            <label class="label_title fd-label">开方时间:</label>
            <div class="l-text-wrapper m-form-control">
                <input class="fd-input" type="text" class="useTitle min-length-6 validate-special-char"  />
            </div>
            <label class="label_title fd-label">开方医生:</label>
            <div class="l-text-wrapper m-form-control">
                <input class="fd-input" type="text"  class="min-length-6 validate-special-char" />
            </div>
        </div>
        <div class="m-form-group" style="">
            <label class="label_title fd-label">科室/医生</label>
            <div class="l-text-wrapper m-form-control">
                <input class="fd-input" type="text"  class="ajax min-length-2 validate-special-char"  />
            </div>
        </div>
        <div style="margin-left:10px;">
            <label class="label_title fd-label">居民信息</label>
        </div>
        <div class="m-form-group" style="border-top: solid 1px #ccc;">
            <label class="label_title fd-label">续方居民:</label>
            <div class="l-text-wrapper m-form-control">
                <input class="fd-input" type="text" class="useTitle min-length-6 validate-special-char"  />
            </div>
            <label class="label_title fd-label">医保卡号:</label>
            <div class="l-text-wrapper m-form-control">
                <input class="fd-input" type="text"  class="min-length-6 validate-special-char" />
            </div>
        </div>
        <div class="m-form-group" style="">
            <label class="label_title fd-label">身份证号</label>
            <div class="l-text-wrapper m-form-control">
                <input class="fd-input" type="text"  class="ajax min-length-2 validate-special-char"  />
            </div>
        </div>
        <div style="margin-left:10px;">
            <label class="label_title fd-label">临床诊断</label>
        </div>
        <div class="m-form-group" style="border-top: solid 1px #ccc;">
            <label class="label_title fd-label">续方居民:</label>
            <div class="l-text-wrapper m-form-control">
                <input class="fd-input" type="text" class="useTitle min-length-6 validate-special-char"  />
            </div>
        </div>
        <div style="margin-left:10px;">
            <label class="label_title fd-label">RP.</label>
        </div>
        <div class="m-form-group" style="border-top: solid 1px #ccc;">
            <label class="label_title fd-label">药品名称1 </label>
            <label class="label_title fd-label"> 用法:</label>
            <div class="l-text-wrapper m-form-control">
                <input class="fd-input" type="text" class="useTitle min-length-6 validate-special-char"  />
            </div>
            <label class="label_title fd-label">总量:</label>
            <div class="l-text-wrapper m-form-control">
                <input class="fd-input" type="text" class="useTitle min-length-6 validate-special-char"  />
            </div>
            <label class="label_title fd-label">规格:</label>
            <div class="l-text-wrapper m-form-control">
                <input class="fd-input" type="text" class="useTitle min-length-6 validate-special-char"  />
            </div>
        </div>
        <div style="margin-left:10px;">
            <label class="label_title fd-label">续方信息</label>
        </div>
        <div class="m-form-group" style="border-top: solid 1px #ccc;">
            <label class="label_title fd-label">续方状态:</label>
            <div class="l-text-wrapper m-form-control">
                <input class="fd-input" type="text" class="useTitle min-length-6 validate-special-char"  />
            </div>
            <label class="label_title fd-label">续方说明:</label>
            <div class="l-text-wrapper m-form-control">
                <input class="fd-input" type="text" class="useTitle min-length-6 validate-special-char"  />
            </div>
        </div>
        <div style="margin-left:10px;">
            <label class="label_title fd-label">审核记录</label>
        </div>
        <div class="m-form-group" style="border-top: solid 1px #ccc;">
            <label class="label_title fd-label">申请时间:</label>
            <div class="l-text-wrapper m-form-control">
                <input class="fd-input" type="text" class="useTitle min-length-6 validate-special-char"  />
            </div>
            <label class="label_title fd-label">审核医生:</label>
            <div class="l-text-wrapper m-form-control">
                <input class="fd-input" type="text"  class="min-length-6 validate-special-char" />
            </div>
        </div>
        <div style="margin-left:10px;">
            <label class="label_title fd-label">审核机构:</label>
            <div class="l-text-wrapper m-form-control">
                <input class="fd-input" type="text"  class="ajax min-length-2 validate-special-char"  />
            </div>
            <label class="label_title fd-label">审核医生:</label>
            <div class="l-text-wrapper m-form-control">
                <input class="fd-input" type="text"  class="ajax min-length-2 validate-special-char"  />
            </div>
        </div>
        <div style="margin-left:10px;">
            <label class="label_title fd-label">结果:</label>
            <div class="l-text-wrapper m-form-control">
                <input class="fd-input" type="text"  class="ajax min-length-2 validate-special-char"  />
            </div>
        </div>
    </div>
</div>
</body>
<%@ include file="../head/page_foot.jsp" %>
<%@ include file="prescription_info_js.jsp" %>
</html>

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

@ -0,0 +1,163 @@
<%@ 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 rolesInfo = null;
            // 表单校验工具类
            var jValidation = $.jValidation;
            var dialog = frameElement.dialog;
            /* *************************** 函数定义 ******************************* */
            function pageInit() {
                rolesInfo.init();
                $('#image').on('click','img',function(){
                    var imgSrc = $(this).attr('src');
                    var html = '<img src="'+imgSrc+'" alt="."/>';
                    var imgView =  $('#fd-img-view', parent.document);
                    imgView.find('.fd-img-show').html(html);
                    imgView.show();
                })
            }
            /* *************************** 模块初始化 ***************************** */
            rolesInfo = {
                dealDialog:null,
                $type: $("#type"),//申诉类型
                $name: $("#name"),//姓名
                $identity:$("#identity"),//身份
                $phone:$("#phone"),//联系方式
                $createTime:$("#createTime"),//时间
                $idcard:$("#idcard"),//身份证
                $description:$("#description"),//申诉详情
                $result:$("#result1"),//处理结果
                $btndeal: $("#deal"),//处理按钮
                $btnclose: $("#close"),//关闭按钮
                $image:$("#image"),
                init: function () {
                    _this = this;
                    var id = $("#id").val();
                    //id不为空,初始化数据
                    if (isNoEmpty(id)) {
                        $.ajax({
                            url: ctx + "/admin/appeal/getAppealById",
                            method: "post",
                            dataType: "json",
                            data: {id: id},
                            success: function (result) {
                                if (result.status == '200') {
                                    var data = result.data;
                                    if(data.type==1){
                                        _this.$type.val("手机号变更");
                                    }else if(data.type==2){
                                        _this.$type.val("重置密码");
                                    }else{
                                        _this.$type.val("其他");
                                    }
                                    _this.$name.val(data.name);
                                    if(data.identity==1){
                                        _this.$identity.val("患者")
                                    }else{
                                        _this.$identity.val("医生")
                                    }
                                    _this.$phone.val(data.phone);
                                    _this.$idcard.val(data.idcard);
                                    _this.$createTime.val(data.createTime);
                                    _this.$description.val(data.description);
                                    if (isNoEmpty(data.result)) {
                                        _this.$result.val(data.result);
                                        $("#dealResult").show();
                                        $("#deal").hide();
                                    }
                                    if(data.images){
                                        var arr = data.images.split(',');
                                        var html="";
                                        for(var i=0;i<arr.length;i++){
                                            html += '<img src="'+data.imgUrlDomain+arr[i]+'" alt="."/>';
                                        }
                                        _this.$image.html(html);
                                    }else{
                                        var html='<span class="no-img">没有上传图片</span>';
                                        _this.$image.html(html);
                                    }
                                }else{
                                    $.Notice.error(result.msg);
                                }
                            },
                        })
                    }
                    this.bindEvents();
                },
                bindEvents: function () {
                    $("#deal").click(function () {
                        $("#dealDiv").show();
                        dialog.set('title', '处理结果');
                        $("#detail").hide();
                    });
                    $("#close").click(function () {
                        parent.window.closeParentInfoDialog();
                    });
                    $("#sure").click(function () {
                        $("#sure").css("pointer-events", "none");
                        var result = $("#result").val();
                        var id = $("#id").val();
                        if (isNoEmpty(result)) {
                            if(result.length>400){
                                $.Notice.error("最多只能填写400个字");
                                $("#sure").css("pointer-events", "");
                            }else {
                                $.ajax({
                                    url: ctx + "/admin/appeal/dealAppeal",
                                    method: "post",
                                    dataType: "json",
                                    data: {id: id,
                                        result:result
                                    },
                                    success: function (result) {
                                        if (result.status == '200') {
                                            //todo  操作成功后的处理
                                            alert("操作成功");
                                            parent.window.closeParentInfoDialog();
                                        }else{
                                            $.Notice.error(result.msg);
                                            $("#sure").css("pointer-events", "");
                                        }
                                    },
                                })
                            }
                        }else{
                            //todo
                            $.Notice.error("请输入处理结果");
                            $("#sure").css("pointer-events", "");
                        }
                    });
                    $("#cancle").click(function () {
                        $("#dealDiv").hide();
                        dialog.set('title', '查看');
                        $("#detail").show();
                    });
                }
            };
            /* ************************* Dialog页面回调接口 ************************** */
            win.reloadRolesInfoGrid = function (msg) {
                if (isNoEmpty(msg)) {
                    $.Notice.success(msg);
                }
                rolesInfo.reloadGrid(msg);
            };
            win.closeInfoDialog = function () {
                rolesInfo.dealDialog.close();
            };
            win.closeParentDealDialog = function () {
                rolesInfo.dealDialog.close();
                rolesInfo.reloadGrid();
            };
            /* *************************** 页面初始化 **************************** */
            pageInit();
        })
    })(jQuery, window);
</script>

+ 27 - 8
patient-co-manage/wlyy-manage/src/main/webapp/WEB-INF/views/prescription/prescription_list_js.jsp

@ -26,11 +26,8 @@
            retrieve = {
                $element: $('.m-retrieve-area'),
                patientInfoDialog: null,
                remindInfoDialog:null,
                $noReply: $('#noReply'),
                $count: $('#count'),
                $rate: $('#rate'),
                prescriptionInfoDialog: null,
                prescriptionOrderDialog: null,
                grid: null,
                url: {
                    //接口链接
@ -128,7 +125,7 @@
                            {text: '支付成功/待配药', statusId: '50'},
                            {text: '配药成功/待配送', statusId: '60'},
                            {text: '配送中', statusId: '65'},
                            {text: '药品已配送', statusId: '69'},
                            {text: '药品到服务站', statusId: '69'},
                            {text: '配送到患者手中/已完成', statusId: '100'},
                            {text: '线下退费', statusId: '-4'},
                            {text: '支付超时', statusId: '-3'},
@ -223,10 +220,11 @@
                            {display: '配送方式', name: 'pay', align: "center"},
                            {display: '时间', name: 'create_time', width: '12%', align: "center"},
                            {
                                display: '操作', name: 'operator', width: '15%', align: "center", isSort: false,
                                display: '操作', name: 'operator', width: '20%', align: "center", isSort: false,
                                render: function (row) {
                                    var html = '';
                                    html += '<a  href="javascript:void(0)" onclick="javascript:' + Util.format("$.publish('{0}',['{1}'])", "patient:info:view", row.id) + '">查看</a>';
                                    html += '<a  href="javascript:void(0)" onclick="javascript:' + Util.format("$.publish('{0}',['{1}'])", "prescription:info:view", row.prescription_code) + '">续方详情</a>';
                                    html += '<a  style="margin-left:10px;" href="javascript:void(0)" onclick="javascript:' + Util.format("$.publish('{0}',['{1}'])", "prescription:order:view", row.prescription_code) + '">订单跟踪</a>';
                                    return html;
                                }
                            }
@ -303,6 +301,27 @@
                },
                bindEvents: function () {
                    var me = this;
                    $.subscribe('prescription:info:view', function (event, code) {
                        var title = '续方详情';
                        me.prescriptionInfoDialog = $.ligerDialog.open({
                            height: 600,
                            width: 900,
                            title: title,
                            url: ctx + '/admin/static/prescription/infoInit/' + code
                        })
                    });
                    $.subscribe('prescription:order:view', function (event, code) {
                        var title = '订单跟踪';
                        me.prescriptionOrderDialog = $.ligerDialog.open({
                            height: 600,
                            width: 900,
                            title: title,
                            url: ctx + '/admin/static/prescription/orderInit/' + code
                        })
                    });
                    //城市下拉
                    me.$inpDeviceName.on( 'change', function () {
                        me.setCityFun(me);

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

@ -0,0 +1,221 @@
<%@ page contentType="text/html; charset=UTF-8" language="java" pageEncoding="UTF-8" %>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <%@ include file="../head/page_head.jsp"%>
    <title>订单跟踪</title>
</head>
<style>
    .m-form-group label.label_title {
        width: 100px
    }
    .fd-label{
        font-size: 12px;
        font-weight: bold!important;
    }
    .fd-input{
        width: 150px;
        border: none;
        font-size: 12px;
        height: 30px;
        margin-bottom: 5px;
    }
    .fd-padl{
        margin-left: 24px;
    }
    .fd-autoh{
        height: auto;
    }
    .fd-pd{
        padding: 35px 35px 10px 35px;
    }
    .fd-group{
        display: -webkit-box;
        display: -moz-box;
        display: -ms-flexbox;
        display: flex;
    }
    .fd-img img{
        width: 100px;
        height: 100px;
        margin-right: 20px;
    }
    .fd-img img:last-child{
        margin-right: 0px;
    }
    .fd-file{
        font-size: 12px;
        font-weight: bold;
        padding-left: 35px;
        padding-right: 10px;
        display: -webkit-box;
        -webkit-box-align: center;
        display: -moz-box;
        -moz-box-align: center;
        display: -ms-flexbox;
        -ms-flex-align: center;
        display: flex;
        align-items: center;
    }
    .no-img{
        display: -webkit-box;
        -webkit-box-align: center;
        display: -moz-box;
        -moz-box-align: center;
        display: -ms-flexbox;
        -ms-flex-align: center;
        display: flex;
        align-items: center;
    }
    .fd-bttn{
        width: 100px;
        height: 35px;
        display: block;
        margin:40px auto 0px;
        background-color: #b9c8d2;
        color: #fff;
        line-height: 35px;
        text-align: center;
    }
    .ad-padd{
        height: 280px;
        width: 100%;
        padding: 10px;
        border: solid 1px #dcdcdc;
        border-radius: 2px;
        font-size: 12px;
    }
    .ad-padd::-webkit-input-placeholder{
        color:#ccc;
    }
    .ad-padd::-moz-placeholder{
        color:#ccc;
    }
    .ad-padd:-moz-placeholder{
        color:#ccc;
    }
    .ad-padd:-ms-input-placeholder{
        color:#ccc;
    }
    .ad-result{
        margin: 20px 35px 0px 35px;
        border-top: solid 1px #ccc;
        padding-top:10px ;
    }
    .ad-label{
        text-align: left!important;
        padding-left: 0px!important;
        font-weight: bold!important;
    }
    .ad-pd{
        padding-top: 35px;
    }
</style>
<body>
<div class="m-form-inline f-mt20" data-role-form>
    <div id="detail">
        <div style="margin-left:10px;">
            <label class="label_title fd-label">续方记录</label>
        </div>
        <div class="m-form-group" style="border-top: solid 1px #ccc;">
            <label class="label_title fd-label">申请时间:</label>
            <div class="l-text-wrapper m-form-control">
                <input class="fd-input" type="text" class="useTitle min-length-6 validate-special-char"  />
            </div>
            <label class="label_title fd-label">审核医生:</label>
            <div class="l-text-wrapper m-form-control">
                <input class="fd-input" type="text"  class="min-length-6 validate-special-char" />
            </div>
        </div>
        <div style="margin-left:10px;">
            <label class="label_title fd-label">收药信息</label>
        </div>
        <div class="m-form-group" style="border-top: solid 1px #ccc;">
            <label class="label_title fd-label">配送方式:</label>
            <div class="l-text-wrapper m-form-control">
                <input class="fd-input" type="text" class="useTitle min-length-6 validate-special-char"  />
            </div>
            <label class="label_title fd-label">配送地点:</label>
            <div class="l-text-wrapper m-form-control">
                <input class="fd-input" type="text"  class="min-length-6 validate-special-char" />
            </div>
        </div>
        <div class="m-form-group" style="">
            <label class="label_title fd-label">居民姓名</label>
            <div class="l-text-wrapper m-form-control">
                <input class="fd-input" type="text"  class="ajax min-length-2 validate-special-char"  />
            </div>
            <label class="label_title fd-label">居民电话</label>
            <div class="l-text-wrapper m-form-control">
                <input class="fd-input" type="text"  class="ajax min-length-2 validate-special-char"  />
            </div>
        </div>
        <div class="m-form-group" style="">
            <label class="label_title fd-label">配送员</label>
            <div class="l-text-wrapper m-form-control">
                <input class="fd-input" type="text"  class="ajax min-length-2 validate-special-char"  />
            </div>
            <label class="label_title fd-label">服务站地址</label>
            <div class="l-text-wrapper m-form-control">
                <input class="fd-input" type="text"  class="ajax min-length-2 validate-special-char"  />
            </div>
        </div>
        <div style="margin-left:10px;">
            <label class="label_title fd-label">订单记录</label>
        </div>
        <div class="m-form-group" style="border-top: solid 1px #ccc;">
            <label class="label_title fd-label">订单状态:</label>
            <div class="l-text-wrapper m-form-control">
                <input class="fd-input" type="text" class="useTitle min-length-6 validate-special-char"  />
            </div>
            <label class="label_title fd-label">订单号:</label>
            <div class="l-text-wrapper m-form-control">
                <input class="fd-input" type="text" class="useTitle min-length-6 validate-special-char"  />
            </div>
        </div>
        <div class="m-form-group" style="border-top: solid 1px #ccc;">
            <label class="label_title fd-label">订单跟踪:</label>
            <div class="l-text-wrapper m-form-control">
                <input class="fd-input" type="text" class="useTitle min-length-6 validate-special-char"  />
            </div>
            <label class="label_title fd-label">出药机构:</label>
            <div class="l-text-wrapper m-form-control">
                <input class="fd-input" type="text" class="useTitle min-length-6 validate-special-char"  />
            </div>
        </div>
        <div style="margin-left:10px;">
            <label class="label_title fd-label">药品信息.</label>
        </div>
        <div class="m-form-group" style="border-top: solid 1px #ccc;">
            <label class="label_title fd-label">药品名称1 </label>
            <label class="label_title fd-label"> 用法:</label>
            <div class="l-text-wrapper m-form-control">
                <input class="fd-input" type="text" class="useTitle min-length-6 validate-special-char"  />
            </div>
            <label class="label_title fd-label">总量:</label>
            <div class="l-text-wrapper m-form-control">
                <input class="fd-input" type="text" class="useTitle min-length-6 validate-special-char"  />
            </div>
            <label class="label_title fd-label">规格:</label>
            <div class="l-text-wrapper m-form-control">
                <input class="fd-input" type="text" class="useTitle min-length-6 validate-special-char"  />
            </div>
        </div>
    </div>
</div>
</body>
<%@ include file="../head/page_foot.jsp" %>
<%@ include file="prescription_order_js.jsp" %>
</html>

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

@ -0,0 +1,163 @@
<%@ 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 rolesInfo = null;
            // 表单校验工具类
            var jValidation = $.jValidation;
            var dialog = frameElement.dialog;
            /* *************************** 函数定义 ******************************* */
            function pageInit() {
                rolesInfo.init();
                $('#image').on('click','img',function(){
                    var imgSrc = $(this).attr('src');
                    var html = '<img src="'+imgSrc+'" alt="."/>';
                    var imgView =  $('#fd-img-view', parent.document);
                    imgView.find('.fd-img-show').html(html);
                    imgView.show();
                })
            }
            /* *************************** 模块初始化 ***************************** */
            rolesInfo = {
                dealDialog:null,
                $type: $("#type"),//申诉类型
                $name: $("#name"),//姓名
                $identity:$("#identity"),//身份
                $phone:$("#phone"),//联系方式
                $createTime:$("#createTime"),//时间
                $idcard:$("#idcard"),//身份证
                $description:$("#description"),//申诉详情
                $result:$("#result1"),//处理结果
                $btndeal: $("#deal"),//处理按钮
                $btnclose: $("#close"),//关闭按钮
                $image:$("#image"),
                init: function () {
                    _this = this;
                    var id = $("#id").val();
                    //id不为空,初始化数据
                    if (isNoEmpty(id)) {
                        $.ajax({
                            url: ctx + "/admin/appeal/getAppealById",
                            method: "post",
                            dataType: "json",
                            data: {id: id},
                            success: function (result) {
                                if (result.status == '200') {
                                    var data = result.data;
                                    if(data.type==1){
                                        _this.$type.val("手机号变更");
                                    }else if(data.type==2){
                                        _this.$type.val("重置密码");
                                    }else{
                                        _this.$type.val("其他");
                                    }
                                    _this.$name.val(data.name);
                                    if(data.identity==1){
                                        _this.$identity.val("患者")
                                    }else{
                                        _this.$identity.val("医生")
                                    }
                                    _this.$phone.val(data.phone);
                                    _this.$idcard.val(data.idcard);
                                    _this.$createTime.val(data.createTime);
                                    _this.$description.val(data.description);
                                    if (isNoEmpty(data.result)) {
                                        _this.$result.val(data.result);
                                        $("#dealResult").show();
                                        $("#deal").hide();
                                    }
                                    if(data.images){
                                        var arr = data.images.split(',');
                                        var html="";
                                        for(var i=0;i<arr.length;i++){
                                            html += '<img src="'+data.imgUrlDomain+arr[i]+'" alt="."/>';
                                        }
                                        _this.$image.html(html);
                                    }else{
                                        var html='<span class="no-img">没有上传图片</span>';
                                        _this.$image.html(html);
                                    }
                                }else{
                                    $.Notice.error(result.msg);
                                }
                            },
                        })
                    }
                    this.bindEvents();
                },
                bindEvents: function () {
                    $("#deal").click(function () {
                        $("#dealDiv").show();
                        dialog.set('title', '处理结果');
                        $("#detail").hide();
                    });
                    $("#close").click(function () {
                        parent.window.closeParentInfoDialog();
                    });
                    $("#sure").click(function () {
                        $("#sure").css("pointer-events", "none");
                        var result = $("#result").val();
                        var id = $("#id").val();
                        if (isNoEmpty(result)) {
                            if(result.length>400){
                                $.Notice.error("最多只能填写400个字");
                                $("#sure").css("pointer-events", "");
                            }else {
                                $.ajax({
                                    url: ctx + "/admin/appeal/dealAppeal",
                                    method: "post",
                                    dataType: "json",
                                    data: {id: id,
                                        result:result
                                    },
                                    success: function (result) {
                                        if (result.status == '200') {
                                            //todo  操作成功后的处理
                                            alert("操作成功");
                                            parent.window.closeParentInfoDialog();
                                        }else{
                                            $.Notice.error(result.msg);
                                            $("#sure").css("pointer-events", "");
                                        }
                                    },
                                })
                            }
                        }else{
                            //todo
                            $.Notice.error("请输入处理结果");
                            $("#sure").css("pointer-events", "");
                        }
                    });
                    $("#cancle").click(function () {
                        $("#dealDiv").hide();
                        dialog.set('title', '查看');
                        $("#detail").show();
                    });
                }
            };
            /* ************************* Dialog页面回调接口 ************************** */
            win.reloadRolesInfoGrid = function (msg) {
                if (isNoEmpty(msg)) {
                    $.Notice.success(msg);
                }
                rolesInfo.reloadGrid(msg);
            };
            win.closeInfoDialog = function () {
                rolesInfo.dealDialog.close();
            };
            win.closeParentDealDialog = function () {
                rolesInfo.dealDialog.close();
                rolesInfo.reloadGrid();
            };
            /* *************************** 页面初始化 **************************** */
            pageInit();
        })
    })(jQuery, window);
</script>

+ 18 - 10
patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/service/app/charge/OnePayService.java

@ -486,25 +486,33 @@ public class OnePayService {
                    for (BindCard card : result) {
                        if ("98".equals(card.getAttachRelation())) {
                            String idcard = card.getAttachIdNo();
                            String bindCardNo= card.getAttachCardNo();
                            Patient patient = patientDao.findByIdcard(idcard);
                            userCode = patient.getCode();
                            patient.setSicardStatus(1);
                            patient.setSicardTime(new Date());
                            patient.setPrincipalCode(userCode);
                            patientDao.save(patient);
                            LOGGER.info("myself ==========>  userCode " + userCode);
                            String ssc = patient.getSsc();
                            if (bindCardNo.equals(ssc)){
                                patient.setSicardStatus(1);
                                patient.setSicardTime(new Date());
                                patient.setPrincipalCode(userCode);
                                patientDao.save(patient);
                                LOGGER.info("myself ==========>  userCode " + userCode);
                            }
                        }
                    }
                    //获取家人绑卡情况
                    for (BindCard familyCard : result) {
                        if (!"98".equals(familyCard.getAttachRelation())) {
                            String idcard = familyCard.getAttachIdNo();
                            String bindCardNo = familyCard.getAttachCardNo();
                            Patient patient = patientDao.findByIdcard(idcard);
                            patient.setSicardStatus(1);
                            patient.setSicardTime(new Date());
                            patient.setPrincipalCode(userCode);
                            patientDao.save(patient);
                            LOGGER.info("family ==========>  userCode "+userCode +" ========== >> "+patient.getOpenid());
                            String ssc = patient.getSsc();
                            if (bindCardNo.equals(ssc)){
                                patient.setSicardStatus(1);
                                patient.setSicardTime(new Date());
                                patient.setPrincipalCode(userCode);
                                patientDao.save(patient);
                                LOGGER.info("family ==========>  userCode "+userCode +" ========== >> "+patient.getOpenid());
                            }
                        }
                    }
                }

+ 105 - 1
patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/service/app/prenatalInspector/PrenatalInspectorPreCardService.java

@ -1,5 +1,7 @@
package com.yihu.wlyy.service.app.prenatalInspector;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.yihu.wlyy.entity.doctor.profile.Doctor;
import com.yihu.wlyy.entity.message.Message;
import com.yihu.wlyy.entity.patient.Patient;
@ -14,6 +16,7 @@ import com.yihu.wlyy.repository.patient.PrenatalInspectorRecordDao;
import com.yihu.wlyy.repository.patient.SignFamilyDao;
import com.yihu.wlyy.service.BaseService;
import com.yihu.wlyy.service.app.sign.FamilyContractService;
import com.yihu.wlyy.service.third.jw.JwMaternalChildService;
import com.yihu.wlyy.task.PushMsgTask;
import com.yihu.wlyy.util.DateUtil;
import com.yihu.wlyy.wechat.util.WeiXinAccessTokenUtils;
@ -50,6 +53,8 @@ public class PrenatalInspectorPreCardService extends BaseService {
    private SignFamilyDao signFamilyDao;
    @Autowired
    private DoctorDao doctorDao;
    @Autowired
    private JwMaternalChildService jwMaternalChildService;
    /**
@ -120,7 +125,7 @@ public class PrenatalInspectorPreCardService extends BaseService {
    /**
     * 向医生发出产检系统消息
     */
    public void sendMessagePrenatal() throws Exception {
    public void sendMessagePrenatalBak() throws Exception {
        try {
            SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
            List<PrenatalInspectorPlan> planList = prenatalInspectorPlanDao.findByTime();
@ -148,6 +153,46 @@ public class PrenatalInspectorPreCardService extends BaseService {
    }
    /**
     * 向医生发出产检系统消息
     */
    public void sendMessagePrenatal() throws Exception {
        try {
            SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
            List<PrenatalInspectorPlan> planList = prenatalInspectorPlanDao.findByTime();
            for (PrenatalInspectorPlan plan : planList) {
                String code = plan.getPatient();
                String pregnancyNo = plan.getInspectionCode();
                Date planTime = plan.getInspectionTime();
                Patient patient = patientDao.findByCode(code);
                Date begin = DateUtil.getPreDays(planTime,-14);
                Date end = DateUtil.getPreDays(planTime,14);
                Long days = DateUtil.getDays(new Date(), planTime);
                String content = "您的签约居民" + patient.getName() + "超期未进行孕检,原计划孕检时间" + format.format(plan.getInspectionTime());
                if (StringUtils.isNotEmpty(pregnancyNo) && (pregnancyNo != null)) {
                    Boolean examStatus = getExamStatus(code, pregnancyNo, begin, end);
                    if (!examStatus) {
                        if (days > 7) {
                            SignFamily signFamily = signFamilyDao.findByPatient(code);
                            String doctor = signFamily.getDoctor();
                            String doctorHealth = signFamily.getDoctorHealth();
                            if (StringUtils.isNotEmpty(doctor)) {
                                saveMessageRecord(plan.getId().toString(), doctor, code, content);
                            }
                            if (StringUtils.isNotEmpty(doctorHealth)) {
                                saveMessageRecord(plan.getId().toString(), doctorHealth, code, content);
                            }
                        }
                    }
                }
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
    /**
     * 保存系统消息及发送记录
     *
@ -209,4 +254,63 @@ public class PrenatalInspectorPreCardService extends BaseService {
        }
    }
    /**
     * 查询待产检计划产检时间在该时间段内是否有过真实产检
     * @param patient 居民code
     * @param pregnancyNo 产检号
     * @param begin  起始时间
     * @param end  截止时间
     * @return
     * @throws Exception
     */
    public Boolean getExamStatus(String patient,String pregnancyNo,Date begin,Date end) throws Exception {
        Boolean flag = false;
        try {
            SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
            JSONArray natals = reExamRecode(patient,pregnancyNo);
            for (Object natal : natals) {
                com.alibaba.fastjson.JSONObject examRecord = JSON.parseObject(natal.toString());
                String exam_time = examRecord.getString("EXAM_TIME");
                Date examTime = format.parse(exam_time);
                if ((examTime.getTime()<= end.getTime()) && (examTime.getTime() >= begin.getTime())){
                    return true;
                }
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        return flag;
    }
    /**
     * 复检记录
     *
     * @param patientCode
     * @return
     */
    public JSONArray reExamRecode(String patientCode, String pregnancyNo) {
        JSONArray re = new JSONArray();
        try {
            SignFamily signFamily = signFamilyDao.findByPatient(patientCode);
            String hospital = null;
            if (signFamily != null) {
                hospital = signFamily.getHospital();
            }
            Patient patient = patientDao.findByCode(patientCode);
            String response = jwMaternalChildService.getEhrMaternalReExamRecord(patient.getIdcard(), hospital, pregnancyNo);
            com.alibaba.fastjson.JSONObject json = com.alibaba.fastjson.JSONObject.parseObject(response);
            JSONArray data = null;
            if (json.getInteger("status") == 200) {
                data = json.getJSONObject("data").getJSONArray("DATA");
            }
            if (data != null && data.size() > 0) {
                return data;
            }
            return re;
        } catch (Exception e) {
            e.printStackTrace();
        }
        return re;
    }
}

+ 308 - 0
patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/service/third/jw/JwMaternalChildService.java

@ -0,0 +1,308 @@
package com.yihu.wlyy.service.third.jw;
import com.yihu.wlyy.util.HttpClientUtil;
import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
/**
 * Created by yeshijie on 2017/9/25.
 */
@Service
public class JwMaternalChildService {
    private static final Logger logger = LoggerFactory.getLogger(JwMaternalChildService.class);
    //基卫服务地址
    @Value("${sign.check_upload}")
    private String jwUrl;
    @Autowired
    private HttpClientUtil httpClientUtil;
    @Autowired
    private JdbcTemplate jdbcTemplate;
    /**
     * 获取孕妇建卡信息
     * @param idcard 身份证
     * @param hospital 医院code
     * @return
     * @throws Exception
     */
    public String getEhrMaternalFirstExamRecord(String idcard,String hospital) throws Exception{
        String url = jwUrl + "/third/prenatalInspector/getEhrMaternalFirstExamRecord";
        List<NameValuePair> params = new ArrayList<>();
        params.add(new BasicNameValuePair("idcard", idcard));
        params.add(new BasicNameValuePair("hospital", hospital));
        String response = httpClientUtil.post(url, params, "UTF-8");
        return response;
    }
    /**
     * 获取非第一次产检记录
     * @param idcard 身份证
     * @param hospital 医院code
     * @param pregnancyNo 产检号
     * @return
     * @throws Exception
     */
    public String getEhrMaternalReExamRecord(String idcard,String hospital,String pregnancyNo) throws Exception{
        String url = jwUrl + "/third/prenatalInspector/getEhrMaternalReExamRecord";
        List<NameValuePair> params = new ArrayList<>();
        params.add(new BasicNameValuePair("idcard", idcard));
        params.add(new BasicNameValuePair("hospital", hospital));
        params.add(new BasicNameValuePair("pregnancyNo", pregnancyNo));
        String response = httpClientUtil.post(url, params, "UTF-8");
        return response;
    }
    /**
     * 获取产床预约信息
     * @param idcard 身份证
     * @param hospital 医院code
     * @return
     * @throws Exception
     */
    public String getEhrMaternalBedPrecontractRecord(String idcard,String hospital) throws Exception{
        String url = jwUrl + "/third/prenatalInspector/getEhrMaternalBedPrecontractRecord";
        List<NameValuePair> params = new ArrayList<>();
        params.add(new BasicNameValuePair("idcard", idcard));
        params.add(new BasicNameValuePair("hospital", hospital));
        String response = httpClientUtil.post(url, params, "UTF-8");
        return response;
    }
    /**
     * 获取高危产妇信息
     * @param idcard 身份证
     * @param hospital 医院code
     * @return
     * @throws Exception
     */
    public String getEhrMaternalPregnancyHighRecord( String idcard, String hospital) throws Exception{
        String url = jwUrl + "/third/prenatalInspector/getEhrMaternalPregnancyHighRecord";
        List<NameValuePair> params = new ArrayList<>();
        params.add(new BasicNameValuePair("idcard", idcard));
        params.add(new BasicNameValuePair("hospital", hospital));
        String response = httpClientUtil.post(url, params, "UTF-8");
        return response;
    }
    /**
     * 获取孕妇分娩信息
     * @param idcard 身份证
     * @param hospital 医院code
     * @return
     * @throws Exception
     */
    public String getEhrMaternalDeliveryRecord(String idcard, String hospital) throws Exception{
        String url = jwUrl + "/third/prenatalInspector/getEhrMaternalDeliveryRecord";
        List<NameValuePair> params = new ArrayList<>();
        params.add(new BasicNameValuePair("idcard", idcard));
        params.add(new BasicNameValuePair("hospital", hospital));
        String response = httpClientUtil.post(url, params, "UTF-8");
        return response;
    }
    /**
     * 获取新生儿基本信息
     * @param idcard 身份证
     * @param hospital 医院code
     * @return
     * @throws Exception
     */
    public String getEhrMaternalDeliveryChildRecord(String idcard,String hospital) throws Exception{
        String url = jwUrl + "/third/prenatalInspector/getEhrMaternalDeliveryChildRecord";
        List<NameValuePair> params = new ArrayList<>();
        params.add(new BasicNameValuePair("idcard", idcard));
        params.add(new BasicNameValuePair("hospital", hospital));
        String response = httpClientUtil.post(url, params, "UTF-8");
        return response;
    }
    /**
     * 获取儿童健康体检0-6岁记录
     * @param idcard 身份证
     * @param hospital 医院code
     * @return
     * @throws Exception
     */
    public String getEhrMaternalChildMedicalRecord(String idcard,String hospital) throws Exception{
        String url = jwUrl + "/third/prenatalInspector/getEhrMaternalChildMedicalRecord";
        List<NameValuePair> params = new ArrayList<>();
        params.add(new BasicNameValuePair("idcard", idcard));
        params.add(new BasicNameValuePair("hospital", hospital));
        String response = httpClientUtil.post(url, params, "UTF-8");
        return response;
    }
    /**
     * 获取新生儿访视信息
     * @param idcard 身份证
     * @param hospital 医院code
     * @return
     * @throws Exception
     */
    public String getEhrMaternalHomeVisitRecord(String idcard,String hospital) throws Exception{
        String url = jwUrl + "/third/prenatalInspector/getEhrMaternalHomeVisitRecord";
        List<NameValuePair> params = new ArrayList<>();
        params.add(new BasicNameValuePair("idcard", idcard));
        params.add(new BasicNameValuePair("hospital", hospital));
        String response = httpClientUtil.post(url, params, "UTF-8");
        return response;
    }
    /**
     * 获取新生儿免疫记录
     * @param idcard 身份证
     * @param hospital 医院code
     * @return
     * @throws Exception
     */
    public String getEhrMaternalChildImmuneRecord(String idcard,String hospital) throws Exception{
        String url = jwUrl + "/third/prenatalInspector/getEhrMaternalChildImmuneRecord";
        List<NameValuePair> params = new ArrayList<>();
        params.add(new BasicNameValuePair("idcard", idcard));
        params.add(new BasicNameValuePair("hospital", hospital));
        String response = httpClientUtil.post(url, params, "UTF-8");
        return response;
    }
    /**
     * 获取孕妇预建卡信息
     * @param idcard 身份证
     * @param hospital 医院code
     * @return
     * @throws Exception
     */
    public String getEhrMaternalPreFirstExamRecord(String idcard,String hospital) throws Exception{
        String url = jwUrl + "/third/prenatalInspector/getEhrMaternalPreFirstExamRecord";
        List<NameValuePair> params = new ArrayList<>();
        params.add(new BasicNameValuePair("idcard", idcard));
        params.add(new BasicNameValuePair("hospital", hospital));
        String response = httpClientUtil.post(url, params, "UTF-8");
        return response;
    }
    /**
     * 上传孕妇预建卡信息
     * @param code 预建卡code
     * @return
     * @throws Exception
     */
    public String SaveEhrMaternalPreFirstExamRecord(String code) throws Exception{
        String url = jwUrl + "/third/prenatalInspector/SaveEhrMaternalPreFirstExamRecord";
        List<NameValuePair> params = new ArrayList<>();
        params.add(new BasicNameValuePair("code", code));
        String response = httpClientUtil.post(url, params, "UTF-8");
        return response;
    }
    /**
     * 上传新生儿访视信息
     * @param idcard 身份证
     * @param hospital 医院code
     * @return
     * @throws Exception
     */
    public String SaveEhrMaternalHomeVisitRecord(String idcard,String hospital) throws Exception{
        String url = jwUrl + "/third/prenatalInspector/SaveEhrMaternalHomeVisitRecord";
        List<NameValuePair> params = new ArrayList<>();
        params.add(new BasicNameValuePair("idcard", idcard));
        params.add(new BasicNameValuePair("hospital", hospital));
        String response = httpClientUtil.post(url, params, "UTF-8");
        return response;
    }
    /**
     * 获取待产记录
     * @param idcard 身份证
     * @param hospital 医院code
     * @param searchTime 查询时间
     * @return
     * @throws Exception
     */
    public String getEhrMaternalZSPreDeliveryRecord(String idcard,String hospital,String searchTime) throws Exception{
        String url = jwUrl + "/third/prenatalInspector/getEhrMaternalZSPreDeliveryRecord";
        List<NameValuePair> params = new ArrayList<>();
        params.add(new BasicNameValuePair("idcard", idcard));
        params.add(new BasicNameValuePair("hospital", hospital));
        params.add(new BasicNameValuePair("searchTime", searchTime));
        String response = httpClientUtil.post(url, params, "UTF-8");
        return response;
    }
    /**
     * 获取阴道分娩记录
     * @param idcard 身份证
     * @param hospital 医院code
     * @param searchTime 查询时间
     * @return
     * @throws Exception
     */
    public String getEhrMaternalZSDeliveryRecord(String idcard, String hospital, String searchTime) throws Exception{
        String url = jwUrl + "/third/prenatalInspector/getEhrMaternalZSDeliveryRecord";
        List<NameValuePair> params = new ArrayList<>();
        params.add(new BasicNameValuePair("idcard", idcard));
        params.add(new BasicNameValuePair("hospital", hospital));
        params.add(new BasicNameValuePair("searchTime", searchTime));
        String response = httpClientUtil.post(url, params, "UTF-8");
        return response;
    }
    /**
     * 获取剖宫产记录
     * @param idcard 身份证
     * @param hospital 医院code
     * @param searchTime 查询时间
     * @return
     * @throws Exception
     */
    public String getEhrMaternalZSCaesareanBirthRecord(String idcard, String hospital, String searchTime) throws Exception{
        String url = jwUrl + "/third/prenatalInspector/getEhrMaternalZSCaesareanBirthRecord";
        List<NameValuePair> params = new ArrayList<>();
        params.add(new BasicNameValuePair("idcard", idcard));
        params.add(new BasicNameValuePair("hospital", hospital));
        params.add(new BasicNameValuePair("searchTime", searchTime));
        String response = httpClientUtil.post(url, params, "UTF-8");
        return response;
    }
}

+ 17 - 0
patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/util/DateUtil.java

@ -368,6 +368,23 @@ public class DateUtil {
		return mydate1;
	}
	/**
	 * 时间前推或后推天数(负数前推正数后推)
	 * date 基准时间
	 */
	public static Date getPreDays(Date date, int days) {
		Date day = null;
		try {
			Calendar c = Calendar.getInstance();
			c.setTime(date);
			c.add(Calendar.DATE, days);
			day = c.getTime();
		} catch (Exception e) {
		}
		return day;
	}
	/**
	 * 得到一个时间延后或前移几分钟的时间,nowdate为时间,delay为前移或后延的分钟数
	 */

+ 1 - 1
patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/web/quota/JobController.java

@ -722,7 +722,7 @@ public class JobController extends BaseController {
    @ApiOperation("医生端产检系统提醒")
    public String startDoctorPrenatalInspectorJob() {
        try {
            quartzHelper.startNow(DoctorPrenatalInspectorJob.class, "DOCTOR_PRENATAL_INSPECTOR_JOB", null);
            quartzHelper.startNow(DoctorPrenatalInspectorJob.class, "DoctorPrenatalInspectorJob", null);
            return success("启动成功!");
        } catch (Exception e) {
            error(e);

+ 108 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prenatalInspector/PrenatalInspectorPreCardService.java

@ -1,5 +1,6 @@
package com.yihu.wlyy.service.app.prenatalInspector;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yihu.device.entity.DevicePatientHealthIndex;
@ -723,10 +724,10 @@ public class PrenatalInspectorPreCardService extends BaseService {
     *
     * @param prenatalId
     */
    public JSONObject getPrenatalStatus(Long prenatalId) throws Exception {
    public JSONObject getPrenatalStatusBak(Long prenatalId) throws Exception {
        JSONObject json = new JSONObject();
        try {
            SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm");
            SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
            PrenatalInspectorPlan plan = prenatalInspectorPlanDao.findOne(prenatalId);
            Date planTime = plan.getInspectionTime();
            Boolean flag = getSendStatus(prenatalId);
@ -793,6 +794,83 @@ public class PrenatalInspectorPreCardService extends BaseService {
        return json;
    }
    /**
     * 根据待产检ID查询最近一条待产检计划状态
     *
     * @param prenatalId
     */
    public JSONObject getPrenatalStatus(Long prenatalId) throws Exception {
        JSONObject json = new JSONObject();
        try {
            SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
            PrenatalInspectorPlan plan = prenatalInspectorPlanDao.findOne(prenatalId);
            Date planTime = plan.getInspectionTime();
            String pregnancyNo = plan.getInspectionCode();
            String patient = plan.getPatient();
            Boolean flag = getSendStatus(prenatalId);
            Long days = DateUtil.getDays(new Date(), planTime);
            Date begin = DateUtil.getPreDays(planTime,-14);
            Date end = DateUtil.getPreDays(planTime,14);
            //有产检code
            if (StringUtils.isNotEmpty(pregnancyNo) && (pregnancyNo != null)){
                Boolean examStatus = getExamStatus(patient,pregnancyNo,begin,end);
                if (examStatus){
                    json.put("renatalStatus", "4");
                }else {
                    if (days > 7) {
                        json.put("renatalStatus", "3");
                        json.put("sendStatus", flag == true ? "1" : "0");
                    }else{
                        PrenatalInspectorRecord record = recordDao.findByRelationAndType(prenatalId.toString(), 0);
                        if (record == null) {
                            json.put("renatalStatus", "1");
                            if (days < -7) {
                                json.put("reason", "未到提醒时间(" + format.format(DateUtil.getPreDays(plan.getInspectionTime(), -7)) + " 08:00)");
                            }else {
                                json.put("reason", "提醒时间(" + format.format(DateUtil.getPreDays(plan.getInspectionTime(), -7)) + " 08:00)");
                            }
                        } else {
                            PrenatalInspectorRecord docRecord = recordDao.findByRelationAndType(prenatalId.toString(), 1);
                            json.put("renatalStatus", "2");
                            json.put("sendStatus", flag == true ? "1" : "0");
                            if (docRecord == null) {
                                json.put("sendTime", format.format(record.getSendTime()));
                            } else {
                                json.put("sendTime", format.format(docRecord.getSendTime()));
                            }
                        }
                    }
                }
            }else {
                PrenatalInspectorRecord record = recordDao.findByRelationAndType(prenatalId.toString(), 0);
                if (record == null) {
                    json.put("renatalStatus", "1");
                    if (days < -7) {
                        json.put("reason", "未到提醒时间(" + format.format(DateUtil.getPreDays(plan.getInspectionTime(), -7)) + " 08:00)");
                    }else {
                        json.put("reason", "提醒时间(" + format.format(DateUtil.getPreDays(plan.getInspectionTime(), -7)) + " 08:00)");
                    }
                } else {
                    PrenatalInspectorRecord docRecord = recordDao.findByRelationAndType(prenatalId.toString(), 1);
                    json.put("renatalStatus", "2");
                    json.put("sendStatus", flag == true ? "1" : "0");
                    if (docRecord == null) {
                        json.put("sendTime", format.format(record.getSendTime()));
                    } else {
                        json.put("sendTime", format.format(docRecord.getSendTime()));
                    }
                }
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        json.put("prenatalId", prenatalId);
        return json;
    }
    /**
     * 提醒居民(每24小时可提醒一次)
     *
@ -902,4 +980,32 @@ public class PrenatalInspectorPreCardService extends BaseService {
        return flag;
    }
    /**
     * 查询待产检计划产检时间在该时间段内是否有过真实产检
     * @param patient 居民code
     * @param pregnancyNo 产检号
     * @param begin  起始时间
     * @param end  截止时间
     * @return
     * @throws Exception
     */
    public Boolean getExamStatus(String patient,String pregnancyNo,Date begin,Date end) throws Exception {
        Boolean flag = false;
        try {
                SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
                JSONArray natals = reExamRecode(patient,pregnancyNo);
                for (Object natal : natals) {
                    JSONObject examRecord = JSON.parseObject(natal.toString());
                    String exam_time = examRecord.getString("EXAM_TIME");
                    Date examTime = format.parse(exam_time);
                    if ((examTime.getTime()<= end.getTime()) && (examTime.getTime() >= begin.getTime())){
                        return true;
                    }
                }
        } catch (Exception e) {
            e.printStackTrace();
        }
        return flag;
    }
}

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prescription/PrescriptionService.java

@ -459,7 +459,7 @@ public class PrescriptionService extends BaseService {
            sql += " AND LEFT(p.hospital, 6) = '"+area+"' ";
            //机构
        }else if("2".equals(level)){
            sql += "AND p.hospital = '"+area+"' ";
            sql += " AND p.hospital = '"+area+"' ";
        }
        List<Map<String,Object>> resultList = new ArrayList<>();
        int start = (pageNo-1)*pageSize;

+ 139 - 51
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/statistics/StatisticsService.java

@ -2045,6 +2045,8 @@ public class StatisticsService extends BaseService {
        String totalSql = "SELECT " +
                "  COUNT(1) total " +
                "  FROM " +
                " wlyy_admin_team_member m JOIN(" +
                " SELECT d.id,t.create_time FROM " +
                "  " + imDataBaseName + ".Topics t, " +
                "  " + imDataBaseName + ".Participants p, " +
                "  " + imDataBaseName + ".Doctors d, " +
@ -2058,7 +2060,10 @@ public class StatisticsService extends BaseService {
                " AND p.session_id = t.session_id " +
                " AND c.admin_team_code =" + id +
                " AND t.create_time >= '" + startDate + "' " +
                " AND t.create_time <= '" + endDate + "'";
                " AND t.create_time <= '" + endDate + "'"+
                ")c ON c.id = m.doctor_code " +
                " WHERE " +
                " m.team_id = "  + id ;
        List<Map<String, Object>> totalList = jdbcTemplate.queryForList(totalSql);
        Long totalCount = 0L;
        if (totalList != null && totalList.size() > 0) {
@ -2068,6 +2073,8 @@ public class StatisticsService extends BaseService {
        String noReySql = "SELECT " +
                "  COUNT(1) noRey " +
                "  FROM " +
                " wlyy_admin_team_member m JOIN(" +
                " SELECT d.id,t.create_time FROM " +
                "  " + imDataBaseName + ".Topics t, " +
                "  " + imDataBaseName + ".Participants p, " +
                "  " + imDataBaseName + ".Doctors d, " +
@ -2083,7 +2090,10 @@ public class StatisticsService extends BaseService {
                " AND p.session_id = t.session_id " +
                " AND c.admin_team_code =" + id +
                " AND t.create_time >= '" + startDate + "' " +
                " AND t.create_time <= '" + endDate + "'";
                " AND t.create_time <= '" + endDate + "'"+
                ")c ON c.id = m.doctor_code " +
                " WHERE " +
                " m.team_id = "  + id;
        List<Map<String, Object>> noReyList = jdbcTemplate.queryForList(noReySql);
        Long noReyCount = 0L;
        if (noReyList != null && noReyList.size() > 0) {
@ -2327,12 +2337,14 @@ public class StatisticsService extends BaseService {
     */
    public Map<String, Object> getConsultByteam(Long id, String startDate, String endDate) {
        String imDataBaseName = im_dataBase_name;
//        startDate = startDate + " 00:00:00";
//        endDate = endDate + " 23:59:59";
        startDate = startDate + " 00:00:00";
        endDate = endDate + " 23:59:59";
        //咨询量
        String consult_sql = "SELECT " +
                "  COUNT(1) consultCount " +
                "  FROM " +
                " wlyy_admin_team_member m JOIN(" +
                " SELECT d.id,t.create_time FROM " +
                "  " + imDataBaseName + ".Topics t, " +
                "  " + imDataBaseName + ".Participants p, " +
                "  " + imDataBaseName + ".Doctors d, " +
@ -2346,7 +2358,10 @@ public class StatisticsService extends BaseService {
                " AND p.session_id = t.session_id " +
                " AND c.admin_team_code =" + id +
                " AND t.create_time >= '" + startDate + "' " +
                " AND t.create_time <= '" + endDate + "'";
                " AND t.create_time <= '" + endDate + "'" +
                ")c ON c.id = m.doctor_code " +
                " WHERE " +
                " m.team_id = "  + id;
        //获取咨詢數
        Map<String, Object> consultCout = jdbcTemplate.queryForMap(consult_sql);
        if (consultCout.get("consultCount") == null) {
@ -2483,54 +2498,66 @@ public class StatisticsService extends BaseService {
        String sql;
        String totalSql;
        startDate = startDate + " 00:00:00";
        endDate = endDate + " 00:00:00";
        endDate = endDate + " 23:59:59";
        if ("0".equals(type)) {
            //按周统计
            sql = "SELECT " +
                    "  left(t.create_time,10) AS dateNo, COUNT(1) AS noRely  " +
            sql = "SELECT" +
                    " left(c.create_time,10) AS dateNo, COUNT(1) AS noRely  " +
                    " FROM " +
                    " wlyy_admin_team_member m JOIN(" +
                    " SELECT d.id,t.create_time FROM " +
                    "  " + imDataBaseName + ".Topics t, " +
                    "  " + imDataBaseName + ".Participants p, " +
                    "  " + imDataBaseName + ".Doctors d, " +
                    "  Wlyy_Consult_Team c, " +
                    "  " + imDataBaseName + ".Patients s " +
                    " WHERE " +
                    "  WHERE " +
                    "  d.id = p.participant_id " +
                    " AND c.consult = t.id " +
                    " AND c.patient = s.id " +
                    " AND c.type <> 8" +
                    " AND t. STATUS <> 10 " +
                    " AND t.`reply` = 0 " +
                    " AND p.session_id = t.session_id " +
                    " AND c.admin_team_code = " + teamCode +
                    " AND t.create_time >= '" + startDate + "' " +
                    " AND t.create_time <= '" + endDate + "' " +
                    "  AND c.consult = t.id " +
                    "  AND c.patient = s.id " +
                    "  AND p.session_id = t.session_id " +
                    "  AND c.type <> 8" +
                    "  AND c.admin_team_code = " + teamCode +
                    "  AND t. STATUS <> 10  " +
                    "  AND t.`reply` = 0  " +
                    "  AND t.create_time >= '" + startDate + "' " +
                    "  AND t.create_time <= '" + endDate + "' " +
                    ")c ON c.id = m.doctor_code " +
                    " WHERE " +
                    " m.team_id = "  + teamCode +
                    " GROUP BY dateNo";
            totalSql = "SELECT " +
                    "  left(t.create_time,10) AS dateNo, COUNT(1) total " +
            totalSql = "SELECT" +
                    " left(c.create_time,10) AS dateNo, COUNT(1) total " +
                    " FROM " +
                    " wlyy_admin_team_member m JOIN(" +
                    " SELECT d.id,t.create_time FROM " +
                    "  " + imDataBaseName + ".Topics t, " +
                    "  " + imDataBaseName + ".Participants p, " +
                    "  " + imDataBaseName + ".Doctors d, " +
                    "  Wlyy_Consult_Team c, " +
                    "  " + imDataBaseName + ".Patients s " +
                    " WHERE " +
                    "  WHERE " +
                    "  d.id = p.participant_id " +
                    " AND c.consult = t.id " +
                    " AND c.patient = s.id " +
                    " AND p.session_id = t.session_id " +
                    " AND c.type <> 8" +
                    " AND c.admin_team_code = " + teamCode +
                    " AND t.create_time >= '" + startDate + "' " +
                    " AND t.create_time <= '" + endDate + "' " +
                    "  AND c.consult = t.id " +
                    "  AND c.patient = s.id " +
                    "  AND p.session_id = t.session_id " +
                    "  AND c.type <> 8" +
                    "  AND c.admin_team_code = " + teamCode +
                    "  AND t.create_time >= '" + startDate + "' " +
                    "  AND t.create_time <= '" + endDate + "' " +
                    ")c ON c.id = m.doctor_code " +
                    " WHERE " +
                    " m.team_id = "  + teamCode +
                    " GROUP BY dateNo";
        } else {
            //按月统计
            sql = "SELECT " +
                    "  (DATE_FORMAT(t.create_time, '%v') - DATE_FORMAT('" + startDate + "', '%v') + 1) AS weekOfMonth, " +
                    "  COUNT(1) AS noRely " +
                    "  FROM " +
            sql = "SELECT" +
                    " (DATE_FORMAT(c.create_time, '%v')- DATE_FORMAT('2017-12-01 00:00:00', '%v')+ 1)AS weekOfMonth, " +
                    " COUNT(1)AS noRely " +
                    " FROM " +
                    " wlyy_admin_team_member m JOIN(" +
                    " SELECT d.id,t.create_time FROM " +
                    "  " + imDataBaseName + ".Topics t, " +
                    "  " + imDataBaseName + ".Participants p, " +
                    "  " + imDataBaseName + ".Doctors d, " +
@ -2547,11 +2574,17 @@ public class StatisticsService extends BaseService {
                    "  AND t.`reply` = 0  " +
                    "  AND t.create_time >= '" + startDate + "' " +
                    "  AND t.create_time <= '" + endDate + "' " +
                    "  GROUP BY weekOfMonth";
            totalSql = "SELECT " +
                    "  (DATE_FORMAT(t.create_time, '%v') - DATE_FORMAT('" + startDate + "', '%v') + 1) AS weekOfMonth, " +
                    "  COUNT(1) AS total " +
                    "  FROM " +
                    ")c ON c.id = m.doctor_code " +
                    " WHERE " +
                    " m.team_id = "  + teamCode +
                    " GROUP BY weekOfMonth";
            totalSql="SELECT" +
                    " (DATE_FORMAT(c.create_time, '%v')- DATE_FORMAT('2017-12-01 00:00:00', '%v')+ 1)AS weekOfMonth, " +
                    " COUNT(1)AS total " +
                    " FROM " +
                    " wlyy_admin_team_member m JOIN(" +
                    " SELECT d.id,t.create_time FROM " +
                    "  " + imDataBaseName + ".Topics t, " +
                    "  " + imDataBaseName + ".Participants p, " +
                    "  " + imDataBaseName + ".Doctors d, " +
@ -2566,7 +2599,10 @@ public class StatisticsService extends BaseService {
                    "  AND c.admin_team_code = " + teamCode +
                    "  AND t.create_time >= '" + startDate + "' " +
                    "  AND t.create_time <= '" + endDate + "' " +
                    "  GROUP BY weekOfMonth";
                    ")c ON c.id = m.doctor_code " +
                    " WHERE " +
                    " m.team_id = "  + teamCode +
                    " GROUP BY weekOfMonth";
        }
        List<Map<String, Object>> noReyList = jdbcTemplate.queryForList(sql);
@ -3170,8 +3206,22 @@ public class StatisticsService extends BaseService {
    }
    public JSONArray getDoctorTeamFolList(String startDate, String endDate, String teamCode, String sort, String sortType) {
        startDate = startDate + " 00:00:00";
        endDate = endDate + " 00:00:00";
        //如果是本月第一天则开始时间为上个月最后一天的下午五点
        Calendar cal = Calendar.getInstance();
        cal.setTime(DateUtil.strToDate(startDate,"yyyy-MM-dd"));
        boolean flag = DateUtil.checkFristDayOfDateMonth(cal);
        if (flag){
            startDate = DateUtil.getNextDay(startDate,-1)+" 17:00:00";
        }else{
            startDate = startDate + " 00:00:00";
        }
        //如果开始时间是当月的最后一天,则到当天的下午五点
        String endStr = DateUtil.getLastDayOfMonthThisDate(DateUtil.strToDate(startDate,"yyyy-MM-dd"));
        if (endStr.equals(endDate)){
            endDate = endDate + " 17:00:00";
        }else{
            endDate = endDate + " 00:00:00";
        }
        String totalSQL = "SELECT " +
                " IFNULL(c.followupCount,0) AS followupCount, " +
                " d.`code` AS doctorCode, " +
@ -3500,8 +3550,22 @@ public class StatisticsService extends BaseService {
    }
    public JSONArray getTeamDoctorResList(String teamCode, String startDate, String endDate, String sort, String sortType) {
        startDate = startDate + " 00:00:00";
        endDate = endDate + " 00:00:00";
        //如果是本月第一天则开始时间为上个月最后一天的下午五点
        Calendar cal = Calendar.getInstance();
        cal.setTime(DateUtil.strToDate(startDate,"yyyy-MM-dd"));
        boolean flag = DateUtil.checkFristDayOfDateMonth(cal);
        if (flag){
            startDate = DateUtil.getNextDay(startDate,-1)+" 17:00:00";
        }else{
            startDate = startDate + " 00:00:00";
        }
        //如果开始时间是当月的最后一天,则到当天的下午五点
        String endStr = DateUtil.getLastDayOfMonthThisDate(DateUtil.strToDate(startDate,"yyyy-MM-dd"));
        if (endStr.equals(endDate)){
            endDate = endDate + " 17:00:00";
        }else{
            endDate = endDate + " 00:00:00";
        }
        String totalSql = "SELECT " +
                " IFNULL(c.reservationCount,0) AS reservationCount, " +
                " d.`code` AS doctorCode, " +
@ -3725,8 +3789,22 @@ public class StatisticsService extends BaseService {
    }
    public JSONArray getTeamGuidList(String teamCode, String startDate, String endDate, String sort, String sortType) {
        startDate = startDate + " 00:00:00";
        endDate = endDate + " 00:00:00";
        //如果是本月第一天则开始时间为上个月最后一天的下午五点
        Calendar cal = Calendar.getInstance();
        cal.setTime(DateUtil.strToDate(startDate,"yyyy-MM-dd"));
        boolean flag = DateUtil.checkFristDayOfDateMonth(cal);
        if (flag){
            startDate = DateUtil.getNextDay(startDate,-1)+" 17:00:00";
        }else{
            startDate = startDate + " 00:00:00";
        }
        //如果开始时间是当月的最后一天,则到当天的下午五点
        String endStr = DateUtil.getLastDayOfMonthThisDate(DateUtil.strToDate(startDate,"yyyy-MM-dd"));
        if (endStr.equals(endDate)){
            endDate = endDate + " 17:00:00";
        }else{
            endDate = endDate + " 00:00:00";
        }
        String totalSql = "SELECT " +
                " IFNULL(c.guidanceCount,0) AS guidanceCount, " +
                " d.`code` AS doctorCode, " +
@ -3944,8 +4022,22 @@ public class StatisticsService extends BaseService {
    }
    public JSONArray getTeamEduList(String teamCode, String startDate, String endDate, String sort, String sortType) {
        startDate = startDate + " 00:00:00";
        endDate = endDate + " 00:00:00";
        //如果是本月第一天则开始时间为上个月最后一天的下午五点
        Calendar cal = Calendar.getInstance();
        cal.setTime(DateUtil.strToDate(startDate,"yyyy-MM-dd"));
        boolean flag = DateUtil.checkFristDayOfDateMonth(cal);
        if (flag){
           startDate = DateUtil.getNextDay(startDate,-1)+" 17:00:00";
        }else{
            startDate = startDate + " 00:00:00";
        }
        //如果开始时间是当月的最后一天,则到当天的下午五点
        String endStr = DateUtil.getLastDayOfMonthThisDate(DateUtil.strToDate(startDate,"yyyy-MM-dd"));
        if (endStr.equals(endDate)){
            endDate = endDate + " 17:00:00";
        }else{
            endDate = endDate + " 00:00:00";
        }
        String totalSql = "SELECT " +
                " IFNULL(c.articleCount,0) AS articleCount, " +
                " IFNULL(c.batchno,0) AS batchno, " +
@ -5120,11 +5212,7 @@ public class StatisticsService extends BaseService {
        if (interval==1){
            sql = "SELECT count(1) AS count,LEFT(p.create_time,10) date  FROM wlyy_prescription p ";
            rs = DateUtil.findDates(startDate,endDate);
            //加入当天数据
            Map<String,Object> dateMap = new HashedMap();
            dateMap.put("date",sdf.format(endDate));
            dateMap.put("count", 0.0D);
            rs.add(dateMap);
            startTime = DateUtil.dateToStr(startDate, "YYYY-MM-dd HH:mm:ss");
            endTime = DateUtil.dateToStr(endDate, "YYYY-MM-dd HH:mm:ss");
        }

+ 106 - 58
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/statisticsES/StatisticsESService.java

@ -1315,7 +1315,12 @@ public class StatisticsESService {
        }
        if (resultList != null) {
            String signTaskNum = systemDictService.getDictValueNoRedis("SIGN_TASKNUM_17", year);//目标量
            String signTaskNum = "";
            if ("3".equals(lowCode)){
                signTaskNum = systemDictService.getDictValueNoRedis("SIGN_TASKNUM_17_65", year);//2017年65岁以上的目标量
            }else{
                signTaskNum = systemDictService.getDictValueNoRedis("SIGN_TASKNUM_17", year);//目标量
            }
            String signRegulationNum = systemDictService.getDictValueNoRedis("SIGN_TEAM_REGULATION_NUM", year);//调控量
            DecimalFormat df = new DecimalFormat("0.0000");
            for (Map<String, Object> map : resultList) {
@ -2377,48 +2382,65 @@ public class StatisticsESService {
        Integer interval = Integer.parseInt(type) + 1;
        List<SaveModel> articleCountList = elasticsearchUtil.findLineChartDateQuotaLevel0(startDate,endDate,teamCode,Integer.valueOf(SaveModel.teamLevel),"59",SaveModel.timeLevel_ZL,String.valueOf(interval));
        List<SaveModel> batchNoCountList = elasticsearchUtil.findLineChartDateQuotaLevel0(startDate,endDate,teamCode,Integer.valueOf(SaveModel.teamLevel),"71",SaveModel.timeLevel_ZL,String.valueOf(interval));
        List<Map<String, Object>> list = new ArrayList<>();
        if(articleCountList!=null){
            //循环人数集合
            for (SaveModel one1:articleCountList){
                String date = "";
                if(one1.getQuotaDate()!=null){
                    date=dateFormat.format(one1.getQuotaDate());
                }
                if (one1.getResult2().intValue()!=0){
                    Map<String,Object> map = new HashedMap();
                    map.put("articleCount",one1.getResult2().intValue());
                    //查看批次集合里是否有同时间的数据
                    for (SaveModel one2:batchNoCountList) {
                        if (one2.getQuotaDate()!=null && dateFormat.format(one2.getQuotaDate()).equals(date)){
                            map.put("batchCount",one2.getResult2().intValue());
                        }
                    }
                    if ("0".equals(type)) {
                        map.put("dateNo",date);
                    } else {
                        map.put("weekOfMonth", DateUtil.getWeekOfMonth(date));
        //List<Map<String, Object>> list = new ArrayList<>();
        Map<String,Object> articleMap = new HashedMap();
        Map<String,Object> batchMap = new HashedMap();
        //把list转换成 map
        if (articleCountList!=null && articleCountList.size()>0){
            articleCountList.stream().forEach(one1->{
                articleMap.put(dateFormat.format(one1.getQuotaDate()),one1);
            });
        }
        if (batchNoCountList!=null && batchNoCountList.size()>0){
            batchNoCountList.stream().forEach(one2->{
                batchMap.put(dateFormat.format(one2.getQuotaDate()),one2);
            });
        }
        //获取结果集
        List<Map<String, Object>> resultList = DateUtil.findDateASWeeks(dateFormat.parse(startDate),dateFormat.parse(endDate));
        String MondayWeekDateStr = DateUtil.getMondayOfThisDate(dateFormat.parse(startDate));
        Date MondayWeekDate = DateUtil.strToDate(MondayWeekDateStr,"yyyy-MM-dd");
        if (dateFormat.parse(startDate).after(MondayWeekDate)){
            //开始时间不是当周的周一,则加入本周周一的时间
            Map<String,Object> dateMap = new HashedMap();
            dateMap.put("date",MondayWeekDateStr);
            dateMap.put("count", 0.0D);
            resultList.add(0,dateMap);
        }
        if (resultList!=null && resultList.size()>0){
            for (Map<String, Object> reMap : resultList) {
                //设置时间
                if ("0".equals(type)) {
                    reMap.put("dateNo",dateFormat.format(reMap.get("date")));
                } else {
                    if (dateFormat.parse(String.valueOf(reMap.get("date"))).before(dateFormat.parse(startDate))){
                        reMap.put("weekOfMonth", 1);
                    }else{
                        reMap.put("weekOfMonth", DateUtil.getWeekOfMonth(String.valueOf(reMap.get("date"))));
                    }
                    list.add(map);
                }
                //放置新增发送人数和批次
                SaveModel one1 = (SaveModel) articleMap.get(reMap.get("date"));
                SaveModel one2 = (SaveModel) batchMap.get(reMap.get("date"));
                if (one1!=null){
                    reMap.put("articleCount",one1.getResult2().intValue());
                }else{
                    //循环批次
                    for (SaveModel one2:batchNoCountList) {
                        if (one2.getResult2().intValue()!=0 && one2.getQuotaDate()!=null && dateFormat.format(one2.getQuotaDate()).equals(date)){
                            Map<String,Object> map = new HashedMap();
                            map.put("articleCount",0);
                            map.put("batchCount",one2.getResult2().intValue());
                            if ("0".equals(type)) {
                                map.put("dateNo",dateFormat.format(date));
                            } else {
                                map.put("weekOfMonth", DateUtil.getWeekOfMonth(date));
                            }
                            list.add(map);
                        }
                    }
                    reMap.put("articleCount",0);
                }
                if (one2!=null){
                    reMap.put("batchCount",one2.getResult2().intValue());
                }else{
                    reMap.put("batchCount",0);
                }
                //去除多余的key
                reMap.remove("count");
                reMap.remove("avg");
                reMap.remove("date");
            }
        }
        return new JSONArray(list);
        return new JSONArray(resultList);
    }
    public JSONObject getRenewPercentAndChangePercent(String index, Integer level, String area, String year, String lowCode) {
@ -2982,7 +3004,7 @@ public class StatisticsESService {
                if ("0".equals(type)) {
                    map.put("applyDate", dateFormat.format(saveModel.getQuotaDate()));
                } else {
                    map.put("applyDate", dateFormat.format(saveModel.getQuotaDate()));
                    map.put("weekOfMonth", DateUtil.getWeekOfMonth(saveModel.getQuotaDate()));
                }
                map.put("signCount", saveModel.getResult2().longValue());
                rs.add(map);
@ -3060,7 +3082,7 @@ public class StatisticsESService {
                if ("0".equals(type)) {
                    map.put("dateNo", dateFormat.format(one.getQuotaDate()));
                } else {
                    map.put("weekNo", dateFormat.format(one.getQuotaDate()));
                    map.put("weekOfMonth", DateUtil.getWeekOfMonth(dateFormat.format(one.getQuotaDate())));
                }
                map.put("avgCount", avgCountStr);
                rs.add(map);
@ -3144,7 +3166,11 @@ public class StatisticsESService {
                if ("0".equals(type)) {
                    map.put("dateNo", dateFormat.format(one.getQuotaDate()));
                } else {
                    map.put("weekOfMonth", DateUtil.getWeekOfMonth(dateFormat.format(one.getQuotaDate())));
                    if (one.getQuotaDate().before(dateFormat.parse(startDate))){
                        map.put("weekOfMonth", 1);
                    }else{
                        map.put("weekOfMonth", DateUtil.getWeekOfMonth(dateFormat.format(one.getQuotaDate())));
                    }
                }
                map.put("followupCount", one.getResult2().intValue());
                totalList.add(map);
@ -3158,7 +3184,11 @@ public class StatisticsESService {
                if ("0".equals(type)) {
                    map.put("dateNo", dateFormat.format(one.getQuotaDate()));
                } else {
                    map.put("weekOfMonth", DateUtil.getWeekOfMonth(dateFormat.format(one.getQuotaDate())));
                    if (one.getQuotaDate().before(dateFormat.parse(startDate))){
                        map.put("weekOfMonth", 1);
                    }else{
                        map.put("weekOfMonth", DateUtil.getWeekOfMonth(dateFormat.format(one.getQuotaDate())));
                    }
                }
                map.put("planCount", one.getResult2().intValue());
                planList.add(map);
@ -3189,16 +3219,21 @@ public class StatisticsESService {
        Map<String, Object> map = null;
        List<Map<String, Object>> totalList = new ArrayList<>();
        for (SaveModel one : list) {
            if (one.getResult2().intValue()!=0){
                map = new HashMap<>();
                if ("0".equals(type)) {
                    map.put("dateNo", dateFormat.format(one.getQuotaDate()));
                } else {
            /*if (one.getResult2().intValue()!=0){
            }*/
            map = new HashMap<>();
            if ("0".equals(type)) {
                map.put("dateNo", dateFormat.format(one.getQuotaDate()));
            } else {
                if (one.getQuotaDate().before(dateFormat.parse(startDate))){
                    map.put("weekOfMonth","1");
                }else{
                    map.put("weekOfMonth", DateUtil.getWeekOfMonth(dateFormat.format(one.getQuotaDate())));
                }
                map.put("reservationCount", one.getResult2().longValue());
                totalList.add(map);
            }
            map.put("reservationCount", one.getResult2().longValue());
            totalList.add(map);
        }
        return new JSONArray(totalList);
    }
@ -3368,16 +3403,21 @@ public class StatisticsESService {
        Map<String, Object> map = null;
        List<Map<String, Object>> totalList = new ArrayList<>();
        for (SaveModel one : list) {
            if (one.getResult2().intValue()!=0){
                map = new HashMap<>();
                if ("0".equals(type)) {
                    map.put("dateNo", dateFormat.format(one.getQuotaDate()));
                } else {
           /* if (one.getResult2().intValue()!=0){
            }*/
            map = new HashMap<>();
            if ("0".equals(type)) {
                map.put("dateNo", dateFormat.format(one.getQuotaDate()));
            } else {
                if (one.getQuotaDate().before(dateFormat.parse(startDate))){
                    map.put("weekOfMonth", 1);
                }else{
                    map.put("weekOfMonth", DateUtil.getWeekOfMonth(dateFormat.format(one.getQuotaDate())));
                }
                map.put("guidanceCount", one.getResult2().longValue());
                totalList.add(map);
            }
            map.put("guidanceCount", one.getResult2().longValue());
            totalList.add(map);
        }
        return new JSONArray(totalList);
    }
@ -3406,7 +3446,11 @@ public class StatisticsESService {
            if ("0".equals(type)) {
                map.put("dateNo", dateFormat.format(one.getQuotaDate()));
            } else {
                map.put("weekOfMonth", DateUtil.getWeekOfMonth(dateFormat.format(one.getQuotaDate())));
                if (one.getQuotaDate().before(dateFormat.parse(startDate))){
                    map.put("weekOfMonth", 1);
                }else{
                    map.put("weekOfMonth", DateUtil.getWeekOfMonth(dateFormat.format(one.getQuotaDate())));
                }
            }
            map.put("inCount", one.getResult2().longValue());
            inList.add(map);
@ -3420,7 +3464,11 @@ public class StatisticsESService {
            if ("0".equals(type)) {
                map.put("dateNo", dateFormat.format(one.getQuotaDate()));
            } else {
                map.put("weekOfMonth", DateUtil.getWeekOfMonth(dateFormat.format(one.getQuotaDate())));
                if (one.getQuotaDate().before(dateFormat.parse(startDate))){
                    map.put("weekOfMonth", 1);
                }else{
                    map.put("weekOfMonth", DateUtil.getWeekOfMonth(dateFormat.format(one.getQuotaDate())));
                }
            }
            map.put("outCount", one.getResult2().longValue());
            outList.add(map);

+ 24 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/team/AdminTeamService.java

@ -237,6 +237,30 @@ public class AdminTeamService extends BaseService {
        return memberDao.findDoctorTeams(doctorCode);
    }
    /**
     * 获取行政团队,包括团队签约人数
     * @param doctorCode
     * @return
     */
    public com.alibaba.fastjson.JSONArray getAdminTeamSignCount(String doctorCode){
        List<AdminTeam> adminTeams = memberDao.findDoctorTeams(doctorCode);
        com.alibaba.fastjson.JSONArray re = new com.alibaba.fastjson.JSONArray();
        for(AdminTeam one:adminTeams){
            //获取团队签约数
            Integer signCount = signFamilyDao.findByAdminTeamIdAndStatus(one.getId(),0);
            com.alibaba.fastjson.JSONObject json = new com.alibaba.fastjson.JSONObject();
            json.put("id",one.getId());
            json.put("name",one.getName());
            json.put("createTime",one.getCreateTime());
            json.put("leaderCode",one.getLeaderCode());
            json.put("available",one.isAvailable());
            json.put("orgCode",one.getOrgCode());
            json.put("signCount",signCount);
            re.add(json);
        }
        return re;
    }
    /**
     * 获取行政团队
     * @param doctorCode

+ 16 - 10
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/common/QrcodeService.java

@ -11,6 +11,7 @@ import com.yihu.wlyy.util.HttpUtil;
import org.apache.commons.lang3.StringUtils;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -37,6 +38,8 @@ public class QrcodeService extends BaseService {
    private TownDao townDao;
    @Autowired
    private HttpUtil HttpUtil;
    @Value("${server.server_url}")
    private String server_url;
    /**
     * 所有医生二维码生成
@ -263,8 +266,7 @@ public class QrcodeService extends BaseService {
                    doctorLevel = "全科医生";
                } else if (doctor.getLevel() == 3) {
                    doctorLevel = "健康管理师";
                }
                else{
                } else {
                    doctorLevel = "未知";
                }
@ -433,9 +435,9 @@ public class QrcodeService extends BaseService {
    /**
     * 从微信生成二维码并下载到本地
     *
     * @param content 场景值
     * @param content  场景值
     * @param fileName 二维码文件名
     * @param path 生成二维码路径
     * @param path     生成二维码路径
     * @param token
     * @throws IOException
     */
@ -502,10 +504,14 @@ public class QrcodeService extends BaseService {
    /**
     * 从微信生成永久二维码(供第三方调用)
     *  文件不存在才会新建
     * 文件不存在才会新建
     *
     * @param content
     * @param fileName
     * @param path
     * @param token
     * @throws IOException
     * @return 返回服务器地址
     * @throws Exception
     */
    public String getQrcodeFromWeiXin(String content, String fileName, String path, String token) throws Exception {
        try {
@ -514,10 +520,11 @@ public class QrcodeService extends BaseService {
            String result = HttpUtil.sendPost(token_url, params);
            if (!StringUtils.isEmpty(result)) {
                String absPath = "qrcode" + File.separator + fileName + ".png";
                JSONObject json = new JSONObject(result);
                if (json.has("ticket")) {
                    String file = path + File.separator + fileName + ".png";
                    String file = path + File.separator + absPath;
                    // 保存路径
                    File pathFile = new File(path);
                    // 保存文件
@ -528,8 +535,7 @@ public class QrcodeService extends BaseService {
                    }
                    // 文件已存在则返回已存在的路径
                    if (outputFile.exists()) {
//                        outputFile.delete();
                        return file;
                        return server_url + absPath;
                    }
                    // 请求输入流
                    InputStream inputStream = null;
@ -556,7 +562,7 @@ public class QrcodeService extends BaseService {
                        outputStream.close();
                    }
                    return file;
                    return server_url + absPath;
                } else {
                    throw new Exception("请求微信生成二维码失败!");
                }

+ 1 - 4
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/weixin/wxpay/service/OnePayService.java

@ -718,11 +718,8 @@ public class OnePayService {
                //保存到患者表
                Patient p = patientDao.findByCode(patient);
//                if(!"undefined".equals(openid)&&StringUtils.isNotBlank(openid)){
//                    p.setOpenid(openid);
//                }
//            增加绑定电子社保卡信息
                if (p.getSicardStatus()!=null && p.getSicardStatus()!=1){
                if (p.getSicardTime() == null){
                    p.setSicardTime(new Date());
                }
                patientDao.save(p);

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

@ -121,6 +121,7 @@ public class LoginController extends BaseController {
        loginLog.setPhone(mobile);
        loginLog.setType("2");
        loginLog.setUserType("2");
        loginLog.setPlatform(platform);
        loginLog.setAppVersion(super.getAppVersion());
        try {
            if (StringUtils.isEmpty(getIMEI())) {

+ 46 - 6
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/jimeiJkEdu/DoctorJMJkEduArticleController.java

@ -253,7 +253,7 @@ public class DoctorJMJkEduArticleController extends BaseController {
     * @param firstLevelCategoryId
     * @param secondLevelCategoryId
     * @param insertTimeStart
     * @param insertTimeEnd
     * @param insertTimeEnds
     * @param articlelevel
     * @param articleTitle
     * @return
@ -272,10 +272,10 @@ public class DoctorJMJkEduArticleController extends BaseController {
                                      @RequestParam(value = "articlelevel", required = false) String articlelevel,
                                      @ApiParam(name = "articleTitle", value = "文章标题关键字")
                                      @RequestParam(value = "articleTitle", required = false) String articleTitle,
//                                      @ApiParam(name = "currentUserRole", value = "当前登录的角色")
//                                      @RequestParam(value = "currentUserRole", required = true) String currentUserRole,
//                                      @ApiParam(name = "currentUserRoleLevel", value = "当前登录的角色级别")
//                                      @RequestParam(value = "currentUserRoleLevel", required = true )String currentUserRoleLevel,
                                      @ApiParam(name = "currentUserRole", value = "当前登录的角色")
                                      @RequestParam(value = "currentUserRole", required = true) String currentUserRole,
                                      @ApiParam(name = "currentUserRoleLevel", value = "当前登录的角色级别",defaultValue = "4")
                                      @RequestParam(value = "currentUserRoleLevel", required = false ,defaultValue = "4")String currentUserRoleLevel,
                                      @ApiParam(name = "isAuthentication", value = "是否认证")
                                      @RequestParam(value = "isAuthentication", required = false) String isAuthentication,
                                      @ApiParam(name = "isMyArticle", value = "是否过滤我的文章")
@ -287,8 +287,9 @@ public class DoctorJMJkEduArticleController extends BaseController {
        try {
            
            
            JSONObject response = jmJkEduArticleService.queryArticlePcList(firstLevelCategoryId,secondLevelCategoryId,insertTimeStart,insertTimeEnd,articlelevel,articleTitle,
                    getUID(),getCurrentRoleCode(),getCurrentRoleLevel(),isAuthentication,isMyArticle,page,pageSize);
                    getUID(),currentUserRole,currentUserRoleLevel,isAuthentication,isMyArticle,page,pageSize);
            
            return write(200,"查询成功!","data",response);
        } catch (Exception e){
@ -296,6 +297,45 @@ public class DoctorJMJkEduArticleController extends BaseController {
            return error(-1,"查询失败!");
        }
    }
    
    @RequestMapping(value = "saveArticle", method = RequestMethod.POST)
    @ApiOperation("添加文章")
    public  String saveArticle(@ApiParam(name = "articleId", value = "文章Id")
                               @RequestParam(value = "articleId", required = false) String articleId,
                               @ApiParam(name = "articleTitle", value = "文章标题")
                               @RequestParam(value = "articleTitle", required = true) String articleTitle,
                               @ApiParam(name = "articleType", value = "文章类型")
                               @RequestParam(value = "articleType", required = true) String articleType,
                               @ApiParam(name = "articlelevel", value = "文章级别")
                               @RequestParam(value = "articlelevel", required = true) Integer articlelevel,
                               @ApiParam(name = "secondLevelCategoryId", value = "文章二级分类id")
                               @RequestParam(value = "secondLevelCategoryId", required = true) String secondLevelCategoryId,
                               @ApiParam(name = "secondLevelCategoryName", value = "文章二级分类名称")
                               @RequestParam(value = "secondLevelCategoryName", required = true) String secondLevelCategoryName,
                               @ApiParam(name = "firstLevelCategoryId", value = "文章一级分类id")
                               @RequestParam(value = "firstLevelCategoryId", required = true) String firstLevelCategoryId,
                               @ApiParam(name = "firstLevelCategoryName", value = "文章一级分类名称")
                               @RequestParam(value = "firstLevelCategoryName", required = true) String firstLevelCategoryName,
                               @ApiParam(name = "content", value = "文章内容")
                               @RequestParam(value = "content", required = true) String content,
                               @ApiParam(name = "imageUrl", value = "文章封面图片地址")
                               @RequestParam(value = "imageUrl", required = true) String imageUrl,
                               @ApiParam(name = "currentUserRole", value = "当前登录的角色")
                               @RequestParam(value = "currentUserRole", required = true) String currentUserRole,
                               @ApiParam(name = "currentUserRoleLevel", value = "当前登录的角色级别",defaultValue = "4")
                               @RequestParam(value = "currentUserRoleLevel", required = false ,defaultValue = "4")String currentUserRoleLevel,
                               @ApiParam(name = "userScope", value = "使用范围(1、全市使用,2、全区使用,3、全社区使用)")
                               @RequestParam(value = "userScope", required = true) Integer userScope){
        
        try {
            jmJkEduArticleService.saveArticle(getUID(),articleTitle,articleType,articlelevel,secondLevelCategoryId,imageUrl,
                    secondLevelCategoryName,firstLevelCategoryId,firstLevelCategoryName,content,currentUserRole,currentUserRoleLevel,userScope,articleId);
            return success("添加成功!");
        }catch (Exception e){
            e.printStackTrace();
            return error(-1,"添加失败!");
        }
    }
    /*************************************************************************医生角色end***************************************************************************************************/

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

@ -20,7 +20,7 @@ import org.springframework.web.bind.annotation.RestController;
 */
@RestController
@RequestMapping(value = "/doctor/prenatalnspector", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@Api(description = "居民端-产检")
@Api(description = "医生端-产检")
public class PrenatalController extends BaseController{
    @Autowired

+ 11 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/team/AdminTeamController.java

@ -273,6 +273,17 @@ public class AdminTeamController extends BaseController {
        }
    }
    @RequestMapping(value = "/team/{doctor_code}/adminteams", method = RequestMethod.GET)
    @ApiOperation(value = "获取医生团队列表(包括团队签约人数)")
    public String getAdminTeamSignCount(@PathVariable("doctor_code") String doctorCode) {
        try {
            return write(200, "OK", "data", teamService.getAdminTeamSignCount(doctorCode));
        } catch (Exception e) {
            error(e);
            return error(-1, e.getMessage());
        }
    }
    @RequestMapping(value = "/team/{doctor_code}/teamsLimit", method = RequestMethod.GET)
    @ApiOperation(value = "获取医生团队列表(获取基位签约上线)")
    public String getDoctorTeamLimit(@PathVariable("doctor_code") String doctorCode){

+ 2 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/statistic/EsStatisticsController.java

@ -901,7 +901,7 @@ public class EsStatisticsController extends BaseController {
                                   @RequestParam(required = true) String isNow) {
        try {
            return write(200, "查询成功", "data", statisticsService.getReyStatbyTeamNow(getUID(), startDate, endDate, isNow));
            //return write(200, "查询成功", "data", statisticsESService.getReyStatbyTeamNow("xh1D2017031502222",startDate,endDate,isNow));
            //return write(200, "查询成功", "data", statisticsService.getReyStatbyTeamNow("xh1D2017031502222",startDate,endDate,isNow));
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败");
@ -1363,7 +1363,7 @@ public class EsStatisticsController extends BaseController {
    }
    /**
     * 获取团队健康
     * 获取团队健康.
     *
     * @param teamCode
     * @param startDate

+ 5 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/jkEduArticle/ThirdJkEduArticleController.java

@ -1,17 +1,16 @@
package com.yihu.wlyy.web.third.jkEduArticle;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yihu.wlyy.aop.ObserverRequired;
import com.yihu.wlyy.service.third.jkEduArticle.ThirdJkEduArticleService;
import com.yihu.wlyy.web.BaseController;
import com.yihu.wlyy.web.third.gateway.service.GcEduArticleService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.jms.core.JmsTemplate;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
@ -252,6 +251,10 @@ public class ThirdJkEduArticleController extends BaseController {
                }
                if(StringUtils.isNotBlank(cid)){
                    response = thirdJkEduArticleService.getCategoryList(2,cid,"");
                    com.alibaba.fastjson.JSONObject  result =  new JSONObject();
                    result.put("cid",cid);
                    result.put("list",response);
                    return write(200,"查询成功!","data",result);
                }else{
                    response = new JSONArray();
                }

+ 1 - 3
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/ylzpay/ThirdQrcodeController.java

@ -28,8 +28,6 @@ import java.io.File;
@Api(description = "供第三方微信类相关业务调用")
public class ThirdQrcodeController extends WeixinBaseController {
    @Value("${server.server_url}")
    private String server_url;
    @Autowired
    private QrcodeService qrcodeService;
@ -46,7 +44,7 @@ public class ThirdQrcodeController extends WeixinBaseController {
    public String getQrcode(@ApiParam(name = "scene", defaultValue = "") @RequestParam(value = "scene", required = true) String scene) throws Exception {
        try {
            String content = "wechat_" + scene;
            String path = server_url + File.separator + "qrcode";
            String path = ThirdQrcodeController.class.getResource("/").getPath().replace("/WEB-INF/classes/", "");
            // 通过微信接口生成医生二维码
            String result = qrcodeService.getQrcodeFromWeiXin(content, content.replaceAll("\r\n", ""), path, getAccessToken());
            return write(200, "生成二维码成功!", "data", result);