Commit 86c6675b1f8d751bdb709a8e668c6bb19bcbdbbd
1 parent
979bf7f917
Exists in
master
and in
6 other branches
操作日志
Showing 4 changed files with 29 additions and 98 deletions
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BabyBuildController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyBookbuildingFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BookbuildingFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/OperateLogFacade.java
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BabyBuildController.java
View file @
86c6675
| ... | ... | @@ -81,7 +81,7 @@ |
| 81 | 81 | @ResponseBody |
| 82 | 82 | public BaseResponse deleteBabyBuildById(@PathVariable("id") String id, HttpServletRequest request) { |
| 83 | 83 | |
| 84 | - return babyBookbuildingFacade.deleteBabyBuildById(id); | |
| 84 | + return babyBookbuildingFacade.deleteBabyBuildById(id,getUserId(request)); | |
| 85 | 85 | |
| 86 | 86 | } |
| 87 | 87 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyBookbuildingFacade.java
View file @
86c6675
| ... | ... | @@ -126,7 +126,10 @@ |
| 126 | 126 | @Autowired |
| 127 | 127 | private OrganizationGroupsFacade groupsFacade; |
| 128 | 128 | |
| 129 | + @Autowired | |
| 130 | + private OperateLogFacade operateLogFacade; | |
| 129 | 131 | |
| 132 | + | |
| 130 | 133 | @Autowired |
| 131 | 134 | @Qualifier("commonThreadPool") |
| 132 | 135 | private ThreadPoolTaskExecutor commonThreadPool; |
| 133 | 136 | |
| ... | ... | @@ -401,8 +404,10 @@ |
| 401 | 404 | } |
| 402 | 405 | } |
| 403 | 406 | |
| 404 | - | |
| 405 | 407 | babyBookbuildingService.updateBabyBuild(model, request.getId()); |
| 408 | + | |
| 409 | + operateLogFacade.addOptLog(userId, Integer.valueOf(model.getHospitalId()), list.get(0), model, OptActionEnums.UPDATE.getId(), "修改儿童建档"); | |
| 410 | + | |
| 406 | 411 | model.setId(request.getId()); |
| 407 | 412 | model.setPid(pid); |
| 408 | 413 | patientsService.updateRefer(model); |
| ... | ... | @@ -604,6 +609,7 @@ |
| 604 | 609 | patient.setPid(pm.getId()); |
| 605 | 610 | patient.setCreated(new Date()); |
| 606 | 611 | patients = yunBookbuildingService.addPregnantBookbuilding(patient); |
| 612 | + operateLogFacade.addOptLog(userId,Integer.valueOf(patients.getHospitalId()),patients,"",OptActionEnums.ADD.getId(),"儿童建档时候添加孕妇建档"); | |
| 607 | 613 | } |
| 608 | 614 | } |
| 609 | 615 | |
| ... | ... | @@ -629,6 +635,8 @@ |
| 629 | 635 | patient.setPid(yunModel.getId()); |
| 630 | 636 | patient.setCreated(new Date()); |
| 631 | 637 | patients = yunBookbuildingService.addPregnantBookbuilding(patient); |
| 638 | + | |
| 639 | + operateLogFacade.addOptLog(userId,Integer.valueOf(patients.getHospitalId()),patients,"",OptActionEnums.ADD.getId(),"儿童建档时候添加孕妇建档"); | |
| 632 | 640 | } |
| 633 | 641 | |
| 634 | 642 | |
| 635 | 643 | |
| ... | ... | @@ -664,8 +672,8 @@ |
| 664 | 672 | // String hospitalName = organizationService.getOrganization(Integer.valueOf(request.getHospitalId())).getName(); |
| 665 | 673 | model = babyBookbuildingService.addBabyBookbuilding(model); |
| 666 | 674 | |
| 675 | + operateLogFacade.addOptLog(userId,Integer.valueOf(request.getHospitalId()),model,"",OptActionEnums.ADD.getId(),"儿童建档"); | |
| 667 | 676 | |
| 668 | - | |
| 669 | 677 | if (model == null || model.getId() == null) { |
| 670 | 678 | br.setErrorcode(ErrorCodeConstants.SYSTEM_ERROR); |
| 671 | 679 | br.setErrormsg("保存失败"); |
| ... | ... | @@ -1146,7 +1154,7 @@ |
| 1146 | 1154 | * |
| 1147 | 1155 | * @param id |
| 1148 | 1156 | */ |
| 1149 | - public BaseResponse deleteBabyBuildById(String id) { | |
| 1157 | + public BaseResponse deleteBabyBuildById(String id,Integer userId) { | |
| 1150 | 1158 | |
| 1151 | 1159 | BabyModel babyModel = mongoTemplate.findById(id, BabyModel.class); |
| 1152 | 1160 | BabyCheckModelQuery query = new BabyCheckModelQuery(); |
| ... | ... | @@ -1172,7 +1180,7 @@ |
| 1172 | 1180 | personService.updatePerson(personModel, allModels.get(0).getPid()); |
| 1173 | 1181 | } |
| 1174 | 1182 | } |
| 1175 | - | |
| 1183 | + operateLogFacade.addOptLog(userId, Integer.valueOf(models.get(0).getHospitalId()), models.get(0), null, OptActionEnums.DELETE.getId(), "删除儿童建档"); | |
| 1176 | 1184 | } |
| 1177 | 1185 | |
| 1178 | 1186 | babyBookbuildingService.deleteBabyById(id); |
| ... | ... | @@ -1947,10 +1955,10 @@ |
| 1947 | 1955 | } |
| 1948 | 1956 | } |
| 1949 | 1957 | |
| 1950 | - String hospital = autoMatchFacade.getHospitalId(userId); | |
| 1951 | - if (com.lyms.platform.common.utils.StringUtils.isNotEmpty(hospital) && !hospitalIdList.contains(hospital)) { | |
| 1952 | - hospitalIdList.add(hospital); | |
| 1953 | - } | |
| 1958 | +// String hospital = autoMatchFacade.getHospitalId(userId); | |
| 1959 | +// if (com.lyms.platform.common.utils.StringUtils.isNotEmpty(hospital) && !hospitalIdList.contains(hospital)) { | |
| 1960 | +// hospitalIdList.add(hospital); | |
| 1961 | +// } | |
| 1954 | 1962 | |
| 1955 | 1963 | List<String> permissions = new ArrayList<>(); |
| 1956 | 1964 | DataPermissionsModelQuery dataPermissionsModelQuery = new DataPermissionsModelQuery(); |
| ... | ... | @@ -2016,92 +2024,6 @@ |
| 2016 | 2024 | } |
| 2017 | 2025 | } |
| 2018 | 2026 | } |
| 2019 | - | |
| 2020 | -// if (CollectionUtils.isNotEmpty(models)) { | |
| 2021 | -// for (BabyModel model : models) { | |
| 2022 | -// BabyManageListResult result = new BabyManageListResult(); | |
| 2023 | -// result.setId(model.getId()); | |
| 2024 | -// if (model.getLastHighRisk() == null || model.getLastHighRisk() == 0) { | |
| 2025 | -// result.setHighRisk("健康"); | |
| 2026 | -// } else { | |
| 2027 | -// result.setHighRisk("高危"); | |
| 2028 | -// } | |
| 2029 | -// result.setSex(StringUtils.emptyDeal(SexEnum.getTextById(model.getSex()))); | |
| 2030 | -// result.setBabyName(StringUtils.emptyDeal(model.getName())); | |
| 2031 | -// result.setBirthday(StringUtils.emptyDeal(DateUtil.getyyyy_MM_dd(model.getBirth()))); | |
| 2032 | -// result.setMommyName(StringUtils.emptyDeal(model.getMname())); | |
| 2033 | -// result.setMommnyPhone(StringUtils.emptyDeal(model.getMphone())); | |
| 2034 | -// result.setMommnyEncryptPhone(StringUtils.encryPhone(model.getMphone())); | |
| 2035 | -// result.setServiceStatus(StringUtils.emptyDeal(model.getServiceStatus() == null ? "" : ServiceStatusEnums.getNameById(model.getServiceStatus()))); | |
| 2036 | -// result.setServiceType(StringUtils.emptyDeal(model.getServiceType() == null ? "" : ServiceTypeEnums.getTitleById(model.getServiceType()))); | |
| 2037 | -// result.setNextDate(StringUtils.emptyDeal(DateUtil.getyyyy_MM_dd(model.getNextDate()))); | |
| 2038 | -// result.setMonthAge(StringUtils.emptyDeal(DateUtil.getBabyMonthAge(model.getBirth(), new Date()))); | |
| 2039 | -// result.setPatientId(model.getParentId()); | |
| 2040 | -// result.setBuildTime(DateUtil.getyyyy_MM_dd(model.getBuildDate())); | |
| 2041 | -// result.setHospitalName(organizationService.getOrganization(Integer.valueOf(model.getHospitalId())).getName()); | |
| 2042 | -// | |
| 2043 | -// if(String.valueOf("true").equals(request.getIsArea())) { | |
| 2044 | -// // 开始查询省市区街道 | |
| 2045 | -// // 省 | |
| 2046 | -// BasicConfig provinceName = basicConfigService.getOneBasicConfigById(model.getProvinceId()); | |
| 2047 | -// // 市 | |
| 2048 | -// BasicConfig cityName = basicConfigService.getOneBasicConfigById(model.getCityId()); | |
| 2049 | -// // 区 | |
| 2050 | -// BasicConfig areaName = basicConfigService.getOneBasicConfigById(model.getAreaId()); | |
| 2051 | -// // 街道 | |
| 2052 | -// BasicConfig streetName = basicConfigService.getOneBasicConfigById(model.getStreetId()); | |
| 2053 | -// // 具体 | |
| 2054 | -// String address = model.getAddress(); | |
| 2055 | -// String completeAddress = ""; | |
| 2056 | -// if (provinceName != null) { | |
| 2057 | -// completeAddress += provinceName.getName(); | |
| 2058 | -// } | |
| 2059 | -// if (cityName != null) { | |
| 2060 | -// completeAddress += cityName.getName(); | |
| 2061 | -// } | |
| 2062 | -// if (areaName != null) { | |
| 2063 | -// completeAddress += areaName.getName(); | |
| 2064 | -// } | |
| 2065 | -// if (streetName != null) { | |
| 2066 | -// completeAddress += streetName.getName(); | |
| 2067 | -// } | |
| 2068 | -// if (!StringUtils.isEmpty(address)) { | |
| 2069 | -// completeAddress += address; | |
| 2070 | -// } | |
| 2071 | -// if (completeAddress.length() == 0) { | |
| 2072 | -// completeAddress = "-"; | |
| 2073 | -// } | |
| 2074 | -// result.setCompleteAddress(completeAddress); | |
| 2075 | -// } | |
| 2076 | -// String diagnose = ""; | |
| 2077 | -//// if (!StringUtils.isEmpty(model.getDiagnose())) { | |
| 2078 | -//// List diagList = JsonUtil.toList(model.getDiagnose(), List.class); | |
| 2079 | -//// if (CollectionUtils.isNotEmpty(diagList)) { | |
| 2080 | -//// diagnose = ""; | |
| 2081 | -//// for (Object obj : diagList) { | |
| 2082 | -//// BasicConfig basicConfig = basicConfigService.getOneBasicConfigById((String) obj); | |
| 2083 | -//// if (basicConfig != null) { | |
| 2084 | -//// diagnose += basicConfig.getName() + " "; | |
| 2085 | -//// } | |
| 2086 | -//// } | |
| 2087 | -//// } | |
| 2088 | -//// } | |
| 2089 | -// if (StringUtils.isNotEmpty(model.getPid())) { | |
| 2090 | -// List diagList = babyCheckFacade.getBabyLastDiagnose(model.getPid()); | |
| 2091 | -// if (CollectionUtils.isNotEmpty(diagList)) { | |
| 2092 | -// for (Object obj : diagList) { | |
| 2093 | -// BasicConfig basicConfig = basicConfigService.getOneBasicConfigById((String) obj); | |
| 2094 | -// if (basicConfig != null) { | |
| 2095 | -// diagnose += basicConfig.getName() + " "; | |
| 2096 | -// } | |
| 2097 | -// } | |
| 2098 | -// } | |
| 2099 | -// } | |
| 2100 | -// result.setDiagnose(StringUtils.emptyDeal(diagnose)); | |
| 2101 | -// list.add(result); | |
| 2102 | -// } | |
| 2103 | -// } | |
| 2104 | - | |
| 2105 | 2027 | BaseListResponse objectResponse = new BaseListResponse(); |
| 2106 | 2028 | objectResponse.setErrorcode(ErrorCodeConstants.SUCCESS); |
| 2107 | 2029 | objectResponse.setData(list); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BookbuildingFacade.java
View file @
86c6675
| ... | ... | @@ -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()),JsonUtil.array2JsonString(p),"",OptActionEnums.ADD.getId(),""); | |
| 255 | + operateLogFacade.addOptLog(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"); |
| ... | ... | @@ -461,6 +461,8 @@ |
| 461 | 461 | patient.setOperator(userId); |
| 462 | 462 | Patients p = yunBookbuildingService.addPregnantBookbuilding(patient); |
| 463 | 463 | |
| 464 | + operateLogFacade.addOptLog(userId, Integer.valueOf(patient.getHospitalId()), p, null, OptActionEnums.UPDATE.getId(), "孕妇建档修改"); | |
| 465 | + | |
| 464 | 466 | if (p == null || p.getId() == null) { |
| 465 | 467 | br.setErrorcode(ErrorCodeConstants.SYSTEM_ERROR); |
| 466 | 468 | br.setErrormsg("建档失败,保存异常"); |
| 467 | 469 | |
| ... | ... | @@ -872,8 +874,12 @@ |
| 872 | 874 | |
| 873 | 875 | patient.setOperator(userId); |
| 874 | 876 | |
| 877 | + Patients beforePatient = yunBookbuildingService.findOneById(id); | |
| 878 | + | |
| 875 | 879 | yunBookbuildingService.updatePregnant(patient, id); |
| 876 | 880 | |
| 881 | + operateLogFacade.addOptLog(userId, Integer.valueOf(patient.getHospitalId()), beforePatient, patient, OptActionEnums.UPDATE.getId(), "孕妇建档修改"); | |
| 882 | + | |
| 877 | 883 | //如果当前是建档医院,那么需要修改其他非建档医院的数据 |
| 878 | 884 | if (autoMatchFacade.checkBStatus(userId)) { |
| 879 | 885 | patientsService.updateBaseData(patient); |
| ... | ... | @@ -1384,6 +1390,8 @@ |
| 1384 | 1390 | //获取初诊记录 |
| 1385 | 1391 | String hospital = autoMatchFacade.getHospitalId(userId); |
| 1386 | 1392 | Patients patients = yunBookbuildingService.findOneById(id); |
| 1393 | + | |
| 1394 | + operateLogFacade.addOptLog(userId,Integer.valueOf(patients.getHospitalId()),patients,"",OptActionEnums.DELETE.getId(),"删除孕妇建档"); | |
| 1387 | 1395 | |
| 1388 | 1396 | if (!deleteProcessHandler.deleteBookBuild(patients.getPid(), patients.getBookbuildingDate(), hospital)) { |
| 1389 | 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 @
86c6675
| ... | ... | @@ -2,6 +2,7 @@ |
| 2 | 2 | |
| 3 | 3 | |
| 4 | 4 | import com.lyms.platform.biz.service.OperateLogService; |
| 5 | +import com.lyms.platform.common.utils.JsonUtil; | |
| 5 | 6 | import com.lyms.platform.permission.model.Users; |
| 6 | 7 | import com.lyms.platform.permission.model.UsersQuery; |
| 7 | 8 | import com.lyms.platform.permission.service.UsersService; |
| ... | ... | @@ -47,8 +48,8 @@ |
| 47 | 48 | } |
| 48 | 49 | |
| 49 | 50 | model.setOperateAction(operateAction); |
| 50 | - model.setOperateAfterContent(operateAfterContent); | |
| 51 | - model.setOperateBeforeContent(operateBeforeContent); | |
| 51 | + model.setOperateAfterContent(JsonUtil.array2JsonString(operateAfterContent)); | |
| 52 | + model.setOperateBeforeContent(JsonUtil.array2JsonString(operateBeforeContent)); | |
| 52 | 53 | model.setOperateRemark(operateRemark); |
| 53 | 54 | |
| 54 | 55 | model.setOperateHospitalId(hospitalId); |