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
9ab13fec
Commit
9ab13fec
authored
Oct 31, 2023
by
周亚武
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
小程序接口更新
parent
e4035525
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
33 additions
and
11 deletions
+33
-11
enterprise-manager/src/main/java/com/mortals/xhx/busiz/applets/web/CompanyApiController.java
...m/mortals/xhx/busiz/applets/web/CompanyApiController.java
+19
-3
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/src/main/java/com/mortals/xhx/busiz/applets/web/CompanyApiController.java
View file @
9ab13fec
...
@@ -5,17 +5,25 @@ import com.alibaba.fastjson.JSONObject;
...
@@ -5,17 +5,25 @@ import com.alibaba.fastjson.JSONObject;
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
;
import
com.mortals.framework.model.OrderCol
;
import
com.mortals.framework.model.Result
;
import
com.mortals.xhx.busiz.applets.req.CompanyReq
;
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.CompanyPatentEntity
;
import
com.mortals.xhx.module.company.model.CompanyPatentQuery
;
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.CompanyPatentService
;
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.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.model.ProductQuery
;
import
com.mortals.xhx.module.product.service.ProductService
;
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.util.ObjectUtils
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
...
@@ -23,9 +31,11 @@ import org.springframework.web.bind.annotation.RequestBody;
...
@@ -23,9 +31,11 @@ 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.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
/**
/**
...
@@ -44,6 +54,9 @@ public class CompanyApiController extends AbstractBaseController<CompanyReq>{
...
@@ -44,6 +54,9 @@ public class CompanyApiController extends AbstractBaseController<CompanyReq>{
private
CompanyPatentService
companyPatentService
;
private
CompanyPatentService
companyPatentService
;
@Autowired
@Autowired
private
ProductService
productService
;
private
ProductService
productService
;
@Autowired
private
CompanyProductService
companyProductService
;
/**
/**
* 公司标注列表
* 公司标注列表
...
@@ -95,12 +108,15 @@ public class CompanyApiController extends AbstractBaseController<CompanyReq>{
...
@@ -95,12 +108,15 @@ public class CompanyApiController extends AbstractBaseController<CompanyReq>{
CompanyPatentQuery
companyPatentQuery
=
new
CompanyPatentQuery
();
CompanyPatentQuery
companyPatentQuery
=
new
CompanyPatentQuery
();
companyPatentQuery
.
setCompanyId
(
companyReq
.
getCompanyId
());
companyPatentQuery
.
setCompanyId
(
companyReq
.
getCompanyId
());
ProductQuery
productQuery
=
new
ProductQuery
();
CompanyProductQuery
companyProductQuery
=
new
CompanyProductQuery
();
productQuery
.
setCompanyId
(
String
.
valueOf
(
companyReq
.
getCompanyId
()));
companyProductQuery
.
setCompanyId
(
companyReq
.
getCompanyId
());
ProductEntity
productEntity
=
new
ProductEntity
();
productEntity
.
setCompanyId
(
String
.
valueOf
(
companyReq
.
getCompanyId
()));
JSONObject
data
=
new
JSONObject
();
JSONObject
data
=
new
JSONObject
();
data
.
put
(
"patentList"
,
companyPatentService
.
find
(
companyPatentQuery
));
data
.
put
(
"patentList"
,
companyPatentService
.
find
(
companyPatentQuery
));
data
.
put
(
"productList"
,
productService
.
find
(
productQuery
));
data
.
put
(
"productList"
,
productService
.
getProductEntitiesByCompanyId
(
productEntity
,
companyProductService
.
find
(
companyProductQuery
)
));
rest
.
setData
(
data
);
rest
.
setData
(
data
);
recordSysLog
(
request
,
busiDesc
+
" 【成功】"
);
recordSysLog
(
request
,
busiDesc
+
" 【成功】"
);
...
...
enterprise-manager/src/main/java/com/mortals/xhx/busiz/applets/web/StaffApiController.java
View file @
9ab13fec
...
@@ -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 @
9ab13fec
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 @
9ab13fec
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