Commit 61bf6d99 authored by Quxl's avatar Quxl

优化申报接口

parent 3f766930
......@@ -49,14 +49,15 @@ public class MemberApplyController {
@ResponseBody
@PostMapping("save_type")
@ApiOperation("保存申报影片类型")
@ApiOperation("新增影片,并保存申报影片类型")
@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 = "enroll_type_name", value="影片性质"),
})
public Object saveMemberFilmType(Long member_film_id, String film_type_name, String enroll_type_name) {
member_film_id = memberService.saveMemberFilmType(member_film_id, film_type_name, enroll_type_name);
public Object saveMemberFilmType(String film_type_name, String 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);
}
......@@ -70,7 +71,9 @@ public class MemberApplyController {
@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) {
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();
}
......@@ -100,7 +103,11 @@ public class MemberApplyController {
String show_date,
String film_medium,
String film_format) {
LoginToken loginToken = tokenService.getToken();
Integer member_id = (Integer)loginToken.getId();
memberService.saveMemberFilmInfo(
member_id,
member_film_id,
film_country,
dialogue_lang,
......@@ -137,7 +144,11 @@ public class MemberApplyController {
String[] playactor_birthday,
String[] playactor_intro,
Integer[] is_play_shanghai) {
LoginToken loginToken = tokenService.getToken();
Integer member_id = (Integer)loginToken.getId();
memberService.saveMemberFilmPlayactor(
member_id,
member_film_id,
playactor_type,
playactor_name,
......@@ -166,7 +177,11 @@ public class MemberApplyController {
String[] issuer_contacts,
String[] issuer_email,
String[] issuer_tel) {
LoginToken loginToken = tokenService.getToken();
Integer member_id = (Integer)loginToken.getId();
memberService.saveMemberFilmIssuer(
member_id,
member_film_id,
issuer_company,
issuer_contacts,
......@@ -192,7 +207,11 @@ public class MemberApplyController {
String[] show_filmfest,
String[] show_filmfest_type,
String[] show_filmfest_intro) {
LoginToken loginToken = tokenService.getToken();
Integer member_id = (Integer)loginToken.getId();
memberService.saveMemberFilmShow(
member_id,
member_film_id,
play_shanghai,
show_filmfest,
......@@ -221,7 +240,11 @@ public class MemberApplyController {
String film_apply_tel,
String film_apply_mobile,
String film_apply_country) {
LoginToken loginToken = tokenService.getToken();
Integer member_id = (Integer)loginToken.getId();
memberService.saveMemberFilmCompany(
member_id,
member_film_id,
film_apply_company,
film_apply_realname,
......
......@@ -54,11 +54,12 @@ public interface MemberService {
Fc_member_film_all queryMoreByNo(String no);
Long saveMemberFilmType(
Long member_film_id,
Integer member_id,
String film_type_name,
String enroll_type_name);
void saveMemberFilmBase(
Integer member_id,
Long member_film_id,
String[] enroll_type_name_other,
String cn_name,
......@@ -66,6 +67,7 @@ public interface MemberService {
String intro);
void saveMemberFilmInfo(
Integer member_id,
Long member_film_id,
String film_country,
String dialogue_lang,
......@@ -78,6 +80,7 @@ public interface MemberService {
String film_format);
void saveMemberFilmPlayactor(
Integer member_id,
Long member_film_id,
String[] playactor_type,
String[] playactor_name,
......@@ -88,6 +91,7 @@ public interface MemberService {
Integer[] is_play_shanghai);
void saveMemberFilmIssuer(
Integer member_id,
Long member_film_id,
String[] issuer_company,
String[] issuer_contacts,
......@@ -95,6 +99,7 @@ public interface MemberService {
String[] issuer_tel);
void saveMemberFilmShow(
Integer member_id,
Long member_film_id,
String play_shanghai,
String[] show_filmfest,
......@@ -102,6 +107,7 @@ public interface MemberService {
String[] show_filmfest_intro);
void saveMemberFilmCompany(
Integer member_id,
Long member_film_id,
String film_apply_company,
String film_apply_realname,
......
......@@ -153,7 +153,7 @@ public class MemberServiceImpl implements MemberService {
@Override
public Long saveMemberFilmType(
Long member_film_id,
Integer member_id,
String film_type_name,
String enroll_type_name) {
......@@ -166,7 +166,7 @@ public class MemberServiceImpl implements MemberService {
Long last_modify_time = create_time;
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};
KeyHolder keyHolder = new GeneratedKeyHolder();
jdbcTemplate.update(new PreparedStatementCreator() {
......@@ -191,20 +191,22 @@ public class MemberServiceImpl implements MemberService {
@Override
public void saveMemberFilmBase(
Integer member_id,
Long member_film_id,
String[] enroll_type_name_other,
String cn_name,
String en_name,
String intro) {
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);
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);
}
@Override
public void saveMemberFilmInfo(
Integer member_id,
Long member_film_id,
String film_country,
String dialogue_lang,
......@@ -217,14 +219,15 @@ public class MemberServiceImpl implements MemberService {
String film_format) {
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);
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);
}
@Override
public void saveMemberFilmPlayactor(
Integer member_id,
Long member_film_id,
String[] playactor_type,
String[] playactor_name,
......@@ -302,6 +305,7 @@ public class MemberServiceImpl implements MemberService {
@Override
public void saveMemberFilmIssuer(
Integer member_id,
Long member_film_id,
String[] issuer_company,
String[] issuer_contacts,
......@@ -336,6 +340,7 @@ public class MemberServiceImpl implements MemberService {
@Override
public void saveMemberFilmShow(
Integer member_id,
Long member_film_id,
String play_shanghai,
String[] show_filmfest,
......@@ -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};
}
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);
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);
......@@ -359,6 +364,7 @@ public class MemberServiceImpl implements MemberService {
@Override
public void saveMemberFilmCompany(
Integer member_id,
Long member_film_id,
String film_apply_company,
String film_apply_realname,
......@@ -380,7 +386,8 @@ public class MemberServiceImpl implements MemberService {
+ "film_apply_country = ?,"
+ "last_modify_time = ? "
+ "where "
+ "id = ?";
+ "member_id = ? "
+ "and id = ?";
Object[] args = new Object[]{
film_apply_company,
film_apply_realname,
......@@ -389,6 +396,7 @@ public class MemberServiceImpl implements MemberService {
film_apply_mobile,
film_apply_country,
last_modify_time,
member_id,
member_film_id};
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