Browse Source

[fix]工程管理

bom新增页面:新增一条物料加上型号字段、bom的form表单新增型号字段
bom实体类新增型号字段和get、set方法,重新排列导出字段的顺序
bom的mapper.xml层的所有查询方法、修改方法、新增方法都加上materialModel字段
dev
liuxiaoxu 4 weeks ago
parent
commit
0d1119a39f
  1. 23
      ruoyi-admin/src/main/java/com/ruoyi/erp/domain/ErpBom.java
  2. 25
      ruoyi-admin/src/main/resources/mapper/erp/ErpBomMapper.xml
  3. 9
      ruoyi-admin/src/main/resources/templates/erp/bom/add.html

23
ruoyi-admin/src/main/java/com/ruoyi/erp/domain/ErpBom.java

@ -34,7 +34,7 @@ public class ErpBom extends BaseEntity
@Excel(name = "料号",sort = 3) @Excel(name = "料号",sort = 3)
private String materialNo; private String materialNo;
@Excel(name = "图片",sort = 9) @Excel(name = "图片",sort = 10)
private String photoUrl; private String photoUrl;
/** 物料名称 */ /** 物料名称 */
@Excel(name = "物料名称",sort = 4) @Excel(name = "物料名称",sort = 4)
@ -44,16 +44,21 @@ public class ErpBom extends BaseEntity
// @Excel(name="物料类型") // @Excel(name="物料类型")
private String materialType; private String materialType;
/** 加工方式 */ /** 加工方式 */
@Excel(name = "半成品类型",sort = 7,dictType = "processMethod") @Excel(name = "半成品类型",sort = 8,dictType = "processMethod")
private String processMethod; private String processMethod;
/** 单位 */ /** 单位 */
@Excel(name = "单位",sort = 8) @Excel(name = "单位",sort = 9)
private String unit; private String unit;
/** 型号*/
@Excel(name = "型号",sort = 6)
private String materialModel;
/** 品牌 */ /** 品牌 */
@Excel(name = "品牌",sort = 6) @Excel(name = "品牌",sort = 7)
private String brand; private String brand;
/** 描述 */ /** 描述 */
@ -241,6 +246,15 @@ public class ErpBom extends BaseEntity
return unit; return unit;
} }
public String getMaterialModel() {
return materialModel;
}
public void setMaterialModel(String materialModel) {
this.materialModel = materialModel;
}
public void setBrand(String brand) public void setBrand(String brand)
{ {
this.brand = brand; this.brand = brand;
@ -454,6 +468,7 @@ public class ErpBom extends BaseEntity
", materialType='" + materialType + '\'' + ", materialType='" + materialType + '\'' +
", processMethod='" + processMethod + '\'' + ", processMethod='" + processMethod + '\'' +
", unit='" + unit + '\'' + ", unit='" + unit + '\'' +
", materialModel='" + materialModel + '\'' +
", brand='" + brand + '\'' + ", brand='" + brand + '\'' +
", describe='" + describe + '\'' + ", describe='" + describe + '\'' +
", engineer='" + engineer + '\'' + ", engineer='" + engineer + '\'' +

25
ruoyi-admin/src/main/resources/mapper/erp/ErpBomMapper.xml

@ -18,6 +18,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="processMethod" column="process_method" /> <result property="processMethod" column="process_method" />
<result property="engineer" column="engineer" /> <result property="engineer" column="engineer" />
<result property="unit" column="unit" /> <result property="unit" column="unit" />
<result property="materialModel" column="material_model" />
<result property="brand" column="brand" /> <result property="brand" column="brand" />
<result property="describe" column="describe" /> <result property="describe" column="describe" />
<result property="warehouseDept" column="warehouseDept" /> <result property="warehouseDept" column="warehouseDept" />
@ -58,6 +59,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="processMethod" column="sub_process_method" /> <result property="processMethod" column="sub_process_method" />
<result property="engineer" column="sub_engineer" /> <result property="engineer" column="sub_engineer" />
<result property="unit" column="sub_unit" /> <result property="unit" column="sub_unit" />
<result property="materialModel" column="sub_material_model" />
<result property="brand" column="sub_brand" /> <result property="brand" column="sub_brand" />
<result property="describe" column="sub_describe" /> <result property="describe" column="sub_describe" />
<result property="warehouseDept" column="sub_warehouseDept" /> <result property="warehouseDept" column="sub_warehouseDept" />
@ -72,7 +74,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<sql id="selectErpBomVo"> <sql id="selectErpBomVo">
select id, del_flag, create_by, create_time, update_by, update_time, remark, bom_no, select id, del_flag, create_by, create_time, update_by, update_time, remark, bom_no,
material_no, material_name, material_type, process_method, unit, brand, `describe`,warehouseDept, material_no, material_name, material_type, process_method, unit, material_model, brand, `describe`,warehouseDept,
engineer,use_num, loss_rate, parent_id, `level`, sort_no, audit_status, use_status, engineer,use_num, loss_rate, parent_id, `level`, sort_no, audit_status, use_status,
instance_id,instance_type,submit_instance_id,cancel_instance_id,restore_instance_id, instance_id,instance_type,submit_instance_id,cancel_instance_id,restore_instance_id,
apply_title,apply_user,apply_time from erp_bom apply_title,apply_user,apply_time from erp_bom
@ -81,7 +83,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectErpBomList" parameterType="ErpBomVo" resultMap="ErpBomResult"> <select id="selectErpBomList" parameterType="ErpBomVo" resultMap="ErpBomResult">
select erp.id, erp.del_flag, erp.create_by, erp.create_time, erp.update_by, erp.update_time select erp.id, erp.del_flag, erp.create_by, erp.create_time, erp.update_by, erp.update_time
, erp.remark,erp.bom_no,erp.material_no,erp.material_name, erp.audit_status, erp.use_status , erp.remark,erp.bom_no,erp.material_no,erp.material_name, erp.audit_status, erp.use_status
, erp.material_type, erp.process_method,erp.unit, erp.brand, erp.`describe`,erp.warehouseDept,erp.engineer, , erp.material_type, erp.process_method,erp.unit, erp.material_model, erp.brand, erp.`describe`,erp.warehouseDept,erp.engineer,
erp.use_num,erp.loss_rate, erp.parent_id, erp.`level`, erp.sort_no, erp.instance_id, erp.use_num,erp.loss_rate, erp.parent_id, erp.`level`, erp.sort_no, erp.instance_id,
erp.instance_type, processDict.dict_label as instance_type_name, erp.submit_instance_id, erp.instance_type, processDict.dict_label as instance_type_name, erp.submit_instance_id,
erp.cancel_instance_id, erp.restore_instance_id,erp.apply_title,erp.apply_user,erp.apply_time erp.cancel_instance_id, erp.restore_instance_id,erp.apply_title,erp.apply_user,erp.apply_time
@ -155,7 +157,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select> </select>
<select id="selectErpBomList1" resultMap="ErpBomResult"> <select id="selectErpBomList1" resultMap="ErpBomResult">
select bom_no, id, create_by, create_time, update_by, update_time, remark, select bom_no, id, create_by, create_time, update_by, update_time, remark,
material_no, material_name, material_type, process_method, unit, material_no, material_name, material_type, process_method, unit, material_model,
brand, `describe`,warehouseDept,engineer,use_num, loss_rate, parent_id, `level`, brand, `describe`,warehouseDept,engineer,use_num, loss_rate, parent_id, `level`,
sort_no, audit_status, use_status from erp_bom sort_no, audit_status, use_status from erp_bom
where bom_no != "" ORDER BY id DESC; where bom_no != "" ORDER BY id DESC;
@ -163,7 +165,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectErpBomById" parameterType="Long" resultMap="ErpBomResult"> <select id="selectErpBomById" parameterType="Long" resultMap="ErpBomResult">
select erp.id, erp.del_flag, erp.create_by, erp.create_time, erp.update_by, erp.update_time, select erp.id, erp.del_flag, erp.create_by, erp.create_time, erp.update_by, erp.update_time,
erp.remark,erp.bom_no, erp.material_no , erp.material_name, erp.audit_status, erp.use_status, erp.remark,erp.bom_no, erp.material_no , erp.material_name, erp.audit_status, erp.use_status,
erp.material_type, erp.process_method, erp.unit, erp.brand, erp.describe,erp.warehouseDept, erp.material_type, erp.process_method, erp.unit, erp.material_model, erp.brand, erp.describe,erp.warehouseDept,
erp.use_num, erp.engineer, erp.use_num, erp.engineer,
erp.loss_rate, erp.parent_id, erp.level, erp.sort_no,erp.instance_id,erp.instance_type, erp.loss_rate, erp.parent_id, erp.level, erp.sort_no,erp.instance_id,erp.instance_type,
erp.submit_instance_id,erp.cancel_instance_id,erp.restore_instance_id,erp.apply_title, erp.submit_instance_id,erp.cancel_instance_id,erp.restore_instance_id,erp.apply_title,
@ -255,6 +257,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="materialType != null and materialType != '' ">material_type,</if> <if test="materialType != null and materialType != '' ">material_type,</if>
<if test="processMethod != null and processMethod != '' ">process_method,</if> <if test="processMethod != null and processMethod != '' ">process_method,</if>
<if test="unit != null and unit != '' ">unit,</if> <if test="unit != null and unit != '' ">unit,</if>
<if test="materialModel != null">material_model,</if>
<if test="brand != null and brand != '' ">brand,</if> <if test="brand != null and brand != '' ">brand,</if>
<if test="describe != null and describe != '' ">`describe`,</if> <if test="describe != null and describe != '' ">`describe`,</if>
<if test="warehouseDept != null and warehouseDept != '' ">warehouseDept,</if> <if test="warehouseDept != null and warehouseDept != '' ">warehouseDept,</if>
@ -286,6 +289,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="materialType != null and materialType != '' ">#{materialType},</if> <if test="materialType != null and materialType != '' ">#{materialType},</if>
<if test="processMethod != null and processMethod != '' ">#{processMethod},</if> <if test="processMethod != null and processMethod != '' ">#{processMethod},</if>
<if test="unit != null and unit != '' ">#{unit},</if> <if test="unit != null and unit != '' ">#{unit},</if>
<if test="materialModel != null">#{materialModel},</if>
<if test="brand != null and brand != '' ">#{brand},</if> <if test="brand != null and brand != '' ">#{brand},</if>
<if test="describe != null and describe != '' ">#{describe},</if> <if test="describe != null and describe != '' ">#{describe},</if>
<if test="warehouseDept != null and warehouseDept != '' ">#{warehouseDept},</if> <if test="warehouseDept != null and warehouseDept != '' ">#{warehouseDept},</if>
@ -321,6 +325,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="materialType != null and materialType != '' ">material_type = #{materialType},</if> <if test="materialType != null and materialType != '' ">material_type = #{materialType},</if>
<if test="processMethod != null and processMethod != '' ">process_method = #{processMethod},</if> <if test="processMethod != null and processMethod != '' ">process_method = #{processMethod},</if>
<if test="unit != null and unit != '' ">unit = #{unit},</if> <if test="unit != null and unit != '' ">unit = #{unit},</if>
<if test="materialModel != null">material_model = #{materialModel},</if>
<if test="brand != null and brand != '' ">brand = #{brand},</if> <if test="brand != null and brand != '' ">brand = #{brand},</if>
<if test="describe != null and describe != '' ">`describe` = #{describe},</if> <if test="describe != null and describe != '' ">`describe` = #{describe},</if>
<if test="warehouseDept != null and warehouseDept != '' ">warehouseDept = #{warehouseDept},</if> <if test="warehouseDept != null and warehouseDept != '' ">warehouseDept = #{warehouseDept},</if>
@ -379,7 +384,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<insert id="batchErpBom"> <insert id="batchErpBom">
insert into erp_bom( id, del_flag, create_by, create_time, update_by, update_time, remark, bom_no, material_no, insert into erp_bom( id, del_flag, create_by, create_time, update_by, update_time, remark, bom_no, material_no,
material_name, material_type, process_method, unit, brand, `describe`,warehouseDept, use_num, loss_rate, material_name, material_type, process_method, unit, material_model, brand, `describe`,warehouseDept, use_num, loss_rate,
parent_id, `level`, sort_no, audit_status, use_status) values parent_id, `level`, sort_no, audit_status, use_status) values
<foreach item="item" index="index" collection="list" separator=","> <foreach item="item" index="index" collection="list" separator=",">
( #{item.id}, #{item.delFlag}, #{item.createBy}, #{item.createTime}, ( #{item.id}, #{item.delFlag}, #{item.createBy}, #{item.createTime},
@ -418,7 +423,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectErpBomByMaterialNo" parameterType="String" resultMap="ErpBomResult"> <select id="selectErpBomByMaterialNo" parameterType="String" resultMap="ErpBomResult">
select erp.id, erp.del_flag, erp.create_by, erp.create_time, erp.update_by, erp.update_time, select erp.id, erp.del_flag, erp.create_by, erp.create_time, erp.update_by, erp.update_time,
erp.remark,erp.bom_no,erp.material_no,erp.material_name, erp.audit_status, erp.use_status, erp.remark,erp.bom_no,erp.material_no,erp.material_name, erp.audit_status, erp.use_status,
erp.material_type, erp.process_method,erp.unit, erp.brand, erp.`describe`,erp.warehouseDept,erp.engineer, erp.material_type, erp.process_method,erp.unit, erp.material_model, erp.brand, erp.`describe`,erp.warehouseDept,erp.engineer,
erp.use_num,erp.loss_rate, erp.parent_id, erp.`level`, erp.sort_no, erp.instance_id, erp.use_num,erp.loss_rate, erp.parent_id, erp.`level`, erp.sort_no, erp.instance_id,
erp.instance_type, processDict.dict_label as instance_type_name, erp.submit_instance_id, erp.instance_type, processDict.dict_label as instance_type_name, erp.submit_instance_id,
erp.cancel_instance_id, erp.restore_instance_id,erp.apply_title,erp.apply_user,erp.apply_time, erp.cancel_instance_id, erp.restore_instance_id,erp.apply_title,erp.apply_user,erp.apply_time,
@ -453,7 +458,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectSubBomsByParentMaterialNo" parameterType="map" resultMap="ErpBomResult"> <select id="selectSubBomsByParentMaterialNo" parameterType="map" resultMap="ErpBomResult">
select erp.id, erp.del_flag, erp.create_by, erp.create_time, erp.update_by, erp.update_time, select erp.id, erp.del_flag, erp.create_by, erp.create_time, erp.update_by, erp.update_time,
erp.remark,erp.bom_no,erp.material_no,erp.material_name, erp.audit_status, erp.use_status, erp.remark,erp.bom_no,erp.material_no,erp.material_name, erp.audit_status, erp.use_status,
erp.material_type, erp.process_method,erp.unit, erp.brand, erp.`describe`,erp.warehouseDept,erp.engineer, erp.material_type, erp.process_method,erp.unit, erp.material_model, erp.brand, erp.`describe`,erp.warehouseDept,erp.engineer,
erp.use_num,erp.loss_rate, erp.parent_id, erp.`level`, erp.sort_no, erp.instance_id, erp.use_num,erp.loss_rate, erp.parent_id, erp.`level`, erp.sort_no, erp.instance_id,
erp.instance_type, processDict.dict_label as instance_type_name, erp.submit_instance_id, erp.instance_type, processDict.dict_label as instance_type_name, erp.submit_instance_id,
erp.cancel_instance_id, erp.restore_instance_id,erp.apply_title,erp.apply_user,erp.apply_time, erp.cancel_instance_id, erp.restore_instance_id,erp.apply_title,erp.apply_user,erp.apply_time,
@ -492,7 +497,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectErpBomByMaterialNos" parameterType="String" resultMap="ErpBomResult"> <select id="selectErpBomByMaterialNos" parameterType="String" resultMap="ErpBomResult">
select erp.id, erp.del_flag, erp.create_by, erp.create_time, erp.update_by, erp.update_time, select erp.id, erp.del_flag, erp.create_by, erp.create_time, erp.update_by, erp.update_time,
erp.remark,erp.bom_no,erp.material_no,erp.material_name, erp.audit_status, erp.use_status, erp.remark,erp.bom_no,erp.material_no,erp.material_name, erp.audit_status, erp.use_status,
erp.material_type, erp.process_method,erp.unit, erp.brand, erp.`describe`,erp.warehouseDept,erp.engineer, erp.material_type, erp.process_method,erp.unit, erp.material_model, erp.brand, erp.`describe`,erp.warehouseDept,erp.engineer,
erp.use_num,erp.loss_rate, erp.parent_id, erp.`level`, erp.sort_no, erp.instance_id, erp.use_num,erp.loss_rate, erp.parent_id, erp.`level`, erp.sort_no, erp.instance_id,
erp.instance_type, processDict.dict_label as instance_type_name, erp.submit_instance_id, erp.instance_type, processDict.dict_label as instance_type_name, erp.submit_instance_id,
erp.cancel_instance_id, erp.restore_instance_id,erp.apply_title,erp.apply_user,erp.apply_time, erp.cancel_instance_id, erp.restore_instance_id,erp.apply_title,erp.apply_user,erp.apply_time,
@ -526,7 +531,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectErpBomByParentIds" parameterType="Map" resultMap="ErpBomResult"> <select id="selectErpBomByParentIds" parameterType="Map" resultMap="ErpBomResult">
select erp.id, erp.del_flag, erp.create_by, erp.create_time, erp.update_by, erp.update_time, select erp.id, erp.del_flag, erp.create_by, erp.create_time, erp.update_by, erp.update_time,
erp.remark,erp.bom_no,erp.material_no,erp.material_name, erp.audit_status, erp.use_status, erp.remark,erp.bom_no,erp.material_no,erp.material_name, erp.audit_status, erp.use_status,
erp.material_type, erp.process_method,erp.unit, erp.brand, erp.`describe`,erp.warehouseDept,erp.engineer, erp.material_type, erp.process_method,erp.unit, erp.material_model, erp.brand, erp.`describe`,erp.warehouseDept,erp.engineer,
erp.use_num,erp.loss_rate, erp.parent_id, erp.`level`, erp.sort_no, erp.instance_id, erp.use_num,erp.loss_rate, erp.parent_id, erp.`level`, erp.sort_no, erp.instance_id,
erp.instance_type, processDict.dict_label as instance_type_name, erp.submit_instance_id, erp.instance_type, processDict.dict_label as instance_type_name, erp.submit_instance_id,
erp.cancel_instance_id, erp.restore_instance_id,erp.apply_title,erp.apply_user,erp.apply_time, erp.cancel_instance_id, erp.restore_instance_id,erp.apply_title,erp.apply_user,erp.apply_time,
@ -560,7 +565,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectErpBomListByBomNos" parameterType="String" resultMap="ErpBomResult"> <select id="selectErpBomListByBomNos" parameterType="String" resultMap="ErpBomResult">
select erp.id, erp.del_flag, erp.create_by, erp.create_time, erp.update_by, erp.update_time, select erp.id, erp.del_flag, erp.create_by, erp.create_time, erp.update_by, erp.update_time,
erp.remark,erp.bom_no,erp.material_no,erp.material_name, erp.audit_status, erp.use_status, erp.remark,erp.bom_no,erp.material_no,erp.material_name, erp.audit_status, erp.use_status,
erp.material_type, erp.process_method,erp.unit, erp.brand, erp.`describe`,erp.warehouseDept,erp.engineer, erp.material_type, erp.process_method,erp.unit, erp.material_model, erp.brand, erp.`describe`,erp.warehouseDept,erp.engineer,
erp.use_num,erp.loss_rate, erp.parent_id, erp.`level`, erp.sort_no, erp.instance_id, erp.use_num,erp.loss_rate, erp.parent_id, erp.`level`, erp.sort_no, erp.instance_id,
erp.instance_type, processDict.dict_label as instance_type_name, erp.submit_instance_id, erp.instance_type, processDict.dict_label as instance_type_name, erp.submit_instance_id,
erp.cancel_instance_id, erp.restore_instance_id,erp.apply_title,erp.apply_user,erp.apply_time, erp.cancel_instance_id, erp.restore_instance_id,erp.apply_title,erp.apply_user,erp.apply_time,

9
ruoyi-admin/src/main/resources/templates/erp/bom/add.html

@ -61,6 +61,12 @@
</div> </div>
<input type="text" name="unit" readonly hidden /> <input type="text" name="unit" readonly hidden />
</div> </div>
<div class="form-group">
<label class="col-sm-3 control-label">型号:</label>
<div class="col-sm-8">
<input name="materialModel" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">品牌:</label> <label class="col-sm-3 control-label">品牌:</label>
<div class="col-sm-8"> <div class="col-sm-8">
@ -402,6 +408,7 @@
$.table.init(options); $.table.init(options);
}); });
//bom 物料检测和赋值
function materilalSelect(data) { function materilalSelect(data) {
var materialType1 = data.materialType.indexOf('yl'); var materialType1 = data.materialType.indexOf('yl');
var materialType2 = data.materialType.indexOf('fl'); var materialType2 = data.materialType.indexOf('fl');
@ -419,6 +426,7 @@
return; return;
} }
$("input[name='brand']").val(data.brand); $("input[name='brand']").val(data.brand);
$("input[name='materialModel']").val(data.materialModel);
$("textarea[name='describe']").val(data.describe); $("textarea[name='describe']").val(data.describe);
$("#selectMaterialType").val([data.materialType]).trigger("change"); $("#selectMaterialType").val([data.materialType]).trigger("change");
$("input[name='materialType']").val(data.materialType); $("input[name='materialType']").val(data.materialType);
@ -505,6 +513,7 @@
describe: rowData.describe, describe: rowData.describe,
processMethod: rowData.processMethod, processMethod: rowData.processMethod,
unit: rowData.unit, unit: rowData.unit,
materialModel: rowData.materialModel,
brand: rowData.brand, brand: rowData.brand,
warehouseDept: rowData.warehouseDept, warehouseDept: rowData.warehouseDept,
level: "1", level: "1",

Loading…
Cancel
Save