diff --git a/doc/开发进度/进度甘特图.xlsx b/doc/开发进度/进度甘特图.xlsx index 1b496bd..740237a 100644 Binary files a/doc/开发进度/进度甘特图.xlsx and b/doc/开发进度/进度甘特图.xlsx differ diff --git a/doc/设计文档/数据库设计/mes-wm.sql b/doc/设计文档/数据库设计/mes-wm.sql index c82d145..a82d7e0 100644 --- a/doc/设计文档/数据库设计/mes-wm.sql +++ b/doc/设计文档/数据库设计/mes-wm.sql @@ -666,6 +666,9 @@ create table wm_product_recpt_line ( specification varchar(500) comment '规格型号', unit_of_measure varchar(64) comment '单位', quantity_recived double(12,2) not null comment '入库数量', + workorder_id bigint(20) comment '生产工单ID', + workorder_code varchar(64) comment '生产工单编码', + workorder_name varchar(255) comment '生产工单名称', batch_code varchar(255) comment '批次号', warehouse_id bigint(20) comment '仓库ID', warehouse_code varchar(64) comment '仓库编码', @@ -872,6 +875,34 @@ create table wm_barcode ( ) engine=innodb auto_increment=200 comment = '条码清单表'; + + +-- ---------------------------- +-- 18、条码配置 +-- ---------------------------- +drop table if exists wm_barcode_config; +create table wm_barcode_config ( + config_id bigint(20) not null auto_increment comment '配置ID', + barcode_formart varchar(64) not null comment '条码格式', + barcode_type varchar(64) not null comment '条码类型', + content_formart varchar(255) not null comment '内容格式', + content_example varchar(255) comment '内容样例', + auto_gen_flag char(1) default 'Y' comment '是否自动生成', + enable_flag char(1) default 'Y' comment '是否生效', + remark varchar(500) default '' comment '备注', + attr1 varchar(64) default null comment '预留字段1', + attr2 varchar(255) default null comment '预留字段2', + attr3 int(11) default 0 comment '预留字段3', + attr4 int(11) default 0 comment '预留字段4', + create_by varchar(64) default '' comment '创建者', + create_time datetime comment '创建时间', + update_by varchar(64) default '' comment '更新者', + update_time datetime comment '更新时间', + primary key (config_id) +) engine=innodb auto_increment=200 comment = '条码配置'; + + + -- ---------------------------- -- 19、装箱单表 -- ---------------------------- diff --git a/ktg-mes/src/main/java/com/ktg/mes/wm/controller/WmBarcodeConfigController.java b/ktg-mes/src/main/java/com/ktg/mes/wm/controller/WmBarcodeConfigController.java new file mode 100644 index 0000000..1ba9314 --- /dev/null +++ b/ktg-mes/src/main/java/com/ktg/mes/wm/controller/WmBarcodeConfigController.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.WmBarcodeConfig; +import com.ktg.mes.wm.service.IWmBarcodeConfigService; +import com.ktg.common.utils.poi.ExcelUtil; +import com.ktg.common.core.page.TableDataInfo; + +/** + * 条码配置Controller + * + * @author yinjinlu + * @date 2022-10-22 + */ +@RestController +@RequestMapping("/mes/wm/barcodeconfig") +public class WmBarcodeConfigController extends BaseController +{ + @Autowired + private IWmBarcodeConfigService wmBarcodeConfigService; + + /** + * 查询条码配置列表 + */ + @PreAuthorize("@ss.hasPermi('mes:wm:barcodeconfig:list')") + @GetMapping("/list") + public TableDataInfo list(WmBarcodeConfig wmBarcodeConfig) + { + startPage(); + List list = wmBarcodeConfigService.selectWmBarcodeConfigList(wmBarcodeConfig); + return getDataTable(list); + } + + /** + * 导出条码配置列表 + */ + @PreAuthorize("@ss.hasPermi('mes:wm:barcodeconfig:export')") + @Log(title = "条码配置", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, WmBarcodeConfig wmBarcodeConfig) + { + List list = wmBarcodeConfigService.selectWmBarcodeConfigList(wmBarcodeConfig); + ExcelUtil util = new ExcelUtil(WmBarcodeConfig.class); + util.exportExcel(response, list, "条码配置数据"); + } + + /** + * 获取条码配置详细信息 + */ + @PreAuthorize("@ss.hasPermi('mes:wm:barcodeconfig:query')") + @GetMapping(value = "/{configId}") + public AjaxResult getInfo(@PathVariable("configId") Long configId) + { + return AjaxResult.success(wmBarcodeConfigService.selectWmBarcodeConfigByConfigId(configId)); + } + + /** + * 新增条码配置 + */ + @PreAuthorize("@ss.hasPermi('mes:wm:barcodeconfig:add')") + @Log(title = "条码配置", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody WmBarcodeConfig wmBarcodeConfig) + { + return toAjax(wmBarcodeConfigService.insertWmBarcodeConfig(wmBarcodeConfig)); + } + + /** + * 修改条码配置 + */ + @PreAuthorize("@ss.hasPermi('mes:wm:barcodeconfig:edit')") + @Log(title = "条码配置", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody WmBarcodeConfig wmBarcodeConfig) + { + return toAjax(wmBarcodeConfigService.updateWmBarcodeConfig(wmBarcodeConfig)); + } + + /** + * 删除条码配置 + */ + @PreAuthorize("@ss.hasPermi('mes:wm:barcodeconfig:remove')") + @Log(title = "条码配置", businessType = BusinessType.DELETE) + @DeleteMapping("/{configIds}") + public AjaxResult remove(@PathVariable Long[] configIds) + { + return toAjax(wmBarcodeConfigService.deleteWmBarcodeConfigByConfigIds(configIds)); + } +} diff --git a/ktg-mes/src/main/java/com/ktg/mes/wm/domain/WmBarcodeConfig.java b/ktg-mes/src/main/java/com/ktg/mes/wm/domain/WmBarcodeConfig.java new file mode 100644 index 0000000..1b19549 --- /dev/null +++ b/ktg-mes/src/main/java/com/ktg/mes/wm/domain/WmBarcodeConfig.java @@ -0,0 +1,182 @@ +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_config + * + * @author yinjinlu + * @date 2022-10-22 + */ +public class WmBarcodeConfig extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 配置ID */ + private Long configId; + + /** 条码格式 */ + @Excel(name = "条码格式") + private String barcodeFormart; + + /** 条码类型 */ + @Excel(name = "条码类型") + private String barcodeType; + + /** 内容格式 */ + @Excel(name = "内容格式") + private String contentFormart; + + /** 内容样例 */ + @Excel(name = "内容样例") + private String contentExample; + + /** 是否自动生成 */ + @Excel(name = "是否自动生成") + private String autoGenFlag; + + /** 是否生效 */ + @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 setConfigId(Long configId) + { + this.configId = configId; + } + + public Long getConfigId() + { + return configId; + } + 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 setContentFormart(String contentFormart) + { + this.contentFormart = contentFormart; + } + + public String getContentFormart() + { + return contentFormart; + } + public void setContentExample(String contentExample) + { + this.contentExample = contentExample; + } + + public String getContentExample() + { + return contentExample; + } + public void setAutoGenFlag(String autoGenFlag) + { + this.autoGenFlag = autoGenFlag; + } + + public String getAutoGenFlag() + { + return autoGenFlag; + } + 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("configId", getConfigId()) + .append("barcodeFormart", getBarcodeFormart()) + .append("barcodeType", getBarcodeType()) + .append("contentFormart", getContentFormart()) + .append("contentExample", getContentExample()) + .append("autoGenFlag", getAutoGenFlag()) + .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/WmBarcodeConfigMapper.java b/ktg-mes/src/main/java/com/ktg/mes/wm/mapper/WmBarcodeConfigMapper.java new file mode 100644 index 0000000..ce5ef7c --- /dev/null +++ b/ktg-mes/src/main/java/com/ktg/mes/wm/mapper/WmBarcodeConfigMapper.java @@ -0,0 +1,61 @@ +package com.ktg.mes.wm.mapper; + +import java.util.List; +import com.ktg.mes.wm.domain.WmBarcodeConfig; + +/** + * 条码配置Mapper接口 + * + * @author yinjinlu + * @date 2022-10-22 + */ +public interface WmBarcodeConfigMapper +{ + /** + * 查询条码配置 + * + * @param configId 条码配置主键 + * @return 条码配置 + */ + public WmBarcodeConfig selectWmBarcodeConfigByConfigId(Long configId); + + /** + * 查询条码配置列表 + * + * @param wmBarcodeConfig 条码配置 + * @return 条码配置集合 + */ + public List selectWmBarcodeConfigList(WmBarcodeConfig wmBarcodeConfig); + + /** + * 新增条码配置 + * + * @param wmBarcodeConfig 条码配置 + * @return 结果 + */ + public int insertWmBarcodeConfig(WmBarcodeConfig wmBarcodeConfig); + + /** + * 修改条码配置 + * + * @param wmBarcodeConfig 条码配置 + * @return 结果 + */ + public int updateWmBarcodeConfig(WmBarcodeConfig wmBarcodeConfig); + + /** + * 删除条码配置 + * + * @param configId 条码配置主键 + * @return 结果 + */ + public int deleteWmBarcodeConfigByConfigId(Long configId); + + /** + * 批量删除条码配置 + * + * @param configIds 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteWmBarcodeConfigByConfigIds(Long[] configIds); +} diff --git a/ktg-mes/src/main/java/com/ktg/mes/wm/service/IWmBarcodeConfigService.java b/ktg-mes/src/main/java/com/ktg/mes/wm/service/IWmBarcodeConfigService.java new file mode 100644 index 0000000..0dc26f2 --- /dev/null +++ b/ktg-mes/src/main/java/com/ktg/mes/wm/service/IWmBarcodeConfigService.java @@ -0,0 +1,61 @@ +package com.ktg.mes.wm.service; + +import java.util.List; +import com.ktg.mes.wm.domain.WmBarcodeConfig; + +/** + * 条码配置Service接口 + * + * @author yinjinlu + * @date 2022-10-22 + */ +public interface IWmBarcodeConfigService +{ + /** + * 查询条码配置 + * + * @param configId 条码配置主键 + * @return 条码配置 + */ + public WmBarcodeConfig selectWmBarcodeConfigByConfigId(Long configId); + + /** + * 查询条码配置列表 + * + * @param wmBarcodeConfig 条码配置 + * @return 条码配置集合 + */ + public List selectWmBarcodeConfigList(WmBarcodeConfig wmBarcodeConfig); + + /** + * 新增条码配置 + * + * @param wmBarcodeConfig 条码配置 + * @return 结果 + */ + public int insertWmBarcodeConfig(WmBarcodeConfig wmBarcodeConfig); + + /** + * 修改条码配置 + * + * @param wmBarcodeConfig 条码配置 + * @return 结果 + */ + public int updateWmBarcodeConfig(WmBarcodeConfig wmBarcodeConfig); + + /** + * 批量删除条码配置 + * + * @param configIds 需要删除的条码配置主键集合 + * @return 结果 + */ + public int deleteWmBarcodeConfigByConfigIds(Long[] configIds); + + /** + * 删除条码配置信息 + * + * @param configId 条码配置主键 + * @return 结果 + */ + public int deleteWmBarcodeConfigByConfigId(Long configId); +} diff --git a/ktg-mes/src/main/java/com/ktg/mes/wm/service/impl/WmBarcodeConfigServiceImpl.java b/ktg-mes/src/main/java/com/ktg/mes/wm/service/impl/WmBarcodeConfigServiceImpl.java new file mode 100644 index 0000000..1fd298d --- /dev/null +++ b/ktg-mes/src/main/java/com/ktg/mes/wm/service/impl/WmBarcodeConfigServiceImpl.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.WmBarcodeConfigMapper; +import com.ktg.mes.wm.domain.WmBarcodeConfig; +import com.ktg.mes.wm.service.IWmBarcodeConfigService; + +/** + * 条码配置Service业务层处理 + * + * @author yinjinlu + * @date 2022-10-22 + */ +@Service +public class WmBarcodeConfigServiceImpl implements IWmBarcodeConfigService +{ + @Autowired + private WmBarcodeConfigMapper wmBarcodeConfigMapper; + + /** + * 查询条码配置 + * + * @param configId 条码配置主键 + * @return 条码配置 + */ + @Override + public WmBarcodeConfig selectWmBarcodeConfigByConfigId(Long configId) + { + return wmBarcodeConfigMapper.selectWmBarcodeConfigByConfigId(configId); + } + + /** + * 查询条码配置列表 + * + * @param wmBarcodeConfig 条码配置 + * @return 条码配置 + */ + @Override + public List selectWmBarcodeConfigList(WmBarcodeConfig wmBarcodeConfig) + { + return wmBarcodeConfigMapper.selectWmBarcodeConfigList(wmBarcodeConfig); + } + + /** + * 新增条码配置 + * + * @param wmBarcodeConfig 条码配置 + * @return 结果 + */ + @Override + public int insertWmBarcodeConfig(WmBarcodeConfig wmBarcodeConfig) + { + wmBarcodeConfig.setCreateTime(DateUtils.getNowDate()); + return wmBarcodeConfigMapper.insertWmBarcodeConfig(wmBarcodeConfig); + } + + /** + * 修改条码配置 + * + * @param wmBarcodeConfig 条码配置 + * @return 结果 + */ + @Override + public int updateWmBarcodeConfig(WmBarcodeConfig wmBarcodeConfig) + { + wmBarcodeConfig.setUpdateTime(DateUtils.getNowDate()); + return wmBarcodeConfigMapper.updateWmBarcodeConfig(wmBarcodeConfig); + } + + /** + * 批量删除条码配置 + * + * @param configIds 需要删除的条码配置主键 + * @return 结果 + */ + @Override + public int deleteWmBarcodeConfigByConfigIds(Long[] configIds) + { + return wmBarcodeConfigMapper.deleteWmBarcodeConfigByConfigIds(configIds); + } + + /** + * 删除条码配置信息 + * + * @param configId 条码配置主键 + * @return 结果 + */ + @Override + public int deleteWmBarcodeConfigByConfigId(Long configId) + { + return wmBarcodeConfigMapper.deleteWmBarcodeConfigByConfigId(configId); + } +} diff --git a/ktg-mes/src/main/resources/mapper/wm/WmBarcodeConfigMapper.xml b/ktg-mes/src/main/resources/mapper/wm/WmBarcodeConfigMapper.xml new file mode 100644 index 0000000..ca4cbf9 --- /dev/null +++ b/ktg-mes/src/main/resources/mapper/wm/WmBarcodeConfigMapper.xml @@ -0,0 +1,121 @@ + + + + + + + + + + + + + + + + + + + + + + + + + select config_id, barcode_formart, barcode_type, content_formart, content_example, auto_gen_flag, enable_flag, remark, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time from wm_barcode_config + + + + + + + + insert into wm_barcode_config + + barcode_formart, + barcode_type, + content_formart, + content_example, + auto_gen_flag, + enable_flag, + remark, + attr1, + attr2, + attr3, + attr4, + create_by, + create_time, + update_by, + update_time, + + + #{barcodeFormart}, + #{barcodeType}, + #{contentFormart}, + #{contentExample}, + #{autoGenFlag}, + #{enableFlag}, + #{remark}, + #{attr1}, + #{attr2}, + #{attr3}, + #{attr4}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + + + + + update wm_barcode_config + + barcode_formart = #{barcodeFormart}, + barcode_type = #{barcodeType}, + content_formart = #{contentFormart}, + content_example = #{contentExample}, + auto_gen_flag = #{autoGenFlag}, + enable_flag = #{enableFlag}, + remark = #{remark}, + attr1 = #{attr1}, + attr2 = #{attr2}, + attr3 = #{attr3}, + attr4 = #{attr4}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + + where config_id = #{configId} + + + + delete from wm_barcode_config where config_id = #{configId} + + + + delete from wm_barcode_config where config_id in + + #{configId} + + + \ No newline at end of file