Commit 18c33ee3 by manxiaoqiang

adi

parent f677dde1
...@@ -116,8 +116,10 @@ public class ADIAccountServiceImpl implements ADIAccountService { ...@@ -116,8 +116,10 @@ public class ADIAccountServiceImpl implements ADIAccountService {
adiSaleMap.setAccountEmail(account); adiSaleMap.setAccountEmail(account);
adiSaleMap.setSaleEmail(email); adiSaleMap.setSaleEmail(email);
adiSaleMap.setSale(bussinessMan.getId()); adiSaleMap.setSale(bussinessMan.getId());
adiSaleMap.setArea(bussinessMan.getArea());
adiSaleMap.setModifeTime(new Date()); adiSaleMap.setModifeTime(new Date());
}else { }else {
adiSaleMap.setArea(bussinessMan.getArea());
adiSaleMap.setSaleEmail(email); adiSaleMap.setSaleEmail(email);
adiSaleMap.setSale(bussinessMan.getId()); adiSaleMap.setSale(bussinessMan.getId());
} }
...@@ -134,6 +136,7 @@ public class ADIAccountServiceImpl implements ADIAccountService { ...@@ -134,6 +136,7 @@ public class ADIAccountServiceImpl implements ADIAccountService {
conditions.put("expriedTime", contract.getEndDate() + " 00:00:00"); conditions.put("expriedTime", contract.getEndDate() + " 00:00:00");
conditions.put("constractStartTime",contract.getStartDate() + " 00:00:00"); conditions.put("constractStartTime",contract.getStartDate() + " 00:00:00");
conditions.put("id", adiUser.getId().toString()); conditions.put("id", adiUser.getId().toString());
conditions.put("useStatus","1");
String request = HttpClientUtil.doHttpPostRequest(url, "",conditions,"utf-8"); String request = HttpClientUtil.doHttpPostRequest(url, "",conditions,"utf-8");
if(!contract.getSale().equals(adiUser.getBussinessMan())){ if(!contract.getSale().equals(adiUser.getBussinessMan())){
...@@ -154,13 +157,7 @@ public class ADIAccountServiceImpl implements ADIAccountService { ...@@ -154,13 +157,7 @@ public class ADIAccountServiceImpl implements ADIAccountService {
// conditions.put("keyw",""); // conditions.put("keyw","");
String request = HttpClientUtil.doHttpPostRequest(url, "",conditions,"utf-8"); String request = HttpClientUtil.doHttpPostRequest(url, "",conditions,"utf-8");
JSONObject rs = new JSONObject(request); 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(); List<ADISaleMap> saleMaps = adiSaleMapRepository.findAll();
final Map<String, ADISaleMap> dicSale = Maps.uniqueIndex(saleMaps, new Function<ADISaleMap, String>() { final Map<String, ADISaleMap> dicSale = Maps.uniqueIndex(saleMaps, new Function<ADISaleMap, String>() {
...@@ -179,16 +176,12 @@ public class ADIAccountServiceImpl implements ADIAccountService { ...@@ -179,16 +176,12 @@ public class ADIAccountServiceImpl implements ADIAccountService {
System.out.println(object); System.out.println(object);
val = new ObjectMapper().readValue(object, ADIUser.class); val = new ObjectMapper().readValue(object, ADIUser.class);
System.out.println(val); System.out.println(val);
val.setPackageType("试用套餐");
if(dicContract.containsKey(val.getEmail())){ if(val.getOnTrial()){
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("正式套餐"); val.setPackageType("正式套餐");
}else{ }else{
val.setPackageType("试用套餐"); val.setPackageType("试用套餐");
} }
}
if(null != dicSale.get(val.getEmail().toString())){ if(null != dicSale.get(val.getEmail().toString())){
ADISaleMap saleMap = dicSale.get(val.getEmail()); ADISaleMap saleMap = dicSale.get(val.getEmail());
......
...@@ -21,6 +21,15 @@ public class ADISaleMap { ...@@ -21,6 +21,15 @@ public class ADISaleMap {
private String saleName; private String saleName;
private Date createTime; private Date createTime;
private Date modifeTime; private Date modifeTime;
private String area;
public String getArea() {
return area;
}
public void setArea(String area) {
this.area = area;
}
@Id @Id
@GeneratedValue(strategy= GenerationType.AUTO) @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