Commit 73a52ae510f97a87f737c98e887f7c88c3c8a568

Authored by fangcheng
1 parent 022a937a5b
Exists in master

修改项目结构

Showing 22 changed files with 250 additions and 1155 deletions

base.common/pom.xml View file @ 73a52ae
1 1 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2 2 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3 3 <modelVersion>4.0.0</modelVersion>
  4 + <parent>
  5 + <groupId>com.lyms</groupId>
  6 + <artifactId>parent</artifactId>
  7 + <version>0.0.1-SNAPSHOT</version>
  8 + </parent>
4 9 <groupId>com.lyms.base.common</groupId>
5 10 <artifactId>base.common</artifactId>
6   - <version>0.0.1-SNAPSHOT</version>
7 11  
8 12 <properties>
9 13 <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
10 14 <java.version>1.7</java.version>
11   - <mybatis-plus.version>2.0.1</mybatis-plus.version>
12 15 </properties>
13 16  
14 17 <dependencies>
15 18 <dependency>
16   - <groupId>com.baomidou</groupId>
17   - <artifactId>mybatis-plus</artifactId>
18   - <version>${mybatis-plus.version}</version>
  19 + <groupId>com.lyms</groupId>
  20 + <artifactId>core.sdk</artifactId>
  21 + <version>${project.parent.version}</version>
19 22 </dependency>
20 23 </dependencies>
21 24  
center.manager/pom.xml View file @ 73a52ae
... ... @@ -2,7 +2,7 @@
2 2 <modelVersion>4.0.0</modelVersion>
3 3 <parent>
4 4 <groupId>com.lyms</groupId>
5   - <artifactId>center.parent</artifactId>
  5 + <artifactId>parent</artifactId>
6 6 <version>0.0.1-SNAPSHOT</version>
7 7 </parent>
8 8 <artifactId>center.manager</artifactId>
center.manager/src/main/java/com/lyms/cm/controller/sys/SysOrganGroupController.java View file @ 73a52ae
1 1 package com.lyms.cm.controller.sys;
2 2  
  3 +import java.util.List;
3 4 import java.util.Map;
4 5  
  6 +import org.apache.commons.lang3.StringUtils;
5 7 import org.springframework.beans.factory.annotation.Autowired;
6 8 import org.springframework.stereotype.Controller;
  9 +import org.springframework.ui.Model;
  10 +import org.springframework.web.bind.annotation.PathVariable;
7 11 import org.springframework.web.bind.annotation.RequestMapping;
8 12 import org.springframework.web.bind.annotation.RequestMethod;
9 13 import org.springframework.web.bind.annotation.ResponseBody;
... ... @@ -11,6 +15,9 @@
11 15 import com.baomidou.mybatisplus.mapper.EntityWrapper;
12 16 import com.baomidou.mybatisplus.plugins.Page;
13 17 import com.lyms.cm.entity.sys.SysOrganGroup;
  18 +import com.lyms.cm.entity.sys.SysRoles;
  19 +import com.lyms.cm.entity.sys.SysUserRoleMaps;
  20 +import com.lyms.cm.entity.sys.SysUsers;
14 21 import com.lyms.cm.enums.ValidityEnum;
15 22 import com.lyms.cm.service.sys.SysOrganGroupService;
16 23 import com.lyms.web.controller.BaseController;
... ... @@ -62,6 +69,22 @@
62 69 page = groupService.selectPage(page, ew);
63 70 return toGridData(page);
64 71 }
  72 +
  73 +
  74 + /**
  75 + * 跳转到编辑页面
  76 + *
  77 + * @return
  78 + */
  79 + @RequestMapping(value = { "/{id}/toEdit" }, method = RequestMethod.GET)
  80 + public String toEdit(@PathVariable String id, Model model) {
  81 + if (!StringUtils.isBlank(id)) {
  82 + SysOrganGroup group = groupService.selectById(id);
  83 + model.addAttribute("group", group);
  84 +
  85 + }
  86 + return "/group/group_edit";
  87 + }
65 88  
66 89 }
center.manager/src/main/webapp/WEB-INF/views/group/group_edit.html View file @ 73a52ae
  1 +#override("body")
  2 +<div class="ibox float-e-margins">
  3 + <div class="ibox-content">
  4 + <div class="col-sm-4">
  5 + <form id="validForm" class="form-horizontal m-t" novalidate="novalidate">
  6 + <input type="hidden" id="group.id" name="id" value="$!group.id"/>
  7 + <div class="form-group">
  8 + <label class="col-sm-3 control-label">组名称:</label>
  9 + <div class="col-sm-8">
  10 + <input type="text" placeholder="机构名称" value="$!group.name" aria-required="true" required="true" class="form-control" minlength="2" name="name" id="name">
  11 + </div>
  12 + </div>
  13 + <div class="form-group">
  14 + <label class="col-sm-3 control-label">建档类型:</label>
  15 + <div class="col-sm-8">
  16 + <select class="form-control" name="type">
  17 + <option value="1" #if($!group.type==1) selected="selected" #end>1</option>
  18 + <option value="2" #if($!group.type==2) selected="selected" #end>2</option>
  19 + <option value="3" #if($!group.type==3) selected="selected" #end>3</option>
  20 + </select>
  21 + <!-- <input type="text" placeholder="类型" aria-required="true" required="true" minlength="3" name="type" class="form-control" id="type"> -->
  22 + </div>
  23 + </div>
  24 +
  25 + <div class="form-group">
  26 + <label class="col-sm-3 control-label">连接地址:</label>
  27 + <div class="col-sm-8">
  28 + <input type="text" value="$!group.clientaddress" placeholder="连接地址" aria-required="true" required="true" minlength="3" name="clientaddress" class="form-control" id="shortCode">
  29 + </div>
  30 + </div>
  31 +
  32 + <div class="hr-line-dashed"></div>
  33 + <div class="form-group">
  34 + <div class="col-sm-4 col-sm-offset-3 pull-right">
  35 + <button type="button" class="btn btn-primary" onclick="save();"><i class="fa fa-check"></i>&nbsp;提交</button>
  36 + <button type="button" class="btn btn-white" onclick="parent.closeAll();"><i class="fa fa-close"></i>&nbsp;取消</button>
  37 + </div>
  38 + </div>
  39 + </form>
  40 + </div>
  41 + <!-- 机构组拥有机构 -->
  42 + <div class="col-sm-8">
  43 + <table id="dataTable"></table>
  44 + </div>
  45 + </div>
  46 +</div>
  47 +<script type="text/javascript">
  48 +function save(){
  49 + if($('#validForm').valid()){
  50 + var data = $('#validForm').serialize();
  51 + //console.log(data);
  52 + if("$!group.id" == ""){
  53 + ajaxPost(APP.PATH + "/sysOrganGroup/create",data);
  54 + }else{
  55 + ajaxPost(APP.PATH + "/sysOrganGroup/update",data);
  56 + }
  57 + parent.reloadGrid('dataTable');
  58 + }
  59 +}
  60 +
  61 +var controllerRequestMappint = "/sysOrganizations/";
  62 +
  63 +## 参考 base_table_init.js 或者根据empty_bootstrap_table_init.js 来自己创建特殊的table
  64 +## 注意:自己创建的特殊的table不能extends base_list.html
  65 +var default_dataUrl = APP.PATH + controllerRequestMappint + "list";
  66 +var default_dataColumns = [{
  67 + field: 'check_state',
  68 + title: '',
  69 + checkbox: true
  70 + },{
  71 + field: 'id',
  72 + title: '编号'
  73 + },{
  74 + field: 'name',
  75 + title: '名称'
  76 + },{
  77 + field: 'type',
  78 + title: '类型',
  79 + formatter:function(value,row,index){
  80 + //1:卫生与计划生育委员会,2:妇幼保健院/站,3:妇产(科)医院,4:综合医院,5:计生站,6:卫生院,7:卫生所,8:其他
  81 + switch(value){
  82 + case 1:return "卫生与计划生育委员会";
  83 + case 2:return "妇幼保健院/站";
  84 + case 3:return "妇产(科)医院";
  85 + case 4:return "综合医院";
  86 + case 5:return "计生站";
  87 + case 6:return "卫生院";
  88 + case 7:return "卫生所";
  89 + case 8:return "其他";
  90 + }
  91 + }
  92 + },{
  93 + field: 'shortCode',
  94 + title: '简码'
  95 + },{
  96 + field: 'level',
  97 + title: '等级',
  98 + formatter:function(value,row,index){
  99 + switch (value) {
  100 + case 1:return "省";
  101 + case 2:return "市";
  102 + case 3:return "区县";
  103 + case 4:return "乡镇";
  104 + case 5:return "村";
  105 + case 6:return "其他";
  106 +
  107 + default:
  108 + return "";
  109 + }
  110 + }
  111 + },{
  112 + field: 'gradeLevel',
  113 + title: '医院等级'
  114 + },{
  115 + field: 'mobile',
  116 + title: '服务热线'
  117 + },{
  118 + field: 'starLevel',
  119 + title: '星级'
  120 + },{
  121 + field: 'status',
  122 + title: '状态',
  123 + formatter:function(value,row,index){
  124 + switch (value) {
  125 + case 0: return "正式运行";
  126 + case 1: return "试运行";
  127 + case 2: return "停止运行";
  128 + default:
  129 + break;
  130 + }
  131 + }
  132 + },{
  133 + field: 'address',
  134 + title: '地址'
  135 + }];
  136 +
  137 +</script>
  138 +#end
  139 +#extends("/common/base_list.html")
center.manager/src/main/webapp/WEB-INF/views/group/group_list.html View file @ 73a52ae
... ... @@ -2,7 +2,7 @@
2 2  
3 3 <div class="ibox float-e-margins">
4 4 <div class="rows" style="width: 100%">
5   - <div class="col-sm-6">
  5 + <div class="col-sm-10">
6 6 <div class="row wrapper border-bottom white-bg page-heading">
7 7 <div class="col-sm-4">
8 8 <div style="padding-top:30px;">
... ... @@ -34,12 +34,6 @@
34 34 </div>
35 35 </div>
36 36 </div>
37   -
38   - <div class="col-sm-6" style="padding-top: 4%">
39   - <input id='resources' name='role.resources' type='hidden'/>
40   - <div id='treeContent_resources' class='menuContent' >
41   - <ul id='tree_resources' class='ztree' style='margin-top:0; width:180px; height: 250px;'></ul></div>
42   - </div>
43 37 </div>
44 38 </div>
45 39 #end
46 40  
... ... @@ -49,13 +43,13 @@
49 43 var controllerRequestMappint = "/sysOrganGroup/";
50 44  
51 45 function add() {
52   - popWindow("添加结构", APP.PATH + controllerRequestMappint + "/toEdit?orgId=",700,550);
  46 + fullWindow("新增机构组", APP.PATH + controllerRequestMappint + "0/toEdit");
53 47 }
54 48  
55 49 function edit(){
56 50 var id = getSingleSelectedValue("dataTable","id");
57 51 if(id){
58   - popWindow("修改机构", APP.PATH + controllerRequestMappint + "toEdit?orgId="+id,700,550);
  52 + fullWindow("修改机构组", APP.PATH + controllerRequestMappint + id + "/toEdit");
59 53 }
60 54 }
61 55  
... ... @@ -88,256 +82,4 @@
88 82 </script>
89 83 #end
90 84 #extends("/common/base_list.html")
91   -
92   -
93   -<link rel="stylesheet" href="${ctx}/static/js/zTree_v3/css/zTreeStyle/zTreeStyle.css" type="text/css" />
94   -<script src="${ctx}/static/js/zTree_v3/js/jquery.ztree.all-3.5.min.js" type="text/javascript"></script>
95   -<script src="${ctx}/static/js/area.js"></script>
96   -<script type="text/javascript">
97   -/* var reNodes = [
98   - { id:"1", name:"菜单",pid:"0",type:"hospital"}
99   - ,{ id:"999", name:"系统管理",pid:"1",type:"hospital"}
100   - ,{ id:"07559D3EEE524B348B28A7D9E4FD9720", name:"测试",pid:"1",type:"hospital"}
101   - ,{ id:"817411CD8A0C4726AA9D5FBA36D4169B", name:"测试_1",pid:"07559D3EEE524B348B28A7D9E4FD9720",type:"hospital"}
102   - ,{ id:"2", name:"用户管理",pid:"999",type:"aaa"}
103   - ,{ id:"6", name:"用户列表",pid:"2",type:"aaa"}
104   - ,{ id:"9", name:"创建用户",pid:"2",type:"hospital"}
105   - ,{ id:"7", name:"编辑用户",pid:"2",type:"hospital"}
106   - ,{ id:"8", name:"删除用户",pid:"2",type:"hospital"}
107   - ,{ id:"3", name:"角色管理",pid:"999",type:"hospital"}
108   - ,{ id:"10", name:"创建角色",pid:"3",type:"hospital"}
109   - ,{ id:"11", name:"编辑角色",pid:"3",type:"hospital"}
110   - ,{ id:"12", name:"删除角色",pid:"3",type:"hospital"}
111   - ,{ id:"13", name:"角色列表",pid:"3",type:"hospital"}
112   - ,{ id:"4", name:"资源管理",pid:"999",type:"hospital"}
113   - ,{ id:"15", name:"资源列表",pid:"4",type:"hospital"}
114   - ,{ id:"16", name:"添加资源",pid:"4",type:"hospital"}
115   - ,{ id:"17", name:"编辑资源",pid:"4",type:"hospital"}
116   - ,{ id:"18", name:"删除资源",pid:"4",type:"hospital"}
117   - ,{ id:"5", name:"会话管理",pid:"999",type:"hospital"}
118   -
119   - ]; */
120   -</script>
121   -<script>
122   -var setting_resources = {
123   - check: {
124   - enable: true,
125   - chkboxType: {
126   - 'Y': 's',
127   - 'N': 's'
128   - },
129   - chkDisabled:true
130   -
131   - },
132   - /* async:{
133   - autoParam:["id"],
134   - type:"get",
135   - url:APP.PATH+"/sysRegions/find?_size=10000&_offset=0",
136   - enable:true
137   - }, */
138   - view: {
139   - dblClickExpand: false,
140   - showIcon : false
141   - },
142   - data: {
143   - simpleData: {
144   - enable: true,
145   - pIdKey: 'pid'
146   - }
147   - },
148   - callback: {
149   - beforeClick: beforeClick_resources,
150   - onCheck: onCheck_resources,
151   - onNodeCreated: zTreeOnNodeCreated_resources,
152   - //onAsyncSuccess: zTreeOnAsyncSuccess,
153   - //onAsyncError: zTreeOnAsyncError,
154   - //beforeAsync: zTreeBeforeAsync
155   - }
156   -};
157   -
158   -/**
159   - * 如果节点在3不加载上面的区域数据
160   - */
161   -function zTreeBeforeAsync(treeId, treeNode) {
162   - //console.log(treeNode)
163   - if(treeNode.level == "3")return false;
164   -};
165   -
166   -function zTreeOnAsyncError(event, treeId, treeNode, XMLHttpRequest, textStatus, errorThrown) {
167   - alert("数据加载失败...");
168   -};
169   -/**
170   - * 异步数据加载返回处理
171   - */
172   -/* function zTreeOnAsyncSuccess(event, treeId, treeNode, msg) {
173   - var treeObj = $.fn.zTree.getZTreeObj(treeId);
174   - if(msg!=null) {
175   - var newNodes = [];
176   - var datas = JSON.parse(msg).records;
177   - if(datas!=null && datas.length>0) {
178   - for(var i=0;i<datas.length;i++) {
179   - newNodes.push({"id":datas[i].id,"name":datas[i].name,"pid":datas[i].parendId,"isParent":true})
180   - }
181   - treeObj.addNodes(treeNode,newNodes)
182   - }
183   - }
184   -}; */
185   -
186   -function ajaxArea(treeId,treeNode) {
187   - var treeObj = $.fn.zTree.getZTreeObj(treeId);
188   - //treeObj.removeChildNodes(treeNode);
189   - var newNodes = [];
190   -
191   - get(treeNode.id,function(data) {
192   - var datas = data.records;
193   - if(datas!=null && datas.length>0) {
194   - for(var i=0;i<datas.length;i++) {
195   - newNodes.push({"id":datas[i].id,"name":datas[i].name,"pid":datas[i].parendId,"isParent":true})
196   - }
197   - treeObj.removeChildNodes(treeNode);
198   - treeObj.addNodes(treeNode,newNodes)
199   - }
200   - })
201   -}
202   -
203   -
204   -function ajaxOrgan(treeId,treeNode) {
205   - var treeObj = $.fn.zTree.getZTreeObj(treeId);
206   - var newNodes = [];
207   -
208   - //区
209   - var areaId = treeNode.id;
210   - //市
211   - var cityId =treeNode.getParentNode().id;
212   - //省
213   - var provinceId = treeNode.getParentNode().getParentNode().id;
214   -
215   - //console.log(treeNode);
216   - $.get(APP.PATH+"/sysOrganizations/list?_size=100000&_offset=0&provinceId="+provinceId+"&cityId="+cityId+"&areaId="+areaId,function(data){
217   - var rows = data.rows;
218   - if(rows!=null && rows.length>0) {
219   - for(var i=0;i<rows.length;i++) {
220   - newNodes.push({"id":rows[i].id,"name":rows[i].name,"isParent":false})
221   - }
222   - treeObj.removeChildNodes(treeNode);
223   - treeObj.addNodes(treeNode,newNodes)
224   - }
225   - })
226   -
227   -}
228   -
229   -
230   -function beforeClick_resources(treeId, treeNode) {
231   - var zTree = $.fn.zTree.getZTreeObj('tree_resources');
232   - zTree.expandNode(treeNode);
233   - zTree.checkNode(treeNode, !treeNode.checked, null, true);
234   -
235   - //加载区域信息
236   - if(treeNode.level<3){
237   - ajaxArea(treeId,treeNode);
238   - }else{
239   - //加载医院信息
240   - ajaxOrgan(treeId,treeNode);
241   - }
242   - return false;
243   -}
244   -function selectTreeNode_resources(id) {
245   - var zTree = $.fn.zTree.getZTreeObj('tree_resources');
246   - var node = zTree.getNodeByParam('id', id);
247   - var pNode = node.getParentNode();
248   - while (pNode != null) {
249   - pNode = analParentNode(pNode, zTree);
250   - }
251   - zTree.cancelSelectedNode();
252   - zTree.checkNode(node, true);
253   - zTree.selectNode(node, true);
254   -}
255   -function analParentNode(node, zTree) {
256   - zTree.expandNode(node, true);
257   - var pNode = node.getParentNode();
258   - if (pNode) {
259   - return pNode;
260   - }
261   - return null;
262   -}
263   -function zTreeOnNodeCreated_resources(event, treeId, treeNode) {
264   - var selectModels = 'leve1';
265   - var types = selectModels.split(',');
266   - for (var i = 0; i < types.length; i++) {
267   - if (treeNode.type == types[i]) {
268   - //console.log(treeNode)
269   - //treeNode.isParent=true;
270   - return;
271   - }
272   - }
273   - treeNode.nocheck = true;
274   - $.fn.zTree.getZTreeObj(treeId).updateNode(treeNode);
275   -};
276   -function onClick_resources(e, treeId, treeNode) {
277   - var zTree = $.fn.zTree.getZTreeObj('tree_resources');
278   - zTree.expandNode(treeNode);
279   - zTree.checkNode(treeNode, !treeNode.checked, null, true);
280   - return false;
281   -}
282   -function onCheck_resources(e, treeId, treeNode) {
283   - var zTree = $.fn.zTree.getZTreeObj('tree_resources'),
284   - nodes = zTree.getCheckedNodes(true),
285   - v_txt = '';
286   - v_value = '';
287   - v_type = '';
288   - for (var i = 0,
289   - l = nodes.length; i < l; i++) {
290   - var pNode = nodes[i].getParentNode();
291   - if (pNode && pNode.checked) {
292   - continue;
293   - }
294   - v_txt += nodes[i].name + ',';
295   - v_value += nodes[i].id + ',';
296   - if (nodes[i].type) {
297   - v_type += nodes[i].type + ',';
298   - }
299   - }
300   - if (v_txt.length > 0) {
301   - v_txt = v_txt.substring(0, v_txt.length - 1);
302   - v_value = v_value.substring(0, v_value.length - 1);
303   - v_type = v_type.substring(0, v_type.length - 1);
304   - }
305   - $('#resources').attr('value', v_value);
306   -}
307   -var zNodes_resources = null;
308   -var zTree_selectMode_resources = 'area';
309   -$(function() {
310   -
311   - //获取资源数据信息
312   - var firstNodes=new Array();
313   - firstNodes.push( { "id":"-1" , "name":"区域信息","pid":"0","type":"flag"});
314   - get("",function(data) {
315   - if(data!=null) {
316   - var areas = data.records;
317   - for(var i=0;i<areas.length;i++) {
318   - firstNodes.push({"isParent":true,"id":""+areas[i].id+"","name":""+areas[i].name+"","pid":"-1","type":"leve1"})
319   - }
320   - zNodes_resources = firstNodes;
321   - }
322   - init("tree_resources" , setting_resources,zNodes_resources)
323   - })
324   -
325   - function init(tree_resources,setting_resources,zNodes_resources) {
326   - var zTree = $.fn.zTree.init($('#'+tree_resources), setting_resources, zNodes_resources);
327   - if (zTree_selectMode_resources.indexOf('all') < 0) {
328   - var types = zTree_selectMode_resources.split(',');
329   - for (var i = 0; i < types.length; i++) {
330   - nodes = zTree.getNodesByParam('type', types[i]);
331   - for (var j = 0; j < nodes.length; j++) {
332   - zTree.setChkDisabled(nodes[j], true);
333   - }
334   - }
335   - }
336   - var resTree = $.fn.zTree.getZTreeObj('tree_resources');
337   -
338   - resTree.expandAll(false);
339   - }
340   -});
341   -
342   -</script>
center.manager/src/main/webapp/WEB-INF/views/group/org_edit.html View file @ 73a52ae
1   -#override("body")
2   -<div class="ibox float-e-margins">
3   - <div class="ibox-content">
4   - <form id="validForm" class="form-horizontal m-t" novalidate="novalidate">
5   - <input type="hidden" id="org.id" name="id" value="$!org.id"/>
6   - <div class="form-group">
7   - <label class="col-sm-3 control-label">名称:</label>
8   - <div class="col-sm-8">
9   - <input type="text" placeholder="机构名称" value="$!org.name" aria-required="true" required="true" class="form-control" minlength="2" name="name" id="name">
10   - </div>
11   - </div>
12   - <div class="form-group">
13   - <label class="col-sm-3 control-label">类型:</label>
14   - <div class="col-sm-8">
15   - <!-- 1:卫生与计划生育委员会,2:妇幼保健院/站,3:妇产(科)医院,4:综合医院,5:计生站,6:卫生院,7:卫生所,8:其他 -->
16   - <select class="form-control" name="type">
17   - <option value="1" >卫生与计划生育委员会</option>
18   - <option value="2">妇幼保健院/站</option>
19   - <option value="3">妇产(科)医院</option>
20   - <option value="4">综合医院</option>
21   - <option value="5">计生站</option>
22   - <option value="6">卫生院</option>
23   - <option value="7">卫生所</option>
24   - <option value="8">其他</option>
25   - </select>
26   - <!-- <input type="text" placeholder="类型" aria-required="true" required="true" minlength="3" name="type" class="form-control" id="type"> -->
27   - </div>
28   - </div>
29   -
30   - <div class="form-group">
31   - <label class="col-sm-3 control-label">简码:</label>
32   - <div class="col-sm-8">
33   - <input type="text" value="$!org.shortCode" placeholder="简码" aria-required="true" required="true" minlength="3" name="shortCode" class="form-control" id="shortCode">
34   - </div>
35   - </div>
36   -
37   -
38   - <div class="form-group">
39   - <label class="col-sm-3 control-label">等级:</label>
40   - <div class="col-sm-8">
41   - <!-- 1省,2市,3区县,4乡镇,5村,6其他 -->
42   - <!-- <input type="text" placeholder="等级" aria-required="true" required="true" minlength="1" name="gradeLevel" class="form-control" id="gradeLevel"> -->
43   - <select class="form-control" name="level">
44   - <option value="1" #if($!org.gradeLevel==1) selected="selected" #end>省</option>
45   - <option value="2" #if($!org.gradeLevel==2) selected="selected" #end>市</option>
46   - <option value="3" #if($!org.gradeLevel==3) selected="selected" #end>区县</option>
47   - <option value="4" #if($!org.gradeLevel==4) selected="selected" #end>乡镇</option>
48   - <option value="5" #if($!org.gradeLevel==5) selected="selected" #end>村</option>
49   - <option value="6" #if($!org.gradeLevel==6) selected="selected" #end>其他</option>
50   - </select>
51   - </div>
52   - </div>
53   -
54   - <div class="form-group">
55   - <label class="col-sm-3 control-label">简码:</label>
56   - <div class="col-sm-8">
57   - <input type="text" value="$!org.shortCode" placeholder="简码" aria-required="true" required="true" minlength="3" name="shortCode" class="form-control" id="shortCode">
58   - </div>
59   - </div>
60   -
61   - <div class="form-group">
62   - <label class="col-sm-3 control-label">服务热线:</label>
63   - <div class="col-sm-8">
64   - <input type="text" value="$!org.mobile" placeholder="服务热线" aria-required="true" required="true" minlength="3" name="mobile" class="form-control" id="mobile">
65   - </div>
66   - </div>
67   - <div class="form-group">
68   - <label class="col-sm-3 control-label">星级:</label>
69   - <div class="col-sm-8">
70   - <input type="text" value="$!org.starLevel" placeholder="星级" aria-required="true" required="true" minlength="1" name="starLevel" class="form-control" id="starLevel">
71   - </div>
72   - </div>
73   - <div class="form-group">
74   - <label class="col-sm-3 control-label">区域:</label>
75   - <div class="col-sm-8">
76   - #extends("/organ/org.html")
77   - </div>
78   - </div>
79   - <div class="form-group">
80   - <label class="col-sm-3 control-label">详细地址:</label>
81   - <div class="col-sm-8">
82   - <input type="text" value="$!org.address" placeholder="详细地址" aria-required="true" required="true" minlength="3" name="address" class="form-control" id="address">
83   - </div>
84   - </div>
85   -
86   - <div class="form-group">
87   - <label class="col-sm-3 control-label">是否有效:</label>
88   - <div class="col-sm-8">
89   - <input class="col-sm-4" checked="checked" type="radio" name="ifdel" #if($!org.ifdel==0) checked="checked" #end value="0"/>是
90   - <input class="col-sm-4" type="radio" name="ifdel" #if($!org.ifdel==1) checked="checked" #end value="1"/>否
91   - </div>
92   - </div>
93   -
94   - <div class="form-group">
95   - <label class="col-sm-3 control-label">状态:</label>
96   - <div class="col-sm-8">
97   - <!-- 0,"正式运行" 1,"试运行" 2,"停止运行" -->
98   - <select class="form-control" name="status">
99   - <option value="0" #if($!org.status==0) selected="selected" #end>正式运行</option>
100   - <option value="1" #if($!org.status==1) selected="selected" #end>试运行</option>
101   - <option value="2" #if($!org.status==2) selected="selected" #end>停止运行</option>
102   - </select>
103   - </div>
104   - </div>
105   - <div class="form-group">
106   - <label class="col-sm-3 control-label">简介:</label>
107   - <div class="col-sm-8">
108   - <!-- 0,"正式运行" 1,"试运行" 2,"停止运行" -->
109   - <textarea class="control-label" cols="80" rows="6" name="description">$!org.description</textarea>
110   - </div>
111   - </div>
112   -
113   -
114   - <div class="hr-line-dashed"></div>
115   - <div class="form-group">
116   - <div class="col-sm-4 col-sm-offset-3 pull-right">
117   - <button type="button" class="btn btn-primary" onclick="save();"><i class="fa fa-check"></i>&nbsp;提交</button>
118   - <button type="button" class="btn btn-white" onclick="parent.closeAll();"><i class="fa fa-close"></i>&nbsp;取消</button>
119   - </div>
120   - </div>
121   - </form>
122   - </div>
123   -</div>
124   -<script type="text/javascript">
125   - function save(){
126   - if($('#validForm').valid()){
127   - var data = $('#validForm').serialize();
128   - data = data + "&" + $('#roleForm').serialize();
129   - //console.log(data);
130   - if("$!org.id" == ""){
131   - ajaxPost(APP.PATH + "/sysOrganizations/create",data);
132   - }else{
133   - ajaxPost(APP.PATH + "/sysOrganizations/update",data);
134   - }
135   - parent.reloadGrid('dataTable');
136   - }
137   - }
138   -</script>
139   -#end
140   -#extends("/common/base_list.html")
141   -<script src="${ctx}/static/js/area.js"></script>
142   -<script type="text/javascript">
143   - //获取所有区县
144   - get("",function(data){
145   - handlerSelect(data,"leve0","$!org.provinceId");
146   - get("$!org.provinceId",function(data){
147   - handlerSelect(data,"leve1","$!org.cityId");
148   - get("$!org.cityId",function(data){
149   - handlerSelect(data,"leve2","$!org.areaId");
150   - });
151   - });
152   - });
153   -
154   -</script>
center.parent/pom.xml View file @ 73a52ae
... ... @@ -2,7 +2,7 @@
2 2 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3 3 <modelVersion>4.0.0</modelVersion>
4 4 <groupId>com.lyms</groupId>
5   - <artifactId>center.parent</artifactId>
  5 + <artifactId>parent</artifactId>
6 6 <version>0.0.1-SNAPSHOT</version>
7 7 <packaging>pom</packaging>
8 8 <properties>
hospital.parent/pom.xml View file @ 73a52ae
1   -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2   - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3   - <modelVersion>4.0.0</modelVersion>
4   - <groupId>com.lyms</groupId>
5   - <artifactId>hospital.parent</artifactId>
6   - <version>0.0.1-SNAPSHOT</version>
7   - <packaging>pom</packaging>
8   -
9   - <properties>
10   - <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
11   - <java.version>1.7</java.version>
12   - <mysql.jdbc.version>5.1.34</mysql.jdbc.version>
13   - <spring.version>4.2.5.RELEASE</spring.version>
14   - <aspectjweaver.version>1.8.9</aspectjweaver.version>
15   - <mybatis-plus.version>2.0.1</mybatis-plus.version>
16   - <fastjson.version>1.2.8</fastjson.version>
17   - <slf4j.version>1.7.21</slf4j.version>
18   - <logback.version>1.0.13</logback.version>
19   - <shiro.version>1.3.2</shiro.version>
20   - <pinyin4j.version>2.5.1</pinyin4j.version>
21   - <mail.version>1.4.7</mail.version>
22   - <velocity.version>1.7</velocity.version>
23   - <velocity-tools.version>2.0</velocity-tools.version>
24   - <quartz.version>2.2.3</quartz.version>
25   - <bcprov-jdk14.version>1.50</bcprov-jdk14.version>
26   - </properties>
27   -
28   - <dependencies>
29   - <dependency>
30   - <groupId>junit</groupId>
31   - <artifactId>junit</artifactId>
32   - <version>4.11</version>
33   - <scope>test</scope>
34   - </dependency>
35   - <dependency>
36   - <groupId>mysql</groupId>
37   - <artifactId>mysql-connector-java</artifactId>
38   - <version>${mysql.jdbc.version}</version>
39   - </dependency>
40   - <!-- spring begin -->
41   - <dependency>
42   - <groupId>org.springframework</groupId>
43   - <artifactId>spring-context</artifactId>
44   - <version>${spring.version}</version>
45   - </dependency>
46   - <dependency>
47   - <groupId>org.springframework</groupId>
48   - <artifactId>spring-webmvc</artifactId>
49   - <version>${spring.version}</version>
50   - </dependency>
51   - <dependency>
52   - <groupId>org.springframework</groupId>
53   - <artifactId>spring-tx</artifactId>
54   - <version>${spring.version}</version>
55   - </dependency>
56   - <dependency>
57   - <groupId>org.springframework</groupId>
58   - <artifactId>spring-jdbc</artifactId>
59   - <version>${spring.version}</version>
60   - </dependency>
61   - <dependency>
62   - <groupId>org.springframework</groupId>
63   - <artifactId>spring-context-support</artifactId>
64   - <version>${spring.version}</version>
65   - </dependency>
66   - <dependency>
67   - <groupId>org.springframework</groupId>
68   - <artifactId>spring-test</artifactId>
69   - <version>${spring.version}</version>
70   - <scope>test</scope>
71   - </dependency>
72   - <dependency>
73   - <groupId>org.aspectj</groupId>
74   - <artifactId>aspectjrt</artifactId>
75   - <version>${aspectjweaver.version}</version>
76   - </dependency>
77   - <dependency>
78   - <groupId>org.aspectj</groupId>
79   - <artifactId>aspectjweaver</artifactId>
80   - <version>${aspectjweaver.version}</version>
81   - </dependency>
82   - <!-- spring end -->
83   - <!-- Commons -->
84   - <dependency>
85   - <groupId>org.apache.commons</groupId>
86   - <artifactId>commons-lang3</artifactId>
87   - <version>3.4</version>
88   - </dependency>
89   - <dependency>
90   - <groupId>commons-logging</groupId>
91   - <artifactId>commons-logging</artifactId>
92   - <version>1.2</version>
93   - </dependency>
94   - <dependency>
95   - <groupId>commons-io</groupId>
96   - <artifactId>commons-io</artifactId>
97   - <version>2.4</version>
98   - </dependency>
99   - <dependency>
100   - <groupId>commons-fileupload</groupId>
101   - <artifactId>commons-fileupload</artifactId>
102   - <version>1.3.1</version>
103   - </dependency>
104   - <dependency>
105   - <groupId>commons-collections</groupId>
106   - <artifactId>commons-collections</artifactId>
107   - <version>3.2.1</version>
108   - </dependency>
109   - <!-- Servlet -->
110   - <dependency>
111   - <groupId>javax.servlet</groupId>
112   - <artifactId>javax.servlet-api</artifactId>
113   - <version>3.0.1</version>
114   - <scope>provided</scope>
115   - </dependency>
116   - <dependency>
117   - <groupId>javax.servlet.jsp</groupId>
118   - <artifactId>jsp-api</artifactId>
119   - <version>2.2</version>
120   - </dependency>
121   - <dependency>
122   - <groupId>javax.servlet</groupId>
123   - <artifactId>jstl</artifactId>
124   - <version>1.2</version>
125   - </dependency>
126   - <dependency>
127   - <groupId>com.baomidou</groupId>
128   - <artifactId>mybatis-plus</artifactId>
129   - <version>${mybatis-plus.version}</version>
130   - </dependency>
131   - <!-- alibaba -->
132   - <dependency>
133   - <groupId>com.alibaba</groupId>
134   - <artifactId>druid</artifactId>
135   - <version>1.0.9</version>
136   - </dependency>
137   - <dependency>
138   - <groupId>com.alibaba</groupId>
139   - <artifactId>fastjson</artifactId>
140   - <version>${fastjson.version}</version>
141   - </dependency>
142   - <!-- log -->
143   - <dependency>
144   - <groupId>org.slf4j</groupId>
145   - <artifactId>slf4j-api</artifactId>
146   - <version>${slf4j.version}</version>
147   - </dependency>
148   - <dependency>
149   - <groupId>ch.qos.logback</groupId>
150   - <artifactId>logback-core</artifactId>
151   - <version>${logback.version}</version>
152   - </dependency>
153   - <dependency>
154   - <groupId>ch.qos.logback</groupId>
155   - <artifactId>logback-classic</artifactId>
156   - <version>${logback.version}</version>
157   - </dependency>
158   - <!-- redis -->
159   - <dependency>
160   - <groupId>org.springframework.data</groupId>
161   - <artifactId>spring-data-redis</artifactId>
162   - <version>1.7.2.RELEASE</version>
163   - </dependency>
164   - <dependency>
165   - <groupId>redis.clients</groupId>
166   - <artifactId>jedis</artifactId>
167   - <version>2.9.0</version>
168   - </dependency>
169   - <dependency>
170   - <groupId>org.springframework.session</groupId>
171   - <artifactId>spring-session</artifactId>
172   - <version>1.2.2.RELEASE</version>
173   - </dependency>
174   -
175   - <!-- APACHE SHIRO -->
176   - <dependency>
177   - <groupId>org.apache.shiro</groupId>
178   - <artifactId>shiro-core</artifactId>
179   - <version>${shiro.version}</version>
180   - </dependency>
181   - <dependency>
182   - <groupId>org.apache.shiro</groupId>
183   - <artifactId>shiro-web</artifactId>
184   - <version>${shiro.version}</version>
185   - </dependency>
186   - <dependency>
187   - <groupId>org.apache.shiro</groupId>
188   - <artifactId>shiro-ehcache</artifactId>
189   - <version>${shiro.version}</version>
190   - </dependency>
191   - <dependency>
192   - <groupId>org.apache.shiro</groupId>
193   - <artifactId>shiro-spring</artifactId>
194   - <version>${shiro.version}</version>
195   - </dependency>
196   - <!-- other -->
197   - <dependency>
198   - <groupId>com.belerweb</groupId>
199   - <artifactId>pinyin4j</artifactId>
200   - <version>${pinyin4j.version}</version>
201   - </dependency>
202   - <!-- velocity begin -->
203   - <dependency>
204   - <groupId>org.apache.velocity</groupId>
205   - <artifactId>velocity-tools</artifactId>
206   - <version>${velocity-tools.version}</version>
207   - </dependency>
208   - <dependency>
209   - <groupId>org.apache.velocity</groupId>
210   - <artifactId>velocity</artifactId>
211   - <version>${velocity.version}</version>
212   - </dependency>
213   - <!-- velocity end -->
214   - <dependency>
215   - <groupId>javax.mail</groupId>
216   - <artifactId>mail</artifactId>
217   - <version>${mail.version}</version>
218   - </dependency>
219   - <dependency>
220   - <groupId>org.quartz-scheduler</groupId>
221   - <artifactId>quartz</artifactId>
222   - <version>${quartz.version}</version>
223   - <exclusions>
224   - <exclusion>
225   - <artifactId>slf4j-api</artifactId>
226   - <groupId>org.slf4j</groupId>
227   - </exclusion>
228   - </exclusions>
229   - </dependency>
230   - <dependency>
231   - <groupId>org.quartz-scheduler</groupId>
232   - <artifactId>quartz-jobs</artifactId>
233   - <version>${quartz.version}</version>
234   - </dependency>
235   - <!-- Encryption -->
236   - <dependency>
237   - <groupId>org.bouncycastle</groupId>
238   - <artifactId>bcprov-jdk14</artifactId>
239   - <version>${bcprov-jdk14.version}</version>
240   - </dependency>
241   - <!-- 二维码 -->
242   - <dependency>
243   - <groupId>com.google.zxing</groupId>
244   - <artifactId>core</artifactId>
245   - <version>3.2.1</version>
246   - </dependency>
247   - <!-- 图片处理\sftp\ftp -->
248   - <dependency>
249   - <groupId>net.coobird</groupId>
250   - <artifactId>thumbnailator</artifactId>
251   - <version>0.4.8</version>
252   - </dependency>
253   - <dependency>
254   - <groupId>com.jcraft</groupId>
255   - <artifactId>jsch</artifactId>
256   - <version>0.1.53</version>
257   - </dependency>
258   - <dependency>
259   - <groupId>commons-net</groupId>
260   - <artifactId>commons-net</artifactId>
261   - <version>3.4</version>
262   - </dependency>
263   - <!-- zxing qrcode -->
264   - <dependency>
265   - <groupId>com.google.zxing</groupId>
266   - <artifactId>core</artifactId>
267   - <version>3.3.0</version>
268   - </dependency>
269   - </dependencies>
270   - <build>
271   - <finalName>${project.artifactId}</finalName>
272   - <plugins>
273   - <!-- 单元测试,true跳过,false执行 -->
274   - <plugin>
275   - <groupId>org.apache.maven.plugins</groupId>
276   - <artifactId>maven-surefire-plugin</artifactId>
277   - <version>2.12.4</version>
278   - <configuration>
279   - <skip>true</skip>
280   - </configuration>
281   - </plugin>
282   - <plugin>
283   - <groupId>org.apache.maven.plugins</groupId>
284   - <artifactId>maven-compiler-plugin</artifactId>
285   - <version>2.3.2</version>
286   - <configuration>
287   - <source>${java.version}</source>
288   - <target>${java.version}</target>
289   - <encoding>${project.build.sourceEncoding}</encoding>
290   - </configuration>
291   - </plugin>
292   - </plugins>
293   - </build>
294   -</project>
hospital.web/pom.xml View file @ 73a52ae
... ... @@ -3,7 +3,7 @@
3 3 <modelVersion>4.0.0</modelVersion>
4 4 <parent>
5 5 <groupId>com.lyms</groupId>
6   - <artifactId>hospital.parent</artifactId>
  6 + <artifactId>parent</artifactId>
7 7 <version>0.0.1-SNAPSHOT</version>
8 8 </parent>
9 9 <artifactId>hospital.web</artifactId>
... ... @@ -21,11 +21,6 @@
21 21 <dependency>
22 22 <groupId>com.lyms</groupId>
23 23 <artifactId>hospital.mac</artifactId>
24   - <version>${project.parent.version}</version>
25   - </dependency>
26   - <dependency>
27   - <groupId>com.lyms</groupId>
28   - <artifactId>sync.data</artifactId>
29 24 <version>${project.parent.version}</version>
30 25 </dependency>
31 26  
hospital.web/src/main/java/com/lyms/hospital/util/AggridUtils.java View file @ 73a52ae
  1 +package com.lyms.hospital.util;
  2 +
  3 +import com.alibaba.fastjson.JSONObject;
  4 +import com.baomidou.mybatisplus.plugins.Page;
  5 +import com.lyms.util.DateTimeUtils;
  6 +
  7 +public abstract class AggridUtils {
  8 +
  9 + private static final String SUCCESS_MSG = "成功";
  10 + private static final int SUCCESS_CODE = 0;
  11 +
  12 +
  13 + /**
  14 + * <li>@Description:返回前段aggrid的数据格式
  15 + * <li>@param page
  16 + * <li>@return
  17 + * <li>创建人:方承
  18 + * <li>创建时间:2017年3月20日
  19 + * <li>修改人:
  20 + * <li>修改时间:
  21 + */
  22 + public static String toAggrid(Page<?> page) {
  23 + JSONObject gridJson = new JSONObject();
  24 +
  25 + gridJson.put("errormsg", SUCCESS_MSG);
  26 + gridJson.put("errorcode", SUCCESS_CODE);
  27 + gridJson.put("data",page.getRecords());
  28 +
  29 + JSONObject pageInfoJson = new JSONObject();
  30 + pageInfoJson.put("page", page.getCurrent());
  31 + pageInfoJson.put("lastPage", page.getPages());
  32 + pageInfoJson.put("count", page.getTotal());
  33 + pageInfoJson.put("limit", page.getOffset());
  34 + pageInfoJson.put("size", page.getSize());
  35 +
  36 + gridJson.put("pageInfo",pageInfoJson);
  37 + gridJson.put("now",DateTimeUtils.getDateTime(DateTimeUtils.YYYY_MM_DD));
  38 + return gridJson.toJSONString();
  39 + }
  40 +
  41 +}
hospital.web/src/main/resources/dev/redis.properties View file @ 73a52ae
  1 +redis.host1=119.90.57.26
  2 +redis.port1=6379
  3 +redis.password1=Lyms123456
  4 +#redis.host1=127.0.0.1
  5 +#redis.port1=6379
  6 +#redis.password1=Lyms123456
  7 +
  8 +
  9 +#redis.password1=
  10 +#redis.host2=192.168.56.254
  11 +#redis.port2=6382
  12 +#redis.password2=
  13 +#redis.host3=192.168.56.254
  14 +#redis.port3=6383
  15 +#redis.password2=
  16 +#redis.host4=192.168.56.254
  17 +#redis.port4=6384
  18 +#redis.password4=
  19 +#redis.host5=192.168.56.254
  20 +#redis.port5=6385
  21 +#redis.password5=
  22 +#redis.host6=192.168.56.254
  23 +#redis.port6=6386
  24 +#redis.password6=
  25 +
  26 +
  27 +redis.minIdle=1
  28 +redis.maxIdle=300
  29 +redis.maxActive=600
  30 +redis.maxWait=1000
  31 +redis.testOnBorrow=true
  32 +redis.HttpSession.redisNamespace=hospital.mac
  33 +spring.redis.cluster.max-redirects= 3
sync.data/pom.xml View file @ 73a52ae
1   -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2   - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3   - <modelVersion>4.0.0</modelVersion>
4   - <parent>
5   - <groupId>com.lyms</groupId>
6   - <artifactId>hospital.parent</artifactId>
7   - <version>0.0.1-SNAPSHOT</version>
8   - </parent>
9   - <artifactId>sync.data</artifactId>
10   - <dependencies>
11   - <dependency>
12   - <groupId>com.lyms</groupId>
13   - <artifactId>core.sdk</artifactId>
14   - <version>${project.parent.version}</version>
15   - </dependency>
16   - </dependencies>
17   -</project>
sync.data/src/main/java/com/lyms/hospital/controller/CenterCallHospitalController.java View file @ 73a52ae
1   -package com.lyms.hospital.controller;
2   -
3   -import javax.servlet.http.HttpServletRequest;
4   -
5   -import org.slf4j.Logger;
6   -import org.slf4j.LoggerFactory;
7   -import org.springframework.beans.factory.annotation.Autowired;
8   -import org.springframework.web.bind.annotation.RequestMapping;
9   -import org.springframework.web.bind.annotation.RequestMethod;
10   -import org.springframework.web.bind.annotation.ResponseBody;
11   -import org.springframework.web.bind.annotation.RestController;
12   -import com.alibaba.fastjson.JSONObject;
13   -import com.lyms.spring.PropertiesUtil;
14   -import com.lyms.sync.data.constants.SyncStatus;
15   -import com.lyms.sync.data.service.SyncDataBasicService;
16   -import com.lyms.web.controller.BaseController;
17   -
18   -@RestController
19   -@RequestMapping(value = "/sync", method = RequestMethod.POST)
20   -public class CenterCallHospitalController extends BaseController {
21   -
22   - private static Logger log = LoggerFactory.getLogger(CenterCallHospitalController.class);
23   -
24   - private static final String ALLOW_IP = PropertiesUtil.getString("sync_allow_ip");
25   -
26   - @Autowired
27   - private SyncDataBasicService syncDataBasicService;
28   -
29   - @ResponseBody
30   - @RequestMapping(value = "/pullSyncData", method = RequestMethod.POST)
31   - public String pullSyncData(HttpServletRequest request) {
32   - if (isAllow(request)) {
33   - return getMsg(SyncStatus.SUCCESS,syncDataBasicService.pullSyncData());
34   - }else{
35   - return getMsg(SyncStatus.NOTALLOW);
36   - }
37   - }
38   -
39   - private boolean isAllow(HttpServletRequest request){
40   - String ip = getHost(request);
41   - if (ip.equalsIgnoreCase(ALLOW_IP)) {
42   - return true;
43   - }
44   - log.info("不是受理允许的ip【{}】地址请求基础数据同步!", ip);
45   - return false;
46   - }
47   -
48   - /**
49   - * <li>@Description:组装json字符串
50   - * <li>@param status
51   - * <li>@param dataObj
52   - * <li>@return
53   - * <li>创建人:方承
54   - * <li>创建时间:2017年3月13日
55   - * <li>修改人:
56   - * <li>修改时间:
57   - */
58   - private String getMsg(SyncStatus status,Object ...dataObj){
59   - JSONObject json = new JSONObject();
60   - json.put("state", status);
61   - if(status.equals(SyncStatus.NOTALLOW)){
62   - json.put("data", "没有被授权的请求,您的所有信息已经保存,如果您再视图访问,本公司将保留追究法律责任的权利!");
63   - }else{
64   - json.put("data", JSONObject.toJSONString(dataObj));
65   - }
66   - return json.toJSONString();
67   - }
68   -
69   -}
sync.data/src/main/java/com/lyms/sync/data/constants/EventType.java View file @ 73a52ae
1   -package com.lyms.sync.data.constants;
2   -
3   -public enum EventType {
4   -
5   - ADD(1),
6   - DELETE(2),
7   - UPDATE(3);
8   -
9   - private int type;
10   -
11   - private EventType(int type) {
12   - this.setType(type);
13   - }
14   -
15   - public int getType() {
16   - return type;
17   - }
18   -
19   - public void setType(int type) {
20   - this.type = type;
21   - }
22   -
23   -}
sync.data/src/main/java/com/lyms/sync/data/constants/ModuleType.java View file @ 73a52ae
1   -package com.lyms.sync.data.constants;
2   -
3   -public enum ModuleType {
4   -
5   - USER("user"),
6   - ROLE("role"),
7   - ORGANIZATION("org"),
8   - DEPARTMENT("dep");
9   -
10   - private String type ;
11   -
12   - private ModuleType(String type) {
13   - this.setType(type);
14   - }
15   -
16   - public String getType() {
17   - return type;
18   - }
19   -
20   - public void setType(String type) {
21   - this.type = type;
22   - }
23   -
24   -}
sync.data/src/main/java/com/lyms/sync/data/constants/SyncStatus.java View file @ 73a52ae
1   -package com.lyms.sync.data.constants;
2   -
3   -public enum SyncStatus {
4   -
5   - SUCCESS("success"),
6   - ERROR("error"),
7   - NOTALLOW("notallow");
8   -
9   - private String code;
10   -
11   - private SyncStatus(String code) {
12   - this.setCode(code);
13   - }
14   -
15   - public String getCode() {
16   - return code;
17   - }
18   -
19   - public void setCode(String code) {
20   - this.code = code;
21   - }
22   -
23   -
24   -}
sync.data/src/main/java/com/lyms/sync/data/dao/SyncDataBasicMapper.java View file @ 73a52ae
1   -package com.lyms.sync.data.dao;
2   -
3   -import com.lyms.sync.data.entity.SyncDataBasic;
4   -import com.baomidou.mybatisplus.mapper.BaseMapper;
5   -import org.springframework.stereotype.Repository;
6   -import java.io.Serializable;
7   -/**
8   - * <p>
9   - * Mapper接口
10   - * </p>
11   - *
12   - * @author fangcheng
13   - * @since 2017-03-13
14   - */
15   -@Repository
16   -public interface SyncDataBasicMapper extends BaseMapper<SyncDataBasic> {
17   -
18   - public Integer deleteLogicById(Serializable id);
19   -
20   -}
sync.data/src/main/java/com/lyms/sync/data/dao/SyncDataBasicMapper.xml View file @ 73a52ae
1   -<?xml version="1.0" encoding="UTF-8"?>
2   -<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3   -<mapper namespace="com.lyms.sync.data.dao.SyncDataBasicMapper">
4   -
5   - <!-- 通用查询映射结果 -->
6   - <resultMap id="BaseResultMap" type="com.lyms.sync.data.entity.SyncDataBasic">
7   - <id column="ID" property="id" />
8   - <result column="BID" property="bid" />
9   - <result column="MODULE" property="module" />
10   - <result column="EVENT" property="event" />
11   - <result column="DATA" property="data" />
12   - <result column="CREATE_TIME" property="createTime" />
13   - <result column="IFSUC" property="ifsuc" />
14   - </resultMap>
15   -
16   - <!-- 通用查询结果列 -->
17   - <sql id="Base_Column_List">
18   - ID AS id, BID AS bid, MODULE AS module, EVENT AS event, DATA AS data, CREATE_TIME AS createTime, IFSUC AS ifsuc
19   - </sql>
20   -</mapper>
sync.data/src/main/java/com/lyms/sync/data/entity/SyncDataBasic.java View file @ 73a52ae
1   -package com.lyms.sync.data.entity;
2   -
3   -import com.baomidou.mybatisplus.annotations.TableId;
4   -import com.baomidou.mybatisplus.annotations.TableField;
5   -import com.baomidou.mybatisplus.annotations.TableName;
6   -import java.io.Serializable;
7   -import java.util.Date;
8   -
9   -/**
10   - * <p>
11   - * 用户、角色、权限、医院、部门等基础数据同步
12   - * </p>
13   - *
14   - * @author fangcheng
15   - * @since 2017-03-13
16   - */
17   -@TableName("SYNC_DATA_BASIC")
18   -public class SyncDataBasic implements Serializable {
19   -
20   - private static final long serialVersionUID = 1L;
21   -
22   - /**
23   - *
24   - */
25   - @TableId(value="ID")
26   - private String id;
27   - /**
28   - * 数据对象业务主键
29   - */
30   - @TableField(value="BID")
31   - private String bid;
32   - /**
33   - * 模块
34   - */
35   - @TableField(value="MODULE")
36   - private String module;
37   - /**
38   - * 事件,1a,2d,3u
39   - */
40   - @TableField(value="EVENT")
41   - private Integer event;
42   - /**
43   - * 数据对象
44   - */
45   - @TableField(value="DATA")
46   - private String data;
47   - /**
48   - * 创建时间
49   - */
50   - @TableField(value="CREATE_TIME")
51   - private Date createTime;
52   - /**
53   - * 数据上传是否成功
54   - */
55   - @TableField(value="IFSUC")
56   - private Integer ifsuc;
57   -
58   -
59   - public String getId() {
60   - return id;
61   - }
62   -
63   - public void setId(String id) {
64   - this.id = id;
65   - }
66   -
67   - public String getBid() {
68   - return bid;
69   - }
70   -
71   - public void setBid(String bid) {
72   - this.bid = bid;
73   - }
74   -
75   - public String getModule() {
76   - return module;
77   - }
78   -
79   - public void setModule(String module) {
80   - this.module = module;
81   - }
82   -
83   - public Integer getEvent() {
84   - return event;
85   - }
86   -
87   - public void setEvent(Integer event) {
88   - this.event = event;
89   - }
90   -
91   - public String getData() {
92   - return data;
93   - }
94   -
95   - public void setData(String data) {
96   - this.data = data;
97   - }
98   -
99   - public Date getCreateTime() {
100   - return createTime;
101   - }
102   -
103   - public void setCreateTime(Date createTime) {
104   - this.createTime = createTime;
105   - }
106   -
107   - public Integer getIfsuc() {
108   - return ifsuc;
109   - }
110   -
111   - public void setIfsuc(Integer ifsuc) {
112   - this.ifsuc = ifsuc;
113   - }
114   -
115   -}
sync.data/src/main/java/com/lyms/sync/data/parse/ParseDataBasicTools.java View file @ 73a52ae
1   -package com.lyms.sync.data.parse;
2   -
3   -/**
4   - * <li>@ClassName: 解析基础数据的工具类
5   - * <li>@Description: TODO(类描述)
6   - * <li>@author 方承
7   - * <li>@date 2017年3月13日
8   - * <li>
9   - */
10   -public class ParseDataBasicTools {
11   -
12   -
13   -
14   -}
sync.data/src/main/java/com/lyms/sync/data/service/SyncDataBasicService.java View file @ 73a52ae
1   -package com.lyms.sync.data.service;
2   -
3   -import com.lyms.sync.data.constants.EventType;
4   -import com.lyms.sync.data.constants.ModuleType;
5   -import com.lyms.sync.data.entity.SyncDataBasic;
6   -import com.lyms.web.service.BaseService;
7   -import java.io.Serializable;
8   -import java.util.List;
9   -
10   -/**
11   - * <p>
12   - * 服务类
13   - * </p>
14   - *
15   - * @author fangcheng
16   - * @since 2017-03-13
17   - */
18   -public interface SyncDataBasicService extends BaseService<SyncDataBasic> {
19   -
20   - /**
21   - * <li>@Description:逻辑删除,ifDel = 1 为删除,否则为没有删除
22   - * <li>@param id 删除主键id
23   - * <li>@return 大于0修改成功,否则为失败
24   - */
25   - public Integer deleteLogicById(Serializable id);
26   -
27   - /**
28   - * <li>@Description:添加需要同步的数据
29   - * <li>@param bid 业务主键id
30   - * <li>@param entityClassName 业务实体对象名称,方便反射回该实体对象和业务对象
31   - * <li>@param eventType 时间类型
32   - * <li>@param objData 数据对象
33   - * <li>@return
34   - * <li>创建人:方承
35   - * <li>创建时间:2017年3月13日
36   - * <li>修改人:
37   - * <li>修改时间:
38   - */
39   - public boolean addSyncData(String bid, String entityClassName, EventType eventType, Object objData);
40   -
41   -
42   - /**
43   - * <li>@Description:拉取所有需要同步的数据列表
44   - * <li>@return
45   - * <li>创建人:方承
46   - * <li>创建时间:2017年3月13日
47   - * <li>修改人:
48   - * <li>修改时间:
49   - */
50   - public List<SyncDataBasic> pullSyncData();
51   -
52   -}
sync.data/src/main/java/com/lyms/sync/data/service/impl/SyncDataBasicServiceImpl.java View file @ 73a52ae
1   -package com.lyms.sync.data.service.impl;
2   -
3   -import java.io.Serializable;
4   -import java.util.List;
5   -
6   -import org.springframework.stereotype.Service;
7   -
8   -import com.alibaba.fastjson.JSONObject;
9   -import com.baomidou.mybatisplus.mapper.EntityWrapper;
10   -import com.baomidou.mybatisplus.service.impl.ServiceImpl;
11   -import com.lyms.sync.data.constants.EventType;
12   -import com.lyms.sync.data.dao.SyncDataBasicMapper;
13   -import com.lyms.sync.data.entity.SyncDataBasic;
14   -import com.lyms.sync.data.service.SyncDataBasicService;
15   -import com.lyms.util.DateTimeUtils;
16   -import com.lyms.util.StrUtils;
17   -
18   -/**
19   - * <p>
20   - * 用户、角色、权限、医院、部门等基础数据同步 服务实现类
21   - * </p>
22   - *
23   - * @author fangcheng
24   - * @since 2017-03-13
25   - */
26   -@Service
27   -public class SyncDataBasicServiceImpl extends ServiceImpl<SyncDataBasicMapper, SyncDataBasic> implements SyncDataBasicService {
28   -
29   - public Integer deleteLogicById(Serializable id){
30   - return baseMapper.deleteLogicById(id);
31   - }
32   -
33   - @Override
34   - public boolean addSyncData(String bid,String entityClassName, EventType eventType, Object dataObj) {
35   - SyncDataBasic entity = new SyncDataBasic();
36   - entity.setId(StrUtils.uuid());
37   - entity.setIfsuc(0);
38   - entity.setCreateTime(DateTimeUtils.getNow());
39   -
40   - entity.setBid(bid);
41   - entity.setModule(entityClassName);
42   - entity.setEvent(eventType.getType());
43   - entity.setData(JSONObject.toJSONString(dataObj));
44   - return insert(entity);
45   - }
46   -
47   - @Override
48   - public List<SyncDataBasic> pullSyncData() {
49   - return selectList(new EntityWrapper<SyncDataBasic>().where("IFSUC", "0"));
50   - }
51   -}