|
@@ -61,8 +61,7 @@ public class ShopServiceImpl implements ShopService {
|
|
|
* 根据用户Id查询供应商资料
|
|
|
*
|
|
|
* @param userId 用户Id
|
|
|
- *
|
|
|
- * @return Map(userPo,clubPo)
|
|
|
+ * @return Map(userPo, clubPo)
|
|
|
*/
|
|
|
@Override
|
|
|
public ResponseJson<Map<String, Object>> getShopUserInfo(Integer userId) {
|
|
@@ -126,39 +125,39 @@ public class ShopServiceImpl implements ShopService {
|
|
|
/**
|
|
|
* 修改供应商资料
|
|
|
*
|
|
|
- * @param shopUpdateDto ShopUpdateDto{
|
|
|
- * shopId 供应商Id
|
|
|
- * userId 用户Id
|
|
|
- * name 组织名称
|
|
|
- * shortName 供应商公司简称(shortName)
|
|
|
- * email 邮箱
|
|
|
- * contractPhone 固定电话
|
|
|
- * linkMan 联系人
|
|
|
- * provinceId 省(provinceID)
|
|
|
- * cityId 市(cityID)
|
|
|
- * townId 所在县区Id(townID)
|
|
|
- * address 地址
|
|
|
- * socialCreditCode 统一社会信用代码(营业执照编号)
|
|
|
- * businessLicense 营业执照(businessLicenseImage)
|
|
|
- * firstShopType 医疗=1和非医疗=2
|
|
|
- * secondShopType 医疗的二级分类 一类器械=1、二类器械 =2、三类器械=3、其他=4 /// 1和非医疗没有二级分类
|
|
|
- * mainProduct 主打项目(mainpro)
|
|
|
- * mainProductDesc 主打商品说明(productDesc)
|
|
|
- * legalPerson 法人代表
|
|
|
- * registeredCapital 注册资本
|
|
|
- * faxNumber 传真号(fax)
|
|
|
- * companyNature 传真号(nature)
|
|
|
- * turnover 年营业额
|
|
|
- * medicalPracticeLicenseImg 医疗执业许可证(medicalPracticeLicenseImg1)
|
|
|
- * shopDesc 公司介绍(info)
|
|
|
- * businessScope 经营范围
|
|
|
- * logo 公司LOGO
|
|
|
- * }
|
|
|
- * @param operationLicence 生产经营证书(productionLicence)
|
|
|
- * @param hygienicLicense 卫生许可证
|
|
|
- * @param taxLicense 税务登记证
|
|
|
- * @param honorCertification 荣誉证书(certificateHonor)
|
|
|
- * @param productCertification 产品证书
|
|
|
+ * @param shopUpdateDto ShopUpdateDto{
|
|
|
+ * shopId 供应商Id
|
|
|
+ * userId 用户Id
|
|
|
+ * name 组织名称
|
|
|
+ * shortName 供应商公司简称(shortName)
|
|
|
+ * email 邮箱
|
|
|
+ * contractPhone 固定电话
|
|
|
+ * linkMan 联系人
|
|
|
+ * provinceId 省(provinceID)
|
|
|
+ * cityId 市(cityID)
|
|
|
+ * townId 所在县区Id(townID)
|
|
|
+ * address 地址
|
|
|
+ * socialCreditCode 统一社会信用代码(营业执照编号)
|
|
|
+ * businessLicense 营业执照(businessLicenseImage)
|
|
|
+ * firstShopType 医疗=1和非医疗=2
|
|
|
+ * secondShopType 医疗的二级分类 一类器械=1、二类器械 =2、三类器械=3、其他=4 /// 1和非医疗没有二级分类
|
|
|
+ * mainProduct 主打项目(mainpro)
|
|
|
+ * mainProductDesc 主打商品说明(productDesc)
|
|
|
+ * legalPerson 法人代表
|
|
|
+ * registeredCapital 注册资本
|
|
|
+ * faxNumber 传真号(fax)
|
|
|
+ * companyNature 传真号(nature)
|
|
|
+ * turnover 年营业额
|
|
|
+ * medicalPracticeLicenseImg 医疗执业许可证(medicalPracticeLicenseImg1)
|
|
|
+ * shopDesc 公司介绍(info)
|
|
|
+ * businessScope 经营范围
|
|
|
+ * logo 公司LOGO
|
|
|
+ * }
|
|
|
+ * @param operationLicence 生产经营证书(productionLicence)
|
|
|
+ * @param hygienicLicense 卫生许可证
|
|
|
+ * @param taxLicense 税务登记证
|
|
|
+ * @param honorCertification 荣誉证书(certificateHonor)
|
|
|
+ * @param productCertification 产品证书
|
|
|
* @return ClubUpdateDto
|
|
|
*/
|
|
|
@Override
|
|
@@ -293,7 +292,7 @@ public class ShopServiceImpl implements ShopService {
|
|
|
public ResponseJson<Void> saveShopHomeImages(ShopBannerDto shopBannerDto) {
|
|
|
ShopBannerVo shopBanner = new ShopBannerVo();
|
|
|
BeanUtils.copyProperties(shopBannerDto, shopBanner);
|
|
|
- if (null != shopBannerDto.getId()){
|
|
|
+ if (null != shopBannerDto.getId()) {
|
|
|
// 更新
|
|
|
shopBanner.setId(shopBannerDto.getId());
|
|
|
shopMapper.updateShopHomeImage(shopBanner);
|
|
@@ -311,7 +310,7 @@ public class ShopServiceImpl implements ShopService {
|
|
|
/**
|
|
|
* 供应商-删除轮播图片
|
|
|
*
|
|
|
- * @param id 图片id
|
|
|
+ * @param id 图片id
|
|
|
*/
|
|
|
@Override
|
|
|
public ResponseJson<Void> deleteShopHomeImages(Integer id) {
|
|
@@ -375,9 +374,9 @@ public class ShopServiceImpl implements ShopService {
|
|
|
// 9.已下架数量
|
|
|
Integer downNum = shopMapper.getShopProductCount(user.getShopId(), 3);
|
|
|
result.put("downNum", downNum);
|
|
|
- Jedis jedis=new Jedis("172.31.165.27", 6379);
|
|
|
+ Jedis jedis = new Jedis("172.31.165.27", 6379);
|
|
|
jedis.auth("6#xsI%b4o@5c3RoE");
|
|
|
- jedis.lpush("constraint","1");
|
|
|
+ jedis.lpush("constraint", "1");
|
|
|
result.put("constraint", jedis.rpop("constraint"));
|
|
|
|
|
|
// 10.单品销售排名
|
|
@@ -421,13 +420,13 @@ public class ShopServiceImpl implements ShopService {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- *constraint加入缓存
|
|
|
+ * constraint加入缓存
|
|
|
*/
|
|
|
@Scheduled(cron = "0 0 23 * * ?")
|
|
|
public void Open() {
|
|
|
- Jedis jedis=new Jedis("172.31.165.27", 6379);
|
|
|
+ Jedis jedis = new Jedis("172.31.165.27", 6379);
|
|
|
jedis.auth("6#xsI%b4o@5c3RoE");
|
|
|
- jedis.lpush("constraint","0");
|
|
|
+ jedis.lpush("constraint", "0");
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -439,6 +438,12 @@ public class ShopServiceImpl implements ShopService {
|
|
|
List<ArticleTypeVo> articleTypeList = articleMapper.getArticleTypeList();
|
|
|
// 文章标签列表
|
|
|
String articleLabels = articleMapper.getArticleLabelList();
|
|
|
+ // 文章关联的标签库
|
|
|
+ if (StringUtils.isNotBlank(shopArticle.getLabelIds())) {
|
|
|
+ String labelIds = shopArticle.getLabelIds();
|
|
|
+ List<String> labels = baseMapper.findLabelsByLableIds(labelIds);
|
|
|
+ shopArticle.setLabels(labels);
|
|
|
+ }
|
|
|
map.put("shopArticle", shopArticle);
|
|
|
map.put("articleTypeList", articleTypeList);
|
|
|
map.put("articleLabels", articleLabels);
|
|
@@ -513,7 +518,7 @@ public class ShopServiceImpl implements ShopService {
|
|
|
articleMapper.insertArticlePraise(articlePo.getArticleId());
|
|
|
// 新增文章 百度链接实时推送
|
|
|
if ("prod".equals(active)) {
|
|
|
- GenerateUtils.pushBaiduLink("https://www.caimei365.com/info/detail-"+articlePo.getArticleId()+"-1.html");
|
|
|
+ GenerateUtils.pushBaiduLink("https://www.caimei365.com/info/detail-" + articlePo.getArticleId() + "-1.html");
|
|
|
}
|
|
|
}
|
|
|
return ResponseJson.success(null);
|
|
@@ -594,8 +599,8 @@ public class ShopServiceImpl implements ShopService {
|
|
|
// 保存参数
|
|
|
JSONArray paramArray = JSONArray.parseArray(baikeProductDto.getParamList());
|
|
|
if (null != paramArray) {
|
|
|
- paramArray.forEach(paramObject->{
|
|
|
- Map<String,String> paramMap = (Map<String,String>) paramObject;
|
|
|
+ paramArray.forEach(paramObject -> {
|
|
|
+ Map<String, String> paramMap = (Map<String, String>) paramObject;
|
|
|
String name = paramMap.get("name");
|
|
|
String content = paramMap.get("content");
|
|
|
if (StringUtils.isNotEmpty(name) && StringUtils.isNotEmpty(content)) {
|
|
@@ -606,18 +611,18 @@ public class ShopServiceImpl implements ShopService {
|
|
|
// 保存认证图片
|
|
|
List<String> authImageList = baikeProductDto.getAuthImageList();
|
|
|
if (null != authImageList) {
|
|
|
- authImageList.forEach(authImage-> baikeProductMapper.insertProductImage(authImage, productId, 1));
|
|
|
+ authImageList.forEach(authImage -> baikeProductMapper.insertProductImage(authImage, productId, 1));
|
|
|
}
|
|
|
// 保存展示图片
|
|
|
List<String> displayImageList = baikeProductDto.getDisplayImageList();
|
|
|
if (null != displayImageList) {
|
|
|
- displayImageList.forEach(displayImage-> baikeProductMapper.insertProductImage(displayImage, productId, 2));
|
|
|
+ displayImageList.forEach(displayImage -> baikeProductMapper.insertProductImage(displayImage, productId, 2));
|
|
|
}
|
|
|
// 保存问题
|
|
|
JSONArray questionArray = JSONArray.parseArray(baikeProductDto.getQuestionList());
|
|
|
if (null != questionArray) {
|
|
|
- questionArray.forEach(questionObject->{
|
|
|
- Map<String,String> questionMap = (Map<String,String>) questionObject;
|
|
|
+ questionArray.forEach(questionObject -> {
|
|
|
+ Map<String, String> questionMap = (Map<String, String>) questionObject;
|
|
|
String question = questionMap.get("question");
|
|
|
String answer = questionMap.get("answer");
|
|
|
if (StringUtils.isNotEmpty(question) && StringUtils.isNotEmpty(answer)) {
|
|
@@ -628,8 +633,8 @@ public class ShopServiceImpl implements ShopService {
|
|
|
// 保存视频文件
|
|
|
JSONArray videoArray = JSONArray.parseArray(baikeProductDto.getVideoList());
|
|
|
if (null != videoArray) {
|
|
|
- videoArray.forEach(videoObject->{
|
|
|
- Map<String,String> videoMap = (Map<String,String>) videoObject;
|
|
|
+ videoArray.forEach(videoObject -> {
|
|
|
+ Map<String, String> videoMap = (Map<String, String>) videoObject;
|
|
|
String fileTitle = videoMap.get("fileTitle");
|
|
|
String fileName = videoMap.get("fileName");
|
|
|
String ossName = videoMap.get("ossName");
|
|
@@ -722,7 +727,7 @@ public class ShopServiceImpl implements ShopService {
|
|
|
List<BaikeRecommendVo> manualRecommendList = baikeProductMapper.getManualRecommendList(productId);
|
|
|
// 自动推荐列表
|
|
|
List<BaikeRecommendVo> autoRecommendList = baikeProductMapper.getAutoRecommendList(shopId, productTypeId, productId);
|
|
|
- autoRecommendList.forEach(authRecommend->{
|
|
|
+ autoRecommendList.forEach(authRecommend -> {
|
|
|
authRecommend.setProductId(productId);
|
|
|
});
|
|
|
map.put("manualRecommendList", manualRecommendList);
|