| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import org.apache.commons.lang.StringUtils; |
| | | import org.jeecg.common.exception.ExceptionCast; |
| | | import org.jeecg.modules.tms.entity.ToolLedgerDetail; |
| | | import org.jeecg.modules.tms.mapper.ToolLedgerDetailMapper; |
| | | import org.jeecg.modules.tms.service.IToolLedgerDetailService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | |
| | | if (statuses != null && statuses.length > 0) { |
| | | queryWrapper.eq("t.status", statuses[0]); |
| | | } |
| | | String[] quantities = parameterMap.get("quantity"); |
| | | if (quantities != null && quantities.length > 0) { |
| | | queryWrapper.gt("t.quantity", quantities[0]); |
| | | } |
| | | String[] classifyIds = parameterMap.get("classifyId"); |
| | | if (classifyIds != null && classifyIds.length > 0) { |
| | | queryWrapper.eq("p.classify_id", classifyIds[0]); |
| | | } |
| | | String[] excludeIds = parameterMap.get("excludeIds"); |
| | | if (excludeIds != null && excludeIds.length > 0) { |
| | | String[] idArray = excludeIds[0].split(","); |
| | | queryWrapper.notIn("t.id", idArray); |
| | | } |
| | | return this.baseMapper.queryPageList(page, queryWrapper); |
| | | } |
| | | |
| | | @Override |
| | | public IPage<Map<String, Object>> queryLendTool(Integer pageNo, Integer pageSize, Map<String, String> query) { |
| | | |
| | | if (pageNo == null || pageNo < 1 || pageSize == null || pageSize < 1) { |
| | | ExceptionCast.cast("参数错误"); |
| | | } |
| | | IPage<Map> pageData = new Page<Map>(pageNo, pageSize); |
| | | QueryWrapper<Map> queryWrapper = Wrappers.query(); |
| | | if (null != query) { |
| | | String toolCode = query.get("toolCode"); |
| | | if (StringUtils.isNotBlank(toolCode)) { |
| | | queryWrapper.like("p.tool_code", toolCode); |
| | | } |
| | | String status = query.get("status"); |
| | | if (StringUtils.isNotBlank(status)) { |
| | | queryWrapper.eq("t.status", status); |
| | | } |
| | | String classifyId = query.get("classifyId"); |
| | | if (StringUtils.isNotBlank(classifyId)) { |
| | | queryWrapper.like("p.classify_id", classifyId); |
| | | } |
| | | } |
| | | return this.baseMapper.queryLendTool(pageData,queryWrapper); |
| | | } |
| | | |
| | | @Override |
| | | public IPage<Map<String, Object>> querySharpenTool(Integer pageNo, Integer pageSize, Map<String, String> query) { |
| | | |
| | | if (pageNo == null || pageNo < 1 || pageSize == null || pageSize < 1) { |
| | | ExceptionCast.cast("参数错误"); |
| | | } |
| | | IPage<Map> pageData = new Page<Map>(pageNo, pageSize); |
| | | QueryWrapper<Map> queryWrapper = Wrappers.query(); |
| | | if (null != query) { |
| | | String toolCode = query.get("toolCode"); |
| | | if (StringUtils.isNotBlank(toolCode)) { |
| | | queryWrapper.like("p.tool_code", toolCode); |
| | | } |
| | | String status = query.get("status"); |
| | | if (StringUtils.isNotBlank(status)) { |
| | | queryWrapper.eq("t.status", status); |
| | | } |
| | | String classifyId = query.get("classifyId"); |
| | | if (StringUtils.isNotBlank(classifyId)) { |
| | | queryWrapper.like("p.classify_id", classifyId); |
| | | } |
| | | } |
| | | return this.baseMapper.querySharpenTool(pageData,queryWrapper); |
| | | } |
| | | } |