Browse Source

[fix]产品型号管理页面调整

dev
zhangsiqi 7 months ago
parent
commit
a4fd3e15c6
  1. 51
      ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysProductModel.java
  2. 20
      ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysProductModelMapper.java
  3. 19
      ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysProductModelServiceImpl.java
  4. 65
      ruoyi-admin/src/main/resources/mapper/system/SysProductModelMapper.xml
  5. 8
      ruoyi-admin/src/main/resources/templates/system/model/add.html
  6. 5
      ruoyi-admin/src/main/resources/templates/system/model/edit.html
  7. 84
      ruoyi-admin/src/main/resources/templates/system/model/model.html

51
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,15 +101,23 @@ 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)
{
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();
}

20
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);
}

19
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);
}
}

65
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">
<mapper namespace="com.ruoyi.system.mapper.SysProductModelMapper">
<resultMap type="SysProductModel" id="SysProductModelResult">
<result property="Pid" column="Pid" />
<result property="Pcode" column="Pcode" />
<result property="createBy" column="create_by" />
<result property="pid" column="pid" />
<result property="pcode" column="pcode" />
<result property="equipModel" column="equipModel" />
<result property="equipName" column="equipName" />
<result property="specification" column="specification" />
<result property="differences" column="differences" />
<result property="remark" column="remark" />
<result property="engineer" column="engineer" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="udpateBy" column="udpate_by" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
<result property="useStatus" column="use_status" />
<result property="photoUrl" column="photoUrl" />
</resultMap>
<sql id="selectSysProductModelVo">
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
</sql>
<select id="selectSysProductModelList" parameterType="SysProductModel" resultMap="SysProductModelResult">
<include refid="selectSysProductModelVo"/>
<where>
<if test="Pcode != null and Pcode != ''"> and Pcode = #{Pcode}</if>
<if test="pcode != null and pcode != ''"> and Pcode = #{pcode}</if>
<if test="createBy != null and createBy != ''"> and create_by = #{createBy}</if>
<if test="equipModel != null and equipModel != ''"> and equipModel = #{equipModel}</if>
<if test="equipName != null and equipName != ''"> and equipName like concat('%', #{equipName}, '%')</if>
<if test="specification != null and specification != ''"> and specification = #{specification}</if>
<if test="differences != null and differences != ''"> and differences = #{differences}</if>
<if test="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''"> and create_time between #{params.beginCreateTime} and #{params.endCreateTime}</if>
<if test="udpateBy != null and udpateBy != ''"> and udpate_by = #{udpateBy}</if>
<if test="photoUrl != null and photoUrl != ''"> and photoUrl = #{photoUrl}</if>
<if test="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''">
and create_time between #{params.beginCreateTime} and #{params.endCreateTime}
</if>
<if test="updateBy != null and updateBy != ''"> and update_by = #{updateBy}</if>
<if test="useStatus != null and useStatus != ''"> and use_status = #{useStatus}</if>
<if test="engineer !=null and engineer != ''">engineer = #{engineer}</if>
</where>
</select>
<select id="selectSysProductModelById" parameterType="Long" resultMap="SysProductModelResult">
<include refid="selectSysProductModelVo"/>
where Pid = #{Pid}
where pid = #{pid}
</select>
<insert id="insertSysProductModel" parameterType="SysProductModel">
<insert id="insertSysProductModel" parameterType="SysProductModel" useGeneratedKeys="true" keyProperty="pid">
insert into sys_product_model
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="Pid != null">Pid,</if>
<if test="Pcode != null">Pcode,</if>
<if test="pcode != null">pcode,</if>
<if test="createBy != null">create_by,</if>
<if test="equipModel != null">equipModel,</if>
<if test="equipName != null">equipName,</if>
@ -54,13 +59,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="differences != null">differences,</if>
<if test="remark != null">remark,</if>
<if test="createTime != null">create_time,</if>
<if test="udpateBy != null">udpate_by,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="photoUrl != null">photoUrl,</if>
use_status
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="Pid != null">#{Pid},</if>
<if test="Pcode != null">#{Pcode},</if>
<if test="pcode != null">#{pcode},</if>
<if test="createBy != null">#{createBy},</if>
<if test="equipModel != null">#{equipModel},</if>
<if test="equipName != null">#{equipName},</if>
@ -68,16 +73,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="differences != null">#{differences},</if>
<if test="remark != null">#{remark},</if>
<if test="createTime != null">#{createTime},</if>
<if test="udpateBy != null">#{udpateBy},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="photoUrl != null">#{photoUrl},</if>
'1'
</trim>
</insert>
<update id="updateSysProductModel" parameterType="SysProductModel">
update sys_product_model
<trim prefix="SET" suffixOverrides=",">
<if test="Pcode != null">Pcode = #{Pcode},</if>
<if test="pcode != null">pcode = #{pcode},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="equipModel != null">equipModel = #{equipModel},</if>
<if test="equipName != null">equipName = #{equipName},</if>
@ -85,30 +91,31 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="differences != null">differences = #{differences},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="udpateBy != null">udpate_by = #{udpateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="photoUrl != null">photoUrl = #{photoUrl},</if>
<if test="useStatus != null">use_status = #{useStatus},</if>
update_time = now()
</trim>
where Pid = #{Pid}
where pid = #{pid}
</update>
<delete id="deleteSysProductModelById" parameterType="Long">
delete from sys_product_model where Pid = #{Pid}
delete from sys_product_model where pid = #{pid}
</delete>
<delete id="deleteSysProductModelByIds" parameterType="String">
delete from sys_product_model where Pid in
<foreach item="Pid" collection="array" open="(" separator="," close=")">
#{Pid}
delete from sys_product_model where pid in
<foreach item="pid" collection="array" open="(" separator="," close=")">
#{pid}
</foreach>
</delete>
<update id="cancelSysProductModelById" parameterType="Long">
update sys_product_model set del_flag = '1' where Pid = #{Pid}
update sys_product_model set use_status = '1' where pid = #{pid}
</update>
<update id="restoreSysProductModelById" parameterType="Long">
update sys_product_model set del_flag = '0' where Pid = #{Pid}
update sys_product_model set use_status = '0' where pid = #{pid}
</update>
</mapper>

8
ruoyi-admin/src/main/resources/templates/system/model/add.html

@ -9,7 +9,7 @@
<div class="form-group">
<label class="col-sm-3 control-label">产品型号ID:</label>
<div class="col-sm-8">
<input name="Pcode" class="form-control" type="text">
<input name="pcode" class="form-control" type="text">
</div>
</div>
<div class="form-group">
@ -42,12 +42,6 @@
<input name="remark" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">更新人:</label>
<div class="col-sm-8">
<input name="udpateBy" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">图片地址:</label>
<div class="col-sm-8">

5
ruoyi-admin/src/main/resources/templates/system/model/edit.html

@ -6,11 +6,11 @@
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-model-edit" th:object="${sysProductModel}">
<input name="Pid" th:field="*{Pid}" type="hidden">
<input name="pid" th:field="*{pid}" type="hidden">
<div class="form-group">
<label class="col-sm-3 control-label">产品型号ID:</label>
<div class="col-sm-8">
<input name="Pcode" th:field="*{Pcode}" class="form-control" type="text">
<input name="pcode" th:field="*{pcode}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
@ -63,7 +63,6 @@
$("#form-model-edit").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/edit", $('#form-model-edit').serialize());

84
ruoyi-admin/src/main/resources/templates/system/model/model.html

@ -12,11 +12,7 @@
<ul>
<li>
<label>产品型号ID:</label>
<input type="text" name="Pcode"/>
</li>
<li>
<label>工程员:</label>
<input type="text" name="createBy"/>
<input type="text" name="pcode"/>
</li>
<li>
<label>设备型号:</label>
@ -41,12 +37,8 @@
<input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endCreateTime]"/>
</li>
<li>
<label>更新人:</label>
<input type="text" name="udpateBy"/>
</li>
<li>
<label>图片地址:</label>
<input type="text" name="photoUrl"/>
<label>工程员:</label>
<input type="text" name="engineer"/>
</li>
<li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
@ -61,12 +53,6 @@
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:model:add">
<i class="fa fa-plus"></i> 添加
</a>
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="system:model:edit">
<i class="fa fa-edit"></i> 修改
</a>
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:model:remove">
<i class="fa fa-remove"></i> 删除
</a>
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:model:export">
<i class="fa fa-download"></i> 导出
</a>
@ -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,50 +81,20 @@
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: '图片地址'
},
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',
@ -147,14 +102,15 @@
var actions = [];
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.Pid + '\')"><i class="fa fa-edit"></i>编辑</a> ');
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.Pid + '\')"><i class="fa fa-remove"></i>删除</a> ');
if(row.delFlag == '0'){
if(row.useStatus == '0'){
actions.push('<a class="btn btn-danger btn-xs ' + cancelFlag + '" href="javascript:void(0)" onclick="$.operate.cancel(\'' + row.id + '\')"><i class="fa fa-remove"></i>作废</a> ');
}else{
actions.push('<a class="btn btn-success btn-xs ' + restoreFlag + '" href="javascript:void(0)" onclick="$.operate.restore(\'' + row.id + '\')"><i class="fa fa-window-restore"></i>恢复</a> ');
}
return actions.join('');
}
}]
}
]
};
$.table.init(options);
});

Loading…
Cancel
Save