|
|
@@ -5,23 +5,21 @@ import com.fdkankan.common.constant.ConstantUrl;
|
|
|
import com.fdkankan.common.util.SecurityUtil;
|
|
|
import com.fdkankan.redis.util.RedisUtil;
|
|
|
import com.fdkankan.ucenter.common.RedisKeyUtil;
|
|
|
+import com.fdkankan.ucenter.common.SceneSourceUtil;
|
|
|
import com.fdkankan.ucenter.common.constants.ResultCode;
|
|
|
import com.fdkankan.ucenter.config.UcenterConfig;
|
|
|
-import com.fdkankan.ucenter.entity.ContactUs;
|
|
|
-import com.fdkankan.ucenter.entity.ContactUsPoint;
|
|
|
-import com.fdkankan.ucenter.entity.MailTemplate;
|
|
|
-import com.fdkankan.ucenter.entity.User;
|
|
|
+import com.fdkankan.ucenter.entity.*;
|
|
|
import com.fdkankan.ucenter.exception.BusinessException;
|
|
|
import com.fdkankan.ucenter.geo.IPUtils;
|
|
|
import com.fdkankan.ucenter.mapper.IContactUsMapper;
|
|
|
-import com.fdkankan.ucenter.service.IContactUsPointService;
|
|
|
-import com.fdkankan.ucenter.service.IContactUsService;
|
|
|
+import com.fdkankan.ucenter.service.*;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
-import com.fdkankan.ucenter.service.IMailTemplateService;
|
|
|
-import com.fdkankan.ucenter.service.IUserService;
|
|
|
import com.fdkankan.ucenter.util.DateUserUtil;
|
|
|
import com.fdkankan.ucenter.vo.request.RegisterParam;
|
|
|
import com.fdkankan.ucenter.vo.response.LoginVo;
|
|
|
+import com.fdkankan.ucenter.vo.response.SceneInfoVo;
|
|
|
+import com.fdkankan.ucenter.vo.response.ScenePlusVo;
|
|
|
+import com.fdkankan.ucenter.vo.response.SceneVo;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
@@ -30,10 +28,8 @@ import org.springframework.stereotype.Service;
|
|
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
import java.io.IOException;
|
|
|
-import java.util.Date;
|
|
|
-import java.util.HashMap;
|
|
|
-import java.util.Map;
|
|
|
-import java.util.UUID;
|
|
|
+import java.util.*;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
|
* <p>
|
|
|
@@ -83,7 +79,8 @@ public class ContactUsServiceImpl extends ServiceImpl<IContactUsMapper, ContactU
|
|
|
if(!b){
|
|
|
throw new BusinessException(ResultCode.email_submit_error);
|
|
|
}
|
|
|
-
|
|
|
+ contactUs.setCountry(IPUtils.getCountry(contactUs.getIpAddress()));
|
|
|
+ this.save(contactUs);
|
|
|
redisUtil.set(redisKey, uuid,15 * 60);
|
|
|
redisUtil.set(redisKey2, JSONObject.toJSONString(contactUs),15 * 60);
|
|
|
}
|
|
|
@@ -99,8 +96,6 @@ public class ContactUsServiceImpl extends ServiceImpl<IContactUsMapper, ContactU
|
|
|
try {
|
|
|
if(redisUtil.hasKey(rediskey) ){
|
|
|
ContactUs contactUs = JSONObject.parseObject( redisUtil.get(rediskey),ContactUs.class);
|
|
|
- contactUs.setCountry(IPUtils.getCountry(contactUs.getIpAddress()));
|
|
|
- this.save(contactUs);
|
|
|
rediskey2 = String.format(RedisKeyUtil.CONTACT_US_KEY,contactUs.getEmail());
|
|
|
User userEntity = userService.getByUserName(contactUs.getEmail());
|
|
|
if(userEntity == null){
|
|
|
@@ -146,4 +141,29 @@ public class ContactUsServiceImpl extends ServiceImpl<IContactUsMapper, ContactU
|
|
|
}
|
|
|
contactUsPointService.saveOrUpdate(contactUsPoint);
|
|
|
}
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ IContactUsSceneService contactUsSceneService;
|
|
|
+ @Autowired
|
|
|
+ IScenePlusService scenePlusService;
|
|
|
+ @Override
|
|
|
+ public List<SceneVo> sceneList() {
|
|
|
+ List<ContactUsScene> list = contactUsSceneService.list();
|
|
|
+ List<String> numList = list.stream().map(ContactUsScene::getNum).collect(Collectors.toList());
|
|
|
+ if(numList.isEmpty()){
|
|
|
+ return new ArrayList<>();
|
|
|
+ }
|
|
|
+ List<SceneVo> sceneVos = scenePlusService.getVoByNumList(numList);
|
|
|
+ for (SceneVo sceneVo : sceneVos) {
|
|
|
+ if(SceneSourceUtil.isLaser(sceneVo.getSceneSource())){
|
|
|
+ if(ucenterConfig.getActive().contains("prod")){
|
|
|
+ sceneVo.setWebSite(ucenterConfig.getBasePath() +"/index.html?m="+sceneVo.getNum());
|
|
|
+ }else {
|
|
|
+ sceneVo.setWebSite(ucenterConfig.getBasePath() +"/uat/index.html?m="+sceneVo.getNum());
|
|
|
+ }
|
|
|
+ sceneVo.setSceneName(sceneVo.getLaserTitle());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return sceneVos;
|
|
|
+ }
|
|
|
}
|