Commit 358760de by wangchunyang
parents 82fd5953 6dd5c256
...@@ -133,7 +133,6 @@ ...@@ -133,7 +133,6 @@
</el-tag> </el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="排序" align="center" prop="sortNo" width="80" />
<el-table-column label="创建日期" align="center" prop="createTime" width="160" /> <el-table-column label="创建日期" align="center" prop="createTime" width="160" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="120" fixed="right"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="120" fixed="right">
<template slot-scope="scope"> <template slot-scope="scope">
...@@ -232,19 +231,6 @@ ...@@ -232,19 +231,6 @@
</el-col> </el-col>
</el-row> </el-row>
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="12">
<el-form-item label="排序" prop="sortNo">
<el-input-number
v-model="form.sortNo"
placeholder="请输入排序"
:min="0"
:step="1"
style="width: 100%"
/>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="24"> <el-col :span="24">
<el-form-item label="仓库地点" prop="address"> <el-form-item label="仓库地点" prop="address">
<el-input v-model="form.address" type="textarea" placeholder="请输入内容" :rows="3" /> <el-input v-model="form.address" type="textarea" placeholder="请输入内容" :rows="3" />
...@@ -374,10 +360,6 @@ export default { ...@@ -374,10 +360,6 @@ export default {
isEnabled: [ isEnabled: [
{ required: true, message: '应用状态不能为空', trigger: 'change' } { required: true, message: '应用状态不能为空', trigger: 'change' }
], ],
sortNo: [
{ required: true, message: '排序不能为空', trigger: 'blur' },
{ type: 'number', message: '排序必须为数字值', trigger: 'blur' }
],
area: [ area: [
{ {
validator: (rule, value, callback) => { validator: (rule, value, callback) => {
......
...@@ -49,7 +49,21 @@ public class StorageLocationsServiceImpl implements IStorageLocationsService ...@@ -49,7 +49,21 @@ public class StorageLocationsServiceImpl implements IStorageLocationsService
@Override @Override
public StorageLocations selectStorageLocationsById(String id) public StorageLocations selectStorageLocationsById(String id)
{ {
return storageLocationsMapper.selectStorageLocationsById(id); StorageLocations storageLocations = storageLocationsMapper.selectStorageLocationsById(id);
String[] AllowedCategoryIds = storageLocations.getAllowedCategoryIds().split(",");
String AllowedCategoryName = "";
for (String AllowedCategoryId : AllowedCategoryIds) {
Materials materials = materialsMapper.selectMaterialsById(AllowedCategoryId);
if (materials != null && materials.getMaterialName() != null) {
String categoryName = materials.getMaterialName().trim(); // 去除首尾空格
if (AllowedCategoryName != "") {
AllowedCategoryName += ",";
}
AllowedCategoryName += categoryName;
}
}
storageLocations.setAllowedCategoryNames(AllowedCategoryName);
return storageLocations;
} }
@Override @Override
...@@ -77,18 +91,14 @@ public class StorageLocationsServiceImpl implements IStorageLocationsService ...@@ -77,18 +91,14 @@ public class StorageLocationsServiceImpl implements IStorageLocationsService
if (storageLocations2.getAllowedCategoryIds() != null && !storageLocations2.getAllowedCategoryIds().isEmpty()){ if (storageLocations2.getAllowedCategoryIds() != null && !storageLocations2.getAllowedCategoryIds().isEmpty()){
String[] AllowedCategoryIds = storageLocations2.getAllowedCategoryIds().split(","); String[] AllowedCategoryIds = storageLocations2.getAllowedCategoryIds().split(",");
for (String AllowedCategoryId : AllowedCategoryIds) { for (String AllowedCategoryId : AllowedCategoryIds) {
Materials materials = materialsMapper.selectMaterialsById(AllowedCategoryId);
List<Materials> materials = materialsMapper.selectMaterialsBySapNo(AllowedCategoryId); if (materials != null && materials.getMaterialName() != null) {
if (materials != null && !materials.isEmpty()) { String categoryName = materials.getMaterialName().trim(); // 去除首尾空格
Materials materials1 = materials.get(0);
if (materials1 != null && materials1.getMaterialName() != null) {
String categoryName = materials1.getMaterialName().trim(); // 去除首尾空格
if (AllowedCategoryName != "") { if (AllowedCategoryName != "") {
AllowedCategoryName += ","; AllowedCategoryName += ",";
} }
AllowedCategoryName += categoryName; AllowedCategoryName += categoryName;
} } }
} }
} }
storageLocations2.setAllowedCategoryNames(AllowedCategoryName); storageLocations2.setAllowedCategoryNames(AllowedCategoryName);
...@@ -123,11 +133,8 @@ public class StorageLocationsServiceImpl implements IStorageLocationsService ...@@ -123,11 +133,8 @@ public class StorageLocationsServiceImpl implements IStorageLocationsService
storageLocationsCategory.setCategoryId(categoryId); storageLocationsCategory.setCategoryId(categoryId);
storageLocationsCategory.setCreateTime(DateUtils.getNowDate()); storageLocationsCategory.setCreateTime(DateUtils.getNowDate());
storageLocationsCategory.setCreateUserCode(String.valueOf(SecurityUtils.getUserId())); storageLocationsCategory.setCreateUserCode(String.valueOf(SecurityUtils.getUserId()));
List<Materials> materials = materialsMapper.selectMaterialsBySapNo(categoryId); Materials materials = materialsMapper.selectMaterialsById(categoryId);
if (materials != null && !materials.isEmpty()) { storageLocationsCategory.setCategoryName(materials.getMaterialName());
Materials materials1 = materials.get(0);
storageLocationsCategory.setCategoryName(materials1.getMaterialName());
}
storageLocationsCategoryMapper.insertStorageLocationsCategory(storageLocationsCategory); storageLocationsCategoryMapper.insertStorageLocationsCategory(storageLocationsCategory);
} }
} }
...@@ -162,11 +169,8 @@ public class StorageLocationsServiceImpl implements IStorageLocationsService ...@@ -162,11 +169,8 @@ public class StorageLocationsServiceImpl implements IStorageLocationsService
storageLocationsCategory.setCategoryId(categoryId); storageLocationsCategory.setCategoryId(categoryId);
storageLocationsCategory.setUpdateTime(DateUtils.getNowDate()); storageLocationsCategory.setUpdateTime(DateUtils.getNowDate());
storageLocationsCategory.setUpdateUserCode(String.valueOf(SecurityUtils.getUserId())); storageLocationsCategory.setUpdateUserCode(String.valueOf(SecurityUtils.getUserId()));
List<Materials> materials = materialsMapper.selectMaterialsBySapNo(categoryId); Materials materials = materialsMapper.selectMaterialsById(categoryId);
if (materials != null && !materials.isEmpty()) { storageLocationsCategory.setCategoryName(materials.getMaterialName());
Materials materials1 = materials.get(0);
storageLocationsCategory.setCategoryName(materials1.getMaterialName());
}
storageLocationsCategoryMapper.insertStorageLocationsCategory(storageLocationsCategory); storageLocationsCategoryMapper.insertStorageLocationsCategory(storageLocationsCategory);
} }
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论