Commit 4e0f9e55 authored by Quxl's avatar Quxl

x

parent 9e187e58
......@@ -119,23 +119,7 @@ public class FilmServiceImpl implements FilmService {
}, keyHolder);
Long film_id = keyHolder.getKey().longValue();
List<Fc_member_film_enroll> enrolls = new ArrayList<Fc_member_film_enroll>();
if(enroll_type_name != null) {
String[] strs = enroll_type_name.split(",");
if(strs != null && strs.length > 0) {
for(String str : strs) {
if(str != null && str.matches("\\d+")) {
Fc_member_film_enroll enroll = new Fc_member_film_enroll();
enroll.setEnroll_type_id(Integer.valueOf(str));
enroll.setFilm_id(film_id.intValue());
enrolls.add(enroll);
}
}
}
}
jdbcTemplate.batchSave(enrolls);
this.updateEnroll(film_id);
return keyHolder.getKey().longValue();
}
......@@ -152,24 +136,7 @@ public class FilmServiceImpl implements FilmService {
String sql = "update fc_member_film set enroll_type_name_other = ?, cn_name = ?, en_name = ?, intro = ?, last_modify_time = ? where member_id = ? and id = ?";
String string = StringUtil.join(",", "", "", "", enroll_type_name_other);
Object[] args = new Object[]{string, cn_name, en_name, intro, last_modify_time, member_id, member_film_id};
List<Fc_member_film_enroll_ext> exts = new ArrayList<Fc_member_film_enroll_ext>();
if(enroll_type_name_other != null && enroll_type_name_other.length > 0) {
for(String str : enroll_type_name_other) {
if(str != null && str.matches("\\d+")) {
Fc_member_film_enroll_ext ext = new Fc_member_film_enroll_ext();
ext.setEnroll_type_ext_id(Integer.valueOf(str));
ext.setFilm_id(member_film_id.intValue());
exts.add(ext);
}
}
}
jdbcTemplate.executeUpdate("delete from fc_member_film_enroll_ext where film_id = ?", member_film_id.intValue());
if(exts != null && exts.size() > 0) {
jdbcTemplate.batchSave(exts);
}
this.updateEnroll(member_film_id);
jdbcTemplate.executeUpdate(sql, args);
}
......@@ -458,7 +425,7 @@ public class FilmServiceImpl implements FilmService {
@Override
@Transactional
public void updateEnroll(Long member_film_id) {
Fc_member_film film = jdbcTemplate.queryForBean("select * from fc_member_film where id = ?", Fc_member_film.class, member_film_id);
Fc_member_film film = jdbcTemplate.queryForBean("select enroll_type_name, enroll_type_name_other from fc_member_film where id = ?", Fc_member_film.class, member_film_id);
String enroll_type_name_other = film.getEnroll_type_name_other();
String enroll_type_name = film.getEnroll_type_name();
List<Fc_member_film_enroll_ext> exts = new ArrayList<Fc_member_film_enroll_ext>();
......
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