BUG修复
This commit is contained in:
parent
ca66929235
commit
b494a6a96e
|
|
@ -114,4 +114,6 @@ public interface FieldDefinedService {
|
|||
* @param param
|
||||
*/
|
||||
void changeGroup(ExtendInfoChangeParam param);
|
||||
|
||||
Map<String, Object> getHasRight(ModuleTypeEnum moduleTypeEnum);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -232,26 +232,6 @@ public class FieldDefinedServiceImpl extends Service implements FieldDefinedServ
|
|||
Map<String, Object> returnMap = new HashMap<>();
|
||||
Long groupType = param.getGroupType();
|
||||
ExtendGroupPO extendGroupPO = getExtendGroupMapper().getGroupById(groupType);
|
||||
String rightName = "";
|
||||
switch (extendGroupPO.getExtendType()) {
|
||||
case 1:
|
||||
rightName = "CompanyField:All";
|
||||
break;
|
||||
case 2:
|
||||
rightName = "DepartmentField:All";
|
||||
break;
|
||||
case 3:
|
||||
rightName = "PostField:All";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
boolean hasRight = HasRightUtil.hasRight(user, rightName, true);
|
||||
returnMap.put("hasRight", hasRight);
|
||||
if (!hasRight) {
|
||||
return returnMap;
|
||||
}
|
||||
|
||||
List<Map<String, Object>> lsFieldInfo = new ArrayList<>();
|
||||
Map<String, Object> fieldInfo;
|
||||
Map<String, Object> recordInfo;
|
||||
|
|
@ -541,6 +521,28 @@ public class FieldDefinedServiceImpl extends Service implements FieldDefinedServ
|
|||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getHasRight(ModuleTypeEnum moduleTypeEnum) {
|
||||
Map<String, Object> btnDatas = new HashMap<>();
|
||||
String rightName = "";
|
||||
switch (moduleTypeEnum.getValue().toString()) {
|
||||
case "1":
|
||||
rightName = "CompanyField:All";
|
||||
break;
|
||||
case "2":
|
||||
rightName = "DepartmentField:All";
|
||||
break;
|
||||
case "3":
|
||||
rightName = "PostField:All";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
boolean hasRight = StringUtils.isNotBlank(rightName) && HasRightUtil.hasRight(user, rightName, true);
|
||||
btnDatas.put("hasRight", hasRight);
|
||||
return btnDatas;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除数据及表结构
|
||||
*
|
||||
|
|
|
|||
|
|
@ -59,6 +59,40 @@ public class CusFieldDataTrigger {
|
|||
MapperProxyFactory.getProxy(SystemDataMapper.class).insertCusFieldData(directionData);
|
||||
}
|
||||
|
||||
// field100002更新
|
||||
if (StringUtils.isNotBlank(sourceField100002) && !sourceField100002.equals(directionData.getField100002())) {
|
||||
directionData.setField100002(sourceField100002);
|
||||
Long gwId = Long.parseLong(sourceField100002);
|
||||
JobPO jobById = MapperProxyFactory.getProxy(JobMapper.class).getJobById(gwId);
|
||||
RecordInfo hrmJobTitleByName = MapperProxyFactory.getProxy(SystemDataMapper.class).getHrmJobTitleByName(jobById.getJobName());
|
||||
Long ecGwId = StringUtils.isNotBlank(hrmJobTitleByName.getId()) ? Long.parseLong(hrmJobTitleByName.getId()) : null;
|
||||
Long ecBmId = jobById.getEcDepartment();
|
||||
Long ecGsId = jobById.getEcCompany();
|
||||
Map<String, Object> hrmResourceMap = new HashMap<>();
|
||||
// 岗位
|
||||
hrmResourceMap.put("jobtitle", ecGwId);
|
||||
// 部门
|
||||
hrmResourceMap.put("departmentid", ecBmId);
|
||||
// 公司
|
||||
hrmResourceMap.put("subcompanyid1", ecGsId);
|
||||
MapperProxyFactory.getProxy(ExtMapper.class).updateTable(ExtendInfoParams.builder().id(id).tableName("hrmresource").params(hrmResourceMap).build());
|
||||
updateFlag = true;
|
||||
|
||||
if(StringUtils.isBlank(sourceField100001)){
|
||||
// 拼接Field100001字段,岗位序列A职级A职等
|
||||
if(null!=jobById.getSequenceId()){
|
||||
sourceField100001 += "_" + jobById.getSequenceId();
|
||||
}
|
||||
if(null!=jobById.getGradeId()){
|
||||
sourceField100001 += "A" + jobById.getGradeId();
|
||||
}
|
||||
if(null!=jobById.getLevelId()){
|
||||
sourceField100001 += "A" + jobById.getLevelId().split(",")[0];
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// field100001更新,职等职级
|
||||
if (null != sourceField100001 && sourceField100001.split("A").length == 3 && !sourceField100001.equals(directionData.getField100001())) {
|
||||
directionData.setField100001(sourceField100001);
|
||||
|
|
@ -82,25 +116,6 @@ public class CusFieldDataTrigger {
|
|||
updateFlag = true;
|
||||
}
|
||||
|
||||
// field100002更新
|
||||
if (StringUtils.isNotBlank(sourceField100002) && !sourceField100002.equals(directionData.getField100002())) {
|
||||
directionData.setField100002(sourceField100002);
|
||||
Long gwId = Long.parseLong(sourceField100002);
|
||||
JobPO jobById = MapperProxyFactory.getProxy(JobMapper.class).getJobById(gwId);
|
||||
RecordInfo hrmJobTitleByName = MapperProxyFactory.getProxy(SystemDataMapper.class).getHrmJobTitleByName(jobById.getJobName());
|
||||
Long ecGwId = StringUtils.isNotBlank(hrmJobTitleByName.getId()) ? Long.parseLong(hrmJobTitleByName.getId()) : null;
|
||||
Long ecBmId = jobById.getEcDepartment();
|
||||
Long ecGsId = jobById.getEcCompany();
|
||||
Map<String, Object> hrmResourceMap = new HashMap<>();
|
||||
// 岗位
|
||||
hrmResourceMap.put("jobtitle", ecGwId);
|
||||
// 部门
|
||||
hrmResourceMap.put("departmentid", ecBmId);
|
||||
// 公司
|
||||
hrmResourceMap.put("subcompanyid1", ecGsId);
|
||||
MapperProxyFactory.getProxy(ExtMapper.class).updateTable(ExtendInfoParams.builder().id(id).tableName("hrmresource").params(hrmResourceMap).build());
|
||||
updateFlag = true;
|
||||
}
|
||||
|
||||
if (null != sourceField100003 && sourceField100003.split("_").length == 2 && !sourceField100003.equals(directionData.getField100003())) {
|
||||
directionData.setField100003(sourceField100003);
|
||||
|
|
|
|||
|
|
@ -1591,7 +1591,7 @@ public class HrmImportProcessE9 extends BaseBean {
|
|||
recordSet.setNoAutoEncrypt(true);
|
||||
boolean execute = recordSet.execute(sql);
|
||||
// 更新聚才林相关字段
|
||||
new CusFieldDataTrigger().run((long) id);
|
||||
CusFieldDataTrigger.run((long) id);
|
||||
return execute;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -203,4 +203,16 @@ public class FieldDefinedController {
|
|||
return ReturnResult.exceptionHandle(e);
|
||||
}
|
||||
}
|
||||
|
||||
@GET
|
||||
@Path("/{moduleTypeEnum}/getHasRight")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public ReturnResult getHasRight(@Context HttpServletRequest request, @Context HttpServletResponse response, @PathParam("moduleTypeEnum") ModuleTypeEnum moduleTypeEnum) {
|
||||
try {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return ReturnResult.successed(getFieldDefinedWrapper(user).getHasRight(moduleTypeEnum));
|
||||
} catch (Exception e) {
|
||||
return ReturnResult.exceptionHandle(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -101,4 +101,8 @@ public class FieldDefinedWrapper extends Service {
|
|||
public void changeGroup(ExtendInfoChangeParam param) {
|
||||
getFieldDefinedService(user).changeGroup(param);
|
||||
}
|
||||
|
||||
public Map<String, Object> getHasRight(ModuleTypeEnum moduleTypeEnum) {
|
||||
return getFieldDefinedService(user).getHasRight(moduleTypeEnum);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue