Commit 5ec0ad60 authored by Quxl's avatar Quxl

xx

parent 969c8cea
package com.egolm.film.api.service;
public interface FilmService {
void copyFilm(Long member_film_id, Integer adminid);
}
package com.egolm.film.api.service.impl;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import com.egolm.common.jdbc.JdbcTemplate;
import com.egolm.film.api.service.FilmService;
import com.egolm.film.api.service.MemberFilmService;
import com.egolm.film.bean.Fc_film;
import com.egolm.film.bean.Fc_film_enroll;
import com.egolm.film.bean.Fc_member_film;
@Service
public class FilmServiceImpl implements FilmService {
@Autowired
JdbcTemplate jdbcTemplate;
@Autowired
MemberFilmService memberFilmService;
@Value("${opt.project.type}")
private Integer project_type;
@Override
public synchronized void copyFilm(Long member_film_id, Integer adminid) {
Fc_member_film memberFilm = memberFilmService.queryMemberFilmById(member_film_id);
Integer film_id = member_film_id.intValue();
Fc_film film = new Fc_film();
film.setFilm_id(film_id);
film.setAdminid(adminid);
film.setCreate_time(new Date());
film.setCn_name(memberFilm.getCn_name());
film.setCo_production_country(memberFilm.getCo_production_country());
film.setColor_tag(memberFilm.getFilm_medium());
film.setCompletion_date(memberFilm.getCompletion_date());
film.setDialogue_lang(memberFilm.getDialogue_lang());
film.setEn_intro(memberFilm.getEn_intro());
film.setEn_name(memberFilm.getEn_name());
film.setFilm_country(memberFilm.getFilm_country());
film.setFilm_total_time(memberFilm.getFilm_total_time());
film.setFilm_medium(memberFilm.getFilm_format());
film.setFilm_online_address(memberFilm.getFilm_format_url());
film.setFilm_online_password(memberFilm.getFilm_format_passw());
film.setFilm_producers(memberFilm.getFilm_producers());
film.setFilm_type_id(Integer.valueOf(memberFilm.getFilm_type_name()));
film.setFirst_play_address(memberFilm.getFirst_show_city());
film.setIntro(memberFilm.getIntro());
film.setIs_like_show(memberFilm.getIs_like_show());
film.setOrigion_name(memberFilm.getOrigion_name());
film.setPlay_shanghai(memberFilm.getPlay_shanghai());
film.setPrize(memberFilm.getPrize());
film.setProduction_company(memberFilm.getProduction_company());
film.setShow_date(memberFilm.getShow_date());
film.setShow_time(memberFilm.getShow_time());
film.setState(0);
film.setSubtitle_lang(memberFilm.getSubtitle_lang());
film.setType(project_type);
List<Fc_film_enroll> enrolls = new ArrayList<Fc_film_enroll>();
String enroll_types = memberFilm.getEnroll_type_name();
if(enroll_types != null) {
String[] strs = enroll_types.split(",");
if(strs != null && strs.length > 0) {
for(String str : strs) {
if(str != null && str.matches("\\d+")) {
Fc_film_enroll enroll = new Fc_film_enroll();
enroll.setFilm_enroll_id(Integer.valueOf(str));
enroll.setFilm_id(film_id);
enrolls.add(enroll);
}
}
}
}
jdbcTemplate.save(film);
jdbcTemplate.batchSave(enrolls);
}
}
......@@ -21,6 +21,7 @@ import com.egolm.common.jdbc.Page;
import com.egolm.common.web.ServletUtil;
import com.egolm.film.api.service.MemberFilmService;
import com.egolm.film.api.service.Messages;
import com.egolm.film.bean.Fc_film_enroll;
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_issuer;
......@@ -75,6 +76,7 @@ public class MemberFilmServiceImpl implements MemberFilmService {
}
@Override
@Transactional
public Long saveMemberFilmType(
Integer member_id,
String film_type_name,
......@@ -109,6 +111,25 @@ public class MemberFilmServiceImpl implements MemberFilmService {
return ps;
}
}, keyHolder);
Long film_id = keyHolder.getKey().longValue();
List<Fc_film_enroll> enrolls = new ArrayList<Fc_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_film_enroll enroll = new Fc_film_enroll();
enroll.setFilm_enroll_id(Integer.valueOf(str));
enroll.setFilm_id(film_id);
enrolls.add(enroll);
}
}
}
}
jdbcTemplate.save(enrolls);
return keyHolder.getKey().longValue();
}
......
......@@ -13,13 +13,11 @@ import org.springframework.web.bind.annotation.ResponseBody;
import com.egolm.common.bean.Rjx;
import com.egolm.common.jdbc.Page;
import com.egolm.film.api.service.AdminTokenService;
import com.egolm.film.api.service.FilmService;
import com.egolm.film.api.service.MemberFilmService;
import com.egolm.film.bean.Fc_member_film;
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;
import com.egolm.film.model.LoginToken;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
......@@ -36,9 +34,6 @@ import io.swagger.annotations.ApiOperation;
@RequestMapping("admin/first")
public class AdminFirstController {
@Autowired
FilmService service;
@Autowired
MemberFilmService memberFilmService;
......@@ -93,10 +88,7 @@ public class AdminFirstController {
@ApiImplicitParam(paramType="query", dataType="long", required=false, name="member_film_id", value="申报影片ID"),
})
public Object pass(Long member_film_id) {
LoginToken loginToken = tokenService.getToken();
Integer adminid = (Integer)loginToken.getId();
memberFilmService.pass(member_film_id);
service.copyFilm(member_film_id, adminid);
return Rjx.jsonOk();
}
......
......@@ -15,7 +15,7 @@ public class Fc_film_enroll implements java.io.Serializable {
private static final long serialVersionUID = 1L;
@Id
private Integer film_id;
private Long film_id;
@Id
private Integer film_enroll_id;
......@@ -33,16 +33,16 @@ public class Fc_film_enroll implements java.io.Serializable {
* @param film_id
* @param film_enroll_id
*/
public Fc_film_enroll(Integer film_id, Integer film_enroll_id) {
public Fc_film_enroll(Long film_id, Integer film_enroll_id) {
this.film_id = film_id;
this.film_enroll_id = film_enroll_id;
}
public void setFilm_id(Integer film_id) {
public void setFilm_id(Long film_id) {
this.film_id = film_id;
}
public Integer getFilm_id() {
public Long getFilm_id() {
return film_id;
}
......
package com.egolm.film.bean;
import javax.persistence.Entity;
import javax.persistence.Id;
import java.util.Date;
/**
* @author 曲欣亮
* @since 2018-11-23
* @version v-1.0
*/
@Entity(name="fc_film_issuer")
public class Fc_film_issuer implements java.io.Serializable {
private static final long serialVersionUID = 1L;
@Id
private Integer id;
/**
* 报名影片ID
*/
private Integer film_id;
/**
* 发行公司
*/
private String issuer_company;
/**
* 联系人
*/
private String issuer_contacts;
/**
* 邮箱
*/
private String issuer_email;
/**
* 电话
*/
private String issuer_tel;
private Date create_time;
/**
* 无参数构造方法
*/
public Fc_film_issuer () {
super();
}
/**
* 全参数构造方法
* @param id
* @param film_id 报名影片ID
* @param issuer_company 发行公司
* @param issuer_contacts 联系人
* @param issuer_email 邮箱
* @param issuer_tel 电话
* @param create_time
*/
public Fc_film_issuer(Integer id, Integer film_id, String issuer_company, String issuer_contacts, String issuer_email, String issuer_tel, Date create_time) {
this.id = id;
this.film_id = film_id;
this.issuer_company = issuer_company;
this.issuer_contacts = issuer_contacts;
this.issuer_email = issuer_email;
this.issuer_tel = issuer_tel;
this.create_time = create_time;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getId() {
return id;
}
public void setFilm_id(Integer film_id) {
this.film_id = film_id;
}
public Integer getFilm_id() {
return film_id;
}
public void setIssuer_company(String issuer_company) {
this.issuer_company = issuer_company;
}
public String getIssuer_company() {
return issuer_company;
}
public void setIssuer_contacts(String issuer_contacts) {
this.issuer_contacts = issuer_contacts;
}
public String getIssuer_contacts() {
return issuer_contacts;
}
public void setIssuer_email(String issuer_email) {
this.issuer_email = issuer_email;
}
public String getIssuer_email() {
return issuer_email;
}
public void setIssuer_tel(String issuer_tel) {
this.issuer_tel = issuer_tel;
}
public String getIssuer_tel() {
return issuer_tel;
}
public void setCreate_time(Date create_time) {
this.create_time = create_time;
}
public Date getCreate_time() {
return create_time;
}
}
package com.egolm.film.bean;
import javax.persistence.Entity;
import javax.persistence.Id;
import java.util.Date;
/**
* @author 曲欣亮
* @since 2018-11-23
* @version v-1.0
*/
@Entity(name="fc_film_playactor")
public class Fc_film_playactor implements java.io.Serializable {
private static final long serialVersionUID = 1L;
@Id
private Integer id;
/**
* 报名影片ID
*/
private Integer film_id;
/**
* 演职人员类型(女演员,男演员,制片人,编剧,摄影师,导演)
*/
private String playactor_type;
/**
* 姓名
*/
private String playactor_name;
/**
* 国籍
*/
private String playactor_country;
/**
* 出生年月
*/
private String playactor_birthday;
/**
* 参与过哪部影片
*/
private String playactor_film_intro;
/**
* 该片为第几部长片(包括配角)
*/
private String playactor_film_nums;
/**
* 饰演的角色名
*/
private String playactor_role_name;
private Date create_time;
/**
* 无参数构造方法
*/
public Fc_film_playactor () {
super();
}
/**
* 全参数构造方法
* @param id
* @param film_id 报名影片ID
* @param playactor_type 演职人员类型(女演员,男演员,制片人,编剧,摄影师,导演)
* @param playactor_name 姓名
* @param playactor_country 国籍
* @param playactor_birthday 出生年月
* @param playactor_film_intro 参与过哪部影片
* @param playactor_film_nums 该片为第几部长片(包括配角)
* @param playactor_role_name 饰演的角色名
* @param create_time
*/
public Fc_film_playactor(Integer id, Integer film_id, String playactor_type, String playactor_name, String playactor_country, String playactor_birthday, String playactor_film_intro, String playactor_film_nums, String playactor_role_name, Date create_time) {
this.id = id;
this.film_id = film_id;
this.playactor_type = playactor_type;
this.playactor_name = playactor_name;
this.playactor_country = playactor_country;
this.playactor_birthday = playactor_birthday;
this.playactor_film_intro = playactor_film_intro;
this.playactor_film_nums = playactor_film_nums;
this.playactor_role_name = playactor_role_name;
this.create_time = create_time;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getId() {
return id;
}
public void setFilm_id(Integer film_id) {
this.film_id = film_id;
}
public Integer getFilm_id() {
return film_id;
}
public void setPlayactor_type(String playactor_type) {
this.playactor_type = playactor_type;
}
public String getPlayactor_type() {
return playactor_type;
}
public void setPlayactor_name(String playactor_name) {
this.playactor_name = playactor_name;
}
public String getPlayactor_name() {
return playactor_name;
}
public void setPlayactor_country(String playactor_country) {
this.playactor_country = playactor_country;
}
public String getPlayactor_country() {
return playactor_country;
}
public void setPlayactor_birthday(String playactor_birthday) {
this.playactor_birthday = playactor_birthday;
}
public String getPlayactor_birthday() {
return playactor_birthday;
}
public void setPlayactor_film_intro(String playactor_film_intro) {
this.playactor_film_intro = playactor_film_intro;
}
public String getPlayactor_film_intro() {
return playactor_film_intro;
}
public void setPlayactor_film_nums(String playactor_film_nums) {
this.playactor_film_nums = playactor_film_nums;
}
public String getPlayactor_film_nums() {
return playactor_film_nums;
}
public void setPlayactor_role_name(String playactor_role_name) {
this.playactor_role_name = playactor_role_name;
}
public String getPlayactor_role_name() {
return playactor_role_name;
}
public void setCreate_time(Date create_time) {
this.create_time = create_time;
}
public Date getCreate_time() {
return create_time;
}
}
package com.egolm.film.bean;
import javax.persistence.Entity;
import javax.persistence.Id;
import java.util.Date;
/**
* @author 曲欣亮
* @since 2018-11-23
* @version v-1.0
*/
@Entity(name="fc_film_show")
public class Fc_film_show implements java.io.Serializable {
private static final long serialVersionUID = 1L;
@Id
private Integer id;
/**
* 报名影片ID
*/
private Integer film_id;
/**
* 参加过什么电影节
*/
private String show_filmfest;
/**
* 参与类型
*/
private String show_filmfest_type;
/**
* 时间
*/
private String show_filmfest_date;
/**
* 简介(获奖或报名奖项等)
*/
private String show_filmfest_intro;
private Date create_time;
/**
* 无参数构造方法
*/
public Fc_film_show () {
super();
}
/**
* 全参数构造方法
* @param id
* @param film_id 报名影片ID
* @param show_filmfest 参加过什么电影节
* @param show_filmfest_type 参与类型
* @param show_filmfest_date 时间
* @param show_filmfest_intro 简介(获奖或报名奖项等)
* @param create_time
*/
public Fc_film_show(Integer id, Integer film_id, String show_filmfest, String show_filmfest_type, String show_filmfest_date, String show_filmfest_intro, Date create_time) {
this.id = id;
this.film_id = film_id;
this.show_filmfest = show_filmfest;
this.show_filmfest_type = show_filmfest_type;
this.show_filmfest_date = show_filmfest_date;
this.show_filmfest_intro = show_filmfest_intro;
this.create_time = create_time;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getId() {
return id;
}
public void setFilm_id(Integer film_id) {
this.film_id = film_id;
}
public Integer getFilm_id() {
return film_id;
}
public void setShow_filmfest(String show_filmfest) {
this.show_filmfest = show_filmfest;
}
public String getShow_filmfest() {
return show_filmfest;
}
public void setShow_filmfest_type(String show_filmfest_type) {
this.show_filmfest_type = show_filmfest_type;
}
public String getShow_filmfest_type() {
return show_filmfest_type;
}
public void setShow_filmfest_date(String show_filmfest_date) {
this.show_filmfest_date = show_filmfest_date;
}
public String getShow_filmfest_date() {
return show_filmfest_date;
}
public void setShow_filmfest_intro(String show_filmfest_intro) {
this.show_filmfest_intro = show_filmfest_intro;
}
public String getShow_filmfest_intro() {
return show_filmfest_intro;
}
public void setCreate_time(Date create_time) {
this.create_time = create_time;
}
public Date getCreate_time() {
return create_time;
}
}
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