Commit 9a6cb81f authored by wangqiang's avatar wangqiang

记录行动项实际完成时间,任务启动时间、任务启动人

parent cae43939
...@@ -179,7 +179,7 @@ public class Constants { ...@@ -179,7 +179,7 @@ public class Constants {
*/ */
public static final String COMPLETED = "completed"; public static final String COMPLETED = "completed";
/** /**
* 已完成 * 已完成 --4.0
*/ */
public static final String COMPLETE = "Complete"; public static final String COMPLETE = "Complete";
...@@ -402,6 +402,10 @@ public class Constants { ...@@ -402,6 +402,10 @@ public class Constants {
* 已答复 * 已答复
*/ */
public static final String ANSWERED = "answered"; public static final String ANSWERED = "answered";
/**
* 进行中
*/
public static final String INPROGRESS = "InProgress";
/** /**
* 状态:信息收集中 * 状态:信息收集中
......
...@@ -15,6 +15,8 @@ import com.yonde.dex.basedata.entity.api.ApiResult; ...@@ -15,6 +15,8 @@ import com.yonde.dex.basedata.entity.api.ApiResult;
import com.yonde.dex.basedata.entity.data.DxPageImpl; import com.yonde.dex.basedata.entity.data.DxPageImpl;
import com.yonde.dex.basedata.entity.vo.IdVO; import com.yonde.dex.basedata.entity.vo.IdVO;
import com.yonde.dex.basedata.exception.DxBusinessException; import com.yonde.dex.basedata.exception.DxBusinessException;
import com.yonde.dex.dao.events.DaoBasePluginEvent;
import com.yonde.dex.dao.service.DxDaoPluginExpander;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -22,6 +24,9 @@ import org.springframework.stereotype.Service; ...@@ -22,6 +24,9 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.Collection;
import java.util.List; import java.util.List;
/** /**
...@@ -32,7 +37,7 @@ import java.util.List; ...@@ -32,7 +37,7 @@ import java.util.List;
**/ **/
@Slf4j @Slf4j
@Service(ExtActionItemServiceImpl.BEAN_NAME) @Service(ExtActionItemServiceImpl.BEAN_NAME)
public class ExtActionItemServiceImpl<V extends ExtActionItemVO> implements ExtActionItemService<V> { public class ExtActionItemServiceImpl<V extends ExtActionItemVO> implements ExtActionItemService<V>,DxDaoPluginExpander<V> {
public static final String BEAN_NAME = "extActionItemServiceImpl"; public static final String BEAN_NAME = "extActionItemServiceImpl";
...@@ -46,9 +51,9 @@ public class ExtActionItemServiceImpl<V extends ExtActionItemVO> implements ExtA ...@@ -46,9 +51,9 @@ public class ExtActionItemServiceImpl<V extends ExtActionItemVO> implements ExtA
@Override @Override
public String changeQRStateWhenAllActionItemIsDone(ExtActionItemVO extActionItemVO) { public String changeQRStateWhenAllActionItemIsDone(ExtActionItemVO extActionItemVO) {
//行动项所有是否已完成标识符
Boolean allActionItemIsCompleteFlag = false; Boolean allActionItemIsCompleteFlag = false;
//根据行动项id查询季报 //根据行动项id查询季报
SearchQueryCondition query = SearchQueryCondition.builder() SearchQueryCondition query = SearchQueryCondition.builder()
.openProp(SearchQueryCondition.builder().name("extQuarterlyReport") .openProp(SearchQueryCondition.builder().name("extQuarterlyReport")
...@@ -69,6 +74,21 @@ public class ExtActionItemServiceImpl<V extends ExtActionItemVO> implements ExtA ...@@ -69,6 +74,21 @@ public class ExtActionItemServiceImpl<V extends ExtActionItemVO> implements ExtA
return ApiResult.SUCCESS; return ApiResult.SUCCESS;
} }
/**
* 在状态已完成时,设置一下实际完成时间
* @param target
* @param origin
*/
@Override
public void beforeUpdate(Collection<V> target, Collection<V> origin) {
//在状态已完成时,设置一下实际完成时间
for (V v : target) {
if (Constants.COMPLETE.equals(v.getState())) {
// 设置已完成时间
v.setRealCompleteTime(LocalDateTime.now());
}
}
}
} }
...@@ -9,6 +9,7 @@ import com.yonde.dcs.plan.common.utils.SearchUtil; ...@@ -9,6 +9,7 @@ import com.yonde.dcs.plan.common.utils.SearchUtil;
import com.yonde.dcs.plan.common.vo.ExtActionItemVO; import com.yonde.dcs.plan.common.vo.ExtActionItemVO;
import com.yonde.dcs.plan.common.vo.ExtQuarterlyReportVO; import com.yonde.dcs.plan.common.vo.ExtQuarterlyReportVO;
import com.yonde.dcs.plan.core.repository.ExtQuarterlyReportRepository; import com.yonde.dcs.plan.core.repository.ExtQuarterlyReportRepository;
import com.yonde.dcs.plan.core.service.ExtActionItemService;
import com.yonde.dcs.plan.core.service.ExtQuarterlyReportService; import com.yonde.dcs.plan.core.service.ExtQuarterlyReportService;
import com.yonde.dcs.plan.entity.po.ExtQuarterlyReport; import com.yonde.dcs.plan.entity.po.ExtQuarterlyReport;
import com.yonde.dex.basedata.data.search.SearchItem; import com.yonde.dex.basedata.data.search.SearchItem;
...@@ -53,6 +54,8 @@ public class ExtQuarterlyReportServiceImpl<V extends ExtQuarterlyReportVO> imple ...@@ -53,6 +54,8 @@ public class ExtQuarterlyReportServiceImpl<V extends ExtQuarterlyReportVO> imple
@Autowired @Autowired
ExtQuarterlyReportRepository<ExtQuarterlyReport> extQuarterlyReportRepository; ExtQuarterlyReportRepository<ExtQuarterlyReport> extQuarterlyReportRepository;
@Autowired
private ExtActionItemService extActionItemService;
@Autowired @Autowired
private FileManagerFeignService fileManagerService; private FileManagerFeignService fileManagerService;
...@@ -122,10 +125,15 @@ public class ExtQuarterlyReportServiceImpl<V extends ExtQuarterlyReportVO> imple ...@@ -122,10 +125,15 @@ public class ExtQuarterlyReportServiceImpl<V extends ExtQuarterlyReportVO> imple
} }
//批量启动行动项工作流 //批量启动行动项工作流
for (ExtActionItemVO extActionItemVO : extQuarterlyReportVO.getExtActionItems()) { for (ExtActionItemVO extActionItemVO : extQuarterlyReportVO.getExtActionItems()) {
//更新行动项状态(进行中) --未发送--进行中--审核中---已完成
//任务启动时间 //任务启动时间
extActionItemVO.setTaskReleaseDate(LocalDateTime.now()); extActionItemVO.setTaskReleaseDate(LocalDateTime.now());
//任务发布人 //任务发布人
extActionItemVO.setTaskReleasePersonId(userHelper.getCurrentUser().getUserId()); extActionItemVO.setTaskReleasePersonId(userHelper.getCurrentUser().getUserId());
//设置状态未“进行中”
extActionItemVO.setState(Constants.INPROGRESS);
extActionItemService.update(extActionItemVO);
//启动行动项工作流
wfcProcessFeign.startProcessByKey("ExtActionItemWF", extActionItemVO); wfcProcessFeign.startProcessByKey("ExtActionItemWF", extActionItemVO);
} }
//修改季报的状态未信息收集中 //修改季报的状态未信息收集中
......
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