Commit 775d91b5 by yinyong

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

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