|
@@ -14,11 +14,14 @@ import com.ozs.common.utils.StringUtils;
|
|
|
import com.ozs.home.domain.HomeNotice;
|
|
|
import com.ozs.home.domain.vo.HomeNoticeVo;
|
|
|
import com.ozs.home.service.HomeNoticeService;
|
|
|
+import com.ozs.plan.doman.PlanQuarter;
|
|
|
import com.ozs.plan.doman.PlanYears;
|
|
|
import com.ozs.plan.doman.vo.requestVo.PlanYearsStandardVo;
|
|
|
+import com.ozs.plan.service.PlanQuarterService;
|
|
|
import com.ozs.plan.service.PlanYearsService;
|
|
|
import com.ozs.pm.doman.PmDemand;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
+import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
import org.springframework.util.ObjectUtils;
|
|
@@ -47,6 +50,8 @@ public class HomeNoticeController extends BaseController {
|
|
|
private HomeNoticeService homeNoticeService;
|
|
|
@Autowired
|
|
|
private PlanYearsService planYearsService;
|
|
|
+ @Autowired
|
|
|
+ private PlanQuarterService planQuarterService;
|
|
|
|
|
|
@ApiOperation(value = "查询首页公告")
|
|
|
@PostMapping("/selectHomeNotice")
|
|
@@ -88,14 +93,30 @@ public class HomeNoticeController extends BaseController {
|
|
|
}
|
|
|
}
|
|
|
List<PlanYears> list = planYearsService.list(lw);
|
|
|
- return AjaxResult.success(list);
|
|
|
+ //项目搜索的结果中要包含临时计划
|
|
|
+ LambdaQueryWrapper<PlanQuarter> ls = new LambdaQueryWrapper<PlanQuarter>();
|
|
|
+ if (!StringUtils.isBlank(yearsStandardVo.getProjectName())) {
|
|
|
+ ls.like(PlanQuarter::getProjectName, "%" + yearsStandardVo.getProjectName() + "%");
|
|
|
+ ls.eq(PlanQuarter::getDelFlay, 0);
|
|
|
+ ls.eq(PlanQuarter::getPlanType, 1);
|
|
|
+ if (!SysUser.isAdmin(SecurityUtils.getUserId())) {
|
|
|
+ ls.eq(PlanQuarter::getPurchaseDeptId, SecurityUtils.getDeptId());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ List<PlanQuarter> lists = planQuarterService.list(ls);
|
|
|
+ for (PlanYears year : list) {
|
|
|
+ PlanQuarter quarter = new PlanQuarter();
|
|
|
+ BeanUtils.copyProperties(year, quarter);
|
|
|
+ lists.add(quarter);
|
|
|
+ }
|
|
|
+ return AjaxResult.success(lists);
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "搜索项目--选择项目查看详情")
|
|
|
@PostMapping("/projectDetails")
|
|
|
public AjaxResult projectDetails(@RequestBody PlanYearsStandardVo yearsStandardVo) {
|
|
|
if (StringUtils.isNull(yearsStandardVo.getPlanYearId())) {
|
|
|
- return error("查询年度ID不能为空!");
|
|
|
+ return error("项目ID不能为空!");
|
|
|
}
|
|
|
return planYearsService.projectDetails(yearsStandardVo);
|
|
|
}
|