Commit 7e7e41436ebe65cd0ceea3546a0dcfe33411aaab
1 parent
70a9432ce4
Exists in
master
and in
6 other branches
医院默认开通高危功能模块
Showing 3 changed files with 68 additions and 12 deletions
platform-common/src/main/java/com/lyms/platform/common/dao/BaseMongoDAOImpl.java
View file @
7e7e414
| 1 | 1 | package com.lyms.platform.common.dao; |
| 2 | 2 | |
| 3 | -import com.lyms.platform.common.dao.operator.MongoCondition; | |
| 4 | -import com.lyms.platform.common.dao.operator.MongoOper; | |
| 5 | -import com.lyms.platform.common.dao.operator.MongoQuery; | |
| 6 | 3 | import com.lyms.platform.common.dao.operator.Page; |
| 7 | 4 | import com.lyms.platform.common.pojo.SyncDataModel; |
| 8 | 5 | import com.lyms.platform.common.pojo.UpdateMultiData; |
| ... | ... | @@ -11,7 +8,6 @@ |
| 11 | 8 | import org.apache.commons.collections.CollectionUtils; |
| 12 | 9 | import org.springframework.beans.factory.annotation.Autowired; |
| 13 | 10 | import org.springframework.data.mongodb.core.MongoTemplate; |
| 14 | -import org.springframework.data.mongodb.core.query.Criteria; | |
| 15 | 11 | import org.springframework.data.mongodb.core.query.Query; |
| 16 | 12 | import org.springframework.data.mongodb.core.query.Update; |
| 17 | 13 | import org.springframework.util.Assert; |
| ... | ... | @@ -160,6 +156,7 @@ |
| 160 | 156 | || "SyncDataModel".equals(data.getClass().getSimpleName()) |
| 161 | 157 | || "SmsConfigModel".equals(data.getClass().getSimpleName()) |
| 162 | 158 | || "OperateLogModel".equals(data.getClass().getSimpleName()) |
| 159 | + || "ModularFunctionConfigModel".equals(data.getClass().getSimpleName()) | |
| 163 | 160 | || "TrackDown".equals(data.getClass().getSimpleName())) { |
| 164 | 161 | if(!"LisReport".equals(data.getClass().getSimpleName())){ |
| 165 | 162 | //ExceptionUtils.catchException("NotSerializable for class :"+data.getClass().getSimpleName() ); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/ModularFunctionConfigController.java
View file @
7e7e414
| ... | ... | @@ -3,6 +3,7 @@ |
| 3 | 3 | |
| 4 | 4 | import com.lyms.platform.common.annotation.TokenRequired; |
| 5 | 5 | import com.lyms.platform.common.base.BaseController; |
| 6 | +import com.lyms.platform.common.constants.ErrorCodeConstants; | |
| 6 | 7 | import com.lyms.platform.common.result.BaseResponse; |
| 7 | 8 | import com.lyms.platform.operate.web.facade.ModularFunctionConfigFacde; |
| 8 | 9 | import com.lyms.platform.operate.web.request.ModularFunctionConfigRequest; |
| 9 | 10 | |
| ... | ... | @@ -23,7 +24,22 @@ |
| 23 | 24 | private ModularFunctionConfigFacde modularFunctionConfigFacde; |
| 24 | 25 | |
| 25 | 26 | /** |
| 27 | + * 初始化开通目前已配置医院高危功能模块 | |
| 28 | + * | |
| 29 | + * @return | |
| 30 | + */ | |
| 31 | + @RequestMapping(method = RequestMethod.GET, value = "/initOrgModulFunConfig") | |
| 32 | + @ResponseBody | |
| 33 | + public BaseResponse initOrgModulFunConfig(String hosptailId) { | |
| 34 | + int size = modularFunctionConfigFacde.configAllOrganization(hosptailId); | |
| 35 | + BaseResponse baseResponse = new BaseResponse("成功", ErrorCodeConstants.SUCCESS); | |
| 36 | + baseResponse.setObject("处理:" + size + "家医院默认开通高危配置模块"); | |
| 37 | + return baseResponse; | |
| 38 | + } | |
| 39 | + | |
| 40 | + /** | |
| 26 | 41 | * 配置医院功能模块 |
| 42 | + * | |
| 27 | 43 | * @param model |
| 28 | 44 | * @param request |
| 29 | 45 | * @return |
| ... | ... | @@ -32,7 +48,7 @@ |
| 32 | 48 | @ResponseBody |
| 33 | 49 | @TokenRequired |
| 34 | 50 | public BaseResponse addModularFunConfig(@RequestBody ModularFunctionConfigRequest model, |
| 35 | - HttpServletRequest request) { | |
| 51 | + HttpServletRequest request) { | |
| 36 | 52 | |
| 37 | 53 | return modularFunctionConfigFacde.addDiagnoseConfig(model, getUserId(request)); |
| 38 | 54 | } |
| 39 | 55 | |
| ... | ... | @@ -40,12 +56,13 @@ |
| 40 | 56 | |
| 41 | 57 | /** |
| 42 | 58 | * 查询当前医院的功能配置项 |
| 59 | + * | |
| 43 | 60 | * @param hospitalId |
| 44 | 61 | * @return |
| 45 | 62 | */ |
| 46 | 63 | @RequestMapping(method = RequestMethod.GET, value = "/queryModularFunConfig") |
| 47 | 64 | @ResponseBody |
| 48 | - public BaseResponse queryDiagnoseConfig(@RequestParam("hospitalId")String hospitalId) { | |
| 65 | + public BaseResponse queryDiagnoseConfig(@RequestParam("hospitalId") String hospitalId) { | |
| 49 | 66 | return modularFunctionConfigFacde.queryDiagnoseConfig(hospitalId); |
| 50 | 67 | } |
| 51 | 68 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ModularFunctionConfigFacde.java
View file @
7e7e414
| ... | ... | @@ -4,18 +4,25 @@ |
| 4 | 4 | import com.lyms.platform.biz.service.ModularFunctionConfigService; |
| 5 | 5 | import com.lyms.platform.common.constants.ErrorCodeConstants; |
| 6 | 6 | import com.lyms.platform.common.enums.OptActionEnums; |
| 7 | +import com.lyms.platform.common.enums.YnEnums; | |
| 7 | 8 | import com.lyms.platform.common.result.BaseObjectResponse; |
| 8 | 9 | import com.lyms.platform.common.result.BaseResponse; |
| 9 | 10 | import com.lyms.platform.common.utils.StringUtils; |
| 10 | 11 | import com.lyms.platform.operate.web.request.ModularFunctionConfigRequest; |
| 11 | 12 | import com.lyms.platform.operate.web.result.ModularFunctionConfigResult; |
| 13 | +import com.lyms.platform.permission.model.Organization; | |
| 14 | +import com.lyms.platform.permission.model.OrganizationQuery; | |
| 15 | +import com.lyms.platform.permission.service.OrganizationService; | |
| 12 | 16 | import com.lyms.platform.pojo.ModularFunctionConfigModel; |
| 13 | 17 | import com.lyms.platform.query.ModularFunctionConfigQuery; |
| 14 | 18 | import org.apache.commons.collections.CollectionUtils; |
| 15 | 19 | import org.springframework.beans.factory.annotation.Autowired; |
| 16 | 20 | import org.springframework.stereotype.Component; |
| 17 | 21 | |
| 22 | +import java.util.ArrayList; | |
| 23 | +import java.util.HashMap; | |
| 18 | 24 | import java.util.List; |
| 25 | +import java.util.Map; | |
| 19 | 26 | |
| 20 | 27 | /** |
| 21 | 28 | * Created by Administrator on 2018-03-29. |
| 22 | 29 | |
| 23 | 30 | |
| ... | ... | @@ -31,11 +38,48 @@ |
| 31 | 38 | |
| 32 | 39 | @Autowired |
| 33 | 40 | private OperateLogFacade operateLogFacade; |
| 34 | - | |
| 35 | 41 | @Autowired |
| 36 | 42 | private BasicConfigService basicConfigService; |
| 43 | + @Autowired | |
| 44 | + private OrganizationService organizationService; | |
| 37 | 45 | |
| 38 | 46 | /** |
| 47 | + * 查询当前组里面包含的医院 | |
| 48 | + * | |
| 49 | + * @return | |
| 50 | + */ | |
| 51 | + public int configAllOrganization(String hosptailId) { | |
| 52 | + OrganizationQuery organizationQuery = new OrganizationQuery(); | |
| 53 | + organizationQuery.setYn(YnEnums.YES.getId()); | |
| 54 | + if (StringUtils.isNotEmpty(hosptailId)) { | |
| 55 | + organizationQuery.setId(Integer.valueOf(hosptailId)); | |
| 56 | + } | |
| 57 | + List<Organization> list = organizationService.queryOrganization(organizationQuery); | |
| 58 | + if (CollectionUtils.isNotEmpty(list)) { | |
| 59 | + for (Organization organization : list) { | |
| 60 | + ModularFunctionConfigQuery modularFunctionConfigQuery = new ModularFunctionConfigQuery(); | |
| 61 | + modularFunctionConfigQuery.setHospitalId(String.valueOf(organization.getId())); | |
| 62 | + List<ModularFunctionConfigModel> modularFunctionConfigModels = modularFunctionConfigServcie.queryDiagnoseConfigs(modularFunctionConfigQuery); | |
| 63 | + if (CollectionUtils.isEmpty(modularFunctionConfigModels)) { | |
| 64 | + ModularFunctionConfigModel modularFunctionConfigModel = new ModularFunctionConfigModel(); | |
| 65 | + modularFunctionConfigModel.setHospitalId(String.valueOf(organization.getId())); | |
| 66 | + System.out.println("正在开通医院高危模块功能:"+organization.getId()); | |
| 67 | + List<Map<String, Object>> configs = new ArrayList<>(); | |
| 68 | + Map<String, Object> conMap = new HashMap(); | |
| 69 | + conMap.put("type", "1"); | |
| 70 | + conMap.put("value", "2"); | |
| 71 | + configs.add(conMap); | |
| 72 | + modularFunctionConfigModel.setConfigs(configs); | |
| 73 | + modularFunctionConfigServcie.saveDiagnoseConfig(modularFunctionConfigModel); | |
| 74 | + }else{ | |
| 75 | + System.out.println("----跳过开通医院高危模块功能:"+organization.getId()); | |
| 76 | + } | |
| 77 | + } | |
| 78 | + } | |
| 79 | + return list.size(); | |
| 80 | + } | |
| 81 | + | |
| 82 | + /** | |
| 39 | 83 | * 添加配置基础和项 |
| 40 | 84 | * |
| 41 | 85 | * @param request |
| ... | ... | @@ -49,7 +93,7 @@ |
| 49 | 93 | if (StringUtils.isNotEmpty(request.getId())) { |
| 50 | 94 | ModularFunctionConfigModel operateBeforeContent = modularFunctionConfigServcie.findById(request.getId()); |
| 51 | 95 | modularFunctionConfigServcie.updateDiagnoseConfig(modularFunctionConfigModel); |
| 52 | - operateLogFacade.addModifyOptLog(userId, Integer.parseInt(hospitalId),operateBeforeContent, modularFunctionConfigModel, OptActionEnums.UPDATE.getId(), "配置医院功能模块"); | |
| 96 | + operateLogFacade.addModifyOptLog(userId, Integer.parseInt(hospitalId), operateBeforeContent, modularFunctionConfigModel, OptActionEnums.UPDATE.getId(), "配置医院功能模块"); | |
| 53 | 97 | } else { |
| 54 | 98 | modularFunctionConfigModel = modularFunctionConfigServcie.saveDiagnoseConfig(modularFunctionConfigModel); |
| 55 | 99 | operateLogFacade.addAddOptLog(userId, Integer.parseInt(hospitalId), modularFunctionConfigModel, OptActionEnums.ADD.getId(), "配置医院功能模块"); |
| 56 | 100 | |
| ... | ... | @@ -62,14 +106,12 @@ |
| 62 | 106 | ModularFunctionConfigQuery diagnoseConfigQuery = new ModularFunctionConfigQuery(); |
| 63 | 107 | diagnoseConfigQuery.setHospitalId(hospitalId); |
| 64 | 108 | List<ModularFunctionConfigModel> configModels = modularFunctionConfigServcie.queryDiagnoseConfigs(diagnoseConfigQuery); |
| 65 | - if (CollectionUtils.isEmpty(configModels)) | |
| 66 | - { | |
| 109 | + if (CollectionUtils.isEmpty(configModels)) { | |
| 67 | 110 | return new BaseResponse().setErrorcode(ErrorCodeConstants.NO_DATA).setErrormsg("没有数据"); |
| 68 | 111 | } |
| 69 | 112 | |
| 70 | 113 | ModularFunctionConfigModel configModel = configModels.get(0); |
| 71 | - if (configModel != null) | |
| 72 | - { | |
| 114 | + if (configModel != null) { | |
| 73 | 115 | ModularFunctionConfigResult result = new ModularFunctionConfigResult(); |
| 74 | 116 | result.convertToResult(configModel); |
| 75 | 117 | return new BaseObjectResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功").setData(result); |