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
c5b64606
Commit
c5b64606
authored
Sep 26, 2025
by
杨浩
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug调整
parent
9d633d1d
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
83 additions
and
26 deletions
+83
-26
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/controller/admin/sale/vo/order/ErpSaleOrderRespVO.java
+2
-2
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/controller/admin/sale/vo/order/ErpSaleOrderSaveReqVO.java
+2
-2
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/dal/dataobject/purchase/ErpPurchaseOrderItemDO.java
+2
-1
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/dal/dataobject/sale/ErpSaleOrderDO.java
+3
-2
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/service/purchase/ErpPurchaseOrderServiceImpl.java
+4
-1
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/controller/admin/customerorder/vo/CustomerOrderPageReqVO.java
+2
-2
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/controller/app/customerOrder/vo/AppCustomerOrderItemSaveReqVO.java
+2
-1
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/controller/app/customerOrder/vo/AppCustomerOrderSaveReqVO.java
+1
-2
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/controller/app/customeraddress/CustomerAddressController.java
+9
-5
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/dal/dataobject/customerorder/CustomerOrderDO.java
+6
-5
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/dal/dataobject/customerorderitem/CustomerOrderItemDO.java
+2
-2
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/service/checktask/CheckTaskServiceImpl.java
+2
-1
foodnexus-module-system/src/main/java/cn/iocoder/foodnexus/module/system/controller/app/province/AppProvinceController.java
+46
-0
No files found.
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/controller/admin/sale/vo/order/ErpSaleOrderRespVO.java
View file @
c5b64606
...
...
@@ -5,7 +5,7 @@ import cn.idev.excel.annotation.ExcelProperty;
import
cn.iocoder.foodnexus.module.order.dto.CustomerAddressInfo
;
import
cn.iocoder.foodnexus.module.order.enums.DeliveryMode
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.extension.handlers.
Fastjson2
TypeHandler
;
import
com.baomidou.mybatisplus.extension.handlers.
Jackson
TypeHandler
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
jakarta.validation.constraints.NotNull
;
import
lombok.Data
;
...
...
@@ -120,7 +120,7 @@ public class ErpSaleOrderRespVO {
private
Long
addressId
;
@Schema
(
description
=
"客户收货地址info"
)
@TableField
(
typeHandler
=
Fastjson2
TypeHandler
.
class
)
@TableField
(
typeHandler
=
Jackson
TypeHandler
.
class
)
private
CustomerAddressInfo
addressInfo
;
@Data
...
...
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/controller/admin/sale/vo/order/ErpSaleOrderSaveReqVO.java
View file @
c5b64606
...
...
@@ -3,7 +3,7 @@ package cn.iocoder.foodnexus.module.erp.controller.admin.sale.vo.order;
import
cn.iocoder.foodnexus.module.order.dto.CustomerAddressInfo
;
import
cn.iocoder.foodnexus.module.order.enums.DeliveryMode
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.extension.handlers.
Fastjson2
TypeHandler
;
import
com.baomidou.mybatisplus.extension.handlers.
Jackson
TypeHandler
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
jakarta.validation.constraints.NotNull
;
import
lombok.Data
;
...
...
@@ -62,7 +62,7 @@ public class ErpSaleOrderSaveReqVO {
private
Long
addressId
;
@Schema
(
description
=
"客户收货地址info"
)
@TableField
(
typeHandler
=
Fastjson2
TypeHandler
.
class
)
@TableField
(
typeHandler
=
Jackson
TypeHandler
.
class
)
private
CustomerAddressInfo
addressInfo
;
@Schema
(
description
=
"订单清单列表"
)
...
...
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/dal/dataobject/purchase/ErpPurchaseOrderItemDO.java
View file @
c5b64606
...
...
@@ -95,6 +95,6 @@ public class ErpPurchaseOrderItemDO extends BaseDO {
/**
* 客户订单id
*/
private
Long
customerId
;
private
Long
customer
Order
Id
;
}
\ No newline at end of file
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/dal/dataobject/sale/ErpSaleOrderDO.java
View file @
c5b64606
...
...
@@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.annotation.KeySequence;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.baomidou.mybatisplus.extension.handlers.
Fastjson2
TypeHandler
;
import
com.baomidou.mybatisplus.extension.handlers.
Jackson
TypeHandler
;
import
lombok.*
;
import
java.math.BigDecimal
;
...
...
@@ -155,6 +155,6 @@ public class ErpSaleOrderDO extends BaseDO {
/**
* 客户收货地址info
*/
@TableField
(
typeHandler
=
Fastjson2
TypeHandler
.
class
)
@TableField
(
typeHandler
=
Jackson
TypeHandler
.
class
)
private
CustomerAddressInfo
addressInfo
;
}
\ No newline at end of file
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/service/purchase/ErpPurchaseOrderServiceImpl.java
View file @
c5b64606
...
...
@@ -98,7 +98,10 @@ public class ErpPurchaseOrderServiceImpl implements ErpPurchaseOrderService {
calculateTotalPrice
(
purchaseOrder
,
purchaseOrderItems
);
purchaseOrderMapper
.
insert
(
purchaseOrder
);
// 2.2 插入订单项
purchaseOrderItems
.
forEach
(
o
->
o
.
setOrderId
(
purchaseOrder
.
getId
()));
purchaseOrderItems
.
forEach
(
o
->
{
o
.
setOrderId
(
purchaseOrder
.
getId
());
o
.
setCustomerOrderId
(
purchaseOrder
.
getCustomerOrderId
());
});
purchaseOrderItemMapper
.
insertBatch
(
purchaseOrderItems
);
return
purchaseOrder
.
getId
();
}
...
...
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/controller/admin/customerorder/vo/CustomerOrderPageReqVO.java
View file @
c5b64606
...
...
@@ -4,7 +4,7 @@ import cn.iocoder.foodnexus.module.erp.api.vo.warehouse.WarehouseInfo;
import
cn.iocoder.foodnexus.module.order.enums.CustomerOrderStatus
;
import
cn.iocoder.foodnexus.module.order.enums.DeliveryMode
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.extension.handlers.
Fastjson2
TypeHandler
;
import
com.baomidou.mybatisplus.extension.handlers.
Jackson
TypeHandler
;
import
lombok.*
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
cn.iocoder.foodnexus.framework.common.pojo.PageParam
;
...
...
@@ -33,7 +33,7 @@ public class CustomerOrderPageReqVO extends PageParam {
private
Long
warehouseAreaId
;
@Schema
(
description
=
"仓库信息"
)
@TableField
(
typeHandler
=
Fastjson2
TypeHandler
.
class
)
@TableField
(
typeHandler
=
Jackson
TypeHandler
.
class
)
private
WarehouseInfo
warehouseInfo
;
@Schema
(
description
=
"配送模式"
)
...
...
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/controller/app/customerOrder/vo/AppCustomerOrderItemSaveReqVO.java
View file @
c5b64606
...
...
@@ -2,6 +2,7 @@ package cn.iocoder.foodnexus.module.order.controller.app.customerOrder.vo;
import
cn.iocoder.foodnexus.module.product.api.dto.ProductInfo
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
jakarta.validation.constraints.Min
;
import
jakarta.validation.constraints.NotNull
;
import
jakarta.validation.constraints.Size
;
import
lombok.Data
;
...
...
@@ -22,7 +23,7 @@ public class AppCustomerOrderItemSaveReqVO {
@Schema
(
description
=
"订单商品数量"
,
requiredMode
=
Schema
.
RequiredMode
.
REQUIRED
)
@NotNull
(
message
=
"订单商品数量不能为空"
)
@
Size
(
min
=
1
,
message
=
"订单商品数量不能小于1"
)
@
Min
(
value
=
1
,
message
=
"订单商品数量不能小于1"
)
private
Integer
orderItemQuantity
;
@Schema
(
description
=
"商品对应供应商id"
,
hidden
=
true
)
...
...
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/controller/app/customerOrder/vo/AppCustomerOrderSaveReqVO.java
View file @
c5b64606
...
...
@@ -32,8 +32,7 @@ public class AppCustomerOrderSaveReqVO {
private
Long
addressId
;
@Schema
(
description
=
"配送模式"
,
requiredMode
=
Schema
.
RequiredMode
.
REQUIRED
)
@NotEmpty
(
message
=
"配送模式不能为空"
)
@InEnum
(
DeliveryMode
.
class
)
@NotNull
(
message
=
"配送模式不能为空"
)
private
DeliveryMode
deliveryMode
;
@Schema
(
description
=
"预计配送开始时间"
)
...
...
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/controller/app/customeraddress/CustomerAddressController.java
View file @
c5b64606
package
cn
.
iocoder
.
foodnexus
.
module
.
order
.
controller
.
app
.
customeraddress
;
import
cn.iocoder.foodnexus.framework.security.core.util.SecurityFrameworkUtils
;
import
cn.iocoder.foodnexus.module.erp.api.service.ErpCustomerApi
;
import
cn.iocoder.foodnexus.module.order.controller.app.customeraddress.vo.CustomerAddressPageReqVO
;
import
cn.iocoder.foodnexus.module.order.controller.app.customeraddress.vo.CustomerAddressRespVO
;
import
cn.iocoder.foodnexus.module.order.controller.app.customeraddress.vo.CustomerAddressSaveReqVO
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
jakarta.annotation.Resource
;
import
org.springframework.validation.annotation.Validated
;
...
...
@@ -39,17 +42,20 @@ public class CustomerAddressController {
@Resource
private
CustomerAddressService
customerAddressService
;
@Autowired
private
ErpCustomerApi
customerApi
;
@PostMapping
(
"/create"
)
@Operation
(
summary
=
"创建客户 - 我的地址"
)
@PreAuthorize
(
"@ss.hasPermission('order:customer-address:create')"
)
public
CommonResult
<
Long
>
createCustomerAddress
(
@Valid
@RequestBody
CustomerAddressSaveReqVO
createReqVO
)
{
createReqVO
.
setCustomerId
(
customerApi
.
queryCustomerIdByUserId
(
SecurityFrameworkUtils
.
getLoginUserId
()));
return
success
(
customerAddressService
.
createCustomerAddress
(
createReqVO
));
}
@PutMapping
(
"/update"
)
@Operation
(
summary
=
"更新客户 - 我的地址"
)
@PreAuthorize
(
"@ss.hasPermission('order:customer-address:update')"
)
public
CommonResult
<
Boolean
>
updateCustomerAddress
(
@Valid
@RequestBody
CustomerAddressSaveReqVO
updateReqVO
)
{
updateReqVO
.
setCustomerId
(
customerApi
.
queryCustomerIdByUserId
(
SecurityFrameworkUtils
.
getLoginUserId
()));
customerAddressService
.
updateCustomerAddress
(
updateReqVO
);
return
success
(
true
);
}
...
...
@@ -57,7 +63,6 @@ public class CustomerAddressController {
@DeleteMapping
(
"/delete"
)
@Operation
(
summary
=
"删除客户 - 我的地址"
)
@Parameter
(
name
=
"id"
,
description
=
"编号"
,
required
=
true
)
@PreAuthorize
(
"@ss.hasPermission('order:customer-address:delete')"
)
public
CommonResult
<
Boolean
>
deleteCustomerAddress
(
@RequestParam
(
"id"
)
Long
id
)
{
customerAddressService
.
deleteCustomerAddress
(
id
);
return
success
(
true
);
...
...
@@ -75,7 +80,6 @@ public class CustomerAddressController {
@GetMapping
(
"/get"
)
@Operation
(
summary
=
"获得客户 - 我的地址"
)
@Parameter
(
name
=
"id"
,
description
=
"编号"
,
required
=
true
,
example
=
"1024"
)
@PreAuthorize
(
"@ss.hasPermission('order:customer-address:query')"
)
public
CommonResult
<
CustomerAddressRespVO
>
getCustomerAddress
(
@RequestParam
(
"id"
)
Long
id
)
{
CustomerAddressDO
customerAddress
=
customerAddressService
.
getCustomerAddress
(
id
);
return
success
(
BeanUtils
.
toBean
(
customerAddress
,
CustomerAddressRespVO
.
class
));
...
...
@@ -83,8 +87,8 @@ public class CustomerAddressController {
@GetMapping
(
"/page"
)
@Operation
(
summary
=
"获得客户 - 我的地址分页"
)
@PreAuthorize
(
"@ss.hasPermission('order:customer-address:query')"
)
public
CommonResult
<
PageResult
<
CustomerAddressRespVO
>>
getCustomerAddressPage
(
@Valid
CustomerAddressPageReqVO
pageReqVO
)
{
pageReqVO
.
setCustomerId
(
customerApi
.
queryCustomerIdByUserId
(
SecurityFrameworkUtils
.
getLoginUserId
()));
PageResult
<
CustomerAddressDO
>
pageResult
=
customerAddressService
.
getCustomerAddressPage
(
pageReqVO
);
return
success
(
BeanUtils
.
toBean
(
pageResult
,
CustomerAddressRespVO
.
class
));
}
...
...
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/dal/dataobject/customerorder/CustomerOrderDO.java
View file @
c5b64606
...
...
@@ -4,7 +4,7 @@ import cn.iocoder.foodnexus.module.erp.api.vo.warehouse.WarehouseInfo;
import
cn.iocoder.foodnexus.module.order.dto.CustomerAddressInfo
;
import
cn.iocoder.foodnexus.module.order.enums.CustomerOrderStatus
;
import
cn.iocoder.foodnexus.module.order.enums.DeliveryMode
;
import
com.baomidou.mybatisplus.extension.handlers.
Fastjson2
TypeHandler
;
import
com.baomidou.mybatisplus.extension.handlers.
Jackson
TypeHandler
;
import
lombok.*
;
import
java.time.LocalDateTime
;
...
...
@@ -30,7 +30,7 @@ public class CustomerOrderDO extends BaseDO {
/**
* id
*/
@TableId
@TableId
(
value
=
"id"
,
type
=
IdType
.
ASSIGN_ID
)
private
Long
id
;
/**
* 订单编号
...
...
@@ -57,7 +57,7 @@ public class CustomerOrderDO extends BaseDO {
/**
* 仓库信息
*/
@TableField
(
typeHandler
=
Fastjson2
TypeHandler
.
class
)
@TableField
(
typeHandler
=
Jackson
TypeHandler
.
class
)
private
WarehouseInfo
warehouseInfo
;
/**
* 客户收货地址id
...
...
@@ -66,7 +66,7 @@ public class CustomerOrderDO extends BaseDO {
/**
* 客户收货地址info
*/
@TableField
(
typeHandler
=
Fastjson2
TypeHandler
.
class
)
@TableField
(
typeHandler
=
Jackson
TypeHandler
.
class
)
private
CustomerAddressInfo
addressInfo
;
/**
* 配送模式
...
...
@@ -106,7 +106,7 @@ public class CustomerOrderDO extends BaseDO {
/**
* 订单备注
*/
@TableField
(
typeHandler
=
Fastjson2
TypeHandler
.
class
)
@TableField
(
typeHandler
=
Jackson
TypeHandler
.
class
)
private
CustomerOrderRemark
orderRemark
;
}
\ 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 @
c5b64606
package
cn
.
iocoder
.
foodnexus
.
module
.
order
.
dal
.
dataobject
.
customerorderitem
;
import
cn.iocoder.foodnexus.module.product.api.dto.ProductInfo
;
import
com.baomidou.mybatisplus.extension.handlers.
Fastjson2
TypeHandler
;
import
com.baomidou.mybatisplus.extension.handlers.
Jackson
TypeHandler
;
import
lombok.*
;
import
java.util.*
;
import
java.time.LocalDateTime
;
...
...
@@ -48,7 +48,7 @@ public class CustomerOrderItemDO extends BaseDO {
/**
* 商品信息
*/
@TableField
(
typeHandler
=
Fastjson2
TypeHandler
.
class
)
@TableField
(
typeHandler
=
Jackson
TypeHandler
.
class
)
private
ProductInfo
productInfo
;
/**
* 商品对应供应商id
...
...
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/service/checktask/CheckTaskServiceImpl.java
View file @
c5b64606
...
...
@@ -210,12 +210,13 @@ public class CheckTaskServiceImpl implements CheckTaskService {
throw
exception
(
CHECK_TASK_CREATE_ERROR
);
}
CustomerOrderDO
customerOrder
=
customerOrderService
.
getCustomerOrder
(
purchaseOrder
.
getCustomerOrderId
());
checkTask
.
setNo
(
genCodeUtils
.
createAmBatch
(
"LLZJ"
));
checkTask
.
setStatus
(
CheckTaskStatus
.
TO_BE_CHECK
.
getKey
());
checkTask
.
setSupplierId
(
checkTask
.
getSupplierId
());
checkTask
.
setPurchaseOrderId
(
purchaseOrder
.
getId
());
checkTask
.
setCustomerOrderId
(
purchaseOrder
.
getCustomerOrderId
());
checkTask
.
setCustomerId
(
purchaseOrderItems
.
get
(
0
)
.
getCustomerId
());
checkTask
.
setCustomerId
(
customerOrder
.
getCustomerId
());
checkTask
.
setArrivalTime
(
LocalDateTime
.
now
());
Map
<
Long
,
ProductSpuDO
>
spuMap
=
productSpuService
.
getSpuMap
(
CommonUtil
.
listConvertSet
(
purchaseOrderItems
,
...
...
foodnexus-module-system/src/main/java/cn/iocoder/foodnexus/module/system/controller/app/province/AppProvinceController.java
0 → 100644
View file @
c5b64606
package
cn
.
iocoder
.
foodnexus
.
module
.
system
.
controller
.
app
.
province
;
import
cn.iocoder.foodnexus.framework.common.pojo.CommonResult
;
import
cn.iocoder.foodnexus.framework.common.util.CommonUtil
;
import
cn.iocoder.foodnexus.framework.common.util.object.BeanUtils
;
import
cn.iocoder.foodnexus.module.system.controller.admin.province.vo.ProvinceRespVO
;
import
cn.iocoder.foodnexus.module.system.controller.admin.province.vo.ProvinceSaveReqVO
;
import
cn.iocoder.foodnexus.module.system.service.province.ProvinceService
;
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.validation.Valid
;
import
org.apache.commons.compress.utils.Lists
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
import
static
cn
.
iocoder
.
foodnexus
.
framework
.
common
.
pojo
.
CommonResult
.
success
;
@Tag
(
name
=
"APP - 地区数据"
)
@RestController
@RequestMapping
(
"/system/province"
)
@Validated
public
class
AppProvinceController
{
@Resource
private
ProvinceService
provinceService
;
@GetMapping
(
"/query"
)
@Operation
(
summary
=
"获取省份信息"
)
@Parameter
(
name
=
"parentId"
,
description
=
"父级id"
)
@Parameter
(
name
=
"type"
,
description
=
"类型(1-省份 2-市 3-县区 4-街道)"
)
@Parameter
(
name
=
"keyword"
,
description
=
"查询字段"
)
public
CommonResult
<
List
<
ProvinceRespVO
>>
query
(
@RequestParam
(
value
=
"parentId"
,
required
=
false
)
Long
parentId
,
@RequestParam
(
value
=
"type"
,
required
=
false
)
Integer
type
,
@RequestParam
(
value
=
"keyword"
,
required
=
false
)
String
keyword
)
{
if
(
CommonUtil
.
isEmpty
(
parentId
)
&&
CommonUtil
.
isEmpty
(
type
)
&&
CommonUtil
.
isEmpty
(
keyword
))
{
// 防止拉取所有数据
return
success
(
Lists
.
newArrayList
());
}
return
success
(
BeanUtils
.
toBean
(
provinceService
.
queryList
(
parentId
,
type
,
keyword
),
ProvinceRespVO
.
class
));
}
}
\ No newline at end of file
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