Commit 775d91b5 by yinyong

财务人员主体审核权限配置功能、审核单筛选

parent c0c11e02
......@@ -110,10 +110,12 @@ public class UserController {
String userid = request.getParameter("userid");
String isadminStr = request.getParameter("isadmin");
String isfinansysStr = request.getParameter("isfinansys");
String authority = request.getParameter("authority");
UserDomain user = new UserDomain();
user.setUserid(Integer.parseInt(userid));
user.setIsadmin(Integer.parseInt(isadminStr));
user.setIsfinansys(Integer.parseInt(isfinansysStr));
user.setAuthority(authority);
Integer result = userService.updateUser(user);
return user;
}
......
......@@ -49,7 +49,9 @@ public class CostCheckSearchController {
pageSize = Integer.parseInt(pageSizeStr);
}
Map<String, Object> all = costCheckSearchService.getAll(pageNum, pageSize);
Integer userId = Integer.valueOf(request.getParameter("userId"));
String authority = costCheckSearchService.findAuthorityByUserid(userId);
Map<String, Object> all = costCheckSearchService.getAll(pageNum, pageSize, authority);
return all;
}
......
......@@ -55,6 +55,13 @@ public class CostTypeController {
return allCompany;
}
@GetMapping("/getAllCompanyAuthority")
public List<CostCompanyDomain> getAllCompanyAuthority(HttpServletResponse response, HttpServletRequest request) {
AxiosUtil.setCors(response, request);
List<CostCompanyDomain> allCompany = costCompanyService.getAllCompanyAuthority();
return allCompany;
}
@GetMapping("/syncAllCompany")
public Map<String, Object> syncAllCompany(HttpServletResponse response, HttpServletRequest request){
AxiosUtil.setCors(response, request);
......
......@@ -21,7 +21,9 @@ public interface CostCheckSearchDao {
List<CostDomain> selectByKeys(CostCheckSearchKeysVo searchKeysVo);
List<CostDomain> selectAll();
List<CostDomain> selectAll(@Param("authority") String authority);
String findAuthorityByUserid(int parseInt);
List<CostDomain> selectLinkList();
......
......@@ -44,6 +44,8 @@ public interface CostCompanyDao {
*/
List<CostCompanyDomain> selectAll();
List<CostCompanyDomain> getAllCompanyAuthority();
/**
* 根据主体名获取主体
* @param companyName
......
......@@ -9,7 +9,9 @@ import java.util.Map;
public interface CostCheckSearchService {
Map<String,Object> getAll(Integer pageNum,Integer pageSize);
Map<String,Object> getAll(Integer pageNum,Integer pageSize, String authority);
String findAuthorityByUserid(Integer userId);
/**
* 通过关键字模糊查询
......
......@@ -25,6 +25,8 @@ public interface CostCompanyService {
*/
List<CostCompanyDomain> getAllCompany();
List<CostCompanyDomain> getAllCompanyAuthority();
/**
* 根据 companyNo 获取付款主体
* @param companyNo
......
package com.blt.other.other_cost.service.impl;
import com.blt.other.other_auth.service.UserService;
import com.blt.other.other_cost.dao.CostCheckSearchDao;
import com.blt.other.other_cost.dto.CostDto;
import com.blt.other.other_cost.service.CostCheckSearchService;
......@@ -7,6 +8,7 @@ import com.blt.other.other_cost.service.CostListSearchService;
import com.blt.other.other_cost.service.CostService;
import com.blt.other.other_cost.vo.CostCheckSearchKeysVo;
import com.blt.other.other_database.model.CostDomain;
import com.blt.other.other_database.model.UserDomain;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -26,10 +28,11 @@ public class CostCheckSearchServiceImpl implements CostCheckSearchService {
private CostListSearchService costListSearchService;
@Autowired
private CostService costService;
@Override
public Map<String, Object> getAll(Integer pageNum, Integer pageSize) {
public Map<String, Object> getAll(Integer pageNum, Integer pageSize, String authority) {
PageHelper.startPage(pageNum,pageSize);
List<CostDomain> costDomains = costCheckSearchDao.selectAll();
List<CostDomain> costDomains = costCheckSearchDao.selectAll(authority);
PageInfo<CostDomain> pageInfo = new PageInfo<>(costDomains);
Map<String,Object> map = new HashMap<>();
map.put("pageInfo",pageInfo);
......@@ -37,6 +40,10 @@ public class CostCheckSearchServiceImpl implements CostCheckSearchService {
return map;
}
public String findAuthorityByUserid(Integer userId) {
return costCheckSearchDao.findAuthorityByUserid(userId);
}
@Override
public Map<String, Object> seachByKey(String key,int pageNum,int pageSize) {
Map<String,Object> map = new HashMap<>();
......
......@@ -80,6 +80,12 @@ public class CostCompanyServiceImpl implements CostCompanyService {
return costCompanyDomains;
}
@Override
public List<CostCompanyDomain> getAllCompanyAuthority() {
List<CostCompanyDomain> costCompanyDomains = costCompanyDao.getAllCompanyAuthority();
return costCompanyDomains;
}
/**
* 根据 companyNo 获取 company
* @param companyNo
......
......@@ -31,6 +31,7 @@ public class UserDomain {
private Integer isvalid;
private Integer isadmin; // 是否是管理员,0普通用户,1管理员
private Integer isfinansys; // 是否是财务 0 不是 1 是
private String authority;
public Integer getUserid() {
return userid;
......@@ -208,6 +209,14 @@ public class UserDomain {
this.isfinansys = isfinansys;
}
public String getAuthority() {
return authority;
}
public void setAuthority(String authority) {
this.authority = authority;
}
@Override
public String toString() {
return "UserDomain{" +
......
......@@ -56,7 +56,7 @@ url:
getBuyDetailApi: ${url.my.baseServerUrl}/purchase/other/purchasing/buy/detail
getCostDetailApi: ${url.my.baseServerUrl}/purchase/other/cost/finansys/detail
api:
baseServerUrl: http://www.bailuntec.com
baseServerUrl: http://oa.bailuntec.com
baseFinansysUrl: http://cw.bailuntec.com
buyUserApi: ${url.api.baseServerUrl}/Api/User/GetUser
logingUserApi: ${url.api.baseServerUrl}/Login/GetUserByBLUserAcct
......
......@@ -9,10 +9,15 @@
cost
WHERE
cost_status > 0
AND FIND_IN_SET(company_value, #{authority})
ORDER BY
id DESC
</select>
<select id="findAuthorityByUserid" resultType="java.lang.String">
select authority from user where userid = #{userid} or useridsso = #{userid}
</select>
<select id="selectByKey" resultType="com.blt.other.other_database.model.CostDomain">
SELECT
*
......
......@@ -57,4 +57,13 @@
FROM
cost_company
</select>
<select id="getAllCompanyAuthority" resultType="com.blt.other.other_database.model.CostCompanyDomain">
SELECT
value as id,
company_name,
value
FROM
cost_company
</select>
</mapper>
\ No newline at end of file
......@@ -59,7 +59,8 @@
<if test="sign != null">sign=#{sign},</if>
<if test="isvalid != null">isvalid=#{isvalid},</if>
<if test="isfinansys != null">isfinansys=#{isfinansys},</if>
<if test="isadmin != null">isadmin=#{isadmin}</if>
<if test="isadmin != null">isadmin=#{isadmin},</if>
<if test="authority != null">authority=#{authority}</if>
</set>
WHERE
userid = #{userid}
......
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