Commit f8b78a2f by kangxiaoshan

dmp套餐

parent dd0aa026
...@@ -4,6 +4,7 @@ package adi.controller; ...@@ -4,6 +4,7 @@ package adi.controller;
import adi.model.ADIUser; import adi.model.ADIUser;
import adi.service.ADIAccountService; import adi.service.ADIAccountService;
import common.model.*; import common.model.*;
import common.service.AccountService;
import dic.OperateObjectTypeEnum; import dic.OperateObjectTypeEnum;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
...@@ -15,6 +16,8 @@ import util.ResultStatus; ...@@ -15,6 +16,8 @@ import util.ResultStatus;
import util.UserLogThread; import util.UserLogThread;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.Map;
/** /**
* Created by mxq on 2017/12/21. * Created by mxq on 2017/12/21.
...@@ -25,6 +28,9 @@ public class ADIAccountController { ...@@ -25,6 +28,9 @@ public class ADIAccountController {
@Autowired @Autowired
ADIAccountService tkioAccountService; ADIAccountService tkioAccountService;
@Autowired
AccountService accountService;
//sale //sale
@RequestMapping(value = "/findSale", method = RequestMethod.GET) @RequestMapping(value = "/findSale", method = RequestMethod.GET)
@ResponseBody @ResponseBody
...@@ -61,11 +67,11 @@ public class ADIAccountController { ...@@ -61,11 +67,11 @@ public class ADIAccountController {
@RequestMapping(value = "/findone", method = RequestMethod.GET) @RequestMapping(value = "/findone", method = RequestMethod.GET)
@ResponseBody @ResponseBody
public ResultModel findOne(@CurrentAccount User loginAccount, @RequestParam String email) { public ResultModel findOne(@CurrentAccount User loginAccount, @RequestParam String email) {
ADIUser account4Web = tkioAccountService.findOne(email); // ADIUser account4Web = tkioAccountService.findOne(email);
if(null == account4Web){ // if(null == account4Web){
return ResultModel.ERROR(ResultStatus.USER_EMPTY); // return ResultModel.ERROR(ResultStatus.USER_EMPTY);
} // }
return ResultModel.OK(account4Web); return ResultModel.OK(accountService.findOne("adi",email));
} }
@RequestMapping(value = "/find/reminderlevel", method = RequestMethod.GET) @RequestMapping(value = "/find/reminderlevel", method = RequestMethod.GET)
@ResponseBody @ResponseBody
...@@ -133,4 +139,23 @@ public class ADIAccountController { ...@@ -133,4 +139,23 @@ public class ADIAccountController {
return ResultModel.OK(tkioAccountService.findContractChange(email,startDate,endDate)); return ResultModel.OK(tkioAccountService.findContractChange(email,startDate,endDate));
} }
@RequestMapping(value = "/find/function/{accountId}", method = RequestMethod.GET)
@ResponseBody
public ResultModel findFunction(@CurrentAccount User loginAccount, @RequestParam String startDate,
@RequestParam String endDate, @PathVariable Long accountId) {
//返回默认数据
Map result = new HashMap();
result.put("numAccount", 0);
result.put("numApp", 0);
result.put("numCampaign", 0);
result.put("numChannel", 0);
result.put("event_sum", 0);
result.put("click_sum", 0);
return ResultModel.OK(result);
}
} }
...@@ -70,9 +70,6 @@ public class Contract { ...@@ -70,9 +70,6 @@ public class Contract {
private String erroMessage; private String erroMessage;
@Id @Id
@GeneratedValue @GeneratedValue
public Long getId() { public Long getId() {
......
...@@ -76,4 +76,7 @@ public interface ContractRepository extends JpaRepository<Contract, Long> { ...@@ -76,4 +76,7 @@ public interface ContractRepository extends JpaRepository<Contract, Long> {
@Query(value = "select * from contract where id = ?1 union all select * from contract where id = ?2",nativeQuery = true) @Query(value = "select * from contract where id = ?1 union all select * from contract where id = ?2",nativeQuery = true)
List<Contract> findByTwoIds(Long relationContract, Long relationContract1); List<Contract> findByTwoIds(Long relationContract, Long relationContract1);
@Query(value="SELECT * from contract where platform =?1 and email = ?2 and (status <> 'end' or status <> 'cancel')",nativeQuery=true)
List<Contract> findByPlatformAndEmailStatus(String platgorm, String email, int status);
} }
package common.service;
import common.model.Account4Web;
public interface AccountService {
Account4Web findOne(String dmp, String email);
}
package common.service.impl;
import common.model.Account4Web;
import common.model.Contract;
import common.model.PackageBase;
import common.repository.ContractRepository;
import common.repository.PackageBaseRepository;
import common.service.AccountService;
import office.model.BussinessMan;
import office.repository.BussinessManRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class AccountServiceImpl implements AccountService {
@Autowired
ContractRepository contractRepository;
@Autowired
BussinessManRepository bussinessManRepository;
@Autowired
PackageBaseRepository packageBaseRepository;
@Override
public Account4Web findOne(String platgorm, String email) {
List<Contract> contract = contractRepository.findByPlatformAndEmailStatus(platgorm, email, 1);
Account4Web account4Web = new Account4Web();
Contract thecontract = contract.get(0);
PackageBase packageBase = packageBaseRepository.findOne(thecontract.getPriceLevel());
account4Web.setPackageType(packageBase.getPackageName());
BussinessMan bussinessMan = bussinessManRepository.findOne(thecontract.getSale());
account4Web.setSaleName(bussinessMan.getName());
return account4Web;
}
}
package dmp.controller;
import common.model.Account4Web;
import common.model.User;
import common.service.AccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import security.annotation.CurrentAccount;
import util.ResultModel;
import util.ResultStatus;
import java.util.HashMap;
import java.util.Map;
@Controller
@RequestMapping("dmp/marketing/accountmng")
public class DmpAccountController {
@Autowired
AccountService accountService;
//功能使用查询
@RequestMapping(value = "/find/function/{accountId}", method = RequestMethod.GET)
@ResponseBody
public ResultModel findFunction(@CurrentAccount User loginAccount, @RequestParam String startDate,
@RequestParam String endDate, @PathVariable Long accountId) {
//返回默认数据
Map result = new HashMap();
result.put("numAccount", 0);
result.put("numApp", 0);
result.put("numCampaign", 0);
result.put("numChannel", 0);
result.put("event_sum", 0);
result.put("click_sum", 0);
return ResultModel.OK(result);
}
@RequestMapping(value = "/findone", method = RequestMethod.GET)
@ResponseBody
public ResultModel findOne(@CurrentAccount User loginAccount, @RequestParam String email) {
return ResultModel.OK(accountService.findOne("dmp",email));
}
}
...@@ -390,7 +390,7 @@ public class IOAccountServiceImpl implements IOAccountService { ...@@ -390,7 +390,7 @@ public class IOAccountServiceImpl implements IOAccountService {
BigInteger numAccount = accountRepository.countByRootParent(account, startDate, endDate); BigInteger numAccount = accountRepository.countByRootParent(account, startDate, endDate);
BigInteger numApp = appRepository.countByAccount(idList, startDate, endDate); BigInteger numApp = appRepository.countByAccount(idList, startDate, endDate);
result.put("numAccount", numAccount.intValue()); result.put("numAccount", numAccount.intValue());
result.put("numApp", numApp.intValue()); result.put("numApp", numApp.intValue());
return result; return result;
} }
......
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