Commit d17e1c0a2666b74c7b7c596874188acdc5a9c7b6

Authored by jiangjiazhi

Merge remote-tracking branch 'origin/master'

Showing 6 changed files

platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BCTransferInController.java View file @ d17e1c0
1 1 package com.lyms.platform.operate.web.controller;
2 2  
3 3 import com.lyms.platform.common.base.BaseController;
  4 +import com.lyms.platform.common.base.LoginContext;
4 5 import com.lyms.platform.common.constants.ErrorCodeConstants;
5 6 import com.lyms.platform.common.enums.BCEnums;
6 7 import com.lyms.platform.common.result.BaseListResponse;
... ... @@ -8,6 +9,7 @@
8 9 import com.lyms.platform.common.utils.BeanUtils;
9 10 import com.lyms.platform.common.utils.DateUtil;
10 11 import com.lyms.platform.common.utils.ExcelUtil;
  12 +import com.lyms.platform.common.utils.ExceptionUtils;
11 13 import com.lyms.platform.operate.web.facade.BCTransferInFacade;
12 14 import com.lyms.platform.operate.web.request.BCTransferInCancelRequest;
13 15 import com.lyms.platform.operate.web.request.BCTransferInQueryRequest;
... ... @@ -16,7 +18,6 @@
16 18 import com.lyms.platform.operate.web.result.BCTransferInHistoryQueryModel;
17 19 import com.lyms.platform.operate.web.result.BCTransferInQueryResult;
18 20 import com.lyms.platform.operate.web.result.BCTransferInSaveResult;
19   -import org.apache.log4j.Logger;
20 21 import org.springframework.beans.factory.annotation.Autowired;
21 22 import org.springframework.stereotype.Controller;
22 23 import org.springframework.web.bind.annotation.RequestMapping;
... ... @@ -40,8 +41,6 @@
40 41 @RequestMapping("bc/transfer/in")
41 42 public class BCTransferInController extends BaseController {
42 43  
43   - private Logger log = Logger.getLogger(this.getClass());
44   -
45 44 @Autowired
46 45 private BCTransferInFacade bcTransferInFacade;
47 46  
48 47  
... ... @@ -63,12 +62,9 @@
63 62 bcTransferInSaveRequest.setStartCode(startCode);
64 63 bcTransferInSaveRequest.setEndCode(endCode);
65 64  
66   - // TODO HuJiaqi-这里是自测使用的调试需要修改
67   - // LoginContext loginContext = (LoginContext) httpServletRequest.getAttribute("loginContext");
68   - // Integer operatorId = loginContext.getId();
69   - Integer operatorId = 123456;
  65 + bcTransferInSaveRequest.setOperatorId(((LoginContext) httpServletRequest.getAttribute("loginContext")).getId());
70 66  
71   - BCTransferInSaveResult bcTransferInSaveResult = bcTransferInFacade.save(bcTransferInSaveRequest, operatorId);
  67 + BCTransferInSaveResult bcTransferInSaveResult = bcTransferInFacade.save(bcTransferInSaveRequest);
72 68 if (bcTransferInSaveResult.getErrorcode() != ErrorCodeConstants.SUCCESS) {
73 69 baseObjectResponse = new BaseObjectResponse().setErrorcode(bcTransferInSaveResult.getErrorcode()).setErrormsg(bcTransferInSaveResult.getErrormsg());
74 70 return baseObjectResponse;
... ... @@ -76,7 +72,7 @@
76 72 baseObjectResponse = new BaseObjectResponse().setErrorcode(bcTransferInSaveResult.getErrorcode()).setErrormsg(bcTransferInSaveResult.getErrormsg()).setData(bcTransferInSaveResult);
77 73 } catch (Exception e) {
78 74 baseObjectResponse = new BaseObjectResponse().setErrorcode(ErrorCodeConstants.SYSTEM_ERROR).setErrormsg(ErrorCodeConstants.SYSTEM_ERROR_DESCRIPTION);
79   - log.error("bc/transfer/in/save异常:" + e);
  75 + ExceptionUtils.catchException(e, "bc/transfer/in/save异常");
80 76 }
81 77 return baseObjectResponse;
82 78 }
83 79  
... ... @@ -95,12 +91,9 @@
95 91 BCTransferInCancelRequest bcTransferInCancelRequest = new BCTransferInCancelRequest();
96 92 bcTransferInCancelRequest.setId(id);
97 93  
98   - // TODO HuJiaqi-这里是自测使用的调试需要修改
99   - // LoginContext loginContext = (LoginContext) httpServletRequest.getAttribute("loginContext");
100   - // Integer operatorId = loginContext.getId();
101   - Integer operatorId = 123456;
  94 + bcTransferInCancelRequest.setOperatorId(((LoginContext) httpServletRequest.getAttribute("loginContext")).getId());
102 95  
103   - BCTransferInCancelResult bcTransferInCancelResult = bcTransferInFacade.cancel(bcTransferInCancelRequest, operatorId);
  96 + BCTransferInCancelResult bcTransferInCancelResult = bcTransferInFacade.cancel(bcTransferInCancelRequest);
104 97 if (bcTransferInCancelResult.getErrorcode() != ErrorCodeConstants.SUCCESS) {
105 98 baseObjectResponse = new BaseObjectResponse().setErrorcode(bcTransferInCancelResult.getErrorcode()).setErrormsg(bcTransferInCancelResult.getErrormsg());
106 99 return baseObjectResponse;
... ... @@ -108,7 +101,7 @@
108 101 baseObjectResponse = new BaseObjectResponse().setErrorcode(bcTransferInCancelResult.getErrorcode()).setErrormsg(bcTransferInCancelResult.getErrormsg()).setData(bcTransferInCancelResult);
109 102 } catch (Exception e) {
110 103 baseObjectResponse = new BaseObjectResponse().setErrorcode(ErrorCodeConstants.SYSTEM_ERROR).setErrormsg(ErrorCodeConstants.SYSTEM_ERROR_DESCRIPTION);
111   - log.error("bc/transfer/in/cancel异常:" + e);
  104 + ExceptionUtils.catchException(e, "bc/transfer/in/cancel异常");
112 105 }
113 106 return baseObjectResponse;
114 107 }
... ... @@ -145,7 +138,7 @@
145 138 baseListResponse = new BaseListResponse().setErrorcode(bcTransferInQueryResult.getErrorcode()).setErrormsg(bcTransferInQueryResult.getErrormsg()).setData(bcTransferInQueryResult.getData()).setPageInfo(bcTransferInQueryResult.getPageInfo());
146 139 } catch (Exception e) {
147 140 baseListResponse = new BaseListResponse().setErrorcode(ErrorCodeConstants.SYSTEM_ERROR).setErrormsg(ErrorCodeConstants.SYSTEM_ERROR_DESCRIPTION);
148   - log.error("bc/transfer/in/query异常:" + e);
  141 + ExceptionUtils.catchException(e, "bc/transfer/in/query异常");
149 142 }
150 143 return baseListResponse;
151 144 }
... ... @@ -185,7 +178,7 @@
185 178 httpServletResponse.setHeader("Content-Disposition", "attachment;filename=" + new String(("证明入库(" + startDate + "至" + endDate + ").xls").getBytes("UTF-8"), "ISO-8859-1"));
186 179 ExcelUtil.toExcel(httpServletResponse.getOutputStream(), list, header);
187 180 } catch (Exception e) {
188   - log.error("bc/transfer/in/excel导出excel失败:" + e);
  181 + ExceptionUtils.catchException(e, "bc/transfer/in/excel异常");
189 182 }
190 183 }
191 184  
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BCTransferInFacade.java View file @ d17e1c0
... ... @@ -50,19 +50,19 @@
50 50 * @createTime 2016年11月18日 15时02分
51 51 * @discription 新增入库
52 52 */
53   - public BCTransferInSaveResult save(BCTransferInSaveRequest bcTransferInSaveRequest, Integer operatorId) {
  53 + public BCTransferInSaveResult save(BCTransferInSaveRequest bcTransferInSaveRequest) {
54 54  
55 55 BCTransferInSaveResult bcTransferInSaveResult = new BCTransferInSaveResult();
56 56  
  57 + Integer operatorId = bcTransferInSaveRequest.getOperatorId();
  58 +
57 59 // TODO HuJiaqi-是否需要判断用户级别
58   - // Users users = usersService.getUsers(operatorId);
59   - // if (users == null) {
60   - // bcTransferInSaveResult.setErrorcode(ErrorCodeConstants.SYSTEM_ERROR);
61   - // bcTransferInSaveResult.setErrormsg("用户信息异常");
62   - // return bcTransferInSaveResult;
63   - // }
64   - Users users = new Users();
65   - users.setName("HuJiaqi");
  60 + Users users = usersService.getUsers(operatorId);
  61 + if (users == null) {
  62 + bcTransferInSaveResult.setErrorcode(ErrorCodeConstants.SYSTEM_ERROR);
  63 + bcTransferInSaveResult.setErrormsg("用户信息异常");
  64 + return bcTransferInSaveResult;
  65 + }
66 66  
67 67 // 计算总量
68 68 Integer total = (int) (bcTransferInSaveRequest.getEndCode() - bcTransferInSaveRequest.getStartCode() + 1);
69 69  
70 70  
... ... @@ -104,19 +104,19 @@
104 104 return bcTransferInSaveResult;
105 105 }
106 106  
107   - public BCTransferInCancelResult cancel(BCTransferInCancelRequest bcTransferInCancelRequest, Integer operatorId) {
  107 + public BCTransferInCancelResult cancel(BCTransferInCancelRequest bcTransferInCancelRequest) {
108 108  
109 109 BCTransferInCancelResult bcTransferInCancelResult = new BCTransferInCancelResult();
110 110  
  111 + Integer operatorId = bcTransferInCancelRequest.getOperatorId();
  112 +
111 113 // TODO HuJiaqi-是否需要判断用户级别
112   - // Users users = usersService.getUsers(operatorId);
113   - // if (users == null) {
114   - // bcTransferInSaveResult.setErrorcode(ErrorCodeConstants.SYSTEM_ERROR);
115   - // bcTransferInSaveResult.setErrormsg("用户信息异常");
116   - // return bcTransferInSaveResult;
117   - // }
118   - Users users = new Users();
119   - users.setName("HuJiaqi");
  114 + Users users = usersService.getUsers(operatorId);
  115 + if (users == null) {
  116 + bcTransferInCancelResult.setErrorcode(ErrorCodeConstants.SYSTEM_ERROR);
  117 + bcTransferInCancelResult.setErrormsg("用户信息异常");
  118 + return bcTransferInCancelResult;
  119 + }
120 120  
121 121 // 1、查询这条历史记录
122 122 BCTransferInHistoryModel bcTransferInHistoryModel = bcTransferInHistoryService.findById(bcTransferInCancelRequest.getId());
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PredictedStatisticsFacade.java View file @ d17e1c0
... ... @@ -95,7 +95,7 @@
95 95 predictedStatisticsQueryModel.setRiskFactor(getRiskFactor(patients.getRiskFactorId()));
96 96 predictedStatisticsQueryModel.setLastCheckEmployee(getLastCheckEmployee(patients.getLastCheckEmployeeId()));
97 97 predictedStatisticsQueryModel.setGestationalWeeks(getGestationalWeeks(patients.getLastMenses(), patients.getType(), patients.getDueStatus()));
98   - predictedStatisticsQueryModel.setRiskScore(getRiskScore(patients.getRiskScore()));
  98 + predictedStatisticsQueryModel.setRiskScore(null == patients.getRiskScore() ? "" : patients.getRiskScore().toString());
99 99 predictedStatisticsQueryModelList.add(predictedStatisticsQueryModel);
100 100 }
101 101 }
... ... @@ -255,13 +255,6 @@
255 255 } catch (Exception e) {
256 256 return "";
257 257 }
258   - }
259   -
260   - private String getRiskScore(Integer in) {
261   - if (in == null || in == 0) {
262   - return "";
263   - }
264   - return in.toString();
265 258 }
266 259  
267 260 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PremaritalCheckupFacade.java View file @ d17e1c0
... ... @@ -54,11 +54,10 @@
54 54 public BaseObjectResponse getPremaritalCheckup(PremaritalCheckupQueryRequest requestParam) {
55 55  
56 56 PremaritalCheckup result = null;
57   - PremaritalCheckupHistoryResult historyResult = null;
58 57 ResidentsArchiveModel archiveModel = null;
59 58 Map<String, Object> archiveMap = null;
60   -
61 59 Map<String, Object> resultMap = new HashMap<>();
  60 + List<PremaritalCheckupHistoryResult> historyList = null;
62 61  
63 62 //婚检ID不为空
64 63 if (StringUtils.isNotEmpty(requestParam.getId())) {
... ... @@ -101,7 +100,7 @@
101 100 result = checkupList.get(0);
102 101 //历史婚检记录
103 102 for (PremaritalCheckup data : checkupList){
104   - historyResult = new PremaritalCheckupHistoryResult();
  103 + PremaritalCheckupHistoryResult historyResult = new PremaritalCheckupHistoryResult();
105 104 historyResult.setId(data.getId());
106 105 historyResult.setPremaritalUpTime(data.getPremaritalUpTime());
107 106 Organization org = organizationService.getOrganization(Integer.valueOf(data.getHospitalId()));
... ... @@ -109,6 +108,8 @@
109 108 historyResult.setPremaritalUpHospital(org.getName());
110 109 historyResult.setHospitalId(data.getHospitalId());
111 110 }
  111 + historyList = new ArrayList<>();
  112 + historyList.add(historyResult);
112 113 }
113 114 }
114 115 }
... ... @@ -130,7 +131,7 @@
130 131  
131 132 resultMap.put("archiveResult", archiveMap);
132 133 resultMap.put("checkupResult", result);
133   - resultMap.put("premaritalCheckupHistory",historyResult);
  134 + resultMap.put("premaritalCheckupHistory",historyList);
134 135  
135 136 BaseObjectResponse response = new BaseObjectResponse();
136 137 response.setData(resultMap);
platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/BCTransferInCancelRequest.java View file @ d17e1c0
... ... @@ -17,12 +17,22 @@
17 17 */
18 18 private String id;
19 19  
  20 + private Integer operatorId;
  21 +
20 22 public String getId() {
21 23 return id;
22 24 }
23 25  
24 26 public void setId(String id) {
25 27 this.id = id;
  28 + }
  29 +
  30 + public Integer getOperatorId() {
  31 + return operatorId;
  32 + }
  33 +
  34 + public void setOperatorId(Integer operatorId) {
  35 + this.operatorId = operatorId;
26 36 }
27 37 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/BCTransferInSaveRequest.java View file @ d17e1c0
... ... @@ -31,6 +31,8 @@
31 31 */
32 32 private Long endCode;
33 33  
  34 + private Integer operatorId;
  35 +
34 36 public String getEnCode() {
35 37 return enCode;
36 38 }
... ... @@ -55,5 +57,12 @@
55 57 this.endCode = endCode;
56 58 }
57 59  
  60 + public Integer getOperatorId() {
  61 + return operatorId;
  62 + }
  63 +
  64 + public void setOperatorId(Integer operatorId) {
  65 + this.operatorId = operatorId;
  66 + }
58 67 }