|
@@ -1,21 +1,23 @@
|
|
package com.caimei365.user.controller;
|
|
package com.caimei365.user.controller;
|
|
|
|
|
|
-import com.caimei365.user.idempotent.IpSave;
|
|
|
|
-import com.caimei365.user.mapper.CmBrandBannerMapper;
|
|
|
|
|
|
+import com.caimei365.user.mapper.BaseMapper;
|
|
import com.caimei365.user.model.ResponseJson;
|
|
import com.caimei365.user.model.ResponseJson;
|
|
-import com.caimei365.user.model.dto.BaikeProductDto;
|
|
|
|
-import com.caimei365.user.model.dto.ShopArticleDto;
|
|
|
|
-import com.caimei365.user.model.dto.ShopBannerDto;
|
|
|
|
-import com.caimei365.user.model.dto.ShopUpdateDto;
|
|
|
|
-import com.caimei365.user.model.po.*;
|
|
|
|
-import com.caimei365.user.model.vo.*;
|
|
|
|
|
|
+import com.caimei365.user.model.po.CmBrandBanner;
|
|
|
|
+import com.caimei365.user.model.po.CmBrandFiles;
|
|
|
|
+import com.caimei365.user.model.po.CmBrandLanding;
|
|
|
|
+import com.caimei365.user.model.po.CmQuestionnaire;
|
|
|
|
+import com.caimei365.user.model.vo.CmBrandLandingVO;
|
|
import com.caimei365.user.service.*;
|
|
import com.caimei365.user.service.*;
|
|
|
|
+import com.caimei365.user.utils.BeanUtil;
|
|
|
|
+import com.caimei365.user.utils.DateUtil;
|
|
|
|
+import com.github.pagehelper.PageHelper;
|
|
import com.github.pagehelper.PageInfo;
|
|
import com.github.pagehelper.PageInfo;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.ApiImplicitParam;
|
|
import io.swagger.annotations.ApiImplicitParam;
|
|
import io.swagger.annotations.ApiImplicitParams;
|
|
import io.swagger.annotations.ApiImplicitParams;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import lombok.RequiredArgsConstructor;
|
|
import lombok.RequiredArgsConstructor;
|
|
|
|
+import org.apache.commons.collections.CollectionUtils;
|
|
import org.apache.commons.lang.StringUtils;
|
|
import org.apache.commons.lang.StringUtils;
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
@@ -42,6 +44,7 @@ public class CmBrandLandingApi {
|
|
private final CmBrandFilesService cmBrandFilesService;
|
|
private final CmBrandFilesService cmBrandFilesService;
|
|
|
|
|
|
private final CmQuestionnaireService cmQuestionnaireService;
|
|
private final CmQuestionnaireService cmQuestionnaireService;
|
|
|
|
+ private final BaseMapper baseMapper;
|
|
@Resource
|
|
@Resource
|
|
private RemoteCallService remoteCallService;
|
|
private RemoteCallService remoteCallService;
|
|
|
|
|
|
@@ -60,30 +63,75 @@ public class CmBrandLandingApi {
|
|
return ResponseJson.error("source异常!", null);
|
|
return ResponseJson.error("source异常!", null);
|
|
}
|
|
}
|
|
CmBrandBanner cmBrandBanner = new CmBrandBanner().setType("2");
|
|
CmBrandBanner cmBrandBanner = new CmBrandBanner().setType("2");
|
|
- CmBrandLanding landing = new CmBrandLanding().setType("1,2,3");
|
|
|
|
|
|
+ CmBrandLanding landing = new CmBrandLanding().type("1").num(0).size(5);
|
|
if (source == 1) {
|
|
if (source == 1) {
|
|
cmBrandBanner.setPcStatus("1");
|
|
cmBrandBanner.setPcStatus("1");
|
|
landing.setPcStatus("1");
|
|
landing.setPcStatus("1");
|
|
- }
|
|
|
|
- if (source == 2) {
|
|
|
|
|
|
+ } else {
|
|
cmBrandBanner.setAppStatus("1");
|
|
cmBrandBanner.setAppStatus("1");
|
|
landing.setAppStatus("1");
|
|
landing.setAppStatus("1");
|
|
}
|
|
}
|
|
HashMap<String, Object> map = new HashMap(2);
|
|
HashMap<String, Object> map = new HashMap(2);
|
|
List<CmBrandBanner> cmBrandBanners = cmBrandBannerService.selectCmBrandBannerList(cmBrandBanner);
|
|
List<CmBrandBanner> cmBrandBanners = cmBrandBannerService.selectCmBrandBannerList(cmBrandBanner);
|
|
List<CmBrandLanding> cmBrandLandings = cmBrandLandingService.selectCmBrandLandingList(landing);
|
|
List<CmBrandLanding> cmBrandLandings = cmBrandLandingService.selectCmBrandLandingList(landing);
|
|
- cmBrandLandings.forEach(cmBrandLanding -> {
|
|
|
|
- CmBrandFiles cmBrandFiles = new CmBrandFiles();
|
|
|
|
- cmBrandFiles.setId(cmBrandLanding.getVideo());
|
|
|
|
- cmBrandFiles.setType("1");
|
|
|
|
- cmBrandLanding.setCmBrandFiles(cmBrandLanding.getVideo() == null ? null :
|
|
|
|
- cmBrandFilesService.selectCmBrandFilesList(cmBrandFiles));
|
|
|
|
- });
|
|
|
|
|
|
+ landing.type("2");
|
|
|
|
+ cmBrandLandings.addAll(cmBrandLandingService.selectCmBrandLandingList(landing));
|
|
|
|
+ landing.type("3");
|
|
|
|
+ cmBrandLandings.addAll(cmBrandLandingService.selectCmBrandLandingList(landing));
|
|
|
|
+ if (CollectionUtils.isNotEmpty(cmBrandLandings)) {
|
|
|
|
+ cmBrandLandings.forEach(cmBrandLanding -> {
|
|
|
|
+ CmBrandFiles cmBrandFiles = new CmBrandFiles();
|
|
|
|
+ cmBrandFiles.setId(cmBrandLanding.getVideo());
|
|
|
|
+ cmBrandFiles.setType("1");
|
|
|
|
+ cmBrandLanding.setCmBrandFiles(cmBrandLanding.getVideo() == null ? null :
|
|
|
|
+ cmBrandFilesService.selectCmBrandFilesList(cmBrandFiles));
|
|
|
|
+ });
|
|
|
|
+ }
|
|
map.put("banner", cmBrandBanners);
|
|
map.put("banner", cmBrandBanners);
|
|
map.put("landing", cmBrandLandings);
|
|
map.put("landing", cmBrandLandings);
|
|
return ResponseJson.success(map);
|
|
return ResponseJson.success(map);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 查询供应商落地页资料
|
|
|
|
+ *
|
|
|
|
+ * @return source 1PC端,2小程序
|
|
|
|
+ * @return Map(userPo, clubPo)
|
|
|
|
+ * @return banner > banner管理
|
|
|
|
+ * @return landing.type 1成功案例,2视频列表,3文章列表
|
|
|
|
+ */
|
|
|
|
+ @ApiOperation("查询供应商落地页资料")
|
|
|
|
+ @GetMapping("/shopTypeInfo")
|
|
|
|
+ public ResponseJson shopTypeInfo(Integer source, CmBrandLanding landing,
|
|
|
|
+ @RequestParam(value = "pageNum", defaultValue = "1") int pageNum,
|
|
|
|
+ @RequestParam(value = "pageSize", defaultValue = "20") int pageSize) {
|
|
|
|
+ if (source == null) {
|
|
|
|
+ return ResponseJson.error("source异常!", null);
|
|
|
|
+ }
|
|
|
|
+ if (landing.type() == null || (!landing.type().equals("2") && !landing.type().equals("3"))) {
|
|
|
|
+ return ResponseJson.error("type异常!", null);
|
|
|
|
+ }
|
|
|
|
+ if (source == 1) {
|
|
|
|
+ landing.setPcStatus("1");
|
|
|
|
+ } else {
|
|
|
|
+ landing.setAppStatus("1");
|
|
|
|
+ }
|
|
|
|
+ List<CmBrandLanding> cmBrandLandings = cmBrandLandingService.selectCmBrandLandingList(landing);
|
|
|
|
+ if (landing.type().equals("2") && CollectionUtils.isNotEmpty(cmBrandLandings)) {
|
|
|
|
+ cmBrandLandings.forEach(s -> {
|
|
|
|
+ CmBrandFiles cmBrandFiles = new CmBrandFiles();
|
|
|
|
+ cmBrandFiles.setId(s.getVideo());
|
|
|
|
+ cmBrandFiles.setType("1");
|
|
|
|
+ s.setCmBrandFiles(s.getVideo() == null ? null :
|
|
|
|
+ cmBrandFilesService.selectCmBrandFilesList(cmBrandFiles));
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ PageHelper.startPage(pageNum, pageSize);
|
|
|
|
+ List<CmBrandLandingVO> cmBrandLandingVOS = BeanUtil.setValues(cmBrandLandings, CmBrandLandingVO.class);
|
|
|
|
+ PageInfo<CmBrandLandingVO> pageInfo = new PageInfo<>(cmBrandLandingVOS);
|
|
|
|
+ return ResponseJson.success(pageInfo);
|
|
|
|
+ }
|
|
|
|
+
|
|
@ApiOperation("供应商落地页解决方案用户需求")
|
|
@ApiOperation("供应商落地页解决方案用户需求")
|
|
@ApiImplicitParams({
|
|
@ApiImplicitParams({
|
|
@ApiImplicitParam(name = "userId", required = true, value = "userId"),
|
|
@ApiImplicitParam(name = "userId", required = true, value = "userId"),
|
|
@@ -97,18 +145,23 @@ public class CmBrandLandingApi {
|
|
public ResponseJson cmQuestionnaireSave(CmQuestionnaire cmQuestionnaire) {
|
|
public ResponseJson cmQuestionnaireSave(CmQuestionnaire cmQuestionnaire) {
|
|
cmQuestionnaire.setType("1");
|
|
cmQuestionnaire.setType("1");
|
|
if (StringUtils.isBlank(cmQuestionnaire.getId())) {
|
|
if (StringUtils.isBlank(cmQuestionnaire.getId())) {
|
|
- if (cmQuestionnaire.getType().equals("1")) {
|
|
|
|
- //发短信
|
|
|
|
- String message = "【采美365】尊敬的客户,已收到您的方案咨询信息,1-3个工作日内采美工作人员将通过此手机号15338851365联系您,期间请留意来电。";
|
|
|
|
- if (StringUtils.isNotBlank(cmQuestionnaire.getMobile())) {
|
|
|
|
- CmQuestionnaire byCmQuestionnaire = cmQuestionnaireService.getByCmQuestionnaire(new CmQuestionnaire()
|
|
|
|
- .setLevel(cmQuestionnaire.getLevel())
|
|
|
|
- .setMobile(cmQuestionnaire.getMobile()));
|
|
|
|
- if (byCmQuestionnaire==null||byCmQuestionnaire.getCreateTime().getTime() < (new Date().getTime()-3600000)) {
|
|
|
|
- remoteCallService.remoteSendSms(24, 1, cmQuestionnaire.getMobile(), message);
|
|
|
|
- }
|
|
|
|
- cmQuestionnaireService.addCmQuestionnaire(cmQuestionnaire);
|
|
|
|
|
|
+ //发短信
|
|
|
|
+ String message = "【采美365】尊敬的客户,已收到您的方案咨询信息,1-3个工作日内采美工作人员将通过此手机号15338851365联系您,期间请留意来电。";
|
|
|
|
+ if (StringUtils.isNotBlank(cmQuestionnaire.getMobile())) {
|
|
|
|
+ CmQuestionnaire byCmQuestionnaire = cmQuestionnaireService.getByCmQuestionnaire(new CmQuestionnaire()
|
|
|
|
+ .setLevel(cmQuestionnaire.getLevel())
|
|
|
|
+ .setMobile(cmQuestionnaire.getMobile()));
|
|
|
|
+ //管理员手机号短信通知
|
|
|
|
+ List<String> adminMobileList = baseMapper.findAdminMobileList(1);
|
|
|
|
+ if (CollectionUtils.isNotEmpty(adminMobileList)) {
|
|
|
|
+ adminMobileList.forEach(s -> {
|
|
|
|
+ remoteCallService.remoteSendSms(0, 1, s, "【采美365】采美后台-供应商落地页-用户需求:" + DateUtil.formatDateTime(new Date(), "yyyy-MM-dd HH:mm") + "新增一条供应商需求,请及时查看。");
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ if (byCmQuestionnaire == null || byCmQuestionnaire.getCreateTime().getTime() < (new Date().getTime() - 3600000)) {
|
|
|
|
+ remoteCallService.remoteSendSms(24, 1, cmQuestionnaire.getMobile(), message);
|
|
}
|
|
}
|
|
|
|
+ cmQuestionnaireService.addCmQuestionnaire(cmQuestionnaire);
|
|
return ResponseJson.success("提交成功");
|
|
return ResponseJson.success("提交成功");
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|