Commit 841545f0 authored by Quxl's avatar Quxl

xx

parent dfdc1a56
......@@ -24,6 +24,7 @@ import com.egolm.film.api.service.Messages;
import com.egolm.film.bean.Fc_member_film;
import com.egolm.film.bean.Fc_member_film_all;
import com.egolm.film.bean.Fc_member_film_enroll;
import com.egolm.film.bean.Fc_member_film_enroll_ext;
import com.egolm.film.bean.Fc_member_film_issuer;
import com.egolm.film.bean.Fc_member_film_playactor;
import com.egolm.film.bean.Fc_member_film_show;
......@@ -135,6 +136,7 @@ public class FilmServiceImpl implements FilmService {
}
@Override
@Transactional
public void saveMemberFilmBase(
Integer member_id,
Long member_film_id,
......@@ -144,8 +146,24 @@ public class FilmServiceImpl implements FilmService {
String intro) {
Long last_modify_time = System.currentTimeMillis()/1000;
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 str = StringUtil.join(",", "", "", "", enroll_type_name_other);
Object[] args = new Object[]{str, cn_name, en_name, intro, last_modify_time, member_id, member_film_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());
jdbcTemplate.batchSave(exts);
jdbcTemplate.executeUpdate(sql, args);
}
......@@ -424,7 +442,42 @@ 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();
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(",");
if(strs != null && strs.length > 0) {
for(String str : strs) {
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());
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(",");
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(filmBase.getMember_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.batchSave(enrolls);
jdbcTemplate.batchSave(exts);
jdbcTemplate.update(filmBase);
}
......
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