| | |
| | | import com.product.common.collect.ListUtils; |
| | | import com.product.common.collect.MapUtils; |
| | | import com.product.common.lang.DateUtils; |
| | | import com.product.core.config.Global; |
| | | import com.product.core.dao.BaseDao; |
| | | import com.product.core.entity.DataTableEntity; |
| | | import com.product.core.entity.FieldMetaEntity; |
| | |
| | | fseDocument.setValue(CmnConst.FILE_TYPE, file_type); |
| | | //保存数据 |
| | | String documentUUID = baseDao.add(fseDocument); |
| | | |
| | | |
| | | //创建文档版本数据容器 |
| | | FieldSetEntity fseDocumentHistory = new FieldSetEntity(CmnConst.PRODUCT_OA_DOCUMENT_HISTORY); |
| | | BaseUtil.createCreatorAndCreationTime(fseDocumentHistory); |
| | | fseDocument.setValue("document_uuid", documentUUID); |
| | | fseDocument.setValue("attachment_uuid", attachment.getUUID()); |
| | | baseDao.add(fseDocumentHistory); |
| | | |
| | | |
| | | uuidList.add(documentUUID); |
| | | fileNameList.add(file_name); |
| | | } |
| | |
| | | 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 |
| | |
| | | fse.setValue("document_collector", SpringMVCContextHolder.getCurrentUserId()); |
| | | return baseDao.add(fse); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 文档取消收藏 |
| | | * @param documentUUID |
| | |
| | | @Override |
| | | public DataTableEntity getApplyDocument(FieldSetEntity fse) throws BaseException { |
| | | |
| | | String document_name = fse.getString("document_name"); |
| | | String filter="file_name like '%"+document_name+"'%"; |
| | | DataTableEntity product_oa_document = baseDao.listTable("product_oa_document",filter); |
| | | DataTableEntity product_oa_document; |
| | | if(ObjectUtil.isNotEmpty(fse.getString("document_name"))){ |
| | | String document_name = fse.getString("document_name"); |
| | | String filter="file_name like '%"+document_name+"'%"; |
| | | product_oa_document = baseDao.listTable("product_oa_document",filter); |
| | | }else { |
| | | product_oa_document = baseDao.listTable("product_oa_document"); |
| | | } |
| | | |
| | | |
| | | return product_oa_document; |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public DataTableEntity getApplayFileSort() throws BaseException { |
| | | public DataTableEntity getApplyFileSort() throws BaseException { |
| | | StringBuilder sb=new StringBuilder(); |
| | | 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"); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public DataTableEntity getApplayUserSort() throws BaseException { |
| | | public DataTableEntity getApplyUserSort() throws BaseException { |
| | | StringBuilder sb=new StringBuilder(); |
| | | sb.append(" SELECT a.borrower,a.show_name,a.applayCount,a.applayFileCount "); |
| | | sb.append(" FROM ("); |
| | |
| | | DataTableEntity dataTableEntity = baseDao.listTable(sb.toString()); |
| | | 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; |
| | | } |
| | | } |