20200727-入园申请
This commit is contained in:
@ -18,18 +18,17 @@ import com.ruoyi.framework.security.handle.LogoutSuccessHandlerImpl;
|
||||
|
||||
/**
|
||||
* spring security配置
|
||||
*
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@EnableGlobalMethodSecurity(prePostEnabled = true, securedEnabled = true)
|
||||
public class SecurityConfig extends WebSecurityConfigurerAdapter
|
||||
{
|
||||
public class SecurityConfig extends WebSecurityConfigurerAdapter {
|
||||
/**
|
||||
* 自定义用户认证逻辑
|
||||
*/
|
||||
@Autowired
|
||||
private UserDetailsService userDetailsService;
|
||||
|
||||
|
||||
/**
|
||||
* 认证失败处理类
|
||||
*/
|
||||
@ -47,7 +46,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
|
||||
*/
|
||||
@Autowired
|
||||
private JwtAuthenticationTokenFilter authenticationTokenFilter;
|
||||
|
||||
|
||||
/**
|
||||
* 解决 无法直接注入 AuthenticationManager
|
||||
*
|
||||
@ -56,8 +55,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
|
||||
*/
|
||||
@Bean
|
||||
@Override
|
||||
public AuthenticationManager authenticationManagerBean() throws Exception
|
||||
{
|
||||
public AuthenticationManager authenticationManagerBean() throws Exception {
|
||||
return super.authenticationManagerBean();
|
||||
}
|
||||
|
||||
@ -77,8 +75,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
|
||||
* authenticated | 用户登录后可访问
|
||||
*/
|
||||
@Override
|
||||
protected void configure(HttpSecurity httpSecurity) throws Exception
|
||||
{
|
||||
protected void configure(HttpSecurity httpSecurity) throws Exception {
|
||||
httpSecurity
|
||||
// CRSF禁用,因为不使用session
|
||||
.csrf().disable()
|
||||
@ -105,6 +102,8 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
|
||||
.antMatchers("/webjars/**").anonymous()
|
||||
.antMatchers("/*/api-docs").anonymous()
|
||||
.antMatchers("/druid/**").anonymous()
|
||||
.antMatchers("/benyi/experience/add").anonymous()//半日入园体验申请
|
||||
.antMatchers("/benyi/experience/getInfo**").anonymous()//半日入园体验明细
|
||||
// 除上面外的所有请求全部需要鉴权认证
|
||||
.anyRequest().authenticated()
|
||||
.and()
|
||||
@ -114,13 +113,12 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
|
||||
httpSecurity.addFilterBefore(authenticationTokenFilter, UsernamePasswordAuthenticationFilter.class);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 强散列哈希加密实现
|
||||
*/
|
||||
@Bean
|
||||
public BCryptPasswordEncoder bCryptPasswordEncoder()
|
||||
{
|
||||
public BCryptPasswordEncoder bCryptPasswordEncoder() {
|
||||
return new BCryptPasswordEncoder();
|
||||
}
|
||||
|
||||
@ -128,8 +126,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
|
||||
* 身份认证接口
|
||||
*/
|
||||
@Override
|
||||
protected void configure(AuthenticationManagerBuilder auth) throws Exception
|
||||
{
|
||||
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
|
||||
auth.userDetailsService(userDetailsService).passwordEncoder(bCryptPasswordEncoder());
|
||||
}
|
||||
}
|
||||
|
@ -2,6 +2,8 @@ package com.ruoyi.project.benyi.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
import com.ruoyi.project.common.SchoolCommon;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
@ -32,6 +34,8 @@ import com.ruoyi.framework.web.page.TableDataInfo;
|
||||
public class ByExperienceController extends BaseController {
|
||||
@Autowired
|
||||
private IByExperienceService byExperienceService;
|
||||
@Autowired
|
||||
private SchoolCommon schoolCommon;
|
||||
|
||||
/**
|
||||
* 查询入班体验申请列表
|
||||
@ -40,6 +44,7 @@ public class ByExperienceController extends BaseController {
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(ByExperience byExperience) {
|
||||
startPage();
|
||||
byExperience.setSchoolid(SecurityUtils.getLoginUser().getUser().getDept().getDeptId());
|
||||
List<ByExperience> list = byExperienceService.selectByExperienceList(byExperience);
|
||||
return getDataTable(list);
|
||||
}
|
||||
@ -65,12 +70,31 @@ public class ByExperienceController extends BaseController {
|
||||
return AjaxResult.success(byExperienceService.selectByExperienceById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取入班体验申请详细信息
|
||||
*/
|
||||
@GetMapping("/getInfo")
|
||||
public AjaxResult getInfo_query(ByExperience byExperience) {
|
||||
if(schoolCommon.isStringEmpty(byExperience.getYexm())){
|
||||
return AjaxResult.error("请输入幼儿姓名");
|
||||
}
|
||||
if(schoolCommon.isStringEmpty(byExperience.getLxfs())){
|
||||
return AjaxResult.error("请输入家长联系方式");
|
||||
}
|
||||
|
||||
List<ByExperience> list = byExperienceService.selectByExperienceList(byExperience);
|
||||
if (list == null || list.size() == 0) {
|
||||
return AjaxResult.error("未找到该幼儿的半日入园体验信息");
|
||||
}
|
||||
return AjaxResult.success(list.get(0));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增入班体验申请
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('benyi:experience:add')")
|
||||
// @PreAuthorize("@ss.hasPermi('benyi:experience:add')")
|
||||
@Log(title = "入班体验申请", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
@PostMapping("/add")
|
||||
public AjaxResult add(@RequestBody ByExperience byExperience) {
|
||||
return toAjax(byExperienceService.insertByExperience(byExperience));
|
||||
}
|
||||
|
@ -5,24 +5,24 @@
|
||||
<mapper namespace="com.ruoyi.project.benyi.mapper.ByExperienceMapper">
|
||||
|
||||
<resultMap type="ByExperience" id="ByExperienceResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="jzxm" column="jzxm" />
|
||||
<result property="yexm" column="yexm" />
|
||||
<result property="csrq" column="csrq" />
|
||||
<result property="lxfs" column="lxfs" />
|
||||
<result property="nrysj" column="nrysj" />
|
||||
<result property="sqtysj" column="sqtysj" />
|
||||
<result property="swxw" column="swxw" />
|
||||
<result property="schoolid" column="schoolid" />
|
||||
<result property="sfhf" column="sfhf" />
|
||||
<result property="hfrn" column="hfrn" />
|
||||
<result property="hfuserid" column="hfuserid" />
|
||||
<result property="fhsj" column="fhsj" />
|
||||
<result property="yzzs" column="yzzs" />
|
||||
<result property="tyjg" column="tyjg" />
|
||||
<result property="rysj" column="rysj" />
|
||||
<result property="createTime" column="create_time" />
|
||||
</resultMap>
|
||||
<result property="id" column="id"/>
|
||||
<result property="jzxm" column="jzxm"/>
|
||||
<result property="yexm" column="yexm"/>
|
||||
<result property="csrq" column="csrq"/>
|
||||
<result property="lxfs" column="lxfs"/>
|
||||
<result property="nrysj" column="nrysj"/>
|
||||
<result property="sqtysj" column="sqtysj"/>
|
||||
<result property="swxw" column="swxw"/>
|
||||
<result property="schoolid" column="schoolid"/>
|
||||
<result property="sfhf" column="sfhf"/>
|
||||
<result property="hfrn" column="hfrn"/>
|
||||
<result property="hfuserid" column="hfuserid"/>
|
||||
<result property="fhsj" column="fhsj"/>
|
||||
<result property="yzzs" column="yzzs"/>
|
||||
<result property="tyjg" column="tyjg"/>
|
||||
<result property="rysj" column="rysj"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectByExperienceVo">
|
||||
select id, jzxm, yexm, csrq, lxfs, nrysj, sqtysj, swxw, schoolid, sfhf, hfrn, hfuserid, fhsj, yzzs, tyjg, rysj, create_time from by_experience
|
||||
@ -31,22 +31,23 @@
|
||||
<select id="selectByExperienceList" parameterType="ByExperience" resultMap="ByExperienceResult">
|
||||
<include refid="selectByExperienceVo"/>
|
||||
<where>
|
||||
<if test="jzxm != null and jzxm != ''"> and jzxm = #{jzxm}</if>
|
||||
<if test="yexm != null and yexm != ''"> and yexm = #{yexm}</if>
|
||||
<if test="csrq != null "> and csrq = #{csrq}</if>
|
||||
<if test="lxfs != null and lxfs != ''"> and lxfs = #{lxfs}</if>
|
||||
<if test="nrysj != null "> and nrysj = #{nrysj}</if>
|
||||
<if test="sqtysj != null "> and sqtysj = #{sqtysj}</if>
|
||||
<if test="swxw != null and swxw != ''"> and swxw = #{swxw}</if>
|
||||
<if test="schoolid != null "> and schoolid = #{schoolid}</if>
|
||||
<if test="sfhf != null and sfhf != ''"> and sfhf = #{sfhf}</if>
|
||||
<if test="hfrn != null and hfrn != ''"> and hfrn = #{hfrn}</if>
|
||||
<if test="hfuserid != null "> and hfuserid = #{hfuserid}</if>
|
||||
<if test="fhsj != null "> and fhsj = #{fhsj}</if>
|
||||
<if test="yzzs != null and yzzs != ''"> and yzzs = #{yzzs}</if>
|
||||
<if test="tyjg != null and tyjg != ''"> and tyjg = #{tyjg}</if>
|
||||
<if test="rysj != null "> and rysj = #{rysj}</if>
|
||||
</where>
|
||||
<if test="jzxm != null and jzxm != ''">and jzxm = #{jzxm}</if>
|
||||
<if test="yexm != null and yexm != ''">and yexm = #{yexm}</if>
|
||||
<if test="csrq != null ">and csrq = #{csrq}</if>
|
||||
<if test="lxfs != null and lxfs != ''">and lxfs = #{lxfs}</if>
|
||||
<if test="nrysj != null ">and nrysj = #{nrysj}</if>
|
||||
<if test="sqtysj != null ">and sqtysj = #{sqtysj}</if>
|
||||
<if test="swxw != null and swxw != ''">and swxw = #{swxw}</if>
|
||||
<if test="schoolid != null ">and schoolid = #{schoolid}</if>
|
||||
<if test="sfhf != null and sfhf != ''">and sfhf = #{sfhf}</if>
|
||||
<if test="hfrn != null and hfrn != ''">and hfrn = #{hfrn}</if>
|
||||
<if test="hfuserid != null ">and hfuserid = #{hfuserid}</if>
|
||||
<if test="fhsj != null ">and fhsj = #{fhsj}</if>
|
||||
<if test="yzzs != null and yzzs != ''">and yzzs = #{yzzs}</if>
|
||||
<if test="tyjg != null and tyjg != ''">and tyjg = #{tyjg}</if>
|
||||
<if test="rysj != null ">and rysj = #{rysj}</if>
|
||||
</where>
|
||||
order by create_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectByExperienceById" parameterType="Long" resultMap="ByExperienceResult">
|
||||
@ -57,63 +58,63 @@
|
||||
<insert id="insertByExperience" parameterType="ByExperience" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into by_experience
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="jzxm != null and jzxm != ''">jzxm,</if>
|
||||
<if test="yexm != null and yexm != ''">yexm,</if>
|
||||
<if test="csrq != null ">csrq,</if>
|
||||
<if test="lxfs != null and lxfs != ''">lxfs,</if>
|
||||
<if test="nrysj != null ">nrysj,</if>
|
||||
<if test="sqtysj != null ">sqtysj,</if>
|
||||
<if test="swxw != null and swxw != ''">swxw,</if>
|
||||
<if test="schoolid != null ">schoolid,</if>
|
||||
<if test="sfhf != null and sfhf != ''">sfhf,</if>
|
||||
<if test="hfrn != null and hfrn != ''">hfrn,</if>
|
||||
<if test="hfuserid != null ">hfuserid,</if>
|
||||
<if test="fhsj != null ">fhsj,</if>
|
||||
<if test="yzzs != null and yzzs != ''">yzzs,</if>
|
||||
<if test="tyjg != null and tyjg != ''">tyjg,</if>
|
||||
<if test="rysj != null ">rysj,</if>
|
||||
<if test="createTime != null ">create_time,</if>
|
||||
</trim>
|
||||
<if test="jzxm != null and jzxm != ''">jzxm,</if>
|
||||
<if test="yexm != null and yexm != ''">yexm,</if>
|
||||
<if test="csrq != null ">csrq,</if>
|
||||
<if test="lxfs != null and lxfs != ''">lxfs,</if>
|
||||
<if test="nrysj != null ">nrysj,</if>
|
||||
<if test="sqtysj != null ">sqtysj,</if>
|
||||
<if test="swxw != null and swxw != ''">swxw,</if>
|
||||
<if test="schoolid != null ">schoolid,</if>
|
||||
<if test="sfhf != null and sfhf != ''">sfhf,</if>
|
||||
<if test="hfrn != null and hfrn != ''">hfrn,</if>
|
||||
<if test="hfuserid != null ">hfuserid,</if>
|
||||
<if test="fhsj != null ">fhsj,</if>
|
||||
<if test="yzzs != null and yzzs != ''">yzzs,</if>
|
||||
<if test="tyjg != null and tyjg != ''">tyjg,</if>
|
||||
<if test="rysj != null ">rysj,</if>
|
||||
<if test="createTime != null ">create_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="jzxm != null and jzxm != ''">#{jzxm},</if>
|
||||
<if test="yexm != null and yexm != ''">#{yexm},</if>
|
||||
<if test="csrq != null ">#{csrq},</if>
|
||||
<if test="lxfs != null and lxfs != ''">#{lxfs},</if>
|
||||
<if test="nrysj != null ">#{nrysj},</if>
|
||||
<if test="sqtysj != null ">#{sqtysj},</if>
|
||||
<if test="swxw != null and swxw != ''">#{swxw},</if>
|
||||
<if test="schoolid != null ">#{schoolid},</if>
|
||||
<if test="sfhf != null and sfhf != ''">#{sfhf},</if>
|
||||
<if test="hfrn != null and hfrn != ''">#{hfrn},</if>
|
||||
<if test="hfuserid != null ">#{hfuserid},</if>
|
||||
<if test="fhsj != null ">#{fhsj},</if>
|
||||
<if test="yzzs != null and yzzs != ''">#{yzzs},</if>
|
||||
<if test="tyjg != null and tyjg != ''">#{tyjg},</if>
|
||||
<if test="rysj != null ">#{rysj},</if>
|
||||
<if test="createTime != null ">#{createTime},</if>
|
||||
</trim>
|
||||
<if test="jzxm != null and jzxm != ''">#{jzxm},</if>
|
||||
<if test="yexm != null and yexm != ''">#{yexm},</if>
|
||||
<if test="csrq != null ">#{csrq},</if>
|
||||
<if test="lxfs != null and lxfs != ''">#{lxfs},</if>
|
||||
<if test="nrysj != null ">#{nrysj},</if>
|
||||
<if test="sqtysj != null ">#{sqtysj},</if>
|
||||
<if test="swxw != null and swxw != ''">#{swxw},</if>
|
||||
<if test="schoolid != null ">#{schoolid},</if>
|
||||
<if test="sfhf != null and sfhf != ''">#{sfhf},</if>
|
||||
<if test="hfrn != null and hfrn != ''">#{hfrn},</if>
|
||||
<if test="hfuserid != null ">#{hfuserid},</if>
|
||||
<if test="fhsj != null ">#{fhsj},</if>
|
||||
<if test="yzzs != null and yzzs != ''">#{yzzs},</if>
|
||||
<if test="tyjg != null and tyjg != ''">#{tyjg},</if>
|
||||
<if test="rysj != null ">#{rysj},</if>
|
||||
<if test="createTime != null ">#{createTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateByExperience" parameterType="ByExperience">
|
||||
update by_experience
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="jzxm != null and jzxm != ''">jzxm = #{jzxm},</if>
|
||||
<if test="yexm != null and yexm != ''">yexm = #{yexm},</if>
|
||||
<if test="csrq != null ">csrq = #{csrq},</if>
|
||||
<if test="lxfs != null and lxfs != ''">lxfs = #{lxfs},</if>
|
||||
<if test="nrysj != null ">nrysj = #{nrysj},</if>
|
||||
<if test="sqtysj != null ">sqtysj = #{sqtysj},</if>
|
||||
<if test="swxw != null and swxw != ''">swxw = #{swxw},</if>
|
||||
<if test="schoolid != null ">schoolid = #{schoolid},</if>
|
||||
<if test="sfhf != null and sfhf != ''">sfhf = #{sfhf},</if>
|
||||
<if test="hfrn != null and hfrn != ''">hfrn = #{hfrn},</if>
|
||||
<if test="hfuserid != null ">hfuserid = #{hfuserid},</if>
|
||||
<if test="fhsj != null ">fhsj = #{fhsj},</if>
|
||||
<if test="yzzs != null and yzzs != ''">yzzs = #{yzzs},</if>
|
||||
<if test="tyjg != null and tyjg != ''">tyjg = #{tyjg},</if>
|
||||
<if test="rysj != null ">rysj = #{rysj},</if>
|
||||
<if test="createTime != null ">create_time = #{createTime},</if>
|
||||
</trim>
|
||||
<if test="jzxm != null and jzxm != ''">jzxm = #{jzxm},</if>
|
||||
<if test="yexm != null and yexm != ''">yexm = #{yexm},</if>
|
||||
<if test="csrq != null ">csrq = #{csrq},</if>
|
||||
<if test="lxfs != null and lxfs != ''">lxfs = #{lxfs},</if>
|
||||
<if test="nrysj != null ">nrysj = #{nrysj},</if>
|
||||
<if test="sqtysj != null ">sqtysj = #{sqtysj},</if>
|
||||
<if test="swxw != null and swxw != ''">swxw = #{swxw},</if>
|
||||
<if test="schoolid != null ">schoolid = #{schoolid},</if>
|
||||
<if test="sfhf != null and sfhf != ''">sfhf = #{sfhf},</if>
|
||||
<if test="hfrn != null and hfrn != ''">hfrn = #{hfrn},</if>
|
||||
<if test="hfuserid != null ">hfuserid = #{hfuserid},</if>
|
||||
<if test="fhsj != null ">fhsj = #{fhsj},</if>
|
||||
<if test="yzzs != null and yzzs != ''">yzzs = #{yzzs},</if>
|
||||
<if test="tyjg != null and tyjg != ''">tyjg = #{tyjg},</if>
|
||||
<if test="rysj != null ">rysj = #{rysj},</if>
|
||||
<if test="createTime != null ">create_time = #{createTime},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
|
Reference in New Issue
Block a user