Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
foodNexus-admin
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
副食品筹措管理平台
foodNexus-admin
Commits
6543ce56
Commit
6543ce56
authored
Jan 07, 2026
by
杨浩
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug修复
parent
42bb38df
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
123 additions
and
5 deletions
+123
-5
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/service/purchase/ErpPurchaseOrderServiceImpl.java
+1
-0
foodnexus-module-mall/foodnexus-module-operations/src/main/java/cn/iocoder/foodnexus/module/operations/controller/admin/customerrequire/CustomerRequireController.java
+27
-2
foodnexus-module-mall/foodnexus-module-operations/src/main/java/cn/iocoder/foodnexus/module/operations/controller/admin/customerrequire/vo/CustomerRequireRespVO.java
+3
-0
foodnexus-module-mall/foodnexus-module-operations/src/main/java/cn/iocoder/foodnexus/module/operations/controller/app/customerrequire/AppCustomerRequireController.java
+36
-3
foodnexus-module-mall/foodnexus-module-order-api/src/main/java/cn/iocoder/foodnexus/module/order/api/CustomerOrderApi.java
+2
-0
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/controller/admin/checktask/vo/CheckTaskItemsRespVO.java
+3
-0
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/controller/admin/customerorderitem/vo/CustomerOrderItemRespVO.java
+4
-0
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/dal/dataobject/checktaskitems/CheckTaskItemsDO.java
+6
-0
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/dal/dataobject/customerorderitem/CustomerOrderItemDO.java
+6
-0
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/service/customerorder/CustomerOrderServiceImpl.java
+10
-0
foodnexus-module-system/src/main/java/cn/iocoder/foodnexus/module/system/service/dept/DeptService.java
+2
-0
foodnexus-module-system/src/main/java/cn/iocoder/foodnexus/module/system/service/dept/DeptServiceImpl.java
+23
-0
No files found.
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/service/purchase/ErpPurchaseOrderServiceImpl.java
View file @
6543ce56
...
...
@@ -380,6 +380,7 @@ public class ErpPurchaseOrderServiceImpl implements ErpPurchaseOrderService {
.
set
(
ErpPurchaseOrderItemDO:
:
getAnnex
,
purchaseOrderItem
.
getAnnex
())
.
eq
(
ErpPurchaseOrderItemDO:
:
getOrderId
,
item
.
getId
())
.
eq
(
ErpPurchaseOrderItemDO:
:
getProductId
,
purchaseOrderItem
.
getProductId
()));
customerOrderApi
.
updatePurchaseAnnex
(
item
.
getCustomerOrderId
(),
item
.
getSupplierId
(),
purchaseOrderItem
.
getProductId
(),
purchaseOrderItem
.
getAnnex
());
});
}
}
...
...
foodnexus-module-mall/foodnexus-module-operations/src/main/java/cn/iocoder/foodnexus/module/operations/controller/admin/customerrequire/CustomerRequireController.java
View file @
6543ce56
...
...
@@ -5,6 +5,11 @@ import cn.iocoder.foodnexus.framework.common.util.collection.MapUtils;
import
cn.iocoder.foodnexus.module.erp.api.service.ErpCustomerApi
;
import
cn.iocoder.foodnexus.module.erp.dal.dataobject.sale.ErpCustomerDO
;
import
cn.iocoder.foodnexus.module.erp.service.sale.ErpCustomerService
;
import
cn.iocoder.foodnexus.module.product.service.category.ProductCategoryService
;
import
cn.iocoder.foodnexus.module.system.dal.dataobject.dept.DeptDO
;
import
cn.iocoder.foodnexus.module.system.dal.dataobject.user.AdminUserDO
;
import
cn.iocoder.foodnexus.module.system.service.dept.DeptService
;
import
cn.iocoder.foodnexus.module.system.service.user.AdminUserService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
jakarta.annotation.Resource
;
...
...
@@ -47,6 +52,15 @@ public class CustomerRequireController {
@Autowired
private
ErpCustomerService
customerService
;
@Autowired
private
ProductCategoryService
productCategoryService
;
@Autowired
private
AdminUserService
userService
;
@Autowired
private
DeptService
deptService
;
@PostMapping
(
"/require"
)
@Operation
(
summary
=
"受理客户需求"
)
@Parameter
(
name
=
"id"
,
description
=
"编号"
,
required
=
true
)
...
...
@@ -80,10 +94,16 @@ public class CustomerRequireController {
public
CommonResult
<
CustomerRequireRespVO
>
getCustomerRequire
(
@RequestParam
(
"id"
)
Long
id
)
{
CustomerRequireDO
customerRequire
=
customerRequireService
.
getCustomerRequire
(
id
);
return
success
(
BeanUtils
.
toBean
(
customerRequire
,
CustomerRequireRespVO
.
class
,
item
->
{
item
.
setCategoryName
(
productCategoryService
.
queryNameById
(
item
.
getCategoryId
()));
AdminUserDO
user
=
userService
.
getUser
(
Long
.
parseLong
(
item
.
getCreator
()));
DeptDO
dept
=
deptService
.
getDept
(
user
.
getDeptId
());
if
(
CommonUtil
.
isNotEmpty
(
dept
))
{
item
.
setDeptName
(
dept
.
getName
());
item
.
setCustomerMobile
(
dept
.
getPhone
());
}
ErpCustomerDO
customer
=
customerService
.
getCustomer
(
item
.
getCustomerId
());
if
(
CommonUtil
.
isNotEmpty
(
customer
))
{
item
.
setCustomerName
(
customer
.
getName
());
item
.
setCustomerMobile
(
customer
.
getMobile
());
}
}));
}
...
...
@@ -94,11 +114,16 @@ public class CustomerRequireController {
public
CommonResult
<
PageResult
<
CustomerRequireRespVO
>>
getCustomerRequirePage
(
@Valid
CustomerRequirePageReqVO
pageReqVO
)
{
PageResult
<
CustomerRequireDO
>
pageResult
=
customerRequireService
.
getCustomerRequirePage
(
pageReqVO
);
Map
<
Long
,
ErpCustomerDO
>
customerMap
=
customerService
.
getCustomerMap
(
CommonUtil
.
listConvertSet
(
pageResult
.
getList
(),
CustomerRequireDO:
:
getCustomerId
));
Map
<
Long
,
DeptDO
>
userDeptMap
=
deptService
.
queryDeptByUserId
(
CommonUtil
.
listConvertSet
(
pageResult
.
getList
(),
item
->
Long
.
parseLong
(
item
.
getCreator
())));
return
success
(
BeanUtils
.
toBean
(
pageResult
,
CustomerRequireRespVO
.
class
,
item
->
{
MapUtils
.
findAndThen
(
customerMap
,
item
.
getCustomerId
(),
customer
->
{
item
.
setCustomerName
(
customer
.
getName
());
item
.
setCustomerMobile
(
customer
.
getMobile
());
});
MapUtils
.
findAndThen
(
userDeptMap
,
Long
.
parseLong
(
item
.
getCreator
()),
dept
->
{
item
.
setDeptName
(
dept
.
getName
());
item
.
setCustomerMobile
(
dept
.
getPhone
());
});
item
.
setCategoryName
(
productCategoryService
.
queryNameById
(
item
.
getCategoryId
()));
}));
}
...
...
foodnexus-module-mall/foodnexus-module-operations/src/main/java/cn/iocoder/foodnexus/module/operations/controller/admin/customerrequire/vo/CustomerRequireRespVO.java
View file @
6543ce56
...
...
@@ -23,6 +23,9 @@ public class CustomerRequireRespVO {
@Schema
(
description
=
"客户名称"
)
private
String
customerName
;
@Schema
(
description
=
"客户单位"
)
private
String
deptName
;
@Schema
(
description
=
"客户联系方式"
)
private
String
customerMobile
;
...
...
foodnexus-module-mall/foodnexus-module-operations/src/main/java/cn/iocoder/foodnexus/module/operations/controller/app/customerrequire/AppCustomerRequireController.java
View file @
6543ce56
...
...
@@ -11,7 +11,9 @@ import cn.iocoder.foodnexus.framework.common.util.object.BeanUtils;
import
cn.iocoder.foodnexus.framework.excel.core.util.ExcelUtils
;
import
cn.iocoder.foodnexus.framework.security.core.util.SecurityFrameworkUtils
;
import
cn.iocoder.foodnexus.module.erp.api.service.ErpCustomerApi
;
import
cn.iocoder.foodnexus.module.erp.dal.dataobject.sale.ErpCustomerDO
;
import
cn.iocoder.foodnexus.module.erp.service.product.ErpProductService
;
import
cn.iocoder.foodnexus.module.erp.service.sale.ErpCustomerService
;
import
cn.iocoder.foodnexus.module.operations.controller.admin.customerrequire.vo.CustomerRequirePageReqVO
;
import
cn.iocoder.foodnexus.module.operations.controller.admin.customerrequire.vo.CustomerRequireRespVO
;
import
cn.iocoder.foodnexus.module.operations.controller.admin.customerrequire.vo.CustomerRequireSaveReqVO
;
...
...
@@ -19,6 +21,10 @@ import cn.iocoder.foodnexus.module.operations.dal.dataobject.customerrequire.Cus
import
cn.iocoder.foodnexus.module.operations.service.customerrequire.CustomerRequireService
;
import
cn.iocoder.foodnexus.module.product.service.category.ProductCategoryService
;
import
cn.iocoder.foodnexus.module.system.annotations.AppSystemAuth
;
import
cn.iocoder.foodnexus.module.system.dal.dataobject.dept.DeptDO
;
import
cn.iocoder.foodnexus.module.system.dal.dataobject.user.AdminUserDO
;
import
cn.iocoder.foodnexus.module.system.service.dept.DeptService
;
import
cn.iocoder.foodnexus.module.system.service.user.AdminUserService
;
import
io.swagger.v3.oas.annotations.Operation
;
import
io.swagger.v3.oas.annotations.Parameter
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
...
...
@@ -51,8 +57,17 @@ public class AppCustomerRequireController {
private
ErpCustomerApi
customerApi
;
@Autowired
private
ErpCustomerService
customerService
;
@Autowired
private
ProductCategoryService
productCategoryService
;
@Autowired
private
AdminUserService
userService
;
@Autowired
private
DeptService
deptService
;
@PostMapping
(
"/create"
)
@Operation
(
summary
=
"创建客户需求"
)
public
CommonResult
<
Long
>
createCustomerRequire
(
@Valid
@RequestBody
CustomerRequireSaveReqVO
createReqVO
)
{
...
...
@@ -74,7 +89,17 @@ public class AppCustomerRequireController {
public
CommonResult
<
CustomerRequireRespVO
>
getCustomerRequire
(
@RequestParam
(
"id"
)
Long
id
)
{
CustomerRequireDO
customerRequire
=
customerRequireService
.
getCustomerRequire
(
id
);
return
success
(
BeanUtils
.
toBean
(
customerRequire
,
CustomerRequireRespVO
.
class
,
item
->
{
item
.
setCategoryName
(
productCategoryService
.
queryNameById
(
customerRequire
.
getCategoryId
()));
item
.
setCategoryName
(
productCategoryService
.
queryNameById
(
item
.
getCategoryId
()));
AdminUserDO
user
=
userService
.
getUser
(
Long
.
parseLong
(
item
.
getCreator
()));
DeptDO
dept
=
deptService
.
getDept
(
user
.
getDeptId
());
if
(
CommonUtil
.
isNotEmpty
(
dept
))
{
item
.
setDeptName
(
dept
.
getName
());
item
.
setCustomerMobile
(
dept
.
getPhone
());
}
ErpCustomerDO
customer
=
customerService
.
getCustomer
(
item
.
getCustomerId
());
if
(
CommonUtil
.
isNotEmpty
(
customer
))
{
item
.
setCustomerName
(
customer
.
getName
());
}
}));
}
...
...
@@ -83,9 +108,17 @@ public class AppCustomerRequireController {
public
CommonResult
<
PageResult
<
CustomerRequireRespVO
>>
getCustomerRequirePage
(
@Valid
CustomerRequirePageReqVO
pageReqVO
)
{
pageReqVO
.
setCreator
(
SecurityFrameworkUtils
.
getLoginUserId
());
PageResult
<
CustomerRequireDO
>
pageResult
=
customerRequireService
.
getCustomerRequirePage
(
pageReqVO
);
Map
<
Long
,
String
>
map
=
productCategoryService
.
getMap
(
CommonUtil
.
listConvertSet
(
pageResult
.
getList
(),
CustomerRequireDO:
:
getCategoryId
));
Map
<
Long
,
ErpCustomerDO
>
customerMap
=
customerService
.
getCustomerMap
(
CommonUtil
.
listConvertSet
(
pageResult
.
getList
(),
CustomerRequireDO:
:
getCustomerId
));
Map
<
Long
,
DeptDO
>
userDeptMap
=
deptService
.
queryDeptByUserId
(
CommonUtil
.
listConvertSet
(
pageResult
.
getList
(),
item
->
Long
.
parseLong
(
item
.
getCreator
())));
return
success
(
BeanUtils
.
toBean
(
pageResult
,
CustomerRequireRespVO
.
class
,
item
->
{
MapUtils
.
findAndThen
(
map
,
item
.
getCategoryId
(),
item:
:
setCategoryName
);
MapUtils
.
findAndThen
(
customerMap
,
item
.
getCustomerId
(),
customer
->
{
item
.
setCustomerName
(
customer
.
getName
());
});
MapUtils
.
findAndThen
(
userDeptMap
,
Long
.
parseLong
(
item
.
getCreator
()),
dept
->
{
item
.
setDeptName
(
dept
.
getName
());
item
.
setCustomerMobile
(
dept
.
getPhone
());
});
item
.
setCategoryName
(
productCategoryService
.
queryNameById
(
item
.
getCategoryId
()));
}));
}
...
...
foodnexus-module-mall/foodnexus-module-order-api/src/main/java/cn/iocoder/foodnexus/module/order/api/CustomerOrderApi.java
View file @
6543ce56
...
...
@@ -31,4 +31,6 @@ public interface CustomerOrderApi {
Map
<
Long
,
String
>
getCodeMap
(
Collection
<
Long
>
longs
);
void
updateActualAmount
(
Long
id
,
int
addAmount
);
void
updatePurchaseAnnex
(
Long
customerOrderId
,
Long
supplierId
,
Long
productId
,
String
annex
);
}
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/controller/admin/checktask/vo/CheckTaskItemsRespVO.java
View file @
6543ce56
...
...
@@ -65,4 +65,6 @@ public class CheckTaskItemsRespVO {
@Schema
(
description
=
"附件"
)
private
String
annex
;
@Schema
(
description
=
"采购附件"
)
private
String
purchaseAnnex
;
}
\ No newline at end of file
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/controller/admin/customerorderitem/vo/CustomerOrderItemRespVO.java
View file @
6543ce56
...
...
@@ -88,4 +88,7 @@ public class CustomerOrderItemRespVO {
@Schema
(
description
=
"客户下单备注"
)
private
String
customerRemark
;
@Schema
(
description
=
"采购附件"
)
private
String
purchaseAnnex
;
}
\ No newline at end of file
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/dal/dataobject/checktaskitems/CheckTaskItemsDO.java
View file @
6543ce56
...
...
@@ -74,4 +74,9 @@ public class CheckTaskItemsDO extends BaseDO {
*/
private
String
annex
;
/**
* 采购附件
*/
private
String
purchaseAnnex
;
}
\ No newline at end of file
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/dal/dataobject/customerorderitem/CustomerOrderItemDO.java
View file @
6543ce56
...
...
@@ -106,4 +106,9 @@ public class CustomerOrderItemDO extends BaseDO {
* 客户下单备注
*/
private
String
customerRemark
;
/**
* 采购附件
*/
private
String
purchaseAnnex
;
}
\ No newline at end of file
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/service/customerorder/CustomerOrderServiceImpl.java
View file @
6543ce56
...
...
@@ -934,4 +934,13 @@ public class CustomerOrderServiceImpl implements CustomerOrderService, CustomerO
}
}
@Override
public
void
updatePurchaseAnnex
(
Long
customerOrderId
,
Long
supplierId
,
Long
productId
,
String
annex
)
{
customerOrderItemMapper
.
update
(
Wrappers
.<
CustomerOrderItemDO
>
lambdaUpdate
()
.
set
(
CustomerOrderItemDO:
:
getPurchaseAnnex
,
annex
)
.
eq
(
CustomerOrderItemDO:
:
getOrderId
,
customerOrderId
)
.
eq
(
CustomerOrderItemDO:
:
getSupplierId
,
supplierId
)
.
eq
(
CustomerOrderItemDO:
:
getProductId
,
productId
));
}
}
\ No newline at end of file
foodnexus-module-system/src/main/java/cn/iocoder/foodnexus/module/system/service/dept/DeptService.java
View file @
6543ce56
...
...
@@ -136,4 +136,6 @@ public interface DeptService {
}
Map
<
Long
,
String
>
queryNameMapByIds
(
Collection
<
Long
>
ids
,
boolean
fullName
);
Map
<
Long
,
DeptDO
>
queryDeptByUserId
(
Collection
<
Long
>
userId
);
}
foodnexus-module-system/src/main/java/cn/iocoder/foodnexus/module/system/service/dept/DeptServiceImpl.java
View file @
6543ce56
...
...
@@ -13,14 +13,17 @@ import cn.iocoder.foodnexus.module.system.controller.admin.dept.vo.dept.DeptList
import
cn.iocoder.foodnexus.module.system.controller.admin.dept.vo.dept.DeptSaveReqVO
;
import
cn.iocoder.foodnexus.module.system.controller.admin.dept.vo.dept.DeptSaveRespVO
;
import
cn.iocoder.foodnexus.module.system.dal.dataobject.dept.DeptDO
;
import
cn.iocoder.foodnexus.module.system.dal.dataobject.user.AdminUserDO
;
import
cn.iocoder.foodnexus.module.system.dal.mysql.dept.DeptMapper
;
import
cn.iocoder.foodnexus.module.system.dal.redis.RedisKeyConstants
;
import
cn.iocoder.foodnexus.framework.common.enums.UserSystemEnum
;
import
cn.iocoder.foodnexus.module.system.service.user.AdminUserService
;
import
com.google.common.annotations.VisibleForTesting
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.cache.annotation.CacheEvict
;
import
org.springframework.cache.annotation.Cacheable
;
import
org.springframework.context.annotation.Lazy
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.validation.annotation.Validated
;
...
...
@@ -51,6 +54,10 @@ public class DeptServiceImpl implements DeptService {
@Autowired
private
ErpCustomerApi
customerApi
;
@Autowired
@Lazy
private
AdminUserService
userService
;
@Override
@CacheEvict
(
cacheNames
=
RedisKeyConstants
.
DEPT_CHILDREN_ID_LIST
,
allEntries
=
true
)
// allEntries 清空所有缓存,因为操作一个部门,涉及到多个缓存
...
...
@@ -320,6 +327,22 @@ public class DeptServiceImpl implements DeptService {
});
}
@Override
public
Map
<
Long
,
DeptDO
>
queryDeptByUserId
(
Collection
<
Long
>
userId
)
{
if
(
CommonUtil
.
isEmpty
(
userId
))
{
return
new
HashMap
<>();
}
List
<
AdminUserDO
>
userList
=
userService
.
getUserList
(
userId
);
if
(
CommonUtil
.
isEmpty
(
userList
))
{
return
new
HashMap
<>();
}
Map
<
Long
,
DeptDO
>
userDeptMap
=
new
HashMap
<>();
userList
.
forEach
(
item
->
{
userDeptMap
.
put
(
item
.
getId
(),
deptMapper
.
selectById
(
item
.
getDeptId
()));
});
return
userDeptMap
;
}
private
String
recursion
(
String
deptName
,
Long
parentId
)
{
if
(
DeptDO
.
PARENT_ID_ROOT
.
equals
(
parentId
)
||
CommonUtil
.
isEmpty
(
parentId
))
{
return
deptName
;
...
...
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