本地最新代码:同步所有修改及新增模块
This commit is contained in:
@@ -0,0 +1,104 @@
|
||||
package com.ruoyi.bas.agvPoint.controller;
|
||||
|
||||
import java.util.List;
|
||||
import jakarta.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.agvPoint.domain.AgvPoint;
|
||||
import com.ruoyi.bas.agvPoint.service.IAgvPointService;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* agv站点Controller
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-03-17
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/bas/agvPoint")
|
||||
public class AgvPointController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IAgvPointService agvPointService;
|
||||
|
||||
/**
|
||||
* 查询agv站点列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bas:agvPoint:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(AgvPoint agvPoint)
|
||||
{
|
||||
startPage();
|
||||
List<AgvPoint> list = agvPointService.selectAgvPointList(agvPoint);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出agv站点列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bas:agvPoint:export')")
|
||||
@Log(title = "agv站点", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, AgvPoint agvPoint)
|
||||
{
|
||||
List<AgvPoint> list = agvPointService.selectAgvPointList(agvPoint);
|
||||
ExcelUtil<AgvPoint> util = new ExcelUtil<AgvPoint>(AgvPoint.class);
|
||||
util.exportExcel(response, list, "agv站点数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取agv站点详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bas:agvPoint:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") String id)
|
||||
{
|
||||
return success(agvPointService.selectAgvPointById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增agv站点
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bas:agvPoint:add')")
|
||||
@Log(title = "agv站点", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody AgvPoint agvPoint)
|
||||
{
|
||||
return toAjax(agvPointService.insertAgvPoint(agvPoint));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改agv站点
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bas:agvPoint:edit')")
|
||||
@Log(title = "agv站点", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody AgvPoint agvPoint)
|
||||
{
|
||||
return toAjax(agvPointService.updateAgvPoint(agvPoint));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除agv站点
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bas:agvPoint:remove')")
|
||||
@Log(title = "agv站点", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable String[] ids)
|
||||
{
|
||||
return toAjax(agvPointService.deleteAgvPointByIds(ids));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,113 @@
|
||||
package com.ruoyi.bas.agvPoint.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;
|
||||
|
||||
/**
|
||||
* agv站点对象 agv_point
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-03-17
|
||||
*/
|
||||
public class AgvPoint extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 序号 */
|
||||
private String id;
|
||||
|
||||
/** 站点编号 */
|
||||
@Excel(name = "站点编号")
|
||||
private String station;
|
||||
|
||||
/** 类型 */
|
||||
@Excel(name = "类型")
|
||||
private String type;
|
||||
|
||||
/** $column.columnComment */
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String spare1;
|
||||
|
||||
/** $column.columnComment */
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String spare2;
|
||||
|
||||
/** $column.columnComment */
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String spare3;
|
||||
|
||||
public void setId(String id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setStation(String station)
|
||||
{
|
||||
this.station = station;
|
||||
}
|
||||
|
||||
public String getStation()
|
||||
{
|
||||
return station;
|
||||
}
|
||||
|
||||
public void setType(String type)
|
||||
{
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getType()
|
||||
{
|
||||
return type;
|
||||
}
|
||||
|
||||
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("station", getStation())
|
||||
.append("type", getType())
|
||||
.append("remark", getRemark())
|
||||
.append("spare1", getSpare1())
|
||||
.append("spare2", getSpare2())
|
||||
.append("spare3", getSpare3())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.ruoyi.bas.agvPoint.domain;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@lombok.Data
|
||||
@Getter
|
||||
@Setter
|
||||
public class AgvTask implements Serializable {
|
||||
|
||||
private String startPoint;
|
||||
private String endPoint;
|
||||
private String type;
|
||||
private String trayCode;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.ruoyi.bas.agvPoint.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.bas.agvPoint.domain.AgvPoint;
|
||||
|
||||
/**
|
||||
* agv站点Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-03-17
|
||||
*/
|
||||
public interface AgvPointMapper
|
||||
{
|
||||
/**
|
||||
* 查询agv站点
|
||||
*
|
||||
* @param id agv站点主键
|
||||
* @return agv站点
|
||||
*/
|
||||
public AgvPoint selectAgvPointById(String id);
|
||||
|
||||
/**
|
||||
* 查询agv站点列表
|
||||
*
|
||||
* @param agvPoint agv站点
|
||||
* @return agv站点集合
|
||||
*/
|
||||
public List<AgvPoint> selectAgvPointList(AgvPoint agvPoint);
|
||||
|
||||
/**
|
||||
* 新增agv站点
|
||||
*
|
||||
* @param agvPoint agv站点
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertAgvPoint(AgvPoint agvPoint);
|
||||
|
||||
/**
|
||||
* 修改agv站点
|
||||
*
|
||||
* @param agvPoint agv站点
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateAgvPoint(AgvPoint agvPoint);
|
||||
|
||||
/**
|
||||
* 删除agv站点
|
||||
*
|
||||
* @param id agv站点主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteAgvPointById(String id);
|
||||
|
||||
/**
|
||||
* 批量删除agv站点
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteAgvPointByIds(String[] ids);
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.ruoyi.bas.agvPoint.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.bas.agvPoint.domain.AgvPoint;
|
||||
|
||||
/**
|
||||
* agv站点Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-03-17
|
||||
*/
|
||||
public interface IAgvPointService
|
||||
{
|
||||
/**
|
||||
* 查询agv站点
|
||||
*
|
||||
* @param id agv站点主键
|
||||
* @return agv站点
|
||||
*/
|
||||
public AgvPoint selectAgvPointById(String id);
|
||||
|
||||
/**
|
||||
* 查询agv站点列表
|
||||
*
|
||||
* @param agvPoint agv站点
|
||||
* @return agv站点集合
|
||||
*/
|
||||
public List<AgvPoint> selectAgvPointList(AgvPoint agvPoint);
|
||||
|
||||
/**
|
||||
* 新增agv站点
|
||||
*
|
||||
* @param agvPoint agv站点
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertAgvPoint(AgvPoint agvPoint);
|
||||
|
||||
/**
|
||||
* 修改agv站点
|
||||
*
|
||||
* @param agvPoint agv站点
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateAgvPoint(AgvPoint agvPoint);
|
||||
|
||||
/**
|
||||
* 批量删除agv站点
|
||||
*
|
||||
* @param ids 需要删除的agv站点主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteAgvPointByIds(String[] ids);
|
||||
|
||||
/**
|
||||
* 删除agv站点信息
|
||||
*
|
||||
* @param id agv站点主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteAgvPointById(String id);
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
package com.ruoyi.bas.agvPoint.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.bas.agvPoint.mapper.AgvPointMapper;
|
||||
import com.ruoyi.bas.agvPoint.domain.AgvPoint;
|
||||
import com.ruoyi.bas.agvPoint.service.IAgvPointService;
|
||||
|
||||
/**
|
||||
* agv站点Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-03-17
|
||||
*/
|
||||
@Service
|
||||
public class AgvPointServiceImpl implements IAgvPointService
|
||||
{
|
||||
@Autowired
|
||||
private AgvPointMapper agvPointMapper;
|
||||
|
||||
/**
|
||||
* 查询agv站点
|
||||
*
|
||||
* @param id agv站点主键
|
||||
* @return agv站点
|
||||
*/
|
||||
@Override
|
||||
public AgvPoint selectAgvPointById(String id)
|
||||
{
|
||||
return agvPointMapper.selectAgvPointById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询agv站点列表
|
||||
*
|
||||
* @param agvPoint agv站点
|
||||
* @return agv站点
|
||||
*/
|
||||
@Override
|
||||
public List<AgvPoint> selectAgvPointList(AgvPoint agvPoint)
|
||||
{
|
||||
return agvPointMapper.selectAgvPointList(agvPoint);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增agv站点
|
||||
*
|
||||
* @param agvPoint agv站点
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertAgvPoint(AgvPoint agvPoint)
|
||||
{
|
||||
return agvPointMapper.insertAgvPoint(agvPoint);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改agv站点
|
||||
*
|
||||
* @param agvPoint agv站点
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateAgvPoint(AgvPoint agvPoint)
|
||||
{
|
||||
return agvPointMapper.updateAgvPoint(agvPoint);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除agv站点
|
||||
*
|
||||
* @param ids 需要删除的agv站点主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteAgvPointByIds(String[] ids)
|
||||
{
|
||||
return agvPointMapper.deleteAgvPointByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除agv站点信息
|
||||
*
|
||||
* @param id agv站点主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteAgvPointById(String id)
|
||||
{
|
||||
return agvPointMapper.deleteAgvPointById(id);
|
||||
}
|
||||
}
|
||||
@@ -71,6 +71,7 @@ public class BasTraycodeController extends BaseController
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody BasTraycode basTraycode)
|
||||
{
|
||||
|
||||
return toAjax(basTraycodeService.insertBasTraycode(basTraycode));
|
||||
}
|
||||
|
||||
|
||||
@@ -16,16 +16,16 @@ public class BasTraycode extends BaseEntity
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** id */
|
||||
@Excel(name = "${bas.Traycode.id}")
|
||||
// @Excel(name = "${bas.Traycode.id}")
|
||||
private Long id;
|
||||
|
||||
/** 条码类型id */
|
||||
@Excel(name = "${bas.Traycode.formatId}")
|
||||
// @Excel(name = "${bas.Traycode.formatId}")
|
||||
private Long formatId;
|
||||
private String formatName;
|
||||
|
||||
/** 条码 */
|
||||
@Excel(name = "${bas.Traycode.trayCode}")
|
||||
@Excel(name = "条码")
|
||||
private String trayCode;
|
||||
|
||||
/** 备用字段1 */
|
||||
@@ -33,7 +33,7 @@ public class BasTraycode extends BaseEntity
|
||||
private String spare1;
|
||||
|
||||
/** 备用字段2 */
|
||||
// @Excel(name = "${bas.Traycode.spare2}")
|
||||
@Excel(name = "是否可用",dictType = "sys_yes_no")
|
||||
private String spare2;
|
||||
|
||||
/** 备用字段3 */
|
||||
|
||||
@@ -61,4 +61,6 @@ public interface BasTraycodeMapper
|
||||
public int deleteBasTraycodeByIds(Long[] ids);
|
||||
|
||||
void insertBasTraycodeList(List<BasTraycode> list);
|
||||
|
||||
Integer selectBasTrayCodeMax();
|
||||
}
|
||||
|
||||
@@ -61,4 +61,6 @@ public interface IBasTraycodeService
|
||||
public int deleteBasTraycodeById(Long id);
|
||||
|
||||
void insertBasTraycodeList(List<BasTraycode> traycodeList);
|
||||
|
||||
Integer selectBasTrayCodeMax();
|
||||
}
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
package com.ruoyi.bas.traycode.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import com.ruoyi.bas.traycode.domain.BasTraycode;
|
||||
import com.ruoyi.bas.traycode.mapper.BasTraycodeMapper;
|
||||
import com.ruoyi.bas.traycode.service.IBasTraycodeService;
|
||||
import com.ruoyi.bas.traycodeformat.domain.BasTraycodeFormat;
|
||||
import com.ruoyi.bas.traycodeformat.service.IBasTraycodeFormatService;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -21,6 +24,8 @@ public class BasTraycodeServiceImpl implements IBasTraycodeService
|
||||
{
|
||||
@Autowired
|
||||
private BasTraycodeMapper basTraycodeMapper;
|
||||
@Autowired
|
||||
private IBasTraycodeFormatService basTraycodeFormatService;
|
||||
|
||||
/**
|
||||
* 查询条码信息
|
||||
@@ -55,8 +60,33 @@ public class BasTraycodeServiceImpl implements IBasTraycodeService
|
||||
@Override
|
||||
public int insertBasTraycode(BasTraycode basTraycode)
|
||||
{
|
||||
basTraycode.setCreateTime(DateUtils.getNowDate());
|
||||
return basTraycodeMapper.insertBasTraycode(basTraycode);
|
||||
try {
|
||||
BasTraycodeFormat basTraycodeFormat = basTraycodeFormatService.selectBasTraycodeFormatById(basTraycode.getFormatId());
|
||||
|
||||
|
||||
int i1 = Integer.parseInt(basTraycode.getSpare1());
|
||||
//如果i<4位数,前面补0
|
||||
String code = "";
|
||||
for (int j = 0; j < i1; j++) {
|
||||
code = String.format("%07d",Convert.toInt( basTraycodeFormat.getSerialRule()) + 1 + j);
|
||||
if(basTraycodeFormat.getMaxNum() < Convert.toLong( code)){
|
||||
throw new RuntimeException("已生成最大值");
|
||||
}
|
||||
String finalCode = basTraycodeFormat.getBarcodeFormat()+code;
|
||||
basTraycode.setTrayCode(finalCode);
|
||||
basTraycode.setSpare1(null);
|
||||
basTraycode.setCreateTime(DateUtils.getNowDate());
|
||||
basTraycode.setSpare2("Y");
|
||||
basTraycodeMapper.insertBasTraycode(basTraycode);
|
||||
|
||||
|
||||
}
|
||||
basTraycodeFormat.setSerialRule(Convert.toLong( code).toString());
|
||||
basTraycodeFormatService.updateBasTraycodeFormat(basTraycodeFormat);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -103,4 +133,9 @@ public class BasTraycodeServiceImpl implements IBasTraycodeService
|
||||
basTraycodeMapper.insertBasTraycodeList(list);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer selectBasTrayCodeMax() {
|
||||
return basTraycodeMapper.selectBasTrayCodeMax();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,17 +1,13 @@
|
||||
package com.ruoyi.bas.traycodeformat.service.impl;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.ruoyi.bas.traycode.domain.BasTraycode;
|
||||
import com.ruoyi.bas.traycode.service.IBasTraycodeService;
|
||||
import com.ruoyi.bas.traycodeformat.domain.BasTraycodeFormat;
|
||||
import com.ruoyi.bas.traycodeformat.mapper.BasTraycodeFormatMapper;
|
||||
import com.ruoyi.bas.traycodeformat.service.IBasTraycodeFormatService;
|
||||
import com.ruoyi.common.core.text.Convert;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -79,20 +75,7 @@ public class BasTraycodeFormatServiceImpl implements IBasTraycodeFormatService
|
||||
public int updateBasTraycodeFormat(BasTraycodeFormat basTraycodeFormat)
|
||||
{
|
||||
BasTraycodeFormat old = selectBasTraycodeFormatById(basTraycodeFormat.getId());
|
||||
int oldSerialRule = Convert.toInt(old.getSerialRule());
|
||||
int newSerialRule = Convert.toInt(basTraycodeFormat.getSerialRule());
|
||||
|
||||
List<BasTraycode> traycodeList = new ArrayList<>();
|
||||
for (int i = oldSerialRule; i < newSerialRule; i++) {
|
||||
BasTraycode basTraycode = new BasTraycode();
|
||||
basTraycode.setFormatId(basTraycodeFormat.getId());
|
||||
String traycode = old.getBarcodeFormat()+ StrUtil.padPre(Convert.toStr(i),5,'0');
|
||||
basTraycode.setTrayCode(traycode);
|
||||
traycodeList.add(basTraycode);
|
||||
}
|
||||
basTraycodeFormat.setUpdateTime(DateUtils.getNowDate());
|
||||
//插入条码信息
|
||||
basTraycodeService.insertBasTraycodeList(traycodeList);
|
||||
return basTraycodeFormatMapper.updateBasTraycodeFormat(basTraycodeFormat);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user