添加功能
This commit is contained in:
parent
374ec166a2
commit
a975aa9cda
|
|
@ -12,6 +12,7 @@ import com.nflg.wms.common.pojo.dto.MaterialQRCodeContentDTO;
|
|||
import com.nflg.wms.common.pojo.qo.*;
|
||||
import com.nflg.wms.common.pojo.vo.InventoryCheckTaskItemVO;
|
||||
import com.nflg.wms.common.pojo.vo.InventoryCheckTaskVO;
|
||||
import com.nflg.wms.common.pojo.vo.InventoryVO;
|
||||
import com.nflg.wms.common.pojo.vo.WmsInventoryCheckTaskItemMaterialVO;
|
||||
import com.nflg.wms.common.util.UserUtil;
|
||||
import com.nflg.wms.common.util.VUtil;
|
||||
|
|
@ -21,6 +22,7 @@ import com.nflg.wms.repository.entity.WmsInventoryCheckTaskItemMaterial;
|
|||
import com.nflg.wms.repository.service.IWmsInventoryCheckTaskItemMaterialService;
|
||||
import com.nflg.wms.repository.service.IWmsInventoryCheckTaskItemService;
|
||||
import com.nflg.wms.repository.service.IWmsInventoryCheckTaskService;
|
||||
import com.nflg.wms.repository.service.IWmsInventoryService;
|
||||
import com.nflg.wms.starter.BaseController;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.validation.Valid;
|
||||
|
|
@ -41,6 +43,9 @@ import java.util.Objects;
|
|||
@RequestMapping("/inventory")
|
||||
public class InventoryController extends BaseController {
|
||||
|
||||
@Resource
|
||||
private IWmsInventoryService inventoryService;
|
||||
|
||||
@Resource
|
||||
private IWmsInventoryCheckTaskService inventoryCheckTaskService;
|
||||
|
||||
|
|
@ -53,6 +58,15 @@ public class InventoryController extends BaseController {
|
|||
@Resource
|
||||
private IWmsInventoryCheckTaskItemMaterialService inventoryCheckTaskItemMaterialService;
|
||||
|
||||
/**
|
||||
* 库存查看
|
||||
* @param request 请求参数
|
||||
*/
|
||||
@PostMapping("search")
|
||||
public ApiResult<PageData<InventoryVO>> search(@Valid @RequestBody InventorySearchQO request) {
|
||||
return ApiResult.success(inventoryService.search(request));
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存库存盘点任务
|
||||
* @param request 请求参数
|
||||
|
|
|
|||
|
|
@ -0,0 +1,27 @@
|
|||
package com.nflg.wms.common.pojo.qo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class InventorySearchQO extends PageQO {
|
||||
|
||||
/**
|
||||
* 物料编号
|
||||
*/
|
||||
private String materialNo;
|
||||
|
||||
/**
|
||||
* 批次号
|
||||
*/
|
||||
private String batchNo;
|
||||
|
||||
/**
|
||||
* 工厂编号
|
||||
*/
|
||||
private String factoryNo;
|
||||
|
||||
/**
|
||||
* 仓库编号
|
||||
*/
|
||||
private String warehouseNo;
|
||||
}
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
package com.nflg.wms.common.pojo.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
public class InventoryVO {
|
||||
|
||||
/**
|
||||
* 物料编号
|
||||
*/
|
||||
private String materialNo;
|
||||
|
||||
/**
|
||||
* 工厂编号
|
||||
*/
|
||||
private String factoryNo;
|
||||
|
||||
/**
|
||||
* 仓库编号
|
||||
*/
|
||||
private String warehouseNo;
|
||||
|
||||
/**
|
||||
* 储位编号
|
||||
*/
|
||||
private String binNos;
|
||||
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
private BigDecimal num;
|
||||
|
||||
/**
|
||||
* 批次号
|
||||
*/
|
||||
private String batchNumber;
|
||||
}
|
||||
|
|
@ -1,6 +1,10 @@
|
|||
package com.nflg.wms.repository.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.nflg.wms.common.pojo.qo.InventorySearchQO;
|
||||
import com.nflg.wms.common.pojo.vo.InventoryVO;
|
||||
import com.nflg.wms.repository.entity.WmsInventory;
|
||||
|
||||
/**
|
||||
|
|
@ -13,4 +17,5 @@ import com.nflg.wms.repository.entity.WmsInventory;
|
|||
*/
|
||||
public interface WmsInventoryMapper extends BaseMapper<WmsInventory> {
|
||||
|
||||
IPage<InventoryVO> search(InventorySearchQO request, Page<Object> objectPage);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,12 @@
|
|||
package com.nflg.wms.repository.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.nflg.wms.common.pojo.dto.InventoryDTO;
|
||||
import com.nflg.wms.common.pojo.qo.InventorySearchQO;
|
||||
import com.nflg.wms.common.pojo.vo.InventoryVO;
|
||||
import com.nflg.wms.repository.entity.WmsInventory;
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
|
@ -19,4 +23,6 @@ public interface IWmsInventoryService extends IService<WmsInventory> {
|
|||
void out(List<InventoryDTO> inventories);
|
||||
|
||||
void in(List<InventoryDTO> inventories);
|
||||
|
||||
IPage<InventoryVO> search(@Valid InventorySearchQO request);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,9 +2,13 @@ package com.nflg.wms.repository.service.impl;
|
|||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
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.nflg.wms.common.exception.NflgException;
|
||||
import com.nflg.wms.common.pojo.dto.InventoryDTO;
|
||||
import com.nflg.wms.common.pojo.qo.InventorySearchQO;
|
||||
import com.nflg.wms.common.pojo.vo.InventoryVO;
|
||||
import com.nflg.wms.common.util.UserUtil;
|
||||
import com.nflg.wms.common.util.VUtil;
|
||||
import com.nflg.wms.repository.entity.WmsInventory;
|
||||
|
|
@ -103,4 +107,9 @@ public class WmsInventoryServiceImpl extends ServiceImpl<WmsInventoryMapper, Wms
|
|||
updateBatchById(forUpdate);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<InventoryVO> search(InventorySearchQO request) {
|
||||
return baseMapper.search(request, new Page<>(request.getPage(), request.getPageSize()));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,4 +2,25 @@
|
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.nflg.wms.repository.mapper.WmsInventoryMapper">
|
||||
|
||||
<select id="search" resultType="com.nflg.wms.common.pojo.vo.InventoryVO">
|
||||
SELECT i.*,get_binnos(s.id) AS "bin_nos"
|
||||
FROM wms_inventory i
|
||||
LEFT JOIN dictionary_item di ON di."value"=i.factory_no
|
||||
LEFT JOIN wms_warehouse wh ON wh.factory_id=di."id"
|
||||
LEFT JOIN wms_storage s ON i.material_no=s.material_no and wh."id"=s.warehouse_id
|
||||
<where>
|
||||
<if test="request.materialNo != null and request.materialNo!=''">
|
||||
AND i.material_no=#{request.materialNo}
|
||||
</if>
|
||||
<if test="request.factoryNo != null and request.factoryNo!=''">
|
||||
AND i.factory_no=#{request.factoryNo}
|
||||
</if>
|
||||
<if test="request.warehouseNo != null and request.warehouseNo!=''">
|
||||
AND i.warehouse_no=#{request.warehouseNo}
|
||||
</if>
|
||||
<if test="request.batchNo != null and request.batchNo!=''">
|
||||
AND i.batch_number= #{request.batchNo}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
Loading…
Reference in New Issue