Authored by Lixiaodi

超级卖家

... ... @@ -56,4 +56,6 @@ public interface StoragePriceMapper {
List<StoragePrice> selectBatchLeastPrice(@Param("skuList") Collection<Integer> skuList);
List<StoragePrice> selectByStorageIdsPlus(@Param("list") List<Integer> integers, @Param("storageId") Integer storageId, @Param("sellerUid") Integer sellerUid);
int updateSkupHideStatus(@Param("uid") Integer uid, @Param("status") int status);
}
\ No newline at end of file
... ...
... ... @@ -85,7 +85,7 @@
where skup = #{skup,jdbcType=INTEGER} and status = 2
</update>
<select id="selectLeastPrice" resultMap="BaseResultMap">
select price, skup from storage_price where storage_id = #{storageId,jdbcType=INTEGER} and status = 1 order by price limit 1
select price, skup from storage_price where storage_id = #{storageId,jdbcType=INTEGER} and status = 1 and is_hide = 0 order by price limit 1
</select>
<select id="selectByStorageIds" resultMap="BaseResultMap">
select id, skup, storage_id, price, status
... ... @@ -95,6 +95,7 @@
open="(" separator="," close=")">
#{item}
</foreach>
and is_hide = 0
</select>
<select id="selectBySkupList" resultMap="BaseResultMap">
select id, skup, product_id, goods_id, storage_id, depot_num, seller_uid, price, status,
... ... @@ -137,6 +138,11 @@
#{skup}
</foreach>
</update>
<update id="updateSkupHideStatus">
update storage_price set is_hide = #{status}, update_time = unix_timestamp()
where seller_uid = #{uid} and status in(0,1,100)
</update>
<select id="selectBatchLeastPrice" resultMap="BaseResultMap">
select storage_id , min(price) as price from storage_price where
... ...
... ... @@ -623,7 +623,14 @@ public class MerchantOrderPaymentService extends AbstractOrderPaymentService {
|| type == SellerWalletDetail.Type.SELLER_OVER_TIME
|| type == SellerWalletDetail.Type.APPRAISE_FAIL) {
// 处罚保证金
lockAmount = money.multiply(new BigDecimal("-1"));
// TODO 如果是超级卖家
boolean isSuper = false;
logger.info("{}修改钱包,uid={},处罚保证金场合:获取身份超级卖家:{}", type.getName(), uid, isSuper);
if(isSuper) {
availAmount = money.multiply(new BigDecimal("-1"));
} else {
lockAmount = money.multiply(new BigDecimal("-1"));
}
tradeAmount = lockAmount;
logger.info("{}修改钱包,uid={},处罚保证金场合:", type.getName(), uid);
}
... ... @@ -634,7 +641,7 @@ public class MerchantOrderPaymentService extends AbstractOrderPaymentService {
logger.info("{}修改钱包表余额,bean={}", message, sw);
if (sellerWalletMapper.addMoney(sw) == 0) {
logger.error(message + "失败,(余额不足或钱包不可用)更新表返回0,bean={}", sw);
// CommonAlarmEventPublisher.publish(message + "失败", "ufo.order.changePrice", "(余额不足货钱包不可用)更新表返回0,uid=" + uid + ", bean为:"+ sw);
CommonAlarmEventPublisher.publish(message + "失败", "ufo.order.walletPunishment", "用户:" + uid + ",(余额不足货钱包不可用),更新表返回 0,bean为:"+ sw);
return null;
}
logger.info("修改钱包表余额成功,bean={}", sw);
... ...
... ... @@ -38,6 +38,7 @@ import com.yohoufo.product.service.ProductService;
public class ProductController {
private final Logger LOG = LoggerFactory.getLogger(ProductController.class);
@Autowired
private ProductService productService;
... ... @@ -278,6 +279,24 @@ public class ProductController {
clearProductCache(skup);
return new ApiResponse(200, "取消卖出成功!", Boolean.TRUE);
}
@RequestMapping(params = "method=ufo.product.hideSellerAllSkup")
public ApiResponse hideSellerAllSkup(
@RequestParam(value = "uid", required = true) Integer uid) {
LOG.info("in method=ufo.product.hideSellerAllSkup uid={}", uid);
productService.changeSkupHideStatus(uid, 1);// status:1 隐藏商品
LOG.info("hideSellerAllSkup success uid = {}", uid);
return new ApiResponse(200, "隐藏用户商品成功!", Boolean.TRUE);
}
@RequestMapping(params = "method=ufo.product.showSellerAllSkup")
public ApiResponse showSellerAllSkup(
@RequestParam(value = "uid", required = true) Integer uid) {
LOG.info("in method=ufo.product.showSellerAllSkup uid={}", uid);
productService.changeSkupHideStatus(uid, 0);// status:0 展示商品
LOG.info("showSellerAllSkup success uid = {}", uid);
return new ApiResponse(200, "隐藏用户商品成功!", Boolean.TRUE);
}
@Autowired
private ControllerCacheAop cacheAop;
... ...
... ... @@ -83,4 +83,6 @@ public interface ProductService {
* @return
*/
SkupDetailForScreenResp getSkuPDetailForShopsScreen(Integer skuP, Integer storeId);
void changeSkupHideStatus(Integer uid, int status);
}
... ...
... ... @@ -734,6 +734,13 @@ public class ProductServiceImpl implements ProductService{
public int sellerBatchUpdatePrice(List<Integer> skupList, Double price) {
return storagePriceMapper.updateBatchPrice(skupList, price);
}
@Override
public void changeSkupHideStatus(Integer uid, int status) {
LOGGER.info("开始:Skup隐藏展示状态修改,uid={} , toStatus={}");
int count = storagePriceMapper.updateSkupHideStatus(uid, status);
LOGGER.info("完成:Skup隐藏展示状态修改,uid={} , toStatus={}, exeCount={}", uid, status, count);
}
@Override
public List<SaleCategoryBo> querySaleCategory() {
... ... @@ -979,4 +986,5 @@ public class ProductServiceImpl implements ProductService{
result.setSkupDetail(innerResult);
return result;
}
}
... ...