|
@@ -13,11 +13,7 @@ import com.cyksj.mapper.UserMapper;
|
|
|
import com.cyksj.mapper.manage.cms.CmsUserMapper;
|
|
import com.cyksj.mapper.manage.cms.CmsUserMapper;
|
|
|
import com.cyksj.mapper.shop.YhShopMapper;
|
|
import com.cyksj.mapper.shop.YhShopMapper;
|
|
|
import com.cyksj.model.entity.*;
|
|
import com.cyksj.model.entity.*;
|
|
|
-import com.cyksj.model.manage.entity.YhShop;
|
|
|
|
|
-import com.cyksj.model.request.DistributeApplyMoneyReq;
|
|
|
|
|
-import com.cyksj.model.request.GoodsDonShopRateReq;
|
|
|
|
|
-import com.cyksj.model.request.ShopGeneralGoodsRateReq;
|
|
|
|
|
-import com.cyksj.model.request.YhShopVerifyReq;
|
|
|
|
|
|
|
+import com.cyksj.model.request.*;
|
|
|
import com.cyksj.model.views.*;
|
|
import com.cyksj.model.views.*;
|
|
|
import com.cyksj.service.mange.CmsYhShopCommonService;
|
|
import com.cyksj.service.mange.CmsYhShopCommonService;
|
|
|
import com.cyksj.service.mange.CmsYhShopGoodsRateService;
|
|
import com.cyksj.service.mange.CmsYhShopGoodsRateService;
|
|
@@ -41,7 +37,7 @@ import java.util.concurrent.ConcurrentHashMap;
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * admin/小店店铺/银河后台
|
|
|
|
|
|
|
+ * admin/小店店铺/银河后台/店铺管理
|
|
|
* @author zwhui
|
|
* @author zwhui
|
|
|
* @date 2023/9/14 16:42
|
|
* @date 2023/9/14 16:42
|
|
|
*/
|
|
*/
|
|
@@ -191,12 +187,14 @@ public class CmsYhShopGoodsController {
|
|
|
/**
|
|
/**
|
|
|
* 店铺关闭
|
|
* 店铺关闭
|
|
|
*/
|
|
*/
|
|
|
- @PutMapping("/update/status/{id}")
|
|
|
|
|
- public Result<String> updateShopStatus(@PathVariable Long id) {
|
|
|
|
|
- YhShop yhShop = yhShopMapper.selectById(id);
|
|
|
|
|
- if (yhShop != null) {
|
|
|
|
|
- yhShop.setStatus(!yhShop.getStatus());
|
|
|
|
|
- yhShopMapper.updateById(yhShop);
|
|
|
|
|
|
|
+ @PutMapping("/update/status")
|
|
|
|
|
+ public Result<String> updateShopStatus(@RequestBody YhShop yhShop) {
|
|
|
|
|
+ Long id = yhShop.getId();
|
|
|
|
|
+ YhShop dbShop = yhShopMapper.selectById(id);
|
|
|
|
|
+ if (dbShop != null) {
|
|
|
|
|
+ dbShop.setStatus(!yhShop.getStatus());
|
|
|
|
|
+ dbShop.setRemark(yhShop.getRemark());
|
|
|
|
|
+ yhShopMapper.updateById(dbShop);
|
|
|
}
|
|
}
|
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult();
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult();
|
|
|
}
|
|
}
|
|
@@ -223,7 +221,19 @@ public class CmsYhShopGoodsController {
|
|
|
* 设置店铺提成比例
|
|
* 设置店铺提成比例
|
|
|
*/
|
|
*/
|
|
|
@PutMapping("/set/rate")
|
|
@PutMapping("/set/rate")
|
|
|
- public Result<String> setYhShopGoodsRate(@RequestBody List<YhShopUserPlatDistributeRate> yhShopUserPlatDistributeRates) {
|
|
|
|
|
|
|
+ public Result<String> setYhShopGoodsRate(@RequestBody @Validated YhShopUserPlatDistributeRateReq req) {
|
|
|
|
|
+ Long businessId = req.getBusinessId();
|
|
|
|
|
+ if (businessId != null) {
|
|
|
|
|
+ YhShop yhShop = new YhShop();
|
|
|
|
|
+ yhShop.setId(req.getId());
|
|
|
|
|
+ yhShop.setBusinessId(businessId);
|
|
|
|
|
+ yhShop.setRemark(req.getRemark());
|
|
|
|
|
+ cmsYhShopCommonService.setYhShopBusiness(yhShop);
|
|
|
|
|
+ }
|
|
|
|
|
+ List<YhShopUserPlatDistributeRate> yhShopUserPlatDistributeRates = req.getRates();
|
|
|
|
|
+ if (CollUtil.isEmpty(yhShopUserPlatDistributeRates)) {
|
|
|
|
|
+ throw BusinessRuntimeException.getInstance("请选择店铺用户对应平台比例");
|
|
|
|
|
+ }
|
|
|
cmsYhShopCommonService.setYhShopGoodsRate(yhShopUserPlatDistributeRates);
|
|
cmsYhShopCommonService.setYhShopGoodsRate(yhShopUserPlatDistributeRates);
|
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult();
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult();
|
|
|
}
|
|
}
|