|
|
package com.yohoufo.order.service.impl;
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.yohoufo.dal.order.SellerOrderMetaMapper;
|
|
|
import com.yohoufo.dal.order.model.SellerOrderMeta;
|
|
|
import com.yohoufo.order.constants.MetaKey;
|
|
|
import com.yohoufo.order.model.SellerOrderContext;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Propagation;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
/**
|
|
|
* Created by chenchao on 2018/9/17.
|
|
|
*/
|
|
|
@Service
|
|
|
public class SellerFeeService {
|
|
|
|
|
|
|
|
|
private final Logger logger = LoggerFactory.getLogger(getClass());
|
|
|
|
|
|
@Autowired
|
|
|
private SellerOrderMetaMapper somMapper;
|
|
|
|
|
|
@Transactional(propagation = Propagation.REQUIRED)
|
|
|
public int saveFee(SellerOrderContext ctx){
|
|
|
logger.info("in seller saveFee, uid {}", ctx.getUid());
|
|
|
SellerOrderMeta som = new SellerOrderMeta();
|
|
|
som.setUid(ctx.getUid());
|
|
|
som.setSkup(ctx.getSoldProduct().getSkup());
|
|
|
som.setMetaKey(MetaKey.SELLER_FEE);
|
|
|
String value = JSONObject.toJSONString(ctx.getSellerOrderComputeResult());
|
|
|
som.setMetaValue(value);
|
|
|
return somMapper.insertSelective(som);
|
|
|
}
|
|
|
} |
...
|
...
|
|