From b457399d61e1d1dc6debcc591fc433a9f77e222a Mon Sep 17 00:00:00 2001 From: wangh <123456> Date: Thu, 1 Feb 2024 10:56:24 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90=20=E5=BA=9F=E5=93=81?= =?UTF-8?q?=E5=85=A5=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/RecordWasteInController.java | 127 ++++++++++++++++++ .../ruoyi/manage/domain/RecordWasteIn.java | 95 +++++++++++++ .../manage/mapper/RecordWasteInMapper.java | 62 +++++++++ .../manage/service/IRecordWasteInService.java | 61 +++++++++ .../impl/RecordWasteInServiceImpl.java | 93 +++++++++++++ .../create_menu_sql/record_waste_inMenu.sql | 22 +++ .../mapper/manage/RecordWasteInMapper.xml | 78 +++++++++++ .../templates/manage/record_waste_in/add.html | 49 +++++++ .../manage/record_waste_in/edit.html | 50 +++++++ .../record_waste_in/record_waste_in.html | 112 +++++++++++++++ 10 files changed, 749 insertions(+) create mode 100644 ruoyi-manage/src/main/java/com/ruoyi/manage/controller/RecordWasteInController.java create mode 100644 ruoyi-manage/src/main/java/com/ruoyi/manage/domain/RecordWasteIn.java create mode 100644 ruoyi-manage/src/main/java/com/ruoyi/manage/mapper/RecordWasteInMapper.java create mode 100644 ruoyi-manage/src/main/java/com/ruoyi/manage/service/IRecordWasteInService.java create mode 100644 ruoyi-manage/src/main/java/com/ruoyi/manage/service/impl/RecordWasteInServiceImpl.java create mode 100644 ruoyi-manage/src/main/resources/create_menu_sql/record_waste_inMenu.sql create mode 100644 ruoyi-manage/src/main/resources/mapper/manage/RecordWasteInMapper.xml create mode 100644 ruoyi-manage/src/main/resources/templates/manage/record_waste_in/add.html create mode 100644 ruoyi-manage/src/main/resources/templates/manage/record_waste_in/edit.html create mode 100644 ruoyi-manage/src/main/resources/templates/manage/record_waste_in/record_waste_in.html diff --git a/ruoyi-manage/src/main/java/com/ruoyi/manage/controller/RecordWasteInController.java b/ruoyi-manage/src/main/java/com/ruoyi/manage/controller/RecordWasteInController.java new file mode 100644 index 0000000..cbda595 --- /dev/null +++ b/ruoyi-manage/src/main/java/com/ruoyi/manage/controller/RecordWasteInController.java @@ -0,0 +1,127 @@ +package com.ruoyi.manage.controller; + +import java.util.List; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.ModelMap; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.manage.domain.RecordWasteIn; +import com.ruoyi.manage.service.IRecordWasteInService; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.common.core.page.TableDataInfo; + +/** + * 废品入库记录Controller + * + * @author wangh + * @date 2024-01-29 + */ +@Controller +@RequestMapping("/manage/record_waste_in") +public class RecordWasteInController extends BaseController +{ + private String prefix = "manage/record_waste_in"; + + @Autowired + private IRecordWasteInService recordWasteInService; + + @RequiresPermissions("manage:record_waste_in:view") + @GetMapping() + public String record_waste_in() + { + return prefix + "/record_waste_in"; + } + + /** + * 查询废品入库记录列表 + */ + @RequiresPermissions("manage:record_waste_in:list") + @PostMapping("/list") + @ResponseBody + public TableDataInfo list(RecordWasteIn recordWasteIn) + { + startPage(); + List list = recordWasteInService.selectRecordWasteInList(recordWasteIn); + return getDataTable(list); + } + + /** + * 导出废品入库记录列表 + */ + @RequiresPermissions("manage:record_waste_in:export") + @Log(title = "废品入库记录", businessType = BusinessType.EXPORT) + @PostMapping("/export") + @ResponseBody + public AjaxResult export(RecordWasteIn recordWasteIn) + { + List list = recordWasteInService.selectRecordWasteInList(recordWasteIn); + ExcelUtil util = new ExcelUtil(RecordWasteIn.class); + return util.exportExcel(list, "废品入库记录数据"); + } + + /** + * 新增废品入库记录 + */ + @GetMapping("/add") + public String add() + { + return prefix + "/add"; + } + + /** + * 新增保存废品入库记录 + */ + @RequiresPermissions("manage:record_waste_in:add") + @Log(title = "废品入库记录", businessType = BusinessType.INSERT) + @PostMapping("/add") + @ResponseBody + public AjaxResult addSave(RecordWasteIn recordWasteIn) + { + return toAjax(recordWasteInService.insertRecordWasteIn(recordWasteIn)); + } + + /** + * 修改废品入库记录 + */ + @RequiresPermissions("manage:record_waste_in:edit") + @GetMapping("/edit/{objid}") + public String edit(@PathVariable("objid") Long objid, ModelMap mmap) + { + RecordWasteIn recordWasteIn = recordWasteInService.selectRecordWasteInByObjid(objid); + mmap.put("recordWasteIn", recordWasteIn); + return prefix + "/edit"; + } + + /** + * 修改保存废品入库记录 + */ + @RequiresPermissions("manage:record_waste_in:edit") + @Log(title = "废品入库记录", businessType = BusinessType.UPDATE) + @PostMapping("/edit") + @ResponseBody + public AjaxResult editSave(RecordWasteIn recordWasteIn) + { + return toAjax(recordWasteInService.updateRecordWasteIn(recordWasteIn)); + } + + /** + * 删除废品入库记录 + */ + @RequiresPermissions("manage:record_waste_in:remove") + @Log(title = "废品入库记录", businessType = BusinessType.DELETE) + @PostMapping( "/remove") + @ResponseBody + public AjaxResult remove(String ids) + { + return toAjax(recordWasteInService.deleteRecordWasteInByObjids(ids)); + } +} diff --git a/ruoyi-manage/src/main/java/com/ruoyi/manage/domain/RecordWasteIn.java b/ruoyi-manage/src/main/java/com/ruoyi/manage/domain/RecordWasteIn.java new file mode 100644 index 0000000..443c4ac --- /dev/null +++ b/ruoyi-manage/src/main/java/com/ruoyi/manage/domain/RecordWasteIn.java @@ -0,0 +1,95 @@ +package com.ruoyi.manage.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +/** + * 废品入库记录对象 record_waste_in + * + * @author wangh + * @date 2024-01-29 + */ +public class RecordWasteIn extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long objid; + + /** RFID */ + @Excel(name = "RFID") + private String epc; + + /** 前存储位置 */ + @Excel(name = "前存储位置") + private String locationCode; + + /** 报废时间 */ + @Excel(name = "报废时间") + private String bfTime; + + /** 入库库位 */ + @Excel(name = "入库库位") + private String inCode; + + public void setObjid(Long objid) + { + this.objid = objid; + } + + public Long getObjid() + { + return objid; + } + public void setEpc(String epc) + { + this.epc = epc; + } + + public String getEpc() + { + return epc; + } + public void setLocationCode(String locationCode) + { + this.locationCode = locationCode; + } + + public String getLocationCode() + { + return locationCode; + } + public void setBfTime(String bfTime) + { + this.bfTime = bfTime; + } + + public String getBfTime() + { + return bfTime; + } + public void setInCode(String inCode) + { + this.inCode = inCode; + } + + public String getInCode() + { + return inCode; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("objid", getObjid()) + .append("epc", getEpc()) + .append("locationCode", getLocationCode()) + .append("bfTime", getBfTime()) + .append("inCode", getInCode()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .toString(); + } +} diff --git a/ruoyi-manage/src/main/java/com/ruoyi/manage/mapper/RecordWasteInMapper.java b/ruoyi-manage/src/main/java/com/ruoyi/manage/mapper/RecordWasteInMapper.java new file mode 100644 index 0000000..e251131 --- /dev/null +++ b/ruoyi-manage/src/main/java/com/ruoyi/manage/mapper/RecordWasteInMapper.java @@ -0,0 +1,62 @@ +package com.ruoyi.manage.mapper; + +import java.util.List; +import com.ruoyi.manage.domain.RecordWasteIn; +import org.springframework.stereotype.Repository; +/** + * 废品入库记录Mapper接口 + * + * @author wangh + * @date 2024-01-29 + */ +@Repository +public interface RecordWasteInMapper +{ + /** + * 查询废品入库记录 + * + * @param objid 废品入库记录主键 + * @return 废品入库记录 + */ + public RecordWasteIn selectRecordWasteInByObjid(Long objid); + + /** + * 查询废品入库记录列表 + * + * @param recordWasteIn 废品入库记录 + * @return 废品入库记录集合 + */ + public List selectRecordWasteInList(RecordWasteIn recordWasteIn); + + /** + * 新增废品入库记录 + * + * @param recordWasteIn 废品入库记录 + * @return 结果 + */ + public int insertRecordWasteIn(RecordWasteIn recordWasteIn); + + /** + * 修改废品入库记录 + * + * @param recordWasteIn 废品入库记录 + * @return 结果 + */ + public int updateRecordWasteIn(RecordWasteIn recordWasteIn); + + /** + * 删除废品入库记录 + * + * @param objid 废品入库记录主键 + * @return 结果 + */ + public int deleteRecordWasteInByObjid(Long objid); + + /** + * 批量删除废品入库记录 + * + * @param objids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteRecordWasteInByObjids(String[] objids); +} diff --git a/ruoyi-manage/src/main/java/com/ruoyi/manage/service/IRecordWasteInService.java b/ruoyi-manage/src/main/java/com/ruoyi/manage/service/IRecordWasteInService.java new file mode 100644 index 0000000..66bc028 --- /dev/null +++ b/ruoyi-manage/src/main/java/com/ruoyi/manage/service/IRecordWasteInService.java @@ -0,0 +1,61 @@ +package com.ruoyi.manage.service; + +import java.util.List; +import com.ruoyi.manage.domain.RecordWasteIn; + +/** + * 废品入库记录Service接口 + * + * @author wangh + * @date 2024-01-29 + */ +public interface IRecordWasteInService +{ + /** + * 查询废品入库记录 + * + * @param objid 废品入库记录主键 + * @return 废品入库记录 + */ + public RecordWasteIn selectRecordWasteInByObjid(Long objid); + + /** + * 查询废品入库记录列表 + * + * @param recordWasteIn 废品入库记录 + * @return 废品入库记录集合 + */ + public List selectRecordWasteInList(RecordWasteIn recordWasteIn); + + /** + * 新增废品入库记录 + * + * @param recordWasteIn 废品入库记录 + * @return 结果 + */ + public int insertRecordWasteIn(RecordWasteIn recordWasteIn); + + /** + * 修改废品入库记录 + * + * @param recordWasteIn 废品入库记录 + * @return 结果 + */ + public int updateRecordWasteIn(RecordWasteIn recordWasteIn); + + /** + * 批量删除废品入库记录 + * + * @param objids 需要删除的废品入库记录主键集合 + * @return 结果 + */ + public int deleteRecordWasteInByObjids(String objids); + + /** + * 删除废品入库记录信息 + * + * @param objid 废品入库记录主键 + * @return 结果 + */ + public int deleteRecordWasteInByObjid(Long objid); +} diff --git a/ruoyi-manage/src/main/java/com/ruoyi/manage/service/impl/RecordWasteInServiceImpl.java b/ruoyi-manage/src/main/java/com/ruoyi/manage/service/impl/RecordWasteInServiceImpl.java new file mode 100644 index 0000000..4654287 --- /dev/null +++ b/ruoyi-manage/src/main/java/com/ruoyi/manage/service/impl/RecordWasteInServiceImpl.java @@ -0,0 +1,93 @@ +package com.ruoyi.manage.service.impl; + +import java.util.List; + + +import com.ruoyi.common.utils.DateUtils; +import com.ruoyi.common.utils.ShiroUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.manage.mapper.RecordWasteInMapper; +import com.ruoyi.manage.domain.RecordWasteIn; +import com.ruoyi.manage.service.IRecordWasteInService; +import com.ruoyi.common.core.text.Convert; + +/** + * 废品入库记录Service业务层处理 + * + * @author wangh + * @date 2024-01-29 + */ +@Service +public class RecordWasteInServiceImpl implements IRecordWasteInService { + @Autowired + private RecordWasteInMapper recordWasteInMapper; + + /** + * 查询废品入库记录 + * + * @param objid 废品入库记录主键 + * @return 废品入库记录 + */ + @Override + public RecordWasteIn selectRecordWasteInByObjid(Long objid) { + return recordWasteInMapper.selectRecordWasteInByObjid(objid); + } + + /** + * 查询废品入库记录列表 + * + * @param recordWasteIn 废品入库记录 + * @return 废品入库记录 + */ + @Override + public List selectRecordWasteInList(RecordWasteIn recordWasteIn) { + return recordWasteInMapper.selectRecordWasteInList(recordWasteIn); + } + + /** + * 新增废品入库记录 + * + * @param recordWasteIn 废品入库记录 + * @return 结果 + */ + @Override + public int insertRecordWasteIn(RecordWasteIn recordWasteIn) { + recordWasteIn.setCreateBy(ShiroUtils.getLoginName()); + recordWasteIn.setCreateTime(DateUtils.getNowDate()); + return recordWasteInMapper.insertRecordWasteIn(recordWasteIn); + } + + /** + * 修改废品入库记录 + * + * @param recordWasteIn 废品入库记录 + * @return 结果 + */ + @Override + public int updateRecordWasteIn(RecordWasteIn recordWasteIn) { + return recordWasteInMapper.updateRecordWasteIn(recordWasteIn); + } + + /** + * 批量删除废品入库记录 + * + * @param objids 需要删除的废品入库记录主键 + * @return 结果 + */ + @Override + public int deleteRecordWasteInByObjids(String objids) { + return recordWasteInMapper.deleteRecordWasteInByObjids(Convert.toStrArray(objids)); + } + + /** + * 删除废品入库记录信息 + * + * @param objid 废品入库记录主键 + * @return 结果 + */ + @Override + public int deleteRecordWasteInByObjid(Long objid) { + return recordWasteInMapper.deleteRecordWasteInByObjid(objid); + } +} diff --git a/ruoyi-manage/src/main/resources/create_menu_sql/record_waste_inMenu.sql b/ruoyi-manage/src/main/resources/create_menu_sql/record_waste_inMenu.sql new file mode 100644 index 0000000..b56897c --- /dev/null +++ b/ruoyi-manage/src/main/resources/create_menu_sql/record_waste_inMenu.sql @@ -0,0 +1,22 @@ +-- 菜单 SQL +insert into sys_menu (menu_name, parent_id, order_num, url, menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark) +values('废品入库记录', '2026', '6', '/manage/record_waste_in', 'C', '0', 'manage:record_waste_in:view', '#', 'admin', sysdate(), '', null, '废品入库记录菜单'); + +-- 按钮父菜单ID +SELECT @parentId := LAST_INSERT_ID(); + +-- 按钮 SQL +insert into sys_menu (menu_name, parent_id, order_num, url, menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark) +values('废品入库记录查询', @parentId, '1', '#', 'F', '0', 'manage:record_waste_in:list', '#', 'admin', sysdate(), '', null, ''); + +insert into sys_menu (menu_name, parent_id, order_num, url, menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark) +values('废品入库记录新增', @parentId, '2', '#', 'F', '0', 'manage:record_waste_in:add', '#', 'admin', sysdate(), '', null, ''); + +insert into sys_menu (menu_name, parent_id, order_num, url, menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark) +values('废品入库记录修改', @parentId, '3', '#', 'F', '0', 'manage:record_waste_in:edit', '#', 'admin', sysdate(), '', null, ''); + +insert into sys_menu (menu_name, parent_id, order_num, url, menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark) +values('废品入库记录删除', @parentId, '4', '#', 'F', '0', 'manage:record_waste_in:remove', '#', 'admin', sysdate(), '', null, ''); + +insert into sys_menu (menu_name, parent_id, order_num, url, menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark) +values('废品入库记录导出', @parentId, '5', '#', 'F', '0', 'manage:record_waste_in:export', '#', 'admin', sysdate(), '', null, ''); diff --git a/ruoyi-manage/src/main/resources/mapper/manage/RecordWasteInMapper.xml b/ruoyi-manage/src/main/resources/mapper/manage/RecordWasteInMapper.xml new file mode 100644 index 0000000..39cd12f --- /dev/null +++ b/ruoyi-manage/src/main/resources/mapper/manage/RecordWasteInMapper.xml @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + + select objid, epc, location_code, bf_time, in_code, create_by, create_time from record_waste_in + + + + + + + + insert into record_waste_in + + epc, + location_code, + bf_time, + in_code, + create_by, + create_time, + + + #{epc}, + #{locationCode}, + #{bfTime}, + #{inCode}, + #{createBy}, + #{createTime}, + + + + + update record_waste_in + + epc = #{epc}, + location_code = #{locationCode}, + bf_time = #{bfTime}, + in_code = #{inCode}, + create_by = #{createBy}, + create_time = #{createTime}, + + where objid = #{objid} + + + + delete from record_waste_in where objid = #{objid} + + + + delete from record_waste_in where objid in + + #{objid} + + + + \ No newline at end of file diff --git a/ruoyi-manage/src/main/resources/templates/manage/record_waste_in/add.html b/ruoyi-manage/src/main/resources/templates/manage/record_waste_in/add.html new file mode 100644 index 0000000..b80fabe --- /dev/null +++ b/ruoyi-manage/src/main/resources/templates/manage/record_waste_in/add.html @@ -0,0 +1,49 @@ + + + + + + +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/ruoyi-manage/src/main/resources/templates/manage/record_waste_in/edit.html b/ruoyi-manage/src/main/resources/templates/manage/record_waste_in/edit.html new file mode 100644 index 0000000..a1d213a --- /dev/null +++ b/ruoyi-manage/src/main/resources/templates/manage/record_waste_in/edit.html @@ -0,0 +1,50 @@ + + + + + + +
+
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/ruoyi-manage/src/main/resources/templates/manage/record_waste_in/record_waste_in.html b/ruoyi-manage/src/main/resources/templates/manage/record_waste_in/record_waste_in.html new file mode 100644 index 0000000..19d7632 --- /dev/null +++ b/ruoyi-manage/src/main/resources/templates/manage/record_waste_in/record_waste_in.html @@ -0,0 +1,112 @@ + + + + + + +
+
+
+
+
+
    +
  • + + +
  • +
  • + + + - + +
  • +
  • +  搜索 +  重置 +
  • +
+
+
+
+ + +
+
+
+
+
+ + + + \ No newline at end of file