Lius
2024-10-21 316ef1bf39d16a29c27fe26393e704c1d0b963f9
lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/controller/MdcComponentInfoController.java
ÎļþÃû´Ó lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/controller/ComponentInfoController.java ÐÞ¸Ä
@@ -10,8 +10,8 @@
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.modules.mdc.entity.ComponentInfo;
import org.jeecg.modules.mdc.service.IComponentInfoService;
import org.jeecg.modules.mdc.entity.MdcComponentInfo;
import org.jeecg.modules.mdc.service.IMdcComponentInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
@@ -24,21 +24,21 @@
/**
 * @Description: é›¶ä»¶è¡¨
 * @Author: lius
 * @Date: 2024-10-18
 * @Date: 2024-10-21
 * @Version: V1.0
 */
@Slf4j
@Api(tags = "零件表")
@RestController
@RequestMapping("/mdc/componentInfo")
public class ComponentInfoController extends JeecgController<ComponentInfo, IComponentInfoService> {
@RequestMapping("/mdc/mdcComponentInfo")
public class MdcComponentInfoController extends JeecgController<MdcComponentInfo, IMdcComponentInfoService> {
    @Resource
    private IComponentInfoService componentInfoService;
    private IMdcComponentInfoService mdcComponentInfoService;
    /**
     * åˆ†é¡µåˆ—表查询
     *
     * @param componentInfo
     * @param mdcComponentInfo
     * @param pageNo
     * @param pageSize
     * @param req
@@ -47,41 +47,41 @@
    @AutoLog(value = "零件表-分页列表查询")
    @ApiOperation(value = "零件表-分页列表查询", notes = "零件表-分页列表查询")
    @GetMapping(value = "/list")
    public Result<?> queryPageList(ComponentInfo componentInfo,
    public Result<?> queryPageList(MdcComponentInfo mdcComponentInfo,
                                   @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
                                   @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
                                   HttpServletRequest req) {
        QueryWrapper<ComponentInfo> queryWrapper = QueryGenerator.initQueryWrapper(componentInfo, req.getParameterMap());
        Page<ComponentInfo> page = new Page<ComponentInfo>(pageNo, pageSize);
        IPage<ComponentInfo> pageList = componentInfoService.page(page, queryWrapper);
        QueryWrapper<MdcComponentInfo> queryWrapper = QueryGenerator.initQueryWrapper(mdcComponentInfo, req.getParameterMap());
        Page<MdcComponentInfo> page = new Page<MdcComponentInfo>(pageNo, pageSize);
        IPage<MdcComponentInfo> pageList = mdcComponentInfoService.page(page);
        return Result.OK(pageList);
    }
    /**
     * æ·»åŠ 
     *
     * @param componentInfo
     * @param mdcComponentInfo
     * @return
     */
    @AutoLog(value = "零件表-添加")
    @ApiOperation(value = "零件表-添加", notes = "零件表-添加")
    @PostMapping(value = "/add")
    public Result<?> add(@RequestBody ComponentInfo componentInfo) {
        componentInfoService.save(componentInfo);
    public Result<?> add(@RequestBody MdcComponentInfo mdcComponentInfo) {
        mdcComponentInfoService.save(mdcComponentInfo);
        return Result.OK("添加成功!");
    }
    /**
     * ç¼–辑
     *
     * @param componentInfo
     * @param mdcComponentInfo
     * @return
     */
    @AutoLog(value = "零件表-编辑")
    @ApiOperation(value = "零件表-编辑", notes = "零件表-编辑")
    @RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
    public Result<?> edit(@RequestBody ComponentInfo componentInfo) {
        componentInfoService.updateById(componentInfo);
    public Result<?> edit(@RequestBody MdcComponentInfo mdcComponentInfo) {
        mdcComponentInfoService.updateById(mdcComponentInfo);
        return Result.OK("编辑成功!");
    }
@@ -95,7 +95,7 @@
    @ApiOperation(value = "零件表-通过id删除", notes = "零件表-通过id删除")
    @DeleteMapping(value = "/delete")
    public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
        componentInfoService.removeById(id);
        mdcComponentInfoService.removeById(id);
        return Result.OK("删除成功!");
    }
@@ -109,7 +109,7 @@
    @ApiOperation(value = "零件表-批量删除", notes = "零件表-批量删除")
    @DeleteMapping(value = "/deleteBatch")
    public Result<?> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
        this.componentInfoService.removeByIds(Arrays.asList(ids.split(",")));
        this.mdcComponentInfoService.removeByIds(Arrays.asList(ids.split(",")));
        return Result.OK("批量删除成功!");
    }
@@ -123,19 +123,19 @@
    @ApiOperation(value = "零件表-通过id查询", notes = "零件表-通过id查询")
    @GetMapping(value = "/queryById")
    public Result<?> queryById(@RequestParam(name = "id", required = true) String id) {
        ComponentInfo componentInfo = componentInfoService.getById(id);
        return Result.OK(componentInfo);
        MdcComponentInfo mdcComponentInfo = mdcComponentInfoService.getById(id);
        return Result.OK(mdcComponentInfo);
    }
    /**
     * å¯¼å‡ºexcel
     *
     * @param request
     * @param componentInfo
     * @param mdcComponentInfo
     */
    @RequestMapping(value = "/exportXls")
    public ModelAndView exportXls(HttpServletRequest request, ComponentInfo componentInfo) {
        return super.exportXls(request, componentInfo, ComponentInfo.class, "零件表");
    public ModelAndView exportXls(HttpServletRequest request, MdcComponentInfo mdcComponentInfo) {
        return super.exportXls(request, mdcComponentInfo, MdcComponentInfo.class, "零件表");
    }
    /**
@@ -147,7 +147,7 @@
     */
    @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
    public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
        return super.importExcel(request, response, ComponentInfo.class);
        return super.importExcel(request, response, MdcComponentInfo.class);
    }
}