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
0c18246f
Commit
0c18246f
authored
Dec 02, 2023
by
覃振观
👶
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
23-12-2
parent
7468be85
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
90 additions
and
49 deletions
+90
-49
product.js
topsun-xt/src/main/webapp/biz/topsun/product/product.js
+0
-2
productDetail.js
...un-xt/src/main/webapp/biz/topsun/product/productDetail.js
+36
-0
productDetail.jsp
...n-xt/src/main/webapp/biz/topsun/product/productDetail.jsp
+15
-15
ProductApplicationImpl.java
...psun/product/application/impl/ProductApplicationImpl.java
+16
-12
ProductController.java
...m/huigou/topsun/product/controller/ProductController.java
+17
-16
ProductLossRepository.java
...igou/topsun/product/repository/ProductLossRepository.java
+1
-1
ProductMaterialRepository.java
.../topsun/product/repository/ProductMaterialRepository.java
+3
-1
ProductPublishedConfRepository.java
...un/product/repository/ProductPublishedConfRepository.java
+1
-1
ProductTypesetConfRepository.java
...psun/product/repository/ProductTypesetConfRepository.java
+1
-1
No files found.
topsun-xt/src/main/webapp/biz/topsun/product/product.js
View file @
0c18246f
var
gridManager
=
null
;
$
(
document
).
ready
(
function
()
{
debugger
;
initializateUI
();
loadCodeRuleListGrid
();
});
...
...
@@ -62,7 +61,6 @@ function updateHandler(data) {
return
;
}
}
debugger
;
var
url
=
DataUtil
.
composeURLByParam
(
'/product/forwardProductDetail.do'
,{
data
:
JSON
.
stringify
(
data
)
});
UICtrl
.
addTabItem
({
tabid
:
'viewFlowChart'
+
id
,
text
:
"产品信息"
,
url
:
url
});
// debugger;
...
...
topsun-xt/src/main/webapp/biz/topsun/product/productDetail.js
View file @
0c18246f
$
(
document
).
ready
(
function
()
{
initializateSelectC
();
});
function
initializateSelectC
()
{
$
(
'#productId'
).
searchbox
({
type
:
"product"
,
name
:
"productCode"
,
onChange
:
function
(
value
,
data
)
{
}
});
}
function
loadDataTest
()
{
console
.
log
(
"loadData"
)
var
params
=
new
URLSearchParams
(
document
.
location
.
search
);
var
paramsData
=
JSON
.
parse
(
params
.
get
(
"data"
));
Public
.
ajax
(
web_app
.
name
+
"/product/loadProductDetail.ajax"
,
{
productId
:
paramsData
.
productId
},
function
(
data
)
{
debugger
;
var
selectedCategory
=
data
.
selectedCategory
;
$
(
"#selectedCategory"
).
ligerComboBox
({
textField
:
'productCategoryName'
,
valueField
:
'productCategoryId'
,
columns
:
[
{
header
:
'ID'
,
name
:
'productCategoryId'
,
width
:
20
},
{
header
:
'名字'
,
name
:
'productCategoryName'
}
],
data
:
selectedCategory
,
selectBoxWidth
:
200
});
});
}
topsun-xt/src/main/webapp/biz/topsun/product/productDetail.jsp
View file @
0c18246f
...
...
@@ -9,6 +9,7 @@
<%@taglib
uri=
"/WEB-INF/taglib.tld"
prefix=
"x"
%>
<%@ taglib
uri=
"http://java.sun.com/jsp/jstl/core"
prefix=
"c"
%>
<head>
<x:base
include=
"layout,dialog,grid,tree,combox,commonTree"
/>
<x:script
src=
'/biz/topsun/product/productDetail.js'
/>
</head>
<form
class=
"hg-form"
method=
"post"
action=
""
id=
"submitForm"
>
...
...
@@ -16,21 +17,20 @@
<x:hidden
name=
"productId"
/>
<div
class=
"hg-form-cols"
>
<div
class=
"hg-form-row"
>
<x:title
title=
"基本属性"
name=
"group"
hideTable=
"#info"
/>
<x:inputC
name=
"productId"
required=
"true"
label=
"产品编码"
labelCol=
"2"
maxLength=
"64"
fieldCol=
"4"
/>
<x:inputC
name=
"productName"
required=
"true"
label=
"产品名称"
labelCol=
"2"
maxLength=
"64"
fieldCol=
"4"
/>
<x:selectC
name=
"productCategoryId"
required=
"false"
label=
"产品类别ID"
dictionary=
"selectedCategory"
labelCol=
"2"
/>
<%-- <x:inputC name="productCategoryId" required="true" label="产品类别ID" wrapper="select" labelCol="2" maxLength="64"--%>
<%-- fieldCol="4" />--%>
<x:inputC
name=
"productUnit"
required=
"false"
label=
"单位"
labelCol=
"2"
maxLength=
"32"
fieldCol=
"4"
/>
<x:inputC
name=
"productSampleCode"
required=
"false"
label=
"样品编号"
labelCol=
"2"
maxLength=
"32"
fieldCol=
"4"
/>
<x:inputC
name=
"brandName"
required=
"false"
label=
"品牌名称"
labelCol=
"2"
maxLength=
"32"
fieldCol=
"4"
/>
<x:title
title=
""
name=
"group"
hideTable=
"#info"
/>
</div>
<div
labelCol=
"15"
>
</div>
</div>
<div
class=
"hg-form-row"
>
<x:title
title=
"基本属性"
name=
"group"
hideTable=
"#info"
/>
<x:inputC
name=
"productId"
required=
"true"
label=
"产品编码"
labelCol=
"2"
maxLength=
"64"
fieldCol=
"4"
/>
<x:inputC
name=
"productName"
required=
"true"
label=
"产品名称"
labelCol=
"2"
maxLength=
"64"
fieldCol=
"4"
/>
<x:selectC
name=
"productCategoryId"
required=
"false"
label=
"产品类别ID"
id=
"selectedCategory"
labelCol=
"2"
/>
<%-- <x:inputC name="productCategoryId" required="true" label="产品类别ID" wrapper="select" labelCol="2" maxLength="64"--%>
<%-- fieldCol="4" />--%>
<x:inputC
name=
"productUnit"
required=
"false"
label=
"单位"
labelCol=
"2"
maxLength=
"32"
fieldCol=
"4"
/>
<x:inputC
name=
"productSampleCode"
required=
"false"
label=
"样品编号"
labelCol=
"2"
maxLength=
"32"
fieldCol=
"4"
/>
<x:inputC
name=
"brandName"
required=
"false"
label=
"品牌名称"
labelCol=
"2"
maxLength=
"32"
fieldCol=
"4"
/>
<x:title
title=
""
name=
"group"
hideTable=
"#info"
/>
</div>
...
...
topsun/src/main/java/com/huigou/topsun/product/application/impl/ProductApplicationImpl.java
View file @
0c18246f
...
...
@@ -84,12 +84,12 @@ public class ProductApplicationImpl implements ProductApplication {
ArrayList
<
ProductCategory
>
categorys
=
(
ArrayList
<
ProductCategory
>)
categoryRepository
.
findAll
();
// --------------------------------- 详情查询 ---------------------------------
ProductTypesetConf
typesetConf
=
typesetConfRepository
.
findByProductIdEquals
(
Long
.
toString
(
productId
)
);
System
.
err
.
println
(
Long
.
toString
(
productId
)
);
ProductLooked
looked
=
lookedRepository
.
findByProductId
(
Long
.
toString
(
productId
)
);
ProductPublishedConf
publishedConf
=
publishedConfRepository
.
findByProductId
Equals
(
Long
.
toString
(
productId
)
);
ProductLoss
loss
=
lossRepository
.
findByProductId
Equals
(
Long
.
toString
(
productId
)
);
ProductMaterial
material
=
materialRepository
.
findByProductIdEquals
(
Long
.
toString
(
productId
)
);
String
strProductId
=
Long
.
toString
(
productId
);
ProductTypesetConf
typesetConf
=
typesetConfRepository
.
findByProductId
(
strProductId
);
ProductLooked
looked
=
lookedRepository
.
findByProductId
(
strProductId
);
ProductPublishedConf
publishedConf
=
publishedConfRepository
.
findByProductId
(
strProductId
);
ProductLoss
loss
=
lossRepository
.
findByProductId
(
strProductId
);
ArrayList
<
ProductMaterial
>
material
=
(
ArrayList
<
ProductMaterial
>)
materialRepository
.
findByProductId
(
strProductId
);
resultMap
.
put
(
"typesetConf"
,
typesetConf
);
resultMap
.
put
(
"looked"
,
looked
);
resultMap
.
put
(
"publishedConf"
,
publishedConf
);
...
...
@@ -111,12 +111,16 @@ public class ProductApplicationImpl implements ProductApplication {
resultMap
.
put
(
"backColor"
,
backColor
);
}
}
resultMap
.
put
(
"selectedBrand"
,
convertToMap
(
Brand
.
class
,
"brandName"
,
"brandId"
,
brands
));
resultMap
.
put
(
"selectedFactory"
,
convertToMap
(
Factory
.
class
,
"factoryName"
,
"factoryId"
,
factorys
));
resultMap
.
put
(
"selectedColor"
,
convertToMap
(
Color
.
class
,
"colorName"
,
"colorId"
,
colors
));
resultMap
.
put
(
"selectedCategory"
,
convertToMap
(
ProductCategory
.
class
,
"productCategoryId"
,
"productCategoryName"
,
categorys
));
ObjectMapper
mapper
=
new
ObjectMapper
();
resultMap
.
put
(
"selectedBrand"
,
mapper
.
convertValue
(
brands
,
List
.
class
));
resultMap
.
put
(
"selectedFactory"
,
mapper
.
convertValue
(
factorys
,
List
.
class
));
resultMap
.
put
(
"selectedColor"
,
mapper
.
convertValue
(
colors
,
List
.
class
));
resultMap
.
put
(
"selectedCategory"
,
mapper
.
convertValue
(
categorys
,
List
.
class
));
// resultMap.put("selectedBrand", convertToMap(Brand.class, "brandName", "brandId", brands));
// resultMap.put("selectedFactory", convertToMap(Factory.class, "factoryName", "factoryId", factorys));
// resultMap.put("selectedColor", convertToMap(Color.class, "colorName", "colorId", colors));
// resultMap.put("selectedCategory", convertToMap(ProductCategory.class, "productCategoryId",
// "productCategoryName", categorys));
return
resultMap
;
}
...
...
topsun/src/main/java/com/huigou/topsun/product/controller/ProductController.java
View file @
0c18246f
...
...
@@ -64,7 +64,6 @@ public class ProductController extends CommonController {
public
String
forwardProduct
()
{
// 通过此方法可以查看系统配置的 字典 的数据结构
DictUtil
.
getDictionaryList
(
"technologyType"
);
Map
<
String
,
Object
>
map4
=
new
HashMap
<>();
map4
.
put
(
"六六六"
,
"666"
);
map4
.
put
(
"七七七"
,
"777"
);
...
...
@@ -73,7 +72,7 @@ public class ProductController extends CommonController {
return
forward
(
"product"
);
}
public
String
forwardProductDetail
()
{
public
String
forwardProductDetail
()
{
ObjectMapper
mapper
=
new
ObjectMapper
();
SDO
sdo
=
this
.
getSDO
();
Map
param
=
null
;
...
...
@@ -82,22 +81,24 @@ public class ProductController extends CommonController {
}
catch
(
JsonProcessingException
e
)
{
throw
new
RuntimeException
(
e
);
}
Map
<
String
,
Object
>
map
=
productService
.
queryDetailAll
(
Integer
.
parseInt
(
param
.
get
(
"productId"
)
+
""
));
HashMap
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
resultMap
.
putAll
(
mapper
.
convertValue
(
map
.
get
(
"detail"
),
Map
.
class
));
resultMap
.
putAll
(
param
);
//字典
DictUtil
.
getDictionaryList
(
"technologyType"
);
// this.putAttribute("selectedCategory", map.get("selectedCategory"));
Map
<
String
,
Object
>
map4
=
new
HashMap
<>();
map4
.
put
(
"code"
,
"666"
);
map4
.
put
(
"name"
,
"777"
);
map4
.
put
(
"value"
,
"888"
);
this
.
putAttribute
(
"selectedCategory"
,
map4
);
String
productId
=
param
.
get
(
"productId"
)+
""
;
Map
<
String
,
Object
>
resultMap
=
productService
.
queryDetailAll
(
Integer
.
parseInt
(
productId
));
if
(
resultMap
.
get
(
"detail"
)
!=
null
)
{
resultMap
.
putAll
(
mapper
.
convertValue
(
resultMap
.
get
(
"detail"
),
Map
.
class
));
}
return
forward
(
"productDetail"
,
param
);
}
return
forward
(
"productDetail"
,
resultMap
);
public
String
loadProductDetail
()
{
ObjectMapper
mapper
=
new
ObjectMapper
();
SDO
sdo
=
this
.
getSDO
();
String
productId
=
sdo
.
getString
(
"productId"
);
Map
<
String
,
Object
>
resultMap
=
productService
.
queryDetailAll
(
Integer
.
parseInt
(
productId
));
if
(
resultMap
.
get
(
"detail"
)
!=
null
)
{
resultMap
.
putAll
(
mapper
.
convertValue
(
resultMap
.
get
(
"detail"
),
Map
.
class
));
}
return
toResult
(
resultMap
);
}
...
...
topsun/src/main/java/com/huigou/topsun/product/repository/ProductLossRepository.java
View file @
0c18246f
...
...
@@ -9,5 +9,5 @@ import org.springframework.data.jpa.repository.JpaRepository;
* @Description:
*/
public
interface
ProductLossRepository
extends
JpaRepository
<
ProductLoss
,
String
>
{
ProductLoss
findByProductId
Equals
(
String
productId
)
;
ProductLoss
findByProductId
(
String
productId
)
;
}
topsun/src/main/java/com/huigou/topsun/product/repository/ProductMaterialRepository.java
View file @
0c18246f
...
...
@@ -3,11 +3,13 @@ package com.huigou.topsun.product.repository;
import
com.huigou.topsun.product.domain.ProductMaterial
;
import
org.springframework.data.jpa.repository.JpaRepository
;
import
java.util.List
;
/**
* @Auther: xin.lu
* @Date: 2023/11/22/10:46
* @Description:
*/
public
interface
ProductMaterialRepository
extends
JpaRepository
<
ProductMaterial
,
String
>
{
ProductMaterial
findByProductIdEquals
(
String
productId
);
List
<
ProductMaterial
>
findByProductId
(
String
productId
);
}
topsun/src/main/java/com/huigou/topsun/product/repository/ProductPublishedConfRepository.java
View file @
0c18246f
...
...
@@ -9,7 +9,7 @@ import org.springframework.data.jpa.repository.JpaRepository;
* @Description:
*/
public
interface
ProductPublishedConfRepository
extends
JpaRepository
<
ProductPublishedConf
,
String
>
{
ProductPublishedConf
findByProductId
Equals
(
String
productId
);
ProductPublishedConf
findByProductId
(
String
productId
);
ProductPublishedConf
getProductPublishedConfByProductId
(
String
productId
);
}
topsun/src/main/java/com/huigou/topsun/product/repository/ProductTypesetConfRepository.java
View file @
0c18246f
...
...
@@ -9,5 +9,5 @@ import org.springframework.data.jpa.repository.JpaRepository;
* @Description:
*/
public
interface
ProductTypesetConfRepository
extends
JpaRepository
<
ProductTypesetConf
,
String
>
{
ProductTypesetConf
findByProductId
Equals
(
String
productId
);
ProductTypesetConf
findByProductId
(
String
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