Commit 68585343 by manxiaoqiang

2

parent fd059d16
......@@ -15,6 +15,7 @@ public class Account4Web {
private String createDs;
private String status;
private String packageType;
private Long packageTypeId;
private String pastDate;
private BigInteger track;
private BigInteger io;
......@@ -35,6 +36,14 @@ public class Account4Web {
private String saleEamil;
private Long sale;
public Long getPackageTypeId() {
return packageTypeId;
}
public void setPackageTypeId(Long packageTypeId) {
this.packageTypeId = packageTypeId;
}
public String getSaleEamil() {
return saleEamil;
}
......
......@@ -16,6 +16,7 @@ public class IOAccount4Web {
private String createDs;
private String status;
private String packageType;
private Long packageTypeId;
private String pastDate;
private BigInteger track;
private BigInteger io;
......@@ -36,6 +37,14 @@ public class IOAccount4Web {
private String saleEamil;
private Long sale;
public Long getPackageTypeId() {
return packageTypeId;
}
public void setPackageTypeId(Long packageTypeId) {
this.packageTypeId = packageTypeId;
}
public String getSaleEamil() {
return saleEamil;
}
......
......@@ -105,11 +105,13 @@ public class TkioAccountServiceImpl implements TkioAccountService {
Account accountTkio = accountRepository.findByEmail(account);
Account4Web account4Web = account4WebRepository.findByEmail(account);
SalesManLeader leader = salesManLeaderRepository.findOneByEmail(email);
User user = userRepository.findByEmail(email);
accountTkio.setBussinessman(Long.parseLong(leader.getId()+""));
accountRepository.save(accountTkio);
account4Web.setBussinessMan(Long.parseLong(leader.getId()+""));
account4Web.setSaleEamil(user.getEmail());
return account4WebRepository.save(account4Web);
}
......@@ -327,6 +329,9 @@ public class TkioAccountServiceImpl implements TkioAccountService {
contractRepository.save(contract);
}
Account4Web account4Web = account4WebRepository.findByEmail(resource.getEmail());
account4Web.setStatus("已激活");
account4WebRepository.save(account4Web);
Account account = accountRepository.findByEmail(resource.getEmail());
account.setStatus(1);
......@@ -361,6 +366,9 @@ public class TkioAccountServiceImpl implements TkioAccountService {
contractRepository.save(contract);
}
Account4Web account4Web = account4WebRepository.findByEmail(resource.getEmail());
account4Web.setStatus("已禁用");
account4WebRepository.save(account4Web);
Account account = accountRepository.findByEmail(resource.getEmail());
account.setStatus(0);
......
......@@ -65,6 +65,7 @@ public class AccountTask {
for(Account ac : accountValidList){
Account4Web account4Web = new Account4Web();
account4Web.setAccountId(ac.getId());
account4Web.setPackageTypeId(ac.getPricelevel());
account4Web.setEmail(ac.getEmail());
account4Web.setCompany(ac.getCompany());
account4Web.setCreateDate(ac.getPubDate());
......@@ -135,6 +136,7 @@ public class AccountTask {
if(ValidateUtil.isValid(pastAccountList)){
for(Account ac : pastAccountList){
Account4Web account4Web = new Account4Web();
account4Web.setPackageTypeId(ac.getPricelevel());
account4Web.setAccountId(ac.getId());
account4Web.setEmail(ac.getEmail());
account4Web.setCompany(ac.getCompany());
......@@ -159,6 +161,7 @@ public class AccountTask {
if(ValidateUtil.isValid(accountList)){
for(Account ac : accountList){
Account4Web account4Web = new Account4Web();
account4Web.setPackageTypeId(ac.getPricelevel());
account4Web.setAccountId(ac.getId());
account4Web.setEmail(ac.getEmail());
account4Web.setCompany(ac.getCompany());
......
......@@ -23,6 +23,23 @@ public class IoAccountController {
@Autowired
IOAccountService 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)
......
......@@ -8,7 +8,7 @@ import userio.model.SalesManLeader;
import java.util.List;
@Transactional
public interface IOSalesManLeaderRepository extends JpaRepository<SalesManLeader, Long> {
public interface IOSalesManLeaderRepository extends JpaRepository<SalesManLeader, Integer> {
@Query(value = "select email from sales_man_leader where id=(select leader from sales_man_leader where id=?1)", nativeQuery = true)
String findLeaderByBussinessMan(Long bussinessMan);
......
......@@ -9,6 +9,10 @@ import java.util.Map;
* Created by mxq on 2017/12/26.
*/
public interface IOAccountService {
Map<String, Object> findSale(User user, Long sale);
IOAccount4Web updateSale(String email, String account);
List<IOAccount4Web> findAll(User user);
IOAccount4Web findOne(String email);
......
......@@ -69,6 +69,40 @@ public class IOAccountServiceImpl implements IOAccountService {
ReminderLevelRepository reminderLevelRepository;
@Autowired
PressMoneyRepository pressMoneyRepository;
@Override
public Map<String, Object> findSale(User user, Long sale) {
Map<String, Object> map = new HashMap();
String email = null;
if(null != sale){
SalesManLeader one = salesManLeaderRepository.findOne(Integer.parseInt(sale+""));
User user1 = userRepository.findByEmail(one.getEmail());
if (null != user1)
map.put("old", user1.getName());
}
List<User> list = new ArrayList<>();
if(user.getRole().equals(RoleEnum.NORTH_BUSSINUSS.getKey()) || user.getRole().equals(RoleEnum.SOUTH_BUSSINUSS.getKey())){
list = userService.findbyRole(user.getRole());
}else {
list = userRepository.findSales();
}
map.put("new", list);
return map;
}
@Override
public IOAccount4Web updateSale(String email, String account) {
Account accountTkio = accountRepository.findByEmail(account);
IOAccount4Web account4Web = account4WebRepository.findByEmail(account);
SalesManLeader leader = salesManLeaderRepository.findOneByEmail(email);
User user = userRepository.findByEmail(email);
accountTkio.setBussinessman(Long.parseLong(leader.getId()+""));
accountRepository.save(accountTkio);
account4Web.setBussinessMan(Long.parseLong(leader.getId()+""));
account4Web.setSaleEamil(user.getEmail());
return account4WebRepository.save(account4Web);
}
@Override
public List<IOAccount4Web> findAll(User user) {
......@@ -271,6 +305,21 @@ public class IOAccountServiceImpl implements IOAccountService {
resource.setPlatform("io");
resource.setPressStatus(false);
resource.setDs(DateUtil.getBeforeDays(0));
Contract contract = contractRepository.findByPlatformAndEmailLimit1("io", resource.getEmail(), ContractTypeEnum.MAIN.getKey());
if(null != contract){
contract.setStatus("executing");
contractRepository.save(contract);
}
IOAccount4Web account4Web = account4WebRepository.findByEmail(resource.getEmail());
account4Web.setStatus("已激活");
account4WebRepository.save(account4Web);
Account account = accountRepository.findByEmail(resource.getEmail());
account.setStatus(1);
accountRepository.save(account);
return pressMoneyRepository.save(resource);
}
......@@ -281,6 +330,22 @@ public class IOAccountServiceImpl implements IOAccountService {
resource.setPlatform("io");
resource.setPressStatus(true);
resource.setDs(DateUtil.getBeforeDays(0));
Contract contract = contractRepository.findByPlatformAndEmailLimit1("io", resource.getEmail(), ContractTypeEnum.MAIN.getKey());
if(null != contract){
contract.setStatus("stop");
contractRepository.save(contract);
}
IOAccount4Web account4Web = account4WebRepository.findByEmail(resource.getEmail());
account4Web.setStatus("已禁用");
account4WebRepository.save(account4Web);
Account account = accountRepository.findByEmail(resource.getEmail());
account.setStatus(0);
accountRepository.save(account);
return pressMoneyRepository.save(resource);
}
......
......@@ -80,7 +80,7 @@ public class IOAccountTask {
for(Account ac : accounts){
IOAccount4Web account4Web = new IOAccount4Web();
account4Web.setStatus(status);
account4Web.setPackageTypeId(ac.getPricelevel());
account4Web.setAccountId(ac.getId());
account4Web.setEmail(ac.getEmail());
account4Web.setCompany(ac.getCompany());
......
......@@ -12,7 +12,7 @@
<bean id="tkioAccountTask" class="tkio.task.AccountTask"></bean>
<task:scheduled-tasks>
<!--//定时同步短链数据(每5分钟执行一次)-->
<task:scheduled ref="tkioAccountTask" method="task" cron="0 54 15 * * ?"/>
<task:scheduled ref="tkioAccountTask" method="task" cron="0 46 16 * * ?"/>
</task:scheduled-tasks>
<bean id="tkioNoticeTask" class="tkio.task.NoticeTask"></bean>
......
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