Toggle navigation
Toggle navigation
This project
Loading...
Sign in
ufo
/
yohoufo-fore
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
chenchao
6 years ago
Commit
7668f3cfe08160ada42d4c0595ab5a509e2dad2e
1 parent
aecee9d6
save one new goods of seller with skup-type
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
28 additions
and
6 deletions
dal/src/main/java/com/yohoufo/dal/order/model/SellerOrderGoods.java
dal/src/main/resources/META-INF/mybatis/order/BuyerOrderMapper.xml
dal/src/main/resources/META-INF/mybatis/order/SellerOrderGoodsMapper.xml
order/src/main/java/com/yohoufo/order/convert/GoodsInfoConvertor.java
order/src/main/java/com/yohoufo/order/model/SellerOrderContext.java
order/src/main/java/com/yohoufo/order/service/impl/processor/SellerOrderPrepareProcessor.java
dal/src/main/java/com/yohoufo/dal/order/model/SellerOrderGoods.java
View file @
7668f3c
...
...
@@ -51,6 +51,9 @@ public class SellerOrderGoods {
@Getter@Setter
private
Integer
storageNum
;
@Getter@Setter
private
Integer
attributes
;
public
String
getImageUrl
()
{
return
imageUrl
;
}
...
...
dal/src/main/resources/META-INF/mybatis/order/BuyerOrderMapper.xml
View file @
7668f3c
...
...
@@ -18,7 +18,6 @@
<result
column=
"buyer_order_status"
jdbcType=
"INTEGER"
property=
"buyerOrderStatus"
/>
<result
column=
"seller_order_status"
jdbcType=
"INTEGER"
property=
"sellerOrderStatus"
/>
<result
column=
"channel_no"
jdbcType=
"VARCHAR"
property=
"channelNo"
/>
<result
column=
"attributes"
jdbcType=
"INTEGER"
property=
"attributes"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
...
...
dal/src/main/resources/META-INF/mybatis/order/SellerOrderGoodsMapper.xml
View file @
7668f3c
...
...
@@ -19,15 +19,16 @@
<result
column=
"batch_no"
jdbcType=
"BIGINT"
property=
"batchNo"
/>
<result
column=
"num"
jdbcType=
"INTEGER"
property=
"num"
/>
<result
column=
"skup_list"
jdbcType=
"VARCHAR"
property=
"skupList"
/>
<result
column=
"attributes"
jdbcType=
"INTEGER"
property=
"attributes"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
id, uid, product_id, product_name, storage_id, depot_no, size_id, size_name,
color_id, color_name, goods_price, status, image_url, is_del, batch_no
color_id, color_name, goods_price, status, image_url, is_del, batch_no
, attributes
</sql>
<sql
id=
"Associated_Base_Column_List"
>
sog.id, sog.uid, sog.product_id, sog.product_name, sog.storage_id, sog.depot_no, sog.size_id, sog.size_name,
sog.color_id, sog.color_name, sog.goods_price, sog.status, sog.image_url, sog.is_del, sog.batch_no
sog.color_id, sog.color_name, sog.goods_price, sog.status, sog.image_url, sog.is_del, sog.batch_no
, sog.attributes
</sql>
<select
id=
"selectByPrimaryKey"
resultMap=
"BaseResultMap"
>
select
...
...
@@ -192,6 +193,9 @@
<if
test=
"batchNo != null"
>
batch_no,
</if>
<if
test=
"attributes != null"
>
attributes,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"productId != null"
>
...
...
@@ -233,11 +237,12 @@
<if
test=
"batchNo != null"
>
#{batchNo,jdbcType=BIGINT},
</if>
<if
test=
"attributes != null"
>
#{attributes,jdbcType=INTEGER},
</if>
</trim>
</insert>
<update
id=
"updateStatusBySkpu"
parameterType=
"com.yohoufo.dal.order.model.SellerOrderGoods"
>
update seller_order_goods
<set>
...
...
order/src/main/java/com/yohoufo/order/convert/GoodsInfoConvertor.java
View file @
7668f3c
package
com
.
yohoufo
.
order
.
convert
;
import
com.yohobuy.ufo.model.order.common.SkupStatus
;
import
com.yohobuy.ufo.model.order.constants.SkupType
;
import
com.yohoufo.common.helper.ImageUrlAssist
;
import
com.yohoufo.dal.order.model.SellerOrderGoods
;
import
com.yohoufo.order.model.response.GoodsInfo
;
import
java.util.Optional
;
/**
* Created by chao.chen on 2018/11/2.
*/
...
...
@@ -47,6 +50,8 @@ public class GoodsInfoConvertor {
sellerOrderGoods
.
setSizeName
(
goodsInfo
.
getSizeName
());
sellerOrderGoods
.
setImageUrl
(
goodsInfo
.
getImageUrl
());
sellerOrderGoods
.
setBatchNo
(
goodsInfo
.
getBatchNo
());
//default is in-stock
sellerOrderGoods
.
setAttributes
(
Optional
.
ofNullable
(
goodsInfo
.
getSkupType
()).
orElse
(
SkupType
.
IN_STOCK
).
prdAttributes
().
getCode
());
return
sellerOrderGoods
;
}
}
...
...
order/src/main/java/com/yohoufo/order/model/SellerOrderContext.java
View file @
7668f3c
package
com
.
yohoufo
.
order
.
model
;
import
com.yohobuy.ufo.model.order.bo.GoodsInfo
;
import
com.yohobuy.ufo.model.order.constants.SkupType
;
import
com.yohobuy.ufo.model.order.vo.AddressInfo
;
import
com.yohoufo.dal.order.model.SellerOrderGoods
;
import
com.yohoufo.order.model.dto.SellerOrderComputeResult
;
...
...
@@ -47,4 +48,9 @@ public class SellerOrderContext {
private
transient
SellerOrderGoods
sellerOrderGoods
;
private
String
priceOverFlowTips
;
/**
* 现货 or 预售
*/
private
SkupType
skupType
;
}
...
...
order/src/main/java/com/yohoufo/order/service/impl/processor/SellerOrderPrepareProcessor.java
View file @
7668f3c
...
...
@@ -5,6 +5,7 @@ import com.yoho.error.exception.ServiceException;
import
com.yohobuy.ufo.model.order.bo.GoodsInfo
;
import
com.yohobuy.ufo.model.order.common.SellerWalletType
;
import
com.yohobuy.ufo.model.order.constants.OrderConstant
;
import
com.yohobuy.ufo.model.order.constants.SkupType
;
import
com.yohobuy.ufo.model.order.req.SellerOrderSubmitReq
;
import
com.yohobuy.ufo.model.response.StorageDataResp
;
import
com.yohoufo.common.exception.GatewayException
;
...
...
@@ -105,7 +106,6 @@ public class SellerOrderPrepareProcessor {
}
//the address of send back 2 seller
//
AddressInfo
hiddenBackAddress
=
userProxyService
.
getHiddenAddressInfo
(
uid
,
addressId
);
AddressInfo
noHiddenBackAddress
=
userProxyService
.
getAddressInfoNotHidden
(
uid
,
addressId
);
if
(
AddressHelper
.
isNeedUpdate
(
noHiddenBackAddress
)){
...
...
@@ -144,6 +144,9 @@ public class SellerOrderPrepareProcessor {
log
.
info
(
"in buildSellerOrderContext , uid {}, storageId {}, price {}, computeResult {}"
,
uid
,
storageId
,
goodsInfo
.
getPrice
(),
computeResult
);
context
.
setSellerOrderComputeResult
(
computeResult
);
//
SkupType
skupType
=
SkupType
.
getSkupType
(
req
.
getSkupType
());
context
.
setSkupType
(
skupType
);
return
context
;
}
...
...
@@ -171,6 +174,7 @@ public class SellerOrderPrepareProcessor {
goodsInfo
.
setImageUrl
(
prdResp
.
getImageUrl
());
goodsInfo
.
setPrice
(
salePrice
);
goodsInfo
.
setStorageId
(
context
.
getStorageId
());
goodsInfo
.
setSkupType
(
context
.
getSkupType
());
return
goodsInfo
;
}
catch
(
Exception
ex
){
log
.
warn
(
"in getProductDetail occur error, uid {}, storageId {}"
,
uid
,
storageId
);
...
...
Please
register
or
login
to post a comment