package com.engine.organization.service.impl; import com.engine.common.service.HrmCommonService; import com.engine.common.service.impl.HrmCommonServiceImpl; import com.engine.core.impl.Service; import com.engine.organization.entity.personnelcard.*; import com.engine.organization.entity.personnelcard.po.CardAccessPO; import com.engine.organization.entity.personnelcard.po.CardButtonPO; import com.engine.organization.entity.personnelcard.po.CusTreeFormPO; import com.engine.organization.exception.OrganizationRunTimeException; import com.engine.organization.mapper.personnelcard.CardAccessMapper; import com.engine.organization.mapper.personnelcard.CardButtonMapper; import com.engine.organization.mapper.personnelcard.PersonnelCardMapper; import com.engine.organization.service.HrmPersonnelCardService; import com.engine.organization.util.OrganizationAssert; import com.engine.organization.util.db.MapperProxyFactory; import com.engine.portal.biz.constants.ModuleConstants; import com.engine.portal.biz.nonstandardfunction.SysModuleInfoBiz; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.json.JSONObject; import weaver.blog.BlogShareManager; import weaver.cowork.CoworkShareManager; import weaver.crm.CrmShareBase; import weaver.docs.search.DocSearchComInfo; import weaver.general.BaseBean; import weaver.general.Util; import weaver.hrm.definedfield.HrmFieldManager; import weaver.hrm.resource.ResourceComInfo; import weaver.systeminfo.SystemEnv; import weaver.workflow.search.WorkflowRequestUtil; import java.util.*; /** * @author:dxfeng * @createTime: 2022/10/08 * @version: 1.0 */ public class HrmPersonnelCardServiceImpl extends Service implements HrmPersonnelCardService { private PersonnelCardMapper getPersonnelCardMapper() { return MapperProxyFactory.getProxy(PersonnelCardMapper.class); } private CardButtonMapper getCardButtonMapper() { return MapperProxyFactory.getProxy(CardButtonMapper.class); } @Override public Map getPersonnelCard(Long uId) { Map resultMap = new HashMap<>(); UserCard userInfo; if (null == uId) { uId = (long) user.getUID(); } userInfo = getPersonnelCardMapper().getUserById(uId); userInfo.setEcId(uId.toString()); OrganizationAssert.notNull(uId, "未找到对应数据"); // 人员基本信息 // 统计报表 Statistical statistical = getStatistical(userInfo.getEcId()); // 获取类型分组信息 List cusTreeForms = getPersonnelCardMapper().getCusTreeForms(0); cusTreeForms.removeIf(item -> !hasGroupAccess(item.getId(), userInfo.getEcId())); List formItemList = new ArrayList<>(); try { for (CusTreeFormPO cusTreeForm : cusTreeForms) { FormItem formItem = getFormItem(cusTreeForm, uId); if (CollectionUtils.isEmpty(formItem.getItems())) { continue; } //TODO 明细表暂不处理 //List> detailList = ServiceUtil.getService(ExtServiceImpl.class, user).getExtendTables(user, "4", groupPO.getId(), "JCL_ORG_HRMRESOURCEEXT_DT1", uId, 1, false); //formItem.setTables(detailList); formItemList.add(formItem); } } catch (Exception e) { throw new RuntimeException(e); } // 所有锚点 List anchorList = new ArrayList<>(); // 添加字段分组信息 for (FormItem formItem : formItemList) { anchorList.add(Anchor.builder().id(formItem.getId()).title(formItem.getTitle()).build()); } // 添加拓展页面信息 List resourceBaseTabList = getPersonnelCardMapper().getResourceBaseTabList(); for (ResourceBaseTab resourceBaseTab : resourceBaseTabList) { anchorList.add(Anchor.builder().id("tab" + resourceBaseTab.getId()).title(resourceBaseTab.getGroupName()).build()); } resultMap.put("buttons", getButtonList(userInfo.getEcId())); resultMap.put("user", userInfo); resultMap.put("statistical", statistical); resultMap.put("formItems", formItemList); resultMap.put("anchorList", anchorList); resultMap.put("iframeList", getIframeList()); return resultMap; } @Override public List