CustomerService单元测试

master
shijie 4 years ago
parent bd0ff253da
commit fb0d0d3e2e
  1. 444
      src/main/java/com/yipin/liuwanr/entity/Customer.java
  2. 769
      src/main/java/com/yipin/liuwanr/entity/UserM.java
  3. 3
      src/test/java/com/yipin/liuwanr/CoursePermissionsServiceTest.java
  4. 141
      src/test/java/com/yipin/liuwanr/CustomerServiceTest.java

@ -4,189 +4,263 @@ import java.util.List;
public class Customer { public class Customer {
//主键ID //主键ID
private Integer customerId; private Integer customerId;
//客户名称 //客户名称
private String customerName; private String customerName;
//国家 //国家
private String countries; private String countries;
//行业 //行业
private String industry; private String industry;
//省份 //省份
private Integer provinceId; private Integer provinceId;
//管理员姓名 //管理员姓名
private String adminName; private String adminName;
//管理员电话 //管理员电话
private String adminPhone; private String adminPhone;
//城市 //城市
private Integer cityId; private Integer cityId;
//客户类型 //客户类型
private Integer customerType; private Integer customerType;
//到期时间 //到期时间
private String stopTime; private String stopTime;
//创建时间 //创建时间
private String creationTime; private String creationTime;
//邮件 //邮件
private String email; private String email;
//绑定学校ID //绑定学校ID
private Integer schoolId; private Integer schoolId;
//搜索内容 //搜索内容
private String searchContent; private String searchContent;
private List<Customer> customer; private List<Customer> customer;
//绑定行业类ID //绑定行业类ID
private Integer industryClassId; private Integer industryClassId;
//绑定行业类名称 //绑定行业类名称
private String industryClassName; private String industryClassName;
//绑定行业ID //绑定行业ID
private Integer industryId; private Integer industryId;
//绑定行业名称 //绑定行业名称
private String industryName; private String industryName;
//———————————————————————— //————————————————————————
//绑定省份名称 //绑定省份名称
private String provinceName; private String provinceName;
//绑定城市名称 //绑定城市名称
private String cityName; private String cityName;
//绑定学校名称 //绑定学校名称
private String schoolName; private String schoolName;
//学校层次 //学校层次
private Integer level; private Integer level;
public String getCreationTime() { public String getCreationTime() {
return creationTime; return creationTime;
} }
public void setCreationTime(String creationTime) {
this.creationTime = creationTime; public void setCreationTime(String creationTime) {
} this.creationTime = creationTime;
public String getIndustryClassName() { }
return industryClassName;
} public String getIndustryClassName() {
public void setIndustryClassName(String industryClassName) { return industryClassName;
this.industryClassName = industryClassName; }
}
public String getIndustryName() { public void setIndustryClassName(String industryClassName) {
return industryName; this.industryClassName = industryClassName;
} }
public void setIndustryName(String industryName) {
this.industryName = industryName; public String getIndustryName() {
} return industryName;
public Integer getIndustryClassId() { }
return industryClassId;
} public void setIndustryName(String industryName) {
public void setIndustryClassId(Integer industryClassId) { this.industryName = industryName;
this.industryClassId = industryClassId; }
}
public Integer getIndustryId() { public Integer getIndustryClassId() {
return industryId; return industryClassId;
} }
public void setIndustryId(Integer industryId) {
this.industryId = industryId; public void setIndustryClassId(Integer industryClassId) {
} this.industryClassId = industryClassId;
public List<Customer> getCustomer() { }
return customer;
} public Integer getIndustryId() {
public void setCustomer(List<Customer> customer) { return industryId;
this.customer = customer; }
}
public String getSearchContent() { public void setIndustryId(Integer industryId) {
return searchContent; this.industryId = industryId;
} }
public void setSearchContent(String searchContent) {
this.searchContent = searchContent; public List<Customer> getCustomer() {
} return customer;
public Integer getLevel() { }
return level;
} public void setCustomer(List<Customer> customer) {
public void setLevel(Integer level) { this.customer = customer;
this.level = level; }
}
public Integer getCustomerId() { public String getSearchContent() {
return customerId; return searchContent;
} }
public void setCustomerId(Integer customerId) {
this.customerId = customerId; public void setSearchContent(String searchContent) {
} this.searchContent = searchContent;
public String getCustomerName() { }
return customerName;
} public Integer getLevel() {
public void setCustomerName(String customerName) { return level;
this.customerName = customerName; }
}
public String getCountries() { public void setLevel(Integer level) {
return countries; this.level = level;
} }
public void setCountries(String countries) {
this.countries = countries; public Integer getCustomerId() {
} return customerId;
public String getIndustry() { }
return industry;
} public void setCustomerId(Integer customerId) {
public void setIndustry(String industry) { this.customerId = customerId;
this.industry = industry; }
}
public Integer getProvinceId() { public String getCustomerName() {
return provinceId; return customerName;
} }
public void setProvinceId(Integer provinceId) {
this.provinceId = provinceId; public void setCustomerName(String customerName) {
} this.customerName = customerName;
public String getAdminName() { }
return adminName;
} public String getCountries() {
public void setAdminName(String adminName) { return countries;
this.adminName = adminName; }
}
public String getAdminPhone() { public void setCountries(String countries) {
return adminPhone; this.countries = countries;
} }
public void setAdminPhone(String adminPhone) {
this.adminPhone = adminPhone; public String getIndustry() {
} return industry;
public Integer getCityId() { }
return cityId;
} public void setIndustry(String industry) {
public void setCityId(Integer cityId) { this.industry = industry;
this.cityId = cityId; }
}
public Integer getCustomerType() { public Integer getProvinceId() {
return customerType; return provinceId;
} }
public void setCustomerType(Integer customerType) {
this.customerType = customerType; public void setProvinceId(Integer provinceId) {
} this.provinceId = provinceId;
public String getStopTime() { }
return stopTime;
} public String getAdminName() {
public void setStopTime(String stopTime) { return adminName;
this.stopTime = stopTime; }
}
public String getEmail() { public void setAdminName(String adminName) {
return email; this.adminName = adminName;
} }
public void setEmail(String email) {
this.email = email; public String getAdminPhone() {
} return adminPhone;
public Integer getSchoolId() { }
return schoolId;
} public void setAdminPhone(String adminPhone) {
public void setSchoolId(Integer schoolId) { this.adminPhone = adminPhone;
this.schoolId = schoolId; }
}
public String getProvinceName() { public Integer getCityId() {
return provinceName; return cityId;
} }
public void setProvinceName(String provinceName) {
this.provinceName = provinceName; public void setCityId(Integer cityId) {
} this.cityId = cityId;
public String getCityName() { }
return cityName;
} public Integer getCustomerType() {
public void setCityName(String cityName) { return customerType;
this.cityName = cityName; }
}
public String getSchoolName() { public void setCustomerType(Integer customerType) {
return schoolName; this.customerType = customerType;
} }
public void setSchoolName(String schoolName) {
this.schoolName = schoolName; public String getStopTime() {
} return stopTime;
}
public void setStopTime(String stopTime) {
this.stopTime = stopTime;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public Integer getSchoolId() {
return schoolId;
}
public void setSchoolId(Integer schoolId) {
this.schoolId = schoolId;
}
public String getProvinceName() {
return provinceName;
}
public void setProvinceName(String provinceName) {
this.provinceName = provinceName;
}
public String getCityName() {
return cityName;
}
public void setCityName(String cityName) {
this.cityName = cityName;
}
public String getSchoolName() {
return schoolName;
}
public void setSchoolName(String schoolName) {
this.schoolName = schoolName;
}
@Override
public String toString() {
return "Customer{" +
"customerId=" + customerId +
", customerName='" + customerName + '\'' +
", countries='" + countries + '\'' +
", industry='" + industry + '\'' +
", provinceId=" + provinceId +
", adminName='" + adminName + '\'' +
", adminPhone='" + adminPhone + '\'' +
", cityId=" + cityId +
", customerType=" + customerType +
", stopTime='" + stopTime + '\'' +
", creationTime='" + creationTime + '\'' +
", email='" + email + '\'' +
", schoolId=" + schoolId +
", searchContent='" + searchContent + '\'' +
", customer=" + customer +
", industryClassId=" + industryClassId +
", industryClassName='" + industryClassName + '\'' +
", industryId=" + industryId +
", industryName='" + industryName + '\'' +
", provinceName='" + provinceName + '\'' +
", cityName='" + cityName + '\'' +
", schoolName='" + schoolName + '\'' +
", level=" + level +
'}';
}
} }

@ -4,329 +4,454 @@ import java.util.List;
/** /**
* 用户信息实体 * 用户信息实体
* @author Ning
* *
* @author Ning
*/ */
public class UserM { public class UserM {
//用户id //用户id
private Integer userId; private Integer userId;
//用户姓名 //用户姓名
private String name; private String name;
//用户账号 //用户账号
private String userAccount; private String userAccount;
//用户密码 //用户密码
private String password; private String password;
//国家 //国家
private String countries; private String countries;
//绑定省份id //绑定省份id
private Integer provinceId; private Integer provinceId;
//绑定城市id //绑定城市id
private Integer cityId; private Integer cityId;
//账号角色 //账号角色
private Integer accountRole; private Integer accountRole;
//创建时间 //创建时间
private String creationTime; private String creationTime;
//登陆次数 //登陆次数
private Integer logInNumber; private Integer logInNumber;
//工号、学号 //工号、学号
private String workNumber; private String workNumber;
//部门 //部门
private String department; private String department;
//班级 //班级
private String classAndGrade; private String classAndGrade;
//上次登陆时间 //上次登陆时间
private String lastTimeOfLanding; private String lastTimeOfLanding;
//性别 //性别
private Integer sex; private Integer sex;
//证件类型(1、身份证) //证件类型(1、身份证)
private Integer documentType; private Integer documentType;
//身份证 //身份证
private String IDNumber; private String IDNumber;
//教育程度(1、研究数及以上) //教育程度(1、研究数及以上)
private Integer educationDegree; private Integer educationDegree;
//授课学科(1、金融) //授课学科(1、金融)
private Integer subjectsTaught; private Integer subjectsTaught;
//电话 //电话
private String phone; private String phone;
//微信账号 //微信账号
private String WeChatID; private String WeChatID;
//授课专业 //授课专业
private String teachingProfessional; private String teachingProfessional;
//出生日期 //出生日期
private String dateBirth; private String dateBirth;
//邮箱 //邮箱
private String email; private String email;
//学校id //学校id
private Integer schoolId; private Integer schoolId;
//唯一标示性账号 //唯一标示性账号
private String uniqueIdentificationAccount; private String uniqueIdentificationAccount;
//搜索内容 //搜索内容
private String searchContent; private String searchContent;
private List<UserM> user; private List<UserM> user;
//用户头像路径 //用户头像路径
private String userAvatars; private String userAvatars;
//------------------------------------------------ //------------------------------------------------
//学校名称 //学校名称
private String schoolName; private String schoolName;
//省份名称 //省份名称
private String provinceName; private String provinceName;
//城市名称 //城市名称
private String cityName; private String cityName;
//条件查询月 //条件查询月
private Integer month; private Integer month;
//条件查询结束时间 //条件查询结束时间
private String endTime; private String endTime;
//专业类ID //专业类ID
private Integer professionalClassId; private Integer professionalClassId;
//专业类名称 //专业类名称
private String professionalClassName; private String professionalClassName;
//学科ID //学科ID
private Integer disciplineId; private Integer disciplineId;
//学科名称 //学科名称
private String disciplineName; private String disciplineName;
//专业id //专业id
private Integer professionalId; private Integer professionalId;
//专业名称 //专业名称
private String professionalName; private String professionalName;
public Integer getProfessionalClassId() { public Integer getProfessionalClassId() {
return professionalClassId; return professionalClassId;
} }
public void setProfessionalClassId(Integer professionalClassId) {
this.professionalClassId = professionalClassId; public void setProfessionalClassId(Integer professionalClassId) {
} this.professionalClassId = professionalClassId;
public String getProfessionalClassName() { }
return professionalClassName;
} public String getProfessionalClassName() {
public void setProfessionalClassName(String professionalClassName) { return professionalClassName;
this.professionalClassName = professionalClassName; }
}
public Integer getDisciplineId() { public void setProfessionalClassName(String professionalClassName) {
return disciplineId; this.professionalClassName = professionalClassName;
} }
public void setDisciplineId(Integer disciplineId) {
this.disciplineId = disciplineId; public Integer getDisciplineId() {
} return disciplineId;
public String getDisciplineName() { }
return disciplineName;
} public void setDisciplineId(Integer disciplineId) {
public void setDisciplineName(String disciplineName) { this.disciplineId = disciplineId;
this.disciplineName = disciplineName; }
}
public Integer getProfessionalId() { public String getDisciplineName() {
return professionalId; return disciplineName;
} }
public void setProfessionalId(Integer professionalId) {
this.professionalId = professionalId; public void setDisciplineName(String disciplineName) {
} this.disciplineName = disciplineName;
public String getProfessionalName() { }
return professionalName;
} public Integer getProfessionalId() {
public void setProfessionalName(String professionalName) { return professionalId;
this.professionalName = professionalName; }
}
public String getUserAvatars() { public void setProfessionalId(Integer professionalId) {
return userAvatars; this.professionalId = professionalId;
} }
public void setUserAvatars(String userAvatars) {
this.userAvatars = userAvatars; public String getProfessionalName() {
} return professionalName;
public Integer getMonth() { }
return month;
} public void setProfessionalName(String professionalName) {
public void setMonth(Integer month) { this.professionalName = professionalName;
this.month = month; }
}
public String getEndTime() { public String getUserAvatars() {
return endTime; return userAvatars;
} }
public void setEndTime(String endTime) {
this.endTime = endTime; public void setUserAvatars(String userAvatars) {
} this.userAvatars = userAvatars;
public String getSearchContent() { }
return searchContent;
} public Integer getMonth() {
public void setSearchContent(String searchContent) { return month;
this.searchContent = searchContent; }
}
public List<UserM> getUser() { public void setMonth(Integer month) {
return user; this.month = month;
} }
public void setUser(List<UserM> user) {
this.user = user; public String getEndTime() {
} return endTime;
public String getProvinceName() { }
return provinceName;
} public void setEndTime(String endTime) {
public void setProvinceName(String provinceName) { this.endTime = endTime;
this.provinceName = provinceName; }
}
public String getCityName() { public String getSearchContent() {
return cityName; return searchContent;
} }
public void setCityName(String cityName) {
this.cityName = cityName; public void setSearchContent(String searchContent) {
} this.searchContent = searchContent;
public String getSchoolName() { }
return schoolName;
} public List<UserM> getUser() {
public void setSchoolName(String schoolName) { return user;
this.schoolName = schoolName; }
}
public String getUniqueIdentificationAccount() { public void setUser(List<UserM> user) {
return uniqueIdentificationAccount; this.user = user;
} }
public void setUniqueIdentificationAccount(String uniqueIdentificationAccount) {
this.uniqueIdentificationAccount = uniqueIdentificationAccount; public String getProvinceName() {
} return provinceName;
public Integer getUserId() { }
return userId;
} public void setProvinceName(String provinceName) {
public void setUserId(Integer userId) { this.provinceName = provinceName;
this.userId = userId; }
}
public String getName() { public String getCityName() {
return name; return cityName;
} }
public void setName(String name) {
this.name = name; public void setCityName(String cityName) {
} this.cityName = cityName;
public String getUserAccount() { }
return userAccount;
} public String getSchoolName() {
public void setUserAccount(String userAccount) { return schoolName;
this.userAccount = userAccount; }
}
public String getPassword() { public void setSchoolName(String schoolName) {
return password; this.schoolName = schoolName;
} }
public void setPassword(String password) {
this.password = password; public String getUniqueIdentificationAccount() {
} return uniqueIdentificationAccount;
public String getCountries() { }
return countries;
} public void setUniqueIdentificationAccount(String uniqueIdentificationAccount) {
public void setCountries(String countries) { this.uniqueIdentificationAccount = uniqueIdentificationAccount;
this.countries = countries; }
}
public Integer getProvinceId() { public Integer getUserId() {
return provinceId; return userId;
} }
public void setProvinceId(Integer provinceId) {
this.provinceId = provinceId; public void setUserId(Integer userId) {
} this.userId = userId;
public Integer getCityId() { }
return cityId;
} public String getName() {
public void setCityId(Integer cityId) { return name;
this.cityId = cityId; }
}
public Integer getAccountRole() { public void setName(String name) {
return accountRole; this.name = name;
} }
public void setAccountRole(Integer accountRole) {
this.accountRole = accountRole; public String getUserAccount() {
} return userAccount;
public String getCreationTime() { }
return creationTime;
} public void setUserAccount(String userAccount) {
public void setCreationTime(String creationTime) { this.userAccount = userAccount;
this.creationTime = creationTime; }
}
public Integer getLogInNumber() { public String getPassword() {
return logInNumber; return password;
} }
public void setLogInNumber(Integer logInNumber) {
this.logInNumber = logInNumber; public void setPassword(String password) {
} this.password = password;
public String getWorkNumber() { }
return workNumber;
} public String getCountries() {
public void setWorkNumber(String workNumber) { return countries;
this.workNumber = workNumber; }
}
public String getDepartment() { public void setCountries(String countries) {
return department; this.countries = countries;
} }
public void setDepartment(String department) {
this.department = department; public Integer getProvinceId() {
} return provinceId;
public String getClassAndGrade() { }
return classAndGrade;
} public void setProvinceId(Integer provinceId) {
public void setClassAndGrade(String classAndGrade) { this.provinceId = provinceId;
this.classAndGrade = classAndGrade; }
}
public String getLastTimeOfLanding() { public Integer getCityId() {
return lastTimeOfLanding; return cityId;
} }
public void setLastTimeOfLanding(String lastTimeOfLanding) {
this.lastTimeOfLanding = lastTimeOfLanding; public void setCityId(Integer cityId) {
} this.cityId = cityId;
public Integer getSex() { }
return sex;
} public Integer getAccountRole() {
public void setSex(Integer sex) { return accountRole;
this.sex = sex; }
}
public Integer getDocumentType() { public void setAccountRole(Integer accountRole) {
return documentType; this.accountRole = accountRole;
} }
public void setDocumentType(Integer documentType) {
this.documentType = documentType; public String getCreationTime() {
} return creationTime;
public String getIDNumber() { }
return IDNumber;
} public void setCreationTime(String creationTime) {
public void setIDNumber(String iDNumber) { this.creationTime = creationTime;
IDNumber = iDNumber; }
}
public Integer getEducationDegree() { public Integer getLogInNumber() {
return educationDegree; return logInNumber;
} }
public void setEducationDegree(Integer educationDegree) {
this.educationDegree = educationDegree; public void setLogInNumber(Integer logInNumber) {
} this.logInNumber = logInNumber;
public Integer getSubjectsTaught() { }
return subjectsTaught;
} public String getWorkNumber() {
public void setSubjectsTaught(Integer subjectsTaught) { return workNumber;
this.subjectsTaught = subjectsTaught; }
}
public String getPhone() { public void setWorkNumber(String workNumber) {
return phone; this.workNumber = workNumber;
} }
public void setPhone(String phone) {
this.phone = phone; public String getDepartment() {
} return department;
public String getWeChatID() { }
return WeChatID;
} public void setDepartment(String department) {
public void setWeChatID(String weChatID) { this.department = department;
WeChatID = weChatID; }
}
public String getTeachingProfessional() { public String getClassAndGrade() {
return teachingProfessional; return classAndGrade;
} }
public void setTeachingProfessional(String teachingProfessional) {
this.teachingProfessional = teachingProfessional; public void setClassAndGrade(String classAndGrade) {
} this.classAndGrade = classAndGrade;
public String getDateBirth() { }
return dateBirth;
} public String getLastTimeOfLanding() {
public void setDateBirth(String dateBirth) { return lastTimeOfLanding;
this.dateBirth = dateBirth; }
}
public String getEmail() { public void setLastTimeOfLanding(String lastTimeOfLanding) {
return email; this.lastTimeOfLanding = lastTimeOfLanding;
} }
public void setEmail(String email) {
this.email = email; public Integer getSex() {
} return sex;
public Integer getSchoolId() { }
return schoolId;
} public void setSex(Integer sex) {
public void setSchoolId(Integer schoolId) { this.sex = sex;
this.schoolId = schoolId; }
}
public Integer getDocumentType() {
return documentType;
}
public void setDocumentType(Integer documentType) {
this.documentType = documentType;
}
public String getIDNumber() {
return IDNumber;
}
public void setIDNumber(String iDNumber) {
IDNumber = iDNumber;
}
public Integer getEducationDegree() {
return educationDegree;
}
public void setEducationDegree(Integer educationDegree) {
this.educationDegree = educationDegree;
}
public Integer getSubjectsTaught() {
return subjectsTaught;
}
public void setSubjectsTaught(Integer subjectsTaught) {
this.subjectsTaught = subjectsTaught;
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
public String getWeChatID() {
return WeChatID;
}
public void setWeChatID(String weChatID) {
WeChatID = weChatID;
}
public String getTeachingProfessional() {
return teachingProfessional;
}
public void setTeachingProfessional(String teachingProfessional) {
this.teachingProfessional = teachingProfessional;
}
public String getDateBirth() {
return dateBirth;
}
public void setDateBirth(String dateBirth) {
this.dateBirth = dateBirth;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public Integer getSchoolId() {
return schoolId;
}
public void setSchoolId(Integer schoolId) {
this.schoolId = schoolId;
}
@Override
public String toString() {
return "UserM{" +
"userId=" + userId +
", name='" + name + '\'' +
", userAccount='" + userAccount + '\'' +
", password='" + password + '\'' +
", countries='" + countries + '\'' +
", provinceId=" + provinceId +
", cityId=" + cityId +
", accountRole=" + accountRole +
", creationTime='" + creationTime + '\'' +
", logInNumber=" + logInNumber +
", workNumber='" + workNumber + '\'' +
", department='" + department + '\'' +
", classAndGrade='" + classAndGrade + '\'' +
", lastTimeOfLanding='" + lastTimeOfLanding + '\'' +
", sex=" + sex +
", documentType=" + documentType +
", IDNumber='" + IDNumber + '\'' +
", educationDegree=" + educationDegree +
", subjectsTaught=" + subjectsTaught +
", phone='" + phone + '\'' +
", WeChatID='" + WeChatID + '\'' +
", teachingProfessional='" + teachingProfessional + '\'' +
", dateBirth='" + dateBirth + '\'' +
", email='" + email + '\'' +
", schoolId=" + schoolId +
", uniqueIdentificationAccount='" + uniqueIdentificationAccount + '\'' +
", searchContent='" + searchContent + '\'' +
", user=" + user +
", userAvatars='" + userAvatars + '\'' +
", schoolName='" + schoolName + '\'' +
", provinceName='" + provinceName + '\'' +
", cityName='" + cityName + '\'' +
", month=" + month +
", endTime='" + endTime + '\'' +
", professionalClassId=" + professionalClassId +
", professionalClassName='" + professionalClassName + '\'' +
", disciplineId=" + disciplineId +
", disciplineName='" + disciplineName + '\'' +
", professionalId=" + professionalId +
", professionalName='" + professionalName + '\'' +
'}';
}
} }

@ -22,9 +22,6 @@ public class CoursePermissionsServiceTest {
@Autowired @Autowired
private CoursePermissionsService coursePermissionsService; private CoursePermissionsService coursePermissionsService;
@Autowired
private CoursePermissionsMapper coursePermissionsMapper;
/** /**
* 新增课程权限 * 新增课程权限
*/ */

@ -0,0 +1,141 @@
package com.yipin.liuwanr;
import com.yipin.liuwanr.entity.Customer;
import com.yipin.liuwanr.entity.UserM;
import com.yipin.liuwanr.service.CustomerService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.transaction.annotation.Transactional;
import java.util.HashMap;
@RunWith(SpringRunner.class)
@SpringBootTest
public class CustomerServiceTest {
@Autowired
private CustomerService customerService;
//添加客户
@Test
@Transactional
public void addCustomer() {
Customer customer = new Customer();
customer.setCountries("测试");
customer.setIndustry("测试");
customer.setProvinceId(1);
customer.setAdminName("测试");
customer.setAdminPhone("测试");
customer.setCityId(1);
customer.setCustomerType(1);
customer.setStopTime("测试");
customer.setEmail("测试");
customer.setSchoolId(1);
customer.setIndustryClassId(1);
customer.setIndustryId(1);
customer.setCustomerName("测试");
HashMap<String, Object> map = customerService.addCustomer(customer);
map.forEach((key, value) -> System.out.println("key = " + key + " ===> value = " + value.toString()));
}
//客户管理添加用户
@Test
@Transactional
public void addAdmin() {
UserM userm = new UserM();
userm.setCountries("测试");
userm.setProvinceId(1);
userm.setCityId(1);
userm.setPhone("13137366429");
userm.setEmail("123@gmail.com");
HashMap<String, Object> map = customerService.addAdmin(userm);
map.forEach((key, value) -> System.out.println("key = " + key + " ===> value = " + value.toString()));
}
@Test
public void queryCustomer() {
Customer customer = new Customer();
Integer pageNo = 1;
Integer pageSize = 10;
HashMap<String, Object> map = customerService.queryCustomer(customer, pageNo, pageSize);
map.forEach((key, value) -> System.out.println("key = " + key + " ===> value = " + value.toString()));
}
@Test
public void queryCustomerDetails() {
Integer customerId = 10;
HashMap<String, Object> map = customerService.queryCustomerDetails(customerId);
map.forEach((key, value) -> System.out.println("key = " + key + " ===> value = " + value.toString()));
}
//查询客户是否存在
@Test
public void queryCustomerIsExists() {
Integer schoolId = 10;
HashMap<String, Object> map = customerService.queryCustomerIsExists(schoolId);
map.forEach((key, value) -> System.out.println("key = " + key + " ===> value = " + value.toString()));
}
//删除客户
@Test
@Transactional
public void deleteCustomer() {
Customer customer = new Customer();
customer.setCountries("测试");
customer.setIndustry("测试");
customer.setProvinceId(1);
customer.setAdminName("测试");
customer.setAdminPhone("测试");
customer.setCityId(1);
customer.setCustomerType(1);
customer.setStopTime("测试");
customer.setEmail("测试");
customer.setSchoolId(1);
customer.setIndustryClassId(1);
customer.setIndustryId(1);
customer.setCustomerName("测试");
HashMap<String, Object> map = customerService.deleteCustomer(customer);
map.forEach((key, value) -> System.out.println("key = " + key + " ===> value = " + value.toString()));
}
//更新客户
@Test
@Transactional
public void updateCustomer() {
Customer customer = new Customer();
customer.setCustomerId(53);
customer.setCountries("测试");
customer.setIndustry("测试");
customer.setProvinceId(1);
customer.setAdminName("测试");
customer.setAdminPhone("测试");
customer.setCityId(1);
customer.setCustomerType(1);
customer.setStopTime("测试");
customer.setEmail("测试");
customer.setSchoolId(1);
customer.setIndustryClassId(1);
customer.setIndustryId(1);
customer.setCustomerName("测试");
HashMap<String, Object> map = customerService.updateCustomer(customer);
map.forEach((key, value) -> System.out.println("key = " + key + " ===> value = " + value.toString()));
}
//查询行业类
@Test
public void queryCustomerIndustryClass() {
HashMap<String, Object> map = customerService.queryCustomerIndustryClass();
map.forEach((key, value) -> System.out.println("key = " + key + " ===> value = " + value.toString()));
}
//查询行业
@Test
public void queryCustomerIndustry() {
Integer industryClassId = 10;
HashMap<String, Object> map = customerService.queryCustomerIndustry(industryClassId);
map.forEach((key, value) -> System.out.println("key = " + key + " ===> value = " + value.toString()));
}
}
Loading…
Cancel
Save