Commit eaabae4c by manxiaoqiang

adi

parent 0e91d6b6
package adi.controller;
import adi.model.ADIUser;
import adi.service.ADIAccountService;
import common.model.*;
import dic.OperateObjectTypeEnum;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import security.annotation.CurrentAccount;
import userio.service.IOAccountService;
import util.ResultModel;
import util.ResultStatus;
import util.UserLogThread;
import javax.servlet.http.HttpServletRequest;
/**
* Created by mxq on 2017/12/21.
*/
@Controller
@RequestMapping("adi/marketing/accountmng")
public class ADIAccountController {
@Autowired
ADIAccountService 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 = "/findSaleInfo", method = RequestMethod.GET)
@ResponseBody
public ResultModel findSale( @RequestParam String email) {
return ResultModel.OK(tkioAccountService.findSale(email));
}
//sale
@RequestMapping(value = "/update/sale", method = RequestMethod.PUT)
@ResponseBody
public ResultModel updateSale(@CurrentAccount User loginAccount,
@RequestParam String email, @RequestParam String accountEmail, HttpServletRequest request) {
UserLogThread userlog = new UserLogThread(loginAccount.getEmail(), loginAccount.getName(), OperateObjectTypeEnum.CUSTOMER.getKey(), accountEmail, "tkio修改销售为 " + email, request,loginAccount.getRole());
userlog.start();
return ResultModel.OK(tkioAccountService.updateSale(email, accountEmail));
}
//客户列表
@RequestMapping(value = "/findAll", method = RequestMethod.GET)
@ResponseBody
public ResultModel find(@CurrentAccount User loginAccount) {
return ResultModel.OK(tkioAccountService.findAll(loginAccount));
}
@RequestMapping(value = "/findone", method = RequestMethod.GET)
@ResponseBody
public ResultModel findOne(@CurrentAccount User loginAccount, @RequestParam String email) {
ADIUser account4Web = tkioAccountService.findOne(email);
if(null == account4Web){
return ResultModel.ERROR(ResultStatus.USER_EMPTY);
}
return ResultModel.OK(account4Web);
}
@RequestMapping(value = "/find/reminderlevel", method = RequestMethod.GET)
@ResponseBody
public ResultModel findReminderlevel() {
return ResultModel.OK(tkioAccountService.findReminderlevel());
}
//关闭缴费提醒
@RequestMapping(value = "/forbidenpress", method = RequestMethod.PUT)
@ResponseBody
public ResultModel forbidenPress(@CurrentAccount User loginAccount, @RequestBody PressMoney resource, HttpServletRequest request) {
UserLogThread userlog = new UserLogThread(loginAccount.getEmail(), loginAccount.getName(), OperateObjectTypeEnum.CUSTOMER.getKey(), resource.getEmail(), "关闭异常状态跟进", request,loginAccount.getRole());
userlog.start();
return ResultModel.OK(tkioAccountService.forbidenPress(loginAccount, resource));
}
//开启缴费提醒
@RequestMapping(value = "/enablepress", method = RequestMethod.PUT)
@ResponseBody
public ResultModel enablePress(@CurrentAccount User loginAccount, @RequestBody PressMoney resource, HttpServletRequest request) {
UserLogThread userlog = new UserLogThread(loginAccount.getEmail(), loginAccount.getName(), OperateObjectTypeEnum.CUSTOMER.getKey(), resource.getEmail(), "开启异常状态跟进", request,loginAccount.getRole());
userlog.start();
return ResultModel.OK(tkioAccountService.enablePress(loginAccount, resource));
}
//回访
@RequestMapping(value = "/visit", method = RequestMethod.PUT)
@ResponseBody
public ResultModel visit(@CurrentAccount User loginAccount, @RequestBody BackVisit resource, HttpServletRequest request) {
UserLogThread userlog = new UserLogThread(loginAccount.getEmail(), loginAccount.getName(), OperateObjectTypeEnum.CUSTOMER.getKey(), resource.getEmail(), "回访", request,loginAccount.getRole());
userlog.start();
return ResultModel.OK( tkioAccountService.visit(loginAccount, resource));
}
//回访查询
@RequestMapping(value = "/find/visit/{accountId}", method = RequestMethod.GET)
@ResponseBody
public ResultModel findVisit(@CurrentAccount User loginAccount, @RequestParam String startDate,
@RequestParam String endDate, @PathVariable Long accountId) {
return ResultModel.OK(tkioAccountService.findVisit(accountId,startDate,endDate));
}
//缴费查询
@RequestMapping(value = "/find/pay/{accountId}", method = RequestMethod.GET)
@ResponseBody
public ResultModel findPay(@CurrentAccount User loginAccount, @RequestParam String startDate,
@RequestParam String endDate, @RequestParam String email, @PathVariable Long accountId) {
return ResultModel.OK(tkioAccountService.findPay(email,startDate,endDate));
}
//合同查询
@RequestMapping(value = "/find/contract/{accountId}", method = RequestMethod.GET)
@ResponseBody
public ResultModel findContract(@CurrentAccount User loginAccount, @RequestParam(required =false) String startDate,
@RequestParam(required =false) String endDate, @RequestParam String email) {
return ResultModel.OK(tkioAccountService.findContractChange(email,startDate,endDate));
}
}
package adi.dic;
public enum PackageEnum {
PROBATION(1,"试用套餐"),
FORMAL(2,"正式套餐");
private Integer key;
private String value;
PackageEnum(Integer key, String value) {
this.key = key;
this.value = value;
}
public Integer getKey() {
return key;
}
public String getValue() {
return value;
}
}
package adi.dic;
public enum StatusEnum {
INIT(0,"未激活"),
ACTIVE(1,"已开通"),
PAST(2,"已过期"),
FORBIDEN(3,"已停用");
private Integer key;
private String value;
StatusEnum(Integer key, String value) {
this.key = key;
this.value = value;
}
public Integer getKey() {
return key;
}
public String getValue() {
return value;
}
}
package adi.dic;
public enum TypeEnum {
COMPANY(1,"企业用户"),
OWNER(2,"个人用户");
private Integer key;
private String value;
TypeEnum(Integer key, String value) {
this.key = key;
this.value = value;
}
public Integer getKey() {
return key;
}
public String getValue() {
return value;
}
}
package adi.model;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
public class ADIUser implements Serializable{
private Long id;
private Long accountId;
private String email;
private String password;
private String name;
private String company;
private String phone;
private String qq;
private String wechat;
private String status;//是否激活: true-激活
private Long modifyAccount;
private Long createAccount;
private Date modifyTime = new Date();
private Date createTime;
private Boolean delFlag;
private String regIpAddr;
private String regIpLocation;
private Long activeTime;//激活时间
private Boolean whetherCompany;//是否企业用户
private Boolean onMedia;//是否选择媒体
private Boolean onTrial;//是否试用账户
private Date expriedTime;//账户到期时间
private Boolean closeFloat;//是否已关闭“试用”提示框
private String packageType;
private String bussinessManEmail;
private List<String> mediaList;
private Date constractStartTime;//合同开始时间
private Long bussinessMan;
private String contractStatus;
private Integer contractTime;
private String saleName;
private Boolean pressStatus;
private String saleEamil;
private Long sale;
private Long money;
private Integer backTime;
private String pastDate;
public Long getAccountId() {
return accountId;
}
public void setAccountId(Long accountId) {
this.accountId = accountId;
}
public String getPastDate() {
return pastDate;
}
public void setPastDate(String pastDate) {
this.pastDate = pastDate;
}
public List<String> getMediaList() {
return mediaList;
}
public Integer getBackTime() {
return backTime;
}
public void setBackTime(Integer backTime) {
this.backTime = backTime;
}
public void setMediaList(List<String> mediaList) {
this.mediaList = mediaList;
}
public String getContractStatus() {
return contractStatus;
}
public void setContractStatus(String contractStatus) {
this.contractStatus = contractStatus;
}
public Integer getContractTime() {
return contractTime;
}
public void setContractTime(Integer contractTime) {
this.contractTime = contractTime;
}
public String getSaleName() {
return saleName;
}
public void setSaleName(String saleName) {
this.saleName = saleName;
}
public Boolean getPressStatus() {
return pressStatus;
}
public void setPressStatus(Boolean pressStatus) {
this.pressStatus = pressStatus;
}
public String getSaleEamil() {
return saleEamil;
}
public void setSaleEamil(String saleEamil) {
this.saleEamil = saleEamil;
}
public Long getSale() {
return sale;
}
public void setSale(Long sale) {
this.sale = sale;
}
public Long getMoney() {
return money;
}
public void setMoney(Long money) {
this.money = money;
}
public String getBussinessManEmail() {
return bussinessManEmail;
}
public void setBussinessManEmail(String bussinessManEmail) {
this.bussinessManEmail = bussinessManEmail;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Long getModifyAccount() {
return modifyAccount;
}
public void setModifyAccount(Long modifyAccount) {
this.modifyAccount = modifyAccount;
}
public Long getCreateAccount() {
return createAccount;
}
public void setCreateAccount(Long createAccount) {
this.createAccount = createAccount;
}
public Date getModifyTime() {
return modifyTime;
}
public void setModifyTime(Date modifyTime) {
this.modifyTime = modifyTime;
}
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Boolean getDelFlag() {
return delFlag;
}
public void setDelFlag(Boolean delFlag) {
this.delFlag = delFlag;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public String getCompany() {
return company;
}
public void setCompany(String company) {
this.company = company;
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
public String getQq() {
return qq;
}
public void setQq(String qq) {
this.qq = qq;
}
public String getWechat() {
return wechat;
}
public void setWechat(String wechat) {
this.wechat = wechat;
}
public String getRegIpAddr() {
return regIpAddr;
}
public void setRegIpAddr(String regIpAddr) {
this.regIpAddr = regIpAddr;
}
public String getRegIpLocation() {
return regIpLocation;
}
public void setRegIpLocation(String regIpLocation) {
this.regIpLocation = regIpLocation;
}
public Long getActiveTime() {
return activeTime;
}
public void setActiveTime(Long activeTime) {
this.activeTime = activeTime;
}
public Boolean getOnMedia() {
return onMedia;
}
public void setOnMedia(Boolean onMedia) {
this.onMedia = onMedia;
}
public Boolean getOnTrial() {
return onTrial;
}
public void setOnTrial(Boolean onTrial) {
this.onTrial = onTrial;
}
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
public Date getExpriedTime() {
return expriedTime;
}
public void setExpriedTime(Date expriedTime) {
this.expriedTime = expriedTime;
}
public Boolean getWhetherCompany() {
return whetherCompany;
}
public void setWhetherCompany(Boolean whetherCompany) {
this.whetherCompany = whetherCompany;
}
public Boolean getCloseFloat() {
return closeFloat;
}
public void setCloseFloat(Boolean closeFloat) {
this.closeFloat = closeFloat;
}
public String getPackageType() {
return packageType;
}
public void setPackageType(String packageType) {
this.packageType = packageType;
}
public Long getBussinessMan() {
return bussinessMan;
}
public void setBussinessMan(Long bussinessMan) {
this.bussinessMan = bussinessMan;
}
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
public Date getConstractStartTime() {
return constractStartTime;
}
public void setConstractStartTime(Date constractStartTime) {
this.constractStartTime = constractStartTime;
}
@Override
public String toString() {
return "ADIUser{" +
"id=" + id +
", email='" + email + '\'' +
", password='" + password + '\'' +
", name='" + name + '\'' +
", company='" + company + '\'' +
", phone='" + phone + '\'' +
", qq='" + qq + '\'' +
", wechat='" + wechat + '\'' +
", status=" + status +
", modifyAccount=" + modifyAccount +
", createAccount=" + createAccount +
", modifyTime=" + modifyTime +
", createTime=" + createTime +
", delFlag=" + delFlag +
", regIpAddr='" + regIpAddr + '\'' +
", regIpLocation='" + regIpLocation + '\'' +
", activeTime=" + activeTime +
", whetherCompany=" + whetherCompany +
", onMedia=" + onMedia +
", onTrial=" + onTrial +
", expriedTime=" + expriedTime +
", closeFloat=" + closeFloat +
", packageType='" + packageType + '\'' +
", bussinessMan=" + bussinessMan +
", mediaList=" + mediaList +
'}';
}
}
package adi.service;
import adi.model.ADIUser;
import common.model.*;
import java.util.List;
import java.util.Map;
/**
* Created by mxq on 2017/12/26.
*/
public interface ADIAccountService {
Map<String, Object> findSale(User user, Long sale);
Map<String, String> findSale(String email);
IOAccount4Web updateSale(String email, String account);
List<ADIUser> findAll(User user);
ADIUser findOne(String email);
List<ReminderLevel> findReminderlevel();
void updateAccount(Contract contract);
//催款提醒关闭
PressMoney forbidenPress(User user, PressMoney resource);
//催款提醒开启
PressMoney enablePress(User user, PressMoney resource);
//回访
BackVisit visit(User user, BackVisit resource);
List<BackVisit> findVisit(Long account, String startDate, String endDate);
List<ContractMoney> findPay(String email, String startDate, String endDate);
List<Contract> findContract(String email);
List<Contract> findContractChange(String email, String startDate, String endDate);
}
package office.model;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import java.util.Date;
/**
* Created by nolan on 06/06/2017.
* description:
*/
@Entity
public class ADISaleMap {
private Long id;
private Long account;
private String accountEmail;
private Long sale;
private String saleEmail;
private String saleName;
private Date createTime;
private Date modifeTime;
@Id
@GeneratedValue(strategy= GenerationType.AUTO)
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getAccount() {
return account;
}
public void setAccount(Long account) {
this.account = account;
}
public String getAccountEmail() {
return accountEmail;
}
public void setAccountEmail(String accountEmail) {
this.accountEmail = accountEmail;
}
public Long getSale() {
return sale;
}
public void setSale(Long sale) {
this.sale = sale;
}
public String getSaleEmail() {
return saleEmail;
}
public void setSaleEmail(String saleEmail) {
this.saleEmail = saleEmail;
}
public String getSaleName() {
return saleName;
}
public void setSaleName(String saleName) {
this.saleName = saleName;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getModifeTime() {
return modifeTime;
}
public void setModifeTime(Date modifeTime) {
this.modifeTime = modifeTime;
}
@Override
public String toString() {
return "ADISaleMap{" +
"id=" + id +
", account=" + account +
", accountEmail='" + accountEmail + '\'' +
", sale=" + sale +
", saleEmail='" + saleEmail + '\'' +
", saleName='" + saleName + '\'' +
", createTime=" + createTime +
", modifeTime=" + modifeTime +
'}';
}
}
package office.repository;
import office.model.ADISaleMap;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
/**
* Created by nolan on 06/06/2017.
* description:
*/
public interface ADISaleMapRepository
extends JpaRepository<ADISaleMap, Long>
{
@Query(value = "select * from adisale_map where account=?1", nativeQuery = true)
ADISaleMap findByAccountId(Long account);
@Query(value = "select * from adisale_map where account_email=?1", nativeQuery = true)
ADISaleMap findByAccountEmail(String email);
}
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