Commit 622961f8 authored by 侯彦文's avatar 侯彦文

借阅单创建

parent 2cbd18b7
......@@ -27,7 +27,6 @@ import lombok.ToString;
@Data
@ToString(callSuper = true)
@DexTypeVersionProp(propName = "target", join = @VersionProperty(curVersion = VersionRelationType.NONE, refVersion = VersionRelationType.ITERATION))
@DexTypeVersionProp(propName = "source", join = @VersionProperty(curVersion = VersionRelationType.NONE, refVersion = VersionRelationType.ITERATION))
public class ExtBorrowingDocLinkVO extends IdOnlyVO implements DxLinkDataVOHolder<DxDocumentVO, ExtBorrowingFormVO>, IdVO {
public static final String DX_ID_EMBEDDABLE_PROP_NAME = "dxIdEmbeddable";
......
......@@ -44,6 +44,13 @@ public class ExtBorrowingFormController<V extends ExtBorrowingFormVO, S extends
return ApiResult.ok(extBorrowingFormService.borrowCount(searchVo));
}
@ApiOperation("借阅统计")
@PostMapping({"borrow"})
public ApiResult borrow(@RequestBody ExtBorrowingFormVO extBorrowingFormVO,@RequestParam("docId") Long docId) {
extBorrowingFormService.borrow(extBorrowingFormVO,docId);
return ApiResult.ok("借阅成功");
}
}
......@@ -76,29 +76,4 @@ public class ExtBorrowingFormEvent {
extDxDocumentService.updateBorrowingStatus(sourceId, ExtBorrowingFormServiceImpl.CAN_BE_BORROWED);
}
}
public void beforeSave(ExtBorrowingFormVO extBorrowingFormVO) {
// 保存之前不展开下面属性
/*ExtBorrowingDocLinkVO extBorrowingDocLinkVO = extBorrowingFormVO.getExtBorrowingDocLinks().get(0);
DxDocumentVO source = extBorrowingDocLinkVO.getSource();
String borrowingStatus = source.getBorrowingStatus();
if (borrowingStatus.equals(ExtBorrowingFormServiceImpl.BORROWING_IN_PROGRESS)) {
throw new DxBusinessException("500", "文档正在借阅中");
}*/
}
public void postSave(ExtBorrowingFormVO extBorrowingFormVO) {
// 待审阅占用文档,改为借阅中
if (extBorrowingFormVO.getState().equals(Constants.PENDING_REVIEW)) {
Long id = extBorrowingFormVO.getId();
SearchQueryCondition queryCondition = SearchUtil.buildQuery("targetId", SearchItem.Operator.EQ, id);
List<ExtBorrowingDocLinkVO> extBorrowingDocLinkVOList = extBorrowingDocLinkService.findRecursion(queryCondition).getContent();
Long sourceId = extBorrowingDocLinkVOList.get(0).getSourceId();
extDxDocumentService.updateBorrowingStatus(sourceId, ExtBorrowingFormServiceImpl.BORROWING_IN_PROGRESS);
// 获取文档档号和文件名称
}
// 更新借阅人,借阅日期,借阅部门
}
}
......@@ -44,7 +44,7 @@ public class ExtTransferDocumentEvent {
for (DxEventWrap<ExtTransferDocumentVO> e : eventWrapList) {
ExtTransferDocumentVO extTransferDocumentVO = e.getTarget();
// 单据状态已完成,只更新一次
if (Constants.COMPLETE.equals(extTransferDocumentVO.getState()) && ObjectUtils.isEmpty(extTransferDocumentVO.getHandoverTime())) {
if (Constants.COMPLETE.equals(extTransferDocumentVO.getState())) {
// 获取档案组流程审批人信息
DxWfProcessVO wfProcessInstVO = workFlowUtil.getWfProcessInst(extTransferDocumentVO);
DxWfProcessInfoVO wfProcessInfoVO = workFlowUtil.getProcessInstDetail(wfProcessInstVO);
......@@ -63,7 +63,7 @@ public class ExtTransferDocumentEvent {
extTransferDocumentService.saveRecursion(extTransferDocumentVO);
// 更新文档状态为已归档
extTransferDocumentService.updateArchivingStatus(extTransferDocumentVO.getId());
extTransferDocumentService.updateArchivingStatus(extTransferDocumentVO);
}
}
}
......
......@@ -31,4 +31,6 @@ public interface ExtBorrowingFormService<V extends ExtBorrowingFormVO> extends E
DxUserInfoVO getSignInfo(List<DxWfProcessTaskVO> activities, String activityName);
LocalDateTime getEndDate(List<DxWfProcessTaskVO> activities, String activityName);
void borrow(ExtBorrowingFormVO extBorrowingFormVO,Long docId);
}
......@@ -32,7 +32,7 @@ public interface ExtTransferDocumentService<V extends ExtTransferDocumentVO> ext
LocalDateTime getEndDate(List<DxWfProcessTaskVO> activities, String activityName);
void updateArchivingStatus(Long id);
void updateArchivingStatus(ExtTransferDocumentVO extTransferDocumentVO);
void returnDocument(Long transferDocLinkId);
......
......@@ -11,7 +11,10 @@ import com.inet.dcs.document.core.constants.SqlConstants;
import com.inet.dcs.document.core.event.ExtBorrowingFormEvent;
import com.inet.dcs.document.core.repository.ExtBorrowingFormRepository;
import com.inet.dcs.document.core.service.ExtBorrowingFormService;
import com.inet.dcs.document.core.service.expand.ExtDxDocumentService;
import com.inet.dcs.document.entity.po.ExtBorrowingForm;
import com.yonde.dcs.document.common.entity.vo.DxDocumentVO;
import com.yonde.dex.basedata.entity.data.OperatorType;
import com.yonde.dex.basedata.exception.DxBusinessException;
import com.yonde.dex.dao.service.DxDaoPluginExpander;
import com.yonde.dex.user.common.vo.DxUserInfoVO;
......@@ -66,27 +69,15 @@ public class ExtBorrowingFormServiceImpl<V extends ExtBorrowingFormVO> implement
@Autowired
private DxUserInfoFeign userService;
@Autowired
private ExtDxDocumentService extDxDocumentService;
@Override
public void postUpdate(Collection<V> target, Collection<V> origin) {
for (V v : target) {
extBorrowingFormEvent.postUpdate(v);
}
}
@Override
public void beforeSave(Collection<V> target) {
for (V v : target) {
//extBorrowingFormEvent.beforeSave(v);
}
}
@Override
public void postSave(Collection<V> target) {
for (V v : target) {
extBorrowingFormEvent.postSave(v);
}
}
@Override
public ExtBorrowingFormVO startWorkflow(Long id) {
ExtBorrowingFormVO extBorrowingFormVO = this.get(id);
......@@ -218,6 +209,15 @@ public class ExtBorrowingFormServiceImpl<V extends ExtBorrowingFormVO> implement
return null;
}
@Override
public void borrow(ExtBorrowingFormVO extBorrowingFormVO,Long docId) {
this.saveRecursion((V) extBorrowingFormVO);
DxDocumentVO dxDocumentVO = (DxDocumentVO) extDxDocumentService.get(docId);
dxDocumentVO.setBorrowingStatus(BORROWING_IN_PROGRESS);
dxDocumentVO.setOperator(OperatorType.MODIFY);
extDxDocumentService.saveRecursion(dxDocumentVO);
}
}
......@@ -202,17 +202,17 @@ public class ExtTransferDocumentServiceImpl<V extends ExtTransferDocumentVO> imp
}
@Override
public void updateArchivingStatus(Long id) {
public void updateArchivingStatus(ExtTransferDocumentVO extTransferDocumentVO) {
SearchQueryCondition queryDoc = SearchQueryCondition.builder()
.searchItems(SearchItems.builder()
.item(new SearchItem("targetId", SearchItem.Operator.EQ, id, null))
.item(new SearchItem("targetId", SearchItem.Operator.EQ, extTransferDocumentVO.getId(), null))
.operator(SearchItems.BooleanOperator.AND).build()).build();
List<ExtTransferDocLinkVO> transferDocLinkVOList = extTransferDocLinkService.findRecursion(queryDoc).getContent();
if (CollectionUtils.isNotEmpty(transferDocLinkVOList)) {
for (ExtTransferDocLinkVO extTransferDocLinkVO : transferDocLinkVOList) {
Long sourceId = extTransferDocLinkVO.getSourceId();
extDxDocumentService.updateArchivingStatus(sourceId, ExtDxDocumentServiceImpl.ARCHIVED, "");
extDxDocumentService.updateArchivingStatus(sourceId, ExtDxDocumentServiceImpl.ARCHIVED, extTransferDocumentVO.getNumber());
}
}
}
......
......@@ -140,7 +140,8 @@ public class ExtDxDocumentServiceImpl<V extends DxDocumentVO> extends DocumentSe
}
// 无前置状态,直接已归档。置空退档人,和退档时间,移交单号
if (ARCHIVED.equals(archivingStatus)) {
dxDocumentVO.setTransferDocumentId(null);
dxDocumentVO.setTransferDocumentId(transferDocumentCode);
dxDocumentVO.setBorrowingStatus("可借阅");
dxDocumentVO.setDxRefundPersonUser(null);
dxDocumentVO.setDxRefundPersonUserId(null);
dxDocumentVO.setDxRefundPersonUserIdType(null);
......@@ -152,6 +153,7 @@ public class ExtDxDocumentServiceImpl<V extends DxDocumentVO> extends DocumentSe
if (!dxDocumentVO.getArchivingStatus().equals(ARCHIVED)) {
throw new DxBusinessException("500", "不是已归档状态");
}
dxDocumentVO.setTransferDocumentId(transferDocumentCode);
dxDocumentVO.setDxRefundPersonUser(dxUserInfoVO);
dxDocumentVO.setDxRefundPersonUserId(dxUserInfoVO.getUserId());
dxDocumentVO.setDxRefundPersonUserIdType("DxUser");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment