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
47e5b923
Commit
47e5b923
authored
Jan 23, 2021
by
xin.yang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bug
parent
1452a0d0
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
47 additions
and
8 deletions
+47
-8
FixtureToolsAssemblyController.cs
...iger.ApiACC/Controllers/FixtureToolsAssemblyController.cs
+47
-8
No files found.
Server/Apis/Siger.ApiACC/Controllers/FixtureToolsAssemblyController.cs
View file @
47e5b923
...
@@ -78,30 +78,49 @@ namespace Siger.ApiACC.Controllers
...
@@ -78,30 +78,49 @@ namespace Siger.ApiACC.Controllers
{
{
throw
new
BadRequestException
(
RequestEnum
.
ParameterMiss
);
throw
new
BadRequestException
(
RequestEnum
.
ParameterMiss
);
}
}
if
(!
string
.
IsNullOrEmpty
(
req
.
parentid
)
&&
!
string
.
IsNullOrEmpty
(
req
.
fixturetoolid
)
&&
if
(
req
.
parentid
==
req
.
fixturetoolid
)
req
.
parentid
==
req
.
fixturetoolid
)
{
{
throw
new
BadRequestException
(
RequestEnum
.
ParentSonSame
);
throw
new
BadRequestException
(
RequestEnum
.
ParentSonSame
);
}
}
var
parent
=
_toolsRepository
.
Get
(
q
=>
q
.
id
==
req
.
parentid
.
ToInt
()
&&
q
.
projectId
==
ProjectId
);
var
parent
=
_toolsRepository
.
Get
(
q
=>
q
.
id
==
req
.
parentid
.
ToInt
()
&&
q
.
projectId
==
ProjectId
);
if
(
parent
==
null
)
{
throw
new
BadRequestException
(
RequestEnum
.
FixtureToolNotFound
);
}
var
son
=
_toolsRepository
.
Get
(
q
=>
q
.
id
==
req
.
fixturetoolid
.
ToInt
()
&&
q
.
projectId
==
ProjectId
);
var
son
=
_toolsRepository
.
Get
(
q
=>
q
.
id
==
req
.
fixturetoolid
.
ToInt
()
&&
q
.
projectId
==
ProjectId
);
if
(
son
==
null
)
if
(
son
==
null
)
{
{
throw
new
BadRequestException
(
RequestEnum
.
FixtureToolNotFound
);
throw
new
BadRequestException
(
RequestEnum
.
FixtureToolNotFound
);
}
}
var
parentGuid
=
parent
?.
guid
??
""
;
var
parentGuid
=
parent
.
guid
;
var
exsit
=
_toolsAssemblyRepository
.
Get
(
q
=>
q
.
projectId
==
ProjectId
&&
q
.
son
==
son
.
guid
&&
q
.
parent
==
parentGuid
);
var
exsit
=
_toolsAssemblyRepository
.
Get
(
q
=>
q
.
projectId
==
ProjectId
&&
q
.
son
==
son
.
guid
&&
q
.
parent
==
parentGuid
);
if
(
exsit
!=
null
)
if
(
exsit
!=
null
)
{
{
throw
new
BadRequestException
(
RequestEnum
.
DataExist
);
throw
new
BadRequestException
(
RequestEnum
.
DataExist
);
}
}
if
(!
string
.
IsNullOrEmpty
(
parentGuid
))
{
var
parentExsit
=
_toolsAssemblyRepository
.
Get
(
q
=>
q
.
projectId
==
ProjectId
&&
q
.
son
==
parentGuid
);
var
parentExsit
=
_toolsAssemblyRepository
.
Get
(
q
=>
q
.
projectId
==
ProjectId
&&
q
.
son
==
parentGuid
);
if
(
parentExsit
!=
null
)
if
(
parentExsit
!=
null
)
{
{
throw
new
BadRequestException
(
RequestEnum
.
LevelCountError
);
throw
new
BadRequestException
(
RequestEnum
.
LevelCountError
);
}
}
if
(
_toolsAssemblyRepository
.
Get
(
q
=>
q
.
projectId
==
ProjectId
&&
q
.
son
==
parentGuid
)
==
null
)
{
var
parentEntity
=
new
siger_automation_fixture_tools_assembly
{
guid
=
Guid
.
NewGuid
().
ToString
(),
parent
=
""
,
son
=
parent
.
guid
,
creator
=
UserId
,
createtime
=
DateTime
.
Now
,
attachment
=
req
.
fileurl
,
filename
=
req
.
filename
,
projectId
=
ProjectId
,
updatetime
=
DateTime
.
Now
,
updator
=
UserId
,
status
=
req
.
status
.
ToInt
()
==
(
int
)
RowState
.
Valid
?
(
int
)
RowState
.
Valid
:
(
int
)
RowState
.
Invalid
,
};
_toolsAssemblyRepository
.
Insert
(
parentEntity
);
}
}
var
entity
=
new
siger_automation_fixture_tools_assembly
var
entity
=
new
siger_automation_fixture_tools_assembly
...
@@ -147,25 +166,45 @@ namespace Siger.ApiACC.Controllers
...
@@ -147,25 +166,45 @@ namespace Siger.ApiACC.Controllers
throw
new
BadRequestException
(
CommonEnum
.
RecordNotFound
);
throw
new
BadRequestException
(
CommonEnum
.
RecordNotFound
);
}
}
var
parent
=
_toolsRepository
.
Get
(
q
=>
q
.
id
==
req
.
parentid
.
ToInt
()
&&
q
.
projectId
==
ProjectId
);
var
parent
=
_toolsRepository
.
Get
(
q
=>
q
.
id
==
req
.
parentid
.
ToInt
()
&&
q
.
projectId
==
ProjectId
);
if
(
parent
==
null
)
{
throw
new
BadRequestException
(
RequestEnum
.
FixtureToolNotFound
);
}
var
son
=
_toolsRepository
.
Get
(
q
=>
q
.
id
==
req
.
fixturetoolid
.
ToInt
()
&&
q
.
projectId
==
ProjectId
);
var
son
=
_toolsRepository
.
Get
(
q
=>
q
.
id
==
req
.
fixturetoolid
.
ToInt
()
&&
q
.
projectId
==
ProjectId
);
if
(
son
==
null
)
if
(
son
==
null
)
{
{
throw
new
BadRequestException
(
RequestEnum
.
FixtureToolNotFound
);
throw
new
BadRequestException
(
RequestEnum
.
FixtureToolNotFound
);
}
}
var
parentGuid
=
parent
?.
guid
??
""
;
var
parentGuid
=
parent
.
guid
;
var
exsit
=
_toolsAssemblyRepository
.
Get
(
q
=>
q
.
projectId
==
ProjectId
&&
q
.
son
==
son
.
guid
&&
q
.
parent
==
parentGuid
&&
var
exsit
=
_toolsAssemblyRepository
.
Get
(
q
=>
q
.
projectId
==
ProjectId
&&
q
.
son
==
son
.
guid
&&
q
.
parent
==
parentGuid
&&
q
.
id
!=
req
.
id
);
q
.
id
!=
req
.
id
);
if
(
exsit
!=
null
)
if
(
exsit
!=
null
)
{
{
throw
new
BadRequestException
(
RequestEnum
.
DataExist
);
throw
new
BadRequestException
(
RequestEnum
.
DataExist
);
}
}
if
(!
string
.
IsNullOrEmpty
(
parentGuid
))
{
var
parentExsit
=
_toolsAssemblyRepository
.
Get
(
q
=>
q
.
projectId
==
ProjectId
&&
q
.
son
==
parentGuid
);
var
parentExsit
=
_toolsAssemblyRepository
.
Get
(
q
=>
q
.
projectId
==
ProjectId
&&
q
.
son
==
parentGuid
);
if
(
parentExsit
!=
null
)
if
(
parentExsit
!=
null
)
{
{
throw
new
BadRequestException
(
RequestEnum
.
LevelCountError
);
throw
new
BadRequestException
(
RequestEnum
.
LevelCountError
);
}
}
if
(
_toolsAssemblyRepository
.
Get
(
q
=>
q
.
projectId
==
ProjectId
&&
q
.
son
==
parentGuid
)
==
null
)
{
var
parentEntity
=
new
siger_automation_fixture_tools_assembly
{
guid
=
Guid
.
NewGuid
().
ToString
(),
parent
=
""
,
son
=
parent
.
guid
,
creator
=
UserId
,
createtime
=
DateTime
.
Now
,
attachment
=
req
.
fileurl
,
filename
=
req
.
filename
,
projectId
=
ProjectId
,
updatetime
=
DateTime
.
Now
,
updator
=
UserId
,
status
=
req
.
status
.
ToInt
()
==
(
int
)
RowState
.
Valid
?
(
int
)
RowState
.
Valid
:
(
int
)
RowState
.
Invalid
,
};
_toolsAssemblyRepository
.
Insert
(
parentEntity
);
}
}
entity
.
parent
=
parent
?.
guid
??
""
;
entity
.
parent
=
parent
?.
guid
??
""
;
...
...
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