|
@@ -6,6 +6,7 @@ import cn.hutool.core.date.DatePattern;
|
|
|
import cn.hutool.core.date.LocalDateTimeUtil;
|
|
import cn.hutool.core.date.LocalDateTimeUtil;
|
|
|
import cn.hutool.core.util.NumberUtil;
|
|
import cn.hutool.core.util.NumberUtil;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
import com.alibaba.fastjson.JSON;
|
|
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
@@ -19,6 +20,7 @@ import com.kxs.common.core.util.SysUtils;
|
|
|
import com.kxs.common.security.util.SecurityUtils;
|
|
import com.kxs.common.security.util.SecurityUtils;
|
|
|
import com.kxs.product.api.feign.RemoteKxsProductService;
|
|
import com.kxs.product.api.feign.RemoteKxsProductService;
|
|
|
import com.kxs.product.api.vo.kxsapp.shop.ShopOrderGoodsUserVO;
|
|
import com.kxs.product.api.vo.kxsapp.shop.ShopOrderGoodsUserVO;
|
|
|
|
|
+import com.kxs.system.api.feign.RemoteOldService;
|
|
|
import com.kxs.system.api.model.KxsCampUser;
|
|
import com.kxs.system.api.model.KxsCampUser;
|
|
|
import com.kxs.system.api.vo.admin.CampUserExcelVO;
|
|
import com.kxs.system.api.vo.admin.CampUserExcelVO;
|
|
|
import com.kxs.system.api.vo.kxsapp.camp.CampGetByIdVO;
|
|
import com.kxs.system.api.vo.kxsapp.camp.CampGetByIdVO;
|
|
@@ -42,6 +44,7 @@ import org.springframework.scheduling.annotation.EnableAsync;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.validation.BindingResult;
|
|
import org.springframework.validation.BindingResult;
|
|
|
|
|
|
|
|
|
|
+import javax.json.Json;
|
|
|
import java.math.BigDecimal;
|
|
import java.math.BigDecimal;
|
|
|
import java.util.*;
|
|
import java.util.*;
|
|
|
|
|
|
|
@@ -61,6 +64,8 @@ public class KxsCampServiceImpl extends ServiceImpl<KxsCampMapper, KxsCamp> impl
|
|
|
|
|
|
|
|
private final RemoteKxsProductService remoteKxsProductService;
|
|
private final RemoteKxsProductService remoteKxsProductService;
|
|
|
|
|
|
|
|
|
|
+ private final RemoteOldService remoteOldService;
|
|
|
|
|
+
|
|
|
|
|
|
|
|
private final KxsCampUserService kxsCampUserService;
|
|
private final KxsCampUserService kxsCampUserService;
|
|
|
|
|
|
|
@@ -183,7 +188,7 @@ public class KxsCampServiceImpl extends ServiceImpl<KxsCampMapper, KxsCamp> impl
|
|
|
//初始化奖金池
|
|
//初始化奖金池
|
|
|
BigDecimal totalBonusPool = BigDecimal.ZERO;
|
|
BigDecimal totalBonusPool = BigDecimal.ZERO;
|
|
|
//开机数
|
|
//开机数
|
|
|
- int openNum;
|
|
|
|
|
|
|
+ int openNum = 0;
|
|
|
//下单数
|
|
//下单数
|
|
|
int orderNum = 0;
|
|
int orderNum = 0;
|
|
|
|
|
|
|
@@ -288,13 +293,35 @@ public class KxsCampServiceImpl extends ServiceImpl<KxsCampMapper, KxsCamp> impl
|
|
|
/*
|
|
/*
|
|
|
* 查询活动区间开机数
|
|
* 查询活动区间开机数
|
|
|
*/
|
|
*/
|
|
|
|
|
+ for (Integer userId : campUsersMap.keySet()) {
|
|
|
|
|
+ KxsCampUser kxsCampUser = campUsersMap.get(userId);
|
|
|
|
|
+ HashMap<String, Object> data = new HashMap<>();
|
|
|
|
|
+ data.put("UserId", userId);
|
|
|
|
|
+ data.put("StartTime", LocalDateTimeUtil.format(kxsCamp.getStartTime(), DatePattern.PURE_DATE_PATTERN));
|
|
|
|
|
+ data.put("EndTime", LocalDateTimeUtil.format(kxsCamp.getStartTime(), DatePattern.PURE_DATE_PATTERN));
|
|
|
|
|
+ R resR = remoteOldService.teamOpenTotalData(JSON.toJSONString(data));
|
|
|
|
|
+ if(resR.getStatus() == 1){
|
|
|
|
|
+ if(resR.getData() != null){
|
|
|
|
|
+ JSONObject jsonObject = JSON.parseObject(resR.getData().toString());
|
|
|
|
|
+ int total = jsonObject.getInteger("SelfPosMerchantCount")
|
|
|
|
|
+ + jsonObject.getInteger("TeamPosMerchantCount")
|
|
|
|
|
+ + jsonObject.getInteger("SelfSimMerchantCount")
|
|
|
|
|
+ + jsonObject.getInteger("TeamSimMerchantCount")
|
|
|
|
|
+ + jsonObject.getInteger("SelfMpMerchantCount")
|
|
|
|
|
+ + jsonObject.getInteger("TeamMpMerchantCount");
|
|
|
|
|
+ openNum += total;
|
|
|
|
|
+ kxsCampUser.setTeamOpenNum(kxsCampUser.getTeamOpenNum() + total);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
kxsCamp.setBonusPool(totalBonusPool);
|
|
kxsCamp.setBonusPool(totalBonusPool);
|
|
|
kxsCamp.setOrderNum(orderNum);
|
|
kxsCamp.setOrderNum(orderNum);
|
|
|
|
|
+ kxsCamp.setOpenNum(openNum);
|
|
|
baseMapper.updateById(kxsCamp);
|
|
baseMapper.updateById(kxsCamp);
|
|
|
//刷新参与创客的统计
|
|
//刷新参与创客的统计
|
|
|
kxsCampUserService.updateBatchById(new ArrayList<>(campUsersMap.values()));
|
|
kxsCampUserService.updateBatchById(new ArrayList<>(campUsersMap.values()));
|
|
|
-
|
|
|
|
|
|
|
+ log.info("训练营{}统计结束", kxsCamp.getCampNum());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|