Commit 61bf6d99 authored by Quxl's avatar Quxl

优化申报接口

parent 3f766930
...@@ -49,14 +49,15 @@ public class MemberApplyController { ...@@ -49,14 +49,15 @@ public class MemberApplyController {
@ResponseBody @ResponseBody
@PostMapping("save_type") @PostMapping("save_type")
@ApiOperation("保存申报影片类型") @ApiOperation("新增影片,并保存申报影片类型")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(paramType = "query", dataType = "long", required = true, name = "member_film_id", value="影片ID"),
@ApiImplicitParam(paramType = "query", dataType = "string", required = true, name = "film_type_name", value="影片类型"), @ApiImplicitParam(paramType = "query", dataType = "string", required = true, name = "film_type_name", value="影片类型"),
@ApiImplicitParam(paramType = "query", dataType = "string", required = true, name = "enroll_type_name", value="影片性质"), @ApiImplicitParam(paramType = "query", dataType = "string", required = true, name = "enroll_type_name", value="影片性质"),
}) })
public Object saveMemberFilmType(Long member_film_id, String film_type_name, String enroll_type_name) { public Object saveMemberFilmType(String film_type_name, String enroll_type_name) {
member_film_id = memberService.saveMemberFilmType(member_film_id, film_type_name, enroll_type_name); LoginToken loginToken = tokenService.getToken();
Integer member_id = (Integer)loginToken.getId();
Long member_film_id = memberService.saveMemberFilmType(member_id, film_type_name, enroll_type_name);
return Rjx.jsonOk().set("member_film_id", member_film_id); return Rjx.jsonOk().set("member_film_id", member_film_id);
} }
...@@ -70,7 +71,9 @@ public class MemberApplyController { ...@@ -70,7 +71,9 @@ public class MemberApplyController {
@ApiImplicitParam(paramType = "query", dataType = "string", required = true, name = "cn_name", value="英文名称"), @ApiImplicitParam(paramType = "query", dataType = "string", required = true, name = "cn_name", value="英文名称"),
}) })
public Object saveMemberFilmBase(Long member_film_id, String[] enroll_type_name_other, String cn_name, String en_name, String intro) { public Object saveMemberFilmBase(Long member_film_id, String[] enroll_type_name_other, String cn_name, String en_name, String intro) {
memberService.saveMemberFilmBase(member_film_id, enroll_type_name_other, cn_name, en_name, intro); LoginToken loginToken = tokenService.getToken();
Integer member_id = (Integer)loginToken.getId();
memberService.saveMemberFilmBase(member_id, member_film_id, enroll_type_name_other, cn_name, en_name, intro);
return Rjx.jsonOk(); return Rjx.jsonOk();
} }
...@@ -100,7 +103,11 @@ public class MemberApplyController { ...@@ -100,7 +103,11 @@ public class MemberApplyController {
String show_date, String show_date,
String film_medium, String film_medium,
String film_format) { String film_format) {
LoginToken loginToken = tokenService.getToken();
Integer member_id = (Integer)loginToken.getId();
memberService.saveMemberFilmInfo( memberService.saveMemberFilmInfo(
member_id,
member_film_id, member_film_id,
film_country, film_country,
dialogue_lang, dialogue_lang,
...@@ -137,7 +144,11 @@ public class MemberApplyController { ...@@ -137,7 +144,11 @@ public class MemberApplyController {
String[] playactor_birthday, String[] playactor_birthday,
String[] playactor_intro, String[] playactor_intro,
Integer[] is_play_shanghai) { Integer[] is_play_shanghai) {
LoginToken loginToken = tokenService.getToken();
Integer member_id = (Integer)loginToken.getId();
memberService.saveMemberFilmPlayactor( memberService.saveMemberFilmPlayactor(
member_id,
member_film_id, member_film_id,
playactor_type, playactor_type,
playactor_name, playactor_name,
...@@ -166,7 +177,11 @@ public class MemberApplyController { ...@@ -166,7 +177,11 @@ public class MemberApplyController {
String[] issuer_contacts, String[] issuer_contacts,
String[] issuer_email, String[] issuer_email,
String[] issuer_tel) { String[] issuer_tel) {
LoginToken loginToken = tokenService.getToken();
Integer member_id = (Integer)loginToken.getId();
memberService.saveMemberFilmIssuer( memberService.saveMemberFilmIssuer(
member_id,
member_film_id, member_film_id,
issuer_company, issuer_company,
issuer_contacts, issuer_contacts,
...@@ -192,7 +207,11 @@ public class MemberApplyController { ...@@ -192,7 +207,11 @@ public class MemberApplyController {
String[] show_filmfest, String[] show_filmfest,
String[] show_filmfest_type, String[] show_filmfest_type,
String[] show_filmfest_intro) { String[] show_filmfest_intro) {
LoginToken loginToken = tokenService.getToken();
Integer member_id = (Integer)loginToken.getId();
memberService.saveMemberFilmShow( memberService.saveMemberFilmShow(
member_id,
member_film_id, member_film_id,
play_shanghai, play_shanghai,
show_filmfest, show_filmfest,
...@@ -221,7 +240,11 @@ public class MemberApplyController { ...@@ -221,7 +240,11 @@ public class MemberApplyController {
String film_apply_tel, String film_apply_tel,
String film_apply_mobile, String film_apply_mobile,
String film_apply_country) { String film_apply_country) {
LoginToken loginToken = tokenService.getToken();
Integer member_id = (Integer)loginToken.getId();
memberService.saveMemberFilmCompany( memberService.saveMemberFilmCompany(
member_id,
member_film_id, member_film_id,
film_apply_company, film_apply_company,
film_apply_realname, film_apply_realname,
......
...@@ -54,11 +54,12 @@ public interface MemberService { ...@@ -54,11 +54,12 @@ public interface MemberService {
Fc_member_film_all queryMoreByNo(String no); Fc_member_film_all queryMoreByNo(String no);
Long saveMemberFilmType( Long saveMemberFilmType(
Long member_film_id, Integer member_id,
String film_type_name, String film_type_name,
String enroll_type_name); String enroll_type_name);
void saveMemberFilmBase( void saveMemberFilmBase(
Integer member_id,
Long member_film_id, Long member_film_id,
String[] enroll_type_name_other, String[] enroll_type_name_other,
String cn_name, String cn_name,
...@@ -66,6 +67,7 @@ public interface MemberService { ...@@ -66,6 +67,7 @@ public interface MemberService {
String intro); String intro);
void saveMemberFilmInfo( void saveMemberFilmInfo(
Integer member_id,
Long member_film_id, Long member_film_id,
String film_country, String film_country,
String dialogue_lang, String dialogue_lang,
...@@ -78,6 +80,7 @@ public interface MemberService { ...@@ -78,6 +80,7 @@ public interface MemberService {
String film_format); String film_format);
void saveMemberFilmPlayactor( void saveMemberFilmPlayactor(
Integer member_id,
Long member_film_id, Long member_film_id,
String[] playactor_type, String[] playactor_type,
String[] playactor_name, String[] playactor_name,
...@@ -88,6 +91,7 @@ public interface MemberService { ...@@ -88,6 +91,7 @@ public interface MemberService {
Integer[] is_play_shanghai); Integer[] is_play_shanghai);
void saveMemberFilmIssuer( void saveMemberFilmIssuer(
Integer member_id,
Long member_film_id, Long member_film_id,
String[] issuer_company, String[] issuer_company,
String[] issuer_contacts, String[] issuer_contacts,
...@@ -95,6 +99,7 @@ public interface MemberService { ...@@ -95,6 +99,7 @@ public interface MemberService {
String[] issuer_tel); String[] issuer_tel);
void saveMemberFilmShow( void saveMemberFilmShow(
Integer member_id,
Long member_film_id, Long member_film_id,
String play_shanghai, String play_shanghai,
String[] show_filmfest, String[] show_filmfest,
...@@ -102,6 +107,7 @@ public interface MemberService { ...@@ -102,6 +107,7 @@ public interface MemberService {
String[] show_filmfest_intro); String[] show_filmfest_intro);
void saveMemberFilmCompany( void saveMemberFilmCompany(
Integer member_id,
Long member_film_id, Long member_film_id,
String film_apply_company, String film_apply_company,
String film_apply_realname, String film_apply_realname,
......
...@@ -153,7 +153,7 @@ public class MemberServiceImpl implements MemberService { ...@@ -153,7 +153,7 @@ public class MemberServiceImpl implements MemberService {
@Override @Override
public Long saveMemberFilmType( public Long saveMemberFilmType(
Long member_film_id, Integer member_id,
String film_type_name, String film_type_name,
String enroll_type_name) { String enroll_type_name) {
...@@ -166,7 +166,7 @@ public class MemberServiceImpl implements MemberService { ...@@ -166,7 +166,7 @@ public class MemberServiceImpl implements MemberService {
Long last_modify_time = create_time; Long last_modify_time = create_time;
String create_ip = ServletUtil.remoteIp(WebMvcConfig.getRequest()); String create_ip = ServletUtil.remoteIp(WebMvcConfig.getRequest());
String sql = "insert into fc_member_film (film_type_name, enroll_type_name, film_group_id, state, is_show, apply_state, is_check_director, create_time, create_ip, last_modify_time) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"; String sql = "insert into fc_member_film (member_id, film_type_name, enroll_type_name, film_group_id, state, is_show, apply_state, is_check_director, create_time, create_ip, last_modify_time) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
Object[] args = new Object[]{film_type_name, enroll_type_name, film_group_id, state, is_show, apply_state, is_check_director, create_time, create_ip, last_modify_time}; Object[] args = new Object[]{film_type_name, enroll_type_name, film_group_id, state, is_show, apply_state, is_check_director, create_time, create_ip, last_modify_time};
KeyHolder keyHolder = new GeneratedKeyHolder(); KeyHolder keyHolder = new GeneratedKeyHolder();
jdbcTemplate.update(new PreparedStatementCreator() { jdbcTemplate.update(new PreparedStatementCreator() {
...@@ -191,20 +191,22 @@ public class MemberServiceImpl implements MemberService { ...@@ -191,20 +191,22 @@ public class MemberServiceImpl implements MemberService {
@Override @Override
public void saveMemberFilmBase( public void saveMemberFilmBase(
Integer member_id,
Long member_film_id, Long member_film_id,
String[] enroll_type_name_other, String[] enroll_type_name_other,
String cn_name, String cn_name,
String en_name, String en_name,
String intro) { String intro) {
Long last_modify_time = System.currentTimeMillis(); Long last_modify_time = System.currentTimeMillis();
String sql = "update fc_member_film set enroll_type_name_other = ?, cn_name = ?, en_name = ?, intro = ?, last_modify_time = ? where id = ?"; String sql = "update fc_member_film set enroll_type_name_other = ?, cn_name = ?, en_name = ?, intro = ?, last_modify_time = ? and where member_id = ? id = ?";
String str = StringUtil.join(",", "", "", "", enroll_type_name_other); String str = StringUtil.join(",", "", "", "", enroll_type_name_other);
Object[] args = new Object[]{str, cn_name, en_name, intro, last_modify_time, member_film_id}; Object[] args = new Object[]{str, cn_name, en_name, intro, last_modify_time, member_id, member_film_id};
jdbcTemplate.executeUpdate(sql, args); jdbcTemplate.executeUpdate(sql, args);
} }
@Override @Override
public void saveMemberFilmInfo( public void saveMemberFilmInfo(
Integer member_id,
Long member_film_id, Long member_film_id,
String film_country, String film_country,
String dialogue_lang, String dialogue_lang,
...@@ -217,14 +219,15 @@ public class MemberServiceImpl implements MemberService { ...@@ -217,14 +219,15 @@ public class MemberServiceImpl implements MemberService {
String film_format) { String film_format) {
Long last_modify_time = System.currentTimeMillis(); Long last_modify_time = System.currentTimeMillis();
String sql = "update fc_member_film set film_country = ?, dialogue_lang = ?, subtitle_lang = ?, co_production_country = ?, film_total_time = ?, completion_date = ?, show_date = ?, film_medium = ?, film_format = ?, last_modify_time = ? where id = ?"; String sql = "update fc_member_film set film_country = ?, dialogue_lang = ?, subtitle_lang = ?, co_production_country = ?, film_total_time = ?, completion_date = ?, show_date = ?, film_medium = ?, film_format = ?, last_modify_time = ? where member_id = ? and id = ?";
String str = StringUtil.join(",", "", "", "", co_production_country); String str = StringUtil.join(",", "", "", "", co_production_country);
Object[] args = new Object[]{str, film_country, dialogue_lang, subtitle_lang, str, film_total_time, completion_date, show_date, film_medium, film_format, last_modify_time, member_film_id}; Object[] args = new Object[]{str, film_country, dialogue_lang, subtitle_lang, str, film_total_time, completion_date, show_date, film_medium, film_format, last_modify_time, member_id, member_film_id};
jdbcTemplate.executeUpdate(sql, args); jdbcTemplate.executeUpdate(sql, args);
} }
@Override @Override
public void saveMemberFilmPlayactor( public void saveMemberFilmPlayactor(
Integer member_id,
Long member_film_id, Long member_film_id,
String[] playactor_type, String[] playactor_type,
String[] playactor_name, String[] playactor_name,
...@@ -302,6 +305,7 @@ public class MemberServiceImpl implements MemberService { ...@@ -302,6 +305,7 @@ public class MemberServiceImpl implements MemberService {
@Override @Override
public void saveMemberFilmIssuer( public void saveMemberFilmIssuer(
Integer member_id,
Long member_film_id, Long member_film_id,
String[] issuer_company, String[] issuer_company,
String[] issuer_contacts, String[] issuer_contacts,
...@@ -336,6 +340,7 @@ public class MemberServiceImpl implements MemberService { ...@@ -336,6 +340,7 @@ public class MemberServiceImpl implements MemberService {
@Override @Override
public void saveMemberFilmShow( public void saveMemberFilmShow(
Integer member_id,
Long member_film_id, Long member_film_id,
String play_shanghai, String play_shanghai,
String[] show_filmfest, String[] show_filmfest,
...@@ -348,7 +353,7 @@ public class MemberServiceImpl implements MemberService { ...@@ -348,7 +353,7 @@ public class MemberServiceImpl implements MemberService {
args[i] = new Object[]{member_film_id, show_filmfest[i], show_filmfest_type[i], show_filmfest_intro[i], create_time}; args[i] = new Object[]{member_film_id, show_filmfest[i], show_filmfest_type[i], show_filmfest_intro[i], create_time};
} }
Long last_modify_time = System.currentTimeMillis(); Long last_modify_time = System.currentTimeMillis();
jdbcTemplate.executeUpdate("update fc_member_film set play_shanghai = ?, last_modify_time = ? where id = ?", play_shanghai, last_modify_time, member_film_id); jdbcTemplate.executeUpdate("update fc_member_film set play_shanghai = ?, last_modify_time = ? where member_id = ? and id = ?", play_shanghai, last_modify_time, member_id, member_film_id);
jdbcTemplate.executeUpdate("delete from fc_member_film_show where film_id = ?", member_film_id); jdbcTemplate.executeUpdate("delete from fc_member_film_show where film_id = ?", member_film_id);
String sql = "insert into fc_member_film_show (film_id, show_filmfest, show_filmfest_type, show_filmfest_intro, create_time) values (?, ?, ?, ?, ?);"; String sql = "insert into fc_member_film_show (film_id, show_filmfest, show_filmfest_type, show_filmfest_intro, create_time) values (?, ?, ?, ?, ?);";
jdbcTemplate.batchUpdate(sql, args); jdbcTemplate.batchUpdate(sql, args);
...@@ -359,6 +364,7 @@ public class MemberServiceImpl implements MemberService { ...@@ -359,6 +364,7 @@ public class MemberServiceImpl implements MemberService {
@Override @Override
public void saveMemberFilmCompany( public void saveMemberFilmCompany(
Integer member_id,
Long member_film_id, Long member_film_id,
String film_apply_company, String film_apply_company,
String film_apply_realname, String film_apply_realname,
...@@ -380,7 +386,8 @@ public class MemberServiceImpl implements MemberService { ...@@ -380,7 +386,8 @@ public class MemberServiceImpl implements MemberService {
+ "film_apply_country = ?," + "film_apply_country = ?,"
+ "last_modify_time = ? " + "last_modify_time = ? "
+ "where " + "where "
+ "id = ?"; + "member_id = ? "
+ "and id = ?";
Object[] args = new Object[]{ Object[] args = new Object[]{
film_apply_company, film_apply_company,
film_apply_realname, film_apply_realname,
...@@ -389,6 +396,7 @@ public class MemberServiceImpl implements MemberService { ...@@ -389,6 +396,7 @@ public class MemberServiceImpl implements MemberService {
film_apply_mobile, film_apply_mobile,
film_apply_country, film_apply_country,
last_modify_time, last_modify_time,
member_id,
member_film_id}; member_film_id};
jdbcTemplate.executeUpdate(sql, args); jdbcTemplate.executeUpdate(sql, args);
} }
......
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