Browse Source

代码修改

chenweida 7 years ago
parent
commit
8b4acebbab
15 changed files with 369 additions and 7 deletions
  1. BIN
      patient-co/patient-co-wlyy/doc/接口文档/对外接口文档/集美健康教育/集美健康教育对外接口文档.docx
  2. 1 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/account/LoginController.java
  3. 1 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/patient/SignPatientLabelInfoController.java
  4. 1 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/gateway/controller/GcHospitalController.java
  5. 8 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/gateway/controller/GcLoginController.java
  6. 24 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/gateway/controller/doctor/GcDoctorController.java
  7. 18 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/gateway/controller/doctor/GcEduArticleController.java
  8. 116 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/gateway/controller/doctor/GcLableController.java
  9. 83 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/gateway/vo/AdminTeamModel.java
  10. 14 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/gateway/vo/LoginModel.java
  11. 63 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/gateway/vo/PatientLabelModel.java
  12. 20 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/gateway/vo/PatientModel.java
  13. 1 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/gateway/vo/base/BaseResultModel.java
  14. 13 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/gateway/vo/base/ResultListModel.java
  15. 6 2
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/gateway/vo/base/ResultPageListModel.java

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


+ 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);

+ 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);
    }
}

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

@ -0,0 +1,18 @@
package com.yihu.wlyy.web.third.gateway.controller.doctor;
import io.swagger.annotations.Api;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
/**
 * 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 {
}

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

@ -0,0 +1,116 @@
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, team.toString());
            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 = "/signPatients", 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());
        }
    }
}

+ 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;
    }
}

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

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

+ 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;
    }