Ver código fonte

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

yeshijie 7 anos atrás
pai
commit
013b76696b
54 arquivos alterados com 548 adições e 819 exclusões
  1. 3 8
      patient-co-manage/redis-cache/pom.xml
  2. 11 61
      patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/common/constants/ServiceApi.java
  3. 5 0
      patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/common/controller/EnvelopRestEndPoint.java
  4. 3 3
      patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/common/vo/MRedisCacheCategory.java
  5. 43 24
      patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/controller/redis/RedisCacheAuthorizationEndPoint.java
  6. 40 24
      patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/controller/redis/RedisCacheCategoryEndPoint.java
  7. 26 19
      patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/controller/redis/RedisCacheKeyRuleEndPoint.java
  8. 2 2
      patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/controller/redis/RedisCacheOperationEndPoint.java
  9. 2 2
      patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/controller/redis/RedisCacheStatisticsEndPoint.java
  10. 41 28
      patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/controller/redis/RedisMqChannelEndPoint.java
  11. 38 26
      patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/controller/redis/RedisMqPublisherEndPoint.java
  12. 6 6
      patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/controller/redis/RedisMqSubscriberEndPoint.java
  13. 2 2
      patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/controller/redis/RedisScheduledController.java
  14. 2 2
      patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/controller/redis/RedisSubscribeMessageEndPoint.java
  15. 0 106
      patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/entity/SystemDict.java
  16. 0 152
      patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/entity/SystemDictList.java
  17. 3 2
      patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/listener/ApplicationReadyEventListener.java
  18. 0 22
      patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/repository/SystemDictDao.java
  19. 0 12
      patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/repository/SystemDictListDao.java
  20. 2 2
      patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/repository/redis/RedisCacheAuthorizationDao.java
  21. 7 3
      patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/repository/redis/RedisCacheCategoryDao.java
  22. 1 1
      patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/repository/redis/RedisCacheKeyMemoryDao.java
  23. 3 3
      patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/repository/redis/RedisCacheKeyRuleDao.java
  24. 3 3
      patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/repository/redis/RedisMqChannelDao.java
  25. 2 2
      patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/repository/redis/RedisMqPublisherDao.java
  26. 3 3
      patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/repository/redis/RedisMqSubscriberDao.java
  27. 0 45
      patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/service/manager/dict/SystemDictService.java
  28. 3 2
      patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/service/redis/DefaultMessageDelegate.java
  29. 3 3
      patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/service/redis/cache/RedisCacheAuthorizationService.java
  30. 5 4
      patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/service/redis/cache/RedisCacheCategoryService.java
  31. 1 1
      patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/service/redis/cache/RedisCacheKeyMemoryService.java
  32. 4 4
      patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/service/redis/cache/RedisCacheKeyRuleService.java
  33. 4 4
      patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/service/redis/pubsub/RedisMqChannelService.java
  34. 3 3
      patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/service/redis/pubsub/RedisMqPublisherService.java
  35. 4 4
      patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/service/redis/pubsub/RedisMqSubscriberService.java
  36. 6 7
      patient-co-manage/redis-cache/src/main/resources/application.yml
  37. 9 5
      patient-co-manage/redis-cache/src/main/webapp/WEB-INF/views/redis/cache/authorization/detailJs.jsp
  38. 1 3
      patient-co-manage/redis-cache/src/main/webapp/WEB-INF/views/redis/cache/authorization/listJs.jsp
  39. 1 1
      patient-co-manage/redis-cache/src/main/webapp/WEB-INF/views/redis/cache/category/detail.jsp
  40. 85 78
      patient-co-manage/redis-cache/src/main/webapp/WEB-INF/views/redis/cache/category/detailJs.jsp
  41. 105 103
      patient-co-manage/redis-cache/src/main/webapp/WEB-INF/views/redis/cache/category/listJs.jsp
  42. 9 5
      patient-co-manage/redis-cache/src/main/webapp/WEB-INF/views/redis/cache/keyRule/detailJs.jsp
  43. 1 3
      patient-co-manage/redis-cache/src/main/webapp/WEB-INF/views/redis/cache/keyRule/listJs.jsp
  44. 9 5
      patient-co-manage/redis-cache/src/main/webapp/WEB-INF/views/redis/mq/channel/detailJs.jsp
  45. 1 3
      patient-co-manage/redis-cache/src/main/webapp/WEB-INF/views/redis/mq/channel/listJs.jsp
  46. 9 5
      patient-co-manage/redis-cache/src/main/webapp/WEB-INF/views/redis/mq/publisher/detailJs.jsp
  47. 1 3
      patient-co-manage/redis-cache/src/main/webapp/WEB-INF/views/redis/mq/publisher/listJs.jsp
  48. 9 5
      patient-co-manage/redis-cache/src/main/webapp/WEB-INF/views/redis/mq/subscriber/detailJs.jsp
  49. 1 3
      patient-co-manage/redis-cache/src/main/webapp/WEB-INF/views/redis/mq/subscriber/listJs.jsp
  50. 25 1
      patient-co-manage/redis-cache/src/main/webapp/static/develop/module/util.js
  51. BIN
      patient-co/patient-co-wlyy/doc/接口文档/~$i健康API文档.docx
  52. BIN
      patient-co/patient-co-wlyy/doc/接口文档/对外接口文档/集美健康教育/~$健康教育对外接口文档(11).docx
  53. BIN
      patient-co/patient-co-wlyy/doc/接口文档/对外接口文档/集美健康教育/~$健康教育对外接口文档.docx
  54. 1 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prenatalInspector/PrenatalInspectorPreCardService.java

+ 3 - 8
patient-co-manage/redis-cache/pom.xml

@ -10,7 +10,7 @@
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>1.3.5.RELEASE</version>
        <version>1.3.8.RELEASE</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>
    <properties>
@ -251,20 +251,15 @@
        </dependency>
    </dependencies>
    <build>
        <finalName>redis-cache</finalName>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin </artifactId>
            </plugin>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
            </plugin>
        </plugins>
    </build>
</project>

+ 11 - 61
patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/common/constants/ServiceApi.java

@ -19,69 +19,14 @@ public class ServiceApi {
     */
    public static class Redis {
        //初始化缓存
        public static final String InitAddress = "/redis/init/address";
        public static final String InitHealthProblem = "/redis/init/healthProblem";
        public static final String InitIcd10HpR = "/redis/init/icd10HpR";
        public static final String InitIcd10 = "/redis/init/icd10";
        public static final String InitIndicatorsDict = "/redis/init/indicatorsDict";
        public static final String InitOrgName = "/redis/init/orgName";
        public static final String InitOrgArea = "/redis/init/orgArea";
        public static final String InitOrgSaasArea = "/redis/init/orgSaasArea";
        public static final String InitOrgSaasOrg = "/redis/init/orgSaasOrg";
        public static final String InitVersions = "/redis/init/versions";
        public static final String InitRsAdapterDict = "/redis/init/rsAdapterDict/{id}";
        public static final String InitRsAdapterMeta = "/redis/init/rsAdapterMeta/{id}";
        public static final String InitRsMetadata = "/redis/init/rsMetadata";
        //清除缓存
        public static final String Delete = "/redis/delete";
        //更新缓存
        public static final String UpdateOrgName = "/redis/update/orgName";
        public static final String UpdateOrgArea = "/redis/update/orgArea";
        public static final String UpdateOrgSaasArea = "/redis/update/orgSaasArea";
        public static final String UpdateOrgSaasOrg = "/redis/update/orgSaasOrg";
        //获取缓存数据
        public static final String Address = "/redis/address";
        public static final String HealthProblem = "/redis/healthProblem";
        public static final String Icd10HpR = "/redis/icd10HpRelation";
        public static final String Icd10Name = "/redis/icd10Name";
        public static final String Icd10HpCode = "/redis/icd10HpCode";
        public static final String IndicatorsDict = "/redis/indicatorsDict";
        public static final String OrgName = "/redis/orgName";
        public static final String OrgArea = "/redis/orgArea";
        public static final String OrgSaasArea = "/redis/orgSaasArea";
        public static final String OrgSaasOrg = "/redis/orgSaasOrg";
        //App前端Redis
        public static final String AppGetRedisValue = "/redis/getAppClientValue";
        public static final String AppSetRedisValue = "/redis/setAppClientValue";
        public static final String AppSetRedisJsonValue = "/redis/setAppClientJsonValue";
        public static final String AppDeleteRedisValue = "/redis/deleteAppClientValue";
        //资源化相关Redis
        public static final String RsAdapterDict = "/redis/rsAdapterDict";
        public static final String RsAdapterMetadata = "/redis/rsAdapterMetaData";
        public static final String RsMetadata = "/redis/rsMetadata";
        //标准相关Redis
        public static final String StdVersion = "/redis/stdVersion";
        public static final String StdDataSetCode = "/redis/stdDataSetCode";
        public static final String StdDataSetName = "/redis/stdDataSetName";
        public static final String StdDataSetNameByCode = "/redis/stdDataSetNameByCode";
        public static final String StdDataSetMultiRecord = "/redis/stdDataSetMultiRecord";
        public static final String StdMetadataType = "/redis/stdMetaDataType";
        public static final String StdMetadataDict = "/redis/stdMetaDataDict";
        public static final String StdDictEntryValue = "/redis/stdDictEntryValue";
        // Redis消息队列
        public static class MqChannel {
            public static final String Prefix = "/redis/mq/channel/";
            public static final String GetById = "/redis/mq/channel/{id}";
            public static final String GetById = "/redis/mq/channel/detail";
            public static final String Search = "/redis/mq/channel/search";
            public static final String Save = "/redis/mq/channel/save";
            public static final String Update = "/redis/mq/channel/update";
            public static final String Delete = "/redis/mq/channel/delete";
            public static final String IsUniqueChannel = "/redis/mq/channel/isUniqueChannel";
            public static final String IsUniqueChannelName = "/redis/mq/channel/isUniqueChannelName";
@ -90,9 +35,10 @@ public class ServiceApi {
        // Redis消息订阅者
        public static class MqSubscriber {
            public static final String Prefix = "/redis/mq/subscriber/";
            public static final String GetById = "/redis/mq/subscriber/{id}";
            public static final String GetById = "/redis/mq/subscriber/detail";
            public static final String Search = "/redis/mq/subscriber/search";
            public static final String Save = "/redis/mq/subscriber/save";
            public static final String Update = "/redis/mq/subscriber/update";
            public static final String Delete = "/redis/mq/subscriber/delete";
            public static final String IsUniqueAppId = "/redis/mq/subscriber/isUniqueAppId";
            public static final String IsUniqueSubscribedUrl = "/redis/mq/subscriber/isUniqueSubscribedUrl";
@ -103,16 +49,18 @@ public class ServiceApi {
            public static final String GetById = "/redis/mq/publisher/{id}";
            public static final String Search = "/redis/mq/publisher/search";
            public static final String Save = "/redis/mq/publisher/save";
            public static final String Update = "/redis/mq/publisher/update";
            public static final String Delete = "/redis/mq/publisher/delete";
            public static final String IsUniqueAppId = "/redis/mq/publisher/isUniqueAppId";
        }
        // 缓存分类
        public static class CacheCategory {
            public static final String Prefix = "/redis/cache/category/";
            public static final String GetById = "/redis/cache/category/{id}";
            public static final String GetById = "/redis/cache/category/detail";
            public static final String Search = "/redis/cache/category/search";
            public static final String SearchNoPage = "/redis/cache/category/searchNoPage";
            public static final String Save = "/redis/cache/category/save";
            public static final String Update = "/redis/cache/category/update";
            public static final String Delete = "/redis/cache/category/delete";
            public static final String IsUniqueName = "/redis/cache/category/isUniqueName";
            public static final String IsUniqueCode = "/redis/cache/category/isUniqueCode";
@ -120,18 +68,20 @@ public class ServiceApi {
        // 缓存授权
        public static class CacheAuthorization {
            public static final String Prefix = "/redis/cache/authorization/";
            public static final String GetById = "/redis/cache/authorization/{id}";
            public static final String GetById = "/redis/cache/authorization/detail";
            public static final String Search = "/redis/cache/authorization/search";
            public static final String Save = "/redis/cache/authorization/save";
            public static final String Update = "/redis/cache/authorization/update";
            public static final String Delete = "/redis/cache/authorization/delete";
            public static final String IsUniqueAppId = "/redis/cache/authorization/isUniqueAppId";
        }
        // 缓存Key规则
        public static class CacheKeyRule {
            public static final String Prefix = "/redis/cache/keyRule/";
            public static final String GetById = "/redis/cache/keyRule/{id}";
            public static final String GetById = "/redis/cache/keyRule/detail";
            public static final String Search = "/redis/cache/keyRule/search";
            public static final String Save = "/redis/cache/keyRule/save";
            public static final String Update = "/redis/cache/keyRule/update";
            public static final String Delete = "/redis/cache/keyRule/delete";
            public static final String IsUniqueName = "/redis/cache/keyRule/isUniqueName";
            public static final String IsUniqueCode = "/redis/cache/keyRule/isUniqueCode";

+ 5 - 0
patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/common/controller/EnvelopRestEndPoint.java

@ -4,8 +4,10 @@ package com.yihu.wlyy.common.controller;
import com.yihu.wlyy.common.constants.BizObject;
import com.yihu.wlyy.common.util.ObjectId;
import com.yihu.wlyy.util.Envelop;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
/**
@ -24,6 +26,9 @@ public class EnvelopRestEndPoint extends BaseRestEndPoint {
    @Value("${deploy.region}")
    Short deployRegion = 3502;
    @Autowired
    protected HttpServletRequest request;
    /**
     * 返回一个信封对象。信封对象的返回场景参见 Envelop.
     *

+ 3 - 3
patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/common/vo/MRedisCacheCategory.java

@ -14,7 +14,7 @@ import java.util.Date;
 */
public class MRedisCacheCategory implements Serializable{
    public Integer id; // 主键
    public Long id; // 主键
    private String name; // 缓存分类名称
    private String code; // 缓存分类编码
    private String remark; // 备注
@ -23,11 +23,11 @@ public class MRedisCacheCategory implements Serializable{
    private Date modifyDate; // 修改时间
    private String modifier; // 修改者
    public Integer getId() {
    public Long getId() {
        return id;
    }
    public void setId(Integer id) {
    public void setId(Long id) {
        this.id = id;
    }

+ 43 - 24
patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/controller/redis/RedisCacheAuthorizationEndPoint.java

@ -5,16 +5,22 @@ import com.yihu.wlyy.common.constants.ApiVersion;
import com.yihu.wlyy.common.constants.ServiceApi;
import com.yihu.wlyy.common.controller.EnvelopRestEndPoint;
import com.yihu.wlyy.common.vo.MRedisCacheAuthorization;
import com.yihu.wlyy.common.vo.MRedisCacheCategory;
import com.yihu.wlyy.entity.User;
import com.yihu.wlyy.entity.redis.RedisCacheAuthorization;
import com.yihu.wlyy.service.redis.cache.RedisCacheAuthorizationService;
import com.yihu.wlyy.util.Envelop;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
@ -23,7 +29,7 @@ import java.util.List;
 * @author 张进军
 * @date 2017/11/23 11:28
 */
@RestController
@Controller
@RequestMapping(value = ApiVersion.Version1_0)
@Api(description = "缓存授权接口", tags = {"缓存服务管理--缓存授权接口"})
public class RedisCacheAuthorizationEndPoint extends EnvelopRestEndPoint {
@ -33,30 +39,31 @@ public class RedisCacheAuthorizationEndPoint extends EnvelopRestEndPoint {
    @ApiOperation("根据ID获取缓存授权")
    @RequestMapping(value = ServiceApi.Redis.CacheAuthorization.GetById, method = RequestMethod.GET)
    public Envelop getById(
            @ApiParam(name = "id", value = "主键", required = true)
            @PathVariable(value = "id") Integer id) {
        Envelop envelop = new Envelop();
        envelop.setSuccessFlg(false);
    public String getById(Model model, Long id) {
        try {
            MRedisCacheAuthorization mRedisCacheAuthorization = convertToModel(redisCacheAuthorizationService.getById(id), MRedisCacheAuthorization.class);
            envelop.setObj(mRedisCacheAuthorization);
            envelop.setSuccessFlg(true);
            envelop.setErrorMsg("成功获取缓存授权。");
            if(id!=null){
                MRedisCacheAuthorization mRedisCacheAuthorization = convertToModel(redisCacheAuthorizationService.getById(id), MRedisCacheAuthorization.class);
                model.addAttribute("detailModel", toJson(mRedisCacheAuthorization));
            }else {
                Object detailModel = new MRedisCacheCategory();
                model.addAttribute("detailModel", toJson(detailModel));
            }
        } catch (Exception e) {
            e.printStackTrace();
            envelop.setErrorMsg("获取缓存授权发生异常:" + e.getMessage());
        }
        return envelop;
        return "redis/cache/authorization/detail";
    }
    @ApiOperation(value = "根据条件获取缓存授权")
    @ResponseBody
    @RequestMapping(value = ServiceApi.Redis.CacheAuthorization.Search, method = RequestMethod.GET)
    public Envelop search(
            @ApiParam(name = "fields", value = "返回的字段,为空则返回全部字段")
            @RequestParam(value = "fields", required = false) String fields,
            @ApiParam(name = "filters", value = "筛选条件")
            @RequestParam(value = "filters", required = false) String filters,
            @RequestParam(value = "filters", required = false) String searchContent,
            @ApiParam(name = "categoryCode", value = "类别")
            @RequestParam(value = "categoryCode", required = false) String categoryCode,
            @ApiParam(name = "sorts", value = "排序")
            @RequestParam(value = "sorts", required = false) String sorts,
            @ApiParam(name = "page", value = "页码", defaultValue = "1")
@ -66,6 +73,10 @@ public class RedisCacheAuthorizationEndPoint extends EnvelopRestEndPoint {
        Envelop envelop = new Envelop();
        envelop.setSuccessFlg(false);
        try {
            String filters = "categoryCode=" + categoryCode + ";";
            if (!StringUtils.isEmpty(searchContent)) {
                filters = "appId?" + searchContent + ";";
            }
            List<RedisCacheAuthorization> redisCacheAuthorization = redisCacheAuthorizationService.search(fields, filters, sorts, page, rows);
            int count = (int) redisCacheAuthorizationService.getCount(filters);
            List<MRedisCacheAuthorization> mRedisCacheAuthorization = (List<MRedisCacheAuthorization>) convertToModels(redisCacheAuthorization, new ArrayList<MRedisCacheAuthorization>(), MRedisCacheAuthorization.class, fields);
@ -80,14 +91,18 @@ public class RedisCacheAuthorizationEndPoint extends EnvelopRestEndPoint {
    }
    @ApiOperation("新增缓存授权")
    @ResponseBody
    @RequestMapping(value = ServiceApi.Redis.CacheAuthorization.Save, method = RequestMethod.POST)
    public Envelop add(
            @ApiParam(value = "缓存授权JSON", required = true)
            @RequestBody String entityJson) {
    public Envelop add(String data) {
        Envelop envelop = new Envelop();
        envelop.setSuccessFlg(false);
        try {
            RedisCacheAuthorization newEntity = objectMapper.readValue(entityJson, RedisCacheAuthorization.class);
            RedisCacheAuthorization newEntity = objectMapper.readValue(data, RedisCacheAuthorization.class);
            User currentUser = (User) request.getSession().getAttribute("current_user");
            newEntity.setCreator(currentUser.getCode());
            newEntity.setCreateDate(new Date());
            newEntity.setModifyDate(new Date());
            newEntity.setModifier(currentUser.getCode());
            newEntity = redisCacheAuthorizationService.save(newEntity);
            MRedisCacheAuthorization mRedisCacheAuthorization = convertToModel(newEntity, MRedisCacheAuthorization.class);
@ -102,14 +117,16 @@ public class RedisCacheAuthorizationEndPoint extends EnvelopRestEndPoint {
    }
    @ApiOperation("更新缓存授权")
    @RequestMapping(value = ServiceApi.Redis.CacheAuthorization.Save, method = RequestMethod.PUT)
    public Envelop update(
            @ApiParam(value = "缓存授权JSON", required = true)
            @RequestBody String entityJson) {
    @ResponseBody
    @RequestMapping(value = ServiceApi.Redis.CacheAuthorization.Update, method = RequestMethod.POST)
    public Envelop update(String data) {
        Envelop envelop = new Envelop();
        envelop.setSuccessFlg(false);
        try {
            RedisCacheAuthorization updateEntity = objectMapper.readValue(entityJson, RedisCacheAuthorization.class);
            RedisCacheAuthorization updateEntity = objectMapper.readValue(data, RedisCacheAuthorization.class);
            User currentUser = (User) request.getSession().getAttribute("current_user");
            updateEntity.setModifyDate(new Date());
            updateEntity.setModifier(currentUser.getCode());
            updateEntity = redisCacheAuthorizationService.save(updateEntity);
            MRedisCacheAuthorization mRedisCacheAuthorization = convertToModel(updateEntity, MRedisCacheAuthorization.class);
@ -124,10 +141,11 @@ public class RedisCacheAuthorizationEndPoint extends EnvelopRestEndPoint {
    }
    @ApiOperation("删除缓存授权")
    @ResponseBody
    @RequestMapping(value = ServiceApi.Redis.CacheAuthorization.Delete, method = RequestMethod.DELETE)
    public Envelop delete(
            @ApiParam(name = "id", value = "缓存授权ID", required = true)
            @RequestParam(value = "id") Integer id) {
            @RequestParam(value = "id") Long id) {
        Envelop envelop = new Envelop();
        envelop.setSuccessFlg(false);
        try {
@ -143,10 +161,11 @@ public class RedisCacheAuthorizationEndPoint extends EnvelopRestEndPoint {
    }
    @ApiOperation("验证指定缓存分类下应用ID是否唯一")
    @ResponseBody
    @RequestMapping(value = ServiceApi.Redis.CacheAuthorization.IsUniqueAppId, method = RequestMethod.GET)
    public Envelop isUniqueAppId(
            @ApiParam(name = "id", value = "缓存授权ID", required = true)
            @RequestParam(value = "id") Integer id,
            @RequestParam(value = "id") Long id,
            @ApiParam(name = "categoryCode", value = "缓存分类编码", required = true)
            @RequestParam(value = "categoryCode") String categoryCode,
            @ApiParam(name = "appId", value = "应用ID", required = true)

+ 40 - 24
patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/controller/redis/RedisCacheCategoryEndPoint.java

@ -5,6 +5,7 @@ import com.yihu.wlyy.common.constants.ApiVersion;
import com.yihu.wlyy.common.constants.ServiceApi;
import com.yihu.wlyy.common.controller.EnvelopRestEndPoint;
import com.yihu.wlyy.common.vo.MRedisCacheCategory;
import com.yihu.wlyy.entity.User;
import com.yihu.wlyy.entity.redis.RedisCacheCategory;
import com.yihu.wlyy.service.redis.cache.RedisCacheCategoryService;
import com.yihu.wlyy.util.Envelop;
@ -13,9 +14,15 @@ import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
@ -24,7 +31,7 @@ import java.util.List;
 * @author 张进军
 * @date 2017/11/23 11:28
 */
@RestController
@Controller
@RequestMapping(value = ApiVersion.Version1_0)
@Api(description = "缓存分类接口", tags = {"缓存服务管理--缓存分类接口"})
public class RedisCacheCategoryEndPoint extends EnvelopRestEndPoint {
@ -34,24 +41,23 @@ public class RedisCacheCategoryEndPoint extends EnvelopRestEndPoint {
    @ApiOperation("根据ID获取缓存分类")
    @RequestMapping(value = ServiceApi.Redis.CacheCategory.GetById, method = RequestMethod.GET)
    public Envelop getById(
            @ApiParam(name = "id", value = "主键", required = true)
            @PathVariable(value = "id") Integer id) {
        Envelop envelop = new Envelop();
        envelop.setSuccessFlg(false);
    public String getById(Model model, Long id) {
        try {
            MRedisCacheCategory mRedisCacheCategory = convertToModel(redisCacheCategoryService.getById(id), MRedisCacheCategory.class);
            envelop.setObj(mRedisCacheCategory);
            envelop.setSuccessFlg(true);
            envelop.setErrorMsg("成功获取缓存分类。");
            if(id!=null){
                MRedisCacheCategory mRedisCacheCategory = convertToModel(redisCacheCategoryService.getById(id), MRedisCacheCategory.class);
                model.addAttribute("detailModel", toJson(mRedisCacheCategory));
            }else {
                Object detailModel = new MRedisCacheCategory();
                model.addAttribute("detailModel", toJson(detailModel));
            }
        } catch (Exception e) {
            e.printStackTrace();
            envelop.setErrorMsg("获取缓存分类发生异常:" + e.getMessage());
        }
        return envelop;
        return "redis/cache/category/detail";
    }
    @ApiOperation(value = "根据条件获取缓存分类")
    @ResponseBody
    @RequestMapping(value = ServiceApi.Redis.CacheCategory.Search, method = RequestMethod.GET)
    public Envelop search(
            @ApiParam(name = "fields", value = "返回的字段,为空则返回全部字段")
@ -85,6 +91,7 @@ public class RedisCacheCategoryEndPoint extends EnvelopRestEndPoint {
    }
    @ApiOperation(value = "根据条件获取缓存分类(不分页)")
    @ResponseBody
    @RequestMapping(value = ServiceApi.Redis.CacheCategory.SearchNoPage, method = RequestMethod.GET)
    public Envelop searchNoPage(
            @ApiParam(name = "filters", value = "筛选条件")
@ -106,14 +113,18 @@ public class RedisCacheCategoryEndPoint extends EnvelopRestEndPoint {
    }
    @ApiOperation("新增缓存分类")
    @ResponseBody
    @RequestMapping(value = ServiceApi.Redis.CacheCategory.Save, method = RequestMethod.POST)
    public Envelop add(
            @ApiParam(value = "缓存分类JSON", required = true)
            @RequestBody String entityJson) {
    public Envelop add(String data) {
        Envelop envelop = new Envelop();
        envelop.setSuccessFlg(false);
        try {
            RedisCacheCategory newEntity = objectMapper.readValue(entityJson, RedisCacheCategory.class);
            RedisCacheCategory newEntity = objectMapper.readValue(data, RedisCacheCategory.class);
            User currentUser = (User) request.getSession().getAttribute("current_user");
            newEntity.setCreator(currentUser.getCode());
            newEntity.setCreateDate(new Date());
            newEntity.setModifyDate(new Date());
            newEntity.setModifier(currentUser.getCode());
            newEntity = redisCacheCategoryService.save(newEntity);
            MRedisCacheCategory mRedisCacheCategory = convertToModel(newEntity, MRedisCacheCategory.class);
@ -128,14 +139,16 @@ public class RedisCacheCategoryEndPoint extends EnvelopRestEndPoint {
    }
    @ApiOperation("更新缓存分类")
    @RequestMapping(value = ServiceApi.Redis.CacheCategory.Save, method = RequestMethod.PUT)
    public Envelop update(
            @ApiParam(value = "缓存分类JSON", required = true)
            @RequestBody String entityJson) {
    @ResponseBody
    @RequestMapping(value = ServiceApi.Redis.CacheCategory.Update, method = RequestMethod.POST)
    public Envelop update(String data) {
        Envelop envelop = new Envelop();
        envelop.setSuccessFlg(false);
        try {
            RedisCacheCategory updateEntity = objectMapper.readValue(entityJson, RedisCacheCategory.class);
            RedisCacheCategory updateEntity = objectMapper.readValue(data, RedisCacheCategory.class);
            User currentUser = (User) request.getSession().getAttribute("current_user");
            updateEntity.setModifyDate(new Date());
            updateEntity.setModifier(currentUser.getCode());
            updateEntity = redisCacheCategoryService.save(updateEntity);
            MRedisCacheCategory mRedisCacheCategory = convertToModel(updateEntity, MRedisCacheCategory.class);
@ -150,6 +163,7 @@ public class RedisCacheCategoryEndPoint extends EnvelopRestEndPoint {
    }
    @ApiOperation("删除缓存分类")
    @ResponseBody
    @RequestMapping(value = ServiceApi.Redis.CacheCategory.Delete, method = RequestMethod.DELETE)
    public Envelop delete(
            @ApiParam(name = "id", value = "缓存分类ID", required = true)
@ -169,10 +183,11 @@ public class RedisCacheCategoryEndPoint extends EnvelopRestEndPoint {
    }
    @ApiOperation("验证缓存分类名称是否唯一")
    @ResponseBody
    @RequestMapping(value = ServiceApi.Redis.CacheCategory.IsUniqueName, method = RequestMethod.GET)
    public Envelop isUniqueName(
            @ApiParam(name = "id", value = "缓存分类ID", required = true)
            @RequestParam(value = "id") Integer id,
            @RequestParam(value = "id") Long id,
            @ApiParam(name = "name", value = "缓存分类名称", required = true)
            @RequestParam(value = "name") String name) {
        Envelop envelop = new Envelop();
@ -191,10 +206,11 @@ public class RedisCacheCategoryEndPoint extends EnvelopRestEndPoint {
    }
    @ApiOperation("验证缓存分类编码是否唯一")
    @ResponseBody
    @RequestMapping(value = ServiceApi.Redis.CacheCategory.IsUniqueCode, method = RequestMethod.GET)
    public Envelop isUniqueCode(
            @ApiParam(name = "id", value = "缓存分类ID", required = true)
            @RequestParam(value = "id") Integer id,
            @RequestParam(value = "id") Long id,
            @ApiParam(name = "code", value = "缓存分类编码", required = true)
            @RequestParam(value = "code") String code) {
        Envelop envelop = new Envelop();

+ 26 - 19
patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/controller/redis/RedisCacheKeyRuleEndPoint.java

@ -4,6 +4,7 @@ package com.yihu.wlyy.controller.redis;
import com.yihu.wlyy.common.constants.ApiVersion;
import com.yihu.wlyy.common.constants.ServiceApi;
import com.yihu.wlyy.common.controller.EnvelopRestEndPoint;
import com.yihu.wlyy.common.vo.MRedisCacheCategory;
import com.yihu.wlyy.common.vo.MRedisCacheKeyRule;
import com.yihu.wlyy.entity.redis.RedisCacheKeyRule;
import com.yihu.wlyy.service.redis.cache.RedisCacheKeyRuleService;
@ -12,6 +13,8 @@ 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.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
@ -23,7 +26,7 @@ import java.util.List;
 * @author 张进军
 * @date 2017/11/23 11:28
 */
@RestController
@Controller
@RequestMapping(value = ApiVersion.Version1_0)
@Api(description = "缓存Key规则接口", tags = {"缓存服务管理--缓存Key规则接口"})
public class RedisCacheKeyRuleEndPoint extends EnvelopRestEndPoint {
@ -33,30 +36,29 @@ public class RedisCacheKeyRuleEndPoint extends EnvelopRestEndPoint {
    @ApiOperation("根据ID获取缓存Key规则")
    @RequestMapping(value = ServiceApi.Redis.CacheKeyRule.GetById, method = RequestMethod.GET)
    public Envelop getById(
            @ApiParam(name = "id", value = "主键", required = true)
            @PathVariable(value = "id") Integer id) {
        Envelop envelop = new Envelop();
        envelop.setSuccessFlg(false);
    public String getById(Model model, Long id) {
        try {
            MRedisCacheKeyRule mRedisCacheKeyRule = convertToModel(redisCacheKeyRuleService.getById(id), MRedisCacheKeyRule.class);
            envelop.setObj(mRedisCacheKeyRule);
            envelop.setSuccessFlg(true);
            envelop.setErrorMsg("成功获取缓存Key规则。");
            if(id!=null){
                MRedisCacheKeyRule mRedisCacheKeyRule = convertToModel(redisCacheKeyRuleService.getById(id), MRedisCacheKeyRule.class);
                model.addAttribute("detailModel", toJson(mRedisCacheKeyRule));
            }else {
                Object detailModel = new MRedisCacheCategory();
                model.addAttribute("detailModel", toJson(detailModel));
            }
        } catch (Exception e) {
            e.printStackTrace();
            envelop.setErrorMsg("获取缓存Key规则发生异常:" + e.getMessage());
        }
        return envelop;
        return "redis/cache/cache/detail";
    }
    @ApiOperation(value = "根据条件获取缓存Key规则")
    @ResponseBody
    @RequestMapping(value = ServiceApi.Redis.CacheKeyRule.Search, method = RequestMethod.GET)
    public Envelop search(
            @ApiParam(name = "fields", value = "返回的字段,为空则返回全部字段")
            @RequestParam(value = "fields", required = false) String fields,
            @ApiParam(name = "filters", value = "筛选条件")
            @RequestParam(value = "filters", required = false) String filters,
            @ApiParam(name = "searchContent", value = "筛选条件")
            @RequestParam(value = "searchContent", required = false) String searchContent,
            @ApiParam(name = "sorts", value = "排序")
            @RequestParam(value = "sorts", required = false) String sorts,
            @ApiParam(name = "page", value = "页码", defaultValue = "1")
@ -66,8 +68,8 @@ public class RedisCacheKeyRuleEndPoint extends EnvelopRestEndPoint {
        Envelop envelop = new Envelop();
        envelop.setSuccessFlg(false);
        try {
            List<RedisCacheKeyRule> redisCacheKeyRuleList = redisCacheKeyRuleService.search(fields, filters, sorts, page, rows);
            int count = (int) redisCacheKeyRuleService.getCount(filters);
            List<RedisCacheKeyRule> redisCacheKeyRuleList = redisCacheKeyRuleService.search(fields, searchContent, sorts, page, rows);
            int count = (int) redisCacheKeyRuleService.getCount(searchContent);
            List<MRedisCacheKeyRule> mRedisCacheKeyRule = (List<MRedisCacheKeyRule>) convertToModels(redisCacheKeyRuleList, new ArrayList<MRedisCacheKeyRule>(), MRedisCacheKeyRule.class, fields);
            envelop = getPageResult(mRedisCacheKeyRule, count, page, rows);
            envelop.setSuccessFlg(true);
@ -80,6 +82,7 @@ public class RedisCacheKeyRuleEndPoint extends EnvelopRestEndPoint {
    }
    @ApiOperation("新增缓存Key规则")
    @ResponseBody
    @RequestMapping(value = ServiceApi.Redis.CacheKeyRule.Save, method = RequestMethod.POST)
    public Envelop add(
            @ApiParam(value = "缓存Key规则JSON", required = true)
@ -102,7 +105,8 @@ public class RedisCacheKeyRuleEndPoint extends EnvelopRestEndPoint {
    }
    @ApiOperation("更新缓存Key规则")
    @RequestMapping(value = ServiceApi.Redis.CacheKeyRule.Save, method = RequestMethod.PUT)
    @ResponseBody
    @RequestMapping(value = ServiceApi.Redis.CacheKeyRule.Update, method = RequestMethod.POST)
    public Envelop update(
            @ApiParam(value = "缓存Key规则JSON", required = true)
            @RequestBody String entityJson) {
@ -124,6 +128,7 @@ public class RedisCacheKeyRuleEndPoint extends EnvelopRestEndPoint {
    }
    @ApiOperation("删除缓存Key规则")
    @ResponseBody
    @RequestMapping(value = ServiceApi.Redis.CacheKeyRule.Delete, method = RequestMethod.DELETE)
    public Envelop delete(
            @ApiParam(name = "id", value = "缓存Key规则ID", required = true)
@ -143,10 +148,11 @@ public class RedisCacheKeyRuleEndPoint extends EnvelopRestEndPoint {
    }
    @ApiOperation("验证缓存Key规则名称是否唯一")
    @ResponseBody
    @RequestMapping(value = ServiceApi.Redis.CacheKeyRule.IsUniqueName, method = RequestMethod.GET)
    public Envelop isUniqueName(
            @ApiParam(name = "id", value = "缓存Key规则ID", required = true)
            @RequestParam(value = "id") Integer id,
            @RequestParam(value = "id") Long id,
            @ApiParam(name = "name", value = "缓存Key规则名称", required = true)
            @RequestParam(value = "name") String name) {
        Envelop envelop = new Envelop();
@ -165,10 +171,11 @@ public class RedisCacheKeyRuleEndPoint extends EnvelopRestEndPoint {
    }
    @ApiOperation("验证缓存Key规则编码是否唯一")
    @ResponseBody
    @RequestMapping(value = ServiceApi.Redis.CacheKeyRule.IsUniqueCode, method = RequestMethod.GET)
    public Envelop isUniqueCode(
            @ApiParam(name = "id", value = "缓存Key规则ID", required = true)
            @RequestParam(value = "id") Integer id,
            @RequestParam(value = "id") Long id,
            @ApiParam(name = "code", value = "缓存Key规则编码", required = true)
            @RequestParam(value = "code") String code) {
        Envelop envelop = new Envelop();

+ 2 - 2
patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/controller/redis/RedisCacheOperationEndPoint.java

@ -16,10 +16,10 @@ import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.ValueOperations;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
@ -29,7 +29,7 @@ import javax.annotation.Resource;
 * @author 张进军
 * @date 2017/11/23 15:09
 */
@RestController
@Controller
@RequestMapping(value = ApiVersion.Version1_0)
@Api(description = "缓存操作接口", tags = {"缓存服务管理--缓存操作接口"})
public class RedisCacheOperationEndPoint extends EnvelopRestEndPoint {

+ 2 - 2
patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/controller/redis/RedisCacheStatisticsEndPoint.java

@ -16,9 +16,9 @@ import org.springframework.dao.DataAccessException;
import org.springframework.data.redis.connection.RedisConnection;
import org.springframework.data.redis.core.RedisCallback;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.ArrayList;
@ -32,7 +32,7 @@ import java.util.Map;
 * @author 张进军
 * @date 2017/11/30 17:07
 */
@RestController
@Controller
@RequestMapping(value = ApiVersion.Version1_0)
@Api(description = "缓存统计接口", tags = {"缓存服务管理--缓存统计接口"})
public class RedisCacheStatisticsEndPoint extends EnvelopRestEndPoint {

+ 41 - 28
patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/controller/redis/RedisMqChannelEndPoint.java

@ -6,6 +6,7 @@ import com.yihu.wlyy.common.constants.ServiceApi;
import com.yihu.wlyy.common.controller.EnvelopRestEndPoint;
import com.yihu.wlyy.common.vo.MRedisCacheCategory;
import com.yihu.wlyy.common.vo.MRedisMqChannel;
import com.yihu.wlyy.entity.User;
import com.yihu.wlyy.entity.redis.RedisMqChannel;
import com.yihu.wlyy.entity.redis.RedisMqMessageLog;
import com.yihu.wlyy.entity.redis.RedisMqSubscriber;
@ -23,10 +24,13 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.listener.ChannelTopic;
import org.springframework.data.redis.listener.RedisMessageListenerContainer;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
@ -35,7 +39,7 @@ import java.util.List;
 * @author 张进军
 * @date 2017/11/10 11:45
 */
@RestController
@Controller
@RequestMapping(value = ApiVersion.Version1_0)
@Api(description = "消息队列接口", tags = {"Redis消息发布订阅--消息队列接口"})
public class RedisMqChannelEndPoint extends EnvelopRestEndPoint {
@ -55,30 +59,29 @@ public class RedisMqChannelEndPoint extends EnvelopRestEndPoint {
    @ApiOperation("根据ID获取消息队列")
    @RequestMapping(value = ServiceApi.Redis.MqChannel.GetById, method = RequestMethod.GET)
    public Envelop getById(
            @ApiParam(name = "id", value = "主键", required = true)
            @PathVariable(value = "id") Integer id) {
        Envelop envelop = new Envelop();
        envelop.setSuccessFlg(false);
    public String getById(Model model, Long id) {
        try {
            MRedisMqChannel mRedisMqChannel = convertToModel(redisMqChannelService.getById(id), MRedisMqChannel.class);
            envelop.setObj(mRedisMqChannel);
            envelop.setSuccessFlg(true);
            envelop.setErrorMsg("成功获取消息队列。");
            if(id!=null){
                MRedisMqChannel mRedisMqChannel = convertToModel(redisMqChannelService.getById(id), MRedisMqChannel.class);
                model.addAttribute("detailModel", toJson(mRedisMqChannel));
            }else {
                Object detailModel = new MRedisCacheCategory();
                model.addAttribute("detailModel", toJson(detailModel));
            }
        } catch (Exception e) {
            e.printStackTrace();
            envelop.setErrorMsg("获取消息队列发生异常:" + e.getMessage());
        }
        return envelop;
        return "redis/mq/channel/detail";
    }
    @ApiOperation(value = "根据条件获取消息队列")
    @ResponseBody
    @RequestMapping(value = ServiceApi.Redis.MqChannel.Search, method = RequestMethod.GET)
    public Envelop search(
            @ApiParam(name = "fields", value = "返回的字段,为空则返回全部字段")
            @RequestParam(value = "fields", required = false) String fields,
            @ApiParam(name = "filters", value = "筛选条件")
            @RequestParam(value = "filters", required = false) String filters,
            @ApiParam(name = "searchContent", value = "筛选条件")
            @RequestParam(value = "searchContent", required = false) String searchContent,
            @ApiParam(name = "sorts", value = "排序")
            @RequestParam(value = "sorts", required = false) String sorts,
            @ApiParam(name = "page", value = "页码", defaultValue = "1")
@ -88,8 +91,8 @@ public class RedisMqChannelEndPoint extends EnvelopRestEndPoint {
        Envelop envelop = new Envelop();
        envelop.setSuccessFlg(false);
        try {
            List<RedisMqChannel> redisMqChannelList = redisMqChannelService.search(fields, filters, sorts, page, rows);
            int count = (int) redisMqChannelService.getCount(filters);
            List<RedisMqChannel> redisMqChannelList = redisMqChannelService.search(fields, searchContent, sorts, page, rows);
            int count = (int) redisMqChannelService.getCount(searchContent);
            List<MRedisMqChannel> mRedisMqChannelList = (List<MRedisMqChannel>) convertToModels(redisMqChannelList, new ArrayList<MRedisMqChannel>(), MRedisMqChannel.class, fields);
            envelop = getPageResult(mRedisMqChannelList, count, page, rows);
            envelop.setSuccessFlg(true);
@ -102,14 +105,18 @@ public class RedisMqChannelEndPoint extends EnvelopRestEndPoint {
    }
    @ApiOperation("新增消息队列")
    @ResponseBody
    @RequestMapping(value = ServiceApi.Redis.MqChannel.Save, method = RequestMethod.POST)
    public Envelop add(
            @ApiParam(value = "消息队列JSON", required = true)
            @RequestBody String entityJson) {
    public Envelop add(String data) {
        Envelop envelop = new Envelop();
        envelop.setSuccessFlg(false);
        try {
            RedisMqChannel newEntity = objectMapper.readValue(entityJson, RedisMqChannel.class);
            RedisMqChannel newEntity = objectMapper.readValue(data, RedisMqChannel.class);
            User currentUser = (User) request.getSession().getAttribute("current_user");
            newEntity.setCreator(currentUser.getCode());
            newEntity.setCreateDate(new Date());
            newEntity.setModifyDate(new Date());
            newEntity.setModifier(currentUser.getCode());
            newEntity = redisMqChannelService.save(newEntity);
            // 开启该订阅者的消息队列的消息监听
@ -129,14 +136,16 @@ public class RedisMqChannelEndPoint extends EnvelopRestEndPoint {
    }
    @ApiOperation("更新消息队列")
    @RequestMapping(value = ServiceApi.Redis.MqChannel.Save, method = RequestMethod.PUT)
    public Envelop update(
            @ApiParam(value = "消息队列JSON", required = true)
            @RequestBody String entityJson) {
    @ResponseBody
    @RequestMapping(value = ServiceApi.Redis.MqChannel.Update, method = RequestMethod.POST)
    public Envelop update(String data) {
        Envelop envelop = new Envelop();
        envelop.setSuccessFlg(false);
        try {
            RedisMqChannel updateEntity = objectMapper.readValue(entityJson, RedisMqChannel.class);
            RedisMqChannel updateEntity = objectMapper.readValue(data, RedisMqChannel.class);
            User currentUser = (User) request.getSession().getAttribute("current_user");
            updateEntity.setModifyDate(new Date());
            updateEntity.setModifier(currentUser.getCode());
            updateEntity = redisMqChannelService.save(updateEntity);
            MRedisMqChannel mRedisMqChannel = convertToModel(updateEntity, MRedisMqChannel.class);
@ -151,10 +160,11 @@ public class RedisMqChannelEndPoint extends EnvelopRestEndPoint {
    }
    @ApiOperation("删除消息队列")
    @ResponseBody
    @RequestMapping(value = ServiceApi.Redis.MqChannel.Delete, method = RequestMethod.DELETE)
    public Envelop delete(
            @ApiParam(name = "id", value = "消息队列ID", required = true)
            @RequestParam(value = "id") Integer id) {
            @RequestParam(value = "id") Long id) {
        Envelop envelop = new Envelop();
        RedisMqChannel redisMqChannel = redisMqChannelService.getById(id);
        String channel = redisMqChannel.getChannel();
@ -183,10 +193,11 @@ public class RedisMqChannelEndPoint extends EnvelopRestEndPoint {
    }
    @ApiOperation("验证消息队列编码是否唯一")
    @ResponseBody
    @RequestMapping(value = ServiceApi.Redis.MqChannel.IsUniqueChannel, method = RequestMethod.GET)
    public Envelop isUniqueChannel(
            @ApiParam(name = "id", value = "消息队列ID", required = true)
            @RequestParam(value = "id") Integer id,
            @RequestParam(value = "id") Long id,
            @ApiParam(name = "channel", value = "消息队列编码", required = true)
            @RequestParam(value = "channel") String channel) {
        Envelop envelop = new Envelop();
@ -205,10 +216,11 @@ public class RedisMqChannelEndPoint extends EnvelopRestEndPoint {
    }
    @ApiOperation("验证消息队列名称是否唯一")
    @ResponseBody
    @RequestMapping(value = ServiceApi.Redis.MqChannel.IsUniqueChannelName, method = RequestMethod.GET)
    public Envelop isUniqueChannelName(
            @ApiParam(name = "id", value = "消息队列ID", required = true)
            @RequestParam(value = "id") Integer id,
            @RequestParam(value = "id") Long id,
            @ApiParam(name = "channelName", value = "消息队列名称", required = true)
            @RequestParam(value = "channelName") String channelName) {
        Envelop envelop = new Envelop();
@ -227,6 +239,7 @@ public class RedisMqChannelEndPoint extends EnvelopRestEndPoint {
    }
    @ApiOperation("发布消息")
    @ResponseBody
    @RequestMapping(value = ServiceApi.Redis.MqChannel.SendMessage, method = RequestMethod.POST)
    public Envelop sendMessage(
            @ApiParam(name = "publisherAppId", value = "发布者应用ID", required = true)

+ 38 - 26
patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/controller/redis/RedisMqPublisherEndPoint.java

@ -4,7 +4,9 @@ package com.yihu.wlyy.controller.redis;
import com.yihu.wlyy.common.constants.ApiVersion;
import com.yihu.wlyy.common.constants.ServiceApi;
import com.yihu.wlyy.common.controller.EnvelopRestEndPoint;
import com.yihu.wlyy.common.vo.MRedisCacheCategory;
import com.yihu.wlyy.common.vo.MRedisMqPublisher;
import com.yihu.wlyy.entity.User;
import com.yihu.wlyy.entity.redis.RedisMqPublisher;
import com.yihu.wlyy.service.redis.pubsub.RedisMqPublisherService;
import com.yihu.wlyy.util.Envelop;
@ -12,9 +14,12 @@ 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.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
@ -23,7 +28,7 @@ import java.util.List;
 * @author 张进军
 * @date 2017/11/20 09:35
 */
@RestController
@Controller
@RequestMapping(value = ApiVersion.Version1_0)
@Api(description = "消息发布者接口", tags = {"Redis消息发布订阅--消息发布者接口"})
public class RedisMqPublisherEndPoint extends EnvelopRestEndPoint {
@ -33,30 +38,29 @@ public class RedisMqPublisherEndPoint extends EnvelopRestEndPoint {
    @ApiOperation("根据ID获取消息发布者")
    @RequestMapping(value = ServiceApi.Redis.MqPublisher.GetById, method = RequestMethod.GET)
    public Envelop getById(
            @ApiParam(name = "id", value = "主键", required = true)
            @PathVariable(value = "id") Integer id) {
        Envelop envelop = new Envelop();
        envelop.setSuccessFlg(false);
    public String getById(Model model, Long id) {
        try {
            MRedisMqPublisher mRedisMqPublisher = convertToModel(redisMqPublisherService.getById(id), MRedisMqPublisher.class);
            envelop.setObj(mRedisMqPublisher);
            envelop.setSuccessFlg(true);
            envelop.setErrorMsg("成功获取消息发布者。");
            if(id!=null){
                MRedisMqPublisher mRedisMqPublisher = convertToModel(redisMqPublisherService.getById(id), MRedisMqPublisher.class);
                model.addAttribute("detailModel", toJson(mRedisMqPublisher));
            }else {
                Object detailModel = new MRedisCacheCategory();
                model.addAttribute("detailModel", toJson(detailModel));
            }
        } catch (Exception e) {
            e.printStackTrace();
            envelop.setErrorMsg("获取消息发布者发生异常:" + e.getMessage());
        }
        return envelop;
        return "redis/mq/publisher/detail";
    }
    @ApiOperation(value = "根据条件获取消息发布者")
    @ResponseBody
    @RequestMapping(value = ServiceApi.Redis.MqPublisher.Search, method = RequestMethod.GET)
    public Envelop search(
            @ApiParam(name = "fields", value = "返回的字段,为空则返回全部字段")
            @RequestParam(value = "fields", required = false) String fields,
            @ApiParam(name = "filters", value = "筛选条件")
            @RequestParam(value = "filters", required = false) String filters,
            @ApiParam(name = "searchContent", value = "筛选条件")
            @RequestParam(value = "searchContent", required = false) String searchContent,
            @ApiParam(name = "sorts", value = "排序")
            @RequestParam(value = "sorts", required = false) String sorts,
            @ApiParam(name = "page", value = "页码", defaultValue = "1")
@ -66,8 +70,8 @@ public class RedisMqPublisherEndPoint extends EnvelopRestEndPoint {
        Envelop envelop = new Envelop();
        envelop.setSuccessFlg(false);
        try {
            List<RedisMqPublisher> list = redisMqPublisherService.search(fields, filters, sorts, page, size);
            int count = (int) redisMqPublisherService.getCount(filters);
            List<RedisMqPublisher> list = redisMqPublisherService.search(fields, searchContent, sorts, page, size);
            int count = (int) redisMqPublisherService.getCount(searchContent);
            List<MRedisMqPublisher> mList = (List<MRedisMqPublisher>) convertToModels(list, new ArrayList<MRedisMqPublisher>(), MRedisMqPublisher.class, fields);
            envelop = getPageResult(mList, count, page, size);
            envelop.setSuccessFlg(true);
@ -80,14 +84,18 @@ public class RedisMqPublisherEndPoint extends EnvelopRestEndPoint {
    }
    @ApiOperation("新增消息发布者")
    @ResponseBody
    @RequestMapping(value = ServiceApi.Redis.MqPublisher.Save, method = RequestMethod.POST)
    public Envelop add(
            @ApiParam(value = "消息发布者JSON", required = true)
            @RequestBody String entityJson) {
    public Envelop add(String data) {
        Envelop envelop = new Envelop();
        envelop.setSuccessFlg(false);
        try {
            RedisMqPublisher newEntity = objectMapper.readValue(entityJson, RedisMqPublisher.class);
            RedisMqPublisher newEntity = objectMapper.readValue(data, RedisMqPublisher.class);
            User currentUser = (User) request.getSession().getAttribute("current_user");
            newEntity.setCreator(currentUser.getCode());
            newEntity.setCreateDate(new Date());
            newEntity.setModifyDate(new Date());
            newEntity.setModifier(currentUser.getCode());
            newEntity = redisMqPublisherService.save(newEntity);
            MRedisMqPublisher mRedisMqPublisher = convertToModel(newEntity, MRedisMqPublisher.class);
@ -102,14 +110,16 @@ public class RedisMqPublisherEndPoint extends EnvelopRestEndPoint {
    }
    @ApiOperation("更新消息发布者")
    @RequestMapping(value = ServiceApi.Redis.MqPublisher.Save, method = RequestMethod.PUT)
    public Envelop update(
            @ApiParam(value = "消息发布者JSON", required = true)
            @RequestBody String entityJson) {
    @ResponseBody
    @RequestMapping(value = ServiceApi.Redis.MqPublisher.Update, method = RequestMethod.POST)
    public Envelop update(String data) {
        Envelop envelop = new Envelop();
        envelop.setSuccessFlg(false);
        try {
            RedisMqPublisher updateEntity = objectMapper.readValue(entityJson, RedisMqPublisher.class);
            RedisMqPublisher updateEntity = objectMapper.readValue(data, RedisMqPublisher.class);
            User currentUser = (User) request.getSession().getAttribute("current_user");
            updateEntity.setModifyDate(new Date());
            updateEntity.setModifier(currentUser.getCode());
            updateEntity = redisMqPublisherService.save(updateEntity);
            MRedisMqPublisher mRedisMqPublisher = convertToModel(updateEntity, MRedisMqPublisher.class);
@ -124,6 +134,7 @@ public class RedisMqPublisherEndPoint extends EnvelopRestEndPoint {
    }
    @ApiOperation("删除消息发布者")
    @ResponseBody
    @RequestMapping(value = ServiceApi.Redis.MqPublisher.Delete, method = RequestMethod.DELETE)
    public Envelop delete(
            @ApiParam(name = "id", value = "消息发布者ID", required = true)
@ -143,10 +154,11 @@ public class RedisMqPublisherEndPoint extends EnvelopRestEndPoint {
    }
    @ApiOperation("验证指定队列中发布者应用ID是否唯一")
    @ResponseBody
    @RequestMapping(value = ServiceApi.Redis.MqPublisher.IsUniqueAppId, method = RequestMethod.GET)
    public Envelop isUniqueAppId(
            @ApiParam(name = "id", value = "消息订阅者ID", required = true)
            @RequestParam(value = "id") Integer id,
            @RequestParam(value = "id") Long id,
            @ApiParam(name = "channel", value = "消息队列编码", required = true)
            @RequestParam(value = "channel") String channel,
            @ApiParam(name = "appId", value = "发布者应用ID", required = true)

+ 6 - 6
patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/controller/redis/RedisMqSubscriberEndPoint.java

@ -14,6 +14,8 @@ import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.listener.RedisMessageListenerContainer;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
@ -25,7 +27,7 @@ import java.util.List;
 * @author 张进军
 * @date 2017/11/13 15:14
 */
@RestController
@Controller
@RequestMapping(value = ApiVersion.Version1_0)
@Api(description = "消息订阅者接口", tags = {"Redis消息发布订阅--消息订阅者接口"})
public class RedisMqSubscriberEndPoint extends EnvelopRestEndPoint {
@ -39,9 +41,7 @@ public class RedisMqSubscriberEndPoint extends EnvelopRestEndPoint {
    @ApiOperation("根据ID获取消息订阅者")
    @RequestMapping(value = ServiceApi.Redis.MqSubscriber.GetById, method = RequestMethod.GET)
    public Envelop getById(
            @ApiParam(name = "id", value = "主键", required = true)
            @PathVariable(value = "id") Integer id) {
    public Envelop getById(Model model, Long id) {
        Envelop envelop = new Envelop();
        envelop.setSuccessFlg(false);
        try {
@ -152,7 +152,7 @@ public class RedisMqSubscriberEndPoint extends EnvelopRestEndPoint {
    @RequestMapping(value = ServiceApi.Redis.MqSubscriber.IsUniqueAppId, method = RequestMethod.GET)
    public Envelop isUniqueAppId(
            @ApiParam(name = "id", value = "消息订阅者ID", required = true)
            @RequestParam(value = "id") Integer id,
            @RequestParam(value = "id") Long id,
            @ApiParam(name = "channel", value = "消息队列编码", required = true)
            @RequestParam(value = "channel") String channel,
            @ApiParam(name = "appId", value = "消息订阅者应用ID", required = true)
@ -176,7 +176,7 @@ public class RedisMqSubscriberEndPoint extends EnvelopRestEndPoint {
    @RequestMapping(value = ServiceApi.Redis.MqSubscriber.IsUniqueSubscribedUrl, method = RequestMethod.GET)
    public Envelop isUniqueSubscribedUrl(
            @ApiParam(name = "id", value = "消息订阅者ID", required = true)
            @RequestParam(value = "id") Integer id,
            @RequestParam(value = "id") Long id,
            @ApiParam(name = "channel", value = "消息队列编码", required = true)
            @RequestParam(value = "channel") String channel,
            @ApiParam(name = "subscriberUrl", value = "消息订阅者服务地址", required = true)

+ 2 - 2
patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/controller/redis/RedisScheduledController.java

@ -24,9 +24,9 @@ import org.springframework.dao.DataAccessException;
import org.springframework.data.redis.connection.RedisConnection;
import org.springframework.data.redis.core.RedisCallback;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.io.*;
@ -39,7 +39,7 @@ import java.util.List;
 * @author ysj
 * @date 2017/12/20
 */
@RestController
@Controller
@RequestMapping(value = ApiVersion.Version1_0)
@Api(description = "定时任务", tags = {"缓存服务管理--定时任务"})
public class RedisScheduledController {

+ 2 - 2
patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/controller/redis/RedisSubscribeMessageEndPoint.java

@ -14,10 +14,10 @@ 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.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import java.util.Map;
@ -25,7 +25,7 @@ import java.util.Map;
 * @author 张进军
 * @date 2017/12/4 15:19
 */
@RestController
@Controller
@RequestMapping(value = ApiVersion.Version1_0)
@Api(description = "接收消息队列的消息订阅接口", tags = {"缓存服务管理--接收消息队列的消息订阅接口"})
public class RedisSubscribeMessageEndPoint extends EnvelopRestEndPoint {

+ 0 - 106
patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/entity/SystemDict.java

@ -1,106 +0,0 @@
package com.yihu.wlyy.entity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import org.hibernate.annotations.GenericGenerator;
/**
 * SystemDict entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "system_dict")
public class SystemDict  implements java.io.Serializable {
	// Fields
	private String dictName;
	private String code;
	private String value;
	private String pyCode;
	private Integer sort;
	private String id;
	// Constructors
	/** default constructor */
	public SystemDict() {
	}
	/** minimal constructor */
	public SystemDict(String dictName, String code, String value) {
		this.dictName = dictName;
		this.code = code;
		this.value = value;
	}
	// Property accessors
	@GenericGenerator(name = "generator", strategy = "uuid")
	@Id
	@GeneratedValue(generator = "generator")
	@Column(name = "id", unique = true, nullable = false, length = 50)
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	/** full constructor */
	public SystemDict(String dictName, String code, String value,
			String pyCode, Integer sort) {
		this.dictName = dictName;
		this.code = code;
		this.value = value;
		this.pyCode = pyCode;
		this.sort = sort;
	}
	@Column(name = "dict_name", nullable = false, length = 50)
	public String getDictName() {
		return this.dictName;
	}
	public void setDictName(String dictName) {
		this.dictName = dictName;
	}
	@Column(name = "code", nullable = false, length = 50)
	public String getCode() {
		return this.code;
	}
	public void setCode(String code) {
		this.code = code;
	}
	@Column(name = "value", nullable = false, length = 50)
	public String getValue() {
		return this.value;
	}
	public void setValue(String value) {
		this.value = value;
	}
	@Column(name = "py_code", length = 50)
	public String getPyCode() {
		return this.pyCode;
	}
	public void setPyCode(String pyCode) {
		this.pyCode = pyCode;
	}
	@Column(name = "sort")
	public Integer getSort() {
		return this.sort;
	}
	public void setSort(Integer sort) {
		this.sort = sort;
	}
}

+ 0 - 152
patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/entity/SystemDictList.java

@ -1,152 +0,0 @@
package com.yihu.wlyy.entity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import org.hibernate.annotations.GenericGenerator;
/**
 * SystemDictList entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "system_dict_list")
public class SystemDictList   implements java.io.Serializable {
	// Fields
	private String dictName;
	private String chineseName;
	private String pyCode;
	private String pid;
	private String remark;
	private String relationTable;
	private String relationColCode;
	private String relationColValue;
	private String relationColExtend;
	private String id;
	// Constructors
	/** default constructor */
	public SystemDictList() {
	}
	/** minimal constructor */
	public SystemDictList(String dictName, String chineseName, String pid) {
		this.dictName = dictName;
		this.chineseName = chineseName;
		this.pid = pid;
	}
	/** full constructor */
	public SystemDictList(String dictName, String chineseName, String pyCode,
			String pid, String remark, String relationTable,
			String relationColCode, String relationColValue,
			String relationColExtend) {
		this.dictName = dictName;
		this.chineseName = chineseName;
		this.pyCode = pyCode;
		this.pid = pid;
		this.remark = remark;
		this.relationTable = relationTable;
		this.relationColCode = relationColCode;
		this.relationColValue = relationColValue;
		this.relationColExtend = relationColExtend;
	}
	// Property accessors
	@GenericGenerator(name = "generator", strategy = "uuid")
	@Id
	@GeneratedValue(generator = "generator")
	@Column(name = "id", unique = true, nullable = false, length = 50)
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	@Column(name = "dict_name", nullable = false, length = 50)
	public String getDictName() {
		return this.dictName;
	}
	public void setDictName(String dictName) {
		this.dictName = dictName;
	}
	@Column(name = "chinese_name", nullable = false, length = 50)
	public String getChineseName() {
		return this.chineseName;
	}
	public void setChineseName(String chineseName) {
		this.chineseName = chineseName;
	}
	@Column(name = "py_code", length = 50)
	public String getPyCode() {
		return this.pyCode;
	}
	public void setPyCode(String pyCode) {
		this.pyCode = pyCode;
	}
	@Column(name = "pid", nullable = false, length = 50)
	public String getPid() {
		return this.pid;
	}
	public void setPid(String pid) {
		this.pid = pid;
	}
	@Column(name = "remark", length = 200)
	public String getRemark() {
		return this.remark;
	}
	public void setRemark(String remark) {
		this.remark = remark;
	}
	@Column(name = "relation_table", length = 50)
	public String getRelationTable() {
		return this.relationTable;
	}
	public void setRelationTable(String relationTable) {
		this.relationTable = relationTable;
	}
	@Column(name = "relation_col_code", length = 50)
	public String getRelationColCode() {
		return this.relationColCode;
	}
	public void setRelationColCode(String relationColCode) {
		this.relationColCode = relationColCode;
	}
	@Column(name = "relation_col_value", length = 50)
	public String getRelationColValue() {
		return this.relationColValue;
	}
	public void setRelationColValue(String relationColValue) {
		this.relationColValue = relationColValue;
	}
	@Column(name = "relation_col_extend", length = 50)
	public String getRelationColExtend() {
		return this.relationColExtend;
	}
	public void setRelationColExtend(String relationColExtend) {
		this.relationColExtend = relationColExtend;
	}
}

+ 3 - 2
patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/listener/ApplicationReadyEventListener.java

@ -9,7 +9,8 @@ import com.yihu.wlyy.service.redis.MessageCommonBiz;
import com.yihu.wlyy.service.redis.pubsub.RedisMqChannelService;
import com.yihu.wlyy.service.redis.pubsub.RedisMqMessageLogService;
import com.yihu.wlyy.service.redis.pubsub.RedisMqSubscriberService;
import org.apache.log4j.Logger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.event.ApplicationReadyEvent;
import org.springframework.context.ApplicationListener;
@ -33,7 +34,7 @@ import java.util.Map;
@Component
public class ApplicationReadyEventListener implements ApplicationListener<ApplicationReadyEvent> {
    Logger logger = Logger.getLogger(ApplicationReadyEventListener.class);
    Logger logger = LoggerFactory.getLogger(ApplicationReadyEventListener.class);
    @Autowired
    RedisMessageListenerContainer redisMessageListenerContainer;
    @Autowired

+ 0 - 22
patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/repository/SystemDictDao.java

@ -1,22 +0,0 @@
package com.yihu.wlyy.repository;
import com.yihu.wlyy.entity.SystemDict;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
/**
 * Created by Administrator on 2016/8/13.
 */
public interface SystemDictDao extends PagingAndSortingRepository<SystemDict, Long>, JpaSpecificationExecutor<SystemDict> {
    @Query("from SystemDict s where s.dictName=?1 order by sort asc ")
    List<SystemDict> findByDictName(String name);
    List<SystemDict> findByDictNameAndCode(String name,String code);
    @Query("select s.value from SystemDict s where s.dictName=?1 and s.code =?2")
    String findByDictNameAndCode2(String dictName, String code);
}

+ 0 - 12
patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/repository/SystemDictListDao.java

@ -1,12 +0,0 @@
package com.yihu.wlyy.repository;
import com.yihu.wlyy.entity.SystemDictList;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * Created by Administrator on 2016/8/13.
 */
public interface SystemDictListDao extends PagingAndSortingRepository<SystemDictList, Long>, JpaSpecificationExecutor<SystemDictList> {
}

+ 2 - 2
patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/repository/redis/RedisCacheAuthorizationDao.java

@ -11,11 +11,11 @@ import org.springframework.data.repository.query.Param;
 * @author 张进军
 * @date 2017/11/23 11:28
 */
public interface RedisCacheAuthorizationDao extends PagingAndSortingRepository<RedisCacheAuthorization, Integer> {
public interface RedisCacheAuthorizationDao extends PagingAndSortingRepository<RedisCacheAuthorization, Long> {
    RedisCacheAuthorization findByCategoryCodeAndAppId(@Param("categoryCode") String categoryCode, @Param("appId") String appId);
    @Query(" FROM RedisCacheAuthorization a WHERE a.id <> :id AND a.categoryCode = :categoryCode AND a.appId = :appId ")
    RedisCacheAuthorization isUniqueAppId(@Param("id") Integer id, @Param("categoryCode") String categoryCode, @Param("appId") String appId);
    RedisCacheAuthorization isUniqueAppId(@Param("id") Long id, @Param("categoryCode") String categoryCode, @Param("appId") String appId);
}

+ 7 - 3
patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/repository/redis/RedisCacheCategoryDao.java

@ -1,6 +1,8 @@
package com.yihu.wlyy.repository.redis;
import com.yihu.wlyy.entity.User;
import com.yihu.wlyy.entity.redis.RedisCacheCategory;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.data.repository.query.Param;
@ -11,12 +13,14 @@ import org.springframework.data.repository.query.Param;
 * @author 张进军
 * @date 2017/11/23 11:28
 */
public interface RedisCacheCategoryDao extends PagingAndSortingRepository<RedisCacheCategory, Integer> {
public interface RedisCacheCategoryDao extends PagingAndSortingRepository<RedisCacheCategory, Long> , JpaSpecificationExecutor<RedisCacheCategory> {
    RedisCacheCategory findById(Long id);
    @Query(" FROM RedisCacheCategory a WHERE a.id <> :id AND a.name = :name ")
    RedisCacheCategory isUniqueName(@Param("id") Integer id, @Param("name") String name);
    RedisCacheCategory isUniqueName(@Param("id") Long id, @Param("name") String name);
    @Query(" FROM RedisCacheCategory a WHERE a.id <> :id AND a.code = :code ")
    RedisCacheCategory isUniqueCode(@Param("id") Integer id, @Param("code") String code);
    RedisCacheCategory isUniqueCode(@Param("id") Long id, @Param("code") String code);
}

+ 1 - 1
patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/repository/redis/RedisCacheKeyMemoryDao.java

@ -11,7 +11,7 @@ import org.springframework.data.repository.query.Param;
 * @author 张进军
 * @date 2017/12/6 14:58
 */
public interface RedisCacheKeyMemoryDao extends JpaRepository<RedisCacheKeyMemory, Integer> {
public interface RedisCacheKeyMemoryDao extends JpaRepository<RedisCacheKeyMemory, Long> {
    RedisCacheKeyMemory findByCacheKey(@Param("cacheKey") String cacheKey);

+ 3 - 3
patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/repository/redis/RedisCacheKeyRuleDao.java

@ -11,14 +11,14 @@ import org.springframework.data.repository.query.Param;
 * @author 张进军
 * @date 2017/11/23 11:28
 */
public interface RedisCacheKeyRuleDao extends PagingAndSortingRepository<RedisCacheKeyRule, Integer> {
public interface RedisCacheKeyRuleDao extends PagingAndSortingRepository<RedisCacheKeyRule, Long> {
    RedisCacheKeyRule findByCode(@Param("code") String code);
    @Query(" FROM RedisCacheKeyRule a WHERE a.id <> :id AND a.name = :name ")
    RedisCacheKeyRule isUniqueName(@Param("id") Integer id, @Param("name") String name);
    RedisCacheKeyRule isUniqueName(@Param("id") Long id, @Param("name") String name);
    @Query(" FROM RedisCacheKeyRule a WHERE a.id <> :id AND a.code = :code ")
    RedisCacheKeyRule isUniqueCode(@Param("id") Integer id, @Param("code") String code);
    RedisCacheKeyRule isUniqueCode(@Param("id") Long id, @Param("code") String code);
}

+ 3 - 3
patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/repository/redis/RedisMqChannelDao.java

@ -11,14 +11,14 @@ import org.springframework.data.repository.query.Param;
 * @author 张进军
 * @date 2017/11/10 11:45
 */
public interface RedisMqChannelDao extends PagingAndSortingRepository<RedisMqChannel, Integer> {
public interface RedisMqChannelDao extends PagingAndSortingRepository<RedisMqChannel, Long> {
    RedisMqChannel findByChannel(@Param("channel") String channel);
    @Query(" FROM RedisMqChannel rmc WHERE rmc.id <> :id AND rmc.channel = :channel ")
    RedisMqChannel isUniqueChannel(@Param("id") Integer id, @Param("channel") String channel);
    RedisMqChannel isUniqueChannel(@Param("id") Long id, @Param("channel") String channel);
    @Query(" FROM RedisMqChannel rmc WHERE rmc.id <> :id AND rmc.channelName = :channelName ")
    RedisMqChannel isUniqueChannelName(@Param("id") Integer id, @Param("channelName") String channelName);
    RedisMqChannel isUniqueChannelName(@Param("id") Long id, @Param("channelName") String channelName);
}

+ 2 - 2
patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/repository/redis/RedisMqPublisherDao.java

@ -13,13 +13,13 @@ import java.util.List;
 * @author 张进军
 * @date 2017/11/20 09:35
 */
public interface RedisMqPublisherDao extends PagingAndSortingRepository<RedisMqPublisher, Integer> {
public interface RedisMqPublisherDao extends PagingAndSortingRepository<RedisMqPublisher, Long> {
    List<RedisMqPublisher> findByChannel(@Param("channel") String channel);
    RedisMqPublisher findByChannelAndAppId(@Param("channel") String channel, @Param("appId") String appId);
    @Query(" FROM RedisMqPublisher rmp WHERE rmp.id <> :id AND rmp.channel = :channel AND rmp.appId = :appId ")
    RedisMqPublisher isUniqueAppId(@Param("id") Integer id, @Param("channel") String channel, @Param("appId") String appId);
    RedisMqPublisher isUniqueAppId(@Param("id") Long id, @Param("channel") String channel, @Param("appId") String appId);
}

+ 3 - 3
patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/repository/redis/RedisMqSubscriberDao.java

@ -13,14 +13,14 @@ import java.util.List;
 * @author 张进军
 * @date 2017/11/10 11:45
 */
public interface RedisMqSubscriberDao extends PagingAndSortingRepository<RedisMqSubscriber, Integer> {
public interface RedisMqSubscriberDao extends PagingAndSortingRepository<RedisMqSubscriber, Long> {
    List<RedisMqSubscriber> findByChannel(@Param("channel") String channel);
    @Query(" FROM RedisMqSubscriber rms WHERE rms.id <> :id AND rms.channel = :channel AND rms.appId = :appId ")
    RedisMqSubscriber isUniqueAppId(@Param("id") Integer id, @Param("channel") String channel, @Param("appId") String appId);
    RedisMqSubscriber isUniqueAppId(@Param("id") Long id, @Param("channel") String channel, @Param("appId") String appId);
    @Query(" FROM RedisMqSubscriber rms WHERE rms.id <> :id AND rms.channel = :channel AND rms.subscribedUrl = :subscribedUrl ")
    RedisMqSubscriber isUniqueSubscribedUrl(@Param("id") Integer id, @Param("channel") String channel, @Param("subscribedUrl") String subscribedUrl);
    RedisMqSubscriber isUniqueSubscribedUrl(@Param("id") Long id, @Param("channel") String channel, @Param("subscribedUrl") String subscribedUrl);
}

+ 0 - 45
patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/service/manager/dict/SystemDictService.java

@ -1,45 +0,0 @@
package com.yihu.wlyy.service.manager.dict;
import com.yihu.wlyy.entity.SystemDict;
import com.yihu.wlyy.repository.SystemDictDao;
import com.yihu.wlyy.util.query.BaseJpaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
 * Created by Administrator on 2017/1/24.
 */
@Service
public class SystemDictService extends BaseJpaService<SystemDict, SystemDictDao> {
    @Autowired
    SystemDictDao systemDictDao;
    private String dictName = "SYSTEM_PARAMS";
    public List<SystemDict> getByDictName(String name){
        return systemDictDao.findByDictName(name);
    }
    /**
     * http_log是否记录成功消息
     *
     * @return
     */
    public Boolean getSaveSuccessLog() {
        try {
            String re = systemDictDao.findByDictNameAndCode2(dictName, "SAVE_SUCCESS_LOG");
            if ("1".equals(re)) {
                return true;
            } else {
                return false;
            }
        } catch (Exception ex) {
            ex.printStackTrace();
            return false;
        }
    }
}

+ 3 - 2
patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/service/redis/DefaultMessageDelegate.java

@ -5,7 +5,8 @@ import com.yihu.wlyy.entity.redis.RedisMqMessageLog;
import com.yihu.wlyy.entity.redis.RedisMqSubscriber;
import com.yihu.wlyy.service.redis.pubsub.RedisMqMessageLogService;
import com.yihu.wlyy.service.redis.pubsub.RedisMqSubscriberService;
import org.apache.log4j.Logger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
@ -24,7 +25,7 @@ import java.util.Map;
 */
public class DefaultMessageDelegate implements MessageDelegate {
    Logger logger = Logger.getLogger(DefaultMessageDelegate.class);
    Logger logger = LoggerFactory.getLogger(DefaultMessageDelegate.class);
    private RestTemplate restTemplate = new RestTemplate();

+ 3 - 3
patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/service/redis/cache/RedisCacheAuthorizationService.java

@ -21,7 +21,7 @@ public class RedisCacheAuthorizationService extends BaseJpaService<RedisCacheAut
    @Autowired
    RedisCacheAuthorizationDao redisCacheAuthorizationDao;
    
    public RedisCacheAuthorization getById(Integer id) {
    public RedisCacheAuthorization getById(Long id) {
        return redisCacheAuthorizationDao.findOne(id);
    }
@ -35,11 +35,11 @@ public class RedisCacheAuthorizationService extends BaseJpaService<RedisCacheAut
    }
    @Transactional(readOnly = false)
    public void delete(Integer id) {
    public void delete(Long id) {
        redisCacheAuthorizationDao.delete(id);
    }
    public Boolean isUniqueAppId(Integer id, String categoryCode, String appId) {
    public Boolean isUniqueAppId(Long id, String categoryCode, String appId) {
        RedisCacheAuthorization redisCacheAuthorization = redisCacheAuthorizationDao.isUniqueAppId(id, categoryCode, appId);
        if (redisCacheAuthorization == null) {
            return true;

+ 5 - 4
patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/service/redis/cache/RedisCacheCategoryService.java

@ -20,8 +20,9 @@ public class RedisCacheCategoryService extends BaseJpaService<RedisCacheCategory
    @Autowired
    RedisCacheCategoryDao redisCacheCategoryDao;
    
    public RedisCacheCategory getById(Integer id) {
    public RedisCacheCategory getById(Long id) {
        return redisCacheCategoryDao.findOne(id);
    }
@ -31,11 +32,11 @@ public class RedisCacheCategoryService extends BaseJpaService<RedisCacheCategory
    }
    @Transactional(readOnly = false)
    public void delete(Integer id) {
    public void delete(Long id) {
        redisCacheCategoryDao.delete(id);
    }
    public Boolean isUniqueName(Integer id, String name) {
    public Boolean isUniqueName(Long id, String name) {
        RedisCacheCategory redisCacheCategory = redisCacheCategoryDao.isUniqueName(id, name);
        if (redisCacheCategory == null) {
            return true;
@ -44,7 +45,7 @@ public class RedisCacheCategoryService extends BaseJpaService<RedisCacheCategory
        }
    }
    public Boolean isUniqueCode(Integer id, String code) {
    public Boolean isUniqueCode(Long id, String code) {
        RedisCacheCategory redisCacheCategory = redisCacheCategoryDao.isUniqueCode(id, code);
        if (redisCacheCategory == null) {
            return true;

+ 1 - 1
patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/service/redis/cache/RedisCacheKeyMemoryService.java

@ -76,7 +76,7 @@ public class RedisCacheKeyMemoryService extends BaseJpaService<RedisCacheKeyMemo
    }
    @Transactional(readOnly = false)
    public void delete(Integer id) {
    public void delete(Long id) {
        redisCacheKeyMemoryDao.delete(id);
    }

+ 4 - 4
patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/service/redis/cache/RedisCacheKeyRuleService.java

@ -21,7 +21,7 @@ public class RedisCacheKeyRuleService extends BaseJpaService<RedisCacheKeyRule,
    @Autowired
    RedisCacheKeyRuleDao redisCacheKeyRuleDao;
    
    public RedisCacheKeyRule getById(Integer id) {
    public RedisCacheKeyRule getById(Long id) {
        return redisCacheKeyRuleDao.findOne(id);
    }
@ -35,11 +35,11 @@ public class RedisCacheKeyRuleService extends BaseJpaService<RedisCacheKeyRule,
    }
    @Transactional(readOnly = false)
    public void delete(Integer id) {
    public void delete(Long id) {
        redisCacheKeyRuleDao.delete(id);
    }
    public Boolean isUniqueName(Integer id, String name) {
    public Boolean isUniqueName(Long id, String name) {
        RedisCacheKeyRule redisCacheKeyRule = redisCacheKeyRuleDao.isUniqueName(id, name);
        if (redisCacheKeyRule == null) {
            return true;
@ -48,7 +48,7 @@ public class RedisCacheKeyRuleService extends BaseJpaService<RedisCacheKeyRule,
        }
    }
    public Boolean isUniqueCode(Integer id, String code) {
    public Boolean isUniqueCode(Long id, String code) {
        RedisCacheKeyRule redisCacheKeyRule = redisCacheKeyRuleDao.isUniqueCode(id, code);
        if (redisCacheKeyRule == null) {
            return true;

+ 4 - 4
patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/service/redis/pubsub/RedisMqChannelService.java

@ -40,7 +40,7 @@ public class RedisMqChannelService extends BaseJpaService<RedisMqChannel, RedisM
    @Autowired
    ObjectMapper objectMapper;
    public RedisMqChannel getById(Integer id) {
    public RedisMqChannel getById(Long id) {
        return redisMqChannelDao.findOne(id);
    }
@ -54,11 +54,11 @@ public class RedisMqChannelService extends BaseJpaService<RedisMqChannel, RedisM
    }
    @Transactional(readOnly = false)
    public void delete(Integer id) {
    public void delete(Long id) {
        redisMqChannelDao.delete(id);
    }
    public Boolean isUniqueChannel(Integer id, String channel) {
    public Boolean isUniqueChannel(Long id, String channel) {
        RedisMqChannel redisMqChannel = redisMqChannelDao.isUniqueChannel(id, channel);
        if (redisMqChannel == null) {
            return true;
@ -67,7 +67,7 @@ public class RedisMqChannelService extends BaseJpaService<RedisMqChannel, RedisM
        }
    }
    public Boolean isUniqueChannelName(Integer id, String channelName) {
    public Boolean isUniqueChannelName(Long id, String channelName) {
        RedisMqChannel redisMqChannel = redisMqChannelDao.isUniqueChannelName(id, channelName);
        if (redisMqChannel == null) {
            return true;

+ 3 - 3
patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/service/redis/pubsub/RedisMqPublisherService.java

@ -23,7 +23,7 @@ public class RedisMqPublisherService extends BaseJpaService<RedisMqPublisher, Re
    @Autowired
    RedisMqPublisherDao redisMqPublisherDao;
    public RedisMqPublisher getById(Integer id) {
    public RedisMqPublisher getById(Long id) {
        return redisMqPublisherDao.findOne(id);
    }
@ -41,11 +41,11 @@ public class RedisMqPublisherService extends BaseJpaService<RedisMqPublisher, Re
    }
    @Transactional(readOnly = false)
    public void delete(Integer id) {
    public void delete(Long id) {
        redisMqPublisherDao.delete(id);
    }
    public Boolean isUniqueAppId(Integer id, String channel, String appId) {
    public Boolean isUniqueAppId(Long id, String channel, String appId) {
        RedisMqPublisher redisMqPublisher = redisMqPublisherDao.isUniqueAppId(id, channel, appId);
        if (redisMqPublisher == null) {
            return true;

+ 4 - 4
patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/service/redis/pubsub/RedisMqSubscriberService.java

@ -23,7 +23,7 @@ public class RedisMqSubscriberService extends BaseJpaService<RedisMqSubscriber,
    @Autowired
    RedisMqSubscriberDao redisMqSubscriberDao;
    public RedisMqSubscriber getById(Integer id) {
    public RedisMqSubscriber getById(Long id) {
        return redisMqSubscriberDao.findOne(id);
    }
@ -37,11 +37,11 @@ public class RedisMqSubscriberService extends BaseJpaService<RedisMqSubscriber,
    }
    @Transactional(readOnly = false)
    public void delete(Integer id) {
    public void delete(Long id) {
        redisMqSubscriberDao.delete(id);
    }
    public Boolean isUniqueAppId(Integer id, String channel, String appId) {
    public Boolean isUniqueAppId(Long id, String channel, String appId) {
        RedisMqSubscriber redisMqSubscriber = redisMqSubscriberDao.isUniqueAppId(id, channel, appId);
        if (redisMqSubscriber == null) {
            return true;
@ -50,7 +50,7 @@ public class RedisMqSubscriberService extends BaseJpaService<RedisMqSubscriber,
        }
    }
    public Boolean isUniqueSubscribedUrl(Integer id, String channel, String subscriberUrl) {
    public Boolean isUniqueSubscribedUrl(Long id, String channel, String subscriberUrl) {
        RedisMqSubscriber redisMqSubscriber = redisMqSubscriberDao.isUniqueSubscribedUrl(id, channel, subscriberUrl);
        if (redisMqSubscriber == null) {
            return true;

+ 6 - 7
patient-co-manage/redis-cache/src/main/resources/application.yml

@ -1,7 +1,6 @@
server:
  port: 8180
  context-path: /redis
  session-timeout: 3000000
  port: 8083
#  context-path: /redis
spring:
  datasource:
@ -24,7 +23,7 @@ spring:
    # REDIS
  redis:
    database: 0 # Database index used by the connection factory.
    password: # Login password of the redis server.
#    password: # Login password of the redis server.
    timeout: 120000 # 连接超时时间(毫秒) 60秒
    pool:
      max-active: 20 # 连接池最大连接数(使用负值表示没有限制)
@ -44,9 +43,9 @@ spring:
      password: 123456
  redis:
    host: 172.19.103.88 # Redis server host.
    port: 6379 # Redis server port.
    password:
    host: 172.19.103.47 # Redis server host.
    port: 6379
    password: redis!@456
fast-dfs:
  tracker-server: 172.19.103.13:22122

+ 9 - 5
patient-co-manage/redis-cache/src/main/webapp/WEB-INF/views/redis/cache/authorization/detailJs.jsp

@ -38,17 +38,21 @@
            if (!validator.validate()) { return; }
            var loading = $.ligerDialog.waitting("正在保存数据...");
            dataModel.fetchRemote("${contextRoot}/redis/cache/authorization/save", {
            var uri = "save";
            if(detailModel.id!=null&&detailModel.id!=-1){
                uri = "update"
            }
            dataModel.fetchRemote("${contextRoot}/redis/cache/authorization/"+uri, {
                type: 'post',
                data: {data: JSON.stringify($form.Fields.getValues())},
                success: function (data) {
                    if (data.successFlg) {
                        if (detailModel.id) {
                            window.closeDetailDialog('新增成功');
                            parent.closeDetailDialog('新增成功');
                        } else {
                            window.closeDetailDialog('修改成功');
                            parent.closeDetailDialog('修改成功');
                        }
                        window.reloadMasterGrid();
                        parent.reloadMasterGrid();
                    } else {
                        $.Notice.error(data.errorMsg);
                    }
@ -64,7 +68,7 @@
        // 关闭
        $('#btnClose').click(function () {
            window.closeDetailDialog();
            parent.closeDetailDialog();
        })
    }

+ 1 - 3
patient-co-manage/redis-cache/src/main/webapp/WEB-INF/views/redis/cache/authorization/listJs.jsp

@ -65,9 +65,7 @@
                urlParms: {
                    id: id,
                    categoryCode: categoryCode
                },
                opener: true,
                load: true
                }
            });
        });

+ 1 - 1
patient-co-manage/redis-cache/src/main/webapp/WEB-INF/views/redis/cache/category/detail.jsp

@ -22,7 +22,7 @@
    <div class="m-form-group">
        <label>缓存分类编码:</label>
        <div class="l-text-wrapper m-form-control essential">
            <input type="text" class="f-w240 max-length-30 required ajax validate-alpha-underline"
            <input type="text" class="f-w240 max-length-30"
                   id="code" data-attr-scan="code">
        </div>
    </div>

+ 85 - 78
patient-co-manage/redis-cache/src/main/webapp/WEB-INF/views/redis/cache/category/detailJs.jsp

@ -2,96 +2,103 @@
<script>
    var detailModel = ${detailModel};
    var dataModel = $.DataModel.init();
    var validator;
    var $form = $("#redisCacheCategoryForm");
(function ($, win) {
    $(function () {
        init();
    });
    function init() {
        validator = customFormValidator();
        initForm();
        bindEvents();
    }
        var detailModel = ${detailModel};
        var dataModel = $.DataModel.init();
        var validator;
        var $form = $("#redisCacheCategoryForm");
    function initForm() {
        var codeTb = $('#code').ligerTextBox({width: 240});
        $('#name').ligerTextBox({width: 240});
        $('#remark').ligerTextBox({width: 240, height: 150});
        $(function () {
            init();
        });
        if(detailModel.id) {
            codeTb.setDisabled(true);
            codeTb.setReadonly(true);
        function init() {
            validator = customFormValidator();
            initForm();
            bindEvents();
        }
        $form.attrScan();
        $form.Fields.fillValues(detailModel);
    }
        function initForm() {
            var codeTb = $('#code').ligerTextBox({width: 240});
            $('#name').ligerTextBox({width: 240});
            $('#remark').ligerTextBox({width: 240, height: 150});
    function bindEvents() {
        // 保存
        $('#btnSave').click(function () {
            if (!validator.validate()) { return; }
            if(detailModel.id) {
                codeTb.setDisabled(true);
                codeTb.setReadonly(true);
            }
            var loading = $.ligerDialog.waitting("正在保存数据...");
            dataModel.fetchRemote("${contextRoot}/redis/cache/category/save", {
                type: 'post',
                data: {data: JSON.stringify($form.Fields.getValues())},
                success: function (data) {
                    if (data.successFlg) {
                        if (detailModel.id) {
                            window.closeDetailDialog('新增成功');
            $form.attrScan();
            $form.Fields.fillValues(detailModel);
        }
        function bindEvents() {
            // 保存
            $('#btnSave').click(function () {
                if (!validator.validate()) { return; }
                var loading = $.ligerDialog.waitting("正在保存数据...");
                var uri = "save";
                if(detailModel.id!=null&&detailModel.id!=-1){
                    uri = "update"
                }
                dataModel.fetchRemote("${contextRoot}/redis/cache/category/"+uri, {
                    type: 'post',
                    data: {data: JSON.stringify($form.Fields.getValues())},
                    success: function (data) {
                        if (data.successFlg) {
                            if (detailModel.id) {
                                parent.closeDetailDialog('新增成功');
                            } else {
                                parent.closeDetailDialog('修改成功');
                            }
                            parent.reloadMasterGrid();
                        } else {
                            window.closeDetailDialog('修改成功');
                            $.Notice.error(data.errorMsg);
                        }
                        window.reloadMasterGrid();
                    } else {
                        $.Notice.error(data.errorMsg);
                    },
                    error: function () {
                        $.Notice.error('保存发生异常');
                    },
                    complete: function () {
                        loading.close();
                    }
                },
                error: function () {
                    $.Notice.error('保存发生异常');
                },
                complete: function () {
                    loading.close();
                }
                });
            });
        });
        // 关闭
        $('#btnClose').click(function () {
            window.closeDetailDialog();
        })
    }
            // 关闭
            $('#btnClose').click(function () {
                parent.closeDetailDialog();
            })
        }
    // 表单验证对象
    function customFormValidator() {
        return new $.jValidation.Validation($form, {
            immediate: true,
            onElementValidateForAjax: function (el) {
                var id = detailModel.id || -1; // 新增时传-1。
                var elId = $(el).attr("id");
                switch(elId) {
                    case 'code':
                        var code = $("#code").val();
                        if(!$.Util.isStrEquals(code, detailModel.code)) {
                            var ulr = "${contextRoot}/redis/cache/category/isUniqueCode";
                            return $.Util.validateByAjax(ulr, {id: id, code: code});
                        }
                        break;
                    case 'name':
                        var name = $("#name").val();
                        if(!$.Util.isStrEquals(name, detailModel.name)) {
                            var ulr = "${contextRoot}/redis/cache/category/isUniqueName";
                            return $.Util.validateByAjax(ulr, {id: id, name: name});
                        }
                        break;
        // 表单验证对象
        function customFormValidator() {
            return new $.jValidation.Validation($form, {
                immediate: true,
                onElementValidateForAjax: function (el) {
                    var id = detailModel.id || -1; // 新增时传-1。
                    var elId = $(el).attr("id");
                    switch(elId) {
                        case 'code':
                            var code = $("#code").val();
                            if(!$.Util.isStrEquals(code, detailModel.code)) {
                                var ulr = "${contextRoot}/redis/cache/category/isUniqueCode";
                                return $.Util.validateByAjax(ulr, {id: id, code: code});
                            }
                            break;
                        case 'name':
                            var name = $("#name").val();
                            if(!$.Util.isStrEquals(name, detailModel.name)) {
                                var ulr = "${contextRoot}/redis/cache/category/isUniqueName";
                                return $.Util.validateByAjax(ulr, {id: id, name: name});
                            }
                            break;
                    }
                }
            }
        });
    }
            });
        }
    });
})(jQuery, window)
</script>

+ 105 - 103
patient-co-manage/redis-cache/src/main/webapp/WEB-INF/views/redis/cache/category/listJs.jsp

@ -2,118 +2,120 @@
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<script>
    var dataModel = $.DataModel.init();
    var detailDialog = null;
    var grid = null;
(function ($, win) {
    $(function () {
        init();
    });
    function init() {
        initWidget();
        bindEvents();
    }
        var dataModel = $.DataModel.init();
        var detailDialog = null;
        var grid = null;
    function initWidget() {
        $('#searchContent').ligerTextBox({
            width: 200, isSearch: true, search: function () {
                reloadGrid();
            }
        $(function () {
            init();
        });
        grid = $("#grid").ligerGrid($.LigerGridEx.config({
            url: ctx + '/redis/cache/category/search',
            columns: [
                {display: 'ID', name: 'id', hide: true},
                {display: '缓存分类名称', name: 'name', width: '20%', isAllowHide: false, align: 'left'},
                {display: '缓存分类编码', name: 'code', width: '20%', isAllowHide: false, align: 'left'},
                {display: '修改时间', name: 'modifyDate', width: '15%', isAllowHide: false, align: 'left'},
                {display: '备注', name: 'remark', width: '30%', isAllowHide: false, align: 'left'},
                {display: '操作', name: 'operator', width: '15%', minWidth: 120, align: 'center',
                    render: function (row) {
                        var html = '';
                        html += '<sec:authorize url="/redis/cache/category/authorizationList"><a class="label_a f-ml10" title="应用授权" href="javascript:void(0)" onclick="javascript:' + $.Util.format("$.publish('{0}',['{1}'])", "redis:cache:category:authorizationList", row.code) + '">应用授权</a></sec:authorize>';
                        html += '<sec:authorize url="/redis/cache/category/detail"><a class="grid_edit f-ml10" title="编辑" href="javascript:void(0)" onclick="javascript:' + $.Util.format("$.publish('{0}',['{1}','{2}'])", "redis:cache:category:detail", row.id, 'modify') + '"></a></sec:authorize>';
                        html += '<sec:authorize url="/redis/cache/category/delete"><a class="grid_delete" title="删除" href="javascript:void(0)"  onclick="javascript:' + $.Util.format("$.publish('{0}',['{1}'])", "redis:cache:category:delete", row.id) + '"></a></sec:authorize>';
                        return html;
                    }
                }
            ],
            method:'GET',
            allowHideColumn: false,
            usePager: true
        }));
        grid.collapseAll();
        grid.adjustToWidth();
    }
    function bindEvents() {
        // 应用授权
        $.subscribe('redis:cache:category:authorizationList', function (event, categoryCode) {
            var url = '${contextRoot}/redis/cache/authorization/index?';
            $("#contentPage").empty();
            $("#contentPage").load(url,{categoryCode: categoryCode});
        });
        function init() {
            initWidget();
            bindEvents();
        }
        // 新增/修改
        $.subscribe('redis:cache:category:detail', function (event, id, mode) {
            var title = '新增缓存分类';
            if (mode == 'modify') {
                title = '修改缓存分类';
            }
            detailDialog = $.ligerDialog.open({
                height: 410,
                width: 480,
                title: title,
                url: '${contextRoot}/redis/cache/category/detail',
                urlParms: {
                    id: id,
                    mode: mode
                },
                opener: true,
                load: true
        function initWidget() {
            $('#searchContent').ligerTextBox({
                width: 200, isSearch: true, search: function () {
                    reloadGrid();
                }
            });
        });
        // 删除
        $.subscribe('redis:cache:category:delete', function (event, id) {
            $.Notice.confirm('确认要删除所选数据吗?', function (r) {
                if (r) {
                    var loading = $.ligerDialog.waitting("正在删除数据...");
                    dataModel.updateRemote('${contextRoot}/redis/cache/category/delete', {
                        data: {id: parseInt(id)},
                        success: function (data) {
                            if (data.successFlg) {
                                $.Notice.success('删除成功!');
                                reloadGrid();
                            } else {
                                $.Notice.error(data.errorMsg);
                            }
                        },
                        error: function () {
                            $.Notice.error('删除发生异常');
                        },
                        complete: function () {
                            loading.close();
            grid = $("#grid").ligerGrid($.LigerGridEx.config({
                url: ctx + '/redis/cache/category/search',
                columns: [
                    {display: 'ID', name: 'id', hide: true},
                    {display: '缓存分类名称', name: 'name', width: '20%', isAllowHide: false, align: 'left'},
                    {display: '缓存分类编码', name: 'code', width: '20%', isAllowHide: false, align: 'left'},
                    {display: '修改时间', name: 'modifyDate', width: '15%', isAllowHide: false, align: 'left'},
                    {display: '备注', name: 'remark', width: '30%', isAllowHide: false, align: 'left'},
                    {display: '操作', name: 'operator', width: '15%', minWidth: 120, align: 'center',
                        render: function (row) {
                            var html = '';
                            html += '<sec:authorize url="/redis/cache/category/authorizationList"><a class="label_a f-ml10" title="应用授权" href="javascript:void(0)" onclick="javascript:' + $.Util.format("$.publish('{0}',['{1}'])", "redis:cache:category:authorizationList", row.code) + '">应用授权</a></sec:authorize>';
                            html += '<sec:authorize url="/redis/cache/category/detail"><a class="grid_edit f-ml10" title="编辑" href="javascript:void(0)" onclick="javascript:' + $.Util.format("$.publish('{0}',['{1}','{2}'])", "redis:cache:category:detail", row.id, 'modify') + '"></a></sec:authorize>';
                            html += '<sec:authorize url="/redis/cache/category/delete"><a class="grid_delete" title="删除" href="javascript:void(0)"  onclick="javascript:' + $.Util.format("$.publish('{0}',['{1}'])", "redis:cache:category:delete", row.id) + '"></a></sec:authorize>';
                            return html;
                        }
                    });
                    }
                ],
                method:'GET',
                allowHideColumn: false,
                usePager: true
            }));
            grid.collapseAll();
            grid.adjustToWidth();
        }
        function bindEvents() {
            // 应用授权
            $.subscribe('redis:cache:category:authorizationList', function (event, categoryCode) {
                var url = '${contextRoot}/redis/cache/authorization/index?';
                $("#contentPage").empty();
                $("#contentPage").load(url,{categoryCode: categoryCode});
            });
            // 新增/修改
            $.subscribe('redis:cache:category:detail', function (event, id, mode) {
                var title = '新增缓存分类';
                if (mode == 'modify') {
                    title = '修改缓存分类';
                }
            })
        });
    }
                detailDialog = $.ligerDialog.open({
                    id:'test',
                    height: 410,
                    width: 480,
                    title: title,
                    url: '${contextRoot}/redis/cache/category/detail',
                    urlParms: {
                        id: id,
                        mode: mode
                    }
                });
            });
    function reloadGrid() {
        var params = {searchContent: $('#searchContent').val()};
        $.Util.reloadGrid.call(grid, '${contextRoot}/redis/cache/category/search', params);
    }
            // 删除
            $.subscribe('redis:cache:category:delete', function (event, id) {
                $.Notice.confirm('确认要删除所选数据吗?', function (r) {
                    if (r) {
                        var loading = $.ligerDialog.waitting("正在删除数据...");
                        dataModel.updateRemote('${contextRoot}/redis/cache/category/delete', {
                            data: {id: parseInt(id)},
                            success: function (data) {
                                if (data.successFlg) {
                                    $.Notice.success('删除成功!');
                                    reloadGrid();
                                } else {
                                    $.Notice.error(data.errorMsg);
                                }
                            },
                            error: function () {
                                $.Notice.error('删除发生异常');
                            },
                            complete: function () {
                                loading.close();
                            }
                        });
                    }
                })
            });
        }
    /*-- 与明细 Dialog 页面间回调的函数 --*/
    window.reloadMasterGrid = function() {
        reloadGrid();
    };
    window.closeDetailDialog = function (type, msg) {
        detailDialog.close();
        msg && $.Notice.success(msg);
    };
        function reloadGrid() {
            var params = {searchContent: $('#searchContent').val()};
            $.Util.reloadGrid.call(grid, '${contextRoot}/redis/cache/category/search', params);
        }
        /*-- 与明细 Dialog 页面间回调的函数 --*/
        win.reloadMasterGrid = function() {
            reloadGrid();
        };
        win.closeDetailDialog = function (type, msg) {
            detailDialog.close();
            msg && $.Notice.success(msg);
        };
    });
})(jQuery, window)
</script>

+ 9 - 5
patient-co-manage/redis-cache/src/main/webapp/WEB-INF/views/redis/cache/keyRule/detailJs.jsp

@ -51,17 +51,21 @@
            if (!validator.validate()) { return; }
            var loading = $.ligerDialog.waitting("正在保存数据...");
            dataModel.fetchRemote("${contextRoot}/redis/cache/keyRule/save", {
            var uri = "save";
            if(detailModel.id!=null&&detailModel.id!=-1){
                uri = "update"
            }
            dataModel.fetchRemote("${contextRoot}/redis/cache/keyRule/"+uri, {
                type: 'post',
                data: {data: JSON.stringify($form.Fields.getValues())},
                success: function (data) {
                    if (data.successFlg) {
                        if (detailModel.id) {
                            window.closeDetailDialog('新增成功');
                            parent.closeDetailDialog('新增成功');
                        } else {
                            window.closeDetailDialog('修改成功');
                            parent.closeDetailDialog('修改成功');
                        }
                        window.reloadMasterGrid();
                        parent.reloadMasterGrid();
                    } else {
                        $.Notice.error(data.errorMsg);
                    }
@ -77,7 +81,7 @@
        // 关闭
        $('#btnClose').click(function () {
            window.closeDetailDialog();
            parent.closeDetailDialog();
        })
    }

+ 1 - 3
patient-co-manage/redis-cache/src/main/webapp/WEB-INF/views/redis/cache/keyRule/listJs.jsp

@ -73,9 +73,7 @@
                url: '${contextRoot}/redis/cache/keyRule/detail',
                urlParms: {
                    id: id
                },
                opener: true,
                load: true
                }
            });
        });

+ 9 - 5
patient-co-manage/redis-cache/src/main/webapp/WEB-INF/views/redis/mq/channel/detailJs.jsp

@ -38,17 +38,21 @@
            if (!validator.validate()) { return; }
            var loading = $.ligerDialog.waitting("正在保存数据...");
            dataModel.fetchRemote("${contextRoot}/redis/mq/channel/save", {
            var uri = "save";
            if(detailModel.id!=null&&detailModel.id!=-1){
                uri = "update"
            }
            dataModel.fetchRemote("${contextRoot}/redis/mq/channel/"+uri, {
                type: 'post',
                data: {data: JSON.stringify($form.Fields.getValues())},
                success: function (data) {
                    if (data.successFlg) {
                        if (detailModel.id) {
                            window.closeDetailDialog('新增成功');
                            parent.closeDetailDialog('新增成功');
                        } else {
                            window.closeDetailDialog('修改成功');
                            parent.closeDetailDialog('修改成功');
                        }
                        window.reloadMasterGrid();
                        parent.reloadMasterGrid();
                    } else {
                        $.Notice.error(data.errorMsg);
                    }
@ -64,7 +68,7 @@
        // 关闭
        $('#btnClose').click(function () {
            window.closeDetailDialog();
            parent.closeDetailDialog();
        })
    }

+ 1 - 3
patient-co-manage/redis-cache/src/main/webapp/WEB-INF/views/redis/mq/channel/listJs.jsp

@ -82,9 +82,7 @@
                urlParms: {
                    id: id,
                    mode: mode
                },
                opener: true,
                load: true
                }
            });
        });

+ 9 - 5
patient-co-manage/redis-cache/src/main/webapp/WEB-INF/views/redis/mq/publisher/detailJs.jsp

@ -38,17 +38,21 @@
            if (!validator.validate()) { return; }
            var loading = $.ligerDialog.waitting("正在保存数据...");
            dataModel.fetchRemote("${contextRoot}/redis/mq/publisher/save", {
            var uri = "save";
            if(detailModel.id!=null&&detailModel.id!=-1){
                uri = "update"
            }
            dataModel.fetchRemote("${contextRoot}/redis/mq/publisher/"+uri, {
                type: 'post',
                data: {data: JSON.stringify($form.Fields.getValues())},
                success: function (data) {
                    if (data.successFlg) {
                        if (detailModel.id) {
                            window.closeDetailDialog('新增成功');
                            parent.closeDetailDialog('新增成功');
                        } else {
                            window.closeDetailDialog('修改成功');
                            parent.closeDetailDialog('修改成功');
                        }
                        window.reloadMasterGrid();
                        parent.reloadMasterGrid();
                    } else {
                        $.Notice.error(data.errorMsg);
                    }
@ -64,7 +68,7 @@
        // 关闭
        $('#btnClose').click(function () {
            window.closeDetailDialog();
            parent.closeDetailDialog();
        })
    }

+ 1 - 3
patient-co-manage/redis-cache/src/main/webapp/WEB-INF/views/redis/mq/publisher/listJs.jsp

@ -65,9 +65,7 @@
                urlParms: {
                    id: id,
                    channel: channel
                },
                opener: true,
                load: true
                }
            });
        });

+ 9 - 5
patient-co-manage/redis-cache/src/main/webapp/WEB-INF/views/redis/mq/subscriber/detailJs.jsp

@ -40,17 +40,21 @@
            if (!validator.validate()) { return; }
            var loading = $.ligerDialog.waitting("正在保存数据...");
            dataModel.fetchRemote("${contextRoot}/redis/mq/subscriber/save", {
            var uri = "save";
            if(detailModel.id!=null&&detailModel.id!=-1){
                uri = "update"
            }
            dataModel.fetchRemote("${contextRoot}/redis/mq/subscriber/"+uri, {
                type: 'post',
                data: {data: JSON.stringify($form.Fields.getValues())},
                success: function (data) {
                    if (data.successFlg) {
                        if (detailModel.id) {
                            window.closeDetailDialog('新增成功');
                            parent.closeDetailDialog('新增成功');
                        } else {
                            window.closeDetailDialog('修改成功');
                            parent.closeDetailDialog('修改成功');
                        }
                        window.reloadMasterGrid();
                        parent.reloadMasterGrid();
                    } else {
                        $.Notice.error(data.errorMsg);
                    }
@ -66,7 +70,7 @@
        // 关闭
        $('#btnClose').click(function () {
            window.closeDetailDialog();
            parent.closeDetailDialog();
        })
    }

+ 1 - 3
patient-co-manage/redis-cache/src/main/webapp/WEB-INF/views/redis/mq/subscriber/listJs.jsp

@ -65,9 +65,7 @@
                urlParms: {
                    id: id,
                    channel: channel
                },
                opener: true,
                load: true
                }
            });
        });

+ 25 - 1
patient-co-manage/redis-cache/src/main/webapp/static/develop/module/util.js

@ -431,8 +431,32 @@
                    this.setOptions({parms: params});
                    this.loadData(true);
                }
            }
            },
            //add by lincl end, 2016-5-10
            validateByAjax: function(url, params,type) { // add by ZhangJinJun 2017-11-28
                var result = new $.jValidation.ajax.Result();
                var dataModel = $.DataModel.init();
                if(!type){
                    type = "GET";
                }
                dataModel.fetchRemote(url, {
                    data: params,
                    type: type,
                    async: false,
                    success: function (data) {
                        if (data.successFlg) {
                            result.setResult(true);
                        } else {
                            result.setResult(false);
                            result.setErrorMsg(data.errorMsg);
                        }
                    },
                    error: function () {
                        $.Notice.error('验证发生异常');
                    }
                });
                return result;
            }
        }
    });
})(jQuery, window);

BIN
patient-co/patient-co-wlyy/doc/接口文档/~$i健康API文档.docx


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


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


+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prenatalInspector/PrenatalInspectorPreCardService.java

@ -275,7 +275,7 @@ public class PrenatalInspectorPreCardService extends BaseService {
                            planJson.put("endTime", END_TIME);
                            planJson.put("mensesLast", MENSES_LAST);
                            planJson.put("expectedTime", DateUtil.dateToStrLong(dueday));
                            Date date = new Date();
                            Date date = DateUtil.getDateShort(new Date());
                            List<PrenatalInspectorPlan> plans = prenatalInspectorPlanDao.findByPatient(patientCode);
                            List<PrenatalInspectorPlan> savePlans = new ArrayList<>();