瀏覽代碼

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

wujunjie 7 年之前
父節點
當前提交
45b5d9b15d
共有 16 個文件被更改,包括 272 次插入43 次删除
  1. 2 1
      patient-co-manage/wlyy-manage/src/main/webapp/static/develop/lib/plugin/validate/jValidate.js
  2. 1 1
      patient-co/patient-co-figure-label/pom.xml
  3. 32 0
      patient-co/patient-co-figure-label/sql/label_es_sql
  4. 2 0
      patient-co/patient-co-figure-label/src/main/java/com/yihu/wlyy/figure/label/convert/AgeConvert.java
  5. 2 0
      patient-co/patient-co-figure-label/src/main/java/com/yihu/wlyy/figure/label/convert/BirthConvert.java
  6. 2 0
      patient-co/patient-co-figure-label/src/main/java/com/yihu/wlyy/figure/label/convert/ConvertHelper.java
  7. 2 0
      patient-co/patient-co-figure-label/src/main/java/com/yihu/wlyy/figure/label/convert/SexConvert.java
  8. 43 0
      patient-co/patient-co-figure-label/src/main/java/com/yihu/wlyy/figure/label/convert/SignStateConvert.java
  9. 35 5
      patient-co/patient-co-figure-label/src/main/java/com/yihu/wlyy/figure/label/job/Mysql2ESJob.java
  10. 17 1
      patient-co/patient-co-figure-label/src/main/java/com/yihu/wlyy/figure/label/model/SaveModel.java
  11. 7 7
      patient-co/patient-co-figure-label/src/main/java/com/yihu/wlyy/figure/label/service/JobService.java
  12. 12 4
      patient-co/patient-co-figure-label/src/main/java/com/yihu/wlyy/figure/label/storage/Store2ES.java
  13. 46 0
      patient-co/patient-co-figure-label/src/main/java/com/yihu/wlyy/figure/label/util/MD5Util.java
  14. 40 0
      patient-co/patient-co-figure-label/src/main/java/com/yihu/wlyy/figure/label/util/MakeModelIDUtil.java
  15. 26 23
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/device/PatientDeviceService.java
  16. 3 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/wx/WechatCoreController.java

+ 2 - 1
patient-co-manage/wlyy-manage/src/main/webapp/static/develop/lib/plugin/validate/jValidate.js

@ -487,6 +487,7 @@
                if(first.select) first.select();
                first.focus();
            }
            return this.options.onFormValidate(result, this.jForm);
        },
@ -1054,7 +1055,7 @@
        }],
        ['validate-chinese',/^[\u4e00-\u9fa5]+$/],
        ['validate-phone',/^((0[1-9]{3})?(0[12][0-9])?[-])?\d{6,8}$/],
        ['validate-mobile-phone',/^0?(13[0-9]|15[0-9]|18[0-9]|14[57]|17[0-9])[0-9]{8}$/],
        ['validate-mobile-phone',/^0?(13[0-9]|15[0-9]|18[0-9]|14[57]|17[0-9]|19[0-9])[0-9]{8}$/],
        ['validate-mobile-and-phone', function (v,elm,args,metadata) {
            if(/^((0[1-9]{3})?(0[12][0-9])?[-]?)?\d{6,8}$/.test(v) || /^0?(13[0-9]|15[0-9]|18[0-9]|14[57]|17[0-9])[0-9]{8}$/.test(v))
                return true;

+ 1 - 1
patient-co/patient-co-figure-label/pom.xml

@ -81,7 +81,7 @@
        <dependency>
            <groupId>com.yihu</groupId>
            <artifactId>common-data-es-starter</artifactId>
            <version>1.0.2</version>
            <version>1.1.0</version>
        </dependency>
        <dependency>
            <groupId>org.json</groupId>

+ 32 - 0
patient-co/patient-co-figure-label/sql/label_es_sql

@ -0,0 +1,32 @@
-- 新增居民标签索引映射
PUT http://172.19.103.45:9200/figure_label_index
{
  "mappings": {
    "figure_label_type": {
      "properties": {
      	"idcard":{
      		"type":"String"
      	},
      	"labelType":{
      		"type":"String"
      	},
      	"labelCode":{
      		"type":"String"
      	},
      	"labeName":{
      		"type":"String"
      	},
      	"labeValue":{
      		"type":"String"
      	},
         "createTime":{
          		"type":"date",
          		"format":"yyyy-MM-dd HH:mm:ss"
        }
      }
    }
  }
}
-- 给索引建立别名
PUT http://172.19.103.45:9200/figure_label_index/figure_label_index_a

+ 2 - 0
patient-co/patient-co-figure-label/src/main/java/com/yihu/wlyy/figure/label/convert/AgeConvert.java

@ -5,6 +5,7 @@ import com.yihu.wlyy.figure.label.model.DataModel;
import com.yihu.wlyy.figure.label.model.SaveModel;
import com.yihu.wlyy.figure.label.util.ConstantUtil;
import com.yihu.wlyy.figure.label.util.IdCardUtil;
import com.yihu.wlyy.figure.label.util.MakeModelIDUtil;
import org.apache.commons.lang3.time.DateFormatUtils;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;
@ -32,6 +33,7 @@ public class AgeConvert implements Convert {
                    int age = IdCardUtil.getAgeForIdcard(model.getIdcard());
                    String labelCode = getAgeLabelCode(age);
                    SaveModel saveModel = new SaveModel();
                    saveModel.setModelId(MakeModelIDUtil.makeModelID(model,""));
                    saveModel.setLabelType(one.getParentCode());
                    saveModel.setLabelCode(labelCode);
                    saveModel.setLabeName(map.get(labelCode));

+ 2 - 0
patient-co/patient-co-figure-label/src/main/java/com/yihu/wlyy/figure/label/convert/BirthConvert.java

@ -5,6 +5,7 @@ import com.yihu.wlyy.figure.label.model.DataModel;
import com.yihu.wlyy.figure.label.model.SaveModel;
import com.yihu.wlyy.figure.label.util.ConstantUtil;
import com.yihu.wlyy.figure.label.util.IdCardUtil;
import com.yihu.wlyy.figure.label.util.MakeModelIDUtil;
import org.apache.commons.lang3.time.DateFormatUtils;
import org.springframework.util.CollectionUtils;
@ -29,6 +30,7 @@ public class BirthConvert implements Convert {
                        e.printStackTrace();
                    }
                    SaveModel saveModel = new SaveModel();
                    saveModel.setModelId(MakeModelIDUtil.makeModelID(model,birth));
                    saveModel.setIdcard(model.getIdcard());
                    saveModel.setLabelCode(fLlabelDict.getLabelCode());
                    saveModel.setLabelType(fLlabelDict.getParentCode());

+ 2 - 0
patient-co/patient-co-figure-label/src/main/java/com/yihu/wlyy/figure/label/convert/ConvertHelper.java

@ -6,6 +6,8 @@ import com.yihu.wlyy.figure.label.dao.FLLabelDictDao;
import com.yihu.wlyy.figure.label.model.DataModel;
import com.yihu.wlyy.figure.label.model.SaveModel;
import com.yihu.wlyy.figure.label.util.ConstantUtil;
import com.yihu.wlyy.figure.label.util.MD5Util;
import com.yihu.wlyy.figure.label.util.MakeModelIDUtil;
import org.apache.commons.lang3.time.DateFormatUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

+ 2 - 0
patient-co/patient-co-figure-label/src/main/java/com/yihu/wlyy/figure/label/convert/SexConvert.java

@ -5,6 +5,7 @@ import com.yihu.wlyy.figure.label.model.DataModel;
import com.yihu.wlyy.figure.label.model.SaveModel;
import com.yihu.wlyy.figure.label.util.ConstantUtil;
import com.yihu.wlyy.figure.label.util.IdCardUtil;
import com.yihu.wlyy.figure.label.util.MakeModelIDUtil;
import org.apache.commons.lang3.time.DateFormatUtils;
import java.util.*;
@ -24,6 +25,7 @@ public class SexConvert implements Convert{
                model -> {
                    String sex = IdCardUtil.getSexForIdcard(model.getIdcard());
                    SaveModel saveModel = new SaveModel();
                    saveModel.setModelId(MakeModelIDUtil.makeModelID(model,""));
                    saveModel.setLabelType(one.getParentCode());
                    saveModel.setLabelCode(sex);
                    saveModel.setLabeName(map.get(sex));

+ 43 - 0
patient-co/patient-co-figure-label/src/main/java/com/yihu/wlyy/figure/label/convert/SignStateConvert.java

@ -0,0 +1,43 @@
package com.yihu.wlyy.figure.label.convert;
import com.yihu.figure_label.entity.FLlabelDict;
import com.yihu.wlyy.figure.label.model.DataModel;
import com.yihu.wlyy.figure.label.model.SaveModel;
import com.yihu.wlyy.figure.label.util.ConstantUtil;
import com.yihu.wlyy.figure.label.util.IdCardUtil;
import org.apache.commons.lang3.time.DateFormatUtils;
import org.springframework.util.CollectionUtils;
import java.util.*;
/**
 * zd
 * 2018-03-21
 */
public class SignStateConvert implements Convert{
    @Override
    public List<SaveModel> convert(List<DataModel> models,List<FLlabelDict> flLabelDictList) {
        List<SaveModel> saveModels = new ArrayList<>();
        if(CollectionUtils.isEmpty(flLabelDictList)){
            return saveModels;
        }
        FLlabelDict one = flLabelDictList.get(0);
        Map<String,String> map = new HashMap<>();
        flLabelDictList.forEach(
                fLlabelDict -> {
                    map.put(fLlabelDict.getLabelCode(),fLlabelDict.getLabelName());
                }
        );
        models.forEach(
                model -> {
                    SaveModel saveModel = new SaveModel();
                    saveModel.setIdcard(model.getIdcard());
                    saveModel.setLabelType(one.getParentCode());
                    saveModel.setLabeName(map.get(model.getLabelCode()));
                    saveModel.setCreateTime(DateFormatUtils.format(new Date(), ConstantUtil.date_format));
                    saveModels.add(saveModel);
                }
        );
        return saveModels;
    }
}

+ 35 - 5
patient-co/patient-co-figure-label/src/main/java/com/yihu/wlyy/figure/label/job/Mysql2ESJob.java

@ -88,12 +88,14 @@ public class Mysql2ESJob implements Job {
        this.flJobConfigId = (Long)paramsMap.get("jobConfig");
        this.flJobConfig = flJobConfigDao.findById(this.flJobConfigId);
        this.sqlFiledValue = (String)paramsMap.get(this.flJobConfig.getSqlField().toString());
        //this.sqlFiledValue = (String)paramsMap.get(this.flJobConfig.getSqlField().toString());
        this.sqlFiledValue = String.valueOf(paramsMap.get("sqlFiledValue"));
        this.sqlFiledCondition = paramsMap.getString("sqlFiledCondition");
        //没有传增量值,以数据库配置的默认值为查询条件
        if(StringUtils.isEmpty(this.sqlFiledValue)){
            this.sqlFiledValue = this.flJobConfig.getSqlFieldValue();
            this.sqlFiledCondition=">";
        }
        this.sqlFiledCondition = paramsMap.getString("sqlFiledCondition");
        //1抽取数据
        String sql = this.flJobConfig.getSql();
        String sqlFiled = this.flJobConfig.getSqlField();
@ -149,15 +151,43 @@ public class Mysql2ESJob implements Job {
        if(StringUtils.isEmpty(sqlFiledCondition)){
            return result.toString();
        }
        if (sqlFiledValue.contains(",") && sql.contains("where")) {
        String[] sqlFiledConditionStr = {};
        if (sqlFiledCondition.contains(",")){
            sqlFiledConditionStr = sqlFiledCondition.split(",");
        }
        StringBuffer sqlFiledString = new StringBuffer();
        if (sqlFiledConditionStr.length>0 && sqlFiledValue.contains(",")){
            String[] sqlFiledValues = sqlFiledValue.split(",");
            sqlFiledString.append(sqlFiled).append(sqlFiledConditionStr[0]).append("\'"+sqlFiledValues[0]+"\'").append(" and ").append(sqlFiled).append(sqlFiledConditionStr[1]).append("\'"+sqlFiledValues[1]+"\'");
        }else{
            sqlFiledString.append(sqlFiled).append(sqlFiledCondition).append("\'"+sqlFiledValue+"\'");
        }
        if (sql.contains("where")) {
            result.append(" and ").append(sqlFiledString.toString());
        }else if (sql.contains("$")){
            StringBuffer otherCondition = new StringBuffer();
            otherCondition.append(" where ").append(sqlFiledString.toString());
            result.replace(result.indexOf("$"),result.indexOf("$")+1,otherCondition.toString());
        }else {
            result.append(" where ").append(sqlFiledString.toString());
        }
        /*if (sqlFiledValue.contains(",") && sql.contains("where")) {
            String[] sqlFiledValues = sqlFiledValue.split(",");
            result.append("and ").append(sqlFiled).append(sqlFiledCondition).append("\'"+sqlFiledValues[1]+"\'").append(sqlFiledCondition).append("\'"+sqlFiledValues[0]+"\'");
            result.append("and ").append(sqlFiled).append(sqlFiledCondition).append("\'"+sqlFiledValues[1]+"\'").append(" and ").append(sqlFiled).append(sqlFiledCondition).append("\'"+sqlFiledValues[0]+"\'");
        }else if(sql.contains("where")){
            result.append("and ").append(sqlFiled).append(sqlFiledCondition).append("\'"+sqlFiledValue+"\'");
        }else if (sql.contains("$")){
            StringBuffer otherCondition = new StringBuffer();
            otherCondition.append("where ").append(sqlFiled).append(sqlFiledCondition).append("\'"+sqlFiledValue+"\'");
            result.replace(result.indexOf("$"),result.indexOf("$")+1,otherCondition.toString());
        }else {
            result.append("where ").append(sqlFiled).append(sqlFiledCondition).append("\'"+sqlFiledValue+"\'");
        }
        }*/
        return result.toString();
    }
}

+ 17 - 1
patient-co/patient-co-figure-label/src/main/java/com/yihu/wlyy/figure/label/model/SaveModel.java

@ -2,14 +2,21 @@ package com.yihu.wlyy.figure.label.model;
import io.searchbox.annotations.JestId;
import java.io.Serializable;
/**
 * Created by chenweida on 2018/3/7.
 */
public class SaveModel {
public class SaveModel implements Serializable{
    @JestId
    private String id;
    /**
     * 存入elasticsearch的id由 idcard,sex,parentCode,labelName,labelCode MD5加密而成。不用es自动生成的_id,实现数据插入排重
     */
    private String modelId;
    /**
     * 身份证
     */
@ -36,8 +43,17 @@ public class SaveModel {
    /**
     * 创建时间
     */
    private String createTime;
    public String getModelId() {
        return modelId;
    }
    public void setModelId(String modelId) {
        this.modelId = modelId;
    }
    public String getIdcard() {
        return idcard;
    }

+ 7 - 7
patient-co/patient-co-figure-label/src/main/java/com/yihu/wlyy/figure/label/service/JobService.java

@ -146,7 +146,7 @@ public class JobService {
    }
    public void productDataByOneDay(String yesterday) throws Exception {
        String sql="select * from wlyy_job_config_new a where  a.del='1' and a.id !=11 order by a.id asc";
        String sql="select * from fl_job_config a where  a.del='1' and a.id !=11 order by a.id asc";
        SimpleDateFormat dataSimple = new SimpleDateFormat("yyyy-MM-dd");
        Date date = dataSimple.parse(yesterday);
@ -168,7 +168,7 @@ public class JobService {
            params.put("jobConfig", flJobConfig.getId().toString());
            //往quartz框架添加任务
            params.put("sqlFiledValue", daybefore+","+yesterday);
            params.put("sqlFiledCondition", "<");
            params.put("sqlFiledCondition", ">,<");
            if (!StringUtils.isEmpty(FLJobConfig.getJobClass())) {
                quartzHelpers.startNow(getRightClass(FLJobConfig), FLJobConfig.getId() + UUID.randomUUID().toString().replace("-", ""), params);
                Thread.sleep(sleepTime);
@ -206,11 +206,11 @@ public class JobService {
        BeanUtils.copyProperties(FLJobConfig, flJobConfigVO);
        Map<String, Object> params = new HashMap<>();
        params.put("jobConfig", flJobConfigVO.getId().toString());
        params.put("jobConfig", Long.valueOf(flJobConfigVO.getId()));
        //往quartz框架添加任务
        params.put("sqlFiledValue", daybefore + "," + yesterday);
        params.put("sqlFiledCondition", "<");
        params.put("sqlFiledCondition", ">,<");
        if (!StringUtils.isEmpty(FLJobConfig.getJobClass())) {
            quartzHelpers.startNow(getRightClass(FLJobConfig), FLJobConfig.getId() + UUID.randomUUID().toString().replace("-", ""), params);
            Thread.sleep(sleepTime);
@ -231,7 +231,7 @@ public class JobService {
        for (int i = 1; i <= day; i++) {
            //往quartz框架添加任务
            params.put("sqlFiledValue",  getYesterday(0 - i - 1)+","+getYesterday(0 - i));
            params.put("sqlFiledCondition", "<");
            params.put("sqlFiledCondition", ">,<");
            if (!StringUtils.isEmpty(FLJobConfig.getJobClass())) {
                quartzHelpers.startNow(getRightClass(FLJobConfig), FLJobConfig.getId() + UUID.randomUUID().toString().replace("-", ""), params);
                Thread.sleep(sleepTime);
@ -331,7 +331,7 @@ public class JobService {
        //往quartz框架添加任务
        params.put("sqlFiledValue", daybefore + "," + yesterday);
        params.put("sqlFiledCondition", "<");
        params.put("sqlFiledCondition", ">,<");
        if (!StringUtils.isEmpty(FLJobConfig.getJobClass())) {
            quartzHelpers.startNow(getRightClass(FLJobConfig), FLJobConfig.getId() + UUID.randomUUID().toString().replace("-", ""), params);
        }
@ -361,7 +361,7 @@ public class JobService {
            params.put("jobConfig", flJobConfigVO.getId().toString());
            //往quartz框架添加任务
            params.put("sqlFiledValue", daybefore + "," + yesterday);
            params.put("sqlFiledCondition", "<");
            params.put("sqlFiledCondition", ">,<");
            if (!StringUtils.isEmpty(FLJobConfig.getJobClass())) {
                quartzHelpers.startNow(getRightClass(FLJobConfig), FLJobConfig.getId() + UUID.randomUUID().toString().replace("-", ""), params);

+ 12 - 4
patient-co/patient-co-figure-label/src/main/java/com/yihu/wlyy/figure/label/storage/Store2ES.java

@ -1,5 +1,7 @@
package com.yihu.wlyy.figure.label.storage;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.base.es.config.ElastricSearchHelper;
import com.yihu.wlyy.figure.label.model.SaveModel;
import com.yihu.wlyy.figure.label.util.ConstantUtil;
@ -18,18 +20,24 @@ public class Store2ES implements Storager {
    @Override
    public void save(List<SaveModel> modelList) {
        List<Object> list = new ArrayList<>();
        List<String> list = new ArrayList<>();
        int saveCount = 0;
        for(SaveModel saveModel:modelList){
            list.add(saveModel);
            ObjectMapper objectMapper = new ObjectMapper();
            try {
                String str =  objectMapper.writeValueAsString(saveModel);
                list.add(str);
            } catch (JsonProcessingException e) {
                e.printStackTrace();
            }
            //防止内存溢出,一次性存储10W条
            if(list.size() >= 100000){
                elastricSearchHelper.save(ConstantUtil.figure_label_es_index, ConstantUtil.figure_label_es_type, list);
                elastricSearchHelper.saveBulkWithCustomId(ConstantUtil.figure_label_es_index, ConstantUtil.figure_label_es_type, list,"modelId");
                list.clear();
                saveCount ++;
            }else if(modelList.size() - saveCount * 100000 == list.size()){
                //剩余的零头
                elastricSearchHelper.save(ConstantUtil.figure_label_es_index, ConstantUtil.figure_label_es_type, list);
                elastricSearchHelper.saveBulkWithCustomId(ConstantUtil.figure_label_es_index, ConstantUtil.figure_label_es_type, list,"modelId");
            }
        }
    }

+ 46 - 0
patient-co/patient-co-figure-label/src/main/java/com/yihu/wlyy/figure/label/util/MD5Util.java

@ -0,0 +1,46 @@
package com.yihu.wlyy.figure.label.util;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
public class MD5Util {
    // 全局数组
    private final static String[] strDigits = { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f" };
    public MD5Util() {
    }
    // 返回形式为数字跟字符串
    private static String byteToArrayString(byte bByte) {
        int iRet = bByte;
        // System.out.println("iRet="+iRet);
        if (iRet < 0) {
            iRet += 256;
        }
        int iD1 = iRet / 16;
        int iD2 = iRet % 16;
        return strDigits[iD1] + strDigits[iD2];
    }
    // 转换字节数组为16进制字串
    private static String byteToString(byte[] bByte) {
        StringBuffer sBuffer = new StringBuffer();
        for (int i = 0; i < bByte.length; i++) {
            sBuffer.append(byteToArrayString(bByte[i]));
        }
        return sBuffer.toString();
    }
    public static String GetMD5Code(String strObj) {
        String resultString = null;
        try {
            resultString = new String(strObj);
            MessageDigest md = MessageDigest.getInstance("MD5");
            // md.digest() 该函数返回值为存放哈希值结果的byte数组
            resultString = byteToString(md.digest(strObj.getBytes()));
        } catch (NoSuchAlgorithmException ex) {
            ex.printStackTrace();
        }
        return resultString;
    }
}

+ 40 - 0
patient-co/patient-co-figure-label/src/main/java/com/yihu/wlyy/figure/label/util/MakeModelIDUtil.java

@ -0,0 +1,40 @@
package com.yihu.wlyy.figure.label.util;
import com.yihu.wlyy.figure.label.model.DataModel;
import org.springframework.util.StringUtils;
public class MakeModelIDUtil {
    /**
     * 生成存入es的id,确保数据不会重复
     * id由 idcard,parentCode,labelName,labelCode MD5加密而成。不用es自动生成的_id,实现数据插入排重
     * @param dataModel
     * @param labelValue
     * @return
     */
    public static String makeModelID(DataModel dataModel,String labelValue) {
        StringBuilder idStr = new StringBuilder();
        idStr.append(dataModel.getIdcard()).append("-")
                .append(dataModel.getParentCode()).append("-")
                .append(dataModel.getLabelCode()).append("-")
                .append(dataModel.getLabelName());
       if(!StringUtils.isEmpty(labelValue)){
           idStr.append("-").append(labelValue);
       }
        return MD5Util.GetMD5Code(idStr.toString());
    }
    public static void main(String[] args) {
        DataModel dataModel = new DataModel();
        dataModel.setIdcard("350881199004241228");
        dataModel.setParentCode("2");
        dataModel.setLabelCode("1");
        dataModel.setLabelName("健康人群");
        String MD5ID = makeModelID(dataModel,"165cm");
//        String MD5ID = makeModelID(dataModel,"");
        System.out.println(MD5ID);
        System.out.println(MD5ID.length());
    }
}

+ 26 - 23
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/device/PatientDeviceService.java

@ -827,30 +827,33 @@ public class PatientDeviceService extends BaseService {
            json.put("labelType",labelInfo.getLabelType());
            jsonArray.add(json);
        });
        switch (patient.getDiseaseCondition()){
            case 0:
                com.alibaba.fastjson.JSONObject json1 = new com.alibaba.fastjson.JSONObject();
                json1.put("label","0");
                json1.put("labelName","绿标");
                json1.put("labelType","99");
                jsonArray.add(json1);
                break;
            case 1:
                com.alibaba.fastjson.JSONObject json2 = new com.alibaba.fastjson.JSONObject();
                json2.put("label",1);
                json2.put("labelName","黄标");
                json2.put("labelType","99");
                jsonArray.add(json2);
                break;
            case 2:
                com.alibaba.fastjson.JSONObject json3 = new com.alibaba.fastjson.JSONObject();
                json3.put("label",2);
                json3.put("labelName","红标");
                json3.put("labelType","99");
                jsonArray.add(json3);
                break;
            default:break;
        if(patient.getDiseaseCondition()!=null){
            switch (patient.getDiseaseCondition()){
                case 0:
                    com.alibaba.fastjson.JSONObject json1 = new com.alibaba.fastjson.JSONObject();
                    json1.put("label","0");
                    json1.put("labelName","绿标");
                    json1.put("labelType","99");
                    jsonArray.add(json1);
                    break;
                case 1:
                    com.alibaba.fastjson.JSONObject json2 = new com.alibaba.fastjson.JSONObject();
                    json2.put("label",1);
                    json2.put("labelName","黄标");
                    json2.put("labelType","99");
                    jsonArray.add(json2);
                    break;
                case 2:
                    com.alibaba.fastjson.JSONObject json3 = new com.alibaba.fastjson.JSONObject();
                    json3.put("label",2);
                    json3.put("labelName","红标");
                    json3.put("labelType","99");
                    jsonArray.add(json3);
                    break;
                default:break;
            }
        }
        jsonObject.put("labelList",jsonArray);
        //个人信息
        jsonObject.put("sex",patient.getSex());//性別,1男,2女

+ 3 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/wx/WechatCoreController.java

@ -97,10 +97,12 @@ public class WechatCoreController extends WeixinBaseController {
                        if (StringUtils.isNotEmpty(json.getString("openId")) && !("undefined".equals(json.getString("openId")))) {
                            pushMsgTask.putWxMsg(getAccessToken(), json.getInt("type"), json.getString("openId"), null, json);
                        }
                    }
                } else {
                    // 返回消息(图文消息)
                    response.setHeader("Content-type", "text/html;charset=UTF-8");
                    //这句话的意思,是告诉servlet用UTF-8转码,而不是用默认的ISO8859
                    response.setCharacterEncoding("UTF-8");
                    response.getWriter().print(xmlStr);
                }
            } else {