实现BOM管理增删改查

master
baogq 6 years ago
parent d7c1081508
commit 7e7974efb7

@ -129,6 +129,9 @@ public class BaseBomInfoController extends BaseController
@ResponseBody @ResponseBody
public AjaxResult addSave(BaseBomInfo baseBomInfo) public AjaxResult addSave(BaseBomInfo baseBomInfo)
{ {
BaseBomInfo pbaseBomInfo = new BaseBomInfo();
pbaseBomInfo = baseBomInfoService.selectBaseBomInfoBymaterialName(baseBomInfo);
baseBomInfo.setpId(pbaseBomInfo.getBomId());
return toAjax(baseBomInfoService.insertBaseBomInfo(baseBomInfo)); return toAjax(baseBomInfoService.insertBaseBomInfo(baseBomInfo));
} }
@ -139,6 +142,8 @@ public class BaseBomInfoController extends BaseController
public String edit(@PathVariable("objid") Long objid, ModelMap mmap) public String edit(@PathVariable("objid") Long objid, ModelMap mmap)
{ {
BaseBomInfo baseBomInfo = baseBomInfoService.selectBaseBomInfoById(objid); BaseBomInfo baseBomInfo = baseBomInfoService.selectBaseBomInfoById(objid);
mmap.put("cbmaterialtypeInfo",baseMaterialtypeInfoService.selectEditBaseMaterialtypeInfoList(baseBomInfo.getMaterialTypeId()));
mmap.put("cbmaterialInfo",baseMaterialInfoService.selectEditBaseMaterialInfoList(baseBomInfo.getMaterialId()));
mmap.put("baseBomInfo", baseBomInfo); mmap.put("baseBomInfo", baseBomInfo);
return prefix + "/edit"; return prefix + "/edit";
} }
@ -158,12 +163,16 @@ public class BaseBomInfoController extends BaseController
/** /**
* BOM * BOM
*/ */
@RequiresPermissions("baseinfo:bominfo:remove")
@Log(title = "BOM基础信息", businessType = BusinessType.DELETE) @Log(title = "BOM基础信息", businessType = BusinessType.DELETE)
@PostMapping( "/remove") @RequiresPermissions("system:dept:remove")
@GetMapping("/remove/{bomId}")
@ResponseBody @ResponseBody
public AjaxResult remove(String ids) public AjaxResult remove(@PathVariable("bomId") Long bomId)
{ {
return toAjax(baseBomInfoService.deleteBaseBomInfoByIds(ids)); if (baseBomInfoService.selectBomCount(bomId) > 0)
{
return AjaxResult.warn("存在下级节点,不允许删除");
}
return toAjax(baseBomInfoService.deleteBaseBomInfoById(bomId));
} }
} }

@ -23,19 +23,19 @@
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">物料类型ID</label> <label class="col-sm-3 control-label">物料类型名称</label>
<div class="col-sm-8"> <div class="col-sm-8">
<select name="materialTypeId" id="workingProcedureId" class="form-control "> <select name="materialTypeId" id="workingProcedureId" class="form-control ">
<option value="">--请选择物料类型--</option> <option value="">--请选择物料类型名称--</option>
<option name="cbmaterialtypeInfo" th:each="materialTypeId:${cbmaterialtypeInfo}" th:value="${materialTypeId.materialTypeId}" th:text="${materialTypeId.materialTypeName}" th:disabled="${materialTypeId.status == '1'}"></option> <option name="cbmaterialtypeInfo" th:each="materialTypeId:${cbmaterialtypeInfo}" th:value="${materialTypeId.materialTypeId}" th:text="${materialTypeId.materialTypeName}" th:disabled="${materialTypeId.status == '1'}"></option>
</select> </select>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">物料ID</label> <label class="col-sm-3 control-label">物料名称</label>
<div class="col-sm-8"> <div class="col-sm-8">
<select name="materialId" id="materialId" class="form-control "> <select name="materialId" id="materialId" class="form-control ">
<option value="">--请选择物料类型--</option> <option value="">--请选择物料名称--</option>
<option name="cbmaterialInfo" th:each="materialId:${cbmaterialInfo}" th:value="${materialId.materialId}" th:text="${materialId.materialName}" th:disabled="${materialId.status == '1'}"></option> <option name="cbmaterialInfo" th:each="materialId:${cbmaterialInfo}" th:value="${materialId.materialId}" th:text="${materialId.materialName}" th:disabled="${materialId.status == '1'}"></option>
</select> </select>
</div> </div>

@ -10,10 +10,10 @@
<form id="formId"> <form id="formId">
<div class="select-list"> <div class="select-list">
<ul> <ul>
<li> <!-- <li>-->
<label>父节点ID</label> <!-- <label>父节点ID</label>-->
<input type="text" name="pId"/> <!-- <input type="text" name="pId"/>-->
</li> <!-- </li>-->
<li> <li>
<label>物料类型:</label> <label>物料类型:</label>
<select name="materialTypeId"> <select name="materialTypeId">
@ -114,8 +114,8 @@
align: "left", align: "left",
formatter: function(value, row, index) { formatter: function(value, row, index) {
var actions = []; var actions = [];
actions.push('<a class="btn btn-info btn-xs ' + addFlag + '" href="javascript:void(0)" onclick="$.operate.add(\'' + row.bomId + '\')"><i class="fa fa-plus"></i>新增物料</a> ');
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.bomId + '\')"><i class="fa fa-edit"></i>编辑</a> '); actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.bomId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
actions.push('<a class="btn btn-info btn-xs ' + addFlag + '" href="javascript:void(0)" onclick="$.operate.add(\'' + row.bomId + '\')"><i class="fa fa-plus"></i>新增</a> ');
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.bomId + '\')"><i class="fa fa-remove"></i>删除</a>'); actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.bomId + '\')"><i class="fa fa-remove"></i>删除</a>');
return actions.join(''); return actions.join('');
} }

@ -2,11 +2,13 @@
<html lang="zh" xmlns:th="http://www.thymeleaf.org" > <html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head> <head>
<th:block th:include="include :: header('修改BOM基础信息')" /> <th:block th:include="include :: header('修改BOM基础信息')" />
<th:block th:include="include :: jasny-bootstrap-css" />
<th:block th:include="include :: datetimepicker-css" />
</head> </head>
<body class="white-bg"> <body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content"> <div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-bominfo-edit" th:object="${baseBomInfo}"> <form class="form-horizontal m" id="form-bominfo-edit" th:object="${baseBomInfo}">
<input name="objid" th:field="*{objid}" type="hidden"> <input name="bomId" th:field="*{bomId}" type="hidden">
<!-- <div class="form-group"> --> <!-- <div class="form-group"> -->
<!-- <label class="col-sm-3 control-label">父节点ID</label>--> <!-- <label class="col-sm-3 control-label">父节点ID</label>-->
<!-- <div class="col-sm-8">--> <!-- <div class="col-sm-8">-->
@ -14,21 +16,27 @@
<!-- </div>--> <!-- </div>-->
<!-- </div>--> <!-- </div>-->
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">物料类型ID</label> <label class="col-sm-3 control-label">物料类型名称</label>
<div class="col-sm-8"> <div class="col-sm-8">
<select name="materialTypeId" class="form-control m-b"> <select name="materialTypeId" th:id="materialTypeId" class="form-control m-b">
<option value="">所有</option> <option name="cbmaterialtypeInfo" th:each="materialTypeId:${cbmaterialtypeInfo}" th:value="${materialTypeId.materialTypeId}" th:text="${materialTypeId.materialTypeName}" th:selected="${materialTypeId.flag}" th:disabled="${materialTypeId.status == '1'}"></option>
</select> </select>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">物料ID</label> <label class="col-sm-3 control-label">物料名称</label>
<div class="col-sm-8"> <div class="col-sm-8">
<select name="materialId" class="form-control m-b"> <select name="materialId" th:id="materialId" class="form-control m-b">
<option value="">所有</option> <option name="cbmaterialInfo" th:each="materialId:${cbmaterialInfo}" th:value="${materialId.materialId}" th:text="${materialId.materialName}" th:selected="${materialId.flag}" th:disabled="${materialId.status == '1'}"></option>
</select> </select>
</div> </div>
</div> </div>
<div class="form-group">
<label class="col-sm-3 control-label">备注:</label>
<div class="col-sm-8">
<input name="remark" th:field="*{remark}" class="form-control" type="text">
</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">
@ -41,6 +49,8 @@
</form> </form>
</div> </div>
<th:block th:include="include :: footer" /> <th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<th:block th:include="include :: jasny-bootstrap-js" />
<script th:inline="javascript"> <script th:inline="javascript">
var prefix = ctx + "baseinfo/bominfo"; var prefix = ctx + "baseinfo/bominfo";
$("#form-bominfo-edit").validate({ $("#form-bominfo-edit").validate({

@ -1,73 +1,77 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" > <html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head> <head>
<th:block th:include="include :: header('修改设备基础信息')" /> <th:block th:include="include :: header('修改设备基础信息')" />
</head> <th:block th:include="include :: jasny-bootstrap-css" />
<body class="white-bg"> <th:block th:include="include :: datetimepicker-css" />
<div class="wrapper wrapper-content animated fadeInRight ibox-content"> </head>
<form class="form-horizontal m" id="form-deviceinfo-edit" th:object="${baseDeviceInfo}"> <body class="white-bg">
<input name="objid" th:field="*{objid}" type="hidden"> <div class="wrapper wrapper-content animated fadeInRight ibox-content">
<div class="form-group"> <form class="form-horizontal m" id="form-deviceinfo-edit" th:object="${baseDeviceInfo}">
<label class="col-sm-3 control-label">设备ID</label> <input name="objid" th:field="*{objid}" type="hidden">
<div class="col-sm-8"> <div class="form-group">
<input name="deviceId" th:field="*{deviceId}" class="form-control" type="text"> <label class="col-sm-3 control-label">设备ID</label>
</div> <div class="col-sm-8">
</div> <input name="deviceId" th:field="*{deviceId}" class="form-control" type="text">
<div class="form-group"> </div>
<label class="col-sm-3 control-label">设备名称:</label> </div>
<div class="col-sm-8"> <div class="form-group">
<input name="deviceName" th:field="*{deviceName}" class="form-control" type="text"> <label class="col-sm-3 control-label">设备名称:</label>
</div> <div class="col-sm-8">
</div> <input name="deviceName" th:field="*{deviceName}" class="form-control" type="text">
<div class="form-group"> </div>
<label class="col-sm-3 control-label">所属工序:</label> </div>
<div class="col-sm-8"> <div class="form-group">
<select name="workingProcedureId" id="workingProcedureId" th:id="postId" class="form-control m-b"> <label class="col-sm-3 control-label">所属工序:</label>
<option name="cbEditWorkingProcedureInfo" th:each="workingProcedureId:${cbEditWorkingProcedureInfo}" th:value="${workingProcedureId.workingProcedureId}" th:text="${workingProcedureId.workingProcedureName}" th:selected="${workingProcedureId.flag}" th:disabled="${workingProcedureId.status == '1'}"></option> <div class="col-sm-8">
</select> <select name="workingProcedureId" id="workingProcedureId" th:id="postId" class="form-control m-b">
</div> <option name="cbEditWorkingProcedureInfo" th:each="workingProcedureId:${cbEditWorkingProcedureInfo}" th:value="${workingProcedureId.workingProcedureId}" th:text="${workingProcedureId.workingProcedureName}" th:selected="${workingProcedureId.flag}" th:disabled="${workingProcedureId.status == '1'}"></option>
</div> </select>
<div class="form-group"> </div>
<label class="col-sm-3 control-label">价格:</label> </div>
<div class="col-sm-8"> <div class="form-group">
<input name="price" th:field="*{price}" class="form-control" type="text"> <label class="col-sm-3 control-label">价格:</label>
</div> <div class="col-sm-8">
</div> <input name="price" th:field="*{price}" class="form-control" type="text">
<div class="form-group"> </div>
<label class="col-sm-3 control-label">设备规格型号:</label> </div>
<div class="col-sm-8"> <div class="form-group">
<input name="deviceType" th:field="*{deviceType}" class="form-control" type="text"> <label class="col-sm-3 control-label">设备规格型号:</label>
</div> <div class="col-sm-8">
</div> <input name="deviceType" th:field="*{deviceType}" class="form-control" type="text">
<div class="form-group"> </div>
<label class="col-sm-3 control-label">备注:</label> </div>
<div class="col-sm-8"> <div class="form-group">
<input name="remark" th:field="*{remark}" class="form-control" type="text"> <label class="col-sm-3 control-label">备注:</label>
</div> <div class="col-sm-8">
</div> <input name="remark" th:field="*{remark}" class="form-control" type="text">
<div class="form-group"> </div>
<label class="col-sm-3 control-label">状态标志:</label> </div>
<div class="col-sm-8"> <div class="form-group">
<div class="radio-box" th:each="dict : ${@dict.getType('sys_status_info')}"> <label class="col-sm-3 control-label">状态标志:</label>
<input type="radio" th:id="${'status_' + dict.dictCode}" name="status" th:value="${dict.dictValue}" th:field="*{status}"> <div class="col-sm-8">
<label th:for="${'status_' + dict.dictCode}" th:text="${dict.dictLabel}"></label> <div class="radio-box" th:each="dict : ${@dict.getType('sys_status_info')}">
</div> <input type="radio" th:id="${'status_' + dict.dictCode}" name="status" th:value="${dict.dictValue}" th:field="*{status}">
</div> <label th:for="${'status_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
</div> </div>
</form> </div>
</div> </div>
<th:block th:include="include :: footer" /> </form>
<script th:inline="javascript"> </div>
var prefix = ctx + "baseinfo/deviceinfo"; <th:block th:include="include :: footer" />
$("#form-deviceinfo-edit").validate({ <th:block th:include="include :: datetimepicker-js" />
focusCleanup: true <th:block th:include="include :: jasny-bootstrap-js" />
}); <script th:inline="javascript">
var prefix = ctx + "baseinfo/deviceinfo";
function submitHandler() { $("#form-deviceinfo-edit").validate({
if ($.validate.form()) { focusCleanup: true
$.operate.save(prefix + "/edit", $('#form-deviceinfo-edit').serialize()); });
}
} function submitHandler() {
</script> if ($.validate.form()) {
</body> $.operate.save(prefix + "/edit", $('#form-deviceinfo-edit').serialize());
}
}
</script>
</body>
</html> </html>

@ -1,161 +1,162 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="zh"> <html lang="zh">
<head> <head>
<th:block th:include="include :: header('多级联动下拉')" /> <th:block th:include="include :: header('多级联动下拉')" />
</head> </head>
<body class="gray-bg"> <body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight"> <div class="wrapper wrapper-content animated fadeInRight">
<div class="row"> <div class="row">
<div class="col-sm-12"> <div class="col-sm-12">
<div class="ibox float-e-margins"> <div class="ibox float-e-margins">
<div class="ibox-title"> <div class="ibox-title">
<h5>多级联动下拉<small>https://github.com/ciaoca/cxSelect</small></h5> <h5>多级联动下拉<small>https://github.com/ciaoca/cxSelect</small></h5>
</div> </div>
<div class="ibox-content"> <div class="ibox-content">
<p>简单联动示例。</p> <p>简单联动示例。</p>
<div id="element" class="row"> <div id="element" class="row">
<div class="col-sm-2"> <div class="col-sm-2">
<select class="type form-control m-b" data-first-title="请选择"> <select class="type form-control m-b" data-first-title="请选择">
<option value="">请选择</option> <option value="">请选择</option>
</select> </select>
</div> </div>
<div class="col-sm-2"> <div class="col-sm-2">
<select class="router form-control m-b" data-first-title="请选择"> <select class="router form-control m-b" data-first-title="请选择">
<option value="">请选择</option> <option value="">请选择</option>
</select> </select>
</div> </div>
</div> </div>
<hr> <hr>
<p>国内省市区联动。</p> <p>国内省市区联动。</p>
<div id="element1" class="row"> <div id="element1" class="row">
<div class="col-sm-2"> <div class="col-sm-2">
<select class="province form-control m-b" data-first-title="选择省"> <select class="province form-control m-b" data-first-title="选择省">
<option value="">请选择</option> <option value="">请选择</option>
<option value="广东省" selected>广东省</option> <option value="广东省" selected>广东省</option>
</select> </select>
</div> </div>
<div class="col-sm-2"> <div class="col-sm-2">
<select class="city form-control m-b" data-first-title="选择市"> <select class="city form-control m-b" data-first-title="选择市">
<option value="">请选择</option> <option value="">请选择</option>
<option value="深圳市" selected>深圳市</option> <option value="深圳市" selected>深圳市</option>
</select> </select>
</div> </div>
<div class="col-sm-2"> <div class="col-sm-2">
<select class="area form-control m-b" data-first-title="选择地区"> <select class="area form-control m-b" data-first-title="选择地区">
<option value="">请选择</option> <option value="">请选择</option>
<option value="南山区" selected>南山区</option> <option value="南山区" selected>南山区</option>
</select> </select>
</div> </div>
</div> </div>
<hr> <hr>
<p>自定义选项。</p> <p>自定义选项。</p>
<div id="element2" class="row"> <div id="element2" class="row">
<div class="col-sm-2"> <div class="col-sm-2">
<select class="first form-control m-b"></select> <select class="first form-control m-b"></select>
</div> </div>
<div class="col-sm-2"> <div class="col-sm-2">
<select class="second form-control m-b"></select> <select class="second form-control m-b"></select>
</div> </div>
<div class="col-sm-2"> <div class="col-sm-2">
<select class="third form-control m-b"></select> <select class="third form-control m-b"></select>
</div> </div>
<div class="col-sm-2"> <div class="col-sm-2">
<select class="fourth form-control m-b"></select> <select class="fourth form-control m-b"></select>
</div> </div>
<div class="col-sm-2"> <div class="col-sm-2">
<select class="fifth form-control m-b"></select> <select class="fifth form-control m-b"></select>
</div> </div>
</div> </div>
<hr> <hr>
<div class="form-group"> <div class="form-group">
<label class="font-noraml">相关参数详细信息</label> <label class="font-noraml">相关参数详细信息</label>
<div><a href="http://doc.ruoyi.vip/ruoyi/document/zjwd.html#jquery-cxselect" target="_blank">http://doc.ruoyi.vip/ruoyi/document/zjwd.html#jquery-cxselect</a></div> <div><a href="http://doc.ruoyi.vip/ruoyi/document/zjwd.html#jquery-cxselect" target="_blank">http://doc.ruoyi.vip/ruoyi/document/zjwd.html#jquery-cxselect</a></div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<th:block th:include="include :: footer" /> <th:block th:include="include :: footer" />
<th:block th:include="include :: jquery-cxselect-js" /> <th:block th:include="include :: jquery-cxselect-js" />
<script th:inline="javascript"> <script th:inline="javascript">
// 直接返回获取 // 直接返回获取
var data = [[${data}]]; var data = [[${data}]];
$('#element').cxSelect({ console.log(data);
selects: ['type', 'router'], $('#element').cxSelect({
jsonValue: 'v', selects: ['type', 'router'],
data: data jsonValue: 'v',
}); data: data
});
// 通过默认url获取
var urlChina = 'cityData'; // 通过默认url获取
$.cxSelect.defaults.url = urlChina; var urlChina = 'cityData';
$('#element1').cxSelect({ $.cxSelect.defaults.url = urlChina;
selects: ['province', 'city', 'area'], $('#element1').cxSelect({
nodata: 'none' selects: ['province', 'city', 'area'],
}); nodata: 'none'
});
// 固定值获取
$('#element2').cxSelect({ // 固定值获取
selects: ['first', 'second', 'third', 'fourth', 'fifth'], $('#element2').cxSelect({
required: true, selects: ['first', 'second', 'third', 'fourth', 'fifth'],
jsonValue: 'v', required: true,
data: [ jsonValue: 'v',
{'v': '1', 'n': '第一级 >', 's': [ data: [
{'v': '2', 'n': '第二级 >', 's': [ {'v': '1', 'n': '第一级 >', 's': [
{'v': '3', 'n': '第三级 >', 's': [ {'v': '2', 'n': '第二级 >', 's': [
{'v': '4', 'n': '第四级 >', 's': [ {'v': '3', 'n': '第三级 >', 's': [
{'v': '5', 'n': '第五级 >', 's': [ {'v': '4', 'n': '第四级 >', 's': [
{'v': '6', 'n': '第六级 >'} {'v': '5', 'n': '第五级 >', 's': [
]} {'v': '6', 'n': '第六级 >'}
]} ]}
]} ]}
]} ]}
]}, ]}
{'v': 'test number', 'n': '测试数字', 's': [ ]},
{'v': 'text', 'n': '文本类型', 's': [ {'v': 'test number', 'n': '测试数字', 's': [
{'v': '4', 'n': '4'}, {'v': 'text', 'n': '文本类型', 's': [
{'v': '5', 'n': '5'}, {'v': '4', 'n': '4'},
{'v': '6', 'n': '6'}, {'v': '5', 'n': '5'},
{'v': '7', 'n': '7'}, {'v': '6', 'n': '6'},
{'v': '8', 'n': '8'}, {'v': '7', 'n': '7'},
{'v': '9', 'n': '9'}, {'v': '8', 'n': '8'},
{'v': '10', 'n': '10'} {'v': '9', 'n': '9'},
]}, {'v': '10', 'n': '10'}
{'v': 'number', 'n': '数值类型', 's': [ ]},
{'v': 11, 'n': 11}, {'v': 'number', 'n': '数值类型', 's': [
{'v': 12, 'n': 12}, {'v': 11, 'n': 11},
{'v': 13, 'n': 13}, {'v': 12, 'n': 12},
{'v': 14, 'n': 14}, {'v': 13, 'n': 13},
{'v': 15, 'n': 15}, {'v': 14, 'n': 14},
{'v': 16, 'n': 16}, {'v': 15, 'n': 15},
{'v': 17, 'n': 17} {'v': 16, 'n': 16},
]} {'v': 17, 'n': 17}
]}, ]}
{'v': 'test boolean','n': '测试 Boolean 类型', 's': [ ]},
{'v': true ,'n': true}, {'v': 'test boolean','n': '测试 Boolean 类型', 's': [
{'v': false ,'n': false} {'v': true ,'n': true},
]}, {'v': false ,'n': false}
{v: 'test quotes', n: '测试属性不加引号', s: [ ]},
{v: 'quotes', n: '引号'} {v: 'test quotes', n: '测试属性不加引号', s: [
]}, {v: 'quotes', n: '引号'}
{v: 'test other', n: '测试奇怪的值', s: [ ]},
{v: '[]', n: '数组(空)'}, {v: 'test other', n: '测试奇怪的值', s: [
{v: [1,2,3], n: '数组(数值)'}, {v: '[]', n: '数组(空)'},
{v: ['a','b','c'], n: '数组(文字)'}, {v: [1,2,3], n: '数组(数值)'},
{v: new Date(), n: '日期'}, {v: ['a','b','c'], n: '数组(文字)'},
{v: new RegExp('\\d+'), n: '正则对象'}, {v: new Date(), n: '日期'},
{v: /\d+/, n: '正则直接量'}, {v: new RegExp('\\d+'), n: '正则对象'},
{v: {}, n: '对象'}, {v: /\d+/, n: '正则直接量'},
{v: document.getElementById('custom_data'), n: 'DOM'}, {v: {}, n: '对象'},
{v: null, n: 'Null'}, {v: document.getElementById('custom_data'), n: 'DOM'},
{n: '未设置 value'} {v: null, n: 'Null'},
]}, {n: '未设置 value'}
{'v': '' , 'n': '无子级'} ]},
] {'v': '' , 'n': '无子级'}
}); ]
</script> });
</body> </script>
</html> </body>
</html>

@ -58,4 +58,20 @@ public interface BaseBomInfoMapper
* @return * @return
*/ */
public int deleteBaseBomInfoByIds(String[] objids); public int deleteBaseBomInfoByIds(String[] objids);
/**
* BOM
*
* @param materialName BOM
* @return
*/
public BaseBomInfo selectBaseBomInfoBymaterialName(BaseBomInfo baseBomInfo);
/**
* BOM
*
* @param parentId ID
* @return
*/
public int selectBomCount(BaseBomInfo baseBomInfo);
} }

@ -58,4 +58,20 @@ public interface IBaseBomInfoService
* @return * @return
*/ */
public int deleteBaseBomInfoById(Long objid); public int deleteBaseBomInfoById(Long objid);
/**
* BOM
*
* @param baseBomInfo BOM
* @return
*/
public BaseBomInfo selectBaseBomInfoBymaterialName(BaseBomInfo baseBomInfo);
/**
* BOM
*
* @param parentId ID
* @return
*/
public int selectBomCount(Long parentId);
} }

@ -2,6 +2,7 @@ package com.ruoyi.baseinfo.service.impl;
import java.util.List; import java.util.List;
import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.domain.SysDept;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.ruoyi.baseinfo.mapper.BaseBomInfoMapper; import com.ruoyi.baseinfo.mapper.BaseBomInfoMapper;
@ -94,4 +95,16 @@ public class BaseBomInfoServiceImpl implements IBaseBomInfoService
{ {
return baseBomInfoMapper.deleteBaseBomInfoById(objid); return baseBomInfoMapper.deleteBaseBomInfoById(objid);
} }
@Override
public BaseBomInfo selectBaseBomInfoBymaterialName(BaseBomInfo baseBomInfo) {
return baseBomInfoMapper.selectBaseBomInfoBymaterialName(baseBomInfo);
}
@Override
public int selectBomCount(Long parentId) {
BaseBomInfo baseBomInfo = new BaseBomInfo();
baseBomInfo.setpId(parentId);
return baseBomInfoMapper.selectBomCount(baseBomInfo);
}
} }

@ -102,4 +102,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</delete> </delete>
<select id="selectBaseBomInfoBymaterialName" parameterType="BaseBomInfo" resultMap="BaseBomInfoResult">
select t1.bom_id, t1.p_id, t1.material_type_id,t2.material_type_name, t1.material_id,t3.material_name, t1.status, t1.remark, t1.create_by, t1.create_time, t1.update_by, t1.update_time, t1.del_flag from base_bom_info t1
left join dbo.base_materialtype_info t2 on t1.material_type_id = t2.material_type_id
left join dbo.base_material_info t3 on t1.material_id = t3.material_id
<where>
<if test="pId != null and pId != ''"> and t1.p_id = #{pId}</if>
<if test="materialName != null and materialName != ''"> and t3.material_name = #{materialName}</if>
<if test="materialTypeId != null and materialTypeId != ''"> and t1.material_type_id = #{materialTypeId}</if>
<if test="materialId != null and materialId != ''"> and t1.material_id = #{materialId}</if>
<if test="status != null and status != ''"> and t1.status = #{status}</if>
</where>
</select>
<select id="selectBomCount" parameterType="BaseBomInfo" resultType="int">
select count(1) from base_bom_info
where del_flag = '0'
<if test="bomId != null and bomId != 0"> and bom_id = #{bomId} </if>
<if test="pId != null and pId != 0"> and p_id = #{pId} </if>
</select>
</mapper> </mapper>

Loading…
Cancel
Save