Commit 8a431caf authored by Quxl's avatar Quxl

xxx

parent b3e2306f
package com.egolm.film.api.admin;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import com.egolm.film.api.admin.service.AdminFilmApplyService;
import io.swagger.annotations.Api;
@Api
@Controller
@RequestMapping("admin/film_apply")
public class AdminFilmApplyController {
@Autowired
AdminFilmApplyService service;
}
package com.egolm.film.api.admin;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
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.bean.Rjx;
import com.egolm.common.jdbc.Page;
import com.egolm.film.api.admin.service.AdminFirstService;
import com.egolm.film.api.member.service.MemberService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
/**
* 初审
* @author Quxl
*
*/
@Api
@Controller
@RequestMapping("admin/first")
public class AdminFirstController {
@Autowired
AdminFirstService service;
@Autowired
MemberService memberService;
@ResponseBody
@PostMapping("list")
@ApiOperation("管理员分页查询")
@ApiImplicitParams({
@ApiImplicitParam(paramType="query", dataType="string", required=false, name="keyword", value="关键字"),
@ApiImplicitParam(paramType="query", dataType="integer", required=false, name="state", value="状态"),
@ApiImplicitParam(paramType="query", dataType="integer", required=false, name="film_type", value="影片类型"),
@ApiImplicitParam(paramType="query", dataType="integer", required=false, name="enroll_type", value="影片性质"),
@ApiImplicitParam(paramType="query", dataType="long", required=true, name="index", value="分页编号"),
@ApiImplicitParam(paramType="query", dataType="long", required=true, name="limit", value="分页大小"),
})
public Object list(String keyword, Integer state, String film_type, String enroll_type, Long index, Long limit) {
index = index == null ? 1 : index;
limit = limit == null ? 20 : limit;
Page page = new Page(index, limit);
List<Map<String, Object>> list = memberService.queryChuShenList(keyword, state, film_type, enroll_type, page);
return Rjx.jsonOk().setData(list);
}
}
package com.egolm.film.api.admin.service;
public interface AdminFilmApplyService {
public interface AdminFirstService {
}
......@@ -41,7 +41,7 @@ public class AdminAuthServiceImpl implements AdminAuthService {
@Override
public List<Map<String, Object>> queryAdminList(String keyword, Integer group_id, Page page) {
SqlWhere argEdit = new SqlWhere().like("realname", keyword).like("username", keyword).eq("group_id", group_id);
SqlWhere argEdit = new SqlWhere().olike(new String[]{"realname", "username"}, keyword).eq("group_id", group_id);
String sql = "select * from fc_admin" + StringUtil.join(" and ", " where ", "", "", argEdit.getArgs());
return jdbcTemplate.limit(sql, page, argEdit.getObjs());
}
......
......@@ -4,10 +4,10 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.egolm.common.jdbc.JdbcTemplate;
import com.egolm.film.api.admin.service.AdminFilmApplyService;
import com.egolm.film.api.admin.service.AdminFirstService;
@Service
public class AdminFilmApplyServiceImpl implements AdminFilmApplyService {
public class AdminFirstServiceImpl implements AdminFirstService {
@Autowired
JdbcTemplate jdbcTemplate;
......
......@@ -3,6 +3,7 @@ package com.egolm.film.api.member.service;
import java.util.List;
import java.util.Map;
import com.egolm.common.jdbc.Page;
import com.egolm.film.bean.Fc_member;
import com.egolm.film.bean.Fc_member_film;
import com.egolm.film.bean.Fc_member_film_all;
......@@ -132,4 +133,7 @@ public interface MemberService {
List<Map<String, Object>> queryListAll(String keyword);
List<Map<String, Object>> queryChuShenList(String keyword, Integer state, String film_type, String enroll_type,
Page page);
}
......@@ -17,6 +17,7 @@ import org.springframework.transaction.annotation.Transactional;
import com.egolm.common.StringUtil;
import com.egolm.common.jdbc.JdbcTemplate;
import com.egolm.common.jdbc.Page;
import com.egolm.common.web.ServletUtil;
import com.egolm.film.api.common.service.Messages;
import com.egolm.film.api.member.service.MemberService;
......@@ -30,6 +31,7 @@ import com.egolm.film.bean.Fc_member_film_show;
import com.egolm.film.config.WebMvcConfig;
import com.egolm.film.config.XException;
import com.egolm.film.util.Common;
import com.egolm.film.util.SqlWhere;
@Service
......@@ -136,7 +138,7 @@ public class MemberServiceImpl implements MemberService {
@Override
public void doApply(Integer member_id, Long member_film_id) {
jdbcTemplate.executeUpdate("update fc_member_film set state = ?, apply_state = ? where id = ? and member_id = ?", 2, 2, member_film_id, member_id);
jdbcTemplate.executeUpdate("update fc_member_film set state = ?, apply_state = ? where id = ? and member_id = ?", 2, 1, member_film_id, member_id);
}
@Override
......@@ -493,4 +495,12 @@ public class MemberServiceImpl implements MemberService {
}
}
@Override
public List<Map<String, Object>> queryChuShenList(String keyword, Integer state, String film_type, String enroll_type, Page page) {
String sql = "select * from fc_member_film";
new SqlWhere().like(name, obj)
return null;
}
}
......@@ -22,7 +22,7 @@ public class Common {
}
public static void main(String[] args) {
System.out.println(encodePassword("Siff@2018", "78hzar"));
System.out.println(encodePassword("123456", "XPm3m5"));
System.out.println(getGenerateString(6));
}
......
......@@ -63,18 +63,18 @@ public class SqlWhere {
return this;
}
public SqlWhere rlike(String name, Object obj) {
if(StringUtil.isNotBlank(obj)) {
this.args.add(name + " like ?");
this.objs.add(obj + "%");
public SqlWhere olike(String[] name, Object obj) {
if(name != null && name.length > 0 && StringUtil.isNotBlank(obj)) {
StringBuffer sb = new StringBuffer();
sb.append("(");
for(int i = 0; i < name.length; i++) {
if(i > 0) {
sb.append(" or ");
}
return this;
sb.append(name + " like '%" + obj + "%'");
}
public SqlWhere llike(String name, Object obj) {
if(StringUtil.isNotBlank(obj)) {
this.args.add(name + " like ?");
this.objs.add("%" + obj);
sb.append(")");
this.args.add(sb.toString());
}
return this;
}
......
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