盘点管理 基础点位管理 绑定物料 解除物料
This commit is contained in:
@@ -70,6 +70,16 @@ public class BasProduct extends BaseEntity
|
||||
@Excel(name = "备用字段6")
|
||||
private String spare6;
|
||||
|
||||
/** 备用字段6 */
|
||||
@Excel(name = "备用字段7")
|
||||
private String spare7;
|
||||
/** 备用字段6 */
|
||||
@Excel(name = "备用字段8")
|
||||
private String spare8;
|
||||
/** 备用字段6 */
|
||||
@Excel(name = "备用字段9")
|
||||
private String spare9;
|
||||
|
||||
/** 物料名称 */
|
||||
@Excel(name = "物料名称")
|
||||
private String productName;
|
||||
@@ -83,4 +93,8 @@ public class BasProduct extends BaseEntity
|
||||
*/
|
||||
private String lotNo;
|
||||
|
||||
private String totalNetWeight;
|
||||
private String netWeight;
|
||||
private String grossWeight;
|
||||
|
||||
}
|
||||
|
||||
@@ -66,4 +66,8 @@ public interface BasProductMapper
|
||||
* @return
|
||||
*/
|
||||
List<BasProduct> selectBasProductListByProductGuids(@Param("productGuids") List<String> collect);
|
||||
|
||||
BasProduct selectBasProductByProductId(String productId);
|
||||
|
||||
List<BasProduct> selectBasProductListByProductIds(@Param("productIds") List<String> collect);
|
||||
}
|
||||
|
||||
@@ -19,6 +19,8 @@ public interface IBasProductService
|
||||
*/
|
||||
public BasProduct selectBasProductByProductGuid(String productGuid);
|
||||
|
||||
public BasProduct selectBasProductByProductId(String productId);
|
||||
|
||||
/**
|
||||
* 查询物料管理列表
|
||||
*
|
||||
@@ -65,4 +67,6 @@ public interface IBasProductService
|
||||
* @return
|
||||
*/
|
||||
List<BasProduct> selectBasProductListByProductGuids(List<String> collect);
|
||||
|
||||
List<BasProduct> selectBasProductListByProductIds(List<String> collect);
|
||||
}
|
||||
|
||||
@@ -34,6 +34,11 @@ public class BasProductServiceImpl implements IBasProductService
|
||||
return basProductMapper.selectBasProductByProductGuid(productGuid);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BasProduct selectBasProductByProductId(String productId) {
|
||||
return basProductMapper.selectBasProductByProductId(productId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询物料管理列表
|
||||
*
|
||||
@@ -105,4 +110,12 @@ public class BasProductServiceImpl implements IBasProductService
|
||||
}
|
||||
return basProductMapper.selectBasProductListByProductGuids(collect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BasProduct> selectBasProductListByProductIds(List<String> collect) {
|
||||
if (CollUtil.isEmpty(collect)){
|
||||
return new ArrayList<>();
|
||||
}
|
||||
return basProductMapper.selectBasProductListByProductIds(collect);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,106 @@
|
||||
package com.ruoyi.bas.port.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.port.domain.BasProductPort;
|
||||
import com.ruoyi.bas.port.service.IBasProductPortService;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 基础点位Controller
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-05-29
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/bas/port")
|
||||
public class BasProductPortController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IBasProductPortService basProductPortService;
|
||||
|
||||
/**
|
||||
* 查询基础点位列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bas:port:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(BasProductPort basProductPort)
|
||||
{
|
||||
startPage();
|
||||
List<BasProductPort> list = basProductPortService.selectBasProductPortList(basProductPort);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出基础点位列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bas:port:export')")
|
||||
@Log(title = "基础点位", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, BasProductPort basProductPort)
|
||||
{
|
||||
List<BasProductPort> list = basProductPortService.selectBasProductPortList(basProductPort);
|
||||
ExcelUtil<BasProductPort> util = new ExcelUtil<BasProductPort>(BasProductPort.class);
|
||||
util.exportExcel(response, list, "基础点位数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取基础点位详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bas:port:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") String id)
|
||||
{
|
||||
return success(basProductPortService.selectBasProductPortById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增基础点位
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bas:port:add')")
|
||||
@Log(title = "基础点位", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody BasProductPort basProductPort)
|
||||
{
|
||||
return toAjax(basProductPortService.insertBasProductPort(basProductPort));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改基础点位
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bas:port:edit')")
|
||||
@Log(title = "基础点位", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody BasProductPort basProductPort)
|
||||
{
|
||||
return toAjax(basProductPortService.updateBasProductPort(basProductPort));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除基础点位
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bas:port:remove')")
|
||||
@Log(title = "基础点位", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable String[] ids)
|
||||
{
|
||||
return toAjax(basProductPortService.deleteBasProductPortByIds(ids));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,111 @@
|
||||
package com.ruoyi.bas.port.domain;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 基础点位对象 bas_product_port
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-05-29
|
||||
*/
|
||||
public class BasProductPort extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** id */
|
||||
private String id;
|
||||
|
||||
/** 点位名称 */
|
||||
@Excel(name = "点位名称")
|
||||
private String portName;
|
||||
|
||||
/** 点位分类 */
|
||||
@Excel(name = "点位分类")
|
||||
private String portType;
|
||||
|
||||
/** 点位描述 */
|
||||
@Excel(name = "点位描述")
|
||||
private String portDesc;
|
||||
|
||||
/** 创建人 */
|
||||
@Excel(name = "创建人")
|
||||
private String createMan;
|
||||
|
||||
|
||||
private List<String> productIdList;
|
||||
|
||||
public List<String> getProductIdList() {
|
||||
return productIdList;
|
||||
}
|
||||
|
||||
public void setProductIdList(List<String> productIdList) {
|
||||
this.productIdList = productIdList;
|
||||
}
|
||||
|
||||
public void setId(String id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setPortName(String portName)
|
||||
{
|
||||
this.portName = portName;
|
||||
}
|
||||
|
||||
public String getPortName()
|
||||
{
|
||||
return portName;
|
||||
}
|
||||
|
||||
public void setPortType(String portType)
|
||||
{
|
||||
this.portType = portType;
|
||||
}
|
||||
|
||||
public String getPortType()
|
||||
{
|
||||
return portType;
|
||||
}
|
||||
|
||||
public void setPortDesc(String portDesc)
|
||||
{
|
||||
this.portDesc = portDesc;
|
||||
}
|
||||
|
||||
public String getPortDesc()
|
||||
{
|
||||
return portDesc;
|
||||
}
|
||||
|
||||
public void setCreateMan(String createMan)
|
||||
{
|
||||
this.createMan = createMan;
|
||||
}
|
||||
|
||||
public String getCreateMan()
|
||||
{
|
||||
return createMan;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("portName", getPortName())
|
||||
.append("portType", getPortType())
|
||||
.append("portDesc", getPortDesc())
|
||||
.append("createMan", getCreateMan())
|
||||
.append("createTime", getCreateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.ruoyi.bas.port.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.bas.port.domain.BasProductPort;
|
||||
|
||||
/**
|
||||
* 基础点位Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-05-29
|
||||
*/
|
||||
public interface BasProductPortMapper
|
||||
{
|
||||
/**
|
||||
* 查询基础点位
|
||||
*
|
||||
* @param id 基础点位主键
|
||||
* @return 基础点位
|
||||
*/
|
||||
public BasProductPort selectBasProductPortById(String id);
|
||||
|
||||
/**
|
||||
* 查询基础点位列表
|
||||
*
|
||||
* @param basProductPort 基础点位
|
||||
* @return 基础点位集合
|
||||
*/
|
||||
public List<BasProductPort> selectBasProductPortList(BasProductPort basProductPort);
|
||||
|
||||
/**
|
||||
* 新增基础点位
|
||||
*
|
||||
* @param basProductPort 基础点位
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBasProductPort(BasProductPort basProductPort);
|
||||
|
||||
/**
|
||||
* 修改基础点位
|
||||
*
|
||||
* @param basProductPort 基础点位
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBasProductPort(BasProductPort basProductPort);
|
||||
|
||||
/**
|
||||
* 删除基础点位
|
||||
*
|
||||
* @param id 基础点位主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBasProductPortById(String id);
|
||||
|
||||
/**
|
||||
* 批量删除基础点位
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBasProductPortByIds(String[] ids);
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package com.ruoyi.bas.port.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.bas.port.domain.BasProductPort;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
|
||||
/**
|
||||
* 基础点位Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-05-29
|
||||
*/
|
||||
public interface IBasProductPortService
|
||||
{
|
||||
/**
|
||||
* 查询基础点位
|
||||
*
|
||||
* @param id 基础点位主键
|
||||
* @return 基础点位
|
||||
*/
|
||||
public BasProductPort selectBasProductPortById(String id);
|
||||
|
||||
/**
|
||||
* 查询基础点位列表
|
||||
*
|
||||
* @param basProductPort 基础点位
|
||||
* @return 基础点位集合
|
||||
*/
|
||||
public List<BasProductPort> selectBasProductPortList(BasProductPort basProductPort);
|
||||
|
||||
/**
|
||||
* 新增基础点位
|
||||
*
|
||||
* @param basProductPort 基础点位
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBasProductPort(BasProductPort basProductPort);
|
||||
|
||||
/**
|
||||
* 修改基础点位
|
||||
*
|
||||
* @param basProductPort 基础点位
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBasProductPort(BasProductPort basProductPort);
|
||||
|
||||
/**
|
||||
* 批量删除基础点位
|
||||
*
|
||||
* @param ids 需要删除的基础点位主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBasProductPortByIds(String[] ids);
|
||||
|
||||
/**
|
||||
* 删除基础点位信息
|
||||
*
|
||||
* @param id 基础点位主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBasProductPortById(String id);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,110 @@
|
||||
package com.ruoyi.bas.port.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import com.ruoyi.bas.portrel.domain.BasProductPortRel;
|
||||
import com.ruoyi.bas.portrel.service.IBasProductPortRelService;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
import org.aspectj.weaver.loadtime.Aj;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.bas.port.mapper.BasProductPortMapper;
|
||||
import com.ruoyi.bas.port.domain.BasProductPort;
|
||||
import com.ruoyi.bas.port.service.IBasProductPortService;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* 基础点位Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-05-29
|
||||
*/
|
||||
@Service
|
||||
public class BasProductPortServiceImpl implements IBasProductPortService
|
||||
{
|
||||
@Autowired
|
||||
private BasProductPortMapper basProductPortMapper;
|
||||
@Autowired
|
||||
private IBasProductPortRelService basProductPortRelService;
|
||||
|
||||
/**
|
||||
* 查询基础点位
|
||||
*
|
||||
* @param id 基础点位主键
|
||||
* @return 基础点位
|
||||
*/
|
||||
@Override
|
||||
public BasProductPort selectBasProductPortById(String id)
|
||||
{
|
||||
return basProductPortMapper.selectBasProductPortById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询基础点位列表
|
||||
*
|
||||
* @param basProductPort 基础点位
|
||||
* @return 基础点位
|
||||
*/
|
||||
@Override
|
||||
public List<BasProductPort> selectBasProductPortList(BasProductPort basProductPort)
|
||||
{
|
||||
return basProductPortMapper.selectBasProductPortList(basProductPort);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增基础点位
|
||||
*
|
||||
* @param basProductPort 基础点位
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertBasProductPort(BasProductPort basProductPort)
|
||||
{
|
||||
basProductPort.setCreateTime(DateUtils.getNowDate());
|
||||
basProductPort.setId(IdUtil.fastSimpleUUID());
|
||||
basProductPort.setCreateMan(Convert.toStr(SecurityUtils.getUsername()));
|
||||
return basProductPortMapper.insertBasProductPort(basProductPort);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改基础点位
|
||||
*
|
||||
* @param basProductPort 基础点位
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateBasProductPort(BasProductPort basProductPort)
|
||||
{
|
||||
return basProductPortMapper.updateBasProductPort(basProductPort);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除基础点位
|
||||
*
|
||||
* @param ids 需要删除的基础点位主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBasProductPortByIds(String[] ids)
|
||||
{
|
||||
return basProductPortMapper.deleteBasProductPortByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除基础点位信息
|
||||
*
|
||||
* @param id 基础点位主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBasProductPortById(String id)
|
||||
{
|
||||
return basProductPortMapper.deleteBasProductPortById(id);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,106 @@
|
||||
package com.ruoyi.bas.portrel.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.ruoyi.bas.BasProduct.domain.BasProduct;
|
||||
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.portrel.domain.BasProductPortRel;
|
||||
import com.ruoyi.bas.portrel.service.IBasProductPortRelService;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 点位与物料关联Controller
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-05-29
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/bas/portProductRel")
|
||||
public class BasProductPortRelController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IBasProductPortRelService basProductPortRelService;
|
||||
|
||||
/**
|
||||
* 查询点位与物料关联列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bas:portProductRel:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(BasProductPortRel basProductPortRel)
|
||||
{
|
||||
startPage();
|
||||
List<BasProduct> list = basProductPortRelService.selectBasProductPortRelList(basProductPortRel);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出点位与物料关联列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bas:portProductRel:export')")
|
||||
@Log(title = "点位与物料关联", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, BasProductPortRel basProductPortRel)
|
||||
{
|
||||
List<BasProduct> list = basProductPortRelService.selectBasProductPortRelList(basProductPortRel);
|
||||
ExcelUtil<BasProduct> util = new ExcelUtil<BasProduct>(BasProduct.class);
|
||||
util.exportExcel(response, list, "点位与物料关联数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取点位与物料关联详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bas:portProductRel:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(basProductPortRelService.selectBasProductPortRelById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增点位与物料关联
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bas:portProductRel:add')")
|
||||
@Log(title = "点位与物料关联", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody BasProductPortRel basProductPortRel)
|
||||
{
|
||||
return toAjax(basProductPortRelService.insertBasProductPortRel(basProductPortRel));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改点位与物料关联
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bas:portProductRel:edit')")
|
||||
@Log(title = "点位与物料关联", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody BasProductPortRel basProductPortRel)
|
||||
{
|
||||
return toAjax(basProductPortRelService.updateBasProductPortRel(basProductPortRel));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除点位与物料关联
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bas:portProductRel:remove')")
|
||||
@Log(title = "点位与物料关联", businessType = BusinessType.DELETE)
|
||||
@PostMapping("/unbind")
|
||||
public AjaxResult remove(@RequestBody BasProductPortRel basProductPortRel)
|
||||
{
|
||||
return toAjax(basProductPortRelService.deleteRelBatch(basProductPortRel));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
package com.ruoyi.bas.portrel.domain;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.ToString;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 点位与物料关联对象 bas_product_port_rel
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-05-29
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@ToString
|
||||
public class BasProductPortRel extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** id */
|
||||
private Long id;
|
||||
|
||||
/** 物料GUID */
|
||||
@Excel(name = "物料GUID")
|
||||
private String productGuid;
|
||||
|
||||
/** 物料id */
|
||||
@Excel(name = "物料id")
|
||||
private String productId;
|
||||
|
||||
/** 点位id */
|
||||
@Excel(name = "点位id")
|
||||
private String portId;
|
||||
|
||||
/**
|
||||
* 绑定状态
|
||||
*/
|
||||
private String bindStatus;
|
||||
/**
|
||||
* 物料名称
|
||||
*/
|
||||
private String productName;
|
||||
|
||||
private List<String> productIds;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
package com.ruoyi.bas.portrel.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ruoyi.bas.BasProduct.domain.BasProduct;
|
||||
import com.ruoyi.bas.portrel.domain.BasProductPortRel;
|
||||
|
||||
/**
|
||||
* 点位与物料关联Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-05-29
|
||||
*/
|
||||
public interface BasProductPortRelMapper
|
||||
{
|
||||
/**
|
||||
* 查询点位与物料关联
|
||||
*
|
||||
* @param id 点位与物料关联主键
|
||||
* @return 点位与物料关联
|
||||
*/
|
||||
public BasProductPortRel selectBasProductPortRelById(Long id);
|
||||
|
||||
/**
|
||||
* 查询点位与物料关联列表
|
||||
*
|
||||
* @param basProductPortRel 点位与物料关联
|
||||
* @return 点位与物料关联集合
|
||||
*/
|
||||
public List<BasProductPortRel> selectBasProductPortRelList(BasProductPortRel basProductPortRel);
|
||||
|
||||
/**
|
||||
* 新增点位与物料关联
|
||||
*
|
||||
* @param basProductPortRel 点位与物料关联
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBasProductPortRel(BasProductPortRel basProductPortRel);
|
||||
|
||||
/**
|
||||
* 修改点位与物料关联
|
||||
*
|
||||
* @param basProductPortRel 点位与物料关联
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBasProductPortRel(BasProductPortRel basProductPortRel);
|
||||
|
||||
/**
|
||||
* 删除点位与物料关联
|
||||
*
|
||||
* @param id 点位与物料关联主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBasProductPortRelById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除点位与物料关联
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBasProductPortRelByIds(Long[] ids);
|
||||
|
||||
List<BasProduct> selectNotBindProduct(BasProductPortRel basProductPortRel);
|
||||
|
||||
int deleteBasProductPortRel(BasProductPortRel rel);
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package com.ruoyi.bas.portrel.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ruoyi.bas.BasProduct.domain.BasProduct;
|
||||
import com.ruoyi.bas.portrel.domain.BasProductPortRel;
|
||||
|
||||
/**
|
||||
* 点位与物料关联Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-05-29
|
||||
*/
|
||||
public interface IBasProductPortRelService
|
||||
{
|
||||
/**
|
||||
* 查询点位与物料关联
|
||||
*
|
||||
* @param id 点位与物料关联主键
|
||||
* @return 点位与物料关联
|
||||
*/
|
||||
public BasProductPortRel selectBasProductPortRelById(Long id);
|
||||
|
||||
/**
|
||||
* 查询点位与物料关联列表
|
||||
*
|
||||
* @param basProductPortRel 点位与物料关联
|
||||
* @return 点位与物料关联集合
|
||||
*/
|
||||
public List<BasProduct> selectBasProductPortRelList(BasProductPortRel basProductPortRel);
|
||||
|
||||
/**
|
||||
* 新增点位与物料关联
|
||||
*
|
||||
* @param basProductPortRel 点位与物料关联
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBasProductPortRel(BasProductPortRel basProductPortRel);
|
||||
|
||||
/**
|
||||
* 修改点位与物料关联
|
||||
*
|
||||
* @param basProductPortRel 点位与物料关联
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBasProductPortRel(BasProductPortRel basProductPortRel);
|
||||
|
||||
/**
|
||||
* 批量删除点位与物料关联
|
||||
*
|
||||
* @param ids 需要删除的点位与物料关联主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBasProductPortRelByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除点位与物料关联信息
|
||||
*
|
||||
* @param id 点位与物料关联主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBasProductPortRelById(Long id);
|
||||
|
||||
int deleteRelBatch(BasProductPortRel basProductPortRel);
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
package com.ruoyi.bas.portrel.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ruoyi.bas.BasProduct.domain.BasProduct;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.bas.portrel.mapper.BasProductPortRelMapper;
|
||||
import com.ruoyi.bas.portrel.domain.BasProductPortRel;
|
||||
import com.ruoyi.bas.portrel.service.IBasProductPortRelService;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* 点位与物料关联Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-05-29
|
||||
*/
|
||||
@Service
|
||||
public class BasProductPortRelServiceImpl implements IBasProductPortRelService
|
||||
{
|
||||
@Autowired
|
||||
private BasProductPortRelMapper basProductPortRelMapper;
|
||||
|
||||
/**
|
||||
* 查询点位与物料关联
|
||||
*
|
||||
* @param id 点位与物料关联主键
|
||||
* @return 点位与物料关联
|
||||
*/
|
||||
@Override
|
||||
public BasProductPortRel selectBasProductPortRelById(Long id)
|
||||
{
|
||||
return basProductPortRelMapper.selectBasProductPortRelById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询点位与物料关联列表
|
||||
*
|
||||
* @param basProductPortRel 点位与物料关联
|
||||
* @return 点位与物料关联
|
||||
*/
|
||||
@Override
|
||||
public List<BasProduct> selectBasProductPortRelList(BasProductPortRel basProductPortRel)
|
||||
{
|
||||
return basProductPortRelMapper.selectNotBindProduct(basProductPortRel);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增点位与物料关联
|
||||
*
|
||||
* @param basProductPortRel 点位与物料关联
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertBasProductPortRel(BasProductPortRel basProductPortRel)
|
||||
{
|
||||
int i = 0;
|
||||
for (String productId : basProductPortRel.getProductIds()) {
|
||||
BasProductPortRel basProductPortRel1 = new BasProductPortRel();
|
||||
basProductPortRel1.setProductId(productId);
|
||||
basProductPortRel1.setPortId(basProductPortRel.getPortId());
|
||||
i +=basProductPortRelMapper.insertBasProductPortRel(basProductPortRel1);
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改点位与物料关联
|
||||
*
|
||||
* @param basProductPortRel 点位与物料关联
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateBasProductPortRel(BasProductPortRel basProductPortRel)
|
||||
{
|
||||
return basProductPortRelMapper.updateBasProductPortRel(basProductPortRel);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除点位与物料关联
|
||||
*
|
||||
* @param ids 需要删除的点位与物料关联主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBasProductPortRelByIds(Long[] ids)
|
||||
{
|
||||
return basProductPortRelMapper.deleteBasProductPortRelByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除点位与物料关联信息
|
||||
*
|
||||
* @param id 点位与物料关联主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBasProductPortRelById(Long id)
|
||||
{
|
||||
return basProductPortRelMapper.deleteBasProductPortRelById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public int deleteRelBatch(BasProductPortRel basProductPortRel) {
|
||||
return basProductPortRelMapper.deleteBasProductPortRel(basProductPortRel);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user