Commit 657f60cf by xin.yang

some update

parent 31eab02c
......@@ -721,6 +721,9 @@ export default {
'9000496': 'ID重复',
'9000497': '父级和子级不能相同',
'9000498': '该类型绑定了工装,不能删除',
'9000499': '储位层级错误',
'9000500': '该类别绑定了储位,不能删除',
'9000501': '该仓库绑定了储位,不能删除',
'9100000': 'Departments cannot be empty',
'9100001': 'Position cannot be empty',
......
......@@ -748,6 +748,9 @@ export default {
'9000496': 'ID重复',
'9000497': '父级和子级不能相同',
'9000498': '该类型绑定了工装,不能删除',
'9000499': '储位层级错误',
'9000500': '该类别绑定了储位,不能删除',
'9000501': '该仓库绑定了储位,不能删除',
'9100000': '部门不能为空',
......
......@@ -292,6 +292,27 @@ export default {
},
//添加提交
addPost(){
if(!this.stid){
this.$Message.error("请填写ID");
return false;
}
if(!this.whid1){
this.$Message.error("请选择仓库");
return false;
}
if(!this.sTypes || this.sTypes.length === 0){
this.$Message.error("请填写储位层级");
return false;
}
else{
for(var i = 0;i<this.sTypes.length;i++){
if(!this.sTypes[i].val){
this.$Message.error("请填写"+this.sTypes[i].name);
return false;
}
}
}
let code = 0;
if(!this.stid){
code = 1;
......
......@@ -21,6 +21,7 @@ using Siger.Middlelayer.WmsRepository.Repositories.Interface;
using Siger.Middlelayer.WmsRepository.Request;
using Siger.Middlelayer.WmsRepository.Response;
using Siger.Middlelayer.Common.Extensions;
using Siger.Middlelayer.Log;
namespace Siger.ApiWMS.Controllers
{
......@@ -237,6 +238,10 @@ namespace Siger.ApiWMS.Controllers
throw new BadRequestException(CommonEnum.LayerNotClean);
}
//存在此列表记录
if (location.GetList(q => q.projectid == ProjectId && q.status == (int)RowState.Valid && q.typeid == req.id).Any())
{
throw new BadRequestException(RequestEnum.CategoryBindLocationData);
}
entity.status = (int)RowState.Invalid;
entity.update_time = DateTime.Now;
......@@ -396,7 +401,7 @@ namespace Siger.ApiWMS.Controllers
locationData = locationAllData.Where(f => typeids.Contains(f.typeid)).Skip((page - 1) * pageSize).Take(pageSize).ToList();
}
Dictionary<int, string> waveHouseDic = new Dictionary<int, string>();
storage.GetList(f => f.status == (int)RowState.Valid && f.projectid == ProjectId).Select(f => new { f.id, f.name }).ToList().ForEach(f =>
storage.GetList(f => f.projectid == ProjectId).Select(f => new { f.id, f.name }).ToList().ForEach(f =>
{
waveHouseDic.Add(f.id, f.name);
});
......@@ -413,7 +418,7 @@ namespace Siger.ApiWMS.Controllers
{
id = item.id,
pid = item.parentid,
storageName = waveHouseDic[item.storageid],
storageName = waveHouseDic.ContainsKey(item.storageid) ? waveHouseDic[item.storageid] : "",
serialNumber = item.serial_number,
state = item.status,
field = new List<FiledName>(),
......@@ -458,8 +463,9 @@ namespace Siger.ApiWMS.Controllers
}
result.Add(tmp);
}
catch (Exception)
catch (Exception e)
{
Logger.WriteLineError(e.Message);
}
}
......@@ -927,6 +933,20 @@ namespace Siger.ApiWMS.Controllers
throw new BadRequestException(RequestEnum.LocationTypeNotFound);
}
var sonLocationTypes = GetSonTypes(0, locationTypes).ToList();
if(req.storeArr.Count != sonLocationTypes.Count)
{
throw new BadRequestException(RequestEnum.LocationLevelError);
}
foreach(var store in req.storeArr)
{
if (string.IsNullOrEmpty(store.val))
{
throw new BadRequestException(RequestEnum.ParameterMiss);
}
}
var locationTypeId = sonLocationTypes.LastOrDefault()?.id ?? 0;
var waveHouse = storage.Get(q => q.projectid == ProjectId && q.status == (int)RowState.Valid && q.id == req.warehouseid);
if (waveHouse == null)
......@@ -1060,6 +1080,20 @@ namespace Siger.ApiWMS.Controllers
throw new BadRequestException(RequestEnum.LocationTypeNotFound);
}
var sonLocationTypes = GetSonTypes(0, locationTypes).ToList();
if (req.storeArr.Count != sonLocationTypes.Count)
{
throw new BadRequestException(RequestEnum.LocationLevelError);
}
foreach (var store in req.storeArr)
{
if (string.IsNullOrEmpty(store.val))
{
throw new BadRequestException(RequestEnum.ParameterMiss);
}
}
var locationTypeId = sonLocationTypes.LastOrDefault()?.id ?? 0;
var waveHouse = storage.Get(q => q.projectid == ProjectId && q.status == (int)RowState.Valid && q.id == req.warehouseid);
if (waveHouse == null)
......
......@@ -188,6 +188,11 @@ namespace Siger.ApiWMS.Controllers
if (entity == null)
throw new BadRequestException(CommonEnum.NoData);
if (location.GetList(q => q.projectid == ProjectId && q.status == (int)RowState.Valid && q.storageid == req.id).Any())
{
throw new BadRequestException(RequestEnum.WavehouseBindLocationData);
}
entity.status = (int)RowState.Valid;
storage.Update(entity);
if (_unitOfWork.Commit() > 0)
......
......@@ -1479,5 +1479,14 @@ namespace Siger.Middlelayer.Common
[Description("该类型绑定了工装,不能删除")]
CategoryBindFixtureToolData,
[Description("储位层级错误")]
LocationLevelError,
[Description("该类别绑定了储位,不能删除")]
CategoryBindLocationData,
[Description("该仓库绑定了储位,不能删除")]
WavehouseBindLocationData,
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment