Commit 51d94765 by zhangkb

考核指标添加短板规则字段

parent d66e8e93
...@@ -33,8 +33,8 @@ public class IndicatorsDefCtrl { ...@@ -33,8 +33,8 @@ public class IndicatorsDefCtrl {
@ApiOperation(value = "新建基础指标", notes = "新建基础指标") @ApiOperation(value = "新建基础指标", notes = "新建基础指标")
@PostMapping(value = "/createBaseInd") @PostMapping(value = "/createBaseInd")
public void createBaseInd(@RequestBody BaseIndDef baseIndDef,@RequestParam String catalogId, public void createBaseInd(@RequestBody BaseIndDef baseIndDef,@RequestParam String catalogId,
@RequestParam String user) throws Exception{ @RequestParam String catalogIdPath,@RequestParam String user) throws Exception{
baseIndDefService.saveOrUpdate(baseIndDef, catalogId, user); baseIndDefService.saveOrUpdate(baseIndDef, catalogId, catalogIdPath, user);
} }
@ApiOperation(value = "删除基础指标", notes = "删除基础指标") @ApiOperation(value = "删除基础指标", notes = "删除基础指标")
...@@ -45,16 +45,17 @@ public class IndicatorsDefCtrl { ...@@ -45,16 +45,17 @@ public class IndicatorsDefCtrl {
@ApiOperation(value = "根据关键字查询基础指标", notes = "根据关键字查询基础指标") @ApiOperation(value = "根据关键字查询基础指标", notes = "根据关键字查询基础指标")
@PostMapping(value = "/getByPageAndKeyword") @PostMapping(value = "/getByPageAndKeyword")
public Map<String,Object> getByPageAndKeyword(@RequestParam String catalogId,@RequestParam String keyword, public Map<String,Object> getByPageAndKeyword(@RequestParam String catalogId,
@RequestParam int page,@RequestParam int rows) throws Exception{ @RequestParam(required=false) String keyword,
@RequestParam(defaultValue = "0") int page,@RequestParam(defaultValue = "10") int rows) throws Exception{
return baseIndDefService.getByPageAndKeyword(catalogId, keyword, page, rows); return baseIndDefService.getByPageAndKeyword(catalogId, keyword, page, rows);
} }
@ApiOperation(value = "新建考核指标", notes = "新建考核指标") @ApiOperation(value = "新建考核指标", notes = "新建考核指标")
@PostMapping(value = "/createDriveInd") @PostMapping(value = "/createDriveInd")
public void createDriveInd(@RequestBody DriveIndDef driveIndDef,@RequestParam String catalogId, public void createDriveInd(@RequestBody DriveIndDef driveIndDef,@RequestParam String catalogId,
@RequestParam String user) throws Exception{ @RequestParam String catalogIdPath,@RequestParam String user) throws Exception{
driveIndDefService.saveOrUpdate(driveIndDef, catalogId, user); driveIndDefService.saveOrUpdate(driveIndDef, catalogId, catalogIdPath, user);
} }
@ApiOperation(value = "删除考核指标", notes = "删除考核指标") @ApiOperation(value = "删除考核指标", notes = "删除考核指标")
...@@ -65,8 +66,9 @@ public class IndicatorsDefCtrl { ...@@ -65,8 +66,9 @@ public class IndicatorsDefCtrl {
@ApiOperation(value = "根据关键字查询考核指标", notes = "根据关键字查询考核指标") @ApiOperation(value = "根据关键字查询考核指标", notes = "根据关键字查询考核指标")
@PostMapping(value = "/getDriveByPageAndKeyword") @PostMapping(value = "/getDriveByPageAndKeyword")
public Map<String,Object> getDriveByPageAndKeyword(@RequestParam String catalogId,@RequestParam String keyword, public Map<String,Object> getDriveByPageAndKeyword(@RequestParam String catalogId,
@RequestParam int page,@RequestParam int rows) throws Exception{ @RequestParam(required=false) String keyword,
@RequestParam(defaultValue = "0") int page,@RequestParam(defaultValue = "10") int rows) throws Exception{
return driveIndDefService.getByPageAndKeyword(catalogId, keyword, page, rows); return driveIndDefService.getByPageAndKeyword(catalogId, keyword, page, rows);
} }
......
...@@ -32,6 +32,8 @@ public class DriveIndDef { ...@@ -32,6 +32,8 @@ public class DriveIndDef {
private String version;//版本号 private String version;//版本号
private String catalogId;//挂靠目录id private String catalogId;//挂靠目录id
private String catalogIdPath;//挂靠目录idPath,方便用目录类别找到对应的挂靠指标 private String catalogIdPath;//挂靠目录idPath,方便用目录类别找到对应的挂靠指标
private String indShortboardRule;//短板规则
private String indShortboardRuleDesc;//短板规则描述
private String creater; private String creater;
private Date createTime; private Date createTime;
private String updater; private String updater;
......
...@@ -19,7 +19,7 @@ public class BaseIndDefService { ...@@ -19,7 +19,7 @@ public class BaseIndDefService {
@Autowired @Autowired
private BaseIndDefVersionService baseIndDefVersionService; private BaseIndDefVersionService baseIndDefVersionService;
public String saveOrUpdate(BaseIndDef baseIndDef,String catalogId,String user) public String saveOrUpdate(BaseIndDef baseIndDef,String catalogId,String catalogIdPath,String user)
throws Exception{ throws Exception{
if(StringUtils.isBlank(baseIndDef.getIndId())) { if(StringUtils.isBlank(baseIndDef.getIndId())) {
return "indId can not be null"; return "indId can not be null";
...@@ -32,16 +32,18 @@ public class BaseIndDefService { ...@@ -32,16 +32,18 @@ public class BaseIndDefService {
baseIndDef.setUpdateTime(new Date()); baseIndDef.setUpdateTime(new Date());
baseIndDef.setVersion("1.0"); baseIndDef.setVersion("1.0");
baseIndDef.setCatalogId(catalogId); baseIndDef.setCatalogId(catalogId);
baseIndDef.setCatalogIdPath(catalogIdPath);
baseIndDefMapper.insert(baseIndDef); baseIndDefMapper.insert(baseIndDef);
}else { }else {
//生成版本 //生成版本
if(baseIndDefVersionService.save(baseIndDef)) { if(baseIndDefVersionService.save(dbBaseIndDef)) {
String oldVersion = baseIndDef.getVersion(); String oldVersion = dbBaseIndDef.getVersion();
String newVersion = String.valueOf(Double.valueOf(oldVersion)+1);//旧版本+1 String newVersion = String.valueOf(Double.valueOf(oldVersion)+1);//旧版本+1
baseIndDef.setUpdater(user); baseIndDef.setUpdater(user);
baseIndDef.setUpdateTime(new Date()); baseIndDef.setUpdateTime(new Date());
baseIndDef.setVersion(newVersion); baseIndDef.setVersion(newVersion);
baseIndDef.setCatalogId(catalogId); baseIndDef.setCatalogId(catalogId);
baseIndDef.setCatalogIdPath(catalogIdPath);
baseIndDefMapper.updateByPrimaryKey(baseIndDef); baseIndDefMapper.updateByPrimaryKey(baseIndDef);
} }
} }
......
...@@ -19,7 +19,7 @@ public class DriveIndDefService { ...@@ -19,7 +19,7 @@ public class DriveIndDefService {
@Autowired @Autowired
private DriveIndDefVersionService driveIndDefVersionService; private DriveIndDefVersionService driveIndDefVersionService;
public String saveOrUpdate(DriveIndDef driveIndDef,String catalogId,String user) public String saveOrUpdate(DriveIndDef driveIndDef,String catalogId,String catalogIdPath,String user)
throws Exception{ throws Exception{
if(StringUtils.isBlank(driveIndDef.getIndId())) { if(StringUtils.isBlank(driveIndDef.getIndId())) {
return "indId can not be null"; return "indId can not be null";
...@@ -32,16 +32,18 @@ public class DriveIndDefService { ...@@ -32,16 +32,18 @@ public class DriveIndDefService {
driveIndDef.setUpdateTime(new Date()); driveIndDef.setUpdateTime(new Date());
driveIndDef.setVersion("1.0"); driveIndDef.setVersion("1.0");
driveIndDef.setCatalogId(catalogId); driveIndDef.setCatalogId(catalogId);
driveIndDef.setCatalogIdPath(catalogIdPath);
driveIndDefMapper.insert(driveIndDef); driveIndDefMapper.insert(driveIndDef);
}else { }else {
//生成版本 //生成版本
if(driveIndDefVersionService.save(driveIndDef)) { if(driveIndDefVersionService.save(dbBaseIndDef)) {
String oldVersion = driveIndDef.getVersion(); String oldVersion = dbBaseIndDef.getVersion();
String newVersion = String.valueOf(Double.valueOf(oldVersion)+1);//旧版本+1 String newVersion = String.valueOf(Double.valueOf(oldVersion)+1);//旧版本+1
driveIndDef.setUpdater(user); driveIndDef.setUpdater(user);
driveIndDef.setUpdateTime(new Date()); driveIndDef.setUpdateTime(new Date());
driveIndDef.setVersion(newVersion); driveIndDef.setVersion(newVersion);
driveIndDef.setCatalogId(catalogId); driveIndDef.setCatalogId(catalogId);
driveIndDef.setCatalogIdPath(catalogIdPath);
driveIndDefMapper.updateByPrimaryKey(driveIndDef); driveIndDefMapper.updateByPrimaryKey(driveIndDef);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment