Commit 333db4ac0a669c5b9f780e4399e95dfdc37358a9

Authored by 姜超
1 parent 7fd86615

feature(*): 打印错误日志

打印错误日志
fw-morax-rpc/src/main/java/cn/fw/morax/rpc/ehr/EhrRpcService.java
... ... @@ -59,7 +59,7 @@ public class EhrRpcService {
59 59 return staffInfoDTO;
60 60 }
61 61 } catch (Exception e) {
62   - e.printStackTrace();
  62 + log.error("StaffApi queryStaffInfo 失败:{}", e);
63 63 }
64 64 return null;
65 65 }
... ... @@ -77,7 +77,7 @@ public class EhrRpcService {
77 77 return staffInfoDTOS;
78 78 }
79 79 } catch (Exception e) {
80   - e.printStackTrace();
  80 + log.error("StaffApi.getBatchStaffBaseInfoList 失败:{}", e);
81 81 }
82 82 return null;
83 83 }
... ... @@ -90,12 +90,12 @@ public class EhrRpcService {
90 90 }
91 91 try {
92 92 final Message<StaffBaseInfo> msg = staffApi.getStaffBaseInfo(userId);
93   - log.info("StaffApi.StaffBaseInfo: param:[{}] msg.code={}, msg.result={}, msg.data={}", userId, msg.getCode(), msg.getResult(), msg.getData());
  93 + log.info("StaffApi.getStaffBaseInfo: param:[{}] msg.code={}, msg.result={}, msg.data={}", userId, msg.getCode(), msg.getResult(), msg.getData());
94 94 if (msg.isSuccess() && !Objects.isNull(msg.getData())) {
95 95 return this.convertStaffBaseDTO(msg.getData());
96 96 }
97 97 } catch (Exception e) {
98   - e.printStackTrace();
  98 + log.error("StaffApi.getStaffBaseInfo 失败:{}", e);
99 99 }
100 100 return null;
101 101 }
... ... @@ -115,7 +115,7 @@ public class EhrRpcService {
115 115 return staffInfoDTO;
116 116 }
117 117 } catch (Exception e) {
118   - e.printStackTrace();
  118 + log.error("StaffApi.queryStaffInfoByMobile 失败:{}", e);
119 119 }
120 120 return null;
121 121 }
... ... @@ -140,7 +140,7 @@ public class EhrRpcService {
140 140 return staffBaseInfoVos;
141 141 }
142 142 } catch (Exception e) {
143   - e.printStackTrace();
  143 + log.error("StaffApi.getStaffListByShopPost 失败:{}", e);
144 144 }
145 145 return null;
146 146 }
... ... @@ -161,7 +161,6 @@ public class EhrRpcService {
161 161 }
162 162 } catch (Exception e) {
163 163 log.error("获取ehr系统员工信息 staffApi.getStaffListByName异常");
164   - e.printStackTrace();
165 164 }
166 165 return new ArrayList<>();
167 166 }
... ... @@ -184,7 +183,7 @@ public class EhrRpcService {
184 183 return this.convertStaffBaseDTOs(msg.getData().getManageStaffList());
185 184 }
186 185 } catch (Exception e) {
187   - e.printStackTrace();
  186 + log.error("StaffApi.getRealTimeManagerScope 失败:{}", e);
188 187 }
189 188 return null;
190 189 }
... ... @@ -207,7 +206,7 @@ public class EhrRpcService {
207 206 return this.convertShopIds(msg.getData().getScopeList());
208 207 }
209 208 } catch (Exception e) {
210   - e.printStackTrace();
  209 + log.error("StaffApi.getRealTimeManagerScope 失败:{}", e);
211 210 }
212 211 return null;
213 212 }
... ... @@ -223,8 +222,8 @@ public class EhrRpcService {
223 222 if (PublicUtil.isEmpty(shopIds)) {
224 223 return new ArrayList<>();
225 224 }
226   - final Message<List<ManagerVo>> msg = managerApi.getRealTimeShopManager(shopIds, true);
227 225 try {
  226 + final Message<List<ManagerVo>> msg = managerApi.getRealTimeShopManager(shopIds, true);
228 227 log.info("ManagerApi.getRealTimeShopManager: msg.code={}, msg.result={}, msg.data={}", msg.getCode(), msg.getResult(), msg.getData());
229 228 if (msg.isSuccess() && !Objects.isNull(msg.getData())) {
230 229 List<ManagerDTO> managerDTOS = new ArrayList<>(msg.getData().size());
... ... @@ -255,7 +254,7 @@ public class EhrRpcService {
255 254 return managerDTOS;
256 255 }
257 256 } catch (Exception e) {
258   - e.printStackTrace();
  257 + log.error("StaffApi.getRealTimeShopManager 失败:{}", e);
259 258 }
260 259 return null;
261 260 }
... ... @@ -271,8 +270,8 @@ public class EhrRpcService {
271 270 if (PublicUtil.isEmpty(shopIds) || PublicUtil.isEmpty(postId)) {
272 271 return new ArrayList<>();
273 272 }
274   - final Message<List<ManagerVo>> msg = managerApi.getRealTimeShopManager(shopIds, true);
275 273 try {
  274 + final Message<List<ManagerVo>> msg = managerApi.getRealTimeShopManager(shopIds, true);
276 275 log.info("ManagerApi.getRealTimeShopManager: param:{}, msg.code={}, msg.result={}, msg.data={}",
277 276 JSON.toJSONString(shopIds), msg.getCode(), msg.getResult(), msg.getData());
278 277 if (msg.isSuccess() && !Objects.isNull(msg.getData())) {
... ... @@ -310,7 +309,7 @@ public class EhrRpcService {
310 309 return managerDTOS;
311 310 }
312 311 } catch (Exception e) {
313   - e.printStackTrace();
  312 + log.error("StaffApi.getRealTimeShopManager 失败:{}", e);
314 313 }
315 314 return null;
316 315 }
... ... @@ -333,7 +332,7 @@ public class EhrRpcService {
333 332 return this.convertStaffBaseDTOs(msg.getData().getManageStaffList());
334 333 }
335 334 } catch (Exception e) {
336   - e.printStackTrace();
  335 + log.error("查询管理范围下的离职员工失败:{}", e);
337 336 }
338 337 return null;
339 338 }
... ... @@ -377,7 +376,7 @@ public class EhrRpcService {
377 376 // return staffDTOS;
378 377 // }
379 378 // } catch (Exception e) {
380   -// e.printStackTrace();
  379 +// log.error("查询管理范围下的离职员工失败:{}", e);
381 380 // }
382 381 // return new ArrayList<>();
383 382 // }
... ... @@ -433,6 +432,7 @@ public class EhrRpcService {
433 432 queryDto.setAfterLeaveTime(queryDate);
434 433 queryDto.setOldChangeTime(queryDate);
435 434 try {
  435 + System.out.println(1/0);
436 436 log.info("StaffApi.getStaffByPostShopList: 开始进行请求。param:[{}] ",
437 437 JSON.toJSONString(queryDto));
438 438 final Message<List<StaffBaseInfo>> msg = staffApi.getStaffByPostShopList(queryDto);
... ... @@ -442,8 +442,7 @@ public class EhrRpcService {
442 442 return getPerformanceStaffDTOS(staffName, msg);
443 443 }
444 444 } catch (Exception e) {
445   - e.printStackTrace();
446   - log.error("获取人员信息失败:{}", e);
  445 + log.error("获取人员信息失败:", e);
447 446 }
448 447 return new ArrayList<>();
449 448 }
... ... @@ -562,7 +561,7 @@ public class EhrRpcService {
562 561 return probationSalaryMap;
563 562 }
564 563 } catch (Exception e) {
565   - e.printStackTrace();
  564 + log.error("获取人员信息失败:", e);
566 565 }
567 566 return Collections.emptyMap();
568 567 }
... ... @@ -596,7 +595,7 @@ public class EhrRpcService {
596 595 return postInfos;
597 596 }
598 597 } catch (Exception e) {
599   - e.printStackTrace();
  598 + log.error("获取岗位人员信息失败:", e);
600 599 }
601 600 return null;
602 601 }
... ... @@ -622,7 +621,7 @@ public class EhrRpcService {
622 621 return this.convertStaffBaseDTOs(msg.getData());
623 622 }
624 623 } catch (Exception e) {
625   - e.printStackTrace();
  624 + log.error("获取门店离职员工失败:", e);
626 625 }
627 626 return null;
628 627 }
... ... @@ -683,7 +682,7 @@ public class EhrRpcService {
683 682 return getPerformanceStaffDTOS(null,msg);
684 683 }
685 684 } catch (Exception e) {
686   - e.printStackTrace();
  685 + log.error("批量获取人员信息失败:", e);
687 686 }
688 687 return Collections.emptyList();
689 688 }
... ... @@ -770,7 +769,7 @@ public class EhrRpcService {
770 769 return staffInfoVos;
771 770 }
772 771 } catch (Exception e) {
773   - e.printStackTrace();
  772 + log.error("通过身份证获取人员信息失败:", e);
774 773 }
775 774 return null;
776 775 }
... ... @@ -792,7 +791,6 @@ public class EhrRpcService {
792 791 }
793 792 } catch (Exception e) {
794 793 log.error("获取ehr系统员工信息 staffApi.getStaffListByShopPost异常");
795   - e.printStackTrace();
796 794 }
797 795 return new ArrayList<>();
798 796 }
... ... @@ -817,7 +815,6 @@ public class EhrRpcService {
817 815 }
818 816 } catch (Exception e) {
819 817 log.error("获取ehr系统员工信息 staffApi.getManagerScopeStaffList异常");
820   - e.printStackTrace();
821 818 }
822 819 return new ArrayList<>();
823 820 }
... ... @@ -846,7 +843,6 @@ public class EhrRpcService {
846 843 }
847 844 } catch (Exception e) {
848 845 log.error("获取ehr系统员工信息 staffApi.getPertainShopStaffList异常");
849   - e.printStackTrace();
850 846 }
851 847 return new ArrayList<>();
852 848 }
... ... @@ -876,8 +872,7 @@ public class EhrRpcService {
876 872 return staffInfoVos;
877 873 }
878 874 } catch (Exception e) {
879   - log.error("获取ehr系统员工信息 staffApi.getPertainShopStaffList异常");
880   - e.printStackTrace();
  875 + log.error("获取ehr系统员工信息 staffApi.getPertainShopStaffList异常:{}", e);
881 876 }
882 877 return new ArrayList<>();
883 878 }
... ... @@ -909,8 +904,7 @@ public class EhrRpcService {
909 904 }
910 905 return postInfoDTOS;
911 906 } catch (Exception e) {
912   - log.error("获取指定上级岗位 postApi.getUpPostList异常");
913   - e.printStackTrace();
  907 + log.error("获取指定上级岗位 postApi.getUpPostList异常:{}", e);
914 908 }
915 909 return new ArrayList<>();
916 910 }
... ...