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
be35ac55
Commit
be35ac55
authored
May 13, 2024
by
赵啸非
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
c828969f
0f3e964c
Changes
14
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
640 additions
and
16 deletions
+640
-16
enterprise-manager-ui/admin/src/views/product/drawershow.vue
enterprise-manager-ui/admin/src/views/product/drawershow.vue
+1
-1
enterprise-manager-ui/admin/src/views/product/list.vue
enterprise-manager-ui/admin/src/views/product/list.vue
+2
-2
enterprise-manager/src/main/java/com/mortals/xhx/busiz/applets/req/CompanyReq.java
...in/java/com/mortals/xhx/busiz/applets/req/CompanyReq.java
+22
-0
enterprise-manager/src/main/java/com/mortals/xhx/busiz/applets/req/FavoriteReq.java
...n/java/com/mortals/xhx/busiz/applets/req/FavoriteReq.java
+34
-0
enterprise-manager/src/main/java/com/mortals/xhx/busiz/applets/req/LoginReq.java
...main/java/com/mortals/xhx/busiz/applets/req/LoginReq.java
+22
-0
enterprise-manager/src/main/java/com/mortals/xhx/busiz/applets/req/UserInfoReq.java
...n/java/com/mortals/xhx/busiz/applets/req/UserInfoReq.java
+42
-0
enterprise-manager/src/main/java/com/mortals/xhx/busiz/applets/rsp/FavoriteTypeListInfo.java
...m/mortals/xhx/busiz/applets/rsp/FavoriteTypeListInfo.java
+25
-0
enterprise-manager/src/main/java/com/mortals/xhx/busiz/applets/web/CompanyApiController.java
...m/mortals/xhx/busiz/applets/web/CompanyApiController.java
+67
-5
enterprise-manager/src/main/java/com/mortals/xhx/busiz/applets/web/FavoriteApiController.java
.../mortals/xhx/busiz/applets/web/FavoriteApiController.java
+238
-0
enterprise-manager/src/main/java/com/mortals/xhx/busiz/applets/web/LoginApiController.java
...com/mortals/xhx/busiz/applets/web/LoginApiController.java
+172
-0
enterprise-manager/src/main/java/com/mortals/xhx/busiz/applets/web/NewsApiController.java
.../com/mortals/xhx/busiz/applets/web/NewsApiController.java
+1
-0
enterprise-manager/src/main/java/com/mortals/xhx/busiz/applets/web/StaffApiController.java
...com/mortals/xhx/busiz/applets/web/StaffApiController.java
+6
-4
enterprise-manager/src/main/java/com/mortals/xhx/module/product/service/ProductService.java
...om/mortals/xhx/module/product/service/ProductService.java
+6
-0
enterprise-manager/src/main/java/com/mortals/xhx/module/product/service/impl/ProductServiceImpl.java
...s/xhx/module/product/service/impl/ProductServiceImpl.java
+2
-4
No files found.
enterprise-manager-ui/admin/src/views/product/drawershow.vue
View file @
be35ac55
...
@@ -17,7 +17,7 @@
...
@@ -17,7 +17,7 @@
</el-row>
</el-row>
<el-row>
<el-row>
<Field
label=
"产品分类"
prop=
"categoryId"
v-model=
"form.categoryId"
:multiple=
"true"
type=
"select"
:enumData=
"dict.categoryId"
placeholder=
"请选择产品分类"
/>
<Field
label=
"产品分类"
prop=
"categoryId"
v-model=
"form.categoryId"
:multiple=
"true"
type=
"select"
:enumData=
"dict.categoryId"
placeholder=
"请选择产品分类"
/>
<
!--
<Field
label=
"所属企业"
prop=
"companyId"
v-model=
"form.companyId"
:multiple=
"true"
type=
"select"
:enumData=
"dict.companyId"
placeholder=
"请选择所属企业"
/>
--
>
<
Field
label=
"所属企业"
prop=
"companyId"
v-model=
"form.companyId"
:multiple=
"true"
type=
"select"
:enumData=
"dict.companyId"
placeholder=
"请选择所属企业"
/
>
<!--
<Field
label=
"产品图标"
><imageUpload
v-model=
"form.productLogoPath"
prePath=
"/file/preview"
/></Field>
-->
<!--
<Field
label=
"产品图标"
><imageUpload
v-model=
"form.productLogoPath"
prePath=
"/file/preview"
/></Field>
-->
...
...
enterprise-manager-ui/admin/src/views/product/list.vue
View file @
be35ac55
<
template
>
<
template
>
<div
class=
"page"
>
<div
class=
"page"
>
<LayoutTable
ref=
"layouttable"
:data=
"tableData"
:config=
"tableConfig"
notDel
>
<LayoutTable
ref=
"layouttable"
:data=
"tableData"
:config=
"tableConfig"
notDel
>
<!-- 热门0为非热门1为热门 -->
<!-- 热门0为非热门1为热门 -->
<div
slot=
"table-search-left"
class=
"onlyhot"
>
<div
slot=
"table-search-left"
class=
"onlyhot"
>
<el-checkbox
<el-checkbox
...
@@ -139,7 +139,7 @@
...
@@ -139,7 +139,7 @@
width
:
240
,
width
:
240
,
formatter
:
row
=>
{
formatter
:
row
=>
{
return
(
return
(
<
table
-
buttons
noAdd
row
=
{
row
}
onEdit
=
{
this
.
toEdit
}
onView
=
{
this
.
toView
}
onDel
=
{
this
.
toDel
}
/
>
<
table
-
buttons
noAdd
noView
row
=
{
row
}
onEdit
=
{
this
.
toEdit
}
onView
=
{
this
.
toView
}
onDel
=
{
this
.
toDel
}
/
>
);
);
}
}
}
}
...
...
enterprise-manager/src/main/java/com/mortals/xhx/busiz/applets/req/CompanyReq.java
0 → 100644
View file @
be35ac55
package
com.mortals.xhx.busiz.applets.req
;
import
com.mortals.xhx.busiz.BaseReq
;
import
lombok.Data
;
/**
* 企业详情
*
* @author: zxfei
* @date: 2023/10/7 16:53
*/
@Data
public
class
CompanyReq
extends
BaseReq
{
/**
* 企业id
*/
private
long
companyId
;
}
enterprise-manager/src/main/java/com/mortals/xhx/busiz/applets/req/FavoriteReq.java
0 → 100644
View file @
be35ac55
package
com.mortals.xhx.busiz.applets.req
;
import
com.mortals.xhx.busiz.BaseReq
;
import
lombok.Data
;
/**
* 收藏
*
* @author: zxfei
* @date: 2023/10/7 16:53
*/
@Data
public
class
FavoriteReq
extends
BaseReq
{
/**
* 产品id
*/
private
long
productId
;
/**
* 新闻id
*/
private
long
newsId
;
/**
* 名片id
*/
private
long
staffId
;
/**
* 分类Id
*/
private
int
typeId
;
}
enterprise-manager/src/main/java/com/mortals/xhx/busiz/applets/req/LoginReq.java
0 → 100644
View file @
be35ac55
package
com.mortals.xhx.busiz.applets.req
;
import
com.mortals.xhx.busiz.BaseReq
;
import
lombok.Data
;
/**
* 登录请求
*
* @author: zxfei
* @date: 2023/10/7 16:53
*/
@Data
public
class
LoginReq
extends
BaseReq
{
/**
* 微信openId
*/
private
String
openId
;
}
enterprise-manager/src/main/java/com/mortals/xhx/busiz/applets/req/UserInfoReq.java
0 → 100644
View file @
be35ac55
package
com.mortals.xhx.busiz.applets.req
;
import
com.mortals.xhx.busiz.BaseReq
;
import
lombok.Data
;
/**
* 修改个人信息
*
* @author: zxfei
* @date: 2023/10/7 16:53
*/
@Data
public
class
UserInfoReq
extends
BaseReq
{
/**
* 员工电话
*/
private
String
phone
;
/**
* 员工邮箱
*/
private
String
email
;
/**
* 员工姓名
*/
private
String
name
;
/**
* 员工单位名称
*/
private
String
deptName
;
/**
* 员工昵称
*/
private
String
realName
;
/**
* 员工照片
*/
private
String
photoPath
;
}
enterprise-manager/src/main/java/com/mortals/xhx/busiz/applets/rsp/FavoriteTypeListInfo.java
0 → 100644
View file @
be35ac55
package
com.mortals.xhx.busiz.applets.rsp
;
import
lombok.Data
;
import
java.util.Date
;
@Data
public
class
FavoriteTypeListInfo
{
public
FavoriteTypeListInfo
(
int
id
,
String
title
)
{
this
.
id
=
id
;
this
.
title
=
title
;
}
/**
* id
*/
private
int
id
;
/**
* 标题
*/
private
String
title
;
}
enterprise-manager/src/main/java/com/mortals/xhx/busiz/applets/web/CompanyApiController.java
View file @
be35ac55
package
com.mortals.xhx.busiz.applets.web
;
package
com.mortals.xhx.busiz.applets.web
;
import
com.alibaba.fastjson.JSONObject
;
import
com.mortals.framework.common.Rest
;
import
com.mortals.framework.common.Rest
;
import
com.mortals.xhx.busiz.applets.req.NewsReq
;
import
com.mortals.framework.exception.AppException
;
import
com.mortals.xhx.module.company.model.CompanyLabelsQuery
;
import
com.mortals.framework.model.Context
;
import
com.mortals.framework.model.OrderCol
;
import
com.mortals.framework.model.Result
;
import
com.mortals.xhx.busiz.applets.req.CompanyReq
;
import
com.mortals.xhx.common.utils.BeanUtil
;
import
com.mortals.xhx.module.company.model.CompanyPatentEntity
;
import
com.mortals.xhx.module.company.model.CompanyPatentQuery
;
import
com.mortals.xhx.module.company.model.CompanyProductQuery
;
import
com.mortals.xhx.module.company.model.CompanyQuery
;
import
com.mortals.xhx.module.company.model.CompanyQuery
;
import
com.mortals.xhx.module.company.service.CompanyLabelsService
;
import
com.mortals.xhx.module.company.service.CompanyPatentService
;
import
com.mortals.xhx.module.company.service.CompanyProductService
;
import
com.mortals.xhx.module.company.service.CompanyService
;
import
com.mortals.xhx.module.company.service.CompanyService
;
import
com.mortals.xhx.module.labels.model.LabelsQuery
;
import
com.mortals.xhx.module.labels.model.LabelsQuery
;
import
com.mortals.xhx.module.labels.service.LabelsService
;
import
com.mortals.xhx.module.labels.service.LabelsService
;
import
com.mortals.xhx.module.news.model.NewsCategoryQuery
;
import
com.mortals.xhx.module.product.model.ProductCategoryQuery
;
import
com.mortals.xhx.module.product.model.ProductEntity
;
import
com.mortals.xhx.module.product.model.ProductQuery
;
import
com.mortals.xhx.module.product.service.ProductService
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.Arrays
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
/**
/**
...
@@ -25,11 +45,18 @@ import org.springframework.web.bind.annotation.RestController;
...
@@ -25,11 +45,18 @@ import org.springframework.web.bind.annotation.RestController;
@RestController
@RestController
@Slf4j
@Slf4j
@RequestMapping
(
"/api/v1/company"
)
@RequestMapping
(
"/api/v1/company"
)
public
class
CompanyApiController
extends
AbstractBaseController
<
News
Req
>{
public
class
CompanyApiController
extends
AbstractBaseController
<
Company
Req
>{
@Autowired
@Autowired
private
CompanyService
companyService
;
private
CompanyService
companyService
;
@Autowired
@Autowired
private
LabelsService
labelsService
;
private
LabelsService
labelsService
;
@Autowired
private
CompanyPatentService
companyPatentService
;
@Autowired
private
ProductService
productService
;
@Autowired
private
CompanyProductService
companyProductService
;
/**
/**
* 公司标注列表
* 公司标注列表
...
@@ -63,4 +90,39 @@ public class CompanyApiController extends AbstractBaseController<NewsReq>{
...
@@ -63,4 +90,39 @@ public class CompanyApiController extends AbstractBaseController<NewsReq>{
return
rest
;
return
rest
;
}
}
/**
* 公司知识产权数量列表及推荐产品列表
*/
@PostMapping
(
value
=
"companyInfo"
)
public
Rest
<
Object
>
companyInfo
(
@RequestBody
CompanyReq
companyReq
){
String
busiDesc
=
"公司详情"
;
log
.
info
(
"【{}】【请求体】--> {}"
,
busiDesc
,
JSONObject
.
toJSONString
(
companyReq
));
Rest
<
Object
>
rest
=
Rest
.
ok
(
busiDesc
+
" 【成功】"
);
try
{
if
(
ObjectUtils
.
isEmpty
(
companyReq
.
getCompanyId
()))
{
throw
new
AppException
(
"详细查询id不能为空!"
);
}
CompanyPatentQuery
companyPatentQuery
=
new
CompanyPatentQuery
();
companyPatentQuery
.
setCompanyId
(
companyReq
.
getCompanyId
());
CompanyProductQuery
companyProductQuery
=
new
CompanyProductQuery
();
companyProductQuery
.
setCompanyId
(
companyReq
.
getCompanyId
());
ProductEntity
productEntity
=
new
ProductEntity
();
productEntity
.
setCompanyId
(
String
.
valueOf
(
companyReq
.
getCompanyId
()));
JSONObject
data
=
new
JSONObject
();
data
.
put
(
"patentList"
,
companyPatentService
.
find
(
companyPatentQuery
));
data
.
put
(
"productList"
,
productService
.
getProductEntitiesByCompanyId
(
productEntity
,
companyProductService
.
find
(
companyProductQuery
)));
rest
.
setData
(
data
);
recordSysLog
(
request
,
busiDesc
+
" 【成功】"
);
}
catch
(
Exception
e
)
{
log
.
error
(
busiDesc
,
e
);
rest
=
Rest
.
fail
(
super
.
convertException
(
e
));
}
return
rest
;
}
}
}
enterprise-manager/src/main/java/com/mortals/xhx/busiz/applets/web/FavoriteApiController.java
0 → 100644
View file @
be35ac55
This diff is collapsed.
Click to expand it.
enterprise-manager/src/main/java/com/mortals/xhx/busiz/applets/web/LoginApiController.java
0 → 100644
View file @
be35ac55
package
com.mortals.xhx.busiz.applets.web
;
import
com.alibaba.fastjson.JSONObject
;
import
com.mortals.framework.common.Rest
;
import
com.mortals.framework.exception.AppException
;
import
com.mortals.framework.model.Context
;
import
com.mortals.framework.service.IAuthTokenService
;
import
com.mortals.framework.service.IUser
;
import
com.mortals.xhx.base.login.web.LoginForm
;
import
com.mortals.xhx.base.system.user.model.UserEntity
;
import
com.mortals.xhx.base.system.user.model.UserQuery
;
import
com.mortals.xhx.base.system.user.service.UserService
;
import
com.mortals.xhx.busiz.applets.req.LoginReq
;
import
com.mortals.xhx.busiz.applets.req.StaffReq
;
import
com.mortals.xhx.busiz.applets.req.UserInfoReq
;
import
com.mortals.xhx.common.pdu.user.UserPdu
;
import
com.mortals.xhx.module.company.model.CompanyQuery
;
import
com.mortals.xhx.module.staff.model.StaffEntity
;
import
com.mortals.xhx.module.staff.model.StaffQuery
;
import
com.mortals.xhx.module.staff.model.StaffRecordEntity
;
import
com.mortals.xhx.module.staff.service.StaffRecordService
;
import
com.mortals.xhx.module.staff.service.StaffService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.catalina.User
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.Date
;
import
static
com
.
mortals
.
xhx
.
common
.
key
.
ErrorCode
.
ERROR_TOKEN_EXPIRED
;
import
static
com
.
mortals
.
xhx
.
common
.
key
.
ErrorCode
.
ERROR_TOKEN_EXPIRED_CONTENT
;
/**
* @author ZYW
* @date 2023-10-30 9:39
*/
@RestController
@Slf4j
@RequestMapping
(
"/api/v1/login"
)
public
class
LoginApiController
extends
AbstractBaseController
<
LoginReq
>{
@Autowired
private
UserService
userService
;
@Autowired
private
StaffService
staffService
;
@Autowired
private
IAuthTokenService
authTokenService
;
@RequestMapping
(
"login"
)
public
Rest
<
Object
>
login
(
@RequestBody
LoginReq
loginReq
)
throws
Exception
{
String
busiDesc
=
"小程序登录"
;
Rest
<
Object
>
rest
=
Rest
.
ok
();
try
{
JSONObject
data
=
new
JSONObject
();
UserQuery
userQuery
=
new
UserQuery
();
userQuery
.
setOpenId
(
loginReq
.
getOpenId
());
UserEntity
userEntity
=
userService
.
selectOne
(
userQuery
);
String
token
=
""
;
//如果没查到用户,则第一次登录,根据openid创建用户
if
(
ObjectUtils
.
isEmpty
(
userEntity
)){
UserEntity
entity
=
new
UserEntity
();
entity
.
setUserType
(
1
);
//普通用户
entity
.
setLastLoginTime
(
new
Date
());
entity
.
setOpenId
(
loginReq
.
getOpenId
());
entity
.
setStatus
(
1
);
entity
.
setRealName
(
"游客"
);
entity
.
setLoginName
(
loginReq
.
getOpenId
());
entity
.
setLoginPwd
(
"123"
);
//默认密码123
entity
.
setCreateUserName
(
"小程序"
);
userService
.
save
(
entity
);
token
=
authTokenService
.
createToken
(
entity
);
log
.
info
(
busiDesc
,
"第一次登陆,保存用户信息成功"
);
rest
.
setMsg
(
"未查询到用户信息"
);
}
else
{
StaffQuery
staffQuery
=
new
StaffQuery
();
if
(
ObjectUtils
.
isEmpty
(
userEntity
.
getStaffId
())){
rest
.
setMsg
(
"后台未绑定员工信息"
);
}
else
{
staffQuery
.
setId
(
userEntity
.
getStaffId
());
StaffEntity
staffEntity
=
staffService
.
selectOne
(
staffQuery
);
data
.
put
(
"userInfo"
,
staffEntity
);
if
(
ObjectUtils
.
isEmpty
(
userEntity
)){
rest
.
setMsg
(
"未查询到员工信息"
);
}
}
token
=
authTokenService
.
createToken
(
userEntity
);
}
data
.
put
(
"token"
,
token
);
rest
.
setData
(
data
);
}
catch
(
Exception
e
)
{
log
.
error
(
busiDesc
,
e
);
rest
=
Rest
.
fail
(
super
.
convertException
(
e
));
}
return
rest
;
}
@RequestMapping
(
"updateUserInfo"
)
public
Rest
<
Object
>
updateUserInfo
(
@RequestBody
UserInfoReq
userInfoReq
)
throws
Exception
{
String
busiDesc
=
"小程序修改人员信息"
;
Rest
<
Object
>
rest
=
Rest
.
ok
();
try
{
IUser
iUser
=
authTokenService
.
getLoginUser
(
request
);
UserEntity
user
=
userService
.
selectOne
(
new
UserQuery
().
id
(
iUser
.
getId
()));
if
(
ObjectUtils
.
isEmpty
(
user
)){
rest
=
Rest
.
fail
(
"获取个人信息失败"
);
}
else
{
if
(!
ObjectUtils
.
isEmpty
(
userInfoReq
.
getPhone
())){
user
.
setPhone
(
userInfoReq
.
getPhone
());
}
if
(!
ObjectUtils
.
isEmpty
(
userInfoReq
.
getEmail
())){
user
.
setEmail
(
userInfoReq
.
getEmail
());
}
if
(!
ObjectUtils
.
isEmpty
(
userInfoReq
.
getName
())){
user
.
setLoginName
(
userInfoReq
.
getName
());
}
if
(!
ObjectUtils
.
isEmpty
(
userInfoReq
.
getDeptName
())){
user
.
setDeptName
(
userInfoReq
.
getDeptName
());
}
if
(!
ObjectUtils
.
isEmpty
(
userInfoReq
.
getRealName
())){
user
.
setRealName
(
userInfoReq
.
getRealName
());
}
if
(!
ObjectUtils
.
isEmpty
(
userInfoReq
.
getPhotoPath
())){
if
(!
ObjectUtils
.
isEmpty
(
user
.
getPhone
())){
StaffEntity
staffEntity
=
staffService
.
selectOne
(
new
StaffQuery
().
phoneNumber
(
user
.
getPhone
()));
if
(!
ObjectUtils
.
isEmpty
(
staffEntity
)){
staffEntity
.
setPhotoPath
(
userInfoReq
.
getPhotoPath
());
staffService
.
update
(
staffEntity
);
}
else
{
rest
=
Rest
.
fail
(
"请先在后台创建工作人员"
);
}
}
else
{
rest
=
Rest
.
fail
(
"请先绑定电话"
);
}
}
userService
.
update
(
user
);
}
}
catch
(
Exception
e
)
{
log
.
error
(
busiDesc
,
e
);
rest
=
Rest
.
fail
(
super
.
convertException
(
e
));
}
return
rest
;
}
}
enterprise-manager/src/main/java/com/mortals/xhx/busiz/applets/web/NewsApiController.java
View file @
be35ac55
package
com.mortals.xhx.busiz.applets.web
;
package
com.mortals.xhx.busiz.applets.web
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.mortals.framework.annotation.UnAuth
;
import
com.mortals.framework.common.Rest
;
import
com.mortals.framework.common.Rest
;
import
com.mortals.framework.exception.AppException
;
import
com.mortals.framework.exception.AppException
;
import
com.mortals.framework.model.Context
;
import
com.mortals.framework.model.Context
;
...
...
enterprise-manager/src/main/java/com/mortals/xhx/busiz/applets/web/StaffApiController.java
View file @
be35ac55
...
@@ -71,9 +71,10 @@ public class StaffApiController extends AbstractBaseController<StaffReq>{
...
@@ -71,9 +71,10 @@ public class StaffApiController extends AbstractBaseController<StaffReq>{
StaffEntity
staffEntity
=
staffService
.
get
(
staffReq
.
getId
());
StaffEntity
staffEntity
=
staffService
.
get
(
staffReq
.
getId
());
if
(
staffEntity
!=
null
){
if
(
staffEntity
!=
null
){
rest
.
setData
(
staffEntity
);
rest
.
setData
(
staffEntity
);
}
else
{
rest
=
Rest
.
fail
(
"未查到该员工"
);
}
}
// else {
// rest = Rest.fail("未查到该员工");
// }
}
else
{
}
else
{
rest
=
Rest
.
fail
(
"缺少id"
);
rest
=
Rest
.
fail
(
"缺少id"
);
...
@@ -103,9 +104,10 @@ public class StaffApiController extends AbstractBaseController<StaffReq>{
...
@@ -103,9 +104,10 @@ public class StaffApiController extends AbstractBaseController<StaffReq>{
StaffRecordEntity
staffRecordEntity
=
staffRecordService
.
get
(
staffReq
.
getId
());
StaffRecordEntity
staffRecordEntity
=
staffRecordService
.
get
(
staffReq
.
getId
());
if
(
staffRecordEntity
!=
null
){
if
(
staffRecordEntity
!=
null
){
rest
.
setData
(
staffRecordEntity
);
rest
.
setData
(
staffRecordEntity
);
}
else
{
rest
=
Rest
.
fail
(
"未查到记录"
);
}
}
// else {
// rest = Rest.fail("未查到记录");
// }
}
else
{
}
else
{
rest
=
Rest
.
fail
(
"缺少id"
);
rest
=
Rest
.
fail
(
"缺少id"
);
...
...
enterprise-manager/src/main/java/com/mortals/xhx/module/product/service/ProductService.java
View file @
be35ac55
package
com.mortals.xhx.module.product.service
;
package
com.mortals.xhx.module.product.service
;
import
com.mortals.framework.service.ICRUDCacheService
;
import
com.mortals.framework.service.ICRUDCacheService
;
import
com.mortals.framework.service.ICRUDService
;
import
com.mortals.framework.service.ICRUDService
;
import
com.mortals.xhx.module.company.model.CompanyProductEntity
;
import
com.mortals.xhx.module.product.model.ProductEntity
;
import
com.mortals.xhx.module.product.model.ProductEntity
;
import
com.mortals.xhx.module.product.dao.ProductDao
;
import
com.mortals.xhx.module.product.dao.ProductDao
;
import
java.util.List
;
/**
/**
* ProductService
* ProductService
*
*
...
@@ -14,4 +18,6 @@ import com.mortals.xhx.module.product.dao.ProductDao;
...
@@ -14,4 +18,6 @@ import com.mortals.xhx.module.product.dao.ProductDao;
public
interface
ProductService
extends
ICRUDCacheService
<
ProductEntity
,
Long
>
{
public
interface
ProductService
extends
ICRUDCacheService
<
ProductEntity
,
Long
>
{
ProductDao
getDao
();
ProductDao
getDao
();
List
<
ProductEntity
>
getProductEntitiesByCompanyId
(
ProductEntity
entity
,
List
<
CompanyProductEntity
>
companyProducList
);
}
}
\ No newline at end of file
enterprise-manager/src/main/java/com/mortals/xhx/module/product/service/impl/ProductServiceImpl.java
View file @
be35ac55
package
com.mortals.xhx.module.product.service.impl
;
package
com.mortals.xhx.module.product.service.impl
;
import
cn.hutool.core.collection.CollUtil
;
import
cn.hutool.core.collection.CollUtil
;
import
cn.hutool.core.util.StrUtil
;
import
com.mortals.framework.model.PageInfo
;
import
com.mortals.framework.model.PageInfo
;
import
com.mortals.framework.model.Result
;
import
com.mortals.framework.model.Result
;
import
com.mortals.framework.service.impl.AbstractCRUDCacheServiceImpl
;
import
com.mortals.framework.service.impl.AbstractCRUDCacheServiceImpl
;
import
com.mortals.xhx.module.category.model.CategoryEntity
;
import
com.mortals.xhx.module.category.model.CategoryEntity
;
import
com.mortals.xhx.module.category.model.CategoryQuery
;
import
com.mortals.xhx.module.category.service.CategoryService
;
import
com.mortals.xhx.module.category.service.CategoryService
;
import
com.mortals.xhx.module.company.model.CompanyEntity
;
import
com.mortals.xhx.module.company.model.CompanyEntity
;
import
com.mortals.xhx.module.company.model.CompanyProductEntity
;
import
com.mortals.xhx.module.company.model.CompanyProductEntity
;
...
@@ -16,7 +14,6 @@ import com.mortals.xhx.module.company.service.CompanyService;
...
@@ -16,7 +14,6 @@ import com.mortals.xhx.module.company.service.CompanyService;
import
com.mortals.xhx.module.product.model.*
;
import
com.mortals.xhx.module.product.model.*
;
import
com.mortals.xhx.module.product.service.ProductCategoryService
;
import
com.mortals.xhx.module.product.service.ProductCategoryService
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
com.mortals.framework.service.impl.AbstractCRUDServiceImpl
;
import
com.mortals.framework.exception.AppException
;
import
com.mortals.framework.exception.AppException
;
import
com.mortals.framework.model.Context
;
import
com.mortals.framework.model.Context
;
import
com.mortals.xhx.module.product.dao.ProductDao
;
import
com.mortals.xhx.module.product.dao.ProductDao
;
...
@@ -111,7 +108,8 @@ public class ProductServiceImpl extends AbstractCRUDCacheServiceImpl<ProductDao,
...
@@ -111,7 +108,8 @@ public class ProductServiceImpl extends AbstractCRUDCacheServiceImpl<ProductDao,
return
productEntityResult
;
return
productEntityResult
;
}
}
private
List
<
ProductEntity
>
getProductEntitiesByCompanyId
(
ProductEntity
entity
,
List
<
CompanyProductEntity
>
companyProducList
)
{
@Override
public
List
<
ProductEntity
>
getProductEntitiesByCompanyId
(
ProductEntity
entity
,
List
<
CompanyProductEntity
>
companyProducList
)
{
List
<
ProductEntity
>
productList
=
companyProducList
.
stream
().
map
(
item
->
{
List
<
ProductEntity
>
productList
=
companyProducList
.
stream
().
map
(
item
->
{
ProductEntity
productEntity
=
this
.
getCache
(
item
.
getProductId
().
toString
());
ProductEntity
productEntity
=
this
.
getCache
(
item
.
getProductId
().
toString
());
if
(!
ObjectUtils
.
isEmpty
(
productEntity
))
{
if
(!
ObjectUtils
.
isEmpty
(
productEntity
))
{
...
...
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