| | |
| | | package org.jeecg.modules.dry.controller; |
| | | |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import cn.hutool.core.bean.BeanUtil; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.common.config.TenantContext; |
| | | import org.jeecg.common.system.query.QueryGenerator; |
| | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | import org.jeecg.common.system.base.controller.JeecgController; |
| | | import org.jeecg.modules.dry.service.IDryOrderTrendService; |
| | | import org.jeecg.modules.dry.vo.DryOrderTrendVo; |
| | | import org.jeecg.modules.dry.vo.DryOrderVo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.servlet.ModelAndView; |
| | |
| | | import org.apache.shiro.authz.annotation.RequiresPermissions; |
| | | |
| | | /** |
| | | * @Description: 干燥批次 |
| | | * @Description: 干燥工单 |
| | | * @Author: jeecg-boot |
| | | * @Date: 2023-03-08 |
| | | * @Version: V1.0 |
| | | */ |
| | | @Api(tags="干燥批次") |
| | | @Api(tags="干燥工单") |
| | | @RestController |
| | | @RequestMapping("/dry/dryOrder") |
| | | @Slf4j |
| | | public class DryOrderController extends JeecgController<DryOrder, IDryOrderService> { |
| | | @Autowired |
| | | private IDryOrderService dryOrderService; |
| | | |
| | | @Autowired |
| | | private IDryOrderTrendService dryOrderTrendService; |
| | | |
| | | /** |
| | | * 分页列表查询 |
| | |
| | | * @param req |
| | | * @return |
| | | */ |
| | | //@AutoLog(value = "干燥批次-分页列表查询") |
| | | @ApiOperation(value="干燥批次-分页列表查询", notes="干燥批次-分页列表查询") |
| | | //@AutoLog(value = "干燥工单-分页列表查询") |
| | | @ApiOperation(value="干燥工单-分页列表查询", notes="干燥工单-分页列表查询") |
| | | @GetMapping(value = "/list") |
| | | public Result<IPage<DryOrder>> queryPageList(DryOrder dryOrder, |
| | | @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, |
| | |
| | | return Result.OK(pageList); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value="月生产情况概览", notes="") |
| | | @GetMapping(value = "/monthOverview") |
| | | public Result<?> queryMonthOverview(@RequestParam(name="month") String month) { |
| | | int tenantId = oConvertUtils.getInt(TenantContext.getTenant(),0); |
| | | List<String> list = dryOrderService.queryMonthOverview(month, tenantId); |
| | | return Result.ok(list); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 添加 |
| | | * |
| | | * @param dryOrder |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "干燥批次-添加") |
| | | @ApiOperation(value="干燥批次-添加", notes="干燥批次-添加") |
| | | @AutoLog(value = "干燥工单-添加") |
| | | @ApiOperation(value="干燥工单-添加", notes="干燥工单-添加") |
| | | @RequiresPermissions("dry:dry_order:add") |
| | | @PostMapping(value = "/add") |
| | | public Result<String> add(@RequestBody DryOrder dryOrder) { |
| | |
| | | * @param dryOrder |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "干燥批次-编辑") |
| | | @ApiOperation(value="干燥批次-编辑", notes="干燥批次-编辑") |
| | | @AutoLog(value = "干燥工单-编辑") |
| | | @ApiOperation(value="干燥工单-编辑", notes="干燥工单-编辑") |
| | | @RequiresPermissions("dry:dry_order:edit") |
| | | @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) |
| | | public Result<String> edit(@RequestBody DryOrder dryOrder) { |
| | |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "干燥批次-通过id删除") |
| | | @ApiOperation(value="干燥批次-通过id删除", notes="干燥批次-通过id删除") |
| | | @AutoLog(value = "干燥工单-通过id删除") |
| | | @ApiOperation(value="干燥工单-通过id删除", notes="干燥工单-通过id删除") |
| | | @RequiresPermissions("dry:dry_order:delete") |
| | | @DeleteMapping(value = "/delete") |
| | | public Result<String> delete(@RequestParam(name="id",required=true) String id) { |
| | |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "干燥批次-批量删除") |
| | | @ApiOperation(value="干燥批次-批量删除", notes="干燥批次-批量删除") |
| | | @AutoLog(value = "干燥工单-批量删除") |
| | | @ApiOperation(value="干燥工单-批量删除", notes="干燥工单-批量删除") |
| | | @RequiresPermissions("dry:dry_order:deleteBatch") |
| | | @DeleteMapping(value = "/deleteBatch") |
| | | public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) { |
| | |
| | | return Result.OK("批量删除成功!"); |
| | | } |
| | | |
| | | /** |
| | | /** |
| | | * 批量下发工单 |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "干燥工单-批量下发") |
| | | @ApiOperation(value="干燥工单-批量下发", notes="干燥工单-批量下发") |
| | | @RequiresPermissions("dry:dry_order:edit") |
| | | @PostMapping(value = "/sendBatch") |
| | | public Result<String> sendBatch(@RequestParam(name="ids",required=true) String ids) { |
| | | this.dryOrderService.sendByIds(Arrays.asList(ids.split(","))); |
| | | return Result.OK("批量下发成功!"); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 通过id查询 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | //@AutoLog(value = "干燥批次-通过id查询") |
| | | @ApiOperation(value="干燥批次-通过id查询", notes="干燥批次-通过id查询") |
| | | //@AutoLog(value = "干燥工单-通过id查询") |
| | | @ApiOperation(value="干燥工单-通过id查询", notes="干燥工单-通过id查询") |
| | | @GetMapping(value = "/queryById") |
| | | public Result<DryOrder> queryById(@RequestParam(name="id",required=true) String id) { |
| | | DryOrder dryOrder = dryOrderService.getById(id); |
| | |
| | | } |
| | | return Result.OK(dryOrder); |
| | | } |
| | | |
| | | @ApiOperation(value="干燥工单-查询过程趋势数据", notes="查询过程趋势数据") |
| | | @GetMapping(value = "/queryOrderTrendById") |
| | | public Result<DryOrderVo> queryOrderTrendById(@RequestParam(name="id",required=true) String id) { |
| | | DryOrder dryOrder = dryOrderService.getById(id); |
| | | DryOrderVo orderVo; |
| | | if(dryOrder ==null) { |
| | | return Result.error("未找到对应数据"); |
| | | } |
| | | orderVo = BeanUtil.toBean(dryOrder, DryOrderVo.class); |
| | | List<DryOrderTrendVo> trendVos = dryOrderTrendService.listByOrderId(orderVo.getId()); |
| | | orderVo.setDetailList(trendVos); |
| | | return Result.OK(orderVo); |
| | | } |
| | | |
| | | /** |
| | | * 导出excel |
| | |
| | | @RequiresPermissions("dry:dry_order:exportXls") |
| | | @RequestMapping(value = "/exportXls") |
| | | public ModelAndView exportXls(HttpServletRequest request, DryOrder dryOrder) { |
| | | return super.exportXls(request, dryOrder, DryOrder.class, "干燥批次"); |
| | | return super.exportXls(request, dryOrder, DryOrder.class, "干燥工单"); |
| | | } |
| | | |
| | | /** |
| | |
| | | return super.importExcel(request, response, DryOrder.class); |
| | | } |
| | | |
| | | |
| | | } |