|
@@ -49,15 +49,19 @@ import org.springblade.manager.vo.AppWbsTreeContractVO;
|
|
|
import org.springblade.resource.feign.CommonFileClient;
|
|
|
import org.springblade.resource.feign.NewIOSSClient;
|
|
|
import org.springblade.system.cache.ParamCache;
|
|
|
+import org.springblade.system.entity.Dept;
|
|
|
+import org.springblade.system.user.entity.User;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.cloud.openfeign.EnableFeignClients;
|
|
|
+import org.springframework.dao.DataAccessException;
|
|
|
import org.springframework.data.redis.core.StringRedisTemplate;
|
|
|
import org.springframework.jdbc.core.BeanPropertyRowMapper;
|
|
|
import org.springframework.jdbc.core.JdbcTemplate;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
+import javax.servlet.http.HttpServletRequest;
|
|
|
import java.io.File;
|
|
|
import java.io.FileNotFoundException;
|
|
|
import java.util.*;
|
|
@@ -118,6 +122,10 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
|
|
|
private final ExcelTabClient excelTabClient;
|
|
|
|
|
|
private final NewIOSSClient newIOSSClient;
|
|
|
+ //超级管理员的角色id
|
|
|
+ private final String SUPER_ADMIN_ROLE_ID ="1123598816738675201";
|
|
|
+ //泓创智诚公司的部门id
|
|
|
+ private final Long HONGCHENG_DEPT_ID = 1536982621165592577L;
|
|
|
|
|
|
@Autowired
|
|
|
StringRedisTemplate RedisTemplate;
|
|
@@ -257,7 +265,7 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
|
|
|
//资料填报原始pdf
|
|
|
// String approvalPdf = StringUtils.isNotEmpty(query.getEVisaPdfUrl()) ? query.getEVisaPdfUrl() : query.getPdfUrl();
|
|
|
/** 修改需求,任务查看时,附件不在列表中显示,需要拼接在电签后面。如果此处修改影响其他地方,则到时候再说*/
|
|
|
- String approvalPdf = StringUtils.isNotEmpty(query.getNodePdfUrl()) ? query.getNodePdfUrl() : query.getPdfUrl();
|
|
|
+ String approvalPdf = StringUtils.isNotEmpty(query.getEVisaPdfUrl()) ? query.getEVisaPdfUrl() : query.getPdfUrl();
|
|
|
vo.setApprovalFileList(query.getName(), this.getHppsToHttp(approvalPdf));
|
|
|
|
|
|
//试验关联文件合并pdf
|
|
@@ -1130,12 +1138,12 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
|
|
|
System.out.println("----- 电签成功--------");
|
|
|
//添加nodePdf的值
|
|
|
List<Map<String, Object>> mapList = jdbcTemplate.queryForList("select *,domain_url as url from m_table_file where is_deleted = 0 and type in (10,11,12) and tab_id = (select wbs_id from u_information_query WHERE id = + "+formDataId+")");
|
|
|
- if(Func.isNotEmpty(mapList)&&mapList.size()>=1){
|
|
|
+ if(Func.isNotEmpty(mapList)&&mapList.size()>=1) {
|
|
|
String file_path = org.springblade.business.utils.FileUtils.getSysLocalFileUrl();
|
|
|
List<String> datainfo = new ArrayList<>();
|
|
|
datainfo.add(newFileUrl);
|
|
|
for (Map<String, Object> tabsx : mapList) {
|
|
|
- datainfo.add(tabsx.get("url")+"");
|
|
|
+ datainfo.add(tabsx.get("url") + "");
|
|
|
}
|
|
|
String listPdf = file_path + "/nodePDF/" + formDataId + ".pdf";
|
|
|
File tabpdf2 = ResourceUtil.getFile(listPdf);
|
|
@@ -1144,12 +1152,12 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
|
|
|
}
|
|
|
|
|
|
org.springblade.business.utils.FileUtils.mergePdfPublicMethods(datainfo, listPdf);
|
|
|
- if(sys_isonline.equals("20")){
|
|
|
+ if (sys_isonline.equals("20")) {
|
|
|
BladeFile bladeFile = this.newIOSSClient.uploadFile(formDataId + ".pdf", listPdf);
|
|
|
if (bladeFile != null && Func.isNotEmpty(bladeFile.getLink())) {
|
|
|
nodePdfUrl = bladeFile.getLink();
|
|
|
}
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
nodePdfUrl = org.springblade.business.utils.FileUtils.getNetUrl(listPdf);
|
|
|
}
|
|
|
|
|
@@ -1442,7 +1450,7 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
|
|
|
// }
|
|
|
|
|
|
@Override
|
|
|
- public void reSigningEVisa(String classify, String taskIds, String contractId, String projectId,Integer type, String header) {
|
|
|
+ public void reSigningEVisa(String classify, String taskIds, String contractId, String projectId, Integer type, String header , HttpServletRequest request) {
|
|
|
//查询任务信息
|
|
|
List<Task> taskList = jdbcTemplate.query("select * from u_task where id in(" + taskIds + ")", new BeanPropertyRowMapper<>(Task.class));
|
|
|
if (taskList.size() > 0) {
|
|
@@ -1464,9 +1472,11 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
|
|
|
try {
|
|
|
for (Task task : taskList) {
|
|
|
R result = new R();
|
|
|
+ jdbcTemplate.execute("DELETE from u_task_batch where json_data like '%"+task.getId()+"%'");
|
|
|
boolean b = informationQueryService.update(new LambdaUpdateWrapper<InformationQuery>()
|
|
|
.eq(InformationQuery::getId, task.getFormDataId())
|
|
|
- .set(InformationQuery::getEVisaPdfUrl, null));
|
|
|
+ .set(InformationQuery::getEVisaPdfUrl, null)
|
|
|
+ .set(InformationQuery::getPdfUrl, null));
|
|
|
|
|
|
if (type == 1) {
|
|
|
//重新保存
|
|
@@ -1501,7 +1511,9 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
|
|
|
}
|
|
|
}
|
|
|
long startTime_2 = System.currentTimeMillis();
|
|
|
- this.batchCompleteApprovalTask(taskApprovalVOS);
|
|
|
+ if(taskApprovalVOS!=null && taskApprovalVOS.size()>=1){
|
|
|
+ this.batchCompleteApprovalTask(taskApprovalVOS);
|
|
|
+ }
|
|
|
long endTime_2 = System.currentTimeMillis();
|
|
|
long executionTime_2 = endTime_2 - startTime_2;
|
|
|
log.info("batchCompleteApprovalTask执行时间:" + executionTime_2 + " 毫秒");
|
|
@@ -1512,7 +1524,14 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
|
|
|
.eq(TaskParallel::getProcessInstanceId, task.getProcessInstanceId()));
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+ //获取当前操作人
|
|
|
+ Long userId = AuthUtil.getUserId(request);
|
|
|
+ String userName = AuthUtil.getNickName(request);
|
|
|
+ //判断是否是超级管理员并且是泓创智诚下的部门
|
|
|
+ if(judgeRoleIdAndDeptId(userId)){
|
|
|
+ //满足去除当前填报人的条件 去除当前任务的填报人中当前操作人的信息
|
|
|
+ removeUserAndName(taskIds, userId, userName);
|
|
|
+ }
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
throw new ServiceException("重新保存PDF信息失败,原因:" + e.getMessage());
|
|
@@ -1523,10 +1542,68 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
R saveNodePdf(String classify, String nodePKeyIds, String contractId, String projectId, String header) throws Exception {
|
|
|
return excelTabClient.synPDFInfo(contractId, nodePKeyIds, classify, projectId, header);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 返回true代表满足条件 是超级管理员并且部门是在泓创智诚下面的部门
|
|
|
+ */
|
|
|
+ public boolean judgeRoleIdAndDeptId(Long userId ){
|
|
|
+ try {
|
|
|
+ String sqlForUser = "select role_id ,dept_id from blade_user where id = "+userId;
|
|
|
+ User user = jdbcTemplate.queryForObject(sqlForUser, new BeanPropertyRowMapper<>(User.class));
|
|
|
+ String sqlforSkipDept = "select id from blade_dept where parent_id = "+HONGCHENG_DEPT_ID + " or id = "+HONGCHENG_DEPT_ID;
|
|
|
+ List<Dept> depts = jdbcTemplate.query(sqlforSkipDept, new BeanPropertyRowMapper<>(Dept.class));
|
|
|
+ String roleId = user.getRoleId();
|
|
|
+ String deptId = user.getDeptId();
|
|
|
+ //既是超级管理员同时是泓创下面的部门才允许跳过填报人赋值
|
|
|
+ if(roleId.contains(SUPER_ADMIN_ROLE_ID)){
|
|
|
+ Boolean flag = false;
|
|
|
+ for (Dept dept : depts) {
|
|
|
+ if(deptId.contains(dept.getId().toString())){
|
|
|
+ flag = true;
|
|
|
+ return flag;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return flag;
|
|
|
+ }else {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ } catch (DataAccessException e) {
|
|
|
+ log.error(e.getMessage());
|
|
|
+ throw new RuntimeException("校验操作人角色异常");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 去掉对应的填报人信息
|
|
|
+ */
|
|
|
+ private void removeUserAndName(String taskIds, Long userId, String userName) {
|
|
|
+ try {
|
|
|
+ String sqlForInformationQuery = "select * from u_information_query where id = (select form_data_id from u_task where id =" +taskIds+ ")";
|
|
|
+ InformationQuery informationQuery = jdbcTemplate.queryForObject(sqlForInformationQuery, new BeanPropertyRowMapper<>(InformationQuery.class));
|
|
|
+ String fileUserIdAndName = informationQuery.getFileUserIdAndName();
|
|
|
+ if (StringUtils.isNotEmpty(fileUserIdAndName) && fileUserIdAndName.contains(userId + "-" + userName)){
|
|
|
+ String[] split = fileUserIdAndName.split(",");
|
|
|
+ if(split != null && split.length > 0){
|
|
|
+ ArrayList<String> list = new ArrayList<>(Arrays.asList(split));
|
|
|
+ for (int i = 0; i < list.size(); i++) {
|
|
|
+ if(list.get(i).contains(userId + "-" + userName)){
|
|
|
+ list.remove(i);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ String fileUserIdAndNameNew = String.join(",", list);
|
|
|
+ String sqlForUpdateInformationQuery = "update u_information_query set file_user_id_and_name = '"+fileUserIdAndNameNew+"' where id = (select form_data_id from u_task where id =" +taskIds+ ")";
|
|
|
+ jdbcTemplate.execute(sqlForUpdateInformationQuery);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } catch (DataAccessException e) {
|
|
|
+ throw new RuntimeException("去除对应的填报人信息异常");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public Task getTaskByFormDataId(String formDataId) {
|
|
|
return getOne(Wrappers.<Task>lambdaQuery()
|