From 3c84d4d15abd7b0f38ff533fa6e6d8d1ea5b1394 Mon Sep 17 00:00:00 2001 From: yinq Date: Mon, 2 Sep 2024 17:28:09 +0800 Subject: [PATCH] =?UTF-8?q?change=20-=20add=E8=AE=BE=E5=A4=87=E5=AE=9E?= =?UTF-8?q?=E6=97=B6=E7=8A=B6=E6=80=81=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DmsRealtimeStatusController.java | 99 ++++++++++++++ .../com/hw/dms/domain/DmsRealtimeStatus.java | 128 ++++++++++++++++++ .../dms/mapper/DmsRealtimeStatusMapper.java | 61 +++++++++ .../service/IDmsRealtimeStatusService.java | 61 +++++++++ .../impl/DmsRealtimeStatusServiceImpl.java | 89 ++++++++++++ .../impl/ModelInterfacesServiceImpl.java | 8 ++ .../mapper/dms/DmsRealtimeStatusMapper.xml | 94 +++++++++++++ 7 files changed, 540 insertions(+) create mode 100644 hw-modules/hw-dms/src/main/java/com/hw/dms/controller/DmsRealtimeStatusController.java create mode 100644 hw-modules/hw-dms/src/main/java/com/hw/dms/domain/DmsRealtimeStatus.java create mode 100644 hw-modules/hw-dms/src/main/java/com/hw/dms/mapper/DmsRealtimeStatusMapper.java create mode 100644 hw-modules/hw-dms/src/main/java/com/hw/dms/service/IDmsRealtimeStatusService.java create mode 100644 hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsRealtimeStatusServiceImpl.java create mode 100644 hw-modules/hw-dms/src/main/resources/mapper/dms/DmsRealtimeStatusMapper.xml diff --git a/hw-modules/hw-dms/src/main/java/com/hw/dms/controller/DmsRealtimeStatusController.java b/hw-modules/hw-dms/src/main/java/com/hw/dms/controller/DmsRealtimeStatusController.java new file mode 100644 index 0000000..485b94a --- /dev/null +++ b/hw-modules/hw-dms/src/main/java/com/hw/dms/controller/DmsRealtimeStatusController.java @@ -0,0 +1,99 @@ +package com.hw.dms.controller; + +import java.util.List; +import java.io.IOException; +import javax.servlet.http.HttpServletResponse; + +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.hw.common.log.annotation.Log; +import com.hw.common.log.enums.BusinessType; +import com.hw.common.security.annotation.RequiresPermissions; +import com.hw.dms.domain.DmsRealtimeStatus; +import com.hw.dms.service.IDmsRealtimeStatusService; +import com.hw.common.core.web.controller.BaseController; +import com.hw.common.core.web.domain.AjaxResult; +import com.hw.common.core.utils.poi.ExcelUtil; +import com.hw.common.core.web.page.TableDataInfo; + +/** + * 设备实时状态Controller + * + * @author Yinq + * @date 2024-09-02 + */ +@RestController +@RequestMapping("/dmsRealtimeStatus") +public class DmsRealtimeStatusController extends BaseController { + @Autowired + private IDmsRealtimeStatusService dmsRealtimeStatusService; + + /** + * 查询设备实时状态列表 + */ + @RequiresPermissions("dms:dmsRealtimeStatus:list") + @GetMapping("/list") + public TableDataInfo list(DmsRealtimeStatus dmsRealtimeStatus) { + startPage(); + List list = dmsRealtimeStatusService.selectDmsRealtimeStatusList(dmsRealtimeStatus); + return getDataTable(list); + } + + /** + * 导出设备实时状态列表 + */ + @RequiresPermissions("dms:dmsRealtimeStatus:export") + @Log(title = "设备实时状态", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, DmsRealtimeStatus dmsRealtimeStatus) { + List list = dmsRealtimeStatusService.selectDmsRealtimeStatusList(dmsRealtimeStatus); + ExcelUtil util = new ExcelUtil(DmsRealtimeStatus.class); + util.exportExcel(response, list, "设备实时状态数据"); + } + + /** + * 获取设备实时状态详细信息 + */ + @RequiresPermissions("dms:dmsRealtimeStatus:query") + @GetMapping(value = "/{statusId}") + public AjaxResult getInfo(@PathVariable("statusId") Long statusId) { + return success(dmsRealtimeStatusService.selectDmsRealtimeStatusByStatusId(statusId)); + } + + /** + * 新增设备实时状态 + */ + @RequiresPermissions("dms:dmsRealtimeStatus:add") + @Log(title = "设备实时状态", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody DmsRealtimeStatus dmsRealtimeStatus) { + return toAjax(dmsRealtimeStatusService.insertDmsRealtimeStatus(dmsRealtimeStatus)); + } + + /** + * 修改设备实时状态 + */ + @RequiresPermissions("dms:dmsRealtimeStatus:edit") + @Log(title = "设备实时状态", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody DmsRealtimeStatus dmsRealtimeStatus) { + return toAjax(dmsRealtimeStatusService.updateDmsRealtimeStatus(dmsRealtimeStatus)); + } + + /** + * 删除设备实时状态 + */ + @RequiresPermissions("dms:dmsRealtimeStatus:remove") + @Log(title = "设备实时状态", businessType = BusinessType.DELETE) + @DeleteMapping("/{statusIds}") + public AjaxResult remove(@PathVariable Long[] statusIds) { + return toAjax(dmsRealtimeStatusService.deleteDmsRealtimeStatusByStatusIds(statusIds)); + } +} diff --git a/hw-modules/hw-dms/src/main/java/com/hw/dms/domain/DmsRealtimeStatus.java b/hw-modules/hw-dms/src/main/java/com/hw/dms/domain/DmsRealtimeStatus.java new file mode 100644 index 0000000..6552b18 --- /dev/null +++ b/hw-modules/hw-dms/src/main/java/com/hw/dms/domain/DmsRealtimeStatus.java @@ -0,0 +1,128 @@ +package com.hw.dms.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.hw.common.core.annotation.Excel; +import com.hw.common.core.web.domain.BaseEntity; + +/** + * 设备实时状态对象 dms_realtime_status + * + * @author Yinq + * @date 2024-09-02 + */ +public class DmsRealtimeStatus extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * 主键标识 + */ + private Long statusId; + + /** + * 设备状态编号 + */ + @Excel(name = "设备状态编号") + private String statusCode; + + /** + * 设备状态名称 + */ + @Excel(name = "设备状态名称") + private String statusName; + + /** + * 设备状态值 + */ + @Excel(name = "设备状态值") + private String statusValue; + + /** + * 所属设备id + */ + @Excel(name = "所属设备id") + private Long deviceId; + + /** 设备名称 */ + @Excel(name = "设备名称") + private String deviceName; + + /** + * 创建时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date creatTime; + + public String getDeviceName() { + return deviceName; + } + + public void setDeviceName(String deviceName) { + this.deviceName = deviceName; + } + + public void setStatusId(Long statusId) { + this.statusId = statusId; + } + + public Long getStatusId() { + return statusId; + } + + public void setStatusCode(String statusCode) { + this.statusCode = statusCode; + } + + public String getStatusCode() { + return statusCode; + } + + public void setStatusName(String statusName) { + this.statusName = statusName; + } + + public String getStatusName() { + return statusName; + } + + public void setStatusValue(String statusValue) { + this.statusValue = statusValue; + } + + public String getStatusValue() { + return statusValue; + } + + public void setDeviceId(Long deviceId) { + this.deviceId = deviceId; + } + + public Long getDeviceId() { + return deviceId; + } + + public void setCreatTime(Date creatTime) { + this.creatTime = creatTime; + } + + public Date getCreatTime() { + return creatTime; + } + + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) + .append("statusId", getStatusId()) + .append("statusCode", getStatusCode()) + .append("statusName", getStatusName()) + .append("statusValue", getStatusValue()) + .append("deviceId", getDeviceId()) + .append("creatTime", getCreatTime()) + .append("updateTime", getUpdateTime()) + .toString(); + } +} diff --git a/hw-modules/hw-dms/src/main/java/com/hw/dms/mapper/DmsRealtimeStatusMapper.java b/hw-modules/hw-dms/src/main/java/com/hw/dms/mapper/DmsRealtimeStatusMapper.java new file mode 100644 index 0000000..fb5cff8 --- /dev/null +++ b/hw-modules/hw-dms/src/main/java/com/hw/dms/mapper/DmsRealtimeStatusMapper.java @@ -0,0 +1,61 @@ +package com.hw.dms.mapper; + +import java.util.List; + +import com.hw.dms.domain.DmsRealtimeStatus; + +/** + * 设备实时状态Mapper接口 + * + * @author Yinq + * @date 2024-09-02 + */ +public interface DmsRealtimeStatusMapper { + /** + * 查询设备实时状态 + * + * @param statusId 设备实时状态主键 + * @return 设备实时状态 + */ + public DmsRealtimeStatus selectDmsRealtimeStatusByStatusId(Long statusId); + + /** + * 查询设备实时状态列表 + * + * @param dmsRealtimeStatus 设备实时状态 + * @return 设备实时状态集合 + */ + public List selectDmsRealtimeStatusList(DmsRealtimeStatus dmsRealtimeStatus); + + /** + * 新增设备实时状态 + * + * @param dmsRealtimeStatus 设备实时状态 + * @return 结果 + */ + public int insertDmsRealtimeStatus(DmsRealtimeStatus dmsRealtimeStatus); + + /** + * 修改设备实时状态 + * + * @param dmsRealtimeStatus 设备实时状态 + * @return 结果 + */ + public int updateDmsRealtimeStatus(DmsRealtimeStatus dmsRealtimeStatus); + + /** + * 删除设备实时状态 + * + * @param statusId 设备实时状态主键 + * @return 结果 + */ + public int deleteDmsRealtimeStatusByStatusId(Long statusId); + + /** + * 批量删除设备实时状态 + * + * @param statusIds 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteDmsRealtimeStatusByStatusIds(Long[] statusIds); +} diff --git a/hw-modules/hw-dms/src/main/java/com/hw/dms/service/IDmsRealtimeStatusService.java b/hw-modules/hw-dms/src/main/java/com/hw/dms/service/IDmsRealtimeStatusService.java new file mode 100644 index 0000000..e078c8b --- /dev/null +++ b/hw-modules/hw-dms/src/main/java/com/hw/dms/service/IDmsRealtimeStatusService.java @@ -0,0 +1,61 @@ +package com.hw.dms.service; + +import java.util.List; + +import com.hw.dms.domain.DmsRealtimeStatus; + +/** + * 设备实时状态Service接口 + * + * @author Yinq + * @date 2024-09-02 + */ +public interface IDmsRealtimeStatusService { + /** + * 查询设备实时状态 + * + * @param statusId 设备实时状态主键 + * @return 设备实时状态 + */ + public DmsRealtimeStatus selectDmsRealtimeStatusByStatusId(Long statusId); + + /** + * 查询设备实时状态列表 + * + * @param dmsRealtimeStatus 设备实时状态 + * @return 设备实时状态集合 + */ + public List selectDmsRealtimeStatusList(DmsRealtimeStatus dmsRealtimeStatus); + + /** + * 新增设备实时状态 + * + * @param dmsRealtimeStatus 设备实时状态 + * @return 结果 + */ + public int insertDmsRealtimeStatus(DmsRealtimeStatus dmsRealtimeStatus); + + /** + * 修改设备实时状态 + * + * @param dmsRealtimeStatus 设备实时状态 + * @return 结果 + */ + public int updateDmsRealtimeStatus(DmsRealtimeStatus dmsRealtimeStatus); + + /** + * 批量删除设备实时状态 + * + * @param statusIds 需要删除的设备实时状态主键集合 + * @return 结果 + */ + public int deleteDmsRealtimeStatusByStatusIds(Long[] statusIds); + + /** + * 删除设备实时状态信息 + * + * @param statusId 设备实时状态主键 + * @return 结果 + */ + public int deleteDmsRealtimeStatusByStatusId(Long statusId); +} diff --git a/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsRealtimeStatusServiceImpl.java b/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsRealtimeStatusServiceImpl.java new file mode 100644 index 0000000..cf3721e --- /dev/null +++ b/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsRealtimeStatusServiceImpl.java @@ -0,0 +1,89 @@ +package com.hw.dms.service.impl; + +import java.util.List; + +import com.hw.common.core.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.hw.dms.mapper.DmsRealtimeStatusMapper; +import com.hw.dms.domain.DmsRealtimeStatus; +import com.hw.dms.service.IDmsRealtimeStatusService; + +/** + * 设备实时状态Service业务层处理 + * + * @author Yinq + * @date 2024-09-02 + */ +@Service +public class DmsRealtimeStatusServiceImpl implements IDmsRealtimeStatusService { + @Autowired + private DmsRealtimeStatusMapper dmsRealtimeStatusMapper; + + /** + * 查询设备实时状态 + * + * @param statusId 设备实时状态主键 + * @return 设备实时状态 + */ + @Override + public DmsRealtimeStatus selectDmsRealtimeStatusByStatusId(Long statusId) { + return dmsRealtimeStatusMapper.selectDmsRealtimeStatusByStatusId(statusId); + } + + /** + * 查询设备实时状态列表 + * + * @param dmsRealtimeStatus 设备实时状态 + * @return 设备实时状态 + */ + @Override + public List selectDmsRealtimeStatusList(DmsRealtimeStatus dmsRealtimeStatus) { + return dmsRealtimeStatusMapper.selectDmsRealtimeStatusList(dmsRealtimeStatus); + } + + /** + * 新增设备实时状态 + * + * @param dmsRealtimeStatus 设备实时状态 + * @return 结果 + */ + @Override + public int insertDmsRealtimeStatus(DmsRealtimeStatus dmsRealtimeStatus) { + return dmsRealtimeStatusMapper.insertDmsRealtimeStatus(dmsRealtimeStatus); + } + + /** + * 修改设备实时状态 + * + * @param dmsRealtimeStatus 设备实时状态 + * @return 结果 + */ + @Override + public int updateDmsRealtimeStatus(DmsRealtimeStatus dmsRealtimeStatus) { + dmsRealtimeStatus.setUpdateTime(DateUtils.getNowDate()); + return dmsRealtimeStatusMapper.updateDmsRealtimeStatus(dmsRealtimeStatus); + } + + /** + * 批量删除设备实时状态 + * + * @param statusIds 需要删除的设备实时状态主键 + * @return 结果 + */ + @Override + public int deleteDmsRealtimeStatusByStatusIds(Long[] statusIds) { + return dmsRealtimeStatusMapper.deleteDmsRealtimeStatusByStatusIds(statusIds); + } + + /** + * 删除设备实时状态信息 + * + * @param statusId 设备实时状态主键 + * @return 结果 + */ + @Override + public int deleteDmsRealtimeStatusByStatusId(Long statusId) { + return dmsRealtimeStatusMapper.deleteDmsRealtimeStatusByStatusId(statusId); + } +} diff --git a/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/ModelInterfacesServiceImpl.java b/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/ModelInterfacesServiceImpl.java index e2850b4..c24355d 100644 --- a/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/ModelInterfacesServiceImpl.java +++ b/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/ModelInterfacesServiceImpl.java @@ -3,7 +3,9 @@ package com.hw.dms.service.impl; import java.util.HashMap; import java.util.List; +import com.hw.dms.domain.DmsRealtimeStatus; import com.hw.dms.domain.vo.ModelBoardVo; +import com.hw.dms.mapper.DmsRealtimeStatusMapper; import com.hw.dms.service.IModelInterfacesService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -22,6 +24,9 @@ public class ModelInterfacesServiceImpl implements IModelInterfacesService @Autowired private WcsAgvStatusMapper wcsAgvStatusMapper; + @Autowired + private DmsRealtimeStatusMapper dmsRealtimeStatusMapper; + /** * 查询AGV设备状态列表 * @param modelBoardVo @@ -33,6 +38,9 @@ public class ModelInterfacesServiceImpl implements IModelInterfacesService WcsAgvStatus wcsAgvStatus = new WcsAgvStatus(); List agvStatusList = wcsAgvStatusMapper.selectWcsAgvStatusList(wcsAgvStatus); result.put("agvStatusList", agvStatusList); + DmsRealtimeStatus realtimeStatus = new DmsRealtimeStatus(); + List realtimeStatusList = dmsRealtimeStatusMapper.selectDmsRealtimeStatusList(realtimeStatus); + result.put("realtimeStatusList", realtimeStatusList); return result; } diff --git a/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsRealtimeStatusMapper.xml b/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsRealtimeStatusMapper.xml new file mode 100644 index 0000000..f9a3d3e --- /dev/null +++ b/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsRealtimeStatusMapper.xml @@ -0,0 +1,94 @@ + + + + + + + + + + + + + + + + + select drs.status_id, + drs.status_code, + drs.status_name, + drs.status_value, + drs.device_id, + drs.creat_time, + drs.update_time, + dbdl.device_name + from dms_realtime_status drs + left join dms_base_device_ledger dbdl on drs.device_id = dbdl.device_id + + + + + + + + insert into dms_realtime_status + + status_code, + status_name, + status_value, + device_id, + creat_time, + update_time, + + + #{statusCode}, + #{statusName}, + #{statusValue}, + #{deviceId}, + #{creatTime}, + #{updateTime}, + + + + + update dms_realtime_status + + status_code = #{statusCode}, + status_name = #{statusName}, + status_value = #{statusValue}, + device_id = #{deviceId}, + creat_time = #{creatTime}, + update_time = #{updateTime}, + + where status_id = #{statusId} + + + + delete + from dms_realtime_status + where status_id = #{statusId} + + + + delete from dms_realtime_status where status_id in + + #{statusId} + + + \ No newline at end of file