|
@@ -99,7 +99,7 @@ public class ShopServiceImpl implements ShopService {
|
|
// 供应商商品上架平台信息
|
|
// 供应商商品上架平台信息
|
|
List<String> shopProductList = loginMapper.getShopProductGroudMall(userLoginVo.getShopId());
|
|
List<String> shopProductList = loginMapper.getShopProductGroudMall(userLoginVo.getShopId());
|
|
if (null != shopProductList) {
|
|
if (null != shopProductList) {
|
|
- for(String product : shopProductList ) {
|
|
|
|
|
|
+ for (String product : shopProductList) {
|
|
if (StringUtils.isNotBlank(product)) {
|
|
if (StringUtils.isNotBlank(product)) {
|
|
// 商品上架平台是否在联合丽格上架
|
|
// 商品上架平台是否在联合丽格上架
|
|
if (product.contains("4")) {
|
|
if (product.contains("4")) {
|
|
@@ -304,7 +304,32 @@ public class ShopServiceImpl implements ShopService {
|
|
* @param shopId 供应商Id
|
|
* @param shopId 供应商Id
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
- public ResponseJson<ShopHomeVo> getShopHomeData(Integer shopId) {
|
|
|
|
|
|
+ public ResponseJson<ShopHomeVo> getShopHomeData(Integer shopId, Integer userId, Integer userIdentity) {
|
|
|
|
+ /** 薇旖美特殊需求,非福建服务商名下的机构无法查看其主页
|
|
|
|
+ * 1.供应商自己可以看
|
|
|
|
+ * 2.薇旖美服务商+名下协销和机构
|
|
|
|
+ */
|
|
|
|
+// if (shopId == 10131) {
|
|
|
|
+// boolean b = true;
|
|
|
|
+// // 协销
|
|
|
|
+// if (1 == userIdentity) {
|
|
|
|
+//
|
|
|
|
+// }
|
|
|
|
+// // 供应商
|
|
|
|
+// else if (3 == userIdentity) {
|
|
|
|
+// b = 22965 != userId;
|
|
|
|
+// }
|
|
|
|
+// // 机构
|
|
|
|
+// else if (2 == userIdentity || 4 == userIdentity) {
|
|
|
|
+// // 根据服务商(协销组长userId)查询名下小组内协销匹配机构
|
|
|
|
+// Integer spId = shopMapper.findSpId(userId);
|
|
|
|
+// spId = null == spId ? 0 : spId;
|
|
|
|
+//
|
|
|
|
+// }
|
|
|
|
+// if(b){
|
|
|
|
+// return ResponseJson.error(-2, "无权限");
|
|
|
|
+// }
|
|
|
|
+// }
|
|
ShopHomeVo supplier = shopMapper.getShopHomeData(shopId);
|
|
ShopHomeVo supplier = shopMapper.getShopHomeData(shopId);
|
|
if (supplier != null && supplier.getBusinessScope() != null) {
|
|
if (supplier != null && supplier.getBusinessScope() != null) {
|
|
String[] businessScope = supplier.getBusinessScope().split("/");
|
|
String[] businessScope = supplier.getBusinessScope().split("/");
|
|
@@ -375,7 +400,7 @@ public class ShopServiceImpl implements ShopService {
|
|
CmShopCategoryVo shopCategoryById = shopMapper.getShopCategoryById(id);
|
|
CmShopCategoryVo shopCategoryById = shopMapper.getShopCategoryById(id);
|
|
List<ProductItemVo> categoryProductList = shopMapper.getCategoryProductById(id);
|
|
List<ProductItemVo> categoryProductList = shopMapper.getCategoryProductById(id);
|
|
categoryProductList.forEach(product -> {
|
|
categoryProductList.forEach(product -> {
|
|
- product.setImage(ImageUtils.getImageURL("product", product.getImage(), 0 , wwwDomain));
|
|
|
|
|
|
+ product.setImage(ImageUtils.getImageURL("product", product.getImage(), 0, wwwDomain));
|
|
});
|
|
});
|
|
shopCategoryById.setProducts(categoryProductList);
|
|
shopCategoryById.setProducts(categoryProductList);
|
|
return ResponseJson.success(shopCategoryById);
|
|
return ResponseJson.success(shopCategoryById);
|
|
@@ -396,12 +421,12 @@ public class ShopServiceImpl implements ShopService {
|
|
PageHelper.startPage(pageNum, pageSize);
|
|
PageHelper.startPage(pageNum, pageSize);
|
|
List<ProductItemVo> shopProductList = shopMapper.getShopProductList(shopId, name);
|
|
List<ProductItemVo> shopProductList = shopMapper.getShopProductList(shopId, name);
|
|
// 供应商已选择商品, 同类别不可重复选择
|
|
// 供应商已选择商品, 同类别不可重复选择
|
|
- List<Integer> categoryProductIdList = new ArrayList<>();
|
|
|
|
|
|
+ List<Integer> categoryProductIdList = new ArrayList<>();
|
|
if (null != categoryId) {
|
|
if (null != categoryId) {
|
|
categoryProductIdList = shopMapper.getCategoryProductIdList(shopId, categoryId);
|
|
categoryProductIdList = shopMapper.getCategoryProductIdList(shopId, categoryId);
|
|
}
|
|
}
|
|
for (ProductItemVo product : shopProductList) {
|
|
for (ProductItemVo product : shopProductList) {
|
|
- product.setImage(ImageUtils.getImageURL("product", product.getImage(), 0 , wwwDomain));
|
|
|
|
|
|
+ product.setImage(ImageUtils.getImageURL("product", product.getImage(), 0, wwwDomain));
|
|
if (null != categoryProductIdList && categoryProductIdList.contains(product.getProductId())) {
|
|
if (null != categoryProductIdList && categoryProductIdList.contains(product.getProductId())) {
|
|
product.setFlag(false);
|
|
product.setFlag(false);
|
|
} else {
|
|
} else {
|
|
@@ -446,7 +471,7 @@ public class ShopServiceImpl implements ShopService {
|
|
cmShopCategoryVo.setCategory(category);
|
|
cmShopCategoryVo.setCategory(category);
|
|
cmShopCategoryVo.setSort(sort);
|
|
cmShopCategoryVo.setSort(sort);
|
|
cmShopCategoryVo.setProductIds(productIds);
|
|
cmShopCategoryVo.setProductIds(productIds);
|
|
- if(null == id) {
|
|
|
|
|
|
+ if (null == id) {
|
|
// 新增
|
|
// 新增
|
|
shopMapper.insertCategory(cmShopCategoryVo);
|
|
shopMapper.insertCategory(cmShopCategoryVo);
|
|
} else {
|
|
} else {
|
|
@@ -477,7 +502,7 @@ public class ShopServiceImpl implements ShopService {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
// 排除不在该商品类别的商品
|
|
// 排除不在该商品类别的商品
|
|
- if(productIdList.size() > 0) {
|
|
|
|
|
|
+ if (productIdList.size() > 0) {
|
|
shopMapper.updateCategoryProduct(categoryId, productIdList);
|
|
shopMapper.updateCategoryProduct(categoryId, productIdList);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -503,7 +528,7 @@ public class ShopServiceImpl implements ShopService {
|
|
* 供应商首页-轮播图片
|
|
* 供应商首页-轮播图片
|
|
*
|
|
*
|
|
* @param shopId 供应商Id
|
|
* @param shopId 供应商Id
|
|
- * @param title 标题
|
|
|
|
|
|
+ * @param title 标题
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
public ResponseJson<PaginationVo<ShopBannerVo>> getShopHomeImages(Integer shopId, String title, int pageNum, int pageSize) {
|
|
public ResponseJson<PaginationVo<ShopBannerVo>> getShopHomeImages(Integer shopId, String title, int pageNum, int pageSize) {
|
|
@@ -813,15 +838,17 @@ public class ShopServiceImpl implements ShopService {
|
|
infoTypes(articleTypeList);
|
|
infoTypes(articleTypeList);
|
|
return ResponseJson.success(articleTypeList);
|
|
return ResponseJson.success(articleTypeList);
|
|
}
|
|
}
|
|
- public void infoTypes(List<ArticleTypeVo> articleTypes ) {
|
|
|
|
- articleTypes.forEach(type->{
|
|
|
|
|
|
+
|
|
|
|
+ public void infoTypes(List<ArticleTypeVo> articleTypes) {
|
|
|
|
+ articleTypes.forEach(type -> {
|
|
List<ArticleTypeVo> articleTypes1 = articleMapper.getArticleTypeList(type.getTypeId().toString());
|
|
List<ArticleTypeVo> articleTypes1 = articleMapper.getArticleTypeList(type.getTypeId().toString());
|
|
- if(articleTypes1.size()>0){
|
|
|
|
|
|
+ if (articleTypes1.size() > 0) {
|
|
type.setArticleTypes(articleTypes1);
|
|
type.setArticleTypes(articleTypes1);
|
|
infoTypes(articleTypes1);
|
|
infoTypes(articleTypes1);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
+
|
|
@Override
|
|
@Override
|
|
public ResponseJson<Void> deleteArticle(Integer articleId) {
|
|
public ResponseJson<Void> deleteArticle(Integer articleId) {
|
|
articleMapper.deleteArticle(articleId);
|
|
articleMapper.deleteArticle(articleId);
|
|
@@ -1087,7 +1114,7 @@ public class ShopServiceImpl implements ShopService {
|
|
// 获取报表对应供应商数据
|
|
// 获取报表对应供应商数据
|
|
CmMarketShopVo shopInfo = shopMapper.getShopInfoById(shopId, type, marketReportId);
|
|
CmMarketShopVo shopInfo = shopMapper.getShopInfoById(shopId, type, marketReportId);
|
|
List<Integer> marketReportIds = shopMapper.getMarketReportIds(shopInfo.getId(), type, marketReportId, startTime, endTime);
|
|
List<Integer> marketReportIds = shopMapper.getMarketReportIds(shopInfo.getId(), type, marketReportId, startTime, endTime);
|
|
- log.info("marketReportIds===="+marketReportIds);
|
|
|
|
|
|
+ log.info("marketReportIds====" + marketReportIds);
|
|
// 获取阶段描述
|
|
// 获取阶段描述
|
|
List<StageVo> summarize = new ArrayList<>();
|
|
List<StageVo> summarize = new ArrayList<>();
|
|
List<StageVo> summarize1 = new ArrayList<>();
|
|
List<StageVo> summarize1 = new ArrayList<>();
|
|
@@ -1131,11 +1158,11 @@ public class ShopServiceImpl implements ShopService {
|
|
}
|
|
}
|
|
try {
|
|
try {
|
|
if (StringUtils.isNotBlank(startTime) && StringUtils.isNotBlank(endTime)) {
|
|
if (StringUtils.isNotBlank(startTime) && StringUtils.isNotBlank(endTime)) {
|
|
- shopInfo.setChartTitle("("+startTime.replaceAll("-", "/") + "-" + endTime.replaceAll("-", "/")+")");
|
|
|
|
|
|
+ shopInfo.setChartTitle("(" + startTime.replaceAll("-", "/") + "-" + endTime.replaceAll("-", "/") + ")");
|
|
} else if (1 == type && null != marketReportId) {
|
|
} else if (1 == type && null != marketReportId) {
|
|
- shopInfo.setChartTitle("("+dateFormat.format(dateFormat.parse(shopInfo.getReportDate())).replaceAll("-", "/")+")");
|
|
|
|
|
|
+ shopInfo.setChartTitle("(" + dateFormat.format(dateFormat.parse(shopInfo.getReportDate())).replaceAll("-", "/") + ")");
|
|
} else {
|
|
} else {
|
|
- shopInfo.setChartTitle("("+ (StringUtils.isNotBlank(shopInfo.getEndDate()) ? dateFormat.format(dateFormat.parse(shopInfo.getEndDate())).replaceAll("-", "/") : "") + ")");
|
|
|
|
|
|
+ shopInfo.setChartTitle("(" + (StringUtils.isNotBlank(shopInfo.getEndDate()) ? dateFormat.format(dateFormat.parse(shopInfo.getEndDate())).replaceAll("-", "/") : "") + ")");
|
|
}
|
|
}
|
|
} catch (ParseException e) {
|
|
} catch (ParseException e) {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
@@ -1220,7 +1247,11 @@ public class ShopServiceImpl implements ShopService {
|
|
// 获取点击量数据
|
|
// 获取点击量数据
|
|
name = new ArrayList<>();
|
|
name = new ArrayList<>();
|
|
value = new ArrayList<>();
|
|
value = new ArrayList<>();
|
|
- generalNumber = 0; microBlog = 0; redBookNumber = 0; otherNumber = 0;pointSingNumber = 0;
|
|
|
|
|
|
+ generalNumber = 0;
|
|
|
|
+ microBlog = 0;
|
|
|
|
+ redBookNumber = 0;
|
|
|
|
+ otherNumber = 0;
|
|
|
|
+ pointSingNumber = 0;
|
|
if (null != marketReportIds && marketReportIds.size() > 0) {
|
|
if (null != marketReportIds && marketReportIds.size() > 0) {
|
|
List<ReadVolumeVo> marketReadVolume = shopMapper.getMarketReadVolume(marketReportIds);
|
|
List<ReadVolumeVo> marketReadVolume = shopMapper.getMarketReadVolume(marketReportIds);
|
|
if (null != marketReadVolume && marketReadVolume.size() > 0) {
|
|
if (null != marketReadVolume && marketReadVolume.size() > 0) {
|
|
@@ -1395,22 +1426,22 @@ public class ShopServiceImpl implements ShopService {
|
|
if (StringUtils.isBlank(startTime)) {
|
|
if (StringUtils.isBlank(startTime)) {
|
|
startTime = monthFirstDay(shopInfo.getReportDate());
|
|
startTime = monthFirstDay(shopInfo.getReportDate());
|
|
}
|
|
}
|
|
- if(StringUtils.isBlank(endTime)) {
|
|
|
|
|
|
+ if (StringUtils.isBlank(endTime)) {
|
|
endTime = monthLastDay(shopInfo.getReportDate());
|
|
endTime = monthLastDay(shopInfo.getReportDate());
|
|
}
|
|
}
|
|
- } else{
|
|
|
|
|
|
+ } else {
|
|
// 供应商主页进入
|
|
// 供应商主页进入
|
|
if (StringUtils.isBlank(startTime)) {
|
|
if (StringUtils.isBlank(startTime)) {
|
|
startTime = shopInfo.getStartDate();
|
|
startTime = shopInfo.getStartDate();
|
|
}
|
|
}
|
|
- if(StringUtils.isBlank(endTime)) {
|
|
|
|
|
|
+ if (StringUtils.isBlank(endTime)) {
|
|
endTime = shopInfo.getEndDate();
|
|
endTime = shopInfo.getEndDate();
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
- log.info("startTime===="+startTime);
|
|
|
|
- log.info("endTime===="+endTime);
|
|
|
|
- log.info("shopKeyword===="+shopKeyword);
|
|
|
|
|
|
+ log.info("startTime====" + startTime);
|
|
|
|
+ log.info("endTime====" + endTime);
|
|
|
|
+ log.info("shopKeyword====" + shopKeyword);
|
|
if (null != shopKeyword && shopKeyword.size() > 0) {
|
|
if (null != shopKeyword && shopKeyword.size() > 0) {
|
|
// 访问供应商用户对于所在地区
|
|
// 访问供应商用户对于所在地区
|
|
List<String> region = shopMapper.getRegion(startTime, endTime, shopKeyword);
|
|
List<String> region = shopMapper.getRegion(startTime, endTime, shopKeyword);
|
|
@@ -1432,7 +1463,7 @@ public class ShopServiceImpl implements ShopService {
|
|
set = new HashSet<>();
|
|
set = new HashSet<>();
|
|
List<ReturnEntityVo> userIdentity1 = shopMapper.getUserIdentity(startTime, endTime, shopKeyword);
|
|
List<ReturnEntityVo> userIdentity1 = shopMapper.getUserIdentity(startTime, endTime, shopKeyword);
|
|
if (null != userIdentity1 && userIdentity1.size() > 0) {
|
|
if (null != userIdentity1 && userIdentity1.size() > 0) {
|
|
- userIdentity1.removeIf( user -> StringUtils.isBlank(user.getName()));
|
|
|
|
|
|
+ userIdentity1.removeIf(user -> StringUtils.isBlank(user.getName()));
|
|
// 所有值之和
|
|
// 所有值之和
|
|
AtomicInteger maxUserValue = new AtomicInteger(0);
|
|
AtomicInteger maxUserValue = new AtomicInteger(0);
|
|
for (ReturnEntityVo returnEntityVo : userIdentity1) {
|
|
for (ReturnEntityVo returnEntityVo : userIdentity1) {
|
|
@@ -1446,19 +1477,19 @@ public class ShopServiceImpl implements ShopService {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- userIdentity.forEach( user -> maxUserValue.set(MathUtil.add(Integer.parseInt(user.getValue()), maxUserValue.get()).intValue()));
|
|
|
|
|
|
+ userIdentity.forEach(user -> maxUserValue.set(MathUtil.add(Integer.parseInt(user.getValue()), maxUserValue.get()).intValue()));
|
|
userIdentity.forEach(returnUserIdentity -> {
|
|
userIdentity.forEach(returnUserIdentity -> {
|
|
- log.info("returnUserIdentity.getValue()==="+returnUserIdentity.getValue());
|
|
|
|
- log.info("maxUserValue.get()==="+maxUserValue.get());
|
|
|
|
|
|
+ log.info("returnUserIdentity.getValue()===" + returnUserIdentity.getValue());
|
|
|
|
+ log.info("maxUserValue.get()===" + maxUserValue.get());
|
|
String values = MathUtil.mul(MathUtil.div(returnUserIdentity.getValue(), maxUserValue.get(), 2), 100).toString();
|
|
String values = MathUtil.mul(MathUtil.div(returnUserIdentity.getValue(), maxUserValue.get(), 2), 100).toString();
|
|
- log.info("values==="+values);
|
|
|
|
|
|
+ log.info("values===" + values);
|
|
returnUserIdentity.setValue(values);
|
|
returnUserIdentity.setValue(values);
|
|
});
|
|
});
|
|
}
|
|
}
|
|
set = new HashSet<>();
|
|
set = new HashSet<>();
|
|
List<ReturnEntityVo> clubType1 = shopMapper.getClubType(startTime, endTime, shopKeyword);
|
|
List<ReturnEntityVo> clubType1 = shopMapper.getClubType(startTime, endTime, shopKeyword);
|
|
if (null != clubType1 && clubType1.size() > 0) {
|
|
if (null != clubType1 && clubType1.size() > 0) {
|
|
- clubType1.removeIf( club -> StringUtils.isBlank(club.getName()));
|
|
|
|
|
|
+ clubType1.removeIf(club -> StringUtils.isBlank(club.getName()));
|
|
// 所有值之和
|
|
// 所有值之和
|
|
AtomicInteger maxClubTypeValue = new AtomicInteger(0);
|
|
AtomicInteger maxClubTypeValue = new AtomicInteger(0);
|
|
for (ReturnEntityVo returnEntityVo : clubType1) {
|
|
for (ReturnEntityVo returnEntityVo : clubType1) {
|
|
@@ -1472,12 +1503,12 @@ public class ShopServiceImpl implements ShopService {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- clubType.forEach( club -> maxClubTypeValue.set(MathUtil.add(Integer.parseInt(club.getValue()), maxClubTypeValue.get()).intValue()));
|
|
|
|
|
|
+ clubType.forEach(club -> maxClubTypeValue.set(MathUtil.add(Integer.parseInt(club.getValue()), maxClubTypeValue.get()).intValue()));
|
|
clubType.forEach(returnUserIdentity -> {
|
|
clubType.forEach(returnUserIdentity -> {
|
|
- log.info("returnUserIdentity.getValue()==="+returnUserIdentity.getValue());
|
|
|
|
- log.info("maxClubTypeValue.get()==="+maxClubTypeValue.get());
|
|
|
|
|
|
+ log.info("returnUserIdentity.getValue()===" + returnUserIdentity.getValue());
|
|
|
|
+ log.info("maxClubTypeValue.get()===" + maxClubTypeValue.get());
|
|
String values = MathUtil.mul(MathUtil.div(returnUserIdentity.getValue(), maxClubTypeValue.get(), 2), 100).toString();
|
|
String values = MathUtil.mul(MathUtil.div(returnUserIdentity.getValue(), maxClubTypeValue.get(), 2), 100).toString();
|
|
- log.info("values==="+values);
|
|
|
|
|
|
+ log.info("values===" + values);
|
|
returnUserIdentity.setValue(values);
|
|
returnUserIdentity.setValue(values);
|
|
});
|
|
});
|
|
}
|
|
}
|
|
@@ -1506,7 +1537,8 @@ public class ShopServiceImpl implements ShopService {
|
|
|
|
|
|
/**
|
|
/**
|
|
* 获取该月份首日日期
|
|
* 获取该月份首日日期
|
|
- * @param reportDate 2023-12
|
|
|
|
|
|
+ *
|
|
|
|
+ * @param reportDate 2023-12
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
public String monthFirstDay(String reportDate) {
|
|
public String monthFirstDay(String reportDate) {
|
|
@@ -1520,7 +1552,8 @@ public class ShopServiceImpl implements ShopService {
|
|
|
|
|
|
/**
|
|
/**
|
|
* 获取该月份最后一天日期
|
|
* 获取该月份最后一天日期
|
|
- * @param reportDate 2023-12
|
|
|
|
|
|
+ *
|
|
|
|
+ * @param reportDate 2023-12
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
public String monthLastDay(String reportDate) {
|
|
public String monthLastDay(String reportDate) {
|
|
@@ -1536,6 +1569,7 @@ public class ShopServiceImpl implements ShopService {
|
|
/**
|
|
/**
|
|
* 不包含的月份
|
|
* 不包含的月份
|
|
* todo 暂定5年
|
|
* todo 暂定5年
|
|
|
|
+ *
|
|
* @param marketReportDataList
|
|
* @param marketReportDataList
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|