Commit 60785873 by zhangkb

修改新增或者修改的接口代码

parent 04b2163f
......@@ -26,7 +26,12 @@ public class DriveIndCalResultService {
private DriveIndCalResultDefMapper driveIndCalResultDefMapper;
public int saveOrUpdate(DriveIndCalResultDef driveIndCalResult) {
return driveIndCalResultDefMapper.insert(driveIndCalResult);
if(driveIndCalResult.getId()==null) {
driveIndCalResultDefMapper.insert(driveIndCalResult);
}else {
driveIndCalResultDefMapper.updateByPrimaryKey(driveIndCalResult);
}
return driveIndCalResult.getId();
}
public DriveIndCalResultDef findById(Integer id) {
......
......@@ -62,7 +62,11 @@ public class IndScorecardService {
indScorecard.setCatalogId(catalogId);
indScorecard.setCatalogIdPath(catalogIdPath);
indScorecard.setLastUpdater(user);
if(indScorecard.getId()==null) {
indScorecardMapper.insert(indScorecard);
}else {
indScorecardMapper.updateByPrimaryKey(indScorecard);
}
return indScorecard.getId();
}
......
......@@ -20,7 +20,6 @@ import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import com.keymobile.indicators.model.entity.DimValue;
......@@ -43,9 +42,6 @@ public class IndicatorsValueService {
@Autowired
private DriveIndCalResultDefMapper driveIndCalResultDefMapper;
@Value("${mongodb.database}")
private String database;
public void fillExcelXianScore(List<String> indIds,int date,
String compareObjString,int groupNum,int type) throws Exception{
String filePath = "D://indicatorsFile/file10.xlsx";
......
......@@ -47,7 +47,11 @@ public class ScoreRuleService {
scoreRule.setCatalogId(catalogId);
scoreRule.setCatalogIdPath(catalogIdPath);
scoreRule.setLastUpdater(user);
if(scoreRule.getId()==null) {
scoreRuleMapper.insert(scoreRule);
}else {
scoreRuleMapper.updateByPrimaryKey(scoreRule);
}
return scoreRule.getId();
}
......
......@@ -43,7 +43,11 @@ public class ShortboardRuleService {
shortboardRule.setCatalogId(catalogId);
shortboardRule.setCatalogIdPath(catalogIdPath);
shortboardRule.setLastUpdater(user);
if(shortboardRule.getId()==null) {
shortboardRuleMapper.insert(shortboardRule);
}else {
shortboardRuleMapper.updateByPrimaryKey(shortboardRule);
}
return shortboardRule.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