|
@@ -1,22 +1,28 @@
|
|
package com.fdkankan.manage.controller.inner;
|
|
package com.fdkankan.manage.controller.inner;
|
|
|
|
|
|
|
|
+import cn.dev33.satoken.stp.StpUtil;
|
|
import cn.hutool.extra.servlet.ServletUtil;
|
|
import cn.hutool.extra.servlet.ServletUtil;
|
|
|
|
+import com.alibaba.fastjson.JSONArray;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.dtflys.forest.annotation.Post;
|
|
import com.dtflys.forest.annotation.Post;
|
|
-import com.fdkankan.manage.common.CameraTypeEnum;
|
|
|
|
-import com.fdkankan.manage.common.PageInfo;
|
|
|
|
-import com.fdkankan.manage.common.ResultCode;
|
|
|
|
-import com.fdkankan.manage.common.ResultData;
|
|
|
|
|
|
+import com.fdkankan.fyun.face.FYunFileServiceInterface;
|
|
|
|
+import com.fdkankan.manage.common.*;
|
|
import com.fdkankan.manage.config.ManageConfig;
|
|
import com.fdkankan.manage.config.ManageConfig;
|
|
|
|
+import com.fdkankan.manage.constant.FileTypeEnum;
|
|
import com.fdkankan.manage.controller.BaseController;
|
|
import com.fdkankan.manage.controller.BaseController;
|
|
import com.fdkankan.manage.entity.*;
|
|
import com.fdkankan.manage.entity.*;
|
|
|
|
+import com.fdkankan.manage.entity.Dict;
|
|
import com.fdkankan.manage.exception.BusinessException;
|
|
import com.fdkankan.manage.exception.BusinessException;
|
|
|
|
+import com.fdkankan.manage.httpClient.client.HaixinClient;
|
|
|
|
+import com.fdkankan.manage.httpClient.param.HaixinParam;
|
|
import com.fdkankan.manage.service.*;
|
|
import com.fdkankan.manage.service.*;
|
|
import com.fdkankan.manage.service.impl.ManageService;
|
|
import com.fdkankan.manage.service.impl.ManageService;
|
|
import com.fdkankan.manage.util.RsaUtils;
|
|
import com.fdkankan.manage.util.RsaUtils;
|
|
|
|
+import com.fdkankan.manage.util.ShellUtil;
|
|
|
|
+import com.fdkankan.manage.vo.EvidenceVo;
|
|
import com.fdkankan.manage.vo.request.*;
|
|
import com.fdkankan.manage.vo.request.*;
|
|
import com.fdkankan.manage.vo.response.ManageLoginResponse;
|
|
import com.fdkankan.manage.vo.response.ManageLoginResponse;
|
|
import com.fdkankan.manage.vo.response.UserAuthSceneVo;
|
|
import com.fdkankan.manage.vo.response.UserAuthSceneVo;
|
|
@@ -26,6 +32,7 @@ import org.apache.commons.lang3.StringUtils;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
+import java.io.File;
|
|
import java.util.*;
|
|
import java.util.*;
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
@@ -55,6 +62,10 @@ public class InnerAPIController extends BaseController {
|
|
ICaseService caseService;
|
|
ICaseService caseService;
|
|
@Autowired
|
|
@Autowired
|
|
ManageService manageService;
|
|
ManageService manageService;
|
|
|
|
+ @Autowired
|
|
|
|
+ ICaseNumService caseNumService;
|
|
|
|
+ @Autowired
|
|
|
|
+ RabbitMqProducer rabbitMqProducer;
|
|
|
|
|
|
|
|
|
|
@PostMapping("/getByRyId")
|
|
@PostMapping("/getByRyId")
|
|
@@ -489,12 +500,10 @@ public class InnerAPIController extends BaseController {
|
|
return ResultData.ok(map);
|
|
return ResultData.ok(map);
|
|
}
|
|
}
|
|
|
|
|
|
- @Autowired
|
|
|
|
- RabbitMqProducer rabbitMqProducer;
|
|
|
|
|
|
|
|
@PostMapping("/updateKno")
|
|
@PostMapping("/updateKno")
|
|
public ResultData updateKno(@RequestBody ManageLoginRequest param){
|
|
public ResultData updateKno(@RequestBody ManageLoginRequest param){
|
|
- if(StringUtils.isBlank(param.getProjectId())){
|
|
|
|
|
|
+ if(StringUtils.isBlank(param.getProjectId()) || StringUtils.isNotBlank(param.getKno())){
|
|
throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
|
|
throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
|
|
}
|
|
}
|
|
LambdaQueryWrapper<ScenePlus> sceneQw = new LambdaQueryWrapper<>();
|
|
LambdaQueryWrapper<ScenePlus> sceneQw = new LambdaQueryWrapper<>();
|
|
@@ -503,17 +512,23 @@ public class InnerAPIController extends BaseController {
|
|
if(list == null || list.isEmpty()){
|
|
if(list == null || list.isEmpty()){
|
|
throw new BusinessException(ResultCode.SCENE_NOT_EXIST);
|
|
throw new BusinessException(ResultCode.SCENE_NOT_EXIST);
|
|
}
|
|
}
|
|
- ScenePlus scenePlus = list.get(0);
|
|
|
|
-
|
|
|
|
-
|
|
|
|
LambdaUpdateWrapper<ScenePlus> wrapper = new LambdaUpdateWrapper<>();
|
|
LambdaUpdateWrapper<ScenePlus> wrapper = new LambdaUpdateWrapper<>();
|
|
wrapper.eq(ScenePlus::getTaskId,param.getProjectId());
|
|
wrapper.eq(ScenePlus::getTaskId,param.getProjectId());
|
|
wrapper.set(ScenePlus::getKNo,param.getKno());
|
|
wrapper.set(ScenePlus::getKNo,param.getKno());
|
|
scenePlusService.update(wrapper);
|
|
scenePlusService.update(wrapper);
|
|
- HashMap<String,Object> map = new HashMap<>();
|
|
|
|
- map.put("num",scenePlus.getNum());
|
|
|
|
- map.put("kNo",param.getKno());
|
|
|
|
- //rabbitMqProducer.sendByWorkQueue("queue-aj-add-scene",map);
|
|
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ for (ScenePlus scenePlus : list) {
|
|
|
|
+ List<CaseNum> caseNumList = caseNumService.getByNum(scenePlus.getNum());
|
|
|
|
+ for (CaseNum caseNum : caseNumList) {
|
|
|
|
+ caseNumService.removeById(caseNum.getId());
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ HashMap<String,Object> map = new HashMap<>();
|
|
|
|
+ map.put("num",scenePlus.getNum());
|
|
|
|
+ map.put("kNo",param.getKno());
|
|
|
|
+ rabbitMqProducer.sendByWorkQueue("queue-aj-add-scene",map);
|
|
|
|
+ }
|
|
|
|
|
|
return ResultData.ok();
|
|
return ResultData.ok();
|
|
}
|
|
}
|
|
@@ -522,10 +537,23 @@ public class InnerAPIController extends BaseController {
|
|
IDictService dictService;
|
|
IDictService dictService;
|
|
@Autowired
|
|
@Autowired
|
|
IDictFileService dictFileService;
|
|
IDictFileService dictFileService;
|
|
|
|
+ @Autowired
|
|
|
|
+ HaixinClient haixinClient;
|
|
|
|
+ @Autowired
|
|
|
|
+ private FYunFileServiceInterface fYunFileServiceInterface;
|
|
|
|
+ @Autowired
|
|
|
|
+ ICommonUploadService commonUploadService;
|
|
|
|
+ @Autowired
|
|
|
|
+ IDictIconService dictIconService;
|
|
|
|
|
|
- @GetMapping("/traceEvidenceList")
|
|
|
|
- public ResultData traceEvidenceList(){
|
|
|
|
- List<Dict> dictList = dictService.getByUseType("trace_evidence");
|
|
|
|
|
|
+ @PostMapping("/traceEvidenceList")
|
|
|
|
+ public ResultData traceEvidenceList(@RequestBody DictFileParam dictParam){
|
|
|
|
+ List<Dict> dictList = dictService.getByUseType("trace_evidence",dictParam.getName());
|
|
|
|
+ List<Integer> dictIds = dictList.stream().map(Dict::getId).collect(Collectors.toList());
|
|
|
|
+ HashMap<Integer,List<DictIcon>> map = dictIconService.getMapGroupDict(dictIds);
|
|
|
|
+ for (Dict dict : dictList) {
|
|
|
|
+ dict.setDictIconList(map.get(dict.getId()));
|
|
|
|
+ }
|
|
return ResultData.ok(dictList);
|
|
return ResultData.ok(dictList);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -535,4 +563,112 @@ public class InnerAPIController extends BaseController {
|
|
dictParam.setUseType("trace_evidence");
|
|
dictParam.setUseType("trace_evidence");
|
|
return ResultData.ok(dictFileService.pageList(dictParam));
|
|
return ResultData.ok(dictFileService.pageList(dictParam));
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ @GetMapping("/refreshTraceEvidenceInfoList/{kno}")
|
|
|
|
+ public ResultData refreshTraceEvidenceInfoList(@PathVariable String kno){
|
|
|
|
+ JSONObject jsonObject = haixinClient.queryEvidence(new HaixinParam(kno), manageConfig.getHaixinApiAppkey());
|
|
|
|
+ JSONObject data = jsonObject.getJSONObject("data");
|
|
|
|
+ JSONArray jsonArray = data.getJSONArray("sceneMaterialEvidence");
|
|
|
|
+ for (Object object : jsonArray) {
|
|
|
|
+ JSONObject obj = (JSONObject) object;
|
|
|
|
+ String evidenceNo = obj.getString("materialEvidenceNo"); //痕迹物证唯一编码
|
|
|
|
+ String category = obj.getString("category");
|
|
|
|
+ String fileServerPath = obj.getString("fileServerPath");
|
|
|
|
+ String materialEvidenceName = obj.getString("materialEvidenceName");
|
|
|
|
+ String leftPosition = obj.getString("leftPosition");
|
|
|
|
+ String feature = obj.getString("feature");
|
|
|
|
+ String collectionModeName = obj.getString("collectionModeName");
|
|
|
|
+ String collectedTime = obj.getString("collectedTime");
|
|
|
|
+ String createAccount = obj.getString("createAccount");
|
|
|
|
+ EvidenceVo vo = new EvidenceVo(materialEvidenceName,leftPosition,feature,collectionModeName,collectedTime,createAccount,0);
|
|
|
|
+
|
|
|
|
+ String localPath = OssPath.localPath + OssPath.MANAGE_MODEL_FILE_PATH;
|
|
|
|
+ String uuid = UUID.randomUUID().toString().replace("-","");
|
|
|
|
+ String extName = fileServerPath.substring(fileServerPath.lastIndexOf(".")).toLowerCase();
|
|
|
|
+ localPath = String.format(localPath,uuid) + extName;
|
|
|
|
+
|
|
|
|
+ String cmd = String.format(CommandEnum.WGET_URL,localPath,manageConfig.getHaixinApiBasePath() + "/"+ fileServerPath);
|
|
|
|
+ ShellUtil.execCmd(cmd);
|
|
|
|
+
|
|
|
|
+ String ossPath = String.format(OssPath.MANAGE_MODEL_FILE_PATH, uuid+ extName);
|
|
|
|
+ fYunFileServiceInterface.uploadFile(localPath, ossPath);
|
|
|
|
+
|
|
|
|
+ DictFile dictFile = dictFileService.getByEvidenceNo(evidenceNo);
|
|
|
|
+ if(dictFile == null){
|
|
|
|
+ dictFile = new DictFile();
|
|
|
|
+ }
|
|
|
|
+ CommonUpload commonUpload = commonUploadService.getById(dictFile.getUploadId());
|
|
|
|
+ if(commonUpload == null){
|
|
|
|
+ commonUpload = new CommonUpload();
|
|
|
|
+ }
|
|
|
|
+ commonUpload.setFileName(materialEvidenceName);
|
|
|
|
+ commonUpload.setFileUrl(manageConfig.getQueryPath() + ossPath);
|
|
|
|
+ commonUpload.setFileSize("0");
|
|
|
|
+ commonUpload.setFileType(0);
|
|
|
|
+ commonUpload.setFileTypeStr("图片");
|
|
|
|
+ commonUpload.setFileFormat(extName);
|
|
|
|
+ commonUpload.setResultFileFormat(extName);
|
|
|
|
+ commonUpload.setStatus(1);
|
|
|
|
+ commonUpload.setUseType("trace_evidence");
|
|
|
|
+ commonUploadService.saveOrUpdate(commonUpload);
|
|
|
|
+
|
|
|
|
+ Dict dict = dictService.getByResourceId(category);
|
|
|
|
+
|
|
|
|
+ dictFile.setName(materialEvidenceName);
|
|
|
|
+ dictFile.setTypeKey("media-library");
|
|
|
|
+ dictFile.setDictId(dict != null?dict.getId() : null);
|
|
|
|
+ dictFile.setSysUserId(Long.valueOf(StpUtil.getLoginId().toString()));
|
|
|
|
+ dictFile.setUseType("trace_evidence");
|
|
|
|
+ dictFile.setUploadId(commonUpload.getId());
|
|
|
|
+ dictFile.setKno(kno);
|
|
|
|
+ dictFile.setContent(JSONObject.toJSONString(vo));
|
|
|
|
+ dictFile.setEvidenceNo(evidenceNo);
|
|
|
|
+ dictFileService.saveOrUpdate(dictFile);
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return ResultData.ok();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @PostMapping("/addMediaLibrary")
|
|
|
|
+ public ResultData addMediaLibrary(@RequestBody addMediaLibraryParam param){
|
|
|
|
+ if(StringUtils.isBlank(param.getFilePath())){
|
|
|
|
+ throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ String uuid = UUID.randomUUID().toString().replace("-","");
|
|
|
|
+ String extName = param.getFilePath().substring(param.getFilePath().lastIndexOf(".")).toLowerCase();
|
|
|
|
+
|
|
|
|
+ FileTypeEnum fileTypeEnum = FileTypeEnum.getByType(extName.replace(".", ""));
|
|
|
|
+ if(fileTypeEnum == null){
|
|
|
|
+ throw new BusinessException(ResultCode.FILE_TYPE_ERROR2);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ String ossPath = String.format(OssPath.MANAGE_MODEL_FILE_PATH, uuid+ extName);
|
|
|
|
+ fYunFileServiceInterface.copyFileInBucket(param.getFilePath(),ossPath);
|
|
|
|
+
|
|
|
|
+ CommonUpload commonUpload = new CommonUpload();
|
|
|
|
+ commonUpload.setFileName(param.getFileName());
|
|
|
|
+ commonUpload.setFileUrl(manageConfig.getQueryPath() + ossPath);
|
|
|
|
+ commonUpload.setFileSize(param.getFileSize());
|
|
|
|
+ commonUpload.setFileType(fileTypeEnum.getCode());
|
|
|
|
+ commonUpload.setFileTypeStr(fileTypeEnum.getMsg());
|
|
|
|
+ commonUpload.setFileFormat(extName);
|
|
|
|
+ commonUpload.setResultFileFormat(extName);
|
|
|
|
+ commonUpload.setStatus(1);
|
|
|
|
+ commonUpload.setUseType("trace_evidence");
|
|
|
|
+ commonUploadService.saveOrUpdate(commonUpload);
|
|
|
|
+
|
|
|
|
+ DictFile dictFile = new DictFile();
|
|
|
|
+ dictFile.setName(param.getFileName());
|
|
|
|
+ dictFile.setTypeKey("media-library");
|
|
|
|
+ dictFile.setSysUserId(Long.valueOf(StpUtil.getLoginId().toString()));
|
|
|
|
+ dictFile.setUseType("trace_evidence");
|
|
|
|
+ dictFile.setUploadId(commonUpload.getId());
|
|
|
|
+ dictFile.setKno(param.getKno());
|
|
|
|
+ dictFile.setContent(param.getContent());
|
|
|
|
+ dictFileService.saveOrUpdate(dictFile);
|
|
|
|
+
|
|
|
|
+ return ResultData.ok();
|
|
|
|
+ }
|
|
}
|
|
}
|