pull/49/head
Chengliang 3 years ago
parent 13345f7c50
commit eeefde07ed

@ -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;
} }

@ -17,7 +17,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>

@ -3,6 +3,7 @@ package com.engine.organization.service.impl;
import com.cloudstore.eccom.result.WeaResultMsg; import com.cloudstore.eccom.result.WeaResultMsg;
import com.engine.core.impl.Service; import com.engine.core.impl.Service;
import com.engine.organization.component.OrganizationWeaTable; import com.engine.organization.component.OrganizationWeaTable;
import com.engine.organization.entity.detach.vo.ManagerDetachVO;
import com.engine.organization.entity.personnelcard.po.CardAccessPO; import com.engine.organization.entity.personnelcard.po.CardAccessPO;
import com.engine.organization.entity.personnelcard.vo.CardAccessVO; import com.engine.organization.entity.personnelcard.vo.CardAccessVO;
import com.engine.organization.mapper.personnelcard.CardAccessMapper; import com.engine.organization.mapper.personnelcard.CardAccessMapper;
@ -10,7 +11,7 @@ import com.engine.organization.service.CardAccessService;
import com.engine.organization.util.HasRightUtil; import com.engine.organization.util.HasRightUtil;
import com.engine.organization.util.db.MapperProxyFactory; import com.engine.organization.util.db.MapperProxyFactory;
import weaver.general.Util; import weaver.general.Util;
import weaver.hrm.User;
import java.util.*; import java.util.*;
@ -24,15 +25,10 @@ public class CardAccessServiceImpl extends Service implements CardAccessService
private static final String RIGHT_NAME = "CardAccess:All"; private static final String RIGHT_NAME = "CardAccess:All";
private static CardAccessMapper getCardAccessMapper() { private CardAccessMapper getCardAccessMapper() {
return MapperProxyFactory.getProxy(CardAccessMapper.class); return MapperProxyFactory.getProxy(CardAccessMapper.class);
} }
public CardAccessServiceImpl(User user) {
super();
this.user = user;
}
@Override @Override
public Map<String, Object> tablePage() { public Map<String, Object> tablePage() {
Map<String, Object> resultMap = new HashMap<>(); Map<String, Object> resultMap = new HashMap<>();
@ -58,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);
@ -88,4 +85,5 @@ public class CardAccessServiceImpl extends Service implements CardAccessService
return getCardAccessMapper().updateTabName(name,id); return getCardAccessMapper().updateTabName(name,id);
} }
} }

@ -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