Commit 5ae2d1ad by zhangtw

审批权限

parent bb3880d1
...@@ -40,6 +40,8 @@ public class KeyDmBorrowServiceImpl { ...@@ -40,6 +40,8 @@ public class KeyDmBorrowServiceImpl {
@ApiOperation(value = "待审核列表", desc = "分页查询待审核") @ApiOperation(value = "待审核列表", desc = "分页查询待审核")
public Page<Map<String, Object>> selectPendingList(Map<String, Object> map) { public Page<Map<String, Object>> selectPendingList(Map<String, Object> map) {
if (map == null) map = new HashMap<>(); if (map == null) map = new HashMap<>();
Map<String, Object> user = (Map<String, Object>) map.get("_user");
map.put("params", user);
return commonService.findPage(namespace + "selectPendingList", map); return commonService.findPage(namespace + "selectPendingList", map);
} }
......
...@@ -10,6 +10,7 @@ import com.scpyun.platform.jilinsscgsdp.utils.DataScopeUtil; ...@@ -10,6 +10,7 @@ import com.scpyun.platform.jilinsscgsdp.utils.DataScopeUtil;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -241,7 +242,15 @@ public class KeyDmUserCategoryServiceImpl { ...@@ -241,7 +242,15 @@ public class KeyDmUserCategoryServiceImpl {
@ApiOperation(value = "获取人员权限配置列表", desc = "从字典获取权限并关联用户") @ApiOperation(value = "获取人员权限配置列表", desc = "从字典获取权限并关联用户")
public List<Map<String, Object>> selectOrgPermission(Map<String, Object> map) { public List<Map<String, Object>> selectOrgPermission(Map<String, Object> map) {
if (map == null) map = new HashMap<>(); if (map == null) map = new HashMap<>();
return commonService.findList(namespace + "selectOrgPermission", map); Map<String, Object> user = (Map<String, Object>) map.get("_user");
String leader = commonService.getObject(namespace + "findLeader", user.get("id"));
List<Map<String, Object>> userList = commonService.findList(namespace + "selectOrgPermission", map);
for (Map<String, Object> map1 : userList) {
if (map1.get("id") != null && map1.get("id").equals(leader)){
map1.put("leader",1);
}
}
return userList;
} }
// ===== 图表分析 ===== // ===== 图表分析 =====
......
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
<where> <where>
is_used = 1 is_used = 1
AND approval_status = 1 AND approval_status = 1
and approver_id = #{params.params.id}
</where> </where>
ORDER BY submit_time DESC ORDER BY submit_time DESC
</select> </select>
...@@ -66,7 +67,7 @@ ...@@ -66,7 +67,7 @@
</update> </update>
<update id="submit" parameterType="map"> <update id="submit" parameterType="map">
UPDATE jl_key_dm_borrow_application SET approval_status = 1, submit_time = NOW(), update_by = #{_user.id}, update_time = NOW() WHERE id = #{id} UPDATE jl_key_dm_borrow_application SET approver_id = #{approver_id}, approver_name = #{approver_name}, approval_status = 1, submit_time = NOW(), update_by = #{_user.id}, update_time = NOW() WHERE id = #{id}
</update> </update>
<update id="revoke" parameterType="map"> <update id="revoke" parameterType="map">
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
) VALUES ) VALUES
<foreach collection="details" item="item" separator=","> <foreach collection="details" item="item" separator=",">
( (
UUID(),#{item.category_id},#{item.material_id},#{op_type},#{id},#{item.material_id},#{item.apply_quantity},#{item.unit_price},#{item.total_amount},1,#{create_by},NOW() UUID(),#{item.category_id},#{item.material_id},#{op_type},#{id},#{item.material_id},#{item.apply_quantity},#{item.unit_price},#{item.total_amount},1,#{approver_id},NOW()
) )
</foreach> </foreach>
</insert> </insert>
......
...@@ -501,13 +501,13 @@ ...@@ -501,13 +501,13 @@
left join jl_key_dm_user u on p.user_id = u.id left join jl_key_dm_user u on p.user_id = u.id
<where> <where>
AND is_used = 1 AND is_used = 1
<if test="_user.company_id != null and _user.company_id != ''"> <if test="_user.company_id != null">
AND u.office_id = #{_user.company_id} AND u.office_id = #{_user.company_id}
</if> </if>
<if test="_user.id != null and _user.id != ''"> <if test="_user.id != null and _user.id != ''">
AND u.id != #{_user.id} AND u.id != #{_user.id}
</if> </if>
<if test="permissionType != null and permissionType != ''"> <if test="permissionType != null">
AND p.permission_code = #{permissionType} AND p.permission_code = #{permissionType}
</if> </if>
</where> </where>
...@@ -719,5 +719,9 @@ ...@@ -719,5 +719,9 @@
update_time = NOW() update_time = NOW()
WHERE id = #{user_id} WHERE id = #{user_id}
</update> </update>
<select id="findLeader" parameterType="String" resultType="String">
select leader from jl_key_dm_user where id = #{param}
</select>
</mapper> </mapper>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论