Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jiedao-api-boot-master
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lanbaoming
jiedao-api-boot-master
Commits
b69c740e
Commit
b69c740e
authored
Jul 02, 2024
by
lanbaoming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
2024-07-02-6提交
parent
72b7e928
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
157 additions
and
63 deletions
+157
-63
IndirectCustomerServiceImpl.java
...service/indirectCustomer/IndirectCustomerServiceImpl.java
+4
-2
OrderQueryServiceImpl.java
...odule/order/service/order/impl/OrderQueryServiceImpl.java
+42
-10
OrderServiceImpl.java
...dao/module/order/service/order/impl/OrderServiceImpl.java
+63
-26
OrderWarehouseInServiceImpl.java
...service/orderWarehouseIn/OrderWarehouseInServiceImpl.java
+4
-4
TargetLogServiceImpl.java
.../module/order/service/targetLog/TargetLogServiceImpl.java
+4
-4
OrderController.java
.../module/order/controller/admin/order/OrderController.java
+2
-1
DeptTargetServiceImpl.java
...module/sale/service/deptTarget/DeptTargetServiceImpl.java
+18
-8
DeptTargetMapper.xml
...src/main/resources/mapper/deptTarget/DeptTargetMapper.xml
+14
-5
DeptTargetController.java
...ale/controller/admin/deptTarget/DeptTargetController.java
+6
-3
No files found.
yudao-module-customer/yudao-module-customer-core/src/main/java/cn/iocoder/yudao/module/customer/service/indirectCustomer/IndirectCustomerServiceImpl.java
View file @
b69c740e
...
...
@@ -109,12 +109,14 @@ public class IndirectCustomerServiceImpl extends AbstractService<IndirectCustome
}
// 获取当前会员关联的customerId
List
<
CustomerContactsDO
>
customerContactsDOS
=
customerContactsService
.
getByMemberUserId
(
userId
);
List
<
CustomerContactsDO
>
customerContactsDOS
=
customerContactsService
.
getByMemberUserId
(
userId
);
if
(
CollectionUtil
.
isEmpty
(
customerContactsDOS
))
{
log
.
error
(
"此会员不存在关联联系人"
);
return
;
}
if
(
CollectionUtil
.
isNotEmpty
(
customerContactsDOS
)
&&
customerContactsDOS
.
size
()
>
1
)
{
if
(
CollectionUtil
.
isNotEmpty
(
customerContactsDOS
)
&&
customerContactsDOS
.
size
()
>
1
)
{
log
.
error
(
String
.
format
(
"此用户的关联客户不止一人,请处理, userid=%d"
,
userId
));
return
;
}
...
...
yudao-module-order/yudao-module-order-core/src/main/java/cn/iocoder/yudao/module/order/service/order/impl/OrderQueryServiceImpl.java
View file @
b69c740e
...
...
@@ -16,7 +16,9 @@ import cn.iocoder.yudao.framework.mybatis.core.vo.PageVO;
import
cn.iocoder.yudao.framework.security.core.LoginUser
;
import
cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils
;
import
cn.iocoder.yudao.module.customer.dal.dataobject.customer.CustomerDO
;
import
cn.iocoder.yudao.module.customer.dal.dataobject.customerContacts.CustomerContactsDO
;
import
cn.iocoder.yudao.module.customer.service.customer.CustomerService
;
import
cn.iocoder.yudao.module.customer.service.customerContacts.CustomerContactsService
;
import
cn.iocoder.yudao.module.customer.service.zhongPao.ZhongPaoService
;
import
cn.iocoder.yudao.module.customer.vo.zhongPao.CustomerZhongPaoQueryVO
;
import
cn.iocoder.yudao.module.customer.vo.zhongPao.ZhongPaoBestVO
;
...
...
@@ -71,6 +73,7 @@ import cn.iocoder.yudao.module.order.vo.approval.OrderSpecialApplyVO;
import
cn.iocoder.yudao.module.order.vo.approval.OrderSpecialBatchApplyOrderItemDetailVO
;
import
cn.iocoder.yudao.module.order.vo.approval.OrderSpecialBatchApplyVO
;
import
cn.iocoder.yudao.module.order.vo.order.*
;
import
cn.iocoder.yudao.module.order.vo.orderConsignee.OrderConsigneeBackVO
;
import
cn.iocoder.yudao.module.order.vo.orderException.OrderExceptionStatisticsExcelVo
;
import
cn.iocoder.yudao.module.order.vo.orderException.OrderFeeDetailBackVO
;
import
cn.iocoder.yudao.module.order.vo.orderItem.OrderItemBackVO
;
...
...
@@ -160,6 +163,8 @@ public class OrderQueryServiceImpl implements OrderQueryService {
private
final
OrderWarehouseInService
orderWarehouseInService
;
private
final
CustomerContactsService
customerContactsService
;
private
UeProperties
ueProperties
;
private
FileService
fileService
;
...
...
@@ -639,7 +644,8 @@ public class OrderQueryServiceImpl implements OrderQueryService {
if
(
Objects
.
nonNull
(
dto
.
getDestAdjustToDestWarehouseId
())
&&
dto
.
getDestAdjustToDestWarehouseId
()
>
0L
)
{
// 如果有目的地的目的仓调仓记录id,则获取最新的调仓仓库信息
WarehouseRegionVO
destWarehouseRegionVO
=
warehouseMapper
.
findWarehouseRegion
(
dto
.
getDestAdjustToDestWarehouseId
());
WarehouseRegionVO
destWarehouseRegionVO
=
warehouseMapper
.
findWarehouseRegion
(
dto
.
getDestAdjustToDestWarehouseId
());
if
(
Objects
.
nonNull
(
destWarehouseRegionVO
))
{
logisticsInfoDto
.
setDestWarehouseId
(
dto
.
getDestAdjustToDestWarehouseId
());
logisticsInfoDto
.
setDestCityId
(
destWarehouseRegionVO
.
getShi
());
...
...
@@ -655,24 +661,50 @@ public class OrderQueryServiceImpl implements OrderQueryService {
// 保存可能是调仓后的物流信息,该信息为当前货物正在经理的物流信息线路
dto
.
setLogisticsInfoDto
(
logisticsInfoDto
);
// 始发地信息
OrderDepartureDO
orderDepartureDO
=
orderDepartureService
.
getOne
(
new
LambdaQueryWrapper
<
OrderDepartureDO
>().
eq
(
OrderDepartureDO:
:
getOrderId
,
orderId
).
orderByDesc
(
OrderDepartureDO:
:
getId
).
last
(
"limit 1"
));
OrderDepartureDO
orderDepartureDO
=
orderDepartureService
.
getOne
(
new
LambdaQueryWrapper
<
OrderDepartureDO
>().
eq
(
OrderDepartureDO:
:
getOrderId
,
orderId
).
orderByDesc
(
OrderDepartureDO:
:
getId
).
last
(
"limit 1"
));
if
(
Objects
.
nonNull
(
orderDepartureDO
))
{
dto
.
setDepartureVO
(
OrderDepartureConvert
.
INSTANCE
.
convert
(
orderDepartureDO
));
}
// 目的地信息
OrderObjectiveDO
orderObjectiveDO
=
orderObjectiveService
.
getOne
(
new
LambdaQueryWrapper
<
OrderObjectiveDO
>().
eq
(
OrderObjectiveDO:
:
getOrderId
,
orderId
).
orderByDesc
(
OrderObjectiveDO:
:
getId
).
last
(
"limit 1"
));
OrderObjectiveDO
orderObjectiveDO
=
orderObjectiveService
.
getOne
(
new
LambdaQueryWrapper
<
OrderObjectiveDO
>().
eq
(
OrderObjectiveDO:
:
getOrderId
,
orderId
).
orderByDesc
(
OrderObjectiveDO:
:
getId
).
last
(
"limit 1"
));
if
(
Objects
.
nonNull
(
orderObjectiveDO
))
{
dto
.
setObjectiveVO
(
OrderObjectiveConvert
.
INSTANCE
.
convert
(
orderObjectiveDO
));
}
// 发货人信息
OrderConsignorDO
orderConsignorDO
=
orderConsignorService
.
getOne
(
new
LambdaQueryWrapper
<
OrderConsignorDO
>().
eq
(
OrderConsignorDO:
:
getOrderId
,
orderId
).
orderByDesc
(
OrderConsignorDO:
:
getId
).
last
(
"limit 1"
));
OrderConsignorDO
orderConsignorDO
=
orderConsignorService
.
getOne
(
new
LambdaQueryWrapper
<
OrderConsignorDO
>().
eq
(
OrderConsignorDO:
:
getOrderId
,
orderId
).
orderByDesc
(
OrderConsignorDO:
:
getId
).
last
(
"limit 1"
));
if
(
Objects
.
nonNull
(
orderConsignorDO
))
{
dto
.
setConsignorVO
(
OrderConsignorConvert
.
INSTANCE
.
convert
(
orderConsignorDO
));
}
// 收货人信息
OrderConsigneeDO
orderConsigneeDO
=
orderConsigneeService
.
getOne
(
new
LambdaQueryWrapper
<
OrderConsigneeDO
>().
eq
(
OrderConsigneeDO:
:
getOrderId
,
orderId
).
orderByDesc
(
OrderConsigneeDO:
:
getId
).
last
(
"limit 1"
));
OrderConsigneeDO
orderConsigneeDO
=
orderConsigneeService
.
getOne
(
new
LambdaQueryWrapper
<
OrderConsigneeDO
>().
eq
(
OrderConsigneeDO:
:
getOrderId
,
orderId
).
orderByDesc
(
OrderConsigneeDO:
:
getId
).
last
(
"limit 1"
));
if
(
Objects
.
nonNull
(
orderConsigneeDO
))
{
dto
.
setConsigneeVO
(
OrderConsigneeConvert
.
INSTANCE
.
convert
(
orderConsigneeDO
));
OrderConsigneeBackVO
v1
=
OrderConsigneeConvert
.
INSTANCE
.
convert
(
orderConsigneeDO
);
/*
LambdaQueryWrapper q1 = new LambdaQueryWrapper<CustomerContactsDO>().eq(
CustomerContactsDO::getCustomerId,
orderConsigneeDO.getCustomerId()).
eq(CustomerContactsDO::getIsDefault, 1);
List<CustomerContactsDO> list =
customerContactsService.selectList(q1);
if (CollectionUtil.isNotEmpty(list)) {
}*/
dto
.
setConsigneeVO
(
v1
);
dto
.
setConsigneeAddress
(
orderConsigneeDO
.
getAddress
());
dto
.
setHarvestMethod
(
orderConsigneeDO
.
getHarvestMethod
());
dto
.
setCity
(
orderConsigneeDO
.
getCity
());
...
...
yudao-module-order/yudao-module-order-core/src/main/java/cn/iocoder/yudao/module/order/service/order/impl/OrderServiceImpl.java
View file @
b69c740e
...
...
@@ -195,13 +195,18 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
public
OrderDO
createOrder
(
OrderCreateReqVO
createReqVO
,
MemberUserDO
memberUserDO
)
{
int
type
=
1
;
//
获取功能开关
//获取功能开关
List
<
DictDataRespDTO
>
dictList
=
dictDataApi
.
getDictDatas
(
"part_function_switch"
);
//
智慧预装功能开关
//智慧预装功能开关
DictDataRespDTO
dictDataRespDTO
=
dictList
.
stream
().
filter
(
dto
->
"create_order_phone_limit"
.
equals
(
dto
.
getLabel
())).
findFirst
().
orElse
(
null
);
if
((
Objects
.
isNull
(
createReqVO
.
getIsCargoControl
())
||
!
createReqVO
.
getIsCargoControl
())
&&
Objects
.
nonNull
(
dictDataRespDTO
)
&&
StringUtils
.
equals
(
dictDataRespDTO
.
getValue
(),
"11"
)
&&
StringUtils
.
isNotBlank
(
createReqVO
.
getCountryCode
())
&&
StringUtils
.
equals
(
"86"
,
createReqVO
.
getCountryCode
()))
{
if
((
Objects
.
isNull
(
createReqVO
.
getIsCargoControl
())
||
!
createReqVO
.
getIsCargoControl
())
&&
Objects
.
nonNull
(
dictDataRespDTO
)
&&
StringUtils
.
equals
(
dictDataRespDTO
.
getValue
(),
"11"
)
&&
StringUtils
.
isNotBlank
(
createReqVO
.
getCountryCode
())
&&
StringUtils
.
equals
(
"86"
,
createReqVO
.
getCountryCode
()))
{
throw
exception
(
CONSIGNEE_PHONE_IS_EXTERNAL
);
}
LogisticsInfoDto
logisticsInfoDto
=
...
...
@@ -227,13 +232,15 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
throw
exception
(
ORDER_EXTERNAL_WAREHOUSE_NOT_NULL
);
}
long
count
=
createReqVO
.
getExternalWarehouseDtoList
().
stream
()
.
filter
(
dto
->
Objects
.
isNull
(
dto
.
getEstLoadingTime
())
||
StringUtils
.
isBlank
(
dto
.
getLoadingAddress
())).
count
();
.
filter
(
dto
->
Objects
.
isNull
(
dto
.
getEstLoadingTime
())
||
StringUtils
.
isBlank
(
dto
.
getLoadingAddress
())).
count
();
if
(
count
>
0
)
{
throw
exception
(
ORDER_EXTERNAL_WAREHOUSE_ADDRESS_AND_LOADING_TIME_NOT_NULL
);
}
}
else
{
if
(
Objects
.
isNull
(
createReqVO
.
getDeliveryDate
())
&&
!
Objects
.
equals
(
createReqVO
.
getStatus
(),
OrderStatusEnum
.
DRAFT
.
getValue
()))
{
!
Objects
.
equals
(
createReqVO
.
getStatus
(),
OrderStatusEnum
.
DRAFT
.
getValue
()))
{
throw
exception
(
ORDER_DELIVERY_DATE_NOT_NULL
);
}
}
...
...
@@ -242,7 +249,7 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
Objects
.
equals
(
TransportTypeShortEnum
.
MARINE_CONTAINER
.
getValue
(),
createReqVO
.
getTransportId
()))
{
//
非空运订单,对前端传值的空运参数做格式化处理
//非空运订单,对前端传值的空运参数做格式化处理
createReqVO
.
setPortDestCustomsClear
(
0
);
createReqVO
.
setDeliveryWay
(
0
);
createReqVO
.
setDoubleClear
(
0
);
...
...
@@ -364,9 +371,11 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
}
if
(
Objects
.
isNull
(
createReqVO
.
getDisplayBillLadingPrice
()))
{
// 查询订单归属客户的默认档案设置
if
(
Objects
.
nonNull
(
order
.
getCustomerId
())
&&
order
.
getCustomerId
()
>
0L
)
{
if
(
Objects
.
nonNull
(
order
.
getCustomerId
())
&&
order
.
getCustomerId
()
>
0L
)
{
CustomerDO
customerDO
=
customerService
.
getById
(
order
.
getCustomerId
());
if
(
Objects
.
nonNull
(
customerDO
)
&&
Objects
.
nonNull
(
customerDO
.
getIsShowTidanPrice
()))
{
if
(
Objects
.
nonNull
(
customerDO
)
&&
Objects
.
nonNull
(
customerDO
.
getIsShowTidanPrice
()))
{
order
.
setDisplayBillLadingPrice
(
customerDO
.
getIsShowTidanPrice
());
}
}
...
...
@@ -414,7 +423,8 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
adminClientCreateEvent
.
setDialCode
(
Integer
.
parseInt
(
orderConsigneeDO
.
getCountryCode
()));
adminClientCreateEvent
.
setDefaultContact
(
true
);
indirectCustomerService
.
createIndirectCustomer
(
adminClientCreateEvent
);
indirectCustomerService
.
createIndirectCustomer
(
adminClientCreateEvent
);
}
}
catch
(
Exception
e
)
{
...
...
@@ -748,13 +758,17 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
}
//新增订单 客户联系人处理
private
void
adminSaveConsignorAndConsignee
(
OrderCreateReqVO
createReqVO
,
OrderDO
order
,
String
creator
,
Date
now
,
DictDataRespDTO
dictDataRespDTO
)
{
private
void
adminSaveConsignorAndConsignee
(
OrderCreateReqVO
createReqVO
,
OrderDO
order
,
String
creator
,
Date
now
,
DictDataRespDTO
dictDataRespDTO
)
{
OrderConsignorDO
orderConsignorDO
=
new
OrderConsignorDO
();
orderConsignorDO
.
setOrderId
(
order
.
getOrderId
());
orderConsignorDO
.
setCreator
(
creator
);
orderConsignorDO
.
setUpdater
(
creator
);
CustomerDO
consignorDO
=
customerService
.
getCustomer
(
createReqVO
.
getConsignorId
());
CustomerDO
consignorDO
=
customerService
.
getCustomer
(
createReqVO
.
getConsignorId
());
if
(
Objects
.
nonNull
(
consignorDO
))
{
orderConsignorDO
.
setCompany
(
consignorDO
.
getCompany
());
orderConsignorDO
.
setCompanyEn
(
consignorDO
.
getCompanyEn
());
...
...
@@ -763,7 +777,9 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
orderConsignorDO
.
setCountryAbbreviation
(
consignorCountryDO
.
getNameShort
());
}
}
CustomerContactsDO
consignorContactsDO
=
customerContactsService
.
getCustomerContacts
(
createReqVO
.
getConsignorContactsId
());
CustomerContactsDO
consignorContactsDO
=
customerContactsService
.
getCustomerContacts
(
createReqVO
.
getConsignorContactsId
());
if
(
Objects
.
nonNull
(
consignorContactsDO
))
{
if
(
StringUtils
.
isBlank
(
consignorContactsDO
.
getPhoneNew
()))
{
...
...
@@ -772,7 +788,6 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
if
(
StringUtils
.
isBlank
(
consignorContactsDO
.
getAreaCode
()))
{
throw
exception
(
CONSIGNOR_PHONE_CODE_NOT_NULL
);
}
orderConsignorDO
.
setName
(
consignorContactsDO
.
getName
());
orderConsignorDO
.
setNameEn
(
consignorContactsDO
.
getNameEn
());
orderConsignorDO
.
setCountryCode
(
consignorContactsDO
.
getAreaCode
());
...
...
@@ -781,7 +796,8 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
orderConsignorDO
.
setCustomerContactsId
(
consignorContactsDO
.
getId
());
orderConsignorDO
.
setCustomerId
(
consignorContactsDO
.
getCustomerId
());
}
else
{
if
(!
Objects
.
equals
(
createReqVO
.
getStatus
(),
OrderStatusEnum
.
DRAFT
.
getValue
()))
{
if
(!
Objects
.
equals
(
createReqVO
.
getStatus
(),
OrderStatusEnum
.
DRAFT
.
getValue
()))
{
if
(
StringUtils
.
isBlank
(
createReqVO
.
getConsignorPhone
()))
{
throw
exception
(
CONSIGNOR_PHONE_NOT_NULL
);
}
...
...
@@ -794,8 +810,10 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
orderConsignorDO
.
setCountryCode
(
createReqVO
.
getConsignorCountryCode
());
orderConsignorDO
.
setEmail
(
createReqVO
.
getConsignorEmail
());
}
if
(!
Objects
.
equals
(
createReqVO
.
getStatus
(),
OrderStatusEnum
.
DRAFT
.
getValue
()))
{
if
(
StringUtils
.
isBlank
(
orderConsignorDO
.
getPhone
())
||
StringUtils
.
isBlank
(
orderConsignorDO
.
getCountryCode
()))
{
if
(!
Objects
.
equals
(
createReqVO
.
getStatus
(),
OrderStatusEnum
.
DRAFT
.
getValue
()))
{
if
(
StringUtils
.
isBlank
(
orderConsignorDO
.
getPhone
())
||
StringUtils
.
isBlank
(
orderConsignorDO
.
getCountryCode
()))
{
throw
exception
(
ORDER_CONSIGNOR_PHONE_INFO_NOT_COMPLETE
);
}
if
(
StringUtils
.
isBlank
(
orderConsignorDO
.
getName
()))
{
...
...
@@ -853,7 +871,8 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
orderConsigneeDO
.
setOrderId
(
order
.
getOrderId
());
orderConsigneeDO
.
setCreator
(
creator
);
orderConsigneeDO
.
setUpdater
(
creator
);
CustomerDO
consigneeDO
=
customerService
.
getCustomer
(
createReqVO
.
getConsigneeId
());
CustomerDO
consigneeDO
=
customerService
.
getCustomer
(
createReqVO
.
getConsigneeId
());
if
(
consigneeDO
!=
null
)
{
orderConsigneeDO
.
setCompany
(
consigneeDO
.
getCompany
());
orderConsigneeDO
.
setCompanyEn
(
consigneeDO
.
getCompanyEn
());
...
...
@@ -869,7 +888,10 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
orderConsigneeDO
.
setAddress
(
createReqVO
.
getConsigneeAddress
());
orderConsignorDO
.
setCountryAbbreviation
(
createReqVO
.
getCountryAbbreviation
());
}
CustomerContactsDO
consigneeContactsDO
=
customerContactsService
.
getCustomerContacts
(
createReqVO
.
getConsigneeContactsId
());
//客户联系人
CustomerContactsDO
consigneeContactsDO
=
customerContactsService
.
getCustomerContacts
(
createReqVO
.
getConsigneeContactsId
());
if
(
null
!=
consigneeContactsDO
)
{
if
(
StringUtils
.
isBlank
(
consigneeContactsDO
.
getPhoneNew
()))
{
throw
exception
(
CONSIGNEE_PHONE_NOT_NULL
);
...
...
@@ -885,7 +907,9 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
orderConsigneeDO
.
setCustomerContactsId
(
consigneeContactsDO
.
getId
());
orderConsigneeDO
.
setCustomerId
(
consigneeContactsDO
.
getCustomerId
());
}
else
{
if
(!
Objects
.
equals
(
createReqVO
.
getStatus
(),
OrderStatusEnum
.
DRAFT
.
getValue
()))
{
if
(!
Objects
.
equals
(
createReqVO
.
getStatus
(),
OrderStatusEnum
.
DRAFT
.
getValue
()))
{
if
(
StringUtils
.
isBlank
(
createReqVO
.
getConsigneePhone
()))
{
throw
exception
(
CONSIGNEE_PHONE_NOT_NULL
);
}
...
...
@@ -900,7 +924,9 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
orderConsigneeDO
.
setPhone
(
createReqVO
.
getConsigneePhone
());
}
orderConsigneeDO
.
setHarvestMethod
(
createReqVO
.
getHarvestMethod
());
// 收货方式
orderConsigneeDO
.
setHarvestMethod
(
createReqVO
.
getHarvestMethod
());
//收货方式
if
(
StringUtils
.
isNotBlank
(
createReqVO
.
getConsigneeAddress
()))
{
orderConsigneeDO
.
setAddress
(
createReqVO
.
getConsigneeAddress
());
}
...
...
@@ -910,8 +936,12 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
orderConsigneeDO
.
setRelationId
(
createReqVO
.
getUserId
());
orderConsigneeDO
.
setCreateTime
(
now
);
orderConsigneeDO
.
setUpdateTime
(
now
);
if
(!
Objects
.
equals
(
createReqVO
.
getStatus
(),
OrderStatusEnum
.
DRAFT
.
getValue
()))
{
if
(
StringUtils
.
isBlank
(
orderConsigneeDO
.
getPhone
())
||
StringUtils
.
isBlank
(
orderConsigneeDO
.
getCountryCode
()))
{
if
(!
Objects
.
equals
(
createReqVO
.
getStatus
(),
OrderStatusEnum
.
DRAFT
.
getValue
()))
{
if
(
StringUtils
.
isBlank
(
orderConsigneeDO
.
getPhone
())
||
StringUtils
.
isBlank
(
orderConsigneeDO
.
getCountryCode
()))
{
throw
exception
(
ORDER_CONSIGNEE_PHONE_INFO_NOT_COMPLETE
);
}
if
(
StringUtils
.
isBlank
(
orderConsigneeDO
.
getName
()))
{
...
...
@@ -946,9 +976,16 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
if
(
StringUtils
.
isNotBlank
(
orderConsigneeDO
.
getPhone
()))
{
orderConsigneeService
.
save
(
orderConsigneeDO
);
}
if
(!
Objects
.
equals
(
createReqVO
.
getStatus
(),
OrderStatusEnum
.
DRAFT
.
getValue
()))
{
if
(!
Objects
.
equals
(
createReqVO
.
getStatus
(),
OrderStatusEnum
.
DRAFT
.
getValue
()))
{
// 发货人 1 收货人 2
int
customerType
=
this
.
checkOrderSalesman
(
order
,
createReqVO
.
getOfferId
(),
null
,
null
,
orderConsignorDO
,
orderConsigneeDO
);
int
customerType
=
this
.
checkOrderSalesman
(
order
,
createReqVO
.
getOfferId
(),
null
,
null
,
orderConsignorDO
,
orderConsigneeDO
);
// 更新所属客户经理(业务员)
if
(
Objects
.
nonNull
(
order
.
getCustomerId
())
&&
order
.
getCustomerId
()
>
0
)
{
...
...
yudao-module-order/yudao-module-order-core/src/main/java/cn/iocoder/yudao/module/order/service/orderWarehouseIn/OrderWarehouseInServiceImpl.java
View file @
b69c740e
...
...
@@ -1206,7 +1206,8 @@ public class OrderWarehouseInServiceImpl extends AbstractService<OrderWarehouseI
channelPackagingOverWeightAdditionalBoList
=
new
ArrayList
<>();
if
(!
isSplitOrderChildren
&&
isNotRollbackIn
)
{
channelPackagingOverWeightAdditionalBoList
=
genChannelPackagingOverweightAdditionalBoList
(
orderDO
,
orderWarehouseInDOList
);
genChannelPackagingOverweightAdditionalBoList
(
orderDO
,
orderWarehouseInDOList
);
}
// 重泡货配置
...
...
@@ -1462,7 +1463,6 @@ public class OrderWarehouseInServiceImpl extends AbstractService<OrderWarehouseI
*/
// end 入仓完成,计算V值 lanbm 2024-05-13 add
// 返回是否包含异常
return
exceptionNum
>
0
;
}
...
...
@@ -1801,7 +1801,7 @@ public class OrderWarehouseInServiceImpl extends AbstractService<OrderWarehouseI
/*
处理多箱或少箱异常
lanbm
2024-06-04 添加注释
2024-06-04 添加注释
ecw_order_exception_result 异常处理记录表
*/
private
void
processMoreOrLessException
(
Long
orderId
,
...
...
@@ -1883,7 +1883,7 @@ public class OrderWarehouseInServiceImpl extends AbstractService<OrderWarehouseI
autoProcessExceptionRemark
,
OrderExceptionResult
.
ORDER_LACK_BOX_EXCEPTION_RESULT
.
CONFIRM_CORRECT
);
// 删除多箱的未处理异常
//
lanbm 2024-06-23
处理少箱异常的时间问题
//处理少箱异常的时间问题
orderExceptionService
.
autoProcessException
(
orderId
,
null
,
OrderExceptionEnum
.
ORDER_SUPERFLUOUS_BOX_EXCEPTION
,
autoProcessExceptionRemark
,
...
...
yudao-module-order/yudao-module-order-core/src/main/java/cn/iocoder/yudao/module/order/service/targetLog/TargetLogServiceImpl.java
View file @
b69c740e
...
...
@@ -132,10 +132,12 @@ public class TargetLogServiceImpl extends AbstractService<TargetLogMapper, Targe
@Override
public
void
addTargetLogs
(
List
<
Long
>
orderIds
,
Date
achievementTime
,
TargetLogEnum
targetLogEnum
)
{
if
(
targetLogEnum
.
getType
()
==
3
)
{
//合单,合单前的所有订单业绩归0
if
(
targetLogEnum
.
getType
()
==
3
)
{
//合单,合单前的所有订单业绩归0
orderIds
.
stream
().
forEach
(
item
->
targetLogMapper
.
delete
(
new
LambdaQueryWrapperX
<
TargetLogDO
>()
.
eq
(
TargetLogDO:
:
getOrderId
,
item
)));
}
else
if
(
targetLogEnum
.
getType
()
==
4
)
{
//拆单,分别计算每个订单的业绩归属
}
else
if
(
targetLogEnum
.
getType
()
==
4
)
{
//拆单,分别计算每个订单的业绩归属
orderIds
.
stream
().
forEach
(
item
->
dealTargetLog
(
item
,
achievementTime
,
targetLogEnum
.
getType
()));
}
}
...
...
@@ -342,7 +344,6 @@ public class TargetLogServiceImpl extends AbstractService<TargetLogMapper, Targe
//customerId = info.getConsignorVO().getCustomerId();
//二期需求修改
customerId
=
consignorDO
.
getId
();
}
else
{
OrderConsigneeDO
orderConsigneeDO
=
orderConsigneeService
.
getOne
(
...
...
@@ -456,7 +457,6 @@ public class TargetLogServiceImpl extends AbstractService<TargetLogMapper, Targe
}
}
}
TargetLogDO
targetLogDO
=
targetLogMapper
.
selectById
(
targetId
);
//客户ID
...
...
yudao-module-order/yudao-module-order-rest/src/main/java/cn/iocoder/yudao/module/order/controller/admin/order/OrderController.java
View file @
b69c740e
...
...
@@ -134,7 +134,8 @@ public class OrderController {
@DynamicRateLimiter
(
base
=
"#Headers['Authorization']"
,
permits
=
1
)
@Idempotent
(
timeout
=
5
)
// @PreAuthorize("@ss.hasPermission('ecw:order:create')")
public
CommonResult
<
Long
>
createOrder
(
@Valid
@RequestBody
OrderCreateReqVO
createReqVO
)
{
public
CommonResult
<
Long
>
createOrder
(
@Valid
@RequestBody
OrderCreateReqVO
createReqVO
)
{
if
(
null
==
createReqVO
.
getStatus
())
{
createReqVO
.
setStatus
(
0
);
}
...
...
yudao-module-sale/yudao-module-sale-core/src/main/java/cn/iocoder/yudao/module/sale/service/deptTarget/DeptTargetServiceImpl.java
View file @
b69c740e
...
...
@@ -154,7 +154,9 @@ public class DeptTargetServiceImpl extends AbstractService<DeptTargetMapper, Dep
}
@Override
public
MyAchievementRetDto
myAchievementByPage
(
DeptTargetQueryVO
query
,
PageVO
page
)
{
public
MyAchievementRetDto
myAchievementByPage
(
DeptTargetQueryVO
query
,
PageVO
page
)
{
LoginUser
loginUser
=
SecurityFrameworkUtils
.
getLoginUser
();
MyAchievementRetDto
myAchievementRetDto
=
new
MyAchievementRetDto
();
// List<Long> collect = new ArrayList<>();
...
...
@@ -170,19 +172,27 @@ public class DeptTargetServiceImpl extends AbstractService<DeptTargetMapper, Dep
query
.
setId
(
loginUser
.
getId
());
}
if
(
StringUtils
.
isNotBlank
(
query
.
getDestWarehouseIds
()))
{
List
<
Integer
>
destWarehouseIds
=
Arrays
.
stream
(
query
.
getDestWarehouseIds
().
split
(
","
)).
map
(
Integer:
:
parseInt
).
collect
(
Collectors
.
toList
());
List
<
Integer
>
destWarehouseIds
=
Arrays
.
stream
(
query
.
getDestWarehouseIds
().
split
(
","
)).
map
(
Integer:
:
parseInt
).
collect
(
Collectors
.
toList
());
query
.
setDestWarehouseIdList
(
destWarehouseIds
);
}
List
<
PostDO
>
posts
=
postService
.
getPosts
(
loginUser
.
getPostIds
());
List
<
PostDO
>
customer_service
=
posts
.
stream
().
filter
(
item
->
item
.
getCode
().
contains
(
"customer service"
)&&!
item
.
getCode
().
contains
(
"documentary"
)).
collect
(
Collectors
.
toList
());
if
(!
"my"
.
equals
(
query
.
getFlag
())
||
(
loginUser
.
getPostIds
()
!=
null
&&
customer_service
!=
null
&&
customer_service
.
size
()>
0
)){
List
<
PostDO
>
posts
=
postService
.
getPosts
(
loginUser
.
getPostIds
());
List
<
PostDO
>
customer_service
=
posts
.
stream
().
filter
(
item
->
item
.
getCode
().
contains
(
"customer service"
)&&!
item
.
getCode
().
contains
(
"documentary"
)).
collect
(
Collectors
.
toList
());
if
(!
"my"
.
equals
(
query
.
getFlag
())
||
(
loginUser
.
getPostIds
()
!=
null
&&
customer_service
!=
null
&&
customer_service
.
size
()>
0
)){
deptTargetMapper
.
getMyAchievementByPage
(
query
,
mpPage
);
myAchievementRetDto
.
setMyAchievementDtos
(
PageResult
.
of
(
mpPage
));
// PageVO pageVO = new PageVO();
// pageVO.setField("c.create_time");
// pageVO.setRows(Integer.MAX_VALUE);
// IPage<MyAchievementDto> mpPage1 = MyBatisUtils.buildPage(pageVO);
List
<
MyAchievementDto
>
myAchievementByPage
=
deptTargetMapper
.
getMyAchievement
(
query
);
List
<
MyAchievementDto
>
myAchievementByPage
=
deptTargetMapper
.
getMyAchievement
(
query
);
// IPage<MyAchievementDto> myAchievementByPage = deptTargetMapper.getMyAchievementByPage(query, mpPage1);
//总数
myAchievementRetDto
.
setTotalNum
(
myAchievementByPage
.
stream
().
mapToInt
(
MyAchievementDto:
:
getSumNum
).
sum
());
...
...
yudao-module-sale/yudao-module-sale-core/src/main/resources/mapper/deptTarget/DeptTargetMapper.xml
View file @
b69c740e
...
...
@@ -48,7 +48,7 @@
( CASE WHEN t6.is_new = 1 THEN '新客户' ELSE '旧客户' END ) AS achieveType,
t2.number,
t1.order_no,
t3.`name`
,
(CASE WHEN t9.customer_id=t.customer_id THEN t9.name ELSE tx.name END) as name
,
t3.phone_new,
t1.marks,
t1.air_shipment,
...
...
@@ -76,6 +76,8 @@
left join ecw_customer t6 on t.customer_id=t6.id and t6.deleted=0
left join ecw_order_departure t7 on t1.order_id=t7.order_id
left join ecw_order_objective t8 on t1.order_id=t8.order_id
left join ecw_order_consignor t9 on t.customer_id=t9.customer_id and t9.deleted=0 and t.order_id=t9.order_id
left join ecw_order_consignee tx on t.customer_id=tx.customer_id and tx.deleted=0 and t.order_id=tx.order_id
where 1=1 and t.deleted=0 and t1.deleted=0
<if
test=
"query.flag != null and query.flag=='my'"
>
and t.user_id=#{query.id}
...
...
@@ -133,7 +135,7 @@
( CASE WHEN t6.is_new = 1 THEN '新客户' ELSE '旧客户' END ) AS achieveType,
t2.number,
t1.order_no,
t3.`name`
,
(CASE WHEN t9.customer_id=t.customer_id THEN t9.name ELSE tx.name END) as name
,
t3.phone_new,
t1.marks,
t1.air_shipment,
...
...
@@ -161,10 +163,13 @@
ecw_target_log t
LEFT JOIN ecw_order t1 ON t.order_id = t1.order_id
LEFT JOIN ecw_offer t2 ON t1.order_id = t2.order_id and t2.deleted=0
LEFT JOIN ecw_customer_contacts t3 ON t.customer_id = t3.customer_id AND t3.is_default = 1 and t3.deleted=0
LEFT JOIN ecw_customer_contacts t3 ON t.customer_id = t3.customer_id
AND t3.is_default = 1 and t3.deleted=0
left join ecw_customer t6 on t.customer_id=t6.id and t6.deleted=0
left join ecw_order_departure t7 on t1.order_id=t7.order_id
left join ecw_order_objective t8 on t1.order_id=t8.order_id
left join ecw_order_consignor t9 on t.customer_id=t9.customer_id and t9.deleted=0 and t.order_id=t9.order_id
left join ecw_order_consignee tx on t.customer_id=tx.customer_id and tx.deleted=0 and t.order_id=tx.order_id
where 1=1 and t.deleted=0 and t1.deleted=0
<if
test=
"query.flag != null and query.flag=='my'"
>
and t.user_id=#{query.id}
...
...
@@ -222,7 +227,7 @@
( CASE WHEN t6.is_new = 1 THEN '新客户' ELSE '旧客户' END ) AS achieveType,
t2.number,
t1.order_no,
t3.`name`
,
(CASE WHEN t9.customer_id=t.customer_id THEN t9.name ELSE tx.name END) as name
,
t3.phone_new,
t1.marks,
t1.air_shipment,
...
...
@@ -250,6 +255,8 @@
left join ecw_customer t6 on t.customer_id=t6.id and t6.deleted=0
left join ecw_order_departure t7 on t1.order_id=t7.order_id
left join ecw_order_objective t8 on t1.order_id=t8.order_id
left join ecw_order_consignor t9 on t.customer_id=t9.customer_id and t9.deleted=0 and t.order_id=t9.order_id
left join ecw_order_consignee tx on t.customer_id=tx.customer_id and tx.deleted=0 and t.order_id=tx.order_id
where t.deleted=0 and t1.deleted=0
and t.user_id in
<foreach
collection=
"query.userIds"
item=
"item"
separator=
","
open=
"("
close=
")"
>
...
...
@@ -308,7 +315,7 @@
( CASE WHEN t6.is_new = 1 THEN '新客户' ELSE '旧客户' END ) AS achieveType,
t2.number,
t1.order_no,
t3.`name`
,
(CASE WHEN t9.customer_id=t.customer_id THEN t9.name ELSE tx.name END) as name
,
t3.phone_new,
t1.marks,
t1.air_shipment,
...
...
@@ -336,6 +343,8 @@
left join ecw_customer t6 on t.customer_id=t6.id and t6.deleted=0
left join ecw_order_departure t7 on t1.order_id=t7.order_id
left join ecw_order_objective t8 on t1.order_id=t8.order_id
left join ecw_order_consignor t9 on t.customer_id=t9.customer_id and t9.deleted=0 and t.order_id=t9.order_id
left join ecw_order_consignee tx on t.customer_id=tx.customer_id and tx.deleted=0 and t.order_id=tx.order_id
where t.deleted=0 and t1.deleted=0
and t.user_id in
<foreach
collection=
"query.userIds"
item=
"item"
separator=
","
open=
"("
close=
")"
>
...
...
yudao-module-sale/yudao-module-sale-rest/src/main/java/cn/iocoder/yudao/module/sale/controller/admin/deptTarget/DeptTargetController.java
View file @
b69c740e
...
...
@@ -187,11 +187,13 @@ public class DeptTargetController {
@DataPermission
(
includeRules
=
{
DeptDataPermissionRule
.
class
})
@ApiOperation
(
"全部业绩分页"
)
//@PreAuthorize("@ss.hasPermission('ecw:dept-target:query')")
public
CommonResult
<
MyAchievementRetDto
>
allAchievementByPage
(
@RequestBody
DeptTargetQueryVO
query
)
{
public
CommonResult
<
MyAchievementRetDto
>
allAchievementByPage
(
@RequestBody
DeptTargetQueryVO
query
)
{
PageVO
pageVO
=
new
PageVO
();
pageVO
.
setPage
(
query
.
getPageNo
());
pageVO
.
setRows
(
query
.
getPageSize
());
MyAchievementRetDto
pageResult
=
deptTargetService
.
myAchievementByPage
(
query
,
pageVO
);
MyAchievementRetDto
pageResult
=
deptTargetService
.
myAchievementByPage
(
query
,
pageVO
);
return
success
(
pageResult
);
}
...
...
@@ -233,7 +235,8 @@ public class DeptTargetController {
public
void
exportStatisticsExcel
(
@Valid
DeptTargetQueryVO
exportReqVO
,
HttpServletResponse
response
)
throws
IOException
{
//TODO
List
<
AchievementStatisticsDto
>
list
=
deptTargetService
.
getExportStatisticsExcel
(
exportReqVO
);
List
<
AchievementStatisticsDto
>
list
=
deptTargetService
.
getExportStatisticsExcel
(
exportReqVO
);
// List<CurrencyDO> list = currencyService.getCurrencyList(exportReqVO);
// // 导出 Excel
// List<CurrencyExcelVO> datas = CurrencyConvert.INSTANCE.convertList02(list);
...
...
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