diff --git a/hw-modules/hw-system/src/main/java/com/hw/system/common/controller/HwPrinterInfoController.java b/hw-modules/hw-system/src/main/java/com/hw/system/common/controller/HwPrinterInfoController.java new file mode 100644 index 0000000..84b76e7 --- /dev/null +++ b/hw-modules/hw-system/src/main/java/com/hw/system/common/controller/HwPrinterInfoController.java @@ -0,0 +1,99 @@ +package com.hw.system.common.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.system.common.domain.HwPrinterInfo; +import com.hw.system.common.service.IHwPrinterInfoService; +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-03-25 + */ +@RestController +@RequestMapping("/hwPrinterInfo") +public class HwPrinterInfoController extends BaseController { + @Autowired + private IHwPrinterInfoService hwPrinterInfoService; + + /** + * 查询打印机信息列表 + */ + @RequiresPermissions("system:hwPrinterInfo:list") + @GetMapping("/list") + public TableDataInfo list(HwPrinterInfo hwPrinterInfo) { + startPage(); + List list = hwPrinterInfoService.selectHwPrinterInfoList(hwPrinterInfo); + return getDataTable(list); + } + + /** + * 导出打印机信息列表 + */ + @RequiresPermissions("system:hwPrinterInfo:export") + @Log(title = "打印机信息", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, HwPrinterInfo hwPrinterInfo) { + List list = hwPrinterInfoService.selectHwPrinterInfoList(hwPrinterInfo); + ExcelUtil util = new ExcelUtil(HwPrinterInfo.class); + util.exportExcel(response, list, "打印机信息数据"); + } + + /** + * 获取打印机信息详细信息 + */ + @RequiresPermissions("system:hwPrinterInfo:query") + @GetMapping(value = "/{printerInfoId}") + public AjaxResult getInfo(@PathVariable("printerInfoId") Long printerInfoId) { + return success(hwPrinterInfoService.selectHwPrinterInfoByPrinterInfoId(printerInfoId)); + } + + /** + * 新增打印机信息 + */ + @RequiresPermissions("system:hwPrinterInfo:add") + @Log(title = "打印机信息", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody HwPrinterInfo hwPrinterInfo) { + return toAjax(hwPrinterInfoService.insertHwPrinterInfo(hwPrinterInfo)); + } + + /** + * 修改打印机信息 + */ + @RequiresPermissions("system:hwPrinterInfo:edit") + @Log(title = "打印机信息", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody HwPrinterInfo hwPrinterInfo) { + return toAjax(hwPrinterInfoService.updateHwPrinterInfo(hwPrinterInfo)); + } + + /** + * 删除打印机信息 + */ + @RequiresPermissions("system:hwPrinterInfo:remove") + @Log(title = "打印机信息", businessType = BusinessType.DELETE) + @DeleteMapping("/{printerInfoIds}") + public AjaxResult remove(@PathVariable Long[] printerInfoIds) { + return toAjax(hwPrinterInfoService.deleteHwPrinterInfoByPrinterInfoIds(printerInfoIds)); + } +} diff --git a/hw-modules/hw-system/src/main/java/com/hw/system/common/domain/HwPrinterInfo.java b/hw-modules/hw-system/src/main/java/com/hw/system/common/domain/HwPrinterInfo.java new file mode 100644 index 0000000..0afb9ac --- /dev/null +++ b/hw-modules/hw-system/src/main/java/com/hw/system/common/domain/HwPrinterInfo.java @@ -0,0 +1,101 @@ +package com.hw.system.common.domain; + +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; + +/** + * 打印机信息对象 hw_printer_info + * + * @author Yinq + * @date 2024-03-25 + */ +public class HwPrinterInfo extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * 打印机ID + */ + private Long printerInfoId; + + /** + * 打印机编号 + */ + @Excel(name = "打印机编号") + private String printerInfoCode; + + /** + * 打印机名称 + */ + @Excel(name = "打印机名称") + private String printerInfoName; + + /** + * 打印机位置 + */ + @Excel(name = "打印机位置") + private String printerInfoAddress; + + /** + * IP地址 + */ + @Excel(name = "IP地址") + private String printerInfoIp; + + public void setPrinterInfoId(Long printerInfoId) { + this.printerInfoId = printerInfoId; + } + + public Long getPrinterInfoId() { + return printerInfoId; + } + + public void setPrinterInfoCode(String printerInfoCode) { + this.printerInfoCode = printerInfoCode; + } + + public String getPrinterInfoCode() { + return printerInfoCode; + } + + public void setPrinterInfoName(String printerInfoName) { + this.printerInfoName = printerInfoName; + } + + public String getPrinterInfoName() { + return printerInfoName; + } + + public void setPrinterInfoAddress(String printerInfoAddress) { + this.printerInfoAddress = printerInfoAddress; + } + + public String getPrinterInfoAddress() { + return printerInfoAddress; + } + + public void setPrinterInfoIp(String printerInfoIp) { + this.printerInfoIp = printerInfoIp; + } + + public String getPrinterInfoIp() { + return printerInfoIp; + } + + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) + .append("printerInfoId", getPrinterInfoId()) + .append("printerInfoCode", getPrinterInfoCode()) + .append("printerInfoName", getPrinterInfoName()) + .append("printerInfoAddress", getPrinterInfoAddress()) + .append("printerInfoIp", getPrinterInfoIp()) + .append("remark", getRemark()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .toString(); + } +} diff --git a/hw-modules/hw-system/src/main/java/com/hw/system/common/mapper/HwPrinterInfoMapper.java b/hw-modules/hw-system/src/main/java/com/hw/system/common/mapper/HwPrinterInfoMapper.java new file mode 100644 index 0000000..838ab61 --- /dev/null +++ b/hw-modules/hw-system/src/main/java/com/hw/system/common/mapper/HwPrinterInfoMapper.java @@ -0,0 +1,61 @@ +package com.hw.system.common.mapper; + +import java.util.List; + +import com.hw.system.common.domain.HwPrinterInfo; + +/** + * 打印机信息Mapper接口 + * + * @author Yinq + * @date 2024-03-25 + */ +public interface HwPrinterInfoMapper { + /** + * 查询打印机信息 + * + * @param printerInfoId 打印机信息主键 + * @return 打印机信息 + */ + public HwPrinterInfo selectHwPrinterInfoByPrinterInfoId(Long printerInfoId); + + /** + * 查询打印机信息列表 + * + * @param hwPrinterInfo 打印机信息 + * @return 打印机信息集合 + */ + public List selectHwPrinterInfoList(HwPrinterInfo hwPrinterInfo); + + /** + * 新增打印机信息 + * + * @param hwPrinterInfo 打印机信息 + * @return 结果 + */ + public int insertHwPrinterInfo(HwPrinterInfo hwPrinterInfo); + + /** + * 修改打印机信息 + * + * @param hwPrinterInfo 打印机信息 + * @return 结果 + */ + public int updateHwPrinterInfo(HwPrinterInfo hwPrinterInfo); + + /** + * 删除打印机信息 + * + * @param printerInfoId 打印机信息主键 + * @return 结果 + */ + public int deleteHwPrinterInfoByPrinterInfoId(Long printerInfoId); + + /** + * 批量删除打印机信息 + * + * @param printerInfoIds 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteHwPrinterInfoByPrinterInfoIds(Long[] printerInfoIds); +} diff --git a/hw-modules/hw-system/src/main/java/com/hw/system/common/service/IHwPrinterInfoService.java b/hw-modules/hw-system/src/main/java/com/hw/system/common/service/IHwPrinterInfoService.java new file mode 100644 index 0000000..902a6eb --- /dev/null +++ b/hw-modules/hw-system/src/main/java/com/hw/system/common/service/IHwPrinterInfoService.java @@ -0,0 +1,61 @@ +package com.hw.system.common.service; + +import java.util.List; + +import com.hw.system.common.domain.HwPrinterInfo; + +/** + * 打印机信息Service接口 + * + * @author Yinq + * @date 2024-03-25 + */ +public interface IHwPrinterInfoService { + /** + * 查询打印机信息 + * + * @param printerInfoId 打印机信息主键 + * @return 打印机信息 + */ + public HwPrinterInfo selectHwPrinterInfoByPrinterInfoId(Long printerInfoId); + + /** + * 查询打印机信息列表 + * + * @param hwPrinterInfo 打印机信息 + * @return 打印机信息集合 + */ + public List selectHwPrinterInfoList(HwPrinterInfo hwPrinterInfo); + + /** + * 新增打印机信息 + * + * @param hwPrinterInfo 打印机信息 + * @return 结果 + */ + public int insertHwPrinterInfo(HwPrinterInfo hwPrinterInfo); + + /** + * 修改打印机信息 + * + * @param hwPrinterInfo 打印机信息 + * @return 结果 + */ + public int updateHwPrinterInfo(HwPrinterInfo hwPrinterInfo); + + /** + * 批量删除打印机信息 + * + * @param printerInfoIds 需要删除的打印机信息主键集合 + * @return 结果 + */ + public int deleteHwPrinterInfoByPrinterInfoIds(Long[] printerInfoIds); + + /** + * 删除打印机信息信息 + * + * @param printerInfoId 打印机信息主键 + * @return 结果 + */ + public int deleteHwPrinterInfoByPrinterInfoId(Long printerInfoId); +} diff --git a/hw-modules/hw-system/src/main/java/com/hw/system/common/service/impl/HwPrinterInfoServiceImpl.java b/hw-modules/hw-system/src/main/java/com/hw/system/common/service/impl/HwPrinterInfoServiceImpl.java new file mode 100644 index 0000000..ee22540 --- /dev/null +++ b/hw-modules/hw-system/src/main/java/com/hw/system/common/service/impl/HwPrinterInfoServiceImpl.java @@ -0,0 +1,93 @@ +package com.hw.system.common.service.impl; + +import java.util.List; + +import com.hw.common.core.utils.DateUtils; +import com.hw.common.security.utils.SecurityUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.hw.system.common.mapper.HwPrinterInfoMapper; +import com.hw.system.common.domain.HwPrinterInfo; +import com.hw.system.common.service.IHwPrinterInfoService; + +/** + * 打印机信息Service业务层处理 + * + * @author Yinq + * @date 2024-03-25 + */ +@Service +public class HwPrinterInfoServiceImpl implements IHwPrinterInfoService { + @Autowired + private HwPrinterInfoMapper hwPrinterInfoMapper; + + /** + * 查询打印机信息 + * + * @param printerInfoId 打印机信息主键 + * @return 打印机信息 + */ + @Override + public HwPrinterInfo selectHwPrinterInfoByPrinterInfoId(Long printerInfoId) { + return hwPrinterInfoMapper.selectHwPrinterInfoByPrinterInfoId(printerInfoId); + } + + /** + * 查询打印机信息列表 + * + * @param hwPrinterInfo 打印机信息 + * @return 打印机信息 + */ + @Override + public List selectHwPrinterInfoList(HwPrinterInfo hwPrinterInfo) { + return hwPrinterInfoMapper.selectHwPrinterInfoList(hwPrinterInfo); + } + + /** + * 新增打印机信息 + * + * @param hwPrinterInfo 打印机信息 + * @return 结果 + */ + @Override + public int insertHwPrinterInfo(HwPrinterInfo hwPrinterInfo) { + hwPrinterInfo.setCreateBy(SecurityUtils.getUsername()); + hwPrinterInfo.setCreateTime(DateUtils.getNowDate()); + return hwPrinterInfoMapper.insertHwPrinterInfo(hwPrinterInfo); + } + + /** + * 修改打印机信息 + * + * @param hwPrinterInfo 打印机信息 + * @return 结果 + */ + @Override + public int updateHwPrinterInfo(HwPrinterInfo hwPrinterInfo) { + hwPrinterInfo.setUpdateBy(SecurityUtils.getUsername()); + hwPrinterInfo.setUpdateTime(DateUtils.getNowDate()); + return hwPrinterInfoMapper.updateHwPrinterInfo(hwPrinterInfo); + } + + /** + * 批量删除打印机信息 + * + * @param printerInfoIds 需要删除的打印机信息主键 + * @return 结果 + */ + @Override + public int deleteHwPrinterInfoByPrinterInfoIds(Long[] printerInfoIds) { + return hwPrinterInfoMapper.deleteHwPrinterInfoByPrinterInfoIds(printerInfoIds); + } + + /** + * 删除打印机信息信息 + * + * @param printerInfoId 打印机信息主键 + * @return 结果 + */ + @Override + public int deleteHwPrinterInfoByPrinterInfoId(Long printerInfoId) { + return hwPrinterInfoMapper.deleteHwPrinterInfoByPrinterInfoId(printerInfoId); + } +} diff --git a/hw-modules/hw-system/src/main/resources/mapper/system/common/HwPrinterInfoMapper.xml b/hw-modules/hw-system/src/main/resources/mapper/system/common/HwPrinterInfoMapper.xml new file mode 100644 index 0000000..b613500 --- /dev/null +++ b/hw-modules/hw-system/src/main/resources/mapper/system/common/HwPrinterInfoMapper.xml @@ -0,0 +1,113 @@ + + + + + + + + + + + + + + + + + + + select printer_info_id, + printer_info_code, + printer_info_name, + printer_info_address, + printer_info_ip, + remark, + create_by, + create_time, + update_by, + update_time + from hw_printer_info + + + + + + + + insert into hw_printer_info + + printer_info_code, + printer_info_name, + printer_info_address, + printer_info_ip, + remark, + create_by, + create_time, + update_by, + update_time, + + + #{printerInfoCode}, + #{printerInfoName}, + #{printerInfoAddress}, + #{printerInfoIp}, + #{remark}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + + + + + update hw_printer_info + + printer_info_code = #{printerInfoCode}, + printer_info_name = #{printerInfoName}, + printer_info_address = #{printerInfoAddress}, + printer_info_ip = #{printerInfoIp}, + remark = #{remark}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + + where printer_info_id = #{printerInfoId} + + + + delete + from hw_printer_info + where printer_info_id = #{printerInfoId} + + + + delete from hw_printer_info where printer_info_id in + + #{printerInfoId} + + + \ No newline at end of file diff --git a/hw-ui/src/api/system/common/hwPrinterInfo.js b/hw-ui/src/api/system/common/hwPrinterInfo.js new file mode 100644 index 0000000..c2725b5 --- /dev/null +++ b/hw-ui/src/api/system/common/hwPrinterInfo.js @@ -0,0 +1,44 @@ +import request from '@//utils/request' + +// 查询打印机信息列表 +export function listHwPrinterInfo(query) { + return request({ + url: '/system/hwPrinterInfo/list', + method: 'get', + params: query + }) +} + +// 查询打印机信息详细 +export function getHwPrinterInfo(printerInfoId) { + return request({ + url: '/system/hwPrinterInfo/' + printerInfoId, + method: 'get' + }) +} + +// 新增打印机信息 +export function addHwPrinterInfo(data) { + return request({ + url: '/system/hwPrinterInfo', + method: 'post', + data: data + }) +} + +// 修改打印机信息 +export function updateHwPrinterInfo(data) { + return request({ + url: '/system/hwPrinterInfo', + method: 'put', + data: data + }) +} + +// 删除打印机信息 +export function delHwPrinterInfo(printerInfoId) { + return request({ + url: '/system/hwPrinterInfo/' + printerInfoId, + method: 'delete' + }) +} diff --git a/hw-ui/src/views/system/common/hwPrinterInfo/index.vue b/hw-ui/src/views/system/common/hwPrinterInfo/index.vue new file mode 100644 index 0000000..845e7b0 --- /dev/null +++ b/hw-ui/src/views/system/common/hwPrinterInfo/index.vue @@ -0,0 +1,325 @@ + + +