Commit 98579186 authored by wangqiang's avatar wangqiang

季报自定义编码规则

parent bac1ffea
package com.yonde.dcs.plan.core.service.impl;
import cn.hutool.core.util.ZipUtil;
import com.yonde.dcs.document.common.entity.vo.DxDocumentVO;
import com.yonde.dcs.plan.common.constants.Constants;
import com.yonde.dcs.plan.common.utils.FileUtils;
import com.yonde.dcs.plan.common.utils.ResourceHelper;
import com.yonde.dcs.plan.common.utils.SearchUtil;
import com.yonde.dcs.plan.common.vo.ExtActionItemVO;
import com.yonde.dcs.plan.common.vo.ExtQuarterlyReportVO;
import com.yonde.dcs.plan.core.encode.QuarterlyReportEncode;
import com.yonde.dcs.plan.core.repository.ExtQuarterlyReportRepository;
import com.yonde.dcs.plan.core.service.ExtActionItemService;
import com.yonde.dcs.plan.core.service.ExtQuarterlyReportService;
......@@ -16,15 +16,12 @@ import com.yonde.dex.basedata.data.search.SearchItem;
import com.yonde.dex.basedata.data.search.SearchItems;
import com.yonde.dex.basedata.data.search.SearchQueryCondition;
import com.yonde.dex.basedata.entity.api.ApiResult;
import com.yonde.dex.basedata.entity.data.DxPageImpl;
import com.yonde.dex.basedata.entity.data.OperatorType;
import com.yonde.dex.basedata.entity.vo.IdVO;
import com.yonde.dex.basedata.exception.DxBusinessException;
import com.yonde.dex.basedata.users.UserHelper;
import com.yonde.dex.dao.service.DxDaoPluginExpander;
import com.yonde.dex.dfs.feign.FileManagerFeignService;
import com.yonde.dex.dfs.vo.ObjFileLinkVO;
import com.yonde.dex.dfs.vo.view.FileDownLoadInfoVO;
import com.yonde.dex.lcycle.plugin.common.entity.DxLifecycleManageBaseVOHolder;
import com.yonde.dex.wfc.feign.api.WfcProcessFeign;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -39,8 +36,8 @@ import java.io.IOException;
import java.io.InputStream;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.stream.Collectors;
/**
* @description: ExtQuarterlyReport-ServiceImpl
......@@ -50,7 +47,7 @@ import java.util.stream.Collectors;
**/
@Slf4j
@Service(ExtQuarterlyReportServiceImpl.BEAN_NAME)
public class ExtQuarterlyReportServiceImpl<V extends ExtQuarterlyReportVO> implements ExtQuarterlyReportService<V> {
public class ExtQuarterlyReportServiceImpl<V extends ExtQuarterlyReportVO> implements ExtQuarterlyReportService<V>,DxDaoPluginExpander<V> {
public static final String BEAN_NAME = "extQuarterlyReportServiceImpl";
......@@ -67,6 +64,8 @@ public class ExtQuarterlyReportServiceImpl<V extends ExtQuarterlyReportVO> imple
private WfcProcessFeign wfcProcessFeign;
@Autowired
private UserHelper userHelper;
@Autowired
private QuarterlyReportEncode quarterlyReportEncode;
@Override
public void batchDownloadDoc(HttpServletResponse response, Long id) throws IOException {
......@@ -154,11 +153,11 @@ public class ExtQuarterlyReportServiceImpl<V extends ExtQuarterlyReportVO> imple
@Override
public ExtQuarterlyReportVO changeState(Long id) {
ExtQuarterlyReportVO extQuarterlyReportVO = this.get(id);
if(!ObjectUtils.isEmpty(extQuarterlyReportVO)){
wfcProcessFeign.startProcessByKey("ExtQuarterlyReportWF",extQuarterlyReportVO);
if (!ObjectUtils.isEmpty(extQuarterlyReportVO)) {
wfcProcessFeign.startProcessByKey("ExtQuarterlyReportWF", extQuarterlyReportVO);
return this.changeStatus(id, Constants.REVIEWING, true);
}else {
throw new DxBusinessException("-1","根据id:"+id+"查询出的对象是空");
} else {
throw new DxBusinessException("-1", "根据id:" + id + "查询出的对象是空");
}
}
......@@ -190,6 +189,15 @@ public class ExtQuarterlyReportServiceImpl<V extends ExtQuarterlyReportVO> imple
});
}
}
@Override
public void beforeSave(Collection<V> target) {
for (V v : target){
//生成文件编码
String fileNumber = quarterlyReportEncode.generateEncode(v);
v.setFileNumber(fileNumber);
}
}
}
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