Commit 55f03c930e193c5405e4a75a84bd09046b9a83be
1 parent
5fb4b2ce8b
Exists in
master
and in
1 other branch
操作日志
Showing 3 changed files with 56 additions and 30 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyBookbuildingFacade.java
View file @
55f03c9
| ... | ... | @@ -609,7 +609,7 @@ |
| 609 | 609 | patient.setPid(pm.getId()); |
| 610 | 610 | patient.setCreated(new Date()); |
| 611 | 611 | patients = yunBookbuildingService.addPregnantBookbuilding(patient); |
| 612 | - operateLogFacade.addOptLog(userId,Integer.valueOf(patients.getHospitalId()),patients,OptActionEnums.ADD.getId(),"儿童建档时候添加孕妇建档"); | |
| 612 | + operateLogFacade.addAddOptLog(userId, Integer.valueOf(patients.getHospitalId()), patients, OptActionEnums.ADD.getId(), "儿童建档时候添加孕妇建档"); | |
| 613 | 613 | } |
| 614 | 614 | } |
| 615 | 615 | |
| ... | ... | @@ -636,7 +636,7 @@ |
| 636 | 636 | patient.setCreated(new Date()); |
| 637 | 637 | patients = yunBookbuildingService.addPregnantBookbuilding(patient); |
| 638 | 638 | |
| 639 | - operateLogFacade.addOptLog(userId,Integer.valueOf(patients.getHospitalId()),patients,OptActionEnums.ADD.getId(),"儿童建档时候添加孕妇建档"); | |
| 639 | + operateLogFacade.addAddOptLog(userId, Integer.valueOf(patients.getHospitalId()), patients, OptActionEnums.ADD.getId(), "儿童建档时候添加孕妇建档"); | |
| 640 | 640 | } |
| 641 | 641 | |
| 642 | 642 | |
| ... | ... | @@ -672,7 +672,7 @@ |
| 672 | 672 | // String hospitalName = organizationService.getOrganization(Integer.valueOf(request.getHospitalId())).getName(); |
| 673 | 673 | model = babyBookbuildingService.addBabyBookbuilding(model); |
| 674 | 674 | |
| 675 | - operateLogFacade.addOptLog(userId,Integer.valueOf(request.getHospitalId()),model,OptActionEnums.ADD.getId(),"儿童建档"); | |
| 675 | + operateLogFacade.addAddOptLog(userId,Integer.valueOf(request.getHospitalId()),model,OptActionEnums.ADD.getId(),"儿童建档"); | |
| 676 | 676 | |
| 677 | 677 | if (model == null || model.getId() == null) { |
| 678 | 678 | br.setErrorcode(ErrorCodeConstants.SYSTEM_ERROR); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BookbuildingFacade.java
View file @
55f03c9
| ... | ... | @@ -252,7 +252,7 @@ |
| 252 | 252 | patient.setOperator(userId); |
| 253 | 253 | Patients p = yunBookbuildingService.addPregnantBookbuilding(patient); |
| 254 | 254 | |
| 255 | - operateLogFacade.addOptLog(userId,Integer.valueOf(yunRequest.getHospitalId()),p,OptActionEnums.ADD.getId(),"孕妇建档"); | |
| 255 | + operateLogFacade.addAddOptLog(userId,Integer.valueOf(yunRequest.getHospitalId()),p,OptActionEnums.ADD.getId(),"孕妇建档"); | |
| 256 | 256 | |
| 257 | 257 | /** 孕妇建档后把所有以前未使用的优惠券作废 */ |
| 258 | 258 | couponService.invalid(p.getPid(), "1,2,3,4,5,6,7,8"); |
| ... | ... | @@ -1391,7 +1391,7 @@ |
| 1391 | 1391 | String hospital = autoMatchFacade.getHospitalId(userId); |
| 1392 | 1392 | Patients patients = yunBookbuildingService.findOneById(id); |
| 1393 | 1393 | |
| 1394 | - operateLogFacade.addDelteOptLog(userId,Integer.valueOf(patients.getHospitalId()),patients,OptActionEnums.DELETE.getId(),"删除孕妇建档"); | |
| 1394 | + operateLogFacade.addDelteOptLog(userId, Integer.valueOf(patients.getHospitalId()), patients, OptActionEnums.DELETE.getId(), "删除孕妇建档"); | |
| 1395 | 1395 | |
| 1396 | 1396 | if (!deleteProcessHandler.deleteBookBuild(patients.getPid(), patients.getBookbuildingDate(), hospital)) { |
| 1397 | 1397 | return new BaseResponse().setErrorcode(ErrorCodeConstants.DONT_DELETE).setErrormsg("孕妇存在检查记录,不能删除建档"); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/OperateLogFacade.java
View file @
55f03c9
| ... | ... | @@ -38,6 +38,15 @@ |
| 38 | 38 | private UsersService usersService; |
| 39 | 39 | |
| 40 | 40 | |
| 41 | + /** | |
| 42 | + * 添加修改的操作日志记录 | |
| 43 | + * @param userId | |
| 44 | + * @param hospitalId | |
| 45 | + * @param operateBeforeContent 修改前的对象 | |
| 46 | + * @param operateAfterContent 修改后的对象 | |
| 47 | + * @param operateAction | |
| 48 | + * @param operateRemark | |
| 49 | + */ | |
| 41 | 50 | public void addModifyOptLog(Integer userId,Integer hospitalId, |
| 42 | 51 | Object operateBeforeContent, |
| 43 | 52 | Object operateAfterContent, |
| 44 | 53 | |
| 45 | 54 | |
| 46 | 55 | |
| 47 | 56 | |
| 48 | 57 | |
| 49 | 58 | |
| 50 | 59 | |
| 51 | 60 | |
| 52 | 61 | |
| ... | ... | @@ -58,39 +67,72 @@ |
| 58 | 67 | } |
| 59 | 68 | |
| 60 | 69 | model.setOperateAction(operateAction); |
| 61 | - model.setOperateAfterContent(JsonUtil.array2JsonString(operateAfterContent)); | |
| 62 | - model.setOperateBeforeContent(JsonUtil.array2JsonString(operateBeforeContent)); | |
| 70 | + model.setOperateBeforeContent(JsonUtil.obj2Str(operateBeforeContent)); | |
| 71 | + model.setOperateAfterContent(JsonUtil.obj2Str(operateAfterContent)); | |
| 63 | 72 | model.setOperateRemark(operateRemark); |
| 64 | 73 | |
| 65 | - if (operateAfterContent != null && operateBeforeContent != null ) | |
| 74 | + if (operateAfterContent != null && operateBeforeContent != null) | |
| 66 | 75 | { |
| 67 | 76 | String json = JsonUtil.obj2Str(getChangeItems(operateAfterContent, operateBeforeContent)); |
| 68 | 77 | System.out.print(json); |
| 69 | 78 | model.setModifyContent(json); |
| 70 | 79 | } |
| 71 | - | |
| 72 | 80 | model.setOperateHospitalId(hospitalId); |
| 73 | - | |
| 74 | 81 | model.setCreated(new Date()); |
| 75 | - | |
| 76 | 82 | operateLogService.addOptLog(model); |
| 77 | 83 | } |
| 78 | 84 | |
| 79 | - public void addOptLog(Integer userId,Integer hospitalId, | |
| 80 | - Object operateBeforeContent, | |
| 85 | + /** | |
| 86 | + * 新增的操作日志记录 | |
| 87 | + * @param userId | |
| 88 | + * @param hospitalId | |
| 89 | + * @param operateAfterContent 添加的对象 | |
| 90 | + * @param operateAction | |
| 91 | + * @param operateRemark | |
| 92 | + */ | |
| 93 | + public void addAddOptLog(Integer userId,Integer hospitalId, | |
| 94 | + Object operateAfterContent, | |
| 81 | 95 | String operateAction, |
| 82 | 96 | String operateRemark) |
| 83 | 97 | { |
| 84 | 98 | |
| 85 | 99 | addModifyOptLog( userId, hospitalId, |
| 86 | - operateBeforeContent, | |
| 87 | 100 | null, |
| 101 | + operateAfterContent, | |
| 88 | 102 | operateAction, |
| 89 | 103 | operateRemark); |
| 90 | 104 | } |
| 91 | 105 | |
| 92 | 106 | |
| 107 | + /** | |
| 108 | + * 添加导出操作日志 | |
| 109 | + * @param userId | |
| 110 | + * @param hospitalId | |
| 111 | + * @param exportContet 导出内容 | |
| 112 | + * @param operateAction | |
| 113 | + * @param operateRemark | |
| 114 | + */ | |
| 115 | + public void addExportOptLog(Integer userId,Integer hospitalId, | |
| 116 | + Object exportContet, | |
| 117 | + String operateAction, | |
| 118 | + String operateRemark) | |
| 119 | + { | |
| 93 | 120 | |
| 121 | + addModifyOptLog( userId, hospitalId, | |
| 122 | + null, | |
| 123 | + exportContet, | |
| 124 | + operateAction, | |
| 125 | + operateRemark); | |
| 126 | + } | |
| 127 | + | |
| 128 | + /** | |
| 129 | + * 删除对象 | |
| 130 | + * @param userId | |
| 131 | + * @param hospitalId | |
| 132 | + * @param operateBeforeContent 删除的对象 | |
| 133 | + * @param operateAction | |
| 134 | + * @param operateRemark 备注 | |
| 135 | + */ | |
| 94 | 136 | public void addDelteOptLog(Integer userId,Integer hospitalId, |
| 95 | 137 | Object operateBeforeContent, |
| 96 | 138 | String operateAction, |
| 97 | 139 | |
| ... | ... | @@ -172,23 +214,7 @@ |
| 172 | 214 | String result = text.substring(0, 22) + ":" + text.substring(22); |
| 173 | 215 | return result; |
| 174 | 216 | } |
| 175 | - | |
| 176 | -// | |
| 177 | -// public static void main(String[] args) | |
| 178 | -// { | |
| 179 | -// | |
| 180 | -// BabyModel model1 = new BabyModel(); | |
| 181 | -// model1.setId("bbb"); | |
| 182 | -// model1.setBlNo("111"); | |
| 183 | -// | |
| 184 | -// BabyModel model2 = new BabyModel(); | |
| 185 | -// model2.setId("bbb"); | |
| 186 | -// model2.setBlNo("222"); | |
| 187 | -// List<ChangeItem> list = getChangeItems(model1, model2); | |
| 188 | -// System.out.println(JsonUtil.obj2Str(list)); | |
| 189 | -// } | |
| 190 | 217 | } |
| 191 | - | |
| 192 | 218 | |
| 193 | 219 | class ChangeItem { |
| 194 | 220 |