Quellcode durchsuchen

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

yeshijie vor 7 Jahren
Ursprung
Commit
4f46f3e13b

+ 43 - 0
common/common-entity/src/main/java/com/yihu/wlyy/entity/call/CallRecord.java

@ -0,0 +1,43 @@
package com.yihu.wlyy.entity.call;
import com.yihu.wlyy.entity.IdEntity;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;
/**
 * Created by Trick on 2017/11/9.
 */
@Entity
@Table(name = "manage_call_record")
public class CallRecord extends IdEntity {
    private String  code; //业务关联标识
    private String  callerNumber; //主叫号码
    private String  recipientNumber;//被叫号码
    private Integer  answerStatus;//接听状态: 1.接通,2. 队列中放弃,3.接通
    private Integer  serviceType; //服务类型:1.医生转接 2.代理咨询
    private String  serviceContent; //服务内容
    private Date createTime; //创建时间
    private Date  endTime; //通话结束时间
    private Date  updateTime; //更新时间
    private Date  callTime; //呼叫时间
    private String  talkTime; //通话时长(单位秒)格式 hh:mm:ss
    private String  userCode; //客服编码
    private String  userName; //客服名称
    private String  patient; //居民
    private String  patientName; //居民姓名
    private String  idcard; //身份证号
    private String  ssc; //社保卡号
    private String  doctor; //签约医生code
    private String  doctorName; //签约医生姓名
    public String getCode() {
        return code;
    }
    public void setCode(String code) {
        this.code = code;
    }
}

+ 45 - 0
common/common-entity/src/main/java/com/yihu/wlyy/entity/call/CallService.java

@ -0,0 +1,45 @@
package com.yihu.wlyy.entity.call;
import com.yihu.wlyy.entity.IdEntity;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;
/**
 * Created by Trick on 2017/11/9.
 */
@Entity
@Table(name = "manage_call_service")
public class CallService extends IdEntity {
    private String code; //服务编号
    private String callCode; //关联通话记录
    private Integer serverType; //服务类型:0.医生咨询,1.预约挂号
    private String patient; //服务对象(患者code)
    private String patientName; // 服务对象名称(患者名称)
    private String ssc; // 社保卡号
    private String Idcard;  // 居民身份证号
    private String phone;  // 手机号
    private String doctor; // 医生code
    private String doctorName; //医生姓名
    private String serverContent; //服务内容
    private Integer state; //订单状态:0.草稿,1.待处理,2.完成
    private Date createTime; //创建时间
    private Date updateTime; //更新时间
    private String remark; //备注
    private Integer type; //服务类型:0.咨询,2.预约
    private Integer dealType; //处理方式:1.电话回复,2.客服回复
    private Date dealTime; //处理时间
    private Integer dealState; // 处理结果:1.完成,2.无法联系居民
    private String dealContent; // 处理内容
    private Integer dealReason; // 处理取消原因:0.没有号源、1.病人取消
    public String getCode() {
        return code;
    }
    public void setCode(String code) {
        this.code = code;
    }
}

+ 50 - 7
common/common-entity/src/main/java/com/yihu/wlyy/entity/job/QuartzJobConfig.java

@ -1,17 +1,14 @@
package com.yihu.wlyy.entity.job;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import org.hibernate.annotations.GenericGenerator;
import javax.persistence.*;
/**
 * 计划任务
 */
@Entity
@Table(name = "wlyy_job_config")
@Table(name = "wlyy_job_config_cwd")
public class QuartzJobConfig implements java.io.Serializable {
	private String id;
@ -23,6 +20,11 @@ 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() {
@ -31,7 +33,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;
@ -124,4 +126,45 @@ 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;
	}
}

Datei-Diff unterdrückt, da er zu groß ist
+ 1 - 1
common/common-entity/src/main/java/com/yihu/wlyy/entity/message/Message.java


+ 1 - 0
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/controller/common/account/CustomerController.java

@ -70,6 +70,7 @@ public class CustomerController extends BaseController {
            req.getSession().setAttribute("code",curUser.getCode());
            req.getSession().setAttribute("name",curUser.getName());
            req.getSession().setAttribute("isLogin", "true");
            req.getSession().setAttribute("type", curUser.getType());
            req.getSession().setMaxInactiveInterval(-1);//设置session用不过期
            WlyyCustomerLog wlyyCustomerLog = new WlyyCustomerLog();
            wlyyCustomerLog.setCreateTime(new Date());

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

@ -84,9 +84,9 @@ spring:
  profiles: test
  datasource:
    wlyy:
      url: jdbc:mysql://172.17.110.160/wlyy?useUnicode:true&characterEncoding=utf-8&autoReconnect=true
      username: ssgg
      password: ssgg
      url: jdbc:mysql://172.19.103.85/wlyy?useUnicode:true&characterEncoding=utf-8&autoReconnect=true
      username: linzhou
      password: linzhou
    device:
      url: jdbc:mysql://172.19.103.77:3306/device?useUnicode=true&characterEncoding=utf-8&autoReconnect=true
      username: root

+ 18 - 25
patient-co-service/wlyy_device/src/main/java/com/yihu/hos/device/service/DeviceService.java

@ -904,34 +904,27 @@ public class DeviceService {
     * @param patient
     */
    private void sendPrescriptionHealthIndexMsgresult(PatientHealthIndex result, Patient patient) {
        
        List<ConsultTeam> consultTeams = consultTeamDao.findUnfinishedConsult(patient.getCode());
    
        if(1 == result.getType()){
            for (ConsultTeam consultTeam:consultTeams) {
                if(1 == consultTeam.getHealthindexType() || 3 == consultTeam.getHealthindexType()){
                    org.json.JSONObject contentPatient = new org.json.JSONObject();
                    //患者发送的消息
                    contentPatient.put("title", "【本消息为系统提醒】:");
                    contentPatient.put("tzMsg", "体征记录:血糖 "+result.getValue1());
                    contentPatient.put("tzTime", "检测时间:"+DateUtil.dateToStrLong(result.getRecordDate()));
                    contentPatient.put("tzAlert","温馨提示:本条体征为居民上传的健康体征数据,您可以自动填入本次随访记录");
                    //患者发送Im消息
                    ImUtill.sendTopicIM(patient.getCode(), patient.getName(), consultTeam.getConsult(), "16", contentPatient.toString(), null);
                }
            }
        }else if(2 == result.getType()){
            for (ConsultTeam consultTeam:consultTeams) {
                if(2 == consultTeam.getHealthindexType() || 3 == consultTeam.getHealthindexType()){
                    org.json.JSONObject contentPatient = new org.json.JSONObject();
                    //患者发送的消息
                    contentPatient.put("title", "【本消息为系统提醒】:");
        for (ConsultTeam consultTeam:consultTeams) {
            if(consultTeam.getHealthindexType() != null){
                org.json.JSONObject contentPatient = new org.json.JSONObject();
                //患者发送的消息
                contentPatient.put("title", "【本消息为系统提醒】:");
                if(1 == result.getType()){
                    contentPatient.put("tzMsg", "体征记录:血糖 "+result.getValue1()+" mmol/L");
                    contentPatient.put("type",2);
                }else if(2 == result.getType()){
                    contentPatient.put("tzMsg", "体征记录:血压 "+result.getValue1()+"/"+result.getValue2()+" mmHg");
                    contentPatient.put("tzTime", "检测时间:"+DateUtil.dateToStrLong(result.getRecordDate()));
                    contentPatient.put("tzAlert","温馨提示:本条体征为居民上传的健康体征数据,您可以自动填入本次随访记录");
                    //患者发送Im消息
                    ImUtill.sendTopicIM(patient.getCode(), patient.getName(), consultTeam.getConsult(), "16", contentPatient.toString(), null);
                }
                    contentPatient.put("type",1);
                }else{}
            
                contentPatient.put("tzTime", "检测时间:"+DateUtil.dateToStrLong(result.getRecordDate()));
                contentPatient.put("tzAlert","温馨提示:本条体征为居民上传的健康体征数据,您可以");
                contentPatient.put("needUpload","false");
            
                //患者发送Im消息
                ImUtill.sendTopicIM(patient.getCode(), patient.getName(), consultTeam.getConsult(), "16", contentPatient.toString(), null);
            }
        }

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

@ -910,39 +910,28 @@ public class PatientHealthIndexService extends BaseService {
    private void sendPrescriptionHealthIndexMsgresult(DevicePatientHealthIndex result, Patient patient) {
        
        List<ConsultTeam> consultTeams = consultTeamDao.findUnfinishedConsultPrescription(patient.getCode());
        
        if(1 == result.getType()){
            for (ConsultTeam consultTeam:consultTeams) {
                if(1 == consultTeam.getHealthindexType() || 3 == consultTeam.getHealthindexType()){
                    org.json.JSONObject contentPatient = new org.json.JSONObject();
                    //患者发送的消息
                    contentPatient.put("title", "【本消息为系统提醒】:");
    
        for (ConsultTeam consultTeam:consultTeams) {
            if(consultTeam.getHealthindexType() != null){
                org.json.JSONObject contentPatient = new org.json.JSONObject();
                //患者发送的消息
                contentPatient.put("title", "【本消息为系统提醒】:");
                if(1 == result.getType()){
                    contentPatient.put("tzMsg", "体征记录:血糖 "+result.getValue1()+" mmol/L");
                    contentPatient.put("tzTime", "检测时间:"+DateUtil.dateToStrLong(result.getRecordDate()));
                    contentPatient.put("tzAlert","温馨提示:本条体征为居民上传的健康体征数据,您可以");
                    contentPatient.put("needUpload","false");
                    contentPatient.put("type",1);
                    //患者发送Im消息
                    ImUtill.sendTopicIM(patient.getCode(), patient.getName(), consultTeam.getConsult(), "16", contentPatient.toString(), null);
                }
            }
        }else if(2 == result.getType()){
            for (ConsultTeam consultTeam:consultTeams) {
                if(2 == consultTeam.getHealthindexType() || 3 == consultTeam.getHealthindexType()){
                    org.json.JSONObject contentPatient = new org.json.JSONObject();
                    //患者发送的消息
                    contentPatient.put("title", "【本消息为系统提醒】:");
                    contentPatient.put("tzMsg", "体征记录:血压 "+result.getValue1()+"/"+result.getValue2()+" mmHg");
                    contentPatient.put("tzTime", "检测时间:"+DateUtil.dateToStrLong(result.getRecordDate()));
                    contentPatient.put("tzAlert","温馨提示:本条体征为居民上传的健康体征数据,您可以");
                    contentPatient.put("needUpload","false");
                    contentPatient.put("type",2);
                    //患者发送Im消息
                    ImUtill.sendTopicIM(patient.getCode(), patient.getName(), consultTeam.getConsult(), "16", contentPatient.toString(), null);
                }
                }else if(2 == result.getType()){
                    contentPatient.put("tzMsg", "体征记录:血压 "+result.getValue1()+"/"+result.getValue2()+" mmHg");
                    contentPatient.put("type",1);
                }else{}
                
                contentPatient.put("tzTime", "检测时间:"+DateUtil.dateToStrLong(result.getRecordDate()));
                contentPatient.put("tzAlert","温馨提示:本条体征为居民上传的健康体征数据,您可以");
                contentPatient.put("needUpload","false");
                
                //患者发送Im消息
                ImUtill.sendTopicIM(patient.getCode(), patient.getName(), consultTeam.getConsult(), "16", contentPatient.toString(), null);
            }
        }
        
    }
    /**

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

@ -434,7 +434,7 @@ public class StatisticsESService {
//        if (endDate.compareTo(dateFormat.format(new Date())) >= 0) {
//            endDate = elasticsearchUtil.getQuotaTime();
//        }
        List<SaveModel> list = elasticsearchUtil.findOneDateQuotaLevel1(endDate, area, level, index, "2");
        List<SaveModel> list = elasticsearchUtil.findOneDateQuotaLevel1(endDate,endDate, area, level, index, "2");
        List<Map<String, Object>> resultList = new ArrayList<>();
        DecimalFormat df = new DecimalFormat("0.0000");
        long total = 0;
@ -453,10 +453,10 @@ public class StatisticsESService {
                String code = saveModel.getSlaveKey1();
                if (!"2".equals(code)) {
                    total += saveModel.getResult2();
                    total += saveModel.getResult2().intValue();
                }
            } else {
                total += saveModel.getResult2();
                total += saveModel.getResult2().intValue();
            }
            resultList.add(map);
        }
@ -520,8 +520,8 @@ public class StatisticsESService {
     */
    public long getIndexTotal(String endDate, String area, int level, String index, String timeLevel) throws Exception {
        endDate = elasticsearchUtil.changeTime(endDate);
        SaveModel saveModel = elasticsearchUtil.findOneDateQuotaLevel0(endDate, area, level, index, timeLevel);
        //endDate = elasticsearchUtil.changeTime(endDate);
        SaveModel saveModel = elasticsearchUtil.findOneDateQuotaLevel0(endDate,endDate, area, level, index, timeLevel);
        return saveModel.getResult2().longValue();
    }
@ -543,10 +543,10 @@ public class StatisticsESService {
    public JSONObject getRenewPercent(String level, String area, String year) throws Exception {
        String renewIndex = "";
        if ("1".equals(level)) {
        if ("5".equals(level)) {
            //团队的续签量
            renewIndex = "42";
        } else if ("2".equals(level)) {
        } else if ("4".equals(level)) {
            //社区的续签量
            renewIndex = "43";
        } else if ("3".equals(level)) {
@ -2153,13 +2153,13 @@ public class StatisticsESService {
//        Map<String, Object> expenseStatus1Sigjn = getByIndexSingle(date, area, level, "1",dateFormat);
        SaveModel expenseStatus1Sigjn = elasticsearchUtil.findOneDateQuotaLevel0(date, area, level, "1", "2");
        JSONObject jsonObject = new JSONObject();
        if (SaveModel.teamLevel.equals(level)) {
        if (Integer.valueOf(SaveModel.teamLevel)==level) {
            jsonObject.put("name", expenseStatus1Sigjn.getTeamName());
        } else if (SaveModel.OrgLevel.equals(level)) {
        } else if (Integer.valueOf(SaveModel.OrgLevel)==level) {
            jsonObject.put("name", expenseStatus1Sigjn.getHospitalName());
        } else if (SaveModel.townLevel.equals(level)) {
        } else if (Integer.valueOf(SaveModel.townLevel)==level) {
            jsonObject.put("name", expenseStatus1Sigjn.getTownName());
        } else if (SaveModel.cityLevel.equals(level)) {
        } else if (Integer.valueOf(SaveModel.cityLevel)==level) {
            jsonObject.put("name", expenseStatus1Sigjn.getCityName());
        }
        jsonObject.put("code", area);
@ -2247,7 +2247,7 @@ public class StatisticsESService {
        if (StringUtils.isEmpty(lowCode)) {
            //续签量
            renewSaveModels = elasticsearchUtil.findDateQuotaLevel0(timeKey, timeKey, area, level, index, "2", "", lowLevel);
            renewSaveModels = elasticsearchUtil.findDateQuotaLevel0(timeKey, timeKey, area, level, index, "2", "", low_level);
        } else {
            //续签量
            renewSaveModels = elasticsearchUtil.findDateQuotaLevel1(timeKey, timeKey, area, level, index, "2", lowCode, "", low_level);
@ -2275,17 +2275,17 @@ public class StatisticsESService {
            //查询去年的签约转map
            List<SaveModel> yearsList = new ArrayList();
            if (StringUtils.isBlank(lowCode)) {
                yearsList = elasticsearchUtil.findListDateQuotaLevel0(lastDate, "", Integer.valueOf(low_level), "1", "2", "");
                yearsList = elasticsearchUtil.findListDateQuotaLevel0(lastDate,lastDate,area,level,"1","2",low_level);
            } else {
                if ("3".equals(lowCode)) {
                    //老年人
                    yearsList = elasticsearchUtil.findListDateQuotaLevel1(lastDate, "", Integer.valueOf(low_level), "17", "2", "", "3");
                    yearsList = elasticsearchUtil.findListDateQuotaLevel1(lastDate, lastDate, level, "17", "2", low_level, "3");
                } else if ("4".equals(lowCode)) {
                    //高血压
                    yearsList = elasticsearchUtil.findListDateQuotaLevel1(lastDate, "", Integer.valueOf(low_level), "17", "2", "", "1");
                    yearsList = elasticsearchUtil.findListDateQuotaLevel1(lastDate, "", level, "17", "2", low_level, "1");
                } else if ("5".equals(lowCode)) {
                    //糖尿病
                    yearsList = elasticsearchUtil.findListDateQuotaLevel1(lastDate, "", Integer.valueOf(low_level), "17", "2", "", "2");
                    yearsList = elasticsearchUtil.findListDateQuotaLevel1(lastDate, "", level, "17", "2", low_level, "2");
                } else {
                }
            }
@ -2304,26 +2304,28 @@ public class StatisticsESService {
            for (Map<String, Object> reMap : resultList) {
                reMap.put("amount", reMap.get("amount") != null ? Long.valueOf(reMap.get("amount").toString()) : 0L);
                int signNum = 0;
                int renewNum = 0;
                Integer renewNum = null;
                //获取去年签约的人数 默认是上个年度的最后一天
                if (resultMap != null && resultMap.size() > 0) {
                    SaveModel one = resultMap.get(reMap.get("code").toString());
                    SaveModel one = resultMap.get(String.valueOf(reMap.get("code")));
                    if (one != null) {
                        signNum = one.getResult2().intValue();
                    }
                } else {
                }
                if (renewMap != null && renewMap.size() > 0) {
                    renewNum = renewMap.get(reMap.get("code").toString());
                if (renewMap != null && renewMap.size() > 0) {;
                    renewNum = renewMap.get(String.valueOf(reMap.get("code")));
                    if(renewNum==null){
                        renewNum=0;
                    }
                } else {
                }
                reMap.put("renewNum", renewNum);
                reMap.put("signNum", signNum);
                reMap.put("rate", getRange(renewNum, signNum, 2));//续签率是 续签量/去年的签约数
            }
            if ((level == 2 && "5".equals(lowLevel)) || (level == 4) || (level == 3 && "5".equals(lowLevel))) {
            if ((level == 2 && "5".equals(low_level)) || (level == 4) || (level == 3 && "5".equals(low_level))) {
                translateTeamLeaderName(resultList);
            }
            //对结果进行排序

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

@ -1455,7 +1455,7 @@ public class EsStatisticsController extends BaseController {
     * <p>
     * @param index 42,43,44 (52,53,54 服务类型维度)
     * @param level 等级  4 市  3区  2社区 1团队
     * @param area  市 默认是厦门市 350200  区 就是区的code  社区就是社区的code 团队就是团队的code.
     * @param code  市 默认是厦门市 350200  区 就是区的code  社区就是社区的code 团队就是团队的code.
     * @param year  年份 非比传
     * @param lowCode 服务类型维度code(老年人3,高血压1,糖尿病2)
     * @return
@ -1465,7 +1465,7 @@ public class EsStatisticsController extends BaseController {
    public String getRenewPercentAndChangePercent(
            @RequestParam(required = true) String index,//续签index
            @RequestParam(required = true) int level,
            @RequestParam(required = true) String area,
            @RequestParam(required = true) String code,
            @RequestParam(required = false) String year,
            @RequestParam(required = false) String lowCode) {
        try {
@ -1474,7 +1474,7 @@ public class EsStatisticsController extends BaseController {
                year = Constant.getNowYear();
            }*/
            //return write(200, "查询成功", "data", statisticsService.getRenewPercentAndChangePercent(index,level, code, year,lowCode));
            return write(200,"查询成功!","data",statisticsESService.getRenewPercentAndChangePercent(index,elasticsearchUtil.changeLevel(level),area,year,lowCode));
            return write(200,"查询成功!","data",statisticsESService.getRenewPercentAndChangePercent(index,elasticsearchUtil.changeLevel(level),code,year,lowCode));
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败");