根据文件拆分id获取拆分详情页面URL接口

This commit is contained in:
wangzhijiang
2024-03-22 15:20:26 +08:00
parent 3ed114cc4f
commit f87dc45881
@@ -11,6 +11,8 @@ import com.jero.common.constant.CommonConstant;
import com.jero.common.exception.JeroBootException; import com.jero.common.exception.JeroBootException;
import com.jero.common.util.DateUtils; import com.jero.common.util.DateUtils;
import com.jero.common.util.MessageUtils; import com.jero.common.util.MessageUtils;
import com.jero.modules.documenttool.entity.DocumentSplitInfo;
import com.jero.modules.documenttool.mapper.DocumentSplitMapper;
import com.jero.modules.documenttool.service.IDocumentSplitService; import com.jero.modules.documenttool.service.IDocumentSplitService;
import com.jero.modules.onlyoffice.entity.OnlineFileLog; import com.jero.modules.onlyoffice.entity.OnlineFileLog;
import com.jero.modules.onlyoffice.mapper.OnlineFileLogDao; import com.jero.modules.onlyoffice.mapper.OnlineFileLogDao;
@@ -21,8 +23,10 @@ import com.jero.modules.split.page.SarFileSplitMenuEOPage;
import com.jero.modules.split.service.ISarFileSplitMenuEOService; import com.jero.modules.split.service.ISarFileSplitMenuEOService;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.ss.formula.functions.T; import org.apache.poi.ss.formula.functions.T;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
@@ -43,6 +47,8 @@ public class DockingController {
private OnlineFileLogDao onlineFileLogDao; private OnlineFileLogDao onlineFileLogDao;
@Autowired @Autowired
private IBusProcessModelHisService busProcessModelHisService; private IBusProcessModelHisService busProcessModelHisService;
@Autowired
private DocumentSplitMapper documentSplitMapper;
/** /**
* 主动拆分接口 * 主动拆分接口
@@ -182,4 +188,31 @@ public class DockingController {
public Result<String> onlyOfficePreview( @RequestBody JSONObject json) { public Result<String> onlyOfficePreview( @RequestBody JSONObject json) {
return Result.OK(busProcessModelHisService.onlyOfficePreview(json)); return Result.OK(busProcessModelHisService.onlyOfficePreview(json));
} }
/**
* 3.8根据文件拆分id获取拆分详情页面URL
*
* @param json
* @return
*/
@AutoLog(value = "根据文件拆分id获取拆分详情页面URL")
@ApiOperation(value="根据文件拆分id获取拆分详情页面URL", notes="根据文件拆分id获取拆分详情页面URL")
@PostMapping(value = "/getSplitDetailUrlByDocId")
@ApiOperationSupport(order = 7)
public Result<String> getSplitDetailUrlByDocId(@RequestBody JSONObject json) {
StringBuilder resultSb = new StringBuilder();
String docId = json.getString("docId");
if (StringUtils.isEmpty(docId)) {
throw new JeroBootException("docId不能为空!");
}
DocumentSplitInfo dsInfo = documentSplitMapper.queryDocumentSplitInfoById(docId);
if (ObjectUtils.isEmpty(dsInfo)) {
throw new JeroBootException("docId参数传递有误,请检查!");
}
resultSb.append("/documentTool/DocumentSplitDetail?infoId=").append(docId);
resultSb.append("&").append("infoNumber=").append(dsInfo.getSerialNumber());
resultSb.append("&").append("standardName=").append(dsInfo.getTitle());
return Result.OK(resultSb.toString());
}
} }