| | |
| | | package org.jeecg.modules.mdc.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.jeecg.common.api.vo.Result; |
| | | 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.AndonOrder; |
| | | import org.jeecg.modules.mdc.service.IAndonOrderService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.servlet.ModelAndView; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.Arrays; |
| | | |
| | | /** |
| | | * @Description: andon_order |
| | |
| | | */ |
| | | @Api(tags="andon_order") |
| | | @RestController |
| | | @RequestMapping("/AndonOrder/andonOrder") |
| | | @RequestMapping("/mdc/andonOrder") |
| | | @Slf4j |
| | | public class AndonOrderController extends JeecgController<AndonOrder, IAndonOrderService> { |
| | | @Autowired |
| | | private IAndonOrderService andonOrderService; |
| | | |
| | | /** |
| | | * 分页列表查询 |
| | | * |
| | | * @param andonOrder |
| | | * @param pageNo |
| | | * @param pageSize |
| | | * @param req |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "安灯-分页列表查询") |
| | | @ApiOperation(value="安灯-分页列表查询", notes="安灯-分页列表查询") |
| | | @GetMapping(value = "/list") |
| | | public Result<?> queryPageList(AndonOrder andonOrder, |
| | | @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, |
| | | @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, |
| | | HttpServletRequest req) { |
| | | QueryWrapper<AndonOrder> queryWrapper = QueryGenerator.initQueryWrapper(andonOrder, req.getParameterMap()); |
| | | Page<AndonOrder> page = new Page<AndonOrder>(pageNo, pageSize); |
| | | IPage<AndonOrder> pageList = andonOrderService.page(page, queryWrapper); |
| | | return Result.OK(pageList); |
| | | } |
| | | |
| | | /** |
| | | * 添加 |
| | | * |
| | | * @param andonOrder |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "安灯-添加") |
| | | @ApiOperation(value="安灯-添加", notes="安灯-添加") |
| | | @PostMapping(value = "/add") |
| | | public Result<?> add(@RequestBody AndonOrder andonOrder) { |
| | | andonOrderService.save(andonOrder); |
| | | return Result.OK("添加成功!"); |
| | | } |
| | | |
| | | /** |
| | | * 通过id查询 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "安灯-通过id查询") |
| | | @ApiOperation(value="安灯-通过id查询", notes="安灯-通过id查询") |
| | | @GetMapping(value = "/queryById") |
| | | public Result<?> queryById(@RequestParam(name="id",required=true) String id) { |
| | | AndonOrder andonOrder = andonOrderService.getById(id); |
| | | return Result.OK(andonOrder); |
| | | } |
| | | |
| | | /** |
| | | * 程序呼叫 |
| | |
| | | andonOrderService.procedureCall(andonOrder); |
| | | return Result.OK("呼叫成功!"); |
| | | } |
| | | |
| | | |
| | | } |