|
@@ -10,6 +10,7 @@ import com.ozs.common.core.domain.AjaxResult;
|
|
|
import com.ozs.common.core.domain.entity.SysDept;
|
|
|
import com.ozs.common.core.domain.entity.SysDictData;
|
|
|
import com.ozs.common.core.domain.model.LoginUser;
|
|
|
+import com.ozs.common.enums.PmProjectStatus;
|
|
|
import com.ozs.common.enums.ProjectStatus;
|
|
|
import com.ozs.common.enums.ProjectTypes;
|
|
|
import com.ozs.common.enums.SysFileRefEnum;
|
|
@@ -24,6 +25,8 @@ import com.ozs.plan.doman.vo.requestVo.ProvisionalPlanVo;
|
|
|
import com.ozs.plan.mapper.PlanYearsMapper;
|
|
|
import com.ozs.plan.mapper.ProvisionalPlanMapper;
|
|
|
import com.ozs.plan.service.ProvisionalPlanService;
|
|
|
+import com.ozs.pm.doman.PmDemand;
|
|
|
+import com.ozs.pm.mapper.PmDemandMapper;
|
|
|
import com.ozs.system.domain.SysFileInfo;
|
|
|
import com.ozs.system.domain.SysFileRef;
|
|
|
import com.ozs.system.domain.vo.responseVo.SysDeptResponseVo;
|
|
@@ -56,6 +59,8 @@ public class ProvisionalPlanServiceImpl extends ServiceImpl<ProvisionalPlanMappe
|
|
|
private SysFileRefMapper sysFileRefMapper;
|
|
|
@Autowired
|
|
|
private SysFileService fileService;
|
|
|
+ @Autowired
|
|
|
+ private PmDemandMapper pmDemandMapper;
|
|
|
|
|
|
@Override
|
|
|
public int deleteProvisionalPlanById(Integer planYearId) {
|
|
@@ -226,11 +231,30 @@ public class ProvisionalPlanServiceImpl extends ServiceImpl<ProvisionalPlanMappe
|
|
|
ProvisionalPlan byId = provisionalPlanMapper.seletById(provisionalPlanVo.getPlanPracticalId());
|
|
|
if (ObjectUtils.isEmpty(byId.getPlanYearId())) {
|
|
|
PlanYears ofYears = new PlanYears();
|
|
|
- BeanUtils.copyProperties(provisionalPlanVo, ofYears);
|
|
|
+ BeanUtils.copyProperties(byId, ofYears);
|
|
|
planYearsMapper.insertPlanYears(ofYears);
|
|
|
Long planYearId = ofYears.getPlanYearId();
|
|
|
byId.setPlanYearId(ofYears.getPlanYearId().intValue());
|
|
|
}
|
|
|
+ PmDemand demand = new PmDemand();
|
|
|
+ BeanUtils.copyProperties(byId, demand);
|
|
|
+ demand.setPlanId(Long.valueOf(byId.getPlanPracticalId()));
|
|
|
+ //同步到项目管理状态为需求待填制
|
|
|
+ demand.setProjectStatus(Long.valueOf(PmProjectStatus.DEMAND_WAIT_FILL.getCode()));
|
|
|
+ demand.setCreateTime(new Date());
|
|
|
+ pmDemandMapper.insert(demand);
|
|
|
+ //计划附件也进行同步---查询年度计划附件后复制一份改为项目需求附件
|
|
|
+ LambdaQueryWrapper<SysFileRef> sysFileRefLp = new LambdaQueryWrapper<>();
|
|
|
+ sysFileRefLp.eq(SysFileRef::getType, SysFileRefEnum.PLAN_YEAR.getType());
|
|
|
+ sysFileRefLp.eq(SysFileRef::getRedId, byId.getPlanYearId());
|
|
|
+ List<SysFileRef> sysFileRefs = sysFileRefMapper.selectList(sysFileRefLp);
|
|
|
+ if (!ObjectUtils.isEmpty(sysFileRefs)) {
|
|
|
+ for (SysFileRef ref : sysFileRefs) {
|
|
|
+ ref.setRedId(demand.getDemandId());
|
|
|
+ ref.setType(SysFileRefEnum.PM_DEMAND.getType());
|
|
|
+ sysFileRefMapper.insert(ref);
|
|
|
+ }
|
|
|
+ }
|
|
|
byId.setProjectStatus(ProjectStatus.PLANTOEXAMINE.getCode());
|
|
|
return review(provisionalPlanVo, byId);
|
|
|
}
|