pull/46/head
Chengliang 2 years ago
parent c2a1908c10
commit 4777e3d3dc

@ -570,10 +570,25 @@ create table JCL_ORG_CARDACCESS (
all_people int null, all_people int null,
superior int null, superior int null,
all_superior int null, all_superior int null,
custom text null , custom varchar(2000) null ,
delete_type int null, delete_type int null,
creator int null, creator int null,
create_time date null, create_time date null,
update_time date null, update_time date null,
constraint JCL_ORG_CARDACCESS_PK primary key (id) constraint JCL_ORG_CARDACCESS_PK primary key (id)
); );
-- JCL_ORG_CARDBUTTON
create table JCL_ORG_CARDBUTTON (
id BIGINT auto_increment not null,
name varchar(255) not null,
status int null,
url varchar(255) null,
role varchar(2000) null,
defaults int not null,
creator int null,
delete_type int null,
create_time date null,
update_time date null,
constraint JCL_ORG_CARDBUTTON_PK primary key (id)
);

@ -55,7 +55,7 @@ public class CardAccessVO {
@OrganizationTableColumn(text = "所有上级可见", width = "15%", column = "all_superior") @OrganizationTableColumn(text = "所有上级可见", width = "15%", column = "all_superior")
private Integer allSuperior; private Integer allSuperior;
@OrganizationTableColumn(text = "查看自定义", width = "15%", column = "custom",transmethod = "com.engine.organization.transmethod.ManagerDetachTransMethod.getRoleLevel") @OrganizationTableColumn(text = "查看自定义", width = "15%", column = "custom",transmethod = "com.engine.organization.transmethod.SystemTransMethod.getRoleName")
private String custom; private String custom;
} }

@ -19,7 +19,7 @@ public interface CardAccessMapper {
int insertIgnoreNull(CardAccessPO cardAccessPO); int insertIgnoreNull(CardAccessPO cardAccessPO);
int saveCardAccess(@Param("dataList") List<HashMap<String, Object>> dataList); int saveCardAccess(@Param("dataList") List<CardAccessPO> dataList);
int deleteByIds(@Param("ids") Collection<Long> ids); int deleteByIds(@Param("ids") Collection<Long> ids);

@ -42,7 +42,7 @@
<if test="typeId != null "> <if test="typeId != null ">
type_id, type_id,
</if> </if>
<if test="typeName != null || typeName != ''"> <if test="typeName != null and typeName != ''">
type_name, type_name,
</if> </if>
<if test="status != null "> <if test="status != null ">
@ -77,7 +77,7 @@
<if test="typeId != null "> <if test="typeId != null ">
#{typeId}, #{typeId},
</if> </if>
<if test="typeName != null || typeName != ''"> <if test="typeName != null and typeName != ''">
#{typeName}, #{typeName},
</if> </if>
<if test="status != null "> <if test="status != null ">
@ -119,7 +119,7 @@
<if test="typeId != null "> <if test="typeId != null ">
type_id, type_id,
</if> </if>
<if test="typeName != null || typeName != ''"> <if test="typeName != null and typeName != ''">
type_name, type_name,
</if> </if>
<if test="status != null "> <if test="status != null ">
@ -154,7 +154,7 @@
<if test="typeId != null "> <if test="typeId != null ">
#{typeId}, #{typeId},
</if> </if>
<if test="typeName != null || typeName != ''"> <if test="typeName != null and typeName != ''">
#{typeName}, #{typeName},
</if> </if>
<if test="status != null "> <if test="status != null ">
@ -189,30 +189,53 @@
<update id="saveCardAccess"> <update id="saveCardAccess" parameterType="java.util.List">
<foreach collection="dataList" item="item" index="index" open="" close="" separator=";">
update jcl_org_cardaccess update jcl_org_cardaccess
<set> <trim prefix="set" suffixOverrides=",">
<trim prefix="status =case" suffix="end,">
<foreach collection="dataList" item="item" index="index">
<if test="item.status != null"> <if test="item.status != null">
status = #{item.status}, when id=#{item.id} then #{item.status}
</if> </if>
</foreach>
</trim>
<trim prefix="all_people =case" suffix="end,">
<foreach collection="dataList" item="item" index="index">
<if test="item.allPeople != null"> <if test="item.allPeople != null">
all_people = #{item.allPeople}, when id=#{item.id} then #{item.allPeople}
</if> </if>
</foreach>
</trim>
<trim prefix="superior =case" suffix="end,">
<foreach collection="dataList" item="item" index="index">
<if test="item.superior != null"> <if test="item.superior != null">
superior = #{item.superior}, when id=#{item.id} then #{item.superior}
</if> </if>
</foreach>
</trim>
<trim prefix="all_superior =case" suffix="end,">
<foreach collection="dataList" item="item" index="index">
<if test="item.allSuperior != null"> <if test="item.allSuperior != null">
all_superior = #{item.allSuperior}, when id=#{item.id} then #{item.allSuperior}
</if>
<if test="item.custom != null">
custom = #{item.custom},
</if> </if>
</foreach>
</trim>
<trim prefix="custom =case" suffix="end,">
<foreach collection="dataList" item="item" index="index">
when id=#{item.id} then #{item.custom}
</foreach>
</trim>
<trim prefix="update_time =case" suffix="end,">
<foreach collection="dataList" item="item" index="index">
<if test="item.updateTime != null"> <if test="item.updateTime != null">
update_time = #{item.updateTime} when id=#{item.id} then #{item.updateTime}
</if> </if>
</set> </foreach>
where id = #{item.id} </trim>
</trim>
where
<foreach collection="dataList" separator="or" item="item" index="index" >
id=#{item.id}
</foreach> </foreach>
</update> </update>

@ -54,16 +54,17 @@ public class CardAccessServiceImpl extends Service implements CardAccessService
@Override @Override
public int save(Map<String, Object> params) { public int save(Map<String, Object> params) {
int rowNum = Util.getIntValue((String) params.get("rownum")); int rowNum = Util.getIntValue((String) params.get("rownum"));
List<HashMap<String, Object>> dataList = new ArrayList<>(); List<CardAccessPO> dataList = new ArrayList<>();
for (int i = 0; i < rowNum; i++) { for (int i = 0; i < rowNum; i++) {
HashMap<String, Object> data = new HashMap<>(); CardAccessPO data = CardAccessPO.builder()
data.put("id",params.get("id_"+i)); .id(Util.getIntValue((String)params.get("id_"+i)))
data.put("status",params.get("status_"+i)); .status(Util.getIntValue((String)params.get("status_"+i)))
data.put("allPeople",params.get("all_people_"+i)); .allPeople(Util.getIntValue((String)params.get("all_people_"+i)))
data.put("superior",params.get("superior_"+i)); .superior(Util.getIntValue((String)params.get("superior_"+i)))
data.put("allSuperior",params.get("all_superior_"+i)); .allSuperior(Util.getIntValue((String)params.get("all_superior_"+i)))
data.put("custom",params.get("custom"+i)); .custom(Util.null2String(params.get("custom_"+i)))
data.put("updateTime",new Date()); .updateTime(new Date())
.build();
dataList.add(data); dataList.add(data);
} }
return getCardAccessMapper().saveCardAccess(dataList); return getCardAccessMapper().saveCardAccess(dataList);

@ -0,0 +1,28 @@
package com.engine.organization.transmethod;
import org.apache.commons.lang3.StringUtils;
import weaver.hrm.roles.RolesComInfo;
import java.util.ArrayList;
import java.util.List;
/**
* @Author weaver_cl
* @Description:
* @Date 2022/11/9
* @Version V1.0
**/
public class SystemTransMethod {
public static String getRoleName(String roleIds) {
RolesComInfo rolesComInfo = new RolesComInfo();
List<String> list = new ArrayList<>();
if (StringUtils.isNotBlank(roleIds)) {
for (String roleId : roleIds.split(",")) {
list.add(rolesComInfo.getRolesname(roleId));
}
}
return StringUtils.join(list,",");
}
}
Loading…
Cancel
Save