请求波司登获取数据·

master
yechenhao 6 years ago
parent 93b6c5de78
commit b14c17bfb9

@ -43,6 +43,7 @@ import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.ss.util.CellRangeAddress;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
@ -101,6 +102,9 @@ public class StoreEmployeeService {
@Autowired
private CustomerViewService customerViewService;
@Value("${bsd.qrCode}")
private String qrCodeBsdUrl;
/**
*
*
@ -190,7 +194,7 @@ public class StoreEmployeeService {
params.put("type", type);
params.put("state", state);
params.put("storeNo", storeNo);
String message = HttpClientUtil.httpPost("http://10.101.10.24:80/BSD_WXAPP/qyWechat/getShareQRcode?token=" + MD5FileUtil.getMD5String("BOSIDENG" + sdf.format(new Date())), JSONObject.toJSONString(params)).getMessage();
String message = HttpClientUtil.httpPost(qrCodeBsdUrl + MD5FileUtil.getMD5String("BOSIDENG" + sdf.format(new Date())), JSONObject.toJSONString(params)).getMessage();
JSONObject qrCodeJson = JSONObject.parseObject(message);
BsdShareCodeResponse bsdResponse = qrCodeJson.toJavaObject(BsdShareCodeResponse.class);
if (bsdResponse.getSuccess()){

@ -19,6 +19,7 @@ import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.cp.api.WxCpService;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -51,6 +52,10 @@ public class StorePromotionDataService {
@Autowired
private PrivilageDomainService privilageDomainService;
@Value("${bsd.userBehavior}")
private String userBehavior;
/**
* 广
* @param storeId
@ -292,7 +297,7 @@ public class StorePromotionDataService {
params.put("start_time",wxCusInfoReqDO.getStart_time());
params.put("end_time",wxCusInfoReqDO.getEnd_time());
params.put("userid",wxCusInfoReqDO.getUserid());
String result = HttpUtil.get("http://10.101.10.24:80/BSD_WXAPP/qyWechat/getUserBehaviorData?token==BOSIDENG" + MD5FileUtil.getMD5String(sdf.format(new Date())), params);
String result = HttpUtil.get(userBehavior + MD5FileUtil.getMD5String("BOSIDENG"+sdf.format(new Date())), params);
JSONObject parseObject = JSON.parseObject(result);
System.out.println(parseObject);
String[] behavior_data = JSONObject.parseObject(parseObject.getString("behavior_data"), String[].class);

@ -21,12 +21,14 @@ import com.kiisoo.ic.store.mapper.PrivilageCpUserStoreDOMapper;
import com.kiisoo.ic.synchronous.entity.PromotionDO;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.text.SimpleDateFormat;
import java.util.*;
import static com.kiisoo.ic.employee.constant.Constants.DATABASE_CP_USER_ID_KEY;
import static com.kiisoo.ic.store.constant.Constants.BSD_REQ_QRCODE_TYPE_SELLER;
import static com.kiisoo.ic.store.constant.Constants.BSD_REQ_QRCODE_TYPE_STORE;
@Service
@ -50,6 +52,9 @@ public class PromotionCodeService {
return MD5FileUtil.getMD5String(token+date);
}
@Value("${bsd.qrCode}")
private String qrCodeBsdUrl;
/**
*
*/
@ -101,7 +106,7 @@ public class PromotionCodeService {
params.put("type", type);
params.put("state", state);
params.put("storeNo", storeNo);
String message = HttpClientUtil.httpPost("http://10.101.10.24:80/BSD_WXAPP/qyWechat/getShareQRcode?token=" + MD5FileUtil.getMD5String("BOSIDENG" + sdf.format(new Date())), JSONObject.toJSONString(params)).getMessage();
String message = HttpClientUtil.httpPost(qrCodeBsdUrl + MD5FileUtil.getMD5String("BOSIDENG" + sdf.format(new Date())), JSONObject.toJSONString(params)).getMessage();
JSONObject qrCodeJson = JSONObject.parseObject(message);
BsdShareCodeResponse bsdResponse = qrCodeJson.toJavaObject(BsdShareCodeResponse.class);
if (bsdResponse.getSuccess()){
@ -118,23 +123,17 @@ public class PromotionCodeService {
List<PoiStoreStaff> sellers = poiStoreStaffDOMapper.selectList(null);
sellers.forEach(item ->{
if(item.getEpWechatQrCode() == null){
PromotionDO p = new PromotionDO();
p.setUserId(item.getCustomerUserId()+"");
p.setType("1");
p.setState(item.getStaffCode());
//没有推广码则查询
HttpResult data = HttpClientUtil.httpPost("http://10.101.10.24:80/BSD_WXAPP/qyWechat/getShareQRcode?token=TOKEN", JSON.toJSONString(p),getToken());
//http返回参数
if((boolean) JSONObject.parseObject(data.getMessage()).get("success")){
String url = JSONObject.parseObject(data.getMessage()).get("data").toString();
String cpUserId = privilageCpUserStoreDOMapper.selectCpUserIdByStoreId(item.getStoreId());
String url = null;
try {
url = getQrCodeFromBSD(cpUserId, BSD_REQ_QRCODE_TYPE_SELLER, item.getStaffCode(), item.getStoreCode());
} catch (Exception e) {
e.printStackTrace();
}
//没有推广码则查询
item.setEpWechatQrCode(url);
poiStoreStaffDOMapper.updateById(item);
}
}
});
}

@ -17,3 +17,5 @@ spring:
bsd:
vip: http://10.101.10.24:80/BSD_WXAPP/miniProgram/getMemberDtlByUnionId
qrCode: http://10.101.10.24:80/BSD_WXAPP/qyWechat/getShareQRcode?token=
userBehavior: http://10.101.10.24:80/BSD_WXAPP/qyWechat/getUserBehaviorData?token=

Loading…
Cancel
Save