物料库存代码初始化
This commit is contained in:
parent
1ed7a8b323
commit
e501180c2c
|
|
@ -0,0 +1,126 @@
|
|||
package com.ruoyi.busi.controller;
|
||||
|
||||
import java.util.List;
|
||||
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.busi.domain.BusiMaterialStock;
|
||||
import com.ruoyi.busi.service.IBusiMaterialStockService;
|
||||
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 WangCL
|
||||
* @date 2021-12-25
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/busi/materialtock")
|
||||
public class BusiMaterialStockController extends BaseController
|
||||
{
|
||||
private String prefix = "busi/materialtock";
|
||||
|
||||
@Autowired
|
||||
private IBusiMaterialStockService busiMaterialStockService;
|
||||
|
||||
@RequiresPermissions("busi:materialtock:view")
|
||||
@GetMapping()
|
||||
public String materialtock()
|
||||
{
|
||||
return prefix + "/materialtock";
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询物料库存列表
|
||||
*/
|
||||
@RequiresPermissions("busi:materialtock:list")
|
||||
@PostMapping("/list")
|
||||
@ResponseBody
|
||||
public TableDataInfo list(BusiMaterialStock busiMaterialStock)
|
||||
{
|
||||
startPage();
|
||||
List<BusiMaterialStock> list = busiMaterialStockService.selectBusiMaterialStockList(busiMaterialStock);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出物料库存列表
|
||||
*/
|
||||
@RequiresPermissions("busi:materialtock:export")
|
||||
@Log(title = "物料库存", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
@ResponseBody
|
||||
public AjaxResult export(BusiMaterialStock busiMaterialStock)
|
||||
{
|
||||
List<BusiMaterialStock> list = busiMaterialStockService.selectBusiMaterialStockList(busiMaterialStock);
|
||||
ExcelUtil<BusiMaterialStock> util = new ExcelUtil<BusiMaterialStock>(BusiMaterialStock.class);
|
||||
return util.exportExcel(list, "物料库存数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增物料库存
|
||||
*/
|
||||
@GetMapping("/add")
|
||||
public String add()
|
||||
{
|
||||
return prefix + "/add";
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增保存物料库存
|
||||
*/
|
||||
@RequiresPermissions("busi:materialtock:add")
|
||||
@Log(title = "物料库存", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/add")
|
||||
@ResponseBody
|
||||
public AjaxResult addSave(BusiMaterialStock busiMaterialStock)
|
||||
{
|
||||
return toAjax(busiMaterialStockService.insertBusiMaterialStock(busiMaterialStock));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改物料库存
|
||||
*/
|
||||
@GetMapping("/edit/{id}")
|
||||
public String edit(@PathVariable("id") String id, ModelMap mmap)
|
||||
{
|
||||
BusiMaterialStock busiMaterialStock = busiMaterialStockService.selectBusiMaterialStockById(id);
|
||||
mmap.put("busiMaterialStock", busiMaterialStock);
|
||||
return prefix + "/edit";
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改保存物料库存
|
||||
*/
|
||||
@RequiresPermissions("busi:materialtock:edit")
|
||||
@Log(title = "物料库存", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/edit")
|
||||
@ResponseBody
|
||||
public AjaxResult editSave(BusiMaterialStock busiMaterialStock)
|
||||
{
|
||||
return toAjax(busiMaterialStockService.updateBusiMaterialStock(busiMaterialStock));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除物料库存
|
||||
*/
|
||||
@RequiresPermissions("busi:materialtock:remove")
|
||||
@Log(title = "物料库存", businessType = BusinessType.DELETE)
|
||||
@PostMapping( "/remove")
|
||||
@ResponseBody
|
||||
public AjaxResult remove(String ids)
|
||||
{
|
||||
return toAjax(busiMaterialStockService.deleteBusiMaterialStockByIds(ids));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,125 @@
|
|||
package com.ruoyi.busi.domain;
|
||||
|
||||
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;
|
||||
|
||||
/**
|
||||
* 物料库存对象 busi_material_stock
|
||||
*
|
||||
* @author WangCL
|
||||
* @date 2021-12-25
|
||||
*/
|
||||
public class BusiMaterialStock extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** ID主键 */
|
||||
private String id;
|
||||
|
||||
/** 所属订单 */
|
||||
@Excel(name = "所属订单")
|
||||
private String orderId;
|
||||
|
||||
/** 进库量 */
|
||||
@Excel(name = "进库量")
|
||||
private String amountIn;
|
||||
|
||||
/** 出库量 */
|
||||
@Excel(name = "出库量")
|
||||
private String amountOut;
|
||||
|
||||
/** 单位 */
|
||||
@Excel(name = "单位")
|
||||
private String unit;
|
||||
|
||||
/** 颜色 */
|
||||
@Excel(name = "颜色")
|
||||
private String color;
|
||||
|
||||
/** 类型 */
|
||||
@Excel(name = "类型")
|
||||
private String classify;
|
||||
|
||||
public void setId(String id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setOrderId(String orderId)
|
||||
{
|
||||
this.orderId = orderId;
|
||||
}
|
||||
|
||||
public String getOrderId()
|
||||
{
|
||||
return orderId;
|
||||
}
|
||||
public void setAmountIn(String amountIn)
|
||||
{
|
||||
this.amountIn = amountIn;
|
||||
}
|
||||
|
||||
public String getAmountIn()
|
||||
{
|
||||
return amountIn;
|
||||
}
|
||||
public void setAmountOut(String amountOut)
|
||||
{
|
||||
this.amountOut = amountOut;
|
||||
}
|
||||
|
||||
public String getAmountOut()
|
||||
{
|
||||
return amountOut;
|
||||
}
|
||||
public void setUnit(String unit)
|
||||
{
|
||||
this.unit = unit;
|
||||
}
|
||||
|
||||
public String getUnit()
|
||||
{
|
||||
return unit;
|
||||
}
|
||||
public void setColor(String color)
|
||||
{
|
||||
this.color = color;
|
||||
}
|
||||
|
||||
public String getColor()
|
||||
{
|
||||
return color;
|
||||
}
|
||||
public void setClassify(String classify)
|
||||
{
|
||||
this.classify = classify;
|
||||
}
|
||||
|
||||
public String getClassify()
|
||||
{
|
||||
return classify;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("orderId", getOrderId())
|
||||
.append("amountIn", getAmountIn())
|
||||
.append("amountOut", getAmountOut())
|
||||
.append("unit", getUnit())
|
||||
.append("color", getColor())
|
||||
.append("classify", getClassify())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,61 @@
|
|||
package com.ruoyi.busi.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.busi.domain.BusiMaterialStock;
|
||||
|
||||
/**
|
||||
* 物料库存Mapper接口
|
||||
*
|
||||
* @author WangCL
|
||||
* @date 2021-12-25
|
||||
*/
|
||||
public interface BusiMaterialStockMapper
|
||||
{
|
||||
/**
|
||||
* 查询物料库存
|
||||
*
|
||||
* @param id 物料库存主键
|
||||
* @return 物料库存
|
||||
*/
|
||||
public BusiMaterialStock selectBusiMaterialStockById(String id);
|
||||
|
||||
/**
|
||||
* 查询物料库存列表
|
||||
*
|
||||
* @param busiMaterialStock 物料库存
|
||||
* @return 物料库存集合
|
||||
*/
|
||||
public List<BusiMaterialStock> selectBusiMaterialStockList(BusiMaterialStock busiMaterialStock);
|
||||
|
||||
/**
|
||||
* 新增物料库存
|
||||
*
|
||||
* @param busiMaterialStock 物料库存
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBusiMaterialStock(BusiMaterialStock busiMaterialStock);
|
||||
|
||||
/**
|
||||
* 修改物料库存
|
||||
*
|
||||
* @param busiMaterialStock 物料库存
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBusiMaterialStock(BusiMaterialStock busiMaterialStock);
|
||||
|
||||
/**
|
||||
* 删除物料库存
|
||||
*
|
||||
* @param id 物料库存主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBusiMaterialStockById(String id);
|
||||
|
||||
/**
|
||||
* 批量删除物料库存
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBusiMaterialStockByIds(String[] ids);
|
||||
}
|
||||
|
|
@ -0,0 +1,61 @@
|
|||
package com.ruoyi.busi.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.busi.domain.BusiMaterialStock;
|
||||
|
||||
/**
|
||||
* 物料库存Service接口
|
||||
*
|
||||
* @author WangCL
|
||||
* @date 2021-12-25
|
||||
*/
|
||||
public interface IBusiMaterialStockService
|
||||
{
|
||||
/**
|
||||
* 查询物料库存
|
||||
*
|
||||
* @param id 物料库存主键
|
||||
* @return 物料库存
|
||||
*/
|
||||
public BusiMaterialStock selectBusiMaterialStockById(String id);
|
||||
|
||||
/**
|
||||
* 查询物料库存列表
|
||||
*
|
||||
* @param busiMaterialStock 物料库存
|
||||
* @return 物料库存集合
|
||||
*/
|
||||
public List<BusiMaterialStock> selectBusiMaterialStockList(BusiMaterialStock busiMaterialStock);
|
||||
|
||||
/**
|
||||
* 新增物料库存
|
||||
*
|
||||
* @param busiMaterialStock 物料库存
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBusiMaterialStock(BusiMaterialStock busiMaterialStock);
|
||||
|
||||
/**
|
||||
* 修改物料库存
|
||||
*
|
||||
* @param busiMaterialStock 物料库存
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBusiMaterialStock(BusiMaterialStock busiMaterialStock);
|
||||
|
||||
/**
|
||||
* 批量删除物料库存
|
||||
*
|
||||
* @param ids 需要删除的物料库存主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBusiMaterialStockByIds(String ids);
|
||||
|
||||
/**
|
||||
* 删除物料库存信息
|
||||
*
|
||||
* @param id 物料库存主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBusiMaterialStockById(String id);
|
||||
}
|
||||
|
|
@ -0,0 +1,97 @@
|
|||
package com.ruoyi.busi.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.busi.mapper.BusiMaterialStockMapper;
|
||||
import com.ruoyi.busi.domain.BusiMaterialStock;
|
||||
import com.ruoyi.busi.service.IBusiMaterialStockService;
|
||||
import com.ruoyi.common.core.text.Convert;
|
||||
|
||||
/**
|
||||
* 物料库存Service业务层处理
|
||||
*
|
||||
* @author WangCL
|
||||
* @date 2021-12-25
|
||||
*/
|
||||
@Service
|
||||
public class BusiMaterialStockServiceImpl implements IBusiMaterialStockService
|
||||
{
|
||||
@Autowired
|
||||
private BusiMaterialStockMapper busiMaterialStockMapper;
|
||||
|
||||
/**
|
||||
* 查询物料库存
|
||||
*
|
||||
* @param id 物料库存主键
|
||||
* @return 物料库存
|
||||
*/
|
||||
@Override
|
||||
public BusiMaterialStock selectBusiMaterialStockById(String id)
|
||||
{
|
||||
return busiMaterialStockMapper.selectBusiMaterialStockById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询物料库存列表
|
||||
*
|
||||
* @param busiMaterialStock 物料库存
|
||||
* @return 物料库存
|
||||
*/
|
||||
@Override
|
||||
public List<BusiMaterialStock> selectBusiMaterialStockList(BusiMaterialStock busiMaterialStock)
|
||||
{
|
||||
return busiMaterialStockMapper.selectBusiMaterialStockList(busiMaterialStock);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增物料库存
|
||||
*
|
||||
* @param busiMaterialStock 物料库存
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertBusiMaterialStock(BusiMaterialStock busiMaterialStock)
|
||||
{
|
||||
busiMaterialStock.setCreateTime(DateUtils.getNowDate());
|
||||
return busiMaterialStockMapper.insertBusiMaterialStock(busiMaterialStock);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改物料库存
|
||||
*
|
||||
* @param busiMaterialStock 物料库存
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateBusiMaterialStock(BusiMaterialStock busiMaterialStock)
|
||||
{
|
||||
busiMaterialStock.setUpdateTime(DateUtils.getNowDate());
|
||||
return busiMaterialStockMapper.updateBusiMaterialStock(busiMaterialStock);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除物料库存
|
||||
*
|
||||
* @param ids 需要删除的物料库存主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBusiMaterialStockByIds(String ids)
|
||||
{
|
||||
return busiMaterialStockMapper.deleteBusiMaterialStockByIds(Convert.toStrArray(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除物料库存信息
|
||||
*
|
||||
* @param id 物料库存主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBusiMaterialStockById(String id)
|
||||
{
|
||||
return busiMaterialStockMapper.deleteBusiMaterialStockById(id);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,95 @@
|
|||
<?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.busi.mapper.BusiMaterialStockMapper">
|
||||
|
||||
<resultMap type="BusiMaterialStock" id="BusiMaterialStockResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="orderId" column="order_id" />
|
||||
<result property="amountIn" column="amount_in" />
|
||||
<result property="amountOut" column="amount_out" />
|
||||
<result property="unit" column="unit" />
|
||||
<result property="color" column="color" />
|
||||
<result property="classify" column="classify" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectBusiMaterialStockVo">
|
||||
select id, order_id, amount_in, amount_out, unit, color, classify, create_by, create_time, update_by, update_time from busi_material_stock
|
||||
</sql>
|
||||
|
||||
<select id="selectBusiMaterialStockList" parameterType="BusiMaterialStock" resultMap="BusiMaterialStockResult">
|
||||
<include refid="selectBusiMaterialStockVo"/>
|
||||
<where>
|
||||
<if test="orderId != null and orderId != ''"> and order_id = #{orderId}</if>
|
||||
<if test="color != null and color != ''"> and color = #{color}</if>
|
||||
<if test="classify != null and classify != ''"> and classify = #{classify}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectBusiMaterialStockById" parameterType="String" resultMap="BusiMaterialStockResult">
|
||||
<include refid="selectBusiMaterialStockVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertBusiMaterialStock" parameterType="BusiMaterialStock" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into busi_material_stock
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="orderId != null">order_id,</if>
|
||||
<if test="amountIn != null">amount_in,</if>
|
||||
<if test="amountOut != null">amount_out,</if>
|
||||
<if test="unit != null">unit,</if>
|
||||
<if test="color != null">color,</if>
|
||||
<if test="classify != null">classify,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="orderId != null">#{orderId},</if>
|
||||
<if test="amountIn != null">#{amountIn},</if>
|
||||
<if test="amountOut != null">#{amountOut},</if>
|
||||
<if test="unit != null">#{unit},</if>
|
||||
<if test="color != null">#{color},</if>
|
||||
<if test="classify != null">#{classify},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateBusiMaterialStock" parameterType="BusiMaterialStock">
|
||||
update busi_material_stock
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="orderId != null">order_id = #{orderId},</if>
|
||||
<if test="amountIn != null">amount_in = #{amountIn},</if>
|
||||
<if test="amountOut != null">amount_out = #{amountOut},</if>
|
||||
<if test="unit != null">unit = #{unit},</if>
|
||||
<if test="color != null">color = #{color},</if>
|
||||
<if test="classify != null">classify = #{classify},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteBusiMaterialStockById" parameterType="String">
|
||||
delete from busi_material_stock where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteBusiMaterialStockByIds" parameterType="String">
|
||||
delete from busi_material_stock where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,65 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
|
||||
<head>
|
||||
<th:block th:include="include :: header('新增物料库存')" />
|
||||
</head>
|
||||
<body class="white-bg">
|
||||
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
|
||||
<form class="form-horizontal m" id="form-materialtock-add">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">所属订单:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="orderId" 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="amountIn" 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="amountOut" 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="unit" class="form-control" type="text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">颜色:</label>
|
||||
<div class="col-sm-8">
|
||||
<select name="color" class="form-control m-b" th:with="type=${@dict.getType('busi_color')}">
|
||||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">类型:</label>
|
||||
<div class="col-sm-8">
|
||||
<select name="classify" class="form-control m-b" th:with="type=${@dict.getType('busi_material_type')}">
|
||||
<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" />
|
||||
<script th:inline="javascript">
|
||||
var prefix = ctx + "busi/materialtock"
|
||||
$("#form-materialtock-add").validate({
|
||||
focusCleanup: true
|
||||
});
|
||||
|
||||
function submitHandler() {
|
||||
if ($.validate.form()) {
|
||||
$.operate.save(prefix + "/add", $('#form-materialtock-add').serialize());
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,66 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
|
||||
<head>
|
||||
<th:block th:include="include :: header('修改物料库存')" />
|
||||
</head>
|
||||
<body class="white-bg">
|
||||
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
|
||||
<form class="form-horizontal m" id="form-materialtock-edit" th:object="${busiMaterialStock}">
|
||||
<input name="id" th:field="*{id}" type="hidden">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">所属订单:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="orderId" th:field="*{orderId}" 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="amountIn" th:field="*{amountIn}" 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="amountOut" th:field="*{amountOut}" 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="unit" th:field="*{unit}" class="form-control" type="text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">颜色:</label>
|
||||
<div class="col-sm-8">
|
||||
<select name="color" class="form-control m-b" th:with="type=${@dict.getType('busi_color')}">
|
||||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{color}"></option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">类型:</label>
|
||||
<div class="col-sm-8">
|
||||
<select name="classify" class="form-control m-b" th:with="type=${@dict.getType('busi_material_type')}">
|
||||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{classify}"></option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<th:block th:include="include :: footer" />
|
||||
<script th:inline="javascript">
|
||||
var prefix = ctx + "busi/materialtock";
|
||||
$("#form-materialtock-edit").validate({
|
||||
focusCleanup: true
|
||||
});
|
||||
|
||||
function submitHandler() {
|
||||
if ($.validate.form()) {
|
||||
$.operate.save(prefix + "/edit", $('#form-materialtock-edit').serialize());
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,128 @@
|
|||
<!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="orderId"/>
|
||||
</li>
|
||||
<li>
|
||||
<label>颜色:</label>
|
||||
<select name="color" th:with="type=${@dict.getType('busi_color')}">
|
||||
<option value="">所有</option>
|
||||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
|
||||
</select>
|
||||
</li>
|
||||
<li>
|
||||
<label>类型:</label>
|
||||
<select name="classify" th:with="type=${@dict.getType('busi_material_type')}">
|
||||
<option value="">所有</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="$.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="busi:materialtock:add">-->
|
||||
<!-- <i class="fa fa-plus"></i> 添加-->
|
||||
<!-- </a>-->
|
||||
<!-- <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="busi:materialtock:edit">-->
|
||||
<!-- <i class="fa fa-edit"></i> 修改-->
|
||||
<!-- </a>-->
|
||||
<!-- <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="busi:materialtock:remove">-->
|
||||
<!-- <i class="fa fa-remove"></i> 删除-->
|
||||
<!-- </a>-->
|
||||
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="busi:materialtock: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('busi:materialtock:edit')}]];
|
||||
var removeFlag = [[${@permission.hasPermi('busi:materialtock:remove')}]];
|
||||
var colorDatas = [[${@dict.getType('busi_color')}]];
|
||||
var classifyDatas = [[${@dict.getType('busi_material_type')}]];
|
||||
var prefix = ctx + "busi/materialtock";
|
||||
|
||||
$(function() {
|
||||
var options = {
|
||||
url: prefix + "/list",
|
||||
createUrl: prefix + "/add",
|
||||
updateUrl: prefix + "/edit/{id}",
|
||||
removeUrl: prefix + "/remove",
|
||||
exportUrl: prefix + "/export",
|
||||
modalName: "物料库存",
|
||||
columns: [{
|
||||
checkbox: true
|
||||
},
|
||||
{
|
||||
field: 'id',
|
||||
title: 'ID主键',
|
||||
visible: false
|
||||
},
|
||||
{
|
||||
field: 'orderId',
|
||||
title: '所属订单'
|
||||
},
|
||||
{
|
||||
field: 'amountIn',
|
||||
title: '进库量'
|
||||
},
|
||||
{
|
||||
field: 'amountOut',
|
||||
title: '出库量'
|
||||
},
|
||||
{
|
||||
field: 'unit',
|
||||
title: '单位'
|
||||
},
|
||||
{
|
||||
field: 'color',
|
||||
title: '颜色',
|
||||
formatter: function(value, row, index) {
|
||||
return $.table.selectDictLabel(colorDatas, value);
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'classify',
|
||||
title: '类型',
|
||||
formatter: function(value, row, index) {
|
||||
return $.table.selectDictLabel(classifyDatas, value);
|
||||
}
|
||||
},
|
||||
{
|
||||
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.id + '\')"><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.id + '\')"><i class="fa fa-remove"></i>删除</a>');
|
||||
return actions.join('');
|
||||
}
|
||||
}]
|
||||
};
|
||||
$.table.init(options);
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
25
sql/tmp.sql
25
sql/tmp.sql
|
|
@ -146,3 +146,28 @@ values('物料操作流水删除', @parentId, '4', '#', 'F', '0', 'busi:materi
|
|||
insert into sys_menu (menu_name, parent_id, order_num, url, menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
values('物料操作流水导出', @parentId, '5', '#', 'F', '0', 'busi:materialperate:export', '#', 'admin', sysdate(), '', null, '');
|
||||
|
||||
|
||||
|
||||
|
||||
-- 菜单 SQL
|
||||
insert into sys_menu (menu_name, parent_id, order_num, url, menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
values('物料库存', '118', '1', '/busi/materialtock', 'C', '0', 'busi:materialtock:view', '#', 'admin', sysdate(), '', null, '物料库存菜单');
|
||||
|
||||
-- 按钮父菜单ID
|
||||
SELECT @parentId := LAST_INSERT_ID();
|
||||
|
||||
-- 按钮 SQL
|
||||
insert into sys_menu (menu_name, parent_id, order_num, url, menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
values('物料库存查询', @parentId, '1', '#', 'F', '0', 'busi:materialtock:list', '#', 'admin', sysdate(), '', null, '');
|
||||
|
||||
insert into sys_menu (menu_name, parent_id, order_num, url, menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
values('物料库存新增', @parentId, '2', '#', 'F', '0', 'busi:materialtock:add', '#', 'admin', sysdate(), '', null, '');
|
||||
|
||||
insert into sys_menu (menu_name, parent_id, order_num, url, menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
values('物料库存修改', @parentId, '3', '#', 'F', '0', 'busi:materialtock:edit', '#', 'admin', sysdate(), '', null, '');
|
||||
|
||||
insert into sys_menu (menu_name, parent_id, order_num, url, menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
values('物料库存删除', @parentId, '4', '#', 'F', '0', 'busi:materialtock:remove', '#', 'admin', sysdate(), '', null, '');
|
||||
|
||||
insert into sys_menu (menu_name, parent_id, order_num, url, menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
values('物料库存导出', @parentId, '5', '#', 'F', '0', 'busi:materialtock:export', '#', 'admin', sysdate(), '', null, '');
|
||||
|
|
|
|||
Loading…
Reference in New Issue