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
8163778c
Commit
8163778c
authored
Dec 09, 2023
by
覃振观
👶
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
23-12-9: 产品模块实体调整。
parent
b868d9de
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
608 additions
and
467 deletions
+608
-467
ProductApplicationImpl.java
...psun/product/application/impl/ProductApplicationImpl.java
+3
-2
Product.java
...c/main/java/com/huigou/topsun/product/domain/Product.java
+0
-122
ProductDetail.java
.../java/com/huigou/topsun/product/domain/ProductDetail.java
+267
-121
ProductLooked.java
.../java/com/huigou/topsun/product/domain/ProductLooked.java
+337
-221
ProductDetailRepository.java
...ou/topsun/product/repository/ProductDetailRepository.java
+1
-1
No files found.
topsun/src/main/java/com/huigou/topsun/product/application/impl/ProductApplicationImpl.java
View file @
8163778c
...
@@ -65,7 +65,8 @@ public class ProductApplicationImpl implements ProductApplication {
...
@@ -65,7 +65,8 @@ public class ProductApplicationImpl implements ProductApplication {
@Override
@Override
public
Map
<
String
,
Object
>
queryDetailAll
(
int
productId
)
{
public
Map
<
String
,
Object
>
queryDetailAll
(
int
productId
)
{
Map
<
String
,
Object
>
resultMap
=
new
HashMap
<>(
200
);
Map
<
String
,
Object
>
resultMap
=
new
HashMap
<>(
200
);
ProductDetail
productDetail
=
detailRepository
.
findByProductIdEquals
((
long
)
productId
);
String
strProductId
=
Long
.
toString
(
productId
);
ProductDetail
productDetail
=
detailRepository
.
findByProductId
(
strProductId
);
// EntityManager manager = JPAUtils.getEntityManger();
// EntityManager manager = JPAUtils.getEntityManger();
// manager.getTransaction().begin();
// manager.getTransaction().begin();
// manager.flush();
// manager.flush();
...
@@ -78,7 +79,7 @@ public class ProductApplicationImpl implements ProductApplication {
...
@@ -78,7 +79,7 @@ public class ProductApplicationImpl implements ProductApplication {
ArrayList
<
ProductCategory
>
categorys
=
(
ArrayList
<
ProductCategory
>)
categoryRepository
.
findAll
();
ArrayList
<
ProductCategory
>
categorys
=
(
ArrayList
<
ProductCategory
>)
categoryRepository
.
findAll
();
// --------------------------------- 详情查询 ---------------------------------
// --------------------------------- 详情查询 ---------------------------------
String
strProductId
=
Long
.
toString
(
productId
);
ArrayList
<
ProductMaterial
>
material
=
(
ArrayList
<
ProductMaterial
>)
materialRepository
.
findByProductId
(
strProductId
);
ArrayList
<
ProductMaterial
>
material
=
(
ArrayList
<
ProductMaterial
>)
materialRepository
.
findByProductId
(
strProductId
);
ArrayList
<
ProductLoss
>
loss
=
(
ArrayList
<
ProductLoss
>)
lossRepository
.
findByProductId
(
strProductId
);
ArrayList
<
ProductLoss
>
loss
=
(
ArrayList
<
ProductLoss
>)
lossRepository
.
findByProductId
(
strProductId
);
Set
<
Object
>
entitys
=
new
HashSet
<>();
Set
<
Object
>
entitys
=
new
HashSet
<>();
...
...
topsun/src/main/java/com/huigou/topsun/product/domain/Product.java
deleted
100644 → 0
View file @
b868d9de
package
com
.
huigou
.
topsun
.
product
.
domain
;
import
java.io.Serializable
;
import
javax.persistence.*
;
import
lombok.Data
;
/**
* 产品
* @TableName product
*/
@Table
(
name
=
"product"
)
@Data
@Entity
public
class
Product
implements
Serializable
{
/**
* 产品ID
*/
@Id
@Column
(
name
=
"product_id"
)
private
String
productId
;
/**
* 产品名称
*/
@Column
(
name
=
"product_name"
)
private
String
productName
;
/**
* 产品类别
*/
@Column
(
name
=
"product_category_id"
)
private
String
productCategoryId
;
/**
* 产品状态(码表status)
*/
@Column
(
name
=
"product_status"
)
private
String
productStatus
;
/**
* 产品计量单位
*/
@Column
(
name
=
"product_unit"
)
private
String
productUnit
;
/**
* 样品编号
*/
@Column
(
name
=
"product_sample_code"
)
private
String
productSampleCode
;
/**
* 品牌名称
*/
@Column
(
name
=
"brand_name"
)
private
String
brandName
;
/**
* 产品类型(product_type)
*/
@Column
(
name
=
"product_type"
)
private
String
productType
;
private
static
final
long
serialVersionUID
=
1L
;
@Override
public
boolean
equals
(
Object
that
)
{
if
(
this
==
that
)
{
return
true
;
}
if
(
that
==
null
)
{
return
false
;
}
if
(
getClass
()
!=
that
.
getClass
())
{
return
false
;
}
Product
other
=
(
Product
)
that
;
return
(
this
.
getProductId
()
==
null
?
other
.
getProductId
()
==
null
:
this
.
getProductId
().
equals
(
other
.
getProductId
()))
&&
(
this
.
getProductName
()
==
null
?
other
.
getProductName
()
==
null
:
this
.
getProductName
().
equals
(
other
.
getProductName
()))
&&
(
this
.
getProductCategoryId
()
==
null
?
other
.
getProductCategoryId
()
==
null
:
this
.
getProductCategoryId
().
equals
(
other
.
getProductCategoryId
()))
&&
(
this
.
getProductStatus
()
==
null
?
other
.
getProductStatus
()
==
null
:
this
.
getProductStatus
().
equals
(
other
.
getProductStatus
()))
&&
(
this
.
getProductUnit
()
==
null
?
other
.
getProductUnit
()
==
null
:
this
.
getProductUnit
().
equals
(
other
.
getProductUnit
()))
&&
(
this
.
getProductSampleCode
()
==
null
?
other
.
getProductSampleCode
()
==
null
:
this
.
getProductSampleCode
().
equals
(
other
.
getProductSampleCode
()))
&&
(
this
.
getBrandName
()
==
null
?
other
.
getBrandName
()
==
null
:
this
.
getBrandName
().
equals
(
other
.
getBrandName
()))
&&
(
this
.
getProductType
()
==
null
?
other
.
getProductType
()
==
null
:
this
.
getProductType
().
equals
(
other
.
getProductType
()));
}
@Override
public
int
hashCode
()
{
final
int
prime
=
31
;
int
result
=
1
;
result
=
prime
*
result
+
((
getProductId
()
==
null
)
?
0
:
getProductId
().
hashCode
());
result
=
prime
*
result
+
((
getProductName
()
==
null
)
?
0
:
getProductName
().
hashCode
());
result
=
prime
*
result
+
((
getProductCategoryId
()
==
null
)
?
0
:
getProductCategoryId
().
hashCode
());
result
=
prime
*
result
+
((
getProductStatus
()
==
null
)
?
0
:
getProductStatus
().
hashCode
());
result
=
prime
*
result
+
((
getProductUnit
()
==
null
)
?
0
:
getProductUnit
().
hashCode
());
result
=
prime
*
result
+
((
getProductSampleCode
()
==
null
)
?
0
:
getProductSampleCode
().
hashCode
());
result
=
prime
*
result
+
((
getBrandName
()
==
null
)
?
0
:
getBrandName
().
hashCode
());
result
=
prime
*
result
+
((
getProductType
()
==
null
)
?
0
:
getProductType
().
hashCode
());
return
result
;
}
@Override
public
String
toString
()
{
StringBuilder
sb
=
new
StringBuilder
();
sb
.
append
(
getClass
().
getSimpleName
());
sb
.
append
(
" ["
);
sb
.
append
(
"Hash = "
).
append
(
hashCode
());
sb
.
append
(
", productId="
).
append
(
productId
);
sb
.
append
(
", productName="
).
append
(
productName
);
sb
.
append
(
", productCategoryId="
).
append
(
productCategoryId
);
sb
.
append
(
", productStatus="
).
append
(
productStatus
);
sb
.
append
(
", productUnit="
).
append
(
productUnit
);
sb
.
append
(
", productSampleCode="
).
append
(
productSampleCode
);
sb
.
append
(
", brandName="
).
append
(
brandName
);
sb
.
append
(
", productType="
).
append
(
productType
);
sb
.
append
(
", serialVersionUID="
).
append
(
serialVersionUID
);
sb
.
append
(
"]"
);
return
sb
.
toString
();
}
}
\ No newline at end of file
topsun/src/main/java/com/huigou/topsun/product/domain/ProductDetail.java
View file @
8163778c
This diff is collapsed.
Click to expand it.
topsun/src/main/java/com/huigou/topsun/product/domain/ProductLooked.java
View file @
8163778c
This diff is collapsed.
Click to expand it.
topsun/src/main/java/com/huigou/topsun/product/repository/ProductDetailRepository.java
View file @
8163778c
...
@@ -9,5 +9,5 @@ import org.springframework.data.jpa.repository.JpaRepository;
...
@@ -9,5 +9,5 @@ import org.springframework.data.jpa.repository.JpaRepository;
* @Description:
* @Description:
*/
*/
public
interface
ProductDetailRepository
extends
JpaRepository
<
ProductDetail
,
String
>
{
public
interface
ProductDetailRepository
extends
JpaRepository
<
ProductDetail
,
String
>
{
ProductDetail
findByProductId
Equals
(
Lo
ng
productId
);
ProductDetail
findByProductId
(
Stri
ng
productId
);
}
}
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