Просмотр исходного кода

签约微服务,以及签约网关开发

chenyongxing 8 лет назад
Родитель
Сommit
6ff306298d

+ 55 - 1
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/wlyy/WlyyContants.java

@ -29,7 +29,6 @@ public class WlyyContants {
        public static final String message_success_create="agreement create success";
        public static final String message_success_find_functions="agreement find success";
    }
    //协议模块常量
@ -81,4 +80,59 @@ public class WlyyContants {
        public static final String message_success_create="agreementKpiLog create success";
        public static final String message_success_find_functions="agreementKpiLog find success";
    }
    //协议模块常量
    public static class WlyySignFamily{
        public static final String api_common="signFamily";
        public static final String api_create="create";
        public static final String api_delete="delete";
        public static final String api_getByCode="getByCode";
        public static final String api_update="update";
        public static final String api_queryPage="queryPage";
        public static final String api_getList="getList";
        public static final String message_fail_code_is_null="code is null";
        public static final String message_fail_name_is_null="name is null";
        public static final String message_fail_code_no_exist="code no exist";
        public static final String message_fail_status_is_null="status is null";
        public static final String message_fail_id_is_null="id is null";
        public static final String message_fail_type_is_null="type is null";
        public static final String message_fail_idCard_is_null="idCard is null";
        public static final String message_fail_ssc_is_null="ssc is null";
        public static final String message_fail_hospital_is_null="hospital is null";
        public static final String message_fail_hospitalName_is_null="hospitalName is null";
        public static final String message_fail_expense_is_null="expense is null";
        public static final String message_fail_expenseStatus_is_null="expenseStatus is null";
        public static final String message_fail_agreementCode_is_null="agreementCode is null";
        public static final String message_success_update="agreement update success";
        public static final String message_success_delete="agreement delete success";
        public static final String message_success_find="agreement find success";
        public static final String message_success_create="agreement create success";
        public static final String message_success_find_functions="agreement find success";
    }
    //协议模块常量
    public static class SignFamily{
        public static final String api_common="signFamily";
        public static final String api_create="create";
        public static final String api_delete="delete";
        public static final String api_getByCode="getByCode";
        public static final String api_update="update";
        public static final String api_queryPage="queryPage";
        public static final String api_getList="getList";
        public static final String message_fail_code_is_null="code is null";
        public static final String message_fail_name_is_null="name is null";
        public static final String message_fail_code_no_exist="code no exist";
        public static final String message_fail_id_is_null="id is null";
        public static final String message_success_update="agreement update success";
        public static final String message_success_delete="agreement delete success";
        public static final String message_success_find="agreement find success";
        public static final String message_success_create="agreement create success";
        public static final String message_success_find_functions="agreement find success";
    }
}

+ 113 - 0
svr/svr-wlyy/src/main/java/com/yihu/jw/wlyy/Agreement/controller/WlyySignFamilyController.java

@ -0,0 +1,113 @@
package com.yihu.jw.wlyy.Agreement.controller;
import com.yihu.jw.restmodel.common.Envelop;
import com.yihu.jw.restmodel.common.EnvelopRestController;
import com.yihu.jw.restmodel.exception.ApiException;
import com.yihu.jw.restmodel.wlyy.WlyyContants;
import com.yihu.jw.wlyy.Agreement.entity.WlyyAgreement;
import com.yihu.jw.wlyy.Agreement.entity.WlyySignFamily;
import com.yihu.jw.wlyy.Agreement.service.WlyySignFamilyService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.List;
@RestController
@RequestMapping(WlyyContants.WlyySignFamily.api_common)
@Api(value = "签约相关操作", description = "签约相关操作")
public class WlyySignFamilyController extends EnvelopRestController {
    @Autowired
    private WlyySignFamilyService wlyySignFamilyService;
    @PostMapping(value = WlyyContants.WlyySignFamily.api_create, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ApiOperation(value = "创建签约", notes = "创建签约")
    public Envelop create(
            @ApiParam(name = "json_data", value = "", defaultValue = "")
            @RequestBody String jsonData) {
        try {
            WlyySignFamily wlyySignFamily = toEntity(jsonData, WlyySignFamily.class);
            return Envelop.getSuccess(WlyyContants.WlyySignFamily.message_success_create, wlyySignFamilyService.create(wlyySignFamily));
        } catch (ApiException e) {
            return Envelop.getError(e.getMessage(), e.getErrorCode());
        }
    }
    @PutMapping(value = WlyyContants.WlyySignFamily.api_update, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ApiOperation(value = "修改签约", notes = "修改签约")
    public Envelop update(
            @ApiParam(name = "json_data", value = "", defaultValue = "")
            @RequestBody String jsonData) {
        try {
            WlyySignFamily wlyySignFamily = toEntity(jsonData, WlyySignFamily.class);
            return Envelop.getSuccess(WlyyContants.WlyySignFamily.message_success_update, wlyySignFamilyService.update(wlyySignFamily));
        } catch (ApiException e) {
            return Envelop.getError(e.getMessage(), e.getErrorCode());
        }
    }
    @GetMapping(value =WlyyContants.WlyySignFamily.api_getByCode)
    @ApiOperation(value = "根据code查找协议", notes = "根据code查找协议")
    public Envelop findByCode(
            @ApiParam(name = "code", value = "code")
            @RequestParam(value = "code", required = true) String code
    ) {
        try {
            return Envelop.getSuccess(WlyyContants.WlyySignFamily.message_success_find, wlyySignFamilyService.findByCode(code));
        } catch (ApiException e) {
            return Envelop.getError(e.getMessage(), e.getErrorCode());
        }
    }
    @RequestMapping(value =WlyyContants.WlyySignFamily.api_queryPage, method = RequestMethod.GET)
    @ApiOperation(value = "分页获取协议")
    public Envelop queryPage(
            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段", defaultValue = "id,code,parentCode,saasId,name,price,posterPic,remark,type,status")
            @RequestParam(value = "fields", required = false) String fields,
            @ApiParam(name = "filters", value = "过滤器,为空检索所有条件")
            @RequestParam(value = "filters", required = false) String filters,
            @ApiParam(name = "sorts", value = "排序,规则参见说明文档", defaultValue = "+name,+createTime")
            @RequestParam(value = "sorts", required = false) String sorts,
            @ApiParam(name = "size", value = "分页大小", defaultValue = "15")
            @RequestParam(value = "size", required = false) int size,
            @ApiParam(name = "page", value = "页码", defaultValue = "1")
            @RequestParam(value = "page", required = false) int page,
            HttpServletRequest request,
            HttpServletResponse response) throws Exception {
        //得到list数据
        List<WlyyAgreement> list = wlyySignFamilyService.search(fields, filters, sorts, page, size);
        //获取总数
        long count=wlyySignFamilyService.getCount(filters);
        //封装头信息
        pagedResponse(request, response, count, page, size);
        //封装返回格式
        List<WlyyAgreement> wlyyAgreement = convertToModels(list, new ArrayList<>(list.size()), WlyyAgreement.class, fields);
        return Envelop.getSuccessListWithPage(WlyyContants.WlyySignFamily.message_success_find_functions,wlyyAgreement, page, size,count);
    }
    @GetMapping(value =WlyyContants.WlyySignFamily.api_getList)
    @ApiOperation(value = "获取协议列表(不分页)")
    public Envelop getList(
            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段", defaultValue = "id,code,parentCode,saasId,name,price,posterPic,remark,type,status")
            @RequestParam(value = "fields", required = false) String fields,
            @ApiParam(name = "filters", value = "过滤器,为空检索所有条件")
            @RequestParam(value = "filters", required = false) String filters,
            @ApiParam(name = "sorts", value = "排序,规则参见说明文档", defaultValue = "+name,+createTime")
            @RequestParam(value = "sorts", required = false) String sorts) throws Exception {
        //得到list数据
        List<WlyyAgreement> list = wlyySignFamilyService.search(fields,filters,sorts);
        //封装返回格式
        List<WlyyAgreement> wlyyAgreement = convertToModels(list, new ArrayList<>(list.size()), WlyyAgreement.class, fields);
        return Envelop.getSuccessList(WlyyContants.WlyySignFamily.message_success_find_functions,wlyyAgreement);
    }
}

+ 15 - 0
svr/svr-wlyy/src/main/java/com/yihu/jw/wlyy/Agreement/dao/WlyySignFamilyDao.java

@ -0,0 +1,15 @@
package com.yihu.jw.wlyy.Agreement.dao;
import com.yihu.jw.wlyy.Agreement.entity.WlyySignFamily;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * Created by Administrator on 2017/6/2 0002.
 */
public interface WlyySignFamilyDao  extends PagingAndSortingRepository<WlyySignFamily, Long>, JpaSpecificationExecutor<WlyySignFamily> {
    @Query("from WlyySignFamily w where w.code = ?1")
    WlyySignFamily findByCode(String code);
}

+ 13 - 9
svr/svr-wlyy/src/main/java/com/yihu/jw/wlyy/Agreement/entity/WlyyAgreement.java

@ -8,7 +8,7 @@ import javax.persistence.Entity;
import javax.persistence.Table;
import java.io.Serializable;
import java.math.BigDecimal;
import java.sql.Timestamp;
import java.util.Date;
/**
 * Created by Administrator on 2017/6/1 0001.
@ -27,12 +27,12 @@ public class WlyyAgreement extends IdEntity implements Serializable{
    private String posterPic;//海报图
    private String remark;//描述
    private String type;//类型
    private Timestamp createTime;
    private Timestamp updateTime;
    private String status;//状态
    private Date createTime;
    private Date updateTime;
    private String status;//状态 -1删除 0 冻结 1可用
    private String createUser;
    public WlyyAgreement(String code, String parentCode, String saasId, String name, BigDecimal price, String posterPic, String remark, String type, Timestamp createTime, Timestamp updateTime, String status, String createUser) {
    public WlyyAgreement(String code, String parentCode, String saasId, String name, BigDecimal price, String posterPic, String remark, String type, Date createTime, Date updateTime, String status, String createUser) {
        this.code = code;
        this.parentCode = parentCode;
        this.saasId = saasId;
@ -47,6 +47,10 @@ public class WlyyAgreement extends IdEntity implements Serializable{
        this.createUser = createUser;
    }
    public WlyyAgreement(){
    }
    @Column(name = "code")
    public String getCode() {
        return code;
@ -120,20 +124,20 @@ public class WlyyAgreement extends IdEntity implements Serializable{
    }
    @Column(name = "create_time")
    public Timestamp getCreateTime() {
    public Date getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Timestamp createTime) {
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    @Column(name = "update_time")
    public Timestamp getUpdateTime() {
    public Date getUpdateTime() {
        return updateTime;
    }
    public void setUpdateTime(Timestamp updateTime) {
    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

+ 7 - 16
svr/svr-wlyy/src/main/java/com/yihu/jw/wlyy/Agreement/entity/WlyyAgreementKpi.java

@ -7,6 +7,7 @@ import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.sql.Timestamp;
import java.util.Date;
/**
 * Created by Administrator on 2017/6/1 0001.
@ -19,13 +20,12 @@ public class WlyyAgreementKpi extends IdEntity {
    private String kpiName;//服务项名称
    private String type;//服务项类型
    private String kpiTimes;//服务次数
    private Integer status;//状态
    private Integer del;//删除状态
    private Integer status;//状态  -1删除 0 冻结 1可用
    private String kpiContent;//服务内容描述
    private String keyword;//关键字
    private Timestamp createTime;
    private Date createTime;
    private String createUser;
    private Timestamp updaateTime;
    private Date updaateTime;
    public String getAgreementCode() {
        return agreementCode;
@ -80,15 +80,6 @@ public class WlyyAgreementKpi extends IdEntity {
        this.status = status;
    }
    @Column(name = "del")
    public Integer getDel() {
        return del;
    }
    public void setDel(Integer del) {
        this.del = del;
    }
    @Column(name = "kpi_content")
    public String getKpiContent() {
        return kpiContent;
@ -108,7 +99,7 @@ public class WlyyAgreementKpi extends IdEntity {
    }
    @Column(name = "create_time")
    public Timestamp getCreateTime() {
    public Date getCreateTime() {
        return createTime;
    }
@ -126,11 +117,11 @@ public class WlyyAgreementKpi extends IdEntity {
    }
    @Column(name = "updaate_time")
    public Timestamp getUpdaateTime() {
    public Date getUpdaateTime() {
        return updaateTime;
    }
    public void setUpdaateTime(Timestamp updaateTime) {
    public void setUpdaateTime(Date updaateTime) {
        this.updaateTime = updaateTime;
    }
}

+ 6 - 2
svr/svr-wlyy/src/main/java/com/yihu/jw/wlyy/Agreement/entity/WlyyAgreementKpiLog.java

@ -7,6 +7,7 @@ import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.sql.Timestamp;
import java.util.Date;
/**
 * Created by Administrator on 2017/6/1 0001.
@ -14,13 +15,16 @@ import java.sql.Timestamp;
@Entity
@Table(name = "wlyy_agreement_kpi_log")
public class WlyyAgreementKpiLog extends IdEntity {
    private static final long serialVersionUID = -3196907595969778396L;
    private String code;//业务code
    private String patientCode;//患者code
    private String signCode;
    private String kpiCode;
    private String agreementCode;//套餐代码
    private String kpiName;//服务项名称
    private Timestamp createTime;
    private Date createTime;
    private String createUser;
@ -79,7 +83,7 @@ public class WlyyAgreementKpiLog extends IdEntity {
    }
    @Column(name = "create_time")
    public Timestamp getCreateTime() {
    public Date getCreateTime() {
        return createTime;
    }

+ 515 - 0
svr/svr-wlyy/src/main/java/com/yihu/jw/wlyy/Agreement/entity/WlyySignFamily.java

@ -0,0 +1,515 @@
package com.yihu.jw.wlyy.Agreement.entity;
import com.yihu.jw.wlyy.Agreement.entity.base.IdEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;
/**
 * Created by Administrator on 2017/6/2 0002.
 */
@Entity
@Table(name = "wlyy_sign_family")
public class WlyySignFamily extends IdEntity{
    private static final long serialVersionUID = -6759565631854462880L;
    private String code;//业务code
    private int type;//签约类型:1三师签约,2家庭签约
    private String patient;//患者标识
    private String openid;//患者微信公众号openid
    private String name;//患者姓名
    private String idcard;//身份证号
    private String ssc;//社保号
    private String mobile;//手机号
    private String emerMobile;//紧急联系人手机号
    private String hospital;//签约医院标识
    private String hospitalName;//签约医院名称
    private String doctor;//全科医生code
    private String doctorName;//全科医生姓名
    private Date begin;//签约开始日期
    private Date end;//签约结束日期
    private String images;//签约图片附件URL,多图以逗号分隔
    private String groupCode;//分组标识
    private int status;//签约状态(-1患者已取消,-2已拒绝,-3已解约,-4已到期,0待签约,1已签约,2患者申请取消签约,3医生申请取消签约
    private String reason;//解决原因
    private Date czrq;//操作时间
    private String teamCode;//所属团队code 关联wlyy_doctor_team
    private String signType;//1 用户自己申请  2医生手工带签
    private Date applyDate;//签约时间
    private String releaseSpeak;//解约说明
    private String doctorHealthName;//健康管理师名字
    private String doctorHealth;//健康管理师code
    private String familyCode;//家庭签约标识(年份(两位:例如2016就填写 16)+街道编码(行政区代码)+中心/站(2位)+人数(6位))
    private Date patientApplyDate;//患者发起的签约时间
    private Double expenses;//签约费用
    private String expensesStatus;//扣费状态 【0未扣费 1已扣费 2已退费】
    private String signSource;//签约来源【1 社区签约 2 移动签约】
    private String signDoctorCode;//签约人code
    private String signDoctorName;//签约人名
    private String signDoctorLevel;//1专科 2全科 3健康管理师
    private Date patientApplyUnsginDate;//患者发起的解约时间
    private Date applyUnsignDate;//节约同意时间
    private String expensesType;//补贴类型
    private String signYear;//签约年度
    private String medicalInsuranceNum;//医保流水号
    private String agentDoctorCode;//代签的健康管理师code
    private String agentDoctorName;//代签的健康管理师
    private String agentDoctorLevel;//代签的健康管理师
    private Integer adminTeamCode;//行政团队
    private java.util.Date expensesTime;//缴费时间
    private String agreementCode;//协议code
    private String criticalPeopleMobile;//紧急联系人电话
    private String criticalPeople;//紧急联系人
    @Column(name = "code")
    public String getCode() {
        return code;
    }
    public void setCode(String code) {
        this.code = code;
    }
    @Column(name = "type")
    public int getType() {
        return type;
    }
    public void setType(int type) {
        this.type = type;
    }
    @Column(name = "patient")
    public String getPatient() {
        return patient;
    }
    public void setPatient(String patient) {
        this.patient = patient;
    }
    @Column(name = "openid")
    public String getOpenid() {
        return openid;
    }
    public void setOpenid(String openid) {
        this.openid = openid;
    }
    @Column(name = "name")
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    @Column(name = "idcard")
    public String getIdcard() {
        return idcard;
    }
    public void setIdcard(String idcard) {
        this.idcard = idcard;
    }
    @Column(name = "ssc")
    public String getSsc() {
        return ssc;
    }
    public void setSsc(String ssc) {
        this.ssc = ssc;
    }
    @Column(name = "mobile")
    public String getMobile() {
        return mobile;
    }
    public void setMobile(String mobile) {
        this.mobile = mobile;
    }
    @Column(name = "emer_mobile")
    public String getEmerMobile() {
        return emerMobile;
    }
    public void setEmerMobile(String emerMobile) {
        this.emerMobile = emerMobile;
    }
    @Column(name = "hospital")
    public String getHospital() {
        return hospital;
    }
    public void setHospital(String hospital) {
        this.hospital = hospital;
    }
    @Column(name = "hospital_name")
    public String getHospitalName() {
        return hospitalName;
    }
    public void setHospitalName(String hospitalName) {
        this.hospitalName = hospitalName;
    }
    @Column(name = "doctor")
    public String getDoctor() {
        return doctor;
    }
    public void setDoctor(String doctor) {
        this.doctor = doctor;
    }
    @Column(name = "doctor_name")
    public String getDoctorName() {
        return doctorName;
    }
    public void setDoctorName(String doctorName) {
        this.doctorName = doctorName;
    }
    @Column(name = "begin")
    public Date getBegin() {
        return begin;
    }
    public void setBegin(Date begin) {
        this.begin = begin;
    }
    @Column(name = "end")
    public Date getEnd() {
        return end;
    }
    public void setEnd(Date end) {
        this.end = end;
    }
    @Column(name = "images")
    public String getImages() {
        return images;
    }
    public void setImages(String images) {
        this.images = images;
    }
    @Column(name = "group_code")
    public String getGroupCode() {
        return groupCode;
    }
    public void setGroupCode(String groupCode) {
        this.groupCode = groupCode;
    }
    @Column(name = "status")
    public int getStatus() {
        return status;
    }
    public void setStatus(int status) {
        this.status = status;
    }
    @Column(name = "reason")
    public String getReason() {
        return reason;
    }
    public void setReason(String reason) {
        this.reason = reason;
    }
    @Column(name = "czrq")
    public Date getCzrq() {
        return czrq;
    }
    public void setCzrq(Date czrq) {
        this.czrq = czrq;
    }
    @Column(name = "team_code")
    public String getTeamCode() {
        return teamCode;
    }
    public void setTeamCode(String teamCode) {
        this.teamCode = teamCode;
    }
    @Column(name = "sign_type")
    public String getSignType() {
        return signType;
    }
    public void setSignType(String signType) {
        this.signType = signType;
    }
    
    @Column(name = "apply_date")
    public Date getApplyDate() {
        return applyDate;
    }
    public void setApplyDate(Date applyDate) {
        this.applyDate = applyDate;
    }
    
    @Column(name = "release_speak")
    public String getReleaseSpeak() {
        return releaseSpeak;
    }
    public void setReleaseSpeak(String releaseSpeak) {
        this.releaseSpeak = releaseSpeak;
    }
    
    @Column(name = "doctor_health_name")
    public String getDoctorHealthName() {
        return doctorHealthName;
    }
    public void setDoctorHealthName(String doctorHealthName) {
        this.doctorHealthName = doctorHealthName;
    }
    
    @Column(name = "doctor_health")
    public String getDoctorHealth() {
        return doctorHealth;
    }
    public void setDoctorHealth(String doctorHealth) {
        this.doctorHealth = doctorHealth;
    }
    
    @Column(name = "family_code")
    public String getFamilyCode() {
        return familyCode;
    }
    public void setFamilyCode(String familyCode) {
        this.familyCode = familyCode;
    }
    
    @Column(name = "patient_apply_date")
    public Date getPatientApplyDate() {
        return patientApplyDate;
    }
    public void setPatientApplyDate(Date patientApplyDate) {
        this.patientApplyDate = patientApplyDate;
    }
    
    @Column(name = "expenses")
    public Double getExpenses() {
        return expenses;
    }
    public void setExpenses(Double expenses) {
        this.expenses = expenses;
    }
    
    @Column(name = "expenses_status")
    public String getExpensesStatus() {
        return expensesStatus;
    }
    public void setExpensesStatus(String expensesStatus) {
        this.expensesStatus = expensesStatus;
    }
    
    @Column(name = "sign_source")
    public String getSignSource() {
        return signSource;
    }
    public void setSignSource(String signSource) {
        this.signSource = signSource;
    }
    
    @Column(name = "sign_doctor_code")
    public String getSignDoctorCode() {
        return signDoctorCode;
    }
    public void setSignDoctorCode(String signDoctorCode) {
        this.signDoctorCode = signDoctorCode;
    }
    
    @Column(name = "sign_doctor_name")
    public String getSignDoctorName() {
        return signDoctorName;
    }
    public void setSignDoctorName(String signDoctorName) {
        this.signDoctorName = signDoctorName;
    }
    
    @Column(name = "sign_doctor_level")
    public String getSignDoctorLevel() {
        return signDoctorLevel;
    }
    public void setSignDoctorLevel(String signDoctorLevel) {
        this.signDoctorLevel = signDoctorLevel;
    }
    
    @Column(name = "patient_apply_unsgin_date")
    public Date getPatientApplyUnsginDate() {
        return patientApplyUnsginDate;
    }
    public void setPatientApplyUnsginDate(Date patientApplyUnsginDate) {
        this.patientApplyUnsginDate = patientApplyUnsginDate;
    }
    
    @Column(name = "apply_unsign_date")
    public Date getApplyUnsignDate() {
        return applyUnsignDate;
    }
    public void setApplyUnsignDate(Date applyUnsignDate) {
        this.applyUnsignDate = applyUnsignDate;
    }
    
    @Column(name = "expenses_type")
    public String getExpensesType() {
        return expensesType;
    }
    public void setExpensesType(String expensesType) {
        this.expensesType = expensesType;
    }
    
    @Column(name = "sign_year")
    public String getSignYear() {
        return signYear;
    }
    public void setSignYear(String signYear) {
        this.signYear = signYear;
    }
    
    @Column(name = "medical_insurance_num")
    public String getMedicalInsuranceNum() {
        return medicalInsuranceNum;
    }
    public void setMedicalInsuranceNum(String medicalInsuranceNum) {
        this.medicalInsuranceNum = medicalInsuranceNum;
    }
    
    @Column(name = "agent_doctor_code")
    public String getAgentDoctorCode() {
        return agentDoctorCode;
    }
    public void setAgentDoctorCode(String agentDoctorCode) {
        this.agentDoctorCode = agentDoctorCode;
    }
    
    @Column(name = "agent_doctor_name")
    public String getAgentDoctorName() {
        return agentDoctorName;
    }
    public void setAgentDoctorName(String agentDoctorName) {
        this.agentDoctorName = agentDoctorName;
    }
    
    @Column(name = "agent_doctor_level")
    public String getAgentDoctorLevel() {
        return agentDoctorLevel;
    }
    public void setAgentDoctorLevel(String agentDoctorLevel) {
        this.agentDoctorLevel = agentDoctorLevel;
    }
    
    @Column(name = "admin_team_code")
    public Integer getAdminTeamCode() {
        return adminTeamCode;
    }
    public void setAdminTeamCode(Integer adminTeamCode) {
        this.adminTeamCode = adminTeamCode;
    }
    
    @Column(name = "expenses_time")
    public Date getExpensesTime() {
        return expensesTime;
    }
    public void setExpensesTime(Date expensesTime) {
        this.expensesTime = expensesTime;
    }
    
    @Column(name = "agreement_code")
    public String getAgreementCode() {
        return agreementCode;
    }
    public void setAgreementCode(String agreementCode) {
        this.agreementCode = agreementCode;
    }
    
    @Column(name = "critical_people_mobile")
    public String getCriticalPeopleMobile() {
        return criticalPeopleMobile;
    }
    public void setCriticalPeopleMobile(String criticalPeopleMobile) {
        this.criticalPeopleMobile = criticalPeopleMobile;
    }
    
    @Column(name = "critical_people")
    public String getCriticalPeople() {
        return criticalPeople;
    }
    public void setCriticalPeople(String criticalPeople) {
        this.criticalPeople = criticalPeople;
    }
}

+ 82 - 0
svr/svr-wlyy/src/main/java/com/yihu/jw/wlyy/Agreement/service/WlyySignFamilyService.java

@ -0,0 +1,82 @@
package com.yihu.jw.wlyy.Agreement.service;
import com.yihu.jw.mysql.query.BaseJpaService;
import com.yihu.jw.restmodel.common.CommonContants;
import com.yihu.jw.restmodel.exception.ApiException;
import com.yihu.jw.restmodel.wlyy.WlyyContants;
import com.yihu.jw.wlyy.Agreement.dao.WlyySignFamilyDao;
import com.yihu.jw.wlyy.Agreement.entity.WlyySignFamily;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import javax.persistence.Transient;
/**
 * Created by Administrator on 2017/6/2 0002.
 */
@Service
public class WlyySignFamilyService extends BaseJpaService<WlyySignFamily, WlyySignFamilyDao> {
    @Autowired
    private WlyySignFamilyDao wlyySignFamilyDao;
    @Transient
    public WlyySignFamily create(WlyySignFamily wlyySignFamily) {
        boolean b = canSaveOrUpdate(wlyySignFamily);
        if(b){
            return wlyySignFamilyDao.save(wlyySignFamily);
        }
        return null;
    }
    @Transient
    public WlyySignFamily update(WlyySignFamily wlyySignFamily) {
        boolean b = canSaveOrUpdate(wlyySignFamily);
        if(b){
            return wlyySignFamilyDao.save(wlyySignFamily);
        }
        return null;
    }
    public WlyySignFamily findByCode(String code) {
        return wlyySignFamilyDao.findByCode(code);
    }
    private boolean canSaveOrUpdate(WlyySignFamily wlyySignFamily){
        if (StringUtils.isEmpty(wlyySignFamily.getCode())) {
            throw new ApiException(WlyyContants.WlyySignFamily.message_fail_code_is_null, CommonContants.common_error_params_code);
        }
        if (StringUtils.isEmpty(wlyySignFamily.getType())) {
            throw new ApiException(WlyyContants.WlyySignFamily.message_fail_type_is_null, CommonContants.common_error_params_code);
        }
        if (StringUtils.isEmpty(wlyySignFamily.getName())) {
            throw new ApiException(WlyyContants.WlyySignFamily.message_fail_name_is_null, CommonContants.common_error_params_code);
        }
        if (StringUtils.isEmpty(wlyySignFamily.getIdcard())) {
            throw new ApiException(WlyyContants.WlyySignFamily.message_fail_idCard_is_null, CommonContants.common_error_params_code);
        }
        if (StringUtils.isEmpty(wlyySignFamily.getSsc())) {
            throw new ApiException(WlyyContants.WlyySignFamily.message_fail_ssc_is_null, CommonContants.common_error_params_code);
        }
        if (StringUtils.isEmpty(wlyySignFamily.getHospital())) {
            throw new ApiException(WlyyContants.WlyySignFamily.message_fail_hospital_is_null, CommonContants.common_error_params_code);
        }
        if (StringUtils.isEmpty(wlyySignFamily.getHospitalName())) {
            throw new ApiException(WlyyContants.WlyySignFamily.message_fail_hospitalName_is_null, CommonContants.common_error_params_code);
        }
        if (StringUtils.isEmpty(wlyySignFamily.getStatus())) {
            throw new ApiException(WlyyContants.WlyySignFamily.message_fail_status_is_null, CommonContants.common_error_params_code);
        }
        if (StringUtils.isEmpty(wlyySignFamily.getExpenses())) {
            throw new ApiException(WlyyContants.WlyySignFamily.message_fail_expense_is_null, CommonContants.common_error_params_code);
        }
        if (StringUtils.isEmpty(wlyySignFamily.getExpensesStatus())) {
            throw new ApiException(WlyyContants.WlyySignFamily.message_fail_expenseStatus_is_null, CommonContants.common_error_params_code);
        }
        if (StringUtils.isEmpty(wlyySignFamily.getAgreementCode())) {
            throw new ApiException(WlyyContants.WlyySignFamily.message_fail_agreementCode_is_null, CommonContants.common_error_params_code);
        }
        return true;
    }
}

+ 31 - 28
web-gateway/src/main/java/com/yihu/jw/controller/wlyy/agreement/WlyyAgreementKpiLogController.java

@ -2,14 +2,17 @@ package com.yihu.jw.controller.wlyy.agreement;
import com.yihu.jw.commnon.wlyy.AgreementContants;
import com.yihu.jw.fegin.wlyy.agreement.WlyyAgreementKpiLogFegin;
import com.yihu.jw.restmodel.common.Envelop;
import com.yihu.jw.restmodel.common.EnvelopRestController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.sleuth.Tracer;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
@RestController
@RequestMapping(AgreementContants.AgreementKpiLog.api_common)
@ -24,22 +27,22 @@ public class WlyyAgreementKpiLogController extends EnvelopRestController {
    @Autowired
    private Tracer tracer;
    //@PostMapping(value = AgreementContants.AgreementKpiLog.api_create, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    //@ApiOperation(value = "创建套餐指标日志", notes = "创建套餐指标日志")
    //public Envelop create(
    //        @ApiParam(name = "json_data", value = "", defaultValue = "")
    //        @RequestBody String jsonData) {
    //    return wlyyAgreementKpiLogFegin.create(jsonData);
    //}
    @PostMapping(value = AgreementContants.AgreementKpiLog.api_create, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ApiOperation(value = "创建套餐指标日志", notes = "创建套餐指标日志")
    public Envelop create(
            @ApiParam(name = "json_data", value = "", defaultValue = "")
            @RequestBody String jsonData) {
        return wlyyAgreementKpiLogFegin.create(jsonData);
    }
    //@GetMapping(value =AgreementContants.AgreementKpiLog.api_getByCode)
    //@ApiOperation(value = "根据code查找套餐指标日志", notes = "根据code查找套餐指标日志")
    //public Envelop findByCode(
    //        @ApiParam(name = "code", value = "code")
    //        @RequestParam(value = "code", required = true) String code
    //) {
    //    return wlyyAgreementKpiLogFegin.findByCode(code);
    //}
    @GetMapping(value =AgreementContants.AgreementKpiLog.api_getByCode)
    @ApiOperation(value = "根据code查找套餐指标日志", notes = "根据code查找套餐指标日志")
    public Envelop findByCode(
            @ApiParam(name = "code", value = "code")
            @RequestParam(value = "code", required = true) String code
    ) {
        return wlyyAgreementKpiLogFegin.findByCode(code);
    }
    //@RequestMapping(value =AgreementContants.AgreementKpiLog.api_queryPage, method = RequestMethod.GET)
    //@ApiOperation(value = "分页获取套餐指标日志")
@ -60,16 +63,16 @@ public class WlyyAgreementKpiLogController extends EnvelopRestController {
    //}
    //@GetMapping(value =AgreementContants.AgreementKpiLog.api_getList)
    //@ApiOperation(value = "获取套餐指标日志列表(不分页)")
    //public Envelop getList(
    //        @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段", defaultValue = "id,code,patientCode,signCode,kpiCode,agreementCode,kpiName")
    //        @RequestParam(value = "fields", required = false) String fields,
    //        @ApiParam(name = "filters", value = "过滤器,为空检索所有条件")
    //        @RequestParam(value = "filters", required = false) String filters,
    //        @ApiParam(name = "sorts", value = "排序,规则参见说明文档", defaultValue = "+kpiName,+createTime")
    //        @RequestParam(value = "sorts", required = false) String sorts) throws Exception {
    //    return wlyyAgreementKpiLogFegin.getList(fields,filters,sorts);
    //}
    @GetMapping(value =AgreementContants.AgreementKpiLog.api_getList)
    @ApiOperation(value = "获取套餐指标日志列表(不分页)")
    public Envelop getList(
            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段", defaultValue = "id,code,patientCode,signCode,kpiCode,agreementCode,kpiName")
            @RequestParam(value = "fields", required = false) String fields,
            @ApiParam(name = "filters", value = "过滤器,为空检索所有条件")
            @RequestParam(value = "filters", required = false) String filters,
            @ApiParam(name = "sorts", value = "排序,规则参见说明文档", defaultValue = "+kpiName,+createTime")
            @RequestParam(value = "sorts", required = false) String sorts) throws Exception {
        return wlyyAgreementKpiLogFegin.getList(fields,filters,sorts);
    }
}

+ 89 - 0
web-gateway/src/main/java/com/yihu/jw/controller/wlyy/agreement/WlyySignFamilyController.java

@ -0,0 +1,89 @@
package com.yihu.jw.controller.wlyy.agreement;
import com.yihu.jw.fegin.wlyy.agreement.WlyySignFamilyFegin;
import com.yihu.jw.restmodel.common.Envelop;
import com.yihu.jw.restmodel.common.EnvelopRestController;
import com.yihu.jw.restmodel.wlyy.WlyyContants;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.sleuth.Tracer;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@RestController
@RequestMapping(WlyyContants.WlyySignFamily.api_common)
@Api(value = "签约相关操作", description = "签约相关操作")
public class WlyySignFamilyController extends EnvelopRestController {
    private Logger logger= LoggerFactory.getLogger(WlyySignFamilyController.class);
    @Autowired
    private WlyySignFamilyFegin wlyySignFamilyFegin;
    @Autowired
    private Tracer tracer;
    @PostMapping(value = WlyyContants.WlyySignFamily.api_create, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ApiOperation(value = "创建签约", notes = "创建签约")
    public Envelop create(
            @ApiParam(name = "json_data", value = "", defaultValue = "")
            @RequestBody String jsonData) {
       return wlyySignFamilyFegin.create(jsonData);
    }
    @PutMapping(value = WlyyContants.WlyySignFamily.api_update, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ApiOperation(value = "修改签约", notes = "修改签约")
    public Envelop update(
            @ApiParam(name = "json_data", value = "", defaultValue = "")
            @RequestBody String jsonData) {
        return wlyySignFamilyFegin.update(jsonData);
    }
    @GetMapping(value =WlyyContants.WlyySignFamily.api_getByCode)
    @ApiOperation(value = "根据code查找协议", notes = "根据code查找协议")
    public Envelop findByCode(
            @ApiParam(name = "code", value = "code")
            @RequestParam(value = "code", required = true) String code
    ) {
       return wlyySignFamilyFegin.findByCode(code);
    }
    @RequestMapping(value =WlyyContants.WlyySignFamily.api_queryPage, method = RequestMethod.GET)
    @ApiOperation(value = "分页获取协议")
    public Envelop queryPage(
            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段", defaultValue = "id,code,parentCode,saasId,name,price,posterPic,remark,type,status")
            @RequestParam(value = "fields", required = false) String fields,
            @ApiParam(name = "filters", value = "过滤器,为空检索所有条件")
            @RequestParam(value = "filters", required = false) String filters,
            @ApiParam(name = "sorts", value = "排序,规则参见说明文档", defaultValue = "+name,+createTime")
            @RequestParam(value = "sorts", required = false) String sorts,
            @ApiParam(name = "size", value = "分页大小", defaultValue = "15")
            @RequestParam(value = "size", required = false) int size,
            @ApiParam(name = "page", value = "页码", defaultValue = "1")
            @RequestParam(value = "page", required = false) int page,
            HttpServletRequest request,
            HttpServletResponse response) throws Exception {
       return wlyySignFamilyFegin.queryPage(fields, filters, sorts, size, page, request, response);
    }
    @GetMapping(value =WlyyContants.WlyySignFamily.api_getList)
    @ApiOperation(value = "获取协议列表(不分页)")
    public Envelop getList(
            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段", defaultValue = "id,code,parentCode,saasId,name,price,posterPic,remark,type,status")
            @RequestParam(value = "fields", required = false) String fields,
            @ApiParam(name = "filters", value = "过滤器,为空检索所有条件")
            @RequestParam(value = "filters", required = false) String filters,
            @ApiParam(name = "sorts", value = "排序,规则参见说明文档", defaultValue = "+name,+createTime")
            @RequestParam(value = "sorts", required = false) String sorts) throws Exception {
        return wlyySignFamilyFegin.getList(fields,filters,sorts);
    }
}

+ 51 - 0
web-gateway/src/main/java/com/yihu/jw/fegin/fallbackfactory/wlyy/agreement/WlyySignFamilyFeginFallbackFactory.java

@ -0,0 +1,51 @@
package com.yihu.jw.fegin.fallbackfactory.wlyy.agreement;
import com.yihu.jw.fegin.wlyy.agreement.WlyySignFamilyFegin;
import com.yihu.jw.restmodel.common.Envelop;
import feign.hystrix.FallbackFactory;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
 * Created by Administrator on 2017/6/2 0002.
 */
public class WlyySignFamilyFeginFallbackFactory implements FallbackFactory<WlyySignFamilyFegin>{
    @Override
    public WlyySignFamilyFegin create(Throwable throwable) {
        return new WlyySignFamilyFegin() {
            @Override
            public Envelop create(@RequestBody String jsonData) {
                return null;
            }
            @Override
            public Envelop update(@RequestBody String jsonData) {
                return null;
            }
            @Override
            public Envelop delete(@RequestParam(value = "code") String code) {
                return null;
            }
            @Override
            public Envelop findByCode(@RequestParam(value = "code") String code) {
                return null;
            }
            @Override
            public Envelop queryPage(@RequestParam(value = "fields", required = false) String fields, @RequestParam(value = "filters", required = false) String filters, @RequestParam(value = "sorts", required = false) String sorts, @RequestParam(value = "size", required = false) int size, @RequestParam(value = "page", required = false) int page, HttpServletRequest request, HttpServletResponse response) {
                return null;
            }
            @Override
            public Envelop getList(@RequestParam(value = "fields", required = false) String fields, @RequestParam(value = "filters", required = false) String filters, @RequestParam(value = "sorts", required = false) String sorts) {
                return null;
            }
        };
    }
}

+ 49 - 0
web-gateway/src/main/java/com/yihu/jw/fegin/wlyy/agreement/WlyySignFamilyFegin.java

@ -0,0 +1,49 @@
package com.yihu.jw.fegin.wlyy.agreement;
import com.yihu.jw.fegin.fallbackfactory.wlyy.agreement.WlyySignFamilyFeginFallbackFactory;
import com.yihu.jw.restmodel.common.CommonContants;
import com.yihu.jw.restmodel.common.Envelop;
import com.yihu.jw.restmodel.wlyy.WlyyContants;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@FeignClient(
        name = CommonContants.svr_wlyy // name值是eurika的实例名字
        ,fallbackFactory  = WlyySignFamilyFeginFallbackFactory.class
)
@RequestMapping(WlyyContants.SignFamily.api_common)
public interface WlyySignFamilyFegin {
    @PostMapping(value = WlyyContants.SignFamily.api_create, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    Envelop create(@RequestBody String jsonData);
    @PutMapping(value = WlyyContants.SignFamily.api_update, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    Envelop update(@RequestBody String jsonData);
    @DeleteMapping(value =WlyyContants.SignFamily.api_delete)
    Envelop delete(@RequestParam(value = "code") String code);
    @RequestMapping(value=WlyyContants.SignFamily.api_getByCode,method = RequestMethod.GET)
    Envelop findByCode(@RequestParam(value = "code") String code);
    @RequestMapping(value =WlyyContants.SignFamily.api_queryPage, method = RequestMethod.GET)
    Envelop queryPage(
            @RequestParam(value = "fields", required = false) String fields,
            @RequestParam(value = "filters", required = false) String filters,
            @RequestParam(value = "sorts", required = false) String sorts,
            @RequestParam(value = "size", required = false) int size,
            @RequestParam(value = "page", required = false) int page,
            HttpServletRequest request,
            HttpServletResponse response);
    @GetMapping(value =WlyyContants.SignFamily.api_getList)
    Envelop getList(
            @RequestParam(value = "fields", required = false) String fields,
            @RequestParam(value = "filters", required = false) String filters,
            @RequestParam(value = "sorts", required = false) String sorts);
}