Browse Source

Merge remote-tracking branch 'origin/dev' into dev

LHB 6 days ago
parent
commit
ad921f92ab
16 changed files with 672 additions and 19 deletions
  1. 34 0
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/dto/TaskProgressDTO.java
  2. 67 0
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/entity/TaskProgress.java
  3. 19 0
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/feign/TaskProgressClient.java
  4. 34 0
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/vo/TaskProgressVO.java
  5. 19 0
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/vo/TaskProgressVO1.java
  6. 137 0
      blade-service/blade-business/src/main/java/org/springblade/business/controller/TaskProgressController.java
  7. 23 0
      blade-service/blade-business/src/main/java/org/springblade/business/feignClient/TaskProgressClientImpl.java
  8. 53 0
      blade-service/blade-business/src/main/java/org/springblade/business/mapper/TaskProgressMapper.java
  9. 58 0
      blade-service/blade-business/src/main/java/org/springblade/business/mapper/TaskProgressMapper.xml
  10. 49 0
      blade-service/blade-business/src/main/java/org/springblade/business/service/ITaskProgressService.java
  11. 2 1
      blade-service/blade-business/src/main/java/org/springblade/business/service/impl/InformationQueryServiceImpl.java
  12. 159 0
      blade-service/blade-business/src/main/java/org/springblade/business/service/impl/TaskProgressServiceImpl.java
  13. 9 6
      blade-service/blade-business/src/main/java/org/springblade/business/service/impl/TaskServiceImpl.java
  14. 4 11
      blade-service/blade-business/src/main/java/org/springblade/business/sync/TaskSync.java
  15. 3 0
      blade-service/blade-e-visa/src/main/java/org/springblade/evisa/service/impl/EVDataServiceImpl.java
  16. 2 1
      blade-service/blade-e-visa/src/main/java/org/springblade/evisa/service/impl/ScrDataServiceImpl.java

+ 34 - 0
blade-service-api/blade-business-api/src/main/java/org/springblade/business/dto/TaskProgressDTO.java

@@ -0,0 +1,34 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.business.dto;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.business.entity.TaskProgress;
+
+/**
+ * 任务进度表数据传输对象实体类
+ *
+ * @author BladeX
+ * @since 2025-10-15
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class TaskProgressDTO extends TaskProgress {
+	private static final long serialVersionUID = 1L;
+
+}

+ 67 - 0
blade-service-api/blade-business-api/src/main/java/org/springblade/business/entity/TaskProgress.java

@@ -0,0 +1,67 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.business.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import java.io.Serializable;
+
+import lombok.AllArgsConstructor;
+import lombok.NoArgsConstructor;
+import org.springblade.core.mp.base.BaseEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 任务进度表实体类
+ *
+ * @author BladeX
+ * @since 2025-10-15
+ */
+@Data
+@TableName("m_task_progress")
+@EqualsAndHashCode(callSuper = true)
+@NoArgsConstructor
+@AllArgsConstructor
+public class TaskProgress extends BaseEntity {
+
+	private static final long serialVersionUID = 1L;
+
+	private Long projectId;
+	private Long contractId;
+	/**
+	* 1.sava_again 2.re_sign 3.电签检测 4.一键电签
+	*/
+		private Integer type;
+	/**
+	* 任务总数
+	*/
+		private Integer taskTotal;
+	/**
+	* 已完成数
+	*/
+		private Integer finishTatol;
+	/**
+	* 是否已完成 0否 1是
+	*/
+		private Integer isFinish;
+	/**
+	 * 任务ID
+ 	 */
+		private String dataId;
+
+
+}

+ 19 - 0
blade-service-api/blade-business-api/src/main/java/org/springblade/business/feign/TaskProgressClient.java

@@ -0,0 +1,19 @@
+package org.springblade.business.feign;
+
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+
+import static org.springblade.core.launch.constant.AppConstant.APPLICATION_NAME_PREFIX;
+
+@FeignClient(value = APPLICATION_NAME_PREFIX + "business")
+public interface TaskProgressClient {
+    /**
+     * 接口前缀
+     */
+    String API_PREFIX = "/api/business/taskProgress";
+
+
+    @GetMapping(API_PREFIX + "/updateTaskProgress")
+    Boolean updateTaskProgress(@RequestParam("projectId") Long projectId,@RequestParam("contractId") Long contractId,@RequestParam("type") Integer type,@RequestParam("finishTotal") Integer finishTotal,@RequestParam("dataId") String dataId);
+}

+ 34 - 0
blade-service-api/blade-business-api/src/main/java/org/springblade/business/vo/TaskProgressVO.java

@@ -0,0 +1,34 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.business.vo;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.business.entity.TaskProgress;
+
+/**
+ * 任务进度表视图实体类
+ *
+ * @author BladeX
+ * @since 2025-10-15
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class TaskProgressVO extends TaskProgress {
+	private static final long serialVersionUID = 1L;
+
+}

+ 19 - 0
blade-service-api/blade-business-api/src/main/java/org/springblade/business/vo/TaskProgressVO1.java

@@ -0,0 +1,19 @@
+package org.springblade.business.vo;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.math.BigDecimal;
+
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+public class TaskProgressVO1 {
+
+    private Integer finishCount;
+
+    private Integer totalCount;
+
+    private BigDecimal pace;
+}

+ 137 - 0
blade-service/blade-business/src/main/java/org/springblade/business/controller/TaskProgressController.java

@@ -0,0 +1,137 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.business.controller;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import lombok.AllArgsConstructor;
+import javax.validation.Valid;
+
+import org.springblade.business.entity.TaskProgress;
+import org.springblade.core.mp.support.Condition;
+import org.springblade.core.mp.support.Query;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.Func;
+import org.springblade.business.vo.TaskProgressVO1;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.RequestParam;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.business.vo.TaskProgressVO;
+import org.springblade.business.service.ITaskProgressService;
+import org.springblade.core.boot.ctrl.BladeController;
+
+import java.util.Map;
+
+/**
+ * 任务进度表 控制器
+ *
+ * @author BladeX
+ * @since 2025-10-15
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping("/taskProgress")
+@Api(value = "任务进度表", tags = "任务进度表接口")
+public class TaskProgressController extends BladeController {
+
+	private final ITaskProgressService taskProgressService;
+
+	/**
+	 * 详情
+	 */
+	@GetMapping("/detail")
+	@ApiOperationSupport(order = 1)
+	@ApiOperation(value = "详情", notes = "传入taskProgress")
+	public R<TaskProgress> detail(TaskProgress taskProgress) {
+		TaskProgress detail = taskProgressService.getOne(Condition.getQueryWrapper(taskProgress));
+		return R.data(detail);
+	}
+
+	@GetMapping("/getTaskProgress")
+	@ApiOperationSupport(order = 1)
+	@ApiOperation(value = "获取进度", notes = "传入taskProgress")
+	public R<Map<String, TaskProgressVO1>> getTaskProgress(Long projectId, Long contractId){
+		return R.data(taskProgressService.selectNewTaskProgress(projectId,contractId));
+	}
+
+	/**
+	 * 分页 任务进度表
+	 */
+	@GetMapping("/list")
+	@ApiOperationSupport(order = 2)
+	@ApiOperation(value = "分页", notes = "传入taskProgress")
+	public R<IPage<TaskProgress>> list(TaskProgress taskProgress, Query query) {
+		IPage<TaskProgress> pages = taskProgressService.page(Condition.getPage(query), Condition.getQueryWrapper(taskProgress));
+		return R.data(pages);
+	}
+
+	/**
+	 * 自定义分页 任务进度表
+	 */
+	@GetMapping("/page")
+	@ApiOperationSupport(order = 3)
+	@ApiOperation(value = "分页", notes = "传入taskProgress")
+	public R<IPage<TaskProgressVO>> page(TaskProgressVO taskProgress, Query query) {
+		IPage<TaskProgressVO> pages = taskProgressService.selectTaskProgressPage(Condition.getPage(query), taskProgress);
+		return R.data(pages);
+	}
+
+	/**
+	 * 新增 任务进度表
+	 */
+	@PostMapping("/save")
+	@ApiOperationSupport(order = 4)
+	@ApiOperation(value = "新增", notes = "传入taskProgress")
+	public R save(@Valid @RequestBody TaskProgress taskProgress) {
+		return R.status(taskProgressService.save(taskProgress));
+	}
+
+	/**
+	 * 修改 任务进度表
+	 */
+	@PostMapping("/update")
+	@ApiOperationSupport(order = 5)
+	@ApiOperation(value = "修改", notes = "传入taskProgress")
+	public R update(@Valid @RequestBody TaskProgress taskProgress) {
+		return R.status(taskProgressService.updateById(taskProgress));
+	}
+
+	/**
+	 * 新增或修改 任务进度表
+	 */
+	@PostMapping("/submit")
+	@ApiOperationSupport(order = 6)
+	@ApiOperation(value = "新增或修改", notes = "传入taskProgress")
+	public R submit(@Valid @RequestBody TaskProgress taskProgress) {
+		return R.status(taskProgressService.saveOrUpdate(taskProgress));
+	}
+
+	
+	/**
+	 * 删除 任务进度表
+	 */
+	@PostMapping("/remove")
+	@ApiOperationSupport(order = 7)
+	@ApiOperation(value = "逻辑删除", notes = "传入ids")
+	public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
+		return R.status(taskProgressService.deleteLogic(Func.toLongList(ids)));
+	}
+
+	
+}

+ 23 - 0
blade-service/blade-business/src/main/java/org/springblade/business/feignClient/TaskProgressClientImpl.java

@@ -0,0 +1,23 @@
+package org.springblade.business.feignClient;
+
+import lombok.AllArgsConstructor;
+
+import org.springblade.business.feign.TaskProgressClient;
+import org.springblade.business.service.ITaskProgressService;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@AllArgsConstructor
+public class TaskProgressClientImpl implements TaskProgressClient {
+
+
+    private final ITaskProgressService taskProgressService;
+
+
+
+
+    @Override
+    public Boolean updateTaskProgress(Long projectId, Long contractId, Integer type, Integer finishTotal,String dataId) {
+        return taskProgressService.updateTaskProgress(projectId, contractId, type, finishTotal,dataId);
+    }
+}

+ 53 - 0
blade-service/blade-business/src/main/java/org/springblade/business/mapper/TaskProgressMapper.java

@@ -0,0 +1,53 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.business.mapper;
+
+import org.apache.ibatis.annotations.Param;
+import org.springblade.business.entity.TaskProgress;
+import org.springblade.business.vo.TaskProgressVO;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+import java.util.List;
+
+/**
+ * 任务进度表 Mapper 接口
+ *
+ * @author BladeX
+ * @since 2025-10-15
+ */
+public interface TaskProgressMapper extends BaseMapper<TaskProgress> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param taskProgress
+	 * @return
+	 */
+	List<TaskProgressVO> selectTaskProgressPage(IPage page, TaskProgressVO taskProgress);
+
+	TaskProgressVO selectNewTaskProgress(@Param("projectId") Long projectId, @Param("contractId") Long contractId,@Param("type") Integer type);
+
+	void addFinishTotalById(@Param("id") Long id, @Param("finishTotal") Integer finishTotal);
+
+	void checkAndUpdateIsFinish(@Param("id") Long id);
+
+	TaskProgressVO selectNewTaskProgress1(@Param("projectId") Long projectId, @Param("contractId") Long contractId, @Param("type") Integer type);
+
+	Integer selectTaskBatchSize(@Param("dataIds") List<Long> dataIds);
+}

+ 58 - 0
blade-service/blade-business/src/main/java/org/springblade/business/mapper/TaskProgressMapper.xml

@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.springblade.business.mapper.TaskProgressMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="taskProgressResultMap" type="org.springblade.business.entity.TaskProgress">
+        <result column="id" property="id"/>
+        <result column="create_user" property="createUser"/>
+        <result column="create_dept" property="createDept"/>
+        <result column="create_time" property="createTime"/>
+        <result column="update_user" property="updateUser"/>
+        <result column="update_time" property="updateTime"/>
+        <result column="status" property="status"/>
+        <result column="is_deleted" property="isDeleted"/>
+        <result column="project_id" property="projectId"/>
+        <result column="contract_id" property="contractId"/>
+        <result column="type" property="type"/>
+        <result column="task_total" property="taskTotal"/>
+        <result column="finish_tatol" property="finishTatol"/>
+        <result column="is_finish" property="isFinish"/>
+    </resultMap>
+    <update id="addFinishTotalById">
+        update m_task_progress set finish_tatol = finish_tatol + #{finishTotal} where id = #{id}
+    </update>
+    <update id="checkAndUpdateIsFinish">
+        update m_task_progress set is_finish = 1 where id = #{id} and finish_tatol >= task_total
+    </update>
+
+
+    <select id="selectTaskProgressPage" resultMap="taskProgressResultMap">
+        select * from m_task_progress where is_deleted = 0
+    </select>
+    <select id="selectNewTaskProgress" resultType="org.springblade.business.vo.TaskProgressVO">
+        select * from m_task_progress where is_deleted = 0 and project_id = #{projectId} and contract_id = #{contractId} and type = #{type} and is_finish=0 order by create_time desc limit 1
+    </select>
+    <select id="selectNewTaskProgress1" resultType="org.springblade.business.vo.TaskProgressVO">
+        select * from m_task_progress where is_deleted = 0 and project_id = #{projectId} and contract_id = #{contractId} and type = #{type}  order by create_time desc limit 1
+    </select>
+    <select id="selectTaskBatchSize" resultType="java.lang.Integer">
+        SELECT COUNT(*)
+        FROM (
+        SELECT DISTINCT JSON_UNQUOTE(JSON_EXTRACT(utb.json_data, '$.taskId')) as taskId
+        FROM u_task_batch utb
+        INNER JOIN m_task_progress mtp
+        ON FIND_IN_SET(
+        JSON_UNQUOTE(JSON_EXTRACT(utb.json_data, '$.formDataId')),
+        mtp.data_id
+        ) > 0
+        <if test="dataIds != null and dataIds.size() > 0">
+            WHERE JSON_UNQUOTE(JSON_EXTRACT(utb.json_data, '$.formDataId')) IN
+            <foreach collection="dataIds" item="id" open="(" close=")" separator=",">
+                #{id}
+            </foreach>
+        </if>
+        ) distinct_tasks
+    </select>
+
+</mapper>

+ 49 - 0
blade-service/blade-business/src/main/java/org/springblade/business/service/ITaskProgressService.java

@@ -0,0 +1,49 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.business.service;
+
+import org.springblade.business.entity.TaskProgress;
+import org.springblade.business.vo.TaskProgressVO;
+import org.springblade.core.mp.base.BaseService;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.business.vo.TaskProgressVO1;
+
+import java.util.Map;
+
+/**
+ * 任务进度表 服务类
+ *
+ * @author BladeX
+ * @since 2025-10-15
+ */
+public interface ITaskProgressService extends BaseService<TaskProgress> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param taskProgress
+	 * @return
+	 */
+	IPage<TaskProgressVO> selectTaskProgressPage(IPage<TaskProgressVO> page, TaskProgressVO taskProgress);
+
+	Map<String, TaskProgressVO1> selectNewTaskProgress(Long projectId, Long contractId);
+
+	Boolean updateTaskProgress(Long projectId,Long contractId,Integer type,Integer finishTotal,String dataId);
+
+	Boolean addTaskProgress(Long projectId,Long contractId,Integer type,Integer taskTotal,String dataIds);
+}

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

@@ -35,6 +35,7 @@ import org.springblade.manager.entity.TabBusstimeInfo;
 import org.springblade.manager.entity.WbsTreeContract;
 import org.springblade.manager.feign.ContractClient;
 import org.springblade.manager.feign.WbsTreeContractClient;
+import org.springblade.business.service.ITaskProgressService;
 import org.springblade.manager.vo.WbsTreeContractTreeVOS;
 import org.springblade.resource.feign.NewIOSSClient;
 import org.springblade.system.cache.ParamCache;
@@ -44,7 +45,6 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.data.redis.core.StringRedisTemplate;
 import org.springframework.jdbc.core.BeanPropertyRowMapper;
 import org.springframework.jdbc.core.JdbcTemplate;
-import org.springframework.scheduling.annotation.Async;
 import org.springframework.stereotype.Service;
 
 import java.io.File;
@@ -83,6 +83,7 @@ public class InformationQueryServiceImpl extends BaseServiceImpl<InformationQuer
 
     private final JdbcTemplate jdbcTemplate;
     private final IOperationLogService operationLogService;
+    private final ITaskProgressService taskProgressService;
 
     @Autowired
     StringRedisTemplate RedisTemplate;

+ 159 - 0
blade-service/blade-business/src/main/java/org/springblade/business/service/impl/TaskProgressServiceImpl.java

@@ -0,0 +1,159 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.business.service.impl;
+
+import org.apache.commons.lang.StringUtils;
+import org.springblade.common.utils.SnowFlakeUtil;
+import org.springblade.business.entity.TaskProgress;
+import org.springblade.business.vo.TaskProgressVO;
+import org.springblade.business.mapper.TaskProgressMapper;
+import org.springblade.business.service.ITaskProgressService;
+import org.springblade.core.mp.base.BaseServiceImpl;
+import org.springblade.business.vo.TaskProgressVO1;
+import org.springblade.core.tool.utils.Func;
+import org.springframework.stereotype.Service;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+import java.math.BigDecimal;
+import java.math.RoundingMode;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * 任务进度表 服务实现类
+ *
+ * @author BladeX
+ * @since 2025-10-15
+ */
+@Service
+public class TaskProgressServiceImpl extends BaseServiceImpl<TaskProgressMapper, TaskProgress> implements ITaskProgressService {
+
+	@Override
+	public IPage<TaskProgressVO> selectTaskProgressPage(IPage<TaskProgressVO> page, TaskProgressVO taskProgress) {
+		return page.setRecords(baseMapper.selectTaskProgressPage(page, taskProgress));
+	}
+
+	@Override
+	public Map<String, TaskProgressVO1> selectNewTaskProgress(Long projectId, Long contractId) {
+		Map<String, TaskProgressVO1> map = new HashMap<>();
+		TaskProgressVO vo1 = baseMapper.selectNewTaskProgress1(projectId, contractId,1);
+		if(vo1!=null){
+			BigDecimal result = (vo1.getTaskTotal() != null && vo1.getTaskTotal() > 0 && vo1.getFinishTatol() != null) ?
+					new BigDecimal(vo1.getFinishTatol())
+							.divide(new BigDecimal(vo1.getTaskTotal()), 2, RoundingMode.HALF_UP)
+							.multiply(new BigDecimal(100)) :
+					BigDecimal.ZERO;
+			map.put("save-again", new TaskProgressVO1(vo1.getFinishTatol(),vo1.getTaskTotal(),result));
+		}
+		TaskProgressVO vo2 = baseMapper.selectNewTaskProgress1(projectId, contractId,2);
+		if(vo2!=null){
+			Integer size=0;
+			if(StringUtils.isNotEmpty(vo2.getDataId())){
+				size=baseMapper.selectTaskBatchSize(Func.toLongList(vo2.getDataId()));
+			}
+			Integer finishTatol=vo2.getTaskTotal()-size;
+			// 使用 BigDecimal 进行精确计算并保留两位小数
+			BigDecimal result = vo2.getTaskTotal() > 0 ?
+					new BigDecimal(finishTatol).divide(new BigDecimal(vo2.getTaskTotal()), 2, RoundingMode.HALF_UP).multiply(new BigDecimal(100)) :
+					BigDecimal.ZERO;
+			result = result.setScale(2, RoundingMode.HALF_UP);
+			map.put("re-sign", new TaskProgressVO1(finishTatol,vo2.getTaskTotal(),result));
+			if(size==0){
+				vo2.setIsDeleted(0);
+				baseMapper.updateById(vo2);
+			}
+		}
+		TaskProgressVO vo3 = baseMapper.selectNewTaskProgress1(projectId, contractId,4);
+		if(vo3!=null){
+			Integer size=0;
+			if(StringUtils.isNotEmpty(vo3.getDataId())){
+				size=baseMapper.selectTaskBatchSize(Func.toLongList(vo3.getDataId()));
+			}
+			Integer finishTatol=vo3.getTaskTotal()-size;
+			// 使用 BigDecimal 进行精确计算并保留两位小数
+			BigDecimal result = vo3.getTaskTotal() > 0 ?
+					new BigDecimal(finishTatol).divide(new BigDecimal(vo3.getTaskTotal()), 2, RoundingMode.HALF_UP).multiply(new BigDecimal(100)) :
+					BigDecimal.ZERO;
+			result = result.setScale(2, RoundingMode.HALF_UP);
+			map.put("electronic-sign", new TaskProgressVO1(finishTatol,vo3.getTaskTotal(),result));
+			if(size==0){
+				vo3.setIsDeleted(0);
+				baseMapper.updateById(vo3);
+			}
+		}
+		return map;
+	}
+
+	/**
+	 * 完成任务后更新进度
+	 * @param projectId
+	 * @param contractId
+	 * @param type 1.sava_again 2.re_sign 3.电签检测 4.一键电签
+	 * @param finishTotal
+	 * @return
+	 */
+	public Boolean updateTaskProgress(Long projectId,Long contractId,Integer type,Integer finishTotal,String dataId) {
+		TaskProgressVO vo = baseMapper.selectNewTaskProgress(projectId, contractId,type);
+		if (vo==null) {
+			return false;
+		} else if (StringUtils.isNotEmpty(dataId)&&StringUtils.isNotEmpty(vo.getDataId())) {
+			if(!vo.getDataId().contains(dataId)){
+				return false;
+			}
+		}
+		if(vo.getIsFinish()!=1){
+			baseMapper.addFinishTotalById(vo.getId(),finishTotal);
+			baseMapper.checkAndUpdateIsFinish(vo.getId());
+		}
+		return true;
+	}
+
+	/**
+	 * 添加任务进度
+	 * @param projectId
+	 * @param contractId
+	 * @param type
+	 * @param taskTotal
+	 * @param dataIds
+	 * @return
+	 */
+	public Boolean addTaskProgress(Long projectId,Long contractId,Integer type,Integer taskTotal,String dataIds) {
+		TaskProgressVO vo = baseMapper.selectNewTaskProgress(projectId, contractId,type);
+		if(vo==null){
+			TaskProgress progress = new TaskProgress();
+			progress.setId(SnowFlakeUtil.getId());
+			progress.setProjectId(projectId);
+			progress.setContractId(contractId);
+			progress.setType(type);
+			progress.setTaskTotal(taskTotal);
+			progress.setFinishTatol(0);
+			progress.setIsFinish(0);
+			if(StringUtils.isNotEmpty(dataIds)){
+				progress.setDataId(dataIds);
+			}
+			baseMapper.insert(progress);
+		}else {
+			vo.setTaskTotal(vo.getTaskTotal()+taskTotal);
+			if(StringUtils.isNotEmpty(dataIds)){
+				vo.setDataId(vo.getDataId()+","+dataIds);
+			}
+			baseMapper.updateById(vo);
+		}
+		return true;
+	}
+}

+ 9 - 6
blade-service/blade-business/src/main/java/org/springblade/business/service/impl/TaskServiceImpl.java

@@ -43,10 +43,7 @@ import org.springblade.flow.core.feign.IFlowClient;
 import org.springblade.flow.core.feign.NewFlowClient;
 import org.springblade.flow.core.utils.FlowUtil;
 
-import org.springblade.manager.entity.ContractInfo;
-import org.springblade.manager.entity.ProjectInfo;
-import org.springblade.manager.entity.TabBusstimeInfo;
-import org.springblade.manager.entity.WbsTreeContract;
+import org.springblade.manager.entity.*;
 import org.springblade.manager.feign.*;
 import org.springblade.manager.vo.AppWbsTreeContractVO;
 import org.springblade.manager.vo.WbsTreePrivateVO4;
@@ -142,6 +139,8 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
 
     private final ITrialSelfInspectionRecordService iTrialSelfInspectionRecordService;
 
+    private final ITaskProgressService taskProgressService;
+
 
     @Override
     public List<TaskParallel> queryApprovalUser(String formDataIds) {
@@ -1972,6 +1971,7 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
                     .in(InformationQuery::getId, newIds));
             List<InformationQuery> list = informationQueryService.list(new LambdaQueryWrapper<>(InformationQuery.class).in(InformationQuery::getId, newIds));
             recordResignLog("save-again", StringUtils.join(newIds, ","), list, dtos, dtos.get(0).getProjectId()+"", dtos.get(0).getContractId()+"", null);
+            taskProgressService.addTaskProgress(dtos.get(0).getProjectId(), dtos.get(0).getContractId(), 1,dtos.size(),StringUtils.join(newIds, ","));
         }
         return R.success("操作成功");
     }
@@ -2008,8 +2008,10 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
             Map<String, List<TaskParallel>> finalTaskParallelGroupMap = taskParallelGroupMap;
             //获取每条任务对应的节点信息
             List<String> dataIdList = taskList.stream().map(Task::getFormDataId).filter(ObjectUtil::isNotEmpty).collect(Collectors.toList());
+            //Map<String, String> queryMap = jdbcTemplate.query("select * from u_information_query where id in(" + StringUtils.join(dataIdList, ",") + ")", new BeanPropertyRowMapper<>(InformationQuery.class)).stream().collect(Collectors.toMap(l -> l.getId() + "", l -> l.getWbsId() + ""));
             List<InformationQuery> list = informationQueryService.list(Wrappers.<InformationQuery>lambdaQuery().in(InformationQuery::getId, dataIdList));
-            Map<String, String> queryMap = jdbcTemplate.query("select * from u_information_query where id in(" + StringUtils.join(dataIdList, ",") + ")", new BeanPropertyRowMapper<>(InformationQuery.class)).stream().collect(Collectors.toMap(l -> l.getId() + "", l -> l.getWbsId() + ""));
+            taskProgressService.addTaskProgress(Long.parseLong(projectId), Long.parseLong(contractId), 2,taskList.size(),StringUtils.join(dataIdList, ","));
+            Map<String, String> queryMap=list.stream().collect(Collectors.toMap(l -> l.getId() + "", l -> l.getWbsId() + ""));
             Map<String, String> typeMap = jdbcTemplate.query("select * from u_information_query where id in(" + StringUtils.join(dataIdList, ",") + ")", new BeanPropertyRowMapper<>(InformationQuery.class)).stream().collect(Collectors.toMap(l -> l.getId() + "", l -> l.getClassify() + ""));
 
             try {
@@ -2340,7 +2342,7 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
             }
             ids2 = ids2.substring(0, ids2.length() - 1);
         }
-        List<InformationQuery> queryList = jdbcTemplate.query("select id, e_visa_pdf_url, status from u_information_query where id in( " + ids + ") and is_deleted=0 and status in (1,2)", new BeanPropertyRowMapper<>(InformationQuery.class));
+        List<InformationQuery> queryList = jdbcTemplate.query("select id, e_visa_pdf_url, status ,project_id,contract_id from u_information_query where id in( " + ids + ") and is_deleted=0 and status in (1,2)", new BeanPropertyRowMapper<>(InformationQuery.class));
         String sqlqu = "update u_information_query set status=2,e_visa_pdf_url='' where id in( " + ids + ") and is_deleted=0 and status in (1,2)";
         String sqlForTask = "update u_task set status=2 where form_data_id in( " + ids2 + ") and status in(1,2) and is_deleted=0 ";
         String sqlForTaskPall = "update u_task_parallel a INNER JOIN u_task b on a.process_instance_id = b.process_instance_id set a.is_resign = 1, a.`status`=2 , a.e_visa_status=1 ,a.e_visa_content='电签成功' where b.form_data_id in( " + ids2 + ") and b.status in(0,1,2) and b.is_deleted = 0 and a.`status` in(0,1,3)";
@@ -2368,6 +2370,7 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
             requestMap.put("userIds", userIds);
             recordResignLog("一键重签", ids, queryList, requestMap, null, null, null);
         }
+        taskProgressService.addTaskProgress(queryList.get(0).getProjectId(), queryList.get(0).getContractId(), 4,queryList.size(),ids);
         return R.success("操作成功");
     }
 

+ 4 - 11
blade-service/blade-business/src/main/java/org/springblade/business/sync/TaskSync.java

@@ -1,26 +1,18 @@
 package org.springblade.business.sync;
 
 import cn.hutool.core.date.DateTime;
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
-import com.google.common.collect.Lists;
 import lombok.AllArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
-import org.springblade.business.dto.reSigningEVisaStatus;
 import org.springblade.business.entity.InformationQuery;
-import org.springblade.business.service.IInformationQueryFileService;
 import org.springblade.business.service.IInformationQueryService;
 import org.springblade.common.utils.SystemUtils;
-import org.springblade.core.log.exception.ServiceException;
-import org.springblade.core.redis.cache.BladeRedis;
 import org.springblade.core.tool.api.R;
-import org.springblade.manager.entity.WbsTreeSynchronousRecord;
 import org.springblade.manager.feign.ExcelTabClient;
+import org.springblade.business.feign.TaskProgressClient;
 import org.springblade.system.user.feign.IUserClient;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.scheduling.annotation.Async;
 import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Component;
 
@@ -29,7 +21,6 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.concurrent.CompletableFuture;
 import java.util.concurrent.ThreadPoolExecutor;
-import java.util.stream.Collectors;
 
 /**
  * @author LHB
@@ -49,6 +40,8 @@ public class TaskSync {
     @Resource
     private IUserClient userClient;
 
+    private final TaskProgressClient taskProgressClient;
+
 
     public void reSigningEVisaStatusSync(InformationQuery dto, String header) {
         log.info("数据正在重刷,线程名称:{}", Thread.currentThread().getName());
@@ -75,7 +68,7 @@ public class TaskSync {
         }
         lambda.set(InformationQuery::getUpdateTime, DateTime.now());
         lambda.eq(InformationQuery::getId, dto.getId());
-
+        taskProgressClient.updateTaskProgress(dto.getProjectId(), dto.getContractId(), 1, 1,dto.getId()+"");
         informationQueryService.update(lambda);
         log.info("数据重刷完毕,线程名称:{}", Thread.currentThread().getName());
     }

+ 3 - 0
blade-service/blade-e-visa/src/main/java/org/springblade/evisa/service/impl/EVDataServiceImpl.java

@@ -15,6 +15,7 @@ import org.springblade.business.entity.InformationQuery;
 import org.springblade.business.entity.TrialSelfInspectionRecord;
 import org.springblade.business.feign.MessageWarningClient;
 import org.springblade.business.feign.TaskClient;
+import org.springblade.business.feign.TaskProgressClient;
 import org.springblade.business.vo.TaskSignInfoVO;
 import org.springblade.business.vo.TrialRawMaterialSelfRecord;
 import org.springblade.common.constant.CommonConstant;
@@ -69,6 +70,8 @@ public class EVDataServiceImpl implements EVDataService {
     @Autowired
      private final MessageWarningClient messageWarningClient;
 
+    private final TaskProgressClient taskProgressClient;
+
     /**
      * 电签主要流程
      *

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

@@ -10,10 +10,10 @@ import org.springblade.business.vo.ScrSignInfoVO;
 import org.springblade.common.utils.CommonUtil;
 import org.springblade.core.tool.utils.CollectionUtil;
 import org.springblade.core.tool.utils.Func;
-import org.springblade.core.tool.utils.StringUtil;
 import org.springblade.evisa.service.ScrDataService;
 import org.springblade.evisa.utils.PdfAddimgUtil;
 import org.springblade.evisa.vo.SignKeyVO;
+import org.springblade.business.feign.TaskProgressClient;
 import org.springblade.manager.vo.PDFIndexInfo;
 import org.springframework.data.redis.core.StringRedisTemplate;
 import org.springframework.jdbc.core.JdbcTemplate;
@@ -29,6 +29,7 @@ public class ScrDataServiceImpl implements ScrDataService {
 
     private final JdbcTemplate jdbcTemplate;
     private final StringRedisTemplate RedisTemplate;
+
     // 主流程
     @Override
     public void sctTaskBatch(ScrSignInfoVO taskApp) throws Exception {