|
|
|
@ -13,6 +13,7 @@ import com.hxgk.lowcode.mapper.CustomerFormViewMapper; |
|
|
|
import com.hxgk.lowcode.mapper.FieldRecordMapper; |
|
|
|
import com.hxgk.lowcode.model.entity.*; |
|
|
|
import com.hxgk.lowcode.service.CustomerFormService; |
|
|
|
import com.hxgk.lowcode.service.HrService; |
|
|
|
import com.hxgk.lowcode.service.SystemRoleService; |
|
|
|
import com.hxgk.lowcode.service.UserService; |
|
|
|
import com.hxgk.lowcode.utils.HttpUtils; |
|
|
|
@ -38,6 +39,9 @@ public class CustomerFormServiceImpl implements CustomerFormService { |
|
|
|
@Autowired |
|
|
|
private FieldRecordMapper fieldRecordMapper; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private HrService hrService; |
|
|
|
|
|
|
|
@Override |
|
|
|
//根据用户权限查询表单列表
|
|
|
|
public Tree getCustomerFormList(String key, String token) { |
|
|
|
@ -742,6 +746,7 @@ public class CustomerFormServiceImpl implements CustomerFormService { |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private ArrayList<CustomerFormTableSingleFieldValue> addToReturnSortedDataTitleList(ArrayList<HashMap<String, String>> ids, ArrayList<CustomerFormTableSingleFieldValue> toReturnSortedDataTitleList) { |
|
|
|
ArrayList<CustomerFormTableSingleFieldValue> list = new ArrayList<>(); |
|
|
|
//toReturnSortedDataTitleList中缺少的asfMasterId的map
|
|
|
|
@ -793,4 +798,49 @@ public class CustomerFormServiceImpl implements CustomerFormService { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public Boolean queryIfOrgOrPersonContainsCurrentUser(String key, String token, String targetOrgOrPerson, String condition, String 当前用户) { |
|
|
|
//获取用户信息 从redis中根据userkey和usertoken拿到userdetail
|
|
|
|
Map<String,String> keytokenmap = new HashMap<>(); |
|
|
|
keytokenmap.put("userkey",key); |
|
|
|
keytokenmap.put("usertoken",token); |
|
|
|
UserDetail userDetail = userService.getUserDetailFromRedis(keytokenmap); |
|
|
|
|
|
|
|
String[] targetOrgOrPersonArr = targetOrgOrPerson.split(":"); |
|
|
|
Tree orgAndManTree = hrService.getOrgAndManTree(); |
|
|
|
if(condition.equals("==")){ |
|
|
|
if(targetOrgOrPersonArr[1].equals(userDetail.getWmKey().toString())){ |
|
|
|
return true; |
|
|
|
}else{ |
|
|
|
return false; |
|
|
|
} |
|
|
|
}else if(condition.equals("!=")){ |
|
|
|
if(!targetOrgOrPersonArr[1].equals(userDetail.getWmKey().toString())){ |
|
|
|
return true; |
|
|
|
}else{ |
|
|
|
return false; |
|
|
|
} |
|
|
|
}else{ |
|
|
|
//条件设置的组织机构人员范围
|
|
|
|
List<String> ancestorIds = orgAndManTree.getAncestorIds(targetOrgOrPersonArr[1]); |
|
|
|
//人员所在地主部门
|
|
|
|
if(userDetail.getMaindeparment().toString().equals(targetOrgOrPersonArr[1])){ |
|
|
|
return true; |
|
|
|
}else{ |
|
|
|
int count = 0; |
|
|
|
for(String id : ancestorIds){ |
|
|
|
if(id.equals(targetOrgOrPersonArr[1])){ |
|
|
|
count++; |
|
|
|
} |
|
|
|
} |
|
|
|
if(count > 0){ |
|
|
|
return true; |
|
|
|
}else{ |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|