Commit bdef71b4 authored by liuzeheng's avatar liuzeheng

Merge remote-tracking branch 'origin/dev' into dev

parents ba7a8458 9e373d99
package cn.iocoder.yudao.framework.apollo.core.event.Customer;
import lombok.Data;
/*
发货人代码的客户去向处理逻辑
lanbm 2024-05-27 add
*/
@Data
public class CustomerGoEvent {
}
...@@ -2898,12 +2898,16 @@ public class CustomerServiceImpl extends AbstractService<CustomerMapper, Custome ...@@ -2898,12 +2898,16 @@ public class CustomerServiceImpl extends AbstractService<CustomerMapper, Custome
} }
@Override @Override
public void updateCustomerByFinishWarehouseIn(Long customerId, Long orderId, String orderNo, Date rucangTime) { public void updateCustomerByFinishWarehouseIn(Long customerId,
Long orderId,
String orderNo,
Date rucangTime) {
//更新客户状态 //更新客户状态
CustomerDO customer = customerMapper.selectById(customerId); CustomerDO customer = customerMapper.selectById(customerId);
if (customer != null) { if (customer != null) {
Date oldEstimateEnterOpenSeaTime = customer.getEstimateEnterOpenSeaTime(); Date oldEstimateEnterOpenSeaTime =
customer.getEstimateEnterOpenSeaTime();
boolean isFcl = isFcl(customer); boolean isFcl = isFcl(customer);
//海运整柜 不掉入公海 //海运整柜 不掉入公海
...@@ -2956,7 +2960,8 @@ public class CustomerServiceImpl extends AbstractService<CustomerMapper, Custome ...@@ -2956,7 +2960,8 @@ public class CustomerServiceImpl extends AbstractService<CustomerMapper, Custome
customerOperateLogService.createOperateLog(customerOperateLogCreateReqVO); customerOperateLogService.createOperateLog(customerOperateLogCreateReqVO);
//转成成交客户 //转成成交客户
if (CustomerStatusEnum.CLUE.getValue().equals(customer.getStatus()) || CustomerStatusEnum.INTENTION.getValue().equals(customer.getStatus())) { if (CustomerStatusEnum.CLUE.getValue().equals(customer.getStatus()) ||
CustomerStatusEnum.INTENTION.getValue().equals(customer.getStatus())) {
this.updateCustomerStatus(customerId, CustomerStatusEnum.DEAL); this.updateCustomerStatus(customerId, CustomerStatusEnum.DEAL);
} }
} }
......
...@@ -42,16 +42,25 @@ public class CalculateOrderVValueListener { ...@@ -42,16 +42,25 @@ public class CalculateOrderVValueListener {
@EventListener(CalculateOrderVValueEvent.class) @EventListener(CalculateOrderVValueEvent.class)
public void CalculateOrderVValuePushEvent( public void CalculateOrderVValuePushEvent(
CalculateOrderVValueEvent event) { CalculateOrderVValueEvent event) {
zTest m=new zTest(); zTest m = new zTest();
String sMsg="计算V值"; String sMsg = "计算V值";
OrderDO orderDO = orderService.getById(event.getOrderId()); OrderDO orderDO = orderService.getById(event.getOrderId());
if (orderDO == null) { if (orderDO == null) {
throw exception(ORDER_NOT_EXISTS); throw exception(ORDER_NOT_EXISTS);
} }
if (orderDO.getRucangTime() == null) {
sMsg += ",订单入仓时间为空,暂不处理。";
m.setTestname(sMsg);
m.setCreatedate(new Date());
zTestService.save(m);
return;
}
//订单状态为已入仓之后的状态,其他状态是否排除,后续和客户确认,先按此逻辑处理 //订单状态为已入仓之后的状态,其他状态是否排除,后续和客户确认,先按此逻辑处理
int nS = orderDO.getStatus(); int nS = orderDO.getStatus();
if (nS >= 5) { if (nS >= 5) {
sMsg+=",已入仓"; sMsg += ",已入仓";
//查询配置参数信息 //查询配置参数信息
EcwVz temp = null; EcwVz temp = null;
BigDecimal CalVvalue = new BigDecimal(0); BigDecimal CalVvalue = new BigDecimal(0);
...@@ -62,7 +71,12 @@ public class CalculateOrderVValueListener { ...@@ -62,7 +71,12 @@ public class CalculateOrderVValueListener {
if (temp == null) { if (temp == null) {
throw exception(VCONFIG_NOT_EXISTS); throw exception(VCONFIG_NOT_EXISTS);
} }
if (orderDO.getSumVolume() == null ||
orderDO.getSumVolume().equals(new BigDecimal(0)) == true) {
CalVvalue = new BigDecimal(0);
} else {
CalVvalue = new BigDecimal(temp.getVz()).divide(orderDO.getSumVolume()); CalVvalue = new BigDecimal(temp.getVz()).divide(orderDO.getSumVolume());
}
} else if (orderDO.getTransportId() == 3) { } else if (orderDO.getTransportId() == 3) {
//空运计算V值 //空运计算V值
temp = ecwVzService.getOne(new LambdaQueryWrapperX<EcwVz>() temp = ecwVzService.getOne(new LambdaQueryWrapperX<EcwVz>()
...@@ -70,8 +84,13 @@ public class CalculateOrderVValueListener { ...@@ -70,8 +84,13 @@ public class CalculateOrderVValueListener {
if (temp == null) { if (temp == null) {
throw exception(VCONFIG_NOT_EXISTS); throw exception(VCONFIG_NOT_EXISTS);
} }
if (orderDO.getSumWeight() == null ||
orderDO.getSumWeight().equals(new BigDecimal(0)) == true) {
CalVvalue = new BigDecimal(0);
} else {
CalVvalue = new BigDecimal(temp.getVz()).divide(orderDO.getSumWeight()); CalVvalue = new BigDecimal(temp.getVz()).divide(orderDO.getSumWeight());
} }
}
//计算业绩产生时间 //计算业绩产生时间
if (orderDO.getRucangTime() == null) { if (orderDO.getRucangTime() == null) {
...@@ -81,10 +100,8 @@ public class CalculateOrderVValueListener { ...@@ -81,10 +100,8 @@ public class CalculateOrderVValueListener {
} }
orderService.UpdateOrderVValue(event.getOrderId(), CalVvalue, orderService.UpdateOrderVValue(event.getOrderId(), CalVvalue,
event.getYejiCreateDate()); event.getYejiCreateDate());
} } else {
else sMsg += ",未入仓";
{
sMsg+=",未入仓";
} }
m.setTestname(sMsg); m.setTestname(sMsg);
......
...@@ -55,7 +55,12 @@ public class CalculateOrderYeJiTypeListener { ...@@ -55,7 +55,12 @@ public class CalculateOrderYeJiTypeListener {
event.setCustomerId(orderDO.getCustomerId()); event.setCustomerId(orderDO.getCustomerId());
CustomerDO customerDO = customerService.getById(event.getCustomerId()); CustomerDO customerDO = customerService.getById(event.getCustomerId());
if (customerDO == null) { if (customerDO == null) {
throw exception(CUSTOMER_NOT_EXISTS); //throw exception(CUSTOMER_NOT_EXISTS);
sMsg+=",客户不存在先不计算业绩类型";
m.setTestname(sMsg);
m.setCreatedate(new Date());
zTestService.save(m);
return;
} }
int isNew = 0; int isNew = 0;
......
package cn.iocoder.yudao.module.delivery.listener;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
/*
发货人带来的客户的去向处理逻辑
lanbm 2024-05-27 add
*/
@Component("CustomerGoListener")
@AllArgsConstructor
@Slf4j
public class CustomerGoListener {
}
...@@ -911,7 +911,9 @@ public class OrderExceptionServiceImpl extends AbstractService<OrderExceptionMap ...@@ -911,7 +911,9 @@ public class OrderExceptionServiceImpl extends AbstractService<OrderExceptionMap
List<CustomerDO> list = new ArrayList<>(); List<CustomerDO> list = new ArrayList<>();
list.add(customerService.getCustomer(orderExceptionDO.getCustomerId())); list.add(customerService.getCustomer(orderExceptionDO.getCustomerId()));
customerService.assignedCustomer(list, Long.parseLong(vo.getCustomerService()), CustomerOperateTypeEnum.ASSIGN, "处理未分配客户经理异常时分配", null); customerService.assignedCustomer(list,
Long.parseLong(vo.getCustomerService()),
CustomerOperateTypeEnum.ASSIGN, "处理未分配客户经理异常时分配", null);
} else if (vo.getOrderExceptionHandlerResult().equals(OrderExceptionResult.NOT_CUSTOMER_SERVICE_EXCEPTION_RESULT.NOT)) { } else if (vo.getOrderExceptionHandlerResult().equals(OrderExceptionResult.NOT_CUSTOMER_SERVICE_EXCEPTION_RESULT.NOT)) {
orderExceptionDO.setOrderExceptionStatus(2); orderExceptionDO.setOrderExceptionStatus(2);
} }
......
...@@ -151,7 +151,7 @@ public class OrderController { ...@@ -151,7 +151,7 @@ public class OrderController {
} }
} }
//lanbm 2024-05-13 添加注释 //lanbm 2024-05-13 添加注释 member_user 注册会员用户
Long orderId = orderService.createOrder(createReqVO, null).getOrderId(); Long orderId = orderService.createOrder(createReqVO, null).getOrderId();
return success(orderId); return success(orderId);
} }
......
...@@ -107,7 +107,8 @@ public class OrderExceptionController { ...@@ -107,7 +107,8 @@ public class OrderExceptionController {
@ApiOperation("根据订单ID获取所有的订单异常列表") @ApiOperation("根据订单ID获取所有的订单异常列表")
@ApiImplicitParam(name = "orderId", value = "订单ID", required = true, example = "1024", dataTypeClass = Long.class) @ApiImplicitParam(name = "orderId", value = "订单ID", required = true, example = "1024", dataTypeClass = Long.class)
public CommonResult<List<OrderExceptionBackVO>> getOrderExceptionListByOrderId(@RequestParam("orderId") Long orderId) { public CommonResult<List<OrderExceptionBackVO>> getOrderExceptionListByOrderId(@RequestParam("orderId") Long orderId) {
List<OrderExceptionBackVO> list = orderExceptionService.getOrderExceptionListByOrderId(orderId); List<OrderExceptionBackVO> list =
orderExceptionService.getOrderExceptionListByOrderId(orderId);
return success(list); return success(list);
} }
......
...@@ -69,7 +69,8 @@ public class OrderWarehouseInController { ...@@ -69,7 +69,8 @@ public class OrderWarehouseInController {
/** /**
* 订单完成入仓操作的放重复提交缓存key * 订单完成入仓操作的放重复提交缓存key
*/ */
private static final String ORDER_FINISH_WAREHOUSE_IN_KEY = "jiedao:order:finish:warehouse:in:{0}"; private static final String ORDER_FINISH_WAREHOUSE_IN_KEY =
"jiedao:order:finish:warehouse:in:{0}";
@PostMapping("/create") @PostMapping("/create")
......
...@@ -137,13 +137,16 @@ public class MyOrderController { ...@@ -137,13 +137,16 @@ public class MyOrderController {
Long userId = loginUser.getId(); Long userId = loginUser.getId();
createReqVO.setUserId(userId); createReqVO.setUserId(userId);
MemberUserDO memberUserDO = memberUserService.info(userId); MemberUserDO memberUserDO = memberUserService.info(userId);
if (Objects.isNull(memberUserDO) || memberUserDO.getStatus() == 1 || memberUserDO.getDeleted()) { if (Objects.isNull(memberUserDO) ||
memberUserDO.getStatus() == 1 ||
memberUserDO.getDeleted()) {
return error(MEMBER_NOT_EXISTS); return error(MEMBER_NOT_EXISTS);
} }
if (null == createReqVO.getStatus()) { if (null == createReqVO.getStatus()) {
createReqVO.setStatus(2); createReqVO.setStatus(2);
} }
if (StringUtils.isNotBlank(createReqVO.getType()) && createReqVO.getType().contains("4")) { if (StringUtils.isNotBlank(createReqVO.getType()) &&
createReqVO.getType().contains("4")) {
// TODO 客户端下单处理未知的类型 // TODO 客户端下单处理未知的类型
String type = Arrays.stream(createReqVO.getType().split(StrUtil.COMMA)).filter(s -> !StringUtils.equals("4", s)).filter(StringUtils::isNotBlank).collect(Collectors.joining(StrUtil.COMMA)); String type = Arrays.stream(createReqVO.getType().split(StrUtil.COMMA)).filter(s -> !StringUtils.equals("4", s)).filter(StringUtils::isNotBlank).collect(Collectors.joining(StrUtil.COMMA));
createReqVO.setType(type); createReqVO.setType(type);
......
...@@ -2224,7 +2224,8 @@ public class BoxServiceImpl extends AbstractService<BoxMapper, BoxDO> implements ...@@ -2224,7 +2224,8 @@ public class BoxServiceImpl extends AbstractService<BoxMapper, BoxDO> implements
Long deptId = SecurityFrameworkUtils.getLoginUser().getDeptId(); Long deptId = SecurityFrameworkUtils.getLoginUser().getDeptId();
DeptWarehouseBaseVO deptWarehouseBaseVO = new DeptWarehouseBaseVO(); DeptWarehouseBaseVO deptWarehouseBaseVO = new DeptWarehouseBaseVO();
deptWarehouseBaseVO.setDeptId(deptId); deptWarehouseBaseVO.setDeptId(deptId);
List<DeptWarehouseDO> deptWarehouseDOS = warehouseService.deptList(deptWarehouseBaseVO); List<DeptWarehouseDO> deptWarehouseDOS =
warehouseService.deptList(deptWarehouseBaseVO);
if (CollectionUtil.isEmpty(deptWarehouseDOS)) { if (CollectionUtil.isEmpty(deptWarehouseDOS)) {
throw exception(DEPT_NOT_FOUND); throw exception(DEPT_NOT_FOUND);
...@@ -2319,11 +2320,11 @@ public class BoxServiceImpl extends AbstractService<BoxMapper, BoxDO> implements ...@@ -2319,11 +2320,11 @@ public class BoxServiceImpl extends AbstractService<BoxMapper, BoxDO> implements
return boxInfoQuery1(result, searchDcDate); return boxInfoQuery1(result, searchDcDate);
} }
private PageResult<BoxBackVO> boxInfoQuery1(PageResult<BoxBackVO> result, boolean searchDcDate) { private PageResult<BoxBackVO> boxInfoQuery1(PageResult<BoxBackVO> result,
boolean searchDcDate) {
List<BoxBackVO> boxBackList = result.getList(); List<BoxBackVO> boxBackList = result.getList();
if (CollectionUtil.isNotEmpty(boxBackList)) { if (CollectionUtil.isNotEmpty(boxBackList)) {
List<Long> idList = boxBackList.stream() List<Long> idList = boxBackList.stream()
.map(BoxBaseBackVO::getId) .map(BoxBaseBackVO::getId)
.collect(Collectors.toList()); .collect(Collectors.toList());
...@@ -2361,12 +2362,14 @@ public class BoxServiceImpl extends AbstractService<BoxMapper, BoxDO> implements ...@@ -2361,12 +2362,14 @@ public class BoxServiceImpl extends AbstractService<BoxMapper, BoxDO> implements
.collect(Collectors.toList()); .collect(Collectors.toList());
Map<Long, ChannelDO> channelMap = new HashMap<>(); Map<Long, ChannelDO> channelMap = new HashMap<>();
if (CollectionUtils.isNotEmpty(channelIdList)) { if (CollectionUtils.isNotEmpty(channelIdList)) {
List<ChannelDO> channelDOList = channelService.getChannelList(channelIdList); List<ChannelDO> channelDOList =
channelService.getChannelList(channelIdList);
channelMap = channelDOList.stream() channelMap = channelDOList.stream()
.collect(Collectors.toMap(ChannelDO::getChannelId, v -> v)); .collect(Collectors.toMap(ChannelDO::getChannelId, v -> v));
} }
List<BoxApprovalDO> approvalDOList = boxApprovalService.getBackApprovalList(idList); List<BoxApprovalDO> approvalDOList =
boxApprovalService.getBackApprovalList(idList);
Map<Long, List<BoxApprovalDO>> shipmentApprovalMap = approvalDOList.stream() Map<Long, List<BoxApprovalDO>> shipmentApprovalMap = approvalDOList.stream()
.collect(Collectors.groupingBy(BoxApprovalDO::getShipmentId)); .collect(Collectors.groupingBy(BoxApprovalDO::getShipmentId));
...@@ -2411,7 +2414,8 @@ public class BoxServiceImpl extends AbstractService<BoxMapper, BoxDO> implements ...@@ -2411,7 +2414,8 @@ public class BoxServiceImpl extends AbstractService<BoxMapper, BoxDO> implements
} }
} }
List<BoxApprovalDO> itemApprovalList = shipmentApprovalMap.get(shipmentId); List<BoxApprovalDO> itemApprovalList =
shipmentApprovalMap.get(shipmentId);
if (CollectionUtils.isNotEmpty(itemApprovalList)) { if (CollectionUtils.isNotEmpty(itemApprovalList)) {
BoxApprovalDO boxApprovalDO = itemApprovalList.get(0); BoxApprovalDO boxApprovalDO = itemApprovalList.get(0);
//查询反审信息 //查询反审信息
...@@ -2507,7 +2511,8 @@ public class BoxServiceImpl extends AbstractService<BoxMapper, BoxDO> implements ...@@ -2507,7 +2511,8 @@ public class BoxServiceImpl extends AbstractService<BoxMapper, BoxDO> implements
.likeIfPresent(BoxDO::getSelfNo, .likeIfPresent(BoxDO::getSelfNo,
query.getSelfNo()) query.getSelfNo())
//已出仓 222 //已出仓 222
.eq(BoxDO::getCheckoutStatus, AirCheckoutStatusEnum.CHECKOUT.getStatus()) .eq(BoxDO::getCheckoutStatus,
AirCheckoutStatusEnum.CHECKOUT.getStatus())
.and( .and(
i -> i.and(t -> i -> i.and(t ->
t.eq(BoxDO::getDcCustomsStatus, 3) t.eq(BoxDO::getDcCustomsStatus, 3)
...@@ -2544,7 +2549,8 @@ public class BoxServiceImpl extends AbstractService<BoxMapper, BoxDO> implements ...@@ -2544,7 +2549,8 @@ public class BoxServiceImpl extends AbstractService<BoxMapper, BoxDO> implements
); );
boxBackVO.setOrderNum(orderNum); boxBackVO.setOrderNum(orderNum);
long orderExitNum = boxOrderExitService.count(new LambdaQueryWrapper<BoxOrderExitDO>() long orderExitNum = boxOrderExitService.count(
new LambdaQueryWrapper<BoxOrderExitDO>()
.eq(BoxOrderExitDO::getShipmentId, shipmentId) .eq(BoxOrderExitDO::getShipmentId, shipmentId)
); );
boxBackVO.setOrderExitNum(orderExitNum); boxBackVO.setOrderExitNum(orderExitNum);
......
...@@ -75,6 +75,8 @@ public class MyBoxController { ...@@ -75,6 +75,8 @@ public class MyBoxController {
@PostMapping("/exitPageAir") @PostMapping("/exitPageAir")
@ApiOperation("获得退场出货分页, use this") @ApiOperation("获得退场出货分页, use this")
public CommonResult<PageResult<BoxBackVO>> getBoxExitPageAir(@Valid @RequestBody MyBoxExitQueryVO query) { public CommonResult<PageResult<BoxBackVO>> getBoxExitPageAir(@Valid @RequestBody MyBoxExitQueryVO query) {
//空运退场到仓列表 lanbm 2024-05-27 添加注释
//此出有个仓库权限的限制,管来没有权限,数据符合逻辑也是显示不出来信息的
PageResult<BoxBackVO> pageResult = boxService.getBoxExitPageAir(query); PageResult<BoxBackVO> pageResult = boxService.getBoxExitPageAir(query);
return success(pageResult); return success(pageResult);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment