Blizzard 11 tháng trước cách đây
mục cha
commit
1f9095f59e

+ 2 - 0
blade-service-api/wt-okr-api/src/main/java/com/wtkj/dto/SearchProjectFileDTO.java

@@ -21,8 +21,10 @@ public class SearchProjectFileDTO implements Serializable {
 	@NotNull(message = "deptId can't be null")
 	private Long topDeptId;
 
+	@JsonSerialize(using = ToStringSerializer.class)
 	private Long projectId;
 
+	@JsonSerialize(using = ToStringSerializer.class)
 	private Long createUser;
 
 	private String text;

+ 2 - 0
blade-service-api/wt-okr-api/src/main/java/com/wtkj/vo/AuthUserInfo.java

@@ -32,5 +32,7 @@ public class AuthUserInfo extends BladeUser {
 
 	private User user;
 
+	private String openId;
+
 
 }

+ 67 - 67
blade-service/wutong-okr/src/main/java/com/wtkj/config/es/EsConfig.java

@@ -1,67 +1,67 @@
-package com.wtkj.config.es;
-
-import co.elastic.clients.elasticsearch.ElasticsearchClient;
-import co.elastic.clients.json.jackson.JacksonJsonpMapper;
-import co.elastic.clients.transport.ElasticsearchTransport;
-import co.elastic.clients.transport.rest_client.RestClientTransport;
-import org.apache.http.HttpHost;
-import org.elasticsearch.client.RestClient;
-import org.elasticsearch.client.RestClientBuilder;
-import org.elasticsearch.client.RestHighLevelClient;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.util.StringUtils;
-
-/**
- * @author Blizzard
- * @create at 2023-09-27 10:03
- * @describe
- */
-@Configuration
-public class EsConfig {
-
-	@Value("${spring.elasticsearch.rest.uris}")
-	private String hosts;
-
-
-	private HttpHost[] toHttpHost() {
-		if (!StringUtils.hasLength(hosts)) {
-			throw new RuntimeException("invalid elasticsearch configuration. elasticsearch.hosts不能为空!");
-		}
-
-		// 多个IP逗号隔开
-		String[] hostArray = hosts.split(",");
-		HttpHost[] httpHosts = new HttpHost[hostArray.length];
-		HttpHost httpHost;
-		for (int i = 0; i < hostArray.length; i++) {
-			String[] strings = hostArray[i].split(":");
-			httpHost = new HttpHost(strings[0], Integer.parseInt(strings[1]), "http");
-			httpHosts[i] = httpHost;
-		}
-
-		return httpHosts;
-	}
-
-
-	@Bean
-	public ElasticsearchClient elasticsearchClient() {
-		HttpHost[] httpHost = toHttpHost();
-		RestClient restClient = RestClient.builder(httpHost).build();
-		// Create the transport with a Jackson mapper
-		ElasticsearchTransport transport = new RestClientTransport(
-			restClient, new JacksonJsonpMapper());
-
-		// And create the API client
-		return new ElasticsearchClient(transport);
-	}
-
-	@Bean
-	public RestHighLevelClient esRestClient() {
-		RestClientBuilder builder;
-		builder = RestClient.builder(toHttpHost());
-		return new RestHighLevelClient(builder);
-	}
-
-
-}
+//package com.wtkj.config.es;
+//
+//import co.elastic.clients.elasticsearch.ElasticsearchClient;
+//import co.elastic.clients.json.jackson.JacksonJsonpMapper;
+//import co.elastic.clients.transport.ElasticsearchTransport;
+//import co.elastic.clients.transport.rest_client.RestClientTransport;
+//import org.apache.http.HttpHost;
+//import org.elasticsearch.client.RestClient;
+//import org.elasticsearch.client.RestClientBuilder;
+//import org.elasticsearch.client.RestHighLevelClient;
+//import org.springframework.beans.factory.annotation.Value;
+//import org.springframework.context.annotation.Bean;
+//import org.springframework.context.annotation.Configuration;
+//import org.springframework.util.StringUtils;
+//
+///**
+// * @author Blizzard
+// * @create at 2023-09-27 10:03
+// * @describe
+// */
+//@Configuration
+//public class EsConfig {
+//
+//	@Value("${spring.elasticsearch.rest.uris}")
+//	private String hosts;
+//
+//
+//	private HttpHost[] toHttpHost() {
+//		if (!StringUtils.hasLength(hosts)) {
+//			throw new RuntimeException("invalid elasticsearch configuration. elasticsearch.hosts不能为空!");
+//		}
+//
+//		// 多个IP逗号隔开
+//		String[] hostArray = hosts.split(",");
+//		HttpHost[] httpHosts = new HttpHost[hostArray.length];
+//		HttpHost httpHost;
+//		for (int i = 0; i < hostArray.length; i++) {
+//			String[] strings = hostArray[i].split(":");
+//			httpHost = new HttpHost(strings[0], Integer.parseInt(strings[1]), "http");
+//			httpHosts[i] = httpHost;
+//		}
+//
+//		return httpHosts;
+//	}
+//
+//
+//	@Bean
+//	public ElasticsearchClient elasticsearchClient() {
+//		HttpHost[] httpHost = toHttpHost();
+//		RestClient restClient = RestClient.builder(httpHost).build();
+//		// Create the transport with a Jackson mapper
+//		ElasticsearchTransport transport = new RestClientTransport(
+//			restClient, new JacksonJsonpMapper());
+//
+//		// And create the API client
+//		return new ElasticsearchClient(transport);
+//	}
+//
+//	@Bean
+//	public RestHighLevelClient esRestClient() {
+//		RestClientBuilder builder;
+//		builder = RestClient.builder(toHttpHost());
+//		return new RestHighLevelClient(builder);
+//	}
+//
+//
+//}

+ 3 - 2
blade-service/wutong-okr/src/main/java/com/wtkj/controller/CommonController.java

@@ -52,8 +52,9 @@ public class CommonController {
 	@ApiOperation(value = "工作量导出", notes = "")
 	@ApiOperationSupport(order = 2)
 	@PreAuth(RoleConstant.HAS_ROLE_ADMIN)
-	public void export(@RequestParam String startDate, @RequestParam String endDate, HttpServletResponse response) throws IOException {
-		List<Workload> list = taskService.exportList(startDate, endDate);
+	public void export(@RequestParam String date, HttpServletResponse response) throws IOException {
+
+		List<Workload> list = taskService.exportList(date);
 		taskService.export(list, response);
 
 	}

+ 20 - 54
blade-service/wutong-okr/src/main/java/com/wtkj/handler/EsFileHandler.java

@@ -5,22 +5,14 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.IdWorker;
 import com.wtkj.config.KafkaConstant;
 import com.wtkj.entity.FileAndFolder;
-import com.wtkj.handler.es.Document;
+import com.wtkj.handler.es.Doc;
 import com.wtkj.service.IFileAndFolderService;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.kafka.clients.consumer.ConsumerRecord;
 import org.elasticsearch.action.index.IndexRequest;
-import org.elasticsearch.action.search.SearchRequest;
-import org.elasticsearch.action.search.SearchResponse;
-import org.elasticsearch.action.update.UpdateRequest;
 import org.elasticsearch.client.RequestOptions;
 import org.elasticsearch.client.RestHighLevelClient;
 import org.elasticsearch.common.xcontent.XContentType;
-import org.elasticsearch.index.query.BoolQueryBuilder;
-import org.elasticsearch.index.query.QueryBuilders;
-import org.elasticsearch.index.query.TermQueryBuilder;
-import org.elasticsearch.search.SearchHits;
-import org.elasticsearch.search.builder.SearchSourceBuilder;
 import org.springframework.kafka.annotation.KafkaListener;
 import org.springframework.kafka.support.Acknowledgment;
 import org.springframework.stereotype.Component;
@@ -64,55 +56,29 @@ public class EsFileHandler {
 			lqw.eq(FileAndFolder::getBladeFileId, fileId);
 			lqw.eq(FileAndFolder::getType, 1);
 			List<FileAndFolder> files = fileAndFolderService.list(lqw);
-			if (!CollectionUtils.isEmpty(files)) {
+			//避免重复处理
+			if (!CollectionUtils.isEmpty(files) && files.size() == 1) {
 				for (FileAndFolder file : files) {
 					Long projectId = file.getProjectId();
 					//使用自定义类作为数据存储容器
-					Document document = new Document();
-					document.setId(IdWorker.getIdStr());
-					document.setContent(content);
-					document.setFileId(fileId);
-					document.setFileName(file.getTitle());
-					document.setCreateUser(file.getCreateUser());
-					document.setCurrentPage(currentPage);
-					document.setProjectId(projectId);
+					Doc doc = new Doc();
+					doc.setId(IdWorker.getIdStr());
+					doc.setContent(content);
+					doc.setFileId(String.valueOf(fileId));
+					doc.setFileName(file.getTitle());
+					doc.setCreateUser(String.valueOf(file.getCreateUser()));
+					doc.setCurrentPage(currentPage);
+					doc.setProjectId(String.valueOf(projectId));
+
+					//创建文档
+					IndexRequest indexRequest = new IndexRequest(PROJECT_RESOURCE_INDEX);
+					indexRequest.id(doc.getId());
+					indexRequest.timeout("1s");
+					//将数据放入请求,将对象装为json格式
+					indexRequest.source(JSONObject.toJSONString(doc), XContentType.JSON);
+					client.index(indexRequest, RequestOptions.DEFAULT);
+					//log.info("文档插入操作结果:" + putResponse.toString());
 
-					//存在即更新  不存在即插入
-					SearchRequest request = new SearchRequest();
-					request.indices(PROJECT_RESOURCE_INDEX);
-					SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();
-					BoolQueryBuilder boolQuery = QueryBuilders.boolQuery()
-						.must(new TermQueryBuilder("projectId", projectId))
-						.must(new TermQueryBuilder("fileId", fileId))
-						.must(new TermQueryBuilder("currentPage", currentPage));
-					searchSourceBuilder.query(boolQuery);
-					searchSourceBuilder.from(0);
-					searchSourceBuilder.size(1);
-					request.source(searchSourceBuilder);
-					SearchResponse response = client.search(request, RequestOptions.DEFAULT);
-					if (response != null) {
-						SearchHits hits = response.getHits();
-						int size = hits.getHits().length;
-						if (size > 0) {
-							//更新
-							for (int i = 0; i < hits.getHits().length; i++) {
-								String docId = hits.getHits()[i].getId();
-								UpdateRequest updateRequest = new UpdateRequest(PROJECT_RESOURCE_INDEX, docId);
-								updateRequest.doc(JSONObject.toJSONString(document), XContentType.JSON);
-								client.update(updateRequest, RequestOptions.DEFAULT);
-								//log.info("文档更新操作结果:" + updateResponse.toString());
-							}
-						} else {
-							//创建文档
-							IndexRequest indexRequest = new IndexRequest(PROJECT_RESOURCE_INDEX);
-							indexRequest.id(document.getId());
-							indexRequest.timeout("1s");
-							//将数据放入请求,将对象装为json格式
-							indexRequest.source(JSONObject.toJSONString(document), XContentType.JSON);
-							client.index(indexRequest, RequestOptions.DEFAULT);
-							//log.info("文档插入操作结果:" + putResponse.toString());
-						}
-					}
 				}
 			}
 		} catch (Exception e) {

+ 30 - 0
blade-service/wutong-okr/src/main/java/com/wtkj/handler/es/Doc.java

@@ -0,0 +1,30 @@
+package com.wtkj.handler.es;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @author Blizzard
+ * @create at 2023-09-27 14:50
+ * @describe
+ */
+@Data
+public class Doc implements Serializable {
+
+	private static final long serialVersionUID = -1L;
+
+	private String id;
+
+	private String projectId;
+
+	private String fileId;
+
+	private String fileName;
+
+	private String createUser;
+
+	private String content;
+
+	private Integer currentPage;
+}

+ 0 - 33
blade-service/wutong-okr/src/main/java/com/wtkj/handler/es/Document.java

@@ -1,33 +0,0 @@
-package com.wtkj.handler.es;
-
-import com.fasterxml.jackson.databind.annotation.JsonSerialize;
-import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
-import lombok.Data;
-
-import java.io.Serializable;
-
-/**
- * @author Blizzard
- * @create at 2023-09-27 14:50
- * @describe
- */
-@Data
-public class Document implements Serializable {
-
-	private String id;
-
-	@JsonSerialize(using = ToStringSerializer.class)
-	private Long projectId;
-
-	@JsonSerialize(using = ToStringSerializer.class)
-	private Long fileId;
-
-	private String fileName;
-
-	@JsonSerialize(using = ToStringSerializer.class)
-	private Long createUser;
-
-	private String content;
-
-	private Integer currentPage;
-}

+ 2 - 0
blade-service/wutong-okr/src/main/java/com/wtkj/mapper/TaskMapper.java

@@ -39,4 +39,6 @@ public interface TaskMapper extends BaseMapper<Task> {
 	List<Task> selectByTaskStatus(Integer status);
 
 	List<Task> getByProjectId(Long projectId);
+
+	List<Task> getByMonth(String date);
 }

+ 5 - 0
blade-service/wutong-okr/src/main/java/com/wtkj/mapper/TaskMapper.xml

@@ -105,4 +105,9 @@
         select * from blade_task where is_deleted = 0 and project_id = #{param}
     </select>
 
+    <select id="getByMonth" resultType="com.wtkj.entity.Task">
+        select * from blade_task where is_deleted = 0 and
+        DATE_FORMAT(confirm_time,'%Y-%m-%d') like concat(concat(#{param}),'%')
+    </select>
+
 </mapper>

+ 1 - 1
blade-service/wutong-okr/src/main/java/com/wtkj/service/ITaskService.java

@@ -90,7 +90,7 @@ public interface ITaskService extends BaseService<Task> {
 
 	List<Task> getTodayToExpire(String date);
 
-	List<Workload> exportList(String startDate, String endDate);
+	List<Workload> exportList(String date);
 
 	void export(List<Workload> list, HttpServletResponse response) throws IOException;
 

+ 9 - 9
blade-service/wutong-okr/src/main/java/com/wtkj/service/impl/AsyncServiceImpl.java

@@ -390,14 +390,14 @@ public class AsyncServiceImpl implements IAsyncService {
 			}
 
 			//5.指定任务审查者
-			if (((beforeUpdate.getFirstCheckUser() == null || beforeUpdate.getFirstCheckUser() < 0L) && afterUpdate.getFirstCheckUser() != null) || ((beforeUpdate.getSecondCheckUser() == null || beforeUpdate.getSecondCheckUser() < 0L) && afterUpdate.getSecondCheckUser() != null)) {
+			if (((beforeUpdate.getFirstCheckUser() == null || beforeUpdate.getFirstCheckUser() < 0L) && afterUpdate.getFirstCheckUser() != null && afterUpdate.getFirstCheckUser() > 0L) || ((beforeUpdate.getSecondCheckUser() == null || beforeUpdate.getSecondCheckUser() < 0L) && afterUpdate.getSecondCheckUser() != null && afterUpdate.getSecondCheckUser() > 0L)) {
 				Long first = afterUpdate.getFirstCheckUser();
 				Long second = afterUpdate.getSecondCheckUser();
 				List<Long> checkUsers = new ArrayList<>();
-				if (first != null) {
+				if (first != null && first > 0L) {
 					checkUsers.add(first);
 				}
-				if (second != null) {
+				if (second != null && second > 0L) {
 					checkUsers.add(second);
 				}
 				List<String> checks = new ArrayList<>();
@@ -562,7 +562,7 @@ public class AsyncServiceImpl implements IAsyncService {
 					String sdkAppId = "1400785942";
 					req.setSmsSdkAppid(sdkAppId);
 
-					String signName = "梧桐树";
+					String signName = "梧桐树小程序";
 					req.setSign(signName);
 
 					String templateId = "1948441";
@@ -628,7 +628,7 @@ public class AsyncServiceImpl implements IAsyncService {
 					String sdkAppId = "1400785942";
 					req.setSmsSdkAppid(sdkAppId);
 
-					String signName = "梧桐树";
+					String signName = "梧桐树小程序";
 					req.setSign(signName);
 
 					String templateId = "1948455";
@@ -699,7 +699,7 @@ public class AsyncServiceImpl implements IAsyncService {
 							String sdkAppId = "1400785942";
 							req.setSmsSdkAppid(sdkAppId);
 
-							String signName = "梧桐树";
+							String signName = "梧桐树小程序";
 							req.setSign(signName);
 
 							//任务下发通知模版id
@@ -783,7 +783,7 @@ public class AsyncServiceImpl implements IAsyncService {
 					String sdkAppId = "1400785942";
 					req.setSmsSdkAppid(sdkAppId);
 
-					String signName = "梧桐树";
+					String signName = "梧桐树小程序";
 					req.setSign(signName);
 
 					//分配任务通知
@@ -862,7 +862,7 @@ public class AsyncServiceImpl implements IAsyncService {
 							String sdkAppId = "1400785942";
 							req.setSmsSdkAppid(sdkAppId);
 
-							String signName = "梧桐树";
+							String signName = "梧桐树小程序";
 							req.setSign(signName);
 
 							//分配任务通知
@@ -928,7 +928,7 @@ public class AsyncServiceImpl implements IAsyncService {
 								String sdkAppId = "1400785942";
 								req.setSmsSdkAppid(sdkAppId);
 
-								String signName = "梧桐树";
+								String signName = "梧桐树小程序";
 								req.setSign(signName);
 
 								//任务下发通知模版id

+ 14 - 25
blade-service/wutong-okr/src/main/java/com/wtkj/service/impl/CommonServiceImpl.java

@@ -12,9 +12,11 @@ import com.wtkj.entity.FileAndFolder;
 import com.wtkj.entity.FileAndFolderHistory;
 import com.wtkj.entity.InnerFileAndFolder;
 import com.wtkj.entity.ProjectAuth;
-import com.wtkj.handler.es.Document;
+import com.wtkj.handler.es.Doc;
 import com.wtkj.service.*;
 import com.wtkj.vo.AuthUserInfo;
+import com.wutong.base.entity.BladeWxUser;
+import com.wutong.base.feign.IBladeWxUserClient;
 import com.wutong.file.feign.IFileClient;
 import com.wutong.file.vo.FileVO;
 import lombok.AllArgsConstructor;
@@ -34,7 +36,6 @@ import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.utils.BeanUtil;
 import org.springblade.core.tool.utils.Func;
 import org.springblade.core.tool.utils.StringUtil;
-import org.springblade.core.tool.utils.WebUtil;
 import org.springblade.system.entity.Dept;
 import org.springblade.system.feign.ISysClient;
 import org.springblade.system.user.entity.User;
@@ -65,6 +66,7 @@ public class CommonServiceImpl implements ICommonService {
 	private final RestHighLevelClient client;
 	private final ISysClient sysClient;
 	private final IUserClient userClient;
+	private final IBladeWxUserClient wxUserClient;
 
 
 	@Override
@@ -124,7 +126,6 @@ public class CommonServiceImpl implements ICommonService {
 					FileAndFolder old = fileAndFolderService.getOne(lqw);
 					if (old != null) {
 						//存在同名文件
-						//此处不删除旧的同名文件,直接修改值 ---> 再保存历史记录信息  修改已存在的的数据 更新url 文件大小等信息
 						//先根据旧的fileId判断是否存在历史记录
 						List<FileAndFolderHistory> hisList = historyService.getByLatestId(old.getBladeFileId());
 						if (!CollectionUtils.isEmpty(hisList)) {
@@ -140,6 +141,7 @@ public class CommonServiceImpl implements ICommonService {
 							his.setHistoryId(String.valueOf(old.getBladeFileId()));
 							histories.add(his);
 						}
+						//此处不删除旧的同名文件,直接修改值 ---> 再保存历史记录信息  修改已存在的的数据 更新url 文件大小等信息
 						old.setBladeFileId(fileId);
 						fileList.add(old);
 					} else {
@@ -272,14 +274,6 @@ public class CommonServiceImpl implements ICommonService {
 			projectIds.add(projectId);
 			proIds.add(String.valueOf(projectId));
 		} else {
-			//如果projectId为空 则查询机构下所有项目
-			//此机构下的项目
-			/*List<ProjectAuth> auths = projectAuthService.getByDeptAndUser(topDept, Func.firstLong(AuthUtil.getDeptId()), null);
-			if (!CollectionUtils.isEmpty(auths)) {
-				Set<Long> ids = auths.stream().map(ProjectAuth::getProjectId).filter(Objects::nonNull).collect(Collectors.toSet());
-				projectIds.addAll(ids);
-			}*/
-
 			String role = AuthUtil.getUserRole();
 			Long deptId = Func.firstLong(AuthUtil.getDeptId());
 			Long userId = AuthUtil.getUserId();
@@ -357,27 +351,22 @@ public class CommonServiceImpl implements ICommonService {
 
 		//执行查询
 		SearchResponse response = client.search(request, RequestOptions.DEFAULT);
-		Set<Document> set = new HashSet<>();
+		Set<Doc> set = new HashSet<>();
 		if (response != null) {
 			SearchHits hits = response.getHits();
 			int size = hits.getHits().length;
 			for (int i = 0; i < size; i++) {
 				String str = hits.getHits()[i].getSourceAsString();
-				Document document = JSON.parseObject(str, Document.class);
+				Doc document = JSON.parseObject(str, Doc.class);
 				set.add(document);
 			}
 		}
 		if (!CollectionUtils.isEmpty(set)) {
 			LambdaQueryWrapper<FileAndFolder> lqw = new LambdaQueryWrapper<>();
 			lqw.eq(FileAndFolder::getType, 1);
-			Set<Long> fileIds = set.stream().map(Document::getFileId).collect(Collectors.toSet());
+			Set<Long> fileIds = set.stream().map(Doc::getFileId).map(Long::valueOf).collect(Collectors.toSet());
 			lqw.in(FileAndFolder::getBladeFileId, fileIds);
 			res = fileAndFolderService.page(page, lqw);
-		} else if (!CollectionUtils.isEmpty(projectIds)) {
-			LambdaQueryWrapper<FileAndFolder> lqw = new LambdaQueryWrapper<>();
-			lqw.eq(FileAndFolder::getType, 1);
-			lqw.in(FileAndFolder::getProjectId, projectIds);
-			res = fileAndFolderService.page(page, lqw);
 		}
 		return res;
 	}
@@ -425,8 +414,8 @@ public class CommonServiceImpl implements ICommonService {
 			int size = hits.getHits().length;
 			for (int i = 0; i < size; i++) {
 				String str = hits.getHits()[i].getSourceAsString();
-				Document document = JSON.parseObject(str, Document.class);
-				set.add(document.getCurrentPage());
+				Doc doc = JSON.parseObject(str, Doc.class);
+				set.add(doc.getCurrentPage());
 			}
 		}
 		return set;
@@ -469,11 +458,11 @@ public class CommonServiceImpl implements ICommonService {
 				userInfo.setUser(userR.getData());
 			}
 
-			//登录成功通知 仅pc端
-			String platform = WebUtil.getHeader("platform");
-			if (StringUtil.isNotBlank(platform) && platform.equals("pc")) {
-
+			R<BladeWxUser> rpc = wxUserClient.findUserByBladeUserIdAndTenantId(String.valueOf(userId), "cHJvamVjdF93eDpwcm9qZWN0X3d4X2tleQ==");
+			if (rpc.isSuccess()) {
+				userInfo.setOpenId(rpc.getData().getOpenId());
 			}
+
 			return userInfo;
 		}
 		return null;

+ 1 - 1
blade-service/wutong-okr/src/main/java/com/wtkj/service/impl/ProjectServiceImpl.java

@@ -160,8 +160,8 @@ public class ProjectServiceImpl extends BaseServiceImpl<ProjectMapper, Project>
 			if (dto.getTodoAsc().equals(1)) {
 				lqw.orderByDesc(Project::getTodoTask);
 			} else {
-				lqw.orderByAsc(Project::getTodoTask);
 				lqw.orderByDesc(Project::getCreateTime);
+				lqw.orderByAsc(Project::getTodoTask);
 			}
 			// todo 截至时间降序
 			projectIPage = this.page(page, lqw);

+ 15 - 8
blade-service/wutong-okr/src/main/java/com/wtkj/service/impl/QrcodeServiceImpl.java

@@ -20,6 +20,7 @@ import org.springblade.system.entity.Dept;
 import org.springblade.system.feign.ISysClient;
 import org.springblade.system.user.entity.User;
 import org.springblade.system.user.feign.IUserClient;
+import org.springframework.data.redis.core.StringRedisTemplate;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
@@ -40,7 +41,6 @@ import static com.wtkj.config.NacosConfigValue.scanCount;
 @Service
 public class QrcodeServiceImpl implements IQrcodeService {
 
-	private final BladeRedis redis;
 	private final IUserClient userClient;
 	private final IProjectAuthService projectAuthService;
 	private final IProjectGroupService projectGroupService;
@@ -48,13 +48,15 @@ public class QrcodeServiceImpl implements IQrcodeService {
 	private final IFileShareService fileShareService;
 	private final IFileClient fileClient;
 	private final ISysClient sysClient;
+	private final StringRedisTemplate redisTemplate;
+	private final BladeRedis redis;
 
 	@Override
 	public JSONObject createDeptQrcode(Long deptId) {
 		JSONObject res = new JSONObject();
 		String kv = IdWorker.getIdStr();
 		Long userId = AuthUtil.getUserId();
-		redis.setEx(kv, 0, Duration.ofSeconds(expireIn));
+		redisTemplate.opsForValue().set(kv, "0", Duration.ofSeconds(expireIn));
 		res.put("qrcodeId", kv);
 		res.put("createUser", userId);
 		res.put("deptId", deptId);
@@ -135,6 +137,7 @@ public class QrcodeServiceImpl implements IQrcodeService {
 				group.setProjectId(projectId);
 				group.setInviteDept(project.getCompetentUnit());
 				group.setBeInvitedDept(deptId);
+				group.setUserId(AuthUtil.getUserId());
 				flag = projectGroupService.save(group);
 			}
 		}
@@ -171,7 +174,7 @@ public class QrcodeServiceImpl implements IQrcodeService {
 	public JSONObject createGroupQrcode(Long projectId) {
 		JSONObject res = new JSONObject();
 		String kv = IdWorker.getIdStr();
-		redis.setEx(kv, 0, Duration.ofSeconds(expireIn));
+		redisTemplate.opsForValue().set(kv, "0", Duration.ofSeconds(expireIn));
 		res.put("createUser", AuthUtil.getUser());
 		res.put("projectId", projectId);
 		res.put("qrcodeId", kv);
@@ -184,7 +187,7 @@ public class QrcodeServiceImpl implements IQrcodeService {
 		boolean save = fileShareService.save(share);
 		if (save) {
 			key = share.getId();
-			redis.setEx(String.valueOf(key), 0, Duration.ofDays(3));
+			redisTemplate.opsForValue().set(String.valueOf(key), "0", Duration.ofDays(3));
 		}
 		return key;
 	}
@@ -215,12 +218,14 @@ public class QrcodeServiceImpl implements IQrcodeService {
 		Boolean exists = redis.exists(key);
 		//如果存在
 		if (exists) {
-			Long count = redis.incrBy(key, 1);
-			if (count > scanCount) {
+			Long count = redisTemplate.opsForValue().increment(key, 1L);
+			if (count != null && count > scanCount) {
 				throw new ServiceException("二维码只能扫描" + scanCount + "次数");
 			} else {
 				flag = true;
 			}
+		} else {
+			throw new ServiceException("二维码或链接失效");
 		}
 		return flag;
 	}
@@ -230,12 +235,14 @@ public class QrcodeServiceImpl implements IQrcodeService {
 		Boolean exists = redis.exists(key);
 		//如果存在
 		if (exists) {
-			Long count = redis.incrBy(key, 1);
-			if (count > 20) {
+			Long count = redisTemplate.opsForValue().increment(key, 1L);
+			if (count != null && count > 20) {
 				throw new ServiceException("二维码只能扫描" + 20 + "次数");
 			} else {
 				flag = true;
 			}
+		} else {
+			throw new ServiceException("二维码或链接失效");
 		}
 		return flag;
 	}

+ 6 - 6
blade-service/wutong-okr/src/main/java/com/wtkj/service/impl/TaskServiceImpl.java

@@ -83,8 +83,10 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
 			if (stage != null) {
 				Date startTime = stage.getStartTime();
 				Date endTime = stage.getEndTime();
-				if (task.getStartTime().before(startTime) || task.getEndTime().after(endTime)) {
-					throw new ServiceException(String.format("任务时间异常,不可超出当前阶段的起止时间%s-%s", DateUtil.format(startTime, "yyyy-MM-dd"), DateUtil.format(endTime, "yyyy-MM-dd")));
+				if (startTime != null && endTime != null) {
+					if (task.getStartTime().before(startTime) || task.getEndTime().after(endTime)) {
+						throw new ServiceException(String.format("任务时间异常,不可超出当前阶段的起止时间%s-%s", DateUtil.format(startTime, "yyyy-MM-dd"), DateUtil.format(endTime, "yyyy-MM-dd")));
+					}
 				}
 			}
 			LocalDate now = LocalDate.now();
@@ -591,12 +593,10 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
 	}
 
 	@Override
-	public List<Workload> exportList(String startDate, String endDate) {
+	public List<Workload> exportList(String startDate) {
 		List<Workload> result = new ArrayList<>();
 		//1.时间段内已经完成的任务
-		LambdaQueryWrapper<Task> lqw = new LambdaQueryWrapper<>();
-		lqw.between(Task::getConfirmTime, DateUtil.parse(startDate, "yyyy-MM-dd"), DateUtil.parse(endDate, "yyyy-MM-dd"));
-		List<Task> list = this.list(lqw);
+		List<Task> list = baseMapper.getByMonth(startDate);
 		if (!CollectionUtils.isEmpty(list)) {
 			List<Workload> tempList = new ArrayList<>();
 			//2.Information for all tasks

+ 46 - 0
blade-service/wutong-okr/src/main/java/com/wtkj/wrapper/TaskPageWrapper.java

@@ -1,16 +1,24 @@
 package com.wtkj.wrapper;
 
+import com.wtkj.entity.Project;
 import com.wtkj.entity.Task;
+import com.wtkj.service.IProjectService;
 import com.wtkj.vo.TaskVO;
 import org.springblade.core.mp.support.BaseEntityWrapper;
 import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.utils.BeanUtil;
+import org.springblade.core.tool.utils.Func;
 import org.springblade.core.tool.utils.SpringUtil;
+import org.springblade.core.tool.utils.StringUtil;
 import org.springblade.system.entity.Dept;
+import org.springblade.system.entity.DictBiz;
+import org.springblade.system.feign.IDictBizClient;
 import org.springblade.system.feign.ISysClient;
 import org.springblade.system.user.entity.User;
 import org.springblade.system.user.feign.IUserClient;
 
+import java.util.ArrayList;
+import java.util.List;
 import java.util.Objects;
 
 /**
@@ -22,10 +30,15 @@ public class TaskPageWrapper extends BaseEntityWrapper<Task, TaskVO> {
 
 	private static ISysClient sysClient;
 	private static IUserClient userClient;
+	private static IProjectService projectService;
+	private static IDictBizClient dictBizClient;
+
 
 	public static TaskPageWrapper build() {
 		sysClient = SpringUtil.getBean(ISysClient.class);
 		userClient = SpringUtil.getBean(IUserClient.class);
+		projectService = SpringUtil.getBean(IProjectService.class);
+		dictBizClient = SpringUtil.getBean(IDictBizClient.class);
 		return new TaskPageWrapper();
 	}
 
@@ -33,6 +46,14 @@ public class TaskPageWrapper extends BaseEntityWrapper<Task, TaskVO> {
 	public TaskVO entityVO(Task entity) {
 		TaskVO vo = Objects.requireNonNull(BeanUtil.copy(entity, TaskVO.class));
 
+		Long projectId = entity.getProjectId();
+		if (projectId != null) {
+			Project byId = projectService.getById(projectId);
+			if (byId != null) {
+				vo.setProjectName(byId.getName());
+			}
+		}
+
 		//协作单位
 		Long orgDeptId = vo.getOrgDeptId();
 		if (orgDeptId != null) {
@@ -51,6 +72,31 @@ public class TaskPageWrapper extends BaseEntityWrapper<Task, TaskVO> {
 			}
 		}
 
+		//任务标签的数组
+		String tags = entity.getTags();
+		String category = entity.getCategory();
+		List<String> dictBizs = new ArrayList<>();
+		if (StringUtil.isNotBlank(tags)) {
+			List<Long> intList = Func.toLongList(tags);
+			intList.forEach(f -> {
+				R<DictBiz> byId = dictBizClient.getById(f);
+				if (byId.isSuccess()) {
+					dictBizs.add(byId.getData().getDictValue());
+				}
+			});
+		}
+		if (StringUtil.isNotBlank(category)) {
+			List<Long> intList = Func.toLongList(category);
+			intList.forEach(f -> {
+				R<DictBiz> byId = dictBizClient.getById(f);
+				if (byId.isSuccess()) {
+					dictBizs.add(byId.getData().getDictValue());
+				}
+			});
+		}
+		vo.setTagsArray(dictBizs);
+
+
 		return vo;
 	}
 }