容器管理功能调整
This commit is contained in:
@@ -0,0 +1,115 @@
|
||||
package com.ruoyi.bas.container.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.bas.container.domain.BasContainer;
|
||||
import com.ruoyi.bas.container.service.IBasContainerService;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 容器管理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)
|
||||
{
|
||||
return toAjax(basContainerService.insertBasContainer(basContainer));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改容器管理
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bas:container:edit')")
|
||||
@Log(title = "容器管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody BasContainer basContainer)
|
||||
{
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,5 +1,8 @@
|
||||
package com.ruoyi.bas.container.domain;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
@@ -11,6 +14,9 @@ import com.ruoyi.common.core.domain.BaseEntity;
|
||||
* @author ruoyi
|
||||
* @date 2025-06-17
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class BasContainer extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
@@ -28,11 +34,11 @@ public class BasContainer extends BaseEntity
|
||||
private Long status;
|
||||
|
||||
/** 物料种类数量 */
|
||||
@Excel(name = "物料种类数量")
|
||||
private Long productTypeQuantity;
|
||||
@Excel(name = "物料种类")
|
||||
private String productTypeQuantity;
|
||||
|
||||
/** 容量(可存放料箱数量) */
|
||||
@Excel(name = "容量", readConverterExp = "可=存放料箱数量")
|
||||
@Excel(name = "容量", readConverterExp = "可存放料箱数量")
|
||||
private Long capacity;
|
||||
|
||||
/** 操作人 */
|
||||
@@ -48,110 +54,4 @@ public class BasContainer extends BaseEntity
|
||||
/** 备用 */
|
||||
private String spare3;
|
||||
|
||||
public void setContainerId(String containerId)
|
||||
{
|
||||
this.containerId = containerId;
|
||||
}
|
||||
|
||||
public String getContainerId()
|
||||
{
|
||||
return containerId;
|
||||
}
|
||||
|
||||
public void setPortName(String portName)
|
||||
{
|
||||
this.portName = portName;
|
||||
}
|
||||
|
||||
public String getPortName()
|
||||
{
|
||||
return portName;
|
||||
}
|
||||
|
||||
public void setStatus(Long status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public Long getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setProductTypeQuantity(Long productTypeQuantity)
|
||||
{
|
||||
this.productTypeQuantity = productTypeQuantity;
|
||||
}
|
||||
|
||||
public Long getProductTypeQuantity()
|
||||
{
|
||||
return productTypeQuantity;
|
||||
}
|
||||
|
||||
public void setCapacity(Long capacity)
|
||||
{
|
||||
this.capacity = capacity;
|
||||
}
|
||||
|
||||
public Long getCapacity()
|
||||
{
|
||||
return capacity;
|
||||
}
|
||||
|
||||
public void setOperationMan(String operationMan)
|
||||
{
|
||||
this.operationMan = operationMan;
|
||||
}
|
||||
|
||||
public String getOperationMan()
|
||||
{
|
||||
return operationMan;
|
||||
}
|
||||
|
||||
public void setSpare1(String spare1)
|
||||
{
|
||||
this.spare1 = spare1;
|
||||
}
|
||||
|
||||
public String getSpare1()
|
||||
{
|
||||
return spare1;
|
||||
}
|
||||
|
||||
public void setSpare2(String spare2)
|
||||
{
|
||||
this.spare2 = spare2;
|
||||
}
|
||||
|
||||
public String getSpare2()
|
||||
{
|
||||
return spare2;
|
||||
}
|
||||
|
||||
public void setSpare3(String spare3)
|
||||
{
|
||||
this.spare3 = spare3;
|
||||
}
|
||||
|
||||
public String getSpare3()
|
||||
{
|
||||
return spare3;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("containerId", getContainerId())
|
||||
.append("portName", getPortName())
|
||||
.append("status", getStatus())
|
||||
.append("productTypeQuantity", getProductTypeQuantity())
|
||||
.append("capacity", getCapacity())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("operationMan", getOperationMan())
|
||||
.append("spare1", getSpare1())
|
||||
.append("spare2", getSpare2())
|
||||
.append("spare3", getSpare3())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,4 +58,13 @@ public interface BasContainerMapper
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBasContainerByContainerIds(String[] containerIds);
|
||||
|
||||
/**
|
||||
* 获取点位管理的点位值集合
|
||||
*
|
||||
* @return 结果
|
||||
*/
|
||||
List<String> selectPortNames();
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -58,4 +58,10 @@ public interface IBasContainerService
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBasContainerByContainerId(String containerId);
|
||||
|
||||
/**
|
||||
* 获取点位名称集合
|
||||
* @return
|
||||
*/
|
||||
public List<String> getPortNames();
|
||||
}
|
||||
|
||||
@@ -93,4 +93,13 @@ public class BasContainerServiceImpl implements IBasContainerService
|
||||
{
|
||||
return basContainerMapper.deleteBasContainerByContainerId(containerId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取点位名称集合
|
||||
* @return
|
||||
*/
|
||||
public List<String> getPortNames() {
|
||||
return basContainerMapper.selectPortNames();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,104 @@
|
||||
package com.ruoyi.bas.containerDetails.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.bas.containerDetails.domain.BasContainerDetails;
|
||||
import com.ruoyi.bas.containerDetails.service.IBasContainerDetailsService;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 容器物料明细Controller
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-06-17
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/bas/containerDetails")
|
||||
public class BasContainerDetailsController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IBasContainerDetailsService basContainerDetailsService;
|
||||
|
||||
/**
|
||||
* 查询容器物料明细列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bas:containerDetails:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(BasContainerDetails basContainerDetails)
|
||||
{
|
||||
startPage();
|
||||
List<BasContainerDetails> list = basContainerDetailsService.selectBasContainerDetailsList(basContainerDetails);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出容器物料明细列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bas:containerDetails:export')")
|
||||
@Log(title = "容器物料明细", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, BasContainerDetails basContainerDetails)
|
||||
{
|
||||
List<BasContainerDetails> list = basContainerDetailsService.selectBasContainerDetailsList(basContainerDetails);
|
||||
ExcelUtil<BasContainerDetails> util = new ExcelUtil<BasContainerDetails>(BasContainerDetails.class);
|
||||
util.exportExcel(response, list, "容器物料明细数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取容器物料明细详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bas:containerDetails:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(basContainerDetailsService.selectBasContainerDetailsById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增容器物料明细
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bas:containerDetails:add')")
|
||||
@Log(title = "容器物料明细", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody BasContainerDetails basContainerDetails)
|
||||
{
|
||||
return toAjax(basContainerDetailsService.insertBasContainerDetails(basContainerDetails));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改容器物料明细
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bas:containerDetails:edit')")
|
||||
@Log(title = "容器物料明细", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody BasContainerDetails basContainerDetails)
|
||||
{
|
||||
return toAjax(basContainerDetailsService.updateBasContainerDetails(basContainerDetails));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除容器物料明细
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bas:containerDetails:remove')")
|
||||
@Log(title = "容器物料明细", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(basContainerDetailsService.deleteBasContainerDetailsByIds(ids));
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,8 @@
|
||||
package com.ruoyi.bas.containerDetails.domain;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
@@ -11,6 +14,9 @@ import com.ruoyi.common.core.domain.BaseEntity;
|
||||
* @author ruoyi
|
||||
* @date 2025-06-17
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class BasContainerDetails extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
@@ -50,108 +56,5 @@ public class BasContainerDetails extends BaseEntity
|
||||
@Excel(name = "备用")
|
||||
private String spare3;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setContainerId(String containerId)
|
||||
{
|
||||
this.containerId = containerId;
|
||||
}
|
||||
|
||||
public String getContainerId()
|
||||
{
|
||||
return containerId;
|
||||
}
|
||||
|
||||
public void setProductId(String productId)
|
||||
{
|
||||
this.productId = productId;
|
||||
}
|
||||
|
||||
public String getProductId()
|
||||
{
|
||||
return productId;
|
||||
}
|
||||
|
||||
public void setProductName(String productName)
|
||||
{
|
||||
this.productName = productName;
|
||||
}
|
||||
|
||||
public String getProductName()
|
||||
{
|
||||
return productName;
|
||||
}
|
||||
|
||||
public void setQuantity(Long quantity)
|
||||
{
|
||||
this.quantity = quantity;
|
||||
}
|
||||
|
||||
public Long getQuantity()
|
||||
{
|
||||
return quantity;
|
||||
}
|
||||
|
||||
public void setUnit(String unit)
|
||||
{
|
||||
this.unit = unit;
|
||||
}
|
||||
|
||||
public String getUnit()
|
||||
{
|
||||
return unit;
|
||||
}
|
||||
|
||||
public void setSpare1(String spare1)
|
||||
{
|
||||
this.spare1 = spare1;
|
||||
}
|
||||
|
||||
public String getSpare1()
|
||||
{
|
||||
return spare1;
|
||||
}
|
||||
|
||||
public void setSpare2(String spare2)
|
||||
{
|
||||
this.spare2 = spare2;
|
||||
}
|
||||
|
||||
public String getSpare2()
|
||||
{
|
||||
return spare2;
|
||||
}
|
||||
|
||||
public void setSpare3(String spare3)
|
||||
{
|
||||
this.spare3 = spare3;
|
||||
}
|
||||
|
||||
public String getSpare3()
|
||||
{
|
||||
return spare3;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("containerId", getContainerId())
|
||||
.append("productId", getProductId())
|
||||
.append("productName", getProductName())
|
||||
.append("quantity", getQuantity())
|
||||
.append("unit", getUnit())
|
||||
.append("spare1", getSpare1())
|
||||
.append("spare2", getSpare2())
|
||||
.append("spare3", getSpare3())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,7 +48,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="productTypeQuantity != null">product_type_quantity,</if>
|
||||
<if test="capacity != null">capacity,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<!-- <if test="updateTime != null">update_time,</if>-->
|
||||
update_time,
|
||||
<if test="operationMan != null">operation_man,</if>
|
||||
<if test="spare1 != null">spare1,</if>
|
||||
<if test="spare2 != null">spare2,</if>
|
||||
@@ -61,7 +62,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="productTypeQuantity != null">#{productTypeQuantity},</if>
|
||||
<if test="capacity != null">#{capacity},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<!-- <if test="updateTime != null">#{updateTime},</if>-->
|
||||
GETDATE(),
|
||||
<if test="operationMan != null">#{operationMan},</if>
|
||||
<if test="spare1 != null">#{spare1},</if>
|
||||
<if test="spare2 != null">#{spare2},</if>
|
||||
@@ -77,7 +79,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="productTypeQuantity != null">product_type_quantity = #{productTypeQuantity},</if>
|
||||
<if test="capacity != null">capacity = #{capacity},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<!-- <if test="updateTime != null">update_time = #{updateTime},</if>-->
|
||||
GETDATE(),
|
||||
<if test="operationMan != null">operation_man = #{operationMan},</if>
|
||||
<if test="spare1 != null">spare1 = #{spare1},</if>
|
||||
<if test="spare2 != null">spare2 = #{spare2},</if>
|
||||
@@ -96,4 +99,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
#{containerId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id="selectPortNames" resultType="string">
|
||||
SELECT DISTINCT port_name FROM bas_product_port WHERE port_name != null or port_name != ''
|
||||
</select>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user