Authored by qinchao

入驻商户:查询skup 和违约次数

package com.yoho.order.dal;
import java.util.List;
import com.yoho.order.model.SellerOrderGoods;
import org.apache.ibatis.annotations.Param;
import com.yoho.order.model.SellerOrderGoods;
import java.util.List;
/**
* Created by caoyan on 2018/9/12.
... ... @@ -15,4 +14,6 @@ public interface SellerOrderGoodsMapper {
int updateSizeId(@Param("newSizeId")Integer newSizeId, @Param("oldSizeIdList")List<Integer> oldSizeIdList);
int selectCountCanCell(@Param("uid")Integer uid);
}
... ...
package com.yoho.order.dal;
import org.apache.ibatis.annotations.Param;
public interface SellerWalletDetailMapper {
//查询用户违约的次数
int selectUserBreakRulesCount(@Param("uid") Integer uid);
}
\ No newline at end of file
... ...
package com.yoho.order.model;
import lombok.Data;
import lombok.ToString;
import java.math.BigDecimal;
@Data
@ToString
public class SellerWalletDetail {
private Integer id;
private Integer walletId;
private Integer uid;
private Long orderCode;
private BigDecimal amount;
private Integer type;
private Integer createTime;
private Integer updateTime;
private Integer isBatch;
private String attachValue;
private BigDecimal availAmount;
private BigDecimal lockAmount;
private Integer isSet;
public enum Type {
// 1:充值,11:发布上架,12:加价,13:减价,
// 21卖家下架,22系统下架,31卖家不卖,32卖家超时发货,33鉴定不通过,
// 41买家取消(无物流), 42买家取消(有物流),
// 51鉴定通过,
// 61退还保证金(退出商家)
RE_CHARGE("充值保证金", 1),
PUBLISH("卖家发布商品", 11),
ADD_PRICE("卖家调高商品价格", 11),
SUBTRACT_PRICE("卖家调低商品价格", 11),
SELLER_OFF("卖家下架商品", 11),
SYSTEM_OFF("系统下架商品", 11),
SELLER_CANCEL("卖家不卖了", 11),
SELLER_OVER_TIME("卖家发货超时", 11),
APPRAISE_FAIL("鉴定不通过", 11),
BUYER_CANCEL_NO_DELIVERY("买家取消(无物流)", 11),
BUYER_CANCEL_DELIVERY("买家取消(有物流)", 11),
APPRAISE_OK("鉴定通过", 11),
MERCHANT_EXIT("商家退出入驻", 11);
private String name;
private int value;
private Type(String name, int value) {
this.name = name;
this.value = value;
}
public String getName() {
return name;
}
public int getValue() {
return value;
}
public static Type of(int value) {
for (Type t : values()) {
if (t.value == value) {
return t;
}
}
return null;
}
}
}
\ No newline at end of file
... ...
... ... @@ -30,6 +30,14 @@
#{id}
</foreach>
</select>
<select id="selectCountCanCell" resultMap="BaseResultMap">
select <include refid="Base_Column_List" />
from seller_order_goods where uid = #{uid,jdbcType=INTEGER} and is_del = 1 and status = 1
</select>
<update id="updateSizeId">
update seller_order_goods set size_id=#{newSizeId} where size_id in
... ...
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.yoho.order.dal.SellerWalletDetailMapper" >
<resultMap id="BaseResultMap" type="com.yoho.order.model.SellerWalletDetail" >
<id column="id" property="id" jdbcType="INTEGER" />
<result column="wallet_id" property="walletId" jdbcType="INTEGER" />
<result column="uid" property="uid" jdbcType="INTEGER" />
<result column="order_code" property="orderCode" jdbcType="BIGINT" />
<result column="amount" property="amount" jdbcType="DECIMAL" />
<result column="type" property="type" jdbcType="TINYINT" />
<result column="create_time" property="createTime" jdbcType="INTEGER" />
<result column="update_time" property="updateTime" jdbcType="INTEGER" />
<result column="is_batch" property="isBatch" jdbcType="INTEGER" />
<result column="attach_value" property="attachValue" jdbcType="VARCHAR" />
<result column="avail_amount" property="availAmount" jdbcType="DECIMAL" />
<result column="lock_amount" property="lockAmount" jdbcType="DECIMAL" />
<result column="is_set" property="isSet" jdbcType="INTEGER" />
</resultMap>
<sql id="Base_Column_List" >
id, wallet_id, uid, order_code, amount, type, create_time, update_time,is_batch,attach_value,avail_amount,lock_amount,is_set
</sql>
<select id="selectUserBreakRulesCount" resultType="java.lang.Integer" >
select
count(*)
from seller_wallet_detail
where uid = #{uid,jdbcType=INTEGER} and is_batch = 0 and type in (32,33)
</select>
</mapper>
\ No newline at end of file
... ...
... ... @@ -25,16 +25,16 @@ public class StoredSellerRespVo {
private String mobile;
//入驻时间
private Long enterTime;
private long enterTime;
//退驻时间
private Long quitTime;
private long quitTime;
//上架sku
private Integer selfSkuNum;
private int selfSkuNum;
//违规次数
private Integer breakRuleTimes;
private int breakRuleTimes;
}
... ...
... ... @@ -6,23 +6,25 @@ import com.google.common.cache.CacheBuilder;
import com.yoho.core.common.utils.DateUtil;
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.StoredSellerMapper;
import com.yoho.order.dal.TradeBillsMapper;
import com.yoho.order.model.*;
import com.yoho.order.model.StoredSeller;
import com.yoho.order.model.StoredSellerReqVo;
import com.yoho.order.model.TradeBills;
import com.yoho.order.model.TradeBillsReq;
import com.yoho.ufo.order.constant.MoneyTypeEnum;
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.impl.UserHelper;
import com.yoho.ufo.service.model.PageResponseBO;
import com.yohobuy.ufo.model.enums.StoredSellerStatusEnum;
import com.yohobuy.ufo.model.order.bo.AppraiseExpressInfoBo;
import com.yohobuy.ufo.model.order.resp.*;
import com.yohobuy.ufo.model.order.resp.TradeBillsResp;
import com.yohobuy.ufo.model.user.req.AuthorizeInfoReq;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.elasticsearch.common.collect.Lists;
import org.elasticsearch.common.collect.Maps;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
... ... @@ -35,7 +37,6 @@ import java.util.Map;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
/**
* @author craig.qin
... ... @@ -63,6 +64,12 @@ public class TradeBillsServiceImpl implements ITradeBillsService {
@Autowired
private StoredSellerMapper storedSellerMapper;
@Autowired
private SellerWalletDetailMapper sellerWalletDetailMapper;
@Autowired
private SellerOrderGoodsMapper sellerOrderGoodsMapper;
@Override
public PageResponseBO<StoredSellerRespVo> queryStoredSeller(StoredSellerReqVo req){
if(req.getUid()==null&&StringUtils.isNotBlank(req.getMobile())){
... ... @@ -105,10 +112,12 @@ public class TradeBillsServiceImpl implements ITradeBillsService {
resp.setValidStatus(item.getValidStatus());
resp.setValidStatusDesc(StoredSellerStatusEnum.getDescriptionByCode(item.getValidStatus()));
resp.setMobile(getMobileByUidFromCache(item.getUid()));
resp.setEnterTime(item.getEnterTime()<=0?null:item.getEnterTime());
resp.setQuitTime(item.getQuitTime()<=0?null:item.getQuitTime());
resp.setSelfSkuNum(0);
resp.setBreakRuleTimes(0);
resp.setEnterTime(item.getEnterTime());
resp.setQuitTime(item.getQuitTime());
// 上架skuP
resp.setSelfSkuNum(sellerOrderGoodsMapper.selectCountCanCell(item.getUid()));
// 违约次数
resp.setBreakRuleTimes(sellerWalletDetailMapper.selectUserBreakRulesCount(item.getUid()));
respList.add(resp);
}
return respList;
... ...
... ... @@ -33,6 +33,7 @@ datasources:
- com.yoho.order.dal.OrderOperateRecordMapper
- com.yoho.order.dal.TradeBillsMapper
- com.yoho.order.dal.StoredSellerMapper
- com.yoho.order.dal.SellerWalletDetailMapper
ufo_resource:
servers:
... ...
... ... @@ -33,6 +33,7 @@ datasources:
- com.yoho.order.dal.OrderOperateRecordMapper
- com.yoho.order.dal.TradeBillsMapper
- com.yoho.order.dal.StoredSellerMapper
- com.yoho.order.dal.SellerWalletDetailMapper
ufo_resource:
servers:
... ...