Commit 856424e519736fa741e667115cc7a3e9b5ce3c92

Authored by maliang
1 parent fd3558e8ba
Exists in master

提交部分文件

Showing 4 changed files with 105 additions and 34 deletions

parent/base.common/src/main/java/com/lyms/base/common/service/conf/HighriskSourceService.java View file @ 856424e
1 1 package com.lyms.base.common.service.conf;
2 2  
3 3 import java.io.Serializable;
  4 +import java.util.List;
4 5  
5 6 import com.lyms.base.common.entity.conf.HighriskSource;
  7 +import com.lyms.exception.SystemException;
6 8 import com.lyms.web.service.BaseService;
7 9  
8 10 /**
... ... @@ -21,6 +23,41 @@
21 23 * <li>@return 大于0修改成功,否则为失败
22 24 */
23 25 public Integer deleteLogicById(Serializable id);
  26 +
  27 + /**
  28 + * <li>@Description:创建高危资源信息
  29 + * <li>@param highriskSource
  30 + * <li>@return
  31 + * <li>@throws SystemException
  32 + * <li>创建人:maliang
  33 + * <li>创建时间:2017年3月28日
  34 + * <li>修改人:
  35 + * <li>修改时间:
  36 + */
  37 + public String createHighriskSource(HighriskSource highriskSource) throws SystemException;
  38 +
  39 + /**
  40 + * <li>@Description:启用/禁用资源信息
  41 + * <li>@param id
  42 + * <li>@return
  43 + * <li>@throws SystemException
  44 + * <li>创建人:maliang
  45 + * <li>创建时间:2017年3月28日
  46 + * <li>修改人:
  47 + * <li>修改时间:
  48 + */
  49 + public boolean enable(Serializable id) throws SystemException;
  50 +
  51 + /**
  52 + * <li>@Description:获取高危资源信息
  53 + * <li>@return
  54 + * <li>@throws SystemException
  55 + * <li>创建人:maliang
  56 + * <li>创建时间:2017年3月28日
  57 + * <li>修改人:
  58 + * <li>修改时间:
  59 + */
  60 + public List<HighriskSource> getHighriskSource() throws SystemException;
24 61  
25 62 }
parent/base.common/src/main/java/com/lyms/base/common/service/conf/impl/HighriskSourceServiceImpl.java View file @ 856424e
1 1 package com.lyms.base.common.service.conf.impl;
2 2  
3 3 import java.io.Serializable;
  4 +import java.util.List;
4 5  
5 6 import com.baomidou.mybatisplus.service.impl.ServiceImpl;
6 7 import com.lyms.base.common.dao.conf.HighriskSourceMapper;
7 8 import com.lyms.base.common.entity.conf.HighriskSource;
8 9 import com.lyms.base.common.service.conf.HighriskSourceService;
  10 +import com.lyms.exception.SystemException;
  11 +import com.lyms.util.StrUtils;
9 12  
10 13 /**
11 14 * <p>
12   - * 服务类
  15 + * 高危项定义资源
13 16 * </p>
14 17 *
15 18 * @author maliang
... ... @@ -20,6 +23,33 @@
20 23  
21 24 @Override
22 25 public Integer deleteLogicById(Serializable id) {
  26 + return null;
  27 + }
  28 +
  29 + private void throwCheckException(HighriskSource highriskSource) throws SystemException {
  30 + if (highriskSource == null) {
  31 + throw new SystemException("资源信息为空");
  32 + }
  33 + }
  34 +
  35 + @Override
  36 + public String createHighriskSource(HighriskSource highriskSource) throws SystemException {
  37 +
  38 + throwCheckException(highriskSource);
  39 +
  40 + String id = StrUtils.uuid();
  41 + highriskSource.setId(id);
  42 +
  43 + return null;
  44 + }
  45 +
  46 + @Override
  47 + public boolean enable(Serializable id) throws SystemException {
  48 + return false;
  49 + }
  50 +
  51 + @Override
  52 + public List<HighriskSource> getHighriskSource() throws SystemException {
23 53 return null;
24 54 }
25 55  
parent/core.sdk/src/main/java/com/lyms/web/controller/BaseController.java View file @ 856424e
... ... @@ -22,6 +22,7 @@
22 22 import org.springframework.web.context.request.ServletRequestAttributes;
23 23  
24 24 import com.alibaba.fastjson.JSON;
  25 +import com.alibaba.fastjson.JSONObject;
25 26 import com.alibaba.fastjson.serializer.SerializerFeature;
26 27 import com.baomidou.mybatisplus.plugins.Page;
27 28 import com.baomidou.mybatisplus.plugins.pagination.Pagination;
... ... @@ -287,6 +288,10 @@
287 288 pw.close();
288 289 }
289 290 }
  291 + }
  292 +
  293 + public <T> T conver(JSONObject object, Class<T> t) {
  294 + return JSON.parseObject(object.toJSONString(), t);
290 295 }
291 296  
292 297 /**
parent/hospital.web/src/main/java/com/lyms/hospital/controller/LoginController.java View file @ 856424e
... ... @@ -29,38 +29,37 @@
29 29 // request.getSession().setAttribute("abc", "123");
30 30 return "abc";
31 31 }
32   -
33   -
34   - /**
35   - * <li>@Description:测试@RequestBody
36   - * <li>@param reqJson
37   - * <li>@param users
38   - * <li>@return
39   - * <li>创建人:方承
40   - * <li>创建时间:2017年3月28日
41   - * <li>修改人:
42   - * <li>修改时间:
43   - */
44   - @RequestMapping(value = "/testPostJson", method = RequestMethod.POST)
45   - @ResponseBody
46   - public String testPostJson(@RequestBody JSONObject reqJson){
47   - Users u = getRequestUsersEntity(reqJson);
48   - System.out.println(JSON.toJSONString(u));
49   - return "1";
50   - }
51   -
52   - /**
53   - * <li>@Description:设置业务实体
54   - * <li>@param reqJson
55   - * <li>@param users
56   - * <li>创建人:方承
57   - * <li>创建时间:2017年3月28日
58   - * <li>修改人:
59   - * <li>修改时间:
60   - */
61   - private Users getRequestUsersEntity(JSONObject reqJson){
62   - //users.setId(reqJson.getString("id"));
63   - return JSON.parseObject(reqJson.toJSONString(), Users.class);
64   - }
  32 +
  33 + /**
  34 + * <li>@Description:测试@RequestBody
  35 + * <li>@param reqJson
  36 + * <li>@param users
  37 + * <li>@return
  38 + * <li>创建人:方承
  39 + * <li>创建时间:2017年3月28日
  40 + * <li>修改人:
  41 + * <li>修改时间:
  42 + */
  43 + @RequestMapping(value = "/testPostJson", method = RequestMethod.POST)
  44 + @ResponseBody
  45 + public String testPostJson(@RequestBody JSONObject reqJson) {
  46 + Users u = getRequestUsersEntity(reqJson);
  47 + System.out.println(JSON.toJSONString(u));
  48 + return "1";
  49 + }
  50 +
  51 + /**
  52 + * <li>@Description:设置业务实体
  53 + * <li>@param reqJson
  54 + * <li>@param users
  55 + * <li>创建人:方承
  56 + * <li>创建时间:2017年3月28日
  57 + * <li>修改人:
  58 + * <li>修改时间:
  59 + */
  60 + private Users getRequestUsersEntity(JSONObject reqJson) {
  61 + // users.setId(reqJson.getString("id"));
  62 + return JSON.parseObject(reqJson.toJSONString(), Users.class);
  63 + }
65 64 }