Commit cfed1d86 authored by Quxl's avatar Quxl

x

parent 105c0f20
...@@ -7,6 +7,7 @@ import java.util.List; ...@@ -7,6 +7,7 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.TreeMap; import java.util.TreeMap;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
...@@ -20,6 +21,7 @@ import com.egolm.common.bean.Rjx; ...@@ -20,6 +21,7 @@ import com.egolm.common.bean.Rjx;
import com.egolm.common.jdbc.Page; import com.egolm.common.jdbc.Page;
import com.egolm.film.api.service.CinemaService; import com.egolm.film.api.service.CinemaService;
import com.egolm.film.api.service.CommonService; import com.egolm.film.api.service.CommonService;
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;
...@@ -47,7 +49,16 @@ public class CinemaController { ...@@ -47,7 +49,16 @@ public class CinemaController {
@ApiImplicitParam(paramType="query", name="sync", value="同步影厅 0:否, 1:是"), @ApiImplicitParam(paramType="query", name="sync", value="同步影厅 0:否, 1:是"),
}) })
public Object saveOrUpdate(Integer sync, Fc_cinema_model cinemaModel) { public Object saveOrUpdate(Integer sync, Fc_cinema_model cinemaModel) {
common.save(cinemaModel); if(cinemaModel.getId() == null) {
Fc_cinema cinema = new Fc_cinema();
BeanUtils.copyProperties(cinemaModel, cinema);
cinema.setCreate_time(new Date());
cinema.setTmp_count_film(0);
cinema.setTmp_count_show(0);
common.save(cinema);
} else {
common.update(cinemaModel);
}
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