Commit 8b975eb0 authored by Quxl's avatar Quxl

x

parent 2f79a86a
...@@ -10,6 +10,7 @@ import java.util.TreeMap; ...@@ -10,6 +10,7 @@ import java.util.TreeMap;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.DuplicateKeyException;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
...@@ -28,6 +29,7 @@ import com.egolm.film.bean.Fc_cinema; ...@@ -28,6 +29,7 @@ import com.egolm.film.bean.Fc_cinema;
import com.egolm.film.bean.Fc_cinema_showtime; import com.egolm.film.bean.Fc_cinema_showtime;
import com.egolm.film.bean.model.Fc_cinema_model; import com.egolm.film.bean.model.Fc_cinema_model;
import com.egolm.film.bean.model.Fc_cinema_showtime_model; import com.egolm.film.bean.model.Fc_cinema_showtime_model;
import com.egolm.film.config.XRException;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
...@@ -145,7 +147,11 @@ public class CinemaController { ...@@ -145,7 +147,11 @@ public class CinemaController {
list.add(showtime); list.add(showtime);
} }
} }
common.batchSave(list); try {
common.batchSave(list);
} catch (DuplicateKeyException e) {
throw new XRException("新建场次时间已存在");
}
return Rjx.jsonOk(); return Rjx.jsonOk();
} }
......
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