Commit 5701e4bca6df0c7969f253af63a0716fb42bd353

Authored by maliang
1 parent d2a3f13589
Exists in master

机构信息创建

Showing 28 changed files with 1715 additions and 125 deletions

center.manager/src/main/java/com/lyms/cm/controller/sys/SysDepartmentsController.java View file @ 5701e4b
  1 +package com.lyms.cm.controller.sys;
  2 +
  3 +import org.springframework.stereotype.Controller;
  4 +import org.springframework.web.bind.annotation.RequestMapping;
  5 +import com.lyms.web.controller.BaseController;
  6 +
  7 +/**
  8 + * <p>
  9 + * 部门 科室表 前端控制器
  10 + * </p>
  11 + *
  12 + * @author maliang
  13 + * @since 2017-03-08
  14 + */
  15 +@Controller
  16 +@RequestMapping("/sysDepartments")
  17 +public class SysDepartmentsController extends BaseController {
  18 +
  19 +}
center.manager/src/main/java/com/lyms/cm/controller/sys/SysOrganizationsController.java View file @ 5701e4b
  1 +package com.lyms.cm.controller.sys;
  2 +
  3 +import java.util.Map;
  4 +
  5 +import org.springframework.beans.factory.annotation.Autowired;
  6 +import org.springframework.stereotype.Controller;
  7 +import org.springframework.ui.Model;
  8 +import org.springframework.web.bind.annotation.PathVariable;
  9 +import org.springframework.web.bind.annotation.RequestMapping;
  10 +import org.springframework.web.bind.annotation.RequestMethod;
  11 +import org.springframework.web.bind.annotation.ResponseBody;
  12 +
  13 +import com.baomidou.mybatisplus.mapper.EntityWrapper;
  14 +import com.baomidou.mybatisplus.plugins.Page;
  15 +import com.lyms.cm.entity.sys.SysOrganizations;
  16 +import com.lyms.cm.service.sys.SysOrganizationsService;
  17 +import com.lyms.constants.OperationName;
  18 +import com.lyms.web.bean.AjaxResult;
  19 +import com.lyms.web.controller.BaseController;
  20 +
  21 +/**
  22 + * <p>
  23 + * 机构表 前端控制器
  24 + * </p>
  25 + *
  26 + * @author maliang
  27 + * @since 2017-03-08
  28 + */
  29 +@Controller
  30 +@RequestMapping("/sysOrganizations")
  31 +public class SysOrganizationsController extends BaseController {
  32 +
  33 + @Autowired
  34 + private SysOrganizationsService organService;
  35 +
  36 + /**
  37 + * <li>@Description:跳转到机构列表页
  38 + * <li>@return
  39 + * <li>创建人:maliang
  40 + * <li>创建时间:2017年3月8日
  41 + * <li>修改人:
  42 + * <li>修改时间:
  43 + */
  44 + @RequestMapping("/toList")
  45 + public String toOrgan() {
  46 + return "/organ/org_list";
  47 + }
  48 +
  49 + /**
  50 + * <li>@Description:获取结构列表
  51 + * <li>@return
  52 + * <li>创建人:maliang
  53 + * <li>创建时间:2017年3月8日
  54 + * <li>修改人:
  55 + * <li>修改时间:
  56 + */
  57 + @RequestMapping(value = "/list", method = { RequestMethod.GET, RequestMethod.POST })
  58 + @ResponseBody
  59 + public Map<String, Object> list() {
  60 + Page<SysOrganizations> page = getPage();
  61 + EntityWrapper<SysOrganizations> ew = new EntityWrapper<SysOrganizations>();
  62 + ew.where("ifDel=0");
  63 + page = organService.selectPage(page, ew);
  64 + return toGridData(page);
  65 + }
  66 +
  67 + /**
  68 + * <li>@Description:跳转到添加编辑页面
  69 + * <li>
  70 + * <li>创建人:maliang
  71 + * <li>创建时间:2017年3月8日
  72 + * <li>修改人:
  73 + * <li>修改时间:
  74 + */
  75 + @RequestMapping(value = "/toEdit", method = { RequestMethod.GET })
  76 + public String toEdit(String orgId, Model model) {
  77 + SysOrganizations org = organService.selectById(orgId);
  78 + model.addAttribute("org", org);
  79 + return "/organ/org_edit";
  80 + }
  81 +
  82 + /**
  83 + * <li>@Description:修改机构信息
  84 + * <li>@param organizations
  85 + * <li>@param ajaxResult
  86 + * <li>@return
  87 + * <li>创建人:maliang
  88 + * <li>创建时间:2017年3月8日
  89 + * <li>修改人:
  90 + * <li>修改时间:
  91 + */
  92 + @ResponseBody
  93 + @RequestMapping(value = "/update", method = { RequestMethod.POST })
  94 + public AjaxResult edit(SysOrganizations organizations, AjaxResult ajaxResult) {
  95 + boolean tag = organService.updateOrg(organizations);
  96 + return handleAjaxResult(ajaxResult, tag, OperationName.UPDATE);
  97 + }
  98 +
  99 + /**
  100 + * <li>@Description:添加机构信息
  101 + * <li>@param organizations
  102 + * <li>@param ajaxResult
  103 + * <li>@return
  104 + * <li>创建人:maliang
  105 + * <li>创建时间:2017年3月8日
  106 + * <li>修改人:
  107 + * <li>修改时间:
  108 + */
  109 + @ResponseBody
  110 + @RequestMapping(value = "/create", method = { RequestMethod.POST })
  111 + public AjaxResult add(SysOrganizations organizations, AjaxResult ajaxResult) {
  112 + boolean tag = organService.addOrg(organizations);
  113 + return handleAjaxResult(ajaxResult, tag, OperationName.CREATE);
  114 + }
  115 +
  116 + @RequestMapping(value = "/{id}/delete", method = { RequestMethod.GET, RequestMethod.POST })
  117 + @ResponseBody
  118 + public AjaxResult delete(@PathVariable String id, AjaxResult ajaxResult) {
  119 + boolean tag = organService.deleteById(id);
  120 + return handleAjaxResult(ajaxResult, tag, OperationName.DELETE);
  121 + }
  122 +
  123 +}
center.manager/src/main/java/com/lyms/cm/controller/sys/SysRegionsController.java View file @ 5701e4b
  1 +package com.lyms.cm.controller.sys;
  2 +
  3 +import java.util.List;
  4 +
  5 +import org.springframework.beans.factory.annotation.Autowired;
  6 +import org.springframework.web.bind.annotation.RequestMapping;
  7 +import org.springframework.web.bind.annotation.RequestMethod;
  8 +import org.springframework.web.bind.annotation.RestController;
  9 +
  10 +import com.baomidou.mybatisplus.plugins.Page;
  11 +import com.lyms.cm.entity.sys.SysRegions;
  12 +import com.lyms.cm.service.sys.SysRegionsService;
  13 +import com.lyms.web.controller.BaseController;
  14 +
  15 +/**
  16 + * <p>
  17 + * 省市区地址表 前端控制器
  18 + * </p>
  19 + *
  20 + * @author maliang
  21 + * @since 2017-03-08
  22 + */
  23 +@RestController
  24 +@RequestMapping("/sysRegions")
  25 +public class SysRegionsController extends BaseController {
  26 +
  27 + @Autowired
  28 + private SysRegionsService regionService;
  29 +
  30 + /**
  31 + * <li>@Description:获取区域信息
  32 + * <li>@return
  33 + * <li>创建人:maliang
  34 + * <li>创建时间:2017年3月8日
  35 + * <li>修改人:
  36 + * <li>修改时间:
  37 + *
  38 + * @return
  39 + */
  40 + @RequestMapping(value = "/find", method = RequestMethod.GET)
  41 + public Page<SysRegions> findRegions(String id) {
  42 + Page<SysRegions> page = getPage();
  43 + page.setSize(Integer.MAX_VALUE);
  44 + List<SysRegions> regions = regionService.selectRegions(id);
  45 + page.setRecords(regions);
  46 + return page;
  47 + }
  48 +
  49 +}
center.manager/src/main/java/com/lyms/cm/controller/sys/SysRolesController.java View file @ 5701e4b
... ... @@ -20,7 +20,7 @@
20 20  
21 21 /**
22 22 * <p>
23   - * 角色表 前端控制器
  23 + * 角色表 前端控制器
24 24 * </p>
25 25 *
26 26 * @author maliang
27 27  
28 28  
29 29  
30 30  
31 31  
... ... @@ -30,75 +30,75 @@
30 30 @RequestMapping("/sysRoles")
31 31 public class SysRolesController extends BaseController {
32 32  
33   - @Autowired
34   - private SysRolesService sysRolesService;
  33 + @Autowired
  34 + private SysRolesService sysRolesService;
35 35  
36   - @RequestMapping("/toList")
37   - public String list() {
38   - return "/role/role_list";
39   - }
  36 + @RequestMapping("/toList")
  37 + public String list() {
  38 + return "/role/role_list";
  39 + }
40 40  
41   - @RequestMapping(value = "/getRoleList", method = { RequestMethod.POST })
42   - @ResponseBody
43   - public java.util.Map<String, Object> getRoleList() {
44   - Page<SysRoles> page = getPage();
45   - EntityWrapper<SysRoles> ew = new EntityWrapper<SysRoles>();
46   - ew.where("ifDel=0");
47   - return toGridData(sysRolesService.selectPage(page,ew));
48   - }
  41 + @RequestMapping(value = "/getRoleList", method = { RequestMethod.POST })
  42 + @ResponseBody
  43 + public java.util.Map<String, Object> getRoleList() {
  44 + Page<SysRoles> page = getPage();
  45 + EntityWrapper<SysRoles> ew = new EntityWrapper<SysRoles>();
  46 + ew.where("ifDel=0");
  47 + return toGridData(sysRolesService.selectPage(page, ew));
  48 + }
49 49  
50   - /**
51   - * 跳转到编辑页面
52   - *
53   - * @return
54   - */
55   - @RequestMapping(value = { "/{id}/toEdit" }, method = RequestMethod.GET)
56   - public String toEdit(@PathVariable String id, Model model) {
57   - if (!StringUtils.isBlank(id) && !"0".equals(id)) {
58   - SysRoles role = sysRolesService.selectById(id);
59   - model.addAttribute("role", role);
60   - }
61   - return "/role/role_edit";
62   - }
63   -
64   - /**
65   - * 创建用户
66   - * <p>
67   - * TODO
68   - *
69   - * @param user
70   - * @return
71   - */
72   - @RequestMapping(value = "/create", method = RequestMethod.POST)
73   - @ResponseBody
74   - public AjaxResult create(SysRoles role, AjaxResult ajaxResult) {
75   - role.setId(StrUtils.uuid());
76   - role.setIfdel(0);
77   - boolean tag = sysRolesService.insert(role);
78   - return handleAjaxResult(ajaxResult, tag, OperationName.CREATE);
79   - }
  50 + /**
  51 + * 跳转到编辑页面
  52 + *
  53 + * @return
  54 + */
  55 + @RequestMapping(value = { "/{id}/toEdit" }, method = RequestMethod.GET)
  56 + public String toEdit(@PathVariable String id, Model model) {
  57 + if (!StringUtils.isBlank(id) && !"0".equals(id)) {
  58 + SysRoles role = sysRolesService.selectById(id);
  59 + model.addAttribute("role", role);
  60 + }
  61 + return "/role/role_edit";
  62 + }
80 63  
81   - /**
82   - * 修改信息
83   - */
84   - @RequestMapping(value = "/update", method = { RequestMethod.POST })
85   - @ResponseBody
86   - public AjaxResult update(SysRoles role, AjaxResult ajaxResult) {
87   - boolean tag = sysRolesService.updateById(role);
88   - return handleAjaxResult(ajaxResult, tag, OperationName.UPDATE);
89   - }
  64 + /**
  65 + * 创建用户
  66 + * <p>
  67 + * TODO
  68 + *
  69 + * @param user
  70 + * @return
  71 + */
  72 + @RequestMapping(value = "/create", method = RequestMethod.POST)
  73 + @ResponseBody
  74 + public AjaxResult create(SysRoles role, AjaxResult ajaxResult) {
  75 + role.setId(StrUtils.uuid());
  76 + role.setIfdel(0);
  77 + boolean tag = sysRolesService.insert(role);
  78 + return handleAjaxResult(ajaxResult, tag, OperationName.CREATE);
  79 + }
90 80  
91   - /**
92   - * 删除用户
93   - *
94   - * @return
95   - */
96   - @RequestMapping(value = "/{id}/delete", method = { RequestMethod.GET, RequestMethod.POST })
97   - @ResponseBody
98   - public AjaxResult delete(@PathVariable String id, AjaxResult ajaxResult) {
99   - int tag = sysRolesService.deleteLogicById(id);
100   - return handleAjaxResult(ajaxResult, tag, OperationName.DELETE);
101   - }
  81 + /**
  82 + * 修改信息
  83 + */
  84 + @RequestMapping(value = "/update", method = { RequestMethod.POST })
  85 + @ResponseBody
  86 + public AjaxResult update(SysRoles role, AjaxResult ajaxResult) {
  87 + boolean tag = sysRolesService.updateById(role);
  88 + return handleAjaxResult(ajaxResult, tag, OperationName.UPDATE);
  89 + }
  90 +
  91 + /**
  92 + * 删除用户
  93 + *
  94 + * @return
  95 + */
  96 + @RequestMapping(value = "/{id}/delete", method = { RequestMethod.GET, RequestMethod.POST })
  97 + @ResponseBody
  98 + public AjaxResult delete(@PathVariable String id, AjaxResult ajaxResult) {
  99 + int tag = sysRolesService.deleteLogicById(id);
  100 + return handleAjaxResult(ajaxResult, tag, OperationName.DELETE);
  101 + }
102 102  
103 103 }
center.manager/src/main/java/com/lyms/cm/controller/sys/SysUsersController.java View file @ 5701e4b
... ... @@ -71,8 +71,8 @@
71 71 public Map<String, Object> list(Model model) {
72 72 Page<SysUsers> page = getPage();
73 73 EntityWrapper<SysUsers> ew = new EntityWrapper<SysUsers>();
74   - ew.where("ifDel=0");
75   - page = userService.selectPage(page,ew);
  74 + ew.where("ifDel=0");
  75 + page = userService.selectPage(page, ew);
76 76 return toGridData(page);
77 77 }
78 78  
center.manager/src/main/java/com/lyms/cm/dao/sys/SysDepartmentsMapper.java View file @ 5701e4b
  1 +package com.lyms.cm.dao.sys;
  2 +
  3 +import com.lyms.cm.entity.sys.SysDepartments;
  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 maliang
  13 + * @since 2017-03-08
  14 + */
  15 +@Repository
  16 +public interface SysDepartmentsMapper extends BaseMapper<SysDepartments> {
  17 +
  18 + public Integer deleteLogicById(Serializable id);
  19 +
  20 +}
center.manager/src/main/java/com/lyms/cm/dao/sys/SysDepartmentsMapper.xml View file @ 5701e4b
  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.cm.dao.sys.SysDepartmentsMapper">
  4 +
  5 + <!-- 通用查询映射结果 -->
  6 + <resultMap id="BaseResultMap" type="com.lyms.cm.entity.sys.SysDepartments">
  7 + <result column="ID" property="id" />
  8 + <result column="PARENT_ID" property="parentId" />
  9 + <result column="NAME" property="name" />
  10 + <result column="ORG_ID" property="orgId" />
  11 + <result column="DESCRIPTION" property="description" />
  12 + <result column="PUBLISH_ID" property="publishId" />
  13 + <result column="IFDEL" property="ifdel" />
  14 + <result column="MODIFIED" property="modified" />
  15 + <result column="CREATED" property="created" />
  16 + <result column="SHORT_CODE" property="shortCode" />
  17 + <result column="FOREIGN_ID" property="foreignId" />
  18 + </resultMap>
  19 +
  20 + <!-- 通用查询结果列 -->
  21 + <sql id="Base_Column_List">
  22 + ID AS id, PARENT_ID AS parentId, NAME AS name, ORG_ID AS orgId, DESCRIPTION AS description, PUBLISH_ID AS publishId, IFDEL AS ifdel, MODIFIED AS modified, CREATED AS created, SHORT_CODE AS shortCode, FOREIGN_ID AS foreignId
  23 + </sql>
  24 +</mapper>
center.manager/src/main/java/com/lyms/cm/dao/sys/SysOrganizationsMapper.java View file @ 5701e4b
  1 +package com.lyms.cm.dao.sys;
  2 +
  3 +import com.lyms.cm.entity.sys.SysOrganizations;
  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 maliang
  13 + * @since 2017-03-08
  14 + */
  15 +@Repository
  16 +public interface SysOrganizationsMapper extends BaseMapper<SysOrganizations> {
  17 +
  18 + public Integer deleteLogicById(Serializable id);
  19 +
  20 +}
center.manager/src/main/java/com/lyms/cm/dao/sys/SysOrganizationsMapper.xml View file @ 5701e4b
  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.cm.dao.sys.SysOrganizationsMapper">
  4 +
  5 + <!-- 通用查询映射结果 -->
  6 + <resultMap id="BaseResultMap" type="com.lyms.cm.entity.sys.SysOrganizations">
  7 + <id column="ID" property="id" />
  8 + <result column="NAME" property="name" />
  9 + <result column="TYPE" property="type" />
  10 + <result column="LEVEL" property="level" />
  11 + <result column="PROVINCE_ID" property="provinceId" />
  12 + <result column="CITY_ID" property="cityId" />
  13 + <result column="AREA_ID" property="areaId" />
  14 + <result column="ADDRESS" property="address" />
  15 + <result column="DESCRIPTION" property="description" />
  16 + <result column="PUBLISH_ID" property="publishId" />
  17 + <result column="IFDEL" property="ifdel" />
  18 + <result column="MODIFIED" property="modified" />
  19 + <result column="CREATED" property="created" />
  20 + <result column="FOREIGN_ID" property="foreignId" />
  21 + <result column="STREET_ID" property="streetId" />
  22 + <result column="STATUS" property="status" />
  23 + <result column="SHORT_CODE" property="shortCode" />
  24 + <result column="LAT" property="lat" />
  25 + <result column="LNG" property="lng" />
  26 + <result column="LOGO" property="logo" />
  27 + <result column="IMAGE" property="image" />
  28 + <result column="GRADE_LEVEL" property="gradeLevel" />
  29 + <result column="STAR_LEVEL" property="starLevel" />
  30 + <result column="MOBILE" property="mobile" />
  31 + </resultMap>
  32 +
  33 + <!-- 通用查询结果列 -->
  34 + <sql id="Base_Column_List">
  35 + ID AS id, NAME AS name, TYPE AS type, LEVEL AS level, PROVINCE_ID AS provinceId, CITY_ID AS cityId, AREA_ID AS areaId, ADDRESS AS address, DESCRIPTION AS description, PUBLISH_ID AS publishId, IFDEL AS ifdel, MODIFIED AS modified, CREATED AS created, FOREIGN_ID AS foreignId, STREET_ID AS streetId, STATUS AS status, SHORT_CODE AS shortCode, LAT AS lat, LNG AS lng, LOGO AS logo, IMAGE AS image, GRADE_LEVEL AS gradeLevel, STAR_LEVEL AS starLevel, MOBILE AS mobile
  36 + </sql>
  37 +</mapper>
center.manager/src/main/java/com/lyms/cm/dao/sys/SysRegionsMapper.java View file @ 5701e4b
  1 +package com.lyms.cm.dao.sys;
  2 +
  3 +import java.io.Serializable;
  4 +/**
  5 + * <p>
  6 + * Mapper接口
  7 + * </p>
  8 + *
  9 + * @author maliang
  10 + * @since 2017-03-08
  11 + */
  12 +import java.util.List;
  13 +
  14 +import org.apache.ibatis.annotations.Param;
  15 +import org.springframework.stereotype.Repository;
  16 +
  17 +import com.baomidou.mybatisplus.mapper.BaseMapper;
  18 +import com.lyms.cm.entity.sys.SysRegions;
  19 +
  20 +@Repository
  21 +public interface SysRegionsMapper extends BaseMapper<SysRegions> {
  22 +
  23 + public Integer deleteLogicById(Serializable id);
  24 +
  25 + /**
  26 + * <li>@Description:获取父/子级Region
  27 + * <li>@param id
  28 + * <li>@return
  29 + * <li>创建人:maliang
  30 + * <li>创建时间:2017年3月8日
  31 + * <li>修改人:
  32 + * <li>修改时间:
  33 + */
  34 + public List<SysRegions> selectRegionsById(@Param("id") Serializable id);
  35 +
  36 +}
center.manager/src/main/java/com/lyms/cm/dao/sys/SysRegionsMapper.xml View file @ 5701e4b
  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.cm.dao.sys.SysRegionsMapper">
  4 +
  5 + <!-- 通用查询映射结果 -->
  6 + <resultMap id="BaseResultMap" type="com.lyms.cm.entity.sys.SysRegions">
  7 + <result column="ID" property="id" />
  8 + <result column="PARENT_ID" property="parentId" />
  9 + <result column="NAME" property="name" />
  10 + <result column="ENABLE" property="enable" />
  11 + <result column="IFDEL" property="ifdel" />
  12 + <result column="CODE" property="code" />
  13 + <result column="MODIFIE" property="modifie" />
  14 + <result column="CREATED" property="created" />
  15 + <result column="FOREIGN_ID" property="foreignId" />
  16 + </resultMap>
  17 +
  18 + <sql id="Base_table">
  19 + SYS_REGIONS
  20 + </sql>
  21 + <!-- 通用查询结果列 -->
  22 + <sql id="Base_Column_List">
  23 + ID AS id, PARENT_ID AS parentId, NAME AS name, ENABLE AS enable, IFDEL AS ifdel, CODE AS code, MODIFIE AS modifie, CREATED AS created, FOREIGN_ID AS foreignId
  24 + </sql>
  25 +
  26 + <!-- 根据条件查询区域 -->
  27 + <select id="selectRegionsById" resultMap="BaseResultMap" flushCache="true" parameterType="String">
  28 + select <include refid="Base_Column_List" /> from <include refid="Base_table" /> as re
  29 + <where>
  30 + re.PARENT_ID=#{id}
  31 + </where>
  32 + </select>
  33 +
  34 +</mapper>
center.manager/src/main/java/com/lyms/cm/entity/sys/SysDepartments.java View file @ 5701e4b
  1 +package com.lyms.cm.entity.sys;
  2 +
  3 +import java.io.Serializable;
  4 +import java.util.Date;
  5 +
  6 +import com.baomidou.mybatisplus.annotations.TableField;
  7 +import com.baomidou.mybatisplus.annotations.TableName;
  8 +
  9 +/**
  10 + * <p>
  11 + * 部门 科室表
  12 + * </p>
  13 + *
  14 + * @author maliang
  15 + * @since 2017-03-08
  16 + */
  17 +@TableName("SYS_DEPARTMENTS")
  18 +public class SysDepartments implements Serializable {
  19 +
  20 + private static final long serialVersionUID = 1L;
  21 +
  22 + /**
  23 + *
  24 + */
  25 + @TableField(value = "ID")
  26 + private String id;
  27 + /**
  28 + * 上级部门,0为root
  29 + */
  30 + @TableField(value = "PARENT_ID")
  31 + private String parentId;
  32 + /**
  33 + *
  34 + */
  35 + @TableField(value = "NAME")
  36 + private String name;
  37 + /**
  38 + * 机构id
  39 + */
  40 + @TableField(value = "ORG_ID")
  41 + private String orgId;
  42 + /**
  43 + *
  44 + */
  45 + @TableField(value = "DESCRIPTION")
  46 + private String description;
  47 + /**
  48 + *
  49 + */
  50 + @TableField(value = "PUBLISH_ID")
  51 + private String publishId;
  52 + /**
  53 + *
  54 + */
  55 + @TableField(value = "IFDEL")
  56 + private Integer ifdel;
  57 + /**
  58 + *
  59 + */
  60 + @TableField(value = "MODIFIED")
  61 + private Date modified;
  62 + /**
  63 + *
  64 + */
  65 + @TableField(value = "CREATED")
  66 + private Date created;
  67 + /**
  68 + * 简码
  69 + */
  70 + @TableField(value = "SHORT_CODE")
  71 + private String shortCode;
  72 + /**
  73 + *
  74 + */
  75 + @TableField(value = "FOREIGN_ID")
  76 + private String foreignId;
  77 +
  78 + public String getId() {
  79 + return id;
  80 + }
  81 +
  82 + public void setId(String id) {
  83 + this.id = id;
  84 + }
  85 +
  86 + public String getParentId() {
  87 + return parentId;
  88 + }
  89 +
  90 + public void setParentId(String parentId) {
  91 + this.parentId = parentId;
  92 + }
  93 +
  94 + public String getName() {
  95 + return name;
  96 + }
  97 +
  98 + public void setName(String name) {
  99 + this.name = name;
  100 + }
  101 +
  102 + public String getOrgId() {
  103 + return orgId;
  104 + }
  105 +
  106 + public void setOrgId(String orgId) {
  107 + this.orgId = orgId;
  108 + }
  109 +
  110 + public String getDescription() {
  111 + return description;
  112 + }
  113 +
  114 + public void setDescription(String description) {
  115 + this.description = description;
  116 + }
  117 +
  118 + public String getPublishId() {
  119 + return publishId;
  120 + }
  121 +
  122 + public void setPublishId(String publishId) {
  123 + this.publishId = publishId;
  124 + }
  125 +
  126 + public Integer getIfdel() {
  127 + return ifdel;
  128 + }
  129 +
  130 + public void setIfdel(Integer ifdel) {
  131 + this.ifdel = ifdel;
  132 + }
  133 +
  134 + public Date getModified() {
  135 + return modified;
  136 + }
  137 +
  138 + public void setModified(Date modified) {
  139 + this.modified = modified;
  140 + }
  141 +
  142 + public Date getCreated() {
  143 + return created;
  144 + }
  145 +
  146 + public void setCreated(Date created) {
  147 + this.created = created;
  148 + }
  149 +
  150 + public String getShortCode() {
  151 + return shortCode;
  152 + }
  153 +
  154 + public void setShortCode(String shortCode) {
  155 + this.shortCode = shortCode;
  156 + }
  157 +
  158 + public String getForeignId() {
  159 + return foreignId;
  160 + }
  161 +
  162 + public void setForeignId(String foreignId) {
  163 + this.foreignId = foreignId;
  164 + }
  165 +
  166 +}
center.manager/src/main/java/com/lyms/cm/entity/sys/SysOrganizations.java View file @ 5701e4b
  1 +package com.lyms.cm.entity.sys;
  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 maliang
  15 + * @since 2017-03-08
  16 + */
  17 +@TableName("SYS_ORGANIZATIONS")
  18 +public class SysOrganizations 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="NAME")
  31 + private String name;
  32 + /**
  33 + * 1:卫生与计划生育委员会,2:妇幼保健院/站,3:妇产(科)医院,4:综合医院,5:计生站,6:卫生院,7:卫生所,8:其他
  34 + */
  35 + @TableField(value="TYPE")
  36 + private Integer type;
  37 + /**
  38 + * 1省,2市,3区县,4乡镇,5村,6其他
  39 + */
  40 + @TableField(value="LEVEL")
  41 + private Integer level;
  42 + /**
  43 + * 省ID
  44 + */
  45 + @TableField(value="PROVINCE_ID")
  46 + private String provinceId;
  47 + /**
  48 + * 城市ID
  49 + */
  50 + @TableField(value="CITY_ID")
  51 + private String cityId;
  52 + /**
  53 + * 区县ID
  54 + */
  55 + @TableField(value="AREA_ID")
  56 + private String areaId;
  57 + /**
  58 + * 街道地址
  59 + */
  60 + @TableField(value="ADDRESS")
  61 + private String address;
  62 + /**
  63 + * 简介
  64 + */
  65 + @TableField(value="DESCRIPTION")
  66 + private String description;
  67 + /**
  68 + * 发布人ID
  69 + */
  70 + @TableField(value="PUBLISH_ID")
  71 + private String publishId;
  72 + /**
  73 + * 1:有效,2:无效
  74 + */
  75 + @TableField(value="IFDEL")
  76 + private Integer ifdel;
  77 + /**
  78 + * 最后修改时间
  79 + */
  80 + @TableField(value="MODIFIED")
  81 + private Date modified;
  82 + /**
  83 + * 创建时间
  84 + */
  85 + @TableField(value="CREATED")
  86 + private Date created;
  87 + /**
  88 + *
  89 + */
  90 + @TableField(value="FOREIGN_ID")
  91 + private String foreignId;
  92 + /**
  93 + *
  94 + */
  95 + @TableField(value="STREET_ID")
  96 + private String streetId;
  97 + /**
  98 + * 0,"正式运行" 1,"试运行" 2,"停止运行"
  99 + */
  100 + @TableField(value="STATUS")
  101 + private Integer status;
  102 + /**
  103 + * 简码
  104 + */
  105 + @TableField(value="SHORT_CODE")
  106 + private String shortCode;
  107 + /**
  108 + * 经度
  109 + */
  110 + @TableField(value="LAT")
  111 + private Double lat;
  112 + /**
  113 + * '纬度
  114 + */
  115 + @TableField(value="LNG")
  116 + private Double lng;
  117 + /**
  118 + *
  119 + */
  120 + @TableField(value="LOGO")
  121 + private String logo;
  122 + /**
  123 + *
  124 + */
  125 + @TableField(value="IMAGE")
  126 + private String image;
  127 + /**
  128 + * 医院等级
  129 + */
  130 + @TableField(value="GRADE_LEVEL")
  131 + private Integer gradeLevel;
  132 + /**
  133 + * 星级
  134 + */
  135 + @TableField(value="STAR_LEVEL")
  136 + private Integer starLevel;
  137 + /**
  138 + * 服务热线
  139 + */
  140 + @TableField(value="MOBILE")
  141 + private String mobile;
  142 +
  143 +
  144 + public String getId() {
  145 + return id;
  146 + }
  147 +
  148 + public void setId(String id) {
  149 + this.id = id;
  150 + }
  151 +
  152 + public String getName() {
  153 + return name;
  154 + }
  155 +
  156 + public void setName(String name) {
  157 + this.name = name;
  158 + }
  159 +
  160 + public Integer getType() {
  161 + return type;
  162 + }
  163 +
  164 + public void setType(Integer type) {
  165 + this.type = type;
  166 + }
  167 +
  168 + public Integer getLevel() {
  169 + return level;
  170 + }
  171 +
  172 + public void setLevel(Integer level) {
  173 + this.level = level;
  174 + }
  175 +
  176 + public String getProvinceId() {
  177 + return provinceId;
  178 + }
  179 +
  180 + public void setProvinceId(String provinceId) {
  181 + this.provinceId = provinceId;
  182 + }
  183 +
  184 + public String getCityId() {
  185 + return cityId;
  186 + }
  187 +
  188 + public void setCityId(String cityId) {
  189 + this.cityId = cityId;
  190 + }
  191 +
  192 + public String getAreaId() {
  193 + return areaId;
  194 + }
  195 +
  196 + public void setAreaId(String areaId) {
  197 + this.areaId = areaId;
  198 + }
  199 +
  200 + public String getAddress() {
  201 + return address;
  202 + }
  203 +
  204 + public void setAddress(String address) {
  205 + this.address = address;
  206 + }
  207 +
  208 + public String getDescription() {
  209 + return description;
  210 + }
  211 +
  212 + public void setDescription(String description) {
  213 + this.description = description;
  214 + }
  215 +
  216 + public String getPublishId() {
  217 + return publishId;
  218 + }
  219 +
  220 + public void setPublishId(String publishId) {
  221 + this.publishId = publishId;
  222 + }
  223 +
  224 + public Integer getIfdel() {
  225 + return ifdel;
  226 + }
  227 +
  228 + public void setIfdel(Integer ifdel) {
  229 + this.ifdel = ifdel;
  230 + }
  231 +
  232 + public Date getModified() {
  233 + return modified;
  234 + }
  235 +
  236 + public void setModified(Date modified) {
  237 + this.modified = modified;
  238 + }
  239 +
  240 + public Date getCreated() {
  241 + return created;
  242 + }
  243 +
  244 + public void setCreated(Date created) {
  245 + this.created = created;
  246 + }
  247 +
  248 + public String getForeignId() {
  249 + return foreignId;
  250 + }
  251 +
  252 + public void setForeignId(String foreignId) {
  253 + this.foreignId = foreignId;
  254 + }
  255 +
  256 + public String getStreetId() {
  257 + return streetId;
  258 + }
  259 +
  260 + public void setStreetId(String streetId) {
  261 + this.streetId = streetId;
  262 + }
  263 +
  264 + public Integer getStatus() {
  265 + return status;
  266 + }
  267 +
  268 + public void setStatus(Integer status) {
  269 + this.status = status;
  270 + }
  271 +
  272 + public String getShortCode() {
  273 + return shortCode;
  274 + }
  275 +
  276 + public void setShortCode(String shortCode) {
  277 + this.shortCode = shortCode;
  278 + }
  279 +
  280 + public Double getLat() {
  281 + return lat;
  282 + }
  283 +
  284 + public void setLat(Double lat) {
  285 + this.lat = lat;
  286 + }
  287 +
  288 + public Double getLng() {
  289 + return lng;
  290 + }
  291 +
  292 + public void setLng(Double lng) {
  293 + this.lng = lng;
  294 + }
  295 +
  296 + public String getLogo() {
  297 + return logo;
  298 + }
  299 +
  300 + public void setLogo(String logo) {
  301 + this.logo = logo;
  302 + }
  303 +
  304 + public String getImage() {
  305 + return image;
  306 + }
  307 +
  308 + public void setImage(String image) {
  309 + this.image = image;
  310 + }
  311 +
  312 + public Integer getGradeLevel() {
  313 + return gradeLevel;
  314 + }
  315 +
  316 + public void setGradeLevel(Integer gradeLevel) {
  317 + this.gradeLevel = gradeLevel;
  318 + }
  319 +
  320 + public Integer getStarLevel() {
  321 + return starLevel;
  322 + }
  323 +
  324 + public void setStarLevel(Integer starLevel) {
  325 + this.starLevel = starLevel;
  326 + }
  327 +
  328 + public String getMobile() {
  329 + return mobile;
  330 + }
  331 +
  332 + public void setMobile(String mobile) {
  333 + this.mobile = mobile;
  334 + }
  335 +
  336 +}
center.manager/src/main/java/com/lyms/cm/entity/sys/SysRegions.java View file @ 5701e4b
  1 +package com.lyms.cm.entity.sys;
  2 +
  3 +import java.io.Serializable;
  4 +import java.util.Date;
  5 +
  6 +import com.baomidou.mybatisplus.annotations.TableField;
  7 +import com.baomidou.mybatisplus.annotations.TableName;
  8 +
  9 +/**
  10 + * <p>
  11 + * 省市区地址表
  12 + * </p>
  13 + *
  14 + * @author maliang
  15 + * @since 2017-03-08
  16 + */
  17 +@TableName("SYS_REGIONS")
  18 +public class SysRegions implements Serializable {
  19 +
  20 + private static final long serialVersionUID = 1L;
  21 +
  22 + /**
  23 + *
  24 + */
  25 + @TableField(value = "ID")
  26 + private String id;
  27 + /**
  28 + *
  29 + */
  30 + @TableField(value = "PARENT_ID")
  31 + private String parentId;
  32 + /**
  33 + *
  34 + */
  35 + @TableField(value = "NAME")
  36 + private String name;
  37 + /**
  38 + *
  39 + */
  40 + @TableField(value = "ENABLE")
  41 + private Integer enable;
  42 + /**
  43 + *
  44 + */
  45 + @TableField(value = "IFDEL")
  46 + private Integer ifdel;
  47 + /**
  48 + *
  49 + */
  50 + @TableField(value = "CODE")
  51 + private String code;
  52 + /**
  53 + *
  54 + */
  55 + @TableField(value = "MODIFIE")
  56 + private Date modifie;
  57 + /**
  58 + *
  59 + */
  60 + @TableField(value = "CREATED")
  61 + private Date created;
  62 + /**
  63 + *
  64 + */
  65 + @TableField(value = "FOREIGN_ID")
  66 + private String foreignId;
  67 +
  68 + public String getId() {
  69 + return id;
  70 + }
  71 +
  72 + public void setId(String id) {
  73 + this.id = id;
  74 + }
  75 +
  76 + public String getParentId() {
  77 + return parentId;
  78 + }
  79 +
  80 + public void setParentId(String parentId) {
  81 + this.parentId = parentId;
  82 + }
  83 +
  84 + public String getName() {
  85 + return name;
  86 + }
  87 +
  88 + public void setName(String name) {
  89 + this.name = name;
  90 + }
  91 +
  92 + public Integer getEnable() {
  93 + return enable;
  94 + }
  95 +
  96 + public void setEnable(Integer enable) {
  97 + this.enable = enable;
  98 + }
  99 +
  100 + public Integer getIfdel() {
  101 + return ifdel;
  102 + }
  103 +
  104 + public void setIfdel(Integer ifdel) {
  105 + this.ifdel = ifdel;
  106 + }
  107 +
  108 + public String getCode() {
  109 + return code;
  110 + }
  111 +
  112 + public void setCode(String code) {
  113 + this.code = code;
  114 + }
  115 +
  116 + public Date getModifie() {
  117 + return modifie;
  118 + }
  119 +
  120 + public void setModifie(Date modifie) {
  121 + this.modifie = modifie;
  122 + }
  123 +
  124 + public Date getCreated() {
  125 + return created;
  126 + }
  127 +
  128 + public void setCreated(Date created) {
  129 + this.created = created;
  130 + }
  131 +
  132 + public String getForeignId() {
  133 + return foreignId;
  134 + }
  135 +
  136 + public void setForeignId(String foreignId) {
  137 + this.foreignId = foreignId;
  138 + }
  139 +
  140 +}
center.manager/src/main/java/com/lyms/cm/service/sys/SysDepartmentsService.java View file @ 5701e4b
  1 +package com.lyms.cm.service.sys;
  2 +
  3 +import com.lyms.cm.entity.sys.SysDepartments;
  4 +import com.lyms.web.service.BaseService;
  5 +import java.io.Serializable;
  6 +
  7 +/**
  8 + * <p>
  9 + * 服务类
  10 + * </p>
  11 + *
  12 + * @author maliang
  13 + * @since 2017-03-08
  14 + */
  15 +public interface SysDepartmentsService extends BaseService<SysDepartments> {
  16 +
  17 + /**
  18 + * <li>@Description:逻辑删除,ifDel = 1 为删除,否则为没有删除
  19 + * <li>@param id 删除主键id
  20 + * <li>@return 大于0修改成功,否则为失败
  21 + */
  22 + public Integer deleteLogicById(Serializable id);
  23 +
  24 +}
center.manager/src/main/java/com/lyms/cm/service/sys/SysOrganizationsService.java View file @ 5701e4b
  1 +package com.lyms.cm.service.sys;
  2 +
  3 +import java.io.Serializable;
  4 +
  5 +import com.lyms.cm.entity.sys.SysOrganizations;
  6 +import com.lyms.exception.SystemException;
  7 +import com.lyms.web.service.BaseService;
  8 +
  9 +/**
  10 + * <p>
  11 + * 服务类
  12 + * </p>
  13 + *
  14 + * @author maliang
  15 + * @since 2017-03-08
  16 + */
  17 +public interface SysOrganizationsService extends BaseService<SysOrganizations> {
  18 +
  19 + /**
  20 + * <li>@Description:逻辑删除,ifDel = 1 为删除,否则为没有删除
  21 + * <li>@param id 删除主键id
  22 + * <li>@return 大于0修改成功,否则为失败
  23 + */
  24 + public Integer deleteLogicById(Serializable id);
  25 +
  26 + /**
  27 + * <li>@Description:添加机构信息
  28 + * <li>@param organizations
  29 + * <li>@return
  30 + * <li>@throws SystemException
  31 + * <li>创建人:maliang
  32 + * <li>创建时间:2017年3月8日
  33 + * <li>修改人:
  34 + * <li>修改时间:
  35 + */
  36 + public boolean addOrg(SysOrganizations organizations) throws SystemException;
  37 +
  38 + /**
  39 + * 修改机构信息
  40 + * <li>@Description:TODO(方法描述)
  41 + * <li>@param organizations
  42 + * <li>@return
  43 + * <li>@throws SystemException
  44 + * <li>创建人:maliang
  45 + * <li>创建时间:2017年3月8日
  46 + * <li>修改人:
  47 + * <li>修改时间:
  48 + */
  49 + public boolean updateOrg(SysOrganizations organizations) throws SystemException;
  50 +
  51 + /**
  52 + * <li>@Description:根据ID删除
  53 + * <li>@param id
  54 + * <li>@return
  55 + * <li>@throws SystemException
  56 + * <li>创建人:maliang
  57 + * <li>创建时间:2017年3月8日
  58 + * <li>修改人:
  59 + * <li>修改时间:
  60 + */
  61 + public boolean deleteById(String id) throws SystemException;
  62 +
  63 +}
center.manager/src/main/java/com/lyms/cm/service/sys/SysRegionsService.java View file @ 5701e4b
  1 +package com.lyms.cm.service.sys;
  2 +
  3 +import java.io.Serializable;
  4 +import java.util.List;
  5 +
  6 +import com.lyms.cm.entity.sys.SysRegions;
  7 +import com.lyms.web.service.BaseService;
  8 +
  9 +/**
  10 + * <p>
  11 + * 服务类
  12 + * </p>
  13 + *
  14 + * @author maliang
  15 + * @since 2017-03-08
  16 + */
  17 +public interface SysRegionsService extends BaseService<SysRegions> {
  18 +
  19 + public static final String NOT_PARENT_TAG = "f6c505dd-835a-43d7-b0bb-fdb9eb0b7b31";
  20 +
  21 + /**
  22 + * <li>@Description:逻辑删除,ifDel = 1 为删除,否则为没有删除
  23 + * <li>@param id 删除主键id
  24 + * <li>@return 大于0修改成功,否则为失败
  25 + */
  26 + public Integer deleteLogicById(Serializable id);
  27 +
  28 + /**
  29 + * <li>@Description:获取区域信息
  30 + * <li>@param id id为空,获取所有一级区域,不为空,获取parentId = id 的子区域
  31 + * <li>@return
  32 + * <li>创建人:maliang
  33 + * <li>创建时间:2017年3月8日
  34 + * <li>修改人:
  35 + * <li>修改时间:
  36 + */
  37 + public List<SysRegions> selectRegions(String id);
  38 +
  39 +}
center.manager/src/main/java/com/lyms/cm/service/sys/SysUsersService.java View file @ 5701e4b
... ... @@ -16,60 +16,60 @@
16 16 */
17 17 public interface SysUsersService extends BaseService<SysUsers> {
18 18  
19   - /**
20   - * 添加用户
21   - *
22   - * @param user
23   - * @return
24   - * @author maliang
25   - */
26   - public boolean addUser(SysUsers user) throws SystemException;
  19 + /**
  20 + * 添加用户
  21 + *
  22 + * @param user
  23 + * @return
  24 + * @author maliang
  25 + */
  26 + public boolean addUser(SysUsers user) throws SystemException;
27 27  
28   - /**
29   - * 修改用户信息
30   - *
31   - * @param user
32   - * @return
33   - * @author maliang
34   - */
35   - public boolean updateUser(SysUsers user) throws SystemException;
  28 + /**
  29 + * 修改用户信息
  30 + *
  31 + * @param user
  32 + * @return
  33 + * @author maliang
  34 + */
  35 + public boolean updateUser(SysUsers user) throws SystemException;
36 36  
37   - /**
38   - * 根据ID获取用户信息
39   - *
40   - * @param userId
41   - * @return
42   - * @author maliang
43   - */
44   - // public SysUsers getUserById(String userId) throws SystemException;
  37 + /**
  38 + * 根据ID获取用户信息
  39 + *
  40 + * @param userId
  41 + * @return
  42 + * @author maliang
  43 + */
  44 + // public SysUsers getUserById(String userId) throws SystemException;
45 45  
46   - /**
47   - * 启用/停用
48   - * <p>
49   - * 根据用户ID操作
50   - * <p>
51   - *
52   - * @param userId
53   - * @return
54   - * @author maliang
55   - */
56   - public boolean enabled(String userId) throws SystemException;
  46 + /**
  47 + * 启用/停用
  48 + * <p>
  49 + * 根据用户ID操作
  50 + * <p>
  51 + *
  52 + * @param userId
  53 + * @return
  54 + * @author maliang
  55 + */
  56 + public boolean enabled(String userId) throws SystemException;
57 57  
58   - /**
59   - * 删除用户信息
60   - *
61   - * @param userId
62   - * @return
63   - * @throws SystemException
64   - */
65   - public boolean delete(String userId) throws SystemException;
  58 + /**
  59 + * 删除用户信息
  60 + *
  61 + * @param userId
  62 + * @return
  63 + * @throws SystemException
  64 + */
  65 + public boolean delete(String userId) throws SystemException;
66 66  
67   - /**
68   - * <li>@Description:逻辑删除,ifDel = 1 为删除,否则为没有删除
69   - * <li>@param id 删除主键id
70   - * <li>@return 大于0修改成功,否则为失败
71   - */
72   - public Integer deleteLogicById(Serializable id);
  67 + /**
  68 + * <li>@Description:逻辑删除,ifDel = 1 为删除,否则为没有删除
  69 + * <li>@param id 删除主键id
  70 + * <li>@return 大于0修改成功,否则为失败
  71 + */
  72 + public Integer deleteLogicById(Serializable id);
73 73  
74 74 }
center.manager/src/main/java/com/lyms/cm/service/sys/impl/SysDepartmentsServiceImpl.java View file @ 5701e4b
  1 +package com.lyms.cm.service.sys.impl;
  2 +
  3 +import com.lyms.cm.entity.sys.SysDepartments;
  4 +import com.lyms.cm.dao.sys.SysDepartmentsMapper;
  5 +import com.lyms.cm.service.sys.SysDepartmentsService;
  6 +import com.baomidou.mybatisplus.service.impl.ServiceImpl;
  7 +import org.springframework.stereotype.Service;
  8 +import java.io.Serializable;
  9 +
  10 +/**
  11 + * <p>
  12 + * 部门 科室表 服务实现类
  13 + * </p>
  14 + *
  15 + * @author maliang
  16 + * @since 2017-03-08
  17 + */
  18 +@Service
  19 +public class SysDepartmentsServiceImpl extends ServiceImpl<SysDepartmentsMapper, SysDepartments> implements SysDepartmentsService {
  20 +
  21 + public Integer deleteLogicById(Serializable id){
  22 + return baseMapper.deleteLogicById(id);
  23 + }
  24 +}
center.manager/src/main/java/com/lyms/cm/service/sys/impl/SysOrganizationsServiceImpl.java View file @ 5701e4b
  1 +package com.lyms.cm.service.sys.impl;
  2 +
  3 +import java.io.Serializable;
  4 +
  5 +import org.springframework.stereotype.Service;
  6 +import org.springframework.transaction.annotation.Transactional;
  7 +
  8 +import com.baomidou.mybatisplus.service.impl.ServiceImpl;
  9 +import com.lyms.cm.dao.sys.SysOrganizationsMapper;
  10 +import com.lyms.cm.entity.sys.SysOrganizations;
  11 +import com.lyms.cm.service.sys.SysOrganizationsService;
  12 +import com.lyms.exception.SystemException;
  13 +import com.lyms.util.StrUtils;
  14 +
  15 +/**
  16 + * <p>
  17 + * 机构表 服务实现类
  18 + * </p>
  19 + *
  20 + * @author maliang
  21 + * @since 2017-03-08
  22 + */
  23 +@Service
  24 +public class SysOrganizationsServiceImpl extends ServiceImpl<SysOrganizationsMapper, SysOrganizations>
  25 + implements SysOrganizationsService {
  26 +
  27 + public Integer deleteLogicById(Serializable id) {
  28 + return baseMapper.deleteLogicById(id);
  29 + }
  30 +
  31 + @Override
  32 + @Transactional
  33 + public boolean addOrg(SysOrganizations organizations) throws SystemException {
  34 + if (organizations == null)
  35 + return false;
  36 + organizations.setId(StrUtils.uuid());
  37 + Integer tag = baseMapper.insert(organizations);
  38 + return tag != null && tag >= 1;
  39 + }
  40 +
  41 + @Override
  42 + @Transactional
  43 + public boolean updateOrg(SysOrganizations organizations) throws SystemException {
  44 + if (organizations == null)
  45 + return false;
  46 + Integer tag = baseMapper.updateById(organizations);
  47 + return tag != null && tag >= 1;
  48 + }
  49 +
  50 + @Override
  51 + @Transactional
  52 + public boolean deleteById(String id) throws SystemException {
  53 + Integer tag = baseMapper.deleteLogicById(id);
  54 + return tag != null && tag >= 1;
  55 + }
  56 +
  57 +}
center.manager/src/main/java/com/lyms/cm/service/sys/impl/SysRegionsServiceImpl.java View file @ 5701e4b
  1 +package com.lyms.cm.service.sys.impl;
  2 +
  3 +import java.io.Serializable;
  4 +import java.util.List;
  5 +
  6 +import org.apache.commons.lang3.StringUtils;
  7 +import org.springframework.beans.factory.annotation.Autowired;
  8 +import org.springframework.stereotype.Service;
  9 +
  10 +import com.baomidou.mybatisplus.service.impl.ServiceImpl;
  11 +import com.lyms.cm.dao.sys.SysRegionsMapper;
  12 +import com.lyms.cm.entity.sys.SysRegions;
  13 +import com.lyms.cm.service.sys.SysRegionsService;
  14 +
  15 +/**
  16 + * <p>
  17 + * 省市区地址表 服务实现类
  18 + * </p>
  19 + *
  20 + * @author maliang
  21 + * @since 2017-03-08
  22 + */
  23 +@Service
  24 +public class SysRegionsServiceImpl extends ServiceImpl<SysRegionsMapper, SysRegions> implements SysRegionsService {
  25 +
  26 + @Autowired
  27 + private SysRegionsMapper regionsMapper;
  28 +
  29 + public Integer deleteLogicById(Serializable id) {
  30 + return baseMapper.deleteLogicById(id);
  31 + }
  32 +
  33 + @Override
  34 + public List<SysRegions> selectRegions(String id) {
  35 + if (StringUtils.isBlank(id)) {
  36 + id = NOT_PARENT_TAG;
  37 + }
  38 + return regionsMapper.selectRegionsById(id);
  39 + }
  40 +}
center.manager/src/main/java/com/lyms/cm/service/sys/impl/SysUsersServiceImpl.java View file @ 5701e4b
... ... @@ -71,7 +71,6 @@
71 71 }
72 72  
73 73 @Override
74   - @Transactional
75 74 public boolean updateUser(SysUsers user) throws SystemException {
76 75 if (empty(user))
77 76 return false;
78 77  
79 78  
... ... @@ -115,11 +114,11 @@
115 114 // TODO 通过sql 修改
116 115 SysUsers user = userMapper.selectById(userId);
117 116 if (user != null) {
118   - Integer ifDel = user.getIfdel() ;
  117 + Integer ifDel = user.getIfdel();
119 118 if (ifDel == null || ifDel == ValidityEnum.VALIDITY.getValidity()) {
120   - ifDel = ValidityEnum.UNVALIDITY.getValidity();
  119 + ifDel = ValidityEnum.UNVALIDITY.getValidity();
121 120 } else {
122   - ifDel = ValidityEnum.VALIDITY.getValidity();
  121 + ifDel = ValidityEnum.VALIDITY.getValidity();
123 122 }
124 123 user.setIfdel(ifDel);
125 124 Integer tag = userMapper.updateById(user);
... ... @@ -128,10 +127,11 @@
128 127 return false;
129 128 }
130 129  
131   - @Override
132   - public Integer deleteLogicById(Serializable id) {
133   - return baseMapper.deleteLogicById(id);
134   - }
  130 + @Override
  131 + @Transactional
  132 + public Integer deleteLogicById(Serializable id) {
  133 + return baseMapper.deleteLogicById(id);
  134 + }
135 135  
136 136 }
center.manager/src/main/webapp/WEB-INF/views/common/base_list.html View file @ 5701e4b
... ... @@ -36,6 +36,71 @@
36 36 <script src="${ctx}/static/js/base/common.js"></script>
37 37 <script type="text/javascript">
38 38 $(document).ready(function(){$(".i-checks").iCheck({checkboxClass:"icheckbox_square-green",radioClass:"iradio_square-green",})});
  39 +
  40 +
  41 +$(function(){
  42 +
  43 + function get(id,callback) {
  44 + $.get(APP.PATH+"/sysRegions/find?id="+id,function(data){
  45 + callback(data);
  46 + })
  47 + }
  48 +
  49 + //下一个级别
  50 + function nextLeve(leve) {
  51 + var tmp = leve.substring(leve.length-1);
  52 + var intTmp = parseInt(tmp)+1;
  53 + return intTmp;
  54 + }
  55 +
  56 +
  57 + //移除当前列表的后续选项
  58 + function remove(leve) {
  59 + var max = 3;
  60 + var nextLeveInt = nextLeve(leve);
  61 + for(var i=nextLeveInt;i<=max;i++) {
  62 + $("#leve"+i).children().first().nextAll().remove();
  63 + }
  64 + }
  65 +
  66 + function handler(data,leveName) {
  67 + var leve =data==null ? [] : data.records;
  68 + var nextLeveInt = nextLeve(leveName);
  69 +
  70 + if(leve!=null && leve.length>0) {
  71 + remove(leveName);
  72 + for(var i=0;i<leve.length;i++) {
  73 + $("#leve"+nextLeveInt).append("<option id="+leve[i].id+" value="+leve[i].id+">"+leve[i].name+"</option>")
  74 + }
  75 + }
  76 + }
  77 +
  78 + //初始信息
  79 + get("",function(data){
  80 + handler(data,"leve0");
  81 + //填充选择信息
  82 + });
  83 +
  84 + //
  85 + $(".leve").bind("change",function(){
  86 + var leveId = $(this).attr("id");
  87 + var leves = ["leve1","leve2","leve3"];
  88 + var thisVal = $(this).val();
  89 + var ZERO = "0";
  90 +
  91 + if((leveId === leves[0] || leveId===leves[1]) &&thisVal===ZERO){
  92 + remove(leveId);
  93 + }else{
  94 + //获取数据
  95 + get(thisVal,function(data){
  96 + handler(data,leveId);
  97 + })
  98 + }
  99 +
  100 + });
  101 +
  102 +})
  103 +
39 104 </script>
40 105 </body>
41 106 </html>
center.manager/src/main/webapp/WEB-INF/views/organ/org.html View file @ 5701e4b
  1 +<select class="leve form-control" name="provinceId" id="leve1">
  2 + <option value="-1">全部省</option>
  3 +</select>
  4 +
  5 +<select class="leve form-control" name="cityId" id="leve2">
  6 + <option value="-1">全部市</option>
  7 +</select>
  8 +
  9 +<select class="leve form-control" name="areaId" id="leve3">
  10 + <option value="-1">全部县</option>
  11 +</select>
center.manager/src/main/webapp/WEB-INF/views/organ/org_edit.html View file @ 5701e4b
  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="gradeLevel">
  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.mobile" placeholder="服务热线" aria-required="true" required="true" minlength="3" name="mobile" class="form-control" id="mobile">
  58 + </div>
  59 + </div>
  60 + <div class="form-group">
  61 + <label class="col-sm-3 control-label">星级:</label>
  62 + <div class="col-sm-8">
  63 + <input type="text" value="$!org.starLevel" placeholder="星级" aria-required="true" required="true" minlength="1" name="starLevel" class="form-control" id="starLevel">
  64 + </div>
  65 + </div>
  66 + <div class="form-group">
  67 + <label class="col-sm-3 control-label">区域:</label>
  68 + <div class="col-sm-8">
  69 + #extends("/organ/org.html")
  70 + </div>
  71 + </div>
  72 + <div class="form-group">
  73 + <label class="col-sm-3 control-label">详细地址:</label>
  74 + <div class="col-sm-8">
  75 + <input type="text" value="$!org.address" placeholder="详细地址" aria-required="true" required="true" minlength="3" name="address" class="form-control" id="address">
  76 + </div>
  77 + </div>
  78 +
  79 + <div class="form-group">
  80 + <label class="col-sm-3 control-label">是否有效:</label>
  81 + <div class="col-sm-8">
  82 + <input class="col-sm-4" checked="checked" type="radio" name="ifdel" #if($!org.ifdel==0) checked="checked" #end value="0"/>是
  83 + <input class="col-sm-4" type="radio" name="ifdel" #if($!org.ifdel==1) checked="checked" #end value="1"/>否
  84 + </div>
  85 + </div>
  86 +
  87 + <div class="form-group">
  88 + <label class="col-sm-3 control-label">状态:</label>
  89 + <div class="col-sm-8">
  90 + <!-- 0,"正式运行" 1,"试运行" 2,"停止运行" -->
  91 + <select class="form-control" name="status">
  92 + <option value="0" #if($!org.status==0) selected="selected" #end>正式运行</option>
  93 + <option value="1" #if($!org.status==1) selected="selected" #end>试运行</option>
  94 + <option value="2" #if($!org.status==2) selected="selected" #end>停止运行</option>
  95 + </select>
  96 + </div>
  97 + </div>
  98 + <div class="form-group">
  99 + <label class="col-sm-3 control-label">简介:</label>
  100 + <div class="col-sm-8">
  101 + <!-- 0,"正式运行" 1,"试运行" 2,"停止运行" -->
  102 + <textarea class="control-label" cols="80" rows="6" name="description">$!org.description</textarea>
  103 + </div>
  104 + </div>
  105 +
  106 +
  107 + <div class="hr-line-dashed"></div>
  108 + <div class="form-group">
  109 + <div class="col-sm-4 col-sm-offset-3 pull-right">
  110 + <button type="button" class="btn btn-primary" onclick="save();"><i class="fa fa-check"></i>&nbsp;提交</button>
  111 + <button type="button" class="btn btn-white" onclick="parent.closeAll();"><i class="fa fa-close"></i>&nbsp;取消</button>
  112 + </div>
  113 + </div>
  114 + </form>
  115 + </div>
  116 +</div>
  117 +<script type="text/javascript">
  118 + function save(){
  119 + if($('#validForm').valid()){
  120 + var data = $('#validForm').serialize();
  121 + data = data + "&" + $('#roleForm').serialize();
  122 + //console.log(data);
  123 + if("$!org.id" == ""){
  124 + ajaxPost(APP.PATH + "/sysOrganizations/create",data);
  125 + }else{
  126 + ajaxPost(APP.PATH + "/sysOrganizations/update",data);
  127 + }
  128 + parent.reloadGrid('dataTable');
  129 + }
  130 + }
  131 +</script>
  132 +#end
  133 +#extends("/common/base_list.html")
  134 +<script type="text/javascript">
  135 + $(function(){
  136 + console.log($("#$!org.provinceId"))
  137 + //$("#$!org.provinceId").attr("selected","selected");
  138 + })
  139 +</script>
center.manager/src/main/webapp/WEB-INF/views/organ/org_list.html View file @ 5701e4b
  1 +#override("body")
  2 +<div class="row wrapper border-bottom white-bg page-heading">
  3 + <div class="col-sm-10">
  4 + <div style="padding-top:30px;">
  5 + <form role="form" class="form-inline">
  6 + <div class="form-group" id="leve">
  7 + <span class="form-control">所属区域</span>
  8 + #extends("/organ/org.html")
  9 + </div>
  10 +
  11 + <div class="form-group">
  12 + <input type="text" placeholder="请输入机构名" id="usernameSearch" class="form-control">
  13 + </div>
  14 + <!-- <div class="form-group">
  15 + <input type="text" placeholder="请输入ID" id="idSearch" class="form-control">
  16 + </div> -->
  17 + </form>
  18 + </div>
  19 + </div>
  20 + <div class="col-sm-2">
  21 + <div class="title-action">
  22 + <a class="btn btn-primary"><i class="fa fa-search"></i> 查询</a>
  23 + </div>
  24 + </div>
  25 +</div>
  26 +<div class="wrapper wrapper-content">
  27 + <div class="row">
  28 + <div class="col-sm-12">
  29 + <div id="toolbar">
  30 + <button class="btn btn-info " type="button" onclick="add();"><i class="fa fa-plus"></i> 新增</button>
  31 + <button class="btn btn-info " type="button" onclick="edit();"><i class="fa fa-paste"></i> 编辑</button>
  32 + <button class="btn btn-info " type="button" onclick="del();"><i class="fa fa-trash"></i> 删除</button>
  33 + </div>
  34 + <table id="dataTable"></table>
  35 + </div>
  36 + </div>
  37 +</div>
  38 +#end
  39 +#override("js")
  40 +<script type="text/javascript">
  41 +
  42 +var controllerRequestMappint = "/sysOrganizations/";
  43 +
  44 +function add() {
  45 + popWindow("添加结构", APP.PATH + controllerRequestMappint + "/toEdit?orgId=",700,550);
  46 +}
  47 +
  48 +function edit(){
  49 + var id = getSingleSelectedValue("dataTable","id");
  50 + if(id){
  51 + popWindow("修改机构", APP.PATH + controllerRequestMappint + "toEdit?orgId="+id,700,550);
  52 + }
  53 +}
  54 +
  55 +function del(){
  56 + goDelete("dataTable","id", APP.PATH + controllerRequestMappint + "@value@/delete");
  57 +}
  58 +## 参考 base_table_init.js 或者根据empty_bootstrap_table_init.js 来自己创建特殊的table
  59 +## 注意:自己创建的特殊的table不能extends base_list.html
  60 +var default_dataUrl = APP.PATH + controllerRequestMappint + "list";
  61 +var default_dataColumns = [{
  62 + field: 'check_state',
  63 + title: '',
  64 + checkbox: true
  65 + },{
  66 + field: 'id',
  67 + title: '编号'
  68 + },{
  69 + field: 'name',
  70 + title: '名称'
  71 + },{
  72 + field: 'type',
  73 + title: '类型'
  74 + },{
  75 + field: 'shortCode',
  76 + title: '简码'
  77 + },{
  78 + field: 'gradeLevel',
  79 + title: '等级'
  80 + },{
  81 + field: 'mobile',
  82 + title: '服务热线'
  83 + },{
  84 + field: 'starLevel',
  85 + title: '星级'
  86 + },{
  87 + field: 'status',
  88 + title: '状态'
  89 + },{
  90 + field: 'ifdel',
  91 + title: '是否删除'
  92 + },{
  93 + field: 'address',
  94 + title: '地址'
  95 + }];
  96 +</script>
  97 +#end
  98 +#extends("/common/base_list.html")
center.manager/src/test/java/center/manager/test/user/ReginsTest.java View file @ 5701e4b
  1 +package center.manager.test.user;
  2 +
  3 +import java.util.List;
  4 +
  5 +import org.junit.Test;
  6 +import org.springframework.beans.factory.annotation.Autowired;
  7 +
  8 +import com.lyms.cm.entity.sys.SysRegions;
  9 +import com.lyms.cm.service.sys.SysRegionsService;
  10 +
  11 +public class ReginsTest extends BaseTest {
  12 +
  13 + @Autowired
  14 + private SysRegionsService regionsService;
  15 +
  16 + @Test
  17 + public void select() {
  18 + List<SysRegions> regions = regionsService.selectRegions(null);
  19 + if (regions != null && !regions.isEmpty()) {
  20 + for (SysRegions region2 : regions) {
  21 + System.out.println(region2.getName());
  22 + }
  23 + }
  24 + }
  25 +
  26 +}
center.manager/src/test/java/center/manager/test/user/UserTest.java View file @ 5701e4b
... ... @@ -23,7 +23,7 @@
23 23 public void init() {
24 24 user = new SysUsers();
25 25 // user.setId(UUID.randomUUID().toString().replaceAll("-", ""));
26   - user.setName("欧阳拉闸");
  26 + user.setName("fdfjsdlf");
27 27 user.setExpirTime(new Date());
28 28 user.setPhone("18682531229");
29 29 }