|
@@ -7,6 +7,7 @@ import com.fdkankan.manage.common.CacheUtil;
|
|
|
import com.fdkankan.manage.common.PageInfo;
|
|
|
import com.fdkankan.manage.common.Result;
|
|
|
import com.fdkankan.manage.common.ResultCode;
|
|
|
+import com.fdkankan.manage.config.LaserConfig;
|
|
|
import com.fdkankan.manage.entity.Camera;
|
|
|
import com.fdkankan.manage.entity.CameraDetail;
|
|
|
import com.fdkankan.manage.entity.User;
|
|
@@ -17,6 +18,7 @@ import com.fdkankan.manage.httpClient.param.LaserSceneParam;
|
|
|
import com.fdkankan.manage.httpClient.param.SSDownSceneParam;
|
|
|
import com.fdkankan.manage.httpClient.vo.FdkkResponse;
|
|
|
import com.fdkankan.manage.httpClient.vo.LaserUpdateUserVo;
|
|
|
+import com.fdkankan.manage.mapper.ILaserMapper;
|
|
|
import com.fdkankan.manage.service.ICameraDetailService;
|
|
|
import com.fdkankan.manage.service.ICameraService;
|
|
|
import com.fdkankan.manage.service.IUserService;
|
|
@@ -42,8 +44,6 @@ public class LaserService {
|
|
|
|
|
|
@Autowired
|
|
|
LaserClient laserClient;
|
|
|
- @Value("${4dkk.laserService.basePath}")
|
|
|
- private String basePath;
|
|
|
@Autowired
|
|
|
IUserService userService;
|
|
|
@Autowired
|
|
@@ -52,79 +52,6 @@ public class LaserService {
|
|
|
ICameraService cameraService;
|
|
|
|
|
|
|
|
|
- public Page<SceneVo> pageList(SceneParam param) {
|
|
|
- LaserSceneParam laserSceneParam = new LaserSceneParam();
|
|
|
- laserSceneParam.setSceneCode(param.getNum());
|
|
|
- laserSceneParam.setTitle(param.getSceneName());
|
|
|
- laserSceneParam.setPageNum(param.getPageNum());
|
|
|
- laserSceneParam.setPageSize(param.getPageSize());
|
|
|
- laserSceneParam.setSnCode(param.getSnCode());
|
|
|
- if(param.getUserId() != null){
|
|
|
- laserSceneParam.setUserId(param.getUserId());
|
|
|
- }
|
|
|
- if(param.getUserIds() != null && param.getUserIds().size()>0){
|
|
|
- laserSceneParam.setOtherUserIds(param.getUserIds());
|
|
|
- }
|
|
|
- if(StringUtils.isNotBlank(param.getUserName())){
|
|
|
- List<User> likeUserName = userService.getLikeUserName(param.getUserName());
|
|
|
- List<Long> userIds = likeUserName.stream().map(User::getId).collect(Collectors.toList());
|
|
|
- if(!param.getUserIds().isEmpty() && !userIds.isEmpty()){
|
|
|
- List<Long> list= param.getUserIds().stream().filter(userIds::contains).collect(Collectors.toList());
|
|
|
- laserSceneParam.setOtherUserIds(list);
|
|
|
- }
|
|
|
- if(userIds.isEmpty()){
|
|
|
- return getResultPage(0L,new ArrayList<>());
|
|
|
-
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- if(param.getType() == 2){
|
|
|
- laserSceneParam.setSceneSource(4);
|
|
|
- List<String> collect = param.getAuthNumList().stream().filter(entity -> entity.contains("SS-") ).collect(Collectors.toList());
|
|
|
- laserSceneParam.setSceneCodes(collect);
|
|
|
- }
|
|
|
- if(param.getType() == 6){
|
|
|
- laserSceneParam.setSceneSource(5);
|
|
|
- List<String> collect = param.getAuthNumList().stream().filter(entity -> entity.contains("SG-") ).collect(Collectors.toList());
|
|
|
- laserSceneParam.setSceneCodes(collect);
|
|
|
- }
|
|
|
- FdkkResponse response = laserClient.sceneList(laserSceneParam);
|
|
|
- JSONObject jsonObject =response.getData();
|
|
|
- if(jsonObject == null){
|
|
|
- return getResultPage(0L,new ArrayList<>());
|
|
|
- }
|
|
|
- JSONArray list = jsonObject.getJSONArray("list");
|
|
|
- long total =jsonObject.getLong("total");
|
|
|
-
|
|
|
- List<SceneVo> sceneVoList = new ArrayList<>();
|
|
|
- for (Object o : list) {
|
|
|
- String res = JSONObject.toJSONString(o);
|
|
|
- SceneVo vo = JSONObject.parseObject(res,SceneVo.class);
|
|
|
- //深时状态,-1:场景被删 0:计算中 1计算失败 2计算成功 3封存 4生成OBJ中
|
|
|
- JSONObject obj = (JSONObject) o;
|
|
|
- vo.setStatusString(getLaserStatus(vo.getStatus()));
|
|
|
- vo.setStatus(toFdStatus(vo.getStatus()));
|
|
|
- if(vo.getStatus() == -3){
|
|
|
- vo.setPayStatus(-1);
|
|
|
- }else {
|
|
|
- vo.setPayStatus(1);
|
|
|
- }
|
|
|
- vo.setSceneName(obj.getString("title"));
|
|
|
- vo.setUserName(obj.getString("phone"));
|
|
|
- vo.setPayStatus(1);
|
|
|
- sceneVoList.add(vo);
|
|
|
- }
|
|
|
- return getResultPage(total,sceneVoList);
|
|
|
- }
|
|
|
-
|
|
|
- private Page<SceneVo> getResultPage(Long total,List<SceneVo> list){
|
|
|
- Page<SceneVo> page = new Page<>();
|
|
|
- page.setTotal(total);
|
|
|
- page.setRecords(list);
|
|
|
- return page;
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
|
|
|
public Integer toFdStatus(Integer status) {
|
|
|
//深时状态,-1:场景被删 0:计算中 1计算失败 2计算成功 3封存 4生成OBJ中
|
|
@@ -263,24 +190,6 @@ public class LaserService {
|
|
|
}
|
|
|
|
|
|
|
|
|
- public HashMap<String, JSONObject> list(List<String> sceneNumList,Integer sceneSource) {
|
|
|
- LaserSceneParam newParam = new LaserSceneParam();
|
|
|
- newParam.setPageNum(1);
|
|
|
- newParam.setPageSize(sceneNumList.size());
|
|
|
- newParam.setSceneCodes(sceneNumList);
|
|
|
- newParam.setSceneSource(sceneSource);
|
|
|
- return this.list(newParam);
|
|
|
- }
|
|
|
-
|
|
|
- public HashMap<String, JSONObject> list(String sceneName,Integer sceneSource) {
|
|
|
- LaserSceneParam newParam = new LaserSceneParam();
|
|
|
- newParam.setPageNum(1);
|
|
|
- newParam.setPageSize(9999);
|
|
|
- newParam.setTitle(sceneName);
|
|
|
- newParam.setSceneSource(sceneSource);
|
|
|
- return this.list(newParam);
|
|
|
- }
|
|
|
-
|
|
|
public HashMap<String, JSONObject> list(LaserSceneParam newParam) {
|
|
|
HashMap<String, JSONObject> map = new HashMap<>();
|
|
|
try {
|
|
@@ -302,4 +211,27 @@ public class LaserService {
|
|
|
|
|
|
return map;
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ ILaserMapper laserMapper;
|
|
|
+ @Autowired
|
|
|
+ LaserConfig laserConfig;
|
|
|
+
|
|
|
+ public List<JSONObject> getLaserSceneByDb(LaserSceneParam param){
|
|
|
+ List<JSONObject> list = laserMapper.getSceneByDb(param);
|
|
|
+ for (JSONObject jsonObject : list) {
|
|
|
+ jsonObject.put("webSite",laserConfig.getLaserWebSite()+jsonObject.getString("scene_code"));
|
|
|
+ }
|
|
|
+ return list;
|
|
|
+ }
|
|
|
+
|
|
|
+ public HashMap<String, JSONObject> getMapLaserSceneByDb(LaserSceneParam newParam) {
|
|
|
+ HashMap<String, JSONObject> map = new HashMap<>();
|
|
|
+ List<JSONObject> laserSceneByDb = this.getLaserSceneByDb(newParam);
|
|
|
+ for (JSONObject obj : laserSceneByDb) {
|
|
|
+ map.put(obj.getString("num"),obj);
|
|
|
+ }
|
|
|
+ return map;
|
|
|
+ }
|
|
|
}
|