Commit 954da1d1 authored by zhengyi's avatar zhengyi

订单收货信息切换bug修复

parent 474b7897
......@@ -312,7 +312,17 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
String creator = String.valueOf(loginUser != null ? loginUser.getId() : null);
Date now = new Date();
if (Objects.nonNull(createReqVO.getHarvestMethod()) && createReqVO.getHarvestMethod() == 2) {
order.setCountry(createReqVO.getCountry());
order.setProvince(createReqVO.getProvince());
order.setCity(createReqVO.getCity());
order.setConsigneeAddress(createReqVO.getConsigneeAddress());
} else {
order.setCountry(0L);
order.setProvince(0L);
order.setCity(0L);
order.setConsigneeAddress("");
}
order.setCreator(creator);
order.setUpdater(creator);
order.setCreateTime(now);
......@@ -619,8 +629,12 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
orderConsigneeDO.setCompanyEn(createReqVO.getConsigneeCompanyEn());
orderConsigneeDO.setHarvestMethod(createReqVO.getHarvestMethod()); // 收货方式
if (StringUtils.isNotBlank(createReqVO.getConsigneeAddress())) {
orderConsigneeDO.setAddress(createReqVO.getConsigneeAddress());
if (Objects.nonNull(createReqVO.getHarvestMethod()) && createReqVO.getHarvestMethod() == 2) {
if (StringUtils.isNotBlank(createReqVO.getConsigneeAddress())) {
orderConsigneeDO.setAddress(createReqVO.getConsigneeAddress());
}
} else {
orderConsigneeDO.setAddress("");
}
orderConsigneeDO.setCountry(createReqVO.getCountry());
orderConsigneeDO.setProvince(createReqVO.getProvince());
......@@ -879,9 +893,12 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
orderConsigneeDO.setHarvestMethod(createReqVO.getHarvestMethod());
//收货方式
if (StringUtils.isNotBlank(createReqVO.getConsigneeAddress())) {
orderConsigneeDO.setAddress(createReqVO.getConsigneeAddress());
if (Objects.nonNull(createReqVO.getHarvestMethod()) && createReqVO.getHarvestMethod() == 2) {
if (StringUtils.isNotBlank(createReqVO.getConsigneeAddress())) {
orderConsigneeDO.setAddress(createReqVO.getConsigneeAddress());
}
} else {
orderConsigneeDO.setAddress("");
}
orderConsigneeDO.setCountry(createReqVO.getCountry());
orderConsigneeDO.setProvince(createReqVO.getProvince());
......@@ -1627,7 +1644,17 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
Date now = new Date();
updateObj.setUpdater(updater);
updateObj.setUpdateTime(now);
if (Objects.nonNull(updateReqVO.getHarvestMethod()) && updateReqVO.getHarvestMethod() == 2) {
updateObj.setCountry(updateReqVO.getCountry());
updateObj.setProvince(updateReqVO.getProvince());
updateObj.setCity(updateReqVO.getCity());
updateObj.setConsigneeAddress(updateReqVO.getConsigneeAddress());
} else {
updateObj.setCountry(0L);
updateObj.setProvince(0L);
updateObj.setCity(0L);
updateObj.setConsigneeAddress("");
}
departureDO.setUpdater(updater);
departureDO.setUpdateTime(now);
departureDO.setDepartureCountryId(logisticsInfoDto.getStartCountryId());
......@@ -2947,6 +2974,15 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
orderConsigneeBackVO.setAddress(updateReqVO.getConsigneeAddress());
orderConsigneeBackVO.setHarvestMethod(updateReqVO.getHarvestMethod());
vo.setConsigneeVO(orderConsigneeBackVO);
vo.setCountry(updateReqVO.getCountry());
vo.setProvince(updateReqVO.getProvince());
vo.setCity(updateReqVO.getCity());
vo.setConsigneeAddress(updateReqVO.getConsigneeAddress());
} else {
vo.setCountry(0L);
vo.setProvince(0L);
vo.setCity(0L);
vo.setConsigneeAddress("");
}
applyInfoList.add(infoVO);
}
......@@ -3214,8 +3250,12 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
orderConsigneeDO.setCompanyEn(updateReqVO.getConsigneeCompanyEn());
orderConsigneeDO.setHarvestMethod(updateReqVO.getHarvestMethod()); // 收货方式
if (StringUtils.isNotBlank(updateReqVO.getConsigneeAddress())) {
orderConsigneeDO.setAddress(updateReqVO.getConsigneeAddress());
if (Objects.nonNull(updateReqVO.getHarvestMethod()) && updateReqVO.getHarvestMethod() == 2) {
if (StringUtils.isNotBlank(updateReqVO.getConsigneeAddress())) {
orderConsigneeDO.setAddress(updateReqVO.getConsigneeAddress());
}
} else {
orderConsigneeDO.setAddress("");
}
orderConsigneeDO.setCountry(updateReqVO.getCountry());
orderConsigneeDO.setProvince(updateReqVO.getProvince());
......@@ -3481,8 +3521,12 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
throw exception(CONSIGNEE_PHONE_IS_EXTERNAL);
}
orderConsigneeDO.setHarvestMethod(updateReqVO.getHarvestMethod()); // 收货方式
if (StringUtils.isNotBlank(updateReqVO.getConsigneeAddress())) {
orderConsigneeDO.setAddress(updateReqVO.getConsigneeAddress());
if (Objects.nonNull(updateReqVO.getHarvestMethod()) && updateReqVO.getHarvestMethod() == 2) {
if (StringUtils.isNotBlank(updateReqVO.getConsigneeAddress())) {
orderConsigneeDO.setAddress(updateReqVO.getConsigneeAddress());
}
} else {
orderConsigneeDO.setAddress("");
}
orderConsigneeDO.setOrderId(updateObj.getOrderId());
orderConsigneeDO.setUpdater(updater);
......
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