Commit de09544f authored by 曲欣红's avatar 曲欣红

修改

parent a4c013eb
...@@ -57,7 +57,9 @@ public class ThemeTemplateServiceImpl implements ThemeTemplateService{ ...@@ -57,7 +57,9 @@ public class ThemeTemplateServiceImpl implements ThemeTemplateService{
public TPlatformTheme selectByNO(String themeNO, String LangID) { public TPlatformTheme selectByNO(String themeNO, String LangID) {
try{ try{
String sql = "select * from tPlatformTheme where sThemeNO = ?"; String sql = "select * from tPlatformTheme where sThemeNO = ?";
return jdbcTemplate.queryForBean(sql, TPlatformTheme.class, themeNO); TPlatformTheme theme = jdbcTemplate.queryForBean(sql, TPlatformTheme.class, themeNO);
System.out.println(theme);
return theme;
}catch(Exception e){ }catch(Exception e){
throw new XException(I18NUtils.getMessage(LangID, "Msg_Query_Error"), e);//查询失败 throw new XException(I18NUtils.getMessage(LangID, "Msg_Query_Error"), e);//查询失败
} }
...@@ -75,11 +77,27 @@ public class ThemeTemplateServiceImpl implements ThemeTemplateService{ ...@@ -75,11 +77,27 @@ public class ThemeTemplateServiceImpl implements ThemeTemplateService{
public TPlatformTheme update(TPlatformTheme theme, String LangID) { public TPlatformTheme update(TPlatformTheme theme, String LangID) {
try{ try{
String sThemeNO = theme.getsThemeNO(); String sThemeNO = theme.getsThemeNO();
boolean haveTheme = haveTheme(sThemeNO); TPlatformTheme oldTheme;
if(!haveTheme){ try{
oldTheme = selectByNO(sThemeNO, LangID);
}catch(Exception e){
throw new XException(I18NUtils.getMessage(LangID, "Msg_No_Template")+": "+sThemeNO);//无此模板 throw new XException(I18NUtils.getMessage(LangID, "Msg_No_Template")+": "+sThemeNO);//无此模板
} }
String sql = "update tPlatformTheme set sThemeName = ?, sThemeAuthor = ?, sCaption = ?, sThemeJson = ?, sSnapshot1 = ?, sSnapshot2 = ?, sSnapshot3 = ?, sMemo = ?, nTag = ?, sUpdateUser = ?, dUpdateDate = ?, dLastUpdateTime = ? where sThemeNO = ?"; oldTheme.setsThemeName(theme.getsThemeName());
oldTheme.setsThemeAuthor(theme.getsThemeAuthor());
oldTheme.setsCaption(theme.getsCaption());
oldTheme.setsThemeJson(theme.getsThemeJson());
oldTheme.setsSnapshot1(theme.getsSnapshot1());
oldTheme.setsSnapshot2(theme.getsSnapshot2());
oldTheme.setsSnapshot3(theme.getsSnapshot3());
oldTheme.setsMemo(theme.getsMemo());
oldTheme.setnTag(theme.getnTag());
oldTheme.setsUpdateUser(theme.getsUpdateUser());
oldTheme.setdUpdateDate(theme.getdUpdateDate());
oldTheme.setdLastUpdateTime(theme.getdLastUpdateTime());
oldTheme.setsThemeNO(sThemeNO);
jdbcTemplate.update(oldTheme);
/*String sql = "update tPlatformTheme set sThemeName = ?, sThemeAuthor = ?, sCaption = ?, sThemeJson = ?, sSnapshot1 = ?, sSnapshot2 = ?, sSnapshot3 = ?, sMemo = ?, nTag = ?, sUpdateUser = ?, dUpdateDate = ?, dLastUpdateTime = ? where sThemeNO = ?";
jdbcTemplate.update( jdbcTemplate.update(
sql, sql,
theme.getsThemeName(), theme.getsThemeName(),
...@@ -95,7 +113,7 @@ public class ThemeTemplateServiceImpl implements ThemeTemplateService{ ...@@ -95,7 +113,7 @@ public class ThemeTemplateServiceImpl implements ThemeTemplateService{
theme.getdUpdateDate(), theme.getdUpdateDate(),
theme.getdLastUpdateTime(), theme.getdLastUpdateTime(),
sThemeNO sThemeNO
); );*/
}catch(Exception e){ }catch(Exception e){
throw new XException(I18NUtils.getMessage(LangID, "Msg_Update_Error"));//修改失败 throw new XException(I18NUtils.getMessage(LangID, "Msg_Update_Error"));//修改失败
} }
......
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