huangjn 2 lat temu
rodzic
commit
23be0f174a

+ 11 - 0
blade-service-api/blade-business-api/src/main/java/org/springblade/business/feign/TaskClient.java

@@ -1,5 +1,6 @@
 package org.springblade.business.feign;
 
+import com.alibaba.fastjson.JSONObject;
 import org.springblade.business.entity.Task;
 import org.springblade.business.entity.TaskParallel;
 import org.springblade.business.vo.TaskApprovalVO;
@@ -26,7 +27,17 @@ public interface TaskClient {
     String QUERY_FORM_DATA_ID = API_PREFIX + "/query-form-data-id";
     String QUERY_BUSINESS_DATA = API_PREFIX + "/query-business-data";
     String QUERY_APPROVAL_USER = API_PREFIX + "/query-approval-user";
+    String QUERY_BUSINESS_TABLE_E_VISA_CONFIG = API_PREFIX + "/query-business-table-E_VISA_CONFIG";
 
+    /**
+     * 获取当前任务绑定的表格
+     */
+    @PostMapping(QUERY_BUSINESS_TABLE_E_VISA_CONFIG)
+    List<JSONObject> queryBusinessTableEVisaConfig(@RequestParam String taskId);
+
+    /**
+     * 获取填报人列表
+     */
     @GetMapping(QUERY_APPROVAL_USER)
     List<TaskParallel> queryApprovalUser(@RequestParam String formDataIds);
 

+ 6 - 0
blade-service-api/blade-manager-api/pom.xml

@@ -12,6 +12,12 @@
     <artifactId>blade-manager-api</artifactId>
     <name>${project.artifactId}</name>
     <version>${bladex.project.version}</version>
+    <dependencies>
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>fastjson</artifactId>
+        </dependency>
+    </dependencies>
     <packaging>jar</packaging>
 
 </project>

+ 23 - 0
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/feign/EVisaConfigClient.java

@@ -0,0 +1,23 @@
+package org.springblade.manager.feign;
+
+import com.alibaba.fastjson.JSONObject;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+
+import java.util.List;
+
+import static org.springblade.core.launch.constant.AppConstant.APPLICATION_NAME_PREFIX;
+
+@FeignClient(value = APPLICATION_NAME_PREFIX + "manager")
+public interface EVisaConfigClient {
+
+    /**
+     * 接口前缀
+     */
+    String API_PREFIX = "/api/manager/eVisaConfig";
+
+    @PostMapping(API_PREFIX + "/queryEVisaConfigByTableIds")
+    List<JSONObject> queryEVisaConfigByTableIds(@RequestBody List<String> tableIds);
+
+}

+ 8 - 6
blade-service/blade-business/src/main/java/org/springblade/business/controller/InformationWriteQueryController.java

@@ -1880,18 +1880,20 @@ public class InformationWriteQueryController extends BladeController {
 //				queryDataResult = this.informationQueryService.queryProcessDataByParentIdAndContractId(parentId, 1, contractId);
 //			}
 
-			rootTreeNode.forEach(vo -> {
-				if(new Integer("1").equals(contractInfo.getContractType())){
-					if(StringUtils.isEmpty(parentId) || "0".equals(parentId)){
-						vo.setTitle(contractInfo.getContractName());
+			if(StringUtils.isEmpty(parentId) || "0".equals(parentId)){
+				rootTreeNode.forEach(vo -> {
+					if(new Integer("1").equals(contractInfo.getContractType())){
+						if(StringUtils.isEmpty(parentId) || "0".equals(parentId)){
+							vo.setTitle(contractInfo.getContractName());
+						}
 					}
-				}
 
 //				//处理颜色
 //				if(queryDataResult != null && queryDataResult.size() > 0){
 //					this.setNodeColor(vo, queryDataResult, true);
 //				}
-			});
+				});
+			}
 		}
 
 		return rootTreeNode;

+ 0 - 21
blade-service/blade-business/src/main/java/org/springblade/business/controller/TaskController.java

@@ -16,15 +16,12 @@ import org.springblade.business.entity.DefaultConfig;
 import org.springblade.business.entity.TaskParallel;
 import org.springblade.business.service.IDefaultConfigService;
 import org.springblade.business.service.ITaskParallelService;
-import org.springblade.business.utils.FileUtils;
 import org.springblade.business.vo.BatchTaskVO;
 import org.springblade.business.vo.TaskApprovalVO;
 import org.springblade.business.vo.TaskQueryVO;
 import org.springblade.common.utils.CommonUtil;
-import org.springblade.common.utils.SnowFlakeUtil;
 import org.springblade.core.mp.support.Condition;
 import org.springblade.core.mp.support.Query;
-import org.springblade.core.oss.model.BladeFile;
 import org.springblade.core.secure.utils.AuthUtil;
 import org.springblade.core.sms.model.SmsResponse;
 import org.springblade.core.tool.api.R;
@@ -32,7 +29,6 @@ import org.springblade.core.tool.jackson.JsonUtil;
 import org.springblade.core.tool.utils.DateUtil;
 import org.springblade.flow.core.entity.BladeFlow;
 import org.springblade.flow.core.feign.NewFlowClient;
-import org.springblade.resource.feign.NewIOSSClient;
 import org.springblade.resource.feign.NewISmsClient;
 import org.springblade.system.entity.DictBiz;
 import org.springblade.system.feign.IDictBizClient;
@@ -70,8 +66,6 @@ public class TaskController extends BladeController {
 
 	private final NewISmsClient newSmsClient;
 
-	private final NewIOSSClient newIOSSClient;
-
 	private final IDefaultConfigService defaultConfigService;
 
 	/**
@@ -115,21 +109,6 @@ public class TaskController extends BladeController {
 		TaskApprovalVO result = new TaskApprovalVO();
 		result.setFormDataId(formDataId);
 		result.setApprovalType(approvalType);
-//		TaskApprovalVO vo = this.taskService.queryBusinessData(result);
-		//所有文件集合
-//		List<String> urlList = new ArrayList<>();
-//		if(vo != null && vo.getApprovalFileList().size() > 0){
-//			vo.getApprovalFileList().forEach(file -> urlList.add(file.getFileUrl()));
-//			String fileName = SnowFlakeUtil.getId() + ".pdf";
-//			String localImgUrl = "D:/project/file/" + fileName;
-//			//合并方法
-//			FileUtils.mergePdfPublicMethods(urlList, localImgUrl);
-//
-//			BladeFile bladeFile = this.newIOSSClient.uploadFile(fileName, localImgUrl);
-//			if(bladeFile != null && StringUtils.isNotEmpty(bladeFile.getLink())){
-//				result.setApprovalFileList(fileName, bladeFile.getLink());
-//			}
-//		}
 
 		return R.data(this.taskService.queryBusinessData(result));
 	}

+ 44 - 0
blade-service/blade-business/src/main/java/org/springblade/business/feignClient/TaskClientImpl.java

@@ -1,15 +1,23 @@
 package org.springblade.business.feignClient;
 
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import lombok.AllArgsConstructor;
+import org.apache.commons.lang.StringUtils;
 import org.springblade.business.entity.Task;
 import org.springblade.business.entity.TaskParallel;
 import org.springblade.business.feign.TaskClient;
+import org.springblade.business.service.IInformationQueryService;
+import org.springblade.business.service.ITaskParallelService;
 import org.springblade.business.service.ITaskService;
 import org.springblade.business.vo.TaskApprovalVO;
 import org.springblade.business.vo.TaskVO;
 import org.springblade.core.tool.api.R;
+import org.springblade.manager.entity.WbsTreeContract;
+import org.springblade.manager.feign.EVisaConfigClient;
 import org.springframework.web.bind.annotation.RestController;
 
+import java.util.ArrayList;
 import java.util.List;
 
 @RestController
@@ -18,6 +26,42 @@ public class TaskClientImpl implements TaskClient {
 
     private final ITaskService taskService;
 
+    private final IInformationQueryService informationQueryService;
+
+    private final EVisaConfigClient eVisaConfigClient;
+
+    private final ITaskParallelService taskParallelService;
+
+    @Override
+    public List<JSONObject> queryBusinessTableEVisaConfig(String taskId) {
+        //获取任务
+        Task task = this.taskService.getById(taskId);
+        if(task == null || StringUtils.isEmpty(task.getFormDataId())){
+            task = this.taskService.getOne(Wrappers.<Task>lambdaQuery().eq(Task::getProcessInstanceId, taskId));
+            if(task == null || StringUtils.isEmpty(task.getFormDataId())){
+                List<TaskParallel> linkList = this.taskParallelService.list(Wrappers.<TaskParallel>lambdaQuery().eq(TaskParallel::getParallelProcessInstanceId, taskId));
+                if(linkList == null || linkList.size() <= 0){
+                    return null;
+                }
+                task = this.taskService.getOne(Wrappers.<Task>lambdaQuery().eq(Task::getProcessInstanceId, linkList.get(0).getProcessInstanceId()));
+                if(task == null || StringUtils.isEmpty(task.getFormDataId())){
+                    return null;
+                }
+            } else {
+                //未找到任务,直接返回
+                return null;
+            }
+        }
+        //存在任务,根据formDataId查询
+        List<String> privatePrimaryKeyIds = this.informationQueryService.queryBusinessTableData(task.getFormDataId());
+        if(privatePrimaryKeyIds != null && privatePrimaryKeyIds.size() > 0){
+            //查询这些表格的电签配置
+            return this.eVisaConfigClient.queryEVisaConfigByTableIds(privatePrimaryKeyIds);
+        }
+
+        return null;
+    }
+
     @Override
     public List<TaskParallel> queryApprovalUser(String formDataIds) {
         return this.taskService.queryApprovalUser(formDataIds);

+ 2 - 0
blade-service/blade-business/src/main/java/org/springblade/business/mapper/InformationQueryMapper.java

@@ -33,6 +33,8 @@ import org.springblade.manager.vo.WbsTreeContractTreeVOS;
  */
 public interface InformationQueryMapper extends BaseMapper<InformationQuery> {
 
+	List<WbsTreeContractTreeVOS> queryContractTreeSupervision(@Param("contractId") String contractId, @Param("primaryKeyIds") List<String> primaryKeyIds, @Param("parentId") String parentId, @Param("classify") Integer classify);
+
 	List<WbsTreeContractTreeVOS> queryContractTree(@Param("contractId") String contractId, @Param("parentId") String parentId, @Param("classify") Integer classify);
 
 	List<QueryProcessDataVO> queryProcessDataByPrimaryKeyIdAndClassify(@Param("primaryKeyId") String primaryKeyId, @Param("classify") Integer classify);

+ 6 - 1
blade-service/blade-business/src/main/java/org/springblade/business/mapper/InformationQueryMapper.xml

@@ -65,6 +65,10 @@
 
     <resultMap id="intResultMap" type="java.lang.Integer"/>
 
+    <select id="queryContractTreeSupervision" resultMap="queryContractTreeMap">
+
+    </select>
+
     <select id="queryContractTree" resultMap="queryContractTreeMap">
         SELECT
             wtc.p_key_id AS primaryKeyId,
@@ -100,7 +104,7 @@
                 WHEN querys.nodeStatus LIKE CONCAT('%',1,'%') AND (querys.nodeStatus NOT LIKE CONCAT('%',2,'%') AND querys.nodeStatus NOT LIKE CONCAT('%',3,'%') AND querys.nodeStatus NOT LIKE CONCAT('%',4,'%')) THEN 1
                 WHEN querys.nodeStatus LIKE CONCAT('%',1,'%') AND (querys.nodeStatus LIKE CONCAT('%',2,'%') OR querys.nodeStatus LIKE CONCAT('%',3,'%') OR querys.nodeStatus LIKE CONCAT('%',4,'%')) THEN 2
                 WHEN querys.nodeStatus NOT LIKE CONCAT('%',1,'%') AND querys.nodeStatus LIKE CONCAT('%',4,'%') AND (querys.nodeStatus LIKE CONCAT('%',2,'%') OR querys.nodeStatus LIKE CONCAT('%',3,'%')) THEN 4
-                ELSE 2 END AS nodeStatus
+                ELSE querys.nodeStatus END AS nodeStatus
             FROM
             (
                 SELECT
@@ -108,6 +112,7 @@
                     group_concat(
                                 CASE
                                 WHEN iq.status is null THEN 1
+                                WHEN iq.status = 0 THEN 2
                                 WHEN iq.status = 1 THEN 3
                                 WHEN iq.status = 2 THEN 4
                                 ELSE 2 END

+ 13 - 1
blade-service/blade-business/src/main/java/org/springblade/business/service/IInformationQueryService.java

@@ -22,7 +22,9 @@ import org.springblade.business.vo.InformationQueryVO;
 import org.springblade.business.vo.QueryProcessDataVO;
 import org.springblade.core.mp.base.BaseService;
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.manager.entity.WbsTreeContract;
 import org.springblade.manager.vo.WbsTreeContractTreeVOS;
+import org.springframework.web.bind.annotation.RequestParam;
 
 import java.util.List;
 
@@ -35,7 +37,17 @@ import java.util.List;
 public interface IInformationQueryService extends BaseService<InformationQuery> {
 
 	/**
-	 * 获取合同段树
+	 * 获取表格信息
+	 */
+	List<String> queryBusinessTableData(String formDataId);
+
+	/**
+	 * 获取合同段树(监理方)
+	 */
+	List<WbsTreeContractTreeVOS> queryContractTreeSupervision(String contractId, List<String> primaryKeyIds, String parentId, Integer classify);
+
+	/**
+	 * 获取合同段树(施工方)
 	 */
 	List<WbsTreeContractTreeVOS> queryContractTree(String contractId, String parentId, Integer classify);
 

+ 26 - 1
blade-service/blade-business/src/main/java/org/springblade/business/service/impl/InformationQueryServiceImpl.java

@@ -28,6 +28,7 @@ import org.springframework.stereotype.Service;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 
 import java.util.*;
+import java.util.stream.Collectors;
 
 /**
  *  服务实现类
@@ -39,7 +40,6 @@ import java.util.*;
 @AllArgsConstructor
 public class InformationQueryServiceImpl extends BaseServiceImpl<InformationQueryMapper, InformationQuery> implements IInformationQueryService {
 
-
 	private final WbsTreeContractClient wbsTreeContractClient;
 
 	private final IUserClient userClient;
@@ -48,6 +48,31 @@ public class InformationQueryServiceImpl extends BaseServiceImpl<InformationQuer
 
 	private final ITaskParallelService taskParallelService;
 
+	@Override
+	public List<String> queryBusinessTableData(String formDataId) {
+		//获取具体业务数据
+		InformationQuery query = this.getById(formDataId);
+
+		//查询这个业务数据绑定的表格,需要区分监理和施工
+		WbsTreeContract tree = this.wbsTreeContractClient.getContractWbsTreeByPrimaryKeyId(query.getWbsId());
+		List<WbsTreeContract> tableList = this.wbsTreeContractClient.queryChildByParentId(tree, "queryTable", String.valueOf(query.getClassify()));
+		if(tableList != null && tableList.size() > 0){
+			//删除掉无法溯源的数据
+			tableList.removeIf(node -> node.getIsTypePrivatePid() == null || node.getIsTypePrivatePid() <= 0 || StringUtils.isEmpty(node.getIsTypePrivatePid().toString()));
+
+			List<Long> privatePIdList = tableList.stream().map(WbsTreeContract::getIsTypePrivatePid).distinct().collect(Collectors.toList());
+
+			return JSONArray.parseArray(JSONObject.toJSONString(privatePIdList), String.class);
+		}
+
+		return null;
+	}
+
+	@Override
+	public List<WbsTreeContractTreeVOS> queryContractTreeSupervision(String contractId, List<String> primaryKeyIds, String parentId, Integer classify) {
+		return this.baseMapper.queryContractTree(contractId, parentId, classify);
+	}
+
 	@Override
 	public List<WbsTreeContractTreeVOS> queryContractTree(String contractId, String parentId, Integer classify) {
 		return this.baseMapper.queryContractTree(contractId, parentId, classify);

+ 2 - 4
blade-service/blade-business/src/main/java/org/springblade/business/service/impl/TaskServiceImpl.java

@@ -1,4 +1,4 @@
- package org.springblade.business.service.impl;
+package org.springblade.business.service.impl;
 
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
@@ -10,7 +10,6 @@ import org.apache.commons.lang.time.DateUtils;
 import org.springblade.business.entity.*;
 import org.springblade.business.mapper.TaskMapper;
 import org.springblade.business.service.*;
-import org.springblade.business.utils.FileUtils;
 import org.springblade.business.vo.TaskApprovalVO;
 import org.springblade.business.vo.TaskVO;
 import org.springblade.common.utils.SnowFlakeUtil;
@@ -40,7 +39,6 @@ import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Date;
 import java.util.List;
-import java.util.stream.Collectors;
 
  /**
  * 任务审核主表 服务实现类
@@ -120,7 +118,7 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
                 List<WbsTreeContract> tableData = this.wbsTreeContractClient.queryProcessSubmitBusinessDataByPrimaKeyIdAndClassify(query.getWbsId().toString(), query.getClassify().toString());
                 if(tableData != null && tableData.size() > 0){
                     //设置数据
-                    List<String> pdfUrls = tableData.stream().map(WbsTreeContract::getPdfUrl).distinct().collect(Collectors.toList());
+//                    List<String> pdfUrls = tableData.stream().map(WbsTreeContract::getPdfUrl).distinct().collect(Collectors.toList());
                     //需要重新合并PDF
 //                    FileUtils.mergePdfPublicMethods();
 

+ 38 - 26
blade-service/blade-e-visa/src/main/java/org/springblade/evisa/service/impl/EVisaServiceImpl.java

@@ -194,9 +194,8 @@ public class EVisaServiceImpl implements EVisaService {
 
     @Override
     public String eVisa(EVisaTaskApprovalVO task) {
-        if(true){
-            return SUCCESS;
-        }
+        String resultMessage = ERROR;
+
         //todo 这里应当是配置限制参数,初版暂时写死
         int batch = 20;
 
@@ -214,9 +213,18 @@ public class EVisaServiceImpl implements EVisaService {
             return NOT_PFX_OR_FILE;
         }
 
+        //获取任务对应表格的电签配置
+        List<JSONObject> eVisaConfigList = this.taskClient.queryBusinessTableEVisaConfig(task.getParallelProcessInstanceId());
+
+        if(eVisaConfigList == null || eVisaConfigList.size() == 0){
+            //没有电签配置,默认当前任务为不签字审批,返回成功
+            return SUCCESS;
+        }
+
         //上锁
         if(DistributedRedisLock.acquire(AuthUtil.getUserId().toString(), batch)){
             try{
+
                 //获取需要签章的数据
                 List<TaskApprovalVO.ApprovalFile> files = taskFile.getApprovalFileList();
                 for(TaskApprovalVO.ApprovalFile file : files){
@@ -227,24 +235,24 @@ public class EVisaServiceImpl implements EVisaService {
                     //准备签章策略
                     List<SealStrategyVO> sealStrategyVOS = new ArrayList<>();
                     for(int i = 0; i <page; i ++){
-                        //设置签章策略
-                        SealStrategyVO vo = new SealStrategyVO();
-                        vo.setSealCode(EVisaConstant.SIGN_SEAL_CODE + AuthUtil.getUserId());
-                        vo.setSealPassword(AuthUtil.getUserId().toString().substring(0, EVisaConstant.USER_ID_SUB));
-                        vo.setSealPerson(AuthUtil.getNickName());
-                        //设置签字文件
-                        vo.setImageUrl(userPfxList.get(0).getSignatureFileUrl());
-                        vo.setSealType("3");
-
-                        //todo ====================== 暂时缺少关键信息 =====================
-//                        vo.setKeyword("监理");
-//                        vo.setLx("10");
-//                        vo.setLy("0");
-                        //todo ====================== 暂时缺少关键信息 =====================
-
-                        //设置页
-                        vo.setPage(( i + 1) + "");
-                        sealStrategyVOS.add(vo);
+                        for(JSONObject eVisaConfig : eVisaConfigList){
+                            //设置签章策略
+                            SealStrategyVO vo = new SealStrategyVO();
+                            vo.setSealCode(EVisaConstant.SIGN_SEAL_CODE + AuthUtil.getUserId());
+                            vo.setSealPassword(AuthUtil.getUserId().toString().substring(0, EVisaConstant.USER_ID_SUB));
+                            vo.setSealPerson(AuthUtil.getNickName());
+                            //设置签字文件
+                            vo.setImageUrl(userPfxList.get(0).getSignatureFileUrl());
+                            vo.setSealType("3");
+
+                            vo.setKeyword(eVisaConfig.getString("KEY"));
+                            vo.setLx(eVisaConfig.getString("X"));
+                            vo.setLy(eVisaConfig.getString("Y"));
+
+                            //设置页
+                            vo.setPage(( i + 1) + "");
+                            sealStrategyVOS.add(vo);
+                        }
                     }
                     SealPdfVO pdfVO = new SealPdfVO();
                     pdfVO.setStrategyVoList(sealStrategyVOS);
@@ -258,22 +266,26 @@ public class EVisaServiceImpl implements EVisaService {
                         //重新上传
                         BladeFile bladeFile = this.newIOSSClient.uploadFileByInputStream(newFiles);
                         if(bladeFile != null){
-                            return SUCCESS + "@@@@" + bladeFile.getLink();
+                            resultMessage = SUCCESS + "@@@@" + bladeFile.getLink();
                         } else {
-                            return ERROR;
+                            resultMessage = ERROR;
                         }
                     } else {
-                        return ERROR;
+                        resultMessage = ERROR;
                     }
 
                 }
+
+
             }catch (Exception e){
                 e.printStackTrace();
-                return ERROR;
             }
         }
 
-        return ERROR;
+        //释放锁
+        DistributedRedisLock.release(AuthUtil.getUserId().toString());
+
+        return resultMessage;
     }
 
     /**

+ 40 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/feign/EVisaConfigClientImpl.java

@@ -0,0 +1,40 @@
+package org.springblade.manager.feign;
+
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import lombok.AllArgsConstructor;
+import org.springblade.core.secure.utils.AuthUtil;
+import org.springblade.manager.entity.TextdictInfo;
+import org.springblade.manager.service.ITextdictInfoService;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+@RestController
+@AllArgsConstructor
+public class EVisaConfigClientImpl implements EVisaConfigClient {
+
+    private final ITextdictInfoService textdictInfoService;
+
+    @Override
+    public List<JSONObject> queryEVisaConfigByTableIds(List<String> tableIds) {
+        List<JSONObject> jsonResult = new ArrayList<>();
+
+        List<TextdictInfo> configResult = this.textdictInfoService.list(Wrappers.<TextdictInfo>lambdaQuery().in(TextdictInfo::getTabId, tableIds).in(TextdictInfo::getSigRoleId, Arrays.asList(AuthUtil.getUser().getRoleId().split(","))));
+        if(configResult != null && configResult.size() > 0){
+            configResult.forEach(config -> {
+                JSONObject jsonObject = new JSONObject();
+                //标识
+                jsonObject.put("KEY", config.getId());
+                //X/Y轴偏移量
+                jsonObject.put("X", config.getPyzbx());
+                jsonObject.put("Y", config.getColKey());
+
+                jsonResult.add(jsonObject);
+            });
+        }
+        return jsonResult;
+    }
+}