|
@@ -49,15 +49,19 @@ import org.springblade.manager.vo.AppWbsTreeContractVO;
|
|
import org.springblade.resource.feign.CommonFileClient;
|
|
import org.springblade.resource.feign.CommonFileClient;
|
|
import org.springblade.resource.feign.NewIOSSClient;
|
|
import org.springblade.resource.feign.NewIOSSClient;
|
|
import org.springblade.system.cache.ParamCache;
|
|
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.BeanUtils;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.cloud.openfeign.EnableFeignClients;
|
|
import org.springframework.cloud.openfeign.EnableFeignClients;
|
|
|
|
+import org.springframework.dao.DataAccessException;
|
|
import org.springframework.data.redis.core.StringRedisTemplate;
|
|
import org.springframework.data.redis.core.StringRedisTemplate;
|
|
import org.springframework.jdbc.core.BeanPropertyRowMapper;
|
|
import org.springframework.jdbc.core.BeanPropertyRowMapper;
|
|
import org.springframework.jdbc.core.JdbcTemplate;
|
|
import org.springframework.jdbc.core.JdbcTemplate;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
|
|
+import javax.servlet.http.HttpServletRequest;
|
|
import java.io.File;
|
|
import java.io.File;
|
|
import java.io.FileNotFoundException;
|
|
import java.io.FileNotFoundException;
|
|
import java.util.*;
|
|
import java.util.*;
|
|
@@ -118,6 +122,10 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
|
|
private final ExcelTabClient excelTabClient;
|
|
private final ExcelTabClient excelTabClient;
|
|
|
|
|
|
private final NewIOSSClient newIOSSClient;
|
|
private final NewIOSSClient newIOSSClient;
|
|
|
|
+ //超级管理员的角色id
|
|
|
|
+ private final String SUPER_ADMIN_ROLE_ID ="1123598816738675201";
|
|
|
|
+ //泓创智诚公司的部门id
|
|
|
|
+ private final Long HONGCHENG_DEPT_ID = 1536982621165592577L;
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
StringRedisTemplate RedisTemplate;
|
|
StringRedisTemplate RedisTemplate;
|
|
@@ -1442,7 +1450,7 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
|
|
// }
|
|
// }
|
|
|
|
|
|
@Override
|
|
@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));
|
|
List<Task> taskList = jdbcTemplate.query("select * from u_task where id in(" + taskIds + ")", new BeanPropertyRowMapper<>(Task.class));
|
|
if (taskList.size() > 0) {
|
|
if (taskList.size() > 0) {
|
|
@@ -1473,7 +1481,7 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
|
|
if (type == 1) {
|
|
if (type == 1) {
|
|
//重新保存
|
|
//重新保存
|
|
long startTime_1 = System.currentTimeMillis();
|
|
long startTime_1 = System.currentTimeMillis();
|
|
- result = this.saveNodePdfResign(typeMap.get(task.getFormDataId()), queryMap.get(task.getFormDataId()), contractId, projectId, header);
|
|
|
|
|
|
+ result = this.saveNodePdf(typeMap.get(task.getFormDataId()), queryMap.get(task.getFormDataId()), contractId, projectId, header);
|
|
long endTime_1 = System.currentTimeMillis();
|
|
long endTime_1 = System.currentTimeMillis();
|
|
long executionTime_1 = endTime_1 - startTime_1;
|
|
long executionTime_1 = endTime_1 - startTime_1;
|
|
log.info("saveNodePdf执行时间:" + executionTime_1 + " 毫秒");
|
|
log.info("saveNodePdf执行时间:" + executionTime_1 + " 毫秒");
|
|
@@ -1516,7 +1524,14 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
|
|
.eq(TaskParallel::getProcessInstanceId, task.getProcessInstanceId()));
|
|
.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) {
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
throw new ServiceException("重新保存PDF信息失败,原因:" + e.getMessage());
|
|
throw new ServiceException("重新保存PDF信息失败,原因:" + e.getMessage());
|
|
@@ -1527,11 +1542,66 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
R saveNodePdf(String classify, String nodePKeyIds, String contractId, String projectId, String header) throws Exception {
|
|
R saveNodePdf(String classify, String nodePKeyIds, String contractId, String projectId, String header) throws Exception {
|
|
return excelTabClient.synPDFInfo(contractId, nodePKeyIds, classify, projectId, header);
|
|
return excelTabClient.synPDFInfo(contractId, nodePKeyIds, classify, projectId, header);
|
|
}
|
|
}
|
|
- R saveNodePdfResign(String classify, String nodePKeyIds, String contractId, String projectId, String header) throws Exception {
|
|
|
|
- return excelTabClient.synPDFInfoResign(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
|
|
@Override
|