Commit 60785873 by zhangkb

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

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