Browse Source

[feat] 新增仓库修改,新增字段仓库管理人联系电话,修改相关信息。

dev
zhangsiqi 5 months ago
parent
commit
5c4432259a
  1. 75
      ruoyi-admin/src/main/java/com/ruoyi/stock/domain/StockInfo.java
  2. 2
      ruoyi-admin/src/main/java/com/ruoyi/stock/service/impl/StockAdjustServiceImpl.java
  3. 4
      ruoyi-admin/src/main/java/com/ruoyi/stock/service/impl/WarehousingOutHeadServiceImpl.java
  4. 2
      ruoyi-admin/src/main/java/com/ruoyi/stock/service/impl/WarehousingRecordServiceImpl.java
  5. 43
      ruoyi-admin/src/main/resources/mapper/stock/StockInfoMapper.xml
  6. 98
      ruoyi-admin/src/main/resources/templates/stock/stockInfo/stockInfo.html

75
ruoyi-admin/src/main/java/com/ruoyi/stock/domain/StockInfo.java

@ -20,11 +20,11 @@ public class StockInfo extends BaseEntity
/** 仓库编号 */
@Excel(name = "仓库编号")
private String StockNO;
private String stockNO;
/** 仓库名 */
@Excel(name = "仓库名")
private String Stockname;
private String stockName;
/** 仓库地址 */
@Excel(name = "仓库地址")
@ -32,11 +32,14 @@ public class StockInfo extends BaseEntity
/** 仓库管理人 */
@Excel(name = "仓库管理人")
private String stockmanager;
private String stockManager;
@Excel(name = "仓库管理人电话")
private String stockManagerPhone;
/** 仓库备注 */
@Excel(name = "仓库备注")
private String stockmemo;
private String stockMemo;
/** */
private String defaltItemclass;
@ -58,48 +61,45 @@ public class StockInfo extends BaseEntity
}
public String getStockNO() {
return StockNO;
return stockNO;
}
public void setStockNO(String StockNO) {
this.StockNO = StockNO;
public void setStockNO(String stockNO) {
this.stockNO = stockNO;
}
public String getStockname() {
return Stockname;
public String getStockName() {
return stockName;
}
public void setStockname(String Stockname) {
this.Stockname = Stockname;
public void setStockName(String stockName) {
this.stockName = stockName;
}
public void setStockAddr(String stockAddr)
{
this.stockAddr = stockAddr;
public String getStockAddr() {
return stockAddr;
}
public String getStockAddr()
{
return stockAddr;
public void setStockAddr(String stockAddr) {
this.stockAddr = stockAddr;
}
public void setStockmanager(String stockmanager)
{
this.stockmanager = stockmanager;
public String getStockManager() {
return stockManager;
}
public String getStockmanager()
{
return stockmanager;
public void setStockManager(String stockManager) {
this.stockManager = stockManager;
}
public void setStockmemo(String stockmemo)
{
this.stockmemo = stockmemo;
public String getStockMemo() {
return stockMemo;
}
public String getStockmemo()
{
return stockmemo;
public void setStockMemo(String stockMemo) {
this.stockMemo = stockMemo;
}
public void setDefaltItemclass(String defaltItemclass)
{
this.defaltItemclass = defaltItemclass;
@ -126,15 +126,24 @@ public class StockInfo extends BaseEntity
this.updateInfoTime = updateInfoTime;
}
public String getStockManagerPhone() {
return stockManagerPhone;
}
public void setStockManagerPhone(String stockManagerPhone) {
this.stockManagerPhone = stockManagerPhone;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("stockId", getStockId())
.append("StockNO", getStockNO())
.append("Stockname", getStockname())
.append("stockNO", getStockNO())
.append("stockName", getStockName())
.append("stockAddr", getStockAddr())
.append("stockmanager", getStockmanager())
.append("stockmemo", getStockmemo())
.append("stockmanager", getStockManager())
.append("stockManagerPhone", getStockManagerPhone())
.append("stockmemo", getStockMemo())
.append("defaltItemclass", getDefaltItemclass())
.append("firstAddTime", getFirstAddTime())
.append("updateInfoTime", getUpdateInfoTime())

2
ruoyi-admin/src/main/java/com/ruoyi/stock/service/impl/StockAdjustServiceImpl.java

@ -68,7 +68,7 @@ public class StockAdjustServiceImpl implements IStockAdjustService {
public int insertStockAdjust(StockAdjust stockAdjust) {
//获取仓库号
StockInfo stockInfo = new StockInfo();
stockInfo.setStockname(stockAdjust.getStockName());
stockInfo.setStockName(stockAdjust.getStockName());
stockInfo = stockInfoMapper.selectStockInfoList(stockInfo).get(0);
stockAdjust.setStockNo(stockInfo.getStockNO());

4
ruoyi-admin/src/main/java/com/ruoyi/stock/service/impl/WarehousingOutHeadServiceImpl.java

@ -167,7 +167,7 @@ public class WarehousingOutHeadServiceImpl implements IWarehousingOutHeadService
}
}
StockInfo stockInfo = new StockInfo();
stockInfo.setStockname(warehousingOutHead.getStockName());
stockInfo.setStockName(warehousingOutHead.getStockName());
List<StockInfo> getStock = stockInfoMapper.selectStockInfoList(stockInfo);
warehousingOutHead.setStockNo(getStock.get(0).getStockNO());
return warehousingOutHeadMapper.insertWarehousingOutHead(warehousingOutHead);
@ -198,7 +198,7 @@ public class WarehousingOutHeadServiceImpl implements IWarehousingOutHeadService
warehousingRecordMapper.updateSurplusQty(warehousingRecord);
}
StockInfo stockInfo = new StockInfo();
stockInfo.setStockname(warehousingOutHead.getStockName());
stockInfo.setStockName(warehousingOutHead.getStockName());
List<StockInfo> getStock = stockInfoMapper.selectStockInfoList(stockInfo);
warehousingOutHead.setStockNo(getStock.get(0).getStockNO());
return warehousingOutHeadMapper.insertWarehousingOutHead(warehousingOutHead);

2
ruoyi-admin/src/main/java/com/ruoyi/stock/service/impl/WarehousingRecordServiceImpl.java

@ -66,7 +66,7 @@ public class WarehousingRecordServiceImpl implements IWarehousingRecordService {
@Override
public int insertWarehousingRecord(WarehousingRecord warehousingRecord) {
StockInfo stockInfo = new StockInfo();
stockInfo.setStockname(warehousingRecord.getWarehouseName());
stockInfo.setStockName(warehousingRecord.getWarehouseName());
stockInfo = stockInfoMapper.selectStockInfoList(stockInfo).get(0);
warehousingRecord.setWarehouseNo(stockInfo.getStockNO());
warehousingRecord.setWarehousingrecordDate(new Date());

43
ruoyi-admin/src/main/resources/mapper/stock/StockInfoMapper.xml

@ -5,26 +5,28 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<mapper namespace="com.ruoyi.stock.mapper.StockInfoMapper">
<resultMap type="StockInfo" id="StockInfoResult">
<result property="stockId" column="stock_id" />
<result property="StockNO" column="StockNO" />
<result property="Stockname" column="Stockname" />
<result property="stockAddr" column="stockAddr" />
<result property="stockmanager" column="stockmanager" />
<result property="stockmemo" column="stockmemo" />
<result property="defaltItemclass" column="defalt_itemclass" />
<result property="firstAddTime" column="first_add_time" />
<result property="updateInfoTime" column="update_info_time" />
<result property="stockId" column="stock_id" />
<result property="stockNO" column="StockNO" />
<result property="stockName" column="Stockname" />
<result property="stockAddr" column="stockAddr" />
<result property="stockManager" column="stockmanager" />
<result property="stockMemo" column="stockmemo" />
<result property="stockManagerPhone" column="stock_manager_phone" />
<result property="defaltItemclass" column="defalt_itemclass" />
<result property="firstAddTime" column="first_add_time" />
<result property="updateInfoTime" column="update_info_time" />
</resultMap>
<sql id="selectStockInfoVo">
select stock_id, StockNO, Stockname, stockAddr, stockmanager, stockmemo, defalt_itemclass, first_add_time, update_info_time from stock_info
select stock_id, StockNO, Stockname, stockAddr, stockmanager,stock_manager_phone, stockmemo,
defalt_itemclass, first_add_time, update_info_time from stock_info
</sql>
<select id="selectStockInfoList" parameterType="StockInfo" resultMap="StockInfoResult">
<include refid="selectStockInfoVo"/>
<where>
<if test="StockNO != null and StockNO != ''"> and StockNO like concat('%', #{StockNO}, '%')</if>
<if test="Stockname != null and Stockname != ''"> and Stockname like concat('%', #{Stockname}, '%')</if>
<if test="stockNO != null and stockNO != ''"> and StockNO like concat('%', #{stockNO}, '%')</if>
<if test="stockname != null and stockname != ''"> and Stockname like concat('%', #{stockname}, '%')</if>
<if test="stockAddr != null and stockAddr != ''"> and stockAddr like concat('%', #{stockAddr}, '%')</if>
<if test="stockmanager != null and stockmanager != ''"> and stockmanager = #{stockmanager}</if>
<if test="stockmemo != null and stockmemo != ''"> and stockmemo = #{stockmemo}</if>
@ -49,19 +51,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<insert id="insertStockInfo" parameterType="StockInfo">
insert into stock_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="StockNO != null and StockNO != ''">StockNO,</if>
<if test="Stockname != null and Stockname != ''">Stockname,</if>
<if test="stockNO != null and stockNO != ''">StockNO,</if>
<if test="stockname != null and stockname != ''">Stockname,</if>
<if test="stockAddr != null and stockAddr != ''">stockAddr,</if>
<if test="stockmanager != null">stockmanager,</if>
<if test="stockManagerPhone != null">stock_manager_phone,</if>
<if test="stockmemo != null">stockmemo,</if>
<if test="defaltItemclass != null">defalt_itemclass,</if>
first_add_time,
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="StockNO != null and StockNO != ''">#{StockNO},</if>
<if test="Stockname != null and Stockname != ''">#{Stockname},</if>
<if test="StockNO != null and StockNO != ''">#{stockNO},</if>
<if test="Stockname != null and Stockname != ''">#{stockname},</if>
<if test="stockAddr != null and stockAddr != ''">#{stockAddr},</if>
<if test="stockmanager != null">#{stockmanager},</if>
<if test="stockManagerPhone != null">#{stockManagerPhone},</if>
<if test="stockmemo != null">#{stockmemo},</if>
<if test="defaltItemclass != null">#{defaltItemclass},</if>
now(),
@ -71,10 +75,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<update id="updateStockInfo" parameterType="StockInfo">
update stock_info
<trim prefix="SET" suffixOverrides=",">
<if test="StockNO != null and StockNO != ''">StockNO = #{StockNO},</if>
<if test="Stockname != null and Stockname != ''">Stockname = #{Stockname},</if>
<if test="stockAddr != null and stockAddr != ''">stockAddr = #{stockAddr},</if>
<if test="stockNO != null and stockNO != ''">StockNO = #{stockNO},</if>
<if test="stockname != null and stockname != ''">Stockname = #{stockname},</if>
<if test="stockAddr != null and stockAddr != ''">StockAddr = #{stockAddr},</if>
<if test="stockmanager != null">stockmanager = #{stockmanager},</if>
<if test="stockManagerPhone != null">stock_manager_phone = #{stockManagerPhone},</if>
<if test="stockmemo != null">stockmemo = #{stockmemo},</if>
<if test="defaltItemclass != null">defalt_itemclass = #{defaltItemclass},</if>
update_info_time = CONCAT_WS(',',NOW(),update_info_time),

98
ruoyi-admin/src/main/resources/templates/stock/stockInfo/stockInfo.html

@ -12,11 +12,11 @@
<ul>
<li>
<label>仓库编号:</label>
<input type="text" name="StockNO"/>
<input type="text" name="stockNO"/>
</li>
<li>
<label>仓库名:</label>
<input type="text" name="Stockname"/>
<input type="text" name="stockName"/>
</li>
<li>
<label>仓库地址:</label>
@ -24,7 +24,7 @@
</li>
<li>
<label>仓库管理人:</label>
<input type="text" name="stockmanager"/>
<input type="text" name="stockManager"/>
</li>
<li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
@ -69,69 +69,41 @@
exportUrl: prefix + "/export",
clickToSelect: true,
modalName: "仓库信息",
columns: [{
checkbox: true
},
{
field: 'stockId',
title: '仓库id',
visible: false
},
{
field: 'stockNO',
title: '仓库编号'
},
{
field: 'stockname',
title: '仓库名'
},
{
field: 'stockAddr',
title: '仓库地址'
},
{
field: 'stockmanager',
title: '仓库管理人'
},
{
field: 'stockmemo',
title: '仓库备注'
},
{
field: 'firstAddTime',
title: '录入时间',
formatter: function (value, row, index) {
console.log(row)
if (value == null) {
return " ";
} else {
return value;
columns: [
{checkbox: true},
{title: '仓库id',field: 'stockId',visible: false},
{title: '仓库编号',field: 'stockNO',},
{title: '仓库名',field: 'stockName',},
{title: '仓库地址',field: 'stockAddr',},
{title: '仓库管理人',field: 'stockManager',},
{title: '仓库管理人',field: 'stockManagerPhone',},
{title: '仓库备注',field: 'stockMemo',},
{title: '录入时间',field: 'firstAddTime',
formatter: function (value, row, index) {
console.log(row)
if (value == null) {return " ";}
else {return value;}
}
}
},
{
field: 'updateInfoTime',
title: '上次修改时间',
formatter: function (value, row, index) {
if (value == null) {
return " ";
} else {
var vArr = value.split(',')
return vArr[0];
},
{title: '上次修改时间',field: 'updateInfoTime',
formatter: function (value, row, index) {
if (value == null) {return " ";}
else {
var vArr = value.split(',')
return vArr[0];
}
}
}
}
// {
// 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.stockNO + '\')"><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.stockNO + '\')"><i class="fa fa-remove"></i>删除</a>');
// return actions.join('');
// }
// }
// {
// 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.stockNO + '\')"><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.stockNO + '\')"><i class="fa fa-remove"></i>删除</a>');
// return actions.join('');
// }
// }
]
};
$.table.init(options);

Loading…
Cancel
Save