Commit ab3a6b57 authored by Quxl's avatar Quxl

x

parent 3e342232
......@@ -117,6 +117,8 @@ public interface FilmService {
*/
void updateFilmBase(Fc_member_film_base_model filmBase);
void updateEnroll(Long member_film_id);
/**
* 进入下一个审片环节
* @param member_film_id
......
......@@ -422,6 +422,7 @@ public class FilmServiceImpl implements FilmService {
@Override
public void pass(Long member_film_id) {
this.updateEnroll(member_film_id);
String sql = "update fc_member_film set apply_state = ?, pass_time = ? where id = ?";
jdbcTemplate.executeUpdate(sql, 2, System.currentTimeMillis()/1000L, member_film_id);
}
......@@ -450,7 +451,16 @@ public class FilmServiceImpl implements FilmService {
@Override
@Transactional
public void updateFilmBase(Fc_member_film_base_model filmBase) {
String enroll_type_name_other = filmBase.getEnroll_type_name_other();
this.updateEnroll(filmBase.getMember_film_id());
jdbcTemplate.update(filmBase);
}
@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);
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>();
if(enroll_type_name_other != null) {
String[] strs = enroll_type_name_other.split(",");
......@@ -459,13 +469,12 @@ public class FilmServiceImpl implements FilmService {
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(filmBase.getMember_film_id().intValue());
ext.setFilm_id(member_film_id.intValue());
exts.add(ext);
}
}
}
}
String enroll_type_name = filmBase.getEnroll_type_name();
List<Fc_member_film_enroll> enrolls = new ArrayList<Fc_member_film_enroll>();
if(enroll_type_name != null) {
String[] strs = enroll_type_name.split(",");
......@@ -474,21 +483,20 @@ public class FilmServiceImpl implements FilmService {
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(filmBase.getMember_film_id().intValue());
enroll.setFilm_id(member_film_id.intValue());
enrolls.add(enroll);
}
}
}
}
jdbcTemplate.executeUpdate("delete from fc_member_film_enroll where film_id = ?", filmBase.getMember_film_id());
jdbcTemplate.executeUpdate("delete from fc_member_film_enroll_ext where film_id = ?", filmBase.getMember_film_id());
jdbcTemplate.executeUpdate("delete from fc_member_film_enroll where film_id = ?", member_film_id);
jdbcTemplate.executeUpdate("delete from fc_member_film_enroll_ext where film_id = ?", member_film_id);
if(enrolls.size() > 0) {
jdbcTemplate.batchSave(enrolls);
}
if(exts.size() > 0) {
jdbcTemplate.batchSave(exts);
}
jdbcTemplate.update(filmBase);
}
@Override
......
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