ids);
}
\ No newline at end of file
diff --git a/src/main/java/com/lz/modules/performance/dto/IndicatorLibraryDto.java b/src/main/java/com/lz/modules/performance/dto/IndicatorLibraryDto.java
new file mode 100644
index 00000000..3755afa9
--- /dev/null
+++ b/src/main/java/com/lz/modules/performance/dto/IndicatorLibraryDto.java
@@ -0,0 +1,36 @@
+package com.lz.modules.performance.dto;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.math.BigDecimal;
+
+/**
+ * @Author: djc
+ * @Desc:
+ * @Date: 2021/1/12 14:41
+ */
+public class IndicatorLibraryDto {
+ //
+ @TableId(value = "id", type = IdType.AUTO)
+ private Long id;
+ //指标名称
+ @ApiModelProperty(value = "指标名称", name = "name")
+ private String name;
+ //指标类型 lz_indicator_type 表id"
+ @ApiModelProperty(value = "指标类型 lz_indicator_type 表id", name = "type")
+ private Integer type;
+ //指标分类 lz_indicator_type 表id
+ @ApiModelProperty(value = "指标分类 lz_indicator_type 表id", name = "indicatorType")
+ private Integer indicatorType;
+ //权重
+ @ApiModelProperty(value = "权重", name = "weight")
+ private BigDecimal weight;
+ //考核标准,关键结果
+ @ApiModelProperty(value = "考核标准,关键结果", name = "keyResult")
+ private String keyResult;
+ //排序
+ @ApiModelProperty(value = "排序", name = "sort")
+ private Integer sort;
+}
diff --git a/src/main/java/com/lz/modules/performance/dto/IndicatorTypeDto.java b/src/main/java/com/lz/modules/performance/dto/IndicatorTypeDto.java
index 04af7299..a4dc3542 100644
--- a/src/main/java/com/lz/modules/performance/dto/IndicatorTypeDto.java
+++ b/src/main/java/com/lz/modules/performance/dto/IndicatorTypeDto.java
@@ -17,6 +17,6 @@ public class IndicatorTypeDto {
@ApiModelProperty(value = "指标分类名称", name = "name")
private String name;
//排序
- @ApiModelProperty(value = "排序(非必传)", name = "orderBy")
+ @ApiModelProperty(value = "排序(非必须)", name = "orderBy")
private Integer orderBy;
}
diff --git a/src/main/java/com/lz/modules/performance/entity/IndicatorLibrary.java b/src/main/java/com/lz/modules/performance/entity/IndicatorLibrary.java
index e99603ad..d17267ff 100644
--- a/src/main/java/com/lz/modules/performance/entity/IndicatorLibrary.java
+++ b/src/main/java/com/lz/modules/performance/entity/IndicatorLibrary.java
@@ -35,7 +35,7 @@ public class IndicatorLibrary implements java.io.Serializable {
@ApiModelProperty(value = "指标名称", name = "name")
private String name;
//指标类型 0:量化指标 1:行为价值观指标 2:团队管理
- @ApiModelProperty(value = "指标类型 0:量化指标 1:行为价值观指标 2:团队管理", name = "type")
+ @ApiModelProperty(value = "指标类型 lz_indicator_type 表id", name = "type")
private Integer type;
//指标分类 lz_indicator_type 表id
@ApiModelProperty(value = "指标分类 lz_indicator_type 表id", name = "indicatorType")
diff --git a/src/main/java/com/lz/modules/performance/req/IndicatorLibraryReq.java b/src/main/java/com/lz/modules/performance/req/IndicatorLibraryReq.java
new file mode 100644
index 00000000..2169e519
--- /dev/null
+++ b/src/main/java/com/lz/modules/performance/req/IndicatorLibraryReq.java
@@ -0,0 +1,22 @@
+package com.lz.modules.performance.req;
+
+import com.fasterxml.jackson.databind.ser.Serializers;
+import com.lz.modules.equipment.entity.model.BasePage;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+ * @Author: djc
+ * @Desc:
+ * @Date: 2021/1/12 14:50
+ */
+@Data
+public class IndicatorLibraryReq extends BasePage{
+ //指标名称
+ @ApiModelProperty(value = "指标名称", name = "name")
+ private String name;
+ //指标分类 lz_indicator_type 表id
+ @ApiModelProperty(value = "指标分类 lz_indicator_type 表id", name = "indicatorType")
+ private Integer indicatorType;
+
+}
diff --git a/src/main/java/com/lz/modules/performance/service/IndicatorLibraryService.java b/src/main/java/com/lz/modules/performance/service/IndicatorLibraryService.java
index 582fa04e..0f49f82d 100644
--- a/src/main/java/com/lz/modules/performance/service/IndicatorLibraryService.java
+++ b/src/main/java/com/lz/modules/performance/service/IndicatorLibraryService.java
@@ -1,7 +1,9 @@
package com.lz.modules.performance.service;
import com.baomidou.mybatisplus.extension.service.IService;
+import com.lz.common.utils.PageUtils;
import com.lz.modules.performance.entity.IndicatorLibrary;
+import com.lz.modules.performance.req.IndicatorLibraryReq;
/**
*
@@ -29,5 +31,9 @@ public interface IndicatorLibraryService extends IService {
int deleteIndicatorLibraryById(Long id);
+ PageUtils selectIndicatorLibrarysByReq(IndicatorLibraryReq req);
+
+ void deleteIndicatorLibrarysByIds(String ids);
+
}
\ No newline at end of file
diff --git a/src/main/java/com/lz/modules/performance/service/impl/IndicatorLibraryServiceImpl.java b/src/main/java/com/lz/modules/performance/service/impl/IndicatorLibraryServiceImpl.java
index c4edd633..34f811bc 100644
--- a/src/main/java/com/lz/modules/performance/service/impl/IndicatorLibraryServiceImpl.java
+++ b/src/main/java/com/lz/modules/performance/service/impl/IndicatorLibraryServiceImpl.java
@@ -1,12 +1,19 @@
package com.lz.modules.performance.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.lz.common.utils.PageUtils;
+import com.lz.common.utils.StringUtil;
import com.lz.modules.performance.dao.IndicatorLibraryMapper;
import com.lz.modules.performance.entity.IndicatorLibrary;
+import com.lz.modules.performance.req.IndicatorLibraryReq;
import com.lz.modules.performance.service.IndicatorLibraryService;
+import io.jsonwebtoken.lang.Collections;
+import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
+import java.util.List;
+
/**
*
* (设置)指标库 服务类
@@ -58,6 +65,22 @@ public class IndicatorLibraryServiceImpl extends ServiceImpl indicatorLibraryMapper.selectIndicatorLibrarysByReq(page1,req)
+ );
+ return page;
+ }
+ @Override
+ public void deleteIndicatorLibrarysByIds(String ids) {
+ if(StringUtil.isBlank(ids)){
+ return;
+ }
+ String[] split = ids.split(",");
+ List list = Collections.arrayToList(split);
+ indicatorLibraryMapper.deleteIndicatorLibrarysByIds(list);
+ }
}
diff --git a/src/main/resources/mapper/performance/IndicatorLibraryMapper.xml b/src/main/resources/mapper/performance/IndicatorLibraryMapper.xml
index 368d6e20..c340ead7 100644
--- a/src/main/resources/mapper/performance/IndicatorLibraryMapper.xml
+++ b/src/main/resources/mapper/performance/IndicatorLibraryMapper.xml
@@ -23,8 +23,6 @@
-
-
@@ -93,5 +91,21 @@
update lz_indicator_library set is_delete = 1 where id=#{id} limit 1
+
+
+
+ update lz_indicator_library set is_delete = 1 where is_delete = 0 AND
+ id in
+ (
+
+ #{id}
+
+ )
+
+
+
From 26ff04f9a8ad4072697da4bf034364be582f2b51 Mon Sep 17 00:00:00 2001
From: DirectionOfMind <3182967682@qq.com>
Date: Tue, 12 Jan 2021 18:13:09 +0800
Subject: [PATCH 03/26] fix
---
.../controller/IndicatorLibraryController.java | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/src/main/java/com/lz/modules/performance/controller/IndicatorLibraryController.java b/src/main/java/com/lz/modules/performance/controller/IndicatorLibraryController.java
index 6f2fe625..5e74be16 100644
--- a/src/main/java/com/lz/modules/performance/controller/IndicatorLibraryController.java
+++ b/src/main/java/com/lz/modules/performance/controller/IndicatorLibraryController.java
@@ -10,6 +10,7 @@ import com.lz.modules.performance.dto.IndicatorLibraryDto;
import com.lz.modules.performance.entity.IndicatorLibrary;
import com.lz.modules.performance.req.IndicatorLibraryReq;
import com.lz.modules.performance.service.IndicatorLibraryService;
+import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@@ -25,22 +26,24 @@ public class IndicatorLibraryController {
private IndicatorLibraryService indicatorLibraryService;
- @RequestMapping("/list")
+ @PostMapping("/list")
public R list(@RequestBody IndicatorLibraryReq req) {
PageUtils page = indicatorLibraryService.selectIndicatorLibrarysByReq(req);
return R.ok().put("data",page);
}
- @RequestMapping("/getById")
- public R getById(@RequestBody IndicatorLibrary indicatorLibrary) {
- indicatorLibrary = indicatorLibraryService.selectIndicatorLibraryById(indicatorLibrary.getId());
- return R.ok().put("indicatorLibrary",indicatorLibrary);
+ @GetMapping("/getById")
+ public R getById(@Param("id")Long id) {
+ IndicatorLibrary indicatorLibrary = indicatorLibraryService.selectIndicatorLibraryById(id);
+ IndicatorLibraryDto dto = new IndicatorLibraryDto();
+ BeanUtil.copyProperties(indicatorLibrary,dto);
+ return R.ok().put("data",dto);
}
- @RequestMapping("/saveOrUpdate")
+ @PostMapping("/saveOrUpdate")
public R save(@RequestBody IndicatorLibraryDto dto) {
IndicatorLibrary indicatorLibrary = new IndicatorLibrary();
BeanUtil.copyProperties(dto,indicatorLibrary);
From 0d87dd9801029748c52debb491467f82ea69da09 Mon Sep 17 00:00:00 2001
From: DirectionOfMind <3182967682@qq.com>
Date: Wed, 13 Jan 2021 16:14:43 +0800
Subject: [PATCH 04/26] fix
---
.../IndicatorLibraryController.java | 37 +++++++++++++++++--
.../controller/IndicatorTypeController.java | 20 +++++++++-
.../dao/IndicatorLibraryMapper.java | 2 +
.../performance/dao/IndicatorTypeMapper.java | 1 +
.../performance/dto/IndicatorLibraryDto.java | 4 ++
.../dto/IndicatorLibraryMoveDto.java | 21 +++++++++++
.../performance/dto/IndicatorTypeDto.java | 5 +++
.../performance/req/IndicatorLibraryReq.java | 2 +
.../modules/performance/req/IndicatorReq.java | 2 +
.../service/IndicatorLibraryService.java | 3 ++
.../service/IndicatorTypeService.java | 2 +
.../impl/IndicatorLibraryServiceImpl.java | 15 ++++++++
.../impl/IndicatorTypeServiceImpl.java | 5 +++
.../performance/IndicatorLibraryMapper.xml | 18 ++++++++-
.../performance/IndicatorTypeMapper.xml | 13 ++++++-
15 files changed, 142 insertions(+), 8 deletions(-)
create mode 100644 src/main/java/com/lz/modules/performance/dto/IndicatorLibraryMoveDto.java
diff --git a/src/main/java/com/lz/modules/performance/controller/IndicatorLibraryController.java b/src/main/java/com/lz/modules/performance/controller/IndicatorLibraryController.java
index 5e74be16..2cdb0dec 100644
--- a/src/main/java/com/lz/modules/performance/controller/IndicatorLibraryController.java
+++ b/src/main/java/com/lz/modules/performance/controller/IndicatorLibraryController.java
@@ -7,9 +7,14 @@ import com.lz.common.utils.PageUtils;
import com.lz.common.utils.R;
import com.lz.common.utils.StringUtil;
import com.lz.modules.performance.dto.IndicatorLibraryDto;
+import com.lz.modules.performance.dto.IndicatorLibraryMoveDto;
import com.lz.modules.performance.entity.IndicatorLibrary;
import com.lz.modules.performance.req.IndicatorLibraryReq;
import com.lz.modules.performance.service.IndicatorLibraryService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@@ -17,8 +22,10 @@ import org.springframework.web.bind.annotation.*;
import java.util.HashMap;
import java.util.Map;
+@Slf4j
@RestController
@RequestMapping("/indicatorLibrary")
+@Api(value = "指标相关接口", tags = { "指标相关接口" })
public class IndicatorLibraryController {
@@ -27,6 +34,7 @@ public class IndicatorLibraryController {
@PostMapping("/list")
+ @ApiOperation("获取指标列表")
public R list(@RequestBody IndicatorLibraryReq req) {
PageUtils page = indicatorLibraryService.selectIndicatorLibrarysByReq(req);
return R.ok().put("data",page);
@@ -34,7 +42,8 @@ public class IndicatorLibraryController {
@GetMapping("/getById")
- public R getById(@Param("id")Long id) {
+ @ApiOperation("获取指标")
+ public R getById(@RequestParam @ApiParam(value = "获取指标id",name = "id")Long id) {
IndicatorLibrary indicatorLibrary = indicatorLibraryService.selectIndicatorLibraryById(id);
IndicatorLibraryDto dto = new IndicatorLibraryDto();
BeanUtil.copyProperties(indicatorLibrary,dto);
@@ -44,7 +53,8 @@ public class IndicatorLibraryController {
@PostMapping("/saveOrUpdate")
- public R save(@RequestBody IndicatorLibraryDto dto) {
+ @ApiOperation("保存/修改指标")
+ public R save(@RequestBody IndicatorLibraryDto dto) {
IndicatorLibrary indicatorLibrary = new IndicatorLibrary();
BeanUtil.copyProperties(dto,indicatorLibrary);
boolean success = indicatorLibraryService.saveOrUpdate(indicatorLibrary);
@@ -56,8 +66,27 @@ public class IndicatorLibraryController {
@GetMapping("/delete")
- public R delete(@RequestParam String ids) {
- indicatorLibraryService.deleteIndicatorLibrarysByIds(ids);
+ @ApiOperation("删除指标")
+ public R delete(@RequestParam @ApiParam(value = "指标删除id,逗号隔开",name = "ids") String ids) {
+ try {
+ indicatorLibraryService.deleteIndicatorLibrarysByIds(ids);
+ } catch (Exception e) {
+ log.error("删除指标异常",e);
+ return R.error();
+ }
return R.ok();
}
+
+
+ @PostMapping("/move")
+ @ApiOperation("移动指标")
+ public R move(@RequestBody IndicatorLibraryMoveDto dto) {
+ try {
+ indicatorLibraryService.updateIndicatorLibrarysMove(dto);
+ } catch (Exception e) {
+ log.error("移动指标异常",e);
+ return R.error();
+ }
+ return R.ok();
+ }
}
diff --git a/src/main/java/com/lz/modules/performance/controller/IndicatorTypeController.java b/src/main/java/com/lz/modules/performance/controller/IndicatorTypeController.java
index 9cb1d485..5c67bab6 100644
--- a/src/main/java/com/lz/modules/performance/controller/IndicatorTypeController.java
+++ b/src/main/java/com/lz/modules/performance/controller/IndicatorTypeController.java
@@ -4,17 +4,22 @@ package com.lz.modules.performance.controller;
import cn.hutool.core.bean.BeanUtil;
import com.lz.common.utils.PageUtils;
import com.lz.common.utils.R;
+import com.lz.common.utils.StringUtil;
import com.lz.modules.performance.dto.IndicatorTypeDto;
import com.lz.modules.performance.entity.IndicatorType;
import com.lz.modules.performance.req.IndicatorReq;
import com.lz.modules.performance.service.IndicatorTypeService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/indicatorType")
+@Api(value = "指标分类相关接口", tags = { "指标分类相关接口" })
public class IndicatorTypeController {
@@ -22,7 +27,8 @@ public class IndicatorTypeController {
private IndicatorTypeService indicatorTypeService;
- @RequestMapping("/list")
+ @PostMapping("/list")
+ @ApiOperation("获取分类/类型列表")
public R list(@RequestBody IndicatorReq req) {
PageUtils page = indicatorTypeService.selectIndicatorTypesByReq(req);
return R.ok().put("data", page);
@@ -30,8 +36,18 @@ public class IndicatorTypeController {
- @RequestMapping("/saveOrUpdate")
+ @ApiOperation("保存/修改分类")
+ @PostMapping("/saveOrUpdate")
public R save(@RequestBody IndicatorTypeDto dto) {
+ if(dto.getId()==null){
+ if(StringUtil.isBlank(dto.getName())){
+ return R.error("分类名称不能为空");
+ }
+ IndicatorType indicatorType = indicatorTypeService.selectIndicatorTypeByName(dto.getName());
+ if(indicatorType!=null){
+ return R.error("分类名称重复");
+ }
+ }
IndicatorType indicatorType = new IndicatorType();
BeanUtil.copyProperties(dto,indicatorType);
boolean success = indicatorTypeService.saveOrUpdate(indicatorType);
diff --git a/src/main/java/com/lz/modules/performance/dao/IndicatorLibraryMapper.java b/src/main/java/com/lz/modules/performance/dao/IndicatorLibraryMapper.java
index bfd2d7d8..a3729213 100644
--- a/src/main/java/com/lz/modules/performance/dao/IndicatorLibraryMapper.java
+++ b/src/main/java/com/lz/modules/performance/dao/IndicatorLibraryMapper.java
@@ -39,4 +39,6 @@ public interface IndicatorLibraryMapper extends BaseMapper {
void deleteIndicatorLibrarysByIds(@Param("ids") List ids);
+ void updateIndicatorLibrarysMove(@Param("ids")List ids,@Param("indicatorType")Long indicatorType);
+
}
\ No newline at end of file
diff --git a/src/main/java/com/lz/modules/performance/dao/IndicatorTypeMapper.java b/src/main/java/com/lz/modules/performance/dao/IndicatorTypeMapper.java
index cec45492..b4f7aec4 100644
--- a/src/main/java/com/lz/modules/performance/dao/IndicatorTypeMapper.java
+++ b/src/main/java/com/lz/modules/performance/dao/IndicatorTypeMapper.java
@@ -38,6 +38,7 @@ public interface IndicatorTypeMapper extends BaseMapper {
List selectIndicatorTypesByReq(@Param("page") IPage page, @Param("req")IndicatorReq req);
+ IndicatorType selectIndicatorTypeByName(@Param("name") String name);
}
\ No newline at end of file
diff --git a/src/main/java/com/lz/modules/performance/dto/IndicatorLibraryDto.java b/src/main/java/com/lz/modules/performance/dto/IndicatorLibraryDto.java
index 3755afa9..6f7f0171 100644
--- a/src/main/java/com/lz/modules/performance/dto/IndicatorLibraryDto.java
+++ b/src/main/java/com/lz/modules/performance/dto/IndicatorLibraryDto.java
@@ -2,7 +2,9 @@ package com.lz.modules.performance.dto;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
+import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
import java.math.BigDecimal;
@@ -11,6 +13,8 @@ import java.math.BigDecimal;
* @Desc:
* @Date: 2021/1/12 14:41
*/
+@Data
+@ApiModel("指标保存/修改实体")
public class IndicatorLibraryDto {
//
@TableId(value = "id", type = IdType.AUTO)
diff --git a/src/main/java/com/lz/modules/performance/dto/IndicatorLibraryMoveDto.java b/src/main/java/com/lz/modules/performance/dto/IndicatorLibraryMoveDto.java
new file mode 100644
index 00000000..4b446658
--- /dev/null
+++ b/src/main/java/com/lz/modules/performance/dto/IndicatorLibraryMoveDto.java
@@ -0,0 +1,21 @@
+package com.lz.modules.performance.dto;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+ * @Author: djc
+ * @Desc:
+ * @Date: 2021/1/13 11:38
+ */
+@Data
+@ApiModel("移动指标实体")
+public class IndicatorLibraryMoveDto {
+ @ApiModelProperty(value = "移动的id,逗号隔开",name = "ids")
+ private String ids;
+
+ @ApiModelProperty(value = "要移动的目标分类",name = "indicatorType")
+ private Long indicatorType;
+
+}
diff --git a/src/main/java/com/lz/modules/performance/dto/IndicatorTypeDto.java b/src/main/java/com/lz/modules/performance/dto/IndicatorTypeDto.java
index a4dc3542..3dbca138 100644
--- a/src/main/java/com/lz/modules/performance/dto/IndicatorTypeDto.java
+++ b/src/main/java/com/lz/modules/performance/dto/IndicatorTypeDto.java
@@ -1,5 +1,6 @@
package com.lz.modules.performance.dto;
+import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@@ -9,6 +10,7 @@ import lombok.Data;
* @Date: 2021/1/12 10:21
*/
@Data
+@ApiModel("保存/修改分类实体")
public class IndicatorTypeDto {
@ApiModelProperty(value = "id", name = "id")
@@ -16,6 +18,9 @@ public class IndicatorTypeDto {
//指标名称
@ApiModelProperty(value = "指标分类名称", name = "name")
private String name;
+ //指标名称
+ @ApiModelProperty(value = "类型0: 指标分类 1:指标类型", name = "type")
+ private Integer type;
//排序
@ApiModelProperty(value = "排序(非必须)", name = "orderBy")
private Integer orderBy;
diff --git a/src/main/java/com/lz/modules/performance/req/IndicatorLibraryReq.java b/src/main/java/com/lz/modules/performance/req/IndicatorLibraryReq.java
index 2169e519..85d27fe3 100644
--- a/src/main/java/com/lz/modules/performance/req/IndicatorLibraryReq.java
+++ b/src/main/java/com/lz/modules/performance/req/IndicatorLibraryReq.java
@@ -2,6 +2,7 @@ package com.lz.modules.performance.req;
import com.fasterxml.jackson.databind.ser.Serializers;
import com.lz.modules.equipment.entity.model.BasePage;
+import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@@ -11,6 +12,7 @@ import lombok.Data;
* @Date: 2021/1/12 14:50
*/
@Data
+@ApiModel("获取指标列表实体")
public class IndicatorLibraryReq extends BasePage{
//指标名称
@ApiModelProperty(value = "指标名称", name = "name")
diff --git a/src/main/java/com/lz/modules/performance/req/IndicatorReq.java b/src/main/java/com/lz/modules/performance/req/IndicatorReq.java
index a53b6e3b..7cf8abf5 100644
--- a/src/main/java/com/lz/modules/performance/req/IndicatorReq.java
+++ b/src/main/java/com/lz/modules/performance/req/IndicatorReq.java
@@ -1,6 +1,7 @@
package com.lz.modules.performance.req;
import com.lz.modules.equipment.entity.model.BasePage;
+import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@@ -10,6 +11,7 @@ import lombok.Data;
* @Date: 2021/1/12 11:39
*/
@Data
+@ApiModel("获取分类/类型实体")
public class IndicatorReq extends BasePage{
//指标名称
@ApiModelProperty(value = "指标分类名称", name = "name")
diff --git a/src/main/java/com/lz/modules/performance/service/IndicatorLibraryService.java b/src/main/java/com/lz/modules/performance/service/IndicatorLibraryService.java
index 0f49f82d..a4e61b5b 100644
--- a/src/main/java/com/lz/modules/performance/service/IndicatorLibraryService.java
+++ b/src/main/java/com/lz/modules/performance/service/IndicatorLibraryService.java
@@ -2,6 +2,7 @@ package com.lz.modules.performance.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.lz.common.utils.PageUtils;
+import com.lz.modules.performance.dto.IndicatorLibraryMoveDto;
import com.lz.modules.performance.entity.IndicatorLibrary;
import com.lz.modules.performance.req.IndicatorLibraryReq;
@@ -35,5 +36,7 @@ public interface IndicatorLibraryService extends IService {
void deleteIndicatorLibrarysByIds(String ids);
+ void updateIndicatorLibrarysMove(IndicatorLibraryMoveDto dto);
+
}
\ No newline at end of file
diff --git a/src/main/java/com/lz/modules/performance/service/IndicatorTypeService.java b/src/main/java/com/lz/modules/performance/service/IndicatorTypeService.java
index 84705fb3..f652ec99 100644
--- a/src/main/java/com/lz/modules/performance/service/IndicatorTypeService.java
+++ b/src/main/java/com/lz/modules/performance/service/IndicatorTypeService.java
@@ -33,5 +33,7 @@ public interface IndicatorTypeService extends IService {
PageUtils selectIndicatorTypesByReq(IndicatorReq req);
+ IndicatorType selectIndicatorTypeByName(String name);
+
}
\ No newline at end of file
diff --git a/src/main/java/com/lz/modules/performance/service/impl/IndicatorLibraryServiceImpl.java b/src/main/java/com/lz/modules/performance/service/impl/IndicatorLibraryServiceImpl.java
index 34f811bc..040009bf 100644
--- a/src/main/java/com/lz/modules/performance/service/impl/IndicatorLibraryServiceImpl.java
+++ b/src/main/java/com/lz/modules/performance/service/impl/IndicatorLibraryServiceImpl.java
@@ -1,9 +1,11 @@
package com.lz.modules.performance.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.google.common.collect.Lists;
import com.lz.common.utils.PageUtils;
import com.lz.common.utils.StringUtil;
import com.lz.modules.performance.dao.IndicatorLibraryMapper;
+import com.lz.modules.performance.dto.IndicatorLibraryMoveDto;
import com.lz.modules.performance.entity.IndicatorLibrary;
import com.lz.modules.performance.req.IndicatorLibraryReq;
import com.lz.modules.performance.service.IndicatorLibraryService;
@@ -12,6 +14,7 @@ import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
+import java.util.Arrays;
import java.util.List;
/**
@@ -83,4 +86,16 @@ public class IndicatorLibraryServiceImpl extends ServiceImpl
select id ,name,type,indicator_type, weight, key_result, sort from lz_indicator_library
- where name LIKE CONCAT('%',#{req.name},'%') and indicator_type = #{req.indicatorType} and is_delete = 0 order by sort
+ where is_delete = 0
+
+ and name LIKE CONCAT('%',#{req.name},'%')
+
+
+ and indicator_type = #{req.indicatorType}
+
+ order by sort
@@ -105,6 +112,15 @@
)
+
+ update lz_indicator_library set indicator_type = #{indicatorType} where is_delete = 0 AND
+ id in
+ (
+
+ #{id}
+
+ )
+
diff --git a/src/main/resources/mapper/performance/IndicatorTypeMapper.xml b/src/main/resources/mapper/performance/IndicatorTypeMapper.xml
index ec89a785..ec5fa83f 100644
--- a/src/main/resources/mapper/performance/IndicatorTypeMapper.xml
+++ b/src/main/resources/mapper/performance/IndicatorTypeMapper.xml
@@ -80,7 +80,18 @@
+
+
From 91b1555d95056dd2d79307b5298c06758df6e6f9 Mon Sep 17 00:00:00 2001
From: DirectionOfMind <3182967682@qq.com>
Date: Thu, 14 Jan 2021 10:48:49 +0800
Subject: [PATCH 05/26] fix
---
.../IndicatorLibraryController.java | 15 +++++++++++----
.../controller/IndicatorTypeController.java | 9 ++++-----
.../dao/IndicatorLibraryMapper.java | 2 ++
.../dto/StatisticalIndicatorTypeDto.java | 19 +++++++++++++++++++
.../service/IndicatorLibraryService.java | 5 +++++
.../impl/IndicatorLibraryServiceImpl.java | 10 ++++++++++
.../performance/IndicatorLibraryMapper.xml | 7 +++++++
7 files changed, 58 insertions(+), 9 deletions(-)
create mode 100644 src/main/java/com/lz/modules/performance/dto/StatisticalIndicatorTypeDto.java
diff --git a/src/main/java/com/lz/modules/performance/controller/IndicatorLibraryController.java b/src/main/java/com/lz/modules/performance/controller/IndicatorLibraryController.java
index 2cdb0dec..68ce5428 100644
--- a/src/main/java/com/lz/modules/performance/controller/IndicatorLibraryController.java
+++ b/src/main/java/com/lz/modules/performance/controller/IndicatorLibraryController.java
@@ -55,13 +55,13 @@ public class IndicatorLibraryController {
@PostMapping("/saveOrUpdate")
@ApiOperation("保存/修改指标")
public R save(@RequestBody IndicatorLibraryDto dto) {
+
IndicatorLibrary indicatorLibrary = new IndicatorLibrary();
BeanUtil.copyProperties(dto,indicatorLibrary);
boolean success = indicatorLibraryService.saveOrUpdate(indicatorLibrary);
- if(!success){
- return R.error();
- }
- return R.ok();
+
+ return success ? R.ok():R.error();
+
}
@@ -89,4 +89,11 @@ public class IndicatorLibraryController {
}
return R.ok();
}
+
+ @PostMapping("/statistical")
+ @ApiOperation("统计指标")
+ public R statistical() {
+ //indicatorLibraryService
+ return R.ok();
+ }
}
diff --git a/src/main/java/com/lz/modules/performance/controller/IndicatorTypeController.java b/src/main/java/com/lz/modules/performance/controller/IndicatorTypeController.java
index 5c67bab6..dfcd1d06 100644
--- a/src/main/java/com/lz/modules/performance/controller/IndicatorTypeController.java
+++ b/src/main/java/com/lz/modules/performance/controller/IndicatorTypeController.java
@@ -50,10 +50,9 @@ public class IndicatorTypeController {
}
IndicatorType indicatorType = new IndicatorType();
BeanUtil.copyProperties(dto,indicatorType);
- boolean success = indicatorTypeService.saveOrUpdate(indicatorType);
- if(!success){
- return R.error();
- }
- return R.ok();
+ boolean success = indicatorTypeService.saveOrUpdate(indicatorType);
+
+ return success ? R.ok():R.error();
+
}
}
diff --git a/src/main/java/com/lz/modules/performance/dao/IndicatorLibraryMapper.java b/src/main/java/com/lz/modules/performance/dao/IndicatorLibraryMapper.java
index a3729213..dc3b43e0 100644
--- a/src/main/java/com/lz/modules/performance/dao/IndicatorLibraryMapper.java
+++ b/src/main/java/com/lz/modules/performance/dao/IndicatorLibraryMapper.java
@@ -10,6 +10,7 @@ package com.lz.modules.performance.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.lz.modules.performance.dto.IndicatorLibraryDto;
+import com.lz.modules.performance.dto.StatisticalIndicatorTypeDto;
import com.lz.modules.performance.entity.IndicatorLibrary;
import com.lz.modules.performance.req.IndicatorLibraryReq;
import org.apache.ibatis.annotations.Mapper;
@@ -41,4 +42,5 @@ public interface IndicatorLibraryMapper extends BaseMapper {
void updateIndicatorLibrarysMove(@Param("ids")List ids,@Param("indicatorType")Long indicatorType);
+ List statisticalByIndicatorType();
}
\ No newline at end of file
diff --git a/src/main/java/com/lz/modules/performance/dto/StatisticalIndicatorTypeDto.java b/src/main/java/com/lz/modules/performance/dto/StatisticalIndicatorTypeDto.java
new file mode 100644
index 00000000..b78ff59e
--- /dev/null
+++ b/src/main/java/com/lz/modules/performance/dto/StatisticalIndicatorTypeDto.java
@@ -0,0 +1,19 @@
+package com.lz.modules.performance.dto;
+
+import com.lz.modules.performance.entity.IndicatorType;
+import lombok.Data;
+
+/**
+ * @Author: djc
+ * @Desc:
+ * @Date: 2021/1/13 17:20
+ */
+@Data
+public class StatisticalIndicatorTypeDto {
+
+ private String name;
+
+ private Integer indicatorType;
+
+ private int count;
+}
diff --git a/src/main/java/com/lz/modules/performance/service/IndicatorLibraryService.java b/src/main/java/com/lz/modules/performance/service/IndicatorLibraryService.java
index a4e61b5b..524552c9 100644
--- a/src/main/java/com/lz/modules/performance/service/IndicatorLibraryService.java
+++ b/src/main/java/com/lz/modules/performance/service/IndicatorLibraryService.java
@@ -3,9 +3,12 @@ package com.lz.modules.performance.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.lz.common.utils.PageUtils;
import com.lz.modules.performance.dto.IndicatorLibraryMoveDto;
+import com.lz.modules.performance.dto.StatisticalIndicatorTypeDto;
import com.lz.modules.performance.entity.IndicatorLibrary;
import com.lz.modules.performance.req.IndicatorLibraryReq;
+import java.util.List;
+
/**
*
* (设置)指标库 服务类
@@ -38,5 +41,7 @@ public interface IndicatorLibraryService extends IService {
void updateIndicatorLibrarysMove(IndicatorLibraryMoveDto dto);
+ List statisticalByIndicatorType();
+
}
\ No newline at end of file
diff --git a/src/main/java/com/lz/modules/performance/service/impl/IndicatorLibraryServiceImpl.java b/src/main/java/com/lz/modules/performance/service/impl/IndicatorLibraryServiceImpl.java
index 040009bf..a139aa05 100644
--- a/src/main/java/com/lz/modules/performance/service/impl/IndicatorLibraryServiceImpl.java
+++ b/src/main/java/com/lz/modules/performance/service/impl/IndicatorLibraryServiceImpl.java
@@ -6,6 +6,7 @@ import com.lz.common.utils.PageUtils;
import com.lz.common.utils.StringUtil;
import com.lz.modules.performance.dao.IndicatorLibraryMapper;
import com.lz.modules.performance.dto.IndicatorLibraryMoveDto;
+import com.lz.modules.performance.dto.StatisticalIndicatorTypeDto;
import com.lz.modules.performance.entity.IndicatorLibrary;
import com.lz.modules.performance.req.IndicatorLibraryReq;
import com.lz.modules.performance.service.IndicatorLibraryService;
@@ -98,4 +99,13 @@ public class IndicatorLibraryServiceImpl extends ServiceImpl statisticalByIndicatorType() {
+ List dtos = indicatorLibraryMapper.statisticalByIndicatorType();
+ for(StatisticalIndicatorTypeDto dto:dtos){
+
+ }
+ return null;
+ }
}
diff --git a/src/main/resources/mapper/performance/IndicatorLibraryMapper.xml b/src/main/resources/mapper/performance/IndicatorLibraryMapper.xml
index b2e424d4..dc72521b 100644
--- a/src/main/resources/mapper/performance/IndicatorLibraryMapper.xml
+++ b/src/main/resources/mapper/performance/IndicatorLibraryMapper.xml
@@ -123,5 +123,12 @@
+
+
+
From 37b6a34b7ab15466a6819b7b77634ccd6b67ce59 Mon Sep 17 00:00:00 2001
From: DirectionOfMind <3182967682@qq.com>
Date: Thu, 14 Jan 2021 16:02:29 +0800
Subject: [PATCH 06/26] fix
---
.../IndicatorLibraryController.java | 24 ++++++++++++++++---
.../impl/IndicatorLibraryServiceImpl.java | 14 ++++++++---
.../performance/IndicatorLibraryMapper.xml | 5 ++--
3 files changed, 35 insertions(+), 8 deletions(-)
diff --git a/src/main/java/com/lz/modules/performance/controller/IndicatorLibraryController.java b/src/main/java/com/lz/modules/performance/controller/IndicatorLibraryController.java
index 68ce5428..fa5d6aba 100644
--- a/src/main/java/com/lz/modules/performance/controller/IndicatorLibraryController.java
+++ b/src/main/java/com/lz/modules/performance/controller/IndicatorLibraryController.java
@@ -8,6 +8,7 @@ import com.lz.common.utils.R;
import com.lz.common.utils.StringUtil;
import com.lz.modules.performance.dto.IndicatorLibraryDto;
import com.lz.modules.performance.dto.IndicatorLibraryMoveDto;
+import com.lz.modules.performance.dto.StatisticalIndicatorTypeDto;
import com.lz.modules.performance.entity.IndicatorLibrary;
import com.lz.modules.performance.req.IndicatorLibraryReq;
import com.lz.modules.performance.service.IndicatorLibraryService;
@@ -15,12 +16,29 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
+import org.aopalliance.aop.Advice;
import org.apache.ibatis.annotations.Param;
+import org.springframework.aop.Advisor;
+import org.springframework.aop.AfterReturningAdvice;
+import org.springframework.aop.framework.adapter.AdvisorAdapter;
+import org.springframework.aop.framework.adapter.AfterReturningAdviceInterceptor;
+import org.springframework.aop.framework.adapter.UnknownAdviceTypeException;
+import org.springframework.aop.support.DefaultPointcutAdvisor;
+import org.springframework.beans.BeansException;
+import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.ApplicationContextAware;
+import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.*;
+import javax.annotation.PostConstruct;
+import java.io.Serializable;
+import java.util.ArrayList;
import java.util.HashMap;
+import java.util.List;
import java.util.Map;
+import java.util.stream.Collectors;
@Slf4j
@RestController
@@ -55,7 +73,6 @@ public class IndicatorLibraryController {
@PostMapping("/saveOrUpdate")
@ApiOperation("保存/修改指标")
public R save(@RequestBody IndicatorLibraryDto dto) {
-
IndicatorLibrary indicatorLibrary = new IndicatorLibrary();
BeanUtil.copyProperties(dto,indicatorLibrary);
boolean success = indicatorLibraryService.saveOrUpdate(indicatorLibrary);
@@ -93,7 +110,8 @@ public class IndicatorLibraryController {
@PostMapping("/statistical")
@ApiOperation("统计指标")
public R statistical() {
- //indicatorLibraryService
- return R.ok();
+ List dtos = indicatorLibraryService.statisticalByIndicatorType();
+ return R.ok().put("data",dtos);
}
}
+
diff --git a/src/main/java/com/lz/modules/performance/service/impl/IndicatorLibraryServiceImpl.java b/src/main/java/com/lz/modules/performance/service/impl/IndicatorLibraryServiceImpl.java
index a139aa05..4a510c1b 100644
--- a/src/main/java/com/lz/modules/performance/service/impl/IndicatorLibraryServiceImpl.java
+++ b/src/main/java/com/lz/modules/performance/service/impl/IndicatorLibraryServiceImpl.java
@@ -17,6 +17,8 @@ import org.springframework.stereotype.Service;
import java.util.Arrays;
import java.util.List;
+import java.util.Optional;
+import java.util.function.ToDoubleFunction;
/**
*
@@ -103,9 +105,15 @@ public class IndicatorLibraryServiceImpl extends ServiceImpl statisticalByIndicatorType() {
List dtos = indicatorLibraryMapper.statisticalByIndicatorType();
- for(StatisticalIndicatorTypeDto dto:dtos){
-
+ StatisticalIndicatorTypeDto dto = new StatisticalIndicatorTypeDto();
+ dto.setName("全部分类");
+ dto.setIndicatorType(null);
+ if(CollectionUtils.isNotEmpty(dtos)){
+ double sum = dtos.stream().mapToDouble(value -> value.getCount()).sum();
+ dto.setCount(Double.valueOf(sum).intValue());
}
- return null;
+ //加入首位
+ dtos.add(0,dto);
+ return dtos;
}
}
diff --git a/src/main/resources/mapper/performance/IndicatorLibraryMapper.xml b/src/main/resources/mapper/performance/IndicatorLibraryMapper.xml
index dc72521b..0eae2f7a 100644
--- a/src/main/resources/mapper/performance/IndicatorLibraryMapper.xml
+++ b/src/main/resources/mapper/performance/IndicatorLibraryMapper.xml
@@ -125,8 +125,9 @@
From 3b261f2d6d46a67ea71115c63436fcceadbd516b Mon Sep 17 00:00:00 2001
From: DirectionOfMind <3182967682@qq.com>
Date: Thu, 14 Jan 2021 16:43:18 +0800
Subject: [PATCH 07/26] fix
---
.../performance/controller/IndicatorLibraryController.java | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/main/java/com/lz/modules/performance/controller/IndicatorLibraryController.java b/src/main/java/com/lz/modules/performance/controller/IndicatorLibraryController.java
index fa5d6aba..3ff4e233 100644
--- a/src/main/java/com/lz/modules/performance/controller/IndicatorLibraryController.java
+++ b/src/main/java/com/lz/modules/performance/controller/IndicatorLibraryController.java
@@ -3,6 +3,7 @@ package com.lz.modules.performance.controller;
import cn.hutool.core.bean.BeanUtil;
import com.alibaba.fastjson.JSONObject;
+import com.google.common.collect.Maps;
import com.lz.common.utils.PageUtils;
import com.lz.common.utils.R;
import com.lz.common.utils.StringUtil;
@@ -38,6 +39,7 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import java.util.function.Function;
import java.util.stream.Collectors;
@Slf4j
@@ -113,5 +115,4 @@ public class IndicatorLibraryController {
List dtos = indicatorLibraryService.statisticalByIndicatorType();
return R.ok().put("data",dtos);
}
-}
-
+}
\ No newline at end of file
From 9b91874ff2e7128e65c6f4ba851638dd3548b7f4 Mon Sep 17 00:00:00 2001
From: DirectionOfMind <3182967682@qq.com>
Date: Tue, 19 Jan 2021 15:12:59 +0800
Subject: [PATCH 08/26] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=8C=87=E6=A0=87?=
=?UTF-8?q?=E5=88=86=E7=B1=BB=E5=88=A0=E9=99=A4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../controller/IndicatorTypeController.java | 27 ++++++++++++++++---
.../dao/IndicatorLibraryMapper.java | 2 ++
.../service/IndicatorLibraryService.java | 2 ++
.../impl/IndicatorLibraryServiceImpl.java | 5 ++++
.../performance/IndicatorLibraryMapper.xml | 5 ++++
5 files changed, 37 insertions(+), 4 deletions(-)
diff --git a/src/main/java/com/lz/modules/performance/controller/IndicatorTypeController.java b/src/main/java/com/lz/modules/performance/controller/IndicatorTypeController.java
index dfcd1d06..6a3c863c 100644
--- a/src/main/java/com/lz/modules/performance/controller/IndicatorTypeController.java
+++ b/src/main/java/com/lz/modules/performance/controller/IndicatorTypeController.java
@@ -8,15 +8,16 @@ import com.lz.common.utils.StringUtil;
import com.lz.modules.performance.dto.IndicatorTypeDto;
import com.lz.modules.performance.entity.IndicatorType;
import com.lz.modules.performance.req.IndicatorReq;
+import com.lz.modules.performance.service.IndicatorLibraryService;
import com.lz.modules.performance.service.IndicatorTypeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
+@Slf4j
@RestController
@RequestMapping("/indicatorType")
@Api(value = "指标分类相关接口", tags = { "指标分类相关接口" })
@@ -25,6 +26,8 @@ public class IndicatorTypeController {
@Autowired
private IndicatorTypeService indicatorTypeService;
+ @Autowired
+ private IndicatorLibraryService indicatorLibraryService;
@PostMapping("/list")
@@ -55,4 +58,20 @@ public class IndicatorTypeController {
return success ? R.ok():R.error();
}
+
+
+ @GetMapping("/delete")
+ @ApiOperation("删除指标分类")
+ public R delete(@RequestParam @ApiParam(value = "删除指标分类id",name = "id") Long id) {
+ try {
+ indicatorTypeService.deleteIndicatorTypeById(id);
+ indicatorLibraryService.deleteIndicatorLibrarysIndicatorType(id.intValue());
+
+ } catch (Exception e) {
+ log.error("删除指标异常",e);
+ return R.error();
+ }
+ return R.ok();
+ }
+
}
diff --git a/src/main/java/com/lz/modules/performance/dao/IndicatorLibraryMapper.java b/src/main/java/com/lz/modules/performance/dao/IndicatorLibraryMapper.java
index dc3b43e0..13e30455 100644
--- a/src/main/java/com/lz/modules/performance/dao/IndicatorLibraryMapper.java
+++ b/src/main/java/com/lz/modules/performance/dao/IndicatorLibraryMapper.java
@@ -43,4 +43,6 @@ public interface IndicatorLibraryMapper extends BaseMapper {
void updateIndicatorLibrarysMove(@Param("ids")List ids,@Param("indicatorType")Long indicatorType);
List statisticalByIndicatorType();
+
+ int deleteIndicatorLibrarysByIndicatorType(@Param("indicatorType") Integer indicatorType);
}
\ No newline at end of file
diff --git a/src/main/java/com/lz/modules/performance/service/IndicatorLibraryService.java b/src/main/java/com/lz/modules/performance/service/IndicatorLibraryService.java
index 524552c9..97acce4b 100644
--- a/src/main/java/com/lz/modules/performance/service/IndicatorLibraryService.java
+++ b/src/main/java/com/lz/modules/performance/service/IndicatorLibraryService.java
@@ -43,5 +43,7 @@ public interface IndicatorLibraryService extends IService {
List statisticalByIndicatorType();
+ int deleteIndicatorLibrarysIndicatorType(Integer indicatorType);
+
}
\ No newline at end of file
diff --git a/src/main/java/com/lz/modules/performance/service/impl/IndicatorLibraryServiceImpl.java b/src/main/java/com/lz/modules/performance/service/impl/IndicatorLibraryServiceImpl.java
index 4a510c1b..59f53118 100644
--- a/src/main/java/com/lz/modules/performance/service/impl/IndicatorLibraryServiceImpl.java
+++ b/src/main/java/com/lz/modules/performance/service/impl/IndicatorLibraryServiceImpl.java
@@ -116,4 +116,9 @@ public class IndicatorLibraryServiceImpl extends ServiceImpl
+
+ update lz_indicator_library set is_delete = 1 where indicator_type=#{indicatorType}
+
+
+
From b81cc494012e23b75a158467d26bef678d509c41 Mon Sep 17 00:00:00 2001
From: DirectionOfMind <3182967682@qq.com>
Date: Tue, 19 Jan 2021 16:18:37 +0800
Subject: [PATCH 09/26] fix
---
.../controller/IndicatorLibraryController.java | 6 +++---
.../modules/performance/dao/IndicatorLibraryMapper.java | 2 +-
.../performance/service/IndicatorLibraryService.java | 2 +-
.../service/impl/IndicatorLibraryServiceImpl.java | 4 ++--
.../mapper/performance/IndicatorLibraryMapper.xml | 9 ++++++---
5 files changed, 13 insertions(+), 10 deletions(-)
diff --git a/src/main/java/com/lz/modules/performance/controller/IndicatorLibraryController.java b/src/main/java/com/lz/modules/performance/controller/IndicatorLibraryController.java
index 3ff4e233..fbfcbd81 100644
--- a/src/main/java/com/lz/modules/performance/controller/IndicatorLibraryController.java
+++ b/src/main/java/com/lz/modules/performance/controller/IndicatorLibraryController.java
@@ -109,10 +109,10 @@ public class IndicatorLibraryController {
return R.ok();
}
- @PostMapping("/statistical")
+ @GetMapping("/statistical")
@ApiOperation("统计指标")
- public R statistical() {
- List dtos = indicatorLibraryService.statisticalByIndicatorType();
+ public R statistical(@RequestParam("indicatorType") @ApiParam(value = "指标分类id",name = "indicatorType") Long indicatorType) {
+ List dtos = indicatorLibraryService.statisticalByIndicatorType(indicatorType);
return R.ok().put("data",dtos);
}
}
\ No newline at end of file
diff --git a/src/main/java/com/lz/modules/performance/dao/IndicatorLibraryMapper.java b/src/main/java/com/lz/modules/performance/dao/IndicatorLibraryMapper.java
index 13e30455..c446191c 100644
--- a/src/main/java/com/lz/modules/performance/dao/IndicatorLibraryMapper.java
+++ b/src/main/java/com/lz/modules/performance/dao/IndicatorLibraryMapper.java
@@ -42,7 +42,7 @@ public interface IndicatorLibraryMapper extends BaseMapper {
void updateIndicatorLibrarysMove(@Param("ids")List ids,@Param("indicatorType")Long indicatorType);
- List statisticalByIndicatorType();
+ List statisticalByIndicatorType(Long indicatorType);
int deleteIndicatorLibrarysByIndicatorType(@Param("indicatorType") Integer indicatorType);
}
\ No newline at end of file
diff --git a/src/main/java/com/lz/modules/performance/service/IndicatorLibraryService.java b/src/main/java/com/lz/modules/performance/service/IndicatorLibraryService.java
index 97acce4b..2898bc29 100644
--- a/src/main/java/com/lz/modules/performance/service/IndicatorLibraryService.java
+++ b/src/main/java/com/lz/modules/performance/service/IndicatorLibraryService.java
@@ -41,7 +41,7 @@ public interface IndicatorLibraryService extends IService {
void updateIndicatorLibrarysMove(IndicatorLibraryMoveDto dto);
- List statisticalByIndicatorType();
+ List statisticalByIndicatorType(Long indicatorType);
int deleteIndicatorLibrarysIndicatorType(Integer indicatorType);
diff --git a/src/main/java/com/lz/modules/performance/service/impl/IndicatorLibraryServiceImpl.java b/src/main/java/com/lz/modules/performance/service/impl/IndicatorLibraryServiceImpl.java
index 59f53118..83ab7e14 100644
--- a/src/main/java/com/lz/modules/performance/service/impl/IndicatorLibraryServiceImpl.java
+++ b/src/main/java/com/lz/modules/performance/service/impl/IndicatorLibraryServiceImpl.java
@@ -103,8 +103,8 @@ public class IndicatorLibraryServiceImpl extends ServiceImpl statisticalByIndicatorType() {
- List dtos = indicatorLibraryMapper.statisticalByIndicatorType();
+ public List statisticalByIndicatorType(Long indicatorType) {
+ List dtos = indicatorLibraryMapper.statisticalByIndicatorType(indicatorType);
StatisticalIndicatorTypeDto dto = new StatisticalIndicatorTypeDto();
dto.setName("全部分类");
dto.setIndicatorType(null);
diff --git a/src/main/resources/mapper/performance/IndicatorLibraryMapper.xml b/src/main/resources/mapper/performance/IndicatorLibraryMapper.xml
index 0d68742b..f539794c 100644
--- a/src/main/resources/mapper/performance/IndicatorLibraryMapper.xml
+++ b/src/main/resources/mapper/performance/IndicatorLibraryMapper.xml
@@ -125,9 +125,12 @@
From ad2bdac0b5ce9c29a953ea970d5ed156bb390e76 Mon Sep 17 00:00:00 2001
From: DirectionOfMind <3182967682@qq.com>
Date: Tue, 19 Jan 2021 17:42:58 +0800
Subject: [PATCH 10/26] fix
---
.../controller/IndicatorLibraryController.java | 2 +-
.../modules/performance/dao/IndicatorLibraryMapper.java | 4 ++++
.../service/impl/IndicatorLibraryServiceImpl.java | 8 ++++++++
.../mapper/performance/IndicatorLibraryMapper.xml | 5 +++++
4 files changed, 18 insertions(+), 1 deletion(-)
diff --git a/src/main/java/com/lz/modules/performance/controller/IndicatorLibraryController.java b/src/main/java/com/lz/modules/performance/controller/IndicatorLibraryController.java
index fbfcbd81..25ce047e 100644
--- a/src/main/java/com/lz/modules/performance/controller/IndicatorLibraryController.java
+++ b/src/main/java/com/lz/modules/performance/controller/IndicatorLibraryController.java
@@ -111,7 +111,7 @@ public class IndicatorLibraryController {
@GetMapping("/statistical")
@ApiOperation("统计指标")
- public R statistical(@RequestParam("indicatorType") @ApiParam(value = "指标分类id",name = "indicatorType") Long indicatorType) {
+ public R statistical(@RequestParam(name = "indicatorType",required = false) @ApiParam(value = "指标分类id",name = "indicatorType") Long indicatorType) {
List dtos = indicatorLibraryService.statisticalByIndicatorType(indicatorType);
return R.ok().put("data",dtos);
}
diff --git a/src/main/java/com/lz/modules/performance/dao/IndicatorLibraryMapper.java b/src/main/java/com/lz/modules/performance/dao/IndicatorLibraryMapper.java
index c446191c..7dde2eab 100644
--- a/src/main/java/com/lz/modules/performance/dao/IndicatorLibraryMapper.java
+++ b/src/main/java/com/lz/modules/performance/dao/IndicatorLibraryMapper.java
@@ -45,4 +45,8 @@ public interface IndicatorLibraryMapper extends BaseMapper {
List statisticalByIndicatorType(Long indicatorType);
int deleteIndicatorLibrarysByIndicatorType(@Param("indicatorType") Integer indicatorType);
+
+ int countIndicatorLibrarysByIndicatorType(@Param("indicatorType") Integer indicatorType);
+
+
}
\ No newline at end of file
diff --git a/src/main/java/com/lz/modules/performance/service/impl/IndicatorLibraryServiceImpl.java b/src/main/java/com/lz/modules/performance/service/impl/IndicatorLibraryServiceImpl.java
index 83ab7e14..0326f2ac 100644
--- a/src/main/java/com/lz/modules/performance/service/impl/IndicatorLibraryServiceImpl.java
+++ b/src/main/java/com/lz/modules/performance/service/impl/IndicatorLibraryServiceImpl.java
@@ -114,6 +114,14 @@ public class IndicatorLibraryServiceImpl extends ServiceImpl0){
+ dtos.add(0,dto);
+ }
return dtos;
}
diff --git a/src/main/resources/mapper/performance/IndicatorLibraryMapper.xml b/src/main/resources/mapper/performance/IndicatorLibraryMapper.xml
index f539794c..ec609282 100644
--- a/src/main/resources/mapper/performance/IndicatorLibraryMapper.xml
+++ b/src/main/resources/mapper/performance/IndicatorLibraryMapper.xml
@@ -139,5 +139,10 @@
+
+
+
From 0e43d5b9dc9531b252d310d8bdb0fc621991a5c5 Mon Sep 17 00:00:00 2001
From: DirectionOfMind <3182967682@qq.com>
Date: Wed, 20 Jan 2021 11:07:32 +0800
Subject: [PATCH 11/26] fix
---
.../impl/IndicatorLibraryServiceImpl.java | 18 ++++++++++--------
1 file changed, 10 insertions(+), 8 deletions(-)
diff --git a/src/main/java/com/lz/modules/performance/service/impl/IndicatorLibraryServiceImpl.java b/src/main/java/com/lz/modules/performance/service/impl/IndicatorLibraryServiceImpl.java
index 0326f2ac..23851cae 100644
--- a/src/main/java/com/lz/modules/performance/service/impl/IndicatorLibraryServiceImpl.java
+++ b/src/main/java/com/lz/modules/performance/service/impl/IndicatorLibraryServiceImpl.java
@@ -106,6 +106,15 @@ public class IndicatorLibraryServiceImpl extends ServiceImpl statisticalByIndicatorType(Long indicatorType) {
List dtos = indicatorLibraryMapper.statisticalByIndicatorType(indicatorType);
StatisticalIndicatorTypeDto dto = new StatisticalIndicatorTypeDto();
+ dto.setName("未分类指标");
+ dto.setIndicatorType(0);
+ int count = indicatorLibraryMapper.countIndicatorLibrarysByIndicatorType(0);
+ dto.setCount(count);
+ if(count>0){
+ dtos.add(dto);
+ }
+
+ dto = new StatisticalIndicatorTypeDto();
dto.setName("全部分类");
dto.setIndicatorType(null);
if(CollectionUtils.isNotEmpty(dtos)){
@@ -114,14 +123,7 @@ public class IndicatorLibraryServiceImpl extends ServiceImpl0){
- dtos.add(0,dto);
- }
+
return dtos;
}
From 1ed80a054e6754bb2a3f77e859ad6d39aaf3f09a Mon Sep 17 00:00:00 2001
From: DirectionOfMind <3182967682@qq.com>
Date: Wed, 20 Jan 2021 11:26:39 +0800
Subject: [PATCH 12/26] fix
---
.../controller/IndicatorLibraryController.java | 6 +++---
.../performance/dto/StatisticalIndicatorTypeDto.java | 9 +++++++++
.../service/impl/IndicatorLibraryServiceImpl.java | 2 ++
3 files changed, 14 insertions(+), 3 deletions(-)
diff --git a/src/main/java/com/lz/modules/performance/controller/IndicatorLibraryController.java b/src/main/java/com/lz/modules/performance/controller/IndicatorLibraryController.java
index 25ce047e..889709d7 100644
--- a/src/main/java/com/lz/modules/performance/controller/IndicatorLibraryController.java
+++ b/src/main/java/com/lz/modules/performance/controller/IndicatorLibraryController.java
@@ -7,15 +7,14 @@ import com.google.common.collect.Maps;
import com.lz.common.utils.PageUtils;
import com.lz.common.utils.R;
import com.lz.common.utils.StringUtil;
+import com.lz.modules.flow.entity.FlowStart;
import com.lz.modules.performance.dto.IndicatorLibraryDto;
import com.lz.modules.performance.dto.IndicatorLibraryMoveDto;
import com.lz.modules.performance.dto.StatisticalIndicatorTypeDto;
import com.lz.modules.performance.entity.IndicatorLibrary;
import com.lz.modules.performance.req.IndicatorLibraryReq;
import com.lz.modules.performance.service.IndicatorLibraryService;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiParam;
+import io.swagger.annotations.*;
import lombok.extern.slf4j.Slf4j;
import org.aopalliance.aop.Advice;
import org.apache.ibatis.annotations.Param;
@@ -111,6 +110,7 @@ public class IndicatorLibraryController {
@GetMapping("/statistical")
@ApiOperation("统计指标")
+ @ApiResponses({@ApiResponse(code = 200, message = "成功", response = StatisticalIndicatorTypeDto.class)})
public R statistical(@RequestParam(name = "indicatorType",required = false) @ApiParam(value = "指标分类id",name = "indicatorType") Long indicatorType) {
List dtos = indicatorLibraryService.statisticalByIndicatorType(indicatorType);
return R.ok().put("data",dtos);
diff --git a/src/main/java/com/lz/modules/performance/dto/StatisticalIndicatorTypeDto.java b/src/main/java/com/lz/modules/performance/dto/StatisticalIndicatorTypeDto.java
index b78ff59e..a70c1603 100644
--- a/src/main/java/com/lz/modules/performance/dto/StatisticalIndicatorTypeDto.java
+++ b/src/main/java/com/lz/modules/performance/dto/StatisticalIndicatorTypeDto.java
@@ -1,6 +1,8 @@
package com.lz.modules.performance.dto;
import com.lz.modules.performance.entity.IndicatorType;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
@@ -9,11 +11,18 @@ import lombok.Data;
* @Date: 2021/1/13 17:20
*/
@Data
+@ApiModel("统计响应实体")
public class StatisticalIndicatorTypeDto {
+ @ApiModelProperty(value = "名称",name = "name")
private String name;
+ @ApiModelProperty(value = "类型",name = "indicatorType")
private Integer indicatorType;
+ @ApiModelProperty(value = "个数",name = "count")
private int count;
+
+ @ApiModelProperty(value = "是否可以删除 0:可以 1:不可以",name = "delete")
+ private int delete;
}
diff --git a/src/main/java/com/lz/modules/performance/service/impl/IndicatorLibraryServiceImpl.java b/src/main/java/com/lz/modules/performance/service/impl/IndicatorLibraryServiceImpl.java
index 23851cae..c6baa6fd 100644
--- a/src/main/java/com/lz/modules/performance/service/impl/IndicatorLibraryServiceImpl.java
+++ b/src/main/java/com/lz/modules/performance/service/impl/IndicatorLibraryServiceImpl.java
@@ -108,6 +108,7 @@ public class IndicatorLibraryServiceImpl extends ServiceImpl0){
@@ -117,6 +118,7 @@ public class IndicatorLibraryServiceImpl extends ServiceImpl value.getCount()).sum();
dto.setCount(Double.valueOf(sum).intValue());
From c74d643f2fcbda3fd0d4b56fc25108c0a9e2bf25 Mon Sep 17 00:00:00 2001
From: DirectionOfMind <3182967682@qq.com>
Date: Wed, 20 Jan 2021 16:38:16 +0800
Subject: [PATCH 13/26] fix
---
.../mapper/performance/IndicatorLibraryMapper.xml | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/src/main/resources/mapper/performance/IndicatorLibraryMapper.xml b/src/main/resources/mapper/performance/IndicatorLibraryMapper.xml
index ec609282..99b4d26d 100644
--- a/src/main/resources/mapper/performance/IndicatorLibraryMapper.xml
+++ b/src/main/resources/mapper/performance/IndicatorLibraryMapper.xml
@@ -125,12 +125,14 @@
From f2f2669ece254b99f3fdea29a51a33e4267d9d33 Mon Sep 17 00:00:00 2001
From: DirectionOfMind <3182967682@qq.com>
Date: Wed, 20 Jan 2021 17:29:13 +0800
Subject: [PATCH 14/26] fix
---
.../IndicatorLibraryController.java | 32 +++----------------
.../controller/IndicatorTypeController.java | 8 ++---
.../dao/IndicatorLibraryMapper.java | 4 +--
.../performance/req/IndicatorLibraryReq.java | 4 +++
.../performance/res/IndicatorTypeRes.java | 27 ++++++++++++++++
.../StatisticalIndicatorTypeRes.java} | 6 ++--
.../service/IndicatorLibraryService.java | 4 +--
.../impl/IndicatorLibraryServiceImpl.java | 14 +++-----
.../performance/IndicatorLibraryMapper.xml | 18 +++++++----
9 files changed, 63 insertions(+), 54 deletions(-)
create mode 100644 src/main/java/com/lz/modules/performance/res/IndicatorTypeRes.java
rename src/main/java/com/lz/modules/performance/{dto/StatisticalIndicatorTypeDto.java => res/StatisticalIndicatorTypeRes.java} (79%)
diff --git a/src/main/java/com/lz/modules/performance/controller/IndicatorLibraryController.java b/src/main/java/com/lz/modules/performance/controller/IndicatorLibraryController.java
index 889709d7..a836f73a 100644
--- a/src/main/java/com/lz/modules/performance/controller/IndicatorLibraryController.java
+++ b/src/main/java/com/lz/modules/performance/controller/IndicatorLibraryController.java
@@ -2,44 +2,20 @@ package com.lz.modules.performance.controller;
import cn.hutool.core.bean.BeanUtil;
-import com.alibaba.fastjson.JSONObject;
-import com.google.common.collect.Maps;
import com.lz.common.utils.PageUtils;
import com.lz.common.utils.R;
-import com.lz.common.utils.StringUtil;
-import com.lz.modules.flow.entity.FlowStart;
import com.lz.modules.performance.dto.IndicatorLibraryDto;
import com.lz.modules.performance.dto.IndicatorLibraryMoveDto;
-import com.lz.modules.performance.dto.StatisticalIndicatorTypeDto;
+import com.lz.modules.performance.res.StatisticalIndicatorTypeRes;
import com.lz.modules.performance.entity.IndicatorLibrary;
import com.lz.modules.performance.req.IndicatorLibraryReq;
import com.lz.modules.performance.service.IndicatorLibraryService;
import io.swagger.annotations.*;
import lombok.extern.slf4j.Slf4j;
-import org.aopalliance.aop.Advice;
-import org.apache.ibatis.annotations.Param;
-import org.springframework.aop.Advisor;
-import org.springframework.aop.AfterReturningAdvice;
-import org.springframework.aop.framework.adapter.AdvisorAdapter;
-import org.springframework.aop.framework.adapter.AfterReturningAdviceInterceptor;
-import org.springframework.aop.framework.adapter.UnknownAdviceTypeException;
-import org.springframework.aop.support.DefaultPointcutAdvisor;
-import org.springframework.beans.BeansException;
-import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.ApplicationContext;
-import org.springframework.context.ApplicationContextAware;
-import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.*;
-import javax.annotation.PostConstruct;
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.HashMap;
import java.util.List;
-import java.util.Map;
-import java.util.function.Function;
-import java.util.stream.Collectors;
@Slf4j
@RestController
@@ -110,9 +86,9 @@ public class IndicatorLibraryController {
@GetMapping("/statistical")
@ApiOperation("统计指标")
- @ApiResponses({@ApiResponse(code = 200, message = "成功", response = StatisticalIndicatorTypeDto.class)})
- public R statistical(@RequestParam(name = "indicatorType",required = false) @ApiParam(value = "指标分类id",name = "indicatorType") Long indicatorType) {
- List dtos = indicatorLibraryService.statisticalByIndicatorType(indicatorType);
+ @ApiResponses({@ApiResponse(code = 200, message = "成功", response = StatisticalIndicatorTypeRes.class)})
+ public R statistical(@RequestParam(name = "type",required = false) @ApiParam(value = "指标分类id",name = "type") Long type) {
+ List dtos = indicatorLibraryService.statisticalByType(type);
return R.ok().put("data",dtos);
}
}
\ No newline at end of file
diff --git a/src/main/java/com/lz/modules/performance/controller/IndicatorTypeController.java b/src/main/java/com/lz/modules/performance/controller/IndicatorTypeController.java
index 6a3c863c..5aff7bf6 100644
--- a/src/main/java/com/lz/modules/performance/controller/IndicatorTypeController.java
+++ b/src/main/java/com/lz/modules/performance/controller/IndicatorTypeController.java
@@ -8,11 +8,10 @@ import com.lz.common.utils.StringUtil;
import com.lz.modules.performance.dto.IndicatorTypeDto;
import com.lz.modules.performance.entity.IndicatorType;
import com.lz.modules.performance.req.IndicatorReq;
+import com.lz.modules.performance.res.IndicatorTypeRes;
import com.lz.modules.performance.service.IndicatorLibraryService;
import com.lz.modules.performance.service.IndicatorTypeService;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiParam;
+import io.swagger.annotations.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@@ -32,7 +31,8 @@ public class IndicatorTypeController {
@PostMapping("/list")
@ApiOperation("获取分类/类型列表")
- public R list(@RequestBody IndicatorReq req) {
+ @ApiResponses({@ApiResponse(code = 200, message = "成功", response = IndicatorTypeRes.class)})
+ public R list(@RequestBody IndicatorReq req) {
PageUtils page = indicatorTypeService.selectIndicatorTypesByReq(req);
return R.ok().put("data", page);
}
diff --git a/src/main/java/com/lz/modules/performance/dao/IndicatorLibraryMapper.java b/src/main/java/com/lz/modules/performance/dao/IndicatorLibraryMapper.java
index 7dde2eab..48f62c85 100644
--- a/src/main/java/com/lz/modules/performance/dao/IndicatorLibraryMapper.java
+++ b/src/main/java/com/lz/modules/performance/dao/IndicatorLibraryMapper.java
@@ -10,7 +10,7 @@ package com.lz.modules.performance.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.lz.modules.performance.dto.IndicatorLibraryDto;
-import com.lz.modules.performance.dto.StatisticalIndicatorTypeDto;
+import com.lz.modules.performance.res.StatisticalIndicatorTypeRes;
import com.lz.modules.performance.entity.IndicatorLibrary;
import com.lz.modules.performance.req.IndicatorLibraryReq;
import org.apache.ibatis.annotations.Mapper;
@@ -42,7 +42,7 @@ public interface IndicatorLibraryMapper extends BaseMapper {
void updateIndicatorLibrarysMove(@Param("ids")List ids,@Param("indicatorType")Long indicatorType);
- List statisticalByIndicatorType(Long indicatorType);
+ List statisticalByType(Long type);
int deleteIndicatorLibrarysByIndicatorType(@Param("indicatorType") Integer indicatorType);
diff --git a/src/main/java/com/lz/modules/performance/req/IndicatorLibraryReq.java b/src/main/java/com/lz/modules/performance/req/IndicatorLibraryReq.java
index 85d27fe3..02453f03 100644
--- a/src/main/java/com/lz/modules/performance/req/IndicatorLibraryReq.java
+++ b/src/main/java/com/lz/modules/performance/req/IndicatorLibraryReq.java
@@ -21,4 +21,8 @@ public class IndicatorLibraryReq extends BasePage{
@ApiModelProperty(value = "指标分类 lz_indicator_type 表id", name = "indicatorType")
private Integer indicatorType;
+ //指标分类 lz_indicator_type 表id
+ @ApiModelProperty(value = "指标类型 lz_indicator_type 表id", name = "type")
+ private Integer type;
+
}
diff --git a/src/main/java/com/lz/modules/performance/res/IndicatorTypeRes.java b/src/main/java/com/lz/modules/performance/res/IndicatorTypeRes.java
new file mode 100644
index 00000000..068e7454
--- /dev/null
+++ b/src/main/java/com/lz/modules/performance/res/IndicatorTypeRes.java
@@ -0,0 +1,27 @@
+package com.lz.modules.performance.res;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+ * @Author: djc
+ * @Desc:
+ * @Date: 2021/1/12 10:21
+ */
+@Data
+@ApiModel("分类响应实体")
+public class IndicatorTypeRes {
+
+ @ApiModelProperty(value = "id 分类或类型标识", name = "id")
+ private Long id;
+ //指标名称
+ @ApiModelProperty(value = "指标分类名称", name = "name")
+ private String name;
+ //指标名称
+ @ApiModelProperty(value = "类型0: 指标分类 1:指标类型", name = "type")
+ private Integer type;
+ //排序
+ @ApiModelProperty(value = "排序(非必须)", name = "orderBy")
+ private Integer orderBy;
+}
diff --git a/src/main/java/com/lz/modules/performance/dto/StatisticalIndicatorTypeDto.java b/src/main/java/com/lz/modules/performance/res/StatisticalIndicatorTypeRes.java
similarity index 79%
rename from src/main/java/com/lz/modules/performance/dto/StatisticalIndicatorTypeDto.java
rename to src/main/java/com/lz/modules/performance/res/StatisticalIndicatorTypeRes.java
index a70c1603..f2d2c6d7 100644
--- a/src/main/java/com/lz/modules/performance/dto/StatisticalIndicatorTypeDto.java
+++ b/src/main/java/com/lz/modules/performance/res/StatisticalIndicatorTypeRes.java
@@ -1,4 +1,4 @@
-package com.lz.modules.performance.dto;
+package com.lz.modules.performance.res;
import com.lz.modules.performance.entity.IndicatorType;
import io.swagger.annotations.ApiModel;
@@ -12,12 +12,12 @@ import lombok.Data;
*/
@Data
@ApiModel("统计响应实体")
-public class StatisticalIndicatorTypeDto {
+public class StatisticalIndicatorTypeRes {
@ApiModelProperty(value = "名称",name = "name")
private String name;
- @ApiModelProperty(value = "类型",name = "indicatorType")
+ @ApiModelProperty(value = "分类",name = "indicatorType")
private Integer indicatorType;
@ApiModelProperty(value = "个数",name = "count")
diff --git a/src/main/java/com/lz/modules/performance/service/IndicatorLibraryService.java b/src/main/java/com/lz/modules/performance/service/IndicatorLibraryService.java
index 2898bc29..2a8f09ee 100644
--- a/src/main/java/com/lz/modules/performance/service/IndicatorLibraryService.java
+++ b/src/main/java/com/lz/modules/performance/service/IndicatorLibraryService.java
@@ -3,7 +3,7 @@ package com.lz.modules.performance.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.lz.common.utils.PageUtils;
import com.lz.modules.performance.dto.IndicatorLibraryMoveDto;
-import com.lz.modules.performance.dto.StatisticalIndicatorTypeDto;
+import com.lz.modules.performance.res.StatisticalIndicatorTypeRes;
import com.lz.modules.performance.entity.IndicatorLibrary;
import com.lz.modules.performance.req.IndicatorLibraryReq;
@@ -41,7 +41,7 @@ public interface IndicatorLibraryService extends IService {
void updateIndicatorLibrarysMove(IndicatorLibraryMoveDto dto);
- List statisticalByIndicatorType(Long indicatorType);
+ List statisticalByType(Long indicatorType);
int deleteIndicatorLibrarysIndicatorType(Integer indicatorType);
diff --git a/src/main/java/com/lz/modules/performance/service/impl/IndicatorLibraryServiceImpl.java b/src/main/java/com/lz/modules/performance/service/impl/IndicatorLibraryServiceImpl.java
index c6baa6fd..0ea56e02 100644
--- a/src/main/java/com/lz/modules/performance/service/impl/IndicatorLibraryServiceImpl.java
+++ b/src/main/java/com/lz/modules/performance/service/impl/IndicatorLibraryServiceImpl.java
@@ -1,12 +1,11 @@
package com.lz.modules.performance.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.google.common.collect.Lists;
import com.lz.common.utils.PageUtils;
import com.lz.common.utils.StringUtil;
import com.lz.modules.performance.dao.IndicatorLibraryMapper;
import com.lz.modules.performance.dto.IndicatorLibraryMoveDto;
-import com.lz.modules.performance.dto.StatisticalIndicatorTypeDto;
+import com.lz.modules.performance.res.StatisticalIndicatorTypeRes;
import com.lz.modules.performance.entity.IndicatorLibrary;
import com.lz.modules.performance.req.IndicatorLibraryReq;
import com.lz.modules.performance.service.IndicatorLibraryService;
@@ -15,10 +14,7 @@ import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
-import java.util.Arrays;
import java.util.List;
-import java.util.Optional;
-import java.util.function.ToDoubleFunction;
/**
*
@@ -103,9 +99,9 @@ public class IndicatorLibraryServiceImpl extends ServiceImpl statisticalByIndicatorType(Long indicatorType) {
- List dtos = indicatorLibraryMapper.statisticalByIndicatorType(indicatorType);
- StatisticalIndicatorTypeDto dto = new StatisticalIndicatorTypeDto();
+ public List statisticalByType(Long type) {
+ List dtos = indicatorLibraryMapper.statisticalByType(type);
+ StatisticalIndicatorTypeRes dto = new StatisticalIndicatorTypeRes();
dto.setName("未分类指标");
dto.setIndicatorType(0);
dto.setDelete(1);
@@ -115,7 +111,7 @@ public class IndicatorLibraryServiceImpl extends ServiceImpl
and indicator_type = #{req.indicatorType}
+
+ and type = #{req.type}
+
order by sort
@@ -123,15 +126,18 @@
-
From 3e394411ff064300004e97e04886047868d4588f Mon Sep 17 00:00:00 2001
From: DirectionOfMind <3182967682@qq.com>
Date: Thu, 21 Jan 2021 11:23:00 +0800
Subject: [PATCH 17/26] fix
---
.../performance/controller/IndicatorLibraryController.java | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/main/java/com/lz/modules/performance/controller/IndicatorLibraryController.java b/src/main/java/com/lz/modules/performance/controller/IndicatorLibraryController.java
index 3ee213b9..70d0d9d4 100644
--- a/src/main/java/com/lz/modules/performance/controller/IndicatorLibraryController.java
+++ b/src/main/java/com/lz/modules/performance/controller/IndicatorLibraryController.java
@@ -31,7 +31,8 @@ public class IndicatorLibraryController {
@PostMapping("/list")
@ApiOperation("获取指标列表")
- public R list(@RequestBody IndicatorLibraryReq req) {
+ @ApiResponses({@ApiResponse(code = 200, message = "成功", response = IndicatorLibraryDto.class)})
+ public R list(@RequestBody IndicatorLibraryReq req) {
PageUtils page = indicatorLibraryService.selectIndicatorLibrarysByReq(req);
return R.ok().put("data",page);
}
From b57fcd6943c04874bb62e57b0637737d72d6111c Mon Sep 17 00:00:00 2001
From: DirectionOfMind <3182967682@qq.com>
Date: Thu, 21 Jan 2021 12:02:33 +0800
Subject: [PATCH 18/26] fix
---
.../performance/dto/IndicatorLibraryDto.java | 5 +++++
.../performance/IndicatorLibraryMapper.xml | 16 ++++++++++------
2 files changed, 15 insertions(+), 6 deletions(-)
diff --git a/src/main/java/com/lz/modules/performance/dto/IndicatorLibraryDto.java b/src/main/java/com/lz/modules/performance/dto/IndicatorLibraryDto.java
index 994f2d38..00abaa9d 100644
--- a/src/main/java/com/lz/modules/performance/dto/IndicatorLibraryDto.java
+++ b/src/main/java/com/lz/modules/performance/dto/IndicatorLibraryDto.java
@@ -37,4 +37,9 @@ public class IndicatorLibraryDto {
//排序
@ApiModelProperty(value = "排序", name = "sort")
private Integer sort;
+
+ @ApiModelProperty(value = "类型名称", name = "typeName")
+ private String typeName;
+
+
}
diff --git a/src/main/resources/mapper/performance/IndicatorLibraryMapper.xml b/src/main/resources/mapper/performance/IndicatorLibraryMapper.xml
index 278390bf..0c603ea1 100644
--- a/src/main/resources/mapper/performance/IndicatorLibraryMapper.xml
+++ b/src/main/resources/mapper/performance/IndicatorLibraryMapper.xml
@@ -92,18 +92,22 @@
- select id ,name,type,indicator_type, weight, key_result, sort from lz_indicator_library
- where is_delete = 0
+
+ select l.id id,l.name name,l.type type,weight, key_result,l.sort,t.name typeName
+ from lz_indicator_library l
+ LEFT JOIN lz_indicator_type t
+ on l.type = t.id
+ where l.is_delete = 0 and t.is_delete = 0
- and name LIKE CONCAT('%',#{req.name},'%')
+ and l.name LIKE CONCAT('%',#{req.name},'%')
- and indicator_type = #{req.indicatorType}
+ and l.indicator_type = #{req.indicatorType}
- and type = #{req.type}
+ and l.type = #{req.type}
- order by sort
+ order by l.sort
From 54efb3c559ab18305e01b2afeefa23da44437960 Mon Sep 17 00:00:00 2001
From: DirectionOfMind <3182967682@qq.com>
Date: Thu, 21 Jan 2021 14:42:58 +0800
Subject: [PATCH 19/26] fix
---
.../performance/controller/IndicatorLibraryController.java | 5 ++++-
.../resources/mapper/performance/IndicatorLibraryMapper.xml | 1 +
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/main/java/com/lz/modules/performance/controller/IndicatorLibraryController.java b/src/main/java/com/lz/modules/performance/controller/IndicatorLibraryController.java
index 70d0d9d4..8de81bd3 100644
--- a/src/main/java/com/lz/modules/performance/controller/IndicatorLibraryController.java
+++ b/src/main/java/com/lz/modules/performance/controller/IndicatorLibraryController.java
@@ -4,6 +4,7 @@ package com.lz.modules.performance.controller;
import cn.hutool.core.bean.BeanUtil;
import com.lz.common.utils.PageUtils;
import com.lz.common.utils.R;
+import com.lz.common.utils.StringUtil;
import com.lz.modules.performance.dto.IndicatorLibraryDto;
import com.lz.modules.performance.dto.IndicatorLibraryMoveDto;
import com.lz.modules.performance.res.StatisticalIndicatorTypeRes;
@@ -54,7 +55,9 @@ public class IndicatorLibraryController {
public R save(@RequestBody IndicatorLibraryDto dto) {
IndicatorLibrary indicatorLibrary = new IndicatorLibrary();
BeanUtil.copyProperties(dto,indicatorLibrary);
- indicatorLibrary.setWeight(new BigDecimal(dto.getWeight()));
+ if(StringUtil.isNotBlank(dto.getWeight())){
+ indicatorLibrary.setWeight(new BigDecimal(dto.getWeight()));
+ }
boolean success = indicatorLibraryService.saveOrUpdate(indicatorLibrary);
return success ? R.ok():R.error();
diff --git a/src/main/resources/mapper/performance/IndicatorLibraryMapper.xml b/src/main/resources/mapper/performance/IndicatorLibraryMapper.xml
index 0c603ea1..e6d770ae 100644
--- a/src/main/resources/mapper/performance/IndicatorLibraryMapper.xml
+++ b/src/main/resources/mapper/performance/IndicatorLibraryMapper.xml
@@ -153,6 +153,7 @@
select COUNT(1) from lz_indicator_library where indicator_type=#{indicatorType} and is_delete = 0
+ and type in (SELECT id from lz_indicator_type where is_delete = 0)
From b738b42a73e3005d1f88843cea330688c6fe49e7 Mon Sep 17 00:00:00 2001
From: DirectionOfMind <3182967682@qq.com>
Date: Thu, 21 Jan 2021 18:34:32 +0800
Subject: [PATCH 20/26] fix
---
.../com/lz/modules/performance/dto/IndicatorLibraryDto.java | 4 ++--
.../com/lz/modules/performance/entity/IndicatorLibrary.java | 2 +-
.../com/lz/modules/performance/req/IndicatorLibraryReq.java | 4 ++--
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/main/java/com/lz/modules/performance/dto/IndicatorLibraryDto.java b/src/main/java/com/lz/modules/performance/dto/IndicatorLibraryDto.java
index 00abaa9d..785093a5 100644
--- a/src/main/java/com/lz/modules/performance/dto/IndicatorLibraryDto.java
+++ b/src/main/java/com/lz/modules/performance/dto/IndicatorLibraryDto.java
@@ -22,8 +22,8 @@ public class IndicatorLibraryDto {
//指标名称
@ApiModelProperty(value = "指标名称", name = "name")
private String name;
- //指标类型 lz_indicator_type 表id"
- @ApiModelProperty(value = "指标类型 lz_indicator_type 表id", name = "type")
+ //指标类型 lz_result_dimension 表id"
+ @ApiModelProperty(value = "指标类型 lz_result_dimension 表id", name = "type")
private Integer type;
//指标分类 lz_indicator_type 表id
@ApiModelProperty(value = "指标分类 lz_indicator_type 表id", name = "indicatorType")
diff --git a/src/main/java/com/lz/modules/performance/entity/IndicatorLibrary.java b/src/main/java/com/lz/modules/performance/entity/IndicatorLibrary.java
index d17267ff..5cac3268 100644
--- a/src/main/java/com/lz/modules/performance/entity/IndicatorLibrary.java
+++ b/src/main/java/com/lz/modules/performance/entity/IndicatorLibrary.java
@@ -35,7 +35,7 @@ public class IndicatorLibrary implements java.io.Serializable {
@ApiModelProperty(value = "指标名称", name = "name")
private String name;
//指标类型 0:量化指标 1:行为价值观指标 2:团队管理
- @ApiModelProperty(value = "指标类型 lz_indicator_type 表id", name = "type")
+ @ApiModelProperty(value = "指标类型 lz_result_dimension 表id", name = "type")
private Integer type;
//指标分类 lz_indicator_type 表id
@ApiModelProperty(value = "指标分类 lz_indicator_type 表id", name = "indicatorType")
diff --git a/src/main/java/com/lz/modules/performance/req/IndicatorLibraryReq.java b/src/main/java/com/lz/modules/performance/req/IndicatorLibraryReq.java
index 02453f03..c362a698 100644
--- a/src/main/java/com/lz/modules/performance/req/IndicatorLibraryReq.java
+++ b/src/main/java/com/lz/modules/performance/req/IndicatorLibraryReq.java
@@ -21,8 +21,8 @@ public class IndicatorLibraryReq extends BasePage{
@ApiModelProperty(value = "指标分类 lz_indicator_type 表id", name = "indicatorType")
private Integer indicatorType;
- //指标分类 lz_indicator_type 表id
- @ApiModelProperty(value = "指标类型 lz_indicator_type 表id", name = "type")
+ //指标分类 lz_result_dimension 表id
+ @ApiModelProperty(value = "指标类型 lz_result_dimension 表id", name = "type")
private Integer type;
}
From 0f440dd17377fa625e81c0ed448e16b800c0c31b Mon Sep 17 00:00:00 2001
From: DirectionOfMind <3182967682@qq.com>
Date: Fri, 22 Jan 2021 09:36:12 +0800
Subject: [PATCH 21/26] fix
---
.../resources/mapper/performance/IndicatorLibraryMapper.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/main/resources/mapper/performance/IndicatorLibraryMapper.xml b/src/main/resources/mapper/performance/IndicatorLibraryMapper.xml
index e6d770ae..6ff3b177 100644
--- a/src/main/resources/mapper/performance/IndicatorLibraryMapper.xml
+++ b/src/main/resources/mapper/performance/IndicatorLibraryMapper.xml
@@ -95,7 +95,7 @@
select l.id id,l.name name,l.type type,weight, key_result,l.sort,t.name typeName
from lz_indicator_library l
- LEFT JOIN lz_indicator_type t
+ LEFT JOIN lz_result_dimension t
on l.type = t.id
where l.is_delete = 0 and t.is_delete = 0
From 39f68e6376cc756d9cfd7b0add9f2a32ab20bdd3 Mon Sep 17 00:00:00 2001
From: DirectionOfMind <3182967682@qq.com>
Date: Fri, 22 Jan 2021 11:05:19 +0800
Subject: [PATCH 22/26] fix
---
.../performance/controller/IndicatorLibraryController.java | 2 +-
.../com/lz/modules/performance/dto/IndicatorLibraryDto.java | 2 +-
.../resources/mapper/performance/IndicatorLibraryMapper.xml | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/main/java/com/lz/modules/performance/controller/IndicatorLibraryController.java b/src/main/java/com/lz/modules/performance/controller/IndicatorLibraryController.java
index 8de81bd3..3460b06d 100644
--- a/src/main/java/com/lz/modules/performance/controller/IndicatorLibraryController.java
+++ b/src/main/java/com/lz/modules/performance/controller/IndicatorLibraryController.java
@@ -93,7 +93,7 @@ public class IndicatorLibraryController {
@GetMapping("/statistical")
@ApiOperation("统计指标")
@ApiResponses({@ApiResponse(code = 200, message = "成功", response = StatisticalIndicatorTypeRes.class)})
- public R statistical(@RequestParam(name = "type",required = false) @ApiParam(value = "指标分类id",name = "type") Long type) {
+ public R statistical(@RequestParam(name = "type",required = false) @ApiParam(value = "指标维度id",name = "type") Long type) {
List dtos = indicatorLibraryService.statisticalByType(type);
return R.ok().put("data",dtos);
}
diff --git a/src/main/java/com/lz/modules/performance/dto/IndicatorLibraryDto.java b/src/main/java/com/lz/modules/performance/dto/IndicatorLibraryDto.java
index 785093a5..aebc6135 100644
--- a/src/main/java/com/lz/modules/performance/dto/IndicatorLibraryDto.java
+++ b/src/main/java/com/lz/modules/performance/dto/IndicatorLibraryDto.java
@@ -23,7 +23,7 @@ public class IndicatorLibraryDto {
@ApiModelProperty(value = "指标名称", name = "name")
private String name;
//指标类型 lz_result_dimension 表id"
- @ApiModelProperty(value = "指标类型 lz_result_dimension 表id", name = "type")
+ @ApiModelProperty(value = "指标维度 lz_result_dimension 表id", name = "type")
private Integer type;
//指标分类 lz_indicator_type 表id
@ApiModelProperty(value = "指标分类 lz_indicator_type 表id", name = "indicatorType")
diff --git a/src/main/resources/mapper/performance/IndicatorLibraryMapper.xml b/src/main/resources/mapper/performance/IndicatorLibraryMapper.xml
index 6ff3b177..472b1e5d 100644
--- a/src/main/resources/mapper/performance/IndicatorLibraryMapper.xml
+++ b/src/main/resources/mapper/performance/IndicatorLibraryMapper.xml
@@ -153,7 +153,7 @@
select COUNT(1) from lz_indicator_library where indicator_type=#{indicatorType} and is_delete = 0
- and type in (SELECT id from lz_indicator_type where is_delete = 0)
+ and type in (SELECT id from lz_result_dimension where is_delete = 0)
From 74096d648ce9e692260cd2fae11979ec49a652bc Mon Sep 17 00:00:00 2001
From: DirectionOfMind <3182967682@qq.com>
Date: Fri, 22 Jan 2021 15:09:41 +0800
Subject: [PATCH 23/26] fix
---
.../resources/mapper/performance/IndicatorLibraryMapper.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/main/resources/mapper/performance/IndicatorLibraryMapper.xml b/src/main/resources/mapper/performance/IndicatorLibraryMapper.xml
index 472b1e5d..9d2185e4 100644
--- a/src/main/resources/mapper/performance/IndicatorLibraryMapper.xml
+++ b/src/main/resources/mapper/performance/IndicatorLibraryMapper.xml
@@ -93,7 +93,7 @@
- select l.id id,l.name name,l.type type,weight, key_result,l.sort,t.name typeName
+ select l.id id,l.name name,l.type type,l.indicator_type,weight, key_result,l.sort,t.name typeName
from lz_indicator_library l
LEFT JOIN lz_result_dimension t
on l.type = t.id
From e5a8a04f88df49d2ce763f2a49115c4f54283aaa Mon Sep 17 00:00:00 2001
From: DirectionOfMind <3182967682@qq.com>
Date: Fri, 22 Jan 2021 15:26:25 +0800
Subject: [PATCH 24/26] fix
---
.../lz/modules/performance/dao/IndicatorLibraryMapper.java | 4 ++--
.../service/impl/IndicatorLibraryServiceImpl.java | 2 +-
.../mapper/performance/IndicatorLibraryMapper.xml | 7 ++++++-
3 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/src/main/java/com/lz/modules/performance/dao/IndicatorLibraryMapper.java b/src/main/java/com/lz/modules/performance/dao/IndicatorLibraryMapper.java
index 48f62c85..bd648613 100644
--- a/src/main/java/com/lz/modules/performance/dao/IndicatorLibraryMapper.java
+++ b/src/main/java/com/lz/modules/performance/dao/IndicatorLibraryMapper.java
@@ -42,11 +42,11 @@ public interface IndicatorLibraryMapper extends BaseMapper {
void updateIndicatorLibrarysMove(@Param("ids")List ids,@Param("indicatorType")Long indicatorType);
- List statisticalByType(Long type);
+ List statisticalByType(@Param("type") Long type);
int deleteIndicatorLibrarysByIndicatorType(@Param("indicatorType") Integer indicatorType);
- int countIndicatorLibrarysByIndicatorType(@Param("indicatorType") Integer indicatorType);
+ int countIndicatorLibrarysByIndicatorType(@Param("indicatorType") Integer indicatorType,@Param("type") Long type);
}
\ No newline at end of file
diff --git a/src/main/java/com/lz/modules/performance/service/impl/IndicatorLibraryServiceImpl.java b/src/main/java/com/lz/modules/performance/service/impl/IndicatorLibraryServiceImpl.java
index 0ea56e02..02eb4eda 100644
--- a/src/main/java/com/lz/modules/performance/service/impl/IndicatorLibraryServiceImpl.java
+++ b/src/main/java/com/lz/modules/performance/service/impl/IndicatorLibraryServiceImpl.java
@@ -105,7 +105,7 @@ public class IndicatorLibraryServiceImpl extends ServiceImpl0){
dtos.add(dto);
diff --git a/src/main/resources/mapper/performance/IndicatorLibraryMapper.xml b/src/main/resources/mapper/performance/IndicatorLibraryMapper.xml
index 9d2185e4..c81a8472 100644
--- a/src/main/resources/mapper/performance/IndicatorLibraryMapper.xml
+++ b/src/main/resources/mapper/performance/IndicatorLibraryMapper.xml
@@ -153,7 +153,12 @@
select COUNT(1) from lz_indicator_library where indicator_type=#{indicatorType} and is_delete = 0
- and type in (SELECT id from lz_result_dimension where is_delete = 0)
+
+ and type = #{type}
+
+
+ and type in (SELECT id from lz_result_dimension where is_delete = 0)
+
From 45e074f89addc568473d8833ca803ba212548089 Mon Sep 17 00:00:00 2001
From: DirectionOfMind <3182967682@qq.com>
Date: Mon, 25 Jan 2021 11:07:31 +0800
Subject: [PATCH 25/26] fix
---
.../equipment/service/impl/EquipmentInfoServiceImpl.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/main/java/com/lz/modules/equipment/service/impl/EquipmentInfoServiceImpl.java b/src/main/java/com/lz/modules/equipment/service/impl/EquipmentInfoServiceImpl.java
index 6ea03e6c..e2da0222 100644
--- a/src/main/java/com/lz/modules/equipment/service/impl/EquipmentInfoServiceImpl.java
+++ b/src/main/java/com/lz/modules/equipment/service/impl/EquipmentInfoServiceImpl.java
@@ -209,7 +209,7 @@ public class EquipmentInfoServiceImpl extends ServiceImpl
Date: Tue, 26 Jan 2021 18:00:07 +0800
Subject: [PATCH 26/26] fix
---
.../performance/controller/IndicatorLibraryController.java | 4 ++--
.../lz/modules/performance/dao/IndicatorLibraryMapper.java | 4 ++--
.../performance/service/IndicatorLibraryService.java | 2 +-
.../service/impl/IndicatorLibraryServiceImpl.java | 6 +++---
.../resources/mapper/performance/IndicatorLibraryMapper.xml | 6 ++++++
5 files changed, 14 insertions(+), 8 deletions(-)
diff --git a/src/main/java/com/lz/modules/performance/controller/IndicatorLibraryController.java b/src/main/java/com/lz/modules/performance/controller/IndicatorLibraryController.java
index 3460b06d..b85c1228 100644
--- a/src/main/java/com/lz/modules/performance/controller/IndicatorLibraryController.java
+++ b/src/main/java/com/lz/modules/performance/controller/IndicatorLibraryController.java
@@ -93,8 +93,8 @@ public class IndicatorLibraryController {
@GetMapping("/statistical")
@ApiOperation("统计指标")
@ApiResponses({@ApiResponse(code = 200, message = "成功", response = StatisticalIndicatorTypeRes.class)})
- public R statistical(@RequestParam(name = "type",required = false) @ApiParam(value = "指标维度id",name = "type") Long type) {
- List dtos = indicatorLibraryService.statisticalByType(type);
+ public R statistical(@RequestParam(name = "type",required = false) @ApiParam(value = "指标维度id",name = "type") Long type,@RequestParam(name = "name",required = false) @ApiParam(value = "指标名称",name = "name") String name) {
+ List dtos = indicatorLibraryService.statisticalByType(type,name);
return R.ok().put("data",dtos);
}
}
\ No newline at end of file
diff --git a/src/main/java/com/lz/modules/performance/dao/IndicatorLibraryMapper.java b/src/main/java/com/lz/modules/performance/dao/IndicatorLibraryMapper.java
index bd648613..fc449c37 100644
--- a/src/main/java/com/lz/modules/performance/dao/IndicatorLibraryMapper.java
+++ b/src/main/java/com/lz/modules/performance/dao/IndicatorLibraryMapper.java
@@ -42,11 +42,11 @@ public interface IndicatorLibraryMapper extends BaseMapper {
void updateIndicatorLibrarysMove(@Param("ids")List ids,@Param("indicatorType")Long indicatorType);
- List statisticalByType(@Param("type") Long type);
+ List statisticalByType(@Param("type") Long type,@Param("name") String name);
int deleteIndicatorLibrarysByIndicatorType(@Param("indicatorType") Integer indicatorType);
- int countIndicatorLibrarysByIndicatorType(@Param("indicatorType") Integer indicatorType,@Param("type") Long type);
+ int countIndicatorLibrarysByIndicatorType(@Param("indicatorType") Integer indicatorType,@Param("type") Long type,@Param("name") String name);
}
\ No newline at end of file
diff --git a/src/main/java/com/lz/modules/performance/service/IndicatorLibraryService.java b/src/main/java/com/lz/modules/performance/service/IndicatorLibraryService.java
index 2a8f09ee..5b1a4a8f 100644
--- a/src/main/java/com/lz/modules/performance/service/IndicatorLibraryService.java
+++ b/src/main/java/com/lz/modules/performance/service/IndicatorLibraryService.java
@@ -41,7 +41,7 @@ public interface IndicatorLibraryService extends IService {
void updateIndicatorLibrarysMove(IndicatorLibraryMoveDto dto);
- List statisticalByType(Long indicatorType);
+ List statisticalByType(Long indicatorType,String name);
int deleteIndicatorLibrarysIndicatorType(Integer indicatorType);
diff --git a/src/main/java/com/lz/modules/performance/service/impl/IndicatorLibraryServiceImpl.java b/src/main/java/com/lz/modules/performance/service/impl/IndicatorLibraryServiceImpl.java
index 02eb4eda..6ea8db5b 100644
--- a/src/main/java/com/lz/modules/performance/service/impl/IndicatorLibraryServiceImpl.java
+++ b/src/main/java/com/lz/modules/performance/service/impl/IndicatorLibraryServiceImpl.java
@@ -99,13 +99,13 @@ public class IndicatorLibraryServiceImpl extends ServiceImpl statisticalByType(Long type) {
- List dtos = indicatorLibraryMapper.statisticalByType(type);
+ public List statisticalByType(Long type,String name) {
+ List dtos = indicatorLibraryMapper.statisticalByType(type,name);
StatisticalIndicatorTypeRes dto = new StatisticalIndicatorTypeRes();
dto.setName("未分类指标");
dto.setIndicatorType(0);
dto.setDelete(1);
- int count = indicatorLibraryMapper.countIndicatorLibrarysByIndicatorType(0,type);
+ int count = indicatorLibraryMapper.countIndicatorLibrarysByIndicatorType(0,type,name);
dto.setCount(count);
if(count>0){
dtos.add(dto);
diff --git a/src/main/resources/mapper/performance/IndicatorLibraryMapper.xml b/src/main/resources/mapper/performance/IndicatorLibraryMapper.xml
index c81a8472..3a4870ab 100644
--- a/src/main/resources/mapper/performance/IndicatorLibraryMapper.xml
+++ b/src/main/resources/mapper/performance/IndicatorLibraryMapper.xml
@@ -138,6 +138,9 @@
and type = #{type}
+
+ and name like concat('%',#{name},'%')
+
GROUP BY indicator_type) l
on t.id = l.indicator_type
where t.is_delete = 0 and t.type=0
@@ -159,6 +162,9 @@
and type in (SELECT id from lz_result_dimension where is_delete = 0)
+
+ and name like concat('%',#{name},'%')
+