Kaynağa Gözat

协议套餐等网关

chenyongxing 8 yıl önce
ebeveyn
işleme
ddab111e10
32 değiştirilmiş dosya ile 764 ekleme ve 50 silme
  1. 1 0
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/common/CommonContants.java
  2. 3 4
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/wlyy/WlyyContants.java
  3. 126 0
      svr/svr-wlyy/src/main/java/com/yihu/jw/wlyy/Agreement/controller/WlyyAgreementController.java
  4. 8 8
      svr/svr-wlyy/src/main/java/com/yihu/jw/wlyy/controller/WlyyAgreementKpiController.java
  5. 12 12
      svr/svr-wlyy/src/main/java/com/yihu/jw/wlyy/controller/WlyyAgreementKpiLogController.java
  6. 2 2
      svr/svr-wlyy/src/main/java/com/yihu/jw/wlyy/dao/WlyyAgreementDao.java
  7. 2 3
      svr/svr-wlyy/src/main/java/com/yihu/jw/wlyy/dao/WlyyAgreementKpiDao.java
  8. 2 2
      svr/svr-wlyy/src/main/java/com/yihu/jw/wlyy/dao/WlyyAgreementKpiLogDao.java
  9. 2 2
      svr/svr-wlyy/src/main/java/com/yihu/jw/wlyy/entity/WlyyAgreement.java
  10. 2 2
      svr/svr-wlyy/src/main/java/com/yihu/jw/wlyy/entity/WlyyAgreementKpi.java
  11. 2 2
      svr/svr-wlyy/src/main/java/com/yihu/jw/wlyy/entity/WlyyAgreementKpiLog.java
  12. 1 1
      svr/svr-wlyy/src/main/java/com/yihu/jw/wlyy/entity/base/IdEntity.java
  13. 3 3
      svr/svr-wlyy/src/main/java/com/yihu/jw/wlyy/service/WlyyAgreementKpiLogService.java
  14. 3 3
      svr/svr-wlyy/src/main/java/com/yihu/jw/wlyy/service/WlyyAgreementKpiService.java
  15. 3 3
      svr/svr-wlyy/src/main/java/com/yihu/jw/wlyy/service/WlyyAgreementService.java
  16. 1 3
      web-gateway/src/main/java/com/yihu/jw/controller/base/wx/WechatContants.java
  17. 37 0
      web-gateway/src/main/java/com/yihu/jw/commnon/wlyy/AgreementContants.java
  18. 1 0
      web-gateway/src/main/java/com/yihu/jw/controller/base/wx/WechatAccessTokenController.java
  19. 1 0
      web-gateway/src/main/java/com/yihu/jw/controller/base/wx/WechatController.java
  20. 1 0
      web-gateway/src/main/java/com/yihu/jw/controller/base/wx/WechatGraphicMessageController.java
  21. 1 0
      web-gateway/src/main/java/com/yihu/jw/controller/base/wx/WechatMenuController.java
  22. 1 0
      web-gateway/src/main/java/com/yihu/jw/controller/base/wx/WechatTemplateControlle.java
  23. 113 0
      web-gateway/src/main/java/com/yihu/jw/controller/wlyy/agreement/WlyyAgreementController.java
  24. 93 0
      web-gateway/src/main/java/com/yihu/jw/controller/wlyy/agreement/WlyyAgreementKpiController.java
  25. 75 0
      web-gateway/src/main/java/com/yihu/jw/controller/wlyy/agreement/WlyyAgreementKpiLogController.java
  26. 50 0
      web-gateway/src/main/java/com/yihu/jw/fegin/fallbackfactory/wlyy/agreement/WlyyAgreementFeginFallbackFactory.java
  27. 48 0
      web-gateway/src/main/java/com/yihu/jw/fegin/fallbackfactory/wlyy/agreement/WlyyAgreementKpiFeginFallbackFactory.java
  28. 38 0
      web-gateway/src/main/java/com/yihu/jw/fegin/fallbackfactory/wlyy/agreement/WlyyAgreementKpiLogFeginFallbackFactory.java
  29. 46 0
      web-gateway/src/main/java/com/yihu/jw/fegin/wlyy/agreement/WlyyAgreementFegin.java
  30. 46 0
      web-gateway/src/main/java/com/yihu/jw/fegin/wlyy/agreement/WlyyAgreementKpiFegin.java
  31. 39 0
      web-gateway/src/main/java/com/yihu/jw/fegin/wlyy/agreement/WlyyAgreementKpiLogFegin.java
  32. 1 0
      web-gateway/src/main/resources/application.yml

+ 1 - 0
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/common/CommonContants.java

@ -8,6 +8,7 @@ public class CommonContants {
    //微服务的id start
    public static final String svr_base = "svr-base";
    public static final String svr_wlyy = "svr-wlyy";
    public static final String svr_gateway = "svr-gateway";
    public static final Integer common_error_code= -10000; //系统异常

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

@ -6,7 +6,7 @@ package com.yihu.jw.restmodel.wlyy;
public class WlyyContants {
    //协议模块常量
    public static class Agreement{
        public static final String api_common="agreement";
        public static final String api_common="wlyyAgreement";
        public static final String api_create="create";
        public static final String api_delete="delete";
        public static final String api_getByCode="getByCode";
@ -34,7 +34,7 @@ public class WlyyContants {
    //协议模块常量
    public static class AgreementKpi{
        public static final String api_common="agreementKpi";
        public static final String api_common="wlyyAgreementKpi";
        public static final String api_create="create";
        public static final String api_delete="delete";
        public static final String api_getByCode="getByCode";
@ -63,7 +63,7 @@ public class WlyyContants {
    //协议模块常量
    public static class AgreementKpiLog{
        public static final String api_common="agreementKpiLog";
        public static final String api_common="wlyyAgreementKpiLog";
        public static final String api_create="create";
        public static final String api_delete="delete";
        public static final String api_getByCode="getByCode";
@ -74,7 +74,6 @@ public class WlyyContants {
        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_wlyyAgreementKpi_is_no_exist="wlyyAgreementKpi is no exist";
        public static final String message_success_update="agreementKpiLog update success";
        public static final String message_success_delete="agreementKpiLog delete success";

+ 126 - 0
svr/svr-wlyy/src/main/java/com/yihu/jw/wlyy/Agreement/controller/WlyyAgreementController.java

@ -0,0 +1,126 @@
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.service.WlyyAgreementService;
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.Agreement.api_common)
@Api(value = "协议相关操作", description = "协议相关操作")
public class WlyyAgreementController extends EnvelopRestController {
    @Autowired
    private WlyyAgreementService wlyyAgreementService;
    @PostMapping(value = WlyyContants.Agreement.api_create, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ApiOperation(value = "创建协议", notes = "创建协议")
    public Envelop create(
            @ApiParam(name = "json_data", value = "", defaultValue = "")
            @RequestBody String jsonData) {
        try {
            WlyyAgreement wlyyAgreement = toEntity(jsonData, WlyyAgreement.class);
            return Envelop.getSuccess(WlyyContants.Agreement.message_success_create, wlyyAgreementService.create(wlyyAgreement));
        } catch (ApiException e) {
            return Envelop.getError(e.getMessage(), e.getErrorCode());
        }
    }
    @PutMapping(value = WlyyContants.Agreement.api_update, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ApiOperation(value = "修改协议", notes = "修改协议")
    public Envelop update(
            @ApiParam(name = "json_data", value = "", defaultValue = "")
            @RequestBody String jsonData) {
        try {
            WlyyAgreement wlyyAgreement = toEntity(jsonData, WlyyAgreement.class);
            return Envelop.getSuccess(WlyyContants.Agreement.message_success_update, wlyyAgreementService.update(wlyyAgreement));
        } catch (ApiException e) {
            return Envelop.getError(e.getMessage(), e.getErrorCode());
        }
    }
    @DeleteMapping(value =WlyyContants.Agreement.api_delete)
    @ApiOperation(value = "删除协议", notes = "删除协议")
    public Envelop delete(
            @ApiParam(name = "code", value = "code")
            @RequestParam(value = "code", required = true) String code) {
        try {
            wlyyAgreementService.delete(code);
            return Envelop.getSuccess(WlyyContants.Agreement.message_success_delete );
        } catch (ApiException e) {
            return Envelop.getError(e.getMessage(), e.getErrorCode());
        }
    }
    @GetMapping(value =WlyyContants.Agreement.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.Agreement.message_success_find, wlyyAgreementService.findByCode(code));
        } catch (ApiException e) {
            return Envelop.getError(e.getMessage(), e.getErrorCode());
        }
    }
    @RequestMapping(value =WlyyContants.Agreement.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 = wlyyAgreementService.search(fields, filters, sorts, page, size);
        //获取总数
        long count=wlyyAgreementService.getCount(filters);
        //封装头信息
        pagedResponse(request, response, count, page, size);
        //封装返回格式
        List<WlyyAgreement> wlyyAgreement = convertToModels(list, new ArrayList<>(list.size()), WlyyAgreement.class, fields);
        return Envelop.getSuccessListWithPage(WlyyContants.Agreement.message_success_find_functions,wlyyAgreement, page, size,count);
    }
    @GetMapping(value =WlyyContants.Agreement.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 = wlyyAgreementService.search(fields,filters,sorts);
        //封装返回格式
        List<WlyyAgreement> wlyyAgreement = convertToModels(list, new ArrayList<>(list.size()), WlyyAgreement.class, fields);
        return Envelop.getSuccessList(WlyyContants.Agreement.message_success_find_functions,wlyyAgreement);
    }
}

+ 8 - 8
svr/svr-wlyy/src/main/java/com/yihu/jw/wlyy/controller/WlyyAgreementKpiController.java

@ -1,11 +1,11 @@
package com.yihu.jw.wlyy.controller;
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.entity.WlyyAgreementKpi;
import com.yihu.jw.wlyy.service.WlyyAgreementKpiService;
import com.yihu.jw.wlyy.Agreement.entity.WlyyAgreementKpi;
import com.yihu.jw.wlyy.Agreement.service.WlyyAgreementKpiService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
@ -82,11 +82,11 @@ public class WlyyAgreementKpiController extends EnvelopRestController {
    @RequestMapping(value =WlyyContants.AgreementKpi.api_queryPage, method = RequestMethod.GET)
    @ApiOperation(value = "分页获取套餐指标")
    public Envelop queryPage(
            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段", defaultValue = "id,code,name,saasId,appId,appSecret,baseUrl,remark")
            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段", defaultValue = "id,code,agreementCode,kpiName,type,kpiTimes,status,del,kpiContent,keyword")
            @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")
            @ApiParam(name = "sorts", value = "排序,规则参见说明文档", defaultValue = "+kpiName,+createTime")
            @RequestParam(value = "sorts", required = false) String sorts,
            @ApiParam(name = "size", value = "分页大小", defaultValue = "15")
            @RequestParam(value = "size", required = false) int size,
@ -108,13 +108,13 @@ public class WlyyAgreementKpiController extends EnvelopRestController {
    @GetMapping(value =WlyyContants.AgreementKpi.api_getList)
    @ApiOperation(value = "获取协议列表(不分页)")
    @ApiOperation(value = "获取套餐指标列表(不分页)")
    public Envelop getList(
            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段", defaultValue = "id,code,name,saasId,appId,appSecret,baseUrl,remark")
            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段", defaultValue = "id,code,agreementCode,kpiName,type,kpiTimes,status,del,kpiContent,keyword")
            @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")
            @ApiParam(name = "sorts", value = "排序,规则参见说明文档", defaultValue = "+kpiName,+createTime")
            @RequestParam(value = "sorts", required = false) String sorts) throws Exception {
        //得到list数据
        List<WlyyAgreementKpi> list = wlyyAgreementKpiService.search(fields,filters,sorts);

+ 12 - 12
svr/svr-wlyy/src/main/java/com/yihu/jw/wlyy/controller/WlyyAgreementKpiLogController.java

@ -1,11 +1,11 @@
package com.yihu.jw.wlyy.controller;
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.entity.WlyyAgreementKpiLog;
import com.yihu.jw.wlyy.service.WlyyAgreementKpiLogService;
import com.yihu.jw.wlyy.Agreement.entity.WlyyAgreementKpiLog;
import com.yihu.jw.wlyy.Agreement.service.WlyyAgreementKpiLogService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
@ -20,14 +20,14 @@ import java.util.List;
@RestController
@RequestMapping(WlyyContants.AgreementKpiLog.api_common)
@Api(value = "套餐指标相关操作", description = "套餐指标相关操作")
@Api(value = "套餐指标执行日志相关操作", description = "套餐指标执行日志相关操作")
public class WlyyAgreementKpiLogController extends EnvelopRestController {
    @Autowired
    private WlyyAgreementKpiLogService wlyyAgreementKpiLogService;
    @PostMapping(value = WlyyContants.AgreementKpiLog.api_create, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ApiOperation(value = "创建套餐指标", notes = "创建套餐指标")
    @ApiOperation(value = "创建套餐指标日志", notes = "创建套餐指标日志")
    public Envelop create(
            @ApiParam(name = "json_data", value = "", defaultValue = "")
            @RequestBody String jsonData) {
@ -40,7 +40,7 @@ public class WlyyAgreementKpiLogController extends EnvelopRestController {
    }
    @GetMapping(value =WlyyContants.AgreementKpiLog.api_getByCode)
    @ApiOperation(value = "根据code查找套餐指标", notes = "根据code查找套餐指标")
    @ApiOperation(value = "根据code查找套餐指标日志", notes = "根据code查找套餐指标日志")
    public Envelop findByCode(
            @ApiParam(name = "code", value = "code")
            @RequestParam(value = "code", required = true) String code
@ -53,13 +53,13 @@ public class WlyyAgreementKpiLogController extends EnvelopRestController {
    }
    @RequestMapping(value =WlyyContants.AgreementKpiLog.api_queryPage, method = RequestMethod.GET)
    @ApiOperation(value = "分页获取套餐指标")
    @ApiOperation(value = "分页获取套餐指标日志")
    public Envelop queryPage(
            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段", defaultValue = "id,code,name,saasId,appId,appSecret,baseUrl,remark")
            @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 = "+name,+createTime")
            @ApiParam(name = "sorts", value = "排序,规则参见说明文档", defaultValue = "+kpiName,+createTime")
            @RequestParam(value = "sorts", required = false) String sorts,
            @ApiParam(name = "size", value = "分页大小", defaultValue = "15")
            @RequestParam(value = "size", required = false) int size,
@ -81,13 +81,13 @@ public class WlyyAgreementKpiLogController extends EnvelopRestController {
    @GetMapping(value =WlyyContants.AgreementKpiLog.api_getList)
    @ApiOperation(value = "获取协议列表(不分页)")
    @ApiOperation(value = "获取套餐指标日志列表(不分页)")
    public Envelop getList(
            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段", defaultValue = "id,code,name,saasId,appId,appSecret,baseUrl,remark")
            @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 = "+name,+createTime")
            @ApiParam(name = "sorts", value = "排序,规则参见说明文档", defaultValue = "+kpiName,+createTime")
            @RequestParam(value = "sorts", required = false) String sorts) throws Exception {
        //得到list数据
        List<WlyyAgreementKpiLog> list = wlyyAgreementKpiLogService.search(fields,filters,sorts);

+ 2 - 2
svr/svr-wlyy/src/main/java/com/yihu/jw/wlyy/dao/WlyyAgreementDao.java

@ -1,6 +1,6 @@
package com.yihu.jw.wlyy.dao;
package com.yihu.jw.wlyy.Agreement.dao;
import com.yihu.jw.wlyy.entity.WlyyAgreement;
import com.yihu.jw.wlyy.Agreement.entity.WlyyAgreement;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;

+ 2 - 3
svr/svr-wlyy/src/main/java/com/yihu/jw/wlyy/dao/WlyyAgreementKpiDao.java

@ -1,7 +1,6 @@
package com.yihu.jw.wlyy.dao;
package com.yihu.jw.wlyy.Agreement.dao;
import com.yihu.jw.wlyy.entity.WlyyAgreement;
import com.yihu.jw.wlyy.entity.WlyyAgreementKpi;
import com.yihu.jw.wlyy.Agreement.entity.WlyyAgreementKpi;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;

+ 2 - 2
svr/svr-wlyy/src/main/java/com/yihu/jw/wlyy/dao/WlyyAgreementKpiLogDao.java

@ -1,6 +1,6 @@
package com.yihu.jw.wlyy.dao;
package com.yihu.jw.wlyy.Agreement.dao;
import com.yihu.jw.wlyy.entity.WlyyAgreementKpiLog;
import com.yihu.jw.wlyy.Agreement.entity.WlyyAgreementKpiLog;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;

+ 2 - 2
svr/svr-wlyy/src/main/java/com/yihu/jw/wlyy/entity/WlyyAgreement.java

@ -1,7 +1,7 @@
package com.yihu.jw.wlyy.entity;
package com.yihu.jw.wlyy.Agreement.entity;
import com.yihu.jw.wlyy.entity.base.IdEntity;
import com.yihu.jw.wlyy.Agreement.entity.base.IdEntity;
import javax.persistence.Column;
import javax.persistence.Entity;

+ 2 - 2
svr/svr-wlyy/src/main/java/com/yihu/jw/wlyy/entity/WlyyAgreementKpi.java

@ -1,7 +1,7 @@
package com.yihu.jw.wlyy.entity;
package com.yihu.jw.wlyy.Agreement.entity;
import com.yihu.jw.wlyy.entity.base.IdEntity;
import com.yihu.jw.wlyy.Agreement.entity.base.IdEntity;
import javax.persistence.Column;
import javax.persistence.Entity;

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

@ -1,7 +1,7 @@
package com.yihu.jw.wlyy.entity;
package com.yihu.jw.wlyy.Agreement.entity;
import com.yihu.jw.wlyy.entity.base.IdEntity;
import com.yihu.jw.wlyy.Agreement.entity.base.IdEntity;
import javax.persistence.Column;
import javax.persistence.Entity;

+ 1 - 1
svr/svr-wlyy/src/main/java/com/yihu/jw/wlyy/entity/base/IdEntity.java

@ -3,7 +3,7 @@
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 *******************************************************************************/
package com.yihu.jw.wlyy.entity.base;
package com.yihu.jw.wlyy.Agreement.entity.base;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;

+ 3 - 3
svr/svr-wlyy/src/main/java/com/yihu/jw/wlyy/service/WlyyAgreementKpiLogService.java

@ -1,11 +1,11 @@
package com.yihu.jw.wlyy.service;
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.dao.WlyyAgreementKpiLogDao;
import com.yihu.jw.wlyy.entity.WlyyAgreementKpiLog;
import com.yihu.jw.wlyy.Agreement.dao.WlyyAgreementKpiLogDao;
import com.yihu.jw.wlyy.Agreement.entity.WlyyAgreementKpiLog;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;

+ 3 - 3
svr/svr-wlyy/src/main/java/com/yihu/jw/wlyy/service/WlyyAgreementKpiService.java

@ -1,11 +1,11 @@
package com.yihu.jw.wlyy.service;
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.dao.WlyyAgreementKpiDao;
import com.yihu.jw.wlyy.entity.WlyyAgreementKpi;
import com.yihu.jw.wlyy.Agreement.dao.WlyyAgreementKpiDao;
import com.yihu.jw.wlyy.Agreement.entity.WlyyAgreementKpi;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;

+ 3 - 3
svr/svr-wlyy/src/main/java/com/yihu/jw/wlyy/service/WlyyAgreementService.java

@ -1,11 +1,11 @@
package com.yihu.jw.wlyy.service;
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.dao.WlyyAgreementDao;
import com.yihu.jw.wlyy.entity.WlyyAgreement;
import com.yihu.jw.wlyy.Agreement.dao.WlyyAgreementDao;
import com.yihu.jw.wlyy.Agreement.entity.WlyyAgreement;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;

+ 1 - 3
web-gateway/src/main/java/com/yihu/jw/controller/base/wx/WechatContants.java

@ -1,4 +1,4 @@
package com.yihu.jw.controller.base.wx;
package com.yihu.jw.commnon.base.wx;
/**
 * Created by Administrator on 2017/5/20 0020.
@ -6,8 +6,6 @@ package com.yihu.jw.controller.base.wx;
public class WechatContants {
    //微信token模块常量
    public static class AccessToken{
        public static final String message_success_get="wxAccessToken get success";
        public static final String api_common="accessToken";
        public static final String api_create="create";
        public static final String api_get="get";

+ 37 - 0
web-gateway/src/main/java/com/yihu/jw/commnon/wlyy/AgreementContants.java

@ -0,0 +1,37 @@
package com.yihu.jw.commnon.wlyy;
/**
 * Created by Administrator on 2017/6/2 0002.
 */
public class AgreementContants {
    //协议常量
    public static class Agreement{
        public static final String api_common="agreement";
        public static final String api_create="create";
        public static final String api_update="update";
        public static final String api_delete="delete";
        public static final String api_getByCode="getByCode";
        public static final String api_queryPage="queryPage";
        public static final String api_getList="getList";
    }
    public static class AgreementKpi {
        public static final String api_common="agreementKpi";
        public static final String api_create="create";
        public static final String api_update="update";
        public static final String api_delete="delete";
        public static final String api_getByCode="getByCode";
        public static final String api_queryPage="queryPage";
        public static final String api_getList="getList";
    }
    public static class AgreementKpiLog {
        public static final String api_common="agreementKpiLog";
        public static final String api_create="create";
        public static final String api_getByCode="getByCode";
        public static final String api_queryPage="queryPage";
        public static final String api_getList="getList";
    }
}

+ 1 - 0
web-gateway/src/main/java/com/yihu/jw/controller/base/wx/WechatAccessTokenController.java

@ -2,6 +2,7 @@ package com.yihu.jw.controller.base.wx;
import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;
import com.netflix.hystrix.contrib.javanica.annotation.HystrixProperty;
import com.yihu.jw.commnon.base.wx.WechatContants;
import com.yihu.jw.fegin.base.wx.AccessTokenFegin;
import com.yihu.jw.restmodel.common.Envelop;
import io.swagger.annotations.Api;

+ 1 - 0
web-gateway/src/main/java/com/yihu/jw/controller/base/wx/WechatController.java

@ -2,6 +2,7 @@ package com.yihu.jw.controller.base.wx;
import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;
import com.netflix.hystrix.contrib.javanica.annotation.HystrixProperty;
import com.yihu.jw.commnon.base.wx.WechatContants;
import com.yihu.jw.fegin.base.wx.WechatFegin;
import com.yihu.jw.restmodel.common.Envelop;
import io.swagger.annotations.Api;

+ 1 - 0
web-gateway/src/main/java/com/yihu/jw/controller/base/wx/WechatGraphicMessageController.java

@ -2,6 +2,7 @@ package com.yihu.jw.controller.base.wx;
import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;
import com.netflix.hystrix.contrib.javanica.annotation.HystrixProperty;
import com.yihu.jw.commnon.base.wx.WechatContants;
import com.yihu.jw.fegin.base.wx.GraphicMessageFegin;
import com.yihu.jw.restmodel.common.Envelop;
import io.swagger.annotations.Api;

+ 1 - 0
web-gateway/src/main/java/com/yihu/jw/controller/base/wx/WechatMenuController.java

@ -2,6 +2,7 @@ package com.yihu.jw.controller.base.wx;
import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;
import com.netflix.hystrix.contrib.javanica.annotation.HystrixProperty;
import com.yihu.jw.commnon.base.wx.WechatContants;
import com.yihu.jw.fegin.base.wx.WechatMenuFegin;
import com.yihu.jw.restmodel.common.Envelop;
import io.swagger.annotations.Api;

+ 1 - 0
web-gateway/src/main/java/com/yihu/jw/controller/base/wx/WechatTemplateControlle.java

@ -2,6 +2,7 @@ package com.yihu.jw.controller.base.wx;
import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;
import com.netflix.hystrix.contrib.javanica.annotation.HystrixProperty;
import com.yihu.jw.commnon.base.wx.WechatContants;
import com.yihu.jw.fegin.base.wx.WechatTemplateFegin;
import com.yihu.jw.restmodel.common.Envelop;
import io.swagger.annotations.Api;

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

@ -0,0 +1,113 @@
package com.yihu.jw.controller.wlyy.agreement;
import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;
import com.netflix.hystrix.contrib.javanica.annotation.HystrixProperty;
import com.yihu.jw.commnon.wlyy.AgreementContants;
import com.yihu.jw.fegin.wlyy.agreement.WlyyAgreementFegin;
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.http.MediaType;
import org.springframework.web.bind.annotation.*;
@RestController
@RequestMapping(AgreementContants.Agreement.api_common)
@Api(value = "协议相关操作", description = "协议相关操作")
public class WlyyAgreementController extends EnvelopRestController {
    private Logger logger = LoggerFactory.getLogger(WlyyAgreementController.class);
    @Autowired
    private WlyyAgreementFegin wlyyAgreementFegin;
    @Autowired
    private Tracer tracer;
    @PostMapping(value = AgreementContants.Agreement.api_create, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ApiOperation(value = "创建协议", notes = "创建协议")
    @HystrixCommand(commandProperties = {
            @HystrixProperty(name = "execution.isolation.thread.timeoutInMilliseconds", value = "-1"),//超时时间
            @HystrixProperty(name = "execution.timeout.enabled", value = "false") })
    public Envelop create(
            @ApiParam(name = "json_data", value = "", defaultValue = "")
            @RequestBody String jsonData) {
        return wlyyAgreementFegin.create(jsonData);
    }
    @PutMapping(value = AgreementContants.Agreement.api_update, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ApiOperation(value = "修改协议", notes = "修改协议")
    @HystrixCommand(commandProperties = {
            @HystrixProperty(name = "execution.isolation.thread.timeoutInMilliseconds", value = "-1"),//超时时间
            @HystrixProperty(name = "execution.timeout.enabled", value = "false") })
    public Envelop update(
            @ApiParam(name = "json_data", value = "", defaultValue = "")
            @RequestBody String jsonData) {
        return wlyyAgreementFegin.update(jsonData);
    }
    @DeleteMapping(value =AgreementContants.Agreement.api_delete)
    @ApiOperation(value = "删除协议", notes = "删除协议")
    @HystrixCommand(commandProperties = {
            @HystrixProperty(name = "execution.isolation.thread.timeoutInMilliseconds", value = "-1"),//超时时间
            @HystrixProperty(name = "execution.timeout.enabled", value = "false") })
    public Envelop delete(
            @ApiParam(name = "code", value = "code")
            @RequestParam(value = "code", required = true) String code) {
        return wlyyAgreementFegin.delete(code);
    }
    @GetMapping(value =AgreementContants.Agreement.api_getByCode)
    @ApiOperation(value = "根据code查找协议", notes = "根据code查找协议")
    @HystrixCommand(commandProperties = {
            @HystrixProperty(name = "execution.isolation.thread.timeoutInMilliseconds", value = "-1"),//超时时间
            @HystrixProperty(name = "execution.timeout.enabled", value = "false") })
    public Envelop findByCode(
            @ApiParam(name = "code", value = "code")
            @RequestParam(value = "code", required = true) String code
    ) {
        return wlyyAgreementFegin.findByCode(code);
    }
    //@RequestMapping(value =AgreementContants.Agreement.api_queryPage, method = RequestMethod.GET)
    //@ApiOperation(value = "分页获取协议")
    //@HystrixCommand(commandProperties = {
    //        @HystrixProperty(name = "execution.isolation.thread.timeoutInMilliseconds", value = "-1"),//超时时间
    //        @HystrixProperty(name = "execution.timeout.enabled", value = "false") })
    //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 wlyyAgreementFegin.queryPage(fields,filters,sorts,size,page,request,response);
    //}
    @GetMapping(value =AgreementContants.Agreement.api_getList)
    @ApiOperation(value = "获取协议列表(不分页)")
    @HystrixCommand(commandProperties = {
            @HystrixProperty(name = "execution.isolation.thread.timeoutInMilliseconds", value = "-1"),//超时时间
            @HystrixProperty(name = "execution.timeout.enabled", value = "false") })
    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 wlyyAgreementFegin.getList(fields,filters,sorts);
    }
}

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

@ -0,0 +1,93 @@
package com.yihu.jw.controller.wlyy.agreement;
import com.yihu.jw.commnon.wlyy.AgreementContants;
import com.yihu.jw.fegin.wlyy.agreement.WlyyAgreementKpiFegin;
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.http.MediaType;
import org.springframework.web.bind.annotation.*;
@RestController
@RequestMapping(AgreementContants.AgreementKpi.api_common)
@Api(value = "套餐指标相关操作", description = "套餐指标相关操作")
public class WlyyAgreementKpiController extends EnvelopRestController {
    private Logger logger= LoggerFactory.getLogger(WlyyAgreementKpiController.class);
    @Autowired
    private WlyyAgreementKpiFegin wlyyAgreementKpiFegin;
    @Autowired
    private Tracer tracer;
    @PostMapping(value = AgreementContants.AgreementKpi.api_create, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ApiOperation(value = "创建套餐指标", notes = "创建套餐指标")
    public Envelop create(
            @ApiParam(name = "json_data", value = "", defaultValue = "")
            @RequestBody String jsonData) {
        return wlyyAgreementKpiFegin.create(jsonData);
    }
    @PutMapping(value = AgreementContants.AgreementKpi.api_update, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ApiOperation(value = "修改套餐指标", notes = "修改套餐指标")
    public Envelop update(
            @ApiParam(name = "json_data", value = "", defaultValue = "")
            @RequestBody String jsonData) {
        return wlyyAgreementKpiFegin.update(jsonData);
    }
    @DeleteMapping(value =AgreementContants.AgreementKpi.api_delete)
    @ApiOperation(value = "删除套餐指标", notes = "删除套餐指标")
    public Envelop delete(
            @ApiParam(name = "code", value = "code")
            @RequestParam(value = "code", required = true) String code) {
        return wlyyAgreementKpiFegin.delete(code);
    }
    @GetMapping(value =AgreementContants.AgreementKpi.api_getByCode)
    @ApiOperation(value = "根据code查找套餐指标", notes = "根据code查找套餐指标")
    public Envelop findByCode(
            @ApiParam(name = "code", value = "code")
            @RequestParam(value = "code", required = true) String code
    ) {
        return wlyyAgreementKpiFegin.findByCode(code);
    }
    //@RequestMapping(value =AgreementContants.AgreementKpi.api_queryPage, method = RequestMethod.GET)
    //@ApiOperation(value = "分页获取套餐指标")
    //public Envelop queryPage(
    //        @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段", defaultValue = "id,code,agreementCode,kpiName,type,kpiTimes,status,del,kpiContent,keyword")
    //        @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,
    //        @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 wlyyAgreementKpiFegin.queryPage(fields, filters, sorts, size, page, request, response);
    //}
    @GetMapping(value =AgreementContants.AgreementKpi.api_getList)
    @ApiOperation(value = "获取套餐指标列表(不分页)")
    public Envelop getList(
            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段", defaultValue = "id,code,agreementCode,kpiName,type,kpiTimes,status,del,kpiContent,keyword")
            @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 wlyyAgreementKpiFegin.getList(fields, filters, sorts);
    }
}

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

@ -0,0 +1,75 @@
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.EnvelopRestController;
import io.swagger.annotations.Api;
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;
@RestController
@RequestMapping(AgreementContants.AgreementKpiLog.api_common)
@Api(value = "套餐指标执行日志相关操作", description = "套餐指标执行日志相关操作")
public class WlyyAgreementKpiLogController extends EnvelopRestController {
    private Logger logger= LoggerFactory.getLogger(WlyyAgreementKpiLogController.class);
    @Autowired
    private WlyyAgreementKpiLogFegin wlyyAgreementKpiLogFegin;
    @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);
    //}
    //@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 = "分页获取套餐指标日志")
    //public Envelop queryPage(
    //        @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,
    //        @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 wlyyAgreementKpiLogFegin.queryPage(fields, filters, sorts, size, page, request, response);
    //}
    //@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);
    //}
}

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

@ -0,0 +1,50 @@
package com.yihu.jw.fegin.fallbackfactory.wlyy.agreement;
import com.yihu.jw.fegin.wlyy.agreement.WlyyAgreementFegin;
import com.yihu.jw.restmodel.common.Envelop;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
/**
 * Created by Administrator on 2017/6/2 0002.
 */
@Component
public class WlyyAgreementFeginFallbackFactory implements FallbackFactory<WlyyAgreementFegin> {
    @Override
    public WlyyAgreementFegin create(Throwable throwable) {
        return new WlyyAgreementFegin() {
            @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;
            }
        };
    }
}

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

@ -0,0 +1,48 @@
package com.yihu.jw.fegin.fallbackfactory.wlyy.agreement;
import com.yihu.jw.fegin.wlyy.agreement.WlyyAgreementKpiFegin;
import com.yihu.jw.restmodel.common.Envelop;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;
/**
 * Created by Administrator on 2017/6/2 0002.
 */
@Component
public class WlyyAgreementKpiFeginFallbackFactory implements FallbackFactory<WlyyAgreementKpiFegin> {
    @Override
    public WlyyAgreementKpiFegin create(Throwable throwable) {
        return new WlyyAgreementKpiFegin() {
            @Override
            public Envelop create(String jsonData) {
                return null;
            }
            @Override
            public Envelop update(String jsonData) {
                return null;
            }
            @Override
            public Envelop delete(String code) {
                return null;
            }
            @Override
            public Envelop findByCode(String code) {
                return null;
            }
            //@Override
            //public Envelop queryPage(String fields, String filters, String sorts, int size, int page, HttpServletRequest request, HttpServletResponse response) {
            //    return null;
            //}
            @Override
            public Envelop getList(String fields, String filters, String sorts) {
                return null;
            }
        };
    }
}

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

@ -0,0 +1,38 @@
package com.yihu.jw.fegin.fallbackfactory.wlyy.agreement;
import com.yihu.jw.fegin.wlyy.agreement.WlyyAgreementKpiLogFegin;
import com.yihu.jw.restmodel.common.Envelop;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;
/**
 * Created by Administrator on 2017/6/2 0002.
 */
@Component
public class WlyyAgreementKpiLogFeginFallbackFactory implements FallbackFactory<WlyyAgreementKpiLogFegin> {
    @Override
    public WlyyAgreementKpiLogFegin create(Throwable throwable) {
        return new WlyyAgreementKpiLogFegin() {
            @Override
            public Envelop create(String jsonData) {
                return null;
            }
            @Override
            public Envelop findByCode(String code) {
                return null;
            }
            //@Override
            //public Envelop queryPage(String fields, String filters, String sorts, int size, int page, HttpServletRequest request, HttpServletResponse response) {
            //    return null;
            //}
            @Override
            public Envelop getList(String fields, String filters, String sorts) {
                return null;
            }
        };
    }
}

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

@ -0,0 +1,46 @@
package com.yihu.jw.fegin.wlyy.agreement;
import com.yihu.jw.fegin.fallbackfactory.wlyy.agreement.WlyyAgreementFeginFallbackFactory;
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.*;
@FeignClient(
        name = CommonContants.svr_wlyy // name值是eurika的实例名字
        ,fallbackFactory  = WlyyAgreementFeginFallbackFactory.class
)
@RequestMapping(WlyyContants.Agreement.api_common)
public interface WlyyAgreementFegin {
    @PostMapping(value = WlyyContants.Agreement.api_create, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    Envelop create(@RequestBody String jsonData);
    @PutMapping(value = WlyyContants.Agreement.api_update, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    Envelop update(@RequestBody String jsonData);
    @DeleteMapping(value =WlyyContants.Agreement.api_delete)
    Envelop delete( @RequestParam(value = "code") String code);
    @GetMapping(value =WlyyContants.Agreement.api_getByCode)
    Envelop findByCode( @RequestParam(value = "code" ) String code);
    //@RequestMapping(value =WlyyContants.Agreement.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.Agreement.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);
}

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

@ -0,0 +1,46 @@
package com.yihu.jw.fegin.wlyy.agreement;
import com.yihu.jw.fegin.fallbackfactory.wlyy.agreement.WlyyAgreementKpiFeginFallbackFactory;
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.*;
@FeignClient(
        name = CommonContants.svr_wlyy // name值是eurika的实例名字
        ,fallbackFactory  = WlyyAgreementKpiFeginFallbackFactory.class
)
@RequestMapping(WlyyContants.AgreementKpi.api_common)
public interface WlyyAgreementKpiFegin {
    @PostMapping(value = WlyyContants.AgreementKpi.api_create, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    Envelop create(@RequestBody String jsonData);
    @PutMapping(value = WlyyContants.AgreementKpi.api_update, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    Envelop update(@RequestBody String jsonData);
    @DeleteMapping(value =WlyyContants.AgreementKpi.api_delete)
    Envelop delete(@RequestParam(value = "code" ) String code);
    @GetMapping(value =WlyyContants.AgreementKpi.api_getByCode)
    Envelop findByCode(@RequestParam(value = "code" ) String code);
    //@RequestMapping(value =WlyyContants.AgreementKpi.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.AgreementKpi.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);
}

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

@ -0,0 +1,39 @@
package com.yihu.jw.fegin.wlyy.agreement;
import com.yihu.jw.fegin.fallbackfactory.wlyy.agreement.WlyyAgreementKpiLogFeginFallbackFactory;
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.web.bind.annotation.*;
@FeignClient(
        name = CommonContants.svr_wlyy // name值是eurika的实例名字
        ,fallbackFactory  = WlyyAgreementKpiLogFeginFallbackFactory.class
)
@RequestMapping(WlyyContants.AgreementKpiLog.api_common)
public interface WlyyAgreementKpiLogFegin {
    @PostMapping(value = WlyyContants.AgreementKpiLog.api_create)
    Envelop create(@RequestBody String jsonData);
    @GetMapping(value =WlyyContants.AgreementKpiLog.api_getByCode)
    Envelop findByCode(@RequestParam(value = "code")String code);
    //@RequestMapping(value =WlyyContants.AgreementKpiLog.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.AgreementKpiLog.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);
}

+ 1 - 0
web-gateway/src/main/resources/application.yml

@ -20,6 +20,7 @@ zuul:
  ignored-services: '*'  ##忽略全部的代理  忽略单个微服务   ignored-services: svr-base 多个逗号分割
  routes:
    svr-base: /base/**  ##svr-base方向代理到/base下多层级的路径
    svr-wlyy: /wlyy/**
#    svr-base:    这种方式和  svr-base: /base/**  一样  svr-base可以随便写 唯一即可
#      path: /base/**  path是代理后的路径
#      serviceId: svr-base  serviceId是微服务name