Commit edd8c30c by zhangkb

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

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