Merge remote-tracking branch 'origin/master'
| | |
| | | @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, |
| | | @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, |
| | | HttpServletRequest req) { |
| | | QueryWrapper<ToolLedgerDetail> queryWrapper = QueryGenerator.initQueryWrapper(toolLedgerDetail, req.getParameterMap()); |
| | | Map<String, String[]> parameterMap = req.getParameterMap(); |
| | | QueryWrapper<ToolLedgerDetail> queryWrapper = QueryGenerator.initQueryWrapper(toolLedgerDetail, parameterMap); |
| | | Page<ToolLedgerDetail> page = new Page<ToolLedgerDetail>(pageNo, pageSize); |
| | | IPage<ToolLedgerDetail> pageList = toolLedgerDetailService.page(page, queryWrapper); |
| | | IPage<ToolLedgerDetail> pageList = toolLedgerDetailService.queryPageList(page, parameterMap); |
| | | return Result.OK(pageList); |
| | | } |
| | | |
| | |
| | | import java.io.UnsupportedEncodingException; |
| | | import java.util.Date; |
| | | import java.math.BigDecimal; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import lombok.Data; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | |
| | | @TableId(type = IdType.ASSIGN_ID) |
| | | @ApiModelProperty(value = "主键id") |
| | | private String id; |
| | | /**工具编码*/ |
| | | /**工具编码(关联字段)*/ |
| | | @Excel(name = "工具编码", width = 15) |
| | | @ApiModelProperty(value = "工具编码") |
| | | @ApiModelProperty(value = "工具编码(关联字段,存tms_base_tools表主键id)") |
| | | private String toolCode; |
| | | /**工具编码*/ |
| | | @ApiModelProperty(value = "工具编码(tms_base_tools表tool_code字段)") |
| | | @TableField(exist = false) |
| | | private String toolNum; |
| | | /**工具编号*/ |
| | | @Excel(name = "工具编号", width = 15) |
| | | @ApiModelProperty(value = "工具编号") |
| | | private String toolId; |
| | | /**工具中文名称*/ |
| | | @TableField(exist = false) |
| | | @ApiModelProperty(value = "工具中文名称") |
| | | private String toolName; |
| | | /**数量*/ |
| | | @Excel(name = "数量", width = 15) |
| | | @ApiModelProperty(value = "数量") |
| | |
| | | @Excel(name = "库区/库号", width = 15) |
| | | @ApiModelProperty(value = "库区/库号") |
| | | private String warehouseId; |
| | | /**仓库名称*/ |
| | | @TableField(exist = false) |
| | | @ApiModelProperty(value = "仓库名称") |
| | | private String warehouseName; |
| | | /**库位号*/ |
| | | @Excel(name = "库位号", width = 15) |
| | | @ApiModelProperty(value = "库位号") |
| | |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Constants; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.jeecg.modules.tms.entity.ToolLedgerDetail; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | |
| | | */ |
| | | public interface ToolLedgerDetailMapper extends BaseMapper<ToolLedgerDetail> { |
| | | |
| | | IPage<ToolLedgerDetail> queryPageList(Page<ToolLedgerDetail> page, |
| | | @Param(Constants.WRAPPER) QueryWrapper<Object> queryWrapper); |
| | | } |
| | |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="org.jeecg.modules.tms.mapper.ToolLedgerDetailMapper"> |
| | | |
| | | <select id="queryPageList" resultType="org.jeecg.modules.tms.entity.ToolLedgerDetail"> |
| | | SELECT |
| | | t.id, |
| | | t.tool_code toolCode, |
| | | p.tool_code toolNum, |
| | | t.tool_id toolId, |
| | | p.chinese_name toolName, |
| | | p.tool_model toolModel, |
| | | t.quantity, |
| | | t.warehouse_id warehouseId, |
| | | ISNULL(q.warehouse_id, '') + '/' + ISNULL(q.warehouse_name, '') warehouseName, |
| | | t.position_code positionCode |
| | | FROM tms_tool_ledger_detail t |
| | | LEFT JOIN tms_base_tools p on t.tool_code = p.id |
| | | LEFT JOIN tms_warehouse q on t.warehouse_id = q.id |
| | | ${ew.customSqlSegment} |
| | | </select> |
| | | </mapper> |
| | |
| | | package org.jeecg.modules.tms.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import org.jeecg.modules.tms.entity.ToolLedgerDetail; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @Description: tms_tool_ledger_detail |
| | |
| | | */ |
| | | public interface IToolLedgerDetailService extends IService<ToolLedgerDetail> { |
| | | |
| | | IPage<ToolLedgerDetail> queryPageList(Page<ToolLedgerDetail> page, Map<String, String[]> parameterMap); |
| | | } |
| | |
| | | package org.jeecg.modules.tms.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 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; |
| | | |
| | | /** |
| | | * @Description: tms_tool_ledger_detail |
| | |
| | | @Service |
| | | public class ToolLedgerDetailServiceImpl extends ServiceImpl<ToolLedgerDetailMapper, ToolLedgerDetail> implements IToolLedgerDetailService { |
| | | |
| | | @Override |
| | | public IPage<ToolLedgerDetail> queryPageList(Page<ToolLedgerDetail> page, Map<String, String[]> parameterMap) { |
| | | QueryWrapper<Object> queryWrapper = Wrappers.query(); |
| | | String[] toolCodes = parameterMap.get("toolCode"); |
| | | if (toolCodes != null && toolCodes.length > 0) { |
| | | queryWrapper.like("p.tool_code", toolCodes[0]); |
| | | } |
| | | String[] statuses = parameterMap.get("status"); |
| | | if (statuses != null && statuses.length > 0) { |
| | | queryWrapper.eq("t.status", statuses[0]); |
| | | } |
| | | return this.baseMapper.queryPageList(page, queryWrapper); |
| | | } |
| | | } |