diff --git a/os-mes/src/main/java/com/os/mes/base/controller/BaseCustomDataController.java b/os-mes/src/main/java/com/os/mes/base/controller/BaseCustomDataController.java new file mode 100644 index 0000000..547f559 --- /dev/null +++ b/os-mes/src/main/java/com/os/mes/base/controller/BaseCustomDataController.java @@ -0,0 +1,100 @@ +package com.os.mes.base.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.os.common.annotation.Log; +import com.os.common.core.controller.BaseController; +import com.os.common.core.domain.AjaxResult; +import com.os.common.enums.BusinessType; +import com.os.mes.base.domain.BaseCustomData; +import com.os.mes.base.service.IBaseCustomDataService; +import com.os.common.utils.poi.ExcelUtil; +import com.os.common.core.page.TableDataInfo; + +/** + * 自定义数据维护Controller + * + * @author Yinq + * @date 2024-05-10 + */ +@RestController +@RequestMapping("/mes/base/baseCustomData") +public class BaseCustomDataController extends BaseController { + @Autowired + private IBaseCustomDataService baseCustomDataService; + + /** + * 查询自定义数据维护列表 + */ + @PreAuthorize("@ss.hasPermi('mes/base:baseCustomData:list')") + @GetMapping("/list") + public TableDataInfo list(BaseCustomData baseCustomData) { + startPage(); + List list = baseCustomDataService.selectBaseCustomDataList(baseCustomData); + return getDataTable(list); + } + + /** + * 导出自定义数据维护列表 + */ + @PreAuthorize("@ss.hasPermi('mes/base:baseCustomData:export')") + @Log(title = "自定义数据维护", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, BaseCustomData baseCustomData) { + List list = baseCustomDataService.selectBaseCustomDataList(baseCustomData); + ExcelUtil util = new ExcelUtil(BaseCustomData.class); + util.exportExcel(response, list, "自定义数据维护数据"); + } + + /** + * 获取自定义数据维护详细信息 + */ + @PreAuthorize("@ss.hasPermi('mes/base:baseCustomData:query')") + @GetMapping(value = "/{objId}") + public AjaxResult getInfo(@PathVariable("objId") Long objId) { + return success(baseCustomDataService.selectBaseCustomDataByObjId(objId)); + } + + /** + * 新增自定义数据维护 + */ + @PreAuthorize("@ss.hasPermi('mes/base:baseCustomData:add')") + @Log(title = "自定义数据维护", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody BaseCustomData baseCustomData) { + baseCustomData.setCreateBy(getUsername()); + return toAjax(baseCustomDataService.insertBaseCustomData(baseCustomData)); + } + + /** + * 修改自定义数据维护 + */ + @PreAuthorize("@ss.hasPermi('mes/base:baseCustomData:edit')") + @Log(title = "自定义数据维护", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody BaseCustomData baseCustomData) { + baseCustomData.setUpdateBy(getUsername()); + return toAjax(baseCustomDataService.updateBaseCustomData(baseCustomData)); + } + + /** + * 删除自定义数据维护 + */ + @PreAuthorize("@ss.hasPermi('mes/base:baseCustomData:remove')") + @Log(title = "自定义数据维护", businessType = BusinessType.DELETE) + @DeleteMapping("/{objIds}") + public AjaxResult remove(@PathVariable Long[] objIds) { + return toAjax(baseCustomDataService.deleteBaseCustomDataByObjIds(objIds)); + } +} diff --git a/os-mes/src/main/java/com/os/mes/base/controller/BaseDeviceLedgerController.java b/os-mes/src/main/java/com/os/mes/base/controller/BaseDeviceLedgerController.java index 7f4eac2..e8cbeb2 100644 --- a/os-mes/src/main/java/com/os/mes/base/controller/BaseDeviceLedgerController.java +++ b/os-mes/src/main/java/com/os/mes/base/controller/BaseDeviceLedgerController.java @@ -103,4 +103,13 @@ public class BaseDeviceLedgerController extends BaseController { return toAjax(baseDeviceLedgerService.deleteBaseDeviceLedgerByObjIds(objIds)); } + + /** + * 获取设备编号 + * @return + */ + @GetMapping("/getDeviceCode") + public AjaxResult getDeviceCode() { + return success(baseDeviceLedgerService.getDeviceCode()); + } } diff --git a/os-mes/src/main/java/com/os/mes/base/controller/BaseMaterialInfoController.java b/os-mes/src/main/java/com/os/mes/base/controller/BaseMaterialInfoController.java new file mode 100644 index 0000000..f7462b2 --- /dev/null +++ b/os-mes/src/main/java/com/os/mes/base/controller/BaseMaterialInfoController.java @@ -0,0 +1,106 @@ +package com.os.mes.base.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.os.common.annotation.Log; +import com.os.common.core.controller.BaseController; +import com.os.common.core.domain.AjaxResult; +import com.os.common.enums.BusinessType; +import com.os.mes.base.domain.BaseMaterialInfo; +import com.os.mes.base.service.IBaseMaterialInfoService; +import com.os.common.utils.poi.ExcelUtil; +import com.os.common.core.page.TableDataInfo; + +/** + * 物料信息Controller + * + * @author Yinq + * @date 2024-05-10 + */ +@RestController +@RequestMapping("/mes/base/baseMaterialInfo") +public class BaseMaterialInfoController extends BaseController +{ + @Autowired + private IBaseMaterialInfoService baseMaterialInfoService; + + /** + * 查询物料信息列表 + */ + @PreAuthorize("@ss.hasPermi('mes/base:baseMaterialInfo:list')") + @GetMapping("/list") + public TableDataInfo list(BaseMaterialInfo baseMaterialInfo) + { + startPage(); + List list = baseMaterialInfoService.selectBaseMaterialInfoList(baseMaterialInfo); + return getDataTable(list); + } + + /** + * 导出物料信息列表 + */ + @PreAuthorize("@ss.hasPermi('mes/base:baseMaterialInfo:export')") + @Log(title = "物料信息", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, BaseMaterialInfo baseMaterialInfo) + { + List list = baseMaterialInfoService.selectBaseMaterialInfoList(baseMaterialInfo); + ExcelUtil util = new ExcelUtil(BaseMaterialInfo.class); + util.exportExcel(response, list, "物料信息数据"); + } + + /** + * 获取物料信息详细信息 + */ + @PreAuthorize("@ss.hasPermi('mes/base:baseMaterialInfo:query')") + @GetMapping(value = "/{objId}") + public AjaxResult getInfo(@PathVariable("objId") Long objId) + { + return success(baseMaterialInfoService.selectBaseMaterialInfoByObjId(objId)); + } + + /** + * 新增物料信息 + */ + @PreAuthorize("@ss.hasPermi('mes/base:baseMaterialInfo:add')") + @Log(title = "物料信息", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody BaseMaterialInfo baseMaterialInfo) + { + baseMaterialInfo.setCreateBy(getUsername()); + return toAjax(baseMaterialInfoService.insertBaseMaterialInfo(baseMaterialInfo)); + } + + /** + * 修改物料信息 + */ + @PreAuthorize("@ss.hasPermi('mes/base:baseMaterialInfo:edit')") + @Log(title = "物料信息", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody BaseMaterialInfo baseMaterialInfo) + { + baseMaterialInfo.setUpdateBy(getUsername()); + return toAjax(baseMaterialInfoService.updateBaseMaterialInfo(baseMaterialInfo)); + } + + /** + * 删除物料信息 + */ + @PreAuthorize("@ss.hasPermi('mes/base:baseMaterialInfo:remove')") + @Log(title = "物料信息", businessType = BusinessType.DELETE) + @DeleteMapping("/{objIds}") + public AjaxResult remove(@PathVariable Long[] objIds) + { + return toAjax(baseMaterialInfoService.deleteBaseMaterialInfoByObjIds(objIds)); + } +} diff --git a/os-mes/src/main/java/com/os/mes/base/domain/BaseCustomData.java b/os-mes/src/main/java/com/os/mes/base/domain/BaseCustomData.java new file mode 100644 index 0000000..60a73f7 --- /dev/null +++ b/os-mes/src/main/java/com/os/mes/base/domain/BaseCustomData.java @@ -0,0 +1,131 @@ +package com.os.mes.base.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.os.common.annotation.Excel; +import com.os.common.core.domain.BaseEntity; + +/** + * 自定义数据维护对象 base_custom_data + * + * @author Yinq + * @date 2024-05-10 + */ +public class BaseCustomData extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * 主键标识 + */ + private Long objId; + + /** + * 自定义数据类型(0OS数据 1EMS数据) + */ + @Excel(name = "自定义数据类型", readConverterExp = "0=OS数据,1=EMS数据") + private String customType; + + /** + * 自定义功能 + */ + @Excel(name = "自定义功能") + private String customFunction; + + /** + * 自定义编号 + */ + @Excel(name = "自定义编号") + private String customCode; + + /** + * 自定义数据 + */ + @Excel(name = "自定义数据") + private String customData; + + /** + * 排序 + */ + @Excel(name = "排序") + private Long customSort; + + /** + * 是否标识 + */ + @Excel(name = "是否标识") + private String isFlag; + + public void setObjId(Long objId) { + this.objId = objId; + } + + public Long getObjId() { + return objId; + } + + public void setCustomType(String customType) { + this.customType = customType; + } + + public String getCustomType() { + return customType; + } + + public void setCustomFunction(String customFunction) { + this.customFunction = customFunction; + } + + public String getCustomFunction() { + return customFunction; + } + + public void setCustomCode(String customCode) { + this.customCode = customCode; + } + + public String getCustomCode() { + return customCode; + } + + public void setCustomData(String customData) { + this.customData = customData; + } + + public String getCustomData() { + return customData; + } + + public void setCustomSort(Long customSort) { + this.customSort = customSort; + } + + public Long getCustomSort() { + return customSort; + } + + public void setIsFlag(String isFlag) { + this.isFlag = isFlag; + } + + public String getIsFlag() { + return isFlag; + } + + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) + .append("objId", getObjId()) + .append("customType", getCustomType()) + .append("customFunction", getCustomFunction()) + .append("customCode", getCustomCode()) + .append("customData", getCustomData()) + .append("customSort", getCustomSort()) + .append("remark", getRemark()) + .append("isFlag", getIsFlag()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .toString(); + } +} diff --git a/os-mes/src/main/java/com/os/mes/base/domain/BaseMaterialInfo.java b/os-mes/src/main/java/com/os/mes/base/domain/BaseMaterialInfo.java new file mode 100644 index 0000000..f59cde3 --- /dev/null +++ b/os-mes/src/main/java/com/os/mes/base/domain/BaseMaterialInfo.java @@ -0,0 +1,255 @@ +package com.os.mes.base.domain; + +import java.math.BigDecimal; +import java.util.Date; + +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.os.common.annotation.Excel; +import com.os.common.core.domain.BaseEntity; + +/** + * 物料信息对象 base_material_info + * + * @author Yinq + * @date 2024-05-10 + */ +public class BaseMaterialInfo extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * 主键标识 + */ + private Long objId; + + /** + * 物料编码 + */ + @Excel(name = "物料编码") + private String materialCode; + + /** + * 物料名称 + */ + @Excel(name = "物料名称") + private String materialName; + + /** + * 物料大类 + */ + @Excel(name = "物料大类") + private String materialCategories; + + /** + * 物料小类(1成品 2BOM) + */ + @Excel(name = "物料小类", readConverterExp = "1=成品,2=BOM") + private String materialSubclass; + + /** + * SAP物料类型 + */ + @Excel(name = "SAP物料类型") + private String materialType; + + /** + * 计量单位 + */ + @Excel(name = "计量单位") + private String materialUnit; + + /** + * 单位工资(元) + */ + @Excel(name = "单位工资(元)") + private BigDecimal unitPrice; + + /** + * 物料型号 + */ + @Excel(name = "物料型号") + private String materialSpecifications; + + /** + * 工厂编号 + */ + @Excel(name = "工厂编号") + private String factoryCode; + + /** + * 所属工位 + */ + @Excel(name = "所属工位") + private String productLineCode; + + /** + * 是否标识 + */ + @Excel(name = "是否标识") + private String isFlag; + + /** + * 增量日期 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "增量日期", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + private Date incrementDate; + + /** + * 商品编码 + */ + @Excel(name = "商品编码") + private String productCode; + + /** + * 商品名称 + */ + @Excel(name = "商品名称") + private String productName; + + public void setObjId(Long objId) { + this.objId = objId; + } + + public Long getObjId() { + return objId; + } + + public void setMaterialCode(String materialCode) { + this.materialCode = materialCode; + } + + public String getMaterialCode() { + return materialCode; + } + + public void setMaterialName(String materialName) { + this.materialName = materialName; + } + + public String getMaterialName() { + return materialName; + } + + public void setMaterialCategories(String materialCategories) { + this.materialCategories = materialCategories; + } + + public String getMaterialCategories() { + return materialCategories; + } + + public void setMaterialSubclass(String materialSubclass) { + this.materialSubclass = materialSubclass; + } + + public String getMaterialSubclass() { + return materialSubclass; + } + + public void setMaterialType(String materialType) { + this.materialType = materialType; + } + + public String getMaterialType() { + return materialType; + } + + public void setMaterialUnit(String materialUnit) { + this.materialUnit = materialUnit; + } + + public String getMaterialUnit() { + return materialUnit; + } + + public void setUnitPrice(BigDecimal unitPrice) { + this.unitPrice = unitPrice; + } + + public BigDecimal getUnitPrice() { + return unitPrice; + } + + public void setMaterialSpecifications(String materialSpecifications) { + this.materialSpecifications = materialSpecifications; + } + + public String getMaterialSpecifications() { + return materialSpecifications; + } + + public void setFactoryCode(String factoryCode) { + this.factoryCode = factoryCode; + } + + public String getFactoryCode() { + return factoryCode; + } + + public void setProductLineCode(String productLineCode) { + this.productLineCode = productLineCode; + } + + public String getProductLineCode() { + return productLineCode; + } + + public void setIsFlag(String isFlag) { + this.isFlag = isFlag; + } + + public String getIsFlag() { + return isFlag; + } + + public void setIncrementDate(Date incrementDate) { + this.incrementDate = incrementDate; + } + + public Date getIncrementDate() { + return incrementDate; + } + + public void setProductCode(String productCode) { + this.productCode = productCode; + } + + public String getProductCode() { + return productCode; + } + + public void setProductName(String productName) { + this.productName = productName; + } + + public String getProductName() { + return productName; + } + + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) + .append("objId", getObjId()) + .append("materialCode", getMaterialCode()) + .append("materialName", getMaterialName()) + .append("materialCategories", getMaterialCategories()) + .append("materialSubclass", getMaterialSubclass()) + .append("materialType", getMaterialType()) + .append("materialUnit", getMaterialUnit()) + .append("unitPrice", getUnitPrice()) + .append("materialSpecifications", getMaterialSpecifications()) + .append("factoryCode", getFactoryCode()) + .append("productLineCode", getProductLineCode()) + .append("isFlag", getIsFlag()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("incrementDate", getIncrementDate()) + .append("productCode", getProductCode()) + .append("productName", getProductName()) + .toString(); + } +} diff --git a/os-mes/src/main/java/com/os/mes/base/mapper/BaseCustomDataMapper.java b/os-mes/src/main/java/com/os/mes/base/mapper/BaseCustomDataMapper.java new file mode 100644 index 0000000..a4cc81d --- /dev/null +++ b/os-mes/src/main/java/com/os/mes/base/mapper/BaseCustomDataMapper.java @@ -0,0 +1,61 @@ +package com.os.mes.base.mapper; + +import java.util.List; + +import com.os.mes.base.domain.BaseCustomData; + +/** + * 自定义数据维护Mapper接口 + * + * @author Yinq + * @date 2024-05-10 + */ +public interface BaseCustomDataMapper { + /** + * 查询自定义数据维护 + * + * @param objId 自定义数据维护主键 + * @return 自定义数据维护 + */ + public BaseCustomData selectBaseCustomDataByObjId(Long objId); + + /** + * 查询自定义数据维护列表 + * + * @param baseCustomData 自定义数据维护 + * @return 自定义数据维护集合 + */ + public List selectBaseCustomDataList(BaseCustomData baseCustomData); + + /** + * 新增自定义数据维护 + * + * @param baseCustomData 自定义数据维护 + * @return 结果 + */ + public int insertBaseCustomData(BaseCustomData baseCustomData); + + /** + * 修改自定义数据维护 + * + * @param baseCustomData 自定义数据维护 + * @return 结果 + */ + public int updateBaseCustomData(BaseCustomData baseCustomData); + + /** + * 删除自定义数据维护 + * + * @param objId 自定义数据维护主键 + * @return 结果 + */ + public int deleteBaseCustomDataByObjId(Long objId); + + /** + * 批量删除自定义数据维护 + * + * @param objIds 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteBaseCustomDataByObjIds(Long[] objIds); +} diff --git a/os-mes/src/main/java/com/os/mes/base/mapper/BaseDeviceLedgerMapper.java b/os-mes/src/main/java/com/os/mes/base/mapper/BaseDeviceLedgerMapper.java index f2094bd..e961300 100644 --- a/os-mes/src/main/java/com/os/mes/base/mapper/BaseDeviceLedgerMapper.java +++ b/os-mes/src/main/java/com/os/mes/base/mapper/BaseDeviceLedgerMapper.java @@ -58,4 +58,10 @@ public interface BaseDeviceLedgerMapper * @return 结果 */ public int deleteBaseDeviceLedgerByObjIds(Long[] objIds); + + /** + * 获取设备编号 + * @return + */ + public String getDeviceCode(); } diff --git a/os-mes/src/main/java/com/os/mes/base/mapper/BaseMaterialInfoMapper.java b/os-mes/src/main/java/com/os/mes/base/mapper/BaseMaterialInfoMapper.java new file mode 100644 index 0000000..84dccc7 --- /dev/null +++ b/os-mes/src/main/java/com/os/mes/base/mapper/BaseMaterialInfoMapper.java @@ -0,0 +1,61 @@ +package com.os.mes.base.mapper; + +import java.util.List; +import com.os.mes.base.domain.BaseMaterialInfo; + +/** + * 物料信息Mapper接口 + * + * @author Yinq + * @date 2024-05-10 + */ +public interface BaseMaterialInfoMapper +{ + /** + * 查询物料信息 + * + * @param objId 物料信息主键 + * @return 物料信息 + */ + public BaseMaterialInfo selectBaseMaterialInfoByObjId(Long objId); + + /** + * 查询物料信息列表 + * + * @param baseMaterialInfo 物料信息 + * @return 物料信息集合 + */ + public List selectBaseMaterialInfoList(BaseMaterialInfo baseMaterialInfo); + + /** + * 新增物料信息 + * + * @param baseMaterialInfo 物料信息 + * @return 结果 + */ + public int insertBaseMaterialInfo(BaseMaterialInfo baseMaterialInfo); + + /** + * 修改物料信息 + * + * @param baseMaterialInfo 物料信息 + * @return 结果 + */ + public int updateBaseMaterialInfo(BaseMaterialInfo baseMaterialInfo); + + /** + * 删除物料信息 + * + * @param objId 物料信息主键 + * @return 结果 + */ + public int deleteBaseMaterialInfoByObjId(Long objId); + + /** + * 批量删除物料信息 + * + * @param objIds 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteBaseMaterialInfoByObjIds(Long[] objIds); +} diff --git a/os-mes/src/main/java/com/os/mes/base/service/IBaseCustomDataService.java b/os-mes/src/main/java/com/os/mes/base/service/IBaseCustomDataService.java new file mode 100644 index 0000000..a25074d --- /dev/null +++ b/os-mes/src/main/java/com/os/mes/base/service/IBaseCustomDataService.java @@ -0,0 +1,61 @@ +package com.os.mes.base.service; + +import java.util.List; + +import com.os.mes.base.domain.BaseCustomData; + +/** + * 自定义数据维护Service接口 + * + * @author Yinq + * @date 2024-05-10 + */ +public interface IBaseCustomDataService { + /** + * 查询自定义数据维护 + * + * @param objId 自定义数据维护主键 + * @return 自定义数据维护 + */ + public BaseCustomData selectBaseCustomDataByObjId(Long objId); + + /** + * 查询自定义数据维护列表 + * + * @param baseCustomData 自定义数据维护 + * @return 自定义数据维护集合 + */ + public List selectBaseCustomDataList(BaseCustomData baseCustomData); + + /** + * 新增自定义数据维护 + * + * @param baseCustomData 自定义数据维护 + * @return 结果 + */ + public int insertBaseCustomData(BaseCustomData baseCustomData); + + /** + * 修改自定义数据维护 + * + * @param baseCustomData 自定义数据维护 + * @return 结果 + */ + public int updateBaseCustomData(BaseCustomData baseCustomData); + + /** + * 批量删除自定义数据维护 + * + * @param objIds 需要删除的自定义数据维护主键集合 + * @return 结果 + */ + public int deleteBaseCustomDataByObjIds(Long[] objIds); + + /** + * 删除自定义数据维护信息 + * + * @param objId 自定义数据维护主键 + * @return 结果 + */ + public int deleteBaseCustomDataByObjId(Long objId); +} diff --git a/os-mes/src/main/java/com/os/mes/base/service/IBaseDeviceLedgerService.java b/os-mes/src/main/java/com/os/mes/base/service/IBaseDeviceLedgerService.java index c73d196..e351564 100644 --- a/os-mes/src/main/java/com/os/mes/base/service/IBaseDeviceLedgerService.java +++ b/os-mes/src/main/java/com/os/mes/base/service/IBaseDeviceLedgerService.java @@ -58,4 +58,10 @@ public interface IBaseDeviceLedgerService * @return 结果 */ public int deleteBaseDeviceLedgerByObjId(Long objId); + + /** + * 获取设备编号 + * @return + */ + public String getDeviceCode(); } diff --git a/os-mes/src/main/java/com/os/mes/base/service/IBaseMaterialInfoService.java b/os-mes/src/main/java/com/os/mes/base/service/IBaseMaterialInfoService.java new file mode 100644 index 0000000..7b0e565 --- /dev/null +++ b/os-mes/src/main/java/com/os/mes/base/service/IBaseMaterialInfoService.java @@ -0,0 +1,61 @@ +package com.os.mes.base.service; + +import java.util.List; +import com.os.mes.base.domain.BaseMaterialInfo; + +/** + * 物料信息Service接口 + * + * @author Yinq + * @date 2024-05-10 + */ +public interface IBaseMaterialInfoService +{ + /** + * 查询物料信息 + * + * @param objId 物料信息主键 + * @return 物料信息 + */ + public BaseMaterialInfo selectBaseMaterialInfoByObjId(Long objId); + + /** + * 查询物料信息列表 + * + * @param baseMaterialInfo 物料信息 + * @return 物料信息集合 + */ + public List selectBaseMaterialInfoList(BaseMaterialInfo baseMaterialInfo); + + /** + * 新增物料信息 + * + * @param baseMaterialInfo 物料信息 + * @return 结果 + */ + public int insertBaseMaterialInfo(BaseMaterialInfo baseMaterialInfo); + + /** + * 修改物料信息 + * + * @param baseMaterialInfo 物料信息 + * @return 结果 + */ + public int updateBaseMaterialInfo(BaseMaterialInfo baseMaterialInfo); + + /** + * 批量删除物料信息 + * + * @param objIds 需要删除的物料信息主键集合 + * @return 结果 + */ + public int deleteBaseMaterialInfoByObjIds(Long[] objIds); + + /** + * 删除物料信息信息 + * + * @param objId 物料信息主键 + * @return 结果 + */ + public int deleteBaseMaterialInfoByObjId(Long objId); +} diff --git a/os-mes/src/main/java/com/os/mes/base/service/impl/BaseCustomDataServiceImpl.java b/os-mes/src/main/java/com/os/mes/base/service/impl/BaseCustomDataServiceImpl.java new file mode 100644 index 0000000..225a2cb --- /dev/null +++ b/os-mes/src/main/java/com/os/mes/base/service/impl/BaseCustomDataServiceImpl.java @@ -0,0 +1,90 @@ +package com.os.mes.base.service.impl; + +import java.util.List; + +import com.os.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.os.mes.base.mapper.BaseCustomDataMapper; +import com.os.mes.base.domain.BaseCustomData; +import com.os.mes.base.service.IBaseCustomDataService; + +/** + * 自定义数据维护Service业务层处理 + * + * @author Yinq + * @date 2024-05-10 + */ +@Service +public class BaseCustomDataServiceImpl implements IBaseCustomDataService { + @Autowired + private BaseCustomDataMapper baseCustomDataMapper; + + /** + * 查询自定义数据维护 + * + * @param objId 自定义数据维护主键 + * @return 自定义数据维护 + */ + @Override + public BaseCustomData selectBaseCustomDataByObjId(Long objId) { + return baseCustomDataMapper.selectBaseCustomDataByObjId(objId); + } + + /** + * 查询自定义数据维护列表 + * + * @param baseCustomData 自定义数据维护 + * @return 自定义数据维护 + */ + @Override + public List selectBaseCustomDataList(BaseCustomData baseCustomData) { + return baseCustomDataMapper.selectBaseCustomDataList(baseCustomData); + } + + /** + * 新增自定义数据维护 + * + * @param baseCustomData 自定义数据维护 + * @return 结果 + */ + @Override + public int insertBaseCustomData(BaseCustomData baseCustomData) { + baseCustomData.setCreateTime(DateUtils.getNowDate()); + return baseCustomDataMapper.insertBaseCustomData(baseCustomData); + } + + /** + * 修改自定义数据维护 + * + * @param baseCustomData 自定义数据维护 + * @return 结果 + */ + @Override + public int updateBaseCustomData(BaseCustomData baseCustomData) { + baseCustomData.setUpdateTime(DateUtils.getNowDate()); + return baseCustomDataMapper.updateBaseCustomData(baseCustomData); + } + + /** + * 批量删除自定义数据维护 + * + * @param objIds 需要删除的自定义数据维护主键 + * @return 结果 + */ + @Override + public int deleteBaseCustomDataByObjIds(Long[] objIds) { + return baseCustomDataMapper.deleteBaseCustomDataByObjIds(objIds); + } + + /** + * 删除自定义数据维护信息 + * + * @param objId 自定义数据维护主键 + * @return 结果 + */ + @Override + public int deleteBaseCustomDataByObjId(Long objId) { + return baseCustomDataMapper.deleteBaseCustomDataByObjId(objId); + } +} diff --git a/os-mes/src/main/java/com/os/mes/base/service/impl/BaseDeviceLedgerServiceImpl.java b/os-mes/src/main/java/com/os/mes/base/service/impl/BaseDeviceLedgerServiceImpl.java index 576e407..81465e1 100644 --- a/os-mes/src/main/java/com/os/mes/base/service/impl/BaseDeviceLedgerServiceImpl.java +++ b/os-mes/src/main/java/com/os/mes/base/service/impl/BaseDeviceLedgerServiceImpl.java @@ -2,6 +2,7 @@ package com.os.mes.base.service.impl; import java.util.List; import com.os.common.utils.DateUtils; +import com.os.common.utils.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.os.mes.base.mapper.BaseDeviceLedgerMapper; @@ -93,4 +94,24 @@ public class BaseDeviceLedgerServiceImpl implements IBaseDeviceLedgerService { return baseDeviceLedgerMapper.deleteBaseDeviceLedgerByObjId(objId); } + + /** + * 获取设备编号 + * @return + */ + @Override + public String getDeviceCode() { + int incrementedNumber = 1; + String deviceCode = baseDeviceLedgerMapper.getDeviceCode(); + if (StringUtils.isNotEmpty(deviceCode)){ + String numericPart = deviceCode.substring(1); + // 将数字部分转换为整数并加1 + incrementedNumber = Integer.parseInt(numericPart) + 1; + } + // 格式化加1后的数字部分,确保总长度为5位 + String formattedNumber = String.format("%05d", incrementedNumber); + // 拼接 'E' 和格式化后的数字部分 + return "E" + formattedNumber; + } + } diff --git a/os-mes/src/main/java/com/os/mes/base/service/impl/BaseMaterialInfoServiceImpl.java b/os-mes/src/main/java/com/os/mes/base/service/impl/BaseMaterialInfoServiceImpl.java new file mode 100644 index 0000000..6f18ee6 --- /dev/null +++ b/os-mes/src/main/java/com/os/mes/base/service/impl/BaseMaterialInfoServiceImpl.java @@ -0,0 +1,96 @@ +package com.os.mes.base.service.impl; + +import java.util.List; +import com.os.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.os.mes.base.mapper.BaseMaterialInfoMapper; +import com.os.mes.base.domain.BaseMaterialInfo; +import com.os.mes.base.service.IBaseMaterialInfoService; + +/** + * 物料信息Service业务层处理 + * + * @author Yinq + * @date 2024-05-10 + */ +@Service +public class BaseMaterialInfoServiceImpl implements IBaseMaterialInfoService +{ + @Autowired + private BaseMaterialInfoMapper baseMaterialInfoMapper; + + /** + * 查询物料信息 + * + * @param objId 物料信息主键 + * @return 物料信息 + */ + @Override + public BaseMaterialInfo selectBaseMaterialInfoByObjId(Long objId) + { + return baseMaterialInfoMapper.selectBaseMaterialInfoByObjId(objId); + } + + /** + * 查询物料信息列表 + * + * @param baseMaterialInfo 物料信息 + * @return 物料信息 + */ + @Override + public List selectBaseMaterialInfoList(BaseMaterialInfo baseMaterialInfo) + { + return baseMaterialInfoMapper.selectBaseMaterialInfoList(baseMaterialInfo); + } + + /** + * 新增物料信息 + * + * @param baseMaterialInfo 物料信息 + * @return 结果 + */ + @Override + public int insertBaseMaterialInfo(BaseMaterialInfo baseMaterialInfo) + { + baseMaterialInfo.setCreateTime(DateUtils.getNowDate()); + return baseMaterialInfoMapper.insertBaseMaterialInfo(baseMaterialInfo); + } + + /** + * 修改物料信息 + * + * @param baseMaterialInfo 物料信息 + * @return 结果 + */ + @Override + public int updateBaseMaterialInfo(BaseMaterialInfo baseMaterialInfo) + { + baseMaterialInfo.setUpdateTime(DateUtils.getNowDate()); + return baseMaterialInfoMapper.updateBaseMaterialInfo(baseMaterialInfo); + } + + /** + * 批量删除物料信息 + * + * @param objIds 需要删除的物料信息主键 + * @return 结果 + */ + @Override + public int deleteBaseMaterialInfoByObjIds(Long[] objIds) + { + return baseMaterialInfoMapper.deleteBaseMaterialInfoByObjIds(objIds); + } + + /** + * 删除物料信息信息 + * + * @param objId 物料信息主键 + * @return 结果 + */ + @Override + public int deleteBaseMaterialInfoByObjId(Long objId) + { + return baseMaterialInfoMapper.deleteBaseMaterialInfoByObjId(objId); + } +} diff --git a/os-mes/src/main/resources/mapper/mes/base/BaseCustomDataMapper.xml b/os-mes/src/main/resources/mapper/mes/base/BaseCustomDataMapper.xml new file mode 100644 index 0000000..5fb05a0 --- /dev/null +++ b/os-mes/src/main/resources/mapper/mes/base/BaseCustomDataMapper.xml @@ -0,0 +1,115 @@ + + + + + + + + + + + + + + + + + + + + + select obj_id, + custom_type, + custom_function, + custom_code, + custom_data, + custom_sort, + remark, + is_flag, + create_by, + create_time, + update_by, + update_time + from base_custom_data + + + + + + + + insert into base_custom_data + + custom_type, + custom_function, + custom_code, + custom_data, + custom_sort, + remark, + is_flag, + create_by, + create_time, + update_by, + update_time, + + + #{customType}, + #{customFunction}, + #{customCode}, + #{customData}, + #{customSort}, + #{remark}, + #{isFlag}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + + + + + update base_custom_data + + custom_type = #{customType}, + custom_function = #{customFunction}, + custom_code = #{customCode}, + custom_data = #{customData}, + custom_sort = #{customSort}, + remark = #{remark}, + is_flag = #{isFlag}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + + where obj_id = #{objId} + + + + delete + from base_custom_data + where obj_id = #{objId} + + + + delete from base_custom_data where obj_id in + + #{objId} + + + \ No newline at end of file diff --git a/os-mes/src/main/resources/mapper/mes/base/BaseDeviceLedgerMapper.xml b/os-mes/src/main/resources/mapper/mes/base/BaseDeviceLedgerMapper.xml index 6826e72..fd95df4 100644 --- a/os-mes/src/main/resources/mapper/mes/base/BaseDeviceLedgerMapper.xml +++ b/os-mes/src/main/resources/mapper/mes/base/BaseDeviceLedgerMapper.xml @@ -139,4 +139,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{objId} + + + \ No newline at end of file diff --git a/os-mes/src/main/resources/mapper/mes/base/BaseMaterialInfoMapper.xml b/os-mes/src/main/resources/mapper/mes/base/BaseMaterialInfoMapper.xml new file mode 100644 index 0000000..a3262e8 --- /dev/null +++ b/os-mes/src/main/resources/mapper/mes/base/BaseMaterialInfoMapper.xml @@ -0,0 +1,137 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + select obj_id, material_code, material_name, material_categories, material_subclass, material_type, material_unit, unit_price, material_specifications, factory_code, product_line_code, is_flag, create_by, create_time, update_by, update_time, increment_date, product_code, product_name from base_material_info + + + + + + + + insert into base_material_info + + material_code, + material_name, + material_categories, + material_subclass, + material_type, + material_unit, + unit_price, + material_specifications, + factory_code, + product_line_code, + is_flag, + create_by, + create_time, + update_by, + update_time, + increment_date, + product_code, + product_name, + + + #{materialCode}, + #{materialName}, + #{materialCategories}, + #{materialSubclass}, + #{materialType}, + #{materialUnit}, + #{unitPrice}, + #{materialSpecifications}, + #{factoryCode}, + #{productLineCode}, + #{isFlag}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + #{incrementDate}, + #{productCode}, + #{productName}, + + + + + update base_material_info + + material_code = #{materialCode}, + material_name = #{materialName}, + material_categories = #{materialCategories}, + material_subclass = #{materialSubclass}, + material_type = #{materialType}, + material_unit = #{materialUnit}, + unit_price = #{unitPrice}, + material_specifications = #{materialSpecifications}, + factory_code = #{factoryCode}, + product_line_code = #{productLineCode}, + is_flag = #{isFlag}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + increment_date = #{incrementDate}, + product_code = #{productCode}, + product_name = #{productName}, + + where obj_id = #{objId} + + + + delete from base_material_info where obj_id = #{objId} + + + + delete from base_material_info where obj_id in + + #{objId} + + + \ No newline at end of file