ÎļþÃû´Ó lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/controller/ComponentInfoController.java ÐÞ¸Ä |
| | |
| | | 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; |
| | |
| | | /** |
| | | * @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 |
| | |
| | | @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("ç¼è¾æå!"); |
| | | } |
| | | |
| | |
| | | @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("å 餿å!"); |
| | | } |
| | | |
| | |
| | | @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("æ¹éå 餿åï¼"); |
| | | } |
| | | |
| | |
| | | @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, "é¶ä»¶è¡¨"); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @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); |
| | | } |
| | | |
| | | } |