|
@@ -75,7 +75,6 @@ import java.io.*;
|
|
|
import java.lang.reflect.InvocationTargetException;
|
|
|
import java.lang.reflect.Method;
|
|
|
import java.math.BigDecimal;
|
|
|
-import java.sql.SQLException;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.time.LocalDate;
|
|
|
import java.time.Month;
|
|
@@ -2814,7 +2813,7 @@ public class TaskController extends BladeController {
|
|
|
/*设置表头*/
|
|
|
setTitle(sheet, tile);
|
|
|
/*添加电签*/
|
|
|
- setDQInfo(sheet, rs);
|
|
|
+ setDQInfo(sheet,rs,tile);
|
|
|
//去掉表格虚线
|
|
|
sheet.setPrintGridlines(false);
|
|
|
//设置 整个工作表为一页
|
|
@@ -2870,15 +2869,17 @@ public class TaskController extends BladeController {
|
|
|
}
|
|
|
|
|
|
// 添加电签任务列表
|
|
|
- public void addSignTaskBatch(Report report) {
|
|
|
- try {
|
|
|
- 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);
|
|
|
- } catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
- }
|
|
|
+ public void addSignTaskBatch(Report report){
|
|
|
+ // 修改个人电签状态
|
|
|
+ String UPSql ="update u_task_parallel a set a.status=1,e_visa_status=0,e_visa_content='' where a.process_instance_id = (select b.process_instance_id from u_task b where b.form_data_id="+report.getPeriodId()+" and b.meter_task_type="+(Func.toInt(report.getType())+1)+")";
|
|
|
+ String DeSql ="delete from u_task_batch where task_parallel_id = (select b.process_instance_id from u_task b where b.form_data_id="+report.getPeriodId()+" and b.meter_task_type="+(Func.toInt(report.getType())+1)+")";
|
|
|
+ jdbcTemplate.execute(UPSql);
|
|
|
+ //删除以前存在的电签
|
|
|
+ jdbcTemplate.execute(DeSql);
|
|
|
+ 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) {
|
|
@@ -2900,77 +2901,7 @@ public class TaskController extends BladeController {
|
|
|
}
|
|
|
|
|
|
// 添加电签信息数据
|
|
|
- public void setDQInfoOld(Sheet sheet, String htmlUrl, String title) {
|
|
|
- String file_path = "/www/wwwroot/Users/hongchuangyanfa/Desktop/";//CollectionUtils.getSysLocalFileUrl();
|
|
|
- // 添加电签关键字Id
|
|
|
- String sys_file_net_url = ParamCache.getValue(CommonConstant.SYS_FILE_NET_URL);
|
|
|
- File file = null;
|
|
|
- InputStream fileInputStream;
|
|
|
- try {
|
|
|
- file = ResourceUtil.getFile(htmlUrl);
|
|
|
- if (file.exists()) {
|
|
|
- fileInputStream = new FileInputStream(file);
|
|
|
- } else {
|
|
|
- String path = sys_file_net_url + htmlUrl.replaceAll("//", "/").replaceAll(file_path, "");
|
|
|
- fileInputStream = CommonUtil.getOSSInputStream(path);
|
|
|
- }
|
|
|
- String htmlString = IoUtil.readToString(fileInputStream);
|
|
|
- org.jsoup.nodes.Document htmldoc = Jsoup.parse(htmlString);
|
|
|
- Elements dqlist = htmldoc.getElementsByAttribute("dqid");
|
|
|
- if (dqlist != null && dqlist.size() > 0) {
|
|
|
- dqlist.forEach(element -> {
|
|
|
- System.out.println(element.hasAttr("y1"));
|
|
|
- int y1 = 0;
|
|
|
- int x1 = 0;
|
|
|
- if (!element.hasAttr("y1") && !element.hasAttr("x1")) {
|
|
|
- Element element2 = element.children().get(0);
|
|
|
- y1 = Func.toInt(element2.attr("y1"));
|
|
|
- x1 = Func.toInt(element2.attr("x1"));
|
|
|
- } else {
|
|
|
- y1 = Func.toInt(element.attr("y1"));
|
|
|
- x1 = Func.toInt(element.attr("x1"));
|
|
|
- }
|
|
|
-
|
|
|
- Row row = sheet.getRow(y1 - 1);
|
|
|
- if (row != null) {
|
|
|
- Cell cell = row.getCell(x1 - 1);
|
|
|
- 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.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);
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
- } catch (Exception e) {
|
|
|
- throw new RuntimeException(e);
|
|
|
- }
|
|
|
- }
|
|
|
- public void setDQInfo(Sheet sheet, ReportResult rs){
|
|
|
+ public void setDQInfo(Sheet sheet, ReportResult rs,String title){
|
|
|
/*电签信息已经和坐标一起给出*/
|
|
|
/*具体获取方法在 FormulaUtils 里的 public static Map<String,String> getESignMap(Document document)*/
|
|
|
Map<String,String> signMap =rs.getESignMap();
|
|
@@ -3014,7 +2945,6 @@ public class TaskController extends BladeController {
|
|
|
}catch (Exception e){
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
-
|
|
|
});
|
|
|
}else{
|
|
|
System.out.println(rs.getName()+"未找到电签配置信息");
|