|
|
@@ -2,6 +2,7 @@ package com.sqx.modules.errand.service.impl;
|
|
|
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
+import cn.hutool.json.JSONUtil;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
@@ -246,7 +247,7 @@ public class TbIndentServiceImpl extends ServiceImpl<TbIndentDao, TbIndent> impl
|
|
|
return Result.error("请勿重复生成订单!");
|
|
|
}
|
|
|
GoodsShop goodsShop = shopMessageService.getShopInfoById(order.getShopId());
|
|
|
- Address address = addressDao.selectById(order.getAddressId());
|
|
|
+
|
|
|
TbIndent tbIndent = new TbIndent();
|
|
|
tbIndent.setItemCodeFlag(1);
|
|
|
tbIndent.setCreateTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
|
|
|
@@ -268,6 +269,14 @@ public class TbIndentServiceImpl extends ServiceImpl<TbIndentDao, TbIndent> impl
|
|
|
|
|
|
tbIndent.setShopAddressDetail(goodsShop.getDetailedAddress());
|
|
|
if (order.getOrderType() == 2) {
|
|
|
+ Address address;
|
|
|
+ String addressStr = order.getAddress();
|
|
|
+ if (StrUtil.isNotBlank(addressStr)) {
|
|
|
+ address = JSONUtil.toBean(addressStr, Address.class);
|
|
|
+ } else {
|
|
|
+ address = addressDao.selectById(order.getAddressId());
|
|
|
+ }
|
|
|
+
|
|
|
tbIndent.setUserName(address.getUserName());
|
|
|
tbIndent.setUserPhone(address.getUserPhone());
|
|
|
tbIndent.setUserProvince(address.getProvince());
|