Commit edd8c30c by zhangkb

实体新增增加code参数输入和保存

parent 771cbb83
......@@ -67,9 +67,9 @@ public class IndScorecardCtrl {
@ApiOperation(value = "新增/修改", notes = "新增/修改")
@PostMapping(value = "/saveOrUpdate")
public Integer saveOrUpdate(@RequestBody IndScorecard indScorecard,@RequestParam Integer catalogId,
public Integer saveOrUpdate(@RequestBody IndScorecard indScorecard,@RequestParam String code,@RequestParam Integer catalogId,
@RequestParam String catalogIdPath,@RequestParam String user) {
return indScorecardService.saveOrUpdate(indScorecard,catalogId,catalogIdPath,user);
return indScorecardService.saveOrUpdate(indScorecard,code,catalogId,catalogIdPath,user);
}
@ApiOperation(value = "删除", notes = "删除")
......
......@@ -42,8 +42,8 @@ public class IndicatorsDefCtrl {
@PostMapping(value = "/createBaseInd")
public void createBaseInd(@RequestBody BaseIndDef baseIndDef,@RequestParam Integer catalogId,
@RequestParam String catalogIdPath,@RequestParam String user,
@RequestParam String isUpdate) throws Exception{
baseIndDefService.saveOrUpdate(baseIndDef, catalogId, catalogIdPath, user, isUpdate);
@RequestParam String isUpdate,@RequestParam String code) throws Exception{
baseIndDefService.saveOrUpdate(baseIndDef, catalogId, catalogIdPath, user, isUpdate, code);
}
@ApiOperation(value = "删除基础指标", notes = "删除基础指标")
......@@ -78,10 +78,10 @@ public class IndicatorsDefCtrl {
@ApiOperation(value = "新建考核指标(isUpdate:0 新增 1修改)", notes = "新建考核指标(isUpdate:0 新增 1修改)")
@PostMapping(value = "/createDriveInd")
public void createDriveInd(@RequestBody DriveIndDef driveIndDef,@RequestParam Integer catalogId,
public void createDriveInd(@RequestBody DriveIndDef driveIndDef,@RequestParam String code,@RequestParam Integer catalogId,
@RequestParam String catalogIdPath,@RequestParam String user,@RequestParam String isUpdate,
@RequestParam String shortboardIds) throws Exception{
driveIndDefService.saveOrUpdate(driveIndDef, catalogId, catalogIdPath, user, isUpdate, shortboardIds);
@RequestParam(required=false) String shortboardIds) throws Exception{
driveIndDefService.saveOrUpdate(driveIndDef, code, catalogId, catalogIdPath, user, isUpdate, shortboardIds);
}
@ApiOperation(value = "删除考核指标", notes = "删除考核指标")
......
......@@ -67,9 +67,9 @@ public class ObjScoreRuleCtrl {
@ApiOperation(value = "新增/修改", notes = "新增/修改")
@PostMapping(value = "/saveOrUpdate")
public Integer saveOrUpdate(@RequestBody ScoreRule scoreRule,@RequestParam Integer catalogId,
public Integer saveOrUpdate(@RequestBody ScoreRule scoreRule,@RequestParam String code,@RequestParam Integer catalogId,
@RequestParam String catalogIdPath,@RequestParam String user) {
return scoreRuleService.saveOrUpdate(scoreRule,catalogId,catalogIdPath,user);
return scoreRuleService.saveOrUpdate(scoreRule,code,catalogId,catalogIdPath,user);
}
@ApiOperation(value = "删除", notes = "删除")
......
......@@ -67,9 +67,9 @@ public class ShortboardRuleCtrl {
@ApiOperation(value = "新增/修改", notes = "新增/修改")
@PostMapping(value = "/saveOrUpdate")
public Integer saveOrUpdate(@RequestBody ShortboardRule shortboardRule,@RequestParam Integer catalogId,
public Integer saveOrUpdate(@RequestBody ShortboardRule shortboardRule,@RequestParam String code,@RequestParam Integer catalogId,
@RequestParam String catalogIdPath,@RequestParam String user) {
return shortboardRuleService.saveOrUpdate(shortboardRule,catalogId,catalogIdPath,user);
return shortboardRuleService.saveOrUpdate(shortboardRule,code,catalogId,catalogIdPath,user);
}
@ApiOperation(value = "删除", notes = "删除")
......
......@@ -70,9 +70,9 @@ public class ShortboardUnitCtrl {
@ApiOperation(value = "新增/修改", notes = "新增/修改")
@PostMapping(value = "/saveOrUpdate")
public Integer saveOrUpdate(@RequestBody ShortboardUnit shortboardUnit,@RequestParam Integer catalogId,
public Integer saveOrUpdate(@RequestBody ShortboardUnit shortboardUnit,@RequestParam String code,@RequestParam Integer catalogId,
@RequestParam String catalogIdPath,@RequestParam String user) {
return shortboardUnitService.saveOrUpdate(shortboardUnit,catalogId,catalogIdPath,user);
return shortboardUnitService.saveOrUpdate(shortboardUnit,code,catalogId,catalogIdPath,user);
}
@ApiOperation(value = "删除", notes = "删除")
......
......@@ -22,7 +22,7 @@ public class BaseIndDefService {
private IndicatorsRelService indRelService;
public String saveOrUpdate(BaseIndDef baseIndDef,Integer catalogId,
String catalogIdPath,String user,String isUpdate)
String catalogIdPath,String user,String isUpdate,String code)
throws Exception{
if(StringUtils.isBlank(baseIndDef.getIndId())) {
return "indId can not be null";
......@@ -38,6 +38,7 @@ public class BaseIndDefService {
baseIndDef.setUpdater(user);
baseIndDef.setUpdateTime(new Date());
baseIndDef.setVersion("1.0");
baseIndDef.setCode(code);
baseIndDef.setCatalogId(catalogId);
baseIndDef.setCatalogIdPath(catalogIdPath);
baseIndDefMapper.insert(baseIndDef);
......@@ -52,6 +53,7 @@ public class BaseIndDefService {
baseIndDef.setUpdater(user);
baseIndDef.setUpdateTime(new Date());
baseIndDef.setVersion(newVersion);
baseIndDef.setCode(code);
baseIndDef.setCatalogId(catalogId);
baseIndDef.setCatalogIdPath(catalogIdPath);
baseIndDefMapper.updateByPrimaryKey(baseIndDef);
......
......@@ -38,7 +38,7 @@ public class DriveIndDefService {
@Autowired
private IndicatorsRelService indRelService;
public String saveOrUpdate(DriveIndDef driveIndDef,Integer catalogId,String catalogIdPath,
public String saveOrUpdate(DriveIndDef driveIndDef,String code,Integer catalogId,String catalogIdPath,
String user,String isUpdate,String shortboardIds)throws Exception{
if(StringUtils.isBlank(driveIndDef.getIndId())) {
return "indId can not be null";
......@@ -53,6 +53,7 @@ public class DriveIndDefService {
driveIndDef.setUpdater(user);
driveIndDef.setUpdateTime(new Date());
driveIndDef.setVersion("1.0");
driveIndDef.setCode(code);
driveIndDef.setCatalogId(catalogId);
driveIndDef.setCatalogIdPath(catalogIdPath);
driveIndDefMapper.insert(driveIndDef);
......@@ -67,6 +68,7 @@ public class DriveIndDefService {
driveIndDef.setUpdater(user);
driveIndDef.setUpdateTime(new Date());
driveIndDef.setVersion(newVersion);
driveIndDef.setCode(code);
driveIndDef.setCatalogId(catalogId);
driveIndDef.setCatalogIdPath(catalogIdPath);
driveIndDefMapper.updateByPrimaryKey(driveIndDef);
......
......@@ -38,7 +38,7 @@ public class IndScorecardService {
private DriveIndCalResultDefMapper driveIndCalResultDefMapper;
//id不为空为修改,为空为新增
public Integer saveOrUpdate(IndScorecard indScorecard,Integer catalogId,
public Integer saveOrUpdate(IndScorecard indScorecard,String code,Integer catalogId,
String catalogIdPath,String user) {
Gson gson = new Gson();
if(!indScorecard.getAddScoreItem().isEmpty()) {
......@@ -59,6 +59,7 @@ public class IndScorecardService {
if(indScorecard.getLessAverage()==null) {
indScorecard.setLessAverage(0.0);
}
indScorecard.setCode(code);
indScorecard.setCatalogId(catalogId);
indScorecard.setCatalogIdPath(catalogIdPath);
indScorecard.setLastUpdater(user);
......
......@@ -42,12 +42,13 @@ public class ScoreRuleService {
private static final Pattern P = Pattern.compile("(\\[[^\\]]*\\])");
public Integer saveOrUpdate(ScoreRule scoreRule,Integer catalogId,String catalogIdPath,String user) {
public Integer saveOrUpdate(ScoreRule scoreRule,String code,Integer catalogId,String catalogIdPath,String user) {
Gson gson = new Gson();
if(!scoreRule.getIndTypeWeights().isEmpty()) {
String indTypeWeightsJson = gson.toJson(scoreRule.getIndTypeWeights());
scoreRule.setIndTypeWeightsJson(indTypeWeightsJson);
}
scoreRule.setCode(code);
scoreRule.setCatalogId(catalogId);
scoreRule.setCatalogIdPath(catalogIdPath);
scoreRule.setLastUpdater(user);
......
......@@ -36,13 +36,14 @@ public class ShortboardRuleService {
@Autowired
private DriveIndDefService driveIndDefService;
public Integer saveOrUpdate(ShortboardRule shortboardRule,Integer catalogId,
public Integer saveOrUpdate(ShortboardRule shortboardRule,String code,Integer catalogId,
String catalogIdPath,String user) {
Gson gson = new Gson();
if(!shortboardRule.getShortboardItem().isEmpty()) {
String shortboardItemJson = gson.toJson(shortboardRule.getShortboardItem());
shortboardRule.setShortboardItemJson(shortboardItemJson);
}
shortboardRule.setCode(code);
shortboardRule.setCatalogId(catalogId);
shortboardRule.setCatalogIdPath(catalogIdPath);
shortboardRule.setLastUpdater(user);
......
......@@ -26,8 +26,9 @@ public class ShortboardUnitService {
@Autowired
private ShortboardRuleService shortboardRuleService;
public Integer saveOrUpdate(ShortboardUnit shortboardUnit,Integer catalogId,
public Integer saveOrUpdate(ShortboardUnit shortboardUnit,String code,Integer catalogId,
String catalogIdPath,String user) {
shortboardUnit.setCode(code);
shortboardUnit.setCatalogId(catalogId);
shortboardUnit.setCatalogIdPath(catalogIdPath);
if(shortboardUnit.getId()==null) {//新增
......
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