change - 设备信息添加物料品种

master
wenjy 2 years ago
parent d87fcfb69f
commit 7b8579282a

@ -11,74 +11,92 @@ import com.ruoyi.common.core.domain.TreeEntity;
* @author wenjy
* @date 2022-11-23
*/
public class BaseDeviceInfo extends TreeEntity
{
public class BaseDeviceInfo extends TreeEntity {
private static final long serialVersionUID = 1L;
/** 设备id */
/**
* id
*/
private Long deviceId;
/** 设备名称 */
/**
*
*/
@Excel(name = "设备名称")
private String deviceName;
/** 资源编号 */
/**
*
*/
@Excel(name = "资源编号")
private String resource;
/** 设备状态0正常 1停用 */
/**
* 0 1
*/
@Excel(name = "设备状态", readConverterExp = "0=正常,1=停用")
private String status;
/** 删除标志0代表存在 2代表删除 */
/**
* 0 2
*/
private String delFlag;
public void setDeviceId(Long deviceId)
{
/**
*
*/
@Excel(name = "品种")
private Integer materialType;
public void setDeviceId(Long deviceId) {
this.deviceId = deviceId;
}
public Long getDeviceId()
{
public Long getDeviceId() {
return deviceId;
}
public void setDeviceName(String deviceName)
{
public void setDeviceName(String deviceName) {
this.deviceName = deviceName;
}
public String getDeviceName()
{
public String getDeviceName() {
return deviceName;
}
public void setResource(String resource)
{
public void setResource(String resource) {
this.resource = resource;
}
public String getResource()
{
public String getResource() {
return resource;
}
public void setStatus(String status)
{
public void setStatus(String status) {
this.status = status;
}
public String getStatus()
{
public String getStatus() {
return status;
}
public void setDelFlag(String delFlag)
{
public void setDelFlag(String delFlag) {
this.delFlag = delFlag;
}
public String getDelFlag()
{
public String getDelFlag() {
return delFlag;
}
public void setMaterialType(Integer materialType) {
this.materialType = materialType;
}
public Integer getMaterialType() {
return materialType;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
@ -93,6 +111,7 @@ public class BaseDeviceInfo extends TreeEntity
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("materialType", getMaterialType())
.toString();
}
}

@ -16,11 +16,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="materialType" column="material_type" />
<result property="parentName" column="parent_name" />
</resultMap>
<sql id="selectBaseDeviceInfoVo">
select device_id, parent_id, device_name, order_num, resource, status, del_flag, create_by, create_time, update_by, update_time from base_deviceinfo
select device_id, parent_id, device_name, order_num, resource, status, del_flag, create_by, create_time, update_by, update_time, material_type from base_deviceinfo
</sql>
<select id="selectBaseDeviceInfoList" parameterType="BaseDeviceInfo" resultMap="BaseDeviceInfoResult">
@ -31,12 +32,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="orderNum != null "> and order_num = #{orderNum}</if>
<if test="resource != null and resource != ''"> and resource = #{resource}</if>
<if test="status != null and status != ''"> and status = #{status}</if>
<if test="materialType != null "> and material_type = #{materialType}</if>
</where>
order by parent_id
</select>
<select id="selectBaseDeviceInfoByDeviceId" parameterType="Long" resultMap="BaseDeviceInfoResult">
select t.device_id, t.parent_id, t.device_name, t.order_num, t.resource, t.status, t.del_flag, t.create_by, t.create_time, t.update_by, t.update_time, p.device_name as parent_name
select t.device_id, t.parent_id, t.device_name, t.order_num, t.resource, t.status, t.del_flag, t.create_by, t.create_time, t.update_by, t.update_time, t.material_type, p.device_name as parent_name
from base_deviceinfo t
left join base_deviceinfo p on p.device_id = t.parent_id
where t.device_id = #{deviceId}
@ -55,6 +57,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="materialType != null">material_type,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="parentId != null">#{parentId},</if>
@ -67,6 +70,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="materialType != null">#{materialType},</if>
</trim>
</insert>
@ -83,6 +87,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="materialType != null">material_type = #{materialType},</if>
</trim>
where device_id = #{deviceId}
</update>

@ -43,6 +43,16 @@
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">品种:</label>
<div class="col-sm-8">
<select name="materialType" class="form-control m-b" th:with="type=${@dict.getType('material_type')}">
<option value="">所有</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />

@ -10,32 +10,35 @@
<form id="formId">
<div class="select-list">
<ul>
<li>
<label>父级id</label>
<input type="text" name="parentId"/>
</li>
<li>
<label>设备名称:</label>
<input type="text" name="deviceName"/>
</li>
<li>
<label>显示顺序:</label>
<input type="text" name="orderNum"/>
</li>
<li>
<label>资源编号:</label>
<input type="text" name="resource"/>
</li>
<li>
<label>物料品种:</label>
<select name="materialType" th:with="type=${@dict.getType('material_type')}">
<option value="">所有</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}"
th:value="${dict.dictValue}"></option>
</select>
</li>
<li>
<label>设备状态:</label>
<select name="status" th:with="type=${@dict.getType('sys_normal_disable')}">
<option value="">所有</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}"
th:value="${dict.dictValue}"></option>
</select>
</li>
<li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.treeTable.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.treeTable.search()"><i
class="fa fa-search"></i>&nbsp;搜索</a>
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i
class="fa fa-refresh"></i>&nbsp;重置</a>
</li>
</ul>
</div>
@ -65,6 +68,7 @@
var removeFlag = [[${@permission.hasPermi('traceability:deviceinfo:remove')}]];
var statusDatas = [[${@dict.getType('sys_normal_disable')}]];
var delFlagDatas = [[${@dict.getType('sys_yes_no')}]];
var materialTypeDatas = [[${@dict.getType('material_type')}]];
var prefix = ctx + "traceability/deviceinfo";
$(function () {
@ -78,6 +82,8 @@
updateUrl: prefix + "/edit/{id}",
removeUrl: prefix + "/remove/{id}",
modalName: "设备信息",
expandAll: false,
expandFirst: true,
columns: [{
field: 'selectItem',
radio: true
@ -85,7 +91,8 @@
{
field: 'parentId',
title: '父级id',
align: 'left'
align: 'left',
visible: false
},
{
field: 'deviceName',
@ -95,13 +102,22 @@
{
field: 'orderNum',
title: '显示顺序',
align: 'left'
align: 'left',
visible: false
},
{
field: 'resource',
title: '资源编号',
align: 'left'
},
{
field: 'materialType',
title: '物料品种',
align: 'left',
formatter: function (value, row, index) {
return $.table.selectDictLabel(materialTypeDatas, value);
}
},
{
field: 'status',
title: '设备状态',

@ -44,6 +44,15 @@
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">品种:</label>
<div class="col-sm-8">
<select name="materialType" class="form-control m-b" th:with="type=${@dict.getType('material_type')}">
<option value="">所有</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{materialType}"></option>
</select>
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />

Loading…
Cancel
Save