Prechádzať zdrojové kódy

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

# Conflicts:
#	patient-co/patient-co-figure-label/src/main/java/com/yihu/wlyy/figure/label/job/Mysql2ESJob.java
humingfen 7 rokov pred
rodič
commit
6cb1aad0af
51 zmenil súbory, kde vykonal 1302 pridanie a 94 odobranie
  1. 1 0
      common/common-entity/src/main/java/com/yihu/wlyy/entity/patient/SignFamily.java
  2. 23 0
      common/common-entity/src/main/java/com/yihu/wlyy/entity/patient/prescription/PrescriptionInfo.java
  3. 19 3
      common/common-entity/src/main/java/com/yihu/wlyy/entity/zydict/ZyIvOrgPhysicAllotDict.java
  4. BIN
      data/elasticsearch/nodes/0/_state/global-17.st
  5. 0 0
      data/elasticsearch/nodes/0/node.lock
  6. 1 1
      patient-co-customization/patient-co-modern-medicine/src/main/java/com/yihu/mm/config/war/ServletInitializer.java
  7. 19 1
      patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/entity/zydict/ZyIvOrgPhysicAllotDict.java
  8. 1 1
      patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/service/LogService.java
  9. 0 0
      patient-co/patient-co-figure-label/patient-co-figure-label.iml___jb_tmp___
  10. 2 1
      patient-co/patient-co-figure-label/sql/label_es_sql
  11. 48 0
      patient-co/patient-co-figure-label/src/main/java/com/yihu/wlyy/figure/label/convert/AddressConvert.java
  12. 1 5
      patient-co/patient-co-figure-label/src/main/java/com/yihu/wlyy/figure/label/convert/AgeConvert.java
  13. 3 4
      patient-co/patient-co-figure-label/src/main/java/com/yihu/wlyy/figure/label/convert/BirthConvert.java
  14. 50 0
      patient-co/patient-co-figure-label/src/main/java/com/yihu/wlyy/figure/label/convert/ConsultConvert.java
  15. 19 9
      patient-co/patient-co-figure-label/src/main/java/com/yihu/wlyy/figure/label/convert/ConvertHelper.java
  16. 50 0
      patient-co/patient-co-figure-label/src/main/java/com/yihu/wlyy/figure/label/convert/EvaluateConvert.java
  17. 122 0
      patient-co/patient-co-figure-label/src/main/java/com/yihu/wlyy/figure/label/convert/FeedbackConvert.java
  18. 57 0
      patient-co/patient-co-figure-label/src/main/java/com/yihu/wlyy/figure/label/convert/HealthEduArticalConvert.java
  19. 48 0
      patient-co/patient-co-figure-label/src/main/java/com/yihu/wlyy/figure/label/convert/HeightConvert.java
  20. 56 0
      patient-co/patient-co-figure-label/src/main/java/com/yihu/wlyy/figure/label/convert/IsConsultConvert.java
  21. 1 1
      patient-co/patient-co-figure-label/src/main/java/com/yihu/wlyy/figure/label/convert/IsOnlineConvert.java
  22. 54 0
      patient-co/patient-co-figure-label/src/main/java/com/yihu/wlyy/figure/label/convert/OnLineConsultConvert.java
  23. 51 0
      patient-co/patient-co-figure-label/src/main/java/com/yihu/wlyy/figure/label/convert/OnlineAppointmentConvert.java
  24. 76 0
      patient-co/patient-co-figure-label/src/main/java/com/yihu/wlyy/figure/label/convert/ReplyInTimeConvert.java
  25. 3 1
      patient-co/patient-co-figure-label/src/main/java/com/yihu/wlyy/figure/label/convert/SexConvert.java
  26. 47 0
      patient-co/patient-co-figure-label/src/main/java/com/yihu/wlyy/figure/label/convert/SignDoctorConvert.java
  27. 3 1
      patient-co/patient-co-figure-label/src/main/java/com/yihu/wlyy/figure/label/convert/SignStateConvert.java
  28. 49 0
      patient-co/patient-co-figure-label/src/main/java/com/yihu/wlyy/figure/label/convert/SignTeamConvert.java
  29. 52 0
      patient-co/patient-co-figure-label/src/main/java/com/yihu/wlyy/figure/label/convert/WeightConvert.java
  30. 56 0
      patient-co/patient-co-figure-label/src/main/java/com/yihu/wlyy/figure/label/convert/WxSubscribeConvert.java
  31. 34 0
      patient-co/patient-co-figure-label/src/main/java/com/yihu/wlyy/figure/label/enums/JobSqlFieldTypeEnum.java
  32. 1 0
      patient-co/patient-co-figure-label/src/main/java/com/yihu/wlyy/figure/label/extract/MysqlExtracter.java
  33. 90 0
      patient-co/patient-co-figure-label/src/main/java/com/yihu/wlyy/figure/label/job/Es2EsJob.java
  34. 22 5
      patient-co/patient-co-figure-label/src/main/java/com/yihu/wlyy/figure/label/job/Mysql2ESJob.java
  35. 68 16
      patient-co/patient-co-figure-label/src/main/java/com/yihu/wlyy/figure/label/model/DataModel.java
  36. 31 5
      patient-co/patient-co-figure-label/src/main/java/com/yihu/wlyy/figure/label/model/SaveModel.java
  37. 9 3
      patient-co/patient-co-figure-label/src/main/java/com/yihu/wlyy/figure/label/service/JobService.java
  38. 2 2
      patient-co/patient-co-figure-label/src/main/java/com/yihu/wlyy/figure/label/storage/Store2ES.java
  39. 24 0
      patient-co/patient-co-figure-label/src/main/java/com/yihu/wlyy/figure/label/util/ApplicationContextHolderUtil.java
  40. 5 0
      patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/service/app/prescription/PrescriptionService.java
  41. 10 3
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/adapter/PresModeAdapter.java
  42. 3 3
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/message/MessageDao.java
  43. 3 2
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/account/DoctorInfoService.java
  44. 2 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/message/MessageService.java
  45. 25 5
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prescription/PrescriptionInfoService.java
  46. 14 3
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/sign/FamilyContractService.java
  47. 29 2
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/third/jw/ZyDictService.java
  48. 3 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/util/MessageType.java
  49. 2 3
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/prescription/PrescriptionInfoController.java
  50. 12 11
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/sign/DoctorFamilyContractController.java
  51. 1 1
      patient-co/patient-co-wlyy/src/main/resources/application-dev.yml

+ 1 - 0
common/common-entity/src/main/java/com/yihu/wlyy/entity/patient/SignFamily.java

@ -379,6 +379,7 @@ public class SignFamily extends IdEntity {
        this.patientApplyDate = patientApplyDate;
    }
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    @Column(name = "patient_apply_unsgin_date")
    public Date getPatientApplyUnsignDate() {
        return patientApplyUnsignDate;

+ 23 - 0
common/common-entity/src/main/java/com/yihu/wlyy/entity/patient/prescription/PrescriptionInfo.java

@ -5,6 +5,7 @@ import com.yihu.wlyy.entity.IdEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;
/**
 * Created by Administrator on 2017/7/21.
@ -49,6 +50,10 @@ public class PrescriptionInfo extends IdEntity{
    private String physicSkinTestName;//皮试类型名称
    private String remark;//备注
    //非数据库字段
    private Integer dispQuantityUntuckFlag;//门诊数量可拆标志 0不可拆,1可拆
    private Integer dispPackUntuckFlag;//门诊包装可拆标志 0不可拆,1可拆
    @Column(name = "code",unique = true , nullable=false)
    public String getCode() {
        return code;
@ -320,4 +325,22 @@ public class PrescriptionInfo extends IdEntity{
    public void setSubjectClass(String subjectClass) {
        this.subjectClass = subjectClass;
    }
    @Transient
    public Integer getDispQuantityUntuckFlag() {
        return dispQuantityUntuckFlag;
    }
    public void setDispQuantityUntuckFlag(Integer dispQuantityUntuckFlag) {
        this.dispQuantityUntuckFlag = dispQuantityUntuckFlag;
    }
    @Transient
    public Integer getDispPackUntuckFlag() {
        return dispPackUntuckFlag;
    }
    public void setDispPackUntuckFlag(Integer dispPackUntuckFlag) {
        this.dispPackUntuckFlag = dispPackUntuckFlag;
    }
}

+ 19 - 3
common/common-entity/src/main/java/com/yihu/wlyy/entity/zydict/ZyIvOrgPhysicAllotDict.java

@ -4,9 +4,6 @@ import com.yihu.wlyy.entity.IdEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.Table;
/**
@ -21,6 +18,8 @@ public class ZyIvOrgPhysicAllotDict extends IdEntity implements java.io.Serializ
	private String orgCode;//机构编码
	private String physicCode;//药品代码
	private Integer dispQuantityUntuckFlag;//门诊数量可拆标志 0不可拆,1可拆
	private Integer dispPackUntuckFlag;//门诊包装可拆标志 0不可拆,1可拆
	// Constructors
@ -53,4 +52,21 @@ public class ZyIvOrgPhysicAllotDict extends IdEntity implements java.io.Serializ
		this.physicCode = physicCode;
	}
	@Column(name = "disp_quantity_untuck_flag")
	public Integer getDispQuantityUntuckFlag() {
		return dispQuantityUntuckFlag;
	}
	public void setDispQuantityUntuckFlag(Integer dispQuantityUntuckFlag) {
		this.dispQuantityUntuckFlag = dispQuantityUntuckFlag;
	}
	@Column(name = "disp_pack_untuck_flag")
	public Integer getDispPackUntuckFlag() {
		return dispPackUntuckFlag;
	}
	public void setDispPackUntuckFlag(Integer dispPackUntuckFlag) {
		this.dispPackUntuckFlag = dispPackUntuckFlag;
	}
}

BIN
data/elasticsearch/nodes/0/_state/global-17.st


+ 0 - 0
data/elasticsearch/nodes/0/node.lock


+ 1 - 1
patient-co-customization/patient-co-modern-medicine/src/main/java/com/yihu/mm/config/war/ServletInitializer.java

@ -2,7 +2,7 @@ package com.yihu.mm.config.war;//package com.yihu.wlyy.config.war;
import com.yihu.mm.MMApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.context.web.SpringBootServletInitializer;
import org.springframework.boot.web.support.SpringBootServletInitializer;
/**
 * Created by Administrator on 2016.10.14.

+ 19 - 1
patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/entity/zydict/ZyIvOrgPhysicAllotDict.java

@ -19,7 +19,8 @@ public class ZyIvOrgPhysicAllotDict extends IdEntity implements java.io.Serializ
	private String orgCode;//机构编码
	private String physicCode;//药品代码
	private String dispQuantityUntuckFlag;//门诊数量可拆标志
	private String dispPackUntuckFlag;//门诊包装可拆标志
	// Constructors
	/** default constructor */
@ -51,4 +52,21 @@ public class ZyIvOrgPhysicAllotDict extends IdEntity implements java.io.Serializ
		this.physicCode = physicCode;
	}
	@Column(name = "disp_quantity_untuck_flag")
	public String getDispQuantityUntuckFlag() {
		return dispQuantityUntuckFlag;
	}
	public void setDispQuantityUntuckFlag(String dispQuantityUntuckFlag) {
		this.dispQuantityUntuckFlag = dispQuantityUntuckFlag;
	}
	@Column(name = "disp_pack_untuck_flag")
	public String getDispPackUntuckFlag() {
		return dispPackUntuckFlag;
	}
	public void setDispPackUntuckFlag(String dispPackUntuckFlag) {
		this.dispPackUntuckFlag = dispPackUntuckFlag;
	}
}

+ 1 - 1
patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/service/LogService.java

@ -107,7 +107,7 @@ public class LogService {
            detail.setError(error);
            detail.setCreateTime(new Date());
            if(re.length()>10652261){
                detail.setResponse("超过longtext限制");
                detail.setResponse("超过longtext限制:"+re.substring(0,500));
            }else {
                detail.setResponse(JSONObject.toJSONString(re, SerializerFeature.WriteMapNullValue));
            }

+ 0 - 0
patient-co/patient-co-figure-label/patient-co-figure-label.iml___jb_tmp___


+ 2 - 1
patient-co/patient-co-figure-label/sql/label_es_sql

@ -13,7 +13,7 @@ PUT http://172.19.103.45:9200/figure_label_index
      	"labelCode":{
      		"type":"String"
      	},
      	"labeName":{
      	"labelName":{
      		"type":"String"
      	},
      	"labeValue":{
@ -28,5 +28,6 @@ PUT http://172.19.103.45:9200/figure_label_index
  }
}
-- 给索引建立别名
PUT http://172.19.103.45:9200/figure_label_index/figure_label_index_a

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

@ -0,0 +1,48 @@
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.MakeIDUtil;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.time.DateFormatUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
 * @author litaohong on 2018/4/12
 * @project patient-co-management
 * 地址标签转换器
 */
@Component
public class AddressConvert implements Convert{
    @Autowired
    private ConvertHelper convertHelper;
    @Override
    public List<SaveModel> convert(List<DataModel> modelList, List<FlLabelDict> flLabelDictList, String sourceType, String source) {
        List<SaveModel> saveModels = new ArrayList<>();
        FlLabelDict dict = flLabelDictList.get(0);
        for(DataModel dataModel : modelList){
            SaveModel saveModel = new SaveModel();
            saveModel.setId(MakeIDUtil.makeSaveModelID(dataModel,dataModel.getLabelValue()));
            saveModel.setIdcard(dataModel.getIdcard());
            saveModel.setLabelType(dict.getParentCode());
            saveModel.setLabelCode(dict.getLabelCode());
            saveModel.setLabelName(dict.getLabelName());
            saveModel.setLabelValue(dataModel.getLabelValue());
            convertHelper.generateDataSource(dataModel,saveModel,sourceType,source);
            if(StringUtils.isEmpty(saveModel.getSource())){
                return new ArrayList<>();
            }
            saveModel.setCreateTime(DateFormatUtils.format(new Date(), ConstantUtil.date_format));
            saveModels.add(saveModel);
        }
        return saveModels;
    }
}

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

@ -6,7 +6,6 @@ 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.MakeIDUtil;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.time.DateFormatUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@ -28,9 +27,6 @@ public class AgeConvert implements Convert {
    @Override
    public List<SaveModel> convert(List<DataModel> models,List<FlLabelDict> flLabelDictList,String sourceType,String source) {
        List<SaveModel> saveModels = new ArrayList<>();
        if(CollectionUtils.isEmpty(flLabelDictList)){
            return saveModels;
        }
        FlLabelDict one = flLabelDictList.get(0);
        Map<String,String> map = new HashMap<>();
@ -47,7 +43,7 @@ public class AgeConvert implements Convert {
                    saveModel.setId(MakeIDUtil.makeSaveModelID(model,""));
                    saveModel.setLabelType(one.getParentCode());
                    saveModel.setLabelCode(labelCode);
                    saveModel.setLabeName(map.get(labelCode));
                    saveModel.setLabelName(map.get(labelCode));
                    saveModel.setCreateTime(DateFormatUtils.format(new Date(), ConstantUtil.date_format));
                    convertHelper.generateDataSource(model,saveModel,sourceType,source);

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

@ -8,6 +8,7 @@ import com.yihu.wlyy.figure.label.util.IdCardUtil;
import com.yihu.wlyy.figure.label.util.MakeIDUtil;
import org.apache.commons.lang3.time.DateFormatUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
@ -18,6 +19,7 @@ import java.util.List;
 * @author lith on 2018.03.14
 * 生日标签转换器
 */
@Component
public class BirthConvert implements Convert {
    @Autowired
@ -26,9 +28,6 @@ public class BirthConvert implements Convert {
    @Override
    public List<SaveModel> convert(List<DataModel> models,List<FlLabelDict> flLabelDictList,String sourceType,String source) {
        List<SaveModel> saveModels = new ArrayList<>();
        if(CollectionUtils.isEmpty(flLabelDictList)){
            return saveModels;
        }
        FlLabelDict flLabelDict = flLabelDictList.get(0);
        models.forEach(
                model -> {
@ -43,7 +42,7 @@ public class BirthConvert implements Convert {
                    saveModel.setIdcard(model.getIdcard());
                    saveModel.setLabelCode(flLabelDict.getLabelCode());
                    saveModel.setLabelType(flLabelDict.getParentCode());
                    saveModel.setLabeName(flLabelDict.getLabelName());
                    saveModel.setLabelName(flLabelDict.getLabelName());
                    saveModel.setLabelValue(birth);
                    saveModel.setCreateTime(DateFormatUtils.format(new Date(), ConstantUtil.date_format));

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

@ -0,0 +1,50 @@
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.MakeIDUtil;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.time.DateFormatUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.util.*;
/**
 * @author litaohong on 2018/4/8
 * @project patient-co-management
 * 咨询问题标签
 */
@Service
public class ConsultConvert implements Convert{
    @Autowired
    private ConvertHelper convertHelper;
    @Override
    public List<SaveModel> convert(List<DataModel> modelList, List<FlLabelDict> flLabelDictList, String sourceType, String source) {
        List<SaveModel> saveModels = new ArrayList<>();
        FlLabelDict dict = flLabelDictList.get(0);
        for(DataModel dataModel:modelList){
            SaveModel saveModel = new SaveModel();
            saveModel.setId(MakeIDUtil.makeSaveModelID(dataModel,dataModel.getLabelValue()));
            saveModel.setIdcard(dataModel.getIdcard());
            saveModel.setLabelType(dict.getParentCode());
            saveModel.setLabelCode(dict.getLabelCode());
            saveModel.setLabelName(dict.getLabelName());
            saveModel.setLabelValue(dataModel.getLabelValue());
            convertHelper.generateDataSource(dataModel,saveModel,sourceType,source);
            if (StringUtils.isEmpty(saveModel.getSource())) {
                return new ArrayList<>();
            }
            saveModel.setSourceTime(dataModel.getSourceTime());
            saveModel.setCreateTime(DateFormatUtils.format(new Date(), ConstantUtil.date_format));
            saveModels.add(saveModel);
        }
        return saveModels;
    }
}

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

@ -2,10 +2,10 @@ package com.yihu.wlyy.figure.label.convert;
import com.yihu.figure_label.entity.FlLabelDict;
import com.yihu.figure_label.entity.FlLabelDictJob;
import com.yihu.wlyy.figure.label.dao.FLLabelDictDao;
import com.yihu.wlyy.figure.label.enums.SourceTypeEnum;
import com.yihu.wlyy.figure.label.model.DataModel;
import com.yihu.wlyy.figure.label.model.SaveModel;
import com.yihu.wlyy.figure.label.util.ApplicationContextHolderUtil;
import com.yihu.wlyy.figure.label.util.ConstantUtil;
import com.yihu.wlyy.figure.label.util.MakeIDUtil;
import org.apache.commons.lang3.time.DateFormatUtils;
@ -16,6 +16,7 @@ import org.springframework.context.annotation.Scope;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
import java.lang.reflect.Method;
@ -41,17 +42,27 @@ public class ConvertHelper {
     */
    public List<SaveModel> convert(List<DataModel> dataModels, FlLabelDictJob flLabelDictJob,String sourceType,String source) throws Exception {
        List<SaveModel> saveModels = new ArrayList<>();
        //不需要转换
        if (flLabelDictJob == null || StringUtils.isEmpty(flLabelDictJob.getConvertClazz()) || StringUtils.isEmpty(flLabelDictJob.getSql())) {
        //如果源数据为空
        if(CollectionUtils.isEmpty(dataModels)){
            return saveModels;
        }
        //转换器为空表示不需要转换
        if (flLabelDictJob == null || StringUtils.isEmpty(flLabelDictJob.getConvertClazz())) {
            return generateSaveModleWithOutConvert(dataModels,sourceType,source);
        }
        List<FlLabelDict> flLabelDictList = jdbcTemplate.query(flLabelDictJob.getSql(), new BeanPropertyRowMapper(FlLabelDict.class));
        //如果配置的字典为空
        if(CollectionUtils.isEmpty(flLabelDictList)){
            return saveModels;
        }
        try {
            Object obj = Class.forName(flLabelDictJob.getConvertClazz()).newInstance();
            Method method = obj.getClass().getMethod("convert", List.class, List.class);
            saveModels = (List<SaveModel>) method.invoke(obj, dataModels, flLabelDictList);
            Class clazz = Class.forName(flLabelDictJob.getConvertClazz());
            Object obj = ApplicationContextHolderUtil.getContext().getBean(clazz);
            Method method = obj.getClass().getMethod("convert", List.class, List.class,String.class,String.class);
            saveModels = (List<SaveModel>) method.invoke(obj, dataModels, flLabelDictList,sourceType,source);
        } catch (Exception e) {
            logger.error("customized class or convert(List<DataModel> modelList,List<FlLabelDict> flLabelDictList) method not found:" + flLabelDictJob.getConvertClazz());
//          logger.error("customized class or convert(List<DataModel> modelList,List<FlLabelDict> flLabelDictList,String sourceType,String source) method not found:" + flLabelDictJob.getConvertClazz());
            e.printStackTrace();
            return saveModels;
        }
        return saveModels;
@ -73,7 +84,7 @@ public class ConvertHelper {
            saveModel.setId(MakeIDUtil.makeSaveModelID(dataModel,""));
            saveModel.setLabelType(dataModel.getParentCode());
            saveModel.setLabelCode(dataModel.getLabelCode());
            saveModel.setLabeName(dataModel.getLabelName());
            saveModel.setLabelName(dataModel.getLabelName());
            saveModel.setCreateTime(DateFormatUtils.format(new Date(), ConstantUtil.date_format));
            this.generateDataSource(dataModel,saveModel,sourceType,source);
            //如果fl_job_config表配置的id和数据来源不一致,则不保存数据,原子性,全部不保存,不然部分存了部分没存不好剔除数据
@ -130,5 +141,4 @@ public class ConvertHelper {
        saveModel.setSource(source.toString());
        return ;
    }
}

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

@ -0,0 +1,50 @@
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.MakeIDUtil;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.time.DateFormatUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;
import java.util.*;
/**
 * @author litaohong on 2018/4/9
 * @project patient-co-management
 * 评价行为标签
 */
@Component
public class EvaluateConvert implements Convert{
    @Autowired
    private ConvertHelper convertHelper;
    @Override
    public List<SaveModel> convert(List<DataModel> modelList, List<FlLabelDict> flLabelDictList, String sourceType, String source) {
        List<SaveModel> saveModels = new ArrayList<>();
        FlLabelDict dict = flLabelDictList.get(0);
        for(DataModel dataModel:modelList){
            SaveModel saveModel = new SaveModel();
            saveModel.setId(MakeIDUtil.makeSaveModelID(dataModel,dataModel.getLabelValue()));
            saveModel.setIdcard(dataModel.getIdcard());
            saveModel.setLabelType(dict.getParentCode());
            saveModel.setLabelCode(dict.getLabelCode());
            saveModel.setLabelName(dataModel.getLabelName());
            // 评价相关的问题的code(业务id)
            saveModel.setLabelValue(dataModel.getLabelValue());
            convertHelper.generateDataSource(dataModel,saveModel,sourceType,source);
            if (StringUtils.isEmpty(saveModel.getSource())) {
                return new ArrayList<>();
            }
            saveModel.setSourceTime(dataModel.getSourceTime());
            saveModel.setCreateTime(DateFormatUtils.format(new Date(), ConstantUtil.date_format));
            saveModels.add(saveModel);
        }
        return saveModels;
    }
}

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

@ -0,0 +1,122 @@
package com.yihu.wlyy.figure.label.convert;
import com.yihu.base.es.config.ElastricSearchHelper;
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.MakeIDUtil;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.time.DateFormatUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;
import java.util.*;
/**
 * @author litaohong on 2018/4/9
 * @project patient-co-management
 * 反馈行为标签  记录用户是否有反馈过,反馈了几次
 */
@Component
public class FeedbackConvert implements Convert {
    @Autowired
    private ConvertHelper convertHelper;
    @Autowired
    private ElastricSearchHelper elastricSearchHelper;
    private Map<String,String> distinctIdcardMap = new HashMap<>();
    @Override
    public List<SaveModel> convert(List<DataModel> modelList, List<FlLabelDict> flLabelDictList, String sourceType, String source) {
        List<SaveModel> saveModels = new ArrayList<>();
        FlLabelDict dict = flLabelDictList.get(0);
        Map<String,String> mapES = countESFeedbackByIdcard(modelList);
        Map<String,DataModel> modelMap = distinctIdcard(modelList);
        for(String idcard : modelMap.keySet()){
            SaveModel saveModel = new SaveModel();
            saveModel.setId(MakeIDUtil.makeSaveModelID(modelMap.get(idcard),""));
            int value = 0;
            saveModel.setIdcard(idcard);
            saveModel.setLabelType(dict.getParentCode());
            saveModel.setLabelCode(dict.getLabelCode());
            saveModel.setLabelName(dict.getLabelName());
            if(mapES.containsKey(idcard)){
                value = Integer.parseInt(mapES.get(idcard));
            }
            if(distinctIdcardMap.containsKey(idcard)){
                value = Integer.parseInt(distinctIdcardMap.get(idcard)) + value;
            }
            saveModel.setLabelValue(String.valueOf(value));
            convertHelper.generateDataSource(modelMap.get(idcard),saveModel,sourceType,source);
            if (StringUtils.isEmpty(saveModel.getSource())) {
                return new ArrayList<>();
            }
            saveModel.setSourceTime(modelMap.get(idcard).getSourceTime());
            saveModel.setCreateTime(DateFormatUtils.format(new Date(), ConstantUtil.date_format));
            saveModels.add(saveModel);
        }
        return saveModels;
    }
    /**
     * 累加es中每个用户反馈的次数
     * @return
     */
    public Map<String,String> countESFeedbackByIdcard(List<DataModel> modelList){
        Map<String, String> result = new HashMap<>();
        List<Map<String,Object>> list = new ArrayList<>();
        StringBuilder idcardStr = new StringBuilder();
        idcardStr.append("(");
        for (int i = 0; i < modelList.size(); i++) {
            idcardStr.append("'").append(modelList.get(i).getIdcard()).append("'");
            if (i != modelList.size() - 1) {
                idcardStr.append(",");
            }
        }
        idcardStr.append(")");
        //先查找出es中已有的用户的反馈次数
        String querySql = "select labelValue from " + ConstantUtil.figure_label_es_index + "/" + ConstantUtil.figure_label_es_type + " where lableType = 'feedback_dict' and idcard in " + idcardStr.toString();
        list = elastricSearchHelper.excuceSQL(querySql);
        //组装以idcard为key的map
        if(!CollectionUtils.isEmpty(list)){
            list.forEach(
                    data -> {
                        result.put(data.get("idcard").toString(), data.get("lableValue").toString());
                    }
            );
        }
        return result;
    }
    /**
     * 统计从数据库中查询出来的idcard的反馈记录次数,一个人可能会有多条反馈
     * @param modelList
     * @return
     */
    public Map<String,DataModel> distinctIdcard(List<DataModel> modelList){
        Map<String,DataModel> result = new HashMap<>();
        modelList.forEach(
                model ->{
                    if(distinctIdcardMap.containsKey(model.getIdcard())){
                        int count = Integer.parseInt(distinctIdcardMap.get(model.getIdcard())) + 1;
                        distinctIdcardMap.put(model.getIdcard(),String.valueOf(count));
                    }else {
                        distinctIdcardMap.put(model.getIdcard(),"1");
                    }
                    if(result.containsKey(model.getIdcard())){
                        return;
                    }else{
                        result.put(model.getIdcard(),model);
                    }
                }
        );
        return result;
    }
}

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

@ -0,0 +1,57 @@
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.MakeIDUtil;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.time.DateFormatUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;
import java.util.*;
/**
 * @author litaohong on 2018/4/4
 * @project patient-co-management
 * 健康教育文章阅读行为标签转换器
 */
@Component
public class HealthEduArticalConvert implements Convert {
    @Autowired
    private ConvertHelper convertHelper;
    @Override
    public List<SaveModel> convert(List<DataModel> modelList, List<FlLabelDict> flLabelDictList, String sourceType, String source) {
        List<SaveModel> saveModels = new ArrayList<>();
        FlLabelDict dict = flLabelDictList.get(0);
        Map<String,String> dictMap = new HashMap<>();
        flLabelDictList.forEach(
                one ->{
                    dictMap.put(one.getLabelCode(),one.getLabelName());
                }
        );
        for(DataModel dataModel:modelList){
            SaveModel saveModel = new SaveModel();
            saveModel.setId(MakeIDUtil.makeSaveModelID(dataModel,dataModel.getLabelValue()));
            saveModel.setIdcard(dataModel.getIdcard());
            saveModel.setLabelType(dict.getParentCode());
            saveModel.setLabelCode(dataModel.getLabelCode());
            saveModel.setLabelName(dictMap.get(dataModel.getLabelCode()));
            // 健康文章的code(业务表id)
            saveModel.setLabelValue(dataModel.getLabelValue());
            convertHelper.generateDataSource(dataModel,saveModel,sourceType,source);
            if (StringUtils.isEmpty(saveModel.getSource())) {
                return new ArrayList<>();
            }
            saveModel.setSourceTime(dataModel.getSourceTime());
            saveModel.setCreateTime(DateFormatUtils.format(new Date(), ConstantUtil.date_format));
            saveModels.add(saveModel);
        }
        return saveModels;
    }
}

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

@ -0,0 +1,48 @@
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 com.yihu.wlyy.figure.label.util.MakeIDUtil;
import org.apache.commons.lang3.time.DateFormatUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.util.StringUtils;
import java.util.*;
/**
 * @author lith on 2018.04.11
 * 身高标签转换器
 */
@Component
public class HeightConvert implements Convert {
    @Autowired
    private ConvertHelper convertHelper;
    @Override
    public List<SaveModel> convert(List<DataModel> modelList,List<FlLabelDict> flLabelDictList,String sourceType,String source) {
        List<SaveModel> saveModels = new ArrayList<>();
        FlLabelDict dict = flLabelDictList.get(0);
        for(DataModel dataModel : modelList){
            SaveModel saveModel = new SaveModel();
            saveModel.setId(MakeIDUtil.makeSaveModelID(dataModel,dataModel.getLabelValue()));
            saveModel.setIdcard(dataModel.getIdcard());
            saveModel.setLabelType(dict.getParentCode());
            saveModel.setLabelCode(dict.getLabelCode());
            saveModel.setLabelName(dict.getLabelName());
            saveModel.setLabelValue(dataModel.getLabelValue() + "cm");
            convertHelper.generateDataSource(dataModel,saveModel,sourceType,source);
            if(org.apache.commons.lang3.StringUtils.isEmpty(saveModel.getSource())){
                return new ArrayList<>();
            }
            saveModel.setCreateTime(DateFormatUtils.format(new Date(), ConstantUtil.date_format));
            saveModels.add(saveModel);
        }
        return saveModels;
    }
}

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

@ -0,0 +1,56 @@
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.MakeIDUtil;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.time.DateFormatUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;
import java.util.*;
/**
 * @author litaohong on 2018/4/9
 * @project patient-co-management
 * 是否有咨询问题标签
 */
@Component
public class IsConsultConvert implements Convert {
    @Autowired
    private ConvertHelper convertHelper;
    @Override
    public List<SaveModel> convert(List<DataModel> modelList, List<FlLabelDict> flLabelDictList, String sourceType, String source) {
        List<SaveModel> saveModels = new ArrayList<>();
        FlLabelDict dict = flLabelDictList.get(0);
        // 有咨询code为0,代表有咨询问题
        String hasConsult = "0";
        Map<String,String> dictMap = new HashMap<>();
        flLabelDictList.forEach(
                one ->{
                    dictMap.put(one.getLabelCode(),one.getLabelName());
                }
        );
        for(DataModel dataModel:modelList){
            SaveModel saveModel = new SaveModel();
            saveModel.setId(MakeIDUtil.makeSaveModelID(dataModel,""));
            saveModel.setIdcard(dataModel.getIdcard());
            saveModel.setLabelType(dict.getParentCode());
            saveModel.setLabelCode(hasConsult);
            saveModel.setLabelName(dictMap.get(hasConsult));
            convertHelper.generateDataSource(dataModel,saveModel,sourceType,source);
            if (StringUtils.isEmpty(saveModel.getSource())) {
                return new ArrayList<>();
            }
            saveModel.setSourceTime(dataModel.getSourceTime());
            saveModel.setCreateTime(DateFormatUtils.format(new Date(), ConstantUtil.date_format));
            saveModels.add(saveModel);
        }
        return saveModels;
    }
}

+ 1 - 1
patient-co/patient-co-figure-label/src/main/java/com/yihu/wlyy/figure/label/convert/IsOnlineConvert.java

@ -43,7 +43,7 @@ public class IsOnlineConvert implements Convert {
                    saveModel.setIdcard(model.getIdcard());
                    saveModel.setLabelType(one.getParentCode());
                    saveModel.setLabelCode(model.getLabelCode());
                    saveModel.setLabeName(map.get(model.getLabelCode()));
                    saveModel.setLabelName(map.get(model.getLabelCode()));
                    saveModel.setCreateTime(DateFormatUtils.format(new Date(), ConstantUtil.date_format));
                    convertHelper.generateDataSource(model,saveModel,sourceType,source);

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

@ -0,0 +1,54 @@
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.MakeIDUtil;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.time.DateFormatUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.*;
/**
 * @author litaohong on 2018/03/27
 * @project patient-co-management
 * 线上咨询问题标签(包括续方咨询,续方咨询只是线上咨询的一种类型)
 */
@Component
public class OnLineConsultConvert implements Convert {
    @Autowired
    private ConvertHelper convertHelper;
    @Override
    public List<SaveModel> convert(List<DataModel> modelList, List<FlLabelDict> flLabelDictList, String sourceType, String source) {
        List<SaveModel> saveModels = new ArrayList<>();
        FlLabelDict dict = flLabelDictList.get(0);
        Map<String,String> dictMap = new HashMap<>();
        flLabelDictList.forEach(
                one ->{
                    dictMap.put(one.getLabelCode(),one.getLabelName());
                }
        );
        for(DataModel dataModel:modelList){
            SaveModel saveModel = new SaveModel();
            saveModel.setId(MakeIDUtil.makeSaveModelID(dataModel,""));
            saveModel.setIdcard(dataModel.getIdcard());
            saveModel.setLabelType(dict.getParentCode());
            saveModel.setLabelCode(dataModel.getLabelCode());
            saveModel.setLabelName(dictMap.get(dataModel.getLabelCode()));
            saveModel.setLabelValue(dataModel.getLabelValue());
            convertHelper.generateDataSource(dataModel,saveModel,sourceType,source);
            if (StringUtils.isEmpty(saveModel.getSource())) {
                return new ArrayList<>();
            }
            saveModel.setSourceTime(dataModel.getSourceTime());
            saveModel.setCreateTime(DateFormatUtils.format(new Date(), ConstantUtil.date_format));
            saveModels.add(saveModel);
        }
        return saveModels;
    }
}

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

@ -0,0 +1,51 @@
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.MakeIDUtil;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.time.DateFormatUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
 * @author litaohong on 2018/4/12
 * @project patient-co-management
 * 网上预约行为标签
 */
@Component
public class OnlineAppointmentConvert implements Convert{
    @Autowired
    private ConvertHelper convertHelper;
    @Override
    public List<SaveModel> convert(List<DataModel> modelList, List<FlLabelDict> flLabelDictList, String sourceType, String source) {
        List<SaveModel> saveModels = new ArrayList<>();
        FlLabelDict dict = flLabelDictList.get(0);
        for(DataModel dataModel : modelList){
            SaveModel saveModel = new SaveModel();
            saveModel.setId(MakeIDUtil.makeSaveModelID(dataModel,dataModel.getLabelValue()));
            saveModel.setIdcard(dataModel.getIdcard());
            saveModel.setLabelType(dict.getParentCode());
            saveModel.setLabelCode(dataModel.getParentCode() + "," + dataModel.getLabelCode());
            saveModel.setLabelName(dataModel.getParentName() + "-" + dataModel.getLabelName());
            saveModel.setLabelValue(dataModel.getLabelValue());
            convertHelper.generateDataSource(dataModel,saveModel,sourceType,source);
            if(StringUtils.isEmpty(saveModel.getSource())){
                return new ArrayList<>();
            }
            saveModel.setSourceTime(dataModel.getSourceTime());
            saveModel.setCreateTime(DateFormatUtils.format(new Date(), ConstantUtil.date_format));
            saveModels.add(saveModel);
        }
        return saveModels;
    }
}

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

@ -0,0 +1,76 @@
package com.yihu.wlyy.figure.label.convert;
import com.yihu.base.es.config.ElastricSearchHelper;
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.MakeIDUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
import java.util.ArrayList;
import java.util.List;
/**
 * @author litaohong on 2018/4/8
 * @project patient-co-management
 * 医生咨询分析--及时回复标签
 */
@Component
public class ReplyInTimeConvert implements Convert{
    @Autowired
    private ConvertHelper convertHelper;
    @Autowired
    private ElastricSearchHelper elastricSearchHelper;
    @Override
    public List<SaveModel> convert(List<DataModel> modelList, List<FlLabelDict> flLabelDictList, String sourceType, String source) {
        List<SaveModel> saveModels = new ArrayList<>();
        FlLabelDict dict = flLabelDictList.get(0);
        for(DataModel model:modelList){
            SaveModel saveModel = new SaveModel();
            saveModel.setId(MakeIDUtil.makeSaveModelID(model,""));
            saveModel.setIdcard(model.getIdcard());
            saveModel.setLabelType(dict.getParentCode());
            saveModel.setLabelCode(dict.getLabelCode());
            saveModel.setLabelName(dict.getLabelName());
            saveModel.setLabelValue(model.getLabelValue());
            //记录回复时间,方便以后统计一定时间内的回复率
            saveModel.setSourceTime(model.getSourceTime());
            convertHelper.generateDataSource(model,saveModel,sourceType,source);
            if(StringUtils.isEmpty(saveModel.getSource())){
                return new ArrayList<>();
            }
            saveModels.add(saveModel);
        }
        return saveModels;
    }
    //lambda无法跳出循环
    public static void main(String[] args) {
        int[] arr = {1,2,3,4,5};
        List list = new ArrayList();
        list.addAll(CollectionUtils.arrayToList(arr));
        list.forEach(
                one ->{
                    if(StringUtils.endsWithIgnoreCase(one.toString(),"3")){
                        return;
                    }
                    System.out.println(one);
                }
        );
        System.out.println("*********************************************************");
        for(Object one:list){
            if(StringUtils.endsWithIgnoreCase(one.toString(),"3")){
                return;
            }
            System.out.println(one);
        }
    }
}

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

@ -8,6 +8,7 @@ import com.yihu.wlyy.figure.label.util.IdCardUtil;
import com.yihu.wlyy.figure.label.util.MakeIDUtil;
import org.apache.commons.lang3.time.DateFormatUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.util.StringUtils;
import java.util.*;
@ -15,6 +16,7 @@ import java.util.*;
 * @author lith on 2018.03.14
 * 性别标签转换器
 */
@Component
public class SexConvert implements Convert{
    @Autowired
@ -37,7 +39,7 @@ public class SexConvert implements Convert{
                    saveModel.setId(MakeIDUtil.makeSaveModelID(model,""));
                    saveModel.setLabelType(one.getParentCode());
                    saveModel.setLabelCode(sex);
                    saveModel.setLabeName(map.get(sex));
                    saveModel.setLabelName(map.get(sex));
                    saveModel.setCreateTime(DateFormatUtils.format(new Date(), ConstantUtil.date_format));
                    convertHelper.generateDataSource(model,saveModel,sourceType,source);

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

@ -0,0 +1,47 @@
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.MakeIDUtil;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.time.DateFormatUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;
import java.util.*;
/**
 * @author litaohong on 2018/4/9
 * @project patient-co-management
 * 签约医生
 */
@Component
public class SignDoctorConvert implements Convert {
    @Autowired
    private ConvertHelper convertHelper;
    @Override
    public List<SaveModel> convert(List<DataModel> modelList, List<FlLabelDict> flLabelDictList, String sourceType, String source) {
        List<SaveModel> saveModels = new ArrayList<>();
        FlLabelDict dict = flLabelDictList.get(0);
        for(DataModel dataModel:modelList){
            SaveModel saveModel = new SaveModel();
            saveModel.setId(MakeIDUtil.makeSaveModelID(dataModel,dataModel.getLabelValue()));
            saveModel.setIdcard(dataModel.getIdcard());
            saveModel.setLabelType(dict.getParentCode());
            saveModel.setLabelCode(dataModel.getLabelCode());
            saveModel.setLabelName(dataModel.getLabelName());
            saveModel.setLabelValue(dataModel.getLabelValue());
            convertHelper.generateDataSource(dataModel,saveModel,sourceType,source);
            if (StringUtils.isEmpty(saveModel.getSource())) {
                return new ArrayList<>();
            }
            saveModel.setSourceTime(dataModel.getSourceTime());
            saveModel.setCreateTime(DateFormatUtils.format(new Date(), ConstantUtil.date_format));
            saveModels.add(saveModel);
        }
        return saveModels;
    }
}

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

@ -7,6 +7,7 @@ import com.yihu.wlyy.figure.label.util.ConstantUtil;
import com.yihu.wlyy.figure.label.util.MakeIDUtil;
import org.apache.commons.lang3.time.DateFormatUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
@ -16,6 +17,7 @@ import java.util.*;
 * zd
 * 2018-03-21
 */
@Component
public class SignStateConvert implements Convert{
    @Autowired
@ -41,7 +43,7 @@ public class SignStateConvert implements Convert{
                    saveModel.setId(MakeIDUtil.makeSaveModelID(model,""));
                    saveModel.setLabelCode(model.getLabelCode());
                    saveModel.setLabelType(one.getParentCode());
                    saveModel.setLabeName(map.get(model.getLabelCode()));
                    saveModel.setLabelName(map.get(model.getLabelCode()));
                    saveModel.setCreateTime(DateFormatUtils.format(new Date(), ConstantUtil.date_format));
                    convertHelper.generateDataSource(model,saveModel,sourceType,source);
                    //如果fl_job_config表配置的id和数据来源不一致,则不保存数据

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

@ -0,0 +1,49 @@
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.MakeIDUtil;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.time.DateFormatUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;
import java.util.*;
/**
 * @author litaohong on 2018/4/9
 * @project patient-co-management
 * 签约团队
 */
@Component
public class SignTeamConvert implements Convert {
    @Autowired
    private ConvertHelper convertHelper;
    @Override
    public List<SaveModel> convert(List<DataModel> modelList, List<FlLabelDict> flLabelDictList, String sourceType, String source) {
        List<SaveModel> saveModels = new ArrayList<>();
        FlLabelDict dict = flLabelDictList.get(0);
        Map<String,String> dictMap = new HashMap<>();
        for(DataModel dataModel:modelList){
            SaveModel saveModel = new SaveModel();
            saveModel.setId(MakeIDUtil.makeSaveModelID(dataModel,dataModel.getLabelValue()));
            saveModel.setIdcard(dataModel.getIdcard());
            saveModel.setLabelType(dict.getParentCode());
            saveModel.setLabelCode(dataModel.getLabelCode());
            saveModel.setLabelName(dataModel.getLabelName());
            saveModel.setLabelValue(dataModel.getLabelValue());
            convertHelper.generateDataSource(dataModel,saveModel,sourceType,source);
            if (StringUtils.isEmpty(saveModel.getSource())) {
                return new ArrayList<>();
            }
            saveModel.setSourceTime(dataModel.getSourceTime());
            saveModel.setCreateTime(DateFormatUtils.format(new Date(), ConstantUtil.date_format));
            saveModels.add(saveModel);
        }
        return saveModels;
    }
}

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

@ -0,0 +1,52 @@
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.MakeIDUtil;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.time.DateFormatUtils;
import org.apache.commons.lang3.time.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
 * @author litaohong on 2018/4/12
 * @project patient-co-management
 * 体重标签转换器
 */
@Component
public class WeightConvert implements Convert{
    @Autowired
    private ConvertHelper convertHelper;
    @Override
    public List<SaveModel> convert(List<DataModel> modelList, List<FlLabelDict> flLabelDictList, String sourceType, String source) {
        List<SaveModel> saveModels = new ArrayList<>();
        FlLabelDict dict = flLabelDictList.get(0);
        for(DataModel dataModel : modelList){
                    SaveModel saveModel = new SaveModel();
                    saveModel.setId(MakeIDUtil.makeSaveModelID(dataModel,dataModel.getLabelValue()));
                    saveModel.setIdcard(dataModel.getIdcard());
                    saveModel.setLabelType(dict.getParentCode());
                    saveModel.setLabelCode(dict.getLabelCode());
                    saveModel.setLabelName(dict.getLabelName());
                    saveModel.setLabelValue(dataModel.getLabelValue() + "kg");
                    convertHelper.generateDataSource(dataModel,saveModel,sourceType,source);
                    if(StringUtils.isEmpty(saveModel.getSource())){
                         return new ArrayList<>();
                    }
                    saveModel.setCreateTime(DateFormatUtils.format(new Date(), ConstantUtil.date_format));
                    saveModels.add(saveModel);
                }
        return saveModels;
    }
}

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

@ -0,0 +1,56 @@
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.MakeIDUtil;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.time.DateFormatUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.*;
/**
 * @author litaohong on 2018/03/27
 * @project patient-co-management
 * 是否有关注i健康微信公众号
 */
@Component
public class WxSubscribeConvert implements Convert {
    @Autowired
    private ConvertHelper convertHelper;
    @Override
    public List<SaveModel> convert(List<DataModel> modelList, List<FlLabelDict> flLabelDictList, String sourceType, String source) {
        List<SaveModel> saveModels = new ArrayList<>();
        FlLabelDict dict = flLabelDictList.get(0);
        // 有咨询code为0,代表有咨询问题
        String yes = "0";
        Map<String,String> dictMap = new HashMap<>();
        flLabelDictList.forEach(
                one ->{
                    dictMap.put(one.getLabelCode(),one.getLabelName());
                }
        );
        for(DataModel dataModel:modelList){
            SaveModel saveModel = new SaveModel();
            saveModel.setId(MakeIDUtil.makeSaveModelID(dataModel,""));
            saveModel.setIdcard(dataModel.getIdcard());
            saveModel.setLabelType(dict.getParentCode());
            saveModel.setLabelCode(yes);
            saveModel.setLabelName(dictMap.get(yes));
            saveModel.setLabelValue(dataModel.getLabelValue());
            convertHelper.generateDataSource(dataModel,saveModel,sourceType,source);
            if (StringUtils.isEmpty(saveModel.getSource())) {
                return new ArrayList<>();
            }
            saveModel.setSourceTime(dataModel.getSourceTime());
            saveModel.setCreateTime(DateFormatUtils.format(new Date(), ConstantUtil.date_format));
            saveModels.add(saveModel);
        }
        return saveModels;
    }
}

+ 34 - 0
patient-co/patient-co-figure-label/src/main/java/com/yihu/wlyy/figure/label/enums/JobSqlFieldTypeEnum.java

@ -0,0 +1,34 @@
package com.yihu.wlyy.figure.label.enums;
/**
 * @author litaohong on 2018/4/11
 * @project patient-co-management
 *
 * 增量字段类型枚举 1时间 (yyyy-mm-dd  HH:MM:ss)2数字
 */
public enum JobSqlFieldTypeEnum {
    TIME(1,"时间"),
    NUM(2,"数字");
    private int value;
    private String desc;
    private JobSqlFieldTypeEnum(int value,String desc){
        this.value = value;
        this.desc = desc;
    }
    public int getValue() {
        return value;
    }
    public String getDesc() {
        return desc;
    }
    @Override
    public String toString() {
        return String.valueOf(this.getValue());
    }
}

+ 1 - 0
patient-co/patient-co-figure-label/src/main/java/com/yihu/wlyy/figure/label/extract/MysqlExtracter.java

@ -75,6 +75,7 @@ public class MysqlExtracter implements Extracter {
    public Integer getCount(String sql){
        String countSql = "select count(*) from " + sql.split("from|FROM")[1];
        Integer count = jdbcTemplate.queryForObject(countSql,Integer.class);
        return count;
    }
}

+ 90 - 0
patient-co/patient-co-figure-label/src/main/java/com/yihu/wlyy/figure/label/job/Es2EsJob.java

@ -0,0 +1,90 @@
package com.yihu.wlyy.figure.label.job;
import com.alibaba.druid.util.StringUtils;
import com.yihu.figure_label.entity.FlJobConfig;
import com.yihu.wlyy.figure.label.controller.JobController;
import com.yihu.wlyy.figure.label.dao.FlJobConfigDao;
import com.yihu.wlyy.figure.label.model.DataModel;
import com.yihu.wlyy.figure.label.service.JobService;
import org.quartz.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
@Scope("prototype")
@DisallowConcurrentExecution//防止到了执行时间点前一任务还在执行中,但是这时有空闲的线程,那么马上又会执行,这样一来就会存在同一job被并行执行
public class Es2EsJob implements Job {
    private Logger logger = LoggerFactory.getLogger(JobController.class);
    @Autowired
    private FlJobConfigDao flJobConfigDao;
    @Autowired
    private JobService jobService;
    private FlJobConfig flJobConfig;
    private Long flJobConfigId;
    private String sqlFiledValue;
    private String sqlFiledCondition;
    private String finalSql;
    private List<DataModel> dataModelList;
    private String sourceType;
    private String source;
    public void execute(JobExecutionContext context) throws JobExecutionException {
        JobDataMap paramsMap = context.getJobDetail().getJobDataMap();
        initParams(paramsMap);
    }
    public void initParams(JobDataMap paramsMap){
        this.flJobConfigId = (Long)paramsMap.get("jobConfig");
        this.sourceType = String.valueOf(paramsMap.get("sourceType"));
        this.source = String.valueOf(paramsMap.get("source"));
        this.flJobConfig = flJobConfigDao.findById(this.flJobConfigId);
        //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=">";
        }
        //1抽取数据
        String sql = this.flJobConfig.getSql();
        String sqlFiled = this.flJobConfig.getSqlField();
//      this.finalSql = getJobConfigSql(sql,sqlFiled,sqlFiledCondition,sqlFiledValue);
    }
    public String getFinalSql(String sql, String sqlFiled, String sqlFiledCondition, String sqlFiledValue) {
        StringBuilder result = new StringBuilder();
        result.append(sql).append(" ");
        if (sqlFiledValue.contains(",") && sql.contains("where")) {
            String[] sqlFiledValues = sqlFiledValue.split(",");
            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();
    }
}

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

@ -6,6 +6,7 @@ import com.yihu.wlyy.figure.label.controller.JobController;
import com.yihu.wlyy.figure.label.convert.ConvertHelper;
import com.yihu.wlyy.figure.label.dao.FlJobConfigDao;
import com.yihu.wlyy.figure.label.dao.FlLabelDictJobDao;
import com.yihu.wlyy.figure.label.enums.JobSqlFieldTypeEnum;
import com.yihu.wlyy.figure.label.extract.MysqlExtracter;
import com.yihu.wlyy.figure.label.model.DataModel;
import com.yihu.wlyy.figure.label.model.SaveModel;
@ -67,6 +68,11 @@ public class Mysql2ESJob implements Job {
    private String source;
    /**
     * 数据表的id,有些数据是按时间增量查询,有些数据是按表的主键id增量查询
     */
    private long lastDataId;
    @Override
    public void execute(JobExecutionContext context) throws JobExecutionException {
@ -81,9 +87,16 @@ public class Mysql2ESJob implements Job {
        //数据保存
        boolean bool = save(list);
        //增量存储成功后,修改增量的czrq时间为当前时间
        jobService.updateFieldValuetoCurrentTime(this.flJobConfigId,bool);
    }
            //增量存储成功后,修改增量的czrq时间为当前时间或主键id为上次获取到的数据的最后的一条的id
            if(StringUtils.endsWithIgnoreCase(this.flJobConfig.getSqlFieldType().toString(), JobSqlFieldTypeEnum.TIME.toString())){
                jobService.updateFieldValuetoCurrentTimeOrId(this.flJobConfigId,null,bool);
            }else if(StringUtils.endsWithIgnoreCase(this.flJobConfig.getSqlFieldType().toString(), JobSqlFieldTypeEnum.NUM.toString())){
                int index = dataModelList.size();
                lastDataId = dataModelList.get(index -1).getId();
                jobService.updateFieldValuetoCurrentTimeOrId(this.flJobConfigId,this.lastDataId,bool);
            }
        }
    public void initParams(JobDataMap paramsMap){
        this.flJobConfigId = (Long)paramsMap.get("jobConfig");
@ -93,9 +106,12 @@ public class Mysql2ESJob implements Job {
        this.flJobConfig = flJobConfigDao.findById(this.flJobConfigId);
        this.sqlFiledValue = this.flJobConfig.getSqlFieldValue();
        this.sqlFiledCondition = paramsMap.getString("sqlFiledCondition");
        /*//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.sqlFiledValue = String.valueOf(paramsMap.get("sqlFiledValue"));
        this.sqlFiledCondition = paramsMap.getString("sqlFiledCondition");
        this.sqlFiledValue = flJobConfig.getSqlFieldValue();
        this.sqlFiledCondition = ">";
        //没有传增量值,以数据库配置的默认值为查询条件
        if(StringUtils.isEmpty(this.sqlFiledValue)){
            this.sqlFiledValue = this.flJobConfig.getSqlFieldValue();
@ -205,4 +221,5 @@ public class Mysql2ESJob implements Job {
        return result.toString();
    }
}
}

+ 68 - 16
patient-co/patient-co-figure-label/src/main/java/com/yihu/wlyy/figure/label/model/DataModel.java

@ -5,20 +5,56 @@ package com.yihu.wlyy.figure.label.model;
 */
public class DataModel {
    //这些id用作记录数据来源,当有多个表时,记录多个表的id,并依据fl_job_config里的sourceTyep,source来区别
    /**
     * 这些id用作记录数据来源,当有多个表时,记录多个表的id,并依据fl_job_config里的sourceTyep,source来区别
     */
    private int id;
    private int id1;
    private int id2;
    private int id3;
    private int id4;
    /**
     * 居民身份证号
     */
    private String idcard;
    private String sex;
    /**
     * 父类标签码
     */
    private String parentCode;
    private String labelName;
    /**
     * 父类标签名
     */
    private String parentName;
    /**
     * 标签码
     */
    private String labelCode;
    /**
     * 标签名
     */
    private String labelName;
    /**
     * 标签值,某个单独的值,如及时回复中的问题id
     */
    private String labelValue;
    /**
     * 转换类
     */
    private String convertClazz;
    /**
     * 定时任务的表id
     */
    private String jobId;
    private String patient;
    /**
     * 原数据来源时间
     */
    private String sourceTime;
    /**
     * 标签状态,eg:预约挂号-预约成功,预约失败
     */
    private String status;
    public int getId() {
        return id;
@ -68,14 +104,6 @@ public class DataModel {
        this.idcard = idcard;
    }
    public String getSex() {
        return sex;
    }
    public void setSex(String sex) {
        this.sex = sex;
    }
    public String getParentCode() {
        return parentCode;
    }
@ -84,6 +112,14 @@ public class DataModel {
        this.parentCode = parentCode;
    }
    public String getParentName() {
        return parentName;
    }
    public void setParentName(String parentName) {
        this.parentName = parentName;
    }
    public String getLabelName() {
        return labelName;
    }
@ -116,11 +152,27 @@ public class DataModel {
        this.jobId = jobId;
    }
    public String getPatient() {
        return patient;
    public String getSourceTime() {
        return sourceTime;
    }
    public void setSourceTime(String sourceTime) {
        this.sourceTime = sourceTime;
    }
    public String getStatus() {
        return status;
    }
    public void setStatus(String status) {
        this.status = status;
    }
    public String getLabelValue() {
        return labelValue;
    }
    public void setPatient(String patient) {
        this.patient = patient;
    public void setLabelValue(String labelValue) {
        this.labelValue = labelValue;
    }
}

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

@ -31,7 +31,7 @@ public class SaveModel implements Serializable{
    /**
     * 标签名称
     */
    private String labeName;
    private String labelName;
    /**
     * 标签值,仅当标签只有一个分类的时候才有此值,比如生日,体重等
@ -43,11 +43,22 @@ public class SaveModel implements Serializable{
     */
    private String createTime;
    /**
     * 当前标签是否激活
     */
//    private boolean isCurrentActive;
    /**
     * 标签生成来源
     */
    private String source;
    /**
     * 标签源数据来源时间
     */
    private String sourceTime;
    public String getIdcard() {
        return idcard;
    }
@ -81,12 +92,12 @@ public class SaveModel implements Serializable{
        this.labelCode = labelCode;
    }
    public String getLabeName() {
        return labeName;
    public String getLabelName() {
        return labelName;
    }
    public void setLabeName(String labeName) {
        this.labeName = labeName;
    public void setLabelName(String labelName) {
        this.labelName = labelName;
    }
    public String getLabelValue() {
@ -105,6 +116,13 @@ public class SaveModel implements Serializable{
        this.createTime = createTime;
    }
//    public boolean isCurrentActive() {
//        return isCurrentActive;
//    }
//    public void setCurrentActive(boolean currentActive) {
//        isCurrentActive = currentActive;
//    }
    public String getSource() {
        return source;
    }
@ -112,4 +130,12 @@ public class SaveModel implements Serializable{
    public void setSource(String source) {
        this.source = source;
    }
    public String getSourceTime() {
        return sourceTime;
    }
    public void setSourceTime(String sourceTime) {
        this.sourceTime = sourceTime;
    }
}

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

@ -379,13 +379,19 @@ public class JobService {
    /**
     * 增量查询数据成功后,将增量时间改为当前时间
     * @param id
     * @param lastDataId
     * @param bool
     */
    @Transactional(rollbackFor = Exception.class)
    public void updateFieldValuetoCurrentTime(Long id,boolean bool) {
        if (bool) {
            this.flJobConfigDao.updateSqlFildeValue(id, DateFormatUtils.format(new Date(), ConstantUtil.date_format));
    public void updateFieldValuetoCurrentTimeOrId(Long id,Long lastDataId,boolean bool) {
        if (!bool) {
            return;
        }
        if(null != lastDataId && lastDataId != 0){
            this.flJobConfigDao.updateSqlFildeValue(id,String.valueOf(lastDataId));
            return;
        }
        this.flJobConfigDao.updateSqlFildeValue(id, DateFormatUtils.format(new Date(), ConstantUtil.date_format));
    }
   /* public void startCleanCacheJob() throws Exception {

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

@ -34,12 +34,12 @@ public class Store2ES implements Storager {
            }
            //防止内存溢出,一次性存储10W条
            if(list.size() >= 100000){
                elastricSearchHelper.saveBulkWithCustomId(ConstantUtil.figure_label_es_index, ConstantUtil.figure_label_es_type, list,"modelId");
                elastricSearchHelper.saveBulkWithCustomId(ConstantUtil.figure_label_es_index, ConstantUtil.figure_label_es_type, list,"id");
                list.clear();
                saveCount ++;
            }else if(modelList.size() - saveCount * 100000 == list.size()){
                //剩余的零头
                elastricSearchHelper.saveBulkWithCustomId(ConstantUtil.figure_label_es_index, ConstantUtil.figure_label_es_type, list,"modelId");
                elastricSearchHelper.saveBulkWithCustomId(ConstantUtil.figure_label_es_index, ConstantUtil.figure_label_es_type, list,"id");
            }
        }
    }

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

@ -0,0 +1,24 @@
package com.yihu.wlyy.figure.label.util;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.stereotype.Component;
/**
 * @author litaohong on 2018/4/11
 * @project patient-co-management
 */
@Component
public class ApplicationContextHolderUtil implements ApplicationContextAware {
    private static ApplicationContext context;
    @Override
    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
        context = applicationContext;
    }
    public static ApplicationContext getContext() {
        return context;
    }
}

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

@ -118,6 +118,11 @@ public class PrescriptionService extends BaseService {
                    String re = JSONArray.fromObject(list).toString();
                    redisTemplate.opsForValue().set(key,re,180, TimeUnit.DAYS);
                }
                Prescription prescription = prescriptionDao.findByCode(prescriptionCode);
                if(messageService.getMessageNoticeSettingByMessageType(prescription.getDoctor(),"1", MessageNoticeSetting.MessageTypeEnum.prescriptionSwitch.getValue())){
                    String content = "您有一条新的续方订单线下调整已完成!";
                    pushMsgTask.put(prescription.getDoctor(), MessageType.MESSAGE_TYPE_PRESCRIPTION_WAIT_TAKE_DRUG.D_P_WRD.name(), MessageType.MESSAGE_TYPE_PRESCRIPTION_WAIT_TAKE_DRUG.续方消息.name(), content, prescription.getCode());
                }
            }
        }
        catch (Exception ex) {

+ 10 - 3
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/adapter/PresModeAdapter.java

@ -26,9 +26,10 @@ public class PresModeAdapter {
    private static Logger logger = LoggerFactory.getLogger(PresModeAdapter.class);
    @Autowired
    private Icd10DictServcie icd10DictServcie;
    @Autowired
    private ZyDictService zyDictService;
    @Autowired
    private Icd10DictServcie icd10DictServcie;
    /**
     * 处方模板适配器
@ -36,7 +37,7 @@ public class PresModeAdapter {
     * @return
     * @throws Exception
     */
    public JSONArray modeTopresInfo(String json){
    public JSONArray modeTopresInfo(String json,String doctor){
        try{
            JSONObject oldJson = JSONObject.parseObject(json);
            if(oldJson.getInteger("status")!=200){
@ -93,6 +94,12 @@ public class PresModeAdapter {
                            prescriptionInfo.setPhysicInjectPlaceName("");//注射地点名称
                            prescriptionInfo.setPhysicSkinTest(info.getString("PHYSIC_SKIN_TEST"));//皮试类型名称
                            prescriptionInfo.setPhysicSkinTestName(info.getString("PHYSIC_SKIN_TEST_NAME"));//皮试类型名称
                            //获取可拆标志
//                            List<Map<String, Object>> list = zyDictService.findDispDictByCode(doctor,info.getString("ITEM_CODE"));
//                            if(list!=null&&list.size()>0){
//                                prescriptionInfo.setDispPackUntuckFlag(Integer.valueOf(list.get(0).get("dispPackUntuckFlag").toString()));
//                                prescriptionInfo.setDispQuantityUntuckFlag(Integer.valueOf(list.get(0).get("dispQuantityUntuckFlag").toString()));
//                            }
                            is.add(prescriptionInfo);
                        }
                        m.put("prescriptionInfo",is);

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

@ -23,7 +23,7 @@ public interface MessageDao extends PagingAndSortingRepository<Message, Long>, J
    @Query("select count(1) from Message a where a.type in(1,101) and a.read= 1 and a.receiver=?1 ")
    Integer amountUnreadByReceiver(String doctor);
    @Query("select a from Message a where a.type =1 and a.read= 1 and a.receiver=?1 order by a.czrq desc")
    @Query("select a from Message a where a.type in(1,101) and a.read= 1 and a.receiver=?1 order by a.czrq desc")
    Page<Message> amountUnreadLastByReceiver(String doctor, Pageable pageRequest);
    @Query("select count(1) from Message a where a.type =2 and a.read= 1 and a.receiver=?1 ")
@ -56,13 +56,13 @@ public interface MessageDao extends PagingAndSortingRepository<Message, Long>, J
    @Query("update Message a set a.read = 0 where a.receiver = ?1 and a.sender=?2 and a.tzType=?3")
    int updateHealthIndexMessageByPatient(String doctor, String patient, String type);
    @Query("select a from Message a where a.read= 1 and a.receiver = ?1 and a.type not in (1,2,6,7,12) order by a.czrq desc")
    @Query("select a from Message a where a.read= 1 and a.receiver = ?1 and a.type not in (1,2,6,7,12,101) order by a.czrq desc")
    List<Message> getSystemMessageUnread(String doctor);
    @Query("select a from Message a where a.receiver = ?1 and a.prescriptionStatus=?2 and a.type in (6,7) order by a.createTime desc")
    List<Message> getSysTemMessageByPrescription(String doctor, String prescriptionStatus);
    @Query("select a from Message a where a.receiver = ?1 and a.type not in (1,2,6,7,12) and (a.del = '1' or a.del is null) ")
    @Query("select a from Message a where a.receiver = ?1 and a.type not in (1,2,6,7,12,101) and (a.del = '1' or a.del is null) ")
    List<Message> getSystemMessage(String doctor, Pageable pageRequest);
    @Query("select a from Message a where a.receiver = ?1 and a.type=?2 and a.prescriptionStatus='0' ")

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

@ -901,7 +901,8 @@ public class DoctorInfoService extends BaseService {
                data.put("remark", remark);
//                data.put("remark", newD.getName() + "健管师将专门为您提供优质健康服务");
            } else {
                remark = remark.replace("key1",newD.getName() + "健管师与" + signFamily.getDoctorName() + "医生一道,");
                remark = remark.replace("key1",newD.getName()==null?"":newD.getName());
                remark = remark.replace("key2",signFamily.getDoctorName()==null?"":signFamily.getDoctorName());
                data.put("remark", remark);
//                data.put("remark", newD.getName() + "健管师与" + signFamily.getDoctorName() + "医生一道,为您提供优质健康服务");
            }
@ -929,7 +930,7 @@ public class DoctorInfoService extends BaseService {
            } else {
                templateConfig = templateConfigDao.findByScene("template_doctor_change","jgsxzqk");
                remark = templateConfig.getRemark();
                remark.replace("key1",(newD.getName()==null?"":newD.getName())).replace("key2",(signFamily.getDoctorName()==null?"":signFamily.getDoctorName()));
                remark = remark.replace("key1",(newD.getName()==null?"":newD.getName())).replace("key2",(signFamily.getDoctorName()==null?"":signFamily.getDoctorName()));
//                data.put("remark", newD.getName() + "健管师与" + signFamily.getDoctorName() + "医生一道,为您提供优质健康服务");
                data.put("remark", remark);
            }

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

@ -115,7 +115,8 @@ public class MessageService extends BaseService {
                    msgJson.put("title", msg.getTitle());
                    msgJson.put("type", msg.getType());
                    if (msg.getSignStatus().equals("4")) {
                        msgJson.put("msg", msg.getSenderName() + "申请与您解除家庭签约");
                        //msgJson.put("msg", msg.getSenderName() + "申请与您解除家庭签约");
                        msgJson.put("msg", "您有一条取消家庭签约消息,请查看。");
                    } else if(msg.getSignStatus().equals("8")){
                        msgJson.put("msg", msg.getSenderName() + "申请与您续签家庭医生");
                    }else{

+ 25 - 5
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prescription/PrescriptionInfoService.java

@ -21,9 +21,9 @@ import com.yihu.wlyy.service.BaseService;
import com.yihu.wlyy.service.app.message.MessageService;
import com.yihu.wlyy.service.system.Icd10DictServcie;
import com.yihu.wlyy.service.third.jw.JwPrescriptionService;
import com.yihu.wlyy.service.third.jw.ZyDictService;
import com.yihu.wlyy.util.DateUtil;
import com.yihu.wlyy.util.HttpClientUtil;
import com.yihu.wlyy.util.HttpUtil;
import com.yihu.wlyy.util.ImUtill;
import org.apache.commons.collections.map.HashedMap;
import org.apache.commons.lang3.StringUtils;
@ -115,6 +115,8 @@ public class PrescriptionInfoService extends BaseService {
	private HttpClientUtil httpClientUtil;
    @Autowired
    private MessageService messageService;
    @Autowired
    private ZyDictService zyDictService;
    private static final Logger logger = LoggerFactory.getLogger(PrescriptionInfoService.class);
@ -889,6 +891,14 @@ public class PrescriptionInfoService extends BaseService {
    public com.alibaba.fastjson.JSONObject getContinuedPrescriptionAsDoctor(String code) {
        Prescription prescription = prescriptionDao.findByCode(code);
        List<PrescriptionInfo> prescriptionInfos = prescriptionInfoDao.findByPrescriptionCode(code);
        //获取药品可拆标志
//        prescriptionInfos.forEach(info->{
//            List<Map<String,Object>> list = zyDictService.findDispDictByCode(prescription.getDoctor(),info.getDrugCode());
//            if(list!=null&&list.size()>0){
//                info.setDispPackUntuckFlag(Integer.valueOf(list.get(0).get("dispPackUntuckFlag").toString()));
//                info.setDispQuantityUntuckFlag(Integer.valueOf(list.get(0).get("dispQuantityUntuckFlag").toString()));
//            }
//        });
        PrescriptionReviewed reviewed = prescriptionReviewedDao.findByPrescriptionCode(code);
        List<PrescriptionAdjust> prescriptionAdjusts = prescriptionAdjustDao.findByPrescriptionCodeOrderByIdDesc(code);
        com.alibaba.fastjson.JSONObject rs = new com.alibaba.fastjson.JSONObject();
@ -1781,7 +1791,7 @@ public class PrescriptionInfoService extends BaseService {
     */
    public com.alibaba.fastjson.JSONArray getPrescriptionTemp(String doctor) throws Exception {
        String rp = jwPrescriptionService.getRecipeTemplate(doctor);
        com.alibaba.fastjson.JSONArray rs = presModeAdapter.modeTopresInfo(rp);
        com.alibaba.fastjson.JSONArray rs = presModeAdapter.modeTopresInfo(rp,doctor);
        return rs;
    }
@ -1833,7 +1843,7 @@ public class PrescriptionInfoService extends BaseService {
        return new JSONArray(rs);
    }
    public List<Map<String, Object>> getPhysicInfo(String code) {
    public List<Map<String, Object>> getPhysicInfo(String code,String doctor) {
        StringBuffer sql = new StringBuffer("SELECT " +
                " t.min_dose AS minDose, " +
                " t.physic_code AS physicCode, " +
@ -1845,9 +1855,19 @@ public class PrescriptionInfoService extends BaseService {
                " t.pack_unit As packUnit, " +
                " com3.`name` As packUnitName, " +
                " pack_spec AS packSpec, " +
                " subject_class AS subjectClass" +
                " subject_class AS subjectClass," +
                " d.dispQuantityUntuckFlag," +
                " d.dispPackUntuckFlag" +
                " FROM " +
                " zy_iv_physic_dict t, " +
                " (SELECT  o.disp_quantity_untuck_flag dispQuantityUntuckFlag, " +
                "          o.disp_pack_untuck_flag dispPackUntuckFlag " +
                "   FROM " +
                "        wlyy_doctor_mapping h, " +
                "        zy_iv_org_physic_allot_dict o " +
                "   WHERE o.org_code = h.jw_doctor_hospital " +
                "         AND h.doctor_code = ? " +
                "         AND o.physic_code = ?) d, " +
                " (SELECT code,name FROM zy_common_dict WHERE dict_name = 'IV_MEASURE_UNIT_DICT') com1, " +
                " (SELECT code,name FROM zy_common_dict WHERE dict_name = 'IV_MEASURE_UNIT_DICT') com2, " +
                " (SELECT code,name FROM zy_common_dict WHERE dict_name = 'IV_MEASURE_UNIT_DICT') com3 " +
@ -1856,7 +1876,7 @@ public class PrescriptionInfoService extends BaseService {
                " AND com2.`code` = t.quantity_unit   " +
                " AND com3.`code` = t.pack_unit   " +
                " AND t.physic_code = ?");
        List<Map<String, Object>> rs = jdbcTemplate.queryForList(sql.toString(),new Object[]{code});
        List<Map<String, Object>> rs = jdbcTemplate.queryForList(sql.toString(),new Object[]{doctor,code,code});
        return rs;
    }

+ 14 - 3
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/sign/FamilyContractService.java

@ -849,8 +849,13 @@ public class FamilyContractService extends BaseService {
        message.setSex(p.getSex());
        message.setOver("1");//未处理
        message.setData(sf.getCode());
        message.setSignStatus("4");
        message.setDel("1");
        message.setState(1);
        messageDao.save(message);
        if(messageService.getMessageNoticeSettingByMessageType(doctor,"1",MessageNoticeSetting.MessageTypeEnum.signSwitch.getValue())) {
            pushMsgTask.put(doctor, MessageType.MESSAGE_TYPE_DOCTOR_SIGN_WEB_RELIEVE.D_SW_02.name(), MessageType.MESSAGE_TYPE_DOCTOR_SIGN_WEB_RELIEVE.患者取消家庭签约.name(), "您有一条取消家庭签约消息,请查看。", patient);
        }
        return 200;
    }
@ -904,8 +909,14 @@ public class FamilyContractService extends BaseService {
        message.setSex(p.getSex());
        message.setOver("1");//未处理
        message.setData(sf.getCode());
        message.setSignStatus("4");
        message.setDel("1");
        message.setState(1);
        messageDao.save(message);
        if(messageService.getMessageNoticeSettingByMessageType(doctor,"1",MessageNoticeSetting.MessageTypeEnum.signSwitch.getValue())) {
            pushMsgTask.put(doctor, MessageType.MESSAGE_TYPE_DOCTOR_SIGN_WEB_RELIEVE.D_SW_02.name(), MessageType.MESSAGE_TYPE_DOCTOR_SIGN_WEB_RELIEVE.患者取消家庭签约.name(), "您有一条取消家庭签约消息,请查看。", patient);
        }
        return 200;
    }
@ -3318,7 +3329,7 @@ public class FamilyContractService extends BaseService {
                    "  sp.id labelid, " +
                    " CASE WHEN sp.label_name is null THEN '未标注' WHEN sp.label_name='' THEN '未标注' else sp.label_name END labelname, " +
                    "  sp.label_type labeltype, " +
                    "  p.idcard idcard " +
                    "  p.idcard idcard" +
                    " FROM " +
                    " wlyy_sign_family sf " +
                    " JOIN wlyy_patient p ON sf.patient = p.CODE " +
@ -4193,7 +4204,7 @@ public class FamilyContractService extends BaseService {
                " f.sick_village_name AS label, " +
                " COUNT(1) AS number " +
                " FROM " +
                " wlyy_sign_family f JOIN wlyy" +
                " wlyy_sign_family f " +
                " WHERE " +
                " f.`status` >= 0 " +
                " AND f.sick_village IS NOT NULL " +

+ 29 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/third/jw/ZyDictService.java

@ -23,8 +23,8 @@ import java.util.Map;
 */
@Service
public class ZyDictService {
    @Autowired
    private JwPrescriptionService jwPrescriptionService;
//    @Autowired
//    private JwPrescriptionService jwPrescriptionService;
    @Autowired
    private HospitalDao hospitalDao;
    @Autowired
@ -186,6 +186,27 @@ public class ZyDictService {
        return "";
    }
    /**
     * 获取药品字典的可拆标志
     * @param doctor
     * @param code
     * @return
     */
    public List<Map<String, Object>> findDispDictByCode(String doctor,String code){
        String sql = "SELECT " +
                    "     o.disp_quantity_untuck_flag dispQuantityUntuckFlag, " +
                    "     o.disp_pack_untuck_flag dispPackUntuckFlag " +
                    "        FROM " +
                    "   wlyy_doctor_mapping h, " +
                    "   zy_iv_org_physic_allot_dict o " +
                    "  WHERE " +
                    "   o.org_code = h.jw_doctor_hospital " +
                    "   AND h.doctor_code = ? " +
                    "   AND o.physic_code = ? " ;
        List<Map<String, Object>> list = jdbcTemplate.queryForList(sql,doctor,code);
        return list;
    }
    /**
     * 获取药品字典
@ -208,6 +229,8 @@ public class ZyDictService {
                " yp.quantity_unit drugNumUnit, " +
                " com2.`name` drugNumUnitName, " +
                " yp.retail_price retailPrice, " +
                " yp.dispQuantityUntuckFlag, " +
                " yp.dispPackUntuckFlag, " +
                " yp.storage_conditions storageConditions" +
                " FROM " +
                " (SELECT code,name FROM zy_common_dict WHERE dict_name = 'IV_MEASURE_UNIT_DICT') com1, " +
@ -226,12 +249,16 @@ public class ZyDictService {
                "   p.min_dose, " +
                "   p.pack_spec," +
                "   p.retail_price," +
                "   ho.dispQuantityUntuckFlag, " +
                "   ho.dispPackUntuckFlag, " +
                "   p.storage_conditions" +
                "    FROM  " +
                "   zy_iv_physic_dict p, " +
                "  ( " +
                "    SELECT " +
                "     o.physic_code, " +
                "     o.disp_quantity_untuck_flag dispQuantityUntuckFlag, " +
                "     o.disp_pack_untuck_flag dispPackUntuckFlag, " +
                "     o.org_code " +
                "        FROM " +
                "   wlyy_doctor_mapping h, " +

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

@ -131,7 +131,7 @@ public class MessageType {
	// 患者申请取消家庭签约消息
	public static enum MESSAGE_TYPE_DOCTOR_SIGN_WEB_RELIEVE {
		D_SW_02, 家庭签约, 患者申请解除家庭签约
		D_SW_02, 家庭签约, 患者取消家庭签约
	};
	// 医生申请取消家庭签约患者同意消息
@ -177,4 +177,6 @@ public class MessageType {
		D_P_WRD, 续方消息, 待取药
	}
}

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

@ -24,7 +24,6 @@ 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.boot.actuate.endpoint.jmx.DataEndpointMBean;
import org.springframework.web.bind.annotation.*;
import java.util.Date;
@ -473,7 +472,7 @@ public class PrescriptionInfoController extends BaseController {
    @ApiOperation(value = "测试适配器")
    public String testAdapter(@RequestParam(required = true) @ApiParam(value = "字符串", name = "json") String json) {
        try {
            return write(200, "操作成功!", "data", adapter.modeTopresInfo(json));
            return write(200, "操作成功!", "data", adapter.modeTopresInfo(json,""));
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败!");
@ -589,7 +588,7 @@ public class PrescriptionInfoController extends BaseController {
    @ApiOperation(value = "获取药品信息")
    public String getPhysicInfo(@RequestParam(required = true) @ApiParam(name = "code", value = "药品code") String code) {
        try {
            return write(200, "查询成功!", "data", prescriptionInfoService.getPhysicInfo(code));
            return write(200, "查询成功!", "data", prescriptionInfoService.getPhysicInfo(code,getUID()));
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败!");

+ 12 - 11
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/sign/DoctorFamilyContractController.java

@ -263,10 +263,10 @@ public class DoctorFamilyContractController extends WeixinBaseController {
                    JSONObject json = jsonArray.getJSONObject(i);
                    Map info = new HashMap();
                    info.put("code", json.getString("code").toString());
                    info.put("patient", json.getString("code").toString());
                    info.put("name", json.getString("name").toString());
                    info.put("photo",json.getString("photo").toString());
                    info.put("age",json.getString("age").toString());
                    info.put("age",json.getInt("age"));
                    info.put("sex",json.getString("sex").toString());
                    info.put("hasopenid",json.getString("hasopenid").toString());
@ -274,7 +274,7 @@ public class DoctorFamilyContractController extends WeixinBaseController {
                }
                int length = codes.size();
                map.put("label", labelName);
                map.put("codes", codes);
                map.put("ps", codes);
                map.put("number", length);
                listNum.add(map);
                count += length;
@ -287,10 +287,10 @@ public class DoctorFamilyContractController extends WeixinBaseController {
                    JSONObject json = noGroup.getJSONObject(i);
                    Map info = new HashMap();
                    info.put("code", json.getString("code").toString());
                    info.put("patient", json.getString("code").toString());
                    info.put("name", json.getString("name").toString());
                    info.put("photo",json.getString("photo").toString());
                    info.put("age",json.getString("age").toString());
                    info.put("age",json.getInt("age"));
                    info.put("sex",json.getString("sex").toString());
                    info.put("hasopenid",json.getString("hasopenid").toString());
@ -299,7 +299,7 @@ public class DoctorFamilyContractController extends WeixinBaseController {
                Map map = new HashMap();
                int size = noGroup.length();
                map.put("label", "未标注");
                map.put("codes", codes);
                map.put("ps", codes);
                map.put("number", size);
                listNum.add(map);
                count += size;
@ -310,6 +310,7 @@ public class DoctorFamilyContractController extends WeixinBaseController {
            map.put("patients", listNum);
            return write(200, "查询成功", "data", map);
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败");
        }
    }
@ -1310,7 +1311,7 @@ public class DoctorFamilyContractController extends WeixinBaseController {
                    for (Object patient : jsonArray) {
                        JSONObject jsonObject = new JSONObject(patient.toString());
                        Map<String,Object> p = new HashedMap();
                        p.put("code",jsonObject.get("code").toString());
                        p.put("patient",jsonObject.get("code").toString());
                        p.put("name",jsonObject.get("name").toString());
                        p.put("sex",jsonObject.get("sex").toString());
                        p.put("age",jsonObject.get("age").toString());
@ -1331,7 +1332,7 @@ public class DoctorFamilyContractController extends WeixinBaseController {
                    for (Object patient : jsonArray) {
                        JSONObject jsonObject = new JSONObject(patient.toString());
                        Map<String,Object> p = new HashedMap();
                        p.put("code",jsonObject.get("code").toString());
                        p.put("patient",jsonObject.get("code").toString());
                        p.put("name",jsonObject.get("name").toString());
                        p.put("sex",jsonObject.get("sex").toString());
                        p.put("age",jsonObject.get("age").toString());
@ -1354,7 +1355,7 @@ public class DoctorFamilyContractController extends WeixinBaseController {
                    for (Object str : jsonArray) {
                        JSONObject jsonObject = new JSONObject(str.toString());
                        Map<String,Object> p = new HashedMap();
                        p.put("code",jsonObject.get("code").toString());
                        p.put("patient",jsonObject.get("code").toString());
                        p.put("name",jsonObject.get("name").toString());
                        p.put("sex",jsonObject.get("sex").toString());
                        p.put("age",jsonObject.get("age").toString());
@ -1374,7 +1375,7 @@ public class DoctorFamilyContractController extends WeixinBaseController {
                    for (Object str : jsonArray1) {
                        JSONObject jsonObject = new JSONObject(str.toString());
                        Map<String,Object> p = new HashedMap();
                        p.put("code",jsonObject.get("code").toString());
                        p.put("patient",jsonObject.get("code").toString());
                        p.put("name",jsonObject.get("name").toString());
                        p.put("sex",jsonObject.get("sex").toString());
                        p.put("age",jsonObject.get("age").toString());
@ -1394,7 +1395,7 @@ public class DoctorFamilyContractController extends WeixinBaseController {
                    for (Object str : jsonArray2) {
                        JSONObject jsonObject = new JSONObject(str.toString());
                        Map<String,Object> p = new HashedMap();
                        p.put("code",jsonObject.get("code").toString());
                        p.put("patient",jsonObject.get("code").toString());
                        p.put("name",jsonObject.get("name").toString());
                        p.put("sex",jsonObject.get("sex").toString());
                        p.put("age",jsonObject.get("age").toString());

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

@ -4,7 +4,7 @@ spring:
  datasource:
    wlyy:
      url: jdbc:mysql://172.19.103.77/wlyy_sr?useUnicode:true&amp;characterEncoding=utf-8&amp;autoReconnect=true
      url: jdbc:mysql://172.19.103.77/wlyy?useUnicode:true&amp;characterEncoding=utf-8&amp;autoReconnect=true
      username: root
      password: 123456
    health: