|
@@ -1,6 +1,7 @@
|
|
|
package com.yonge.cooleshow.biz.dal.service.impl;
|
|
|
|
|
|
|
|
|
+import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
@@ -21,6 +22,12 @@ import com.yonge.cooleshow.biz.dal.entity.PlatformCashAccountRecord;
|
|
|
import com.yonge.cooleshow.biz.dal.entity.SysConfig;
|
|
|
import com.yonge.cooleshow.biz.dal.enums.AccountBizTypeEnum;
|
|
|
import com.yonge.cooleshow.biz.dal.service.PlatformCashAccountRecordService;
|
|
|
+import com.yonge.cooleshow.biz.dal.vo.PlatformCashAccountRecordSummaryVo;
|
|
|
+
|
|
|
+import org.slf4j.Logger;
|
|
|
+import org.slf4j.LoggerFactory;
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
+import org.springframework.transaction.annotation.Transactional;
|
|
|
import com.yonge.cooleshow.biz.dal.service.SysConfigService;
|
|
|
import com.yonge.cooleshow.biz.dal.vo.PlatformCashAccountRecordSummaryVo;
|
|
|
import com.yonge.cooleshow.common.constant.SysConfigConstant;
|
|
@@ -36,7 +43,7 @@ import com.yonge.cooleshow.common.enums.PostStatusEnum;
|
|
|
public class PlatformCashAccountRecordServiceImpl extends ServiceImpl<PlatformCashAccountRecordDao, PlatformCashAccountRecord> implements PlatformCashAccountRecordService {
|
|
|
|
|
|
private final static Logger log = LoggerFactory.getLogger(PlatformCashAccountRecordServiceImpl.class);
|
|
|
-
|
|
|
+
|
|
|
@Autowired
|
|
|
private SysConfigService sysConfigService;
|
|
|
|
|
@@ -58,7 +65,27 @@ public class PlatformCashAccountRecordServiceImpl extends ServiceImpl<PlatformCa
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public boolean updateWaitRecord() {
|
|
|
-
|
|
|
+ //根据不同类型(业务类型:PRACTICE、陪练课 LIVE、直播课 VIDEO、视频课 MUSIC、乐谱)查询超过账期待结算的记录
|
|
|
+
|
|
|
+ //getDao().queryByBizTypeAndPaymentDays(bizType, paymentDays);
|
|
|
+
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public IPage<PlatformCashAccountRecord> queryPage(IPage<PlatformCashAccountRecord> page, PlatformCashAccountRecordSearch query) {
|
|
|
+ return getDao().queryPage(page, query);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public PlatformCashAccountRecordSummaryVo querySummary(PlatformCashAccountRecordSearch query) {
|
|
|
+ return getDao().querySummary(query);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
+ public boolean updateWaitRecord() {
|
|
|
+
|
|
|
List<String> paramNames = new ArrayList<String>();
|
|
|
paramNames.add(SysConfigConstant.MALL_ACCOUNT_PERIOD);
|
|
|
paramNames.add(SysConfigConstant.MUSIC_ACCOUNT_PERIOD);
|
|
@@ -66,11 +93,11 @@ public class PlatformCashAccountRecordServiceImpl extends ServiceImpl<PlatformCa
|
|
|
paramNames.add(SysConfigConstant.VIDEO_ACCOUNT_PERIOD);
|
|
|
paramNames.add(SysConfigConstant.LIVE_ACCOUNT_PERIOD);
|
|
|
//paramNames.add(SysConfigConstant.PRACTICE_ACCOUNT_PERIOD);
|
|
|
-
|
|
|
+
|
|
|
List<SysConfig> sysConfigs = sysConfigService.findByParamName(paramNames);
|
|
|
-
|
|
|
+
|
|
|
Map<String,String> configMap = sysConfigs.stream().collect(Collectors.toMap(SysConfig :: getParamName, SysConfig :: getParamValue));
|
|
|
-
|
|
|
+
|
|
|
List<PlatformCashAccountRecord> list = new ArrayList<PlatformCashAccountRecord>();
|
|
|
//根据不同类型(业务类型:PRACTICE、陪练课 LIVE、直播课 VIDEO、视频课 MUSIC、乐谱)查询超过账期待结算的记录
|
|
|
List<PlatformCashAccountRecord> list1 = getDao().queryByBizTypeAndPaymentDays(AccountBizTypeEnum.MALL_SHARE.getCode(), Integer.parseInt(configMap.get(SysConfigConstant.MALL_ACCOUNT_PERIOD).toString()));
|
|
@@ -95,24 +122,24 @@ public class PlatformCashAccountRecordServiceImpl extends ServiceImpl<PlatformCa
|
|
|
if(list5.size() > 0){
|
|
|
list.addAll(list5);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
if(list.size() > 0){
|
|
|
Date date = new Date();
|
|
|
List<PlatformCashAccountRecord> batchUpdateList = new ArrayList<PlatformCashAccountRecord>();
|
|
|
-
|
|
|
+
|
|
|
for(PlatformCashAccountRecord pcar : list){
|
|
|
//预收改成实收
|
|
|
pcar.setPostStatus(PostStatusEnum.RECORDED);
|
|
|
pcar.setUpdateTime(date);
|
|
|
batchUpdateList.add(pcar);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
if(batchUpdateList.size() > 0){
|
|
|
getDao().batchUpdate(batchUpdateList);
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
return true;
|
|
|
}
|
|
|
|