package com.ld.igds.oa.view;
|
|
import com.bstek.dorado.annotation.DataProvider;
|
import com.bstek.dorado.annotation.DataResolver;
|
import com.bstek.dorado.annotation.Expose;
|
import com.ld.igds.constant.OrderStatus;
|
import com.ld.igds.file.CoreFileService;
|
import com.ld.igds.models.*;
|
import com.ld.igds.oa.service.HDocumentServiceImpl;
|
import com.ld.igds.sys.service.SysDeptService;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.stereotype.Component;
|
import java.util.*;
|
|
/**
|
* 公文流转管理
|
*
|
* @author: chen
|
* @date 2023-02-17 16:50
|
*
|
*/
|
@Component
|
public class DocumentPR {
|
|
@Autowired
|
private HDocumentServiceImpl hDocumentService;
|
@Autowired
|
private CoreFileService fileService;
|
@Autowired
|
private SysDeptService sysDeptService;
|
|
/**
|
* 公文流转--任务类型
|
*
|
* ${dorado.getDataProvider("documentPR#triggerTaskType").getResult()}
|
* @return
|
*/
|
@DataProvider
|
public List<DicTrigger> triggerTaskType() {
|
List<DicTrigger> list = new ArrayList<DicTrigger>();
|
list.add(new DicTrigger("10", "普通任务"));
|
list.add(new DicTrigger("20", "竞签任务"));
|
list.add(new DicTrigger("30", "会签任务"));
|
return list;
|
}
|
|
/*----------公文流转配置----------*/
|
/**
|
* 获取公文流转信息
|
* documentPR#listDocumentNode 查询登录人的工单申请列表
|
*
|
* @param param
|
*/
|
@DataProvider
|
public List<Document> listDocumentNode(Map<String, Object> param) {
|
return hDocumentService.listDocumentNode(param);
|
}
|
|
/**
|
* 更新公文信息
|
* documentPR#saveDocumentNode
|
*
|
* @param data
|
*/
|
@DataResolver
|
public void saveDocumentNode(DocumentNode data) {
|
hDocumentService.saveDocumentNode(data);
|
}
|
|
/**
|
* 删除公文信息
|
* documentPR#delDocumentNode
|
* @param data
|
* @return
|
*/
|
@Expose
|
public String delDocumentNode(DocumentNode data) {
|
hDocumentService.delDocumentNode(data);
|
return null;
|
}
|
|
/*-----------------公文流转申请相关----------------*/
|
|
/**
|
* 获取公文流转信息
|
* documentPR#listDocument 查询登录人的工单申请列表
|
*
|
* @param param
|
*/
|
@DataProvider
|
public List<Document> listDocument(Map<String, Object> param) {
|
|
return hDocumentService.listDocument(param);
|
}
|
|
/**
|
* 更新公文信息
|
* documentPR#saveDocument
|
*
|
* @param data
|
*/
|
@DataResolver
|
public void saveDocument(Document data) {
|
//保存数据到数据库
|
String orderId = hDocumentService.saveDocument(data);
|
|
// 附件
|
List<FileInfo> files = data.getFiles();
|
fileService.saveFiles(files, orderId,null);
|
}
|
|
/**
|
* 删除公文信息
|
* documentPR#delDocument
|
* @param data
|
* @return
|
*/
|
@Expose
|
public String delDocument(Document data) {
|
|
return hDocumentService.delDocument(data);
|
}
|
|
/*-----------------公文流转审核----------------*/
|
/**
|
* documentPR#listAuditDocument
|
*
|
* @param param
|
*/
|
@DataProvider
|
public List<Document> listAuditDocument(Map<String, Object> param) {
|
return hDocumentService.listAuditDocument(param);
|
}
|
|
/**
|
* 审核通过
|
* documentPR#passDocument
|
*
|
* @param data
|
* @return
|
*/
|
@Expose
|
public void passDocument(Document data) {
|
//设置通过状态
|
data.setStatus(OrderStatus.Status_20.getCode());
|
|
|
hDocumentService.auditApplyOrder(data);
|
}
|
|
/**
|
* 审核拒绝
|
* documentPR#rejectDocument
|
*
|
* @param data
|
* @return
|
*/
|
@Expose
|
public void rejectDocument(Document data) {
|
//设置拒绝状态
|
data.setStatus(OrderStatus.Status_30.getCode());
|
|
hDocumentService.auditApplyOrder(data);
|
}
|
|
/**
|
* 审核退回
|
* documentPR#rejectDocument
|
* *
|
* @param data
|
* @return
|
*/
|
@Expose
|
public void backDocument(Document data) {
|
//设置退回状态
|
data.setStatus(OrderStatus.Status_40.getCode());
|
|
hDocumentService.auditApplyOrder(data);
|
}
|
}
|