Commit ccc4eed0 by jiawei.su
parents 8b5780e4 a1303788
......@@ -50,8 +50,10 @@ export default {
var errs = data.split(";");
errs.forEach((item) => {
var inf = item.split(",");
console.log(this.$t(inf[1]));
msg +=
this.$t("1077") + inf[0] + this.$t("1083") + this.$t(inf[1]) + ",";
this.$t("1077") + inf[0] + this.$t("1083") + this.$t(inf[1].trim()) + ",";
});
msg = msg.slice(0, -1);
this.window_warning(msg);
......
......@@ -742,6 +742,7 @@ export default {
'9000517': '请填写子工装编号',
'9000518': '请填写储位ID',
'9000519': '请填写仓库名称',
'9000520': '请输入工件编号',
'9100000': 'Departments cannot be empty',
'9100001': 'Position cannot be empty',
......
......@@ -769,6 +769,7 @@ export default {
'9000517': '请填写子工装编号',
'9000518': '请填写储位ID',
'9000519': '请填写仓库名称',
'9000520': '请输入工件编号',
'9100000': '部门不能为空',
......
......@@ -620,7 +620,7 @@ export default {
getRoutesByProduct(val) {
// 选择产品查询工艺路径
let id = 0;
id = val.value?val.value:0;
id = val&&val.value?val.value:0;
var params = {
productId: id,
page: 1,
......
......@@ -295,7 +295,7 @@ export default {
},
{
title: "储位编号",
key: "locationcode",
key: "locationid",
},
{
title: "工装编号",
......@@ -318,7 +318,7 @@ export default {
},
{
title: "储位编号",
key: "locationcode",
key: "locationid",
},
{
title: "工装编号",
......@@ -505,7 +505,7 @@ export default {
feedReady() {
// 准备上料
if (this.sectionid == 0) {
this.$Message.error("请选择工位");
this.$Message.error("请选择生产线、工位");
return false;
}
let data = {
......
......@@ -10,6 +10,7 @@
class="searchSelect"
:data="datalevel"
:value="leveldata"
@on-change="getSectionId"
></Cascader>
</div>
<div class="filter">
......@@ -300,6 +301,7 @@ export default {
startTime: [],
endTime: [],
detailobj: {},
sectionid:0
};
},
created() {
......@@ -311,7 +313,7 @@ export default {
methods: {
search(page, pagesize) {
let params = {
section: this.sectionId,
section: this.sectionid,
tasktype: this.taskType,
productCode: this.productCode,
sn: this.sn,
......@@ -340,6 +342,13 @@ export default {
this.total = res.data.data.total;
});
},
getSectionId(val) {
this.leveldata = val;
this.sectionid =
this.leveldata.length > 0
? this.leveldata[this.leveldata.length - 1]
: 0;
},
cancel() {
console.log(this.detailobj);
if (!this.detailobj.id) {
......
......@@ -256,7 +256,6 @@
</label>
<DatePicker
class="searchInput"
:disabled="type == 2 ? true : false"
v-model="addobj.deliverydate"
type="date"
></DatePicker>
......
......@@ -396,13 +396,12 @@ export default {
handleSuccess(res, file) {
if (res.ret == 1) {
this.$Message.success(this.$t("950398"));
this.getCategory();
this.search(1, 10);
this.tosearch();
} else {
if ((res.msg + "").indexOf(",") != -1) {
inittip(res.msg);
} else {
this.$Message.error(this.$t(res.data));
this.$Message.error(this.$t(res.msg));
}
}
},
......
......@@ -38,13 +38,15 @@ namespace Siger.ApiACC.Controllers
private readonly ISigerTrMaterialsRepository _materialsRepository;
private readonly IAutomationTaskListRepository _automationTaskList;
private readonly IAutomationFixtureMonitor _fixtureMonitor;
private readonly IProductionBeatSetRepository _beatSetRepository;
public QmsCheckController(IUnitOfWork unitOfWork, IAutomationFixtureToolsProductRepository automationFixtureToolsProduct,
ISigerProjectProductRepository productRepository, ISigerProjectLevelRepository levelRepository,
ISigerProjectLevelSectionRepository levelSectionRepository, IInspectStandardRepository inspectStandard,
ICheckSnTraceInspectionRepository traceInspectionRepository, ICheckSnTraceDetailRepository traceDetailRepository,
ICheckSnListRepository checkSnListRepository, ISigerTrMaterialsRepository materialsRepository,
IAutomationTaskListRepository automationTaskListRepository, IAutomationFixtureMonitor fixtureMonitor)
IAutomationTaskListRepository automationTaskListRepository, IAutomationFixtureMonitor fixtureMonitor,
IProductionBeatSetRepository beatSetRepository)
{
_unitOfWork = unitOfWork;
_automationFixtureToolsProduct = automationFixtureToolsProduct;
......@@ -58,6 +60,7 @@ namespace Siger.ApiACC.Controllers
_materialsRepository = materialsRepository;
_automationTaskList = automationTaskListRepository;
_fixtureMonitor = fixtureMonitor;
_beatSetRepository = beatSetRepository;
}
[HttpPost]
public IActionResult AddManual([FromBody]RequestAddDataCollection req)
......@@ -68,6 +71,15 @@ namespace Siger.ApiACC.Controllers
{
throw new BadRequestException(RequestEnum.ProductNotFound);
}
var route = _beatSetRepository.Get(q => q.projectID == ProjectId && q.status == (int)RowState.Valid && q.id == req.routeid.ToInt());
if (route == null)
{
throw new BadRequestException(RequestEnum.ProcessNotFind);
}
if (string.IsNullOrEmpty(req.sn))
{
throw new BadRequestException(RequestEnum.PleaseInputPartSerialNumber);
}
var maxLevel = _levelRepository.GetList(t => t.status == (int)RowState.Valid && t.projectid == ProjectId).Max(q => q.id);
var section = _levelSectionRepository.Get(t => t.status == (int)RowState.Valid && t.projectid == ProjectId && t.id == req.sectionid);
if (section == null || section.levelid != maxLevel)
......
......@@ -16,6 +16,7 @@ using Siger.Middlelayer.Utility.Helpers;
using Siger.Middlelayer.Utility.ImportEntities;
using Siger.Middlelayer.WmsRepository.Entities;
using Siger.Middlelayer.WmsRepository.Repositories.Interface;
using Siger.Middlelayer.Common.Extensions;
namespace Siger.ApiWMS.Controllers
{
......@@ -116,10 +117,19 @@ namespace Siger.ApiWMS.Controllers
var locationTypes = _location_TypeRepository.GetList(q => q.projectid == ProjectId && q.status == (int)RowState.Valid).ToList();
if (!locationTypes.Any())
{
throw new BadRequestException(RequestEnum.LocationTypeNotFound);
return new CommonImportResult(0, string.Join(';', (int)RequestEnum.LocationTypeNotFound));
}
var sonLocationTypes = GetSonTypes(0, locationTypes).Select(q => new Tuple<int, string>(q.id, q.name)).ToList();
var checkResult = excelHelper.CheckExcel(sonLocationTypes);
if (checkResult.Any())
{
return new CommonImportResult(0, string.Join(';', checkResult));
}
var data = excelHelper.ConvertSheetToList(sonLocationTypes);
if (!data.Any())
{
return new CommonImportResult(0, string.Join(';', (int)CommonEnum.NoData));
}
var result = _locationRepository.ImportStorageLocations(data, ProjectId, UserId);
return result;
}
......
......@@ -1544,5 +1544,8 @@ namespace Siger.Middlelayer.Common
[Description("请填写仓库名称")]
PleaseInputWarehouseName,
[Description("请输入工件编号")]
PleaseInputPartSerialNumber,
}
}
......@@ -6,6 +6,7 @@ using System.Reflection;
using System.Text.RegularExpressions;
using OfficeOpenXml;
using OfficeOpenXml.Style;
using Siger.Middlelayer.Common;
using Siger.Middlelayer.Utility.ExcelImport;
using Siger.Middlelayer.Utility.ImportEntities;
using ExcelColumn = Siger.Middlelayer.Utility.ExcelImport.ExcelColumn;
......@@ -117,6 +118,94 @@ namespace Siger.Middlelayer.Utility.Helpers
return collection;
}
public List<string> CheckExcel(List<Tuple<int, string>> locationTypes)
{
if (Sheet == null)
{
throw new ArgumentNullException(nameof(Sheet));
}
var messages = new List<string>();
var columns = new List<string> { "ID", "仓库名称" };
foreach (var item in locationTypes)
{
columns.Add(item.Item2);
}
var endRow = 2;
for (var row = 2; row <= Sheet.Dimension.Rows; row++)
{
var columnValues = new List<string>();
for (var i = 1; i <= columns.Count; i++)
{
var val = Sheet.Cells[row, i];
if (val != null)
{
columnValues.Add(val.Text);
}
}
if (columnValues.All(string.IsNullOrWhiteSpace))
{
endRow = row - 1;
break;
}
endRow = row;
}
IList<int> rows = new List<int>();
for (var i = 2; i <= endRow; i++)
{
rows.Add(i);
}
foreach (var row in rows)
{
var tnew = new ImportStorageLocations();
int i = 1;
foreach (var col in columns)
{
var cell = Sheet.Cells[row, i];
var val = cell == null ? "" : cell.Value?.ToString() ?? "";
if (i == 1)
{
if (string.IsNullOrEmpty(val))
{
messages.Add($"{row},{(int)RequestEnum.PleaseInputNotZeroIntID}");
return messages;
}
tnew.ID = val;
}
if (i == 2)
{
if (string.IsNullOrEmpty(val))
{
messages.Add($"{row},{(int)RequestEnum.PleaseInputStorageName}");
return messages;
}
tnew.StorageName = val;
}
if (i > 2)
{
var typeId = locationTypes.FirstOrDefault(q => q.Item2 == col);
if (string.IsNullOrEmpty(val))
{
messages.Add(typeId != null ? $"{row}, 请填写{typeId.Item2}" : $"{row}, {(int)RequestEnum.LocationImportFormatError}");
return messages;
}
tnew.Locations.Add(new LocationModels
{
LocationType = typeId == null ? 0 : typeId.Item1,
Location = val
});
}
i++;
}
}
return messages;
}
public void Dispose()
{
Sheet?.Dispose();
......
......@@ -68,7 +68,7 @@ namespace Siger.Middlelayer.AccRepository.Repositories
if (string.IsNullOrEmpty(item.Fixture))
{
errors.Add($"{rowIndex}, {(int)RequestEnum.ParameterMiss}");
errors.Add($"{rowIndex},{(int)RequestEnum.ParameterMiss}");
}
var data = _context.siger_automation_fixture_tools_category.FirstOrDefault(q => q.projectId == projectid && q.status == (int)RowState.Valid && q.name == item.Fixture);
......
......@@ -221,11 +221,13 @@ namespace Siger.Middlelayer.WmsRepository.Repositories
if(!int.TryParse(loca.ID, out int id))
{
errors.Add($"{rowIndex},{(int)RequestEnum.PleaseInputNotZeroIntID}");
return new CommonImportResult(0, string.Join(";", errors));
}
if (string.IsNullOrEmpty(loca.StorageName))
{
errors.Add($"{rowIndex},{(int)RequestEnum.PleaseInputStorageName}");
return new CommonImportResult(0, string.Join(";", errors));
}
if (loca.Locations.Count != sonLocationTypes.Count)
......@@ -238,6 +240,7 @@ namespace Siger.Middlelayer.WmsRepository.Repositories
if (storage == null)
{
errors.Add($"{rowIndex},{(int)RequestEnum.StorageError}");
return new CommonImportResult(0, string.Join(";", errors));
}
else
{
......@@ -249,10 +252,12 @@ namespace Siger.Middlelayer.WmsRepository.Repositories
if(typeId.LocationType == 0)
{
errors.Add($"{rowIndex},{(int)RequestEnum.LocationLevelError}");
return new CommonImportResult(0, string.Join(";", errors));
}
if (string.IsNullOrEmpty(typeId.Location))
{
errors.Add($"{rowIndex},{(int)RequestEnum.PleaseInputLocation}");
return new CommonImportResult(0, string.Join(";", errors));
}
if(storage != null && typeId.LocationType > 0 && loca.ID.ToInt() > 0)
{
......@@ -262,16 +267,11 @@ namespace Siger.Middlelayer.WmsRepository.Repositories
if (locationIdExist != null || locations.Count(q => q.StorageName == loca.StorageName && q.ID == loca.ID) > 1)
{
errors.Add($"{rowIndex},{(int)RequestEnum.IDExist}");
break;
return new CommonImportResult(0, string.Join(";", errors));
}
}
}
if (errors.Any())
{
return new CommonImportResult(0, string.Join(";", errors));
}
list.Add(loca);
rowIndex++;
......
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