Commit 18c33ee3 by manxiaoqiang

adi

parent f677dde1
......@@ -116,8 +116,10 @@ public class ADIAccountServiceImpl implements ADIAccountService {
adiSaleMap.setAccountEmail(account);
adiSaleMap.setSaleEmail(email);
adiSaleMap.setSale(bussinessMan.getId());
adiSaleMap.setArea(bussinessMan.getArea());
adiSaleMap.setModifeTime(new Date());
}else {
adiSaleMap.setArea(bussinessMan.getArea());
adiSaleMap.setSaleEmail(email);
adiSaleMap.setSale(bussinessMan.getId());
}
......@@ -134,6 +136,7 @@ public class ADIAccountServiceImpl implements ADIAccountService {
conditions.put("expriedTime", contract.getEndDate() + " 00:00:00");
conditions.put("constractStartTime",contract.getStartDate() + " 00:00:00");
conditions.put("id", adiUser.getId().toString());
conditions.put("useStatus","1");
String request = HttpClientUtil.doHttpPostRequest(url, "",conditions,"utf-8");
if(!contract.getSale().equals(adiUser.getBussinessMan())){
......@@ -154,13 +157,7 @@ public class ADIAccountServiceImpl implements ADIAccountService {
// conditions.put("keyw","");
String request = HttpClientUtil.doHttpPostRequest(url, "",conditions,"utf-8");
JSONObject rs = new JSONObject(request);
List<Contract> contractList = contractRepository.findByPlatform("adi");
Map<String, Contract> dicContract = new HashMap<>();
if(ValidateUtil.isValid(contractList)){
for(Contract co : contractList){
dicContract.put(co.getEmail(), co);
}
}
List<ADISaleMap> saleMaps = adiSaleMapRepository.findAll();
final Map<String, ADISaleMap> dicSale = Maps.uniqueIndex(saleMaps, new Function<ADISaleMap, String>() {
......@@ -179,15 +176,11 @@ public class ADIAccountServiceImpl implements ADIAccountService {
System.out.println(object);
val = new ObjectMapper().readValue(object, ADIUser.class);
System.out.println(val);
val.setPackageType("试用套餐");
if(dicContract.containsKey(val.getEmail())){
Contract contract = dicContract.get(val.getEmail());
String date = DateUtil.format(val.getExpriedTime(), "yyyy-MM-dd");
if(null != date && contract.getPayMoney() > 0 && contract.getEndDate().compareTo(date) >= 0){
val.setPackageType("正式套餐");
}else{
val.setPackageType("试用套餐");
}
if(val.getOnTrial()){
val.setPackageType("正式套餐");
}else{
val.setPackageType("试用套餐");
}
if(null != dicSale.get(val.getEmail().toString())){
......
......@@ -21,6 +21,15 @@ public class ADISaleMap {
private String saleName;
private Date createTime;
private Date modifeTime;
private String area;
public String getArea() {
return area;
}
public void setArea(String area) {
this.area = area;
}
@Id
@GeneratedValue(strategy= GenerationType.AUTO)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment