|
|
@ -10,13 +10,14 @@ import com.engine.core.impl.Service;
|
|
|
|
import com.engine.hrm.entity.FieldSelectOptionBean;
|
|
|
|
import com.engine.hrm.entity.FieldSelectOptionBean;
|
|
|
|
import com.engine.organization.entity.DeleteParam;
|
|
|
|
import com.engine.organization.entity.DeleteParam;
|
|
|
|
import com.engine.organization.entity.SelectOptionParam;
|
|
|
|
import com.engine.organization.entity.SelectOptionParam;
|
|
|
|
import com.engine.organization.entity.company.po.CompPO;
|
|
|
|
|
|
|
|
import com.engine.organization.entity.extend.param.ExtendInfoParams;
|
|
|
|
import com.engine.organization.entity.extend.param.ExtendInfoParams;
|
|
|
|
import com.engine.organization.entity.extend.po.ExtendInfoPO;
|
|
|
|
import com.engine.organization.entity.extend.po.ExtendInfoPO;
|
|
|
|
import com.engine.organization.entity.hrmresource.param.HrmResourceImportParam;
|
|
|
|
import com.engine.organization.entity.hrmresource.param.HrmResourceImportParam;
|
|
|
|
import com.engine.organization.mapper.comp.CompMapper;
|
|
|
|
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.extend.ExtMapper;
|
|
|
|
import com.engine.organization.mapper.extend.ExtendInfoMapper;
|
|
|
|
import com.engine.organization.mapper.extend.ExtendInfoMapper;
|
|
|
|
|
|
|
|
import com.engine.organization.mapper.job.JobMapper;
|
|
|
|
import com.engine.organization.service.ImportCommonService;
|
|
|
|
import com.engine.organization.service.ImportCommonService;
|
|
|
|
import com.engine.organization.util.OrganizationAssert;
|
|
|
|
import com.engine.organization.util.OrganizationAssert;
|
|
|
|
import com.engine.organization.util.db.MapperProxyFactory;
|
|
|
|
import com.engine.organization.util.db.MapperProxyFactory;
|
|
|
@ -182,7 +183,7 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|
|
|
jsonObject.put("name", item.getFieldNameDesc());
|
|
|
|
jsonObject.put("name", item.getFieldNameDesc());
|
|
|
|
return jsonObject;
|
|
|
|
return jsonObject;
|
|
|
|
}).collect(Collectors.toList());
|
|
|
|
}).collect(Collectors.toList());
|
|
|
|
List<Long> selectedKeys = infoPOList.stream().filter(item -> 0 == item.getIsSystemDefault()).map(ExtendInfoPO::getId).collect(Collectors.toList());
|
|
|
|
List<Long> selectedKeys = infoPOList.stream().filter(item -> (!exculdeFields.contains(item.getFieldName()) && 0 == item.getIsSystemDefault())).map(ExtendInfoPO::getId).collect(Collectors.toList());
|
|
|
|
returnMaps.put("data", fieldDatas);
|
|
|
|
returnMaps.put("data", fieldDatas);
|
|
|
|
returnMaps.put("selectedKeys", selectedKeys);
|
|
|
|
returnMaps.put("selectedKeys", selectedKeys);
|
|
|
|
return returnMaps;
|
|
|
|
return returnMaps;
|
|
|
@ -402,14 +403,23 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|
|
|
break nextRow;
|
|
|
|
break nextRow;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
map.put(infoPO.getFieldName(), reallyValue);
|
|
|
|
map.put(infoPO.getFieldName(), reallyValue);
|
|
|
|
// TODO 自动编号
|
|
|
|
String compNo = (String) map.get("comp_no");
|
|
|
|
if ("add".equals(operateType)) {
|
|
|
|
if ("add".equals(operateType)) {
|
|
|
|
|
|
|
|
// 自动编号
|
|
|
|
|
|
|
|
compNo = CompServiceImpl.repeatDetermine(compNo);
|
|
|
|
|
|
|
|
map.put("comp_no", compNo);
|
|
|
|
MapperProxyFactory.getProxy(ExtMapper.class).insertExt(ExtendInfoParams.builder().tableName("JCL_ORG_COMP").params(map).build());
|
|
|
|
MapperProxyFactory.getProxy(ExtMapper.class).insertExt(ExtendInfoParams.builder().tableName("JCL_ORG_COMP").params(map).build());
|
|
|
|
} else if ("update".equals(operateType)) {
|
|
|
|
} else if ("update".equals(operateType)) {
|
|
|
|
String compNo = (String) map.get("comp_no");
|
|
|
|
|
|
|
|
// 查询对应ID
|
|
|
|
// 查询对应ID
|
|
|
|
if (StringUtils.isNotBlank(compNo)) {
|
|
|
|
if (StringUtils.isNotBlank(compNo)) {
|
|
|
|
List<CompPO> compPOS = MapperProxyFactory.getProxy(CompMapper.class).listByNo(compNo);
|
|
|
|
if (checkRepeatNo(compNo, extendType, null)) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
errMsg.add(compNo + "编号已存在");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
errMsg.add("编号为空,更新失败");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -506,20 +516,22 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|
|
|
* 校验重复编号
|
|
|
|
* 校验重复编号
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @param no
|
|
|
|
* @param no
|
|
|
|
* @param tableName
|
|
|
|
* @param extendType
|
|
|
|
* @param id
|
|
|
|
* @param id
|
|
|
|
* @return
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
private boolean checkRepeatNo(String no, String tableName, Long id) {
|
|
|
|
private boolean checkRepeatNo(String no, Long extendType, Long id) {
|
|
|
|
if (StringUtils.isBlank(no)) {
|
|
|
|
if (StringUtils.isBlank(no)) {
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (StringUtils.isNotBlank(tableName)) {
|
|
|
|
if (null != extendType) {
|
|
|
|
switch (tableName) {
|
|
|
|
switch (extendType.toString()) {
|
|
|
|
case "JCL_ORG_COMP":
|
|
|
|
case "1":
|
|
|
|
return 0 == MapperProxyFactory.getProxy(CompMapper.class).checkRepeatNo(no, id);
|
|
|
|
return 0 == MapperProxyFactory.getProxy(CompMapper.class).checkRepeatNo(no, id);
|
|
|
|
case "JCL_ORG_DEPT":
|
|
|
|
case "2":
|
|
|
|
case "JCL_ORG_JOB":
|
|
|
|
return 0 == MapperProxyFactory.getProxy(DepartmentMapper.class).checkRepeatNo(no, id);
|
|
|
|
|
|
|
|
case "3":
|
|
|
|
|
|
|
|
return 0 == MapperProxyFactory.getProxy(JobMapper.class).checkRepeatNo(no, id);
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|