Commit e67d06d8 by zhangkb

修改指标计分规则和单位计分规则新增接口。

parent b6e2a909
...@@ -49,8 +49,9 @@ public class IndScorecardCtrl { ...@@ -49,8 +49,9 @@ public class IndScorecardCtrl {
@ApiOperation(value = "新增/修改", notes = "新增/修改") @ApiOperation(value = "新增/修改", notes = "新增/修改")
@PostMapping(value = "/saveOrUpdate") @PostMapping(value = "/saveOrUpdate")
public String saveOrUpdate(@RequestBody IndScorecard indScorecard) { public String saveOrUpdate(@RequestBody IndScorecard indScorecard,@RequestParam String catalogId,
return indScorecardService.saveOrUpdate(indScorecard); @RequestParam String catalogIdPath,@RequestParam String user) {
return indScorecardService.saveOrUpdate(indScorecard,catalogId,catalogIdPath,user);
} }
@ApiOperation(value = "删除", notes = "删除") @ApiOperation(value = "删除", notes = "删除")
......
...@@ -49,8 +49,9 @@ public class ObjScoreRuleCtrl { ...@@ -49,8 +49,9 @@ public class ObjScoreRuleCtrl {
@ApiOperation(value = "新增/修改", notes = "新增/修改") @ApiOperation(value = "新增/修改", notes = "新增/修改")
@PostMapping(value = "/saveOrUpdate") @PostMapping(value = "/saveOrUpdate")
public String saveOrUpdate(@RequestBody ScoreRule scoreRule) { public String saveOrUpdate(@RequestBody ScoreRule scoreRule,@RequestParam String catalogId,
return scoreRuleService.save(scoreRule); @RequestParam String catalogIdPath,@RequestParam String user) {
return scoreRuleService.saveOrUpdate(scoreRule,catalogId,catalogIdPath,user);
} }
@ApiOperation(value = "删除", notes = "删除") @ApiOperation(value = "删除", notes = "删除")
......
...@@ -2,11 +2,14 @@ package com.keymobile.indicators.model.entity.objscorerule; ...@@ -2,11 +2,14 @@ package com.keymobile.indicators.model.entity.objscorerule;
import java.io.Serializable; import java.io.Serializable;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date;
import java.util.List; import java.util.List;
import org.springframework.data.annotation.Id; import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document; import org.springframework.data.mongodb.core.mapping.Document;
import com.keymobile.indicators.utils.DateUtils;
import lombok.Data; import lombok.Data;
/** /**
...@@ -33,6 +36,9 @@ public class ScoreRule implements Serializable{ ...@@ -33,6 +36,9 @@ public class ScoreRule implements Serializable{
private String code;//标识编码 private String code;//标识编码
private String desc;//规则描述 private String desc;//规则描述
private String lastUpdateTime = DateUtils.formatDate(new Date(), "yyyy-MM-dd HH:mm:ss");
private String lastUpdater;
public List<IndTypeWeight> getIndTypeWeights(){ public List<IndTypeWeight> getIndTypeWeights(){
return indTypeWeights; return indTypeWeights;
} }
......
...@@ -37,7 +37,11 @@ public class IndScorecardService { ...@@ -37,7 +37,11 @@ public class IndScorecardService {
private DriveIndDefService driveIndDefService; private DriveIndDefService driveIndDefService;
//id不为空为修改,为空为新增 //id不为空为修改,为空为新增
public String saveOrUpdate(IndScorecard indScorecard) { public String saveOrUpdate(IndScorecard indScorecard,String catalogId,
String catalogIdPath,String user) {
indScorecard.setCatalogId(catalogId);
indScorecard.setCatalogIdPath(catalogIdPath);
indScorecard.setLastUpdater(user);
indScorecard = indScorecardRepo.save(indScorecard); indScorecard = indScorecardRepo.save(indScorecard);
return indScorecard.getId(); return indScorecard.getId();
} }
......
...@@ -37,7 +37,10 @@ public class ScoreRuleService { ...@@ -37,7 +37,10 @@ public class ScoreRuleService {
private static final Pattern P = Pattern.compile("(\\[[^\\]]*\\])"); private static final Pattern P = Pattern.compile("(\\[[^\\]]*\\])");
public String save(ScoreRule scoreRule) { public String saveOrUpdate(ScoreRule scoreRule,String catalogId,String catalogIdPath,String user) {
scoreRule.setCatalogId(catalogId);
scoreRule.setCatalogIdPath(catalogIdPath);
scoreRule.setLastUpdater(user);
scoreRule = scoreRuleRepo.save(scoreRule); scoreRule = scoreRuleRepo.save(scoreRule);
return scoreRule.getId(); return scoreRule.getId();
} }
......
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