Showing
6 changed files
with
47 additions
and
3 deletions
@@ -56,4 +56,6 @@ public interface StoragePriceMapper { | @@ -56,4 +56,6 @@ public interface StoragePriceMapper { | ||
56 | List<StoragePrice> selectBatchLeastPrice(@Param("skuList") Collection<Integer> skuList); | 56 | List<StoragePrice> selectBatchLeastPrice(@Param("skuList") Collection<Integer> skuList); |
57 | 57 | ||
58 | List<StoragePrice> selectByStorageIdsPlus(@Param("list") List<Integer> integers, @Param("storageId") Integer storageId, @Param("sellerUid") Integer sellerUid); | 58 | List<StoragePrice> selectByStorageIdsPlus(@Param("list") List<Integer> integers, @Param("storageId") Integer storageId, @Param("sellerUid") Integer sellerUid); |
59 | + | ||
60 | + int updateSkupHideStatus(@Param("uid") Integer uid, @Param("status") int status); | ||
59 | } | 61 | } |
@@ -85,7 +85,7 @@ | @@ -85,7 +85,7 @@ | ||
85 | where skup = #{skup,jdbcType=INTEGER} and status = 2 | 85 | where skup = #{skup,jdbcType=INTEGER} and status = 2 |
86 | </update> | 86 | </update> |
87 | <select id="selectLeastPrice" resultMap="BaseResultMap"> | 87 | <select id="selectLeastPrice" resultMap="BaseResultMap"> |
88 | - select price, skup from storage_price where storage_id = #{storageId,jdbcType=INTEGER} and status = 1 order by price limit 1 | 88 | + select price, skup from storage_price where storage_id = #{storageId,jdbcType=INTEGER} and status = 1 and is_hide = 0 order by price limit 1 |
89 | </select> | 89 | </select> |
90 | <select id="selectByStorageIds" resultMap="BaseResultMap"> | 90 | <select id="selectByStorageIds" resultMap="BaseResultMap"> |
91 | select id, skup, storage_id, price, status | 91 | select id, skup, storage_id, price, status |
@@ -95,6 +95,7 @@ | @@ -95,6 +95,7 @@ | ||
95 | open="(" separator="," close=")"> | 95 | open="(" separator="," close=")"> |
96 | #{item} | 96 | #{item} |
97 | </foreach> | 97 | </foreach> |
98 | + and is_hide = 0 | ||
98 | </select> | 99 | </select> |
99 | <select id="selectBySkupList" resultMap="BaseResultMap"> | 100 | <select id="selectBySkupList" resultMap="BaseResultMap"> |
100 | select id, skup, product_id, goods_id, storage_id, depot_num, seller_uid, price, status, | 101 | select id, skup, product_id, goods_id, storage_id, depot_num, seller_uid, price, status, |
@@ -137,6 +138,11 @@ | @@ -137,6 +138,11 @@ | ||
137 | #{skup} | 138 | #{skup} |
138 | </foreach> | 139 | </foreach> |
139 | </update> | 140 | </update> |
141 | + | ||
142 | + <update id="updateSkupHideStatus"> | ||
143 | + update storage_price set is_hide = #{status}, update_time = unix_timestamp() | ||
144 | + where seller_uid = #{uid} and status in(0,1,100) | ||
145 | + </update> | ||
140 | 146 | ||
141 | <select id="selectBatchLeastPrice" resultMap="BaseResultMap"> | 147 | <select id="selectBatchLeastPrice" resultMap="BaseResultMap"> |
142 | select storage_id , min(price) as price from storage_price where | 148 | select storage_id , min(price) as price from storage_price where |
@@ -623,7 +623,14 @@ public class MerchantOrderPaymentService extends AbstractOrderPaymentService { | @@ -623,7 +623,14 @@ public class MerchantOrderPaymentService extends AbstractOrderPaymentService { | ||
623 | || type == SellerWalletDetail.Type.SELLER_OVER_TIME | 623 | || type == SellerWalletDetail.Type.SELLER_OVER_TIME |
624 | || type == SellerWalletDetail.Type.APPRAISE_FAIL) { | 624 | || type == SellerWalletDetail.Type.APPRAISE_FAIL) { |
625 | // 处罚保证金 | 625 | // 处罚保证金 |
626 | - lockAmount = money.multiply(new BigDecimal("-1")); | 626 | + // TODO 如果是超级卖家 |
627 | + boolean isSuper = false; | ||
628 | + logger.info("{}修改钱包,uid={},处罚保证金场合:获取身份超级卖家:{}", type.getName(), uid, isSuper); | ||
629 | + if(isSuper) { | ||
630 | + availAmount = money.multiply(new BigDecimal("-1")); | ||
631 | + } else { | ||
632 | + lockAmount = money.multiply(new BigDecimal("-1")); | ||
633 | + } | ||
627 | tradeAmount = lockAmount; | 634 | tradeAmount = lockAmount; |
628 | logger.info("{}修改钱包,uid={},处罚保证金场合:", type.getName(), uid); | 635 | logger.info("{}修改钱包,uid={},处罚保证金场合:", type.getName(), uid); |
629 | } | 636 | } |
@@ -634,7 +641,7 @@ public class MerchantOrderPaymentService extends AbstractOrderPaymentService { | @@ -634,7 +641,7 @@ public class MerchantOrderPaymentService extends AbstractOrderPaymentService { | ||
634 | logger.info("{}修改钱包表余额,bean={}", message, sw); | 641 | logger.info("{}修改钱包表余额,bean={}", message, sw); |
635 | if (sellerWalletMapper.addMoney(sw) == 0) { | 642 | if (sellerWalletMapper.addMoney(sw) == 0) { |
636 | logger.error(message + "失败,(余额不足或钱包不可用)更新表返回0,bean={}", sw); | 643 | logger.error(message + "失败,(余额不足或钱包不可用)更新表返回0,bean={}", sw); |
637 | - // CommonAlarmEventPublisher.publish(message + "失败", "ufo.order.changePrice", "(余额不足货钱包不可用)更新表返回0,uid=" + uid + ", bean为:"+ sw); | 644 | + CommonAlarmEventPublisher.publish(message + "失败", "ufo.order.walletPunishment", "用户:" + uid + ",(余额不足货钱包不可用),更新表返回 0,bean为:"+ sw); |
638 | return null; | 645 | return null; |
639 | } | 646 | } |
640 | logger.info("修改钱包表余额成功,bean={}", sw); | 647 | logger.info("修改钱包表余额成功,bean={}", sw); |
@@ -38,6 +38,7 @@ import com.yohoufo.product.service.ProductService; | @@ -38,6 +38,7 @@ import com.yohoufo.product.service.ProductService; | ||
38 | public class ProductController { | 38 | public class ProductController { |
39 | 39 | ||
40 | private final Logger LOG = LoggerFactory.getLogger(ProductController.class); | 40 | private final Logger LOG = LoggerFactory.getLogger(ProductController.class); |
41 | + | ||
41 | 42 | ||
42 | @Autowired | 43 | @Autowired |
43 | private ProductService productService; | 44 | private ProductService productService; |
@@ -278,6 +279,24 @@ public class ProductController { | @@ -278,6 +279,24 @@ public class ProductController { | ||
278 | clearProductCache(skup); | 279 | clearProductCache(skup); |
279 | return new ApiResponse(200, "取消卖出成功!", Boolean.TRUE); | 280 | return new ApiResponse(200, "取消卖出成功!", Boolean.TRUE); |
280 | } | 281 | } |
282 | + | ||
283 | + @RequestMapping(params = "method=ufo.product.hideSellerAllSkup") | ||
284 | + public ApiResponse hideSellerAllSkup( | ||
285 | + @RequestParam(value = "uid", required = true) Integer uid) { | ||
286 | + LOG.info("in method=ufo.product.hideSellerAllSkup uid={}", uid); | ||
287 | + productService.changeSkupHideStatus(uid, 1);// status:1 隐藏商品 | ||
288 | + LOG.info("hideSellerAllSkup success uid = {}", uid); | ||
289 | + return new ApiResponse(200, "隐藏用户商品成功!", Boolean.TRUE); | ||
290 | + } | ||
291 | + | ||
292 | + @RequestMapping(params = "method=ufo.product.showSellerAllSkup") | ||
293 | + public ApiResponse showSellerAllSkup( | ||
294 | + @RequestParam(value = "uid", required = true) Integer uid) { | ||
295 | + LOG.info("in method=ufo.product.showSellerAllSkup uid={}", uid); | ||
296 | + productService.changeSkupHideStatus(uid, 0);// status:0 展示商品 | ||
297 | + LOG.info("showSellerAllSkup success uid = {}", uid); | ||
298 | + return new ApiResponse(200, "隐藏用户商品成功!", Boolean.TRUE); | ||
299 | + } | ||
281 | 300 | ||
282 | @Autowired | 301 | @Autowired |
283 | private ControllerCacheAop cacheAop; | 302 | private ControllerCacheAop cacheAop; |
@@ -83,4 +83,6 @@ public interface ProductService { | @@ -83,4 +83,6 @@ public interface ProductService { | ||
83 | * @return | 83 | * @return |
84 | */ | 84 | */ |
85 | SkupDetailForScreenResp getSkuPDetailForShopsScreen(Integer skuP, Integer storeId); | 85 | SkupDetailForScreenResp getSkuPDetailForShopsScreen(Integer skuP, Integer storeId); |
86 | + | ||
87 | + void changeSkupHideStatus(Integer uid, int status); | ||
86 | } | 88 | } |
@@ -734,6 +734,13 @@ public class ProductServiceImpl implements ProductService{ | @@ -734,6 +734,13 @@ public class ProductServiceImpl implements ProductService{ | ||
734 | public int sellerBatchUpdatePrice(List<Integer> skupList, Double price) { | 734 | public int sellerBatchUpdatePrice(List<Integer> skupList, Double price) { |
735 | return storagePriceMapper.updateBatchPrice(skupList, price); | 735 | return storagePriceMapper.updateBatchPrice(skupList, price); |
736 | } | 736 | } |
737 | + | ||
738 | + @Override | ||
739 | + public void changeSkupHideStatus(Integer uid, int status) { | ||
740 | + LOGGER.info("开始:Skup隐藏展示状态修改,uid={} , toStatus={}"); | ||
741 | + int count = storagePriceMapper.updateSkupHideStatus(uid, status); | ||
742 | + LOGGER.info("完成:Skup隐藏展示状态修改,uid={} , toStatus={}, exeCount={}", uid, status, count); | ||
743 | + } | ||
737 | 744 | ||
738 | @Override | 745 | @Override |
739 | public List<SaleCategoryBo> querySaleCategory() { | 746 | public List<SaleCategoryBo> querySaleCategory() { |
@@ -979,4 +986,5 @@ public class ProductServiceImpl implements ProductService{ | @@ -979,4 +986,5 @@ public class ProductServiceImpl implements ProductService{ | ||
979 | result.setSkupDetail(innerResult); | 986 | result.setSkupDetail(innerResult); |
980 | return result; | 987 | return result; |
981 | } | 988 | } |
989 | + | ||
982 | } | 990 | } |
-
Please register or login to post a comment