chenw 6 лет назад
Родитель
Сommit
cedfc6d0f1

+ 4 - 1
bi-server/src/main/java/com/usoftchina/bi/server/controller/dashboard/DashboardsController.java

@@ -6,6 +6,7 @@ import com.usoftchina.bi.core.base.TestPage;
 import com.usoftchina.bi.core.utils.EncryUtil;
 import com.usoftchina.bi.server.model.bo.ShareReqBO;
 import com.usoftchina.bi.server.model.pojo.annotation.CheckToken;
+import com.usoftchina.bi.server.model.pojo.annotation.Log;
 import com.usoftchina.bi.server.model.vo.configVo.ChangeOrderInfo;
 import com.usoftchina.bi.server.model.vo.configVo.ChartsToDashInfo;
 import com.usoftchina.bi.server.model.vo.configVo.DashboardsInfo;
@@ -33,8 +34,9 @@ public class DashboardsController {
      */
     @ApiOperation(value = "保存看板", notes = "保存看板", response = RepEntity.class)
     @CheckToken
+    @Log(module = "看板", name = "#body.bdName", token = "#token")
     @PostMapping("/inputDashboards")
-    public RepEntity inputDashboards(@RequestHeader String token, @RequestBody DashboardsInfo body){
+    public RepEntity saveDashboards(@RequestHeader String token, @RequestBody DashboardsInfo body){
         return dashboardsService.setDashboards(token, body);
     }
 
@@ -43,6 +45,7 @@ public class DashboardsController {
      */
     @ApiOperation(value = "更新看板", notes = "更新看板", response = RepEntity.class)
     @CheckToken
+    @Log(module = "看板", name = "#body.bdName", token = "#token")
     @PostMapping("/updateDashboards")
     public RepEntity updateDashboards(@RequestHeader String token,@RequestBody DashboardsInfo body){
         return dashboardsService.updateDashboards(token, body);

+ 9 - 0
bi-server/src/main/java/com/usoftchina/bi/server/service/dashboard/DashboardsService.java

@@ -24,6 +24,7 @@ import com.usoftchina.bi.server.model.vo.dataVo.DashboardOrderInfo;
 import com.usoftchina.bi.server.model.vo.dataVo.DataSourceCopyInfo;
 import com.usoftchina.bi.server.service.chart.ChartsUtilService;
 import com.usoftchina.bi.core.utils.GetTokenDataUtil;
+import com.usoftchina.bi.server.service.common.MessageLogService;
 import com.usoftchina.bi.server.service.dataSource.DataConnectorService;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -50,6 +51,8 @@ public class DashboardsService {
     private DataConnectorService dataConnectorService;
     @Autowired
     private ChartsConfigMapper chartsConfigMapper;
+    @Autowired
+    private MessageLogService messageLogService;
 
     private static final Logger LOGGER = LoggerFactory.getLogger(DashboardsService.class);
 
@@ -146,9 +149,15 @@ public class DashboardsService {
         if (userId != createId) {
             return new RepEntity(RepCode.NoAuthority);
         }
+        Dashboards dashboards = dashboardsMapper.getDashboards(userId, id);
+        String name = null;
+        if (!ObjectUtils.isEmpty(dashboards)) {
+            name = dashboards.getBdName();
+        }
         dashboardsMapper.delDashboards(id);
         //删除看板-图表关联关系
         dashboardsMapper.deleteDashboardChartRelation(id);
+        messageLogService.delete("看板", name, stringMap.get("name"), null);
         return new RepEntity(RepCode.success);
     }