Authored by Lixiaodi

增加身份、余额处理

... ... @@ -39,5 +39,7 @@ public class StoredSeller {
//是否跳过了芝麻认证,1: 跳过 ,default 0
private Integer breakZhiMaCert;
private Integer entryType;
}
... ...
... ... @@ -21,6 +21,7 @@ public class StoredSellerReqVo extends PageRequestBO{
///// status 入驻状态
private Integer validStatus;
//// 1:普通入驻,2:超级,3:前期白名单
private Integer entryType;
}
... ...
... ... @@ -14,10 +14,11 @@
<result column="create_time" property="createTime" jdbcType="INTEGER" />
<result column="update_time" property="updateTime" jdbcType="INTEGER" />
<result column="break_zhi_ma_cert" property="breakZhiMaCert" jdbcType="TINYINT" />
<result column="entry_type" property="entryType" jdbcType="INTEGER" />
</resultMap>
<sql id="Base_Column_List" >
id, uid, valid_status,cert_no,cert_name,operator_uid,operator_name,enter_time,quit_time ,create_time, update_time,break_zhi_ma_cert
id, uid, valid_status,cert_no,cert_name,operator_uid,operator_name,enter_time,quit_time ,create_time, update_time,break_zhi_ma_cert,entry_type
</sql>
... ... @@ -34,6 +35,9 @@
<if test="storedSellerReq.validStatus != null ">
and valid_status = #{storedSellerReq.validStatus}
</if>
<if test="storedSellerReq.entryType != null and storedSellerReq.entryType != 0">
and entry_type = #{storedSellerReq.entryType}
</if>
</sql>
<select id="selectCountByCondition" resultType="java.lang.Integer" parameterType="com.yoho.order.model.StoredSellerReqVo">
... ...
... ... @@ -36,5 +36,11 @@ public class StoredSellerRespVo {
//违规次数
private int breakRuleTimes;
//身份:入驻,超级卖家
private Integer entryType;
//账户总金额
private String money;
}
... ...
... ... @@ -8,8 +8,10 @@ import com.yoho.core.rest.client.ServiceCaller;
import com.yoho.error.exception.ServiceException;
import com.yoho.order.dal.SellerOrderGoodsMapper;
import com.yoho.order.dal.SellerWalletDetailMapper;
import com.yoho.order.dal.SellerWalletMapper;
import com.yoho.order.dal.StoredSellerMapper;
import com.yoho.order.dal.TradeBillsMapper;
import com.yoho.order.model.SellerWallet;
import com.yoho.order.model.StoredSeller;
import com.yoho.order.model.StoredSellerReqVo;
import com.yoho.order.model.TradeBills;
... ... @@ -19,6 +21,7 @@ import com.yoho.ufo.order.constant.TradeStatusEnum;
import com.yoho.ufo.order.response.StoredSellerRespVo;
import com.yoho.ufo.order.service.ITradeBillsService;
import com.yoho.ufo.service.model.PageResponseBO;
import com.yoho.ufo.util.CollectionUtil;
import com.yohobuy.ufo.model.enums.StoredSellerStatusEnum;
import com.yohobuy.ufo.model.order.resp.TradeBillsResp;
import com.yohobuy.ufo.model.user.req.AuthorizeInfoReq;
... ... @@ -66,6 +69,9 @@ public class TradeBillsServiceImpl implements ITradeBillsService {
@Autowired
private SellerWalletDetailMapper sellerWalletDetailMapper;
@Autowired
private SellerWalletMapper sellerWalletMapper;
@Autowired
private SellerOrderGoodsMapper sellerOrderGoodsMapper;
... ... @@ -104,6 +110,8 @@ public class TradeBillsServiceImpl implements ITradeBillsService {
private List<StoredSellerRespVo> convertToStoreSellerResp(List<StoredSeller> ls ){
List<StoredSellerRespVo> respList = Lists.newArrayList();
List<SellerWallet> sws = sellerWalletMapper.selectByUidAndMerchantUids(null, CollectionUtil.distinct(ls,StoredSeller::getUid), 0, ls.size());
Map<Integer, SellerWallet> swsMap = CollectionUtil.extractMap(sws, SellerWallet::getUid);
for(StoredSeller item : ls) {
StoredSellerRespVo resp=new StoredSellerRespVo();
resp.setUid(item.getUid());
... ... @@ -114,10 +122,19 @@ public class TradeBillsServiceImpl implements ITradeBillsService {
resp.setMobile(getMobileByUidFromCache(item.getUid()));
resp.setEnterTime(1000L * item.getEnterTime());
resp.setQuitTime(1000L * item.getQuitTime());
// 身份等级
resp.setEntryType(item.getEntryType());
// 上架skuP
resp.setSelfSkuNum(sellerOrderGoodsMapper.selectCountCanCell(item.getUid()));
// 违约次数
resp.setBreakRuleTimes(sellerWalletDetailMapper.selectUserBreakRulesCount(item.getUid()));
// 总余额
SellerWallet sw = swsMap.get(item.getUid());
if (sw != null) {
resp.setMoney(sw.getLockAmount().add(sw.getAmount()).setScale(2).toString());
} else {
resp.setMoney("");
}
respList.add(resp);
}
return respList;
... ...