Browse Source

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

yangyj 8 months ago
parent
commit
6899bde55b

+ 1 - 0
blade-service-api/blade-business-api/src/main/java/org/springblade/business/vo/TaskApprovalVO.java

@@ -26,6 +26,7 @@ public class TaskApprovalVO {
     @ApiModelProperty("数据源")
     private String formDataId;
 
+    // 1=填报数据 2=工程文件 3=日志资料 4=档案数据
     @ApiModelProperty("上报类型")
     private Integer approvalType;
 

+ 1 - 1
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/entity/TableFile.java

@@ -66,7 +66,7 @@ public class TableFile implements Serializable {
      */
     private String extension;
     /**
-     * 1 表示表单 2表示附件 10节点附件
+     * 1 表示表单 2表示附件 10节点附件 11混凝土强度报告 12 28d混凝土强度报告
      */
     private Integer type;
     /**

+ 1 - 0
blade-service/blade-business/src/main/java/org/springblade/business/service/impl/TaskServiceImpl.java

@@ -168,6 +168,7 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
             case 3:
                 //日志资料
                 return this.queryTheLogFileBusinessData(taskApprovalVO.getFormDataId());
+
             default:
                 return null;
         }

+ 3 - 3
blade-service/blade-e-visa/src/main/java/org/springblade/evisa/controller/EVisaController.java

@@ -56,11 +56,11 @@ public class EVisaController {
 
     // 电签主类
 
-    @Scheduled(cron = "0/20 * * * * ?")
+    @Scheduled(cron = "0/30 * * * * ?")
     public void SignInfo() {
         //执行代码
         log.info("扫描开始");
-        String sql = "SELECT * from u_task_batch where is_deleted<>5 LIMIT 40";
+        String sql = "SELECT * from u_task_batch where is_deleted<>5  and task_parallel_id=1765613633921875968 LIMIT 40";
         List<Map<String, Object>> maps = jdbcTemplate.queryForList(sql);
         if (maps != null && maps.size() >= 1) {
             for (Map<String, Object> dataInfo : maps) {
@@ -74,7 +74,7 @@ public class EVisaController {
                     taskApprovalVO.setId(taskBatchId);
                     taskApprovalVO.setUserId(userId);
                     taskApprovalVO.setNickName(nickName);
-                    System.out.println("---------" + aBoolean);
+
                     if (!aBoolean) {
                         RedisTemplate.opsForValue().set("sign-" + taskApprovalVO.getFormDataId(), "1",120, TimeUnit.SECONDS);
                         CompletableFuture<Void> runAsync = CompletableFuture.runAsync(() -> {

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

@@ -33,6 +33,7 @@ import cfca.paperless.dto.response.tx40.SealPdfResponse;
 import cfca.paperless.dto.response.tx40.VerifyPdfSealResponse;
 import cn.hutool.core.io.file.FileReader;
 import com.alibaba.fastjson.JSONObject;
+import com.spire.xls.Workbook;
 import lombok.AllArgsConstructor;
 import org.apache.commons.io.IOUtils;
 import org.apache.commons.lang.StringUtils;
@@ -410,10 +411,25 @@ public class EVisaServiceImpl implements EVisaService {
         }
 
         //根据任务类型获取对应的文件信息
-        TaskApprovalVO taskFile = this.taskClient.queryBusinessDataTask(JSONObject.parseObject(JSONObject.toJSONString(task), TaskApprovalVO.class));
+        TaskApprovalVO taskFile=new TaskApprovalVO();
+        if(task.getApprovalType()<=4){
+            //上报类型,1填报资料,2工程文件,3日志资料  ,  4档案数据
+            taskFile = this.taskClient.queryBusinessDataTask(JSONObject.parseObject(JSONObject.toJSONString(task), TaskApprovalVO.class));
+        } else if (task.getApprovalType()<=8 && task.getApprovalType()>=5) {
+           // 计量任务类型  5 = 中间计量申请,6 = 材料计量单,7 = 开工预付款计量单,8 = 变更令
+            Map<String, Object> map =new HashMap<>();
+            if(task.getApprovalType()==6 || task.getApprovalType()==7){
+                map = this.jdbcTemplate.queryForMap("select * from  s_material_start_statement where meter_period_id = " + task.getFormDataId());
+                taskFile.setApprovalFileList(map.get("period_number")+"", map.get("raw_url")+"");
+            }else if (task.getApprovalType()==5) {
+                map = this.jdbcTemplate.queryForMap("select * from s_interim_pay_certificate where contract_period_id = " + task.getFormDataId());
+                taskFile.setApprovalFileList(map.get("period_number")+"", map.get("raw_url")+"");
+            }
+            taskFile.setRemarkType("1");
+        }
+
         if (taskFile == null || taskFile.getApprovalFileList().size() <= 0) {
             //没有找到业务文件,取消签章
-            System.out.println("------1------");
             RedisTemplate.delete("sign-" + task.getFormDataId());
             return NOT_PFX_SGIN;
         }
@@ -1534,4 +1550,5 @@ public class EVisaServiceImpl implements EVisaService {
         sealStrategy.setSignWithKeywordInfo(keyword, offSetX, offSetY);
         return sealStrategy;
     }
+
 }

+ 2 - 2
blade-service/blade-manager/src/main/java/org/springblade/manager/controller/ExcelTabController.java

@@ -3921,7 +3921,7 @@ public class ExcelTabController extends BladeController {
             @ApiImplicitParam(name = "nodeId", value = "nodeId", required = true),
 
     })
-    public R addBussFile(@RequestParam("file") MultipartFile[] file, String nodeId) {
+    public R addBussFile(@RequestParam("file") MultipartFile[] file, String nodeId,Integer type) {
         List<TableFile> fileList = new ArrayList<>();
         if (file != null && file.length >= 1) {
             for (MultipartFile multipartFile : file) {
@@ -3933,7 +3933,7 @@ public class ExcelTabController extends BladeController {
                 String fileExtension = FileUtil.getFileExtension(bladeFile1.getName()).toLowerCase();
                 tableFile.setTabId(nodeId + "");
                 tableFile.setName(multipartFile.getOriginalFilename());
-                tableFile.setType(10);
+                tableFile.setType(type); //10 代表附件
                 tableFile.setDomainUrl(bladeFile1.getLink());
                 tableFile.setIsDeleted(0);
                 tableFile.setExtension(fileExtension);

+ 37 - 16
blade-service/blade-meter/src/main/java/org/springblade/meter/controller/TaskController.java

@@ -20,16 +20,16 @@ import lombok.AllArgsConstructor;
 import lombok.Data;
 import org.apache.commons.lang.StringUtils;
 import org.apache.commons.lang.time.DateUtils;
+import org.apache.poi.hssf.usermodel.HSSFFont;
+import org.apache.poi.hssf.usermodel.HSSFRichTextString;
 import org.apache.poi.ss.usermodel.*;
 import org.apache.poi.util.IOUtils;
+import org.apache.poi.xssf.usermodel.XSSFRichTextString;
 import org.apache.poi.xssf.usermodel.XSSFWorkbook;
 import org.jsoup.Jsoup;
 import org.jsoup.nodes.Element;
 import org.jsoup.select.Elements;
-import org.springblade.business.entity.FixedFlow;
-import org.springblade.business.entity.FixedFlowLink;
-import org.springblade.business.entity.Task;
-import org.springblade.business.entity.TaskParallel;
+import org.springblade.business.entity.*;
 import org.springblade.business.feign.TaskClient;
 import org.springblade.common.constant.ClientIdConstant;
 import org.springblade.common.constant.CommonConstant;
@@ -2828,11 +2828,21 @@ public class TaskController extends BladeController {
                 }
                 /*合并所有表*/
                 fileUrl = report.getReportPdf(file_path, reportResults);
+                // 添加电签任务列表
+                addSignTaskBatch(report);
             }
         }
         return R.data(fileUrl);
     }
 
+    // 添加电签任务列表
+    public void addSignTaskBatch(Report report){
+        String sql=" insert INTO u_task_batch(id,task_parallel_id,json_data,create_user,create_dept,create_time,update_user,update_time,status,is_deleted,nick_name) "+
+                   " SELECT a.id,a.process_instance_id,json_object('approvalFileList',json_array(),'approvalType',4+b.meter_task_type,'comment','','flag','OK','formDataId',b.form_data_id,'parallelProcessInstanceId',a.parallel_process_instance_id,'pass',true,'taskId',b.id) as  json_data,a.task_user,a.create_dept,a.create_time,a.update_user,a.update_time,1 as status,0 as is_deleted,a.task_user_name as nick_name "+
+                   " from u_task_parallel a,u_task b where a.process_instance_id=b.process_instance_id and b.form_data_id="+report.getPeriodId()+" and b.meter_task_type="+(Func.toInt(report.getType())+1);
+        jdbcTemplate.execute(sql);
+    }
+
     public void setTitle(Sheet sheet, String name) {
         Row row = sheet.getRow(0);
         Cell cell = row.getCell(0);
@@ -2869,7 +2879,7 @@ public class TaskController extends BladeController {
             String htmlString = IoUtil.readToString(fileInputStream);
             org.jsoup.nodes.Document htmldoc = Jsoup.parse(htmlString);
             Elements dqlist = htmldoc.getElementsByAttribute("dqid");
-            if(dqlist!=null && !dqlist.isEmpty()){
+            if(dqlist!=null && dqlist.size()>0){
                 dqlist.forEach(element -> {
                     System.out.println(element.hasAttr("y1"));
                     int y1=0;
@@ -2886,19 +2896,33 @@ public class TaskController extends BladeController {
                     Row row = sheet.getRow(y1 - 1);
                     if (row != null) {
                         Cell cell = row.getCell(x1 - 1);
-                        if (cell != null) {
-                            /*if(title.equals("重庆试验项目-中期支付汇总表")){
-                                System.out.println(title+"------坐标------"+y1+"__"+x1+"===="+element.attr("dqid"));
-                            }*/
-                            cell.setCellValue(element.attr("dqid"));
+                        if (cell != null && ObjectUtil.isNotEmpty(cell)) {
+
+                            String dataInfo = cell.getStringCellValue();
+                            String dqVal = element.attr("dqid");
+                            //调用方法设置字体样式到单元格中的指定字符
                             Workbook workbook = cell.getSheet().getWorkbook();
                             CellStyle cellStyle = workbook.createCellStyle();
                             cellStyle.cloneStyleFrom(cell.getCellStyle());
 
                             Font newFont = workbook.createFont();
-                            newFont.setColor(IndexedColors.WHITE.getIndex());
-                            newFont.setFontHeightInPoints((short) 2);
-                            cellStyle.setFont(newFont);
+                            newFont.setFontHeightInPoints(workbook.getFontAt(cell.getCellStyle().getFontIndex()).getFontHeightInPoints());
+
+                            if (dataInfo==null||StringUtil.isEmpty(dataInfo)){
+                                cell.setCellValue(dqVal);
+                                newFont.setFontHeightInPoints((short) 1);
+                                newFont.setColor(IndexedColors.WHITE.getIndex());
+                                cellStyle.setFont(newFont);
+                            }else{
+                                String lastData = dataInfo+"*"+dqVal;
+                                RichTextString richString = new XSSFRichTextString(lastData);
+                                richString.clearFormatting();
+                                richString.applyFont(0,dataInfo.length(),newFont);
+                                newFont.setFontHeightInPoints((short) 1);
+                                newFont.setColor(IndexedColors.WHITE.getIndex());
+                                richString.applyFont(dataInfo.length(),lastData.length(),newFont);
+                                cell.setCellValue(richString);
+                            }
                             cell.setCellStyle(cellStyle);
                         }
                     }
@@ -3037,7 +3061,6 @@ public class TaskController extends BladeController {
                     taskClient.saveFixedFlowLink(fixedFlowId, fixedBranch.getName(), fixedBranch.getType(),
                             fixedBranch.getUserIds(), dto.getProjectId(), dto.getContractId(), sort++);
                 }
-
                 return R.success("操作成功");
             }
 
@@ -3084,12 +3107,10 @@ public class TaskController extends BladeController {
                     }
 
                     fixedBranchVO.setUserList(userListResult);
-
                     fixedBranchVOList.add(fixedBranchVO);
                 }
 
                 vo.setFixedBranchVOList(fixedBranchVOList);
-
                 return R.data(vo);
             }
         }