zoujiajian преди 2 години
родител
ревизия
9aa73465d4

+ 2 - 2
netflix-service/src/main/java/com/cyksj/service/shop/impl/YhShopDistributeServiceImpl.java

@@ -64,13 +64,13 @@ public class YhShopDistributeServiceImpl implements YhShopDistributeService {
 		YhShopUserPlatDistributeRate yhShopUserPlatDistributeRate = yhShopUserPlatDistributeRateMapper.selectOne(Wrappers.lambdaQuery(YhShopUserPlatDistributeRate.class)
 		YhShopUserPlatDistributeRate yhShopUserPlatDistributeRate = yhShopUserPlatDistributeRateMapper.selectOne(Wrappers.lambdaQuery(YhShopUserPlatDistributeRate.class)
 				.eq(YhShopUserPlatDistributeRate::getUserId, shopUserId)
 				.eq(YhShopUserPlatDistributeRate::getUserId, shopUserId)
 				.eq(YhShopUserPlatDistributeRate::getGoodsId, order.getGoodsId()).last("limit 1"));
 				.eq(YhShopUserPlatDistributeRate::getGoodsId, order.getGoodsId()).last("limit 1"));
-		Integer rate = 0;
+		Integer rate = null;
 		if (yhShopUserPlatDistributeRate == null) {
 		if (yhShopUserPlatDistributeRate == null) {
 			log.info("未配置店铺主userId:{}对应平台goodsId:{}的比例,走通用比例", shopUserId, order.getGoodsId());
 			log.info("未配置店铺主userId:{}对应平台goodsId:{}的比例,走通用比例", shopUserId, order.getGoodsId());
 		} else {
 		} else {
 			rate = yhShopUserPlatDistributeRate.getRate();
 			rate = yhShopUserPlatDistributeRate.getRate();
 		}
 		}
-		if (rate <= 0) {
+		if (rate == null) {
 			//获取平台配置的通用比例
 			//获取平台配置的通用比例
 			YhShopGeneralGoodsRate yhShopGeneralGoodsRate = yhShopGeneralGoodsRateMapper.selectOne(Wrappers.lambdaQuery(YhShopGeneralGoodsRate.class)
 			YhShopGeneralGoodsRate yhShopGeneralGoodsRate = yhShopGeneralGoodsRateMapper.selectOne(Wrappers.lambdaQuery(YhShopGeneralGoodsRate.class)
 					.eq(YhShopGeneralGoodsRate::getGoodsId, order.getGoodsId()).last("limit 1"));
 					.eq(YhShopGeneralGoodsRate::getGoodsId, order.getGoodsId()).last("limit 1"));

+ 3 - 2
netflix-web/src/main/java/com/cyksj/web/controller/manage/goods/shop/YhShopUserController.java

@@ -68,12 +68,13 @@ public class YhShopUserController {
 	 */
 	 */
 	@PutMapping("/set/shop/contact")
 	@PutMapping("/set/shop/contact")
 	public Result<String> setShopContact(@RequestBody YhShop yhShop) {
 	public Result<String> setShopContact(@RequestBody YhShop yhShop) {
+		long userId = StpYhShopManageUser.getLoginIdAsLong();
 		String contact = yhShop.getContact();
 		String contact = yhShop.getContact();
 		if (StrUtil.isEmpty(contact)) {
 		if (StrUtil.isEmpty(contact)) {
 			throw BusinessRuntimeException.getInstance("请输入联系方式");
 			throw BusinessRuntimeException.getInstance("请输入联系方式");
 		}
 		}
-		Long id = yhShop.getId();
-		YhShop dbShop = yhShopMapper.selectById(id);
+		YhShop dbShop = yhShopMapper.selectOne(Wrappers.lambdaQuery(YhShop.class)
+				.eq(YhShop::getUserId, userId).last("limit 1"));
 		if (dbShop == null) {
 		if (dbShop == null) {
 			throw BusinessRuntimeException.getInstance("店铺不存在");
 			throw BusinessRuntimeException.getInstance("店铺不存在");
 		}
 		}