Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
T
topsun-bpm
Project
Project
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
鲁鑫
topsun-bpm
Commits
07af99f6
Commit
07af99f6
authored
Nov 29, 2023
by
覃振观
👶
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
111
parent
4136e703
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
6 deletions
+5
-6
ProductApplicationImpl.java
...psun/product/application/impl/ProductApplicationImpl.java
+5
-6
No files found.
topsun/src/main/java/com/huigou/topsun/product/application/impl/ProductApplicationImpl.java
View file @
07af99f6
package
com
.
huigou
.
topsun
.
product
.
application
.
impl
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.huigou.topsun.config.JPAUtils
;
import
com.huigou.topsun.product.application.BrandApplication
;
import
com.huigou.topsun.product.application.ProductApplication
;
import
com.huigou.topsun.product.domain.*
;
...
...
@@ -12,7 +11,6 @@ import org.springframework.data.domain.Page;
import
org.springframework.data.domain.PageRequest
;
import
org.springframework.stereotype.Service
;
import
javax.persistence.EntityManager
;
import
java.lang.reflect.Field
;
import
java.lang.reflect.InvocationTargetException
;
import
java.lang.reflect.Method
;
...
...
@@ -67,8 +65,10 @@ public class ProductApplicationImpl implements ProductApplication {
Map
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
ProductDetail
productDetail
=
detailRepository
.
findByProductIdEquals
((
long
)
productId
);
resultMap
.
put
(
"detai"
,
productDetail
);
EntityManager
manager
=
JPAUtils
.
getEntityManger
();
manager
.
getTransaction
().
begin
();
// EntityManager manager = JPAUtils.getEntityManger();
// manager.getTransaction().begin();
// manager.flush();
// manager.close();
// --------------------------------- 类别查询 ---------------------------------
ArrayList
<
Brand
>
brands
=
(
ArrayList
<
Brand
>)
brandRepository
.
findAll
();
...
...
@@ -105,8 +105,7 @@ public class ProductApplicationImpl implements ProductApplication {
}
}
manager
.
flush
();
manager
.
close
();
Map
<
Object
,
Object
>
selectedBrand
=
convertToMap
(
Brand
.
class
,
"brandName"
,
brands
);
Map
<
Object
,
Object
>
selectedFactory
=
convertToMap
(
Factory
.
class
,
"factoryName"
,
factorys
);
Map
<
Object
,
Object
>
selectedColor
=
convertToMap
(
Color
.
class
,
"colorId"
,
colors
);
...
...
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