项目初始化 放货点位管理 缓存点位管理 接口记录管理
This commit is contained in:
@@ -0,0 +1,104 @@
|
||||
package com.ruoyi.bas.cachePort.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.cachePort.domain.WcsCachePort;
|
||||
import com.ruoyi.bas.cachePort.service.IWcsCachePortService;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 缓存点管理Controller
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-06-11
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/bas/cachePort")
|
||||
public class WcsCachePortController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IWcsCachePortService wcsCachePortService;
|
||||
|
||||
/**
|
||||
* 查询缓存点管理列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bas:cachePort:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(WcsCachePort wcsCachePort)
|
||||
{
|
||||
startPage();
|
||||
List<WcsCachePort> list = wcsCachePortService.selectWcsCachePortList(wcsCachePort);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出缓存点管理列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bas:cachePort:export')")
|
||||
@Log(title = "缓存点管理", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, WcsCachePort wcsCachePort)
|
||||
{
|
||||
List<WcsCachePort> list = wcsCachePortService.selectWcsCachePortList(wcsCachePort);
|
||||
ExcelUtil<WcsCachePort> util = new ExcelUtil<WcsCachePort>(WcsCachePort.class);
|
||||
util.exportExcel(response, list, "缓存点管理数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取缓存点管理详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bas:cachePort:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(wcsCachePortService.selectWcsCachePortById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增缓存点管理
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bas:cachePort:add')")
|
||||
@Log(title = "缓存点管理", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody WcsCachePort wcsCachePort)
|
||||
{
|
||||
return toAjax(wcsCachePortService.insertWcsCachePort(wcsCachePort));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改缓存点管理
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bas:cachePort:edit')")
|
||||
@Log(title = "缓存点管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody WcsCachePort wcsCachePort)
|
||||
{
|
||||
return toAjax(wcsCachePortService.updateWcsCachePort(wcsCachePort));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除缓存点管理
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bas:cachePort:remove')")
|
||||
@Log(title = "缓存点管理", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(wcsCachePortService.deleteWcsCachePortByIds(ids));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,157 @@
|
||||
package com.ruoyi.bas.cachePort.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;
|
||||
|
||||
/**
|
||||
* 缓存点管理对象 wcs_cache_port
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-06-11
|
||||
*/
|
||||
public class WcsCachePort extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键 */
|
||||
private Long id;
|
||||
|
||||
/** 点位编码 */
|
||||
@Excel(name = "点位编码")
|
||||
private String portCode;
|
||||
|
||||
/** 点位名称 */
|
||||
@Excel(name = "点位名称")
|
||||
private String portName;
|
||||
|
||||
/** 1-ctu放货点位 2-高架库放货点位 3-平库放货点位 */
|
||||
@Excel(name = "1-ctu放货点位 2-高架库放货点位 3-平库放货点位")
|
||||
private String portType;
|
||||
|
||||
/** 点位区域 */
|
||||
@Excel(name = "点位区域")
|
||||
private String portRegion;
|
||||
|
||||
/** 备用字段 */
|
||||
@Excel(name = "备用字段")
|
||||
private String spare1;
|
||||
|
||||
/** 备用字段 */
|
||||
@Excel(name = "备用字段")
|
||||
private String spare2;
|
||||
|
||||
/** 备用字段 */
|
||||
@Excel(name = "备用字段")
|
||||
private String spare3;
|
||||
|
||||
/** 点位状态 */
|
||||
@Excel(name = "点位状态")
|
||||
private String status;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setPortCode(String portCode)
|
||||
{
|
||||
this.portCode = portCode;
|
||||
}
|
||||
|
||||
public String getPortCode()
|
||||
{
|
||||
return portCode;
|
||||
}
|
||||
|
||||
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 setPortRegion(String portRegion)
|
||||
{
|
||||
this.portRegion = portRegion;
|
||||
}
|
||||
|
||||
public String getPortRegion()
|
||||
{
|
||||
return portRegion;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
public void setStatus(String status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("portCode", getPortCode())
|
||||
.append("portName", getPortName())
|
||||
.append("portType", getPortType())
|
||||
.append("portRegion", getPortRegion())
|
||||
.append("spare1", getSpare1())
|
||||
.append("spare2", getSpare2())
|
||||
.append("spare3", getSpare3())
|
||||
.append("status", getStatus())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.ruoyi.bas.cachePort.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.bas.cachePort.domain.WcsCachePort;
|
||||
|
||||
/**
|
||||
* 缓存点管理Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-06-11
|
||||
*/
|
||||
public interface WcsCachePortMapper
|
||||
{
|
||||
/**
|
||||
* 查询缓存点管理
|
||||
*
|
||||
* @param id 缓存点管理主键
|
||||
* @return 缓存点管理
|
||||
*/
|
||||
public WcsCachePort selectWcsCachePortById(Long id);
|
||||
|
||||
/**
|
||||
* 查询缓存点管理列表
|
||||
*
|
||||
* @param wcsCachePort 缓存点管理
|
||||
* @return 缓存点管理集合
|
||||
*/
|
||||
public List<WcsCachePort> selectWcsCachePortList(WcsCachePort wcsCachePort);
|
||||
|
||||
/**
|
||||
* 新增缓存点管理
|
||||
*
|
||||
* @param wcsCachePort 缓存点管理
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertWcsCachePort(WcsCachePort wcsCachePort);
|
||||
|
||||
/**
|
||||
* 修改缓存点管理
|
||||
*
|
||||
* @param wcsCachePort 缓存点管理
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateWcsCachePort(WcsCachePort wcsCachePort);
|
||||
|
||||
/**
|
||||
* 删除缓存点管理
|
||||
*
|
||||
* @param id 缓存点管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWcsCachePortById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除缓存点管理
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWcsCachePortByIds(Long[] ids);
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.ruoyi.bas.cachePort.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.bas.cachePort.domain.WcsCachePort;
|
||||
|
||||
/**
|
||||
* 缓存点管理Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-06-11
|
||||
*/
|
||||
public interface IWcsCachePortService
|
||||
{
|
||||
/**
|
||||
* 查询缓存点管理
|
||||
*
|
||||
* @param id 缓存点管理主键
|
||||
* @return 缓存点管理
|
||||
*/
|
||||
public WcsCachePort selectWcsCachePortById(Long id);
|
||||
|
||||
/**
|
||||
* 查询缓存点管理列表
|
||||
*
|
||||
* @param wcsCachePort 缓存点管理
|
||||
* @return 缓存点管理集合
|
||||
*/
|
||||
public List<WcsCachePort> selectWcsCachePortList(WcsCachePort wcsCachePort);
|
||||
|
||||
/**
|
||||
* 新增缓存点管理
|
||||
*
|
||||
* @param wcsCachePort 缓存点管理
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertWcsCachePort(WcsCachePort wcsCachePort);
|
||||
|
||||
/**
|
||||
* 修改缓存点管理
|
||||
*
|
||||
* @param wcsCachePort 缓存点管理
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateWcsCachePort(WcsCachePort wcsCachePort);
|
||||
|
||||
/**
|
||||
* 批量删除缓存点管理
|
||||
*
|
||||
* @param ids 需要删除的缓存点管理主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWcsCachePortByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除缓存点管理信息
|
||||
*
|
||||
* @param id 缓存点管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWcsCachePortById(Long id);
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
package com.ruoyi.bas.cachePort.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.bas.cachePort.mapper.WcsCachePortMapper;
|
||||
import com.ruoyi.bas.cachePort.domain.WcsCachePort;
|
||||
import com.ruoyi.bas.cachePort.service.IWcsCachePortService;
|
||||
|
||||
/**
|
||||
* 缓存点管理Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-06-11
|
||||
*/
|
||||
@Service
|
||||
public class WcsCachePortServiceImpl implements IWcsCachePortService
|
||||
{
|
||||
@Autowired
|
||||
private WcsCachePortMapper wcsCachePortMapper;
|
||||
|
||||
/**
|
||||
* 查询缓存点管理
|
||||
*
|
||||
* @param id 缓存点管理主键
|
||||
* @return 缓存点管理
|
||||
*/
|
||||
@Override
|
||||
public WcsCachePort selectWcsCachePortById(Long id)
|
||||
{
|
||||
return wcsCachePortMapper.selectWcsCachePortById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询缓存点管理列表
|
||||
*
|
||||
* @param wcsCachePort 缓存点管理
|
||||
* @return 缓存点管理
|
||||
*/
|
||||
@Override
|
||||
public List<WcsCachePort> selectWcsCachePortList(WcsCachePort wcsCachePort)
|
||||
{
|
||||
return wcsCachePortMapper.selectWcsCachePortList(wcsCachePort);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增缓存点管理
|
||||
*
|
||||
* @param wcsCachePort 缓存点管理
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertWcsCachePort(WcsCachePort wcsCachePort)
|
||||
{
|
||||
return wcsCachePortMapper.insertWcsCachePort(wcsCachePort);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改缓存点管理
|
||||
*
|
||||
* @param wcsCachePort 缓存点管理
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateWcsCachePort(WcsCachePort wcsCachePort)
|
||||
{
|
||||
return wcsCachePortMapper.updateWcsCachePort(wcsCachePort);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除缓存点管理
|
||||
*
|
||||
* @param ids 需要删除的缓存点管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteWcsCachePortByIds(Long[] ids)
|
||||
{
|
||||
return wcsCachePortMapper.deleteWcsCachePortByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除缓存点管理信息
|
||||
*
|
||||
* @param id 缓存点管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteWcsCachePortById(Long id)
|
||||
{
|
||||
return wcsCachePortMapper.deleteWcsCachePortById(id);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
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.WcsPort;
|
||||
import com.ruoyi.bas.port.service.IWcsPortService;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 点位管理Controller
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-06-11
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/bas/port")
|
||||
public class WcsPortController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IWcsPortService wcsPortService;
|
||||
|
||||
/**
|
||||
* 查询点位管理列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bas:port:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(WcsPort wcsPort)
|
||||
{
|
||||
startPage();
|
||||
List<WcsPort> list = wcsPortService.selectWcsPortList(wcsPort);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出点位管理列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bas:port:export')")
|
||||
@Log(title = "点位管理", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, WcsPort wcsPort)
|
||||
{
|
||||
List<WcsPort> list = wcsPortService.selectWcsPortList(wcsPort);
|
||||
ExcelUtil<WcsPort> util = new ExcelUtil<WcsPort>(WcsPort.class);
|
||||
util.exportExcel(response, list, "点位管理数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取点位管理详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bas:port:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(wcsPortService.selectWcsPortById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增点位管理
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bas:port:add')")
|
||||
@Log(title = "点位管理", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody WcsPort wcsPort)
|
||||
{
|
||||
return toAjax(wcsPortService.insertWcsPort(wcsPort));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改点位管理
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bas:port:edit')")
|
||||
@Log(title = "点位管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody WcsPort wcsPort)
|
||||
{
|
||||
return toAjax(wcsPortService.updateWcsPort(wcsPort));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除点位管理
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bas:port:remove')")
|
||||
@Log(title = "点位管理", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(wcsPortService.deleteWcsPortByIds(ids));
|
||||
}
|
||||
}
|
||||
157
ruoyi-admin/src/main/java/com/ruoyi/bas/port/domain/WcsPort.java
Normal file
157
ruoyi-admin/src/main/java/com/ruoyi/bas/port/domain/WcsPort.java
Normal file
@@ -0,0 +1,157 @@
|
||||
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;
|
||||
|
||||
/**
|
||||
* 点位管理对象 wcs_port
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-06-11
|
||||
*/
|
||||
public class WcsPort extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键 */
|
||||
private Long id;
|
||||
|
||||
/** 点位编码 */
|
||||
@Excel(name = "点位编码")
|
||||
private String portCode;
|
||||
|
||||
/** 点位名称 */
|
||||
@Excel(name = "点位名称")
|
||||
private String portName;
|
||||
|
||||
/** 点位类型 */
|
||||
@Excel(name = "点位类型")
|
||||
private String portType;
|
||||
|
||||
/** 点位区域 */
|
||||
@Excel(name = "点位区域")
|
||||
private String portRegion;
|
||||
|
||||
/** 备用字段 */
|
||||
@Excel(name = "备用字段")
|
||||
private String spare1;
|
||||
|
||||
/** 备用字段 */
|
||||
@Excel(name = "备用字段")
|
||||
private String spare2;
|
||||
|
||||
/** 备用字段 */
|
||||
@Excel(name = "备用字段")
|
||||
private String spare3;
|
||||
|
||||
/** 状态 */
|
||||
@Excel(name = "状态")
|
||||
private String status;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setPortCode(String portCode)
|
||||
{
|
||||
this.portCode = portCode;
|
||||
}
|
||||
|
||||
public String getPortCode()
|
||||
{
|
||||
return portCode;
|
||||
}
|
||||
|
||||
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 setPortRegion(String portRegion)
|
||||
{
|
||||
this.portRegion = portRegion;
|
||||
}
|
||||
|
||||
public String getPortRegion()
|
||||
{
|
||||
return portRegion;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
public void setStatus(String status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("portCode", getPortCode())
|
||||
.append("portName", getPortName())
|
||||
.append("portType", getPortType())
|
||||
.append("portRegion", getPortRegion())
|
||||
.append("spare1", getSpare1())
|
||||
.append("spare2", getSpare2())
|
||||
.append("spare3", getSpare3())
|
||||
.append("status", getStatus())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.ruoyi.bas.port.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.bas.port.domain.WcsPort;
|
||||
|
||||
/**
|
||||
* 点位管理Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-06-11
|
||||
*/
|
||||
public interface WcsPortMapper
|
||||
{
|
||||
/**
|
||||
* 查询点位管理
|
||||
*
|
||||
* @param id 点位管理主键
|
||||
* @return 点位管理
|
||||
*/
|
||||
public WcsPort selectWcsPortById(Long id);
|
||||
|
||||
/**
|
||||
* 查询点位管理列表
|
||||
*
|
||||
* @param wcsPort 点位管理
|
||||
* @return 点位管理集合
|
||||
*/
|
||||
public List<WcsPort> selectWcsPortList(WcsPort wcsPort);
|
||||
|
||||
/**
|
||||
* 新增点位管理
|
||||
*
|
||||
* @param wcsPort 点位管理
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertWcsPort(WcsPort wcsPort);
|
||||
|
||||
/**
|
||||
* 修改点位管理
|
||||
*
|
||||
* @param wcsPort 点位管理
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateWcsPort(WcsPort wcsPort);
|
||||
|
||||
/**
|
||||
* 删除点位管理
|
||||
*
|
||||
* @param id 点位管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWcsPortById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除点位管理
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWcsPortByIds(Long[] ids);
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.ruoyi.bas.port.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.bas.port.domain.WcsPort;
|
||||
|
||||
/**
|
||||
* 点位管理Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-06-11
|
||||
*/
|
||||
public interface IWcsPortService
|
||||
{
|
||||
/**
|
||||
* 查询点位管理
|
||||
*
|
||||
* @param id 点位管理主键
|
||||
* @return 点位管理
|
||||
*/
|
||||
public WcsPort selectWcsPortById(Long id);
|
||||
|
||||
/**
|
||||
* 查询点位管理列表
|
||||
*
|
||||
* @param wcsPort 点位管理
|
||||
* @return 点位管理集合
|
||||
*/
|
||||
public List<WcsPort> selectWcsPortList(WcsPort wcsPort);
|
||||
|
||||
/**
|
||||
* 新增点位管理
|
||||
*
|
||||
* @param wcsPort 点位管理
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertWcsPort(WcsPort wcsPort);
|
||||
|
||||
/**
|
||||
* 修改点位管理
|
||||
*
|
||||
* @param wcsPort 点位管理
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateWcsPort(WcsPort wcsPort);
|
||||
|
||||
/**
|
||||
* 批量删除点位管理
|
||||
*
|
||||
* @param ids 需要删除的点位管理主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWcsPortByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除点位管理信息
|
||||
*
|
||||
* @param id 点位管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWcsPortById(Long id);
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
package com.ruoyi.bas.port.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.bas.port.mapper.WcsPortMapper;
|
||||
import com.ruoyi.bas.port.domain.WcsPort;
|
||||
import com.ruoyi.bas.port.service.IWcsPortService;
|
||||
|
||||
/**
|
||||
* 点位管理Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-06-11
|
||||
*/
|
||||
@Service
|
||||
public class WcsPortServiceImpl implements IWcsPortService
|
||||
{
|
||||
@Autowired
|
||||
private WcsPortMapper wcsPortMapper;
|
||||
|
||||
/**
|
||||
* 查询点位管理
|
||||
*
|
||||
* @param id 点位管理主键
|
||||
* @return 点位管理
|
||||
*/
|
||||
@Override
|
||||
public WcsPort selectWcsPortById(Long id)
|
||||
{
|
||||
return wcsPortMapper.selectWcsPortById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询点位管理列表
|
||||
*
|
||||
* @param wcsPort 点位管理
|
||||
* @return 点位管理
|
||||
*/
|
||||
@Override
|
||||
public List<WcsPort> selectWcsPortList(WcsPort wcsPort)
|
||||
{
|
||||
return wcsPortMapper.selectWcsPortList(wcsPort);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增点位管理
|
||||
*
|
||||
* @param wcsPort 点位管理
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertWcsPort(WcsPort wcsPort)
|
||||
{
|
||||
return wcsPortMapper.insertWcsPort(wcsPort);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改点位管理
|
||||
*
|
||||
* @param wcsPort 点位管理
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateWcsPort(WcsPort wcsPort)
|
||||
{
|
||||
return wcsPortMapper.updateWcsPort(wcsPort);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除点位管理
|
||||
*
|
||||
* @param ids 需要删除的点位管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteWcsPortByIds(Long[] ids)
|
||||
{
|
||||
return wcsPortMapper.deleteWcsPortByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除点位管理信息
|
||||
*
|
||||
* @param id 点位管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteWcsPortById(Long id)
|
||||
{
|
||||
return wcsPortMapper.deleteWcsPortById(id);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
package com.ruoyi.device.api.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.device.api.domain.RequestLog;
|
||||
import com.ruoyi.device.api.service.IRequestLogService;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 接口记录Controller
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-06-11
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/device/api")
|
||||
public class RequestLogController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IRequestLogService requestLogService;
|
||||
|
||||
/**
|
||||
* 查询接口记录列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('device:api:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(RequestLog requestLog)
|
||||
{
|
||||
startPage();
|
||||
List<RequestLog> list = requestLogService.selectRequestLogList(requestLog);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出接口记录列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('device:api:export')")
|
||||
@Log(title = "接口记录", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, RequestLog requestLog)
|
||||
{
|
||||
List<RequestLog> list = requestLogService.selectRequestLogList(requestLog);
|
||||
ExcelUtil<RequestLog> util = new ExcelUtil<RequestLog>(RequestLog.class);
|
||||
util.exportExcel(response, list, "接口记录数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取接口记录详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('device:api:query')")
|
||||
@GetMapping(value = "/{requestId}")
|
||||
public AjaxResult getInfo(@PathVariable("requestId") Long requestId)
|
||||
{
|
||||
return success(requestLogService.selectRequestLogByRequestId(requestId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增接口记录
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('device:api:add')")
|
||||
@Log(title = "接口记录", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody RequestLog requestLog)
|
||||
{
|
||||
return toAjax(requestLogService.insertRequestLog(requestLog));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改接口记录
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('device:api:edit')")
|
||||
@Log(title = "接口记录", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody RequestLog requestLog)
|
||||
{
|
||||
return toAjax(requestLogService.updateRequestLog(requestLog));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除接口记录
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('device:api:remove')")
|
||||
@Log(title = "接口记录", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{requestIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] requestIds)
|
||||
{
|
||||
return toAjax(requestLogService.deleteRequestLogByRequestIds(requestIds));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.ruoyi.device.api.domain;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.ToString;
|
||||
|
||||
/**
|
||||
* 接口接收类
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
@ToString
|
||||
public class InterfaceReceive {
|
||||
|
||||
private Integer code;
|
||||
private String msg;
|
||||
private Object data;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,247 @@
|
||||
package com.ruoyi.device.api.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;
|
||||
|
||||
/**
|
||||
* 接口记录对象 request_log
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-06-11
|
||||
*/
|
||||
public class RequestLog extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 请求id */
|
||||
private Long requestId;
|
||||
|
||||
/** 请求时间 */
|
||||
@Excel(name = "请求时间")
|
||||
private String requestTime;
|
||||
|
||||
/** 来源系统 */
|
||||
@Excel(name = "来源系统")
|
||||
private String sourceSystem;
|
||||
|
||||
/** 目标系统 */
|
||||
@Excel(name = "目标系统")
|
||||
private String targetSystem;
|
||||
|
||||
/** 接口名称 */
|
||||
@Excel(name = "接口名称")
|
||||
private String endpoint;
|
||||
|
||||
/** url路径 */
|
||||
@Excel(name = "url路径")
|
||||
private String requestUrl;
|
||||
|
||||
/** 请求方式 */
|
||||
@Excel(name = "请求方式")
|
||||
private String requestMethod;
|
||||
|
||||
/** 请求头信息 */
|
||||
@Excel(name = "请求头信息")
|
||||
private String requestHeaders;
|
||||
|
||||
/** 请求参数 */
|
||||
@Excel(name = "请求参数")
|
||||
private String requestBody;
|
||||
|
||||
/** 响应时间 */
|
||||
@Excel(name = "响应时间")
|
||||
private String responseTime;
|
||||
|
||||
/** 响应主体 */
|
||||
@Excel(name = "响应主体")
|
||||
private String responseBody;
|
||||
|
||||
/** 响应状态 */
|
||||
@Excel(name = "响应状态")
|
||||
private String responseStatus;
|
||||
|
||||
/** 错误信息 */
|
||||
@Excel(name = "错误信息")
|
||||
private String errorDetails;
|
||||
|
||||
/** 耗时 */
|
||||
@Excel(name = "耗时")
|
||||
private String duration;
|
||||
|
||||
/** 是否成功 */
|
||||
@Excel(name = "是否成功",dictType = "interface_status")
|
||||
private String isSuccessful;
|
||||
|
||||
public void setRequestId(Long requestId)
|
||||
{
|
||||
this.requestId = requestId;
|
||||
}
|
||||
|
||||
public Long getRequestId()
|
||||
{
|
||||
return requestId;
|
||||
}
|
||||
|
||||
public void setRequestTime(String requestTime)
|
||||
{
|
||||
this.requestTime = requestTime;
|
||||
}
|
||||
|
||||
public String getRequestTime()
|
||||
{
|
||||
return requestTime;
|
||||
}
|
||||
|
||||
public void setSourceSystem(String sourceSystem)
|
||||
{
|
||||
this.sourceSystem = sourceSystem;
|
||||
}
|
||||
|
||||
public String getSourceSystem()
|
||||
{
|
||||
return sourceSystem;
|
||||
}
|
||||
|
||||
public void setTargetSystem(String targetSystem)
|
||||
{
|
||||
this.targetSystem = targetSystem;
|
||||
}
|
||||
|
||||
public String getTargetSystem()
|
||||
{
|
||||
return targetSystem;
|
||||
}
|
||||
|
||||
public void setEndpoint(String endpoint)
|
||||
{
|
||||
this.endpoint = endpoint;
|
||||
}
|
||||
|
||||
public String getEndpoint()
|
||||
{
|
||||
return endpoint;
|
||||
}
|
||||
|
||||
public void setRequestUrl(String requestUrl)
|
||||
{
|
||||
this.requestUrl = requestUrl;
|
||||
}
|
||||
|
||||
public String getRequestUrl()
|
||||
{
|
||||
return requestUrl;
|
||||
}
|
||||
|
||||
public void setRequestMethod(String requestMethod)
|
||||
{
|
||||
this.requestMethod = requestMethod;
|
||||
}
|
||||
|
||||
public String getRequestMethod()
|
||||
{
|
||||
return requestMethod;
|
||||
}
|
||||
|
||||
public void setRequestHeaders(String requestHeaders)
|
||||
{
|
||||
this.requestHeaders = requestHeaders;
|
||||
}
|
||||
|
||||
public String getRequestHeaders()
|
||||
{
|
||||
return requestHeaders;
|
||||
}
|
||||
|
||||
public void setRequestBody(String requestBody)
|
||||
{
|
||||
this.requestBody = requestBody;
|
||||
}
|
||||
|
||||
public String getRequestBody()
|
||||
{
|
||||
return requestBody;
|
||||
}
|
||||
|
||||
public void setResponseTime(String responseTime)
|
||||
{
|
||||
this.responseTime = responseTime;
|
||||
}
|
||||
|
||||
public String getResponseTime()
|
||||
{
|
||||
return responseTime;
|
||||
}
|
||||
|
||||
public void setResponseBody(String responseBody)
|
||||
{
|
||||
this.responseBody = responseBody;
|
||||
}
|
||||
|
||||
public String getResponseBody()
|
||||
{
|
||||
return responseBody;
|
||||
}
|
||||
|
||||
public void setResponseStatus(String responseStatus)
|
||||
{
|
||||
this.responseStatus = responseStatus;
|
||||
}
|
||||
|
||||
public String getResponseStatus()
|
||||
{
|
||||
return responseStatus;
|
||||
}
|
||||
|
||||
public void setErrorDetails(String errorDetails)
|
||||
{
|
||||
this.errorDetails = errorDetails;
|
||||
}
|
||||
|
||||
public String getErrorDetails()
|
||||
{
|
||||
return errorDetails;
|
||||
}
|
||||
|
||||
public void setDuration(String duration)
|
||||
{
|
||||
this.duration = duration;
|
||||
}
|
||||
|
||||
public String getDuration()
|
||||
{
|
||||
return duration;
|
||||
}
|
||||
|
||||
public void setIsSuccessful(String isSuccessful)
|
||||
{
|
||||
this.isSuccessful = isSuccessful;
|
||||
}
|
||||
|
||||
public String getIsSuccessful()
|
||||
{
|
||||
return isSuccessful;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("requestId", getRequestId())
|
||||
.append("requestTime", getRequestTime())
|
||||
.append("sourceSystem", getSourceSystem())
|
||||
.append("targetSystem", getTargetSystem())
|
||||
.append("endpoint", getEndpoint())
|
||||
.append("requestUrl", getRequestUrl())
|
||||
.append("requestMethod", getRequestMethod())
|
||||
.append("requestHeaders", getRequestHeaders())
|
||||
.append("requestBody", getRequestBody())
|
||||
.append("responseTime", getResponseTime())
|
||||
.append("responseBody", getResponseBody())
|
||||
.append("responseStatus", getResponseStatus())
|
||||
.append("errorDetails", getErrorDetails())
|
||||
.append("duration", getDuration())
|
||||
.append("isSuccessful", getIsSuccessful())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.ruoyi.device.api.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.device.api.domain.RequestLog;
|
||||
|
||||
/**
|
||||
* 接口记录Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-06-11
|
||||
*/
|
||||
public interface RequestLogMapper
|
||||
{
|
||||
/**
|
||||
* 查询接口记录
|
||||
*
|
||||
* @param requestId 接口记录主键
|
||||
* @return 接口记录
|
||||
*/
|
||||
public RequestLog selectRequestLogByRequestId(Long requestId);
|
||||
|
||||
/**
|
||||
* 查询接口记录列表
|
||||
*
|
||||
* @param requestLog 接口记录
|
||||
* @return 接口记录集合
|
||||
*/
|
||||
public List<RequestLog> selectRequestLogList(RequestLog requestLog);
|
||||
|
||||
/**
|
||||
* 新增接口记录
|
||||
*
|
||||
* @param requestLog 接口记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertRequestLog(RequestLog requestLog);
|
||||
|
||||
/**
|
||||
* 修改接口记录
|
||||
*
|
||||
* @param requestLog 接口记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateRequestLog(RequestLog requestLog);
|
||||
|
||||
/**
|
||||
* 删除接口记录
|
||||
*
|
||||
* @param requestId 接口记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRequestLogByRequestId(Long requestId);
|
||||
|
||||
/**
|
||||
* 批量删除接口记录
|
||||
*
|
||||
* @param requestIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRequestLogByRequestIds(Long[] requestIds);
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.ruoyi.device.api.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.device.api.domain.RequestLog;
|
||||
|
||||
/**
|
||||
* 接口记录Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-06-11
|
||||
*/
|
||||
public interface IRequestLogService
|
||||
{
|
||||
/**
|
||||
* 查询接口记录
|
||||
*
|
||||
* @param requestId 接口记录主键
|
||||
* @return 接口记录
|
||||
*/
|
||||
public RequestLog selectRequestLogByRequestId(Long requestId);
|
||||
|
||||
/**
|
||||
* 查询接口记录列表
|
||||
*
|
||||
* @param requestLog 接口记录
|
||||
* @return 接口记录集合
|
||||
*/
|
||||
public List<RequestLog> selectRequestLogList(RequestLog requestLog);
|
||||
|
||||
/**
|
||||
* 新增接口记录
|
||||
*
|
||||
* @param requestLog 接口记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertRequestLog(RequestLog requestLog);
|
||||
|
||||
/**
|
||||
* 修改接口记录
|
||||
*
|
||||
* @param requestLog 接口记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateRequestLog(RequestLog requestLog);
|
||||
|
||||
/**
|
||||
* 批量删除接口记录
|
||||
*
|
||||
* @param requestIds 需要删除的接口记录主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRequestLogByRequestIds(Long[] requestIds);
|
||||
|
||||
/**
|
||||
* 删除接口记录信息
|
||||
*
|
||||
* @param requestId 接口记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRequestLogByRequestId(Long requestId);
|
||||
}
|
||||
@@ -0,0 +1,166 @@
|
||||
package com.ruoyi.device.api.service.impl;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.date.DateUnit;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.http.HttpUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.ruoyi.device.api.domain.InterfaceReceive;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.device.api.mapper.RequestLogMapper;
|
||||
import com.ruoyi.device.api.domain.RequestLog;
|
||||
import com.ruoyi.device.api.service.IRequestLogService;
|
||||
|
||||
/**
|
||||
* 接口记录Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-06-11
|
||||
*/
|
||||
@Service
|
||||
public class RequestLogServiceImpl implements IRequestLogService
|
||||
{
|
||||
@Autowired
|
||||
private RequestLogMapper requestLogMapper;
|
||||
|
||||
/**
|
||||
* 查询接口记录
|
||||
*
|
||||
* @param requestId 接口记录主键
|
||||
* @return 接口记录
|
||||
*/
|
||||
@Override
|
||||
public RequestLog selectRequestLogByRequestId(Long requestId)
|
||||
{
|
||||
return requestLogMapper.selectRequestLogByRequestId(requestId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询接口记录列表
|
||||
*
|
||||
* @param requestLog 接口记录
|
||||
* @return 接口记录
|
||||
*/
|
||||
@Override
|
||||
public List<RequestLog> selectRequestLogList(RequestLog requestLog)
|
||||
{
|
||||
return requestLogMapper.selectRequestLogList(requestLog);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增接口记录
|
||||
*
|
||||
* @param requestLog 接口记录
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertRequestLog(RequestLog requestLog)
|
||||
{
|
||||
return requestLogMapper.insertRequestLog(requestLog);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改接口记录
|
||||
*
|
||||
* @param requestLog 接口记录
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateRequestLog(RequestLog requestLog)
|
||||
{
|
||||
return requestLogMapper.updateRequestLog(requestLog);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除接口记录
|
||||
*
|
||||
* @param requestIds 需要删除的接口记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteRequestLogByRequestIds(Long[] requestIds)
|
||||
{
|
||||
return requestLogMapper.deleteRequestLogByRequestIds(requestIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除接口记录信息
|
||||
*
|
||||
* @param requestId 接口记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteRequestLogByRequestId(Long requestId)
|
||||
{
|
||||
return requestLogMapper.deleteRequestLogByRequestId(requestId);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 插入请求日志
|
||||
*
|
||||
* @param url 请求url
|
||||
* @param param 参数
|
||||
* @return requestLog
|
||||
*/
|
||||
private RequestLog getRequestLog(String url, String param, String endPoint) {
|
||||
RequestLog requestLog = new RequestLog();
|
||||
Date requestTime = new Date();
|
||||
requestLog.setRequestTime(DateUtil.format(requestTime, "yyyy-MM-dd HH:mm:ss"));
|
||||
requestLog.setSourceSystem("wcs");
|
||||
requestLog.setTargetSystem("wms");
|
||||
requestLog.setEndpoint(endPoint);
|
||||
requestLog.setRequestMethod("post");
|
||||
requestLog.setRequestHeaders(null);
|
||||
requestLog.setRequestBody(param);
|
||||
requestLog.setRequestUrl(url);
|
||||
try {
|
||||
String resStr = HttpUtil.post(url, param);
|
||||
requestLog.setResponseBody(resStr);
|
||||
InterfaceReceive bean = JSONUtil.toBean(resStr, InterfaceReceive.class);
|
||||
Date responseTime =new Date();
|
||||
if (bean.getCode() == 0) {
|
||||
requestLog.setResponseTime(DateUtil.format(responseTime, "yyyy-MM-dd HH:mm:ss"));
|
||||
requestLog.setResponseStatus("1");
|
||||
requestLog.setDuration(Convert.toStr(DateUtil.between(requestTime, responseTime, DateUnit.MS)));
|
||||
requestLog.setIsSuccessful("1");
|
||||
}else {
|
||||
requestLog.setResponseStatus("0");
|
||||
requestLog.setErrorDetails(bean.getMsg());
|
||||
requestLog.setIsSuccessful("0");
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
requestLog.setErrorDetails(e.getMessage());
|
||||
requestLog.setIsSuccessful("0");
|
||||
requestLog.setResponseStatus("0");
|
||||
} finally {
|
||||
requestLogMapper.insertRequestLog(requestLog);
|
||||
}
|
||||
return requestLog;
|
||||
}
|
||||
|
||||
/**
|
||||
* 插入请求日志
|
||||
*
|
||||
* @return requestLog
|
||||
*/
|
||||
private RequestLog getRequestLog(String param, String endPoint) {
|
||||
RequestLog requestLog = new RequestLog();
|
||||
Date requestTime = new Date();
|
||||
requestLog.setRequestTime(DateUtil.format(requestTime, "yyyy-MM-dd HH:mm:ss"));
|
||||
requestLog.setRequestBody(param);
|
||||
requestLog.setSourceSystem("wms");
|
||||
requestLog.setTargetSystem("wcs");
|
||||
requestLog.setEndpoint(endPoint);
|
||||
requestLog.setRequestMethod("post");
|
||||
requestLog.setResponseTime(DateUtil.format(requestTime, "yyyy-MM-dd HH:mm:ss"));
|
||||
requestLog.setDuration(Convert.toStr(DateUtil.between(requestTime, requestTime, DateUnit.MS)));
|
||||
return requestLog;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.ruoyi.device.operation.controller;
|
||||
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.schedule.ScheduleThread;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/device/operation")
|
||||
public class ThreadOperationController {
|
||||
|
||||
@Resource
|
||||
private ScheduleThread scheduleThread;
|
||||
|
||||
/**
|
||||
* 开启线程
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/startAllThread")
|
||||
@PreAuthorize("@ss.hasPermi('device:operation:start')")
|
||||
public AjaxResult startAllThread() {
|
||||
scheduleThread.startAllThread();
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 关闭线程
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/stopAllThread")
|
||||
@PreAuthorize("@ss.hasPermi('device:operation:stop')")
|
||||
public AjaxResult stopAllThread() {
|
||||
scheduleThread.stopAllThread();
|
||||
return AjaxResult.success();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.ruoyi.schedule;
|
||||
|
||||
import com.ruoyi.schedule.plc.PlcRead;
|
||||
import com.ruoyi.schedule.plc.domain.SsjDevice;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
@Component
|
||||
public class ScheduleThread {
|
||||
|
||||
public PlcRead plcRead;
|
||||
|
||||
|
||||
@PostConstruct
|
||||
public void init(){
|
||||
ConcurrentHashMap<String, SsjDevice> list = new ConcurrentHashMap<>();
|
||||
plcRead = new PlcRead(list);
|
||||
}
|
||||
|
||||
public void startAllThread(){
|
||||
Thread plcReadThread = new Thread(plcRead);
|
||||
plcReadThread.start();
|
||||
}
|
||||
|
||||
public void stopAllThread(){
|
||||
Thread plcReadThread = new Thread(plcRead);
|
||||
plcReadThread.start();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.ruoyi.schedule.plc;
|
||||
|
||||
import com.ruoyi.schedule.plc.domain.SsjDevice;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
public class PlcRead implements Runnable{
|
||||
|
||||
private final Map<String, SsjDevice> deviceMap;
|
||||
|
||||
public PlcRead(ConcurrentHashMap<String, SsjDevice> deviceMap) {
|
||||
this.deviceMap = deviceMap;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
System.out.println("PLC Read thread is running...");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
package com.ruoyi.schedule.plc.domain;
|
||||
|
||||
public class SsjDevice {
|
||||
}
|
||||
Reference in New Issue
Block a user