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
2f7230fd
Commit
2f7230fd
authored
Oct 30, 2025
by
杨浩
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
后台调整
parent
e7d23e39
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
247 additions
and
10 deletions
+247
-10
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/controller/admin/purchase/SupplierPurchaseReturnController.java
+161
-0
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/controller/admin/purchase/vo/order/ErpPurchaseOrderPageReqVO.java
+7
-0
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/controller/admin/stock/ErpWarehouseController.java
+21
-3
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/controller/admin/stock/vo/warehouse/ErpWarehouseRespVO.java
+6
-0
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/controller/admin/stock/vo/warehouse/ErpWarehouseSaveReqVO.java
+4
-0
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/dal/dataobject/stock/ErpWarehouseDO.java
+5
-0
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/dal/mysql/purchase/ErpPurchaseOrderMapper.java
+7
-0
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/service/stock/ErpWarehouseService.java
+3
-0
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/service/stock/ErpWarehouseServiceImpl.java
+19
-4
foodnexus-module-mall/foodnexus-module-operations/src/main/java/cn/iocoder/foodnexus/module/operations/controller/app/inquirecustomerpush/vo/AppInquireCustomerPushPageReqVO.java
+5
-1
foodnexus-module-mall/foodnexus-module-operations/src/main/java/cn/iocoder/foodnexus/module/operations/dal/mysql/inquirecustomerpush/InquireCustomerPushMapper.java
+1
-0
foodnexus-module-mall/foodnexus-module-operations/src/main/java/cn/iocoder/foodnexus/module/operations/service/deliverystaff/DeliveryStaffServiceImpl.java
+8
-2
No files found.
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/controller/admin/purchase/SupplierPurchaseReturnController.java
0 → 100644
View file @
2f7230fd
package
cn
.
iocoder
.
foodnexus
.
module
.
erp
.
controller
.
admin
.
purchase
;
import
cn.hutool.core.collection.CollUtil
;
import
cn.iocoder.foodnexus.framework.apilog.core.annotation.ApiAccessLog
;
import
cn.iocoder.foodnexus.framework.common.enums.UserSystemEnum
;
import
cn.iocoder.foodnexus.framework.common.pojo.CommonResult
;
import
cn.iocoder.foodnexus.framework.common.pojo.PageParam
;
import
cn.iocoder.foodnexus.framework.common.pojo.PageResult
;
import
cn.iocoder.foodnexus.framework.common.util.CommonUtil
;
import
cn.iocoder.foodnexus.framework.common.util.collection.MapUtils
;
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.api.service.ErpSupplierApi
;
import
cn.iocoder.foodnexus.module.erp.controller.admin.purchase.vo.returns.ErpPurchaseReturnPageReqVO
;
import
cn.iocoder.foodnexus.module.erp.controller.admin.purchase.vo.returns.ErpPurchaseReturnRespVO
;
import
cn.iocoder.foodnexus.module.erp.dal.dataobject.purchase.ErpPurchaseReturnDO
;
import
cn.iocoder.foodnexus.module.erp.dal.dataobject.purchase.ErpPurchaseReturnItemDO
;
import
cn.iocoder.foodnexus.module.erp.dal.dataobject.purchase.ErpSupplierDO
;
import
cn.iocoder.foodnexus.module.erp.dal.dataobject.stock.ErpStockDO
;
import
cn.iocoder.foodnexus.module.erp.service.purchase.ErpPurchaseReturnService
;
import
cn.iocoder.foodnexus.module.erp.service.purchase.ErpSupplierService
;
import
cn.iocoder.foodnexus.module.erp.service.stock.ErpStockService
;
import
cn.iocoder.foodnexus.module.order.api.CustomerOrderApi
;
import
cn.iocoder.foodnexus.module.order.dto.CustomerOrderDTO
;
import
cn.iocoder.foodnexus.module.product.api.dto.ProductInfo
;
import
cn.iocoder.foodnexus.module.system.annotations.AppSystemAuth
;
import
cn.iocoder.foodnexus.module.system.api.user.AdminUserApi
;
import
cn.iocoder.foodnexus.module.system.api.user.dto.AdminUserRespDTO
;
import
io.swagger.v3.oas.annotations.Operation
;
import
io.swagger.v3.oas.annotations.Parameter
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
jakarta.annotation.Resource
;
import
jakarta.servlet.http.HttpServletResponse
;
import
jakarta.validation.Valid
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
import
java.io.IOException
;
import
java.math.BigDecimal
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Optional
;
import
static
cn
.
iocoder
.
foodnexus
.
framework
.
apilog
.
core
.
enums
.
OperateTypeEnum
.
EXPORT
;
import
static
cn
.
iocoder
.
foodnexus
.
framework
.
common
.
pojo
.
CommonResult
.
success
;
import
static
cn
.
iocoder
.
foodnexus
.
framework
.
common
.
util
.
collection
.
CollectionUtils
.
convertMultiMap
;
import
static
cn
.
iocoder
.
foodnexus
.
framework
.
common
.
util
.
collection
.
CollectionUtils
.
convertSet
;
@Tag
(
name
=
"供应商 - ERP 采购退货"
)
@RestController
@RequestMapping
(
"/supplier/purchase-return"
)
@Validated
@AppSystemAuth
(
UserSystemEnum
.
SUPPLIER
)
public
class
SupplierPurchaseReturnController
{
@Resource
private
ErpPurchaseReturnService
purchaseReturnService
;
@Resource
private
ErpStockService
stockService
;
@Resource
private
ErpSupplierService
supplierService
;
@Resource
private
AdminUserApi
adminUserApi
;
@Autowired
private
CustomerOrderApi
customerOrderApi
;
@Autowired
private
ErpCustomerApi
customerApi
;
@Autowired
private
ErpSupplierApi
supplierApi
;
@DeleteMapping
(
"/delete"
)
@Operation
(
summary
=
"删除采购退货"
)
@Parameter
(
name
=
"ids"
,
description
=
"编号数组"
,
required
=
true
)
@PreAuthorize
(
"@ss.hasPermission('erp:purchase-return:delete')"
)
public
CommonResult
<
Boolean
>
deletePurchaseReturn
(
@RequestParam
(
"ids"
)
List
<
Long
>
ids
)
{
purchaseReturnService
.
deletePurchaseReturn
(
ids
);
return
success
(
true
);
}
@GetMapping
(
"/get"
)
@Operation
(
summary
=
"获得采购退货"
)
@Parameter
(
name
=
"id"
,
description
=
"编号"
,
required
=
true
,
example
=
"1024"
)
@PreAuthorize
(
"@ss.hasPermission('erp:purchase-return:query')"
)
public
CommonResult
<
ErpPurchaseReturnRespVO
>
getPurchaseReturn
(
@RequestParam
(
"id"
)
Long
id
)
{
ErpPurchaseReturnDO
purchaseReturn
=
purchaseReturnService
.
getPurchaseReturn
(
id
);
if
(
purchaseReturn
==
null
)
{
return
success
(
null
);
}
List
<
ErpPurchaseReturnItemDO
>
purchaseReturnItemList
=
purchaseReturnService
.
getPurchaseReturnItemListByReturnId
(
id
);
return
success
(
BeanUtils
.
toBean
(
purchaseReturn
,
ErpPurchaseReturnRespVO
.
class
,
purchaseReturnVO
->{
String
supplierName
=
Optional
.
ofNullable
(
supplierService
.
getSupplier
(
purchaseReturnVO
.
getSupplierId
())).
map
(
ErpSupplierDO:
:
getName
).
orElse
(
""
);
String
orderCode
=
Optional
.
ofNullable
(
customerOrderApi
.
queryById
(
purchaseReturnVO
.
getCustomerOrderId
())).
map
(
CustomerOrderDTO:
:
getCode
).
orElse
(
""
);
purchaseReturnVO
.
setSupplierName
(
supplierName
);
purchaseReturnVO
.
setCustomerOrderCode
(
orderCode
);
purchaseReturnVO
.
setItems
(
BeanUtils
.
toBean
(
purchaseReturnItemList
,
ErpPurchaseReturnRespVO
.
Item
.
class
,
item
->
{
ErpStockDO
stock
=
stockService
.
getStock
(
item
.
getProductId
(),
item
.
getWarehouseId
());
item
.
setStockCount
(
stock
!=
null
?
stock
.
getCount
()
:
BigDecimal
.
ZERO
);
}));
}));
}
@GetMapping
(
"/page"
)
@Operation
(
summary
=
"获得采购退货分页"
)
@PreAuthorize
(
"@ss.hasPermission('erp:purchase-return:query')"
)
public
CommonResult
<
PageResult
<
ErpPurchaseReturnRespVO
>>
getPurchaseReturnPage
(
@Valid
ErpPurchaseReturnPageReqVO
pageReqVO
)
{
pageReqVO
.
setSupplierId
(
supplierApi
.
querySupplierIdByUserId
(
SecurityFrameworkUtils
.
getLoginUserId
()));
PageResult
<
ErpPurchaseReturnDO
>
pageResult
=
purchaseReturnService
.
getPurchaseReturnPage
(
pageReqVO
);
return
success
(
buildPurchaseReturnVOPageResult
(
pageResult
));
}
@GetMapping
(
"/export-excel"
)
@Operation
(
summary
=
"导出采购退货 Excel"
)
@PreAuthorize
(
"@ss.hasPermission('erp:purchase-return:export')"
)
@ApiAccessLog
(
operateType
=
EXPORT
)
public
void
exportPurchaseReturnExcel
(
@Valid
ErpPurchaseReturnPageReqVO
pageReqVO
,
HttpServletResponse
response
)
throws
IOException
{
pageReqVO
.
setPageSize
(
PageParam
.
PAGE_SIZE_NONE
);
pageReqVO
.
setSupplierId
(
supplierApi
.
querySupplierIdByUserId
(
SecurityFrameworkUtils
.
getLoginUserId
()));
List
<
ErpPurchaseReturnRespVO
>
list
=
buildPurchaseReturnVOPageResult
(
purchaseReturnService
.
getPurchaseReturnPage
(
pageReqVO
)).
getList
();
// 导出 Excel
ExcelUtils
.
write
(
response
,
"采购退货.xls"
,
"数据"
,
ErpPurchaseReturnRespVO
.
class
,
list
);
}
private
PageResult
<
ErpPurchaseReturnRespVO
>
buildPurchaseReturnVOPageResult
(
PageResult
<
ErpPurchaseReturnDO
>
pageResult
)
{
if
(
CollUtil
.
isEmpty
(
pageResult
.
getList
()))
{
return
PageResult
.
empty
(
pageResult
.
getTotal
());
}
// 1.1 退货项
List
<
ErpPurchaseReturnItemDO
>
purchaseReturnItemList
=
purchaseReturnService
.
getPurchaseReturnItemListByReturnIds
(
convertSet
(
pageResult
.
getList
(),
ErpPurchaseReturnDO:
:
getId
));
Map
<
Long
,
List
<
ErpPurchaseReturnItemDO
>>
purchaseReturnItemMap
=
convertMultiMap
(
purchaseReturnItemList
,
ErpPurchaseReturnItemDO:
:
getReturnId
);
// 1.3 供应商信息
Map
<
Long
,
ErpSupplierDO
>
supplierMap
=
supplierService
.
getSupplierMap
(
convertSet
(
pageResult
.
getList
(),
ErpPurchaseReturnDO:
:
getSupplierId
));
// 1.4 管理员信息
Map
<
Long
,
AdminUserRespDTO
>
userMap
=
adminUserApi
.
getUserMap
(
convertSet
(
pageResult
.
getList
(),
purchaseReturn
->
Long
.
parseLong
(
purchaseReturn
.
getCreator
())));
Map
<
Long
,
String
>
customerOrderCodeMap
=
customerOrderApi
.
getCodeMap
(
CommonUtil
.
listConvert
(
pageResult
.
getList
(),
ErpPurchaseReturnDO:
:
getCustomerOrderId
));
Map
<
Long
,
String
>
customerNameMap
=
customerApi
.
queryNameMapByIds
(
CommonUtil
.
listConvertSet
(
pageResult
.
getList
(),
ErpPurchaseReturnDO:
:
getCustomerId
));
// 2. 开始拼接
return
BeanUtils
.
toBean
(
pageResult
,
ErpPurchaseReturnRespVO
.
class
,
purchaseReturn
->
{
purchaseReturn
.
setItems
(
BeanUtils
.
toBean
(
purchaseReturnItemMap
.
get
(
purchaseReturn
.
getId
()),
ErpPurchaseReturnRespVO
.
Item
.
class
));
purchaseReturn
.
setProductNames
(
CollUtil
.
join
(
purchaseReturn
.
getItems
(),
","
,
item
->
Optional
.
ofNullable
(
item
.
getProductInfo
()).
map
(
ProductInfo:
:
getName
).
orElse
(
""
)));
MapUtils
.
findAndThen
(
supplierMap
,
purchaseReturn
.
getSupplierId
(),
supplier
->
purchaseReturn
.
setSupplierName
(
supplier
.
getName
()));
MapUtils
.
findAndThen
(
userMap
,
Long
.
parseLong
(
purchaseReturn
.
getCreator
()),
user
->
purchaseReturn
.
setCreatorName
(
user
.
getNickname
()));
MapUtils
.
findAndThen
(
customerOrderCodeMap
,
purchaseReturn
.
getCustomerOrderId
(),
purchaseReturn:
:
setCustomerOrderCode
);
MapUtils
.
findAndThen
(
customerNameMap
,
purchaseReturn
.
getCustomerId
(),
purchaseReturn:
:
setCustomerName
);
});
}
}
\ No newline at end of file
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/controller/admin/purchase/vo/order/ErpPurchaseOrderPageReqVO.java
View file @
2f7230fd
...
@@ -94,4 +94,10 @@ public class ErpPurchaseOrderPageReqVO extends PageParam {
...
@@ -94,4 +94,10 @@ public class ErpPurchaseOrderPageReqVO extends PageParam {
@Schema
(
description
=
"配送模式"
)
@Schema
(
description
=
"配送模式"
)
private
DeliveryMode
deliveryMode
;
private
DeliveryMode
deliveryMode
;
@Schema
(
description
=
"客户订单id"
)
private
Long
customerOrderId
;
@Schema
(
description
=
"客户名称"
)
private
String
customerName
;
}
}
\ No newline at end of file
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/controller/admin/stock/ErpWarehouseController.java
View file @
2f7230fd
...
@@ -5,6 +5,8 @@ import cn.iocoder.foodnexus.framework.common.enums.CommonStatusEnum;
...
@@ -5,6 +5,8 @@ import cn.iocoder.foodnexus.framework.common.enums.CommonStatusEnum;
import
cn.iocoder.foodnexus.framework.common.pojo.CommonResult
;
import
cn.iocoder.foodnexus.framework.common.pojo.CommonResult
;
import
cn.iocoder.foodnexus.framework.common.pojo.PageParam
;
import
cn.iocoder.foodnexus.framework.common.pojo.PageParam
;
import
cn.iocoder.foodnexus.framework.common.pojo.PageResult
;
import
cn.iocoder.foodnexus.framework.common.pojo.PageResult
;
import
cn.iocoder.foodnexus.framework.common.util.CommonUtil
;
import
cn.iocoder.foodnexus.framework.common.util.collection.MapUtils
;
import
cn.iocoder.foodnexus.framework.common.util.object.BeanUtils
;
import
cn.iocoder.foodnexus.framework.common.util.object.BeanUtils
;
import
cn.iocoder.foodnexus.framework.excel.core.util.ExcelUtils
;
import
cn.iocoder.foodnexus.framework.excel.core.util.ExcelUtils
;
import
cn.iocoder.foodnexus.module.erp.controller.admin.stock.vo.warehouse.ErpWarehousePageReqVO
;
import
cn.iocoder.foodnexus.module.erp.controller.admin.stock.vo.warehouse.ErpWarehousePageReqVO
;
...
@@ -25,6 +27,9 @@ import org.springframework.web.bind.annotation.*;
...
@@ -25,6 +27,9 @@ import org.springframework.web.bind.annotation.*;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Objects
;
import
java.util.Optional
;
import
static
cn
.
iocoder
.
foodnexus
.
framework
.
apilog
.
core
.
enums
.
OperateTypeEnum
.
EXPORT
;
import
static
cn
.
iocoder
.
foodnexus
.
framework
.
apilog
.
core
.
enums
.
OperateTypeEnum
.
EXPORT
;
import
static
cn
.
iocoder
.
foodnexus
.
framework
.
common
.
pojo
.
CommonResult
.
success
;
import
static
cn
.
iocoder
.
foodnexus
.
framework
.
common
.
pojo
.
CommonResult
.
success
;
...
@@ -81,7 +86,13 @@ public class ErpWarehouseController {
...
@@ -81,7 +86,13 @@ public class ErpWarehouseController {
@PreAuthorize
(
"@ss.hasPermission('erp:warehouse:query')"
)
@PreAuthorize
(
"@ss.hasPermission('erp:warehouse:query')"
)
public
CommonResult
<
ErpWarehouseRespVO
>
getWarehouse
(
@RequestParam
(
"id"
)
Long
id
)
{
public
CommonResult
<
ErpWarehouseRespVO
>
getWarehouse
(
@RequestParam
(
"id"
)
Long
id
)
{
ErpWarehouseDO
warehouse
=
warehouseService
.
getWarehouse
(
id
);
ErpWarehouseDO
warehouse
=
warehouseService
.
getWarehouse
(
id
);
return
success
(
BeanUtils
.
toBean
(
warehouse
,
ErpWarehouseRespVO
.
class
));
return
success
(
BeanUtils
.
toBean
(
warehouse
,
ErpWarehouseRespVO
.
class
,
item
->
{
if
(!
Objects
.
equals
(
item
.
getParentId
(),
ErpWarehouseDO
.
PARENT_ID_ROOT
))
{
item
.
setParentName
(
""
);
}
else
{
item
.
setParentName
(
Optional
.
ofNullable
(
warehouseService
.
getWarehouse
(
item
.
getParentId
())).
map
(
ErpWarehouseDO:
:
getName
).
orElse
(
""
));
}
}));
}
}
@GetMapping
(
"/list-by-ids"
)
@GetMapping
(
"/list-by-ids"
)
...
@@ -89,7 +100,11 @@ public class ErpWarehouseController {
...
@@ -89,7 +100,11 @@ public class ErpWarehouseController {
@Parameter
(
name
=
"ids"
,
description
=
"编号"
,
required
=
true
)
@Parameter
(
name
=
"ids"
,
description
=
"编号"
,
required
=
true
)
@PreAuthorize
(
"@ss.hasPermission('erp:warehouse:query')"
)
@PreAuthorize
(
"@ss.hasPermission('erp:warehouse:query')"
)
public
CommonResult
<
List
<
ErpWarehouseRespVO
>>
getWarehouse
(
@RequestParam
(
"ids"
)
List
<
Long
>
ids
)
{
public
CommonResult
<
List
<
ErpWarehouseRespVO
>>
getWarehouse
(
@RequestParam
(
"ids"
)
List
<
Long
>
ids
)
{
return
success
(
BeanUtils
.
toBean
(
warehouseService
.
getWarehouseList
(
ids
),
ErpWarehouseRespVO
.
class
));
List
<
ErpWarehouseDO
>
warehouseList
=
warehouseService
.
getWarehouseList
(
ids
);
Map
<
Long
,
String
>
nameMap
=
warehouseService
.
queryNameByIds
(
CommonUtil
.
listConvertSet
(
warehouseList
,
ErpWarehouseDO:
:
getId
));
return
success
(
BeanUtils
.
toBean
(
warehouseList
,
ErpWarehouseRespVO
.
class
,
item
->
{
MapUtils
.
findAndThen
(
nameMap
,
item
.
getParentId
(),
item:
:
setParentName
);
}));
}
}
@GetMapping
(
"/page"
)
@GetMapping
(
"/page"
)
...
@@ -97,7 +112,10 @@ public class ErpWarehouseController {
...
@@ -97,7 +112,10 @@ public class ErpWarehouseController {
@PreAuthorize
(
"@ss.hasPermission('erp:warehouse:query')"
)
@PreAuthorize
(
"@ss.hasPermission('erp:warehouse:query')"
)
public
CommonResult
<
PageResult
<
ErpWarehouseRespVO
>>
getWarehousePage
(
@Valid
ErpWarehousePageReqVO
pageReqVO
)
{
public
CommonResult
<
PageResult
<
ErpWarehouseRespVO
>>
getWarehousePage
(
@Valid
ErpWarehousePageReqVO
pageReqVO
)
{
PageResult
<
ErpWarehouseDO
>
pageResult
=
warehouseService
.
getWarehousePage
(
pageReqVO
);
PageResult
<
ErpWarehouseDO
>
pageResult
=
warehouseService
.
getWarehousePage
(
pageReqVO
);
return
success
(
BeanUtils
.
toBean
(
pageResult
,
ErpWarehouseRespVO
.
class
));
Map
<
Long
,
String
>
nameMap
=
warehouseService
.
queryNameByIds
(
CommonUtil
.
listConvertSet
(
pageResult
.
getList
(),
ErpWarehouseDO:
:
getId
));
return
success
(
BeanUtils
.
toBean
(
pageResult
,
ErpWarehouseRespVO
.
class
,
item
->
{
MapUtils
.
findAndThen
(
nameMap
,
item
.
getParentId
(),
item:
:
setParentName
);
}));
}
}
@GetMapping
(
"/simple-list"
)
@GetMapping
(
"/simple-list"
)
...
...
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/controller/admin/stock/vo/warehouse/ErpWarehouseRespVO.java
View file @
2f7230fd
...
@@ -76,5 +76,11 @@ public class ErpWarehouseRespVO {
...
@@ -76,5 +76,11 @@ public class ErpWarehouseRespVO {
@Schema
(
description
=
"库区所属仓库id, level=warehouse为0"
,
requiredMode
=
Schema
.
RequiredMode
.
REQUIRED
,
example
=
"0"
)
@Schema
(
description
=
"库区所属仓库id, level=warehouse为0"
,
requiredMode
=
Schema
.
RequiredMode
.
REQUIRED
,
example
=
"0"
)
private
Long
parentId
;
private
Long
parentId
;
@Schema
(
description
=
"库区所属仓库id"
)
private
String
parentName
;
@Schema
(
description
=
"面积"
)
private
String
area
;
}
}
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/controller/admin/stock/vo/warehouse/ErpWarehouseSaveReqVO.java
View file @
2f7230fd
...
@@ -58,4 +58,7 @@ public class ErpWarehouseSaveReqVO {
...
@@ -58,4 +58,7 @@ public class ErpWarehouseSaveReqVO {
@NotNull
(
message
=
"库区所属仓库id不能为空"
)
@NotNull
(
message
=
"库区所属仓库id不能为空"
)
private
Long
parentId
;
private
Long
parentId
;
@Schema
(
description
=
"面积"
)
private
String
area
;
}
}
\ No newline at end of file
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/dal/dataobject/stock/ErpWarehouseDO.java
View file @
2f7230fd
...
@@ -84,5 +84,9 @@ public class ErpWarehouseDO extends BaseDO {
...
@@ -84,5 +84,9 @@ public class ErpWarehouseDO extends BaseDO {
* 库区所属仓库id
* 库区所属仓库id
*/
*/
private
Long
parentId
;
private
Long
parentId
;
/**
* 面积
*/
private
String
area
;
}
}
\ No newline at end of file
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/dal/mysql/purchase/ErpPurchaseOrderMapper.java
View file @
2f7230fd
...
@@ -54,6 +54,7 @@ public interface ErpPurchaseOrderMapper extends BaseMapperX<ErpPurchaseOrderDO>
...
@@ -54,6 +54,7 @@ public interface ErpPurchaseOrderMapper extends BaseMapperX<ErpPurchaseOrderDO>
.
likeIfPresent
(
ErpPurchaseOrderDO:
:
getRemark
,
reqVO
.
getRemark
())
.
likeIfPresent
(
ErpPurchaseOrderDO:
:
getRemark
,
reqVO
.
getRemark
())
.
eqIfPresent
(
ErpPurchaseOrderDO:
:
getCreator
,
reqVO
.
getCreator
())
.
eqIfPresent
(
ErpPurchaseOrderDO:
:
getCreator
,
reqVO
.
getCreator
())
.
inIfPresent
(
ErpPurchaseOrderDO:
:
getDeliveryStatus
,
reqVO
.
getDeliveryStatus
())
.
inIfPresent
(
ErpPurchaseOrderDO:
:
getDeliveryStatus
,
reqVO
.
getDeliveryStatus
())
.
eqIfPresent
(
ErpPurchaseOrderDO:
:
getCustomerOrderId
,
reqVO
.
getCustomerOrderId
())
.
orderByDesc
(
ErpPurchaseOrderDO:
:
getId
);
.
orderByDesc
(
ErpPurchaseOrderDO:
:
getId
);
// 入库状态。为什么需要 t. 的原因,是因为联表查询时,需要指定表名,不然会报 in_count 错误
// 入库状态。为什么需要 t. 的原因,是因为联表查询时,需要指定表名,不然会报 in_count 错误
if
(
Objects
.
equals
(
reqVO
.
getInStatus
(),
ErpPurchaseOrderPageReqVO
.
IN_STATUS_NONE
))
{
if
(
Objects
.
equals
(
reqVO
.
getInStatus
(),
ErpPurchaseOrderPageReqVO
.
IN_STATUS_NONE
))
{
...
@@ -103,6 +104,12 @@ public interface ErpPurchaseOrderMapper extends BaseMapperX<ErpPurchaseOrderDO>
...
@@ -103,6 +104,12 @@ public interface ErpPurchaseOrderMapper extends BaseMapperX<ErpPurchaseOrderDO>
query
.
ge
(
ErpPurchaseOrderDO:
:
getCreateTime
,
startOfMonth
)
query
.
ge
(
ErpPurchaseOrderDO:
:
getCreateTime
,
startOfMonth
)
.
lt
(
ErpPurchaseOrderDO:
:
getCreateTime
,
endOfMonth
);
.
lt
(
ErpPurchaseOrderDO:
:
getCreateTime
,
endOfMonth
);
}
}
if
(
CommonUtil
.
isNotBlank
(
reqVO
.
getCustomerName
()))
{
query
.
leftJoin
(
"order_customer_order oco on oco.id = t.customer_order_id"
);
query
.
leftJoin
(
"erp_customer ec on ec.id = oco.customer_id"
);
query
.
like
(
"ec.`name`"
,
reqVO
.
getCustomerName
());
query
.
groupBy
(
ErpPurchaseOrderDO:
:
getId
);
}
return
query
;
return
query
;
}
}
...
...
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/service/stock/ErpWarehouseService.java
View file @
2f7230fd
...
@@ -9,6 +9,7 @@ import jakarta.validation.Valid;
...
@@ -9,6 +9,7 @@ import jakarta.validation.Valid;
import
java.util.Collection
;
import
java.util.Collection
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.Set
;
import
static
cn
.
iocoder
.
foodnexus
.
framework
.
common
.
util
.
collection
.
CollectionUtils
.
convertMap
;
import
static
cn
.
iocoder
.
foodnexus
.
framework
.
common
.
util
.
collection
.
CollectionUtils
.
convertMap
;
...
@@ -99,4 +100,5 @@ public interface ErpWarehouseService {
...
@@ -99,4 +100,5 @@ public interface ErpWarehouseService {
*/
*/
PageResult
<
ErpWarehouseDO
>
getWarehousePage
(
ErpWarehousePageReqVO
pageReqVO
);
PageResult
<
ErpWarehouseDO
>
getWarehousePage
(
ErpWarehousePageReqVO
pageReqVO
);
Map
<
Long
,
String
>
queryNameByIds
(
Collection
<
Long
>
longs
);
}
}
\ No newline at end of file
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/service/stock/ErpWarehouseServiceImpl.java
View file @
2f7230fd
...
@@ -17,10 +17,8 @@ import org.springframework.stereotype.Service;
...
@@ -17,10 +17,8 @@ import org.springframework.stereotype.Service;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.validation.annotation.Validated
;
import
java.util.Collection
;
import
java.util.*
;
import
java.util.Collections
;
import
java.util.stream.Collectors
;
import
java.util.List
;
import
java.util.Map
;
import
static
cn
.
iocoder
.
foodnexus
.
framework
.
common
.
exception
.
util
.
ServiceExceptionUtil
.
exception
;
import
static
cn
.
iocoder
.
foodnexus
.
framework
.
common
.
exception
.
util
.
ServiceExceptionUtil
.
exception
;
import
static
cn
.
iocoder
.
foodnexus
.
framework
.
common
.
util
.
collection
.
CollectionUtils
.
convertMap
;
import
static
cn
.
iocoder
.
foodnexus
.
framework
.
common
.
util
.
collection
.
CollectionUtils
.
convertMap
;
...
@@ -127,6 +125,23 @@ public class ErpWarehouseServiceImpl implements ErpWarehouseService, ErpWarehous
...
@@ -127,6 +125,23 @@ public class ErpWarehouseServiceImpl implements ErpWarehouseService, ErpWarehous
}
}
@Override
@Override
public
Map
<
Long
,
String
>
queryNameByIds
(
Collection
<
Long
>
ids
)
{
if
(
CollUtil
.
isEmpty
(
ids
))
{
return
new
HashMap
<>();
}
Map
<
Long
,
String
>
rootMap
=
new
HashMap
<>();
rootMap
.
put
(
ErpWarehouseDO
.
PARENT_ID_ROOT
,
""
);
List
<
Long
>
collect
=
ids
.
stream
().
filter
(
id
->
!
Objects
.
equals
(
id
,
ErpWarehouseDO
.
PARENT_ID_ROOT
)).
toList
();
if
(
CommonUtil
.
isEmpty
(
collect
))
{
return
rootMap
;
}
List
<
ErpWarehouseDO
>
erpWarehouseDOS
=
warehouseMapper
.
selectByIds
(
collect
);
Map
<
Long
,
String
>
result
=
CommonUtil
.
listConvertMap
(
erpWarehouseDOS
,
ErpWarehouseDO:
:
getId
,
ErpWarehouseDO:
:
getName
);
result
.
putAll
(
rootMap
);
return
result
;
}
@Override
public
boolean
existsById
(
Long
warehouseId
)
{
public
boolean
existsById
(
Long
warehouseId
)
{
return
warehouseMapper
.
exists
(
Wrappers
.<
ErpWarehouseDO
>
lambdaQuery
()
return
warehouseMapper
.
exists
(
Wrappers
.<
ErpWarehouseDO
>
lambdaQuery
()
.
eq
(
ErpWarehouseDO:
:
getId
,
warehouseId
)
.
eq
(
ErpWarehouseDO:
:
getId
,
warehouseId
)
...
...
foodnexus-module-mall/foodnexus-module-operations/src/main/java/cn/iocoder/foodnexus/module/operations/controller/app/inquirecustomerpush/vo/AppInquireCustomerPushPageReqVO.java
View file @
2f7230fd
...
@@ -34,7 +34,10 @@ public class AppInquireCustomerPushPageReqVO extends PageParam {
...
@@ -34,7 +34,10 @@ public class AppInquireCustomerPushPageReqVO extends PageParam {
private
LocalDateTime
[]
createTime
;
private
LocalDateTime
[]
createTime
;
@Schema
(
description
=
"询价年月"
)
@Schema
(
description
=
"询价年月
yyyy-MM
"
)
private
String
inquiryYearMonth
;
private
String
inquiryYearMonth
;
@Schema
(
description
=
"询价年份 yyyy"
)
private
String
inquireYear
;
}
}
\ No newline at end of file
foodnexus-module-mall/foodnexus-module-operations/src/main/java/cn/iocoder/foodnexus/module/operations/dal/mysql/inquirecustomerpush/InquireCustomerPushMapper.java
View file @
2f7230fd
...
@@ -52,6 +52,7 @@ public interface InquireCustomerPushMapper extends BaseMapperX<InquireCustomerPu
...
@@ -52,6 +52,7 @@ public interface InquireCustomerPushMapper extends BaseMapperX<InquireCustomerPu
wrapperX
.
between
(
InquireCustomerPushDO:
:
getCreateTime
,
reqVO
.
getCreateTime
()[
0
],
reqVO
.
getCreateTime
()[
1
]);
wrapperX
.
between
(
InquireCustomerPushDO:
:
getCreateTime
,
reqVO
.
getCreateTime
()[
0
],
reqVO
.
getCreateTime
()[
1
]);
}
}
wrapperX
.
eqIfExists
(
InquirePriceDO:
:
getInquiryYearMonth
,
reqVO
.
getInquiryYearMonth
());
wrapperX
.
eqIfExists
(
InquirePriceDO:
:
getInquiryYearMonth
,
reqVO
.
getInquiryYearMonth
());
wrapperX
.
likeRightIfExists
(
InquirePriceDO:
:
getInquiryYearMonth
,
reqVO
.
getInquireYear
());
wrapperX
.
groupBy
(
InquireCustomerPushDO:
:
getId
);
wrapperX
.
groupBy
(
InquireCustomerPushDO:
:
getId
);
wrapperX
.
orderByDesc
(
InquireCustomerPushDO:
:
getId
);
wrapperX
.
orderByDesc
(
InquireCustomerPushDO:
:
getId
);
return
selectJoinPage
(
reqVO
,
AppInquireCustomerPushRespVO
.
class
,
wrapperX
);
return
selectJoinPage
(
reqVO
,
AppInquireCustomerPushRespVO
.
class
,
wrapperX
);
...
...
foodnexus-module-mall/foodnexus-module-operations/src/main/java/cn/iocoder/foodnexus/module/operations/service/deliverystaff/DeliveryStaffServiceImpl.java
View file @
2f7230fd
...
@@ -151,9 +151,12 @@ public class DeliveryStaffServiceImpl implements DeliveryStaffService, DeliveryS
...
@@ -151,9 +151,12 @@ public class DeliveryStaffServiceImpl implements DeliveryStaffService, DeliveryS
}
}
@Override
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
bindCustomer
(
DeliveryStaffBindCustomerReqVO
updateReqVO
)
{
public
void
bindCustomer
(
DeliveryStaffBindCustomerReqVO
updateReqVO
)
{
validateDeliveryStaffExists
(
updateReqVO
.
getStaffId
());
validateDeliveryStaffExists
(
updateReqVO
.
getStaffId
());
deliveryStaffCustomerMapper
.
delete
(
DeliveryStaffCustomerDO:
:
getDeliveryStaffId
,
updateReqVO
.
getStaffId
());
deliveryStaffCustomerMapper
.
delete
(
Wrappers
.<
DeliveryStaffCustomerDO
>
lambdaQuery
()
.
eq
(
DeliveryStaffCustomerDO:
:
getDeliveryStaffId
,
updateReqVO
.
getStaffId
())
.
eq
(
DeliveryStaffCustomerDO:
:
getIsDept
,
Boolean
.
FALSE
));
if
(
CommonUtil
.
isNotEmpty
(
updateReqVO
.
getCustomerIdList
()))
{
if
(
CommonUtil
.
isNotEmpty
(
updateReqVO
.
getCustomerIdList
()))
{
List
<
DeliveryStaffCustomerDO
>
deliveryStaffCustomerDOS
=
CommonUtil
.
listConvert
(
updateReqVO
.
getCustomerIdList
(),
customer
->
{
List
<
DeliveryStaffCustomerDO
>
deliveryStaffCustomerDOS
=
CommonUtil
.
listConvert
(
updateReqVO
.
getCustomerIdList
(),
customer
->
{
DeliveryStaffCustomerDO
deliveryStaffCustomerDO
=
new
DeliveryStaffCustomerDO
();
DeliveryStaffCustomerDO
deliveryStaffCustomerDO
=
new
DeliveryStaffCustomerDO
();
...
@@ -181,9 +184,12 @@ public class DeliveryStaffServiceImpl implements DeliveryStaffService, DeliveryS
...
@@ -181,9 +184,12 @@ public class DeliveryStaffServiceImpl implements DeliveryStaffService, DeliveryS
}
}
@Override
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
bindDept
(
DeliveryStaffBindDeptReqVO
updateReqVO
)
{
public
void
bindDept
(
DeliveryStaffBindDeptReqVO
updateReqVO
)
{
validateDeliveryStaffExists
(
updateReqVO
.
getStaffId
());
validateDeliveryStaffExists
(
updateReqVO
.
getStaffId
());
deliveryStaffCustomerMapper
.
delete
(
DeliveryStaffCustomerDO:
:
getDeliveryStaffId
,
updateReqVO
.
getStaffId
());
deliveryStaffCustomerMapper
.
delete
(
Wrappers
.<
DeliveryStaffCustomerDO
>
lambdaQuery
()
.
eq
(
DeliveryStaffCustomerDO:
:
getDeliveryStaffId
,
updateReqVO
.
getStaffId
())
.
eq
(
DeliveryStaffCustomerDO:
:
getIsDept
,
Boolean
.
TRUE
));
if
(
CommonUtil
.
isNotEmpty
(
updateReqVO
.
getDeptIdList
()))
{
if
(
CommonUtil
.
isNotEmpty
(
updateReqVO
.
getDeptIdList
()))
{
List
<
DeliveryStaffCustomerDO
>
deliveryStaffCustomerDOS
=
CommonUtil
.
listConvert
(
updateReqVO
.
getDeptIdList
(),
deptId
->
{
List
<
DeliveryStaffCustomerDO
>
deliveryStaffCustomerDOS
=
CommonUtil
.
listConvert
(
updateReqVO
.
getDeptIdList
(),
deptId
->
{
DeliveryStaffCustomerDO
deliveryStaffCustomerDO
=
new
DeliveryStaffCustomerDO
();
DeliveryStaffCustomerDO
deliveryStaffCustomerDO
=
new
DeliveryStaffCustomerDO
();
...
...
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