Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
enterprise-platform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵啸非
enterprise-platform
Commits
0c40687a
Commit
0c40687a
authored
1 year ago
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加修改产品规划
parent
31627be4
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
102 additions
and
42 deletions
+102
-42
db/add.sql
db/add.sql
+2
-0
enterprise-manager-ui/admin/src/views/company/drawershow.vue
enterprise-manager-ui/admin/src/views/company/drawershow.vue
+9
-1
enterprise-manager-ui/admin/src/views/product/list.vue
enterprise-manager-ui/admin/src/views/product/list.vue
+9
-24
enterprise-manager/src/main/java/com/mortals/xhx/module/company/model/CompanyLabelsEntity.java
...mortals/xhx/module/company/model/CompanyLabelsEntity.java
+10
-3
enterprise-manager/src/main/java/com/mortals/xhx/module/product/model/vo/ProductVo.java
...va/com/mortals/xhx/module/product/model/vo/ProductVo.java
+5
-0
enterprise-manager/src/main/java/com/mortals/xhx/module/product/service/impl/ProductServiceImpl.java
...s/xhx/module/product/service/impl/ProductServiceImpl.java
+34
-4
enterprise-manager/src/main/java/com/mortals/xhx/module/product/web/ProductController.java
...com/mortals/xhx/module/product/web/ProductController.java
+33
-10
No files found.
db/add.sql
View file @
0c40687a
...
...
@@ -2,4 +2,6 @@
2023
-
9
-
11
-- ----------------------------
ALTER
TABLE
mortals_xhx_user
ADD
COLUMN
`staffId`
varchar
(
64
)
COMMENT
'员工Id,关联用户员工表'
;
ALTER
TABLE
mortals_xhx_user
ADD
COLUMN
`openId`
varchar
(
64
)
COMMENT
'微信openId'
;
ALTER
TABLE
mortals_xhx_user
ADD
COLUMN
`serviceAprParams`
varchar
(
1024
)
default
''
COMMENT
'事件服务接口请求参数'
;
ALTER
TABLE
mortals_xhx_user
ADD
COLUMN
`customerId`
bigint
(
20
)
COMMENT
'客户ID'
;
This diff is collapsed.
Click to expand it.
enterprise-manager-ui/admin/src/views/company/drawershow.vue
View file @
0c40687a
...
...
@@ -75,7 +75,7 @@
<el-table-column
label=
"标签名称"
prop=
"labelId"
>
<
template
slot-scope=
"scope"
>
<el-select
v-model=
"scope.row.labelId
+''
"
placeholder=
"请选择标签名称"
>
<el-select
v-model=
"scope.row.labelId"
placeholder=
"请选择标签名称"
>
<el-option
v-for=
"($label, $value) in dict.labels"
:key=
"$value"
...
...
@@ -328,6 +328,14 @@
// 渲染前置处理
beforeRender
(
data
)
{
if
(
data
.
entity
.
companyLabelsList
)
{
data
.
entity
.
companyLabelsList
.
forEach
(
item
=>
{
//如果相等做操作
item
[
'
labelId
'
]
=
item
[
'
labelId
'
]
+
''
;
})
this
.
companyLabelsList
=
data
.
entity
.
companyLabelsList
;
}
if
(
data
.
entity
.
companyPatentsList
)
{
...
...
This diff is collapsed.
Click to expand it.
enterprise-manager-ui/admin/src/views/product/list.vue
View file @
0c40687a
...
...
@@ -57,7 +57,6 @@
return
{
/** 子表列元素 */
columnSet
:[
{
label
:
"
产品id
"
,
prop
:
"
productId
"
,
formatter
:
this
.
formatter
},
{
label
:
"
产品名称
"
,
prop
:
"
productName
"
},
{
label
:
"
问题
"
,
prop
:
"
question
"
},
{
label
:
"
常见问题回答
"
,
prop
:
"
answer
"
},
...
...
@@ -69,34 +68,20 @@
{
type
:
"
selection
"
,
width
:
60
},
{
type
:
"
index
"
,
label
:
"
序号
"
,
width
:
50
},
{
label
:
"
产品名称
,名称唯一
"
,
prop
:
"
productName
"
},
{
label
:
"
产品名称
"
,
prop
:
"
productName
"
},
{
label
:
"
产品
编码
"
,
prop
:
"
productCode
"
},
{
label
:
"
产品
分类
"
,
prop
:
"
categoryIds
"
,
formatter
:
this
.
formatters
},
{
label
:
"
产品slogan
"
,
prop
:
"
productSlogan
"
},
{
label
:
"
所属企业
"
,
prop
:
"
companyIds
"
,
formatter
:
this
.
formatters
},
{
label
:
"
产品
图标
"
,
prop
:
"
productLogoPath
"
},
{
label
:
"
产品
介绍
"
,
prop
:
"
productIntroduction
"
,
width
:
120
},
{
label
:
"
产品封面图片
"
,
prop
:
"
productFacePath
"
},
{
label
:
"
发布时间
"
,
prop
:
"
publishTime
"
,
formatter
:
this
.
formatterDate
},
{
label
:
"
是否热门
"
,
prop
:
"
hot
"
,
formatter
:
this
.
formatter
},
{
label
:
"
热门
"
,
prop
:
"
hot
"
,
formatter
:
this
.
formatter
},
{
label
:
"
最近更新时间
"
,
prop
:
"
updateTime
"
,
formatter
:
this
.
formatterDate
},
{
label
:
"
创建用户
"
,
prop
:
"
createUserId
"
,
formatter
:
this
.
formatter
},
{
label
:
"
产品常见问题
"
,
width
:
120
,
prop
:
"
subColumns
"
,
formatter
:
(
row
)
=>
{
let
widthsize
=
this
.
columnSet
.
reduce
((
pre
,
cur
)
=>
{
return
pre
+
Number
(
cur
.
width
);
},
50
);
return
(
<
el
-
popover
placement
=
"
right
"
width
=
{
widthsize
}
trigger
=
"
click
"
>
{
this
.
renderTable
(
row
.
productQuestionList
)}
<
el
-
button
type
=
"
text
"
slot
=
"
reference
"
>
详细
<
/el-button
>
<
/el-popover
>
);
},
},
{
label
:
"
操作
"
,
width
:
240
,
...
...
@@ -111,4 +96,4 @@
};
}
};
</
script
>
\ No newline at end of file
</
script
>
This diff is collapsed.
Click to expand it.
enterprise-manager/src/main/java/com/mortals/xhx/module/company/model/CompanyLabelsEntity.java
View file @
0c40687a
package
com.mortals.xhx.module.company.model
;
import
java.util.List
;
import
java.util.ArrayList
;
import
java.math.BigDecimal
;
import
cn.hutool.core.date.DateUtil
;
import
java.util.Date
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.mortals.framework.annotation.Excel
;
import
com.mortals.framework.model.BaseEntityLong
;
import
com.mortals.xhx.module.company.model.vo.CompanyLabelsVo
;
import
lombok.Data
;
/**
* 公司标注实体对象
*
...
...
@@ -41,23 +46,25 @@ public class CompanyLabelsEntity extends CompanyLabelsVo {
* 备注
*/
private
String
remark
;
@Override
public
int
hashCode
()
{
return
this
.
getId
().
hashCode
();
return
this
.
get
Label
Id
().
hashCode
();
}
@Override
public
boolean
equals
(
Object
obj
)
{
if
(
obj
==
null
)
return
false
;
if
(
obj
instanceof
CompanyLabelsEntity
)
{
CompanyLabelsEntity
tmp
=
(
CompanyLabelsEntity
)
obj
;
if
(
this
.
get
Id
()
==
tmp
.
get
Id
())
{
if
(
this
.
get
LabelId
()
==
tmp
.
getLabel
Id
())
{
return
true
;
}
}
return
false
;
}
public
void
initAttrValue
(){
public
void
initAttrValue
()
{
this
.
labelId
=
0L
;
this
.
labelName
=
""
;
this
.
companyId
=
0L
;
...
...
This diff is collapsed.
Click to expand it.
enterprise-manager/src/main/java/com/mortals/xhx/module/product/model/vo/ProductVo.java
View file @
0c40687a
...
...
@@ -19,5 +19,10 @@ public class ProductVo extends BaseEntityLong {
/** 主键ID,主键,自增长列表 */
private
List
<
Long
>
idList
;
//所属公司
private
String
companyIds
;
//所属企业
private
String
categoryIds
;
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
enterprise-manager/src/main/java/com/mortals/xhx/module/product/service/impl/ProductServiceImpl.java
View file @
0c40687a
package
com.mortals.xhx.module.product.service.impl
;
import
com.mortals.framework.model.PageInfo
;
import
com.mortals.xhx.module.category.service.CategoryService
;
import
com.mortals.xhx.module.company.model.CompanyProductQuery
;
import
com.mortals.xhx.module.company.service.CompanyProductService
;
import
com.mortals.xhx.module.company.service.CompanyService
;
import
com.mortals.xhx.module.product.model.*
;
import
com.mortals.xhx.module.product.service.ProductCategoryService
;
import
org.springframework.stereotype.Service
;
import
com.mortals.framework.service.impl.AbstractCRUDServiceImpl
;
import
com.mortals.framework.exception.AppException
;
import
com.mortals.framework.model.Context
;
import
com.mortals.xhx.module.product.dao.ProductDao
;
import
com.mortals.xhx.module.product.model.ProductEntity
;
import
com.mortals.xhx.module.product.service.ProductService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
com.mortals.xhx.module.product.model.ProductQuestionEntity
;
import
com.mortals.xhx.module.product.model.ProductQuestionQuery
;
import
com.mortals.xhx.module.product.service.ProductQuestionService
;
import
org.springframework.util.ObjectUtils
;
import
java.util.Date
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.stream.Collectors
;
import
lombok.extern.slf4j.Slf4j
;
/**
* ProductService
...
...
@@ -27,12 +33,35 @@ import lombok.extern.slf4j.Slf4j;
public
class
ProductServiceImpl
extends
AbstractCRUDServiceImpl
<
ProductDao
,
ProductEntity
,
Long
>
implements
ProductService
{
@Autowired
private
ProductQuestionService
productQuestionService
;
@Autowired
private
ProductCategoryService
productCategoryService
;
@Autowired
private
CompanyProductService
companyProductService
;
@Autowired
private
CategoryService
categoryService
;
@Autowired
private
CompanyService
companyService
;
@Override
protected
void
findAfter
(
ProductEntity
params
,
PageInfo
pageInfo
,
Context
context
,
List
<
ProductEntity
>
list
)
throws
AppException
{
list
.
forEach
(
item
->{
String
categoryIds
=
productCategoryService
.
find
(
new
ProductCategoryQuery
().
productId
(
item
.
getId
())).
stream
().
map
(
i
->
i
.
getCategoryId
().
toString
()).
collect
(
Collectors
.
joining
(
","
));
String
companyIds
=
companyProductService
.
find
(
new
CompanyProductQuery
().
productId
(
item
.
getId
())).
stream
().
map
(
i
->
i
.
getProductId
().
toString
()).
collect
(
Collectors
.
joining
(
","
));
item
.
setCompanyIds
(
companyIds
);
item
.
setCategoryIds
(
categoryIds
);
});
}
@Override
protected
void
saveAfter
(
ProductEntity
entity
,
Context
context
)
throws
AppException
{
if
(!
ObjectUtils
.
isEmpty
(
entity
.
getProductQuestionList
())){
entity
.
getProductQuestionList
().
stream
().
peek
(
item
->{
item
.
setProductId
(
entity
.
getId
());
item
.
setProductName
(
entity
.
getProductName
());
item
.
setCreateUserId
(
this
.
getContextUserId
(
context
));
item
.
setCreateTime
(
new
Date
());
}).
count
();
...
...
@@ -48,6 +77,7 @@ public class ProductServiceImpl extends AbstractCRUDServiceImpl<ProductDao, Prod
productQuestionService
.
remove
(
productQuestionIds
,
context
);
entity
.
getProductQuestionList
().
stream
().
peek
(
item
->{
item
.
setProductId
(
entity
.
getId
());
item
.
setProductName
(
entity
.
getProductName
());
item
.
setCreateUserId
(
this
.
getContextUserId
(
context
));
item
.
setCreateTime
(
new
Date
());
item
.
setUpdateUserId
(
this
.
getContextUserId
(
context
));
...
...
This diff is collapsed.
Click to expand it.
enterprise-manager/src/main/java/com/mortals/xhx/module/product/web/ProductController.java
View file @
0c40687a
package
com.mortals.xhx.module.product.web
;
import
com.mortals.framework.web.BaseCRUDJsonBodyMappingController
;
import
com.mortals.xhx.base.system.param.service.ParamService
;
import
com.mortals.xhx.common.code.YesNoEnum
;
import
com.mortals.xhx.module.category.model.CategoryQuery
;
import
com.mortals.xhx.module.category.service.CategoryService
;
import
com.mortals.xhx.module.company.model.CompanyQuery
;
import
com.mortals.xhx.module.company.service.CompanyService
;
import
com.mortals.xhx.module.product.service.ProductCategoryService
;
import
org.checkerframework.checker.units.qual.A
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.*
;
import
com.mortals.framework.model.Context
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
com.mortals.framework.web.BaseCRUDJsonBodyMappingController
;
import
com.mortals.xhx.module.product.model.ProductEntity
;
import
com.mortals.xhx.module.product.service.ProductService
;
import
org.apache.commons.lang3.ArrayUtils
;
import
com.mortals.framework.util.StringUtils
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
import
com.alibaba.fastjson.JSONObject
;
import
java.util.Arrays
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.multipart.MultipartFile
;
import
static
com
.
mortals
.
framework
.
ap
.
SysConstains
.*;
/**
*
* 产品
*
* @author zxfei
* @date 2023-09-18
*/
* 产品
*
* @author zxfei
* @date 2023-09-18
*/
@RestController
@RequestMapping
(
"product"
)
public
class
ProductController
extends
BaseCRUDJsonBodyMappingController
<
ProductService
,
ProductEntity
,
Long
>
{
public
class
ProductController
extends
BaseCRUDJsonBodyMappingController
<
ProductService
,
ProductEntity
,
Long
>
{
@Autowired
private
ParamService
paramService
;
@Autowired
private
ProductCategoryService
productCategoryService
;
@Autowired
private
CategoryService
categoryService
;
@Autowired
private
CompanyService
companyService
;
public
ProductController
(){
super
.
setModuleDesc
(
"产品"
);
public
ProductController
()
{
super
.
setModuleDesc
(
"产品"
);
}
@Override
protected
void
init
(
Map
<
String
,
Object
>
model
,
Context
context
)
{
this
.
addDict
(
model
,
"hot"
,
paramService
.
getParamBySecondOrganize
(
"Product"
,
"hot"
));
this
.
addDict
(
model
,
"hot"
,
YesNoEnum
.
getEnumMap
());
this
.
addDict
(
model
,
"categoryId"
,
categoryService
.
find
(
new
CategoryQuery
()).
stream
().
collect
(
Collectors
.
toMap
(
x
->
x
.
getId
().
toString
(),
y
->
y
.
getName
(),
(
o
,
n
)
->
n
)));
this
.
addDict
(
model
,
"companyId"
,
companyService
.
find
(
new
CompanyQuery
()).
stream
().
collect
(
Collectors
.
toMap
(
x
->
x
.
getId
().
toString
(),
y
->
y
.
getCompanyName
(),
(
o
,
n
)
->
n
)));
super
.
init
(
model
,
context
);
}
...
...
This diff is collapsed.
Click to expand it.
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