|
@@ -1324,7 +1324,7 @@ public class TaskController extends BladeController {
|
|
WbsTreePrivate aPrivate = r.getData();
|
|
WbsTreePrivate aPrivate = r.getData();
|
|
//获取所有的key
|
|
//获取所有的key
|
|
Map<String, String> map = FileUtils.getHtmlAllKey(aPrivate.getHtmlUrl());
|
|
Map<String, String> map = FileUtils.getHtmlAllKey(aPrivate.getHtmlUrl());
|
|
-// Map<String, String> map = FileUtils.getHtmlAllKey("C:\\Users\\泓创研发01\\Desktop\\fsdownload\\1789967486389583872.html");
|
|
|
|
|
|
+// Map<String, String> map = FileUtils.getHtmlAllKey("C:\\Users\\泓创研发01\\Desktop\\fsdownload\\1802649593746292736.html");
|
|
if (map.size() == 0){
|
|
if (map.size() == 0){
|
|
throw new ServiceException("未获取到html中的keyName");
|
|
throw new ServiceException("未获取到html中的keyName");
|
|
}
|
|
}
|
|
@@ -2451,7 +2451,7 @@ public class TaskController extends BladeController {
|
|
String html = this.getExcelHtmlByBuss(Long.valueOf(task.getProjectId()));
|
|
String html = this.getExcelHtmlByBuss(Long.valueOf(task.getProjectId()));
|
|
if (html != null) {
|
|
if (html != null) {
|
|
if (task.getMeterTaskType() != null && task.getMeterTaskType() == 1) {
|
|
if (task.getMeterTaskType() != null && task.getMeterTaskType() == 1) {
|
|
- //判断当前用户所属流程,只处理第一流程
|
|
|
|
|
|
+ //判断当前用户所属流程,只处理审计流程
|
|
Integer currentUserFlow = null;
|
|
Integer currentUserFlow = null;
|
|
Integer auditFlow = null;
|
|
Integer auditFlow = null;
|
|
Boolean isDefiniteFlow = false;
|
|
Boolean isDefiniteFlow = false;
|
|
@@ -2482,7 +2482,7 @@ public class TaskController extends BladeController {
|
|
WbsTreePrivate aPrivate = (WbsTreePrivate) r.getData();
|
|
WbsTreePrivate aPrivate = (WbsTreePrivate) r.getData();
|
|
//获取所有的key
|
|
//获取所有的key
|
|
Map<String, String> map = FileUtils.getHtmlAllKey(aPrivate.getHtmlUrl());
|
|
Map<String, String> map = FileUtils.getHtmlAllKey(aPrivate.getHtmlUrl());
|
|
-// Map<String, String> map = FileUtils.getHtmlAllKey("C:\\Users\\泓创研发01\\Desktop\\fsdownload\\1789967486389583872.html");
|
|
|
|
|
|
+// Map<String, String> map = FileUtils.getHtmlAllKey("C:\\Users\\泓创研发01\\Desktop\\fsdownload\\1802649593746292736.html");
|
|
if (map.size() == 0){
|
|
if (map.size() == 0){
|
|
throw new ServiceException("未获取到html中的keyName");
|
|
throw new ServiceException("未获取到html中的keyName");
|
|
}
|
|
}
|
|
@@ -2511,6 +2511,26 @@ public class TaskController extends BladeController {
|
|
isAllApp = true;
|
|
isAllApp = true;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ //任务
|
|
|
|
+ Task updateTask = new Task();
|
|
|
|
+ updateTask.setId(task.getId());
|
|
|
|
+ Map<String, Object> tableData = dto.getTableData();
|
|
|
|
+ Object object = tableData.get(map.get("造价机构现场咨询意见_本期审核进度款(元)"));
|
|
|
|
+ if (object != null) {
|
|
|
|
+ try {
|
|
|
|
+ BigDecimal decimal = new BigDecimal(object.toString());
|
|
|
|
+ updateTask.setTaskCommonMoney(decimal);
|
|
|
|
+ Object object2 = tableData.get(map.get("造价机构现场咨询意见_截止上期已累计审批进度款(元)"));
|
|
|
|
+ if (object2 != null) {
|
|
|
|
+ BigDecimal decimal2 = new BigDecimal(object2.toString());
|
|
|
|
+ tableData.put(map.get("造价机构现场咨询意见_截止上期已累计审批进度款(元)_截止本期已累计审核进度款(元)"), decimal.add(decimal2));
|
|
|
|
+ } else {
|
|
|
|
+ tableData.put(map.get("造价机构现场咨询意见_截止上期已累计审批进度款(元)_截止本期已累计审核进度款(元)"), decimal);
|
|
|
|
+ }
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ throw new ServiceException("本期审核进度款格式不对");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
//保存数据到m表
|
|
//保存数据到m表
|
|
String delSql = "delete from " + aPrivate.getInitTableName() + " where p_key_id=" + task.getId();
|
|
String delSql = "delete from " + aPrivate.getInitTableName() + " where p_key_id=" + task.getId();
|
|
jdbcTemplate.execute(delSql);
|
|
jdbcTemplate.execute(delSql);
|
|
@@ -2537,26 +2557,6 @@ public class TaskController extends BladeController {
|
|
sqlInfo = sqlInfo + keyStr + ") VALUES (" + valStr + ")";
|
|
sqlInfo = sqlInfo + keyStr + ") VALUES (" + valStr + ")";
|
|
jdbcTemplate.execute(sqlInfo);
|
|
jdbcTemplate.execute(sqlInfo);
|
|
|
|
|
|
- //任务
|
|
|
|
- Task updateTask = new Task();
|
|
|
|
- updateTask.setId(task.getId());
|
|
|
|
- Map<String, Object> tableData = dto.getTableData();
|
|
|
|
- Object object = tableData.get(map.get("造价机构现场咨询意见_本期审核进度款(元)"));
|
|
|
|
- if (object != null) {
|
|
|
|
- try {
|
|
|
|
- BigDecimal decimal = new BigDecimal(object.toString());
|
|
|
|
- updateTask.setTaskCommonMoney(decimal);
|
|
|
|
- Object object2 = tableData.get(map.get("造价机构现场咨询意见_截止上期已累计审批进度款(元)"));
|
|
|
|
- if (object2 != null) {
|
|
|
|
- BigDecimal decimal2 = new BigDecimal(object2.toString());
|
|
|
|
- tableData.put(map.get("造价机构现场咨询意见_截止上期已累计审批进度款(元)_截止本期已累计审核进度款(元)"), decimal.add(decimal2));
|
|
|
|
- } else {
|
|
|
|
- tableData.put(map.get("造价机构现场咨询意见_截止上期已累计审批进度款(元)_截止本期已累计审核进度款(元)"), decimal);
|
|
|
|
- }
|
|
|
|
- } catch (Exception e) {
|
|
|
|
- throw new ServiceException("本期审核进度款格式不对");
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
//如果为第一流程则判断是否当前流程已全部审批,已经全部审批则生成电签PDF,没有全部审批则只保存数据
|
|
//如果为第一流程则判断是否当前流程已全部审批,已经全部审批则生成电签PDF,没有全部审批则只保存数据
|
|
if (isAllApp) {
|
|
if (isAllApp) {
|
|
//要求付款额度
|
|
//要求付款额度
|
|
@@ -2571,6 +2571,8 @@ public class TaskController extends BladeController {
|
|
throw new ServiceException("未找到流程人信息");
|
|
throw new ServiceException("未找到流程人信息");
|
|
}
|
|
}
|
|
tableData.put(map.get("项目名称:"), projectClient.getById(task.getProjectId()).getProjectName() + contractClient.getContractById(Long.valueOf(task.getContractId())).getContractName());
|
|
tableData.put(map.get("项目名称:"), projectClient.getById(task.getProjectId()).getProjectName() + contractClient.getContractById(Long.valueOf(task.getContractId())).getContractName());
|
|
|
|
+ //申请书收到时间
|
|
|
|
+ tableData.put(map.get("申请书收到时间:"), DateTimeFormatter.ofPattern("yyyy年MM月dd日").format(LocalDate.now()));
|
|
//申请进度时间
|
|
//申请进度时间
|
|
tableData.put(map.get("申请进度款摘录_摘录人_时间"), DateTimeFormatter.ofPattern("yyyy年MM月dd日").format(LocalDate.now()));
|
|
tableData.put(map.get("申请进度款摘录_摘录人_时间"), DateTimeFormatter.ofPattern("yyyy年MM月dd日").format(LocalDate.now()));
|
|
//电签单位日期
|
|
//电签单位日期
|
|
@@ -3559,15 +3561,25 @@ public class TaskController extends BladeController {
|
|
|
|
|
|
R<WbsTreePrivate> r = wbsTreePrivateClient.getProjectOpinionNode(projectId);
|
|
R<WbsTreePrivate> r = wbsTreePrivateClient.getProjectOpinionNode(projectId);
|
|
if (r.getCode() != 200){
|
|
if (r.getCode() != 200){
|
|
-// throw new ServiceException(r.getMsg());
|
|
|
|
//如果没有节点或者清单,直接判断不需要
|
|
//如果没有节点或者清单,直接判断不需要
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
|
|
+ Set<String> strings = new HashSet<>();
|
|
|
|
+ strings.add("项目名称:");
|
|
|
|
+ strings.add("申请书收到时间:");
|
|
|
|
+ strings.add("意见发出日期:");
|
|
|
|
+ strings.add("申请进度款摘录_摘录人_时间");
|
|
|
|
+ strings.add("造价机构现场咨询意见_截止上期已累计审批进度款(元)");
|
|
|
|
+ strings.add("造价机构现场咨询意见_截止上期已累计审批进度款(元)_截止本期已累计审核进度款(元)");
|
|
|
|
+ strings.add("造价机构现场咨询意见_现场造价人员");
|
|
|
|
+ strings.add("造价机构现场咨询意见_现场造价人员_负责人");
|
|
|
|
+ strings.add("建设单位签收");
|
|
|
|
+ strings.add("建设单位签收_日期");
|
|
WbsTreePrivate aPrivate = r.getData();
|
|
WbsTreePrivate aPrivate = r.getData();
|
|
String fileUrl = null;
|
|
String fileUrl = null;
|
|
String os = System.getProperty("os.name").toLowerCase();
|
|
String os = System.getProperty("os.name").toLowerCase();
|
|
if (os.contains("win")) {
|
|
if (os.contains("win")) {
|
|
- fileUrl = "C:\\Users\\泓创研发01\\Desktop\\fsdownload\\1789967486389583872.html";
|
|
|
|
|
|
+ fileUrl = "C:\\Users\\泓创研发01\\Desktop\\fsdownload\\1802649593746292736.html";
|
|
} else {
|
|
} else {
|
|
fileUrl = aPrivate.getHtmlUrl();
|
|
fileUrl = aPrivate.getHtmlUrl();
|
|
}
|
|
}
|
|
@@ -3578,7 +3590,19 @@ public class TaskController extends BladeController {
|
|
// 获取表单字符串返回
|
|
// 获取表单字符串返回
|
|
org.jsoup.nodes.Document doc = Jsoup.parse(htmlString);
|
|
org.jsoup.nodes.Document doc = Jsoup.parse(htmlString);
|
|
Element table = doc.select("table").first();
|
|
Element table = doc.select("table").first();
|
|
-
|
|
|
|
|
|
+ Elements tds = doc.getElementsByTag("td");
|
|
|
|
+ for (Element td : tds) {
|
|
|
|
+ Elements keyname = td.getElementsByAttribute("keyname");
|
|
|
|
+ String string = keyname.attr("keyname");
|
|
|
|
+ if (StringUtils.isNotBlank(string)) {
|
|
|
|
+ System.out.println(string);
|
|
|
|
+ String name = keyname.attr("placeholderxx").replaceAll("\\s", "");
|
|
|
|
+ if (strings.contains(name)){
|
|
|
|
+ td.attr("gscolor","11");
|
|
|
|
+ keyname.attr("disabled","");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
return table+"";
|
|
return table+"";
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
throw new ServiceException("解析咨询意见表单时发生异常");
|
|
throw new ServiceException("解析咨询意见表单时发生异常");
|
|
@@ -3613,7 +3637,7 @@ public class TaskController extends BladeController {
|
|
//数据不为空,构造数据
|
|
//数据不为空,构造数据
|
|
String fileUrl = aPrivate.getHtmlUrl();
|
|
String fileUrl = aPrivate.getHtmlUrl();
|
|
File file1 = ResourceUtil.getFile(fileUrl);
|
|
File file1 = ResourceUtil.getFile(fileUrl);
|
|
-// File file1 = ResourceUtil.getFile("C:\\Users\\泓创研发01\\Desktop\\fsdownload\\1789967486389583872.html");
|
|
|
|
|
|
+// File file1 = ResourceUtil.getFile("C:\\Users\\泓创研发01\\Desktop\\fsdownload\\1802649593746292736.html");
|
|
InputStream fileInputStream;
|
|
InputStream fileInputStream;
|
|
if (file1.exists()) {
|
|
if (file1.exists()) {
|
|
fileInputStream = new FileInputStream(file1);
|
|
fileInputStream = new FileInputStream(file1);
|
|
@@ -3632,6 +3656,57 @@ public class TaskController extends BladeController {
|
|
|
|
|
|
//实际电签人
|
|
//实际电签人
|
|
Set<User> sigUser = new HashSet<>();
|
|
Set<User> sigUser = new HashSet<>();
|
|
|
|
+ List<TextdictInfo> infoList = jdbcTemplate.query("select * from m_textdict_info where type in (2,6) and tab_id = " + aPrivate.getPKeyId(), new BeanPropertyRowMapper<>(TextdictInfo.class));
|
|
|
|
+ if (infoList.size() == 0){
|
|
|
|
+ throw new ServiceException("未找到审计意见的电签配置");
|
|
|
|
+ }
|
|
|
|
+ List<TextdictInfo> textdictInfos = infoList.stream().filter(l->l.getType() == 2).collect(Collectors.toList());
|
|
|
|
+ List<TextdictInfo> companyList = infoList.stream().filter(l->l.getType() == 6).collect(Collectors.toList());
|
|
|
|
+ Map<String, TextdictInfo> roleMap = new HashMap<>();
|
|
|
|
+ Map<Long,String> htmlDeptIdMap = new HashMap<>();
|
|
|
|
+
|
|
|
|
+ // 组装个人电签设置
|
|
|
|
+ if (textdictInfos != null && !textdictInfos.isEmpty()) {
|
|
|
|
+ //校验是否每个位置都能找到对应的人
|
|
|
|
+ List<String> roleIds = textdictInfos.stream().map(l -> l.getSigRoleId()).collect(Collectors.toList());
|
|
|
|
+ try {
|
|
|
|
+ roleMap = textdictInfos.stream().collect(Collectors.toMap(l -> l.getSigRoleId(), l -> l));
|
|
|
|
+ }catch (Exception e){
|
|
|
|
+ throw new ServiceException("在审计咨询意见表单中,电签位置不能配置相同角色");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //获取这些人资料合同段下的权限
|
|
|
|
+ List<JSONObject> userRoleList = this.saveUserInfoByProjectClient.queryUserContractRole(new ArrayList<>(flowIds.keySet()), contractId);
|
|
|
|
+ if (userRoleList == null || userRoleList.size() == 0) {
|
|
|
|
+ throw new ServiceException("电签时未找到审批人在合同段下的权限");
|
|
|
|
+ }
|
|
|
|
+ //确保每一个配置了电签的位置都能签名,并且设置好DQID和实际电签信息之间的映射关系,以便在HTML中写入
|
|
|
|
+ for (String roleId : roleIds) {
|
|
|
|
+ boolean isRole = true;
|
|
|
|
+ for (JSONObject userRole : userRoleList) {
|
|
|
|
+ if (roleId.contains(userRole.getString("roleId"))) {
|
|
|
|
+ List<User> userInfo = jdbcTemplate.query("select * from blade_user WHERE id =" + userRole.getString("userId"),new BeanPropertyRowMapper<>(User.class));
|
|
|
|
+ if (userInfo.size() != 1){
|
|
|
|
+ throw new ServiceException("未找到"+flowIds.get(Long.valueOf(userRole.getString("roleId")))+"的用户信息");
|
|
|
|
+ }
|
|
|
|
+ User user = userInfo.get(0);
|
|
|
|
+ sigUser.add(user);
|
|
|
|
+ htmlDeptIdMap.put(roleMap.get(roleId).getId(),user.getName()+user.getPhone().substring(0,3));
|
|
|
|
+ isRole = false;
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if (isRole){
|
|
|
|
+ throw new ServiceException("当前审批人中,不存在:"+roleMap.get(roleId).getSigRoleName()+",无法电签,请查看后台配置");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ //组装企业电签设置
|
|
|
|
+ if (companyList.size() != 0){
|
|
|
|
+ for (TextdictInfo textdictInfo : companyList) {
|
|
|
|
+ htmlDeptIdMap.put(textdictInfo.getId(),textdictInfo.getSigRoleName()+"123");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
|
|
if (ObjectUtil.isNotEmpty(DataInfo)) {
|
|
if (ObjectUtil.isNotEmpty(DataInfo)) {
|
|
for (String val : Objects.requireNonNull(DataInfo).keySet()) {
|
|
for (String val : Objects.requireNonNull(DataInfo).keySet()) {
|
|
@@ -3728,96 +3803,53 @@ public class TaskController extends BladeController {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
- // 组装电签设置
|
|
|
|
- List<TextdictInfo> textdictInfos = jdbcTemplate.query("select * from m_textdict_info where type in (2,6) and tab_id = " + aPrivate.getPKeyId(), new BeanPropertyRowMapper<>(TextdictInfo.class));
|
|
|
|
- if (textdictInfos != null && !textdictInfos.isEmpty()) {
|
|
|
|
- //校验是否每个位置都能找到对应的人
|
|
|
|
- List<String> roleIds = textdictInfos.stream().map(l -> l.getSigRoleId()).collect(Collectors.toList());
|
|
|
|
- Map<String, TextdictInfo> roleMap = new HashMap<>();
|
|
|
|
- try {
|
|
|
|
- roleMap = textdictInfos.stream().collect(Collectors.toMap(l -> l.getSigRoleId(), l -> l));
|
|
|
|
- }catch (Exception e){
|
|
|
|
- throw new ServiceException("在审计咨询意见表单中,电签位置不能配置相同角色");
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- //获取这些人资料合同段下的权限
|
|
|
|
- List<JSONObject> userRoleList = this.saveUserInfoByProjectClient.queryUserContractRole(new ArrayList<>(flowIds.keySet()), contractId);
|
|
|
|
- if (userRoleList == null || userRoleList.size() == 0) {
|
|
|
|
- throw new ServiceException("电签时未找到审批人在合同段下的权限");
|
|
|
|
- }
|
|
|
|
- Map<Long,String> htmlDeptIdMap = new HashMap<>();
|
|
|
|
- //确保每一个配置了电签的位置都能签名,并且设置好DQID和实际电签信息之间的映射关系,以便在HTML中写入
|
|
|
|
- for (String roleId : roleIds) {
|
|
|
|
- boolean isRole = true;
|
|
|
|
- for (JSONObject userRole : userRoleList) {
|
|
|
|
- if (roleId.contains(userRole.getString("roleId"))) {
|
|
|
|
- List<User> userInfo = jdbcTemplate.query("select * from blade_user WHERE id =" + userRole.getString("userId"),new BeanPropertyRowMapper<>(User.class));
|
|
|
|
- if (userInfo.size() != 1){
|
|
|
|
- throw new ServiceException("未找到"+flowIds.get(Long.valueOf(userRole.getString("roleId")))+"的用户信息");
|
|
|
|
- }
|
|
|
|
- User user = userInfo.get(0);
|
|
|
|
- sigUser.add(user);
|
|
|
|
- htmlDeptIdMap.put(roleMap.get(roleId).getId(),user.getName()+user.getPhone().substring(0,3));
|
|
|
|
- isRole = false;
|
|
|
|
- break;
|
|
|
|
- }
|
|
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ //修改输入框里面的值为电签标识
|
|
|
|
+ for (TextdictInfo e : infoList) {
|
|
|
|
+ String key = e.getColKey();
|
|
|
|
+ String[] keys = key.split("__");
|
|
|
|
+ String[] trtd = keys[1].split("_");
|
|
|
|
+ if (Integer.parseInt(trtd[0]) < trs.size()) {
|
|
|
|
+ Element ytzData = trs.get(Integer.parseInt(trtd[0]));
|
|
|
|
+ if (ytzData != null) {
|
|
|
|
+ Elements tdsx = ytzData.select("td");
|
|
|
|
+ if (Integer.parseInt(trtd[1]) < tdsx.size()) {
|
|
|
|
+ Element data = ytzData.select("td").get(Integer.parseInt(trtd[1]));
|
|
|
|
+ if (data.html().contains("el-tooltip")) {
|
|
|
|
+ data = data.children().get(0);
|
|
}
|
|
}
|
|
- if (isRole){
|
|
|
|
- throw new ServiceException("当前审批人中,不存在:"+roleMap.get(roleId).getSigRoleName()+",无法电签,请查看后台配置");
|
|
|
|
|
|
+ Elements children = data.children();
|
|
|
|
+ Element element = children.get(0);
|
|
|
|
+ int x1 = Integer.parseInt(data.children().get(0).attr("x1"));
|
|
|
|
+ if (x1 == 0) {
|
|
|
|
+ x1 = 1;
|
|
}
|
|
}
|
|
- }
|
|
|
|
|
|
+ int y1 = Integer.parseInt(data.children().get(0).attr("y1"));
|
|
|
|
|
|
- //修改输入框里面的值为电签标识
|
|
|
|
- for (TextdictInfo e : textdictInfos) {
|
|
|
|
- String key = e.getColKey();
|
|
|
|
- String[] keys = key.split("__");
|
|
|
|
- String[] trtd = keys[1].split("_");
|
|
|
|
- if (Integer.parseInt(trtd[0]) < trs.size()) {
|
|
|
|
- Element ytzData = trs.get(Integer.parseInt(trtd[0]));
|
|
|
|
- if (ytzData != null) {
|
|
|
|
- Elements tdsx = ytzData.select("td");
|
|
|
|
- if (Integer.parseInt(trtd[1]) < tdsx.size()) {
|
|
|
|
- Element data = ytzData.select("td").get(Integer.parseInt(trtd[1]));
|
|
|
|
- if (data.html().contains("el-tooltip")) {
|
|
|
|
- data = data.children().get(0);
|
|
|
|
- }
|
|
|
|
- Elements children = data.children();
|
|
|
|
- Element element = children.get(0);
|
|
|
|
- int x1 = Integer.parseInt(data.children().get(0).attr("x1"));
|
|
|
|
- if (x1 == 0) {
|
|
|
|
- x1 = 1;
|
|
|
|
- }
|
|
|
|
- int y1 = Integer.parseInt(data.children().get(0).attr("y1"));
|
|
|
|
-
|
|
|
|
- Row row = sheet.getRow(y1 - 1);
|
|
|
|
- if (row != null) {
|
|
|
|
- Cell cell = sheet.getRow(y1 - 1).getCell(x1 - 1);
|
|
|
|
- if (cell != null) {
|
|
|
|
- short fontIndex = cell.getCellStyle().getFontIndex();
|
|
|
|
- Font oldfontAt = workbook.getFontAt(fontIndex);
|
|
|
|
-
|
|
|
|
- Font redFont = workbook.createFont();
|
|
|
|
- redFont.setColor(IndexedColors.WHITE.getIndex()); //设置字体颜色
|
|
|
|
- redFont.setFontHeightInPoints(oldfontAt.getFontHeightInPoints());//设置字体大小
|
|
|
|
- redFont.setFontName(oldfontAt.getFontName());//设置字体
|
|
|
|
-
|
|
|
|
- CellStyle newStyle = workbook.createCellStyle(); //创建单元格样式
|
|
|
|
- newStyle.cloneStyleFrom(cell.getCellStyle());
|
|
|
|
- newStyle.setFont(redFont);
|
|
|
|
- cell.setCellStyle(newStyle);
|
|
|
|
- String sig = htmlDeptIdMap.get(e.getId());
|
|
|
|
- cell.setCellValue(sig);
|
|
|
|
- } else {
|
|
|
|
- ObjectUtils.isNotEmpty(cell);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ Row row = sheet.getRow(y1 - 1);
|
|
|
|
+ if (row != null) {
|
|
|
|
+ Cell cell = sheet.getRow(y1 - 1).getCell(x1 - 1);
|
|
|
|
+ if (cell != null) {
|
|
|
|
+ short fontIndex = cell.getCellStyle().getFontIndex();
|
|
|
|
+ Font oldfontAt = workbook.getFontAt(fontIndex);
|
|
|
|
+
|
|
|
|
+ Font redFont = workbook.createFont();
|
|
|
|
+ redFont.setColor(IndexedColors.WHITE.getIndex()); //设置字体颜色
|
|
|
|
+ redFont.setFontHeightInPoints(oldfontAt.getFontHeightInPoints());//设置字体大小
|
|
|
|
+ redFont.setFontName(oldfontAt.getFontName());//设置字体
|
|
|
|
+
|
|
|
|
+ CellStyle newStyle = workbook.createCellStyle(); //创建单元格样式
|
|
|
|
+ newStyle.cloneStyleFrom(cell.getCellStyle());
|
|
|
|
+ newStyle.setFont(redFont);
|
|
|
|
+ cell.setCellStyle(newStyle);
|
|
|
|
+ String sig = htmlDeptIdMap.get(e.getId());
|
|
|
|
+ cell.setCellValue(sig);
|
|
|
|
+ } else {
|
|
|
|
+ ObjectUtils.isNotEmpty(cell);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- }else {
|
|
|
|
- throw new ServiceException("未找到审计意见的电签配置");
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -3825,8 +3857,6 @@ public class TaskController extends BladeController {
|
|
//输出流
|
|
//输出流
|
|
FileOutputStream outputStream = new FileOutputStream(excelPath);
|
|
FileOutputStream outputStream = new FileOutputStream(excelPath);
|
|
|
|
|
|
-
|
|
|
|
-
|
|
|
|
workbook.write(outputStream);
|
|
workbook.write(outputStream);
|
|
|
|
|
|
FileUtils.setExcelScaleToPdf(excelPath, pdfPath);
|
|
FileUtils.setExcelScaleToPdf(excelPath, pdfPath);
|
|
@@ -3834,7 +3864,7 @@ public class TaskController extends BladeController {
|
|
|
|
|
|
if (bladeFile != null) {
|
|
if (bladeFile != null) {
|
|
//获取所有专家个人证书
|
|
//获取所有专家个人证书
|
|
- List<SignPfxFile> list = jdbcTemplate.query(" select * from m_sign_pfx_file where is_deleted = 0 and certificate_user_id in ("+sigUser.stream().map(User::getId).distinct().map(Objects::toString).collect(Collectors.joining(",")) +")", new BeanPropertyRowMapper<>(SignPfxFile.class));
|
|
|
|
|
|
+ List<SignPfxFile> list = jdbcTemplate.query(" select * from m_sign_pfx_file where is_deleted = 0 and certificate_user_id in ("+sigUser.stream().map(User::getId).distinct().map(Objects::toString).collect(Collectors.joining(",")) +")", new BeanPropertyRowMapper<>(SignPfxFile.class));
|
|
if (list.size() == 0 || list.size() != sigUser.size()){
|
|
if (list.size() == 0 || list.size() != sigUser.size()){
|
|
throw new ServiceException("有签字人没有配置电签,请联系管理员");
|
|
throw new ServiceException("有签字人没有配置电签,请联系管理员");
|
|
}
|
|
}
|
|
@@ -3857,11 +3887,36 @@ public class TaskController extends BladeController {
|
|
info.setSigPic(file.getSignatureFileUrl());
|
|
info.setSigPic(file.getSignatureFileUrl());
|
|
infos.add(info);
|
|
infos.add(info);
|
|
}
|
|
}
|
|
|
|
+ //如果存在配置企业电签,则需要获取企业证书
|
|
|
|
+ if (companyList.size() > 0) {
|
|
|
|
+ //获取企业当前合同段所有证书
|
|
|
|
+ List<SignPfxFile> allCompany = jdbcTemplate.query(" SELECT * from m_sign_pfx_file WHERE is_deleted = 0 and is_register = 1 and project_contract_role like '%"+contractId+"%'", new BeanPropertyRowMapper<>(SignPfxFile.class));
|
|
|
|
+ for (TextdictInfo textdictInfo : companyList) {
|
|
|
|
+ List<SignPfxFile> certificates = allCompany.stream().filter(l->textdictInfo.getSigRoleId().equals(l.getPfxType())).collect(Collectors.toList());
|
|
|
|
+ if (certificates.size() == 0){
|
|
|
|
+ throw new ServiceException("未获取到:"+textdictInfo.getSigRoleName());
|
|
|
|
+ }else if (certificates.size() > 1){
|
|
|
|
+ throw new ServiceException("获取到多个:"+textdictInfo.getSigRoleName());
|
|
|
|
+ }
|
|
|
|
+ SignPfxFile file = certificates.get(0);
|
|
|
|
+ if (StringUtils.isBlank(file.getSignatureFileUrl())){
|
|
|
|
+ throw new ServiceException("未获取到:"+textdictInfo.getSigRoleName()+"的签字图片");
|
|
|
|
+ }
|
|
|
|
+ SigInfoVO.SigInfo info = new SigInfoVO.SigInfo();
|
|
|
|
+ info.setUserName(file.getCertificateUserName());
|
|
|
|
+ info.setUserSig(textdictInfo.getSigRoleName()+"123");
|
|
|
|
+ info.setSealCode("S_NEW_"+file.getId());
|
|
|
|
+ info.setSealPassword(file.getCertificatePassword());
|
|
|
|
+ info.setSigPic(file.getSignatureFileUrl());
|
|
|
|
+ infos.add(info);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
vo.setList(infos);
|
|
vo.setList(infos);
|
|
vo.setPdfUrl(bladeFile.getLink());
|
|
vo.setPdfUrl(bladeFile.getLink());
|
|
R<String> r1 = eVisaClient.batchEVisa(vo);
|
|
R<String> r1 = eVisaClient.batchEVisa(vo);
|
|
if (r1.getCode() != 200 || StringUtils.isBlank(r1.getData())){
|
|
if (r1.getCode() != 200 || StringUtils.isBlank(r1.getData())){
|
|
- throw new ServiceException("咨询意见PDF电签时失败");
|
|
|
|
|
|
+ throw new ServiceException("咨询意见PDF电签时失败:"+r1.getMsg());
|
|
}
|
|
}
|
|
return r1.getData();
|
|
return r1.getData();
|
|
}else {
|
|
}else {
|