|
@@ -1,6 +1,7 @@
|
|
|
package com.ruixuan.isc.service.impl;
|
|
package com.ruixuan.isc.service.impl;
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
|
+import com.ruixuan.common.core.domain.AjaxResult;
|
|
|
import com.ruixuan.common.core.domain.entity.SysUser;
|
|
import com.ruixuan.common.core.domain.entity.SysUser;
|
|
|
import com.ruixuan.common.utils.Check;
|
|
import com.ruixuan.common.utils.Check;
|
|
|
import com.ruixuan.common.utils.DateUtils;
|
|
import com.ruixuan.common.utils.DateUtils;
|
|
@@ -17,6 +18,7 @@ import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
import java.util.Arrays;
|
|
import java.util.Arrays;
|
|
|
|
|
+import java.util.Date;
|
|
|
import java.util.HashMap;
|
|
import java.util.HashMap;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
@@ -206,4 +208,51 @@ public class KuaishouPromoterServiceImpl implements IKuaishouPromoterService {
|
|
|
return kuaishouPromoterMapper.deleteKuaishouPromoterById(id);
|
|
return kuaishouPromoterMapper.deleteKuaishouPromoterById(id);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public AjaxResult getPromoterInfo(Long id) {
|
|
|
|
|
+ AjaxResult ajaxResult = null;
|
|
|
|
|
+ try {
|
|
|
|
|
+ KuaishouPromoter promoter = kuaishouPromoterMapper.selectKuaishouPromoterById(id);
|
|
|
|
|
+ JSONObject data = new JSONObject();
|
|
|
|
|
+ if (Check.isNotNull(promoter)) {
|
|
|
|
|
+ Thread thread = new Thread() {
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void run() {
|
|
|
|
|
+ try {
|
|
|
|
|
+ editPromoter(promoter.getId(), promoter.getPromoterId());
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ e.printStackTrace();
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ };
|
|
|
|
|
+ thread.start();
|
|
|
|
|
+ Long startTime = System.currentTimeMillis();
|
|
|
|
|
+ String content = HttpUtil.httpGetRequest(internalIpPath + "kuaiShou/promoter/getPromoterVideoInfo?promoterId=" + promoter.getPromoterId());
|
|
|
|
|
+ JSONObject result = JSONObject.parseObject(content);
|
|
|
|
|
+ log.info("获取达人视频销售数据,用时:{}s", (System.currentTimeMillis() - startTime) / 1000);
|
|
|
|
|
+
|
|
|
|
|
+ String start = DateUtils.getSubtractTime(new Date(), 31);
|
|
|
|
|
+ String end = DateUtils.getDate();
|
|
|
|
|
+ JSONObject info = kuaishouPromoterMapper.getNearlyMonthGmv(promoter.getPromoterId(), start, end);
|
|
|
|
|
+
|
|
|
|
|
+ if (Check.isNotNull(info)) {
|
|
|
|
|
+ data.put("orderAmount", info.getString("orderAmount"));
|
|
|
|
|
+ data.put("operationCompletionRate", info.getString("operationCompletionRate"));
|
|
|
|
|
+ }
|
|
|
|
|
+ if (Check.isNotNull(result)) {
|
|
|
|
|
+ data.put("avgVideoSales", result.getString("avgVideoSales"));
|
|
|
|
|
+ data.put("videoSales", result.getString("videoSales"));
|
|
|
|
|
+ }
|
|
|
|
|
+ data.put("promoterId", promoter.getPromoterId());
|
|
|
|
|
+ data.put("promoterUrl", promoter.getPromoterUrl());
|
|
|
|
|
+ }
|
|
|
|
|
+ ajaxResult = new AjaxResult(200, "查询成功", data);
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ e.printStackTrace();
|
|
|
|
|
+ log.error("获取达人详情数据异常");
|
|
|
|
|
+ ajaxResult = new AjaxResult(500, "查询失败");
|
|
|
|
|
+ }
|
|
|
|
|
+ return ajaxResult;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
}
|
|
}
|