|
@@ -17,7 +17,9 @@ import com.ozs.common.core.controller.BaseController;
|
|
|
import com.ozs.common.core.domain.AjaxResult;
|
|
|
import com.ozs.common.core.domain.entity.SysDictData;
|
|
|
import com.ozs.common.enums.BusinessType;
|
|
|
+import com.ozs.common.enums.PmProjectStatus;
|
|
|
import com.ozs.common.enums.ProjectAttribute;
|
|
|
+import com.ozs.common.enums.ProjectStatus;
|
|
|
import com.ozs.plan.doman.MonthlyReconciliation;
|
|
|
import com.ozs.plan.service.MonthlyReconciliationService;
|
|
|
import com.ozs.system.domain.vo.responseVo.SysDeptResponseVo;
|
|
@@ -36,6 +38,7 @@ import javax.validation.constraints.NotEmpty;
|
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
+import java.util.Optional;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
@@ -220,17 +223,39 @@ public class BaseAgencyController extends BaseController {
|
|
|
@RequestBody BasePolicyPageReqVo vo) {
|
|
|
LambdaQueryWrapper<MonthlyReconciliation> lw = new LambdaQueryWrapper<>();
|
|
|
lw.isNull(MonthlyReconciliation::getAgencyId);
|
|
|
+ lw.eq(MonthlyReconciliation::getProjectStatus, PmProjectStatus.BID_INFO_WAIT_FILL.getCode());
|
|
|
if (!StringUtils.isBlank(vo.getName())) {
|
|
|
lw.like(MonthlyReconciliation::getProjectName, vo.getName());
|
|
|
}
|
|
|
- if (!ObjectUtils.isEmpty(vo.getStartTime())) {
|
|
|
- lw.ge(MonthlyReconciliation::getExtractAgencyTime, vo.getStartTime());
|
|
|
+ return success(monthlyReconciliationService.list(lw));
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @ApiOperation(value = "根据项目名称模糊查询项目信息")
|
|
|
+ @PostMapping("/extract")
|
|
|
+ @PreAuthorize("@ss.hasPermi('base:agency:extract')")
|
|
|
+ @Log(title = ModularConstans.agency, businessType = BusinessType.OTHER)
|
|
|
+ public AjaxResult extract(@NotEmpty(message = "主键id不能为空")
|
|
|
+ @RequestParam(value = "demandId", required = true)
|
|
|
+ @RequestBody Long demandId) {
|
|
|
+ LambdaQueryWrapper<BaseAgency> lw = new LambdaQueryWrapper<>();
|
|
|
+ MonthlyReconciliation byId = monthlyReconciliationService.getById(demandId);
|
|
|
+ if(ObjectUtils.isEmpty(byId)){
|
|
|
+ return error("参数错误");
|
|
|
}
|
|
|
- if (!ObjectUtils.isEmpty(vo.getStartTime())) {
|
|
|
- lw.le(MonthlyReconciliation::getExtractAgencyTime, vo.getEntTime());
|
|
|
+ byId.setExtractAgencyTime(new Date());
|
|
|
+ lw.eq(BaseAgency::getCompanyType,byId.getProjectType());
|
|
|
+ lw.eq(BaseAgency::getStatus,0);
|
|
|
+ Optional<BaseAgency> any = baseAgencyService.list(lw).stream().findAny();
|
|
|
+ if(ObjectUtils.isEmpty(any)){
|
|
|
+ return error("没有符合的招标代理机构,抽取失败!");
|
|
|
}
|
|
|
+ byId.setAgencyId(any.get().getId());
|
|
|
+ byId.setUpdateTime(byId.getExtractAgencyTime());
|
|
|
+ byId.setUpdateBy(getUserId().toString());
|
|
|
|
|
|
|
|
|
- return success();
|
|
|
+ return success(monthlyReconciliationService.updateById(byId));
|
|
|
}
|
|
|
+
|
|
|
}
|