|
@@ -207,7 +207,7 @@ public class ShopApi {
|
|
|
List<ShopInfoDto> shopInfoList = new ArrayList<>();
|
|
|
List<String> brandNameList = new ArrayList<>();
|
|
|
for (Map<String, Object> infoMap : shopInfoData) {
|
|
|
- Integer id = (Integer) infoMap.get("id");
|
|
|
+ Integer infoId = (Integer) infoMap.get("info");
|
|
|
String brandName = (String) infoMap.get("brandName");
|
|
|
String brandLogo = (String) infoMap.get("brandLogo");
|
|
|
String producePlace = (String) infoMap.get("producePlace");
|
|
@@ -221,7 +221,7 @@ public class ShopApi {
|
|
|
return ResponseJson.error("品牌名称重复");
|
|
|
}
|
|
|
ShopInfoDto shopInfo = new ShopInfoDto();
|
|
|
- shopInfo.setId(id);
|
|
|
+ shopInfo.setInfoId(infoId);
|
|
|
shopInfo.setBrandName(brandName);
|
|
|
shopInfo.setBrandLogo(brandLogo);
|
|
|
shopInfo.setProducePlace(producePlace);
|
|
@@ -377,16 +377,35 @@ public class ShopApi {
|
|
|
if (null == sysUser) {
|
|
|
return ResponseJson.error("用户信息异常", null);
|
|
|
}
|
|
|
- // 修改用户信息:供应商和子用户都可以修改个人信息,直接取id即可
|
|
|
- Integer authUserId = sysUser.getId();
|
|
|
+ // 获取供应商用户id
|
|
|
+ Integer userIdentity = sysUser.getUserIdentity();
|
|
|
+ Integer authUserId = 2 == userIdentity ? sysUser.getId() : 3 == userIdentity ? sysUser.getParentId() : null;
|
|
|
if (null == authUserId) {
|
|
|
- return ResponseJson.error("用户id不能为空", null);
|
|
|
+ return ResponseJson.error("供应商用户id不能为空", null);
|
|
|
}
|
|
|
JSONObject parseObject = JSONObject.parseObject(params);
|
|
|
- String linkMan = parseObject.getString("verifyCode");
|
|
|
+ String linkMan = parseObject.getString("linkMan");
|
|
|
return shopService.changeLinkMan(authUserId, linkMan);
|
|
|
}
|
|
|
|
|
|
+ @ApiOperation("修改公司logo")
|
|
|
+ @ApiImplicitParam(name = "params", value = "logo:公司logo", required = true)
|
|
|
+ @PostMapping("/logo/change")
|
|
|
+ public ResponseJson changeLogo(@CurrentUser SysUser sysUser, @RequestBody String params) {
|
|
|
+ if (null == sysUser) {
|
|
|
+ return ResponseJson.error("用户信息异常", null);
|
|
|
+ }
|
|
|
+ // 获取供应商用户id
|
|
|
+ Integer userIdentity = sysUser.getUserIdentity();
|
|
|
+ Integer authUserId = 2 == userIdentity ? sysUser.getId() : 3 == userIdentity ? sysUser.getParentId() : null;
|
|
|
+ if (null == authUserId) {
|
|
|
+ return ResponseJson.error("供应商用户id不能为空", null);
|
|
|
+ }
|
|
|
+ JSONObject parseObject = JSONObject.parseObject(params);
|
|
|
+ String logo = parseObject.getString("logo");
|
|
|
+ return shopService.changeLogo(authUserId, logo);
|
|
|
+ }
|
|
|
+
|
|
|
@ApiOperation("登录账号绑定")
|
|
|
@ApiImplicitParam(name = "params", value = "mobile:手机号;verifyCode:验证码;loginAccount:登录账号;", required = true)
|
|
|
@PostMapping("/account/bind")
|
|
@@ -394,8 +413,9 @@ public class ShopApi {
|
|
|
if (null == sysUser) {
|
|
|
return ResponseJson.error("用户信息异常", null);
|
|
|
}
|
|
|
- // 修改用户信息:供应商和子用户都可以修改个人信息,直接取id即可
|
|
|
- Integer authUserId = sysUser.getId();
|
|
|
+ // 获取供应商用户id
|
|
|
+ Integer userIdentity = sysUser.getUserIdentity();
|
|
|
+ Integer authUserId = 2 == userIdentity ? sysUser.getId() : 3 == userIdentity ? sysUser.getParentId() : null;
|
|
|
if (null == authUserId) {
|
|
|
return ResponseJson.error("供应商用户id不能为空", null);
|
|
|
}
|