|
@@ -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);
|
|
|
}
|
|
|
}
|