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 new file mode 100644 index 0000000..7f4eac2 --- /dev/null +++ b/os-mes/src/main/java/com/os/mes/base/controller/BaseDeviceLedgerController.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.BaseDeviceLedger; +import com.os.mes.base.service.IBaseDeviceLedgerService; +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/baseDeviceLedger") +public class BaseDeviceLedgerController extends BaseController +{ + @Autowired + private IBaseDeviceLedgerService baseDeviceLedgerService; + + /** + * 查询设备台账列表 + */ + @PreAuthorize("@ss.hasPermi('mes/base:baseDeviceLedger:list')") + @GetMapping("/list") + public TableDataInfo list(BaseDeviceLedger baseDeviceLedger) + { + startPage(); + List list = baseDeviceLedgerService.selectBaseDeviceLedgerList(baseDeviceLedger); + return getDataTable(list); + } + + /** + * 导出设备台账列表 + */ + @PreAuthorize("@ss.hasPermi('mes/base:baseDeviceLedger:export')") + @Log(title = "设备台账", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, BaseDeviceLedger baseDeviceLedger) + { + List list = baseDeviceLedgerService.selectBaseDeviceLedgerList(baseDeviceLedger); + ExcelUtil util = new ExcelUtil(BaseDeviceLedger.class); + util.exportExcel(response, list, "设备台账数据"); + } + + /** + * 获取设备台账详细信息 + */ + @PreAuthorize("@ss.hasPermi('mes/base:baseDeviceLedger:query')") + @GetMapping(value = "/{objId}") + public AjaxResult getInfo(@PathVariable("objId") Long objId) + { + return success(baseDeviceLedgerService.selectBaseDeviceLedgerByObjId(objId)); + } + + /** + * 新增设备台账 + */ + @PreAuthorize("@ss.hasPermi('mes/base:baseDeviceLedger:add')") + @Log(title = "设备台账", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody BaseDeviceLedger baseDeviceLedger) + { + baseDeviceLedger.setCreateBy(getUsername()); + return toAjax(baseDeviceLedgerService.insertBaseDeviceLedger(baseDeviceLedger)); + } + + /** + * 修改设备台账 + */ + @PreAuthorize("@ss.hasPermi('mes/base:baseDeviceLedger:edit')") + @Log(title = "设备台账", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody BaseDeviceLedger baseDeviceLedger) + { + baseDeviceLedger.setUpdateBy(getUsername()); + return toAjax(baseDeviceLedgerService.updateBaseDeviceLedger(baseDeviceLedger)); + } + + /** + * 删除设备台账 + */ + @PreAuthorize("@ss.hasPermi('mes/base:baseDeviceLedger:remove')") + @Log(title = "设备台账", businessType = BusinessType.DELETE) + @DeleteMapping("/{objIds}") + public AjaxResult remove(@PathVariable Long[] objIds) + { + return toAjax(baseDeviceLedgerService.deleteBaseDeviceLedgerByObjIds(objIds)); + } +} diff --git a/os-mes/src/main/java/com/os/mes/base/controller/BaseDeviceParamController.java b/os-mes/src/main/java/com/os/mes/base/controller/BaseDeviceParamController.java new file mode 100644 index 0000000..64b03f8 --- /dev/null +++ b/os-mes/src/main/java/com/os/mes/base/controller/BaseDeviceParamController.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.BaseDeviceParam; +import com.os.mes.base.service.IBaseDeviceParamService; +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/baseDeviceParam") +public class BaseDeviceParamController extends BaseController +{ + @Autowired + private IBaseDeviceParamService baseDeviceParamService; + + /** + * 查询设备参数列表 + */ + @PreAuthorize("@ss.hasPermi('mes/base:baseDeviceParam:list')") + @GetMapping("/list") + public TableDataInfo list(BaseDeviceParam baseDeviceParam) + { + startPage(); + List list = baseDeviceParamService.selectBaseDeviceParamList(baseDeviceParam); + return getDataTable(list); + } + + /** + * 导出设备参数列表 + */ + @PreAuthorize("@ss.hasPermi('mes/base:baseDeviceParam:export')") + @Log(title = "设备参数", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, BaseDeviceParam baseDeviceParam) + { + List list = baseDeviceParamService.selectBaseDeviceParamList(baseDeviceParam); + ExcelUtil util = new ExcelUtil(BaseDeviceParam.class); + util.exportExcel(response, list, "设备参数数据"); + } + + /** + * 获取设备参数详细信息 + */ + @PreAuthorize("@ss.hasPermi('mes/base:baseDeviceParam:query')") + @GetMapping(value = "/{objId}") + public AjaxResult getInfo(@PathVariable("objId") Long objId) + { + return success(baseDeviceParamService.selectBaseDeviceParamByObjId(objId)); + } + + /** + * 新增设备参数 + */ + @PreAuthorize("@ss.hasPermi('mes/base:baseDeviceParam:add')") + @Log(title = "设备参数", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody BaseDeviceParam baseDeviceParam) + { + baseDeviceParam.setCreateBy(getUsername()); + return toAjax(baseDeviceParamService.insertBaseDeviceParam(baseDeviceParam)); + } + + /** + * 修改设备参数 + */ + @PreAuthorize("@ss.hasPermi('mes/base:baseDeviceParam:edit')") + @Log(title = "设备参数", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody BaseDeviceParam baseDeviceParam) + { + baseDeviceParam.setUpdateBy(getUsername()); + return toAjax(baseDeviceParamService.updateBaseDeviceParam(baseDeviceParam)); + } + + /** + * 删除设备参数 + */ + @PreAuthorize("@ss.hasPermi('mes/base:baseDeviceParam:remove')") + @Log(title = "设备参数", businessType = BusinessType.DELETE) + @DeleteMapping("/{objIds}") + public AjaxResult remove(@PathVariable Long[] objIds) + { + return toAjax(baseDeviceParamService.deleteBaseDeviceParamByObjIds(objIds)); + } +} diff --git a/os-mes/src/main/java/com/os/mes/base/domain/BaseDeviceLedger.java b/os-mes/src/main/java/com/os/mes/base/domain/BaseDeviceLedger.java new file mode 100644 index 0000000..02ff51f --- /dev/null +++ b/os-mes/src/main/java/com/os/mes/base/domain/BaseDeviceLedger.java @@ -0,0 +1,254 @@ +package com.os.mes.base.domain; + +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_device_ledger + * + * @author Yinq + * @date 2024-05-10 + */ +public class BaseDeviceLedger extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键标识 */ + private Long objId; + + /** 设备编号 */ + @Excel(name = "设备编号") + private String deviceCode; + + /** 设备名称 */ + @Excel(name = "设备名称") + private String deviceName; + + /** 设备型号 */ + @Excel(name = "设备型号") + private String deviceModel; + + /** 设备类型(1生产设备 2计量设备) */ + @Excel(name = "设备类型", readConverterExp = "1=生产设备,2=计量设备") + private String deviceType; + + /** IP地址 */ + @Excel(name = "IP地址") + private String deviceAddress; + + /** 设备状态(0使用 1停用 2报废) */ + @Excel(name = "设备状态", readConverterExp = "0=使用,1=停用,2=报废") + private String deviceStatus; + + /** 使用部门 */ + @Excel(name = "使用部门") + private String usedDepartment; + + /** 成本中心 */ + @Excel(name = "成本中心") + private String costCenter; + + /** 生产厂商 */ + @Excel(name = "生产厂商") + private String manufacturer; + + /** 启用日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "启用日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date enableDate; + + /** 所属工位 */ + @Excel(name = "所属工位") + private String productLineCode; + + /** 启用标识 */ + @Excel(name = "启用标识") + private String isFlag; + + /** 工厂编号 */ + @Excel(name = "工厂编号") + private String factoryCode; + + /** 班组编号 */ + @Excel(name = "班组编号") + private String teamCode; + + /** 资产编号 */ + @Excel(name = "资产编号") + private String assetCode; + + public void setObjId(Long objId) + { + this.objId = objId; + } + + public Long getObjId() + { + return objId; + } + public void setDeviceCode(String deviceCode) + { + this.deviceCode = deviceCode; + } + + public String getDeviceCode() + { + return deviceCode; + } + public void setDeviceName(String deviceName) + { + this.deviceName = deviceName; + } + + public String getDeviceName() + { + return deviceName; + } + public void setDeviceModel(String deviceModel) + { + this.deviceModel = deviceModel; + } + + public String getDeviceModel() + { + return deviceModel; + } + public void setDeviceType(String deviceType) + { + this.deviceType = deviceType; + } + + public String getDeviceType() + { + return deviceType; + } + public void setDeviceAddress(String deviceAddress) + { + this.deviceAddress = deviceAddress; + } + + public String getDeviceAddress() + { + return deviceAddress; + } + public void setDeviceStatus(String deviceStatus) + { + this.deviceStatus = deviceStatus; + } + + public String getDeviceStatus() + { + return deviceStatus; + } + public void setUsedDepartment(String usedDepartment) + { + this.usedDepartment = usedDepartment; + } + + public String getUsedDepartment() + { + return usedDepartment; + } + public void setCostCenter(String costCenter) + { + this.costCenter = costCenter; + } + + public String getCostCenter() + { + return costCenter; + } + public void setManufacturer(String manufacturer) + { + this.manufacturer = manufacturer; + } + + public String getManufacturer() + { + return manufacturer; + } + public void setEnableDate(Date enableDate) + { + this.enableDate = enableDate; + } + + public Date getEnableDate() + { + return enableDate; + } + 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 setFactoryCode(String factoryCode) + { + this.factoryCode = factoryCode; + } + + public String getFactoryCode() + { + return factoryCode; + } + public void setTeamCode(String teamCode) + { + this.teamCode = teamCode; + } + + public String getTeamCode() + { + return teamCode; + } + public void setAssetCode(String assetCode) + { + this.assetCode = assetCode; + } + + public String getAssetCode() + { + return assetCode; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("objId", getObjId()) + .append("deviceCode", getDeviceCode()) + .append("deviceName", getDeviceName()) + .append("deviceModel", getDeviceModel()) + .append("deviceType", getDeviceType()) + .append("deviceAddress", getDeviceAddress()) + .append("deviceStatus", getDeviceStatus()) + .append("usedDepartment", getUsedDepartment()) + .append("costCenter", getCostCenter()) + .append("manufacturer", getManufacturer()) + .append("enableDate", getEnableDate()) + .append("productLineCode", getProductLineCode()) + .append("isFlag", getIsFlag()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("factoryCode", getFactoryCode()) + .append("teamCode", getTeamCode()) + .append("assetCode", getAssetCode()) + .toString(); + } +} diff --git a/os-mes/src/main/java/com/os/mes/base/domain/BaseDeviceParam.java b/os-mes/src/main/java/com/os/mes/base/domain/BaseDeviceParam.java new file mode 100644 index 0000000..9d6fb84 --- /dev/null +++ b/os-mes/src/main/java/com/os/mes/base/domain/BaseDeviceParam.java @@ -0,0 +1,188 @@ +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_device_param + * + * @author Yinq + * @date 2024-05-10 + */ +public class BaseDeviceParam extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * 主键标识 + */ + private Long objId; + + /** + * 参数编号 + */ + @Excel(name = "参数编号") + private String paramCode; + + /** + * 参数名称 + */ + @Excel(name = "参数名称") + private String paramName; + + /** + * 网络地址 + */ + @Excel(name = "网络地址") + private String paramNetwork; + + /** + * 参数地址 + */ + @Excel(name = "参数地址") + private String paramAddress; + + /** + * 参数类型(0int 1float) + */ + @Excel(name = "参数类型", readConverterExp = "0=int,1=float") + private String paramType; + + /** + * 设备编号 + */ + @Excel(name = "设备编号") + private String deviceCode; + + /** + * 设备名称 + */ + @Excel(name = "设备名称") + private String deviceName; + + /** + * 读取频率(毫秒) + */ + @Excel(name = "读取频率(毫秒)") + private Long readFrequency; + + /** + * 启用标识 + */ + @Excel(name = "启用标识") + private String isFlag; + + /** + * 工位名称 + */ + @Excel(name = "工位名称") + private String productLineName; + + public String getDeviceName() { + return deviceName; + } + + public void setDeviceName(String deviceName) { + this.deviceName = deviceName; + } + + public String getProductLineName() { + return productLineName; + } + + public void setProductLineName(String productLineName) { + this.productLineName = productLineName; + } + + public void setObjId(Long objId) { + this.objId = objId; + } + + public Long getObjId() { + return objId; + } + + public void setParamCode(String paramCode) { + this.paramCode = paramCode; + } + + public String getParamCode() { + return paramCode; + } + + public void setParamName(String paramName) { + this.paramName = paramName; + } + + public String getParamName() { + return paramName; + } + + public void setParamNetwork(String paramNetwork) { + this.paramNetwork = paramNetwork; + } + + public String getParamNetwork() { + return paramNetwork; + } + + public void setParamAddress(String paramAddress) { + this.paramAddress = paramAddress; + } + + public String getParamAddress() { + return paramAddress; + } + + public void setParamType(String paramType) { + this.paramType = paramType; + } + + public String getParamType() { + return paramType; + } + + public void setDeviceCode(String deviceCode) { + this.deviceCode = deviceCode; + } + + public String getDeviceCode() { + return deviceCode; + } + + public void setReadFrequency(Long readFrequency) { + this.readFrequency = readFrequency; + } + + public Long getReadFrequency() { + return readFrequency; + } + + 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("paramCode", getParamCode()) + .append("paramName", getParamName()) + .append("paramNetwork", getParamNetwork()) + .append("paramAddress", getParamAddress()) + .append("paramType", getParamType()) + .append("deviceCode", getDeviceCode()) + .append("readFrequency", getReadFrequency()) + .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/mapper/BaseDeviceLedgerMapper.java b/os-mes/src/main/java/com/os/mes/base/mapper/BaseDeviceLedgerMapper.java new file mode 100644 index 0000000..f2094bd --- /dev/null +++ b/os-mes/src/main/java/com/os/mes/base/mapper/BaseDeviceLedgerMapper.java @@ -0,0 +1,61 @@ +package com.os.mes.base.mapper; + +import java.util.List; +import com.os.mes.base.domain.BaseDeviceLedger; + +/** + * 设备台账Mapper接口 + * + * @author Yinq + * @date 2024-05-10 + */ +public interface BaseDeviceLedgerMapper +{ + /** + * 查询设备台账 + * + * @param objId 设备台账主键 + * @return 设备台账 + */ + public BaseDeviceLedger selectBaseDeviceLedgerByObjId(Long objId); + + /** + * 查询设备台账列表 + * + * @param baseDeviceLedger 设备台账 + * @return 设备台账集合 + */ + public List selectBaseDeviceLedgerList(BaseDeviceLedger baseDeviceLedger); + + /** + * 新增设备台账 + * + * @param baseDeviceLedger 设备台账 + * @return 结果 + */ + public int insertBaseDeviceLedger(BaseDeviceLedger baseDeviceLedger); + + /** + * 修改设备台账 + * + * @param baseDeviceLedger 设备台账 + * @return 结果 + */ + public int updateBaseDeviceLedger(BaseDeviceLedger baseDeviceLedger); + + /** + * 删除设备台账 + * + * @param objId 设备台账主键 + * @return 结果 + */ + public int deleteBaseDeviceLedgerByObjId(Long objId); + + /** + * 批量删除设备台账 + * + * @param objIds 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteBaseDeviceLedgerByObjIds(Long[] objIds); +} diff --git a/os-mes/src/main/java/com/os/mes/base/mapper/BaseDeviceParamMapper.java b/os-mes/src/main/java/com/os/mes/base/mapper/BaseDeviceParamMapper.java new file mode 100644 index 0000000..b293bb5 --- /dev/null +++ b/os-mes/src/main/java/com/os/mes/base/mapper/BaseDeviceParamMapper.java @@ -0,0 +1,61 @@ +package com.os.mes.base.mapper; + +import java.util.List; + +import com.os.mes.base.domain.BaseDeviceParam; + +/** + * 设备参数Mapper接口 + * + * @author Yinq + * @date 2024-05-10 + */ +public interface BaseDeviceParamMapper { + /** + * 查询设备参数 + * + * @param objId 设备参数主键 + * @return 设备参数 + */ + public BaseDeviceParam selectBaseDeviceParamByObjId(Long objId); + + /** + * 查询设备参数列表 + * + * @param baseDeviceParam 设备参数 + * @return 设备参数集合 + */ + public List selectBaseDeviceParamList(BaseDeviceParam baseDeviceParam); + + /** + * 新增设备参数 + * + * @param baseDeviceParam 设备参数 + * @return 结果 + */ + public int insertBaseDeviceParam(BaseDeviceParam baseDeviceParam); + + /** + * 修改设备参数 + * + * @param baseDeviceParam 设备参数 + * @return 结果 + */ + public int updateBaseDeviceParam(BaseDeviceParam baseDeviceParam); + + /** + * 删除设备参数 + * + * @param objId 设备参数主键 + * @return 结果 + */ + public int deleteBaseDeviceParamByObjId(Long objId); + + /** + * 批量删除设备参数 + * + * @param objIds 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteBaseDeviceParamByObjIds(Long[] objIds); +} 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 new file mode 100644 index 0000000..c73d196 --- /dev/null +++ b/os-mes/src/main/java/com/os/mes/base/service/IBaseDeviceLedgerService.java @@ -0,0 +1,61 @@ +package com.os.mes.base.service; + +import java.util.List; +import com.os.mes.base.domain.BaseDeviceLedger; + +/** + * 设备台账Service接口 + * + * @author Yinq + * @date 2024-05-10 + */ +public interface IBaseDeviceLedgerService +{ + /** + * 查询设备台账 + * + * @param objId 设备台账主键 + * @return 设备台账 + */ + public BaseDeviceLedger selectBaseDeviceLedgerByObjId(Long objId); + + /** + * 查询设备台账列表 + * + * @param baseDeviceLedger 设备台账 + * @return 设备台账集合 + */ + public List selectBaseDeviceLedgerList(BaseDeviceLedger baseDeviceLedger); + + /** + * 新增设备台账 + * + * @param baseDeviceLedger 设备台账 + * @return 结果 + */ + public int insertBaseDeviceLedger(BaseDeviceLedger baseDeviceLedger); + + /** + * 修改设备台账 + * + * @param baseDeviceLedger 设备台账 + * @return 结果 + */ + public int updateBaseDeviceLedger(BaseDeviceLedger baseDeviceLedger); + + /** + * 批量删除设备台账 + * + * @param objIds 需要删除的设备台账主键集合 + * @return 结果 + */ + public int deleteBaseDeviceLedgerByObjIds(Long[] objIds); + + /** + * 删除设备台账信息 + * + * @param objId 设备台账主键 + * @return 结果 + */ + public int deleteBaseDeviceLedgerByObjId(Long objId); +} diff --git a/os-mes/src/main/java/com/os/mes/base/service/IBaseDeviceParamService.java b/os-mes/src/main/java/com/os/mes/base/service/IBaseDeviceParamService.java new file mode 100644 index 0000000..43ee11c --- /dev/null +++ b/os-mes/src/main/java/com/os/mes/base/service/IBaseDeviceParamService.java @@ -0,0 +1,61 @@ +package com.os.mes.base.service; + +import java.util.List; +import com.os.mes.base.domain.BaseDeviceParam; + +/** + * 设备参数Service接口 + * + * @author Yinq + * @date 2024-05-10 + */ +public interface IBaseDeviceParamService +{ + /** + * 查询设备参数 + * + * @param objId 设备参数主键 + * @return 设备参数 + */ + public BaseDeviceParam selectBaseDeviceParamByObjId(Long objId); + + /** + * 查询设备参数列表 + * + * @param baseDeviceParam 设备参数 + * @return 设备参数集合 + */ + public List selectBaseDeviceParamList(BaseDeviceParam baseDeviceParam); + + /** + * 新增设备参数 + * + * @param baseDeviceParam 设备参数 + * @return 结果 + */ + public int insertBaseDeviceParam(BaseDeviceParam baseDeviceParam); + + /** + * 修改设备参数 + * + * @param baseDeviceParam 设备参数 + * @return 结果 + */ + public int updateBaseDeviceParam(BaseDeviceParam baseDeviceParam); + + /** + * 批量删除设备参数 + * + * @param objIds 需要删除的设备参数主键集合 + * @return 结果 + */ + public int deleteBaseDeviceParamByObjIds(Long[] objIds); + + /** + * 删除设备参数信息 + * + * @param objId 设备参数主键 + * @return 结果 + */ + public int deleteBaseDeviceParamByObjId(Long 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 new file mode 100644 index 0000000..576e407 --- /dev/null +++ b/os-mes/src/main/java/com/os/mes/base/service/impl/BaseDeviceLedgerServiceImpl.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.BaseDeviceLedgerMapper; +import com.os.mes.base.domain.BaseDeviceLedger; +import com.os.mes.base.service.IBaseDeviceLedgerService; + +/** + * 设备台账Service业务层处理 + * + * @author Yinq + * @date 2024-05-10 + */ +@Service +public class BaseDeviceLedgerServiceImpl implements IBaseDeviceLedgerService +{ + @Autowired + private BaseDeviceLedgerMapper baseDeviceLedgerMapper; + + /** + * 查询设备台账 + * + * @param objId 设备台账主键 + * @return 设备台账 + */ + @Override + public BaseDeviceLedger selectBaseDeviceLedgerByObjId(Long objId) + { + return baseDeviceLedgerMapper.selectBaseDeviceLedgerByObjId(objId); + } + + /** + * 查询设备台账列表 + * + * @param baseDeviceLedger 设备台账 + * @return 设备台账 + */ + @Override + public List selectBaseDeviceLedgerList(BaseDeviceLedger baseDeviceLedger) + { + return baseDeviceLedgerMapper.selectBaseDeviceLedgerList(baseDeviceLedger); + } + + /** + * 新增设备台账 + * + * @param baseDeviceLedger 设备台账 + * @return 结果 + */ + @Override + public int insertBaseDeviceLedger(BaseDeviceLedger baseDeviceLedger) + { + baseDeviceLedger.setCreateTime(DateUtils.getNowDate()); + return baseDeviceLedgerMapper.insertBaseDeviceLedger(baseDeviceLedger); + } + + /** + * 修改设备台账 + * + * @param baseDeviceLedger 设备台账 + * @return 结果 + */ + @Override + public int updateBaseDeviceLedger(BaseDeviceLedger baseDeviceLedger) + { + baseDeviceLedger.setUpdateTime(DateUtils.getNowDate()); + return baseDeviceLedgerMapper.updateBaseDeviceLedger(baseDeviceLedger); + } + + /** + * 批量删除设备台账 + * + * @param objIds 需要删除的设备台账主键 + * @return 结果 + */ + @Override + public int deleteBaseDeviceLedgerByObjIds(Long[] objIds) + { + return baseDeviceLedgerMapper.deleteBaseDeviceLedgerByObjIds(objIds); + } + + /** + * 删除设备台账信息 + * + * @param objId 设备台账主键 + * @return 结果 + */ + @Override + public int deleteBaseDeviceLedgerByObjId(Long objId) + { + return baseDeviceLedgerMapper.deleteBaseDeviceLedgerByObjId(objId); + } +} diff --git a/os-mes/src/main/java/com/os/mes/base/service/impl/BaseDeviceParamServiceImpl.java b/os-mes/src/main/java/com/os/mes/base/service/impl/BaseDeviceParamServiceImpl.java new file mode 100644 index 0000000..710dd03 --- /dev/null +++ b/os-mes/src/main/java/com/os/mes/base/service/impl/BaseDeviceParamServiceImpl.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.BaseDeviceParamMapper; +import com.os.mes.base.domain.BaseDeviceParam; +import com.os.mes.base.service.IBaseDeviceParamService; + +/** + * 设备参数Service业务层处理 + * + * @author Yinq + * @date 2024-05-10 + */ +@Service +public class BaseDeviceParamServiceImpl implements IBaseDeviceParamService +{ + @Autowired + private BaseDeviceParamMapper baseDeviceParamMapper; + + /** + * 查询设备参数 + * + * @param objId 设备参数主键 + * @return 设备参数 + */ + @Override + public BaseDeviceParam selectBaseDeviceParamByObjId(Long objId) + { + return baseDeviceParamMapper.selectBaseDeviceParamByObjId(objId); + } + + /** + * 查询设备参数列表 + * + * @param baseDeviceParam 设备参数 + * @return 设备参数 + */ + @Override + public List selectBaseDeviceParamList(BaseDeviceParam baseDeviceParam) + { + return baseDeviceParamMapper.selectBaseDeviceParamList(baseDeviceParam); + } + + /** + * 新增设备参数 + * + * @param baseDeviceParam 设备参数 + * @return 结果 + */ + @Override + public int insertBaseDeviceParam(BaseDeviceParam baseDeviceParam) + { + baseDeviceParam.setCreateTime(DateUtils.getNowDate()); + return baseDeviceParamMapper.insertBaseDeviceParam(baseDeviceParam); + } + + /** + * 修改设备参数 + * + * @param baseDeviceParam 设备参数 + * @return 结果 + */ + @Override + public int updateBaseDeviceParam(BaseDeviceParam baseDeviceParam) + { + baseDeviceParam.setUpdateTime(DateUtils.getNowDate()); + return baseDeviceParamMapper.updateBaseDeviceParam(baseDeviceParam); + } + + /** + * 批量删除设备参数 + * + * @param objIds 需要删除的设备参数主键 + * @return 结果 + */ + @Override + public int deleteBaseDeviceParamByObjIds(Long[] objIds) + { + return baseDeviceParamMapper.deleteBaseDeviceParamByObjIds(objIds); + } + + /** + * 删除设备参数信息 + * + * @param objId 设备参数主键 + * @return 结果 + */ + @Override + public int deleteBaseDeviceParamByObjId(Long objId) + { + return baseDeviceParamMapper.deleteBaseDeviceParamByObjId(objId); + } +} diff --git a/os-mes/src/main/resources/mapper/mes/base/BaseDeviceLedgerMapper.xml b/os-mes/src/main/resources/mapper/mes/base/BaseDeviceLedgerMapper.xml new file mode 100644 index 0000000..6826e72 --- /dev/null +++ b/os-mes/src/main/resources/mapper/mes/base/BaseDeviceLedgerMapper.xml @@ -0,0 +1,142 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select obj_id, device_code, device_name, device_model, device_type, device_address, device_status, used_department, cost_center, manufacturer, enable_date, product_line_code, is_flag, create_by, create_time, update_by, update_time, factory_code, team_code, asset_code from base_device_ledger + + + + + + + + insert into base_device_ledger + + device_code, + device_name, + device_model, + device_type, + device_address, + device_status, + used_department, + cost_center, + manufacturer, + enable_date, + product_line_code, + is_flag, + create_by, + create_time, + update_by, + update_time, + factory_code, + team_code, + asset_code, + + + #{deviceCode}, + #{deviceName}, + #{deviceModel}, + #{deviceType}, + #{deviceAddress}, + #{deviceStatus}, + #{usedDepartment}, + #{costCenter}, + #{manufacturer}, + #{enableDate}, + #{productLineCode}, + #{isFlag}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + #{factoryCode}, + #{teamCode}, + #{assetCode}, + + + + + update base_device_ledger + + device_code = #{deviceCode}, + device_name = #{deviceName}, + device_model = #{deviceModel}, + device_type = #{deviceType}, + device_address = #{deviceAddress}, + device_status = #{deviceStatus}, + used_department = #{usedDepartment}, + cost_center = #{costCenter}, + manufacturer = #{manufacturer}, + enable_date = #{enableDate}, + product_line_code = #{productLineCode}, + is_flag = #{isFlag}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + factory_code = #{factoryCode}, + team_code = #{teamCode}, + asset_code = #{assetCode}, + + where obj_id = #{objId} + + + + delete from base_device_ledger where obj_id = #{objId} + + + + delete from base_device_ledger where obj_id in + + #{objId} + + + \ No newline at end of file diff --git a/os-mes/src/main/resources/mapper/mes/base/BaseDeviceParamMapper.xml b/os-mes/src/main/resources/mapper/mes/base/BaseDeviceParamMapper.xml new file mode 100644 index 0000000..dade478 --- /dev/null +++ b/os-mes/src/main/resources/mapper/mes/base/BaseDeviceParamMapper.xml @@ -0,0 +1,132 @@ + + + + + + + + + + + + + + + + + + + + + + + + select dp.obj_id, + dp.param_code, + dp.param_name, + dp.param_network, + dp.param_address, + dp.param_type, + dp.device_code, + dp.read_frequency, + dp.is_flag, + dp.create_by, + dp.create_time, + dp.update_by, + dp.update_time, + dl.device_name, + pl.product_line_name + from base_device_param dp + left join base_device_ledger dl on dl.device_code = dp.device_code + left join base_product_line pl on pl.product_line_code = dl.product_line_code + + + + + + + + insert into base_device_param + + param_code, + param_name, + param_network, + param_address, + param_type, + device_code, + read_frequency, + is_flag, + create_by, + create_time, + update_by, + update_time, + + + #{paramCode}, + #{paramName}, + #{paramNetwork}, + #{paramAddress}, + #{paramType}, + #{deviceCode}, + #{readFrequency}, + #{isFlag}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + + + + + update base_device_param + + param_code = #{paramCode}, + param_name = #{paramName}, + param_network = #{paramNetwork}, + param_address = #{paramAddress}, + param_type = #{paramType}, + device_code = #{deviceCode}, + read_frequency = #{readFrequency}, + is_flag = #{isFlag}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + + where obj_id = #{objId} + + + + delete + from base_device_param + where obj_id = #{objId} + + + + delete from base_device_param where obj_id in + + #{objId} + + + \ No newline at end of file