|
@@ -95,7 +95,7 @@ public class ShopServiceImpl implements ShopService {
|
|
// 短信发送失败重试一次
|
|
// 短信发送失败重试一次
|
|
AliyunSmsUtil.sendSms(mobile, 14, "{password:\"" + newPassword + "\"}");
|
|
AliyunSmsUtil.sendSms(mobile, 14, "{password:\"" + newPassword + "\"}");
|
|
}
|
|
}
|
|
- log.info("供应商重置密码,用户id:" + authUserId + ",新密码:" + newPassword);
|
|
|
|
|
|
+ log.info("供应商重置密码,用户id:" + authUserId);
|
|
return ResponseJson.success("密码重置成功");
|
|
return ResponseJson.success("密码重置成功");
|
|
}
|
|
}
|
|
|
|
|
|
@@ -189,6 +189,12 @@ public class ShopServiceImpl implements ShopService {
|
|
if (null != userIdByShopName) {
|
|
if (null != userIdByShopName) {
|
|
return ResponseJson.error("该供应商名称已经存在,请重新输入", null);
|
|
return ResponseJson.error("该供应商名称已经存在,请重新输入", null);
|
|
}
|
|
}
|
|
|
|
+ } else {
|
|
|
|
+ // 修改时验证新手机号是否已被使用
|
|
|
|
+ Integer userIdByMobile = shopMapper.getUserIdByMobile(mobile);
|
|
|
|
+ if (null != userIdByMobile && !userIdByMobile.equals(authUserId)) {
|
|
|
|
+ return ResponseJson.error("该手机号已被使用,请重新输入", null);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
// 更新品牌授权logo
|
|
// 更新品牌授权logo
|
|
shopInfoList.forEach(shopInfo->{
|
|
shopInfoList.forEach(shopInfo->{
|
|
@@ -249,12 +255,23 @@ public class ShopServiceImpl implements ShopService {
|
|
} else {
|
|
} else {
|
|
// 数据库中供应商信息数据
|
|
// 数据库中供应商信息数据
|
|
List<ShopBrandVo> dbInfoBrandList = shopMapper.getDbInfoBrandList(shop.getAuthUserId());
|
|
List<ShopBrandVo> dbInfoBrandList = shopMapper.getDbInfoBrandList(shop.getAuthUserId());
|
|
- List<Integer> updateInfoBrandList = new ArrayList<>();
|
|
|
|
|
|
+ // 编辑后的品牌列表
|
|
List<Integer> newInfoBrandList = new ArrayList<>();
|
|
List<Integer> newInfoBrandList = new ArrayList<>();
|
|
|
|
+ // 编辑后的品牌列表和数据库中的品牌列表重复的需要更新的部分
|
|
|
|
+ List<Integer> updateInfoBrandList = new ArrayList<>();
|
|
// 编辑后的供应商品牌id
|
|
// 编辑后的供应商品牌id
|
|
shopInfoList.forEach(shopInfo->{
|
|
shopInfoList.forEach(shopInfo->{
|
|
newInfoBrandList.add(shopInfo.getBrandId());
|
|
newInfoBrandList.add(shopInfo.getBrandId());
|
|
});
|
|
});
|
|
|
|
+ for (ShopBrandVo shopBrand : dbInfoBrandList) {
|
|
|
|
+ // 判断被删除的品牌下是否还有未删除的商品,若存在,提示供应商需要删除后才能删除品牌
|
|
|
|
+ if (!newInfoBrandList.contains(shopBrand.getBrandId())) {
|
|
|
|
+ Integer productCount = shopMapper.getProductCount(shop.getAuthUserId(), shopBrand.getBrandId());
|
|
|
|
+ if (null != productCount && productCount > 0) {
|
|
|
|
+ return ResponseJson.error("该品牌已绑定供应商商品,无法进行删除");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
for (ShopBrandVo shopBrand : dbInfoBrandList) {
|
|
for (ShopBrandVo shopBrand : dbInfoBrandList) {
|
|
if (!newInfoBrandList.contains(shopBrand.getBrandId())) {
|
|
if (!newInfoBrandList.contains(shopBrand.getBrandId())) {
|
|
// 删除被删除的数据
|
|
// 删除被删除的数据
|
|
@@ -296,6 +313,16 @@ public class ShopServiceImpl implements ShopService {
|
|
}
|
|
}
|
|
List<ShopInfoVo> shopInfoList = shopMapper.getShopInfoByUserId(authUserId);
|
|
List<ShopInfoVo> shopInfoList = shopMapper.getShopInfoByUserId(authUserId);
|
|
shopForm.setShopInfo(shopInfoList);
|
|
shopForm.setShopInfo(shopInfoList);
|
|
|
|
+ String existProductBrandIds = "";
|
|
|
|
+ for (ShopInfoVo shopInfo : shopInfoList) {
|
|
|
|
+ if (null != shopInfo.getBrandId()) {
|
|
|
|
+ Integer productCount = shopMapper.getProductCount(authUserId, shopInfo.getBrandId());
|
|
|
|
+ if (null != productCount && productCount > 0) {
|
|
|
|
+ existProductBrandIds += shopInfo.getBrandId() + ",";
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ shopForm.setExistProductBrandIds(existProductBrandIds);
|
|
return ResponseJson.success(shopForm);
|
|
return ResponseJson.success(shopForm);
|
|
}
|
|
}
|
|
|
|
|