Эх сурвалжийг харах

处理加载项目时业主合同段排序显示在顶部,日志填报废除状态未改变

DengLinLang 1 сар өмнө
parent
commit
6648a5e360

+ 2 - 2
blade-service/blade-business/src/main/java/org/springblade/business/controller/ContractLogController.java

@@ -408,12 +408,12 @@ public class ContractLogController extends BladeController {
                 if (new Integer("1").equals(task.getStatus())) {
                     //正在审批,调用废除
                     this.taskClient.abolishTask(task);
-                } else if (new Integer("2").equals(task.getStatus())) {
+                } else if (new Integer("2").equals(task.getStatus()) || new Integer("3").equals(task.getStatus())) {
                     //已审批的任务,修改业务数据的审批状态为未上报并撤签即可
                     this.contractLogService.update(Wrappers.<ContractLog>lambdaUpdate()
                             .set(ContractLog::getAuditUserIdAndName, null)
                             .set(ContractLog::getEVisaPdfUrl, null)
-                            .set(ContractLog::getStatus, 3).in(ContractLog::getId, Arrays.asList(task.getFormDataId().split(","))));
+                            .set(ContractLog::getStatus, 0).in(ContractLog::getId, Arrays.asList(task.getFormDataId().split(","))));
                 }
 
                 List<ContractLog> contractLogs = this.contractLogService.getBaseMapper().selectBatchIds(Arrays.asList(task.getFormDataId().split(",")));

+ 16 - 7
blade-service/blade-business/src/main/java/org/springblade/business/controller/UserViewProjectContractController.java

@@ -4,7 +4,6 @@ import cn.hutool.core.date.StopWatch;
 import cn.hutool.log.StaticLog;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
-import com.baomidou.mybatisplus.core.toolkit.BeanUtils;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
 import io.swagger.annotations.Api;
@@ -14,7 +13,6 @@ import org.apache.commons.lang.StringUtils;
 import org.springblade.business.entity.DefaultProject;
 import org.springblade.business.service.IDefaultProjectService;
 import org.springblade.business.vo.UserVO;
-import org.springblade.core.log.exception.ServiceException;
 import org.springblade.core.secure.BladeUser;
 import org.springblade.core.secure.utils.AuthUtil;
 import org.springblade.core.secure.utils.SecureUtil;
@@ -22,11 +20,15 @@ import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.utils.BeanUtil;
 import org.springblade.core.tool.utils.ObjectUtil;
 import org.springblade.manager.dto.SaveUserInfoByProjectDTO;
-import org.springblade.manager.entity.*;
-import org.springblade.manager.feign.*;
+import org.springblade.manager.entity.ContractInfo;
+import org.springblade.manager.entity.ProjectInfo;
+import org.springblade.manager.entity.SignPfxFile;
+import org.springblade.manager.feign.ContractClient;
+import org.springblade.manager.feign.ProjectAssignmentUserClient;
+import org.springblade.manager.feign.ProjectClient;
+import org.springblade.manager.feign.SignPfxClient;
 import org.springblade.manager.vo.ContractInfoVO;
 import org.springblade.manager.vo.ProjectInfoVO;
-import org.springblade.manager.vo.ProjectInfoWbsTypeVO;
 import org.springblade.system.entity.Role;
 import org.springblade.system.feign.ISysClient;
 import org.springblade.system.user.entity.User;
@@ -38,7 +40,6 @@ import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
-import java.util.ArrayList;
 import java.util.Comparator;
 import java.util.Iterator;
 import java.util.List;
@@ -224,7 +225,15 @@ public class UserViewProjectContractController {
 
             //剔除没有合同段的项目
             projectInfoVOS.removeIf(next -> next.getContractInfoList().size() == 0);
-
+            //将合同段中业主合同段排在最前面
+            if(ObjectUtil.isNotEmpty(projectInfoVOS)){
+                for (ProjectInfoVO projectInfoVO : projectInfoVOS) {
+                    if(ObjectUtil.isNotEmpty(projectInfoVO.getContractInfoList())){
+                        List<ContractInfoVO> contractInfoList = projectInfoVO.getContractInfoList();
+                        contractInfoList.sort(Comparator.comparingInt(contractInfo->contractInfo.getContractType() == 3 ? -1:0));
+                    }
+                }
+            }
             return R.data(projectInfoVOS);
         }
         return R.data(-1, null, "数据查询失败");