master
zhiyong.ning 4 years ago
parent bd0ff253da
commit d701ee6d40
  1. 25
      src/main/java/com/yipin/liuwanr/controller/CustomerController.java
  2. 6
      src/main/java/com/yipin/liuwanr/controller/UserController.java
  3. 21
      src/main/java/com/yipin/liuwanr/entity/School.java
  4. 13
      src/main/java/com/yipin/liuwanr/mapper/CustomerMapper.java
  5. 15
      src/main/java/com/yipin/liuwanr/service/CustomerService.java

@ -2,6 +2,7 @@ package com.yipin.liuwanr.controller;
import java.util.HashMap;
import com.yipin.liuwanr.entity.School;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
@ -240,4 +241,28 @@ public class CustomerController {
}
return resp;
}
/**
* 查询学校
*/
@GetMapping("/querySchool")
Response querySchool(@RequestParam String schoolName) {
Response resp = new Response();
School school = new School();
if (schoolName!=null||schoolName!=""){
school.setSchoolName(schoolName);
}
HashMap<String, Object> ret = customerService.querySchool(school);
resp.setStatus(200);
resp.setErrmessage("Parameter effective");
int status = (int) ret.get("retcode");
if (200 == status) {
resp.setStatus(status);
resp.setMessage(ret.get("retvalue"));
} else {
resp.setStatus(status);
resp.setErrmessage(ret.get("retvalue").toString());
}
return resp;
}
}

@ -182,7 +182,7 @@ public class UserController {
throw new RuntimeException();
}
}
if(accountRole == 3){
if(accountRole == 3||accountRole==2){
HashMap<String, Object> sta = staffService.addStaff(staff);
int staStatus = (int) sta.get("retcode");
if (staStatus == 200){
@ -286,7 +286,7 @@ public class UserController {
if (200 == status) {
resp.setStatus(status);
resp.setMessage(ret.get("retvalue"));
if (roleId==3){
if (roleId==3||roleId==2){
HashMap<String, Object> sta = userService.deleteStaff(user);
int staStatus = (int) ret.get("retcode");
if (200 == staStatus) {
@ -345,7 +345,7 @@ public class UserController {
if (200 == status) {
resp.setStatus(status);
resp.setMessage(ret.get("retvalue"));
if (roleId ==3){
if (roleId ==3||roleId==2){
HashMap<String, Object> sta = userService.updateStaff(staff);
int staStatus = (int) sta.get("retcode");
if (200 == status) {

@ -8,10 +8,31 @@ public class School {
private String schoolName;
//省份
private Integer provinceId;
//省份名称
private String provinceName;
//城市
private Integer cityId;
//城市名称
private String cityName;
//层次
private Integer level;
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 Integer getSchoolId() {
return schoolId;
}

@ -2,6 +2,7 @@ package com.yipin.liuwanr.mapper;
import java.util.List;
import com.yipin.liuwanr.entity.*;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Many;
import org.apache.ibatis.annotations.One;
@ -10,12 +11,6 @@ import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import com.yipin.liuwanr.entity.ContractInformation;
import com.yipin.liuwanr.entity.CoursePermissions;
import com.yipin.liuwanr.entity.Customer;
import com.yipin.liuwanr.entity.Industry;
import com.yipin.liuwanr.entity.IndustryClass;
import com.yipin.liuwanr.entity.UserM;
import com.yipin.liuwanr.vo.CustomerVO;
public interface CustomerMapper {
@ -91,4 +86,10 @@ public interface CustomerMapper {
"</script> "})
List<Industry> queryCustomerIndustry(Integer industryClassId);
//查询行业
@Select({"<script>",
"SELECT schoolId,schoolName,provinceId,cityId,level,provinceName,cityName from school where isdel = 0",
" <if test='schoolName!=null and schoolName!=\"\"'>and schoolName like concat('%',#{schoolName},'%') </if>",
"</script> "})
List<School> querySchool(School school);
}

@ -3,6 +3,7 @@ package com.yipin.liuwanr.service;
import java.util.HashMap;
import java.util.List;
import com.yipin.liuwanr.entity.School;
import org.jboss.logging.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -166,4 +167,18 @@ public class CustomerService {
return resp;
}
//查询学校
public HashMap<String, Object> querySchool(School school){
HashMap<String, Object> resp = new HashMap<String, Object>();
try {
resp.put("retvalue", customerMapper.querySchool(school));
resp.put("retcode", 200);
} catch (RuntimeException e) {
logger.error(e.getMessage());
resp.put("retcode", 500);
resp.put("retvalue", "查询学校失败!");
return resp;
}
return resp;
}
}

Loading…
Cancel
Save