盘点历史
parent
4d079f7943
commit
cdb0c43a74
@ -0,0 +1,33 @@
|
||||
package com.zhehekeji.web.controller;
|
||||
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.zhehekeji.common.util.ValidatorUtil;
|
||||
import com.zhehekeji.core.pojo.Result;
|
||||
import com.zhehekeji.web.entity.CheckLog;
|
||||
import com.zhehekeji.web.pojo.stock.CheckLogSearch;
|
||||
import com.zhehekeji.web.service.StockLogService;
|
||||
import com.zhehekeji.web.service.TestService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
@Api(tags = "盘点历史")
|
||||
@RequestMapping("/stockLog")
|
||||
@RestController
|
||||
public class StockLogController {
|
||||
|
||||
@Resource
|
||||
private StockLogService stockLogService;
|
||||
@Resource
|
||||
private ValidatorUtil validatorUtil;
|
||||
|
||||
@ApiOperation("盘点历史")
|
||||
@PostMapping("")
|
||||
public Result<PageInfo<CheckLog>> list(@RequestBody CheckLogSearch checkLogSearch){
|
||||
return Result.success(stockLogService.list(checkLogSearch));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,56 @@
|
||||
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 StockLogService {
|
||||
|
||||
@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());
|
||||
shelveIds = streetService.getShelves(street,search.getLeftRight(),search.getSide());
|
||||
}
|
||||
|
||||
PageHelper.startPage(search.getPageNum(),search.getPageSize());
|
||||
QueryWrapper<CheckLog> wrapper = new QueryWrapper<>();
|
||||
if(!StringUtils.isEmpty(search.getOrderNum())){
|
||||
wrapper.eq("check_num",search.getOrderNum());
|
||||
}
|
||||
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`");
|
||||
List<CheckLog>stockChecks = checkLogMapper.selectList(wrapper);
|
||||
|
||||
return new PageInfo<>(stockChecks);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue