add: 木箱库存查询
This commit is contained in:
@@ -35,6 +35,12 @@ public class BstIvtBoxinfoController {
|
||||
return new ResponseEntity<>(iBstIvtBoxinfoService.queryAll(whereJson, page), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@GetMapping("/boxivtquery")
|
||||
@Log("查询木箱库存信息")
|
||||
public ResponseEntity<Object> boxIvtQuery(@RequestParam Map whereJson, Pageable page) {
|
||||
return new ResponseEntity<>(iBstIvtBoxinfoService.boxIvtQuery(whereJson, page), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/saveBoxInfo")
|
||||
@Log("保存木箱信息")
|
||||
public ResponseEntity<Object> saveBoxInfo(@RequestBody JSONObject jsonObject) {
|
||||
|
||||
@@ -46,4 +46,11 @@ public interface IBstIvtBoxinfoService extends IService<BstIvtBoxinfo> {
|
||||
|
||||
BstIvtBoxinfo getBoxInfo(JSONObject jsonObject);
|
||||
|
||||
/**
|
||||
* 查询木箱库存信息
|
||||
* @param whereJson : 查询条件
|
||||
* @param page 分页组件
|
||||
* @return 木箱信息
|
||||
*/
|
||||
Object boxIvtQuery(Map whereJson, Pageable page);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.nl.b_lms.storage_manage.database.service.dao.mapper;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
@@ -20,10 +21,18 @@ import java.util.Map;
|
||||
public interface BstIvtBoxinfoMapper extends BaseMapper<BstIvtBoxinfo> {
|
||||
|
||||
/**
|
||||
* 查询入库单
|
||||
* 查询木箱
|
||||
* @param query: 查询条件
|
||||
* @param pageQuery: 分页工具
|
||||
* @return List<Map>
|
||||
*/
|
||||
List<Map> getPageQuery(@Param("query") Map query, @Param("pageQuery") Pageable pageQuery);
|
||||
|
||||
/**
|
||||
* 查询木箱库存
|
||||
* @param query 查询条件
|
||||
* @param pageQuery 分页工具
|
||||
* @return List<Map>
|
||||
*/
|
||||
List<Map> getBoxIvtPage(@Param("query") Map query, @Param("pageQuery") Pageable pageQuery);
|
||||
}
|
||||
|
||||
@@ -29,4 +29,31 @@
|
||||
</where>
|
||||
|
||||
</select>
|
||||
|
||||
<select id="getBoxIvtPage" resultType="java.util.Map">
|
||||
SELECT
|
||||
box.*,
|
||||
attr.struct_code
|
||||
FROM
|
||||
bst_ivt_boxinfo box
|
||||
INNER JOIN st_ivt_structattr attr ON attr.storagevehicle_code = box.box_no
|
||||
<where>
|
||||
box.is_packing = '0'
|
||||
AND attr.lock_type = '1'
|
||||
|
||||
<if test="query.material_code != null and query.material_code != ''">
|
||||
AND box.material_code = #{query.material_code}
|
||||
</if>
|
||||
|
||||
<if test="query.material_name != null and query.material_name != ''">
|
||||
AND box.material_name LIKE '%${query.material_name}%'
|
||||
</if>
|
||||
|
||||
<if test="query.box_no != null and query.box_no != ''">
|
||||
AND box.box_no LIKE '%${query.box_no}%'
|
||||
</if>
|
||||
|
||||
</where>
|
||||
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -7,11 +7,13 @@ 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 com.github.pagehelper.PageHelper;
|
||||
import org.nl.b_lms.storage_manage.database.service.IBstIvtBoxinfoService;
|
||||
import org.nl.b_lms.storage_manage.database.service.IMdpbBoxtypeService;
|
||||
import org.nl.b_lms.storage_manage.database.service.dao.BstIvtBoxinfo;
|
||||
import org.nl.b_lms.storage_manage.database.service.dao.MdpbBoxtype;
|
||||
import org.nl.b_lms.storage_manage.database.service.dao.mapper.BstIvtBoxinfoMapper;
|
||||
import org.nl.common.TableDataInfo;
|
||||
import org.nl.common.utils.IdUtil;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.modules.wql.util.SpringContextHolder;
|
||||
@@ -23,6 +25,7 @@ import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
@@ -150,4 +153,15 @@ public class BstIvtBoxinfoServiceImpl extends ServiceImpl<BstIvtBoxinfoMapper, B
|
||||
}
|
||||
return boxinfo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object boxIvtQuery(Map query, Pageable pageQuery) {
|
||||
com.github.pagehelper.Page<Object> page = PageHelper.startPage(pageQuery.getPageNumber() + 1, pageQuery.getPageSize());
|
||||
|
||||
List<Map> mst_detail = this.baseMapper.getBoxIvtPage(query, pageQuery);
|
||||
|
||||
TableDataInfo<Map> build = TableDataInfo.build(mst_detail);
|
||||
build.setTotalElements(page.getTotal());
|
||||
return build;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user