Selaa lähdekoodia

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

trick9191 7 vuotta sitten
vanhempi
commit
728b333271
49 muutettua tiedostoa jossa 1737 lisäystä ja 621 poistoa
  1. 31 0
      common/common-entity/src/main/java/com/yihu/wlyy/entity/feedback/Appeal.java
  2. 50 3
      common/common-entity/src/main/java/com/yihu/wlyy/entity/feedback/Feedback.java
  3. 6 6
      common/common-entity/src/main/java/com/yihu/wlyy/entity/followup/FollowupDrugs.java
  4. 2 157
      common/common-entity/src/main/java/com/yihu/wlyy/entity/job/QuartzJobConfig.java
  5. 1 1
      common/common-entity/src/main/java/com/yihu/wlyy/entity/message/SMS.java
  6. 1 1
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/controller/manager/appeal/AppealController.java
  7. 20 3
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/controller/manager/feedback/FeedbackController.java
  8. 1 1
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/entity/SMS.java
  9. 32 0
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/entity/feedback/Appeal.java
  10. 43 1
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/entity/feedback/Feedback.java
  11. 54 5
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/manager/feedback/AppealService.java
  12. 14 0
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/manager/feedback/FeedbackService.java
  13. 20 8
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/util/DateUtil.java
  14. 6 6
      patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/entity/FollowupDrugs.java
  15. 3 0
      patient-co-service/wlyy_sign/src/main/java/com/yihu/wlyy/sign/dao/SignFamilyRenewLogDao.java
  16. 9 1
      patient-co-service/wlyy_sign/src/main/java/com/yihu/wlyy/sign/service/ChargeZYService.java
  17. 1 1
      patient-co/patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/etl/compute/ComputeHelper.java
  18. 23 8
      patient-co/patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/service/ExtractDataService.java
  19. 8 8
      patient-co/patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/util/Contant.java
  20. 3 3
      patient-co/patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/vo/SaveModel.java
  21. 2 2
      patient-co/patient-co-statistics-es/src/main/resources/application-prod.yml
  22. 1 1
      patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/service/app/followup/FollowupDrugsService.java
  23. 9 7
      patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/service/third/jw/JwPrescriptionService.java
  24. 10 0
      patient-co/patient-co-wlyy/pom.xml
  25. 2 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/config/SwaggerConfig.java
  26. 9 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/feedback/AppealDao.java
  27. 9 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/feedback/FeedbackDao.java
  28. 81 6
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/feedback/AppealService.java
  29. 50 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/feedback/FeedbackService.java
  30. 1 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/followup/FollowupDrugsService.java
  31. 3 2
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/physicalExamination/PhysicalExaminationRemindService.java
  32. 8 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/statistics/StatisticsService.java
  33. 412 42
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/statisticsES/StatisticsESService.java
  34. 22 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/util/DateUtil.java
  35. 1 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/util/ElasticsearchUtil.java
  36. 418 243
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/FileUploadController.java
  37. 120 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/feedback/DoctorAppealController.java
  38. 28 35
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/feedback/DoctorFeedbackController.java
  39. 2 2
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/patient/PyhsicExamRemindController.java
  40. 120 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/feedback/PatientAppealController.java
  41. 33 51
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/feedback/PatientFeedbackController.java
  42. 37 14
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/statistic/EsStatisticsController.java
  43. 1 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/statistic/StatisticsController.java
  44. 5 0
      patient-co/patient-co-wlyy/src/main/resources/application-dev.yml
  45. 5 0
      patient-co/patient-co-wlyy/src/main/resources/application-devtest.yml
  46. 4 0
      patient-co/patient-co-wlyy/src/main/resources/application-local.yml
  47. 5 0
      patient-co/patient-co-wlyy/src/main/resources/application-localtest.yml
  48. 5 0
      patient-co/patient-co-wlyy/src/main/resources/application-prod.yml
  49. 6 1
      patient-co/patient-co-wlyy/src/main/resources/application-test.yml

+ 31 - 0
common/common-entity/src/main/java/com/yihu/wlyy/entity/feedback/Appeal.java

@ -1,10 +1,12 @@
package com.yihu.wlyy.entity.feedback;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yihu.wlyy.entity.IdEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;
/**
 * Created by Reece on 2017/5/6.
@ -24,6 +26,9 @@ public class Appeal extends IdEntity {
    private String images;
    //    联系手机号
    private String phone;
    private String name;//申诉人姓名
    private String idcard;//申诉人身份证
    private Date createTime;//申诉时间
    //    状态 0、未读 1、待处理  2、已处理
    private int status;
    //    '处理结果'
@ -141,4 +146,30 @@ public class Appeal extends IdEntity {
    public void setIdentity(int identity) {
        this.identity = identity;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public String getIdcard() {
        return idcard;
    }
    public void setIdcard(String idcard) {
        this.idcard = idcard;
    }
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    @Column(name = "create_time")
    public Date getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
}

+ 50 - 3
common/common-entity/src/main/java/com/yihu/wlyy/entity/feedback/Feedback.java

@ -1,8 +1,12 @@
package com.yihu.wlyy.entity.feedback;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yihu.wlyy.entity.IdEntity;
import javax.persistence.*;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;
/**
 * Created by Reece on 2017/5/6.
@ -21,7 +25,7 @@ public class Feedback extends IdEntity{
//    反馈人身份 1、患者  2、医生
    @Column(name="identity")
    private  int identity;
    private Integer identity;
//    问题描述
    @Column(name="description")
@ -39,7 +43,7 @@ public class Feedback extends IdEntity{
    @Column(name="contact")
    private String contact;
//    状态 0、未读 1、已读
//  状态 0、未读 1、待处理  2、已处理
    @Column(name="status")
    private int status;
@ -51,6 +55,11 @@ public class Feedback extends IdEntity{
    @Column(name="creater_name")
    private String createrName;
    private String phone; //    '手机号'
    private String result; //    '处理结果'
    private String idcard;//反馈人身份证
    private Date createTime;//反馈时间
    public Integer getDel() {
        return del;
    }
@ -146,4 +155,42 @@ public class Feedback extends IdEntity{
    public void setStatus(int status) {
        this.status = status;
    }
    public void setIdentity(Integer identity) {
        this.identity = identity;
    }
    public String getIdcard() {
        return idcard;
    }
    public void setIdcard(String idcard) {
        this.idcard = idcard;
    }
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    @Column(name = "create_time")
    public Date getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    public String getResult() {
        return result;
    }
    public void setResult(String result) {
        this.result = result;
    }
    public String getPhone() {
        return phone;
    }
    public void setPhone(String phone) {
        this.phone = phone;
    }
}

+ 6 - 6
common/common-entity/src/main/java/com/yihu/wlyy/entity/followup/FollowupDrugs.java

@ -26,7 +26,7 @@ public class FollowupDrugs extends IdEntity {
	//药品分组(糖尿病--胰岛特殊处理)
	private String drugsGroup;
	//次剂量
	private Double dose;
	private String dose;
	//用药单位【字典MEASURE_UNIT_DICT】
	private String unit;
	//用药频率【字典RECIPE_FREQUENCY_DICT】
@ -65,15 +65,15 @@ public class FollowupDrugs extends IdEntity {
	public void setDrugsGroup(String drugsGroup) {
		this.drugsGroup = drugsGroup;
	}
	public Double getDose() {
	
	public String getDose() {
		return dose;
	}
	public void setDose(Double dose) {
	
	public void setDose(String dose) {
		this.dose = dose;
	}
	
	public String getUnit() {
		return unit;
	}

+ 2 - 157
common/common-entity/src/main/java/com/yihu/wlyy/entity/job/QuartzJobConfig.java

@ -14,117 +14,7 @@ import org.hibernate.annotations.GenericGenerator;
@Table(name = "wlyy_job_config")
public class QuartzJobConfig implements java.io.Serializable {
    /*private String id;
    private String quotaId;//指标id
    private String jobName;//任务名称
    private String jobInfo;//任务描述
    private String jobType;//任务类型(0--单次执行  1--周期执行 2--监听任务)
    private String jobClass;//任务执行的class
    private String quartzCron;//quartz表达式
    private String status;//1 启动 0停止
    private String del;//是否删除 1正常 0删除
    *//** minimal constructor *//*
    public QuartzJobConfig() {
    }
    *//** full constructor *//*
    public QuartzJobConfig(String jobName, String jobInfo, String jobType,
                           String jobClass, String quartzCron, String status) {
        this.jobName = jobName;
        this.jobInfo = jobInfo;
        this.jobType = jobType;
        this.jobClass = jobClass;
        this.quartzCron = quartzCron;
        this.status = status;
    }
    // Property accessors
    @GenericGenerator(name = "generator", strategy = "uuid")
    @Id
    @GeneratedValue(generator = "generator")
    @Column(name = "id", unique = true, nullable = false, length = 50)
    public String getId() {
        return this.id;
    }
    public void setId(String id) {
        this.id = id;
    }
    @Column(name = "job_name", length = 50)
    public String getJobName() {
        return this.jobName;
    }
    public void setJobName(String jobName) {
        this.jobName = jobName;
    }
    @Column(name = "job_info", length = 200)
    public String getJobInfo() {
        return this.jobInfo;
    }
    public void setJobInfo(String jobInfo) {
        this.jobInfo = jobInfo;
    }
    @Column(name = "job_type", length = 10)
    public String getJobType() {
        return this.jobType;
    }
    public void setJobType(String jobType) {
        this.jobType = jobType;
    }
    @Column(name = "job_class", length = 200)
    public String getJobClass() {
        return jobClass;
    }
    public void setJobClass(String jobClass) {
        this.jobClass = jobClass;
    }
    @Column(name = "quartz_cron", length = 200)
    public String getQuartzCron() {
        return this.quartzCron;
    }
    public void setQuartzCron(String quartzCron) {
        this.quartzCron = quartzCron;
    }
    @Column(name = "status", length = 1)
    public String getStatus() {
        return this.status;
    }
    public void setStatus(String status) {
        this.status = status;
    }
    @Column(name = "quota_id", length = 50)
    public String getQuotaId() {
        return quotaId;
    }
    public void setQuotaId(String quotaId) {
        this.quotaId = quotaId;
    }
    @Column(name = "del", length = 1)
    public String getDel() {
        return del;
    }
    public void setDel(String del) {
        this.del = del;
    }*/
    private String id;
	private String id;
	private String quotaId;//指标id
	private String jobName;//任务名称
	private String jobInfo;//任务描述
@ -133,11 +23,6 @@ public class QuartzJobConfig implements java.io.Serializable {
	private String quartzCron;//quartz表达式
	private String status;//1 启动 0停止
	private String del;//是否删除 1正常 0删除
	private String sql;
	private String sqlCount;
	private String sqlDay;
	private String sqlYear;
	private String cacheKey;//缓存的key
	/** minimal constructor */
	public QuartzJobConfig() {
@ -146,7 +31,7 @@ public class QuartzJobConfig implements java.io.Serializable {
	/** full constructor */
	public QuartzJobConfig(String jobName, String jobInfo, String jobType,
                           String jobClass, String quartzCron, String status) {
						   String jobClass, String quartzCron, String status) {
		this.jobName = jobName;
		this.jobInfo = jobInfo;
		this.jobType = jobType;
@ -239,44 +124,4 @@ public class QuartzJobConfig implements java.io.Serializable {
	public void setDel(String del) {
		this.del = del;
	}
	public String getSql() {
		return sql;
	}
	public void setSql(String sql) {
		this.sql = sql;
	}
	public String getSqlCount() {
		return sqlCount;
	}
	public void setSqlCount(String sqlCount) {
		this.sqlCount = sqlCount;
	}
	public String getSqlDay() {
		return sqlDay;
	}
	public void setSqlDay(String sqlDay) {
		this.sqlDay = sqlDay;
	}
	public String getSqlYear() {
		return sqlYear;
	}
	public void setSqlYear(String sqlYear) {
		this.sqlYear = sqlYear;
	}
	public String getCacheKey() {
		return cacheKey;
	}
	public void setCacheKey(String cacheKey) {
		this.cacheKey = cacheKey;
	}
}

+ 1 - 1
common/common-entity/src/main/java/com/yihu/wlyy/entity/message/SMS.java

@ -18,7 +18,7 @@ public class SMS extends IdEntity {
    private String mobile;// 手机号
    private String ip;// ip地址
    private Integer type;// 消息类型:1微信端注册,2微信端找回密码,3医生端找回密码,4患者登录,5医生登录,6代预约(发送给居民)  10患者添加家庭关系
    private Integer type;// 消息类型:1微信端注册,2微信端找回密码,3医生端找回密码,4患者登录,5医生登录,6代预约(发送给居民)  10患者添加家庭关系,11账号申诉处理完成
    private String captcha;// 验证码
    private String content;// 消息内容
    private Date deadline;// 过期时间

+ 1 - 1
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/controller/manager/appeal/AppealController.java

@ -117,7 +117,7 @@ public class AppealController extends BaseController {
     * @param result
     * @return
     */
    @RequestMapping(value="dealAppeal")
    @RequestMapping(value="dealAppeal", method = RequestMethod.POST)
    @ResponseBody
    public String dealAppeal(@RequestParam(required = true,value="id") Long id,
                             @RequestParam(required = true,value="result") String result){

+ 20 - 3
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/controller/manager/feedback/FeedbackController.java

@ -2,7 +2,6 @@ package com.yihu.wlyy.controller.manager.feedback;
import com.yihu.wlyy.controller.BaseController;
import com.yihu.wlyy.entity.feedback.Feedback;
import com.yihu.wlyy.service.manager.feedback.AppealService;
import com.yihu.wlyy.service.manager.feedback.FeedbackService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@ -24,8 +23,7 @@ import java.util.Map;
@RequestMapping(value = "admin/feedback")
@Api(description = "管理系统意见反馈接口")
public class FeedbackController extends BaseController {
    @Autowired
    private AppealService appealService;
    @Autowired
    private FeedbackService feedbackService;
@ -109,4 +107,23 @@ public class FeedbackController extends BaseController {
        }
    }
    /**
     * 根据反馈id,回复内容result进行处理
     * @param id
     * @param result
     * @return
     */
    @RequestMapping(value="dealFeedback", method = RequestMethod.POST)
    @ResponseBody
    public String dealAppeal(@RequestParam(required = true,value="id") Long id,
                             @RequestParam(required = true,value="result") String result){
        try {
            feedbackService.dealFeedback(id,result);
            return write(200,"操作成功!");
        }catch (Exception e){
            error(e);
            return error(-1, "操作失败!");
        }
    }
}

+ 1 - 1
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/entity/SMS.java

@ -16,7 +16,7 @@ public class SMS extends IdEntity {
    private String mobile;// 手机号
    private String ip;// ip地址
    private Integer type;// 消息类型:1微信端注册,2微信端找回密码,3医生端找回密码,4患者登录,5医生登录
    private Integer type;// 消息类型:1微信端注册,2微信端找回密码,3医生端找回密码,4患者登录,5医生登录,7旧手机验证码,8新手机验证码,10添加家人,11账号申诉处理完成
    private String captcha;// 验证码
    private String content;// 消息内容
    private Date deadline;// 过期时间

+ 32 - 0
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/entity/feedback/Appeal.java

@ -1,9 +1,12 @@
package com.yihu.wlyy.entity.feedback;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yihu.wlyy.entity.IdEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;
/**
 * 账号申诉表
@ -24,6 +27,9 @@ public class Appeal extends IdEntity {
    private String images;
    //    联系手机号
    private String phone;
    private String name;//申诉人姓名
    private String idcard;//申诉人身份证
    private Date createTime;//申诉时间
    //    状态 0、未读 1、待处理  2、已处理
    private int status;
    //    '处理结果'
@ -125,4 +131,30 @@ public class Appeal extends IdEntity {
    public void setIdentity(int identity) {
        this.identity = identity;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public String getIdcard() {
        return idcard;
    }
    public void setIdcard(String idcard) {
        this.idcard = idcard;
    }
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    @Column(name = "create_time")
    public Date getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
}

+ 43 - 1
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/entity/feedback/Feedback.java

@ -1,9 +1,12 @@
package com.yihu.wlyy.entity.feedback;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yihu.wlyy.entity.IdEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;
/**
 * 意见反馈表
@ -26,13 +29,18 @@ public class Feedback extends IdEntity {
    private String images;
    //    联系方式: qq号或者邮箱
    private String contact;
    //    状态 0、未读 1、已读
    //    /状态 0、未读 1、待处理  2、已处理
    private int status;
    //    是否删除 0、删除 1、正常
    private int del;
    //    创建人姓名
    private String createrName;
    private String result; //    '处理结果'
    private String phone; //    '手机号'
    private String idcard;//反馈人身份证
    private Date createTime;//反馈时间
    public Feedback() {
    }
@ -115,4 +123,38 @@ public class Feedback extends IdEntity {
    public void setStatus(int status) {
        this.status = status;
    }
    public String getIdcard() {
        return idcard;
    }
    public void setIdcard(String idcard) {
        this.idcard = idcard;
    }
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    @Column(name = "create_time")
    public Date getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    public String getResult() {
        return result;
    }
    public void setResult(String result) {
        this.result = result;
    }
    public String getPhone() {
        return phone;
    }
    public void setPhone(String phone) {
        this.phone = phone;
    }
}

+ 54 - 5
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/manager/feedback/AppealService.java

@ -1,12 +1,19 @@
package com.yihu.wlyy.service.manager.feedback;
import com.yihu.wlyy.entity.Doctor;
import com.yihu.wlyy.entity.SMS;
import com.yihu.wlyy.entity.feedback.Appeal;
import com.yihu.wlyy.repository.DoctorDao;
import com.yihu.wlyy.repository.PatientDao;
import com.yihu.wlyy.repository.SMSDao;
import com.yihu.wlyy.repository.feedback.AppealDao;
import com.yihu.wlyy.service.BaseService;
import com.yihu.wlyy.service.SMSService;
import com.yihu.wlyy.util.DateUtil;
import org.apache.commons.lang3.StringUtils;
import org.json.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
@ -17,10 +24,7 @@ import org.springframework.transaction.annotation.Transactional;
import org.springside.modules.persistence.DynamicSpecifications;
import org.springside.modules.persistence.SearchFilter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
/**
 * Created by Reece on 2017/5/6.
@ -28,13 +32,19 @@ import java.util.Map;
@Service
@Transactional
public class AppealService extends BaseService {
    private static Logger logger = LoggerFactory.getLogger(AppealService.class);
    @Autowired
    private AppealDao appealDao;
    @Autowired
    private PatientDao patientDao;
    @Autowired
    private DoctorDao doctorDao;
    @Autowired
    private SMSService smsService;
    @Autowired
    private SMSDao smsDao;
    /**
     * 分页查找问题
@ -136,6 +146,9 @@ public class AppealService extends BaseService {
        map.put("identity", identity);
        map.put("phone", phone);
        map.put("description", description);
        map.put("name", appeal.getName());
        map.put("createTime", DateUtil.dateToStrLong(appeal.getCreateTime()));
        map.put("idcard", appeal.getIdcard());
        map.put("images", images);
        map.put("result", result);
        if (status == 0){
@ -172,5 +185,41 @@ public class AppealService extends BaseService {
        appeal.setResult(result);
        appeal.setStatus(2);
        appealDao.save(appeal);
        //发送处理完成短信
        //您某年某月某日在i健康平台提交的账号申诉已处理,请使用i健康应用(微信公众号)查看处理结果,查看路径:账号登录—忘记密码—账号申诉—申诉记录
        //医生和居民用不同的内容,医生是i健康应用,居民是i健康微信公众号
        StringBuffer msgContent = new StringBuffer("您");
        msgContent.append(DateUtil.getYMD(appeal.getCreateTime()));
        msgContent.append("在i健康平台提交的账号申诉已处理,请使用");
        if(appeal.getIdentity()==1){
            msgContent.append("微信公众号");
        }else {
            msgContent.append("i健康应用");
        }
        msgContent.append("查看处理结果,查看路径:账号登录—忘记密码—账号申诉—申诉记录");
        JSONObject json = smsService.sendMsg(appeal.getPhone(),msgContent.toString());
        SMS sms = new SMS();
        Date date = new Date();
        // 延后5分钟
        sms.setContent(msgContent.toString());
        sms.setDeadline(date);
        sms.setCzrq(date);
        sms.setMobile(appeal.getPhone());
        sms.setIp("127.0.0.1");
        sms.setType(11);
        sms.setStatus(1);
        smsDao.save(sms);
        if (json == null) {
            // 发送失败
            logger.error("申诉处理完成:短信发送失败");
        } else if (json.getInt("result") != 0) {
            logger.error("申诉处理完成:短信发送失败"+json.getString("description"));
        } else {
            //发送成功,保存到数据库
            smsDao.save(sms);
        }
    }
}

+ 14 - 0
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/manager/feedback/FeedbackService.java

@ -156,4 +156,18 @@ public class FeedbackService extends BaseService {
            }
        }
    }
    /***
     * 根据反馈id保存处理结果
     * @param id
     * @param result
     * @throws Exception
     */
    public void dealFeedback(Long id,String result) throws Exception {
        Feedback feedback = feedbackDao.findFeedbackById(id);
        feedback.setResult(result);
        feedback.setStatus(2);
        feedbackDao.save(feedback);
    }
}

+ 20 - 8
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/util/DateUtil.java

@ -1,15 +1,14 @@
package com.yihu.wlyy.util;
import java.sql.Time;
import org.apache.commons.lang3.StringUtils;
import java.text.ParsePosition;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.Locale;
import java.util.Random;
import org.apache.commons.lang3.StringUtils;
import java.time.Instant;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.util.*;
public class DateUtil {
@ -668,6 +667,19 @@ public class DateUtil {
		}
	}
	/**
	 * 返回 某年某月某日
	 * @param date
	 * @return
     */
	public static String getYMD(Date date){
		Instant instant = date.toInstant();
		ZoneId zone = ZoneId.systemDefault();
		LocalDateTime localDateTime = LocalDateTime.ofInstant(instant, zone);
		LocalDate localDate = localDateTime.toLocalDate();
		return localDate.getYear()+"年"+localDate.getMonth().getValue()+"月"+localDate.getDayOfMonth()+"日";
	}
//	public static void main(String[] args) {
//		String hour = "12:22:12";
//		System.out.println(Time.valueOf(hour));

+ 6 - 6
patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/entity/FollowupDrugs.java

@ -26,7 +26,7 @@ public class FollowupDrugs extends IdEntity {
	//药品分组(糖尿病--胰岛特殊处理)
	private String drugsGroup;
	//次剂量
	private Double dose;
	private String dose;
	//用药单位【字典MEASURE_UNIT_DICT】
	private String unit;
	//用药频率【字典RECIPE_FREQUENCY_DICT】
@ -65,15 +65,15 @@ public class FollowupDrugs extends IdEntity {
	public void setDrugsGroup(String drugsGroup) {
		this.drugsGroup = drugsGroup;
	}
	public Double getDose() {
	
	public String getDose() {
		return dose;
	}
	public void setDose(Double dose) {
	
	public void setDose(String dose) {
		this.dose = dose;
	}
	
	public String getUnit() {
		return unit;
	}

+ 3 - 0
patient-co-service/wlyy_sign/src/main/java/com/yihu/wlyy/sign/dao/SignFamilyRenewLogDao.java

@ -40,4 +40,7 @@ public interface SignFamilyRenewLogDao extends PagingAndSortingRepository<SignFa
     */
    @Query("select a from SignFamilyRenewLog a where a.doctor<>a.oldDoctor")
    List<SignFamilyRenewLog> findChangeDoctor(Pageable pageable) throws Exception;
    @Query("select a.proId from SignFamilyRenewLog a where a.signCode=?1")
    String getProId(String signCode);
}

+ 9 - 1
patient-co-service/wlyy_sign/src/main/java/com/yihu/wlyy/sign/service/ChargeZYService.java

@ -37,6 +37,8 @@ public class ChargeZYService {
    private PatientDao patientDao;
    @Autowired
    private SignFamilyMappingDao signFamilyMappingDao;
    @Autowired
    private SignFamilyRenewLogDao signFamilyRenewLogDao;
    /**
     * 获取机构映射
@ -122,7 +124,13 @@ public class ChargeZYService {
                params.put("CHARGE_TIME", DateUtil.dateToStrLong(sign.getExpensesTime()));  //缴费时间
                params.put("INSUR_PRO_ID", charge.getMiRegisterNo());  //医保签约号
                proId = signFamilyMappingDao.getProId(signCode);
                if("1".equals(sign.getRenewFlag())||"2".equals(sign.getRenewFlag())){
                    proId = signFamilyRenewLogDao.getProId(signCode);
                }else {
                    proId = signFamilyMappingDao.getProId(signCode);
                }
                params.put("PRO_ID", proId);  //标志(智业签约主键)
                operator = doctorMappingDao.findByDocotrCodeAndJwDoctorHospital(operator,hm[0]);  //【医生映射】

+ 1 - 1
patient-co/patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/etl/compute/ComputeHelper.java

@ -187,7 +187,7 @@ public class ComputeHelper {
            if (countMap.containsKey(one.getKey())) {
                List<DataModel> dataModels = countMap.get(one.getKey());
                Double result1 = 0.0;
                Integer result2 = 0;
                Double result2 = 0.0;
                for (int j = 0; j < dataModels.size(); j++) {
                    DataModel dataModel = dataModels.get(j);
                    result1 += dataModel.getNum();

+ 23 - 8
patient-co/patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/service/ExtractDataService.java

@ -14,12 +14,15 @@ import org.elasticsearch.search.builder.SearchSourceBuilder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import javax.annotation.PostConstruct;
import javax.sql.DataSource;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
@ -39,25 +42,37 @@ public class ExtractDataService {
    @Value("${es.index}")
    private String esIndex;
    @Autowired
    private ElastricSearchSave elastricSearchSave;
    @Autowired
    private ElastricSearchSave elastricSearchSave;//只读库的jdbcTemplate
    private JdbcTemplate jdbcTemplate;
    private Logger logger= LoggerFactory.getLogger(ExtractDataService.class);
    /**
     * 构造注入只读库的数据源
     *
     * @param dataSource
     */
    @Autowired
    public void JdbcTemplateInit(
            @Qualifier(value = "primaryRead") DataSource dataSource) {
        this.jdbcTemplate = new JdbcTemplate();
        this.jdbcTemplate.setDataSource(dataSource);
    }
    private Logger logger = LoggerFactory.getLogger(ExtractDataService.class);
    public void extractOneDate(String date) {
        String sql = "select * from wlyy_quota_result w where w.level1_type=1  and w.quato_code !=18 and w.quato_code !=19 and quota_date='" + date + "' ";
        List<WlyyQuotaResult> quotaResults = jdbcTemplate.query(sql, new BeanPropertyRowMapper(WlyyQuotaResult.class));
        save2es(quotaResults, date, null);
        logger.info("date:"+date+" all quota      success");
        save2es(quotaResults, null, date);
        logger.info("date:" + date + " all quota      success");
    }
    public void extractOneDateWithId(String date, String quotaId) {
        String sql = "select * from wlyy_quota_result w where w.level1_type=1  and w.quato_code !=18 and w.quato_code !=19 and quota_date='" + date + "' and quato_code='" + quotaId + "'";
        List<WlyyQuotaResult> quotaResults = jdbcTemplate.query(sql, new BeanPropertyRowMapper(WlyyQuotaResult.class));
        save2es(quotaResults, date, quotaId);
        logger.info("date:"+date+",quotaId:"+quotaId+"      success");
        save2es(quotaResults, quotaId,date );
        logger.info("date:" + date + ",quotaId:" + quotaId + "      success");
    }
    public void extractDate2Date(String start, String end) throws Exception {
@ -191,7 +206,7 @@ public class ExtractDataService {
                saveModelTemp.setTeam(one.getQkdoctorCode());
                saveModelTemp.setTeamName(one.getQkdoctorName());
                saveModelTemp.setResult1(Double.valueOf(one.getResult()));
                saveModelTemp.setResult2(Integer.valueOf(one.getResult()));
                saveModelTemp.setResult2(Double.valueOf(one.getResult()));
                saveModelTemp.setSlaveKey1(one.getLevel2Type());
                saveModelTemp.setSlaveKey1Name(one.getLevel2TypeName());
                saveModelTemp.setSlaveKey2(one.getLevel3Type());

+ 8 - 8
patient-co/patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/util/Contant.java

@ -146,14 +146,14 @@ public class Contant {
        public static String status_3="3";
        public static String status_4="4";
        public static String status_5="5";
        public static String status_6="6";
        public static String status_7="7";
        public static String status_8="8";
        public static String status_9="9";
        public static String status_10="10";
        public static String status_11="11";
        public static String status_12="12";
        public static String status_13="13";
//        public static String status_6="6";
//        public static String status_7="7";
//        public static String status_8="8";
//        public static String status_9="9";
//        public static String status_10="10";
//        public static String status_11="11";
//        public static String status_12="12";
//        public static String status_13="13";
//        public static String status_1_name="续方取消";

+ 3 - 3
patient-co/patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/vo/SaveModel.java

@ -76,7 +76,7 @@ public class SaveModel {
    private Double result1 = 0.0;//统计结果  总的累加结果 如果是平均分 那就是总分 其他指标都是和result2一样
    private Integer result2 = 0;//统计结果  次数
    private Double result2 = 0.0;//统计结果  次数
    private String areaLevel;// 1 省 2 市 3 区县 4 机构 5团队
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ssXX")
@ -167,11 +167,11 @@ public class SaveModel {
        this.result1 = result1;
    }
    public Integer getResult2() {
    public Double getResult2() {
        return result2;
    }
    public void setResult2(Integer result2) {
    public void setResult2(Double result2) {
        this.result2 = result2;
    }

+ 2 - 2
patient-co/patient-co-statistics-es/src/main/resources/application-prod.yml

@ -7,11 +7,11 @@ spring:
      username: wlyy
      password: jkzlehr@123
    primaryRead:
      url: jdbc:mysql://59.61.92.90:8079/wlyy?useUnicode=true&amp;characterEncoding=utf-8&amp;autoReconnect=true
      url: jdbc:mysql://59.61.92.90:8082/wlyy?useUnicode=true&amp;characterEncoding=utf-8&amp;autoReconnect=true
      username: wlyy
      password: jkzlehr@123
    im: #im库:
      url: jdbc:mysql://59.61.92.90:8079/im?useUnicode=true&characterEncoding=utf-8&autoReconnect=true
      url: jdbc:mysql://59.61.92.90:8082/im?useUnicode=true&characterEncoding=utf-8&autoReconnect=true
      username: im
      password: im!)123

+ 1 - 1
patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/service/app/followup/FollowupDrugsService.java

@ -85,7 +85,7 @@ public class FollowupDrugsService extends BaseService {
				drug.setDrugsGroup(item.get("drugsGroup"));
				drug.setDrugsCode(item.get("drugsCode"));
				drug.setDrugsName(item.get("drugsName"));
				drug.setDose(Double.valueOf(String.valueOf(item.get("dose"))));
				drug.setDose(item.get("dose"));
				drug.setUnit(item.get("unit"));
				drug.setFrequency(item.get("frequency"));
				drug.setCreateTime(new Date());

+ 9 - 7
patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/service/third/jw/JwPrescriptionService.java

@ -378,6 +378,9 @@ public class JwPrescriptionService {
                        String idcard = json.getString("IDENTITY_CARD_NO");//身份证号码
                        String medicalNo = json.getString("MEDICAL_NO");//体检编码
                        String patientName = json.getString("SICK_NAME");//姓名
                        if(StringUtils.isNoneBlank(patientName) && patientName.length() >200){
                            patientName = patientName.substring(0,200);
                        }
                        String orgName = json.getString("ORG_NAME");//医院名称
                        String orgCode = json.getString("ORG_CODE");//医院机构编码
                        String jwDoctorCode = json.getString("MEDICAL_OPERATOR");//体检医生
@ -447,6 +450,7 @@ public class JwPrescriptionService {
                    Integer jwCode = jwData.getInteger("CODE");
                    if (1 == jwCode) {
                        JSONArray dataArray = jwData.getJSONArray("DATA");
                        logger.info("从基卫获取随访信息数量"+ dataArray.size());
                        for (int i = 0; i < dataArray.size(); i++) {
                            Followup followup = new Followup();
                    
@ -806,10 +810,7 @@ public class JwPrescriptionService {
                                        drug.setDrugsGroup("normal");
                                        drug.setDrugsCode("");
                                        drug.setDrugsName(json.getString("PHYSIC_NAME" + j));//药物名称
                                        if(StringUtils.isNoneBlank(json.getString("PHYSIC_DOSE" + j))){
                                            drug.setDose(Double.valueOf(json.getString("PHYSIC_DOSE" + j)));//剂量
                                        }
                                        
                                        drug.setDose(json.getString("PHYSIC_DOSE" + j));//剂量
                                        drug.setUnit(json.getString("PHYSIC_UNIT" + j));//单位【MEASURE_UNIT_DICT】
                                        drug.setFrequency(json.getString("FREQUENCY" + j));//频次【RECIPE_FREQUENCY_DICT】
                                        drug.setCreateTime(new Date());
@ -824,9 +825,7 @@ public class JwPrescriptionService {
                                        drug.setDrugsGroup("insulin");
                                        drug.setDrugsCode("");
                                        drug.setDrugsName(json.getString("INSULIN_NAME" + k));//胰岛素药物名称
                                        if(StringUtils.isNoneBlank(json.getString("INSULIN_DOSE" + k))){
                                            drug.setDose(Double.valueOf(json.getString("INSULIN_DOSE" + k)));//胰岛素剂量
                                        }
                                        drug.setDose(json.getString("PHYSIC_DOSE" + k));//剂量
                                        drug.setUnit(json.getString("INSULIN_UNIT" + k));//v单位【MEASURE_UNIT_DICT】
                                        drug.setFrequency(json.getString("INSULIN_FREQUENCY" + k));//胰岛素频次【RECIPE_FREQUENCY_DICT】
                                        drug.setCreateTime(new Date());
@ -839,6 +838,9 @@ public class JwPrescriptionService {
                        
                                transactionManager.commit(transactionStatus);
                            } catch (Exception ex) {
                                logger.info("查询居民随访记录,开始时间" + startdate + ",结束时间:" + enddate);
                                logger.info("查询居民随访记录,机构" + hospitalMapping.getName() + ",编码:" + hospitalMapping.getCode());
                                logger.info("基卫随访信息报文:"+json.toString());
                                logger.info("同步随访信息报错,errmessage:" + ex.toString());
                                transactionManager.rollback(transactionStatus);
                                continue;

+ 10 - 0
patient-co/patient-co-wlyy/pom.xml

@ -452,6 +452,16 @@
            <artifactId>commons-collections</artifactId>
            <version>3.2.2</version>
        </dependency>
        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpmime</artifactId>
            <version>4.5.1</version>
        </dependency>
        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpcore</artifactId>
            <version>4.4.5</version>
        </dependency>
        <!--elasticsearch end-->
    </dependencies>
    <build>

+ 2 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/config/SwaggerConfig.java

@ -178,6 +178,8 @@ public class SwaggerConfig {
                        regex("/im_new/.*"),
                        regex("/version/.*"),
                        regex("/express/.*"),
                        regex("/doctorFeeback/.*"),
                        regex("/patientFeeback/.*"),
                        regex("/esstatistics/.*")
                ))
                .build()

+ 9 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/feedback/AppealDao.java

@ -1,11 +1,20 @@
package com.yihu.wlyy.repository.feedback;
import com.yihu.wlyy.entity.feedback.Appeal;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * Created by Reece on 2017/5/6.
 */
public interface AppealDao extends PagingAndSortingRepository<Appeal, Long>,JpaSpecificationExecutor<Appeal> {
    @Query("from Appeal p where p.idcard = ?1 and p.del=1 ")
    Page<Appeal> findByIdcard(String idcard, Pageable pageRequest);
    @Query("select p from Appeal p where p.code=?1")
    Appeal findByCode(String code);
}

+ 9 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/feedback/FeedbackDao.java

@ -1,11 +1,20 @@
package com.yihu.wlyy.repository.feedback;
import com.yihu.wlyy.entity.feedback.Feedback;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * Created by Reece on 2017/5/6.
 */
public interface FeedbackDao extends PagingAndSortingRepository<Feedback, Long>,JpaSpecificationExecutor<Feedback> {
    @Query("from Feedback p where p.creater = ?1 and p.identity=?2 and p.del=1 ")
    Page<Feedback> findByCreater(String creater,Integer identity,Pageable pageRequest);
    @Query("select p from Feedback p where p.code=?1")
    Feedback findByCode(String code);
}

+ 81 - 6
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/feedback/AppealService.java

@ -1,13 +1,23 @@
package com.yihu.wlyy.service.app.feedback;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yihu.wlyy.entity.doctor.profile.Doctor;
import com.yihu.wlyy.entity.feedback.Appeal;
import com.yihu.wlyy.entity.patient.Patient;
import com.yihu.wlyy.repository.doctor.DoctorDao;
import com.yihu.wlyy.repository.feedback.AppealDao;
import com.yihu.wlyy.repository.patient.PatientDao;
import com.yihu.wlyy.service.BaseService;
import com.yihu.wlyy.service.common.account.DoctorService;
import com.yihu.wlyy.service.common.account.PatientService;
import com.yihu.wlyy.util.DateUtil;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Sort;
import org.springframework.data.domain.Sort.Direction;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -22,11 +32,26 @@ public class AppealService extends BaseService {
    @Autowired
    private PatientService patientService;
    @Autowired
    private PatientDao patientDao;
    @Autowired
    private DoctorService doctorService;
    @Autowired
    private DoctorDao doctorDao;
    public void saveAppeal(String creater,String description,int type,String images,String phone,int identity) throws Exception{
    /**
     * 保存账号申诉
     * @param creater 申请人code(如果有登录)
     * @param description 描述
     * @param type 申诉类型
     * @param images 图片
     * @param phone 手机号
     * @param identity 申诉人类型
     * @param name 姓名
     * @param idcard 身份证
     * @throws Exception
     */
    public void saveAppeal(String creater,String description,int type,String images,String phone,int identity,String name,String idcard) throws Exception{
        Appeal appeal = new Appeal();
        appeal.setCode(getCode());
        appeal.setCreater(creater);
@ -34,21 +59,71 @@ public class AppealService extends BaseService {
        appeal.setType(type);
        appeal.setImages(images);
        appeal.setPhone(phone);
        appeal.setName(name);
        appeal.setIdcard(idcard);
        appeal.setStatus(0);
        appeal.setIdentity(identity);
        appeal.setDel(1);
        //通过creater获取创建人名字
        String name ="";
        String createrName ="";
        if(creater!=null&&!"".equals(creater)){
            if(identity==1){//说明是患者
                Patient patient = patientService.findByCode(creater);
                name = patient.getName();
                createrName = patient.getName();
            }else{//说明是医生
                Doctor doctor = doctorService.findDoctorByCode(creater);
                name = doctor.getName();
                createrName = doctor.getName();
            }
        }
        appeal.setCreaterName(name);
        appeal.setCreaterName(createrName);
        appealDao.save(appeal);
    }
    /**
     * 按身份证查找
     * @param idcard
     * @param page
     * @param pagesize
     * @param type 类型 1居民 2医生
     * @return
     */
    public JSONArray findAppealByIdcard(String idcard,String userCode,Integer page,Integer pagesize,Integer type){
        JSONArray re = new JSONArray();
        if(StringUtils.isEmpty(idcard)&&StringUtils.isEmpty(userCode)){
            return re;
        }
        if(StringUtils.isEmpty(idcard)){
            if(type==1){
                Patient patient = patientDao.findByCode(userCode);
                idcard = patient.getIdcard();
            }else {
                Doctor doctor = doctorDao.findByCode(userCode);
                idcard = doctor.getIdcard();
            }
        }
        pagesize = pagesize==null? 10:pagesize;
        // 排序
        Sort sort = new Sort(Direction.DESC, "createTime");
        // 分页信息
        PageRequest pageRequest = new PageRequest(page, pagesize, sort);
        Page<Appeal> pages = appealDao.findByIdcard(idcard,pageRequest);
        pages.forEach(appeal -> {
            JSONObject json = new JSONObject();
            json.put("code",appeal.getCode());
            json.put("createTime",DateUtil.dateToStrLong(appeal.getCreateTime()));
            json.put("type",appeal.getType());
            json.put("status",appeal.getStatus());
            json.put("description",appeal.getDescription());
            re.add(json);
        });
        return re;
    }
    public Appeal findByCode(String code){
        return appealDao.findByCode(code);
    }
}

+ 50 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/feedback/FeedbackService.java

@ -1,5 +1,7 @@
package com.yihu.wlyy.service.app.feedback;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yihu.wlyy.entity.doctor.profile.Doctor;
import com.yihu.wlyy.entity.feedback.Feedback;
import com.yihu.wlyy.entity.patient.Patient;
@ -7,10 +9,17 @@ import com.yihu.wlyy.repository.feedback.FeedbackDao;
import com.yihu.wlyy.service.BaseService;
import com.yihu.wlyy.service.common.account.DoctorService;
import com.yihu.wlyy.service.common.account.PatientService;
import com.yihu.wlyy.util.DateUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Sort;
import org.springframework.data.domain.Sort.Direction;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Date;
/**
 * Created by Reece on 2017/5/6.
 */
@ -42,12 +51,53 @@ public class FeedbackService extends BaseService {
        if(identity==1){//说明是患者
            Patient patient = patientService.findByCode(creater);
            name = patient.getName();
            feedback.setIdcard(patient.getIdcard());
            feedback.setPhone(patient.getMobile());
        }else{//说明是医生
            Doctor doctor = doctorService.findDoctorByCode(creater);
            name = doctor.getName();
            feedback.setIdcard(doctor.getIdcard());
            feedback.setPhone(doctor.getMobile());
        }
        feedback.setCreateTime(new Date());
        feedback.setCreaterName(name);
        feedbackDao.save(feedback);
    }
    /**
     * 按用户code查找
     * @param userCode
     * @param page
     * @param pagesize
     * @param type 类型 1居民 2医生
     * @return
     */
    public JSONArray findByCreater(String userCode, Integer page, Integer pagesize, Integer type){
        JSONArray re = new JSONArray();
        page = page == null?0:page;
        pagesize = pagesize==null? 10:pagesize;
        // 排序
        Sort sort = new Sort(Direction.DESC, "createTime");
        // 分页信息
        PageRequest pageRequest = new PageRequest(page, pagesize, sort);
        Page<Feedback> pages = feedbackDao.findByCreater(userCode,type,pageRequest);
        pages.forEach(feedback -> {
            JSONObject json = new JSONObject();
            json.put("code",feedback.getCode());
            json.put("createTime", DateUtil.dateToStrLong(feedback.getCreateTime()));
            json.put("type",feedback.getType());
            json.put("status",feedback.getStatus());
            json.put("description",feedback.getDescription());
            re.add(json);
        });
        return re;
    }
    public Feedback findByCode(String code){
        return feedbackDao.findByCode(code);
    }
}

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/followup/FollowupDrugsService.java

@ -85,7 +85,7 @@ public class FollowupDrugsService extends BaseService {
				drug.setDrugsGroup(item.get("drugsGroup"));
				drug.setDrugsCode(item.get("drugsCode"));
				drug.setDrugsName(item.get("drugsName"));
				drug.setDose(Double.valueOf(String.valueOf(item.get("dose"))));
				drug.setDose(item.get("dose"));
				drug.setUnit(item.get("unit"));
				drug.setFrequency(item.get("frequency"));
				drug.setCreateTime(new Date());

+ 3 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/physicalExamination/PhysicalExaminationRemindService.java

@ -152,7 +152,7 @@ public class PhysicalExaminationRemindService extends BaseService {
     * @return
     * @throws Exception
     */
    public JSONArray getOldPatientByTeamCode(long teamCode, int page, int pagesize) throws Exception {
    public JSONArray getOldPatientByTeamCode(long teamCode,String doctor, int page, int pagesize) throws Exception {
        Map<String, JSONObject> result = new TreeMap<>();
        List<Map<String, Object>> signList = new ArrayList<>();
@ -169,6 +169,7 @@ public class PhysicalExaminationRemindService extends BaseService {
                " WHERE " +
                "     t1.status > 0 " +
                "    AND t1.admin_team_code = ? " +
                "    AND (t1.doctor = ? or t1.doctor_health = ?) " +
                "    AND (YEAR(curdate()) -IF(length(idcard) = 18,substring(idcard, 7, 4),IF(length(idcard) = 15,concat('19', substring(idcard, 7, 2)),NULL)))>65 " +
                "    AND t1.idcard not in " +
                "       (SELECT DISTINCT s.idcard " +
@ -178,7 +179,7 @@ public class PhysicalExaminationRemindService extends BaseService {
                "                 and o.medical_time>?)" +
                " order by t1.openid desc,convert(t1.name using gbk) ";
        args = new Object[]{teamCode, teamCode, DateUtil.getLastYear()};
        args = new Object[]{teamCode,doctor,doctor, teamCode, DateUtil.getLastYear()};
        sql = sql + " limit " + start + "," + pagesize;
        signList = jdbcTemplate.queryForList(sql, args);

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

@ -4624,6 +4624,14 @@ public class StatisticsService extends BaseService {
        return result;
    }
    /**
     * 续签 签入、签出统计
     * @param teamCode
     * @param startDate
     * @param endDate
     * @param type
     * @return
     */
    public JSONObject getTeamRenewChangeLine(String teamCode, String startDate, String endDate, String type) {
        startDate = startDate + " 00:00:00";
        endDate = endDate + " 23:59:59";

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

@ -20,6 +20,7 @@ import io.searchbox.client.JestClient;
import io.searchbox.core.Bulk;
import io.searchbox.core.BulkResult;
import io.searchbox.core.Index;
import org.apache.commons.collections.map.HashedMap;
import org.apache.commons.lang3.StringUtils;
import org.json.JSONArray;
import org.json.JSONObject;
@ -59,6 +60,7 @@ public class StatisticsESService {
    SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
    SimpleDateFormat dateFormat2 = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssXX");
    SimpleDateFormat dateFormat3 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
    /**
     * 获取上次统计时间
     *
@ -190,7 +192,7 @@ public class StatisticsESService {
    public long getIntervalIncrement(String startDate, String endDate, String area, int level, String index) throws Exception {
        SaveModel saveModel = elasticsearchUtil.findOneDateQuotaLevel0(startDate,endDate,area,level,index,"1");
        return saveModel.getResult2();
        return saveModel.getResult2().longValue();
    }
//    /**
@ -271,7 +273,7 @@ public class StatisticsESService {
        }else{
            saveModel = elasticsearchUtil.findOneDateQuotaLevel0(startDate,endDate,area,level,index,"1");
        }
        return saveModel.getResult2();
        return saveModel.getResult2().longValue();
    }
    /**
@ -322,9 +324,9 @@ public class StatisticsESService {
                map.put("code",saveModel.getTeam());
                map.put("name",saveModel.getCityName());
            }
            map.put("amount",Long.parseLong(saveModel.getResult2()+""));
            map.put("amount",saveModel.getResult2().longValue());
            map.put("rate",df.format((saveModel.getResult2() * 1.0000) / populationBase.getNum() * 100));
            map.put("rateString",saveModel.getResult2()+"/"+populationBase.getNum());
            map.put("rateString",saveModel.getResult2().longValue()+"/"+populationBase.getNum());
            resultList.add(map);
        }
        Collections.sort(resultList, new Comparator<Map<String, Object>>() {
@ -360,7 +362,7 @@ public class StatisticsESService {
            Map<String, Object> map = new HashMap<>();
            map.put("code",saveModel.getSlaveKey1());
            map.put("name",saveModel.getSlaveKey1Name());
            map.put("amount",Long.parseLong(saveModel.getResult2()+""));
            map.put("amount",saveModel.getResult2().longValue());
            if (index.equals("7")) {
                // 分组指标总数算法
                String code = saveModel.getSlaveKey2();
@ -442,7 +444,7 @@ public class StatisticsESService {
            endDate = elasticsearchUtil.getQuotaTime();
        }
        SaveModel saveModel = elasticsearchUtil.findOneDateQuotaLevel0(endDate,area,level,index,timeLevel);
        return saveModel.getResult2();
        return saveModel.getResult2().longValue();
    }
    /**
@ -456,7 +458,7 @@ public class StatisticsESService {
    public long getWeiJiaoFei(String endDate, String area, int level) throws Exception{
        SaveModel saveModel = elasticsearchUtil.findOneDateQuotaLevel1(endDate,area,level,"16","2","0");
        return saveModel.getResult2();
        return saveModel.getResult2().longValue();
    }
@ -478,12 +480,12 @@ public class StatisticsESService {
        }
        String timeKey = elasticsearchUtil.getQuotaTime();
        SaveModel saveModel = elasticsearchUtil.findOneDateQuotaLevel0(timeKey,area,Integer.parseInt(level),renewIndex,"2");
        int renewNum = saveModel.getResult2();
        int renewNum = saveModel.getResult2().intValue();
        //根据年度获取去年的签约数 签约指标是1
        String date = year + "-06-30";
        String index = "1";
        SaveModel saveModel2 = elasticsearchUtil.findOneDateQuotaLevel0(date,area,Integer.parseInt(level),index,"2");
        int signNum = saveModel2.getResult2();
        int signNum = saveModel2.getResult2().intValue();
        JSONObject jo = new JSONObject();
        jo.put("yesterYearSign", signNum);//去年的签约量
        jo.put("thisYearRenew", renewNum);//今年的续签量
@ -502,7 +504,7 @@ public class StatisticsESService {
    public JSONObject getSignRate(String endDate, String area, int level, String year) throws Exception {
        SaveModel saveModel = elasticsearchUtil.findOneDateQuotaLevel0(endDate,area,level,"13","2");
        long signAmount = saveModel.getResult2();
        long signAmount = saveModel.getResult2().longValue();
        PopulationBase peopleNum = getPopulationBase(area, year);
        JSONObject json = new JSONObject();
        DecimalFormat df = new DecimalFormat("0.0000");
@ -533,7 +535,7 @@ public class StatisticsESService {
            endDate = elasticsearchUtil.getQuotaTime();
        }
        SaveModel saveModel = elasticsearchUtil.findOneDateQuotaLevel0(endDate,area,level,"13","2");
        long signAmount = saveModel.getResult2();
        long signAmount = saveModel.getResult2().longValue();
        PopulationBase peopleNum = getPopulationBase(area, year);
        DecimalFormat df = new DecimalFormat("0.0000");
        JSONObject json = new JSONObject();
@ -564,7 +566,7 @@ public class StatisticsESService {
        List<SaveModel> list = elasticsearchUtil.findDateQuotaLevel1(endDate,endDate,area,level,"17","2",lowCode,null,null);
        long total = 0;
        if(list.size()>0){
            total = list.get(0).getResult2();
            total = list.get(0).getResult2().longValue();
        }
        int num = 0;
        int taskNum = 0;
@ -676,7 +678,7 @@ public class StatisticsESService {
            endDate = elasticsearchUtil.getQuotaTime();
        }
        SaveModel saveModel = elasticsearchUtil.findOneDateQuotaLevel1(endDate,area,level,"8","2","6");
        return saveModel.getResult2();
        return saveModel.getResult2().longValue();
    }
    /**
@ -728,7 +730,7 @@ public class StatisticsESService {
        for (SaveModel saveModel:list) {
            JSONObject range = new JSONObject();
            range.put("range", df.format(saveModel.getQuotaDate()));
            range.put("amount", saveModel.getResult2());
            range.put("amount", saveModel.getResult2().longValue());
            result.add(range);
        }
        json.put("data", new ArrayList<>(result));
@ -1027,7 +1029,7 @@ public class StatisticsESService {
        if (esModelList != null && esModelList.size() > 0) {
            for (SaveModel one : esModelList) {
                Map<String, Object> maps = new HashMap<String, Object>();
                maps.put("amount", one.getResult1());
                maps.put("amount", one.getResult2().longValue());
                if (low_level.equals("3")) {
                    maps.put("code", one.getTown());
                    maps.put("name", one.getTownName());
@ -1251,7 +1253,7 @@ public class StatisticsESService {
                    JSONObject jo = new JSONObject();
                    jo.put("name", one.getTownName());
                    jo.put("code", one.getTown());
                    jo.put("avgCount", getRangeDouuble(one.getResult1(), one.getResult2(), 2));
                    jo.put("avgCount", getRangeDouuble(one.getResult1(), one.getResult2().intValue(), 2));
                    ja.put(jo);
                });
            } else {
@ -1260,7 +1262,7 @@ public class StatisticsESService {
                    JSONObject jo = new JSONObject();
                    jo.put("name", one.getHospitalName());
                    jo.put("code", one.getHospital());
                    jo.put("avgCount", getRangeDouuble(one.getResult1(), one.getResult2(), 2));
                    jo.put("avgCount", getRangeDouuble(one.getResult1(), one.getResult2().intValue(), 2));
                    ja.put(jo);
                });
            }
@ -1270,7 +1272,7 @@ public class StatisticsESService {
                JSONObject jo = new JSONObject();
                jo.put("name", one.getHospitalName());
                jo.put("code", one.getHospital());
                jo.put("avgCount", getRangeDouuble(one.getResult1(), one.getResult2(), 2));
                jo.put("avgCount", getRangeDouuble(one.getResult1(), one.getResult2().intValue(), 2));
                ja.put(jo);
            });
        } else if (level == 2) {
@ -1280,7 +1282,7 @@ public class StatisticsESService {
                JSONObject jo = new JSONObject();
                jo.put("name", one.getTeam());
                jo.put("code", one.getTeamName());
                jo.put("avgCount", getRangeDouuble(one.getResult1(), one.getResult2(), 2));
                jo.put("avgCount", getRangeDouuble(one.getResult1(), one.getResult2().intValue(), 2));
                ja.put(jo);
            });
            translateTeamLeaderName(ja);
@ -1312,7 +1314,7 @@ public class StatisticsESService {
        if (esModelList != null && esModelList.size() > 0) {
            for (SaveModel one : esModelList) {
                Map<String, Object> maps = new HashMap<String, Object>();
                maps.put("amount", one.getResult1());
                maps.put("amount", one.getResult2().intValue());
                if (low_level.equals("3")) {
                    maps.put("code", one.getTown());
                    maps.put("name", one.getTownName());
@ -1406,7 +1408,7 @@ public class StatisticsESService {
        if (esModelList != null && esModelList.size() > 0) {
            for (SaveModel one : esModelList) {
                Map<String, Object> maps = new HashMap<String, Object>();
                maps.put("amount", one.getResult1());
                maps.put("amount", one.getResult2().intValue());
                if (low_level.equals("3")) {
                    maps.put("code", one.getTown());
                    maps.put("name", one.getTownName());
@ -1681,9 +1683,9 @@ public class StatisticsESService {
                continue;
            }
            //合并结果集
            Integer totalNm = totalRs.getResult2();
            Integer relyNm = relyRs.getResult2();
            Integer noRelyNm = onRelyRs.getResult2();
            Integer totalNm = totalRs.getResult2().intValue();
            Integer relyNm = relyRs.getResult2().intValue();
            Integer noRelyNm = onRelyRs.getResult2().intValue();
//            rs.put("name", relyRs.get(area+"Name"));
            if(level==4){
                rs.put("name", relyRs.getHospitalName());
@ -1876,9 +1878,9 @@ public class StatisticsESService {
        //合并结果集
        Map<String, Object> rs = new HashMap<>();
        Integer totalNm = total.getResult2();
        Integer relyNm = rely.getResult2();
        Integer noRelyNm = onRely.getResult2();
        Integer totalNm = total.getResult2().intValue();
        Integer relyNm = rely.getResult2().intValue();
        Integer noRelyNm = onRely.getResult2().intValue();
//        rs.put("name", rely.get(area + "Name"));
        if (SaveModel.cityLevel.equals(level+"")) {
            rs.put("code", rely.getCity());
@ -1971,8 +1973,8 @@ public class StatisticsESService {
                //转签量
                switchSaveModel=elasticsearchUtil.findOneDateQuotaLevel0(timeKey,area,level,renewIndex,"2");
            }
            int renewNum = renewSaveModel.getResult2();
            int switchNum = switchSaveModel.getResult2();
            int renewNum = renewSaveModel.getResult2().intValue();
            int switchNum = switchSaveModel.getResult2().intValue();
            //根据年度获取去年的签约数 签约指标是1
            if(StringUtils.isNoneBlank(lowCode)){
@ -1992,7 +1994,7 @@ public class StatisticsESService {
                signSaveModel=elasticsearchUtil.findOneDateQuotaLevel0(date,area,level,signIndex,"2");
            }
            //签约量
            int signNum = signSaveModel.getResult2();
            int signNum = signSaveModel.getResult2().intValue();
            jo.put("yesterYearSign", signNum);//去年的签约量
            jo.put("thisYearRenew", renewNum);//今年的续签量
            jo.put("thisYearSwithch", switchNum);//今年的转签量
@ -2057,7 +2059,7 @@ public class StatisticsESService {
    private int getLevel1NumForRedis(String index, String level, String code, String timeKey) throws Exception{
        SaveModel saveModel = elasticsearchUtil.findOneDateQuotaLevel0(timeKey,code,Integer.parseInt(level),index,"2");
        return saveModel.getResult2();
        return saveModel.getResult2().intValue();
    }
    /**
     * 通用的方法 获取二级维度的数据列表
@ -2215,11 +2217,11 @@ public class StatisticsESService {
        if (renewSaveModels != null && renewSaveModels.size() > 0) {
            for (SaveModel saveModel : renewSaveModels) {
                if ("3".equals(low_level)) {
                    renewMap.put(saveModel.getTown(), saveModel.getResult2());
                    renewMap.put(saveModel.getTown(), saveModel.getResult2().intValue());
                } else if ("4".equals(low_level)) {
                    renewMap.put(saveModel.getHospital(), saveModel.getResult2());
                    renewMap.put(saveModel.getHospital(), saveModel.getResult2().intValue());
                } else if ("5".equals(low_level)) {
                    renewMap.put(saveModel.getTeam(), saveModel.getResult2());
                    renewMap.put(saveModel.getTeam(), saveModel.getResult2().intValue());
                } else {
                    continue;
                }
@ -2268,7 +2270,7 @@ public class StatisticsESService {
                    int signNum = 0;
                    int renewNum = renewMap.get(reMap.get("code").toString());
                    if (one != null) {
                        signNum = Integer.valueOf(one.getResult2());
                        signNum = one.getResult2().intValue();
                    }
                    reMap.put("rate", getRange(renewNum, signNum, 2));//续签率是 续签量/去年的签约数
                    reMap.put("signNum", signNum);
@ -2362,24 +2364,290 @@ public class StatisticsESService {
     * @return
     */
    public JSONArray getStatTitleInfo(String doctor, String startDate, String endDate) throws Exception {
        JSONArray rs = new JSONArray();
        AdminTeam admin = adminTeamDao.findByLeaderCode(doctor);
        if (admin == null) {
            throw new RuntimeException("未找到团队信息");
        }
        //1.计算签约总数
        SaveModel saveModel = elasticsearchUtil.findOneDateQuotaLevel0(startDate,endDate,admin.getId()+"",Integer.parseInt(SaveModel.teamLevel),"1","2");
        //计算签约总数
        Long sc = saveModel.getResult2().longValue();
        //查找续签表未转移的记录
        JSONObject signTotal = new JSONObject();
        signTotal.put("signTotal", sc);
        rs.put(signTotal);
        //3.平均满意度
        SaveModel saveModel2 = elasticsearchUtil.findOneDateQuotaLevel0(startDate,endDate,admin.getId()+"",Integer.parseInt(SaveModel.teamLevel),"1","2");
        String sql = "SELECT count(1) as num FROM wlyy_consult_team d WHERE d.czrq>= ? and d.czrq<=? and d.admin_team_code =? ";
        Map<String, Object> map = jdbcTemplate.queryForMap(sql, startDate, endDate,admin.getId());
        Double avgCout = saveModel2.getResult1()/(Integer)map.get("num");
        SaveModel saveModel2 = elasticsearchUtil.findOneDateQuotaLevel0(startDate,endDate,admin.getId()+"",Integer.parseInt(SaveModel.teamLevel),"28","2");
//        String sql = "SELECT count(1) as num FROM wlyy_consult_team d WHERE d.czrq>= ? and d.czrq<=? and d.admin_team_code =? ";
//        Map<String, Object> map = jdbcTemplate.queryForMap(sql, startDate, endDate,admin.getId());
        SaveModel saveModel21 = elasticsearchUtil.findOneDateQuotaLevel0(startDate,endDate,admin.getId()+"",Integer.parseInt(SaveModel.teamLevel),"3","2");
        Double avgCout = saveModel2.getResult1()/saveModel21.getResult2();
        Map<String,Object> avgScore = new HashMap<>();
        avgScore.put("avgScore",avgCout);
        rs.put(avgScore);
        //4.获取咨詢數
        SaveModel saveModel3 = elasticsearchUtil.findOneDateQuotaLevel0(startDate,endDate,admin.getId()+"",Integer.parseInt(SaveModel.teamLevel),"3","2");
        Map<String,Object> consultCout = new HashMap<>();
        consultCout.put("consultCount",saveModel3.getResult2().longValue());
        rs.put(consultCout);
        //5.获取待预约
        SaveModel saveModel4 = elasticsearchUtil.findOneDateQuotaLevel0(startDate,endDate,admin.getId()+"",Integer.parseInt(SaveModel.teamLevel),"27","2");
        Map<String,Object> reservationCout = new HashMap<>();
        reservationCout.put("reservationCount",saveModel4.getResult2().longValue());
        rs.put(reservationCout);
        //6.获取健康教育
        SaveModel saveModel5 = elasticsearchUtil.findOneDateQuotaLevel0(startDate,endDate,admin.getId()+"",Integer.parseInt(SaveModel.teamLevel),"59","2");
        Map<String,Object> articleCout = new HashMap<>();
        articleCout.put("articleCount",saveModel5.getResult2().longValue());
        rs.put(articleCout);
        //7.获取健康指导
        SaveModel saveModel6 = elasticsearchUtil.findOneDateQuotaLevel0(startDate,endDate,admin.getId()+"",Integer.parseInt(SaveModel.teamLevel),"5","2");
        Map<String,Object> guidanceCout = new HashMap<>();
        guidanceCout.put("guidanceCount",saveModel6.getResult2().longValue());
        rs.put(guidanceCout);
        //8.随访数目
        SaveModel saveModel7 = elasticsearchUtil.findOneDateQuotaLevel0(startDate,endDate,admin.getId()+"",Integer.parseInt(SaveModel.teamLevel),"4","2");
        Map<String,Object> followupCout = new HashMap<>();
        followupCout.put("followupCount",saveModel7.getResult2().longValue());
        rs.put(followupCout);
        return rs;
    }
    /**
     * 查询签约
     *
     * @param type      0 按周,1 按月
     * @param startDate
     * @param endDate
     * @return
     */
    public JSONArray getSignCountLineByType(String doctor, String type, String startDate, String endDate) throws Exception {
        AdminTeam admin = adminTeamDao.findByLeaderCode(doctor);
        if (admin == null) {
            throw new RuntimeException("未找到团队信息");
        }
        Long id = admin.getId();
        List<SaveModel> list = elasticsearchUtil.findLineChartDateQuotaLevel0(startDate,endDate,id+"",Integer.parseInt(SaveModel.teamLevel),"1","2",String.valueOf(Integer.parseInt(type)+1));
        List<Map<String, Object>> rs = new ArrayList<>();
        for (SaveModel saveModel:list) {
            Map<String, Object> map = new HashMap<>();
            map.put("applyDate",dateFormat3.format(saveModel.getQuotaDate()));
            map.put("signCount",saveModel.getResult2().longValue());
            rs.add(map);
        }
        JSONArray rsJs = new JSONArray(rs);
        return rsJs;
    }
    /**
     * 查询续签约
     *
     * @param type      0 按周,1 按月
     * @param startDate
     * @param endDate
     * @return
     */
    public JSONArray getRenewCountLineByType(String doctor, String type, String startDate, String endDate) throws Exception {
        AdminTeam admin = adminTeamDao.findByLeaderCode(doctor);
        if (admin == null) {
            throw new RuntimeException("未找到团队信息");
        }
        Long id = admin.getId();
        List<SaveModel> list = elasticsearchUtil.findLineChartDateQuotaLevel0(startDate,endDate,id+"",Integer.parseInt(SaveModel.teamLevel),"42","2",String.valueOf(Integer.parseInt(type)+1));
        List<Map<String, Object>> rs = new ArrayList<>();
        for (SaveModel saveModel:list) {
            Map<String, Object> map = new HashMap<>();
            map.put("applyDate",dateFormat3.format(saveModel.getQuotaDate()));
            map.put("signCount",saveModel.getResult2().longValue());
            rs.add(map);
        }
        JSONArray rsJs = new JSONArray(rs);
        return rsJs;
    }
    /**
     * 获取咨询数和未回复数
     * @param doctor
     * @param startDate
     * @param endDate
     * @param isNow
     * @return
     */
    public JSONObject getReyStatbyTeamNow(String doctor, String startDate, String endDate, String isNow) throws Exception{
        AdminTeam admin = adminTeamDao.findByLeaderCode(doctor);
        if (admin == null) {
            throw new RuntimeException("未找到团队信息");
        }
        Long id = admin.getId();
        //家庭医生、健康咨询到达量
        SaveModel saveModel = elasticsearchUtil.findOneDateQuotaLevel0(startDate,endDate,id+"",Integer.parseInt(SaveModel.teamLevel),"3","2");
        Long totalCount = saveModel.getResult2().longValue();
        //健康咨询量  未回复到达量
        SaveModel saveModel2 = elasticsearchUtil.findOneDateQuotaLevel0(startDate,endDate,id+"",Integer.parseInt(SaveModel.teamLevel),"22","2");
        Long noReyCount = saveModel.getResult2().longValue();
        JSONObject rs = new JSONObject();
        rs.put("onReyCount", noReyCount);
        rs.put("totalCount", totalCount);
        return rs;
    }
    /***
     * 获取平均折线图
     *
     * @param doctor
     * @param startDate
     * @param endDate
     * @param type      0 周,1月
     * @return
     */
    public JSONArray getAvgLine(String doctor, String startDate, String endDate, String type) throws Exception{
        AdminTeam admin = adminTeamDao.findByLeaderCode(doctor);
        if (admin == null) {
            throw new RuntimeException("未找到团队信息");
        }
        Long id = admin.getId();
        //统计评分
        Integer interval = Integer.parseInt(type)+2;
        List<SaveModel> list = elasticsearchUtil.findLineChartDateQuotaLevel0(startDate,endDate,id+"",Integer.parseInt(SaveModel.teamLevel),"28","2",interval+"");
        SaveModel saveModel = null;
        Map<String, Object> map = null;
        List<Map<String, Object>> rs = null;
                Double avgCount = 0.0;
        for(SaveModel one:list){
            String quotaDate = dateFormat.format(one.getQuotaDate());
            saveModel = elasticsearchUtil.findOneDateQuotaLevel0(quotaDate,id+"",Integer.parseInt(SaveModel.teamLevel),"59","2");
            avgCount = one.getResult1()/saveModel.getResult2();
            if(avgCount==0.0){
                avgCount = 80.0;
            }
            map = new HashMap<>();
            if("0".equals(type)){
                map.put("dateNo",dateFormat.format(one.getQuotaDate()));
            }else{
                map.put("weekNo",dateFormat.format(one.getQuotaDate()));
            }
            map.put("avgCount",avgCount);
            rs.add(map);
        }
        return new JSONArray(rs);
    }
    /**
     * 获取团队月或周咨询未回复和总数折线图
     *
     * @param teamCode
     * @param startDate
     * @param endDate
     * @param type      0周,1月
     * @return
     */
    public JSONObject getTeamConsultCount(String teamCode, String startDate, String endDate, String type) throws Exception{
        //咨询未回复
        Integer interval = Integer.parseInt(type)+2;
        List<SaveModel> list = elasticsearchUtil.findLineChartDateQuotaLevel0(startDate,endDate,teamCode,Integer.parseInt(SaveModel.teamLevel),"22","2",interval+"");
        //咨询总数
        List<SaveModel> list2 = elasticsearchUtil.findLineChartDateQuotaLevel0(startDate,endDate,teamCode,Integer.parseInt(SaveModel.teamLevel),"3","2",interval+"");
        Map<String, Object> map = null;
        List<Map<String, Object>> noReyList = new ArrayList<>();
        for (SaveModel one:list) {
            map = new HashMap<>();
            if ("0".equals(type)) {
                map.put("weekOfMonth",DateUtil.getWeekOfMonth(dateFormat.format(one.getQuotaDate())));
            }else{
                map.put("dateNo",dateFormat.format(one.getQuotaDate()));
            }
            map.put("noRely",one.getResult2().longValue());
            noReyList.add(map);
        }
        List<Map<String, Object>> totalList = new ArrayList<>();
        for (SaveModel one:list) {
            map = new HashMap<>();
            if ("0".equals(type)) {
                map.put("weekOfMonth",DateUtil.getWeekOfMonth(dateFormat.format(one.getQuotaDate())));
            }else{
                map.put("dateNo",dateFormat.format(one.getQuotaDate()));
            }
            map.put("noRely",one.getResult2().longValue());
            totalList.add(map);
        }
        JSONObject result = new JSONObject();
        result.put("noReyList", noReyList);
        result.put("totalList", totalList);
        return result;
    }
    /**
     * 获取团队随访量折线统计图(弃用)
     *
     * @param type
     * @param teamCode
     * @param startDate
     * @param endDate
     * @return
     */
    public JSONObject getTeamFollowupLine(String teamCode, String startDate, String endDate, String type) throws Exception{
        Integer interval = Integer.parseInt(type)+2;
        List<SaveModel> list = elasticsearchUtil.findLineChartDateQuotaLevel0(startDate,endDate,teamCode,Integer.parseInt(SaveModel.teamLevel),"4","2",interval+"");
        Map<String, Object> map = null;
        List<Map<String, Object>> totalList = new ArrayList<>();
        for(SaveModel one:list){
            map = new HashMap<>();
            if ("0".equals(type)) {
                map.put("dateNo",dateFormat.format(one.getQuotaDate()));
            }else{
                map.put("weekOfMonth",DateUtil.getWeekOfMonth(dateFormat.format(one.getQuotaDate())));
            }
            map.put("followupCount",one.getResult2().longValue());
            totalList.add(map);
        }
        return null;
    }
    /**
     * 获取待预约量团队统计折线图
     * @param teamCode
     * @param startDate
     * @param endDate
     * @param type
     * @return
     */
    public JSONArray getTeamResLine(String teamCode, String startDate, String endDate, String type) throws Exception{
        startDate = elasticsearchUtil.changeTime(startDate + " 00:00:00");
        endDate = elasticsearchUtil.changeTime(endDate + " 23:59:59");
        Integer interval = Integer.parseInt(type)+2;
        List<SaveModel> list = elasticsearchUtil.findLineChartDateQuotaLevel0(startDate,endDate,teamCode,Integer.parseInt(SaveModel.teamLevel),"27","2",interval+"");
        Map<String, Object> map = null;
        List<Map<String, Object>> totalList = new ArrayList<>();
        for(SaveModel one:list){
            map = new HashMap<>();
            if ("0".equals(type)) {
                map.put("dateNo",dateFormat.format(one.getQuotaDate()));
            }else{
                map.put("weekOfMonth",DateUtil.getWeekOfMonth(dateFormat.format(one.getQuotaDate())));
            }
            map.put("reservationCount",one.getResult2().longValue());
            totalList.add(map);
        }
        return new JSONArray(totalList);
    }
    public Map<String,Object> getPrescriptionCount(int level,String area,String disease) throws Exception{
        String index ="58";
        Map<String,Object> rs = new HashedMap();
@ -2435,4 +2703,106 @@ public class StatisticsESService {
        }
        return rs;
    }
    public JSONArray getTeamGuidLine(String teamCode, String startDate, String endDate, String type) throws Exception{
        startDate = elasticsearchUtil.changeTime(startDate + " 00:00:00");
        endDate = elasticsearchUtil.changeTime(endDate + " 23:59:59");
        Integer interval = Integer.parseInt(type)+2;
        List<SaveModel> list = elasticsearchUtil.findLineChartDateQuotaLevel0(startDate,endDate,teamCode,Integer.parseInt(SaveModel.teamLevel),"5","2",interval+"");
        Map<String, Object> map = null;
        List<Map<String, Object>> totalList = new ArrayList<>();
        for(SaveModel one:list){
            map = new HashMap<>();
            if ("0".equals(type)) {
                map.put("dateNo",dateFormat.format(one.getQuotaDate()));
            }else{
                map.put("weekOfMonth",DateUtil.getWeekOfMonth(dateFormat.format(one.getQuotaDate())));
            }
            map.put("guidanceCount",one.getResult2().longValue());
            totalList.add(map);
        }
        return new JSONArray(totalList);
    }
    /**
     * 续签 签入、签出统计
     * @param teamCode
     * @param startDate
     * @param endDate
     * @param type
     * @return
     */
    public JSONObject getTeamRenewChangeLine(String teamCode, String startDate, String endDate, String type) throws Exception{
        startDate = elasticsearchUtil.changeTime(startDate + " 00:00:00");
        endDate = elasticsearchUtil.changeTime(endDate + " 23:59:59");
        Integer interval = Integer.parseInt(type)+2;
        List<SaveModel> inData = elasticsearchUtil.findLineChartDateQuotaLevel0(startDate,endDate,teamCode,Integer.parseInt(SaveModel.teamLevel),"34","2",interval+"");
        List<SaveModel> outData = elasticsearchUtil.findLineChartDateQuotaLevel0(startDate,endDate,teamCode,Integer.parseInt(SaveModel.teamLevel),"35","2",interval+"");
        return null;
    }
    /**
     *
     * @param level 等级
     * @param area 等级编码
     * @param disease 疾病编码
     * @param type 类型1.总量,2.已完成,3.居民取消,4.审核不通过,5.进行中,6.其他原因取消
     * @return
     */
    public List<Map<String,Object>> getPrescriptionTotalHistogram(int level,String area,String disease,String type) throws Exception{
        String index ="60";
        List<Map<String,Object>> rs =new ArrayList<>();
        Calendar dd = Calendar.getInstance();//定义日期实例
        Date endDate = new Date();
        dd.setTime(endDate);
        for(int i=1;i<7;i++){
            Map<String,Object> mc = new HashedMap();
            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM");
            String date = sdf.format(dd.getTime());
            mc.put("month",date);
            mc.put("count",0);
            dd.add(Calendar.MONTH,-1);
            rs.add(mc);
        }
        String startTime = DateUtil.dateToStr(dd.getTime(),"YYYY-MM-dd HH:mm:ss");
        String endTime = DateUtil.dateToStr(new Date(),"YYYY-MM-dd HH:mm:ss");
        List<SaveModel> resultList = new ArrayList<>();
        //类型1.总量,2.已完成,3.居民取消,4.审核不通过,5.进行中,6.其他原因取消
        if("1".equals(type)){
            //总数
            resultList =  elasticsearchUtil.findLineChartDateQuotaLevel1(null,null,area,level,index,"2","3",disease);
        }else if("2".equals(type)){
            //进行中
            resultList =  elasticsearchUtil.findLineChartDateQuotaLevel2(null,null,area,level,index,"2","3",disease,"1");
        }else if("3".equals(type)){
            //已完成
            resultList =  elasticsearchUtil.findLineChartDateQuotaLevel2(null,null,area,level,index,"2","3",disease,"2");
        }else if("4".equals(type)){
            //已经取消
            resultList =  elasticsearchUtil.findLineChartDateQuotaLevel2(null,null,area,level,index,"2","3",disease,"3");
        }else if("5".equals(type)){
            //审核不通过
            resultList =  elasticsearchUtil.findLineChartDateQuotaLevel2(null,null,area,level,index,"2","3",disease,"4");
        }else if("6".equals(type)){
            //其他原因取消
            resultList =  elasticsearchUtil.findLineChartDateQuotaLevel2(null,null,area,level,index,"2","3",disease,"5");
        }
        for(Map<String,Object> m:rs){
            Iterator iterator = resultList.iterator();
            while (iterator.hasNext()){
                SaveModel saveModel = (SaveModel)iterator.next();
                String monthKey = (String)m.get("month");
                String monthKeyEs = DateUtil.changeQuotaDate(saveModel.getQuotaDate());
                if(monthKey.equals(monthKeyEs)){
                    m.put("count",saveModel.getResult2());
                }
            }
        }
        return rs;
    }
}

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

@ -24,6 +24,7 @@ public class DateUtil {
	public static final String YYYY_MM_DD_HH_MM_SS = "yyyy-MM-dd HH:mm:ss";
	public static final String YYYY_M_D_HH_MM_SS = "yyyy/M/d HH:mm:ss";
	public static final String YYYYMMddHHmmssSSS  = "yyyyMMddHHmmssSSS";
	public static final String YYYY_MM ="yyyy-MM";
	/**
@ -1063,4 +1064,25 @@ public class DateUtil {
		return y+m+d;
	}
	public static int getWeekOfMonth(String dateString){
		Date date = strToDate(dateString);
		return getWeekOfMonth(date);
	}
	public static int getWeekOfMonth(Date date){
		Calendar calendar = Calendar.getInstance();
		calendar.setTime(date);
		int weekOfMonth = calendar.get(Calendar.WEEK_OF_MONTH);
		return weekOfMonth;
	}
	//将时间维度查出来的quotaDate转成yyyy-MM
	public static String changeQuotaDate(Date quotaDate){
		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM");
		String  date = sdf.format(quotaDate);
		return date;
	}
}

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

@ -686,7 +686,7 @@ public class ElasticsearchUtil {
     * @throws Exception
     */
    public List<SaveModel> findLineChartDateQuotaLevel0(String startDate,String endDate,  String area, int level, String index, String timelevel,String interval) throws Exception {
        List list = findDateQuotaLevel0(startDate, endDate, area, level, index, timelevel, interval, null);
        List list =  findDateQuotaLevel0(startDate, endDate, area, level, index, timelevel, interval, null);
        return list;
    }
    /**

+ 418 - 243
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/FileUploadController.java

@ -1,24 +1,34 @@
package com.yihu.wlyy.web.common;
import java.beans.Encoder;
import java.io.*;
import java.nio.charset.Charset;
import java.text.SimpleDateFormat;
import java.util.*;
import javax.servlet.ServletRequest;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.sound.sampled.AudioFileFormat;
import javax.sound.sampled.AudioFormat;
import javax.sound.sampled.AudioInputStream;
import javax.sound.sampled.AudioSystem;
import com.fasterxml.jackson.databind.node.ObjectNode;
import com.yihu.wlyy.util.CommonUtil;
import com.yihu.wlyy.util.*;
import com.yihu.wlyy.util.fastdfs.FastDFSUtil;
import com.yihu.wlyy.web.third.gateway.vo.UploadModel;
import com.yihu.wlyy.web.third.gateway.vo.base.BaseResultModel;
import com.yihu.wlyy.web.third.gateway.vo.base.ResultOneModel;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.codec.EncoderException;
import org.apache.commons.io.FileUtils;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.ContentType;
import org.apache.http.entity.mime.MultipartEntityBuilder;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
@ -27,14 +37,13 @@ import org.springframework.stereotype.Controller;
import org.springframework.util.FileCopyUtils;
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.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import com.yihu.wlyy.util.DateUtil;
import com.yihu.wlyy.util.ImageCompress;
import com.yihu.wlyy.util.SystemConf;
import com.yihu.wlyy.web.BaseController;
import org.springframework.web.multipart.MultipartRequest;
@Controller
@RequestMapping(value = "/upload", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@ -47,6 +56,10 @@ public class FileUploadController extends BaseController {
    private CommonUtil CommonUtil;
    @Value("${fastDFS.fastdfs_file_url}")
    private String fastdfs_file_url;
    @Value("${neiwang.enable}")
    private Boolean isneiwang = false;  //如果不是内网项目要转到到内网wlyy在上传
    @Value("${neiwang.wlyy}")
    private String neiwangWlyy;  //内网的项目地址
    /**
     * 患者头像上传
@ -58,32 +71,36 @@ public class FileUploadController extends BaseController {
    @RequestMapping(value = "patientPhoto", method = RequestMethod.POST/* , headers = "Accept=image/png" */)
    @ResponseBody
    public String patientPhoto(HttpServletRequest request, HttpServletResponse response, String photo) {
        try {
            MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
            Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
            String fileName = null;
            String firstPhoto = null;
            for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
                // 上传文件
                MultipartFile mf = entity.getValue();
                fileName = mf.getOriginalFilename();
                String fileExt = fileName.substring(fileName.lastIndexOf(".") + 1).toLowerCase();
                // 重命名文件
                firstPhoto = photo.substring(0, photo.lastIndexOf(".")) + "_small." + fileExt;
                File uploadFile = new File(SystemConf.getInstance().getTempPath() + File.separator + firstPhoto);
                // 拷贝文件流到指定文件路径
                FileCopyUtils.copy(mf.getBytes(), uploadFile);
        if (isneiwang) {
            try {
                MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
                Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
                String fileName = null;
                String firstPhoto = null;
                for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
                    // 上传文件
                    MultipartFile mf = entity.getValue();
                    fileName = mf.getOriginalFilename();
                    String fileExt = fileName.substring(fileName.lastIndexOf(".") + 1).toLowerCase();
                    // 重命名文件
                    firstPhoto = photo.substring(0, photo.lastIndexOf(".")) + "_small." + fileExt;
                    File uploadFile = new File(SystemConf.getInstance().getTempPath() + File.separator + firstPhoto);
                    // 拷贝文件流到指定文件路径
                    FileCopyUtils.copy(mf.getBytes(), uploadFile);
                }
                JSONObject json = new JSONObject();
                json.put("status", 200);
                json.put("msg", "上传成功");
                // 图片标识对象的HTTP链接
                json.put("urls", String.join(",", firstPhoto));
                System.out.println("图片上传:" + json.toString());
                return json.toString();
            } catch (Exception e) {
                error(e);
                return error(-1, "上传失败");
            }
            JSONObject json = new JSONObject();
            json.put("status", 200);
            json.put("msg", "上传成功");
            // 图片标识对象的HTTP链接
            json.put("urls", String.join(",", firstPhoto));
            System.out.println("图片上传:" + json.toString());
            return json.toString();
        } catch (Exception e) {
            error(e);
            return error(-1, "上传失败");
        } else {
            return toNeiWang(request, response);
        }
    }
@ -97,65 +114,69 @@ public class FileUploadController extends BaseController {
    @RequestMapping(value = "image", method = RequestMethod.POST/* , headers = "Accept=image/png" */)
    @ResponseBody
    public String image(HttpServletRequest request, HttpServletResponse response) {
        // 圖片列表
        List<File> images = new ArrayList<File>();
        List<String> tempPaths = new ArrayList<String>();
        // 文件保存的临时路径
        String tempPath = SystemConf.getInstance().getTempPath() + File.separator;
        // 拼接年月日路径
        String datePath = DateUtil.getStringDate("yyyy") + File.separator + DateUtil.getStringDate("MM") + File.separator + DateUtil.getStringDate("dd") + File.separator;
        try {
            MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
            Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
            // 创建文件夹
            File file = new File(tempPath + datePath);
            if (!file.exists()) {
                file.mkdirs();
            }
            String fileName = null;
            for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
                // 上传文件
                MultipartFile mf = entity.getValue();
                fileName = mf.getOriginalFilename();
                String fileExt = fileName.substring(fileName.lastIndexOf(".") + 1).toLowerCase();
                // 重命名文件
                SimpleDateFormat df = new SimpleDateFormat("yyyyMMddHHmmss");
                String newFileName = df.format(new Date()) + "_" + new Random().nextInt(1000) + "." + fileExt;
                File uploadFile = new File(tempPath + datePath + newFileName);
                // 拷贝文件流到指定文件路径
                FileCopyUtils.copy(mf.getBytes(), uploadFile);
                // 生成缩略图
                ImageCompress.compress(uploadFile.getAbsolutePath(), uploadFile.getAbsolutePath() + "_small", 300, 300);
                // 添加到上传成功数组中
                images.add(uploadFile);
                tempPaths.add(datePath + newFileName);
            }
            String urls = "";
            for (String image : tempPaths) {
                if (urls.length() == 0) {
                    urls = image;
                } else {
                    urls += "," + image;
                }
            }
            JSONObject json = new JSONObject();
            json.put("status", 200);
            json.put("msg", "上传成功");
            // 图片标识对象的HTTP链接
            json.put("urls", urls);
            System.out.println("图片上传:" + json.toString());
            return json.toString();
        } catch (Exception e) {
            error(e);
        if (isneiwang) {
            // 圖片列表
            List<File> images = new ArrayList<File>();
            List<String> tempPaths = new ArrayList<String>();
            // 文件保存的临时路径
            String tempPath = SystemConf.getInstance().getTempPath() + File.separator;
            // 拼接年月日路径
            String datePath = DateUtil.getStringDate("yyyy") + File.separator + DateUtil.getStringDate("MM") + File.separator + DateUtil.getStringDate("dd") + File.separator;
            try {
                // 清除垃圾图片
                for (File file : images) {
                    FileUtils.forceDelete(file);
                MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
                Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
                // 创建文件夹
                File file = new File(tempPath + datePath);
                if (!file.exists()) {
                    file.mkdirs();
                }
                String fileName = null;
                for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
                    // 上传文件
                    MultipartFile mf = entity.getValue();
                    fileName = mf.getOriginalFilename();
                    String fileExt = fileName.substring(fileName.lastIndexOf(".") + 1).toLowerCase();
                    // 重命名文件
                    SimpleDateFormat df = new SimpleDateFormat("yyyyMMddHHmmss");
                    String newFileName = df.format(new Date()) + "_" + new Random().nextInt(1000) + "." + fileExt;
                    File uploadFile = new File(tempPath + datePath + newFileName);
                    // 拷贝文件流到指定文件路径
                    FileCopyUtils.copy(mf.getBytes(), uploadFile);
                    // 生成缩略图
                    ImageCompress.compress(uploadFile.getAbsolutePath(), uploadFile.getAbsolutePath() + "_small", 300, 300);
                    // 添加到上传成功数组中
                    images.add(uploadFile);
                    tempPaths.add(datePath + newFileName);
                }
                String urls = "";
                for (String image : tempPaths) {
                    if (urls.length() == 0) {
                        urls = image;
                    } else {
                        urls += "," + image;
                    }
                }
                JSONObject json = new JSONObject();
                json.put("status", 200);
                json.put("msg", "上传成功");
                // 图片标识对象的HTTP链接
                json.put("urls", urls);
                System.out.println("图片上传:" + json.toString());
                return json.toString();
            } catch (Exception e) {
                error(e);
                try {
                    // 清除垃圾图片
                    for (File file : images) {
                        FileUtils.forceDelete(file);
                    }
                } catch (Exception e2) {
                    error(e2);
                }
            } catch (Exception e2) {
                error(e2);
                return error(-1, "上传失败");
            }
            return error(-1, "上传失败");
        } else {
            return toNeiWang(request, response);
        }
    }
@ -169,93 +190,97 @@ public class FileUploadController extends BaseController {
    @RequestMapping(value = "chat", method = RequestMethod.POST)
    @ResponseBody
    public String chatFile(HttpServletRequest request, HttpServletResponse response) {
        List<String> tempPaths = new ArrayList<String>();
        try {
            String fastUrl = fastdfs_file_url;
            String type  = request.getParameter("type");
            MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
            Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
            String fileName = null;
            for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
        if (isneiwang) {
            List<String> tempPaths = new ArrayList<String>();
            try {
                String fastUrl = fastdfs_file_url;
                String type = request.getParameter("type");
                MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
                Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
                String fileName = null;
                for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
                // 上传文件
                MultipartFile mf = entity.getValue();
                fileName = mf.getOriginalFilename();
                    // 上传文件
                    MultipartFile mf = entity.getValue();
                    fileName = mf.getOriginalFilename();
                if("3".equals(type)){
                    String tempPath  =  CommonUtil.saveVoiceToDisk(mf.getInputStream(),fileName);
                    String map3Path = tempPath.substring(0,tempPath.lastIndexOf("."));
                    CommonUtil.changeToMp3(tempPath,map3Path);
                    File tempFile = new File(tempPath);
                    File mp3File = new File(map3Path);
                    ObjectNode objectNode = fastDFSUtil.upload(new FileInputStream(mp3File),"mp3","");
                    //1.3.7 去掉前缀,返回相对路径
                    if ("3".equals(type)) {
                        String tempPath = CommonUtil.saveVoiceToDisk(mf.getInputStream(), fileName);
                        String map3Path = tempPath.substring(0, tempPath.lastIndexOf("."));
                        CommonUtil.changeToMp3(tempPath, map3Path);
                        File tempFile = new File(tempPath);
                        File mp3File = new File(map3Path);
                        ObjectNode objectNode = fastDFSUtil.upload(new FileInputStream(mp3File), "mp3", "");
                        //1.3.7 去掉前缀,返回相对路径
//                    tempPaths.add(fastUrl + objectNode.get("groupName").toString().replaceAll("\"","")
//                            + "/" + objectNode.get("remoteFileName").toString().replaceAll("\"",""));
                    tempPaths.add(objectNode.get("groupName").toString().replaceAll("\"","")
                            + "/" + objectNode.get("remoteFileName").toString().replaceAll("\"",""));
                    if(tempFile!=null){
                        tempFile.delete();
                    }
                    if(mp3File!=null){
                        mp3File.delete();
                    }
                }else if("4".equals(type)){
                    String tempPath  =  CommonUtil.saveVoiceToDisk(mf.getInputStream(),fileName);
                    String pngPath = tempPath.substring(0,tempPath.lastIndexOf("."))+".png";
                    File tempFile = new File(tempPath);
                    File pngFile = new File(pngPath);
                    long times = CommonUtil.getVideoTimeAndImg(tempPath,pngPath);
                    if(times<1000){
                        JSONObject json = new JSONObject();
                        json.put("status", -1);
                        json.put("success",true);
                        json.put("msg", "视频录制时间太短!");
                        json.put("times", times);
                        return json.toString();
                    }
                    ObjectNode imgNode = fastDFSUtil.upload(new FileInputStream(pngPath),"png","");
                    String fileExt = fileName.substring(fileName.lastIndexOf(".") + 1).toLowerCase();
                    ObjectNode videoNode = fastDFSUtil.upload(new FileInputStream(tempPath),fileExt,"");
                        tempPaths.add(objectNode.get("groupName").toString().replaceAll("\"", "")
                                + "/" + objectNode.get("remoteFileName").toString().replaceAll("\"", ""));
                        if (tempFile != null) {
                            tempFile.delete();
                        }
                        if (mp3File != null) {
                            mp3File.delete();
                        }
                    } else if ("4".equals(type)) {
                        String tempPath = CommonUtil.saveVoiceToDisk(mf.getInputStream(), fileName);
                        String pngPath = tempPath.substring(0, tempPath.lastIndexOf(".")) + ".png";
                        File tempFile = new File(tempPath);
                        File pngFile = new File(pngPath);
                        long times = CommonUtil.getVideoTimeAndImg(tempPath, pngPath);
                        if (times < 1000) {
                            JSONObject json = new JSONObject();
                            json.put("status", -1);
                            json.put("success", true);
                            json.put("msg", "视频录制时间太短!");
                            json.put("times", times);
                            return json.toString();
                        }
                        ObjectNode imgNode = fastDFSUtil.upload(new FileInputStream(pngPath), "png", "");
                        String fileExt = fileName.substring(fileName.lastIndexOf(".") + 1).toLowerCase();
                        ObjectNode videoNode = fastDFSUtil.upload(new FileInputStream(tempPath), fileExt, "");
                    //1.3.7 去掉前缀,返回相对路径
                        //1.3.7 去掉前缀,返回相对路径
//                    tempPaths.add(fastUrl + imgNode.get("groupName").toString().replaceAll("\"","")
//                            + "/" + imgNode.get("remoteFileName").toString().replaceAll("\"",""));
//                    tempPaths.add(fastUrl + videoNode.get("groupName").toString().replaceAll("\"","")
//                            + "/" + videoNode.get("remoteFileName").toString().replaceAll("\"",""));
                    tempPaths.add(imgNode.get("groupName").toString().replaceAll("\"","")
                            + "/" + imgNode.get("remoteFileName").toString().replaceAll("\"",""));
                    tempPaths.add(videoNode.get("groupName").toString().replaceAll("\"","")
                            + "/" + videoNode.get("remoteFileName").toString().replaceAll("\"",""));
                    tempPaths.add(times+"");
                    if(tempFile!=null){
                        tempFile.delete();
                    }
                    if(pngFile!=null){
                        pngFile.delete();
                    }
                } else{
                    String fileExt = fileName.substring(fileName.lastIndexOf(".") + 1).toLowerCase();
                    ObjectNode objectNode = fastDFSUtil.upload(mf.getInputStream() ,fileExt,"");
                    //1.3.7 去掉前缀,返回相对路径
                        tempPaths.add(imgNode.get("groupName").toString().replaceAll("\"", "")
                                + "/" + imgNode.get("remoteFileName").toString().replaceAll("\"", ""));
                        tempPaths.add(videoNode.get("groupName").toString().replaceAll("\"", "")
                                + "/" + videoNode.get("remoteFileName").toString().replaceAll("\"", ""));
                        tempPaths.add(times + "");
                        if (tempFile != null) {
                            tempFile.delete();
                        }
                        if (pngFile != null) {
                            pngFile.delete();
                        }
                    } else {
                        String fileExt = fileName.substring(fileName.lastIndexOf(".") + 1).toLowerCase();
                        ObjectNode objectNode = fastDFSUtil.upload(mf.getInputStream(), fileExt, "");
                        //1.3.7 去掉前缀,返回相对路径
//                  tempPaths.add(fastUrl + objectNode.get("groupName").toString().replaceAll("\"","")
//                            + "/" + objectNode.get("remoteFileName").toString().replaceAll("\"",""));
                    tempPaths.add(objectNode.get("groupName").toString().replaceAll("\"","")
                            + "/" + objectNode.get("remoteFileName").toString().replaceAll("\"",""));
                        tempPaths.add(objectNode.get("groupName").toString().replaceAll("\"", "")
                                + "/" + objectNode.get("remoteFileName").toString().replaceAll("\"", ""));
                    }
                }
                String urls = String.join(",", tempPaths);
                JSONObject json = new JSONObject();
                json.put("status", 200);
                json.put("success", true);
                json.put("msg", "上传成功");
                // 图片标识对象的HTTP链接
                json.put("urls", urls);
                System.out.println("附件上传:" + json.toString());
                return json.toString();
            } catch (Exception e) {
                error(e);
                return error(-1, "上传失败");
            }
            String urls = String.join(",", tempPaths);
            JSONObject json = new JSONObject();
            json.put("status", 200);
            json.put("success",true);
            json.put("msg", "上传成功");
            // 图片标识对象的HTTP链接
            json.put("urls", urls);
            System.out.println("附件上传:" + json.toString());
            return json.toString();
        } catch (Exception e) {
            error(e);
            return error(-1, "上传失败");
        } else {
            return toNeiWang(request, response);
        }
    }
@ -269,104 +294,254 @@ public class FileUploadController extends BaseController {
    @RequestMapping(value = "voice", method = RequestMethod.POST)
    @ResponseBody
    public String voice(HttpServletRequest request, HttpServletResponse response) {
        // 圖片列表
        List<File> voices = new ArrayList<File>();
        List<String> tempPaths = new ArrayList<String>();
        // 文件保存的临时路径
        String tempPath = SystemConf.getInstance().getTempPath() + File.separator;
        // 拼接年月日路径
        String datePath = DateUtil.getStringDate("yyyy") + File.separator + DateUtil.getStringDate("MM") + File.separator + DateUtil.getStringDate("dd") + File.separator;
        try {
        if (isneiwang) {
            // 圖片列表
            List<File> voices = new ArrayList<File>();
            List<String> tempPaths = new ArrayList<String>();
            // 文件保存的临时路径
            String tempPath = SystemConf.getInstance().getTempPath() + File.separator;
            // 拼接年月日路径
            String datePath = DateUtil.getStringDate("yyyy") + File.separator + DateUtil.getStringDate("MM") + File.separator + DateUtil.getStringDate("dd") + File.separator;
            try {
                MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
                Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
                // 创建文件夹
                File file = new File(tempPath + datePath);
                if (!file.exists()) {
                    file.mkdirs();
                }
                String fileName = null;
                for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
                    // 上传文件
                    MultipartFile mf = entity.getValue();
                    fileName = mf.getOriginalFilename();
                    String fileExt = fileName.substring(fileName.lastIndexOf(".") + 1).toLowerCase();
                    // 重命名文件
                    SimpleDateFormat df = new SimpleDateFormat("yyyyMMddHHmmss");
                    String newFileName = df.format(new Date()) + "_" + new Random().nextInt(1000) + "." + fileExt;
                    File uploadFile = new File(tempPath + datePath + newFileName);
                    // 拷贝文件流到指定文件路径
                    FileCopyUtils.copy(mf.getBytes(), uploadFile);
                    // 添加到上传成功数组中
                    voices.add(uploadFile);
                    tempPaths.add(datePath + newFileName);
                }
                String urls = "";
                for (String voice : tempPaths) {
                    if (urls.length() == 0) {
                        urls = voice;
                    } else {
                        urls += "," + voice;
                    }
                }
                JSONObject json = new JSONObject();
                json.put("status", 200);
                json.put("msg", "上传成功");
                // 图片标识对象的HTTP链接
                json.put("urls", urls);
                System.out.println("语音上传:" + json.toString());
                return json.toString();
            } catch (Exception e) {
                error(e);
                try {
                    // 清除垃圾图片
                    for (File file : voices) {
                        FileUtils.forceDelete(file);
                    }
                } catch (Exception e2) {
                    error(e2);
                }
                return error(-1, "上传失败");
            }
        } else {
            return toNeiWang(request, response);
        }
    }
    /**
     * 语音上传
     *
     * @param request
     * @param response
     * @return
     */
    @RequestMapping(value = "test", method = RequestMethod.POST)
    @ResponseBody
    public String test(HttpServletRequest request, HttpServletResponse response) throws Exception {
        if (isneiwang) {
            MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
            Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
            // 创建文件夹
            File file = new File(tempPath + datePath);
            if (!file.exists()) {
                file.mkdirs();
            }
            String fileName = null;
            List<String> tempPaths = new ArrayList<String>();
            String fastUrl = fastdfs_file_url;
            for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
                // 上传文件
                MultipartFile mf = entity.getValue();
                fileName = mf.getOriginalFilename();
                String fileName = mf.getOriginalFilename();
                String tempPath = CommonUtil.saveVoiceToDisk(mf.getInputStream(), fileName);
                String pngPath = tempPath.substring(0, tempPath.lastIndexOf(".")) + ".png";
                File tempFile = new File(tempPath);
                File pngFile = new File(pngPath);
                long times = CommonUtil.getVideoTimeAndImg(tempPath, pngPath);
                ObjectNode imgNode = fastDFSUtil.upload(new FileInputStream(pngPath), "png", "");
                String fileExt = fileName.substring(fileName.lastIndexOf(".") + 1).toLowerCase();
                // 重命名文件
                SimpleDateFormat df = new SimpleDateFormat("yyyyMMddHHmmss");
                String newFileName = df.format(new Date()) + "_" + new Random().nextInt(1000) + "." + fileExt;
                File uploadFile = new File(tempPath + datePath + newFileName);
                // 拷贝文件流到指定文件路径
                FileCopyUtils.copy(mf.getBytes(), uploadFile);
                // 添加到上传成功数组中
                voices.add(uploadFile);
                tempPaths.add(datePath + newFileName);
            }
            String urls = "";
            for (String voice : tempPaths) {
                if (urls.length() == 0) {
                    urls = voice;
                } else {
                    urls += "," + voice;
                ObjectNode videoNode = fastDFSUtil.upload(new FileInputStream(tempPath), fileExt, "");
                tempPaths.add(fastUrl + imgNode.get("groupName").toString().replaceAll("\"", "")
                        + "/" + imgNode.get("remoteFileName").toString().replaceAll("\"", ""));
                tempPaths.add(fastUrl + videoNode.get("groupName").toString().replaceAll("\"", "")
                        + "/" + videoNode.get("remoteFileName").toString().replaceAll("\"", ""));
                tempPaths.add(times + "");
                if (tempFile != null) {
                    tempFile.delete();
                }
            }
            JSONObject json = new JSONObject();
            json.put("status", 200);
            json.put("msg", "上传成功");
            // 图片标识对象的HTTP链接
            json.put("urls", urls);
            System.out.println("语音上传:" + json.toString());
            return json.toString();
        } catch (Exception e) {
            error(e);
            try {
                // 清除垃圾图片
                for (File file : voices) {
                    FileUtils.forceDelete(file);
                if (pngFile != null) {
                    pngFile.delete();
                }
            } catch (Exception e2) {
                error(e2);
            }
            return error(-1, "上传失败");
            String urls = String.join(",", tempPaths);
            return urls;
        } else {
            return toNeiWang(request, response);
        }
    }
    /**
     * 语音上传
     * 测试
     *
     * @return
     * @throws IOException
     * @throws IllegalStateException
     */
    @RequestMapping(value = "/test_cwd", method = RequestMethod.POST)
    @ApiOperation(value = "单文件上传")
    @ResponseBody
    public String uploadFile(
            @ApiParam(value = "文件", required = true) @RequestParam(value = "file", required = true) MultipartFile file1,
            HttpServletRequest request,
            HttpServletResponse response
    ) {
        try {
            if (isneiwang) {
                // 圖片列表
                List<File> images = new ArrayList<File>();
                List<String> tempPaths = new ArrayList<String>();
                // 文件保存的临时路径
                String tempPath = SystemConf.getInstance().getTempPath() + File.separator;
                // 拼接年月日路径
                String datePath = DateUtil.getStringDate("yyyy") + File.separator + DateUtil.getStringDate("MM") + File.separator + DateUtil.getStringDate("dd") + File.separator;
                try {
                    MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
                    Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
                    // 创建文件夹
                    File file = new File(tempPath + datePath);
                    if (!file.exists()) {
                        file.mkdirs();
                    }
                    String fileName = null;
                    for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
                        // 上传文件
                        MultipartFile mf = entity.getValue();
                        fileName = mf.getOriginalFilename();
                        String fileExt = fileName.substring(fileName.lastIndexOf(".") + 1).toLowerCase();
                        // 重命名文件
                        SimpleDateFormat df = new SimpleDateFormat("yyyyMMddHHmmss");
                        String newFileName = df.format(new Date()) + "_" + new Random().nextInt(1000) + "." + fileExt;
                        File uploadFile = new File(tempPath + datePath + newFileName);
                        // 拷贝文件流到指定文件路径
                        FileCopyUtils.copy(mf.getBytes(), uploadFile);
                        // 生成缩略图
                        ImageCompress.compress(uploadFile.getAbsolutePath(), uploadFile.getAbsolutePath() + "_small", 300, 300);
                        // 添加到上传成功数组中
                        images.add(uploadFile);
                        tempPaths.add(datePath + newFileName);
                    }
                    String urls = "";
                    for (String image : tempPaths) {
                        if (urls.length() == 0) {
                            urls = image;
                        } else {
                            urls += "," + image;
                        }
                    }
                    JSONObject json = new JSONObject();
                    json.put("status", 200);
                    json.put("msg", "上传成功");
                    // 图片标识对象的HTTP链接
                    json.put("urls", urls);
                    System.out.println("图片上传:" + json.toString());
                    return json.toString();
                } catch (Exception e) {
                    error(e);
                    try {
                        // 清除垃圾图片
                        for (File file : images) {
                            FileUtils.forceDelete(file);
                        }
                    } catch (Exception e2) {
                        error(e2);
                    }
                    return error(-1, "上传失败");
                }
            } else {
                return  toNeiWang(request, response);
            }
        } catch (Exception e) {
            e.printStackTrace();
            // return new ResultOneModel(BaseResultModel.statusEm.file_upload_error.getCode(), BaseResultModel.statusEm.file_upload_error.getMessage() + "," + e.getMessage(), new com.alibaba.fastjson.JSONObject());
            return e.getMessage();
        }
    }
    /**
     * 如果是外网那是发送到内网的服务器
     *
     * @param request
     * @param response
     * @return
     */
    @RequestMapping(value = "test", method = RequestMethod.POST)
    @ResponseBody
    public String test(HttpServletRequest request, HttpServletResponse response) throws Exception {
        MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
        Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
        List<String> tempPaths = new ArrayList<String>();
        String fastUrl = fastdfs_file_url;
        for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
            MultipartFile mf = entity.getValue();
            String fileName = mf.getOriginalFilename();
            String tempPath  =  CommonUtil.saveVoiceToDisk(mf.getInputStream(),fileName);
            String pngPath = tempPath.substring(0,tempPath.lastIndexOf("."))+".png";
            File tempFile = new File(tempPath);
            File pngFile = new File(pngPath);
            long times = CommonUtil.getVideoTimeAndImg(tempPath,pngPath);
            ObjectNode imgNode = fastDFSUtil.upload(new FileInputStream(pngPath),"png","");
            String fileExt = fileName.substring(fileName.lastIndexOf(".") + 1).toLowerCase();
            ObjectNode videoNode = fastDFSUtil.upload(new FileInputStream(tempPath),fileExt,"");
            tempPaths.add(fastUrl + imgNode.get("groupName").toString().replaceAll("\"","")
                    + "/" + imgNode.get("remoteFileName").toString().replaceAll("\"",""));
            tempPaths.add(fastUrl + videoNode.get("groupName").toString().replaceAll("\"","")
                    + "/" + videoNode.get("remoteFileName").toString().replaceAll("\"",""));
            tempPaths.add(times+"");
            if(tempFile!=null){
                tempFile.delete();
    private String toNeiWang(HttpServletRequest request, HttpServletResponse response) {
        try {
            MultipartRequest multipartRequest= (MultipartRequest) request;
            String url = neiwangWlyy + request.getRequestURI();//uri请求路径 http://172.19.103.88/wlyy/upload/chat
            String responseEntity =null;
            for(Map.Entry<String,List<MultipartFile >> one:multipartRequest.getMultiFileMap().entrySet()){
                 responseEntity = request(url,one.getValue().get(0));
            }
            return responseEntity;
        } catch (Exception e) {
            return error(-1, "上传失败");
        }
    }
    private String request(String remote_url, MultipartFile file) {
        CloseableHttpClient httpClient = HttpClientBuilder.create().build();
        System.out.println(file.getOriginalFilename());
        String result = "";
        try {
            String fileName = file.getOriginalFilename();
            HttpPost httpPost = new HttpPost(remote_url);
            MultipartEntityBuilder builder = MultipartEntityBuilder.create();
            builder.addBinaryBody("file", file.getInputStream(), ContentType.MULTIPART_FORM_DATA, fileName);// 文件流
            builder.addTextBody("filename", fileName);// 类似浏览器表单提交,对应input的name和value
            HttpEntity entity = builder.build();
            httpPost.setEntity(entity);
            HttpResponse response = httpClient.execute(httpPost);// 执行提交
            HttpEntity responseEntity = response.getEntity();
            if (responseEntity != null) {
                // 将响应内容转换为字符串
                result = EntityUtils.toString(responseEntity, Charset.forName("UTF-8"));
            }
            if(pngFile!=null){
                pngFile.delete();
        } catch (IOException e) {
            e.printStackTrace();
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            try {
                httpClient.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        String urls = String.join(",", tempPaths);
        return urls;
        return result;
    }
}

+ 120 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/feedback/DoctorAppealController.java

@ -0,0 +1,120 @@
package com.yihu.wlyy.web.doctor.feedback;
import com.alibaba.fastjson.JSONArray;
import com.yihu.wlyy.aop.ObserverRequired;
import com.yihu.wlyy.entity.feedback.Appeal;
import com.yihu.wlyy.service.app.feedback.AppealService;
import com.yihu.wlyy.util.CommonUtil;
import com.yihu.wlyy.util.IdcardValidator;
import com.yihu.wlyy.web.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
/**
 * 因账号申诉不需要登录 所以剥离出来
 * Created by yeshijie on 2017/10/30.
 */
@Controller
@RestController
@RequestMapping(value = "/doctorFeeback/feedback")
@Api(description = "医生端账号申诉")
public class DoctorAppealController extends BaseController{
    @Autowired
    private AppealService appealService;
    @Autowired
    private CommonUtil commonUtil;
    @RequestMapping(value = "/saveAppeal", method = RequestMethod.POST)
    @ApiOperation(value = "医生端保存申诉")
    @ResponseBody
    @ObserverRequired
    public String saveAppeal(
            @ApiParam(name = "description", value = "申诉人描述")
            @RequestParam(value = "description", required = true) String description,
            @ApiParam(name = "type", value = "申诉人类型")
            @RequestParam(value = "type", required = true) int type,
            @ApiParam(name = "images", value = "图片")
            @RequestParam(required = false) String images,
            @ApiParam(name = "phone", value = "手机号码")
            @RequestParam(value = "phone", required = true) String phone,
            @ApiParam(name = "name", value = "申诉人姓名")
            @RequestParam(value = "name", required = true) String name,
            @ApiParam(name = "idcard", value = "申诉人身份证号码")
            @RequestParam(value = "idcard", required = true) String idcard) {
        try {
            // 校验身份证号
            IdcardValidator validator = new IdcardValidator();
            if (validator.isValidatedAllIdcard(idcard)) {
                if (idcard.length() == 15) {
                    idcard = validator.convertIdcarBy15bit(idcard);
                    if (StringUtils.isEmpty(idcard)) {
                        return error(-1, "请输入正确的身份证号!");
                    }
                }
            } else {
                return error(-1, "请输入正确的身份证号!");
            }
            String imagesUrl = null;
            String imageRow = "";
            String imageUrls = "";
            if (StringUtils.isNotEmpty(images)) {
                String[] imgs = images.split(",");
                for (String image : imgs) {
                    if (image.contains("group1")) {
                        imageUrls += image + ",";
                    } else {
                        try {
                            imageRow += commonUtil.copyTempImage(image) + ",";
                        } catch (Exception e) {
                            e.printStackTrace();
                        }
                    }
                }
                imagesUrl = imageUrls + imageRow;
                imagesUrl = imagesUrl.substring(0, imagesUrl.length() - 1);
            }
//             保存到数据库
            appealService.saveAppeal(getUID(),description,type,imagesUrl,phone,2,name,idcard);
            return write(200, "保存成功!");
        } catch (Exception e) {
            error(e);
            return invalidUserException(e, -1, "保存失败!");
        }
    }
    @RequestMapping(value = "findByIdcard", method = RequestMethod.GET)
    @ApiOperation(value = "按身份证查询")
    public String findByIdcard(@ApiParam(name = "idcard", value = "申诉人身份证号码")
                               @RequestParam(value = "idcard", required = true) String idcard,
                               @ApiParam(name = "page", value = "第几页")
                               @RequestParam(value = "page", required = true) Integer page,
                               @ApiParam(name = "pagesize", value = "页面大小")
                               @RequestParam(value = "pagesize", required = true) Integer pagesize){
        try {
            JSONArray jsonArray = appealService.findAppealByIdcard(idcard,getUID(),page,pagesize,2);
            return write(200,"查询成功","list",jsonArray);
        }catch (Exception e){
            error(e);
            return error(-1,"查询失败");
        }
    }
    @RequestMapping(value = "findByCode", method = RequestMethod.GET)
    @ApiOperation(value = "按code查询")
    public String findByCode(@ApiParam(name = "code", value = "code")
                             @RequestParam(value = "code", required = true) String code){
        try {
            Appeal appeal = appealService.findByCode(code);
            return write(200,"查询成功","data",appeal);
        }catch (Exception e){
            error(e);
            return error(-1,"查询失败");
        }
    }
}

+ 28 - 35
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/feedback/DoctorFeedbackController.java

@ -1,32 +1,30 @@
package com.yihu.wlyy.web.doctor.feedback;
import com.alibaba.fastjson.JSONArray;
import com.yihu.wlyy.aop.ObserverRequired;
import com.yihu.wlyy.service.app.feedback.AppealService;
import com.yihu.wlyy.entity.feedback.Feedback;
import com.yihu.wlyy.service.app.feedback.FeedbackService;
import com.yihu.wlyy.util.CommonUtil;
import com.yihu.wlyy.web.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.StringUtils;
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.*;
/**
 * Created by Reece on 2017/5/6.
 */
@Controller
@RestController
@RequestMapping(value = "/doctor/feedback")
@Api(description = "医生端意见反馈与账号申诉")
@Api(description = "医生端意见反馈")
public class DoctorFeedbackController extends BaseController {
    @Autowired
    private FeedbackService feedbackService;
    @Autowired
    private AppealService appealService;
    @Autowired
    private CommonUtil CommonUtil;
    /**
@ -61,37 +59,32 @@ public class DoctorFeedbackController extends BaseController {
        }
    }
    /**
     * 医生端保存账号申诉
     *
     * @param description 问题描述
     * @param type        选择类型
     * @param images      图片,多图逗号分隔
     * @param phone       手机号码
     * @return
     */
    @RequestMapping(value = "/saveAppeal", method = RequestMethod.POST)
    @ApiOperation(value = "医生端保存申诉")
    @ResponseBody
    @ObserverRequired
    public String saveAppeal(
            @RequestParam String description,
            @RequestParam int type,
            @RequestParam(required = false) String images,
            @RequestParam String phone) {
    @RequestMapping(value = "findByCreater", method = RequestMethod.GET)
    @ApiOperation(value = "按身份证查询")
    public String findByIdcard(@ApiParam(name = "page", value = "第几页")
                               @RequestParam(value = "page", required = true) Integer page,
                               @ApiParam(name = "pagesize", value = "页面大小")
                               @RequestParam(value = "pagesize", required = true) Integer pagesize){
        try {
//        图片上传
            if (StringUtils.isNotEmpty(images)) {
                images = CommonUtil.copyTempImage(images);
            }
//             保存到数据库
            appealService.saveAppeal(getUID(),description,type,images,phone,2);
            return write(200, "保存成功!");
        } catch (Exception e) {
            JSONArray jsonArray = feedbackService.findByCreater(getUID(),page,pagesize,2);
            return write(200,"查询成功","list",jsonArray);
        }catch (Exception e){
            error(e);
            return invalidUserException(e, -1, "保存失败!");
            return error(-1,"查询失败");
        }
    }
    @RequestMapping(value = "findByCode", method = RequestMethod.GET)
    @ApiOperation(value = "按code查询")
    public String findByCode(@ApiParam(name = "code", value = "code")
                             @RequestParam(value = "code", required = true) String code){
        try {
            Feedback feedback = feedbackService.findByCode(code);
            return write(200,"查询成功","data",feedback);
        }catch (Exception e){
            error(e);
            return error(-1,"查询失败");
        }
    }
}

+ 2 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/patient/PyhsicExamRemindController.java

@ -38,7 +38,8 @@ public class PyhsicExamRemindController extends BaseController{
        try {
            page = page==null?0:page;
            pagesize = pagesize==null?10:pagesize;
            JSONArray list = physicalExaminationRemindService.getOldPatientByTeamCode(adminTeamCode,page,pagesize);
            JSONArray list = physicalExaminationRemindService.getOldPatientByTeamCode(adminTeamCode,"3782f16386f211e6b394fa163e424525",page,pagesize);
//            JSONArray list = physicalExaminationRemindService.getOldPatientByTeamCode(adminTeamCode,getUID(),page,pagesize);
            return write(200, "查询成功", "data", list);
        } catch (Exception e) {
            e.printStackTrace();
@ -65,7 +66,6 @@ public class PyhsicExamRemindController extends BaseController{
                                      @RequestParam(value = "patient", required = true) String patient){
        try {
            Integer re = physicalExaminationRemindService.singleRemindPhyExam(patient,getUID());
//            Integer re = physicalExaminationRemindService.singleRemindPhyExam(patient,"3782f16386f211e6b394fa163e424525");
            if(re==-1){
                return error(-1, "7天内已提醒过该居民,请不要重复提醒");
            }

+ 120 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/feedback/PatientAppealController.java

@ -0,0 +1,120 @@
package com.yihu.wlyy.web.patient.feedback;
import com.alibaba.fastjson.JSONArray;
import com.yihu.wlyy.entity.feedback.Appeal;
import com.yihu.wlyy.service.app.feedback.AppealService;
import com.yihu.wlyy.util.IdcardValidator;
import com.yihu.wlyy.web.WeixinBaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.StringUtils;
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.RestController;
/**
 * Created by yeshijie on 2017/10/30.
 */
@Controller
@RestController
@RequestMapping(value = "/patientFeedback/feedback")
@Api(description = "居民端意见反馈与账号申诉")
public class PatientAppealController extends WeixinBaseController {
    @Autowired
    private AppealService appealService;
    @Autowired
    private com.yihu.wlyy.util.CommonUtil commonUtil;
    @RequestMapping(value = "/saveAppeal", method = RequestMethod.POST)
    @ApiOperation(value = "居民端保存申诉")
    public String saveAppeal(
            @ApiParam(name = "description", value = "申诉人姓名")
            @RequestParam(value = "description", required = true) String description,
            @ApiParam(name = "type", value = "申诉人类型")
            @RequestParam(value = "type", required = true) int type,
            @ApiParam(name = "images", value = "图片")
            @RequestParam(required = false) String images,
            @ApiParam(name = "phone", value = "手机号码")
            @RequestParam(value = "phone", required = true) String phone,
            @ApiParam(name = "name", value = "申诉人姓名")
            @RequestParam(value = "name", required = true) String name,
            @ApiParam(name = "idcard", value = "申诉人身份证号码")
            @RequestParam(value = "idcard", required = true) String idcard) {
        try {
            // 校验身份证号
            IdcardValidator validator = new IdcardValidator();
            if (validator.isValidatedAllIdcard(idcard)) {
                if (idcard.length() == 15) {
                    idcard = validator.convertIdcarBy15bit(idcard);
                    if (StringUtils.isEmpty(idcard)) {
                        return error(-1, "请输入正确的身份证号!");
                    }
                }
            } else {
                return error(-1, "请输入正确的身份证号!");
            }
//        图片上传
            String photos="";
            if (StringUtils.isNotEmpty(images)) {
                String[] mediaIds = images.split(",");
                for (String mediaId : mediaIds) {
                    if (StringUtils.isEmpty(mediaId)) {
                        continue;
                    }
                    String temp = saveImageToDisk(mediaId);
                    if (StringUtils.isNotEmpty(temp)) {
                        if (photos.length() == 0) {
                            photos = temp;
                        } else {
                            photos += "," + temp;
                        }
                    }
                }
            }
            if (StringUtils.isNotEmpty(photos)) {
                photos = commonUtil.copyTempImage(photos);
            }
//             保存到数据库
            appealService.saveAppeal(getUID(),description,type,photos,phone,1,name,idcard);
            return write(200, "保存成功!");
        } catch (Exception e) {
            error(e);
            return invalidUserException(e, -1, "保存失败!");
        }
    }
    @RequestMapping(value = "findByIdcard", method = RequestMethod.GET)
    @ApiOperation(value = "按身份证查询")
    public String findByIdcard(@ApiParam(name = "idcard", value = "申诉人身份证号码")
                               @RequestParam(value = "idcard", required = false) String idcard,
                               @ApiParam(name = "page", value = "第几页")
                               @RequestParam(value = "page", required = true) Integer page,
                               @ApiParam(name = "pagesize", value = "页面大小")
                               @RequestParam(value = "pagesize", required = true) Integer pagesize){
        try {
            JSONArray jsonArray = appealService.findAppealByIdcard(idcard,getUID(),page,pagesize,1);
            return write(200,"查询成功","list",jsonArray);
        }catch (Exception e){
            error(e);
            return error(-1,"查询失败");
        }
    }
    @RequestMapping(value = "findByCode", method = RequestMethod.GET)
    @ApiOperation(value = "按code查询")
    public String findByCode(@ApiParam(name = "code", value = "code")
                             @RequestParam(value = "code", required = true) String code){
        try {
            Appeal appeal = appealService.findByCode(code);
            return write(200,"查询成功","data",appeal);
        }catch (Exception e){
            error(e);
            return error(-1,"查询失败");
        }
    }
}

+ 33 - 51
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/feedback/PatientFeedbackController.java

@ -1,31 +1,29 @@
package com.yihu.wlyy.web.patient.feedback;
import com.yihu.wlyy.service.app.feedback.AppealService;
import com.alibaba.fastjson.JSONArray;
import com.yihu.wlyy.entity.feedback.Feedback;
import com.yihu.wlyy.service.app.feedback.FeedbackService;
import com.yihu.wlyy.util.CommonUtil;
import com.yihu.wlyy.web.WeixinBaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.StringUtils;
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.*;
/**
 * Created by Reece on 2017/5/6.
 */
@Controller
@RestController
@RequestMapping(value = "/patient/feedback")
@Api(description = "居民端意见反馈与账号申诉")
@Api(description = "居民端意见反馈")
public class PatientFeedbackController extends WeixinBaseController {
    @Autowired
    private FeedbackService feedbackService;
    @Autowired
    private AppealService appealService;
    @Autowired
    private CommonUtil CommonUtil;
    /**
@ -76,58 +74,42 @@ public class PatientFeedbackController extends WeixinBaseController {
        }
    }
    /**
     * 居民端保存账号申诉
     *
     * @param description 问题描述
     * @param type        选择类型
     * @param images      图片,多图逗号分隔
     * @param phone       手机号码
     * @return
     */
    @RequestMapping(value = "/saveAppeal", method = RequestMethod.POST)
    @ApiOperation(value = "居民端保存申诉")
    @ResponseBody
    public String saveAppeal(
            @RequestParam String description,
            @RequestParam int type,
            @RequestParam(required = false) String images,
            @RequestParam String phone) {
    @RequestMapping(value = "findByCreater", method = RequestMethod.GET)
    @ApiOperation(value = "按身份证查询")
    public String findByIdcard(@ApiParam(name = "page", value = "第几页")
                               @RequestParam(value = "page", required = true) Integer page,
                               @ApiParam(name = "pagesize", value = "页面大小")
                               @RequestParam(value = "pagesize", required = true) Integer pagesize){
        try {
//        图片上传
            String photos="";
            if (StringUtils.isNotEmpty(images)) {
                String[] mediaIds = images.split(",");
                for (String mediaId : mediaIds) {
                    if (StringUtils.isEmpty(mediaId)) {
                        continue;
                    }
                    String temp = saveImageToDisk(mediaId);
                    if (StringUtils.isNotEmpty(temp)) {
                        if (photos.length() == 0) {
                            photos = temp;
                        } else {
                            photos += "," + temp;
                        }
                    }
                }
            }
            if (StringUtils.isNotEmpty(photos)) {
                photos = CommonUtil.copyTempImage(photos);
            }
//             保存到数据库
            appealService.saveAppeal(getUID(),description,type,photos,phone,1);
            return write(200, "保存成功!");
        } catch (Exception e) {
            JSONArray jsonArray = feedbackService.findByCreater(getUID(),page,pagesize,1);
            return write(200,"查询成功","list",jsonArray);
        }catch (Exception e){
            error(e);
            return invalidUserException(e, -1, "保存失败!");
            return error(-1,"查询失败");
        }
    }
    @RequestMapping(value = "findByCode", method = RequestMethod.GET)
    @ApiOperation(value = "按code查询")
    public String findByCode(@ApiParam(name = "code", value = "code")
                             @RequestParam(value = "code", required = true) String code){
        try {
            Feedback feedback = feedbackService.findByCode(code);
            return write(200,"查询成功","data",feedback);
        }catch (Exception e){
            error(e);
            return error(-1,"查询失败");
        }
    }
    /**
     * 获取微信服务器图片
     *
     * @return
     */
    @Override
    public String fetchWxImages() {
        String photos = "";
        try {

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

@ -833,7 +833,7 @@ public class EsStatisticsController extends BaseController {
                                   @RequestParam(required = true) String endDate) {
        try {
            return write(200, "查询成功", "data", statisticsService.getStatTitleInfo(getUID(), startDate, endDate));
            return write(200, "查询成功", "data", statisticsESService.getStatTitleInfo(getUID(), startDate, endDate));
            //return write(200, "查询成功", "data", statisticsService.getStatTitleInfo("zbqD201703150228",startDate,endDate));
        } catch (Exception e) {
@ -860,10 +860,10 @@ public class EsStatisticsController extends BaseController {
        try {
            //判断是签约还是续签
            if ("0".equals(signType)) {
                return write(200, "查询成功", "data", statisticsService.getSignCountLineByType(getUID(), type, startDate, endDate));
                return write(200, "查询成功", "data", statisticsESService.getSignCountLineByType(getUID(), type, startDate, endDate));
                //return write(200, "查询成功", "data", statisticsService.getSignCountLineByType("xh1D201703150222",type,startDate,endDate));
            } else {
                return write(200, "查询成功", "data", statisticsService.getRenewCountLineByType(getUID(), type, startDate, endDate));
                return write(200, "查询成功", "data", statisticsESService.getRenewCountLineByType(getUID(), type, startDate, endDate));
                //return write(200, "查询成功", "data", statisticsService.getRenewCountLineByType("xh1D201703150222",type,startDate,endDate));
            }
        } catch (Exception e) {
@ -886,7 +886,7 @@ public class EsStatisticsController extends BaseController {
                                   @RequestParam(required = true) String endDate,
                                   @RequestParam(required = true) String isNow) {
        try {
            return write(200, "查询成功", "data", statisticsService.getReyStatbyTeamNow(getUID(), startDate, endDate, isNow));
            return write(200, "查询成功", "data", statisticsESService.getReyStatbyTeamNow(getUID(), startDate, endDate, isNow));
            //return write(200, "查询成功", "data", statisticsService.getReyStatbyTeamNow("zbqD201703150228",startDate,endDate,isNow));
        } catch (Exception e) {
            error(e);
@ -928,7 +928,7 @@ public class EsStatisticsController extends BaseController {
                             @RequestParam(required = true) String endDate,
                             @RequestParam(required = true) String type) {
        try {
            return write(200, "查询成功", "data", statisticsService.getAvgLine(getUID(), startDate, endDate, type));
            return write(200, "查询成功", "data", statisticsESService.getAvgLine(getUID(), startDate, endDate, type));
            // return write(200, "查询成功", "data", statisticsService.getAvgLine("xh1D201703150222",startDate,endDate,type));
        } catch (Exception e) {
            error(e);
@ -968,7 +968,7 @@ public class EsStatisticsController extends BaseController {
                                      @RequestParam(required = true) String endDate,
                                      @RequestParam(required = true) String type) {
        try {
            return write(200, "查询成功", "data", statisticsService.getTeamConsultCount(teamCode, startDate, endDate, type));
            return write(200, "查询成功", "data", statisticsESService.getTeamConsultCount(teamCode, startDate, endDate, type));
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败");
@ -976,7 +976,7 @@ public class EsStatisticsController extends BaseController {
    }
    /**
     * 计算团队医生月或周咨询未回复和总数折线图
     * 计算团队某个医生月或周咨询未回复和总数折线图
     *
     * @param teamCode
     * @param startDate
@ -1001,7 +1001,7 @@ public class EsStatisticsController extends BaseController {
    }
    /**
     * 获取团队内这成员,未回复数,总数,结束咨询数
     * 获取某个团队内所有成员,未回复数,总数,结束咨询数
     *
     * @param teamCode
     * @param startDate
@ -1025,7 +1025,7 @@ public class EsStatisticsController extends BaseController {
    }
    /**
     * 获取Doctor咨询结果
     * 获取某个Doctor咨询结果
     *
     * @param doctor
     * @param teamCode
@ -1048,7 +1048,7 @@ public class EsStatisticsController extends BaseController {
    }
    /**
     * 获取团队随访量折线统计图
     * 获取团队随访量折线统计图(弃用)
     *
     * @param type
     * @param teamCode
@ -1134,7 +1134,7 @@ public class EsStatisticsController extends BaseController {
    }
    /**
     * 获取待预约量团队统计则线图
     * 获取待预约量团队统计折线图
     *
     * @param teamCode
     * @param type
@ -1149,7 +1149,7 @@ public class EsStatisticsController extends BaseController {
                                 @RequestParam(required = true) String startDate,
                                 @RequestParam(required = true) String endDate) {
        try {
            return write(200, "查询成功", "data", statisticsService.getTeamResLine(teamCode, startDate, endDate, type));
            return write(200, "查询成功", "data", statisticsESService.getTeamResLine(teamCode, startDate, endDate, type));
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败");
@ -1245,7 +1245,7 @@ public class EsStatisticsController extends BaseController {
                                  @RequestParam(required = true) String endDate,
                                  @RequestParam(required = true) String type) {
        try {
            return write(200, "查询成功", "data", statisticsService.getTeamGuidLine(teamCode, startDate, endDate, type));
            return write(200, "查询成功", "data", statisticsESService.getTeamGuidLine(teamCode, startDate, endDate, type));
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败");
@ -1253,7 +1253,7 @@ public class EsStatisticsController extends BaseController {
    }
    /**
     * 获取团队医生则线图
     * 获取团队医生折线图
     *
     * @param teamCode
     * @param startDate
@ -1422,6 +1422,14 @@ public class EsStatisticsController extends BaseController {
        }
    }
    /**
     * 续签 签入、签出统计
     * @param teamCode
     * @param startDate
     * @param endDate
     * @param type
     * @return
     */
    @RequestMapping("/getTeamRenewChangeLine")
    @ResponseBody
    public String getTeamRenewChangeLine(@RequestParam(required = true) String teamCode,
@ -1606,4 +1614,19 @@ public class EsStatisticsController extends BaseController {
            return error(-1, "查询失败");
        }
    }
    @RequestMapping("/getPrescriptionTotalHistogram")
    @ResponseBody
    @ApiOperation("订单统计-中部树状图获取")
    public String getPrescriptionTotalHistogram(@ApiParam(name="level", value="级别") @RequestParam(required = true)String level,
                                                @ApiParam(name="area", value="级别对应编码") @RequestParam(required = true)String area,
                                                @ApiParam(name="disease", value="疾病类型") @RequestParam(required = false)String disease,
                                                @ApiParam(name="type", value="类型1.总量,2.已完成,3.居民取消,4.审核不通过,5.进行中,6.其他原因取消") @RequestParam(required = true)String type){
        try{
            return write(200, "查询成功", "data", statisticsESService.getPrescriptionTotalHistogram(elasticsearchUtil.changeLevel(Integer.valueOf(level)),area,disease,type));
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败");
        }
    }
}

+ 1 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/statistic/StatisticsController.java

@ -1684,6 +1684,7 @@ public class StatisticsController extends BaseController {
    @RequestMapping("/getPrescriptionTotalHistogram")
    @ResponseBody
    @Deprecated
    @ApiOperation("订单统计-中部树状图获取")
    public String getPrescriptionTotalHistogram(@ApiParam(name="level", value="级别") @RequestParam(required = true)String level,
                                                @ApiParam(name="area", value="级别对应编码") @RequestParam(required = true)String area,

+ 5 - 0
patient-co/patient-co-wlyy/src/main/resources/application-dev.yml

@ -109,3 +109,8 @@ activemq:
  url: tcp://172.19.103.87:61616
  queue:
    healtHarticleQueue: healthArticleChannel_dev  #健康文章推送
##如果是外网项目就是flase 内网是true
neiwang:
  enable: true
  wlyy: http://59.61.92.90:8072/wlyy

+ 5 - 0
patient-co/patient-co-wlyy/src/main/resources/application-devtest.yml

@ -109,3 +109,8 @@ activemq:
  url: tcp://172.19.103.87:61616
  queue:
    healtHarticleQueue: healthArticleChannel_devtest  #健康文章推送
##如果是外网项目就是flase 内网是true
neiwang:
  enable: false
  wlyy: http://localhost:8081

+ 4 - 0
patient-co/patient-co-wlyy/src/main/resources/application-local.yml

@ -107,3 +107,7 @@ activemq:
  queue:
    healtHarticleQueue: healthArticleChannel_devtest  #健康文章推送
##如果是外网项目就是flase 内网是true
neiwang:
  enable: true
  wlyy: http://59.61.92.90:8072/wlyy

+ 5 - 0
patient-co/patient-co-wlyy/src/main/resources/application-localtest.yml

@ -108,3 +108,8 @@ activemq:
  url: tcp://172.19.103.87:61616
  queue:
    healtHarticleQueue: healthArticleChannel_devtest  #健康文章推送
##如果是外网项目就是flase 内网是true
neiwang:
  enable: true
  wlyy: http://59.61.92.90:8072/wlyy

+ 5 - 0
patient-co/patient-co-wlyy/src/main/resources/application-prod.yml

@ -108,3 +108,8 @@ activemq:
  url: tcp://172.19.103.87:61616
  queue:
    healtHarticleQueue: healthArticleChannel  #健康文章推送
##如果是外网项目就是flase 内网是true
neiwang:
  enable: false
  wlyy: http://59.61.92.90:8072/wlyy

+ 6 - 1
patient-co/patient-co-wlyy/src/main/resources/application-test.yml

@ -104,4 +104,9 @@ activemq:
  password: admin
  url: tcp://172.19.103.87:61616
  queue:
    healtHarticleQueue: healthArticleChannel_test  #健康文章推送
    healtHarticleQueue: healthArticleChannel_test  #健康文章推送
##如果是外网项目就是flase,false会调用内网http接口项目提交  内网是true直接上传fastDfs
neiwang:
  enable: true
  wlyy: http://59.61.92.90:8072/wlyy