|
@@ -48,6 +48,7 @@ import org.springblade.common.constant.CommonConstant;
|
|
|
import org.springblade.common.utils.BaseUtils;
|
|
|
import org.springblade.common.utils.CommonUtil;
|
|
|
import org.springblade.common.utils.SnowFlakeUtil;
|
|
|
+import org.springblade.common.utils.SystemUtils;
|
|
|
import org.springblade.common.vo.DataVO;
|
|
|
import org.springblade.core.boot.ctrl.BladeController;
|
|
|
import org.springblade.core.log.exception.ServiceException;
|
|
@@ -65,6 +66,7 @@ import org.springblade.evisa.vo.SigInfoVO;
|
|
|
import org.springblade.feign.ArchiveFileTaskClient;
|
|
|
import org.springblade.manager.entity.*;
|
|
|
import org.springblade.manager.feign.*;
|
|
|
+import org.springblade.manager.vo.ExecutionTime;
|
|
|
import org.springblade.manager.vo.ReportMergeCellsConfig;
|
|
|
import org.springblade.manager.vo.ReportResult;
|
|
|
import org.springblade.meter.config.MyJdbcTemplate;
|
|
@@ -3555,9 +3557,12 @@ public class TaskController extends BladeController {
|
|
|
/*数据完全独立互不影响,可以并发生成,预估PDF的总大小来决定是否全部在内存中生成PDF*/
|
|
|
/*分为新增和更新*/
|
|
|
/*如果数据没有变化,则各表的PDF可以不用更新*/
|
|
|
+ ExecutionTime executionTime = new ExecutionTime();
|
|
|
List<ReportResult> reportResults = formulaClient.formulaExecute3(report.getContractId(), report.getId(), report.getType());
|
|
|
+ executionTime.info("公式执行");
|
|
|
String fileUrl = null;
|
|
|
if (Func.isNotEmpty(reportResults)) {
|
|
|
+ CompletableFuture<Map<Long ,List<DqTime>>> dqTimeMap=getDqTime(reportResults.stream().map(s->s.getPkeyId().toString()).collect(Collectors.joining(",")), report.getContractId(), report.getPeriodId());
|
|
|
/*List<String> dataListPdf = new ArrayList<>();*/
|
|
|
String file_path = CollectionUtils.getSysLocalFileUrl();
|
|
|
Map<String, Object> projectMap = jdbcTemplate.queryForMap("select b.project_name projectName from m_contract_info a join m_project_info b on a.p_id=b.id where a.id= " + report.getContractId());
|
|
@@ -3576,6 +3581,7 @@ public class TaskController extends BladeController {
|
|
|
rawDataMap.put("C",rs.getCommonData());
|
|
|
rawDataMap.put("D",rs.getData());
|
|
|
rawListMap.put(rs.getInitTableName(),rawDataMap);
|
|
|
+ /*动态隐藏行*/
|
|
|
if (rs.getInitTableName().equals("m_20240325154016_1772166597482381312")||rs.getInitTableName().equals("m_20240710170847_1810964374177710080")) {
|
|
|
List<Map.Entry<String,Object>> entries=rs.getData().get(0).entrySet().stream().filter(e->Integer.parseInt(e.getKey().split("_")[1])==1).sorted(Comparator.comparingInt(e->Integer.parseInt(e.getKey().split("_")[0]))).collect(Collectors.toList());
|
|
|
List<String> list =entries.stream().map(e->e.getValue().toString()).collect(Collectors.toList());
|
|
@@ -3623,6 +3629,16 @@ public class TaskController extends BladeController {
|
|
|
doc.open();
|
|
|
/* String tile = rs.getName().contains("封面") ? projectName : projectName + StringPool.DASH + rs.getName();*/
|
|
|
String title = rs.createTitle(projectName);
|
|
|
+ // 添加签字时间
|
|
|
+ List<DqTime> dqTimes= dqTimeMap.get().get(rs.getPkeyId());
|
|
|
+ if(dqTimes!=null&&dqTimes.size()>0){
|
|
|
+ Map<String,Object> commonData= rs.getCommonData();
|
|
|
+ Map<String,String> coordsMap=rs.getCoordinateMap();
|
|
|
+ dqTimes.forEach(s->{
|
|
|
+ String coords = coordsMap.get(s.getColKey().split("__")[0]);
|
|
|
+ commonData.put(coords,s.getCreateTime());
|
|
|
+ });
|
|
|
+ }
|
|
|
/*把公共部分内容释放到每一页*/
|
|
|
rs.putCommon();
|
|
|
/*合并单元格的配置信息*/
|
|
@@ -3636,7 +3652,7 @@ public class TaskController extends BladeController {
|
|
|
Sheet sheet = workbook.getSheetAt(0);
|
|
|
sheet.setForceFormulaRecalculation(true);
|
|
|
// 添加签字时间
|
|
|
- dataMap = setDQTimeInfo(dataMap,rs.getPkeyId(),report.getContractId(),report.getPeriodId(),rs.getUrl());
|
|
|
+ /* dataMap = setDQTimeInfo(dataMap, rs.getPkeyId(), report.getContractId(), report.getPeriodId(), rs.getUrl());*/
|
|
|
if (Func.isNotEmpty(dataMap)) {
|
|
|
for (String keys : dataMap.keySet()) {
|
|
|
int y1 = Func.toInt(keys.split("_")[0]);
|
|
@@ -3924,6 +3940,29 @@ public class TaskController extends BladeController {
|
|
|
StaticLog.error(e.getMessage());
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ @Data
|
|
|
+ public static class DqTime{
|
|
|
+ private Long pkeyId;
|
|
|
+ private String colKey;
|
|
|
+ private String createTime;
|
|
|
+ public DqTime() {
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public CompletableFuture<Map<Long ,List<DqTime>>> getDqTime(String pkeyIds,Long contractId,Long perId){
|
|
|
+ return CompletableFuture.supplyAsync(() -> {
|
|
|
+ String timeSql = "SELECT DISTINCT a.time_col_key colKey,DATE_FORMAT(c.create_time, '%Y年%m月%d日')as create_time ,a.tab_id pkeyId from m_textdict_info a ,m_project_assignment_user b,u_task_parallel c ,u_task d where a.sig_role_id=b.role_id and b.user_id=c.task_user and c.process_instance_id=d.process_instance_id and b.contract_id="+contractId+" and LENGTH(a.time_col_key)>=2 " +
|
|
|
+ "and d.form_data_id="+perId+" and a.tab_id in ("+pkeyIds+")";
|
|
|
+ List<DqTime> dqTimeList= jdbcTemplate.query(timeSql, new BeanPropertyRowMapper<>(DqTime.class));
|
|
|
+ if(dqTimeList.size()>0){
|
|
|
+ return dqTimeList.stream().collect(Collectors.groupingBy(DqTime::getPkeyId));
|
|
|
+ }
|
|
|
+ return new HashMap<>();
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
// 添加签字时间
|
|
|
public Map<String, Object> setDQTimeInfo(Map<String, Object> dataMap, Long pkeyId,Long contractId,Long perId,String htmlUrl) {
|
|
|
String timeSql = "SELECT DISTINCT a.time_col_key,DATE_FORMAT(c.create_time, '%Y年%m月%d日') as create_time from m_textdict_info a ,m_project_assignment_user b,u_task_parallel c ,u_task d where a.sig_role_id=b.role_id and b.user_id=c.task_user and c.process_instance_id=d.process_instance_id and b.contract_id="+contractId+" and LENGTH(a.time_col_key)>=2 " +
|