Commit 44174845e7dccdfa2f2a4e6c475673f0c11dc06c

Authored by hujiaqi

Merge remote-tracking branch 'origin/master'

Showing 13 changed files

platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/IAntExRecordDao.java View file @ 4417484
... ... @@ -64,5 +64,7 @@
64 64 Integer count(MongoQuery mongoQuery);
65 65  
66 66 List<HashMap> aggregateOne(MongoQuery mongoQuery);
  67 + //删除匹配的
  68 + void findAndMove(MongoQuery mongoQuery);
67 69 }
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/impl/AntExRecordDaoImpl.java View file @ 4417484
... ... @@ -33,6 +33,10 @@
33 33 @Repository("antExRecordDao")
34 34 public class AntExRecordDaoImpl extends BaseMongoDAOImpl<AntExRecordModel> implements IAntExRecordDao {
35 35  
  36 +
  37 + public void findAndMove(MongoQuery mongoQuery){
  38 + super.delete(mongoQuery.convertToMongoQuery());
  39 + }
36 40 /**
37 41 * 统计单个医院的产检情况
38 42 *
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/AntExRecordService.java View file @ 4417484
... ... @@ -16,9 +16,11 @@
16 16 import org.slf4j.Logger;
17 17 import org.slf4j.LoggerFactory;
18 18 import org.springframework.beans.factory.annotation.Autowired;
  19 +import org.springframework.data.domain.Sort;
19 20 import org.springframework.stereotype.Service;
20 21  
21 22 import java.util.ArrayList;
  23 +import java.util.Date;
22 24 import java.util.List;
23 25  
24 26 /**
25 27  
26 28  
27 29  
... ... @@ -54,22 +56,19 @@
54 56 antExQuery.setHospitalId(hospitalId);
55 57  
56 58 //复诊
57   - List<AntenatalExaminationModel> list = antExService.queryAntenatalExamination(antExQuery.convertToQuery());
58   - List<AntExRecordModel> data = new ArrayList<>();
  59 + List<AntenatalExaminationModel> list = antExService.queryAntenatalExamination(antExQuery.convertToQuery().addOrder(Sort.Direction.DESC,"checkDate"));
59 60 for (AntenatalExaminationModel antEx : list) {
60 61 AntExRecordModel record = convert(antEx);
61   - if(null!=record){
62   - data.add(record);
  62 + if (null != record) {
  63 + AntExRecordQuery antExRecordQuery = new AntExRecordQuery();
  64 + antExRecordQuery.setParentId(record.getParentId());
  65 + antExRecordQuery.setcId(record.getCheckDoctor());
  66 + Integer count = count(antExRecordQuery);
  67 + if (null == count || 0 == count) {
  68 + antExRecordDao.addOneRecord(record);
  69 + }
63 70 }
64   - if (data.size() == 50) {
65   - antExRecordDao.batchAddRecord(data);
66   - data.clear();
67   - }
68 71 }
69   - if (!data.isEmpty()) {
70   - antExRecordDao.batchAddRecord(data);
71   - data.clear();
72   - }
73 72  
74 73  
75 74 //初诊
76 75  
77 76  
... ... @@ -81,17 +80,70 @@
81 80 if (CollectionUtils.isNotEmpty(antExChuModelList)) {
82 81 for (AntExChuModel antEx : antExChuModelList) {
83 82 AntExRecordModel record = convert(antEx);
84   - if(null!=record){
85   - data.add(record);
  83 + if (null != record) {
  84 + AntExRecordQuery antExRecordQuery = new AntExRecordQuery();
  85 + antExRecordQuery.setParentId(record.getParentId());
  86 + antExRecordQuery.setcId(record.getCheckDoctor());
  87 + Integer count = count(antExRecordQuery);
  88 + if (null == count || 0 == count) {
  89 + antExRecordDao.addOneRecord(record);
  90 + }
86 91 }
87   - if (data.size() == 50) {
88   - antExRecordDao.batchAddRecord(data);
89   - data.clear();
  92 + }
  93 + }
  94 + }
  95 +
  96 + /**
  97 + * 处理删除检查
  98 + *
  99 + * @param parentId
  100 + */
  101 + public void handExRecord(String parentId) {
  102 + if (StringUtils.isEmpty(parentId)) {
  103 + return;
  104 + }
  105 +
  106 + //先删除掉该人的
  107 + AntExRecordQuery antExRecordQuery1 = new AntExRecordQuery();
  108 + antExRecordQuery1.setParentId(parentId);
  109 + antExRecordDao.findAndMove(antExRecordQuery1.convertToQuery());
  110 +
  111 + AntExQuery antExQuery = new AntExQuery();
  112 + antExQuery.setYn(YnEnums.YES.getId());
  113 + antExQuery.setParentId(parentId);
  114 + //复诊
  115 + List<AntenatalExaminationModel> list = antExService.queryAntenatalExamination(antExQuery.convertToQuery());
  116 + for (AntenatalExaminationModel antEx : list) {
  117 + AntExRecordModel record = convert(antEx);
  118 + if (null != record) {
  119 + AntExRecordQuery antExRecordQuery = new AntExRecordQuery();
  120 + antExRecordQuery.setParentId(record.getParentId());
  121 + antExRecordQuery.setcId(record.getCheckDoctor());
  122 + Integer count = count(antExRecordQuery);
  123 + if (null == count || 0 == count) {
  124 + antExRecordDao.addOneRecord(record);
90 125 }
91 126 }
92   - if (!data.isEmpty()) {
93   - antExRecordDao.batchAddRecord(data);
94   - data.clear();
  127 + }
  128 +
  129 + //初诊
  130 + AntExChuQuery antExChuQuery = new AntExChuQuery();
  131 + antExChuQuery.setYn(YnEnums.YES.getId());
  132 + antExChuQuery.setParentId(parentId);
  133 + List<AntExChuModel> antExChuModelList = antExService.queryAntExChu(antExChuQuery.convertToQuery());
  134 +
  135 + if (CollectionUtils.isNotEmpty(antExChuModelList)) {
  136 + for (AntExChuModel antEx : antExChuModelList) {
  137 + AntExRecordModel record = convert(antEx);
  138 + if (null != record) {
  139 + AntExRecordQuery antExRecordQuery = new AntExRecordQuery();
  140 + antExRecordQuery.setParentId(record.getParentId());
  141 + antExRecordQuery.setcId(record.getCheckDoctor());
  142 + Integer count = count(antExRecordQuery);
  143 + if (null == count || 0 == count) {
  144 + antExRecordDao.addOneRecord(record);
  145 + }
  146 + }
95 147 }
96 148 }
97 149 }
98 150  
... ... @@ -106,11 +158,12 @@
106 158 antExRecordModel.setCheckDoctor(antEx.getCheckDoctor());
107 159 antExRecordModel.setCheckTime(antEx.getCheckDate());
108 160 antExRecordModel.setPid(antEx.getPid());
  161 + antExRecordModel.setModified(new Date());
109 162 Patients patients = patientsService.findOnePatientById(antEx.getParentId());
110 163 if (null != patients) {
111 164 if (patients.getType() == 1) {
112 165 antExRecordModel.setStatus(2);
113   - }else{
  166 + } else {
114 167 antExRecordModel.setStatus(1);
115 168 }
116 169 antExRecordModel.setBrith(patients.getBirth());
... ... @@ -121,8 +174,8 @@
121 174 antExRecordModel.sethScore(patients.getRiskScore());
122 175 antExRecordModel.sethRisk(patients.getRiskFactorId());
123 176 antExRecordModel.sethLevel(JsonUtil.toList(patients.getRiskLevelId(), List.class));
124   - }else{
125   - logger.info("antex find patient by id is null. parentId:"+antEx.getParentId());
  177 + } else {
  178 + logger.info("antex find patient by id is null. parentId:" + antEx.getParentId());
126 179 return null;
127 180 }
128 181 return antExRecordModel;
129 182  
... ... @@ -135,11 +188,12 @@
135 188 antExRecordModel.setParentId(antExChuModel.getParentId());
136 189 antExRecordModel.setType(2);
137 190 antExRecordModel.setPid(antExChuModel.getPid());
  191 + antExRecordModel.setModified(new Date());
138 192 Patients patients = patientsService.findOnePatientById(antExChuModel.getParentId());
139 193 if (null != patients) {
140 194 if (patients.getType() == 1) {
141 195 antExRecordModel.setStatus(2);
142   - }else{
  196 + } else {
143 197 antExRecordModel.setStatus(1);
144 198 }
145 199 antExRecordModel.setLastMenses(patients.getLastMenses());
... ... @@ -150,8 +204,8 @@
150 204 antExRecordModel.sethScore(patients.getRiskScore());
151 205 antExRecordModel.sethRisk(patients.getRiskFactorId());
152 206 antExRecordModel.sethLevel(JsonUtil.toList(patients.getRiskLevelId(), List.class));
153   - }else{
154   - logger.info("antexc find patient by id is null. parentId:"+antExChuModel.getParentId());
  207 + } else {
  208 + logger.info("antexc find patient by id is null. parentId:" + antExChuModel.getParentId());
155 209 return null;
156 210 }
157 211 return antExRecordModel;
... ... @@ -175,6 +229,11 @@
175 229 query.start(antExRecordQuery.getOffset()).end(antExRecordQuery.getLimit());
176 230 }
177 231 return antExRecordDao.queryRecord(antExRecordQuery.convertToQuery());
  232 + }
  233 +
  234 +
  235 + public Integer count(AntExRecordQuery antExRecordQuery) {
  236 + return antExRecordDao.count(antExRecordQuery.convertToQuery());
178 237 }
179 238  
180 239 /**
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/AntenatalExaminationService.java View file @ 4417484
... ... @@ -7,8 +7,10 @@
7 7 import com.lyms.platform.common.dao.operator.MongoQuery;
8 8 import com.lyms.platform.common.enums.YnEnums;
9 9 import com.lyms.platform.pojo.AntExChuModel;
  10 +import com.lyms.platform.pojo.AntExRecordModel;
10 11 import com.lyms.platform.pojo.AntenatalExaminationModel;
11 12 import com.lyms.platform.query.AntExChuQuery;
  13 +import com.lyms.platform.query.AntExRecordQuery;
12 14 import com.lyms.platform.query.VisitQuery;
13 15 import org.springframework.beans.factory.annotation.Autowired;
14 16 import org.springframework.data.domain.Sort;
... ... @@ -20,7 +22,7 @@
20 22  
21 23 /**
22 24 * 产前检查服务实现
23   - * <p>
  25 + * <p/>
24 26 * Created by Administrator on 2016/6/16 0016.
25 27 */
26 28 @Service
27 29  
... ... @@ -29,11 +31,13 @@
29 31 private IAntenatalExaminationDao iAntenatalExaminationDao;
30 32 @Autowired
31 33 private IAntExChuDao iAntExChuDao;
  34 + @Autowired
  35 + private AntExRecordService antExRecordService;
32 36  
33 37 public List<AntenatalExaminationModel> findAllByParentId(String parentId) {
34 38 Assert.notNull(parentId, "findAllByParentId parentId must not be null.");
35   - MongoCondition condition = MongoCondition.newInstance("parentId", parentId, MongoOper.IS).and("yn", YnEnums.YES.getId(),MongoOper.IS);
36   - return iAntenatalExaminationDao.queryAntenatalExamination(condition.toMongoQuery().addOrder(Sort.Direction.DESC,"created"));
  39 + MongoCondition condition = MongoCondition.newInstance("parentId", parentId, MongoOper.IS).and("yn", YnEnums.YES.getId(), MongoOper.IS);
  40 + return iAntenatalExaminationDao.queryAntenatalExamination(condition.toMongoQuery().addOrder(Sort.Direction.DESC, "created"));
37 41 }
38 42  
39 43  
40 44  
41 45  
... ... @@ -43,12 +47,14 @@
43 47  
44 48 /**
45 49 * 查询条数
  50 + *
46 51 * @param query
47 52 * @return
48 53 */
49   - public int queryAntExChuCount(MongoQuery query){
50   - return (int)iAntExChuDao.count(query);
  54 + public int queryAntExChuCount(MongoQuery query) {
  55 + return (int) iAntExChuDao.count(query);
51 56 }
  57 +
52 58 /**
53 59 * 按条件查询所有
54 60 *
55 61  
... ... @@ -80,10 +86,39 @@
80 86 Assert.notNull(babyVisitModel, "addOneBabyAnt babyVisitModel must not be null.");
81 87 babyVisitModel.setCreated(new Date());
82 88 babyVisitModel.setModified(new Date());
  89 +
83 90 return iAntenatalExaminationDao.addOneAntenatalExamination(babyVisitModel);
84 91 }
85 92  
86 93 /**
  94 + * @param id
  95 + * @param type 1 初诊 2 复诊
  96 + */
  97 + public void updateAntExRecord(String id, int type) {
  98 + AntExRecordModel antExRecordModel = null;
  99 + if (type == 2) {
  100 + AntenatalExaminationModel ant = findOneById(id);
  101 + antExRecordModel = antExRecordService.convert(ant);
  102 + } else {
  103 + AntExChuModel chu = findOne(id);
  104 + antExRecordModel = antExRecordService.convert(chu);
  105 + }
  106 +
  107 +
  108 + if (null != antExRecordModel) {
  109 + AntExRecordQuery antExRecordQuery = new AntExRecordQuery();
  110 + antExRecordQuery.setParentId(antExRecordModel.getParentId());
  111 + antExRecordQuery.setcId(antExRecordModel.getCheckDoctor());
  112 + Integer count = antExRecordService.count(antExRecordQuery);
  113 + if (null == count || 0 == count) {
  114 + antExRecordModel.setCreated(new Date());
  115 + antExRecordService.addOneRecord(antExRecordModel);
  116 + }
  117 + }
  118 + }
  119 +
  120 +
  121 + /**
87 122 * 修改一条新生儿访视记录
88 123 *
89 124 * @param babyVisitModel 新生儿访视记录模型
... ... @@ -93,6 +128,7 @@
93 128 Assert.notNull(id, "updateOneAnt id must not be null.");
94 129 babyVisitModel.setModified(new Date());
95 130 iAntenatalExaminationDao.updateAntenatalExamination(babyVisitModel, id);
  131 +
96 132 }
97 133  
98 134 /**
... ... @@ -115,6 +151,7 @@
115 151 public void updateAntExChu(AntExChuModel antExChuModel, String id) {
116 152 antExChuModel.setModified(new Date());
117 153 iAntExChuDao.updateOneAntEx(antExChuModel, id);
  154 +
118 155 }
119 156  
120 157 /**
121 158  
122 159  
123 160  
124 161  
... ... @@ -126,21 +163,24 @@
126 163 public AntExChuModel addOneAntEx(AntExChuModel obj) {
127 164 obj.setCreated(new Date());
128 165 obj.setModified(new Date());
  166 +
129 167 return iAntExChuDao.addOneAntEx(obj);
130 168 }
131 169  
132   - public List<AntExChuModel> queryAntExChu(AntExChuQuery antExChuQuery){
  170 + public List<AntExChuModel> queryAntExChu(AntExChuQuery antExChuQuery) {
133 171 return iAntExChuDao.query(antExChuQuery.convertToQuery().addOrder(Sort.Direction.DESC, "created"));
134 172 }
135 173  
136   - public List<AntExChuModel> queryAntExChu(MongoQuery mongoQuery){
  174 + public List<AntExChuModel> queryAntExChu(MongoQuery mongoQuery) {
137 175 return iAntExChuDao.query(mongoQuery);
138 176 }
139   - public List<AntenatalExaminationModel> queryYuyueAntenatalExamination(Date yuYueDate,String hospitalId) {
  177 +
  178 + public List<AntenatalExaminationModel> queryYuyueAntenatalExamination(Date yuYueDate, String hospitalId) {
140 179 return iAntenatalExaminationDao.queryYuyueAntenatalExamination(yuYueDate, hospitalId);
141 180 }
142   - public List<AntenatalExaminationModel> queryYuyueAntenatalExamination(Date startDate,String hospitalId,String pid) {
143   - return iAntenatalExaminationDao.queryYuyueAntenatalExamination(startDate, hospitalId,pid);
  181 +
  182 + public List<AntenatalExaminationModel> queryYuyueAntenatalExamination(Date startDate, String hospitalId, String pid) {
  183 + return iAntenatalExaminationDao.queryYuyueAntenatalExamination(startDate, hospitalId, pid);
144 184 }
145 185  
146 186  
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/PatientsService.java View file @ 4417484
1 1 package com.lyms.platform.biz.service;
2 2  
3   -import com.lyms.platform.biz.dal.IPatientDao;
4   -import com.lyms.platform.biz.dal.IReferralApplyOrderDao;
5   -import com.lyms.platform.biz.dal.ISieveApplyOrderDao;
6   -import com.lyms.platform.biz.dal.ISieveDao;
  3 +import com.lyms.platform.biz.dal.*;
7 4 import com.lyms.platform.common.dao.operator.MongoQuery;
8 5 import com.lyms.platform.common.enums.SieveStatusEnums;
9 6 import com.lyms.platform.common.enums.YnEnums;
... ... @@ -37,6 +34,8 @@
37 34 private IReferralApplyOrderDao iReferralApplyOrderDao;
38 35 @Autowired
39 36 private PersonService personService;
  37 + @Autowired
  38 + private IAntExRecordDao iAntExRecordDao;
40 39  
41 40 public Patients addPatient(Patients obj) {
42 41 return iPatientDao.addPatient(obj);
43 42  
44 43  
45 44  
... ... @@ -240,9 +239,29 @@
240 239 updateSieve(patients);
241 240 //修改转诊
242 241 updateRefer(patients);
  242 +
  243 + updateExRecord(patients);
243 244 }
  245 + //修改产检管理的孕妇基本信息
  246 + private void updateExRecord(Patients patients){
  247 + AntExRecordQuery antExRecordQuery=new AntExRecordQuery();
  248 + antExRecordQuery.setParentId(patients.getId());
244 249  
  250 + AntExRecordModel antExRecordModel=new AntExRecordModel();
  251 + antExRecordModel.setLastMenses(patients.getLastMenses());
  252 + antExRecordModel.setBuildTime(patients.getBookbuildingDate());
  253 + antExRecordModel.setDueDate(patients.getDueDate());
  254 + antExRecordModel.setName(patients.getUsername());
  255 + antExRecordModel.setBrith(patients.getBirth());
  256 + if(patients.getType()==1){
  257 + antExRecordModel.setStatus(2);
  258 + }else {
  259 + antExRecordModel.setStatus(1);
  260 + }
  261 + antExRecordModel.setModified(new Date());
245 262  
  263 + iAntExRecordDao.batchUpdateRecord(antExRecordModel, antExRecordQuery.convertToQuery());
  264 + }
246 265 /**
247 266 * 修改产筛数据
248 267 *
platform-dal/src/main/java/com/lyms/platform/pojo/AntExRecordModel.java View file @ 4417484
... ... @@ -45,6 +45,26 @@
45 45 //末次月经
46 46 private Date lastMenses;
47 47  
  48 + private Date modified;
  49 +
  50 + private Date created;
  51 +
  52 + public Date getModified() {
  53 + return modified;
  54 + }
  55 +
  56 + public void setModified(Date modified) {
  57 + this.modified = modified;
  58 + }
  59 +
  60 + public Date getCreated() {
  61 + return created;
  62 + }
  63 +
  64 + public void setCreated(Date created) {
  65 + this.created = created;
  66 + }
  67 +
48 68 public Date getBuildTime() {
49 69 return buildTime;
50 70 }
platform-dal/src/main/java/com/lyms/platform/query/ResidentsArchiveQuery.java View file @ 4417484
... ... @@ -127,6 +127,9 @@
127 127 if (StringUtils.isNotBlank(areaId)) {
128 128 condition = condition.and("areaId", areaId, MongoOper.IS);
129 129 }
  130 + if (StringUtils.isNotBlank(vcCardNo)) {
  131 + condition = condition.and("vcCardNo", vcCardNo, MongoOper.IS);
  132 + }
130 133 if (yn !=null) {
131 134 condition = condition.and("yn", yn, MongoOper.IS);
132 135 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/UsersController.java View file @ 4417484
... ... @@ -494,6 +494,12 @@
494 494 }
495 495  
496 496 users.setOrganizations(organizations);
  497 +
  498 + List<DataPermissionsModel> permissionsModelList = accessPermissionFacade.findAccessPerminssionByUserId(users.getId());
  499 + if (permissionsModelList != null && permissionsModelList.size() > 0) {
  500 + users.setAreaPermission(permissionsModelList.get(0).getAreaPermission());
  501 + }
  502 +
497 503 Map<String, Object> map = new HashMap<>();
498 504 map.put("user", users);
499 505 map.put("roles", roles);
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntExRecordFacade.java View file @ 4417484
... ... @@ -111,6 +111,23 @@
111 111 for (AntExRecordModel record : list2) {
112 112 CjStatisticsListResult cjStatisticsListResult = new CjStatisticsListResult();
113 113 cjStatisticsListResult.convertToResult(record);
  114 + Patients patients = patientsService.findOnePatientById(record.getParentId());
  115 + String dueWeek = "";
  116 + if (null != patients) {
  117 + if (patients.getDueStatus() == 1) {
  118 + dueWeek = "终止妊娠";
  119 + } else if (null != patients.getFmDate()) {
  120 + dueWeek = "已分娩";
  121 + } else {
  122 + int days = DateUtil.daysBetween(patients.getLastMenses(), new Date());
  123 + String week = (days / 7) + "";
  124 + int day = (days % 7);
  125 + dueWeek = "孕" + week + "周" + (day > 0 ? "+" + day + "天" : "");
  126 + }
  127 + cjStatisticsListResult.setDueWeek(dueWeek);
  128 + }
  129 +
  130 +
114 131 Users users = usersService.getUsers(NumberUtils.toInt(record.getCheckDoctor()));
115 132 if (null != users) {
116 133 cjStatisticsListResult.setCheckDoctor(users.getName());
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntenatalExaminationFacade.java View file @ 4417484
... ... @@ -57,7 +57,8 @@
57 57 private UsersService usersService;
58 58 @Autowired
59 59 private DeleteProcessHandler deleteProcessHandler;
60   -
  60 +@Autowired
  61 + private AntExRecordService recordService;
61 62 /**
62 63 * 修改最后一次产检时间
63 64 *
... ... @@ -145,6 +146,9 @@
145 146 updateLastRhTime(patients.getId(), hospitalId);
146 147 //修改最后一次检查时间
147 148 setLashCTimes(hospitalId, antExAddRequest.getParentId(), 2);
  149 +
  150 + //复诊,修改产检管理
  151 + antenatalExaminationService.updateAntExRecord(antExAddRequest.getId(), 2);
148 152 } else {
149 153 AntenatalExaminationModel model = antExAddRequest.convertToDataModel();
150 154 model.setOperator(userId);
... ... @@ -181,6 +185,8 @@
181 185  
182 186 //修改本院最后一次定义高危
183 187 updateLastRhTime(patients.getId(), hospitalId);
  188 + //复诊,修改产检管理
  189 + antenatalExaminationService.updateAntExRecord(model.getId(),2);
184 190 if (null != patients.getBuildType() && patients.getBuildType() == 3) {
185 191 ReferralApplyOrderQuery referralApplyOrderQuery = new ReferralApplyOrderQuery();
186 192 referralApplyOrderQuery.setParentId(patients.getId());
... ... @@ -264,6 +270,9 @@
264 270  
265 271 setLashCTimes(hospitalId, antExChuModel.getParentId(), 1);
266 272  
  273 + //初诊,修改产检管理
  274 + antenatalExaminationService.updateAntExRecord(antExChuModel.getId(), 1);
  275 +
267 276 } else {
268 277 AntExChuQuery antExChuQuery1 = new AntExChuQuery();
269 278 antExChuQuery1.setParentId(excAddRequest.getParentId());
... ... @@ -304,6 +313,7 @@
304 313 //修改本院最后一次定义高危
305 314 updateLastRhTime(patients.getId(), hospitalId);
306 315 setLashCTimes(hospitalId, antExChuModel.getParentId(), 1);
  316 + antenatalExaminationService.updateAntExRecord(antExChuModel.getId(), 1);
307 317 if (null != patients.getBuildType() && patients.getBuildType() == 3) {
308 318 Patients patients1 = new Patients();
309 319 patients1.setEnable("1");
... ... @@ -1422,7 +1432,7 @@
1422 1432 setLashCTimes(hospital, antenatalExaminationModel.getParentId(), 2);
1423 1433  
1424 1434 updateLastRisk(antenatalExaminationModel.getParentId());
1425   -
  1435 + recordService.handExRecord(antenatalExaminationModel.getParentId());
1426 1436 } else {
1427 1437 return new BaseResponse().setErrorcode(ErrorCodeConstants.BUSINESS_ERROR).setErrormsg("当前产检记录不是本院最新的产检记录,不能删除");
1428 1438 }
... ... @@ -1470,7 +1480,7 @@
1470 1480 AntExChuModel antExChuModel1 = antenatalExaminationService.findOne(antExQueryRequest.getId());
1471 1481 setLashCTimes(hospital, antExChuModel1.getParentId(), 1);
1472 1482 updateLastRisk(antExChuModel1.getParentId());
1473   -
  1483 + recordService.handExRecord(antExChuModel1.getParentId());
1474 1484 } else {
1475 1485 return new BaseResponse().setErrorcode(ErrorCodeConstants.BUSINESS_ERROR).setErrormsg("当前产检记录不是本院最新的产检记录,不能删除");
1476 1486 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ResidentsArchiveFacade.java View file @ 4417484
... ... @@ -180,7 +180,7 @@
180 180 if (StringUtils.isNotEmpty(addRequest.getCertificateNum())){
181 181 //判断该证件号码是否在该医院建档
182 182 query.setCertificateNum(addRequest.getCertificateNum());
183   - query.setCertificateTypeId(addRequest.getCertificateTypeId());
  183 +// query.setCertificateTypeId(addRequest.getCertificateTypeId());
184 184 List<ResidentsArchiveModel> modelList = residentsArchiveService.queryResident(query);
185 185 if (CollectionUtils.isNotEmpty(modelList)){
186 186 ResidentsArchiveModel archiveModel = modelList.get(0);
187 187  
... ... @@ -241,11 +241,20 @@
241 241 if (StringUtils.isNotEmpty(addRequest.getCertificateNum())) {
242 242 //判断该证件号码是否在该医院建档
243 243 query.setCertificateNum(addRequest.getCertificateNum());
244   - query.setCertificateTypeId(addRequest.getCertificateTypeId());
245 244 List<ResidentsArchiveModel> modelList = residentsArchiveService.queryResident(query);
246 245 if (CollectionUtils.isNotEmpty(modelList)){
247 246 br.setErrorcode(ErrorCodeConstants.DATA_EXIST);
248 247 br.setErrormsg("该证件号在医院已经建档");
  248 + return br;
  249 + }
  250 + }
  251 +
  252 + if (StringUtils.isNotEmpty(addRequest.getPhone())){
  253 + query.setPhone(addRequest.getPhone());
  254 + List<ResidentsArchiveModel> modelList = residentsArchiveService.queryResident(query);
  255 + if (CollectionUtils.isNotEmpty(modelList)){
  256 + br.setErrorcode(ErrorCodeConstants.DATA_EXIST);
  257 + br.setErrormsg("该手机号在医院已经建档");
249 258 return br;
250 259 }
251 260 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/worker/QuanPatientWorker.java View file @ 4417484
... ... @@ -198,8 +198,8 @@
198 198 }
199 199 stopWatch.stop();
200 200 //注册地址
201   - quanPatientsResult.setRegisterAddr(CommonsHelper.getResidence(patients.getProvinceRegisterId(), patients.getCityRegisterId(), patients.getAreaRegisterId(), patients.getStreetRegisterId(), patients.getAddressRegister(), basicConfigService));
202   - quanPatientsResult.setAddr(CommonsHelper.getResidence(patients.getProvinceId(), patients.getCityId(), patients.getAreaId(), patients.getStreetId(), patients.getAddress(), basicConfigService));
  201 + quanPatientsResult.setRegisterAddr(CommonsHelper.getResidence(patients.getProvinceId(), patients.getCityId(), patients.getAreaId(), patients.getStreetId(), patients.getAddress(), basicConfigService));
  202 + quanPatientsResult.setAddr(CommonsHelper.getResidence(patients.getProvinceRegisterId(), patients.getCityRegisterId(), patients.getAreaRegisterId(), patients.getStreetRegisterId(), patients.getAddressRegister(), basicConfigService));
203 203 try {
204 204 quanPatientsResult.setFirstBH(organizationService.getOrganization(Integer.valueOf(patients.getHospitalId())).getName());
205 205 } catch (Exception e) {
platform-operate-api/src/main/java/com/lyms/platform/operate/web/worker/WorkHR.java View file @ 4417484
... ... @@ -183,8 +183,8 @@
183 183 }
184 184 stopWatch.stop();
185 185 //注册地址
186   - riskPatientsResult.setRegisterAddr(CommonsHelper.getResidence(patients.getProvinceRegisterId(), patients.getCityRegisterId(), patients.getAreaRegisterId(), patients.getStreetRegisterId(), patients.getAddressRegister(), basicConfigService));
187   - riskPatientsResult.setAddr(CommonsHelper.getResidence(patients.getProvinceId(), patients.getCityId(), patients.getAreaId(), patients.getStreetId(), patients.getAddress(), basicConfigService));
  186 + riskPatientsResult.setRegisterAddr(CommonsHelper.getResidence(patients.getProvinceId(), patients.getCityId(), patients.getAreaId(), patients.getStreetId(), patients.getAddress(), basicConfigService));
  187 + riskPatientsResult.setAddr(CommonsHelper.getResidence(patients.getProvinceRegisterId(), patients.getCityRegisterId(), patients.getAreaRegisterId(), patients.getStreetRegisterId(), patients.getAddressRegister(), basicConfigService));
188 188 try {
189 189 riskPatientsResult.setFirstBH(organizationService.getOrganization(Integer.valueOf(patients.getHospitalId())).getName());
190 190 } catch (Exception e) {