| | |
| | | |
| | | import cn.hutool.core.collection.CollectionUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | 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.jeecg.modules.pms.entity.PmsProcessBillMaterialsDetail; |
| | | import org.jeecg.modules.pms.mapper.PmsProcessBillMaterialsDetailMapper; |
| | | import org.jeecg.modules.pms.service.IPmsProcessBillMaterialsDetailService; |
| | |
| | | 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; |
| | | |
| | | /** |
| | |
| | | public class PmsProcessBillMaterialsDetailServiceImpl extends ServiceImpl<PmsProcessBillMaterialsDetailMapper, PmsProcessBillMaterialsDetail> implements IPmsProcessBillMaterialsDetailService { |
| | | |
| | | @Override |
| | | public PmsProcessBillMaterialsDetail queryByMaterialId(String materialId) { |
| | | return baseMapper.queryByMaterialId(materialId); |
| | | } |
| | | |
| | | @Override |
| | | public IPage<Map<String, Object>> getpmsProcessBillMaterialsDetailListData(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().getpmsProcessBillMaterialsDetailListData(pageData, paramMap); |
| | | public List<PmsProcessBillMaterialsDetail> queryByMaterialId(String materialId) { |
| | | LambdaQueryWrapper<PmsProcessBillMaterialsDetail> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.eq(PmsProcessBillMaterialsDetail::getMaterialId, materialId); |
| | | return baseMapper.selectList(queryWrapper); |
| | | } |
| | | |
| | | @Override |