diff --git a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user b/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user
deleted file mode 100644
index 63c9751..0000000
--- a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user
+++ /dev/null
@@ -1,562 +0,0 @@
-
-
-
-
-
- EnvironmentId
- {2746248a-b112-4e0f-9ae0-9e61f2a42309}
-
-
- ProjectExplorer.Project.ActiveTarget
- 0
-
-
- ProjectExplorer.Project.EditorSettings
-
- true
- false
- true
-
- Cpp
-
- CppGlobal
-
-
-
- QmlJS
-
- QmlJSGlobal
-
-
- 2
- UTF-8
- false
- 4
- false
- 80
- true
- true
- 1
- true
- false
- 0
- true
- true
- 0
- 8
- true
- 1
- true
- true
- true
- false
-
-
-
- ProjectExplorer.Project.PluginSettings
-
-
- -fno-delayed-template-parsing
-
- true
-
-
-
- ProjectExplorer.Project.Target.0
-
- Desktop Qt 5.14.2 MinGW 32-bit
- Desktop Qt 5.14.2 MinGW 32-bit
- qt.qt5.5142.win32_mingw73_kit
- 0
- 0
- 0
-
- D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Debug
-
-
- true
- QtProjectManager.QMakeBuildStep
- true
-
- false
- false
- false
-
-
- true
- Qt4ProjectManager.MakeStep
-
- false
-
-
- false
-
- 2
- Build
- Build
- ProjectExplorer.BuildSteps.Build
-
-
-
- true
- Qt4ProjectManager.MakeStep
-
- true
- clean
-
- false
-
- 1
- Clean
- Clean
- ProjectExplorer.BuildSteps.Clean
-
- 2
- false
-
- Debug
- Qt4ProjectManager.Qt4BuildConfiguration
- 2
-
-
- D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Release
-
-
- true
- QtProjectManager.QMakeBuildStep
- false
-
- false
- false
- true
-
-
- true
- Qt4ProjectManager.MakeStep
-
- false
-
-
- false
-
- 2
- Build
- Build
- ProjectExplorer.BuildSteps.Build
-
-
-
- true
- Qt4ProjectManager.MakeStep
-
- true
- clean
-
- false
-
- 1
- Clean
- Clean
- ProjectExplorer.BuildSteps.Clean
-
- 2
- false
-
- Release
- Qt4ProjectManager.Qt4BuildConfiguration
- 0
-
-
- D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Profile
-
-
- true
- QtProjectManager.QMakeBuildStep
- true
-
- false
- true
- true
-
-
- true
- Qt4ProjectManager.MakeStep
-
- false
-
-
- false
-
- 2
- Build
- Build
- ProjectExplorer.BuildSteps.Build
-
-
-
- true
- Qt4ProjectManager.MakeStep
-
- true
- clean
-
- false
-
- 1
- Clean
- Clean
- ProjectExplorer.BuildSteps.Clean
-
- 2
- false
-
- Profile
- Qt4ProjectManager.Qt4BuildConfiguration
- 0
-
- 3
-
-
- 0
- Deploy
- Deploy
- ProjectExplorer.BuildSteps.Deploy
-
- 1
- ProjectExplorer.DefaultDeployConfiguration
-
- 1
-
-
- dwarf
-
- cpu-cycles
-
-
- 250
-
- -e
- cpu-cycles
- --call-graph
- dwarf,4096
- -F
- 250
-
- -F
- true
- 4096
- false
- false
- 1000
-
- true
-
- false
- false
- false
- false
- true
- 0.01
- 10
- true
- kcachegrind
- 1
- 25
-
- 1
- true
- false
- true
- valgrind
-
- 0
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
-
- 2
-
-
- ProjectExplorer.CustomExecutableRunConfiguration
-
-
- false
-
- false
- true
- false
- false
- true
-
-
-
- 1
-
-
-
- ProjectExplorer.Project.Target.1
-
- Desktop Qt 5.14.2 MinGW 64-bit
- Desktop Qt 5.14.2 MinGW 64-bit
- qt.qt5.5142.win64_mingw73_kit
- 0
- 0
- 0
-
- D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Debug
-
-
- true
- QtProjectManager.QMakeBuildStep
- true
-
- false
- false
- false
-
-
- true
- Qt4ProjectManager.MakeStep
-
- false
-
-
- false
-
- 2
- Build
- Build
- ProjectExplorer.BuildSteps.Build
-
-
-
- true
- Qt4ProjectManager.MakeStep
-
- true
- clean
-
- false
-
- 1
- Clean
- Clean
- ProjectExplorer.BuildSteps.Clean
-
- 2
- false
-
- Debug
- Qt4ProjectManager.Qt4BuildConfiguration
- 2
-
-
- D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Release
-
-
- true
- QtProjectManager.QMakeBuildStep
- false
-
- false
- false
- true
-
-
- true
- Qt4ProjectManager.MakeStep
-
- false
-
-
- false
-
- 2
- Build
- Build
- ProjectExplorer.BuildSteps.Build
-
-
-
- true
- Qt4ProjectManager.MakeStep
-
- true
- clean
-
- false
-
- 1
- Clean
- Clean
- ProjectExplorer.BuildSteps.Clean
-
- 2
- false
-
- Release
- Qt4ProjectManager.Qt4BuildConfiguration
- 0
-
-
- D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Profile
-
-
- true
- QtProjectManager.QMakeBuildStep
- true
-
- false
- true
- true
-
-
- true
- Qt4ProjectManager.MakeStep
-
- false
-
-
- false
-
- 2
- Build
- Build
- ProjectExplorer.BuildSteps.Build
-
-
-
- true
- Qt4ProjectManager.MakeStep
-
- true
- clean
-
- false
-
- 1
- Clean
- Clean
- ProjectExplorer.BuildSteps.Clean
-
- 2
- false
-
- Profile
- Qt4ProjectManager.Qt4BuildConfiguration
- 0
-
- 3
-
-
- 0
- Deploy
- Deploy
- ProjectExplorer.BuildSteps.Deploy
-
- 1
- ProjectExplorer.DefaultDeployConfiguration
-
- 1
-
-
- dwarf
-
- cpu-cycles
-
-
- 250
-
- -e
- cpu-cycles
- --call-graph
- dwarf,4096
- -F
- 250
-
- -F
- true
- 4096
- false
- false
- 1000
-
- true
-
- false
- false
- false
- false
- true
- 0.01
- 10
- true
- kcachegrind
- 1
- 25
-
- 1
- true
- false
- true
- valgrind
-
- 0
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
-
- 2
-
-
- ProjectExplorer.CustomExecutableRunConfiguration
-
-
- false
-
- false
- true
- false
- false
- true
-
-
-
- 1
-
-
-
- ProjectExplorer.Project.TargetCount
- 2
-
-
- ProjectExplorer.Project.Updater.FileVersion
- 22
-
-
- Version
- 22
-
-
diff --git a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user b/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user
deleted file mode 100644
index 63c9751..0000000
--- a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user
+++ /dev/null
@@ -1,562 +0,0 @@
-
-
-
-
-
- EnvironmentId
- {2746248a-b112-4e0f-9ae0-9e61f2a42309}
-
-
- ProjectExplorer.Project.ActiveTarget
- 0
-
-
- ProjectExplorer.Project.EditorSettings
-
- true
- false
- true
-
- Cpp
-
- CppGlobal
-
-
-
- QmlJS
-
- QmlJSGlobal
-
-
- 2
- UTF-8
- false
- 4
- false
- 80
- true
- true
- 1
- true
- false
- 0
- true
- true
- 0
- 8
- true
- 1
- true
- true
- true
- false
-
-
-
- ProjectExplorer.Project.PluginSettings
-
-
- -fno-delayed-template-parsing
-
- true
-
-
-
- ProjectExplorer.Project.Target.0
-
- Desktop Qt 5.14.2 MinGW 32-bit
- Desktop Qt 5.14.2 MinGW 32-bit
- qt.qt5.5142.win32_mingw73_kit
- 0
- 0
- 0
-
- D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Debug
-
-
- true
- QtProjectManager.QMakeBuildStep
- true
-
- false
- false
- false
-
-
- true
- Qt4ProjectManager.MakeStep
-
- false
-
-
- false
-
- 2
- Build
- Build
- ProjectExplorer.BuildSteps.Build
-
-
-
- true
- Qt4ProjectManager.MakeStep
-
- true
- clean
-
- false
-
- 1
- Clean
- Clean
- ProjectExplorer.BuildSteps.Clean
-
- 2
- false
-
- Debug
- Qt4ProjectManager.Qt4BuildConfiguration
- 2
-
-
- D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Release
-
-
- true
- QtProjectManager.QMakeBuildStep
- false
-
- false
- false
- true
-
-
- true
- Qt4ProjectManager.MakeStep
-
- false
-
-
- false
-
- 2
- Build
- Build
- ProjectExplorer.BuildSteps.Build
-
-
-
- true
- Qt4ProjectManager.MakeStep
-
- true
- clean
-
- false
-
- 1
- Clean
- Clean
- ProjectExplorer.BuildSteps.Clean
-
- 2
- false
-
- Release
- Qt4ProjectManager.Qt4BuildConfiguration
- 0
-
-
- D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Profile
-
-
- true
- QtProjectManager.QMakeBuildStep
- true
-
- false
- true
- true
-
-
- true
- Qt4ProjectManager.MakeStep
-
- false
-
-
- false
-
- 2
- Build
- Build
- ProjectExplorer.BuildSteps.Build
-
-
-
- true
- Qt4ProjectManager.MakeStep
-
- true
- clean
-
- false
-
- 1
- Clean
- Clean
- ProjectExplorer.BuildSteps.Clean
-
- 2
- false
-
- Profile
- Qt4ProjectManager.Qt4BuildConfiguration
- 0
-
- 3
-
-
- 0
- Deploy
- Deploy
- ProjectExplorer.BuildSteps.Deploy
-
- 1
- ProjectExplorer.DefaultDeployConfiguration
-
- 1
-
-
- dwarf
-
- cpu-cycles
-
-
- 250
-
- -e
- cpu-cycles
- --call-graph
- dwarf,4096
- -F
- 250
-
- -F
- true
- 4096
- false
- false
- 1000
-
- true
-
- false
- false
- false
- false
- true
- 0.01
- 10
- true
- kcachegrind
- 1
- 25
-
- 1
- true
- false
- true
- valgrind
-
- 0
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
-
- 2
-
-
- ProjectExplorer.CustomExecutableRunConfiguration
-
-
- false
-
- false
- true
- false
- false
- true
-
-
-
- 1
-
-
-
- ProjectExplorer.Project.Target.1
-
- Desktop Qt 5.14.2 MinGW 64-bit
- Desktop Qt 5.14.2 MinGW 64-bit
- qt.qt5.5142.win64_mingw73_kit
- 0
- 0
- 0
-
- D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Debug
-
-
- true
- QtProjectManager.QMakeBuildStep
- true
-
- false
- false
- false
-
-
- true
- Qt4ProjectManager.MakeStep
-
- false
-
-
- false
-
- 2
- Build
- Build
- ProjectExplorer.BuildSteps.Build
-
-
-
- true
- Qt4ProjectManager.MakeStep
-
- true
- clean
-
- false
-
- 1
- Clean
- Clean
- ProjectExplorer.BuildSteps.Clean
-
- 2
- false
-
- Debug
- Qt4ProjectManager.Qt4BuildConfiguration
- 2
-
-
- D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Release
-
-
- true
- QtProjectManager.QMakeBuildStep
- false
-
- false
- false
- true
-
-
- true
- Qt4ProjectManager.MakeStep
-
- false
-
-
- false
-
- 2
- Build
- Build
- ProjectExplorer.BuildSteps.Build
-
-
-
- true
- Qt4ProjectManager.MakeStep
-
- true
- clean
-
- false
-
- 1
- Clean
- Clean
- ProjectExplorer.BuildSteps.Clean
-
- 2
- false
-
- Release
- Qt4ProjectManager.Qt4BuildConfiguration
- 0
-
-
- D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Profile
-
-
- true
- QtProjectManager.QMakeBuildStep
- true
-
- false
- true
- true
-
-
- true
- Qt4ProjectManager.MakeStep
-
- false
-
-
- false
-
- 2
- Build
- Build
- ProjectExplorer.BuildSteps.Build
-
-
-
- true
- Qt4ProjectManager.MakeStep
-
- true
- clean
-
- false
-
- 1
- Clean
- Clean
- ProjectExplorer.BuildSteps.Clean
-
- 2
- false
-
- Profile
- Qt4ProjectManager.Qt4BuildConfiguration
- 0
-
- 3
-
-
- 0
- Deploy
- Deploy
- ProjectExplorer.BuildSteps.Deploy
-
- 1
- ProjectExplorer.DefaultDeployConfiguration
-
- 1
-
-
- dwarf
-
- cpu-cycles
-
-
- 250
-
- -e
- cpu-cycles
- --call-graph
- dwarf,4096
- -F
- 250
-
- -F
- true
- 4096
- false
- false
- 1000
-
- true
-
- false
- false
- false
- false
- true
- 0.01
- 10
- true
- kcachegrind
- 1
- 25
-
- 1
- true
- false
- true
- valgrind
-
- 0
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
-
- 2
-
-
- ProjectExplorer.CustomExecutableRunConfiguration
-
-
- false
-
- false
- true
- false
- false
- true
-
-
-
- 1
-
-
-
- ProjectExplorer.Project.TargetCount
- 2
-
-
- ProjectExplorer.Project.Updater.FileVersion
- 22
-
-
- Version
- 22
-
-
diff --git a/softwareDirectory/AutoVerScheme/basecommonapi.cpp b/softwareDirectory/AutoVerScheme/basecommonapi.cpp
index 6170ee7..f587b64 100644
--- a/softwareDirectory/AutoVerScheme/basecommonapi.cpp
+++ b/softwareDirectory/AutoVerScheme/basecommonapi.cpp
@@ -5,30 +5,34 @@
}
-//获取部门任务数据 “1640229293790650370”
-QList BaseCommonApi::getAllData(QString userId) {
+//获取部门任务数据
+QList BaseCommonApi::getAllData(QString deptId,QString status) {
QList result;
QSqlQuery query;
- query.prepare("SELECT bi.id ,br.sample_name , br.sample_model ,ei.help_instruction ,ei.manufacture_no ,"
- " ei.manufacturer ,bi.customer_name ,dept.FULL_NAME,bi.require_over_time ,bi.is_urgent "
- " FROM biz_business_order_info bi LEft JOIN biz_business_order_sample_relation br ON bi.id = br.order_id "
- " LEft JOIN eqpt_equipment_info ei ON br.sample_no = ei.equipment_no LEft JOIN sys_dept dept ON ei.dept_id = dept.ID "
- " LEft JOIN sys_user ON bi.create_user_id = sys_user.ID "
- " WHERE sys_user.ID = :userId");
+ query.prepare("SELECT blei.id AS id, eei.equipment_name AS sampleName, eei.model AS sampleModel,eei.help_instruction AS helpInstruction, "
+ " eei.manufacture_no AS manufactureNo, eei.manufacturer,bo.customer_name,sd.SIMPLE_NAME,bo.require_over_time, bo.is_urgent "
+ "FROM biz_business_lab_executive_info blei "
+ "JOIN eqpt_equipment_info eei ON eei.id = blei.sample_id "
+ "LEFT JOIN sys_dept sd ON blei.measure_dept_id = sd.ID "
+ " JOIN biz_business_order_info bo ON bo.id = blei.order_id "
+ " WHERE blei.measure_dept_id = :deptId "
+ " AND blei.measure_status = :status "
+ " ORDER BY blei.update_time DESC");
// 将参数绑定到占位符
- query.bindValue(":userId", userId);
+ query.bindValue(":deptId", deptId);
+ query.bindValue(":status", status);
if (query.exec()) {
while (query.next()) {
Dept Dept;
Dept.id = query.value("id").toString();
- Dept.sample_name = query.value("sample_name").toString();
- Dept.sample_model = query.value("sample_model").toString();
- Dept.help_instruction = query.value("help_instruction").toString();
- Dept.manufacture_no = query.value("manufacture_no").toString();
+ Dept.sample_name = query.value("sampleName").toString();
+ Dept.sample_model = query.value("sampleModel").toString();
+ Dept.help_instruction = query.value("helpInstruction").toString();
+ Dept.manufacture_no = query.value("manufactureNo").toString();
Dept.manufacturer = query.value("manufacturer").toString();
Dept.customer_name = query.value("customer_name").toString();
- Dept.FULL_NAME = query.value("FULL_NAME").toString();
+ Dept.FULL_NAME = query.value("SIMPLE_NAME").toString();
Dept.require_over_time = query.value("require_over_time").toDateTime();
Dept.is_urgent = query.value("is_urgent").toString();
result.append(Dept);
@@ -39,32 +43,34 @@
return result;
}
-//获取我的任务
-QList BaseCommonApi::getMyTasks(QString userId){
+//获取我的任务 参数登录用户的id 和 任务状态
+QList BaseCommonApi::getMyTasks(QString userId,QString status){
QList result;
QSqlQuery query;
- query.prepare("SELECT "
- "bi.id, br.sample_name, br.sample_model, ei.help_instruction, ei.manufacture_no,"
- "ei.manufacturer, bi.customer_name,"
- "dept.FULL_NAME, bi.require_over_time,"
- "bi.is_urgent FROM biz_business_order_info bi"
- " LEfT JOIN biz_business_order_sample_relation br ON bi.id = br.order_id"
- " LEfT JOIN eqpt_equipment_info ei ON br.sample_no = ei.equipment_no LEfT JOIN "
- "sys_dept dept ON ei.dept_id = dept.ID WHERE bi.create_user_id = :user_id");
+ query.prepare("SELECT blei.id AS id, eei.equipment_name AS sampleName, eei.model AS sampleModel, eei.help_instruction AS helpInstruction, "
+ "eei.manufacture_no AS manufactureNo, eei.manufacturer,bo.customer_name,sd.SIMPLE_NAME AS measureDeptName,bo.require_over_time , bo.is_urgent "
+ "FROM biz_business_lab_executive_info blei "
+ "JOIN eqpt_equipment_info eei ON eei.id = blei.sample_id "
+ "JOIN biz_business_order_info bo ON bo.id = blei.order_id "
+ "LEFT JOIN sys_dept sd ON blei.measure_dept_id = sd.ID "
+ " WHERE blei.measure_person_id = :userId "
+ " AND blei.measure_status = :status "
+ " ORDER BY blei.update_time DESC");
// 将参数绑定到占位符
- query.bindValue(":user_id", userId);
+ query.bindValue(":userId", userId);
+ query.bindValue(":status", status);
if (query.exec()) {
while (query.next()) {
MyTask task;
task.id = query.value("id").toString();
- task.sample_name = query.value("sample_name").toString();
- task.sample_model = query.value("sample_model").toString();
- task.help_instruction = query.value("help_instruction").toString();
- task.manufacture_no = query.value("manufacture_no").toString();
+ task.sample_name = query.value("sampleName").toString();
+ task.sample_model = query.value("sampleModel").toString();
+ task.help_instruction = query.value("helpInstruction").toString();
+ task.manufacture_no = query.value("manufactureNo").toString();
task.manufacturer = query.value("manufacturer").toString();
task.customer_name = query.value("customer_name").toString();
- task.FULL_NAME = query.value("FULL_NAME").toString();
+ task.FULL_NAME = query.value("measureDeptName").toString();
task.require_over_time = query.value("require_over_time").toDateTime();
task.is_urgent = query.value("is_urgent").toString();
result.append(task);
@@ -470,9 +476,9 @@
{
QList result;
QSqlQuery query;
-bool isSuccess = query.exec("SELECT eei.id ,eei.equipment_name ,eei.model ,eei.help_instruction ,eei.manufacture_no ,eei.manufacturer ,bboi.customer_name ,sys_dept.FULL_NAME ,eei.meter_identify ,eei.check_cycle ,eei.certificate_valid from eqpt_equipment_info eei "
- " JOIN sys_dept ON sys_dept.ID = eei.dept_id "
- " JOIN biz_business_order_info bboi ON bboi.customer_id = eei.company_id");
+bool isSuccess = query.exec("SELECT DISTINCT eei.id ,eei.equipment_name ,eei.model ,eei.help_instruction ,eei.manufacture_no ,eei.manufacturer ,bboi.customer_name ,sys_dept.FULL_NAME ,eei.meter_identify ,eei.check_cycle ,eei.certificate_valid from eqpt_equipment_info eei "
+ " LEFT JOIN sys_dept ON sys_dept.ID = eei.dept_id "
+ " LEFT JOIN biz_business_order_info bboi ON bboi.customer_id = eei.company_id ");
if (isSuccess) {
while (query.next()) {
TestedDevice testedDevice;
@@ -596,9 +602,11 @@
{
case 1:
- //CliTable[0].item_category_id
+ //Clable[0].item_category_idiT
+ //1717086652508487681 后面替换为 Clable[0].item_category_idiT
DataList=BaseCommonApi::getVerMultiCal("1717086652508487681",HeadList);
break;
+
}
return DataList;
@@ -638,6 +646,7 @@
qDebug() << "Query execution failed: " << query.lastError().text();
}
*headList<<"序号"<<"参数"<<"量"<<"单位"<<"频率"<<"量程"<<"标准值"<<"分辨力"<<"最大允许误差"<<"误差参数a"<<"误差参数b";
+ return resultData;
}
//检定数据管理 首页
diff --git a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user b/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user
deleted file mode 100644
index 63c9751..0000000
--- a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user
+++ /dev/null
@@ -1,562 +0,0 @@
-
-
-
-
-
- EnvironmentId
- {2746248a-b112-4e0f-9ae0-9e61f2a42309}
-
-
- ProjectExplorer.Project.ActiveTarget
- 0
-
-
- ProjectExplorer.Project.EditorSettings
-
- true
- false
- true
-
- Cpp
-
- CppGlobal
-
-
-
- QmlJS
-
- QmlJSGlobal
-
-
- 2
- UTF-8
- false
- 4
- false
- 80
- true
- true
- 1
- true
- false
- 0
- true
- true
- 0
- 8
- true
- 1
- true
- true
- true
- false
-
-
-
- ProjectExplorer.Project.PluginSettings
-
-
- -fno-delayed-template-parsing
-
- true
-
-
-
- ProjectExplorer.Project.Target.0
-
- Desktop Qt 5.14.2 MinGW 32-bit
- Desktop Qt 5.14.2 MinGW 32-bit
- qt.qt5.5142.win32_mingw73_kit
- 0
- 0
- 0
-
- D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Debug
-
-
- true
- QtProjectManager.QMakeBuildStep
- true
-
- false
- false
- false
-
-
- true
- Qt4ProjectManager.MakeStep
-
- false
-
-
- false
-
- 2
- Build
- Build
- ProjectExplorer.BuildSteps.Build
-
-
-
- true
- Qt4ProjectManager.MakeStep
-
- true
- clean
-
- false
-
- 1
- Clean
- Clean
- ProjectExplorer.BuildSteps.Clean
-
- 2
- false
-
- Debug
- Qt4ProjectManager.Qt4BuildConfiguration
- 2
-
-
- D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Release
-
-
- true
- QtProjectManager.QMakeBuildStep
- false
-
- false
- false
- true
-
-
- true
- Qt4ProjectManager.MakeStep
-
- false
-
-
- false
-
- 2
- Build
- Build
- ProjectExplorer.BuildSteps.Build
-
-
-
- true
- Qt4ProjectManager.MakeStep
-
- true
- clean
-
- false
-
- 1
- Clean
- Clean
- ProjectExplorer.BuildSteps.Clean
-
- 2
- false
-
- Release
- Qt4ProjectManager.Qt4BuildConfiguration
- 0
-
-
- D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Profile
-
-
- true
- QtProjectManager.QMakeBuildStep
- true
-
- false
- true
- true
-
-
- true
- Qt4ProjectManager.MakeStep
-
- false
-
-
- false
-
- 2
- Build
- Build
- ProjectExplorer.BuildSteps.Build
-
-
-
- true
- Qt4ProjectManager.MakeStep
-
- true
- clean
-
- false
-
- 1
- Clean
- Clean
- ProjectExplorer.BuildSteps.Clean
-
- 2
- false
-
- Profile
- Qt4ProjectManager.Qt4BuildConfiguration
- 0
-
- 3
-
-
- 0
- Deploy
- Deploy
- ProjectExplorer.BuildSteps.Deploy
-
- 1
- ProjectExplorer.DefaultDeployConfiguration
-
- 1
-
-
- dwarf
-
- cpu-cycles
-
-
- 250
-
- -e
- cpu-cycles
- --call-graph
- dwarf,4096
- -F
- 250
-
- -F
- true
- 4096
- false
- false
- 1000
-
- true
-
- false
- false
- false
- false
- true
- 0.01
- 10
- true
- kcachegrind
- 1
- 25
-
- 1
- true
- false
- true
- valgrind
-
- 0
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
-
- 2
-
-
- ProjectExplorer.CustomExecutableRunConfiguration
-
-
- false
-
- false
- true
- false
- false
- true
-
-
-
- 1
-
-
-
- ProjectExplorer.Project.Target.1
-
- Desktop Qt 5.14.2 MinGW 64-bit
- Desktop Qt 5.14.2 MinGW 64-bit
- qt.qt5.5142.win64_mingw73_kit
- 0
- 0
- 0
-
- D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Debug
-
-
- true
- QtProjectManager.QMakeBuildStep
- true
-
- false
- false
- false
-
-
- true
- Qt4ProjectManager.MakeStep
-
- false
-
-
- false
-
- 2
- Build
- Build
- ProjectExplorer.BuildSteps.Build
-
-
-
- true
- Qt4ProjectManager.MakeStep
-
- true
- clean
-
- false
-
- 1
- Clean
- Clean
- ProjectExplorer.BuildSteps.Clean
-
- 2
- false
-
- Debug
- Qt4ProjectManager.Qt4BuildConfiguration
- 2
-
-
- D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Release
-
-
- true
- QtProjectManager.QMakeBuildStep
- false
-
- false
- false
- true
-
-
- true
- Qt4ProjectManager.MakeStep
-
- false
-
-
- false
-
- 2
- Build
- Build
- ProjectExplorer.BuildSteps.Build
-
-
-
- true
- Qt4ProjectManager.MakeStep
-
- true
- clean
-
- false
-
- 1
- Clean
- Clean
- ProjectExplorer.BuildSteps.Clean
-
- 2
- false
-
- Release
- Qt4ProjectManager.Qt4BuildConfiguration
- 0
-
-
- D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Profile
-
-
- true
- QtProjectManager.QMakeBuildStep
- true
-
- false
- true
- true
-
-
- true
- Qt4ProjectManager.MakeStep
-
- false
-
-
- false
-
- 2
- Build
- Build
- ProjectExplorer.BuildSteps.Build
-
-
-
- true
- Qt4ProjectManager.MakeStep
-
- true
- clean
-
- false
-
- 1
- Clean
- Clean
- ProjectExplorer.BuildSteps.Clean
-
- 2
- false
-
- Profile
- Qt4ProjectManager.Qt4BuildConfiguration
- 0
-
- 3
-
-
- 0
- Deploy
- Deploy
- ProjectExplorer.BuildSteps.Deploy
-
- 1
- ProjectExplorer.DefaultDeployConfiguration
-
- 1
-
-
- dwarf
-
- cpu-cycles
-
-
- 250
-
- -e
- cpu-cycles
- --call-graph
- dwarf,4096
- -F
- 250
-
- -F
- true
- 4096
- false
- false
- 1000
-
- true
-
- false
- false
- false
- false
- true
- 0.01
- 10
- true
- kcachegrind
- 1
- 25
-
- 1
- true
- false
- true
- valgrind
-
- 0
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
-
- 2
-
-
- ProjectExplorer.CustomExecutableRunConfiguration
-
-
- false
-
- false
- true
- false
- false
- true
-
-
-
- 1
-
-
-
- ProjectExplorer.Project.TargetCount
- 2
-
-
- ProjectExplorer.Project.Updater.FileVersion
- 22
-
-
- Version
- 22
-
-
diff --git a/softwareDirectory/AutoVerScheme/basecommonapi.cpp b/softwareDirectory/AutoVerScheme/basecommonapi.cpp
index 6170ee7..f587b64 100644
--- a/softwareDirectory/AutoVerScheme/basecommonapi.cpp
+++ b/softwareDirectory/AutoVerScheme/basecommonapi.cpp
@@ -5,30 +5,34 @@
}
-//获取部门任务数据 “1640229293790650370”
-QList BaseCommonApi::getAllData(QString userId) {
+//获取部门任务数据
+QList BaseCommonApi::getAllData(QString deptId,QString status) {
QList result;
QSqlQuery query;
- query.prepare("SELECT bi.id ,br.sample_name , br.sample_model ,ei.help_instruction ,ei.manufacture_no ,"
- " ei.manufacturer ,bi.customer_name ,dept.FULL_NAME,bi.require_over_time ,bi.is_urgent "
- " FROM biz_business_order_info bi LEft JOIN biz_business_order_sample_relation br ON bi.id = br.order_id "
- " LEft JOIN eqpt_equipment_info ei ON br.sample_no = ei.equipment_no LEft JOIN sys_dept dept ON ei.dept_id = dept.ID "
- " LEft JOIN sys_user ON bi.create_user_id = sys_user.ID "
- " WHERE sys_user.ID = :userId");
+ query.prepare("SELECT blei.id AS id, eei.equipment_name AS sampleName, eei.model AS sampleModel,eei.help_instruction AS helpInstruction, "
+ " eei.manufacture_no AS manufactureNo, eei.manufacturer,bo.customer_name,sd.SIMPLE_NAME,bo.require_over_time, bo.is_urgent "
+ "FROM biz_business_lab_executive_info blei "
+ "JOIN eqpt_equipment_info eei ON eei.id = blei.sample_id "
+ "LEFT JOIN sys_dept sd ON blei.measure_dept_id = sd.ID "
+ " JOIN biz_business_order_info bo ON bo.id = blei.order_id "
+ " WHERE blei.measure_dept_id = :deptId "
+ " AND blei.measure_status = :status "
+ " ORDER BY blei.update_time DESC");
// 将参数绑定到占位符
- query.bindValue(":userId", userId);
+ query.bindValue(":deptId", deptId);
+ query.bindValue(":status", status);
if (query.exec()) {
while (query.next()) {
Dept Dept;
Dept.id = query.value("id").toString();
- Dept.sample_name = query.value("sample_name").toString();
- Dept.sample_model = query.value("sample_model").toString();
- Dept.help_instruction = query.value("help_instruction").toString();
- Dept.manufacture_no = query.value("manufacture_no").toString();
+ Dept.sample_name = query.value("sampleName").toString();
+ Dept.sample_model = query.value("sampleModel").toString();
+ Dept.help_instruction = query.value("helpInstruction").toString();
+ Dept.manufacture_no = query.value("manufactureNo").toString();
Dept.manufacturer = query.value("manufacturer").toString();
Dept.customer_name = query.value("customer_name").toString();
- Dept.FULL_NAME = query.value("FULL_NAME").toString();
+ Dept.FULL_NAME = query.value("SIMPLE_NAME").toString();
Dept.require_over_time = query.value("require_over_time").toDateTime();
Dept.is_urgent = query.value("is_urgent").toString();
result.append(Dept);
@@ -39,32 +43,34 @@
return result;
}
-//获取我的任务
-QList BaseCommonApi::getMyTasks(QString userId){
+//获取我的任务 参数登录用户的id 和 任务状态
+QList BaseCommonApi::getMyTasks(QString userId,QString status){
QList result;
QSqlQuery query;
- query.prepare("SELECT "
- "bi.id, br.sample_name, br.sample_model, ei.help_instruction, ei.manufacture_no,"
- "ei.manufacturer, bi.customer_name,"
- "dept.FULL_NAME, bi.require_over_time,"
- "bi.is_urgent FROM biz_business_order_info bi"
- " LEfT JOIN biz_business_order_sample_relation br ON bi.id = br.order_id"
- " LEfT JOIN eqpt_equipment_info ei ON br.sample_no = ei.equipment_no LEfT JOIN "
- "sys_dept dept ON ei.dept_id = dept.ID WHERE bi.create_user_id = :user_id");
+ query.prepare("SELECT blei.id AS id, eei.equipment_name AS sampleName, eei.model AS sampleModel, eei.help_instruction AS helpInstruction, "
+ "eei.manufacture_no AS manufactureNo, eei.manufacturer,bo.customer_name,sd.SIMPLE_NAME AS measureDeptName,bo.require_over_time , bo.is_urgent "
+ "FROM biz_business_lab_executive_info blei "
+ "JOIN eqpt_equipment_info eei ON eei.id = blei.sample_id "
+ "JOIN biz_business_order_info bo ON bo.id = blei.order_id "
+ "LEFT JOIN sys_dept sd ON blei.measure_dept_id = sd.ID "
+ " WHERE blei.measure_person_id = :userId "
+ " AND blei.measure_status = :status "
+ " ORDER BY blei.update_time DESC");
// 将参数绑定到占位符
- query.bindValue(":user_id", userId);
+ query.bindValue(":userId", userId);
+ query.bindValue(":status", status);
if (query.exec()) {
while (query.next()) {
MyTask task;
task.id = query.value("id").toString();
- task.sample_name = query.value("sample_name").toString();
- task.sample_model = query.value("sample_model").toString();
- task.help_instruction = query.value("help_instruction").toString();
- task.manufacture_no = query.value("manufacture_no").toString();
+ task.sample_name = query.value("sampleName").toString();
+ task.sample_model = query.value("sampleModel").toString();
+ task.help_instruction = query.value("helpInstruction").toString();
+ task.manufacture_no = query.value("manufactureNo").toString();
task.manufacturer = query.value("manufacturer").toString();
task.customer_name = query.value("customer_name").toString();
- task.FULL_NAME = query.value("FULL_NAME").toString();
+ task.FULL_NAME = query.value("measureDeptName").toString();
task.require_over_time = query.value("require_over_time").toDateTime();
task.is_urgent = query.value("is_urgent").toString();
result.append(task);
@@ -470,9 +476,9 @@
{
QList result;
QSqlQuery query;
-bool isSuccess = query.exec("SELECT eei.id ,eei.equipment_name ,eei.model ,eei.help_instruction ,eei.manufacture_no ,eei.manufacturer ,bboi.customer_name ,sys_dept.FULL_NAME ,eei.meter_identify ,eei.check_cycle ,eei.certificate_valid from eqpt_equipment_info eei "
- " JOIN sys_dept ON sys_dept.ID = eei.dept_id "
- " JOIN biz_business_order_info bboi ON bboi.customer_id = eei.company_id");
+bool isSuccess = query.exec("SELECT DISTINCT eei.id ,eei.equipment_name ,eei.model ,eei.help_instruction ,eei.manufacture_no ,eei.manufacturer ,bboi.customer_name ,sys_dept.FULL_NAME ,eei.meter_identify ,eei.check_cycle ,eei.certificate_valid from eqpt_equipment_info eei "
+ " LEFT JOIN sys_dept ON sys_dept.ID = eei.dept_id "
+ " LEFT JOIN biz_business_order_info bboi ON bboi.customer_id = eei.company_id ");
if (isSuccess) {
while (query.next()) {
TestedDevice testedDevice;
@@ -596,9 +602,11 @@
{
case 1:
- //CliTable[0].item_category_id
+ //Clable[0].item_category_idiT
+ //1717086652508487681 后面替换为 Clable[0].item_category_idiT
DataList=BaseCommonApi::getVerMultiCal("1717086652508487681",HeadList);
break;
+
}
return DataList;
@@ -638,6 +646,7 @@
qDebug() << "Query execution failed: " << query.lastError().text();
}
*headList<<"序号"<<"参数"<<"量"<<"单位"<<"频率"<<"量程"<<"标准值"<<"分辨力"<<"最大允许误差"<<"误差参数a"<<"误差参数b";
+ return resultData;
}
//检定数据管理 首页
diff --git a/softwareDirectory/AutoVerScheme/basecommonapi.h b/softwareDirectory/AutoVerScheme/basecommonapi.h
index 1b70cb9..a113006 100644
--- a/softwareDirectory/AutoVerScheme/basecommonapi.h
+++ b/softwareDirectory/AutoVerScheme/basecommonapi.h
@@ -365,6 +365,7 @@
class Technique_File
{
public:
+ QString id;
QString file_distribute_no;
QString file_name;
QString version_no;
@@ -444,10 +445,16 @@
public:
BaseCommonApi();
- //部门任务 参数登录用户的id
- static QList getAllData(QString userId);
+
+ static QList Search_CalibrationTable(QString DeiverId,QStringList *HeadList);
+ //部门任务 废弃
+// static QList getAllData();
+
+
+ //部门任务 参数登录用户的部门id和状态
+ static QList getAllData(QString deptId,QString status);
//我的任务
- static QList getMyTasks(QString id);
+ static QList getMyTasks(QString id,QString status);
//获取创建任务首页数据
static QListgetCreateTaskList(QString id);
//创建任务-查看任务单顶部
@@ -479,7 +486,7 @@
//判断 哪个 装置表 传参 设备id 返回itemId
static QList getJudgeCalibrationTable(QString id);
//被检设备管理-检定项目及检定点-多功能校准源
- static QList getVerMultiCal(QString itemId,QStringList *headList);
+ static QList getVerMultiCal(QString itemId,QStringList *headList);
// 获取检定数据管理 首页
static QList getVerificationData();
// 检定数据管理-检定基本信息
diff --git a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user b/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user
deleted file mode 100644
index 63c9751..0000000
--- a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user
+++ /dev/null
@@ -1,562 +0,0 @@
-
-
-
-
-
- EnvironmentId
- {2746248a-b112-4e0f-9ae0-9e61f2a42309}
-
-
- ProjectExplorer.Project.ActiveTarget
- 0
-
-
- ProjectExplorer.Project.EditorSettings
-
- true
- false
- true
-
- Cpp
-
- CppGlobal
-
-
-
- QmlJS
-
- QmlJSGlobal
-
-
- 2
- UTF-8
- false
- 4
- false
- 80
- true
- true
- 1
- true
- false
- 0
- true
- true
- 0
- 8
- true
- 1
- true
- true
- true
- false
-
-
-
- ProjectExplorer.Project.PluginSettings
-
-
- -fno-delayed-template-parsing
-
- true
-
-
-
- ProjectExplorer.Project.Target.0
-
- Desktop Qt 5.14.2 MinGW 32-bit
- Desktop Qt 5.14.2 MinGW 32-bit
- qt.qt5.5142.win32_mingw73_kit
- 0
- 0
- 0
-
- D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Debug
-
-
- true
- QtProjectManager.QMakeBuildStep
- true
-
- false
- false
- false
-
-
- true
- Qt4ProjectManager.MakeStep
-
- false
-
-
- false
-
- 2
- Build
- Build
- ProjectExplorer.BuildSteps.Build
-
-
-
- true
- Qt4ProjectManager.MakeStep
-
- true
- clean
-
- false
-
- 1
- Clean
- Clean
- ProjectExplorer.BuildSteps.Clean
-
- 2
- false
-
- Debug
- Qt4ProjectManager.Qt4BuildConfiguration
- 2
-
-
- D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Release
-
-
- true
- QtProjectManager.QMakeBuildStep
- false
-
- false
- false
- true
-
-
- true
- Qt4ProjectManager.MakeStep
-
- false
-
-
- false
-
- 2
- Build
- Build
- ProjectExplorer.BuildSteps.Build
-
-
-
- true
- Qt4ProjectManager.MakeStep
-
- true
- clean
-
- false
-
- 1
- Clean
- Clean
- ProjectExplorer.BuildSteps.Clean
-
- 2
- false
-
- Release
- Qt4ProjectManager.Qt4BuildConfiguration
- 0
-
-
- D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Profile
-
-
- true
- QtProjectManager.QMakeBuildStep
- true
-
- false
- true
- true
-
-
- true
- Qt4ProjectManager.MakeStep
-
- false
-
-
- false
-
- 2
- Build
- Build
- ProjectExplorer.BuildSteps.Build
-
-
-
- true
- Qt4ProjectManager.MakeStep
-
- true
- clean
-
- false
-
- 1
- Clean
- Clean
- ProjectExplorer.BuildSteps.Clean
-
- 2
- false
-
- Profile
- Qt4ProjectManager.Qt4BuildConfiguration
- 0
-
- 3
-
-
- 0
- Deploy
- Deploy
- ProjectExplorer.BuildSteps.Deploy
-
- 1
- ProjectExplorer.DefaultDeployConfiguration
-
- 1
-
-
- dwarf
-
- cpu-cycles
-
-
- 250
-
- -e
- cpu-cycles
- --call-graph
- dwarf,4096
- -F
- 250
-
- -F
- true
- 4096
- false
- false
- 1000
-
- true
-
- false
- false
- false
- false
- true
- 0.01
- 10
- true
- kcachegrind
- 1
- 25
-
- 1
- true
- false
- true
- valgrind
-
- 0
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
-
- 2
-
-
- ProjectExplorer.CustomExecutableRunConfiguration
-
-
- false
-
- false
- true
- false
- false
- true
-
-
-
- 1
-
-
-
- ProjectExplorer.Project.Target.1
-
- Desktop Qt 5.14.2 MinGW 64-bit
- Desktop Qt 5.14.2 MinGW 64-bit
- qt.qt5.5142.win64_mingw73_kit
- 0
- 0
- 0
-
- D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Debug
-
-
- true
- QtProjectManager.QMakeBuildStep
- true
-
- false
- false
- false
-
-
- true
- Qt4ProjectManager.MakeStep
-
- false
-
-
- false
-
- 2
- Build
- Build
- ProjectExplorer.BuildSteps.Build
-
-
-
- true
- Qt4ProjectManager.MakeStep
-
- true
- clean
-
- false
-
- 1
- Clean
- Clean
- ProjectExplorer.BuildSteps.Clean
-
- 2
- false
-
- Debug
- Qt4ProjectManager.Qt4BuildConfiguration
- 2
-
-
- D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Release
-
-
- true
- QtProjectManager.QMakeBuildStep
- false
-
- false
- false
- true
-
-
- true
- Qt4ProjectManager.MakeStep
-
- false
-
-
- false
-
- 2
- Build
- Build
- ProjectExplorer.BuildSteps.Build
-
-
-
- true
- Qt4ProjectManager.MakeStep
-
- true
- clean
-
- false
-
- 1
- Clean
- Clean
- ProjectExplorer.BuildSteps.Clean
-
- 2
- false
-
- Release
- Qt4ProjectManager.Qt4BuildConfiguration
- 0
-
-
- D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Profile
-
-
- true
- QtProjectManager.QMakeBuildStep
- true
-
- false
- true
- true
-
-
- true
- Qt4ProjectManager.MakeStep
-
- false
-
-
- false
-
- 2
- Build
- Build
- ProjectExplorer.BuildSteps.Build
-
-
-
- true
- Qt4ProjectManager.MakeStep
-
- true
- clean
-
- false
-
- 1
- Clean
- Clean
- ProjectExplorer.BuildSteps.Clean
-
- 2
- false
-
- Profile
- Qt4ProjectManager.Qt4BuildConfiguration
- 0
-
- 3
-
-
- 0
- Deploy
- Deploy
- ProjectExplorer.BuildSteps.Deploy
-
- 1
- ProjectExplorer.DefaultDeployConfiguration
-
- 1
-
-
- dwarf
-
- cpu-cycles
-
-
- 250
-
- -e
- cpu-cycles
- --call-graph
- dwarf,4096
- -F
- 250
-
- -F
- true
- 4096
- false
- false
- 1000
-
- true
-
- false
- false
- false
- false
- true
- 0.01
- 10
- true
- kcachegrind
- 1
- 25
-
- 1
- true
- false
- true
- valgrind
-
- 0
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
-
- 2
-
-
- ProjectExplorer.CustomExecutableRunConfiguration
-
-
- false
-
- false
- true
- false
- false
- true
-
-
-
- 1
-
-
-
- ProjectExplorer.Project.TargetCount
- 2
-
-
- ProjectExplorer.Project.Updater.FileVersion
- 22
-
-
- Version
- 22
-
-
diff --git a/softwareDirectory/AutoVerScheme/basecommonapi.cpp b/softwareDirectory/AutoVerScheme/basecommonapi.cpp
index 6170ee7..f587b64 100644
--- a/softwareDirectory/AutoVerScheme/basecommonapi.cpp
+++ b/softwareDirectory/AutoVerScheme/basecommonapi.cpp
@@ -5,30 +5,34 @@
}
-//获取部门任务数据 “1640229293790650370”
-QList BaseCommonApi::getAllData(QString userId) {
+//获取部门任务数据
+QList BaseCommonApi::getAllData(QString deptId,QString status) {
QList result;
QSqlQuery query;
- query.prepare("SELECT bi.id ,br.sample_name , br.sample_model ,ei.help_instruction ,ei.manufacture_no ,"
- " ei.manufacturer ,bi.customer_name ,dept.FULL_NAME,bi.require_over_time ,bi.is_urgent "
- " FROM biz_business_order_info bi LEft JOIN biz_business_order_sample_relation br ON bi.id = br.order_id "
- " LEft JOIN eqpt_equipment_info ei ON br.sample_no = ei.equipment_no LEft JOIN sys_dept dept ON ei.dept_id = dept.ID "
- " LEft JOIN sys_user ON bi.create_user_id = sys_user.ID "
- " WHERE sys_user.ID = :userId");
+ query.prepare("SELECT blei.id AS id, eei.equipment_name AS sampleName, eei.model AS sampleModel,eei.help_instruction AS helpInstruction, "
+ " eei.manufacture_no AS manufactureNo, eei.manufacturer,bo.customer_name,sd.SIMPLE_NAME,bo.require_over_time, bo.is_urgent "
+ "FROM biz_business_lab_executive_info blei "
+ "JOIN eqpt_equipment_info eei ON eei.id = blei.sample_id "
+ "LEFT JOIN sys_dept sd ON blei.measure_dept_id = sd.ID "
+ " JOIN biz_business_order_info bo ON bo.id = blei.order_id "
+ " WHERE blei.measure_dept_id = :deptId "
+ " AND blei.measure_status = :status "
+ " ORDER BY blei.update_time DESC");
// 将参数绑定到占位符
- query.bindValue(":userId", userId);
+ query.bindValue(":deptId", deptId);
+ query.bindValue(":status", status);
if (query.exec()) {
while (query.next()) {
Dept Dept;
Dept.id = query.value("id").toString();
- Dept.sample_name = query.value("sample_name").toString();
- Dept.sample_model = query.value("sample_model").toString();
- Dept.help_instruction = query.value("help_instruction").toString();
- Dept.manufacture_no = query.value("manufacture_no").toString();
+ Dept.sample_name = query.value("sampleName").toString();
+ Dept.sample_model = query.value("sampleModel").toString();
+ Dept.help_instruction = query.value("helpInstruction").toString();
+ Dept.manufacture_no = query.value("manufactureNo").toString();
Dept.manufacturer = query.value("manufacturer").toString();
Dept.customer_name = query.value("customer_name").toString();
- Dept.FULL_NAME = query.value("FULL_NAME").toString();
+ Dept.FULL_NAME = query.value("SIMPLE_NAME").toString();
Dept.require_over_time = query.value("require_over_time").toDateTime();
Dept.is_urgent = query.value("is_urgent").toString();
result.append(Dept);
@@ -39,32 +43,34 @@
return result;
}
-//获取我的任务
-QList BaseCommonApi::getMyTasks(QString userId){
+//获取我的任务 参数登录用户的id 和 任务状态
+QList BaseCommonApi::getMyTasks(QString userId,QString status){
QList result;
QSqlQuery query;
- query.prepare("SELECT "
- "bi.id, br.sample_name, br.sample_model, ei.help_instruction, ei.manufacture_no,"
- "ei.manufacturer, bi.customer_name,"
- "dept.FULL_NAME, bi.require_over_time,"
- "bi.is_urgent FROM biz_business_order_info bi"
- " LEfT JOIN biz_business_order_sample_relation br ON bi.id = br.order_id"
- " LEfT JOIN eqpt_equipment_info ei ON br.sample_no = ei.equipment_no LEfT JOIN "
- "sys_dept dept ON ei.dept_id = dept.ID WHERE bi.create_user_id = :user_id");
+ query.prepare("SELECT blei.id AS id, eei.equipment_name AS sampleName, eei.model AS sampleModel, eei.help_instruction AS helpInstruction, "
+ "eei.manufacture_no AS manufactureNo, eei.manufacturer,bo.customer_name,sd.SIMPLE_NAME AS measureDeptName,bo.require_over_time , bo.is_urgent "
+ "FROM biz_business_lab_executive_info blei "
+ "JOIN eqpt_equipment_info eei ON eei.id = blei.sample_id "
+ "JOIN biz_business_order_info bo ON bo.id = blei.order_id "
+ "LEFT JOIN sys_dept sd ON blei.measure_dept_id = sd.ID "
+ " WHERE blei.measure_person_id = :userId "
+ " AND blei.measure_status = :status "
+ " ORDER BY blei.update_time DESC");
// 将参数绑定到占位符
- query.bindValue(":user_id", userId);
+ query.bindValue(":userId", userId);
+ query.bindValue(":status", status);
if (query.exec()) {
while (query.next()) {
MyTask task;
task.id = query.value("id").toString();
- task.sample_name = query.value("sample_name").toString();
- task.sample_model = query.value("sample_model").toString();
- task.help_instruction = query.value("help_instruction").toString();
- task.manufacture_no = query.value("manufacture_no").toString();
+ task.sample_name = query.value("sampleName").toString();
+ task.sample_model = query.value("sampleModel").toString();
+ task.help_instruction = query.value("helpInstruction").toString();
+ task.manufacture_no = query.value("manufactureNo").toString();
task.manufacturer = query.value("manufacturer").toString();
task.customer_name = query.value("customer_name").toString();
- task.FULL_NAME = query.value("FULL_NAME").toString();
+ task.FULL_NAME = query.value("measureDeptName").toString();
task.require_over_time = query.value("require_over_time").toDateTime();
task.is_urgent = query.value("is_urgent").toString();
result.append(task);
@@ -470,9 +476,9 @@
{
QList result;
QSqlQuery query;
-bool isSuccess = query.exec("SELECT eei.id ,eei.equipment_name ,eei.model ,eei.help_instruction ,eei.manufacture_no ,eei.manufacturer ,bboi.customer_name ,sys_dept.FULL_NAME ,eei.meter_identify ,eei.check_cycle ,eei.certificate_valid from eqpt_equipment_info eei "
- " JOIN sys_dept ON sys_dept.ID = eei.dept_id "
- " JOIN biz_business_order_info bboi ON bboi.customer_id = eei.company_id");
+bool isSuccess = query.exec("SELECT DISTINCT eei.id ,eei.equipment_name ,eei.model ,eei.help_instruction ,eei.manufacture_no ,eei.manufacturer ,bboi.customer_name ,sys_dept.FULL_NAME ,eei.meter_identify ,eei.check_cycle ,eei.certificate_valid from eqpt_equipment_info eei "
+ " LEFT JOIN sys_dept ON sys_dept.ID = eei.dept_id "
+ " LEFT JOIN biz_business_order_info bboi ON bboi.customer_id = eei.company_id ");
if (isSuccess) {
while (query.next()) {
TestedDevice testedDevice;
@@ -596,9 +602,11 @@
{
case 1:
- //CliTable[0].item_category_id
+ //Clable[0].item_category_idiT
+ //1717086652508487681 后面替换为 Clable[0].item_category_idiT
DataList=BaseCommonApi::getVerMultiCal("1717086652508487681",HeadList);
break;
+
}
return DataList;
@@ -638,6 +646,7 @@
qDebug() << "Query execution failed: " << query.lastError().text();
}
*headList<<"序号"<<"参数"<<"量"<<"单位"<<"频率"<<"量程"<<"标准值"<<"分辨力"<<"最大允许误差"<<"误差参数a"<<"误差参数b";
+ return resultData;
}
//检定数据管理 首页
diff --git a/softwareDirectory/AutoVerScheme/basecommonapi.h b/softwareDirectory/AutoVerScheme/basecommonapi.h
index 1b70cb9..a113006 100644
--- a/softwareDirectory/AutoVerScheme/basecommonapi.h
+++ b/softwareDirectory/AutoVerScheme/basecommonapi.h
@@ -365,6 +365,7 @@
class Technique_File
{
public:
+ QString id;
QString file_distribute_no;
QString file_name;
QString version_no;
@@ -444,10 +445,16 @@
public:
BaseCommonApi();
- //部门任务 参数登录用户的id
- static QList getAllData(QString userId);
+
+ static QList Search_CalibrationTable(QString DeiverId,QStringList *HeadList);
+ //部门任务 废弃
+// static QList getAllData();
+
+
+ //部门任务 参数登录用户的部门id和状态
+ static QList getAllData(QString deptId,QString status);
//我的任务
- static QList getMyTasks(QString id);
+ static QList getMyTasks(QString id,QString status);
//获取创建任务首页数据
static QListgetCreateTaskList(QString id);
//创建任务-查看任务单顶部
@@ -479,7 +486,7 @@
//判断 哪个 装置表 传参 设备id 返回itemId
static QList getJudgeCalibrationTable(QString id);
//被检设备管理-检定项目及检定点-多功能校准源
- static QList getVerMultiCal(QString itemId,QStringList *headList);
+ static QList getVerMultiCal(QString itemId,QStringList *headList);
// 获取检定数据管理 首页
static QList getVerificationData();
// 检定数据管理-检定基本信息
diff --git a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.cpp b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.cpp
index 70148f4..ca5e040 100644
--- a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.cpp
+++ b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.cpp
@@ -203,7 +203,7 @@
//循环读取值 headlist,count是列的数量
for(int i=1;itableWidgetItem->setItem(row, i, new QTableWidgetItem(item[i])); //核查类型
+ ui->tableWidgetItem->setItem(row, i, new QTableWidgetItem(item[i]));
}
row++;
diff --git a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user b/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user
deleted file mode 100644
index 63c9751..0000000
--- a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user
+++ /dev/null
@@ -1,562 +0,0 @@
-
-
-
-
-
- EnvironmentId
- {2746248a-b112-4e0f-9ae0-9e61f2a42309}
-
-
- ProjectExplorer.Project.ActiveTarget
- 0
-
-
- ProjectExplorer.Project.EditorSettings
-
- true
- false
- true
-
- Cpp
-
- CppGlobal
-
-
-
- QmlJS
-
- QmlJSGlobal
-
-
- 2
- UTF-8
- false
- 4
- false
- 80
- true
- true
- 1
- true
- false
- 0
- true
- true
- 0
- 8
- true
- 1
- true
- true
- true
- false
-
-
-
- ProjectExplorer.Project.PluginSettings
-
-
- -fno-delayed-template-parsing
-
- true
-
-
-
- ProjectExplorer.Project.Target.0
-
- Desktop Qt 5.14.2 MinGW 32-bit
- Desktop Qt 5.14.2 MinGW 32-bit
- qt.qt5.5142.win32_mingw73_kit
- 0
- 0
- 0
-
- D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Debug
-
-
- true
- QtProjectManager.QMakeBuildStep
- true
-
- false
- false
- false
-
-
- true
- Qt4ProjectManager.MakeStep
-
- false
-
-
- false
-
- 2
- Build
- Build
- ProjectExplorer.BuildSteps.Build
-
-
-
- true
- Qt4ProjectManager.MakeStep
-
- true
- clean
-
- false
-
- 1
- Clean
- Clean
- ProjectExplorer.BuildSteps.Clean
-
- 2
- false
-
- Debug
- Qt4ProjectManager.Qt4BuildConfiguration
- 2
-
-
- D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Release
-
-
- true
- QtProjectManager.QMakeBuildStep
- false
-
- false
- false
- true
-
-
- true
- Qt4ProjectManager.MakeStep
-
- false
-
-
- false
-
- 2
- Build
- Build
- ProjectExplorer.BuildSteps.Build
-
-
-
- true
- Qt4ProjectManager.MakeStep
-
- true
- clean
-
- false
-
- 1
- Clean
- Clean
- ProjectExplorer.BuildSteps.Clean
-
- 2
- false
-
- Release
- Qt4ProjectManager.Qt4BuildConfiguration
- 0
-
-
- D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Profile
-
-
- true
- QtProjectManager.QMakeBuildStep
- true
-
- false
- true
- true
-
-
- true
- Qt4ProjectManager.MakeStep
-
- false
-
-
- false
-
- 2
- Build
- Build
- ProjectExplorer.BuildSteps.Build
-
-
-
- true
- Qt4ProjectManager.MakeStep
-
- true
- clean
-
- false
-
- 1
- Clean
- Clean
- ProjectExplorer.BuildSteps.Clean
-
- 2
- false
-
- Profile
- Qt4ProjectManager.Qt4BuildConfiguration
- 0
-
- 3
-
-
- 0
- Deploy
- Deploy
- ProjectExplorer.BuildSteps.Deploy
-
- 1
- ProjectExplorer.DefaultDeployConfiguration
-
- 1
-
-
- dwarf
-
- cpu-cycles
-
-
- 250
-
- -e
- cpu-cycles
- --call-graph
- dwarf,4096
- -F
- 250
-
- -F
- true
- 4096
- false
- false
- 1000
-
- true
-
- false
- false
- false
- false
- true
- 0.01
- 10
- true
- kcachegrind
- 1
- 25
-
- 1
- true
- false
- true
- valgrind
-
- 0
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
-
- 2
-
-
- ProjectExplorer.CustomExecutableRunConfiguration
-
-
- false
-
- false
- true
- false
- false
- true
-
-
-
- 1
-
-
-
- ProjectExplorer.Project.Target.1
-
- Desktop Qt 5.14.2 MinGW 64-bit
- Desktop Qt 5.14.2 MinGW 64-bit
- qt.qt5.5142.win64_mingw73_kit
- 0
- 0
- 0
-
- D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Debug
-
-
- true
- QtProjectManager.QMakeBuildStep
- true
-
- false
- false
- false
-
-
- true
- Qt4ProjectManager.MakeStep
-
- false
-
-
- false
-
- 2
- Build
- Build
- ProjectExplorer.BuildSteps.Build
-
-
-
- true
- Qt4ProjectManager.MakeStep
-
- true
- clean
-
- false
-
- 1
- Clean
- Clean
- ProjectExplorer.BuildSteps.Clean
-
- 2
- false
-
- Debug
- Qt4ProjectManager.Qt4BuildConfiguration
- 2
-
-
- D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Release
-
-
- true
- QtProjectManager.QMakeBuildStep
- false
-
- false
- false
- true
-
-
- true
- Qt4ProjectManager.MakeStep
-
- false
-
-
- false
-
- 2
- Build
- Build
- ProjectExplorer.BuildSteps.Build
-
-
-
- true
- Qt4ProjectManager.MakeStep
-
- true
- clean
-
- false
-
- 1
- Clean
- Clean
- ProjectExplorer.BuildSteps.Clean
-
- 2
- false
-
- Release
- Qt4ProjectManager.Qt4BuildConfiguration
- 0
-
-
- D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Profile
-
-
- true
- QtProjectManager.QMakeBuildStep
- true
-
- false
- true
- true
-
-
- true
- Qt4ProjectManager.MakeStep
-
- false
-
-
- false
-
- 2
- Build
- Build
- ProjectExplorer.BuildSteps.Build
-
-
-
- true
- Qt4ProjectManager.MakeStep
-
- true
- clean
-
- false
-
- 1
- Clean
- Clean
- ProjectExplorer.BuildSteps.Clean
-
- 2
- false
-
- Profile
- Qt4ProjectManager.Qt4BuildConfiguration
- 0
-
- 3
-
-
- 0
- Deploy
- Deploy
- ProjectExplorer.BuildSteps.Deploy
-
- 1
- ProjectExplorer.DefaultDeployConfiguration
-
- 1
-
-
- dwarf
-
- cpu-cycles
-
-
- 250
-
- -e
- cpu-cycles
- --call-graph
- dwarf,4096
- -F
- 250
-
- -F
- true
- 4096
- false
- false
- 1000
-
- true
-
- false
- false
- false
- false
- true
- 0.01
- 10
- true
- kcachegrind
- 1
- 25
-
- 1
- true
- false
- true
- valgrind
-
- 0
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
-
- 2
-
-
- ProjectExplorer.CustomExecutableRunConfiguration
-
-
- false
-
- false
- true
- false
- false
- true
-
-
-
- 1
-
-
-
- ProjectExplorer.Project.TargetCount
- 2
-
-
- ProjectExplorer.Project.Updater.FileVersion
- 22
-
-
- Version
- 22
-
-
diff --git a/softwareDirectory/AutoVerScheme/basecommonapi.cpp b/softwareDirectory/AutoVerScheme/basecommonapi.cpp
index 6170ee7..f587b64 100644
--- a/softwareDirectory/AutoVerScheme/basecommonapi.cpp
+++ b/softwareDirectory/AutoVerScheme/basecommonapi.cpp
@@ -5,30 +5,34 @@
}
-//获取部门任务数据 “1640229293790650370”
-QList BaseCommonApi::getAllData(QString userId) {
+//获取部门任务数据
+QList BaseCommonApi::getAllData(QString deptId,QString status) {
QList result;
QSqlQuery query;
- query.prepare("SELECT bi.id ,br.sample_name , br.sample_model ,ei.help_instruction ,ei.manufacture_no ,"
- " ei.manufacturer ,bi.customer_name ,dept.FULL_NAME,bi.require_over_time ,bi.is_urgent "
- " FROM biz_business_order_info bi LEft JOIN biz_business_order_sample_relation br ON bi.id = br.order_id "
- " LEft JOIN eqpt_equipment_info ei ON br.sample_no = ei.equipment_no LEft JOIN sys_dept dept ON ei.dept_id = dept.ID "
- " LEft JOIN sys_user ON bi.create_user_id = sys_user.ID "
- " WHERE sys_user.ID = :userId");
+ query.prepare("SELECT blei.id AS id, eei.equipment_name AS sampleName, eei.model AS sampleModel,eei.help_instruction AS helpInstruction, "
+ " eei.manufacture_no AS manufactureNo, eei.manufacturer,bo.customer_name,sd.SIMPLE_NAME,bo.require_over_time, bo.is_urgent "
+ "FROM biz_business_lab_executive_info blei "
+ "JOIN eqpt_equipment_info eei ON eei.id = blei.sample_id "
+ "LEFT JOIN sys_dept sd ON blei.measure_dept_id = sd.ID "
+ " JOIN biz_business_order_info bo ON bo.id = blei.order_id "
+ " WHERE blei.measure_dept_id = :deptId "
+ " AND blei.measure_status = :status "
+ " ORDER BY blei.update_time DESC");
// 将参数绑定到占位符
- query.bindValue(":userId", userId);
+ query.bindValue(":deptId", deptId);
+ query.bindValue(":status", status);
if (query.exec()) {
while (query.next()) {
Dept Dept;
Dept.id = query.value("id").toString();
- Dept.sample_name = query.value("sample_name").toString();
- Dept.sample_model = query.value("sample_model").toString();
- Dept.help_instruction = query.value("help_instruction").toString();
- Dept.manufacture_no = query.value("manufacture_no").toString();
+ Dept.sample_name = query.value("sampleName").toString();
+ Dept.sample_model = query.value("sampleModel").toString();
+ Dept.help_instruction = query.value("helpInstruction").toString();
+ Dept.manufacture_no = query.value("manufactureNo").toString();
Dept.manufacturer = query.value("manufacturer").toString();
Dept.customer_name = query.value("customer_name").toString();
- Dept.FULL_NAME = query.value("FULL_NAME").toString();
+ Dept.FULL_NAME = query.value("SIMPLE_NAME").toString();
Dept.require_over_time = query.value("require_over_time").toDateTime();
Dept.is_urgent = query.value("is_urgent").toString();
result.append(Dept);
@@ -39,32 +43,34 @@
return result;
}
-//获取我的任务
-QList BaseCommonApi::getMyTasks(QString userId){
+//获取我的任务 参数登录用户的id 和 任务状态
+QList BaseCommonApi::getMyTasks(QString userId,QString status){
QList result;
QSqlQuery query;
- query.prepare("SELECT "
- "bi.id, br.sample_name, br.sample_model, ei.help_instruction, ei.manufacture_no,"
- "ei.manufacturer, bi.customer_name,"
- "dept.FULL_NAME, bi.require_over_time,"
- "bi.is_urgent FROM biz_business_order_info bi"
- " LEfT JOIN biz_business_order_sample_relation br ON bi.id = br.order_id"
- " LEfT JOIN eqpt_equipment_info ei ON br.sample_no = ei.equipment_no LEfT JOIN "
- "sys_dept dept ON ei.dept_id = dept.ID WHERE bi.create_user_id = :user_id");
+ query.prepare("SELECT blei.id AS id, eei.equipment_name AS sampleName, eei.model AS sampleModel, eei.help_instruction AS helpInstruction, "
+ "eei.manufacture_no AS manufactureNo, eei.manufacturer,bo.customer_name,sd.SIMPLE_NAME AS measureDeptName,bo.require_over_time , bo.is_urgent "
+ "FROM biz_business_lab_executive_info blei "
+ "JOIN eqpt_equipment_info eei ON eei.id = blei.sample_id "
+ "JOIN biz_business_order_info bo ON bo.id = blei.order_id "
+ "LEFT JOIN sys_dept sd ON blei.measure_dept_id = sd.ID "
+ " WHERE blei.measure_person_id = :userId "
+ " AND blei.measure_status = :status "
+ " ORDER BY blei.update_time DESC");
// 将参数绑定到占位符
- query.bindValue(":user_id", userId);
+ query.bindValue(":userId", userId);
+ query.bindValue(":status", status);
if (query.exec()) {
while (query.next()) {
MyTask task;
task.id = query.value("id").toString();
- task.sample_name = query.value("sample_name").toString();
- task.sample_model = query.value("sample_model").toString();
- task.help_instruction = query.value("help_instruction").toString();
- task.manufacture_no = query.value("manufacture_no").toString();
+ task.sample_name = query.value("sampleName").toString();
+ task.sample_model = query.value("sampleModel").toString();
+ task.help_instruction = query.value("helpInstruction").toString();
+ task.manufacture_no = query.value("manufactureNo").toString();
task.manufacturer = query.value("manufacturer").toString();
task.customer_name = query.value("customer_name").toString();
- task.FULL_NAME = query.value("FULL_NAME").toString();
+ task.FULL_NAME = query.value("measureDeptName").toString();
task.require_over_time = query.value("require_over_time").toDateTime();
task.is_urgent = query.value("is_urgent").toString();
result.append(task);
@@ -470,9 +476,9 @@
{
QList result;
QSqlQuery query;
-bool isSuccess = query.exec("SELECT eei.id ,eei.equipment_name ,eei.model ,eei.help_instruction ,eei.manufacture_no ,eei.manufacturer ,bboi.customer_name ,sys_dept.FULL_NAME ,eei.meter_identify ,eei.check_cycle ,eei.certificate_valid from eqpt_equipment_info eei "
- " JOIN sys_dept ON sys_dept.ID = eei.dept_id "
- " JOIN biz_business_order_info bboi ON bboi.customer_id = eei.company_id");
+bool isSuccess = query.exec("SELECT DISTINCT eei.id ,eei.equipment_name ,eei.model ,eei.help_instruction ,eei.manufacture_no ,eei.manufacturer ,bboi.customer_name ,sys_dept.FULL_NAME ,eei.meter_identify ,eei.check_cycle ,eei.certificate_valid from eqpt_equipment_info eei "
+ " LEFT JOIN sys_dept ON sys_dept.ID = eei.dept_id "
+ " LEFT JOIN biz_business_order_info bboi ON bboi.customer_id = eei.company_id ");
if (isSuccess) {
while (query.next()) {
TestedDevice testedDevice;
@@ -596,9 +602,11 @@
{
case 1:
- //CliTable[0].item_category_id
+ //Clable[0].item_category_idiT
+ //1717086652508487681 后面替换为 Clable[0].item_category_idiT
DataList=BaseCommonApi::getVerMultiCal("1717086652508487681",HeadList);
break;
+
}
return DataList;
@@ -638,6 +646,7 @@
qDebug() << "Query execution failed: " << query.lastError().text();
}
*headList<<"序号"<<"参数"<<"量"<<"单位"<<"频率"<<"量程"<<"标准值"<<"分辨力"<<"最大允许误差"<<"误差参数a"<<"误差参数b";
+ return resultData;
}
//检定数据管理 首页
diff --git a/softwareDirectory/AutoVerScheme/basecommonapi.h b/softwareDirectory/AutoVerScheme/basecommonapi.h
index 1b70cb9..a113006 100644
--- a/softwareDirectory/AutoVerScheme/basecommonapi.h
+++ b/softwareDirectory/AutoVerScheme/basecommonapi.h
@@ -365,6 +365,7 @@
class Technique_File
{
public:
+ QString id;
QString file_distribute_no;
QString file_name;
QString version_no;
@@ -444,10 +445,16 @@
public:
BaseCommonApi();
- //部门任务 参数登录用户的id
- static QList getAllData(QString userId);
+
+ static QList Search_CalibrationTable(QString DeiverId,QStringList *HeadList);
+ //部门任务 废弃
+// static QList getAllData();
+
+
+ //部门任务 参数登录用户的部门id和状态
+ static QList getAllData(QString deptId,QString status);
//我的任务
- static QList getMyTasks(QString id);
+ static QList getMyTasks(QString id,QString status);
//获取创建任务首页数据
static QListgetCreateTaskList(QString id);
//创建任务-查看任务单顶部
@@ -479,7 +486,7 @@
//判断 哪个 装置表 传参 设备id 返回itemId
static QList getJudgeCalibrationTable(QString id);
//被检设备管理-检定项目及检定点-多功能校准源
- static QList getVerMultiCal(QString itemId,QStringList *headList);
+ static QList getVerMultiCal(QString itemId,QStringList *headList);
// 获取检定数据管理 首页
static QList getVerificationData();
// 检定数据管理-检定基本信息
diff --git a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.cpp b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.cpp
index 70148f4..ca5e040 100644
--- a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.cpp
+++ b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.cpp
@@ -203,7 +203,7 @@
//循环读取值 headlist,count是列的数量
for(int i=1;itableWidgetItem->setItem(row, i, new QTableWidgetItem(item[i])); //核查类型
+ ui->tableWidgetItem->setItem(row, i, new QTableWidgetItem(item[i]));
}
row++;
diff --git a/softwareDirectory/AutoVerScheme/checkwindow.cpp b/softwareDirectory/AutoVerScheme/checkwindow.cpp
index a5b8cbc..51650f9 100644
--- a/softwareDirectory/AutoVerScheme/checkwindow.cpp
+++ b/softwareDirectory/AutoVerScheme/checkwindow.cpp
@@ -63,7 +63,7 @@
//模拟用户ID
QString userId="1640229293790650370";
- QList data = BaseCommonApi::getMyTasks(userId);
+ QList data = BaseCommonApi::getMyTasks(userId,"3");
int rowCount = 0;
int row=0;
diff --git a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user b/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user
deleted file mode 100644
index 63c9751..0000000
--- a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user
+++ /dev/null
@@ -1,562 +0,0 @@
-
-
-
-
-
- EnvironmentId
- {2746248a-b112-4e0f-9ae0-9e61f2a42309}
-
-
- ProjectExplorer.Project.ActiveTarget
- 0
-
-
- ProjectExplorer.Project.EditorSettings
-
- true
- false
- true
-
- Cpp
-
- CppGlobal
-
-
-
- QmlJS
-
- QmlJSGlobal
-
-
- 2
- UTF-8
- false
- 4
- false
- 80
- true
- true
- 1
- true
- false
- 0
- true
- true
- 0
- 8
- true
- 1
- true
- true
- true
- false
-
-
-
- ProjectExplorer.Project.PluginSettings
-
-
- -fno-delayed-template-parsing
-
- true
-
-
-
- ProjectExplorer.Project.Target.0
-
- Desktop Qt 5.14.2 MinGW 32-bit
- Desktop Qt 5.14.2 MinGW 32-bit
- qt.qt5.5142.win32_mingw73_kit
- 0
- 0
- 0
-
- D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Debug
-
-
- true
- QtProjectManager.QMakeBuildStep
- true
-
- false
- false
- false
-
-
- true
- Qt4ProjectManager.MakeStep
-
- false
-
-
- false
-
- 2
- Build
- Build
- ProjectExplorer.BuildSteps.Build
-
-
-
- true
- Qt4ProjectManager.MakeStep
-
- true
- clean
-
- false
-
- 1
- Clean
- Clean
- ProjectExplorer.BuildSteps.Clean
-
- 2
- false
-
- Debug
- Qt4ProjectManager.Qt4BuildConfiguration
- 2
-
-
- D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Release
-
-
- true
- QtProjectManager.QMakeBuildStep
- false
-
- false
- false
- true
-
-
- true
- Qt4ProjectManager.MakeStep
-
- false
-
-
- false
-
- 2
- Build
- Build
- ProjectExplorer.BuildSteps.Build
-
-
-
- true
- Qt4ProjectManager.MakeStep
-
- true
- clean
-
- false
-
- 1
- Clean
- Clean
- ProjectExplorer.BuildSteps.Clean
-
- 2
- false
-
- Release
- Qt4ProjectManager.Qt4BuildConfiguration
- 0
-
-
- D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Profile
-
-
- true
- QtProjectManager.QMakeBuildStep
- true
-
- false
- true
- true
-
-
- true
- Qt4ProjectManager.MakeStep
-
- false
-
-
- false
-
- 2
- Build
- Build
- ProjectExplorer.BuildSteps.Build
-
-
-
- true
- Qt4ProjectManager.MakeStep
-
- true
- clean
-
- false
-
- 1
- Clean
- Clean
- ProjectExplorer.BuildSteps.Clean
-
- 2
- false
-
- Profile
- Qt4ProjectManager.Qt4BuildConfiguration
- 0
-
- 3
-
-
- 0
- Deploy
- Deploy
- ProjectExplorer.BuildSteps.Deploy
-
- 1
- ProjectExplorer.DefaultDeployConfiguration
-
- 1
-
-
- dwarf
-
- cpu-cycles
-
-
- 250
-
- -e
- cpu-cycles
- --call-graph
- dwarf,4096
- -F
- 250
-
- -F
- true
- 4096
- false
- false
- 1000
-
- true
-
- false
- false
- false
- false
- true
- 0.01
- 10
- true
- kcachegrind
- 1
- 25
-
- 1
- true
- false
- true
- valgrind
-
- 0
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
-
- 2
-
-
- ProjectExplorer.CustomExecutableRunConfiguration
-
-
- false
-
- false
- true
- false
- false
- true
-
-
-
- 1
-
-
-
- ProjectExplorer.Project.Target.1
-
- Desktop Qt 5.14.2 MinGW 64-bit
- Desktop Qt 5.14.2 MinGW 64-bit
- qt.qt5.5142.win64_mingw73_kit
- 0
- 0
- 0
-
- D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Debug
-
-
- true
- QtProjectManager.QMakeBuildStep
- true
-
- false
- false
- false
-
-
- true
- Qt4ProjectManager.MakeStep
-
- false
-
-
- false
-
- 2
- Build
- Build
- ProjectExplorer.BuildSteps.Build
-
-
-
- true
- Qt4ProjectManager.MakeStep
-
- true
- clean
-
- false
-
- 1
- Clean
- Clean
- ProjectExplorer.BuildSteps.Clean
-
- 2
- false
-
- Debug
- Qt4ProjectManager.Qt4BuildConfiguration
- 2
-
-
- D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Release
-
-
- true
- QtProjectManager.QMakeBuildStep
- false
-
- false
- false
- true
-
-
- true
- Qt4ProjectManager.MakeStep
-
- false
-
-
- false
-
- 2
- Build
- Build
- ProjectExplorer.BuildSteps.Build
-
-
-
- true
- Qt4ProjectManager.MakeStep
-
- true
- clean
-
- false
-
- 1
- Clean
- Clean
- ProjectExplorer.BuildSteps.Clean
-
- 2
- false
-
- Release
- Qt4ProjectManager.Qt4BuildConfiguration
- 0
-
-
- D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Profile
-
-
- true
- QtProjectManager.QMakeBuildStep
- true
-
- false
- true
- true
-
-
- true
- Qt4ProjectManager.MakeStep
-
- false
-
-
- false
-
- 2
- Build
- Build
- ProjectExplorer.BuildSteps.Build
-
-
-
- true
- Qt4ProjectManager.MakeStep
-
- true
- clean
-
- false
-
- 1
- Clean
- Clean
- ProjectExplorer.BuildSteps.Clean
-
- 2
- false
-
- Profile
- Qt4ProjectManager.Qt4BuildConfiguration
- 0
-
- 3
-
-
- 0
- Deploy
- Deploy
- ProjectExplorer.BuildSteps.Deploy
-
- 1
- ProjectExplorer.DefaultDeployConfiguration
-
- 1
-
-
- dwarf
-
- cpu-cycles
-
-
- 250
-
- -e
- cpu-cycles
- --call-graph
- dwarf,4096
- -F
- 250
-
- -F
- true
- 4096
- false
- false
- 1000
-
- true
-
- false
- false
- false
- false
- true
- 0.01
- 10
- true
- kcachegrind
- 1
- 25
-
- 1
- true
- false
- true
- valgrind
-
- 0
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
-
- 2
-
-
- ProjectExplorer.CustomExecutableRunConfiguration
-
-
- false
-
- false
- true
- false
- false
- true
-
-
-
- 1
-
-
-
- ProjectExplorer.Project.TargetCount
- 2
-
-
- ProjectExplorer.Project.Updater.FileVersion
- 22
-
-
- Version
- 22
-
-
diff --git a/softwareDirectory/AutoVerScheme/basecommonapi.cpp b/softwareDirectory/AutoVerScheme/basecommonapi.cpp
index 6170ee7..f587b64 100644
--- a/softwareDirectory/AutoVerScheme/basecommonapi.cpp
+++ b/softwareDirectory/AutoVerScheme/basecommonapi.cpp
@@ -5,30 +5,34 @@
}
-//获取部门任务数据 “1640229293790650370”
-QList BaseCommonApi::getAllData(QString userId) {
+//获取部门任务数据
+QList BaseCommonApi::getAllData(QString deptId,QString status) {
QList result;
QSqlQuery query;
- query.prepare("SELECT bi.id ,br.sample_name , br.sample_model ,ei.help_instruction ,ei.manufacture_no ,"
- " ei.manufacturer ,bi.customer_name ,dept.FULL_NAME,bi.require_over_time ,bi.is_urgent "
- " FROM biz_business_order_info bi LEft JOIN biz_business_order_sample_relation br ON bi.id = br.order_id "
- " LEft JOIN eqpt_equipment_info ei ON br.sample_no = ei.equipment_no LEft JOIN sys_dept dept ON ei.dept_id = dept.ID "
- " LEft JOIN sys_user ON bi.create_user_id = sys_user.ID "
- " WHERE sys_user.ID = :userId");
+ query.prepare("SELECT blei.id AS id, eei.equipment_name AS sampleName, eei.model AS sampleModel,eei.help_instruction AS helpInstruction, "
+ " eei.manufacture_no AS manufactureNo, eei.manufacturer,bo.customer_name,sd.SIMPLE_NAME,bo.require_over_time, bo.is_urgent "
+ "FROM biz_business_lab_executive_info blei "
+ "JOIN eqpt_equipment_info eei ON eei.id = blei.sample_id "
+ "LEFT JOIN sys_dept sd ON blei.measure_dept_id = sd.ID "
+ " JOIN biz_business_order_info bo ON bo.id = blei.order_id "
+ " WHERE blei.measure_dept_id = :deptId "
+ " AND blei.measure_status = :status "
+ " ORDER BY blei.update_time DESC");
// 将参数绑定到占位符
- query.bindValue(":userId", userId);
+ query.bindValue(":deptId", deptId);
+ query.bindValue(":status", status);
if (query.exec()) {
while (query.next()) {
Dept Dept;
Dept.id = query.value("id").toString();
- Dept.sample_name = query.value("sample_name").toString();
- Dept.sample_model = query.value("sample_model").toString();
- Dept.help_instruction = query.value("help_instruction").toString();
- Dept.manufacture_no = query.value("manufacture_no").toString();
+ Dept.sample_name = query.value("sampleName").toString();
+ Dept.sample_model = query.value("sampleModel").toString();
+ Dept.help_instruction = query.value("helpInstruction").toString();
+ Dept.manufacture_no = query.value("manufactureNo").toString();
Dept.manufacturer = query.value("manufacturer").toString();
Dept.customer_name = query.value("customer_name").toString();
- Dept.FULL_NAME = query.value("FULL_NAME").toString();
+ Dept.FULL_NAME = query.value("SIMPLE_NAME").toString();
Dept.require_over_time = query.value("require_over_time").toDateTime();
Dept.is_urgent = query.value("is_urgent").toString();
result.append(Dept);
@@ -39,32 +43,34 @@
return result;
}
-//获取我的任务
-QList BaseCommonApi::getMyTasks(QString userId){
+//获取我的任务 参数登录用户的id 和 任务状态
+QList BaseCommonApi::getMyTasks(QString userId,QString status){
QList result;
QSqlQuery query;
- query.prepare("SELECT "
- "bi.id, br.sample_name, br.sample_model, ei.help_instruction, ei.manufacture_no,"
- "ei.manufacturer, bi.customer_name,"
- "dept.FULL_NAME, bi.require_over_time,"
- "bi.is_urgent FROM biz_business_order_info bi"
- " LEfT JOIN biz_business_order_sample_relation br ON bi.id = br.order_id"
- " LEfT JOIN eqpt_equipment_info ei ON br.sample_no = ei.equipment_no LEfT JOIN "
- "sys_dept dept ON ei.dept_id = dept.ID WHERE bi.create_user_id = :user_id");
+ query.prepare("SELECT blei.id AS id, eei.equipment_name AS sampleName, eei.model AS sampleModel, eei.help_instruction AS helpInstruction, "
+ "eei.manufacture_no AS manufactureNo, eei.manufacturer,bo.customer_name,sd.SIMPLE_NAME AS measureDeptName,bo.require_over_time , bo.is_urgent "
+ "FROM biz_business_lab_executive_info blei "
+ "JOIN eqpt_equipment_info eei ON eei.id = blei.sample_id "
+ "JOIN biz_business_order_info bo ON bo.id = blei.order_id "
+ "LEFT JOIN sys_dept sd ON blei.measure_dept_id = sd.ID "
+ " WHERE blei.measure_person_id = :userId "
+ " AND blei.measure_status = :status "
+ " ORDER BY blei.update_time DESC");
// 将参数绑定到占位符
- query.bindValue(":user_id", userId);
+ query.bindValue(":userId", userId);
+ query.bindValue(":status", status);
if (query.exec()) {
while (query.next()) {
MyTask task;
task.id = query.value("id").toString();
- task.sample_name = query.value("sample_name").toString();
- task.sample_model = query.value("sample_model").toString();
- task.help_instruction = query.value("help_instruction").toString();
- task.manufacture_no = query.value("manufacture_no").toString();
+ task.sample_name = query.value("sampleName").toString();
+ task.sample_model = query.value("sampleModel").toString();
+ task.help_instruction = query.value("helpInstruction").toString();
+ task.manufacture_no = query.value("manufactureNo").toString();
task.manufacturer = query.value("manufacturer").toString();
task.customer_name = query.value("customer_name").toString();
- task.FULL_NAME = query.value("FULL_NAME").toString();
+ task.FULL_NAME = query.value("measureDeptName").toString();
task.require_over_time = query.value("require_over_time").toDateTime();
task.is_urgent = query.value("is_urgent").toString();
result.append(task);
@@ -470,9 +476,9 @@
{
QList result;
QSqlQuery query;
-bool isSuccess = query.exec("SELECT eei.id ,eei.equipment_name ,eei.model ,eei.help_instruction ,eei.manufacture_no ,eei.manufacturer ,bboi.customer_name ,sys_dept.FULL_NAME ,eei.meter_identify ,eei.check_cycle ,eei.certificate_valid from eqpt_equipment_info eei "
- " JOIN sys_dept ON sys_dept.ID = eei.dept_id "
- " JOIN biz_business_order_info bboi ON bboi.customer_id = eei.company_id");
+bool isSuccess = query.exec("SELECT DISTINCT eei.id ,eei.equipment_name ,eei.model ,eei.help_instruction ,eei.manufacture_no ,eei.manufacturer ,bboi.customer_name ,sys_dept.FULL_NAME ,eei.meter_identify ,eei.check_cycle ,eei.certificate_valid from eqpt_equipment_info eei "
+ " LEFT JOIN sys_dept ON sys_dept.ID = eei.dept_id "
+ " LEFT JOIN biz_business_order_info bboi ON bboi.customer_id = eei.company_id ");
if (isSuccess) {
while (query.next()) {
TestedDevice testedDevice;
@@ -596,9 +602,11 @@
{
case 1:
- //CliTable[0].item_category_id
+ //Clable[0].item_category_idiT
+ //1717086652508487681 后面替换为 Clable[0].item_category_idiT
DataList=BaseCommonApi::getVerMultiCal("1717086652508487681",HeadList);
break;
+
}
return DataList;
@@ -638,6 +646,7 @@
qDebug() << "Query execution failed: " << query.lastError().text();
}
*headList<<"序号"<<"参数"<<"量"<<"单位"<<"频率"<<"量程"<<"标准值"<<"分辨力"<<"最大允许误差"<<"误差参数a"<<"误差参数b";
+ return resultData;
}
//检定数据管理 首页
diff --git a/softwareDirectory/AutoVerScheme/basecommonapi.h b/softwareDirectory/AutoVerScheme/basecommonapi.h
index 1b70cb9..a113006 100644
--- a/softwareDirectory/AutoVerScheme/basecommonapi.h
+++ b/softwareDirectory/AutoVerScheme/basecommonapi.h
@@ -365,6 +365,7 @@
class Technique_File
{
public:
+ QString id;
QString file_distribute_no;
QString file_name;
QString version_no;
@@ -444,10 +445,16 @@
public:
BaseCommonApi();
- //部门任务 参数登录用户的id
- static QList getAllData(QString userId);
+
+ static QList Search_CalibrationTable(QString DeiverId,QStringList *HeadList);
+ //部门任务 废弃
+// static QList getAllData();
+
+
+ //部门任务 参数登录用户的部门id和状态
+ static QList getAllData(QString deptId,QString status);
//我的任务
- static QList getMyTasks(QString id);
+ static QList getMyTasks(QString id,QString status);
//获取创建任务首页数据
static QListgetCreateTaskList(QString id);
//创建任务-查看任务单顶部
@@ -479,7 +486,7 @@
//判断 哪个 装置表 传参 设备id 返回itemId
static QList getJudgeCalibrationTable(QString id);
//被检设备管理-检定项目及检定点-多功能校准源
- static QList getVerMultiCal(QString itemId,QStringList *headList);
+ static QList getVerMultiCal(QString itemId,QStringList *headList);
// 获取检定数据管理 首页
static QList getVerificationData();
// 检定数据管理-检定基本信息
diff --git a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.cpp b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.cpp
index 70148f4..ca5e040 100644
--- a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.cpp
+++ b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.cpp
@@ -203,7 +203,7 @@
//循环读取值 headlist,count是列的数量
for(int i=1;itableWidgetItem->setItem(row, i, new QTableWidgetItem(item[i])); //核查类型
+ ui->tableWidgetItem->setItem(row, i, new QTableWidgetItem(item[i]));
}
row++;
diff --git a/softwareDirectory/AutoVerScheme/checkwindow.cpp b/softwareDirectory/AutoVerScheme/checkwindow.cpp
index a5b8cbc..51650f9 100644
--- a/softwareDirectory/AutoVerScheme/checkwindow.cpp
+++ b/softwareDirectory/AutoVerScheme/checkwindow.cpp
@@ -63,7 +63,7 @@
//模拟用户ID
QString userId="1640229293790650370";
- QList data = BaseCommonApi::getMyTasks(userId);
+ QList data = BaseCommonApi::getMyTasks(userId,"3");
int rowCount = 0;
int row=0;
diff --git a/softwareDirectory/AutoVerScheme/create_task.cpp b/softwareDirectory/AutoVerScheme/create_task.cpp
index 9b49a1a..ddd78ef 100644
--- a/softwareDirectory/AutoVerScheme/create_task.cpp
+++ b/softwareDirectory/AutoVerScheme/create_task.cpp
@@ -2,12 +2,15 @@
#include "ui_create_task.h"
#include "QMessageBox"
+
+ QString Create_Task::State="";
Create_Task::Create_Task(QWidget *parent) :
InfoBase(parent),
ui(new Ui::Create_Task)
{
ui->setupUi(this);
this->initForm();
+
}
Create_Task::~Create_Task()
@@ -25,17 +28,19 @@
"background-color:white;"
"}");
- ui->tableWidget->setRowCount(10); // 设置10行
- ui->tableWidget->setColumnCount(8); // 设置11列
+ //ui->tableWidget->setRowCount(10); // 设置10行
+ ui->tableWidget->setColumnCount(9); // 设置11列
ui->tableWidget->setColumnWidth(0, 80); // 设置第一列的宽度为100像素
ui->tableWidget->verticalHeader()->setParent(nullptr); //隐藏行头
- QTableWidgetItem *item = new QTableWidgetItem("测试数据");
- item->setTextAlignment(Qt::AlignCenter);
- ui->tableWidget->setItem(0, 0, item); //设置数据
+ //QTableWidgetItem *item = new QTableWidgetItem("测试数据");
+ //item->setTextAlignment(Qt::AlignCenter);
+ //ui->tableWidget->setItem(0, 0, item); //设置数据
+ ui->tableWidget->setColumnWidth(0, 0); // 设置第一列的宽度为0
//初始化TableWidget 设置列
QStringList headers;
- headers << "序号" << "任务单编号" << "委托方"<< "使用部门" << "要求检完时间" << "送检人"<<"是否加急"<<"操作";
+ headers <<"ID"<< "序号" << "任务单编号" << "委托方"<< "使用部门"
+ << "要求检完时间" << "送检人"<<"是否加急"<<"操作";
ui->tableWidget->setHorizontalHeaderLabels(headers);
//ShowMessageBox("标题","初始化完成");
}
@@ -57,5 +62,171 @@
}
void Create_Task::Load()
{
- //ShowMessageBox("创建任务界面","创建任务界面初始化完成");
+ //先设置为行为0
+ ui->tableWidget->setRowCount(0);
+ ui->stackedWidget->setCurrentIndex(0);
+
+ QList data = BaseCommonApi::getCreateTaskList("");
+
+ int rowCount = 0;
+ int row=0;
+ QString is_urgent;
+ for (const CreateTaskList& item : data) {
+ rowCount = ui->tableWidget->rowCount();
+
+ ui->tableWidget->insertRow(rowCount);
+ ui->tableWidget->setItem(row, 0, new QTableWidgetItem(item.id));
+ ui->tableWidget->setItem(row, 1, new QTableWidgetItem(QString::number(row+1)));
+ ui->tableWidget->setItem(row, 2, new QTableWidgetItem(item.order_no));
+ ui->tableWidget->setItem(row, 3, new QTableWidgetItem(item.customer_name));
+ ui->tableWidget->setItem(row, 4, new QTableWidgetItem(item.DEPT_FULL_NAME));
+ ui->tableWidget->setItem(row, 5, new QTableWidgetItem(item.require_over_time.toString()));
+ ui->tableWidget->setItem(row, 6, new QTableWidgetItem(item.deliverer));
+ if(item.is_urgent=="1")
+ is_urgent="是";
+ else
+ is_urgent="否";
+ ui->tableWidget->setItem(row, 7, new QTableWidgetItem(is_urgent));
+
+ //实现单元格添加两个按钮
+ // 创建一个QWidget作为单元格的容器
+ QWidget *widget = new QWidget();
+ QHBoxLayout *layout = new QHBoxLayout(widget); // 水平布局
+
+
+ QPushButton *button = new QPushButton("查看");
+ QPushButton *button2 = new QPushButton("编辑");
+ QPushButton *button3 = new QPushButton("删除");
+
+ //设置按钮1简单样式
+ button->setStyleSheet("QPushButton {"
+ " border: none; /* 无边框 */"
+ " color: green; /* 文本颜色 */"
+ " text-decoration: underline; /* 文本下划线 */"
+ "}");
+
+ // 设置鼠标悬停时的光标样式为小手图标
+ button->setCursor(Qt::PointingHandCursor);
+ // 连接按钮的 clicked 信号到自定义槽函数
+ connect(button, &QPushButton::clicked, this, [this, button, row]() {
+ // 获取当前行第一列的 ID
+ QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0);
+ if (idItem) {
+ QString id = idItem->text();
+ OnButtonSelectClicked(id);
+ Create_Task::State="Select";
+ }
+
+ });
+ //设置按钮2简单样式
+ button2->setStyleSheet("QPushButton {"
+ " border: none; /* 无边框 */"
+ " color: green; /* 文本颜色 */"
+ " text-decoration: underline; /* 文本下划线 */"
+ "}");
+
+ // 设置鼠标悬停时的光标样式为小手图标
+ button2->setCursor(Qt::PointingHandCursor);
+ // 连接按钮的 clicked 信号到自定义槽函数
+ connect(button2, &QPushButton::clicked, this, [this, button2, row]() {
+ // 获取当前行第一列的 ID
+ QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0);
+ if (idItem) {
+ QString id = idItem->text();
+ OnButtonUpdateClicked(id);
+ Create_Task::State="Update";
+ }
+
+ });
+ //设置按钮3简单样式
+ button3->setStyleSheet("QPushButton {"
+ " border: none; /* 无边框 */"
+ " color: red; /* 文本颜色 */"
+ " text-decoration: underline; /* 文本下划线 */"
+ "}");
+
+ // 设置鼠标悬停时的光标样式为小手图标
+ button3->setCursor(Qt::PointingHandCursor);
+ // 连接按钮的 clicked 信号到自定义槽函数
+ connect(button3, &QPushButton::clicked, this, [this, button3, row]() {
+ // 获取当前行第一列的 ID
+ QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0);
+ if (idItem) {
+ QString id = idItem->text();
+ OnButtoDeleteClicked(id);
+ }
+
+ });
+ //将按钮添加到布局控件
+ layout->addWidget(button);
+ layout->addWidget(button2);
+ layout->addWidget(button3);
+ layout->setContentsMargins(5, 5, 0, 0); // 设置布局边距为0
+ widget->setLayout(layout);
+ //将布局控件添加到 单元格
+ ui->tableWidget->setCellWidget(row, 8, widget);
+ // 调整表格大小以适应内容
+ //ui->tableWidget->resizeColumnsToContents();
+ // ui->tableWidget->resizeRowsToContents();
+ row++;
+ }
+}
+void Create_Task::OnButtonSelectClicked(QString id)
+{
+ // ========================================================================================
+ // 查看按钮 点击事件 进入详情页面
+ // ====================================================================================
+ //DeviceInfoInit(id);
+ HiddenButton();
+ ui->stackedWidget->setCurrentIndex(1);
+ QMessageBox::information(this, "查看按钮ID",id);
+}
+void Create_Task::OnButtonUpdateClicked(QString id)
+{
+ // ========================================================================================
+ // 编辑按钮 点击事件 进入详情页面
+ // ====================================================================================
+ //DeviceInfoInit(id);
+ DisplayButton();
+ ui->stackedWidget->setCurrentIndex(1);
+ QMessageBox::information(this, "编辑按钮ID",id);
+}
+void Create_Task::OnButtoDeleteClicked(QString id)
+{
+ // ========================================================================================
+ // 删除按钮 点击事件 进入详情页面
+ // ====================================================================================
+ //DeviceInfoInit(id);
+ //ui->stackedWidget->setCurrentIndex(1);
+
+ QMessageBox::information(this, "删除按钮ID",id);
+}
+
+void Create_Task::on_pushButton_2_clicked()
+{
+ // ========================================================================================
+ // 创建任务单按钮
+ // ====================================================================================
+ DisplayButton();
+ ui->stackedWidget->setCurrentIndex(1);
+ Create_Task::State="Create";
+}
+void Create_Task::HiddenButton()
+{
+ ui->SaveButton->hide();
+ ui->CreateButton->hide();
+ ui->ScanButton->hide();
+ ui->deletebutton->hide();
+}
+void Create_Task::DisplayButton()
+{
+ ui->SaveButton->show();
+ ui->CreateButton->show();
+ ui->ScanButton->show();
+ ui->deletebutton->show();
+}
+
+void Create_Task::on_pushButton_clicked()
+{
+ ui->stackedWidget->setCurrentIndex(0);
}
diff --git a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user b/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user
deleted file mode 100644
index 63c9751..0000000
--- a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user
+++ /dev/null
@@ -1,562 +0,0 @@
-
-
-
-
-
- EnvironmentId
- {2746248a-b112-4e0f-9ae0-9e61f2a42309}
-
-
- ProjectExplorer.Project.ActiveTarget
- 0
-
-
- ProjectExplorer.Project.EditorSettings
-
- true
- false
- true
-
- Cpp
-
- CppGlobal
-
-
-
- QmlJS
-
- QmlJSGlobal
-
-
- 2
- UTF-8
- false
- 4
- false
- 80
- true
- true
- 1
- true
- false
- 0
- true
- true
- 0
- 8
- true
- 1
- true
- true
- true
- false
-
-
-
- ProjectExplorer.Project.PluginSettings
-
-
- -fno-delayed-template-parsing
-
- true
-
-
-
- ProjectExplorer.Project.Target.0
-
- Desktop Qt 5.14.2 MinGW 32-bit
- Desktop Qt 5.14.2 MinGW 32-bit
- qt.qt5.5142.win32_mingw73_kit
- 0
- 0
- 0
-
- D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Debug
-
-
- true
- QtProjectManager.QMakeBuildStep
- true
-
- false
- false
- false
-
-
- true
- Qt4ProjectManager.MakeStep
-
- false
-
-
- false
-
- 2
- Build
- Build
- ProjectExplorer.BuildSteps.Build
-
-
-
- true
- Qt4ProjectManager.MakeStep
-
- true
- clean
-
- false
-
- 1
- Clean
- Clean
- ProjectExplorer.BuildSteps.Clean
-
- 2
- false
-
- Debug
- Qt4ProjectManager.Qt4BuildConfiguration
- 2
-
-
- D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Release
-
-
- true
- QtProjectManager.QMakeBuildStep
- false
-
- false
- false
- true
-
-
- true
- Qt4ProjectManager.MakeStep
-
- false
-
-
- false
-
- 2
- Build
- Build
- ProjectExplorer.BuildSteps.Build
-
-
-
- true
- Qt4ProjectManager.MakeStep
-
- true
- clean
-
- false
-
- 1
- Clean
- Clean
- ProjectExplorer.BuildSteps.Clean
-
- 2
- false
-
- Release
- Qt4ProjectManager.Qt4BuildConfiguration
- 0
-
-
- D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Profile
-
-
- true
- QtProjectManager.QMakeBuildStep
- true
-
- false
- true
- true
-
-
- true
- Qt4ProjectManager.MakeStep
-
- false
-
-
- false
-
- 2
- Build
- Build
- ProjectExplorer.BuildSteps.Build
-
-
-
- true
- Qt4ProjectManager.MakeStep
-
- true
- clean
-
- false
-
- 1
- Clean
- Clean
- ProjectExplorer.BuildSteps.Clean
-
- 2
- false
-
- Profile
- Qt4ProjectManager.Qt4BuildConfiguration
- 0
-
- 3
-
-
- 0
- Deploy
- Deploy
- ProjectExplorer.BuildSteps.Deploy
-
- 1
- ProjectExplorer.DefaultDeployConfiguration
-
- 1
-
-
- dwarf
-
- cpu-cycles
-
-
- 250
-
- -e
- cpu-cycles
- --call-graph
- dwarf,4096
- -F
- 250
-
- -F
- true
- 4096
- false
- false
- 1000
-
- true
-
- false
- false
- false
- false
- true
- 0.01
- 10
- true
- kcachegrind
- 1
- 25
-
- 1
- true
- false
- true
- valgrind
-
- 0
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
-
- 2
-
-
- ProjectExplorer.CustomExecutableRunConfiguration
-
-
- false
-
- false
- true
- false
- false
- true
-
-
-
- 1
-
-
-
- ProjectExplorer.Project.Target.1
-
- Desktop Qt 5.14.2 MinGW 64-bit
- Desktop Qt 5.14.2 MinGW 64-bit
- qt.qt5.5142.win64_mingw73_kit
- 0
- 0
- 0
-
- D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Debug
-
-
- true
- QtProjectManager.QMakeBuildStep
- true
-
- false
- false
- false
-
-
- true
- Qt4ProjectManager.MakeStep
-
- false
-
-
- false
-
- 2
- Build
- Build
- ProjectExplorer.BuildSteps.Build
-
-
-
- true
- Qt4ProjectManager.MakeStep
-
- true
- clean
-
- false
-
- 1
- Clean
- Clean
- ProjectExplorer.BuildSteps.Clean
-
- 2
- false
-
- Debug
- Qt4ProjectManager.Qt4BuildConfiguration
- 2
-
-
- D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Release
-
-
- true
- QtProjectManager.QMakeBuildStep
- false
-
- false
- false
- true
-
-
- true
- Qt4ProjectManager.MakeStep
-
- false
-
-
- false
-
- 2
- Build
- Build
- ProjectExplorer.BuildSteps.Build
-
-
-
- true
- Qt4ProjectManager.MakeStep
-
- true
- clean
-
- false
-
- 1
- Clean
- Clean
- ProjectExplorer.BuildSteps.Clean
-
- 2
- false
-
- Release
- Qt4ProjectManager.Qt4BuildConfiguration
- 0
-
-
- D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Profile
-
-
- true
- QtProjectManager.QMakeBuildStep
- true
-
- false
- true
- true
-
-
- true
- Qt4ProjectManager.MakeStep
-
- false
-
-
- false
-
- 2
- Build
- Build
- ProjectExplorer.BuildSteps.Build
-
-
-
- true
- Qt4ProjectManager.MakeStep
-
- true
- clean
-
- false
-
- 1
- Clean
- Clean
- ProjectExplorer.BuildSteps.Clean
-
- 2
- false
-
- Profile
- Qt4ProjectManager.Qt4BuildConfiguration
- 0
-
- 3
-
-
- 0
- Deploy
- Deploy
- ProjectExplorer.BuildSteps.Deploy
-
- 1
- ProjectExplorer.DefaultDeployConfiguration
-
- 1
-
-
- dwarf
-
- cpu-cycles
-
-
- 250
-
- -e
- cpu-cycles
- --call-graph
- dwarf,4096
- -F
- 250
-
- -F
- true
- 4096
- false
- false
- 1000
-
- true
-
- false
- false
- false
- false
- true
- 0.01
- 10
- true
- kcachegrind
- 1
- 25
-
- 1
- true
- false
- true
- valgrind
-
- 0
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
-
- 2
-
-
- ProjectExplorer.CustomExecutableRunConfiguration
-
-
- false
-
- false
- true
- false
- false
- true
-
-
-
- 1
-
-
-
- ProjectExplorer.Project.TargetCount
- 2
-
-
- ProjectExplorer.Project.Updater.FileVersion
- 22
-
-
- Version
- 22
-
-
diff --git a/softwareDirectory/AutoVerScheme/basecommonapi.cpp b/softwareDirectory/AutoVerScheme/basecommonapi.cpp
index 6170ee7..f587b64 100644
--- a/softwareDirectory/AutoVerScheme/basecommonapi.cpp
+++ b/softwareDirectory/AutoVerScheme/basecommonapi.cpp
@@ -5,30 +5,34 @@
}
-//获取部门任务数据 “1640229293790650370”
-QList BaseCommonApi::getAllData(QString userId) {
+//获取部门任务数据
+QList BaseCommonApi::getAllData(QString deptId,QString status) {
QList result;
QSqlQuery query;
- query.prepare("SELECT bi.id ,br.sample_name , br.sample_model ,ei.help_instruction ,ei.manufacture_no ,"
- " ei.manufacturer ,bi.customer_name ,dept.FULL_NAME,bi.require_over_time ,bi.is_urgent "
- " FROM biz_business_order_info bi LEft JOIN biz_business_order_sample_relation br ON bi.id = br.order_id "
- " LEft JOIN eqpt_equipment_info ei ON br.sample_no = ei.equipment_no LEft JOIN sys_dept dept ON ei.dept_id = dept.ID "
- " LEft JOIN sys_user ON bi.create_user_id = sys_user.ID "
- " WHERE sys_user.ID = :userId");
+ query.prepare("SELECT blei.id AS id, eei.equipment_name AS sampleName, eei.model AS sampleModel,eei.help_instruction AS helpInstruction, "
+ " eei.manufacture_no AS manufactureNo, eei.manufacturer,bo.customer_name,sd.SIMPLE_NAME,bo.require_over_time, bo.is_urgent "
+ "FROM biz_business_lab_executive_info blei "
+ "JOIN eqpt_equipment_info eei ON eei.id = blei.sample_id "
+ "LEFT JOIN sys_dept sd ON blei.measure_dept_id = sd.ID "
+ " JOIN biz_business_order_info bo ON bo.id = blei.order_id "
+ " WHERE blei.measure_dept_id = :deptId "
+ " AND blei.measure_status = :status "
+ " ORDER BY blei.update_time DESC");
// 将参数绑定到占位符
- query.bindValue(":userId", userId);
+ query.bindValue(":deptId", deptId);
+ query.bindValue(":status", status);
if (query.exec()) {
while (query.next()) {
Dept Dept;
Dept.id = query.value("id").toString();
- Dept.sample_name = query.value("sample_name").toString();
- Dept.sample_model = query.value("sample_model").toString();
- Dept.help_instruction = query.value("help_instruction").toString();
- Dept.manufacture_no = query.value("manufacture_no").toString();
+ Dept.sample_name = query.value("sampleName").toString();
+ Dept.sample_model = query.value("sampleModel").toString();
+ Dept.help_instruction = query.value("helpInstruction").toString();
+ Dept.manufacture_no = query.value("manufactureNo").toString();
Dept.manufacturer = query.value("manufacturer").toString();
Dept.customer_name = query.value("customer_name").toString();
- Dept.FULL_NAME = query.value("FULL_NAME").toString();
+ Dept.FULL_NAME = query.value("SIMPLE_NAME").toString();
Dept.require_over_time = query.value("require_over_time").toDateTime();
Dept.is_urgent = query.value("is_urgent").toString();
result.append(Dept);
@@ -39,32 +43,34 @@
return result;
}
-//获取我的任务
-QList BaseCommonApi::getMyTasks(QString userId){
+//获取我的任务 参数登录用户的id 和 任务状态
+QList BaseCommonApi::getMyTasks(QString userId,QString status){
QList result;
QSqlQuery query;
- query.prepare("SELECT "
- "bi.id, br.sample_name, br.sample_model, ei.help_instruction, ei.manufacture_no,"
- "ei.manufacturer, bi.customer_name,"
- "dept.FULL_NAME, bi.require_over_time,"
- "bi.is_urgent FROM biz_business_order_info bi"
- " LEfT JOIN biz_business_order_sample_relation br ON bi.id = br.order_id"
- " LEfT JOIN eqpt_equipment_info ei ON br.sample_no = ei.equipment_no LEfT JOIN "
- "sys_dept dept ON ei.dept_id = dept.ID WHERE bi.create_user_id = :user_id");
+ query.prepare("SELECT blei.id AS id, eei.equipment_name AS sampleName, eei.model AS sampleModel, eei.help_instruction AS helpInstruction, "
+ "eei.manufacture_no AS manufactureNo, eei.manufacturer,bo.customer_name,sd.SIMPLE_NAME AS measureDeptName,bo.require_over_time , bo.is_urgent "
+ "FROM biz_business_lab_executive_info blei "
+ "JOIN eqpt_equipment_info eei ON eei.id = blei.sample_id "
+ "JOIN biz_business_order_info bo ON bo.id = blei.order_id "
+ "LEFT JOIN sys_dept sd ON blei.measure_dept_id = sd.ID "
+ " WHERE blei.measure_person_id = :userId "
+ " AND blei.measure_status = :status "
+ " ORDER BY blei.update_time DESC");
// 将参数绑定到占位符
- query.bindValue(":user_id", userId);
+ query.bindValue(":userId", userId);
+ query.bindValue(":status", status);
if (query.exec()) {
while (query.next()) {
MyTask task;
task.id = query.value("id").toString();
- task.sample_name = query.value("sample_name").toString();
- task.sample_model = query.value("sample_model").toString();
- task.help_instruction = query.value("help_instruction").toString();
- task.manufacture_no = query.value("manufacture_no").toString();
+ task.sample_name = query.value("sampleName").toString();
+ task.sample_model = query.value("sampleModel").toString();
+ task.help_instruction = query.value("helpInstruction").toString();
+ task.manufacture_no = query.value("manufactureNo").toString();
task.manufacturer = query.value("manufacturer").toString();
task.customer_name = query.value("customer_name").toString();
- task.FULL_NAME = query.value("FULL_NAME").toString();
+ task.FULL_NAME = query.value("measureDeptName").toString();
task.require_over_time = query.value("require_over_time").toDateTime();
task.is_urgent = query.value("is_urgent").toString();
result.append(task);
@@ -470,9 +476,9 @@
{
QList result;
QSqlQuery query;
-bool isSuccess = query.exec("SELECT eei.id ,eei.equipment_name ,eei.model ,eei.help_instruction ,eei.manufacture_no ,eei.manufacturer ,bboi.customer_name ,sys_dept.FULL_NAME ,eei.meter_identify ,eei.check_cycle ,eei.certificate_valid from eqpt_equipment_info eei "
- " JOIN sys_dept ON sys_dept.ID = eei.dept_id "
- " JOIN biz_business_order_info bboi ON bboi.customer_id = eei.company_id");
+bool isSuccess = query.exec("SELECT DISTINCT eei.id ,eei.equipment_name ,eei.model ,eei.help_instruction ,eei.manufacture_no ,eei.manufacturer ,bboi.customer_name ,sys_dept.FULL_NAME ,eei.meter_identify ,eei.check_cycle ,eei.certificate_valid from eqpt_equipment_info eei "
+ " LEFT JOIN sys_dept ON sys_dept.ID = eei.dept_id "
+ " LEFT JOIN biz_business_order_info bboi ON bboi.customer_id = eei.company_id ");
if (isSuccess) {
while (query.next()) {
TestedDevice testedDevice;
@@ -596,9 +602,11 @@
{
case 1:
- //CliTable[0].item_category_id
+ //Clable[0].item_category_idiT
+ //1717086652508487681 后面替换为 Clable[0].item_category_idiT
DataList=BaseCommonApi::getVerMultiCal("1717086652508487681",HeadList);
break;
+
}
return DataList;
@@ -638,6 +646,7 @@
qDebug() << "Query execution failed: " << query.lastError().text();
}
*headList<<"序号"<<"参数"<<"量"<<"单位"<<"频率"<<"量程"<<"标准值"<<"分辨力"<<"最大允许误差"<<"误差参数a"<<"误差参数b";
+ return resultData;
}
//检定数据管理 首页
diff --git a/softwareDirectory/AutoVerScheme/basecommonapi.h b/softwareDirectory/AutoVerScheme/basecommonapi.h
index 1b70cb9..a113006 100644
--- a/softwareDirectory/AutoVerScheme/basecommonapi.h
+++ b/softwareDirectory/AutoVerScheme/basecommonapi.h
@@ -365,6 +365,7 @@
class Technique_File
{
public:
+ QString id;
QString file_distribute_no;
QString file_name;
QString version_no;
@@ -444,10 +445,16 @@
public:
BaseCommonApi();
- //部门任务 参数登录用户的id
- static QList getAllData(QString userId);
+
+ static QList Search_CalibrationTable(QString DeiverId,QStringList *HeadList);
+ //部门任务 废弃
+// static QList getAllData();
+
+
+ //部门任务 参数登录用户的部门id和状态
+ static QList getAllData(QString deptId,QString status);
//我的任务
- static QList getMyTasks(QString id);
+ static QList getMyTasks(QString id,QString status);
//获取创建任务首页数据
static QListgetCreateTaskList(QString id);
//创建任务-查看任务单顶部
@@ -479,7 +486,7 @@
//判断 哪个 装置表 传参 设备id 返回itemId
static QList getJudgeCalibrationTable(QString id);
//被检设备管理-检定项目及检定点-多功能校准源
- static QList getVerMultiCal(QString itemId,QStringList *headList);
+ static QList getVerMultiCal(QString itemId,QStringList *headList);
// 获取检定数据管理 首页
static QList getVerificationData();
// 检定数据管理-检定基本信息
diff --git a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.cpp b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.cpp
index 70148f4..ca5e040 100644
--- a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.cpp
+++ b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.cpp
@@ -203,7 +203,7 @@
//循环读取值 headlist,count是列的数量
for(int i=1;itableWidgetItem->setItem(row, i, new QTableWidgetItem(item[i])); //核查类型
+ ui->tableWidgetItem->setItem(row, i, new QTableWidgetItem(item[i]));
}
row++;
diff --git a/softwareDirectory/AutoVerScheme/checkwindow.cpp b/softwareDirectory/AutoVerScheme/checkwindow.cpp
index a5b8cbc..51650f9 100644
--- a/softwareDirectory/AutoVerScheme/checkwindow.cpp
+++ b/softwareDirectory/AutoVerScheme/checkwindow.cpp
@@ -63,7 +63,7 @@
//模拟用户ID
QString userId="1640229293790650370";
- QList data = BaseCommonApi::getMyTasks(userId);
+ QList data = BaseCommonApi::getMyTasks(userId,"3");
int rowCount = 0;
int row=0;
diff --git a/softwareDirectory/AutoVerScheme/create_task.cpp b/softwareDirectory/AutoVerScheme/create_task.cpp
index 9b49a1a..ddd78ef 100644
--- a/softwareDirectory/AutoVerScheme/create_task.cpp
+++ b/softwareDirectory/AutoVerScheme/create_task.cpp
@@ -2,12 +2,15 @@
#include "ui_create_task.h"
#include "QMessageBox"
+
+ QString Create_Task::State="";
Create_Task::Create_Task(QWidget *parent) :
InfoBase(parent),
ui(new Ui::Create_Task)
{
ui->setupUi(this);
this->initForm();
+
}
Create_Task::~Create_Task()
@@ -25,17 +28,19 @@
"background-color:white;"
"}");
- ui->tableWidget->setRowCount(10); // 设置10行
- ui->tableWidget->setColumnCount(8); // 设置11列
+ //ui->tableWidget->setRowCount(10); // 设置10行
+ ui->tableWidget->setColumnCount(9); // 设置11列
ui->tableWidget->setColumnWidth(0, 80); // 设置第一列的宽度为100像素
ui->tableWidget->verticalHeader()->setParent(nullptr); //隐藏行头
- QTableWidgetItem *item = new QTableWidgetItem("测试数据");
- item->setTextAlignment(Qt::AlignCenter);
- ui->tableWidget->setItem(0, 0, item); //设置数据
+ //QTableWidgetItem *item = new QTableWidgetItem("测试数据");
+ //item->setTextAlignment(Qt::AlignCenter);
+ //ui->tableWidget->setItem(0, 0, item); //设置数据
+ ui->tableWidget->setColumnWidth(0, 0); // 设置第一列的宽度为0
//初始化TableWidget 设置列
QStringList headers;
- headers << "序号" << "任务单编号" << "委托方"<< "使用部门" << "要求检完时间" << "送检人"<<"是否加急"<<"操作";
+ headers <<"ID"<< "序号" << "任务单编号" << "委托方"<< "使用部门"
+ << "要求检完时间" << "送检人"<<"是否加急"<<"操作";
ui->tableWidget->setHorizontalHeaderLabels(headers);
//ShowMessageBox("标题","初始化完成");
}
@@ -57,5 +62,171 @@
}
void Create_Task::Load()
{
- //ShowMessageBox("创建任务界面","创建任务界面初始化完成");
+ //先设置为行为0
+ ui->tableWidget->setRowCount(0);
+ ui->stackedWidget->setCurrentIndex(0);
+
+ QList data = BaseCommonApi::getCreateTaskList("");
+
+ int rowCount = 0;
+ int row=0;
+ QString is_urgent;
+ for (const CreateTaskList& item : data) {
+ rowCount = ui->tableWidget->rowCount();
+
+ ui->tableWidget->insertRow(rowCount);
+ ui->tableWidget->setItem(row, 0, new QTableWidgetItem(item.id));
+ ui->tableWidget->setItem(row, 1, new QTableWidgetItem(QString::number(row+1)));
+ ui->tableWidget->setItem(row, 2, new QTableWidgetItem(item.order_no));
+ ui->tableWidget->setItem(row, 3, new QTableWidgetItem(item.customer_name));
+ ui->tableWidget->setItem(row, 4, new QTableWidgetItem(item.DEPT_FULL_NAME));
+ ui->tableWidget->setItem(row, 5, new QTableWidgetItem(item.require_over_time.toString()));
+ ui->tableWidget->setItem(row, 6, new QTableWidgetItem(item.deliverer));
+ if(item.is_urgent=="1")
+ is_urgent="是";
+ else
+ is_urgent="否";
+ ui->tableWidget->setItem(row, 7, new QTableWidgetItem(is_urgent));
+
+ //实现单元格添加两个按钮
+ // 创建一个QWidget作为单元格的容器
+ QWidget *widget = new QWidget();
+ QHBoxLayout *layout = new QHBoxLayout(widget); // 水平布局
+
+
+ QPushButton *button = new QPushButton("查看");
+ QPushButton *button2 = new QPushButton("编辑");
+ QPushButton *button3 = new QPushButton("删除");
+
+ //设置按钮1简单样式
+ button->setStyleSheet("QPushButton {"
+ " border: none; /* 无边框 */"
+ " color: green; /* 文本颜色 */"
+ " text-decoration: underline; /* 文本下划线 */"
+ "}");
+
+ // 设置鼠标悬停时的光标样式为小手图标
+ button->setCursor(Qt::PointingHandCursor);
+ // 连接按钮的 clicked 信号到自定义槽函数
+ connect(button, &QPushButton::clicked, this, [this, button, row]() {
+ // 获取当前行第一列的 ID
+ QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0);
+ if (idItem) {
+ QString id = idItem->text();
+ OnButtonSelectClicked(id);
+ Create_Task::State="Select";
+ }
+
+ });
+ //设置按钮2简单样式
+ button2->setStyleSheet("QPushButton {"
+ " border: none; /* 无边框 */"
+ " color: green; /* 文本颜色 */"
+ " text-decoration: underline; /* 文本下划线 */"
+ "}");
+
+ // 设置鼠标悬停时的光标样式为小手图标
+ button2->setCursor(Qt::PointingHandCursor);
+ // 连接按钮的 clicked 信号到自定义槽函数
+ connect(button2, &QPushButton::clicked, this, [this, button2, row]() {
+ // 获取当前行第一列的 ID
+ QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0);
+ if (idItem) {
+ QString id = idItem->text();
+ OnButtonUpdateClicked(id);
+ Create_Task::State="Update";
+ }
+
+ });
+ //设置按钮3简单样式
+ button3->setStyleSheet("QPushButton {"
+ " border: none; /* 无边框 */"
+ " color: red; /* 文本颜色 */"
+ " text-decoration: underline; /* 文本下划线 */"
+ "}");
+
+ // 设置鼠标悬停时的光标样式为小手图标
+ button3->setCursor(Qt::PointingHandCursor);
+ // 连接按钮的 clicked 信号到自定义槽函数
+ connect(button3, &QPushButton::clicked, this, [this, button3, row]() {
+ // 获取当前行第一列的 ID
+ QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0);
+ if (idItem) {
+ QString id = idItem->text();
+ OnButtoDeleteClicked(id);
+ }
+
+ });
+ //将按钮添加到布局控件
+ layout->addWidget(button);
+ layout->addWidget(button2);
+ layout->addWidget(button3);
+ layout->setContentsMargins(5, 5, 0, 0); // 设置布局边距为0
+ widget->setLayout(layout);
+ //将布局控件添加到 单元格
+ ui->tableWidget->setCellWidget(row, 8, widget);
+ // 调整表格大小以适应内容
+ //ui->tableWidget->resizeColumnsToContents();
+ // ui->tableWidget->resizeRowsToContents();
+ row++;
+ }
+}
+void Create_Task::OnButtonSelectClicked(QString id)
+{
+ // ========================================================================================
+ // 查看按钮 点击事件 进入详情页面
+ // ====================================================================================
+ //DeviceInfoInit(id);
+ HiddenButton();
+ ui->stackedWidget->setCurrentIndex(1);
+ QMessageBox::information(this, "查看按钮ID",id);
+}
+void Create_Task::OnButtonUpdateClicked(QString id)
+{
+ // ========================================================================================
+ // 编辑按钮 点击事件 进入详情页面
+ // ====================================================================================
+ //DeviceInfoInit(id);
+ DisplayButton();
+ ui->stackedWidget->setCurrentIndex(1);
+ QMessageBox::information(this, "编辑按钮ID",id);
+}
+void Create_Task::OnButtoDeleteClicked(QString id)
+{
+ // ========================================================================================
+ // 删除按钮 点击事件 进入详情页面
+ // ====================================================================================
+ //DeviceInfoInit(id);
+ //ui->stackedWidget->setCurrentIndex(1);
+
+ QMessageBox::information(this, "删除按钮ID",id);
+}
+
+void Create_Task::on_pushButton_2_clicked()
+{
+ // ========================================================================================
+ // 创建任务单按钮
+ // ====================================================================================
+ DisplayButton();
+ ui->stackedWidget->setCurrentIndex(1);
+ Create_Task::State="Create";
+}
+void Create_Task::HiddenButton()
+{
+ ui->SaveButton->hide();
+ ui->CreateButton->hide();
+ ui->ScanButton->hide();
+ ui->deletebutton->hide();
+}
+void Create_Task::DisplayButton()
+{
+ ui->SaveButton->show();
+ ui->CreateButton->show();
+ ui->ScanButton->show();
+ ui->deletebutton->show();
+}
+
+void Create_Task::on_pushButton_clicked()
+{
+ ui->stackedWidget->setCurrentIndex(0);
}
diff --git a/softwareDirectory/AutoVerScheme/depar_task.cpp b/softwareDirectory/AutoVerScheme/depar_task.cpp
index d442b65..13b1855 100644
--- a/softwareDirectory/AutoVerScheme/depar_task.cpp
+++ b/softwareDirectory/AutoVerScheme/depar_task.cpp
@@ -79,8 +79,8 @@
// 调用数据库管理器的函数获取数据
//QList data = dbManager.getAllData();
//模拟用户ID
- QString userId="1640229293790650370";
- QList data = BaseCommonApi::getAllData(userId);
+ QString deptId="1601423748184150017";
+ QList data = BaseCommonApi::getAllData(deptId,"3");
int rowCount = 0;
int row=0;
diff --git a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user b/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user
deleted file mode 100644
index 63c9751..0000000
--- a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user
+++ /dev/null
@@ -1,562 +0,0 @@
-
-
-
-
-
- EnvironmentId
- {2746248a-b112-4e0f-9ae0-9e61f2a42309}
-
-
- ProjectExplorer.Project.ActiveTarget
- 0
-
-
- ProjectExplorer.Project.EditorSettings
-
- true
- false
- true
-
- Cpp
-
- CppGlobal
-
-
-
- QmlJS
-
- QmlJSGlobal
-
-
- 2
- UTF-8
- false
- 4
- false
- 80
- true
- true
- 1
- true
- false
- 0
- true
- true
- 0
- 8
- true
- 1
- true
- true
- true
- false
-
-
-
- ProjectExplorer.Project.PluginSettings
-
-
- -fno-delayed-template-parsing
-
- true
-
-
-
- ProjectExplorer.Project.Target.0
-
- Desktop Qt 5.14.2 MinGW 32-bit
- Desktop Qt 5.14.2 MinGW 32-bit
- qt.qt5.5142.win32_mingw73_kit
- 0
- 0
- 0
-
- D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Debug
-
-
- true
- QtProjectManager.QMakeBuildStep
- true
-
- false
- false
- false
-
-
- true
- Qt4ProjectManager.MakeStep
-
- false
-
-
- false
-
- 2
- Build
- Build
- ProjectExplorer.BuildSteps.Build
-
-
-
- true
- Qt4ProjectManager.MakeStep
-
- true
- clean
-
- false
-
- 1
- Clean
- Clean
- ProjectExplorer.BuildSteps.Clean
-
- 2
- false
-
- Debug
- Qt4ProjectManager.Qt4BuildConfiguration
- 2
-
-
- D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Release
-
-
- true
- QtProjectManager.QMakeBuildStep
- false
-
- false
- false
- true
-
-
- true
- Qt4ProjectManager.MakeStep
-
- false
-
-
- false
-
- 2
- Build
- Build
- ProjectExplorer.BuildSteps.Build
-
-
-
- true
- Qt4ProjectManager.MakeStep
-
- true
- clean
-
- false
-
- 1
- Clean
- Clean
- ProjectExplorer.BuildSteps.Clean
-
- 2
- false
-
- Release
- Qt4ProjectManager.Qt4BuildConfiguration
- 0
-
-
- D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Profile
-
-
- true
- QtProjectManager.QMakeBuildStep
- true
-
- false
- true
- true
-
-
- true
- Qt4ProjectManager.MakeStep
-
- false
-
-
- false
-
- 2
- Build
- Build
- ProjectExplorer.BuildSteps.Build
-
-
-
- true
- Qt4ProjectManager.MakeStep
-
- true
- clean
-
- false
-
- 1
- Clean
- Clean
- ProjectExplorer.BuildSteps.Clean
-
- 2
- false
-
- Profile
- Qt4ProjectManager.Qt4BuildConfiguration
- 0
-
- 3
-
-
- 0
- Deploy
- Deploy
- ProjectExplorer.BuildSteps.Deploy
-
- 1
- ProjectExplorer.DefaultDeployConfiguration
-
- 1
-
-
- dwarf
-
- cpu-cycles
-
-
- 250
-
- -e
- cpu-cycles
- --call-graph
- dwarf,4096
- -F
- 250
-
- -F
- true
- 4096
- false
- false
- 1000
-
- true
-
- false
- false
- false
- false
- true
- 0.01
- 10
- true
- kcachegrind
- 1
- 25
-
- 1
- true
- false
- true
- valgrind
-
- 0
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
-
- 2
-
-
- ProjectExplorer.CustomExecutableRunConfiguration
-
-
- false
-
- false
- true
- false
- false
- true
-
-
-
- 1
-
-
-
- ProjectExplorer.Project.Target.1
-
- Desktop Qt 5.14.2 MinGW 64-bit
- Desktop Qt 5.14.2 MinGW 64-bit
- qt.qt5.5142.win64_mingw73_kit
- 0
- 0
- 0
-
- D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Debug
-
-
- true
- QtProjectManager.QMakeBuildStep
- true
-
- false
- false
- false
-
-
- true
- Qt4ProjectManager.MakeStep
-
- false
-
-
- false
-
- 2
- Build
- Build
- ProjectExplorer.BuildSteps.Build
-
-
-
- true
- Qt4ProjectManager.MakeStep
-
- true
- clean
-
- false
-
- 1
- Clean
- Clean
- ProjectExplorer.BuildSteps.Clean
-
- 2
- false
-
- Debug
- Qt4ProjectManager.Qt4BuildConfiguration
- 2
-
-
- D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Release
-
-
- true
- QtProjectManager.QMakeBuildStep
- false
-
- false
- false
- true
-
-
- true
- Qt4ProjectManager.MakeStep
-
- false
-
-
- false
-
- 2
- Build
- Build
- ProjectExplorer.BuildSteps.Build
-
-
-
- true
- Qt4ProjectManager.MakeStep
-
- true
- clean
-
- false
-
- 1
- Clean
- Clean
- ProjectExplorer.BuildSteps.Clean
-
- 2
- false
-
- Release
- Qt4ProjectManager.Qt4BuildConfiguration
- 0
-
-
- D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Profile
-
-
- true
- QtProjectManager.QMakeBuildStep
- true
-
- false
- true
- true
-
-
- true
- Qt4ProjectManager.MakeStep
-
- false
-
-
- false
-
- 2
- Build
- Build
- ProjectExplorer.BuildSteps.Build
-
-
-
- true
- Qt4ProjectManager.MakeStep
-
- true
- clean
-
- false
-
- 1
- Clean
- Clean
- ProjectExplorer.BuildSteps.Clean
-
- 2
- false
-
- Profile
- Qt4ProjectManager.Qt4BuildConfiguration
- 0
-
- 3
-
-
- 0
- Deploy
- Deploy
- ProjectExplorer.BuildSteps.Deploy
-
- 1
- ProjectExplorer.DefaultDeployConfiguration
-
- 1
-
-
- dwarf
-
- cpu-cycles
-
-
- 250
-
- -e
- cpu-cycles
- --call-graph
- dwarf,4096
- -F
- 250
-
- -F
- true
- 4096
- false
- false
- 1000
-
- true
-
- false
- false
- false
- false
- true
- 0.01
- 10
- true
- kcachegrind
- 1
- 25
-
- 1
- true
- false
- true
- valgrind
-
- 0
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
-
- 2
-
-
- ProjectExplorer.CustomExecutableRunConfiguration
-
-
- false
-
- false
- true
- false
- false
- true
-
-
-
- 1
-
-
-
- ProjectExplorer.Project.TargetCount
- 2
-
-
- ProjectExplorer.Project.Updater.FileVersion
- 22
-
-
- Version
- 22
-
-
diff --git a/softwareDirectory/AutoVerScheme/basecommonapi.cpp b/softwareDirectory/AutoVerScheme/basecommonapi.cpp
index 6170ee7..f587b64 100644
--- a/softwareDirectory/AutoVerScheme/basecommonapi.cpp
+++ b/softwareDirectory/AutoVerScheme/basecommonapi.cpp
@@ -5,30 +5,34 @@
}
-//获取部门任务数据 “1640229293790650370”
-QList BaseCommonApi::getAllData(QString userId) {
+//获取部门任务数据
+QList BaseCommonApi::getAllData(QString deptId,QString status) {
QList result;
QSqlQuery query;
- query.prepare("SELECT bi.id ,br.sample_name , br.sample_model ,ei.help_instruction ,ei.manufacture_no ,"
- " ei.manufacturer ,bi.customer_name ,dept.FULL_NAME,bi.require_over_time ,bi.is_urgent "
- " FROM biz_business_order_info bi LEft JOIN biz_business_order_sample_relation br ON bi.id = br.order_id "
- " LEft JOIN eqpt_equipment_info ei ON br.sample_no = ei.equipment_no LEft JOIN sys_dept dept ON ei.dept_id = dept.ID "
- " LEft JOIN sys_user ON bi.create_user_id = sys_user.ID "
- " WHERE sys_user.ID = :userId");
+ query.prepare("SELECT blei.id AS id, eei.equipment_name AS sampleName, eei.model AS sampleModel,eei.help_instruction AS helpInstruction, "
+ " eei.manufacture_no AS manufactureNo, eei.manufacturer,bo.customer_name,sd.SIMPLE_NAME,bo.require_over_time, bo.is_urgent "
+ "FROM biz_business_lab_executive_info blei "
+ "JOIN eqpt_equipment_info eei ON eei.id = blei.sample_id "
+ "LEFT JOIN sys_dept sd ON blei.measure_dept_id = sd.ID "
+ " JOIN biz_business_order_info bo ON bo.id = blei.order_id "
+ " WHERE blei.measure_dept_id = :deptId "
+ " AND blei.measure_status = :status "
+ " ORDER BY blei.update_time DESC");
// 将参数绑定到占位符
- query.bindValue(":userId", userId);
+ query.bindValue(":deptId", deptId);
+ query.bindValue(":status", status);
if (query.exec()) {
while (query.next()) {
Dept Dept;
Dept.id = query.value("id").toString();
- Dept.sample_name = query.value("sample_name").toString();
- Dept.sample_model = query.value("sample_model").toString();
- Dept.help_instruction = query.value("help_instruction").toString();
- Dept.manufacture_no = query.value("manufacture_no").toString();
+ Dept.sample_name = query.value("sampleName").toString();
+ Dept.sample_model = query.value("sampleModel").toString();
+ Dept.help_instruction = query.value("helpInstruction").toString();
+ Dept.manufacture_no = query.value("manufactureNo").toString();
Dept.manufacturer = query.value("manufacturer").toString();
Dept.customer_name = query.value("customer_name").toString();
- Dept.FULL_NAME = query.value("FULL_NAME").toString();
+ Dept.FULL_NAME = query.value("SIMPLE_NAME").toString();
Dept.require_over_time = query.value("require_over_time").toDateTime();
Dept.is_urgent = query.value("is_urgent").toString();
result.append(Dept);
@@ -39,32 +43,34 @@
return result;
}
-//获取我的任务
-QList BaseCommonApi::getMyTasks(QString userId){
+//获取我的任务 参数登录用户的id 和 任务状态
+QList BaseCommonApi::getMyTasks(QString userId,QString status){
QList result;
QSqlQuery query;
- query.prepare("SELECT "
- "bi.id, br.sample_name, br.sample_model, ei.help_instruction, ei.manufacture_no,"
- "ei.manufacturer, bi.customer_name,"
- "dept.FULL_NAME, bi.require_over_time,"
- "bi.is_urgent FROM biz_business_order_info bi"
- " LEfT JOIN biz_business_order_sample_relation br ON bi.id = br.order_id"
- " LEfT JOIN eqpt_equipment_info ei ON br.sample_no = ei.equipment_no LEfT JOIN "
- "sys_dept dept ON ei.dept_id = dept.ID WHERE bi.create_user_id = :user_id");
+ query.prepare("SELECT blei.id AS id, eei.equipment_name AS sampleName, eei.model AS sampleModel, eei.help_instruction AS helpInstruction, "
+ "eei.manufacture_no AS manufactureNo, eei.manufacturer,bo.customer_name,sd.SIMPLE_NAME AS measureDeptName,bo.require_over_time , bo.is_urgent "
+ "FROM biz_business_lab_executive_info blei "
+ "JOIN eqpt_equipment_info eei ON eei.id = blei.sample_id "
+ "JOIN biz_business_order_info bo ON bo.id = blei.order_id "
+ "LEFT JOIN sys_dept sd ON blei.measure_dept_id = sd.ID "
+ " WHERE blei.measure_person_id = :userId "
+ " AND blei.measure_status = :status "
+ " ORDER BY blei.update_time DESC");
// 将参数绑定到占位符
- query.bindValue(":user_id", userId);
+ query.bindValue(":userId", userId);
+ query.bindValue(":status", status);
if (query.exec()) {
while (query.next()) {
MyTask task;
task.id = query.value("id").toString();
- task.sample_name = query.value("sample_name").toString();
- task.sample_model = query.value("sample_model").toString();
- task.help_instruction = query.value("help_instruction").toString();
- task.manufacture_no = query.value("manufacture_no").toString();
+ task.sample_name = query.value("sampleName").toString();
+ task.sample_model = query.value("sampleModel").toString();
+ task.help_instruction = query.value("helpInstruction").toString();
+ task.manufacture_no = query.value("manufactureNo").toString();
task.manufacturer = query.value("manufacturer").toString();
task.customer_name = query.value("customer_name").toString();
- task.FULL_NAME = query.value("FULL_NAME").toString();
+ task.FULL_NAME = query.value("measureDeptName").toString();
task.require_over_time = query.value("require_over_time").toDateTime();
task.is_urgent = query.value("is_urgent").toString();
result.append(task);
@@ -470,9 +476,9 @@
{
QList result;
QSqlQuery query;
-bool isSuccess = query.exec("SELECT eei.id ,eei.equipment_name ,eei.model ,eei.help_instruction ,eei.manufacture_no ,eei.manufacturer ,bboi.customer_name ,sys_dept.FULL_NAME ,eei.meter_identify ,eei.check_cycle ,eei.certificate_valid from eqpt_equipment_info eei "
- " JOIN sys_dept ON sys_dept.ID = eei.dept_id "
- " JOIN biz_business_order_info bboi ON bboi.customer_id = eei.company_id");
+bool isSuccess = query.exec("SELECT DISTINCT eei.id ,eei.equipment_name ,eei.model ,eei.help_instruction ,eei.manufacture_no ,eei.manufacturer ,bboi.customer_name ,sys_dept.FULL_NAME ,eei.meter_identify ,eei.check_cycle ,eei.certificate_valid from eqpt_equipment_info eei "
+ " LEFT JOIN sys_dept ON sys_dept.ID = eei.dept_id "
+ " LEFT JOIN biz_business_order_info bboi ON bboi.customer_id = eei.company_id ");
if (isSuccess) {
while (query.next()) {
TestedDevice testedDevice;
@@ -596,9 +602,11 @@
{
case 1:
- //CliTable[0].item_category_id
+ //Clable[0].item_category_idiT
+ //1717086652508487681 后面替换为 Clable[0].item_category_idiT
DataList=BaseCommonApi::getVerMultiCal("1717086652508487681",HeadList);
break;
+
}
return DataList;
@@ -638,6 +646,7 @@
qDebug() << "Query execution failed: " << query.lastError().text();
}
*headList<<"序号"<<"参数"<<"量"<<"单位"<<"频率"<<"量程"<<"标准值"<<"分辨力"<<"最大允许误差"<<"误差参数a"<<"误差参数b";
+ return resultData;
}
//检定数据管理 首页
diff --git a/softwareDirectory/AutoVerScheme/basecommonapi.h b/softwareDirectory/AutoVerScheme/basecommonapi.h
index 1b70cb9..a113006 100644
--- a/softwareDirectory/AutoVerScheme/basecommonapi.h
+++ b/softwareDirectory/AutoVerScheme/basecommonapi.h
@@ -365,6 +365,7 @@
class Technique_File
{
public:
+ QString id;
QString file_distribute_no;
QString file_name;
QString version_no;
@@ -444,10 +445,16 @@
public:
BaseCommonApi();
- //部门任务 参数登录用户的id
- static QList getAllData(QString userId);
+
+ static QList Search_CalibrationTable(QString DeiverId,QStringList *HeadList);
+ //部门任务 废弃
+// static QList getAllData();
+
+
+ //部门任务 参数登录用户的部门id和状态
+ static QList getAllData(QString deptId,QString status);
//我的任务
- static QList getMyTasks(QString id);
+ static QList getMyTasks(QString id,QString status);
//获取创建任务首页数据
static QListgetCreateTaskList(QString id);
//创建任务-查看任务单顶部
@@ -479,7 +486,7 @@
//判断 哪个 装置表 传参 设备id 返回itemId
static QList getJudgeCalibrationTable(QString id);
//被检设备管理-检定项目及检定点-多功能校准源
- static QList getVerMultiCal(QString itemId,QStringList *headList);
+ static QList getVerMultiCal(QString itemId,QStringList *headList);
// 获取检定数据管理 首页
static QList getVerificationData();
// 检定数据管理-检定基本信息
diff --git a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.cpp b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.cpp
index 70148f4..ca5e040 100644
--- a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.cpp
+++ b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.cpp
@@ -203,7 +203,7 @@
//循环读取值 headlist,count是列的数量
for(int i=1;itableWidgetItem->setItem(row, i, new QTableWidgetItem(item[i])); //核查类型
+ ui->tableWidgetItem->setItem(row, i, new QTableWidgetItem(item[i]));
}
row++;
diff --git a/softwareDirectory/AutoVerScheme/checkwindow.cpp b/softwareDirectory/AutoVerScheme/checkwindow.cpp
index a5b8cbc..51650f9 100644
--- a/softwareDirectory/AutoVerScheme/checkwindow.cpp
+++ b/softwareDirectory/AutoVerScheme/checkwindow.cpp
@@ -63,7 +63,7 @@
//模拟用户ID
QString userId="1640229293790650370";
- QList data = BaseCommonApi::getMyTasks(userId);
+ QList data = BaseCommonApi::getMyTasks(userId,"3");
int rowCount = 0;
int row=0;
diff --git a/softwareDirectory/AutoVerScheme/create_task.cpp b/softwareDirectory/AutoVerScheme/create_task.cpp
index 9b49a1a..ddd78ef 100644
--- a/softwareDirectory/AutoVerScheme/create_task.cpp
+++ b/softwareDirectory/AutoVerScheme/create_task.cpp
@@ -2,12 +2,15 @@
#include "ui_create_task.h"
#include "QMessageBox"
+
+ QString Create_Task::State="";
Create_Task::Create_Task(QWidget *parent) :
InfoBase(parent),
ui(new Ui::Create_Task)
{
ui->setupUi(this);
this->initForm();
+
}
Create_Task::~Create_Task()
@@ -25,17 +28,19 @@
"background-color:white;"
"}");
- ui->tableWidget->setRowCount(10); // 设置10行
- ui->tableWidget->setColumnCount(8); // 设置11列
+ //ui->tableWidget->setRowCount(10); // 设置10行
+ ui->tableWidget->setColumnCount(9); // 设置11列
ui->tableWidget->setColumnWidth(0, 80); // 设置第一列的宽度为100像素
ui->tableWidget->verticalHeader()->setParent(nullptr); //隐藏行头
- QTableWidgetItem *item = new QTableWidgetItem("测试数据");
- item->setTextAlignment(Qt::AlignCenter);
- ui->tableWidget->setItem(0, 0, item); //设置数据
+ //QTableWidgetItem *item = new QTableWidgetItem("测试数据");
+ //item->setTextAlignment(Qt::AlignCenter);
+ //ui->tableWidget->setItem(0, 0, item); //设置数据
+ ui->tableWidget->setColumnWidth(0, 0); // 设置第一列的宽度为0
//初始化TableWidget 设置列
QStringList headers;
- headers << "序号" << "任务单编号" << "委托方"<< "使用部门" << "要求检完时间" << "送检人"<<"是否加急"<<"操作";
+ headers <<"ID"<< "序号" << "任务单编号" << "委托方"<< "使用部门"
+ << "要求检完时间" << "送检人"<<"是否加急"<<"操作";
ui->tableWidget->setHorizontalHeaderLabels(headers);
//ShowMessageBox("标题","初始化完成");
}
@@ -57,5 +62,171 @@
}
void Create_Task::Load()
{
- //ShowMessageBox("创建任务界面","创建任务界面初始化完成");
+ //先设置为行为0
+ ui->tableWidget->setRowCount(0);
+ ui->stackedWidget->setCurrentIndex(0);
+
+ QList data = BaseCommonApi::getCreateTaskList("");
+
+ int rowCount = 0;
+ int row=0;
+ QString is_urgent;
+ for (const CreateTaskList& item : data) {
+ rowCount = ui->tableWidget->rowCount();
+
+ ui->tableWidget->insertRow(rowCount);
+ ui->tableWidget->setItem(row, 0, new QTableWidgetItem(item.id));
+ ui->tableWidget->setItem(row, 1, new QTableWidgetItem(QString::number(row+1)));
+ ui->tableWidget->setItem(row, 2, new QTableWidgetItem(item.order_no));
+ ui->tableWidget->setItem(row, 3, new QTableWidgetItem(item.customer_name));
+ ui->tableWidget->setItem(row, 4, new QTableWidgetItem(item.DEPT_FULL_NAME));
+ ui->tableWidget->setItem(row, 5, new QTableWidgetItem(item.require_over_time.toString()));
+ ui->tableWidget->setItem(row, 6, new QTableWidgetItem(item.deliverer));
+ if(item.is_urgent=="1")
+ is_urgent="是";
+ else
+ is_urgent="否";
+ ui->tableWidget->setItem(row, 7, new QTableWidgetItem(is_urgent));
+
+ //实现单元格添加两个按钮
+ // 创建一个QWidget作为单元格的容器
+ QWidget *widget = new QWidget();
+ QHBoxLayout *layout = new QHBoxLayout(widget); // 水平布局
+
+
+ QPushButton *button = new QPushButton("查看");
+ QPushButton *button2 = new QPushButton("编辑");
+ QPushButton *button3 = new QPushButton("删除");
+
+ //设置按钮1简单样式
+ button->setStyleSheet("QPushButton {"
+ " border: none; /* 无边框 */"
+ " color: green; /* 文本颜色 */"
+ " text-decoration: underline; /* 文本下划线 */"
+ "}");
+
+ // 设置鼠标悬停时的光标样式为小手图标
+ button->setCursor(Qt::PointingHandCursor);
+ // 连接按钮的 clicked 信号到自定义槽函数
+ connect(button, &QPushButton::clicked, this, [this, button, row]() {
+ // 获取当前行第一列的 ID
+ QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0);
+ if (idItem) {
+ QString id = idItem->text();
+ OnButtonSelectClicked(id);
+ Create_Task::State="Select";
+ }
+
+ });
+ //设置按钮2简单样式
+ button2->setStyleSheet("QPushButton {"
+ " border: none; /* 无边框 */"
+ " color: green; /* 文本颜色 */"
+ " text-decoration: underline; /* 文本下划线 */"
+ "}");
+
+ // 设置鼠标悬停时的光标样式为小手图标
+ button2->setCursor(Qt::PointingHandCursor);
+ // 连接按钮的 clicked 信号到自定义槽函数
+ connect(button2, &QPushButton::clicked, this, [this, button2, row]() {
+ // 获取当前行第一列的 ID
+ QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0);
+ if (idItem) {
+ QString id = idItem->text();
+ OnButtonUpdateClicked(id);
+ Create_Task::State="Update";
+ }
+
+ });
+ //设置按钮3简单样式
+ button3->setStyleSheet("QPushButton {"
+ " border: none; /* 无边框 */"
+ " color: red; /* 文本颜色 */"
+ " text-decoration: underline; /* 文本下划线 */"
+ "}");
+
+ // 设置鼠标悬停时的光标样式为小手图标
+ button3->setCursor(Qt::PointingHandCursor);
+ // 连接按钮的 clicked 信号到自定义槽函数
+ connect(button3, &QPushButton::clicked, this, [this, button3, row]() {
+ // 获取当前行第一列的 ID
+ QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0);
+ if (idItem) {
+ QString id = idItem->text();
+ OnButtoDeleteClicked(id);
+ }
+
+ });
+ //将按钮添加到布局控件
+ layout->addWidget(button);
+ layout->addWidget(button2);
+ layout->addWidget(button3);
+ layout->setContentsMargins(5, 5, 0, 0); // 设置布局边距为0
+ widget->setLayout(layout);
+ //将布局控件添加到 单元格
+ ui->tableWidget->setCellWidget(row, 8, widget);
+ // 调整表格大小以适应内容
+ //ui->tableWidget->resizeColumnsToContents();
+ // ui->tableWidget->resizeRowsToContents();
+ row++;
+ }
+}
+void Create_Task::OnButtonSelectClicked(QString id)
+{
+ // ========================================================================================
+ // 查看按钮 点击事件 进入详情页面
+ // ====================================================================================
+ //DeviceInfoInit(id);
+ HiddenButton();
+ ui->stackedWidget->setCurrentIndex(1);
+ QMessageBox::information(this, "查看按钮ID",id);
+}
+void Create_Task::OnButtonUpdateClicked(QString id)
+{
+ // ========================================================================================
+ // 编辑按钮 点击事件 进入详情页面
+ // ====================================================================================
+ //DeviceInfoInit(id);
+ DisplayButton();
+ ui->stackedWidget->setCurrentIndex(1);
+ QMessageBox::information(this, "编辑按钮ID",id);
+}
+void Create_Task::OnButtoDeleteClicked(QString id)
+{
+ // ========================================================================================
+ // 删除按钮 点击事件 进入详情页面
+ // ====================================================================================
+ //DeviceInfoInit(id);
+ //ui->stackedWidget->setCurrentIndex(1);
+
+ QMessageBox::information(this, "删除按钮ID",id);
+}
+
+void Create_Task::on_pushButton_2_clicked()
+{
+ // ========================================================================================
+ // 创建任务单按钮
+ // ====================================================================================
+ DisplayButton();
+ ui->stackedWidget->setCurrentIndex(1);
+ Create_Task::State="Create";
+}
+void Create_Task::HiddenButton()
+{
+ ui->SaveButton->hide();
+ ui->CreateButton->hide();
+ ui->ScanButton->hide();
+ ui->deletebutton->hide();
+}
+void Create_Task::DisplayButton()
+{
+ ui->SaveButton->show();
+ ui->CreateButton->show();
+ ui->ScanButton->show();
+ ui->deletebutton->show();
+}
+
+void Create_Task::on_pushButton_clicked()
+{
+ ui->stackedWidget->setCurrentIndex(0);
}
diff --git a/softwareDirectory/AutoVerScheme/depar_task.cpp b/softwareDirectory/AutoVerScheme/depar_task.cpp
index d442b65..13b1855 100644
--- a/softwareDirectory/AutoVerScheme/depar_task.cpp
+++ b/softwareDirectory/AutoVerScheme/depar_task.cpp
@@ -79,8 +79,8 @@
// 调用数据库管理器的函数获取数据
//QList data = dbManager.getAllData();
//模拟用户ID
- QString userId="1640229293790650370";
- QList data = BaseCommonApi::getAllData(userId);
+ QString deptId="1601423748184150017";
+ QList data = BaseCommonApi::getAllData(deptId,"3");
int rowCount = 0;
int row=0;
diff --git a/softwareDirectory/AutoVerScheme/my_task.cpp b/softwareDirectory/AutoVerScheme/my_task.cpp
index fb72684..bae72d0 100644
--- a/softwareDirectory/AutoVerScheme/my_task.cpp
+++ b/softwareDirectory/AutoVerScheme/my_task.cpp
@@ -69,8 +69,8 @@
// 调用数据库管理器的函数获取数据
//模拟用户ID
- QString userId="1640229293790650370";
- QList data = BaseCommonApi::getMyTasks(userId);
+ QString userId="1695282436182188034";
+ QList data = BaseCommonApi::getMyTasks(userId,"3");
int rowCount = 0;
int row=0;