Commit f997f0e1 by yiyu.li
parents 89a6f874 3f0e0000
......@@ -123,6 +123,10 @@
<Input class="searchInput" type="text" id="input1" v-model="editobj.checktype_value" disabled="disabled" />
</div>
<div class="filter">
<label >{{$t('950232')}}:</label>
<Input class="searchInput" type="text" id="input1" v-model="editobj.routename" disabled="disabled" />
</div>
<div class="filter">
<label >{{$t('800008')}}:</label>
<Input class="searchInput" type="text" id="input1" v-model="editobj.sn" disabled="disabled" />
</div>
......@@ -330,10 +334,6 @@ export default{
title: this.$t('100089'),
key: 'productcode'
},
// {
// title: this.$t('500006'),
// key: 'routename'
// },
{
title: this.$t('100088'),
key: 'productname'
......@@ -347,6 +347,10 @@ export default{
key: 'workorder'
},
{
title: this.$t('950232'),
key: 'routename'
},
{
title: this.$t('800008'),
key: 'sn'
},
......
......@@ -678,6 +678,7 @@ export default {
this.stationList = res.data.data;
this.station = this.stationList[0];
this.initproduct(this.station.id);
this.initSn(this.station.id);
});
}
},
......@@ -719,7 +720,7 @@ export default {
axios
.request({
url:
"/acc/SectionProperty/GetSn?productId=" + productid + "&sectionId=" + sectionid,
"/acc/SectionProperty/GetSn?sectionId=" + sectionid,
method: "get",
})
.then((res) => {
......
......@@ -30,10 +30,11 @@ namespace Siger.ApiACC.Controllers
private readonly IAutomationLocationRepository _autoLocationRepository;
private readonly IAutomationFixtureMonitor _fixtureMonitor;
private readonly IProductRouteRepository _routeRepository;
private readonly IAutomationFixtureToolsProductRepository _automationFixtureToolsProduct;
public AutomationLocationController(IUnitOfWork unitOfWork, IAutomationFixtureToolsCategoryRepository toolsCategoryRepository,
IAutomationFixtureToolsRepository toolsRepository, IAutomationLocationRepository autoLocationRepository,
IAutomationFixtureMonitor fixtureMonitor, IProductRouteRepository routeRepository)
IAutomationFixtureMonitor fixtureMonitor, IProductRouteRepository routeRepository,IAutomationFixtureToolsProductRepository automationFixtureToolsProduct)
{
_unitOfWork = unitOfWork;
_toolsCategoryRepository = toolsCategoryRepository;
......@@ -41,6 +42,7 @@ namespace Siger.ApiACC.Controllers
_autoLocationRepository = autoLocationRepository;
_fixtureMonitor = fixtureMonitor;
_routeRepository = routeRepository;
_automationFixtureToolsProduct = automationFixtureToolsProduct;
}
[HttpGet]
......@@ -192,6 +194,8 @@ namespace Siger.ApiACC.Controllers
{
throw new BadRequestException(RequestEnum.FixtureToolNotFound);
}
var fixturetoolProduct = _automationFixtureToolsProduct.Get(f => f.fixturetools == fixturetool.guid);
var location = _autoLocationRepository.GetLocation(req.locationid.ToInt(), ProjectId);
if (location == null)
{
......@@ -209,6 +213,8 @@ namespace Siger.ApiACC.Controllers
guid = Guid.NewGuid().ToString(),
locationid = location.locationid,
fixturetools = fixturetool.guid,
productid= fixturetoolProduct != null ? fixturetoolProduct.productid : 0,
productcode = fixturetoolProduct!=null? fixturetoolProduct.productcode:"",
attachment = req.fileurl,
filename = req.filename,
remark = req.remark,
......@@ -244,6 +250,7 @@ namespace Siger.ApiACC.Controllers
{
throw new BadRequestException(RequestEnum.FixtureToolNotFound);
}
var fixturetoolProduct = _automationFixtureToolsProduct.Get(f => f.fixturetools == fixturetool.guid);
var location = _autoLocationRepository.GetLocation(req.locationid.ToInt(), ProjectId);
if (location == null)
{
......@@ -263,6 +270,9 @@ namespace Siger.ApiACC.Controllers
entity.remark = req.remark;
entity.updatetime = DateTime.Now;
entity.updator = UserId;
entity.productid = fixturetoolProduct != null ? fixturetoolProduct.productid : 0;
entity.productcode = fixturetoolProduct != null ? fixturetoolProduct.productcode : "";
_autoLocationRepository.Update(entity);
if (_unitOfWork.Commit() > 0)
{
......
......@@ -35,9 +35,10 @@ namespace Siger.ApiACC.Controllers
private readonly IAutomationFixtureMonitor _automationFixtureMonitor;
private readonly IAutomationFixtureToolsProductRepository _automationFixtureToolsProduct;
private readonly IAutomationFixtureToolsRepository _automationFixtureTools;
private readonly IAutomationLocationRepository _automationLocation;
public AutomationOperateController(IUnitOfWork unitOfWork,ISigerProjectLevelSectionRepository sigerProjectLevelSection , ISigerDict sigerDict,IAutomationMachineStatus automationMachineStatus,ISigerProjectMachineAttributionRepository sigerProjectMachineAttribution,IAutomationTaskListRepository automationTaskList,
IProductPlanDetails planDetails,IProductPlanRepository productPlan,IAutomationFixtureMonitor automationFixtureMonitor ,IAutomationFixtureToolsProductRepository automationFixtureToolsProduct,IAutomationFixtureToolsRepository automationFixtureTools)
IProductPlanDetails planDetails,IProductPlanRepository productPlan,IAutomationFixtureMonitor automationFixtureMonitor ,IAutomationFixtureToolsProductRepository automationFixtureToolsProduct,IAutomationFixtureToolsRepository automationFixtureTools, IAutomationLocationRepository automationLocation)
{
_unitOfWork = unitOfWork;
_sigerProjectLevelSection = sigerProjectLevelSection;
......@@ -50,6 +51,7 @@ namespace Siger.ApiACC.Controllers
_automationFixtureMonitor = automationFixtureMonitor;
_automationFixtureToolsProduct = automationFixtureToolsProduct;
_automationFixtureTools = automationFixtureTools;
_automationLocation = automationLocation;
}
/// <summary>
......@@ -173,7 +175,7 @@ namespace Siger.ApiACC.Controllers
return new ObjectResult(result);
}
/// <summary>
/// 准备上料 -生成指令 load
/// 准备上料 -生成指令 load (立库->上料位)
/// </summary>
/// <param name="loading"></param>
/// <returns></returns>
......@@ -348,6 +350,8 @@ namespace Siger.ApiACC.Controllers
throw new BadRequestException(AccEnum.MonitorNotfound);
}
var taskNo = _automationTaskList.CrateTaskNumber(Automation.TaskTrigerType.Manual);
_automationTaskList.Insert(new siger_automation_task_list
{
......@@ -376,7 +380,6 @@ namespace Siger.ApiACC.Controllers
});
if (_unitOfWork.Commit() > 0)
{
Logger.WriteLineError($"手动任务创建成功-{Siger.Middlelayer.Common.Helpers.EnumHelper.GetEnumDesc(Automation.TaskAction.Step_SXLW_LK)}");
......
......@@ -40,9 +40,17 @@ namespace Siger.ApiACC.Controllers
public IActionResult GetPageList(string category, string code, string name, string state, int page, int pagesize, string toexcel)
{
var data = _toolsRepository.GetPagedList(category.ToInt(), code, name, string.IsNullOrEmpty(state) ? -1 : state.ToInt(), ProjectId, page, pagesize, toexcel);
var list = new List<ResponseFixtureTools>();
var categorys = _toolsCategoryRepository.GetList(q => q.projectId == ProjectId && q.status == (int)RowState.Valid).ToList();
var categoryIds = new List<int>();
if(category.ToInt() > 0)
{
var cate = categorys.FirstOrDefault(q => q.id == category.ToInt());
var sonCates = GetSonCategoryList(cate.guid, categorys);
categoryIds = sonCates.Select(q => q.id).ToList();
categoryIds.Add(category.ToInt());
}
var data = _toolsRepository.GetPagedList(categoryIds, code, name, string.IsNullOrEmpty(state) ? -1 : state.ToInt(), ProjectId, page, pagesize, toexcel);
var list = new List<ResponseFixtureTools>();
foreach(var item in data.Data)
{
var cates = GetParentCategoryList(item.cate_guid, categorys);
......@@ -258,7 +266,16 @@ namespace Siger.ApiACC.Controllers
[HttpGet]
public IActionResult GetCategoryPageList(string id, int page, int pagesize, string toexcel = "")
{
var data = _toolsCategoryRepository.GetPagedList(id.ToInt(), ProjectId, page, pagesize, toexcel);
var categorys = _toolsCategoryRepository.GetList(q => q.projectId == ProjectId && q.status == (int)RowState.Valid).ToList();
var categoryIds = new List<int>();
if (id.ToInt() > 0)
{
var cate = categorys.FirstOrDefault(q => q.id == id.ToInt());
var sonCates = GetSonCategoryList(cate.guid, categorys);
categoryIds = sonCates.Select(q => q.id).ToList();
categoryIds.Add(id.ToInt());
}
var data = _toolsCategoryRepository.GetPagedList(categoryIds, ProjectId, page, pagesize, toexcel);
if(toexcel.ToInt() == 1)
{
return ExportCategoryExcel(data.Data);
......
......@@ -38,5 +38,10 @@ namespace Siger.Middlelayer.Share.Constant
/// </summary>
public const string UploadloadStation = "LoadStation";
/// <summary>
/// 立库
/// </summary>
public const string WarehouseStation = "WarehouseStation";
}
}
......@@ -334,7 +334,9 @@ namespace Siger.Middlelayer.Common.ModuleEnum
[Description("设备已经生产完成")]
MachineProCompalate,
[Description("该设备当前无工装状态")]
MonitorNotfound
MonitorNotfound,
[Description("未配置字典信息")]
AutomationDictNotfound
}
public enum SeriNumCfg
......
......@@ -14,14 +14,13 @@ namespace Siger.Middlelayer.Utility.ImportEntities
[ExcelColumn("产品名称")]
public string ProductName { get; set; }
[ExcelColumn("工序")]
public string RouteName { get; set; }
[ExcelColumn("位置")]
public string Section { get; set; }
[ExcelColumn("工单")]
public string WorkOrder { get; set; }
[ExcelColumn("工艺")]
public string RouteName { get; set; }
[ExcelColumn("二维码")]
public string SN { get; set; }
[ExcelColumn("偏差放行数量")]
......
......@@ -18,6 +18,26 @@ namespace Siger.Middlelayer.AccRepository.Entities
/// 工装GUID
/// </summary>
public string fixturetools { get; set; }
public int productid { get; set; }
public string productcode { get; set; }
/// <summary>
/// 工件对应的工单号
/// </summary>
public string ordernumber { get; set; }
/// <summary>
/// 工装工件
/// </summary>
public string sn { get; set; }
/// <summary>
/// 每加工CNC 设备 经过的工序: 标准节拍表
/// </summary>
public int routeid { get; set; }
/// <summary>
/// 每加工CNC 设备 经过的工序: 标准节拍表
/// </summary>
public string route { get; set; }
/// <summary>
/// 附件
/// </summary>
......
......@@ -23,7 +23,7 @@ namespace Siger.Middlelayer.AccRepository.Repositories
_context = context;
}
public IPagedCollectionResult<ResponseFixtureToolsCategory> GetPagedList(int id, int projectid, int page, int pagesize, string toexcel = "")
public IPagedCollectionResult<ResponseFixtureToolsCategory> GetPagedList(List<int> id, int projectid, int page, int pagesize, string toexcel = "")
{
Expression<Func<ResponseFixtureToolsCategory, bool>> FunNum = f => true;
var query = from q in _context.siger_automation_fixture_tools_category
......@@ -41,9 +41,9 @@ namespace Siger.Middlelayer.AccRepository.Repositories
createtime = q.createtime.ToString(ParameterConstant.DateTimeFormat),
time = q.createtime
};
if (id > 0)
if (id.Any())
{
FunNum = q => q.id == id;
FunNum = q => id.Contains(q.id);
}
if(toexcel.ToInt() == 1)
{
......
......@@ -97,6 +97,28 @@ namespace Siger.Middlelayer.AccRepository.Repositories
}
}
/// <summary>
/// 获取 交期最早的订单
/// </summary>
/// <param name="productIds"></param>
/// <param name="projectId"></param>
/// <returns></returns>
public IEnumerable<ResponseAutomationPlanOrder> GetDeliveryOrder(List<int>productIds,int projectId)
{
var query = from d in _context.siger_project_product_plan_detail
join p in _context.siger_project_product_plan on d.PlanId equals p.id
where d.projectId == projectId && productIds.Contains(p.product_id) && d.status != (int)RowState.Invalid && p.status != (int)RowState.Invalid
select new ResponseAutomationPlanOrder
{
productId=p.product_id,
ordernumber=d.OrderNumber,
productCode=p.product_code,
productName=p.product_name,
delvery=p.delivery_time,
};
return query.OrderBy(f => f.delvery);
}
public ResponsePlanlFixtureInfo GetPlanFixtureInfo(int projectId, string ordernumber)
{
......
......@@ -24,7 +24,7 @@ namespace Siger.Middlelayer.AccRepository.Repositories
_context = context;
}
public IPagedCollectionResult<ResponseFixtureTools> GetPagedList(int category, string code, string name, int state,
public IPagedCollectionResult<ResponseFixtureTools> GetPagedList(List<int> category, string code, string name, int state,
int projectid, int page, int pagesize, string toexcel = "")
{
var query = from q in _context.siger_automation_fixture_tools
......@@ -53,9 +53,9 @@ namespace Siger.Middlelayer.AccRepository.Repositories
updatetime = q.updatetime.HasValue && q.updatetime > DateTime.MinValue ? q.updatetime.Value.ToString(ParameterConstant.DateTimeFormat) : ""
};
Expression<Func<ResponseFixtureTools, bool>> categoryExpression = f => true;
if (category > 0)
if (category.Any())
{
categoryExpression = q => q.categoryid == category;
categoryExpression = q => category.Contains(q.categoryid);
}
Expression<Func<ResponseFixtureTools, bool>> codeExpression = f => true;
if (!string.IsNullOrEmpty(code))
......
......@@ -35,7 +35,7 @@ namespace Siger.Middlelayer.AccRepository.Repositories
from u in uu.DefaultIfEmpty()
join m in _context.siger_automation_fixture_tools_moniter on q.fixturetools equals m.fixtureguid into mm
from m in mm.DefaultIfEmpty()
join r in _context.siger_project_product_route on m.route equals r.id into rr
join r in _context.siger_project_beat_set on m.route equals r.id into rr
from r in rr.DefaultIfEmpty()
where q.projectId == projectid && q.status == (int)RowState.Valid
select new ResponseAutomationLocation
......@@ -58,8 +58,8 @@ namespace Siger.Middlelayer.AccRepository.Repositories
status = q.status,
updatetime = q.updatetime.HasValue && q.updatetime > DateTime.MinValue ? q.updatetime.Value.ToString(ParameterConstant.DateTimeFormat) : "",
sn = m.sn ?? "",
route = r.name ?? "",
routenumber = r == null ? "" : r.serialNumber.ToString(),
route = r.route_name ?? "",
routenumber = r == null ? "" : r.route_number.ToString(),
cate_guid = c.guid ?? "",
categoryId = c == null ? 0 : c.id
};
......
......@@ -9,7 +9,7 @@ namespace Siger.Middlelayer.AccRepository.Repositories.Interface
{
public interface IAutomationFixtureToolsCategoryRepository : IAccRepositoryBase<siger_automation_fixture_tools_category>
{
IPagedCollectionResult<ResponseFixtureToolsCategory> GetPagedList(int id, int projectid, int page, int pagesize, string toexcel = "");
IPagedCollectionResult<ResponseFixtureToolsCategory> GetPagedList(List<int> id, int projectid, int page, int pagesize, string toexcel = "");
CommonImportResult ImportData(IEnumerable<FixtureToolsCategoryTemplate> list, int projectid);
}
......
......@@ -23,5 +23,13 @@ namespace Siger.Middlelayer.AccRepository.Repositories.Interface
CommonImportResult ImportData(IEnumerable<FixtureToolsProductTemplate> list, int projectid, int userid);
/// <summary>
/// 获取交期最近的订单
/// </summary>
/// <param name="productIds"></param>
/// <param name="projectId"></param>
/// <returns></returns>
IEnumerable<ResponseAutomationPlanOrder> GetDeliveryOrder(List<int> productIds, int projectId);
}
}
......@@ -9,7 +9,7 @@ namespace Siger.Middlelayer.AccRepository.Repositories.Interface
{
public interface IAutomationFixtureToolsRepository : IAccRepositoryBase<siger_automation_fixture_tools>
{
IPagedCollectionResult<ResponseFixtureTools> GetPagedList(int category, string code, string name, int state,
IPagedCollectionResult<ResponseFixtureTools> GetPagedList(List<int> category, string code, string name, int state,
int projectid, int page, int pagesize, string toexcel = "");
IEnumerable<ResponseFixtureTools> GetDataList(int categoryid, int projectid);
......
......@@ -40,4 +40,15 @@ namespace Siger.Middlelayer.AccRepository.Response
public int Location { get; set; }
public string Sn { get; set; }
}
public class ResponseAutomationPlanOrder
{
public string ordernumber { get; set; }
public int productId { get; set; }
public string productCode { get; set; }
public string productName { get; set; }
public int delvery { get; set; }
}
}
......@@ -157,5 +157,7 @@ namespace Siger.Middlelayer.QmsRepository
public DbSet<siger_tr_sn_trace_detail> siger_tr_sn_trace_detail { get; set; }
public DbSet<siger_project_beat_set> siger_project_beat_set { get; set; }
}
}
using System;
using System.ComponentModel.DataAnnotations.Schema;
namespace Siger.Middlelayer.QmsRepository.Entities
{
/// <summary>
/// siger_project_beat_set Entity Model
/// </summary>
public class siger_project_beat_set: QmsEntityBase
{
/// <summary>
/// 产线id
/// </summary>
public int section_id { get; set; }
/// <summary>
/// 设备id
/// </summary>
public int machineID { get; set; }
/// <summary>
/// 加工程序号
/// </summary>
public string process_number { get; set; }
/// <summary>
/// 产品名称 编号
/// </summary>
public string product_name { get; set; }
/// <summary>
/// 产品图纸号
/// </summary>
public string drawing_number { get; set; }
/// <summary>
/// 标准节拍(单位/ 秒 S )
/// </summary>
public int standard_besat { get; set; }
/// <summary>
/// 日标准产量(单位/pcs个)
/// </summary>
public int daily_standard_output { get; set; }
/// <summary>
/// 添加时间
/// </summary>
public DateTime add_time { get; set; }
/// <summary>
/// 修改时间
/// </summary>
public DateTime? edit_time { get; set; }
/// <summary>
/// 产品名称
/// </summary>
public string product_name_text { get; set; }
/// <summary>
/// 换型时间
/// </summary>
public int changemodeltime { get; set; }
/// <summary>
/// 工序顺序
/// </summary>
public string route_number { get; set; } = "";
/// <summary>
/// 工序名称
/// </summary>
public string route_name { get; set; }
/// <summary>
/// 上下料时间
/// </summary>
public double updown_besat { get; set; }
/// <summary>
/// 产量比率
/// </summary>
public int yieldrate { get; set; }
/// <summary>
/// 有效开始时间
/// </summary>
public DateTime start_time { get; set; }
/// <summary>
/// 有效结束时间
/// </summary>
public DateTime end_time { get; set; }
}
}
......@@ -38,7 +38,7 @@ namespace Siger.Middlelayer.QmsRepository.Repositories
from m in mm.DefaultIfEmpty()
join s in _context.siger_project_level_section on q.sectionid equals s.id into ss
from s in ss.DefaultIfEmpty()
join r in _context.siger_project_product_route on q.routeid equals r.id into rr
join r in _context.siger_project_beat_set on q.routeid equals r.id into rr
from r in rr.DefaultIfEmpty()
join u1 in _context.siger_project_user on q.send_mid equals u1.mid into uu1
from u1 in uu1.DefaultIfEmpty()
......@@ -60,7 +60,7 @@ namespace Siger.Middlelayer.QmsRepository.Repositories
check_time = (q.check_time.HasValue && q.check_time != DateTime.Now) ?
q.check_time.Value.ToString(ParameterConstant.DateTimeFormat) : "",
routeid = q.routeid,
routename = r.name ?? "",
routename = r.route_name ?? "",
materialid = q.materialid,
materialname = m.name ?? "",
materialpn = m.pn ?? "",
......
......@@ -34,7 +34,7 @@ namespace Siger.Middlelayer.QmsRepository.Repositories
join s in _context.siger_project_level_section on q.sectionid equals s.id
join m in _context.siger_tr_materials on q.materialid equals m.id into mm
from m in mm.DefaultIfEmpty()
join r in _context.siger_project_product_route on q.routeid equals r.id into rr
join r in _context.siger_project_beat_set on q.routeid equals r.id into rr
from r in rr.DefaultIfEmpty()
join u1 in _context.siger_user on q.send_mid equals u1.id into uu1
from u1 in uu1.DefaultIfEmpty()
......@@ -58,7 +58,7 @@ namespace Siger.Middlelayer.QmsRepository.Repositories
sectionid = q.sectionid,
sectionname = s.title ?? "",
routeid = q.routeid,
routename = r.name ?? "",
routename = r.route_name ?? "",
testroom = q.testroom,
sn = q.sn,
checktype = q.check_type,
......
......@@ -269,6 +269,12 @@ CREATE TABLE IF NOT EXISTS `siger_automation_location` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`locationid` int(11) NOT NULL DEFAULT 0 COMMENT '储位位置',
`fixturetools` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '工装GUID',
`productid` int(11) NULL DEFAULT 0 COMMENT '产品ID',
`productcode` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '产品CODE',
`ordernumber` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '工件对应工单号',
`sn` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '工件',
`routeid` int(11) NULL DEFAULT 0,
`route` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '工序',
`attachment` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '附件',
`filename` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '附件名称',
`remark` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注',
......
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