人员卡片菜单权限接口
This commit is contained in:
parent
6c15f7fc3c
commit
dc347c755d
|
|
@ -5,7 +5,9 @@ import com.engine.organization.entity.personnelcard.po.CardAccessPO;
|
|||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Author weaver_cl
|
||||
|
|
@ -17,9 +19,11 @@ public interface CardAccessMapper {
|
|||
|
||||
int insertIgnoreNull(CardAccessPO cardAccessPO);
|
||||
|
||||
int updateCardAccess(CardAccessPO cardAccessPO);
|
||||
int saveCardAccess(@Param("dataList") List<HashMap<String, Object>> dataList);
|
||||
|
||||
int deleteByIds(@Param("ids") Collection<Long> ids);
|
||||
|
||||
ManagerDetachPO selectById(@Param("id") Integer id);
|
||||
|
||||
int updateTabName(@Param("name")String name,@Param("id") Integer id);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -187,21 +187,35 @@
|
|||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateCardAccess" parameterType="com.engine.organization.entity.personnelcard.po.CardAccessPO">
|
||||
update jcl_org_cardaccess
|
||||
<set>
|
||||
type_id=#{typeId},
|
||||
type_name=#{typeName},
|
||||
status=#{status},
|
||||
all_people=#{allPeople},
|
||||
all_superior=#{allSuperior},
|
||||
custom=#{custom},
|
||||
update_time=#{updateTime},
|
||||
</set>
|
||||
WHERE id = #{id} AND delete_type = 0
|
||||
</update>
|
||||
|
||||
|
||||
<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}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<update id="deleteByIds">
|
||||
UPDATE jcl_org_cardaccess
|
||||
SET delete_type = 1
|
||||
|
|
@ -214,7 +228,6 @@
|
|||
|
||||
|
||||
|
||||
|
||||
<select id="selectById" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="baseColumns"/>
|
||||
|
|
@ -222,4 +235,12 @@
|
|||
WHERE delete_type = 0
|
||||
AND id = #{id}
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
<update id="updateTabName">
|
||||
UPDATE jcl_org_cardaccess
|
||||
SET type_name = #{name}
|
||||
WHERE id = #{id}
|
||||
</update>
|
||||
</mapper>
|
||||
|
|
@ -1,5 +1,8 @@
|
|||
package com.engine.organization.service;
|
||||
|
||||
import com.engine.organization.entity.personnelcard.po.CardAccessPO;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
|
|
@ -10,9 +13,46 @@ import java.util.Map;
|
|||
**/
|
||||
public interface CardAccessService {
|
||||
|
||||
/**
|
||||
* 列表接口
|
||||
* @return
|
||||
*/
|
||||
Map<String, Object> tablePage();
|
||||
|
||||
/**
|
||||
* 页面权限
|
||||
* @return
|
||||
*/
|
||||
Map<String, Object> hasRight();
|
||||
|
||||
/**
|
||||
* 列表保存
|
||||
* @param params
|
||||
* @return
|
||||
*/
|
||||
int save(Map<String, Object> params);
|
||||
|
||||
|
||||
/**
|
||||
* 删除
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
int deleteByIds(Collection<Long> ids);
|
||||
|
||||
/**
|
||||
* 新增
|
||||
* @param cardAccessPO
|
||||
* @return
|
||||
*/
|
||||
int addData(CardAccessPO cardAccessPO);
|
||||
|
||||
/**
|
||||
* 更新tab名称
|
||||
* @param name
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
int updateTabName(String name,Integer id);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,11 +4,15 @@ 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.mapper.personnelcard.CardAccessMapper;
|
||||
import com.engine.organization.service.CardAccessService;
|
||||
import com.engine.organization.util.HasRightUtil;
|
||||
import com.engine.organization.util.db.MapperProxyFactory;
|
||||
import weaver.general.Util;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @Author weaver_cl
|
||||
|
|
@ -20,6 +24,10 @@ public class CardAccessServiceImpl extends Service implements CardAccessService
|
|||
|
||||
private static final String RIGHT_NAME = "CardAccess:All";
|
||||
|
||||
private CardAccessMapper getCardAccessMapper() {
|
||||
return MapperProxyFactory.getProxy(CardAccessMapper.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> tablePage() {
|
||||
Map<String, Object> resultMap = new HashMap<>();
|
||||
|
|
@ -44,8 +52,35 @@ public class CardAccessServiceImpl extends Service implements CardAccessService
|
|||
|
||||
@Override
|
||||
public int save(Map<String, Object> params) {
|
||||
|
||||
return 0;
|
||||
int rowNum = Util.getIntValue((String) params.get("rownum"));
|
||||
List<HashMap<String, Object>> 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());
|
||||
dataList.add(data);
|
||||
}
|
||||
return getCardAccessMapper().saveCardAccess(dataList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteByIds(Collection<Long> ids) {
|
||||
return getCardAccessMapper().deleteByIds(ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int addData(CardAccessPO cardAccessPO) {
|
||||
return getCardAccessMapper().insertIgnoreNull(cardAccessPO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateTabName(String name,Integer id) {
|
||||
return getCardAccessMapper().updateTabName(name,id);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue