old mode 100644
new mode 100755
| | |
| | | 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.*; |
| | |
| | | public class DryOrderController extends JeecgController<DryOrder, IDryOrderService> { |
| | | @Autowired |
| | | private IDryOrderService dryOrderService; |
| | | |
| | | @Autowired |
| | | private IDryOrderTrendService dryOrderTrendService; |
| | | |
| | | /** |
| | | * 分页列表查询 |
| | |
| | | IPage<DryOrder> pageList = dryOrderService.page(page, queryWrapper); |
| | | 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); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 添加 |
| | |
| | | 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 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 |
| | |
| | | return super.importExcel(request, response, DryOrder.class); |
| | | } |
| | | |
| | | |
| | | |
| | | @ApiOperation(value="接收实时数据", notes="设备实时数据上传") |
| | | @PostMapping("/sendRealTimeData") |
| | | public void realTimeData(@RequestBody DryOrderVo orderVo) { |
| | | System.out.println("接收到实时数据:" + orderVo.toString()); |
| | | service.saveRealTimeData(orderVo); |
| | | |
| | | } |
| | | |
| | | } |