瀏覽代碼

Merge branch 'dev' of http://192.168.1.220:10080/Amoy/patient-co-management into dev

zd_123 7 年之前
父節點
當前提交
0337839a9a
共有 100 個文件被更改,包括 3594 次插入1945 次删除
  1. 457 0
      common/common-entity/src/main/java/com/yihu/wlyy/entity/manage/User.java
  2. 3 3
      patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/common/vo/MRedisCacheAuthorization.java
  3. 2 0
      patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/common/vo/MRedisCacheCategory.java
  4. 3 3
      patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/common/vo/MRedisCacheKeyRule.java
  5. 3 3
      patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/common/vo/MRedisMqChannel.java
  6. 3 3
      patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/common/vo/MRedisMqPublisher.java
  7. 3 3
      patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/common/vo/MRedisMqSubscriber.java
  8. 0 220
      patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/controller/manager/user/UserController.java
  9. 7 5
      patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/controller/redis/RedisCacheAuthorizationEndPoint.java
  10. 2 2
      patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/controller/redis/RedisCacheCategoryEndPoint.java
  11. 31 15
      patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/controller/redis/RedisCacheKeyRuleEndPoint.java
  12. 4 4
      patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/controller/redis/RedisCacheStatisticsEndPoint.java
  13. 16 2
      patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/controller/redis/RedisIndexController.java
  14. 9 3
      patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/controller/redis/RedisMqChannelEndPoint.java
  15. 20 11
      patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/controller/redis/RedisMqPublisherEndPoint.java
  16. 45 23
      patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/controller/redis/RedisMqSubscriberEndPoint.java
  17. 25 16
      patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/controller/redis/RedisScheduledController.java
  18. 17 4
      patient-co-manage/redis-cache/src/main/resources/application.yml
  19. 0 0
      patient-co-manage/redis-cache/src/main/resources/system.properties
  20. 1 0
      patient-co-manage/redis-cache/src/main/webapp/WEB-INF/views/head/page_foot.jsp
  21. 0 14
      patient-co-manage/redis-cache/src/main/webapp/WEB-INF/views/main.jsp
  22. 79 76
      patient-co-manage/redis-cache/src/main/webapp/WEB-INF/views/redis/cache/authorization/detailJs.jsp
  23. 1 1
      patient-co-manage/redis-cache/src/main/webapp/WEB-INF/views/redis/cache/authorization/list.jsp
  24. 107 102
      patient-co-manage/redis-cache/src/main/webapp/WEB-INF/views/redis/cache/authorization/listJs.jsp
  25. 6 4
      patient-co-manage/redis-cache/src/main/webapp/WEB-INF/views/redis/cache/category/listJs.jsp
  26. 13 3
      patient-co-manage/redis-cache/src/main/webapp/WEB-INF/views/redis/cache/keyRule/detail.jsp
  27. 98 95
      patient-co-manage/redis-cache/src/main/webapp/WEB-INF/views/redis/cache/keyRule/detailJs.jsp
  28. 12 1
      patient-co-manage/redis-cache/src/main/webapp/WEB-INF/views/redis/cache/keyRule/list.jsp
  29. 206 203
      patient-co-manage/redis-cache/src/main/webapp/WEB-INF/views/redis/cache/keyRule/listJs.jsp
  30. 12 2
      patient-co-manage/redis-cache/src/main/webapp/WEB-INF/views/redis/mq/channel/detail.jsp
  31. 86 83
      patient-co-manage/redis-cache/src/main/webapp/WEB-INF/views/redis/mq/channel/detailJs.jsp
  32. 12 1
      patient-co-manage/redis-cache/src/main/webapp/WEB-INF/views/redis/mq/channel/list.jsp
  33. 117 109
      patient-co-manage/redis-cache/src/main/webapp/WEB-INF/views/redis/mq/channel/listJs.jsp
  34. 12 2
      patient-co-manage/redis-cache/src/main/webapp/WEB-INF/views/redis/mq/publisher/detail.jsp
  35. 79 76
      patient-co-manage/redis-cache/src/main/webapp/WEB-INF/views/redis/mq/publisher/detailJs.jsp
  36. 12 1
      patient-co-manage/redis-cache/src/main/webapp/WEB-INF/views/redis/mq/publisher/list.jsp
  37. 107 102
      patient-co-manage/redis-cache/src/main/webapp/WEB-INF/views/redis/mq/publisher/listJs.jsp
  38. 12 2
      patient-co-manage/redis-cache/src/main/webapp/WEB-INF/views/redis/mq/subscriber/detail.jsp
  39. 88 85
      patient-co-manage/redis-cache/src/main/webapp/WEB-INF/views/redis/mq/subscriber/detailJs.jsp
  40. 12 1
      patient-co-manage/redis-cache/src/main/webapp/WEB-INF/views/redis/mq/subscriber/list.jsp
  41. 107 102
      patient-co-manage/redis-cache/src/main/webapp/WEB-INF/views/redis/mq/subscriber/listJs.jsp
  42. 0 42
      patient-co-manage/redis-cache/src/main/webapp/WEB-INF/views/user/user_list.jsp
  43. 0 202
      patient-co-manage/redis-cache/src/main/webapp/WEB-INF/views/user/user_list_js.jsp
  44. 0 88
      patient-co-manage/redis-cache/src/main/webapp/WEB-INF/views/user/user_modify.jsp
  45. 0 228
      patient-co-manage/redis-cache/src/main/webapp/WEB-INF/views/user/user_modify_js.jsp
  46. 1 0
      patient-co-manage/redis-cache/src/main/webapp/static/develop/lib/plugin/echarts/2.2.7/js/chart/bar.js
  47. 1 0
      patient-co-manage/redis-cache/src/main/webapp/static/develop/lib/plugin/echarts/2.2.7/js/chart/chord.js
  48. 1 0
      patient-co-manage/redis-cache/src/main/webapp/static/develop/lib/plugin/echarts/2.2.7/js/chart/eventRiver.js
  49. 1 0
      patient-co-manage/redis-cache/src/main/webapp/static/develop/lib/plugin/echarts/2.2.7/js/chart/force.js
  50. 1 0
      patient-co-manage/redis-cache/src/main/webapp/static/develop/lib/plugin/echarts/2.2.7/js/chart/funnel.js
  51. 1 0
      patient-co-manage/redis-cache/src/main/webapp/static/develop/lib/plugin/echarts/2.2.7/js/chart/gauge.js
  52. 1 0
      patient-co-manage/redis-cache/src/main/webapp/static/develop/lib/plugin/echarts/2.2.7/js/chart/heatmap.js
  53. 1 0
      patient-co-manage/redis-cache/src/main/webapp/static/develop/lib/plugin/echarts/2.2.7/js/chart/k.js
  54. 1 0
      patient-co-manage/redis-cache/src/main/webapp/static/develop/lib/plugin/echarts/2.2.7/js/chart/line.js
  55. 13 0
      patient-co-manage/redis-cache/src/main/webapp/static/develop/lib/plugin/echarts/2.2.7/js/chart/map.js
  56. 1 0
      patient-co-manage/redis-cache/src/main/webapp/static/develop/lib/plugin/echarts/2.2.7/js/chart/pie.js
  57. 1 0
      patient-co-manage/redis-cache/src/main/webapp/static/develop/lib/plugin/echarts/2.2.7/js/chart/radar.js
  58. 1 0
      patient-co-manage/redis-cache/src/main/webapp/static/develop/lib/plugin/echarts/2.2.7/js/chart/scatter.js
  59. 1 0
      patient-co-manage/redis-cache/src/main/webapp/static/develop/lib/plugin/echarts/2.2.7/js/chart/tree.js
  60. 1 0
      patient-co-manage/redis-cache/src/main/webapp/static/develop/lib/plugin/echarts/2.2.7/js/chart/treemap.js
  61. 1 0
      patient-co-manage/redis-cache/src/main/webapp/static/develop/lib/plugin/echarts/2.2.7/js/chart/venn.js
  62. 2 0
      patient-co-manage/redis-cache/src/main/webapp/static/develop/lib/plugin/echarts/2.2.7/js/chart/wordCloud.js
  63. 35 0
      patient-co-manage/redis-cache/src/main/webapp/static/develop/lib/plugin/echarts/2.2.7/js/echarts-all.js
  64. 20 0
      patient-co-manage/redis-cache/src/main/webapp/static/develop/lib/plugin/echarts/2.2.7/js/echarts.js
  65. 79 0
      patient-co-manage/redis-cache/src/main/webapp/static/develop/lib/plugin/echarts/2.2.7/js/util/accMath.js
  66. 40 0
      patient-co-manage/redis-cache/src/main/webapp/static/develop/lib/plugin/echarts/2.2.7/js/util/coordinates.js
  67. 162 0
      patient-co-manage/redis-cache/src/main/webapp/static/develop/lib/plugin/echarts/2.2.7/js/util/date.js
  68. 624 0
      patient-co-manage/redis-cache/src/main/webapp/static/develop/lib/plugin/echarts/2.2.7/js/util/ecAnimation.js
  69. 115 0
      patient-co-manage/redis-cache/src/main/webapp/static/develop/lib/plugin/echarts/2.2.7/js/util/ecData.js
  70. 444 0
      patient-co-manage/redis-cache/src/main/webapp/static/develop/lib/plugin/echarts/2.2.7/js/util/ecEffect.js
  71. 81 0
      patient-co-manage/redis-cache/src/main/webapp/static/develop/lib/plugin/echarts/2.2.7/js/util/ecQuery.js
  72. 48 0
      patient-co-manage/redis-cache/src/main/webapp/static/develop/lib/plugin/echarts/2.2.7/js/util/kwargs.js
  73. 9 0
      patient-co-manage/redis-cache/src/main/webapp/static/develop/lib/plugin/echarts/2.2.7/js/util/mapData/geoCoord.js
  74. 3 0
      patient-co-manage/redis-cache/src/main/webapp/static/develop/lib/plugin/echarts/2.2.7/js/util/mapData/geoJson/an_hui_geo.js
  75. 3 0
      patient-co-manage/redis-cache/src/main/webapp/static/develop/lib/plugin/echarts/2.2.7/js/util/mapData/geoJson/ao_men_geo.js
  76. 3 0
      patient-co-manage/redis-cache/src/main/webapp/static/develop/lib/plugin/echarts/2.2.7/js/util/mapData/geoJson/bei_jing_geo.js
  77. 3 0
      patient-co-manage/redis-cache/src/main/webapp/static/develop/lib/plugin/echarts/2.2.7/js/util/mapData/geoJson/china_geo.js
  78. 3 0
      patient-co-manage/redis-cache/src/main/webapp/static/develop/lib/plugin/echarts/2.2.7/js/util/mapData/geoJson/chong_qing_geo.js
  79. 3 0
      patient-co-manage/redis-cache/src/main/webapp/static/develop/lib/plugin/echarts/2.2.7/js/util/mapData/geoJson/fu_jian_geo.js
  80. 3 0
      patient-co-manage/redis-cache/src/main/webapp/static/develop/lib/plugin/echarts/2.2.7/js/util/mapData/geoJson/gan_su_geo.js
  81. 3 0
      patient-co-manage/redis-cache/src/main/webapp/static/develop/lib/plugin/echarts/2.2.7/js/util/mapData/geoJson/guang_dong_geo.js
  82. 3 0
      patient-co-manage/redis-cache/src/main/webapp/static/develop/lib/plugin/echarts/2.2.7/js/util/mapData/geoJson/guang_xi_geo.js
  83. 3 0
      patient-co-manage/redis-cache/src/main/webapp/static/develop/lib/plugin/echarts/2.2.7/js/util/mapData/geoJson/gui_zhou_geo.js
  84. 3 0
      patient-co-manage/redis-cache/src/main/webapp/static/develop/lib/plugin/echarts/2.2.7/js/util/mapData/geoJson/hai_nan_geo.js
  85. 3 0
      patient-co-manage/redis-cache/src/main/webapp/static/develop/lib/plugin/echarts/2.2.7/js/util/mapData/geoJson/he_bei_geo.js
  86. 3 0
      patient-co-manage/redis-cache/src/main/webapp/static/develop/lib/plugin/echarts/2.2.7/js/util/mapData/geoJson/he_nan_geo.js
  87. 3 0
      patient-co-manage/redis-cache/src/main/webapp/static/develop/lib/plugin/echarts/2.2.7/js/util/mapData/geoJson/hei_long_jiang_geo.js
  88. 3 0
      patient-co-manage/redis-cache/src/main/webapp/static/develop/lib/plugin/echarts/2.2.7/js/util/mapData/geoJson/hu_bei_geo.js
  89. 3 0
      patient-co-manage/redis-cache/src/main/webapp/static/develop/lib/plugin/echarts/2.2.7/js/util/mapData/geoJson/hu_nan_geo.js
  90. 3 0
      patient-co-manage/redis-cache/src/main/webapp/static/develop/lib/plugin/echarts/2.2.7/js/util/mapData/geoJson/ji_lin_geo.js
  91. 3 0
      patient-co-manage/redis-cache/src/main/webapp/static/develop/lib/plugin/echarts/2.2.7/js/util/mapData/geoJson/jiang_su_geo.js
  92. 3 0
      patient-co-manage/redis-cache/src/main/webapp/static/develop/lib/plugin/echarts/2.2.7/js/util/mapData/geoJson/jiang_xi_geo.js
  93. 3 0
      patient-co-manage/redis-cache/src/main/webapp/static/develop/lib/plugin/echarts/2.2.7/js/util/mapData/geoJson/liao_ning_geo.js
  94. 3 0
      patient-co-manage/redis-cache/src/main/webapp/static/develop/lib/plugin/echarts/2.2.7/js/util/mapData/geoJson/nei_meng_gu_geo.js
  95. 3 0
      patient-co-manage/redis-cache/src/main/webapp/static/develop/lib/plugin/echarts/2.2.7/js/util/mapData/geoJson/ning_xia_geo.js
  96. 3 0
      patient-co-manage/redis-cache/src/main/webapp/static/develop/lib/plugin/echarts/2.2.7/js/util/mapData/geoJson/qing_hai_geo.js
  97. 3 0
      patient-co-manage/redis-cache/src/main/webapp/static/develop/lib/plugin/echarts/2.2.7/js/util/mapData/geoJson/shan_dong_geo.js
  98. 3 0
      patient-co-manage/redis-cache/src/main/webapp/static/develop/lib/plugin/echarts/2.2.7/js/util/mapData/geoJson/shan_xi_1_geo.js
  99. 3 0
      patient-co-manage/redis-cache/src/main/webapp/static/develop/lib/plugin/echarts/2.2.7/js/util/mapData/geoJson/shan_xi_2_geo.js
  100. 0 0
      patient-co-manage/redis-cache/src/main/webapp/static/develop/lib/plugin/echarts/2.2.7/js/util/mapData/geoJson/shang_hai_geo.js

+ 457 - 0
common/common-entity/src/main/java/com/yihu/wlyy/entity/manage/User.java

@ -0,0 +1,457 @@
package com.yihu.wlyy.entity.manage;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.google.common.collect.ImmutableList;
import com.yihu.wlyy.entity.IdEntity;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.builder.ToStringBuilder;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.util.Date;
import java.util.List;
/**
 * 用户表
 * @author George
 *
 */
@Entity
@Table(name = "wlyy_user")
public class User extends IdEntity {
    private static final long serialVersionUID = 5397123441067268436L;
	// 用户标识
	private String code;
    // 姓名
    private String name;
    // 手机号
    private String mobile;
    // 登录密码
    private String password;
    // 密码加密密钥
    private String salt;
    // 用户类型:1超级管理员,2医生   3客服管理员   4普通客服
    private int type;
    //用户类型名称
    private String typeName;
    //用户拥有的权限标识,以逗号分隔
    private String roles;
    // 用户找拥有的权限以逗号分隔
    private String roleName;
	// 添加日期
	private Date czrq;
	// 所属机构
	private long organizationId;
    // 所属机构名称
    private String organizationName;
    //客服工号
    private String jobNo;
    //客服坐席号
    private String seat;
    //客服电话
    private String phone;
    //是否在线 0不在线   1离开  2在线
    private String online;
    public String getCode() {
        return code;
    }
    public void setCode(String code) {
        this.code = code;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public String getMobile() {
        return mobile;
    }
    public void setMobile(String mobile) {
        this.mobile = mobile;
    }
    public String getPassword() {
        return password;
    }
    public void setPassword(String password) {
        this.password = password;
    }
    public String getSalt() {
        return salt;
    }
    public void setSalt(String salt) {
        this.salt = salt;
    }
    public int getType() {
        return type;
    }
    public void setType(int type) {
        this.type = type;
    }
    @Transient
    public String getTypeName() {
        return typeName;
    }
    public void setTypeName(String typeName) {
        this.typeName = typeName;
    }
    public String getRoles() {
        return roles;
    }
    public void setRoles(String roles) {
        this.roles = roles;
    }
    @Transient
    @JsonIgnore
    public String getRoleName() {
        return roleName;
    }
    public void setRoleName(String roleName) {
        this.roleName = roleName;
    }
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    public Date getCzrq() {
        return czrq;
    }
    public void setCzrq(Date czrq) {
        this.czrq = czrq;
    }
    @Column(name = "organization_id")
    public long getOrganizationId() {
        return organizationId;
    }
    public void setOrganizationId(long organizationId) {
        this.organizationId = organizationId;
    }
    @Transient
    public String getOrganizationName() {
        return organizationName;
    }
    public void setOrganizationName(String organizationName) {
        this.organizationName = organizationName;
    }
    @Override
    public String toString() {
        return ToStringBuilder.reflectionToString(this);
    }
    @Transient
    @JsonIgnore
    public List<String> getRoleList() {
        // 角色列表在数据库中实际以逗号分隔字符串存储,因此返回不能修改的List.
        return ImmutableList.copyOf(StringUtils.split("", ","));
    }
    public String getJobNo() {
        return jobNo;
    }
    public void setJobNo(String jobNo) {
        this.jobNo = jobNo;
    }
    public String getSeat() {
        return seat;
    }
    public void setSeat(String seat) {
        this.seat = seat;
    }
    public String getPhone() {
        return phone;
    }
    public void setPhone(String phone) {
        this.phone = phone;
    }
    public String getOnline() {
        return online;
    }
    public void setOnline(String online) {
        this.online = online;
    }
    /**
	 * 
	 */
//	private static final long serialVersionUID = 5397123441067268436L;
//
//	// 用户标识
//	private String code;
//	// 添加日期
//	private Date czrq;
//	//科室code
//	private String hospitalDept;
//	//是否签约 1是 0否
//	private String isSign;
//	//职务code
//	private String mbjob;
//	// 手机号
//	private String mobile;
//	// 姓名
//	private String name;
//	//部门code
//	private String organizationDept;
//	// 所属机构
//	private long organizationId;
//	// 登录密码
//	private String password;
//	//简介
//	private String  remark;
//	// 密码加密密钥
//	private String salt;
//	//性别
//	private String  sex;
//	//专场
//	private String speciality;
//	// 用户类型:1超级管理员,2医生
//	private int type;
//
//	// 用户找拥有的权限以逗号分隔
//	private String roles;
//	// 用户找拥有的权限以逗号分隔
//	private String roleName;
//	private String photo;
//	//职务code
//	private String mbjobName;;
//	//科室code
//	private String hospitalDeptName;
//
//	private String organizationDeptName;
//
//	public String getCode() {
//		return code;
//	}
//
//	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
//	public Date getCzrq() {
//		return czrq;
//	}
//
//	@Column(name = "hospital_dept")
//	public String getHospitalDept() {
//		return hospitalDept;
//	}
//
//	@Column(name = "is_sign")
//	public String getIsSign() {
//		return isSign;
//	}
//
//	@Column(name = "mbjob")
//	public String getMbjob() {
//		return mbjob;
//	}
//
//	public String getMobile() {
//		return mobile;
//	}
//
//	public String getName() {
//		return name;
//	}
//
//	@Column(name = "organization_dept")
//	public String getOrganizationDept() {
//		return organizationDept;
//	}
//
//	@Column(name = "organization_id")
//	public long getOrganizationId() {
//		return organizationId;
//	}
//
//	public String getPassword() {
//		return password;
//	}
//
//	@Column(name = "remark")
//	public String getRemark() {
//		return remark;
//	}
//
//	@Transient
//	@JsonIgnore
//	public List<String> getRoleList() {
//		// 角色列表在数据库中实际以逗号分隔字符串存储,因此返回不能修改的List.
//		return ImmutableList.copyOf(StringUtils.split("", ","));
//	}
//
//	public String getRoles() {
//		return roles;
//	}
//
//	public String getSalt() {
//		return salt;
//	}
//
//	public String getSex() {
//		return sex;
//	}
//
//
//
//	public String getPhoto() {
//		return photo;
//	}
//
//	public void setPhoto(String photo) {
//		this.photo = photo;
//	}
//
//	@Column(name = "speciality")
//	public String getSpeciality() {
//		return speciality;
//	}
//
//	public int getType() {
//		return type;
//	}
//
//	public void setCode(String code) {
//		this.code = code;
//	}
//
//	public void setCzrq(Date czrq) {
//		this.czrq = czrq;
//	}
//
//	public void setHospitalDept(String hospitalDept) {
//		this.hospitalDept = hospitalDept;
//	}
//
//	public void setIsSign(String isSign) {
//		this.isSign = isSign;
//	}
//
//	public void setMbjob(String mbjob) {
//		this.mbjob = mbjob;
//	}
//
//	public void setMobile(String mobile) {
//		this.mobile = mobile;
//	}
//
//	public void setName(String name) {
//		this.name = name;
//	}
//
//	public void setOrganizationDept(String organizationDept) {
//		this.organizationDept = organizationDept;
//	}
//
//	public void setOrganizationId(long organizationId) {
//		this.organizationId = organizationId;
//	}
//
//	public void setPassword(String password) {
//		this.password = password;
//	}
//
//	public void setRemark(String remark) {
//		this.remark = remark;
//	}
//
//	public void setRoles(String roles) {
//		this.roles = roles;
//	}
//
//	public void setSalt(String salt) {
//		this.salt = salt;
//	}
//
//	public void setSex(String sex) {
//		this.sex = sex;
//	}
//
//	public void setSpeciality(String speciality) {
//		this.speciality = speciality;
//	}
//
//	public void setType(int type) {
//		this.type = type;
//	}
//
//	@Override
//	public String toString() {
//		return ToStringBuilder.reflectionToString(this);
//	}
//
//	@Transient
//	public String getRoleName() {
//		return roleName;
//	}
//
//	public void setRoleName(String roleName) {
//		this.roleName = roleName;
//	}
//
//	@Transient
//	public String getMbjobName() {
//		return mbjobName;
//	}
//
//	public void setMbjobName(String mbjobName) {
//		this.mbjobName = mbjobName;
//	}
//
//	@Transient
//	public String getHospitalDeptName() {
//		return hospitalDeptName;
//	}
//
//	public void setHospitalDeptName(String hospitalDeptName) {
//		this.hospitalDeptName = hospitalDeptName;
//	}
//
//	@Transient
//	public String getOrganizationDeptName() {
//		return organizationDeptName;
//	}
//
//	public void setOrganizationDeptName(String organizationDeptName) {
//		this.organizationDeptName = organizationDeptName;
//	}
	
}

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

+ 0 - 220
patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/controller/manager/user/UserController.java

@ -1,220 +0,0 @@
package com.yihu.wlyy.controller.manager.user;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.wlyy.controller.BaseController;
import com.yihu.wlyy.entity.User;
import com.yihu.wlyy.service.manager.user.UserService;
import com.yihu.wlyy.util.Envelop;
import com.yihu.wlyy.util.MD5;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
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.ResponseBody;
import javax.servlet.http.HttpServletRequest;
import java.util.*;
/**
 * Created by yww on 2016/12/6.
 */
@Controller
@RequestMapping(value = "admin/user")
public class UserController extends BaseController {
    @Autowired
    private UserService userService;
    @Autowired
    private ObjectMapper objectMapper;
    @RequestMapping(value = "initial", method = RequestMethod.GET)
    public String listPageInit(){
        return "user/user_list";
    }
    @RequestMapping(value = "infoInit",method = RequestMethod.GET)
    public String infoPageInit(Long id,String mode){
        request.setAttribute("id",id);
        request.setAttribute("mode",mode);
        return "user/user_modify";
    }
    @RequestMapping(value = "userList")
    @ResponseBody
    public String searchList(
            @RequestParam(value = "code",required = false) String code,
            @RequestParam(value = "name",required = false) String name,
            @RequestParam(value = "mobile",required = false) String mobile,
            @RequestParam(value= "page",required = false) Integer page,
            @RequestParam(value = "rows",required = false) Integer pageSize){
        try{
            Page<User> userPage = userService.searchList(code, name, mobile, page, pageSize);
            return write(200,"操作成功",page,pageSize,userPage);
        }catch (Exception ex){
            error(ex);
            return error(-1,"操作失败!");
        }
    }
    @RequestMapping(value = "user")
    @ResponseBody
    public String getUser(
            @ApiParam(name = "id", defaultValue = "2")
            @RequestParam(name = "id", required = true) Long id) {
        try{
            User user = userService.retrieve(id);
            return write(200,"操作成功","data",user);
        }catch (Exception ex){
            error(ex);
            return error(-1,"操作失败!");
        }
    }
    @RequestMapping(value = "isCodeExist")
    @ResponseBody
    public String isCodeExist(String code){
        List<User> users = userService.findByField("code", code);
        if(users != null && users.size()>0){
            return "true";
        }
        return "false";
    }
    @RequestMapping(value = "isMobileExist")
    @ResponseBody
    public String isMobileExist(String mobile){
        List<User> users = userService.findByField("mobile", mobile);
        if(users != null && users.size()>0){
            return "true";
        }
        return "false";
    }
    @RequestMapping(value = "delete")
    @ResponseBody
    public String deleteUser(Long id){
        try{
            if (id == null) {
                return error(-1, "id不能为空!");
            }
            User user = userService.retrieve(id);
            if (StringUtils.equals(user.getCode(), "admin")) {
                return error(-1, "超级管理员admin不允许删除!");
            }
            userService.deleteUser(id);
            return write(200,"操作成功!");
        }catch (Exception ex){
            error(ex);
            return error(-1,"操作失败!");
        }
    }
    @RequestMapping(value = "create")
    @ResponseBody
    public String createUser(String jsonData){
        try{
            User user = objectMapper.readValue(jsonData, User.class);
            String mobile = user.getMobile();
            if(mobile == null){
                return write(-1,"手机号不能为空");
            }
            user.setCzrq(new Date());
            String password=user.getMobile().substring(5);
            String salt= UUID.randomUUID().toString().replace("-", "");
            password = MD5.GetMD5Code(password+salt);
            user.setPassword(password);
            user.setSalt(salt);
            User userNew = userService.save(user);
            return write(200,"操作成功!");
        }catch (Exception ex){
            error(ex);
            return error(-1,"操作失败!");
        }
    }
    @RequestMapping(value = "update")
    @ResponseBody
    public String updateUser(String jsonData){
        try{
            User user = objectMapper.readValue(jsonData, User.class);
            String mobile = user.getMobile();
            if(mobile == null){
                return write(-1,"手机号不能为空");
            }
            User userNew = userService.retrieve(user.getId());
            userNew.setCode(user.getCode());
            userNew.setName(user.getName());
            userNew.setType(user.getType());
            userNew.setMobile(user.getMobile());
            userNew.setOrganizationId(user.getOrganizationId());
            userNew.setRoles(user.getRoles());
            //修改手机号对应初始化密码(因暂未提供修改密码操作)-手机号后六位
            if(userNew.getMobile() != user.getMobile()){
                String password=mobile.substring(5);
                String salt= UUID.randomUUID().toString().replace("-", "");
                password = MD5.GetMD5Code(password+salt);
                userNew.setPassword(password);
                userNew.setSalt(salt);
            }
            userNew = userService.save(userNew);
            return write(200,"操作成功!");
        }catch (Exception ex){
            error(ex);
            return error(-1,"操作失败!");
        }
    }
    //初始化密码
    @RequestMapping(value = "initPwd")
    @ResponseBody
    public String initPwd(
            @RequestParam(value = "mobile",required = true)String mobile){
        try{
            boolean res = userService.initPwd(mobile);
            if(!res){
                return error(-1,"操作失败!");
            }
            return write(200,"操作成功!");
        }catch (Exception ex){
            error(ex);
            return error(-1,"操作失败!");
        }
    }
    //修改密码
    @RequestMapping(value = "changePwd")
    @ResponseBody
    public String changePwd(
            @RequestParam(value = "mobile")String mobile,
            @RequestParam(value = "oldPwd")String oldPwd,
            @RequestParam(value = "newPwd")String newPwd){
        try {
            return write(200,"操作成功");
        }catch (Exception ex){
            error(ex);
            return error(-1, "操作失败!");
        }
    }
    //根据姓名获取所有有效用户列表(用于分页下拉框)
    @RequestMapping("/searchUsers")
    @ResponseBody
    public Object searchUsers(String searchNm, int page, int rows) {
        try {
            Page<User> users = userService.searchUsers(searchNm, page, rows);
            return write(200, "操作成功", page, rows, users);
        } catch (Exception ex) {
            error(ex);
            return error(-1,"操作失败!");
        }
    }
}

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

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

@ -4,20 +4,22 @@ 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.User;
import com.yihu.wlyy.entity.redis.RedisCacheKeyRule;
import com.yihu.wlyy.service.redis.cache.RedisCacheKeyRuleService;
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;
/**
@ -42,13 +44,13 @@ public class RedisCacheKeyRuleEndPoint extends EnvelopRestEndPoint {
                MRedisCacheKeyRule mRedisCacheKeyRule = convertToModel(redisCacheKeyRuleService.getById(id), MRedisCacheKeyRule.class);
                model.addAttribute("detailModel", toJson(mRedisCacheKeyRule));
            }else {
                Object detailModel = new MRedisCacheCategory();
                Object detailModel = new MRedisCacheKeyRule();
                model.addAttribute("detailModel", toJson(detailModel));
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        return "redis/cache/cache/detail";
        return "redis/cache/keyRule/detail";
    }
    @ApiOperation(value = "根据条件获取缓存Key规则")
@ -59,6 +61,8 @@ public class RedisCacheKeyRuleEndPoint extends EnvelopRestEndPoint {
            @RequestParam(value = "fields", required = false) String fields,
            @ApiParam(name = "searchContent", value = "筛选条件")
            @RequestParam(value = "searchContent", 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")
@ -68,8 +72,16 @@ public class RedisCacheKeyRuleEndPoint extends EnvelopRestEndPoint {
        Envelop envelop = new Envelop();
        envelop.setSuccessFlg(false);
        try {
            List<RedisCacheKeyRule> redisCacheKeyRuleList = redisCacheKeyRuleService.search(fields, searchContent, sorts, page, rows);
            int count = (int) redisCacheKeyRuleService.getCount(searchContent);
            String filters = "";
            if (!StringUtils.isEmpty(searchContent)) {
                filters = "code?" + searchContent + ";name?" + searchContent + ";";
            }
            if (!StringUtils.isEmpty(categoryCode)) {
                filters = "categoryCode=" + categoryCode + ";";
            }
            List<RedisCacheKeyRule> redisCacheKeyRuleList = redisCacheKeyRuleService.search(fields, filters, sorts, page, rows);
            int count = (int) redisCacheKeyRuleService.getCount(filters);
            List<MRedisCacheKeyRule> mRedisCacheKeyRule = (List<MRedisCacheKeyRule>) convertToModels(redisCacheKeyRuleList, new ArrayList<MRedisCacheKeyRule>(), MRedisCacheKeyRule.class, fields);
            envelop = getPageResult(mRedisCacheKeyRule, count, page, rows);
            envelop.setSuccessFlg(true);
@ -84,13 +96,16 @@ 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)
            @RequestBody String entityJson) {
    public Envelop add(String data) {
        Envelop envelop = new Envelop();
        envelop.setSuccessFlg(false);
        try {
            RedisCacheKeyRule newEntity = objectMapper.readValue(entityJson, RedisCacheKeyRule.class);
            RedisCacheKeyRule newEntity = objectMapper.readValue(data, RedisCacheKeyRule.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 = redisCacheKeyRuleService.save(newEntity);
            MRedisCacheKeyRule mRedisCacheKeyRule = convertToModel(newEntity, MRedisCacheKeyRule.class);
@ -107,13 +122,14 @@ public class RedisCacheKeyRuleEndPoint extends EnvelopRestEndPoint {
    @ApiOperation("更新缓存Key规则")
    @ResponseBody
    @RequestMapping(value = ServiceApi.Redis.CacheKeyRule.Update, method = RequestMethod.POST)
    public Envelop update(
            @ApiParam(value = "缓存Key规则JSON", required = true)
            @RequestBody String entityJson) {
    public Envelop update(String data) {
        Envelop envelop = new Envelop();
        envelop.setSuccessFlg(false);
        try {
            RedisCacheKeyRule updateEntity = objectMapper.readValue(entityJson, RedisCacheKeyRule.class);
            RedisCacheKeyRule updateEntity = objectMapper.readValue(data, RedisCacheKeyRule.class);
            User currentUser = (User) request.getSession().getAttribute("current_user");
            updateEntity.setModifyDate(new Date());
            updateEntity.setModifier(currentUser.getCode());
            updateEntity = redisCacheKeyRuleService.save(updateEntity);
            MRedisCacheKeyRule mRedisCacheKeyRule = convertToModel(updateEntity, MRedisCacheKeyRule.class);
@ -129,10 +145,10 @@ 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) {
            @RequestParam(value = "id") Long id) {
        Envelop envelop = new Envelop();
        envelop.setSuccessFlg(false);
        try {

+ 4 - 4
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
 */
@Controller
@RestController
@RequestMapping(value = ApiVersion.Version1_0)
@Api(description = "缓存统计接口", tags = {"缓存服务管理--缓存统计接口"})
public class RedisCacheStatisticsEndPoint extends EnvelopRestEndPoint {
@ -45,7 +45,7 @@ public class RedisCacheStatisticsEndPoint extends EnvelopRestEndPoint {
    private RedisTemplate<String, Object> redisTemplate;
    @ApiOperation("统计缓存分类的缓存数量")
    @RequestMapping(value = ServiceApi.Redis.CacheStatistics.GetCategoryKeys, method = RequestMethod.GET)
    @RequestMapping(value = ServiceApi.Redis.CacheStatistics.GetCategoryKeys, method = RequestMethod.POST)
    public Envelop getCategoryKeys() {
        Envelop envelop = new Envelop();
        envelop.setSuccessFlg(false);
@ -73,7 +73,7 @@ public class RedisCacheStatisticsEndPoint extends EnvelopRestEndPoint {
    }
    @ApiOperation("统计缓存分类的缓存内存比率(近似值,比实际略小)")
    @RequestMapping(value = ServiceApi.Redis.CacheStatistics.GetCategoryMemory, method = RequestMethod.GET)
    @RequestMapping(value = ServiceApi.Redis.CacheStatistics.GetCategoryMemory, method = RequestMethod.POST)
    public Envelop getCategoryMemory() {
        Envelop envelop = new Envelop();
        envelop.setSuccessFlg(false);

+ 16 - 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;
@ -28,8 +29,21 @@ 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";
    }
    @RequestMapping(value = "subscriber/index", method = RequestMethod.GET)
    public String subscriber_index(Model model,String channel){
        model.addAttribute("channel", channel);
        return "/redis/mq/subscriber/list";
    }
    @RequestMapping(value = "publisher/index", method = RequestMethod.GET)
    public String publisher_index(Model model,String channel){
        model.addAttribute("channel", channel);
        return "/redis/mq/publisher/list";
    }
}

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

@ -20,6 +20,7 @@ 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.data.redis.core.RedisTemplate;
import org.springframework.data.redis.listener.ChannelTopic;
@ -91,8 +92,13 @@ public class RedisMqChannelEndPoint extends EnvelopRestEndPoint {
        Envelop envelop = new Envelop();
        envelop.setSuccessFlg(false);
        try {
            List<RedisMqChannel> redisMqChannelList = redisMqChannelService.search(fields, searchContent, sorts, page, rows);
            int count = (int) redisMqChannelService.getCount(searchContent);
            String filters = "";
            if (!StringUtils.isEmpty(searchContent)) {
                filters = "channel?" + searchContent + ";channelName?" + searchContent + ";";
            }
            List<RedisMqChannel> redisMqChannelList = redisMqChannelService.search(fields, filters, sorts, page, rows);
            int count = (int) redisMqChannelService.getCount(filters);
            List<MRedisMqChannel> mRedisMqChannelList = (List<MRedisMqChannel>) convertToModels(redisMqChannelList, new ArrayList<MRedisMqChannel>(), MRedisMqChannel.class, fields);
            envelop = getPageResult(mRedisMqChannelList, count, page, rows);
            envelop.setSuccessFlg(true);
@ -161,7 +167,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) {

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

@ -4,7 +4,6 @@ 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;
@ -13,10 +12,14 @@ 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 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;
@ -38,13 +41,13 @@ public class RedisMqPublisherEndPoint extends EnvelopRestEndPoint {
    @ApiOperation("根据ID获取消息发布者")
    @RequestMapping(value = ServiceApi.Redis.MqPublisher.GetById, method = RequestMethod.GET)
    public String getById(Model model, Long id) {
    public String getById(Model model, Long id,String channel) {
        try {
            if(id!=null){
                MRedisMqPublisher mRedisMqPublisher = convertToModel(redisMqPublisherService.getById(id), MRedisMqPublisher.class);
                model.addAttribute("detailModel", toJson(mRedisMqPublisher));
            }else {
                Object detailModel = new MRedisCacheCategory();
                Object detailModel = new MRedisMqPublisher(channel);
                model.addAttribute("detailModel", toJson(detailModel));
            }
        } catch (Exception e) {
@ -61,19 +64,25 @@ public class RedisMqPublisherEndPoint extends EnvelopRestEndPoint {
            @RequestParam(value = "fields", required = false) String fields,
            @ApiParam(name = "searchContent", value = "筛选条件")
            @RequestParam(value = "searchContent", required = false) String searchContent,
            @ApiParam(name = "channel", value = "消息队列代码")
            @RequestParam(value = "channel", required = false) String channel,
            @ApiParam(name = "sorts", value = "排序")
            @RequestParam(value = "sorts", required = false) String sorts,
            @ApiParam(name = "page", value = "页码", defaultValue = "1")
            @RequestParam(value = "page", required = false) int page,
            @ApiParam(name = "size", value = "分页大小", defaultValue = "15")
            @RequestParam(value = "size", required = false) int size) {
            @ApiParam(name = "rows", value = "分页大小", defaultValue = "15")
            @RequestParam(value = "rows", required = false) int rows) {
        Envelop envelop = new Envelop();
        envelop.setSuccessFlg(false);
        try {
            List<RedisMqPublisher> list = redisMqPublisherService.search(fields, searchContent, sorts, page, size);
            int count = (int) redisMqPublisherService.getCount(searchContent);
            String filters = "channel=" + channel + ";";
            if (!StringUtils.isEmpty(searchContent)) {
                filters = "appId?" + searchContent + ";";
            }
            List<RedisMqPublisher> list = redisMqPublisherService.search(fields, filters, sorts, page, rows);
            int count = (int) redisMqPublisherService.getCount(filters);
            List<MRedisMqPublisher> mList = (List<MRedisMqPublisher>) convertToModels(list, new ArrayList<MRedisMqPublisher>(), MRedisMqPublisher.class, fields);
            envelop = getPageResult(mList, count, page, size);
            envelop = getPageResult(mList, count, page, rows);
            envelop.setSuccessFlg(true);
            envelop.setErrorMsg("成功获取消息发布者列表。");
        } catch (Exception e) {
@ -135,10 +144,10 @@ 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) {
            @RequestParam(value = "id") Long id) {
        Envelop envelop = new Envelop();
        envelop.setSuccessFlg(false);
        try {

+ 45 - 23
patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/controller/redis/RedisMqSubscriberEndPoint.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.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;
@ -12,13 +13,18 @@ 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.data.redis.listener.RedisMessageListenerContainer;
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;
import java.util.List;
/**
@ -41,28 +47,31 @@ 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,String channel) {
        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 MRedisMqSubscriber(channel);
                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 = "返回的字段,为空则返回全部字段")
            @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 = "channel", value = "消息队列代码")
            @RequestParam(value = "channel", required = false) String channel,
            @ApiParam(name = "sorts", value = "排序")
            @RequestParam(value = "sorts", required = false) String sorts,
            @ApiParam(name = "page", value = "页码", defaultValue = "1")
@ -72,6 +81,10 @@ public class RedisMqSubscriberEndPoint extends EnvelopRestEndPoint {
        Envelop envelop = new Envelop();
        envelop.setSuccessFlg(false);
        try {
            String filters = "channel=" + channel + ";";
            if (!StringUtils.isEmpty(searchContent)) {
                filters = "subscribedUrl?" + searchContent + ";";
            }
            List<RedisMqSubscriber> list = redisMqSubscriberService.search(fields, filters, sorts, page, rows);
            int count = (int) redisMqSubscriberService.getCount(filters);
            List<MRedisMqSubscriber> mList = (List<MRedisMqSubscriber>) convertToModels(list, new ArrayList<MRedisMqSubscriber>(), MRedisMqSubscriber.class, fields);
@ -86,14 +99,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 +125,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,10 +149,11 @@ 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) {
            @RequestParam(value = "id") Long id) {
        Envelop envelop = new Envelop();
        envelop.setSuccessFlg(false);
        try {
@ -149,6 +169,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 +194,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)

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

@ -27,10 +27,12 @@ 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.ResponseBody;
import javax.annotation.Resource;
import java.io.*;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
@ -50,18 +52,16 @@ public class RedisScheduledController {
    private String rdbFilePath;
    @Value("${ehr-redis.cache.memory.outFilePath}")
    private String outFilePath;
//    @Value("${ehr-redis.server.host}")
//    private String redisServerHost;
//    @Value("${ehr-redis.server.username}")
//    private String redisServerUsername;
//    @Value("${ehr-redis.server.password}")
//    private String redisServerPwd;
//    @Value("${ehr-redis.server.ssh-port}")
//    private int redisServerSshPort;
    private String redisServerHost = "";
    private String redisServerUsername = "";
    private String redisServerPwd = "";
    private int redisServerSshPort = 22;
    @Value("${ehr-redis.cache.memory.filename}")
    private String filename;
    @Value("${ehr-redis.server.host}")
    private String redisServerHost;
    @Value("${ehr-redis.server.username}")
    private String redisServerUsername;
    @Value("${ehr-redis.server.password}")
    private String redisServerPwd;
    @Value("${ehr-redis.server.ssh-port}")
    private int redisServerSshPort;
    @Autowired
    private RedisCacheKeyMemoryService redisCacheKeyMemoryService;
@ -84,20 +84,21 @@ public class RedisScheduledController {
    @RequestMapping(value = "/redis/cache/statistics/exportAndImportRedisMemoryData", method = RequestMethod.GET)
    @ResponseBody
    @ApiOperation("导出 redis 内存分析报告,并导入到数据库")
    public void exportAndImportRedisMemoryData() {
    public String exportAndImportRedisMemoryData() {
        long start = System.currentTimeMillis();
        try {
            // 导出内存分析报告CSV文件(得到的内存值是近似值,比实际略小)
            // 生产环境服务器不允许代码直接通过SSH访问服务器,故暂时注释,另寻方法。
            exportRedisMemoryReport();
//            exportRedisMemoryReport();
            long export = System.currentTimeMillis();
            logger.info("成功导出Redis内存分析报告,耗时:" + (export - start) + " 毫秒");
            // 导入CSV格式的内存分析数据
            FlatFileItemReader<RedisCacheKeyMemory> itemReader = new FlatFileItemReader<>();
            itemReader.setResource(new FileSystemResource(outFilePath));
            itemReader.setResource(new FileSystemResource(outFilePath+filename));
            itemReader.setLinesToSkip(1);
            DefaultLineMapper<RedisCacheKeyMemory> lineMapper = new DefaultLineMapper<>();
            lineMapper.setLineTokenizer(new DelimitedLineTokenizer());
@ -114,6 +115,8 @@ public class RedisScheduledController {
            int i = 0;
            while ((redisCacheKeyMemory = itemReader.read()) != null) {
                redisCacheKeyMemory.setId(UuidUtil.randomUUID());
                redisCacheKeyMemory.setModifyDate(new Date());
                redisCacheKeyMemory.setCreateDate(new Date());
                redisCacheKeyMemoryList.add(redisCacheKeyMemory);
                if (redisCacheKeyMemoryList.size() == 1000) {
                    redisCacheKeyMemoryService.save(redisCacheKeyMemoryList);
@ -131,6 +134,7 @@ public class RedisScheduledController {
            e.printStackTrace();
            logger.error("发生异常:" + e.getMessage());
        }
        return "导出成功";
    }
    /**
@ -160,7 +164,11 @@ public class RedisScheduledController {
            InputStream in = channel.getInputStream();
            channel.connect();
            File outFile = new File(outFilePath);
            File file = new File(outFilePath);
            if(!file.exists()){
                file.mkdirs();
            }
            File outFile = new File(file,filename);
            if (!outFile.exists()){
                outFile.createNewFile();
            }
@ -179,6 +187,7 @@ public class RedisScheduledController {
            channel.disconnect();
            session.disconnect();
        } catch (Exception e) {
            e.printStackTrace();
            logger.error("生成Redis内存分析报告发生异常:" + e.getMessage());
            throw new Exception();
        } finally {

+ 17 - 4
patient-co-manage/redis-cache/src/main/resources/application.yml

@ -58,8 +58,13 @@ ehr-redis:
  cache:
    memory:
      rdbFilePath: /usr/local/bin/dump.rdb
      outFilePath: /usr/local/ehr/redisReport/memory.csv
      outFilePath: /usr/local/ehr/redisReport/
      filename: memory.csv
  server:
    host: 172.19.103.47
    username: root
    password: jkzl
    ssh-port: 22
---
spring:
  profiles: test
@ -73,7 +78,11 @@ spring:
    host: 172.19.103.88 # Redis server host.
    port: 6379 # Redis server port.
#    password: jkzl_ehr
  server:
    host: 172.19.103.47
    username: root
    password: jkzl
    ssh-port: 22
---
spring:
@ -88,4 +97,8 @@ spring:
    host: 27.155.101.77 # Redis server host.
    port: 6380 # Redis server port.
    password: jkzl_ehr
  server:
    host: 172.19.103.47
    username: root
    password: jkzl
    ssh-port: 22

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


+ 1 - 0
patient-co-manage/redis-cache/src/main/webapp/WEB-INF/views/head/page_foot.jsp

@ -78,6 +78,7 @@
<script src="${ctx}/static/js/until/global.js"></script>
<script src='${ctx}/static/jquery/jquery-ui.js' type='text/javascript'></script>
<script src="${ctx}/static/develop/lib/plugin/echarts/2.2.7/js/echarts-all.js"></script>
<script>
    (function ($, win) {

+ 0 - 14
patient-co-manage/redis-cache/src/main/webapp/WEB-INF/views/main.jsp

@ -43,20 +43,6 @@
		<div class="index-menu-box">
			<div class="aMenus">
				<%-- 安全管理中心--%>
				<sec:authorize url="/admin/security/center">
				<div class="a-divider"></div>
				<div class="a-menu">
					<div class="a-menu-tit"><i class="icons icons-aside-2 icons-24 mr15"></i>安全管理</div>
					<div class="a-menu-list c-hide">
						<ul>
							</sec:authorize>
							<sec:authorize url="/admin/user/initial">
								<li><a href="javascript:locationMenu('user');">用户管理</a></li>
						</ul>
					</div>
				</div>
				</sec:authorize>
				<%-- 缓存管理--%>
				<sec:authorize url="/admin/redis/center">
				<div class="a-divider"></div>

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

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

@ -1,5 +1,12 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="utf-8" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <%@ include file="../../../head/page_head.jsp" %>
    <%@ include file="detailCss.jsp" %>
    <title>用户管理</title>
</head>
<body>
<div id="redisCacheKeyRuleForm" class="m-form-inline f-mt20" data-role-form>
    <input type="hidden" id="id" data-attr-scan="id">
@ -14,7 +21,7 @@
    <div class="m-form-group">
        <label>缓存Key规则编码:</label>
        <div class="l-text-wrapper m-form-control essential">
            <input type="text" class="f-w240 max-length-50 required ajax validate-alpha-underline"
            <input type="text" class="f-w240 max-length-50 required ajax"
                   id="code" data-attr-scan="code">
        </div>
    </div>
@ -49,4 +56,7 @@
        </div>
    </div>
</div>
</body>
<%@ include file="../../../head/page_foot.jsp" %>
<%@ include file="detailJs.jsp" %>
</html>

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

@ -2,114 +2,117 @@
<script>
    var detailModel = ${detailModel};
    var dataModel = $.DataModel.init();
    var validator;
    var $form = $("#redisCacheKeyRuleForm");
(function ($, win) {
    $(function () {
        init();
    });
    function init() {
        validator = customFormValidator();
        initForm();
        bindEvents();
    }
        var detailModel = ${detailModel};
        var dataModel = $.DataModel.init();
        var validator;
        var $form = $("#redisCacheKeyRuleForm");
    function initForm() {
        var nameTb = $('#name').ligerTextBox({width: 240});
        var codeTb = $('#code').ligerTextBox({width: 240});
        var categoryCode = $("#categoryCode").ligerComboBox({
            ajaxType: 'get',
            url: "${contextRoot}/redis/cache/category/searchNoPage",
            dataParmName: 'detailModelList',
            valueField: 'code',
            textField: 'name'
        $(function () {
            init();
        });
        var expressionTb = $('#expression').ligerTextBox({width: 240});
        $('#remark').ligerTextBox({width: 240, height: 150});
        if(detailModel.id) {
            nameTb.setDisabled(true);
            nameTb.setReadonly(true);
            codeTb.setDisabled(true);
            codeTb.setReadonly(true);
            categoryCode.setDisabled(true);
            categoryCode.setReadonly(true);
            expressionTb.setDisabled(true);
            expressionTb.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() {
            var nameTb = $('#name').ligerTextBox({width: 240});
            var codeTb = $('#code').ligerTextBox({width: 240});
            var categoryCode = $("#categoryCode").ligerComboBox({
                ajaxType: 'get',
                url: "${contextRoot}/redis/cache/category/searchNoPage",
                dataParmName: 'detailModelList',
                valueField: 'code',
                textField: 'name'
            });
            var expressionTb = $('#expression').ligerTextBox({width: 240});
            $('#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) {
                nameTb.setDisabled(true);
                nameTb.setReadonly(true);
                codeTb.setDisabled(true);
                codeTb.setReadonly(true);
                categoryCode.setDisabled(true);
                categoryCode.setReadonly(true);
                expressionTb.setDisabled(true);
                expressionTb.setReadonly(true);
            }
            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) {
                            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/keyRule/"+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 'name':
                        var name = $("#name").val();
                        if(!$.Util.isStrEquals(name, detailModel.name)) {
                            var ulr = "${contextRoot}/redis/cache/keyRule/isUniqueName";
                            return $.Util.validateByAjax(ulr, {id: id, name: name});
                        }
                        break;
                    case 'code':
                        var code = $("#code").val();
                        if(!$.Util.isStrEquals(code, detailModel.code)) {
                            var ulr = "${contextRoot}/redis/cache/keyRule/isUniqueCode";
                            return $.Util.validateByAjax(ulr, {id: id, code: code});
                        }
                        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 'name':
                            var name = $("#name").val();
                            if(!$.Util.isStrEquals(name, detailModel.name)) {
                                var ulr = "${contextRoot}/redis/cache/keyRule/isUniqueName";
                                return $.Util.validateByAjax(ulr, {id: id, name: name});
                            }
                            break;
                        case 'code':
                            var code = $("#code").val();
                            if(!$.Util.isStrEquals(code, detailModel.code)) {
                                var ulr = "${contextRoot}/redis/cache/keyRule/isUniqueCode";
                                return $.Util.validateByAjax(ulr, {id: id, code: code});
                            }
                            break;
                    }
                }
            }
        });
    }
            });
        }
    });
})(jQuery, window)
</script>

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

@ -1,6 +1,13 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="utf-8" %>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <%@ include file="../../../head/page_head.jsp" %>
    <%@ include file="listCss.jsp" %>
    <title>用户管理</title>
</head>
<body>
<div>
    <div id="categoryMemoryRate" style="width: 600px;height: 300px; display: inline-block;"></div>
@ -33,3 +40,7 @@
    <div id="grid"></div>
</div>
</body>
<%@ include file="../../../head/page_foot.jsp" %>
<%@ include file="listJs.jsp" %>
</html>

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

@ -3,228 +3,231 @@
<script>
    var dataModel = $.DataModel.init();
    var detailDialog = null;
    var grid = null;
(function ($, win) {
    $(function () {
        init();
    });
    function init() {
        initWidget();
        bindEvents();
        initChart();
    }
        var dataModel = $.DataModel.init();
        var detailDialog = null;
        var grid = null;
    function initWidget() {
        $('#searchContent').ligerTextBox({ width: 200 });
        $("#searchCategoryCode").ligerComboBox({
            ajaxType: 'get',
            url: "${contextRoot}/redis/cache/category/searchNoPage",
            dataParmName: 'detailModelList',
            valueField: 'code',
            textField: 'name'
        $(function () {
            init();
        });
        grid = $("#grid").ligerGrid($.LigerGridEx.config({
            url: '${contextRoot}/redis/cache/keyRule/search',
            height: '600px',
            method:'GET',
            columns: [
                {display: 'ID', name: 'id', hide: true},
                {display: '缓存Key规则名称', name: 'name', width: '15%', isAllowHide: false, align: 'left'},
                {display: '缓存Key规则编码', name: 'code', width: '15%', isAllowHide: false, align: 'left'},
                {display: '缓存分类', name: 'categoryName', width: '15%', isAllowHide: false, align: 'left'},
                {display: 'Key规则表达式', name: 'expression', width: '20%', isAllowHide: false, align: 'left'},
                {display: '备注', name: 'remark', width: '15%', isAllowHide: false, align: 'left'},
                {display: '操作', name: 'operator', minWidth: 120, align: 'center',
                    render: function (row) {
                        var html = '';
                        html += '<sec:authorize url="/redis/cache/keyRule/detail"><a class="grid_edit f-ml10" title="编辑" href="javascript:void(0)" onclick="javascript:' + $.Util.format("$.publish('{0}',['{1}','{2}'])", "redis:cache:keyRule:detail", row.id, 'modify') + '"></a></sec:authorize>';
                        html += '<sec:authorize url="/redis/cache/keyRule/delete"><a class="grid_delete" title="删除" href="javascript:void(0)"  onclick="javascript:' + $.Util.format("$.publish('{0}',['{1}'])", "redis:cache:keyRule:delete", row.id) + '"></a></sec:authorize>';
                        return html;
        function init() {
            initWidget();
            bindEvents();
            initChart();
        }
        function initWidget() {
            $('#searchContent').ligerTextBox({ width: 200 });
            $("#searchCategoryCode").ligerComboBox({
                ajaxType: 'get',
                url: "${contextRoot}/redis/cache/category/searchNoPage",
                dataParmName: 'detailModelList',
                valueField: 'code',
                textField: 'name'
            });
            grid = $("#grid").ligerGrid($.LigerGridEx.config({
                url: '${contextRoot}/redis/cache/keyRule/search',
                height: '600px',
                method:'GET',
                columns: [
                    {display: 'ID', name: 'id', hide: true},
                    {display: '缓存Key规则名称', name: 'name', width: '15%', isAllowHide: false, align: 'left'},
                    {display: '缓存Key规则编码', name: 'code', width: '15%', isAllowHide: false, align: 'left'},
                    {display: '缓存分类', name: 'categoryName', width: '15%', isAllowHide: false, align: 'left'},
                    {display: 'Key规则表达式', name: 'expression', width: '20%', isAllowHide: false, align: 'left'},
                    {display: '备注', name: 'remark', width: '15%', isAllowHide: false, align: 'left'},
                    {display: '操作', name: 'operator', minWidth: 120, align: 'center',
                        render: function (row) {
                            var html = '';
                            html += '<sec:authorize url="/redis/cache/keyRule/detail"><a class="grid_edit f-ml10" title="编辑" href="javascript:void(0)" onclick="javascript:' + $.Util.format("$.publish('{0}',['{1}','{2}'])", "redis:cache:keyRule:detail", row.id, 'modify') + '"></a></sec:authorize>';
                            html += '<sec:authorize url="/redis/cache/keyRule/delete"><a class="grid_delete" title="删除" href="javascript:void(0)"  onclick="javascript:' + $.Util.format("$.publish('{0}',['{1}'])", "redis:cache:keyRule:delete", row.id) + '"></a></sec:authorize>';
                            return html;
                        }
                    }
                }
            ],
            allowHideColumn: false,
            usePager: true
        }));
        grid.collapseAll();
        grid.adjustToWidth();
    }
                ],
                allowHideColumn: false,
                usePager: true
            }));
            grid.collapseAll();
            grid.adjustToWidth();
        }
    function bindEvents() {
        // 查询
        $('#btnSearch').on('click', function () {
            reloadGrid();
        });
        function bindEvents() {
            // 查询
            $('#btnSearch').on('click', function () {
                reloadGrid();
            });
        // 新增/修改
        $.subscribe('redis:cache:keyRule:detail', function (event, id, mode) {
            var title = '新增缓存Key规则';
            if (mode == 'modify') {
                title = '修改缓存Key规则';
            }
            detailDialog = $.ligerDialog.open({
                height: 490,
                width: 480,
                title: title,
                url: '${contextRoot}/redis/cache/keyRule/detail',
                urlParms: {
                    id: id
            // 新增/修改
            $.subscribe('redis:cache:keyRule:detail', function (event, id, mode) {
                var title = '新增缓存Key规则';
                if (mode == 'modify') {
                    title = '修改缓存Key规则';
                }
                detailDialog = $.ligerDialog.open({
                    height: 490,
                    width: 480,
                    title: title,
                    url: '${contextRoot}/redis/cache/keyRule/detail',
                    urlParms: {
                        id: id
                    }
                });
            });
        });
        // 删除
        $.subscribe('redis:cache:keyRule:delete', function (event, id) {
            $.Notice.confirm('删除后不能通过该缓存Key规则操作缓存,确认要删除吗?', function (r) {
                if (r) {
                    var loading = $.ligerDialog.waitting("正在删除数据...");
                    dataModel.updateRemote('${contextRoot}/redis/cache/keyRule/delete', {
                        data: {id: parseInt(id)},
                        success: function (data) {
                            if (data.successFlg) {
                                $.Notice.success('删除成功!');
                                reloadGrid();
                            } else {
                                $.Notice.error(data.errorMsg);
            // 删除
            $.subscribe('redis:cache:keyRule:delete', function (event, id) {
                $.Notice.confirm('删除后不能通过该缓存Key规则操作缓存,确认要删除吗?', function (r) {
                    if (r) {
                        var loading = $.ligerDialog.waitting("正在删除数据...");
                        dataModel.updateRemote('${contextRoot}/redis/cache/keyRule/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();
                            }
                        },
                        error: function () {
                            $.Notice.error('删除发生异常');
                        },
                        complete: function () {
                            loading.close();
                        }
                    });
                }
            })
        });
                        });
                    }
                })
            });
    }
        }
    function initChart() {
        // 缓存分类内存比率统计
        dataModel.fetchRemote('${contextRoot}/redis/cache/statistics/getCategoryMemory', {
            success: function(data) {
                if (data.successFlg) {
                    var categoryMemoryRateChart = echarts.init(document.getElementById('categoryMemoryRate'));
                    categoryMemoryRateChart.setOption({
                        title : {
                            text: '缓存分类的Redis内存占比',
                            subtext: '单位:字节(bytes)',
                            x:'center'
                        },
                        tooltip : {
                            trigger: 'item',
                            formatter: "{b} : {c} ({d}%)"
                        },
                        /*legend: {
                            type: 'scroll',
                            orient: 'vertical',
                            right: 10,
                            top: 20,
                            bottom: 20,
                            data: data.obj.categoryNameList
                        },*/
                        series : [
                            {
                                type: 'pie',
                                radius : '55%',
                                center: ['50%', '60%'],
                                data: data.obj.categoryMemoryList,
                                itemStyle: {
                                    emphasis: {
                                        shadowBlur: 10,
                                        shadowOffsetX: 0,
                                        shadowColor: 'rgba(0, 0, 0, 0.5)'
        function initChart() {
            // 缓存分类内存比率统计
            dataModel.fetchRemote('${contextRoot}/redis/cache/statistics/getCategoryMemory', {
                success: function(data) {
                    if (data.successFlg) {
                        var categoryMemoryRateChart = echarts.init(document.getElementById('categoryMemoryRate'));
                        categoryMemoryRateChart.setOption({
                            title : {
                                text: '缓存分类的Redis内存占比',
                                subtext: '单位:字节(bytes)',
                                x:'center'
                            },
                            tooltip : {
                                trigger: 'item',
                                formatter: "{b} : {c} ({d}%)"
                            },
                            /*legend: {
                                type: 'scroll',
                                orient: 'vertical',
                                right: 10,
                                top: 20,
                                bottom: 20,
                                data: data.obj.categoryNameList
                            },*/
                            series : [
                                {
                                    type: 'pie',
                                    radius : '55%',
                                    center: ['50%', '60%'],
                                    data: data.obj.categoryMemoryList,
                                    itemStyle: {
                                        emphasis: {
                                            shadowBlur: 10,
                                            shadowOffsetX: 0,
                                            shadowColor: 'rgba(0, 0, 0, 0.5)'
                                        }
                                    }
                                }
                            }
                        ]
                    });
                } else {
                    $.Notice.error(data.errorMsg);
                            ]
                        });
                    } else {
                        $.Notice.error(data.errorMsg);
                    }
                },
                error: function() {
                    $.Notice.error('加载分类内存占比图表数据发生异常!');
                }
            },
            error: function() {
                $.Notice.error('加载分类内存占比图表数据发生异常!');
            }
        });
            });
        // 缓存个数统计
        dataModel.fetchRemote('${contextRoot}/redis/cache/statistics/getCategoryKeys', {
            success: function(data) {
                if (data.successFlg) {
                    var cacheKeysChart = echarts.init(document.getElementById('cacheKeys'));
                    cacheKeysChart.setOption({
                        title: {
                            text: '分类缓存数量',
                            x:'center'
                        },
                        color: ['#3398DB'],
                        tooltip : {
                            trigger: 'axis',
                            axisPointer : {
                                type : 'shadow'
                            }
                        },
                        grid: {
                            left: '3%',
                            right: '4%',
                            bottom: '3%',
                            containLabel: true
                        },
                        xAxis : [
                            {
                                type : 'category',
                                data : data.obj.categoryNameList,
                                axisTick: {
                                    alignWithLabel: true
            // 缓存个数统计
            dataModel.fetchRemote('${contextRoot}/redis/cache/statistics/getCategoryKeys', {
                success: function(data) {
                    if (data.successFlg) {
                        var cacheKeysChart = echarts.init(document.getElementById('cacheKeys'));
                        cacheKeysChart.setOption({
                            title: {
                                text: '分类缓存数量',
                                x:'center'
                            },
                            color: ['#3398DB'],
                            tooltip : {
                                trigger: 'axis',
                                axisPointer : {
                                    type : 'shadow'
                                }
                            }
                        ],
                        yAxis : [
                            {
                                type : 'value'
                            }
                        ],
                        series : [
                            {
                                name:'缓存数量',
                                type:'bar',
                                barWidth: '60%',
                                data: data.obj.categoryNumList
                            }
                        ]
                    });
                } else {
                    $.Notice.error(data.errorMsg);
                            },
                            grid: {
                                left: '3%',
                                right: '4%',
                                bottom: '3%',
                                containLabel: true
                            },
                            xAxis : [
                                {
                                    type : 'category',
                                    data : data.obj.categoryNameList,
                                    axisTick: {
                                        alignWithLabel: true
                                    }
                                }
                            ],
                            yAxis : [
                                {
                                    type : 'value'
                                }
                            ],
                            series : [
                                {
                                    name:'缓存数量',
                                    type:'bar',
                                    barWidth: '60%',
                                    data: data.obj.categoryNumList
                                }
                            ]
                        });
                    } else {
                        $.Notice.error(data.errorMsg);
                    }
                },
                error: function() {
                    $.Notice.error('加载缓存数量图表数据发生异常!');
                }
            },
            error: function() {
                $.Notice.error('加载缓存数量图表数据发生异常!');
            }
        });
    }
            });
        }
    function reloadGrid() {
        var params = {
            searchContent: $('#searchContent').val(),
            categoryCode: $("#searchCategoryCode").ligerComboBox().getValue()
        };
        $.Util.reloadGrid.call(grid, '${contextRoot}/redis/cache/keyRule/search', params);
    }
        function reloadGrid() {
            var params = {
                searchContent: $('#searchContent').val(),
                categoryCode: $("#searchCategoryCode").ligerComboBox().getValue()
            };
            $.Util.reloadGrid.call(grid, '${contextRoot}/redis/cache/keyRule/search', params);
        }
    /*-- 与明细 Dialog 页面间回调的函数 --*/
    window.reloadMasterGrid = function() {
        reloadGrid();
    };
    window.closeDetailDialog = function (type, msg) {
        detailDialog.close();
        msg && $.Notice.success(msg);
        /*-- 与明细 Dialog 页面间回调的函数 --*/
        window.reloadMasterGrid = function() {
        };
        window.closeDetailDialog = function (type, msg) {
            detailDialog.close();
            reloadGrid();
            msg && $.Notice.success(msg);
    };
</script>
    });
})(jQuery, window)
</script>

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

@ -1,5 +1,12 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="utf-8" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <%@ include file="../../../head/page_head.jsp" %>
    <%@ include file="detailCss.jsp" %>
    <title>用户管理</title>
</head>
<body>
<div id="redisMqChannelForm" class="m-form-inline f-mt20" data-role-form>
    <input type="hidden" id="id" data-attr-scan="id">
@ -42,4 +49,7 @@
        </div>
    </div>
</div>
</body>
<%@ include file="../../../head/page_foot.jsp" %>
<%@ include file="detailJs.jsp" %>
</html>

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

@ -2,101 +2,104 @@
<script>
    var detailModel = ${detailModel};
    var dataModel = $.DataModel.init();
    var validator;
    var $form = $("#redisMqChannelForm");
(function ($, win) {
    $(function () {
        init();
    });
    function init() {
        validator = customFormValidator();
        initForm();
        bindEvents();
    }
        var detailModel = ${detailModel};
        var dataModel = $.DataModel.init();
        var validator;
        var $form = $("#redisMqChannelForm");
    function initForm() {
        var channelTb = $('#channel').ligerTextBox({width: 240});
        $('#channelName').ligerTextBox({width: 240});
        $('#messageTemplate').ligerTextBox({width: 240, height: 150});
        $('#remark').ligerTextBox({width: 240, height: 150});
        $(function () {
            init();
        });
        if(detailModel.id) {
            channelTb.setDisabled(true);
            channelTb.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() {
            var channelTb = $('#channel').ligerTextBox({width: 240});
            $('#channelName').ligerTextBox({width: 240});
            $('#messageTemplate').ligerTextBox({width: 240, height: 150});
            $('#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) {
                channelTb.setDisabled(true);
                channelTb.setReadonly(true);
            }
            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) {
                            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/mq/channel/"+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 'channel':
                        var channel = $("#channel").val();
                        if(!$.Util.isStrEquals(channel, detailModel.channel)) {
                            var ulr = "${contextRoot}/redis/mq/channel/isUniqueChannel";
                            return $.Util.validateByAjax(ulr, {id: id, channel: channel});
                        }
                        break;
                    case 'channelName':
                        var channelName = $("#channelName").val();
                        if(!$.Util.isStrEquals(channelName, detailModel.channelName)) {
                            var ulr = "${contextRoot}/redis/mq/channel/isUniqueChannelName";
                            return $.Util.validateByAjax(ulr, {id: id, channelName: channelName});
                        }
                        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 'channel':
                            var channel = $("#channel").val();
                            if(!$.Util.isStrEquals(channel, detailModel.channel)) {
                                var ulr = "${contextRoot}/redis/mq/channel/isUniqueChannel";
                                return $.Util.validateByAjax(ulr, {id: id, channel: channel});
                            }
                            break;
                        case 'channelName':
                            var channelName = $("#channelName").val();
                            if(!$.Util.isStrEquals(channelName, detailModel.channelName)) {
                                var ulr = "${contextRoot}/redis/mq/channel/isUniqueChannelName";
                                return $.Util.validateByAjax(ulr, {id: id, channelName: channelName});
                            }
                            break;
                    }
                }
            }
        });
    }
            });
        }
    });
})(jQuery, window)
</script>

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

@ -1,6 +1,13 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="utf-8" %>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <%@ include file="../../../head/page_head.jsp" %>
    <%@ include file="listCss.jsp" %>
    <title>用户管理</title>
</head>
<body>
<div class="m-form-inline">
    <div class="m-form-group f-mt10">
@ -20,3 +27,7 @@
    <div id="grid"></div>
</div>
</body>
<%@ include file="../../../head/page_foot.jsp" %>
<%@ include file="listJs.jsp" %>
</html>

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

@ -3,128 +3,136 @@
<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: '${contextRoot}/redis/mq/channel/search',
            method:'GET',
            columns: [
                {display: 'ID', name: 'id', hide: true},
                {display: '消息队列编码', name: 'channel', width: '20%', isAllowHide: false, align: 'left'},
                {display: '消息队列名称', name: 'channelName', width: '20%', isAllowHide: false, align: 'left'},
                {display: '入列数', name: 'enqueuedNum', width: '5%', isAllowHide: false, align: 'center'},
                {display: '出列数', name: 'dequeuedNum', width: '5%', isAllowHide: false, align: 'center'},
                {display: '订阅者数', name: 'subscriberNum', width: '5%', isAllowHide: false, align: 'center'},
                {display: '发布者数', name: 'publisherNum', width: '5%', isAllowHide: false, align: 'center'},
                {display: '备注', name: 'remark', width: '25%', isAllowHide: false, align: 'left'},
                {display: '操作', name: 'operator', width: '15%', minWidth: 120, align: 'center',
                    render: function (row) {
                        var html = '';
                        html += '<sec:authorize url="/redis/mq/channel/publisherList"><a class="label_a f-ml10" title="发布者" href="javascript:void(0)" onclick="javascript:' + $.Util.format("$.publish('{0}',['{1}'])", "redis:mq:channel:publisherList", row.channel) + '">发布者</a></sec:authorize>';
                        html += '<sec:authorize url="/redis/mq/channel/subscriberList"><a class="label_a f-ml10" title="订阅者" href="javascript:void(0)" onclick="javascript:' + $.Util.format("$.publish('{0}',['{1}'])", "redis:mq:channel:subscriberList", row.channel) + '">订阅者</a></sec:authorize>';
                        html += '<sec:authorize url="/redis/mq/channel/detail"><a class="grid_edit f-ml10" title="编辑" href="javascript:void(0)" onclick="javascript:' + $.Util.format("$.publish('{0}',['{1}','{2}'])", "redis:mq:channel:detail", row.id, 'modify') + '"></a></sec:authorize>';
                        html += '<sec:authorize url="/redis/mq/channel/delete"><a class="grid_delete" title="删除" href="javascript:void(0)"  onclick="javascript:' + $.Util.format("$.publish('{0}',['{1}'])", "redis:mq:channel:delete", row.id) + '"></a></sec:authorize>';
                        return html;
                    }
        function init() {
            initWidget();
            bindEvents();
        }
        function initWidget() {
            $('#searchContent').ligerTextBox({
                width: 200, isSearch: true, search: function () {
                    reloadGrid();
                }
            ],
            allowHideColumn: false,
            usePager: true
        }));
        grid.collapseAll();
        grid.adjustToWidth();
    }
            });
    function bindEvents() {
        // 发布者
        $.subscribe('redis:mq:channel:publisherList', function (event, channel) {
            var url = '${contextRoot}/redis/mq/publisher/index?';
            $("#contentPage").empty();
            $("#contentPage").load(url,{channel: channel});
        });
            grid = $("#grid").ligerGrid($.LigerGridEx.config({
                url: '${contextRoot}/redis/mq/channel/search',
                method:'GET',
                columns: [
                    {display: 'ID', name: 'id', hide: true},
                    {display: '消息队列编码', name: 'channel', width: '20%', isAllowHide: false, align: 'left'},
                    {display: '消息队列名称', name: 'channelName', width: '20%', isAllowHide: false, align: 'left'},
                    {display: '入列数', name: 'enqueuedNum', width: '5%', isAllowHide: false, align: 'center'},
                    {display: '出列数', name: 'dequeuedNum', width: '5%', isAllowHide: false, align: 'center'},
                    {display: '订阅者数', name: 'subscriberNum', width: '5%', isAllowHide: false, align: 'center'},
                    {display: '发布者数', name: 'publisherNum', width: '5%', isAllowHide: false, align: 'center'},
                    {display: '备注', name: 'remark', width: '25%', isAllowHide: false, align: 'left'},
                    {display: '操作', name: 'operator', width: '15%', minWidth: 120, align: 'center',
                        render: function (row) {
                            var html = '';
                            <sec:authorize url="/redis/mq/channel/publisherList">
                            html += '<a class="label_a f-ml10" title="发布者" href="${contextRoot}/admin/redis/publisher/index?channel='+row.channel+'">发布者</a>';
                            </sec:authorize>
                            <sec:authorize url="/redis/mq/channel/subscriberList">
                            html += '<a class="label_a f-ml10" title="订阅者" href="${contextRoot}/admin/redis/subscriber/index?channel='+row.channel + '">订阅者</a>';
                            </sec:authorize>
                            html += '<sec:authorize url="/redis/mq/channel/detail"><a class="grid_edit f-ml10" title="编辑" href="javascript:void(0)" onclick="javascript:' + $.Util.format("$.publish('{0}',['{1}','{2}'])", "redis:mq:channel:detail", row.id, 'modify') + '"></a></sec:authorize>';
                            html += '<sec:authorize url="/redis/mq/channel/delete"><a class="grid_delete" title="删除" href="javascript:void(0)"  onclick="javascript:' + $.Util.format("$.publish('{0}',['{1}'])", "redis:mq:channel:delete", row.id) + '"></a></sec:authorize>';
                            return html;
                        }
                    }
                ],
                allowHideColumn: false,
                usePager: true
            }));
            grid.collapseAll();
            grid.adjustToWidth();
        }
        // 订阅者
        $.subscribe('redis:mq:channel:subscriberList', function (event, channel) {
            var url = '${contextRoot}/redis/mq/subscriber/index?';
            $("#contentPage").empty();
            $("#contentPage").load(url,{channel: channel});
        });
        function bindEvents() {
            // 发布者
            $.subscribe('redis:mq:channel:publisherList', function (event, channel) {
                var url = '${contextRoot}/admin/redis/publisher/index?';
                $("#contentPage").empty();
                $("#contentPage").load(url,{channel: channel});
            });
        // 新增/修改
        $.subscribe('redis:mq:channel:detail', function (event, id, mode) {
            var title = '新增消息队列';
            if (mode == 'modify') {
                title = '修改消息队列';
            }
            detailDialog = $.ligerDialog.open({
                height: 560,
                width: 480,
                title: title,
                url: '${contextRoot}/redis/mq/channel/detail',
                urlParms: {
                    id: id,
                    mode: mode
            // 订阅者
            $.subscribe('redis:mq:channel:subscriberList', function (event, channel) {
                var url = '${contextRoot}/admin/redis/subscriber/index?';
                $("#contentPage").empty();
                $("#contentPage").load(url,{channel: channel});
            });
            // 新增/修改
            $.subscribe('redis:mq:channel:detail', function (event, id, mode) {
                var title = '新增消息队列';
                if (mode == 'modify') {
                    title = '修改消息队列';
                }
                detailDialog = $.ligerDialog.open({
                    height: 560,
                    width: 480,
                    title: title,
                    url: '${contextRoot}/redis/mq/channel/detail',
                    urlParms: {
                        id: id,
                        mode: mode
                    }
                });
            });
        });
        // 删除
        $.subscribe('redis:mq:channel:delete', function (event, id) {
            $.Notice.confirm('确认要删除所选数据吗?', function (r) {
                if (r) {
                    var loading = $.ligerDialog.waitting("正在删除数据...");
                    dataModel.updateRemote('${contextRoot}/redis/mq/channel/delete', {
                        data: {id: parseInt(id)},
                        success: function (data) {
                            if (data.successFlg) {
                                $.Notice.success('删除成功!');
                                reloadGrid();
                            } else {
                                $.Notice.error(data.errorMsg);
            // 删除
            $.subscribe('redis:mq:channel:delete', function (event, id) {
                $.Notice.confirm('确认要删除所选数据吗?', function (r) {
                    if (r) {
                        var loading = $.ligerDialog.waitting("正在删除数据...");
                        dataModel.updateRemote('${contextRoot}/redis/mq/channel/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();
                            }
                        },
                        error: function () {
                            $.Notice.error('删除发生异常');
                        },
                        complete: function () {
                            loading.close();
                        }
                    });
                }
            })
        });
    }
                        });
                    }
                })
            });
        }
    function reloadGrid() {
        var params = {searchContent: $('#searchContent').val()};
        $.Util.reloadGrid.call(grid, '${contextRoot}/redis/mq/channel/search', params);
    }
        function reloadGrid() {
            var params = {searchContent: $('#searchContent').val()};
            $.Util.reloadGrid.call(grid, '${contextRoot}/redis/mq/channel/search', params);
        }
    /*-- 与明细 Dialog 页面间回调的函数 --*/
    window.reloadMasterGrid = function() {
        reloadGrid();
    };
    window.closeDetailDialog = function (type, msg) {
        detailDialog.close();
        msg && $.Notice.success(msg);
    };
        /*-- 与明细 Dialog 页面间回调的函数 --*/
        window.reloadMasterGrid = function() {
        };
        window.closeDetailDialog = function (type, msg) {
            detailDialog.close();
            reloadGrid();
            msg && $.Notice.success(msg);
        };
    });
})(jQuery, window)
</script>

+ 12 - 2
patient-co-manage/redis-cache/src/main/webapp/WEB-INF/views/redis/mq/publisher/detail.jsp

@ -1,5 +1,12 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="utf-8" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <%@ include file="../../../head/page_head.jsp" %>
    <%@ include file="detailCss.jsp" %>
    <title>用户管理</title>
</head>
<body>
<div id="redisMqSubscriberForm" class="m-form-inline f-mt20" data-role-form>
    <input type="hidden" id="id" data-attr-scan="id">
@ -42,4 +49,7 @@
        </div>
    </div>
</div>
</body>
<%@ include file="../../../head/page_foot.jsp" %>
<%@ include file="detailJs.jsp" %>
</html>

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

@ -2,94 +2,97 @@
<script>
    var detailModel = ${detailModel};
    var dataModel = $.DataModel.init();
    var validator;
    var $form = $("#redisMqSubscriberForm");
(function ($, win) {
    $(function () {
        init();
    });
    function init() {
        validator = customFormValidator();
        initForm();
        bindEvents();
    }
        var detailModel = ${detailModel};
        var dataModel = $.DataModel.init();
        var validator;
        var $form = $("#redisMqSubscriberForm");
    function initForm() {
        $('#channel').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() {
            $('#channel').ligerTextBox({width: 240, disabled: true, readonly: true});
            var appIdTb = $('#appId').ligerTextBox({width: 240});
            $('#authorizedCode').ligerTextBox({width: 240});
            $('#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/mq/publisher/"+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/mq/publisher/"+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(channel, detailModel.channel)) {
                            var ulr = "${contextRoot}/redis/mq/publisher/isUniqueAppId";
                            return $.Util.validateByAjax(ulr, {id: id, channel: channel, 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(channel, detailModel.channel)) {
                                var ulr = "${contextRoot}/redis/mq/publisher/isUniqueAppId";
                                return $.Util.validateByAjax(ulr, {id: id, channel: channel, appId: appId});
                            }
                            break;
                    }
                }
            }
        });
    }
            });
        }
    });
})(jQuery, window)
</script>

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

@ -1,6 +1,13 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="utf-8" %>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <%@ include file="../../../head/page_head.jsp" %>
    <%@ include file="listCss.jsp" %>
    <title>用户管理</title>
</head>
<body>
<div class="m-form-inline">
    <div id="conditionArea" class="f-mb10 f-mr10" align="right">
@ -27,3 +34,7 @@
    <div id="grid"></div>
</div>
</body>
<%@ include file="../../../head/page_foot.jsp" %>
<%@ include file="listJs.jsp" %>
</html>

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

@ -3,121 +3,126 @@
<script>
    var dataModel = $.DataModel.init();
    var channel = '${channel}';
    var detailDialog = null;
    var grid = null;
(function ($, win) {
    $(function () {
        init();
    });
    function init() {
        initWidget();
        bindEvents();
    }
        var dataModel = $.DataModel.init();
        var channel = '${channel}';
        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/mq/publisher/search',
            urlParms: { channel: channel },
            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: 'createDate', 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/mq/publisher/detail"><a class="grid_edit f-ml10" title="编辑" href="javascript:void(0)" onclick="javascript:' + $.Util.format("$.publish('{0}',['{1}','{2}'])", "redis:mq:publisher:detail", row.id, 'modify') + '"></a></sec:authorize>';
                        html += '<sec:authorize url="/redis/mq/publisher/delete"><a class="grid_delete" title="删除" href="javascript:void(0)"  onclick="javascript:' + $.Util.format("$.publish('{0}',['{1}'])", "redis:mq:publisher:delete", row.id) + '"></a></sec:authorize>';
                        return html;
                    }
                }
            ],
            allowHideColumn: false,
            usePager: true
        }));
        grid.collapseAll();
        grid.adjustToWidth();
    }
        function init() {
            initWidget();
            bindEvents();
        }
    function bindEvents() {
        // 新增/修改
        $.subscribe('redis:mq:publisher:detail', function (event, id, mode) {
            var title = '新增消息发布者';
            if (mode == 'modify') {
                title = '修改消息发布者';
            }
            detailDialog = $.ligerDialog.open({
                height: 450,
                width: 480,
                title: title,
                url: '${contextRoot}/redis/mq/publisher/detail',
                urlParms: {
                    id: id,
                    channel: channel
        function initWidget() {
            $('#searchContent').ligerTextBox({
                width: 200, isSearch: true, search: function () {
                    reloadGrid();
                }
            });
        });
        // 删除
        $.subscribe('redis:mq:publisher:delete', function (event, id) {
            $.Notice.confirm('删除后该发布者将不能发布消息,确认要删除吗?', function (r) {
                if (r) {
                    var loading = $.ligerDialog.waitting("正在删除数据...");
                    dataModel.updateRemote('${contextRoot}/redis/mq/publisher/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/mq/publisher/search',
                urlParms: { channel: channel },
                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: 'createDate', 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/mq/publisher/detail"><a class="grid_edit f-ml10" title="编辑" href="javascript:void(0)" onclick="javascript:' + $.Util.format("$.publish('{0}',['{1}','{2}'])", "redis:mq:publisher:detail", row.id, 'modify') + '"></a></sec:authorize>';
                            html += '<sec:authorize url="/redis/mq/publisher/delete"><a class="grid_delete" title="删除" href="javascript:void(0)"  onclick="javascript:' + $.Util.format("$.publish('{0}',['{1}'])", "redis:mq:publisher:delete", row.id) + '"></a></sec:authorize>';
                            return html;
                        }
                    });
                    }
                ],
                allowHideColumn: false,
                usePager: true
            }));
            grid.collapseAll();
            grid.adjustToWidth();
        }
        function bindEvents() {
            // 新增/修改
            $.subscribe('redis:mq:publisher:detail', function (event, id, mode) {
                var title = '新增消息发布者';
                if (mode == 'modify') {
                    title = '修改消息发布者';
                }
            })
        });
                detailDialog = $.ligerDialog.open({
                    height: 450,
                    width: 480,
                    title: title,
                    url: '${contextRoot}/redis/mq/publisher/detail',
                    urlParms: {
                        id: id,
                        channel: channel
                    }
                });
            });
        // 返回上一页
        $('#btn_back').click(function(){
            $('#contentPage').empty();
            $('#contentPage').load('${contextRoot}/redis/mq/channel/index');
        });
            // 删除
            $.subscribe('redis:mq:publisher:delete', function (event, id) {
                $.Notice.confirm('删除后该发布者将不能发布消息,确认要删除吗?', function (r) {
                    if (r) {
                        var loading = $.ligerDialog.waitting("正在删除数据...");
                        dataModel.updateRemote('${contextRoot}/redis/mq/publisher/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(){
                <%--$('#contentPage').empty();--%>
                <%--$('#contentPage').load('${contextRoot}/redis/mq/channel/index');--%>
                window.location.href = '${contextRoot}/admin/redis/channel';
            });
    function reloadGrid() {
        var params = {
            searchContent: $('#searchContent').val(),
            channel: channel
        };
        $.Util.reloadGrid.call(grid, '${contextRoot}/redis/mq/publisher/search', params);
    }
        }
        function reloadGrid() {
            var params = {
                searchContent: $('#searchContent').val(),
                channel: channel
            };
            $.Util.reloadGrid.call(grid, '${contextRoot}/redis/mq/publisher/search', params);
        }
    /*-- 与明细 Dialog 页面间回调的函数 --*/
    window.reloadMasterGrid = function() {
        reloadGrid();
    };
    window.closeDetailDialog = function (type, msg) {
        detailDialog.close();
        msg && $.Notice.success(msg);
    };
        /*-- 与明细 Dialog 页面间回调的函数 --*/
        window.reloadMasterGrid = function() {
        };
        window.closeDetailDialog = function (type, msg) {
            detailDialog.close();
            reloadGrid();
            msg && $.Notice.success(msg);
        };
    });
})(jQuery, window)
</script>

+ 12 - 2
patient-co-manage/redis-cache/src/main/webapp/WEB-INF/views/redis/mq/subscriber/detail.jsp

@ -1,5 +1,12 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="utf-8" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <%@ include file="../../../head/page_head.jsp" %>
    <%@ include file="detailCss.jsp" %>
    <title>用户管理</title>
</head>
<body>
<div id="redisMqSubscriberForm" class="m-form-inline f-mt20" data-role-form>
    <input type="hidden" id="id" data-attr-scan="id">
@ -42,4 +49,7 @@
        </div>
    </div>
</div>
</body>
<%@ include file="../../../head/page_foot.jsp" %>
<%@ include file="detailJs.jsp" %>
</html>

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

@ -2,103 +2,106 @@
<script>
    var detailModel = ${detailModel};
    var dataModel = $.DataModel.init();
    var validator;
    var $form = $("#redisMqSubscriberForm");
(function ($, win) {
    $(function () {
        init();
    });
    function init() {
        validator = customFormValidator();
        initForm();
        bindEvents();
    }
        var detailModel = ${detailModel};
        var dataModel = $.DataModel.init();
        var validator;
        var $form = $("#redisMqSubscriberForm");
    function initForm() {
        $('#channel').ligerTextBox({width: 240, disabled: true, readonly: true});
        var appIdTb = $('#appId').ligerTextBox({width: 240});
        var subscribedUrlTb = $('#subscribedUrl').ligerTextBox({width: 240});
        $('#remark').ligerTextBox({width: 240, height: 150});
        $(function () {
            init();
        });
        if(detailModel.id) {
            appIdTb.setDisabled(true);
            appIdTb.setReadonly(true);
            subscribedUrlTb.setDisabled(true);
            subscribedUrlTb.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() {
            $('#channel').ligerTextBox({width: 240, disabled: true, readonly: true});
            var appIdTb = $('#appId').ligerTextBox({width: 240});
            var subscribedUrlTb = $('#subscribedUrl').ligerTextBox({width: 240});
            $('#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);
                subscribedUrlTb.setDisabled(true);
                subscribedUrlTb.setReadonly(true);
            }
            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) {
                            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/mq/subscriber/"+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(channel, detailModel.channel)) {
                            var ulr = "${contextRoot}/redis/mq/subscriber/isUniqueAppId";
                            return $.Util.validateByAjax(ulr, {id: id, channel: channel, appId: appId});
                        }
                        break;
                    case 'subscribedUrl':
                        var subscriberUrl = $("#subscribedUrl").val();
                        if(!$.Util.isStrEquals(channel, detailModel.channel)) {
                            var ulr = "${contextRoot}/redis/mq/subscriber/isUniqueSubscribedUrl";
                            return $.Util.validateByAjax(ulr, {id: id, channel: channel, subscriberUrl: subscriberUrl});
                        }
                        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(channel, detailModel.channel)) {
                                var ulr = "${contextRoot}/redis/mq/subscriber/isUniqueAppId";
                                return $.Util.validateByAjax(ulr, {id: id, channel: detailModel.channel, appId: appId});
                            }
                            break;
                        case 'subscribedUrl':
                            var subscriberUrl = $("#subscribedUrl").val();
                            if(!$.Util.isStrEquals(channel, detailModel.channel)) {
                                var ulr = "${contextRoot}/redis/mq/subscriber/isUniqueSubscribedUrl";
                                return $.Util.validateByAjax(ulr, {id: id, channel: detailModel.channel, subscriberUrl: subscriberUrl});
                            }
                            break;
                    }
                }
            }
        });
    }
            });
        }
    });
})(jQuery, window)
</script>

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

@ -1,6 +1,13 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="utf-8" %>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <%@ include file="../../../head/page_head.jsp" %>
    <%@ include file="listCss.jsp" %>
    <title>用户管理</title>
</head>
<body>
<div class="m-form-inline">
    <div id="conditionArea" class="f-mb10 f-mr10" align="right">
@ -27,3 +34,7 @@
    <div id="grid"></div>
</div>
</body>
<%@ include file="../../../head/page_foot.jsp" %>
<%@ include file="listJs.jsp" %>
</html>

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

@ -3,121 +3,126 @@
<script>
    var dataModel = $.DataModel.init();
    var channel = '${channel}';
    var detailDialog = null;
    var grid = null;
(function ($, win) {
    $(function () {
        init();
    });
    function init() {
        initWidget();
        bindEvents();
    }
        var dataModel = $.DataModel.init();
        var channel = '${channel}';
        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/mq/subscriber/search',
            urlParms: { channel: channel },
            method:'GET',
            columns: [
                {display: 'ID', name: 'id', hide: true},
//                {display: '应用ID', name: 'appId', width: '10%', isAllowHide: false, align: 'left'},
                {display: '订阅者服务地址', name: 'subscribedUrl', width: '25%', isAllowHide: false, align: 'left'},
                {display: '创建日期', name: 'createDate', 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/mq/subscriber/detail"><a class="grid_edit f-ml10" title="编辑" href="javascript:void(0)" onclick="javascript:' + $.Util.format("$.publish('{0}',['{1}','{2}'])", "redis:mq:subscriber:detail", row.id, 'modify') + '"></a></sec:authorize>';
                        html += '<sec:authorize url="/redis/mq/subscriber/delete"><a class="grid_delete" title="删除" href="javascript:void(0)"  onclick="javascript:' + $.Util.format("$.publish('{0}',['{1}'])", "redis:mq:subscriber:delete", row.id) + '"></a></sec:authorize>';
                        return html;
                    }
                }
            ],
            allowHideColumn: false,
            usePager: true
        }));
        grid.collapseAll();
        grid.adjustToWidth();
    }
        function init() {
            initWidget();
            bindEvents();
        }
    function bindEvents() {
        // 新增/修改
        $.subscribe('redis:mq:subscriber:detail', function (event, id, mode) {
            var title = '新增消息订阅者';
            if (mode == 'modify') {
                title = '修改消息订阅者';
            }
            detailDialog = $.ligerDialog.open({
                height: 450,
                width: 480,
                title: title,
                url: '${contextRoot}/redis/mq/subscriber/detail',
                urlParms: {
                    id: id,
                    channel: channel
        function initWidget() {
            $('#searchContent').ligerTextBox({
                width: 200, isSearch: true, search: function () {
                    reloadGrid();
                }
            });
        });
        // 删除
        $.subscribe('redis:mq:subscriber:delete', function (event, id) {
            $.Notice.confirm('删除后该订阅者服务地址将不会接收到发布的消息,确认要删除吗?', function (r) {
                if (r) {
                    var loading = $.ligerDialog.waitting("正在删除数据...");
                    dataModel.updateRemote('${contextRoot}/redis/mq/subscriber/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/mq/subscriber/search',
                urlParms: { channel: channel },
                method:'GET',
                columns: [
                    {display: 'ID', name: 'id', hide: true},
        //                {display: '应用ID', name: 'appId', width: '10%', isAllowHide: false, align: 'left'},
                    {display: '订阅者服务地址', name: 'subscribedUrl', width: '25%', isAllowHide: false, align: 'left'},
                    {display: '创建日期', name: 'createDate', 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/mq/subscriber/detail"><a class="grid_edit f-ml10" title="编辑" href="javascript:void(0)" onclick="javascript:' + $.Util.format("$.publish('{0}',['{1}','{2}'])", "redis:mq:subscriber:detail", row.id, 'modify') + '"></a></sec:authorize>';
                            html += '<sec:authorize url="/redis/mq/subscriber/delete"><a class="grid_delete" title="删除" href="javascript:void(0)"  onclick="javascript:' + $.Util.format("$.publish('{0}',['{1}'])", "redis:mq:subscriber:delete", row.id) + '"></a></sec:authorize>';
                            return html;
                        }
                    });
                    }
                ],
                allowHideColumn: false,
                usePager: true
            }));
            grid.collapseAll();
            grid.adjustToWidth();
        }
        function bindEvents() {
            // 新增/修改
            $.subscribe('redis:mq:subscriber:detail', function (event, id, mode) {
                var title = '新增消息订阅者';
                if (mode == 'modify') {
                    title = '修改消息订阅者';
                }
            })
        });
                detailDialog = $.ligerDialog.open({
                    height: 450,
                    width: 480,
                    title: title,
                    url: '${contextRoot}/redis/mq/subscriber/detail',
                    urlParms: {
                        id: id,
                        channel: channel
                    }
                });
            });
        // 返回上一页
        $('#btn_back').click(function(){
            $('#contentPage').empty();
            $('#contentPage').load('${contextRoot}/redis/mq/channel/index');
        });
            // 删除
            $.subscribe('redis:mq:subscriber:delete', function (event, id) {
                $.Notice.confirm('删除后该订阅者服务地址将不会接收到发布的消息,确认要删除吗?', function (r) {
                    if (r) {
                        var loading = $.ligerDialog.waitting("正在删除数据...");
                        dataModel.updateRemote('${contextRoot}/redis/mq/subscriber/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(){
                <%--$('#contentPage').empty();--%>
                <%--$('#contentPage').load('${contextRoot}/redis/mq/channel/index');--%>
                window.location.href = '${contextRoot}/admin/redis/channel';
            });
    function reloadGrid() {
        var params = {
            searchContent: $('#searchContent').val(),
            channel: channel
        };
        $.Util.reloadGrid.call(grid, '${contextRoot}/redis/mq/subscriber/search', params);
    }
        }
        function reloadGrid() {
            var params = {
                searchContent: $('#searchContent').val(),
                channel: channel
            };
            $.Util.reloadGrid.call(grid, '${contextRoot}/redis/mq/subscriber/search', params);
        }
    /*-- 与明细 Dialog 页面间回调的函数 --*/
    window.reloadMasterGrid = function() {
        reloadGrid();
    };
    window.closeDetailDialog = function (type, msg) {
        detailDialog.close();
        msg && $.Notice.success(msg);
    };
        /*-- 与明细 Dialog 页面间回调的函数 --*/
        window.reloadMasterGrid = function() {
        };
        window.closeDetailDialog = function (type, msg) {
            detailDialog.close();
            reloadGrid();
            msg && $.Notice.success(msg);
        };
    });
})(jQuery, window)
</script>

+ 0 - 42
patient-co-manage/redis-cache/src/main/webapp/WEB-INF/views/user/user_list.jsp

@ -1,42 +0,0 @@
<%@ page contentType="text/html; charset=UTF-8" language="java" pageEncoding="UTF-8" %>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<!DOCTYPE html>
<html lang="en">
<head>
	<%@ include file="../head/page_head.jsp" %>
	<title>用户管理</title>
</head>
<body>
<div id="div_wrapper">
	<!-- 检索条件 -->
	<div class="m-retrieve-area f-h50 f-dn f-pr m-form-inline" data-role-form style='display: block;'>
		<div class="m-form-group f-mt10">
			<div class="m-form-control f-ml15">
				<input type="text" id="inp_name" placeholder="请输入用户姓名" class="f-ml10" data-attr-scan="name"/>
			</div>
			<div class="m-form-control f-ml15">
				<input type="text" id="inp_mobile" placeholder="请输入手机号" class="f-ml10" data-attr-scan="mobile"/>
			</div>
			<sec:authorize url="/admin/user/userList">
			<div id="btn_search" class="l-button u-btn u-btn-primary u-btn-small f-ib f-vam  f-ml10" >
				<span>查询</span>
			</div>
			</sec:authorize>
			<sec:authorize url="/admin/user/create">
			<div class="m-form-control m-form-control-fr">
				<div id="btn_add" class="l-button u-btn u-btn-primary u-btn-small f-ib f-vam" style="margin-right: 20px;">
					<span>新增</span>
				</div>
			</div>
			</sec:authorize>
		</div>
	</div>
	<!-- 列表 -->
	<div id="div_user_list">
	</div>
</div>
</body>
<%@ include file="../head/page_foot.jsp" %>
<%@ include file="user_list_js.jsp" %>
</html>

+ 0 - 202
patient-co-manage/redis-cache/src/main/webapp/WEB-INF/views/user/user_list_js.jsp

@ -1,202 +0,0 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="utf-8" %>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<script>
	(function ($, win) {
		$(function () {
			/* ************************** 变量定义 ******************************** */
			// 通用工具类库
			var Util = $.Util;
			var retrieve = null;
			var master = null;
			var isFirstPage = false;
			/* *************************** 函数定义 ******************************* */
			function pageInit() {
				retrieve.init();
				master.init();
			}
			function reloadGrid(params) {
				if (isFirstPage) {
					this.grid.options.newPage = 1;
				}
				this.grid.setOptions({parms: params});
				this.grid.loadData(true);
			}
			/* *************************** 模块初始化 ***************************** */
			retrieve = {
				$element: $('.m-retrieve-area'),
				$searchBtn: $('#btn_search'),
				$addBtn: $('#btn_add'),
				$name: $("#inp_name"),//人员姓名
				$code: $("#inp_code"),//人员姓名
				$mobile: $("#inp_mobile"),
				init: function () {
					this.$element.show();
					this.$element.attrScan();
					window.form = this.$element;
					this.$name.ligerTextBox({width: 200}); //姓名
					this.$code.ligerTextBox({width: 200}); //姓名
					this.$mobile.ligerTextBox({width: 200})//手机号
					this.bindEvents();
				},
				bindEvents: function () {
					var self = this;
					self.$searchBtn.click(function () {
						master.grid.options.newPage = 1;
						master.reloadGrid();
					});
					self.$addBtn.click(function () {
						$.publish("info:create", [''])
					});
				}
			};
			master = {
				infoDialog: null,
				grid: null,
				init: function () {
					var data;
					this.grid = $("#div_user_list").ligerGrid($.LigerGridEx.config({
						url: ctx + '/admin/user/userList',
						parms: {},
						ajaxHeader: ajaxHeaderName,
						ajaxHeaderValue: ajaxHeaderValue,
						columns: [
							{display: 'ID', name: 'id', hide: true},
							{display: '用户编码', name: 'code', width: '10%', align: "center"},
							{display: '用户姓名', name: 'name', width: '10%', align: "center"},
							{display: '手机号码', name: 'mobile', width: '10%', align: "center"},
							{
								display: '用户类型', name: 'type', width: '10%', align: "center",
								render: function (row) {
									if (Util.isStrEquals(row.type, "1")) {
										return "管理员";
									} else if (Util.isStrEquals(row.type, "2")) {
										return "医生";
									}else if (Util.isStrEquals(row.type, "3")) {
                                        return "客服管理员";
                                    }else if (Util.isStrEquals(row.type, "4")) {
                                        return "普通客服";
                                    }
									return "其他";
								}
							},
							{display: '创建时间', name: 'czrq', width: '15%', align: "center"},
							{display: '用户角色', name: 'roleName', width: '10%', align: "center"},
							{display: '所属机构', name: '', width: '20%', align: "left"},
							{
								display: '操作', name: 'operator', width: '15%', align: "center", isSort: false,
								render: function (row) {
									var html = '';
									html += '<a  href="javascript:void(0)" onclick="javascript:' + Util.format("$.publish('{0}',['{1}'])", "info:view", row.id) + '">查看</a>';
									<sec:authorize url="/admin/user/update">
									if (!Util.isStrEquals(row.code, "admin")) {
										html += '<a  style="margin-left:10px;"href="javascript:void(0)" onclick="javascript:' + Util.format("$.publish('{0}',['{1}'])", "info:edit", row.id) + '">编辑</a>';
									}
									</sec:authorize>
									<sec:authorize url="/admin/user/delete">
									if (!Util.isStrEquals(row.code, "admin")) {
										html += '<a  style="margin-left:10px;" title="删除" href="javascript:void(0)" onclick="javascript:' + Util.format("$.publish('{0}',['{1}','{2}'])", "info:del", row.id) + '">删除</a>';
									}
									</sec:authorize>
									return html;
								}
							}
						],
					}));
					// 自适应宽度
					this.grid.adjustToWidth();
					this.bindEvents();
				},
				reloadGrid: function (msg) {
					if (msg) {
						//如果是新增,直接刷新页面
						master.grid.loadData();
					} else {
						//如果是查询
						retrieve.$element.attrScan();
						var values = retrieve.$element.Fields.getValues();
						reloadGrid.call(this, values);
					}
				},
				delRecord: function (id, code) {
					var self = this;
					$.ajax({
						url: ctx + "/admin/user/delete",
						data: {"id": id},
						method: "post",
						dataType: "json",
						success: function (result) {
							if (result.status == '200') {
								window.reloadMasterGrid(result.msg);
							} else {
								$.Notice.error(result.msg);
							}
						},
						error: function (data) {
							$.Notice.error("系统异常,请联系管理员!");
						}
					})
				},
				bindEvents: function () {
					var self = this;
					$.subscribe('info:view', function (event, id) {
						var title = '查看用户信息';
						self.infoDialog = $.ligerDialog.open({
							height: 460,
							width: 490,
							urlParms: {"id": id, "mode": "view"},
							title: title,
							url: ctx + '/admin/user/infoInit'
						})
					});
					$.subscribe('info:edit', function (event, id) {
						var title = '编辑用户信息';
						self.infoDialog = $.ligerDialog.open({
							height: 460,
							width: 490,
							urlParms: {"id": id, "mode": "edit"},
							title: title,
							url: ctx + '/admin/user/infoInit'
						})
					});
					$.subscribe('info:create', function (event, id) {
						var title = '新增用户';
						self.infoDialog = $.ligerDialog.open({
							height: 460,
							width: 490,
							urlParms: {"id": id, "mode": "new"},
							title: title,
							url: ctx + '/admin/user/infoInit'
						})
					});
					$.subscribe('info:del', function (event, id, code) {
						$.ligerDialog.confirm('确认删除该行信息?<br>如果是请点击确认按钮,否则请点击取消。', function (yes) {
							if (yes) {
								self.delRecord(id, code);
							}
						});
					})
				}
			};
			/* ************************* Dialog页面回调接口 ************************** */
			win.reloadMasterGrid = function (msg) {
				if (isNoEmpty(msg)) {
					$.Notice.success(msg);
				}
				master.reloadGrid(msg);
			};
			win.closeUserInfoDialog = function () {
				master.infoDialog.close();
			};
			/* *************************** 页面初始化 **************************** */
			pageInit();
		});
	})(jQuery, window);
</script>

+ 0 - 88
patient-co-manage/redis-cache/src/main/webapp/WEB-INF/views/user/user_modify.jsp

@ -1,88 +0,0 @@
<%@ page contentType="text/html; charset=UTF-8" language="java" pageEncoding="UTF-8" %>
<html>
<head>
	<%@ include file="../head/page_head.jsp"%>
	<title>患者详情</title>
	<style type="text/css">
		.m-form-group label.label_title{width: 100px}
	</style>
</head>
<body>
<div id="div_patient_info_form" data-role-form class="m-form-inline f-mt20 f-ml30" data-role-form>
	<input type="hidden" id="inp_id" value='${id}' data-attr-scan="id"/>
	<input type="hidden" id="inp_mode" value='${mode}'/>
	<!-- <div class="m-form-group">	 -->
	<%--<div  class="l-text-wrapper m-form-control " style="height:150px;width:120px;background:#EDF6FA;float:right;position: absolute;right: 90px;top: 30px;">--%>
		<%--<input type="hidden" id="photo" data-attr-scan="photo"/>--%>
	<%--</div>--%>
	<!-- </div> -->
	<div class="m-form-group" style="padding:10 0 10 0">
		<label class="label_title" style="width:120px">编码</label>
		<div class="l-text-wrapper m-form-control essential">
			<input type="text"  id="inp_code" class="required useTitle ajax f-w240 validate-special-char"  required-title="编码不能为空"  data-attr-scan="code"/>
		</div>
	</div>
	<div class="m-form-group">
		<label class="label_title" style="width:120px">姓名</label>
		<div class="l-text-wrapper m-form-control essential">
			<input type="text"  id="inp_name" class="required useTitle f-w240 validate-special-char"  required-title="姓名不能为空"  data-attr-scan="name"/>
		</div>
	</div>
	<div class="m-form-group">
		<label class="label_title" style="width:120px">手机号码</label>
		<div class="l-text-wrapper m-form-control essential">
			<input type="text"  id="inp_mobile" class="required useTitle ajax validate-mobile-phone f-w240 validate-special-char" required-title="手机号码不能为空"  required-title="请输入手机号码"  data-attr-scan="mobile"/>
		</div>
	</div>
	<div class="m-form-group">
		<label class="label_title" style="width:120px">用户类型</label>
		<div class="l-text-wrapper m-form-control essential">
			<input type="text"  id="inp_type" class="required useTitle f-w240 validate-special-char" required-title="用户类型不能为空"  data-attr-scan="type"/>
		</div>
	</div>
	<div id="customer" style="display: none">
		<div class="m-form-group">
			<label class="label_title" style="width:120px">工号</label>
			<div class="l-text-wrapper m-form-control essential">
				<input type="text"  id="inp_jobNo" class="required useTitle f-w240 validate-special-char" required-title="工号不能为空"  data-attr-scan="jobNo"/>
			</div>
		</div>
		<div class="m-form-group">
			<label class="label_title" style="width:120px">座席</label>
			<div class="l-text-wrapper m-form-control essential">
				<input type="text"  id="inp_seat" class="required useTitle f-w240 validate-special-char" required-title="座席不能为空"  data-attr-scan="seat"/>
			</div>
		</div>
		<div class="m-form-group">
			<label class="label_title" style="width:120px">号码</label>
			<div class="l-text-wrapper m-form-control essential">
				<input type="text"  id="inp_phone" class="required useTitle f-w240 validate-special-char" required-title="号码不能为空"  data-attr-scan="phone"/>
			</div>
		</div>
	</div>
	<%--<div class="m-form-group">--%>
		<%--<label class="label_title" style="width:120px">所属角色组</label>--%>
		<%--<div class="l-text-wrapper m-form-control">--%>
			<%--<input type="text"  id="inp_roles" class="f-w240 validate-special-char" required-title=""  required-title="请输入手机号码"  data-attr-scan="roles"/>--%>
		<%--</div>--%>
	<%--</div>--%>
	<%--<div class="m-form-group">--%>
		<%--<label class="label_title" style="width:120px">所属机构</label>--%>
		<%--<div class="l-text-wrapper m-form-control">--%>
			<%--<input type="text"  id="inp_organizationId" class="f-w240 validate-special-char" required-title=""  required-title="请选择所属机构"  data-attr-scan="organizationId"/>--%>
		<%--</div>--%>
	<%--</div>--%>
	<div class="m-form-group f-pa" id="btn_save_close"  style="right: 10px;bottom: 0;display: none">
		<div class="m-form-control">
			<input type="button" value="保存" id="btn_save" class="l-button u-btn u-btn-primary u-btn-large f-ib f-vam" />
			<div id="btn_cancel" class="l-button u-btn u-btn-cancel u-btn-large f-ib f-vam" >
				<span>关闭</span>
			</div>
		</div>
	</div>
</div>
</body>
<%@ include file="../head/page_foot.jsp"%>
<%@ include file="user_modify_js.jsp" %>
<%--<script src="${ctx}/static/js/user/user_modify.js"></script>--%>
</html>

+ 0 - 228
patient-co-manage/redis-cache/src/main/webapp/WEB-INF/views/user/user_modify_js.jsp

@ -1,228 +0,0 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="utf-8" %>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<script>
	(function ($, win) {
		$(function () {
			var Util = $.Util;
			var type = $('#inp_mode').val();
			var id = $('#inp_id').val();
			var info = "";
			var oldCode = "";
			var oldMobile = "";
			var jValidation = $.jValidation;
			function pageInit() {
				info.init();
				info.initForm();
			}
			info = {
				//变量
				$form: $("#div_patient_info_form"),
				$code: $('#inp_code'),
				$name: $('#inp_name'),
				$mobile: $('#inp_mobile'),
				$type: $("#inp_type"),
                $jobNo:$("#inp_jobNo"),
                $seat:$("#inp_seat"),
                $phone:$("#inp_phone"),
				//$roles:$("#inp_roles"),
				$organization: $("#inp_organizationId"),
				init: function () {
					this.$form.attrScan();
					this.$code.ligerTextBox({width: 240});
					this.$name.ligerTextBox({width: 240});
					this.$mobile.ligerTextBox({width: 240});
					this.typeBox = this.$type.ligerComboBox({
						width: 240,
						data: [
							{text: '管理员', typeId: '1'},
							{text: '医生', typeId: '2'},
                            {text: '客服管理员', typeId: '3'},
                            {text: '普通客服', typeId: '4'},
							{text: '其他', typeId: '0'}
						],
						initIsTriggerEvent: false,
						valueField: 'typeId',
					});
                    this.$jobNo.ligerTextBox({width: 240});
                    this.$seat.ligerTextBox({width: 240});
                    this.$phone.ligerTextBox({width: 240});
				},
				initForm: function () {
					_this = this;
                    this.bindEvents();
					//修改、查看
					if (isNoEmpty(id) && id != 0) {
						$.ajax({
							url: ctx + "/admin/user/user",
							method: "post",
							dataType: "json",
							async: false,
							data: {id: id},
							success: function (result) {
								if (result.status == '200') {
									//通过id查信息
									var data = result.data;
									if (!data) {
										return
									}
									oldCode = data.code;
									oldMobile = data.mobile;
									_this.$form.Fields.fillValues({
										code: data.code,
										name: data.name,
										mobile: data.mobile,
                                        jobNo:data.jobNo,
                                        seat:data.seat,
                                        phone:data.phone
									});
									_this.typeBox.selectValue(data.type);
								} else {
									$.Notice.error(result.msg);
								}
							},
							error: function (data) {
								$.Notice.error("系统异常,请联系管理员!");
							}
						});
					}
					if (type == "view") {
						_this.$form.addClass("m-form-readonly"); //表单只读
						$(".essential").addClass("XXXtest");
						$(".essential").removeClass("essential");
						$("#btn_save_close").css("display", "none");
					} else {
						this.$form.removeClass("m-form-readonly");
						$(".XXXtest").addClass("essential");
						$("#btn_save_close").css("display", "block");
					}
					this.$form.show();
				},
				//绑定事件
				bindEvents: function () {
					var validator = new jValidation.Validation(this.$form, {
						immediate: true, onSubmit: false,
						onElementValidateForAjax: function (elm) {
							if (Util.isStrEquals($(elm).attr("id"), 'inp_mobile')) {
								var result = new jValidation.ajax.Result();
								var newMobile = $('#inp_mobile').val();
								if (newMobile != null && oldMobile != '' && oldMobile == newMobile) {
									return true;
								}
								if (newMobile != oldMobile) {
									$.ajax({
										url: ctx + "/admin/user/isMobileExist",
										async: false,
										method: "post",
										dataType: "json",
										data: {"mobile": newMobile},
										success: function (data) {
											if (data == true) {
												result.setResult(false);
												result.setErrorMsg("手机号已注册过");
											} else {
												result.setResult(true);
											}
										}
									});
								}
								return result;
							}
							;
							if (Util.isStrEquals($(elm).attr("id"), 'inp_code')) {
								var result = new jValidation.ajax.Result();
								var newCode = $('#inp_code').val();
								if (newCode != null && oldCode != '' && oldCode == newCode) {
									return true;
								}
								if (newCode != oldCode) {
									$.ajax({
										url: ctx + "/admin/user/isCodeExist",
										async: false,
										method: "post",
										dataType: "json",
										data: {"code": newCode},
										success: function (data) {
											if (data == true) {
												result.setResult(false);
												result.setErrorMsg("用户编码已存在");
											} else {
												result.setResult(true);
											}
										}
									});
								}
								return result;
							}
						}
					});
					var self = this;
					$("#btn_save").click(function () {
                        var values = self.$form.Fields.getValues();
                        if (!validator.validate()) {
                            return;
                        }
                        values.type = self.typeBox.getValue();
                        update(values);
                    });
                    $("#inp_type").change(function () {
                        var val = self.typeBox.getValue();
                        if(val==3||val==4){
                            $("#customer").show();
                        }else{
                            $("#customer").hide();
                        }
                        debugger
                    });
					function update(values) {
						var dataModel = $.DataModel.init();
						var url = "update";
						if (values.id == 0) {
							url = "create";
						}
						$.ajax({
							url: ctx + "/admin/user/" + url,
							async: false,
							method: "post",
							dataType: "json",
							data: {jsonData: JSON.stringify(values)},
							success: function (data) {
								if (data.status == 200) {
									parent.window.reloadMasterGrid(data.msg);
									parent.window.closeUserInfoDialog();
								} else {
									$.Notice.error(data.msg);
								}
							}
						});
//						dataModel.updateRemote(ctx+"/admin/user/"+url, {
//							data:{jsonData:JSON.stringify(values)},
//							success: function(data) {
//								if (data.status==200) {
//									parent.window.reloadMasterGrid(data.msg);
//									parent.window.closeUserInfoDialog();
//								} else {
//									$.Notice.error(data.msg);
//								}
//							}
//						});
					}
					$("#btn_cancel").click(function () {
						parent.window.closeUserInfoDialog();
					});
				}
			}
			pageInit();
		});
	})(jQuery, window)
</script>

File diff suppressed because it is too large
+ 1 - 0
patient-co-manage/redis-cache/src/main/webapp/static/develop/lib/plugin/echarts/2.2.7/js/chart/bar.js


File diff suppressed because it is too large
+ 1 - 0
patient-co-manage/redis-cache/src/main/webapp/static/develop/lib/plugin/echarts/2.2.7/js/chart/chord.js


File diff suppressed because it is too large
+ 1 - 0
patient-co-manage/redis-cache/src/main/webapp/static/develop/lib/plugin/echarts/2.2.7/js/chart/eventRiver.js


File diff suppressed because it is too large
+ 1 - 0
patient-co-manage/redis-cache/src/main/webapp/static/develop/lib/plugin/echarts/2.2.7/js/chart/force.js


File diff suppressed because it is too large
+ 1 - 0
patient-co-manage/redis-cache/src/main/webapp/static/develop/lib/plugin/echarts/2.2.7/js/chart/funnel.js


File diff suppressed because it is too large
+ 1 - 0
patient-co-manage/redis-cache/src/main/webapp/static/develop/lib/plugin/echarts/2.2.7/js/chart/gauge.js


File diff suppressed because it is too large
+ 1 - 0
patient-co-manage/redis-cache/src/main/webapp/static/develop/lib/plugin/echarts/2.2.7/js/chart/heatmap.js


File diff suppressed because it is too large
+ 1 - 0
patient-co-manage/redis-cache/src/main/webapp/static/develop/lib/plugin/echarts/2.2.7/js/chart/k.js


File diff suppressed because it is too large
+ 1 - 0
patient-co-manage/redis-cache/src/main/webapp/static/develop/lib/plugin/echarts/2.2.7/js/chart/line.js


File diff suppressed because it is too large
+ 13 - 0
patient-co-manage/redis-cache/src/main/webapp/static/develop/lib/plugin/echarts/2.2.7/js/chart/map.js


File diff suppressed because it is too large
+ 1 - 0
patient-co-manage/redis-cache/src/main/webapp/static/develop/lib/plugin/echarts/2.2.7/js/chart/pie.js


File diff suppressed because it is too large
+ 1 - 0
patient-co-manage/redis-cache/src/main/webapp/static/develop/lib/plugin/echarts/2.2.7/js/chart/radar.js


File diff suppressed because it is too large
+ 1 - 0
patient-co-manage/redis-cache/src/main/webapp/static/develop/lib/plugin/echarts/2.2.7/js/chart/scatter.js


File diff suppressed because it is too large
+ 1 - 0
patient-co-manage/redis-cache/src/main/webapp/static/develop/lib/plugin/echarts/2.2.7/js/chart/tree.js


File diff suppressed because it is too large
+ 1 - 0
patient-co-manage/redis-cache/src/main/webapp/static/develop/lib/plugin/echarts/2.2.7/js/chart/treemap.js


File diff suppressed because it is too large
+ 1 - 0
patient-co-manage/redis-cache/src/main/webapp/static/develop/lib/plugin/echarts/2.2.7/js/chart/venn.js


File diff suppressed because it is too large
+ 2 - 0
patient-co-manage/redis-cache/src/main/webapp/static/develop/lib/plugin/echarts/2.2.7/js/chart/wordCloud.js


File diff suppressed because it is too large
+ 35 - 0
patient-co-manage/redis-cache/src/main/webapp/static/develop/lib/plugin/echarts/2.2.7/js/echarts-all.js


File diff suppressed because it is too large
+ 20 - 0
patient-co-manage/redis-cache/src/main/webapp/static/develop/lib/plugin/echarts/2.2.7/js/echarts.js


+ 79 - 0
patient-co-manage/redis-cache/src/main/webapp/static/develop/lib/plugin/echarts/2.2.7/js/util/accMath.js

@ -0,0 +1,79 @@
/**
 * 高精度数学运算
 */
define(function() {
    // 除法函数,用来得到精确的除法结果 
    // 说明:javascript的除法结果会有误差,在两个浮点数相除的时候会比较明显。这个函数返回较为精确的除法结果。 
    // 调用:accDiv(arg1,arg2) 
    // 返回值:arg1除以arg2的精确结果
    function accDiv(arg1,arg2){
        var s1 = arg1.toString();
        var s2 = arg2.toString(); 
        var m = 0;
        try {
            m = s2.split('.')[1].length;
        }
        catch(e) {}
        try {
            m -= s1.split('.')[1].length;
        }
        catch(e) {}
        
        return (s1.replace('.', '') - 0) / (s2.replace('.', '') - 0) * Math.pow(10, m);
    }
    // 乘法函数,用来得到精确的乘法结果
    // 说明:javascript的乘法结果会有误差,在两个浮点数相乘的时候会比较明显。这个函数返回较为精确的乘法结果。 
    // 调用:accMul(arg1,arg2) 
    // 返回值:arg1乘以arg2的精确结果
    function accMul(arg1, arg2) {
        var s1 = arg1.toString();
        var s2 = arg2.toString();
        var m = 0;
        try {
            m += s1.split('.')[1].length;
        }
        catch(e) {}
        try {
            m += s2.split('.')[1].length;
        }
        catch(e) {}
        
        return (s1.replace('.', '') - 0) * (s2.replace('.', '') - 0) / Math.pow(10, m);
    }
    // 加法函数,用来得到精确的加法结果 
    // 说明:javascript的加法结果会有误差,在两个浮点数相加的时候会比较明显。这个函数返回较为精确的加法结果。 
    // 调用:accAdd(arg1,arg2) 
    // 返回值:arg1加上arg2的精确结果 
    function accAdd(arg1, arg2) {
        var r1 = 0;
        var r2 = 0;
        try {
            r1 = arg1.toString().split('.')[1].length;
        }
        catch(e) {}
        try {
            r2 = arg2.toString().split('.')[1].length;
        }
        catch(e) {}
        
        var m = Math.pow(10, Math.max(r1, r2));
        return (Math.round(arg1 * m) + Math.round(arg2 * m)) / m; 
    }
    //减法函数,用来得到精确的减法结果 
    //说明:javascript的减法结果会有误差,在两个浮点数减法的时候会比较明显。这个函数返回较为精确的减法结果。 
    //调用:accSub(arg1,arg2) 
    //返回值:arg1减法arg2的精确结果 
    function accSub(arg1,arg2) {
        return accAdd(arg1, -arg2);
    }
    return {
        accDiv : accDiv,
        accMul : accMul,
        accAdd : accAdd,
        accSub : accSub
    };
});

+ 40 - 0
patient-co-manage/redis-cache/src/main/webapp/static/develop/lib/plugin/echarts/2.2.7/js/util/coordinates.js

@ -0,0 +1,40 @@
/**
 * echarts坐标处理方法
 *
 * @author Neil (杨骥, 511415343@qq.com)
 */
define(
    function (require) {
        var zrMath = require('zrender/tool/math');
        /**
         * 极坐标转直角坐标
         *
         * @param {number} 半径
         * @param {number} 角度
         *
         * @return {Array.<number>} 直角坐标[x,y]
         */
        function polar2cartesian(r, theta) {
            return [r * zrMath.sin(theta), r*zrMath.cos(theta)];
        }
        /**
         * 直角坐标转极坐标
         *
         * @param {number} 横坐标
         * @param {number} 纵坐标
         *
         * @return {Array.<number>} 极坐标[r,theta]
         */
        function cartesian2polar(x, y) {
            return [Math.sqrt(x * x + y * y), Math.atan(y / x)];
        }
        return {
            polar2cartesian : polar2cartesian,
            cartesian2polar : cartesian2polar
        };
    }
);

+ 162 - 0
patient-co-manage/redis-cache/src/main/webapp/static/develop/lib/plugin/echarts/2.2.7/js/util/date.js

@ -0,0 +1,162 @@
/**
 * echarts日期运算格式化相关
 *
 * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。
 * @author Kener (@Kener-林峰, kener.linfeng@gmail.com)
 *
 */
define(function() {
    var _timeGap = [
        {formatter: 'hh : mm : ss', value: 1000},               // 1s
        {formatter: 'hh : mm : ss', value: 1000 * 5},           // 5s
        {formatter: 'hh : mm : ss', value: 1000 * 10},          // 10s
        {formatter: 'hh : mm : ss', value: 1000 * 15},          // 15s
        {formatter: 'hh : mm : ss', value: 1000 * 30},          // 30s
        {formatter: 'hh : mm\nMM - dd', value: 60000},          // 1m
        {formatter: 'hh : mm\nMM - dd', value: 60000 * 5},      // 5m
        {formatter: 'hh : mm\nMM - dd', value: 60000 * 10},     // 10m
        {formatter: 'hh : mm\nMM - dd', value: 60000 * 15},     // 15m
        {formatter: 'hh : mm\nMM - dd', value: 60000 * 30},     // 30m
        {formatter: 'hh : mm\nMM - dd', value: 3600000},        // 1h
        {formatter: 'hh : mm\nMM - dd', value: 3600000 * 2},    // 2h
        {formatter: 'hh : mm\nMM - dd', value: 3600000 * 6},    // 6h
        {formatter: 'hh : mm\nMM - dd', value: 3600000 * 12},   // 12h
        {formatter: 'MM - dd\nyyyy', value: 3600000 * 24},      // 1d
        {formatter: 'week', value: 3600000 * 24 * 7},           // 7d
        {formatter: 'month', value: 3600000 * 24 * 31},         // 1M
        {formatter: 'quarter', value: 3600000 * 24 * 380 / 4},  // 3M
        {formatter: 'half-year', value: 3600000 * 24 * 380 / 2},// 6M
        {formatter: 'year', value: 3600000 * 24 * 380}          // 1Y
    ];
    
    /**
     * 获取最佳formatter
     * @params {number} min 最小值
     * @params {number} max 最大值
     * @params {=number} splitNumber 分隔段数
     */
    function getAutoFormatter(min, max, splitNumber) {
        splitNumber = splitNumber > 1 ? splitNumber : 2;
        // 最优解
        var curValue;
        var totalGap;
        // 目标
        var formatter;
        var gapValue;
        for (var i = 0, l = _timeGap.length; i < l; i++) {
            curValue = _timeGap[i].value;
            totalGap = Math.ceil(max / curValue) * curValue 
                       - Math.floor(min / curValue) * curValue;
            if (Math.round(totalGap / curValue) <= splitNumber * 1.2) {
                formatter =  _timeGap[i].formatter;
                gapValue = _timeGap[i].value;
                // console.log(formatter, gapValue,i);
                break;
            }
        }
        
        if (formatter == null) {
            formatter = 'year';
            curValue = 3600000 * 24 * 367;
            totalGap = Math.ceil(max / curValue) * curValue 
                       - Math.floor(min / curValue) * curValue;
            gapValue = Math.round(totalGap / (splitNumber - 1) / curValue) * curValue;
        }
        
        return {
            formatter: formatter,
            gapValue: gapValue
        };
    }
    
    /**
     * 一位数字补0 
     */
    function s2d (v) {
        return v < 10 ? ('0' + v) : v;
    }
    
    /**
     * 百分比计算
     */
    function format(formatter, value) {
        if (formatter == 'week' 
            || formatter == 'month' 
            || formatter == 'quarter' 
            || formatter == 'half-year'
            || formatter == 'year'
        ) {
            formatter = 'MM - dd\nyyyy';
        }
            
        var date = getNewDate(value);
        var y = date.getFullYear();
        var M = date.getMonth() + 1;
        var d = date.getDate();
        var h = date.getHours();
        var m = date.getMinutes();
        var s = date.getSeconds();
        
        formatter = formatter.replace('MM', s2d(M));
        formatter = formatter.toLowerCase();
        formatter = formatter.replace('yyyy', y);
        formatter = formatter.replace('yy', y % 100);
        formatter = formatter.replace('dd', s2d(d));
        formatter = formatter.replace('d', d);
        formatter = formatter.replace('hh', s2d(h));
        formatter = formatter.replace('h', h);
        formatter = formatter.replace('mm', s2d(m));
        formatter = formatter.replace('m', m);
        formatter = formatter.replace('ss', s2d(s));
        formatter = formatter.replace('s', s);
        return formatter;
    }
    
    function nextMonday(value) {
        value = getNewDate(value);
        value.setDate(value.getDate() + 8 - value.getDay());
        return value;
    }
    
    function nextNthPerNmonth(value, nth, nmon) {
        value = getNewDate(value);
        value.setMonth(Math.ceil((value.getMonth() + 1) / nmon) * nmon);
        value.setDate(nth);
        return value;
    }
    
    function nextNthOnMonth(value, nth) {
        return nextNthPerNmonth(value, nth, 1);
    }
    
    function nextNthOnQuarterYear(value, nth) {
        return nextNthPerNmonth(value, nth, 3);
    }
    
    function nextNthOnHalfYear(value, nth) {
        return nextNthPerNmonth(value, nth, 6);
    }
    
    function nextNthOnYear(value, nth) {
        return nextNthPerNmonth(value, nth, 12);
    }
    
    function getNewDate(value) {
        return value instanceof Date
               ? value
               : new Date(typeof value == 'string' ? value.replace(/-/g, '/') : value);
    }
    
    return {
        getAutoFormatter: getAutoFormatter,
        getNewDate: getNewDate,
        format: format,
        nextMonday: nextMonday,
        nextNthPerNmonth: nextNthPerNmonth,
        nextNthOnMonth: nextNthOnMonth,
        nextNthOnQuarterYear: nextNthOnQuarterYear,
        nextNthOnHalfYear: nextNthOnHalfYear,
        nextNthOnYear : nextNthOnYear
    };
});

+ 624 - 0
patient-co-manage/redis-cache/src/main/webapp/static/develop/lib/plugin/echarts/2.2.7/js/util/ecAnimation.js

@ -0,0 +1,624 @@
/**
 * echarts图表动画基类
 *
 * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。
 * @author Kener (@Kener-林峰, kener.linfeng@gmail.com)
 *
 */
define(function (require) {
    var zrUtil = require('zrender/tool/util');
    var curveTool = require('zrender/tool/curve');
    
    /**
     * 折线型动画
     * 
     * @param {ZRender} zr
     * @param {shape} oldShape
     * @param {shape} newShape
     * @param {number} duration
     * @param {tring} easing
     */
    function pointList(zr, oldShape, newShape, duration, easing) {
        var newPointList = newShape.style.pointList;
        var newPointListLen = newPointList.length;
        var oldPointList;
        if (!oldShape) {        // add
            oldPointList = [];
            if (newShape._orient != 'vertical') {
                var y = newPointList[0][1];
                for (var i = 0; i < newPointListLen; i++) {
                    oldPointList[i] = [newPointList[i][0], y];
                }
            }
            else {
                var x = newPointList[0][0];
                for (var i = 0; i < newPointListLen; i++) {
                    oldPointList[i] = [x, newPointList[i][1]];
                }
            }
            if (newShape.type == 'half-smooth-polygon') {
                oldPointList[newPointListLen - 1] = zrUtil.clone(newPointList[newPointListLen - 1]);
                oldPointList[newPointListLen - 2] = zrUtil.clone(newPointList[newPointListLen - 2]);
            }
            oldShape = {style : {pointList : oldPointList}};
        }
        
        oldPointList = oldShape.style.pointList;
        var oldPointListLen = oldPointList.length;
        if (oldPointListLen == newPointListLen) {
            newShape.style.pointList = oldPointList;
        }
        else if (oldPointListLen < newPointListLen) {
            // 原来短,新的长,补全
            newShape.style.pointList = oldPointList.concat(newPointList.slice(oldPointListLen));
        }
        else {
            // 原来长,新的短,截断
            newShape.style.pointList = oldPointList.slice(0, newPointListLen);
        }
        zr.addShape(newShape);
        newShape.__animating = true;
        zr.animate(newShape.id, 'style')
            .when(
                duration,
                { pointList: newPointList }
            )
            .during(function () {
                // Updating bezier points
                if (newShape.updateControlPoints) {
                    newShape.updateControlPoints(newShape.style);
                }
            })
            .done(function() {
                newShape.__animating = false;
            })
            .start(easing);
    }
    
    /**
     * 复制样式
     * 
     * @inner
     * @param {Object} target 目标对象
     * @param {Object} source 源对象
     * @param {...string} props 复制的属性列表
     */
    function cloneStyle(target, source) {
        var len = arguments.length;
        for (var i = 2; i < len; i++) {
            var prop = arguments[i];
            target.style[prop] = source.style[prop];
        }
    }
    /**
     * 方型动画
     * 
     * @param {ZRender} zr
     * @param {shape} oldShape
     * @param {shape} newShape
     * @param {number} duration
     * @param {tring} easing
     */
    function rectangle(zr, oldShape, newShape, duration, easing) {
        var newShapeStyle = newShape.style;
        if (!oldShape) {        // add
            oldShape = {
                position : newShape.position,
                style : {
                    x : newShapeStyle.x,
                    y : newShape._orient == 'vertical'
                        ? newShapeStyle.y + newShapeStyle.height
                        : newShapeStyle.y,
                    width: newShape._orient == 'vertical' 
                           ? newShapeStyle.width : 0,
                    height: newShape._orient != 'vertical' 
                           ? newShapeStyle.height : 0
                }
            };
        }
        
        var newX = newShapeStyle.x;
        var newY = newShapeStyle.y;
        var newWidth = newShapeStyle.width;
        var newHeight = newShapeStyle.height;
        var newPosition = [newShape.position[0], newShape.position[1]];
        cloneStyle(
            newShape, oldShape,
            'x', 'y', 'width', 'height'
        );
        newShape.position = oldShape.position;
        zr.addShape(newShape);
        if (newPosition[0] != oldShape.position[0] || newPosition[1] != oldShape.position[1]) {
            zr.animate(newShape.id, '')
                .when(
                    duration,
                    {
                        position: newPosition
                    }
                )
                .start(easing);
        }
        
        newShape.__animating = true;
        zr.animate(newShape.id, 'style')
            .when(
                duration,
                {
                    x: newX,
                    y: newY,
                    width: newWidth,
                    height: newHeight
                }
            )
            .done(function() {
                newShape.__animating = false;
            })
            .start(easing);
    }
    
    /**
     * 蜡烛动画
     * 
     * @param {ZRender} zr
     * @param {shape} oldShape
     * @param {shape} newShape
     * @param {number} duration
     * @param {tring} easing
     */
    function candle(zr, oldShape, newShape, duration, easing) {
        if (!oldShape) {        // add
            var y = newShape.style.y;
            oldShape = {style : {y : [y[0], y[0], y[0], y[0]]}};
        }
        
        var newY = newShape.style.y;
        newShape.style.y = oldShape.style.y;
        zr.addShape(newShape);
        newShape.__animating = true;
        zr.animate(newShape.id, 'style')
            .when(
                duration,
                { y: newY }
            )
            .done(function() {
                newShape.__animating = false;
            })
            .start(easing);
    }
    /**
     * 环型动画
     * 
     * @param {ZRender} zr
     * @param {shape} oldShape
     * @param {shape} newShape
     * @param {number} duration
     * @param {tring} easing
     */
    function ring(zr, oldShape, newShape, duration, easing) {
        var x = newShape.style.x;
        var y = newShape.style.y;
        var r0 = newShape.style.r0;
        var r = newShape.style.r;
        
        newShape.__animating = true;
        if (newShape._animationAdd != 'r') {
            newShape.style.r0 = 0;
            newShape.style.r = 0;
            newShape.rotation = [Math.PI*2, x, y];
            
            zr.addShape(newShape);
            zr.animate(newShape.id, 'style')
                .when(
                    duration,
                    {
                        r0 : r0,
                        r : r
                    }
                )
                .done(function() {
                    newShape.__animating = false;
                })
                .start(easing);
            zr.animate(newShape.id, '')
                .when(
                    duration,
                    { rotation : [0, x, y] }
                )
                .start(easing);
        }
        else {
            newShape.style.r0 = newShape.style.r;
            
            zr.addShape(newShape);
            zr.animate(newShape.id, 'style')
                .when(
                    duration,
                    {
                        r0 : r0
                    }
                )
                .done(function() {
                    newShape.__animating = false;
                })
                .start(easing);
        }
    }
    
    /**
     * 扇形动画
     * 
     * @param {ZRender} zr
     * @param {shape} oldShape
     * @param {shape} newShape
     * @param {number} duration
     * @param {tring} easing
     */
    function sector(zr, oldShape, newShape, duration, easing) {
        if (!oldShape) {        // add
            if (newShape._animationAdd != 'r') {
                oldShape = {
                    style : {
                        startAngle : newShape.style.startAngle,
                        endAngle : newShape.style.startAngle
                    }
                };
            }
            else {
                oldShape = {style : {r0 : newShape.style.r}};
            }
        }
        
        var startAngle = newShape.style.startAngle;
        var endAngle = newShape.style.endAngle;
        
        cloneStyle(
            newShape, oldShape,
            'startAngle', 'endAngle'
        );
        
        zr.addShape(newShape);
        newShape.__animating = true;
        zr.animate(newShape.id, 'style')
            .when(
                duration,
                {
                    startAngle : startAngle,
                    endAngle : endAngle
                }
            )
            .done(function() {
                newShape.__animating = false;
            })
            .start(easing);
    }
    
    /**
     * 文本动画
     * 
     * @param {ZRender} zr
     * @param {shape} oldShape
     * @param {shape} newShape
     * @param {number} duration
     * @param {tring} easing
     */
    function text(zr, oldShape, newShape, duration, easing) {
        if (!oldShape) {        // add
            oldShape = {
                style : {
                    x : newShape.style.textAlign == 'left' 
                        ? newShape.style.x + 100
                        : newShape.style.x - 100,
                    y : newShape.style.y
                }
            };
        }
        
        var x = newShape.style.x;
        var y = newShape.style.y;
        
        cloneStyle(
            newShape, oldShape,
            'x', 'y'
        );
        
        zr.addShape(newShape);
        newShape.__animating = true;
        zr.animate(newShape.id, 'style')
            .when(
                duration,
                {
                    x : x,
                    y : y
                }
            )
            .done(function() {
                newShape.__animating = false;
            })
            .start(easing);
    }
    
    /**
     * 多边形动画
     * 
     * @param {ZRender} zr
     * @param {shape} oldShape
     * @param {shape} newShape
     * @param {number} duration
     * @param {tring} easing
     */
    function polygon(zr, oldShape, newShape, duration, easing) {
        var rect = require('zrender/shape/Polygon').prototype.getRect(newShape.style);
        var x = rect.x + rect.width / 2;
        var y = rect.y + rect.height / 2;
        
        newShape.scale = [0.1, 0.1, x, y];
        zr.addShape(newShape);
        newShape.__animating = true;
        zr.animate(newShape.id, '')
            .when(
                duration,
                {
                    scale : [1, 1, x, y]
                }
            )
            .done(function() {
                newShape.__animating = false;
            })
            .start(easing);
    }
    
    /**
     * 和弦动画
     * 
     * @param {ZRender} zr
     * @param {shape} oldShape
     * @param {shape} newShape
     * @param {number} duration
     * @param {tring} easing
     */
    function ribbon(zr, oldShape, newShape, duration, easing) {
        if (!oldShape) {        // add
            oldShape = {
                style : {
                    source0 : 0,
                    source1 : newShape.style.source1 > 0 ? 360 : -360,
                    target0 : 0,
                    target1 : newShape.style.target1 > 0 ? 360 : -360
                }
            };
        }
        
        var source0 = newShape.style.source0;
        var source1 = newShape.style.source1;
        var target0 = newShape.style.target0;
        var target1 = newShape.style.target1;
        
        if (oldShape.style) {
            cloneStyle(
                newShape, oldShape,
                'source0', 'source1', 'target0', 'target1'
            );
        }
        
        zr.addShape(newShape);
        newShape.__animating = true;
        zr.animate(newShape.id, 'style')
            .when(
                duration,
                {
                    source0 : source0,
                    source1 : source1,
                    target0 : target0,
                    target1 : target1
                }
            )
            .done(function() {
                newShape.__animating = false;
            })
            .start(easing);
    }
    
    /**
     * gaugePointer动画
     * 
     * @param {ZRender} zr
     * @param {shape} oldShape
     * @param {shape} newShape
     * @param {number} duration
     * @param {tring} easing
     */
    function gaugePointer(zr, oldShape, newShape, duration, easing) {
        if (!oldShape) {        // add
            oldShape = {
                style : {
                    angle : newShape.style.startAngle
                }
            };
        }
        
        var angle = newShape.style.angle;
        newShape.style.angle = oldShape.style.angle;
        zr.addShape(newShape);
        newShape.__animating = true;
        zr.animate(newShape.id, 'style')
            .when(
                duration,
                {
                    angle : angle
                }
            )
            .done(function() {
                newShape.__animating = false;
            })
            .start(easing);
    }
    
    /**
     * icon动画
     * 
     * @param {ZRender} zr
     * @param {shape} oldShape
     * @param {shape} newShape
     * @param {number} duration
     * @param {tring} easing
     */
    function icon(zr, oldShape, newShape, duration, easing, delay) {
        // 避免markPoint特效取值在动画帧上
        newShape.style._x = newShape.style.x;
        newShape.style._y = newShape.style.y;
        newShape.style._width = newShape.style.width;
        newShape.style._height = newShape.style.height;
        if (!oldShape) {    // add
            var x = newShape._x || 0;
            var y = newShape._y || 0;
            newShape.scale = [0.01, 0.01, x, y];
            zr.addShape(newShape);
            newShape.__animating = true;
            zr.animate(newShape.id, '')
                .delay(delay)
                .when(
                    duration,
                    {scale : [1, 1, x, y]}
                )
                .done(function() {
                    newShape.__animating = false;
                })
                .start(easing || 'QuinticOut');
        }
        else {              // mod
            rectangle(zr, oldShape, newShape, duration, easing);
        }
    }
    
    /**
     * line动画
     * 
     * @param {ZRender} zr
     * @param {shape} oldShape
     * @param {shape} newShape
     * @param {number} duration
     * @param {tring} easing
     */
    function line(zr, oldShape, newShape, duration, easing) {
        if (!oldShape) {
            oldShape = {
                style : {
                    xStart : newShape.style.xStart,
                    yStart : newShape.style.yStart,
                    xEnd : newShape.style.xStart,
                    yEnd : newShape.style.yStart
                }
            };
        }
        
        var xStart = newShape.style.xStart;
        var xEnd = newShape.style.xEnd;
        var yStart = newShape.style.yStart;
        var yEnd = newShape.style.yEnd;
        cloneStyle(
            newShape, oldShape,
            'xStart', 'xEnd', 'yStart', 'yEnd'
        );
        zr.addShape(newShape);
        newShape.__animating = true;
        zr.animate(newShape.id, 'style')
            .when(
                duration,
                {
                    xStart: xStart,
                    xEnd: xEnd,
                    yStart: yStart,
                    yEnd: yEnd
                }
            )
            .done(function() {
                newShape.__animating = false;
            })
            .start(easing);
    }
    
    /**
     * markline动画
     * 
     * @param {ZRender} zr
     * @param {shape} oldShape
     * @param {shape} newShape
     * @param {number} duration
     * @param {tring} easing
     */
    function markline(zr, oldShape, newShape, duration, easing) {
        easing = easing || 'QuinticOut';
        newShape.__animating = true;
        zr.addShape(newShape);
        var newShapeStyle = newShape.style;
        var animationDone = function () {
            newShape.__animating = false;
        };
        var x0 = newShapeStyle.xStart;
        var y0 = newShapeStyle.yStart;
        var x2 = newShapeStyle.xEnd;
        var y2 = newShapeStyle.yEnd;
        if (newShapeStyle.curveness > 0) {
            newShape.updatePoints(newShapeStyle);
            var obj = { p: 0 };
            var x1 = newShapeStyle.cpX1;
            var y1 = newShapeStyle.cpY1;
            var newXArr = [];
            var newYArr = [];
            var subdivide = curveTool.quadraticSubdivide;
            zr.animation.animate(obj)
                .when(duration, { p: 1 })
                .during(function () {
                    // Calculate subdivided curve
                    subdivide(x0, x1, x2, obj.p, newXArr);
                    subdivide(y0, y1, y2, obj.p, newYArr);
                    newShapeStyle.cpX1 = newXArr[1];
                    newShapeStyle.cpY1 = newYArr[1];
                    newShapeStyle.xEnd = newXArr[2];
                    newShapeStyle.yEnd = newYArr[2];
                    zr.modShape(newShape);
                })
                .done(animationDone)
                .start(easing);
        }
        else {
            zr.animate(newShape.id, 'style')
                .when(0, {
                    xEnd: x0,
                    yEnd: y0
                })
                .when(duration, {
                    xEnd: x2,
                    yEnd: y2
                })
                .done(animationDone)
                .start(easing);
        }
    }
    return {
        pointList : pointList,
        rectangle : rectangle,
        candle : candle,
        ring : ring,
        sector : sector,
        text : text,
        polygon : polygon,
        ribbon : ribbon,
        gaugePointer : gaugePointer,
        icon : icon,
        line : line,
        markline : markline
    };
});

+ 115 - 0
patient-co-manage/redis-cache/src/main/webapp/static/develop/lib/plugin/echarts/2.2.7/js/util/ecData.js

@ -0,0 +1,115 @@
/**
 * echarts通用私有数据服务
 *
 * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。
 * @author Kener (@Kener-林峰, kener.linfeng@gmail.com)
 *
 */
define(function() {
    /**
     * 打包私有数据
     *
     * @param {shape} shape 修改目标
     * @param {Object} series
     * @param {number} seriesIndex
     * @param {number | Object} data
     * @param {number} dataIndex
     * @param {*=} special
     * @param {*=} special2
     */
    function pack(
        shape, series, seriesIndex, data, dataIndex, name, special, special2
    ) {
        var value;
        if (typeof data != 'undefined') {
            value = data.value == null
                ? data
                : data.value;
        }
        shape._echartsData = {
            '_series' : series,
            '_seriesIndex' : seriesIndex,
            '_data' : data,
            '_dataIndex' : dataIndex,
            '_name' : name,
            '_value' : value,
            '_special' : special,
            '_special2' : special2
        };
        return shape._echartsData;
    }
    /**
     * 从私有数据中获取特定项
     * @param {shape} shape
     * @param {string} key
     */
    function get(shape, key) {
        var data = shape._echartsData;
        if (!key) {
            return data;
        }
        switch (key) {
            case 'series' :
            case 'seriesIndex' :
            case 'data' :
            case 'dataIndex' :
            case 'name' :
            case 'value' :
            case 'special' :
            case 'special2' :
                return data && data['_' + key];
        }
        return null;
    }
    /**
     * 修改私有数据中获取特定项
     * @param {shape} shape
     * @param {string} key
     * @param {*} value
     */
    function set(shape, key, value) {
        shape._echartsData = shape._echartsData || {};
        switch (key) {
            case 'series' :             // 当前系列值
            case 'seriesIndex' :        // 系列数组位置索引
            case 'data' :               // 当前数据值
            case 'dataIndex' :          // 数据数组位置索引
            case 'name' :
            case 'value' :
            case 'special' :
            case 'special2' :
                shape._echartsData['_' + key] = value;
                break;
        }
    }
    
    /**
     * 私有数据克隆,把source拷贝到target上
     * @param {shape} source 源
     * @param {shape} target 目标
     */
    function clone(source, target) {
        target._echartsData =  {
            '_series' : source._echartsData._series,
            '_seriesIndex' : source._echartsData._seriesIndex,
            '_data' : source._echartsData._data,
            '_dataIndex' : source._echartsData._dataIndex,
            '_name' : source._echartsData._name,
            '_value' : source._echartsData._value,
            '_special' : source._echartsData._special,
            '_special2' : source._echartsData._special2
        };
    }
    return {
        pack : pack,
        set : set,
        get : get,
        clone : clone
    };
});

+ 444 - 0
patient-co-manage/redis-cache/src/main/webapp/static/develop/lib/plugin/echarts/2.2.7/js/util/ecEffect.js

@ -0,0 +1,444 @@
/**
 * echarts图表特效基类
 *
 * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。
 * @author Kener (@Kener-林峰, kener.linfeng@gmail.com)
 *
 */
define(function (require) {
    var ecData = require('../util/ecData');
    
    var CircleShape = require('zrender/shape/Circle');
    var ImageShape = require('zrender/shape/Image');
    var curveTool = require('zrender/tool/curve');
    var IconShape = require('../util/shape/Icon');
    var SymbolShape = require('../util/shape/Symbol');
    var ShapeBundle = require('zrender/shape/ShapeBundle');
    var Polyline = require('zrender/shape/Polyline');
    var vec2 = require('zrender/tool/vector');
    var canvasSupported = require('zrender/tool/env').canvasSupported;
    
    function point(zr, effectList, shape, zlevel) {
        var effect = shape.effect;
        var color = effect.color || shape.style.strokeColor || shape.style.color;
        var shadowColor = effect.shadowColor || color;
        var size = effect.scaleSize;
        var distance = effect.bounceDistance;
        var shadowBlur = typeof effect.shadowBlur != 'undefined'
                         ? effect.shadowBlur : size;
        var effectShape;
        if (shape.type !== 'image') {
            effectShape = new IconShape({
                zlevel : zlevel,
                style : {
                    brushType : 'stroke',
                    iconType : shape.style.iconType != 'droplet'
                               ? shape.style.iconType
                               : 'circle',
                    x : shadowBlur + 1, // 线宽
                    y : shadowBlur + 1,
                    n : shape.style.n,
                    width : shape.style._width * size,
                    height : shape.style._height * size,
                    lineWidth : 1,
                    strokeColor : color,
                    shadowColor : shadowColor,
                    shadowBlur : shadowBlur
                },
                draggable : false,
                hoverable : false
            });
            if (shape.style.iconType == 'pin') {
                effectShape.style.y += effectShape.style.height / 2 * 1.5;
            }
            if (canvasSupported) {  // 提高性能,换成image
                effectShape.style.image = zr.shapeToImage(
                    effectShape, 
                    effectShape.style.width + shadowBlur * 2 + 2, 
                    effectShape.style.height + shadowBlur * 2 + 2
                ).style.image;
                
                effectShape = new ImageShape({
                    zlevel : effectShape.zlevel,
                    style : effectShape.style,
                    draggable : false,
                    hoverable : false
                });
            }
        }
        else {
            effectShape = new ImageShape({
                zlevel : zlevel,
                style : shape.style,
                draggable : false,
                hoverable : false
            });
        }
        
        ecData.clone(shape, effectShape);
        
        // 改变坐标,不能移到前面
        effectShape.position = shape.position;
        effectList.push(effectShape);
        zr.addShape(effectShape);
        
        var devicePixelRatio = shape.type !== 'image' ? (window.devicePixelRatio || 1) : 1;
        var offset = (effectShape.style.width / devicePixelRatio - shape.style._width) / 2;
        effectShape.style.x = shape.style._x - offset;
        effectShape.style.y = shape.style._y - offset;
        if (shape.style.iconType == 'pin') {
            effectShape.style.y -= shape.style.height / 2 * 1.5;
        }
        var duration = (effect.period + Math.random() * 10) * 100;
        
        zr.modShape(
            shape.id, 
            { invisible : true}
        );
        
        var centerX = effectShape.style.x + (effectShape.style.width) / 2 / devicePixelRatio;
        var centerY = effectShape.style.y + (effectShape.style.height) / 2 / devicePixelRatio;
        if (effect.type === 'scale') {
            // 放大效果
            zr.modShape(
                effectShape.id, 
                {
                    scale : [0.1, 0.1, centerX, centerY]
                }
            );
            
            zr.animate(effectShape.id, '', effect.loop)
                .when(
                    duration,
                    {
                        scale : [1, 1, centerX, centerY]
                    }
                )
                .done(function() {
                    shape.effect.show = false;
                    zr.delShape(effectShape.id);
                })
                .start();
        }
        else {
            zr.animate(effectShape.id, 'style', effect.loop)
                .when(
                    duration,
                    {
                        y : effectShape.style.y - distance
                    }
                )
                .when(
                    duration * 2,
                    {
                        y : effectShape.style.y
                    }
                )
                .done(function() {
                    shape.effect.show = false;
                    zr.delShape(effectShape.id);
                })
                .start();
        }
        
    }
    
    function largePoint(zr, effectList, shape, zlevel) {
        var effect = shape.effect;
        var color = effect.color || shape.style.strokeColor || shape.style.color;
        var size = effect.scaleSize;
        var shadowColor = effect.shadowColor || color;
        var shadowBlur = typeof effect.shadowBlur != 'undefined'
                         ? effect.shadowBlur : (size * 2);
        var devicePixelRatio = window.devicePixelRatio || 1;
        var effectShape = new SymbolShape({
            zlevel : zlevel,
            position : shape.position,
            scale : shape.scale,
            style : {
                pointList : shape.style.pointList,
                iconType : shape.style.iconType,
                color : color,
                strokeColor : color,
                shadowColor : shadowColor,
                shadowBlur : shadowBlur * devicePixelRatio,
                random : true,
                brushType: 'fill',
                lineWidth:1,
                size : shape.style.size
            },
            draggable : false,
            hoverable : false
        });
        
        effectList.push(effectShape);
        zr.addShape(effectShape);
        zr.modShape(
            shape.id, 
            { invisible : true}
        );
        
        var duration = Math.round(effect.period * 100);
        var clip1 = {};
        var clip2 = {};
        for (var i = 0; i < 20; i++) {
            effectShape.style['randomMap' + i] = 0;
            clip1 = {};
            clip1['randomMap' + i] = 100;
            clip2 = {};
            clip2['randomMap' + i] = 0;
            effectShape.style['randomMap' + i] = Math.random() * 100;
            zr.animate(effectShape.id, 'style', true)
                .when(duration, clip1)
                .when(duration * 2, clip2)
                .when(duration * 3, clip1)
                .when(duration * 4, clip1)
                .delay(Math.random() * duration * i)
                //.delay(duration / 15 * (15 - i + 1))
                .start();
            
        }
    }
    
    function line(zr, effectList, shape, zlevel, isLarge) {
        var effect = shape.effect;
        var shapeStyle = shape.style;
        var color = effect.color || shapeStyle.strokeColor || shapeStyle.color;
        var shadowColor = effect.shadowColor || shapeStyle.strokeColor || color;
        var size = shapeStyle.lineWidth * effect.scaleSize;
        var shadowBlur = typeof effect.shadowBlur != 'undefined'
                         ? effect.shadowBlur : size;
        var effectShape = new CircleShape({
            zlevel : zlevel,
            style : {
                x : shadowBlur,
                y : shadowBlur,
                r : size,
                color : color,
                shadowColor : shadowColor,
                shadowBlur : shadowBlur
            },
            hoverable : false
        });
        var offset = 0;
        if (canvasSupported && ! isLarge) {  // 提高性能,换成image
            var zlevel = effectShape.zlevel;
            effectShape = zr.shapeToImage(
                effectShape,
                (size + shadowBlur) * 2,
                (size + shadowBlur) * 2
            );
            effectShape.zlevel = zlevel;
            effectShape.hoverable = false;
            offset = shadowBlur;
        }
        if (! isLarge) {
            ecData.clone(shape, effectShape);
            // 改变坐标, 不能移到前面
            effectShape.position = shape.position;
            effectList.push(effectShape);
            zr.addShape(effectShape);
        }
        var effectDone = function () {
            if (! isLarge) {
                shape.effect.show = false;
                zr.delShape(effectShape.id);   
            }
            effectShape.effectAnimator = null;
        };
        if (shape instanceof Polyline) {
            var distanceList = [0];
            var totalDist = 0;
            var pointList = shapeStyle.pointList;
            var controlPointList = shapeStyle.controlPointList;
            for (var i = 1; i < pointList.length; i++) {
                if (controlPointList) {
                    var cp1 = controlPointList[(i - 1) * 2];
                    var cp2 = controlPointList[(i - 1) * 2 + 1];
                    totalDist += vec2.dist(pointList[i - 1], cp1)
                         + vec2.dist(cp1, cp2)
                         + vec2.dist(cp2, pointList[i]);
                }
                else {
                    totalDist += vec2.dist(pointList[i - 1], pointList[i]);
                }
                distanceList.push(totalDist);
            }
            var obj = { p: 0 };
            var animator = zr.animation.animate(obj, { loop: effect.loop });
            for (var i = 0; i < distanceList.length; i++) {
                animator.when(distanceList[i] * effect.period, { p: i });
            }
            animator.during(function () {
                var i = Math.floor(obj.p);
                var x, y;
                if (i == pointList.length - 1) {
                    x = pointList[i][0];
                    y = pointList[i][1];
                }
                else {
                    var t = obj.p - i;
                    var p0 = pointList[i];
                    var p1 = pointList[i + 1];
                    if (controlPointList) {
                        var cp1 = controlPointList[i * 2];
                        var cp2 = controlPointList[i * 2 + 1];
                        x = curveTool.cubicAt(
                            p0[0], cp1[0], cp2[0], p1[0], t
                        );
                        y = curveTool.cubicAt(
                            p0[1], cp1[1], cp2[1], p1[1], t
                        );
                    }
                    else {
                        x = (p1[0] - p0[0]) * t + p0[0];
                        y = (p1[1] - p0[1]) * t + p0[1];   
                    }
                }
                effectShape.style.x = x;
                effectShape.style.y = y;
                if (! isLarge) {
                    zr.modShape(effectShape);
                }
            })
            .done(effectDone)
            .start();
            animator.duration = totalDist * effect.period;
            effectShape.effectAnimator = animator;
        }
        else {
            var x0 = shapeStyle.xStart - offset;
            var y0 = shapeStyle.yStart - offset;
            var x2 = shapeStyle.xEnd - offset;
            var y2 = shapeStyle.yEnd - offset;
            effectShape.style.x = x0;
            effectShape.style.y = y0;
            var distance = (x2 - x0) * (x2 - x0) + (y2 - y0) * (y2 - y0);
            var duration = Math.round(Math.sqrt(Math.round(
                distance * effect.period * effect.period
            )));
            if (shape.style.curveness > 0) {
                var x1 = shapeStyle.cpX1 - offset;
                var y1 = shapeStyle.cpY1 - offset;
                effectShape.effectAnimator = zr.animation.animate(effectShape, { loop: effect.loop })
                    .when(duration, { p: 1 })
                    .during(function (target, t) {
                        effectShape.style.x = curveTool.quadraticAt(
                            x0, x1, x2, t
                        );
                        effectShape.style.y = curveTool.quadraticAt(
                            y0, y1, y2, t
                        );
                        if (! isLarge) {
                            zr.modShape(effectShape);
                        }
                    })
                    .done(effectDone)
                    .start();
            }
            else {
                // 不用 zr.animate,因为在用 ShapeBundle 的时候单个 effectShape 不会
                // 被加到 zrender 中
                effectShape.effectAnimator = zr.animation.animate(effectShape.style, { loop: effect.loop })
                    .when(duration, {
                        x: x2,
                        y: y2
                    })
                    .during(function () {
                        if (! isLarge) {
                            zr.modShape(effectShape);
                        }
                    })
                    .done(effectDone)
                    .start();
            }
            effectShape.effectAnimator.duration = duration;
        }
        return effectShape;
    }
    function largeLine(zr, effectList, shape, zlevel) {
        var effectShape = new ShapeBundle({
            style: {
                shapeList: []
            },
            zlevel: zlevel,
            hoverable: false
        });
        var shapeList = shape.style.shapeList;
        var effect = shape.effect;
        effectShape.position = shape.position;
        var maxDuration = 0;
        var subEffectAnimators = [];
        for (var i = 0; i < shapeList.length; i++) {
            shapeList[i].effect = effect;
            var subEffectShape = line(zr, null, shapeList[i], zlevel, true);
            var subEffectAnimator = subEffectShape.effectAnimator;
            effectShape.style.shapeList.push(subEffectShape);
            if (subEffectAnimator.duration > maxDuration) {
                maxDuration = subEffectAnimator.duration;
            }
            if (i === 0) {
                effectShape.style.color = subEffectShape.style.color;
                effectShape.style.shadowBlur = subEffectShape.style.shadowBlur;
                effectShape.style.shadowColor = subEffectShape.style.shadowColor;
            }
            subEffectAnimators.push(subEffectAnimator);
        }
        effectList.push(effectShape);
        zr.addShape(effectShape);
        var clearAllAnimators = function () {
            for (var i = 0; i < subEffectAnimators.length; i++) {
                subEffectAnimators[i].stop();
            }
        };
        if (maxDuration) {
            effectShape.__dummy = 0;
            // Proxy animator
            var animator = zr.animate(effectShape.id, '', effect.loop)
                .when(maxDuration, {
                    __dummy: 1
                })
                .during(function () {
                    zr.modShape(effectShape);
                })
                .done(function () {
                    shape.effect.show = false;
                    zr.delShape(effectShape.id);
                })
                .start();
            var oldStop = animator.stop;
            animator.stop = function () {
                clearAllAnimators();
                oldStop.call(this);
            };
        }
    }
    return {
        point : point,
        largePoint : largePoint,
        line : line,
        largeLine: largeLine
    };
});

+ 81 - 0
patient-co-manage/redis-cache/src/main/webapp/static/develop/lib/plugin/echarts/2.2.7/js/util/ecQuery.js

@ -0,0 +1,81 @@
/**
 * echarts层级查找方法
 *
 * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。
 * @author Kener (@Kener-林峰, kener.linfeng@gmail.com)
 *
 */
define(function(require) {
    var zrUtil = require('zrender/tool/util');
    
    /**
     * 获取嵌套选项的基础方法
     * 返回optionTarget中位于optionLocation上的值,如果没有定义,则返回undefined
     */
    function query(optionTarget, optionLocation) {
        if (typeof optionTarget == 'undefined') {
            return;
        }
        if (!optionLocation) {
            return optionTarget;
        }
        optionLocation = optionLocation.split('.');
        var length = optionLocation.length;
        var curIdx = 0;
        while (curIdx < length) {
            optionTarget = optionTarget[optionLocation[curIdx]];
            if (typeof optionTarget == 'undefined') {
                return;
            }
            curIdx++;
        }
        return optionTarget;
    }
        
    /**
     * 获取多级控制嵌套属性的基础方法
     * 返回ctrList中优先级最高(最靠前)的非undefined属性,ctrList中均无定义则返回undefined
     */
    function deepQuery(ctrList, optionLocation) {
        var finalOption;
        for (var i = 0, l = ctrList.length; i < l; i++) {
            finalOption = query(ctrList[i], optionLocation);
            if (typeof finalOption != 'undefined') {
                return finalOption;
            }
        }
    }
    
    /**
     * 获取多级控制嵌套属性的基础方法
     * 根据ctrList中优先级合并产出目标属性
     */
    function deepMerge(ctrList, optionLocation) {
        var finalOption;
        var len = ctrList.length;
        while (len--) {
            var tempOption = query(ctrList[len], optionLocation);
            if (typeof tempOption != 'undefined') {
                if (typeof finalOption == 'undefined') {
                    finalOption = zrUtil.clone(tempOption);
                }
                else {
                    zrUtil.merge(
                        finalOption, tempOption, true
                    );
                }
            }
        }
        
        return finalOption;
    }
    
    return {
        query : query,
        deepQuery : deepQuery,
        deepMerge : deepMerge
    };
});

+ 48 - 0
patient-co-manage/redis-cache/src/main/webapp/static/develop/lib/plugin/echarts/2.2.7/js/util/kwargs.js

@ -0,0 +1,48 @@
define(function (){
    function kwargs(func, defaults) {
        /*jshint maxlen : 200*/
        var removeComments = new RegExp('(\\/\\*[\\w\\\'\\,\\(\\)\\s\\r\\n\\*]*\\*\\/)|(\\/\\/[\\w\\s\\\'][^\\n\\r]*$)|(<![\\-\\-\\s\\w\\>\\/]*>)', 'gim');
        var removeWhitespc = new RegExp('\\s+', 'gim');
        var matchSignature = new RegExp('function.*?\\((.*?)\\)', 'i');
        // get the argument names from function source
        var names = func.toString()
                        .replace(removeComments, '')
                        .replace(removeWhitespc, '')
                        .match(matchSignature)[1]
                        .split(',');
        // Check the existance of default, if not create an object
        if(defaults !== Object(defaults)){
            defaults = {};
        }
        return function () {
            var args = Array.prototype.slice.call(arguments);
            var kwargs = args[args.length - 1];
            // Check the existance of the kwargs
            if (kwargs && kwargs.constructor === Object) {
                args.pop();
            }
            else{
                kwargs = {};
            }
            // Fill the arguments and apply them
            for (var i = 0; i < names.length; i++) {
                var name = names[i];
                if (name in kwargs) {
                    args[i] = kwargs[name];
                }
                else if(name in defaults && args[i] == null){
                    args[i] = defaults[name];
                }
            }
            return func.apply(this, args);
        };
    }
    // As function prototype
    // Function.prototype.kwargs = kwargs;
    return kwargs;
});

+ 9 - 0
patient-co-manage/redis-cache/src/main/webapp/static/develop/lib/plugin/echarts/2.2.7/js/util/mapData/geoCoord.js

@ -0,0 +1,9 @@
/**
 * 经纬度坐标,优先于自定计算
 */
define(function() {
    return {
        'Russia': [ 100, 60 ],
        'United States of America': [ -99, 38 ]
    };
});

File diff suppressed because it is too large
+ 3 - 0
patient-co-manage/redis-cache/src/main/webapp/static/develop/lib/plugin/echarts/2.2.7/js/util/mapData/geoJson/an_hui_geo.js


+ 3 - 0
patient-co-manage/redis-cache/src/main/webapp/static/develop/lib/plugin/echarts/2.2.7/js/util/mapData/geoJson/ao_men_geo.js

@ -0,0 +1,3 @@
define(function() {
    return {"type":"FeatureCollection","features":[{"type":"Feature","id":"8200","properties":{"name":"澳门","cp":[113.5715,22.1583],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@HQFMDIDGBI@E@EEKEGCEIGGEKEMGSEU@CBEDAJAP@F@LBT@JCHMPOdADCFADAB@LFLDFFP@DAB@@AF@D@B@@FBD@FADHBBHAD@FAJ@JEDCJI`gFIJW"],"encodeOffsets":[[116325,22699]]}}],"UTF8Encoding":true};
});

File diff suppressed because it is too large
+ 3 - 0
patient-co-manage/redis-cache/src/main/webapp/static/develop/lib/plugin/echarts/2.2.7/js/util/mapData/geoJson/bei_jing_geo.js


File diff suppressed because it is too large
+ 3 - 0
patient-co-manage/redis-cache/src/main/webapp/static/develop/lib/plugin/echarts/2.2.7/js/util/mapData/geoJson/china_geo.js


File diff suppressed because it is too large
+ 3 - 0
patient-co-manage/redis-cache/src/main/webapp/static/develop/lib/plugin/echarts/2.2.7/js/util/mapData/geoJson/chong_qing_geo.js


File diff suppressed because it is too large
+ 3 - 0
patient-co-manage/redis-cache/src/main/webapp/static/develop/lib/plugin/echarts/2.2.7/js/util/mapData/geoJson/fu_jian_geo.js


File diff suppressed because it is too large
+ 3 - 0
patient-co-manage/redis-cache/src/main/webapp/static/develop/lib/plugin/echarts/2.2.7/js/util/mapData/geoJson/gan_su_geo.js


File diff suppressed because it is too large
+ 3 - 0
patient-co-manage/redis-cache/src/main/webapp/static/develop/lib/plugin/echarts/2.2.7/js/util/mapData/geoJson/guang_dong_geo.js


File diff suppressed because it is too large
+ 3 - 0
patient-co-manage/redis-cache/src/main/webapp/static/develop/lib/plugin/echarts/2.2.7/js/util/mapData/geoJson/guang_xi_geo.js


File diff suppressed because it is too large
+ 3 - 0
patient-co-manage/redis-cache/src/main/webapp/static/develop/lib/plugin/echarts/2.2.7/js/util/mapData/geoJson/gui_zhou_geo.js


File diff suppressed because it is too large
+ 3 - 0
patient-co-manage/redis-cache/src/main/webapp/static/develop/lib/plugin/echarts/2.2.7/js/util/mapData/geoJson/hai_nan_geo.js


File diff suppressed because it is too large
+ 3 - 0
patient-co-manage/redis-cache/src/main/webapp/static/develop/lib/plugin/echarts/2.2.7/js/util/mapData/geoJson/he_bei_geo.js


File diff suppressed because it is too large
+ 3 - 0
patient-co-manage/redis-cache/src/main/webapp/static/develop/lib/plugin/echarts/2.2.7/js/util/mapData/geoJson/he_nan_geo.js


File diff suppressed because it is too large
+ 3 - 0
patient-co-manage/redis-cache/src/main/webapp/static/develop/lib/plugin/echarts/2.2.7/js/util/mapData/geoJson/hei_long_jiang_geo.js


File diff suppressed because it is too large
+ 3 - 0
patient-co-manage/redis-cache/src/main/webapp/static/develop/lib/plugin/echarts/2.2.7/js/util/mapData/geoJson/hu_bei_geo.js


File diff suppressed because it is too large
+ 3 - 0
patient-co-manage/redis-cache/src/main/webapp/static/develop/lib/plugin/echarts/2.2.7/js/util/mapData/geoJson/hu_nan_geo.js


File diff suppressed because it is too large
+ 3 - 0
patient-co-manage/redis-cache/src/main/webapp/static/develop/lib/plugin/echarts/2.2.7/js/util/mapData/geoJson/ji_lin_geo.js


File diff suppressed because it is too large
+ 3 - 0
patient-co-manage/redis-cache/src/main/webapp/static/develop/lib/plugin/echarts/2.2.7/js/util/mapData/geoJson/jiang_su_geo.js


File diff suppressed because it is too large
+ 3 - 0
patient-co-manage/redis-cache/src/main/webapp/static/develop/lib/plugin/echarts/2.2.7/js/util/mapData/geoJson/jiang_xi_geo.js


File diff suppressed because it is too large
+ 3 - 0
patient-co-manage/redis-cache/src/main/webapp/static/develop/lib/plugin/echarts/2.2.7/js/util/mapData/geoJson/liao_ning_geo.js


File diff suppressed because it is too large
+ 3 - 0
patient-co-manage/redis-cache/src/main/webapp/static/develop/lib/plugin/echarts/2.2.7/js/util/mapData/geoJson/nei_meng_gu_geo.js


File diff suppressed because it is too large
+ 3 - 0
patient-co-manage/redis-cache/src/main/webapp/static/develop/lib/plugin/echarts/2.2.7/js/util/mapData/geoJson/ning_xia_geo.js


File diff suppressed because it is too large
+ 3 - 0
patient-co-manage/redis-cache/src/main/webapp/static/develop/lib/plugin/echarts/2.2.7/js/util/mapData/geoJson/qing_hai_geo.js


File diff suppressed because it is too large
+ 3 - 0
patient-co-manage/redis-cache/src/main/webapp/static/develop/lib/plugin/echarts/2.2.7/js/util/mapData/geoJson/shan_dong_geo.js


File diff suppressed because it is too large
+ 3 - 0
patient-co-manage/redis-cache/src/main/webapp/static/develop/lib/plugin/echarts/2.2.7/js/util/mapData/geoJson/shan_xi_1_geo.js


File diff suppressed because it is too large
+ 3 - 0
patient-co-manage/redis-cache/src/main/webapp/static/develop/lib/plugin/echarts/2.2.7/js/util/mapData/geoJson/shan_xi_2_geo.js


+ 0 - 0
patient-co-manage/redis-cache/src/main/webapp/static/develop/lib/plugin/echarts/2.2.7/js/util/mapData/geoJson/shang_hai_geo.js


Some files were not shown because too many files changed in this diff