|
@@ -89,6 +89,7 @@ public class MerchantSignServiceImpl extends BaseServiceImpl<MerchantSign, Strin
|
|
merchantSign.setStatus(1);
|
|
merchantSign.setStatus(1);
|
|
merchantSign.setUpdateTime(new Date());
|
|
merchantSign.setUpdateTime(new Date());
|
|
this.save(merchantSign);
|
|
this.save(merchantSign);
|
|
|
|
+
|
|
Merchant merchant = merchantService.getById(merchantSign.getMerchantId());
|
|
Merchant merchant = merchantService.getById(merchantSign.getMerchantId());
|
|
merchant.setLibService(merchant.getLibService()-merchantSign.getLibService());
|
|
merchant.setLibService(merchant.getLibService()-merchantSign.getLibService());
|
|
merchantService.save(merchant);
|
|
merchantService.save(merchant);
|
|
@@ -96,13 +97,6 @@ public class MerchantSignServiceImpl extends BaseServiceImpl<MerchantSign, Strin
|
|
//同步商户表与机构表
|
|
//同步商户表与机构表
|
|
this.syncMerchantByLibJoin(merchant);
|
|
this.syncMerchantByLibJoin(merchant);
|
|
|
|
|
|
- //如果加油包过期后,现有的学生大于商户的套餐人数, 就全部学生停止服务。
|
|
|
|
- if(StringUtils.isNotEmpty(merchant.getLibId())) {
|
|
|
|
- List<LibVip> libVips=libVipService.findByLibId(merchant.getLibId());
|
|
|
|
- if(libVips.size()>merchant.getLibService()) {
|
|
|
|
- //这里需要调用灿哥的代码。
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
//记录加油包记录
|
|
//记录加油包记录
|
|
TbLibJoinConsume consume=new TbLibJoinConsume();
|
|
TbLibJoinConsume consume=new TbLibJoinConsume();
|
|
consume.setFromLibId(merchant.getLibId());
|
|
consume.setFromLibId(merchant.getLibId());
|
|
@@ -149,6 +143,16 @@ public class MerchantSignServiceImpl extends BaseServiceImpl<MerchantSign, Strin
|
|
consume.setRemarks("加油包激活【加油包激活】");
|
|
consume.setRemarks("加油包激活【加油包激活】");
|
|
consume.setCreateTime(new Date());
|
|
consume.setCreateTime(new Date());
|
|
libJoinConsumeService.save(consume);
|
|
libJoinConsumeService.save(consume);
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ //调用openApi接口
|
|
|
|
+ libVipServiceService.openApiServiceCRM(
|
|
|
|
+ 1,
|
|
|
|
+ merchant.getLibId(),
|
|
|
|
+ merchant.getSignType(),
|
|
|
|
+ merchant.getLibService(),
|
|
|
|
+ null);
|
|
|
|
+
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
logger.error("1:处理加油包激活数据,异常:"+e.getMessage());
|
|
logger.error("1:处理加油包激活数据,异常:"+e.getMessage());
|
|
@@ -170,7 +174,7 @@ public class MerchantSignServiceImpl extends BaseServiceImpl<MerchantSign, Strin
|
|
TbLibJoinConsume consume=new TbLibJoinConsume();
|
|
TbLibJoinConsume consume=new TbLibJoinConsume();
|
|
consume.setFromLibId(merchant.getLibId());
|
|
consume.setFromLibId(merchant.getLibId());
|
|
consume.setFromMerchantId(merchant.getId());
|
|
consume.setFromMerchantId(merchant.getId());
|
|
- consume.setLibService(0);
|
|
|
|
|
|
+ consume.setLibService(merchant.getLibService());
|
|
consume.setPlatformService(0);
|
|
consume.setPlatformService(0);
|
|
consume.setType(7);
|
|
consume.setType(7);
|
|
consume.setComputeNum(merchant.getCurIsSummary());
|
|
consume.setComputeNum(merchant.getCurIsSummary());
|
|
@@ -194,24 +198,41 @@ public class MerchantSignServiceImpl extends BaseServiceImpl<MerchantSign, Strin
|
|
//只有在激活期的商户才处理数据。
|
|
//只有在激活期的商户才处理数据。
|
|
if(merchant.getCurIsSummary()==null || merchant.getCurIsSummary()==0) {
|
|
if(merchant.getCurIsSummary()==null || merchant.getCurIsSummary()==0) {
|
|
try {
|
|
try {
|
|
- merchant.setCurIsSummary(0);
|
|
|
|
- merchant.setCurSummaryTime(new Date());
|
|
|
|
- merchant.setNextSummaryTime(DateHelper.getMonthDate(merchant.getCurSummaryTime(),1));
|
|
|
|
- merchantService.save(merchant);
|
|
|
|
-
|
|
|
|
- //记录
|
|
|
|
- TbLibJoinConsume consume=new TbLibJoinConsume();
|
|
|
|
- consume.setFromLibId(merchant.getLibId());
|
|
|
|
- consume.setFromMerchantId(merchant.getId());
|
|
|
|
- consume.setLibService(0);
|
|
|
|
- consume.setPlatformService(0);
|
|
|
|
- consume.setType(8);
|
|
|
|
- consume.setComputeNum(merchant.getCurIsSummary());
|
|
|
|
- consume.setSignType(merchant.getSignType());
|
|
|
|
- consume.setRemarks("激活期失效【服务包失效】");
|
|
|
|
- consume.setCreateTime(new Date());
|
|
|
|
- libJoinConsumeService.save(consume);
|
|
|
|
-
|
|
|
|
|
|
+ //如果当前日期还是小于开始计费日期,再生一条激活的记录
|
|
|
|
+ if(merchant.getComputeTime().getTime()>new Date().getTime()) {
|
|
|
|
+
|
|
|
|
+ merchant.setCurIsSummary(0);
|
|
|
|
+ merchant.setCurSummaryTime(new Date());
|
|
|
|
+ merchant.setNextSummaryTime(DateHelper.getMonthDate(merchant.getCurSummaryTime(),1));
|
|
|
|
+ merchantService.save(merchant);
|
|
|
|
+
|
|
|
|
+ //生成激活期的免费失效记录。
|
|
|
|
+ TbLibJoinConsume consume=new TbLibJoinConsume();
|
|
|
|
+ consume.setFromLibId(merchant.getLibId());
|
|
|
|
+ consume.setFromMerchantId(merchant.getId());
|
|
|
|
+ consume.setLibService(merchant.getLibService());
|
|
|
|
+ consume.setPlatformService(0);
|
|
|
|
+ consume.setType(8);
|
|
|
|
+ consume.setComputeNum(merchant.getCurIsSummary());
|
|
|
|
+ consume.setSignType(merchant.getSignType());
|
|
|
|
+ consume.setRemarks("激活期失效【服务包失效】");
|
|
|
|
+ consume.setCreateTime(new Date());
|
|
|
|
+ libJoinConsumeService.save(consume);
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ consume=new TbLibJoinConsume();
|
|
|
|
+ consume.setFromLibId(merchant.getLibId());
|
|
|
|
+ consume.setFromMerchantId(merchant.getId());
|
|
|
|
+ consume.setLibService(merchant.getLibService());
|
|
|
|
+ consume.setPlatformService(0);
|
|
|
|
+ consume.setType(7);
|
|
|
|
+ consume.setComputeNum(merchant.getCurIsSummary());
|
|
|
|
+ consume.setSignType(merchant.getSignType());
|
|
|
|
+ consume.setRemarks("激活期扣费【服务包扣费】");
|
|
|
|
+ consume.setCreateTime(new Date());
|
|
|
|
+ libJoinConsumeService.save(consume);
|
|
|
|
+ }
|
|
|
|
+
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
logger.error("3:处理商户激活结算日期数据,异常:"+e.getMessage());
|
|
logger.error("3:处理商户激活结算日期数据,异常:"+e.getMessage());
|
|
@@ -230,7 +251,7 @@ public class MerchantSignServiceImpl extends BaseServiceImpl<MerchantSign, Strin
|
|
TbLibJoinConsume consume=new TbLibJoinConsume();
|
|
TbLibJoinConsume consume=new TbLibJoinConsume();
|
|
consume.setFromLibId(merchant.getLibId());
|
|
consume.setFromLibId(merchant.getLibId());
|
|
consume.setFromMerchantId(merchant.getId());
|
|
consume.setFromMerchantId(merchant.getId());
|
|
- consume.setLibService(0);
|
|
|
|
|
|
+ consume.setLibService(merchant.getLibService());
|
|
consume.setPlatformService(0);
|
|
consume.setPlatformService(0);
|
|
consume.setType(8);
|
|
consume.setType(8);
|
|
consume.setComputeNum(merchant.getCurIsSummary());
|
|
consume.setComputeNum(merchant.getCurIsSummary());
|
|
@@ -284,7 +305,7 @@ public class MerchantSignServiceImpl extends BaseServiceImpl<MerchantSign, Strin
|
|
TbLibJoinConsume consume=new TbLibJoinConsume();
|
|
TbLibJoinConsume consume=new TbLibJoinConsume();
|
|
consume.setFromLibId(merchant.getLibId());
|
|
consume.setFromLibId(merchant.getLibId());
|
|
consume.setFromMerchantId(merchant.getId());
|
|
consume.setFromMerchantId(merchant.getId());
|
|
- consume.setLibService(0);
|
|
|
|
|
|
+ consume.setLibService(merchant.getLibService());
|
|
consume.setSignType(merchant.getSignType());
|
|
consume.setSignType(merchant.getSignType());
|
|
consume.setPlatformService(0);
|
|
consume.setPlatformService(0);
|
|
consume.setType(8);
|
|
consume.setType(8);
|
|
@@ -330,7 +351,7 @@ public class MerchantSignServiceImpl extends BaseServiceImpl<MerchantSign, Strin
|
|
consume=new TbLibJoinConsume();
|
|
consume=new TbLibJoinConsume();
|
|
consume.setFromLibId(merchant.getLibId());
|
|
consume.setFromLibId(merchant.getLibId());
|
|
consume.setFromMerchantId(merchant.getId());
|
|
consume.setFromMerchantId(merchant.getId());
|
|
- consume.setLibService(0);
|
|
|
|
|
|
+ consume.setLibService(merchant.getLibService());
|
|
consume.setPlatformService(0);
|
|
consume.setPlatformService(0);
|
|
consume.setType(7);
|
|
consume.setType(7);
|
|
consume.setComputeNum(merchant.getCurIsSummary());
|
|
consume.setComputeNum(merchant.getCurIsSummary());
|