Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
Laisi_AutoMES2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
jiawei.su
Laisi_AutoMES2
Commits
24f43658
Commit
24f43658
authored
Jan 22, 2021
by
xin.yang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
some update
parent
6d235900
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
51 deletions
+21
-51
ManualCollectionController.cs
...is/Siger.ApiQMS/Controllers/ManualCollectionController.cs
+13
-29
SendTestCollectionController.cs
.../Siger.ApiQMS/Controllers/SendTestCollectionController.cs
+8
-22
No files found.
Server/Apis/Siger.ApiQMS/Controllers/ManualCollectionController.cs
View file @
24f43658
...
@@ -165,21 +165,7 @@ namespace Siger.ApiQMS.Controllers
...
@@ -165,21 +165,7 @@ namespace Siger.ApiQMS.Controllers
traceResult
=
"NG"
;
traceResult
=
"NG"
;
}
}
}
}
//插入大数据库的trace表
var
trace
=
new
SnTrace
{
MaterialID
=
req
.
materialid
.
ToInt
(),
ProductID
=
req
.
productid
,
SectionID
=
req
.
sectionid
,
MachineID
=
machine
?.
id
??
0
,
WorkOrder
=
req
.
workorder
??
""
,
SN
=
req
.
sn
??
""
,
Result
=
traceResult
,
UserID
=
UserId
,
RouteID
=
req
.
routeid
.
ToInt
(),
CreateTime
=
DateTime
.
Now
,
CheckType
=
req
.
checktype
};
var
insertDetailList
=
new
List
<
SnTraceDetailList
>();
var
insertDetailList
=
new
List
<
SnTraceDetailList
>();
foreach
(
var
index
in
indexs
)
foreach
(
var
index
in
indexs
)
{
{
...
@@ -265,6 +251,7 @@ namespace Siger.ApiQMS.Controllers
...
@@ -265,6 +251,7 @@ namespace Siger.ApiQMS.Controllers
{
{
req
.
result
=
((
int
)
SendTestType
.
Unqualified
).
ToString
();
req
.
result
=
((
int
)
SendTestType
.
Unqualified
).
ToString
();
}
}
var
nowTime
=
DateTime
.
Now
;
//插入中间层库的trace表
//插入中间层库的trace表
var
inspection
=
new
siger_check_sn_trace_inspection
var
inspection
=
new
siger_check_sn_trace_inspection
{
{
...
@@ -279,9 +266,9 @@ namespace Siger.ApiQMS.Controllers
...
@@ -279,9 +266,9 @@ namespace Siger.ApiQMS.Controllers
check_status
=
(
int
)
SendCheckStatus
.
Completed
,
check_status
=
(
int
)
SendCheckStatus
.
Completed
,
result
=
req
.
result
,
result
=
req
.
result
,
send_mid
=
UserId
,
send_mid
=
UserId
,
send_time
=
trace
.
Create
Time
,
send_time
=
now
Time
,
check_mid
=
UserId
,
check_mid
=
UserId
,
check_time
=
trace
.
Create
Time
,
check_time
=
now
Time
,
inspection_type
=
(
int
)
InspectionType
.
ManualCollection
,
inspection_type
=
(
int
)
InspectionType
.
ManualCollection
,
projectid
=
ProjectId
,
projectid
=
ProjectId
,
reason
=
req
.
reason
??
""
,
reason
=
req
.
reason
??
""
,
...
@@ -305,7 +292,7 @@ namespace Siger.ApiQMS.Controllers
...
@@ -305,7 +292,7 @@ namespace Siger.ApiQMS.Controllers
LowerLimit
=
detail
.
LowerLimit
,
LowerLimit
=
detail
.
LowerLimit
,
UpperLimit
=
detail
.
UpperLimit
,
UpperLimit
=
detail
.
UpperLimit
,
projectid
=
ProjectId
,
projectid
=
ProjectId
,
CreateTime
=
trace
.
Create
Time
CreateTime
=
now
Time
};
};
_traceDetailRepository
.
Insert
(
model
);
_traceDetailRepository
.
Insert
(
model
);
}
}
...
@@ -314,7 +301,7 @@ namespace Siger.ApiQMS.Controllers
...
@@ -314,7 +301,7 @@ namespace Siger.ApiQMS.Controllers
{
{
try
try
{
{
AddSnList
(
req
.
materialid
.
ToInt
(),
trace
,
product
.
code
,
section
.
parentid
);
//把二维码插入到 sn_list表
AddSnList
(
req
.
materialid
.
ToInt
(),
inspection
,
product
.
code
,
section
.
parentid
);
//把二维码插入到 sn_list表
var
abnormalCheckHelper
=
new
AbnormalCheckHelper
(
_unitOfWork
,
_abnormalRuleRepository
,
_projectUserRepository
,
var
abnormalCheckHelper
=
new
AbnormalCheckHelper
(
_unitOfWork
,
_abnormalRuleRepository
,
_projectUserRepository
,
_traceDetailRepository
,
_inspectStandard
,
_traceInspectionRepository
,
_sigerDict
,
CompanyId
,
ProjectId
,
UserId
);
_traceDetailRepository
,
_inspectStandard
,
_traceInspectionRepository
,
_sigerDict
,
CompanyId
,
ProjectId
,
UserId
);
...
@@ -764,12 +751,9 @@ namespace Siger.ApiQMS.Controllers
...
@@ -764,12 +751,9 @@ namespace Siger.ApiQMS.Controllers
req
.
result
=
((
int
)
SendTestType
.
Unqualified
).
ToString
();
req
.
result
=
((
int
)
SendTestType
.
Unqualified
).
ToString
();
}
}
else
{
inspection
.
result
=
req
.
result
;
inspection
.
result
=
req
.
result
;
inspection
.
quantity
=
req
.
quantity
.
ToInt
();
inspection
.
quantity
=
req
.
quantity
.
ToInt
();
_traceInspectionRepository
.
Update
(
inspection
);
_traceInspectionRepository
.
Update
(
inspection
);
}
foreach
(
var
delDetail
in
delTraceDetails
)
foreach
(
var
delDetail
in
delTraceDetails
)
{
{
...
@@ -808,18 +792,18 @@ namespace Siger.ApiQMS.Controllers
...
@@ -808,18 +792,18 @@ namespace Siger.ApiQMS.Controllers
#
endregion
#
endregion
}
}
private
void
AddSnList
(
int
materialid
,
SnTrace
trace
,
string
code
,
int
lineId
)
private
void
AddSnList
(
int
materialid
,
siger_check_sn_trace_inspection
trace
,
string
code
,
int
lineId
)
{
{
var
snEntity
=
_snListRepository
.
Get
(
t
=>
t
.
projectid
==
ProjectId
&&
t
.
status
==
(
int
)
RowState
.
Valid
&&
var
snEntity
=
_snListRepository
.
Get
(
t
=>
t
.
projectid
==
ProjectId
&&
t
.
status
==
(
int
)
RowState
.
Valid
&&
t
.
SN
==
trace
.
SN
&&
!
string
.
IsNullOrWhiteSpace
(
trace
.
SN
));
t
.
SN
==
trace
.
sn
&&
!
string
.
IsNullOrWhiteSpace
(
trace
.
sn
));
if
(
snEntity
==
null
)
if
(
snEntity
==
null
)
{
{
var
stateCode
=
"000"
;
var
stateCode
=
"000"
;
var
eventNoObj
=
_snListRepository
.
GetEventNoByResult
(
trace
.
SN
,
ProjectId
);
var
eventNoObj
=
_snListRepository
.
GetEventNoByResult
(
trace
.
sn
,
ProjectId
);
if
(
eventNoObj
!=
null
)
if
(
eventNoObj
!=
null
)
{
{
//出站信息获取
//出站信息获取
var
outObj
=
_snListRepository
.
GetOutStationByEventNo
(
eventNoObj
.
EventNo
,
trace
.
SectionID
,
ProjectId
);
var
outObj
=
_snListRepository
.
GetOutStationByEventNo
(
eventNoObj
.
EventNo
,
trace
.
sectionid
,
ProjectId
);
if
(
outObj
!=
null
)
if
(
outObj
!=
null
)
{
{
stateCode
=
outObj
.
ResultStatus
;
stateCode
=
outObj
.
ResultStatus
;
...
@@ -829,12 +813,12 @@ namespace Siger.ApiQMS.Controllers
...
@@ -829,12 +813,12 @@ namespace Siger.ApiQMS.Controllers
t
.
id
==
materialid
);
t
.
id
==
materialid
);
var
snListObj
=
new
siger_check_sn_list
var
snListObj
=
new
siger_check_sn_list
{
{
SN
=
trace
.
SN
,
SN
=
trace
.
sn
,
BatchNumber
=
""
,
BatchNumber
=
""
,
ProductID
=
trace
.
ProductID
,
ProductID
=
trace
.
productid
,
ProductCode
=
code
,
ProductCode
=
code
,
LineID
=
lineId
,
LineID
=
lineId
,
WorkOrder
=
trace
.
WorkO
rder
,
WorkOrder
=
trace
.
worko
rder
,
MaterialID
=
material
?.
id
??
0
,
MaterialID
=
material
?.
id
??
0
,
PartNumber
=
material
?.
pn
??
""
,
PartNumber
=
material
?.
pn
??
""
,
StateCode
=
stateCode
,
StateCode
=
stateCode
,
...
...
Server/Apis/Siger.ApiQMS/Controllers/SendTestCollectionController.cs
View file @
24f43658
...
@@ -342,20 +342,6 @@ namespace Siger.ApiQMS.Controllers
...
@@ -342,20 +342,6 @@ namespace Siger.ApiQMS.Controllers
var
machine
=
_inspectStandard
.
GetMachineBySectionId
(
sendTest
.
sectionid
,
ProjectId
);
var
machine
=
_inspectStandard
.
GetMachineBySectionId
(
sendTest
.
sectionid
,
ProjectId
);
var
trace
=
new
SnTrace
{
MaterialID
=
sendTest
.
materialid
,
ProductID
=
sendTest
.
productid
,
SectionID
=
sendTest
.
sectionid
,
MachineID
=
machine
?.
id
??
0
,
WorkOrder
=
""
,
SN
=
sendTest
.
sn
??
""
,
Result
=
(
result
==
(
int
)
SendTestType
.
Qalified
||
result
==
(
int
)
SendTestType
.
DeviationRelease
)
?
"OK"
:
"NG"
,
UserID
=
UserId
,
RouteID
=
sendTest
.
routeid
,
CreateTime
=
DateTime
.
Now
,
CheckType
=
sendTest
.
check_type
};
var
insertDetailList
=
new
List
<
SnTraceDetailList
>();
var
insertDetailList
=
new
List
<
SnTraceDetailList
>();
foreach
(
var
index
in
indexs
)
foreach
(
var
index
in
indexs
)
{
{
...
@@ -490,7 +476,7 @@ namespace Siger.ApiQMS.Controllers
...
@@ -490,7 +476,7 @@ namespace Siger.ApiQMS.Controllers
{
{
try
try
{
{
AddSnList
(
sendTest
,
trace
);
AddSnList
(
sendTest
);
var
abnormalCheckHelper
=
new
AbnormalCheckHelper
(
_unitOfWork
,
_abnormalRuleRepository
,
_projectUserRepository
,
var
abnormalCheckHelper
=
new
AbnormalCheckHelper
(
_unitOfWork
,
_abnormalRuleRepository
,
_projectUserRepository
,
_traceDetailRepository
,
_inspectStandard
,
_traceInspectionRepository
,
_sigerDict
,
CompanyId
,
ProjectId
,
UserId
);
_traceDetailRepository
,
_inspectStandard
,
_traceInspectionRepository
,
_sigerDict
,
CompanyId
,
ProjectId
,
UserId
);
...
@@ -1035,16 +1021,16 @@ namespace Siger.ApiQMS.Controllers
...
@@ -1035,16 +1021,16 @@ namespace Siger.ApiQMS.Controllers
return
new
ObjectResult
(
CommonEnum
.
Succefull
);
return
new
ObjectResult
(
CommonEnum
.
Succefull
);
}
}
private
void
AddSnList
(
siger_check_sn_trace_inspection
sendTest
,
SnTrace
trace
)
private
void
AddSnList
(
siger_check_sn_trace_inspection
sendTest
)
{
{
var
snEntity
=
_snListRepository
.
Get
(
t
=>
t
.
projectid
==
ProjectId
&&
t
.
status
==
(
int
)
RowState
.
Valid
&&
var
snEntity
=
_snListRepository
.
Get
(
t
=>
t
.
projectid
==
ProjectId
&&
t
.
status
==
(
int
)
RowState
.
Valid
&&
t
.
SN
==
trace
.
SN
&&
!
string
.
IsNullOrWhiteSpace
(
trace
.
SN
));
t
.
SN
==
sendTest
.
sn
&&
!
string
.
IsNullOrWhiteSpace
(
sendTest
.
sn
));
var
stateCode
=
"000"
;
var
stateCode
=
"000"
;
var
eventNoObj
=
_snListRepository
.
GetEventNoByResult
(
trace
.
SN
,
ProjectId
);
var
eventNoObj
=
_snListRepository
.
GetEventNoByResult
(
sendTest
.
sn
,
ProjectId
);
if
(
eventNoObj
!=
null
)
if
(
eventNoObj
!=
null
)
{
{
//出站信息获取
//出站信息获取
var
outObj
=
_snListRepository
.
GetOutStationByEventNo
(
eventNoObj
.
EventNo
,
trace
.
SectionID
,
ProjectId
);
var
outObj
=
_snListRepository
.
GetOutStationByEventNo
(
eventNoObj
.
EventNo
,
sendTest
.
sectionid
,
ProjectId
);
if
(
outObj
!=
null
)
if
(
outObj
!=
null
)
{
{
stateCode
=
outObj
.
ResultStatus
;
stateCode
=
outObj
.
ResultStatus
;
...
@@ -1062,12 +1048,12 @@ namespace Siger.ApiQMS.Controllers
...
@@ -1062,12 +1048,12 @@ namespace Siger.ApiQMS.Controllers
{
{
var
snListObj
=
new
siger_check_sn_list
var
snListObj
=
new
siger_check_sn_list
{
{
SN
=
trace
.
SN
??
""
,
SN
=
sendTest
.
sn
??
""
,
BatchNumber
=
""
,
BatchNumber
=
""
,
ProductID
=
trace
.
ProductID
,
ProductID
=
sendTest
.
productid
,
ProductCode
=
product
.
code
,
ProductCode
=
product
.
code
,
LineID
=
section
.
parentid
,
LineID
=
section
.
parentid
,
WorkOrder
=
trace
.
WorkO
rder
,
WorkOrder
=
sendTest
.
worko
rder
,
MaterialID
=
material
?.
id
??
0
,
MaterialID
=
material
?.
id
??
0
,
PartNumber
=
material
?.
pn
??
""
,
PartNumber
=
material
?.
pn
??
""
,
StateCode
=
stateCode
,
StateCode
=
stateCode
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment