Commit 2afdc18ce2230f152f540f51fd1fe460f02b35a6

Authored by liquanyu
1 parent 35083ae5e1

优惠券发放机构修改

Showing 6 changed files with 30 additions and 7 deletions

platform-biz-service/src/main/java/com/lyms/platform/permission/dao/master/CouponMapper.java View file @ 2afdc18
... ... @@ -169,5 +169,8 @@
169 169 List<Map> bookbuildingCoupon(BookbuildingCouponQuery query);
170 170  
171 171 int bookbuildingCouponCount(BookbuildingCouponQuery query);
  172 +
  173 + String getCouponHospital(String userId);
  174 +
172 175 }
platform-biz-service/src/main/java/com/lyms/platform/permission/service/CouponService.java View file @ 2afdc18
... ... @@ -71,5 +71,6 @@
71 71 int getUserCouponCanUseCount(String userId);
72 72  
73 73 BaseObjectResponse use1(String hospitalId, String code, String userId, String usedId);
  74 + String getCouponHospital(String userId);
74 75 }
platform-biz-service/src/main/java/com/lyms/platform/permission/service/impl/CouponServiceImpl.java View file @ 2afdc18
... ... @@ -668,6 +668,12 @@
668 668 }
669 669  
670 670 @Override
  671 + public String getCouponHospital(String userId) {
  672 +
  673 + return couponMapper.getCouponHospital(userId);
  674 + }
  675 +
  676 + @Override
671 677 public int updateCouponStatus(Map<String, String> param) {
672 678 return couponMapper.updateCouponStatus(param);
673 679 }
platform-biz-service/src/main/resources/mainOrm/master/CouponMapper.xml View file @ 2afdc18
... ... @@ -1493,5 +1493,11 @@
1493 1493 </where>
1494 1494 </sql>
1495 1495  
  1496 + <select id="getCouponHospital" parameterType="string" resultType="string">
  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}
  1499 + and c.create_date >= DATE_SUB(NOW(), interval 10 MONTH)
  1500 + </select>
  1501 +
1496 1502 </mapper>
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientFacade.java View file @ 2afdc18
... ... @@ -1704,7 +1704,7 @@
1704 1704 if (end > patientses.size()) {
1705 1705 end = patientses.size();
1706 1706 }
1707   - listFuture.add(commonThreadPool.submit(new QuanPatientWorker(patientses.subList(i, end), usersService, hospital, antExService, basicConfigService, patientsService, organizationService)));
  1707 + listFuture.add(commonThreadPool.submit(new QuanPatientWorker(patientses.subList(i, end), usersService, hospital, antExService, basicConfigService, patientsService, organizationService,couponService)));
1708 1708 }
1709 1709 for (Future f : listFuture) {
1710 1710 try {
platform-operate-api/src/main/java/com/lyms/platform/operate/web/worker/QuanPatientWorker.java View file @ 2afdc18
... ... @@ -15,6 +15,7 @@
15 15 import com.lyms.platform.operate.web.utils.CommonsHelper;
16 16 import com.lyms.platform.permission.model.Organization;
17 17 import com.lyms.platform.permission.model.Users;
  18 +import com.lyms.platform.permission.service.CouponService;
18 19 import com.lyms.platform.permission.service.OrganizationService;
19 20 import com.lyms.platform.permission.service.UsersService;
20 21 import com.lyms.platform.pojo.AntExChuModel;
21 22  
... ... @@ -50,12 +51,14 @@
50 51 private BasicConfigService basicConfigService;
51 52 private PatientsService patientsService;
52 53 private OrganizationService organizationService;
  54 + private CouponService couponService;
53 55  
54 56 public QuanPatientWorker(List<Patients> patientses,
55 57 UsersService usersService,
56 58 String hospital,
57 59 AntenatalExaminationService antExService,
58   - BasicConfigService basicConfigService, PatientsService patientsService, OrganizationService organizationService) {
  60 + BasicConfigService basicConfigService, PatientsService patientsService,
  61 + OrganizationService organizationService,CouponService couponService) {
59 62 this.patientses = patientses;
60 63 this.usersService = usersService;
61 64 this.antExService = antExService;
... ... @@ -63,6 +66,7 @@
63 66 this.basicConfigService = basicConfigService;
64 67 this.patientsService = patientsService;
65 68 this.organizationService = organizationService;
  69 + this.couponService = couponService;
66 70 }
67 71  
68 72 @Override
69 73  
... ... @@ -295,12 +299,15 @@
295 299 quanPatientsResult.setRegisterAddr(CommonsHelper.getResidence(patients.getProvinceId(), patients.getCityId(), patients.getAreaId(), patients.getStreetId(), patients.getAddress(), basicConfigService));
296 300 quanPatientsResult.setAddr(CommonsHelper.getResidence(patients.getProvinceRegisterId(), patients.getCityRegisterId(), patients.getAreaRegisterId(), patients.getStreetRegisterId(), patients.getAddressRegister(), basicConfigService));
297 301 try {
298   - String hname = organizationService.getOrganization(Integer.valueOf(patients.getHospitalId())).getName();
299   - if ((hname.contains("医院")) || (hname.contains("秦皇岛市妇幼保健院"))) {/* if (!(hname.contains("卫生服务站") || hname.contains("卫生服务中心") || hname.contains("卫生院"))) {*/
300   - quanPatientsResult.setFirstBH(hname);
301   - } else {
302   - quanPatientsResult.setCouponCommunity(hname);
  302 + if (CollectionUtils.isNotEmpty(chu))
  303 + {
  304 + AntExChuModel antExChuModel = chu.get(0);
  305 + Organization org = organizationService.getOrganization(Integer.parseInt( antExChuModel.getHospitalId()));
  306 + quanPatientsResult.setFirstBH(org.getName());
303 307 }
  308 + //优惠券发放医院
  309 + String coupHospital = couponService.getCouponHospital(patients.getPid());
  310 + quanPatientsResult.setCouponCommunity(coupHospital);
304 311 } catch (Exception e) {
305 312 quanPatientsResult.setFirstBH("");
306 313 quanPatientsResult.setCouponCommunity("");