فهرست منبع

fix 修改定时多线程

Administrator 1 سال پیش
والد
کامیت
2c4f28e9f0

+ 1 - 1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/investment/ZxInvestmentController.java

@@ -92,7 +92,7 @@ public class ZxInvestmentController extends BaseController {
     @Log(title = "政协委员招商引资", businessType = BusinessType.UPDATE)
     @PostMapping("/examine")
     public AjaxResult examine(@RequestBody ZxInvestment zxInvestment) {
-        return toAjax(zxInvestmentService.updateZxInvestment(zxInvestment));
+        return zxInvestmentService.updateZxInvestment(zxInvestment);
     }
 
     /**

+ 2 - 1
ruoyi-system/src/main/java/com/ruoyi/system/service/IZxInvestmentService.java

@@ -1,5 +1,6 @@
 package com.ruoyi.system.service;
 
+import com.ruoyi.common.core.domain.AjaxResult;
 import com.ruoyi.system.domain.investment.ZxInvestment;
 
 import java.util.List;
@@ -43,7 +44,7 @@ public interface IZxInvestmentService
      * @param zxInvestment 政协委员招商引资
      * @return 结果
      */
-    public int updateZxInvestment(ZxInvestment zxInvestment);
+    public AjaxResult updateZxInvestment(ZxInvestment zxInvestment);
 
     /**
      * 批量删除政协委员招商引资

+ 15 - 2
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ZxInvestmentServiceImpl.java

@@ -1,6 +1,9 @@
 package com.ruoyi.system.service.impl;
 
 import java.util.List;
+import java.util.Objects;
+
+import com.ruoyi.common.core.domain.AjaxResult;
 import com.ruoyi.common.utils.DateUtils;
 import com.ruoyi.common.utils.SecurityUtils;
 import com.ruoyi.system.domain.investment.ZxInvestment;
@@ -9,6 +12,8 @@ import org.springframework.stereotype.Service;
 import com.ruoyi.system.mapper.ZxInvestmentMapper;
 import com.ruoyi.system.service.IZxInvestmentService;
 
+import static com.ruoyi.common.constant.CommonConstants.*;
+
 /**
  * 政协委员招商引资Service业务层处理
  * 
@@ -67,10 +72,18 @@ public class ZxInvestmentServiceImpl implements IZxInvestmentService
      * @return 结果
      */
     @Override
-    public int updateZxInvestment(ZxInvestment zxInvestment)
+    public AjaxResult updateZxInvestment(ZxInvestment zxInvestment)
     {
+        ZxInvestment zxInvestmentNew = zxInvestmentMapper.selectZxInvestmentByInvestmentId(zxInvestment.getInvestmentId());
+        if (zxInvestment.getType().equals(TWO) && !Objects.equals(zxInvestmentNew.getType(), ONE)){
+            return AjaxResult.error("已签约或已审核");
+        }
+        if (zxInvestment.getType().equals(THR) && !Objects.equals(zxInvestmentNew.getType(), TWO)){
+            return AjaxResult.error("项目未已审核");
+        }
         zxInvestment.setUpdateTime(DateUtils.getNowDate());
-        return zxInvestmentMapper.updateZxInvestment(zxInvestment);
+         zxInvestmentMapper.updateZxInvestment(zxInvestment);
+        return AjaxResult.success();
     }
 
     /**