fix: 修复删除计划时重新查询model的问题
--bug=1009008 --user=刘瑞斌 【消息中心】删除测试计划提示信息参数无值 https://www.tapd.cn/55049933/s/1085153
This commit is contained in:
parent
6c38dc571c
commit
bae4c71167
|
@ -35,6 +35,8 @@ import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
import static com.alibaba.fastjson.serializer.SerializerFeature.WriteMapNullValue;
|
||||||
|
|
||||||
@Aspect
|
@Aspect
|
||||||
@Component
|
@Component
|
||||||
public class SendNoticeAspect {
|
public class SendNoticeAspect {
|
||||||
|
@ -81,7 +83,7 @@ public class SendNoticeAspect {
|
||||||
Expression titleExp = parser.parseExpression(target);
|
Expression titleExp = parser.parseExpression(target);
|
||||||
Object v = titleExp.getValue(context, Object.class);
|
Object v = titleExp.getValue(context, Object.class);
|
||||||
Map<String, Object> memberValues = (Map<String, Object>) value.get(invocationHandler);
|
Map<String, Object> memberValues = (Map<String, Object>) value.get(invocationHandler);
|
||||||
memberValues.put("source", JSON.toJSONString(v));
|
memberValues.put("source", JSON.toJSONString(v, WriteMapNullValue));
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
LogUtil.error(e.getMessage(), e);
|
LogUtil.error(e.getMessage(), e);
|
||||||
|
@ -119,7 +121,7 @@ public class SendNoticeAspect {
|
||||||
Object v = titleExp.getValue(context, Object.class);
|
Object v = titleExp.getValue(context, Object.class);
|
||||||
if (v != null) {
|
if (v != null) {
|
||||||
Map<String, Object> memberValues = (Map<String, Object>) value.get(invocationHandler);
|
Map<String, Object> memberValues = (Map<String, Object>) value.get(invocationHandler);
|
||||||
memberValues.put("source", JSON.toJSONString(v));
|
memberValues.put("source", JSON.toJSONString(v, WriteMapNullValue));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -133,7 +133,7 @@ public class TestPlanController {
|
||||||
@PostMapping("/delete/{testPlanId}")
|
@PostMapping("/delete/{testPlanId}")
|
||||||
@RequiresPermissions(PermissionConstants.PROJECT_TRACK_PLAN_READ_DELETE)
|
@RequiresPermissions(PermissionConstants.PROJECT_TRACK_PLAN_READ_DELETE)
|
||||||
@MsAuditLog(module = "track_test_plan", type = OperLogConstants.DELETE, beforeEvent = "#msClass.getLogDetails(#testPlanId)", msClass = TestPlanService.class)
|
@MsAuditLog(module = "track_test_plan", type = OperLogConstants.DELETE, beforeEvent = "#msClass.getLogDetails(#testPlanId)", msClass = TestPlanService.class)
|
||||||
@SendNotice(taskType = NoticeConstants.TaskType.TEST_PLAN_TASK, target = "#targetClass.getTestPlan(#testPlanId)", targetClass = TestPlanService.class,
|
@SendNotice(taskType = NoticeConstants.TaskType.TEST_PLAN_TASK, target = "#targetClass.get(#testPlanId)", targetClass = TestPlanService.class,
|
||||||
event = NoticeConstants.Event.DELETE, mailTemplate = "track/TestPlanDelete", subject = "测试计划通知")
|
event = NoticeConstants.Event.DELETE, mailTemplate = "track/TestPlanDelete", subject = "测试计划通知")
|
||||||
public int deleteTestPlan(@PathVariable String testPlanId) {
|
public int deleteTestPlan(@PathVariable String testPlanId) {
|
||||||
checkPermissionService.checkTestPlanOwner(testPlanId);
|
checkPermissionService.checkTestPlanOwner(testPlanId);
|
||||||
|
|
|
@ -243,6 +243,10 @@ public class TestPlanService {
|
||||||
return Optional.ofNullable(testPlanMapper.selectByPrimaryKey(testPlanId)).orElse(new TestPlanWithBLOBs());
|
return Optional.ofNullable(testPlanMapper.selectByPrimaryKey(testPlanId)).orElse(new TestPlanWithBLOBs());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public TestPlanWithBLOBs get(String testPlanId) {
|
||||||
|
return testPlanMapper.selectByPrimaryKey(testPlanId);
|
||||||
|
}
|
||||||
|
|
||||||
public TestPlan editTestPlanWithRequest(AddTestPlanRequest request) {
|
public TestPlan editTestPlanWithRequest(AddTestPlanRequest request) {
|
||||||
List<String> principals = request.getPrincipals();
|
List<String> principals = request.getPrincipals();
|
||||||
if (!CollectionUtils.isEmpty(principals)) {
|
if (!CollectionUtils.isEmpty(principals)) {
|
||||||
|
|
Loading…
Reference in New Issue