| | |
| | | package org.jeecg.modules.mes.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | 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.apache.commons.lang.StringUtils; |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.common.aspect.annotation.AutoLog; |
| | | import org.jeecg.common.constant.CommonConstant; |
| | | import org.jeecg.common.system.base.controller.JeecgController; |
| | | import org.jeecg.common.system.query.QueryGenerator; |
| | | import org.jeecg.modules.mes.entity.MesProductionOrder; |
| | | import org.jeecg.modules.mes.enums.ProductionOrderStatus; |
| | | import org.jeecg.modules.mes.service.IMesProductionOrderService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * @Description: SAP生产订单 |
| | |
| | | } |
| | | return Result.OK(mesProductionOrder); |
| | | } |
| | | |
| | | @ApiOperation(value = "SAP生产订单-查询可报工的生产订单", notes = "SAP生产订单-查询可报工的生产订单") |
| | | @GetMapping(value = "/selectReportWorkOrderList") |
| | | public Result<?> selectReportWorkOrderList(MesProductionOrder mesProductionOrder) { |
| | | if (StringUtils.isBlank(mesProductionOrder.getMaterialNumber())) { |
| | | return Result.error("请传入必要的查询参数!"); |
| | | } |
| | | List<MesProductionOrder> orderList = mesProductionOrderService.list(new LambdaQueryWrapper<MesProductionOrder>() |
| | | .eq(MesProductionOrder::getMaterialNumber, mesProductionOrder.getMaterialNumber()) |
| | | .eq(MesProductionOrder::getOrderStatus, ProductionOrderStatus.REL.name()) |
| | | .eq(MesProductionOrder::getDelFlag, CommonConstant.DEL_FLAG_0) |
| | | .orderByAsc(MesProductionOrder::getPlanStart)); |
| | | List<Map<String, Object>> res = orderList.stream().map(order -> { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("title", order.getOrderCode()); |
| | | map.put("label", order.getOrderCode()); |
| | | map.put("value", order.getId()); |
| | | return map; |
| | | }).collect(Collectors.toList()); |
| | | return Result.OK(res); |
| | | } |
| | | } |