|
@@ -121,8 +121,10 @@ public class MerchantSignServiceImpl extends BaseServiceImpl<MerchantSign, Strin
|
|
|
merchant.getMealType(),
|
|
|
merchant.getLibService(),
|
|
|
merchant.getStartActiveTime()!=null ? format.format(merchant.getStartActiveTime()) : "",
|
|
|
- merchant.getComputeTime()!=null ? format.format(merchant.getComputeTime()) : "",
|
|
|
- merchant.getComputeTime()!=null ? format.format(DateHelper.getMonthDate(merchant.getComputeTime(),merchant.getLibServiceMonth())) : "" );
|
|
|
+ merchant.getComputeTime()!=null ? format.format(merchant.getComputeTime()) : format.format(merchant.getActiveTime()),
|
|
|
+ merchant.getComputeTime()!=null ?
|
|
|
+ format.format(DateHelper.getMonthDate(merchant.getComputeTime(),merchant.getLibServiceMonth())) :
|
|
|
+ format.format(DateHelper.getMonthDate(merchant.getActiveTime(),merchant.getLibServiceMonth())));
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
logger.error("1:处理加油包过期数据,异常:"+e.getMessage());
|
|
@@ -150,7 +152,11 @@ public class MerchantSignServiceImpl extends BaseServiceImpl<MerchantSign, Strin
|
|
|
consume.setType(10);
|
|
|
consume.setComputeNum(merchantSign.getNum());
|
|
|
consume.setSignType(merchant.getSignType());
|
|
|
- consume.setRemarks("加油包激活【加油包激活】");
|
|
|
+ if(merchantSign.getSignType().equals(4)) {
|
|
|
+ consume.setRemarks("加油包开通【新模式月包】");
|
|
|
+ }else {
|
|
|
+ consume.setRemarks("加油包开通【新模式量包】");
|
|
|
+ }
|
|
|
consume.setCreateTime(new Date());
|
|
|
libJoinConsumeService.save(consume);
|
|
|
|
|
@@ -163,8 +169,11 @@ public class MerchantSignServiceImpl extends BaseServiceImpl<MerchantSign, Strin
|
|
|
merchant.getMealType(),
|
|
|
merchant.getLibService(),
|
|
|
merchant.getStartActiveTime()!=null ? format.format(merchant.getStartActiveTime()) : "",
|
|
|
- merchant.getComputeTime()!=null ? format.format(merchant.getComputeTime()) : "",
|
|
|
- merchant.getComputeTime()!=null ? format.format(DateHelper.getMonthDate(merchant.getComputeTime(),merchant.getLibServiceMonth())) : "" );
|
|
|
+ merchant.getComputeTime()!=null ? format.format(merchant.getComputeTime()) : format.format(merchant.getActiveTime()),
|
|
|
+ merchant.getComputeTime()!=null ?
|
|
|
+ format.format(DateHelper.getMonthDate(merchant.getComputeTime(),merchant.getLibServiceMonth())) :
|
|
|
+ format.format(DateHelper.getMonthDate(merchant.getActiveTime(),merchant.getLibServiceMonth()))
|
|
|
+ );
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
@@ -178,6 +187,11 @@ public class MerchantSignServiceImpl extends BaseServiceImpl<MerchantSign, Strin
|
|
|
List<Merchant> activeMerchants=merchantService.findMerchantSignByActiveTime();
|
|
|
for (Merchant merchant : activeMerchants) {
|
|
|
try {
|
|
|
+ //如果开始计费时间为null,就不处理
|
|
|
+ if(merchant.getComputeTime()==null) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
merchant.setCurIsSummary(0);
|
|
|
merchant.setCurSummaryTime(new Date());
|
|
|
merchant.setNextSummaryTime(DateHelper.getMonthDate(merchant.getCurSummaryTime(),1));
|
|
@@ -203,11 +217,50 @@ public class MerchantSignServiceImpl extends BaseServiceImpl<MerchantSign, Strin
|
|
|
}
|
|
|
|
|
|
|
|
|
- //3:处理激活日期的下一结算日数据,再生成一条0的结算数据,CurIsSummary=0的,设置下一个结算时间。
|
|
|
+
|
|
|
+ //3:处理激活日期的数据,设置下一个结算日,CurIsSummary=1
|
|
|
+ //注:如果在激活日期之前的时间,设置下一个结算日,CurIsSummary=1
|
|
|
+ for (Merchant merchant : activeMerchants) {
|
|
|
+ try {
|
|
|
+
|
|
|
+ if(merchant.getComputeTime()==null) {
|
|
|
+ merchant.setCurIsSummary(1);
|
|
|
+ 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(7);
|
|
|
+ consume.setComputeNum(merchant.getCurIsSummary());
|
|
|
+ consume.setSignType(merchant.getSignType());
|
|
|
+ consume.setRemarks("激活期扣费【服务包扣费】");
|
|
|
+ consume.setCreateTime(new Date());
|
|
|
+ libJoinConsumeService.save(consume);
|
|
|
+ }
|
|
|
+
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ logger.error("3:处理商户系统激活日期数据,异常:"+e.getMessage());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ //4:处理激活日期的下一结算日数据,再生成一条0的结算数据,CurIsSummary=0的,设置下一个结算时间。
|
|
|
//注:设置当前的时间
|
|
|
List<Merchant> activeEndMerchants=merchantService.findMerchantSignBySummaryTime();
|
|
|
for (Merchant merchant : activeEndMerchants) {
|
|
|
|
|
|
+ //如果开始计费时间为null,就不处理
|
|
|
+ if(merchant.getComputeTime()==null) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
//只有在激活期的商户才处理数据。
|
|
|
if(merchant.getCurIsSummary()==null || merchant.getCurIsSummary()==0) {
|
|
|
try {
|
|
@@ -248,17 +301,21 @@ public class MerchantSignServiceImpl extends BaseServiceImpl<MerchantSign, Strin
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
- logger.error("3:处理商户激活结算日期数据,异常:"+e.getMessage());
|
|
|
+ logger.error("4:处理商户激活结算日期数据,异常:"+e.getMessage());
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
- //4:处理开始计费日期,生成一条真实的数据30,设置当前的时间, 设置下一个结算日,CurIsSummary=+1,真实开始结算。
|
|
|
+ //5:处理开始计费日期,生成一条真实的数据30,设置当前的时间, 设置下一个结算日,CurIsSummary=+1,真实开始结算。
|
|
|
List<Merchant> computeMerchants=merchantService.findMerchantSignByComputeTime();
|
|
|
for (Merchant merchant : computeMerchants) {
|
|
|
try {
|
|
|
+ //如果开始计费时间为null,就不处理
|
|
|
+ if(merchant.getComputeTime()==null) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
|
|
|
//记录激活期的结算
|
|
|
TbLibJoinConsume consume=new TbLibJoinConsume();
|
|
@@ -294,13 +351,13 @@ public class MerchantSignServiceImpl extends BaseServiceImpl<MerchantSign, Strin
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
- logger.error("2:处理商户系统激活日期数据,异常:"+e.getMessage());
|
|
|
+ logger.error("5:处理商户系统激活日期数据,异常:"+e.getMessage());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
- //5:处理商户结算的数据
|
|
|
+ //6:处理商户结算的数据
|
|
|
List<Merchant> summaryMerchants=merchantService.findMerchantSignBySummaryTime();
|
|
|
for (Merchant merchant : summaryMerchants) {
|
|
|
try {
|
|
@@ -377,7 +434,7 @@ public class MerchantSignServiceImpl extends BaseServiceImpl<MerchantSign, Strin
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
- logger.error("2:处理商户结算的数据,异常:"+e.getMessage());
|
|
|
+ logger.error("6:处理商户结算的数据,异常:"+e.getMessage());
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -398,13 +455,13 @@ public class MerchantSignServiceImpl extends BaseServiceImpl<MerchantSign, Strin
|
|
|
|
|
|
//开始计费时间是否大等于今天。
|
|
|
boolean isGTDay=false;
|
|
|
- Date computeTime=merchant.getComputeTime();
|
|
|
+ Date computeTime=merchant.getComputeTime()!=null ? merchant.getComputeTime(): merchant.getActiveTime();
|
|
|
if(computeTime.getTime()<=new Date().getTime()) {
|
|
|
computeTime=new Date();
|
|
|
isGTDay=true;
|
|
|
}
|
|
|
|
|
|
- String remarks="加油包开通【新模式】";
|
|
|
+ String remarks="加油包开通【新模式月包】";
|
|
|
Calendar cal = Calendar.getInstance();
|
|
|
cal.setTime(computeTime);
|
|
|
switch (signType) {
|
|
@@ -491,7 +548,7 @@ public class MerchantSignServiceImpl extends BaseServiceImpl<MerchantSign, Strin
|
|
|
break;
|
|
|
}
|
|
|
|
|
|
- if(merchant.getComputeTime().getTime()<=new Date().getTime()) {
|
|
|
+ if(computeTime.getTime()<=new Date().getTime()) {
|
|
|
TbLibJoinConsume consume=null;
|
|
|
switch (signType) {
|
|
|
case 4:
|
|
@@ -544,8 +601,11 @@ public class MerchantSignServiceImpl extends BaseServiceImpl<MerchantSign, Strin
|
|
|
merchant.getMealType(),
|
|
|
merchant.getLibService(),
|
|
|
merchant.getStartActiveTime()!=null ? format.format(merchant.getStartActiveTime()) : "",
|
|
|
- merchant.getComputeTime()!=null ? format.format(merchant.getComputeTime()) : "",
|
|
|
- merchant.getComputeTime()!=null ? format.format(DateHelper.getMonthDate(merchant.getComputeTime(),merchant.getLibServiceMonth())) : "" );
|
|
|
+ merchant.getComputeTime()!=null ? format.format(merchant.getComputeTime()) : format.format(merchant.getActiveTime()),
|
|
|
+ merchant.getComputeTime()!=null ?
|
|
|
+ format.format(DateHelper.getMonthDate(merchant.getComputeTime(),merchant.getLibServiceMonth())) :
|
|
|
+ format.format(DateHelper.getMonthDate(merchant.getActiveTime(),merchant.getLibServiceMonth()))
|
|
|
+ );
|
|
|
}
|
|
|
}
|
|
|
|