|
@@ -13,6 +13,7 @@ import com.ozs.common.utils.SecurityUtils;
|
|
import com.ozs.common.utils.StringUtils;
|
|
import com.ozs.common.utils.StringUtils;
|
|
import com.ozs.home.domain.HomeNotice;
|
|
import com.ozs.home.domain.HomeNotice;
|
|
import com.ozs.home.domain.vo.HomeNoticeVo;
|
|
import com.ozs.home.domain.vo.HomeNoticeVo;
|
|
|
|
+import com.ozs.home.domain.vo.HomeToDoQueryResVo;
|
|
import com.ozs.home.service.HomeNoticeService;
|
|
import com.ozs.home.service.HomeNoticeService;
|
|
import com.ozs.plan.doman.PlanQuarter;
|
|
import com.ozs.plan.doman.PlanQuarter;
|
|
import com.ozs.plan.doman.PlanYears;
|
|
import com.ozs.plan.doman.PlanYears;
|
|
@@ -20,6 +21,8 @@ import com.ozs.plan.doman.vo.requestVo.PlanYearsStandardVo;
|
|
import com.ozs.plan.service.PlanQuarterService;
|
|
import com.ozs.plan.service.PlanQuarterService;
|
|
import com.ozs.plan.service.PlanYearsService;
|
|
import com.ozs.plan.service.PlanYearsService;
|
|
import com.ozs.pm.doman.PmDemand;
|
|
import com.ozs.pm.doman.PmDemand;
|
|
|
|
+import com.ozs.pm.doman.PmDemandExpertRef;
|
|
|
|
+import com.ozs.pm.service.IPmDemandService;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import org.springframework.beans.BeanUtils;
|
|
import org.springframework.beans.BeanUtils;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -52,6 +55,8 @@ public class HomeNoticeController extends BaseController {
|
|
private PlanYearsService planYearsService;
|
|
private PlanYearsService planYearsService;
|
|
@Autowired
|
|
@Autowired
|
|
private PlanQuarterService planQuarterService;
|
|
private PlanQuarterService planQuarterService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private IPmDemandService demandService;
|
|
|
|
|
|
@ApiOperation(value = "查询首页公告")
|
|
@ApiOperation(value = "查询首页公告")
|
|
@PostMapping("/selectHomeNotice")
|
|
@PostMapping("/selectHomeNotice")
|
|
@@ -81,44 +86,51 @@ public class HomeNoticeController extends BaseController {
|
|
@ApiOperation(value = "搜索项目列表")
|
|
@ApiOperation(value = "搜索项目列表")
|
|
@PostMapping("/listPlanYears")
|
|
@PostMapping("/listPlanYears")
|
|
public AjaxResult listPlanYears(@RequestBody PlanYearsStandardVo yearsStandardVo) {
|
|
public AjaxResult listPlanYears(@RequestBody PlanYearsStandardVo yearsStandardVo) {
|
|
- if (StringUtils.isNull(yearsStandardVo.getProjectName())) {
|
|
|
|
|
|
+ if (ObjectUtils.isEmpty(yearsStandardVo.getProjectName())) {
|
|
return error("查询项目名称不能为空!");
|
|
return error("查询项目名称不能为空!");
|
|
}
|
|
}
|
|
LambdaQueryWrapper<PlanYears> lw = new LambdaQueryWrapper<PlanYears>();
|
|
LambdaQueryWrapper<PlanYears> lw = new LambdaQueryWrapper<PlanYears>();
|
|
- if (!StringUtils.isBlank(yearsStandardVo.getProjectName())) {
|
|
|
|
- lw.like(PlanYears::getProjectName, "%" + yearsStandardVo.getProjectName() + "%");
|
|
|
|
- lw.eq(PlanYears::getDelFlay, 0);
|
|
|
|
- if (!SysUser.isAdmin(SecurityUtils.getUserId())) {
|
|
|
|
- lw.eq(PlanYears::getPurchaseDeptId, SecurityUtils.getDeptId());
|
|
|
|
|
|
+ lw.like(PlanYears::getProjectName, "%" + yearsStandardVo.getProjectName() + "%");
|
|
|
|
+ lw.eq(PlanYears::getDelFlay, 0);
|
|
|
|
+ if (!SysUser.isAdmin(SecurityUtils.getUserId())) {
|
|
|
|
+ //查出不在季度计划表中的id
|
|
|
|
+ List<Integer> ids = planYearsService.idNotInQuarter();
|
|
|
|
+ if (ObjectUtils.isEmpty(ids)) {
|
|
|
|
+ lw.in(PlanYears::getPlanYearId, ids);
|
|
}
|
|
}
|
|
|
|
+ lw.eq(PlanYears::getPurchaseDeptId, SecurityUtils.getDeptId());
|
|
}
|
|
}
|
|
- //如果年度计划已添加到季度计划,或临时计划同步到年度计划,就不展示年度计划数据
|
|
|
|
List<PlanYears> list = planYearsService.list(lw);
|
|
List<PlanYears> list = planYearsService.list(lw);
|
|
- for (PlanYears years : list) {
|
|
|
|
- LambdaQueryWrapper<PlanQuarter> qw = new LambdaQueryWrapper<>();
|
|
|
|
- qw.eq(PlanQuarter::getPlanYearId, years.getPlanYearId());
|
|
|
|
- if (planQuarterService.count(qw) > 1) {
|
|
|
|
- list.remove(years);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
|
|
- //项目搜索的结果中要包含临时计划
|
|
|
|
|
|
+ //项目搜索的结果中要包含季度、临时计划(过滤掉已同步到项目管理的临时、季度计划)
|
|
LambdaQueryWrapper<PlanQuarter> ls = new LambdaQueryWrapper<PlanQuarter>();
|
|
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());
|
|
|
|
|
|
+ ls.like(PlanQuarter::getProjectName, "%" + yearsStandardVo.getProjectName() + "%");
|
|
|
|
+ ls.eq(PlanQuarter::getDelFlay, 0);
|
|
|
|
+ if (!SysUser.isAdmin(SecurityUtils.getUserId())) {
|
|
|
|
+ //查出不在项目表中的季度、临时id
|
|
|
|
+ List<Integer> ids = planQuarterService.idNotDemand();
|
|
|
|
+ if (ObjectUtils.isEmpty(ids)) {
|
|
|
|
+ ls.in(PlanQuarter::getPlanPracticalId, ids);
|
|
}
|
|
}
|
|
|
|
+ ls.eq(PlanQuarter::getPurchaseDeptId, SecurityUtils.getDeptId());
|
|
}
|
|
}
|
|
List<PlanQuarter> lists = planQuarterService.list(ls);
|
|
List<PlanQuarter> lists = planQuarterService.list(ls);
|
|
|
|
+ //年度计划融合季度、临时计划
|
|
for (PlanYears year : list) {
|
|
for (PlanYears year : list) {
|
|
PlanQuarter quarter = new PlanQuarter();
|
|
PlanQuarter quarter = new PlanQuarter();
|
|
BeanUtils.copyProperties(year, quarter);
|
|
BeanUtils.copyProperties(year, quarter);
|
|
lists.add(quarter);
|
|
lists.add(quarter);
|
|
}
|
|
}
|
|
- return AjaxResult.success(lists);
|
|
|
|
|
|
+ //查询项目信息,
|
|
|
|
+ LambdaQueryWrapper<PmDemand> lq = new LambdaQueryWrapper<PmDemand>();
|
|
|
|
+ lq.like(PmDemand::getProjectName, "%" + yearsStandardVo.getProjectName() + "%");
|
|
|
|
+ if (!SysUser.isAdmin(SecurityUtils.getUserId())) {
|
|
|
|
+ lq.eq(PmDemand::getPurchaseDeptId, SecurityUtils.getDeptId());
|
|
|
|
+ }
|
|
|
|
+ List<PmDemand> demandList = demandService.list(lq);
|
|
|
|
+ //放在同一个列表里返回
|
|
|
|
+ List<HomeToDoQueryResVo> home = planYearsService.listToHome(lists, demandList);
|
|
|
|
+ return AjaxResult.success(home);
|
|
}
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "搜索项目--选择项目查看详情")
|
|
@ApiOperation(value = "搜索项目--选择项目查看详情")
|