模具
This commit is contained in:
parent
2770cade75
commit
8e4070456b
@ -3,6 +3,7 @@ package com.shgx.web.controller.mold;
|
||||
import java.util.List;
|
||||
|
||||
import com.shgx.moldmanagement.domain.MoldInventoryChangeLog;
|
||||
import com.shgx.moldmanagement.domain.dto.MoldQueryDTO;
|
||||
import com.shgx.moldmanagement.service.IMoldInventoryChangeLogService;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -45,6 +46,17 @@ public class MoldInventoryChangeLogController extends BaseController
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* PDA查询出入库日志列表
|
||||
*/
|
||||
@PostMapping("/list")
|
||||
public TableDataInfo list(@RequestBody MoldQueryDTO.SearchLogQueryDTO dto)
|
||||
{
|
||||
startPage();
|
||||
List<MoldInventoryChangeLog> list = moldInventoryChangeLogService.selectPDALogList(dto);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
// /**
|
||||
// * 导出模具出入库日志列表
|
||||
// */
|
||||
|
||||
@ -1,5 +1,9 @@
|
||||
package com.shgx.moldmanagement.domain.dto;
|
||||
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public class MoldQueryDTO {
|
||||
/**
|
||||
* 修改模具状态
|
||||
@ -19,13 +23,24 @@ public class MoldQueryDTO {
|
||||
/**
|
||||
* 查询库位模具详情
|
||||
*/
|
||||
public static class SearchMoldQueryDTO {
|
||||
public static class SearchLogQueryDTO {
|
||||
|
||||
// 模具号
|
||||
public String moldCode;
|
||||
|
||||
// 模具名称
|
||||
public String moldName;
|
||||
|
||||
// 库位号
|
||||
public String positionCode;
|
||||
|
||||
// 开始时间
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
public Date startTime;
|
||||
|
||||
// 结束时间
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
public Date endTime;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package com.shgx.moldmanagement.service;
|
||||
|
||||
import com.shgx.moldmanagement.domain.MoldInventoryChangeLog;
|
||||
import com.shgx.moldmanagement.domain.dto.MoldQueryDTO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@ -21,8 +22,16 @@ public interface IMoldInventoryChangeLogService
|
||||
public MoldInventoryChangeLog selectMoldInventoryChangeLogByChangeId(Long changeId);
|
||||
|
||||
/**
|
||||
* 查询模具库存变动列表
|
||||
* PDA查询出入库日志列表
|
||||
*
|
||||
* @param dto 模具库存变动
|
||||
* @return 模具库存变动集合
|
||||
*/
|
||||
public List<MoldInventoryChangeLog> selectPDALogList(MoldQueryDTO.SearchLogQueryDTO dto);
|
||||
|
||||
/**
|
||||
* 查询模具库存变动列表
|
||||
*
|
||||
* @param moldInventoryChangeLog 模具库存变动
|
||||
* @return 模具库存变动集合
|
||||
*/
|
||||
|
||||
@ -1,18 +1,23 @@
|
||||
package com.shgx.moldmanagement.service.impl;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.shgx.common.utils.DateUtils;
|
||||
import com.shgx.common.utils.SecurityUtils;
|
||||
import com.shgx.common.utils.StringUtils;
|
||||
import com.shgx.moldmanagement.domain.MoldInventoryChangeLog;
|
||||
import com.shgx.moldmanagement.domain.dto.MoldQueryDTO;
|
||||
import com.shgx.moldmanagement.mapper.MoldInventoryChangeLogMapper;
|
||||
import com.shgx.moldmanagement.mapper.MoldWarehouseLocationLiveMapper;
|
||||
import com.shgx.moldmanagement.service.IMoldInventoryChangeLogService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import static com.shgx.common.utils.DateUtils.getEndOfDay;
|
||||
|
||||
|
||||
/**
|
||||
* 模具库存日志Service业务层处理
|
||||
@ -40,6 +45,48 @@ public class MoldInventoryChangeLogServiceImpl implements IMoldInventoryChangeLo
|
||||
return moldInventoryChangeLogMapper.selectById(changeId);
|
||||
}
|
||||
|
||||
/**
|
||||
* PDA查询出入库日志列表
|
||||
* @param dto 模具库存变动
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<MoldInventoryChangeLog> selectPDALogList(MoldQueryDTO.SearchLogQueryDTO dto) {
|
||||
LambdaQueryWrapper<MoldInventoryChangeLog> queryWrapper = new LambdaQueryWrapper<>();
|
||||
|
||||
// 模具号模糊查询
|
||||
if (StringUtils.hasText(dto.moldCode)) {
|
||||
queryWrapper.like(MoldInventoryChangeLog::getMoldCode, dto.moldCode);
|
||||
}
|
||||
|
||||
// 模具名称模糊查询
|
||||
if (StringUtils.hasText(dto.moldName)) {
|
||||
queryWrapper.like(MoldInventoryChangeLog::getMoldName, dto.moldName);
|
||||
}
|
||||
|
||||
// 库位号模糊查询(匹配来源位置或目标位置)
|
||||
if (StringUtils.hasText(dto.positionCode)) {
|
||||
// 使用 or() 构建「来源位置包含该值 或 目标位置包含该值」的条件
|
||||
queryWrapper.and(qw -> qw
|
||||
.like(MoldInventoryChangeLog::getFromLocation, dto.positionCode)
|
||||
.or()
|
||||
.like(MoldInventoryChangeLog::getToLocation, dto.positionCode)
|
||||
);
|
||||
}
|
||||
|
||||
if (dto.startTime != null) {
|
||||
queryWrapper.ge(MoldInventoryChangeLog::getCreateTime, dto.startTime);
|
||||
}
|
||||
|
||||
if (dto.endTime != null) {
|
||||
queryWrapper.le(MoldInventoryChangeLog::getCreateTime, getEndOfDay(dto.endTime));
|
||||
}
|
||||
|
||||
// 按创建时间降序排序
|
||||
queryWrapper.orderByDesc(MoldInventoryChangeLog::getCreateTime);
|
||||
|
||||
return moldInventoryChangeLogMapper.selectList(queryWrapper);
|
||||
}
|
||||
/**
|
||||
* 查询模具库存日志列表
|
||||
*
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user