| | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.jeecg.common.constant.CommonConstant; |
| | | import org.jeecg.common.exception.JeecgBootException; |
| | | import org.jeecg.common.system.vo.LoginUser; |
| | | import org.jeecg.modules.base.entity.Factory; |
| | | import org.jeecg.modules.base.entity.LineSideWarehouse; |
| | | import org.jeecg.modules.base.entity.Shift; |
| | |
| | | import org.jeecg.modules.mes.service.IMesProductionWorkOrderService; |
| | | import org.jeecg.modules.mes.entity.MesProductionWorkOrder; |
| | | import org.jeecg.modules.mes.mapper.MesProductionWorkOrderMapper; |
| | | import org.jeecg.modules.mes.utils.CommonUtils; |
| | | import org.jeecg.modules.pms.entity.PmsProcessBillMaterials; |
| | | import org.jeecg.modules.pms.entity.PmsProcessBillMaterialsDetail; |
| | | import org.jeecg.modules.pms.service.IPmsProcessBillMaterialsDetailService; |
| | |
| | | .eq(ShiftGroup::getFactoryId, request.getFactoryId()) |
| | | .eq(ShiftGroup::getDelFlag, CommonConstant.DEL_FLAG_0)) |
| | | .stream().collect(Collectors.toMap(ShiftGroup::getShiftId, v1 -> v1, (v1, v2) -> v1)); |
| | | if (shiftGroupMap.isEmpty()) { |
| | | throw new JeecgBootException("该产线下未设置班组,无法排产!"); |
| | | } |
| | | Factory factory = factoryService.getById(request.getFactoryId()); |
| | | Map<String, Shift> shiftNameMap = new HashMap<>(); |
| | | List<Shift> shifts = shiftService.list(new LambdaQueryWrapper<Shift>() |
| | |
| | | @Override |
| | | public IPage<MesProductionWorkOrder> queryPageList(Page<MesProductionWorkOrder> page, Map<String, String[]> parameterMap) { |
| | | QueryWrapper<MesProductionWorkOrder> queryWrapper = Wrappers.query(); |
| | | |
| | | LoginUser loginUser = CommonUtils.getCurrentUser(); |
| | | if (loginUser == null) { |
| | | return page; |
| | | } |
| | | queryWrapper.exists("select 1 from base_user_factory t where t.user_id = {0} and t.factory_id = t1.factory_id", loginUser.getId()); |
| | | String[] factoryIds = parameterMap.get("factoryId"); |
| | | if (factoryIds != null && factoryIds.length > 0) { |
| | | queryWrapper.eq("t1.factory_id", factoryIds[0]); |
| | | } |
| | | String[] materialNumbers = parameterMap.get("materialNumber"); |
| | | if (materialNumbers != null && materialNumbers.length > 0) { |
| | | queryWrapper.like("t1.material_number", materialNumbers[0]); |
| | | } |
| | | String[] materialNames = parameterMap.get("materialName"); |
| | | if (materialNames != null && materialNames.length > 0) { |
| | | queryWrapper.like("t1.material_name", materialNames[0]); |
| | | } |
| | | String[] workOrderCodes = parameterMap.get("workOrderCode"); |
| | | if (workOrderCodes != null && workOrderCodes.length > 0) { |
| | | queryWrapper.like("t1.work_order_code", workOrderCodes[0]); |
| | | } |
| | | String[] startDates = parameterMap.get("startDate"); |
| | | String[] endDates = parameterMap.get("endDate"); |
| | | if (startDates != null && startDates.length > 0) { |