| | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.apache.commons.lang.StringUtils; |
| | | import org.jeecg.common.constant.CommonConstant; |
| | | import org.jeecg.common.exception.JeecgBootException; |
| | | import org.jeecg.common.system.vo.LoginUser; |
| | |
| | | import org.jeecg.modules.base.service.ILineSideWarehouseService; |
| | | import org.jeecg.modules.base.service.IShiftGroupService; |
| | | import org.jeecg.modules.base.service.IShiftService; |
| | | import org.jeecg.modules.lsw.entity.LswMaterial; |
| | | import org.jeecg.modules.lsw.entity.LswMaterialInventory; |
| | | import org.jeecg.modules.lsw.enums.MaterialCategoryEnum; |
| | | import org.jeecg.modules.lsw.service.ILswMaterialInventoryService; |
| | | import org.jeecg.modules.lsw.service.ILswMaterialService; |
| | | import org.jeecg.modules.lsw.vo.LswMaterialInventoryVo; |
| | | import org.jeecg.modules.mes.dto.MesProductionWorkScheduleRequest; |
| | | import org.jeecg.modules.mes.entity.MesKittingCompletenessCheck; |
| | |
| | | @Autowired |
| | | private IPmsProcessBillMaterialsDetailService pmsProcessBillMaterialsDetailService; |
| | | @Autowired |
| | | private ILswMaterialService lswMaterialService; |
| | | @Autowired |
| | | private ILswMaterialInventoryService lswMaterialInventoryService; |
| | | @Autowired |
| | | private ILineSideWarehouseService lineSideWarehouseService; |
| | |
| | | .limit(ChronoUnit.DAYS.between(startDate, endDate) + 1) |
| | | .collect(Collectors.toList()); |
| | | List<MesProductionWorkOrder> newProductionWorkOrderList = CollectionUtil.newArrayList(); |
| | | String materialNumber = request.getMaterialNumber(); |
| | | BigDecimal planQuantity = request.getPlanQuantity(); |
| | | if (StringUtils.isNotBlank(materialNumber)) { |
| | | LswMaterial material = lswMaterialService.list(new LambdaQueryWrapper<LswMaterial>() |
| | | .eq(LswMaterial::getMaterialNumber, materialNumber) |
| | | .eq(LswMaterial::getDelFlag, CommonConstant.DEL_FLAG_0) |
| | | .eq(LswMaterial::getMaterialStatus, CommonConstant.STATUS_1)) |
| | | .stream().findFirst().orElse(null); |
| | | request.setMaterialName(Objects.requireNonNull(material).getMaterialName()); |
| | | } |
| | | |
| | | for (LocalDate date : dateRange) { |
| | | for (String shiftId : shiftGroupMap.keySet()) { |
| | |
| | | .setShiftName(shiftNameMap.get(shiftId).getShiftName()) |
| | | .setGroupId(shiftGroup.getId()) |
| | | .setGroupName(shiftGroup.getGroupName()) |
| | | .setWorkOrderDate(workOrderDate); |
| | | .setWorkOrderDate(workOrderDate) |
| | | .setMaterialNumber(StringUtils.isNotBlank(materialNumber) ? materialNumber : "") |
| | | .setMaterialName(StringUtils.isNotBlank(materialNumber) ? request.getMaterialName() : "") |
| | | .setPlanQuantity(Objects.nonNull(planQuantity) ? planQuantity : null); |
| | | |
| | | newProductionWorkOrderList.add(mesProductionWorkOrder); |
| | | } |
| | |
| | | MesProductionWorkOrder mesProductionWorkOrder = new MesProductionWorkOrder() |
| | | .setFactoryId(factory.getId()) |
| | | .setFactoryCode(factory.getFactoryCode()) |
| | | .setFactoryName(factory.getFactoryName()); |
| | | .setFactoryName(factory.getFactoryName()) |
| | | .setMaterialNumber(StringUtils.isNotBlank(materialNumber) ? materialNumber : "") |
| | | .setMaterialName(StringUtils.isNotBlank(materialNumber) ? request.getMaterialName() : "") |
| | | .setPlanQuantity(Objects.nonNull(planQuantity) ? planQuantity : null);; |
| | | newProductionWorkOrderList.add(mesProductionWorkOrder); |
| | | } |
| | | return newProductionWorkOrderList; |