From 0afb452a6ae0c0d797e1eb4a8c5f07c3d666217b Mon Sep 17 00:00:00 2001 From: "JinLu.Yin" <411641505@qq.com> Date: Mon, 1 Aug 2022 10:59:24 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9D=A1=E7=A0=81=E6=B8=85=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wm/controller/WmBarcodeController.java | 104 +++++++++++ .../java/com/ktg/mes/wm/domain/WmBarcode.java | 168 ++++++++++++++++++ .../ktg/mes/wm/mapper/WmBarcodeMapper.java | 61 +++++++ .../ktg/mes/wm/service/IWmBarcodeService.java | 61 +++++++ .../wm/service/impl/WmBarcodeServiceImpl.java | 96 ++++++++++ 5 files changed, 490 insertions(+) create mode 100644 ktg-mes/src/main/java/com/ktg/mes/wm/controller/WmBarcodeController.java create mode 100644 ktg-mes/src/main/java/com/ktg/mes/wm/domain/WmBarcode.java create mode 100644 ktg-mes/src/main/java/com/ktg/mes/wm/mapper/WmBarcodeMapper.java create mode 100644 ktg-mes/src/main/java/com/ktg/mes/wm/service/IWmBarcodeService.java create mode 100644 ktg-mes/src/main/java/com/ktg/mes/wm/service/impl/WmBarcodeServiceImpl.java diff --git a/ktg-mes/src/main/java/com/ktg/mes/wm/controller/WmBarcodeController.java b/ktg-mes/src/main/java/com/ktg/mes/wm/controller/WmBarcodeController.java new file mode 100644 index 0000000..4ec0a89 --- /dev/null +++ b/ktg-mes/src/main/java/com/ktg/mes/wm/controller/WmBarcodeController.java @@ -0,0 +1,104 @@ +package com.ktg.mes.wm.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.ktg.common.annotation.Log; +import com.ktg.common.core.controller.BaseController; +import com.ktg.common.core.domain.AjaxResult; +import com.ktg.common.enums.BusinessType; +import com.ktg.mes.wm.domain.WmBarcode; +import com.ktg.mes.wm.service.IWmBarcodeService; +import com.ktg.common.utils.poi.ExcelUtil; +import com.ktg.common.core.page.TableDataInfo; + +/** + * 条码清单Controller + * + * @author yinjinlu + * @date 2022-08-01 + */ +@RestController +@RequestMapping("/mes/wm/barcode") +public class WmBarcodeController extends BaseController +{ + @Autowired + private IWmBarcodeService wmBarcodeService; + + /** + * 查询条码清单列表 + */ + @PreAuthorize("@ss.hasPermi('mes:wm:barcode:list')") + @GetMapping("/list") + public TableDataInfo list(WmBarcode wmBarcode) + { + startPage(); + List list = wmBarcodeService.selectWmBarcodeList(wmBarcode); + return getDataTable(list); + } + + /** + * 导出条码清单列表 + */ + @PreAuthorize("@ss.hasPermi('mes:wm:barcode:export')") + @Log(title = "条码清单", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, WmBarcode wmBarcode) + { + List list = wmBarcodeService.selectWmBarcodeList(wmBarcode); + ExcelUtil util = new ExcelUtil(WmBarcode.class); + util.exportExcel(response, list, "条码清单数据"); + } + + /** + * 获取条码清单详细信息 + */ + @PreAuthorize("@ss.hasPermi('mes:wm:barcode:query')") + @GetMapping(value = "/{barcodeId}") + public AjaxResult getInfo(@PathVariable("barcodeId") Long barcodeId) + { + return AjaxResult.success(wmBarcodeService.selectWmBarcodeByBarcodeId(barcodeId)); + } + + /** + * 新增条码清单 + */ + @PreAuthorize("@ss.hasPermi('mes:wm:barcode:add')") + @Log(title = "条码清单", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody WmBarcode wmBarcode) + { + return toAjax(wmBarcodeService.insertWmBarcode(wmBarcode)); + } + + /** + * 修改条码清单 + */ + @PreAuthorize("@ss.hasPermi('mes:wm:barcode:edit')") + @Log(title = "条码清单", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody WmBarcode wmBarcode) + { + return toAjax(wmBarcodeService.updateWmBarcode(wmBarcode)); + } + + /** + * 删除条码清单 + */ + @PreAuthorize("@ss.hasPermi('mes:wm:barcode:remove')") + @Log(title = "条码清单", businessType = BusinessType.DELETE) + @DeleteMapping("/{barcodeIds}") + public AjaxResult remove(@PathVariable Long[] barcodeIds) + { + return toAjax(wmBarcodeService.deleteWmBarcodeByBarcodeIds(barcodeIds)); + } +} diff --git a/ktg-mes/src/main/java/com/ktg/mes/wm/domain/WmBarcode.java b/ktg-mes/src/main/java/com/ktg/mes/wm/domain/WmBarcode.java new file mode 100644 index 0000000..434f405 --- /dev/null +++ b/ktg-mes/src/main/java/com/ktg/mes/wm/domain/WmBarcode.java @@ -0,0 +1,168 @@ +package com.ktg.mes.wm.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ktg.common.annotation.Excel; +import com.ktg.common.core.domain.BaseEntity; + +/** + * 条码清单对象 wm_barcode + * + * @author yinjinlu + * @date 2022-08-01 + */ +public class WmBarcode extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 条码ID */ + private Long barcodeId; + + /** 条码格式 */ + @Excel(name = "条码格式") + private String barcodeFormart; + + /** 条码类型 */ + @Excel(name = "条码类型") + private String barcodeType; + + /** 产品物料ID */ + @Excel(name = "产品物料ID") + private String barcodeContent; + + /** 条码地址 */ + @Excel(name = "条码地址") + private String url; + + /** 是否生效 */ + @Excel(name = "是否生效") + private String enableFlag; + + /** 预留字段1 */ + @Excel(name = "预留字段1") + private String attr1; + + /** 预留字段2 */ + @Excel(name = "预留字段2") + private String attr2; + + /** 预留字段3 */ + @Excel(name = "预留字段3") + private Long attr3; + + /** 预留字段4 */ + @Excel(name = "预留字段4") + private Long attr4; + + public void setBarcodeId(Long barcodeId) + { + this.barcodeId = barcodeId; + } + + public Long getBarcodeId() + { + return barcodeId; + } + public void setBarcodeFormart(String barcodeFormart) + { + this.barcodeFormart = barcodeFormart; + } + + public String getBarcodeFormart() + { + return barcodeFormart; + } + public void setBarcodeType(String barcodeType) + { + this.barcodeType = barcodeType; + } + + public String getBarcodeType() + { + return barcodeType; + } + public void setBarcodeContent(String barcodeContent) + { + this.barcodeContent = barcodeContent; + } + + public String getBarcodeContent() + { + return barcodeContent; + } + public void setUrl(String url) + { + this.url = url; + } + + public String getUrl() + { + return url; + } + public void setEnableFlag(String enableFlag) + { + this.enableFlag = enableFlag; + } + + public String getEnableFlag() + { + return enableFlag; + } + public void setAttr1(String attr1) + { + this.attr1 = attr1; + } + + public String getAttr1() + { + return attr1; + } + public void setAttr2(String attr2) + { + this.attr2 = attr2; + } + + public String getAttr2() + { + return attr2; + } + public void setAttr3(Long attr3) + { + this.attr3 = attr3; + } + + public Long getAttr3() + { + return attr3; + } + public void setAttr4(Long attr4) + { + this.attr4 = attr4; + } + + public Long getAttr4() + { + return attr4; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("barcodeId", getBarcodeId()) + .append("barcodeFormart", getBarcodeFormart()) + .append("barcodeType", getBarcodeType()) + .append("barcodeContent", getBarcodeContent()) + .append("url", getUrl()) + .append("enableFlag", getEnableFlag()) + .append("remark", getRemark()) + .append("attr1", getAttr1()) + .append("attr2", getAttr2()) + .append("attr3", getAttr3()) + .append("attr4", getAttr4()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .toString(); + } +} diff --git a/ktg-mes/src/main/java/com/ktg/mes/wm/mapper/WmBarcodeMapper.java b/ktg-mes/src/main/java/com/ktg/mes/wm/mapper/WmBarcodeMapper.java new file mode 100644 index 0000000..5dbad68 --- /dev/null +++ b/ktg-mes/src/main/java/com/ktg/mes/wm/mapper/WmBarcodeMapper.java @@ -0,0 +1,61 @@ +package com.ktg.mes.wm.mapper; + +import java.util.List; +import com.ktg.mes.wm.domain.WmBarcode; + +/** + * 条码清单Mapper接口 + * + * @author yinjinlu + * @date 2022-08-01 + */ +public interface WmBarcodeMapper +{ + /** + * 查询条码清单 + * + * @param barcodeId 条码清单主键 + * @return 条码清单 + */ + public WmBarcode selectWmBarcodeByBarcodeId(Long barcodeId); + + /** + * 查询条码清单列表 + * + * @param wmBarcode 条码清单 + * @return 条码清单集合 + */ + public List selectWmBarcodeList(WmBarcode wmBarcode); + + /** + * 新增条码清单 + * + * @param wmBarcode 条码清单 + * @return 结果 + */ + public int insertWmBarcode(WmBarcode wmBarcode); + + /** + * 修改条码清单 + * + * @param wmBarcode 条码清单 + * @return 结果 + */ + public int updateWmBarcode(WmBarcode wmBarcode); + + /** + * 删除条码清单 + * + * @param barcodeId 条码清单主键 + * @return 结果 + */ + public int deleteWmBarcodeByBarcodeId(Long barcodeId); + + /** + * 批量删除条码清单 + * + * @param barcodeIds 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteWmBarcodeByBarcodeIds(Long[] barcodeIds); +} diff --git a/ktg-mes/src/main/java/com/ktg/mes/wm/service/IWmBarcodeService.java b/ktg-mes/src/main/java/com/ktg/mes/wm/service/IWmBarcodeService.java new file mode 100644 index 0000000..1ce91e3 --- /dev/null +++ b/ktg-mes/src/main/java/com/ktg/mes/wm/service/IWmBarcodeService.java @@ -0,0 +1,61 @@ +package com.ktg.mes.wm.service; + +import java.util.List; +import com.ktg.mes.wm.domain.WmBarcode; + +/** + * 条码清单Service接口 + * + * @author yinjinlu + * @date 2022-08-01 + */ +public interface IWmBarcodeService +{ + /** + * 查询条码清单 + * + * @param barcodeId 条码清单主键 + * @return 条码清单 + */ + public WmBarcode selectWmBarcodeByBarcodeId(Long barcodeId); + + /** + * 查询条码清单列表 + * + * @param wmBarcode 条码清单 + * @return 条码清单集合 + */ + public List selectWmBarcodeList(WmBarcode wmBarcode); + + /** + * 新增条码清单 + * + * @param wmBarcode 条码清单 + * @return 结果 + */ + public int insertWmBarcode(WmBarcode wmBarcode); + + /** + * 修改条码清单 + * + * @param wmBarcode 条码清单 + * @return 结果 + */ + public int updateWmBarcode(WmBarcode wmBarcode); + + /** + * 批量删除条码清单 + * + * @param barcodeIds 需要删除的条码清单主键集合 + * @return 结果 + */ + public int deleteWmBarcodeByBarcodeIds(Long[] barcodeIds); + + /** + * 删除条码清单信息 + * + * @param barcodeId 条码清单主键 + * @return 结果 + */ + public int deleteWmBarcodeByBarcodeId(Long barcodeId); +} diff --git a/ktg-mes/src/main/java/com/ktg/mes/wm/service/impl/WmBarcodeServiceImpl.java b/ktg-mes/src/main/java/com/ktg/mes/wm/service/impl/WmBarcodeServiceImpl.java new file mode 100644 index 0000000..06d39c8 --- /dev/null +++ b/ktg-mes/src/main/java/com/ktg/mes/wm/service/impl/WmBarcodeServiceImpl.java @@ -0,0 +1,96 @@ +package com.ktg.mes.wm.service.impl; + +import java.util.List; +import com.ktg.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ktg.mes.wm.mapper.WmBarcodeMapper; +import com.ktg.mes.wm.domain.WmBarcode; +import com.ktg.mes.wm.service.IWmBarcodeService; + +/** + * 条码清单Service业务层处理 + * + * @author yinjinlu + * @date 2022-08-01 + */ +@Service +public class WmBarcodeServiceImpl implements IWmBarcodeService +{ + @Autowired + private WmBarcodeMapper wmBarcodeMapper; + + /** + * 查询条码清单 + * + * @param barcodeId 条码清单主键 + * @return 条码清单 + */ + @Override + public WmBarcode selectWmBarcodeByBarcodeId(Long barcodeId) + { + return wmBarcodeMapper.selectWmBarcodeByBarcodeId(barcodeId); + } + + /** + * 查询条码清单列表 + * + * @param wmBarcode 条码清单 + * @return 条码清单 + */ + @Override + public List selectWmBarcodeList(WmBarcode wmBarcode) + { + return wmBarcodeMapper.selectWmBarcodeList(wmBarcode); + } + + /** + * 新增条码清单 + * + * @param wmBarcode 条码清单 + * @return 结果 + */ + @Override + public int insertWmBarcode(WmBarcode wmBarcode) + { + wmBarcode.setCreateTime(DateUtils.getNowDate()); + return wmBarcodeMapper.insertWmBarcode(wmBarcode); + } + + /** + * 修改条码清单 + * + * @param wmBarcode 条码清单 + * @return 结果 + */ + @Override + public int updateWmBarcode(WmBarcode wmBarcode) + { + wmBarcode.setUpdateTime(DateUtils.getNowDate()); + return wmBarcodeMapper.updateWmBarcode(wmBarcode); + } + + /** + * 批量删除条码清单 + * + * @param barcodeIds 需要删除的条码清单主键 + * @return 结果 + */ + @Override + public int deleteWmBarcodeByBarcodeIds(Long[] barcodeIds) + { + return wmBarcodeMapper.deleteWmBarcodeByBarcodeIds(barcodeIds); + } + + /** + * 删除条码清单信息 + * + * @param barcodeId 条码清单主键 + * @return 结果 + */ + @Override + public int deleteWmBarcodeByBarcodeId(Long barcodeId) + { + return wmBarcodeMapper.deleteWmBarcodeByBarcodeId(barcodeId); + } +}