Commit 2b6e2970 authored by Quxl's avatar Quxl

x

parent c24280b1
package com.egolm.film.api.web.admin;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
......@@ -10,12 +12,15 @@ import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.egolm.common.StringUtil;
import com.egolm.common.Util;
import com.egolm.common.bean.Rjx;
import com.egolm.common.jdbc.JdbcTemplate;
import com.egolm.film.api.service.AdminTokenService;
import com.egolm.film.api.service.ReviewService;
import com.egolm.film.bean.Fc_admin;
import com.egolm.film.bean.Fc_member_film;
import com.egolm.film.bean.Fc_member_film_enroll;
import com.egolm.film.config.XRException;
import io.swagger.annotations.Api;
......@@ -46,6 +51,33 @@ public class WebUtilController {
return Rjx.jsonOk();
}
@ResponseBody
@PostMapping("initAllEnrollType")
@ApiOperation("初始化所有影片性质")
public Object initAllEnrollType() {
jdbcTemplate.executeUpdate("delete from fc_member_film_enroll");
String sql = "select id, enroll_type_name, enroll_type_name_other from fc_member_film";
List<Map<String, Object>> list = jdbcTemplate.queryForList(sql);
List<Fc_member_film_enroll> enrolls = new ArrayList<Fc_member_film_enroll>();
for(Map<String, Object> map : list) {
Integer id = Util.toInt(map.get("id"));
String name = (String)map.get("enroll_type_name");
if(StringUtil.isNotBlank(name)) {
String[] strs = name.trim().split(",");
for(String str : strs) {
Fc_member_film_enroll enroll = new Fc_member_film_enroll();
enroll.setEnroll_type_id(Integer.valueOf(str));
enroll.setFilm_id(id);
enrolls.add(enroll);
}
}
}
if(enrolls.size() > 0) {
jdbcTemplate.batchSave(enrolls);
}
return Rjx.jsonOk();
}
@ResponseBody
@PostMapping("initAllReview")
@ApiOperation("初始化所有审片流程")
......
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