commit
b984af0ad5
|
|
@ -2,6 +2,7 @@ package com.engine.organization.mapper.hrmresource;
|
|||
|
||||
|
||||
import com.engine.organization.entity.TreeData;
|
||||
import com.engine.organization.entity.hrmresource.po.ResourceItemClassPO;
|
||||
import com.engine.organization.entity.hrmresource.po.ResourceItemPO;
|
||||
import org.apache.ibatis.annotations.MapKey;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
|
@ -25,17 +26,30 @@ public interface ResourceBasicInfoMapper {
|
|||
List<Map<String, Object>> browserDatas(@Param("ids") Collection<Long> ids);
|
||||
|
||||
|
||||
ResourceItemPO getResourceItemByFid(@Param("fid")Integer fid);
|
||||
ResourceItemPO getResourceItemByFid(@Param("fid") Integer fid);
|
||||
|
||||
List<ResourceItemPO> selectItemByIds(@Param("ids")Collection<Long> ids);
|
||||
List<ResourceItemPO> selectItemByIds(@Param("ids") Collection<Long> ids);
|
||||
|
||||
int deleteByIds(@Param("ids")Collection<Long> ids);
|
||||
int deleteByIds(@Param("ids") Collection<Long> ids);
|
||||
|
||||
int recoverByIds(@Param("ids")Collection<Long> ids);
|
||||
int recoverByIds(@Param("ids") Collection<Long> ids);
|
||||
|
||||
List<ResourceItemPO> selectItemByFNo(@Param("fno")String fno,@Param("fclassid")Integer fclassid);
|
||||
List<ResourceItemPO> selectItemByFNo(@Param("fno") String fno, @Param("fclassid") Integer fclassid);
|
||||
|
||||
int insertIgnoreNull(ResourceItemPO resourceItemPO);
|
||||
|
||||
int update(ResourceItemPO resourceItemPO);
|
||||
|
||||
ResourceItemClassPO getResourceItemClassByFid(@Param("fid") Integer fid);
|
||||
|
||||
List<ResourceItemClassPO> selectItemClassByFNo(@Param("fno") String fno, @Param("fid") Integer fid);
|
||||
|
||||
int saveResourceItemClass(ResourceItemClassPO itemClassPO);
|
||||
|
||||
int updateResourceItemClass(ResourceItemClassPO itemClassPO);
|
||||
|
||||
int deleteResourceItemClass(@Param("fid") Integer fid);
|
||||
|
||||
List<ResourceItemPO> getItemByClassId(@Param("fclassid") Integer fclassid);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,6 +10,12 @@
|
|||
<result column="fmemo" property="fmemo"/>
|
||||
<result column="fdelete" property="fdelete"/>
|
||||
</resultMap>
|
||||
<resultMap id="ItemClassResultMap" type="com.engine.organization.entity.hrmresource.po.ResourceItemClassPO">
|
||||
<result column="fid" property="fid"/>
|
||||
<result column="fno" property="fno"/>
|
||||
<result column="fname" property="fname"/>
|
||||
<result column="fmemo" property="fmemo"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="TreeResultMap" type="com.engine.organization.entity.TreeData">
|
||||
<result column="fid" property="key"/>
|
||||
|
|
@ -33,11 +39,19 @@
|
|||
</select>
|
||||
|
||||
|
||||
|
||||
<select id="getResourceItemByFid" resultType="com.engine.organization.entity.hrmresource.po.ResourceItemPO">
|
||||
select fid,fclassid,fno,fname,fmemo,fdelete,creator,create_time,update_time
|
||||
select fid,
|
||||
fclassid,
|
||||
fno,
|
||||
fname,
|
||||
fmemo,
|
||||
fdelete,
|
||||
creator,
|
||||
create_time,
|
||||
update_time
|
||||
from jcl_org_item
|
||||
where fdelete = 0 and fid = #{fid}
|
||||
where fdelete = 0
|
||||
and fid = #{fid}
|
||||
</select>
|
||||
|
||||
|
||||
|
|
@ -53,10 +67,18 @@
|
|||
|
||||
|
||||
<select id="selectItemByFNo" resultMap="ItemResultMap">
|
||||
select fid,fclassid,fno,fname,fmemo,fdelete,creator,create_time,update_time
|
||||
select fid,
|
||||
fclassid,
|
||||
fno,
|
||||
fname,
|
||||
fmemo,
|
||||
fdelete,
|
||||
creator,
|
||||
create_time,
|
||||
update_time
|
||||
from jcl_org_item
|
||||
where fno = #{fno}
|
||||
and fclassid = #{fclassid}
|
||||
and fclassid = #{fclassid}
|
||||
</select>
|
||||
|
||||
<update id="deleteByIds">
|
||||
|
|
@ -81,7 +103,8 @@
|
|||
</update>
|
||||
|
||||
|
||||
<insert id="insertIgnoreNull" parameterType="com.engine.organization.entity.hrmresource.po.ResourceItemPO" keyProperty="fid"
|
||||
<insert id="insertIgnoreNull" parameterType="com.engine.organization.entity.hrmresource.po.ResourceItemPO"
|
||||
keyProperty="fid"
|
||||
keyColumn="fid" useGeneratedKeys="true">
|
||||
INSERT INTO jcl_org_item
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
|
|
@ -138,9 +161,10 @@
|
|||
</trim>
|
||||
</insert>
|
||||
|
||||
|
||||
<!--oracle未处理-->
|
||||
<!--<insert id="insertIgnoreNull" parameterType="com.engine.organization.entity.hrmresource.po.ResourceItemPO"-->
|
||||
<!--databaseId="oracle">-->
|
||||
<!--databaseId="oracle">-->
|
||||
<!--</insert>-->
|
||||
|
||||
<update id="update" parameterType="com.engine.organization.entity.hrmresource.po.ResourceItemPO">
|
||||
|
|
@ -152,4 +176,105 @@
|
|||
</set>
|
||||
WHERE fid = #{fid} AND fdelete = 0
|
||||
</update>
|
||||
|
||||
<select id="getResourceItemClassByFid" resultMap="ItemClassResultMap">
|
||||
select fid,
|
||||
fno,
|
||||
fname,
|
||||
fmemo,
|
||||
creator,
|
||||
create_time,
|
||||
update_time
|
||||
from jcl_org_itemclass
|
||||
where fid = #{fid}
|
||||
</select>
|
||||
|
||||
|
||||
<insert id="saveResourceItemClass">
|
||||
INSERT INTO jcl_org_itemclass
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="fno != null">
|
||||
fno,
|
||||
</if>
|
||||
<if test="fname != null">
|
||||
fname,
|
||||
</if>
|
||||
<if test="fmemo != null">
|
||||
fmemo,
|
||||
</if>
|
||||
<if test="creator != null">
|
||||
creator,
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time,
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
|
||||
<if test="fno != null">
|
||||
#{fno},
|
||||
</if>
|
||||
<if test="fname != null">
|
||||
#{fname},
|
||||
</if>
|
||||
<if test="fmemo != null">
|
||||
#{fmemo},
|
||||
</if>
|
||||
<if test="creator != null">
|
||||
#{creator},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
#{createTime},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
#{updateTime},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<select id="selectItemClassByFNo" resultMap="ItemClassResultMap">
|
||||
select fid,
|
||||
fno,
|
||||
fname,
|
||||
fmemo,
|
||||
creator,
|
||||
create_time,
|
||||
update_time
|
||||
from jcl_org_itemclass
|
||||
where fno = #{fno}
|
||||
<if test=" fid !=null ">
|
||||
and fid != #{fid}
|
||||
</if>
|
||||
</select>
|
||||
<select id="getItemByClassId" resultMap="ItemResultMap">
|
||||
select fid,
|
||||
fclassid,
|
||||
fno,
|
||||
fname,
|
||||
fmemo,
|
||||
fdelete,
|
||||
creator,
|
||||
create_time,
|
||||
update_time
|
||||
from jcl_org_item
|
||||
where fclassid = #{fclassid}
|
||||
</select>
|
||||
|
||||
<update id="updateResourceItemClass">
|
||||
update jcl_org_itemclass
|
||||
<set>
|
||||
fname=#{fname},
|
||||
fmemo=#{fmemo},
|
||||
update_time=#{updateTime},
|
||||
</set>
|
||||
WHERE fid = #{fid}
|
||||
</update>
|
||||
|
||||
<delete id="deleteResourceItemClass">
|
||||
delete
|
||||
from jcl_org_itemclass
|
||||
where fid = #{fid}
|
||||
</delete>
|
||||
</mapper>
|
||||
|
|
@ -2,6 +2,7 @@ package com.engine.organization.service;
|
|||
|
||||
import com.api.browser.bean.SearchConditionGroup;
|
||||
import com.engine.organization.entity.fieldset.vo.TypeTreeVO;
|
||||
import com.engine.organization.entity.hrmresource.po.ResourceItemClassPO;
|
||||
import com.engine.organization.entity.hrmresource.po.ResourceItemPO;
|
||||
|
||||
import java.util.Collection;
|
||||
|
|
@ -18,6 +19,7 @@ public interface ResourceBasicInfoService {
|
|||
|
||||
/**
|
||||
* 列表
|
||||
*
|
||||
* @param params
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -25,12 +27,14 @@ public interface ResourceBasicInfoService {
|
|||
|
||||
/**
|
||||
* 获取左侧树
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
List<TypeTreeVO> getTreeData();
|
||||
|
||||
/**
|
||||
* 新增编辑表单
|
||||
*
|
||||
* @param params
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -38,6 +42,7 @@ public interface ResourceBasicInfoService {
|
|||
|
||||
/**
|
||||
* 删除/批量删除人员信息资料
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -45,6 +50,7 @@ public interface ResourceBasicInfoService {
|
|||
|
||||
/**
|
||||
* 恢复人员信息资料
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -52,6 +58,7 @@ public interface ResourceBasicInfoService {
|
|||
|
||||
/**
|
||||
* 保存人员信息资料
|
||||
*
|
||||
* @param resourceItemPO
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -59,6 +66,7 @@ public interface ResourceBasicInfoService {
|
|||
|
||||
/**
|
||||
* 根据id获取人员信息资料
|
||||
*
|
||||
* @param fid
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -66,8 +74,39 @@ public interface ResourceBasicInfoService {
|
|||
|
||||
/**
|
||||
* 更新人员信息资料
|
||||
*
|
||||
* @param resourceItemPO
|
||||
* @return
|
||||
*/
|
||||
int update(ResourceItemPO resourceItemPO);
|
||||
|
||||
|
||||
/**
|
||||
* 分类,新增编辑表单
|
||||
* @param params
|
||||
* @return
|
||||
*/
|
||||
List<SearchConditionGroup> getItemClassForm(Map<String, Object> params);
|
||||
|
||||
/**
|
||||
* 新增分类
|
||||
* @param itemClassPO
|
||||
* @return
|
||||
*/
|
||||
int saveResourceItemClass(ResourceItemClassPO itemClassPO);
|
||||
|
||||
/**
|
||||
* 更新分类
|
||||
* @param itemClassPO
|
||||
* @return
|
||||
*/
|
||||
int updateResourceItemClass(ResourceItemClassPO itemClassPO);
|
||||
|
||||
/**
|
||||
* 删除分类
|
||||
* @param fid
|
||||
* @return
|
||||
*/
|
||||
int deleteResourceItemClass(Integer fid);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import com.engine.organization.component.OrganizationWeaTable;
|
|||
import com.engine.organization.entity.DeleteParam;
|
||||
import com.engine.organization.entity.TreeData;
|
||||
import com.engine.organization.entity.fieldset.vo.TypeTreeVO;
|
||||
import com.engine.organization.entity.hrmresource.po.ResourceItemClassPO;
|
||||
import com.engine.organization.entity.hrmresource.po.ResourceItemPO;
|
||||
import com.engine.organization.entity.hrmresource.vo.ResourceBasicInfoVO;
|
||||
import com.engine.organization.mapper.hrmresource.ResourceBasicInfoMapper;
|
||||
|
|
@ -18,6 +19,7 @@ import com.engine.organization.util.OrganizationAssert;
|
|||
import com.engine.organization.util.OrganizationFormItemUtil;
|
||||
import com.engine.organization.util.db.DBType;
|
||||
import com.engine.organization.util.db.MapperProxyFactory;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import weaver.conn.RecordSet;
|
||||
import weaver.general.Util;
|
||||
|
|
@ -42,13 +44,13 @@ public class ResourceBasicInfoServiceImpl extends Service implements ResourceBas
|
|||
|
||||
@Override
|
||||
public Map<String, Object> listPage(Map<String, Object> params) {
|
||||
Map<String,Object> resultMap = new HashMap<>();
|
||||
Map<String, Object> resultMap = new HashMap<>();
|
||||
boolean hasRight = HasRightUtil.hasRight(user, RIGHT_NAME, true);
|
||||
resultMap.put("hasRight", hasRight);
|
||||
if (!hasRight) {
|
||||
return resultMap;
|
||||
}
|
||||
OrganizationWeaTable<ResourceBasicInfoVO> table = new OrganizationWeaTable<>(user,ResourceBasicInfoVO.class);
|
||||
OrganizationWeaTable<ResourceBasicInfoVO> table = new OrganizationWeaTable<>(user, ResourceBasicInfoVO.class);
|
||||
String sqlWhere = buildSqlWhere(params);
|
||||
table.setSqlwhere(sqlWhere);
|
||||
WeaResultMsg result = new WeaResultMsg(false);
|
||||
|
|
@ -99,9 +101,9 @@ public class ResourceBasicInfoServiceImpl extends Service implements ResourceBas
|
|||
fName.setRules("required|string");
|
||||
SearchConditionItem fMemo = OrganizationFormItemUtil.textareaItem(user, 2, 17, true, 2, 60, "说明", "fmemo");
|
||||
|
||||
if(StringUtils.isNotBlank(id)) {
|
||||
if (StringUtils.isNotBlank(id)) {
|
||||
ResourceItemPO resourceItemPO = getResourceBasicInfoMapper().getResourceItemByFid(Integer.parseInt(id));
|
||||
OrganizationAssert.notNull(resourceItemPO,"选择的数据不存在");
|
||||
OrganizationAssert.notNull(resourceItemPO, "选择的数据不存在");
|
||||
BrowserBean browserBean = resourceTypeItem.getBrowserConditionParam();
|
||||
List<Map<String, Object>> maps = getResourceBasicInfoMapper().browserDatas(DeleteParam.builder().ids(resourceItemPO.getFid().toString()).build().getIds());
|
||||
browserBean.setReplaceDatas(maps);
|
||||
|
|
@ -135,8 +137,8 @@ public class ResourceBasicInfoServiceImpl extends Service implements ResourceBas
|
|||
|
||||
@Override
|
||||
public int save(ResourceItemPO resourceItemPO) {
|
||||
List<ResourceItemPO> list = getResourceBasicInfoMapper().selectItemByFNo(resourceItemPO.getFno(),resourceItemPO.getFclassid());
|
||||
OrganizationAssert.isEmpty(list,"编号不允许重复");
|
||||
List<ResourceItemPO> list = getResourceBasicInfoMapper().selectItemByFNo(resourceItemPO.getFno(), resourceItemPO.getFclassid());
|
||||
OrganizationAssert.isEmpty(list, "编号不允许重复");
|
||||
return getResourceBasicInfoMapper().insertIgnoreNull(resourceItemPO);
|
||||
}
|
||||
|
||||
|
|
@ -150,6 +152,56 @@ public class ResourceBasicInfoServiceImpl extends Service implements ResourceBas
|
|||
return getResourceBasicInfoMapper().update(resourceItemPO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SearchConditionGroup> getItemClassForm(Map<String, Object> params) {
|
||||
String id = Util.null2String(params.get("fid"));
|
||||
List<SearchConditionItem> selectItems = new ArrayList<>();
|
||||
List<SearchConditionGroup> addGroups = new ArrayList<>();
|
||||
SearchConditionItem fNo = OrganizationFormItemUtil.inputItem(user, 2, 17, 3, 50, "编号", "fno");
|
||||
fNo.setRules("required|string");
|
||||
SearchConditionItem fName = OrganizationFormItemUtil.inputItem(user, 2, 17, 3, 50, "名称", "fname");
|
||||
fName.setRules("required|string");
|
||||
SearchConditionItem fMemo = OrganizationFormItemUtil.textareaItem(user, 2, 17, true, 2, 60, "说明", "fmemo");
|
||||
|
||||
if (StringUtils.isNotBlank(id)) {
|
||||
ResourceItemClassPO resourceItemClassPO = getResourceBasicInfoMapper().getResourceItemClassByFid(Integer.parseInt(id));
|
||||
OrganizationAssert.notNull(resourceItemClassPO, "选择的数据不存在");
|
||||
fNo.setValue(resourceItemClassPO.getFno());
|
||||
fNo.setViewAttr(1);
|
||||
fName.setValue(resourceItemClassPO.getFname());
|
||||
fMemo.setValue(resourceItemClassPO.getFmemo());
|
||||
}
|
||||
selectItems.add(fNo);
|
||||
selectItems.add(fName);
|
||||
selectItems.add(fMemo);
|
||||
addGroups.add(new SearchConditionGroup("基本信息", true, selectItems));
|
||||
return addGroups;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int saveResourceItemClass(ResourceItemClassPO itemClassPO) {
|
||||
List<ResourceItemClassPO> list = getResourceBasicInfoMapper().selectItemClassByFNo(itemClassPO.getFno(), null);
|
||||
OrganizationAssert.isEmpty(list, "编号不允许重复");
|
||||
itemClassPO.setCreator((long) user.getUID());
|
||||
itemClassPO.setCreateTime(new Date());
|
||||
return getResourceBasicInfoMapper().saveResourceItemClass(itemClassPO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateResourceItemClass(ResourceItemClassPO itemClassPO) {
|
||||
itemClassPO.setUpdateTime(new Date());
|
||||
return getResourceBasicInfoMapper().updateResourceItemClass(itemClassPO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteResourceItemClass(Integer fid) {
|
||||
OrganizationAssert.notNull(fid, "选择的数据不存在");
|
||||
// 判断该分类下是否有数据
|
||||
List<ResourceItemPO> itemByClassId = getResourceBasicInfoMapper().getItemByClassId(fid);
|
||||
OrganizationAssert.isTrue(CollectionUtils.isEmpty(itemByClassId), "当前分类已被禁用,无法删除");
|
||||
return getResourceBasicInfoMapper().deleteResourceItemClass(fid);
|
||||
}
|
||||
|
||||
private String buildSqlWhere(Map<String, Object> params) {
|
||||
DBType dbType = DBType.get(new RecordSet().getDBType());
|
||||
String sqlWhere = " where 1 = 1 ";
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package com.engine.organization.web;
|
|||
import com.engine.common.util.ParamUtil;
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.organization.entity.DeleteParam;
|
||||
import com.engine.organization.entity.hrmresource.po.ResourceItemClassPO;
|
||||
import com.engine.organization.entity.hrmresource.po.ResourceItemPO;
|
||||
import com.engine.organization.util.response.ReturnResult;
|
||||
import com.engine.organization.wrapper.ResourceBasicInfoWrapper;
|
||||
|
|
@ -29,7 +30,7 @@ import java.util.Map;
|
|||
public class ResourceBasicInfoController {
|
||||
|
||||
private ResourceBasicInfoWrapper getResourceBasicInfoWrapper(User user) {
|
||||
return ServiceUtil.getService(ResourceBasicInfoWrapper.class,user);
|
||||
return ServiceUtil.getService(ResourceBasicInfoWrapper.class, user);
|
||||
}
|
||||
|
||||
@GET
|
||||
|
|
@ -134,5 +135,53 @@ public class ResourceBasicInfoController {
|
|||
}
|
||||
}
|
||||
|
||||
@GET
|
||||
@Path("/getItemClassForm")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public ReturnResult getItemClassForm(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
try {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
Map<String, Object> map = ParamUtil.request2Map(request);
|
||||
return ReturnResult.successed(getResourceBasicInfoWrapper(user).getItemClassForm(map));
|
||||
} catch (Exception e) {
|
||||
return ReturnResult.exceptionHandle(e);
|
||||
}
|
||||
}
|
||||
|
||||
@POST
|
||||
@Path("/saveResourceItemClass")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public ReturnResult saveResourceItemClass(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody ResourceItemClassPO resourceItemClassPO) {
|
||||
try {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return ReturnResult.successed(getResourceBasicInfoWrapper(user).saveResourceItemClass(resourceItemClassPO));
|
||||
} catch (Exception e) {
|
||||
return ReturnResult.exceptionHandle(e);
|
||||
}
|
||||
}
|
||||
|
||||
@POST
|
||||
@Path("/updateResourceItemClass")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public ReturnResult updateResourceItemClass(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody ResourceItemClassPO resourceItemClassPO) {
|
||||
try {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return ReturnResult.successed(getResourceBasicInfoWrapper(user).updateResourceItemClass(resourceItemClassPO));
|
||||
} catch (Exception e) {
|
||||
return ReturnResult.exceptionHandle(e);
|
||||
}
|
||||
}
|
||||
|
||||
@POST
|
||||
@Path("/deleteResourceItemClass")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public ReturnResult deleteResourceItemClass(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody Integer fid) {
|
||||
try {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return ReturnResult.successed(getResourceBasicInfoWrapper(user).deleteResourceItemClass(fid));
|
||||
} catch (Exception e) {
|
||||
return ReturnResult.exceptionHandle(e);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import com.api.browser.bean.SearchConditionGroup;
|
|||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.organization.annotation.Log;
|
||||
import com.engine.organization.entity.fieldset.vo.TypeTreeVO;
|
||||
import com.engine.organization.entity.hrmresource.po.ResourceItemClassPO;
|
||||
import com.engine.organization.entity.hrmresource.po.ResourceItemPO;
|
||||
import com.engine.organization.enums.DeleteTypeEnum;
|
||||
import com.engine.organization.enums.LogModuleNameEnum;
|
||||
|
|
@ -27,16 +28,16 @@ import java.util.*;
|
|||
**/
|
||||
public class ResourceBasicInfoWrapper extends OrganizationWrapper {
|
||||
|
||||
private ResourceBasicInfoService getResourceBasicInfoService(User user){
|
||||
return ServiceUtil.getService(ResourceBasicInfoServiceImpl.class,user);
|
||||
private ResourceBasicInfoService getResourceBasicInfoService(User user) {
|
||||
return ServiceUtil.getService(ResourceBasicInfoServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private ResourceBasicInfoMapper getResourceBasicInfoMapper() {
|
||||
return MapperProxyFactory.getProxy(ResourceBasicInfoMapper.class);
|
||||
}
|
||||
|
||||
public Map<String, Object> getResourceBasicInfo(Map<String, Object> params) {
|
||||
return getResourceBasicInfoService(user).listPage(params);
|
||||
public Map<String, Object> getResourceBasicInfo(Map<String, Object> params) {
|
||||
return getResourceBasicInfoService(user).listPage(params);
|
||||
}
|
||||
|
||||
public List<TypeTreeVO> getTreeData() {
|
||||
|
|
@ -75,7 +76,8 @@ public class ResourceBasicInfoWrapper extends OrganizationWrapper {
|
|||
List<ResourceItemPO> resourceItemPOS = getResourceBasicInfoMapper().selectItemByIds(ids);
|
||||
int result = getResourceBasicInfoService(user).deletByIds(ids);
|
||||
for (ResourceItemPO resourceItemPO : resourceItemPOS) {
|
||||
writeOperateLog(new Object() {}.getClass(),resourceItemPO.getFname(), JSON.toJSONString(ids),"删除人员信息资料");
|
||||
writeOperateLog(new Object() {
|
||||
}.getClass(), resourceItemPO.getFname(), JSON.toJSONString(ids), "删除人员信息资料");
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
|
@ -86,7 +88,8 @@ public class ResourceBasicInfoWrapper extends OrganizationWrapper {
|
|||
List<ResourceItemPO> resourceItemPOS = getResourceBasicInfoMapper().selectItemByIds(ids);
|
||||
int result = getResourceBasicInfoService(user).recoverByIds(ids);
|
||||
for (ResourceItemPO resourceItemPO : resourceItemPOS) {
|
||||
writeOperateLog(new Object() {}.getClass(),resourceItemPO.getFname(), JSON.toJSONString(ids),"恢复人员信息资料");
|
||||
writeOperateLog(new Object() {
|
||||
}.getClass(), resourceItemPO.getFname(), JSON.toJSONString(ids), "恢复人员信息资料");
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
|
@ -94,10 +97,11 @@ public class ResourceBasicInfoWrapper extends OrganizationWrapper {
|
|||
@Log(operateType = OperateTypeEnum.ADD, operateModule = LogModuleNameEnum.RESOURCE, operateDesc = "新增人员信息资料")
|
||||
public int save(ResourceItemPO resourceItemPO) {
|
||||
resourceItemPO.setCreateTime(new Date());
|
||||
resourceItemPO.setCreator((long)user.getUID());
|
||||
resourceItemPO.setCreator((long) user.getUID());
|
||||
resourceItemPO.setFdelete(DeleteTypeEnum.NOT_DELETED.getValue());
|
||||
int result = getResourceBasicInfoService(user).save(resourceItemPO);
|
||||
writeOperateLog(new Object() {}.getClass(),resourceItemPO.getFname(),JSON.toJSONString(resourceItemPO),"新增人员信息资料");
|
||||
writeOperateLog(new Object() {
|
||||
}.getClass(), resourceItemPO.getFname(), JSON.toJSONString(resourceItemPO), "新增人员信息资料");
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
@ -106,8 +110,41 @@ public class ResourceBasicInfoWrapper extends OrganizationWrapper {
|
|||
resourceItemPO.setUpdateTime(new Date());
|
||||
ResourceItemPO resourceItem = getResourceBasicInfoService(user).selectById(resourceItemPO.getFid());
|
||||
int result = getResourceBasicInfoService(user).update(resourceItemPO);
|
||||
writeOperateLog(new Object() {}.getClass(),resourceItem.getFname(),JSON.toJSONString(resourceItemPO),resourceItem,
|
||||
writeOperateLog(new Object() {
|
||||
}.getClass(), resourceItem.getFname(), JSON.toJSONString(resourceItemPO), resourceItem,
|
||||
getResourceBasicInfoService(user).selectById(resourceItemPO.getFid()));
|
||||
return result;
|
||||
}
|
||||
|
||||
public List<SearchConditionGroup> getItemClassForm(Map<String, Object> params) {
|
||||
return getResourceBasicInfoService(user).getItemClassForm(params);
|
||||
}
|
||||
|
||||
@Log(operateType = OperateTypeEnum.ADD, operateModule = LogModuleNameEnum.RESOURCE, operateDesc = "新增人员信息分类")
|
||||
public int saveResourceItemClass(ResourceItemClassPO resourceItemClassPO) {
|
||||
int result = getResourceBasicInfoService(user).saveResourceItemClass(resourceItemClassPO);
|
||||
writeOperateLog(new Object() {
|
||||
}.getClass(), resourceItemClassPO.getFname(), JSON.toJSONString(resourceItemClassPO), "新增人员信息分类");
|
||||
return result;
|
||||
}
|
||||
|
||||
@Log(operateType = OperateTypeEnum.UPDATE, operateModule = LogModuleNameEnum.RESOURCE, operateDesc = "更新人员信息分类")
|
||||
public int updateResourceItemClass(ResourceItemClassPO resourceItemClassPO) {
|
||||
ResourceItemClassPO resourceItemClass = getResourceBasicInfoMapper().getResourceItemClassByFid(resourceItemClassPO.getFid());
|
||||
int result = getResourceBasicInfoService(user).updateResourceItemClass(resourceItemClassPO);
|
||||
writeOperateLog(new Object() {
|
||||
}.getClass(), resourceItemClassPO.getFname(), JSON.toJSONString(resourceItemClassPO), resourceItemClass,
|
||||
getResourceBasicInfoMapper().getResourceItemClassByFid(resourceItemClassPO.getFid()));
|
||||
return result;
|
||||
}
|
||||
|
||||
@Log(operateType = OperateTypeEnum.DELETE, operateModule = LogModuleNameEnum.RESOURCE, operateDesc = "删除人员信息分类")
|
||||
public int deleteResourceItemClass(Integer fid) {
|
||||
ResourceItemClassPO resourceItemClass = getResourceBasicInfoMapper().getResourceItemClassByFid(fid);
|
||||
int result = getResourceBasicInfoService(user).deleteResourceItemClass(fid);
|
||||
writeOperateLog(new Object() {
|
||||
}.getClass(), resourceItemClass.getFname(), JSON.toJSONString(fid), "删除人员信息分类");
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue