| | |
| | | package org.jeecg.modules.mes.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | 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.jeecg.modules.mes.entity.MesMaterialLoading; |
| | | import org.jeecg.modules.mes.entity.MesMaterialUnloading; |
| | | import org.jeecg.modules.mes.mapper.MesMaterialLoadingMapper; |
| | | import org.jeecg.modules.mes.service.IMesMaterialLoadingService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @Description: 上料 |
| | |
| | | @Service |
| | | public class MesMaterialLoadingServiceImpl extends ServiceImpl<MesMaterialLoadingMapper, MesMaterialLoading> implements IMesMaterialLoadingService { |
| | | |
| | | @Override |
| | | public List<MesMaterialUnloading> queryUnloadingByLoadingId(String loadingId) { |
| | | return baseMapper.queryUnloadingByLoadingId(loadingId); |
| | | } |
| | | |
| | | @Override |
| | | public List<MesMaterialLoading> queryLoadingByWorkOrderId(String workOrderId) { |
| | | return baseMapper.queryLoadingByWorkOrderId(workOrderId); |
| | | } |
| | | |
| | | @Override |
| | | public IPage<MesMaterialLoading> queryPageList(Page<MesMaterialLoading> page, Map<String, String[]> parameterMap) { |
| | | QueryWrapper<MesMaterialLoading> queryWrapper = Wrappers.query(); |
| | | String[] factoryIds = parameterMap.get("factoryId"); |
| | | if (factoryIds != null && factoryIds.length > 0) { |
| | | queryWrapper.eq("t2.factory_id", factoryIds[0]); |
| | | } |
| | | String[] workOrderIds = parameterMap.get("workOrderId"); |
| | | if (workOrderIds != null && workOrderIds.length > 0) { |
| | | queryWrapper.eq("t1.work_order_id", workOrderIds[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[] batchNumbers = parameterMap.get("batchNumber"); |
| | | if (batchNumbers != null && batchNumbers.length > 0) { |
| | | queryWrapper.like("t1.batch_number", batchNumbers[0]); |
| | | } |
| | | String[] equipmentIds = parameterMap.get("equipmentId"); |
| | | if (equipmentIds != null && equipmentIds.length > 0) { |
| | | queryWrapper.eq("t1.equipment_id", equipmentIds[0]); |
| | | } |
| | | queryWrapper.orderByDesc("t1.create_time"); |
| | | return this.baseMapper.queryPageList(page, queryWrapper); |
| | | } |
| | | } |