|
@@ -1705,10 +1705,13 @@ public class LibVipServiceServiceImpl extends BaseServiceImpl<LibVipService, Str
|
|
|
endDate = this.getEndDate(vipId, libId);
|
|
|
|
|
|
Merchant merchant = merchantService.getMerchantByLibId(libId);
|
|
|
- if(Objects.isNull(merchant) || merchant.getPosType()!=3){
|
|
|
+ if(Objects.nonNull(merchant) && merchant.getPosType()==3){
|
|
|
+ this.insertCorrectServiceByLibIdAndType(vipId,libId,endDate);
|
|
|
+ }else{
|
|
|
this.insertLibCorrectService(vipId, libId, endDate);
|
|
|
+ this.insertLibService(vipId, libId, endDate);
|
|
|
}
|
|
|
- this.insertLibService(vipId, libId, endDate);
|
|
|
+
|
|
|
} else {
|
|
|
|
|
|
this.insertLibService(vipId, libId, DateUtil.parse_yyyyMMdd("9999-01-01"));
|
|
@@ -1802,6 +1805,31 @@ public class LibVipServiceServiceImpl extends BaseServiceImpl<LibVipService, Str
|
|
|
this.save(libVipService);
|
|
|
}
|
|
|
|
|
|
+ public void insertCorrectServiceByLibIdAndType(String vipId, String libId,Date endDate) {
|
|
|
+ Date now = new Date();
|
|
|
+
|
|
|
+ LibVipService libVipService = libVipServiceDao.findTopByVipIdAndLibIdAndSpeciesAndTypeOrderByCreateTimeDesc(vipId, libId, "S003", "C100");
|
|
|
+ if (libVipService == null) {
|
|
|
+ libVipService = new LibVipService();
|
|
|
+ libVipService.setVipId(vipId);
|
|
|
+ libVipService.setLibId(libId);
|
|
|
+ libVipService.setStartTime(now);
|
|
|
+ libVipService.setEndTime(endDate);
|
|
|
+ libVipService.setStat(1);
|
|
|
+ libVipService.setSpecies("S003");
|
|
|
+ libVipService.setType("C100");
|
|
|
+ libVipService.setCreateTime(now);
|
|
|
+
|
|
|
+ libVipService.setCorrectType(100);
|
|
|
+
|
|
|
+ libVipService.setServiceSort(1);
|
|
|
+ this.save(libVipService);
|
|
|
+ } else {
|
|
|
+ libVipService.setStat(1);
|
|
|
+ this.save(libVipService);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
* 获取馆服务的结束时间
|
|
|
*
|