新火炬后端单体项目初始化代码
zhangherong
3 天以前 43f0e69715099cfc8c8b8ea5284b874bfad14400
src/main/java/org/jeecg/modules/andon/controller/AndonButtonConfigController.java
@@ -10,8 +10,11 @@
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.andon.dto.AndonButtonDTO;
import org.jeecg.modules.andon.dto.AndonOrdeDto;
import org.jeecg.modules.andon.entity.AndonButtonConfig;
import org.jeecg.modules.andon.service.IAndonButtonConfigService;
import org.jeecg.modules.andon.service.impl.AndonOrderServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
@@ -19,143 +22,199 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Arrays;
import java.util.List;
/**
* @Description: 安灯按钮配置
* @Author: jeecg-boot
* @Date:   2025-07-10
* @Version: V1.0
*/
@Api(tags="安灯按钮配置")
 * @Description: 安灯按钮配置
 * @Author: jeecg-boot
 * @Date: 2025-07-10
 * @Version: V1.0
 */
@Api(tags = "安灯按钮配置")
@RestController
@RequestMapping("/andonbuttonconfig/andonButtonConfig")
@Slf4j
public class AndonButtonConfigController extends JeecgController<AndonButtonConfig, IAndonButtonConfigService> {
   @Autowired
   private IAndonButtonConfigService andonButtonConfigService;
    @Autowired
    private IAndonButtonConfigService andonButtonConfigService;
    @Autowired
    private AndonOrderServiceImpl andonOrderServiceImpl;
   /**
    * 分页列表查询
    *
    * @param andonButtonConfig
    * @param pageNo
    * @param pageSize
    * @param req
    * @return
    */
   //@AutoLog(value = "安灯按钮配置-分页列表查询")
   @ApiOperation(value="安灯按钮配置-分页列表查询", notes="安灯按钮配置-分页列表查询")
   @GetMapping(value = "/list")
   public Result<IPage<AndonButtonConfig>> queryPageList(AndonButtonConfig andonButtonConfig,
                                  @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
                                  @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
                                  HttpServletRequest req) {
       QueryWrapper<AndonButtonConfig> queryWrapper = QueryGenerator.initQueryWrapper(andonButtonConfig, req.getParameterMap());
       Page<AndonButtonConfig> page = new Page<AndonButtonConfig>(pageNo, pageSize);
       IPage<AndonButtonConfig> pageList = andonButtonConfigService.page(page, queryWrapper);
       return Result.OK(pageList);
   }
    /**
     * 分页列表查询
     *
     * @param andonButtonConfig
     * @param pageNo
     * @param pageSize
     * @param req
     * @return
     */
    //@AutoLog(value = "安灯按钮配置-分页列表查询")
    @ApiOperation(value = "安灯按钮配置-分页列表查询", notes = "安灯按钮配置-分页列表查询")
    @GetMapping(value = "/list")
    public Result<IPage<AndonButtonConfig>> queryPageList(AndonButtonConfig andonButtonConfig,
                                                          @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
                                                          @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
                                                          HttpServletRequest req) {
        QueryWrapper<AndonButtonConfig> queryWrapper = QueryGenerator.initQueryWrapper(andonButtonConfig, req.getParameterMap());
        Page<AndonButtonConfig> page = new Page<AndonButtonConfig>(pageNo, pageSize);
        IPage<AndonButtonConfig> pageList = andonButtonConfigService.page(page, queryWrapper);
        return Result.OK(pageList);
    }
   /**
    *   添加
    *
    * @param andonButtonConfig
    * @return
    */
   @AutoLog(value = "安灯按钮配置-添加")
   @ApiOperation(value="安灯按钮配置-添加", notes="安灯按钮配置-添加")
   //@RequiresPermissions("org.jeecg.modules:andon_button_config:add")
   @PostMapping(value = "/add")
   public Result<String> add(@RequestBody AndonButtonConfig andonButtonConfig) {
       andonButtonConfigService.save(andonButtonConfig);
       return Result.OK("添加成功!");
   }
   /**
    *  编辑
    *
    * @param andonButtonConfig
    * @return
    */
   @AutoLog(value = "安灯按钮配置-编辑")
   @ApiOperation(value="安灯按钮配置-编辑", notes="安灯按钮配置-编辑")
   //@RequiresPermissions("org.jeecg.modules:andon_button_config:edit")
   @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
   public Result<String> edit(@RequestBody AndonButtonConfig andonButtonConfig) {
       andonButtonConfigService.updateById(andonButtonConfig);
       return Result.OK("编辑成功!");
   }
    /**
     * APP安灯按钮列表查询
     *
     * @param factoryId
     * @return
     */
    @ApiOperation(value = "安灯按钮配置-分页列表查询", notes = "安灯按钮配置-分页列表查询")
    @GetMapping(value = "/queryUserAndonButtonList")
    public Result<List<AndonButtonDTO>> queryUserAndonButtonList(@RequestParam("factoryId") String factoryId) {
        List<AndonButtonDTO> list = andonButtonConfigService.queryUserAndonButtonList(factoryId);
        return Result.OK(list);
    }
   /**
    *   通过id删除
    *
    * @param id
    * @return
    */
   @AutoLog(value = "安灯按钮配置-通过id删除")
   @ApiOperation(value="安灯按钮配置-通过id删除", notes="安灯按钮配置-通过id删除")
   //@RequiresPermissions("org.jeecg.modules:andon_button_config:delete")
   @DeleteMapping(value = "/delete")
   public Result<String> delete(@RequestParam(name="id",required=true) String id) {
       andonButtonConfigService.removeById(id);
       return Result.OK("删除成功!");
   }
   /**
    *  批量删除
    *
    * @param ids
    * @return
    */
   @AutoLog(value = "安灯按钮配置-批量删除")
   @ApiOperation(value="安灯按钮配置-批量删除", notes="安灯按钮配置-批量删除")
   //@RequiresPermissions("org.jeecg.modules:andon_button_config:deleteBatch")
   @DeleteMapping(value = "/deleteBatch")
   public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
       this.andonButtonConfigService.removeByIds(Arrays.asList(ids.split(",")));
       return Result.OK("批量删除成功!");
   }
    /**
     * APP安灯发起列表查询
     *
     * @param factoryId
     * @return
     */
    @ApiOperation(value = "安灯发起-分页列表查询", notes = "安灯发起-分页列表查询")
    @GetMapping(value = "/queryUserAndonCallList")
    public Result<List<AndonOrdeDto>> queryUserAndonCallList(@RequestParam("factoryId") String factoryId, @RequestParam("orderStatus") String orderStatus) {
        List<AndonOrdeDto> list = andonButtonConfigService.queryUserAndonCallList(factoryId,orderStatus);
        return Result.OK(list);
    }
   /**
    * 通过id查询
    *
    * @param id
    * @return
    */
   //@AutoLog(value = "安灯按钮配置-通过id查询")
   @ApiOperation(value="安灯按钮配置-通过id查询", notes="安灯按钮配置-通过id查询")
   @GetMapping(value = "/queryById")
   public Result<AndonButtonConfig> queryById(@RequestParam(name="id",required=true) String id) {
       AndonButtonConfig andonButtonConfig = andonButtonConfigService.getById(id);
       if(andonButtonConfig==null) {
           return Result.error("未找到对应数据");
       }
       return Result.OK(andonButtonConfig);
   }
    /**
     * APP安灯响应列表查询
     *
     * @param factoryId
     * @return
     */
    @ApiOperation(value = "安灯响应-分页列表查询", notes = "安灯响应-分页列表查询")
    @GetMapping(value = "/queryUserAndonRespondList")
    public Result<List<AndonOrdeDto>> queryUserAndonRespondList(@RequestParam("factoryId") String factoryId, @RequestParam("orderStatus") String orderStatus) {
        List<AndonOrdeDto> list = andonButtonConfigService.queryUserAndonRespondList(factoryId,orderStatus);
        return Result.OK(list);
    }
   /**
   * 导出excel
   *
   * @param request
   * @param andonButtonConfig
   */
   //@RequiresPermissions("org.jeecg.modules:andon_button_config:exportXls")
   @RequestMapping(value = "/exportXls")
   public ModelAndView exportXls(HttpServletRequest request, AndonButtonConfig andonButtonConfig) {
       return super.exportXls(request, andonButtonConfig, AndonButtonConfig.class, "安灯按钮配置");
   }
    /**
     * APP安灯已处理列表查询
     *
     * @param factoryId
     * @return
     */
    @ApiOperation(value = "安灯响应-分页列表查询", notes = "安灯响应-分页列表查询")
    @GetMapping(value = "/queryUserAndonHandelList")
    public Result<List<AndonOrdeDto>> queryUserAndonHandelList(@RequestParam("factoryId") String factoryId ,@RequestParam("orderStatus") String orderStatus) {
        List<AndonOrdeDto> list = andonButtonConfigService.queryUserAndonHandelList(factoryId,orderStatus);
        return Result.OK(list);
    }
    /**
     * 添加
     *
     * @param andonButtonConfig
     * @return
     */
    @AutoLog(value = "安灯按钮配置-添加")
    @ApiOperation(value = "安灯按钮配置-添加", notes = "安灯按钮配置-添加")
    //@RequiresPermissions("org.jeecg.modules:andon_button_config:add")
    @PostMapping(value = "/add")
    public Result<String> add(@RequestBody AndonButtonConfig andonButtonConfig) {
        andonButtonConfigService.save(andonButtonConfig);
        return Result.OK("添加成功!");
    }
   /**
    /**
     * 编辑
     *
     * @param andonButtonConfig
     * @return
     */
    @AutoLog(value = "安灯按钮配置-编辑")
    @ApiOperation(value = "安灯按钮配置-编辑", notes = "安灯按钮配置-编辑")
    //@RequiresPermissions("org.jeecg.modules:andon_button_config:edit")
    @RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
    public Result<String> edit(@RequestBody AndonButtonConfig andonButtonConfig) {
        andonButtonConfigService.updateById(andonButtonConfig);
        return Result.OK("编辑成功!");
    }
    /**
     * 通过id删除
     *
     * @param id
     * @return
     */
    @AutoLog(value = "安灯按钮配置-通过id删除")
    @ApiOperation(value = "安灯按钮配置-通过id删除", notes = "安灯按钮配置-通过id删除")
    //@RequiresPermissions("org.jeecg.modules:andon_button_config:delete")
    @DeleteMapping(value = "/delete")
    public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
        andonButtonConfigService.removeById(id);
        return Result.OK("删除成功!");
    }
    /**
     * 批量删除
     *
     * @param ids
     * @return
     */
    @AutoLog(value = "安灯按钮配置-批量删除")
    @ApiOperation(value = "安灯按钮配置-批量删除", notes = "安灯按钮配置-批量删除")
    //@RequiresPermissions("org.jeecg.modules:andon_button_config:deleteBatch")
    @DeleteMapping(value = "/deleteBatch")
    public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
        this.andonButtonConfigService.removeByIds(Arrays.asList(ids.split(",")));
        return Result.OK("批量删除成功!");
    }
    /**
     * 通过id查询
     *
     * @param id
     * @return
     */
    //@AutoLog(value = "安灯按钮配置-通过id查询")
    @ApiOperation(value = "安灯按钮配置-通过id查询", notes = "安灯按钮配置-通过id查询")
    @GetMapping(value = "/queryById")
    public Result<AndonButtonConfig> queryById(@RequestParam(name = "id", required = true) String id) {
        AndonButtonConfig andonButtonConfig = andonButtonConfigService.getById(id);
        if (andonButtonConfig == null) {
            return Result.error("未找到对应数据");
        }
        return Result.OK(andonButtonConfig);
    }
    /**
     * 导出excel
     *
     * @param request
     * @param andonButtonConfig
     */
    //@RequiresPermissions("org.jeecg.modules:andon_button_config:exportXls")
    @RequestMapping(value = "/exportXls")
    public ModelAndView exportXls(HttpServletRequest request, AndonButtonConfig andonButtonConfig) {
        return super.exportXls(request, andonButtonConfig, AndonButtonConfig.class, "安灯按钮配置");
    }
    /**
     * 通过excel导入数据
   *
   * @param request
   * @param response
   * @return
   */
   //@RequiresPermissions("andon_button_config:importExcel")
   @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
   public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
       return super.importExcel(request, response, AndonButtonConfig.class);
   }
     *
     * @param request
     * @param response
     * @return
     */
    //@RequiresPermissions("andon_button_config:importExcel")
    @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
    public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
        return super.importExcel(request, response, AndonButtonConfig.class);
    }
}