Browse Source

Merge branch 'dev' of chenweida/patient-co-management into dev

chenweida 7 years ago
parent
commit
4a86c1328a
22 changed files with 918 additions and 211 deletions
  1. 208 170
      common/common-entity/src/main/java/com/yihu/wlyy/entity/education/HealthEduArticlePatient.java
  2. BIN
      patient-co/patient-co-wlyy/doc/接口文档/对外接口文档/集美健康教育/集美健康教育对外接口文档.docx
  3. 1 2
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/config/SwaggerConfig.java
  4. 1 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/account/LoginController.java
  5. 2 15
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/health/DoctorHealthEduArticleController.java
  6. 1 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/patient/SignPatientLabelInfoController.java
  7. 1 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/gateway/controller/GcHospitalController.java
  8. 8 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/gateway/controller/GcLoginController.java
  9. 24 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/gateway/controller/doctor/GcDoctorController.java
  10. 168 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/gateway/controller/doctor/GcEduArticleController.java
  11. 117 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/gateway/controller/doctor/GcLableController.java
  12. 21 17
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/gateway/controller/doctor/GcMessageController.java
  13. 23 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/gateway/controller/patient/GcPatientController.java
  14. 138 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/gateway/service/GcEduArticleService.java
  15. 83 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/gateway/vo/AdminTeamModel.java
  16. 14 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/gateway/vo/LoginModel.java
  17. 63 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/gateway/vo/PatientLabelModel.java
  18. 20 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/gateway/vo/PatientModel.java
  19. 2 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/gateway/vo/base/BaseResultModel.java
  20. 4 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/gateway/vo/base/ResultBatchModel.java
  21. 13 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/gateway/vo/base/ResultListModel.java
  22. 6 2
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/gateway/vo/base/ResultPageListModel.java

+ 208 - 170
common/common-entity/src/main/java/com/yihu/wlyy/entity/education/HealthEduArticlePatient.java

@ -12,180 +12,218 @@ import com.yihu.wlyy.entity.IdEntity;
/**
 * 患者健康教育文章
 * @author George
 *
 * @author George
 */
@Entity
@Table(name = "wlyy_health_edu_article_patient")
public class HealthEduArticlePatient extends IdEntity {
	/**
	 * 
	 */
	private static final long serialVersionUID = -2828104062535279547L;
	// 患者标识
	private String patient;
	// 文章标识
	private String article;
	// 医生标识
	private String doctor;
	// 医生姓名
	private String doctorName;
	// 文章标题
	private String title;
	// 文章链接
	private String url;
	// 文章内容
	private String content;
	// 是否已读:0已读,1未读
	private Integer read;
	// 发布时间
	private Date czrq;
	// 签约类型 1三师 2家庭
	private Integer signType;
	// 行政团队
	private Long adminTeamCode;
	// 简介
	private String summary;
	//附加内容
	private String attachedContent;
	//批次号记录发送所属批次
	private String batchNo;
	//签约表code
	private String signCode;
	private Integer articleId;
	public String getBatchNo() {
		return batchNo;
	}
	public void setBatchNo(String batchNo) {
		this.batchNo = batchNo;
	}
	public String getAttachedContent() {
		return attachedContent;
	}
	public void setAttachedContent(String attachedContent) {
		this.attachedContent = attachedContent;
	}
	public String getPatient() {
		return patient;
	}
	public void setPatient(String patient) {
		this.patient = patient;
	}
	public String getArticle() {
		return article;
	}
	public void setArticle(String article) {
		this.article = article;
	}
	public String getDoctor() {
		return doctor;
	}
	public void setDoctor(String doctor) {
		this.doctor = doctor;
	}
	public String getDoctorName() {
		return doctorName;
	}
	public void setDoctorName(String doctorName) {
		this.doctorName = doctorName;
	}
	@Transient
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	@Transient
	public String getUrl() {
		return url;
	}
	public void setUrl(String url) {
		this.url = url;
	}
	@Transient
	public String getContent() {
		return content;
	}
	public void setContent(String content) {
		this.content = content;
	}
	@Column(name = "is_read")
	public Integer getRead() {
		return read;
	}
	public void setRead(Integer read) {
		this.read = read;
	}
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
	public Date getCzrq() {
		return czrq;
	}
	public void setCzrq(Date czrq) {
		this.czrq = czrq;
	}
	public Integer getSignType() {
		return signType;
	}
	public void setSignType(Integer signType) {
		this.signType = signType;
	}
	public Long getAdminTeamCode() {
		return adminTeamCode;
	}
	public void setAdminTeamCode(Long adminTeamCode) {
		this.adminTeamCode = adminTeamCode;
	}
	@Transient
	public String getSummary() {
		return summary;
	}
	public void setSummary(String summary) {
		this.summary = summary;
	}
	public String getSignCode() {
		return signCode;
	}
	public void setSignCode(String signCode) {
		this.signCode = signCode;
	}
	@Transient
	public Integer getArticleId() {
		return articleId;
	}
	public void setArticleId(Integer articleId) {
		this.articleId = articleId;
	}
    /**
     *
     */
    private static final long serialVersionUID = -2828104062535279547L;
    // 患者标识
    private String patient;
    // 文章标识
    private String article;
    // 医生标识
    private String doctor;
    // 医生姓名
    private String doctorName;
    // 文章标题
    private String title;
    // 文章链接
    private String url;
    // 文章内容
    private String content;
    // 是否已读:0已读,1未读
    private Integer read;
    // 发布时间
    private Date czrq;
    // 签约类型 1三师 2家庭
    private Integer signType;
    // 行政团队
    private Long adminTeamCode;
    // 简介
    private String summary;
    //附加内容
    private String attachedContent;
    //批次号记录发送所属批次
    private String batchNo;
    //文章标题
    private String attachedTitle;
    //文章封面
    private String attachedPic;
    //推送类型
    private Integer sendType; //1或者为空 i健康后台推送  2PC端推送
    //签约表code
    private String signCode;
    private Integer articleId;
    public String getBatchNo() {
        return batchNo;
    }
    public void setBatchNo(String batchNo) {
        this.batchNo = batchNo;
    }
    public String getAttachedContent() {
        return attachedContent;
    }
    public void setAttachedContent(String attachedContent) {
        this.attachedContent = attachedContent;
    }
    public String getPatient() {
        return patient;
    }
    public void setPatient(String patient) {
        this.patient = patient;
    }
    public String getArticle() {
        return article;
    }
    public void setArticle(String article) {
        this.article = article;
    }
    public String getDoctor() {
        return doctor;
    }
    public void setDoctor(String doctor) {
        this.doctor = doctor;
    }
    public String getDoctorName() {
        return doctorName;
    }
    public void setDoctorName(String doctorName) {
        this.doctorName = doctorName;
    }
    @Transient
    public String getTitle() {
        return title;
    }
    public void setTitle(String title) {
        this.title = title;
    }
    @Transient
    public String getUrl() {
        return url;
    }
    public void setUrl(String url) {
        this.url = url;
    }
    @Transient
    public String getContent() {
        return content;
    }
    public void setContent(String content) {
        this.content = content;
    }
    @Column(name = "is_read")
    public Integer getRead() {
        return read;
    }
    public void setRead(Integer read) {
        this.read = read;
    }
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    public Date getCzrq() {
        return czrq;
    }
    public void setCzrq(Date czrq) {
        this.czrq = czrq;
    }
    public Integer getSignType() {
        return signType;
    }
    public void setSignType(Integer signType) {
        this.signType = signType;
    }
    public Long getAdminTeamCode() {
        return adminTeamCode;
    }
    public void setAdminTeamCode(Long adminTeamCode) {
        this.adminTeamCode = adminTeamCode;
    }
    @Transient
    public String getSummary() {
        return summary;
    }
    public void setSummary(String summary) {
        this.summary = summary;
    }
    public String getSignCode() {
        return signCode;
    }
    public void setSignCode(String signCode) {
        this.signCode = signCode;
    }
    @Transient
    public Integer getArticleId() {
        return articleId;
    }
    public void setArticleId(Integer articleId) {
        this.articleId = articleId;
    }
    public static long getSerialVersionUID() {
        return serialVersionUID;
    }
    public String getAttachedTitle() {
        return attachedTitle;
    }
    public void setAttachedTitle(String attachedTitle) {
        this.attachedTitle = attachedTitle;
    }
    public String getAttachedPic() {
        return attachedPic;
    }
    public void setAttachedPic(String attachedPic) {
        this.attachedPic = attachedPic;
    }
    public Integer getSendType() {
        return sendType;
    }
    public void setSendType(Integer sendType) {
        this.sendType = sendType;
    }
}

BIN
patient-co/patient-co-wlyy/doc/接口文档/对外接口文档/集美健康教育/集美健康教育对外接口文档.docx


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

@ -42,6 +42,7 @@ public class SwaggerConfig {
                .select()
                .paths(or(
                        regex("/wlyygc/.*"),
                        regex("/manage_util/.*"),
                        regex("/gc/.*")
                ))
                .build()
@ -83,7 +84,6 @@ public class SwaggerConfig {
                .pathMapping("/")
                .select()
                .paths(or(regex("/doctor/.*"),
                        regex("/manage_util/.*"),
                        regex("/PC/.*")))
                .build()
                .globalOperationParameters(pars)
@ -156,7 +156,6 @@ public class SwaggerConfig {
                        regex("/job/.*"),
                        regex("/family_contract/.*"),
                        regex("/hosptail/.*"),
                        regex("/manage_util/.*"),
                        regex("/common/.*"),
                        regex("/hospitals/.*"),
                        regex("/index/.*"),

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

@ -165,7 +165,7 @@ public class LoginController extends BaseController {
                    List<Map<String, String>> roleMap = roleService.getUserRoleAndArea(doctor.getCode());
                    map.put("userRole", roleMap);
                    if ("10" .equals(doctor.getLevel()) && roleMap.size() == 0) {
                        errorMessage = "改用户没有管理员权限";
                        errorMessage = "该用户没有管理员权限";
                        loginLog.setErrorMessage(errorMessage);
                        loginLogService.saveLog(loginLog);
                        return error(-1, errorMessage);

+ 2 - 15
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/health/DoctorHealthEduArticleController.java

@ -371,7 +371,6 @@ public class DoctorHealthEduArticleController extends WeixinBaseController {
            if(StringUtils.isNotBlank(attachedContent)){
                endMsg = attachedContent;
            }
            JSONArray messages = new JSONArray();
            Map<String, Map<String, Object>> msgs = new HashMap<>();
            String batchNo = UUID.randomUUID().toString();
            Date createTime = new Date();
@ -421,6 +420,8 @@ public class DoctorHealthEduArticleController extends WeixinBaseController {
                        //创建时间
                        heap.setCzrq(createTime);
                        heap.setSignCode(patientService.getSignCodeByPatient(p));
                        heap.setSendType(1);
                        heap.setTitle(temp.getTitle());
                        list.add(heap);
                        consultService.sendMucMessageBySingnType(doctor.getCode(), doctor.getName(), p, "{\"title\":\"" + temp.getTitle()+ "\",\"type\":0,\"id\":\"" + temp.getCode() + "\",\"img\":\"" + temp.getUrl() + "\",\"content\":\"为了您的健康,我给您发送了一篇文章,请咨询查阅,如有问题,可随时与我沟通\"}", "4", patientTemp.getName());
                        if(StringUtils.isNotBlank(attachedContent)){
@ -463,18 +464,6 @@ public class DoctorHealthEduArticleController extends WeixinBaseController {
                                map.get("name") == null ? "" : map.get("name").toString(),
                                (JSONObject) map.get("json"));
                    }
//                    else{
//                        JSONObject j = weiXinOpenIdUtils.getFamilyOpenId((String)map.get("code"));
//                        Patient p = patientService.findByCode((String)map.get("code"));
//                        Patient member = (Patient)j.get("member");
//                        JSONObject data = (JSONObject) map.get("json");
//                        String first = (String)data.get("first");
//                        data.remove("first");
//                        data.put("first",weiXinOpenIdUtils.getTitleMes(p,j.isNull("relation")?1:j.getInt("relation"),p.getName()));
//                        if(StringUtils.isNotBlank(member.getOpenid())){
//                            pushMsgTask.putWxMsg(getAccessToken(), 9, member.getOpenid(), member.getName(), data);
//                        }
//                    }
                    //发送代理人
                    JSONArray jsonArray = weiXinOpenIdUtils.getAgentOpenId((String)map.get("code"),openid);
                    if(jsonArray!=null&&jsonArray.length()>0){
@ -499,8 +488,6 @@ public class DoctorHealthEduArticleController extends WeixinBaseController {
                for (HealthEduArticlePatient heap : list) {
                    BusinessLogs.info(BusinessLogs.BusinessType.article, getUID(), heap.getPatient(), new JSONObject(heap));
                }
                // 推送消息给患者
                pushMsgTask.put(messages);
                return success("发送成功!");
            }
        } catch (Exception e) {

+ 1 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/patient/SignPatientLabelInfoController.java

@ -161,6 +161,7 @@ public class SignPatientLabelInfoController extends BaseController {
            }
            page = page - 1;
            //按照签约年度  labelCode 是年度 例如 2016
            if (labelType.equals("9")) {
                JSONObject jsonObject = signWebService.getOverDuePatients(labelCode, teamCode, getUID(), page, pagesize);
                return write(200, "查询成功", "data", jsonObject);

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/gateway/controller/GcHospitalController.java

@ -27,7 +27,7 @@ public class GcHospitalController {
    @Autowired
    private HospitalService hospitalService;
    @RequestMapping(value = "/", method = RequestMethod.GET)
    @RequestMapping(value = "", method = RequestMethod.GET)
    @ApiOperation("获取医院列表")
    public ResultPageListModel<HospitalModel> doctor(
            @ApiParam(name = "provinceId", value = "省(国标编码 35000)", required = false) @RequestParam(value = "provinceId", required = false) String provinceId,

+ 8 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/gateway/controller/GcLoginController.java

@ -5,6 +5,7 @@ import com.yihu.wlyy.entity.login.LoginLog;
import com.yihu.wlyy.entity.security.Token;
import com.yihu.wlyy.service.common.SMSService;
import com.yihu.wlyy.service.common.account.DoctorService;
import com.yihu.wlyy.service.common.account.RoleService;
import com.yihu.wlyy.service.common.account.TokenService;
import com.yihu.wlyy.service.common.login.LoginLogService;
import com.yihu.wlyy.util.MD5;
@ -23,6 +24,8 @@ import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
 * Created by chenweida on 2017/8/18.
@ -41,6 +44,8 @@ public class GcLoginController {
    @Autowired
    private SMSService smsService;
    @Autowired
    private RoleService roleService;
    @Autowired
    private RSAUtils rsaUtils;
    /**
     * 公钥生成并返回接口
@ -139,6 +144,9 @@ public class GcLoginController {
                    loginModel.setDoctorPhoto(doctor.getPhoto());
                    loginModel.setDoctorType(doctor.getLevel());
                    loginLogService.saveLog(loginLog);
                    //获取医生角色和区域权限
                    List<Map<String, String>> roleMap = roleService.getUserRoleAndArea(doctor.getCode());
                    loginModel.setUserRole(roleMap);
                    return new ResultOneModel<>(loginModel);
                } else {

+ 24 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/gateway/controller/doctor/GcDoctorController.java

@ -2,11 +2,16 @@ package com.yihu.wlyy.web.third.gateway.controller.doctor;
import com.alibaba.fastjson.JSONObject;
import com.yihu.wlyy.entity.doctor.profile.Doctor;
import com.yihu.wlyy.entity.doctor.team.admin.AdminTeam;
import com.yihu.wlyy.entity.patient.Patient;
import com.yihu.wlyy.service.app.team.AdminTeamService;
import com.yihu.wlyy.service.common.account.DoctorService;
import com.yihu.wlyy.service.common.account.PatientService;
import com.yihu.wlyy.web.BaseController;
import com.yihu.wlyy.web.third.gateway.vo.AdminTeamModel;
import com.yihu.wlyy.web.third.gateway.vo.DoctorModel;
import com.yihu.wlyy.web.third.gateway.vo.PatientModel;
import com.yihu.wlyy.web.third.gateway.vo.base.ResultListModel;
import com.yihu.wlyy.web.third.gateway.vo.base.ResultOneModel;
import com.yihu.wlyy.web.third.gateway.vo.base.ResultPageListModel;
import io.swagger.annotations.Api;
@ -29,11 +34,13 @@ import java.util.List;
@RequestMapping(value = "/wlyygc/doctor/user", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@ResponseBody
@Api(description = "用户相关服务")
public class GcDoctorController {
public class GcDoctorController extends BaseController {
    @Autowired
    private PatientService patientService;
    @Autowired
    private DoctorService doctorService;
    @Autowired
    private AdminTeamService adminTeamService;
    @RequestMapping(value = "/doctor", method = RequestMethod.GET)
@ -90,4 +97,20 @@ public class GcDoctorController {
        }
    }
    @RequestMapping(value = "/doctorTeams", method = RequestMethod.GET)
    @ApiOperation("获取医生所属团队")
    public ResultListModel<AdminTeamModel> doctors(
    ) {
        List<AdminTeam> teams = adminTeamService.getDoctorTeams(getUID());
        List<AdminTeamModel> adminTeamModelList = new ArrayList<>();
        if (teams != null && teams.size() > 0) {
            teams.stream().forEach(one -> {
                AdminTeamModel adminTeamModel = new AdminTeamModel();
                BeanUtils.copyProperties(one, adminTeamModel);
                adminTeamModelList.add(adminTeamModel);
            });
        }
        return new ResultListModel(adminTeamModelList);
    }
}

+ 168 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/gateway/controller/doctor/GcEduArticleController.java

@ -0,0 +1,168 @@
package com.yihu.wlyy.web.third.gateway.controller.doctor;
import com.yihu.wlyy.entity.education.HealthEduArticlePatient;
import com.yihu.wlyy.entity.patient.Patient;
import com.yihu.wlyy.repository.patient.SignFamilyDao;
import com.yihu.wlyy.service.app.consult.ConsultService;
import com.yihu.wlyy.service.app.health.HealthEduArticleService;
import com.yihu.wlyy.service.app.label.SignPatientLabelInfoService;
import com.yihu.wlyy.service.common.account.DoctorService;
import com.yihu.wlyy.service.common.account.PatientService;
import com.yihu.wlyy.task.PushMsgTask;
import com.yihu.wlyy.util.DateUtil;
import com.yihu.wlyy.util.ImUtill;
import com.yihu.wlyy.web.WeixinBaseController;
import com.yihu.wlyy.web.third.gateway.service.GcEduArticleService;
import com.yihu.wlyy.web.third.gateway.vo.base.BaseResultModel;
import com.yihu.wlyy.web.third.gateway.vo.base.ResultBatchModel;
import com.yihu.wlyy.wechat.util.WeiXinOpenIdUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.StringUtils;
import org.json.JSONArray;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.*;
/**
 * Created by chenweida on 2017/8/30.
 */
@Controller
@RequestMapping(value = "/wlyygc/doctor/edu/article", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@ResponseBody
@Api(description = "医生文章相关服务")
public class GcEduArticleController extends WeixinBaseController {
    @Autowired
    private WeiXinOpenIdUtils weiXinOpenIdUtils;
    @Autowired
    private PushMsgTask pushMsgTask;
    @Autowired
    private PatientService patientService;
    @Autowired
    private ConsultService consultService;
    @Autowired
    private HealthEduArticleService healthEduArticleService;
    @Autowired
    private DoctorService doctorService;
    @Autowired
    private SignPatientLabelInfoService signPatientLabelInfoService;
    @Autowired
    private SignFamilyDao signFamilyDao;
    @Autowired
    private GcEduArticleService gcEduArticleService;
    /**
     * 参考原来的教育文章推送
     * http://172.19.103.88:9092/wlyy//doctor/health/edu/send?code=2e6467b5bb2f4b81b598633624d7f98e&patient=e911d1b756cd4680ab241ab76a463282&teamCode=1&attachedContent=
     *
     * @param sendCode
     * @param sendName
     * @param sendMessage
     * @param labelCode
     * @param labelType
     * @param teamId
     * @param receiveCodes
     * @param articleIds
     * @param articlePics
     * @param articleTitles
     * @return
     */
    @RequestMapping(value = "send", method = RequestMethod.POST)
    @ApiOperation("文章推送")
    public BaseResultModel send(
            @ApiParam(name = "sendType", value = "发送类型 1医生发送 2卫纪委发送", required = true) @RequestParam(value = "sendType", required = true) String sendType,
            @ApiParam(name = "sendCode", value = "发送人code", required = true) @RequestParam(value = "sendCode", required = true) String sendCode,
            @ApiParam(name = "sendName", value = "发送人名", required = true) @RequestParam(value = "sendName", required = true) String sendName,
            @ApiParam(name = "sendMessage", value = "发送人信息", required = false) @RequestParam(value = "sendMessage", required = false) String sendMessage,
            @ApiParam(name = "teamId", value = "发送人是医生的时候,医生所属的团队", required = true) @RequestParam(value = "teamId", required = true) Long teamId,
            @ApiParam(name = "labelCode", value = "所选群组,多个用逗号分隔", required = true) @RequestParam(value = "labelCode", required = false, defaultValue = "") String labelCode,
            @ApiParam(name = "labelType", value = "标签类型  1 服务类型  2 健康情况 3 疾病类型 4 自定义标签", required = true) @RequestParam(value = "labelType", required = false, defaultValue = "") String labelType,
            @ApiParam(name = "receiveCodes", value = "接收人code,多个逗号分割", required = false) @RequestParam(value = "receiveCodes", required = false, defaultValue = "") String receiveCodes,
            @ApiParam(name = "articleIds", value = "文章ID,多个逗号分割", required = true) @RequestParam(value = "articleIds", required = true) String articleIds,
            @ApiParam(name = "articlePics", value = "文章封面,多个逗号分割", required = true) @RequestParam(value = "articlePics", required = true) String articlePics,
            @ApiParam(name = "articleTitles", value = "文章标题,多个逗号分割", required = true) @RequestParam(value = "articleTitles", required = true) String articleTitles
    ) {
        try {
            String[] patients = receiveCodes.split(",");//接收人的code
            Set<String> patientSet = new HashSet<>(); //放入set中可以去重复
            String[] articleIdArr = articleIds.split(",");
            String[] articlePicArr = articlePics.split(",");
            String[] articleTitleArr = articleTitles.split(",");
            if ((articleIdArr.length != articlePicArr.length) || (articleIdArr.length != articleTitleArr.length) || (articlePicArr.length != articleTitleArr.length)) {
                return new ResultBatchModel(BaseResultModel.statusEm.opera_error.getCode(), BaseResultModel.statusEm.opera_error.getMessage() + ":文章参数长度错误");
            }
            //得到需要发送的患者
            gcEduArticleService.initPatient(patientSet, patients, labelType, labelCode, teamId);
            //保存发送记录
            List<HealthEduArticlePatient> healthEduArticlePatients = gcEduArticleService.saveArticle(patientSet, sendCode, sendName, sendMessage, teamId, articleIdArr, articlePicArr, articleTitleArr);
            //推送微信模板消息和发送im消息
            sendWxTemplateAndIM(healthEduArticlePatients);
            return new BaseResultModel();
        } catch (Exception e) {
            return new BaseResultModel(BaseResultModel.statusEm.opera_error.getCode(), BaseResultModel.statusEm.opera_error.getMessage() + ":" + e.getMessage());
        }
    }
    private void sendWxTemplateAndIM(List<HealthEduArticlePatient> healthEduArticlePatients) throws  Exception{
        String endMsg = "";//"为了您的健康," + doctor.getName() + "医生给您发送了一篇患教文章,请仔细查阅,如有问题,可随时咨询医生。";
        healthEduArticlePatients.stream().forEach(one -> {
            Patient patient=patientService.findByCode(one.getPatient());
            consultService.sendMucMessageBySingnType(one.getDoctor(), one.getDoctorName(), patient.getCode(), "{\"title\":\"" + one.getAttachedTitle()+ "\",\"type\":0,\"id\":\"" + one.getId() + "\",\"img\":\"" + one.getAttachedPic() + "\",\"content\":\"为了您的健康,我给您发送了一篇文章,请咨询查阅,如有问题,可随时与我沟通\"}", "4", patient.getName());
            if(StringUtils.isNotBlank(one.getAttachedContent())){
                //发送备注
                consultService.sendMucMessageBySingnType(one.getDoctor(),one.getDoctorName(), patient.getCode(), one.getAttachedContent(), ImUtill.CONTENT_TYPE_TEXT, patient.getName());
            }
            // 推送消息给微信端
            JSONObject json = new JSONObject();
            json.put("first", patient.getName() + ",您好!\n" +  one.getDoctorName() + "医生给您发来了一篇患教文章");
            json.put("toUser", patient.getCode());
            json.put("article", one.getId()+ "");
            json.put("title", one.getAttachedTitle());
            json.put("doctorName", one.getDoctorName());
            json.put("represented",patient.getCode());//被代理人
            json.put("date", DateUtil.dateToStrLong(DateUtil.getNowDate()));
            json.put("remark", one.getAttachedContent());
            if(StringUtils.isNotBlank(patient.getOpenid())){
                pushMsgTask.putWxMsg(getAccessToken(), 9,
                        patient.getOpenid(),
                        patient.getName(),
                        json);
            }
            //发送代理人
            JSONArray jsonArray = weiXinOpenIdUtils.getAgentOpenId(patient.getCode(),patient.getOpenid());
            if(jsonArray!=null&&jsonArray.length()>0){
                for (int i=0;i<jsonArray.length();i++){
                    JSONObject j = jsonArray.getJSONObject(i);
                    Patient member = (Patient)j.get("member");
                    json.remove("toUser");
                    json.put("toUser",member.getCode());
                    json.remove("first");
                    try {
                        json.put("first",weiXinOpenIdUtils.getTitleMes(patient,j.isNull("relation")?1:j.getInt("relation"),patient.getName()));
                    } catch (Exception e) {
                        e.printStackTrace();
                    }
                    if(StringUtils.isNotBlank(member.getOpenid())){
                        pushMsgTask.putWxMsg(getAccessToken(), 9, member.getOpenid(), patient.getName(), json);
                    }
                }
            }
        });
    }
}

+ 117 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/gateway/controller/doctor/GcLableController.java

@ -0,0 +1,117 @@
package com.yihu.wlyy.web.third.gateway.controller.doctor;
import com.yihu.wlyy.entity.doctor.team.sign.SignPatientLabel;
import com.yihu.wlyy.service.app.label.SignPatientLabelInfoService;
import com.yihu.wlyy.service.app.label.SignPatientLabelService;
import com.yihu.wlyy.web.BaseController;
import com.yihu.wlyy.web.third.gateway.vo.HospitalModel;
import com.yihu.wlyy.web.third.gateway.vo.PatientLabelModel;
import com.yihu.wlyy.web.third.gateway.vo.PatientModel;
import com.yihu.wlyy.web.third.gateway.vo.base.BaseResultModel;
import com.yihu.wlyy.web.third.gateway.vo.base.ResultListModel;
import com.yihu.wlyy.web.third.gateway.vo.base.ResultPageListModel;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.json.JSONArray;
import org.json.JSONObject;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.ArrayList;
import java.util.List;
/**
 * Created by chenweida on 2017/8/30.
 */
@Controller
@RequestMapping(value = "/wlyygc/doctor/label", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@ResponseBody
@Api(description = "疾病标签")
public class GcLableController extends BaseController {
    @Autowired
    private SignPatientLabelService signPatientLabelService;
    @Autowired
    private SignPatientLabelInfoService signPatientLabelInfoService;
    @RequestMapping(value = "/labels", method = RequestMethod.GET)
    @ApiOperation("根据分组类型查找标签")
    public ResultListModel<List<PatientLabelModel>> labels(
            @ApiParam(name = "type", value = "1:服务类型(卫计委三大分组) 2:健康情况 3:疾病类型 4:团队标签(自定义标签)", required = true) @RequestParam(value = "type", required = true) String type,
            @ApiParam(name = "team", value = "type是4的时候需要传team", required = false) @RequestParam(value = "team", required = false) Long team
    ) {
        try {
            List<SignPatientLabel> signPatientLabels = signPatientLabelService.getLabelsByTypeAndTeam(type, String.valueOf(team));
            List<PatientLabelModel> patientLabelModels = new ArrayList<>();
            for (SignPatientLabel signPatientLabel : signPatientLabels) {
                PatientLabelModel patientLabelModel = new PatientLabelModel();
                BeanUtils.copyProperties(signPatientLabel, patientLabelModel);
                patientLabelModels.add(patientLabelModel);
            }
            return new ResultListModel(patientLabelModels);
        } catch (Exception e) {
            return new ResultListModel(BaseResultModel.statusEm.find_error.getCode(), BaseResultModel.statusEm.find_error.getMessage() + "," + e.getMessage());
        }
    }
    @RequestMapping(value = "/labelsWithNum", method = RequestMethod.GET)
    @ApiOperation("根据分组类型查找标签已经标签下的患者数目")
    public ResultListModel<List<PatientLabelModel>> labelsWithNum(
            @ApiParam(name = "type", value = "1:服务类型(卫计委三大分组) 2:健康情况 3:疾病类型 4:团队标签(自定义标签)", required = true) @RequestParam(value = "type", required = true) String type,
            @ApiParam(name = "team", value = "医生所属的团队ID", required = true) @RequestParam(value = "team", required = true) Long team
    ) {
        try {
            JSONArray signPatientLabels = signPatientLabelInfoService.getPatientAmountByTeamGroupLable(team, type);
            List<PatientLabelModel> patientLabelModels = new ArrayList<>();
            for (int i = 0; i < signPatientLabels.length(); i++) {
                JSONObject jo = signPatientLabels.getJSONObject(i);
                PatientLabelModel patientLabelModel = new PatientLabelModel();
                patientLabelModel.setLabelCode(jo.getString("labelCode"));
                patientLabelModel.setLabelName(jo.getString("labelName"));
                patientLabelModel.setAmount(jo.getInt("amount"));
                patientLabelModel.setFocusAmount(jo.getInt("focusAmount"));
                patientLabelModels.add(patientLabelModel);
            }
            return new ResultListModel(patientLabelModels);
        } catch (Exception e) {
            return new ResultListModel(BaseResultModel.statusEm.find_error.getCode(), BaseResultModel.statusEm.find_error.getMessage() + "," + e.getMessage());
        }
    }
    @RequestMapping(value = "/signPatientsByLabel", method = RequestMethod.GET)
    @ApiOperation("获取医生签约的患者列表")
    public ResultPageListModel<PatientModel> signPatients(
            @ApiParam(name = "labelType", value = "标签类型", required = true) @RequestParam(value = "labelType", required = true) String labelType,
            @ApiParam(name = "labelCode", value = "标签code", required = true) @RequestParam(value = "labelCode", required = true) String labelCode,
            @ApiParam(name = "teamCode", value = "所属团队", required = true) @RequestParam(value = "teamCode", required = true) Long teamCode,
            @ApiParam(name = "page", value = "当前页(1开始)", required = true) @RequestParam(value = "page", required = true, defaultValue = "1") Integer page,
            @ApiParam(name = "pageSize", value = "每页大小", required = true) @RequestParam(value = "pageSize", required = true, defaultValue = "10") Integer pageSize
    ) {
        try {
            JSONArray result = signPatientLabelInfoService.getPatientByLabel(getUID(), labelCode, labelType, teamCode, page, pageSize);
            List<PatientModel> patientLabelModels = new ArrayList<>();
            for (int i = 0; i < result.length(); i++) {
                JSONObject jo = result.getJSONObject(i);
                PatientModel patientModel = new PatientModel();
                patientModel.setCode(jo.getString("code"));
                patientModel.setName(jo.getString("name"));
                patientModel.setWechatFocusRemind(jo.getString("wechatFocusRemind"));
                patientModel.setPhoto(jo.getString("photo"));
                patientModel.setSex(jo.getInt("sex"));
                patientModel.setAge(jo.getInt("age"));
                patientLabelModels.add(patientModel);
            }
            return new ResultPageListModel();
        } catch (Exception e) {
            return new ResultPageListModel(BaseResultModel.statusEm.find_error.getCode(), BaseResultModel.statusEm.find_error.getMessage() + "," + e.getMessage());
        }
    }
}

+ 21 - 17
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/gateway/controller/doctor/GcMessageController.java

@ -21,6 +21,7 @@ import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.ExecutionException;
/**
 * Created by chenweida on 2017/8/17.
@ -32,7 +33,7 @@ import java.util.List;
@Api(description = "消息相关服务,包括短信,微信模板")
public class GcMessageController {
    private Logger logger= LoggerFactory.getLogger(GcMessageController.class);
    private Logger logger = LoggerFactory.getLogger(GcMessageController.class);
    @Autowired
    private WeiXinTempMsgSendUtils weiXinTempMsgSendUtils;
    @Autowired
@ -48,23 +49,26 @@ public class GcMessageController {
            @ApiParam(name = "teampolateJson", value = "微信模板内容json格式", required = true) @RequestParam(value = "teampolateJson", required = true) String teampolateJson,
            @ApiParam(name = "url", value = "模板跳转的url", required = true) @RequestParam(value = "url", required = true) String url
    ) {
        Integer success = 0;
        Integer error = 0;
        List<String> errorLiust = new ArrayList<>();
        String[] codeArr = codes.split(",");
        for (String code : codeArr) {
            try {
                Patient patient = patientService.findByCode(code);
                weiXinTempMsgSendUtils.sendTemplateMessage(templateId, patient.getOpenid(), url, new JSONObject(teampolateJson));
                success++;
            } catch (Exception e) {
                logger.error("code "+code+"send Template error:"+e.getMessage());
                error++;
                errorLiust.add(code);
        try {
            Integer success = 0;
            Integer error = 0;
            List<String> errorLiust = new ArrayList<>();
            String[] codeArr = codes.split(",");
            for (String code : codeArr) {
                try {
                    Patient patient = patientService.findByCode(code);
                    weiXinTempMsgSendUtils.sendTemplateMessage(templateId, patient.getOpenid(), url, new JSONObject(teampolateJson));
                    success++;
                } catch (Exception e) {
                    logger.error("code " + code + "send Template error:" + e.getMessage());
                    error++;
                    errorLiust.add(code);
                }
            }
            return new ResultBatchModel(success, error, errorLiust);
        } catch (Exception e) {
            return new ResultBatchModel(BaseResultModel.statusEm.opera_error.getCode(), BaseResultModel.statusEm.opera_error.getMessage() + ":" + e.getMessage());
        }
        return new ResultBatchModel(success, error, errorLiust);
    }
    @RequestMapping(value = "/sendMobileMessage", method = RequestMethod.POST)
@ -87,7 +91,7 @@ public class GcMessageController {
                    smsService.sendWithContent(mobile, ip, 11, content);
                    success++;
                } catch (Exception e) {
                    logger.error("mobile "+mobile+"send message error:"+e.getMessage());
                    logger.error("mobile " + mobile + "send message error:" + e.getMessage());
                    error++;
                    errorLiust.add(mobile);
                }

+ 23 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/gateway/controller/patient/GcPatientController.java

@ -1,9 +1,12 @@
package com.yihu.wlyy.web.third.gateway.controller.patient;
import com.yihu.wlyy.entity.doctor.profile.Doctor;
import com.yihu.wlyy.entity.patient.Patient;
import com.yihu.wlyy.entity.patient.SignFamily;
import com.yihu.wlyy.repository.patient.SignFamilyDao;
import com.yihu.wlyy.service.common.account.DoctorService;
import com.yihu.wlyy.service.common.account.PatientService;
import com.yihu.wlyy.web.third.gateway.vo.DoctorModel;
import com.yihu.wlyy.web.third.gateway.vo.PatientModel;
import com.yihu.wlyy.web.third.gateway.vo.base.ResultOneModel;
import io.swagger.annotations.Api;
@ -29,6 +32,8 @@ public class GcPatientController {
    private PatientService patientService;
    @Autowired
    private SignFamilyDao signFamilyDao;
    @Autowired
    private DoctorService doctorService;
    @RequestMapping(value = "/patient", method = RequestMethod.GET)
@ -53,6 +58,22 @@ public class GcPatientController {
        }
    }
    @RequestMapping(value = "/doctor", method = RequestMethod.GET)
    @ApiOperation("根据医生code查询医生信息")
    public ResultOneModel<DoctorModel> doctor(
            @ApiParam(name = "code", value = "医生code", required = true) @RequestParam(value = "code", required = true) String code
    ) {
        Doctor doctor = doctorService.findDoctorByCode(code);
        DoctorModel doctorModel = null;
        if (doctor != null) {
            doctorModel = new DoctorModel();
            BeanUtils.copyProperties(doctor, doctorModel);
            return new ResultOneModel(doctorModel);
        } else {
            return new ResultOneModel(new JSONObject());
        }
    }
    @RequestMapping(value = "/patientHasSign", method = RequestMethod.GET)
    @ApiOperation("判断患者是否签约")
@ -66,4 +87,6 @@ public class GcPatientController {
        }
        return new ResultOneModel(isSign);
    }
}

+ 138 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/gateway/service/GcEduArticleService.java

@ -0,0 +1,138 @@
package com.yihu.wlyy.web.third.gateway.service;
import com.yihu.wlyy.entity.education.HealthEduArticleOpHistory;
import com.yihu.wlyy.entity.education.HealthEduArticlePatient;
import com.yihu.wlyy.entity.patient.SignFamily;
import com.yihu.wlyy.repository.education.HealthEduArticlePatientDao;
import com.yihu.wlyy.repository.patient.SignFamilyDao;
import com.yihu.wlyy.service.app.health.HealthEduArticleOpHistoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.*;
/**
 * Created by chenweida on 2017/8/31.
 */
@Service
public class GcEduArticleService {
    @Autowired
    private JdbcTemplate jdbcTemplate;
    @Autowired
    private SignFamilyDao signFamilyDao;
    @Autowired
    private HealthEduArticleOpHistoryService healthEduArticleOpHistoryService;
    @Autowired
    private HealthEduArticlePatientDao healthEduArticlePatientDao;
    /**
     * 初始化需要发送的患者
     *
     * @param patientSet
     * @param patients
     * @param labelType
     * @param labelCode
     * @param teamId
     */
    public void initPatient(Set<String> patientSet, String[] patients, String labelType, String labelCode, Long teamId) {
        List params = new ArrayList();//sql参数
        StringBuffer sb = new StringBuffer();//sql
        //1 服务类型  2 健康情况 3 疾病类型 4 自定义标签
        if (!org.springframework.util.StringUtils.isEmpty(labelType)) {
            switch (labelType) {
                case "1": {
                    sb.append(" select w.patient from wlyy_sign_family w where w.server_type=? and w.`status`>0 ");
                    params.add(labelCode);
                    if (teamId != null && teamId > 0) {
                        sb.append(" and w.admin_team_code=? ");
                        params.add(teamId);
                    }
                    break;
                }
                case "2":
                case "3":
                case "4": {
                    sb.append("SELECT w.patient FROM wlyy_sign_family w " +
                            "WHERE " +
                            "  w.patient in (SELECT  l.patient FROM  wlyy_sign_patient_label_info l WHERE l.label_type = ? AND l.label = ?) " +
                            "AND w.`status` > 0");
                    params.add(labelType);
                    params.add(labelCode);
                    if (teamId != null && teamId > 0) {
                        sb.append(" and w.admin_team_code=? ");
                        params.add(teamId);
                    }
                    break;
                }
            }
            List<String> groupPatient = jdbcTemplate.queryForList(sb.toString(), String.class, params.toArray());
            patientSet.addAll(groupPatient);
        }
        if (patients != null && patients.length > 0) {
            List<String> arrPatient = java.util.Arrays.asList(patients);
            patientSet.addAll(arrPatient);
        }
    }
    /**
     * 保存发送信息
     *
     * @param patientSet    患者set集和
     * @param sendCode      发送人code、
     * @param sendName      发送人名称
     * @param sendMessage   发送人携带的信息
     * @param teamId        发送人所属团队
     * @param articleIds    文章列表
     * @param articlePics   文件封面
     * @param articleTitles 文章主题
     */
    @Transactional
    public List<HealthEduArticlePatient> saveArticle(Set<String> patientSet, String sendCode, String sendName, String sendMessage, Long teamId, String[] articleIds, String[] articlePics, String[] articleTitles) {
        List<HealthEduArticlePatient> healthEduArticlePatients = new ArrayList<>();
        String batchNo = UUID.randomUUID().toString();
        Date createTime = new Date();
        for (String patient : patientSet) {
            SignFamily signFamily = signFamilyDao.findByjiatingPatient(patient);
            for (int i = 0; i < articleIds.length; i++) {
                HealthEduArticlePatient healthEduArticlePatient = new HealthEduArticlePatient();
                // 设置文章标识
                healthEduArticlePatient.setArticle(articleIds[i]);
                // 设置医生标识
                healthEduArticlePatient.setDoctor(sendCode);
                // 设置医生姓名
                healthEduArticlePatient.setDoctorName(sendName);
                // 设置患者标识
                healthEduArticlePatient.setPatient(patient);
                // 设置为示读
                healthEduArticlePatient.setRead(1);
                // 签约类型
                healthEduArticlePatient.setSignType(2);
                // 行政团队
                healthEduArticlePatient.setAdminTeamCode(teamId);
                //附加内容
                healthEduArticlePatient.setAttachedContent(sendMessage);
                //批次号记录发送批次
                healthEduArticlePatient.setBatchNo(batchNo);
                //创建时间
                healthEduArticlePatient.setCzrq(createTime);
                healthEduArticlePatient.setSignCode(signFamily.getCode());
                healthEduArticlePatient.setSendType(2);
                healthEduArticlePatient.setAttachedTitle(articleTitles[i]);
                healthEduArticlePatient.setAttachedPic(articlePics[i]);
                healthEduArticlePatients.add(healthEduArticlePatient);
            }
        }
        healthEduArticlePatientDao.save(healthEduArticlePatients);
        //记录转发量
        for (HealthEduArticlePatient healthEduArticlePatient : healthEduArticlePatients) {
            healthEduArticleOpHistoryService.saveByStatus(HealthEduArticleOpHistory.REPEAT_STATUS, healthEduArticlePatient.getArticle(), healthEduArticlePatient.getTitle(), healthEduArticlePatient.getDoctor());
        }
        return healthEduArticlePatients;
    }
}

+ 83 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/gateway/vo/AdminTeamModel.java

@ -0,0 +1,83 @@
package com.yihu.wlyy.web.third.gateway.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.Date;
/**
 * Created by chenweida on 2017/8/30.
 */
@ApiModel(description ="团队实体")
public class AdminTeamModel {
    @ApiModelProperty(value = "id", required = false, access = "response")
    private Long id;
    @ApiModelProperty(value = "团队名称", required = false, access = "response")
    private String name;
    @ApiModelProperty(value = "团队长code", required = false, access = "response")
    private String leaderCode;
    @ApiModelProperty(value = "所属机构", required = false, access = "response")
    private String orgCode;
    @ApiModelProperty(value = "所属机构名称", required = false, access = "response")
    private String orgName;
    @ApiModelProperty(value = "所属区", required = false, access = "response")
    private String townCode;
    @ApiModelProperty(value = "所属区名", required = false, access = "response")
    private String townName;
    public Long getId() {
        return id;
    }
    public void setId(Long id) {
        this.id = id;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public String getLeaderCode() {
        return leaderCode;
    }
    public void setLeaderCode(String leaderCode) {
        this.leaderCode = leaderCode;
    }
    public String getOrgCode() {
        return orgCode;
    }
    public void setOrgCode(String orgCode) {
        this.orgCode = orgCode;
    }
    public String getOrgName() {
        return orgName;
    }
    public void setOrgName(String orgName) {
        this.orgName = orgName;
    }
    public String getTownCode() {
        return townCode;
    }
    public void setTownCode(String townCode) {
        this.townCode = townCode;
    }
    public String getTownName() {
        return townName;
    }
    public void setTownName(String townName) {
        this.townName = townName;
    }
}

+ 14 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/gateway/vo/LoginModel.java

@ -3,11 +3,14 @@ package com.yihu.wlyy.web.third.gateway.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.List;
import java.util.Map;
/**
 * Created by chenweida on 2017/8/17.
 */
@ApiModel(description = "登陆实体类")
public class LoginModel  {
public class LoginModel {
    @ApiModelProperty(value = "id", required = false, access = "response")
    private Long id;
@ -23,6 +26,8 @@ public class LoginModel  {
    private String doctorPhoto;
    @ApiModelProperty(value = "医生类型:1专科医生,2全科医生,3健康管理师", required = false, access = "response")
    private Integer doctorType;
    @ApiModelProperty(value = "用户权限", required = false, access = "response")
    private List<Map<String, String>> userRole;
    public String getDoctorCode() {
        return doctorCode;
@ -79,5 +84,13 @@ public class LoginModel  {
    public void setId(Long id) {
        this.id = id;
    }
    public List<Map<String, String>> getUserRole() {
        return userRole;
    }
    public void setUserRole(List<Map<String, String>> userRole) {
        this.userRole = userRole;
    }
}

+ 63 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/gateway/vo/PatientLabelModel.java

@ -0,0 +1,63 @@
package com.yihu.wlyy.web.third.gateway.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.Date;
/**
 * Created by chenweida on 2017/8/30.
 */
@ApiModel(description = "标签实体类")
public class PatientLabelModel {
    @ApiModelProperty(value = "标签code", required = false, access = "response")
    private String labelCode;
    @ApiModelProperty(value = "标签名称", required = false, access = "response")
    private String labelName;
    @ApiModelProperty(value = "1:卫计委三大分组 2:健康情况 3:疾病类型 4:自定义", required = false, access = "response")
    private String labelType;
    @ApiModelProperty(value = "居民关注微信数目", required = false, access = "response")
    private Integer focusAmount;
    @ApiModelProperty(value = "居民数目", required = false, access = "response")
    private Integer amount;
    public String getLabelCode() {
        return labelCode;
    }
    public void setLabelCode(String labelCode) {
        this.labelCode = labelCode;
    }
    public String getLabelName() {
        return labelName;
    }
    public void setLabelName(String labelName) {
        this.labelName = labelName;
    }
    public String getLabelType() {
        return labelType;
    }
    public void setLabelType(String labelType) {
        this.labelType = labelType;
    }
    public Integer getFocusAmount() {
        return focusAmount;
    }
    public void setFocusAmount(Integer focusAmount) {
        this.focusAmount = focusAmount;
    }
    public Integer getAmount() {
        return amount;
    }
    public void setAmount(Integer amount) {
        this.amount = amount;
    }
}

+ 20 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/gateway/vo/PatientModel.java

@ -81,7 +81,10 @@ public class PatientModel {
    private Date sicardTime;
    @ApiModelProperty(value = "是否签约(1是 0否)", required = false, access = "response")
    private Integer isSign;
    @ApiModelProperty(value = "微信是否绑定 1有 0没有", required = false, access = "response")
    private String wechatFocusRemind;
    @ApiModelProperty(value = "年龄", required = false, access = "response")
    private Integer age;
    public String getCode() {
        return code;
@ -266,4 +269,20 @@ public class PatientModel {
    public void setIsSign(Integer isSign) {
        this.isSign = isSign;
    }
    public String getWechatFocusRemind() {
        return wechatFocusRemind;
    }
    public void setWechatFocusRemind(String wechatFocusRemind) {
        this.wechatFocusRemind = wechatFocusRemind;
    }
    public Integer getAge() {
        return age;
    }
    public void setAge(Integer age) {
        this.age = age;
    }
}

+ 2 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/gateway/vo/base/BaseResultModel.java

@ -43,6 +43,8 @@ public class BaseResultModel {
        login_system_error(-10020, "系统异常"),
        login_publickey_error(-10030, "获取公钥失败"),
        file_upload_error(-10040, "文件上传失败"),
        find_error(-10050, "查询失败"),
        opera_error(-10060, "操作失败"),
        login_account_error(-20010, "账号不存在"),
        login_password_error(-20020, "密码错误"),

+ 4 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/gateway/vo/base/ResultBatchModel.java

@ -37,6 +37,10 @@ public class ResultBatchModel extends BaseResultModel {
    }
    public ResultBatchModel(Integer status, String message) {
        super(status, message);
    }
    public Integer getSuccessNum() {
        return successNum;
    }

+ 13 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/gateway/vo/base/ResultListModel.java

@ -13,6 +13,7 @@ public class ResultListModel<T> extends BaseResultModel {
    @ApiModelProperty(value = "返回数据", required = false, access = "response")
    private List<T> result;
    public List<T> getResult() {
        return result;
    }
@ -20,4 +21,16 @@ public class ResultListModel<T> extends BaseResultModel {
    public void setResult(List<T> result) {
        this.result = result;
    }
    public ResultListModel(List<T> result) {
        this.result = result;
    }
    public ResultListModel(Integer status, String message) {
        this.status = status;
        this.message = message;
    }
    public ResultListModel() {
    }
}

+ 6 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/gateway/vo/base/ResultPageListModel.java

@ -42,17 +42,21 @@ public class ResultPageListModel<T> extends BaseResultModel {
        this.pageSize = pageSize;
    }
    public ResultPageListModel(Integer page, Integer pageSize,Integer allNum, List<T> result) {
    public ResultPageListModel(Integer page, Integer pageSize, Integer allNum, List<T> result) {
        this.page = page;
        this.pageSize = pageSize;
        this.result = result;
        this.allNum=allNum;
        this.allNum = allNum;
    }
    public ResultPageListModel() {
    }
    public ResultPageListModel(Integer status, String message) {
        super(status, message);
    }
    public Integer getAllNum() {
        return allNum;
    }