已经完成

物料库位关系 增加所属仓库
master
森屿海巷 3 years ago
parent 12734d20fc
commit 1851d57b81

@ -2,7 +2,11 @@ package com.ruoyi.web.controller.basic;
import java.util.List;
import com.ruoyi.system.domain.BaseLocationInfo;
import com.ruoyi.system.domain.BaseStoreInfo;
import com.ruoyi.system.service.IBaseStoreInfoService;
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;
@ -33,6 +37,9 @@ public class BaseMaterialStoreController extends BaseController
{
private String prefix = "system/basematerialstore";
@Autowired
private IBaseStoreInfoService baseStoreInfoService;
@Autowired
private IBaseMaterialStoreService baseMaterialStoreService;
@ -74,8 +81,12 @@ public class BaseMaterialStoreController extends BaseController
*
*/
@GetMapping("/add")
public String add()
public String add(ModelMap modelMap)
{
BaseStoreInfo baseStoreInfo = new BaseStoreInfo();
List<BaseStoreInfo> baseStoreInfos = baseStoreInfoService.selectBaseStoreInfoList(baseStoreInfo);
modelMap.put("baseStoreInfos",baseStoreInfos);
return prefix + "/add";
}
@ -88,6 +99,8 @@ public class BaseMaterialStoreController extends BaseController
@ResponseBody
public AjaxResult addSave(BaseMaterialStore baseMaterialStore)
{
baseMaterialStore.setObjid(UUIDTool.generate());
return toAjax(baseMaterialStoreService.insertBaseMaterialStore(baseMaterialStore));
}
@ -112,6 +125,7 @@ public class BaseMaterialStoreController extends BaseController
@ResponseBody
public AjaxResult editSave(BaseMaterialStore baseMaterialStore)
{
return toAjax(baseMaterialStoreService.updateBaseMaterialStore(baseMaterialStore));
}

@ -25,6 +25,16 @@
<input name="locationCode" 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="storeCode" class="form-control" type="text">-->
<select name="storeCode" id="storeCode" class="form-control m-b" required>
<option th:each="baseStoreInfos: ${baseStoreInfos}" th:text="${baseStoreInfos.storeName}" th:value="${baseStoreInfos.storeCode}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">库位状态:</label>
<div class="col-sm-8">

@ -18,6 +18,14 @@
<label>物料类型:</label>
<input type="text" name="materialType"/>
</li>
<li>
<label>所属仓库:</label>
<select name="storeCode" th:with="type=${@baseStoreInfoService.selectBaseStoreInfoList(null)}">
<option value="">所有</option>
<option th:each="baseStoreInfos: ${type}" th:text="${baseStoreInfos.storeName}" th:value="${baseStoreInfos.storeCode}"></option>
</select>
</li>
<li>
<label>库位状态:</label>
<select name="locationStatus" th:with="type=${@dict.getType('location_status')}">
@ -67,7 +75,7 @@
var locationStatusDatas = [[${@dict.getType('location_status')}]];
var locationInfo = [[${@dict.getType('location_info')}]];
var prefix = ctx + "system/basematerialstore";
var storeInfoDatas = [[${@baseStoreInfoService.selectBaseStoreInfoList(null)}]];
$(function() {
var options = {
url: prefix + "/list",
@ -110,6 +118,15 @@
return $.table.selectDictLabel(locationInfo, value);
}
},
{
field: 'storeCode',
title: '所属仓库',
formatter: function(value, row, index) {
return $.table.selectStoreDictLabelLocation(storeInfoDatas, value);
}
},
{
field: 'recordTime',
title: '记录时间'

@ -26,6 +26,17 @@
<input name="locationCode" th:field="*{locationCode}" 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="storeCode" th:field="*{storeCode}" class="form-control" type="text"> baseStoreInfoService.selectBaseStoreInfoList(baseStoreInfo) -->
<select name="storeCode" class="form-control m-b" th:with="type=${@baseStoreInfoService.selectBaseStoreInfoList(null)}">
<option th:each="dict : ${type}" th:text="${dict.storeName}" th:value="${dict.storeCode}" th:field="*{storeCode}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">库位状态:</label>
<div class="col-sm-8">

@ -43,6 +43,10 @@ public class BaseMaterialStore extends BaseEntity
/** 删除标志 */
private Long deleteFlag;
/** 所属库位 */
@Excel(name = "所属库位")
private String storeCode;
/** 记录时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "记录时间", width = 30, dateFormat = "yyyy-MM-dd")
@ -121,17 +125,26 @@ public class BaseMaterialStore extends BaseEntity
return recordTime;
}
public String getStoreCode() {
return storeCode;
}
public void setStoreCode(String storeCode) {
this.storeCode = storeCode;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("objid", getObjid())
.append("materialCode", getMaterialCode())
.append("materialType", getMaterialType())
.append("locationCode", getLocationCode())
.append("locationStatus", getLocationStatus())
.append("locationArea", getLocationArea())
.append("deleteFlag", getDeleteFlag())
.append("recordTime", getRecordTime())
.toString();
return "BaseMaterialStore{" +
"objid='" + objid + '\'' +
", materialCode='" + materialCode + '\'' +
", materialType='" + materialType + '\'' +
", locationCode='" + locationCode + '\'' +
", locationStatus=" + locationStatus +
", locationArea='" + locationArea + '\'' +
", deleteFlag=" + deleteFlag +
", storeCode='" + storeCode + '\'' +
", recordTime=" + recordTime +
'}';
}
}

@ -13,10 +13,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="locationArea" column="location_area" />
<result property="deleteFlag" column="delete_flag" />
<result property="recordTime" column="record_time" />
<result property="storeCode" column="store_code" />
</resultMap>
<sql id="selectBaseMaterialStoreVo">
select objid, material_code, material_type, location_code, location_status, location_area, delete_flag, record_time from base_material_store
select objid, material_code, material_type, location_code, location_status, location_area, delete_flag, record_time,store_code from base_material_store
</sql>
<select id="selectBaseMaterialStoreList" parameterType="BaseMaterialStore" resultMap="BaseMaterialStoreResult">
@ -27,6 +28,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="locationStatus != null"> and location_status = #{locationStatus} </if>
<if test="locationArea != null and locationArea != ''"> and location_area = #{locationArea} </if>
<if test="storeCode != null and storeCode != ''"> and store_code = #{storeCode} </if>
and delete_flag = '1'
</where>
</select>
@ -50,6 +53,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="locationArea != null">location_area,</if>
<if test="deleteFlag != null">delete_flag,</if>
<if test="recordTime != null">record_time,</if>
<if test="storeCode != null">store_code,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="objid != null">#{objid},</if>
@ -60,6 +64,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="locationArea != null">#{locationArea},</if>
<if test="deleteFlag != null">#{deleteFlag},</if>
<if test="recordTime != null">#{recordTime},</if>
<if test="storeCode != null">#{storeCode},</if>
</trim>
</insert>
@ -73,6 +78,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="locationArea != null">location_area = #{locationArea},</if>
<if test="deleteFlag != null">delete_flag = #{deleteFlag},</if>
<if test="recordTime != null">record_time = #{recordTime},</if>
<if test="storeCode != null">store_code = #{storeCode},</if>
</trim>
where objid = #{objid}
</update>
@ -87,6 +93,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="locationArea != null">location_area = #{locationArea},</if>
<if test="deleteFlag != null">delete_flag = #{deleteFlag},</if>
<if test="recordTime != null">record_time = #{recordTime},</if>
<if test="storeCode != null">store_code = #{storeCode},</if>
</trim>
where location_code = #{locationCode}
</update>

Loading…
Cancel
Save