Merge pull request '部门导入BUG修复' (#112) from feature/dxf into develop
Reviewed-on: http://221.226.25.34:3000/liang.cheng/weaver-hrm-organization/pulls/112
This commit is contained in:
commit
a19c2f2f26
|
|
@ -16,7 +16,6 @@ import com.engine.organization.entity.scheme.po.GradePO;
|
|||
import com.engine.organization.entity.scheme.po.LevelPO;
|
||||
import com.engine.organization.entity.scheme.po.SchemePO;
|
||||
import com.engine.organization.enums.OrgImportEnum;
|
||||
import com.engine.organization.mapper.employee.EmployeeMapper;
|
||||
import com.engine.organization.mapper.extend.ExtendInfoMapper;
|
||||
import com.engine.organization.mapper.jclimport.ImportMapper;
|
||||
import com.engine.organization.mapper.jclimport.JclImportHistoryDetailMapper;
|
||||
|
|
@ -874,44 +873,8 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* 判断表头是否正确
|
||||
*
|
||||
* @param historyDetailPO
|
||||
* @param cellValue
|
||||
* @param infoPOList
|
||||
* @return
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* 判断负责人是否有重名人员、若有重复人员、给出反馈信息。不处理该条数据
|
||||
*
|
||||
* @param historyDetailPO
|
||||
* @param cellValue
|
||||
* @return
|
||||
*/
|
||||
private boolean hasSameName(JclImportHistoryDetailPO historyDetailPO, String cellValue) {
|
||||
String operateDetail = "";
|
||||
if (StringUtils.isBlank(cellValue)) {
|
||||
return false;
|
||||
}
|
||||
List<Long> resourceIds = MapperProxyFactory.getProxy(EmployeeMapper.class).getResourceIdsByName(cellValue);
|
||||
if (CollectionUtils.isEmpty(resourceIds)) {
|
||||
operateDetail = "[" + cellValue + "]未找到对应人员";
|
||||
}
|
||||
if (resourceIds.size() > 1) {
|
||||
operateDetail = "[" + cellValue + "]查询到多个人员,请在导入完成后自行执行该负责人";
|
||||
}
|
||||
if (StringUtils.isNotBlank(operateDetail)) {
|
||||
historyDetailPO.setOperateDetail(operateDetail);
|
||||
historyDetailPO.setStatus("0");
|
||||
OrgImportUtil.saveImportDetailLog(historyDetailPO);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断所选关键字段是否查出多条数据
|
||||
*
|
||||
|
|
|
|||
|
|
@ -124,6 +124,9 @@ public class DepartmentImport {
|
|||
value += SystemEnv.getHtmlLabelName(28576, user.getLanguage());
|
||||
item.put("link", templatePath);
|
||||
}
|
||||
if(3==i){
|
||||
value = value.replace("及显示顺序","");
|
||||
}
|
||||
item.put("value", value);
|
||||
itemList.add(item);
|
||||
}
|
||||
|
|
@ -194,6 +197,10 @@ public class DepartmentImport {
|
|||
OrgImportUtil.saveImportDetailLog(historyDetailPO);
|
||||
continue nextRow;
|
||||
}
|
||||
// 人员导入校验
|
||||
if ("3".equals(infoPO.getFieldHtmlType()) && ("1".equals(infoPO.getType()) || "17".equals(infoPO.getType())) && OrgImportUtil.hasSameName(historyDetailPO, cellValue)) {
|
||||
continue nextRow;
|
||||
}
|
||||
|
||||
Object reallyValue;
|
||||
try {
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import com.engine.organization.entity.SelectOptionParam;
|
|||
import com.engine.organization.entity.extend.po.ExtendInfoPO;
|
||||
import com.engine.organization.entity.jclimport.po.JclImportHistoryDetailPO;
|
||||
import com.engine.organization.entity.jclimport.po.JclImportHistoryPO;
|
||||
import com.engine.organization.mapper.employee.EmployeeMapper;
|
||||
import com.engine.organization.mapper.jclimport.JclImportHistoryDetailMapper;
|
||||
import com.engine.organization.mapper.jclimport.JclImportHistoryMapper;
|
||||
import com.engine.organization.util.OrganizationAssert;
|
||||
|
|
@ -184,4 +185,35 @@ public class OrgImportUtil {
|
|||
public static boolean isThrowError(Map<String, Object> resultMap) {
|
||||
return "1".equals(Util.null2String(resultMap.get("status"))) || "1".equals(Util.null2String(resultMap.get("sign")));
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断负责人是否有重名人员、若有重复人员、给出反馈信息。不处理该条数据
|
||||
*
|
||||
* @param historyDetailPO
|
||||
* @param cellValue
|
||||
* @return
|
||||
*/
|
||||
public static boolean hasSameName(JclImportHistoryDetailPO historyDetailPO, String cellValue) {
|
||||
String operateDetail = "";
|
||||
if (StringUtils.isBlank(cellValue)) {
|
||||
return false;
|
||||
}
|
||||
String[] split = cellValue.split(",");
|
||||
for (String s : split) {
|
||||
List<Long> resourceIds = MapperProxyFactory.getProxy(EmployeeMapper.class).getResourceIdsByName(s);
|
||||
if (CollectionUtils.isEmpty(resourceIds)) {
|
||||
operateDetail = "[" + s + "]未找到对应人员";
|
||||
}
|
||||
if (resourceIds.size() > 1) {
|
||||
operateDetail = "[" + s + "]查询到多个人员";
|
||||
}
|
||||
if (StringUtils.isNotBlank(operateDetail)) {
|
||||
historyDetailPO.setOperateDetail(operateDetail);
|
||||
historyDetailPO.setStatus("0");
|
||||
OrgImportUtil.saveImportDetailLog(historyDetailPO);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue