| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507 |
- package cn.com.goldenwater.dcproj.controller.general;
- import cn.com.goldenwater.core.web.BaseController;
- import cn.com.goldenwater.core.web.BaseResponse;
- import cn.com.goldenwater.dcproj.model.*;
- import cn.com.goldenwater.dcproj.param.GwComFileParam;
- import cn.com.goldenwater.dcproj.service.*;
- import cn.com.goldenwater.dcproj.utils.AdLevelUtil;
- import cn.com.goldenwater.id.util.UuidUtil;
- import com.github.pagehelper.PageInfo;
- import io.swagger.annotations.Api;
- import io.swagger.annotations.ApiOperation;
- import io.swagger.annotations.ApiParam;
- import org.apache.commons.lang3.StringUtils;
- import org.slf4j.Logger;
- import org.slf4j.LoggerFactory;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.beans.factory.annotation.Value;
- import org.springframework.util.Assert;
- import org.springframework.web.bind.annotation.*;
- import org.springframework.web.multipart.MultipartFile;
- import javax.servlet.http.HttpServletRequest;
- import javax.servlet.http.HttpServletResponse;
- import java.io.File;
- import java.io.IOException;
- import java.util.*;
- import java.util.regex.Pattern;
- /**
- * @author zhaohg
- * @date 2019-2-18
- */
- @Api(value = "文件管理", tags = "01文件管理")
- @RestController
- @RequestMapping("/file")
- public class GwComFileController extends BaseController {
- private Logger logger = LoggerFactory.getLogger(getClass());
- private Pattern pattern = Pattern.compile("\\d{12}$");
- @Autowired
- private GwComFileService gwComFileService;
- @Autowired
- private AttAdBaseService attAdBaseService;
- @Autowired
- private NewsService newsService;
- @Autowired
- private BisInspOprdCstrProjRgstrService bisInspOprdCstrProjRgstrService;
- @Value("${getFile.prefix}")
- public String prefix;
- @Autowired
- private OlBisInspOrgService olBisInspOrgService;
- @ApiOperation(value = "添加文件", notes = "参数字段说明:{\n\r" +
- " \"file\":\"上传文件\",\n\r" +
- " \"fileTitle\":\"标题\",\n\r" +
- " \"keyWord\":\"版号\",\n\r" +
- " };\n\r" +
- "返回结构说明:{\n\r" +
- " \"success\":\"是否成功(true为成功,false为失败)\",\n\r" +
- " \"code\":\"错误代码\",\n\r" +
- " \"data(数据信息)\":\n\r" +
- " {\n\r" +
- " \"guid \":\"主键id\",\n\r" +
- " \"filePath \":\"文件路径\",\n\r" +
- " \"fileType \":\"文件类型\",\n\r" +
- " \"fileTitle\":\"标题\",\n\r" +
- " \"createDate\":\"时间\",\n\r" +
- " \"keyWord\":\"版号\",\n\r" +
- " \"fileName\":\"文件名称\",\n\r" +
- " \"fileExt\":\"文件扩展名\",\n\r" +
- " }\n\r" +
- " }")
- @RequestMapping(value = "/insert", method = RequestMethod.POST)
- public BaseResponse<GwComFile> insert(@RequestParam("file") MultipartFile file, GwComFile gwComFile, HttpServletRequest request) {
- String uuid = UuidUtil.uuid(); // 生成uuid
- gwComFile.setId(uuid);
- //按时间日期存文件
- System.out.println("submit file in");
- Calendar dat = Calendar.getInstance();
- if (null == gwComFile.getCreateDate()) {
- gwComFile.setCreateDate(Calendar.getInstance().getTime());
- }
- if (file != null) {
- String originalFilename = file.getOriginalFilename();
- gwComFile.setFileName(originalFilename);
- gwComFile.setFileTitle(StringUtils.isNotBlank(gwComFile.getFileTitle()) ? gwComFile.getFileTitle() : gwComFile.getFileName());
- gwComFile.setFileSize((double) file.getSize());
- gwComFile.setFileExt(originalFilename.substring(1 + originalFilename.lastIndexOf(".")));
- String filePath = prefix + dat.get(Calendar.YEAR) + File.separator + (dat.get(Calendar.MONTH) + 1) + File.separator + dat.get(Calendar.DAY_OF_MONTH) + File.separator + uuid + "." + gwComFile.getFileExt();
- gwComFile.setFilePath(filePath);
- if (gwComFile.getFileExt().toLowerCase().equals("html") ||
- gwComFile.getFileExt().toLowerCase().equals("htm") ||
- gwComFile.getFileExt().toLowerCase().equals("js") ||
- gwComFile.getFileExt().toLowerCase().equals("jsp") ||
- gwComFile.getFileExt().toLowerCase().equals("aspx") ||
- gwComFile.getFileExt().toLowerCase().equals("php") ||
- gwComFile.getFileExt().toLowerCase().equals("python") ||
- gwComFile.getFileExt().toLowerCase().equals("exe")) {
- return buildFailResponse(1001, "文件上传失败");
- }
- }
- //写入文件
- String filePath = dat.get(Calendar.YEAR) + File.separator + (dat.get(Calendar.MONTH) + 1) + File.separator + dat.get(Calendar.DAY_OF_MONTH);
- boolean success = gwComFileService.writeFile(gwComFile, file, filePath);
- System.out.println("submit file " + success);
- if (success) {
- System.out.println("submit file success");
- gwComFileService.insert(gwComFile);
- if ("1".equals(gwComFile.getIsNotice())) {
- // String currentAdcode = AdLevelUtil.getAddvcd(olBisInspOrgService.getProvince(getCurrentOrgId()));
- BisInspOrg bisInspOrg = olBisInspOrgService.getDefaultOrg(getCurrentOrgId());
- AttAdBase attAdBase = attAdBaseService.get(bisInspOrg.getAdCode());
- News news = new News();
- news.setOrgId(bisInspOrg.getOrgId());
- news.setAdCode(bisInspOrg.getAdCode());
- news.setAdName(attAdBase.getAdName());
- news.setAdFullName(attAdBase.getAdFullName());
- news.setAdGrad(attAdBase.getAdGrad());
- news.setTitle(file.getOriginalFilename().substring(0, file.getOriginalFilename().lastIndexOf(".")));
- news.setDes(file.getOriginalFilename().substring(0, file.getOriginalFilename().lastIndexOf(".")));
- news.setClcUrl(gwComFile.getFilePath());
- news.setIntm(new Date());
- news.setDataStat("0");
- newsService.insert(news);
- }
- if (StringUtils.isNotBlank(gwComFile.getBizType()) && gwComFile.getBizType().contains("signature")) {
- String orgId = request.getHeader("orgId");
- if (gwComFile.getBizId().endsWith(orgId)) {
- String registrId = gwComFile.getBizId().replace(orgId, "");
- BisInspOprdCstrProjRgstr oprdCstrProjRgstr = bisInspOprdCstrProjRgstrService.get(registrId);
- if (oprdCstrProjRgstr != null) {
- oprdCstrProjRgstr.setState("1");
- bisInspOprdCstrProjRgstrService.update(oprdCstrProjRgstr);
- }
- }
- }
- } else {
- return buildFailResponse(1001, "文件上传失败");
- }
- return buildSuccessResponse(gwComFile);
- }
- @ApiOperation(value = "添加文件", notes = "参数字段说明:{\n\r" +
- " \"file\":\"上传文件\",\n\r" +
- " \"fileTitle\":\"标题\",\n\r" +
- " \"keyWord\":\"版号\",\n\r" +
- " };\n\r" +
- "返回结构说明:{\n\r" +
- " \"success\":\"是否成功(true为成功,false为失败)\",\n\r" +
- " \"code\":\"错误代码\",\n\r" +
- " \"data(数据信息)\":\n\r" +
- " {\n\r" +
- " \"guid \":\"主键id\",\n\r" +
- " \"filePath \":\"文件路径\",\n\r" +
- " \"fileType \":\"文件类型\",\n\r" +
- " \"fileTitle\":\"标题\",\n\r" +
- " \"createDate\":\"时间\",\n\r" +
- " \"keyWord\":\"版号\",\n\r" +
- " \"fileName\":\"文件名称\",\n\r" +
- " \"fileExt\":\"文件扩展名\",\n\r" +
- " }\n\r" +
- " }")
- @RequestMapping(value = "/insertMulId", method = RequestMethod.POST)
- public BaseResponse<GwComFile> insertMulId(@RequestParam("file") MultipartFile file, GwComFile gwComFile, HttpServletRequest request) {
- try {
- if (gwComFile != null) {
- if (StringUtils.isNotBlank(gwComFile.getBizId())) {
- String[] arr = gwComFile.getBizId().split(",");
- for (String id : arr) {
- GwComFile gwComFile1 = new GwComFile();
- gwComFile1.setBizId(id);
- gwComFile1.setBizType(gwComFile.getBizType());
- this.insert(file, gwComFile1, request);
- }
- }
- }
- } catch (Exception e) {
- return buildFailResponse();
- }
- return buildSuccessResponse(gwComFile);
- }
- @RequestMapping(value = "/insertList", method = RequestMethod.POST)
- public BaseResponse<List<GwComFile>> insertList(@RequestParam("file") List<MultipartFile> files, GwComFile gwComFile, HttpServletRequest request) {
- List<GwComFile> gwComFiles = new ArrayList<>();
- for (int i = 0; i < files.size(); i++) {
- String uuid = UuidUtil.uuid(); // 生成uuid
- GwComFile bizParam = new GwComFile();
- bizParam.setBizId(gwComFile.getBizId());
- bizParam.setBizType(gwComFile.getBizType());
- bizParam.setId(uuid);
- //按时间日期存文件
- System.out.println("submit file in");
- Calendar dat = Calendar.getInstance();
- if (null == bizParam.getCreateDate()) {
- bizParam.setCreateDate(Calendar.getInstance().getTime());
- }
- if (files.get(i) != null) {
- String originalFilename = files.get(i).getOriginalFilename();
- bizParam.setFileName(originalFilename);
- bizParam.setFileTitle(StringUtils.isNotBlank(bizParam.getFileTitle()) ? bizParam.getFileTitle() : bizParam.getFileName());
- bizParam.setFileSize((double) files.get(i).getSize());
- bizParam.setFileExt(originalFilename.substring(1 + originalFilename.lastIndexOf(".")));
- String filePath = prefix + dat.get(Calendar.YEAR) + File.separator + (dat.get(Calendar.MONTH) + 1) + File.separator + dat.get(Calendar.DAY_OF_MONTH) + File.separator + uuid + "." + bizParam.getFileExt();
- bizParam.setFilePath(filePath);
- }
- //写入文件
- String filePath = dat.get(Calendar.YEAR) + File.separator + (dat.get(Calendar.MONTH) + 1) + File.separator + dat.get(Calendar.DAY_OF_MONTH);
- boolean success = gwComFileService.writeFile(bizParam, files.get(i), filePath);
- System.out.println("submit file " + success);
- if (success) {
- System.out.println("submit file success");
- gwComFileService.insert(bizParam);
- if ("1".equals(bizParam.getIsNotice())) {
- // String currentAdcode = AdLevelUtil.getAddvcd(olBisInspOrgService.getProvince(getCurrentOrgId()));
- BisInspOrg bisInspOrg = olBisInspOrgService.getDefaultOrg(getCurrentOrgId());
- AttAdBase attAdBase = attAdBaseService.get(bisInspOrg.getAdCode());
- News news = new News();
- news.setOrgId(bisInspOrg.getOrgId());
- news.setAdCode(bisInspOrg.getAdCode());
- news.setAdName(attAdBase.getAdName());
- news.setAdFullName(attAdBase.getAdFullName());
- news.setAdGrad(attAdBase.getAdGrad());
- news.setTitle(files.get(i).getOriginalFilename().substring(0, files.get(i).getOriginalFilename().lastIndexOf(".")));
- news.setDes(files.get(i).getOriginalFilename().substring(0, files.get(i).getOriginalFilename().lastIndexOf(".")));
- news.setClcUrl(bizParam.getFilePath());
- news.setIntm(new Date());
- news.setDataStat("0");
- newsService.insert(news);
- }
- if (StringUtils.isNotBlank(bizParam.getBizType()) && bizParam.getBizType().contains("signature")) {
- String orgId = request.getHeader("orgId");
- if (bizParam.getBizId().endsWith(orgId)) {
- String registrId = bizParam.getBizId().replace(orgId, "");
- BisInspOprdCstrProjRgstr oprdCstrProjRgstr = bisInspOprdCstrProjRgstrService.get(registrId);
- if (oprdCstrProjRgstr != null) {
- oprdCstrProjRgstr.setState("1");
- bisInspOprdCstrProjRgstrService.update(oprdCstrProjRgstr);
- }
- }
- }
- gwComFiles.add(bizParam);
- } else {
- return buildFailResponse(1001, "文件上传失败");
- }
- }
- return buildSuccessResponse(gwComFiles);
- }
- @ApiOperation(value = "根据ID删除xxx")
- @RequestMapping(value = "/{id}", method = RequestMethod.POST)
- public BaseResponse delete(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) {
- GwComFile gwComFile = gwComFileService.get(id);
- int ret = gwComFileService.delete(id);
- gwComFileService.updatePblmVedio(gwComFile.getBizId());
- return buildSuccessResponse();
- }
- @ApiOperation(value = "文件列表")
- @RequestMapping(value = "/findImgPage", method = RequestMethod.POST)
- public BaseResponse findPage(@ApiParam(name = "gwComFileParam", value = "GwComFileParam", required = true)
- @RequestBody GwComFileParam gwComFileParam) {
- return buildSuccessResponse(gwComFileService.findImgPage(gwComFileParam));
- }
- @ApiOperation(value = "更新xxx信息")
- @RequestMapping(value = "/update", method = RequestMethod.POST)
- public BaseResponse update(@ApiParam(name = "gwComFile", value = "GwComFile", required = true) @RequestBody GwComFile gwComFile) {
- Assert.notNull(gwComFile.getId(), "主键id为必填参数");
- int ret = gwComFileService.update(gwComFile);
- return buildSuccessResponse();
- }
- @ApiOperation(value = "更新文件信息")
- @RequestMapping(value = "/updateFile", method = RequestMethod.POST)
- public BaseResponse updateFile(@RequestParam("file") MultipartFile file, GwComFile newGwComFile) {
- Assert.notNull(newGwComFile.getId(), "主键id为必填参数");
- GwComFile gwComFile = gwComFileService.get(newGwComFile.getId());
- File gwFile = new File(gwComFile.getFilePath());
- if (gwFile.exists()) {
- gwFile.delete();
- }
- Calendar dat = Calendar.getInstance();
- if (null == gwComFile.getCreateDate()) {
- gwComFile.setCreateDate(Calendar.getInstance().getTime());
- }
- if (file != null) {
- String originalFilename = file.getOriginalFilename();
- gwComFile.setFileName(originalFilename);
- gwComFile.setFileTitle(StringUtils.isNotBlank(gwComFile.getFileTitle()) ? gwComFile.getFileTitle() : gwComFile.getFileName());
- gwComFile.setFileSize((double) file.getSize());
- gwComFile.setFileExt(originalFilename.substring(1 + originalFilename.lastIndexOf(".")));
- String filePath = prefix + dat.get(Calendar.YEAR) + File.separator + (dat.get(Calendar.MONTH) + 1) + File.separator + dat.get(Calendar.DAY_OF_MONTH) + File.separator + gwComFile.getId() + "." + gwComFile.getFileExt();
- gwComFile.setFilePath(filePath);
- }
- //写入文件
- String filePath = dat.get(Calendar.YEAR) + File.separator + (dat.get(Calendar.MONTH) + 1) + File.separator + dat.get(Calendar.DAY_OF_MONTH);
- boolean success = gwComFileService.writeFile(gwComFile, file, filePath);
- if (success) {
- int ret = gwComFileService.update(gwComFile);
- } else {
- return buildFailResponse(1001, "文件上传失败");
- }
- return buildSuccessResponse(gwComFile);
- }
- @ApiOperation(value = "根据ID获取xxx(单表)")
- @RequestMapping(value = "/{id}", method = RequestMethod.GET)
- public BaseResponse<GwComFile> get(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) {
- GwComFile gwComFile = gwComFileService.get(id);
- return buildSuccessResponse(gwComFile);
- }
- @ApiOperation(value = "根据业务ID获取文件")
- @RequestMapping(value = "/findFileByBiz", method = RequestMethod.POST)
- public BaseResponse<List<GwComFile>> findFileByBiz(@ApiParam(name = "bizId", value = "bizId", required = true) @RequestParam String bizId) {
- List<GwComFile> gwComFileList = gwComFileService.findFileByBiz(bizId);
- return buildSuccessResponse(gwComFileList);
- }
- @ApiOperation(value = "把所有图片制作一份缩略图(按月份的文件夹修改)")
- @RequestMapping(value = "/changeSmallImg", method = RequestMethod.GET)
- public BaseResponse<String> changeSmallImg(@ApiParam(name = "year", value = "year", required = true) @RequestParam String year, @ApiParam(name = "mnth", value = "mnth", required = true) @RequestParam String mnth) {
- gwComFileService.changeSmallImg(year, mnth);
- return buildSuccessResponse("执行完成");
- }
- @ApiOperation(value = "根据查询条件获取文件列表")
- @RequestMapping(value = "/findPageInfo", method = RequestMethod.POST)
- public BaseResponse<PageInfo<GwComFile>> findPageInfo(@RequestBody GwComFileParam gwComFileParam) {
- PageInfo<GwComFile> gwComFileList = gwComFileService.findFilePageByBiz(gwComFileParam);
- return buildSuccessResponse(gwComFileList);
- }
- @ApiOperation(value = "根据查询条件获取所有文件列表")
- @RequestMapping(value = "/findAllFile", method = RequestMethod.POST)
- public BaseResponse<List<GwComFile>> findAllFile(@RequestBody GwComFileParam gwComFileParam) {
- List<GwComFile> gwComFileList = gwComFileService.findAllFile(gwComFileParam);
- return buildSuccessResponse(gwComFileList);
- }
- @ApiOperation(value = "根据id下载文件")
- @RequestMapping(value = "/downFile/{id}", method = RequestMethod.GET)
- public BaseResponse downFile(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id, HttpServletResponse response) {
- GwComFile gwComFile = gwComFileService.get(id);
- if (gwComFile == null) {
- return buildFailResponse("文件不存在");
- }
- gwComFile.setFilePath(gwComFile.getFilePath().substring(gwComFile.getFilePath().indexOf(prefix) + 7));
- int result = gwComFileService.downFile(gwComFile, response);
- if (result == 0) {
- return buildFailResponse("文件不存在");
- }
- return buildSuccessResponse();
- }
- @ApiOperation(value = "根据文件ID置顶")
- @GetMapping(value = "/top/{id}")
- public BaseResponse<String> getTop(@PathVariable String id) {
- gwComFileService.updateTopById(id);
- return buildSuccessResponse(id);
- }
- @ApiOperation(value = "根据文件ID取消置顶")
- @GetMapping(value = "/cancelTop/{id}")
- @Deprecated
- public BaseResponse<String> cancelTop(@PathVariable String id) {
- gwComFileService.updateTopById(id);
- return buildSuccessResponse(id);
- }
- @ApiOperation(value = "获取前N条近期面貌督查")
- @RequestMapping(value = "/getTopNFace", method = RequestMethod.GET)
- public BaseResponse<List<GwComFile>> getTopNFace(
- @ApiParam(name = "n", value = "前n调记录", required = false) @RequestParam(defaultValue = "5", required = false) String n,
- @ApiParam(name = "adCode", value = "行政区代码", required = false) @RequestParam(required = false) String adCode,
- @ApiParam(name = "ptype", value = "督查类别", required = false) @RequestParam(required = false) String pType) {
- String currentAdcode = AdLevelUtil.getAddvcd(olBisInspOrgService.getProvince(getCurrentOrgId()));
- if (StringUtils.isNotBlank(pType)) {
- pType = String.valueOf(Integer.parseInt(pType));
- }
- if (StringUtils.isNotBlank(adCode)) {
- if (validateAdCode(adCode)) {
- adCode = AdLevelUtil.getAddvcd(adCode);
- } else {
- adCode = currentAdcode;
- }
- } else {
- adCode = currentAdcode;
- }
- List<GwComFile> gwComFiles = gwComFileService.getTopNFace(n, adCode, pType, currentAdcode);
- return buildSuccessResponse(gwComFiles);
- }
- @ApiOperation(value = "获取前N条问题")
- @RequestMapping(value = "/getTopNPblm", method = RequestMethod.GET)
- public BaseResponse<List<GwComFile>> getTopNPblm(
- @ApiParam(name = "n", value = "前n调记录", required = false) @RequestParam(defaultValue = "8", required = false) String n,
- @ApiParam(name = "adCode", value = "行政区代码", required = false) @RequestParam(required = false) String adCode,
- @ApiParam(name = "ptype", value = "督查类别", required = false) @RequestParam(required = false) String pType) {
- String currentAdcode = AdLevelUtil.getAddvcd(olBisInspOrgService.getProvince(getCurrentOrgId()));
- if (StringUtils.isNotBlank(pType)) {
- pType = String.valueOf(Integer.parseInt(pType));
- }
- if (StringUtils.isNotBlank(adCode)) {
- adCode = AdLevelUtil.getAddvcd(adCode);
- } else {
- adCode = currentAdcode;
- }
- List<GwComFile> gwComFiles = gwComFileService.getTopNPblm(n, adCode, pType, currentAdcode);
- return buildSuccessResponse(gwComFiles);
- }
- @ApiOperation(value = "获取前N条问题视频")
- @RequestMapping(value = "/getTopNPblmVido", method = RequestMethod.GET)
- public BaseResponse<List<GwComFile>> getTopNPblmVido(
- @ApiParam(name = "n", value = "前n调记录", required = false) @RequestParam(defaultValue = "5", required = false) String n,
- @ApiParam(name = "adCode", value = "行政区代码", required = false) @RequestParam(required = false) String adCode,
- @ApiParam(name = "ptype", value = "督查类别", required = false) @RequestParam(required = false) String pType) {
- String currentAdcode = AdLevelUtil.getAddvcd(olBisInspOrgService.getProvince(getCurrentOrgId()));
- if (StringUtils.isNotBlank(pType)) {
- pType = String.valueOf(Integer.parseInt(pType));
- }
- if (StringUtils.isNotBlank(adCode)) {
- if (validateAdCode(adCode)) {
- adCode = AdLevelUtil.getAddvcd(adCode);
- } else {
- adCode = currentAdcode;
- }
- } else {
- adCode = currentAdcode;
- }
- List<GwComFile> gwComFiles = gwComFileService.getTopNPblmVido(n, adCode, pType, currentAdcode);
- return buildSuccessResponse(gwComFiles);
- }
- /**
- * 正则:行政区划编码 12位数字即可
- *
- * @param in
- * @return
- */
- private boolean validateAdCode(String in) {
- return this.pattern.matcher(in).matches();
- }
- @ApiOperation(value = "获取前N条稽察问题资源")
- @RequestMapping(value = "/getTopTacPblm", method = RequestMethod.GET)
- public BaseResponse<List<GwComFile>> getTopTacPlam(
- @ApiParam(name = "n", value = "前n调记录", required = false) @RequestParam(defaultValue = "5", required = false) String n,
- @ApiParam(name = "adCode", value = "行政区代码", required = false) @RequestParam(required = false) String adCode) {
- String province = "";
- if (StringUtils.isBlank(adCode)) {
- province = olBisInspOrgService.getProvince(getCurrentOrgId());
- } else {
- province = adCode;
- }
- List<GwComFile> gwComFiles = gwComFileService.getTopTacPblm(n, province);
- return buildSuccessResponse(gwComFiles);
- }
- @ApiOperation(value = "获取前N条稽察问题视频资源")
- @RequestMapping(value = "/getTopTacPblmvideo", method = RequestMethod.GET)
- public BaseResponse<List<GwComFile>> getTopTacPblmvideo(
- @ApiParam(name = "n", value = "前n调记录", required = false) @RequestParam(defaultValue = "5", required = false) String n,
- @ApiParam(name = "adCode", value = "行政区代码", required = false) @RequestParam(required = false) String adCode) {
- String province = "";
- if (StringUtils.isBlank(adCode)) {
- province = olBisInspOrgService.getProvince(getCurrentOrgId());
- } else {
- province = adCode;
- }
- List<GwComFile> gwComFiles = gwComFileService.getTopTacPblmVideo(n, province);
- return buildSuccessResponse(gwComFiles);
- }
- //按照项目导出工地标准化的图片数据
- @ApiOperation(value = "按照项目导出工地标准化的图片数据")
- @RequestMapping(value = "/getpicInfo", method = RequestMethod.GET)
- public BaseResponse getpicInfo() throws IOException {
- gwComFileService.getpicInfo();
- return buildSuccessResponse();
- }
- @ApiOperation(value = "调用wsdl接口推送数据")
- @RequestMapping(value = "/wsdl/push/data", method = RequestMethod.POST)
- public BaseResponse sendToWsdlData(@ApiParam(name = "gwComFileParam", value = "GwComFileParam", required = true)
- @RequestBody GwComFileParam gwComFileParam) {
- BaseResponse response = buildSuccessResponse();
- String result = gwComFileService.toWsdlPushData(gwComFileParam);
- response.setData(result);
- return response;
- }
- }
|