| | |
| | | |
| | | import cn.hutool.core.collection.CollectionUtil; |
| | | 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 com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.apache.commons.lang.StringUtils; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.jeecg.modules.mes.entity.MesProductionOrder; |
| | | import org.jeecg.modules.pms.entity.PmsMaterialProcess; |
| | | import org.jeecg.modules.pms.mapper.PmsMaterialProcessMapper; |
| | |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | |
| | | */ |
| | | @Service |
| | | public class PmsMaterialProcessServiceImpl extends ServiceImpl<PmsMaterialProcessMapper, PmsMaterialProcess> implements IPmsMaterialProcessService { |
| | | |
| | | @Override |
| | | public IPage<Map<String, Object>> getpmsMaterialProcessListData(Integer pageNo, Integer pageSize, HttpServletRequest req) { |
| | | IPage<Map> pageData = new Page<Map>(pageNo, pageSize); |
| | | Map<String, String> paramMap = new HashMap<String, String>(); |
| | | Map<String, String[]> parameterMap = req.getParameterMap(); |
| | | if (null != parameterMap) { |
| | | if (parameterMap.containsKey("materialNumber") && StringUtils.isNotBlank(parameterMap.get("materialNumber")[0])) { |
| | | paramMap.put("materialNumber", parameterMap.get("materialNumber")[0]); |
| | | } |
| | | if (parameterMap.containsKey("materialName") && StringUtils.isNotBlank(parameterMap.get("materialName")[0])) { |
| | | paramMap.put("materialName", parameterMap.get("materialName")[0].trim()); |
| | | } |
| | | if (parameterMap.containsKey("batchNumber") && StringUtils.isNotBlank(parameterMap.get("batchNumber")[0])) { |
| | | paramMap.put("batchNumber", parameterMap.get("batchNumber")[0].trim()); |
| | | } |
| | | } |
| | | return super.getBaseMapper().getpmsMaterialProcessListData(pageData, paramMap); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | |
| | | queryWrapper.eq(PmsMaterialProcess::getOrderId, orderId); |
| | | super.remove(queryWrapper); |
| | | } |
| | | |
| | | @Override |
| | | public IPage<PmsMaterialProcess> queryPageList(Page<PmsMaterialProcess> page, PmsMaterialProcess query) { |
| | | QueryWrapper<PmsMaterialProcess> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.orderByDesc("pbm.create_time"); |
| | | if (query != null) { |
| | | //物料编码 模糊查询 |
| | | if (org.apache.commons.lang3.StringUtils.isNotBlank(query.getMaterialNumber())) { |
| | | queryWrapper.like("pbm.material_number", query.getMaterialNumber()); |
| | | } |
| | | //物料名称 模糊查询 |
| | | if (org.apache.commons.lang3.StringUtils.isNotBlank(query.getMaterialName())) { |
| | | queryWrapper.like("pbm.material_name", query.getMaterialName()); |
| | | } |
| | | //工序号 模糊查询 |
| | | if (StringUtils.isNotBlank(query.getProcessCode())) { |
| | | queryWrapper.like("pbm.process_code", query.getProcessCode()); |
| | | } |
| | | //订单号 模糊查询 |
| | | if (StringUtils.isNotBlank(query.getOrderCode())) { |
| | | queryWrapper.like("po.order_code", query.getOrderCode()); |
| | | } |
| | | } |
| | | return this.getBaseMapper().queryPageList(page, queryWrapper); |
| | | } |
| | | } |