修改 shiro

master
wangh 6 months ago
parent 31d48cfdec
commit 8cae52943e

@ -57,7 +57,7 @@ public class BaseLocationInfoController extends BaseController
/**
*
*/
@RequiresPermissions("base:location:list")
// @RequiresPermissions("base:location:list")
@PostMapping("/list")
@ResponseBody
public TableDataInfo list(BaseLocationInfo baseLocationInfo)

@ -290,6 +290,7 @@ public class ShiroConfig
filterChainDefinitionMap.put("/js/**", "anon");
filterChainDefinitionMap.put("/ruoyi/**", "anon");
filterChainDefinitionMap.put("/api/**", "anon");
filterChainDefinitionMap.put("/demo/table/**", "anon");
filterChainDefinitionMap.put("/captcha/captchaImage**", "anon");
// 匿名访问不鉴权注解列表
List<String> permitAllUrl = SpringUtils.getBean(PermitAllUrlProperties.class).getUrls();
@ -301,6 +302,7 @@ public class ShiroConfig
filterChainDefinitionMap.put("/logout", "logout");
// 不需要拦截的访问
filterChainDefinitionMap.put("/login", "anon,captchaValidate");
filterChainDefinitionMap.put("/**/**/**", "anon,captchaValidate");
// 注册相关
filterChainDefinitionMap.put("/register", "anon,captchaValidate");
// 系统权限列表
@ -316,7 +318,7 @@ public class ShiroConfig
shiroFilterFactoryBean.setFilters(filters);
// 所有请求需要认证
filterChainDefinitionMap.put("/**", "user,kickout,onlineSession,syncOnlineSession");
// filterChainDefinitionMap.put("/**", "user,kickout,onlineSession,syncOnlineSession");
shiroFilterFactoryBean.setFilterChainDefinitionMap(filterChainDefinitionMap);
return shiroFilterFactoryBean;

@ -3,26 +3,31 @@ package com.bgs.webapi.controller;
import com.bgs.common.core.domain.AjaxResult;
import com.bgs.webapi.doman.BindingSubmitBeen;
import com.bgs.webapi.doman.JoinSubmitBeen;
import com.bgs.webapi.service.ApiService;
import com.bgs.webapi.service.LoginService;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* Created by wangh on 2020/7/17-15:18
*/
@RestController
@Controller
@RequestMapping("/api")
public class ApiController {
@Autowired
ApiService service;
@GetMapping("/test")
public String stockLedger()
{
return "base/location/stockLedger";
}
@PostMapping("/bindingSubmit")
public AjaxResult bindingSubmit(@RequestBody BindingSubmitBeen submitBeen) {
@ -77,8 +82,27 @@ public class ApiController {
if (list == null || list.isEmpty()) return AjaxResult.error("账号无绑定记录");
return AjaxResult.success(list);
}
//交货提交
@PostMapping("/join/jiaoSubmit")
public AjaxResult joinJiaoSubmit(@RequestBody JoinSubmitBeen been){
int i = service.joinSelectByUser(been);
if (i == 0) {
return AjaxResult.success();
}
return AjaxResult.error();
}
//接货提交
@PostMapping("/join/shouSubmit")
public AjaxResult joinJieSubmit(@RequestBody JoinSubmitBeen been){
int i = service.joinShouSubmit(been);
if (i == been.getList().size()) {
return AjaxResult.success();
}
return AjaxResult.error();
}
/* @GetMapping("/getVersion")
public String getVersion(){

@ -0,0 +1,28 @@
package com.bgs.webapi.doman;
import java.util.List;
/**
* @author wanghao
* @date 2024/7/29 9:50
*/
public class JoinSubmitBeen {
private String user;
private List<String> list;
public String getUser() {
return user;
}
public void setUser(String user) {
this.user = user;
}
public List<String> getList() {
return list;
}
public void setList(List<String> list) {
this.list = list;
}
}

@ -1,6 +1,7 @@
package com.bgs.webapi.mapper;
import com.bgs.webapi.doman.JoinSubmitBeen;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
@ -27,4 +28,8 @@ public interface ApiMapper {
int blueToothSubmit(String locationCode, String hkCode);
List<String> jionSelect(String user);
int joinShouSubmit(JoinSubmitBeen been);
int joinSelectByUser(JoinSubmitBeen been);
}

@ -1,5 +1,6 @@
package com.bgs.webapi.service;
import com.bgs.webapi.doman.JoinSubmitBeen;
import com.bgs.webapi.mapper.ApiMapper;
import com.bgs.webapi.mapper.LoginMapper;
import org.springframework.beans.factory.annotation.Autowired;
@ -47,4 +48,12 @@ public class ApiService {
public List<String> jionSelect(String user) {
return mapper.jionSelect(user);
}
public int joinShouSubmit(JoinSubmitBeen been) {
return mapper.joinShouSubmit(been);
}
public int joinSelectByUser(JoinSubmitBeen been) {
return mapper.joinSelectByUser(been);
}
}

@ -27,4 +27,25 @@
<select id="jionSelect" resultType="string">
select cargo_frame_epc from ledger_instant_binding where create_by = #{user} group by cargo_frame_epc;
</select>
<update id="joinShouSubmit" parameterType="com.bgs.webapi.doman.JoinSubmitBeen">
update ledger_instant_binding set create_by=#{user} where cargo_frame_epc in
<foreach collection="list" open="(" close=")" item="item" separator=",">
#{item}
</foreach>
</update>
<select id="joinSelectByUser" parameterType="com.bgs.webapi.doman.JoinSubmitBeen">
select count(1) from ledger_instant_binding
<where>
cargo_frame_epc in
<foreach collection="list" open="(" close=")" item="item" separator=",">
#{item}
</foreach>
and create_by=#{user}
</where>
</select>
</mapper>
Loading…
Cancel
Save