接口 #49

Merged
liang.cheng merged 1 commits from feature/cl into develop 2 years ago

@ -570,10 +570,25 @@ create table JCL_ORG_CARDACCESS (
all_people int null,
superior int null,
all_superior int null,
custom text null ,
custom varchar(2000) null ,
delete_type int null,
creator int null,
create_time date null,
update_time date null,
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")
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;
}

@ -17,7 +17,7 @@ public interface CardAccessMapper {
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);

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

@ -3,6 +3,7 @@ package com.engine.organization.service.impl;
import com.cloudstore.eccom.result.WeaResultMsg;
import com.engine.core.impl.Service;
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.vo.CardAccessVO;
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.db.MapperProxyFactory;
import weaver.general.Util;
import weaver.hrm.User;
import java.util.*;
@ -24,15 +25,10 @@ public class CardAccessServiceImpl extends Service implements CardAccessService
private static final String RIGHT_NAME = "CardAccess:All";
private static CardAccessMapper getCardAccessMapper() {
private CardAccessMapper getCardAccessMapper() {
return MapperProxyFactory.getProxy(CardAccessMapper.class);
}
public CardAccessServiceImpl(User user) {
super();
this.user = user;
}
@Override
public Map<String, Object> tablePage() {
Map<String, Object> resultMap = new HashMap<>();
@ -58,16 +54,17 @@ public class CardAccessServiceImpl extends Service implements CardAccessService
@Override
public int save(Map<String, Object> params) {
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++) {
HashMap<String, Object> data = new HashMap<>();
data.put("id", params.get("id_" + i));
data.put("status", params.get("status_" + i));
data.put("allPeople", params.get("all_people_" + i));
data.put("superior", params.get("superior_" + i));
data.put("allSuperior", params.get("all_superior_" + i));
data.put("custom", params.get("custom" + i));
data.put("updateTime", new Date());
CardAccessPO data = CardAccessPO.builder()
.id(Util.getIntValue((String)params.get("id_"+i)))
.status(Util.getIntValue((String)params.get("status_"+i)))
.allPeople(Util.getIntValue((String)params.get("all_people_"+i)))
.superior(Util.getIntValue((String)params.get("superior_"+i)))
.allSuperior(Util.getIntValue((String)params.get("all_superior_"+i)))
.custom(Util.null2String(params.get("custom_"+i)))
.updateTime(new Date())
.build();
dataList.add(data);
}
return getCardAccessMapper().saveCardAccess(dataList);
@ -84,8 +81,9 @@ public class CardAccessServiceImpl extends Service implements CardAccessService
}
@Override
public int updateTabName(String name, Integer id) {
return getCardAccessMapper().updateTabName(name, id);
public int updateTabName(String name,Integer 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