From a4fd3e15c6aba1deca6f38c576e33faab1f5baa8 Mon Sep 17 00:00:00 2001 From: zhangsiqi <2825463979@qq.com> Date: Tue, 16 Apr 2024 10:30:59 +0800 Subject: [PATCH] =?UTF-8?q?[fix]=E4=BA=A7=E5=93=81=E5=9E=8B=E5=8F=B7?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E9=A1=B5=E9=9D=A2=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ruoyi/system/domain/SysProductModel.java | 53 +++++---- .../system/mapper/SysProductModelMapper.java | 20 ++-- .../impl/SysProductModelServiceImpl.java | 19 ++-- .../mapper/system/SysProductModelMapper.xml | 81 +++++++------ .../resources/templates/system/model/add.html | 8 +- .../templates/system/model/edit.html | 5 +- .../templates/system/model/model.html | 106 +++++------------- 7 files changed, 129 insertions(+), 163 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysProductModel.java b/ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysProductModel.java index 48153333..216a1d25 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysProductModel.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysProductModel.java @@ -16,11 +16,11 @@ public class SysProductModel extends BaseEntity private static final long serialVersionUID = 1L; /** 产品型号管理表id */ - private Long Pid; + private Long pid; /** 产品型号ID */ @Excel(name = "产品型号ID") - private String Pcode; + private String pcode; /** 设备型号 */ @Excel(name = "设备型号") @@ -38,31 +38,32 @@ public class SysProductModel extends BaseEntity @Excel(name = "差异说明") private String differences; - /** 更新人 */ - @Excel(name = "更新人") - private String udpateBy; + @Excel(name = "工程员") + private String engineer; + @Excel(name = "使用状态") + private String useStatus; /** 图片地址 */ @Excel(name = "图片地址") private String photoUrl; - public void setPid(Long Pid) + public void setPid(Long pid) { - this.Pid = Pid; + this.pid = pid; } public Long getPid() { - return Pid; + return pid; } - public void setPcode(String Pcode) + public void setPcode(String pcode) { - this.Pcode = Pcode; + this.pcode = pcode; } public String getPcode() { - return Pcode; + return pcode; } public void setEquipModel(String equipModel) { @@ -100,16 +101,24 @@ public class SysProductModel extends BaseEntity { return differences; } - public void setUdpateBy(String udpateBy) - { - this.udpateBy = udpateBy; + + public String getEngineer() { + return engineer; } - public String getUdpateBy() - { - return udpateBy; + public void setEngineer(String engineer) { + this.engineer = engineer; + } + + public String getUseStatus() { + return useStatus; + } + + public void setUseStatus(String useStatus) { + this.useStatus = useStatus; } - public void setPhotoUrl(String photoUrl) + + public void setPhotoUrl(String photoUrl) { this.photoUrl = photoUrl; } @@ -124,15 +133,17 @@ public class SysProductModel extends BaseEntity return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) .append("Pid", getPid()) .append("Pcode", getPcode()) - .append("createBy", getCreateBy()) .append("equipModel", getEquipModel()) .append("equipName", getEquipName()) .append("specification", getSpecification()) .append("differences", getDifferences()) - .append("remark", getRemark()) + .append("engineer", getEngineer()) + .append("useStatus", getUseStatus()) + .append("createBy", getCreateBy()) .append("createTime", getCreateTime()) - .append("udpateBy", getUdpateBy()) + .append("updateBy", getUpdateBy()) .append("updateTime", getUpdateTime()) + .append("remark", getRemark()) .append("photoUrl", getPhotoUrl()) .toString(); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysProductModelMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysProductModelMapper.java index 22cea5fa..1ed1f04b 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysProductModelMapper.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysProductModelMapper.java @@ -15,10 +15,10 @@ public interface SysProductModelMapper /** * 查询产品型号管理 * - * @param Pid 产品型号管理ID + * @param pid 产品型号管理ID * @return 产品型号管理 */ - public SysProductModel selectSysProductModelById(Long Pid); + public SysProductModel selectSysProductModelById(Long pid); /** * 查询产品型号管理列表 @@ -47,32 +47,32 @@ public interface SysProductModelMapper /** * 删除产品型号管理 * - * @param Pid 产品型号管理ID + * @param pid 产品型号管理ID * @return 结果 */ - public int deleteSysProductModelById(Long Pid); + public int deleteSysProductModelById(Long pid); /** * 批量删除产品型号管理 * - * @param Pids 需要删除的数据ID + * @param pids 需要删除的数据ID * @return 结果 */ - public int deleteSysProductModelByIds(String[] Pids); + public int deleteSysProductModelByIds(String[] ids); /** * 作废产品型号管理 * - * @param Pid 产品型号管理ID + * @param pid 产品型号管理ID * @return 结果 */ - public int cancelSysProductModelById(Long Pid); + public int cancelSysProductModelById(Long pid); /** * 恢复产品型号管理 * - * @param Pid 产品型号管理ID + * @param pid 产品型号管理ID * @return 结果 */ - public int restoreSysProductModelById(Long Pid); + public int restoreSysProductModelById(Long pid); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysProductModelServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysProductModelServiceImpl.java index 9f26f151..3a36ad8c 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysProductModelServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysProductModelServiceImpl.java @@ -32,9 +32,9 @@ public class SysProductModelServiceImpl implements ISysProductModelService * @return 产品型号管理 */ @Override - public SysProductModel selectSysProductModelById(Long Pid) + public SysProductModel selectSysProductModelById(Long pid) { - return sysProductModelMapper.selectSysProductModelById(Pid); + return sysProductModelMapper.selectSysProductModelById(pid); } /** @@ -60,8 +60,7 @@ public class SysProductModelServiceImpl implements ISysProductModelService { String loginName = ShiroUtils.getLoginName(); sysProductModel.setCreateBy(loginName); - String cpxh = redisCache.generateNo("CPXH"); - sysProductModel.setPcode(cpxh); + sysProductModel.setPcode(redisCache.generateNo("CPXH")); sysProductModel.setCreateTime(DateUtils.getNowDate()); return sysProductModelMapper.insertSysProductModel(sysProductModel); } @@ -98,9 +97,9 @@ public class SysProductModelServiceImpl implements ISysProductModelService * @return 结果 */ @Override - public int deleteSysProductModelById(Long Pid) + public int deleteSysProductModelById(Long pid) { - return sysProductModelMapper.deleteSysProductModelById(Pid); + return sysProductModelMapper.deleteSysProductModelById(pid); } /** @@ -110,9 +109,9 @@ public class SysProductModelServiceImpl implements ISysProductModelService * @return 结果 */ @Override - public int cancelSysProductModelById(Long Pid) + public int cancelSysProductModelById(Long pid) { - return sysProductModelMapper.cancelSysProductModelById(Pid); + return sysProductModelMapper.cancelSysProductModelById(pid); } /** @@ -122,8 +121,8 @@ public class SysProductModelServiceImpl implements ISysProductModelService * @return 结果 */ @Override - public int restoreSysProductModelById(Long Pid) + public int restoreSysProductModelById(Long pid) { - return sysProductModelMapper.restoreSysProductModelById(Pid); + return sysProductModelMapper.restoreSysProductModelById(pid); } } diff --git a/ruoyi-admin/src/main/resources/mapper/system/SysProductModelMapper.xml b/ruoyi-admin/src/main/resources/mapper/system/SysProductModelMapper.xml index 74026c0b..1bed9c94 100644 --- a/ruoyi-admin/src/main/resources/mapper/system/SysProductModelMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/system/SysProductModelMapper.xml @@ -4,49 +4,54 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - - - - - - - - - - - - + + + + + + + + + + + + + + - select Pid, Pcode, create_by, equipModel, equipName, specification, differences, remark, create_time, udpate_by, update_time, photoUrl from sys_product_model + select pid, pcode, equipModel, equipName,engineer,use_status, + specification, differences, create_by, create_time, udpate_by, + update_time,remark, photoUrl from sys_product_model - - + insert into sys_product_model - Pid, - Pcode, + pcode, create_by, equipModel, equipName, @@ -54,13 +59,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" differences, remark, create_time, - udpate_by, + update_by, update_time, photoUrl, + use_status - #{Pid}, - #{Pcode}, + #{pcode}, #{createBy}, #{equipModel}, #{equipName}, @@ -68,16 +73,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{differences}, #{remark}, #{createTime}, - #{udpateBy}, + #{updateBy}, #{updateTime}, #{photoUrl}, + '1' update sys_product_model - Pcode = #{Pcode}, + pcode = #{pcode}, create_by = #{createBy}, equipModel = #{equipModel}, equipName = #{equipName}, @@ -85,30 +91,31 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" differences = #{differences}, remark = #{remark}, create_time = #{createTime}, - udpate_by = #{udpateBy}, - update_time = #{updateTime}, + update_by = #{updateBy}, photoUrl = #{photoUrl}, + use_status = #{useStatus}, + update_time = now() - where Pid = #{Pid} + where pid = #{pid} - delete from sys_product_model where Pid = #{Pid} + delete from sys_product_model where pid = #{pid} - delete from sys_product_model where Pid in - - #{Pid} + delete from sys_product_model where pid in + + #{pid} - update sys_product_model set del_flag = '1' where Pid = #{Pid} + update sys_product_model set use_status = '1' where pid = #{pid} - update sys_product_model set del_flag = '0' where Pid = #{Pid} + update sys_product_model set use_status = '0' where pid = #{pid} \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/system/model/add.html b/ruoyi-admin/src/main/resources/templates/system/model/add.html index 9740abad..e5609257 100644 --- a/ruoyi-admin/src/main/resources/templates/system/model/add.html +++ b/ruoyi-admin/src/main/resources/templates/system/model/add.html @@ -9,7 +9,7 @@
- +
@@ -42,12 +42,6 @@
-
- -
- -
-
diff --git a/ruoyi-admin/src/main/resources/templates/system/model/edit.html b/ruoyi-admin/src/main/resources/templates/system/model/edit.html index b5398482..0f9ef007 100644 --- a/ruoyi-admin/src/main/resources/templates/system/model/edit.html +++ b/ruoyi-admin/src/main/resources/templates/system/model/edit.html @@ -6,11 +6,11 @@
- +
- +
@@ -63,7 +63,6 @@ $("#form-model-edit").validate({ focusCleanup: true }); - function submitHandler() { if ($.validate.form()) { $.operate.save(prefix + "/edit", $('#form-model-edit').serialize()); diff --git a/ruoyi-admin/src/main/resources/templates/system/model/model.html b/ruoyi-admin/src/main/resources/templates/system/model/model.html index ae877d32..ba13d77d 100644 --- a/ruoyi-admin/src/main/resources/templates/system/model/model.html +++ b/ruoyi-admin/src/main/resources/templates/system/model/model.html @@ -12,11 +12,7 @@
  • - -
  • -
  • - - +
  • @@ -41,12 +37,8 @@
  • - - -
  • -
  • - - + +
  •  搜索 @@ -61,12 +53,6 @@ 添加 - - 修改 - - - 删除 - 导出 @@ -83,7 +69,6 @@ var cancelFlag = [[${@permission.hasPermi('system:model:cancel')}]]; var restoreFlag = [[${@permission.hasPermi('system:model:restore')}]]; var prefix = ctx + "system/model"; - $(function() { var options = { url: prefix + "/list", @@ -96,65 +81,36 @@ modalName: "产品型号管理", fixedColumns: true, // 启用冻结列 fixedRightNumber: 1, // 冻结右列个数 - columns: [{ - checkbox: true - }, - { - field: 'Pid', - title: '产品型号管理表id', - visible: false - }, - { - field: 'Pcode', - title: '产品型号ID' - }, - { - field: 'createBy', - title: '工程员' - }, - { - field: 'equipModel', - title: '设备型号' - }, - { - field: 'equipName', - title: '设备名称' - }, - { - field: 'specification', - title: '规格说明' - }, - { - field: 'differences', - title: '差异说明' - }, - { - field: 'remark', - title: '备注' - }, - { - field: 'udpateBy', - title: '更新人' - }, - { - field: 'photoUrl', - title: '图片地址' - }, - { - title: '操作', - align: 'center', - formatter: function(value, row, index) { - var actions = []; - actions.push('编辑 '); - actions.push('删除 '); - if(row.delFlag == '0'){ - actions.push('作废 '); - }else{ - actions.push('恢复 '); + columns: [ + {checkbox: true}, + { title: '产品型号管理表id',field: 'pid',visible: false}, + { title: '产品型号ID',field: 'pcode'}, + { title: '工程员',field: 'engineer'}, + { title: '设备型号',field: 'equipModel'}, + { title: '设备名称',field: 'equipName'}, + { title: '规格说明',field: 'specification'}, + { title: '差异说明',field: 'differences'}, + { title: '备注',field: 'remark'}, + { title: '创建人',field: 'createBy',visible: false}, + { title: '录入时间',field: 'createTime'}, + { title: '更新人',field: 'updateBy'}, + { title:'上次更新时间',field: 'updateTime'}, + { + title: '操作', + align: 'center', + formatter: function(value, row, index) { + var actions = []; + actions.push('编辑 '); + actions.push('删除 '); + if(row.useStatus == '0'){ + actions.push('作废 '); + }else{ + actions.push('恢复 '); + } + return actions.join(''); } - return actions.join(''); } - }] + ] }; $.table.init(options); });