Commit 172d3c8c authored by Quxl's avatar Quxl

x

parent 40d953a3
......@@ -142,5 +142,7 @@ public interface FilmService {
void saveUploadState(Long member_film_id, Integer upload_state);
List<Fc_member_film_enroll> queryFilmEnrollList(Long member_film_id);
void verifyFilmDuplicate(Long member_film_id);
}
......@@ -17,6 +17,7 @@ import org.springframework.jdbc.support.KeyHolder;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.egolm.common.DateUtil;
import com.egolm.common.StringUtil;
import com.egolm.common.jdbc.JdbcTemplate;
import com.egolm.common.jdbc.Page;
......@@ -520,4 +521,19 @@ public class FilmServiceImpl implements FilmService {
return jdbcTemplate.queryForBeans("select * from fc_member_film_enroll where film_id = ?", Fc_member_film_enroll.class, member_film_id.intValue());
}
@Override
public void verifyFilmDuplicate(Long member_film_id) {
String sql0 = "select f.* from fc_member_film f, fc_member_film f2 where f.apply_state = 2 and f.en_name == f2.en_name or f.cn_name = f2.ch_name and f2.id = ? and f.id != ?";
List<Fc_member_film> list = jdbcTemplate.queryForBeans(sql0, Fc_member_film.class, member_film_id, member_film_id);
if(list.size() > 0) {
String sql = "select count(fp.id) from fc_member_film_playactor fp, fc_member_film_playactor fp2 where fp.playactor_type = 'director' and fp.playactor_type = fp2.playactor_type and fp.playactor_name = fp2.playactor_name and fp2.film_id = ? and fp.film_id != ?";
Integer count = jdbcTemplate.queryForInt(sql, member_film_id, member_film_id);
if(count > 0) {
Fc_member_film film = list.get(0);
Long passtime = film.getPass_time();
throw new XException("该片名已经在" + DateUtil.format(new Date(passtime*1000), "yyyy年MM月dd日HH") + "时被管理员通过,通过的影片ID号为" + film.getFilm_no());
}
}
}
}
......@@ -109,6 +109,7 @@ public class AdminFirstController {
@ApiImplicitParam(paramType="query", dataType="string", required=true, name="film_type_name_short", value="影片分类扩展分类"),
})
public Object pass(Long member_film_id, String film_type_name_short) {
memberFilmService.verifyFilmDuplicate(member_film_id);
memberFilmService.pass(member_film_id);
Fc_member_film film = new Fc_member_film();
film.setId(member_film_id);
......
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