zhuwei 1 سال پیش
والد
کامیت
7716af2c1f

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

@@ -1526,7 +1526,7 @@ public class EVisaServiceImpl implements EVisaService {
             } else {
                 Random random = new Random();
                 int i = random.nextInt(100000);
-                String pdfFile = "/www/wwwroot/Users/hongchuangyanfa/Desktop/archiveCheck/" + i +".pdf";
+                String pdfFile = FileUtils.getSysLocalFileUrl() + "/archiveCheck/" + i +".pdf";
                 resultOutputFilepath = pdfFile;
                 IoUtil.write(resultOutputFilepath, pdf);
                 System.out.println("文件已输出到:"+ resultOutputFilepath );

+ 1 - 1
blade-service/blade-meter/src/main/java/org/springblade/meter/controller/InterimPayCertificateController.java

@@ -102,7 +102,7 @@ public class InterimPayCertificateController extends BladeController {
 		}
 		interimPayCertificateService.update2(interimPayCertificate);
 		// taskType 10 代表任务查看pdf
-		taskController.calculate(interimPayCertificate.getId().toString(),0,1);
+		taskController.calculate(interimPayCertificate.getId().toString(),0,10);
 		return R.success("修改成功");
 	}
 

+ 19 - 18
blade-service/blade-meter/src/main/java/org/springblade/meter/controller/TaskController.java

@@ -1220,7 +1220,7 @@ public class TaskController extends BladeController {
             List<Integer> auditFlow = new ArrayList<>();
             /*预设流程(平行、顺序审批)*/
             if (ObjectUtil.isNotEmpty(task.getFixedFlowId()) && !task.getFixedFlowId().equals(0L)) {
-                List<FixedFlowLink> query = jdbcTemplate.query("SELECT * FROM u_fixed_flow_link WHERE fixed_flow_id = ?", new Object[]{task.getFixedFlowId()}, new BeanPropertyRowMapper<>(FixedFlowLink.class));
+                List<FixedFlowLink> query = jdbcTemplate.query("SELECT * FROM u_fixed_flow_link WHERE fixed_flow_id = ? order by fixed_flow_branch_sort ", new Object[]{task.getFixedFlowId()}, new BeanPropertyRowMapper<>(FixedFlowLink.class));
                 //查看流程中是否存在审计流程
                 for (FixedFlowLink link : query) {
                     if (StringUtils.isNotBlank(link.getFixedFlowLink()) && link.getFixedFlowLink().contains("审计")) {
@@ -1230,8 +1230,10 @@ public class TaskController extends BladeController {
                 //校验当前用户在第几流程
                 //Map<Long, Integer> collect = query.stream().collect(Collectors.toMap(l -> l.getFixedFlowLinkUser(), l -> l.getFixedFlowBranchSort()));
                 //Integer sort = collect.get(AuthUtil.getUserId());
-                for (FixedFlowLink flowLink:query){
-                    if(flowLink.getFixedFlowLinkUser().equals(AuthUtil.getUserId())){
+                for (int i = 0; i < query.size(); i++) {
+                    FixedFlowLink flowLink= query.get(i);
+                    TaskParallel taskParallel = taskParallels.get(i);
+                    if(flowLink.getFixedFlowLinkUser().equals(AuthUtil.getUserId()) &&taskParallel.getStatus()==1 ){
                         // 为空则代表是上报人,直接显示当前结果
                         currentUserFlow = flowLink.getFixedFlowLinkSort();
                         break;
@@ -1239,7 +1241,6 @@ public class TaskController extends BladeController {
                 }
 
                 Map<String, List<FixedFlowLink>> group = query.stream().collect(Collectors.groupingBy(obj -> obj.getFixedFlowLink() + "@@@" + obj.getFixedFlowLinkType(), LinkedHashMap::new, Collectors.toList()));
-
                 for (Map.Entry<String, List<FixedFlowLink>> stringListEntry : group.entrySet()) {
                     Map<String, Object> m = new LinkedHashMap<>();
                     m.put("taskBranchName", stringListEntry.getKey().split("@@@")[0]);
@@ -1550,7 +1551,7 @@ public class TaskController extends BladeController {
                 }
             }
         }
-
+        System.out.println("dddd");
         return R.data(200, vo, "操作成功");
     }
 
@@ -2423,7 +2424,8 @@ public class TaskController extends BladeController {
         if (ObjectUtil.isEmpty(dto.getTaskId()) || ObjectUtil.isEmpty(dto.getProjectId()) || ObjectUtil.isEmpty(dto.getContractId()) || ObjectUtil.isEmpty(SecureUtil.getUserId())) {
             throw new ServiceException("入参数据异常");
         }
-
+        //是否需要加入电签流程 10 不加入  其他加入
+        int taskType = 10;
         /*加锁*/
         String redisValue = bladeRedis.get("meter:approve:user:" + SecureUtil.getUserId());
         if (StringUtils.isNotEmpty(redisValue) && redisValue.equals("1")) {
@@ -2523,7 +2525,12 @@ public class TaskController extends BladeController {
                 }
                 /**计量公式执行 0中间,1材料,2开工*/
                 /*复制业务数据状态>主任务状态>替换数据*/
-                updateCopyDataApproveStatus(task, dto).updateTaskStatus(task).displace(task, dto);
+                updateCopyDataApproveStatus(task, dto);
+                if(taskParallels!=null && taskParallels.size()<=1){
+                    updateTaskStatus(task);
+                    taskType = 1;
+                }
+                displace(task, dto);
             }
 
             /*副任务状态*/
@@ -2537,7 +2544,7 @@ public class TaskController extends BladeController {
             //
             if (reportId != null && StringUtils.isNotEmpty(reportId) && (task.getMeterTaskType() == 3 || task.getMeterTaskType() == 1 || task.getMeterTaskType() == 2)) {
                 // taskType 10 代表任务查看pdf
-                meterPdfInfo(reportId + "", task.getMeterTaskType() - 1, 1);
+                meterPdfInfo(reportId + "", task.getMeterTaskType() - 1, taskType);
             }
 
             return R.data(200, aopParamsSet, "操作成功");
@@ -2792,7 +2799,7 @@ public class TaskController extends BladeController {
                 if (task.getFixedFlowId() != null && !task.getFixedFlowId().equals(0L)) {
                     isDefiniteFlow = true;
 
-                    query = jdbcTemplate.query("SELECT a.id,a.fixed_flow_link,a.fixed_flow_link_sort,a.fixed_flow_link_user,a.fixed_flow_link_user_name,a.fixed_flow_link_type,fixed_flow_branch_sort,b.status from u_fixed_flow_link a ,u_task_parallel b where a.fixed_flow_branch_sort= b.sort and a.fixed_flow_link_user=b.task_user and b.process_instance_id=? and fixed_flow_id=? ", new Object[]{task.getProcessInstanceId(),task.getFixedFlowId()}, new BeanPropertyRowMapper<>(FixedFlowLink.class));
+                    query = jdbcTemplate.query("SELECT a.id,a.fixed_flow_link,a.fixed_flow_link_sort,a.fixed_flow_link_user,a.fixed_flow_link_user_name,a.fixed_flow_link_type,fixed_flow_branch_sort,b.status from u_fixed_flow_link a ,u_task_parallel b where a.fixed_flow_branch_sort= b.sort and a.fixed_flow_link_user=b.task_user and b.process_instance_id=? and fixed_flow_id=?  ", new Object[]{task.getProcessInstanceId(),task.getFixedFlowId()}, new BeanPropertyRowMapper<>(FixedFlowLink.class));
 
                     //查看流程中是否存在审计流程
                     for (FixedFlowLink link : query) {
@@ -2803,7 +2810,7 @@ public class TaskController extends BladeController {
                     //校验当前用户在第几流程
                     //Integer sort = query.stream().collect(Collectors.toMap(l -> l.getFixedFlowLinkUser(), l -> l.getFixedFlowBranchSort())).get(AuthUtil.getUserId());
                     for (FixedFlowLink link : query) {
-                        if( link.equals(AuthUtil.getUserId()) && link.getStatus() !=2 ){
+                        if( link.getFixedFlowLinkUser().equals(AuthUtil.getUserId()) && link.getStatus() !=2 ){
                             currentUserFlow=link.getFixedFlowBranchSort();
                             break;
                         }
@@ -4126,19 +4133,13 @@ public class TaskController extends BladeController {
         String fileUrl = aPrivate.getHtmlUrl();
         File file1 = null;
         String os = System.getProperty("os.name").toLowerCase();
+        InputStream fileInputStream = null;
         if (os.contains("win")) {
             file1 = ResourceUtil.getFile("C:\\Users\\泓创研发01\\Desktop\\fsdownload\\1808346073870106624.html");
-        } else {
-            file1 = ResourceUtil.getFile(fileUrl);
-        }
-        InputStream fileInputStream;
-        if (file1.exists()) {
             fileInputStream = new FileInputStream(file1);
         } else {
-            String path = sys_file_net_url + fileUrl.replaceAll("//", "/").replaceAll(file_path, "");
-            fileInputStream = CommonUtil.getOSSInputStream(path);
+            fileInputStream = FileUtils.getInputStreamByUrl(fileUrl);
         }
-
         String htmlString = IoUtil.readToString(fileInputStream);
         htmlString = htmlString.replaceAll("placeholder", "placeholderxx");
         htmlString = htmlString.replaceAll("title", "titlexx");

+ 4 - 2
blade-service/blade-meter/src/main/java/org/springblade/meter/utils/FileUtils.java

@@ -14,6 +14,7 @@ import org.springblade.common.constant.CommonConstant;
 import org.springblade.common.utils.CommonUtil;
 import org.springblade.common.utils.SystemUtils;
 import org.springblade.core.log.exception.ServiceException;
+import org.springblade.core.tool.utils.IoUtil;
 import org.springblade.system.cache.ParamCache;
 
 import java.io.*;
@@ -103,8 +104,9 @@ public class FileUtils {
     public static Map<String,String> getHtmlAllKey(String htmlFileUrl){
         Map<String,String> map = new HashMap<>();
         try {
-            File file = new File(htmlFileUrl);
-            Document doc = Jsoup.parse(file, "utf-8");
+            InputStream inputStreamByUrl = FileUtils.getInputStreamByUrl(htmlFileUrl);
+            String htmlString = IoUtil.readToString(inputStreamByUrl);
+            Document doc = Jsoup.parse(htmlString, "utf-8");
             Elements tds = doc.getElementsByTag("td");
             for (Element td : tds) {
                 Elements keyname = td.getElementsByAttribute("keyname");