| | |
| | | @RequestParam(required = false)String orderByField, |
| | | @RequestParam(required = false)String orderByType, |
| | | @RequestParam Map<String, Object> param){ |
| | | EntityWrapper<Mat> wrapper = new EntityWrapper<>(); |
| | | excludeTrash(param); |
| | | convert(param, wrapper); |
| | | if (!Cools.isEmpty(orderByField)){ |
| | | wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType)); |
| | | // EntityWrapper<Mat> wrapper = new EntityWrapper<>(); |
| | | // excludeTrash(param); |
| | | // convert(param, wrapper); |
| | | // if (!Cools.isEmpty(orderByField)){ |
| | | // wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType)); |
| | | // } |
| | | // Page<Mat> page = matService.selectPage(new Page<>(curr, limit), wrapper); |
| | | // |
| | | // return R.ok().add(page); |
| | | Object tagId = param.get("tag_id"); |
| | | if (Cools.isEmpty(tagId)) { |
| | | tagId = getOriginTag().getId(); |
| | | } |
| | | Page<Mat> page = matService.selectPage(new Page<>(curr, limit), wrapper); |
| | | return R.ok(matService.getPage(new Page<>(curr, limit), String.valueOf(tagId))); |
| | | |
| | | return R.ok().add(page); |
| | | } |
| | | |
| | | private void convert(Map<String, Object> map, EntityWrapper wrapper){ |
| | |
| | | package zy.cloud.wms.manager.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import zy.cloud.wms.manager.entity.Mat; |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Mapper |
| | | @Repository |
| | | public interface MatMapper extends BaseMapper<Mat> { |
| | | |
| | | List<Mat> listByPage(Page page, @Param("tagId") String tagId); |
| | | |
| | | Mat selectByMatnr(@Param("matnr")String matnr); |
| | | |
| | | } |
| | |
| | | package zy.cloud.wms.manager.service; |
| | | |
| | | import zy.cloud.wms.manager.entity.Mat; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import zy.cloud.wms.manager.entity.Mat; |
| | | |
| | | public interface MatService extends IService<Mat> { |
| | | |
| | | Page<Mat> getPage(Page page, String tagId); |
| | | |
| | | Mat selectByMatnr(String matnr); |
| | | |
| | | } |
| | |
| | | package zy.cloud.wms.manager.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import zy.cloud.wms.manager.mapper.MatMapper; |
| | | import zy.cloud.wms.manager.entity.Mat; |
| | | import zy.cloud.wms.manager.service.MatService; |
| | |
| | | @Service("matService") |
| | | public class MatServiceImpl extends ServiceImpl<MatMapper, Mat> implements MatService { |
| | | |
| | | @Override |
| | | public Page<Mat> getPage(Page page, String tagId) { |
| | | return page.setRecords(baseMapper.listByPage(page, tagId)); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public Mat selectByMatnr(String matnr) { |
| | |
| | | |
| | | </resultMap> |
| | | |
| | | <select id="listByPageByArea" resultMap="BaseResultMap"> |
| | | <select id="listByPage" resultMap="BaseResultMap"> |
| | | SELECT |
| | | mm.* |
| | | FROM man_mat mm |
| | | LEFT JOIN man_tag mt ON mm.`tag_id` = mt.`id` |
| | | LEFT JOIN man_tag mt ON mm.tag_id = mt.id |
| | | WHERE 1=1 |
| | | AND (FIND_IN_SET(#{tagId}, mt.`path`) OR mt.`id` = #{tagId}) |
| | | AND (CHARINDEX(',' + '#{tagId}' + ',', ','+mt.path+',') > 0 OR mt.id = #{tagId}) |
| | | ORDER BY mm.create_time DESC |
| | | </select> |
| | | |
| | |
| | | // ,{field: 'createTime$', align: 'center',title: '添加时间'} |
| | | // ,{field: 'updateBy$', align: 'center',title: '修改人员',event: 'updateBy', style: 'cursor:pointer'} |
| | | // ,{field: 'updateTime$', align: 'center',title: '修改时间'} |
| | | ,{field: 'memo', align: 'center',title: '备注'} |
| | | ,{field: 'memo', align: 'center',title: '备注', hide: true} |
| | | |
| | | ,{fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:150} |
| | | ]], |
| | |
| | | .layui-form.layui-border-box.layui-table-view { |
| | | margin: 0; |
| | | } |
| | | #search-box { |
| | | padding: 30px 30px 10px 0px; |
| | | margin-left: 0px; |
| | | } |
| | | </style> |
| | | </head> |
| | | <body> |
| | |
| | | </div> |
| | | </div> |
| | | |
| | | <!--<!– 搜索栏 –>--> |
| | | <!--<div id="search-box" class="layui-form layui-card-header">--> |
| | | <!-- <div class="layui-inline">--> |
| | | <!-- <div class="layui-input-inline">--> |
| | | <!-- <input class="layui-input" type="text" name="loc_no" placeholder="货位编号" autocomplete="off">--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!-- <div class="layui-inline">--> |
| | | <!-- <div class="layui-input-inline">--> |
| | | <!-- <input class="layui-input" type="text" name="matnr" placeholder="商品编号" autocomplete="off">--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | |
| | | <!-- <div class="layui-inline">--> |
| | | <!-- <div class="layui-input-inline">--> |
| | | <!-- <input class="layui-input" type="text" name="maktx" placeholder="商品名称" autocomplete="off">--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | |
| | | <!-- <!– 待添加 –>--> |
| | | <!-- <div id="data-search-btn" class="layui-btn-container layui-form-item">--> |
| | | <!-- <button id="search" class="layui-btn layui-btn-primary layui-btn-radius" lay-submit lay-filter="search">搜索</button>--> |
| | | <!-- <button id="reset" class="layui-btn layui-btn-primary layui-btn-radius" lay-submit lay-filter="reset">重置</button>--> |
| | | <!-- </div>--> |
| | | <!--</div>--> |
| | | |
| | | <!--<!– 表格 –>--> |
| | | <!--<div class="layui-form">--> |
| | | <!-- <table class="layui-hide" id="locDetl" lay-filter="locDetl"></table>--> |
| | | <!--</div>--> |
| | | <script type="text/html" id="toolbar"> |
| | | <div class="layui-btn-container"> |
| | | <button class="layui-btn layui-btn-sm" id="btn-add" lay-event="addData">新增</button> |
| | |
| | | .layui-form.layui-border-box.layui-table-view { |
| | | margin: 0; |
| | | } |
| | | #search-box { |
| | | padding: 30px 30px 10px 0px; |
| | | margin-left: 0px; |
| | | } |
| | | </style> |
| | | </head> |
| | | <body> |