|
@@ -6,11 +6,13 @@ import com.hssx.cloudmodel.entity.Company;
|
|
import com.hssx.cloudmodel.entity.Role;
|
|
import com.hssx.cloudmodel.entity.Role;
|
|
import com.hssx.cloudmodel.service.CompanyService;
|
|
import com.hssx.cloudmodel.service.CompanyService;
|
|
import com.hssx.cloudmodel.util.HttpRespMsg;
|
|
import com.hssx.cloudmodel.util.HttpRespMsg;
|
|
|
|
+import com.hssx.cloudmodel.util.PageUtil;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Controller;
|
|
import org.springframework.stereotype.Controller;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
+import org.springframework.web.bind.annotation.RequestParam;
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
@@ -18,7 +20,6 @@ import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
- *
|
|
|
|
* @author 吴涛涛
|
|
* @author 吴涛涛
|
|
* @since 2019-07-26
|
|
* @since 2019-07-26
|
|
*/
|
|
*/
|
|
@@ -32,9 +33,9 @@ public class CompanyController {
|
|
|
|
|
|
/**
|
|
/**
|
|
* 添加/修改公司
|
|
* 添加/修改公司
|
|
- * @param company
|
|
|
|
- * 参数:companyName 公司名 companyAddress 公司地址
|
|
|
|
- * @param flag 0-添加,1-修改
|
|
|
|
|
|
+ *
|
|
|
|
+ * @param company 参数:companyName 公司名 companyAddress 公司地址
|
|
|
|
+ * @param flag 0-添加,1-修改
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
@ApiOperation("添加/修改公司")
|
|
@ApiOperation("添加/修改公司")
|
|
@@ -43,21 +44,21 @@ public class CompanyController {
|
|
public HttpRespMsg addAndUpdateRole(Company company, HttpServletRequest request, Integer flag,
|
|
public HttpRespMsg addAndUpdateRole(Company company, HttpServletRequest request, Integer flag,
|
|
HttpServletResponse response) {
|
|
HttpServletResponse response) {
|
|
HttpRespMsg msg = new HttpRespMsg();
|
|
HttpRespMsg msg = new HttpRespMsg();
|
|
- msg = companyService.addAndUpdateRole(company,flag);
|
|
|
|
|
|
+ msg = companyService.addAndUpdateRole(company, flag);
|
|
return msg;
|
|
return msg;
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
* 删除公司
|
|
* 删除公司
|
|
- * @param company
|
|
|
|
- * 参数 id 公司id
|
|
|
|
|
|
+ *
|
|
|
|
+ * @param company 参数 id 公司id
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
@ApiOperation("删除公司")
|
|
@ApiOperation("删除公司")
|
|
@RequestMapping("/delete")
|
|
@RequestMapping("/delete")
|
|
@ResponseBody
|
|
@ResponseBody
|
|
public HttpRespMsg delete(Company company, HttpServletRequest request,
|
|
public HttpRespMsg delete(Company company, HttpServletRequest request,
|
|
- HttpServletResponse response) {
|
|
|
|
|
|
+ HttpServletResponse response) {
|
|
HttpRespMsg msg = new HttpRespMsg();
|
|
HttpRespMsg msg = new HttpRespMsg();
|
|
msg.data = companyService.removeById(company.getId());
|
|
msg.data = companyService.removeById(company.getId());
|
|
return msg;
|
|
return msg;
|
|
@@ -65,18 +66,17 @@ public class CompanyController {
|
|
|
|
|
|
/**
|
|
/**
|
|
* 公司列表
|
|
* 公司列表
|
|
- * @param keyName 关键字查询 根据公司名称检索
|
|
|
|
|
|
+ * @param keyName
|
|
|
|
+ * 参数:currentPage 当前页码,pageSize 每页条数 keyName 关键字查询
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
@ApiOperation("公司列表")
|
|
@ApiOperation("公司列表")
|
|
@RequestMapping("/list")
|
|
@RequestMapping("/list")
|
|
@ResponseBody
|
|
@ResponseBody
|
|
- public HttpRespMsg deleteRole(String keyName, HttpServletRequest request,
|
|
|
|
- HttpServletResponse response) {
|
|
|
|
|
|
+ public HttpRespMsg deleteRole(@RequestParam(required = false)String keyName, HttpServletRequest request,
|
|
|
|
+ HttpServletResponse response, PageUtil page) {
|
|
HttpRespMsg msg = new HttpRespMsg();
|
|
HttpRespMsg msg = new HttpRespMsg();
|
|
- QueryWrapper<Company> qw = new QueryWrapper<>();
|
|
|
|
- qw.like("company_name",keyName);
|
|
|
|
- msg.data = companyService.list(qw);
|
|
|
|
|
|
+ msg.data = companyService.pageList(page,keyName);
|
|
return msg;
|
|
return msg;
|
|
}
|
|
}
|
|
|
|
|