yeshijie преди 7 години
родител
ревизия
e152e3ca05
променени са 19 файла, в които са добавени 270 реда и са изтрити 231 реда
  1. 3 3
      patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/common/vo/MRedisCacheAuthorization.java
  2. 2 0
      patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/common/vo/MRedisCacheCategory.java
  3. 3 3
      patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/common/vo/MRedisCacheKeyRule.java
  4. 3 3
      patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/common/vo/MRedisMqChannel.java
  5. 3 3
      patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/common/vo/MRedisMqPublisher.java
  6. 3 3
      patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/common/vo/MRedisMqSubscriber.java
  7. 7 5
      patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/controller/redis/RedisCacheAuthorizationEndPoint.java
  8. 2 2
      patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/controller/redis/RedisCacheCategoryEndPoint.java
  9. 1 1
      patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/controller/redis/RedisCacheKeyRuleEndPoint.java
  10. 14 2
      patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/controller/redis/RedisIndexController.java
  11. 1 1
      patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/controller/redis/RedisMqChannelEndPoint.java
  12. 1 1
      patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/controller/redis/RedisMqPublisherEndPoint.java
  13. 32 19
      patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/controller/redis/RedisMqSubscriberEndPoint.java
  14. 0 0
      patient-co-manage/redis-cache/src/main/resources/system.properties
  15. 79 76
      patient-co-manage/redis-cache/src/main/webapp/WEB-INF/views/redis/cache/authorization/detailJs.jsp
  16. 1 1
      patient-co-manage/redis-cache/src/main/webapp/WEB-INF/views/redis/cache/authorization/list.jsp
  17. 107 102
      patient-co-manage/redis-cache/src/main/webapp/WEB-INF/views/redis/cache/authorization/listJs.jsp
  18. 6 4
      patient-co-manage/redis-cache/src/main/webapp/WEB-INF/views/redis/cache/category/listJs.jsp
  19. 2 2
      patient-co-manage/redis-cache/src/main/webapp/WEB-INF/views/redis/mq/channel/listJs.jsp

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

@ -14,7 +14,7 @@ import java.util.Date;
 */
public class MRedisCacheAuthorization implements Serializable{
    public Integer id; // 主键
    public Long id; // 主键
    private String categoryCode; // 缓存分类编码
    private String appId; // 应用ID
    private String authorizedCode; // 授权码
@ -31,11 +31,11 @@ public class MRedisCacheAuthorization implements Serializable{
        this.categoryCode = categoryCode;
    }
    public Integer getId() {
    public Long getId() {
        return id;
    }
    public void setId(Integer id) {
    public void setId(Long id) {
        this.id = id;
    }

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

@ -23,6 +23,8 @@ public class MRedisCacheCategory implements Serializable{
    private Date modifyDate; // 修改时间
    private String modifier; // 修改者
    public Long getId() {
        return id;
    }

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

@ -14,7 +14,7 @@ import java.util.Date;
 */
public class MRedisCacheKeyRule implements Serializable{
    public Integer id; // 主键
    public Long id; // 主键
    private String name; // 规则名称
    private String code; // 规则编码
    private String categoryCode; // 缓存分类编码
@ -27,11 +27,11 @@ public class MRedisCacheKeyRule implements Serializable{
    private String modifier; // 修改者
    private String categoryName; // 缓存分类名称
    public Integer getId() {
    public Long getId() {
        return id;
    }
    public void setId(Integer id) {
    public void setId(Long id) {
        this.id = id;
    }

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

@ -14,7 +14,7 @@ import java.util.Date;
 */
public class MRedisMqChannel implements Serializable{
    public Integer id; // 主键
    public Long id; // 主键
    public String channel; // 消息队列编码
    public String channelName; // 消息队列名称
    public String messageTemplate; // 消息模版
@ -28,11 +28,11 @@ public class MRedisMqChannel implements Serializable{
    public String subscriberNum; // 订阅者数
    public String publisherNum; // 发布者数
    public Integer getId() {
    public Long getId() {
        return id;
    }
    public void setId(Integer id) {
    public void setId(Long id) {
        this.id = id;
    }

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

@ -14,7 +14,7 @@ import java.util.Date;
 */
public class MRedisMqPublisher implements Serializable {
    public Integer id; // 主键
    public Long id; // 主键
    public String appId; // 应用ID
    public String authorizedCode; // 授权码
    public String channel; // 消息队列编码
@ -31,11 +31,11 @@ public class MRedisMqPublisher implements Serializable {
        this.channel = channel;
    }
    public Integer getId() {
    public Long getId() {
        return id;
    }
    public void setId(Integer id) {
    public void setId(Long id) {
        this.id = id;
    }

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

@ -14,7 +14,7 @@ import java.util.Date;
 */
public class MRedisMqSubscriber implements Serializable {
    public Integer id; // 主键
    public Long id; // 主键
    public String appId; // 应用ID
    public String subscribedUrl; // 订阅者服务地址
    public String channel; // 消息队列编码
@ -31,11 +31,11 @@ public class MRedisMqSubscriber implements Serializable {
        this.channel = channel;
    }
    public Integer getId() {
    public Long getId() {
        return id;
    }
    public void setId(Integer id) {
    public void setId(Long id) {
        this.id = id;
    }

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

@ -5,7 +5,6 @@ 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;
@ -17,7 +16,10 @@ 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 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;
@ -39,13 +41,13 @@ public class RedisCacheAuthorizationEndPoint extends EnvelopRestEndPoint {
    @ApiOperation("根据ID获取缓存授权")
    @RequestMapping(value = ServiceApi.Redis.CacheAuthorization.GetById, method = RequestMethod.GET)
    public String getById(Model model, Long id) {
    public String getById(Model model, Long id,String categoryCode) {
        try {
            if(id!=null){
                MRedisCacheAuthorization mRedisCacheAuthorization = convertToModel(redisCacheAuthorizationService.getById(id), MRedisCacheAuthorization.class);
                model.addAttribute("detailModel", toJson(mRedisCacheAuthorization));
            }else {
                Object detailModel = new MRedisCacheCategory();
                Object detailModel = new MRedisCacheAuthorization(categoryCode);
                model.addAttribute("detailModel", toJson(detailModel));
            }
        } catch (Exception e) {
@ -142,7 +144,7 @@ public class RedisCacheAuthorizationEndPoint extends EnvelopRestEndPoint {
    @ApiOperation("删除缓存授权")
    @ResponseBody
    @RequestMapping(value = ServiceApi.Redis.CacheAuthorization.Delete, method = RequestMethod.DELETE)
    @RequestMapping(value = ServiceApi.Redis.CacheAuthorization.Delete, method = RequestMethod.POST)
    public Envelop delete(
            @ApiParam(name = "id", value = "缓存授权ID", required = true)
            @RequestParam(value = "id") Long id) {

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

@ -164,10 +164,10 @@ public class RedisCacheCategoryEndPoint extends EnvelopRestEndPoint {
    @ApiOperation("删除缓存分类")
    @ResponseBody
    @RequestMapping(value = ServiceApi.Redis.CacheCategory.Delete, method = RequestMethod.DELETE)
    @RequestMapping(value = ServiceApi.Redis.CacheCategory.Delete, method = RequestMethod.POST)
    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 {

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

@ -129,7 +129,7 @@ public class RedisCacheKeyRuleEndPoint extends EnvelopRestEndPoint {
    @ApiOperation("删除缓存Key规则")
    @ResponseBody
    @RequestMapping(value = ServiceApi.Redis.CacheKeyRule.Delete, method = RequestMethod.DELETE)
    @RequestMapping(value = ServiceApi.Redis.CacheKeyRule.Delete, method = RequestMethod.POST)
    public Envelop delete(
            @ApiParam(name = "id", value = "缓存Key规则ID", required = true)
            @RequestParam(value = "id") Integer id) {

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

@ -2,6 +2,7 @@ package com.yihu.wlyy.controller.redis;
import com.yihu.wlyy.controller.BaseController;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
@ -17,6 +18,16 @@ public class RedisIndexController extends BaseController {
        return "redis/mq/channel/list";
    }
    @RequestMapping(value = "pub", method = RequestMethod.GET)
    public String pub(){
        return "redis/mq/publisher/list";
    }
    @RequestMapping(value = "sub", method = RequestMethod.GET)
    public String sub(){
        return "redis/mq/sublisher/list";
    }
    @RequestMapping(value = "cacheCategory", method = RequestMethod.GET)
    public String cacheCategory(){
        return "redis/cache/category/list";
@ -28,8 +39,9 @@ public class RedisIndexController extends BaseController {
    }
    @RequestMapping(value = "authorization/index", method = RequestMethod.GET)
    public String authorization_index(){
        return "redis/cache/keyRule/list";
    public String authorization_index(Model model,String categoryCode){
        model.addAttribute("categoryCode", categoryCode);
        return "/redis/cache/authorization/list";
    }
}

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

@ -161,7 +161,7 @@ public class RedisMqChannelEndPoint extends EnvelopRestEndPoint {
    @ApiOperation("删除消息队列")
    @ResponseBody
    @RequestMapping(value = ServiceApi.Redis.MqChannel.Delete, method = RequestMethod.DELETE)
    @RequestMapping(value = ServiceApi.Redis.MqChannel.Delete, method = RequestMethod.POST)
    public Envelop delete(
            @ApiParam(name = "id", value = "消息队列ID", required = true)
            @RequestParam(value = "id") Long id) {

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

@ -135,7 +135,7 @@ public class RedisMqPublisherEndPoint extends EnvelopRestEndPoint {
    @ApiOperation("删除消息发布者")
    @ResponseBody
    @RequestMapping(value = ServiceApi.Redis.MqPublisher.Delete, method = RequestMethod.DELETE)
    @RequestMapping(value = ServiceApi.Redis.MqPublisher.Delete, method = RequestMethod.POST)
    public Envelop delete(
            @ApiParam(name = "id", value = "消息发布者ID", required = true)
            @RequestParam(value = "id") Integer id) {

+ 32 - 19
patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/controller/redis/RedisMqSubscriberEndPoint.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.MRedisMqSubscriber;
import com.yihu.wlyy.entity.User;
import com.yihu.wlyy.entity.redis.RedisMqSubscriber;
import com.yihu.wlyy.service.redis.pubsub.RedisMqChannelService;
import com.yihu.wlyy.service.redis.pubsub.RedisMqSubscriberService;
@ -19,6 +21,7 @@ import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
@ -41,22 +44,23 @@ public class RedisMqSubscriberEndPoint extends EnvelopRestEndPoint {
    @ApiOperation("根据ID获取消息订阅者")
    @RequestMapping(value = ServiceApi.Redis.MqSubscriber.GetById, method = RequestMethod.GET)
    public Envelop getById(Model model, Long id) {
        Envelop envelop = new Envelop();
        envelop.setSuccessFlg(false);
    public String getById(Model model, Long id) {
        try {
            MRedisMqSubscriber mRedisMqSubscriber = convertToModel(redisMqSubscriberService.getById(id), MRedisMqSubscriber.class);
            envelop.setObj(mRedisMqSubscriber);
            envelop.setSuccessFlg(true);
            envelop.setErrorMsg("成功获取消息订阅者。");
            if(id!=null){
                MRedisMqSubscriber mRedisMqSubscriber = convertToModel(redisMqSubscriberService.getById(id), MRedisMqSubscriber.class);
                model.addAttribute("detailModel", toJson(mRedisMqSubscriber));
            }else {
                Object detailModel = new MRedisCacheCategory();
                model.addAttribute("detailModel", toJson(detailModel));
            }
        } catch (Exception e) {
            e.printStackTrace();
            envelop.setErrorMsg("获取消息订阅者发生异常:" + e.getMessage());
        }
        return envelop;
        return "/redis/mq/subscriber/detail";
    }
    @ApiOperation(value = "根据条件获取消息订阅者")
    @ResponseBody
    @RequestMapping(value = ServiceApi.Redis.MqSubscriber.Search, method = RequestMethod.GET)
    public Envelop search(
            @ApiParam(name = "fields", value = "返回的字段,为空则返回全部字段")
@ -86,14 +90,18 @@ public class RedisMqSubscriberEndPoint extends EnvelopRestEndPoint {
    }
    @ApiOperation("新增消息订阅者")
    @ResponseBody
    @RequestMapping(value = ServiceApi.Redis.MqSubscriber.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 {
            RedisMqSubscriber newEntity = objectMapper.readValue(entityJson, RedisMqSubscriber.class);
            RedisMqSubscriber newEntity = objectMapper.readValue(data, RedisMqSubscriber.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 = redisMqSubscriberService.save(newEntity);
            MRedisMqSubscriber mRedisMqSubscriber = convertToModel(newEntity, MRedisMqSubscriber.class);
@ -108,14 +116,16 @@ public class RedisMqSubscriberEndPoint extends EnvelopRestEndPoint {
    }
    @ApiOperation("更新消息订阅者")
    @RequestMapping(value = ServiceApi.Redis.MqSubscriber.Save, method = RequestMethod.PUT)
    public Envelop update(
            @ApiParam(value = "消息订阅者JSON", required = true)
            @RequestBody String entityJson) {
    @ResponseBody
    @RequestMapping(value = ServiceApi.Redis.MqSubscriber.Update, method = RequestMethod.POST)
    public Envelop update(String data) {
        Envelop envelop = new Envelop();
        envelop.setSuccessFlg(false);
        try {
            RedisMqSubscriber updateEntity = objectMapper.readValue(entityJson, RedisMqSubscriber.class);
            RedisMqSubscriber updateEntity = objectMapper.readValue(data, RedisMqSubscriber.class);
            User currentUser = (User) request.getSession().getAttribute("current_user");
            updateEntity.setModifyDate(new Date());
            updateEntity.setModifier(currentUser.getCode());
            updateEntity = redisMqSubscriberService.save(updateEntity);
            MRedisMqSubscriber mRedisMqSubscriber = convertToModel(updateEntity, MRedisMqSubscriber.class);
@ -130,7 +140,8 @@ public class RedisMqSubscriberEndPoint extends EnvelopRestEndPoint {
    }
    @ApiOperation("删除消息订阅者")
    @RequestMapping(value = ServiceApi.Redis.MqSubscriber.Delete, method = RequestMethod.DELETE)
    @ResponseBody
    @RequestMapping(value = ServiceApi.Redis.MqSubscriber.Delete, method = RequestMethod.POST)
    public Envelop delete(
            @ApiParam(name = "id", value = "消息订阅者ID", required = true)
            @RequestParam(value = "id") Integer id) {
@ -149,6 +160,7 @@ public class RedisMqSubscriberEndPoint extends EnvelopRestEndPoint {
    }
    @ApiOperation("验证指定消息队列中订阅者应用ID是否唯一")
    @ResponseBody
    @RequestMapping(value = ServiceApi.Redis.MqSubscriber.IsUniqueAppId, method = RequestMethod.GET)
    public Envelop isUniqueAppId(
            @ApiParam(name = "id", value = "消息订阅者ID", required = true)
@ -173,6 +185,7 @@ public class RedisMqSubscriberEndPoint extends EnvelopRestEndPoint {
    }
    @ApiOperation("验证指定消息队列中订阅者服务地址是否唯一")
    @ResponseBody
    @RequestMapping(value = ServiceApi.Redis.MqSubscriber.IsUniqueSubscribedUrl, method = RequestMethod.GET)
    public Envelop isUniqueSubscribedUrl(
            @ApiParam(name = "id", value = "消息订阅者ID", required = true)

+ 0 - 0
patient-co-manage/redis-cache/src/main/resources/system.properties


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

@ -2,94 +2,97 @@
<script>
    var detailModel = ${detailModel};
    var dataModel = $.DataModel.init();
    var validator;
    var $form = $("#redisCacheAuthorizationForm");
(function ($, win) {
    $(function () {
        init();
    });
    function init() {
        validator = customFormValidator();
        initForm();
        bindEvents();
    }
        var detailModel = ${detailModel};
        var dataModel = $.DataModel.init();
        var validator;
        var $form = $("#redisCacheAuthorizationForm");
    function initForm() {
        $('#categoryCode').ligerTextBox({width: 240, disabled: true, readonly: true});
        var appIdTb = $('#appId').ligerTextBox({width: 240});
        $('#authorizedCode').ligerTextBox({width: 240, disabled: true, readonly: true});
        $('#remark').ligerTextBox({width: 240, height: 150});
        $(function () {
            init();
        });
        if(detailModel.id) {
            appIdTb.setDisabled(true);
            appIdTb.setReadonly(true);
        function init() {
            validator = customFormValidator();
            initForm();
            bindEvents();
        }
        $form.attrScan();
        $form.Fields.fillValues(detailModel);
    }
    function bindEvents() {
        // 保存
        $('#btnSave').click(function () {
            if (!validator.validate()) { return; }
        function initForm() {
            $('#categoryCode').ligerTextBox({width: 240, disabled: true, readonly: true});
            var appIdTb = $('#appId').ligerTextBox({width: 240});
            $('#authorizedCode').ligerTextBox({width: 240, disabled: true, readonly: true});
            $('#remark').ligerTextBox({width: 240, height: 150});
            var loading = $.ligerDialog.waitting("正在保存数据...");
            var uri = "save";
            if(detailModel.id!=null&&detailModel.id!=-1){
                uri = "update"
            if(detailModel.id) {
                appIdTb.setDisabled(true);
                appIdTb.setReadonly(true);
            }
            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) {
                            parent.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/authorization/"+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 {
                            parent.closeDetailDialog('修改成功');
                            $.Notice.error(data.errorMsg);
                        }
                        parent.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 () {
            parent.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 'appId':
                        var appId = $("#appId").val();
                        if(!$.Util.isStrEquals(appId, detailModel.appId)) {
                            var ulr = "${contextRoot}/redis/cache/authorization/isUniqueAppId";
                            return $.Util.validateByAjax(ulr, {id: id, categoryCode: categoryCode, appId: appId});
                        }
                        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 'appId':
                            var appId = $("#appId").val();
                            if(!$.Util.isStrEquals(appId, detailModel.appId)) {
                                var ulr = "${contextRoot}/redis/cache/authorization/isUniqueAppId";
                                return $.Util.validateByAjax(ulr, {id: id, categoryCode: detailModel.categoryCode, appId: appId});
                            }
                            break;
                    }
                }
            }
        });
    }
            });
        }
    });
})(jQuery, window)
</script>

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

@ -12,7 +12,7 @@
<div class="m-form-inline">
    <div id="conditionArea" class="f-mb10 f-mr10" align="right">
        <div class="body-head f-h30" align="left">
            <a id="btn_back" class="f-fwb">返回上一层 </a>
            <a id="btn_back" class="f-fwb" j>返回上一层 </a>
            <span class="f-ml20">缓存分类编码:${categoryCode}</span>
        </div>
    </div>

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

@ -3,121 +3,126 @@
<script>
    var dataModel = $.DataModel.init();
    var categoryCode = '${categoryCode}';
    var detailDialog = null;
    var grid = null;
(function ($, win) {
    $(function () {
        init();
    });
    function init() {
        initWidget();
        bindEvents();
    }
        var dataModel = $.DataModel.init();
        var categoryCode = '${categoryCode}';
        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: '${contextRoot}/redis/cache/authorization/search',
            urlParms: { categoryCode: categoryCode },
            method:'GET',
            columns: [
                {display: 'ID', name: 'id', hide: true},
                {display: '应用ID', name: 'appId', width: '10%', isAllowHide: false, align: 'left'},
                {display: '授权码', name: 'authorizedCode', width: '25%', isAllowHide: false, align: 'left'},
                {display: '修改时间', name: 'modifyDate', width: '15%', isAllowHide: false, align: 'left'},
                {display: '备注', name: 'remark', width: '25%', isAllowHide: false, align: 'left'},
                {display: '操作', name: 'operator', minWidth: 120, align: 'center',
                    render: function (row) {
                        var html = '';
                        html += '<sec:authorize url="/redis/cache/authorization/detail"><a class="grid_edit f-ml10" title="编辑" href="javascript:void(0)" onclick="javascript:' + $.Util.format("$.publish('{0}',['{1}','{2}'])", "redis:cache:authorization:detail", row.id, 'modify') + '"></a></sec:authorize>';
                        html += '<sec:authorize url="/redis/cache/authorization/delete"><a class="grid_delete" title="删除" href="javascript:void(0)"  onclick="javascript:' + $.Util.format("$.publish('{0}',['{1}'])", "redis:cache:authorization:delete", row.id) + '"></a></sec:authorize>';
                        return html;
                    }
                }
            ],
            allowHideColumn: false,
            usePager: true
        }));
        grid.collapseAll();
        grid.adjustToWidth();
    }
        function init() {
            initWidget();
            bindEvents();
        }
    function bindEvents() {
        // 新增/修改
        $.subscribe('redis:cache:authorization:detail', function (event, id, mode) {
            var title = '新增缓存授权';
            if (mode == 'modify') {
                title = '修改缓存授权';
            }
            detailDialog = $.ligerDialog.open({
                height: 450,
                width: 480,
                title: title,
                url: '${contextRoot}/redis/cache/authorization/detail',
                urlParms: {
                    id: id,
                    categoryCode: categoryCode
        function initWidget() {
            $('#searchContent').ligerTextBox({
                width: 200, isSearch: true, search: function () {
                    reloadGrid();
                }
            });
        });
        // 删除
        $.subscribe('redis:cache:authorization:delete', function (event, id) {
            $.Notice.confirm('删除后,该应用ID不能调用缓存服务接口,来设置所属分类下Key规则的缓存数据,确认要删除吗?', function (r) {
                if (r) {
                    var loading = $.ligerDialog.waitting("正在删除数据...");
                    dataModel.updateRemote('${contextRoot}/redis/cache/authorization/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: '${contextRoot}/redis/cache/authorization/search',
                urlParms: { categoryCode: categoryCode },
                method:'GET',
                columns: [
                    {display: 'ID', name: 'id', hide: true},
                    {display: '应用ID', name: 'appId', width: '10%', isAllowHide: false, align: 'left'},
                    {display: '授权码', name: 'authorizedCode', width: '25%', isAllowHide: false, align: 'left'},
                    {display: '修改时间', name: 'modifyDate', width: '15%', isAllowHide: false, align: 'left'},
                    {display: '备注', name: 'remark', width: '25%', isAllowHide: false, align: 'left'},
                    {display: '操作', name: 'operator', minWidth: 120, align: 'center',
                        render: function (row) {
                            var html = '';
                            html += '<sec:authorize url="/redis/cache/authorization/detail"><a class="grid_edit f-ml10" title="编辑" href="javascript:void(0)" onclick="javascript:' + $.Util.format("$.publish('{0}',['{1}','{2}'])", "redis:cache:authorization:detail", row.id, 'modify') + '"></a></sec:authorize>';
                            html += '<sec:authorize url="/redis/cache/authorization/delete"><a class="grid_delete" title="删除" href="javascript:void(0)"  onclick="javascript:' + $.Util.format("$.publish('{0}',['{1}'])", "redis:cache:authorization:delete", row.id) + '"></a></sec:authorize>';
                            return html;
                        }
                    });
                    }
                ],
                allowHideColumn: false,
                usePager: true
            }));
            grid.collapseAll();
            grid.adjustToWidth();
        }
        function bindEvents() {
            // 新增/修改
            $.subscribe('redis:cache:authorization:detail', function (event, id, mode) {
                var title = '新增缓存授权';
                if (mode == 'modify') {
                    title = '修改缓存授权';
                }
            })
        });
                detailDialog = $.ligerDialog.open({
                    height: 450,
                    width: 480,
                    title: title,
                    url: '${contextRoot}/redis/cache/authorization/detail',
                    urlParms: {
                        id: id,
                        categoryCode: categoryCode
                    }
                });
            });
        // 返回上一页
        $('#btn_back').click(function(){
            $('#contentPage').empty();
            $('#contentPage').load('${contextRoot}/redis/cache/category/index');
        });
            // 删除
            $.subscribe('redis:cache:authorization:delete', function (event, id) {
                $.Notice.confirm('删除后,该应用ID不能调用缓存服务接口,来设置所属分类下Key规则的缓存数据,确认要删除吗?', function (r) {
                    if (r) {
                        var loading = $.ligerDialog.waitting("正在删除数据...");
                        dataModel.updateRemote('${contextRoot}/redis/cache/authorization/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();
                            }
                        });
                    }
                })
            });
    }
            // 返回上一页
            $('#btn_back').click(function(){
                var url = '${contextRoot}/admin/redis/cacheCategory';
                window.location.href = url;
//                $('#contentPage').empty();
//                $('#contentPage').load(url,{});
            });
    function reloadGrid() {
        var params = {
            searchContent: $('#searchContent').val(),
            categoryCode: categoryCode
        };
        $.Util.reloadGrid.call(grid, '${contextRoot}/redis/cache/authorization/search', params);
    }
        }
    /*-- 与明细 Dialog 页面间回调的函数 --*/
    window.reloadMasterGrid = function() {
        reloadGrid();
    };
    window.closeDetailDialog = function (type, msg) {
        detailDialog.close();
        msg && $.Notice.success(msg);
    };
        function reloadGrid() {
            var params = {
                searchContent: $('#searchContent').val(),
                categoryCode: categoryCode
            };
            $.Util.reloadGrid.call(grid, '${contextRoot}/redis/cache/authorization/search', params);
        }
        /*-- 与明细 Dialog 页面间回调的函数 --*/
        window.reloadMasterGrid = function() {
        };
        window.closeDetailDialog = function (type, msg) {
            detailDialog.close();
            reloadGrid();
            msg && $.Notice.success(msg);
        };
    });
})(jQuery, window)
</script>

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

@ -34,7 +34,9 @@
                    {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>';
                            <sec:authorize url="/redis/cache/category/authorizationList">
                            html += '<a class="label_a f-ml10" title="应用授权" href="${contextRoot}/admin/redis/authorization/index?categoryCode='+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;
@ -52,7 +54,7 @@
        function bindEvents() {
            // 应用授权
            $.subscribe('redis:cache:category:authorizationList', function (event, categoryCode) {
                var url = '${contextRoot}/redis/cache/authorization/index?';
                var url = '${contextRoot}/admin/redis/authorization/index?';
                $("#contentPage").empty();
                $("#contentPage").load(url,{categoryCode: categoryCode});
            });
@ -109,10 +111,10 @@
        }
        /*-- 与明细 Dialog 页面间回调的函数 --*/
        win.reloadMasterGrid = function() {
        window.reloadMasterGrid = function() {
            reloadGrid();
        };
        win.closeDetailDialog = function (type, msg) {
        window.closeDetailDialog = function (type, msg) {
            detailDialog.close();
            msg && $.Notice.success(msg);
        };

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

@ -56,14 +56,14 @@
    function bindEvents() {
        // 发布者
        $.subscribe('redis:mq:channel:publisherList', function (event, channel) {
            var url = '${contextRoot}/redis/mq/publisher/index?';
            var url = '${contextRoot}/admin/redis/publisher/index?';
            $("#contentPage").empty();
            $("#contentPage").load(url,{channel: channel});
        });
        // 订阅者
        $.subscribe('redis:mq:channel:subscriberList', function (event, channel) {
            var url = '${contextRoot}/redis/mq/subscriber/index?';
            var url = '${contextRoot}/admin/redis/subscriber/index?';
            $("#contentPage").empty();
            $("#contentPage").load(url,{channel: channel});
        });