Commit e37f1f12 by manxiaoqiang

客户表

parent 0e60f9ae
...@@ -24,6 +24,23 @@ public class TkioAccountController { ...@@ -24,6 +24,23 @@ public class TkioAccountController {
@Autowired @Autowired
TkioAccountService tkioAccountService; TkioAccountService tkioAccountService;
//sale
@RequestMapping(value = "/findSale", method = RequestMethod.GET)
@ResponseBody
public ResultModel findSale(@CurrentAccount User loginAccount, @RequestParam(required = false) Long sale) {
return ResultModel.OK(tkioAccountService.findSale(loginAccount, sale));
}
//sale
@RequestMapping(value = "/update/sale", method = RequestMethod.PUT)
@ResponseBody
public ResultModel updateSale(@CurrentAccount User loginAccount,
@RequestParam String email, @RequestParam String accountEmail) {
return ResultModel.OK(tkioAccountService.updateSale(email, accountEmail));
}
//客户列表 //客户列表
@RequestMapping(value = "/findAll", method = RequestMethod.GET) @RequestMapping(value = "/findAll", method = RequestMethod.GET)
@ResponseBody @ResponseBody
......
...@@ -9,6 +9,10 @@ import java.util.Map; ...@@ -9,6 +9,10 @@ import java.util.Map;
* Created by mxq on 2017/12/26. * Created by mxq on 2017/12/26.
*/ */
public interface TkioAccountService { public interface TkioAccountService {
Map<String, Object> findSale(User user, Long sale);
Account4Web updateSale(String email, String account);
List<Account4Web> findAll(User user); List<Account4Web> findAll(User user);
Account4Web findOne(String email); Account4Web findOne(String email);
......
...@@ -7,6 +7,7 @@ import common.service.UserService; ...@@ -7,6 +7,7 @@ import common.service.UserService;
import dic.RoleEnum; import dic.RoleEnum;
import dic.RoleTypeEnum; import dic.RoleTypeEnum;
import org.apache.commons.collections.map.AbstractMapDecorator; import org.apache.commons.collections.map.AbstractMapDecorator;
import org.apache.commons.collections.map.HashedMap;
import org.apache.commons.collections4.list.TreeList; import org.apache.commons.collections4.list.TreeList;
import org.json.JSONArray; import org.json.JSONArray;
import org.json.JSONException; import org.json.JSONException;
...@@ -74,6 +75,33 @@ public class TkioAccountServiceImpl implements TkioAccountService { ...@@ -74,6 +75,33 @@ public class TkioAccountServiceImpl implements TkioAccountService {
ReminderLevelRepository reminderLevelRepository; ReminderLevelRepository reminderLevelRepository;
@Override @Override
public Map<String, Object> findSale(User user, Long sale) {
Map<String, Object> map = new HashMap();
String email = null;
if(null != sale){
email = salesManLeaderRepository.findLeaderByBussinessMan(sale);
User user1 = userRepository.findByEmail(email);
map.put("old", user1.getName());
}
List<User> list = userService.findbyRole(user.getRole());
map.put("new", list);
return map;
}
@Override
public Account4Web updateSale(String email, String account) {
Account accountTkio = accountRepository.findByEmail(account);
Account4Web account4Web = account4WebRepository.findByEmail(account);
SalesManLeader leader = salesManLeaderRepository.findOneByEmail(email);
accountTkio.setBussinessman(Long.parseLong(leader.getId()+""));
accountRepository.save(accountTkio);
account4Web.setBussinessMan(Long.parseLong(leader.getId()+""));
return account4WebRepository.save(account4Web);
}
@Override
public List<Account4Web> findAll(User user) { public List<Account4Web> findAll(User user) {
List<Account4Web> result = new ArrayList<>(); List<Account4Web> result = new ArrayList<>();
List<Account4Web> account4WebList = null; List<Account4Web> account4WebList = null;
......
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