From 2afdc18ce2230f152f540f51fd1fe460f02b35a6 Mon Sep 17 00:00:00 2001 From: liquanyu Date: Sat, 27 May 2023 18:25:11 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E6=83=A0=E5=88=B8=E5=8F=91=E6=94=BE?= =?UTF-8?q?=E6=9C=BA=E6=9E=84=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../platform/permission/dao/master/CouponMapper.java | 3 +++ .../platform/permission/service/CouponService.java | 1 + .../permission/service/impl/CouponServiceImpl.java | 6 ++++++ .../main/resources/mainOrm/master/CouponMapper.xml | 6 ++++++ .../platform/operate/web/facade/PatientFacade.java | 2 +- .../operate/web/worker/QuanPatientWorker.java | 19 +++++++++++++------ 6 files changed, 30 insertions(+), 7 deletions(-) diff --git a/platform-biz-service/src/main/java/com/lyms/platform/permission/dao/master/CouponMapper.java b/platform-biz-service/src/main/java/com/lyms/platform/permission/dao/master/CouponMapper.java index a0a1615..129eece 100644 --- a/platform-biz-service/src/main/java/com/lyms/platform/permission/dao/master/CouponMapper.java +++ b/platform-biz-service/src/main/java/com/lyms/platform/permission/dao/master/CouponMapper.java @@ -169,4 +169,7 @@ public interface CouponMapper { List bookbuildingCoupon(BookbuildingCouponQuery query); int bookbuildingCouponCount(BookbuildingCouponQuery query); + + String getCouponHospital(String userId); + } diff --git a/platform-biz-service/src/main/java/com/lyms/platform/permission/service/CouponService.java b/platform-biz-service/src/main/java/com/lyms/platform/permission/service/CouponService.java index 623ff0f..eac5378 100644 --- a/platform-biz-service/src/main/java/com/lyms/platform/permission/service/CouponService.java +++ b/platform-biz-service/src/main/java/com/lyms/platform/permission/service/CouponService.java @@ -71,4 +71,5 @@ public interface CouponService{ int getUserCouponCanUseCount(String userId); BaseObjectResponse use1(String hospitalId, String code, String userId, String usedId); + String getCouponHospital(String userId); } diff --git a/platform-biz-service/src/main/java/com/lyms/platform/permission/service/impl/CouponServiceImpl.java b/platform-biz-service/src/main/java/com/lyms/platform/permission/service/impl/CouponServiceImpl.java index 30dc8fd..75902a1 100644 --- a/platform-biz-service/src/main/java/com/lyms/platform/permission/service/impl/CouponServiceImpl.java +++ b/platform-biz-service/src/main/java/com/lyms/platform/permission/service/impl/CouponServiceImpl.java @@ -668,6 +668,12 @@ public class CouponServiceImpl implements CouponService { } @Override + public String getCouponHospital(String userId) { + + return couponMapper.getCouponHospital(userId); + } + + @Override public int updateCouponStatus(Map param) { return couponMapper.updateCouponStatus(param); } diff --git a/platform-biz-service/src/main/resources/mainOrm/master/CouponMapper.xml b/platform-biz-service/src/main/resources/mainOrm/master/CouponMapper.xml index 156f426..610f6b5 100644 --- a/platform-biz-service/src/main/resources/mainOrm/master/CouponMapper.xml +++ b/platform-biz-service/src/main/resources/mainOrm/master/CouponMapper.xml @@ -1493,4 +1493,10 @@ + + \ No newline at end of file diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientFacade.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientFacade.java index 9025f4e..ce58a83 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientFacade.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientFacade.java @@ -1704,7 +1704,7 @@ public class PatientFacade extends BaseServiceImpl { if (end > patientses.size()) { end = patientses.size(); } - listFuture.add(commonThreadPool.submit(new QuanPatientWorker(patientses.subList(i, end), usersService, hospital, antExService, basicConfigService, patientsService, organizationService))); + listFuture.add(commonThreadPool.submit(new QuanPatientWorker(patientses.subList(i, end), usersService, hospital, antExService, basicConfigService, patientsService, organizationService,couponService))); } for (Future f : listFuture) { try { diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/worker/QuanPatientWorker.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/worker/QuanPatientWorker.java index 4b2dfab..9cfa3fa 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/worker/QuanPatientWorker.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/worker/QuanPatientWorker.java @@ -15,6 +15,7 @@ import com.lyms.platform.operate.web.result.QuanPatientsResult; import com.lyms.platform.operate.web.utils.CommonsHelper; import com.lyms.platform.permission.model.Organization; import com.lyms.platform.permission.model.Users; +import com.lyms.platform.permission.service.CouponService; import com.lyms.platform.permission.service.OrganizationService; import com.lyms.platform.permission.service.UsersService; import com.lyms.platform.pojo.AntExChuModel; @@ -50,12 +51,14 @@ public class QuanPatientWorker implements Callable> { private BasicConfigService basicConfigService; private PatientsService patientsService; private OrganizationService organizationService; + private CouponService couponService; public QuanPatientWorker(List patientses, UsersService usersService, String hospital, AntenatalExaminationService antExService, - BasicConfigService basicConfigService, PatientsService patientsService, OrganizationService organizationService) { + BasicConfigService basicConfigService, PatientsService patientsService, + OrganizationService organizationService,CouponService couponService) { this.patientses = patientses; this.usersService = usersService; this.antExService = antExService; @@ -63,6 +66,7 @@ public class QuanPatientWorker implements Callable> { this.basicConfigService = basicConfigService; this.patientsService = patientsService; this.organizationService = organizationService; + this.couponService = couponService; } @Override @@ -295,12 +299,15 @@ public class QuanPatientWorker implements Callable> { quanPatientsResult.setRegisterAddr(CommonsHelper.getResidence(patients.getProvinceId(), patients.getCityId(), patients.getAreaId(), patients.getStreetId(), patients.getAddress(), basicConfigService)); quanPatientsResult.setAddr(CommonsHelper.getResidence(patients.getProvinceRegisterId(), patients.getCityRegisterId(), patients.getAreaRegisterId(), patients.getStreetRegisterId(), patients.getAddressRegister(), basicConfigService)); try { - String hname = organizationService.getOrganization(Integer.valueOf(patients.getHospitalId())).getName(); - if ((hname.contains("医院")) || (hname.contains("秦皇岛市妇幼保健院"))) {/* if (!(hname.contains("卫生服务站") || hname.contains("卫生服务中心") || hname.contains("卫生院"))) {*/ - quanPatientsResult.setFirstBH(hname); - } else { - quanPatientsResult.setCouponCommunity(hname); + if (CollectionUtils.isNotEmpty(chu)) + { + AntExChuModel antExChuModel = chu.get(0); + Organization org = organizationService.getOrganization(Integer.parseInt( antExChuModel.getHospitalId())); + quanPatientsResult.setFirstBH(org.getName()); } + //优惠券发放医院 + String coupHospital = couponService.getCouponHospital(patients.getPid()); + quanPatientsResult.setCouponCommunity(coupHospital); } catch (Exception e) { quanPatientsResult.setFirstBH(""); quanPatientsResult.setCouponCommunity(""); -- 1.8.3.1