commit
b50aaead23
|
|
@ -34,6 +34,14 @@ public interface ResourceBasicInfoMapper {
|
|||
|
||||
int recoverByIds(@Param("ids") Collection<Long> ids);
|
||||
|
||||
/**
|
||||
* delete语句,删除人员信息
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
int deleteItemByIds(@Param("ids") Collection<Integer> ids);
|
||||
|
||||
List<ResourceItemPO> selectItemByFNo(@Param("fno") String fno, @Param("fclassid") Integer fclassid);
|
||||
|
||||
int insertIgnoreNull(ResourceItemPO resourceItemPO);
|
||||
|
|
@ -50,6 +58,6 @@ public interface ResourceBasicInfoMapper {
|
|||
|
||||
int deleteResourceItemClass(@Param("fid") Integer fid);
|
||||
|
||||
List<ResourceItemPO> getItemByClassId(@Param("fclassid") Integer fclassid);
|
||||
List<ResourceItemPO> getItemByClassId(@Param("fclassid") Integer fclassid, @Param("fdelete") Integer fdelete);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -250,16 +250,19 @@
|
|||
</select>
|
||||
<select id="getItemByClassId" resultMap="ItemResultMap">
|
||||
select fid,
|
||||
fclassid,
|
||||
fno,
|
||||
fname,
|
||||
fmemo,
|
||||
fdelete,
|
||||
creator,
|
||||
create_time,
|
||||
update_time
|
||||
fclassid,
|
||||
fno,
|
||||
fname,
|
||||
fmemo,
|
||||
fdelete,
|
||||
creator,
|
||||
create_time,
|
||||
update_time
|
||||
from jcl_org_item
|
||||
where fclassid = #{fclassid}
|
||||
<if test="fdelete!=null">
|
||||
and fdelete = #{fdelete}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<update id="updateResourceItemClass">
|
||||
|
|
@ -277,4 +280,12 @@
|
|||
from jcl_org_itemclass
|
||||
where fid = #{fid}
|
||||
</delete>
|
||||
<delete id="deleteItemByIds">
|
||||
delete
|
||||
from jcl_org_item
|
||||
where fid IN
|
||||
<foreach collection="ids" open="(" item="id" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
|
|
@ -105,7 +105,7 @@ public class ResourceBasicInfoServiceImpl extends Service implements ResourceBas
|
|||
ResourceItemPO resourceItemPO = getResourceBasicInfoMapper().getResourceItemByFid(Integer.parseInt(id));
|
||||
OrganizationAssert.notNull(resourceItemPO, "选择的数据不存在");
|
||||
BrowserBean browserBean = resourceTypeItem.getBrowserConditionParam();
|
||||
List<Map<String, Object>> maps = getResourceBasicInfoMapper().browserDatas(DeleteParam.builder().ids(resourceItemPO.getFid().toString()).build().getIds());
|
||||
List<Map<String, Object>> maps = getResourceBasicInfoMapper().browserDatas(DeleteParam.builder().ids(resourceItemPO.getFclassid().toString()).build().getIds());
|
||||
browserBean.setReplaceDatas(maps);
|
||||
resourceTypeItem.setBrowserConditionParam(browserBean);
|
||||
|
||||
|
|
@ -197,8 +197,13 @@ public class ResourceBasicInfoServiceImpl extends Service implements ResourceBas
|
|||
public int deleteResourceItemClass(Integer fid) {
|
||||
OrganizationAssert.notNull(fid, "选择的数据不存在");
|
||||
// 判断该分类下是否有数据
|
||||
List<ResourceItemPO> itemByClassId = getResourceBasicInfoMapper().getItemByClassId(fid);
|
||||
OrganizationAssert.isTrue(CollectionUtils.isEmpty(itemByClassId), "当前分类已被禁用,无法删除");
|
||||
List<ResourceItemPO> itemByClassId = getResourceBasicInfoMapper().getItemByClassId(fid, 0);
|
||||
OrganizationAssert.isTrue(CollectionUtils.isEmpty(itemByClassId), "当前分类下存在数据,无法删除");
|
||||
List<ResourceItemPO> deleteItems = getResourceBasicInfoMapper().getItemByClassId(fid, 1);
|
||||
// 级联删除已停用数据
|
||||
if (CollectionUtils.isNotEmpty(deleteItems)) {
|
||||
getResourceBasicInfoMapper().deleteItemByIds((deleteItems.stream().map(ResourceItemPO::getFid).collect(Collectors.toList())));
|
||||
}
|
||||
return getResourceBasicInfoMapper().deleteResourceItemClass(fid);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -11,7 +11,6 @@ import com.engine.organization.enums.LogModuleNameEnum;
|
|||
import com.engine.organization.enums.OperateTypeEnum;
|
||||
import com.engine.organization.mapper.comp.CompMapper;
|
||||
import com.engine.organization.mapper.department.DepartmentMapper;
|
||||
import com.engine.organization.mapper.extend.ExtMapper;
|
||||
import com.engine.organization.mapper.hrmresource.SystemDataMapper;
|
||||
import com.engine.organization.mapper.job.JobMapper;
|
||||
import com.engine.organization.util.OrganizationAssert;
|
||||
|
|
@ -42,20 +41,10 @@ public class OrganizationSyncEc {
|
|||
Map<String, Object> resultMap;
|
||||
private boolean throwException = true;
|
||||
|
||||
private static final String HRM_COMPANY = "hrmsubcompany";
|
||||
private static final String HRM_DEPARTMENT = "hrmdepartment";
|
||||
|
||||
private static final String JCL_COMPANY = "jcl_org_comp";
|
||||
private static final String JCL_DEPARTMENT = "jcl_org_dept";
|
||||
|
||||
private SystemDataMapper getSystemDataMapper() {
|
||||
return MapperProxyFactory.getProxy(SystemDataMapper.class);
|
||||
}
|
||||
|
||||
private ExtMapper getExtMapper() {
|
||||
return MapperProxyFactory.getProxy(ExtMapper.class);
|
||||
}
|
||||
|
||||
public OrganizationSyncEc(User user, LogModuleNameEnum moduleName, OperateTypeEnum operateType, Map<String, Object> params) {
|
||||
this.moduleName = moduleName;
|
||||
this.operateType = operateType;
|
||||
|
|
@ -93,7 +82,9 @@ public class OrganizationSyncEc {
|
|||
default:
|
||||
break;
|
||||
}
|
||||
OrganizationAssert.isTrue(throwException && ("1".equals(Util.null2String(resultMap.get("status"))) || "1".equals(Util.null2String(resultMap.get("sign")))), Util.null2String(resultMap.get("message")));
|
||||
if (throwException) {
|
||||
OrganizationAssert.isTrue("1".equals(Util.null2String(resultMap.get("status"))) || "1".equals(Util.null2String(resultMap.get("sign"))), Util.null2String(resultMap.get("message")));
|
||||
}
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
|
|
@ -224,7 +215,6 @@ public class OrganizationSyncEc {
|
|||
List<Long> hrmResourceIds = getSystemDataMapper().getHrmResourceIds(oldJobPO.getParentDept(), oldHrmJobTitle.getId());
|
||||
getSystemDataMapper().updateResourceJobTitleByIds(Util.null2String(hrmJobTitle.getId()), hrmResourceIds);
|
||||
// 封存原名称岗位
|
||||
map.clear();
|
||||
map.put("ids", oldHrmJobTitle.getId());
|
||||
map.put("canceled", "canceled");
|
||||
this.resultMap = ServiceUtil.getService(HrmJobServiceImpl.class, user).doCanceled(map, user);
|
||||
|
|
|
|||
Loading…
Reference in New Issue