Browse Source

bug修复

master
luogw 1 month ago
parent
commit
e2e5dcb069
  1. 3
      src/main/java/com/project/information/application/ProductLineApplicationService.java
  2. 15
      src/main/java/com/project/information/application/impl/ProductLineApplicationServiceImpl.java
  3. 18
      src/main/java/com/project/task/domain/service/impl/NotifyTaskDomainServiceImpl.java
  4. 10
      src/main/java/com/project/task/domain/service/impl/SearchTaskDomainServiceImpl.java

3
src/main/java/com/project/information/application/ProductLineApplicationService.java

@ -5,6 +5,7 @@ import com.project.information.domain.dto.ProductLineDTO;
import com.project.information.domain.param.ProductLineParam; import com.project.information.domain.param.ProductLineParam;
import java.util.List; import java.util.List;
import java.util.Optional;
public interface ProductLineApplicationService { public interface ProductLineApplicationService {
Result<ProductLineDTO> save(ProductLineDTO dto) throws Exception; Result<ProductLineDTO> save(ProductLineDTO dto) throws Exception;
@ -14,4 +15,6 @@ public interface ProductLineApplicationService {
Result<ProductLineDTO> rename(ProductLineDTO dto) throws Exception; Result<ProductLineDTO> rename(ProductLineDTO dto) throws Exception;
Result<String> delete(Long id) throws Exception; Result<String> delete(Long id) throws Exception;
String searchLineNameById(Long subLineId);
} }

15
src/main/java/com/project/information/application/impl/ProductLineApplicationServiceImpl.java

@ -3,8 +3,10 @@ package com.project.information.application.impl;
import com.project.base.domain.result.Result; import com.project.base.domain.result.Result;
import com.project.information.application.ProductLineApplicationService; import com.project.information.application.ProductLineApplicationService;
import com.project.information.domain.dto.ProductLineDTO; import com.project.information.domain.dto.ProductLineDTO;
import com.project.information.domain.entity.ProductLineEntity;
import com.project.information.domain.param.ProductLineParam; import com.project.information.domain.param.ProductLineParam;
import com.project.information.domain.service.GetTreeListProductLineDomainService; import com.project.information.domain.service.GetTreeListProductLineDomainService;
import com.project.information.domain.service.ProductLineBaseService;
import com.project.information.domain.service.SaveProductLineDomainService; import com.project.information.domain.service.SaveProductLineDomainService;
import com.project.information.domain.service.UpdateProductLineDomainService; import com.project.information.domain.service.UpdateProductLineDomainService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -20,6 +22,9 @@ public class ProductLineApplicationServiceImpl implements ProductLineApplication
@Autowired @Autowired
private GetTreeListProductLineDomainService treeListProductLineDomainService; private GetTreeListProductLineDomainService treeListProductLineDomainService;
@Autowired
private ProductLineBaseService productLineBaseService;
@Autowired @Autowired
private UpdateProductLineDomainService updateProductLineDomainService; private UpdateProductLineDomainService updateProductLineDomainService;
@Override @Override
@ -41,4 +46,14 @@ public class ProductLineApplicationServiceImpl implements ProductLineApplication
public Result<String> delete(Long id) throws Exception { public Result<String> delete(Long id) throws Exception {
return updateProductLineDomainService.delete(id); return updateProductLineDomainService.delete(id);
} }
@Override
public String searchLineNameById(Long subLineId) {
return productLineBaseService.lambdaQuery()
.eq(ProductLineEntity::getId , subLineId)
.select(ProductLineEntity::getName)
.oneOpt()
.map(ProductLineEntity::getName)
.orElse("");
}
} }

18
src/main/java/com/project/task/domain/service/impl/NotifyTaskDomainServiceImpl.java

@ -10,8 +10,7 @@ import com.github.tingyugetc520.ali.dingtalk.bean.message.DtCorpConversationMsgS
import com.github.tingyugetc520.ali.dingtalk.bean.message.DtMessage; import com.github.tingyugetc520.ali.dingtalk.bean.message.DtMessage;
import com.github.tingyugetc520.ali.dingtalk.error.DtErrorException; import com.github.tingyugetc520.ali.dingtalk.error.DtErrorException;
import com.project.ding.config.DingProperties; import com.project.ding.config.DingProperties;
import com.project.information.domain.entity.ProductLineEntity; import com.project.information.application.ProductLineApplicationService;
import com.project.information.domain.service.ProductLineBaseService;
import com.project.task.domain.dto.TaskDTO; import com.project.task.domain.dto.TaskDTO;
import com.project.task.domain.entity.TaskEntity; import com.project.task.domain.entity.TaskEntity;
import com.project.task.domain.entity.TaskUserEntity; import com.project.task.domain.entity.TaskUserEntity;
@ -39,7 +38,7 @@ public class NotifyTaskDomainServiceImpl implements NotifyTaskDomainService {
@Autowired @Autowired
private DtService dtService; private DtService dtService;
@Autowired @Autowired
private ProductLineBaseService productLineBaseService; private ProductLineApplicationService productLineApplicationService;
@Autowired @Autowired
private DingProperties dingTalkProperties; private DingProperties dingTalkProperties;
@ -91,12 +90,7 @@ public class NotifyTaskDomainServiceImpl implements NotifyTaskDomainService {
} }
//获取子产品线名称 //获取子产品线名称
String subLineName = productLineBaseService.lambdaQuery() String subLineName = productLineApplicationService.searchLineNameById(taskDTO.getSubLineId());
.eq(ProductLineEntity::getId , taskDTO.getSubLineId())
.select(ProductLineEntity::getName)
.oneOpt()
.map(ProductLineEntity::getName)
.orElse("");
StringBuilder markdown = new StringBuilder(); StringBuilder markdown = new StringBuilder();
markdown.append(String.format("### 【%s】已经<font color=#00b500>开始</font>,请按时完成\n\n" , taskDTO.getName())) markdown.append(String.format("### 【%s】已经<font color=#00b500>开始</font>,请按时完成\n\n" , taskDTO.getName()))
@ -143,9 +137,13 @@ public class NotifyTaskDomainServiceImpl implements NotifyTaskDomainService {
if (CollUtil.isEmpty(userIds)) { if (CollUtil.isEmpty(userIds)) {
return; return;
} }
//获取子产品线名称
String subLineName = productLineApplicationService.searchLineNameById(taskDTO.getSubLineId());
StringBuilder markdown = new StringBuilder(); StringBuilder markdown = new StringBuilder();
markdown.append(String.format("### 【%s】即将<font color=#FF0000>结束</font>,请按时完成\n\n" , taskDTO.getName())) markdown.append(String.format("### 【%s】即将<font color=#FF0000>结束</font>,请按时完成\n\n" , taskDTO.getName()))
.append(String.format("产品线:%s\n\n" , taskDTO.getLineName())) .append(String.format("产品线:%s\n\n" , subLineName))
.append(String.format("开考时间:%s\n\n" ,sdf.format(taskDTO.getStartTime()))) .append(String.format("开考时间:%s\n\n" ,sdf.format(taskDTO.getStartTime())))
.append(String.format("截止时间:%s\n\n" , sdf.format(taskDTO.getEndTime()))) .append(String.format("截止时间:%s\n\n" , sdf.format(taskDTO.getEndTime())))
.append(String.format("注意事项:%s" , taskDTO.getNote())); .append(String.format("注意事项:%s" , taskDTO.getNote()));

10
src/main/java/com/project/task/domain/service/impl/SearchTaskDomainServiceImpl.java

@ -10,6 +10,7 @@ import com.project.base.domain.result.Result;
import com.project.base.domain.result.ResultCodeEnum; import com.project.base.domain.result.ResultCodeEnum;
import com.project.base.domain.utils.PageConverter; import com.project.base.domain.utils.PageConverter;
import com.project.ding.domain.dto.UserDTO; import com.project.ding.domain.dto.UserDTO;
import com.project.information.application.ProductLineApplicationService;
import com.project.information.domain.entity.ProductLineEntity; import com.project.information.domain.entity.ProductLineEntity;
import com.project.information.domain.service.ProductLineBaseService; import com.project.information.domain.service.ProductLineBaseService;
import com.project.task.domain.dto.TaskDTO; import com.project.task.domain.dto.TaskDTO;
@ -36,7 +37,7 @@ public class SearchTaskDomainServiceImpl implements SearchTaskDomainService {
@Autowired @Autowired
private TaskUserBaseService taskUserBaseService; private TaskUserBaseService taskUserBaseService;
@Autowired @Autowired
private ProductLineBaseService productLineBaseService; private ProductLineApplicationService productLineApplicationService;
@Override @Override
public Result<PageResult<TaskDTO>> search(TaskParam param) throws Exception { public Result<PageResult<TaskDTO>> search(TaskParam param) throws Exception {
@ -87,12 +88,7 @@ public class SearchTaskDomainServiceImpl implements SearchTaskDomainService {
}).toList(); }).toList();
//获取子产品线名称 //获取子产品线名称
String subLineName = productLineBaseService.lambdaQuery() String subLineName = productLineApplicationService.searchLineNameById(dto.getSubLineId());
.eq(ProductLineEntity::getId , dto.getSubLineId())
.select(ProductLineEntity::getName)
.oneOpt()
.map(ProductLineEntity::getName)
.orElse("");
dto.setSubLineName(subLineName); dto.setSubLineName(subLineName);

Loading…
Cancel
Save