diff --git a/ruoyi-admin/src/main/java/com/ruoyi/bas/BasProductCode/controller/BasProductCodeController.java b/ruoyi-admin/src/main/java/com/ruoyi/bas/BasProductCode/controller/BasProductCodeController.java index 908a041..a506ad6 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/bas/BasProductCode/controller/BasProductCodeController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/bas/BasProductCode/controller/BasProductCodeController.java @@ -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)); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/bas/BasProductCode/domain/BasProductCode.java b/ruoyi-admin/src/main/java/com/ruoyi/bas/BasProductCode/domain/BasProductCode.java index 4ad1667..3993766 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/bas/BasProductCode/domain/BasProductCode.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/bas/BasProductCode/domain/BasProductCode.java @@ -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(); } } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/bas/BasProductCode/mapper/BasProductCodeMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/bas/BasProductCode/mapper/BasProductCodeMapper.java index 974214d..b099ffe 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/bas/BasProductCode/mapper/BasProductCodeMapper.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/bas/BasProductCode/mapper/BasProductCodeMapper.java @@ -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); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/bas/BasProductCode/service/IBasProductCodeService.java b/ruoyi-admin/src/main/java/com/ruoyi/bas/BasProductCode/service/IBasProductCodeService.java index fca7649..6f40ce9 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/bas/BasProductCode/service/IBasProductCodeService.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/bas/BasProductCode/service/IBasProductCodeService.java @@ -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); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/bas/BasProductCode/service/impl/BasProductCodeServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/bas/BasProductCode/service/impl/BasProductCodeServiceImpl.java index 4eef6d7..7bd821e 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/bas/BasProductCode/service/impl/BasProductCodeServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/bas/BasProductCode/service/impl/BasProductCodeServiceImpl.java @@ -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); } diff --git a/ruoyi-admin/src/main/resources/mapper/bas/BasProductCodeMapper.xml b/ruoyi-admin/src/main/resources/mapper/bas/BasProductCodeMapper.xml index 38f051e..5477ce9 100644 --- a/ruoyi-admin/src/main/resources/mapper/bas/BasProductCodeMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/bas/BasProductCodeMapper.xml @@ -18,10 +18,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + + + - 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 - where id = #{id} @@ -60,6 +70,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" spare1, spare2, spare3, + create_time, + spare4, + spare5, + spare6, #{id}, @@ -75,6 +89,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{spare1}, #{spare2}, #{spare3}, + #{createTime}, + #{spare4}, + #{spare5}, + #{spare6}, @@ -93,11 +111,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" spare1 = #{spare1}, spare2 = #{spare2}, spare3 = #{spare3}, + create_time = #{createTime}, + spare4 = #{spare4}, + spare5 = #{spare5}, + spare6 = #{spare6}, where id = #{id} - + delete from bas_product_code where id = #{id} diff --git a/ruoyi-ui/src/views/bas/BasProductCode/index.vue b/ruoyi-ui/src/views/bas/BasProductCode/index.vue index 49dedb9..eeecbd9 100644 --- a/ruoyi-ui/src/views/bas/BasProductCode/index.vue +++ b/ruoyi-ui/src/views/bas/BasProductCode/index.vue @@ -1,382 +1,884 @@ + + diff --git a/ruoyi-ui/src/views/bas/basProduct/index.vue b/ruoyi-ui/src/views/bas/basProduct/index.vue index 8e7f123..d6aef35 100644 --- a/ruoyi-ui/src/views/bas/basProduct/index.vue +++ b/ruoyi-ui/src/views/bas/basProduct/index.vue @@ -138,14 +138,14 @@ - - - - + + + +