增加库存历史照片
parent
1c15675ba6
commit
5d5fa9d2d6
@ -0,0 +1,7 @@
|
||||
package com.zhehekeji.web.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.zhehekeji.web.entity.StockLog;
|
||||
|
||||
public interface StockLogMapper extends BaseMapper<StockLog> {
|
||||
}
|
||||
@ -0,0 +1,17 @@
|
||||
package com.zhehekeji.web.pojo.stock;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class StockLogSearch {
|
||||
|
||||
private Integer row;
|
||||
|
||||
private Integer column;
|
||||
|
||||
private Integer pageSize;
|
||||
|
||||
private Integer pageNum;
|
||||
|
||||
private String shelveId;
|
||||
}
|
||||
@ -0,0 +1,58 @@
|
||||
package com.zhehekeji.web.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.zhehekeji.web.entity.CheckLog;
|
||||
import com.zhehekeji.web.entity.Street;
|
||||
import com.zhehekeji.web.mapper.CheckLogMapper;
|
||||
import com.zhehekeji.web.mapper.StreetMapper;
|
||||
import com.zhehekeji.web.pojo.stock.CheckLogSearch;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class CheckLogService {
|
||||
|
||||
@Resource
|
||||
private CheckLogMapper checkLogMapper;
|
||||
@Resource
|
||||
private StreetService streetService;
|
||||
|
||||
public PageInfo<CheckLog> list(CheckLogSearch search){
|
||||
List<String> shelveIds = null;
|
||||
|
||||
if(search.getStreetId() != null){
|
||||
Street street = streetService.streetById(search.getStreetId());
|
||||
if(street != null){
|
||||
shelveIds = streetService.getShelves(street,search.getLeftRight(),search.getSide());
|
||||
}
|
||||
}
|
||||
|
||||
PageHelper.startPage(search.getPageNum(),search.getPageSize());
|
||||
QueryWrapper<CheckLog> wrapper = new QueryWrapper<>();
|
||||
if(!StringUtils.isEmpty(search.getLotnum())){
|
||||
wrapper.eq("lotnum",search.getLotnum());
|
||||
}
|
||||
if(search.getStartTimestamp() != null && search.getEndTimestamp() != null){
|
||||
wrapper.ge("create_time",search.getStartTimestamp()).le("create_time",search.getEndTimestamp());
|
||||
}
|
||||
if(!StringUtils.isEmpty(shelveIds)){
|
||||
wrapper.in("shelve_id",shelveIds);
|
||||
}
|
||||
if(search.getRow() != null && search.getRow() != 0){
|
||||
wrapper.eq("`row`",search.getRow());
|
||||
}
|
||||
if(search.getColumn() != null && search.getColumn() != 0){
|
||||
wrapper.eq("`column`",search.getColumn());
|
||||
}
|
||||
wrapper.orderByDesc("shelve_id","`row`","`column`","id");
|
||||
List<CheckLog>stockChecks = checkLogMapper.selectList(wrapper);
|
||||
|
||||
return new PageInfo<>(stockChecks);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue