条码打印相关功能
This commit is contained in:
@@ -0,0 +1,104 @@
|
||||
package com.ruoyi.bas.traycode.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.traycode.domain.BasTraycode;
|
||||
import com.ruoyi.bas.traycode.service.IBasTraycodeService;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 条码信息Controller
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-07-28
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/bas/traycode")
|
||||
public class BasTraycodeController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IBasTraycodeService basTraycodeService;
|
||||
|
||||
/**
|
||||
* 查询条码信息列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bas:traycode:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(BasTraycode basTraycode)
|
||||
{
|
||||
startPage();
|
||||
List<BasTraycode> list = basTraycodeService.selectBasTraycodeList(basTraycode);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出条码信息列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bas:traycode:export')")
|
||||
@Log(title = "条码信息", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, BasTraycode basTraycode)
|
||||
{
|
||||
List<BasTraycode> list = basTraycodeService.selectBasTraycodeList(basTraycode);
|
||||
ExcelUtil<BasTraycode> util = new ExcelUtil<BasTraycode>(BasTraycode.class);
|
||||
util.exportExcel(response, list, "条码信息数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取条码信息详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bas:traycode:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(basTraycodeService.selectBasTraycodeById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增条码信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bas:traycode:add')")
|
||||
@Log(title = "条码信息", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody BasTraycode basTraycode)
|
||||
{
|
||||
return toAjax(basTraycodeService.insertBasTraycode(basTraycode));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改条码信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bas:traycode:edit')")
|
||||
@Log(title = "条码信息", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody BasTraycode basTraycode)
|
||||
{
|
||||
return toAjax(basTraycodeService.updateBasTraycode(basTraycode));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除条码信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bas:traycode:remove')")
|
||||
@Log(title = "条码信息", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(basTraycodeService.deleteBasTraycodeByIds(ids));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,114 @@
|
||||
package com.ruoyi.bas.traycode.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;
|
||||
|
||||
/**
|
||||
* 条码信息对象 bas_traycode
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-07-28
|
||||
*/
|
||||
public class BasTraycode extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** id */
|
||||
private Long id;
|
||||
|
||||
/** 条码类型id */
|
||||
@Excel(name = "条码类型id")
|
||||
private Long formatId;
|
||||
|
||||
/** 条码 */
|
||||
@Excel(name = "条码")
|
||||
private String trayCode;
|
||||
|
||||
/** 备用字段1 */
|
||||
@Excel(name = "备用字段1")
|
||||
private String spare1;
|
||||
|
||||
/** 备用字段2 */
|
||||
@Excel(name = "备用字段2")
|
||||
private String spare2;
|
||||
|
||||
/** 备用字段3 */
|
||||
@Excel(name = "备用字段3")
|
||||
private String spare3;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setFormatId(Long formatId)
|
||||
{
|
||||
this.formatId = formatId;
|
||||
}
|
||||
|
||||
public Long getFormatId()
|
||||
{
|
||||
return formatId;
|
||||
}
|
||||
|
||||
public void setTrayCode(String trayCode)
|
||||
{
|
||||
this.trayCode = trayCode;
|
||||
}
|
||||
|
||||
public String getTrayCode()
|
||||
{
|
||||
return trayCode;
|
||||
}
|
||||
|
||||
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("formatId", getFormatId())
|
||||
.append("trayCode", getTrayCode())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("spare1", getSpare1())
|
||||
.append("spare2", getSpare2())
|
||||
.append("spare3", getSpare3())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package com.ruoyi.bas.traycode.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.bas.traycode.domain.BasTraycode;
|
||||
|
||||
/**
|
||||
* 条码信息Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-07-28
|
||||
*/
|
||||
public interface BasTraycodeMapper
|
||||
{
|
||||
/**
|
||||
* 查询条码信息
|
||||
*
|
||||
* @param id 条码信息主键
|
||||
* @return 条码信息
|
||||
*/
|
||||
public BasTraycode selectBasTraycodeById(Long id);
|
||||
|
||||
/**
|
||||
* 查询条码信息列表
|
||||
*
|
||||
* @param basTraycode 条码信息
|
||||
* @return 条码信息集合
|
||||
*/
|
||||
public List<BasTraycode> selectBasTraycodeList(BasTraycode basTraycode);
|
||||
|
||||
/**
|
||||
* 新增条码信息
|
||||
*
|
||||
* @param basTraycode 条码信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBasTraycode(BasTraycode basTraycode);
|
||||
|
||||
/**
|
||||
* 修改条码信息
|
||||
*
|
||||
* @param basTraycode 条码信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBasTraycode(BasTraycode basTraycode);
|
||||
|
||||
/**
|
||||
* 删除条码信息
|
||||
*
|
||||
* @param id 条码信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBasTraycodeById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除条码信息
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBasTraycodeByIds(Long[] ids);
|
||||
|
||||
void insertBasTraycodeList(List<BasTraycode> list);
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package com.ruoyi.bas.traycode.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.bas.traycode.domain.BasTraycode;
|
||||
|
||||
/**
|
||||
* 条码信息Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-07-28
|
||||
*/
|
||||
public interface IBasTraycodeService
|
||||
{
|
||||
/**
|
||||
* 查询条码信息
|
||||
*
|
||||
* @param id 条码信息主键
|
||||
* @return 条码信息
|
||||
*/
|
||||
public BasTraycode selectBasTraycodeById(Long id);
|
||||
|
||||
/**
|
||||
* 查询条码信息列表
|
||||
*
|
||||
* @param basTraycode 条码信息
|
||||
* @return 条码信息集合
|
||||
*/
|
||||
public List<BasTraycode> selectBasTraycodeList(BasTraycode basTraycode);
|
||||
|
||||
/**
|
||||
* 新增条码信息
|
||||
*
|
||||
* @param basTraycode 条码信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBasTraycode(BasTraycode basTraycode);
|
||||
|
||||
/**
|
||||
* 修改条码信息
|
||||
*
|
||||
* @param basTraycode 条码信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBasTraycode(BasTraycode basTraycode);
|
||||
|
||||
/**
|
||||
* 批量删除条码信息
|
||||
*
|
||||
* @param ids 需要删除的条码信息主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBasTraycodeByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除条码信息信息
|
||||
*
|
||||
* @param id 条码信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBasTraycodeById(Long id);
|
||||
|
||||
void insertBasTraycodeList(List<BasTraycode> traycodeList);
|
||||
}
|
||||
@@ -0,0 +1,106 @@
|
||||
package com.ruoyi.bas.traycode.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.bas.traycode.mapper.BasTraycodeMapper;
|
||||
import com.ruoyi.bas.traycode.domain.BasTraycode;
|
||||
import com.ruoyi.bas.traycode.service.IBasTraycodeService;
|
||||
|
||||
/**
|
||||
* 条码信息Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-07-28
|
||||
*/
|
||||
@Service
|
||||
public class BasTraycodeServiceImpl implements IBasTraycodeService
|
||||
{
|
||||
@Autowired
|
||||
private BasTraycodeMapper basTraycodeMapper;
|
||||
|
||||
/**
|
||||
* 查询条码信息
|
||||
*
|
||||
* @param id 条码信息主键
|
||||
* @return 条码信息
|
||||
*/
|
||||
@Override
|
||||
public BasTraycode selectBasTraycodeById(Long id)
|
||||
{
|
||||
return basTraycodeMapper.selectBasTraycodeById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询条码信息列表
|
||||
*
|
||||
* @param basTraycode 条码信息
|
||||
* @return 条码信息
|
||||
*/
|
||||
@Override
|
||||
public List<BasTraycode> selectBasTraycodeList(BasTraycode basTraycode)
|
||||
{
|
||||
return basTraycodeMapper.selectBasTraycodeList(basTraycode);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增条码信息
|
||||
*
|
||||
* @param basTraycode 条码信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertBasTraycode(BasTraycode basTraycode)
|
||||
{
|
||||
basTraycode.setCreateTime(DateUtils.getNowDate());
|
||||
return basTraycodeMapper.insertBasTraycode(basTraycode);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改条码信息
|
||||
*
|
||||
* @param basTraycode 条码信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateBasTraycode(BasTraycode basTraycode)
|
||||
{
|
||||
basTraycode.setUpdateTime(DateUtils.getNowDate());
|
||||
return basTraycodeMapper.updateBasTraycode(basTraycode);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除条码信息
|
||||
*
|
||||
* @param ids 需要删除的条码信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBasTraycodeByIds(Long[] ids)
|
||||
{
|
||||
return basTraycodeMapper.deleteBasTraycodeByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除条码信息信息
|
||||
*
|
||||
* @param id 条码信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBasTraycodeById(Long id)
|
||||
{
|
||||
return basTraycodeMapper.deleteBasTraycodeById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void insertBasTraycodeList(List<BasTraycode> traycodeList) {
|
||||
List<List<BasTraycode>> split = CollUtil.split(traycodeList, 300);
|
||||
for (List<BasTraycode> list : split) {
|
||||
basTraycodeMapper.insertBasTraycodeList(list);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
package com.ruoyi.bas.traycodeformat.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.traycodeformat.domain.BasTraycodeFormat;
|
||||
import com.ruoyi.bas.traycodeformat.service.IBasTraycodeFormatService;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 条码生成规则Controller
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-07-28
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/bas/traycodeFormat")
|
||||
public class BasTraycodeFormatController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IBasTraycodeFormatService basTraycodeFormatService;
|
||||
|
||||
/**
|
||||
* 查询条码生成规则列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bas:traycodeFormat:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(BasTraycodeFormat basTraycodeFormat)
|
||||
{
|
||||
startPage();
|
||||
List<BasTraycodeFormat> list = basTraycodeFormatService.selectBasTraycodeFormatList(basTraycodeFormat);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出条码生成规则列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bas:traycodeFormat:export')")
|
||||
@Log(title = "条码生成规则", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, BasTraycodeFormat basTraycodeFormat)
|
||||
{
|
||||
List<BasTraycodeFormat> list = basTraycodeFormatService.selectBasTraycodeFormatList(basTraycodeFormat);
|
||||
ExcelUtil<BasTraycodeFormat> util = new ExcelUtil<BasTraycodeFormat>(BasTraycodeFormat.class);
|
||||
util.exportExcel(response, list, "条码生成规则数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取条码生成规则详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bas:traycodeFormat:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(basTraycodeFormatService.selectBasTraycodeFormatById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增条码生成规则
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bas:traycodeFormat:add')")
|
||||
@Log(title = "条码生成规则", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody BasTraycodeFormat basTraycodeFormat)
|
||||
{
|
||||
return toAjax(basTraycodeFormatService.insertBasTraycodeFormat(basTraycodeFormat));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改条码生成规则
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bas:traycodeFormat:edit')")
|
||||
@Log(title = "条码生成规则", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody BasTraycodeFormat basTraycodeFormat)
|
||||
{
|
||||
return toAjax(basTraycodeFormatService.updateBasTraycodeFormat(basTraycodeFormat));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除条码生成规则
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bas:traycodeFormat:remove')")
|
||||
@Log(title = "条码生成规则", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(basTraycodeFormatService.deleteBasTraycodeFormatByIds(ids));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,174 @@
|
||||
package com.ruoyi.bas.traycodeformat.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;
|
||||
|
||||
/**
|
||||
* 条码生成规则对象 bas_traycode_format
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-07-28
|
||||
*/
|
||||
public class BasTraycodeFormat extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** id */
|
||||
private Long id;
|
||||
|
||||
/** 条码前缀 */
|
||||
@Excel(name = "条码前缀")
|
||||
private String barcodeFormat;
|
||||
|
||||
/** 流水号 */
|
||||
@Excel(name = "流水号")
|
||||
private String serialRule;
|
||||
|
||||
/** 条码样例 */
|
||||
@Excel(name = "条码样例")
|
||||
private String serialExample;
|
||||
|
||||
/** 描述 */
|
||||
@Excel(name = "描述")
|
||||
private String remarks;
|
||||
|
||||
/** 最小流水号 */
|
||||
@Excel(name = "最小流水号")
|
||||
private Long minNum;
|
||||
|
||||
/** 最大流水号 */
|
||||
@Excel(name = "最大流水号")
|
||||
private Long maxNum;
|
||||
|
||||
/** 备用字段1 */
|
||||
@Excel(name = "备用字段1")
|
||||
private String spare1;
|
||||
|
||||
/** 备用字段2 */
|
||||
@Excel(name = "备用字段2")
|
||||
private String spare2;
|
||||
|
||||
/** 备用字段3 */
|
||||
@Excel(name = "备用字段3")
|
||||
private String spare3;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setBarcodeFormat(String barcodeFormat)
|
||||
{
|
||||
this.barcodeFormat = barcodeFormat;
|
||||
}
|
||||
|
||||
public String getBarcodeFormat()
|
||||
{
|
||||
return barcodeFormat;
|
||||
}
|
||||
|
||||
public void setSerialRule(String serialRule)
|
||||
{
|
||||
this.serialRule = serialRule;
|
||||
}
|
||||
|
||||
public String getSerialRule()
|
||||
{
|
||||
return serialRule;
|
||||
}
|
||||
|
||||
public void setSerialExample(String serialExample)
|
||||
{
|
||||
this.serialExample = serialExample;
|
||||
}
|
||||
|
||||
public String getSerialExample()
|
||||
{
|
||||
return serialExample;
|
||||
}
|
||||
|
||||
public void setRemarks(String remarks)
|
||||
{
|
||||
this.remarks = remarks;
|
||||
}
|
||||
|
||||
public String getRemarks()
|
||||
{
|
||||
return remarks;
|
||||
}
|
||||
|
||||
public void setMinNum(Long minNum)
|
||||
{
|
||||
this.minNum = minNum;
|
||||
}
|
||||
|
||||
public Long getMinNum()
|
||||
{
|
||||
return minNum;
|
||||
}
|
||||
|
||||
public void setMaxNum(Long maxNum)
|
||||
{
|
||||
this.maxNum = maxNum;
|
||||
}
|
||||
|
||||
public Long getMaxNum()
|
||||
{
|
||||
return maxNum;
|
||||
}
|
||||
|
||||
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("barcodeFormat", getBarcodeFormat())
|
||||
.append("serialRule", getSerialRule())
|
||||
.append("serialExample", getSerialExample())
|
||||
.append("remarks", getRemarks())
|
||||
.append("minNum", getMinNum())
|
||||
.append("maxNum", getMaxNum())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("spare1", getSpare1())
|
||||
.append("spare2", getSpare2())
|
||||
.append("spare3", getSpare3())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.ruoyi.bas.traycodeformat.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.bas.traycodeformat.domain.BasTraycodeFormat;
|
||||
|
||||
/**
|
||||
* 条码生成规则Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-07-28
|
||||
*/
|
||||
public interface BasTraycodeFormatMapper
|
||||
{
|
||||
/**
|
||||
* 查询条码生成规则
|
||||
*
|
||||
* @param id 条码生成规则主键
|
||||
* @return 条码生成规则
|
||||
*/
|
||||
public BasTraycodeFormat selectBasTraycodeFormatById(Long id);
|
||||
|
||||
/**
|
||||
* 查询条码生成规则列表
|
||||
*
|
||||
* @param basTraycodeFormat 条码生成规则
|
||||
* @return 条码生成规则集合
|
||||
*/
|
||||
public List<BasTraycodeFormat> selectBasTraycodeFormatList(BasTraycodeFormat basTraycodeFormat);
|
||||
|
||||
/**
|
||||
* 新增条码生成规则
|
||||
*
|
||||
* @param basTraycodeFormat 条码生成规则
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBasTraycodeFormat(BasTraycodeFormat basTraycodeFormat);
|
||||
|
||||
/**
|
||||
* 修改条码生成规则
|
||||
*
|
||||
* @param basTraycodeFormat 条码生成规则
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBasTraycodeFormat(BasTraycodeFormat basTraycodeFormat);
|
||||
|
||||
/**
|
||||
* 删除条码生成规则
|
||||
*
|
||||
* @param id 条码生成规则主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBasTraycodeFormatById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除条码生成规则
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBasTraycodeFormatByIds(Long[] ids);
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.ruoyi.bas.traycodeformat.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.bas.traycodeformat.domain.BasTraycodeFormat;
|
||||
|
||||
/**
|
||||
* 条码生成规则Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-07-28
|
||||
*/
|
||||
public interface IBasTraycodeFormatService
|
||||
{
|
||||
/**
|
||||
* 查询条码生成规则
|
||||
*
|
||||
* @param id 条码生成规则主键
|
||||
* @return 条码生成规则
|
||||
*/
|
||||
public BasTraycodeFormat selectBasTraycodeFormatById(Long id);
|
||||
|
||||
/**
|
||||
* 查询条码生成规则列表
|
||||
*
|
||||
* @param basTraycodeFormat 条码生成规则
|
||||
* @return 条码生成规则集合
|
||||
*/
|
||||
public List<BasTraycodeFormat> selectBasTraycodeFormatList(BasTraycodeFormat basTraycodeFormat);
|
||||
|
||||
/**
|
||||
* 新增条码生成规则
|
||||
*
|
||||
* @param basTraycodeFormat 条码生成规则
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBasTraycodeFormat(BasTraycodeFormat basTraycodeFormat);
|
||||
|
||||
/**
|
||||
* 修改条码生成规则
|
||||
*
|
||||
* @param basTraycodeFormat 条码生成规则
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBasTraycodeFormat(BasTraycodeFormat basTraycodeFormat);
|
||||
|
||||
/**
|
||||
* 批量删除条码生成规则
|
||||
*
|
||||
* @param ids 需要删除的条码生成规则主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBasTraycodeFormatByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除条码生成规则信息
|
||||
*
|
||||
* @param id 条码生成规则主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBasTraycodeFormatById(Long id);
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
package com.ruoyi.bas.traycodeformat.service.impl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.ruoyi.bas.traycode.domain.BasTraycode;
|
||||
import com.ruoyi.bas.traycode.service.IBasTraycodeService;
|
||||
import com.ruoyi.bas.traycode.service.impl.BasTraycodeServiceImpl;
|
||||
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 com.ruoyi.bas.traycodeformat.mapper.BasTraycodeFormatMapper;
|
||||
import com.ruoyi.bas.traycodeformat.domain.BasTraycodeFormat;
|
||||
import com.ruoyi.bas.traycodeformat.service.IBasTraycodeFormatService;
|
||||
|
||||
/**
|
||||
* 条码生成规则Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-07-28
|
||||
*/
|
||||
@Service
|
||||
public class BasTraycodeFormatServiceImpl implements IBasTraycodeFormatService
|
||||
{
|
||||
@Autowired
|
||||
private BasTraycodeFormatMapper basTraycodeFormatMapper;
|
||||
@Autowired
|
||||
private IBasTraycodeService basTraycodeService;
|
||||
|
||||
/**
|
||||
* 查询条码生成规则
|
||||
*
|
||||
* @param id 条码生成规则主键
|
||||
* @return 条码生成规则
|
||||
*/
|
||||
@Override
|
||||
public BasTraycodeFormat selectBasTraycodeFormatById(Long id)
|
||||
{
|
||||
return basTraycodeFormatMapper.selectBasTraycodeFormatById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询条码生成规则列表
|
||||
*
|
||||
* @param basTraycodeFormat 条码生成规则
|
||||
* @return 条码生成规则
|
||||
*/
|
||||
@Override
|
||||
public List<BasTraycodeFormat> selectBasTraycodeFormatList(BasTraycodeFormat basTraycodeFormat)
|
||||
{
|
||||
return basTraycodeFormatMapper.selectBasTraycodeFormatList(basTraycodeFormat);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增条码生成规则
|
||||
*
|
||||
* @param basTraycodeFormat 条码生成规则
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertBasTraycodeFormat(BasTraycodeFormat basTraycodeFormat)
|
||||
{
|
||||
basTraycodeFormat.setCreateTime(DateUtils.getNowDate());
|
||||
return basTraycodeFormatMapper.insertBasTraycodeFormat(basTraycodeFormat);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改条码生成规则
|
||||
*
|
||||
* @param basTraycodeFormat 条码生成规则
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
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);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除条码生成规则
|
||||
*
|
||||
* @param ids 需要删除的条码生成规则主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBasTraycodeFormatByIds(Long[] ids)
|
||||
{
|
||||
return basTraycodeFormatMapper.deleteBasTraycodeFormatByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除条码生成规则信息
|
||||
*
|
||||
* @param id 条码生成规则主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBasTraycodeFormatById(Long id)
|
||||
{
|
||||
return basTraycodeFormatMapper.deleteBasTraycodeFormatById(id);
|
||||
}
|
||||
}
|
||||
@@ -248,8 +248,6 @@ public class TagTaskServiceImpl implements ITagTaskService {
|
||||
trayCodeMsg.setWarehouseId("02");
|
||||
trayCodeMsg.setEntranceId(basTag.getPickAdd());
|
||||
pdaService.emptyBoxIn(trayCodeMsg);
|
||||
//推送空料箱入库作业 生成ctu队列
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user