From 241e351dcb4b5aa33dde2c05b711b7f2066f3be8 Mon Sep 17 00:00:00 2001
From: 许鹏程 <1821349743@qq.com>
Date: 星期三, 28 八月 2024 10:08:05 +0800
Subject: [PATCH] bug
---
src/main/java/com/product/file/controller/DocumentController.java | 1008 ++++++++++----------
src/main/java/com/product/file/service/DocumentService.java | 1175 ++++++++++++------------
src/main/java/com/product/file/controller/FileManagerController.java | 639 ++++++------
3 files changed, 1,420 insertions(+), 1,402 deletions(-)
diff --git a/src/main/java/com/product/file/controller/DocumentController.java b/src/main/java/com/product/file/controller/DocumentController.java
index 3e38041..3212674 100644
--- a/src/main/java/com/product/file/controller/DocumentController.java
+++ b/src/main/java/com/product/file/controller/DocumentController.java
@@ -39,523 +39,533 @@
@RequestMapping("/api/document")
@RestController
public class DocumentController extends AbstractBaseController {
- @Autowired
- public DocumentService documentService;
+ @Autowired
+ public DocumentService documentService;
- /**
- * 鏂板鏂囦欢鏁版嵁(涓婁紶)3
- *
- * @param request
- * @return
- */
- @RequestMapping(value = "/addDocument/{version}", method = RequestMethod.POST)
- @ApiVersion(1)
- public String addDocument(HttpServletRequest request) {
- try {
- //鑾峰彇鍙傛暟
- FieldSetEntity fse = BaseUtil.getFieldSetEntity(request);
- IDocumentService service = (IDocumentService) getProxyInstance(documentService);
- String uuids = service.addDocument(fse);
- return OK_Add(uuids);
- } catch (BaseException e) {
- SpringMVCContextHolder.getSystemLogger().error(e);
- return this.error(e);
- } catch (Exception e) {
- e.printStackTrace();
- SpringMVCContextHolder.getSystemLogger().error(e);
- return this.error(DocumentCode.DOCUMENT_SAVE_FAIL.getValue(), DocumentCode.DOCUMENT_SAVE_FAIL.getText());
- }
- }
+ /**
+ * 鏂板鏂囦欢鏁版嵁(涓婁紶)3
+ *
+ * @param request
+ * @return
+ */
+ @RequestMapping(value = "/addDocument/{version}", method = RequestMethod.POST)
+ @ApiVersion(1)
+ public String addDocument(HttpServletRequest request) {
+ try {
+ //鑾峰彇鍙傛暟
+ FieldSetEntity fse = BaseUtil.getFieldSetEntity(request);
+ IDocumentService service = (IDocumentService) getProxyInstance(documentService);
+ String uuids = service.addDocument(fse);
+ return OK_Add(uuids);
+ } catch (BaseException e) {
+ e.printStackTrace();
+ SpringMVCContextHolder.getSystemLogger().error(e);
+ return this.error(e);
+ } catch (Exception e) {
+ e.printStackTrace();
+ SpringMVCContextHolder.getSystemLogger().error(e);
+ return this.error(DocumentCode.DOCUMENT_SAVE_FAIL.getValue(), DocumentCode.DOCUMENT_SAVE_FAIL.getText());
+ }
+ }
- /**
- * 閲嶅懡鍚嶏紙缂栬緫锛�4
- *
- * @param request
- * @return
- */
- @RequestMapping(value = "/upDocumentName/{version}", method = RequestMethod.POST)
- @ApiVersion(1)
- public String upDocumentName(HttpServletRequest request) {
- try {
- //鑾峰彇鍙傛暟
- FieldSetEntity fse = null;
- Object bean = request.getAttribute(CoreConst.API_POST_REQUEST_DATA);
- if (bean != null) {
- RequestParameterEntity reqp = (RequestParameterEntity) bean;
- fse = reqp.getFormData();
- }
- //鍒ゆ柇鍙傛暟鏄惁涓虹┖
- if (fse == null) {
- SpringMVCContextHolder
- .getSystemLogger().error(DocumentCode.DOCUMENT_FORM_NODATA.getValue(), DocumentCode.DOCUMENT_FORM_NODATA.getText());
- return this.error(DocumentCode.DOCUMENT_FORM_NODATA.getValue(), DocumentCode.DOCUMENT_FORM_NODATA.getText());
- }
- IDocumentService service = (IDocumentService) getProxyInstance(documentService);
- boolean flag = service.upDocumentName(fse);
- if (flag) {
- return OK();
- }
- return this.error(DocumentCode.DOCUMENT_SAVE_FAIL.getValue(), DocumentCode.DOCUMENT_SAVE_FAIL.getText());
- } catch (BaseException e) {
- SpringMVCContextHolder.getSystemLogger().error(e);
- return this.error(e);
- } catch (Exception e) {
- e.printStackTrace();
- SpringMVCContextHolder.getSystemLogger().error(e);
- return this.error(DocumentCode.DOCUMENT_SAVE_FAIL.getValue(), DocumentCode.DOCUMENT_SAVE_FAIL.getText());
- }
- }
-
- /**
- * 鍒犻櫎鏂囦欢锛堟壒閲忓垹闄わ級5
- *
- * @param request
- * @return
- */
- @RequestMapping(value = "/delDocument/{version}", method = RequestMethod.POST)
- @ApiVersion(1)
- public String delDocument(HttpServletRequest request) {
- try {
- //鑾峰彇鍙傛暟
- FieldSetEntity fse = null;
- Object bean = request.getAttribute(CoreConst.API_POST_REQUEST_DATA);
- if (bean != null) {
- RequestParameterEntity reqp = (RequestParameterEntity) bean;
- fse = reqp.getFormData();
- }
- //鍒ゆ柇鍙傛暟鏄惁涓虹┖
- if (fse == null) {
- SpringMVCContextHolder
- .getSystemLogger().error(DocumentCode.DOCUMENT_FORM_NODATA.getValue(), DocumentCode.DOCUMENT_FORM_NODATA.getText());
- return this.error(DocumentCode.DOCUMENT_FORM_NODATA.getValue(), DocumentCode.DOCUMENT_FORM_NODATA.getText());
- }
- IDocumentService service = (IDocumentService) getProxyInstance(documentService);
- boolean flag = service.delDocument(fse);
- if (flag) {
- return OK();
- }
- return this.error(DocumentCode.DOCUMENT_DELETE_FAIL.getValue(), DocumentCode.DOCUMENT_DELETE_FAIL.getText());
- } catch (BaseException e) {
- SpringMVCContextHolder.getSystemLogger().error(e);
- return this.error(e);
- } catch (Exception e) {
- e.printStackTrace();
- SpringMVCContextHolder.getSystemLogger().error(e);
- return this.error(DocumentCode.DOCUMENT_DELETE_FAIL.getValue(), DocumentCode.DOCUMENT_DELETE_FAIL.getText());
- }
- }
-
- /**
- * 鏍规嵁鏂囦欢澶硅幏鍙栨枃浠跺垪琛紙鏌ョ湅锛�1
- *
- * @param request
- * @return
- */
- @RequestMapping(value = "/documentAll/{version}", method = RequestMethod.POST)
- @ApiVersion(1)
- public String documentAll(HttpServletRequest request) {
- try {
- //鑾峰彇鍙傛暟
- FieldSetEntity fse = null;
- Object bean = request.getAttribute(CoreConst.API_POST_REQUEST_DATA);
- if (bean != null) {
- RequestParameterEntity reqp = (RequestParameterEntity) bean;
- fse = reqp.getFormData();
- }
- //鍒ゆ柇鍙傛暟鏄惁涓虹┖
- if (fse == null) {
- SpringMVCContextHolder
- .getSystemLogger().error(DocumentCode.DOCUMENT_FORM_NODATA.getValue(), DocumentCode.DOCUMENT_FORM_NODATA.getText());
- return this.error(DocumentCode.DOCUMENT_FORM_NODATA.getValue(), DocumentCode.DOCUMENT_FORM_NODATA.getText());
- }
- DataTableEntity dataTableEntity = documentService.documentAll(fse);
- return OK_List(dataTableEntity);
- } catch (BaseException e) {
- SpringMVCContextHolder.getSystemLogger().error(e);
- return this.error(e);
- } catch (Exception e) {
- e.printStackTrace();
- SpringMVCContextHolder.getSystemLogger().error(e);
- return this.error(DocumentCode.DOCUMENT_GET_LIST_FAIL.getValue(), DocumentCode.DOCUMENT_GET_LIST_FAIL.getText());
- }
- }
-
- /**
- * 鑾峰彇鏂囦欢璇︽儏锛堟煡鐪嬶級1
- *
- * @param request
- * @return
- */
- @RequestMapping(value = "/documentInfo/{version}", method = RequestMethod.POST)
- @ApiVersion(1)
- public String documentInfo(HttpServletRequest request) {
- try {
- //鑾峰彇鍙傛暟
- FieldSetEntity fse = null;
- Object bean = request.getAttribute(CoreConst.API_POST_REQUEST_DATA);
- if (bean != null) {
- RequestParameterEntity reqp = (RequestParameterEntity) bean;
- fse = reqp.getFormData();
- }
- //鍒ゆ柇鍙傛暟鏄惁涓虹┖
- if (fse == null) {
- SpringMVCContextHolder
- .getSystemLogger().error(DocumentCode.DOCUMENT_FORM_NODATA.getValue(), DocumentCode.DOCUMENT_FORM_NODATA.getText());
- return this.error(DocumentCode.DOCUMENT_FORM_NODATA.getValue(), DocumentCode.DOCUMENT_FORM_NODATA.getText());
- }
- return OK_List(documentService.documentInfo(fse));
- } catch (BaseException e) {
- SpringMVCContextHolder.getSystemLogger().error(e);
- return this.error(e);
- } catch (Exception e) {
- e.printStackTrace();
- SpringMVCContextHolder.getSystemLogger().error(e);
- return this.error(DocumentCode.DOCUMENT_GET_FAIL.getValue(), DocumentCode.DOCUMENT_GET_FAIL.getText());
- }
- }
-
- /**
- * 鑾峰彇褰撳墠鐢ㄦ埛鏂囨。鐩綍鎸夐挳鏉冮檺鏉冮檺
- * 鍜屾枃浠跺叏璺緞
- * 鑻ユ湁鏌ョ湅鏉冮檺鏌ョ湅鎵�鏈夋枃浠�
- * 鏉冮檺1(鏌ョ湅),2(涓嬭浇),3(鏂板{鎵归噺涓婁紶}),4(淇敼),5(鎵归噺鍒犻櫎),6(鎵归噺绉诲姩)
- *
- * @param request
- * @return
- */
- @RequestMapping(value = "/getButtonPermissions/{version}", method = RequestMethod.POST)
- @ApiVersion(1)
- public String getButtonPermissions(HttpServletRequest request) {
- try {
- //鑾峰彇鍙傛暟
- FieldSetEntity fse = null;
- Object bean = request.getAttribute(CoreConst.API_POST_REQUEST_DATA);
- if (bean != null) {
- RequestParameterEntity reqp = (RequestParameterEntity) bean;
- fse = reqp.getFormData();
- }
- //鍒ゆ柇鍙傛暟鏄惁涓虹┖
- if (fse == null) {
- SpringMVCContextHolder
- .getSystemLogger().error(DocumentCode.DOCUMENT_FORM_NODATA.getValue(), DocumentCode.DOCUMENT_FORM_NODATA.getText());
- return this.error(DocumentCode.DOCUMENT_FORM_NODATA.getValue(), DocumentCode.DOCUMENT_FORM_NODATA.getText());
- }
- if (BaseUtil.strIsNull(fse.getString(CmnConst.DIRECTORY_UUID))) {
- return OK();
- }
- FieldSetEntity fieldSet = documentService.getButtonPermissions(fse);
- DataTableEntity dataTableEntity = fieldSet.getSubDataTable("dataTable");
- String str = OK_List(dataTableEntity);
- JSONObject object = JSONObject.parseObject(str);
- JSONArray systemFieldMeta = object.getJSONArray("systemFieldMeta");
- Object systemSeniorQueryString = object.get("systemSeniorQueryString");
-
- Map<String, Object> map = new HashMap<>();
- map.put("systemFieldMeta", systemFieldMeta);
- map.put("systemSeniorQueryString", systemSeniorQueryString);
- //浼犲叆fieldSet, 鍜岄澶栫殑map 瀵硅薄
- return BaseUtil.success(fieldSet, map);
- } catch (BaseException e) {
- SpringMVCContextHolder.getSystemLogger().error(e);
- return this.error(e);
- } catch (Exception e) {
- e.printStackTrace();
- SpringMVCContextHolder.getSystemLogger().error(e);
- return this.error(DocumentCode.DOCUMENT_GET_LIST_FAIL.getValue(), DocumentCode.DOCUMENT_GET_LIST_FAIL.getText());
- }
- }
-
- /**
- * 寮瑰嚭绉诲姩鐩綍妗�
- *
- * @param request
- * @return
- */
- @RequestMapping(value = "/popBoxGetFileDirectory/{version}", method = RequestMethod.POST)
- @ApiVersion(1)
- public String popBoxGetFileDirectory(HttpServletRequest request) {
- try {
- //鑾峰彇鍙傛暟
- FieldSetEntity fse = null;
- Object bean = request.getAttribute(CoreConst.API_POST_REQUEST_DATA);
- if (bean != null) {
- RequestParameterEntity reqp = (RequestParameterEntity) bean;
- fse = reqp.getFormData();
- }
- //鍒ゆ柇鍙傛暟鏄惁涓虹┖
- if (fse == null) {
- SpringMVCContextHolder
- .getSystemLogger().error(DocumentCode.DOCUMENT_FORM_NODATA.getValue(), DocumentCode.DOCUMENT_FORM_NODATA.getText());
- return this.error(DocumentCode.DOCUMENT_FORM_NODATA.getValue(), DocumentCode.DOCUMENT_FORM_NODATA.getText());
- }
- JSONObject obj = documentService.popBoxGetFileDirectory(fse);
- return ResultInfo.success(obj);
- } catch (BaseException e) {
- SpringMVCContextHolder.getSystemLogger().error(e);
- return this.error(e);
- } catch (Exception e) {
- e.printStackTrace();
- SpringMVCContextHolder.getSystemLogger().error(e);
- return this.error(DocumentCode.DOCUMENT_CATALOG_GET_FAIL.getValue(), DocumentCode.DOCUMENT_CATALOG_GET_FAIL.getText());
- }
- }
-
- /**
- * 绉诲姩锛堟枃浠舵壒閲忕Щ鍔級6
- *
- * @param request
- * @return
- */
- @RequestMapping(value = "/fileMoveTo/{version}", method = RequestMethod.POST)
- @ApiVersion(1)
- public String fileMoveTo(HttpServletRequest request) {
- try {
- //鑾峰彇鍙傛暟
- FieldSetEntity fse = null;
- Object bean = request.getAttribute(CoreConst.API_POST_REQUEST_DATA);
- if (bean != null) {
- RequestParameterEntity reqp = (RequestParameterEntity) bean;
- fse = reqp.getFormData();
- }
- //鍒ゆ柇鍙傛暟鏄惁涓虹┖
- if (fse == null) {
- SpringMVCContextHolder
- .getSystemLogger().error(DocumentCode.DOCUMENT_FORM_NODATA.getValue(), DocumentCode.DOCUMENT_FORM_NODATA.getText());
- return this.error(DocumentCode.DOCUMENT_FORM_NODATA.getValue(), DocumentCode.DOCUMENT_FORM_NODATA.getText());
- }
- if (documentService.fileMoveTo(fse)) {
- return OK();
- } else {
- return this.error(DocumentCode.DOCUMENT_USER_RIGHT_FAIL.getValue(), DocumentCode.DOCUMENT_USER_RIGHT_FAIL.getText());
- }
- } catch (BaseException e) {
- SpringMVCContextHolder.getSystemLogger().error(e);
- return this.error(e);
- } catch (Exception e) {
- e.printStackTrace();
- SpringMVCContextHolder.getSystemLogger().error(e);
- return this.error(DocumentCode.DOCUMENT_MOVE_FAIL.getValue(), DocumentCode.DOCUMENT_MOVE_FAIL.getText());
- }
- }
-
-
- /**
- * @param request
- * @return
- */
- @RequestMapping(value = "/getDocumentLog/{version}", method = RequestMethod.POST)
- @ApiVersion(1)
- public String getDocumentLog(HttpServletRequest request) {
- try {
- //鑾峰彇鍙傛暟
- FieldSetEntity fse = null;
- Object bean = request.getAttribute(CoreConst.API_POST_REQUEST_DATA);
- if (bean != null) {
- RequestParameterEntity reqp = (RequestParameterEntity) bean;
- fse = reqp.getFormData();
- }
- //鍒ゆ柇鍙傛暟鏄惁涓虹┖
- if (fse == null) {
- SpringMVCContextHolder
- .getSystemLogger().error(DocumentCode.DOCUMENT_FORM_NODATA.getValue(), DocumentCode.DOCUMENT_FORM_NODATA.getText());
- return this.error(DocumentCode.DOCUMENT_FORM_NODATA.getValue(), DocumentCode.DOCUMENT_FORM_NODATA.getText());
- }
- return OK_List(documentService.getDocumentLog(fse));
- } catch (BaseException e) {
- SpringMVCContextHolder.getSystemLogger().error(e);
- return this.error(e);
- } catch (Exception e) {
- e.printStackTrace();
- SpringMVCContextHolder.getSystemLogger().error(e);
- return this.error(DocumentCode.DOCUMENT_LOG_FAIL.getValue(), DocumentCode.DOCUMENT_LOG_FAIL.getText());
- }
- }
-
- /**
- * 鏂囨。鏀惰棌
- * @param request
- * @return
- */
- @RequestMapping(value = "/collection/{version}", method = RequestMethod.POST)
- @ApiVersion(1)
- public String documentCollection(HttpServletRequest request) {
- try {
- //鑾峰彇鍙傛暟
- FieldSetEntity fse = BaseUtil.getFieldSetEntity(request, CmnConst.PRODUCT_OA_DOCUMENT_COLLECTION);
- return OK_Add(documentService.documentCollection(fse));
- } catch (BaseException e) {
- e.printStackTrace();
- return this.error(e);
- } catch (Exception e) {
- e.printStackTrace();
- return this.error(DocumentCode.DOCUMENT_COLLECTION_FAIL.getValue(), DocumentCode.DOCUMENT_COLLECTION_FAIL.getText() + e.getMessage());
- }
- }
- /**
- * 鏂囨。鍙栨秷鏀惰棌
- * @param request
- * @return
- */
- @RequestMapping(value = "/cancel-collection/{version}", method = RequestMethod.POST)
- @ApiVersion(1)
- public String documentCancelCollection(HttpServletRequest request) {
- try {
- //鑾峰彇鍙傛暟
- FieldSetEntity fse = BaseUtil.getFieldSetEntity(request, CmnConst.PRODUCT_OA_DOCUMENT_COLLECTION);
- if (documentService.documentCancelCollection(fse.getString("document_uuid"))) {
+ /**
+ * 閲嶅懡鍚嶏紙缂栬緫锛�4
+ *
+ * @param request
+ * @return
+ */
+ @RequestMapping(value = "/upDocumentName/{version}", method = RequestMethod.POST)
+ @ApiVersion(1)
+ public String upDocumentName(HttpServletRequest request) {
+ try {
+ //鑾峰彇鍙傛暟
+ FieldSetEntity fse = null;
+ Object bean = request.getAttribute(CoreConst.API_POST_REQUEST_DATA);
+ if (bean != null) {
+ RequestParameterEntity reqp = (RequestParameterEntity) bean;
+ fse = reqp.getFormData();
+ }
+ //鍒ゆ柇鍙傛暟鏄惁涓虹┖
+ if (fse == null) {
+ SpringMVCContextHolder
+ .getSystemLogger().error(DocumentCode.DOCUMENT_FORM_NODATA.getValue(), DocumentCode.DOCUMENT_FORM_NODATA.getText());
+ return this.error(DocumentCode.DOCUMENT_FORM_NODATA.getValue(), DocumentCode.DOCUMENT_FORM_NODATA.getText());
+ }
+ IDocumentService service = (IDocumentService) getProxyInstance(documentService);
+ boolean flag = service.upDocumentName(fse);
+ if (flag) {
return OK();
}
- return error(DocumentCode.DOCUMENT_CANCEL_COLLECTION_FAIL.getValue(), DocumentCode.DOCUMENT_CANCEL_COLLECTION_FAIL.getText());
- } catch (BaseException e) {
- e.printStackTrace();
- return this.error(e);
- } catch (Exception e) {
- e.printStackTrace();
- return this.error(DocumentCode.DOCUMENT_OPERATE_FAIL.getValue(), DocumentCode.DOCUMENT_OPERATE_FAIL.getText() + e.getMessage());
- }
- }
+ return this.error(DocumentCode.DOCUMENT_SAVE_FAIL.getValue(), DocumentCode.DOCUMENT_SAVE_FAIL.getText());
+ } catch (BaseException e) {
+ SpringMVCContextHolder.getSystemLogger().error(e);
+ return this.error(e);
+ } catch (Exception e) {
+ e.printStackTrace();
+ SpringMVCContextHolder.getSystemLogger().error(e);
+ return this.error(DocumentCode.DOCUMENT_SAVE_FAIL.getValue(), DocumentCode.DOCUMENT_SAVE_FAIL.getText());
+ }
+ }
- /**
- * 鏂囨。鍘嗗彶鐗堟湰
- * @param request
- * @return
- */
- @RequestMapping(value = "/document-history/{version}", method = RequestMethod.POST)
- @ApiVersion(1)
- public String findDocumentHistory(HttpServletRequest request) {
- try {
- //鑾峰彇鍙傛暟
- FieldSetEntity fse = BaseUtil.getFieldSetEntity(request, CmnConst.PRODUCT_OA_DOCUMENT_COLLECTION);
- return OK_List(documentService.findDocumentHistory(fse.getUUID()));
- } catch (BaseException e) {
- e.printStackTrace();
- return this.error(e);
- } catch (Exception e) {
- e.printStackTrace();
- return this.error(DocumentCode.DOCUMENT_OPERATE_FAIL.getValue(), DocumentCode.DOCUMENT_OPERATE_FAIL.getText() + e.getMessage());
- }
- }
-
- /**
- * 鏂囨。鏈�鏂扮増鏈繚瀛�
- * @param request
- * @return
- */
- @RequestMapping(value = "/document-save-new-version/{version}", method = RequestMethod.POST)
- @ApiVersion(1)
- public String documentSaveNewVersion(HttpServletRequest request) {
- try {
- //鑾峰彇鍙傛暟
- FieldSetEntity fse = BaseUtil.getFieldSetEntity(request, CmnConst.PRODUCT_OA_DOCUMENT_COLLECTION);
- if (documentService.documentSaveNewVersion(fse)) {
+ /**
+ * 鍒犻櫎鏂囦欢锛堟壒閲忓垹闄わ級5
+ *
+ * @param request
+ * @return
+ */
+ @RequestMapping(value = "/delDocument/{version}", method = RequestMethod.POST)
+ @ApiVersion(1)
+ public String delDocument(HttpServletRequest request) {
+ try {
+ //鑾峰彇鍙傛暟
+ FieldSetEntity fse = null;
+ Object bean = request.getAttribute(CoreConst.API_POST_REQUEST_DATA);
+ if (bean != null) {
+ RequestParameterEntity reqp = (RequestParameterEntity) bean;
+ fse = reqp.getFormData();
+ }
+ //鍒ゆ柇鍙傛暟鏄惁涓虹┖
+ if (fse == null) {
+ SpringMVCContextHolder
+ .getSystemLogger().error(DocumentCode.DOCUMENT_FORM_NODATA.getValue(), DocumentCode.DOCUMENT_FORM_NODATA.getText());
+ return this.error(DocumentCode.DOCUMENT_FORM_NODATA.getValue(), DocumentCode.DOCUMENT_FORM_NODATA.getText());
+ }
+ IDocumentService service = (IDocumentService) getProxyInstance(documentService);
+ boolean flag = service.delDocument(fse);
+ if (flag) {
return OK();
}
- return error(DocumentCode.DOCUMENT_SAVE_NEW_VERION_FAIL.getValue(), DocumentCode.DOCUMENT_SAVE_NEW_VERION_FAIL.getText());
- } catch (BaseException e) {
- e.printStackTrace();
- return this.error(e);
- } catch (Exception e) {
- e.printStackTrace();
- return this.error(DocumentCode.DOCUMENT_OPERATE_FAIL.getValue(), DocumentCode.DOCUMENT_OPERATE_FAIL.getText() + e.getMessage());
- }
- }
+ return this.error(DocumentCode.DOCUMENT_DELETE_FAIL.getValue(), DocumentCode.DOCUMENT_DELETE_FAIL.getText());
+ } catch (BaseException e) {
+ SpringMVCContextHolder.getSystemLogger().error(e);
+ return this.error(e);
+ } catch (Exception e) {
+ e.printStackTrace();
+ SpringMVCContextHolder.getSystemLogger().error(e);
+ return this.error(DocumentCode.DOCUMENT_DELETE_FAIL.getValue(), DocumentCode.DOCUMENT_DELETE_FAIL.getText());
+ }
+ }
+
+ /**
+ * 鏍规嵁鏂囦欢澶硅幏鍙栨枃浠跺垪琛紙鏌ョ湅锛�1
+ *
+ * @param request
+ * @return
+ */
+ @RequestMapping(value = "/documentAll/{version}", method = RequestMethod.POST)
+ @ApiVersion(1)
+ public String documentAll(HttpServletRequest request) {
+ try {
+ //鑾峰彇鍙傛暟
+ FieldSetEntity fse = null;
+ Object bean = request.getAttribute(CoreConst.API_POST_REQUEST_DATA);
+ if (bean != null) {
+ RequestParameterEntity reqp = (RequestParameterEntity) bean;
+ fse = reqp.getFormData();
+ }
+ //鍒ゆ柇鍙傛暟鏄惁涓虹┖
+ if (fse == null) {
+ SpringMVCContextHolder
+ .getSystemLogger().error(DocumentCode.DOCUMENT_FORM_NODATA.getValue(), DocumentCode.DOCUMENT_FORM_NODATA.getText());
+ return this.error(DocumentCode.DOCUMENT_FORM_NODATA.getValue(), DocumentCode.DOCUMENT_FORM_NODATA.getText());
+ }
+ DataTableEntity dataTableEntity = documentService.documentAll(fse);
+ return OK_List(dataTableEntity);
+ } catch (BaseException e) {
+ SpringMVCContextHolder.getSystemLogger().error(e);
+ return this.error(e);
+ } catch (Exception e) {
+ e.printStackTrace();
+ SpringMVCContextHolder.getSystemLogger().error(e);
+ return this.error(DocumentCode.DOCUMENT_GET_LIST_FAIL.getValue(), DocumentCode.DOCUMENT_GET_LIST_FAIL.getText());
+ }
+ }
+
+ /**
+ * 鑾峰彇鏂囦欢璇︽儏锛堟煡鐪嬶級1
+ *
+ * @param request
+ * @return
+ */
+ @RequestMapping(value = "/documentInfo/{version}", method = RequestMethod.POST)
+ @ApiVersion(1)
+ public String documentInfo(HttpServletRequest request) {
+ try {
+ //鑾峰彇鍙傛暟
+ FieldSetEntity fse = null;
+ Object bean = request.getAttribute(CoreConst.API_POST_REQUEST_DATA);
+ if (bean != null) {
+ RequestParameterEntity reqp = (RequestParameterEntity) bean;
+ fse = reqp.getFormData();
+ }
+ //鍒ゆ柇鍙傛暟鏄惁涓虹┖
+ if (fse == null) {
+ SpringMVCContextHolder
+ .getSystemLogger().error(DocumentCode.DOCUMENT_FORM_NODATA.getValue(), DocumentCode.DOCUMENT_FORM_NODATA.getText());
+ return this.error(DocumentCode.DOCUMENT_FORM_NODATA.getValue(), DocumentCode.DOCUMENT_FORM_NODATA.getText());
+ }
+ return OK_List(documentService.documentInfo(fse));
+ } catch (BaseException e) {
+ SpringMVCContextHolder.getSystemLogger().error(e);
+ return this.error(e);
+ } catch (Exception e) {
+ e.printStackTrace();
+ SpringMVCContextHolder.getSystemLogger().error(e);
+ return this.error(DocumentCode.DOCUMENT_GET_FAIL.getValue(), DocumentCode.DOCUMENT_GET_FAIL.getText());
+ }
+ }
+
+ /**
+ * 鑾峰彇褰撳墠鐢ㄦ埛鏂囨。鐩綍鎸夐挳鏉冮檺鏉冮檺
+ * 鍜屾枃浠跺叏璺緞
+ * 鑻ユ湁鏌ョ湅鏉冮檺鏌ョ湅鎵�鏈夋枃浠�
+ * 鏉冮檺1(鏌ョ湅),2(涓嬭浇),3(鏂板{鎵归噺涓婁紶}),4(淇敼),5(鎵归噺鍒犻櫎),6(鎵归噺绉诲姩)
+ *
+ * @param request
+ * @return
+ */
+ @RequestMapping(value = "/getButtonPermissions/{version}", method = RequestMethod.POST)
+ @ApiVersion(1)
+ public String getButtonPermissions(HttpServletRequest request) {
+ try {
+ //鑾峰彇鍙傛暟
+ FieldSetEntity fse = null;
+ Object bean = request.getAttribute(CoreConst.API_POST_REQUEST_DATA);
+ if (bean != null) {
+ RequestParameterEntity reqp = (RequestParameterEntity) bean;
+ fse = reqp.getFormData();
+ }
+ //鍒ゆ柇鍙傛暟鏄惁涓虹┖
+ if (fse == null) {
+ SpringMVCContextHolder
+ .getSystemLogger().error(DocumentCode.DOCUMENT_FORM_NODATA.getValue(), DocumentCode.DOCUMENT_FORM_NODATA.getText());
+ return this.error(DocumentCode.DOCUMENT_FORM_NODATA.getValue(), DocumentCode.DOCUMENT_FORM_NODATA.getText());
+ }
+ if (BaseUtil.strIsNull(fse.getString(CmnConst.DIRECTORY_UUID))) {
+ return OK();
+ }
+ FieldSetEntity fieldSet = documentService.getButtonPermissions(fse);
+ DataTableEntity dataTableEntity = fieldSet.getSubDataTable("dataTable");
+ String str = OK_List(dataTableEntity);
+ JSONObject object = JSONObject.parseObject(str);
+ JSONArray systemFieldMeta = object.getJSONArray("systemFieldMeta");
+ Object systemSeniorQueryString = object.get("systemSeniorQueryString");
+
+ Map<String, Object> map = new HashMap<>();
+ map.put("systemFieldMeta", systemFieldMeta);
+ map.put("systemSeniorQueryString", systemSeniorQueryString);
+ //浼犲叆fieldSet, 鍜岄澶栫殑map 瀵硅薄
+ return BaseUtil.success(fieldSet, map);
+ } catch (BaseException e) {
+ SpringMVCContextHolder.getSystemLogger().error(e);
+ return this.error(e);
+ } catch (Exception e) {
+ e.printStackTrace();
+ SpringMVCContextHolder.getSystemLogger().error(e);
+ return this.error(DocumentCode.DOCUMENT_GET_LIST_FAIL.getValue(), DocumentCode.DOCUMENT_GET_LIST_FAIL.getText());
+ }
+ }
+
+ /**
+ * 寮瑰嚭绉诲姩鐩綍妗�
+ *
+ * @param request
+ * @return
+ */
+ @RequestMapping(value = "/popBoxGetFileDirectory/{version}", method = RequestMethod.POST)
+ @ApiVersion(1)
+ public String popBoxGetFileDirectory(HttpServletRequest request) {
+ try {
+ //鑾峰彇鍙傛暟
+ FieldSetEntity fse = null;
+ Object bean = request.getAttribute(CoreConst.API_POST_REQUEST_DATA);
+ if (bean != null) {
+ RequestParameterEntity reqp = (RequestParameterEntity) bean;
+ fse = reqp.getFormData();
+ }
+ //鍒ゆ柇鍙傛暟鏄惁涓虹┖
+ if (fse == null) {
+ SpringMVCContextHolder
+ .getSystemLogger().error(DocumentCode.DOCUMENT_FORM_NODATA.getValue(), DocumentCode.DOCUMENT_FORM_NODATA.getText());
+ return this.error(DocumentCode.DOCUMENT_FORM_NODATA.getValue(), DocumentCode.DOCUMENT_FORM_NODATA.getText());
+ }
+ JSONObject obj = documentService.popBoxGetFileDirectory(fse);
+ return ResultInfo.success(obj);
+ } catch (BaseException e) {
+ SpringMVCContextHolder.getSystemLogger().error(e);
+ return this.error(e);
+ } catch (Exception e) {
+ e.printStackTrace();
+ SpringMVCContextHolder.getSystemLogger().error(e);
+ return this.error(DocumentCode.DOCUMENT_CATALOG_GET_FAIL.getValue(), DocumentCode.DOCUMENT_CATALOG_GET_FAIL.getText());
+ }
+ }
+
+ /**
+ * 绉诲姩锛堟枃浠舵壒閲忕Щ鍔級6
+ *
+ * @param request
+ * @return
+ */
+ @RequestMapping(value = "/fileMoveTo/{version}", method = RequestMethod.POST)
+ @ApiVersion(1)
+ public String fileMoveTo(HttpServletRequest request) {
+ try {
+ //鑾峰彇鍙傛暟
+ FieldSetEntity fse = null;
+ Object bean = request.getAttribute(CoreConst.API_POST_REQUEST_DATA);
+ if (bean != null) {
+ RequestParameterEntity reqp = (RequestParameterEntity) bean;
+ fse = reqp.getFormData();
+ }
+ //鍒ゆ柇鍙傛暟鏄惁涓虹┖
+ if (fse == null) {
+ SpringMVCContextHolder
+ .getSystemLogger().error(DocumentCode.DOCUMENT_FORM_NODATA.getValue(), DocumentCode.DOCUMENT_FORM_NODATA.getText());
+ return this.error(DocumentCode.DOCUMENT_FORM_NODATA.getValue(), DocumentCode.DOCUMENT_FORM_NODATA.getText());
+ }
+ if (documentService.fileMoveTo(fse)) {
+ return OK();
+ } else {
+ return this.error(DocumentCode.DOCUMENT_USER_RIGHT_FAIL.getValue(), DocumentCode.DOCUMENT_USER_RIGHT_FAIL.getText());
+ }
+ } catch (BaseException e) {
+ SpringMVCContextHolder.getSystemLogger().error(e);
+ return this.error(e);
+ } catch (Exception e) {
+ e.printStackTrace();
+ SpringMVCContextHolder.getSystemLogger().error(e);
+ return this.error(DocumentCode.DOCUMENT_MOVE_FAIL.getValue(), DocumentCode.DOCUMENT_MOVE_FAIL.getText());
+ }
+ }
- @RequestMapping(value = "/getApplyDocument/{version}", method = RequestMethod.POST)
- @ApiVersion(1)
- public String getApplyDocument(HttpServletRequest request){
+ /**
+ * @param request
+ * @return
+ */
+ @RequestMapping(value = "/getDocumentLog/{version}", method = RequestMethod.POST)
+ @ApiVersion(1)
+ public String getDocumentLog(HttpServletRequest request) {
+ try {
+ //鑾峰彇鍙傛暟
+ FieldSetEntity fse = null;
+ Object bean = request.getAttribute(CoreConst.API_POST_REQUEST_DATA);
+ if (bean != null) {
+ RequestParameterEntity reqp = (RequestParameterEntity) bean;
+ fse = reqp.getFormData();
+ }
+ //鍒ゆ柇鍙傛暟鏄惁涓虹┖
+ if (fse == null) {
+ SpringMVCContextHolder
+ .getSystemLogger().error(DocumentCode.DOCUMENT_FORM_NODATA.getValue(), DocumentCode.DOCUMENT_FORM_NODATA.getText());
+ return this.error(DocumentCode.DOCUMENT_FORM_NODATA.getValue(), DocumentCode.DOCUMENT_FORM_NODATA.getText());
+ }
+ return OK_List(documentService.getDocumentLog(fse));
+ } catch (BaseException e) {
+ SpringMVCContextHolder.getSystemLogger().error(e);
+ return this.error(e);
+ } catch (Exception e) {
+ e.printStackTrace();
+ SpringMVCContextHolder.getSystemLogger().error(e);
+ return this.error(DocumentCode.DOCUMENT_LOG_FAIL.getValue(), DocumentCode.DOCUMENT_LOG_FAIL.getText());
+ }
+ }
- //鑾峰彇鍙傛暟
- FieldSetEntity fse = null;
- Object bean = request.getAttribute(CoreConst.API_POST_REQUEST_DATA);
- if (bean != null) {
- RequestParameterEntity reqp = (RequestParameterEntity) bean;
- fse = reqp.getFormData();
- }
- //鍒ゆ柇鍙傛暟鏄惁涓虹┖
- if (fse == null) {
- SpringMVCContextHolder
- .getSystemLogger().error(DocumentCode.DOCUMENT_FORM_NODATA.getValue(), DocumentCode.DOCUMENT_FORM_NODATA.getText());
- return this.error(DocumentCode.DOCUMENT_FORM_NODATA.getValue(), DocumentCode.DOCUMENT_FORM_NODATA.getText());
- }
- DataTableEntity applyDocument = documentService.getApplyDocument(fse);
- return OK_List(applyDocument);
+ /**
+ * 鏂囨。鏀惰棌
+ *
+ * @param request
+ * @return
+ */
+ @RequestMapping(value = "/collection/{version}", method = RequestMethod.POST)
+ @ApiVersion(1)
+ public String documentCollection(HttpServletRequest request) {
+ try {
+ //鑾峰彇鍙傛暟
+ FieldSetEntity fse = BaseUtil.getFieldSetEntity(request, CmnConst.PRODUCT_OA_DOCUMENT_COLLECTION);
+ return OK_Add(documentService.documentCollection(fse));
+ } catch (BaseException e) {
+ e.printStackTrace();
+ return this.error(e);
+ } catch (Exception e) {
+ e.printStackTrace();
+ return this.error(DocumentCode.DOCUMENT_COLLECTION_FAIL.getValue(), DocumentCode.DOCUMENT_COLLECTION_FAIL.getText() + e.getMessage());
+ }
+ }
- }
+ /**
+ * 鏂囨。鍙栨秷鏀惰棌
+ *
+ * @param request
+ * @return
+ */
+ @RequestMapping(value = "/cancel-collection/{version}", method = RequestMethod.POST)
+ @ApiVersion(1)
+ public String documentCancelCollection(HttpServletRequest request) {
+ try {
+ //鑾峰彇鍙傛暟
+ FieldSetEntity fse = BaseUtil.getFieldSetEntity(request, CmnConst.PRODUCT_OA_DOCUMENT_COLLECTION);
+ if (documentService.documentCancelCollection(fse.getString("document_uuid"))) {
+ return OK();
+ }
+ return error(DocumentCode.DOCUMENT_CANCEL_COLLECTION_FAIL.getValue(), DocumentCode.DOCUMENT_CANCEL_COLLECTION_FAIL.getText());
+ } catch (BaseException e) {
+ e.printStackTrace();
+ return this.error(e);
+ } catch (Exception e) {
+ e.printStackTrace();
+ return this.error(DocumentCode.DOCUMENT_OPERATE_FAIL.getValue(), DocumentCode.DOCUMENT_OPERATE_FAIL.getText() + e.getMessage());
+ }
+ }
+
+ /**
+ * 鏂囨。鍘嗗彶鐗堟湰
+ *
+ * @param request
+ * @return
+ */
+ @RequestMapping(value = "/document-history/{version}", method = RequestMethod.POST)
+ @ApiVersion(1)
+ public String findDocumentHistory(HttpServletRequest request) {
+ try {
+ //鑾峰彇鍙傛暟
+ FieldSetEntity fse = BaseUtil.getFieldSetEntity(request, CmnConst.PRODUCT_OA_DOCUMENT_HISTORY);
+ return OK_List(documentService.findDocumentHistory(fse.getUUID()));
+ } catch (BaseException e) {
+ e.printStackTrace();
+ return this.error(e);
+ } catch (Exception e) {
+ e.printStackTrace();
+ return this.error(DocumentCode.DOCUMENT_OPERATE_FAIL.getValue(), DocumentCode.DOCUMENT_OPERATE_FAIL.getText() + e.getMessage());
+ }
+ }
+
+ /**
+ * 鏂囨。鏈�鏂扮増鏈繚瀛�
+ *
+ * @param request
+ * @return
+ */
+ @RequestMapping(value = "/document-save-new-version/{version}", method = RequestMethod.POST)
+ @ApiVersion(1)
+ public String documentSaveNewVersion(HttpServletRequest request) {
+ try {
+ //鑾峰彇鍙傛暟
+ FieldSetEntity fse = BaseUtil.getFieldSetEntity(request, CmnConst.PRODUCT_OA_DOCUMENT);
+ if (documentService.documentSaveNewVersion(fse)) {
+ return OK();
+ }
+ return error(DocumentCode.DOCUMENT_SAVE_NEW_VERION_FAIL.getValue(), DocumentCode.DOCUMENT_SAVE_NEW_VERION_FAIL.getText());
+ } catch (BaseException e) {
+ e.printStackTrace();
+ return this.error(e);
+ } catch (Exception e) {
+ e.printStackTrace();
+ return this.error(DocumentCode.DOCUMENT_OPERATE_FAIL.getValue(), DocumentCode.DOCUMENT_OPERATE_FAIL.getText() + e.getMessage());
+ }
+ }
- /**
- * 鏂囨。鐢宠淇濆瓨涓庢洿鏂�
- * @param request
- * @return
- */
- @RequestMapping(value = "/addOrUpdateApplyDocument/{version}", method = RequestMethod.POST)
- @ApiVersion(1)
- public String addOrUpdateApplyDocument(HttpServletRequest request){
- //鑾峰彇鍙傛暟
- FieldSetEntity fse = null;
- Object bean = request.getAttribute(CoreConst.API_POST_REQUEST_DATA);
- if (bean != null) {
- RequestParameterEntity reqp = (RequestParameterEntity) bean;
- fse = reqp.getFormData();
- }
- //鍒ゆ柇鍙傛暟鏄惁涓虹┖
- if (fse == null) {
- SpringMVCContextHolder
- .getSystemLogger().error(DocumentCode.DOCUMENT_FORM_NODATA.getValue(), DocumentCode.DOCUMENT_FORM_NODATA.getText());
- return this.error(DocumentCode.DOCUMENT_FORM_NODATA.getValue(), DocumentCode.DOCUMENT_FORM_NODATA.getText());
- }
- documentService.addOrUpdateApplyDocument(fse);
- return OK();
- }
+ @RequestMapping(value = "/getApplyDocument/{version}", method = RequestMethod.POST)
+ @ApiVersion(1)
+ public String getApplyDocument(HttpServletRequest request) {
- /**
- * 鍊熼槄鏂囨。鎺掑悕
- * @return
- */
- @RequestMapping(value = "/getApplayFileSort/{version}", method = RequestMethod.POST)
- @ApiVersion(1)
- public String getApplayFileSort(){
- DataTableEntity applayFileSort = documentService.getApplyFileSort();
- return OK_List(applayFileSort);
- }
+ //鑾峰彇鍙傛暟
+ FieldSetEntity fse = null;
+ Object bean = request.getAttribute(CoreConst.API_POST_REQUEST_DATA);
+ if (bean != null) {
+ RequestParameterEntity reqp = (RequestParameterEntity) bean;
+ fse = reqp.getFormData();
+ }
+ //鍒ゆ柇鍙傛暟鏄惁涓虹┖
+ if (fse == null) {
+ SpringMVCContextHolder
+ .getSystemLogger().error(DocumentCode.DOCUMENT_FORM_NODATA.getValue(), DocumentCode.DOCUMENT_FORM_NODATA.getText());
+ return this.error(DocumentCode.DOCUMENT_FORM_NODATA.getValue(), DocumentCode.DOCUMENT_FORM_NODATA.getText());
+ }
+ DataTableEntity applyDocument = documentService.getApplyDocument(fse);
+ return OK_List(applyDocument);
+
+ }
- /**
- * 鏂囨。鍊熼槄浜哄憳鎺掑悕
- * @return
- */
- @RequestMapping(value = "/getApplayUserSort/{version}", method = RequestMethod.POST)
- @ApiVersion(1)
- public String getApplayUserSort(){
- DataTableEntity applayFileSort = documentService.getApplyUserSort();
- return OK_List(applayFileSort);
- }
+ /**
+ * 鏂囨。鐢宠淇濆瓨涓庢洿鏂�
+ *
+ * @param request
+ * @return
+ */
+ @RequestMapping(value = "/addOrUpdateApplyDocument/{version}", method = RequestMethod.POST)
+ @ApiVersion(1)
+ public String addOrUpdateApplyDocument(HttpServletRequest request) {
+ //鑾峰彇鍙傛暟
+ FieldSetEntity fse = null;
+ Object bean = request.getAttribute(CoreConst.API_POST_REQUEST_DATA);
+ if (bean != null) {
+ RequestParameterEntity reqp = (RequestParameterEntity) bean;
+ fse = reqp.getFormData();
+ }
+ //鍒ゆ柇鍙傛暟鏄惁涓虹┖
+ if (fse == null) {
+ SpringMVCContextHolder
+ .getSystemLogger().error(DocumentCode.DOCUMENT_FORM_NODATA.getValue(), DocumentCode.DOCUMENT_FORM_NODATA.getText());
+ return this.error(DocumentCode.DOCUMENT_FORM_NODATA.getValue(), DocumentCode.DOCUMENT_FORM_NODATA.getText());
+ }
+ documentService.addOrUpdateApplyDocument(fse);
+ return OK();
+ }
- /**
- * 鑾峰彇鍊熼槄璇︽儏淇℃伅
- * @param request
- */
+ /**
+ * 鍊熼槄鏂囨。鎺掑悕
+ *
+ * @return
+ */
+ @RequestMapping(value = "/getApplayFileSort/{version}", method = RequestMethod.POST)
+ @ApiVersion(1)
+ public String getApplayFileSort() {
+ DataTableEntity applayFileSort = documentService.getApplyFileSort();
+ return OK_List(applayFileSort);
+ }
- @RequestMapping(value = "/getApplayInfo/{version}", method = RequestMethod.POST)
- @ApiVersion(1)
- public String getApplayInfo(HttpServletRequest request){
- //鑾峰彇鍙傛暟
- FieldSetEntity fse = null;
- Object bean = request.getAttribute(CoreConst.API_POST_REQUEST_DATA);
- if (bean != null) {
- RequestParameterEntity reqp = (RequestParameterEntity) bean;
- fse = reqp.getFormData();
- }
- //鍒ゆ柇鍙傛暟鏄惁涓虹┖
- if (fse == null) {
- SpringMVCContextHolder
- .getSystemLogger().error(DocumentCode.DOCUMENT_FORM_NODATA.getValue(), DocumentCode.DOCUMENT_FORM_NODATA.getText());
- return this.error(DocumentCode.DOCUMENT_FORM_NODATA.getValue(), DocumentCode.DOCUMENT_FORM_NODATA.getText());
- }
- FieldSetEntity applayInfo = documentService.getApplyInfo(fse);
- return OK_List(applayInfo);
- }
+
+ /**
+ * 鏂囨。鍊熼槄浜哄憳鎺掑悕
+ *
+ * @return
+ */
+ @RequestMapping(value = "/getApplayUserSort/{version}", method = RequestMethod.POST)
+ @ApiVersion(1)
+ public String getApplayUserSort() {
+ DataTableEntity applayFileSort = documentService.getApplyUserSort();
+ return OK_List(applayFileSort);
+ }
+
+ /**
+ * 鑾峰彇鍊熼槄璇︽儏淇℃伅
+ *
+ * @param request
+ */
+
+ @RequestMapping(value = "/getApplayInfo/{version}", method = RequestMethod.POST)
+ @ApiVersion(1)
+ public String getApplayInfo(HttpServletRequest request) {
+ //鑾峰彇鍙傛暟
+ FieldSetEntity fse = null;
+ Object bean = request.getAttribute(CoreConst.API_POST_REQUEST_DATA);
+ if (bean != null) {
+ RequestParameterEntity reqp = (RequestParameterEntity) bean;
+ fse = reqp.getFormData();
+ }
+ //鍒ゆ柇鍙傛暟鏄惁涓虹┖
+ if (fse == null) {
+ SpringMVCContextHolder
+ .getSystemLogger().error(DocumentCode.DOCUMENT_FORM_NODATA.getValue(), DocumentCode.DOCUMENT_FORM_NODATA.getText());
+ return this.error(DocumentCode.DOCUMENT_FORM_NODATA.getValue(), DocumentCode.DOCUMENT_FORM_NODATA.getText());
+ }
+ FieldSetEntity applayInfo = documentService.getApplyInfo(fse);
+ return OK_List(applayInfo);
+ }
}
diff --git a/src/main/java/com/product/file/controller/FileManagerController.java b/src/main/java/com/product/file/controller/FileManagerController.java
index 72f55fe..dadac21 100644
--- a/src/main/java/com/product/file/controller/FileManagerController.java
+++ b/src/main/java/com/product/file/controller/FileManagerController.java
@@ -32,351 +32,356 @@
@RestController
public class FileManagerController extends AbstractBaseController {
- @Autowired
- public FileManagerService fileManagerService;
+ @Autowired
+ public FileManagerService fileManagerService;
- /**
- * @param uuid
- * @param response
- * @return
- */
- @GetMapping("/get-static-file/{version}")
- @ApiVersion(1)
- public String getStaticFile(@RequestParam("uuid") String uuid, HttpServletResponse response) {
- try {
- // 娌℃湁鐧诲綍锛岀櫧鍚嶅崟涓� 璇ユ帴鍙d腑涓嶈兘鑾峰彇 token 鍜� 褰撳墠鐢ㄦ埛
- fileManagerService.getStaticFile(uuid, response);
- return OK();
- } catch (BaseException e) {
- e.printStackTrace();
- return error(e);
- } catch (Exception e) {
- e.printStackTrace();
- SpringMVCContextHolder.getSystemLogger().error(e);
- return error(FileCode.GET_FILE_FAIL);
- }
- }
+ /**
+ * @param uuid
+ * @param response
+ * @return
+ */
+ @GetMapping("/get-static-file/{version}")
+ @ApiVersion(1)
+ public String getStaticFile(@RequestParam("uuid") String uuid, HttpServletResponse response) {
+ try {
+ // 娌℃湁鐧诲綍锛岀櫧鍚嶅崟涓� 璇ユ帴鍙d腑涓嶈兘鑾峰彇 token 鍜� 褰撳墠鐢ㄦ埛
+ fileManagerService.getStaticFile(uuid, response);
+ return OK();
+ } catch (BaseException e) {
+ e.printStackTrace();
+ return error(e);
+ } catch (Exception e) {
+ e.printStackTrace();
+ SpringMVCContextHolder.getSystemLogger().error(e);
+ return error(FileCode.GET_FILE_FAIL);
+ }
+ }
- /**
- * 鑾峰彇瀹㈡埛涓婁紶鐨勬枃浠舵�诲ぇ灏�
- *
- * @param request 璇锋眰
- * @return 缁撴灉
- */
- @RequestMapping(value = "/find-client-file-uesd-capacity/{version}", method = RequestMethod.POST)
- @ApiVersion(1)
- public String findClientFileUsedCapacity(HttpServletRequest request) {
- try {
- FieldSetEntity fse = null;
- Object bean = request.getAttribute(CoreConst.API_POST_REQUEST_DATA);
- RequestParameterEntity rpe = (RequestParameterEntity) bean;
- if (null != rpe && null != rpe.getFormData()) {
- fse = rpe.getFormData();
- }
- if (fse == null) {
- SpringMVCContextHolder.getSystemLogger().error(FileCode.FORM_NODATA.getValue(), FileCode.FORM_NODATA.getText());
- return this.error(FileCode.FORM_NODATA.getValue(), FileCode.FORM_NODATA.getText());
- }
+ /**
+ * 鑾峰彇瀹㈡埛涓婁紶鐨勬枃浠舵�诲ぇ灏�
+ *
+ * @param request 璇锋眰
+ * @return 缁撴灉
+ */
+ @RequestMapping(value = "/find-client-file-uesd-capacity/{version}", method = RequestMethod.POST)
+ @ApiVersion(1)
+ public String findClientFileUsedCapacity(HttpServletRequest request) {
+ try {
+ FieldSetEntity fse = null;
+ Object bean = request.getAttribute(CoreConst.API_POST_REQUEST_DATA);
+ RequestParameterEntity rpe = (RequestParameterEntity) bean;
+ if (null != rpe && null != rpe.getFormData()) {
+ fse = rpe.getFormData();
+ }
+ if (fse == null) {
+ SpringMVCContextHolder.getSystemLogger().error(FileCode.FORM_NODATA.getValue(), FileCode.FORM_NODATA.getText());
+ return this.error(FileCode.FORM_NODATA.getValue(), FileCode.FORM_NODATA.getText());
+ }
- long usedCapacity = fileManagerService.findClientFileUsedCapacity(fse.getString("client_uuid"));
- JSONObject data = new JSONObject();
- data.put("used_capacity", String.valueOf(usedCapacity));
- JSONObject result = new JSONObject();
- result.put("data", data);
- result.put("msg", FileCode.SUCCESS.getText());
- result.put("code", "200");
- result.put("status", "success");
- return result.toString();
- } catch (BaseException e) {
- SpringMVCContextHolder.getSystemLogger().error(e);
- return this.error(e.getCode(), e.getMessageInfo());
- } catch (Exception e) {
- SpringMVCContextHolder.getSystemLogger().error(e);
- e.printStackTrace();
- return error(FileCode.GET_DATA_FAIL.getValue(), FileCode.GET_DATA_FAIL.getText());
- }
- }
+ long usedCapacity = fileManagerService.findClientFileUsedCapacity(fse.getString("client_uuid"));
+ JSONObject data = new JSONObject();
+ data.put("used_capacity", String.valueOf(usedCapacity));
+ JSONObject result = new JSONObject();
+ result.put("data", data);
+ result.put("msg", FileCode.SUCCESS.getText());
+ result.put("code", "200");
+ result.put("status", "success");
+ return result.toString();
+ } catch (BaseException e) {
+ SpringMVCContextHolder.getSystemLogger().error(e);
+ return this.error(e.getCode(), e.getMessageInfo());
+ } catch (Exception e) {
+ SpringMVCContextHolder.getSystemLogger().error(e);
+ e.printStackTrace();
+ return error(FileCode.GET_DATA_FAIL.getValue(), FileCode.GET_DATA_FAIL.getText());
+ }
+ }
- /**
- * 鑾峰彇瀹㈡埛鍓╀綑鐨勬枃浠舵�诲ぇ灏�
- *
- * @param request 璇锋眰
- * @return 缁撴灉
- */
- @RequestMapping(value = "/find-client-file-residue-capacity/{version}", method = RequestMethod.POST)
- @ApiVersion(1)
- public String findClientFileResidueCapacity(HttpServletRequest request) {
- try {
- FieldSetEntity fse = null;
- Object bean = request.getAttribute(CoreConst.API_POST_REQUEST_DATA);
- RequestParameterEntity rpe = (RequestParameterEntity) bean;
- if (null != rpe && null != rpe.getFormData()) {
- fse = rpe.getFormData();
- }
- if (fse == null) {
- SpringMVCContextHolder.getSystemLogger().error(FileCode.FORM_NODATA.getValue(), FileCode.FORM_NODATA.getText());
- return this.error(FileCode.FORM_NODATA.getValue(), FileCode.FORM_NODATA.getText());
- }
+ /**
+ * 鑾峰彇瀹㈡埛鍓╀綑鐨勬枃浠舵�诲ぇ灏�
+ *
+ * @param request 璇锋眰
+ * @return 缁撴灉
+ */
+ @RequestMapping(value = "/find-client-file-residue-capacity/{version}", method = RequestMethod.POST)
+ @ApiVersion(1)
+ public String findClientFileResidueCapacity(HttpServletRequest request) {
+ try {
+ FieldSetEntity fse = null;
+ Object bean = request.getAttribute(CoreConst.API_POST_REQUEST_DATA);
+ RequestParameterEntity rpe = (RequestParameterEntity) bean;
+ if (null != rpe && null != rpe.getFormData()) {
+ fse = rpe.getFormData();
+ }
+ if (fse == null) {
+ SpringMVCContextHolder.getSystemLogger().error(FileCode.FORM_NODATA.getValue(), FileCode.FORM_NODATA.getText());
+ return this.error(FileCode.FORM_NODATA.getValue(), FileCode.FORM_NODATA.getText());
+ }
- long residueCapacity = fileManagerService.findClientFileResidueCapacity(fse.getString("client_uuid"));
- JSONObject data = new JSONObject();
- data.put("residue_capacity", String.valueOf(residueCapacity));
- JSONObject result = new JSONObject();
- result.put("data", data);
- result.put("msg", FileCode.SUCCESS.getText());
- result.put("code", "200");
- result.put("status", "success");
- return result.toString();
- } catch (BaseException e) {
- SpringMVCContextHolder.getSystemLogger().error(e);
- return this.error(e.getCode(), e.getMessageInfo());
- } catch (Exception e) {
- SpringMVCContextHolder.getSystemLogger().error(e);
- e.printStackTrace();
- return error(FileCode.GET_DATA_FAIL.getValue(), FileCode.GET_DATA_FAIL.getText());
- }
- }
+ long residueCapacity = fileManagerService.findClientFileResidueCapacity(fse.getString("client_uuid"));
+ JSONObject data = new JSONObject();
+ data.put("residue_capacity", String.valueOf(residueCapacity));
+ JSONObject result = new JSONObject();
+ result.put("data", data);
+ result.put("msg", FileCode.SUCCESS.getText());
+ result.put("code", "200");
+ result.put("status", "success");
+ return result.toString();
+ } catch (BaseException e) {
+ SpringMVCContextHolder.getSystemLogger().error(e);
+ return this.error(e.getCode(), e.getMessageInfo());
+ } catch (Exception e) {
+ SpringMVCContextHolder.getSystemLogger().error(e);
+ e.printStackTrace();
+ return error(FileCode.GET_DATA_FAIL.getValue(), FileCode.GET_DATA_FAIL.getText());
+ }
+ }
- /**
- * 楠岃瘉鏄惁鍏佽涓婁紶鐨勬枃浠剁被鍨�
- *
- * @param request 璇锋眰
- * @return 缁撴灉
- */
- @RequestMapping(value = "/check-is-allowed-file-type/{version}", method = RequestMethod.POST)
- @ApiVersion(1)
- public String checkIsAllowedFileType(HttpServletRequest request) {
- try {
- FieldSetEntity fse = null;
- Object bean = request.getAttribute(CoreConst.API_POST_REQUEST_DATA);
- RequestParameterEntity rpe = (RequestParameterEntity) bean;
- if (null != rpe && null != rpe.getFormData()) {
- fse = rpe.getFormData();
- }
- if (fse == null) {
- SpringMVCContextHolder.getSystemLogger().error(FileCode.FORM_NODATA.getValue(), FileCode.FORM_NODATA.getText());
- return this.error(FileCode.FORM_NODATA.getValue(), FileCode.FORM_NODATA.getText());
- }
+ /**
+ * 楠岃瘉鏄惁鍏佽涓婁紶鐨勬枃浠剁被鍨�
+ *
+ * @param request 璇锋眰
+ * @return 缁撴灉
+ */
+ @RequestMapping(value = "/check-is-allowed-file-type/{version}", method = RequestMethod.POST)
+ @ApiVersion(1)
+ public String checkIsAllowedFileType(HttpServletRequest request) {
+ try {
+ FieldSetEntity fse = null;
+ Object bean = request.getAttribute(CoreConst.API_POST_REQUEST_DATA);
+ RequestParameterEntity rpe = (RequestParameterEntity) bean;
+ if (null != rpe && null != rpe.getFormData()) {
+ fse = rpe.getFormData();
+ }
+ if (fse == null) {
+ SpringMVCContextHolder.getSystemLogger().error(FileCode.FORM_NODATA.getValue(), FileCode.FORM_NODATA.getText());
+ return this.error(FileCode.FORM_NODATA.getValue(), FileCode.FORM_NODATA.getText());
+ }
- boolean f = fileManagerService.checkIsAllowedFileType(fse.getString("attachment_name"));
- return f ? this.OK() : this.error(FileCode.CHECK_FAIL.getValue(), FileCode.CHECK_FAIL.getText());
- } catch (BaseException e) {
- SpringMVCContextHolder.getSystemLogger().error(e);
- return this.error(e.getCode(), e.getMessageInfo());
- } catch (Exception e) {
- SpringMVCContextHolder.getSystemLogger().error(e);
- e.printStackTrace();
- return error(FileCode.CHECK_FAIL.getValue(), FileCode.CHECK_FAIL.getText());
- }
- }
+ boolean f = fileManagerService.checkIsAllowedFileType(fse.getString("attachment_name"));
+ return f ? this.OK() : this.error(FileCode.CHECK_FAIL.getValue(), FileCode.CHECK_FAIL.getText());
+ } catch (BaseException e) {
+ SpringMVCContextHolder.getSystemLogger().error(e);
+ return this.error(e.getCode(), e.getMessageInfo());
+ } catch (Exception e) {
+ SpringMVCContextHolder.getSystemLogger().error(e);
+ e.printStackTrace();
+ return error(FileCode.CHECK_FAIL.getValue(), FileCode.CHECK_FAIL.getText());
+ }
+ }
- /**
- * 鑾峰彇鍘熷鍩熷悕
- *
- * @return 缁撴灉
- */
- @RequestMapping(value = "/find-source-domain/{version}", method = RequestMethod.POST)
- @ApiVersion(1)
- public String findSourceDomain() {
- try {
- String sourceDomain = fileManagerService.findSourceDomain();
+ /**
+ * 鑾峰彇鍘熷鍩熷悕
+ *
+ * @return 缁撴灉
+ */
+ @RequestMapping(value = "/find-source-domain/{version}", method = RequestMethod.POST)
+ @ApiVersion(1)
+ public String findSourceDomain() {
+ try {
+ String sourceDomain = fileManagerService.findSourceDomain();
- JSONObject data = new JSONObject();
- data.put("source_domain", sourceDomain);
- JSONObject result = new JSONObject();
- result.put("data", data);
- result.put("msg", FileCode.SUCCESS.getText());
- result.put("code", "200");
- result.put("status", "success");
- return result.toString();
- } catch (Exception e) {
+ JSONObject data = new JSONObject();
+ data.put("source_domain", sourceDomain);
+ JSONObject result = new JSONObject();
+ result.put("data", data);
+ result.put("msg", FileCode.SUCCESS.getText());
+ result.put("code", "200");
+ result.put("status", "success");
+ return result.toString();
+ } catch (Exception e) {
- SpringMVCContextHolder.getSystemLogger().error(e);
- e.printStackTrace();
- return error(FileCode.FIND_SOURCE_DOMAIN_FAIL.getValue(), FileCode.FIND_SOURCE_DOMAIN_FAIL.getText());
- }
- }
+ SpringMVCContextHolder.getSystemLogger().error(e);
+ e.printStackTrace();
+ return error(FileCode.FIND_SOURCE_DOMAIN_FAIL.getValue(), FileCode.FIND_SOURCE_DOMAIN_FAIL.getText());
+ }
+ }
- /**
- * 鎵嬪姩瑙﹀彂鏃犵敤鏁版嵁娓呯┖
- *
- * @return 缁撴灉
- */
- @RequestMapping(value = "/clear-no-used-data/{version}", method = RequestMethod.POST)
- @ApiVersion(1)
- public String clearNoUsedData() {
- try {
- boolean reuslt = fileManagerService.autoClearNoUsedData();
- JSONObject result = new JSONObject();
- result.put("msg", FileCode.SUCCESS.getText());
- result.put("code", "200");
- result.put("status", reuslt);
- return result.toString();
- } catch (Exception e) {
- SpringMVCContextHolder.getSystemLogger().error(e);
- e.printStackTrace();
- return error(FileCode.CLEAR_NO_USED_DATA_FAIL.getValue(), FileCode.CLEAR_NO_USED_DATA_FAIL.getText());
- }
- }
+ /**
+ * 鎵嬪姩瑙﹀彂鏃犵敤鏁版嵁娓呯┖
+ *
+ * @return 缁撴灉
+ */
+ @RequestMapping(value = "/clear-no-used-data/{version}", method = RequestMethod.POST)
+ @ApiVersion(1)
+ public String clearNoUsedData() {
+ try {
+ boolean reuslt = fileManagerService.autoClearNoUsedData();
+ JSONObject result = new JSONObject();
+ result.put("msg", FileCode.SUCCESS.getText());
+ result.put("code", "200");
+ result.put("status", reuslt);
+ return result.toString();
+ } catch (Exception e) {
+ SpringMVCContextHolder.getSystemLogger().error(e);
+ e.printStackTrace();
+ return error(FileCode.CLEAR_NO_USED_DATA_FAIL.getValue(), FileCode.CLEAR_NO_USED_DATA_FAIL.getText());
+ }
+ }
- /**
- * 鏂囦欢鍒櫎
- *
- * @param request
- * @return
- */
- @RequestMapping(value = "/delete-file/{version}", method = RequestMethod.POST)
- @ApiVersion(1)
- public String deleteFile(HttpServletRequest request) {
- try {
- FieldSetEntity fse = null;
- Object bean = request.getAttribute(CoreConst.API_POST_REQUEST_DATA);
- RequestParameterEntity rpe = (RequestParameterEntity) bean;
- if (null != rpe && null != rpe.getFormData()) {
- fse = rpe.getFormData();
- }
- if (fse == null) {
- SpringMVCContextHolder.getSystemLogger().error(FileCode.FORM_NODATA.getValue(), FileCode.FORM_NODATA.getText());
- return this.error(FileCode.FORM_NODATA.getValue(), FileCode.FORM_NODATA.getText());
- }
- return BaseUtil.success(fileManagerService.delFiles(fse), null);
- } catch (Exception e) {
- SpringMVCContextHolder.getSystemLogger().error(e);
- e.printStackTrace();
- return error(FileCode.CLEAR_NO_USED_DATA_FAIL.getValue(), FileCode.CLEAR_NO_USED_DATA_FAIL.getText());
- }
- }
+ /**
+ * 鏂囦欢鍒櫎
+ *
+ * @param request
+ * @return
+ */
+ @RequestMapping(value = "/delete-file/{version}", method = RequestMethod.POST)
+ @ApiVersion(1)
+ public String deleteFile(HttpServletRequest request) {
+ try {
+ FieldSetEntity fse = null;
+ Object bean = request.getAttribute(CoreConst.API_POST_REQUEST_DATA);
+ RequestParameterEntity rpe = (RequestParameterEntity) bean;
+ if (null != rpe && null != rpe.getFormData()) {
+ fse = rpe.getFormData();
+ }
+ if (fse == null) {
+ SpringMVCContextHolder.getSystemLogger().error(FileCode.FORM_NODATA.getValue(), FileCode.FORM_NODATA.getText());
+ return this.error(FileCode.FORM_NODATA.getValue(), FileCode.FORM_NODATA.getText());
+ }
+ return BaseUtil.success(fileManagerService.delFiles(fse), null);
+ } catch (Exception e) {
+ SpringMVCContextHolder.getSystemLogger().error(e);
+ e.printStackTrace();
+ return error(FileCode.CLEAR_NO_USED_DATA_FAIL.getValue(), FileCode.CLEAR_NO_USED_DATA_FAIL.getText());
+ }
+ }
- /**
- * 涓婁紶鏂囦欢
- *
- * @return 缁撴灉
- */
- @RequestMapping(value = "/upload-file/{version}", method = RequestMethod.POST)
- @ApiVersion(1)
- public String uploadFile(HttpServletRequest request) {
- try {
- Object bean = request.getAttribute(CoreConst.API_POST_REQUEST_DATA);
- RequestParameterEntity rpe = (RequestParameterEntity) bean;
- FieldSetEntity fieldSetEntity = fileManagerService.uploadFile(rpe);
- return OK_List(fieldSetEntity);
- } catch (BaseException e) {
- SpringMVCContextHolder.getSystemLogger().error(e);
- e.printStackTrace();
- return error(e.getCode(), e.getMessage());
- } catch (Exception e) {
- SpringMVCContextHolder.getSystemLogger().error(e);
- e.printStackTrace();
- return error(FileCode.UPLOAD_FILE_FAIL.getValue(), FileCode.UPLOAD_FILE_FAIL.getText());
- }
- }
- /**
- * 涓嬭浇鏂囦欢鎴栬�呭湪绾块瑙�
- *
- * @return 缁撴灉
- */
- @RequestMapping(value = "/get-file-content/{version}", method = RequestMethod.GET)
- @ApiVersion(1)
- public String getFileContents(HttpServletRequest request, HttpServletResponse response) {
- try {
- FieldSetEntity fse = null;
- String uuid = request.getParameter(CoreConst.UUID);
- String onlineView = request.getParameter(CmnConst.NEED_ONLINE_VIEW);
-
- if (StringUtils.isEmpty(uuid)) {
- SpringMVCContextHolder.getSystemLogger().error(FileCode.FORM_NODATA.getValue(), FileCode.FORM_NODATA.getText());
- return this.error(FileCode.FORM_NODATA.getValue(), FileCode.FORM_NODATA.getText());
- }
- fse=new FieldSetEntity();
- fse.setTableName(CmnConst.PRODUCT_SYS_ATTACHMENTS);
- fse.setValue(CoreConst.UUID, uuid);
- fse.setValue(CmnConst.NEED_ONLINE_VIEW, onlineView);
- SpringMVCContextHolder.getSystemLogger().info("閫氳繃GET璇锋眰鑾峰彇闄勪欢鍐呭");
- // 姝e紡浠g爜
- fileManagerService.getFileContent(fse, response);
- return OK();
- } catch (Exception e) {
- SpringMVCContextHolder.getSystemLogger().error(e);
- e.printStackTrace();
- return error(FileCode.GET_FILE_CONTENT_FAIL.getValue(), FileCode.GET_FILE_CONTENT_FAIL.getText());
- }
- }
- /**
- * 涓嬭浇鏂囦欢鎴栬�呭湪绾块瑙�
- *
- * @return 缁撴灉
- */
- @RequestMapping(value = "/get-file-content/{version}", method = RequestMethod.POST)
- @ApiVersion(1)
- public String getFileContent(HttpServletRequest request, HttpServletResponse response) {
- try {
- FieldSetEntity fse = null;
- Object bean = request.getAttribute(CoreConst.API_POST_REQUEST_DATA);
- RequestParameterEntity rpe = (RequestParameterEntity) bean;
- if (null != rpe && null != rpe.getFormData()) {
- fse = rpe.getFormData();
- }
- if (fse == null) {
- SpringMVCContextHolder.getSystemLogger().error(FileCode.FORM_NODATA.getValue(), FileCode.FORM_NODATA.getText());
- return this.error(FileCode.FORM_NODATA.getValue(), FileCode.FORM_NODATA.getText());
- }
- // 姝e紡浠g爜
- fileManagerService.getFileContent(fse, response);
- /*===test-start===*/
+ /**
+ * 涓婁紶鏂囦欢
+ *
+ * @return 缁撴灉
+ */
+ @RequestMapping(value = "/upload-file/{version}", method = RequestMethod.POST)
+ @ApiVersion(1)
+ public String uploadFile(HttpServletRequest request) {
+ try {
+ Object bean = request.getAttribute(CoreConst.API_POST_REQUEST_DATA);
+ RequestParameterEntity rpe = (RequestParameterEntity) bean;
+ FieldSetEntity fieldSetEntity = fileManagerService.uploadFile(rpe);
+ return OK_List(fieldSetEntity);
+ } catch (BaseException e) {
+ SpringMVCContextHolder.getSystemLogger().error(e);
+ e.printStackTrace();
+ return error(e.getCode(), e.getMessage());
+ } catch (Exception e) {
+ SpringMVCContextHolder.getSystemLogger().error(e);
+ e.printStackTrace();
+ return error(FileCode.UPLOAD_FILE_FAIL.getValue(), FileCode.UPLOAD_FILE_FAIL.getText());
+ }
+ }
+
+ /**
+ * 涓嬭浇鏂囦欢鎴栬�呭湪绾块瑙�
+ *
+ * @return 缁撴灉
+ */
+ @RequestMapping(value = "/get-file-content/{version}", method = RequestMethod.GET)
+ @ApiVersion(1)
+ public String getFileContents(HttpServletRequest request, HttpServletResponse response) {
+ try {
+ FieldSetEntity fse = null;
+ String uuid = request.getParameter(CoreConst.UUID);
+ String onlineView = request.getParameter(CmnConst.NEED_ONLINE_VIEW);
+
+ if (StringUtils.isEmpty(uuid)) {
+ SpringMVCContextHolder.getSystemLogger().error(FileCode.FORM_NODATA.getValue(), FileCode.FORM_NODATA.getText());
+ return this.error(FileCode.FORM_NODATA.getValue(), FileCode.FORM_NODATA.getText());
+ }
+ fse = new FieldSetEntity();
+ fse.setTableName(CmnConst.PRODUCT_SYS_ATTACHMENTS);
+ fse.setValue(CoreConst.UUID, uuid);
+ fse.setValue(CmnConst.NEED_ONLINE_VIEW, onlineView);
+ SpringMVCContextHolder.getSystemLogger().info("閫氳繃GET璇锋眰鑾峰彇闄勪欢鍐呭");
+ // 姝e紡浠g爜
+ fileManagerService.getFileContent(fse, response);
+ return OK();
+ } catch (Exception e) {
+ SpringMVCContextHolder.getSystemLogger().error(e);
+ e.printStackTrace();
+ return error(FileCode.GET_FILE_CONTENT_FAIL.getValue(), FileCode.GET_FILE_CONTENT_FAIL.getText());
+ }
+ }
+
+ /**
+ * 涓嬭浇鏂囦欢鎴栬�呭湪绾块瑙�
+ *
+ * @return 缁撴灉
+ */
+ @RequestMapping(value = "/get-file-content/{version}", method = RequestMethod.POST)
+ @ApiVersion(1)
+ public String getFileContent(HttpServletRequest request, HttpServletResponse response) {
+ try {
+ FieldSetEntity fse = null;
+ Object bean = request.getAttribute(CoreConst.API_POST_REQUEST_DATA);
+ RequestParameterEntity rpe = (RequestParameterEntity) bean;
+ if (null != rpe && null != rpe.getFormData()) {
+ fse = rpe.getFormData();
+ }
+ if (fse == null) {
+ SpringMVCContextHolder.getSystemLogger().error(FileCode.FORM_NODATA.getValue(), FileCode.FORM_NODATA.getText());
+ return this.error(FileCode.FORM_NODATA.getValue(), FileCode.FORM_NODATA.getText());
+ }
+ // 姝e紡浠g爜
+ fileManagerService.getFileContent(fse, response);
+ /*===test-start===*/
// String tempPath = fse.getString("tempPath");
// File file = new File(tempPath);
// OutputStream sos = new FileOutputStream(file);
// fileManagerService.getFileContent(fse, sos);
// sos.close();
- /*===test-start===*/
- return OK();
- } catch (Exception e) {
- SpringMVCContextHolder.getSystemLogger().error(e);
- e.printStackTrace();
- return error(FileCode.GET_FILE_CONTENT_FAIL.getValue(), FileCode.GET_FILE_CONTENT_FAIL.getText());
- }
- }
+ /*===test-start===*/
+ return OK();
+ } catch (BaseException e) {
+ e.printStackTrace();
+ return error(e);
+ } catch (Exception e) {
+ SpringMVCContextHolder.getSystemLogger().error(e);
+ e.printStackTrace();
+ return error(FileCode.GET_FILE_CONTENT_FAIL.getValue(), FileCode.GET_FILE_CONTENT_FAIL.getText());
+ }
+ }
- /**
- * 鎵归噺鎵撳寘涓嬭浇
- *
- * @return 缁撴灉
- */
- @RequestMapping(value = "/download-file-zip/{version}", method = RequestMethod.POST)
- @ApiVersion(1)
- public String downLoadFileZip(HttpServletRequest request, HttpServletResponse response) {
- try {
- FieldSetEntity fse = null;
- Object bean = request.getAttribute(CoreConst.API_POST_REQUEST_DATA);
- RequestParameterEntity rpe = (RequestParameterEntity) bean;
- if (null != rpe && null != rpe.getFormData()) {
- fse = rpe.getFormData();
- }
- if (fse == null) {
- SpringMVCContextHolder.getSystemLogger().error(FileCode.FORM_NODATA.getValue(), FileCode.FORM_NODATA.getText());
- return this.error(FileCode.FORM_NODATA.getValue(), FileCode.FORM_NODATA.getText());
- }
+ /**
+ * 鎵归噺鎵撳寘涓嬭浇
+ *
+ * @return 缁撴灉
+ */
+ @RequestMapping(value = "/download-file-zip/{version}", method = RequestMethod.POST)
+ @ApiVersion(1)
+ public String downLoadFileZip(HttpServletRequest request, HttpServletResponse response) {
+ try {
+ FieldSetEntity fse = null;
+ Object bean = request.getAttribute(CoreConst.API_POST_REQUEST_DATA);
+ RequestParameterEntity rpe = (RequestParameterEntity) bean;
+ if (null != rpe && null != rpe.getFormData()) {
+ fse = rpe.getFormData();
+ }
+ if (fse == null) {
+ SpringMVCContextHolder.getSystemLogger().error(FileCode.FORM_NODATA.getValue(), FileCode.FORM_NODATA.getText());
+ return this.error(FileCode.FORM_NODATA.getValue(), FileCode.FORM_NODATA.getText());
+ }
- response.setContentType("multipart/form-data");
- // 姝e紡浠g爜
- fileManagerService.downLoadFileZip(fse, response);
+ response.setContentType("multipart/form-data");
+ // 姝e紡浠g爜
+ fileManagerService.downLoadFileZip(fse, response);
- /*===test-start===*/
+ /*===test-start===*/
// String tempPath ="D:\\Desktop\\ccc.zip";
// File file = new File(tempPath);
// OutputStream sssos = new FileOutputStream(file);
// fileManagerService.downLoadFileZip(fse, sssos);
// sssos.close();
- /*===test-start===*/
- return OK();
- } catch (Exception e) {
- SpringMVCContextHolder.getSystemLogger().error(e);
- e.printStackTrace();
- return error(FileCode.GET_FILE_CONTENT_FAIL.getValue(), FileCode.GET_FILE_CONTENT_FAIL.getText());
- }
- }
+ /*===test-start===*/
+ return OK();
+ } catch (Exception e) {
+ SpringMVCContextHolder.getSystemLogger().error(e);
+ e.printStackTrace();
+ return error(FileCode.GET_FILE_CONTENT_FAIL.getValue(), FileCode.GET_FILE_CONTENT_FAIL.getText());
+ }
+ }
}
diff --git a/src/main/java/com/product/file/service/DocumentService.java b/src/main/java/com/product/file/service/DocumentService.java
index fa8ad64..60767d4 100644
--- a/src/main/java/com/product/file/service/DocumentService.java
+++ b/src/main/java/com/product/file/service/DocumentService.java
@@ -40,641 +40,644 @@
@Component
public class DocumentService extends AbstractBaseService implements IDocumentService {
- @Autowired
- public BaseDao baseDao;
+ @Autowired
+ public BaseDao baseDao;
- @Autowired
- public DocumentService documentService;
+ @Autowired
+ public DocumentService documentService;
- @Autowired
- QueryFilterService queryFilterService;
+ @Autowired
+ QueryFilterService queryFilterService;
- @Autowired
- DocumentDirectoryService documentDirectoryService;
+ @Autowired
+ DocumentDirectoryService documentDirectoryService;
- @Override
- @Transactional
- public String addDocument(FieldSetEntity fse) throws BaseException {
- //鑾峰彇闄勪欢鐩綍鍜岄檮浠秛uid
- String directory_uuid = fse.getString(CmnConst.DIRECTORY_UUID);
- String fileUUIDs = fse.getString(CmnConst.ATTACHMENTS_UUID);
- String[] fileUUIDArray = fileUUIDs.split(",");
- //鑾峰彇闄勪欢淇℃伅
- DataTableEntity attachments = baseDao.listTable(CmnConst.PRODUCT_SYS_ATTACHMENTS, BaseUtil.buildQuestionMarkFilter(CmnConst.UUID, fileUUIDArray, true));
- List<String> uuidList = ListUtils.newArrayList();
- List<String> fileNameList = ListUtils.newArrayList();
- //寰幆闄勪欢淇℃伅锛岀敓鎴愭枃妗d俊鎭�
- for (int i = 0, length = attachments.getRows(); i < length; i++) {
- FieldSetEntity attachment = attachments.getFieldSetEntity(i);
- //鍒涘缓鏂囨。鏁版嵁瀹瑰櫒
- FieldSetEntity fseDocument = new FieldSetEntity(CmnConst.PRODUCT_OA_DOCUMENT);
- fseDocument.setValue(CmnConst.ATTACHMENTS_UUID, attachment.getUUID());
- fseDocument.setValue(CmnConst.DIRECTORY_UUID, directory_uuid);
- fseDocument.setValue(CmnConst.FILE_SIZE, attachment.getString(CmnConst.ATTACHMENT_SIZE));
- fseDocument.setValue(CmnConst.CREATED_BY, SpringMVCContextHolder.getCurrentUser().getUser_id());
- fseDocument.setValue(CmnConst.CREATED_UTC_DATETIME, DateUtils.getDateTime());
- //鏂囦欢鍚嶇О
- String file_name = attachment.getString(CmnConst.FILE_NAME);
- fseDocument.setValue(CmnConst.FILE_NAME, file_name);
- //鏂囦欢绫诲瀷
- String file_type = file_name.substring(file_name.lastIndexOf(".") + 1);
- fseDocument.setValue(CmnConst.FILE_TYPE, file_type);
- //淇濆瓨鏁版嵁
- String documentUUID = baseDao.add(fseDocument);
+ @Override
+ @Transactional
+ public String addDocument(FieldSetEntity fse) throws BaseException {
+ //鑾峰彇闄勪欢鐩綍鍜岄檮浠秛uid
+ String directory_uuid = fse.getString(CmnConst.DIRECTORY_UUID);
+ String fileUUIDs = fse.getString(CmnConst.ATTACHMENTS_UUID);
+ String[] fileUUIDArray = fileUUIDs.split(",");
+ //鑾峰彇闄勪欢淇℃伅
+ DataTableEntity attachments = baseDao.listTable(CmnConst.PRODUCT_SYS_ATTACHMENTS, BaseUtil.buildQuestionMarkFilter(CmnConst.UUID, fileUUIDArray, true));
+ List<String> uuidList = ListUtils.newArrayList();
+ List<String> fileNameList = ListUtils.newArrayList();
+ //寰幆闄勪欢淇℃伅锛岀敓鎴愭枃妗d俊鎭�
+ for (int i = 0, length = attachments.getRows(); i < length; i++) {
+ FieldSetEntity attachment = attachments.getFieldSetEntity(i);
+ //鍒涘缓鏂囨。鏁版嵁瀹瑰櫒
+ FieldSetEntity fseDocument = new FieldSetEntity(CmnConst.PRODUCT_OA_DOCUMENT);
+ fseDocument.setValue(CmnConst.ATTACHMENTS_UUID, attachment.getUUID());
+ fseDocument.setValue(CmnConst.DIRECTORY_UUID, directory_uuid);
+ fseDocument.setValue(CmnConst.FILE_SIZE, attachment.getString(CmnConst.ATTACHMENT_SIZE));
+ fseDocument.setValue(CmnConst.CREATED_BY, SpringMVCContextHolder.getCurrentUser().getUser_id());
+ fseDocument.setValue(CmnConst.CREATED_UTC_DATETIME, DateUtils.getDateTime());
+ fseDocument.setValue("latest_version", fse.getObject("latest_version"));
+ fseDocument.setValue("business_classify_uuid", fse.getObject("business_classify_uuid"));
+ fseDocument.setValue("office_classify_uuid", fse.getObject("office_classify_uuid"));
+ //鏂囦欢鍚嶇О
+ String file_name = attachment.getString(CmnConst.FILE_NAME);
+ fseDocument.setValue(CmnConst.FILE_NAME, file_name);
+ //鏂囦欢绫诲瀷
+ String file_type = file_name.substring(file_name.lastIndexOf(".") + 1);
+ fseDocument.setValue(CmnConst.FILE_TYPE, file_type);
+ //淇濆瓨鏁版嵁
+ String documentUUID = baseDao.add(fseDocument);
- //鍒涘缓鏂囨。鐗堟湰鏁版嵁瀹瑰櫒
- FieldSetEntity fseDocumentHistory = new FieldSetEntity(CmnConst.PRODUCT_OA_DOCUMENT_HISTORY);
- BaseUtil.createCreatorAndCreationTime(fseDocumentHistory);
- fseDocumentHistory.setValue("document_uuid", documentUUID);
- fseDocumentHistory.setValue("attachment_uuid", attachment.getUUID());
- fseDocumentHistory.setValue("version_number", "v1");
- baseDao.add(fseDocumentHistory);
+ //鍒涘缓鏂囨。鐗堟湰鏁版嵁瀹瑰櫒
+ FieldSetEntity fseDocumentHistory = new FieldSetEntity(CmnConst.PRODUCT_OA_DOCUMENT_HISTORY);
+ BaseUtil.createCreatorAndCreationTime(fseDocumentHistory);
+ fseDocumentHistory.setValue("document_uuid", documentUUID);
+ fseDocumentHistory.setValue("attachment_uuid", attachment.getUUID());
+ fseDocumentHistory.setValue("version_number", fseDocument.getObject("latest_version"));
+ baseDao.add(fseDocumentHistory);
- uuidList.add(documentUUID);
- fileNameList.add(file_name);
- }
- this.documentation(uuidList.toArray(), "鏂板", fileNameList.toArray(), null);
- return uuidList.toString();
- }
+ uuidList.add(documentUUID);
+ fileNameList.add(file_name);
+ }
+ this.documentation(uuidList.toArray(), "鏂板", fileNameList.toArray(), null);
+ return uuidList.toString();
+ }
- @Override
- @Transactional
- public boolean upDocumentName(FieldSetEntity fieldSetEntity) throws BaseException {
- String uuid = fieldSetEntity.getString(CmnConst.UUID);
- String file_name = fieldSetEntity.getString(CmnConst.FILE_NAME);
- fieldSetEntity.setValue(CmnConst.UPDATED_BY, SpringMVCContextHolder.getCurrentUser().getUser_id());// 淇敼浜�
- fieldSetEntity.setValue(CmnConst.UPDATED_UTC_DATETIME, DateUtils.getDateTime());// 淇敼鏃堕棿
- FieldSetEntity fie = baseDao.getFieldSetEntity(CmnConst.PRODUCT_OA_DOCUMENT, uuid, false);
- String name = fie.getString(CmnConst.FILE_NAME);
- //姣忔淇敼閮戒翰绌哄凡璇讳汉鍛�
- fieldSetEntity.setValue(CmnConst.READ_NUM, "");
- boolean flag = baseDao.update(fieldSetEntity);
- this.documentRepeatOrder(new Object[]{uuid}, "閲嶅懡鍚�", new Object[]{name}, new Object[]{file_name});
- return flag;
- }
+ @Override
+ @Transactional
+ public boolean upDocumentName(FieldSetEntity fieldSetEntity) throws BaseException {
+ String uuid = fieldSetEntity.getString(CmnConst.UUID);
+ String file_name = fieldSetEntity.getString(CmnConst.FILE_NAME);
+ fieldSetEntity.setValue(CmnConst.UPDATED_BY, SpringMVCContextHolder.getCurrentUser().getUser_id());// 淇敼浜�
+ fieldSetEntity.setValue(CmnConst.UPDATED_UTC_DATETIME, DateUtils.getDateTime());// 淇敼鏃堕棿
+ FieldSetEntity fie = baseDao.getFieldSetEntity(CmnConst.PRODUCT_OA_DOCUMENT, uuid, false);
+ String name = fie.getString(CmnConst.FILE_NAME);
+ //姣忔淇敼閮戒翰绌哄凡璇讳汉鍛�
+ fieldSetEntity.setValue(CmnConst.READ_NUM, "");
+ boolean flag = baseDao.update(fieldSetEntity);
+ this.documentRepeatOrder(new Object[]{uuid}, "閲嶅懡鍚�", new Object[]{name}, new Object[]{file_name});
+ return flag;
+ }
- /**
- * 闇�瑕佹壒閲忓垹闄�
- *
- * @param fieldSetEntity
- * @return
- * @throws BaseException
- */
- @Override
- @Transactional
- public boolean delDocument(FieldSetEntity fieldSetEntity) throws BaseException {
- String uuids = fieldSetEntity.getString(CmnConst.UUID);
- String file_names = fieldSetEntity.getString(CmnConst.FILE_NAME);
- String[] file_name = file_names.split(",");
- String[] uuid = uuids.split(",");
- boolean flag = baseDao.delete(CmnConst.PRODUCT_OA_DOCUMENT, uuid);
- this.documentation(uuid, "鍒犻櫎", file_name, null);
- return flag;
- }
+ /**
+ * 闇�瑕佹壒閲忓垹闄�
+ *
+ * @param fieldSetEntity
+ * @return
+ * @throws BaseException
+ */
+ @Override
+ @Transactional
+ public boolean delDocument(FieldSetEntity fieldSetEntity) throws BaseException {
+ String uuids = fieldSetEntity.getString(CmnConst.UUID);
+ String file_names = fieldSetEntity.getString(CmnConst.FILE_NAME);
+ String[] file_name = file_names.split(",");
+ String[] uuid = uuids.split(",");
+ boolean flag = baseDao.delete(CmnConst.PRODUCT_OA_DOCUMENT, uuid);
+ this.documentation(uuid, "鍒犻櫎", file_name, null);
+ return flag;
+ }
- @Override
- public DataTableEntity documentAll(FieldSetEntity fieldSetEntity) throws BaseException {
- //鏂囨。鐩綍uuid
- String directory_uuid = fieldSetEntity.getString(CmnConst.DIRECTORY_UUID);
- String queryFilter = queryFilterService.getQueryFilter(fieldSetEntity);
- if (!BaseUtil.strIsNull(queryFilter)) {
- queryFilter = " AND " + queryFilter;
- }
- StringBuffer sql = new StringBuffer();
- sql.append("SELECT \n");
- sql.append(" A.*,B.show_name name, \n");
- sql.append(" CONCAT(CONVERT(a.file_size / 1024, decimal(10,2)), 'KB') file_size_kb, \n");
- sql.append(" CASE WHEN D.document_uuid IS NOT NULL THEN '1' ELSE '0' END AS is_collection \n");
- sql.append("FROM( \n");
- sql.append(" SELECT * FROM product_oa_document \n");
- sql.append(" WHERE directory_uuid = ? \n");
- sql.append(queryFilter);
- sql.append(")A \n");
- sql.append("LEFT JOIN product_sys_staffs B ON B.user_id = A.created_by \n");
- sql.append("LEFT JOIN product_sys_attachments C ON C.uuid = B.staff_avatar \n");
- sql.append("LEFT JOIN product_oa_document_collection D ON D.document_uuid = A.uuid AND D.created_by = ?");
- DataTableEntity documentData = baseDao.listTable(sql.toString(), new String[]{directory_uuid, SpringMVCContextHolder.getCurrentUserId()},
- fieldSetEntity.getInteger(CmnConst.PAGESIZE), fieldSetEntity.getInteger(CmnConst.CPAGE));
- baseDao.listInternationDataTable(documentData, null);
- return documentData;
- }
+ @Override
+ public DataTableEntity documentAll(FieldSetEntity fieldSetEntity) throws BaseException {
+ //鏂囨。鐩綍uuid
+ String directory_uuid = fieldSetEntity.getString(CmnConst.DIRECTORY_UUID);
+ String queryFilter = queryFilterService.getQueryFilter(fieldSetEntity);
+ if (!BaseUtil.strIsNull(queryFilter)) {
+ queryFilter = " AND " + queryFilter;
+ }
+ StringBuffer sql = new StringBuffer();
+ sql.append("SELECT \n");
+ sql.append(" A.*,B.show_name name, \n");
+ sql.append(" CONCAT(CONVERT(a.file_size / 1024, decimal(10,2)), 'KB') file_size_kb, \n");
+ sql.append(" CASE WHEN D.document_uuid IS NOT NULL THEN '1' ELSE '0' END AS is_collection \n");
+ sql.append("FROM( \n");
+ sql.append(" SELECT * FROM product_oa_document \n");
+ sql.append(" WHERE directory_uuid = ? \n");
+ sql.append(queryFilter);
+ sql.append(")A \n");
+ sql.append("LEFT JOIN product_sys_staffs B ON B.user_id = A.created_by \n");
+ sql.append("LEFT JOIN product_sys_attachments C ON C.uuid = B.staff_avatar \n");
+ sql.append("LEFT JOIN product_oa_document_collection D ON D.document_uuid = A.uuid AND D.created_by = ?");
+ DataTableEntity documentData = baseDao.listTable(sql.toString(), new String[]{directory_uuid, SpringMVCContextHolder.getCurrentUserId()}, fieldSetEntity.getInteger(CmnConst.PAGESIZE), fieldSetEntity.getInteger(CmnConst.CPAGE));
+ baseDao.listInternationDataTable(documentData, null);
+ return documentData;
+ }
- @Override
- public FieldSetEntity documentInfo(FieldSetEntity fieldSetEntity) throws BaseException {
- String uuid = fieldSetEntity.getString(CmnConst.UUID);
- FieldSetEntity fieldSet = baseDao.getFieldSetEntity(CmnConst.PRODUCT_OA_DOCUMENT, uuid, true);
- String file_name = fieldSet.getString(CmnConst.FILE_NAME);
- String user_ids = fieldSetEntity.getString(CmnConst.USER_IDS);
- String read = fieldSetEntity.getString(CmnConst.READ_NUM);
- if (!BaseUtil.strIsNull(user_ids)) {
- fieldSetEntity.setValue(CmnConst.REQUIRED_NUMBER, user_ids.split(",").length);
- fieldSetEntity.setValue(CmnConst.READ_NUM, read.split(",").length);
- }
- this.documentation(new Object[]{uuid}, "鏌ョ湅", new Object[]{file_name}, null);
- return fieldSet;
- }
+ @Override
+ public FieldSetEntity documentInfo(FieldSetEntity fieldSetEntity) throws BaseException {
+ String uuid = fieldSetEntity.getString(CmnConst.UUID);
+ FieldSetEntity fieldSet = baseDao.getFieldSetEntity(CmnConst.PRODUCT_OA_DOCUMENT, uuid, true);
+ String file_name = fieldSet.getString(CmnConst.FILE_NAME);
+ String user_ids = fieldSetEntity.getString(CmnConst.USER_IDS);
+ String read = fieldSetEntity.getString(CmnConst.READ_NUM);
+ if (!BaseUtil.strIsNull(user_ids)) {
+ fieldSetEntity.setValue(CmnConst.REQUIRED_NUMBER, user_ids.split(",").length);
+ fieldSetEntity.setValue(CmnConst.READ_NUM, read.split(",").length);
+ }
+ this.documentation(new Object[]{uuid}, "鏌ョ湅", new Object[]{file_name}, null);
+ return fieldSet;
+ }
- @Override
- public void documentation(Object[] uuid, String opetype, Object[] file_name, String file_directory) throws BaseException {
- //鑾峰彇鏂囦欢淇℃伅瀛樺叆鏃ュ織琛�
- SystemUser user = SpringMVCContextHolder.getCurrentUser();
- DataTableEntity dataTableEntity = new DataTableEntity();
- FieldMetaEntity fieldMeta = new FieldMetaEntity();
- fieldMeta.setTableName(new String[]{CmnConst.PRODUCT_OA_DOCUMENT_LOG});
- dataTableEntity.setMeta(fieldMeta);
- for (int i = 0; i < uuid.length; i++) {
- FieldSetEntity fieldSetEntity = new FieldSetEntity();
- fieldSetEntity.setTableName(CmnConst.PRODUCT_OA_DOCUMENT_LOG);
- fieldSetEntity.setMeta(fieldMeta);
- fieldSetEntity.setValue(CmnConst.DOCUMENT_UUID, uuid[i]);
- //fieldSetEntity.setValue(CmnConst.RECORD,record);
- fieldSetEntity.setValue(CmnConst.OPETYPE, opetype);
- fieldSetEntity.setValue(CmnConst.OPE_DOCUMENT, file_name[i]);
- StringBuffer state = new StringBuffer();
- state.append(opetype)
- .append("浜哰")
- .append(file_name[i])
- .append("]");
- if (!BaseUtil.strIsNull(file_directory)) {
- state.append("鍒�").append(file_directory).append("鐩綍涓�");
- }
- fieldSetEntity.setValue(CmnConst.STATE, state.toString()); //璇存槑
- fieldSetEntity.setValue(CmnConst.CREATED_BY, user.getUser_id());// 鍒涘缓浜�
- fieldSetEntity.setValue(CmnConst.CREATED_UTC_DATETIME, DateUtils.getDateTime());// 鍒涘缓鏃堕棿
- dataTableEntity.addFieldSetEntity(fieldSetEntity);
- }
- baseDao.add(dataTableEntity);
- }
+ @Override
+ public void documentation(Object[] uuid, String opetype, Object[] file_name, String file_directory) throws BaseException {
+ //鑾峰彇鏂囦欢淇℃伅瀛樺叆鏃ュ織琛�
+ SystemUser user = SpringMVCContextHolder.getCurrentUser();
+ DataTableEntity dataTableEntity = new DataTableEntity();
+ FieldMetaEntity fieldMeta = new FieldMetaEntity();
+ fieldMeta.setTableName(new String[]{CmnConst.PRODUCT_OA_DOCUMENT_LOG});
+ dataTableEntity.setMeta(fieldMeta);
+ for (int i = 0; i < uuid.length; i++) {
+ FieldSetEntity fieldSetEntity = new FieldSetEntity();
+ fieldSetEntity.setTableName(CmnConst.PRODUCT_OA_DOCUMENT_LOG);
+ fieldSetEntity.setMeta(fieldMeta);
+ fieldSetEntity.setValue(CmnConst.DOCUMENT_UUID, uuid[i]);
+ //fieldSetEntity.setValue(CmnConst.RECORD,record);
+ fieldSetEntity.setValue(CmnConst.OPETYPE, opetype);
+ fieldSetEntity.setValue(CmnConst.OPE_DOCUMENT, file_name[i]);
+ StringBuffer state = new StringBuffer();
+ state.append(opetype).append("浜哰").append(file_name[i]).append("]");
+ if (!BaseUtil.strIsNull(file_directory)) {
+ state.append("鍒�").append(file_directory).append("鐩綍涓�");
+ }
+ fieldSetEntity.setValue(CmnConst.STATE, state.toString()); //璇存槑
+ fieldSetEntity.setValue(CmnConst.CREATED_BY, user.getUser_id());// 鍒涘缓浜�
+ fieldSetEntity.setValue(CmnConst.CREATED_UTC_DATETIME, DateUtils.getDateTime());// 鍒涘缓鏃堕棿
+ dataTableEntity.addFieldSetEntity(fieldSetEntity);
+ }
+ baseDao.add(dataTableEntity);
+ }
- @Override
- public void documentRepeatOrder(Object[] uuid, String opetype, Object[] file_name, Object[] newFile_name) throws BaseException {
- //鑾峰彇鏂囦欢淇℃伅瀛樺叆鏃ュ織琛�
- SystemUser user = SpringMVCContextHolder.getCurrentUser();
- DataTableEntity dataTableEntity = new DataTableEntity();
- FieldMetaEntity fieldMeta = new FieldMetaEntity();
- fieldMeta.setTableName(new String[]{CmnConst.PRODUCT_OA_DOCUMENT_LOG});
- dataTableEntity.setMeta(fieldMeta);
- for (int i = 0; i < uuid.length; i++) {
- FieldSetEntity fieldSetEntity = new FieldSetEntity();
- fieldSetEntity.setTableName(CmnConst.PRODUCT_OA_DOCUMENT_LOG);
- fieldSetEntity.setMeta(fieldMeta);
- fieldSetEntity.setValue(CmnConst.DOCUMENT_UUID, uuid[i]);
- //fieldSetEntity.setValue(CmnConst.RECORD,record);
- fieldSetEntity.setValue(CmnConst.OPETYPE, opetype);
- fieldSetEntity.setValue(CmnConst.OPE_DOCUMENT, file_name[i]);
- StringBuffer state = new StringBuffer();
- state.append("鎶奫")
- .append(file_name[i])
- .append("]")
- .append(opetype)
- .append("涓篬")
- .append(newFile_name[i])
- .append("]");
- fieldSetEntity.setValue(CmnConst.STATE, state.toString()); //璇存槑
- fieldSetEntity.setValue(CmnConst.CREATED_BY, user.getUser_id());// 鍒涘缓浜�
- fieldSetEntity.setValue(CmnConst.CREATED_UTC_DATETIME, DateUtils.getDateTime());// 鍒涘缓鏃堕棿
- dataTableEntity.addFieldSetEntity(fieldSetEntity);
- }
- baseDao.add(dataTableEntity);
- }
+ @Override
+ public void documentRepeatOrder(Object[] uuid, String opetype, Object[] file_name, Object[] newFile_name) throws BaseException {
+ //鑾峰彇鏂囦欢淇℃伅瀛樺叆鏃ュ織琛�
+ SystemUser user = SpringMVCContextHolder.getCurrentUser();
+ DataTableEntity dataTableEntity = new DataTableEntity();
+ FieldMetaEntity fieldMeta = new FieldMetaEntity();
+ fieldMeta.setTableName(new String[]{CmnConst.PRODUCT_OA_DOCUMENT_LOG});
+ dataTableEntity.setMeta(fieldMeta);
+ for (int i = 0; i < uuid.length; i++) {
+ FieldSetEntity fieldSetEntity = new FieldSetEntity();
+ fieldSetEntity.setTableName(CmnConst.PRODUCT_OA_DOCUMENT_LOG);
+ fieldSetEntity.setMeta(fieldMeta);
+ fieldSetEntity.setValue(CmnConst.DOCUMENT_UUID, uuid[i]);
+ //fieldSetEntity.setValue(CmnConst.RECORD,record);
+ fieldSetEntity.setValue(CmnConst.OPETYPE, opetype);
+ fieldSetEntity.setValue(CmnConst.OPE_DOCUMENT, file_name[i]);
+ StringBuffer state = new StringBuffer();
+ state.append("鎶奫").append(file_name[i]).append("]").append(opetype).append("涓篬").append(newFile_name[i]).append("]");
+ fieldSetEntity.setValue(CmnConst.STATE, state.toString()); //璇存槑
+ fieldSetEntity.setValue(CmnConst.CREATED_BY, user.getUser_id());// 鍒涘缓浜�
+ fieldSetEntity.setValue(CmnConst.CREATED_UTC_DATETIME, DateUtils.getDateTime());// 鍒涘缓鏃堕棿
+ dataTableEntity.addFieldSetEntity(fieldSetEntity);
+ }
+ baseDao.add(dataTableEntity);
+ }
- public boolean verifyOrgExist(String org) {
- Integer user_id = SpringMVCContextHolder.getCurrentUser().getUser_id();
- String code = SpringMVCContextHolder.getCurrentUser().getCurrentStaff().getString("tricode");
- //鑾峰彇鎵�鏈変笂绾х紪鐮�
- String[] superior_code = new String[code.split("-").length - 1];
- for (int i = 0; i < code.split("-").length - 1; i++) {
- superior_code[i] = code.substring(0, code.length() - ((i + 1) * 4));
- }
- String this_user = String.valueOf(user_id);
- SpringMVCContextHolder.getCurrentUser().getLanguageCode();
- String[][] orgArr = BaseUtil.decomposesMultipleTypeValues(org);
- String[] user = orgArr[3];
- if (null != user) {
- for (int i = 0; i < user.length; i++) {
- if (this_user.equals(user[i])) {
- return true;
- }
- }
- }
- String[] level = orgArr[0];
- String[] dept = orgArr[1];
- // List<String> list = Arrays.asList(a); --OK
- // List<String> list = Arrays.asList("A","B","C"); --OK
- // list.add("F"); --UnsupportedOperationException
- // list.remove("A"); --UnsupportedOperationException
- // list.set(1,"javaee");--OK (鍥犱负鏄妸鏁扮粍杞负闆嗗悎锛屽叾鏈川杩樻槸鏁扮粍锛屾暟缁勯暱搴﹀浐瀹氫笉鍙橈紝浣嗗唴瀹瑰彲浠ユ敼鍙�)
- // 缁撹锛氳櫧鐒跺彲浠ユ妸鏁扮粍杞负闆嗗悎锛屼絾鏄泦鍚堥暱搴︿笉鑳芥敼鍙�
- List list = new ArrayList();
- ;
- if (null != level) {
- list.addAll(Arrays.asList(level));
- }
- if (null != dept) {
- list.addAll(Arrays.asList(dept));
- }
- String[] level_dept = new String[list.size()];
- list.toArray(level_dept);
+ public boolean verifyOrgExist(String org) {
+ Integer user_id = SpringMVCContextHolder.getCurrentUser().getUser_id();
+ String code = SpringMVCContextHolder.getCurrentUser().getCurrentStaff().getString("tricode");
+ //鑾峰彇鎵�鏈変笂绾х紪鐮�
+ String[] superior_code = new String[code.split("-").length - 1];
+ for (int i = 0; i < code.split("-").length - 1; i++) {
+ superior_code[i] = code.substring(0, code.length() - ((i + 1) * 4));
+ }
+ String this_user = String.valueOf(user_id);
+ SpringMVCContextHolder.getCurrentUser().getLanguageCode();
+ String[][] orgArr = BaseUtil.decomposesMultipleTypeValues(org);
+ String[] user = orgArr[3];
+ if (null != user) {
+ for (int i = 0; i < user.length; i++) {
+ if (this_user.equals(user[i])) {
+ return true;
+ }
+ }
+ }
+ String[] level = orgArr[0];
+ String[] dept = orgArr[1];
+ // List<String> list = Arrays.asList(a); --OK
+ // List<String> list = Arrays.asList("A","B","C"); --OK
+ // list.add("F"); --UnsupportedOperationException
+ // list.remove("A"); --UnsupportedOperationException
+ // list.set(1,"javaee");--OK (鍥犱负鏄妸鏁扮粍杞负闆嗗悎锛屽叾鏈川杩樻槸鏁扮粍锛屾暟缁勯暱搴﹀浐瀹氫笉鍙橈紝浣嗗唴瀹瑰彲浠ユ敼鍙�)
+ // 缁撹锛氳櫧鐒跺彲浠ユ妸鏁扮粍杞负闆嗗悎锛屼絾鏄泦鍚堥暱搴︿笉鑳芥敼鍙�
+ List list = new ArrayList();
+ ;
+ if (null != level) {
+ list.addAll(Arrays.asList(level));
+ }
+ if (null != dept) {
+ list.addAll(Arrays.asList(dept));
+ }
+ String[] level_dept = new String[list.size()];
+ list.toArray(level_dept);
- String[] post = orgArr[2];
- if (level_dept.length != 0) {
- DataTableEntity org_level_uuid = baseDao.listTable(CmnConst.TABLE_PRODUCT_SYS_ORG_LEVELS, BaseUtil.buildQuestionMarkFilter("uuid", level_dept, true) + " and " + BaseUtil.buildQuestionMarkFilter("org_level_code", superior_code, true), new String[]{});
- if (org_level_uuid.getRows() > 0) return true;
- }
- if (null != post) {
- DataTableEntity post_uuid = baseDao.listTable(CmnConst.PRODUCT_SYS_STAFFS, BaseUtil.buildQuestionMarkFilter("job_post_uuid", post, true) + " and user_id=?", new String[]{this_user});
- if (post_uuid.getRows() > 0) return true;
- }
- return false;
- }
+ String[] post = orgArr[2];
+ if (level_dept.length != 0) {
+ DataTableEntity org_level_uuid = baseDao.listTable(CmnConst.TABLE_PRODUCT_SYS_ORG_LEVELS, BaseUtil.buildQuestionMarkFilter("uuid", level_dept, true) + " and " + BaseUtil.buildQuestionMarkFilter("org_level_code", superior_code, true), new String[]{});
+ if (org_level_uuid.getRows() > 0) return true;
+ }
+ if (null != post) {
+ DataTableEntity post_uuid = baseDao.listTable(CmnConst.PRODUCT_SYS_STAFFS, BaseUtil.buildQuestionMarkFilter("job_post_uuid", post, true) + " and user_id=?", new String[]{this_user});
+ if (post_uuid.getRows() > 0) return true;
+ }
+ return false;
+ }
- @Override
- public FieldSetEntity getButtonPermissions(FieldSetEntity fieldSetEntity) throws BaseException {
- String butt = "";
- DataTableEntity dataTable = null;
- FieldSetEntity fse = new FieldSetEntity();
- fse.setTableName(CmnConst.PRODUCT_OA_DOCUMENT);
- if ("1".equals(fieldSetEntity.getString(CmnConst.DIRECTORY_TYPE))) {
- //鑾峰彇鐨剈ser_id
- Integer user_id = SpringMVCContextHolder.getCurrentUser().getUser_id();
- String key = "%," + user_id + ",%";
- String directory_uuid = fieldSetEntity.getString(CmnConst.DIRECTORY_UUID);
- //String key = "%,140,%";
- DataTableEntity dataTableEntity = new DataTableEntity();
- FieldSetEntity org = baseDao.getFieldSetByFilter(CmnConst.PRODUCT_OA_DIRECTORY_RIGHTS, "directory_uuid=?", new String[]{directory_uuid}, false);
- if (verifyOrgExist(org.getString("storage_uuid"))) {
- StringBuffer sql = new StringBuffer();
- sql.append(" SELECT substring_index(substring_index(a.rigths,',',b.help_topic_id+1),',',-1) fun FROM PRODUCT_OA_directory_rights a ")
- .append(" INNER join mysql.help_topic b on b.help_topic_id < (length(a.rigths) - length(replace(a.rigths,',',''))+1) ")
- .append(" WHERE a.directory_uuid = ? ");
- dataTableEntity = baseDao.listTable(sql.toString(), new String[]{directory_uuid});
- }
- StringBuffer button = new StringBuffer();
- if (!BaseUtil.dataTableIsEmpty(dataTableEntity)) {
- for (int i = 0, length = dataTableEntity.getRows(); i < length; i++) {
- FieldSetEntity field = dataTableEntity.getFieldSetEntity(i);
- String fun = field.getString("fun");
- //鏉冮檺1(鏌ョ湅),2(涓嬭浇),3(鏂板涓婁紶),4(淇敼,閲嶅懡鍚�),5(鍒犻櫎),6(绉诲姩)
- button.append(fun).append(",");
- if ("1".equals(fun)) {
- //鏈夋煡鐪嬫潈闄愬氨鍔犺浇鍒楄〃
- dataTable = this.documentAll(fieldSetEntity);
- }
- }
- }
- if (!BaseUtil.strIsNull(button.toString())) {
- butt = button.substring(0, button.length() - 1);
- }
- } else {
- dataTable = this.documentAll(fieldSetEntity);
- }
- Map<String, DataTableEntity> dataMap = MapUtils.newHashMap();
- fse.setValue("button", butt);
- //鍔犺浇鏂囦欢璺緞
- DataTableEntity file_list = documentDirectoryService.getDirectoryStructure(fieldSetEntity);
- dataMap.put("file_list", file_list);
- if (BaseUtil.dataTableIsEmpty(dataTable) || dataTable.getSqle() == null) {
- fse.setValue(CmnConst.PAGESIZE, 0);
- fse.setValue(CmnConst.CPAGE, 0);
- fse.setValue("total", 0);
- } else {
- dataMap.put("dataTable", dataTable);
- fse.setValue(CmnConst.PAGESIZE, dataTable.getSqle().getPsize());
- fse.setValue(CmnConst.CPAGE, dataTable.getSqle().getPindex());
- fse.setValue("total", dataTable.getSqle().getTotalCount());
- }
- fse.setSubData(dataMap);
+ @Override
+ public FieldSetEntity getButtonPermissions(FieldSetEntity fieldSetEntity) throws BaseException {
+ String butt = "";
+ DataTableEntity dataTable = null;
+ FieldSetEntity fse = new FieldSetEntity();
+ fse.setTableName(CmnConst.PRODUCT_OA_DOCUMENT);
+ if ("1".equals(fieldSetEntity.getString(CmnConst.DIRECTORY_TYPE))) {
+ //鑾峰彇鐨剈ser_id
+ Integer user_id = SpringMVCContextHolder.getCurrentUser().getUser_id();
+ String key = "%," + user_id + ",%";
+ String directory_uuid = fieldSetEntity.getString(CmnConst.DIRECTORY_UUID);
+ //String key = "%,140,%";
+ DataTableEntity dataTableEntity = new DataTableEntity();
+ FieldSetEntity org = baseDao.getFieldSetByFilter(CmnConst.PRODUCT_OA_DIRECTORY_RIGHTS, "directory_uuid=?", new String[]{directory_uuid}, false);
+ if (verifyOrgExist(org.getString("storage_uuid"))) {
+ StringBuffer sql = new StringBuffer();
+ sql.append(" SELECT substring_index(substring_index(a.rigths,',',b.help_topic_id+1),',',-1) fun FROM PRODUCT_OA_directory_rights a ").append(" INNER join mysql.help_topic b on b.help_topic_id < (length(a.rigths) - length(replace(a.rigths,',',''))+1) ").append(" WHERE a.directory_uuid = ? ");
+ dataTableEntity = baseDao.listTable(sql.toString(), new String[]{directory_uuid});
+ }
+ StringBuffer button = new StringBuffer();
+ if (!BaseUtil.dataTableIsEmpty(dataTableEntity)) {
+ for (int i = 0, length = dataTableEntity.getRows(); i < length; i++) {
+ FieldSetEntity field = dataTableEntity.getFieldSetEntity(i);
+ String fun = field.getString("fun");
+ //鏉冮檺1(鏌ョ湅),2(涓嬭浇),3(鏂板涓婁紶),4(淇敼,閲嶅懡鍚�),5(鍒犻櫎),6(绉诲姩)
+ button.append(fun).append(",");
+ if ("1".equals(fun)) {
+ //鏈夋煡鐪嬫潈闄愬氨鍔犺浇鍒楄〃
+ dataTable = this.documentAll(fieldSetEntity);
+ }
+ }
+ }
+ if (!BaseUtil.strIsNull(button.toString())) {
+ butt = button.substring(0, button.length() - 1);
+ }
+ } else {
+ dataTable = this.documentAll(fieldSetEntity);
+ }
+ Map<String, DataTableEntity> dataMap = MapUtils.newHashMap();
+ fse.setValue("button", butt);
+ //鍔犺浇鏂囦欢璺緞
+ DataTableEntity file_list = documentDirectoryService.getDirectoryStructure(fieldSetEntity);
+ dataMap.put("file_list", file_list);
+ if (BaseUtil.dataTableIsEmpty(dataTable) || dataTable.getSqle() == null) {
+ fse.setValue(CmnConst.PAGESIZE, 0);
+ fse.setValue(CmnConst.CPAGE, 0);
+ fse.setValue("total", 0);
+ } else {
+ dataMap.put("dataTable", dataTable);
+ fse.setValue(CmnConst.PAGESIZE, dataTable.getSqle().getPsize());
+ fse.setValue(CmnConst.CPAGE, dataTable.getSqle().getPindex());
+ fse.setValue("total", dataTable.getSqle().getTotalCount());
+ }
+ fse.setSubData(dataMap);
- return fse;
- }
+ return fse;
+ }
- @Override
- public JSONObject popBoxGetFileDirectory(FieldSetEntity fse) throws BaseException {
- //鏂囦欢鐩綍uuid
- String directory_uuid = fse.getString(CmnConst.DIRECTORY_UUID);
- String type = fse.getString(CmnConst.DIRECTORY_TYPE);
- List<Object> param = ListUtils.newArrayList();
- SystemUser user = SpringMVCContextHolder.getCurrentUser();
- StringBuffer sql = new StringBuffer();
- //1涓哄叕鍙告枃浠剁洰褰�
- if ("1".equals(type)) {
- //String staffId = user.getCurrentStaff().getString("staff_id");
- sql.append(" select a.* from PRODUCT_OA_directory a ")
- .append(" LEFT JOIN ( SELECT a.directory_uuid FROM PRODUCT_OA_directory_rights a LEFT JOIN product_sys_organizational_structure_storage b ")
- .append(" on a.storage_uuid = b.uuid WHERE a.rigths like '%3%' AND CONCAT(',',b.staff_ids,',') like ? GROUP BY ")
- .append(" a.directory_uuid) b ON a.uuid = b.directory_uuid where a.directory_type = 1 and a.org_level_uuid = ? ");
- String staffId = "%" + user.getCurrentStaff().getString("staff_id") + "%";
- param.add(staffId);
- param.add(user.getOrg_level_uuid());
- //param.add("%,140,%");
- } else {
- sql.append(" select * from PRODUCT_OA_directory where directory_type = 2 AND created_by = ? ");
- param.add(user.getUser_id());
- }
- JSONObject object = new JSONObject();
- //directory_uuid涓虹┖灏辨槸鏈�夋嫨鏂囦欢鐩綍 鑾峰彇褰撳墠鏍圭洰褰曞垪琛�
- if (BaseUtil.strIsNull(directory_uuid)) {
- sql.append(" and directory_tier = 1 ");
- //涓嶄负绌哄氨鑾峰彇閫夋嫨鏂囦欢鐩綍
- } else {
- String triCode = fse.getString(CmnConst.TRICODE);
- param.add(triCode);
- sql.append(" and tricode_parent = ? ");
- //鍔犺浇鏂囦欢璺緞
- DataTableEntity dataTableEntity = documentDirectoryService.getDirectoryStructure(fse);
- object.put("product_oa_directory_path", BaseUtil.dataTableEntityToJson(dataTableEntity));
- }
- //sql.append(" GROUP BY tricode,tricode_parent,directory_name");
- DataTableEntity data = baseDao.listTable(sql.toString(), param.toArray());
+ @Override
+ public JSONObject popBoxGetFileDirectory(FieldSetEntity fse) throws BaseException {
+ //鏂囦欢鐩綍uuid
+ String directory_uuid = fse.getString(CmnConst.DIRECTORY_UUID);
+ String type = fse.getString(CmnConst.DIRECTORY_TYPE);
+ List<Object> param = ListUtils.newArrayList();
+ SystemUser user = SpringMVCContextHolder.getCurrentUser();
+ StringBuffer sql = new StringBuffer();
+ //1涓哄叕鍙告枃浠剁洰褰�
+ if ("1".equals(type)) {
+ //String staffId = user.getCurrentStaff().getString("staff_id");
+ sql.append(" select a.* from PRODUCT_OA_directory a ").append(" LEFT JOIN ( SELECT a.directory_uuid FROM PRODUCT_OA_directory_rights a LEFT JOIN product_sys_organizational_structure_storage b ").append(" on a.storage_uuid = b.uuid WHERE a.rigths like '%3%' AND CONCAT(',',b.staff_ids,',') like ? GROUP BY ").append(" a.directory_uuid) b ON a.uuid = b.directory_uuid where a.directory_type = 1 and a.org_level_uuid = ? ");
+ String staffId = "%" + user.getCurrentStaff().getString("staff_id") + "%";
+ param.add(staffId);
+ param.add(user.getOrg_level_uuid());
+ //param.add("%,140,%");
+ } else {
+ sql.append(" select * from PRODUCT_OA_directory where directory_type = 2 AND created_by = ? ");
+ param.add(user.getUser_id());
+ }
+ JSONObject object = new JSONObject();
+ //directory_uuid涓虹┖灏辨槸鏈�夋嫨鏂囦欢鐩綍 鑾峰彇褰撳墠鏍圭洰褰曞垪琛�
+ if (BaseUtil.strIsNull(directory_uuid)) {
+ sql.append(" and directory_tier = 1 ");
+ //涓嶄负绌哄氨鑾峰彇閫夋嫨鏂囦欢鐩綍
+ } else {
+ String triCode = fse.getString(CmnConst.TRICODE);
+ param.add(triCode);
+ sql.append(" and tricode_parent = ? ");
+ //鍔犺浇鏂囦欢璺緞
+ DataTableEntity dataTableEntity = documentDirectoryService.getDirectoryStructure(fse);
+ object.put("product_oa_directory_path", BaseUtil.dataTableEntityToJson(dataTableEntity));
+ }
+ //sql.append(" GROUP BY tricode,tricode_parent,directory_name");
+ DataTableEntity data = baseDao.listTable(sql.toString(), param.toArray());
- object.put("product_oa_directory_sub", BaseUtil.dataTableEntityToJson(data));
- baseDao.listInternationDataTable(data, null);
+ object.put("product_oa_directory_sub", BaseUtil.dataTableEntityToJson(data));
+ baseDao.listInternationDataTable(data, null);
- return object;
- }
+ return object;
+ }
- @Override
- @Transactional
- public void downloadFile(FieldSetEntity fieldSetEntity) throws BaseException {
- String uuid = fieldSetEntity.getString(CmnConst.UUID);
- FieldSetEntity fieldSet = baseDao.getFieldSetEntity(CmnConst.PRODUCT_OA_DOCUMENT, uuid, false);
- String file_name = fieldSet.getString(CmnConst.FILE_NAME);
- this.documentation(new String[]{uuid}, "涓嬭浇", new String[]{file_name}, null);
- this.markRead(fieldSet);
- }
+ @Override
+ @Transactional
+ public void downloadFile(FieldSetEntity fieldSetEntity) throws BaseException {
+ String uuid = fieldSetEntity.getString(CmnConst.UUID);
+ FieldSetEntity fieldSet = baseDao.getFieldSetEntity(CmnConst.PRODUCT_OA_DOCUMENT, uuid, false);
+ String file_name = fieldSet.getString(CmnConst.FILE_NAME);
+ this.documentation(new String[]{uuid}, "涓嬭浇", new String[]{file_name}, null);
+ this.markRead(fieldSet);
+ }
- @Override
- public void markRead(FieldSetEntity fieldSetEntity) throws BaseException {
+ @Override
+ public void markRead(FieldSetEntity fieldSetEntity) throws BaseException {
- //鑾峰彇蹇呰浜哄憳ID闆�
- String user_ids = fieldSetEntity.getString(CmnConst.USER_IDS);
- String read = fieldSetEntity.getString(CmnConst.READ_NUM);
- SystemUser user = SpringMVCContextHolder.getCurrentUser();
- user_ids = "," + user_ids + ",";
- String rawRead = "," + read + ",";
- String userId = "," + user.getUser_id() + ",";
- //濡傛灉鍖呭惈鐢ㄦ埛ID
- if (BaseUtil.strIsNull(read)) {
- fieldSetEntity.setValue(CmnConst.READ_NUM, user.getUser_id());
- baseDao.update(fieldSetEntity);
- } else {
- if (user_ids.contains(userId) && !rawRead.contains(userId)) {
- read = read + "," + user.getUser_id();
- fieldSetEntity.setValue(CmnConst.READ_NUM, read);
- baseDao.update(fieldSetEntity);
- }
- }
- }
+ //鑾峰彇蹇呰浜哄憳ID闆�
+ String user_ids = fieldSetEntity.getString(CmnConst.USER_IDS);
+ String read = fieldSetEntity.getString(CmnConst.READ_NUM);
+ SystemUser user = SpringMVCContextHolder.getCurrentUser();
+ user_ids = "," + user_ids + ",";
+ String rawRead = "," + read + ",";
+ String userId = "," + user.getUser_id() + ",";
+ //濡傛灉鍖呭惈鐢ㄦ埛ID
+ if (BaseUtil.strIsNull(read)) {
+ fieldSetEntity.setValue(CmnConst.READ_NUM, user.getUser_id());
+ baseDao.update(fieldSetEntity);
+ } else {
+ if (user_ids.contains(userId) && !rawRead.contains(userId)) {
+ read = read + "," + user.getUser_id();
+ fieldSetEntity.setValue(CmnConst.READ_NUM, read);
+ baseDao.update(fieldSetEntity);
+ }
+ }
+ }
- /**
- * 绉诲姩锛堟枃浠舵壒閲忕Щ鍔級6
- *
- * @param
- * @return
- * @throws BaseException
- */
- @Override
- @Transactional
- public boolean fileMoveTo(FieldSetEntity fse) throws BaseException {
- String directory_uuid = fse.getString(CmnConst.DIRECTORY_UUID);
- Integer directory_type = fse.getInteger(CmnConst.DIRECTORY_TYPE);
- Integer row = 0;
- //1涓哄叕鍙告枃浠跺す
- if (directory_type == 1) {
- StringBuffer sql = new StringBuffer();
- sql.append(" SELECT * FROM PRODUCT_OA_directory_rights ")
- .append(" WHERE directory_uuid = ? ")
- .append(" AND rigths like '%3%' AND concat(',',storage_uuid,',') like ? ");//3涓烘柊澧�
- String user_id = String.valueOf(SpringMVCContextHolder.getCurrentUser().getUser_id());
- user_id = "%," + user_id + ",%";
- DataTableEntity dataTableEntity = baseDao.listTable(sql.toString(), new String[]{directory_uuid, user_id});
- row = dataTableEntity.getRows();
- }
- //1涓轰釜浜烘枃浠跺す
- if (directory_type == 2 || row > 0) {
- FieldSetEntity fieldSetEntity = baseDao.getFieldSetEntity(CmnConst.PRODUCT_OA_DIRECTORY, directory_uuid, false);
- //鑾峰彇绉诲姩鍒扮殑鐩綍鍚�
- String directory_name = fieldSetEntity.getString(CmnConst.DIRECTORY_NAME);
- String uuids = fse.getString(CmnConst.UUID);
- String[] uuid = uuids.split(",");
- DataTableEntity dataTable = baseDao.listTable(CmnConst.PRODUCT_OA_DOCUMENT, BaseUtil.buildQuestionMarkFilter(CmnConst.UUID, uuid.length, true), uuid);
- List<String> uuidList = ListUtils.newArrayList();
- List<String> fileNameList = ListUtils.newArrayList();
- for (int i = 0, length = dataTable.getRows(); i < length; i++) {
- uuidList.add(dataTable.getFieldSetEntity(i).getString(CmnConst.UUID));
- fileNameList.add(dataTable.getFieldSetEntity(i).getString(CmnConst.FILE_NAME));
- }
+ /**
+ * 绉诲姩锛堟枃浠舵壒閲忕Щ鍔級6
+ *
+ * @param
+ * @return
+ * @throws BaseException
+ */
+ @Override
+ @Transactional
+ public boolean fileMoveTo(FieldSetEntity fse) throws BaseException {
+ String directory_uuid = fse.getString(CmnConst.DIRECTORY_UUID);
+ Integer directory_type = fse.getInteger(CmnConst.DIRECTORY_TYPE);
+ Integer row = 0;
+ //1涓哄叕鍙告枃浠跺す
+ if (directory_type == 1) {
+ StringBuffer sql = new StringBuffer();
+ sql.append(" SELECT * FROM PRODUCT_OA_directory_rights ").append(" WHERE directory_uuid = ? ").append(" AND rigths like '%3%' AND concat(',',storage_uuid,',') like ? ");//3涓烘柊澧�
+ String user_id = String.valueOf(SpringMVCContextHolder.getCurrentUser().getUser_id());
+ user_id = "%," + user_id + ",%";
+ DataTableEntity dataTableEntity = baseDao.listTable(sql.toString(), new String[]{directory_uuid, user_id});
+ row = dataTableEntity.getRows();
+ }
+ //1涓轰釜浜烘枃浠跺す
+ if (directory_type == 2 || row > 0) {
+ FieldSetEntity fieldSetEntity = baseDao.getFieldSetEntity(CmnConst.PRODUCT_OA_DIRECTORY, directory_uuid, false);
+ //鑾峰彇绉诲姩鍒扮殑鐩綍鍚�
+ String directory_name = fieldSetEntity.getString(CmnConst.DIRECTORY_NAME);
+ String uuids = fse.getString(CmnConst.UUID);
+ String[] uuid = uuids.split(",");
+ DataTableEntity dataTable = baseDao.listTable(CmnConst.PRODUCT_OA_DOCUMENT, BaseUtil.buildQuestionMarkFilter(CmnConst.UUID, uuid.length, true), uuid);
+ List<String> uuidList = ListUtils.newArrayList();
+ List<String> fileNameList = ListUtils.newArrayList();
+ for (int i = 0, length = dataTable.getRows(); i < length; i++) {
+ uuidList.add(dataTable.getFieldSetEntity(i).getString(CmnConst.UUID));
+ fileNameList.add(dataTable.getFieldSetEntity(i).getString(CmnConst.FILE_NAME));
+ }
- String params = directory_uuid + "," + uuids;
- String[] param = params.split(",");
- boolean flag = baseDao.executeUpdate("UPDATE PRODUCT_OA_document SET directory_uuid = ? WHERE " + BaseUtil.buildQuestionMarkFilter(CmnConst.UUID, uuid.length, true), param);
- this.documentation(uuidList.toArray(), "绉诲姩", fileNameList.toArray(), directory_name);
- return flag;
- } else {
- return false;
- }
- }
+ String params = directory_uuid + "," + uuids;
+ String[] param = params.split(",");
+ boolean flag = baseDao.executeUpdate("UPDATE PRODUCT_OA_document SET directory_uuid = ? WHERE " + BaseUtil.buildQuestionMarkFilter(CmnConst.UUID, uuid.length, true), param);
+ this.documentation(uuidList.toArray(), "绉诲姩", fileNameList.toArray(), directory_name);
+ return flag;
+ } else {
+ return false;
+ }
+ }
- @Override
- public DataTableEntity getDocumentLog(FieldSetEntity fieldSetEntity) throws BaseException {
- return baseDao.listTable("SELECT CONCAT(b.show_name, a.state) log,a.created_utc_datetime FROM PRODUCT_OA_document_log a LEFT JOIN product_sys_staffs b on a.created_by = b.user_id WHERE document_uuid = ? ORDER BY a.created_utc_datetime DESC",
- new String[]{fieldSetEntity.getString(CmnConst.DOCUMENT_UUID)}, fieldSetEntity.getInteger(CmnConst.PAGESIZE), fieldSetEntity.getInteger(CmnConst.CPAGE));
- }
+ @Override
+ public DataTableEntity getDocumentLog(FieldSetEntity fieldSetEntity) throws BaseException {
+ return baseDao.listTable("SELECT CONCAT(b.show_name, a.state) log,a.created_utc_datetime FROM PRODUCT_OA_document_log a LEFT JOIN product_sys_staffs b on a.created_by = b.user_id WHERE document_uuid = ? ORDER BY a.created_utc_datetime DESC", new String[]{fieldSetEntity.getString(CmnConst.DOCUMENT_UUID)}, fieldSetEntity.getInteger(CmnConst.PAGESIZE), fieldSetEntity.getInteger(CmnConst.CPAGE));
+ }
- /**
- * 鏂囨。鏀惰棌
- * @param fse
- * @return
- */
- public String documentCollection(FieldSetEntity fse) {
- BaseUtil.createCreatorAndCreationTime(fse);
- fse.setValue("document_collector", SpringMVCContextHolder.getCurrentUserId());
- return baseDao.add(fse);
- }
+ /**
+ * 鏂囨。鏀惰棌
+ *
+ * @param fse
+ * @return
+ */
+ public String documentCollection(FieldSetEntity fse) {
+ BaseUtil.createCreatorAndCreationTime(fse);
+ fse.setValue("document_collector", SpringMVCContextHolder.getCurrentUserId());
+ return baseDao.add(fse);
+ }
- /**
- * 鏂囨。鍙栨秷鏀惰棌
- * @param documentUUID
- * @return
- */
- public boolean documentCancelCollection(String documentUUID) {
- return baseDao.delete(CmnConst.PRODUCT_OA_DOCUMENT_COLLECTION, "document_uuid = ? AND document_collector = ?", new Object[] {documentUUID, SpringMVCContextHolder.getCurrentUserId()});
- }
+ /**
+ * 鏂囨。鍙栨秷鏀惰棌
+ *
+ * @param documentUUID
+ * @return
+ */
+ public boolean documentCancelCollection(String documentUUID) {
+ return baseDao.delete(CmnConst.PRODUCT_OA_DOCUMENT_COLLECTION, "document_uuid = ? AND document_collector = ?", new Object[]{documentUUID, SpringMVCContextHolder.getCurrentUserId()});
+ }
- /**
- * 鏌ヨ鏂囨。鍘嗗彶鐗堟湰
- * @param documentUUID
- * @return
- */
- public DataTableEntity findDocumentHistory(String documentUUID) {
- StringBuilder sql = new StringBuilder();
- sql.append("SELECT A.*,B.file_name");
- sql.append("FROM product_oa_document_history A \n");
- sql.append("LEFT JOIN product_oa_document_history B ON B.uuid = A.document_uuid \n");
- sql.append("WHERE A.document_uuid = ?");
- sql.append("ORDER BY A.version_number");
- return baseDao.listTable(sql.toString(), new Object[] {documentUUID});
- }
+ /**
+ * 鏌ヨ鏂囨。鍘嗗彶鐗堟湰
+ *
+ * @param documentUUID
+ * @return
+ */
+ public DataTableEntity findDocumentHistory(String documentUUID) {
+ StringBuilder sql = new StringBuilder();
+ sql.append("SELECT A.*,B.file_name\n");
+ sql.append("FROM product_oa_document_history A \n");
+ sql.append("LEFT JOIN product_oa_document B ON B.uuid = A.document_uuid \n");
+ sql.append("WHERE A.document_uuid = ?\n");
+ sql.append("ORDER BY A.version_number");
+ return baseDao.listTable(sql.toString(), new Object[]{documentUUID});
+ }
- /**
- * 鏂囨。鏈�鏂扮増鏈繚瀛�
- * @param fse
- * @return
- */
- @Transactional
- public boolean documentSaveNewVersion(FieldSetEntity fse) {
- // 鑾峰彇鏂囨。鏁版嵁鍜屾渶澶х紪鍙�
- StringBuilder sql = new StringBuilder();
- sql.append("SELECT A.*, IFNULL(B.max_version_number, 'v0')AS max_version_number \n");
- sql.append("FROM product_oa_document A \n");
- sql.append("LEFT JOIN ( \n");
- sql.append(" SELECT document_uuid, MAX(version_number) AS max_version_number \n");
- sql.append(" FROM product_oa_document_history B \n");
- sql.append(" WHERE document_uuid = ? \n");
- sql.append(" GROUP BY document_uuid \n");
- sql.append(") B ON B.document_uuid = A.uuid \n");
- sql.append("WHERE uuid = ? \n");
- FieldSetEntity fseDocument = baseDao.getFieldSetEntityBySQL(sql.toString(), new Object[] {fse.getString("document_uuid"),fse.getString("document_uuid")}, false);
- if(fseDocument == null) {
- throw new BaseException(DocumentCode.DOCUMENT_DATA_NO_EXIST.getValue(), DocumentCode.DOCUMENT_DATA_NO_EXIST.getText());
- }
- fseDocument.setValue("attachments_uuid", fse.getString("attachment_uuid"));
- baseDao.saveFieldSetEntity(fseDocument);
+ /**
+ * 鏂囨。鏈�鏂扮増鏈繚瀛�
+ *
+ * @param fse
+ * @return
+ */
+ @Transactional
+ public boolean documentSaveNewVersion(FieldSetEntity fse) {
+ // 鑾峰彇鏂囨。鏁版嵁鍜屾渶澶х紪鍙�
+ StringBuilder sql = new StringBuilder();
+ sql.append("SELECT A.*, IFNULL(B.max_version_number, '0')AS max_version_number \n");
+ sql.append("FROM product_oa_document A \n");
+ sql.append("LEFT JOIN ( \n");
+ sql.append(" SELECT document_uuid, MAX(version_number) AS max_version_number \n");
+ sql.append(" FROM product_oa_document_history B \n");
+ sql.append(" WHERE document_uuid = ? \n");
+ sql.append(" GROUP BY document_uuid \n");
+ sql.append(") B ON B.document_uuid = A.uuid \n");
+ sql.append("WHERE uuid = ? \n");
+ String documentUuid = fse.getString("document_uuid");
+ FieldSetEntity fseDocument = baseDao.getFieldSetEntityBySQL(sql.toString(), new Object[]{documentUuid, documentUuid}, false);
+ if (fseDocument == null) {
+ throw new BaseException(DocumentCode.DOCUMENT_DATA_NO_EXIST.getValue(), DocumentCode.DOCUMENT_DATA_NO_EXIST.getText());
+ }
- fse.setValue("version_number", versionNUmberAddne(fseDocument.getString("max_version_number")));
- return baseDao.saveFieldSetEntity(fse);
- }
+ String attachmentUuid = fse.getString("attachment_uuid");
+ FieldSetEntity fieldSetEntity = baseDao.getFieldSetEntity(CmnConst.PRODUCT_SYS_ATTACHMENTS, attachmentUuid, false);
+ fseDocument.setValue("file_size", fieldSetEntity.getString(CmnConst.ATTACHMENT_SIZE));
+ fseDocument.setValue("file_name", fieldSetEntity.getString("file_name"));
+ fseDocument.setValue("attachments_uuid", attachmentUuid);
+ fseDocument.setValue("latest_version", fseDocument.getInteger("max_version_number") + 1);
- /**
- * 鏂囨。鐗堟湰+1
- * @param originNumber
- * @return
- */
- public String versionNUmberAddne(String originNumber) {
- String numberStr = originNumber.substring(1); // 鍘绘帀鍓嶇紑"v"
- int number = Integer.parseInt(numberStr); // 灏嗗瓧绗︿覆杞�
- // 鏁板瓧鍔犱竴
- number += 1;
+ baseDao.saveFieldSetEntity(fseDocument);
- // 閲嶆柊鏋勫缓瀛楃涓诧紙杩欓噷鎴戜滑鍋囪鍓嶇紑鎬绘槸"v"锛�
- return "v" + number;
- }
+ //鍒涘缓鏂囨。鐗堟湰鏁版嵁瀹瑰櫒
+ FieldSetEntity fseDocumentHistory = new FieldSetEntity(CmnConst.PRODUCT_OA_DOCUMENT_HISTORY);
+ BaseUtil.createCreatorAndCreationTime(fseDocumentHistory);
+ fseDocumentHistory.setValue("document_uuid", documentUuid);
+ fseDocumentHistory.setValue("attachment_uuid", attachmentUuid);
+ fseDocumentHistory.setValue("version_number", fseDocument.getObject("latest_version"));
+ return baseDao.saveFieldSetEntity(fseDocumentHistory);
+ }
- @Override
- public DataTableEntity getApplyDocument(FieldSetEntity fse) throws BaseException {
+ /**
+ * 鏂囨。鐗堟湰+1
+ *
+ * @param originNumber
+ * @return
+ */
+ public String versionNUmberAddne(String originNumber) {
+ String numberStr = originNumber.substring(1); // 鍘绘帀鍓嶇紑"v"
+ int number = Integer.parseInt(numberStr); // 灏嗗瓧绗︿覆杞�
+ // 鏁板瓧鍔犱竴
+ number += 1;
- DataTableEntity product_oa_document = new DataTableEntity();
- StringBuilder sb=new StringBuilder();
- sb.append(" select d.*,f.show_name ");
- sb.append(" from product_oa_document d ");
- sb.append(" left join product_sys_staffs f ");
- sb.append(" on d.created_by=f.user_id ");
- List<String> param=new ArrayList<>();
- if(!ObjectUtil.isNotEmpty(fse.getString("document_name"))){
- product_oa_document = baseDao.listTable(sb.toString(),param.toArray());
+ // 閲嶆柊鏋勫缓瀛楃涓诧紙杩欓噷鎴戜滑鍋囪鍓嶇紑鎬绘槸"v"锛�
+ return "v" + number;
+ }
- }else {
- String document_name = fse.getString("document_name");
- sb.append(" where d.file_name like '%"+document_name+"%'");
- product_oa_document = baseDao.listTable(sb.toString(),param.toArray());
+ @Override
+ public DataTableEntity getApplyDocument(FieldSetEntity fse) throws BaseException {
+
+ DataTableEntity product_oa_document = new DataTableEntity();
+ StringBuilder sb = new StringBuilder();
+ sb.append(" select d.*,f.show_name ");
+ sb.append(" from product_oa_document d ");
+ sb.append(" left join product_sys_staffs f ");
+ sb.append(" on d.created_by=f.user_id ");
+ List<String> param = new ArrayList<>();
+ if (!ObjectUtil.isNotEmpty(fse.getString("document_name"))) {
+ product_oa_document = baseDao.listTable(sb.toString(), param.toArray());
+
+ } else {
+ String document_name = fse.getString("document_name");
+ sb.append(" where d.file_name like '%" + document_name + "%'");
+ product_oa_document = baseDao.listTable(sb.toString(), param.toArray());
- }
- return product_oa_document;
- }
+ }
+ return product_oa_document;
+ }
- @Override
- public void addOrUpdateApplyDocument(FieldSetEntity fse) throws BaseException {
+ @Override
+ public void addOrUpdateApplyDocument(FieldSetEntity fse) throws BaseException {
- String[] attachment = new String[0];
- if(ObjectUtil.isNotEmpty(fse.getString("uuid"))){
- UUID uuid = UUID.randomUUID();
- fse.setValue("uuid",uuid);
- baseDao.add(fse);
+ String[] attachment = new String[0];
+ if (ObjectUtil.isNotEmpty(fse.getString("uuid"))) {
+ UUID uuid = UUID.randomUUID();
+ fse.setValue("uuid", uuid);
+ baseDao.add(fse);
- if(ObjectUtil.isNotEmpty(fse.getString("attachment_uuid"))){
- String attachment_uuid = fse.getString("attachment_uuid");
- attachment= attachment_uuid.split(",");
- }
- for (int i = 0; i < attachment.length; i++) {
- FieldSetEntity fieldSetEntity = new FieldSetEntity();
- fieldSetEntity.setTableName("product_oa_document_borrow_sub");
- fieldSetEntity.setValue("borrow_uuid",uuid);
- fieldSetEntity.setValue("sub_uuid",attachment[i]);
+ if (ObjectUtil.isNotEmpty(fse.getString("attachment_uuid"))) {
+ String attachment_uuid = fse.getString("attachment_uuid");
+ attachment = attachment_uuid.split(",");
+ }
+ for (int i = 0; i < attachment.length; i++) {
+ FieldSetEntity fieldSetEntity = new FieldSetEntity();
+ fieldSetEntity.setTableName("product_oa_document_borrow_sub");
+ fieldSetEntity.setValue("borrow_uuid", uuid);
+ fieldSetEntity.setValue("sub_uuid", attachment[i]);
- }
+ }
- }else {
- String uuid = fse.getString("uuid");
- String filter="borrow_uuid='"+uuid+"'";
- //鍒犻櫎鍘熸潵闄勪欢淇℃伅
- baseDao.delete("product_oa_document_borrow_sub",filter,new Object[]{});
- baseDao.update(fse);
- if(ObjectUtil.isNotEmpty(fse.getString("attachment_uuid"))){
- String attachment_uuid = fse.getString("attachment_uuid");
- attachment= attachment_uuid.split(",");
- }
+ } else {
+ String uuid = fse.getString("uuid");
+ String filter = "borrow_uuid='" + uuid + "'";
+ //鍒犻櫎鍘熸潵闄勪欢淇℃伅
+ baseDao.delete("product_oa_document_borrow_sub", filter, new Object[]{});
+ baseDao.update(fse);
+ if (ObjectUtil.isNotEmpty(fse.getString("attachment_uuid"))) {
+ String attachment_uuid = fse.getString("attachment_uuid");
+ attachment = attachment_uuid.split(",");
+ }
- //閲嶆柊璺熸柊闄勪欢淇℃伅
- for (int i = 0; i < attachment.length; i++) {
- FieldSetEntity fieldSetEntity = new FieldSetEntity();
- fieldSetEntity.setTableName("product_oa_document_borrow_sub");
- fieldSetEntity.setValue("borrow_uuid",uuid);
- fieldSetEntity.setValue("sub_uuid",attachment[i]);
- baseDao.add(fieldSetEntity);
+ //閲嶆柊璺熸柊闄勪欢淇℃伅
+ for (int i = 0; i < attachment.length; i++) {
+ FieldSetEntity fieldSetEntity = new FieldSetEntity();
+ fieldSetEntity.setTableName("product_oa_document_borrow_sub");
+ fieldSetEntity.setValue("borrow_uuid", uuid);
+ fieldSetEntity.setValue("sub_uuid", attachment[i]);
+ baseDao.add(fieldSetEntity);
- }
+ }
- }
+ }
- }
+ }
- @Override
- public DataTableEntity getApplyFileSort() throws BaseException {
- StringBuilder sb=new StringBuilder();
- List<String> param=new ArrayList<>();
- sb.append(" SELECT b.* FROM (");
- sb.append(" SELECT t.uuid,t.file_name,s.show_name,t.created_utc_datetime,count(t.uuid) as applyCount");
- sb.append(" FROM product_oa_document_borrow_sub b");
- sb.append(" JOIN product_oa_document t");
- sb.append(" on b.sub_uuid=t.uuid");
- sb.append(" JOIN product_sys_staffs s ");
- sb.append(" on t.created_by=s.user_id");
- sb.append(" group by t.file_name,t.uuid,s.show_name,t.created_utc_datetime");
- sb.append(" )b order by b.applyCount asc");
- DataTableEntity dataTableEntity = baseDao.listTable(sb.toString(),param.toArray());
- return dataTableEntity;
- }
+ @Override
+ public DataTableEntity getApplyFileSort() throws BaseException {
+ StringBuilder sb = new StringBuilder();
+ List<String> param = new ArrayList<>();
+ sb.append(" SELECT b.* FROM (");
+ sb.append(" SELECT t.uuid,t.file_name,s.show_name,t.created_utc_datetime,count(t.uuid) as applyCount");
+ sb.append(" FROM product_oa_document_borrow_sub b");
+ sb.append(" JOIN product_oa_document t");
+ sb.append(" on b.sub_uuid=t.uuid");
+ sb.append(" JOIN product_sys_staffs s ");
+ sb.append(" on t.created_by=s.user_id");
+ sb.append(" group by t.file_name,t.uuid,s.show_name,t.created_utc_datetime");
+ sb.append(" )b order by b.applyCount asc");
+ DataTableEntity dataTableEntity = baseDao.listTable(sb.toString(), param.toArray());
+ return dataTableEntity;
+ }
- @Override
- public DataTableEntity getApplyUserSort() throws BaseException {
- StringBuilder sb=new StringBuilder();
- List<String> param=new ArrayList<>();
- sb.append(" SELECT a.borrower,a.show_name,a.applayCount,a.applayFileCount ");
- sb.append(" FROM (");
- sb.append(" SELECT w.borrower,s.show_name,");
- sb.append(" (select count(borrower) from product_oa_document_borrow group by borrower ) as applayCount,");
- sb.append(" count(sub_uuid) as applayFileCount ");
- sb.append(" FROM product_oa_document_borrow w ");
- sb.append(" JOIN product_oa_document_borrow_sub b");
- sb.append(" on b.borrow_uuid=w.uuid");
- sb.append(" JOIN product_oa_document t");
- sb.append(" on b.sub_uuid=t.uuid");
- sb.append(" JOIN product_sys_staffs s");
- sb.append(" on w.borrower=s.user_id");
- sb.append(" GROUP BY w.borrower,s.show_name");
- sb.append(" )a");
- sb.append(" order by a.applayCount,a.applayFileCount asc");
- DataTableEntity dataTableEntity = baseDao.listTable(sb.toString(),param.toArray());
- return dataTableEntity;
- }
+ @Override
+ public DataTableEntity getApplyUserSort() throws BaseException {
+ StringBuilder sb = new StringBuilder();
+ List<String> param = new ArrayList<>();
+ sb.append(" SELECT a.borrower,a.show_name,a.applayCount,a.applayFileCount ");
+ sb.append(" FROM (");
+ sb.append(" SELECT w.borrower,s.show_name,");
+ sb.append(" (select count(borrower) from product_oa_document_borrow group by borrower ) as applayCount,");
+ sb.append(" count(sub_uuid) as applayFileCount ");
+ sb.append(" FROM product_oa_document_borrow w ");
+ sb.append(" JOIN product_oa_document_borrow_sub b");
+ sb.append(" on b.borrow_uuid=w.uuid");
+ sb.append(" JOIN product_oa_document t");
+ sb.append(" on b.sub_uuid=t.uuid");
+ sb.append(" JOIN product_sys_staffs s");
+ sb.append(" on w.borrower=s.user_id");
+ sb.append(" GROUP BY w.borrower,s.show_name");
+ sb.append(" )a");
+ sb.append(" order by a.applayCount,a.applayFileCount asc");
+ DataTableEntity dataTableEntity = baseDao.listTable(sb.toString(), param.toArray());
+ return dataTableEntity;
+ }
- @Override
- public FieldSetEntity getApplyInfo(FieldSetEntity fes) throws BaseException {
- String uuid = fes.getString("uuid");
- FieldSetEntity product_oa_document_borrow = baseDao.getFieldSetEntity("product_oa_document_borrow", uuid, false);
- return product_oa_document_borrow;
- }
+ @Override
+ public FieldSetEntity getApplyInfo(FieldSetEntity fes) throws BaseException {
+ String uuid = fes.getString("uuid");
+ FieldSetEntity product_oa_document_borrow = baseDao.getFieldSetEntity("product_oa_document_borrow", uuid, false);
+ return product_oa_document_borrow;
+ }
}
--
Gitblit v1.9.2