日志翻译
This commit is contained in:
@@ -4,6 +4,7 @@ import com.alibaba.excel.EasyExcel;
|
|||||||
import com.alibaba.excel.write.style.column.LongestMatchColumnWidthStyleStrategy;
|
import com.alibaba.excel.write.style.column.LongestMatchColumnWidthStyleStrategy;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.nbport.zgwl.common.PageResult;
|
import com.nbport.zgwl.common.PageResult;
|
||||||
|
import com.nbport.zgwl.contractlaunch.utils.ContractLaunchConstants;
|
||||||
import com.nbport.zgwl.contractlog.dto.ContractLogDto;
|
import com.nbport.zgwl.contractlog.dto.ContractLogDto;
|
||||||
import com.nbport.zgwl.contractlog.dto.ContractLogQueryDto;
|
import com.nbport.zgwl.contractlog.dto.ContractLogQueryDto;
|
||||||
import com.nbport.zgwl.contractlog.mapper.ContractLogMapper;
|
import com.nbport.zgwl.contractlog.mapper.ContractLogMapper;
|
||||||
@@ -12,11 +13,53 @@ import org.springframework.stereotype.Service;
|
|||||||
|
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
public class ContractLogServiceImpl implements ContractLogService {
|
public class ContractLogServiceImpl implements ContractLogService {
|
||||||
|
|
||||||
|
private static final Map<String, String> STATUS_LABEL_MAP = Map.ofEntries(
|
||||||
|
Map.entry(ContractLaunchConstants.STATUS_DRAFT, "草稿"),
|
||||||
|
Map.entry(ContractLaunchConstants.STATUS_REVIEWING, "审批中"),
|
||||||
|
Map.entry(ContractLaunchConstants.STATUS_REJECTED, "审批驳回"),
|
||||||
|
Map.entry(ContractLaunchConstants.STATUS_PENDING_SIGN, "待签署"),
|
||||||
|
Map.entry(ContractLaunchConstants.STATUS_SIGNING, "签署中"),
|
||||||
|
Map.entry(ContractLaunchConstants.STATUS_PENDING_COLLECT, "待采集"),
|
||||||
|
Map.entry(ContractLaunchConstants.STATUS_PENDING_ARCHIVE, "待归档"),
|
||||||
|
Map.entry(ContractLaunchConstants.STATUS_COMPLETED, "已完成"),
|
||||||
|
Map.entry(ContractLaunchConstants.STATUS_TERMINATED, "已终止")
|
||||||
|
);
|
||||||
|
|
||||||
|
private static final Map<String, String> ACTION_TYPE_LABEL_MAP = Map.ofEntries(
|
||||||
|
Map.entry(ContractLaunchConstants.ACTION_SAVE, "保存"),
|
||||||
|
Map.entry(ContractLaunchConstants.ACTION_COPY, "复制"),
|
||||||
|
Map.entry(ContractLaunchConstants.ACTION_CHANGE, "变更"),
|
||||||
|
Map.entry(ContractLaunchConstants.ACTION_SUBMIT, "提交法务"),
|
||||||
|
Map.entry(ContractLaunchConstants.ACTION_APPROVE, "审批通过"),
|
||||||
|
Map.entry(ContractLaunchConstants.ACTION_REJECT, "审批驳回"),
|
||||||
|
Map.entry(ContractLaunchConstants.ACTION_SEAL_START, "开始签署"),
|
||||||
|
Map.entry(ContractLaunchConstants.ACTION_SEAL_FINISH, "签署完成"),
|
||||||
|
Map.entry(ContractLaunchConstants.ACTION_COLLECT, "合同采集"),
|
||||||
|
Map.entry(ContractLaunchConstants.ACTION_ARCHIVE, "合同归档"),
|
||||||
|
Map.entry(ContractLaunchConstants.ACTION_DELETE, "删除合同"),
|
||||||
|
Map.entry(ContractLaunchConstants.ACTION_TERMINATE, "终止合同"),
|
||||||
|
Map.entry(ContractLaunchConstants.ACTION_SEAL_CREATE, "创建签署流程"),
|
||||||
|
Map.entry(ContractLaunchConstants.ACTION_SEAL_SIGN, "签署确认"),
|
||||||
|
Map.entry(ContractLaunchConstants.ACTION_SEAL_COMPLETE, "签署流程完结"),
|
||||||
|
Map.entry(ContractLaunchConstants.ACTION_SEAL_CANCEL, "取消签署"),
|
||||||
|
Map.entry(ContractLaunchConstants.ACTION_SEAL_TIMESTAMP, "时间戳签章"),
|
||||||
|
Map.entry(ContractLaunchConstants.ACTION_SEAL_COMMENT, "批注签章"),
|
||||||
|
Map.entry(ContractLaunchConstants.ACTION_SEAL_CALLBACK, "签章回调通知"),
|
||||||
|
Map.entry(ContractLaunchConstants.ACTION_SEAL_UPLOAD, "上传线下签署文件")
|
||||||
|
);
|
||||||
|
|
||||||
|
private static final Map<String, String> ACTION_STATUS_LABEL_MAP = Map.of(
|
||||||
|
ContractLaunchConstants.ACTION_STATUS_SUCCESS, "成功",
|
||||||
|
ContractLaunchConstants.ACTION_STATUS_FAILED, "失败",
|
||||||
|
ContractLaunchConstants.ACTION_STATUS_PENDING, "处理中"
|
||||||
|
);
|
||||||
|
|
||||||
private final ContractLogMapper contractLogMapper;
|
private final ContractLogMapper contractLogMapper;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -34,6 +77,11 @@ public class ContractLogServiceImpl implements ContractLogService {
|
|||||||
@Override
|
@Override
|
||||||
public byte[] exportExcel(ContractLogQueryDto queryDto) {
|
public byte[] exportExcel(ContractLogQueryDto queryDto) {
|
||||||
List<ContractLogDto> list = queryList(queryDto);
|
List<ContractLogDto> list = queryList(queryDto);
|
||||||
|
list.forEach(dto -> {
|
||||||
|
dto.setContractStatus(STATUS_LABEL_MAP.getOrDefault(dto.getContractStatus(), dto.getContractStatus()));
|
||||||
|
dto.setActionType(ACTION_TYPE_LABEL_MAP.getOrDefault(dto.getActionType(), dto.getActionType()));
|
||||||
|
dto.setActionStatus(ACTION_STATUS_LABEL_MAP.getOrDefault(dto.getActionStatus(), dto.getActionStatus()));
|
||||||
|
});
|
||||||
try (ByteArrayOutputStream outputStream = new ByteArrayOutputStream()) {
|
try (ByteArrayOutputStream outputStream = new ByteArrayOutputStream()) {
|
||||||
EasyExcel.write(outputStream, ContractLogDto.class)
|
EasyExcel.write(outputStream, ContractLogDto.class)
|
||||||
.registerWriteHandler(new LongestMatchColumnWidthStyleStrategy())
|
.registerWriteHandler(new LongestMatchColumnWidthStyleStrategy())
|
||||||
|
|||||||
Reference in New Issue
Block a user