Commit d1acd639e462475f85f3a262c451f59dc2851dd5
Exists in
master
and in
8 other branches
Merge remote-tracking branch 'origin/master'
Showing 7 changed files
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AccessPermissionFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AutoMatchFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyManagerFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BasicConfigFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/VisitFacade.java
- platform-operate-api/src/main/resources/log4j_config.xml
- platform-operate-api/src/main/resources/spring/applicationContext_biz_patient.xml
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AccessPermissionFacade.java
View file @
d1acd63
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AutoMatchFacade.java
View file @
d1acd63
| ... | ... | @@ -29,12 +29,6 @@ |
| 29 | 29 | @Autowired |
| 30 | 30 | private OrganizationService organizationService; |
| 31 | 31 | @Autowired |
| 32 | - private CommunityConfigService communityConfigService; | |
| 33 | - @Autowired | |
| 34 | - private PatientsService patientsService; | |
| 35 | - @Autowired | |
| 36 | - private UserOrganizationMapsService userOrganizationMapsService; | |
| 37 | - @Autowired | |
| 38 | 32 | private AccessPermissionFacade accessPermissionFacade; |
| 39 | 33 | |
| 40 | 34 | public String match(int userId) { |
| ... | ... | @@ -92,23 +86,5 @@ |
| 92 | 86 | } |
| 93 | 87 | return data; |
| 94 | 88 | } |
| 95 | - | |
| 96 | - | |
| 97 | - public List<CommunityConfig> findCommunity(String areaId) { | |
| 98 | - CommunityQuery communityQuery = new CommunityQuery(); | |
| 99 | - communityQuery.setId(areaId); | |
| 100 | - return communityConfigService.queryCommunity(communityQuery); | |
| 101 | - } | |
| 102 | - | |
| 103 | - public List<Patients> findPatients(String areaId) { | |
| 104 | - PatientsQuery patientsQuery = new PatientsQuery(); | |
| 105 | - patientsQuery.setAreaId(areaId); | |
| 106 | - patientsQuery.setYn(YnEnums.YES.getId()); | |
| 107 | - patientsQuery.setType(3); | |
| 108 | - return patientsService.queryPatient(patientsQuery); | |
| 109 | - } | |
| 110 | - /*public List<BabyModel> findBaby(){ | |
| 111 | - | |
| 112 | - }*/ | |
| 113 | 89 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyManagerFacade.java
View file @
d1acd63
| ... | ... | @@ -29,12 +29,9 @@ |
| 29 | 29 | public class BabyManagerFacade { |
| 30 | 30 | |
| 31 | 31 | @Autowired |
| 32 | - private PuerperaService puerperaService; | |
| 33 | - @Autowired | |
| 34 | 32 | private PatientsService patientsService; |
| 35 | 33 | @Autowired |
| 36 | 34 | private CommunityConfigService communityConfigService; |
| 37 | - | |
| 38 | 35 | @Autowired |
| 39 | 36 | private BabyService babyService; |
| 40 | 37 | @Autowired |
| 41 | 38 | |
| 42 | 39 | |
| ... | ... | @@ -52,40 +49,12 @@ |
| 52 | 49 | */ |
| 53 | 50 | public BaseListResponse findBabyList(BabyManagerQueryRequest babyManagerRequest,int userId) { |
| 54 | 51 | |
| 55 | - /*PatientsQuery patientsQuery = new PatientsQuery(); | |
| 56 | - patientsQuery.setType(2); | |
| 57 | - patientsQuery.setYn(YnEnums.YES.getId()); | |
| 58 | 52 | Date date = DateUtil.parseYMD(babyManagerRequest.getdEnd()); |
| 59 | 53 | if (null != date) { |
| 60 | 54 | long d = date.getTime() + 86398000; |
| 61 | 55 | date = new Date(d); |
| 62 | 56 | } |
| 63 | - patientsQuery.setBirthEnd(date); | |
| 64 | - patientsQuery.setBirthStart(DateUtil.parseYMD(babyManagerRequest.getdStart())); | |
| 65 | - patientsQuery.setPhone(babyManagerRequest.getPhone()); | |
| 66 | - patientsQuery.setName(babyManagerRequest.getName()); | |
| 67 | - patientsQuery.setVisitstatus(babyManagerRequest.getVisitstatus()); | |
| 68 | - patientsQuery.setPage(babyManagerRequest.getPage()); | |
| 69 | - patientsQuery.setLimit(babyManagerRequest.getLimit()); | |
| 70 | - patientsQuery.setNeed("1"); | |
| 71 | - if (StringUtils.isNotEmpty(babyManagerRequest.getKeyword())) { | |
| 72 | - patientsQuery.setKeyword(babyManagerRequest.getKeyword()); | |
| 73 | - } | |
| 74 | - List<Patients> patientsList = patientsService.queryPatient(patientsQuery); | |
| 75 | 57 | |
| 76 | - List<BabyResult> data =new ArrayList<BabyResult>(); | |
| 77 | - | |
| 78 | - if(CollectionUtils.isNotEmpty(patientsList)){ | |
| 79 | - for(Patients patients:patientsList){ | |
| 80 | - data.add(buildResult(patients)); | |
| 81 | - } | |
| 82 | - }*/ | |
| 83 | - Date date = DateUtil.parseYMD(babyManagerRequest.getdEnd()); | |
| 84 | - if (null != date) { | |
| 85 | - long d = date.getTime() + 86398000; | |
| 86 | - date = new Date(d); | |
| 87 | - } | |
| 88 | - | |
| 89 | 58 | BabyModelQuery babyQuery = new BabyModelQuery(); |
| 90 | 59 | babyQuery.setBirthEnd(date); |
| 91 | 60 | babyQuery.setBirthStart(DateUtil.parseYMD(babyManagerRequest.getdStart())); |
| 92 | 61 | |
| ... | ... | @@ -96,7 +65,9 @@ |
| 96 | 65 | babyQuery.setMname(babyManagerRequest.getName()); |
| 97 | 66 | babyQuery.setLimit(babyManagerRequest.getLimit()); |
| 98 | 67 | babyQuery.setYn(YnEnums.YES.getId()); |
| 68 | + | |
| 99 | 69 | String areaid= autoMatchFacade.match(userId); |
| 70 | + | |
| 100 | 71 | if(StringUtils.isNotEmpty(areaid)){ |
| 101 | 72 | babyQuery.setAreaId(areaid); |
| 102 | 73 | } |
| 103 | 74 | |
| 104 | 75 | |
| 105 | 76 | |
| 106 | 77 | |
| ... | ... | @@ -141,60 +112,19 @@ |
| 141 | 112 | return new BaseResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功"); |
| 142 | 113 | } |
| 143 | 114 | |
| 115 | + | |
| 144 | 116 | /** |
| 145 | - * 构建放回的数据 | |
| 117 | + * 构建返回的数据 | |
| 146 | 118 | * |
| 147 | - * @param baby | |
| 148 | - * @param puerModel | |
| 149 | - * @return | |
| 119 | + * @param patients | |
| 120 | + * | |
| 121 | + * @param communityId 社区id | |
| 122 | + * | |
| 123 | + * @return 新生儿访视 | |
| 150 | 124 | */ |
| 151 | - public BabyResult buildResult(BabyModel baby, PuerperaModel puerModel) { | |
| 152 | - BabyResult babyResult = new BabyResult(); | |
| 153 | - | |
| 154 | - // 填充小孩信息 | |
| 155 | - babyResult.convertToResult(baby); | |
| 156 | - babyResult.setMotherName(puerModel.getName()); | |
| 157 | - babyResult.setMotherPhone(puerModel.getPhone()); | |
| 158 | - // HashMap map = (HashMap)JsonUtil.str2Obj(puerModel.getAddress(), HashMap.class); | |
| 159 | - // 需要将数据库中的json结构地址解析出来 | |
| 160 | - HashMap<String, String> map = new HashMap<>(); | |
| 161 | - map.put("address", "测试地址"); | |
| 162 | - babyResult.setAddress(map.get("address").toString()); | |
| 163 | - babyResult.setParentId(puerModel.getId()); | |
| 164 | - // TODO 需要根据产妇模型上的社区id获取社区信息 | |
| 165 | - babyResult.setCommunity(StringUtils.isEmpty(puerModel.getCommunityId()) ? "" : puerModel.getCommunityId()); | |
| 166 | - return babyResult; | |
| 167 | - } | |
| 168 | - | |
| 169 | - public BabyResult buildResult(BabyModel baby, Patients puerModel) { | |
| 170 | - BabyResult babyResult = new BabyResult(); | |
| 171 | - | |
| 172 | - // 填充小孩信息 | |
| 173 | - babyResult.convertToResult(baby); | |
| 174 | - babyResult.setMotherName(puerModel.getUsername()); | |
| 175 | - babyResult.setMotherPhone(puerModel.getPhone()); | |
| 176 | - // HashMap map = (HashMap)JsonUtil.str2Obj(puerModel.getAddress(), HashMap.class); | |
| 177 | - // 需要将数据库中的json结构地址解析出来 | |
| 178 | - HashMap<String, String> map = new HashMap<>(); | |
| 179 | - map.put("address", "测试地址"); | |
| 180 | - babyResult.setAddress(map.get("address").toString()); | |
| 181 | - babyResult.setParentId(puerModel.getId()); | |
| 182 | - // TODO 需要根据产妇模型上的社区id获取社区信息 | |
| 183 | - babyResult.setCommunity(StringUtils.isEmpty(puerModel.getCommunityId()) ? "" : puerModel.getCommunityId()); | |
| 184 | - return babyResult; | |
| 185 | - } | |
| 186 | - | |
| 187 | 125 | public BabyResult buildResult(BabyModel patients, String communityId) { |
| 188 | 126 | BabyResult babyResult = new BabyResult(); |
| 189 | - /* String addr = ""; | |
| 190 | - if (StringUtils.isNotEmpty(patients.getAddress())) { | |
| 191 | - try { | |
| 192 | - Map map = JsonUtil.str2Obj(patients.getAddress(), Map.class); | |
| 193 | - addr = map.get("d").toString(); | |
| 194 | - } catch (Exception e) { | |
| 195 | - addr = ""; | |
| 196 | - } | |
| 197 | - }*/ | |
| 127 | + | |
| 198 | 128 | babyResult.setAddress(patients.getAddress()); |
| 199 | 129 | babyResult.setFullAddr(CommonsHelper.getFullAddress(patients.getProvinceId(), patients.getCityId(), patients.getAreaId(), patients.getAddress(),basicConfigService)); |
| 200 | 130 | babyResult.setCommunityId(StringUtils.isEmpty(communityId) ? "" : communityId); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BasicConfigFacade.java
View file @
d1acd63
| ... | ... | @@ -47,12 +47,6 @@ |
| 47 | 47 | return new BaseListResponse().setData(buildResult(data)).setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功").setPageInfo(basicConfigQuery.getPageInfo()); |
| 48 | 48 | } |
| 49 | 49 | |
| 50 | -/* public BaseListResponse findByParentId(String id){ | |
| 51 | - BasicConfigQuery basicConfigQuery = new BasicConfigQuery(); | |
| 52 | - basicConfigQuery.setParentId(id); | |
| 53 | - List<BasicConfig> data = basicConfigService.queryBasicConfig(basicConfigQuery); | |
| 54 | - return new BaseListResponse().setData(buildResult(data)).setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功"); | |
| 55 | - }*/ | |
| 56 | 50 | |
| 57 | 51 | public List<BasicConfigResult> buildResult( List<BasicConfig> data){ |
| 58 | 52 | List<BasicConfigResult> dataList = new ArrayList<>(); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/VisitFacade.java
View file @
d1acd63
| ... | ... | @@ -172,14 +172,13 @@ |
| 172 | 172 | |
| 173 | 173 | patients.setCreated(new Date()); |
| 174 | 174 | patients.setModified(new Date()); |
| 175 | - patientsService.updatePatient(patients/*.build()*/); | |
| 175 | + patientsService.updatePatient(patients); | |
| 176 | 176 | } |
| 177 | 177 | } else { |
| 178 | 178 | return new BaseResponse().setErrorcode(ErrorCodeConstants.PARAMETER_ERROR).setErrormsg("产妇信息不存在"); |
| 179 | 179 | } |
| 180 | 180 | } else { |
| 181 | 181 | // 表示是新的产妇直接新增 |
| 182 | -// parentId = puerperaService.addPuerpera(visitRequest.getPuerpera().build()).getId(); | |
| 183 | 182 | parentId = addOnePatients(visitRequest.getPatients()); |
| 184 | 183 | } |
| 185 | 184 | |
| ... | ... | @@ -381,11 +380,6 @@ |
| 381 | 380 | */ |
| 382 | 381 | public BaseObjectResponse findBabyVisitByMotherCardNo(String cardNo) { |
| 383 | 382 | // 根据身份证号获取到产妇信息 |
| 384 | - /* BabyModel puerperaModel = findOnePuerperaByCardNo(cardNo,2); | |
| 385 | - if (null == puerperaModel) { | |
| 386 | - return new BaseObjectResponse().setErrorcode(ErrorCodeConstants.DEPT_NOT_EXISTS).setErrormsg("产妇信息不存在"); | |
| 387 | - } | |
| 388 | - return findBabyVisit(puerperaModel);*/ | |
| 389 | 383 | BabyModel babyModel = findOneBabyByMphone(cardNo); |
| 390 | 384 | |
| 391 | 385 | if (null != babyModel) { |
| ... | ... | @@ -428,10 +422,7 @@ |
| 428 | 422 | |
| 429 | 423 | |
| 430 | 424 | private BaseObjectResponse findBabyVisit(BabyModel babyModel) { |
| 431 | -/* BabyModelQuery babyQuery = new BabyModelQuery(); | |
| 432 | - babyQuery.setParentId(puerperaModel.getId()); | |
| 433 | - babyQuery.setYn(YnEnums.YES.getId()); | |
| 434 | - List<BabyModel> babies = babyService.queryBabyWithQuery(babyQuery);*/ | |
| 425 | + | |
| 435 | 426 | BabyVisitResult babyVisitResult = new BabyVisitResult(); |
| 436 | 427 | List<BabyVisitResult.BabyVisit> data = new ArrayList<BabyVisitResult.BabyVisit>(); |
| 437 | 428 | // 根据产妇id查询该产妇下的小孩访视 |
platform-operate-api/src/main/resources/log4j_config.xml
View file @
d1acd63
| ... | ... | @@ -15,7 +15,7 @@ |
| 15 | 15 | </filter> |
| 16 | 16 | </appender> |
| 17 | 17 | <!-- Normal log: [DEBUG->WARN] --> |
| 18 | - <appender name="Access" class="org.apache.log4j.RollingFileAppender"> | |
| 18 | + <appender name="Access" class="org.apache.log4j.DailyRollingFileAppender"> | |
| 19 | 19 | <param name="File" value="${catalina.base}/logs/access-perf.log" /> |
| 20 | 20 | <param name="Append" value="true" /> |
| 21 | 21 | <param name="Threshold" value="DEBUG" /> |
| ... | ... | @@ -23,7 +23,7 @@ |
| 23 | 23 | <param name="ConversionPattern" value="%d %p - %m%n" /> |
| 24 | 24 | </layout> |
| 25 | 25 | </appender> |
| 26 | - <appender name="Info" class="org.apache.log4j.RollingFileAppender"> | |
| 26 | + <appender name="Info" class="org.apache.log4j.DailyRollingFileAppender"> | |
| 27 | 27 | <param name="Append" value="true" /> |
| 28 | 28 | <param name="File" value="${catalina.base}/logs/biz_info.log" /> |
| 29 | 29 | <layout class="org.apache.log4j.PatternLayout"> |
| ... | ... | @@ -36,7 +36,7 @@ |
| 36 | 36 | </filter> |
| 37 | 37 | </appender> |
| 38 | 38 | <!-- ERORR LOG: [ERROR->FATAL] --> |
| 39 | - <appender name="Error" class="org.apache.log4j.RollingFileAppender"> | |
| 39 | + <appender name="Error" class="org.apache.log4j.DailyRollingFileAppender"> | |
| 40 | 40 | <param name="Append" value="true" /> |
| 41 | 41 | <param name="File" value="${catalina.base}/logs/common_error.log" /> |
| 42 | 42 | <layout class="org.apache.log4j.PatternLayout"> |
| ... | ... | @@ -54,7 +54,7 @@ |
| 54 | 54 | <!-- ========================================================================================== --> |
| 55 | 55 | |
| 56 | 56 | |
| 57 | - <appender name="DAL-MONITOR" class="org.apache.log4j.RollingFileAppender"> | |
| 57 | + <appender name="DAL-MONITOR" class="org.apache.log4j.DailyRollingFileAppender"> | |
| 58 | 58 | <param name="Append" value="true" /> |
| 59 | 59 | <param name="File" value="${catalina.base}/logs/dal-perf.log" /> |
| 60 | 60 | <layout class="org.apache.log4j.PatternLayout"> |
platform-operate-api/src/main/resources/spring/applicationContext_biz_patient.xml
View file @
d1acd63
| ... | ... | @@ -37,7 +37,7 @@ |
| 37 | 37 | </set> |
| 38 | 38 | </property> |
| 39 | 39 | </bean> |
| 40 | - <!--自动代理dao层 | |
| 40 | + <!--自动代理dao层--> | |
| 41 | 41 | <bean |
| 42 | 42 | class="org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator" id="autoProxyCreator"> |
| 43 | 43 | <property name="beanNames" value="*Dao" /> |
| ... | ... | @@ -46,7 +46,7 @@ |
| 46 | 46 | <value>dalInterceptor</value> |
| 47 | 47 | </list> |
| 48 | 48 | </property> |
| 49 | - </bean>--> | |
| 49 | + </bean> | |
| 50 | 50 | <!-- --> |
| 51 | 51 | <bean |
| 52 | 52 | class="org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator" id="nameAutoProxyCreator"> |