触摸屏修改
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
using DOAN.Service.Mobile.IService;
|
using DOAN.Service.Mobile.IService;
|
||||||
|
using Infrastructure.Converter;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
namespace DOAN.Admin.WebApi.Controllers.Mobile;
|
namespace DOAN.Admin.WebApi.Controllers.Mobile;
|
||||||
@@ -17,6 +18,28 @@ public class ReportFlowController : BaseController
|
|||||||
{
|
{
|
||||||
_reportFlowService = reportFlowService;
|
_reportFlowService = reportFlowService;
|
||||||
}
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 根据指定日期获取工单列表
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="startDate"></param>
|
||||||
|
/// <param name="endDate"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
/// <exception cref="CustomException"></exception>
|
||||||
|
|
||||||
|
[HttpGet("get_workorders_by_date")]
|
||||||
|
public IActionResult GetWorkOrdersByDate(DateTime startDate, DateTime endDate)
|
||||||
|
{
|
||||||
|
startDate = DOANConvertDate.ConvertLocalDate(startDate);
|
||||||
|
endDate = DOANConvertDate.ConvertLocalDate(endDate);
|
||||||
|
if(startDate == DateTime.MinValue||endDate==DateTime.MinValue)
|
||||||
|
{
|
||||||
|
throw new CustomException("date is error");
|
||||||
|
}
|
||||||
|
var response = _reportFlowService.GetWorkOrdersByDate(startDate, endDate);
|
||||||
|
return SUCCESS(response);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//TODO 查询工单详情
|
//TODO 查询工单详情
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -112,6 +135,46 @@ public class ReportFlowController : BaseController
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//TODO 输入姓名拼音,查询此人今日报工记录
|
||||||
|
[HttpGet("get_report_info_by_name")]
|
||||||
|
public IActionResult GetReportInfoByName(string name)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(name))
|
||||||
|
{
|
||||||
|
throw new CustomException("name is null");
|
||||||
|
|
||||||
|
}
|
||||||
|
var response= _reportFlowService.GetReportInfoByName(name);
|
||||||
|
return SUCCESS(response);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//TODO 根据工艺路线获取所有工序
|
||||||
|
[HttpGet("get_process_by_route")]
|
||||||
|
public IActionResult GetProcessByRoute(int route_id=32)
|
||||||
|
{
|
||||||
|
var response = _reportFlowService.GetProcessByRoute(route_id);
|
||||||
|
return SUCCESS(response);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//TODO 输入工序id 查询今天报工记录
|
||||||
|
[HttpGet("get_report_by_processid")]
|
||||||
|
public IActionResult GetReportByProcessId(int processId)
|
||||||
|
{
|
||||||
|
if (processId <= 0) {
|
||||||
|
throw new CustomException("processId is error");
|
||||||
|
}
|
||||||
|
var response = _reportFlowService.GetReportByProcessId(processId);
|
||||||
|
return SUCCESS(response);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
"dbConfigs": [
|
"dbConfigs": [
|
||||||
{
|
{
|
||||||
// 远程测试服务器
|
// 远程测试服务器
|
||||||
|
//"Conn": "Data Source=192.168.1.106;User ID=root;Password=123456;Initial Catalog=bzfm_mes;Port=3306",
|
||||||
"Conn": "Data Source=139.224.232.211;User ID=root;Password=doantech123;Initial Catalog=bzfm_mes;Port=3308",
|
"Conn": "Data Source=139.224.232.211;User ID=root;Password=doantech123;Initial Catalog=bzfm_mes;Port=3308",
|
||||||
// "Conn": "Data Source=192.168.0.58;User ID=root;Password=123456;Initial Catalog=bzfm_mes;Port=3306",
|
// "Conn": "Data Source=192.168.0.58;User ID=root;Password=123456;Initial Catalog=bzfm_mes;Port=3306",
|
||||||
"DbType": 0, //数据库类型 MySql = 0, SqlServer = 1, Oracle = 3,PgSql = 4
|
"DbType": 0, //数据库类型 MySql = 0, SqlServer = 1, Oracle = 3,PgSql = 4
|
||||||
@@ -19,7 +20,7 @@
|
|||||||
"DbName": "bzfm_mes" //代码生成默认连接数据库,Oracle库是实例的名称
|
"DbName": "bzfm_mes" //代码生成默认连接数据库,Oracle库是实例的名称
|
||||||
},
|
},
|
||||||
"ShowDbLog": true, //是否打印db日志
|
"ShowDbLog": true, //是否打印db日志
|
||||||
"urls": "http://0.0.0.0:7000", //项目启动url,如果改动端口前端对应devServer也需要进行修改
|
"urls": "http://127.0.0.1:7000", //项目启动url,如果改动端口前端对应devServer也需要进行修改
|
||||||
"corsUrls": [ "http://localhost:8887", "http://localhost:8886", "http://localhost:9090", "http://localhost:8080" ], //跨域地址(前端启动项目,前后端分离单独部署需要设置),多个用","隔开
|
"corsUrls": [ "http://localhost:8887", "http://localhost:8886", "http://localhost:9090", "http://localhost:8080" ], //跨域地址(前端启动项目,前后端分离单独部署需要设置),多个用","隔开
|
||||||
"Upload": {
|
"Upload": {
|
||||||
"rootDirectory": "D:/MES_Test/file",
|
"rootDirectory": "D:/MES_Test/file",
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
"dbConfigs": [
|
"dbConfigs": [
|
||||||
{
|
{
|
||||||
// 远程测试服务器
|
// 远程测试服务器
|
||||||
"Conn": "Data Source=127.0.0.1;User ID=root;Password=123456;Initial Catalog=bzfm_mes;Port=3306",
|
"Conn": "Data Source=192.168.1.106;User ID=root;Password=123456;Initial Catalog=bzfm_mes;Port=3306",
|
||||||
"DbType": 0, //数据库类型 MySql = 0, SqlServer = 1, Oracle = 3,PgSql = 4
|
"DbType": 0, //数据库类型 MySql = 0, SqlServer = 1, Oracle = 3,PgSql = 4
|
||||||
"ConfigId": "0", //多租户唯一标识
|
"ConfigId": "0", //多租户唯一标识
|
||||||
"IsAutoCloseConnection": true
|
"IsAutoCloseConnection": true
|
||||||
|
|||||||
@@ -200,6 +200,7 @@ namespace DOAN.Service.MES.dev
|
|||||||
.Where(it => it.LifeCycleStart <= DateTime.Now)
|
.Where(it => it.LifeCycleStart <= DateTime.Now)
|
||||||
.Where(it => it.LifeCycleEnd >= DateTime.Now)
|
.Where(it => it.LifeCycleEnd >= DateTime.Now)
|
||||||
.ToList();
|
.ToList();
|
||||||
|
|
||||||
// 今日时间
|
// 今日时间
|
||||||
DateTime CurrentTime = new DateTime(
|
DateTime CurrentTime = new DateTime(
|
||||||
DateTime.Now.Year,
|
DateTime.Now.Year,
|
||||||
@@ -209,7 +210,6 @@ namespace DOAN.Service.MES.dev
|
|||||||
0,
|
0,
|
||||||
0
|
0
|
||||||
);
|
);
|
||||||
|
|
||||||
//1. 扫描巡检
|
//1. 扫描巡检
|
||||||
List<DeviceRouteInspectionPlan> deviceRouteInspectionPlan_execute_List =
|
List<DeviceRouteInspectionPlan> deviceRouteInspectionPlan_execute_List =
|
||||||
new List<DeviceRouteInspectionPlan>();
|
new List<DeviceRouteInspectionPlan>();
|
||||||
@@ -225,7 +225,7 @@ namespace DOAN.Service.MES.dev
|
|||||||
foreach (var item in RouteInspectionPlan_day_List)
|
foreach (var item in RouteInspectionPlan_day_List)
|
||||||
{
|
{
|
||||||
//开始日期
|
//开始日期
|
||||||
DateTime start_cal = (DateTime)item.CreatedTime;
|
DateTime start_cal =item.LifeCycleStart??DateTime.MinValue;
|
||||||
start_cal = new DateTime(
|
start_cal = new DateTime(
|
||||||
start_cal.Year,
|
start_cal.Year,
|
||||||
start_cal.Month,
|
start_cal.Month,
|
||||||
@@ -236,8 +236,6 @@ namespace DOAN.Service.MES.dev
|
|||||||
);
|
);
|
||||||
//循环周期
|
//循环周期
|
||||||
int cycle_period = (int)item.DayNum;
|
int cycle_period = (int)item.DayNum;
|
||||||
|
|
||||||
|
|
||||||
DateTime date = start_cal;
|
DateTime date = start_cal;
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
@@ -252,7 +250,6 @@ namespace DOAN.Service.MES.dev
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region 1.2 每周类型处理
|
#region 1.2 每周类型处理
|
||||||
|
|
||||||
|
|
||||||
@@ -299,7 +296,6 @@ namespace DOAN.Service.MES.dev
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region 1.3 每月类型处理
|
#region 1.3 每月类型处理
|
||||||
|
|
||||||
List<DeviceRouteInspectionPlan> DeviceRouteInspectionPlan_month_list = InitDataList
|
List<DeviceRouteInspectionPlan> DeviceRouteInspectionPlan_month_list = InitDataList
|
||||||
@@ -333,8 +329,6 @@ namespace DOAN.Service.MES.dev
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
// 插入数据库
|
// 插入数据库
|
||||||
List<DeviceTaskExecute> executes = new List<DeviceTaskExecute>();
|
List<DeviceTaskExecute> executes = new List<DeviceTaskExecute>();
|
||||||
if (deviceRouteInspectionPlan_execute_List.Count > 0)
|
if (deviceRouteInspectionPlan_execute_List.Count > 0)
|
||||||
@@ -357,7 +351,6 @@ namespace DOAN.Service.MES.dev
|
|||||||
result = Context.Insertable(executes).ExecuteCommand();
|
result = Context.Insertable(executes).ExecuteCommand();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ namespace DOAN.Service.MES.SmartScreen.Product
|
|||||||
/// 数字翻牌器
|
/// 数字翻牌器
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
|
|
||||||
public DigitalTurntableModel DigitalTurntable()
|
public DigitalTurntableModel DigitalTurntable()
|
||||||
{
|
{
|
||||||
DigitalTurntableModel digital=new DigitalTurntableModel();
|
DigitalTurntableModel digital=new DigitalTurntableModel();
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
using DOAN.Model.MES.base_;
|
||||||
|
using DOAN.Model.MES.base_.Dto;
|
||||||
using DOAN.Model.MES.product;
|
using DOAN.Model.MES.product;
|
||||||
using DOAN.Model.Mobile.ReportFlow.Dto;
|
using DOAN.Model.Mobile.ReportFlow.Dto;
|
||||||
|
|
||||||
@@ -6,6 +8,8 @@ namespace DOAN.Service.Mobile.IService;
|
|||||||
public interface IReportFlowService: IBaseService<ProReportwork01>
|
public interface IReportFlowService: IBaseService<ProReportwork01>
|
||||||
{
|
{
|
||||||
|
|
||||||
|
List<ProWorkorder> GetWorkOrdersByDate(DateTime startDate, DateTime endDate);
|
||||||
|
|
||||||
ProWorkorder GetWorkOrderDetail(string workorder);
|
ProWorkorder GetWorkOrderDetail(string workorder);
|
||||||
|
|
||||||
ProReportwork01 GetProcessReportWorkDetail(string workorder, int process);
|
ProReportwork01 GetProcessReportWorkDetail(string workorder, int process);
|
||||||
@@ -17,4 +21,9 @@ public interface IReportFlowService: IBaseService<ProReportwork01>
|
|||||||
bool ShipmentProcessReportwork(string workorder, int processId, int finish_num, int bad_num, string customer_order, string Worker);
|
bool ShipmentProcessReportwork(string workorder, int processId, int finish_num, int bad_num, string customer_order, string Worker);
|
||||||
List<ProReportWorkDetialDto> GetWorkOrderReportWorkList(string workorder);
|
List<ProReportWorkDetialDto> GetWorkOrderReportWorkList(string workorder);
|
||||||
|
|
||||||
|
List<ProReportWorkDetialDto> GetReportInfoByName(string Name);
|
||||||
|
|
||||||
|
List<BaseWorkProcessesDto> GetProcessByRoute(int route_id);
|
||||||
|
List<ProReportWorkDetialDto> GetReportByProcessId(int processId);
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
using DOAN.Model.MES.base_;
|
using DOAN.Model.MES.base_;
|
||||||
|
using DOAN.Model.MES.base_.Dto;
|
||||||
using DOAN.Model.MES.product;
|
using DOAN.Model.MES.product;
|
||||||
using DOAN.Model.Mobile.ReportFlow.Dto;
|
using DOAN.Model.Mobile.ReportFlow.Dto;
|
||||||
using DOAN.Model.Public;
|
using DOAN.Model.Public;
|
||||||
@@ -6,6 +7,7 @@ using DOAN.Model.System;
|
|||||||
using DOAN.Service.Mobile.IService;
|
using DOAN.Service.Mobile.IService;
|
||||||
using DOAN.Service.Public.IPublicService;
|
using DOAN.Service.Public.IPublicService;
|
||||||
using Infrastructure.Attribute;
|
using Infrastructure.Attribute;
|
||||||
|
using Mapster;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using SqlSugar.DistributedSystem.Snowflake;
|
using SqlSugar.DistributedSystem.Snowflake;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
@@ -22,6 +24,11 @@ public class ReportFlowService : BaseService<ProReportwork01>, IReportFlowServic
|
|||||||
{
|
{
|
||||||
return Context.Queryable<ProWorkorder>().Where(x => x.Workorder == workorder).First();
|
return Context.Queryable<ProWorkorder>().Where(x => x.Workorder == workorder).First();
|
||||||
}
|
}
|
||||||
|
public List<ProWorkorder> GetWorkOrdersByDate(DateTime startDate, DateTime endDate)
|
||||||
|
{
|
||||||
|
return Context.Queryable<ProWorkorder>()
|
||||||
|
.Where(it => it.WorkorderDate >= startDate && it.WorkorderDate <= endDate).ToList();
|
||||||
|
}
|
||||||
|
|
||||||
public ProReportwork01 GetProcessReportWorkDetail(string workorder, int process)
|
public ProReportwork01 GetProcessReportWorkDetail(string workorder, int process)
|
||||||
{
|
{
|
||||||
@@ -43,7 +50,7 @@ public class ReportFlowService : BaseService<ProReportwork01>, IReportFlowServic
|
|||||||
int result = 0;
|
int result = 0;
|
||||||
bool Exist = Context.Queryable<ProReportwork01>().Where(it => it.Workorder == workorder && it.ProcessId == processId).Any();
|
bool Exist = Context.Queryable<ProReportwork01>().Where(it => it.Workorder == workorder && it.ProcessId == processId).Any();
|
||||||
|
|
||||||
string NickName= Context.Queryable<SysUser>().Where(it=>it.UserName==Worker).Select(it=>it.NickName).First();
|
string NickName = Context.Queryable<SysUser>().Where(it => it.UserName == Worker).Select(it => it.NickName).First();
|
||||||
Worker = string.IsNullOrEmpty(NickName) ? Worker + "|异常人员|" : NickName;
|
Worker = string.IsNullOrEmpty(NickName) ? Worker + "|异常人员|" : NickName;
|
||||||
if (Exist)
|
if (Exist)
|
||||||
{
|
{
|
||||||
@@ -132,13 +139,13 @@ public class ReportFlowService : BaseService<ProReportwork01>, IReportFlowServic
|
|||||||
int result = 0;
|
int result = 0;
|
||||||
bool Exist = Context.Queryable<ProReportwork01>().Where(it => it.Workorder == workorder && it.ProcessId == processId).Any();
|
bool Exist = Context.Queryable<ProReportwork01>().Where(it => it.Workorder == workorder && it.ProcessId == processId).Any();
|
||||||
string NickName = Context.Queryable<SysUser>().Where(it => it.UserName == Worker).Select(it => it.NickName).First();
|
string NickName = Context.Queryable<SysUser>().Where(it => it.UserName == Worker).Select(it => it.NickName).First();
|
||||||
Worker = string.IsNullOrEmpty(NickName) ? Worker+"|异常人员|" : NickName;
|
Worker = string.IsNullOrEmpty(NickName) ? Worker + "|异常人员|" : NickName;
|
||||||
if (Exist)
|
if (Exist)
|
||||||
{
|
{
|
||||||
result = Context.Updateable<ProReportwork01>()
|
result = Context.Updateable<ProReportwork01>()
|
||||||
.Where(it => it.Workorder == workorder && it.ProcessId == processId)
|
.Where(it => it.Workorder == workorder && it.ProcessId == processId)
|
||||||
.SetColumns(it => it.FinishNum == finish_num)
|
.SetColumns(it => it.FinishNum == finish_num)
|
||||||
.SetColumns(it=>it.BadNum == bad_num)
|
.SetColumns(it => it.BadNum == bad_num)
|
||||||
.SetColumns(it => it.Worker == Worker)
|
.SetColumns(it => it.Worker == Worker)
|
||||||
.SetColumns(it => it.JobDate == DateTime.Now)
|
.SetColumns(it => it.JobDate == DateTime.Now)
|
||||||
.SetColumns(it => it.UpdatedBy == Worker)
|
.SetColumns(it => it.UpdatedBy == Worker)
|
||||||
@@ -181,10 +188,49 @@ public class ReportFlowService : BaseService<ProReportwork01>, IReportFlowServic
|
|||||||
ProcessName = wp.Name,
|
ProcessName = wp.Name,
|
||||||
}, true)
|
}, true)
|
||||||
.ToList();
|
.ToList();
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<ProReportWorkDetialDto> GetReportInfoByName(string Name)
|
||||||
|
{
|
||||||
|
|
||||||
|
string NickName = Context.Queryable<SysUser>().Where(it => it.UserName == Name).Select(it => it.NickName).First();
|
||||||
|
Name = string.IsNullOrEmpty(NickName) ? Name + "|异常人员|" : NickName;
|
||||||
|
|
||||||
|
return Context.Queryable<ProReportwork01>()
|
||||||
|
.LeftJoin<BaseWorkProcesses>((rw, wp) => rw.ProcessId == wp.Id)
|
||||||
|
.Where((rw, wp) => rw.Worker == Name && rw.JobDate >= DateTime.Today && rw.JobDate < DateTime.Today.AddDays(1))
|
||||||
|
.OrderBy(rw => rw.ProcessId)
|
||||||
|
.Select((rw, wp) => new ProReportWorkDetialDto()
|
||||||
|
{
|
||||||
|
ProcessName = wp.Name,
|
||||||
|
}, true)
|
||||||
|
.ToList();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<BaseWorkProcessesDto> GetProcessByRoute(int route_id)
|
||||||
|
{
|
||||||
|
|
||||||
|
return Context.Queryable<BaseRelWorkRouteProcesses>()
|
||||||
|
.LeftJoin<BaseWorkProcesses>((rel, pro) => rel.FkWorkProcesses == pro.Id)
|
||||||
|
.Where((rel, pro) => rel.FkWorkRoute == route_id)
|
||||||
|
.Select((rel, pro) => pro)
|
||||||
|
.ToList()
|
||||||
|
.Adapt<List<BaseWorkProcesses>, List<BaseWorkProcessesDto>>();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<ProReportWorkDetialDto> GetReportByProcessId(int processId)
|
||||||
|
{
|
||||||
|
return Context.Queryable<ProReportwork01>()
|
||||||
|
.LeftJoin<BaseWorkProcesses>((rw, wp) => rw.ProcessId == wp.Id)
|
||||||
|
.Where((rw, wp) => rw.ProcessId == processId && rw.JobDate >= DateTime.Today && rw.JobDate < DateTime.Today.AddDays(1))
|
||||||
|
.OrderBy(rw => rw.ProcessId)
|
||||||
|
.Select((rw, wp) => new ProReportWorkDetialDto()
|
||||||
|
{
|
||||||
|
ProcessName = wp.Name,
|
||||||
|
}, true)
|
||||||
|
.ToList();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ using DOAN.Model.System;
|
|||||||
using DOAN.Model.MES.dev;
|
using DOAN.Model.MES.dev;
|
||||||
using DOAN.Model.MES.dev.Dto;
|
using DOAN.Model.MES.dev.Dto;
|
||||||
using DOAN.Service.MES.dev.IService;
|
using DOAN.Service.MES.dev.IService;
|
||||||
|
using DOAN.Service.MES.dev;
|
||||||
|
|
||||||
namespace DOAN.Tasks.TaskScheduler
|
namespace DOAN.Tasks.TaskScheduler
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user