Commit 954da1d1 authored by zhengyi's avatar zhengyi

订单收货信息切换bug修复

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