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. 15
      src/main/java/com/yipin/liuwanr/mapper/CustomerMapper.java
  5. 17
      src/main/java/com/yipin/liuwanr/service/CustomerService.java

@ -2,6 +2,7 @@ package com.yipin.liuwanr.controller;
import java.util.HashMap; import java.util.HashMap;
import com.yipin.liuwanr.entity.School;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin; import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
@ -240,4 +241,28 @@ public class CustomerController {
} }
return resp; 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(); throw new RuntimeException();
} }
} }
if(accountRole == 3){ if(accountRole == 3||accountRole==2){
HashMap<String, Object> sta = staffService.addStaff(staff); HashMap<String, Object> sta = staffService.addStaff(staff);
int staStatus = (int) sta.get("retcode"); int staStatus = (int) sta.get("retcode");
if (staStatus == 200){ if (staStatus == 200){
@ -286,7 +286,7 @@ public class UserController {
if (200 == status) { if (200 == status) {
resp.setStatus(status); resp.setStatus(status);
resp.setMessage(ret.get("retvalue")); resp.setMessage(ret.get("retvalue"));
if (roleId==3){ if (roleId==3||roleId==2){
HashMap<String, Object> sta = userService.deleteStaff(user); HashMap<String, Object> sta = userService.deleteStaff(user);
int staStatus = (int) ret.get("retcode"); int staStatus = (int) ret.get("retcode");
if (200 == staStatus) { if (200 == staStatus) {
@ -345,7 +345,7 @@ public class UserController {
if (200 == status) { if (200 == status) {
resp.setStatus(status); resp.setStatus(status);
resp.setMessage(ret.get("retvalue")); resp.setMessage(ret.get("retvalue"));
if (roleId ==3){ if (roleId ==3||roleId==2){
HashMap<String, Object> sta = userService.updateStaff(staff); HashMap<String, Object> sta = userService.updateStaff(staff);
int staStatus = (int) sta.get("retcode"); int staStatus = (int) sta.get("retcode");
if (200 == status) { if (200 == status) {

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

@ -2,6 +2,7 @@ package com.yipin.liuwanr.mapper;
import java.util.List; import java.util.List;
import com.yipin.liuwanr.entity.*;
import org.apache.ibatis.annotations.Insert; import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Many; import org.apache.ibatis.annotations.Many;
import org.apache.ibatis.annotations.One; 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.Select;
import org.apache.ibatis.annotations.Update; 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; import com.yipin.liuwanr.vo.CustomerVO;
public interface CustomerMapper { public interface CustomerMapper {
@ -90,5 +85,11 @@ public interface CustomerMapper {
"SELECT industryId,industryClassId,industryName from hr_industry where industryClassId = #{industryClassId}", "SELECT industryId,industryClassId,industryName from hr_industry where industryClassId = #{industryClassId}",
"</script> "}) "</script> "})
List<Industry> queryCustomerIndustry(Integer industryClassId); 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.HashMap;
import java.util.List; import java.util.List;
import com.yipin.liuwanr.entity.School;
import org.jboss.logging.Logger; import org.jboss.logging.Logger;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -165,5 +166,19 @@ public class CustomerService {
} }
return resp; 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