Browse Source

Merge branch 'dev' of chenyongxing/jw2.0 into dev

chenweida 7 years ago
parent
commit
adfe596583
59 changed files with 2066 additions and 200 deletions
  1. 1 0
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/common/CommonContants.java
  2. 33 2
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/wlyy/WlyyContants.java
  3. 1 0
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/wx/WxContants.java
  4. 1 0
      common/common-swagger/src/main/java/com/yihu/jw/config/SwaggerConfig.java
  5. 1 1
      svr/svr-base/src/main/java/com/yihu/jw/wx/controller/WxGraphicMessageController.java
  6. 4 0
      svr/svr-base/src/main/java/com/yihu/jw/wx/dao/WechatDao.java
  7. 3 3
      svr/svr-base/src/main/java/com/yihu/jw/wx/dao/WxGraphicMessageDao.java
  8. 4 0
      svr/svr-base/src/main/java/com/yihu/jw/wx/dao/WxMenuDao.java
  9. 4 0
      svr/svr-base/src/main/java/com/yihu/jw/wx/dao/WxTemplateDao.java
  10. 19 1
      svr/svr-base/src/main/java/com/yihu/jw/wx/service/WechatService.java
  11. 22 5
      svr/svr-base/src/main/java/com/yihu/jw/wx/service/WxGraphicMessageService.java
  12. 14 1
      svr/svr-base/src/main/java/com/yihu/jw/wx/service/WxMenuService.java
  13. 17 5
      svr/svr-base/src/main/java/com/yihu/jw/wx/service/WxTemplateService.java
  14. 219 0
      svr/svr-wlyy/src/main/java/com/yihu/jw/util/IDCard.java
  15. 5 5
      svr/svr-wlyy/src/main/java/com/yihu/jw/wlyy/controller/WlyyAgreementController.java
  16. 8 8
      svr/svr-wlyy/src/main/java/com/yihu/jw/wlyy/controller/WlyyAgreementKpiController.java
  17. 12 12
      svr/svr-wlyy/src/main/java/com/yihu/jw/wlyy/controller/WlyyAgreementKpiLogController.java
  18. 113 0
      svr/svr-wlyy/src/main/java/com/yihu/jw/wlyy/Agreement/controller/WlyySignFamilyController.java
  19. 2 2
      svr/svr-wlyy/src/main/java/com/yihu/jw/wlyy/dao/WlyyAgreementDao.java
  20. 2 3
      svr/svr-wlyy/src/main/java/com/yihu/jw/wlyy/dao/WlyyAgreementKpiDao.java
  21. 2 2
      svr/svr-wlyy/src/main/java/com/yihu/jw/wlyy/dao/WlyyAgreementKpiLogDao.java
  22. 15 0
      svr/svr-wlyy/src/main/java/com/yihu/jw/wlyy/Agreement/dao/WlyySignFamilyDao.java
  23. 15 11
      svr/svr-wlyy/src/main/java/com/yihu/jw/wlyy/entity/WlyyAgreement.java
  24. 10 20
      svr/svr-wlyy/src/main/java/com/yihu/jw/wlyy/entity/WlyyAgreementKpi.java
  25. 9 6
      svr/svr-wlyy/src/main/java/com/yihu/jw/wlyy/entity/WlyyAgreementKpiLog.java
  26. 515 0
      svr/svr-wlyy/src/main/java/com/yihu/jw/wlyy/Agreement/entity/WlyySignFamily.java
  27. 1 1
      svr/svr-wlyy/src/main/java/com/yihu/jw/wlyy/entity/base/IdEntity.java
  28. 7 3
      svr/svr-wlyy/src/main/java/com/yihu/jw/wlyy/service/WlyyAgreementKpiLogService.java
  29. 35 3
      svr/svr-wlyy/src/main/java/com/yihu/jw/wlyy/service/WlyyAgreementKpiService.java
  30. 14 4
      svr/svr-wlyy/src/main/java/com/yihu/jw/wlyy/service/WlyyAgreementService.java
  31. 99 0
      svr/svr-wlyy/src/main/java/com/yihu/jw/wlyy/Agreement/service/WlyySignFamilyService.java
  32. 1 3
      web-gateway/src/main/java/com/yihu/jw/controller/base/wx/WechatContants.java
  33. 49 0
      web-gateway/src/main/java/com/yihu/jw/commnon/wlyy/AgreementContants.java
  34. 1 0
      web-gateway/src/main/java/com/yihu/jw/controller/base/wx/WechatAccessTokenController.java
  35. 2 6
      web-gateway/src/main/java/com/yihu/jw/controller/base/wx/WechatController.java
  36. 21 17
      web-gateway/src/main/java/com/yihu/jw/controller/base/wx/WechatGraphicMessageController.java
  37. 16 17
      web-gateway/src/main/java/com/yihu/jw/controller/base/wx/WechatMenuController.java
  38. 16 17
      web-gateway/src/main/java/com/yihu/jw/controller/base/wx/WechatTemplateControlle.java
  39. 113 0
      web-gateway/src/main/java/com/yihu/jw/controller/wlyy/agreement/WlyyAgreementController.java
  40. 91 0
      web-gateway/src/main/java/com/yihu/jw/controller/wlyy/agreement/WlyyAgreementKpiController.java
  41. 78 0
      web-gateway/src/main/java/com/yihu/jw/controller/wlyy/agreement/WlyyAgreementKpiLogController.java
  42. 86 0
      web-gateway/src/main/java/com/yihu/jw/controller/wlyy/agreement/WlyySignFamilyController.java
  43. 7 9
      web-gateway/src/main/java/com/yihu/jw/fegin/base/wx/GraphicMessageFegin.java
  44. 2 2
      web-gateway/src/main/java/com/yihu/jw/fegin/base/wx/WechatFegin.java
  45. 7 9
      web-gateway/src/main/java/com/yihu/jw/fegin/base/wx/WechatMenuFegin.java
  46. 7 9
      web-gateway/src/main/java/com/yihu/jw/fegin/base/wx/WechatTemplateFegin.java
  47. 4 4
      web-gateway/src/main/java/com/yihu/jw/fegin/fallbackfactory/base/wx/GraphicMessageFeginFallbackFactory.java
  48. 1 1
      web-gateway/src/main/java/com/yihu/jw/fegin/fallbackfactory/base/wx/WechatFeginFallbackFactory.java
  49. 5 4
      web-gateway/src/main/java/com/yihu/jw/fegin/fallbackfactory/base/wx/WechatMenuFeginFallbackFactory.java
  50. 4 4
      web-gateway/src/main/java/com/yihu/jw/fegin/fallbackfactory/base/wx/WechatTemplateFeginFallbackFactory.java
  51. 50 0
      web-gateway/src/main/java/com/yihu/jw/fegin/fallbackfactory/wlyy/agreement/WlyyAgreementFeginFallbackFactory.java
  52. 48 0
      web-gateway/src/main/java/com/yihu/jw/fegin/fallbackfactory/wlyy/agreement/WlyyAgreementKpiFeginFallbackFactory.java
  53. 38 0
      web-gateway/src/main/java/com/yihu/jw/fegin/fallbackfactory/wlyy/agreement/WlyyAgreementKpiLogFeginFallbackFactory.java
  54. 45 0
      web-gateway/src/main/java/com/yihu/jw/fegin/fallbackfactory/wlyy/agreement/WlyySignFamilyFeginFallbackFactory.java
  55. 44 0
      web-gateway/src/main/java/com/yihu/jw/fegin/wlyy/agreement/WlyyAgreementFegin.java
  56. 44 0
      web-gateway/src/main/java/com/yihu/jw/fegin/wlyy/agreement/WlyyAgreementKpiFegin.java
  57. 37 0
      web-gateway/src/main/java/com/yihu/jw/fegin/wlyy/agreement/WlyyAgreementKpiLogFegin.java
  58. 41 0
      web-gateway/src/main/java/com/yihu/jw/fegin/wlyy/agreement/WlyySignFamilyFegin.java
  59. 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; //系统异常

+ 33 - 2
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";
    }
    //协议模块常量
@ -53,6 +52,7 @@ public class WlyyContants {
        public static final String message_fail_signCode_is_null="signCode is null";
        public static final String message_fail_kpiCode_is_null="kpiCode is null";
        public static final String message_fail_agreementCode_is_null="agreementCode is null";
        public static final String message_fail_agreement_is_null="agreement is null";
        public static final String message_success_update="agreementKpi update success";
        public static final String message_success_delete="agreementKpi delete success";
@ -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";
@ -82,4 +81,36 @@ 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 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_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="signFamily update success";
        public static final String message_success_delete="signFamily delete success";
        public static final String message_success_find="signFamily find success";
        public static final String message_success_create="signFamily create success";
        public static final String message_success_find_functions="signFamily find success";
    }
}

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

@ -126,5 +126,6 @@ public class WxContants {
        public static final String message_fail_code_exist="code exist";
        public static final String message_fail_status_is_null="status is null";
        public static final String message_fail_title_is_null="title is null";
        public static final String message_fail_wxGraphicMessage_is_no_exist="wxGraphicMessage is no exist";
    }
}

+ 1 - 0
common/common-swagger/src/main/java/com/yihu/jw/config/SwaggerConfig.java

@ -69,6 +69,7 @@ public class SwaggerConfig {
                        regex("/" + WlyyContants.Agreement.api_common + "/.*")
                        ,regex("/"+WlyyContants.AgreementKpi.api_common+"/.*")
                        ,regex("/"+WlyyContants.AgreementKpiLog.api_common+"/.*")
                        ,regex("/"+WlyyContants.WlyySignFamily.api_common+"/.*")
                ))
                .build()
                .apiInfo(wlyyApiInfo());

+ 1 - 1
svr/svr-base/src/main/java/com/yihu/jw/wx/controller/WxGraphicMessageController.java

@ -50,7 +50,7 @@ public class WxGraphicMessageController extends EnvelopRestController {
            @RequestBody String jsonData) {
        try {
            WxGraphicMessage WxGraphicMessage = toEntity(jsonData, WxGraphicMessage.class);
            return Envelop.getSuccess(WxContants.WxGraphicMessage.message_success_update, wxGraphicMessageService.updateWxchat(WxGraphicMessage));
            return Envelop.getSuccess(WxContants.WxGraphicMessage.message_success_update, wxGraphicMessageService.updateWxGraphicMessage(WxGraphicMessage));
        } catch (ApiException e) {
            return Envelop.getError(e.getMessage(), e.getErrorCode());
        }

+ 4 - 0
svr/svr-base/src/main/java/com/yihu/jw/wx/dao/WechatDao.java

@ -19,4 +19,8 @@ public interface WechatDao extends PagingAndSortingRepository<WxWechat, Long>, J
    @Query("from WxWechat w where w.code =?1 and w.status!=-1")
    WxWechat findByCode(String code);
    @Query("from WxWechat w where w.id = ?1 and w.status!=-1")
    WxWechat findById(Long id);
}

+ 3 - 3
svr/svr-base/src/main/java/com/yihu/jw/wx/dao/WxGraphicMessageDao.java

@ -17,9 +17,9 @@ public interface WxGraphicMessageDao extends PagingAndSortingRepository<WxGraphi
    @Query("from WxWechat w where w.appId = ?1 and w.code!= ?2 and w.status!=-1")
    WxGraphicMessage findByAppIdExcludeCode(String appId, String code);
    @Query("from WxGraphicMessage w where w.code =?1 and w.status!=-1")
    WxGraphicMessage findByCode(String code);
    @Query("from WxGraphicMessage w where w.id =?1 and w.status!=-1")
    WxGraphicMessage findById(Long id);
}

+ 4 - 0
svr/svr-base/src/main/java/com/yihu/jw/wx/dao/WxMenuDao.java

@ -15,6 +15,9 @@ public interface WxMenuDao  extends PagingAndSortingRepository<WxMenu, Long>, Jp
    @Query("from WxMenu m where m.code = ?1 and m.status = 1")
    WxMenu findByCode(String code);
    @Query("from WxMenu m where m.id = ?1 and m.status = 1")
    WxMenu findById(Long id);
    @Query("from WxMenu m where m.wechatCode =?1 and m.status = 1 order  by m.supMenucode ,m.sort")
    List<WxMenu> findByWechatCode(String wechatCode);
@ -39,4 +42,5 @@ public interface WxMenuDao  extends PagingAndSortingRepository<WxMenu, Long>, Jp
    @Query("from WxMenu m where m.wechatCode =?1 and m.status = 1 and m.supMenucode is null order by m.supMenucode ,m.sort")
    List<WxMenu> findParentMenuByWechatCode(String wechatCode);
}

+ 4 - 0
svr/svr-base/src/main/java/com/yihu/jw/wx/dao/WxTemplateDao.java

@ -12,4 +12,8 @@ public interface WxTemplateDao extends PagingAndSortingRepository<WxTemplate, Lo
    @Query("from WxTemplate w where w.code = ?1 and w.status =1")
    WxTemplate findByCode(String code);
    @Query("from WxTemplate w where w.id = ?1 and w.status =1")
    WxTemplate findById(Long id);
}

+ 19 - 1
svr/svr-base/src/main/java/com/yihu/jw/wx/service/WechatService.java

@ -11,6 +11,7 @@ import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import javax.persistence.Transient;
import java.util.Date;
/**
 * Created by Administrator on 2017/5/20 0020.
@ -45,6 +46,11 @@ public class WechatService extends BaseJpaService<WxWechat, WechatDao> {
        if (wechatTem != null) {
            throw new ApiException(WxContants.Wechat.message_fail_appId_exist, CommonContants.common_error_params_code);
        }
        //设置创建时间和修改时间
        Date date = new Date();
        wechat.setCreateTime(date);
        wechat.setUpdateTime(date);
        return wechatDao.save(wechat);
    }
@ -68,9 +74,17 @@ public class WechatService extends BaseJpaService<WxWechat, WechatDao> {
        if (StringUtils.isEmpty(wechat.getAppSecret())) {
            throw new ApiException(WxContants.Wechat.message_fail_appSecret_is_null, CommonContants.common_error_params_code);
        }
        if (StringUtils.isEmpty(wechat.getId())) {
        Long id = wechat.getId();
        if (StringUtils.isEmpty(id)) {
            throw new ApiException(WxContants.Wechat.message_fail_id_is_null, CommonContants.common_error_params_code);
        }
        WxWechat wechat1 = findById(id);
        if(wechat1 == null){
            throw new ApiException(WxContants.Wechat.message_fail_wxWechat_is_no_exist, CommonContants.common_error_params_code);
        }
        //设置修改时间创建时间
        wechat.setCreateTime(wechat1.getCreateTime());
        wechat.setUpdateTime(new Date());
        WxWechat wechatTem = wechatDao.findByAppIdExcludeCode(wechat.getAppId(),wechat.getCode());
        if(wechatTem!=null){
            throw new ApiException(WxContants.Wechat.message_fail_appId_exist, CommonContants.common_error_params_code);
@ -83,6 +97,10 @@ public class WechatService extends BaseJpaService<WxWechat, WechatDao> {
        return wxWechat;
    }
    public WxWechat findById(Long id){
        return wechatDao.findById(id);
    }
    @Transient
    public void deleteWechat(String code) {
        WxWechat wxWechat = wechatDao.findByCode(code);

+ 22 - 5
svr/svr-base/src/main/java/com/yihu/jw/wx/service/WxGraphicMessageService.java

@ -39,31 +39,48 @@ public class WxGraphicMessageService extends BaseJpaService<WxGraphicMessage, Wx
        if (wxGraphicMessageTem != null) {
            throw new ApiException(WxContants.WxGraphicMessage.message_fail_code_exist, CommonContants.common_error_params_code);
        }
        //设置创建时间和修改时间
        Date date = new Date();
        wxGraphicMessage.setCreateTime(date);
        wxGraphicMessage.setUpdateTime(date);
        return wxGraphicMessageDao.save(wxGraphicMessage);
    }
    @Transient
    public WxGraphicMessage updateWxchat(WxGraphicMessage wxGraphicMessage) {
    public WxGraphicMessage updateWxGraphicMessage(WxGraphicMessage wxGraphicMessage) {
        if (StringUtils.isEmpty(wxGraphicMessage.getCode())) {
            throw new ApiException(WxContants.WxGraphicMessage.message_fail_code_is_null, CommonContants.common_error_params_code);
        }
        if (StringUtils.isEmpty(wxGraphicMessage.getStatus())) {
            throw new ApiException(WxContants.WxGraphicMessage.message_fail_status_is_null, CommonContants.common_error_params_code);
        }
        if (StringUtils.isEmpty(wxGraphicMessage.getId())) {
        Long id = wxGraphicMessage.getId();
        if (StringUtils.isEmpty(id)) {
            throw new ApiException(WxContants.Wechat.message_fail_id_is_null, CommonContants.common_error_params_code);
        }
        //根据id查找
        WxGraphicMessage wxGraphicMessage1 = findById(id);
        if(wxGraphicMessage1==null){
            throw new ApiException(WxContants.WxGraphicMessage.message_fail_wxGraphicMessage_is_no_exist, CommonContants.common_error_params_code);
        }
        //设置创建时间和修改时间
        Date date = new Date();
        wxGraphicMessage.setCreateTime(wxGraphicMessage1.getCreateTime());
        wxGraphicMessage.setUpdateTime(date);
        return wxGraphicMessageDao.save(wxGraphicMessage);
    }
    public WxGraphicMessage findByCode(String code) {
        WxGraphicMessage WxGraphicMessage = wxGraphicMessageDao.findByCode(code);
        if (WxGraphicMessage == null) {
            throw new ApiException(WxContants.WxGraphicMessage.message_fail_code_no_exist, CommonContants.common_error_params_code);
        }
        return WxGraphicMessage;
    }
    public WxGraphicMessage findById(Long id) {
      return wxGraphicMessageDao.findById(id);
    }
    @Transient
    public void deleteWxGraphicMessage(String code) {
        WxGraphicMessage WxGraphicMessage = findByCode(code);

+ 14 - 1
svr/svr-base/src/main/java/com/yihu/jw/wx/service/WxMenuService.java

@ -16,6 +16,7 @@ import org.springframework.util.StringUtils;
import javax.persistence.Transient;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
@ -40,6 +41,7 @@ public class WxMenuService extends BaseJpaService<WxMenu, WxMenuDao> {
     */
    public WxMenu createWxMenu(WxMenu wxMenu) {
        if(canSaveOrUpata(wxMenu)){
            wxMenu.setCreateTime(new Date());
            return wxMenuDao.save(wxMenu);
        }
        return null;
@ -48,9 +50,15 @@ public class WxMenuService extends BaseJpaService<WxMenu, WxMenuDao> {
    @Transient
    public WxMenu updateWxMenu(WxMenu wxMenu) {
        if(canSaveOrUpata(wxMenu)){
            if (StringUtils.isEmpty(wxMenu.getId())) {
            Long id = wxMenu.getId();
            if (StringUtils.isEmpty(id)) {
                throw new ApiException(WxContants.Wechat.message_fail_id_is_null, CommonContants.common_error_params_code);
            }
            WxMenu wxMenu1 = findById(id);
            if(wxMenu1==null){
                throw new ApiException(WxContants.WxMenu.message_fail_WxMenu_is_no_exist, CommonContants.common_error_params_code);
            }
            wxMenu.setCreateTime(wxMenu1.getCreateTime());
            return wxMenuDao.save(wxMenu);
        }
        return null;
@ -80,6 +88,10 @@ public class WxMenuService extends BaseJpaService<WxMenu, WxMenuDao> {
        return wxMenuDao.findByCode(code);
    }
    public WxMenu findById(Long id) {
        return wxMenuDao.findById(id);
    }
    /**
     * 根据wechatCode查找所有菜单
     * @param wechatCode
@ -307,6 +319,7 @@ public class WxMenuService extends BaseJpaService<WxMenu, WxMenuDao> {
        if(null!=wxMenuTemp){
            throw new ApiException(WxContants.WxMenu.message_fail_sort_is_repeat, CommonContants.common_error_params_code);
        }
        wxMenu.setUpdateTime(new Date());
        return true;
    }
}

+ 17 - 5
svr/svr-base/src/main/java/com/yihu/jw/wx/service/WxTemplateService.java

@ -31,7 +31,6 @@ public class WxTemplateService extends BaseJpaService<WxTemplate, WxTemplateDao>
    @Autowired
    private WechatService wechatService;
    public WxTemplate createWxTemplate(WxTemplate wxTemplate) {
        if (StringUtils.isEmpty(wxTemplate.getCode())) {
            throw new ApiException(WxContants.WxTemplate.message_fail_code_is_null, CommonContants.common_error_params_code);
@ -54,6 +53,10 @@ public class WxTemplateService extends BaseJpaService<WxTemplate, WxTemplateDao>
        if(!content.matches("\\{\\{.+\\.DATA\\}\\}")){//content必须还有 "{{.DATA}}"
            throw new ApiException(WxContants.WxTemplate.message_fail_content_format_is_not_right, CommonContants.common_error_params_code);
        }
        //设置创建时间和修改时间
        Date date = new Date();
        wxTemplate.setCreateTime(date);
        wxTemplate.setUpdateTime(date);
        return wxTemplateDao.save(wxTemplate);
    }
@ -71,9 +74,16 @@ public class WxTemplateService extends BaseJpaService<WxTemplate, WxTemplateDao>
        if (StringUtils.isEmpty(content)) {
            throw new ApiException(WxContants.WxTemplate.message_fail_content_is_null, CommonContants.common_error_params_code);
        }
        if (StringUtils.isEmpty(wxTemplate.getId())) {
        Long id = wxTemplate.getId();
        if (StringUtils.isEmpty(id)) {
            throw new ApiException(WxContants.Wechat.message_fail_id_is_null, CommonContants.common_error_params_code);
        }
        WxTemplate wxTemplate1 = findById(id);
        if(wxTemplate1==null){
            throw new ApiException(WxContants.WxTemplate.message_fail_template_is_no_exist, CommonContants.common_error_params_code);
        }
        wxTemplate.setCreateTime(wxTemplate1.getCreateTime());
        wxTemplate.setUpdateTime(new Date());
        if(!content.matches("\\{\\{.+\\.DATA\\}\\}")){//content必须还有 "{{.DATA}}"
            throw new ApiException(WxContants.WxTemplate.message_fail_content_format_is_not_right, CommonContants.common_error_params_code);
        }
@ -91,9 +101,11 @@ public class WxTemplateService extends BaseJpaService<WxTemplate, WxTemplateDao>
    public WxTemplate findByCode(String code) {
        WxTemplate wxTemplate = wxTemplateDao.findByCode(code);
        if (wxTemplate == null) {
            throw new ApiException(WxContants.WxTemplate.message_fail_code_no_exist, CommonContants.common_error_params_code);
        }
        return wxTemplate;
    }
    public WxTemplate findById(Long id) {
        WxTemplate wxTemplate = wxTemplateDao.findById(id);
        return wxTemplate;
    }

File diff suppressed because it is too large
+ 219 - 0
svr/svr-wlyy/src/main/java/com/yihu/jw/util/IDCard.java


+ 5 - 5
svr/svr-wlyy/src/main/java/com/yihu/jw/wlyy/controller/WlyyAgreementController.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.WlyyAgreement;
import com.yihu.jw.wlyy.service.WlyyAgreementService;
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;
@ -82,7 +82,7 @@ public class WlyyAgreementController extends EnvelopRestController {
    @RequestMapping(value =WlyyContants.Agreement.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,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,
@ -110,7 +110,7 @@ public class WlyyAgreementController extends EnvelopRestController {
    @GetMapping(value =WlyyContants.Agreement.api_getList)
    @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,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,

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

+ 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.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.text.ParseException;
import java.util.ArrayList;
import java.util.List;
@RestController
@RequestMapping(WlyyContants.SignFamily.api_common)
@Api(value = "签约相关操作", description = "签约相关操作")
public class WlyySignFamilyController extends EnvelopRestController {
    @Autowired
    private WlyySignFamilyService wlyySignFamilyService;
    @PostMapping(value = WlyyContants.SignFamily.api_create, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ApiOperation(value = "创建签约", notes = "创建签约")
    public Envelop create(
            @ApiParam(name = "json_data", value = "", defaultValue = "")
            @RequestBody String jsonData) throws ParseException {
        try {
            WlyySignFamily wlyySignFamily = toEntity(jsonData, WlyySignFamily.class);
            return Envelop.getSuccess(WlyyContants.SignFamily.message_success_create, wlyySignFamilyService.create(wlyySignFamily));
        } catch (ApiException e) {
            return Envelop.getError(e.getMessage(), e.getErrorCode());
        }
    }
    @PutMapping(value = WlyyContants.SignFamily.api_update, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ApiOperation(value = "修改签约", notes = "修改签约")
    public Envelop update(
            @ApiParam(name = "json_data", value = "", defaultValue = "")
            @RequestBody String jsonData) throws ParseException {
        try {
            WlyySignFamily wlyySignFamily = toEntity(jsonData, WlyySignFamily.class);
            return Envelop.getSuccess(WlyyContants.SignFamily.message_success_update, wlyySignFamilyService.update(wlyySignFamily));
        } catch (ApiException e) {
            return Envelop.getError(e.getMessage(), e.getErrorCode());
        }
    }
    @GetMapping(value =WlyyContants.SignFamily.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.SignFamily.message_success_find, wlyySignFamilyService.findByCode(code));
        } catch (ApiException e) {
            return Envelop.getError(e.getMessage(), e.getErrorCode());
        }
    }
    @RequestMapping(value =WlyyContants.SignFamily.api_queryPage, method = RequestMethod.GET)
    @ApiOperation(value = "分页获取协议")
    public Envelop queryPage(
            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段")
            @RequestParam(value = "fields", required = false) String fields,
            @ApiParam(name = "filters", value = "过滤器,为空检索所有条件")
            @RequestParam(value = "filters", required = false) String filters,
            @ApiParam(name = "sorts", value = "排序,规则参见说明文档", defaultValue = "+name")
            @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<WlyySignFamily> list = wlyySignFamilyService.search(fields, filters, sorts, page, size);
        //获取总数
        long count=wlyySignFamilyService.getCount(filters);
        //封装头信息
        pagedResponse(request, response, count, page, size);
        //封装返回格式
        List<WlyySignFamily> wlyySignFamily = convertToModels(list, new ArrayList<>(list.size()), WlyySignFamily.class, fields);
        return Envelop.getSuccessListWithPage(WlyyContants.SignFamily.message_success_find_functions,wlyySignFamily, page, size,count);
    }
    @GetMapping(value =WlyyContants.SignFamily.api_getList)
    @ApiOperation(value = "获取协议列表(不分页)")
    public Envelop getList(
            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段")
            @RequestParam(value = "fields", required = false) String fields,
            @ApiParam(name = "filters", value = "过滤器,为空检索所有条件")
            @RequestParam(value = "filters", required = false) String filters,
            @ApiParam(name = "sorts", value = "排序,规则参见说明文档", defaultValue = "+name")
            @RequestParam(value = "sorts", required = false) String sorts) throws Exception {
        //得到list数据
        List<WlyySignFamily> list = wlyySignFamilyService.search(fields,filters,sorts);
        //封装返回格式
        List<WlyySignFamily> wlyySignFamily = convertToModels(list, new ArrayList<>(list.size()), WlyySignFamily.class, fields);
        return Envelop.getSuccessList(WlyyContants.SignFamily.message_success_find_functions,wlyySignFamily);
    }
}

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

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

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

@ -1,14 +1,14 @@
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;
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;
    }

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

@ -1,12 +1,12 @@
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;
import javax.persistence.Table;
import java.sql.Timestamp;
import java.util.Date;
/**
 * Created by Administrator on 2017/6/1 0001.
@ -19,13 +19,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 +79,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,11 +98,11 @@ public class WlyyAgreementKpi extends IdEntity {
    }
    @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;
    }
@ -126,11 +116,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;
    }
}

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

@ -1,12 +1,12 @@
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;
import javax.persistence.Table;
import java.sql.Timestamp;
import java.util.Date;
/**
 * Created by Administrator on 2017/6/1 0001.
@ -14,13 +14,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,11 +82,11 @@ public class WlyyAgreementKpiLog extends IdEntity {
    }
    @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;
    }

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

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

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

@ -1,16 +1,17 @@
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;
import javax.persistence.Transient;
import java.util.Date;
/**
 * Created by Administrator on 2017/6/1 0001.
@ -41,6 +42,9 @@ public class WlyyAgreementKpiLogService extends BaseJpaService<WlyyAgreementKpiL
        if (StringUtils.isEmpty(wlyyAgreementKpiLog.getCode())) {
            throw new ApiException(WlyyContants.AgreementKpi.message_fail_code_is_null, CommonContants.common_error_params_code);
        }
        //设置创建时间
        Date date = new Date();
        wlyyAgreementKpiLog.setCreateTime(date);
        return wlyyAgreementKpiLogDao.save(wlyyAgreementKpiLog);
    }

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

@ -1,16 +1,18 @@
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.WlyyAgreement;
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;
import javax.persistence.Transient;
import java.util.Date;
/**
 * Created by Administrator on 2017/6/1 0001.
@ -21,11 +23,23 @@ public class WlyyAgreementKpiService extends BaseJpaService<WlyyAgreementKpi, Wl
    @Autowired
    private WlyyAgreementKpiDao wlyyAgreementKpiDao;
    @Autowired
    private WlyyAgreementService wlyyAgreementService;
    @Transient
    public WlyyAgreementKpi create(WlyyAgreementKpi wlyyAgreementKpi) {
        if (StringUtils.isEmpty(wlyyAgreementKpi.getCode())) {
            throw new ApiException(WlyyContants.AgreementKpi.message_fail_code_is_null, CommonContants.common_error_params_code);
        }
        //判断agreement是否存在
        String agreementCode = wlyyAgreementKpi.getAgreementCode();
        if (StringUtils.isEmpty(agreementCode)) {
            throw new ApiException(WlyyContants.AgreementKpi.message_fail_agreementCode_is_null, CommonContants.common_error_params_code);
        }
        WlyyAgreement agreement = wlyyAgreementService.findByCode(agreementCode);
        if(agreement == null){
            throw new ApiException(WlyyContants.AgreementKpi.message_fail_agreement_is_null, CommonContants.common_error_params_code);
        }
        if (StringUtils.isEmpty(wlyyAgreementKpi.getKpiName())) {
            throw new ApiException(WlyyContants.AgreementKpi.message_fail_kpiName_is_null, CommonContants.common_error_params_code);
        }
@ -35,6 +49,10 @@ public class WlyyAgreementKpiService extends BaseJpaService<WlyyAgreementKpi, Wl
        if (StringUtils.isEmpty(wlyyAgreementKpi.getStatus())) {
            throw new ApiException(WlyyContants.AgreementKpi.message_fail_status_is_null, CommonContants.common_error_params_code);
        }
        //设置创建时间和修改时间
        Date date = new Date();
        wlyyAgreementKpi.setCreateTime(date);
        wlyyAgreementKpi.setUpdaateTime(date);
        return wlyyAgreementKpiDao.save(wlyyAgreementKpi);
    }
@ -44,6 +62,15 @@ public class WlyyAgreementKpiService extends BaseJpaService<WlyyAgreementKpi, Wl
        if (StringUtils.isEmpty(code)) {
            throw new ApiException(WlyyContants.AgreementKpi.message_fail_code_is_null, CommonContants.common_error_params_code);
        }
        //判断agreement是否存在
        String agreementCode = wlyyAgreementKpi.getAgreementCode();
        if (StringUtils.isEmpty(agreementCode)) {
            throw new ApiException(WlyyContants.AgreementKpi.message_fail_agreementCode_is_null, CommonContants.common_error_params_code);
        }
        WlyyAgreement agreement = wlyyAgreementService.findByCode(agreementCode);
        if(agreement == null){
            throw new ApiException(WlyyContants.AgreementKpi.message_fail_agreement_is_null, CommonContants.common_error_params_code);
        }
        if (StringUtils.isEmpty(wlyyAgreementKpi.getKpiName())) {
            throw new ApiException(WlyyContants.AgreementKpi.message_fail_kpiName_is_null, CommonContants.common_error_params_code);
        }
@ -61,6 +88,11 @@ public class WlyyAgreementKpiService extends BaseJpaService<WlyyAgreementKpi, Wl
        if(wlyyAgreementKpi1==null){
            throw new ApiException(WlyyContants.Agreement.message_fail_wlyyAgreement_is_no_exist, CommonContants.common_error_params_code);
        }
        //设置创建时间和修改时间
        Date date = new Date();
        wlyyAgreementKpi.setCreateTime(wlyyAgreementKpi1.getCreateTime());
        wlyyAgreementKpi.setUpdaateTime(date);
        wlyyAgreementKpi1 = wlyyAgreementKpiDao.findCodeExcludeId(code,id);
        if(wlyyAgreementKpi1 !=null){
            throw new ApiException(WlyyContants.Agreement.message_fail_code_exist, CommonContants.common_error_params_code);

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

@ -1,16 +1,17 @@
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;
import javax.persistence.Transient;
import java.util.Date;
/**
 * Created by Administrator on 2017/6/1 0001.
@ -35,6 +36,10 @@ public class WlyyAgreementService extends BaseJpaService<WlyyAgreement, WlyyAgre
        if (StringUtils.isEmpty(wlyyAgreement.getStatus())) {
            throw new ApiException(WlyyContants.Agreement.message_fail_status_is_null, CommonContants.common_error_params_code);
        }
        //设置创建时间和修改时间
        Date date = new Date();
        wlyyAgreement.setCreateTime(date);
        wlyyAgreement.setUpdateTime(date);
        return wlyyAgreementDao.save(wlyyAgreement);
    }
@ -61,7 +66,12 @@ public class WlyyAgreementService extends BaseJpaService<WlyyAgreement, WlyyAgre
        if(wlyyAgreement1==null){
            throw new ApiException(WlyyContants.Agreement.message_fail_wlyyAgreement_is_no_exist, CommonContants.common_error_params_code);
        }
         wlyyAgreement1 = wlyyAgreementDao.findCodeExcludeId(code,id);
        //设置创建时间和修改时间
        Date date = new Date();
        wlyyAgreement.setCreateTime(wlyyAgreement1.getCreateTime());
        wlyyAgreement.setUpdateTime(date);
        wlyyAgreement1 = wlyyAgreementDao.findCodeExcludeId(code,id);
        if(wlyyAgreement1 !=null){
            throw new ApiException(WlyyContants.Agreement.message_fail_code_exist, CommonContants.common_error_params_code);
        }

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

@ -0,0 +1,99 @@
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.util.IDCard;
import com.yihu.jw.wlyy.Agreement.dao.WlyySignFamilyDao;
import com.yihu.jw.wlyy.Agreement.entity.WlyyAgreement;
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;
import java.text.ParseException;
/**
 * Created by Administrator on 2017/6/2 0002.
 */
@Service
public class WlyySignFamilyService extends BaseJpaService<WlyySignFamily, WlyySignFamilyDao> {
    @Autowired
    private WlyySignFamilyDao wlyySignFamilyDao;
    @Autowired
    private WlyyAgreementService wlyyAgreementService;
    @Transient
    public WlyySignFamily create(WlyySignFamily wlyySignFamily) throws ParseException {
        boolean b = canSaveOrUpdate(wlyySignFamily);
        if(b){
            return wlyySignFamilyDao.save(wlyySignFamily);
        }
        return null;
    }
    @Transient
    public WlyySignFamily update(WlyySignFamily wlyySignFamily) throws ParseException {
        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) throws ParseException {
        if (StringUtils.isEmpty(wlyySignFamily.getCode())) {
            throw new ApiException(WlyyContants.SignFamily.message_fail_code_is_null, CommonContants.common_error_params_code);
        }
        if (StringUtils.isEmpty(wlyySignFamily.getType())) {
            throw new ApiException(WlyyContants.SignFamily.message_fail_type_is_null, CommonContants.common_error_params_code);
        }
        if (StringUtils.isEmpty(wlyySignFamily.getName())) {
            throw new ApiException(WlyyContants.SignFamily.message_fail_name_is_null, CommonContants.common_error_params_code);
        }
        String idcard = wlyySignFamily.getIdcard();
        if (StringUtils.isEmpty(idcard)) {
            throw new ApiException(WlyyContants.SignFamily.message_fail_idCard_is_null, CommonContants.common_error_params_code);
        }
        String s = new IDCard().IDCardValidate(idcard);//不为空字符串,说明身份证有问题啦
        if(!StringUtils.isEmpty(s)){
            throw new ApiException(s, CommonContants.common_error_params_code);
        }
        if (StringUtils.isEmpty(wlyySignFamily.getSsc())) {
            throw new ApiException(WlyyContants.SignFamily.message_fail_ssc_is_null, CommonContants.common_error_params_code);
        }
        if (StringUtils.isEmpty(wlyySignFamily.getHospital())) {
            throw new ApiException(WlyyContants.SignFamily.message_fail_hospital_is_null, CommonContants.common_error_params_code);
        }
        if (StringUtils.isEmpty(wlyySignFamily.getHospitalName())) {
            throw new ApiException(WlyyContants.SignFamily.message_fail_hospitalName_is_null, CommonContants.common_error_params_code);
        }
        if (StringUtils.isEmpty(wlyySignFamily.getStatus())) {
            throw new ApiException(WlyyContants.SignFamily.message_fail_status_is_null, CommonContants.common_error_params_code);
        }
        if (StringUtils.isEmpty(wlyySignFamily.getExpenses())) {
            throw new ApiException(WlyyContants.SignFamily.message_fail_expense_is_null, CommonContants.common_error_params_code);
        }
        if (StringUtils.isEmpty(wlyySignFamily.getExpensesStatus())) {
            throw new ApiException(WlyyContants.SignFamily.message_fail_expenseStatus_is_null, CommonContants.common_error_params_code);
        }
        String agreementCode = wlyySignFamily.getAgreementCode();
        if (StringUtils.isEmpty(agreementCode)) {
            throw new ApiException(WlyyContants.SignFamily.message_fail_agreementCode_is_null, CommonContants.common_error_params_code);
        }
        //根据agreementCode查找协议是否存在
        WlyyAgreement agreement = wlyyAgreementService.findByCode(agreementCode);
        if(agreement==null){
            throw new ApiException(WlyyContants.Agreement.message_fail_wlyyAgreement_is_no_exist, CommonContants.common_error_params_code);
        }
        return true;
    }
}

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

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

@ -0,0 +1,49 @@
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="wlyyAgreement";
        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="wlyyAgreementKpi";
        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="wlyyAgreementKpiLog";
        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";
    }
    //签约
    public static class SignFamily{
        public static final String api_common="wlyySignFamily";
        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";
    }
}

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

+ 2 - 6
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;
@ -13,9 +14,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.sleuth.Tracer;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@RestController
@RequestMapping(WechatContants.Config.api_common)
@ -93,9 +91,7 @@ public class WechatController{
            @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 {
            @RequestParam(value = "page", required = false) int page) throws Exception {
        Envelop envelop = wechatFegin.getWechats(fields,filters,sorts,size,page);
        return envelop;
    }

+ 21 - 17
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;
@ -14,6 +15,9 @@ 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;
/**
 * Created by Administrator on 2017/5/31 0031.
 */
@ -76,23 +80,23 @@ public class WechatGraphicMessageController {
        return graphicMessageFegin.findByCode(code);
    }
    //@RequestMapping(value = WechatContants.GraphicMessage.api_getWxGraphicMessages, method = RequestMethod.GET)
    //@ApiOperation(value = "获取微信图文消息列表(分页)")
    //public Envelop getWxGraphicMessages(
    //        @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段", defaultValue = "id,code,title,description,url,pic_url,remark,status")
    //        @RequestParam(value = "fields", required = false) String fields,
    //        @ApiParam(name = "filters", value = "过滤器,为空检索所有条件")
    //        @RequestParam(value = "filters", required = false) String filters,
    //        @ApiParam(name = "sorts", value = "排序,规则参见说明文档", defaultValue = "+title,+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 graphicMessageFegin.getWxGraphicMessages(fields,filters,sorts,size,page,request,response);
    //}
    @RequestMapping(value = WechatContants.GraphicMessage.api_getWxGraphicMessages, method = RequestMethod.GET)
    @ApiOperation(value = "获取微信图文消息列表(分页)")
    public Envelop getWxGraphicMessages(
            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段", defaultValue = "id,code,title,description,url,pic_url,remark,status")
            @RequestParam(value = "fields", required = false) String fields,
            @ApiParam(name = "filters", value = "过滤器,为空检索所有条件")
            @RequestParam(value = "filters", required = false) String filters,
            @ApiParam(name = "sorts", value = "排序,规则参见说明文档", defaultValue = "+title,+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 graphicMessageFegin.getWxGraphicMessages(fields,filters,sorts,size,page);
    }
    @GetMapping(value = WechatContants.GraphicMessage.api_getWxGraphicMessageNoPage)

+ 16 - 17
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;
@ -76,23 +77,21 @@ public class WechatMenuController {
        return wechatMenuFegin.findByCode(code);
    }
    //@RequestMapping(value = WechatContants.Menu.api_getWxMenus, method = RequestMethod.GET)
    //@ApiOperation(value = "获取微信菜单列表(分页)")
    //public Envelop getWxMenus(
    //        @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段", defaultValue = "id,code,name,saasId,appId,appSecret,baseUrl,remark")
    //        @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 wechatMenuFegin.getWxMenus(fields,filters,sorts,size,page,request,response);
    //}
    @RequestMapping(value = WechatContants.Menu.api_getWxMenus, method = RequestMethod.GET)
    @ApiOperation(value = "获取微信菜单列表(分页)")
    public Envelop getWxMenus(
            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段", defaultValue = "id,code,name,saasId,appId,appSecret,baseUrl,remark")
            @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) throws Exception {
        return wechatMenuFegin.getWxMenus(fields,filters,sorts,size,page);
    }
    @GetMapping(value = WechatContants.Menu.api_getWxMenuNoPage)

+ 16 - 17
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;
@ -76,23 +77,21 @@ public class WechatTemplateControlle {
        return wechatTemplateFegin.findByCode(code);
    }
    //@RequestMapping(value = WechatContants.Template.api_getWxTemplates, method = RequestMethod.GET)
    //@ApiOperation(value = "获取微信模版列表(分页)")
    //public Envelop getWechats(
    //        @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段", defaultValue = "id,code,title,wechatCode,templateId,content,remark,status")
    //        @RequestParam(value = "fields", required = false) String fields,
    //        @ApiParam(name = "filters", value = "过滤器,为空检索所有条件")
    //        @RequestParam(value = "filters", required = false) String filters,
    //        @ApiParam(name = "sorts", value = "排序,规则参见说明文档", defaultValue = "+title,+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 wechatTemplateFegin.getWechats(fields,filters,sorts,size,page,request,response);
    //}
    @RequestMapping(value = WechatContants.Template.api_getWxTemplates, method = RequestMethod.GET)
    @ApiOperation(value = "获取微信模版列表(分页)")
    public Envelop getWechats(
            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段", defaultValue = "id,code,title,wechatCode,templateId,content,remark,status")
            @RequestParam(value = "fields", required = false) String fields,
            @ApiParam(name = "filters", value = "过滤器,为空检索所有条件")
            @RequestParam(value = "filters", required = false) String filters,
            @ApiParam(name = "sorts", value = "排序,规则参见说明文档", defaultValue = "+title,+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) throws Exception {
        return wechatTemplateFegin.getWechats(fields,filters,sorts,size,page);
    }
    @GetMapping(value = WechatContants.Template.api_getWxTemplatesNoPage)

+ 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.*;
import javax.servlet.http.HttpServletResponse;
@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) throws Exception {
        return wlyyAgreementFegin.queryPage(fields,filters,sorts,size,page);
    }
    @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);
    }
}

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

@ -0,0 +1,91 @@
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) throws Exception {
        return wlyyAgreementKpiFegin.queryPage(fields, filters, sorts, size, page);
    }
    @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);
    }
}

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

@ -0,0 +1,78 @@
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.http.MediaType;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
@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) throws Exception {
        return wlyyAgreementKpiLogFegin.queryPage(fields, filters, sorts, size, page);
    }
    @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);
    }
}

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

@ -0,0 +1,86 @@
package com.yihu.jw.controller.wlyy.agreement;
import com.yihu.jw.commnon.wlyy.AgreementContants;
import com.yihu.jw.fegin.wlyy.agreement.WlyySignFamilyFegin;
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.*;
import javax.servlet.http.HttpServletResponse;
@RestController
@RequestMapping(AgreementContants.SignFamily.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 = AgreementContants.SignFamily.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 = AgreementContants.SignFamily.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 =AgreementContants.SignFamily.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 =AgreementContants.SignFamily.api_queryPage, method = RequestMethod.GET)
    @ApiOperation(value = "分页获取协议")
    public Envelop queryPage(
            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段")
            @RequestParam(value = "fields", required = false) String fields,
            @ApiParam(name = "filters", value = "过滤器,为空检索所有条件")
            @RequestParam(value = "filters", required = false) String filters,
            @ApiParam(name = "sorts", value = "排序,规则参见说明文档", defaultValue = "+name")
            @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) throws Exception {
       return wlyySignFamilyFegin.queryPage(fields, filters, sorts, size, page);
    }
    @GetMapping(value =AgreementContants.SignFamily.api_getList)
    @ApiOperation(value = "获取协议列表(不分页)")
    public Envelop getList(
            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段")
            @RequestParam(value = "fields", required = false) String fields,
            @ApiParam(name = "filters", value = "过滤器,为空检索所有条件")
            @RequestParam(value = "filters", required = false) String filters,
            @ApiParam(name = "sorts", value = "排序,规则参见说明文档", defaultValue = "+name")
            @RequestParam(value = "sorts", required = false) String sorts) throws Exception {
        return wlyySignFamilyFegin.getList(fields,filters,sorts);
    }
}

+ 7 - 9
web-gateway/src/main/java/com/yihu/jw/fegin/base/wx/GraphicMessageFegin.java

@ -32,15 +32,13 @@ public interface GraphicMessageFegin {
    @RequestMapping(value = WxContants.WxGraphicMessage.api_getByCode,method = RequestMethod.GET)
    Envelop findByCode(String code);
    //@RequestMapping(value = WlyyContants.WxGraphicMessage.api_getWxGraphicMessages,method = RequestMethod.GET)
    //Envelop getWxGraphicMessages(
    //        @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);
    @RequestMapping(value = WxContants.WxGraphicMessage.api_getWxGraphicMessages,method = RequestMethod.GET)
    Envelop getWxGraphicMessages(
            @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);
    @RequestMapping(value = WxContants.WxGraphicMessage.api_getWxGraphicMessageNoPage,method = RequestMethod.GET)
    Envelop getWxGraphicMessageNoPage(

+ 2 - 2
web-gateway/src/main/java/com/yihu/jw/fegin/base/wx/WechatFegin.java

@ -31,8 +31,8 @@ public interface WechatFegin {
    Envelop findByCode(@RequestParam(value = "code") String code);
    @RequestMapping(value = WxContants.Wechat.api_getWechats ,method = RequestMethod.GET)
    Envelop getWechats(@RequestParam(value = "fields")String fields, @RequestParam(value = "filters") String filters, @RequestParam(value = "sorts")String sorts, @RequestParam(value = "page")int page,@RequestParam(value = "size") int size);
    Envelop getWechats(@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);
    @RequestMapping(value = WxContants.Wechat.api_getWechatNoPage,method = RequestMethod.GET )
    Envelop getWechatNoPage(@RequestParam(value = "code")String fields,@RequestParam(value = "code") String filters,@RequestParam(value = "code") String sorts);
    Envelop getWechatNoPage(@RequestParam(value = "fields")String fields,@RequestParam(value = "filters") String filters,@RequestParam(value = "sorts") String sorts);
}

+ 7 - 9
web-gateway/src/main/java/com/yihu/jw/fegin/base/wx/WechatMenuFegin.java

@ -38,15 +38,13 @@ public interface WechatMenuFegin {
            @RequestParam(value = "filters", required = false) String filters,
            @RequestParam(value = "sorts", required = false) String sorts);
    //@RequestMapping(value = WlyyContants.WxMenu.api_getWxMenus,method = RequestMethod.GET)
    //Envelop getWxMenus(
    //        @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);
    @RequestMapping(value = WxContants.WxMenu.api_getWxMenus,method = RequestMethod.GET)
    Envelop getWxMenus(
            @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);
    @RequestMapping(value = WxContants.WxMenu.api_createMenu ,method = RequestMethod.GET)
    Envelop createWechatMenu(@RequestParam(value = "wechatCode", required = true)String wechatCode);

+ 7 - 9
web-gateway/src/main/java/com/yihu/jw/fegin/base/wx/WechatTemplateFegin.java

@ -35,15 +35,13 @@ public interface WechatTemplateFegin {
            @RequestParam(value = "filters", required = false) String filters,
            @RequestParam(value = "sorts", required = false) String sorts);
    //@RequestMapping(value = WlyyContants.WxTemplate.api_getWxTemplates, method = RequestMethod.GET)
    //Envelop getWechats(
    //        @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);
    @RequestMapping(value = WxContants.WxTemplate.api_getWxTemplates, method = RequestMethod.GET)
    Envelop getWechats(
            @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);
    @RequestMapping(value = WxContants.WxTemplate.api_sendTemplateMessage ,method = RequestMethod.GET)
    @ResponseBody

+ 4 - 4
web-gateway/src/main/java/com/yihu/jw/fegin/fallbackfactory/base/wx/GraphicMessageFeginFallbackFactory.java

@ -35,10 +35,10 @@ public class GraphicMessageFeginFallbackFactory implements FallbackFactory<Graph
                return null;
            }
            //@Override
            //public Envelop getWxGraphicMessages(@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 getWxGraphicMessages(@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) {
                return null;
            }
            @Override
            public Envelop getWxGraphicMessageNoPage(@RequestParam(value = "fields", required = false) String fields, @RequestParam(value = "filters", required = false) String filters, @RequestParam(value = "sorts", required = false) String sorts) {

+ 1 - 1
web-gateway/src/main/java/com/yihu/jw/fegin/fallbackfactory/base/wx/WechatFeginFallbackFactory.java

@ -32,7 +32,7 @@ public class WechatFeginFallbackFactory implements FallbackFactory<WechatFegin>
                return envelop;
            }
            public Envelop getWechats(String fields, String filters, String sorts, int page, int size){
            public Envelop getWechats(String fields, String filters, String sorts, int size, int page){
                Envelop envelop = new Envelop();
                envelop.getError(e.getMessage(),-1);
                return envelop;

+ 5 - 4
web-gateway/src/main/java/com/yihu/jw/fegin/fallbackfactory/base/wx/WechatMenuFeginFallbackFactory.java

@ -38,15 +38,16 @@ public class WechatMenuFeginFallbackFactory implements FallbackFactory<WechatMen
                return null;
            }
            //@Override
            @Override
            public Envelop createWechatMenu(String wechatCode) {
                return null;
            }
            //public Envelop getWxMenus(String fields, String filters, String sorts, int size, int page, HttpServletRequest request, HttpServletResponse response) {
            //    return null;
            //}
            @Override
            public Envelop getWxMenus(String fields, String filters, String sorts, int size, int page) {
                return null;
            }
        };
    }
}

+ 4 - 4
web-gateway/src/main/java/com/yihu/jw/fegin/fallbackfactory/base/wx/WechatTemplateFeginFallbackFactory.java

@ -44,10 +44,10 @@ public class WechatTemplateFeginFallbackFactory implements FallbackFactory<Wecha
                return null;
            }
            //@Override
            //public Envelop getWechats(String fields, String filters, String sorts, int size, int page, HttpServletRequest request, HttpServletResponse response) {
            //    return null;
            //}
            @Override
            public Envelop getWechats(String fields, String filters, String sorts, int size, int page) {
                return null;
            }
        };
    }
}

+ 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) {
                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) {
                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) {
                return null;
            }
            @Override
            public Envelop getList(String fields, String filters, String sorts) {
                return null;
            }
        };
    }
}

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

@ -0,0 +1,45 @@
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.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 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 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) {
                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;
            }
        };
    }
}

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

@ -0,0 +1,44 @@
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);
    @RequestMapping(value=WlyyContants.Agreement.api_getByCode,method = RequestMethod.GET)
    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);
    @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);
}

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

@ -0,0 +1,44 @@
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);
    @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);
}

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

@ -0,0 +1,37 @@
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);
    @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);
}

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

@ -0,0 +1,41 @@
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.*;
@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);
    @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);
    @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);
}

+ 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