diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysSop.java b/ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysSop.java index e471da4f..fc2dbcae 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysSop.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysSop.java @@ -15,8 +15,23 @@ public class SysSop extends BaseEntity { private static final long serialVersionUID = 1L; + /** 主键ID */ + private Long id; + + /** 删除标志(0代表存在 1代表删除) */ + private String delFlag; + /** sopid */ - private Long sopId; + private String sopId; + + /** sop编号 */ + private String sopNum; + /** 品名 */ + private String productName; + /** 设备型号 */ + private String equipModel; + /** 描述 */ + private String describe; /** 成品代码 */ @Excel(name = "成品代码") @@ -101,16 +116,65 @@ public class SysSop extends BaseEntity @Excel(name = "修改时间") private String updateInfoTime; - public void setSopId(Long sopId) + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getDelFlag() { + return delFlag; + } + + public void setDelFlag(String delFlag) { + this.delFlag = delFlag; + } + + public void setSopId(String sopId) { this.sopId = sopId; } - public Long getSopId() + public String getSopId() { return sopId; } - public void setSopCode(String sopCode) + + public String getSopNum() { + return sopNum; + } + + public void setSopNum(String sopNum) { + this.sopNum = sopNum; + } + + public String getProductName() { + return productName; + } + + public void setProductName(String productName) { + this.productName = productName; + } + + public String getEquipModel() { + return equipModel; + } + + public void setEquipModel(String equipModel) { + this.equipModel = equipModel; + } + + public String getDescribe() { + return describe; + } + + public void setDescribe(String describe) { + this.describe = describe; + } + + public void setSopCode(String sopCode) { this.sopCode = sopCode; } @@ -301,7 +365,13 @@ public class SysSop extends BaseEntity @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("delFlag", getDelFlag()) .append("sopId", getSopId()) + .append("sopNum", getSopNum()) + .append("productName", getProductName()) + .append("equipModel", getEquipModel()) + .append("describe", getDescribe()) .append("sopCode", getSopCode()) .append("sopName", getSopName()) .append("sopModel", getSopModel()) @@ -321,8 +391,6 @@ public class SysSop extends BaseEntity .append("sopRegistrant", getSopRegistrant()) .append("sopRemark", getSopRemark()) .append("currentVersion", getCurrentVersion()) - .append("firstAddTime", getFirstAddTime()) - .append("updateInfoTime", getUpdateInfoTime()) .toString(); } } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysSopMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysSopMapper.java index 0e3ab137..9e0c4ffc 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysSopMapper.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysSopMapper.java @@ -15,10 +15,10 @@ public interface SysSopMapper /** * 查询SOP * - * @param sopId SOPID + * @param id 主键id * @return SOP */ - public SysSop selectSysSopById(Long sopId); + public SysSop selectSysSopById(Long id); /** * 查询SOP列表 @@ -47,16 +47,16 @@ public interface SysSopMapper /** * 删除SOP * - * @param sopId SOPID + * @param id 主键id * @return 结果 */ - public int deleteSysSopById(Long sopId); + public int deleteSysSopById(Long id); /** * 批量删除SOP * - * @param sopIds 需要删除的数据ID + * @param ids 需要删除的数据ID * @return 结果 */ - public int deleteSysSopByIds(String[] sopIds); + public int deleteSysSopByIds(String[] ids); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSopServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSopServiceImpl.java index 442be24b..d83402ee 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSopServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSopServiceImpl.java @@ -1,6 +1,9 @@ package com.ruoyi.system.service.impl; +import com.ruoyi.common.core.redis.RedisCache; import com.ruoyi.common.core.text.Convert; +import com.ruoyi.common.utils.DateUtils; +import com.ruoyi.common.utils.ShiroUtils; import com.ruoyi.system.domain.SysSop; import com.ruoyi.system.mapper.SysSopMapper; import com.ruoyi.system.service.ISysSopService; @@ -21,6 +24,9 @@ public class SysSopServiceImpl implements ISysSopService @Autowired private SysSopMapper sysSopMapper; + @Autowired + private RedisCache redisCache; + /** * 查询SOP * @@ -54,6 +60,12 @@ public class SysSopServiceImpl implements ISysSopService @Override public int insertSysSop(SysSop sysSop) { + String loginName = ShiroUtils.getLoginName(); + sysSop.setCreateBy(loginName); + sysSop.setCreateTime(DateUtils.getNowDate()); + // 生成编号 + String billNo = redisCache.generateNo("SOP"); + sysSop.setSopId(billNo); return sysSopMapper.insertSysSop(sysSop); } @@ -66,6 +78,9 @@ public class SysSopServiceImpl implements ISysSopService @Override public int updateSysSop(SysSop sysSop) { + String loginName = ShiroUtils.getLoginName(); + sysSop.setUpdateBy(loginName); + sysSop.setUpdateTime(DateUtils.getNowDate()); return sysSopMapper.updateSysSop(sysSop); } @@ -84,12 +99,12 @@ public class SysSopServiceImpl implements ISysSopService /** * 删除SOP信息 * - * @param sopId SOPID + * @param id 主键id * @return 结果 */ @Override - public int deleteSysSopById(Long sopId) + public int deleteSysSopById(Long id) { - return sysSopMapper.deleteSysSopById(sopId); + return sysSopMapper.deleteSysSopById(id); } } diff --git a/ruoyi-admin/src/main/resources/mapper/system/SysSopMapper.xml b/ruoyi-admin/src/main/resources/mapper/system/SysSopMapper.xml index 3ba7c0b0..a49aa12f 100644 --- a/ruoyi-admin/src/main/resources/mapper/system/SysSopMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/system/SysSopMapper.xml @@ -5,7 +5,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + + + + + + + + + + @@ -25,17 +36,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - - - select sop_id, sop_code, sop_name, sop_model, type_of_machine, sop_unit, drawing_file, workhour_file, sop_file, sip_file, spp_file, bom_file, customer_file, other_file, customer_code, customer_name, date_of_registration, sop_registrant, sop_remark, current_version, first_add_time, update_info_time from sys_sop + select id,del_flag,create_by,create_time,update_by,update_time,remark,sop_id,sop_num,product_name,equip_model,`describe`,sop_code, sop_name, sop_model, type_of_machine, sop_unit, drawing_file, workhour_file, sop_file, sip_file, spp_file, bom_file, customer_file, other_file, customer_code, customer_name, date_of_registration, sop_registrant, sop_remark, current_version from sys_sop - where sop_id = #{sopId} + where id = #{id} insert into sys_sop + sop_id, + sop_num, + product_name, + equip_model, + `describe`, sop_code, sop_name, sop_model, @@ -71,9 +86,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" sop_registrant, sop_remark, current_version, - first_add_time, + create_by, + create_time, + update_by, + update_time, + remark, + del_flag, + #{sopId}, + #{sopNum}, + #{productName}, + #{equipModel}, + #{describe}, #{sopCode}, #{sopName}, #{sopModel}, @@ -93,13 +118,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{sopRegistrant}, #{sopRemark}, #{currentVersion}, - now(), + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + #{remark}, + #{delFlag}, update sys_sop + sop_num = #{sopNum}, + product_name = #{productName}, + equip_model = #{equipModel}, + `describe` = #{describe}, sop_code = #{sopCode}, sop_name = #{sopName}, sop_model = #{sopModel}, @@ -119,19 +153,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" sop_registrant = #{sopRegistrant}, sop_remark = #{sopRemark}, current_version = #{currentVersion}, - update_info_time = CONCAT_WS(',',NOW(),update_info_time), + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + remark = #{remark}, + del_flag = #{delFlag}, - where sop_id = #{sopId} + where id = #{sopId} - delete from sys_sop where sop_id = #{sopId} + delete from sys_sop where id = #{id} - delete from sys_sop where sop_id in - - #{sopId} + delete from sys_sop where id in + + #{item} diff --git a/ruoyi-admin/src/main/resources/templates/system/sop/add.html b/ruoyi-admin/src/main/resources/templates/system/sop/add.html index 000c687e..74f6f598 100644 --- a/ruoyi-admin/src/main/resources/templates/system/sop/add.html +++ b/ruoyi-admin/src/main/resources/templates/system/sop/add.html @@ -16,6 +16,30 @@
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
diff --git a/ruoyi-admin/src/main/resources/templates/system/sop/edit.html b/ruoyi-admin/src/main/resources/templates/system/sop/edit.html index 7cc400e1..129b528d 100644 --- a/ruoyi-admin/src/main/resources/templates/system/sop/edit.html +++ b/ruoyi-admin/src/main/resources/templates/system/sop/edit.html @@ -10,7 +10,37 @@
- + +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
diff --git a/ruoyi-admin/src/main/resources/templates/system/sop/sop.html b/ruoyi-admin/src/main/resources/templates/system/sop/sop.html index 402c5f76..da758862 100644 --- a/ruoyi-admin/src/main/resources/templates/system/sop/sop.html +++ b/ruoyi-admin/src/main/resources/templates/system/sop/sop.html @@ -39,6 +39,10 @@ +
  • + + +
  •  搜索  重置 @@ -87,192 +91,212 @@ columns: [{ checkbox: true }, - { - field: 'sopId', - title: 'sopid', - visible: false - }, - { - field: 'sopCode', - title: '成品代码' - }, - { - field: 'sopName', - title: '成品名称' - }, - { - field: 'sopModel', - title: '规格型号' - }, - { - field: 'typeOfMachine', - title: '机种' - }, - { - field: 'sopUnit', - title: '单位', - formatter: function(value, row, index) { - return $.table.selectDictLabel(sopUnitDatas, value); - } - }, - { - field: 'drawingFile', - title: '图纸文件', - formatter: function(value, row, index) { - var actions = []; - if (value !== null) { - var filepath = value.substring(value.lastIndexOf("/")+1) - actions.push(''+filepath+' '); - } - return actions.join(''); - } - }, - { - field: 'workhourFile', - title: '工时文件', - formatter: function(value, row, index) { - var actions = []; - if (value !== null) { - var filepath = value.substring(value.lastIndexOf("/")+1) - actions.push(''+filepath+' '); - } - return actions.join(''); + { + title: '主键ID', + field: 'id', + visible: false + }, + { + field: 'sopId', + title: 'SOPID' + }, + { + field: 'sopNum', + title: 'SOP编号' + }, + { + field: 'productName', + title: '品名' + }, + { + field: 'equipModel', + title: '设备型号' + }, + { + field: 'describe', + title: '描述' + }, + { + field: 'sopCode', + title: '成品代码' + }, + { + field: 'sopName', + title: '成品名称' + }, + { + field: 'sopModel', + title: '规格型号' + }, + { + field: 'typeOfMachine', + title: '机种' + }, + { + field: 'sopUnit', + title: '单位', + formatter: function(value, row, index) { + return $.table.selectDictLabel(sopUnitDatas, value); + } + }, + { + field: 'drawingFile', + title: '图纸文件', + formatter: function(value, row, index) { + var actions = []; + if (value !== null) { + var filepath = value.substring(value.lastIndexOf("/")+1) + actions.push(''+filepath+' '); } - }, - { - field: 'sopFile', - title: 'SOP文件', - formatter: function(value, row, index) { - var actions = []; - if (value !== null) { - var filepath = value.substring(value.lastIndexOf("/")+1) - actions.push(''+filepath+' '); - } - return actions.join(''); + return actions.join(''); + } + }, + { + field: 'workhourFile', + title: '工时文件', + formatter: function(value, row, index) { + var actions = []; + if (value !== null) { + var filepath = value.substring(value.lastIndexOf("/")+1) + actions.push(''+filepath+' '); } - }, - { - field: 'sipFile', - title: 'SIP文件', - formatter: function(value, row, index) { - var actions = []; - if (value !== null) { - var filepath = value.substring(value.lastIndexOf("/")+1) - actions.push(''+filepath+' '); - } - return actions.join(''); + return actions.join(''); + } + }, + { + field: 'sopFile', + title: 'SOP文件', + formatter: function(value, row, index) { + var actions = []; + if (value !== null) { + var filepath = value.substring(value.lastIndexOf("/")+1) + actions.push(''+filepath+' '); } - }, - { - field: 'sppFile', - title: 'SPP文件', - formatter: function(value, row, index) { - var actions = []; - if (value !== null) { - var filepath = value.substring(value.lastIndexOf("/")+1) - actions.push(''+filepath+' '); - } - return actions.join(''); + return actions.join(''); + } + }, + { + field: 'sipFile', + title: 'SIP文件', + formatter: function(value, row, index) { + var actions = []; + if (value !== null) { + var filepath = value.substring(value.lastIndexOf("/")+1) + actions.push(''+filepath+' '); } - }, - { - field: 'bomFile', - title: 'BOM文件', - formatter: function(value, row, index) { - var actions = []; - if (value !== null) { - var filepath = value.substring(value.lastIndexOf("/")+1) - actions.push(''+filepath+' '); - } - return actions.join(''); + return actions.join(''); + } + }, + { + field: 'sppFile', + title: 'SPP文件', + formatter: function(value, row, index) { + var actions = []; + if (value !== null) { + var filepath = value.substring(value.lastIndexOf("/")+1) + actions.push(''+filepath+' '); } - }, - { - field: 'customerFile', - title: '客户文件', - formatter: function(value, row, index) { - var actions = []; - if (value !== null) { - var filepath = value.substring(value.lastIndexOf("/")+1) - actions.push(''+filepath+' '); - } - return actions.join(''); + return actions.join(''); + } + }, + { + field: 'bomFile', + title: 'BOM文件', + formatter: function(value, row, index) { + var actions = []; + if (value !== null) { + var filepath = value.substring(value.lastIndexOf("/")+1) + actions.push(''+filepath+' '); } - }, - { - field: 'otherFile', - title: '其他文件', - formatter: function(value, row, index) { - var actions = []; - if (value !== null) { - var filepath = value.substring(value.lastIndexOf("/")+1) - actions.push(''+filepath+' '); - } - return actions.join(''); + return actions.join(''); + } + }, + { + field: 'customerFile', + title: '客户文件', + formatter: function(value, row, index) { + var actions = []; + if (value !== null) { + var filepath = value.substring(value.lastIndexOf("/")+1) + actions.push(''+filepath+' '); } - }, - { - field: 'customerCode', - title: '客户编号' - }, - { - field: 'customerName', - title: '客户名称' - }, - { - field: 'dateOfRegistration', - title: '登记日期' - }, - { - field: 'sopRegistrant', - title: '登记人' - }, - { - field: 'sopRemark', - title: '备注说明' - }, - { - field: 'currentVersion', - title: '是否当前版本', - formatter: function (value, row, index) { - return $.table.selectDictLabel(currentVersionDatas, value); + return actions.join(''); + } + }, + { + field: 'otherFile', + title: '其他文件', + formatter: function(value, row, index) { + var actions = []; + if (value !== null) { + var filepath = value.substring(value.lastIndexOf("/")+1) + actions.push(''+filepath+' '); } - }, - { - field: 'firstAddTime', - title: '录入时间', - formatter: function (value, row, index) { - if (value == null) { - return " "; - } else { - return value; - } + return actions.join(''); + } + }, + { + field: 'customerCode', + title: '客户编号' + }, + { + field: 'customerName', + title: '客户名称' + }, + { + field: 'dateOfRegistration', + title: '登记日期' + }, + { + field: 'sopRegistrant', + title: '登记人' + }, + { + field: 'sopRemark', + title: '备注说明' + }, + { + field: 'currentVersion', + title: '是否当前版本', + formatter: function (value, row, index) { + return $.table.selectDictLabel(currentVersionDatas, value); + } + }, + { + field: 'createTime', + title: '录入时间', + formatter: function (value, row, index) { + if (value == null) { + return " "; + } else { + return value; } - }, - { - field: 'updateInfoTime', - title: '上次修改时间', - formatter: function (value, row, index) { - if (value == null) { - return " "; - } else { - var vArr = value.split(',') - return vArr[0]; - } + } + }, + { + field: 'updateTime', + title: '上次修改时间', + formatter: function (value, row, index) { + if (value == null) { + return " "; + } else { + var vArr = value.split(',') + return vArr[0]; } } + } - // { - // title: '操作', - // align: 'center', - // formatter: function(value, row, index) { - // var actions = []; - // actions.push('编辑 '); - // actions.push('删除'); - // return actions.join(''); - // } - // } - ] + // { + // title: '操作', + // align: 'center', + // formatter: function(value, row, index) { + // var actions = []; + // actions.push('编辑 '); + // actions.push('删除'); + // return actions.join(''); + // } + // } + ] }; $.table.init(options); });