|
@@ -6,21 +6,28 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.github.pagehelper.PageHelper;
|
|
|
import com.github.pagehelper.PageInfo;
|
|
|
+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.ProjectStatus;
|
|
|
import com.ozs.common.enums.ProjectTypes;
|
|
|
+import com.ozs.common.enums.SysFileRefEnum;
|
|
|
import com.ozs.common.exception.ServiceException;
|
|
|
import com.ozs.common.utils.StringUtils;
|
|
|
+import com.ozs.common.utils.bean.BeanUtils;
|
|
|
+import com.ozs.plan.doman.PlanQuarter;
|
|
|
import com.ozs.plan.doman.PlanYears;
|
|
|
import com.ozs.plan.doman.ProvisionalPlan;
|
|
|
+import com.ozs.plan.doman.vo.requestVo.PlanQuarterStandardVo;
|
|
|
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.system.domain.SysFileRef;
|
|
|
import com.ozs.system.domain.vo.responseVo.SysDeptResponseVo;
|
|
|
import com.ozs.system.mapper.SysDeptMapper;
|
|
|
+import com.ozs.system.mapper.SysFileRefMapper;
|
|
|
import com.ozs.system.service.ISysDeptService;
|
|
|
import com.ozs.system.service.ISysDictTypeService;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -41,6 +48,10 @@ public class ProvisionalPlanServiceImpl extends ServiceImpl<ProvisionalPlanMappe
|
|
|
private SysDeptMapper deptMapper;
|
|
|
@Autowired
|
|
|
private ISysDeptService deptService;
|
|
|
+ @Autowired
|
|
|
+ private PlanYearsMapper planYearsMapper;
|
|
|
+ @Autowired
|
|
|
+ private SysFileRefMapper sysFileRefMapper;
|
|
|
|
|
|
@Override
|
|
|
public int deleteProvisionalPlanById(Integer planYearId) {
|
|
@@ -178,6 +189,57 @@ public class ProvisionalPlanServiceImpl extends ServiceImpl<ProvisionalPlanMappe
|
|
|
return pageInfo;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public PageInfo<ProvisionalPlan> selectProvisionalPlanAudit(ProvisionalPlanVo provisionalPlanVo) {
|
|
|
+ List<ProvisionalPlan> provisionalPlanList = provisionalPlanMapper.selectProvisionalPlanAudit(provisionalPlanVo);
|
|
|
+ provisionalPlanList = changeTo(provisionalPlanList);
|
|
|
+ PageHelper.startPage(provisionalPlanVo.getPageNum().intValue(), provisionalPlanVo.getPageSize().intValue());
|
|
|
+ PageInfo<ProvisionalPlan> pageInfo = new PageInfo<>(provisionalPlanList);
|
|
|
+ return pageInfo;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public AjaxResult auditPass(ProvisionalPlanVo provisionalPlanVo) {
|
|
|
+ ProvisionalPlan byId = provisionalPlanMapper.seletById(provisionalPlanVo.getPlanPracticalId());
|
|
|
+ if (ObjectUtils.isEmpty(byId.getPlanYearId())) {
|
|
|
+ PlanYears ofYears = new PlanYears();
|
|
|
+ BeanUtils.copyProperties(provisionalPlanVo, ofYears);
|
|
|
+ planYearsMapper.insertPlanYears(ofYears);
|
|
|
+ Long planYearId = ofYears.getPlanYearId();
|
|
|
+ byId.setPlanYearId(ofYears.getPlanYearId().intValue());
|
|
|
+ }
|
|
|
+ byId.setProjectStatus(ProjectStatus.PLANTOEXAMINE.getCode());
|
|
|
+ return review(provisionalPlanVo, byId);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public AjaxResult auditNoPass(ProvisionalPlanVo provisionalPlanVo) {
|
|
|
+ ProvisionalPlan provisionalPlan = new ProvisionalPlan();
|
|
|
+ BeanUtils.copyProperties(provisionalPlanVo, provisionalPlan);
|
|
|
+ provisionalPlan.setProjectStatus(ProjectStatus.PLANTOBACK.getCode());
|
|
|
+ return review(provisionalPlanVo, provisionalPlan);
|
|
|
+ }
|
|
|
+
|
|
|
+ private AjaxResult review(ProvisionalPlanVo vo, ProvisionalPlan provisionalPlan) {
|
|
|
+ List<SysFileRef> sysFileRefs = vo.getSysFileRefs();
|
|
|
+ if (!ObjectUtils.isEmpty(sysFileRefs)) {
|
|
|
+ for (SysFileRef ref : sysFileRefs) {
|
|
|
+ ref.setRedId(vo.getPlanPracticalId().longValue());
|
|
|
+ ref.setType(SysFileRefEnum.PLAN_TEMPORARY.getType());
|
|
|
+ ref.setCreated(vo.getUpdated());
|
|
|
+ ref.setCreateTime(new Date());
|
|
|
+ ref.setUpdated(vo.getUpdated());
|
|
|
+ ref.setUpdateTime(new Date());
|
|
|
+ sysFileRefMapper.insert(ref);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ int review = provisionalPlanMapper.review(provisionalPlan);
|
|
|
+ if (review != 1) {
|
|
|
+ return AjaxResult.error("项目状态数据异常");
|
|
|
+ }
|
|
|
+ return AjaxResult.success();
|
|
|
+ }
|
|
|
+
|
|
|
//判断是否为超额计划
|
|
|
public String isExcessOrNo(String projectType, BigDecimal evaluation) {
|
|
|
BigDecimal threshold = new BigDecimal(0);
|