|
@@ -1,12 +1,12 @@
|
|
|
package com.ozs.web.controller.plan;
|
|
|
|
|
|
-import com.github.pagehelper.PageInfo;
|
|
|
import com.ozs.common.annotation.Log;
|
|
|
import com.ozs.common.constant.ModularConstans;
|
|
|
import com.ozs.common.core.controller.BaseController;
|
|
|
import com.ozs.common.core.domain.AjaxResult;
|
|
|
import com.ozs.common.core.domain.model.LoginUser;
|
|
|
import com.ozs.common.enums.BusinessType;
|
|
|
+import com.ozs.common.enums.SysFileRefEnum;
|
|
|
import com.ozs.common.exception.ServiceException;
|
|
|
import com.ozs.common.utils.StringUtils;
|
|
|
import com.ozs.common.utils.file.FileUtils;
|
|
@@ -17,13 +17,16 @@ import com.ozs.plan.doman.vo.requestVo.ProvisionalPlanVo;
|
|
|
import com.ozs.plan.service.PlanQuarterService;
|
|
|
import com.ozs.plan.service.ProvisionalPlanService;
|
|
|
import com.ozs.plan.service.impl.PlanQuarterServiceImpl;
|
|
|
+import com.ozs.system.domain.SysFileRef;
|
|
|
import com.ozs.system.service.ISysDeptService;
|
|
|
+import com.ozs.system.service.SysFileRefService;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.http.MediaType;
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
+import org.springframework.util.ObjectUtils;
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
@@ -63,6 +66,8 @@ public class ProvisionalPlanController extends BaseController {
|
|
|
private ISysDeptService iSysDeptService;
|
|
|
@Autowired
|
|
|
private PlanQuarterServiceImpl planQuarterServiceImpl;
|
|
|
+ @Autowired
|
|
|
+ private SysFileRefService sysFileRefService;
|
|
|
|
|
|
@ApiOperation(value = "新增临时计划")
|
|
|
@PostMapping("/insertProvisionalPlan")
|
|
@@ -79,6 +84,18 @@ public class ProvisionalPlanController extends BaseController {
|
|
|
// 项目状态(0:计划待提交,1:计划待审核,2:计划已退回,3:计划已审核)
|
|
|
provisionalPlan.setProjectStatus("0");
|
|
|
provisionalPlan.setIsExcess(iSysDeptService.isExcessOrNo(provisionalPlan.getProjectType(), provisionalPlan.getEvaluation(), Long.valueOf(provisionalPlan.getPurchaseDeptId())));
|
|
|
+ List<SysFileRef> sysFileRefs = provisionalPlan.getSysFileRefs();
|
|
|
+ if (!ObjectUtils.isEmpty(sysFileRefs)) {
|
|
|
+ for (SysFileRef ref : sysFileRefs) {
|
|
|
+ ref.setRedId(provisionalPlan.getPlanPracticalId());
|
|
|
+ ref.setType(SysFileRefEnum.PLAN_TEMPORARY.getType());
|
|
|
+ ref.setCreated(provisionalPlan.getCreated());
|
|
|
+ ref.setCreateTime(new Date());
|
|
|
+ ref.setUpdated(provisionalPlan.getCreated());
|
|
|
+ ref.setUpdateTime(new Date());
|
|
|
+ sysFileRefService.save(ref);
|
|
|
+ }
|
|
|
+ }
|
|
|
return toAjax(provisionalPlanService.save(provisionalPlan));
|
|
|
}
|
|
|
|