|
@@ -108,7 +108,7 @@ public class BrandController extends AbstractController{
|
|
|
@ApiOperation(value = "店铺绑定情况列表")
|
|
|
@GetMapping("/brandBindList")
|
|
|
@RequiresPermissions("brand:list")
|
|
|
- public Result brandBindList(@RequestParam(name = "page") long page,
|
|
|
+ public Result brandBindList(@RequestParam(name = "page") long page,@RequestHeader String token,
|
|
|
@RequestParam(name = "limit") long limit,
|
|
|
String sceneName,String brandName,Integer type,Integer livestreamStatus) {
|
|
|
List<Long> deptIdList = new ArrayList<>();
|
|
@@ -138,9 +138,11 @@ public class BrandController extends AbstractController{
|
|
|
if (!CollectionUtils.isEmpty(nameList)) {
|
|
|
brandRspVo.setBindShowerNameList(nameList.stream().collect(Collectors.joining(";")));
|
|
|
}
|
|
|
- JSONObject jsonObject = zhiHouseService.queryBySceneNum(brandEntity.getSceneNum());
|
|
|
- brandRspVo.setSceneName(jsonObject.getString("sceneName"));
|
|
|
- brandRspVo.setSceneUrl(jsonObject.getString("webSite"));
|
|
|
+ JSONObject jsonObject = zhiHouseService.queryBySceneNum(brandEntity.getSceneNum(),token);
|
|
|
+ if(!ObjectUtils.isEmpty(jsonObject)){
|
|
|
+ brandRspVo.setSceneName(jsonObject.getString("sceneName"));
|
|
|
+ brandRspVo.setSceneUrl(jsonObject.getString("webSite"));
|
|
|
+ }
|
|
|
return brandRspVo;
|
|
|
}).collect(Collectors.toList());
|
|
|
return Result.success(PageUtilsPlus.page(rspBrandList,resultPage));
|
|
@@ -151,16 +153,18 @@ public class BrandController extends AbstractController{
|
|
|
*/
|
|
|
@PostMapping("/info")
|
|
|
@RequiresPermissions("brand:info")
|
|
|
- public Result info(@RequestBody BrandEntity brandEntity) {
|
|
|
+ public Result info(@RequestBody BrandEntity brandEntity,@RequestHeader String token) {
|
|
|
if(ObjectUtils.isEmpty(brandEntity.getId())){
|
|
|
return Result.failure("参数有误!");
|
|
|
}
|
|
|
BrandEntity brand = brandService.queryObject(brandEntity.getId().intValue());
|
|
|
BrandRspVo brandRspVo = new BrandRspVo();
|
|
|
BeanUtils.copyProperties(brand,brandRspVo);
|
|
|
- JSONObject jsonObject = zhiHouseService.queryBySceneNum(brand.getSceneNum());
|
|
|
- brandRspVo.setSceneUrl(jsonObject.getString("webSite"));
|
|
|
- brandRspVo.setSceneName(jsonObject.getString("sceneName"));
|
|
|
+ JSONObject jsonObject = zhiHouseService.queryBySceneNum(brand.getSceneNum(),token);
|
|
|
+ if(!ObjectUtils.isEmpty(jsonObject)){
|
|
|
+ brandRspVo.setSceneUrl(jsonObject.getString("webSite"));
|
|
|
+ brandRspVo.setSceneName(jsonObject.getString("sceneName"));
|
|
|
+ }
|
|
|
return Result.success( brandRspVo);
|
|
|
}
|
|
|
|
|
@@ -173,11 +177,11 @@ public class BrandController extends AbstractController{
|
|
|
@RequestMapping("/save")
|
|
|
@RequiresPermissions("brand:save")
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
- public Result save(@RequestBody BrandEntity params) {
|
|
|
+ public Result save(@RequestBody BrandEntity params,@RequestHeader String token) {
|
|
|
if(ObjectUtils.isEmpty(params.getSceneNum())){
|
|
|
return Result.failure("场景码为空!");
|
|
|
}
|
|
|
- JSONObject jsonObject = zhiHouseService.queryBySceneNum(params.getSceneNum());
|
|
|
+ JSONObject jsonObject = zhiHouseService.queryBySceneNum(params.getSceneNum(),token);
|
|
|
if(ObjectUtils.isEmpty(jsonObject)){
|
|
|
return Result.failure("场景码错误!");
|
|
|
}
|
|
@@ -207,6 +211,7 @@ public class BrandController extends AbstractController{
|
|
|
brandService.save(brand,true);
|
|
|
//生成微信分享二维码
|
|
|
brandService.generalWxShareQrCode(brand , true);
|
|
|
+ brand.setToken(token);
|
|
|
brandService.sendDataToApi(brand);
|
|
|
} catch (BeansException e) {
|
|
|
e.printStackTrace();
|
|
@@ -222,7 +227,7 @@ public class BrandController extends AbstractController{
|
|
|
@PostMapping("/update")
|
|
|
@RequiresPermissions("brand:update")
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
- public Result update(@RequestBody BrandEntity brand) {
|
|
|
+ public Result update(@RequestBody BrandEntity brand,@RequestHeader String token) {
|
|
|
if(ObjectUtils.isEmpty(brand.getId())){
|
|
|
return Result.failure("id 为空!");
|
|
|
}
|
|
@@ -244,7 +249,7 @@ public class BrandController extends AbstractController{
|
|
|
//场景码有变更 将新场景的分享二维码更新
|
|
|
String wxShareQrCodeUrl = brandService.generalWxShareQrCode(brand, false);
|
|
|
brand.setShareWxQrCode(wxShareQrCodeUrl);
|
|
|
- JSONObject jsonObject = zhiHouseService.queryBySceneNum(brand.getSceneNum());
|
|
|
+ JSONObject jsonObject = zhiHouseService.queryBySceneNum(brand.getSceneNum(),token);
|
|
|
if(ObjectUtils.isEmpty(jsonObject)){
|
|
|
return Result.failure("场景码错误!");
|
|
|
}
|
|
@@ -255,6 +260,7 @@ public class BrandController extends AbstractController{
|
|
|
|
|
|
brand.setAppListPicUrl(brand.getAppListPicUrl());
|
|
|
brandService.update(brand);
|
|
|
+ brand.setToken(token);
|
|
|
brandService.sendDataToApi(brand);
|
|
|
return Result.success();
|
|
|
}
|
|
@@ -266,7 +272,7 @@ public class BrandController extends AbstractController{
|
|
|
@RequestMapping("/delete")
|
|
|
@RequiresPermissions("brand:delete")
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
- public Result delete(@RequestBody Integer[] ids) {
|
|
|
+ public Result delete(@RequestBody Integer[] ids,@RequestHeader String token) {
|
|
|
if(ObjectUtils.isEmpty(ids)){
|
|
|
return Result.success();
|
|
|
}
|
|
@@ -279,7 +285,10 @@ public class BrandController extends AbstractController{
|
|
|
return Result.failure("该场景或者直播间已经设置了商品,不允许删除!");
|
|
|
}
|
|
|
//获取数据,推送给api
|
|
|
- Arrays.stream(ids).map(id-> brandService.queryObject(id)).forEach(entity->brandService.sendDataToApi(entity));
|
|
|
+ Arrays.stream(ids).map(id-> brandService.queryObject(id)).forEach(entity->{
|
|
|
+ entity.setToken(token);
|
|
|
+ brandService.sendDataToApi(entity);
|
|
|
+ });
|
|
|
|
|
|
// 删除绑定关系
|
|
|
mySysUserBrandService.deleteByBrandIds(ids);
|
|
@@ -311,7 +320,7 @@ public class BrandController extends AbstractController{
|
|
|
* 查看所有列表
|
|
|
*/
|
|
|
@RequestMapping("/queryAllHot")
|
|
|
- public Result queryAllHot(@RequestBody Map<String, Object> params) throws Exception {
|
|
|
+ public Result queryAllHot(@RequestBody Map<String, Object> params,@RequestHeader String token) throws Exception {
|
|
|
//查询列表数据
|
|
|
Query query = new Query(params);
|
|
|
|
|
@@ -346,9 +355,10 @@ public class BrandController extends AbstractController{
|
|
|
}
|
|
|
sceneNum = brand.getSceneNum();
|
|
|
|
|
|
- JSONObject sceneEntity = zhiHouseService.queryBySceneNum(sceneNum);
|
|
|
- sceneName = sceneEntity.getString("sceneName");
|
|
|
-
|
|
|
+ JSONObject sceneEntity = zhiHouseService.queryBySceneNum(sceneNum,token);
|
|
|
+ if(!ObjectUtils.isEmpty(sceneEntity)){
|
|
|
+ sceneName = sceneEntity.getString("sceneName");
|
|
|
+ }
|
|
|
getResult = util.doGet(sceneData + "data/data" + sceneNum + "/hot.json");
|
|
|
if(StringUtils.isEmpty(getResult)){
|
|
|
continue;
|