Commit 7387451c17fec759ec1a046ec6f5ae7c5377eaee
1 parent
f496f8fc32
Exists in
master
and in
6 other branches
全部孕妇管理增加按照排序
Showing 5 changed files with 518 additions and 0 deletions
- platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/ITrackDownRecordDao.java
- platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/impl/TrackDownRecordDaoImpl.java
- platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/TrackDownRecordService.java
- platform-dal/src/main/java/com/lyms/platform/pojo/TrackDownRecord.java
- platform-dal/src/main/java/com/lyms/platform/query/TrackDownRecordQuery.java
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/ITrackDownRecordDao.java
View file @
7387451
| 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.TrackDownRecord; | |
| 7 | + | |
| 8 | +import java.util.List; | |
| 9 | + | |
| 10 | +/** | |
| 11 | + * 追访列表dao | |
| 12 | + * <p/> | |
| 13 | + * 详细描述 | |
| 14 | + * <p/> | |
| 15 | + * 示例代码 | |
| 16 | + * <pre> | |
| 17 | + * </pre/> | |
| 18 | + * | |
| 19 | + * @author JIAZHI.JIANG | |
| 20 | + * @version BME V100R001 2018/1/17 0017 | |
| 21 | + * @since BME V100R001C40B104 | |
| 22 | + */ | |
| 23 | +public interface ITrackDownRecordDao { | |
| 24 | + | |
| 25 | + TrackDownRecord addTrackDown(TrackDownRecord downRecord); | |
| 26 | + | |
| 27 | + void updateTrackDown(TrackDownRecord obj, String id); | |
| 28 | + | |
| 29 | + void deleteTrackDown(String id); | |
| 30 | + | |
| 31 | + TrackDownRecord getTrackDown(String id); | |
| 32 | + | |
| 33 | + int queryTrackDownCount(MongoQuery query); | |
| 34 | + | |
| 35 | + List<TrackDownRecord> queryTrackDown(MongoQuery query); | |
| 36 | + | |
| 37 | + Page<TrackDownRecord> findPage(MongoQuery query); | |
| 38 | +} |
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/impl/TrackDownRecordDaoImpl.java
View file @
7387451
| 1 | +package com.lyms.platform.biz.dal.impl; | |
| 2 | + | |
| 3 | +import com.lyms.platform.biz.dal.ITrackDownRecordDao; | |
| 4 | +import com.lyms.platform.common.dao.BaseMongoDAOImpl; | |
| 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 com.lyms.platform.common.dao.operator.Page; | |
| 9 | +import com.lyms.platform.pojo.TrackDownRecord; | |
| 10 | +import org.bson.types.ObjectId; | |
| 11 | +import org.slf4j.Logger; | |
| 12 | +import org.slf4j.LoggerFactory; | |
| 13 | +import org.springframework.stereotype.Repository; | |
| 14 | + | |
| 15 | +import java.util.List; | |
| 16 | + | |
| 17 | + | |
| 18 | +/** | |
| 19 | + * 添加类的一句话简单描述。 | |
| 20 | + * <p/> | |
| 21 | + * 详细描述 | |
| 22 | + * <p/> | |
| 23 | + * 示例代码 | |
| 24 | + * <pre> | |
| 25 | + * </pre/> | |
| 26 | + * | |
| 27 | + * @author JIAZHI.JIANG | |
| 28 | + * @version BME V100R001 2018-01-17 16:26 | |
| 29 | + * @since BME V100R001C40B104 | |
| 30 | + */ | |
| 31 | +@Repository("trackDownRecordDao") | |
| 32 | +public class TrackDownRecordDaoImpl extends BaseMongoDAOImpl<TrackDownRecord> implements ITrackDownRecordDao { | |
| 33 | + | |
| 34 | + //日志调测器 | |
| 35 | + private static final Logger logger = LoggerFactory.getLogger(TrackDownRecordDaoImpl.class); | |
| 36 | + | |
| 37 | + @Override | |
| 38 | + public TrackDownRecord addTrackDown(TrackDownRecord downRecord) { | |
| 39 | + return save(downRecord); | |
| 40 | + } | |
| 41 | + | |
| 42 | + @Override | |
| 43 | + public void updateTrackDown(TrackDownRecord obj, String id) { | |
| 44 | + update(new MongoQuery(new MongoCondition("id", id, MongoOper.IS)).convertToMongoQuery(), obj); | |
| 45 | + } | |
| 46 | + | |
| 47 | + @Override | |
| 48 | + public void deleteTrackDown(String id) { | |
| 49 | + delete(new MongoQuery(new MongoCondition("id", new ObjectId(id), MongoOper.IS)).convertToMongoQuery()); | |
| 50 | + } | |
| 51 | + | |
| 52 | + @Override | |
| 53 | + public TrackDownRecord getTrackDown(String id) { | |
| 54 | + return findById(id); | |
| 55 | + } | |
| 56 | + | |
| 57 | + @Override | |
| 58 | + public int queryTrackDownCount(MongoQuery query) { | |
| 59 | + return (int) count(query.convertToMongoQuery()); | |
| 60 | + } | |
| 61 | + | |
| 62 | + @Override | |
| 63 | + public List<TrackDownRecord> queryTrackDown(MongoQuery query) { | |
| 64 | + return find(query.convertToMongoQuery()); | |
| 65 | + } | |
| 66 | + | |
| 67 | + @Override | |
| 68 | + public Page<TrackDownRecord> findPage(MongoQuery query) { | |
| 69 | + return findPage(query.convertToMongoQuery()); | |
| 70 | + } | |
| 71 | +} |
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/TrackDownRecordService.java
View file @
7387451
| 1 | +package com.lyms.platform.biz.service; | |
| 2 | + | |
| 3 | +import com.lyms.platform.biz.dal.ITrackDownRecordDao; | |
| 4 | +import com.lyms.platform.common.dao.operator.MongoQuery; | |
| 5 | +import com.lyms.platform.pojo.TrackDownRecord; | |
| 6 | +import com.lyms.platform.query.TrackDownRecordQuery; | |
| 7 | +import org.apache.commons.lang.StringUtils; | |
| 8 | +import org.slf4j.Logger; | |
| 9 | +import org.slf4j.LoggerFactory; | |
| 10 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 11 | +import org.springframework.stereotype.Service; | |
| 12 | + | |
| 13 | +import java.util.Date; | |
| 14 | +import java.util.List; | |
| 15 | + | |
| 16 | + | |
| 17 | +/** | |
| 18 | + * 添加类的一句话简单描述。 | |
| 19 | + * <p/> | |
| 20 | + * 详细描述 | |
| 21 | + * <p/> | |
| 22 | + * 示例代码 | |
| 23 | + * <pre> | |
| 24 | + * </pre/> | |
| 25 | + * | |
| 26 | + * @author JIAZHI.JIANG | |
| 27 | + * @version BME V100R001 2018-01-17 16:34 | |
| 28 | + * @since BME V100R001C40B104 | |
| 29 | + */ | |
| 30 | +@Service | |
| 31 | +public class TrackDownRecordService { | |
| 32 | + | |
| 33 | + //日志调测器 | |
| 34 | + private static final Logger logger = LoggerFactory.getLogger(TrackDownRecordService.class); | |
| 35 | + | |
| 36 | + @Autowired | |
| 37 | + private ITrackDownRecordDao iTrackDownRecordDao; | |
| 38 | + | |
| 39 | + public TrackDownRecord addTrackDown(TrackDownRecord downRecord) { | |
| 40 | + downRecord.setCreated(new Date()); | |
| 41 | + downRecord.setModified(new Date()); | |
| 42 | + return iTrackDownRecordDao.addTrackDown(downRecord); | |
| 43 | + } | |
| 44 | + | |
| 45 | + public void updateTrackDown(TrackDownRecord obj, String id) { | |
| 46 | + obj.setModified(new Date()); | |
| 47 | + iTrackDownRecordDao.updateTrackDown(obj, id); | |
| 48 | + } | |
| 49 | + | |
| 50 | + public void deleteTrackDown(String id) { | |
| 51 | + iTrackDownRecordDao.deleteTrackDown(id); | |
| 52 | + } | |
| 53 | + | |
| 54 | + public TrackDownRecord getTrackDown(String id) { | |
| 55 | + return iTrackDownRecordDao.getTrackDown(id); | |
| 56 | + } | |
| 57 | + | |
| 58 | + public int queryTrackDownCount(TrackDownRecordQuery query) { | |
| 59 | + return iTrackDownRecordDao.queryTrackDownCount(query.convertToQuery()); | |
| 60 | + } | |
| 61 | + | |
| 62 | + public List<TrackDownRecord> queryTrackDown(TrackDownRecordQuery query) { | |
| 63 | + MongoQuery query1 = query.convertToQuery(); | |
| 64 | + if (StringUtils.isNotEmpty(query.getNeed())) { | |
| 65 | + query.mysqlBuild(iTrackDownRecordDao.queryTrackDownCount(query1)); | |
| 66 | + query1.start(query.getOffset()).end(query.getLimit()); | |
| 67 | + } | |
| 68 | + return iTrackDownRecordDao.queryTrackDown(query1); | |
| 69 | + } | |
| 70 | +} |
platform-dal/src/main/java/com/lyms/platform/pojo/TrackDownRecord.java
View file @
7387451
| 1 | +package com.lyms.platform.pojo; | |
| 2 | + | |
| 3 | +import com.lyms.platform.common.result.BaseModel; | |
| 4 | +import org.springframework.data.mongodb.core.mapping.Document; | |
| 5 | + | |
| 6 | +import java.util.Date; | |
| 7 | + | |
| 8 | + | |
| 9 | +/** | |
| 10 | + * 追访列表的数据 | |
| 11 | + * <p/> | |
| 12 | + * 详细描述 | |
| 13 | + * <p/> | |
| 14 | + * 示例代码 | |
| 15 | + * <pre> | |
| 16 | + * </pre/> | |
| 17 | + * | |
| 18 | + * @author JIAZHI.JIANG | |
| 19 | + * @version BME V100R001 2018-01-17 15:35 | |
| 20 | + * @since BME V100R001C40B104 | |
| 21 | + */ | |
| 22 | +@Document(collection = "lyms_trackdown_record") | |
| 23 | +public class TrackDownRecord extends BaseModel{ | |
| 24 | + | |
| 25 | + private String id; | |
| 26 | + private String username; | |
| 27 | + private Date birth; | |
| 28 | + private String phone; | |
| 29 | + private String cardNo; | |
| 30 | + //末次月经 | |
| 31 | + private Date lastMenses; | |
| 32 | + /** | |
| 33 | + * 孕妇居住地 | |
| 34 | + */ | |
| 35 | + private String addressRegister; | |
| 36 | + private String provinceRegisterId; | |
| 37 | + private String cityRegisterId; | |
| 38 | + private String areaRegisterId; | |
| 39 | + private String streetRegisterId; | |
| 40 | + | |
| 41 | + private String parentId; | |
| 42 | + private String pid; | |
| 43 | + private Date modified; | |
| 44 | + private String hospitalId; | |
| 45 | + private Date created; | |
| 46 | + //这条数据的状态 | |
| 47 | + private Integer status; | |
| 48 | + private Integer trackType; | |
| 49 | + //是否还在这个列表显示 | |
| 50 | + private Integer done; | |
| 51 | + | |
| 52 | + public Integer getTrackType() { | |
| 53 | + return trackType; | |
| 54 | + } | |
| 55 | + | |
| 56 | + public void setTrackType(Integer trackType) { | |
| 57 | + this.trackType = trackType; | |
| 58 | + } | |
| 59 | + | |
| 60 | + public String getId() { | |
| 61 | + return id; | |
| 62 | + } | |
| 63 | + | |
| 64 | + public Date getLastMenses() { | |
| 65 | + return lastMenses; | |
| 66 | + } | |
| 67 | + | |
| 68 | + public void setLastMenses(Date lastMenses) { | |
| 69 | + this.lastMenses = lastMenses; | |
| 70 | + } | |
| 71 | + | |
| 72 | + public void setId(String id) { | |
| 73 | + this.id = id; | |
| 74 | + } | |
| 75 | + | |
| 76 | + public String getUsername() { | |
| 77 | + return username; | |
| 78 | + } | |
| 79 | + | |
| 80 | + public void setUsername(String username) { | |
| 81 | + this.username = username; | |
| 82 | + } | |
| 83 | + | |
| 84 | + public Date getBirth() { | |
| 85 | + return birth; | |
| 86 | + } | |
| 87 | + | |
| 88 | + public void setBirth(Date birth) { | |
| 89 | + this.birth = birth; | |
| 90 | + } | |
| 91 | + | |
| 92 | + public String getPhone() { | |
| 93 | + return phone; | |
| 94 | + } | |
| 95 | + | |
| 96 | + public void setPhone(String phone) { | |
| 97 | + this.phone = phone; | |
| 98 | + } | |
| 99 | + | |
| 100 | + public String getCardNo() { | |
| 101 | + return cardNo; | |
| 102 | + } | |
| 103 | + | |
| 104 | + public void setCardNo(String cardNo) { | |
| 105 | + this.cardNo = cardNo; | |
| 106 | + } | |
| 107 | + | |
| 108 | + public String getAddressRegister() { | |
| 109 | + return addressRegister; | |
| 110 | + } | |
| 111 | + | |
| 112 | + public void setAddressRegister(String addressRegister) { | |
| 113 | + this.addressRegister = addressRegister; | |
| 114 | + } | |
| 115 | + | |
| 116 | + public String getProvinceRegisterId() { | |
| 117 | + return provinceRegisterId; | |
| 118 | + } | |
| 119 | + | |
| 120 | + public void setProvinceRegisterId(String provinceRegisterId) { | |
| 121 | + this.provinceRegisterId = provinceRegisterId; | |
| 122 | + } | |
| 123 | + | |
| 124 | + public String getCityRegisterId() { | |
| 125 | + return cityRegisterId; | |
| 126 | + } | |
| 127 | + | |
| 128 | + public void setCityRegisterId(String cityRegisterId) { | |
| 129 | + this.cityRegisterId = cityRegisterId; | |
| 130 | + } | |
| 131 | + | |
| 132 | + public String getAreaRegisterId() { | |
| 133 | + return areaRegisterId; | |
| 134 | + } | |
| 135 | + | |
| 136 | + public void setAreaRegisterId(String areaRegisterId) { | |
| 137 | + this.areaRegisterId = areaRegisterId; | |
| 138 | + } | |
| 139 | + | |
| 140 | + public String getStreetRegisterId() { | |
| 141 | + return streetRegisterId; | |
| 142 | + } | |
| 143 | + | |
| 144 | + public void setStreetRegisterId(String streetRegisterId) { | |
| 145 | + this.streetRegisterId = streetRegisterId; | |
| 146 | + } | |
| 147 | + | |
| 148 | + public String getParentId() { | |
| 149 | + return parentId; | |
| 150 | + } | |
| 151 | + | |
| 152 | + public void setParentId(String parentId) { | |
| 153 | + this.parentId = parentId; | |
| 154 | + } | |
| 155 | + | |
| 156 | + public String getPid() { | |
| 157 | + return pid; | |
| 158 | + } | |
| 159 | + | |
| 160 | + public void setPid(String pid) { | |
| 161 | + this.pid = pid; | |
| 162 | + } | |
| 163 | + | |
| 164 | + public Date getModified() { | |
| 165 | + return modified; | |
| 166 | + } | |
| 167 | + | |
| 168 | + public void setModified(Date modified) { | |
| 169 | + this.modified = modified; | |
| 170 | + } | |
| 171 | + | |
| 172 | + public String getHospitalId() { | |
| 173 | + return hospitalId; | |
| 174 | + } | |
| 175 | + | |
| 176 | + public void setHospitalId(String hospitalId) { | |
| 177 | + this.hospitalId = hospitalId; | |
| 178 | + } | |
| 179 | + | |
| 180 | + public Date getCreated() { | |
| 181 | + return created; | |
| 182 | + } | |
| 183 | + | |
| 184 | + public void setCreated(Date created) { | |
| 185 | + this.created = created; | |
| 186 | + } | |
| 187 | + | |
| 188 | + public Integer getStatus() { | |
| 189 | + return status; | |
| 190 | + } | |
| 191 | + | |
| 192 | + public void setStatus(Integer status) { | |
| 193 | + this.status = status; | |
| 194 | + } | |
| 195 | + | |
| 196 | + public Integer getDone() { | |
| 197 | + return done; | |
| 198 | + } | |
| 199 | + | |
| 200 | + public void setDone(Integer done) { | |
| 201 | + this.done = done; | |
| 202 | + } | |
| 203 | +} |
platform-dal/src/main/java/com/lyms/platform/query/TrackDownRecordQuery.java
View file @
7387451
| 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.apache.commons.collections.CollectionUtils; | |
| 9 | +import org.slf4j.Logger; | |
| 10 | +import org.slf4j.LoggerFactory; | |
| 11 | + | |
| 12 | +import java.util.List; | |
| 13 | + | |
| 14 | + | |
| 15 | +/** | |
| 16 | + * 添加类的一句话简单描述。 | |
| 17 | + * <p/> | |
| 18 | + * 详细描述 | |
| 19 | + * <p/> | |
| 20 | + * 示例代码 | |
| 21 | + * <pre> | |
| 22 | + * </pre/> | |
| 23 | + * | |
| 24 | + * @author JIAZHI.JIANG | |
| 25 | + * @version BME V100R001 2018-01-17 16:30 | |
| 26 | + * @since BME V100R001C40B104 | |
| 27 | + */ | |
| 28 | +public class TrackDownRecordQuery extends BaseQuery implements IConvertToNativeQuery { | |
| 29 | + private String provinceId; | |
| 30 | + private String cityId; | |
| 31 | + private String areaId; | |
| 32 | + private String streetId; | |
| 33 | + private String key; | |
| 34 | + private Integer trackType; | |
| 35 | + private String parentId; | |
| 36 | + private List<String> pids; | |
| 37 | + private String hospitalId; | |
| 38 | + | |
| 39 | + public String getHospitalId() { | |
| 40 | + return hospitalId; | |
| 41 | + } | |
| 42 | + | |
| 43 | + public void setHospitalId(String hospitalId) { | |
| 44 | + this.hospitalId = hospitalId; | |
| 45 | + } | |
| 46 | + | |
| 47 | + public String getParentId() { | |
| 48 | + return parentId; | |
| 49 | + } | |
| 50 | + | |
| 51 | + public void setParentId(String parentId) { | |
| 52 | + this.parentId = parentId; | |
| 53 | + } | |
| 54 | + | |
| 55 | + public List<String> getPids() { | |
| 56 | + return pids; | |
| 57 | + } | |
| 58 | + | |
| 59 | + public void setPids(List<String> pids) { | |
| 60 | + this.pids = pids; | |
| 61 | + } | |
| 62 | + | |
| 63 | + public String getProvinceId() { | |
| 64 | + return provinceId; | |
| 65 | + } | |
| 66 | + | |
| 67 | + public void setProvinceId(String provinceId) { | |
| 68 | + this.provinceId = provinceId; | |
| 69 | + } | |
| 70 | + | |
| 71 | + public String getCityId() { | |
| 72 | + return cityId; | |
| 73 | + } | |
| 74 | + | |
| 75 | + public void setCityId(String cityId) { | |
| 76 | + this.cityId = cityId; | |
| 77 | + } | |
| 78 | + | |
| 79 | + public String getAreaId() { | |
| 80 | + return areaId; | |
| 81 | + } | |
| 82 | + | |
| 83 | + public void setAreaId(String areaId) { | |
| 84 | + this.areaId = areaId; | |
| 85 | + } | |
| 86 | + | |
| 87 | + public String getStreetId() { | |
| 88 | + return streetId; | |
| 89 | + } | |
| 90 | + | |
| 91 | + public void setStreetId(String streetId) { | |
| 92 | + this.streetId = streetId; | |
| 93 | + } | |
| 94 | + | |
| 95 | + public String getKey() { | |
| 96 | + return key; | |
| 97 | + } | |
| 98 | + | |
| 99 | + public void setKey(String key) { | |
| 100 | + this.key = key; | |
| 101 | + } | |
| 102 | + | |
| 103 | + public Integer getTrackType() { | |
| 104 | + return trackType; | |
| 105 | + } | |
| 106 | + | |
| 107 | + public void setTrackType(Integer trackType) { | |
| 108 | + this.trackType = trackType; | |
| 109 | + } | |
| 110 | + @Override | |
| 111 | + public MongoQuery convertToQuery() { | |
| 112 | + MongoCondition condition=MongoCondition.newInstance(); | |
| 113 | + if(null!=provinceId){ | |
| 114 | + condition= condition.and("provinceId",provinceId, MongoOper.IS); | |
| 115 | + } | |
| 116 | + if(null!=cityId){ | |
| 117 | + condition= condition.and("cityId",cityId, MongoOper.IS); | |
| 118 | + } | |
| 119 | + if(null!=areaId){ | |
| 120 | + condition= condition.and("areaId",areaId, MongoOper.IS); | |
| 121 | + } | |
| 122 | + if(null!=areaId){ | |
| 123 | + condition= condition.and("hospitalId",hospitalId, MongoOper.IS); | |
| 124 | + } | |
| 125 | + if(null!=streetId){ | |
| 126 | + condition = condition.and("streetId", streetId, MongoOper.IS); | |
| 127 | + } | |
| 128 | + if(null!=parentId){ | |
| 129 | + condition = condition.and("parentId", parentId, MongoOper.IS); | |
| 130 | + } | |
| 131 | + if (null != pids) { | |
| 132 | + condition = condition.and("pid", pids, MongoOper.IN); | |
| 133 | + } | |
| 134 | + return condition.toMongoQuery(); | |
| 135 | + } | |
| 136 | +} |