|
@@ -18,11 +18,14 @@ import com.ssj.bean.sys.fx.domain.Merchant;
|
|
|
import com.ssj.bean.sys.fx.domain.MerchantSign;
|
|
|
import com.ssj.bean.weixin.libmy.domain.LibVip;
|
|
|
import com.ssj.bean.weixin.libmy.domain.TbLibJoin;
|
|
|
+import com.ssj.bean.weixin.libmy.domain.TbLibJoinConsume;
|
|
|
import com.ssj.dao.sys.fx.dao.FxQueryDao;
|
|
|
import com.ssj.dao.sys.fx.dao.MerchantSignDao;
|
|
|
+import com.ssj.framework.basic.utils.DateHelper;
|
|
|
import com.ssj.framework.core.common.service.BaseServiceImpl;
|
|
|
import com.ssj.service.sys.fx.service.MerchantService;
|
|
|
import com.ssj.service.sys.fx.service.MerchantSignService;
|
|
|
+import com.ssj.service.weixin.library.service.ILibJoinConsumeService;
|
|
|
import com.ssj.service.weixin.library.service.ILibJoinService;
|
|
|
import com.ssj.service.weixin.library.service.ILibVipService;
|
|
|
|
|
@@ -45,6 +48,9 @@ public class MerchantSignServiceImpl extends BaseServiceImpl<MerchantSign, Strin
|
|
|
private ILibJoinService libJoinService;
|
|
|
|
|
|
@Autowired
|
|
|
+ private ILibJoinConsumeService libJoinConsumeService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
private ILibVipService libVipService;
|
|
|
|
|
|
@Override
|
|
@@ -81,6 +87,18 @@ public class MerchantSignServiceImpl extends BaseServiceImpl<MerchantSign, Strin
|
|
|
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ //记录加油包记录
|
|
|
+ TbLibJoinConsume consume=new TbLibJoinConsume();
|
|
|
+ consume.setFromLibId(merchant.getLibId());
|
|
|
+ consume.setFromMerchantId(merchant.getId());
|
|
|
+ consume.setLibService(merchantSign.getLibService());
|
|
|
+ consume.setPlatformService(0);
|
|
|
+ consume.setType(2);
|
|
|
+ consume.setRemarks("消费【加油包过期】");
|
|
|
+ consume.setCreateTime(new Date());
|
|
|
+ libJoinConsumeService.save(consume);
|
|
|
+
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
@@ -90,6 +108,7 @@ public class MerchantSignServiceImpl extends BaseServiceImpl<MerchantSign, Strin
|
|
|
//2:处理商户主套餐过期的数据
|
|
|
List<Merchant> merchants=merchantService.findMerchantSignByEndTime();
|
|
|
for (Merchant merchant : merchants) {
|
|
|
+ Integer libService=merchant.getLibService();
|
|
|
try {
|
|
|
List<MerchantSign> signs=this.findMerchantSignByMerchantId(merchant.getId(), 0);
|
|
|
for (MerchantSign merchantSign : signs) {
|
|
@@ -101,15 +120,57 @@ public class MerchantSignServiceImpl extends BaseServiceImpl<MerchantSign, Strin
|
|
|
|
|
|
merchant.setSignTime(null);
|
|
|
merchant.setEndSignTime(null);
|
|
|
+ merchant.setCurSummaryTime(null);
|
|
|
+ merchant.setNextSummaryTime(null);
|
|
|
merchant.setLibService(0);
|
|
|
merchantService.save(merchant);
|
|
|
|
|
|
this.syncMerchantByLibJoin(merchant);
|
|
|
+
|
|
|
+ try {
|
|
|
+ //记录
|
|
|
+ TbLibJoinConsume consume=new TbLibJoinConsume();
|
|
|
+ consume.setFromLibId(merchant.getLibId());
|
|
|
+ consume.setFromMerchantId(merchant.getId());
|
|
|
+ consume.setLibService(libService);
|
|
|
+ consume.setPlatformService(0);
|
|
|
+ consume.setType(2);
|
|
|
+ consume.setRemarks("消费【主套餐过期】");
|
|
|
+ consume.setCreateTime(new Date());
|
|
|
+ libJoinConsumeService.save(consume);
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ //2:处理商户结算的数据
|
|
|
+ List<Merchant> summaryMerchants=merchantService.findMerchantSignBySummaryTime();
|
|
|
+ for (Merchant merchant : summaryMerchants) {
|
|
|
+ try {
|
|
|
+ //记录
|
|
|
+ TbLibJoinConsume consume=new TbLibJoinConsume();
|
|
|
+ consume.setToLibId(merchant.getLibId());
|
|
|
+ consume.setToMerchantId(merchant.getId());
|
|
|
+ consume.setLibService(merchant.getLibService());
|
|
|
+ consume.setPlatformService(0);
|
|
|
+ consume.setType(2);
|
|
|
+ consume.setRemarks("消费【套餐月结算】");
|
|
|
+ consume.setCreateTime(new Date());
|
|
|
+ libJoinConsumeService.save(consume);
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
|
|
|
+ merchant.setCurIsSummary(0);
|
|
|
+ merchant.setCurSummaryTime(new Date());
|
|
|
+ merchant.setNextSummaryTime(DateHelper.getMonthDate(merchant.getCurSummaryTime(),1));
|
|
|
+ merchantService.save(merchant);
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
|
|
|
|
|
@@ -154,6 +215,18 @@ public class MerchantSignServiceImpl extends BaseServiceImpl<MerchantSign, Strin
|
|
|
|
|
|
//同步商户表与机构表
|
|
|
this.syncMerchantByLibJoin(merchant);
|
|
|
+
|
|
|
+ //记录加油包记录
|
|
|
+ TbLibJoinConsume consume=new TbLibJoinConsume();
|
|
|
+ consume.setToLibId(merchant.getLibId());
|
|
|
+ consume.setToMerchantId(merchant.getId());
|
|
|
+ consume.setLibService(merchantSign.getLibService());
|
|
|
+ consume.setPlatformService(0);
|
|
|
+ consume.setType(1);
|
|
|
+ consume.setRemarks("加油包充值");
|
|
|
+ consume.setCreateTime(new Date());
|
|
|
+ libJoinConsumeService.save(consume);
|
|
|
+
|
|
|
}
|
|
|
|
|
|
|