|
@@ -7,9 +7,11 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.gyee.backconfig.config.R;
|
|
|
import com.gyee.backconfig.model.auto.Companys;
|
|
|
+import com.gyee.backconfig.model.auto.Projectplan;
|
|
|
import com.gyee.backconfig.service.BackConfigService;
|
|
|
import com.gyee.backconfig.service.auto.ICompanysService;
|
|
|
import com.gyee.backconfig.vo.Companysvo;
|
|
|
+import com.gyee.backconfig.vo.Projectplanvo;
|
|
|
import com.gyee.common.model.StringUtils;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
@@ -31,6 +33,8 @@ import java.util.List;
|
|
|
public class CompanysController {
|
|
|
@Resource
|
|
|
private ICompanysService companysService;
|
|
|
+ @Resource
|
|
|
+ private BackConfigService backConfigService;
|
|
|
|
|
|
/**
|
|
|
* 查询
|
|
@@ -93,13 +97,16 @@ public class CompanysController {
|
|
|
* @param ids
|
|
|
* @return
|
|
|
*/
|
|
|
- @DeleteMapping(value = "/companys/{ids}")
|
|
|
- public R deleteAll(@PathVariable("ids") String ids){
|
|
|
+ @DeleteMapping(value = "/remove-companys/{ids}")
|
|
|
+ public R deleteAll(@PathVariable("ids") String ids) {
|
|
|
String[] strings = ids.split(",");
|
|
|
- boolean b = companysService.removeByIds(Arrays.asList(strings));
|
|
|
- if (b){
|
|
|
+
|
|
|
+ boolean b = companysService.removeByIds(Arrays.asList(strings));
|
|
|
+
|
|
|
+
|
|
|
+ if (b) {
|
|
|
return R.ok().data(b);
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
return R.error().data("删除失败!");
|
|
|
}
|
|
|
}
|
|
@@ -119,7 +126,39 @@ public class CompanysController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
+ //分页查询
|
|
|
+ @GetMapping("/listByPage")
|
|
|
+ @ResponseBody
|
|
|
+ @CrossOrigin(origins = "*", maxAge = 3600)
|
|
|
+ public R ListByPage(
|
|
|
+ @RequestParam(value = "pagenum",required = true) Integer pageNum,
|
|
|
+ @RequestParam(value = "pagesize",required = true) Integer pageSize,
|
|
|
+ @RequestParam(value = "id", required = false) String id,
|
|
|
+ @RequestParam(value = "rid", required = false) String rid,
|
|
|
+ @RequestParam(value = "name", required = false) String name,
|
|
|
+ @RequestParam(value = "version", required = false) Integer version){
|
|
|
+ Companysvo vo=new Companysvo();
|
|
|
+ setVOTemplate(pageNum, pageSize, id, rid, name,version, vo);
|
|
|
+
|
|
|
+ Page<Companys> CompanysPage = backConfigService.CompanysBypage(vo);
|
|
|
+ if (StringUtils.isNotNull(CompanysPage)) {
|
|
|
+ return R.ok().data(CompanysPage);
|
|
|
+ }else{
|
|
|
+ return R.error().message("访问失败");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ private void setVOTemplate(@RequestParam(value = "pagenum", required = true) Integer pageNum,
|
|
|
+ @RequestParam(value = "pagesize", required = true) Integer pageSize,
|
|
|
+ @RequestParam(value = "id", required = false) String id,
|
|
|
+ @RequestParam(value = "rid", required = false) String rid,
|
|
|
+ @RequestParam(value = "name", required = false) String name,
|
|
|
+ @RequestParam(value = "version", required = false) Integer version, Companysvo vo) {
|
|
|
+ vo.setId(id);
|
|
|
+ vo.setRid(rid);
|
|
|
+ vo.setName(name);
|
|
|
+ vo.setVersion(version);
|
|
|
+ vo.setCurrent(pageNum);
|
|
|
+ vo.setPageSize(pageSize);
|
|
|
+ }
|
|
|
|
|
|
}
|