|
|
|
package org.jeecg.modules.erp.trad.controller;
|
|
|
|
|
|
|
|
import java.util.Arrays;
|
|
|
|
import java.util.List;
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
|
|
|
import org.jeecg.common.api.vo.Result;
|
|
|
|
import org.jeecg.common.system.query.QueryGenerator;
|
|
|
|
import org.jeecg.modules.erp.trad.entity.TblTradZong;
|
|
|
|
import org.jeecg.modules.erp.trad.service.TblTradZongService;
|
|
|
|
import org.jeecg.modules.erp.trad.entity.ViewTradZong;
|
|
|
|
import org.jeecg.modules.erp.trad.service.ViewTradZongService;
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
...
|
...
|
@@ -33,14 +32,14 @@ import org.jeecg.common.aspect.annotation.AutoLog; |
|
|
|
@RestController
|
|
|
|
@RequestMapping("/trad/tblTradZong")
|
|
|
|
@Slf4j
|
|
|
|
public class TblTradZongController extends JeecgController<TblTradZong, TblTradZongService> {
|
|
|
|
public class ViewTradZongController extends JeecgController<ViewTradZong, ViewTradZongService> {
|
|
|
|
@Autowired
|
|
|
|
private TblTradZongService tblTradZongService;
|
|
|
|
private ViewTradZongService viewTradZongService;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 分页列表查询
|
|
|
|
*
|
|
|
|
* @param tblTradZong
|
|
|
|
* @param viewTradZong
|
|
|
|
* @param pageNo
|
|
|
|
* @param pageSize
|
|
|
|
* @param req
|
|
...
|
...
|
@@ -50,47 +49,41 @@ public class TblTradZongController extends JeecgController<TblTradZong, TblTradZ |
|
|
|
@ApiOperation(value="tbl_trad_zong-分页列表查询", notes="tbl_trad_zong-分页列表查询")
|
|
|
|
@GetMapping(value = "/list")
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
public Result<IPage<TblTradZong>> queryPageList(TblTradZong tblTradZong,
|
|
|
|
public Result<IPage<ViewTradZong>> queryPageList(ViewTradZong viewTradZong,
|
|
|
|
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
|
|
|
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
|
|
|
HttpServletRequest req) {
|
|
|
|
Boolean zhi=tblTradZongService.del();
|
|
|
|
System.out.println(zhi);
|
|
|
|
|
|
|
|
tblTradZongService.getlist();
|
|
|
|
|
|
|
|
|
|
|
|
QueryWrapper<TblTradZong> queryWrapper = QueryGenerator.initQueryWrapper(tblTradZong, req.getParameterMap());
|
|
|
|
Page<TblTradZong> page = new Page<TblTradZong>(pageNo, pageSize);
|
|
|
|
IPage<TblTradZong> pageList = tblTradZongService.page(page, queryWrapper);
|
|
|
|
QueryWrapper<ViewTradZong> queryWrapper = QueryGenerator.initQueryWrapper(viewTradZong, req.getParameterMap());
|
|
|
|
Page<ViewTradZong> page = new Page<ViewTradZong>(pageNo, pageSize);
|
|
|
|
IPage<ViewTradZong> pageList = viewTradZongService.page(page, queryWrapper);
|
|
|
|
return Result.OK(pageList);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 添加
|
|
|
|
*
|
|
|
|
* @param tblTradZong
|
|
|
|
* @param viewTradZong
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
@AutoLog(value = "tbl_trad_zong-添加")
|
|
|
|
@ApiOperation(value="tbl_trad_zong-添加", notes="tbl_trad_zong-添加")
|
|
|
|
@PostMapping(value = "/add")
|
|
|
|
public Result<String> add(@RequestBody TblTradZong tblTradZong) {
|
|
|
|
tblTradZongService.save(tblTradZong);
|
|
|
|
public Result<String> add(@RequestBody ViewTradZong viewTradZong) {
|
|
|
|
viewTradZongService.save(viewTradZong);
|
|
|
|
return Result.OK("添加成功!");
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 编辑
|
|
|
|
*
|
|
|
|
* @param tblTradZong
|
|
|
|
* @param viewTradZong
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
@AutoLog(value = "tbl_trad_zong-编辑")
|
|
|
|
@ApiOperation(value="tbl_trad_zong-编辑", notes="tbl_trad_zong-编辑")
|
|
|
|
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
|
|
|
public Result<String> edit(@RequestBody TblTradZong tblTradZong) {
|
|
|
|
tblTradZongService.updateById(tblTradZong);
|
|
|
|
public Result<String> edit(@RequestBody ViewTradZong viewTradZong) {
|
|
|
|
viewTradZongService.updateById(viewTradZong);
|
|
|
|
return Result.OK("编辑成功!");
|
|
|
|
}
|
|
|
|
|
|
...
|
...
|
@@ -104,7 +97,7 @@ public class TblTradZongController extends JeecgController<TblTradZong, TblTradZ |
|
|
|
@ApiOperation(value="tbl_trad_zong-通过id删除", notes="tbl_trad_zong-通过id删除")
|
|
|
|
@DeleteMapping(value = "/delete")
|
|
|
|
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
|
|
|
|
tblTradZongService.removeById(id);
|
|
|
|
viewTradZongService.removeById(id);
|
|
|
|
return Result.OK("删除成功!");
|
|
|
|
}
|
|
|
|
|
|
...
|
...
|
@@ -118,7 +111,7 @@ public class TblTradZongController extends JeecgController<TblTradZong, TblTradZ |
|
|
|
@ApiOperation(value="tbl_trad_zong-批量删除", notes="tbl_trad_zong-批量删除")
|
|
|
|
@DeleteMapping(value = "/deleteBatch")
|
|
|
|
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
|
|
|
this.tblTradZongService.removeByIds(Arrays.asList(ids.split(",")));
|
|
|
|
this.viewTradZongService.removeByIds(Arrays.asList(ids.split(",")));
|
|
|
|
return Result.OK("批量删除成功!");
|
|
|
|
}
|
|
|
|
|
|
...
|
...
|
@@ -131,23 +124,23 @@ public class TblTradZongController extends JeecgController<TblTradZong, TblTradZ |
|
|
|
//@AutoLog(value = "tbl_trad_zong-通过id查询")
|
|
|
|
@ApiOperation(value="tbl_trad_zong-通过id查询", notes="tbl_trad_zong-通过id查询")
|
|
|
|
@GetMapping(value = "/queryById")
|
|
|
|
public Result<TblTradZong> queryById(@RequestParam(name="id",required=true) String id) {
|
|
|
|
TblTradZong tblTradZong = tblTradZongService.getById(id);
|
|
|
|
if(tblTradZong==null) {
|
|
|
|
public Result<ViewTradZong> queryById(@RequestParam(name="id",required=true) String id) {
|
|
|
|
ViewTradZong viewTradZong = viewTradZongService.getById(id);
|
|
|
|
if(viewTradZong ==null) {
|
|
|
|
return Result.error("未找到对应数据");
|
|
|
|
}
|
|
|
|
return Result.OK(tblTradZong);
|
|
|
|
return Result.OK(viewTradZong);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 导出excel
|
|
|
|
*
|
|
|
|
* @param request
|
|
|
|
* @param tblTradZong
|
|
|
|
* @param viewTradZong
|
|
|
|
*/
|
|
|
|
@RequestMapping(value = "/exportXls")
|
|
|
|
public ModelAndView exportXls(HttpServletRequest request, TblTradZong tblTradZong) {
|
|
|
|
return super.exportXls(request, tblTradZong, TblTradZong.class, "tbl_trad_zong");
|
|
|
|
public ModelAndView exportXls(HttpServletRequest request, ViewTradZong viewTradZong) {
|
|
|
|
return super.exportXls(request, viewTradZong, ViewTradZong.class, "tbl_trad_zong");
|
|
|
|
}
|
|
|
|
|
|
|
|
} |
...
|
...
|
|