|
|
|
@ -14,12 +14,14 @@ import com.engine.organization.component.OrganizationWeaTable;
|
|
|
|
|
import com.engine.organization.entity.department.bo.DepartmentBO;
|
|
|
|
|
import com.engine.organization.entity.department.dto.DepartmentListDTO;
|
|
|
|
|
import com.engine.organization.entity.department.po.DepartmentPO;
|
|
|
|
|
import com.engine.organization.entity.hrmresource.po.JclOrgCustomTemplatePO;
|
|
|
|
|
import com.engine.organization.entity.hrmresource.po.SearchTemplatePO;
|
|
|
|
|
import com.engine.organization.entity.hrmresource.vo.HrmResourceVO;
|
|
|
|
|
import com.engine.organization.entity.staff.po.StaffPO;
|
|
|
|
|
import com.engine.organization.entity.staff.vo.StaffTableVO;
|
|
|
|
|
import com.engine.organization.mapper.department.DepartmentMapper;
|
|
|
|
|
import com.engine.organization.mapper.resource.HrmResourceMapper;
|
|
|
|
|
import com.engine.organization.mapper.resource.JclOrgCustomTemplateMapper;
|
|
|
|
|
import com.engine.organization.mapper.resource.ResourceMapper;
|
|
|
|
|
import com.engine.organization.mapper.staff.StaffMapper;
|
|
|
|
|
import com.engine.organization.mapper.staff.StaffPlanMapper;
|
|
|
|
@ -141,18 +143,31 @@ public class ExportCommonServiceImpl extends Service implements ExportCommonServ
|
|
|
|
|
HrmResourceServiceImpl hrmResourceService = ServiceUtil.getService(HrmResourceServiceImpl.class,user);
|
|
|
|
|
List<SearchConditionGroup> allConditions = hrmResourceService.getAllConditions();
|
|
|
|
|
|
|
|
|
|
List<String> columnList;
|
|
|
|
|
JclOrgCustomTemplatePO jclOrgCustomTemplatePO = MapperProxyFactory.getProxy(JclOrgCustomTemplateMapper.class).queryIsusedTemp("1", String.valueOf(user.getUID()));
|
|
|
|
|
|
|
|
|
|
// 查询当前台账定制列
|
|
|
|
|
SearchTemplatePO usedCustomTemplate = MapperProxyFactory.getProxy(HrmResourceMapper.class).getUsedCustomTemplateByUser(user.getUID());
|
|
|
|
|
if (null == usedCustomTemplate) {
|
|
|
|
|
// 默认列定制
|
|
|
|
|
String selectKeys = "-1_hrm_lastname,-1_hrm_departmentid,-1_hrm_jobtitle,-1_hrm_mobile,-1_hrm_telephone,-1_hrm_managerid";
|
|
|
|
|
columnList = Arrays.asList(selectKeys.split(","));
|
|
|
|
|
//2.是否存在通用模板
|
|
|
|
|
if (null == jclOrgCustomTemplatePO) {
|
|
|
|
|
jclOrgCustomTemplatePO = MapperProxyFactory.getProxy(JclOrgCustomTemplateMapper.class).queryOverAll();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
String columns = "";
|
|
|
|
|
if (jclOrgCustomTemplatePO != null) {
|
|
|
|
|
if (org.apache.commons.lang3.StringUtils.isNotBlank(jclOrgCustomTemplatePO.getBasicFields())) {
|
|
|
|
|
columns = jclOrgCustomTemplatePO.getBasicFields();
|
|
|
|
|
}
|
|
|
|
|
if (org.apache.commons.lang3.StringUtils.isNotBlank(jclOrgCustomTemplatePO.getPersonalFields())) {
|
|
|
|
|
columns = columns + "," + jclOrgCustomTemplatePO.getPersonalFields();
|
|
|
|
|
}
|
|
|
|
|
if (org.apache.commons.lang3.StringUtils.isNotBlank(jclOrgCustomTemplatePO.getWorkFields())) {
|
|
|
|
|
columns = columns + "," + jclOrgCustomTemplatePO.getWorkFields();
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
columnList = hrmResourceService.getSelectKeys(usedCustomTemplate);
|
|
|
|
|
//初次使用,无模板初始值
|
|
|
|
|
columns = "-1_hrm_lastname,-1_hrm_departmentid,-1_hrm_subcompanyid1,-1_hrm_jobtitle,-1_hrm_mobile,-1_hrm_telephone,-1_hrm_managerid,-1_hrm_sporder";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
List<String> columnList = Arrays.asList(columns.split(","));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
BigDecimal decimal = new BigDecimal(100 / columnList.size());
|
|
|
|
@ -168,7 +183,8 @@ public class ExportCommonServiceImpl extends Service implements ExportCommonServ
|
|
|
|
|
weaTableColumn.setText(MapperProxyFactory.getProxy(HrmResourceMapper.class).queryLabelName(fieldName, scopeId, user.getLanguage()));
|
|
|
|
|
weaTableColumn.setColumn(hrmResourceService.buildTableSql(columnName).replace(".", "_"));
|
|
|
|
|
weaTableColumn.setDisplay(columnList.contains(columnName) ? WeaBoolAttr.TRUE : WeaBoolAttr.FALSE);
|
|
|
|
|
weaTableColumn.setTransmethod("com.engine.organization.transmethod.HrmResourceTransMethod.getFieldTrueValue");
|
|
|
|
|
// 导出专用转换,去除html标签
|
|
|
|
|
weaTableColumn.setTransmethod("com.engine.organization.transmethod.HrmResourceTransMethod.getFieldTrueValueExp");
|
|
|
|
|
weaTableColumn.setOtherpara(columnName);
|
|
|
|
|
weaTableColumn.setWidth(decimal.setScale(2, RoundingMode.HALF_UP).doubleValue() + "%");
|
|
|
|
|
if (weaTableColumn.getDisplay().getBoolVal()) {
|
|
|
|
|