Commit 13d1150116db3578f5a8dd8576bba882cc2231f8

Authored by liquanyu
1 parent ae3d0a58b7

区域档案管理

Showing 9 changed files with 81 additions and 114 deletions

platform-biz-service/src/main/resources/mainOrm/master/CouponMapper.xml View file @ 13d1150
... ... @@ -1495,7 +1495,7 @@
1495 1495  
1496 1496 <select id="getCouponHospital" parameterType="string" resultType="string">
1497 1497 SELECT DISTINCT(o.name) as cname from coupon_info c LEFT JOIN organization o
1498   - on c.create_hospital_id=o.id where c.user_id=#{userId}
  1498 + on c.create_hospital_id=o.id where c.user_id=#{userId} and c.create_date > DATE_SUB(SYSDATE(), interval 2 year)
1499 1499 and c.create_date >= DATE_SUB(NOW(), interval 10 MONTH)
1500 1500 </select>
1501 1501  
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/OrganizationController.java View file @ 13d1150
... ... @@ -279,6 +279,11 @@
279 279 @RequestParam(value = "areaId", required = false) String aId) {
280 280 LoginContext loginState = (LoginContext) request.getAttribute("loginContext");
281 281 Users users = usersService.getUsers(loginState.getId());
  282 + //定制秦皇岛区域影响了承德区域
  283 + Organization org = organizationService.getOrganization(users.getOrgId());
  284 + if ("9".equals(org.getCityId())){
  285 + isMaternityManagement = null;
  286 + }
282 287  
283 288 List<Integer> areaId = autoMatchFacade.matchAreaOrgId(loginState.getId());
284 289 List<Object> data = new ArrayList<>();
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientFacade.java View file @ 13d1150
... ... @@ -1681,7 +1681,10 @@
1681 1681 if (end > patientses.size()) {
1682 1682 end = patientses.size();
1683 1683 }
1684   - listFuture.add(commonThreadPool.submit(new QuanChanPatientWorker(patientses.subList(i, end), hospital, usersService, postReviewService, matDeliverService, patientsService, organizationService, basicConfigService, antExService, dischargeAbstractMotherService, matDeliverFollowService)));
  1684 + listFuture.add(commonThreadPool.submit(new QuanChanPatientWorker(patientses.subList(i, end),
  1685 + hospital, usersService, postReviewService, matDeliverService, patientsService,
  1686 + organizationService, basicConfigService, antExService, dischargeAbstractMotherService,
  1687 + matDeliverFollowService,couponService)));
1685 1688 }
1686 1689 for (Future f : listFuture) {
1687 1690 try {
platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/QuanPatientsResult.java View file @ 13d1150
... ... @@ -119,6 +119,17 @@
119 119 //领劵社区
120 120 private String couponCommunity;
121 121  
  122 + //最后检查时间
  123 + private String lastCheckTime;
  124 +
  125 + public String getLastCheckTime() {
  126 + return lastCheckTime;
  127 + }
  128 +
  129 + public void setLastCheckTime(String lastCheckTime) {
  130 + this.lastCheckTime = lastCheckTime;
  131 + }
  132 +
122 133 public String getrFactor() {
123 134 return rFactor;
124 135 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/RiskPatientsResult.java View file @ 13d1150
... ... @@ -100,6 +100,17 @@
100 100 //初诊时间
101 101 private String firstCheckTime;
102 102  
  103 + //最后检查时间
  104 + private String lastCheckTime;
  105 +
  106 + public String getLastCheckTime() {
  107 + return lastCheckTime;
  108 + }
  109 +
  110 + public void setLastCheckTime(String lastCheckTime) {
  111 + this.lastCheckTime = lastCheckTime;
  112 + }
  113 +
103 114 public String getCouponCommunity() {
104 115 return couponCommunity;
105 116 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/SyncDataTaskService.java View file @ 13d1150
... ... @@ -60,7 +60,7 @@
60 60 urls.put("area-rongcheng-api.healthbaby.com.cn:12356","荣成");
61 61 urls.put("area-zhucheng-api.healthbaby.com.cn:12356","诸城市妇幼保健院");
62 62 urls.put("area-weihai-api.healthbaby.com.cn:12356","威海市妇幼");
63   - //urls.put("area-chengde-api.healthbaby.com.cn:12356","承德");
  63 + urls.put("area-chengde-api.healthbaby.com.cn:12356","承德");
64 64 //urls.put("area-lingcheng-api.healthbaby.com.cn:12356","陵城");
65 65 }
66 66  
platform-operate-api/src/main/java/com/lyms/platform/operate/web/worker/QuanChanPatientWorker.java View file @ 13d1150
... ... @@ -12,7 +12,9 @@
12 12 import com.lyms.platform.operate.web.result.HighScoreResult;
13 13 import com.lyms.platform.operate.web.result.QuanChanResult;
14 14 import com.lyms.platform.operate.web.utils.CommonsHelper;
  15 +import com.lyms.platform.permission.model.Organization;
15 16 import com.lyms.platform.permission.model.Users;
  17 +import com.lyms.platform.permission.service.CouponService;
16 18 import com.lyms.platform.permission.service.OrganizationService;
17 19 import com.lyms.platform.permission.service.UsersService;
18 20 import com.lyms.platform.pojo.*;
... ... @@ -54,6 +56,7 @@
54 56 private BasicConfigService basicConfigService;
55 57 private DischargeAbstractMotherService dischargeAbstractMotherService;
56 58 private MatDeliverFollowService matDeliverFollowService;
  59 + private CouponService couponService;
57 60  
58 61 public QuanChanPatientWorker(List <Patients> patientses,
59 62 String hospital,
... ... @@ -62,7 +65,9 @@
62 65 MatDeliverService matDeliverService, PatientsService patientsService,
63 66 OrganizationService organizationService, BasicConfigService basicConfigService,
64 67 AntenatalExaminationService antExService, DischargeAbstractMotherService dischargeAbstractMotherService,
65   - MatDeliverFollowService matDeliverFollowService) {
  68 + MatDeliverFollowService matDeliverFollowService,
  69 + CouponService couponService) {
  70 + this.couponService = couponService;
66 71 this.patientses = patientses;
67 72 this.matDeliverService = matDeliverService;
68 73 this.postReviewService = postReviewService;
... ... @@ -182,6 +187,14 @@
182 187 int ichu = CollectionUtils.isEmpty(chu) ? 0 : chu.size();
183 188 chanResult.setCjTimes(ichu + i);
184 189  
  190 + try {
  191 + //优惠券发放医院
  192 + String coupHospital = couponService.getCouponHospital(patients.getPid());
  193 + chanResult.setCouponCommunity(coupHospital);
  194 + } catch (Exception e) {
  195 + chanResult.setCouponCommunity("");
  196 + }
  197 +
185 198 //出院小结
186 199 DischargeAbstractMotherQuery dischargeAbstractMotherQuery = new DischargeAbstractMotherQuery();
187 200 dischargeAbstractMotherQuery.setYn(YnEnums.YES.getId());
... ... @@ -233,7 +246,7 @@
233 246 List<BasicConfig> basicConfigList = basicConfigService.queryBasicConfig(basicConfigQuery);
234 247 chanResult.setLiveType(basicConfigList.get(0).getName());
235 248 }
236   - chanResult.setbTime(DateUtil.getyyyy_MM_dd(patients.getBookbuildingDate()));
  249 + chanResult.setbTime(DateUtil.getyyyy_MM_dd(patients.getFirstCheckTime()));
237 250 //注册地址
238 251 chanResult.setRegisterAddr(CommonsHelper.getResidence(patients.getProvinceId(), patients.getCityId(), patients.getAreaId(), patients.getStreetId(), patients.getAddress(), basicConfigService));
239 252 chanResult.setAddr(CommonsHelper.getResidence(patients.getProvinceRegisterId(), patients.getCityRegisterId(), patients.getAreaRegisterId(), patients.getStreetRegisterId(), patients.getAddressRegister(), basicConfigService));
platform-operate-api/src/main/java/com/lyms/platform/operate/web/worker/QuanPatientWorker.java View file @ 13d1150
... ... @@ -31,6 +31,7 @@
31 31 import org.apache.commons.lang.math.NumberUtils;
32 32 import org.slf4j.Logger;
33 33 import org.slf4j.LoggerFactory;
  34 +import org.springframework.data.domain.Sort;
34 35 import org.springframework.util.StopWatch;
35 36  
36 37 import java.util.*;
... ... @@ -81,14 +82,7 @@
81 82 try {
82 83 StopWatch stopWatch = new StopWatch("QuanPatientWorker -" + patients.getId());
83 84 QuanPatientsResult quanPatientsResult = new QuanPatientsResult();
84   - /*******************************开始**************************/
85   - /**
86   - * 秦皇岛需求 在区域妇幼管理---全部孕妇管理---全部产妇管理、全部孕妇管理两个界面,首次建档医院后面加初诊日期一栏列表
87   - */
88   - if (patients.getFirstCheckTime() != null){
89   - quanPatientsResult.setFirstCheckTime(DateUtil.getyyyy_MM_dd(patients.getFirstCheckTime()));
90   - }
91   - /****************************结束*****************************/
  85 +
92 86 quanPatientsResult.setVcCardNo(patients.getVcCardNo());
93 87 quanPatientsResult.setCardNo(patients.getCardNo());
94 88 quanPatientsResult.setRemark(patients.getMremark());
95 89  
96 90  
97 91  
98 92  
99 93  
... ... @@ -133,64 +127,31 @@
133 127 String screenStr = basicConfigService.getScreenResult(patients.getScreenResult());
134 128 quanPatientsResult.setScreenResult(screenStr);
135 129 quanPatientsResult.setbTime(DateUtil.getyyyy_MM_dd(patients.getBookbuildingDate()));
136   - stopWatch.start("query ant count");
  130 +
  131 +
  132 + //查询当前记录的初诊
137 133 antExChuQuery1.setPid(patients.getPid());
138   - //antExChuQuery1.setParentId(patients.getId());
139   - //增加查询本次产程条数
140 134 antExChuQuery1.setStart(patients.getLastMenses());
141   - List<AntExChuModel> chu = antExService.queryAntExChu(antExChuQuery1.convertToQuery());
142   - //复诊次数
143   - List<AntenatalExaminationModel> ant = null;
144   - if (CollectionUtils.isNotEmpty(chu)) {
145   - for(AntExChuModel a : chu){//唐山滦县导出判断初诊是否是本院
146   - if(StringUtils.isNotEmpty(a.getHospitalId())){
147   - if(a.getHospitalId().equals(hospital)){
148   - quanPatientsResult.setYi("本院");
149   - }else{
150   - quanPatientsResult.setYi("外院");
151   - }
152   - break;
153   - }
  135 + List<AntExChuModel> chu = antExService.queryAntExChu(antExChuQuery1);
  136 +
  137 +
  138 + antExQuery.setStart(patients.getLastMenses());
  139 + antExQuery.setPid(patients.getPid());
  140 + //初诊为空就不用查复诊
  141 + List<AntenatalExaminationModel> ant =null;
  142 + if(CollectionUtils.isNotEmpty(chu)){
  143 + if (chu.get(0).getCheckTime() != null){
  144 + quanPatientsResult.setFirstCheckTime(DateUtil.getyyyy_MM_dd(chu.get(0).getCheckTime()));
154 145 }
155   - ant = antExService.queryAntenatalExamination(antExQuery.convertToQuery());
  146 + ant=antExService.queryAntenatalExamination(antExQuery.convertToQuery().addOrder(Sort.Direction.DESC, "created"));
156 147 }
157   - //唐山滦县判断复诊是否是本院
158   - if(CollectionUtils.isNotEmpty(ant)){
159   - for(int k = 0;k < ant.size();k++){
160   - if(k>=4){
161   - break;
162   - }
163   - if(0==k){
164   - if(ant.get(k) != null && ant.get(k).getHospitalId() != null && ant.get(k).getHospitalId().equals(hospital)){
165   - quanPatientsResult.setEr("本院");
166   - }else{
167   - quanPatientsResult.setEr("外院");
168   - }
169   - }else if(1==k){
170   - if(ant.get(k) != null && ant.get(k).getHospitalId() != null && ant.get(k).getHospitalId().equals(hospital)){
171   - quanPatientsResult.setSan("本院");
172   - }else{
173   - quanPatientsResult.setSan("外院");
174   - }
175   - }else if(2==k){
176   - if(ant.get(k) != null && ant.get(k).getHospitalId() != null && ant.get(k).getHospitalId().equals(hospital)){
177   - quanPatientsResult.setSi("本院");
178   - }else{
179   - quanPatientsResult.setSi("外院");
180   - }
181   - }else if(3==k){
182   - if(ant.get(k) != null && ant.get(k).getHospitalId() != null && ant.get(k).getHospitalId().equals(hospital)){
183   - quanPatientsResult.setWu("本院");
184   - }else{
185   - quanPatientsResult.setWu("外院");
186   - }
187   - }
188   - }
189   - }
190 148  
191 149 //系统复诊次数
192 150 int i = 0;
193 151 if (CollectionUtils.isNotEmpty(ant)) {
  152 + if (ant.get(0).getCheckDate() != null){
  153 + quanPatientsResult.setLastCheckTime(DateUtil.getyyyy_MM_dd(ant.get(0).getCheckDate()));
  154 + }
194 155 //复诊次数
195 156 i = ant.size();
196 157 sort(ant);
197 158  
198 159  
199 160  
200 161  
201 162  
... ... @@ -222,59 +183,18 @@
222 183 }
223 184 }
224 185 }
225   - //统计产检次数
226   - List <String> patientIds = new ArrayList <>();
227   - patientIds.add(patients.getId());
228   - PatientsQuery patientsQuery = new PatientsQuery();
229   - patientsQuery.setSource(patients.getId());
230   - patientsQuery.setBuildType(1);
231   - if (patients.getPliveTypeId()!=null){
232   - BasicConfigQuery basicConfigQuery = new BasicConfigQuery();
233   - basicConfigQuery.setId(patients.getPliveTypeId());
234 186  
235   - //所有数据
236   - List<BasicConfig> basicConfigList = basicConfigService.queryBasicConfig(basicConfigQuery);
237   - patientsQuery.setLiveType(basicConfigList.get(0).getName());
238   - }
239   - List <Patients> patients1 = patientsService.queryPatient(patientsQuery);
240   - if (CollectionUtils.isNotEmpty(patients1)) {
241   - for (Patients ps : patients1) {
242   - patientIds.add(ps.getPid());
243   - }
244   - }
245   - int chuzhen = 0;
246   - int fuzhen = 0;
247   - //初诊记录
248   - AntExChuQuery antExChuQuery = new AntExChuQuery();
249   - antExChuQuery.setYn(YnEnums.YES.getId());
250   - antExChuQuery.setParentIds(patientIds);
251   - List <AntExChuModel> antExChuModels = antExService.queryAntExChu(antExChuQuery);
252   - if (CollectionUtils.isNotEmpty(antExChuModels)) {
253   - chuzhen = antExChuModels.size();
254   - }
255   - //复诊记录
256   - AntExQuery antExQuery1 = new AntExQuery();
257   - antExQuery1.setYn(YnEnums.YES.getId());
258   - antExQuery1.setParentIds(patientIds);
259   - List <AntenatalExaminationModel> list1 = antExService.queryAntenatalExamination(antExQuery1.convertToQuery());
260   - if (CollectionUtils.isNotEmpty(list1)) {
261   - fuzhen = list1.size();
262   - }
263   - quanPatientsResult.setcTimes(chuzhen + fuzhen);
264   -
265   - antExQuery.setHospitalId(hospital);
266   - //本院初诊
  187 + //初诊次数
  188 + int b = CollectionUtils.isEmpty(chu)?0:chu.size();
  189 + //本院的初诊记录
267 190 int chi = countAntChu(chu, hospital);
268   -
269   - //本院复诊
  191 + //本院的复诊记录
270 192 int chb = capLocalHospital(hospital, ant);
  193 +
  194 + quanPatientsResult.setcTimes(i + b);
271 195 quanPatientsResult.setcHTimes(chi + chb);
272   - quanPatientsResult.setrFactor(patientsQuery.getrFactor());
273   - stopWatch.stop();
  196 + //下次时间
274 197 String nextCheckTime = "";
275   - stopWatch.start("query antex list");
276   -
277   -
278 198 if (null != patients.getNextCheckTime()) {
279 199 nextCheckTime = DateUtil.getyyyy_MM_dd(patients.getNextCheckTime());
280 200 }
... ... @@ -292,9 +212,6 @@
292 212 }
293 213 }
294 214  
295   -
296   - stopWatch.stop();
297   - stopWatch.start("query basicconfig");
298 215 //注册地址
299 216 quanPatientsResult.setRegisterAddr(CommonsHelper.getResidence(patients.getProvinceId(), patients.getCityId(), patients.getAreaId(), patients.getStreetId(), patients.getAddress(), basicConfigService));
300 217 quanPatientsResult.setAddr(CommonsHelper.getResidence(patients.getProvinceRegisterId(), patients.getCityRegisterId(), patients.getAreaRegisterId(), patients.getStreetRegisterId(), patients.getAddressRegister(), basicConfigService));
platform-operate-api/src/main/java/com/lyms/platform/operate/web/worker/WorkHR.java View file @ 13d1150
... ... @@ -114,6 +114,7 @@
114 114 antExQuery.setStart(patients.getLastMenses());
115 115 antExQuery.setPid(patients.getPid());
116 116 antExQuery.setYn(YnEnums.YES.getId());
  117 +
117 118 antExChuQuery1.setStart(patients.getLastMenses());
118 119 antExChuQuery1.setPid(patients.getPid());
119 120 antExChuQuery1.setYn(YnEnums.YES.getId());
120 121  
... ... @@ -126,10 +127,16 @@
126 127 stopWatch.start("query antex list");
127 128 ant=antExService.queryAntenatalExamination(antExQuery.convertToQuery().addOrder(Sort.Direction.DESC, "created"));
128 129 stopWatch.stop();
  130 + if (chu.get(0).getCheckTime() != null){
  131 + riskPatientsResult.setFirstCheckTime(DateUtil.getyyyy_MM_dd(chu.get(0).getCheckTime()));
  132 + }
129 133 }
130 134  
131 135 int i = 0;
132 136 if (CollectionUtils.isNotEmpty(ant)) {
  137 + if (ant.get(0).getCheckDate() != null){
  138 + riskPatientsResult.setLastCheckTime(DateUtil.getyyyy_MM_dd(ant.get(0).getCheckDate()));
  139 + }
133 140 //复诊次数
134 141 i = ant.size();
135 142 for (AntenatalExaminationModel a : ant) {