parent
8bea666e2a
commit
0cc2be243b
@ -0,0 +1,129 @@
|
|||||||
|
package com.ruoyi.web.controller.basic;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.ruoyi.web.controller.tool.UUIDTool;
|
||||||
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.ui.ModelMap;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
|
import com.ruoyi.common.annotation.Log;
|
||||||
|
import com.ruoyi.common.enums.BusinessType;
|
||||||
|
import com.ruoyi.system.domain.BaseMaterialInfo;
|
||||||
|
import com.ruoyi.system.service.IBaseMaterialInfoService;
|
||||||
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||||
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物料信息Controller
|
||||||
|
*
|
||||||
|
* @author Frank zhou
|
||||||
|
* @date 2021-09-10
|
||||||
|
*/
|
||||||
|
@Controller
|
||||||
|
@RequestMapping("/system/basematerialInfo")
|
||||||
|
public class BaseMaterialInfoController extends BaseController
|
||||||
|
{
|
||||||
|
private String prefix = "system/basematerialInfo";
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IBaseMaterialInfoService baseMaterialInfoService;
|
||||||
|
|
||||||
|
@RequiresPermissions("system:basematerialInfo:view")
|
||||||
|
@GetMapping()
|
||||||
|
public String basematerialInfo()
|
||||||
|
{
|
||||||
|
return prefix + "/basematerialInfo";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询物料信息列表
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("system:basematerialInfo:list")
|
||||||
|
@PostMapping("/list")
|
||||||
|
@ResponseBody
|
||||||
|
public TableDataInfo list(BaseMaterialInfo baseMaterialInfo)
|
||||||
|
{
|
||||||
|
startPage();
|
||||||
|
List<BaseMaterialInfo> list = baseMaterialInfoService.selectBaseMaterialInfoList(baseMaterialInfo);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出物料信息列表
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("system:basematerialInfo:export")
|
||||||
|
@Log(title = "物料信息", businessType = BusinessType.EXPORT)
|
||||||
|
@PostMapping("/export")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult export(BaseMaterialInfo baseMaterialInfo)
|
||||||
|
{
|
||||||
|
List<BaseMaterialInfo> list = baseMaterialInfoService.selectBaseMaterialInfoList(baseMaterialInfo);
|
||||||
|
ExcelUtil<BaseMaterialInfo> util = new ExcelUtil<BaseMaterialInfo>(BaseMaterialInfo.class);
|
||||||
|
return util.exportExcel(list, "物料信息数据");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增物料信息
|
||||||
|
*/
|
||||||
|
@GetMapping("/add")
|
||||||
|
public String add()
|
||||||
|
{
|
||||||
|
return prefix + "/add";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增保存物料信息
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("system:basematerialInfo:add")
|
||||||
|
@Log(title = "物料信息", businessType = BusinessType.INSERT)
|
||||||
|
@PostMapping("/add")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult addSave(BaseMaterialInfo baseMaterialInfo)
|
||||||
|
{
|
||||||
|
baseMaterialInfo.setObjid(UUIDTool.generate());
|
||||||
|
return toAjax(baseMaterialInfoService.insertBaseMaterialInfo(baseMaterialInfo));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改物料信息
|
||||||
|
*/
|
||||||
|
@GetMapping("/edit/{objid}")
|
||||||
|
public String edit(@PathVariable("objid") String objid, ModelMap mmap)
|
||||||
|
{
|
||||||
|
BaseMaterialInfo baseMaterialInfo = baseMaterialInfoService.selectBaseMaterialInfoByObjid(objid);
|
||||||
|
mmap.put("baseMaterialInfo", baseMaterialInfo);
|
||||||
|
return prefix + "/edit";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改保存物料信息
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("system:basematerialInfo:edit")
|
||||||
|
@Log(title = "物料信息", businessType = BusinessType.UPDATE)
|
||||||
|
@PostMapping("/edit")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult editSave(BaseMaterialInfo baseMaterialInfo)
|
||||||
|
{
|
||||||
|
return toAjax(baseMaterialInfoService.updateBaseMaterialInfo(baseMaterialInfo));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除物料信息
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("system:basematerialInfo:remove")
|
||||||
|
@Log(title = "物料信息", businessType = BusinessType.DELETE)
|
||||||
|
@PostMapping( "/remove")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult remove(String ids)
|
||||||
|
{
|
||||||
|
return toAjax(baseMaterialInfoService.deleteBaseMaterialInfoByObjids(ids));
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,16 @@
|
|||||||
|
package com.ruoyi.web.controller.tool;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author Frankzhou
|
||||||
|
* @Date 2021/9/10 9:47
|
||||||
|
* @Description
|
||||||
|
*/
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
public class UUIDTool {
|
||||||
|
|
||||||
|
public static String generate(){
|
||||||
|
return String.valueOf(UUID.randomUUID());
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,84 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
|
||||||
|
<head>
|
||||||
|
<th:block th:include="include :: header('新增物料信息')" />
|
||||||
|
<th:block th:include="include :: datetimepicker-css" />
|
||||||
|
</head>
|
||||||
|
<body class="white-bg">
|
||||||
|
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
|
||||||
|
<form class="form-horizontal m" id="form-basematerialInfo-add">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">物料类别编码:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<input name="materialCode" 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="materialName" 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="materialType" 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="materialSize" 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="materialHeight" 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="materialWeight" 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="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">
|
||||||
|
<div class="input-group date">
|
||||||
|
<input name="recordTime" class="form-control" placeholder="yyyy-MM-dd" type="text">
|
||||||
|
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
<th:block th:include="include :: footer" />
|
||||||
|
<th:block th:include="include :: datetimepicker-js" />
|
||||||
|
<script th:inline="javascript">
|
||||||
|
var prefix = ctx + "system/basematerialInfo"
|
||||||
|
$("#form-basematerialInfo-add").validate({
|
||||||
|
focusCleanup: true
|
||||||
|
});
|
||||||
|
|
||||||
|
function submitHandler() {
|
||||||
|
if ($.validate.form()) {
|
||||||
|
$.operate.save(prefix + "/add", $('#form-basematerialInfo-add').serialize());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$("input[name='recordTime']").datetimepicker({
|
||||||
|
format: "yyyy-mm-dd",
|
||||||
|
minView: "month",
|
||||||
|
autoclose: true
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
@ -0,0 +1,118 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
|
||||||
|
<head>
|
||||||
|
<th:block th:include="include :: header('物料信息列表')" />
|
||||||
|
</head>
|
||||||
|
<body class="gray-bg">
|
||||||
|
<div class="container-div">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm-12 search-collapse">
|
||||||
|
<form id="formId">
|
||||||
|
<div class="select-list">
|
||||||
|
<ul>
|
||||||
|
<li>
|
||||||
|
<label>物料类别编码:</label>
|
||||||
|
<input type="text" name="materialCode"/>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<label>物料名称:</label>
|
||||||
|
<input type="text" name="materialName"/>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a>
|
||||||
|
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i> 重置</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="btn-group-sm" id="toolbar" role="group">
|
||||||
|
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:basematerialInfo:add">
|
||||||
|
<i class="fa fa-plus"></i> 添加
|
||||||
|
</a>
|
||||||
|
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="system:basematerialInfo:edit">
|
||||||
|
<i class="fa fa-edit"></i> 修改
|
||||||
|
</a>
|
||||||
|
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:basematerialInfo:remove">
|
||||||
|
<i class="fa fa-remove"></i> 删除
|
||||||
|
</a>
|
||||||
|
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:basematerialInfo:export">
|
||||||
|
<i class="fa fa-download"></i> 导出
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
<div class="col-sm-12 select-table table-striped">
|
||||||
|
<table id="bootstrap-table"></table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<th:block th:include="include :: footer" />
|
||||||
|
<script th:inline="javascript">
|
||||||
|
var editFlag = [[${@permission.hasPermi('system:basematerialInfo:edit')}]];
|
||||||
|
var removeFlag = [[${@permission.hasPermi('system:basematerialInfo:remove')}]];
|
||||||
|
var prefix = ctx + "system/basematerialInfo";
|
||||||
|
|
||||||
|
$(function() {
|
||||||
|
var options = {
|
||||||
|
url: prefix + "/list",
|
||||||
|
createUrl: prefix + "/add",
|
||||||
|
updateUrl: prefix + "/edit/{id}",
|
||||||
|
removeUrl: prefix + "/remove",
|
||||||
|
exportUrl: prefix + "/export",
|
||||||
|
modalName: "物料信息",
|
||||||
|
columns: [{
|
||||||
|
checkbox: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'objid',
|
||||||
|
title: '主键',
|
||||||
|
visible: false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'materialCode',
|
||||||
|
title: '物料类别编码'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'materialName',
|
||||||
|
title: '物料名称'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'materialType',
|
||||||
|
title: '物料类别'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'materialSize',
|
||||||
|
title: '物料尺寸'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'materialHeight',
|
||||||
|
title: '物料高度'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'materialWeight',
|
||||||
|
title: '物料重量'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'remark',
|
||||||
|
title: '备注'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'recordTime',
|
||||||
|
title: '记录时间'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '操作',
|
||||||
|
align: 'center',
|
||||||
|
formatter: function(value, row, index) {
|
||||||
|
var actions = [];
|
||||||
|
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.objid + '\')"><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.objid + '\')"><i class="fa fa-remove"></i>删除</a>');
|
||||||
|
return actions.join('');
|
||||||
|
}
|
||||||
|
}]
|
||||||
|
};
|
||||||
|
$.table.init(options);
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
@ -0,0 +1,85 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
|
||||||
|
<head>
|
||||||
|
<th:block th:include="include :: header('修改物料信息')" />
|
||||||
|
<th:block th:include="include :: datetimepicker-css" />
|
||||||
|
</head>
|
||||||
|
<body class="white-bg">
|
||||||
|
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
|
||||||
|
<form class="form-horizontal m" id="form-basematerialInfo-edit" th:object="${baseMaterialInfo}">
|
||||||
|
<input name="objid" th:field="*{objid}" type="hidden">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">物料类别编码:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<input name="materialCode" th:field="*{materialCode}" 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="materialName" th:field="*{materialName}" 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="materialType" th:field="*{materialType}" 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="materialSize" th:field="*{materialSize}" 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="materialHeight" th:field="*{materialHeight}" 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="materialWeight" th:field="*{materialWeight}" 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="remark" th:field="*{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">
|
||||||
|
<div class="input-group date">
|
||||||
|
<input name="recordTime" th:value="${#dates.format(baseMaterialInfo.recordTime, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">
|
||||||
|
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
<th:block th:include="include :: footer" />
|
||||||
|
<th:block th:include="include :: datetimepicker-js" />
|
||||||
|
<script th:inline="javascript">
|
||||||
|
var prefix = ctx + "system/basematerialInfo";
|
||||||
|
$("#form-basematerialInfo-edit").validate({
|
||||||
|
focusCleanup: true
|
||||||
|
});
|
||||||
|
|
||||||
|
function submitHandler() {
|
||||||
|
if ($.validate.form()) {
|
||||||
|
$.operate.save(prefix + "/edit", $('#form-basematerialInfo-edit').serialize());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$("input[name='recordTime']").datetimepicker({
|
||||||
|
format: "yyyy-mm-dd",
|
||||||
|
minView: "month",
|
||||||
|
autoclose: true
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
@ -0,0 +1,152 @@
|
|||||||
|
package com.ruoyi.system.domain;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
|
import com.ruoyi.common.annotation.Excel;
|
||||||
|
import com.ruoyi.common.core.domain.BaseEntity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物料信息对象 base_material_info
|
||||||
|
*
|
||||||
|
* @author Frank zhou
|
||||||
|
* @date 2021-09-10
|
||||||
|
*/
|
||||||
|
public class BaseMaterialInfo extends BaseEntity
|
||||||
|
{
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** 主键 */
|
||||||
|
private String objid;
|
||||||
|
|
||||||
|
/** 物料类别编码 */
|
||||||
|
@Excel(name = "物料类别编码")
|
||||||
|
private String materialCode;
|
||||||
|
|
||||||
|
/** 物料名称 */
|
||||||
|
@Excel(name = "物料名称")
|
||||||
|
private String materialName;
|
||||||
|
|
||||||
|
/** 物料类别 */
|
||||||
|
@Excel(name = "物料类别")
|
||||||
|
private String materialType;
|
||||||
|
|
||||||
|
/** 物料尺寸 */
|
||||||
|
@Excel(name = "物料尺寸")
|
||||||
|
private Long materialSize;
|
||||||
|
|
||||||
|
/** 物料高度 */
|
||||||
|
@Excel(name = "物料高度")
|
||||||
|
private Long materialHeight;
|
||||||
|
|
||||||
|
/** 物料重量 */
|
||||||
|
@Excel(name = "物料重量")
|
||||||
|
private Long materialWeight;
|
||||||
|
|
||||||
|
/** 删除标志 */
|
||||||
|
private Long deleteFlag;
|
||||||
|
|
||||||
|
/** 记录时间 */
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
@Excel(name = "记录时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||||
|
private Date recordTime;
|
||||||
|
|
||||||
|
public void setObjid(String objid)
|
||||||
|
{
|
||||||
|
this.objid = objid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getObjid()
|
||||||
|
{
|
||||||
|
return objid;
|
||||||
|
}
|
||||||
|
public void setMaterialCode(String materialCode)
|
||||||
|
{
|
||||||
|
this.materialCode = materialCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMaterialCode()
|
||||||
|
{
|
||||||
|
return materialCode;
|
||||||
|
}
|
||||||
|
public void setMaterialName(String materialName)
|
||||||
|
{
|
||||||
|
this.materialName = materialName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMaterialName()
|
||||||
|
{
|
||||||
|
return materialName;
|
||||||
|
}
|
||||||
|
public void setMaterialType(String materialType)
|
||||||
|
{
|
||||||
|
this.materialType = materialType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMaterialType()
|
||||||
|
{
|
||||||
|
return materialType;
|
||||||
|
}
|
||||||
|
public void setMaterialSize(Long materialSize)
|
||||||
|
{
|
||||||
|
this.materialSize = materialSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getMaterialSize()
|
||||||
|
{
|
||||||
|
return materialSize;
|
||||||
|
}
|
||||||
|
public void setMaterialHeight(Long materialHeight)
|
||||||
|
{
|
||||||
|
this.materialHeight = materialHeight;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getMaterialHeight()
|
||||||
|
{
|
||||||
|
return materialHeight;
|
||||||
|
}
|
||||||
|
public void setMaterialWeight(Long materialWeight)
|
||||||
|
{
|
||||||
|
this.materialWeight = materialWeight;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getMaterialWeight()
|
||||||
|
{
|
||||||
|
return materialWeight;
|
||||||
|
}
|
||||||
|
public void setDeleteFlag(Long deleteFlag)
|
||||||
|
{
|
||||||
|
this.deleteFlag = deleteFlag;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getDeleteFlag()
|
||||||
|
{
|
||||||
|
return deleteFlag;
|
||||||
|
}
|
||||||
|
public void setRecordTime(Date recordTime)
|
||||||
|
{
|
||||||
|
this.recordTime = recordTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getRecordTime()
|
||||||
|
{
|
||||||
|
return recordTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||||
|
.append("objid", getObjid())
|
||||||
|
.append("materialCode", getMaterialCode())
|
||||||
|
.append("materialName", getMaterialName())
|
||||||
|
.append("materialType", getMaterialType())
|
||||||
|
.append("materialSize", getMaterialSize())
|
||||||
|
.append("materialHeight", getMaterialHeight())
|
||||||
|
.append("materialWeight", getMaterialWeight())
|
||||||
|
.append("remark", getRemark())
|
||||||
|
.append("deleteFlag", getDeleteFlag())
|
||||||
|
.append("recordTime", getRecordTime())
|
||||||
|
.toString();
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,61 @@
|
|||||||
|
package com.ruoyi.system.mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.ruoyi.system.domain.BaseMaterialInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物料信息Mapper接口
|
||||||
|
*
|
||||||
|
* @author Frank zhou
|
||||||
|
* @date 2021-09-10
|
||||||
|
*/
|
||||||
|
public interface BaseMaterialInfoMapper
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询物料信息
|
||||||
|
*
|
||||||
|
* @param objid 物料信息主键
|
||||||
|
* @return 物料信息
|
||||||
|
*/
|
||||||
|
public BaseMaterialInfo selectBaseMaterialInfoByObjid(String objid);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询物料信息列表
|
||||||
|
*
|
||||||
|
* @param baseMaterialInfo 物料信息
|
||||||
|
* @return 物料信息集合
|
||||||
|
*/
|
||||||
|
public List<BaseMaterialInfo> selectBaseMaterialInfoList(BaseMaterialInfo baseMaterialInfo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增物料信息
|
||||||
|
*
|
||||||
|
* @param baseMaterialInfo 物料信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertBaseMaterialInfo(BaseMaterialInfo baseMaterialInfo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改物料信息
|
||||||
|
*
|
||||||
|
* @param baseMaterialInfo 物料信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateBaseMaterialInfo(BaseMaterialInfo baseMaterialInfo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除物料信息
|
||||||
|
*
|
||||||
|
* @param objid 物料信息主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteBaseMaterialInfoByObjid(String objid);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除物料信息
|
||||||
|
*
|
||||||
|
* @param objids 需要删除的数据主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteBaseMaterialInfoByObjids(String[] objids);
|
||||||
|
}
|
@ -0,0 +1,61 @@
|
|||||||
|
package com.ruoyi.system.service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.ruoyi.system.domain.BaseMaterialInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物料信息Service接口
|
||||||
|
*
|
||||||
|
* @author Frank zhou
|
||||||
|
* @date 2021-09-10
|
||||||
|
*/
|
||||||
|
public interface IBaseMaterialInfoService
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询物料信息
|
||||||
|
*
|
||||||
|
* @param objid 物料信息主键
|
||||||
|
* @return 物料信息
|
||||||
|
*/
|
||||||
|
public BaseMaterialInfo selectBaseMaterialInfoByObjid(String objid);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询物料信息列表
|
||||||
|
*
|
||||||
|
* @param baseMaterialInfo 物料信息
|
||||||
|
* @return 物料信息集合
|
||||||
|
*/
|
||||||
|
public List<BaseMaterialInfo> selectBaseMaterialInfoList(BaseMaterialInfo baseMaterialInfo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增物料信息
|
||||||
|
*
|
||||||
|
* @param baseMaterialInfo 物料信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertBaseMaterialInfo(BaseMaterialInfo baseMaterialInfo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改物料信息
|
||||||
|
*
|
||||||
|
* @param baseMaterialInfo 物料信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateBaseMaterialInfo(BaseMaterialInfo baseMaterialInfo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除物料信息
|
||||||
|
*
|
||||||
|
* @param objids 需要删除的物料信息主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteBaseMaterialInfoByObjids(String objids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除物料信息信息
|
||||||
|
*
|
||||||
|
* @param objid 物料信息主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteBaseMaterialInfoByObjid(String objid);
|
||||||
|
}
|
@ -0,0 +1,94 @@
|
|||||||
|
package com.ruoyi.system.service.impl;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import com.ruoyi.system.mapper.BaseMaterialInfoMapper;
|
||||||
|
import com.ruoyi.system.domain.BaseMaterialInfo;
|
||||||
|
import com.ruoyi.system.service.IBaseMaterialInfoService;
|
||||||
|
import com.ruoyi.common.core.text.Convert;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物料信息Service业务层处理
|
||||||
|
*
|
||||||
|
* @author Frank zhou
|
||||||
|
* @date 2021-09-10
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class BaseMaterialInfoServiceImpl implements IBaseMaterialInfoService
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private BaseMaterialInfoMapper baseMaterialInfoMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询物料信息
|
||||||
|
*
|
||||||
|
* @param objid 物料信息主键
|
||||||
|
* @return 物料信息
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public BaseMaterialInfo selectBaseMaterialInfoByObjid(String objid)
|
||||||
|
{
|
||||||
|
return baseMaterialInfoMapper.selectBaseMaterialInfoByObjid(objid);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询物料信息列表
|
||||||
|
*
|
||||||
|
* @param baseMaterialInfo 物料信息
|
||||||
|
* @return 物料信息
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<BaseMaterialInfo> selectBaseMaterialInfoList(BaseMaterialInfo baseMaterialInfo)
|
||||||
|
{
|
||||||
|
return baseMaterialInfoMapper.selectBaseMaterialInfoList(baseMaterialInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增物料信息
|
||||||
|
*
|
||||||
|
* @param baseMaterialInfo 物料信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int insertBaseMaterialInfo(BaseMaterialInfo baseMaterialInfo)
|
||||||
|
{
|
||||||
|
return baseMaterialInfoMapper.insertBaseMaterialInfo(baseMaterialInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改物料信息
|
||||||
|
*
|
||||||
|
* @param baseMaterialInfo 物料信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int updateBaseMaterialInfo(BaseMaterialInfo baseMaterialInfo)
|
||||||
|
{
|
||||||
|
return baseMaterialInfoMapper.updateBaseMaterialInfo(baseMaterialInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除物料信息
|
||||||
|
*
|
||||||
|
* @param objids 需要删除的物料信息主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteBaseMaterialInfoByObjids(String objids)
|
||||||
|
{
|
||||||
|
return baseMaterialInfoMapper.deleteBaseMaterialInfoByObjids(Convert.toStrArray(objids));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除物料信息信息
|
||||||
|
*
|
||||||
|
* @param objid 物料信息主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteBaseMaterialInfoByObjid(String objid)
|
||||||
|
{
|
||||||
|
return baseMaterialInfoMapper.deleteBaseMaterialInfoByObjid(objid);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,96 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper
|
||||||
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.ruoyi.system.mapper.BaseMaterialInfoMapper">
|
||||||
|
|
||||||
|
<resultMap type="BaseMaterialInfo" id="BaseMaterialInfoResult">
|
||||||
|
<result property="objid" column="objid" />
|
||||||
|
<result property="materialCode" column="material_code" />
|
||||||
|
<result property="materialName" column="material_name" />
|
||||||
|
<result property="materialType" column="material_type" />
|
||||||
|
<result property="materialSize" column="material_size" />
|
||||||
|
<result property="materialHeight" column="material_height" />
|
||||||
|
<result property="materialWeight" column="material_weight" />
|
||||||
|
<result property="remark" column="remark" />
|
||||||
|
<result property="deleteFlag" column="delete_flag" />
|
||||||
|
<result property="recordTime" column="record_time" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="selectBaseMaterialInfoVo">
|
||||||
|
select objid, material_code, material_name, material_type, material_size, material_height, material_weight, remark, delete_flag, record_time from base_material_info
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectBaseMaterialInfoList" parameterType="BaseMaterialInfo" resultMap="BaseMaterialInfoResult">
|
||||||
|
<include refid="selectBaseMaterialInfoVo"/>
|
||||||
|
<where>
|
||||||
|
<if test="materialCode != null and materialCode != ''"> and material_code like concat(concat('%', #{materialCode}), '%')</if>
|
||||||
|
<if test="materialName != null and materialName != ''"> and material_name like concat(concat('%', #{materialName}), '%')</if>
|
||||||
|
and delete_flag = 0
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectBaseMaterialInfoByObjid" parameterType="String" resultMap="BaseMaterialInfoResult">
|
||||||
|
<include refid="selectBaseMaterialInfoVo"/>
|
||||||
|
where objid = #{objid}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertBaseMaterialInfo" parameterType="BaseMaterialInfo">
|
||||||
|
<!--<selectKey keyProperty="objid" resultType="long" order="BEFORE">
|
||||||
|
SELECT seq_base_material_info.NEXTVAL as objid FROM DUAL
|
||||||
|
</selectKey>-->
|
||||||
|
insert into base_material_info
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="objid != null">objid,</if>
|
||||||
|
<if test="materialCode != null">material_code,</if>
|
||||||
|
<if test="materialName != null">material_name,</if>
|
||||||
|
<if test="materialType != null">material_type,</if>
|
||||||
|
<if test="materialSize != null">material_size,</if>
|
||||||
|
<if test="materialHeight != null">material_height,</if>
|
||||||
|
<if test="materialWeight != null">material_weight,</if>
|
||||||
|
<if test="remark != null">remark,</if>
|
||||||
|
<if test="deleteFlag != null">delete_flag,</if>
|
||||||
|
<if test="recordTime != null">record_time,</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="objid != null">#{objid},</if>
|
||||||
|
<if test="materialCode != null">#{materialCode},</if>
|
||||||
|
<if test="materialName != null">#{materialName},</if>
|
||||||
|
<if test="materialType != null">#{materialType},</if>
|
||||||
|
<if test="materialSize != null">#{materialSize},</if>
|
||||||
|
<if test="materialHeight != null">#{materialHeight},</if>
|
||||||
|
<if test="materialWeight != null">#{materialWeight},</if>
|
||||||
|
<if test="remark != null">#{remark},</if>
|
||||||
|
<if test="deleteFlag != null">#{deleteFlag},</if>
|
||||||
|
<if test="recordTime != null">#{recordTime},</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updateBaseMaterialInfo" parameterType="BaseMaterialInfo">
|
||||||
|
update base_material_info
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="materialCode != null">material_code = #{materialCode},</if>
|
||||||
|
<if test="materialName != null">material_name = #{materialName},</if>
|
||||||
|
<if test="materialType != null">material_type = #{materialType},</if>
|
||||||
|
<if test="materialSize != null">material_size = #{materialSize},</if>
|
||||||
|
<if test="materialHeight != null">material_height = #{materialHeight},</if>
|
||||||
|
<if test="materialWeight != null">material_weight = #{materialWeight},</if>
|
||||||
|
<if test="remark != null">remark = #{remark},</if>
|
||||||
|
<if test="deleteFlag != null">delete_flag = #{deleteFlag},</if>
|
||||||
|
<if test="recordTime != null">record_time = #{recordTime},</if>
|
||||||
|
</trim>
|
||||||
|
where objid = #{objid}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="deleteBaseMaterialInfoByObjid" parameterType="String">
|
||||||
|
delete from base_material_info where objid = #{objid}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteBaseMaterialInfoByObjids" parameterType="String">
|
||||||
|
update base_material_info set delete_flag = 1
|
||||||
|
where objid in
|
||||||
|
<foreach item="objid" collection="array" open="(" separator="," close=")">
|
||||||
|
#{objid}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
</mapper>
|
Loading…
Reference in New Issue