fix
This commit is contained in:
parent
0d87dd9801
commit
91b1555d95
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
@ -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();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -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<IndicatorLibrary> {
|
||||
|
||||
void updateIndicatorLibrarysMove(@Param("ids")List<Long> ids,@Param("indicatorType")Long indicatorType);
|
||||
|
||||
List<StatisticalIndicatorTypeDto> statisticalByIndicatorType();
|
||||
}
|
||||
@ -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;
|
||||
}
|
||||
@ -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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* (设置)指标库 服务类
|
||||
@ -38,5 +41,7 @@ public interface IndicatorLibraryService extends IService<IndicatorLibrary> {
|
||||
|
||||
void updateIndicatorLibrarysMove(IndicatorLibraryMoveDto dto);
|
||||
|
||||
List<StatisticalIndicatorTypeDto> statisticalByIndicatorType();
|
||||
|
||||
|
||||
}
|
||||
@ -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<IndicatorLibraryMap
|
||||
indicatorLibraryMapper.updateIndicatorLibrarysMove(list,dto.getIndicatorType());
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<StatisticalIndicatorTypeDto> statisticalByIndicatorType() {
|
||||
List<StatisticalIndicatorTypeDto> dtos = indicatorLibraryMapper.statisticalByIndicatorType();
|
||||
for(StatisticalIndicatorTypeDto dto:dtos){
|
||||
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@ -123,5 +123,12 @@
|
||||
</update>
|
||||
|
||||
|
||||
<select id="statisticalByIndicatorType"
|
||||
resultType="com.lz.modules.performance.dto.StatisticalIndicatorTypeDto">
|
||||
SELECT indicator_type,count(indicator_type) count from lz_indicator_library where is_delete = 0 GROUP BY indicator_type
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user