Commit ad19c994262abd14c8475e9805f8bbe81e4cd6a2
Exists in
master
and in
1 other branch
Merge remote-tracking branch 'origin/master'
Showing 33 changed files
- platform-biz-patient-service/src/main/java/com/lyms/platform/biz/BasicConfigServiceTest.java
- platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/IPatientDao.java
- platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/impl/PatientDaoImpl.java
- platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/BasicConfigService.java
- platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/PatientsService.java
- platform-common/src/main/java/com/lyms/platform/common/core/resolve/MessageResolver.java
- platform-dal/src/main/java/com/lyms/platform/pojo/Patients.java
- platform-dal/src/main/java/com/lyms/platform/query/BabyModelQuery.java
- platform-dal/src/main/java/com/lyms/platform/query/PatientsQuery.java
- platform-data-api/src/main/java/com/lyms/platform/data/web/ws/EmergenceTest.java
- platform-data-api/src/main/resources/log4j.properties
- platform-data-api/src/main/webapp/WEB-INF/web.xml
- platform-job-index/pom.xml
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PuerperaManageController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/UsersController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/VisitController.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/PatientFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PuerperaManagerFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/VisitFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/PuerperaManagerUpdateRequest.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/VisitAddRequest.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/BabyVisitResult.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/PuerperaResult.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/VisitResult.java
- platform-operate-api/src/main/resources/database.properties
- platform-operate-api/src/main/resources/spring/spring-mongodb-old.xml
- platform-operate-api/src/main/resources/spring/spring-mongodb.xml
- platform-operate-api/src/main/webapp/WEB-INF/web.xml
- platform-operate-api/src/main/webapp/crossdomain.xml
- platform-resource/resources/config-dev.properties
- platform-resource/resources/config-test.properties
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/BasicConfigServiceTest.java
View file @
ad19c99
| ... | ... | @@ -21,7 +21,7 @@ |
| 21 | 21 | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| 22 | 22 | ApplicationContext applicationContext = new ClassPathXmlApplicationContext("classpath:/spring/applicationContext_biz_patient1.xml"); |
| 23 | 23 | PuerperaService basicConfigService = (PuerperaService) applicationContext.getBean(PuerperaService.class); |
| 24 | - PuerperaModel obj = new PuerperaModel(); | |
| 24 | + /* PuerperaModel obj = new PuerperaModel(); | |
| 25 | 25 | obj.setAddress("成都市高新区天府2街"); |
| 26 | 26 | obj.setAge(111); |
| 27 | 27 | obj.setDueDate(new Date()); |
| ... | ... | @@ -30,7 +30,7 @@ |
| 30 | 30 | obj.setPhone("13996289315"); |
| 31 | 31 | obj.setYn(1); |
| 32 | 32 | obj.setCardNo("50022319951267164465"); |
| 33 | -// basicConfigService.addPuerpera(obj); | |
| 33 | + basicConfigService.addPuerpera(obj); | |
| 34 | 34 | |
| 35 | 35 | PuerperaModel obj1 = new PuerperaModel(); |
| 36 | 36 | obj1.setAddress("成都市高新区天府4街"); |
| 37 | 37 | |
| ... | ... | @@ -42,15 +42,16 @@ |
| 42 | 42 | obj1.setYn(1); |
| 43 | 43 | obj1.setCommunityId("dqweqwdadadaddad"); |
| 44 | 44 | obj1.setCardNo("50022319951267164466"); |
| 45 | -// basicConfigService.addPuerpera(obj1); | |
| 45 | + basicConfigService.addPuerpera(obj1);*/ | |
| 46 | 46 | |
| 47 | 47 | PuerperaModelQuery puerperaQuery = new PuerperaModelQuery(); |
| 48 | 48 | |
| 49 | 49 | ; |
| 50 | - puerperaQuery.setKeyword("小王"); | |
| 51 | - puerperaQuery.setDueDateStart(sdf.parse("2016-1-12")); | |
| 52 | - puerperaQuery.setDueDateEnd(sdf.parse("2016-3-16")); | |
| 53 | -// System.out.println(basicConfigService.queryPuerpera(puerperaQuery)); | |
| 50 | +// puerperaQuery.setKeyword("小王"); | |
| 51 | +// puerperaQuery.setDueDateStart(sdf.parse("2016-1-12")); | |
| 52 | +// puerperaQuery.setDueDateEnd(sdf.parse("2016-3-16")); | |
| 53 | + puerperaQuery.setId("5719caf624fd57791341b7cb"); | |
| 54 | + System.out.println(basicConfigService.queryPuerpera(puerperaQuery)); | |
| 54 | 55 | /* |
| 55 | 56 | * for(int i = 6;i<7;i++){ BasicConfig obj = new BasicConfig(); obj.setCode("xc123456"+i); obj.setName("哮喘123456"+i); obj.setYn(1); |
| 56 | 57 | * obj.setParentId("56ea134c24fdaafbabbb0025"); basicConfigService.addBasicConfig(obj); } |
| ... | ... | @@ -69,7 +70,8 @@ |
| 69 | 70 | for (PuerperaModel users2 : users) { |
| 70 | 71 | System.out.println(users2.toString()); |
| 71 | 72 | }*/ |
| 72 | - addDataPermission(applicationContext); | |
| 73 | +// addDataPermission(applicationContext); | |
| 74 | + addVisit(applicationContext); | |
| 73 | 75 | } |
| 74 | 76 | |
| 75 | 77 | public static void addDataPermission(ApplicationContext applicationContext){ |
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/IPatientDao.java
View file @
ad19c99
| 1 | +package com.lyms.platform.biz.dal; | |
| 2 | + | |
| 3 | +import com.lyms.platform.common.dao.operator.MongoQuery; | |
| 4 | +import com.lyms.platform.common.dao.operator.Page; | |
| 5 | +import com.lyms.platform.pojo.Patients; | |
| 6 | +import com.lyms.platform.pojo.PuerperaModel; | |
| 7 | + | |
| 8 | +import java.util.List; | |
| 9 | + | |
| 10 | +/** | |
| 11 | + * Created by Administrator on 2016/4/22 0022. | |
| 12 | + */ | |
| 13 | +public interface IPatientDao { | |
| 14 | + public Patients addPatient(Patients obj); | |
| 15 | + | |
| 16 | + public void updatePatient(Patients obj, String id); | |
| 17 | + | |
| 18 | + public void deletePatient(String id); | |
| 19 | + | |
| 20 | + public Patients getPatient(String id); | |
| 21 | + | |
| 22 | + public int queryPatientCount(MongoQuery query); | |
| 23 | + | |
| 24 | + public List<Patients> queryPatient(MongoQuery query); | |
| 25 | + | |
| 26 | + public Page<Patients> findPage(MongoQuery query); | |
| 27 | +} |
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/impl/PatientDaoImpl.java
View file @
ad19c99
| 1 | +package com.lyms.platform.biz.dal.impl; | |
| 2 | + | |
| 3 | +import com.lyms.platform.biz.dal.IPatientDao; | |
| 4 | +import com.lyms.platform.common.dao.operator.MongoCondition; | |
| 5 | +import com.lyms.platform.common.dao.operator.MongoOper; | |
| 6 | +import com.lyms.platform.common.dao.operator.MongoQuery; | |
| 7 | +import com.lyms.platform.common.dao.operator.Page; | |
| 8 | +import com.lyms.platform.pojo.Patients; | |
| 9 | +import com.lyms.platform.common.dao.BaseMongoDAOImpl; | |
| 10 | +import org.springframework.stereotype.Repository; | |
| 11 | + | |
| 12 | +import java.util.List; | |
| 13 | + | |
| 14 | +/** | |
| 15 | + * | |
| 16 | + * 患者模型 | |
| 17 | + * | |
| 18 | + * | |
| 19 | + * Created by Administrator on 2016/4/22 0022. | |
| 20 | + */ | |
| 21 | +@Repository("patientDaoImpl") | |
| 22 | +public class PatientDaoImpl extends BaseMongoDAOImpl<Patients> implements IPatientDao { | |
| 23 | + @Override | |
| 24 | + public Patients addPatient(Patients obj) { | |
| 25 | + return save(obj); | |
| 26 | + } | |
| 27 | + | |
| 28 | + @Override | |
| 29 | + public void updatePatient(Patients obj, String id) { | |
| 30 | + update(new MongoQuery(new MongoCondition("id", id, MongoOper.IS)).convertToMongoQuery(), obj); | |
| 31 | + } | |
| 32 | + | |
| 33 | + @Override | |
| 34 | + public void deletePatient(String id) { | |
| 35 | + delete(new MongoQuery(new MongoCondition("id", id, MongoOper.IS)).convertToMongoQuery()); | |
| 36 | + } | |
| 37 | + | |
| 38 | + @Override | |
| 39 | + public Patients getPatient(String id) { | |
| 40 | + return findById(id); | |
| 41 | + } | |
| 42 | + | |
| 43 | + @Override | |
| 44 | + public int queryPatientCount(MongoQuery query) { | |
| 45 | + return (int) count(query.convertToMongoQuery()); | |
| 46 | + } | |
| 47 | + | |
| 48 | + @Override | |
| 49 | + public List<Patients> queryPatient(MongoQuery query) { | |
| 50 | + return find(query.convertToMongoQuery()); | |
| 51 | + } | |
| 52 | + | |
| 53 | + @Override | |
| 54 | + public Page<Patients> findPage(MongoQuery query) { | |
| 55 | + return findPage(query.convertToMongoQuery()); | |
| 56 | + } | |
| 57 | +} |
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/BasicConfigService.java
View file @
ad19c99
| ... | ... | @@ -41,7 +41,7 @@ |
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | public List<BasicConfig> queryParentConfig() { |
| 44 | - return basicConfigDao.queryBasicConfig(MongoCondition.newInstance("parentId", null, MongoOper.IS).and("yn", YnEnums.YES.getId(), MongoOper.IS).toMongoQuery() | |
| 44 | + return basicConfigDao.queryBasicConfig(MongoCondition.newInstance("parentId", "0", MongoOper.IS).and("yn", YnEnums.YES.getId(), MongoOper.IS).toMongoQuery() | |
| 45 | 45 | .addOrder(Direction.ASC, "id")); |
| 46 | 46 | } |
| 47 | 47 |
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/PatientsService.java
View file @
ad19c99
| 1 | +package com.lyms.platform.biz.service; | |
| 2 | + | |
| 3 | +import com.lyms.platform.biz.dal.IPatientDao; | |
| 4 | +import com.lyms.platform.common.dao.operator.MongoCondition; | |
| 5 | +import com.lyms.platform.common.dao.operator.MongoOper; | |
| 6 | +import com.lyms.platform.common.dao.operator.MongoQuery; | |
| 7 | +import com.lyms.platform.common.dao.operator.Page; | |
| 8 | +import com.lyms.platform.pojo.Patients; | |
| 9 | +import com.lyms.platform.pojo.PuerperaModel; | |
| 10 | +import com.lyms.platform.query.PatientsQuery; | |
| 11 | +import com.lyms.platform.query.PuerperaModelQuery; | |
| 12 | +import org.apache.commons.collections.CollectionUtils; | |
| 13 | +import org.apache.commons.lang.StringUtils; | |
| 14 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 15 | +import org.springframework.data.domain.Sort; | |
| 16 | +import org.springframework.stereotype.Service; | |
| 17 | + | |
| 18 | +import java.util.List; | |
| 19 | + | |
| 20 | +/** | |
| 21 | + * Created by Administrator on 2016/4/22 0022. | |
| 22 | + */ | |
| 23 | +@Service | |
| 24 | +public class PatientsService { | |
| 25 | + | |
| 26 | + @Autowired | |
| 27 | + private IPatientDao iPatientDao; | |
| 28 | + | |
| 29 | + public Patients addPatient(Patients obj) { | |
| 30 | + return iPatientDao.addPatient(obj); | |
| 31 | + } | |
| 32 | + | |
| 33 | + public void updatePatient(Patients obj) { | |
| 34 | + iPatientDao.updatePatient(obj, obj.getId()); | |
| 35 | + } | |
| 36 | + | |
| 37 | + public List<Patients> queryPatient(PatientsQuery patientsQuery) { | |
| 38 | + MongoQuery query = patientsQuery.convertToQuery(); | |
| 39 | + if (StringUtils.isNotEmpty(patientsQuery.getNeed())) { | |
| 40 | + patientsQuery.mysqlBuild(iPatientDao.queryPatientCount(patientsQuery.convertToQuery())); | |
| 41 | + query.start(patientsQuery.getOffset()).end(patientsQuery.getLimit()); | |
| 42 | + } | |
| 43 | + | |
| 44 | + return iPatientDao.queryPatient(query.addOrder(Sort.Direction.ASC, "id")); | |
| 45 | + } | |
| 46 | + | |
| 47 | + /** | |
| 48 | + * 根据身份证号码查询某一个患者 | |
| 49 | + * | |
| 50 | + * @return | |
| 51 | + */ | |
| 52 | + public Patients findOnePatientByCardNo(PatientsQuery puerperaQuery) { | |
| 53 | + List<Patients> result = iPatientDao.queryPatient(puerperaQuery.convertToQuery()); | |
| 54 | + if(CollectionUtils.isEmpty(result)){ | |
| 55 | + return result.get(0); | |
| 56 | + } | |
| 57 | + return null; | |
| 58 | + } | |
| 59 | + | |
| 60 | + public Patients findOnePatientById(String id) { | |
| 61 | + return iPatientDao.getPatient(id); | |
| 62 | + } | |
| 63 | +} |
platform-common/src/main/java/com/lyms/platform/common/core/resolve/MessageResolver.java
View file @
ad19c99
| ... | ... | @@ -2,6 +2,7 @@ |
| 2 | 2 | |
| 3 | 3 | import java.util.Properties; |
| 4 | 4 | |
| 5 | +import org.apache.commons.lang.StringUtils; | |
| 5 | 6 | import org.springframework.beans.factory.InitializingBean; |
| 6 | 7 | import org.springframework.core.io.ClassPathResource; |
| 7 | 8 | import org.springframework.core.io.support.EncodedResource; |
| ... | ... | @@ -34,6 +35,9 @@ |
| 34 | 35 | } |
| 35 | 36 | |
| 36 | 37 | public String getErrorMessage(String key) { |
| 38 | + if(StringUtils.isEmpty(messageMapHolder.getProperty(key))){ | |
| 39 | + return key; | |
| 40 | + } | |
| 37 | 41 | return messageMapHolder.getProperty(key); |
| 38 | 42 | } |
| 39 | 43 |
platform-dal/src/main/java/com/lyms/platform/pojo/Patients.java
View file @
ad19c99
| ... | ... | @@ -2,9 +2,45 @@ |
| 2 | 2 | |
| 3 | 3 | import java.util.Date; |
| 4 | 4 | |
| 5 | +import com.lyms.platform.common.result.BaseModel; | |
| 5 | 6 | import com.lyms.platform.common.utils.DateUtil; |
| 7 | +import org.springframework.data.mongodb.core.mapping.Document; | |
| 8 | +import org.springframework.data.mongodb.core.mapping.Field; | |
| 6 | 9 | |
| 7 | -public class Patients { | |
| 10 | + | |
| 11 | +@Document(collection="lyms_patient") | |
| 12 | +public class Patients extends BaseModel { | |
| 13 | + | |
| 14 | + | |
| 15 | + /** | |
| 16 | + * 身份证号码 | |
| 17 | + */ | |
| 18 | + @Field("cardno") | |
| 19 | + private String cardNo; | |
| 20 | + /** | |
| 21 | + * 助产机构 | |
| 22 | + */ | |
| 23 | + @Field("deliverorg") | |
| 24 | + private String deliverOrg; | |
| 25 | + /** | |
| 26 | + * 分娩方式 | |
| 27 | + */ | |
| 28 | + @Field("duetype") | |
| 29 | + private String dueType; | |
| 30 | + | |
| 31 | + /** | |
| 32 | + * 地址 | |
| 33 | + */ | |
| 34 | + private String address; | |
| 35 | + /** | |
| 36 | + * 社区id | |
| 37 | + */ | |
| 38 | + private String communityId; | |
| 39 | + /** | |
| 40 | + * 是否访视 | |
| 41 | + */ | |
| 42 | + private int isVisit; | |
| 43 | + | |
| 8 | 44 | private String id; |
| 9 | 45 | |
| 10 | 46 | private String username; |
| ... | ... | @@ -225,6 +261,54 @@ |
| 225 | 261 | |
| 226 | 262 | public void setCreated(Date created) { |
| 227 | 263 | this.created = created; |
| 264 | + } | |
| 265 | + | |
| 266 | + public String getAddress() { | |
| 267 | + return address; | |
| 268 | + } | |
| 269 | + | |
| 270 | + public void setAddress(String address) { | |
| 271 | + this.address = address; | |
| 272 | + } | |
| 273 | + | |
| 274 | + public String getCardNo() { | |
| 275 | + return cardNo; | |
| 276 | + } | |
| 277 | + | |
| 278 | + public void setCardNo(String cardNo) { | |
| 279 | + this.cardNo = cardNo; | |
| 280 | + } | |
| 281 | + | |
| 282 | + public String getCommunityId() { | |
| 283 | + return communityId; | |
| 284 | + } | |
| 285 | + | |
| 286 | + public void setCommunityId(String communityId) { | |
| 287 | + this.communityId = communityId; | |
| 288 | + } | |
| 289 | + | |
| 290 | + public String getDeliverOrg() { | |
| 291 | + return deliverOrg; | |
| 292 | + } | |
| 293 | + | |
| 294 | + public void setDeliverOrg(String deliverOrg) { | |
| 295 | + this.deliverOrg = deliverOrg; | |
| 296 | + } | |
| 297 | + | |
| 298 | + public String getDueType() { | |
| 299 | + return dueType; | |
| 300 | + } | |
| 301 | + | |
| 302 | + public void setDueType(String dueType) { | |
| 303 | + this.dueType = dueType; | |
| 304 | + } | |
| 305 | + | |
| 306 | + public int getIsVisit() { | |
| 307 | + return isVisit; | |
| 308 | + } | |
| 309 | + | |
| 310 | + public void setIsVisit(int isVisit) { | |
| 311 | + this.isVisit = isVisit; | |
| 228 | 312 | } |
| 229 | 313 | } |
platform-dal/src/main/java/com/lyms/platform/query/BabyModelQuery.java
View file @
ad19c99
| ... | ... | @@ -2,6 +2,7 @@ |
| 2 | 2 | |
| 3 | 3 | import java.util.Date; |
| 4 | 4 | |
| 5 | +import org.bson.types.ObjectId; | |
| 5 | 6 | import org.springframework.data.mongodb.core.query.Criteria; |
| 6 | 7 | |
| 7 | 8 | import com.lyms.platform.common.base.IConvertToNativeQuery; |
| ... | ... | @@ -124,7 +125,7 @@ |
| 124 | 125 | condition = condition.and("visitstatus", visitstatus, MongoOper.IS); |
| 125 | 126 | } |
| 126 | 127 | if (null != id) { |
| 127 | - condition = condition.and("id", id, MongoOper.IS); | |
| 128 | + condition = condition.and("id", new ObjectId(id), MongoOper.IS); | |
| 128 | 129 | } |
| 129 | 130 | if(-1!=yn){ |
| 130 | 131 | condition = condition.and("yn", yn, MongoOper.IS); |
platform-dal/src/main/java/com/lyms/platform/query/PatientsQuery.java
View file @
ad19c99
| 1 | +package com.lyms.platform.query; | |
| 2 | + | |
| 3 | +import com.lyms.platform.common.base.IConvertToNativeQuery; | |
| 4 | +import com.lyms.platform.common.dao.BaseQuery; | |
| 5 | +import com.lyms.platform.common.dao.operator.MongoCondition; | |
| 6 | +import com.lyms.platform.common.dao.operator.MongoOper; | |
| 7 | +import com.lyms.platform.common.dao.operator.MongoQuery; | |
| 8 | +import org.bson.types.ObjectId; | |
| 9 | +import org.springframework.data.mongodb.core.query.Criteria; | |
| 10 | + | |
| 11 | +import java.util.Date; | |
| 12 | + | |
| 13 | +/** | |
| 14 | + * | |
| 15 | + * 产妇模型定义 | |
| 16 | + * | |
| 17 | + * @author Administrator | |
| 18 | + * | |
| 19 | + */ | |
| 20 | +public class PatientsQuery extends BaseQuery implements IConvertToNativeQuery{ | |
| 21 | + | |
| 22 | + private String id; | |
| 23 | + | |
| 24 | + /** | |
| 25 | + * 关键字 | |
| 26 | + */ | |
| 27 | + private String keyword; | |
| 28 | + | |
| 29 | + /** | |
| 30 | + * 产妇名称 | |
| 31 | + */ | |
| 32 | + private String name; | |
| 33 | + /** | |
| 34 | + * 产妇年龄 | |
| 35 | + */ | |
| 36 | + private int age; | |
| 37 | + /** | |
| 38 | + * 访视状态 | |
| 39 | + */ | |
| 40 | + private int visitstatus=-1; | |
| 41 | + /** | |
| 42 | + * 产妇手机号 | |
| 43 | + */ | |
| 44 | + private String phone; | |
| 45 | + /** | |
| 46 | + * 产妇分娩日期 | |
| 47 | + */ | |
| 48 | + private Date dueDateStart; | |
| 49 | + | |
| 50 | + private Date dueDateEnd; | |
| 51 | + | |
| 52 | + /** | |
| 53 | + * 地址 | |
| 54 | + */ | |
| 55 | + private String address; | |
| 56 | + /** | |
| 57 | + * 社区id | |
| 58 | + */ | |
| 59 | + private String communityId; | |
| 60 | + | |
| 61 | + /** | |
| 62 | + * 身份证号码 | |
| 63 | + */ | |
| 64 | + private String cardNo; | |
| 65 | + | |
| 66 | + | |
| 67 | + /** | |
| 68 | + * 是否有效 | |
| 69 | + */ | |
| 70 | + private int yn; | |
| 71 | + | |
| 72 | + | |
| 73 | + public String getCardNo() { | |
| 74 | + return cardNo; | |
| 75 | + } | |
| 76 | + public void setCardNo(String cardNo) { | |
| 77 | + this.cardNo = cardNo; | |
| 78 | + } | |
| 79 | + public int getVisitstatus() { | |
| 80 | + return visitstatus; | |
| 81 | + } | |
| 82 | + public void setVisitstatus(int visitstatus) { | |
| 83 | + this.visitstatus = visitstatus; | |
| 84 | + } | |
| 85 | + public String getKeyword() { | |
| 86 | + return keyword; | |
| 87 | + } | |
| 88 | + public void setKeyword(String keyword) { | |
| 89 | + this.keyword = keyword; | |
| 90 | + } | |
| 91 | + public Date getDueDateStart() { | |
| 92 | + return dueDateStart; | |
| 93 | + } | |
| 94 | + public void setDueDateStart(Date dueDateStart) { | |
| 95 | + this.dueDateStart = dueDateStart; | |
| 96 | + } | |
| 97 | + public Date getDueDateEnd() { | |
| 98 | + return dueDateEnd; | |
| 99 | + } | |
| 100 | + public void setDueDateEnd(Date dueDateEnd) { | |
| 101 | + this.dueDateEnd = dueDateEnd; | |
| 102 | + } | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + public int getYn() { | |
| 107 | + return yn; | |
| 108 | + } | |
| 109 | + public void setYn(int yn) { | |
| 110 | + this.yn = yn; | |
| 111 | + } | |
| 112 | + public String getName() { | |
| 113 | + return name; | |
| 114 | + } | |
| 115 | + public void setName(String name) { | |
| 116 | + this.name = name; | |
| 117 | + } | |
| 118 | + public int getAge() { | |
| 119 | + return age; | |
| 120 | + } | |
| 121 | + public void setAge(int age) { | |
| 122 | + this.age = age; | |
| 123 | + } | |
| 124 | + public String getPhone() { | |
| 125 | + return phone; | |
| 126 | + } | |
| 127 | + public void setPhone(String phone) { | |
| 128 | + this.phone = phone; | |
| 129 | + } | |
| 130 | + | |
| 131 | + public String getAddress() { | |
| 132 | + return address; | |
| 133 | + } | |
| 134 | + public void setAddress(String address) { | |
| 135 | + this.address = address; | |
| 136 | + } | |
| 137 | + public String getCommunityId() { | |
| 138 | + return communityId; | |
| 139 | + } | |
| 140 | + public void setCommunityId(String communityId) { | |
| 141 | + this.communityId = communityId; | |
| 142 | + } | |
| 143 | + public MongoQuery convertToQuery() { | |
| 144 | + MongoCondition condition = MongoCondition.newInstance(); | |
| 145 | + if(null!=keyword){ | |
| 146 | + MongoCondition con1= MongoCondition.newInstance("phone", keyword, MongoOper.LIKE); | |
| 147 | + MongoCondition con = MongoCondition.newInstance("username", keyword, MongoOper.LIKE); | |
| 148 | + condition = condition.orCondition(new MongoCondition[]{con1,con}); | |
| 149 | + } | |
| 150 | + if(visitstatus!=-1){ | |
| 151 | + condition= condition.and("visitstatus", visitstatus, MongoOper.IS); | |
| 152 | + } | |
| 153 | + if(null!=communityId){ | |
| 154 | + condition= condition.and("communityId", communityId, MongoOper.IS); | |
| 155 | + } | |
| 156 | + if(null!=id){ | |
| 157 | + condition= condition.and("id", new ObjectId(id), MongoOper.IS); | |
| 158 | + } | |
| 159 | + if(null!=cardNo){ | |
| 160 | + condition=condition.and("cardno", cardNo, MongoOper.IS); | |
| 161 | + } | |
| 162 | + /*if(null!=dueDateStart){ | |
| 163 | +// condition= condition.elemMatch("dueDate",MongoCondition.newInstance("$lte", dueDateStart, MongoOper.IS).and("$gte", dueDateEnd, MongoOper.IS)); | |
| 164 | +// condition=condition.and("dueDate", dueDateStart, MongoOper.GTE).and("dueDate", dueDateEnd, MongoOper.LTE); | |
| 165 | + Criteria c = Criteria.where("dueDate").gte(dueDateStart).lte(dueDateEnd).andOperator(condition.getCriteria()); | |
| 166 | + return new MongoCondition(c).toMongoQuery(); | |
| 167 | + }*/ | |
| 168 | + boolean isAddStart = Boolean.FALSE; | |
| 169 | + Criteria c = null; | |
| 170 | + if (null != dueDateStart) { | |
| 171 | + c = Criteria.where("dueDate").gte(dueDateStart); | |
| 172 | + isAddStart = Boolean.TRUE; | |
| 173 | + } | |
| 174 | + | |
| 175 | + if (null != dueDateEnd) { | |
| 176 | + if (isAddStart) { | |
| 177 | + c=c.lte(dueDateEnd); | |
| 178 | + } else { | |
| 179 | + c = Criteria.where("dueDate").lte(dueDateEnd); | |
| 180 | + } | |
| 181 | + isAddStart = Boolean.TRUE; | |
| 182 | + } | |
| 183 | + if (isAddStart) { | |
| 184 | + return new MongoCondition(c.andOperator(condition.getCriteria())).toMongoQuery(); | |
| 185 | + } | |
| 186 | + | |
| 187 | + return condition.toMongoQuery(); | |
| 188 | + } | |
| 189 | + public String getId() { | |
| 190 | + return id; | |
| 191 | + } | |
| 192 | + public void setId(String id) { | |
| 193 | + this.id = id; | |
| 194 | + } | |
| 195 | + | |
| 196 | + | |
| 197 | +} |
platform-data-api/src/main/java/com/lyms/platform/data/web/ws/EmergenceTest.java
View file @
ad19c99
| ... | ... | @@ -16,7 +16,7 @@ |
| 16 | 16 | factoryBean.getInInterceptors().add(new LoggingInInterceptor()); |
| 17 | 17 | factoryBean.getOutInterceptors().add(new LoggingOutInterceptor()); |
| 18 | 18 | factoryBean.setServiceClass(SoapV1Service.class); |
| 19 | - factoryBean.setAddress("http://localhost:8080/services/v1"); | |
| 19 | + factoryBean.setAddress("http://soap.stage.healthbaby.com.cn/services/v1"); | |
| 20 | 20 | SoapV1Service impl=(SoapV1Service) factoryBean.create(); |
| 21 | 21 | System.out.println(impl.addHospital(new WsHospitals()).getErrormsg()); |
| 22 | 22 |
platform-data-api/src/main/resources/log4j.properties
View file @
ad19c99
| 1 | +log4j.rootLogger=DEBUG,CONSOLE,FILEOUT | |
| 2 | +log4j.addivity.org.apache=true | |
| 3 | +log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender | |
| 4 | +log4j.appender.Threshold=ERROR | |
| 5 | +log4j.appender.CONSOLE.Target=System.out | |
| 6 | +log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout | |
| 7 | +log4j.appender.CONSOLE.layout.ConversionPattern=[%-5p] %d{yyyy-MM-dd HH\:mm\:ss} :%m%n # | |
| 8 | +log4j.appender.FILEOUT=org.apache.log4j.RollingFileAppender | |
| 9 | +log4j.appender.FILEOUT.File=${catalina.home}/file.log | |
| 10 | +log4j.appender.fileout.MaxFileSize=100000KB | |
| 11 | +log4j.appender.FILEOUT.Append=true | |
| 12 | +log4j.appender.FILEOUT.layout=org.apache.log4j.PatternLayout | |
| 13 | +log4j.appender.FILEOUT.layout.ConversionPattern=[%-5p]_%d{yyyy-MM-dd HH:mm:ss} :%m%n |
platform-data-api/src/main/webapp/WEB-INF/web.xml
View file @
ad19c99
| ... | ... | @@ -39,7 +39,7 @@ |
| 39 | 39 | </session-config> |
| 40 | 40 | <context-param> |
| 41 | 41 | <param-name>log4jConfigLocation</param-name> |
| 42 | - <param-value>classpath:log4j_config.xml</param-value> | |
| 42 | + <param-value>classpath:log4j.properties</param-value> | |
| 43 | 43 | </context-param> |
| 44 | 44 | <context-param> |
| 45 | 45 | <param-name>log4jRefreshInterval</param-name> |
platform-job-index/pom.xml
View file @
ad19c99
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PuerperaManageController.java
View file @
ad19c99
| ... | ... | @@ -2,6 +2,7 @@ |
| 2 | 2 | |
| 3 | 3 | import javax.validation.Valid; |
| 4 | 4 | |
| 5 | +import com.lyms.platform.operate.web.facade.PatientFacade; | |
| 5 | 6 | import com.lyms.platform.operate.web.request.PuerperaMatcherCommunityRequest; |
| 6 | 7 | import org.springframework.beans.factory.annotation.Autowired; |
| 7 | 8 | import org.springframework.stereotype.Controller; |
| ... | ... | @@ -26,6 +27,8 @@ |
| 26 | 27 | |
| 27 | 28 | @Autowired |
| 28 | 29 | private PuerperaManagerFacade puerperaManagerFacade; |
| 30 | + @Autowired | |
| 31 | + private PatientFacade patientFacade; | |
| 29 | 32 | |
| 30 | 33 | /** |
| 31 | 34 | * 产妇管理查询接口 |
| 32 | 35 | |
| ... | ... | @@ -36,9 +39,9 @@ |
| 36 | 39 | @RequestMapping(value = "/puerperamanage", method = RequestMethod.GET) |
| 37 | 40 | @ResponseBody |
| 38 | 41 | public BaseListResponse queryPuerperaList(@Valid PuerperaManagerQueryRequest managerRequest) { |
| 39 | - return puerperaManagerFacade.findPuerperaList(managerRequest); | |
| 42 | + return patientFacade.findPatientList(managerRequest); | |
| 40 | 43 | } |
| 41 | - | |
| 44 | + | |
| 42 | 45 | /** |
| 43 | 46 | * |
| 44 | 47 | * 产妇管理删除接口 |
| ... | ... | @@ -51,7 +54,7 @@ |
| 51 | 54 | @ResponseBody |
| 52 | 55 | public BaseResponse deleteOnePuerperaById(@RequestParam("id") String id) { |
| 53 | 56 | //软删除数据 |
| 54 | - return puerperaManagerFacade.deleteOnePuerperaById(id, Boolean.TRUE); | |
| 57 | + return patientFacade.deleteOnePuerperaById(id, Boolean.TRUE); | |
| 55 | 58 | } |
| 56 | 59 | |
| 57 | 60 | /** |
| ... | ... | @@ -65,7 +68,7 @@ |
| 65 | 68 | @ResponseBody |
| 66 | 69 | @RequestMapping(value = "/matchpuerpera", method = RequestMethod.POST) |
| 67 | 70 | public BaseResponse matchCommunity(@Valid PuerperaMatcherCommunityRequest puerperaMatcherCommunityRequest){ |
| 68 | - return puerperaManagerFacade.matchCommunity(puerperaMatcherCommunityRequest); | |
| 71 | + return patientFacade.matchCommunity(puerperaMatcherCommunityRequest); | |
| 69 | 72 | } |
| 70 | 73 | /** |
| 71 | 74 | * 产妇管理修改 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/UsersController.java
View file @
ad19c99
| ... | ... | @@ -356,7 +356,7 @@ |
| 356 | 356 | /** |
| 357 | 357 | * 添加管理员信息 |
| 358 | 358 | */ |
| 359 | - @RequestMapping(value = "/admin", method = RequestMethod.POST) | |
| 359 | + @RequestMapping(value = "/admins", method = RequestMethod.POST) | |
| 360 | 360 | @TokenRequired |
| 361 | 361 | public void addAdmin(HttpServletResponse response, |
| 362 | 362 | HttpServletRequest request, |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/VisitController.java
View file @
ad19c99
| ... | ... | @@ -4,11 +4,9 @@ |
| 4 | 4 | |
| 5 | 5 | import org.apache.commons.lang.StringUtils; |
| 6 | 6 | import org.springframework.beans.factory.annotation.Autowired; |
| 7 | +import org.springframework.http.MediaType; | |
| 7 | 8 | import org.springframework.stereotype.Controller; |
| 8 | -import org.springframework.web.bind.annotation.PathVariable; | |
| 9 | -import org.springframework.web.bind.annotation.RequestMapping; | |
| 10 | -import org.springframework.web.bind.annotation.RequestMethod; | |
| 11 | -import org.springframework.web.bind.annotation.ResponseBody; | |
| 9 | +import org.springframework.web.bind.annotation.*; | |
| 12 | 10 | |
| 13 | 11 | import com.lyms.platform.common.constants.ErrorCodeConstants; |
| 14 | 12 | import com.lyms.platform.common.result.BaseObjectResponse; |
| ... | ... | @@ -58,8 +56,8 @@ |
| 58 | 56 | * @return 返回结果 |
| 59 | 57 | */ |
| 60 | 58 | @ResponseBody |
| 61 | - @RequestMapping(value = "/visitpuerpera", method = RequestMethod.POST) | |
| 62 | - public BaseResponse addOneVisit(@Valid | |
| 59 | + @RequestMapping(value = "/visitpuerpera", method = RequestMethod.POST,produces = MediaType.APPLICATION_JSON_VALUE,consumes =MediaType.APPLICATION_JSON_VALUE ) | |
| 60 | + public BaseResponse addOneVisit(@Valid @RequestBody | |
| 63 | 61 | VisitAddRequest visitAddRequest) { |
| 64 | 62 | return visitFacade.addOneVisit(visitAddRequest); |
| 65 | 63 | } |
| ... | ... | @@ -72,7 +70,7 @@ |
| 72 | 70 | * @return 返回结果 |
| 73 | 71 | */ |
| 74 | 72 | @ResponseBody |
| 75 | - @RequestMapping(value = "/visitbaby", method = RequestMethod.POST) | |
| 73 | + @RequestMapping(value = "/visitbaby", method = RequestMethod.POST,produces = MediaType.APPLICATION_JSON_VALUE,consumes =MediaType.APPLICATION_JSON_VALUE ) | |
| 76 | 74 | public BaseResponse addOneBabyVisit(@Valid |
| 77 | 75 | BabyVisitAddRequest babyVisitAddRequest) { |
| 78 | 76 | return visitFacade.addOrUpdateBabyAndVisit(babyVisitAddRequest); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyManagerFacade.java
View file @
ad19c99
| ... | ... | @@ -4,6 +4,9 @@ |
| 4 | 4 | import java.util.HashMap; |
| 5 | 5 | import java.util.List; |
| 6 | 6 | |
| 7 | +import com.lyms.platform.biz.service.PatientsService; | |
| 8 | +import com.lyms.platform.pojo.Patients; | |
| 9 | +import com.lyms.platform.query.PatientsQuery; | |
| 7 | 10 | import org.apache.commons.collections.CollectionUtils; |
| 8 | 11 | import org.apache.commons.lang.StringUtils; |
| 9 | 12 | import org.springframework.beans.factory.annotation.Autowired; |
| ... | ... | @@ -28,6 +31,8 @@ |
| 28 | 31 | |
| 29 | 32 | @Autowired |
| 30 | 33 | private PuerperaService puerperaService; |
| 34 | + @Autowired | |
| 35 | + private PatientsService patientsService; | |
| 31 | 36 | |
| 32 | 37 | @Autowired |
| 33 | 38 | private BabyService babyService; |
| 34 | 39 | |
| 35 | 40 | |
| ... | ... | @@ -52,11 +57,13 @@ |
| 52 | 57 | if (StringUtils.isNotEmpty(babyManagerRequest.getKeyword())) { |
| 53 | 58 | PuerperaModelQuery puerperaQuery = new PuerperaModelQuery(); |
| 54 | 59 | puerperaQuery.setKeyword(babyManagerRequest.getKeyword()); |
| 60 | + PatientsQuery patientsQuery = new PatientsQuery(); | |
| 61 | + patientsQuery.setKeyword(babyManagerRequest.getKeyword()); | |
| 55 | 62 | // 符合关键字的产妇列表 |
| 56 | - List<PuerperaModel> puerList = puerperaService.queryPuerpera(puerperaQuery); | |
| 57 | - | |
| 63 | +// List<PuerperaModel> puerList = puerperaService.queryPuerpera(puerperaQuery); | |
| 64 | + List<Patients> puerList = patientsService.queryPatient(patientsQuery); | |
| 58 | 65 | if (CollectionUtils.isNotEmpty(puerList)) { |
| 59 | - for (PuerperaModel model : puerList) { | |
| 66 | + /* for (PuerperaModel model : puerList) { | |
| 60 | 67 | babyQuery.setParentId(model.getId()); |
| 61 | 68 | List<BabyModel> babies = babyService.queryBabyWithQuery(babyQuery); |
| 62 | 69 | if (CollectionUtils.isNotEmpty(babies)) { |
| ... | ... | @@ -64,6 +71,16 @@ |
| 64 | 71 | data.add(buildResult(baby, model)); |
| 65 | 72 | } |
| 66 | 73 | } |
| 74 | + }*/ | |
| 75 | + | |
| 76 | + for(Patients model : puerList) { | |
| 77 | + babyQuery.setParentId(model.getId()); | |
| 78 | + List<BabyModel> babies = babyService.queryBabyWithQuery(babyQuery); | |
| 79 | + if (CollectionUtils.isNotEmpty(babies)) { | |
| 80 | + for (BabyModel baby : babies) { | |
| 81 | + data.add(buildResult(baby, model)); | |
| 82 | + } | |
| 83 | + } | |
| 67 | 84 | } |
| 68 | 85 | } |
| 69 | 86 | } else { |
| ... | ... | @@ -71,7 +88,7 @@ |
| 71 | 88 | List<BabyModel> babies = babyService.queryBabyWithQuery(babyQuery); |
| 72 | 89 | if (CollectionUtils.isNotEmpty(babies)) { |
| 73 | 90 | for (BabyModel baby : babies) { |
| 74 | - data.add(buildResult(baby, puerperaService.findOnePuerperaById(baby.getParentId()))); | |
| 91 | + data.add(buildResult(baby,/* puerperaService.findOnePuerperaById(baby.getParentId())*/patientsService.findOnePatientById(baby.getParentId()))); | |
| 75 | 92 | } |
| 76 | 93 | } |
| 77 | 94 | } |
| ... | ... | @@ -111,6 +128,23 @@ |
| 111 | 128 | // 填充小孩信息 |
| 112 | 129 | babyResult.convertToResult(baby); |
| 113 | 130 | babyResult.setMotherName(puerModel.getName()); |
| 131 | + babyResult.setMotherPhone(puerModel.getPhone()); | |
| 132 | + // HashMap map = (HashMap)JsonUtil.str2Obj(puerModel.getAddress(), HashMap.class); | |
| 133 | + // 需要将数据库中的json结构地址解析出来 | |
| 134 | + HashMap<String, String> map = new HashMap<>(); | |
| 135 | + map.put("address", "测试地址"); | |
| 136 | + babyResult.setAddress(map.get("address").toString()); | |
| 137 | + babyResult.setParentId(puerModel.getId()); | |
| 138 | + // TODO 需要根据产妇模型上的社区id获取社区信息 | |
| 139 | + babyResult.setCommunity(StringUtils.isEmpty(puerModel.getCommunityId()) ? "" : puerModel.getCommunityId()); | |
| 140 | + return babyResult; | |
| 141 | + } | |
| 142 | + public BabyResult buildResult(BabyModel baby, Patients puerModel) { | |
| 143 | + BabyResult babyResult = new BabyResult(); | |
| 144 | + | |
| 145 | + // 填充小孩信息 | |
| 146 | + babyResult.convertToResult(baby); | |
| 147 | + babyResult.setMotherName(puerModel.getUsername()); | |
| 114 | 148 | babyResult.setMotherPhone(puerModel.getPhone()); |
| 115 | 149 | // HashMap map = (HashMap)JsonUtil.str2Obj(puerModel.getAddress(), HashMap.class); |
| 116 | 150 | // 需要将数据库中的json结构地址解析出来 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BasicConfigFacade.java
View file @
ad19c99
| ... | ... | @@ -101,10 +101,12 @@ |
| 101 | 101 | public List<TreeNode> findAllBasicConfigWithTree() { |
| 102 | 102 | List<TreeNode> list = new ArrayList<TreeNode>(); |
| 103 | 103 | List<BasicConfig> l = basicConfigService.queryParentConfig(); |
| 104 | - for (BasicConfig b : l) { | |
| 105 | - TreeNode node = TreeHelper.recursiveTree(b, basicConfigService); | |
| 106 | - if (null != node) { | |
| 107 | - list.add(node); | |
| 104 | + if(CollectionUtils.isNotEmpty(l)){ | |
| 105 | + for (BasicConfig b : l) { | |
| 106 | + TreeNode node = TreeHelper.recursiveTree(b, basicConfigService); | |
| 107 | + if (null != node) { | |
| 108 | + list.add(node); | |
| 109 | + } | |
| 108 | 110 | } |
| 109 | 111 | } |
| 110 | 112 | return list; |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientFacade.java
View file @
ad19c99
| 1 | +package com.lyms.platform.operate.web.facade; | |
| 2 | + | |
| 3 | +import com.lyms.platform.biz.service.PatientsService; | |
| 4 | +import com.lyms.platform.common.constants.ErrorCodeConstants; | |
| 5 | +import com.lyms.platform.common.enums.YnEnums; | |
| 6 | +import com.lyms.platform.common.result.BaseListResponse; | |
| 7 | +import com.lyms.platform.common.result.BaseResponse; | |
| 8 | +import com.lyms.platform.common.utils.Assert; | |
| 9 | +import com.lyms.platform.operate.web.request.PuerperaManagerQueryRequest; | |
| 10 | +import com.lyms.platform.operate.web.request.PuerperaManagerUpdateRequest; | |
| 11 | +import com.lyms.platform.operate.web.request.PuerperaMatcherCommunityRequest; | |
| 12 | +import com.lyms.platform.operate.web.result.PuerperaResult; | |
| 13 | +import com.lyms.platform.pojo.Patients; | |
| 14 | +import com.lyms.platform.pojo.PuerperaModel; | |
| 15 | +import com.lyms.platform.query.PatientsQuery; | |
| 16 | +import com.lyms.platform.query.PuerperaModelQuery; | |
| 17 | +import org.apache.commons.collections.CollectionUtils; | |
| 18 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 19 | +import org.springframework.stereotype.Component; | |
| 20 | + | |
| 21 | +import java.util.ArrayList; | |
| 22 | +import java.util.List; | |
| 23 | + | |
| 24 | +/** | |
| 25 | + * Created by Administrator on 2016/4/22 0022. | |
| 26 | + */ | |
| 27 | +@Component | |
| 28 | +public class PatientFacade { | |
| 29 | + | |
| 30 | + @Autowired | |
| 31 | + private PatientsService patientsService; | |
| 32 | + | |
| 33 | + | |
| 34 | + /** | |
| 35 | + * 修改产妇的社区 | |
| 36 | + * | |
| 37 | + * @param puerperaMatcherCommunityRequest 修改产妇社区 | |
| 38 | + * | |
| 39 | + * @return | |
| 40 | + */ | |
| 41 | + public BaseResponse matchCommunity(PuerperaMatcherCommunityRequest puerperaMatcherCommunityRequest){ | |
| 42 | + Patients puerperaModel = patientsService.findOnePatientById(puerperaMatcherCommunityRequest.getParentId()); | |
| 43 | + Assert.notNull(puerperaModel, "产妇信息不存在"); | |
| 44 | + puerperaModel.setCommunityId(puerperaMatcherCommunityRequest.getCommunityId()); | |
| 45 | + patientsService.updatePatient(puerperaModel); | |
| 46 | + //TODO 产妇分配了社区,需要给对应的社区提示消息 | |
| 47 | + return new BaseResponse().setErrormsg("成功").setErrorcode(ErrorCodeConstants.SUCCESS); | |
| 48 | + } | |
| 49 | + | |
| 50 | + /** | |
| 51 | + * 修改产妇信息 | |
| 52 | + * | |
| 53 | + * @param managerUpdateRequest | |
| 54 | + * 产妇信息修改请求 | |
| 55 | + * @return | |
| 56 | + */ | |
| 57 | + public BaseResponse updateOnePuerperaData(PuerperaManagerUpdateRequest managerUpdateRequest) { | |
| 58 | + | |
| 59 | + patientsService.updatePatient(managerUpdateRequest.convertToDataModel1()); | |
| 60 | + return new BaseResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功"); | |
| 61 | + } | |
| 62 | + | |
| 63 | + /** | |
| 64 | + * 获取符合条件的产妇数据 | |
| 65 | + * | |
| 66 | + * @param managerRequest | |
| 67 | + * @return | |
| 68 | + */ | |
| 69 | + public BaseListResponse findPatientList(PuerperaManagerQueryRequest managerRequest) { | |
| 70 | + PatientsQuery puerperaQuery = new PatientsQuery(); | |
| 71 | + puerperaQuery.setLimit(managerRequest.getLimit()); | |
| 72 | + puerperaQuery.setPage(managerRequest.getPage()); | |
| 73 | + puerperaQuery.setDueDateEnd(managerRequest.getDueDateEnd()); | |
| 74 | + puerperaQuery.setDueDateStart(managerRequest.getDueDateStart()); | |
| 75 | + puerperaQuery.setKeyword(managerRequest.getKeyword()); | |
| 76 | + puerperaQuery.setCommunityId(managerRequest.getCommunityId()); | |
| 77 | + puerperaQuery.setVisitstatus(managerRequest.getVisitstatus()); | |
| 78 | + puerperaQuery.setYn(YnEnums.YES.getId()); | |
| 79 | + // 调用service查询 | |
| 80 | + | |
| 81 | + List<Patients> puerperaList = patientsService.queryPatient(puerperaQuery); | |
| 82 | + List<PuerperaResult> data = new ArrayList<PuerperaResult>(); | |
| 83 | + if (CollectionUtils.isNotEmpty(puerperaList)) { | |
| 84 | + | |
| 85 | + for (Patients model : puerperaList) { | |
| 86 | + PuerperaResult result = new PuerperaResult(); | |
| 87 | + data.add(result.convertToResult(model)); | |
| 88 | + } | |
| 89 | + } | |
| 90 | + | |
| 91 | + return new BaseListResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功").setData(data); | |
| 92 | + } | |
| 93 | + | |
| 94 | + /** | |
| 95 | + * 删除一条产妇数据 | |
| 96 | + * | |
| 97 | + * @param id | |
| 98 | + * 产妇id | |
| 99 | + * @param softDel | |
| 100 | + * 是否是软删除 <code>true/false</code> | |
| 101 | + * @return 处理结果 | |
| 102 | + */ | |
| 103 | + public BaseResponse deleteOnePuerperaById(String id, boolean softDel) { | |
| 104 | + if (softDel) { | |
| 105 | + Patients obj = new Patients(); | |
| 106 | + obj.setId(id); | |
| 107 | + obj.setYn(YnEnums.NO.getId()); | |
| 108 | + patientsService.updatePatient(obj); | |
| 109 | + } | |
| 110 | + return new BaseResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功"); | |
| 111 | + } | |
| 112 | +} |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PuerperaManagerFacade.java
View file @
ad19c99
| 1 | 1 | package com.lyms.platform.operate.web.facade; |
| 2 | 2 | |
| 3 | +import com.lyms.platform.biz.service.PatientsService; | |
| 3 | 4 | import com.lyms.platform.biz.service.PuerperaService; |
| 4 | 5 | import com.lyms.platform.common.constants.ErrorCodeConstants; |
| 5 | 6 | import com.lyms.platform.common.enums.YnEnums; |
| ... | ... | @@ -29,6 +30,7 @@ |
| 29 | 30 | |
| 30 | 31 | @Autowired |
| 31 | 32 | private PuerperaService puerperaService; |
| 33 | + | |
| 32 | 34 | |
| 33 | 35 | /** |
| 34 | 36 | * 修改产妇的社区 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/VisitFacade.java
View file @
ad19c99
| ... | ... | @@ -3,15 +3,14 @@ |
| 3 | 3 | import java.util.ArrayList; |
| 4 | 4 | import java.util.List; |
| 5 | 5 | |
| 6 | +import com.lyms.platform.biz.service.*; | |
| 7 | +import com.lyms.platform.pojo.*; | |
| 8 | +import com.lyms.platform.query.PatientsQuery; | |
| 6 | 9 | import org.apache.commons.collections.CollectionUtils; |
| 7 | 10 | import org.apache.commons.lang.StringUtils; |
| 8 | 11 | import org.springframework.beans.factory.annotation.Autowired; |
| 9 | 12 | import org.springframework.stereotype.Component; |
| 10 | 13 | |
| 11 | -import com.lyms.platform.biz.service.BabyService; | |
| 12 | -import com.lyms.platform.biz.service.BabyVisitService; | |
| 13 | -import com.lyms.platform.biz.service.PuerperaService; | |
| 14 | -import com.lyms.platform.biz.service.VisitService; | |
| 15 | 14 | import com.lyms.platform.common.constants.ErrorCodeConstants; |
| 16 | 15 | import com.lyms.platform.common.enums.YnEnums; |
| 17 | 16 | import com.lyms.platform.common.result.BaseObjectResponse; |
| ... | ... | @@ -23,10 +22,6 @@ |
| 23 | 22 | import com.lyms.platform.operate.web.result.BabyVisitResult.BabyVisit; |
| 24 | 23 | import com.lyms.platform.operate.web.result.SimpleVisit; |
| 25 | 24 | import com.lyms.platform.operate.web.result.VisitResult; |
| 26 | -import com.lyms.platform.pojo.BabyModel; | |
| 27 | -import com.lyms.platform.pojo.BabyVisitModel; | |
| 28 | -import com.lyms.platform.pojo.PuerperaModel; | |
| 29 | -import com.lyms.platform.pojo.VisitModel; | |
| 30 | 25 | import com.lyms.platform.query.BabyModelQuery; |
| 31 | 26 | import com.lyms.platform.query.PuerperaModelQuery; |
| 32 | 27 | import com.lyms.platform.query.VisitQuery; |
| ... | ... | @@ -50,6 +45,8 @@ |
| 50 | 45 | |
| 51 | 46 | @Autowired |
| 52 | 47 | private BabyService babyService; |
| 48 | + @Autowired | |
| 49 | + private PatientsService patientsService; | |
| 53 | 50 | |
| 54 | 51 | /** |
| 55 | 52 | * 根据产妇id获取产妇的访视信息 |
| ... | ... | @@ -58,7 +55,7 @@ |
| 58 | 55 | * @return |
| 59 | 56 | */ |
| 60 | 57 | public BaseObjectResponse findOneById(String id) { |
| 61 | - return doBiz(puerperaService.findOnePuerperaById(id)); | |
| 58 | + return doBiz(patientsService.findOnePatientById(id)); | |
| 62 | 59 | } |
| 63 | 60 | |
| 64 | 61 | /** |
| ... | ... | @@ -69,7 +66,7 @@ |
| 69 | 66 | * @return |
| 70 | 67 | */ |
| 71 | 68 | public BaseObjectResponse findOneByCardNo(String cardNo) { |
| 72 | - PuerperaModel puerperaModel= findOnePuerperaByCardNo(cardNo); | |
| 69 | + Patients puerperaModel= findOnePuerperaByCardNo(cardNo); | |
| 73 | 70 | if (null == puerperaModel) { |
| 74 | 71 | return new BaseObjectResponse().setErrorcode(ErrorCodeConstants.DEPT_NOT_EXISTS).setErrormsg("产妇信息不存在"); |
| 75 | 72 | } |
| 76 | 73 | |
| ... | ... | @@ -82,10 +79,10 @@ |
| 82 | 79 | * @param puerperaModel |
| 83 | 80 | * @return |
| 84 | 81 | */ |
| 85 | - private BaseObjectResponse doBiz(PuerperaModel puerperaModel) { | |
| 82 | + private BaseObjectResponse doBiz(Patients puerperaModel) { | |
| 86 | 83 | VisitResult data = new VisitResult(); |
| 87 | 84 | if (null != puerperaModel) { |
| 88 | - data.convertToResult(puerperaModel); | |
| 85 | + data.convertToResult1(puerperaModel); | |
| 89 | 86 | VisitQuery visitQuery = new VisitQuery(); |
| 90 | 87 | visitQuery.setParentId(puerperaModel.getId()); |
| 91 | 88 | List<VisitModel> visits = visitService.queryVisit(visitQuery); |
| 92 | 89 | |
| ... | ... | @@ -109,12 +106,12 @@ |
| 109 | 106 | * 身份证号码 |
| 110 | 107 | * @return 产妇信息 |
| 111 | 108 | */ |
| 112 | - private PuerperaModel findOnePuerperaByCardNo(String cardNo) { | |
| 113 | - PuerperaModelQuery query = new PuerperaModelQuery(); | |
| 109 | + private Patients findOnePuerperaByCardNo(String cardNo) { | |
| 110 | + PatientsQuery query = new PatientsQuery(); | |
| 114 | 111 | query.setCardNo(cardNo); |
| 115 | 112 | query.setYn(YnEnums.YES.getId()); |
| 116 | 113 | // 根据身份证号找到产妇信息 |
| 117 | - return puerperaService.findOnePuerperaByCardNo(query); | |
| 114 | + return patientsService.findOnePatientByCardNo(query); | |
| 118 | 115 | } |
| 119 | 116 | |
| 120 | 117 | /** |
| 121 | 118 | |
| 122 | 119 | |
| 123 | 120 | |
| 124 | 121 | |
| ... | ... | @@ -128,25 +125,30 @@ |
| 128 | 125 | // 获取患者id |
| 129 | 126 | String parentId = visitRequest.getParentId(); |
| 130 | 127 | if (StringUtils.isNotEmpty(parentId)) { |
| 131 | - PuerperaModelQuery puerperaQuery = new PuerperaModelQuery(); | |
| 128 | + /* PuerperaModelQuery puerperaQuery = new PuerperaModelQuery(); | |
| 132 | 129 | puerperaQuery.setId(parentId); |
| 133 | - PuerperaModel model; | |
| 134 | - List<PuerperaModel> puerList = puerperaService.queryPuerpera(puerperaQuery); | |
| 130 | + PuerperaModel model;*/ | |
| 131 | + Patients model; | |
| 132 | + PatientsQuery patientsQuery = new PatientsQuery(); | |
| 133 | + patientsQuery.setId(parentId); | |
| 134 | + List<Patients> puerList = patientsService.queryPatient(patientsQuery); | |
| 135 | 135 | if (CollectionUtils.isNotEmpty(puerList)) { |
| 136 | 136 | model = puerList.get(0); |
| 137 | 137 | SimpleVisitPuerpera destModel = visitRequest.getPuerpera(); |
| 138 | 138 | SimpleVisitPuerpera srcModel = visitRequest.new SimpleVisitPuerpera(model); |
| 139 | 139 | // 和数据库里面的对象比较如果不等就表示有修改需存入到数据库中 |
| 140 | 140 | if (!destModel.equals(srcModel)) { |
| 141 | - puerperaService.updatePuerpera(visitRequest.getPuerpera().build()); | |
| 141 | + patientsService.updatePatient(visitRequest.getPatients()/*.build()*/); | |
| 142 | 142 | } |
| 143 | 143 | } else { |
| 144 | 144 | return new BaseResponse().setErrorcode(ErrorCodeConstants.PARAMETER_ERROR).setErrormsg("产妇信息不存在"); |
| 145 | 145 | } |
| 146 | 146 | } else { |
| 147 | 147 | // 表示是新的产妇直接新增 |
| 148 | - parentId = puerperaService.addPuerpera(visitRequest.getPuerpera().build()).getId(); | |
| 148 | +// parentId = puerperaService.addPuerpera(visitRequest.getPuerpera().build()).getId(); | |
| 149 | + parentId =patientsService.addPatient(visitRequest.getPatients()).getId(); | |
| 149 | 150 | } |
| 151 | + | |
| 150 | 152 | // 如果为空表示新增 |
| 151 | 153 | if (StringUtils.isEmpty(visitRequest.getRequestVisit().getId())) { |
| 152 | 154 | if (StringUtils.isNotEmpty(parentId)) { |
| 153 | 155 | |
| ... | ... | @@ -191,14 +193,14 @@ |
| 191 | 193 | */ |
| 192 | 194 | public BaseObjectResponse findBabyVisitByMotherCardNo(String cardNo) { |
| 193 | 195 | // 根据身份证号获取到产妇信息 |
| 194 | - PuerperaModel puerperaModel = findOnePuerperaByCardNo(cardNo); | |
| 196 | + Patients puerperaModel = findOnePuerperaByCardNo(cardNo); | |
| 195 | 197 | if (null == puerperaModel) { |
| 196 | 198 | return new BaseObjectResponse().setErrorcode(ErrorCodeConstants.DEPT_NOT_EXISTS).setErrormsg("产妇信息不存在"); |
| 197 | 199 | } |
| 198 | 200 | return findBabyVisit(puerperaModel); |
| 199 | 201 | } |
| 200 | 202 | |
| 201 | - private BaseObjectResponse findBabyVisit(PuerperaModel puerperaModel) { | |
| 203 | + private BaseObjectResponse findBabyVisit(Patients puerperaModel) { | |
| 202 | 204 | BabyModelQuery babyQuery = new BabyModelQuery(); |
| 203 | 205 | babyQuery.setParentId(puerperaModel.getId()); |
| 204 | 206 | babyQuery.setYn(YnEnums.YES.getId()); |
| ... | ... | @@ -220,7 +222,7 @@ |
| 220 | 222 | |
| 221 | 223 | // TODO 需要转换成具体的result对象 |
| 222 | 224 | // 设置产妇的信息 |
| 223 | - babyVisitResult.convertToResult(puerperaModel); | |
| 225 | + babyVisitResult.convertToResult1(puerperaModel); | |
| 224 | 226 | babyVisitResult.setData(data); |
| 225 | 227 | return new BaseObjectResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功").setData(babyVisitResult); |
| 226 | 228 | } |
| ... | ... | @@ -236,7 +238,7 @@ |
| 236 | 238 | if (null == babyModel) { |
| 237 | 239 | return new BaseObjectResponse().setErrormsg("找不到相关的新生儿数据"); |
| 238 | 240 | } |
| 239 | - PuerperaModel model = puerperaService.findOnePuerperaById(babyModel.getParentId()); | |
| 241 | + Patients model = patientsService.findOnePatientById(babyModel.getParentId()); | |
| 240 | 242 | return findBabyVisit(model); |
| 241 | 243 | } |
| 242 | 244 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/PuerperaManagerUpdateRequest.java
View file @
ad19c99
| ... | ... | @@ -6,6 +6,7 @@ |
| 6 | 6 | import com.lyms.platform.common.core.annotation.form.FormParam; |
| 7 | 7 | import com.lyms.platform.common.utils.DateUtil; |
| 8 | 8 | import com.lyms.platform.common.utils.JsonUtil; |
| 9 | +import com.lyms.platform.pojo.Patients; | |
| 9 | 10 | import com.lyms.platform.pojo.PuerperaModel; |
| 10 | 11 | import com.lyms.platform.pojo.VisitModel; |
| 11 | 12 | |
| ... | ... | @@ -368,6 +369,18 @@ |
| 368 | 369 | model.setDeliverOrg(deliverOrg); |
| 369 | 370 | model.setDueType(dueType); |
| 370 | 371 | model.setName(name); |
| 372 | + model.setDueDate(DateUtil.parseYMD(dueDate)); | |
| 373 | + model.setAddress(JsonUtil.obj2JsonString(address)); | |
| 374 | + return model; | |
| 375 | + } | |
| 376 | + | |
| 377 | + public Patients convertToDataModel1() { | |
| 378 | + Patients model = new Patients(); | |
| 379 | + model.setAge(age); | |
| 380 | + model.setCardNo(cardNo); | |
| 381 | + model.setDeliverOrg(deliverOrg); | |
| 382 | + model.setDueType(dueType); | |
| 383 | + model.setUsername(name); | |
| 371 | 384 | model.setDueDate(DateUtil.parseYMD(dueDate)); |
| 372 | 385 | model.setAddress(JsonUtil.obj2JsonString(address)); |
| 373 | 386 | return model; |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/VisitAddRequest.java
View file @
ad19c99
| 1 | 1 | package com.lyms.platform.operate.web.request; |
| 2 | 2 | |
| 3 | 3 | import java.util.Date; |
| 4 | +import java.util.Map; | |
| 4 | 5 | |
| 5 | 6 | import javax.validation.constraints.Max; |
| 6 | 7 | import javax.validation.constraints.Min; |
| 7 | 8 | import javax.validation.constraints.NotNull; |
| 8 | 9 | |
| 10 | +import com.lyms.platform.pojo.Patients; | |
| 9 | 11 | import org.hibernate.validator.constraints.NotEmpty; |
| 10 | 12 | |
| 11 | 13 | import com.lyms.platform.common.core.annotation.form.Form; |
| 12 | 14 | |
| ... | ... | @@ -20,13 +22,14 @@ |
| 20 | 22 | * |
| 21 | 23 | * @author Administrator |
| 22 | 24 | */ |
| 23 | -@Form | |
| 25 | +//@Form | |
| 24 | 26 | public class VisitAddRequest { |
| 25 | 27 | |
| 26 | 28 | // 产妇基本信息 start |
| 27 | 29 | /** |
| 28 | 30 | * 产妇id |
| 29 | 31 | */ |
| 32 | + @NotEmpty(message = "产妇id不能为空") | |
| 30 | 33 | private String parentId; |
| 31 | 34 | |
| 32 | 35 | /** |
| 33 | 36 | |
| ... | ... | @@ -38,16 +41,16 @@ |
| 38 | 41 | /** |
| 39 | 42 | * 产妇年龄 |
| 40 | 43 | */ |
| 41 | - @NotNull(message = "page.limit.must.not.null") | |
| 42 | - @Min(value = 1, message = "page.min") | |
| 43 | - @Max(value = 40, message = "page.max") | |
| 44 | + @NotNull(message = "年龄不能为空") | |
| 45 | + @Min(value = 1, message = "年龄不能小于1") | |
| 46 | + @Max(value = 50, message = "年龄不能大于50") | |
| 44 | 47 | private int age; |
| 45 | 48 | |
| 46 | 49 | /** |
| 47 | 50 | * 产妇身份证号码 |
| 48 | 51 | */ |
| 49 | 52 | @FormParam("cardno") |
| 50 | - @NotEmpty(message = "产妇名称不能为空") | |
| 53 | + @NotEmpty(message = "产妇身份证不能为空") | |
| 51 | 54 | private String cardNo; |
| 52 | 55 | |
| 53 | 56 | /** |
| ... | ... | @@ -71,7 +74,7 @@ |
| 71 | 74 | /** |
| 72 | 75 | * 地址 |
| 73 | 76 | */ |
| 74 | - private String address; | |
| 77 | + private Map address; | |
| 75 | 78 | |
| 76 | 79 | // 产妇基本信息 end |
| 77 | 80 | /** |
| ... | ... | @@ -108,7 +111,7 @@ |
| 108 | 111 | /** |
| 109 | 112 | * 分娩后的天数 |
| 110 | 113 | */ |
| 111 | - private String days; | |
| 114 | +// private String days; | |
| 112 | 115 | |
| 113 | 116 | /** |
| 114 | 117 | * 医生签名 |
| 115 | 118 | |
| 116 | 119 | |
| 117 | 120 | |
| ... | ... | @@ -149,24 +152,24 @@ |
| 149 | 152 | /** |
| 150 | 153 | * 指导 |
| 151 | 154 | */ |
| 152 | - private String guide; | |
| 155 | + private Map guide; | |
| 153 | 156 | |
| 154 | 157 | /** |
| 155 | 158 | * 血压 |
| 156 | 159 | */ |
| 157 | 160 | // private Bp bp; |
| 158 | - private String bp; | |
| 161 | + private Map bp; | |
| 159 | 162 | |
| 160 | 163 | /** |
| 161 | 164 | * 转诊 |
| 162 | 165 | */ |
| 163 | 166 | // private Referral referral; |
| 164 | - private String referral; | |
| 167 | + private Map referral; | |
| 165 | 168 | |
| 166 | 169 | /** |
| 167 | 170 | * 类型 |
| 168 | 171 | */ |
| 169 | - private String type; | |
| 172 | + private Map type; | |
| 170 | 173 | |
| 171 | 174 | /** |
| 172 | 175 | * 伤口 |
| 173 | 176 | |
| 174 | 177 | |
| ... | ... | @@ -221,14 +224,22 @@ |
| 221 | 224 | this.deliverOrg = deliverOrg; |
| 222 | 225 | } |
| 223 | 226 | |
| 224 | - public String getAddress() { | |
| 227 | +/* public String getAddress() { | |
| 225 | 228 | return address; |
| 226 | 229 | } |
| 227 | 230 | |
| 228 | 231 | public void setAddress(String address) { |
| 229 | 232 | this.address = address; |
| 233 | + }*/ | |
| 234 | + | |
| 235 | + public Map getAddress() { | |
| 236 | + return address; | |
| 230 | 237 | } |
| 231 | 238 | |
| 239 | + public void setAddress(Map address) { | |
| 240 | + this.address = address; | |
| 241 | + } | |
| 242 | + | |
| 232 | 243 | public String getNumOfLive() { |
| 233 | 244 | return numOfLive; |
| 234 | 245 | } |
| 235 | 246 | |
| ... | ... | @@ -269,13 +280,13 @@ |
| 269 | 280 | this.checktime = checktime; |
| 270 | 281 | } |
| 271 | 282 | |
| 272 | - public String getDays() { | |
| 273 | - return days; | |
| 274 | - } | |
| 283 | +/* public String getDays() { | |
| 284 | + return days;*/ | |
| 285 | +// } | |
| 275 | 286 | |
| 276 | - public void setDays(String days) { | |
| 277 | - this.days = days; | |
| 278 | - } | |
| 287 | +// public void setDays(String days) { | |
| 288 | +// this.days = days; | |
| 289 | +// } | |
| 279 | 290 | |
| 280 | 291 | public String getDoctorsign() { |
| 281 | 292 | return doctorsign; |
| 282 | 293 | |
| ... | ... | @@ -349,10 +360,34 @@ |
| 349 | 360 | this.other = other; |
| 350 | 361 | } |
| 351 | 362 | |
| 352 | - public String getGuide() { | |
| 363 | + public Map getBp() { | |
| 364 | + return bp; | |
| 365 | + } | |
| 366 | + | |
| 367 | + public void setBp(Map bp) { | |
| 368 | + this.bp = bp; | |
| 369 | + } | |
| 370 | + | |
| 371 | + public Map getGuide() { | |
| 353 | 372 | return guide; |
| 354 | 373 | } |
| 355 | 374 | |
| 375 | + public void setGuide(Map guide) { | |
| 376 | + this.guide = guide; | |
| 377 | + } | |
| 378 | + | |
| 379 | + public Map getReferral() { | |
| 380 | + return referral; | |
| 381 | + } | |
| 382 | + | |
| 383 | + public void setReferral(Map referral) { | |
| 384 | + this.referral = referral; | |
| 385 | + } | |
| 386 | + | |
| 387 | + /* public String getGuide() { | |
| 388 | + return guide; | |
| 389 | + } | |
| 390 | + | |
| 356 | 391 | public void setGuide(String guide) { |
| 357 | 392 | this.guide = guide; |
| 358 | 393 | } |
| 359 | 394 | |
| 360 | 395 | |
| 361 | 396 | |
| ... | ... | @@ -369,17 +404,25 @@ |
| 369 | 404 | return referral; |
| 370 | 405 | } |
| 371 | 406 | |
| 407 | + | |
| 372 | 408 | public void setReferral(String referral) { |
| 373 | 409 | this.referral = referral; |
| 410 | + }*/ | |
| 411 | + | |
| 412 | + public Map getType() { | |
| 413 | + return type; | |
| 374 | 414 | } |
| 375 | 415 | |
| 376 | - public String getType() { | |
| 416 | + public void setType(Map type) { | |
| 417 | + this.type = type; | |
| 418 | + } | |
| 419 | +/* public String getType() { | |
| 377 | 420 | return type; |
| 378 | 421 | } |
| 379 | 422 | |
| 380 | 423 | public void setType(String type) { |
| 381 | 424 | this.type = type; |
| 382 | - } | |
| 425 | + }*/ | |
| 383 | 426 | |
| 384 | 427 | public String getWound() { |
| 385 | 428 | return wound; |
| ... | ... | @@ -402,6 +445,18 @@ |
| 402 | 445 | puerperaModel.setAddress(JsonUtil.obj2JsonString(address)); |
| 403 | 446 | return puerperaModel; |
| 404 | 447 | } |
| 448 | + public Patients getPatients(){ | |
| 449 | + Patients patients = new Patients(); | |
| 450 | + patients.setId(parentId); | |
| 451 | + patients.setUsername(name); | |
| 452 | + patients.setAge(age); | |
| 453 | + patients.setCardNo(cardNo); | |
| 454 | + patients.setDueDate(new Date()); | |
| 455 | + patients.setDeliverOrg(deliverOrg); | |
| 456 | + patients.setDueType(dueType); | |
| 457 | + patients.setAddress(JsonUtil.obj2JsonString(address)); | |
| 458 | + return patients; | |
| 459 | + } | |
| 405 | 460 | |
| 406 | 461 | public VisitModel getRequestVisit() { |
| 407 | 462 | VisitModel visit = new VisitModel(); |
| ... | ... | @@ -409,6 +464,7 @@ |
| 409 | 464 | visit.setBp(JsonUtil.obj2JsonString(bp)); |
| 410 | 465 | visit.setGuide(JsonUtil.obj2JsonString(guide)); |
| 411 | 466 | visit.setReferral(JsonUtil.obj2JsonString(referral)); |
| 467 | + visit.setType(JsonUtil.obj2JsonString(type)); | |
| 412 | 468 | } catch (Exception e) { |
| 413 | 469 | } |
| 414 | 470 | |
| ... | ... | @@ -424,7 +480,7 @@ |
| 424 | 480 | visit.setNextvisit(nextvisit); |
| 425 | 481 | visit.setNumOfLive(numOfLive); |
| 426 | 482 | visit.setOther(other); |
| 427 | - visit.setType(type); | |
| 483 | + | |
| 428 | 484 | visit.setWound(wound); |
| 429 | 485 | visit.setXinType(xinType); |
| 430 | 486 | visit.setParentId(parentId); |
| ... | ... | @@ -475,6 +531,16 @@ |
| 475 | 531 | dueType = model.getDueType(); |
| 476 | 532 | address = model.getAddress(); |
| 477 | 533 | } |
| 534 | + public SimpleVisitPuerpera(Patients model) { | |
| 535 | + id = model.getId(); | |
| 536 | + name = model.getUsername(); | |
| 537 | + age = model.getAge(); | |
| 538 | + cardno = model.getCardNo(); | |
| 539 | + dueDate = DateUtil.getyyyy_MM_dd(model.getDueDate()); | |
| 540 | + deliverOrg = model.getDeliverOrg(); | |
| 541 | + dueType = model.getDueType(); | |
| 542 | + address = model.getAddress(); | |
| 543 | + } | |
| 478 | 544 | |
| 479 | 545 | public String getId() { |
| 480 | 546 | return id; |
| ... | ... | @@ -621,6 +687,14 @@ |
| 621 | 687 | model.setId("11"); |
| 622 | 688 | model.setName("查房1"); |
| 623 | 689 | System.out.println(puerpera.equals(new VisitAddRequest().new SimpleVisitPuerpera(model))); |
| 690 | + | |
| 691 | + VisitAddRequest visitAddRequest = new VisitAddRequest(); | |
| 692 | +// visitAddRequest.setAddress("测试"); | |
| 693 | + visitAddRequest.setAge(1); | |
| 694 | +// visitAddRequest.setBp("{}"); | |
| 695 | + visitAddRequest.setCardNo("454646465456465456"); | |
| 696 | + visitAddRequest.setBreast("fafffaffaffa"); | |
| 697 | + System.out.print(JsonUtil.obj2JsonString(visitAddRequest)); | |
| 624 | 698 | } |
| 625 | 699 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/BabyVisitResult.java
View file @
ad19c99
| ... | ... | @@ -2,6 +2,7 @@ |
| 2 | 2 | |
| 3 | 3 | import java.util.List; |
| 4 | 4 | |
| 5 | +import com.lyms.platform.pojo.Patients; | |
| 5 | 6 | import org.springframework.data.annotation.Id; |
| 6 | 7 | |
| 7 | 8 | import com.lyms.platform.common.base.IBasicResultConvert; |
| ... | ... | @@ -760,6 +761,13 @@ |
| 760 | 761 | setmCardNo(destModel.getCardNo()); |
| 761 | 762 | setmName(destModel.getName()); |
| 762 | 763 | |
| 764 | + return this; | |
| 765 | + } | |
| 766 | + public BabyVisitResult convertToResult1(Patients destModel) { | |
| 767 | + setAge(destModel.getAge()); | |
| 768 | + setmCardNo(destModel.getCardNo()); | |
| 769 | + setmName(destModel.getUsername()); | |
| 770 | + | |
| 763 | 771 | return this; |
| 764 | 772 | } |
| 765 | 773 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/PuerperaResult.java
View file @
ad19c99
| 1 | 1 | package com.lyms.platform.operate.web.result; |
| 2 | 2 | |
| 3 | +import com.lyms.platform.pojo.Patients; | |
| 3 | 4 | import org.apache.commons.lang.StringUtils; |
| 4 | 5 | |
| 5 | 6 | import com.lyms.platform.common.utils.DateUtil; |
| ... | ... | @@ -110,6 +111,19 @@ |
| 110 | 111 | setPhone(model.getPhone()); |
| 111 | 112 | setAge(model.getAge()); |
| 112 | 113 | setName(model.getName()); |
| 114 | + setVisitStatus(model.getIsVisit()); | |
| 115 | + return this; | |
| 116 | + } | |
| 117 | + | |
| 118 | + public PuerperaResult convertToResult(Patients model) { | |
| 119 | + setAddress(model.getAddress()); | |
| 120 | + setId(model.getId()); | |
| 121 | + setDueDate(DateUtil.getyyyy_MM_dd(model.getDueDate())); | |
| 122 | + setVisit(model.getIsVisit() == 0 ? "未访视" : "已访视"); | |
| 123 | + setCommunity(StringUtils.isEmpty(model.getCommunityId()) ? "未分配" : model.getCommunityId()); | |
| 124 | + setPhone(model.getPhone()); | |
| 125 | + setAge(model.getAge()); | |
| 126 | + setName(model.getUsername()); | |
| 113 | 127 | setVisitStatus(model.getIsVisit()); |
| 114 | 128 | return this; |
| 115 | 129 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/VisitResult.java
View file @
ad19c99
| ... | ... | @@ -5,6 +5,7 @@ |
| 5 | 5 | |
| 6 | 6 | import com.lyms.platform.common.utils.DateUtil; |
| 7 | 7 | import com.lyms.platform.common.utils.JsonUtil; |
| 8 | +import com.lyms.platform.pojo.Patients; | |
| 8 | 9 | import com.lyms.platform.pojo.PuerperaModel; |
| 9 | 10 | |
| 10 | 11 | @SuppressWarnings("rawtypes") |
| ... | ... | @@ -100,6 +101,18 @@ |
| 100 | 101 | setDueDate(DateUtil.getyyyy_MM_dd(model.getDueDate())); |
| 101 | 102 | setDueType(model.getDueType()); |
| 102 | 103 | setName(model.getName()); |
| 104 | + } | |
| 105 | + public void convertToResult1(Patients model) { | |
| 106 | + try { | |
| 107 | + setAddress(JsonUtil.str2Obj(model.getAddress(), Map.class)); | |
| 108 | + } catch (Exception e) { | |
| 109 | + } | |
| 110 | + setAge(model.getAge()); | |
| 111 | + setCardNo(model.getCardNo()); | |
| 112 | + setDeliverOrg(model.getDeliverOrg()); | |
| 113 | + setDueDate(DateUtil.getyyyy_MM_dd(model.getDueDate())); | |
| 114 | + setDueType(model.getDueType()); | |
| 115 | + setName(model.getUsername()); | |
| 103 | 116 | } |
| 104 | 117 | } |
platform-operate-api/src/main/resources/database.properties
View file @
ad19c99
| ... | ... | @@ -5,11 +5,11 @@ |
| 5 | 5 | mongo.db.host=${mongo.db.host} |
| 6 | 6 | mongo.db.port=${mongo.db.port} |
| 7 | 7 | mongo.db.dbname=${mongo.db.dbname} |
| 8 | -mongo.db.username=root | |
| 9 | -mongo.db.password=root | |
| 8 | +mongo.db.username=${mongo.db.username} | |
| 9 | +mongo.db.password=${mongo.db.password} | |
| 10 | 10 | |
| 11 | 11 | |
| 12 | -mongo.port=27017 | |
| 12 | + | |
| 13 | 13 | mongo.connectionsPerHost=8 |
| 14 | 14 | mongo.threadsAllowedToBlockForConnectionMultiplier=4 |
| 15 | 15 | mongo.connectTimeout=1000 |
platform-operate-api/src/main/resources/spring/spring-mongodb-old.xml
View file @
ad19c99
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | |
| 2 | +<beans xmlns="http://www.springframework.org/schema/beans" | |
| 3 | + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:mongo="http://www.springframework.org/schema/data/mongo" | |
| 4 | + xsi:schemaLocation="http://www.springframework.org/schema/data/mongo | |
| 5 | + http://www.springframework.org/schema/data/mongo/spring-mongo-1.0.xsd | |
| 6 | + http://www.springframework.org/schema/beans | |
| 7 | + http://www.springframework.org/schema/beans/spring-beans-3.0.xsd"> | |
| 8 | + | |
| 9 | + <mongo:db-factory id="mongoDbFactory" host="${mongo.db.host}" | |
| 10 | + port="${mongo.db.port}" dbname="${mongo.db.dbname}" /> | |
| 11 | + | |
| 12 | + <bean id="mongoTemplate" class="org.springframework.data.mongodb.core.MongoTemplate"> | |
| 13 | + <constructor-arg name="mongoDbFactory" ref="mongoDbFactory" /> | |
| 14 | + <!-- <constructor-arg name="userCredentials" ref="userCredentials"/> --> | |
| 15 | + <constructor-arg name="mongoConverter" ref="mappingMongoConverter" /> | |
| 16 | + </bean> | |
| 17 | + | |
| 18 | + <mongo:mapping-converter base-package="com.lyms.platform.pojo" /> | |
| 19 | + <bean id="mappingContext" class="org.springframework.data.mongodb.core.mapping.MongoMappingContext" /> | |
| 20 | + <!-- 配置mongodb映射类型 --> | |
| 21 | + <bean id="mappingMongoConverter" class="org.springframework.data.mongodb.core.convert.MappingMongoConverter"> | |
| 22 | + <constructor-arg name="mongoDbFactory" ref="mongoDbFactory" /> | |
| 23 | + <constructor-arg name="mappingContext" ref="mappingContext" /> | |
| 24 | + <property name="typeMapper" ref="defaultMongoTypeMapper" /> | |
| 25 | + </bean> | |
| 26 | + | |
| 27 | + <!-- 默认Mongodb类型映射 --> | |
| 28 | + <bean id="defaultMongoTypeMapper" class="org.springframework.data.mongodb.core.convert.DefaultMongoTypeMapper"> | |
| 29 | + <constructor-arg name="typeKey"> | |
| 30 | + <null /><!-- 这里设置为空,可以把 spring data mongodb 多余保存的_class字段去掉 --> | |
| 31 | + </constructor-arg> | |
| 32 | + </bean> | |
| 33 | + <!-- | |
| 34 | + <bean id="userCredentials" class="org.springframework.data.authentication.UserCredentials"> | |
| 35 | + <description>认证口令</description> | |
| 36 | + <constructor-arg name="username" value="${${mongo.username}}" /> | |
| 37 | + <constructor-arg name="password" value="${${mongo.password}}" /> | |
| 38 | + </bean> | |
| 39 | + | |
| 40 | + <mongo:mongo id="mongo" host="${${mongo.host}}" port="${${mongo.port}}"> | |
| 41 | + | |
| 42 | + <mongo:options connections-per-host="${${mongo.connectionsPerHost}}" | |
| 43 | + | |
| 44 | + threads-allowed-to-block-for-connection-multiplier="${${mongo.threadsAllowedToBlockForConnectionMultiplier}}" | |
| 45 | + | |
| 46 | + connect-timeout="${${mongo.connectTimeout}}" max-wait-time="${${mongo.maxWaitTime}}" | |
| 47 | + | |
| 48 | + auto-connect-retry="${${mongo.autoConnectRetry}}" socket-keep-alive="${${mongo.socketKeepAlive}}" | |
| 49 | + | |
| 50 | + socket-timeout="${${mongo.socketTimeout}}" slave-ok="${${mongo.slaveOk}}" | |
| 51 | + | |
| 52 | + write-number="1" write-timeout="0" write-fsync="true" /> | |
| 53 | + </mongo:mongo>--> | |
| 54 | +</beans> |
platform-operate-api/src/main/resources/spring/spring-mongodb.xml
View file @
ad19c99
| 1 | 1 | <?xml version="1.0" encoding="UTF-8"?> |
| 2 | 2 | <beans xmlns="http://www.springframework.org/schema/beans" |
| 3 | - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:mongo="http://www.springframework.org/schema/data/mongo" | |
| 4 | - xsi:schemaLocation="http://www.springframework.org/schema/data/mongo | |
| 3 | + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
| 4 | + xmlns:mongo="http://www.springframework.org/schema/data/mongo" | |
| 5 | + xsi:schemaLocation="http://www.springframework.org/schema/data/mongo | |
| 5 | 6 | http://www.springframework.org/schema/data/mongo/spring-mongo-1.0.xsd |
| 6 | 7 | http://www.springframework.org/schema/beans |
| 7 | 8 | http://www.springframework.org/schema/beans/spring-beans-3.0.xsd"> |
| 8 | 9 | |
| 9 | - <mongo:db-factory id="mongoDbFactory" host="${mongo.db.host}" | |
| 10 | - port="${mongo.db.port}" dbname="${mongo.db.dbname}" /> | |
| 10 | + <bean name="mongoTemplate" class="org.springframework.data.mongodb.core.MongoTemplate"> | |
| 11 | + <constructor-arg name="mongo" ref="mongo"/> | |
| 12 | + <constructor-arg name="userCredentials" ref="userCredentials"/> | |
| 13 | + <constructor-arg name="databaseName" value="platform"/> | |
| 14 | + </bean> | |
| 11 | 15 | |
| 12 | - <bean id="mongoTemplate" class="org.springframework.data.mongodb.core.MongoTemplate"> | |
| 13 | - <constructor-arg name="mongoDbFactory" ref="mongoDbFactory" /> | |
| 14 | - <!-- <constructor-arg name="userCredentials" ref="userCredentials"/> --> | |
| 15 | - <constructor-arg name="mongoConverter" ref="mappingMongoConverter" /> | |
| 16 | - </bean> | |
| 17 | 16 | |
| 18 | - <mongo:mapping-converter base-package="com.lyms.platform.pojo" /> | |
| 19 | - <bean id="mappingContext" class="org.springframework.data.mongodb.core.mapping.MongoMappingContext" /> | |
| 20 | - <!-- 配置mongodb映射类型 --> | |
| 21 | - <bean id="mappingMongoConverter" class="org.springframework.data.mongodb.core.convert.MappingMongoConverter"> | |
| 22 | - <constructor-arg name="mongoDbFactory" ref="mongoDbFactory" /> | |
| 23 | - <constructor-arg name="mappingContext" ref="mappingContext" /> | |
| 24 | - <property name="typeMapper" ref="defaultMongoTypeMapper" /> | |
| 25 | - </bean> | |
| 17 | + <bean id="defaultMongoTypeMapper" | |
| 18 | + class="org.springframework.data.mongodb.core.convert.DefaultMongoTypeMapper"> | |
| 19 | + <constructor-arg name="typeKey"> | |
| 20 | + <null/> | |
| 21 | + </constructor-arg> | |
| 22 | + </bean> | |
| 26 | 23 | |
| 27 | - <!-- 默认Mongodb类型映射 --> | |
| 28 | - <bean id="defaultMongoTypeMapper" class="org.springframework.data.mongodb.core.convert.DefaultMongoTypeMapper"> | |
| 29 | - <constructor-arg name="typeKey"> | |
| 30 | - <null /><!-- 这里设置为空,可以把 spring data mongodb 多余保存的_class字段去掉 --> | |
| 31 | - </constructor-arg> | |
| 32 | - </bean> | |
| 33 | - <!-- | |
| 34 | - <bean id="userCredentials" class="org.springframework.data.authentication.UserCredentials"> | |
| 35 | - <description>认证口令</description> | |
| 36 | - <constructor-arg name="username" value="${${mongo.username}}" /> | |
| 37 | - <constructor-arg name="password" value="${${mongo.password}}" /> | |
| 38 | - </bean> | |
| 24 | + <bean id="userCredentials" class="org.springframework.data.authentication.UserCredentials"> | |
| 25 | + <constructor-arg name="username" value="${mongo.db.username}"/> | |
| 26 | + <constructor-arg name="password" value="${mongo.db.password}"/> | |
| 27 | + </bean> | |
| 39 | 28 | |
| 40 | - <mongo:mongo id="mongo" host="${${mongo.host}}" port="${${mongo.port}}"> | |
| 29 | + <mongo:db-factory mongo-ref="mongo" id="mongoDbFactory"/> | |
| 41 | 30 | |
| 42 | - <mongo:options connections-per-host="${${mongo.connectionsPerHost}}" | |
| 43 | - | |
| 44 | - threads-allowed-to-block-for-connection-multiplier="${${mongo.threadsAllowedToBlockForConnectionMultiplier}}" | |
| 45 | - | |
| 46 | - connect-timeout="${${mongo.connectTimeout}}" max-wait-time="${${mongo.maxWaitTime}}" | |
| 47 | - | |
| 48 | - auto-connect-retry="${${mongo.autoConnectRetry}}" socket-keep-alive="${${mongo.socketKeepAlive}}" | |
| 49 | - | |
| 50 | - socket-timeout="${${mongo.socketTimeout}}" slave-ok="${${mongo.slaveOk}}" | |
| 51 | - | |
| 52 | - write-number="1" write-timeout="0" write-fsync="true" /> | |
| 53 | - </mongo:mongo>--> | |
| 31 | + <mongo:mongo id="mongo" host="${mongo.db.host}" port="${mongo.db.port}"> | |
| 32 | + <mongo:options connections-per-host="${mongo.connectionsPerHost}" | |
| 33 | + threads-allowed-to-block-for-connection-multiplier="${mongo.threadsAllowedToBlockForConnectionMultiplier}" | |
| 34 | + connect-timeout="${mongo.connectTimeout}" max-wait-time="${mongo.maxWaitTime}" | |
| 35 | + auto-connect-retry="${mongo.autoConnectRetry}" socket-keep-alive="${mongo.socketKeepAlive}" | |
| 36 | + socket-timeout="${mongo.socketTimeout}" write-number="1" | |
| 37 | + write-timeout="0" write-fsync="true"/> | |
| 38 | + </mongo:mongo> | |
| 54 | 39 | </beans> |
platform-operate-api/src/main/webapp/WEB-INF/web.xml
View file @
ad19c99
| ... | ... | @@ -12,6 +12,49 @@ |
| 12 | 12 | <web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| 13 | 13 | version="2.5" |
| 14 | 14 | xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"> |
| 15 | + | |
| 16 | +<!-- | |
| 17 | +<filter> | |
| 18 | + <filter-name>CorsFilter</filter-name> | |
| 19 | + <filter-class>org.apache.catalina.filters.CorsFilter</filter-class> | |
| 20 | + <init-param> | |
| 21 | + <param-name>cors.allowed.origins</param-name> | |
| 22 | + <param-value>*</param-value> | |
| 23 | + </init-param> | |
| 24 | + <init-param> | |
| 25 | + <param-name>cors.allowed.methods</param-name> | |
| 26 | + <param-value>GET,POST,HEAD,OPTIONS,PUT,DELETE</param-value> | |
| 27 | + </init-param> | |
| 28 | + <init-param> | |
| 29 | + <param-name>cors.allowed.headers</param-name> | |
| 30 | + <param-value>Content-Type,X-Requested-With,accept,Origin,Access-Control-Request-Method,Access-Control-Request-Headers,authorization</param-value> | |
| 31 | + </init-param> | |
| 32 | + <init-param> | |
| 33 | + <param-name>cors.exposed.headers</param-name> | |
| 34 | + <param-value>Access-Control-Allow-Origin,Access-Control-Allow-Credentials</param-value> | |
| 35 | + </init-param> | |
| 36 | + <init-param> | |
| 37 | + <param-name>cors.support.credentials</param-name> | |
| 38 | + <param-value>true</param-value> | |
| 39 | + </init-param> | |
| 40 | + <init-param> | |
| 41 | + <param-name>cors.preflight.maxage</param-name> | |
| 42 | + <param-value>10</param-value> | |
| 43 | + </init-param> | |
| 44 | +</filter> | |
| 45 | +<filter-mapping> | |
| 46 | + <filter-name>CorsFilter</filter-name> | |
| 47 | + <url-pattern>/*</url-pattern> | |
| 48 | +</filter-mapping> | |
| 49 | + | |
| 50 | + --> | |
| 51 | +<servlet-mapping> | |
| 52 | + <servlet-name>default</servlet-name> | |
| 53 | + <url-pattern>*.xml</url-pattern> | |
| 54 | + </servlet-mapping> | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 15 | 58 | <context-param> |
| 16 | 59 | <param-name>contextConfigLocation</param-name> |
| 17 | 60 | <param-value> |
| ... | ... | @@ -25,10 +68,6 @@ |
| 25 | 68 | <context-param> |
| 26 | 69 | <param-name>log4jConfigLocation</param-name> |
| 27 | 70 | <param-value>classpath:log4j_config.xml</param-value> |
| 28 | - </context-param> | |
| 29 | - <context-param> | |
| 30 | - <param-name>webAppRootKey</param-name> | |
| 31 | - <param-value>webapp.operate</param-value> | |
| 32 | 71 | </context-param> |
| 33 | 72 | <context-param> |
| 34 | 73 | <param-name>log4jRefreshInterval</param-name> |
platform-operate-api/src/main/webapp/crossdomain.xml
View file @
ad19c99
platform-resource/resources/config-dev.properties
View file @
ad19c99
| 1 | 1 | mongo.db.host=localhost |
| 2 | 2 | mongo.db.port=27017 |
| 3 | -mongo.db.dbname=platform | |
| 4 | - | |
| 3 | +mongo.db.dbname=platform1 | |
| 4 | +mongo.db.username=platform | |
| 5 | +mongo.db.password=platform123 | |
| 6 | +mongo.socketTimeout=1000 | |
| 7 | +mongo.connectionsPerHost=20 | |
| 8 | +mongo.threadsAllowedToBlockForConnectionMultiplier=10 | |
| 9 | +mongo.connectTimeout=1000 | |
| 10 | +mongo.maxWaitTime=2000 | |
| 11 | +mongo.autoConnectRetry=true | |
| 12 | +mongo.socketKeepAlive=true | |
| 5 | 13 | |
| 6 | 14 | mysql.db.name=platform |
| 7 | 15 | mysql.db.password=platform123 |
platform-resource/resources/config-test.properties
View file @
ad19c99
| 1 | -mongo.db.host=localhost | |
| 1 | +mongo.db.host=119.90.57.26 | |
| 2 | 2 | mongo.db.port=10001 |
| 3 | 3 | mongo.db.dbname=platform |
| 4 | + | |
| 5 | +mongo.db.username=platform | |
| 6 | +mongo.db.password=platform123 | |
| 7 | +mongo.socketTimeout=1000 | |
| 8 | +mongo.connectionsPerHost=20 | |
| 9 | +mongo.threadsAllowedToBlockForConnectionMultiplier=10 | |
| 10 | +mongo.connectTimeout=1000 | |
| 11 | +mongo.maxWaitTime=2000 | |
| 12 | +mongo.autoConnectRetry=true | |
| 13 | +mongo.socketKeepAlive=true | |
| 14 | + | |
| 4 | 15 | |
| 5 | 16 | |
| 6 | 17 | mysql.db.name=platform |