|
|
@ -78,7 +78,27 @@ public class ZyToolController extends JeecgController<ZyTool, IZyToolService> { |
|
|
|
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo, |
|
|
|
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo, |
|
|
|
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize, |
|
|
|
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize, |
|
|
|
HttpServletRequest req) throws WriterException, IOException { |
|
|
|
HttpServletRequest req) throws WriterException, IOException { |
|
|
|
QueryWrapper<ZyTool> queryWrapper = QueryGenerator.initQueryWrapper(zyTool, req.getParameterMap()); |
|
|
|
//QueryWrapper<ZyTool> queryWrapper = QueryGenerator.initQueryWrapper(zyTool, req.getParameterMap());
|
|
|
|
|
|
|
|
QueryWrapper queryWrapper=new QueryWrapper(); |
|
|
|
|
|
|
|
if(zyTool.getName()!=null){ |
|
|
|
|
|
|
|
queryWrapper.like("name",zyTool.getName()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if(zyTool.getCode()!=null){ |
|
|
|
|
|
|
|
queryWrapper.like("code",zyTool.getCode()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if(zyTool.getStatus()!=null){ |
|
|
|
|
|
|
|
queryWrapper.eq("status",zyTool.getStatus()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if(zyTool.getBrandId()!=null){ |
|
|
|
|
|
|
|
String s="%"+zyTool.getBrandId()+"%"; |
|
|
|
|
|
|
|
List<String> brand=zyToolService.findAllBrand(s); |
|
|
|
|
|
|
|
queryWrapper.in("brand_id",brand); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if(zyTool.getModelId()!=null){ |
|
|
|
|
|
|
|
String s="%"+zyTool.getModelId()+"%"; |
|
|
|
|
|
|
|
List<String> model=zyToolService.findAllModel(s); |
|
|
|
|
|
|
|
queryWrapper.in("model_id",model); |
|
|
|
|
|
|
|
} |
|
|
|
Page<ZyTool> page = new Page<ZyTool>(pageNo, pageSize); |
|
|
|
Page<ZyTool> page = new Page<ZyTool>(pageNo, pageSize); |
|
|
|
IPage<ZyTool> pageList = zyToolService.page(page, queryWrapper); |
|
|
|
IPage<ZyTool> pageList = zyToolService.page(page, queryWrapper); |
|
|
|
MultiFormatWriter multiFormatWriter = new MultiFormatWriter(); |
|
|
|
MultiFormatWriter multiFormatWriter = new MultiFormatWriter(); |
|
|
@ -192,6 +212,10 @@ public class ZyToolController extends JeecgController<ZyTool, IZyToolService> { |
|
|
|
@ApiOperation(value="工具表-通过id删除", notes="工具表-通过id删除") |
|
|
|
@ApiOperation(value="工具表-通过id删除", notes="工具表-通过id删除") |
|
|
|
@DeleteMapping(value = "/delete") |
|
|
|
@DeleteMapping(value = "/delete") |
|
|
|
public Result<?> delete(@RequestParam(name="id",required=true) String id) { |
|
|
|
public Result<?> delete(@RequestParam(name="id",required=true) String id) { |
|
|
|
|
|
|
|
int a=zyToolService.find(id); |
|
|
|
|
|
|
|
if(a>=1){ |
|
|
|
|
|
|
|
return Result.error("有工序使用本工具,删除失败!!!"); |
|
|
|
|
|
|
|
} |
|
|
|
zyToolService.removeById(id); |
|
|
|
zyToolService.removeById(id); |
|
|
|
return Result.OK("删除成功!"); |
|
|
|
return Result.OK("删除成功!"); |
|
|
|
} |
|
|
|
} |
|
|
|