初始化
This commit is contained in:
@@ -0,0 +1,113 @@
|
||||
package com.ruoyi.bas.container.controller;
|
||||
|
||||
import com.ruoyi.bas.container.domain.BasContainer;
|
||||
import com.ruoyi.bas.container.service.IBasContainerService;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 容器管理Controller
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-06-17
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/bas/container")
|
||||
public class BasContainerController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IBasContainerService basContainerService;
|
||||
|
||||
/**
|
||||
* 查询容器管理列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bas:container:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(BasContainer basContainer)
|
||||
{
|
||||
startPage();
|
||||
List<BasContainer> list = basContainerService.selectBasContainerList(basContainer);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出容器管理列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bas:container:export')")
|
||||
@Log(title = "容器管理", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, BasContainer basContainer)
|
||||
{
|
||||
List<BasContainer> list = basContainerService.selectBasContainerList(basContainer);
|
||||
ExcelUtil<BasContainer> util = new ExcelUtil<BasContainer>(BasContainer.class);
|
||||
util.exportExcel(response, list, "容器管理数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取容器管理详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bas:container:query')")
|
||||
@GetMapping(value = "/{containerId}")
|
||||
public AjaxResult getInfo(@PathVariable("containerId") String containerId)
|
||||
{
|
||||
return success(basContainerService.selectBasContainerByContainerId(containerId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增容器管理
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bas:container:add')")
|
||||
@Log(title = "容器管理", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody BasContainer basContainer)
|
||||
{
|
||||
// 自动获取当前登录用户作为操作人
|
||||
basContainer.setOperationMan(getUsername());
|
||||
return toAjax(basContainerService.insertBasContainer(basContainer));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改容器管理
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bas:container:edit')")
|
||||
@Log(title = "容器管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody BasContainer basContainer)
|
||||
{
|
||||
// 自动获取当前登录用户作为操作人
|
||||
basContainer.setOperationMan(getUsername());
|
||||
return toAjax(basContainerService.updateBasContainer(basContainer));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除容器管理
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bas:container:remove')")
|
||||
@Log(title = "容器管理", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{containerIds}")
|
||||
public AjaxResult remove(@PathVariable String[] containerIds)
|
||||
{
|
||||
return toAjax(basContainerService.deleteBasContainerByContainerIds(containerIds));
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/portNames")
|
||||
public AjaxResult getPortNames() {
|
||||
List<String> portNames = basContainerService.getPortNames();
|
||||
return AjaxResult.success(portNames);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
package com.ruoyi.bas.container.domain;
|
||||
|
||||
import com.ruoyi.bas.containerDetails.domain.BasContainerDetails;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 容器管理对象 bas_container
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-06-17
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class BasContainer extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 容器编号 */
|
||||
@Excel(name = "${bas.Container.containerId}")
|
||||
private String containerId;
|
||||
|
||||
/** 点位名称 */
|
||||
@Excel(name = "${bas.Container.portName}")
|
||||
private String portName;
|
||||
|
||||
/** 容器状态 */
|
||||
@Excel(name = "${bas.Container.status}")
|
||||
private Long status;
|
||||
|
||||
/** 物料种类数量 */
|
||||
@Excel(name = "${bas.Container.productTypeQuantity}")
|
||||
private String productTypeQuantity;
|
||||
|
||||
/** 容量(可存放料箱数量) */
|
||||
@Excel(name = "${bas.Container.capacity}")
|
||||
private Long capacity;
|
||||
|
||||
/** 操作人 */
|
||||
@Excel(name = "${bas.Container.operationMan}")
|
||||
private String operationMan;
|
||||
|
||||
/** 备用 */
|
||||
private String spare1;
|
||||
|
||||
/** 备用 */
|
||||
private String spare2;
|
||||
|
||||
/** 备用 */
|
||||
private String spare3;
|
||||
|
||||
private List<BasContainerDetails> details;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
package com.ruoyi.bas.container.mapper;
|
||||
|
||||
import com.ruoyi.bas.container.domain.BasContainer;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 容器管理Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-06-17
|
||||
*/
|
||||
public interface BasContainerMapper
|
||||
{
|
||||
/**
|
||||
* 查询容器管理
|
||||
*
|
||||
* @param containerId 容器管理主键
|
||||
* @return 容器管理
|
||||
*/
|
||||
public BasContainer selectBasContainerByContainerId(String containerId);
|
||||
|
||||
/**
|
||||
* 查询容器管理列表
|
||||
*
|
||||
* @param basContainer 容器管理
|
||||
* @return 容器管理集合
|
||||
*/
|
||||
public List<BasContainer> selectBasContainerList(BasContainer basContainer);
|
||||
|
||||
/**
|
||||
* 新增容器管理
|
||||
*
|
||||
* @param basContainer 容器管理
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBasContainer(BasContainer basContainer);
|
||||
|
||||
/**
|
||||
* 修改容器管理
|
||||
*
|
||||
* @param basContainer 容器管理
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBasContainer(BasContainer basContainer);
|
||||
|
||||
/**
|
||||
* 删除容器管理
|
||||
*
|
||||
* @param containerId 容器管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBasContainerByContainerId(String containerId);
|
||||
|
||||
/**
|
||||
* 批量删除容器管理
|
||||
*
|
||||
* @param containerIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBasContainerByContainerIds(String[] containerIds);
|
||||
|
||||
/**
|
||||
* 获取点位管理的点位值集合
|
||||
*
|
||||
* @return 结果
|
||||
*/
|
||||
List<String> selectPortNames();
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
package com.ruoyi.bas.container.service;
|
||||
|
||||
import com.ruoyi.bas.container.domain.BasContainer;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 容器管理Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-06-17
|
||||
*/
|
||||
public interface IBasContainerService
|
||||
{
|
||||
/**
|
||||
* 查询容器管理
|
||||
*
|
||||
* @param containerId 容器管理主键
|
||||
* @return 容器管理
|
||||
*/
|
||||
public BasContainer selectBasContainerByContainerId(String containerId);
|
||||
|
||||
/**
|
||||
* 查询容器管理列表
|
||||
*
|
||||
* @param basContainer 容器管理
|
||||
* @return 容器管理集合
|
||||
*/
|
||||
public List<BasContainer> selectBasContainerList(BasContainer basContainer);
|
||||
|
||||
/**
|
||||
* 新增容器管理
|
||||
*
|
||||
* @param basContainer 容器管理
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBasContainer(BasContainer basContainer);
|
||||
|
||||
/**
|
||||
* 修改容器管理
|
||||
*
|
||||
* @param basContainer 容器管理
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBasContainer(BasContainer basContainer);
|
||||
|
||||
/**
|
||||
* 批量删除容器管理
|
||||
*
|
||||
* @param containerIds 需要删除的容器管理主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBasContainerByContainerIds(String[] containerIds);
|
||||
|
||||
/**
|
||||
* 删除容器管理信息
|
||||
*
|
||||
* @param containerId 容器管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBasContainerByContainerId(String containerId);
|
||||
|
||||
/**
|
||||
* 获取点位名称集合
|
||||
* @return
|
||||
*/
|
||||
public List<String> getPortNames();
|
||||
}
|
||||
@@ -0,0 +1,106 @@
|
||||
package com.ruoyi.bas.container.service.impl;
|
||||
|
||||
import com.ruoyi.bas.container.domain.BasContainer;
|
||||
import com.ruoyi.bas.container.mapper.BasContainerMapper;
|
||||
import com.ruoyi.bas.container.service.IBasContainerService;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 容器管理Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-06-17
|
||||
*/
|
||||
@Service
|
||||
public class BasContainerServiceImpl implements IBasContainerService
|
||||
{
|
||||
@Autowired
|
||||
private BasContainerMapper basContainerMapper;
|
||||
|
||||
/**
|
||||
* 查询容器管理
|
||||
*
|
||||
* @param containerId 容器管理主键
|
||||
* @return 容器管理
|
||||
*/
|
||||
@Override
|
||||
public BasContainer selectBasContainerByContainerId(String containerId)
|
||||
{
|
||||
return basContainerMapper.selectBasContainerByContainerId(containerId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询容器管理列表
|
||||
*
|
||||
* @param basContainer 容器管理
|
||||
* @return 容器管理
|
||||
*/
|
||||
@Override
|
||||
public List<BasContainer> selectBasContainerList(BasContainer basContainer)
|
||||
{
|
||||
return basContainerMapper.selectBasContainerList(basContainer);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增容器管理
|
||||
*
|
||||
* @param basContainer 容器管理
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertBasContainer(BasContainer basContainer)
|
||||
{
|
||||
basContainer.setCreateTime(DateUtils.getNowDate());
|
||||
return basContainerMapper.insertBasContainer(basContainer);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改容器管理
|
||||
*
|
||||
* @param basContainer 容器管理
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateBasContainer(BasContainer basContainer)
|
||||
{
|
||||
basContainer.setUpdateTime(DateUtils.getNowDate());
|
||||
return basContainerMapper.updateBasContainer(basContainer);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除容器管理
|
||||
*
|
||||
* @param containerIds 需要删除的容器管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBasContainerByContainerIds(String[] containerIds)
|
||||
{
|
||||
return basContainerMapper.deleteBasContainerByContainerIds(containerIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除容器管理信息
|
||||
*
|
||||
* @param containerId 容器管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBasContainerByContainerId(String containerId)
|
||||
{
|
||||
return basContainerMapper.deleteBasContainerByContainerId(containerId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取点位名称集合
|
||||
* @return
|
||||
*/
|
||||
public List<String> getPortNames() {
|
||||
return basContainerMapper.selectPortNames();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user