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
c1eb784e
Commit
c1eb784e
authored
Oct 24, 2025
by
杨浩
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
查询调整
parent
b3342487
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
34 additions
and
7 deletions
+34
-7
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/controller/admin/purchase/vo/order/ErpPurchaseOrderPageReqVO.java
+5
-0
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/dal/mysql/purchase/ErpPurchaseOrderMapper.java
+4
-0
foodnexus-module-mall/foodnexus-module-operations/src/main/java/cn/iocoder/foodnexus/module/operations/controller/app/inquirecustomerpush/AppInquireCustomerPushController.java
+3
-1
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/controller/app/customeraddress/CustomerAddressController.java
+1
-1
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/dal/mysql/customeraddress/CustomerAddressMapper.java
+2
-1
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/service/customeraddress/CustomerAddressServiceImpl.java
+19
-4
No files found.
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/controller/admin/purchase/vo/order/ErpPurchaseOrderPageReqVO.java
View file @
c1eb784e
...
@@ -2,6 +2,7 @@ package cn.iocoder.foodnexus.module.erp.controller.admin.purchase.vo.order;
...
@@ -2,6 +2,7 @@ package cn.iocoder.foodnexus.module.erp.controller.admin.purchase.vo.order;
import
cn.iocoder.foodnexus.framework.common.pojo.PageParam
;
import
cn.iocoder.foodnexus.framework.common.pojo.PageParam
;
import
cn.iocoder.foodnexus.module.erp.api.enums.ErpDeliveryStatus
;
import
cn.iocoder.foodnexus.module.erp.api.enums.ErpDeliveryStatus
;
import
cn.iocoder.foodnexus.module.order.enums.DeliveryMode
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
lombok.Data
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.EqualsAndHashCode
;
...
@@ -90,4 +91,7 @@ public class ErpPurchaseOrderPageReqVO extends PageParam {
...
@@ -90,4 +91,7 @@ public class ErpPurchaseOrderPageReqVO extends PageParam {
@Schema
(
description
=
"发货状态"
)
@Schema
(
description
=
"发货状态"
)
private
List
<
String
>
deliveryStatus
;
private
List
<
String
>
deliveryStatus
;
@Schema
(
description
=
"配送模式"
)
private
DeliveryMode
deliveryMode
;
}
}
\ No newline at end of file
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/dal/mysql/purchase/ErpPurchaseOrderMapper.java
View file @
c1eb784e
...
@@ -63,6 +63,10 @@ public interface ErpPurchaseOrderMapper extends BaseMapperX<ErpPurchaseOrderDO>
...
@@ -63,6 +63,10 @@ public interface ErpPurchaseOrderMapper extends BaseMapperX<ErpPurchaseOrderDO>
}
else
if
(
Objects
.
equals
(
reqVO
.
getInStatus
(),
ErpPurchaseOrderPageReqVO
.
IN_STATUS_ALL
))
{
}
else
if
(
Objects
.
equals
(
reqVO
.
getInStatus
(),
ErpPurchaseOrderPageReqVO
.
IN_STATUS_ALL
))
{
query
.
apply
(
"t.in_count = t.total_count"
);
query
.
apply
(
"t.in_count = t.total_count"
);
}
}
if
(
CommonUtil
.
isNotEmpty
(
reqVO
.
getDeliveryMode
()))
{
query
.
leftJoin
(
"order_customer_order oco on t.customer_order_id = oco.id"
);
query
.
eq
(
"oco.delivery_mode"
,
reqVO
.
getDeliveryMode
().
getKey
());
}
// 退货状态
// 退货状态
if
(
Objects
.
equals
(
reqVO
.
getReturnStatus
(),
ErpPurchaseOrderPageReqVO
.
RETURN_STATUS_NONE
))
{
if
(
Objects
.
equals
(
reqVO
.
getReturnStatus
(),
ErpPurchaseOrderPageReqVO
.
RETURN_STATUS_NONE
))
{
query
.
eq
(
ErpPurchaseOrderDO:
:
getReturnCount
,
0
);
query
.
eq
(
ErpPurchaseOrderDO:
:
getReturnCount
,
0
);
...
...
foodnexus-module-mall/foodnexus-module-operations/src/main/java/cn/iocoder/foodnexus/module/operations/controller/app/inquirecustomerpush/AppInquireCustomerPushController.java
View file @
c1eb784e
...
@@ -82,7 +82,8 @@ public class AppInquireCustomerPushController {
...
@@ -82,7 +82,8 @@ public class AppInquireCustomerPushController {
public
CommonResult
<
PageResult
<
AppInquireCustomerPushRespVO
>>
getInquireCustomerPushPage
(
@Valid
AppInquireCustomerPushPageReqVO
pageReqVO
)
{
public
CommonResult
<
PageResult
<
AppInquireCustomerPushRespVO
>>
getInquireCustomerPushPage
(
@Valid
AppInquireCustomerPushPageReqVO
pageReqVO
)
{
pageReqVO
.
setCustomerId
(
customerApi
.
queryCustomerIdByUserId
(
SecurityFrameworkUtils
.
getLoginUserId
()));
pageReqVO
.
setCustomerId
(
customerApi
.
queryCustomerIdByUserId
(
SecurityFrameworkUtils
.
getLoginUserId
()));
PageResult
<
AppInquireCustomerPushRespVO
>
pageResult
=
inquireCustomerPushService
.
getAppInquireCustomerPushPage
(
pageReqVO
);
PageResult
<
AppInquireCustomerPushRespVO
>
pageResult
=
inquireCustomerPushService
.
getAppInquireCustomerPushPage
(
pageReqVO
);
return
success
(
pageResult
);
return
success
(
BeanUtils
.
toBean
(
pageResult
,
AppInquireCustomerPushRespVO
.
class
,
item
->
item
.
setInquirePrice
(
BeanUtils
.
toBean
(
inquirePriceService
.
getInquirePrice
(
item
.
getInquirePriceId
()),
InquirePriceRespVO
.
class
))));
}
}
}
}
\ No newline at end of file
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/controller/app/customeraddress/CustomerAddressController.java
View file @
c1eb784e
...
@@ -88,7 +88,7 @@ public class CustomerAddressController {
...
@@ -88,7 +88,7 @@ public class CustomerAddressController {
@GetMapping
(
"/page"
)
@GetMapping
(
"/page"
)
@Operation
(
summary
=
"获得客户 - 我的地址分页"
)
@Operation
(
summary
=
"获得客户 - 我的地址分页"
)
public
CommonResult
<
PageResult
<
CustomerAddressRespVO
>>
getCustomerAddressPage
(
@Valid
CustomerAddressPageReqVO
pageReqVO
)
{
public
CommonResult
<
PageResult
<
CustomerAddressRespVO
>>
getCustomerAddressPage
(
@Valid
CustomerAddressPageReqVO
pageReqVO
)
{
pageReqVO
.
setCreator
(
customerApi
.
queryCustomerIdByUserId
(
SecurityFrameworkUtils
.
getLoginUserId
()
));
pageReqVO
.
setCreator
(
SecurityFrameworkUtils
.
getLoginUserId
(
));
PageResult
<
CustomerAddressDO
>
pageResult
=
customerAddressService
.
getCustomerAddressPage
(
pageReqVO
);
PageResult
<
CustomerAddressDO
>
pageResult
=
customerAddressService
.
getCustomerAddressPage
(
pageReqVO
);
return
success
(
BeanUtils
.
toBean
(
pageResult
,
CustomerAddressRespVO
.
class
));
return
success
(
BeanUtils
.
toBean
(
pageResult
,
CustomerAddressRespVO
.
class
));
}
}
...
...
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/dal/mysql/customeraddress/CustomerAddressMapper.java
View file @
c1eb784e
...
@@ -30,7 +30,7 @@ public interface CustomerAddressMapper extends BaseMapperX<CustomerAddressDO> {
...
@@ -30,7 +30,7 @@ public interface CustomerAddressMapper extends BaseMapperX<CustomerAddressDO> {
.
eqIfPresent
(
CustomerAddressDO:
:
getIsDefault
,
reqVO
.
getIsDefault
())
.
eqIfPresent
(
CustomerAddressDO:
:
getIsDefault
,
reqVO
.
getIsDefault
())
.
betweenIfPresent
(
CustomerAddressDO:
:
getCreateTime
,
reqVO
.
getCreateTime
())
.
betweenIfPresent
(
CustomerAddressDO:
:
getCreateTime
,
reqVO
.
getCreateTime
())
.
eqIfPresent
(
CustomerAddressDO:
:
getCreator
,
reqVO
.
getCreator
())
.
eqIfPresent
(
CustomerAddressDO:
:
getCreator
,
reqVO
.
getCreator
())
.
orderByDesc
(
CustomerAddressDO:
:
getId
));
.
orderByDesc
(
CustomerAddressDO:
:
getI
sDefault
,
CustomerAddressDO:
:
getI
d
));
}
}
}
}
\ No newline at end of file
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/service/customeraddress/CustomerAddressServiceImpl.java
View file @
c1eb784e
...
@@ -3,6 +3,7 @@ package cn.iocoder.foodnexus.module.order.service.customeraddress;
...
@@ -3,6 +3,7 @@ package cn.iocoder.foodnexus.module.order.service.customeraddress;
import
cn.iocoder.foodnexus.module.order.controller.app.customeraddress.vo.CustomerAddressPageReqVO
;
import
cn.iocoder.foodnexus.module.order.controller.app.customeraddress.vo.CustomerAddressPageReqVO
;
import
cn.iocoder.foodnexus.module.order.controller.app.customeraddress.vo.CustomerAddressSaveReqVO
;
import
cn.iocoder.foodnexus.module.order.controller.app.customeraddress.vo.CustomerAddressSaveReqVO
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
org.springframework.security.core.parameters.P
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
jakarta.annotation.Resource
;
import
jakarta.annotation.Resource
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.validation.annotation.Validated
;
...
@@ -17,6 +18,7 @@ import cn.iocoder.foodnexus.module.order.dal.mysql.customeraddress.CustomerAddre
...
@@ -17,6 +18,7 @@ import cn.iocoder.foodnexus.module.order.dal.mysql.customeraddress.CustomerAddre
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
.
convertList
;
import
static
cn
.
iocoder
.
foodnexus
.
framework
.
common
.
util
.
collection
.
CollectionUtils
.
convertList
;
import
static
cn
.
iocoder
.
foodnexus
.
framework
.
security
.
core
.
util
.
SecurityFrameworkUtils
.
getLoginUserId
;
import
static
cn
.
iocoder
.
foodnexus
.
module
.
order
.
enums
.
ErrorCodeConstants
.*;
import
static
cn
.
iocoder
.
foodnexus
.
module
.
order
.
enums
.
ErrorCodeConstants
.*;
/**
/**
...
@@ -33,10 +35,15 @@ public class CustomerAddressServiceImpl implements CustomerAddressService {
...
@@ -33,10 +35,15 @@ public class CustomerAddressServiceImpl implements CustomerAddressService {
@Override
@Override
public
Long
createCustomerAddress
(
CustomerAddressSaveReqVO
createReqVO
)
{
public
Long
createCustomerAddress
(
CustomerAddressSaveReqVO
createReqVO
)
{
if
(
createReqVO
.
getIsDefault
())
{
customerAddressMapper
.
update
(
Wrappers
.<
CustomerAddressDO
>
lambdaUpdate
()
.
set
(
CustomerAddressDO:
:
getIsDefault
,
Boolean
.
FALSE
)
.
eq
(
CustomerAddressDO:
:
getIsDefault
,
Boolean
.
TRUE
)
.
eq
(
CustomerAddressDO:
:
getCreator
,
getLoginUserId
()));
}
// 插入
// 插入
CustomerAddressDO
customerAddress
=
BeanUtils
.
toBean
(
createReqVO
,
CustomerAddressDO
.
class
);
CustomerAddressDO
customerAddress
=
BeanUtils
.
toBean
(
createReqVO
,
CustomerAddressDO
.
class
);
customerAddressMapper
.
insert
(
customerAddress
);
customerAddressMapper
.
insert
(
customerAddress
);
// 返回
// 返回
return
customerAddress
.
getId
();
return
customerAddress
.
getId
();
}
}
...
@@ -44,7 +51,13 @@ public class CustomerAddressServiceImpl implements CustomerAddressService {
...
@@ -44,7 +51,13 @@ public class CustomerAddressServiceImpl implements CustomerAddressService {
@Override
@Override
public
void
updateCustomerAddress
(
CustomerAddressSaveReqVO
updateReqVO
)
{
public
void
updateCustomerAddress
(
CustomerAddressSaveReqVO
updateReqVO
)
{
// 校验存在
// 校验存在
validateCustomerAddressExists
(
updateReqVO
.
getId
());
CustomerAddressDO
customerAddressDO
=
validateCustomerAddressExists
(
updateReqVO
.
getId
());
if
(!
customerAddressDO
.
getIsDefault
()
&&
updateReqVO
.
getIsDefault
())
{
customerAddressMapper
.
update
(
Wrappers
.<
CustomerAddressDO
>
lambdaUpdate
()
.
set
(
CustomerAddressDO:
:
getIsDefault
,
Boolean
.
FALSE
)
.
eq
(
CustomerAddressDO:
:
getIsDefault
,
Boolean
.
TRUE
)
.
eq
(
CustomerAddressDO:
:
getCreator
,
getLoginUserId
()));
}
// 更新
// 更新
CustomerAddressDO
updateObj
=
BeanUtils
.
toBean
(
updateReqVO
,
CustomerAddressDO
.
class
);
CustomerAddressDO
updateObj
=
BeanUtils
.
toBean
(
updateReqVO
,
CustomerAddressDO
.
class
);
customerAddressMapper
.
updateById
(
updateObj
);
customerAddressMapper
.
updateById
(
updateObj
);
...
@@ -65,10 +78,12 @@ public class CustomerAddressServiceImpl implements CustomerAddressService {
...
@@ -65,10 +78,12 @@ public class CustomerAddressServiceImpl implements CustomerAddressService {
}
}
private
void
validateCustomerAddressExists
(
Long
id
)
{
private
CustomerAddressDO
validateCustomerAddressExists
(
Long
id
)
{
if
(
customerAddressMapper
.
selectById
(
id
)
==
null
)
{
CustomerAddressDO
customerAddressDO
=
customerAddressMapper
.
selectById
(
id
);
if
(
customerAddressDO
==
null
)
{
throw
exception
(
CUSTOMER_ADDRESS_NOT_EXISTS
);
throw
exception
(
CUSTOMER_ADDRESS_NOT_EXISTS
);
}
}
return
customerAddressDO
;
}
}
@Override
@Override
...
...
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