Bläddra i källkod

Merge remote-tracking branch 'origin/master'

buzhanyi 2 år sedan
förälder
incheckning
acf8337aa3

+ 30 - 5
purchase-admin/src/main/java/com/ozs/web/controller/base/BaseAgencyController.java

@@ -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));
     }
+
 }

+ 1 - 1
purchase-admin/src/main/resources/application-test.yml

@@ -15,7 +15,7 @@ purchase:
   # 验证码类型 math 数组计算 char 字符验证
   captchaType: math
   # 全部用户是否开启接口权限校验,排除admin用户
-  permissionsEnable: true
+  permissionsEnable: false
 
 # 开发环境配置
 server:

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 11 - 3
purchase-system/src/main/resources/mapper/pm/PmDemandMapper.xml