打印物料条码
This commit is contained in:
@@ -25,7 +25,7 @@ import com.ruoyi.common.core.page.TableDataInfo;
|
||||
* 条码打印Controller
|
||||
*
|
||||
* @author gw
|
||||
* @date 2025-09-11
|
||||
* @date 2025-09-12
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/bas/BasProductCode")
|
||||
@@ -64,7 +64,7 @@ public class BasProductCodeController extends BaseController
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bas:BasProductCode:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") String id)
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(basProductCodeService.selectBasProductCodeById(id));
|
||||
}
|
||||
@@ -77,7 +77,6 @@ public class BasProductCodeController extends BaseController
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody BasProductCode basProductCode)
|
||||
{
|
||||
|
||||
return toAjax(basProductCodeService.insertBasProductCode(basProductCode));
|
||||
}
|
||||
|
||||
@@ -98,7 +97,7 @@ public class BasProductCodeController extends BaseController
|
||||
@PreAuthorize("@ss.hasPermi('bas:BasProductCode:remove')")
|
||||
@Log(title = "条码打印", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable String[] ids)
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(basProductCodeService.deleteBasProductCodeByIds(ids));
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.ruoyi.bas.BasProductCode.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
@@ -7,16 +8,16 @@ import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 条码打印对象 bas_product_code
|
||||
*
|
||||
*
|
||||
* @author gw
|
||||
* @date 2025-09-11
|
||||
* @date 2025-09-12
|
||||
*/
|
||||
public class BasProductCode extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键 */
|
||||
private String id;
|
||||
private Long id;
|
||||
|
||||
/** 型号 */
|
||||
@Excel(name = "型号")
|
||||
@@ -44,155 +45,202 @@ public class BasProductCode extends BaseEntity
|
||||
|
||||
/** 净重 */
|
||||
@Excel(name = "净重")
|
||||
@JsonProperty("nW")
|
||||
private String nW;
|
||||
|
||||
/** 毛重 */
|
||||
@Excel(name = "毛重")
|
||||
@JsonProperty("gW")
|
||||
private String gW;
|
||||
|
||||
/** 类型 */
|
||||
@Excel(name = "类型")
|
||||
/** 类型(1为未打印,2为已打印) */
|
||||
@Excel(name = "类型", readConverterExp = "1=为未打印,2为已打印")
|
||||
private String type;
|
||||
|
||||
/** $column.columnComment */
|
||||
/** 订单号 */
|
||||
@Excel(name = "订单号")
|
||||
private String spare1;
|
||||
|
||||
/** $column.columnComment */
|
||||
/** 机型 */
|
||||
@Excel(name = "机型")
|
||||
private String spare2;
|
||||
|
||||
/** $column.columnComment */
|
||||
/** 分销 */
|
||||
@Excel(name = "分销")
|
||||
private String spare3;
|
||||
|
||||
public void setId(String id)
|
||||
/** 备用字段1 */
|
||||
@Excel(name = "备用字段1")
|
||||
private String spare4;
|
||||
|
||||
/** 备用字段2 */
|
||||
@Excel(name = "备用字段2")
|
||||
private String spare5;
|
||||
|
||||
/** 备用字段3 */
|
||||
@Excel(name = "备用字段3")
|
||||
private String spare6;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getId()
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setModel(String model)
|
||||
public void setModel(String model)
|
||||
{
|
||||
this.model = model;
|
||||
}
|
||||
|
||||
public String getModel()
|
||||
public String getModel()
|
||||
{
|
||||
return model;
|
||||
}
|
||||
|
||||
public void setColor(String color)
|
||||
public void setColor(String color)
|
||||
{
|
||||
this.color = color;
|
||||
}
|
||||
|
||||
public String getColor()
|
||||
public String getColor()
|
||||
{
|
||||
return color;
|
||||
}
|
||||
|
||||
public void setSerial(String serial)
|
||||
public void setSerial(String serial)
|
||||
{
|
||||
this.serial = serial;
|
||||
}
|
||||
|
||||
public String getSerial()
|
||||
public String getSerial()
|
||||
{
|
||||
return serial;
|
||||
}
|
||||
|
||||
public void setV(String v)
|
||||
public void setV(String v)
|
||||
{
|
||||
this.v = v;
|
||||
}
|
||||
|
||||
public String getV()
|
||||
public String getV()
|
||||
{
|
||||
return v;
|
||||
}
|
||||
|
||||
public void setHz(String hz)
|
||||
public void setHz(String hz)
|
||||
{
|
||||
this.hz = hz;
|
||||
}
|
||||
|
||||
public String getHz()
|
||||
public String getHz()
|
||||
{
|
||||
return hz;
|
||||
}
|
||||
|
||||
public void setPh(String ph)
|
||||
public void setPh(String ph)
|
||||
{
|
||||
this.ph = ph;
|
||||
}
|
||||
|
||||
public String getPh()
|
||||
public String getPh()
|
||||
{
|
||||
return ph;
|
||||
}
|
||||
|
||||
public void setNw(String nW)
|
||||
public void setNW(String nW)
|
||||
{
|
||||
this.nW = nW;
|
||||
}
|
||||
|
||||
public String getNw()
|
||||
public String getNW()
|
||||
{
|
||||
return nW;
|
||||
}
|
||||
|
||||
public void setGw(String gW)
|
||||
public void setGW(String gW)
|
||||
{
|
||||
this.gW = gW;
|
||||
}
|
||||
|
||||
public String getGw()
|
||||
public String getGW()
|
||||
{
|
||||
return gW;
|
||||
}
|
||||
|
||||
public void setType(String type)
|
||||
public void setType(String type)
|
||||
{
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getType()
|
||||
public String getType()
|
||||
{
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setSpare1(String spare1)
|
||||
public void setSpare1(String spare1)
|
||||
{
|
||||
this.spare1 = spare1;
|
||||
}
|
||||
|
||||
public String getSpare1()
|
||||
public String getSpare1()
|
||||
{
|
||||
return spare1;
|
||||
}
|
||||
|
||||
public void setSpare2(String spare2)
|
||||
public void setSpare2(String spare2)
|
||||
{
|
||||
this.spare2 = spare2;
|
||||
}
|
||||
|
||||
public String getSpare2()
|
||||
public String getSpare2()
|
||||
{
|
||||
return spare2;
|
||||
}
|
||||
|
||||
public void setSpare3(String spare3)
|
||||
public void setSpare3(String spare3)
|
||||
{
|
||||
this.spare3 = spare3;
|
||||
}
|
||||
|
||||
public String getSpare3()
|
||||
public String getSpare3()
|
||||
{
|
||||
return spare3;
|
||||
}
|
||||
|
||||
public void setSpare4(String spare4)
|
||||
{
|
||||
this.spare4 = spare4;
|
||||
}
|
||||
|
||||
public String getSpare4()
|
||||
{
|
||||
return spare4;
|
||||
}
|
||||
|
||||
public void setSpare5(String spare5)
|
||||
{
|
||||
this.spare5 = spare5;
|
||||
}
|
||||
|
||||
public String getSpare5()
|
||||
{
|
||||
return spare5;
|
||||
}
|
||||
|
||||
public void setSpare6(String spare6)
|
||||
{
|
||||
this.spare6 = spare6;
|
||||
}
|
||||
|
||||
public String getSpare6()
|
||||
{
|
||||
return spare6;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
@@ -203,12 +251,16 @@ public class BasProductCode extends BaseEntity
|
||||
.append("v", getV())
|
||||
.append("hz", getHz())
|
||||
.append("ph", getPh())
|
||||
.append("nW", getNw())
|
||||
.append("gW", getGw())
|
||||
.append("nW", getNW())
|
||||
.append("gW", getGW())
|
||||
.append("type", getType())
|
||||
.append("spare1", getSpare1())
|
||||
.append("spare2", getSpare2())
|
||||
.append("spare3", getSpare3())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("spare4", getSpare4())
|
||||
.append("spare5", getSpare5())
|
||||
.append("spare6", getSpare6())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ import com.ruoyi.bas.BasProductCode.domain.BasProductCode;
|
||||
* 条码打印Mapper接口
|
||||
*
|
||||
* @author gw
|
||||
* @date 2025-09-11
|
||||
* @date 2025-09-12
|
||||
*/
|
||||
public interface BasProductCodeMapper
|
||||
{
|
||||
@@ -17,7 +17,7 @@ public interface BasProductCodeMapper
|
||||
* @param id 条码打印主键
|
||||
* @return 条码打印
|
||||
*/
|
||||
public BasProductCode selectBasProductCodeById(String id);
|
||||
public BasProductCode selectBasProductCodeById(Long id);
|
||||
|
||||
/**
|
||||
* 查询条码打印列表
|
||||
@@ -49,7 +49,7 @@ public interface BasProductCodeMapper
|
||||
* @param id 条码打印主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBasProductCodeById(String id);
|
||||
public int deleteBasProductCodeById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除条码打印
|
||||
@@ -57,5 +57,5 @@ public interface BasProductCodeMapper
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBasProductCodeByIds(String[] ids);
|
||||
public int deleteBasProductCodeByIds(Long[] ids);
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ import com.ruoyi.bas.BasProductCode.domain.BasProductCode;
|
||||
* 条码打印Service接口
|
||||
*
|
||||
* @author gw
|
||||
* @date 2025-09-11
|
||||
* @date 2025-09-12
|
||||
*/
|
||||
public interface IBasProductCodeService
|
||||
{
|
||||
@@ -17,7 +17,7 @@ public interface IBasProductCodeService
|
||||
* @param id 条码打印主键
|
||||
* @return 条码打印
|
||||
*/
|
||||
public BasProductCode selectBasProductCodeById(String id);
|
||||
public BasProductCode selectBasProductCodeById(Long id);
|
||||
|
||||
/**
|
||||
* 查询条码打印列表
|
||||
@@ -49,7 +49,7 @@ public interface IBasProductCodeService
|
||||
* @param ids 需要删除的条码打印主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBasProductCodeByIds(String[] ids);
|
||||
public int deleteBasProductCodeByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除条码打印信息
|
||||
@@ -57,5 +57,5 @@ public interface IBasProductCodeService
|
||||
* @param id 条码打印主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBasProductCodeById(String id);
|
||||
public int deleteBasProductCodeById(Long id);
|
||||
}
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
package com.ruoyi.bas.BasProductCode.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.bas.BasProductCode.mapper.BasProductCodeMapper;
|
||||
@@ -11,31 +10,31 @@ import com.ruoyi.bas.BasProductCode.service.IBasProductCodeService;
|
||||
|
||||
/**
|
||||
* 条码打印Service业务层处理
|
||||
*
|
||||
*
|
||||
* @author gw
|
||||
* @date 2025-09-11
|
||||
* @date 2025-09-12
|
||||
*/
|
||||
@Service
|
||||
public class BasProductCodeServiceImpl implements IBasProductCodeService
|
||||
public class BasProductCodeServiceImpl implements IBasProductCodeService
|
||||
{
|
||||
@Autowired
|
||||
private BasProductCodeMapper basProductCodeMapper;
|
||||
|
||||
/**
|
||||
* 查询条码打印
|
||||
*
|
||||
*
|
||||
* @param id 条码打印主键
|
||||
* @return 条码打印
|
||||
*/
|
||||
@Override
|
||||
public BasProductCode selectBasProductCodeById(String id)
|
||||
public BasProductCode selectBasProductCodeById(Long id)
|
||||
{
|
||||
return basProductCodeMapper.selectBasProductCodeById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询条码打印列表
|
||||
*
|
||||
*
|
||||
* @param basProductCode 条码打印
|
||||
* @return 条码打印
|
||||
*/
|
||||
@@ -47,21 +46,21 @@ public class BasProductCodeServiceImpl implements IBasProductCodeService
|
||||
|
||||
/**
|
||||
* 新增条码打印
|
||||
*
|
||||
*
|
||||
* @param basProductCode 条码打印
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertBasProductCode(BasProductCode basProductCode)
|
||||
{
|
||||
// 使用雪花算法生成ID
|
||||
basProductCode.setId(IdUtil.simpleUUID());
|
||||
basProductCode.setCreateTime(DateUtils.getNowDate());
|
||||
basProductCode.setType("1");
|
||||
return basProductCodeMapper.insertBasProductCode(basProductCode);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改条码打印
|
||||
*
|
||||
*
|
||||
* @param basProductCode 条码打印
|
||||
* @return 结果
|
||||
*/
|
||||
@@ -73,24 +72,24 @@ public class BasProductCodeServiceImpl implements IBasProductCodeService
|
||||
|
||||
/**
|
||||
* 批量删除条码打印
|
||||
*
|
||||
*
|
||||
* @param ids 需要删除的条码打印主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBasProductCodeByIds(String[] ids)
|
||||
public int deleteBasProductCodeByIds(Long[] ids)
|
||||
{
|
||||
return basProductCodeMapper.deleteBasProductCodeByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除条码打印信息
|
||||
*
|
||||
*
|
||||
* @param id 条码打印主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBasProductCodeById(String id)
|
||||
public int deleteBasProductCodeById(Long id)
|
||||
{
|
||||
return basProductCodeMapper.deleteBasProductCodeById(id);
|
||||
}
|
||||
|
||||
@@ -18,10 +18,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="spare1" column="spare1" />
|
||||
<result property="spare2" column="spare2" />
|
||||
<result property="spare3" column="spare3" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="spare4" column="spare4" />
|
||||
<result property="spare5" column="spare5" />
|
||||
<result property="spare6" column="spare6" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectBasProductCodeVo">
|
||||
select id, model, color, serial, v, hz, ph, n_w, g_w, type, spare1, spare2, spare3 from bas_product_code
|
||||
select id, model, color, serial, v, hz, ph, n_w, g_w, type, spare1, spare2, spare3, create_time, spare4, spare5, spare6 from bas_product_code
|
||||
</sql>
|
||||
|
||||
<select id="selectBasProductCodeList" parameterType="BasProductCode" resultMap="BasProductCodeResult">
|
||||
@@ -36,10 +40,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="nW != null and nW != ''"> and n_w like concat('%', #{nW}, '%')</if>
|
||||
<if test="gW != null and gW != ''"> and g_w like concat('%', #{gW}, '%')</if>
|
||||
<if test="type != null and type != ''"> and type = #{type}</if>
|
||||
<if test="spare1 != null and spare1 != ''"> and spare1 = #{spare1}</if>
|
||||
<if test="spare2 != null and spare2 != ''"> and spare2 = #{spare2}</if>
|
||||
<if test="spare3 != null and spare3 != ''"> and spare3 = #{spare3}</if>
|
||||
<if test="spare4 != null and spare4 != ''"> and spare4 = #{spare4}</if>
|
||||
<if test="spare5 != null and spare5 != ''"> and spare5 = #{spare5}</if>
|
||||
<if test="spare6 != null and spare6 != ''"> and spare6 = #{spare6}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectBasProductCodeById" parameterType="String" resultMap="BasProductCodeResult">
|
||||
<select id="selectBasProductCodeById" parameterType="Long" resultMap="BasProductCodeResult">
|
||||
<include refid="selectBasProductCodeVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
@@ -60,6 +70,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="spare1 != null">spare1,</if>
|
||||
<if test="spare2 != null">spare2,</if>
|
||||
<if test="spare3 != null">spare3,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="spare4 != null">spare4,</if>
|
||||
<if test="spare5 != null">spare5,</if>
|
||||
<if test="spare6 != null">spare6,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
@@ -75,6 +89,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="spare1 != null">#{spare1},</if>
|
||||
<if test="spare2 != null">#{spare2},</if>
|
||||
<if test="spare3 != null">#{spare3},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="spare4 != null">#{spare4},</if>
|
||||
<if test="spare5 != null">#{spare5},</if>
|
||||
<if test="spare6 != null">#{spare6},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
@@ -93,11 +111,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="spare1 != null">spare1 = #{spare1},</if>
|
||||
<if test="spare2 != null">spare2 = #{spare2},</if>
|
||||
<if test="spare3 != null">spare3 = #{spare3},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="spare4 != null">spare4 = #{spare4},</if>
|
||||
<if test="spare5 != null">spare5 = #{spare5},</if>
|
||||
<if test="spare6 != null">spare6 = #{spare6},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteBasProductCodeById" parameterType="String">
|
||||
<delete id="deleteBasProductCodeById" parameterType="Long">
|
||||
delete from bas_product_code where id = #{id}
|
||||
</delete>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user